(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [1886],
  {
    21929: (e, t, n) => {
      'use strict';
      n.d(t, { F: () => c, S: () => u }), n(74569);
      var r = n(76506),
        i = n(71331),
        s = n(40267),
        o = n(85674),
        a = n(32422);
      class u {
        constructor(e, t) {
          (this._mask = 0), (this._buf = e), (this._mask = t);
        }
        static fromBuffer(e, t) {
          return new u(e, t);
        }
        static create(e, t = 4294967295) {
          const n = new Uint32Array(Math.ceil(e / 32));
          return new u(n, t);
        }
        _getIndex(e) {
          return Math.floor(e / 32);
        }
        has(e) {
          const t = this._mask & e;
          return !!(this._buf[this._getIndex(t)] & (1 << t % 32));
        }
        hasRange(e, t) {
          let n = e,
            r = t;
          for (; n % 32 && n !== r; ) {
            if (this.has(n)) return !0;
            n++;
          }
          for (; r % 32 && n !== r; ) {
            if (this.has(n)) return !0;
            r--;
          }
          if (n === r) return !1;
          for (let e = n / 32; e !== r / 32; e++) if (this._buf[e]) return !0;
          return !1;
        }
        set(e) {
          const t = this._mask & e,
            n = this._getIndex(t),
            r = 1 << t % 32;
          this._buf[n] |= r;
        }
        setRange(e, t) {
          let n = e,
            r = t;
          for (; n % 32 && n !== r; ) this.set(n++);
          for (; r % 32 && n !== r; ) this.set(r--);
          if (n !== r) for (let e = n / 32; e !== r / 32; e++) this._buf[e] = 4294967295;
        }
        unset(e) {
          const t = this._mask & e,
            n = this._getIndex(t),
            r = 1 << t % 32;
          this._buf[n] &= 4294967295 ^ r;
        }
        resize(e) {
          const t = this._buf,
            n = new Uint32Array(Math.ceil(e / 32));
          n.set(t), (this._buf = n);
        }
        or(e) {
          for (let t = 0; t < this._buf.length; t++) this._buf[t] |= e._buf[t];
          return this;
        }
        and(e) {
          for (let t = 0; t < this._buf.length; t++) this._buf[t] &= e._buf[t];
          return this;
        }
        xor(e) {
          for (let t = 0; t < this._buf.length; t++) this._buf[t] ^= e._buf[t];
          return this;
        }
        ior(e) {
          for (let t = 0; t < this._buf.length; t++) this._buf[t] |= ~e._buf[t];
          return this;
        }
        iand(e) {
          for (let t = 0; t < this._buf.length; t++) this._buf[t] &= ~e._buf[t];
          return this;
        }
        ixor(e) {
          for (let t = 0; t < this._buf.length; t++) this._buf[t] ^= ~e._buf[t];
          return this;
        }
        any() {
          for (let e = 0; e < this._buf.length; e++) if (this._buf[e]) return !0;
          return !1;
        }
        copy(e) {
          for (let t = 0; t < this._buf.length; t++) this._buf[t] = e._buf[t];
          return this;
        }
        clone() {
          return new u(this._buf.slice(), this._mask);
        }
        clear() {
          for (let e = 0; e < this._buf.length; e++) this._buf[e] = 0;
        }
        forEachSet(e) {
          for (let t = 0; t < this._buf.length; t++) {
            let n = this._buf[t],
              r = 32 * t;
            if (n) for (; n; ) 1 & n && e(r), (n >>>= 1), r++;
          }
        }
        countSet() {
          let e = 0;
          return (
            this.forEachSet((t) => {
              e++;
            }),
            e
          );
        }
      }
      let l = 0;
      class c {
        constructor(e) {
          (this.type = 'FeatureSetReader'),
            (this.seen = !1),
            (this.instance = 0),
            (this._tx = 0),
            (this._ty = 0),
            (this._sx = 1),
            (this._sy = 1),
            (this._deleted = null),
            (this._joined = []),
            (this._objectIdToIndex = null),
            (this.instance = e);
        }
        static createInstance() {
          return l++, (l = l > 65535 ? 0 : l), l;
        }
        get isEmpty() {
          return (0, r.i)(this._deleted) && this._deleted.countSet() === this.getSize();
        }
        setArcadeSpatialReference(e) {
          this._arcadeSpatialReference = e;
        }
        attachStorage(e) {
          this._storage = e;
        }
        getQuantizationTransform() {
          throw new Error('Unable to find transform for featureSet');
        }
        getStorage() {
          return this._storage;
        }
        getComputedNumeric(e) {
          return this.getComputedNumericAtIndex(0);
        }
        setComputedNumeric(e, t) {
          return this.setComputedNumericAtIndex(t, 0);
        }
        getComputedString(e) {
          return this.getComputedStringAtIndex(0);
        }
        setComputedString(e, t) {
          return this.setComputedStringAtIndex(0, t);
        }
        getComputedNumericAtIndex(e) {
          return this._storage.getComputedNumericAtIndex(this.getDisplayId(), e);
        }
        setComputedNumericAtIndex(e, t) {
          this._storage.setComputedNumericAtIndex(this.getDisplayId(), e, t);
        }
        getComputedStringAtIndex(e) {
          return this._storage.getComputedStringAtIndex(this.getDisplayId(), e);
        }
        setComputedStringAtIndex(e, t) {
          return this._storage.setComputedStringAtIndex(this.getDisplayId(), e, t);
        }
        transform(e, t, n, r) {
          const i = this.copy();
          return (i._tx += e), (i._ty += t), (i._sx *= n), (i._sy *= r), i;
        }
        readAttribute(e, t = !1) {
          const n = this._readAttribute(e, t);
          if (void 0 !== n) return n;
          for (const n of this._joined) {
            n.setIndex(this.getIndex());
            const r = n._readAttribute(e, t);
            if (void 0 !== r) return r;
          }
        }
        readAttributes() {
          const e = this._readAttributes();
          for (const t of this._joined) {
            t.setIndex(this.getIndex());
            const n = t._readAttributes();
            for (const t of Object.keys(n)) e[t] = n[t];
          }
          return e;
        }
        joinAttributes(e) {
          this._joined.push(e);
        }
        readArcadeFeature() {
          return this;
        }
        geometry() {
          const e = this.readHydratedGeometry(),
            t = (0, s.c)(e, this.geometryType, this.hasZ, this.hasM),
            n = (0, a.im)(t);
          return n && (n.spatialReference = this._arcadeSpatialReference), n;
        }
        field(e) {
          return this.readAttribute(e, !0);
        }
        hasField(e) {
          return !0;
        }
        setField(e, t) {}
        keys() {
          return [];
        }
        castToText() {
          return '';
        }
        removeIds(e) {
          if ((0, r.b)(this._objectIdToIndex)) {
            const e = new Map(),
              t = this.getCursor();
            for (; t.next(); ) e.set(t.getObjectId(), t.getIndex());
            this._objectIdToIndex = e;
          }
          const t = this._objectIdToIndex;
          for (const n of e) t.has(n) && this.removeAtIndex(t.get(n));
        }
        removeAtIndex(e) {
          (0, r.b)(this._deleted) && (this._deleted = u.create(this.getSize())),
            this._deleted.set(e);
        }
        *features() {
          const e = this.getCursor();
          for (; e.next(); ) yield e.readOptimizedFeature();
        }
        _getExists() {
          return (0, r.b)(this._deleted) || !this._deleted.has(this.getIndex());
        }
        _computeCentroid() {
          if ('esriGeometryPolygon' !== this.geometryType) return null;
          const e = this.readUnquantizedGeometry();
          if (!e || e.hasIndeterminateRingOrder) return null;
          const t = (0, r.d)(this.getQuantizationTransform(), null);
          return (0, i.g)(new o.a(), e, this.hasM, this.hasZ, t);
        }
        copyInto(e) {
          (e.seen = this.seen),
            (e._storage = this._storage),
            (e._arcadeSpatialReference = this._arcadeSpatialReference),
            (e._joined = this._joined),
            (e._tx = this._tx),
            (e._ty = this._ty),
            (e._sx = this._sx),
            (e._sy = this._sy),
            (e._deleted = this._deleted),
            (e._objectIdToIndex = this._objectIdToIndex);
        }
      }
    },
    85674: (e, t, n) => {
      'use strict';
      n.d(t, { O: () => i, a: () => r });
      class r {
        constructor(e = [], t = [], n = !1) {
          (this.lengths = null != e ? e : []),
            (this.coords = null != t ? t : []),
            (this.hasIndeterminateRingOrder = n);
        }
        get isPoint() {
          return 0 === this.lengths.length;
        }
        forEachVertex(e) {
          let t = 0;
          this.lengths.length || e(this.coords[0], this.coords[1]);
          for (let n = 0; n < this.lengths.length; n++) {
            const r = this.lengths[n];
            for (let n = 0; n < r; n++) e(this.coords[2 * (n + t)], this.coords[2 * (n + t) + 1]);
            t += r;
          }
        }
        clone() {
          return new r(this.lengths.slice(), this.coords.slice(), this.hasIndeterminateRingOrder);
        }
      }
      class i {
        constructor(e = null, t = {}, n, r) {
          (this.displayId = 0),
            (this.geohashX = 0),
            (this.geohashY = 0),
            (this.geometry = e),
            t && (this.attributes = t),
            n && (this.centroid = n),
            null != r && (this.objectId = r);
        }
        get hasGeometry() {
          return !(!this.geometry || !this.geometry.coords || !this.geometry.coords.length);
        }
        weakClone() {
          const e = new i(this.geometry, this.attributes, this.centroid, this.objectId);
          return (
            (e.displayId = this.displayId),
            (e.geohashX = this.geohashX),
            (e.geohashY = this.geohashY),
            e
          );
        }
      }
    },
    9006: (e, t, n) => {
      'use strict';
      n.d(t, { O: () => r });
      class r {
        constructor() {
          (this.objectIdFieldName = null),
            (this.globalIdFieldName = null),
            (this.geohashFieldName = null),
            (this.geometryProperties = null),
            (this.geometryType = null),
            (this.spatialReference = null),
            (this.hasZ = !1),
            (this.hasM = !1),
            (this.features = []),
            (this.fields = []),
            (this.transform = null),
            (this.exceededTransferLimit = !1),
            (this.uniqueIdField = null),
            (this.queryGeometryType = null),
            (this.queryGeometry = null);
        }
        weakClone() {
          const e = new r();
          return (
            (e.objectIdFieldName = this.objectIdFieldName),
            (e.globalIdFieldName = this.globalIdFieldName),
            (e.geohashFieldName = this.geohashFieldName),
            (e.geometryProperties = this.geometryProperties),
            (e.geometryType = this.geometryType),
            (e.spatialReference = this.spatialReference),
            (e.hasZ = this.hasZ),
            (e.hasM = this.hasM),
            (e.features = this.features),
            (e.fields = this.fields),
            (e.transform = this.transform),
            (e.exceededTransferLimit = this.exceededTransferLimit),
            (e.uniqueIdField = this.uniqueIdField),
            (e.queryGeometry = this.queryGeometry),
            (e.queryGeometryType = this.queryGeometryType),
            e
          );
        }
      }
    },
    1886: (e, t, n) => {
      'use strict';
      n.r(t),
        n.d(t, {
          $: () => kt,
          A: () => Z,
          B: () => M,
          C: () => oe,
          D: () => _e,
          E: () => ee,
          F: () => A,
          G: () => Ne,
          H: () => ce,
          I: () => T,
          J: () => w,
          K: () => C,
          L: () => H,
          M: () => Be,
          N: () => I,
          O: () => Oe,
          P: () => Y,
          Q: () => De,
          R: () => v,
          S: () => zt,
          T: () => Lt,
          U: () => U,
          V: () => Ee,
          W: () => Zt,
          X: () => xe,
          Y: () => Ae,
          Z: () => le,
          _: () => vt,
          a: () => Ft,
          a0: () => Ye,
          a1: () => Ie,
          a2: () => Re,
          a3: () => Se,
          a4: () => Fe,
          a5: () => Ve,
          a6: () => We,
          a7: () => Xe,
          a8: () => be,
          a9: () => Ue,
          aa: () => Pe,
          ab: () => Ge,
          ac: () => Ze,
          ad: () => je,
          ae: () => Me,
          af: () => qe,
          ag: () => ze,
          ah: () => we,
          ai: () => R,
          aj: () => Kt,
          ak: () => Gt,
          al: () => pe,
          am: () => fe,
          an: () => de,
          ao: () => ie,
          ap: () => He,
          aq: () => Ss,
          b: () => Pn,
          c: () => Jt,
          d: () => Ut,
          e: () => Qt,
          f: () => te,
          g: () => tt,
          h: () => O,
          i: () => G,
          j: () => B,
          k: () => ct,
          l: () => dt,
          m: () => ut,
          n: () => lt,
          o: () => yt,
          p: () => J,
          q: () => mt,
          r: () => xt,
          s: () => Je,
          t: () => ne,
          u: () => j,
          v: () => _,
          w: () => L,
          x: () => q,
          y: () => Ke,
          z: () => V,
        });
      var r = n(91597),
        i = n(50406),
        s = n(21801),
        o = n(73796),
        a = n(84069),
        u = n(44567),
        l = n(92896),
        c = n(56240),
        h = n(76506),
        f = n(32422),
        d = n(97546),
        p = n(40267),
        m = n(88762),
        g = n(60947),
        D = n(21929),
        y = n(92228),
        E = n(52228);
      class x {
        constructor(e = []) {
          this._elements = e;
        }
        length() {
          return this._elements.length;
        }
        get(e) {
          return this._elements[e];
        }
        toArray() {
          const e = [];
          for (let t = 0; t < this.length(); t++) e.push(this.get(t));
          return e;
        }
      }
      class A {
        constructor(e, t) {
          (this.definition = null),
            (this.context = null),
            (this.definition = e),
            (this.context = t);
        }
      }
      class w extends x {
        constructor(e, t, n, r, i, s) {
          super(e),
            (this._lazyPt = []),
            (this._hasZ = !1),
            (this._hasM = !1),
            (this._spRef = t),
            (this._hasZ = n),
            (this._hasM = r),
            (this._cacheId = i),
            (this._partId = s);
        }
        get(e) {
          if (void 0 === this._lazyPt[e]) {
            const t = this._elements[e];
            if (void 0 === t) return;
            const n = this._hasZ,
              i = this._hasM;
            let s = null;
            (s =
              n && !i
                ? new r.Z(t[0], t[1], t[2], void 0, this._spRef)
                : i && !n
                ? new r.Z(t[0], t[1], void 0, t[2], this._spRef)
                : n && i
                ? new r.Z(t[0], t[1], t[2], t[3], this._spRef)
                : new r.Z(t[0], t[1], this._spRef)),
              (s.cache._arcadeCacheId =
                this._cacheId.toString() + '-' + this._partId.toString() + '-' + e.toString()),
              (this._lazyPt[e] = s);
          }
          return this._lazyPt[e];
        }
        equalityTest(e) {
          return (
            e === this ||
            (null !== e && e instanceof w != 0 && e.getUniqueHash() === this.getUniqueHash())
          );
        }
        getUniqueHash() {
          return this._cacheId.toString() + '-' + this._partId.toString();
        }
      }
      class C extends x {
        constructor(e, t, n, r, i) {
          super(e),
            (this._lazyPath = []),
            (this._hasZ = !1),
            (this._hasM = !1),
            (this._hasZ = n),
            (this._hasM = r),
            (this._spRef = t),
            (this._cacheId = i);
        }
        get(e) {
          if (void 0 === this._lazyPath[e]) {
            const t = this._elements[e];
            if (void 0 === t) return;
            this._lazyPath[e] = new w(t, this._spRef, this._hasZ, this._hasM, this._cacheId, e);
          }
          return this._lazyPath[e];
        }
        equalityTest(e) {
          return (
            e === this ||
            (null !== e && e instanceof C != 0 && e.getUniqueHash() === this.getUniqueHash())
          );
        }
        getUniqueHash() {
          return this._cacheId.toString();
        }
      }
      class F {
        constructor(e) {
          this.value = e;
        }
      }
      class b {
        constructor(e) {
          this.value = e;
        }
      }
      class N {
        constructor(e) {
          this.fn = e;
        }
      }
      class S {
        constructor(e) {
          this.fn = e;
        }
      }
      const I = N,
        T = b,
        v = F,
        k = S,
        _ = { type: 'VOID' },
        O = { type: 'BREAK' },
        B = { type: 'CONTINUE' };
      function R(e, t, n) {
        return '' === t || null == t || t === n || t === n ? e : (e = e.split(t).join(n));
      }
      function M(e) {
        return e instanceof N || e instanceof A || e instanceof S;
      }
      function P(e) {
        return !!(L(e) || Z(e) || H(e) || G(e) || null === e || e === _ || 'number' == typeof e);
      }
      function U(e, t) {
        return void 0 === e ? t : e;
      }
      function L(e) {
        return 'string' == typeof e || e instanceof String;
      }
      function G(e) {
        return 'boolean' == typeof e;
      }
      function Z(e) {
        return 'number' == typeof e;
      }
      function z(e) {
        return 'number' == typeof e && isFinite(e) && Math.floor(e) === e;
      }
      function j(e) {
        return e instanceof Array;
      }
      function V(e) {
        return (
          !0 ===
          (e &&
            e.declaredRootClass &&
            'esri.arcade.featureset.support.FeatureSet' === e.declaredRootClass)
        );
      }
      function Y(e) {
        return (
          !0 ===
          (e && e.declaredRootClass && 'esri.arcade.featureSetCollection' === e.declaredRootClass)
        );
      }
      function q(e) {
        return e instanceof x;
      }
      function H(e) {
        return e instanceof Date;
      }
      function J(e, t, n) {
        if (e.length < t || e.length > n)
          throw new Error('Function called with wrong number of Parameters');
      }
      function X() {
        let e = new Date().getTime();
        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (t) {
          const n = (e + 16 * Math.random()) % 16 | 0;
          return (e = Math.floor(e / 16)), ('x' === t ? n : (3 & n) | 8).toString(16);
        });
      }
      function W(e, t) {
        return !1 === isNaN(e)
          ? null == t || '' === t
            ? e.toString()
            : ((t = R(t, '‰', '')), (t = R(t, '¤', '')), (0, c.f)(e, { pattern: t }))
          : e.toString();
      }
      function K(e, t) {
        const n = be.Moment(e);
        return null == t || '' === t ? n.format() : n.format($(t));
      }
      function $(e) {
        return e.replace(/(LTS)|L|l/g, function (e) {
          return '[' + e + ']';
        });
      }
      function Q(e, t, n) {
        switch (n) {
          case '>':
            return e > t;
          case '<':
            return e < t;
          case '>=':
            return e >= t;
          case '<=':
            return e <= t;
        }
        return !1;
      }
      function ee(e, t, n) {
        if (null === e) {
          if (null === t || t === _) return Q(null, null, n);
          if (Z(t)) return Q(0, t, n);
          if (L(t)) return Q(0, oe(t), n);
          if (G(t)) return Q(0, oe(t), n);
          if (H(t)) return Q(0, t.getTime(), n);
        }
        if (e === _) {
          if (null === t || t === _) return Q(null, null, n);
          if (Z(t)) return Q(0, t, n);
          if (L(t)) return Q(0, oe(t), n);
          if (G(t)) return Q(0, oe(t), n);
          if (H(t)) return Q(0, t.getTime(), n);
        } else if (Z(e)) {
          if (Z(t)) return Q(e, t, n);
          if (G(t)) return Q(e, oe(t), n);
          if (null === t || t === _) return Q(e, 0, n);
          if (L(t)) return Q(e, oe(t), n);
          if (H(t)) return Q(e, t.getTime(), n);
        } else if (L(e)) {
          if (L(t)) return Q(ne(e), ne(t), n);
          if (H(t)) return Q(oe(e), t.getTime(), n);
          if (Z(t)) return Q(oe(e), t, n);
          if (null === t || t === _) return Q(oe(e), 0, n);
          if (G(t)) return Q(oe(e), oe(t), n);
        } else if (H(e)) {
          if (H(t)) return Q(e, t, n);
          if (null === t || t === _) return Q(e.getTime(), 0, n);
          if (Z(t)) return Q(e.getTime(), t, n);
          if (G(t)) return Q(e.getTime(), oe(t), n);
          if (L(t)) return Q(e.getTime(), oe(t), n);
        } else if (G(e)) {
          if (G(t)) return Q(e, t, n);
          if (Z(t)) return Q(oe(e), oe(t), n);
          if (H(t)) return Q(oe(e), t.getTime(), n);
          if (null === t || t === _) return Q(oe(e), 0, n);
          if (L(t)) return Q(oe(e), oe(t), n);
        }
        return !!te(e, t) && ('<=' === n || '>=' === n);
      }
      function te(e, t) {
        if (e === t) return !0;
        if ((null === e && t === _) || (null === t && e === _)) return !0;
        if (H(e) && H(t)) return e.getTime() === t.getTime();
        if (e instanceof C) return e.equalityTest(t);
        if (e instanceof w) return e.equalityTest(t);
        if (e instanceof r.Z && t instanceof r.Z) {
          const n = e.cache._arcadeCacheId,
            r = t.cache._arcadeCacheId;
          if (null != n) return n === r;
        }
        if (
          void 0 !== e &&
          void 0 !== t &&
          null !== e &&
          null !== t &&
          'object' == typeof e &&
          'object' == typeof t
        ) {
          if (
            e._arcadeCacheId === t._arcadeCacheId &&
            void 0 !== e._arcadeCacheId &&
            null !== e._arcadeCacheId
          )
            return !0;
          if (
            e._underlyingGraphic === t._underlyingGraphic &&
            void 0 !== e._underlyingGraphic &&
            null !== e._underlyingGraphic
          )
            return !0;
        }
        return !1;
      }
      function ne(e, t) {
        if (L(e)) return e;
        if (null === e) return '';
        if (Z(e)) return W(e, t);
        if (G(e)) return e.toString();
        if (H(e)) return K(e, t);
        if (e instanceof o.Z) return JSON.stringify(e.toJSON());
        if (j(e)) {
          const t = [];
          for (let n = 0; n < e.length; n++) t[n] = se(e[n]);
          return '[' + t.join(',') + ']';
        }
        if (e instanceof x) {
          const t = [];
          for (let n = 0; n < e.length(); n++) t[n] = se(e.get(n));
          return '[' + t.join(',') + ']';
        }
        return null !== e && 'object' == typeof e && void 0 !== e.castToText
          ? e.castToText()
          : M(e)
          ? 'object, Function'
          : '';
      }
      function re(e) {
        const t = [];
        if (!1 === j(e)) return null;
        if (e instanceof x) {
          for (let n = 0; n < e.length(); n++) t[n] = oe(e.get(n));
          return t;
        }
        for (let n = 0; n < e.length; n++) t[n] = oe(e[n]);
        return t;
      }
      function ie(e, t) {
        if (L(e)) return e;
        if (null === e) return '';
        if (Z(e)) return W(e, t);
        if (G(e)) return e.toString();
        if (H(e)) return K(e, t);
        if (e instanceof o.Z)
          return e instanceof s.Z
            ? '{"xmin":' +
                e.xmin.toString() +
                ',"ymin":' +
                e.ymin.toString() +
                ',' +
                (e.hasZ ? '"zmin":' + e.zmin.toString() + ',' : '') +
                (e.hasM ? '"mmin":' + e.mmin.toString() + ',' : '') +
                '"xmax":' +
                e.xmax.toString() +
                ',"ymax":' +
                e.ymax.toString() +
                ',' +
                (e.hasZ ? '"zmax":' + e.zmax.toString() + ',' : '') +
                (e.hasM ? '"mmax":' + e.mmax.toString() + ',' : '') +
                '"spatialReference":' +
                ge(e.spatialReference) +
                '}'
            : ge(e.toJSON(), (e, t) =>
                e.key === t.key
                  ? 0
                  : 'spatialReference' === e.key
                  ? 1
                  : 'spatialReference' === t.key || e.key < t.key
                  ? -1
                  : e.key > t.key
                  ? 1
                  : 0,
              );
        if (j(e)) {
          const t = [];
          for (let n = 0; n < e.length; n++) t[n] = se(e[n]);
          return '[' + t.join(',') + ']';
        }
        if (e instanceof x) {
          const t = [];
          for (let n = 0; n < e.length(); n++) t[n] = se(e.get(n));
          return '[' + t.join(',') + ']';
        }
        return null !== e && 'object' == typeof e && void 0 !== e.castToText
          ? e.castToText()
          : M(e)
          ? 'object, Function'
          : '';
      }
      function se(e) {
        if (null === e) return 'null';
        if (G(e) || Z(e) || L(e)) return JSON.stringify(e);
        if (e instanceof o.Z) return ie(e);
        if (e instanceof x) return ie(e);
        if (e instanceof Array) return ie(e);
        if (e instanceof Date) return JSON.stringify(K(e, ''));
        if (null !== e && 'object' == typeof e) {
          if (void 0 !== e.castToText) return e.castToText();
        } else if (e === _) return 'null';
        return 'null';
      }
      function oe(e, t) {
        return Z(e)
          ? e
          : null === e || '' === e
          ? 0
          : H(e)
          ? NaN
          : G(e)
          ? e
            ? 1
            : 0
          : j(e) || '' === e || void 0 === e
          ? NaN
          : void 0 !== t && L(e)
          ? ((t = R(t, '‰', '')), (t = R(t, '¤', '')), (0, c.p)(e, { pattern: t }))
          : e === _
          ? 0
          : Number(e);
      }
      function ae(e, t) {
        if (H(e)) return e;
        if (L(e)) {
          const n = be.Moment(e, [null == t || '' === t ? be.Moment.ISO_8601 : t]);
          if (n.isValid()) return n.toDate();
        }
        return null;
      }
      function ue(e, t) {
        if (H(e)) return be.Moment(e);
        if (L(e)) {
          const n = be.Moment(e, [null == t || '' === t ? be.Moment.ISO_8601 : t]);
          if (n.isValid()) return n;
        }
        return null;
      }
      function le(e) {
        return G(e) ? e : L(e) ? 'true' === (e = e.toLowerCase()) : !!Z(e) && 0 !== e && !isNaN(e);
      }
      function ce(e, t) {
        return (0, h.b)(e)
          ? null
          : ((null !== e.spatialReference && void 0 !== e.spatialReference) ||
              (e.spatialReference = t),
            e);
      }
      function he(e) {
        if (null === e) return null;
        if (e instanceof r.Z) return 'NaN' === e.x || null === e.x || isNaN(e.x) ? null : e;
        if (e instanceof u.Z) {
          if (0 === e.rings.length) return null;
          for (const t of e.rings) if (t.length > 0) return e;
          return null;
        }
        if (e instanceof l.Z) {
          if (0 === e.paths.length) return null;
          for (const t of e.paths) if (t.length > 0) return e;
          return null;
        }
        return e instanceof a.Z
          ? 0 === e.points.length
            ? null
            : e
          : e instanceof s.Z
          ? 'NaN' === e.xmin || null === e.xmin || isNaN(e.xmin)
            ? null
            : e
          : null;
      }
      function fe(e, t) {
        if (!e) return t;
        if (!e.domain) return t;
        let n = null;
        if ('string' === e.field.type || 'esriFieldTypeString' === e.field.type) t = ne(t);
        else {
          if (null == t) return null;
          if ('' === t) return t;
          t = oe(t);
        }
        for (let r = 0; r < e.domain.codedValues.length; r++) {
          const i = e.domain.codedValues[r];
          i.code === t && (n = i);
        }
        return null === n ? t : n.name;
      }
      function de(e, t) {
        if (!e) return t;
        if (!e.domain) return t;
        let n = null;
        t = ne(t);
        for (let r = 0; r < e.domain.codedValues.length; r++) {
          const i = e.domain.codedValues[r];
          i.name === t && (n = i);
        }
        return null === n ? t : n.code;
      }
      function pe(e, t, n = null, r) {
        if (!t) return null;
        if (!t.fields) return null;
        let i,
          s,
          o = null;
        for (let n = 0; n < t.fields.length; n++) {
          const r = t.fields[n];
          r.name.toLowerCase() === e.toString().toLowerCase() && (o = r);
        }
        if (null === o) throw new Error('Field not found');
        return (
          r || (r = n && t.typeIdField && n._field(t.typeIdField)),
          null != r &&
            t.types.some(function (e) {
              return (
                e.id === r &&
                ((i = e.domains && e.domains[o.name]),
                i && 'inherited' === i.type && ((i = me(o.name, t)), (s = !0)),
                !0)
              );
            }),
          s || i || (i = me(e, t)),
          { field: o, domain: i }
        );
      }
      function me(e, t) {
        let n;
        return (
          t.fields.some(function (t) {
            return t.name.toLowerCase() === e.toLowerCase() && (n = t.domain), !!n;
          }),
          n
        );
      }
      function ge(e, t) {
        t || (t = {}), 'function' == typeof t && (t = { cmp: t });
        const n = 'boolean' == typeof t.cycles && t.cycles,
          r =
            t.cmp &&
            ((i = t.cmp),
            function (e) {
              return function (t, n) {
                const r = { key: t, value: e[t] },
                  s = { key: n, value: e[n] };
                return i(r, s);
              };
            });
        var i;
        const s = [];
        return (function e(t) {
          if ((t && t.toJSON && 'function' == typeof t.toJSON && (t = t.toJSON()), void 0 === t))
            return;
          if ('number' == typeof t) return isFinite(t) ? '' + t : 'null';
          if ('object' != typeof t) return JSON.stringify(t);
          let i, o;
          if (Array.isArray(t)) {
            for (o = '[', i = 0; i < t.length; i++) i && (o += ','), (o += e(t[i]) || 'null');
            return o + ']';
          }
          if (null === t) return 'null';
          if (-1 !== s.indexOf(t)) {
            if (n) return JSON.stringify('__cycle__');
            throw new TypeError('Converting circular structure to JSON');
          }
          const a = s.push(t) - 1,
            u = Object.keys(t).sort(r && r(t));
          for (o = '', i = 0; i < u.length; i++) {
            const n = u[i],
              r = e(t[n]);
            r && (o && (o += ','), (o += JSON.stringify(n) + ':' + r));
          }
          return s.splice(a, 1), '{' + o + '}';
        })(e);
      }
      function De(e) {
        if (null === e) return null;
        const t = [];
        for (const n of e)
          n &&
          ((n.declaredClass && 'esri.arcade.Feature' === n.declaredClass) ||
            'FeatureSetReader' === n.type)
            ? t.push(n.geometry())
            : t.push(n);
        return t;
      }
      function ye(e, t) {
        if (!(t instanceof r.Z)) throw new Error('Invalid Argument');
        e.push(t.hasZ ? (t.hasM ? [t.x, t.y, t.z, t.m] : [t.x, t.y, t.z]) : [t.x, t.y]);
      }
      function Ee(e, t) {
        if (j(e) || q(e)) {
          let n = !1,
            r = !1,
            i = [],
            s = t;
          if (j(e)) {
            for (const t of e) ye(i, t);
            i.length > 0 && ((s = e[0].spatialReference), (n = e[0].hasZ), (r = e[0].hasM));
          } else if (e instanceof w)
            (i = e._elements),
              i.length > 0 && ((n = e._hasZ), (r = e._hasM), (s = e.get(0).spatialReference));
          else {
            if (!q(e)) throw new Error('Invalid Argument');
            for (const t of e.toArray()) ye(i, t);
            i.length > 0 &&
              ((s = e.get(0).spatialReference),
              (n = !0 === e.get(0).hasZ),
              (r = !0 === e.get(0).hasM));
          }
          return 0 === i.length
            ? null
            : (!1 === (0, u.i)(i, r, n) && (i = i.slice(0).reverse()),
              new u.Z({ rings: [i], spatialReference: s, hasZ: n, hasM: r }));
        }
        return e;
      }
      function xe(e, t) {
        if (j(e) || q(e)) {
          let n = !1,
            r = !1,
            i = [],
            s = t;
          if (j(e)) {
            for (const t of e) ye(i, t);
            i.length > 0 &&
              ((s = e[0].spatialReference), (n = !0 === e[0].hasZ), (r = !0 === e[0].hasM));
          } else if (e instanceof w)
            (i = e._elements),
              i.length > 0 && ((n = e._hasZ), (r = e._hasM), (s = e.get(0).spatialReference));
          else if (q(e)) {
            for (const t of e.toArray()) ye(i, t);
            i.length > 0 &&
              ((s = e.get(0).spatialReference),
              (n = !0 === e.get(0).hasZ),
              (r = !0 === e.get(0).hasM));
          }
          return 0 === i.length
            ? null
            : new l.Z({ paths: [i], spatialReference: s, hasZ: n, hasM: r });
        }
        return e;
      }
      function Ae(e, t) {
        if (j(e) || q(e)) {
          let n = !1,
            r = !1,
            i = [],
            s = t;
          if (j(e)) {
            for (const t of e) ye(i, t);
            i.length > 0 &&
              ((s = e[0].spatialReference), (n = !0 === e[0].hasZ), (r = !0 === e[0].hasM));
          } else if (e instanceof w)
            (i = e._elements),
              i.length > 0 && ((n = e._hasZ), (r = e._hasM), (s = e.get(0).spatialReference));
          else if (q(e)) {
            for (const t of e.toArray()) ye(i, t);
            i.length > 0 &&
              ((s = e.get(0).spatialReference),
              (n = !0 === e.get(0).hasZ),
              (r = !0 === e.get(0).hasM));
          }
          return 0 === i.length
            ? null
            : new a.Z({ points: i, spatialReference: s, hasZ: n, hasM: r });
        }
        return e;
      }
      function we(e, t = !1) {
        const n = [];
        if (null === e) return n;
        if (!0 === j(e)) {
          for (let r = 0; r < e.length; r++) {
            const i = ne(e[r]);
            ('' === i && !0 !== t) || n.push(i);
          }
          return n;
        }
        if (e instanceof x) {
          for (let r = 0; r < e.length(); r++) {
            const i = ne(e.get(r));
            ('' === i && !0 !== t) || n.push(i);
          }
          return n;
        }
        if (P(e)) {
          const r = ne(e);
          return ('' === r && !0 !== t) || n.push(r), n;
        }
        return [];
      }
      let Ce = 0;
      function Fe(e) {
        return (
          Ce++,
          Ce % 100 == 0
            ? ((Ce = 0),
              (0, i.Ue)((t) => {
                setTimeout(() => {
                  t(e);
                }, 0);
              }))
            : e
        );
      }
      const be = { Moment: null };
      function Ne(e, t, n) {
        switch (n) {
          case '&':
            return e & t;
          case '|':
            return e | t;
          case '^':
            return e ^ t;
          case '<<':
            return e << t;
          case '>>':
            return e >> t;
          case '>>>':
            return e >>> t;
        }
      }
      var Se,
        Ie,
        Te,
        ve = Object.freeze({
          __proto__: null,
          ReturnResultE: F,
          ImplicitResultE: b,
          NativeFunctionE: N,
          SizzleFunctionE: S,
          NativeFunction: I,
          ImplicitResult: T,
          ReturnResult: v,
          SizzleFunction: k,
          voidOperation: _,
          breakResult: O,
          continueResult: B,
          multiReplace: R,
          isFunctionParameter: M,
          isSimpleType: P,
          defaultUndefined: U,
          isString: L,
          isBoolean: G,
          isNumber: Z,
          isInteger: z,
          isArray: j,
          isFeatureSet: V,
          isFeatureSetCollection: Y,
          isImmutableArray: q,
          isDate: H,
          pcCheck: J,
          generateUUID: X,
          formatNumber: W,
          formatDate: K,
          standardiseDateFormat: $,
          greaterThanLessThan: ee,
          equalityTest: te,
          toString: ne,
          toNumberArray: re,
          toStringExplicit: ie,
          toNumber: oe,
          toDate: ae,
          toDateM: ue,
          toBoolean: le,
          fixSpatialReference: ce,
          fixNullGeometry: he,
          getDomainValue: fe,
          getDomainCode: de,
          getDomain: pe,
          stableStringify: ge,
          autoCastFeatureToGeometry: De,
          autoCastArrayOfPointsToPolygon: Ee,
          autoCastArrayOfPointsToPolyline: xe,
          autoCastArrayOfPointsToMultiPoint: Ae,
          toStringArray: we,
          tick: Fe,
          MomentLibrary: be,
          binaryOperator: Ne,
        });
      function ke(e, t = !1) {
        let n = null;
        if (null === e);
        else if (Z(e)) n = oe(e);
        else if (G(e)) n = le(e);
        else if (L(e)) n = ne(e);
        else if (H(e)) n = ae(e);
        else if (j(e)) {
          n = [];
          for (const r of e) n.push(ke(r, t));
        } else {
          if (0 === Object.keys(e).length) return null;
          const r = new _e();
          r.immutable = !1;
          for (const n of Object.keys(e)) {
            const i = e[n];
            void 0 !== i && r.setField(n, ke(i, t));
          }
          (r.immutable = t), (n = r);
        }
        return n;
      }
      class _e {
        constructor(e) {
          (this.declaredClass = 'esri.arcade.Dictionary'),
            (this.attributes = null),
            (this.plain = !1),
            (this.immutable = !0),
            (this.attributes = e instanceof _e ? e.attributes : null == e ? {} : e);
        }
        field(e) {
          const t = e.toLowerCase(),
            n = this.attributes[e];
          if (void 0 !== n) return n;
          for (const e in this.attributes) if (e.toLowerCase() === t) return this.attributes[e];
          throw new Error('Field not Found : ' + e);
        }
        setField(e, t) {
          if (this.immutable) throw new Error('Dictionary is Immutable');
          const n = e.toLowerCase();
          if (void 0 === this.attributes[e]) {
            for (const e in this.attributes)
              if (e.toLowerCase() === n) return void (this.attributes[e] = t);
            this.attributes[e] = t;
          } else this.attributes[e] = t;
        }
        hasField(e) {
          const t = e.toLowerCase();
          if (void 0 !== this.attributes[e]) return !0;
          for (const e in this.attributes) if (e.toLowerCase() === t) return !0;
          return !1;
        }
        keys() {
          let e = [];
          for (const t in this.attributes) e.push(t);
          return (e = e.sort()), e;
        }
        castToText() {
          let e = '';
          for (const t in this.attributes) {
            '' !== e && (e += ',');
            const n = this.attributes[t];
            null == n
              ? (e += JSON.stringify(t) + ':null')
              : G(n) || Z(n) || L(n)
              ? (e += JSON.stringify(t) + ':' + JSON.stringify(n))
              : n instanceof o.Z || n instanceof x || n instanceof Array
              ? (e += JSON.stringify(t) + ':' + ie(n))
              : n instanceof Date
              ? (e += JSON.stringify(t) + ':' + JSON.stringify(n))
              : null !== n &&
                'object' == typeof n &&
                void 0 !== n.castToText &&
                (e += JSON.stringify(t) + ':' + n.castToText());
          }
          return '{' + e + '}';
        }
        static convertObjectToArcadeDictionary(e, t = !0) {
          const n = new _e();
          n.immutable = !1;
          for (const t in e) {
            const r = e[t];
            void 0 !== r && n.setField(t.toString(), ke(r));
          }
          return (n.immutable = t), n;
        }
      }
      class Oe extends _e {
        constructor(e) {
          super(), (this.immutable = !1), this.setField('url', e), (this.immutable = !0);
        }
      }
      class Be extends _e {
        constructor(e, t, n, r, i) {
          super(),
            (this.attachmentUrl = i),
            (this.immutable = !1),
            this.setField('id', e),
            this.setField('name', t),
            this.setField('contenttype', n),
            this.setField('size', r),
            (this.immutable = !0);
        }
      }
      function Re(e) {
        return d.Z.fromJSON(e.toJSON());
      }
      function Me(e) {
        return e.toJSON();
      }
      function Pe(e) {
        return 'string' == typeof e || e instanceof String;
      }
      function Ue(e) {
        return 'number' == typeof e;
      }
      function Le(e) {
        return e instanceof Date;
      }
      function Ge(e, t) {
        return e === t || (!(!Le(e) || !Le(t)) && e.getTime() === t.getTime());
      }
      function Ze(e) {
        if (void 0 === e) return null;
        if ('number' == typeof e) return e;
        switch (e.toLowerCase()) {
          case 'meters':
          case 'meter':
            return 109404;
          case 'miles':
          case 'mile':
            return 109413;
          case 'kilometers':
          case 'kilometer':
          case 'km':
            return 109414;
        }
        return null;
      }
      function ze(e) {
        if (null === e) return null;
        switch (e.type) {
          case 'polygon':
          case 'multipoint':
          case 'polyline':
            return e.extent;
          case 'point':
            return new s.Z({
              xmin: e.x,
              ymin: e.y,
              xmax: e.x,
              ymax: e.y,
              spatialReference: e.spatialReference,
            });
          case 'extent':
            return e;
        }
        return null;
      }
      function je(e) {
        if (void 0 === e) return null;
        if ('number' == typeof e) return e;
        if ('number' == typeof e) return e;
        switch (e.toLowerCase()) {
          case 'meters':
          case 'meter':
            return 9001;
          case 'miles':
          case 'mile':
            return 9035;
          case 'kilometers':
          case 'kilometer':
          case 'km':
            return 9036;
        }
        return null;
      }
      ((Te = Se || (Se = {}))[(Te.Standardised = 0)] = 'Standardised'),
        (Te[(Te.StandardisedNoInterval = 1)] = 'StandardisedNoInterval'),
        (Te[(Te.SqlServer = 2)] = 'SqlServer'),
        (Te[(Te.Oracle = 3)] = 'Oracle'),
        (Te[(Te.Postgres = 4)] = 'Postgres'),
        (Te[(Te.PGDB = 5)] = 'PGDB'),
        (Te[(Te.FILEGDB = 6)] = 'FILEGDB'),
        (Te[(Te.NotEvaluated = 7)] = 'NotEvaluated'),
        (function (e) {
          (e[(e.InFeatureSet = 0)] = 'InFeatureSet'),
            (e[(e.NotInFeatureSet = 1)] = 'NotInFeatureSet'),
            (e[(e.Unknown = 2)] = 'Unknown');
        })(Ie || (Ie = {}));
      const Ve = 1e3,
        Ye = {
          point: 'point',
          polygon: 'polygon',
          polyline: 'polyline',
          multipoint: 'multipoint',
          extent: 'extent',
          esriGeometryPoint: 'point',
          esriGeometryPolygon: 'polygon',
          esriGeometryPolyline: 'polyline',
          esriGeometryMultipoint: 'multipoint',
          esriGeometryEnvelope: 'extent',
          envelope: 'extent',
        },
        qe = {
          point: 'esriGeometryPoint',
          polygon: 'esriGeometryPolygon',
          polyline: 'esriGeometryPolyline',
          multipoint: 'esriGeometryMultipoint',
          extent: 'esriGeometryEnvelope',
          esriGeometryPoint: 'esriGeometryPoint',
          esriGeometryPolygon: 'esriGeometryPolygon',
          esriGeometryPolyline: 'esriGeometryPolyline',
          esriGeometryMultipoint: 'esriGeometryMultipoint',
          esriGeometryEnvelope: 'esriGeometryEnvelope',
          envelope: 'esriGeometryEnvelope',
        },
        He = {
          'small-integer': 'esriFieldTypeSmallInteger',
          integer: 'esriFieldTypeInteger',
          long: 'esriFieldTypeLong',
          single: 'esriFieldTypeSingle',
          double: 'esriFieldTypeDouble',
          string: 'esriFieldTypeString',
          date: 'esriFieldTypeDate',
          oid: 'esriFieldTypeOID',
          geometry: 'esriFieldTypeGeometry',
          blob: 'esriFieldTypeBlob',
          raster: 'esriFieldTypeRaster',
          guid: 'esriFieldTypeGUID',
          'global-id': 'esriFieldTypeGlobalID',
          xml: 'eesriFieldTypeXML',
          esriFieldTypeSmallInteger: 'esriFieldTypeSmallInteger',
          esriFieldTypeInteger: 'esriFieldTypeInteger',
          esriFieldTypeLong: 'esriFieldTypeLong',
          esriFieldTypeSingle: 'esriFieldTypeSingle',
          esriFieldTypeDouble: 'esriFieldTypeDouble',
          esriFieldTypeString: 'esriFieldTypeString',
          esriFieldTypeDate: 'esriFieldTypeDate',
          esriFieldTypeOID: 'esriFieldTypeOID',
          esriFieldTypeGeometry: 'esriFieldTypeGeometry',
          esriFieldTypeBlob: 'esriFieldTypeBlob',
          esriFieldTypeRaster: 'esriFieldTypeRaster',
          esriFieldTypeGUID: 'esriFieldTypeGUID',
          esriFieldTypeGlobalID: 'esriFieldTypeGlobalID',
          esriFieldTypeXML: 'eesriFieldTypeXML',
        };
      function Je(e, t) {
        return (0, i.Ue)((n, r) => {
          const s = (0, i.DB)(!0);
          e.reduce(
            (e, n, r, s) =>
              e.then(
                (e) => {
                  try {
                    return t(e, n, r, s);
                  } catch (e) {
                    return (0, i.d1)(e);
                  }
                },
                (e) => (0, i.d1)(e),
              ),
            s,
          ).then(n, r);
        });
      }
      function Xe(e) {
        return void 0 === e
          ? ''
          : (e = (e = (e = e.replace(/\/featureserver\/[0-9]*/i, '/FeatureServer')).replace(
              /\/mapserver\/[0-9]*/i,
              '/MapServer',
            )).split('?')[0]);
      }
      function We(e, t) {
        t || (t = {}), 'function' == typeof t && (t = { cmp: t });
        const n = 'boolean' == typeof t.cycles && t.cycles,
          r =
            t.cmp &&
            ((i = t.cmp),
            function (e) {
              return function (t, n) {
                const r = { key: t, value: e[t] },
                  s = { key: n, value: e[n] };
                return i(r, s);
              };
            });
        var i;
        const s = [];
        return (function e(t) {
          if ((t && t.toJSON && 'function' == typeof t.toJSON && (t = t.toJSON()), void 0 === t))
            return;
          if ('number' == typeof t) return isFinite(t) ? '' + t : 'null';
          if ('object' != typeof t) return JSON.stringify(t);
          let i, o;
          if (Array.isArray(t)) {
            for (o = '[', i = 0; i < t.length; i++) i && (o += ','), (o += e(t[i]) || 'null');
            return o + ']';
          }
          if (null === t) return 'null';
          if (-1 !== s.indexOf(t)) {
            if (n) return JSON.stringify('__cycle__');
            throw new TypeError('Converting circular structure to JSON');
          }
          const a = s.push(t) - 1,
            u = Object.keys(t).sort(r && r(t));
          for (o = '', i = 0; i < u.length; i++) {
            const n = u[i],
              r = e(t[n]);
            r && (o && (o += ','), (o += JSON.stringify(n) + ':' + r));
          }
          return s.splice(a, 1), '{' + o + '}';
        })(e);
      }
      class Ke {
        constructor() {
          (this.declaredClass = 'esri.arcade.Feature'),
            (this._optimizedGeomDefinition = null),
            (this._geometry = null),
            (this.attributes = null),
            (this._layer = null),
            (this._datesfixed = !0),
            (this.immutable = !0),
            (this._datefields = null),
            (this.immutable = !0);
        }
        static createFromGraphic(e) {
          const t = new Ke();
          return (
            (t._geometry = (0, h.i)(e.geometry) ? e.geometry : null),
            void 0 === e.attributes || null === e.attributes
              ? (t.attributes = {})
              : (t.attributes = e.attributes),
            e._sourceLayer
              ? ((t._layer = e._sourceLayer), (t._datesfixed = !1))
              : e._layer
              ? ((t._layer = e._layer), (t._datesfixed = !1))
              : e.layer && 'fields' in e.layer
              ? ((t._layer = e.layer), (t._datesfixed = !1))
              : e.sourceLayer &&
                'fields' in e.sourceLayer &&
                ((t._layer = e.sourceLayer), (t._datesfixed = !1)),
            t
          );
        }
        static createFromArcadeFeature(e) {
          const t = new Ke();
          return (
            (t._datesfixed = e._datesfixed),
            (t.attributes = e.attributes),
            (t._geometry = e._geometry),
            (t._optimizedGeomDefinition = e._optimizedGeomDefinition),
            e._layer && (t._layer = e._layer),
            t
          );
        }
        static createFromOptimisedFeature(e, t, n) {
          const r = new Ke();
          return (
            (r._geometry = e.geometry ? { geometry: e.geometry } : null),
            (r._optimizedGeomDefinition = n),
            (r.attributes = e.attributes || {}),
            (r._layer = t),
            (r._datesfixed = !1),
            r
          );
        }
        static createFromArcadeDictionary(e) {
          const t = new Ke();
          return (
            (t.attributes = e.field('attributes')),
            null !== t.attributes && t.attributes instanceof _e
              ? ((t.attributes = t.attributes.attributes),
                null === t.attributes && (t.attributes = {}))
              : (t.attributes = {}),
            (t._geometry = e.field('geometry')),
            null !== t._geometry &&
              (t._geometry instanceof _e
                ? (t._geometry = Ke.parseGeometryFromDictionary(t._geometry))
                : t._geometry instanceof o.Z || (t._geometry = null)),
            t
          );
        }
        static createFromGraphicLikeObject(e, t, n = null) {
          const r = new Ke();
          return (
            null === t && (t = {}),
            (r.attributes = t),
            (r._geometry = (0, h.i)(e) ? e : null),
            (r._layer = n),
            r._layer && (r._datesfixed = !1),
            (r._adapter = null),
            r
          );
        }
        repurposeFromGraphicLikeObject(e, t, n = null) {
          null === t && (t = {}),
            (this.attributes = t),
            (this._geometry = e || null),
            (this._layer = n),
            this._layer ? (this._datesfixed = !1) : (this._datesfixed = !0);
        }
        repurposeFromAdapter(e, t = null) {
          (this._adapter = e), (this._layer = t);
        }
        castToText() {
          if (this._adapter) return this._adapter.castToText();
          let e = '';
          !1 === this._datesfixed && this._fixDates();
          for (const t in this.attributes) {
            '' !== e && (e += ',');
            const n = this.attributes[t];
            null == n
              ? (e += JSON.stringify(t) + ':null')
              : G(n) || Z(n) || L(n)
              ? (e += JSON.stringify(t) + ':' + JSON.stringify(n))
              : n instanceof o.Z || n instanceof x || n instanceof Array
              ? (e += JSON.stringify(t) + ':' + ie(n))
              : n instanceof Date
              ? (e += JSON.stringify(t) + ':' + JSON.stringify(n))
              : null !== n &&
                'object' == typeof n &&
                void 0 !== n.castToText &&
                (e += JSON.stringify(t) + ':' + n.castToText());
          }
          return (
            '{"geometry":' +
            (null === this.geometry() ? 'null' : ie(this.geometry())) +
            ',"attributes":{' +
            e +
            '}}'
          );
        }
        _fixDates() {
          if (null !== this._datefields)
            return (
              this._datefields.length > 0 && this._fixDateFields(this._datefields),
              void (this._datesfixed = !0)
            );
          const e = [];
          for (let t = 0; t < this._layer.fields.length; t++) {
            const n = this._layer.fields[t];
            ('date' !== n.type && 'esriFieldTypeDate' !== n.type) || e.push(n.name);
          }
          (this._datefields = e), e.length > 0 && this._fixDateFields(e), (this._datesfixed = !0);
        }
        _fixDateFields(e) {
          this.attributes = { ...this.attributes };
          for (let t = 0; t < e.length; t++) {
            let n = this.attributes[e[t]];
            if (null === n);
            else if (void 0 === n) {
              for (const r in this.attributes)
                if (r.toLowerCase() === e[t].toLowerCase()) {
                  (n = this.attributes[r]),
                    null !== n && (n instanceof Date || (this.attributes[r] = new Date(n)));
                  break;
                }
            } else n instanceof Date || (this.attributes[e[t]] = new Date(n));
          }
        }
        geometry() {
          return this._adapter
            ? this._adapter.geometry()
            : (null === this._geometry ||
                this._geometry instanceof o.Z ||
                (this._optimizedGeomDefinition
                  ? ((this._geometry = (0, h.u)(
                      (0, f.im)(
                        (0, p.c)(
                          this._geometry,
                          this._optimizedGeomDefinition.geometryType,
                          this._optimizedGeomDefinition.hasZ,
                          this._optimizedGeomDefinition.hasM,
                        ),
                      ),
                    )),
                    (this._geometry.spatialReference = this._optimizedGeomDefinition.spatialReference))
                  : (this._geometry = (0, h.u)((0, f.im)(this._geometry)))),
              this._geometry);
        }
        field(e) {
          if (this._adapter) return this._adapter.field(e);
          !1 === this._datesfixed && this._fixDates();
          const t = this.attributes[e];
          if (void 0 !== t) return t;
          const n = e.toLowerCase();
          for (const e in this.attributes) if (e.toLowerCase() === n) return this.attributes[e];
          if (this._hasFieldDefinition(n)) return null;
          throw new Error('Field not Found : ' + e);
        }
        _hasFieldDefinition(e) {
          if (null === this._layer) return !1;
          for (let t = 0; t < this._layer.fields.length; t++)
            if (this._layer.fields[t].name.toLowerCase() === e) return !0;
          return !1;
        }
        _field(e) {
          var t;
          if (this._adapter) return null != (t = this._adapter.field(e)) ? t : null;
          !1 === this._datesfixed && this._fixDates();
          const n = e.toLowerCase(),
            r = this.attributes[e];
          if (void 0 !== r) return r;
          for (const e in this.attributes) if (e.toLowerCase() === n) return this.attributes[e];
          return null;
        }
        setField(e, t) {
          if (this.immutable) throw new Error('Feature is Immutable');
          if (!1 === P(t)) throw new Error('Illegal Value Assignment to Feature');
          if (this._adapter) return void this._adapter.setField(e, t);
          const n = e.toLowerCase();
          if (void 0 === this.attributes[e]) {
            for (const e in this.attributes)
              if (e.toLowerCase() === n) return void (this.attributes[e] = t);
            this.attributes[e] = t;
          } else this.attributes[e] = t;
        }
        hasField(e) {
          if (this._adapter) return this._adapter.hasField(e);
          const t = e.toLowerCase();
          if (void 0 !== this.attributes[e]) return !0;
          for (const e in this.attributes) if (e.toLowerCase() === t) return !0;
          return !!this._hasFieldDefinition(t);
        }
        keys() {
          if (this._adapter) return this._adapter.keys();
          let e = [];
          const t = {};
          for (const n in this.attributes) e.push(n), (t[n.toLowerCase()] = 1);
          if (null !== this._layer)
            for (let n = 0; n < this._layer.fields.length; n++) {
              const r = this._layer.fields[n];
              1 !== t[r.name.toLowerCase()] && e.push(r.name);
            }
          return (e = e.sort()), e;
        }
        static parseGeometryFromDictionary(e) {
          const t = Ke.convertDictionaryToJson(e, !0);
          return (
            void 0 !== t.hasm && ((t.hasM = t.hasm), delete t.hasm),
            void 0 !== t.hasz && ((t.hasZ = t.hasz), delete t.hasz),
            void 0 !== t.spatialreference &&
              ((t.spatialReference = t.spatialreference), delete t.spatialreference),
            void 0 !== t.rings &&
              (t.rings = this.fixPathArrays(t.rings, !0 === t.hasZ, !0 === t.hasZ)),
            void 0 !== t.paths &&
              (t.paths = this.fixPathArrays(t.paths, !0 === t.hasZ, !0 === t.hasM)),
            void 0 !== t.points &&
              (t.points = this.fixPointArrays(t.points, !0 === t.hasZ, !0 === t.hasM)),
            (0, f.im)(t)
          );
        }
        static fixPathArrays(e, t, n) {
          const r = [];
          if (e instanceof Array)
            for (let i = 0; i < e.length; i++) r.push(this.fixPointArrays(e[i], t, n));
          else if (e instanceof x)
            for (let i = 0; i < e.length(); i++) r.push(this.fixPointArrays(e.get(i), t, n));
          return r;
        }
        static fixPointArrays(e, t, n) {
          const i = [];
          if (e instanceof Array)
            for (let s = 0; s < e.length; s++) {
              const o = e[s];
              o instanceof r.Z
                ? t && n
                  ? i.push([o.x, o.y, o.z, o.m])
                  : t
                  ? i.push([o.x, o.y, o.z])
                  : n
                  ? i.push([o.x, o.y, o.m])
                  : i.push([o.x, o.y])
                : o instanceof x
                ? i.push(o.toArray())
                : i.push(o);
            }
          else if (e instanceof x)
            for (let s = 0; s < e.length(); s++) {
              const o = e.get(s);
              o instanceof r.Z
                ? t && n
                  ? i.push([o.x, o.y, o.z, o.m])
                  : t
                  ? i.push([o.x, o.y, o.z])
                  : n
                  ? i.push([o.x, o.y, o.m])
                  : i.push([o.x, o.y])
                : o instanceof x
                ? i.push(o.toArray())
                : i.push(o);
            }
          return i;
        }
        static convertDictionaryToJson(e, t = !1) {
          const n = {};
          for (const r in e.attributes) {
            let i = e.attributes[r];
            i instanceof _e && (i = Ke.convertDictionaryToJson(i)),
              t ? (n[r.toLowerCase()] = i) : (n[r] = i);
          }
          return n;
        }
        static parseAttributesFromDictionary(e) {
          const t = {};
          for (const n in e.attributes) {
            const r = e.attributes[n];
            if (!P(r)) throw new Error('Illegal Argument');
            t[n] = r;
          }
          return t;
        }
        static fromJson(e) {
          let t = null;
          null !== e.geometry && void 0 !== e.geometry && (t = (0, f.im)(e.geometry));
          const n = {};
          if (null !== e.attributes && void 0 !== e.attributes)
            for (const t in e.attributes) {
              const r = e.attributes[t];
              if (null === r) n[t] = r;
              else {
                if (!(L(r) || Z(r) || G(r) || H(r))) throw new Error('Illegal Argument');
                n[t] = r;
              }
            }
          return Ke.createFromGraphicLikeObject(t, n, null);
        }
        fullDomain(e, t) {
          return null === this._layer
            ? null
            : this._layer.fields
            ? pe(e, this._layer, this, t)
            : null;
        }
        subtypes() {
          return null === this._layer
            ? null
            : this._layer.fields && this._layer.typeIdField
            ? {
                subtypeField: this._layer.typeIdField,
                subtypes: this._layer.types
                  ? this._layer.types.map((e) => ({ name: e.name, code: e.id }))
                  : [],
              }
            : null;
        }
        domainValueLookup(e, t, n) {
          if (null === this._layer) return null;
          if (!this._layer.fields) return null;
          const r = pe(e, this._layer, this, n);
          if (void 0 === t)
            try {
              t = this.field(e);
            } catch (e) {
              return null;
            }
          return fe(r, t);
        }
        gdbVersion() {
          if (null === this._layer) return '';
          const e = this._layer.gdbVersion;
          return void 0 === e
            ? ''
            : '' === e && this._layer.capabilities && this._layer.capabilities.isVersioned
            ? 'SDE.DEFAULT'
            : e;
        }
        domainCodeLookup(e, t, n) {
          if (null === this._layer) return null;
          if (!this._layer.fields) return null;
          if (void 0 === t) {
            try {
              t = this.field(e);
            } catch (e) {
              return null;
            }
            return t;
          }
          return de(pe(e, this._layer, this, n), t);
        }
        schema() {
          if (null === this._layer) return null;
          if (!this._layer.fields) return null;
          const e = [];
          for (const t of this._layer.fields) e.push(Me(t));
          return {
            objectIdField: this._layer.objectIdField,
            globalIdField: this._layer.globalIdField,
            geometryType:
              void 0 === qe[this._layer.geometryType] ? '' : qe[this._layer.geometryType],
            fields: e,
          };
        }
      }
      const $e = {
        concatenate: { min: '0', max: '*' },
        tohex: { min: '1', max: '1' },
        hash: { min: '1', max: '1' },
        isoweek: { min: '1', max: '1' },
        isoweekday: { min: '1', max: '1' },
        isomonth: { min: '1', max: '1' },
        isoyear: { min: '1', max: '1' },
        resize: { min: '2', max: '3' },
        slice: { min: '0', max: '*' },
        splice: { min: '0', max: '*' },
        push: { min: '2', max: '2' },
        pop: { min: '1', max: '1' },
        includes: { min: '2', max: '2' },
        array: { min: '1', max: '2' },
        front: { min: '1', max: '1' },
        back: { min: '1', max: '1' },
        insert: { min: '3', max: '3' },
        erase: { min: '2', max: '2' },
        split: { min: '2', max: '4' },
        guid: { min: '0', max: '1' },
        today: { min: '0', max: '0' },
        angle: { min: '2', max: '3' },
        bearing: { min: '2', max: '3' },
        urlencode: { min: '1', max: '1' },
        now: { min: '0', max: '0' },
        timestamp: { min: '0', max: '0' },
        day: { min: '1', max: '1' },
        month: { min: '1', max: '1' },
        year: { min: '1', max: '1' },
        hour: { min: '1', max: '1' },
        second: { min: '1', max: '1' },
        millisecond: { min: '1', max: '1' },
        minute: { min: '1', max: '1' },
        weekday: { min: '1', max: '1' },
        toutc: { min: '1', max: '1' },
        tolocal: { min: '1', max: '1' },
        date: { min: '0', max: '7' },
        datediff: { min: '2', max: '3' },
        dateadd: { min: '2', max: '3' },
        trim: { min: '1', max: '1' },
        text: { min: '1', max: '2' },
        left: { min: '2', max: '2' },
        right: { min: '2', max: '2' },
        mid: { min: '2', max: '3' },
        upper: { min: '1', max: '1' },
        proper: { min: '1', max: '2' },
        lower: { min: '1', max: '1' },
        find: { min: '2', max: '3' },
        iif: { min: '3', max: '3' },
        decode: { min: '2', max: '*' },
        when: { min: '2', max: '*' },
        defaultvalue: { min: '2', max: '2' },
        isempty: { min: '1', max: '1' },
        domaincode: { min: '2', max: '4' },
        domainname: { min: '2', max: '4' },
        polygon: { min: '1', max: '1' },
        point: { min: '1', max: '1' },
        polyline: { min: '1', max: '1' },
        extent: { min: '1', max: '1' },
        multipoint: { min: '1', max: '1' },
        ringisclockwise: { min: '1', max: '1' },
        geometry: { min: '1', max: '1' },
        count: { min: '0', max: '*' },
        number: { min: '1', max: '2' },
        acos: { min: '1', max: '1' },
        asin: { min: '1', max: '1' },
        atan: { min: '1', max: '1' },
        atan2: { min: '2', max: '2' },
        ceil: { min: '1', max: '2' },
        floor: { min: '1', max: '2' },
        round: { min: '1', max: '2' },
        cos: { min: '1', max: '1' },
        exp: { min: '1', max: '1' },
        log: { min: '1', max: '1' },
        min: { min: '0', max: '*' },
        constrain: { min: '3', max: '3' },
        console: { min: '0', max: '*' },
        max: { min: '0', max: '*' },
        pow: { min: '2', max: '2' },
        random: { min: '0', max: '0' },
        sqrt: { min: '1', max: '1' },
        sin: { min: '1', max: '1' },
        tan: { min: '1', max: '1' },
        abs: { min: '1', max: '1' },
        isnan: { min: '1', max: '1' },
        stdev: { min: '0', max: '*' },
        average: { min: '0', max: '*' },
        mean: { min: '0', max: '*' },
        sum: { min: '0', max: '*' },
        variance: { min: '0', max: '*' },
        distinct: { min: '0', max: '*' },
        first: { min: '1', max: '1' },
        top: { min: '2', max: '2' },
        boolean: { min: '1', max: '1' },
        dictionary: { min: '0', max: '*' },
        typeof: { min: '1', max: '1' },
        reverse: { min: '1', max: '1' },
        replace: { min: '3', max: '4' },
        sort: { min: '1', max: '2' },
        feature: { min: '1', max: '*' },
        haskey: { min: '2', max: '2' },
        indexof: { min: '2', max: '2' },
        disjoint: { min: '2', max: '2' },
        intersects: { min: '2', max: '2' },
        touches: { min: '2', max: '2' },
        crosses: { min: '2', max: '2' },
        within: { min: '2', max: '2' },
        contains: { min: '2', max: '2' },
        overlaps: { min: '2', max: '2' },
        equals: { min: '2', max: '2' },
        relate: { min: '3', max: '3' },
        intersection: { min: '2', max: '2' },
        union: { min: '1', max: '2' },
        difference: { min: '2', max: '2' },
        symmetricdifference: { min: '2', max: '2' },
        clip: { min: '2', max: '2' },
        cut: { min: '2', max: '2' },
        area: { min: '1', max: '2' },
        areageodetic: { min: '1', max: '2' },
        length: { min: '1', max: '2' },
        lengthgeodetic: { min: '1', max: '2' },
        distancegeodetic: { min: '2', max: '3' },
        distance: { min: '2', max: '3' },
        densify: { min: '2', max: '3' },
        densifygeodetic: { min: '2', max: '3' },
        generalize: { min: '2', max: '4' },
        buffer: { min: '2', max: '3' },
        buffergeodetic: { min: '2', max: '3' },
        offset: { min: '2', max: '6' },
        rotate: { min: '2', max: '3' },
        issimple: { min: '1', max: '1' },
        simplify: { min: '1', max: '1' },
        centroid: { min: '1', max: '1' },
        isselfintersecting: { min: '1', max: '1' },
        multiparttosinglepart: { min: '1', max: '1' },
        setgeometry: { min: '2', max: '2' },
        portal: { min: '1', max: '1' },
        getuser: { min: '1', max: '2' },
        subtypes: { min: '1', max: '1' },
        subtypecode: { min: '1', max: '1' },
        subtypename: { min: '1', max: '1' },
        domain: { min: '2', max: '3' },
        convertdirection: { min: '3', max: '3' },
        schema: { min: '1', max: '1' },
      };
      for (const e in $e) ($e[e].fmin = $e[e].min), ($e[e].fmax = $e[e].max);
      const Qe = [
          'featureset',
          'getuser',
          'featuresetbyid',
          'featuresetbyname',
          'featuresetbyassociation',
          'featuresetbyrelationshipname',
          'featuresetbyurl',
          'attachments',
          'featuresetbyportalitem',
        ],
        et = [
          'disjoint',
          'intersects',
          'touches',
          'crosses',
          'within',
          'contains',
          'overlaps',
          'equals',
          'relate',
          'intersection',
          'union',
          'difference',
          'symmetricdifference',
          'clip',
          'cut',
          'area',
          'areageodetic',
          'length',
          'lengthgeodetic',
          'distance',
          'distancegeodetic',
          'densify',
          'densifygeodetic',
          'generalize',
          'buffer',
          'buffergeodetic',
          'offset',
          'rotate',
          'issimple',
          'simplify',
          'multiparttosinglepart',
        ];
      function tt(e, t) {
        const n = $e[e.name.toLowerCase()];
        void 0 === n
          ? ($e[e.name.toLowerCase()] =
              'sync' === t ? { min: e.min, max: e.max } : { fmin: e.min, fmax: e.max })
          : 'sync' === t
          ? ((n.min = e.min), (n.max = e.max))
          : ((n.fmin = e.min), (n.fmax = e.max));
      }
      function nt(e, t) {
        return ('0' !== e.min && t.length < Number(e.min)) ||
          ('*' !== e.max && t.length > Number(e.max))
          ? -2
          : 1;
      }
      function rt(e, t, n) {
        if (null !== n.localScope && void 0 !== n.localScope[e.toLowerCase()]) {
          const r = n.localScope[e.toLowerCase()];
          if ('FormulaFunction' === r.type)
            return (
              void 0 === r.signature && (r.signature = { min: '0', max: '*' }), nt(r.signature, t)
            );
          if ('any' === r.type)
            return (
              void 0 === r.signature && (r.signature = { min: '0', max: '*' }), nt(r.signature, t)
            );
        }
        if (void 0 !== n.globalScope[e.toLowerCase()]) {
          const r = n.globalScope[e.toLowerCase()];
          if ('FormulaFunction' === r.type)
            return (
              void 0 === r.signature && (r.signature = { min: '0', max: '*' }), nt(r.signature, t)
            );
          if ('any' === r.type)
            return (
              void 0 === r.signature && (r.signature = { min: '0', max: '*' }), nt(r.signature, t)
            );
        }
        return -1;
      }
      function it(e, t) {
        if (e) for (const n of e) st(n, t);
      }
      function st(e, t) {
        if (e && !1 !== t(e))
          switch (e.type) {
            case 'ArrayExpression':
              it(e.elements, t);
              break;
            case 'AssignmentExpression':
            case 'BinaryExpression':
              st(e.left, t), st(e.right, t);
              break;
            case 'BlockStatement':
              it(e.body, t);
              break;
            case 'BreakStatement':
              break;
            case 'CallExpression':
              st(e.callee, t), it(e.arguments, t);
              break;
            case 'ConditionalExpression':
              st(e.test, t), st(e.alternate, t), st(e.consequent, t);
              break;
            case 'ContinueStatement':
            case 'EmptyStatement':
              break;
            case 'ExpressionStatement':
              st(e.expression, t);
              break;
            case 'ForInStatement':
              st(e.left, t), st(e.right, t), st(e.body, t);
              break;
            case 'ForStatement':
              st(e.init, t), st(e.test, t), st(e.update, t), st(e.body, t);
              break;
            case 'FunctionDeclaration':
            case 'FunctionDeclaration':
            case 'FunctionExpression':
              st(e.id, t), it(e.params, t), st(e.body, t);
              break;
            case 'Identifier':
              break;
            case 'IfStatement':
              st(e.test, t), st(e.consequent, t), st(e.alternate, t);
              break;
            case 'Literal':
              break;
            case 'LogicalExpression':
              st(e.left, t), st(e.right, t);
              break;
            case 'MemberExpression':
              st(e.object, t), st(e.property, t);
              break;
            case 'ObjectExpression':
              it(e.properties, t);
              break;
            case 'Program':
              it(e.body, t);
              break;
            case 'Property':
              st(e.key, t), st(e.value, t);
              break;
            case 'ReturnStatement':
            case 'UnaryExpression':
            case 'UpdateExpression':
              st(e.argument, t);
              break;
            case 'VariableDeclaration':
              it(e.declarations, t);
              break;
            case 'VariableDeclarator':
              st(e.id, t), st(e.init, t);
              break;
            case 'TemplateLiteral':
              it(e.expressions, t), it(e.quasis, t);
          }
      }
      function ot(e, t = !0) {
        let n = mt(e, 'SYNTAX', 'UNREOGNISED');
        try {
          switch (e.type) {
            case 'VariableDeclarator':
              return null !== e.init && 'FunctionExpression' === e.init.type
                ? mt(e, 'SYNTAX', 'FUNCTIONVARIABLEDECLARATOR')
                : 'Identifier' !== e.id.type
                ? mt(e, 'SYNTAX', 'VARIABLEMUSTHAVEIDENTIFIER')
                : null !== e.init
                ? ot(e.init, !1)
                : '';
            case 'VariableDeclaration':
              for (let r = 0; r < e.declarations.length; r++)
                if (((n = ot(e.declarations[r], t)), '' !== n)) return n;
              return '';
            case 'ForInStatement':
              if (((n = ot(e.left, t)), '' !== n)) return n;
              if ('VariableDeclaration' === e.left.type) {
                if (e.left.declarations.length > 1) return mt(e, 'SYNTAX', 'ONLY1VAR');
                if (null !== e.left.declarations[0].init)
                  return mt(e, 'SYNTAX', 'CANNOTDECLAREVAL');
              } else if ('Identifier' !== e.left.type) return mt(e, 'SYNTAX', 'LEFTNOTVAR');
              return (n = ot(e.right, t)), '' !== n ? n : ((n = ot(e.body, t)), '' !== n ? n : '');
            case 'ForStatement':
              return (null !== e.test && ((n = ot(e.test, t)), '' !== n)) ||
                (null !== e.init && ((n = ot(e.init, t)), '' !== n)) ||
                (null !== e.update && ((n = ot(e.update, t)), '' !== n)) ||
                (null !== e.body && ((n = ot(e.body, t)), '' !== n))
                ? n
                : '';
            case 'ContinueStatement':
            case 'EmptyStatement':
            case 'BreakStatement':
              return '';
            case 'IfStatement':
              return (
                (n = ot(e.test, t)),
                '' !== n ||
                (null !== e.consequent && ((n = ot(e.consequent, !1)), '' !== n)) ||
                (null !== e.alternate && ((n = ot(e.alternate, !1)), '' !== n))
                  ? n
                  : ''
              );
            case 'BlockStatement': {
              const r = [];
              for (let t = 0; t < e.body.length; t++)
                'EmptyStatement' !== e.body[t].type && r.push(e.body[t]);
              e.body = r;
              for (let r = 0; r < e.body.length; r++)
                if (((n = ot(e.body[r], t)), '' !== n)) return n;
              return '';
            }
            case 'FunctionDeclaration':
              return !1 === t
                ? mt(e, 'SYNTAX', 'GLOBALFUNCTIONSONLY')
                : 'Identifier' !== e.id.type
                ? mt(e, 'SYNTAX', 'FUNCTIONMUSTHAVEIDENTIFIER')
                : ot(e.body, !1);
            case 'ReturnStatement':
              return null !== e.argument ? ot(e.argument, t) : '';
            case 'UpdateExpression':
              return 'Identifier' !== e.argument.type && 'MemberExpression' !== e.argument.type
                ? mt(e, 'SYNTAX', 'ASSIGNMENTTOVARSONLY')
                : ot(e.argument, t);
            case 'AssignmentExpression':
              if ('Identifier' !== e.left.type && 'MemberExpression' !== e.left.type)
                return mt(e, 'SYNTAX', 'ASSIGNMENTTOVARSONLY');
              if (((n = ot(e.left, t)), '' !== n)) return n;
              switch (e.operator) {
                case '=':
                case '/=':
                case '*=':
                case '%=':
                case '+=':
                case '-=':
                  break;
                default:
                  return mt(e, 'SYNTAX', 'OPERATORNOTRECOGNISED');
              }
              return ot(e.right, !1);
            case 'ExpressionStatement':
              return (
                'AssignmentExpression' === e.expression.type || e.expression.type,
                ot(e.expression, !1)
              );
            case 'Identifier':
              n = '';
              break;
            case 'MemberExpression':
              return (
                (n = ot(e.object, t)), '' !== n ? n : !0 === e.computed ? ot(e.property, t) : ''
              );
            case 'Literal':
            case 'TemplateElement':
              return '';
            case 'CallExpression':
              if ('Identifier' !== e.callee.type) return mt(e, 'SYNTAX', 'ONLYNODESSUPPORTED');
              n = '';
              for (let r = 0; r < e.arguments.length; r++)
                if (((n = ot(e.arguments[r], t)), '' !== n)) return n;
              return '';
            case 'UnaryExpression':
              n = ot(e.argument, t);
              break;
            case 'BinaryExpression':
              if (((n = ot(e.left, t)), '' !== n)) return n;
              if (((n = ot(e.right, t)), '' !== n)) return n;
              switch (e.operator) {
                case '|':
                case '&':
                case '>>':
                case '<<':
                case '>>':
                case '>>>':
                case '^':
                case '==':
                case '!=':
                case '<':
                case '<=':
                case '>':
                case '>=':
                case '+':
                case '-':
                case '*':
                case '/':
                case '%':
                  break;
                default:
                  return mt(e, 'SYNTAX', 'OPERATORNOTRECOGNISED');
              }
              return '';
            case 'LogicalExpression':
              if (((n = ot(e.left, t)), '' !== n)) return n;
              if (((n = ot(e.right)), '' !== n)) return n;
              switch (e.operator) {
                case '&&':
                case '||':
                  break;
                default:
                  return mt(e, 'SYNTAX', 'OPERATORNOTRECOGNISED');
              }
              return '';
            case 'ConditionalExpression':
              return mt(e, 'SYNTAX', 'NOTSUPPORTED');
            case 'ArrayExpression':
              n = '';
              for (let r = 0; r < e.elements.length; r++)
                if (((n = ot(e.elements[r], t)), '' !== n)) return n;
              return n;
            case 'TemplateLiteral':
              n = '';
              for (let r = 0; r < e.quasis.length; r++)
                if (((n = ot(e.quasis[r], t)), '' !== n)) return n;
              for (let r = 0; r < e.expressions.length; r++)
                if (((n = ot(e.expressions[r], t)), '' !== n)) return n;
              return n;
            case 'ObjectExpression':
              n = '';
              for (let r = 0; r < e.properties.length; r++) {
                if (
                  ((n = ''),
                  null !== e.properties[r].key &&
                    ('Literal' !== e.properties[r].key.type &&
                      'Identifier' !== e.properties[r].key.type &&
                      (n = mt(e, 'SYNTAX', 'OBJECTPROPERTYMUSTBESTRING')),
                    'Literal' === e.properties[r].key.type))
                ) {
                  const t = e.properties[r].key,
                    i = 'value' in t ? t.value : null;
                  'string' == typeof i ||
                    i instanceof String ||
                    (n = mt(e, 'SYNTAX', 'OBJECTPROPERTYMUSTBESTRING'));
                }
                if (('' === n && (n = ot(e.properties[r], t)), '' !== n)) return n;
              }
              return n;
            case 'Property':
              return 'Literal' !== e.key.type && 'Identifier' !== e.key.type
                ? mt(e, 'SYNTAX', 'ONLYLITERAL')
                : (('Identifier' !== e.key.type && ((n = ot(e.key, t)), '' !== n)) ||
                    (n = ot(e.value, t)),
                  n);
            default:
              return n;
          }
          return n;
        } catch (e) {
          throw e;
        }
      }
      function at(e, t) {
        let n = mt(e, 'SYNTAX', 'UNREOGNISED'),
          r = null,
          i = '';
        try {
          switch (e.type) {
            case 'VariableDeclarator': {
              if (null !== e.init && 'FunctionExpression' === e.init.type)
                return mt(e, 'SYNTAX', 'FUNCTIONVARIABLEDECLARATOR');
              const n = null === e.init ? '' : at(e.init, t);
              return '' !== n
                ? n
                : ('Identifier' === e.id.type &&
                    (null === t.localScope
                      ? (t.globalScope[e.id.name.toLowerCase()] = { type: 'any' })
                      : (t.localScope[e.id.name.toLowerCase()] = { type: 'any' })),
                  '');
            }
            case 'FunctionDeclaration':
              return (
                (r = ht(e.id.name.toLowerCase(), e)),
                (i = (function (e, t) {
                  const n = { globalScope: t.globalScope, localScope: {} };
                  for (let t = 0; t < e.params.length; t++) {
                    const r = e.params[t].name;
                    n.localScope[r.toLowerCase()] = { type: 'any' };
                  }
                  return at(e.body, n);
                })(e, t)),
                '' !== i
                  ? i
                  : null !== t.localScope
                  ? mt(e, 'SYNTAX', 'GLOBALFUNCTIONSONLY')
                  : ((r.isnative = !1),
                    (t.globalScope[e.id.name.toLowerCase()] = {
                      type: 'FormulaFunction',
                      signature: [r],
                    }),
                    '')
              );
            case 'VariableDeclaration':
              n = '';
              for (let r = 0; r < e.declarations.length; r++)
                if (((n = at(e.declarations[r], t)), '' !== n)) return n;
              return n;
            case 'IfStatement':
              return (
                (n = at(e.test, t)),
                '' !== n
                  ? n
                  : 'AssignmentExpression' === e.test.type || 'UpdateExpression' === e.test.type
                  ? mt(e.test, 'SYNTAX', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION')
                  : (null !== e.consequent && ((n = at(e.consequent, t)), '' !== n)) ||
                    (null !== e.alternate && ((n = at(e.alternate, t)), '' !== n))
                  ? n
                  : ''
              );
            case 'EmptyStatement':
              return '';
            case 'BlockStatement':
              for (let r = 0; r < e.body.length; r++)
                if (((n = at(e.body[r], t)), '' !== n)) return n;
              return '';
            case 'ReturnStatement':
              return null !== e.argument ? at(e.argument, t) : '';
            case 'ForInStatement':
              if ('VariableDeclaration' === e.left.type) {
                if (e.left.declarations.length > 1) return mt(e, 'SYNTAX', 'ONLY1VAR');
                if (null !== e.left.declarations[0].init)
                  return mt(e, 'SYNTAX', 'CANNOTDECLAREVAL');
              } else if ('Identifier' !== e.left.type) return mt(e, 'SYNTAX', 'LEFTNOTVAR');
              return (
                (n = at(e.left, t)),
                '' !== n
                  ? n
                  : ((n = at(e.right, t)), '' !== n ? n : ((n = at(e.body, t)), '' !== n ? n : ''))
              );
            case 'ForStatement':
              return (null !== e.init && ((n = at(e.init, t)), '' !== n)) ||
                (null !== e.test && ((n = at(e.test, t)), '' !== n)) ||
                (null !== e.body && ((n = at(e.body, t)), '' !== n)) ||
                (null !== e.update && ((n = at(e.update, t)), '' !== n))
                ? n
                : '';
            case 'BreakStatement':
            case 'ContinueStatement':
              return '';
            case 'UpdateExpression': {
              if ('Identifier' !== e.argument.type && 'MemberExpression' !== e.argument.type)
                return mt(e, 'SYNTAX', 'ASSIGNMENTTOVARSONLY');
              let n = !1;
              return 'MemberExpression' === e.argument.type
                ? at(e.argument, t)
                : (null !== t.localScope &&
                    void 0 !== t.localScope[e.argument.name.toLowerCase()] &&
                    (n = !0),
                  void 0 !== t.globalScope[e.argument.name.toLowerCase()] && (n = !0),
                  !1 === n ? 'Identifier ' + e.argument.name + ' has not been declared.' : '');
            }
            case 'AssignmentExpression': {
              if ('Identifier' !== e.left.type && 'MemberExpression' !== e.left.type)
                return mt(e, 'SYNTAX', 'ASSIGNMENTTOVARSONLY');
              let n = at(e.right, t);
              if ('' !== n) return n;
              let r = !1;
              return 'MemberExpression' === e.left.type
                ? ((n = at(e.left, t)), '' !== n ? n : '')
                : (null !== t.localScope &&
                    void 0 !== t.localScope[e.left.name.toLowerCase()] &&
                    (r = !0),
                  void 0 !== t.globalScope[e.left.name.toLowerCase()] && (r = !0),
                  !1 === r ? 'Identifier ' + e.left.name + ' has not been declared.' : '');
            }
            case 'ExpressionStatement':
              return (
                'AssignmentExpression' === e.expression.type || e.expression.type,
                at(e.expression, t)
              );
            case 'Identifier': {
              const r = e.name.toLowerCase();
              if (null !== t.localScope && void 0 !== t.localScope[r]) return '';
              n = void 0 !== t.globalScope[r] ? '' : mt(e, 'SYNTAX', 'VARIABLENOTFOUND');
              break;
            }
            case 'MemberExpression':
              return (
                (n = at(e.object, t)), '' !== n ? n : !0 === e.computed ? at(e.property, t) : ''
              );
            case 'Literal':
            case 'TemplateElement':
              return '';
            case 'CallExpression': {
              if ('Identifier' !== e.callee.type) return mt(e, 'SYNTAX', 'ONLYNODESSUPPORTED');
              n = '';
              for (let r = 0; r < e.arguments.length; r++)
                if (((n = at(e.arguments[r], t)), '' !== n)) return n;
              const r = rt(e.callee.name, e.arguments, t);
              -1 === r && (n = mt(e, 'SYNTAX', 'NOTFOUND')),
                -2 === r && (n = mt(e, 'SYNTAX', 'WRONGSIGNATURE'));
              break;
            }
            case 'UnaryExpression':
              n = at(e.argument, t);
              break;
            case 'BinaryExpression':
              return (n = at(e.left, t)), '' !== n ? n : ((n = at(e.right, t)), '' !== n ? n : '');
            case 'LogicalExpression':
              return (
                (n = at(e.left, t)),
                '' !== n
                  ? n
                  : 'AssignmentExpression' === e.left.type || 'UpdateExpression' === e.left.type
                  ? mt(e.left, 'SYNTAX', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION')
                  : ((n = at(e.right, t)),
                    '' !== n
                      ? n
                      : 'AssignmentExpression' === e.right.type ||
                        'UpdateExpression' === e.right.type
                      ? mt(e.right, 'SYNTAX', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION')
                      : '')
              );
            case 'ConditionalExpression':
              return mt(e, 'SYNTAX', 'NOTSUPPORTED');
            case 'ArrayExpression':
              n = '';
              for (let r = 0; r < e.elements.length; r++)
                if (((n = at(e.elements[r], t)), '' !== n)) return n;
              return n;
            case 'TemplateLiteral':
              n = '';
              for (let r = 0; r < e.quasis.length; r++)
                if (((n = at(e.quasis[r], t)), '' !== n)) return n;
              for (let r = 0; r < e.expressions.length; r++)
                if (((n = at(e.expressions[r], t)), '' !== n)) return n;
              return n;
            case 'ObjectExpression':
              n = '';
              for (let r = 0; r < e.properties.length; r++) {
                if (
                  ((n = ''),
                  null !== e.properties[r].key &&
                    ('Literal' !== e.properties[r].key.type &&
                      'Identifier' !== e.properties[r].key.type &&
                      (n = mt(e, 'SYNTAX', 'OBJECTPROPERTYMUSTBESTRING')),
                    'Literal' === e.properties[r].key.type))
                ) {
                  const t = e.properties[r].key,
                    i = 'value' in t ? t.value : null;
                  'string' == typeof i ||
                    i instanceof String ||
                    (n = mt(e, 'SYNTAX', 'OBJECTPROPERTYMUSTBESTRING'));
                }
                if (('' === n && (n = at(e.properties[r], t)), '' !== n)) return n;
              }
              return n;
            case 'Property':
              return 'Literal' !== e.key.type && 'Identifier' !== e.key.type
                ? mt(e, 'SYNTAX', 'ONLYLITERAL')
                : (('Identifier' !== e.key.type && ((n = at(e.key, t)), '' !== n)) ||
                    (n = at(e.value, t)),
                  n);
            case 'Program':
            case 'FunctionExpression':
            case 'NewExpression':
            case 'DoWhileStatement':
            case 'TemplateElement':
            default:
              return n;
          }
          return n;
        } catch (e) {
          throw e;
        }
      }
      function ut(e, t) {
        let n = !1;
        const r = t.toLowerCase();
        return (
          st(
            e,
            (e) =>
              !n &&
              ('Identifier' === e.type && e.name && e.name.toLowerCase() === r && (n = !0), !0),
          ),
          n
        );
      }
      function lt(e, t) {
        let n = !1;
        const r = t.toLowerCase();
        return (
          st(
            e,
            (e) =>
              !(
                n ||
                ('CallExpression' === e.type &&
                  'Identifier' === e.callee.type &&
                  e.callee.name &&
                  e.callee.name.toLowerCase() === r &&
                  ((n = !0), 1))
              ),
          ),
          n
        );
      }
      function ct(e) {
        const t = [];
        return (
          st(
            e,
            (e) =>
              'MemberExpression' !== e.type ||
              'Identifier' !== e.object.type ||
              (!1 === e.computed &&
              e.object &&
              e.object.name &&
              e.property &&
              'Identifier' === e.property.type &&
              e.property.name
                ? t.push(e.object.name.toLowerCase() + '.' + e.property.name.toLowerCase())
                : e.object &&
                  e.object.name &&
                  e.property &&
                  'Literal' === e.property.type &&
                  'string' == typeof e.property.value &&
                  t.push(
                    e.object.name.toLowerCase() + '.' + e.property.value.toString().toLowerCase(),
                  ),
              !1),
          ),
          t
        );
      }
      function ht(e, t) {
        const n = [];
        if (void 0 !== t.params && null !== t.params)
          for (let e = 0; e < t.params.length; e++) n.push('any');
        return { name: e, return: 'any', params: n };
      }
      function ft(e, t, n, r) {
        const i = {};
        null == e && (e = {}),
          null == n && (n = {}),
          (i.infinity = { type: 'any' }),
          (i.textformatting = { type: 'any' }),
          (i.pi = { type: 'any' });
        for (const e in t)
          'sync' === r && void 0 !== t[e].min
            ? (i[e] = { type: 'FormulaFunction', signature: { min: t[e].min, max: t[e].max } })
            : 'sync' !== r &&
              void 0 !== t[e].fmin &&
              (i[e] = { type: 'FormulaFunction', signature: { min: t[e].fmin, max: t[e].fmax } });
        for (let e = 0; e < n.length; e++) {
          const t = n[e];
          i[t.name] = { type: 'FormulaFunction', signature: t };
        }
        for (const t in e) (i[t] = e[t]), (i[t].type = 'any');
        return i;
      }
      function dt(e, t, n = 'async', r = $e) {
        const i = { globalScope: ft(t.vars, r, t.customFunctions, n), localScope: null };
        return at(e.body[0].body, i);
      }
      function pt(e) {
        return 'BlockStatement' !== e.body[0].body.type
          ? 'Invalid formula content.'
          : ot(e.body[0].body);
      }
      function mt(e, t, n) {
        let r = '';
        switch (t) {
          case 'SYNTAX':
            r = 'Syntax Error: ';
            break;
          case 'RUNTIME':
            r = 'Runtime Error: ';
            break;
          default:
            r = 'Syntax Error: ';
        }
        try {
          switch (e.type) {
            case 'IfStatement':
              switch (n) {
                case 'CANNOT_USE_ASSIGNMENT_IN_CONDITION':
                  r += ' Assignments not be made in logical tests';
                  break;
                case 'CANNOT_USE_NONBOOLEAN_IN_CONDITION':
                  r += ' Non Boolean used as Condition';
              }
              break;
            case 'UpdateExpression':
            case 'AssignmentExpression':
              switch (n) {
                case 'CANNOT_USE_ASSIGNMENT_IN_CONDITION':
                  r += ' Assignments not be made in logical tests';
                  break;
                case 'ASSIGNMENTTOVARSONLY':
                  r += ' Assignments can only be made to identifiers';
              }
              break;
            case 'ExpressionStatement':
              r += ' Assignments can only be made to identifiers';
              break;
            case 'FunctionDeclaration':
              switch (n) {
                case 'GLOBALFUNCTIONSONLY':
                  r += ' Functions cannot be declared as variables';
                  break;
                case 'FUNCTIONMUSTHAVEIDENTIFIER':
                  r += ' Function Definition must have an identifier';
              }
              break;
            case 'VariableDeclaration':
              r += ' Only 1 variable can be declared at a time';
              break;
            case 'VariableDeclarator':
              switch (n) {
                case 'FUNCTIONVARIABLEDECLARATOR':
                  r += ' Functions cannot be declared as variables';
                  break;
                case 'VARIABLEMUSTHAVEIDENTIFIER':
                  r += ' Variable Definition must have an identifier';
              }
              break;
            case 'Identifier':
              (r += ' Identifier Not Found. '), (r += e.name);
              break;
            case 'ObjectExpression':
              switch (n) {
                case 'OBJECTPROPERTYMUSTBESTRING':
                  r += ' Property name must be a string';
              }
              break;
            case 'ForStatement':
              switch (n) {
                case 'CANNOT_USE_NONBOOLEAN_IN_CONDITION':
                  r += ' Non Boolean used as Condition';
              }
              break;
            case 'ForInStatement':
              switch (n) {
                case 'ONLY1VAR':
                  r += ' Can only declare 1 var for use with IN';
                  break;
                case 'CANNOTDECLAREVAL':
                  r += ' Can only declare value for use with IN';
                  break;
                case 'LEFTNOVAR':
                  r += 'Must provide a variable to iterate with.';
                  break;
                case 'VARIABLENOTDECLARED':
                  r += 'Variable must be declared before it is used..';
                  break;
                case 'CANNOTITERATETHISTYPE':
                  r += 'This type cannot be used in an IN loop';
              }
              break;
            case 'MemberExpression':
              switch (n) {
                case 'PROPERTYNOTFOUND':
                  (r += 'Cannot find member property. '),
                    (r +=
                      !1 === e.computed && 'Identifier' === e.property.type ? e.property.name : '');
                  break;
                case 'OUTOFBOUNDS':
                  (r += 'Out of Bounds. '),
                    (r +=
                      !1 === e.computed && 'Identifier' === e.property.type ? e.property.name : '');
                  break;
                case 'NOTFOUND':
                  (r += 'Cannot call member method on null. '),
                    (r +=
                      !1 === e.computed && 'Identifier' === e.property.type ? e.property.name : '');
                  break;
                case 'INVALIDTYPE':
                  (r += 'Cannot call member property on object of this type. '),
                    (r +=
                      !1 === e.computed && 'Identifier' === e.property.type ? e.property.name : '');
              }
              break;
            case 'Property':
              switch (n) {
                case 'ONLYLITERAL':
                  r += 'Property names must be literals or identifiers';
              }
              break;
            case 'Literal':
              break;
            case 'CallExpression':
              switch (n) {
                case 'WRONGSIGNATURE':
                  (r += 'Function signature does not match: '),
                    (r += 'Identifier' === e.callee.type ? e.callee.name : '');
                  break;
                case 'ONLYNODESUPPORTED':
                  (r += 'Functions must be declared.'),
                    (r += 'Identifier' === e.callee.type ? e.callee.name : '');
                  break;
                case 'NOTAFUNCTION':
                  (r += 'Not a Function: '),
                    (r += 'Identifier' === e.callee.type ? e.callee.name : '');
                  break;
                case 'NOTFOUND':
                  r +=
                    'Function Not Found: ' + ('Identifier' === e.callee.type ? e.callee.name : '');
              }
              break;
            case 'UnaryExpression':
              switch (n) {
                case 'NOTSUPPORTEDUNARYOPERATOR':
                  r +=
                    'Operator ' +
                    e.operator +
                    ' not allowed in this context. Only ! can be used with boolean, and - with a number';
                  break;
                case 'NOTSUPPORTEDTYPE':
                  r += 'Unary operator ' + e.operator + ' cannot be used with this argument.';
              }
            case 'BinaryExpression':
              switch (n) {
                case 'OPERATORNOTRECOGNISED':
                  r += 'Binary Operator not recognised ' + e.operator;
              }
              break;
            case 'LogicalExpression':
              switch (n) {
                case 'ONLYBOOLEAN':
                  r +=
                    'Operator ' + e.operator + ' cannot be used. Only || or && are allowed values';
                  break;
                case 'ONLYORORAND':
                  r +=
                    'Logical Expression ' +
                    e.operator +
                    ' being applied to parameters that are not boolean.';
              }
              break;
            case 'ConditionalExpression':
              r += 'Conditional statements not supported.';
              break;
            case 'ArrayExpression':
              switch (n) {
                case 'FUNCTIONCONTEXTILLEGAL':
                  r += ' Cannot Put Function inside Array.';
              }
              break;
            default:
              r += 'Expression contains unrecognised code structures.';
          }
        } catch (e) {
          throw e;
        }
        return r;
      }
      function gt(e, t, n) {
        return { line: e.loc.start.line, character: e.loc.start.column, reason: mt(e, t, n) };
      }
      function Dt(e, t, n, r, i = !0) {
        if (null === e) throw new Error('Unnexpexted Expression Syntax');
        let s = null;
        try {
          switch (e.type) {
            case 'VariableDeclarator':
              return null !== e.init && 'FunctionExpression' === e.init.type
                ? void r.push(gt(e, 'SYNTAX', 'FUNCTIONVARIABLEDECLARATOR'))
                : ('Identifier' !== e.id.type
                    ? r.push(gt(e, 'SYNTAX', 'VARIABLEMUSTHAVEIDENTIFIER'))
                    : (null !== t.localScope
                        ? t.localScope[e.id.name.toLowerCase()]
                        : t.globalScope[e.id.name.toLowerCase()],
                      null === t.localScope
                        ? (t.globalScope[e.id.name.toLowerCase()] = { type: 'any' })
                        : (t.localScope[e.id.name.toLowerCase()] = { type: 'any' })),
                  void (null !== e.init && Dt(e.init, t, n, r, i)));
            case 'FunctionDeclaration':
              return (
                !1 === i && r.push(gt(e, 'SYNTAX', 'GLOBALFUNCTIONSONLY')),
                'Identifier' !== e.id.type && r.push(gt(e, 'SYNTAX', 'FUNCTIONMUSTHAVEIDENTIFIER')),
                (s = ht('', e)),
                (function (e, t, n, r) {
                  const i = { globalScope: t.globalScope, localScope: {} };
                  for (let t = 0; t < e.params.length; t++) {
                    const n = e.params[t].name;
                    i.localScope[n.toLowerCase()] = { type: 'any' };
                  }
                  Dt(e.body, i, n, r, !1);
                })(e, t, n, r),
                null !== t.localScope && r.push(gt(e, 'SYNTAX', 'GLOBALFUNCTIONSONLY')),
                (s.isnative = !1),
                void (
                  'Identifier' === e.id.type &&
                  (t.globalScope[e.id.name.toLowerCase()] = {
                    type: 'FormulaFunction',
                    signature: [s],
                  })
                )
              );
            case 'VariableDeclaration':
              for (let s = 0; s < e.declarations.length; s++) Dt(e.declarations[s], t, n, r, i);
              return;
            case 'IfStatement':
              return (
                null !== e.test &&
                  (Dt(e.test, t, n, r, i),
                  ('AssignmentExpression' !== e.test.type && 'UpdateExpression' !== e.test.type) ||
                    r.push(gt(e.test, 'SYNTAX', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION'))),
                null !== e.consequent && Dt(e.consequent, t, n, r, i),
                void (null !== e.alternate && Dt(e.alternate, t, n, r, i))
              );
            case 'EmptyStatement':
              return;
            case 'BlockStatement':
              if (null !== e.body)
                for (let s = 0; s < e.body.length; s++) Dt(e.body[s], t, n, r, i);
              return;
            case 'ReturnStatement':
              return void (null !== e.argument && Dt(e.argument, t, n, r, i));
            case 'ForInStatement':
              return (
                'VariableDeclaration' === e.left.type
                  ? (e.left.declarations.length > 1 && r.push(gt(e, 'SYNTAX', 'ONLY1VAR')),
                    null !== e.left.declarations[0].init &&
                      r.push(gt(e, 'SYNTAX', 'CANNOTDECLAREVAL')))
                  : 'Identifier' !== e.left.type && r.push(gt(e, 'SYNTAX', 'LEFTNOTVAR')),
                Dt(e.left, t, n, r, i),
                Dt(e.right, t, n, r, i),
                void Dt(e.body, t, n, r, i)
              );
            case 'ForStatement':
              return (
                null !== e.init && Dt(e.init, t, n, r, i),
                null !== e.test && Dt(e.test, t, n, r, i),
                null !== e.body && Dt(e.body, t, n, r, i),
                void (null !== e.update && Dt(e.update, t, n, r, i))
              );
            case 'BreakStatement':
            case 'ContinueStatement':
              return;
            case 'UpdateExpression':
              if ('Identifier' !== e.argument.type && 'MemberExpression' !== e.argument.type)
                r.push(gt(e, 'SYNTAX', 'ASSIGNMENTTOVARSONLY'));
              else {
                if ('Identifier' === e.argument.type) {
                  let i = !1;
                  !1 === n &&
                    (null !== t.localScope &&
                      void 0 !== t.localScope[e.argument.name.toLowerCase()] &&
                      (i = !0),
                    void 0 !== t.globalScope[e.argument.name.toLowerCase()] && (i = !0),
                    !1 === i &&
                      r.push({
                        line: null === e ? 0 : e.loc.start.line,
                        character: null === e ? 0 : e.loc.start.column,
                        reason: 'Identifier ' + e.argument.name + ' has not been declared.',
                      }));
                }
                'MemberExpression' === e.argument.type && Dt(e.argument, t, n, r, i);
              }
              return;
            case 'AssignmentExpression': {
              switch (
                ('Identifier' !== e.left.type &&
                  'MemberExpression' !== e.left.type &&
                  r.push(gt(e, 'SYNTAX', 'ASSIGNMENTTOVARSONLY')),
                e.operator)
              ) {
                case '=':
                case '/=':
                case '*=':
                case '%=':
                case '+=':
                case '-=':
                  break;
                default:
                  r.push(gt(e, 'SYNTAX', 'OPERATORNOTRECOGNISED'));
              }
              Dt(e.right, t, n, r, i);
              let s = !1;
              return (
                'Identifier' === e.left.type &&
                  (null !== t.localScope &&
                    void 0 !== t.localScope[e.left.name.toLowerCase()] &&
                    (s = !0),
                  void 0 !== t.globalScope[e.left.name.toLowerCase()] && (s = !0),
                  !1 === n &&
                    !1 === s &&
                    r.push({
                      line: null === e ? 0 : e.loc.start.line,
                      character: null === e ? 0 : e.loc.start.column,
                      reason: 'Identifier ' + e.left.name + ' has not been declared.',
                    })),
                void ('MemberExpression' === e.left.type && Dt(e.left, t, n, r, i))
              );
            }
            case 'ExpressionStatement':
              return (
                'AssignmentExpression' === e.expression.type || e.expression.type,
                void Dt(e.expression, t, n, r, i)
              );
            case 'Identifier': {
              const i = e.name.toLowerCase();
              if (null !== t.localScope && void 0 !== t.localScope[i]) return;
              if (void 0 !== t.globalScope[i]) return;
              !1 === n && r.push(gt(e, 'SYNTAX', 'VARIABLENOTFOUND'));
              break;
            }
            case 'MemberExpression':
              return (
                Dt(e.object, t, n, r, i), void (!0 === e.computed && Dt(e.property, t, n, r, i))
              );
            case 'Literal':
            case 'TemplateElement':
              return;
            case 'CallExpression':
              'Identifier' !== e.callee.type && r.push(gt(e, 'SYNTAX', 'ONLYNODESSUPPORTED'));
              for (let s = 0; s < e.arguments.length; s++) Dt(e.arguments[s], t, n, r, i);
              if ('Identifier' === e.callee.type) {
                const i = rt(e.callee.name, e.arguments, t);
                !1 === n && -1 === i && r.push(gt(e, 'SYNTAX', 'NOTFOUND')),
                  -2 === i && r.push(gt(e, 'SYNTAX', 'WRONGSIGNATURE'));
              }
              return;
            case 'UnaryExpression':
              return void Dt(e.argument, t, n, r, i);
            case 'BinaryExpression':
              switch ((Dt(e.left, t, n, r, i), Dt(e.right, t, n, r, i), e.operator)) {
                case '==':
                case '!=':
                case '<':
                case '<=':
                case '>':
                case '>=':
                case '+':
                case '-':
                case '*':
                case '/':
                case '%':
                case '&':
                case '|':
                case '^':
                case '<<':
                case '>>':
                case '>>>':
                  break;
                default:
                  r.push(gt(e, 'SYNTAX', 'OPERATORNOTRECOGNISED'));
              }
              return;
            case 'LogicalExpression':
              switch (e.operator) {
                case '&&':
                case '||':
                  break;
                default:
                  r.push(gt(e, 'SYNTAX', 'OPERATORNOTRECOGNISED'));
              }
              return (
                Dt(e.left, t, n, r, i),
                ('AssignmentExpression' !== e.left.type && 'UpdateExpression' !== e.left.type) ||
                  r.push(gt(e, 'SYNTAX', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION')),
                Dt(e.right, t, n, r, i),
                void (
                  ('AssignmentExpression' !== e.right.type &&
                    'UpdateExpression' !== e.right.type) ||
                  r.push(gt(e, 'SYNTAX', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION'))
                )
              );
            case 'ConditionalExpression':
              r.push(gt(e, 'SYNTAX', 'NOTSUPPORTED'));
              break;
            case 'ArrayExpression':
              for (let s = 0; s < e.elements.length; s++) Dt(e.elements[s], t, n, r, i);
              return;
            case 'TemplateLiteral':
              for (let s = 0; s < e.quasis.length; s++) Dt(e.quasis[s], t, n, r, i);
              for (let s = 0; s < e.expressions.length; s++) Dt(e.expressions[s], t, n, r, i);
              return;
            case 'ObjectExpression':
              for (let s = 0; s < e.properties.length; s++) Dt(e.properties[s], t, n, r, i);
              return;
            case 'Property':
              return (
                'Literal' !== e.key.type &&
                  'Identifier' !== e.key.type &&
                  r.push(gt(e, 'SYNTAX', 'ONLYLITERAL')),
                'Literal' === e.key.type && Dt(e.key, t, n, r, i),
                void Dt(e.value, t, n, r, i)
              );
            default:
              r.push(gt(e, 'SYNTAX', 'UNRECOGNISED'));
          }
          return;
        } catch (t) {
          r.push({
            line: null === e ? 0 : e.loc.start.line,
            character: null === e ? 0 : e.loc.start.column,
            reason: 'Unnexpected Syntax',
          });
        }
      }
      function yt(e) {
        const t = [];
        return (
          st(
            e,
            (e) => (
              'CallExpression' === e.type &&
                'Identifier' === e.callee.type &&
                t.push(e.callee.name.toLowerCase()),
              !0
            ),
          ),
          t
        );
      }
      function Et(e, t = []) {
        let n = null;
        if (void 0 === e.usesFeatureSet) {
          null === n && (n = yt(e)), (e.usesFeatureSet = !1);
          for (let t = 0; t < n.length; t++)
            Qe.indexOf(n[t]) > -1 && ((e.usesFeatureSet = !0), (e.isAsync = !0));
          if (!1 === e.usesFeatureSet && t && t.length > 0)
            for (const n of t)
              if (ut(e, n)) {
                (e.usesFeatureSet = !0), (e.isAsync = !0);
                break;
              }
        }
        if (void 0 === e.usesGeometry) {
          (e.usesGeometry = !1), null === n && (n = yt(e));
          for (let t = 0; t < n.length; t++) et.indexOf(n[t]) > -1 && (e.usesGeometry = !0);
        }
      }
      function xt(e, t) {
        (e.array = function (e, n) {
          return t(e, n, function (e, t, n) {
            J(n, 1, 2);
            const r = oe(n[0]);
            if (isNaN(r) || !1 === z(r)) throw new Error('Invalid Parameter');
            const i = U(n[1], null),
              s = new Array(r);
            return s.fill(i), s;
          });
        }),
          (e.front = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 1), q(n[0]))) {
                if (n[0].length() <= 0) throw new Error('Array is empty');
                return n[0].get(0);
              }
              if (j(n[0])) {
                if (n[0].length <= 0) throw new Error('Array is empty');
                return n[0][0];
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.back = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 1), q(n[0]))) {
                if (n[0].length() <= 0) throw new Error('Array is empty');
                return n[0].get(n[0].length() - 1);
              }
              if (j(n[0])) {
                if (n[0].length <= 0) throw new Error('Array is empty');
                return n[0][n[0].length - 1];
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.push = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 2), j(n[0]))) return (n[0][n[0].length] = n[1]), n[0].length;
              throw new Error('Invalid Parameter');
            });
          }),
          (e.pop = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 1), j(n[0]))) {
                if (n[0].length <= 0) throw new Error('Array is empty');
                const e = n[0][n[0].length - 1];
                return (n[0].length = n[0].length - 1), e;
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.erase = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 2, 2), j(n[0]))) {
                let e = oe(n[1]);
                if (isNaN(e) || !1 === z(e)) throw new Error('Invalid Parameter');
                const t = n[0];
                if (t.length <= 0) throw new Error('Array is empty');
                if ((e < 0 && (e = t.length + e), e < 0)) throw new Error('Element not found');
                if (e >= t.length) throw new Error('Index is greater than array');
                return t.splice(e, 1), _;
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.insert = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 3, 3), j(n[0]))) {
                const e = oe(n[1]);
                if (isNaN(e) || !1 === z(e)) throw new Error('Invalid Parameter');
                const t = n[2],
                  r = n[0];
                if (e > r.length) throw new Error('Index is greater than array');
                if (e < 0 && e < -1 * r.length) throw new Error('Index is greater than array');
                return e === r.length ? ((r[e] = t), _) : (r.splice(e, 0, t), _);
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.resize = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 2, 3), j(n[0]))) {
                const e = oe(n[1]);
                if (isNaN(e) || !1 === z(e)) throw new Error('Invalid Parameter');
                if (e < 0) throw new Error('Size cannot be negative');
                const t = U(n[2], null),
                  r = n[0];
                if (r.length >= e) return (r.length = e), _;
                const i = r.length;
                r.length = e;
                for (let e = i; e < r.length; e++) r[e] = t;
                return _;
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.includes = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 2, 2), j(n[0]))) {
                const e = n[1];
                return n[0].findIndex((t) => te(t, e)) > -1;
              }
              if (q(n[0])) {
                const e = n[1];
                return n[0].toArray().findIndex((t) => te(t, e)) > -1;
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.slice = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 3), j(n[0]))) {
                const e = oe(U(n[1], 0)),
                  t = oe(U(n[2], n[0].length));
                if (isNaN(e) || !1 === z(e)) throw new Error('Invalid Parameter');
                if (isNaN(t) || !1 === z(t)) throw new Error('Invalid Parameter');
                return n[0].slice(e, t);
              }
              if (q(n[0])) {
                const e = n[0],
                  t = oe(U(n[1], 0)),
                  r = oe(U(n[2], e.length()));
                if (isNaN(t) || !1 === z(t)) throw new Error('Invalid Parameter');
                if (isNaN(r) || !1 === z(r)) throw new Error('Invalid Parameter');
                return e.toArray().slice(t, r);
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.splice = function (e, n) {
            return t(e, n, function (e, t, n) {
              const r = [];
              for (let e = 0; e < n.length; e++)
                j(n[e]) ? r.push(...n[e]) : q(n[e]) ? r.push(...n[e].toArray()) : r.push(n[e]);
              return r;
            });
          });
      }
      function At(e) {
        const t = new Date(e.getTime()),
          n = t.getFullYear(),
          r = new Date(0);
        r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
        const i = wt(r),
          s = new Date(0);
        s.setFullYear(n, 0, 4), s.setHours(0, 0, 0, 0);
        const o = wt(s);
        return t.getTime() >= i.getTime() ? n + 1 : t.getTime() >= o.getTime() ? n : n - 1;
      }
      function wt(e) {
        const t = new Date(e.getTime()),
          n = t.getDay(),
          r = (n < 1 ? 7 : 0) + n - 1;
        return t.setDate(t.getDate() - r), t.setHours(0, 0, 0, 0), t;
      }
      function Ct(e) {
        return null === e ? e : isNaN(e.getTime()) ? null : e;
      }
      function Ft(e, t) {
        (e.today = function (e, n) {
          return t(e, n, function (e, t, n) {
            J(n, 0, 0);
            const r = new Date();
            return r.setHours(0, 0, 0, 0), r;
          });
        }),
          (e.now = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 0, 0), new Date();
            });
          }),
          (e.timestamp = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 0, 0);
              let r = new Date();
              return (
                (r = new Date(
                  r.getUTCFullYear(),
                  r.getUTCMonth(),
                  r.getUTCDate(),
                  r.getUTCHours(),
                  r.getUTCMinutes(),
                  r.getUTCSeconds(),
                  r.getUTCMilliseconds(),
                )),
                r
              );
            });
          }),
          (e.toutc = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r
                ? null
                : new Date(
                    r.getUTCFullYear(),
                    r.getUTCMonth(),
                    r.getUTCDate(),
                    r.getUTCHours(),
                    r.getUTCMinutes(),
                    r.getUTCSeconds(),
                    r.getUTCMilliseconds(),
                  );
            });
          }),
          (e.tolocal = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r
                ? null
                : be.Moment.utc([
                    r.getFullYear(),
                    r.getMonth(),
                    r.getDate(),
                    r.getHours(),
                    r.getMinutes(),
                    r.getSeconds(),
                    r.getMilliseconds(),
                  ]).toDate();
            });
          }),
          (e.day = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r ? NaN : r.getDate();
            });
          }),
          (e.month = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r ? NaN : r.getMonth();
            });
          }),
          (e.year = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r ? NaN : r.getFullYear();
            });
          }),
          (e.hour = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r ? NaN : r.getHours();
            });
          }),
          (e.second = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r ? NaN : r.getSeconds();
            });
          }),
          (e.millisecond = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r ? NaN : r.getMilliseconds();
            });
          }),
          (e.minute = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r ? NaN : r.getMinutes();
            });
          }),
          (e.weekday = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r ? NaN : r.getDay();
            });
          }),
          (e.isoweekday = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              if (null === r) return NaN;
              let i = r.getDay();
              return 0 === i && (i = 7), i;
            });
          }),
          (e.isomonth = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r ? NaN : r.getMonth() + 1;
            });
          }),
          (e.isoweek = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              if (null === r) return NaN;
              const i =
                wt(r).getTime() -
                (function (e) {
                  const t = At(e),
                    n = new Date(0);
                  return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), wt(n);
                })(r).getTime();
              return Math.round(i / 6048e5) + 1;
            });
          }),
          (e.isoyear = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = ae(n[0]);
              return null === r ? NaN : At(r);
            });
          }),
          (e.date = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 0, 7), 3 === n.length))
                return Ct(new Date(oe(n[0]), oe(n[1]), oe(n[2]), 0, 0, 0, 0));
              if (4 === n.length)
                return Ct(new Date(oe(n[0]), oe(n[1]), oe(n[2]), oe(n[3]), 0, 0, 0));
              if (5 === n.length)
                return Ct(new Date(oe(n[0]), oe(n[1]), oe(n[2]), oe(n[3]), oe(n[4]), 0, 0));
              if (6 === n.length)
                return Ct(new Date(oe(n[0]), oe(n[1]), oe(n[2]), oe(n[3]), oe(n[4]), oe(n[5]), 0));
              if (7 === n.length)
                return Ct(
                  new Date(oe(n[0]), oe(n[1]), oe(n[2]), oe(n[3]), oe(n[4]), oe(n[5]), oe(n[6])),
                );
              if (2 === n.length) {
                let e = ne(n[1]);
                if ('' === e) return null;
                e = $(e);
                const t = be.Moment(ne(n[0]), e, !0);
                return !0 === t.isValid() ? t.toDate() : null;
              }
              if (1 === n.length) {
                if (L(n[0])) {
                  if ('' === n[0].replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '')) return null;
                  if (!0 === /^[0-9][0-9][0-9][0-9]$/.test(n[0])) return ae(n[0] + '-01-01');
                }
                const e = oe(n[0]);
                return !1 === isNaN(e) ? Ct(new Date(e)) : ae(n[0]);
              }
              return 0 === n.length ? new Date() : void 0;
            });
          }),
          (e.datediff = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 2, 3);
              const r = ue(n[0]),
                i = ue(n[1]);
              if (null === r || null === i) return NaN;
              switch (ne(n[2]).toLowerCase()) {
                case 'days':
                case 'day':
                case 'd':
                  return r.diff(i, 'days', !0);
                case 'months':
                case 'month':
                  return r.diff(i, 'months', !0);
                case 'minutes':
                case 'minute':
                case 'm':
                  return 'M' === n[2] ? r.diff(i, 'months', !0) : r.diff(i, 'minutes', !0);
                case 'seconds':
                case 'second':
                case 's':
                  return r.diff(i, 'seconds', !0);
                case 'milliseconds':
                case 'millisecond':
                case 'ms':
                  return r.diff(i);
                case 'hours':
                case 'hour':
                case 'h':
                  return r.diff(i, 'hours', !0);
                case 'years':
                case 'year':
                case 'y':
                  return r.diff(i, 'years', !0);
                default:
                  return r.diff(i);
              }
            });
          }),
          (e.dateadd = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 2, 3);
              const r = ue(n[0]);
              if (null === r) return null;
              let i = 'milliseconds';
              switch (ne(n[2]).toLowerCase()) {
                case 'days':
                case 'day':
                case 'd':
                  i = 'days';
                  break;
                case 'months':
                case 'month':
                  i = 'months';
                  break;
                case 'minutes':
                case 'minute':
                case 'm':
                  i = 'M' === n[2] ? 'months' : 'minutes';
                  break;
                case 'seconds':
                case 'second':
                case 's':
                  i = 'seconds';
                  break;
                case 'milliseconds':
                case 'millisecond':
                case 'ms':
                  i = 'milliseconds';
                  break;
                case 'hours':
                case 'hour':
                case 'h':
                  i = 'hours';
                  break;
                case 'years':
                case 'year':
                case 'y':
                  i = 'years';
              }
              return r.add(oe(n[1]), i), r.toDate();
            });
          });
      }
      function bt(e, t, n) {
        const r = { x: 0, y: 0 };
        t && (r.z = 0), n && (r.m = 0);
        let i = 0,
          s = e[0];
        for (let o = 0; o < e.length; o++) {
          const a = e[o];
          if (!1 === Tt(a, s)) {
            const e = It(s, a, t),
              o = Nt(s, a, t, n);
            (o.x *= e),
              (o.y *= e),
              (r.x += o.x),
              (r.y += o.y),
              t && ((o.z *= e), (r.z += o.z)),
              n && ((o.m *= e), (r.m += o.m)),
              (i += e),
              (s = a);
          }
        }
        return (
          i > 0
            ? ((r.x /= i), (r.y /= i), t && (r.z /= i), n && (r.m /= i))
            : ((r.x = e[0][0]),
              (r.y = e[0][1]),
              t && (r.z = e[0][2]),
              n && t ? (r.m = e[0][3]) : n && (r.m = e[0][2])),
          r
        );
      }
      function Nt(e, t, n, r) {
        const i = { x: (e[0] + t[0]) / 2, y: (e[1] + t[1]) / 2 };
        return (
          n && (i.z = (e[2] + t[2]) / 2),
          n && r ? (i.m = (e[3] + t[3]) / 2) : r && (i.m = (e[2] + t[2]) / 2),
          i
        );
      }
      function St(e, t) {
        if (e.length <= 1) return 0;
        let n = 0;
        for (let r = 1; r < e.length; r++) n += It(e[r - 1], e[r], t);
        return n;
      }
      function It(e, t, n) {
        const r = t[0] - e[0],
          i = t[1] - e[1];
        if (n) {
          const e = t[2] - t[2];
          return Math.sqrt(r * r + i * i + e * e);
        }
        return Math.sqrt(r * r + i * i);
      }
      function Tt(e, t) {
        if (e.length !== t.length) return !1;
        for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
        return !0;
      }
      function vt(e) {
        const t = { x: 0, y: 0, spatialReference: e.spatialReference.toJSON() },
          n = { x: 0, y: 0, spatialReference: e.spatialReference.toJSON() };
        let i = 0,
          s = 0;
        for (let r = 0; r < e.paths.length; r++) {
          if (0 === e.paths[r].length) continue;
          const o = St(e.paths[r], !0 === e.hasZ);
          if (0 === o) {
            const n = bt(e.paths[r], !0 === e.hasZ, !0 === e.hasM);
            (t.x += n.x),
              (t.y += n.y),
              !0 === e.hasZ && (t.z += n.z),
              !0 === e.hasM && (t.m += n.m),
              ++i;
          } else {
            const t = bt(e.paths[r], !0 === e.hasZ, !0 === e.hasM);
            (n.x += t.x * o),
              (n.y += t.y * o),
              !0 === e.hasZ && (n.z += t.z * o),
              !0 === e.hasM && (n.m += t.m * o),
              (s += o);
          }
        }
        return s > 0
          ? ((n.x /= s),
            (n.y /= s),
            !0 === e.hasZ && (n.z /= s),
            !0 === e.hasM && (n.m /= s),
            new r.Z(n))
          : i > 0
          ? ((t.x /= i),
            (t.y /= i),
            !0 === e.hasZ && (n.z /= i),
            !0 === e.hasM && (t.m /= i),
            new r.Z(t))
          : null;
      }
      function kt(e) {
        if (0 === e.points.length) return null;
        let t = 0,
          n = 0,
          i = 0,
          s = 0;
        for (let r = 0; r < e.points.length; r++) {
          const o = e.getPoint(r);
          !0 === o.hasZ && (i += o.z),
            !0 === o.hasM && (s += o.m),
            (t += o.x),
            (n += o.y),
            (s += o.m);
        }
        const o = { x: t / e.points.length, y: n / e.points.length, spatialReference: null };
        return (
          (o.spatialReference = e.spatialReference.toJSON()),
          !0 === e.hasZ && (o.z = i / e.points.length),
          !0 === e.hasM && (o.m = s / e.points.length),
          new r.Z(o)
        );
      }
      function _t(e, t, n = 0) {
        for (; e < n; ) e += t;
        const r = n + t;
        for (; e >= r; ) e -= t;
        return e;
      }
      function Ot(e, t) {
        return Math.atan2(t.y - e.y, t.x - e.x);
      }
      function Bt(e, t, n) {
        const r = { x: e.x - t.x, y: e.y - t.y },
          i = { x: n.x - t.x, y: n.y - t.y };
        return Math.atan2(
          (s = r).x * (o = i).y - o.x * s.y,
          (function (e, t) {
            return e.x * t.x + e.y * t.y;
          })(r, i),
        );
        var s, o;
      }
      const Rt = [0, 0];
      function Mt(e) {
        for (let t = 0; t < e.length; t++) {
          const n = e[t];
          for (let r = 0; r < n.length - 1; r++) {
            const i = n[r],
              o = n[r + 1];
            for (let n = t + 1; n < e.length; n++)
              for (let t = 0; t < e[n].length - 1; t++) {
                const r = e[n][t],
                  a = e[n][t + 1];
                if (
                  (0, s.s)(i, o, r, a, Rt) &&
                  !(
                    (Rt[0] === i[0] && Rt[1] === i[1]) ||
                    (Rt[0] === r[0] && Rt[1] === r[1]) ||
                    (Rt[0] === o[0] && Rt[1] === o[1]) ||
                    (Rt[0] === a[0] && Rt[1] === a[1])
                  )
                )
                  return !0;
              }
          }
          const r = n.length;
          if (!(r < 3))
            for (let e = 0; e <= r - 2; e++) {
              const t = n[e],
                i = n[e + 1];
              for (let o = e + 2; o <= r - 2; o++) {
                const e = n[o],
                  r = n[o + 1];
                if (
                  (0, s.s)(t, i, e, r, Rt) &&
                  !(
                    (Rt[0] === t[0] && Rt[1] === t[1]) ||
                    (Rt[0] === e[0] && Rt[1] === e[1]) ||
                    (Rt[0] === i[0] && Rt[1] === i[1]) ||
                    (Rt[0] === r[0] && Rt[1] === r[1])
                  )
                )
                  return !0;
              }
            }
        }
        return !1;
      }
      function Pt(e) {
        return e instanceof Ke || ('object' == typeof e && 'FeatureSetReader' === e.type);
      }
      function Ut(e, t) {
        (e.ringisclockwise = function (e, n) {
          return t(e, n, function (e, t, n) {
            J(n, 1, 1);
            let i = [],
              s = !1,
              o = !1;
            if (null === n[0]) return !1;
            if (j(n[0])) {
              for (const e of n[0]) {
                if (!(e instanceof r.Z)) throw new Error('Invalid Argument');
                i.push(e.hasZ ? (e.hasM ? [e.x, e.y, e.z, e.m] : [e.x, e.y, e.z]) : [e.x, e.y]);
              }
              i.length > 0 && ((s = n[0][0].hasZ), (o = n[0][0].hasM));
            } else if (n[0] instanceof w)
              (i = n[0]._elements), i.length > 0 && ((s = n[0]._hasZ), (o = n[0]._hasM));
            else {
              if (!q(n[0])) throw new Error('Invalid Argument');
              for (const e of n[0].toArray()) {
                if (!(e instanceof r.Z)) throw new Error('Invalid Argument');
                i.push(e.hasZ ? (e.hasM ? [e.x, e.y, e.z, e.m] : [e.x, e.y, e.z]) : [e.x, e.y]);
              }
              i.length > 0 && ((s = n[0].get(0).hasZ), (o = n[0].get(0).hasM));
            }
            return !(i.length < 3) && (0, u.i)(i, o, s);
          });
        }),
          (e.polygon = function (e, n) {
            return t(e, n, function (t, n, r) {
              J(r, 1, 1);
              let i = null;
              if (r[0] instanceof _e) {
                if (
                  ((i = ce(Ke.parseGeometryFromDictionary(r[0]), e.spatialReference)),
                  i instanceof u.Z == 0)
                )
                  throw new Error('Illegal Parameter');
              } else i = r[0] instanceof u.Z ? (0, f.im)(r[0].toJSON()) : ce(new u.Z(JSON.parse(r[0])), e.spatialReference);
              if (null !== i && !1 === i.spatialReference.equals(e.spatialReference))
                throw new Error(
                  'Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.',
                );
              return he(i);
            });
          }),
          (e.polyline = function (e, n) {
            return t(e, n, function (t, n, r) {
              J(r, 1, 1);
              let i = null;
              if (r[0] instanceof _e) {
                if (
                  ((i = ce(Ke.parseGeometryFromDictionary(r[0]), e.spatialReference)),
                  i instanceof l.Z == 0)
                )
                  throw new Error('Illegal Parameter');
              } else i = r[0] instanceof l.Z ? (0, f.im)(r[0].toJSON()) : ce(new l.Z(JSON.parse(r[0])), e.spatialReference);
              if (null !== i && !1 === i.spatialReference.equals(e.spatialReference))
                throw new Error(
                  'Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.',
                );
              return he(i);
            });
          }),
          (e.point = function (e, n) {
            return t(e, n, function (t, n, i) {
              J(i, 1, 1);
              let s = null;
              if (i[0] instanceof _e) {
                if (
                  ((s = ce(Ke.parseGeometryFromDictionary(i[0]), e.spatialReference)),
                  s instanceof r.Z == 0)
                )
                  throw new Error('Illegal Parameter');
              } else s = i[0] instanceof r.Z ? (0, f.im)(i[0].toJSON()) : ce(new r.Z(JSON.parse(i[0])), e.spatialReference);
              if (null !== s && !1 === s.spatialReference.equals(e.spatialReference))
                throw new Error(
                  'Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.',
                );
              return he(s);
            });
          }),
          (e.multipoint = function (e, n) {
            return t(e, n, function (t, n, r) {
              J(r, 1, 1);
              let i = null;
              if (r[0] instanceof _e) {
                if (
                  ((i = ce(Ke.parseGeometryFromDictionary(r[0]), e.spatialReference)),
                  i instanceof a.Z == 0)
                )
                  throw new Error('Illegal Parameter');
              } else i = r[0] instanceof a.Z ? (0, f.im)(r[0].toJSON()) : ce(new a.Z(JSON.parse(r[0])), e.spatialReference);
              if (null !== i && !1 === i.spatialReference.equals(e.spatialReference))
                throw new Error(
                  'Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.',
                );
              return he(i);
            });
          }),
          (e.extent = function (e, n) {
            return t(e, n, function (t, n, i) {
              J((i = De(i)), 1, 1);
              let o = null;
              if (i[0] instanceof _e)
                o = ce(Ke.parseGeometryFromDictionary(i[0]), e.spatialReference);
              else if (i[0] instanceof r.Z) {
                const e = {
                    xmin: i[0].x,
                    ymin: i[0].y,
                    xmax: i[0].x,
                    ymax: i[0].y,
                    spatialReference: i[0].spatialReference.toJSON(),
                  },
                  t = i[0];
                t.hasZ
                  ? ((e.zmin = t.z), (e.zmax = t.z))
                  : t.hasM && ((e.mmin = t.m), (e.mmax = t.m)),
                  (o = (0, f.im)(e));
              } else
                o =
                  i[0] instanceof u.Z || i[0] instanceof l.Z || i[0] instanceof a.Z
                    ? (0, f.im)(i[0].extent.toJSON())
                    : i[0] instanceof s.Z
                    ? (0, f.im)(i[0].toJSON())
                    : ce(new s.Z(JSON.parse(i[0])), e.spatialReference);
              if (null !== o && !1 === o.spatialReference.equals(e.spatialReference))
                throw new Error(
                  'Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.',
                );
              return he(o);
            });
          }),
          (e.geometry = function (e, n) {
            return t(e, n, function (t, n, r) {
              J(r, 1, 1);
              let i = null;
              if (
                ((i = Pt(r[0])
                  ? ce(r[0].geometry(), e.spatialReference)
                  : r[0] instanceof _e
                  ? ce(Ke.parseGeometryFromDictionary(r[0]), e.spatialReference)
                  : ce((0, f.im)(JSON.parse(r[0])), e.spatialReference)),
                null !== i && !1 === i.spatialReference.equals(e.spatialReference))
              )
                throw new Error(
                  'Cannot create Geometry in this SpatialReference. Engine is using a different spatial reference.',
                );
              return he(i);
            });
          }),
          (e.setgeometry = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 2, 2), !Pt(n[0]))) throw new Error('Illegal Argument');
              if (!0 === n[0].immutable) throw new Error('Feature is Immutable');
              if (!(n[1] instanceof o.Z || null === n[1])) throw new Error('Illegal Argument');
              return (n[0]._geometry = n[1]), _;
            });
          }),
          (e.feature = function (e, n) {
            return t(e, n, function (t, n, r) {
              if (0 === r.length) throw new Error('Missing Parameters');
              let i = null;
              if (1 === r.length)
                if (L(r[0])) i = Ke.fromJson(JSON.parse(r[0]));
                else if (Pt(r[0])) i = Ke.createFromArcadeFeature(r[0]);
                else if (r[0] instanceof o.Z) i = Ke.createFromGraphicLikeObject(r[0], null, null);
                else {
                  if (!(r[0] instanceof _e)) throw new Error('Illegal Argument');
                  {
                    let e = r[0].hasField('geometry') ? r[0].field('geometry') : null,
                      t = r[0].hasField('attributes') ? r[0].field('attributes') : null;
                    null !== e && e instanceof _e && (e = Ke.parseGeometryFromDictionary(e)),
                      null !== t && (t = Ke.parseAttributesFromDictionary(t)),
                      (i = Ke.createFromGraphicLikeObject(e, t, null));
                  }
                }
              else if (2 === r.length) {
                let e = null,
                  t = null;
                if (null !== r[0])
                  if (r[0] instanceof o.Z) e = r[0];
                  else {
                    if (!(e instanceof _e)) throw new Error('Illegal Argument');
                    e = Ke.parseGeometryFromDictionary(r[0]);
                  }
                if (null !== r[1]) {
                  if (!(r[1] instanceof _e)) throw new Error('Illegal Argument');
                  t = Ke.parseAttributesFromDictionary(r[1]);
                }
                i = Ke.createFromGraphicLikeObject(e, t, null);
              } else {
                let e = null;
                const t = {};
                if (null !== r[0])
                  if (r[0] instanceof o.Z) e = r[0];
                  else {
                    if (!(e instanceof _e)) throw new Error('Illegal Argument');
                    e = Ke.parseGeometryFromDictionary(r[0]);
                  }
                for (let e = 1; e < r.length; e += 2) {
                  const n = ne(r[e]),
                    i = r[e + 1];
                  if (!(null == i || L(i) || isNaN(i) || H(i) || Z(i) || G(i)))
                    throw new Error('Illegal Argument');
                  if (M(i) || !1 === P(i)) throw new Error('Illegal Argument');
                  t[n] = i === _ ? null : i;
                }
                i = Ke.createFromGraphicLikeObject(e, t, null);
              }
              return (i._geometry = ce(i.geometry(), e.spatialReference)), (i.immutable = !1), i;
            });
          }),
          (e.dictionary = function (e, n) {
            return t(e, n, function (e, t, n) {
              if (0 === n.length) {
                const e = new _e();
                return (e.immutable = !1), e;
              }
              if (1 === n.length && L(n[0]))
                try {
                  const e = JSON.parse(n[0]),
                    t = _e.convertObjectToArcadeDictionary(e, !1);
                  return (t.immutable = !1), t;
                } catch (e) {
                  throw new Error('Missing Parameters or Illegal Json');
                }
              if (n.length % 2 != 0) throw new Error('Missing Parameters');
              const r = {};
              for (let e = 0; e < n.length; e += 2) {
                const t = ne(n[e]),
                  i = n[e + 1];
                if (!(null == i || L(i) || isNaN(i) || H(i) || Z(i) || G(i) || j(i) || q(i)))
                  throw new Error('Illegal Argument');
                if (M(i)) throw new Error('Illegal Argument');
                r[t] = i === _ ? null : i;
              }
              const i = new _e(r);
              return (i.immutable = !1), i;
            });
          }),
          (e.haskey = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 2, 2);
              const r = ne(n[1]);
              if (Pt(n[0])) return n[0].hasField(r);
              if (n[0] instanceof _e) return n[0].hasField(r);
              throw new Error('Illegal Argument');
            });
          }),
          (e.indexof = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 2, 2);
              const r = n[1];
              if (j(n[0])) {
                for (let e = 0; e < n[0].length; e++) if (te(r, n[0][e])) return e;
                return -1;
              }
              if (q(n[0])) {
                const e = n[0].length();
                for (let t = 0; t < e; t++) if (te(r, n[0].get(t))) return t;
                return -1;
              }
              throw new Error('Illegal Argument');
            });
          }),
          (e.angle = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 2, 3), !(n[0] instanceof r.Z)))
                throw new Error('Illegal Argument');
              if (!(n[1] instanceof r.Z)) throw new Error('Illegal Argument');
              if (n.length > 2 && !(n[2] instanceof r.Z)) throw new Error('Illegal Argument');
              return 2 === n.length
                ? _t(Ot(n[0], n[1]), 2 * Math.PI) * (180 / Math.PI)
                : (function (e, t, n) {
                    return _t(Bt(e, t, n), 2 * Math.PI) * (180 / Math.PI);
                  })(n[0], n[1], n[2]);
            });
          }),
          (e.bearing = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 2, 3), !(n[0] instanceof r.Z)))
                throw new Error('Illegal Argument');
              if (!(n[1] instanceof r.Z)) throw new Error('Illegal Argument');
              if (n.length > 2 && !(n[2] instanceof r.Z)) throw new Error('Illegal Argument');
              return 2 === n.length
                ? ((i = n[0]),
                  (s = n[1]),
                  _t(Math.PI / 2 - Ot(i, s), 2 * Math.PI) * (180 / Math.PI))
                : (function (e, t, n) {
                    return _t(-1 * Bt(e, t, n), 2 * Math.PI) * (180 / Math.PI);
                  })(n[0], n[1], n[2]);
              var i, s;
            });
          }),
          (e.isselfintersecting = function (e, n) {
            return t(e, n, function (t, n, r) {
              J((r = De(r)), 1, 1);
              let i = r[0];
              if (i instanceof u.Z) return i.isSelfIntersecting;
              if (i instanceof l.Z) return (i = i.paths), Mt(i);
              if (i instanceof a.Z) {
                const e = i.points;
                for (let t = 0; t < e.length; t++)
                  for (let n = 0; n < e.length; n++)
                    if (n !== t) {
                      let r = !0;
                      for (let i = 0; i < e[t].length; i++)
                        if (e[t][i] !== e[n][i]) {
                          r = !1;
                          break;
                        }
                      if (!0 === r) return !0;
                    }
              }
              return (
                !(!j(i) && !q(i)) &&
                ((i = xe(i, e.spatialReference)), null !== i && (i = i.paths), Mt(i))
              );
            });
          });
      }
      function Lt(e) {
        if (void 0 === e) return null;
        if ('number' == typeof e) return e;
        switch (e.toLowerCase()) {
          case 'meters':
          case 'meter':
          case 'm':
          case 'squaremeters':
          case 'squaremeter':
          case 'square-meter':
          case 'square-meters':
            return 109404;
          case 'miles':
          case 'mile':
          case 'squaremile':
          case 'squaremiles':
          case 'square-miles':
          case 'square-mile':
            return 109413;
          case 'kilometers':
          case 'kilometer':
          case 'squarekilometers':
          case 'squarekilometer':
          case 'square-kilometers':
          case 'square-kilometer':
          case 'km':
            return 109414;
          case 'acres':
          case 'acre':
          case 'ac':
            return 109402;
          case 'hectares':
          case 'hectare':
          case 'ha':
            return 109401;
          case 'yard':
          case 'yd':
          case 'yards':
          case 'square-yards':
          case 'square-yard':
          case 'squareyards':
          case 'squareyard':
            return 109442;
          case 'feet':
          case 'ft':
          case 'foot':
          case 'square-feet':
          case 'square-foot':
          case 'squarefeet':
          case 'squarefoot':
            return 109405;
        }
        return null;
      }
      function Gt(e) {
        if (null === e) return null;
        switch (e.type) {
          case 'polygon':
          case 'multipoint':
          case 'polyline':
            return e.extent;
          case 'point':
            return new s.Z({
              xmin: e.x,
              ymin: e.y,
              xmax: e.x,
              ymax: e.y,
              spatialReference: e.spatialReference,
            });
          case 'extent':
            return e;
        }
        return null;
      }
      function Zt(e) {
        if (void 0 === e) return null;
        if ('number' == typeof e) return e;
        if ('number' == typeof e) return e;
        switch (e.toLowerCase()) {
          case 'meters':
          case 'meter':
          case 'm':
          case 'squaremeters':
          case 'squaremeter':
          case 'square-meter':
          case 'square-meters':
            return 9001;
          case 'miles':
          case 'mile':
          case 'squaremile':
          case 'squaremiles':
          case 'square-miles':
          case 'square-mile':
            return 9035;
          case 'kilometers':
          case 'kilometer':
          case 'squarekilometers':
          case 'squarekilometer':
          case 'square-kilometers':
          case 'square-kilometer':
          case 'km':
            return 9036;
          case 'yard':
          case 'yd':
          case 'yards':
          case 'square-yards':
          case 'square-yard':
          case 'squareyards':
          case 'squareyard':
            return 9096;
          case 'feet':
          case 'ft':
          case 'foot':
          case 'square-feet':
          case 'square-foot':
          case 'squarefeet':
          case 'squarefoot':
            return 9002;
        }
        return null;
      }
      function zt(e) {
        if (null === e) return null;
        const t = e.clone();
        return void 0 !== e.cache._geVersion && (t.cache._geVersion = e.cache._geVersion), t;
      }
      let jt = null;
      function Vt(e) {
        return 0 === m.i8.indexOf('4.')
          ? u.Z.fromExtent(e)
          : new u.Z({
              spatialReference: e.spatialReference,
              rings: [
                [
                  [e.xmin, e.ymin],
                  [e.xmin, e.ymax],
                  [e.xmax, e.ymax],
                  [e.xmax, e.ymin],
                  [e.xmin, e.ymin],
                ],
              ],
            });
      }
      function Yt(e, t) {
        function n(e) {
          if ((J(e, 2, 2), e[0] instanceof o.Z && e[1] instanceof o.Z));
          else if (e[0] instanceof o.Z && null === e[1]);
          else if (e[1] instanceof o.Z && null === e[0]);
          else if (null !== e[0] || null !== e[1]) throw new Error('Illegal Argument');
        }
        (e.disjoint = function (e, r) {
          return t(e, r, function (e, t, r) {
            return n((r = De(r))), null === r[0] || null === r[1] || jt.disjoint(r[0], r[1]);
          });
        }),
          (e.intersects = function (e, r) {
            return t(e, r, function (e, t, r) {
              return n((r = De(r))), null !== r[0] && null !== r[1] && jt.intersects(r[0], r[1]);
            });
          }),
          (e.touches = function (e, r) {
            return t(e, r, function (e, t, r) {
              return n((r = De(r))), null !== r[0] && null !== r[1] && jt.touches(r[0], r[1]);
            });
          }),
          (e.crosses = function (e, r) {
            return t(e, r, function (e, t, r) {
              return n((r = De(r))), null !== r[0] && null !== r[1] && jt.crosses(r[0], r[1]);
            });
          }),
          (e.within = function (e, r) {
            return t(e, r, function (e, t, r) {
              return n((r = De(r))), null !== r[0] && null !== r[1] && jt.within(r[0], r[1]);
            });
          }),
          (e.contains = function (e, r) {
            return t(e, r, function (e, t, r) {
              return n((r = De(r))), null !== r[0] && null !== r[1] && jt.contains(r[0], r[1]);
            });
          }),
          (e.overlaps = function (e, r) {
            return t(e, r, function (e, t, r) {
              return n((r = De(r))), null !== r[0] && null !== r[1] && jt.overlaps(r[0], r[1]);
            });
          }),
          (e.equals = function (e, n) {
            return t(e, n, function (e, t, n) {
              return (
                J(n, 2, 2),
                n[0] === n[1] ||
                  (n[0] instanceof o.Z && n[1] instanceof o.Z
                    ? jt.equals(n[0], n[1])
                    : !(!H(n[0]) || !H(n[1])) && n[0].getTime() === n[1].getTime())
              );
            });
          }),
          (e.relate = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 3, 3), n[0] instanceof o.Z && n[1] instanceof o.Z))
                return jt.relate(n[0], n[1], ne(n[2]));
              if (n[0] instanceof o.Z && null === n[1]) return !1;
              if (n[1] instanceof o.Z && null === n[0]) return !1;
              if (null === n[0] && null === n[1]) return !1;
              throw new Error('Illegal Argument');
            });
          }),
          (e.intersection = function (e, r) {
            return t(e, r, function (e, t, r) {
              return (
                n((r = De(r))), null === r[0] || null === r[1] ? null : jt.intersect(r[0], r[1])
              );
            });
          }),
          (e.union = function (e, n) {
            return t(e, n, function (t, n, r) {
              const i = [];
              if (0 === (r = De(r)).length)
                throw new Error('Function called with wrong number of Parameters');
              if (1 === r.length)
                if (j(r[0])) {
                  const e = De(r[0]);
                  for (let t = 0; t < e.length; t++)
                    if (null !== e[t]) {
                      if (!(e[t] instanceof o.Z)) throw new Error('Illegal Argument');
                      i.push(e[t]);
                    }
                } else {
                  if (!q(r[0])) {
                    if (r[0] instanceof o.Z) return ce(zt(r[0]), e.spatialReference);
                    if (null === r[0]) return null;
                    throw new Error('Illegal Argument');
                  }
                  {
                    const e = De(r[0].toArray());
                    for (let t = 0; t < e.length; t++)
                      if (null !== e[t]) {
                        if (!(e[t] instanceof o.Z)) throw new Error('Illegal Argument');
                        i.push(e[t]);
                      }
                  }
                }
              else
                for (let e = 0; e < r.length; e++)
                  if (null !== r[e]) {
                    if (!(r[e] instanceof o.Z)) throw new Error('Illegal Argument');
                    i.push(r[e]);
                  }
              return 0 === i.length ? null : jt.union(i);
            });
          }),
          (e.difference = function (e, r) {
            return t(e, r, function (e, t, r) {
              return (
                n((r = De(r))),
                null !== r[0] && null === r[1]
                  ? zt(r[0])
                  : null === r[0]
                  ? null
                  : jt.difference(r[0], r[1])
              );
            });
          }),
          (e.symmetricdifference = function (e, r) {
            return t(e, r, function (e, t, r) {
              return (
                n((r = De(r))),
                null === r[0] && null === r[1]
                  ? null
                  : null === r[0]
                  ? zt(r[1])
                  : null === r[1]
                  ? zt(r[0])
                  : jt.symmetricDifference(r[0], r[1])
              );
            });
          }),
          (e.clip = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 2, 2), !(n[1] instanceof s.Z) && null !== n[1]))
                throw new Error('Illegal Argument');
              if (null === n[0]) return null;
              if (!(n[0] instanceof o.Z)) throw new Error('Illegal Argument');
              return null === n[1] ? null : jt.clip(n[0], n[1]);
            });
          }),
          (e.cut = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 2, 2), !(n[1] instanceof l.Z) && null !== n[1]))
                throw new Error('Illegal Argument');
              if (null === n[0]) return [];
              if (!(n[0] instanceof o.Z)) throw new Error('Illegal Argument');
              return null === n[1] ? [zt(n[0])] : jt.cut(n[0], n[1]);
            });
          }),
          (e.area = function (e, n) {
            return t(e, n, function (t, n, r) {
              if ((J(r, 1, 2), null === (r = De(r))[0])) return 0;
              if (j(r[0]) || q(r[0])) {
                const t = Ee(r[0], e.spatialReference);
                return null === t ? 0 : jt.planarArea(t, Lt(U(r[1], -1)));
              }
              if (!(r[0] instanceof o.Z)) throw new Error('Illegal Argument');
              return jt.planarArea(r[0], Lt(U(r[1], -1)));
            });
          }),
          (e.areageodetic = function (e, n) {
            return t(e, n, function (t, n, r) {
              if ((J(r, 1, 2), null === (r = De(r))[0])) return 0;
              if (j(r[0]) || q(r[0])) {
                const t = Ee(r[0], e.spatialReference);
                return null === t ? 0 : jt.geodesicArea(t, Lt(U(r[1], -1)));
              }
              if (!(r[0] instanceof o.Z)) throw new Error('Illegal Argument');
              return jt.geodesicArea(r[0], Lt(U(r[1], -1)));
            });
          }),
          (e.length = function (e, n) {
            return t(e, n, function (t, n, r) {
              if ((J(r, 1, 2), null === (r = De(r))[0])) return 0;
              if (j(r[0]) || q(r[0])) {
                const t = xe(r[0], e.spatialReference);
                return null === t ? 0 : jt.planarLength(t, Zt(U(r[1], -1)));
              }
              if (!(r[0] instanceof o.Z)) throw new Error('Illegal Argument');
              return jt.planarLength(r[0], Zt(U(r[1], -1)));
            });
          }),
          (e.lengthgeodetic = function (e, n) {
            return t(e, n, function (t, n, r) {
              if ((J(r, 1, 2), null === (r = De(r))[0])) return 0;
              if (j(r[0]) || q(r[0])) {
                const t = xe(r[0], e.spatialReference);
                return null === t ? 0 : jt.geodesicLength(t, Zt(U(r[1], -1)));
              }
              if (!(r[0] instanceof o.Z)) throw new Error('Illegal Argument');
              return jt.geodesicLength(r[0], Zt(U(r[1], -1)));
            });
          }),
          (e.distance = function (e, n) {
            return t(e, n, function (t, n, r) {
              J((r = De(r)), 2, 3);
              let i = r[0];
              (j(r[0]) || q(r[0])) && (i = Ae(r[0], e.spatialReference));
              let s = r[1];
              if (((j(r[1]) || q(r[1])) && (s = Ae(r[1], e.spatialReference)), !(i instanceof o.Z)))
                throw new Error('Illegal Argument');
              if (!(s instanceof o.Z)) throw new Error('Illegal Argument');
              return jt.distance(i, s, Zt(U(r[2], -1)));
            });
          }),
          (e.distancegeodetic = function (e, n) {
            return t(e, n, function (e, t, n) {
              J((n = De(n)), 2, 3);
              const i = n[0],
                s = n[1];
              if (!(i instanceof r.Z)) throw new Error('Illegal Argument');
              if (!(s instanceof r.Z)) throw new Error('Illegal Argument');
              const o = new l.Z({ paths: [], spatialReference: i.spatialReference });
              return o.addPath([i, s]), jt.geodesicLength(o, Zt(U(n[2], -1)));
            });
          }),
          (e.densify = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 2, 3), null === n[0])) return null;
              if (!(n[0] instanceof o.Z)) throw new Error('Illegal Argument');
              const r = oe(n[1]);
              if (isNaN(r)) throw new Error('Illegal Argument');
              if (r <= 0) throw new Error('Illegal Argument');
              return n[0] instanceof u.Z || n[0] instanceof l.Z
                ? jt.densify(n[0], r, Zt(U(n[2], -1)))
                : n[0] instanceof s.Z
                ? jt.densify(Vt(n[0]), r, Zt(U(n[2], -1)))
                : n[0];
            });
          }),
          (e.densifygeodetic = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 2, 3), null === n[0])) return null;
              if (!(n[0] instanceof o.Z)) throw new Error('Illegal Argument');
              const r = oe(n[1]);
              if (isNaN(r)) throw new Error('Illegal Argument');
              if (r <= 0) throw new Error('Illegal Argument');
              return n[0] instanceof u.Z || n[0] instanceof l.Z
                ? jt.geodesicDensify(n[0], r, Zt(U(n[2], -1)))
                : n[0] instanceof s.Z
                ? jt.geodesicDensify(Vt(n[0]), r, Zt(U(n[2], -1)))
                : n[0];
            });
          }),
          (e.generalize = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 2, 4), null === n[0])) return null;
              if (!(n[0] instanceof o.Z)) throw new Error('Illegal Argument');
              const r = oe(n[1]);
              if (isNaN(r)) throw new Error('Illegal Argument');
              return jt.generalize(n[0], r, le(U(n[2], !0)), Zt(U(n[3], -1)));
            });
          }),
          (e.buffer = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 2, 3), null === n[0])) return null;
              if (!(n[0] instanceof o.Z)) throw new Error('Illegal Argument');
              const r = oe(n[1]);
              if (isNaN(r)) throw new Error('Illegal Argument');
              return 0 === r ? zt(n[0]) : jt.buffer(n[0], r, Zt(U(n[2], -1)));
            });
          }),
          (e.buffergeodetic = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 2, 3), null === n[0])) return null;
              if (!(n[0] instanceof o.Z)) throw new Error('Illegal Argument');
              const r = oe(n[1]);
              if (isNaN(r)) throw new Error('Illegal Argument');
              return 0 === r ? zt(n[0]) : jt.geodesicBuffer(n[0], r, Zt(U(n[2], -1)));
            });
          }),
          (e.offset = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 2, 6), null === n[0])) return null;
              if (!(n[0] instanceof u.Z || n[0] instanceof l.Z))
                throw new Error('Illegal Argument');
              const r = oe(n[1]);
              if (isNaN(r)) throw new Error('Illegal Argument');
              const i = oe(U(n[4], 10));
              if (isNaN(i)) throw new Error('Illegal Argument');
              const s = oe(U(n[5], 0));
              if (isNaN(s)) throw new Error('Illegal Argument');
              return jt.offset(n[0], r, Zt(U(n[2], -1)), ne(U(n[3], 'round')).toLowerCase(), i, s);
            });
          }),
          (e.rotate = function (e, n) {
            return t(e, n, function (e, t, n) {
              J((n = De(n)), 2, 3);
              let i = n[0];
              if (null === i) return null;
              if (!(i instanceof o.Z)) throw new Error('Illegal Argument');
              i instanceof s.Z && (i = u.Z.fromExtent(i));
              const a = oe(n[1]);
              if (isNaN(a)) throw new Error('Illegal Argument');
              const l = U(n[2], null);
              if (null === l) return jt.rotate(i, a);
              if (l instanceof r.Z) return jt.rotate(i, a, l);
              throw new Error('Illegal Argument');
            });
          }),
          (e.centroid = function (e, n) {
            return t(e, n, function (t, n, i) {
              if ((J((i = De(i)), 1, 1), null === i[0])) return null;
              let c = i[0];
              if (((j(i[0]) || q(i[0])) && (c = Ae(i[0], e.spatialReference)), null === c))
                return null;
              if (!(c instanceof o.Z)) throw new Error('Illegal Argument');
              return c instanceof r.Z
                ? ce(zt(i[0]), e.spatialReference)
                : c instanceof u.Z
                ? c.centroid
                : c instanceof l.Z
                ? vt(c)
                : c instanceof a.Z
                ? kt(c)
                : c instanceof s.Z
                ? c.center
                : null;
            });
          }),
          (e.multiparttosinglepart = function (e, n) {
            return t(e, n, function (t, n, i) {
              J((i = De(i)), 1, 1);
              const c = [];
              if (null === i[0]) return null;
              if (!(i[0] instanceof o.Z)) throw new Error('Illegal Argument');
              if (i[0] instanceof r.Z) return [ce(zt(i[0]), e.spatialReference)];
              if (i[0] instanceof s.Z) return [ce(zt(i[0]), e.spatialReference)];
              const h = jt.simplify(i[0]);
              if (h instanceof u.Z) {
                const e = [],
                  t = [];
                for (let n = 0; n < h.rings.length; n++)
                  if (h.isClockwise(h.rings[n])) {
                    const t = (0, f.im)({
                      rings: [h.rings[n]],
                      hasZ: !0 === h.hasZ,
                      hasM: !0 === h.hasM,
                      spatialReference: h.spatialReference.toJSON(),
                    });
                    e.push(t);
                  } else t.push({ ring: h.rings[n], pt: h.getPoint(n, 0) });
                for (let n = 0; n < t.length; n++)
                  for (let r = 0; r < e.length; r++)
                    if (e[r].contains(t[n].pt)) {
                      e[r].addRing(t[n].ring);
                      break;
                    }
                return e;
              }
              if (h instanceof l.Z) {
                const e = [];
                for (let t = 0; t < h.paths.length; t++) {
                  const n = (0, f.im)({
                    paths: [h.paths[t]],
                    hasZ: !0 === h.hasZ,
                    hasM: !0 === h.hasM,
                    spatialReference: h.spatialReference.toJSON(),
                  });
                  e.push(n);
                }
                return e;
              }
              if (i[0] instanceof a.Z) {
                const t = ce(zt(i[0]), e.spatialReference);
                for (let e = 0; e < t.points.length; e++) c.push(t.getPoint(e));
                return c;
              }
              return null;
            });
          }),
          (e.issimple = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 1, 1), null === n[0])) return !0;
              if (!(n[0] instanceof o.Z)) throw new Error('Illegal Argument');
              return jt.isSimple(n[0]);
            });
          }),
          (e.simplify = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J((n = De(n)), 1, 1), null === n[0])) return null;
              if (!(n[0] instanceof o.Z)) throw new Error('Illegal Argument');
              return jt.simplify(n[0]);
            });
          });
      }
      var qt = Object.freeze({
        __proto__: null,
        setGeometryEngine: function (e) {
          jt = e;
        },
        registerFunctions: Yt,
      });
      function Ht(e, t, n) {
        return void 0 === n || 0 == +n
          ? Math[e](t)
          : ((t = +t),
            (n = +n),
            isNaN(t) || 'number' != typeof n || n % 1 != 0
              ? NaN
              : ((t = t.toString().split('e')),
                +(
                  (t = (t = Math[e](+(t[0] + 'e' + (t[1] ? +t[1] - n : -n))))
                    .toString()
                    .split('e'))[0] +
                  'e' +
                  (t[1] ? +t[1] + n : n)
                )));
      }
      function Jt(e, t) {
        function n(e, t, n) {
          const r = oe(e);
          return isNaN(r) ? r : isNaN(t) || isNaN(n) || t > n ? NaN : r < t ? t : r > n ? n : r;
        }
        (e.number = function (e, n) {
          return t(e, n, function (e, t, n) {
            J(n, 1, 2);
            const r = n[0];
            if (Z(r)) return r;
            if (null === r) return 0;
            if (H(r)) return Number(r);
            if (G(r)) return Number(r);
            if (j(r)) return NaN;
            if ('' === r) return Number(r);
            if (void 0 === r) return Number(r);
            if (L(r)) {
              if (void 0 !== n[1]) {
                let e = R(n[1], '‰', '');
                return (e = R(e, '¤', '')), (0, c.p)(r, { pattern: e });
              }
              return Number(r.trim());
            }
            return Number(r);
          });
        }),
          (e.abs = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), Math.abs(oe(n[0]));
            });
          }),
          (e.acos = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), Math.acos(oe(n[0]));
            });
          }),
          (e.asin = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), Math.asin(oe(n[0]));
            });
          }),
          (e.atan = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), Math.atan(oe(n[0]));
            });
          }),
          (e.atan2 = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 2, 2), Math.atan2(oe(n[0]), oe(n[1]));
            });
          }),
          (e.ceil = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 2), 2 === n.length)) {
                let e = oe(n[1]);
                return isNaN(e) && (e = 0), Ht('ceil', oe(n[0]), -1 * e);
              }
              return Math.ceil(oe(n[0]));
            });
          }),
          (e.round = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 2), 2 === n.length)) {
                let e = oe(n[1]);
                return isNaN(e) && (e = 0), Ht('round', oe(n[0]), -1 * e);
              }
              return Math.round(oe(n[0]));
            });
          }),
          (e.floor = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 2), 2 === n.length)) {
                let e = oe(n[1]);
                return isNaN(e) && (e = 0), Ht('floor', oe(n[0]), -1 * e);
              }
              return Math.floor(oe(n[0]));
            });
          }),
          (e.cos = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), Math.cos(oe(n[0]));
            });
          }),
          (e.isnan = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), 'number' == typeof n[0] && isNaN(n[0]);
            });
          }),
          (e.exp = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), Math.exp(oe(n[0]));
            });
          }),
          (e.log = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), Math.log(oe(n[0]));
            });
          }),
          (e.pow = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 2, 2), oe(n[0]) ** oe(n[1]);
            });
          }),
          (e.random = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 0, 0), Math.random();
            });
          }),
          (e.sin = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), Math.sin(oe(n[0]));
            });
          }),
          (e.sqrt = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), Math.sqrt(oe(n[0]));
            });
          }),
          (e.tan = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), Math.tan(oe(n[0]));
            });
          }),
          (e.defaultvalue = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 2, 2), null === n[0] || '' === n[0] || void 0 === n[0] ? n[1] : n[0];
            });
          }),
          (e.isempty = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), null === n[0] || '' === n[0] || void 0 === n[0];
            });
          }),
          (e.boolean = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), le(n[0]);
            });
          }),
          (e.constrain = function (e, r) {
            return t(e, r, function (e, t, r) {
              J(r, 3, 3);
              const i = oe(r[1]),
                s = oe(r[2]);
              if (j(r[0])) {
                const e = [];
                for (const t of r[0]) e.push(n(t, i, s));
                return e;
              }
              if (q(r[0])) {
                const e = [];
                for (let t = 0; t < r[0].length(); t++) e.push(n(r[0].get(t), i, s));
                return e;
              }
              return n(r[0], i, s);
            });
          });
      }
      function Xt(e) {
        let t = 0;
        for (let n = 0; n < e.length; n++) t += e[n];
        return t / e.length;
      }
      function Wt(e) {
        const t = Xt(e);
        let n = 0;
        for (let r = 0; r < e.length; r++) n += (t - e[r]) ** 2;
        return n / e.length;
      }
      function Kt(e, t, n = 1e3) {
        switch (e.toLowerCase()) {
          case 'distinct':
            return (function (e, t) {
              const n = [],
                r = {},
                i = [];
              for (let s = 0; s < e.length; s++) {
                if (void 0 !== e[s] && null !== e[s] && e[s] !== _) {
                  const t = e[s];
                  if (Z(t) || L(t)) void 0 === r[t] && (n.push(t), (r[t] = 1));
                  else {
                    let e = !1;
                    for (let n = 0; n < i.length; n++) !0 === te(i[n], t) && (e = !0);
                    !1 === e && (i.push(t), n.push(t));
                  }
                }
                if (n.length >= t && -1 !== t) return n;
              }
              return n;
            })(t, n);
          case 'avg':
          case 'mean':
            return Xt(re(t));
          case 'min':
            return Math.min.apply(Math, re(t));
          case 'sum':
            return (function (e) {
              let t = 0;
              for (let n = 0; n < e.length; n++) t += e[n];
              return t;
            })(re(t));
          case 'max':
            return Math.max.apply(Math, re(t));
          case 'stdev':
          case 'stddev':
            return Math.sqrt(Wt(re(t)));
          case 'var':
          case 'variance':
            return Wt(re(t));
          case 'count':
            return t.length;
        }
        return 0;
      }
      function $t(e, t, n, r) {
        if (1 === r.length) {
          if (j(r[0])) return Kt(e, r[0], -1);
          if (q(r[0])) return Kt(e, r[0].toArray(), -1);
        }
        return Kt(e, r, -1);
      }
      function Qt(e, t) {
        (e.stdev = function (e, n) {
          return t(e, n, function (e, t, n) {
            return $t('stdev', 0, 0, n);
          });
        }),
          (e.variance = function (e, n) {
            return t(e, n, function (e, t, n) {
              return $t('variance', 0, 0, n);
            });
          }),
          (e.average = function (e, n) {
            return t(e, n, function (e, t, n) {
              return $t('mean', 0, 0, n);
            });
          }),
          (e.mean = function (e, n) {
            return t(e, n, function (e, t, n) {
              return $t('mean', 0, 0, n);
            });
          }),
          (e.sum = function (e, n) {
            return t(e, n, function (e, t, n) {
              return $t('sum', 0, 0, n);
            });
          }),
          (e.min = function (e, n) {
            return t(e, n, function (e, t, n) {
              return $t('min', 0, 0, n);
            });
          }),
          (e.max = function (e, n) {
            return t(e, n, function (e, t, n) {
              return $t('max', 0, 0, n);
            });
          }),
          (e.distinct = function (e, n) {
            return t(e, n, function (e, t, n) {
              return $t('distinct', 0, 0, n);
            });
          }),
          (e.count = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 1), j(n[0]) || L(n[0]))) return n[0].length;
              if (q(n[0])) return n[0].length();
              throw new Error('Invalid Parameters for Count');
            });
          });
      }
      const en = (e) => (t, n, r) => ((r = r || 14), +e(t, n).toFixed(r)),
        tn = (e, t) => e + t,
        nn = (e, t) => e * t,
        rn = (e, t) => e / t,
        sn = (e, t, n) => en(tn)(e, t, n),
        on = (e, t, n) => en(nn)(e, t, n),
        an = (e, t, n) => en(rn)(e, t, n),
        un = 2 * Math.PI,
        ln = 648e3 / Math.PI,
        cn = String.fromCharCode(7501);
      function hn(e) {
        if (!1 === L(e)) throw new Error('Invalid Parameter');
        return e;
      }
      function fn(e, t) {
        const n = 10 ** t;
        return Math.round(e * n) / n;
      }
      function dn(e) {
        const t = parseFloat(e.toString().replace(Math.trunc(e).toString(), '0')) * Math.sign(e);
        return e < 0
          ? { fraction: t, integer: Math.ceil(e) }
          : { fraction: t, integer: Math.floor(e) };
      }
      function pn(e, t) {
        switch (e) {
          case 0:
            return 'SHORT' === t ? 'N' : 'North';
          case 1:
            return 'SHORT' === t ? 'E' : 'East';
          case 2:
            return 'SHORT' === t ? 'S' : 'South';
          case 3:
            return 'SHORT' === t ? 'W' : 'West';
        }
      }
      function mn(e, t, n) {
        for (; e.length < n; ) e = t + e;
        return e;
      }
      function gn(e, t) {
        return e - Math.floor(e / t) * t;
      }
      function Dn(e) {
        switch (e) {
          case 6:
          case 1:
            return 360;
          case 4:
            return un;
          case 5:
            return 400;
          case 2:
            return 1296e3;
          case 7:
          case 8:
            return 60;
          default:
            throw new Error('Unnexpected evaluations');
        }
      }
      function yn(e) {
        switch (e.toUpperCase().trim()) {
          case 'NORTH':
          case 'NORTHAZIMUTH':
          case 'NORTH AZIMUTH':
            return 1;
          case 'POLAR':
            return 2;
          case 'QUADRANT':
            return 3;
          case 'SOUTH':
          case 'SOUTHAZIMUTH':
          case 'SOUTH AZIMUTH':
            return 4;
        }
        throw new Error('Unsupported direction type');
      }
      function En(e) {
        switch (e.toUpperCase().trim()) {
          case 'D':
          case 'DD':
          case 'DECIMALDEGREE':
          case 'DECIMAL DEGREE':
          case 'DEGREE':
          case 'DECIMALDEGREES':
          case 'DECIMAL DEGREES':
          case 'DEGREES':
            return 1;
          case 'DMS':
          case 'DEGREESMINUTESSECONDS':
          case 'DEGREES MINUTES SECONDS':
            return 3;
          case 'R':
          case 'RAD':
          case 'RADS':
          case 'RADIAN':
          case 'RADIANS':
            return 4;
          case 'G':
          case 'GON':
          case 'GONS':
          case 'GRAD':
          case 'GRADS':
          case 'GRADIAN':
          case 'GRADIANS':
            return 5;
        }
        throw new Error('Unsupported units');
      }
      class xn {
        constructor(e, t, n) {
          (this.m_degrees = e), (this.m_minutes = t), (this.m_seconds = n);
        }
        get_field(e) {
          switch (e) {
            case 1:
            case 6:
              return this.m_degrees;
            case 7:
              return this.m_minutes;
            case 2:
            case 8:
              return this.m_seconds;
            default:
              throw new Error('Unnexpected evaluation');
          }
        }
        static seconds_to_DMS(e) {
          const t = dn(e).fraction;
          let n = dn(e).integer;
          const r = Math.floor(n / 3600);
          n -= 3600 * r;
          const i = Math.floor(n / 60);
          return (n -= 60 * i), new xn(r, i, n + t);
        }
        static number_to_dms(e) {
          const t = dn(e).fraction,
            n = dn(e).integer,
            r = on(dn(100 * t).fraction, 100),
            i = dn(100 * t).integer;
          return new xn(n, i, r);
        }
        format(e, t) {
          let n = fn(this.m_seconds, t),
            r = this.m_minutes,
            i = this.m_degrees;
          if (2 === e || 8 === e)
            60 <= n && ((n -= 60), ++r), 60 <= r && ((r = 0), ++i), 360 <= i && (i = 0);
          else if (7 === e)
            (n = 0),
              (r = 30 <= this.m_seconds ? this.m_minutes + 1 : this.m_minutes),
              (i = this.m_degrees),
              60 <= r && ((r = 0), ++i),
              360 <= i && (i = 0);
          else if (1 === e || 6 === e) {
            const e = an(this.m_seconds, 3600),
              t = an(this.m_minutes, 60);
            (i = Math.round(this.m_degrees + t + e)), (r = 0), (n = 0);
          }
          return new xn(i, r, n);
        }
        static DMS_to_seconds(e, t, n) {
          return 3600 * e + 60 * t + n;
        }
      }
      class An {
        constructor(e, t, n) {
          (this.meridian = e), (this.angle = t), (this.direction = n);
        }
        fetch_azimuth(e) {
          return 0 === e ? this.meridian : this.direction;
        }
      }
      class wn {
        constructor(e) {
          this.m_angle = e;
        }
        static createFromAngleAndDirection(e, t) {
          return new wn(new Fn(wn.convertDirectionFormat(e.extract_angular_units(2), t, 1)));
        }
        getAngle(e) {
          const t = this.m_angle.extract_angular_units(2);
          switch (e) {
            case 1:
            case 4:
            case 2:
              return new Fn(wn.convertDirectionFormat(t, 1, e));
            case 3: {
              const e = wn.seconds_north_azimuth_to_quadrant(t);
              return new Fn(e.angle);
            }
          }
        }
        getMeridian(e) {
          const t = this.m_angle.extract_angular_units(2);
          switch (e) {
            case 1:
              return 0;
            case 4:
              return 2;
            case 2:
              return 1;
            case 3:
              return wn.seconds_north_azimuth_to_quadrant(t).meridian;
          }
        }
        getDirection(e) {
          const t = this.m_angle.extract_angular_units(2);
          switch (e) {
            case 1:
              return 1;
            case 4:
              return 3;
            case 2:
              return 0;
            case 3:
              return wn.seconds_north_azimuth_to_quadrant(t).direction;
          }
        }
        static seconds_north_azimuth_to_quadrant(e) {
          const t = e <= 324e3 || e >= 972e3 ? 0 : 2,
            n = 0 === t ? Math.min(1296e3 - e, e) : Math.abs(e - 648e3);
          return new An(t, n, e > 648e3 ? 3 : 1);
        }
        static createFromAngleMeridianAndDirection(e, t, n) {
          return new wn(new Fn(wn.secondsQuadrantToNorthAzimuth(e.extract_angular_units(2), t, n)));
        }
        static secondsQuadrantToNorthAzimuth(e, t, n) {
          return 0 === t ? (1 === n ? e : 1296e3 - e) : 1 === n ? 648e3 - e : 648e3 + e;
        }
        static convertDirectionFormat(e, t, n) {
          let r = 0;
          switch (t) {
            case 1:
              r = e;
              break;
            case 2:
              r = 324e3 - e;
              break;
            case 3:
              throw new Error('Unnexpected evaluation');
            case 4:
              r = e + 648e3;
          }
          let i = 0;
          switch (n) {
            case 1:
              i = r;
              break;
            case 2:
              i = 324e3 - r;
              break;
            case 3:
              throw new Error('Unnexpected evaluation');
            case 4:
              i = r - 648e3;
          }
          return (i %= 1296e3), i < 0 ? 1296e3 + i : i;
        }
      }
      function Cn(e, t, n) {
        let r = null;
        switch (t) {
          case 1:
            r = on(e, 3600);
            break;
          case 2:
            r = e;
            break;
          case 5:
            r = on(e, 3240);
            break;
          case 4:
            r = on(e, ln);
            break;
          default:
            throw new Error('Unnexpected evaluation');
        }
        switch (n) {
          case 1:
            return an(r, 3600);
          case 2:
            return r;
          case 5:
            return an(r, 3240);
          case 4:
            return r / ln;
          default:
            throw new Error('Unnexpected evaluation');
        }
      }
      class Fn {
        constructor(e) {
          this.m_seconds = e;
        }
        static createFromAngleAndUnits(e, t) {
          return new Fn(Cn(e, t, 2));
        }
        extract_angular_units(e) {
          return Cn(this.m_seconds, 2, bn(e));
        }
        static createFromDegreesMinutesSeconds(e, t, n) {
          return new Fn(sn(sn(on(e, 3600), on(t, 60)), n));
        }
      }
      function bn(e) {
        switch (e) {
          case 1:
          case 6:
          case 3:
            return 1;
          case 5:
            return 5;
          case 7:
            return 7;
          case 4:
            return 4;
          case 2:
          case 8:
            return 2;
        }
      }
      class Nn {
        constructor(e, t, n, r) {
          (this.m_view = e),
            (this.m_angle = t),
            (this.m_merdian = n),
            (this.m_direction = r),
            (this.m_dms = null),
            (this.m_formatted_dms = null);
        }
        static createFromStringAndBearing(e, t, n) {
          return new Nn(e, t.getAngle(n), t.getMeridian(n), t.getDirection(n));
        }
        fetch_angle() {
          return this.m_angle;
        }
        fetch_meridian() {
          return this.m_merdian;
        }
        fetch_direction() {
          return this.m_direction;
        }
        fetch_m_view() {
          return this.m_view;
        }
        fetch_dms() {
          return null === this.m_dms && this.calculate_dms(), this.m_dms;
        }
        fetch_formatted_dms() {
          return null === this.m_formatted_dms && this.calculate_dms(), this.m_formatted_dms;
        }
        calculate_dms() {
          let e = null,
            t = 6,
            n = 0;
          for (let r = 0; r < this.m_view.length; r++) {
            const i = this.m_view[r];
            switch (i) {
              case 'm':
                (e = kn(this.m_view, r, i)), (t = 6 === t ? 7 : t), (r = e.newpos);
                continue;
              case 's':
                (e = kn(this.m_view, r, i)),
                  (t = 8),
                  (n = n < e.rounding ? e.rounding : n),
                  (r = e.newpos);
                continue;
              default:
                continue;
            }
          }
          (this.m_dms = xn.seconds_to_DMS(this.m_angle.extract_angular_units(2))),
            (this.m_formatted_dms = xn
              .seconds_to_DMS(this.m_angle.extract_angular_units(2))
              .format(t, n));
        }
      }
      function Sn(e, t, n, r, i) {
        let s = null;
        switch (t) {
          case 1:
          case 4:
          case 5:
            return (
              (s = gn(fn(e.extract_angular_units(t), r), Dn(t))),
              mn(s.toFixed(r), '0', n + r + (r > 0 ? 1 : 0))
            );
          case 6:
          case 7:
            return (
              (s = gn(i.fetch_formatted_dms().get_field(t), Dn(t))),
              mn(s.toFixed(r), '0', n + r + (r > 0 ? 1 : 0))
            );
          case 8:
            return (
              (s = gn(fn(i.fetch_dms().get_field(t), r), Dn(t))),
              mn(s.toFixed(r), '0', n + r + (r > 0 ? 1 : 0))
            );
          default:
            throw new Error('Unnexepected evaluation');
        }
      }
      function In(e) {
        switch (e.toUpperCase().trim()) {
          case 'N':
          case 'NORTH':
            return 0;
          case 'E':
          case 'EAST':
            return 1;
          case 'S':
          case 'SOUTH':
            return 2;
          case 'W':
          case 'WEST':
            return 3;
        }
        return null;
      }
      function Tn(e) {
        const t = parseFloat(e);
        if (Z(t)) {
          if (isNaN(t)) throw new Error('Invalid conversion');
          return t;
        }
        throw new Error('Invalid conversion');
      }
      function vn(e, t, n) {
        const r = 3 === n;
        let i = null,
          s = null,
          o = 0,
          a = 0,
          u = 0;
        if (r) {
          if (e.length < 2) throw new Error('Conversion Error');
          u = 1;
          const t = (function (e) {
            switch (oe(e)) {
              case 1:
                return { first: 0, second: 1 };
              case 2:
                return { first: 2, second: 1 };
              case 3:
                return { first: 2, second: 3 };
              case 4:
                return { first: 0, second: 3 };
            }
            return null;
          })(ne(e[e.length - 1]));
          if (
            (t
              ? ((i = t.first), (s = t.second))
              : ((o = 1), (i = In(ne(e[0]))), (s = In(ne(e[e.length - 1])))),
            null === i || null === s)
          )
            throw new Error('Invalid Conversion');
        }
        switch (t) {
          case 1:
          case 4:
          case 5:
            if (0 === e.length) throw new Error('Invalid Conversion');
            return r
              ? wn.createFromAngleMeridianAndDirection(
                  Fn.createFromAngleAndUnits(Tn(e[o]), bn(t)),
                  i,
                  s,
                )
              : wn.createFromAngleAndDirection(Fn.createFromAngleAndUnits(Tn(e[o]), bn(t)), n);
          case 3:
            if (((a = e.length - u - o), 3 === a)) {
              const t = Fn.createFromDegreesMinutesSeconds(Tn(e[o]), Tn(e[o + 1]), Tn(e[o + 2]));
              return r
                ? wn.createFromAngleMeridianAndDirection(t, i, s)
                : wn.createFromAngleAndDirection(t, n);
            }
            if (1 === a) {
              const t = Tn(e[o]),
                a = xn.number_to_dms(t),
                u = Fn.createFromDegreesMinutesSeconds(a.m_degrees, a.m_minutes, a.m_seconds);
              return r
                ? wn.createFromAngleMeridianAndDirection(u, i, s)
                : wn.createFromAngleAndDirection(u, n);
            }
        }
        throw new Error('Conversion Error');
      }
      function kn(e, t, n) {
        const r = { padding: 0, rounding: 0, newpos: t };
        let i = !1;
        for (; t < e.length; ) {
          const s = e[t];
          if (s === n) i ? r.rounding++ : r.padding++, t++;
          else {
            if ('.' !== s) break;
            (i = !0), t++;
          }
        }
        return (r.newpos = t - 1), r;
      }
      function _n(e, t, n) {
        const r = { escaped: '', newpos: t };
        for (t++; t < e.length; ) {
          const n = e[t];
          if ((t++, ']' === n)) break;
          r.escaped += n;
        }
        return (r.newpos = t - 1), r;
      }
      function On(e) {
        const t = [];
        for (let n = 0, r = e.length; n < r; n++) {
          let r = e.charCodeAt(n);
          r < 128
            ? t.push(r)
            : r < 2048
            ? t.push(192 | (r >> 6), 128 | (63 & r))
            : r < 55296 || r >= 57344
            ? t.push(224 | (r >> 12), 128 | ((r >> 6) & 63), 128 | (63 & r))
            : (n++,
              (r = 65536 + (((1023 & r) << 10) | (1023 & e.charCodeAt(n)))),
              t.push(
                240 | (r >> 18),
                128 | ((r >> 12) & 63),
                128 | ((r >> 6) & 63),
                128 | (63 & r),
              ));
        }
        return new Uint8Array(t);
      }
      class Bn {
        constructor(e) {
          (this.seed = e), (this.totallen = 0), (this.bufs = []), this.init();
        }
        init() {
          return (this.bufs = []), (this.totallen = 0), this;
        }
        updateFloatArray(e) {
          const t = [];
          for (const n of e)
            isNaN(n)
              ? t.push('NaN')
              : n === 1 / 0
              ? t.push('Infinity')
              : n === -1 / 0
              ? t.push('-Infinity')
              : 0 === n
              ? t.push('0')
              : t.push(n.toString(16));
          this.update(On(t.join('')));
        }
        updateIntArray(e) {
          const t = Int32Array.from(e);
          this.update(new Uint8Array(t.buffer));
        }
        updateUint8Array(e) {
          this.update(Uint8Array.from(e));
        }
        updateWithString(e) {
          return this.update(On(e));
        }
        update(e) {
          return this.bufs.push(e), (this.totallen += e.length), this;
        }
        digest() {
          const e = new Uint8Array(this.totallen);
          let t = 0;
          for (const n of this.bufs) e.set(n, t), (t += n.length);
          return this.init(), this.xxHash32(e, this.seed);
        }
        xxHash32(e, t = 0) {
          const n = e;
          let r = (t + 374761393) & 4294967295,
            i = 0;
          if (n.length >= 16) {
            const n = [
                (t + 2654435761 + 2246822519) & 4294967295,
                (t + 2246822519) & 4294967295,
                (t + 0) & 4294967295,
                (t - 2654435761) & 4294967295,
              ],
              s = e,
              o = s.length - 16;
            let a = 0;
            for (i = 0; (4294967280 & i) <= o; i += 4) {
              const e = i,
                t =
                  2246822519 * (s[e + 0] + (s[e + 1] << 8)) +
                  ((2246822519 * (s[e + 2] + (s[e + 3] << 8))) << 16);
              let r = (n[a] + t) & 4294967295;
              r = (r << 13) | (r >>> 19);
              const o = 65535 & r,
                u = r >>> 16;
              (n[a] = (2654435761 * o + ((2654435761 * u) << 16)) & 4294967295), (a = (a + 1) & 3);
            }
            r =
              (((n[0] << 1) | (n[0] >>> 31)) +
                ((n[1] << 7) | (n[1] >>> 25)) +
                ((n[2] << 12) | (n[2] >>> 20)) +
                ((n[3] << 18) | (n[3] >>> 14))) &
              4294967295;
          }
          r = (r + e.length) & 4294967295;
          const s = e.length - 4;
          for (; i <= s; i += 4) {
            const e = i;
            (r =
              (r +
                (3266489917 * (n[e + 0] + (n[e + 1] << 8)) +
                  ((3266489917 * (n[e + 2] + (n[e + 3] << 8))) << 16))) &
              4294967295),
              (r = (r << 17) | (r >>> 15)),
              (r = (668265263 * (65535 & r) + ((668265263 * (r >>> 16)) << 16)) & 4294967295);
          }
          for (; i < n.length; ++i)
            (r += 374761393 * n[i]),
              (r = (r << 11) | (r >>> 21)),
              (r = (2654435761 * (65535 & r) + ((2654435761 * (r >>> 16)) << 16)) & 4294967295);
          return (
            (r ^= r >>> 15),
            (r = ((2246822519 * (65535 & r)) & 4294967295) + ((2246822519 * (r >>> 16)) << 16)),
            (r ^= r >>> 13),
            (r = ((3266489917 * (65535 & r)) & 4294967295) + ((3266489917 * (r >>> 16)) << 16)),
            (r ^= r >>> 16),
            r < 0 ? r + 4294967296 : r
          );
        }
      }
      function Rn(e, t) {
        if (e.x === t.x && e.y === t.y) {
          if (e.hasZ) {
            if (e.z !== t.z) return !1;
          } else if (t.hasZ) return !1;
          if (e.hasM) {
            if (e.m !== t.m) return !1;
          } else if (t.hasM) return !1;
          return !0;
        }
        return !1;
      }
      function Mn(e, t, n) {
        if (null !== e)
          if (j(e)) {
            if ((t.updateUint8Array([61]), n.map.has(e))) {
              const r = n.map.get(e);
              t.updateIntArray([61237541 ^ r]);
            } else {
              n.map.set(e, n.currentLength++);
              for (const r of e) Mn(r, t, n);
              n.map.delete(e), n.currentLength--;
            }
            t.updateUint8Array([199]);
          } else if (q(e)) {
            if ((t.updateUint8Array([61]), n.map.has(e))) {
              const r = n.map.get(e);
              t.updateIntArray([61237541 ^ r]);
            } else {
              n.map.set(e, n.currentLength++);
              for (const r of e.toArray()) Mn(r, t, n);
              n.map.delete(e), n.currentLength--;
            }
            t.updateUint8Array([199]);
          } else {
            if (H(e)) return t.updateIntArray([e.getTime()]), void t.updateUint8Array([241]);
            if (L(e))
              return (
                t.updateIntArray([e.length]), t.updateWithString(e), void t.updateUint8Array([41])
              );
            if (G(e)) t.updateUint8Array([!0 === e ? 1 : 0, 113]);
            else {
              if (Z(e)) return t.updateFloatArray([e]), void t.updateUint8Array([173]);
              if (e instanceof Be) throw new Error('Type not supported in Hash');
              if (e instanceof Oe) throw new Error('Type not supported in Hash');
              if (!(e instanceof _e)) {
                if (e instanceof Ke) throw new Error('Type not supported in Hash');
                if (e instanceof r.Z)
                  return (
                    t.updateIntArray([3833836621]),
                    t.updateIntArray([0]),
                    t.updateFloatArray([e.x]),
                    t.updateIntArray([1]),
                    t.updateFloatArray([e.y]),
                    e.hasZ && (t.updateIntArray([2]), t.updateFloatArray([e.z])),
                    e.hasM && (t.updateIntArray([3]), t.updateFloatArray([e.m])),
                    t.updateIntArray([3765347959]),
                    void Mn(e.spatialReference.wkid, t, n)
                  );
                if (e instanceof u.Z) {
                  t.updateIntArray([1266616829]);
                  for (let r = 0; r < e.rings.length; r++) {
                    const i = e.rings[r],
                      s = [];
                    let o = null,
                      a = null;
                    for (let t = 0; t < i.length; t++) {
                      const n = e.getPoint(r, t);
                      if (0 === t) o = n;
                      else if (Rn(a, n)) continue;
                      (a = n), (t === i.length - 1 && Rn(o, n)) || s.push(n);
                    }
                    t.updateIntArray([1397116793, s.length]);
                    for (let e = 0; e < s.length; e++) {
                      const r = s[e];
                      t.updateIntArray([3962308117, e]),
                        Mn(r, t, n),
                        t.updateIntArray([2716288009]);
                    }
                    t.updateIntArray([2278822459]);
                  }
                  return t.updateIntArray([3878477243]), void Mn(e.spatialReference.wkid, t, n);
                }
                if (e instanceof l.Z) {
                  t.updateIntArray([4106883559]);
                  for (let r = 0; r < e.paths.length; r++) {
                    const i = e.paths[r];
                    t.updateIntArray([1397116793, i.length]);
                    for (let s = 0; s < i.length; s++)
                      t.updateIntArray([3962308117, s]),
                        Mn(e.getPoint(r, s), t, n),
                        t.updateIntArray([2716288009]);
                    t.updateIntArray([2278822459]);
                  }
                  return t.updateIntArray([2568784753]), void Mn(e.spatialReference.wkid, t, n);
                }
                if (e instanceof a.Z) {
                  t.updateIntArray([588535921, e.points.length]);
                  for (let r = 0; r < e.points.length; r++) {
                    const i = e.getPoint(r);
                    t.updateIntArray([r]), Mn(i, t, n);
                  }
                  return t.updateIntArray([1700171621]), void Mn(e.spatialReference.wkid, t, n);
                }
                if (e instanceof s.Z)
                  return (
                    t.updateIntArray([3483648373]),
                    t.updateIntArray([0]),
                    t.updateFloatArray([e.xmax]),
                    t.updateIntArray([1]),
                    t.updateFloatArray([e.xmin]),
                    t.updateIntArray([2]),
                    t.updateFloatArray([e.ymax]),
                    t.updateIntArray([3]),
                    t.updateFloatArray([e.ymin]),
                    e.hasZ &&
                      (t.updateIntArray([4]),
                      t.updateFloatArray([e.zmax]),
                      t.updateIntArray([5]),
                      t.updateFloatArray([e.zmin])),
                    e.hasM &&
                      (t.updateIntArray([6]),
                      t.updateFloatArray([e.mmax]),
                      t.updateIntArray([7]),
                      t.updateFloatArray([e.mmin])),
                    t.updateIntArray([3622027469]),
                    void Mn(e.spatialReference.wkid, t, n)
                  );
                if (e instanceof g.Z)
                  return (
                    t.updateIntArray([14]),
                    void 0 !== e.wkid && null !== e.wkid && t.updateIntArray([e.wkid]),
                    void (e.wkt && t.updateWithString(e.wkt))
                  );
                if (M(e)) throw new Error('Type not supported in Hash');
                if (V(e)) throw new Error('Type not supported in Hash');
                if (Y(e)) throw new Error('Type not supported in Hash');
                if (e === _) throw new Error('Type not supported in Hash');
                throw new Error('Type not supported in Hash');
              }
              if ((t.updateUint8Array([223]), n.map.has(e))) {
                const r = n.map.get(e);
                t.updateIntArray([61237541 ^ r]);
              } else {
                n.map.set(e, n.currentLength++);
                for (const r of e.keys())
                  t.updateIntArray([r.length]),
                    t.updateWithString(r),
                    t.updateUint8Array([251]),
                    Mn(e.field(r), t, n),
                    t.updateUint8Array([239]);
                n.map.delete(e), n.currentLength--;
              }
              t.updateUint8Array([73]);
            }
          }
        else t.updateUint8Array([0, 139]);
      }
      function Pn(e, t) {
        (e.portal = function (e, n) {
          return t(e, n, function (e, t, n) {
            return J(n, 1, 1), new Oe(ne(n[0]));
          });
        }),
          (e.trim = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), ne(n[0]).trim();
            });
          }),
          (e.tohex = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = oe(n[0]);
              return isNaN(r) ? r : r.toString(16);
            });
          }),
          (e.upper = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), ne(n[0]).toUpperCase();
            });
          }),
          (e.proper = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 2);
              let r = 1;
              2 === n.length && 'firstword' === ne(n[1]).toLowerCase() && (r = 2);
              const i = /\s/,
                s = ne(n[0]);
              let o = '',
                a = !0;
              for (let e = 0; e < s.length; e++) {
                let t = s[e];
                i.test(t)
                  ? 1 === r && (a = !0)
                  : t.toUpperCase() !== t.toLowerCase() &&
                    (a ? ((t = t.toUpperCase()), (a = !1)) : (t = t.toLowerCase())),
                  (o += t);
              }
              return o;
            });
          }),
          (e.lower = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 1), ne(n[0]).toLowerCase();
            });
          }),
          (e.guid = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 0, 1), n.length > 0))
                switch (ne(n[0]).toLowerCase()) {
                  case 'digits':
                    return X().replace('-', '').replace('-', '').replace('-', '').replace('-', '');
                  case 'digits-hyphen':
                    return X();
                  case 'digits-hyphen-braces':
                    return '{' + X() + '}';
                  case 'digits-hyphen-parentheses':
                    return '(' + X() + ')';
                }
              return '{' + X() + '}';
            });
          }),
          (e.console = function (e, n) {
            return t(e, n, function (t, n, r) {
              return 0 === r.length || (1 === r.length ? e.console(ne(r[0])) : e.console(ne(r))), _;
            });
          }),
          (e.mid = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 2, 3);
              let r = oe(n[1]);
              if (isNaN(r)) return '';
              if ((r < 0 && (r = 0), 2 === n.length)) return ne(n[0]).substr(r);
              let i = oe(n[2]);
              return isNaN(i) ? '' : (i < 0 && (i = 0), ne(n[0]).substr(r, i));
            });
          }),
          (e.find = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 2, 3);
              let r = 0;
              if (n.length > 2) {
                if (((r = oe(U(n[2], 0))), isNaN(r))) return -1;
                r < 0 && (r = 0);
              }
              return ne(n[1]).indexOf(ne(n[0]), r);
            });
          }),
          (e.left = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 2, 2);
              let r = oe(n[1]);
              return isNaN(r) ? '' : (r < 0 && (r = 0), ne(n[0]).substr(0, r));
            });
          }),
          (e.right = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 2, 2);
              let r = oe(n[1]);
              return isNaN(r) ? '' : (r < 0 && (r = 0), ne(n[0]).substr(-1 * r, r));
            });
          }),
          (e.split = function (e, n) {
            return t(e, n, function (e, t, n) {
              let r;
              J(n, 2, 4);
              let i = oe(U(n[2], -1));
              const s = le(U(n[3], !1));
              if (
                (-1 === i || null === i || !0 === s
                  ? (r = ne(n[0]).split(ne(n[1])))
                  : (isNaN(i) && (i = -1), i < -1 && (i = -1), (r = ne(n[0]).split(ne(n[1]), i))),
                !1 === s)
              )
                return r;
              const o = [];
              for (let e = 0; e < r.length && !(-1 !== i && o.length >= i); e++)
                '' !== r[e] && void 0 !== r[e] && o.push(r[e]);
              return o;
            });
          }),
          (e.text = function (e, n) {
            return t(e, n, function (e, t, n) {
              return J(n, 1, 2), ie(n[0], n[1]);
            });
          }),
          (e.concatenate = function (e, n) {
            return t(e, n, function (e, t, n) {
              const r = [];
              if (n.length < 1) return '';
              if (j(n[0])) {
                const e = U(n[2], '');
                for (let t = 0; t < n[0].length; t++) r[t] = ie(n[0][t], e);
                return n.length > 1 ? r.join(n[1]) : r.join('');
              }
              if (q(n[0])) {
                const e = U(n[2], '');
                for (let t = 0; t < n[0].length(); t++) r[t] = ie(n[0].get(t), e);
                return n.length > 1 ? r.join(n[1]) : r.join('');
              }
              for (let e = 0; e < n.length; e++) r[e] = ie(n[e]);
              return r.join('');
            });
          }),
          (e.reverse = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 1), j(n[0]))) {
                const e = n[0].slice(0);
                return e.reverse(), e;
              }
              if (q(n[0])) {
                const e = n[0].toArray().slice(0);
                return e.reverse(), e;
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.replace = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 3, 4);
              const r = ne(n[0]),
                i = ne(n[1]),
                s = ne(n[2]);
              return 4 !== n.length || le(n[3]) ? R(r, i, s) : r.replace(i, s);
            });
          }),
          (e.schema = function (e, n) {
            return t(e, n, function (e, t, n) {
              if (n[0] instanceof Ke) {
                const e = n[0].schema();
                return e ? _e.convertObjectToArcadeDictionary(e) : null;
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.subtypes = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 1), n[0] instanceof Ke)) {
                const e = n[0].subtypes();
                return e ? _e.convertObjectToArcadeDictionary(e) : null;
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.subtypecode = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 1), n[0] instanceof Ke)) {
                const e = n[0].subtypes();
                if (!e) return null;
                if (e.subtypeField && n[0].hasField(e.subtypeField)) {
                  const t = n[0].field(e.subtypeField);
                  for (const n of e.subtypes) if (n.code === t) return n.code;
                  return null;
                }
                return null;
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.subtypename = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 1), n[0] instanceof Ke)) {
                const e = n[0].subtypes();
                if (!e) return '';
                if (e.subtypeField && n[0].hasField(e.subtypeField)) {
                  const t = n[0].field(e.subtypeField);
                  for (const n of e.subtypes) if (n.code === t) return n.name;
                  return '';
                }
                return '';
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.gdbversion = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 1), n[0] instanceof Ke)) return n[0].gdbVersion();
              throw new Error('Invalid Parameter');
            });
          }),
          (e.domain = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 2, 3), n[0] instanceof Ke)) {
                const e = n[0].fullDomain(ne(n[1]), void 0 === n[2] ? void 0 : oe(n[2]));
                return e && e.domain
                  ? 'coded-value' === e.domain.type || 'codedValue' === e.domain.type
                    ? _e.convertObjectToArcadeDictionary({
                        type: 'codedValue',
                        name: e.domain.name,
                        dataType: He[e.field.type],
                        codedValues: e.domain.codedValues.map((e) => ({
                          name: e.name,
                          code: e.code,
                        })),
                      })
                    : _e.convertObjectToArcadeDictionary({
                        type: 'range',
                        name: e.domain.name,
                        dataType: He[e.field.type],
                        min: e.domain.min,
                        max: e.domain.max,
                      })
                  : null;
              }
              throw new Error('Invalid Parameter');
            });
          }),
          (e.domainname = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 2, 4), n[0] instanceof Ke))
                return n[0].domainValueLookup(ne(n[1]), n[2], void 0 === n[3] ? void 0 : oe(n[3]));
              throw new Error('Invalid Parameter');
            });
          }),
          (e.domaincode = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 2, 4), n[0] instanceof Ke))
                return n[0].domainCodeLookup(ne(n[1]), n[2], void 0 === n[3] ? void 0 : oe(n[3]));
              throw new Error('Invalid Parameter');
            });
          }),
          (e.urlencode = function (e, n) {
            return t(e, n, function (e, t, n) {
              if ((J(n, 1, 1), null === n[0])) return '';
              if (n[0] instanceof _e) {
                let e = '';
                for (const t of n[0].keys()) {
                  const r = n[0].field(t);
                  '' !== e && (e += '&'),
                    (e +=
                      null === r
                        ? encodeURIComponent(t) + '='
                        : encodeURIComponent(t) + '=' + encodeURIComponent(r));
                }
                return e;
              }
              return encodeURIComponent(ne(n[0]));
            });
          }),
          (e.hash = function (e, n) {
            return t(e, n, function (e, t, n) {
              J(n, 1, 1);
              const r = new Bn(0);
              return Mn(n[0], r, { map: new Map(), currentLength: 0 }), r.digest();
            });
          }),
          (e.convertdirection = function (e, n) {
            return t(e, n, function (e, t, n) {
              return (
                J(n, 3, 3),
                (function (e, t, n) {
                  if (!(t instanceof _e)) throw new Error('Invalid Parameter');
                  if (!1 === t.hasField('directionType'))
                    throw new Error('Invalid Parameter - Missing directionType');
                  if (!1 === t.hasField('angleType'))
                    throw new Error('Invalid Parameter - Missing directionType');
                  const r = yn(hn(t.field('directiontype'))),
                    i = (function (e, t, n) {
                      if (Z(e))
                        return (function (e, t, n) {
                          if (3 === n) throw new Error('Conversion error');
                          if (3 === t) {
                            const t = xn.number_to_dms(e);
                            return wn.createFromAngleAndDirection(
                              Fn.createFromDegreesMinutesSeconds(
                                t.m_degrees,
                                t.m_minutes,
                                t.m_seconds,
                              ),
                              n,
                            );
                          }
                          return wn.createFromAngleAndDirection(
                            Fn.createFromAngleAndUnits(e, bn(t)),
                            n,
                          );
                        })(oe(e), t, n);
                      if (L(e))
                        return vn(
                          (function (e) {
                            const t = [
                              ' ',
                              '-',
                              '/',
                              "'",
                              '"',
                              '\\',
                              '^',
                              '°',
                              cn,
                              '\t',
                              '\r',
                              '\n',
                              '*',
                            ];
                            let n = '';
                            for (let r = 0; r < e.length; r++) {
                              const i = e.charAt(r);
                              -1 !== t.indexOf(i) ? (n += 'RRSPLITRRSPLITRR') : (n += i);
                            }
                            return n.split('RRSPLITRRSPLITRR').filter((e) => '' !== e);
                          })(e),
                          t,
                          n,
                        );
                      if (j(e)) return vn(e, t, n);
                      if (q(e)) return vn(e.toArray(), t, n);
                      throw new Error('Conversion Error');
                    })(e, En(hn(t.field('angletype'))), r);
                  if (!(n instanceof _e)) throw new Error('Invalid Parameter');
                  if (!1 === n.hasField('directionType'))
                    throw new Error('Invalid Parameter - Missing directionType');
                  if (!1 === n.hasField('outputType'))
                    throw new Error('Invalid Parameter - Missing directionType');
                  const s = yn(hn(n.field('directiontype'))),
                    o = n.hasField('angleType') ? En(hn(n.field('angletype'))) : null,
                    a = hn(n.field('outputType')).toUpperCase().trim();
                  if (!s || !a) throw new Error('Conversion error');
                  if (!(o || ('TEXT' === a && n.hasField('format'))))
                    throw new Error('Invalid unit');
                  switch (a) {
                    case 'VALUE':
                      return 3 === s || 3 === o
                        ? (function (e, t, n) {
                            const r = e.getAngle(t);
                            if (3 === t && 3 === n) {
                              const n = xn.seconds_to_DMS(r.extract_angular_units(2));
                              return [
                                pn(e.getMeridian(t), 'SHORT'),
                                n.m_degrees,
                                n.m_minutes,
                                n.m_seconds,
                                pn(e.getDirection(t), 'SHORT'),
                              ];
                            }
                            if (3 === n) {
                              const e = xn.seconds_to_DMS(r.extract_angular_units(2));
                              return [e.m_degrees, e.m_minutes, e.m_seconds];
                            }
                            return 3 === t
                              ? [
                                  pn(e.getMeridian(t), 'SHORT'),
                                  r.extract_angular_units(n),
                                  pn(e.getDirection(t), 'SHORT'),
                                ]
                              : [r.extract_angular_units(n)];
                          })(i, s, o)
                        : (function (e, t, n) {
                            const r = bn(n);
                            if (r && 3 !== n) return e.getAngle(t).extract_angular_units(r);
                            throw new Error('Conversion Error');
                          })(i, s, o);
                    case 'TEXT': {
                      let e = '';
                      return (
                        n.hasField('format') && (e = ne(n.field('format'))),
                        (null !== e && '' !== e) ||
                          (e = (function (e, t) {
                            let n = '';
                            switch (e) {
                              case 1:
                                n = 3 === t ? 'DD.DD°' : 'DDD.DD°';
                                break;
                              case 3:
                                n = 3 === t ? 'dd° mm\' ss"' : 'ddd° mm\' ss.ss"';
                                break;
                              case 4:
                                n = 'R.RR';
                                break;
                              case 5:
                                n = 'GGG.GG' + cn;
                                break;
                              default:
                                throw new Error('Conversion error');
                            }
                            return 3 === t && (n = 'p ' + n + ' b'), n;
                          })(o, s)),
                        (function (e, t, n) {
                          let r = '',
                            i = null,
                            s = null;
                          const o = Nn.createFromStringAndBearing(t, e, n),
                            a = { D: 1, d: 6, m: 7, s: 8, R: 4, G: 5 };
                          for (let u = 0; u < t.length; u++) {
                            const l = t[u];
                            switch (l) {
                              case '[':
                                (i = _n(t, u)), (r += i.escaped), (u = i.newpos);
                                continue;
                              case 'D':
                              case 'd':
                              case 'm':
                              case 's':
                              case 'R':
                              case 'G':
                                (i = kn(t, u, l)),
                                  (s = e.getAngle(n)),
                                  (r += Sn(s, a[l], i.padding, i.rounding, o)),
                                  (u = i.newpos);
                                continue;
                              case 'P':
                              case 'p':
                                r += pn(o.fetch_meridian(), 'p' === l ? 'SHORT' : 'LONG');
                                continue;
                              case 'B':
                              case 'b':
                                r += pn(o.fetch_direction(), 'b' === l ? 'SHORT' : 'LONG');
                                continue;
                              default:
                                r += l;
                            }
                          }
                          return r;
                        })(i, e, s)
                      );
                    }
                    default:
                      throw new Error('Invalid Parameter');
                  }
                })(n[0], n[1], n[2])
              );
            });
          });
      }
      function Un(e, t, n) {
        try {
          return n(e, null, t);
        } catch (e) {
          throw e;
        }
      }
      function Ln(e) {
        return e instanceof Error ? (0, i.d1)(e) : (0, i.d1)(new Error(e));
      }
      function Gn(e, t) {
        try {
          switch (t.type) {
            case 'EmptyStatement':
              return 'lc.voidOperation';
            case 'VariableDeclarator':
              return (function (e, t) {
                let n = null === t.init ? null : Gn(e, t.init);
                n === _ && (n = null);
                const r = t.id.name.toLowerCase();
                if (null !== e.localScope) {
                  if (void 0 !== e.localScope[r]) return "lscope['" + r + "']=" + n + '; ';
                  if (void 0 !== e.localScope._SymbolsMap[r])
                    return "lscope['" + e.localScope._SymbolsMap[r] + "']=" + n + '; ';
                  {
                    const t = Kn(e);
                    return (
                      (e.localScope._SymbolsMap[r] = t),
                      (e.mangleMap[r] = t),
                      "lscope['" + t + "']=" + n + '; '
                    );
                  }
                }
                if (void 0 !== e.globalScope[r]) return "gscope['" + r + "']=" + n + '; ';
                if (void 0 !== e.globalScope._SymbolsMap[r])
                  return "gscope['" + e.globalScope._SymbolsMap[r] + "']=" + n + '; ';
                {
                  const t = Kn(e);
                  return (
                    (e.globalScope._SymbolsMap[r] = t),
                    (e.mangleMap[r] = t),
                    "gscope['" + t + "']=" + n + '; '
                  );
                }
              })(e, t);
            case 'VariableDeclaration':
              return (function (e, t) {
                const n = [];
                for (let r = 0; r < t.declarations.length; r++) n.push(Gn(e, t.declarations[r]));
                return n.join('\n') + ' \n lastStatement=  lc.voidOperation; \n';
              })(e, t);
            case 'BlockStatement':
              return zn(e, t);
            case 'FunctionDeclaration':
              return (function (e, t) {
                const n = t.id.name.toLowerCase(),
                  r = {
                    isAsync: e.isAsync,
                    spatialReference: e.spatialReference,
                    console: e.console,
                    lrucache: e.lrucache,
                    interceptor: e.interceptor,
                    services: e.services,
                    symbols: e.symbols,
                    mangleMap: e.mangleMap,
                    localScope: { _SymbolsMap: {} },
                    depthCounter: e.depthCounter + 1,
                    globalScope: e.globalScope,
                  };
                if (r.depthCounter > 64) throw new Error('Exceeded maximum function depth');
                let i =
                  'new lc.SizzleFunction( lang.functionDepthchecker(function() { var lastStatement = lc.voidOperation; \n   var lscope = runtimeCtx.localStack[runtimeCtx.localStack.length-1];\n';
                for (let n = 0; n < t.params.length; n++) {
                  const s = t.params[n].name.toLowerCase(),
                    o = Kn(e);
                  (r.localScope._SymbolsMap[s] = o),
                    (r.mangleMap[s] = o),
                    (i += "lscope['" + o + "']=arguments[" + n.toString() + '];\n');
                }
                if (
                  (!0 === e.isAsync
                    ? ((i += 'return lang.__awaiter(this, void 0, void 0, function* () {\n'),
                      (i += zn(r, t.body) + '\n return lastStatement; '),
                      (i += '});  }'),
                      (i += ', runtimeCtx))'),
                      (i += '\n lastStatement = lc.voidOperation; \n'))
                    : ((i += zn(r, t.body) + '\n return lastStatement; }, runtimeCtx))'),
                      (i += '\n lastStatement = lc.voidOperation; \n')),
                  void 0 !== e.globalScope[n])
                )
                  return "gscope['" + n + "']=" + i;
                if (void 0 !== e.globalScope._SymbolsMap[n])
                  return "gscope['" + e.globalScope._SymbolsMap[n] + "']=" + i;
                {
                  const t = Kn(e);
                  return (
                    (e.globalScope._SymbolsMap[n] = t),
                    (e.mangleMap[n] = t),
                    "gscope['" + t + "']=" + i
                  );
                }
              })(e, t);
            case 'ReturnStatement':
              return (function (e, t) {
                return null === t.argument
                  ? 'return lc.voidOperation'
                  : 'return ' + Gn(e, t.argument);
              })(e, t);
            case 'IfStatement':
              return (function (e, t) {
                if ('AssignmentExpression' === t.test.type || 'UpdateExpression' === t.test.type)
                  throw new Error(mt(t.test, 'RUNTIME', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION'));
                const n = Gn(e, t.test),
                  r = $n(e);
                let i =
                  'var ' +
                  r +
                  ' = ' +
                  n +
                  ';\n if (' +
                  r +
                  ' === true) {\n' +
                  Zn(e, t.consequent) +
                  '\n }\n';
                return (
                  null !== t.alternate
                    ? (i += 'else if (' + r + '===false)   { \n' + Zn(e, t.alternate) + '}\n')
                    : (i +=
                        'else if (' + r + '===false) { \n lastStatement = lc.voidOperation;\n }\n'),
                  (i +=
                    "else { lang.error({type: '" +
                    t.type +
                    "'},'RUNTIME','CANNOT_USE_NONBOOLEAN_IN_CONDITION'); \n}\n"),
                  i
                );
              })(e, t);
            case 'ExpressionStatement':
              return (function (e, t) {
                return 'AssignmentExpression' === t.expression.type
                  ? 'lastStatement = lc.voidOperation; ' + Gn(e, t.expression) + '; \n '
                  : (t.expression.type, 'lastStatement = ' + Gn(e, t.expression) + '; ');
              })(e, t);
            case 'AssignmentExpression':
              return (function (e, t) {
                const n = Gn(e, t.right);
                let r = null,
                  i = '';
                if ('MemberExpression' === t.left.type)
                  return (
                    (r = Gn(e, t.left.object)),
                    (i =
                      !0 === t.left.computed
                        ? Gn(e, t.left.property)
                        : "'" + t.left.property.name + "'"),
                    'lang.assignmember(' + r + ',' + i + ",'" + t.operator + "'," + n + ')'
                  );
                if (((r = t.left.name.toLowerCase()), null !== e.localScope)) {
                  if (void 0 !== e.localScope[r])
                    return (
                      "lscope['" +
                      r +
                      "']=lang.assign(" +
                      n +
                      ",'" +
                      t.operator +
                      "', lscope['" +
                      r +
                      "'])"
                    );
                  if (void 0 !== e.localScope._SymbolsMap[r])
                    return (
                      "lscope['" +
                      e.localScope._SymbolsMap[r] +
                      "']=lang.assign(" +
                      n +
                      ",'" +
                      t.operator +
                      "', lscope['" +
                      e.localScope._SymbolsMap[r] +
                      "'])"
                    );
                }
                if (void 0 !== e.globalScope[r])
                  return (
                    "gscope['" +
                    r +
                    "']=lang.assign(" +
                    n +
                    ",'" +
                    t.operator +
                    "', gscope['" +
                    r +
                    "'])"
                  );
                if (void 0 !== e.globalScope._SymbolsMap[r])
                  return (
                    "gscope['" +
                    e.globalScope._SymbolsMap[r] +
                    "']=lang.assign(" +
                    n +
                    ",'" +
                    t.operator +
                    "', gscope['" +
                    e.globalScope._SymbolsMap[r] +
                    "'])"
                  );
                throw new Error('Variable not recognised');
              })(e, t);
            case 'UpdateExpression':
              return (function (e, t) {
                let n = null,
                  r = '';
                if ('MemberExpression' === t.argument.type)
                  return (
                    (n = Gn(e, t.argument.object)),
                    (r =
                      !0 === t.argument.computed
                        ? Gn(e, t.argument.property)
                        : "'" + t.argument.property.name + "'"),
                    'lang.memberupdate(' + n + ',' + r + ",'" + t.operator + "'," + t.prefix + ')'
                  );
                if (((n = t.argument.name.toLowerCase()), null !== e.localScope)) {
                  if (void 0 !== e.localScope[n])
                    return "lang.update(lscope, '" + n + "','" + t.operator + "'," + t.prefix + ')';
                  if (void 0 !== e.localScope._SymbolsMap[n])
                    return (
                      "lang.update(lscope, '" +
                      e.localScope._SymbolsMap[n] +
                      "','" +
                      t.operator +
                      "'," +
                      t.prefix +
                      ')'
                    );
                }
                if (void 0 !== e.globalScope[n])
                  return "lang.update(gscope, '" + n + "','" + t.operator + "'," + t.prefix + ')';
                if (void 0 !== e.globalScope._SymbolsMap[n])
                  return (
                    "lang.update(gscope, '" +
                    e.globalScope._SymbolsMap[n] +
                    "','" +
                    t.operator +
                    "'," +
                    t.prefix +
                    ')'
                  );
                throw new Error('Variable not recognised');
              })(e, t);
            case 'BreakStatement':
              return 'break';
            case 'ContinueStatement':
              return 'continue';
            case 'TemplateLiteral':
              return (function (e, t) {
                try {
                  const n = [];
                  let r = 0;
                  for (const i of t.quasis)
                    n.push(i.value ? JSON.stringify(i.value.cooked) : JSON.stringify('')),
                      !1 === i.tail &&
                        (n.push(
                          t.expressions[r]
                            ? 'lang.castString(lang.aCheck(' +
                                Gn(e, t.expressions[r]) +
                                ", 'TemplateLiteral'))"
                            : '',
                        ),
                        r++);
                  return '([' + n.join(',') + "]).join('')";
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'TemplateElement':
              return JSON.stringify(t.value ? t.value.cooked : '');
            case 'ForStatement':
              return (function (e, t) {
                let n = 'lastStatement = lc.voidOperation; \n';
                null !== t.init && (n += Gn(e, t.init) + '; ');
                const r = $n(e),
                  i = $n(e);
                return (
                  (n += 'var ' + r + ' = true; '),
                  (n += '\n do { '),
                  null !== t.update &&
                    (n +=
                      ' if (' +
                      r +
                      '===false) {\n ' +
                      Gn(e, t.update) +
                      '  \n}\n ' +
                      r +
                      '=false; \n'),
                  null !== t.test &&
                    ((n += 'var ' + i + ' = ' + Gn(e, t.test) + '; '),
                    (n +=
                      'if (' +
                      i +
                      '===false) { break; } else if (' +
                      i +
                      "!==true) { lang.error({type: '" +
                      t.type +
                      "'},'RUNTIME','CANNOT_USE_NONBOOLEAN_IN_CONDITION');   }\n")),
                  (n += Gn(e, t.body)),
                  null !== t.update && (n += '\n ' + Gn(e, t.update)),
                  (n += '\n' + r + ' = true; \n} while(true);  lastStatement = lc.voidOperation; '),
                  n
                );
              })(e, t);
            case 'ForInStatement':
              return (function (e, t) {
                const n = $n(e),
                  r = $n(e),
                  i = $n(e);
                let s = 'var ' + n + ' = ' + Gn(e, t.right) + ';\n';
                'VariableDeclaration' === t.left.type && (s += Gn(e, t.left));
                let o =
                  'VariableDeclaration' === t.left.type
                    ? t.left.declarations[0].id.name
                    : t.left.name;
                o = o.toLowerCase();
                let a = '';
                return (
                  null !== e.localScope &&
                    (void 0 !== e.localScope[o]
                      ? (a = "lscope['" + o + "']")
                      : void 0 !== e.localScope._SymbolsMap[o] &&
                        (a = "lscope['" + e.localScope._SymbolsMap[o] + "']")),
                  '' === a &&
                    (void 0 !== e.globalScope[o]
                      ? (a = "gscope['" + o + "']")
                      : void 0 !== e.globalScope._SymbolsMap[o] &&
                        (a = "gscope['" + e.globalScope._SymbolsMap[o] + "']")),
                  (s += 'if (' + n + '===null) {  lastStatement = lc.voidOperation; }\n '),
                  (s += 'else if (lc.isArray(' + n + ') || lc.isString(' + n + ')) {'),
                  (s += 'var ' + r + '=' + n + '.length; \n'),
                  (s += 'for(var ' + i + '=0; ' + i + '<' + r + '; ' + i + '++) {\n'),
                  (s += a + '=' + i + ';\n'),
                  (s += Gn(e, t.body)),
                  (s += '\n}\n'),
                  (s += ' lastStatement = lc.voidOperation; \n'),
                  (s += ' \n}\n'),
                  (s += 'else if (lc.isImmutableArray(' + n + ')) {'),
                  (s += 'var ' + r + '=' + n + '.length(); \n'),
                  (s += 'for(var ' + i + '=0; ' + i + '<' + r + '; ' + i + '++) {\n'),
                  (s += a + '=' + i + ';\n'),
                  (s += Gn(e, t.body)),
                  (s += '\n}\n'),
                  (s += ' lastStatement = lc.voidOperation; \n'),
                  (s += ' \n}\n'),
                  (s +=
                    'else if (( ' +
                    n +
                    ' instanceof lang.Dictionary) || ( ' +
                    n +
                    ' instanceof lang.Feature)) {'),
                  (s += 'var ' + r + '=' + n + '.keys(); \n'),
                  (s += 'for(var ' + i + '=0; ' + i + '<' + r + '.length; ' + i + '++) {\n'),
                  (s += a + '=' + r + '[' + i + '];\n'),
                  (s += Gn(e, t.body)),
                  (s += '\n}\n'),
                  (s += ' lastStatement = lc.voidOperation; \n'),
                  (s += ' \n}\n'),
                  e.isAsync &&
                    ((s += 'else if (lc.isFeatureSet(' + n + ')) {'),
                    (s += 'var ' + r + '=' + n + '.iterator(runtimeCtx.abortSignal); \n'),
                    (s +=
                      'for(var ' +
                      i +
                      '=lang. graphicToFeature( yield ' +
                      r +
                      '.next(),' +
                      n +
                      '); ' +
                      i +
                      '!=null; ' +
                      i +
                      '=lang. graphicToFeature( yield ' +
                      r +
                      '.next(),' +
                      n +
                      ')) {\n'),
                    (s += a + '=' + i + ';\n'),
                    (s += Gn(e, t.body)),
                    (s += '\n}\n'),
                    (s += ' lastStatement = lc.voidOperation; \n'),
                    (s += ' \n}\n')),
                  (s += 'else { lastStatement = lc.voidOperation; } \n'),
                  s
                );
              })(e, t);
            case 'Identifier':
              return (function (e, t) {
                try {
                  const n = t.name.toLowerCase();
                  if (null !== e.localScope) {
                    if (void 0 !== e.localScope[n]) return "lscope['" + n + "']";
                    if (void 0 !== e.localScope._SymbolsMap[n])
                      return "lscope['" + e.localScope._SymbolsMap[n] + "']";
                  }
                  if (void 0 !== e.globalScope[n]) return "gscope['" + n + "']";
                  if (void 0 !== e.globalScope._SymbolsMap[n])
                    return "gscope['" + e.globalScope._SymbolsMap[n] + "']";
                  throw new Error(mt(t, 'RUNTIME', 'VARIABLENOTFOUND'));
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'MemberExpression':
              return (function (e, t) {
                try {
                  let n;
                  return (
                    (n = !0 === t.computed ? Gn(e, t.property) : "'" + t.property.name + "'"),
                    'lang.member(' + Gn(e, t.object) + ',' + n + ')'
                  );
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'Literal':
              return null === t.value || void 0 === t.value ? 'null' : JSON.stringify(t.value);
            case 'ThisExpression':
              throw new Error(mt(t, 'RUNTIME', 'NOTSUPPORTED'));
            case 'CallExpression':
              return (function (e, t) {
                try {
                  if ('Identifier' !== t.callee.type)
                    throw new Error(mt(t, 'RUNTIME', 'ONLYNODESSUPPORTED'));
                  const n = t.callee.name.toLowerCase();
                  let r = '';
                  if (
                    (null !== e.localScope &&
                      (void 0 !== e.localScope[n]
                        ? (r = "lscope['" + n + "']")
                        : void 0 !== e.localScope._SymbolsMap[n] &&
                          (r = "lscope['" + e.localScope._SymbolsMap[n] + "']")),
                    '' === r &&
                      (void 0 !== e.globalScope[n]
                        ? (r = "gscope['" + n + "']")
                        : void 0 !== e.globalScope._SymbolsMap[n] &&
                          (r = "gscope['" + e.globalScope._SymbolsMap[n] + "']")),
                    '' !== r)
                  ) {
                    let n = '[';
                    for (let r = 0; r < t.arguments.length; r++)
                      r > 0 && (n += ', '), (n += Gn(e, t.arguments[r]));
                    return (
                      (n += ']'),
                      e.isAsync
                        ? '(yield lang.callfunc(' + r + ',' + n + ',runtimeCtx) )'
                        : 'lang.callfunc(' + r + ',' + n + ',runtimeCtx)'
                    );
                  }
                  throw new Error(mt(t, 'RUNTIME', 'NOTFOUND'));
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'UnaryExpression':
              return (function (e, t) {
                try {
                  return 'lang.unary(' + Gn(e, t.argument) + ",'" + t.operator + "')";
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'BinaryExpression':
              return (function (e, t) {
                try {
                  return (
                    'lang.binary(' + Gn(e, t.left) + ',' + Gn(e, t.right) + ",'" + t.operator + "')"
                  );
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'LogicalExpression':
              return (function (e, t) {
                try {
                  if ('AssignmentExpression' === t.left.type || 'UpdateExpression' === t.left.type)
                    throw new Error(mt(t.left, 'RUNTIME', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION'));
                  if (
                    'AssignmentExpression' === t.right.type ||
                    'UpdateExpression' === t.right.type
                  )
                    throw new Error(mt(t.right, 'RUNTIME', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION'));
                  if ('&&' === t.operator || '||' === t.operator)
                    return (
                      '(lang.logicalCheck(' +
                      Gn(e, t.left) +
                      ') ' +
                      t.operator +
                      ' lang.logicalCheck(' +
                      Gn(e, t.right) +
                      '))'
                    );
                  throw new Error(mt(t, 'RUNTIME', 'ONLYORORAND'));
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'ConditionalExpression':
              throw new Error(mt(t, 'RUNTIME', 'NOTSUPPORTED'));
            case 'ArrayExpression':
              return (function (e, t) {
                try {
                  const n = [];
                  for (let r = 0; r < t.elements.length; r++)
                    'Literal' === t.elements[r].type
                      ? n.push(Gn(e, t.elements[r]))
                      : n.push('lang.aCheck(' + Gn(e, t.elements[r]) + ",'ArrayExpression')");
                  return '[' + n.join(',') + ']';
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'ObjectExpression':
              return (function (e, t) {
                let n = 'lang.dictionary([';
                for (let r = 0; r < t.properties.length; r++) {
                  const i = t.properties[r];
                  r > 0 && (n += ','),
                    (n +=
                      'lang.strCheck(' +
                      ('Identifier' === i.key.type ? "'" + i.key.name + "'" : Gn(e, i.key)) +
                      ",'ObjectExpression'),lang.aCheck(" +
                      Gn(e, i.value) +
                      ", 'ObjectExpression')");
                }
                return (n += '])'), n;
              })(e, t);
            case 'Property':
              return (function (e, t) {
                throw new Error('Should not get here');
              })();
            case 'Array':
              throw new Error(mt(t, 'RUNTIME', 'NOTSUPPORTED'));
            default:
              throw new Error(mt(t, 'RUNTIME', 'UNREOGNISED'));
          }
        } catch (e) {
          throw e;
        }
      }
      function Zn(e, t) {
        return 'BlockStatement' === t.type
          ? Gn(e, t)
          : 'ReturnStatement' === t.type ||
            'BreakStatement' === t.type ||
            'ContinueStatement' === t.type
          ? Gn(e, t) + '; '
          : 'UpdateExpression' === t.type
          ? 'lastStatement = ' + Gn(e, t) + '; '
          : 'ExpressionStatement' === t.type
          ? Gn(e, t)
          : 'ObjectExpression' === t.type
          ? 'lastStatement = ' + Gn(e, t) + '; '
          : Gn(e, t) + '; ';
      }
      function zn(e, t) {
        let n = '';
        for (let r = 0; r < t.body.length; r++)
          'ReturnStatement' === t.body[r].type ||
          'BreakStatement' === t.body[r].type ||
          'ContinueStatement' === t.body[r].type
            ? (n += Gn(e, t.body[r]) + '; \n')
            : 'UpdateExpression' === t.body[r].type || 'ObjectExpression' === t.body[r].type
            ? (n += 'lastStatement = ' + Gn(e, t.body[r]) + '; \n')
            : (n += Gn(e, t.body[r]) + ' \n');
        return n;
      }
      let jn = 0;
      const Vn = {};
      function Yn(e) {
        return null === e
          ? ''
          : j(e) || q(e)
          ? 'Array'
          : H(e)
          ? 'Date'
          : L(e)
          ? 'String'
          : G(e)
          ? 'Boolean'
          : Z(e)
          ? 'Number'
          : e instanceof Be
          ? 'Attachment'
          : e instanceof Oe
          ? 'Portal'
          : e instanceof _e
          ? 'Dictionary'
          : e instanceof Ke
          ? 'Feature'
          : e instanceof r.Z
          ? 'Point'
          : e instanceof u.Z
          ? 'Polygon'
          : e instanceof l.Z
          ? 'Polyline'
          : e instanceof a.Z
          ? 'Multipoint'
          : e instanceof s.Z
          ? 'Extent'
          : M(e)
          ? 'Function'
          : V(e)
          ? 'FeatureSet'
          : Y(e)
          ? 'FeatureSetCollection'
          : e === _
          ? ''
          : 'number' == typeof e && isNaN(e)
          ? 'Number'
          : 'Unrecognised Type';
      }
      function qn(e, t, n, r) {
        try {
          if (te(t[n], r)) return t[n + 1];
          {
            const i = t.length - n;
            return 1 === i ? t[n] : 2 === i ? null : 3 === i ? t[n + 2] : qn(e, t, n + 2, r);
          }
        } catch (e) {
          throw e;
        }
      }
      function Hn(e, t, n, r) {
        try {
          if (!0 === r) return t[n + 1];
          if (3 == t.length - n) return t[n + 2];
          {
            const r = t[n + 2];
            if (!1 === G(r)) throw new Error('WHEN needs boolean test conditions');
            return Hn(e, t, n + 2, r);
          }
        } catch (e) {
          throw e;
        }
      }
      function Jn(e, t) {
        const n = e.length,
          r = Math.floor(n / 2);
        return 0 === n
          ? []
          : 1 === n
          ? [e[0]]
          : (function (e, t, n) {
              const r = [];
              for (; e.length > 0 || t.length > 0; )
                if (e.length > 0 && t.length > 0) {
                  let i = n(e[0], t[0]);
                  isNaN(i) && (i = 0),
                    i <= 0 ? (r.push(e[0]), (e = e.slice(1))) : (r.push(t[0]), (t = t.slice(1)));
                } else
                  e.length > 0
                    ? (r.push(e[0]), (e = e.slice(1)))
                    : t.length > 0 && (r.push(t[0]), (t = t.slice(1)));
              return r;
            })(Jn(e.slice(0, r), t), Jn(e.slice(r, n), t), t);
      }
      function Xn(e, t) {
        try {
          const n = e.length,
            r = Math.floor(n / 2);
          if (0 === n) return (0, i.DB)([]);
          if (1 === n) return (0, i.DB)([e[0]]);
          const s = [Xn(e.slice(0, r), t), Xn(e.slice(r, n), t)];
          return (0, i.$6)(s).then((e) => Wn(e[0], e[1], t, []));
        } catch (e) {
          return (0, i.d1)(e);
        }
      }
      function Wn(e, t, n, r) {
        return (0, i.Ue)((i, s) => {
          const o = r;
          e.length > 0 || t.length > 0
            ? e.length > 0 && t.length > 0
              ? n(e[0], t[0]).then((a) => {
                  try {
                    isNaN(a) && (a = 1),
                      a <= 0 ? (o.push(e[0]), (e = e.slice(1))) : (o.push(t[0]), (t = t.slice(1))),
                      Wn(e, t, n, r).then((e) => {
                        i(e);
                      }, s);
                  } catch (e) {
                    s(e);
                  }
                }, s)
              : e.length > 0
              ? (o.push(e[0]),
                Wn((e = e.slice(1)), t, n, r).then((e) => {
                  i(e);
                }, s))
              : t.length > 0 &&
                (o.push(t[0]),
                (t = t.slice(1)),
                Wn(e, t, n, r).then((e) => {
                  i(e);
                }, s))
            : i(r);
        });
      }
      function Kn(e) {
        return e.symbols.symbolCounter++, '_T' + e.symbols.symbolCounter.toString();
      }
      function $n(e) {
        return e.symbols.symbolCounter++, '_Tvar' + e.symbols.symbolCounter.toString();
      }
      xt(Vn, Un),
        Ft(Vn, Un),
        Pn(Vn, Un),
        Jt(Vn, Un),
        Ut(Vn, Un),
        Qt(Vn, Un),
        (Vn.typeof = function (e, t) {
          return Un(e, t, function (e, t, n) {
            J(n, 1, 1);
            const r = Yn(n[0]);
            if ('Unrecognised Type' === r) throw new Error('Unrecognised Type');
            return r;
          });
        }),
        (Vn.iif = function (e, t) {
          try {
            return Un(e, t, function (e, t, n) {
              if ((J(n, 3, 3), !1 === G(n[0])))
                throw new Error('IF Function must have a boolean test condition');
              return n[0] ? n[1] : n[2];
            });
          } catch (e) {
            throw e;
          }
        }),
        (Vn.decode = function (e, t) {
          try {
            return Un(e, t, function (t, n, r) {
              if (r.length < 2) throw new Error('Missing Parameters');
              if (2 === r.length) return r[1];
              {
                if ((r.length - 1) % 2 == 0) throw new Error('Must have a default value result.');
                const t = r[0];
                return qn(e, r, 1, t);
              }
            });
          } catch (e) {
            throw e;
          }
        }),
        (Vn.when = function (e, t) {
          try {
            return Un(e, t, function (t, n, r) {
              if (r.length < 3) throw new Error('Missing Parameters');
              if (r.length % 2 == 0) throw new Error('Must have a default value result.');
              const i = r[0];
              if (!1 === G(i)) throw new Error('WHEN needs boolean test conditions');
              return Hn(e, r, 0, i);
            });
          } catch (e) {
            throw e;
          }
        }),
        (Vn.top = function (e, t) {
          return Un(e, t, function (e, t, n) {
            if ((J(n, 2, 2), j(n[0])))
              return oe(n[1]) >= n[0].length ? n[0].slice(0) : n[0].slice(0, oe(n[1]));
            if (q(n[0])) return oe(n[1]) >= n[0].length() ? n[0].slice(0) : n[0].slice(0, oe(n[1]));
            throw new Error('Top cannot accept this parameter type');
          });
        }),
        (Vn.first = function (e, t) {
          return Un(e, t, function (e, t, n) {
            return (
              J(n, 1, 1),
              j(n[0])
                ? 0 === n[0].length
                  ? null
                  : n[0][0]
                : q(n[0])
                ? 0 === n[0].length()
                  ? null
                  : n[0].get(0)
                : null
            );
          });
        }),
        (Vn.sort = function (e, t) {
          return Un(e, t, function (t, n, r) {
            J(r, 1, 2);
            let i = r[0];
            if ((q(i) && (i = i.toArray()), !1 === j(i))) throw new Error('Illegal Argument');
            if (r.length > 1) {
              if (!1 === M(r[1])) throw new Error('Illegal Argument');
              let n = i;
              const s = function (e, n) {
                return or.callfunc(r[1], [e, n], t);
              };
              return e.isAsync
                ? Xn(n, s)
                : ((n = Jn(n, function (e, t) {
                    return s(e, t);
                  })),
                  n);
            }
            {
              let e = i;
              if (0 === e.length) return [];
              const t = {};
              for (let n = 0; n < e.length; n++) {
                const r = Yn(e[n]);
                '' !== r && (t[r] = !0);
              }
              if (
                !0 === t.Array ||
                !0 === t.Dictionary ||
                !0 === t.Feature ||
                !0 === t.Point ||
                !0 === t.Polygon ||
                !0 === t.Polyline ||
                !0 === t.Multipoint ||
                !0 === t.Extent ||
                !0 === t.Function
              )
                return e.slice(0);
              let n = 0,
                r = '';
              for (const e in t) n++, (r = e);
              return (
                (e =
                  n > 1 || 'String' === r
                    ? Jn(e, function (e, t) {
                        if (null == e || e === _) return null == t || t === _ ? 0 : 1;
                        if (null == t || t === _) return -1;
                        const n = ne(e),
                          r = ne(t);
                        return n < r ? -1 : n === r ? 0 : 1;
                      })
                    : 'Number' === r
                    ? Jn(e, function (e, t) {
                        return e - t;
                      })
                    : 'Boolean' === r
                    ? Jn(e, function (e, t) {
                        return e === t ? 0 : t ? -1 : 1;
                      })
                    : 'Date' === r
                    ? Jn(e, function (e, t) {
                        return t - e;
                      })
                    : e.slice(0)),
                e
              );
            }
          });
        });
      const Qn = {};
      for (const e in Vn) Qn[e] = new I(Vn[e]);
      Yt(Vn, Un);
      for (const e in Vn) Vn[e] = new I(Vn[e]);
      const er = function () {};
      er.prototype = Vn;
      const tr = function () {};
      function nr(e, t, n) {
        const r = {};
        e || (e = {}),
          n || (n = {}),
          (r._SymbolsMap = {}),
          (r.textformatting = 1),
          (r.infinity = 1),
          (r.pi = 1);
        for (const e in t) r[e] = 1;
        for (const e in n) r[e] = 1;
        for (const t in e) r[t] = 1;
        return r;
      }
      function rr(e, t) {
        const n = {
          mode: t,
          compiled: !0,
          functions: {},
          signatures: [],
          failDefferred: Ln,
          standardFunction: Un,
          standardFunctionAsync: Un,
          evaluateIdentifier: ir,
        };
        for (let t = 0; t < e.length; t++) e[t].registerFunctions(n);
        if ('sync' === t) {
          for (const e in n.functions) (Vn[e] = new I(n.functions[e])), (er.prototype[e] = Vn[e]);
          for (let e = 0; e < n.signatures.length; e++) tt(n.signatures[e], 'sync');
        } else {
          for (const e in n.functions) (Qn[e] = new I(n.functions[e])), (tr.prototype[e] = Qn[e]);
          for (let e = 0; e < n.signatures.length; e++) tt(n.signatures[e], 'async');
        }
      }
      function ir(e, t) {
        const n = t.name;
        if ('_SymbolsMap' === n) throw 'Illegal';
        if (e.localStack.length > 0) {
          if (
            '_t' !== n.substr(0, 2).toLowerCase() &&
            void 0 !== e.localStack[e.localStack.length - 1][n]
          )
            return e.localStack[e.localStack.length - 1][n];
          const t = e.mangleMap[n];
          if (void 0 !== t && void 0 !== e.localStack[e.localStack.length - 1][t])
            return e.localStack[e.localStack.length - 1][t];
        }
        if ('_t' !== n.substr(0, 2).toLowerCase() && void 0 !== e.globalScope[n])
          return e.globalScope[n];
        if (1 === e.globalScope._SymbolsMap[n]) return e.globalScope[n];
        const r = e.mangleMap[n];
        return void 0 !== r ? e.globalScope[r] : void 0;
      }
      tr.prototype = Qn;
      let sr = 0;
      const or = {
        error(e, t, n) {
          throw new Error(mt(e, t, n));
        },
        __awaiter: (e, t, n, r) =>
          (0, i.Ue)((n, i) => {
            function s(e) {
              try {
                a(r.next(e));
              } catch (e) {
                i(e);
              }
            }
            function o(e) {
              try {
                a(r.throw(e));
              } catch (e) {
                i(e);
              }
            }
            function a(e) {
              e.done
                ? n(e.value)
                : e.value && e.value.then
                ? e.value.then(s, o)
                : (sr++,
                  sr % 100 == 0
                    ? setTimeout(() => {
                        (sr = 0), s(e.value);
                      }, 0)
                    : s(e.value));
            }
            a((r = r.apply(e, t || [])).next());
          }),
        functionDepthchecker: (e, t) =>
          function () {
            if ((t.depthCounter++, t.localStack.push([]), t.depthCounter > 64))
              throw new Error('Exceeded maximum function depth');
            const n = e.apply(this, arguments);
            return (0, i.y8)(n)
              ? n.then(
                  (e) => (t.depthCounter--, (t.localStack.length = t.localStack.length - 1), e),
                )
              : (t.depthCounter--, (t.localStack.length = t.localStack.length - 1), n);
          },
        castString: (e) => ne(e),
        aCheck(e, t) {
          if (M(e)) throw new Error(mt({ type: t }, 'RUNTIME', 'FUNCTIONCONTEXTILLEGAL'));
          return e === _ ? null : e;
        },
        Dictionary: _e,
        Feature: Ke,
        dictionary(e) {
          const t = {};
          for (let n = 0; n < e.length; n += 2) {
            if (M(e[n + 1])) throw new Error('Illegal Argument');
            if (!1 === L(e[n])) throw new Error('Illegal Argument');
            e[n + 1] === _ ? (t[e[n].toString()] = null) : (t[e[n].toString()] = e[n + 1]);
          }
          const n = new _e(t);
          return (n.immutable = !1), n;
        },
        strCheck(e) {
          if (!1 === L(e)) throw new Error('Illegal Argument');
          return e;
        },
        unary(e, t) {
          if (G(e)) {
            if ('!' === t) return !e;
            if ('-' === t) return -1 * oe(e);
            if ('+' === t) return 1 * oe(e);
            if ('~' === t) return ~oe(e);
            throw new Error(
              mt(
                { type: 'UnaryExpression', operator: t, prefix: null, argument: null },
                'RUNTIME',
                'NOTSUPPORTEDUNARYOPERATOR',
              ),
            );
          }
          if ('-' === t) return -1 * oe(e);
          if ('+' === t) return 1 * oe(e);
          if ('~' === t) return ~oe(e);
          throw new Error(
            mt(
              { type: 'UnaryExpression', operator: t, prefix: null, argument: null },
              'RUNTIME',
              'NOTSUPPORTEDUNARYOPERATOR',
            ),
          );
        },
        logicalCheck(e) {
          if (!1 === G(e))
            throw new Error(
              mt(
                { type: 'LogicalExpression', operator: null, left: null, right: null },
                'RUNTIME',
                'ONLYORORAND',
              ),
            );
          return e;
        },
        logical(e, t, n) {
          if (G(e) && G(t))
            switch (n) {
              case '||':
                return e || t;
              case '&&':
                return e && t;
              default:
                throw new Error(
                  mt(
                    { type: 'LogicalExpression', operator: null, left: null, right: null },
                    'RUNTIME',
                    'ONLYORORAND',
                  ),
                );
            }
          throw new Error(
            mt(
              { type: 'LogicalExpression', operator: null, left: null, right: null },
              'RUNTIME',
              'ONLYORORAND',
            ),
          );
        },
        binary(e, t, n) {
          switch (n) {
            case '|':
            case '<<':
            case '>>':
            case '>>>':
            case '^':
            case '&':
              return Ne(oe(e), oe(t), n);
            case '==':
            case '=':
              return te(e, t);
            case '!=':
              return !te(e, t);
            case '<':
            case '>':
            case '<=':
            case '>=':
              return ee(e, t, n);
            case '+':
              return L(e) || L(t) ? ne(e) + ne(t) : oe(e) + oe(t);
            case '-':
              return oe(e) - oe(t);
            case '*':
              return oe(e) * oe(t);
            case '/':
              return oe(e) / oe(t);
            case '%':
              return oe(e) % oe(t);
            default:
              throw new Error(
                mt(
                  { type: 'BinaryExpression', operator: n, left: e, right: t },
                  'RUNTIME',
                  'OPERATORNOTRECOGNISED',
                ),
              );
          }
        },
        assign(e, t, n) {
          switch (t) {
            case '=':
              return e === _ ? null : e;
            case '/=':
              return oe(n) / oe(e);
            case '*=':
              return oe(n) * oe(e);
            case '-=':
              return oe(n) - oe(e);
            case '+=':
              return L(n) || L(e) ? ne(n) + ne(e) : oe(n) + oe(e);
            case '%=':
              return oe(n) % oe(e);
            default:
              throw new Error(
                mt(
                  { type: 'AssignmentExpression', operator: t, left: null, right: null },
                  'RUNTIME',
                  'OPERATORNOTRECOGNISED',
                ),
              );
          }
        },
        update(e, t, n, r) {
          const i = oe(e[t]);
          return (e[t] = '++' === n ? i + 1 : i - 1), !1 === r ? i : '++' === n ? i + 1 : i - 1;
        },
        graphicToFeature: (e, t) =>
          null === e ? null : Ke.createFromGraphicLikeObject(e.geometry, e.attributes, t),
        memberupdate(e, t, n, r) {
          let i;
          if (j(e)) {
            if (!Z(t)) throw new Error('Invalid Parameter');
            if ((t < 0 && (t = e.length + t), t < 0 || t >= e.length))
              throw new Error('Assignment outside of array bounds');
            (i = oe(e[t])), (e[t] = '++' === n ? i + 1 : i - 1);
          } else if (e instanceof _e) {
            if (!1 === L(t)) throw new Error('Dictionary accessor must be a string');
            if (!0 !== e.hasField(t)) throw new Error('Invalid Parameter');
            (i = oe(e.field(t))), e.setField(t, '++' === n ? i + 1 : i - 1);
          } else {
            if (!(e instanceof Ke))
              throw q(e) ? new Error('Array is Immutable') : new Error('Invalid Parameter');
            if (!1 === L(t)) throw new Error('Feature accessor must be a string');
            if (!0 !== e.hasField(t)) throw new Error('Invalid Parameter');
            (i = oe(e.field(t))), e.setField(t, '++' === n ? i + 1 : i - 1);
          }
          return !1 === r ? i : '++' === n ? i + 1 : i - 1;
        },
        assignmember(e, t, n, r) {
          if (j(e)) {
            if (!Z(t)) throw new Error('Invalid Parameter');
            if ((t < 0 && (t = e.length + t), t < 0 || t > e.length))
              throw new Error('Assignment outside of array bounds');
            if (t === e.length) {
              if ('=' !== n) throw new Error('Invalid Parameter');
              e[t] = this.assign(r, n, e[t]);
            } else e[t] = this.assign(r, n, e[t]);
          } else if (e instanceof _e) {
            if (!1 === L(t)) throw new Error('Dictionary accessor must be a string');
            if (!0 === e.hasField(t)) e.setField(t, this.assign(r, n, e.field(t)));
            else {
              if ('=' !== n) throw new Error('Invalid Parameter');
              e.setField(t, this.assign(r, n, null));
            }
          } else {
            if (!(e instanceof Ke))
              throw q(e) ? new Error('Array is Immutable') : new Error('Invalid Parameter');
            if (!1 === L(t)) throw new Error('Feature accessor must be a string');
            if (!0 === e.hasField(t)) e.setField(t, this.assign(r, n, e.field(t)));
            else {
              if ('=' !== n) throw new Error('Invalid Parameter');
              e.setField(t, this.assign(r, n, null));
            }
          }
        },
        member(e, t) {
          if (null === e)
            throw new Error(
              mt(
                { type: 'MemberExpression', object: null, property: null, computed: null },
                'RUNTIME',
                'NOTFOUND',
              ),
            );
          if (e instanceof D.F) {
            if (L(t)) return e.field(t);
            throw new Error(
              mt(
                { type: 'MemberExpression', object: null, property: null, computed: null },
                'RUNTIME',
                'INVALIDTYPE',
              ),
            );
          }
          if (e instanceof _e || e instanceof Ke) {
            if (L(t)) return e.field(t);
            throw new Error(
              mt(
                { type: 'MemberExpression', object: null, property: null, computed: null },
                'RUNTIME',
                'INVALIDTYPE',
              ),
            );
          }
          if (e instanceof o.Z) {
            if (L(t))
              return (function (e, t, n) {
                let r;
                switch ((t = t.toLowerCase())) {
                  case 'hasz': {
                    const t = e.hasZ;
                    return void 0 !== t && t;
                  }
                  case 'hasm': {
                    const t = e.hasM;
                    return void 0 !== t && t;
                  }
                  case 'spatialreference': {
                    let t = e.spatialReference._arcadeCacheId;
                    if (void 0 === t) {
                      let n = !0;
                      Object.freeze && Object.isFrozen(e.spatialReference) && (n = !1),
                        n && (jn++, (e.spatialReference._arcadeCacheId = jn), (t = jn));
                    }
                    const n = new _e({
                      wkt: e.spatialReference.wkt,
                      wkid: e.spatialReference.wkid,
                    });
                    return void 0 !== t && (n._arcadeCacheId = 'SPREF' + t.toString()), n;
                  }
                }
                switch (e.type) {
                  case 'extent':
                    switch (t) {
                      case 'xmin':
                      case 'xmax':
                      case 'ymin':
                      case 'ymax':
                      case 'zmin':
                      case 'zmax':
                      case 'mmin':
                      case 'mmax': {
                        const n = e[t];
                        return void 0 !== n ? n : null;
                      }
                      case 'type':
                        return 'Extent';
                    }
                    break;
                  case 'polygon':
                    switch (t) {
                      case 'rings':
                        return (
                          (r = e.cache._arcadeCacheId),
                          void 0 === r && (jn++, (r = jn), (e.cache._arcadeCacheId = r)),
                          new C(e.rings, e.spatialReference, !0 === e.hasZ, !0 === e.hasM, r)
                        );
                      case 'type':
                        return 'Polygon';
                    }
                    break;
                  case 'point':
                    switch (t) {
                      case 'x':
                      case 'y':
                      case 'z':
                      case 'm':
                        return void 0 !== e[t] ? e[t] : null;
                      case 'type':
                        return 'Point';
                    }
                    break;
                  case 'polyline':
                    switch (t) {
                      case 'paths':
                        return (
                          (r = e.cache._arcadeCacheId),
                          void 0 === r && (jn++, (r = jn), (e.cache._arcadeCacheId = r)),
                          new C(e.paths, e.spatialReference, !0 === e.hasZ, !0 === e.hasM, r)
                        );
                      case 'type':
                        return 'Polyline';
                    }
                    break;
                  case 'multipoint':
                    switch (t) {
                      case 'points':
                        return (
                          (r = e.cache._arcadeCacheId),
                          void 0 === r && (jn++, (r = jn), (e.cache._arcadeCacheId = r)),
                          new w(e.points, e.spatialReference, !0 === e.hasZ, !0 === e.hasM, r, 1)
                        );
                      case 'type':
                        return 'Multipoint';
                    }
                }
                throw new Error(mt('MemberExpression', 'RUNTIME', 'PROPERTYNOTFOUND'));
              })(e, t);
            throw new Error(
              mt(
                { type: 'MemberExpression', object: null, property: null, computed: null },
                'RUNTIME',
                'INVALIDTYPE',
              ),
            );
          }
          if (j(e)) {
            if (Z(t) && isFinite(t) && Math.floor(t) === t) {
              if ((t < 0 && (t = e.length + t), t >= e.length || t < 0))
                throw new Error(
                  mt(
                    { type: 'MemberExpression', object: null, property: null, computed: null },
                    'RUNTIME',
                    'OUTOFBOUNDS',
                  ),
                );
              return e[t];
            }
            throw new Error(
              mt(
                { type: 'MemberExpression', object: null, property: null, computed: null },
                'RUNTIME',
                'INVALIDTYPE',
              ),
            );
          }
          if (L(e)) {
            if (Z(t) && isFinite(t) && Math.floor(t) === t) {
              if ((t < 0 && (t = e.length + t), t >= e.length || t < 0))
                throw new Error(
                  mt(
                    { type: 'MemberExpression', object: null, property: null, computed: null },
                    'RUNTIME',
                    'OUTOFBOUNDS',
                  ),
                );
              return e[t];
            }
            throw new Error(
              mt(
                { type: 'MemberExpression', object: null, property: null, computed: null },
                'RUNTIME',
                'INVALIDTYPE',
              ),
            );
          }
          if (q(e)) {
            if (Z(t) && isFinite(t) && Math.floor(t) === t) {
              if ((t < 0 && (t = e.length() + t), t >= e.length() || t < 0))
                throw new Error(
                  mt(
                    { type: 'MemberExpression', object: null, property: null, computed: null },
                    'RUNTIME',
                    'OUTOFBOUNDS',
                  ),
                );
              return e.get(t);
            }
            throw new Error(
              mt(
                { type: 'MemberExpression', object: null, property: null, computed: null },
                'RUNTIME',
                'INVALIDTYPE',
              ),
            );
          }
          throw new Error(
            mt(
              { type: 'MemberExpression', object: null, property: null, computed: null },
              'RUNTIME',
              'INVALIDTYPE',
            ),
          );
        },
        callfunc(e, t, n) {
          return e instanceof I
            ? e.fn(n, t)
            : e instanceof k
            ? e.fn.apply(this, t)
            : e.apply(this, t);
        },
      };
      function ar(e) {
        console.log(e);
      }
      function ur(e, t = null, n = !1) {
        null === t && (t = { vars: {}, customfunctions: {} });
        const r = {
          isAsync: n,
          globalScope: nr(t.vars, n ? Qn : Vn, t.customfunctions),
          localScope: null,
          mangleMap: {},
          console: ar,
          lrucache: t.lrucache,
          interceptor: t.interceptor,
          services: t.services,
          symbols: { symbolCounter: 0 },
        };
        let i = Gn(r, e.body[0].body);
        '' === i && (i = 'lc.voidOperation; ');
        let s = '';
        s = n
          ? 'var runtimeCtx=this.prepare(context, true);\n var lc = this.lc;  var lang = this.lang; var gscope=runtimeCtx.globalScope; \nreturn lang.__awaiter(this, void 0, void 0, function* () {\n\n function mainBody() {\n var lastStatement=lc.voidOperation;\n return lang.__awaiter(this, void 0, void 0, function* () {\n' +
            i +
            '\n return lastStatement; }); } \n return this.postProcess(yield mainBody()); }); '
          : 'var runtimeCtx=this.prepare(context, false);\n var lc = this.lc;  var lang = this.lang; var gscope=runtimeCtx.globalScope; \n function mainBody() {\n var lastStatement=lc.voidOperation;\n ' +
            i +
            '\n return lastStatement; } \n return this.postProcess(mainBody()); ';
        const o = {
          lc: ve,
          lang: or,
          mangles: r.mangleMap,
          postProcess(e) {
            if (
              (e instanceof v && (e = e.value),
              e instanceof T && (e = e.value),
              e === _ && (e = null),
              e === O)
            )
              throw new Error('Cannot return BREAK');
            if (e === B) throw new Error('Cannot return CONTINUE');
            if (M(e)) throw new Error('Cannot return FUNCTION');
            return e;
          },
          prepare(e, t) {
            let n = e.spatialReference;
            null == n && (n = new g.Z({ wkid: 102100 }));
            const r = (function (e, t, n) {
              const r = n ? new tr() : new er();
              e || (e = {}), t || (t = {});
              const i = new _e({
                newline: '\n',
                tab: '\t',
                singlequote: "'",
                doublequote: '"',
                forwardslash: '/',
                backwardslash: '\\',
              });
              (i.immutable = !1),
                (r._SymbolsMap = { textformatting: 1, infinity: 1, pi: 1 }),
                (r.textformatting = i),
                (r.infinity = Number.POSITIVE_INFINITY),
                (r.pi = Math.PI);
              for (const e in t) (r[e] = t[e]), (r._SymbolsMap[e] = 1);
              for (const t in e)
                (r._SymbolsMap[t] = 1),
                  e[t] && 'esri.Graphic' === e[t].declaredClass
                    ? (r[t] = Ke.createFromGraphic(e[t]))
                    : (r[t] = e[t]);
              return r;
            })(e.vars, e.customfunctions, t);
            return {
              localStack: [],
              isAsync: t,
              mangleMap: this.mangles,
              spatialReference: n,
              globalScope: r,
              abortSignal:
                void 0 === e.abortSignal || null === e.abortSignal
                  ? { aborted: !1 }
                  : e.abortSignal,
              localScope: null,
              services: e.services,
              console: e.console ? e.console : ar,
              lrucache: e.lrucache,
              interceptor: e.interceptor,
              symbols: { symbolCounter: 0 },
              depthCounter: 1,
            };
          },
        };
        return new Function('context', 'spatialReference', s).bind(o);
      }
      function lr(e, t, n) {
        try {
          return n(
            e,
            t,
            (function (e, t) {
              const n = [];
              for (let r = 0; r < t.arguments.length; r++) n.push(cr(e, t.arguments[r]));
              return n;
            })(e, t),
          );
        } catch (e) {
          throw e;
        }
      }
      function cr(e, t) {
        try {
          switch (t.type) {
            case 'EmptyStatement':
              return _;
            case 'VariableDeclarator':
              return (function (e, t) {
                let n = null === t.init ? null : cr(e, t.init);
                if ((n === _ && (n = null), 'Identifier' !== t.id.type))
                  throw new Error('Can only assign a regular variable');
                const r = t.id.name.toLowerCase();
                return (
                  null !== e.localScope
                    ? (e.localScope[r] = { value: n, valueset: !0, node: t.init })
                    : (e.globalScope[r] = { value: n, valueset: !0, node: t.init }),
                  _
                );
              })(e, t);
            case 'VariableDeclaration':
              return (function (e, t) {
                for (let n = 0; n < t.declarations.length; n++) cr(e, t.declarations[n]);
                return _;
              })(e, t);
            case 'BlockStatement':
              return (function (e, t) {
                let n = _;
                for (let r = 0; r < t.body.length; r++)
                  if (((n = cr(e, t.body[r])), n instanceof v || n === O || n === B)) return n;
                return n;
              })(e, t);
            case 'FunctionDeclaration':
              return (function (e, t) {
                const n = t.id.name.toLowerCase();
                return (e.globalScope[n] = { valueset: !0, node: null, value: new A(t, e) }), _;
              })(e, t);
            case 'ReturnStatement':
              return (function (e, t) {
                if (null === t.argument) return new v(_);
                const n = cr(e, t.argument);
                return new v(n);
              })(e, t);
            case 'IfStatement':
              return (function (e, t) {
                if ('AssignmentExpression' === t.test.type || 'UpdateExpression' === t.test.type)
                  throw new Error(mt(t.test, 'RUNTIME', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION'));
                const n = cr(e, t.test);
                if (!0 === n) return cr(e, t.consequent);
                if (!1 === n) return null !== t.alternate ? cr(e, t.alternate) : _;
                throw new Error(mt(t, 'RUNTIME', 'CANNOT_USE_NONBOOLEAN_IN_CONDITION'));
              })(e, t);
            case 'ExpressionStatement':
              return (function (e, t) {
                if (
                  'AssignmentExpression' === t.expression.type ||
                  'UpdateExpression' === t.expression.type
                )
                  return cr(e, t.expression);
                if ('CallExpression' === t.expression.type) {
                  const n = cr(e, t.expression);
                  return n === _ ? _ : new T(n);
                }
                {
                  const n = cr(e, t.expression);
                  return n === _ ? _ : new T(n);
                }
              })(e, t);
            case 'AssignmentExpression':
              return (function (e, t) {
                const n = cr(e, t.right);
                let r = null,
                  i = '';
                if ('MemberExpression' === t.left.type) {
                  if (
                    ((r = cr(e, t.left.object)),
                    !0 === t.left.computed
                      ? (i = cr(e, t.left.property))
                      : 'Identifier' === t.left.property.type && (i = t.left.property.name),
                    j(r))
                  ) {
                    if (!Z(i)) throw new Error('Invalid Parameter');
                    if ((i < 0 && (i = r.length + i), i < 0 || i > r.length))
                      throw new Error('Assignment outside of array bounds');
                    if (i === r.length) {
                      if ('=' !== t.operator) throw new Error('Invalid Parameter');
                      r[i] = fr(n, t.operator, r[i], t);
                    } else r[i] = fr(n, t.operator, r[i], t);
                  } else if (r instanceof _e) {
                    if (!1 === L(i)) throw new Error('Dictionary accessor must be a string');
                    if (!0 === r.hasField(i)) r.setField(i, fr(n, t.operator, r.field(i), t));
                    else {
                      if ('=' !== t.operator) throw new Error('Invalid Parameter');
                      r.setField(i, fr(n, t.operator, null, t));
                    }
                  } else {
                    if (!(r instanceof Ke))
                      throw q(r) ? new Error('Array is Immutable') : new Error('Invalid Parameter');
                    if (!1 === L(i)) throw new Error('Feature accessor must be a string');
                    if (!0 === r.hasField(i)) r.setField(i, fr(n, t.operator, r.field(i), t));
                    else {
                      if ('=' !== t.operator) throw new Error('Invalid Parameter');
                      r.setField(i, fr(n, t.operator, null, t));
                    }
                  }
                  return _;
                }
                if (
                  ((r = t.left.name.toLowerCase()),
                  null !== e.localScope && void 0 !== e.localScope[r])
                )
                  return (
                    (e.localScope[r] = {
                      value: fr(n, t.operator, e.localScope[r].value, t),
                      valueset: !0,
                      node: t.right,
                    }),
                    _
                  );
                if (void 0 !== e.globalScope[r])
                  return (
                    (e.globalScope[r] = {
                      value: fr(n, t.operator, e.globalScope[r].value, t),
                      valueset: !0,
                      node: t.right,
                    }),
                    _
                  );
                throw new Error('Variable not recognised');
              })(e, t);
            case 'UpdateExpression':
              return (function (e, t) {
                let n,
                  r = null,
                  i = '';
                if ('MemberExpression' === t.argument.type) {
                  if (
                    ((r = cr(e, t.argument.object)),
                    !0 === t.argument.computed
                      ? (i = cr(e, t.argument.property))
                      : 'Identifier' === t.argument.property.type && (i = t.argument.property.name),
                    j(r))
                  ) {
                    if (!Z(i)) throw new Error('Invalid Parameter');
                    if ((i < 0 && (i = r.length + i), i < 0 || i >= r.length))
                      throw new Error('Assignment outside of array bounds');
                    (n = oe(r[i])), (r[i] = '++' === t.operator ? n + 1 : n - 1);
                  } else if (r instanceof _e) {
                    if (!1 === L(i)) throw new Error('Dictionary accessor must be a string');
                    if (!0 !== r.hasField(i)) throw new Error('Invalid Parameter');
                    (n = oe(r.field(i))), r.setField(i, '++' === t.operator ? n + 1 : n - 1);
                  } else {
                    if (!(r instanceof Ke))
                      throw q(r) ? new Error('Array is Immutable') : new Error('Invalid Parameter');
                    if (!1 === L(i)) throw new Error('Feature accessor must be a string');
                    if (!0 !== r.hasField(i)) throw new Error('Invalid Parameter');
                    (n = oe(r.field(i))), r.setField(i, '++' === t.operator ? n + 1 : n - 1);
                  }
                  return !1 === t.prefix ? n : '++' === t.operator ? n + 1 : n - 1;
                }
                if (
                  ((r = 'Identifier' === t.argument.type ? t.argument.name.toLowerCase() : ''), !r)
                )
                  throw new Error('Invalid identifier');
                if (null !== e.localScope && void 0 !== e.localScope[r])
                  return (
                    (n = oe(e.localScope[r].value)),
                    (e.localScope[r] = {
                      value: '++' === t.operator ? n + 1 : n - 1,
                      valueset: !0,
                      node: t,
                    }),
                    !1 === t.prefix ? n : '++' === t.operator ? n + 1 : n - 1
                  );
                if (void 0 !== e.globalScope[r])
                  return (
                    (n = oe(e.globalScope[r].value)),
                    (e.globalScope[r] = {
                      value: '++' === t.operator ? n + 1 : n - 1,
                      valueset: !0,
                      node: t,
                    }),
                    !1 === t.prefix ? n : '++' === t.operator ? n + 1 : n - 1
                  );
                throw new Error('Variable not recognised');
              })(e, t);
            case 'BreakStatement':
              return O;
            case 'ContinueStatement':
              return B;
            case 'TemplateElement':
              return (function (e, t) {
                return t.value ? t.value.cooked : '';
              })(0, t);
            case 'TemplateLiteral':
              return (function (e, t) {
                let n = '',
                  r = 0;
                for (const i of t.quasis)
                  (n += i.value ? i.value.cooked : ''),
                    !1 === i.tail &&
                      ((n += t.expressions[r] ? ne(cr(e, t.expressions[r])) : ''), r++);
                return n;
              })(e, t);
            case 'ForStatement':
              return (function (e, t) {
                null !== t.init && cr(e, t.init);
                const n = { testResult: !0, lastAction: _ };
                do {
                  hr(e, t, n);
                } while (!0 === n.testResult);
                return n.lastAction instanceof v ? n.lastAction : _;
              })(e, t);
            case 'ForInStatement':
              return (function (e, t) {
                const n = cr(e, t.right);
                'VariableDeclaration' === t.left.type && cr(e, t.left);
                let r = null,
                  i = '';
                if ('VariableDeclaration' === t.left.type) {
                  const e = t.left.declarations[0].id;
                  'Identifier' === e.type && (i = e.name);
                } else 'Identifier' === t.left.type && (i = t.left.name);
                if (!i) throw new Error(mt(t, 'RUNTIME', 'INVALIDVARIABLE'));
                if (
                  ((i = i.toLowerCase()),
                  null !== e.localScope && void 0 !== e.localScope[i] && (r = e.localScope[i]),
                  null === r && void 0 !== e.globalScope[i] && (r = e.globalScope[i]),
                  null === r)
                )
                  throw new Error(mt(t, 'RUNTIME', 'VARIABLENOTDECLARED'));
                if (j(n) || L(n)) {
                  const i = n.length;
                  for (let n = 0; n < i; n++) {
                    r.value = n;
                    const i = cr(e, t.body);
                    if (i === O) break;
                    if (i instanceof v) return i;
                  }
                  return _;
                }
                if (q(n)) {
                  for (let i = 0; i < n.length(); i++) {
                    r.value = i;
                    const n = cr(e, t.body);
                    if (n === O) break;
                    if (n instanceof v) return n;
                  }
                  return _;
                }
                if (!(n instanceof _e || n instanceof Ke)) return _;
                {
                  const i = n.keys();
                  for (let n = 0; n < i.length; n++) {
                    r.value = i[n];
                    const s = cr(e, t.body);
                    if (s === O) break;
                    if (s instanceof v) return s;
                  }
                }
              })(e, t);
            case 'Identifier':
              return mr(e, t);
            case 'MemberExpression':
              return (function (e, t) {
                try {
                  const n = cr(e, t.object);
                  if (null === n) throw new Error(mt(t, 'RUNTIME', 'NOTFOUND'));
                  if (!1 === t.computed) {
                    if ('Identifier' === t.property.type) {
                      if (n instanceof _e || n instanceof Ke) return n.field(t.property.name);
                      if (n instanceof o.Z) return pr(n, t.property.name, t);
                    }
                    throw new Error(mt(t, 'RUNTIME', 'INVALIDTYPE'));
                  }
                  {
                    let r = cr(e, t.property);
                    if (n instanceof _e || n instanceof Ke) {
                      if (L(r)) return n.field(r);
                      throw new Error(mt(t, 'RUNTIME', 'INVALIDTYPE'));
                    }
                    if (n instanceof o.Z) {
                      if (L(r)) return pr(n, r, t);
                      throw new Error(mt(t, 'RUNTIME', 'INVALIDTYPE'));
                    }
                    if (j(n)) {
                      if (Z(r) && isFinite(r) && Math.floor(r) === r) {
                        if ((r < 0 && (r = n.length + r), r >= n.length || r < 0))
                          throw new Error(mt(t, 'RUNTIME', 'OUTOFBOUNDS'));
                        return n[r];
                      }
                      throw new Error(mt(t, 'RUNTIME', 'INVALIDTYPE'));
                    }
                    if (L(n)) {
                      if (Z(r) && isFinite(r) && Math.floor(r) === r) {
                        if ((r < 0 && (r = n.length + r), r >= n.length || r < 0))
                          throw new Error(mt(t, 'RUNTIME', 'OUTOFBOUNDS'));
                        return n[r];
                      }
                      throw new Error(mt(t, 'RUNTIME', 'INVALIDTYPE'));
                    }
                    if (q(n)) {
                      if (Z(r) && isFinite(r) && Math.floor(r) === r) {
                        if ((r < 0 && (r = n.length() + r), r >= n.length() || r < 0))
                          throw new Error(mt(t, 'RUNTIME', 'OUTOFBOUNDS'));
                        return n.get(r);
                      }
                      throw new Error(mt(t, 'RUNTIME', 'INVALIDTYPE'));
                    }
                    throw new Error(mt(t, 'RUNTIME', 'INVALIDTYPE'));
                  }
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'Literal':
              return t.value;
            case 'CallExpression':
              return (function (e, t) {
                try {
                  if ('Identifier' !== t.callee.type)
                    throw new Error(mt(t, 'RUNTIME', 'ONLYNODESSUPPORTED'));
                  if (
                    null !== e.localScope &&
                    void 0 !== e.localScope[t.callee.name.toLowerCase()]
                  ) {
                    const n = e.localScope[t.callee.name.toLowerCase()];
                    if (n.value instanceof I) return n.value.fn(e, t);
                    if (n.value instanceof A) return wr(e, t, n.value.definition);
                    throw new Error(mt(t, 'RUNTIME', 'NOTAFUNCTION'));
                  }
                  if (void 0 !== e.globalScope[t.callee.name.toLowerCase()]) {
                    const n = e.globalScope[t.callee.name.toLowerCase()];
                    if (n.value instanceof I) return n.value.fn(e, t);
                    if (n.value instanceof A) return wr(e, t, n.value.definition);
                    throw new Error(mt(t, 'RUNTIME', 'NOTAFUNCTION'));
                  }
                  throw new Error(mt(t, 'RUNTIME', 'NOTFOUND'));
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'UnaryExpression':
              return (function (e, t) {
                try {
                  const n = cr(e, t.argument);
                  if (G(n)) {
                    if ('!' === t.operator) return !n;
                    if ('-' === t.operator) return -1 * oe(n);
                    if ('+' === t.operator) return 1 * oe(n);
                    if ('~' === t.operator) return ~oe(n);
                    throw new Error(mt(t, 'RUNTIME', 'NOTSUPPORTEDUNARYOPERATOR'));
                  }
                  if ('~' === t.operator) return ~oe(n);
                  if ('-' === t.operator) return -1 * oe(n);
                  if ('+' === t.operator) return 1 * oe(n);
                  throw new Error(mt(t, 'RUNTIME', 'NOTSUPPORTEDUNARYOPERATOR'));
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'BinaryExpression':
              return (function (e, t) {
                try {
                  const n = [cr(e, t.left), cr(e, t.right)],
                    r = n[0],
                    i = n[1];
                  switch (t.operator) {
                    case '|':
                    case '<<':
                    case '>>':
                    case '>>>':
                    case '^':
                    case '&':
                      return Ne(oe(r), oe(i), t.operator);
                    case '==':
                      return te(r, i);
                    case '!=':
                      return !te(r, i);
                    case '<':
                    case '>':
                    case '<=':
                    case '>=':
                      return ee(r, i, t.operator);
                    case '+':
                      return L(r) || L(i) ? ne(r) + ne(i) : oe(r) + oe(i);
                    case '-':
                      return oe(r) - oe(i);
                    case '*':
                      return oe(r) * oe(i);
                    case '/':
                      return oe(r) / oe(i);
                    case '%':
                      return oe(r) % oe(i);
                    default:
                      throw new Error(mt(t, 'RUNTIME', 'OPERATORNOTRECOGNISED'));
                  }
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'LogicalExpression':
              return (function (e, t) {
                try {
                  if ('AssignmentExpression' === t.left.type || 'UpdateExpression' === t.left.type)
                    throw new Error(mt(t.left, 'RUNTIME', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION'));
                  if (
                    'AssignmentExpression' === t.right.type ||
                    'UpdateExpression' === t.right.type
                  )
                    throw new Error(mt(t.right, 'RUNTIME', 'CANNOT_USE_ASSIGNMENT_IN_CONDITION'));
                  const n = cr(e, t.left);
                  if (G(n))
                    switch (t.operator) {
                      case '||':
                        if (!0 === n) return n;
                        {
                          const n = cr(e, t.right);
                          if (G(n)) return n;
                          throw new Error(mt(t, 'RUNTIME', 'ONLYORORAND'));
                        }
                      case '&&':
                        if (!1 === n) return n;
                        {
                          const n = cr(e, t.right);
                          if (G(n)) return n;
                          throw new Error(mt(t, 'RUNTIME', 'ONLYORORAND'));
                        }
                      default:
                        throw new Error(mt(t, 'RUNTIME', 'ONLYORORAND'));
                    }
                  throw new Error(mt(t, 'RUNTIME', 'ONLYBOOLEAN'));
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'ConditionalExpression':
              throw new Error(mt(t, 'RUNTIME', 'NOTSUPPORTED'));
            case 'ArrayExpression':
              return (function (e, t) {
                try {
                  const n = [];
                  for (let r = 0; r < t.elements.length; r++) {
                    const i = cr(e, t.elements[r]);
                    if (M(i)) throw new Error(mt(t, 'RUNTIME', 'FUNCTIONCONTEXTILLEGAL'));
                    i === _ ? n.push(null) : n.push(i);
                  }
                  return n;
                } catch (e) {
                  throw e;
                }
              })(e, t);
            case 'ObjectExpression':
              return (function (e, t) {
                const n = {};
                for (let r = 0; r < t.properties.length; r++) {
                  const i = cr(e, t.properties[r]);
                  if (M(i.value)) throw new Error('Illegal Argument');
                  if (!1 === L(i.key)) throw new Error('Illegal Argument');
                  i.value === _ ? (n[i.key.toString()] = null) : (n[i.key.toString()] = i.value);
                }
                const r = new _e(n);
                return (r.immutable = !1), r;
              })(e, t);
            case 'Property':
              return (function (e, t) {
                return {
                  key: 'Identifier' === t.key.type ? t.key.name : cr(e, t.key),
                  value: cr(e, t.value),
                };
              })(e, t);
            default:
              throw new Error(mt(t, 'RUNTIME', 'UNREOGNISED'));
          }
        } catch (e) {
          throw e;
        }
      }
      function hr(e, t, n) {
        if (null !== t.test) {
          if (((n.testResult = cr(e, t.test)), !1 === n.testResult)) return;
          if (!0 !== n.testResult)
            throw new Error(mt(t, 'RUNTIME', 'CANNOT_USE_NONBOOLEAN_IN_CONDITION'));
        }
        (n.lastAction = cr(e, t.body)),
          n.lastAction !== O
            ? n.lastAction instanceof v
              ? (n.testResult = !1)
              : null !== t.update && cr(e, t.update)
            : (n.testResult = !1);
      }
      function fr(e, t, n, r) {
        switch (t) {
          case '=':
            return e === _ ? null : e;
          case '/=':
            return oe(n) / oe(e);
          case '*=':
            return oe(n) * oe(e);
          case '-=':
            return oe(n) - oe(e);
          case '+=':
            return L(n) || L(e) ? ne(n) + ne(e) : oe(n) + oe(e);
          case '%=':
            return oe(n) % oe(e);
          default:
            throw new Error(mt(r, 'RUNTIME', 'OPERATORNOTRECOGNISED'));
        }
      }
      let dr = 0;
      function pr(e, t, n) {
        let r;
        switch ((t = t.toLowerCase())) {
          case 'hasz': {
            const t = e.hasZ;
            return void 0 !== t && t;
          }
          case 'hasm': {
            const t = e.hasM;
            return void 0 !== t && t;
          }
          case 'spatialreference': {
            let t = e.spatialReference._arcadeCacheId;
            if (void 0 === t) {
              let n = !0;
              Object.freeze && Object.isFrozen(e.spatialReference) && (n = !1),
                n && (dr++, (e.spatialReference._arcadeCacheId = dr), (t = dr));
            }
            const n = new _e({ wkt: e.spatialReference.wkt, wkid: e.spatialReference.wkid });
            return void 0 !== t && (n._arcadeCacheId = 'SPREF' + t.toString()), n;
          }
        }
        switch (e.type) {
          case 'extent':
            switch (t) {
              case 'xmin':
              case 'xmax':
              case 'ymin':
              case 'ymax':
              case 'zmin':
              case 'zmax':
              case 'mmin':
              case 'mmax': {
                const n = e[t];
                return void 0 !== n ? n : null;
              }
              case 'type':
                return 'Extent';
            }
            break;
          case 'polygon':
            switch (t) {
              case 'rings':
                return (
                  (r = e.cache._arcadeCacheId),
                  void 0 === r && (dr++, (r = dr), (e.cache._arcadeCacheId = r)),
                  new C(e.rings, e.spatialReference, !0 === e.hasZ, !0 === e.hasM, r)
                );
              case 'type':
                return 'Polygon';
            }
            break;
          case 'point':
            switch (t) {
              case 'x':
              case 'y':
              case 'z':
              case 'm':
                return void 0 !== e[t] ? e[t] : null;
              case 'type':
                return 'Point';
            }
            break;
          case 'polyline':
            switch (t) {
              case 'paths':
                return (
                  (r = e.cache._arcadeCacheId),
                  void 0 === r && (dr++, (r = dr), (e.cache._arcadeCacheId = r)),
                  new C(e.paths, e.spatialReference, !0 === e.hasZ, !0 === e.hasM, r)
                );
              case 'type':
                return 'Polyline';
            }
            break;
          case 'multipoint':
            switch (t) {
              case 'points':
                return (
                  (r = e.cache._arcadeCacheId),
                  void 0 === r && (dr++, (r = dr), (e.cache._arcadeCacheId = r)),
                  new w(e.points, e.spatialReference, !0 === e.hasZ, !0 === e.hasM, r, 1)
                );
              case 'type':
                return 'Multipoint';
            }
        }
        throw new Error(mt(n, 'RUNTIME', 'PROPERTYNOTFOUND'));
      }
      function mr(e, t) {
        let n;
        try {
          const r = t.name.toLowerCase();
          if (null !== e.localScope && void 0 !== e.localScope[r])
            return (
              (n = e.localScope[r]),
              !0 === n.valueset || ((n.value = cr(e, n.node)), (n.valueset = !0)),
              n.value
            );
          if (void 0 !== e.globalScope[r])
            return (
              (n = e.globalScope[r]),
              !0 === n.valueset || ((n.value = cr(e, n.node)), (n.valueset = !0)),
              n.value
            );
          throw new Error(mt(t, 'RUNTIME', 'VARIABLENOTFOUND'));
        } catch (e) {
          throw e;
        }
      }
      const gr = {};
      function Dr(e) {
        return null == e
          ? ''
          : j(e) || q(e)
          ? 'Array'
          : H(e)
          ? 'Date'
          : L(e)
          ? 'String'
          : G(e)
          ? 'Boolean'
          : Z(e)
          ? 'Number'
          : e instanceof Be
          ? 'Attachment'
          : e instanceof Oe
          ? 'Portal'
          : e instanceof _e
          ? 'Dictionary'
          : e instanceof Ke
          ? 'Feature'
          : e instanceof r.Z
          ? 'Point'
          : e instanceof u.Z
          ? 'Polygon'
          : e instanceof l.Z
          ? 'Polyline'
          : e instanceof a.Z
          ? 'Multipoint'
          : e instanceof s.Z
          ? 'Extent'
          : M(e)
          ? 'Function'
          : V(e)
          ? 'FeatureSet'
          : Y(e)
          ? 'FeatureSetCollection'
          : e === _
          ? ''
          : 'number' == typeof e && isNaN(e)
          ? 'Number'
          : 'Unrecognised Type';
      }
      function yr(e, t, n, r) {
        try {
          if (te(cr(e, t.arguments[n]), r)) return cr(e, t.arguments[n + 1]);
          {
            const i = t.arguments.length - n;
            return 1 === i
              ? cr(e, t.arguments[n])
              : 2 === i
              ? null
              : 3 === i
              ? cr(e, t.arguments[n + 2])
              : yr(e, t, n + 2, r);
          }
        } catch (e) {
          throw e;
        }
      }
      function Er(e, t, n, r) {
        try {
          if (!0 === r) return cr(e, t.arguments[n + 1]);
          if (3 == t.arguments.length - n) return cr(e, t.arguments[n + 2]);
          {
            const r = cr(e, t.arguments[n + 2]);
            if (!1 === G(r)) throw new Error('WHEN needs boolean test conditions');
            return Er(e, t, n + 2, r);
          }
        } catch (e) {
          throw e;
        }
      }
      function xr(e, t) {
        const n = e.length,
          r = Math.floor(n / 2);
        return 0 === n
          ? []
          : 1 === n
          ? [e[0]]
          : (function (e, t, n) {
              const r = [];
              for (; e.length > 0 || t.length > 0; )
                if (e.length > 0 && t.length > 0) {
                  let i = n(e[0], t[0]);
                  isNaN(i) && (i = 0),
                    i <= 0 ? (r.push(e[0]), (e = e.slice(1))) : (r.push(t[0]), (t = t.slice(1)));
                } else
                  e.length > 0
                    ? (r.push(e[0]), (e = e.slice(1)))
                    : t.length > 0 && (r.push(t[0]), (t = t.slice(1)));
              return r;
            })(xr(e.slice(0, r), t), xr(e.slice(r, n), t), t);
      }
      function Ar(e, t, n) {
        try {
          const r = e.body;
          if (n.length !== e.params.length) throw new Error('Invalid Parameter calls to function.');
          for (let r = 0; r < n.length; r++)
            t.localScope[e.params[r].name.toLowerCase()] = {
              value: n[r],
              valueset: !0,
              node: null,
            };
          const i = cr(t, r);
          if (i instanceof v) return i.value;
          if (i === O) throw new Error('Cannot Break from a Function');
          if (i === B) throw new Error('Cannot Continue from a Function');
          return i instanceof T ? i.value : i;
        } catch (e) {
          throw e;
        }
      }
      function wr(e, t, n) {
        return lr(e, t, function (t, r, i) {
          const s = {
            spatialReference: e.spatialReference,
            globalScope: e.globalScope,
            depthCounter: e.depthCounter + 1,
            console: e.console,
            lrucache: e.lrucache,
            interceptor: e.interceptor,
            localScope: {},
          };
          if (s.depthCounter > 64) throw new Error('Exceeded maximum function depth');
          return Ar(n, s, i);
        });
      }
      function Cr(e) {
        return function () {
          const t = {
            spatialReference: e.context.spatialReference,
            console: e.context.console,
            lrucache: e.context.lrucache,
            interceptor: e.context.interceptor,
            localScope: {},
            depthCounter: e.context.depthCounter + 1,
            globalScope: e.context.globalScope,
          };
          if (t.depthCounter > 64) throw new Error('Exceeded maximum function depth');
          return Ar(e.definition, t, arguments);
        };
      }
      xt(gr, lr),
        Ft(gr, lr),
        Pn(gr, lr),
        Jt(gr, lr),
        Ut(gr, lr),
        Qt(gr, lr),
        Yt(gr, lr),
        (gr.typeof = function (e, t) {
          return lr(e, t, function (e, t, n) {
            J(n, 1, 1);
            const r = Dr(n[0]);
            if ('Unrecognised Type' === r) throw new Error('Unrecognised Type');
            return r;
          });
        }),
        (gr.iif = function (e, t) {
          try {
            J(null === t.arguments ? [] : t.arguments, 3, 3);
            const n = cr(e, t.arguments[0]);
            if (!1 === G(n)) throw new Error('IF Function must have a boolean test condition');
            const r = cr(e, t.arguments[1]),
              i = cr(e, t.arguments[2]);
            return !0 === n ? r : i;
          } catch (e) {
            throw e;
          }
        }),
        (gr.decode = function (e, t) {
          try {
            if (t.arguments.length < 2) throw new Error('Missing Parameters');
            if (2 === t.arguments.length) return cr(e, t.arguments[1]);
            if ((t.arguments.length - 1) % 2 == 0)
              throw new Error('Must have a default value result.');
            return yr(e, t, 1, cr(e, t.arguments[0]));
          } catch (e) {
            throw e;
          }
        }),
        (gr.when = function (e, t) {
          try {
            if (t.arguments.length < 3) throw new Error('Missing Parameters');
            if (t.arguments.length % 2 == 0) throw new Error('Must have a default value result.');
            const n = cr(e, t.arguments[0]);
            if (!1 === G(n)) throw new Error('WHEN needs boolean test conditions');
            return Er(e, t, 0, n);
          } catch (e) {
            throw e;
          }
        }),
        (gr.top = function (e, t) {
          return lr(e, t, function (e, t, n) {
            if ((J(n, 2, 2), j(n[0])))
              return oe(n[1]) >= n[0].length ? n[0].slice(0) : n[0].slice(0, oe(n[1]));
            if (q(n[0])) return oe(n[1]) >= n[0].length() ? n[0].slice(0) : n[0].slice(0, oe(n[1]));
            throw new Error('Top cannot accept this parameter type');
          });
        }),
        (gr.first = function (e, t) {
          return lr(e, t, function (e, t, n) {
            return (
              J(n, 1, 1),
              j(n[0])
                ? 0 === n[0].length
                  ? null
                  : n[0][0]
                : q(n[0])
                ? 0 === n[0].length()
                  ? null
                  : n[0].get(0)
                : null
            );
          });
        }),
        (gr.sort = function (e, t) {
          return lr(e, t, function (e, t, n) {
            J(n, 1, 2);
            let r = n[0];
            if ((q(r) && (r = r.toArray()), !1 === j(r))) throw new Error('Illegal Argument');
            if (n.length > 1) {
              if (!1 === M(n[1])) throw new Error('Illegal Argument');
              let e = r;
              const t = Cr(n[1]);
              return (
                (e = xr(e, function (e, n) {
                  return t(e, n);
                })),
                e
              );
            }
            {
              let e = r;
              if (0 === e.length) return [];
              const t = {};
              for (let n = 0; n < e.length; n++) {
                const r = Dr(e[n]);
                '' !== r && (t[r] = !0);
              }
              if (
                !0 === t.Array ||
                !0 === t.Dictionary ||
                !0 === t.Feature ||
                !0 === t.Point ||
                !0 === t.Polygon ||
                !0 === t.Polyline ||
                !0 === t.Multipoint ||
                !0 === t.Extent ||
                !0 === t.Function
              )
                return e.slice(0);
              let n = 0,
                i = '';
              for (const e in t) n++, (i = e);
              return (
                (e =
                  n > 1 || 'String' === i
                    ? xr(e, function (e, t) {
                        if (null == e || e === _) return null == t || t === _ ? 0 : 1;
                        if (null == t || t === _) return -1;
                        const n = ne(e),
                          r = ne(t);
                        return n < r ? -1 : n === r ? 0 : 1;
                      })
                    : 'Number' === i
                    ? xr(e, function (e, t) {
                        return e - t;
                      })
                    : 'Boolean' === i
                    ? xr(e, function (e, t) {
                        return e === t ? 0 : t ? -1 : 1;
                      })
                    : 'Date' === i
                    ? xr(e, function (e, t) {
                        return t - e;
                      })
                    : e.slice(0)),
                e
              );
            }
          });
        });
      for (const e in gr) gr[e] = { value: new I(gr[e]), valueset: !0, node: null };
      const Fr = function () {};
      function br(e) {
        console.log(e);
      }
      function Nr(e, t) {
        let n = t.spatialReference;
        null == n && (n = new g.Z({ wkid: 102100 }));
        let r = cr(
          {
            spatialReference: n,
            globalScope: (function (e, t) {
              const n = new Fr();
              e || (e = {}), t || (t = {});
              const r = new _e({
                newline: '\n',
                tab: '\t',
                singlequote: "'",
                doublequote: '"',
                forwardslash: '/',
                backwardslash: '\\',
              });
              (r.immutable = !1), (n.textformatting = { value: r, valueset: !0, node: null });
              for (const e in t)
                n[e] = { value: new I(t[e]), native: !0, valueset: !0, node: null };
              for (const t in e)
                e[t] && 'esri.Graphic' === e[t].declaredClass
                  ? (n[t] = { value: Ke.createFromGraphic(e[t]), valueset: !0, node: null })
                  : (n[t] = { value: e[t], valueset: !0, node: null });
              return n;
            })(t.vars, t.customfunctions),
            localScope: null,
            console: t.console ? t.console : br,
            lrucache: t.lrucache,
            interceptor: t.interceptor,
            depthCounter: 1,
          },
          e.body[0].body,
        );
        if (
          (r instanceof v && (r = r.value),
          r instanceof T && (r = r.value),
          r === _ && (r = null),
          r === O)
        )
          throw new Error('Cannot return BREAK');
        if (r === B) throw new Error('Cannot return CONTINUE');
        if (r instanceof A) throw new Error('Cannot return FUNCTION');
        if (r instanceof I) throw new Error('Cannot return FUNCTION');
        return r;
      }
      ((Fr.prototype = gr).infinity = {
        value: Number.POSITIVE_INFINITY,
        valueset: !0,
        node: null,
      }),
        (Fr.prototype.pi = { value: Math.PI, valueset: !0, node: null });
      const Sr = 'AssignmentExpression',
        Ir = 'AssignmentPattern',
        Tr = 'ArrayExpression',
        vr = 'ArrayPattern',
        kr = 'BlockStatement',
        _r = 'Identifier',
        Or = 'Literal',
        Br = 'MemberExpression',
        Rr = 'ObjectExpression',
        Mr = 'ObjectPattern',
        Pr = 'Program',
        Ur = 'SequenceExpression',
        Lr = 'UnaryExpression';
      class Gr {
        constructor() {
          (this.attach = !1),
            (this.comments = []),
            (this.stack = []),
            (this.leading = []),
            (this.trailing = []);
        }
        insertInnerComments(e, t) {
          if (e.type === kr && 0 === e.body.length) {
            const n = [];
            for (let e = this.leading.length - 1; e >= 0; --e) {
              const r = this.leading[e];
              t.end.offset >= r.start &&
                (n.unshift(r.comment), this.leading.splice(e, 1), this.trailing.splice(e, 1));
            }
            n.length && (e.innerComments = n);
          }
        }
        findTrailingComments(e) {
          let t = [];
          if (this.trailing.length > 0) {
            for (let n = this.trailing.length - 1; n >= 0; --n) {
              const r = this.trailing[n];
              r.start >= e.end.offset && t.unshift(r.comment);
            }
            return (this.trailing.length = 0), t;
          }
          const n = this.stack[this.stack.length - 1];
          if (n && n.node.trailingComments) {
            const r = n.node.trailingComments[0];
            r &&
              r.range[0] >= e.end.offset &&
              ((t = n.node.trailingComments), delete n.node.trailingComments);
          }
          return t;
        }
        findLeadingComments(e) {
          const t = [];
          let n;
          for (; this.stack.length > 0; ) {
            const t = this.stack[this.stack.length - 1];
            if (!(t && t.start >= e.start.offset)) break;
            (n = t.node), this.stack.pop();
          }
          if (n) {
            for (let r = (n.leadingComments ? n.leadingComments.length : 0) - 1; r >= 0; --r) {
              const i = n.leadingComments[r];
              i.range[1] <= e.start.offset && (t.unshift(i), n.leadingComments.splice(r, 1));
            }
            return (
              n.leadingComments && 0 === n.leadingComments.length && delete n.leadingComments, t
            );
          }
          for (let n = this.leading.length - 1; n >= 0; --n) {
            const r = this.leading[n];
            r.start <= e.start.offset && (t.unshift(r.comment), this.leading.splice(n, 1));
          }
          return t;
        }
        visitNode(e, t) {
          if (e.type === Pr && e.body.length > 0) return;
          this.insertInnerComments(e, t);
          const n = this.findTrailingComments(t),
            r = this.findLeadingComments(t);
          r.length > 0 && (e.leadingComments = r),
            n.length > 0 && (e.trailingComments = n),
            this.stack.push({ node: e, start: t.start.offset });
        }
        visitComment(e, t) {
          const n = 'L' === e.type[0] ? 'Line' : 'Block',
            r = { type: n, value: e.value };
          if (
            (e.range && (r.range = e.range),
            e.loc && (r.loc = e.loc),
            this.comments.push(r),
            this.attach)
          ) {
            const r = {
              comment: { type: n, value: e.value, range: [t.start.offset, t.end.offset] },
              start: t.start.offset,
            };
            e.loc && (r.comment.loc = e.loc),
              (e.type = n),
              this.leading.push(r),
              this.trailing.push(r);
          }
        }
        visit(e, t) {
          'LineComment' === e.type || 'BlockComment' === e.type
            ? this.visitComment(e, t)
            : this.attach && this.visitNode(e, t);
        }
      }
      function Zr(e, t) {
        if (!e) throw new Error('ASSERT: ' + t);
      }
      class zr {
        constructor() {
          (this.errors = []), (this.tolerant = !1);
        }
        recordError(e) {
          this.errors.push(e);
        }
        tolerate(e) {
          if (!this.tolerant) throw e;
          this.recordError(e);
        }
        constructError(e, t) {
          let n = new Error(e);
          try {
            throw n;
          } catch (e) {
            Object.create &&
              Object.defineProperty &&
              ((n = Object.create(e)), Object.defineProperty(n, 'column', { value: t }));
          }
          return n;
        }
        createError(e, t, n, r) {
          const i = 'Line ' + t + ': ' + r,
            s = this.constructError(i, n);
          return (s.index = e), (s.lineNumber = t), (s.description = r), s;
        }
        throwError(e, t, n, r) {
          throw this.createError(e, t, n, r);
        }
        tolerateError(e, t, n, r) {
          const i = this.createError(e, t, n, r);
          if (!this.tolerant) throw i;
          this.recordError(i);
        }
      }
      const jr = 'Invalid hexadecimal escape sequence',
        Vr = 'Invalid left-hand side in assignment',
        Yr = 'Invalid regular expression',
        qr = 'Function name may not be eval or arguments in strict mode',
        Hr = 'Octal literals are not allowed in strict mode.',
        Jr = 'Strict mode function may not have duplicate parameter names',
        Xr = 'Parameter name eval or arguments is not allowed in strict mode',
        Wr = 'Use of future reserved word in strict mode',
        Kr = 'Variable name may not be eval or arguments in strict mode',
        $r = 'Octal literals are not allowed in template strings.',
        Qr = 'Unexpected token %0',
        ei = 'Unexpected token ILLEGAL',
        ti = "Undefined label '%0'",
        ni = 'Invalid regular expression: missing /';
      class ri {
        constructor(e) {
          (this.type = Tr), (this.elements = e);
        }
      }
      class ii {
        constructor(e) {
          (this.type = vr), (this.elements = e);
        }
      }
      class si {
        constructor(e, t, n) {
          (this.type = Sr), (this.operator = e), (this.left = t), (this.right = n);
        }
      }
      class oi {
        constructor(e, t) {
          (this.type = Ir), (this.left = e), (this.right = t);
        }
      }
      class ai {
        constructor(e, t, n) {
          const r = '||' === e || '&&' === e;
          (this.type = r ? 'LogicalExpression' : 'BinaryExpression'),
            (this.operator = e),
            (this.left = t),
            (this.right = n);
        }
      }
      class ui {
        constructor(e) {
          (this.type = kr), (this.body = e);
        }
      }
      class li {
        constructor(e) {
          (this.type = 'BreakStatement'), (this.label = e);
        }
      }
      class ci {
        constructor(e, t) {
          (this.type = 'CallExpression'), (this.callee = e), (this.arguments = t);
        }
      }
      class hi {
        constructor(e, t) {
          (this.type = Br), (this.computed = !0), (this.object = e), (this.property = t);
        }
      }
      class fi {
        constructor(e, t, n) {
          (this.type = 'ConditionalExpression'),
            (this.test = e),
            (this.consequent = t),
            (this.alternate = n);
        }
      }
      class di {
        constructor(e) {
          (this.type = 'ContinueStatement'), (this.label = e);
        }
      }
      class pi {
        constructor() {
          this.type = 'EmptyStatement';
        }
      }
      class mi {
        constructor(e) {
          (this.type = 'ExpressionStatement'), (this.expression = e);
        }
      }
      class gi {
        constructor(e, t, n) {
          (this.type = 'ForInStatement'),
            (this.left = e),
            (this.right = t),
            (this.body = n),
            (this.each = !1);
        }
      }
      class Di {
        constructor(e, t, n, r) {
          (this.type = 'ForStatement'),
            (this.init = e),
            (this.test = t),
            (this.update = n),
            (this.body = r);
        }
      }
      class yi {
        constructor(e, t, n, r) {
          (this.type = 'FunctionDeclaration'),
            (this.id = e),
            (this.params = t),
            (this.body = n),
            (this.generator = r),
            (this.expression = !1),
            (this.async = !1);
        }
      }
      class Ei {
        constructor(e, t, n, r) {
          (this.type = 'FunctionExpression'),
            (this.id = e),
            (this.params = t),
            (this.body = n),
            (this.generator = r),
            (this.expression = !1),
            (this.async = !1);
        }
      }
      class xi {
        constructor(e) {
          (this.type = _r), (this.name = e);
        }
      }
      class Ai {
        constructor(e, t, n) {
          (this.type = 'IfStatement'), (this.test = e), (this.consequent = t), (this.alternate = n);
        }
      }
      class wi {
        constructor(e, t) {
          (this.type = Or), (this.value = e), (this.raw = t);
        }
      }
      class Ci {
        constructor(e) {
          (this.type = Rr), (this.properties = e);
        }
      }
      class Fi {
        constructor(e) {
          (this.type = Mr), (this.properties = e);
        }
      }
      class bi {
        constructor(e, t, n, r, i, s) {
          (this.type = 'Property'),
            (this.key = t),
            (this.computed = n),
            (this.value = r),
            (this.kind = e),
            (this.method = i),
            (this.shorthand = s);
        }
      }
      class Ni {
        constructor(e) {
          (this.type = 'ReturnStatement'), (this.argument = e);
        }
      }
      class Si {
        constructor(e) {
          (this.type = Pr), (this.body = e), (this.sourceType = 'script');
        }
      }
      class Ii {
        constructor(e) {
          (this.type = Ur), (this.expressions = e);
        }
      }
      class Ti {
        constructor(e, t) {
          (this.type = Br), (this.computed = !1), (this.object = e), (this.property = t);
        }
      }
      class vi {
        constructor(e, t) {
          (this.type = 'TemplateElement'), (this.value = e), (this.tail = t);
        }
      }
      class ki {
        constructor(e, t) {
          (this.type = 'TemplateLiteral'), (this.quasis = e), (this.expressions = t);
        }
      }
      class _i {
        constructor(e, t) {
          (this.type = Lr), (this.operator = e), (this.argument = t), (this.prefix = !0);
        }
      }
      class Oi {
        constructor(e, t, n) {
          (this.type = 'UpdateExpression'),
            (this.operator = e),
            (this.argument = t),
            (this.prefix = n);
        }
      }
      class Bi {
        constructor(e, t) {
          (this.type = 'VariableDeclaration'), (this.declarations = e), (this.kind = t);
        }
      }
      class Ri {
        constructor(e, t) {
          (this.type = 'VariableDeclarator'), (this.id = e), (this.init = t);
        }
      }
      const Mi = {
          NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,
          NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,
        },
        Pi = {
          fromCodePoint: (e) =>
            e < 65536
              ? String.fromCharCode(e)
              : String.fromCharCode(55296 + ((e - 65536) >> 10)) +
                String.fromCharCode(56320 + ((e - 65536) & 1023)),
          isWhiteSpace: (e) =>
            32 === e ||
            9 === e ||
            11 === e ||
            12 === e ||
            160 === e ||
            (e >= 5760 &&
              [
                5760,
                8192,
                8193,
                8194,
                8195,
                8196,
                8197,
                8198,
                8199,
                8200,
                8201,
                8202,
                8239,
                8287,
                12288,
                65279,
              ].indexOf(e) >= 0),
          isLineTerminator: (e) => 10 === e || 13 === e || 8232 === e || 8233 === e,
          isIdentifierStart: (e) =>
            36 === e ||
            95 === e ||
            (e >= 65 && e <= 90) ||
            (e >= 97 && e <= 122) ||
            92 === e ||
            (e >= 128 && Mi.NonAsciiIdentifierStart.test(Pi.fromCodePoint(e))),
          isIdentifierPart: (e) =>
            36 === e ||
            95 === e ||
            (e >= 65 && e <= 90) ||
            (e >= 97 && e <= 122) ||
            (e >= 48 && e <= 57) ||
            92 === e ||
            (e >= 128 && Mi.NonAsciiIdentifierPart.test(Pi.fromCodePoint(e))),
          isDecimalDigit: (e) => e >= 48 && e <= 57,
          isHexDigit: (e) => (e >= 48 && e <= 57) || (e >= 65 && e <= 70) || (e >= 97 && e <= 102),
          isOctalDigit: (e) => e >= 48 && e <= 55,
        };
      function Ui(e) {
        return '0123456789abcdef'.indexOf(e.toLowerCase());
      }
      function Li(e) {
        return '01234567'.indexOf(e);
      }
      class Gi {
        constructor(e, t) {
          (this.source = e),
            (this.errorHandler = t),
            (this.trackComment = !1),
            (this.isModule = !1),
            (this.length = e.length),
            (this.index = 0),
            (this.lineNumber = e.length > 0 ? 1 : 0),
            (this.lineStart = 0),
            (this.curlyStack = []);
        }
        saveState() {
          return {
            index: this.index,
            lineNumber: this.lineNumber,
            lineStart: this.lineStart,
            curlyStack: this.curlyStack.slice(),
          };
        }
        restoreState(e) {
          (this.index = e.index),
            (this.lineNumber = e.lineNumber),
            (this.lineStart = e.lineStart),
            (this.curlyStack = e.curlyStack);
        }
        eof() {
          return this.index >= this.length;
        }
        throwUnexpectedToken(e = ei) {
          return this.errorHandler.throwError(
            this.index,
            this.lineNumber,
            this.index - this.lineStart + 1,
            e,
          );
        }
        tolerateUnexpectedToken(e = ei) {
          this.errorHandler.tolerateError(
            this.index,
            this.lineNumber,
            this.index - this.lineStart + 1,
            e,
          );
        }
        skipSingleLineComment(e) {
          let t,
            n,
            r = [];
          for (
            this.trackComment &&
            ((r = []),
            (t = this.index - e),
            (n = {
              start: { line: this.lineNumber, column: this.index - this.lineStart - e },
              end: {},
            }));
            !this.eof();

          ) {
            const i = this.source.charCodeAt(this.index);
            if ((++this.index, Pi.isLineTerminator(i))) {
              if (this.trackComment) {
                n.end = { line: this.lineNumber, column: this.index - this.lineStart - 1 };
                const i = {
                  multiLine: !1,
                  slice: [t + e, this.index - 1],
                  range: [t, this.index - 1],
                  loc: n,
                };
                r.push(i);
              }
              return (
                13 === i && 10 === this.source.charCodeAt(this.index) && ++this.index,
                ++this.lineNumber,
                (this.lineStart = this.index),
                r
              );
            }
          }
          if (this.trackComment) {
            n.end = { line: this.lineNumber, column: this.index - this.lineStart };
            const i = { multiLine: !1, slice: [t + e, this.index], range: [t, this.index], loc: n };
            r.push(i);
          }
          return r;
        }
        skipMultiLineComment() {
          let e,
            t,
            n = [];
          for (
            this.trackComment &&
            ((n = []),
            (e = this.index - 2),
            (t = {
              start: { line: this.lineNumber, column: this.index - this.lineStart - 2 },
              end: {},
            }));
            !this.eof();

          ) {
            const r = this.source.charCodeAt(this.index);
            if (Pi.isLineTerminator(r))
              13 === r && 10 === this.source.charCodeAt(this.index + 1) && ++this.index,
                ++this.lineNumber,
                ++this.index,
                (this.lineStart = this.index);
            else if (42 === r) {
              if (47 === this.source.charCodeAt(this.index + 1)) {
                if (((this.index += 2), this.trackComment)) {
                  t.end = { line: this.lineNumber, column: this.index - this.lineStart };
                  const r = {
                    multiLine: !0,
                    slice: [e + 2, this.index - 2],
                    range: [e, this.index],
                    loc: t,
                  };
                  n.push(r);
                }
                return n;
              }
              ++this.index;
            } else ++this.index;
          }
          if (this.trackComment) {
            t.end = { line: this.lineNumber, column: this.index - this.lineStart };
            const r = { multiLine: !0, slice: [e + 2, this.index], range: [e, this.index], loc: t };
            n.push(r);
          }
          return this.tolerateUnexpectedToken(), n;
        }
        scanComments() {
          let e;
          this.trackComment && (e = []);
          let t = 0 === this.index;
          for (; !this.eof(); ) {
            let n = this.source.charCodeAt(this.index);
            if (Pi.isWhiteSpace(n)) ++this.index;
            else if (Pi.isLineTerminator(n))
              ++this.index,
                13 === n && 10 === this.source.charCodeAt(this.index) && ++this.index,
                ++this.lineNumber,
                (this.lineStart = this.index),
                (t = !0);
            else if (47 === n)
              if (((n = this.source.charCodeAt(this.index + 1)), 47 === n)) {
                this.index += 2;
                const n = this.skipSingleLineComment(2);
                this.trackComment && (e = e.concat(n)), (t = !0);
              } else {
                if (42 !== n) break;
                {
                  this.index += 2;
                  const t = this.skipMultiLineComment();
                  this.trackComment && (e = e.concat(t));
                }
              }
            else if (t && 45 === n) {
              if (
                45 !== this.source.charCodeAt(this.index + 1) ||
                62 !== this.source.charCodeAt(this.index + 2)
              )
                break;
              {
                this.index += 3;
                const t = this.skipSingleLineComment(3);
                this.trackComment && (e = e.concat(t));
              }
            } else {
              if (60 !== n || this.isModule) break;
              if ('!--' !== this.source.slice(this.index + 1, this.index + 4)) break;
              {
                this.index += 4;
                const t = this.skipSingleLineComment(4);
                this.trackComment && (e = e.concat(t));
              }
            }
          }
          return e;
        }
        isFutureReservedWord(e) {
          return !1;
        }
        isStrictModeReservedWord(e) {
          return !1;
        }
        isRestrictedWord(e) {
          return !1;
        }
        isKeyword(e) {
          switch ((e = e.toLowerCase()).length) {
            case 2:
              return 'if' === e || 'in' === e;
            case 3:
              return 'var' === e || 'for' === e;
            case 4:
              return 'else' === e;
            case 5:
              return 'break' === e;
            case 6:
              return 'return' === e;
            case 8:
              return 'function' === e || 'continue' === e;
            default:
              return !1;
          }
        }
        codePointAt(e) {
          let t = this.source.charCodeAt(e);
          if (t >= 55296 && t <= 56319) {
            const n = this.source.charCodeAt(e + 1);
            n >= 56320 && n <= 57343 && (t = 1024 * (t - 55296) + n - 56320 + 65536);
          }
          return t;
        }
        scanHexEscape(e) {
          const t = 'u' === e ? 4 : 2;
          let n = 0;
          for (let e = 0; e < t; ++e) {
            if (this.eof() || !Pi.isHexDigit(this.source.charCodeAt(this.index))) return null;
            n = 16 * n + Ui(this.source[this.index++]);
          }
          return String.fromCharCode(n);
        }
        scanUnicodeCodePointEscape() {
          let e = this.source[this.index],
            t = 0;
          for (
            '}' === e && this.throwUnexpectedToken();
            !this.eof() && ((e = this.source[this.index++]), Pi.isHexDigit(e.charCodeAt(0)));

          )
            t = 16 * t + Ui(e);
          return (t > 1114111 || '}' !== e) && this.throwUnexpectedToken(), Pi.fromCodePoint(t);
        }
        getIdentifier() {
          const e = this.index++;
          for (; !this.eof(); ) {
            const t = this.source.charCodeAt(this.index);
            if (92 === t) return (this.index = e), this.getComplexIdentifier();
            if (t >= 55296 && t < 57343) return (this.index = e), this.getComplexIdentifier();
            if (!Pi.isIdentifierPart(t)) break;
            ++this.index;
          }
          return this.source.slice(e, this.index);
        }
        getComplexIdentifier() {
          let e,
            t = this.codePointAt(this.index),
            n = Pi.fromCodePoint(t);
          for (
            this.index += n.length,
              92 === t &&
                (117 !== this.source.charCodeAt(this.index) && this.throwUnexpectedToken(),
                ++this.index,
                '{' === this.source[this.index]
                  ? (++this.index, (e = this.scanUnicodeCodePointEscape()))
                  : ((e = this.scanHexEscape('u')),
                    (null !== e && '\\' !== e && Pi.isIdentifierStart(e.charCodeAt(0))) ||
                      this.throwUnexpectedToken()),
                (n = e));
            !this.eof() && ((t = this.codePointAt(this.index)), Pi.isIdentifierPart(t));

          )
            (e = Pi.fromCodePoint(t)),
              (n += e),
              (this.index += e.length),
              92 === t &&
                ((n = n.substr(0, n.length - 1)),
                117 !== this.source.charCodeAt(this.index) && this.throwUnexpectedToken(),
                ++this.index,
                '{' === this.source[this.index]
                  ? (++this.index, (e = this.scanUnicodeCodePointEscape()))
                  : ((e = this.scanHexEscape('u')),
                    (null !== e && '\\' !== e && Pi.isIdentifierPart(e.charCodeAt(0))) ||
                      this.throwUnexpectedToken()),
                (n += e));
          return n;
        }
        octalToDecimal(e) {
          let t = '0' !== e,
            n = Li(e);
          return (
            !this.eof() &&
              Pi.isOctalDigit(this.source.charCodeAt(this.index)) &&
              ((t = !0),
              (n = 8 * n + Li(this.source[this.index++])),
              '0123'.indexOf(e) >= 0 &&
                !this.eof() &&
                Pi.isOctalDigit(this.source.charCodeAt(this.index)) &&
                (n = 8 * n + Li(this.source[this.index++]))),
            { code: n, octal: t }
          );
        }
        scanIdentifier() {
          let e;
          const t = this.index,
            n =
              92 === this.source.charCodeAt(t) ? this.getComplexIdentifier() : this.getIdentifier();
          if (
            ((e =
              1 === n.length
                ? 3
                : this.isKeyword(n)
                ? 4
                : 'null' === n.toLowerCase()
                ? 5
                : 'true' === n.toLowerCase() || 'false' === n.toLowerCase()
                ? 1
                : 3),
            3 !== e && t + n.length !== this.index)
          ) {
            const e = this.index;
            (this.index = t),
              this.tolerateUnexpectedToken('Keyword must not contain escaped characters'),
              (this.index = e);
          }
          return {
            type: e,
            value: n,
            lineNumber: this.lineNumber,
            lineStart: this.lineStart,
            start: t,
            end: this.index,
          };
        }
        scanPunctuator() {
          const e = this.index;
          let t = this.source[this.index];
          switch (t) {
            case '(':
            case '{':
              '{' === t && this.curlyStack.push('{'), ++this.index;
              break;
            case '.':
              ++this.index,
                '.' === this.source[this.index] &&
                  '.' === this.source[this.index + 1] &&
                  ((this.index += 2), (t = '...'));
              break;
            case '}':
              ++this.index, this.curlyStack.pop();
              break;
            case ')':
            case ';':
            case ',':
            case '[':
            case ']':
            case ':':
            case '?':
            case '~':
              ++this.index;
              break;
            default:
              (t = this.source.substr(this.index, 4)),
                '>>>=' === t
                  ? (this.index += 4)
                  : ((t = t.substr(0, 3)),
                    '===' === t ||
                    '!==' === t ||
                    '>>>' === t ||
                    '<<=' === t ||
                    '>>=' === t ||
                    '**=' === t
                      ? (this.index += 3)
                      : ((t = t.substr(0, 2)),
                        '&&' === t ||
                        '||' === t ||
                        '==' === t ||
                        '!=' === t ||
                        '+=' === t ||
                        '-=' === t ||
                        '*=' === t ||
                        '/=' === t ||
                        '++' === t ||
                        '--' === t ||
                        '<<' === t ||
                        '>>' === t ||
                        '&=' === t ||
                        '|=' === t ||
                        '^=' === t ||
                        '%=' === t ||
                        '<=' === t ||
                        '>=' === t ||
                        '=>' === t ||
                        '**' === t
                          ? (this.index += 2)
                          : ((t = this.source[this.index]),
                            '<>=!+-*%&|^/'.indexOf(t) >= 0 && ++this.index)));
          }
          return (
            this.index === e && this.throwUnexpectedToken(),
            {
              type: 7,
              value: t,
              lineNumber: this.lineNumber,
              lineStart: this.lineStart,
              start: e,
              end: this.index,
            }
          );
        }
        scanHexLiteral(e) {
          let t = '';
          for (; !this.eof() && Pi.isHexDigit(this.source.charCodeAt(this.index)); )
            t += this.source[this.index++];
          return (
            0 === t.length && this.throwUnexpectedToken(),
            Pi.isIdentifierStart(this.source.charCodeAt(this.index)) && this.throwUnexpectedToken(),
            {
              type: 6,
              value: parseInt('0x' + t, 16),
              lineNumber: this.lineNumber,
              lineStart: this.lineStart,
              start: e,
              end: this.index,
            }
          );
        }
        scanBinaryLiteral(e) {
          let t,
            n = '';
          for (; !this.eof() && ((t = this.source[this.index]), '0' === t || '1' === t); )
            n += this.source[this.index++];
          return (
            0 === n.length && this.throwUnexpectedToken(),
            this.eof() ||
              ((t = this.source.charCodeAt(this.index)),
              (Pi.isIdentifierStart(t) || Pi.isDecimalDigit(t)) && this.throwUnexpectedToken()),
            {
              type: 6,
              value: parseInt(n, 2),
              lineNumber: this.lineNumber,
              lineStart: this.lineStart,
              start: e,
              end: this.index,
            }
          );
        }
        scanOctalLiteral(e, t) {
          let n = '',
            r = !1;
          for (
            Pi.isOctalDigit(e.charCodeAt(0))
              ? ((r = !0), (n = '0' + this.source[this.index++]))
              : ++this.index;
            !this.eof() && Pi.isOctalDigit(this.source.charCodeAt(this.index));

          )
            n += this.source[this.index++];
          return (
            r || 0 !== n.length || this.throwUnexpectedToken(),
            (Pi.isIdentifierStart(this.source.charCodeAt(this.index)) ||
              Pi.isDecimalDigit(this.source.charCodeAt(this.index))) &&
              this.throwUnexpectedToken(),
            {
              type: 6,
              value: parseInt(n, 8),
              octal: r,
              lineNumber: this.lineNumber,
              lineStart: this.lineStart,
              start: t,
              end: this.index,
            }
          );
        }
        scanNumericLiteral() {
          const e = this.index;
          let t = this.source[e];
          Zr(
            Pi.isDecimalDigit(t.charCodeAt(0)) || '.' === t,
            'Numeric literal must start with a decimal digit or a decimal point',
          );
          let n = '';
          if ('.' !== t) {
            if (((n = this.source[this.index++]), (t = this.source[this.index]), '0' === n)) {
              if ('x' === t || 'X' === t) return ++this.index, this.scanHexLiteral(e);
              if ('b' === t || 'B' === t) return ++this.index, this.scanBinaryLiteral(e);
              if ('o' === t || 'O' === t) return this.scanOctalLiteral(t, e);
            }
            for (; Pi.isDecimalDigit(this.source.charCodeAt(this.index)); )
              n += this.source[this.index++];
            t = this.source[this.index];
          }
          if ('.' === t) {
            for (
              n += this.source[this.index++];
              Pi.isDecimalDigit(this.source.charCodeAt(this.index));

            )
              n += this.source[this.index++];
            t = this.source[this.index];
          }
          if ('e' === t || 'E' === t)
            if (
              ((n += this.source[this.index++]),
              (t = this.source[this.index]),
              ('+' !== t && '-' !== t) || (n += this.source[this.index++]),
              Pi.isDecimalDigit(this.source.charCodeAt(this.index)))
            )
              for (; Pi.isDecimalDigit(this.source.charCodeAt(this.index)); )
                n += this.source[this.index++];
            else this.throwUnexpectedToken();
          return (
            Pi.isIdentifierStart(this.source.charCodeAt(this.index)) && this.throwUnexpectedToken(),
            {
              type: 6,
              value: parseFloat(n),
              lineNumber: this.lineNumber,
              lineStart: this.lineStart,
              start: e,
              end: this.index,
            }
          );
        }
        scanStringLiteral() {
          const e = this.index;
          let t = this.source[e];
          Zr("'" === t || '"' === t, 'String literal must starts with a quote'), ++this.index;
          let n = !1,
            r = '';
          for (; !this.eof(); ) {
            let e = this.source[this.index++];
            if (e === t) {
              t = '';
              break;
            }
            if ('\\' === e)
              if (((e = this.source[this.index++]), e && Pi.isLineTerminator(e.charCodeAt(0))))
                ++this.lineNumber,
                  '\r' === e && '\n' === this.source[this.index] && ++this.index,
                  (this.lineStart = this.index);
              else
                switch (e) {
                  case 'u':
                    if ('{' === this.source[this.index])
                      ++this.index, (r += this.scanUnicodeCodePointEscape());
                    else {
                      const t = this.scanHexEscape(e);
                      null === t && this.throwUnexpectedToken(), (r += t);
                    }
                    break;
                  case 'x': {
                    const t = this.scanHexEscape(e);
                    null === t && this.throwUnexpectedToken(jr), (r += t);
                    break;
                  }
                  case 'n':
                    r += '\n';
                    break;
                  case 'r':
                    r += '\r';
                    break;
                  case 't':
                    r += '\t';
                    break;
                  case 'b':
                    r += '\b';
                    break;
                  case 'f':
                    r += '\f';
                    break;
                  case 'v':
                    r += '\v';
                    break;
                  case '8':
                  case '9':
                    (r += e), this.tolerateUnexpectedToken();
                    break;
                  default:
                    if (e && Pi.isOctalDigit(e.charCodeAt(0))) {
                      const t = this.octalToDecimal(e);
                      (n = t.octal || n), (r += String.fromCharCode(t.code));
                    } else r += e;
                }
            else {
              if (Pi.isLineTerminator(e.charCodeAt(0))) break;
              r += e;
            }
          }
          return (
            '' !== t && ((this.index = e), this.throwUnexpectedToken()),
            {
              type: 8,
              value: r,
              octal: n,
              lineNumber: this.lineNumber,
              lineStart: this.lineStart,
              start: e,
              end: this.index,
            }
          );
        }
        scanTemplate() {
          let e = '',
            t = !1;
          const n = this.index,
            r = '`' === this.source[n];
          let i = !1,
            s = 2;
          for (++this.index; !this.eof(); ) {
            let n = this.source[this.index++];
            if ('`' === n) {
              (s = 1), (i = !0), (t = !0);
              break;
            }
            if ('$' === n) {
              if ('{' === this.source[this.index]) {
                this.curlyStack.push('${'), ++this.index, (t = !0);
                break;
              }
              e += n;
            } else if ('\\' === n)
              if (((n = this.source[this.index++]), Pi.isLineTerminator(n.charCodeAt(0))))
                ++this.lineNumber,
                  '\r' === n && '\n' === this.source[this.index] && ++this.index,
                  (this.lineStart = this.index);
              else
                switch (n) {
                  case 'n':
                    e += '\n';
                    break;
                  case 'r':
                    e += '\r';
                    break;
                  case 't':
                    e += '\t';
                    break;
                  case 'u':
                    if ('{' === this.source[this.index])
                      ++this.index, (e += this.scanUnicodeCodePointEscape());
                    else {
                      const t = this.index,
                        r = this.scanHexEscape(n);
                      null !== r ? (e += r) : ((this.index = t), (e += n));
                    }
                    break;
                  case 'x': {
                    const t = this.scanHexEscape(n);
                    null === t && this.throwUnexpectedToken(jr), (e += t);
                    break;
                  }
                  case 'b':
                    e += '\b';
                    break;
                  case 'f':
                    e += '\f';
                    break;
                  case 'v':
                    e += '\v';
                    break;
                  default:
                    '0' === n
                      ? (Pi.isDecimalDigit(this.source.charCodeAt(this.index)) &&
                          this.throwUnexpectedToken($r),
                        (e += '\0'))
                      : Pi.isOctalDigit(n.charCodeAt(0))
                      ? this.throwUnexpectedToken($r)
                      : (e += n);
                }
            else
              Pi.isLineTerminator(n.charCodeAt(0))
                ? (++this.lineNumber,
                  '\r' === n && '\n' === this.source[this.index] && ++this.index,
                  (this.lineStart = this.index),
                  (e += '\n'))
                : (e += n);
          }
          return (
            t || this.throwUnexpectedToken(),
            r || this.curlyStack.pop(),
            {
              type: 10,
              value: this.source.slice(n + 1, this.index - s),
              cooked: e,
              head: r,
              tail: i,
              lineNumber: this.lineNumber,
              lineStart: this.lineStart,
              start: n,
              end: this.index,
            }
          );
        }
        testRegExp(e, t) {
          let n = e;
          t.indexOf('u') >= 0 &&
            (n = n
              .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, (e, t, n) => {
                const r = parseInt(t || n, 16);
                return (
                  r > 1114111 && this.throwUnexpectedToken(Yr),
                  r <= 65535 ? String.fromCharCode(r) : ''
                );
              })
              .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, ''));
          try {
            RegExp(n);
          } catch (e) {
            this.throwUnexpectedToken(Yr);
          }
          try {
            return new RegExp(e, t);
          } catch (e) {
            return null;
          }
        }
        scanRegExpBody() {
          let e = this.source[this.index];
          Zr('/' === e, 'Regular expression literal must start with a slash');
          let t = this.source[this.index++],
            n = !1,
            r = !1;
          for (; !this.eof(); )
            if (((e = this.source[this.index++]), (t += e), '\\' === e))
              (e = this.source[this.index++]),
                Pi.isLineTerminator(e.charCodeAt(0)) && this.throwUnexpectedToken(ni),
                (t += e);
            else if (Pi.isLineTerminator(e.charCodeAt(0))) this.throwUnexpectedToken(ni);
            else if (n) ']' === e && (n = !1);
            else {
              if ('/' === e) {
                r = !0;
                break;
              }
              '[' === e && (n = !0);
            }
          return r || this.throwUnexpectedToken(ni), t.substr(1, t.length - 2);
        }
        scanRegExpFlags() {
          let e = '',
            t = '';
          for (; !this.eof(); ) {
            let n = this.source[this.index];
            if (!Pi.isIdentifierPart(n.charCodeAt(0))) break;
            if ((++this.index, '\\' !== n || this.eof())) (t += n), (e += n);
            else if (((n = this.source[this.index]), 'u' === n)) {
              ++this.index;
              let n = this.index;
              const r = this.scanHexEscape('u');
              if (null !== r) for (t += r, e += '\\u'; n < this.index; ++n) e += this.source[n];
              else (this.index = n), (t += 'u'), (e += '\\u');
              this.tolerateUnexpectedToken();
            } else (e += '\\'), this.tolerateUnexpectedToken();
          }
          return t;
        }
        scanRegExp() {
          const e = this.index,
            t = this.scanRegExpBody(),
            n = this.scanRegExpFlags();
          return {
            type: 9,
            value: '',
            pattern: t,
            flags: n,
            regex: this.testRegExp(t, n),
            lineNumber: this.lineNumber,
            lineStart: this.lineStart,
            start: e,
            end: this.index,
          };
        }
        lex() {
          if (this.eof())
            return {
              type: 2,
              value: '',
              lineNumber: this.lineNumber,
              lineStart: this.lineStart,
              start: this.index,
              end: this.index,
            };
          const e = this.source.charCodeAt(this.index);
          return Pi.isIdentifierStart(e)
            ? this.scanIdentifier()
            : 40 === e || 41 === e || 59 === e
            ? this.scanPunctuator()
            : 39 === e || 34 === e
            ? this.scanStringLiteral()
            : 46 === e
            ? Pi.isDecimalDigit(this.source.charCodeAt(this.index + 1))
              ? this.scanNumericLiteral()
              : this.scanPunctuator()
            : Pi.isDecimalDigit(e)
            ? this.scanNumericLiteral()
            : 96 === e || (125 === e && '${' === this.curlyStack[this.curlyStack.length - 1])
            ? this.scanTemplate()
            : e >= 55296 && e < 57343 && Pi.isIdentifierStart(this.codePointAt(this.index))
            ? this.scanIdentifier()
            : this.scanPunctuator();
        }
      }
      const Zi = {
        1: 'Boolean',
        2: '<end>',
        3: 'Identifier',
        4: 'Keyword',
        5: 'Null',
        6: 'Numeric',
        7: 'Punctuator',
        8: 'String',
        9: 'RegularExpression',
        10: 'Template',
      };
      class zi {
        constructor(e, t = {}, n) {
          (this.config = {
            range: 'boolean' == typeof t.range && t.range,
            loc: 'boolean' == typeof t.loc && t.loc,
            source: null,
            tokens: 'boolean' == typeof t.tokens && t.tokens,
            comment: 'boolean' == typeof t.comment && t.comment,
            tolerant: 'boolean' == typeof t.tolerant && t.tolerant,
          }),
            this.config.loc &&
              t.source &&
              null !== t.source &&
              (this.config.source = String(t.source)),
            (this.delegate = n),
            (this.errorHandler = new zr()),
            (this.errorHandler.tolerant = this.config.tolerant),
            (this.scanner = new Gi(e, this.errorHandler)),
            (this.scanner.trackComment = this.config.comment),
            (this.operatorPrecedence = {
              ')': 0,
              ';': 0,
              ',': 0,
              '=': 0,
              ']': 0,
              '||': 1,
              '&&': 2,
              '|': 3,
              '^': 4,
              '&': 5,
              '==': 6,
              '!=': 6,
              '===': 6,
              '!==': 6,
              '<': 7,
              '>': 7,
              '<=': 7,
              '>=': 7,
              '<<': 8,
              '>>': 8,
              '>>>': 8,
              '+': 9,
              '-': 9,
              '*': 11,
              '/': 11,
              '%': 11,
            }),
            (this.lookahead = {
              type: 2,
              value: '',
              lineNumber: this.scanner.lineNumber,
              lineStart: 0,
              start: 0,
              end: 0,
            }),
            (this.hasLineTerminator = !1),
            (this.context = {
              isModule: !1,
              allowIn: !0,
              allowStrictDirective: !0,
              firstCoverInitializedNameError: null,
              isAssignmentTarget: !1,
              isBindingElement: !1,
              inFunctionBody: !1,
              inIteration: !1,
              inSwitch: !1,
              labelSet: {},
              strict: !1,
            }),
            (this.tokens = []),
            (this.startMarker = { index: 0, line: this.scanner.lineNumber, column: 0 }),
            (this.lastMarker = { index: 0, line: this.scanner.lineNumber, column: 0 }),
            this.nextToken(),
            (this.lastMarker = {
              index: this.scanner.index,
              line: this.scanner.lineNumber,
              column: this.scanner.index - this.scanner.lineStart,
            });
        }
        throwError(e, ...t) {
          const n = t.slice(),
            r = e.replace(
              /%(\d)/g,
              (e, t) => (Zr(t < n.length, 'Message reference must be in range'), n[t]),
            ),
            i = this.lastMarker.index,
            s = this.lastMarker.line,
            o = this.lastMarker.column + 1;
          throw this.errorHandler.createError(i, s, o, r);
        }
        tolerateError(e, ...t) {
          const n = t.slice(),
            r = e.replace(
              /%(\d)/g,
              (e, t) => (Zr(t < n.length, 'Message reference must be in range'), n[t]),
            ),
            i = this.lastMarker.index,
            s = this.scanner.lineNumber,
            o = this.lastMarker.column + 1;
          this.errorHandler.tolerateError(i, s, o, r);
        }
        unexpectedTokenError(e, t) {
          let n,
            r = t || Qr;
          if (
            (e
              ? (t ||
                  ((r =
                    2 === e.type
                      ? 'Unexpected end of input'
                      : 3 === e.type
                      ? 'Unexpected identifier'
                      : 6 === e.type
                      ? 'Unexpected number'
                      : 8 === e.type
                      ? 'Unexpected string'
                      : 10 === e.type
                      ? 'Unexpected quasi %0'
                      : Qr),
                  4 === e.type &&
                    (this.scanner.isFutureReservedWord(e.value)
                      ? (r = 'Unexpected reserved word')
                      : this.context.strict &&
                        this.scanner.isStrictModeReservedWord(e.value) &&
                        (r = Wr))),
                (n = e.value))
              : (n = 'ILLEGAL'),
            (r = r.replace('%0', n)),
            e && 'number' == typeof e.lineNumber)
          ) {
            const t = e.start,
              n = e.lineNumber,
              i = this.lastMarker.index - this.lastMarker.column,
              s = e.start - i + 1;
            return this.errorHandler.createError(t, n, s, r);
          }
          {
            const e = this.lastMarker.index,
              t = this.lastMarker.line,
              n = this.lastMarker.column + 1;
            return this.errorHandler.createError(e, t, n, r);
          }
        }
        throwUnexpectedToken(e, t) {
          throw this.unexpectedTokenError(e, t);
        }
        tolerateUnexpectedToken(e, t) {
          this.errorHandler.tolerate(this.unexpectedTokenError(e, t));
        }
        collectComments() {
          if (this.config.comment) {
            const e = this.scanner.scanComments();
            if (e.length > 0 && this.delegate)
              for (let t = 0; t < e.length; ++t) {
                const n = e[t],
                  r = {
                    type: n.multiLine ? 'BlockComment' : 'LineComment',
                    value: this.scanner.source.slice(n.slice[0], n.slice[1]),
                  };
                this.config.range && (r.range = n.range), this.config.loc && (r.loc = n.loc);
                const i = {
                  start: { line: n.loc.start.line, column: n.loc.start.column, offset: n.range[0] },
                  end: { line: n.loc.end.line, column: n.loc.end.column, offset: n.range[1] },
                };
                this.delegate(r, i);
              }
          } else this.scanner.scanComments();
        }
        getTokenRaw(e) {
          return this.scanner.source.slice(e.start, e.end);
        }
        convertToken(e) {
          const t = { type: Zi[e.type], value: this.getTokenRaw(e) };
          if (
            (this.config.range && (t.range = [e.start, e.end]),
            this.config.loc &&
              (t.loc = {
                start: { line: this.startMarker.line, column: this.startMarker.column },
                end: {
                  line: this.scanner.lineNumber,
                  column: this.scanner.index - this.scanner.lineStart,
                },
              }),
            9 === e.type)
          ) {
            const n = e.pattern,
              r = e.flags;
            t.regex = { pattern: n, flags: r };
          }
          return t;
        }
        nextToken() {
          const e = this.lookahead;
          (this.lastMarker.index = this.scanner.index),
            (this.lastMarker.line = this.scanner.lineNumber),
            (this.lastMarker.column = this.scanner.index - this.scanner.lineStart),
            this.collectComments(),
            this.scanner.index !== this.startMarker.index &&
              ((this.startMarker.index = this.scanner.index),
              (this.startMarker.line = this.scanner.lineNumber),
              (this.startMarker.column = this.scanner.index - this.scanner.lineStart));
          const t = this.scanner.lex();
          return (
            (this.hasLineTerminator = e.lineNumber !== t.lineNumber),
            t &&
              this.context.strict &&
              3 === t.type &&
              this.scanner.isStrictModeReservedWord(t.value) &&
              (t.type = 4),
            (this.lookahead = t),
            this.config.tokens && 2 !== t.type && this.tokens.push(this.convertToken(t)),
            e
          );
        }
        nextRegexToken() {
          this.collectComments();
          const e = this.scanner.scanRegExp();
          return (
            this.config.tokens && (this.tokens.pop(), this.tokens.push(this.convertToken(e))),
            (this.lookahead = e),
            this.nextToken(),
            e
          );
        }
        createNode() {
          return {
            index: this.startMarker.index,
            line: this.startMarker.line,
            column: this.startMarker.column,
          };
        }
        startNode(e, t = 0) {
          let n = e.start - e.lineStart,
            r = e.lineNumber;
          return n < 0 && ((n += t), r--), { index: e.start, line: r, column: n };
        }
        finalize(e, t) {
          if (
            (this.config.range && (t.range = [e.index, this.lastMarker.index]),
            this.config.loc &&
              ((t.loc = {
                start: { line: e.line, column: e.column },
                end: { line: this.lastMarker.line, column: this.lastMarker.column },
              }),
              this.config.source && (t.loc.source = this.config.source)),
            this.delegate)
          ) {
            const n = {
              start: { line: e.line, column: e.column, offset: e.index },
              end: {
                line: this.lastMarker.line,
                column: this.lastMarker.column,
                offset: this.lastMarker.index,
              },
            };
            this.delegate(t, n);
          }
          return t;
        }
        expect(e) {
          const t = this.nextToken();
          (7 === t.type && t.value === e) || this.throwUnexpectedToken(t);
        }
        expectCommaSeparator() {
          if (this.config.tolerant) {
            const e = this.lookahead;
            7 === e.type && ',' === e.value
              ? this.nextToken()
              : 7 === e.type && ';' === e.value
              ? (this.nextToken(), this.tolerateUnexpectedToken(e))
              : this.tolerateUnexpectedToken(e, Qr);
          } else this.expect(',');
        }
        expectKeyword(e) {
          const t = this.nextToken();
          (4 === t.type && t.value.toLowerCase() === e.toLowerCase()) ||
            this.throwUnexpectedToken(t);
        }
        match(e) {
          return 7 === this.lookahead.type && this.lookahead.value === e;
        }
        matchKeyword(e) {
          return (
            4 === this.lookahead.type && this.lookahead.value.toLowerCase() === e.toLowerCase()
          );
        }
        matchContextualKeyword(e) {
          return 3 === this.lookahead.type && this.lookahead.value === e;
        }
        matchAssign() {
          if (7 !== this.lookahead.type) return !1;
          const e = this.lookahead.value;
          return (
            '=' === e ||
            '*=' === e ||
            '**=' === e ||
            '/=' === e ||
            '%=' === e ||
            '+=' === e ||
            '-=' === e ||
            '<<=' === e ||
            '>>=' === e ||
            '>>>=' === e ||
            '&=' === e ||
            '^=' === e ||
            '|=' === e
          );
        }
        isolateCoverGrammar(e) {
          const t = this.context.isBindingElement,
            n = this.context.isAssignmentTarget,
            r = this.context.firstCoverInitializedNameError;
          (this.context.isBindingElement = !0),
            (this.context.isAssignmentTarget = !0),
            (this.context.firstCoverInitializedNameError = null);
          const i = e.call(this);
          return (
            null !== this.context.firstCoverInitializedNameError &&
              this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),
            (this.context.isBindingElement = t),
            (this.context.isAssignmentTarget = n),
            (this.context.firstCoverInitializedNameError = r),
            i
          );
        }
        inheritCoverGrammar(e) {
          const t = this.context.isBindingElement,
            n = this.context.isAssignmentTarget,
            r = this.context.firstCoverInitializedNameError;
          (this.context.isBindingElement = !0),
            (this.context.isAssignmentTarget = !0),
            (this.context.firstCoverInitializedNameError = null);
          const i = e.call(this);
          return (
            (this.context.isBindingElement = this.context.isBindingElement && t),
            (this.context.isAssignmentTarget = this.context.isAssignmentTarget && n),
            (this.context.firstCoverInitializedNameError =
              r || this.context.firstCoverInitializedNameError),
            i
          );
        }
        consumeSemicolon() {
          this.match(';')
            ? this.nextToken()
            : this.hasLineTerminator ||
              (2 === this.lookahead.type ||
                this.match('}') ||
                this.throwUnexpectedToken(this.lookahead),
              (this.lastMarker.index = this.startMarker.index),
              (this.lastMarker.line = this.startMarker.line),
              (this.lastMarker.column = this.startMarker.column));
        }
        parsePrimaryExpression() {
          const e = this.createNode();
          let t, n, r;
          switch (this.lookahead.type) {
            case 3:
              t = this.finalize(e, new xi(this.nextToken().value));
              break;
            case 6:
            case 8:
              this.context.strict &&
                this.lookahead.octal &&
                this.tolerateUnexpectedToken(this.lookahead, Hr),
                (this.context.isAssignmentTarget = !1),
                (this.context.isBindingElement = !1),
                (n = this.nextToken()),
                (r = this.getTokenRaw(n)),
                (t = this.finalize(e, new wi(n.value, r)));
              break;
            case 1:
              (this.context.isAssignmentTarget = !1),
                (this.context.isBindingElement = !1),
                (n = this.nextToken()),
                (r = this.getTokenRaw(n)),
                (t = this.finalize(e, new wi('true' === n.value.toLowerCase(), r)));
              break;
            case 5:
              (this.context.isAssignmentTarget = !1),
                (this.context.isBindingElement = !1),
                (n = this.nextToken()),
                (r = this.getTokenRaw(n)),
                (t = this.finalize(e, new wi(null, r)));
              break;
            case 10:
              t = this.parseTemplateLiteral();
              break;
            case 7:
              switch (this.lookahead.value) {
                case '(':
                  (this.context.isBindingElement = !1),
                    (t = this.inheritCoverGrammar(this.parseGroupExpression));
                  break;
                case '[':
                  t = this.inheritCoverGrammar(this.parseArrayInitializer);
                  break;
                case '{':
                  t = this.inheritCoverGrammar(this.parseObjectInitializer);
                  break;
                default:
                  t = this.throwUnexpectedToken(this.nextToken());
              }
              break;
            case 4:
              (this.context.isAssignmentTarget = !1),
                (this.context.isBindingElement = !1),
                (t = this.matchKeyword('function')
                  ? this.parseFunctionExpression()
                  : this.throwUnexpectedToken(this.nextToken()));
              break;
            default:
              t = this.throwUnexpectedToken(this.nextToken());
          }
          return t;
        }
        parseArrayInitializer() {
          const e = this.createNode(),
            t = [];
          for (this.expect('['); !this.match(']'); )
            this.match(',')
              ? (this.nextToken(), t.push(null))
              : (t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),
                this.match(']') || this.expect(','));
          return this.expect(']'), this.finalize(e, new ri(t));
        }
        parsePropertyMethod(e) {
          (this.context.isAssignmentTarget = !1), (this.context.isBindingElement = !1);
          const t = this.context.strict,
            n = this.context.allowStrictDirective;
          this.context.allowStrictDirective = e.simple;
          const r = this.isolateCoverGrammar(this.parseFunctionSourceElements);
          return (
            this.context.strict &&
              e.firstRestricted &&
              this.tolerateUnexpectedToken(e.firstRestricted, e.message),
            this.context.strict &&
              e.stricted &&
              this.tolerateUnexpectedToken(e.stricted, e.message),
            (this.context.strict = t),
            (this.context.allowStrictDirective = n),
            r
          );
        }
        parsePropertyMethodFunction() {
          const e = this.createNode(),
            t = this.parseFormalParameters(),
            n = this.parsePropertyMethod(t);
          return this.finalize(e, new Ei(null, t.params, n, !1));
        }
        parseObjectPropertyKey() {
          const e = this.createNode(),
            t = this.nextToken();
          let n;
          switch (t.type) {
            case 8:
            case 6: {
              this.context.strict && t.octal && this.tolerateUnexpectedToken(t, Hr);
              const r = this.getTokenRaw(t);
              n = this.finalize(e, new wi(t.value, r));
              break;
            }
            case 3:
            case 1:
            case 5:
            case 4:
              n = this.finalize(e, new xi(t.value));
              break;
            case 7:
              '[' === t.value
                ? ((n = this.isolateCoverGrammar(this.parseAssignmentExpression)), this.expect(']'))
                : (n = this.throwUnexpectedToken(t));
              break;
            default:
              n = this.throwUnexpectedToken(t);
          }
          return n;
        }
        isPropertyKey(e, t) {
          return (e.type === _r && e.name === t) || (e.type === Or && e.value === t);
        }
        parseObjectProperty(e) {
          const t = this.createNode(),
            n = this.lookahead;
          let r,
            i = null,
            s = null,
            o = !1,
            a = !1,
            u = !1,
            l = !1;
          if (3 === n.type) {
            const e = n.value;
            this.nextToken(),
              (o = this.match('[')),
              (l = !(
                this.hasLineTerminator ||
                'async' !== e ||
                this.match(':') ||
                this.match('(') ||
                this.match('*') ||
                this.match(',')
              )),
              (i = l ? this.parseObjectPropertyKey() : this.finalize(t, new xi(e)));
          } else
            this.match('*')
              ? this.nextToken()
              : ((o = this.match('[')), (i = this.parseObjectPropertyKey()));
          if ((i || this.throwUnexpectedToken(this.lookahead), (r = 'init'), this.match(':') && !l))
            !o &&
              this.isPropertyKey(i, '__proto__') &&
              (e.value &&
                this.tolerateError('Duplicate __proto__ fields are not allowed in object literals'),
              (e.value = !0)),
              this.nextToken(),
              (s = this.inheritCoverGrammar(this.parseAssignmentExpression));
          else if (this.match('(')) (s = this.parsePropertyMethodFunction()), (a = !0);
          else if (3 === n.type) {
            const e = this.finalize(t, new xi(n.value));
            if (this.match('=')) {
              (this.context.firstCoverInitializedNameError = this.lookahead),
                this.nextToken(),
                (u = !0);
              const n = this.isolateCoverGrammar(this.parseAssignmentExpression);
              s = this.finalize(t, new oi(e, n));
            } else (u = !0), (s = e);
          } else this.throwUnexpectedToken(this.nextToken());
          return this.finalize(t, new bi('init', i, o, s, a, u));
        }
        parseObjectInitializer() {
          const e = this.createNode();
          this.expect('{');
          const t = [],
            n = { value: !1 };
          for (; !this.match('}'); )
            t.push(this.parseObjectProperty(n)), this.match('}') || this.expectCommaSeparator();
          return this.expect('}'), this.finalize(e, new Ci(t));
        }
        parseTemplateHead() {
          Zr(this.lookahead.head, 'Template literal must start with a template head');
          const e = this.createNode(),
            t = this.nextToken(),
            n = t.value,
            r = t.cooked;
          return this.finalize(e, new vi({ raw: n, cooked: r }, t.tail));
        }
        parseTemplateElement() {
          10 !== this.lookahead.type && this.throwUnexpectedToken();
          const e = this.createNode(),
            t = this.nextToken(),
            n = t.value,
            r = t.cooked;
          return this.finalize(e, new vi({ raw: n, cooked: r }, t.tail));
        }
        parseTemplateLiteral() {
          const e = this.createNode(),
            t = [],
            n = [];
          let r = this.parseTemplateHead();
          for (n.push(r); !r.tail; )
            t.push(this.parseExpression()), (r = this.parseTemplateElement()), n.push(r);
          return this.finalize(e, new ki(n, t));
        }
        reinterpretExpressionAsPattern(e) {
          switch (e.type) {
            case _r:
            case Br:
            case Ir:
              break;
            case Tr:
              e.type = vr;
              for (let t = 0; t < e.elements.length; t++)
                null !== e.elements[t] && this.reinterpretExpressionAsPattern(e.elements[t]);
              break;
            case Rr:
              e.type = Mr;
              for (let t = 0; t < e.properties.length; t++) {
                const n = e.properties[t];
                this.reinterpretExpressionAsPattern(n.value);
              }
              break;
            case Sr:
              (e.type = Ir), delete e.operator, this.reinterpretExpressionAsPattern(e.left);
          }
        }
        parseGroupExpression() {
          let e;
          if ((this.expect('('), this.match(')')))
            this.nextToken(),
              this.match('=>') || this.expect('=>'),
              (e = { type: 'ArrowParameterPlaceHolder', params: [], async: !1 });
          else {
            const t = this.lookahead;
            let n = !1;
            if (
              ((this.context.isBindingElement = !0),
              (e = this.inheritCoverGrammar(this.parseAssignmentExpression)),
              this.match(','))
            ) {
              const r = [];
              for (
                this.context.isAssignmentTarget = !1, r.push(e);
                2 !== this.lookahead.type && this.match(',');

              ) {
                if ((this.nextToken(), this.match(')'))) {
                  this.nextToken();
                  for (let e = 0; e < r.length; e++) this.reinterpretExpressionAsPattern(r[e]);
                  (n = !0), (e = { type: 'ArrowParameterPlaceHolder', params: r, async: !1 });
                } else r.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
                if (n) break;
              }
              n || (e = this.finalize(this.startNode(t), new Ii(r)));
            }
            if (!n) {
              if (
                (this.expect(')'),
                this.match('=>') &&
                  (e.type === _r &&
                    'yield' === e.name &&
                    ((n = !0), (e = { type: 'ArrowParameterPlaceHolder', params: [e], async: !1 })),
                  !n))
              ) {
                if (
                  (this.context.isBindingElement || this.throwUnexpectedToken(this.lookahead),
                  e.type === Ur)
                )
                  for (let t = 0; t < e.expressions.length; t++)
                    this.reinterpretExpressionAsPattern(e.expressions[t]);
                else this.reinterpretExpressionAsPattern(e);
                e = {
                  type: 'ArrowParameterPlaceHolder',
                  params: e.type === Ur ? e.expressions : [e],
                  async: !1,
                };
              }
              this.context.isBindingElement = !1;
            }
          }
          return e;
        }
        parseArguments() {
          this.expect('(');
          const e = [];
          if (!this.match(')'))
            for (;;) {
              const t = this.isolateCoverGrammar(this.parseAssignmentExpression);
              if ((e.push(t), this.match(')'))) break;
              if ((this.expectCommaSeparator(), this.match(')'))) break;
            }
          return this.expect(')'), e;
        }
        isIdentifierName(e) {
          return 3 === e.type || 4 === e.type || 1 === e.type || 5 === e.type;
        }
        parseIdentifierName() {
          const e = this.createNode(),
            t = this.nextToken();
          return (
            this.isIdentifierName(t) || this.throwUnexpectedToken(t),
            this.finalize(e, new xi(t.value))
          );
        }
        parseLeftHandSideExpressionAllowCall() {
          const e = this.lookahead,
            t = this.context.allowIn;
          let n;
          for (
            this.context.allowIn = !0, n = this.inheritCoverGrammar(this.parsePrimaryExpression);
            ;

          )
            if (this.match('.')) {
              (this.context.isBindingElement = !1),
                (this.context.isAssignmentTarget = !0),
                this.expect('.');
              const t = this.parseIdentifierName();
              n = this.finalize(this.startNode(e), new Ti(n, t));
            } else if (this.match('(')) {
              (this.context.isBindingElement = !1), (this.context.isAssignmentTarget = !1);
              const t = this.parseArguments();
              n = this.finalize(this.startNode(e), new ci(n, t));
            } else {
              if (!this.match('[')) break;
              {
                (this.context.isBindingElement = !1),
                  (this.context.isAssignmentTarget = !0),
                  this.expect('[');
                const t = this.isolateCoverGrammar(this.parseExpression);
                this.expect(']'), (n = this.finalize(this.startNode(e), new hi(n, t)));
              }
            }
          return (this.context.allowIn = t), n;
        }
        parseLeftHandSideExpression() {
          Zr(this.context.allowIn, 'callee of new expression always allow in keyword.');
          const e = this.startNode(this.lookahead);
          let t = this.inheritCoverGrammar(this.parsePrimaryExpression);
          for (;;)
            if (this.match('[')) {
              (this.context.isBindingElement = !1),
                (this.context.isAssignmentTarget = !0),
                this.expect('[');
              const n = this.isolateCoverGrammar(this.parseExpression);
              this.expect(']'), (t = this.finalize(e, new hi(t, n)));
            } else {
              if (!this.match('.')) break;
              {
                (this.context.isBindingElement = !1),
                  (this.context.isAssignmentTarget = !0),
                  this.expect('.');
                const n = this.parseIdentifierName();
                t = this.finalize(e, new Ti(t, n));
              }
            }
          return t;
        }
        parseUpdateExpression() {
          let e;
          const t = this.lookahead;
          if (this.match('++') || this.match('--')) {
            const n = this.startNode(t),
              r = this.nextToken();
            (e = this.inheritCoverGrammar(this.parseUnaryExpression)),
              this.context.strict &&
                e.type === _r &&
                this.scanner.isRestrictedWord(e.name) &&
                this.tolerateError(
                  'Prefix increment/decrement may not have eval or arguments operand in strict mode',
                ),
              this.context.isAssignmentTarget || this.tolerateError(Vr);
            const i = !0;
            (e = this.finalize(n, new Oi(r.value, e, i))),
              (this.context.isAssignmentTarget = !1),
              (this.context.isBindingElement = !1);
          } else if (
            ((e = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall)),
            !this.hasLineTerminator &&
              7 === this.lookahead.type &&
              (this.match('++') || this.match('--')))
          ) {
            this.context.strict &&
              e.type === _r &&
              this.scanner.isRestrictedWord(e.name) &&
              this.tolerateError(
                'Postfix increment/decrement may not have eval or arguments operand in strict mode',
              ),
              this.context.isAssignmentTarget || this.tolerateError(Vr),
              (this.context.isAssignmentTarget = !1),
              (this.context.isBindingElement = !1);
            const n = this.nextToken().value,
              r = !1;
            e = this.finalize(this.startNode(t), new Oi(n, e, r));
          }
          return e;
        }
        parseUnaryExpression() {
          let e;
          if (
            this.match('+') ||
            this.match('-') ||
            this.match('~') ||
            this.match('!') ||
            this.matchKeyword('delete') ||
            this.matchKeyword('void') ||
            this.matchKeyword('typeof')
          ) {
            const t = this.startNode(this.lookahead),
              n = this.nextToken();
            (e = this.inheritCoverGrammar(this.parseUnaryExpression)),
              (e = this.finalize(t, new _i(n.value, e))),
              this.context.strict &&
                'delete' === e.operator &&
                e.argument.type === _r &&
                this.tolerateError('Delete of an unqualified identifier in strict mode.'),
              (this.context.isAssignmentTarget = !1),
              (this.context.isBindingElement = !1);
          } else e = this.parseUpdateExpression();
          return e;
        }
        parseExponentiationExpression() {
          const e = this.lookahead;
          let t = this.inheritCoverGrammar(this.parseUnaryExpression);
          if (t.type !== Lr && this.match('**')) {
            this.nextToken(),
              (this.context.isAssignmentTarget = !1),
              (this.context.isBindingElement = !1);
            const n = t,
              r = this.isolateCoverGrammar(this.parseExponentiationExpression);
            t = this.finalize(this.startNode(e), new ai('**', n, r));
          }
          return t;
        }
        binaryPrecedence(e) {
          const t = e.value;
          let n;
          return (
            (n =
              7 === e.type
                ? this.operatorPrecedence[t] || 0
                : 4 === e.type && ('instanceof' === t || (this.context.allowIn && 'in' === t))
                ? 7
                : 0),
            n
          );
        }
        parseBinaryExpression() {
          const e = this.lookahead;
          let t = this.inheritCoverGrammar(this.parseExponentiationExpression);
          const n = this.lookahead;
          let r = this.binaryPrecedence(n);
          if (r > 0) {
            this.nextToken(),
              (this.context.isAssignmentTarget = !1),
              (this.context.isBindingElement = !1);
            const i = [e, this.lookahead];
            let s = t,
              o = this.isolateCoverGrammar(this.parseExponentiationExpression);
            const a = [s, n.value, o],
              u = [r];
            for (; (r = this.binaryPrecedence(this.lookahead)), !(r <= 0); ) {
              for (; a.length > 2 && r <= u[u.length - 1]; ) {
                o = a.pop();
                const e = a.pop();
                u.pop(), (s = a.pop()), i.pop();
                const t = i[i.length - 1],
                  n = this.startNode(t, t.lineStart);
                a.push(this.finalize(n, new ai(e, s, o)));
              }
              a.push(this.nextToken().value),
                u.push(r),
                i.push(this.lookahead),
                a.push(this.isolateCoverGrammar(this.parseExponentiationExpression));
            }
            let l = a.length - 1;
            t = a[l];
            let c = i.pop();
            for (; l > 1; ) {
              const e = i.pop(),
                n = c && c.lineStart,
                r = this.startNode(e, n),
                s = a[l - 1];
              (t = this.finalize(r, new ai(s, a[l - 2], t))), (l -= 2), (c = e);
            }
          }
          return t;
        }
        parseConditionalExpression() {
          const e = this.lookahead;
          let t = this.inheritCoverGrammar(this.parseBinaryExpression);
          if (this.match('?')) {
            this.nextToken();
            const n = this.context.allowIn;
            this.context.allowIn = !0;
            const r = this.isolateCoverGrammar(this.parseAssignmentExpression);
            (this.context.allowIn = n), this.expect(':');
            const i = this.isolateCoverGrammar(this.parseAssignmentExpression);
            (t = this.finalize(this.startNode(e), new fi(t, r, i))),
              (this.context.isAssignmentTarget = !1),
              (this.context.isBindingElement = !1);
          }
          return t;
        }
        checkPatternParam(e, t) {
          switch (t.type) {
            case _r:
              this.validateParam(e, t, t.name);
              break;
            case Ir:
              this.checkPatternParam(e, t.left);
              break;
            case vr:
              for (let n = 0; n < t.elements.length; n++)
                null !== t.elements[n] && this.checkPatternParam(e, t.elements[n]);
              break;
            case Mr:
              for (let n = 0; n < t.properties.length; n++) {
                const r = t.properties[n];
                this.checkPatternParam(e, r.value);
              }
          }
          e.simple = e.simple && t instanceof xi;
        }
        reinterpretAsCoverFormalsList(e) {
          const t = [e],
            n = { simple: !0, paramSet: {} };
          switch (e.type) {
            case _r:
              break;
            default:
              return null;
          }
          for (let e = 0; e < t.length; ++e) {
            const r = t[e];
            this.checkPatternParam(n, r), (t[e] = r);
          }
          if (n.message === Jr) {
            const e = this.context.strict ? n.stricted : n.firstRestricted;
            this.throwUnexpectedToken(e, n.message);
          }
          return {
            simple: n.simple,
            params: t,
            stricted: n.stricted,
            firstRestricted: n.firstRestricted,
            message: n.message,
          };
        }
        parseAssignmentExpression() {
          let e;
          const t = this.lookahead;
          let n = t;
          if (((e = this.parseConditionalExpression()), this.matchAssign())) {
            if (
              (this.context.isAssignmentTarget || this.tolerateError(Vr),
              this.context.strict && e.type === _r)
            ) {
              const t = e;
              this.scanner.isRestrictedWord(t.name) &&
                this.tolerateUnexpectedToken(
                  n,
                  'Assignment to eval or arguments is not allowed in strict mode',
                ),
                this.scanner.isStrictModeReservedWord(t.name) &&
                  this.tolerateUnexpectedToken(n, Wr);
            }
            this.match('=')
              ? this.reinterpretExpressionAsPattern(e)
              : ((this.context.isAssignmentTarget = !1), (this.context.isBindingElement = !1)),
              (n = this.nextToken());
            const r = n.value,
              i = this.isolateCoverGrammar(this.parseAssignmentExpression);
            (e = this.finalize(this.startNode(t), new si(r, e, i))),
              (this.context.firstCoverInitializedNameError = null);
          }
          return e;
        }
        parseExpression() {
          const e = this.lookahead;
          let t = this.isolateCoverGrammar(this.parseAssignmentExpression);
          if (this.match(',')) {
            const n = [];
            for (n.push(t); 2 !== this.lookahead.type && this.match(','); )
              this.nextToken(), n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
            t = this.finalize(this.startNode(e), new Ii(n));
          }
          return t;
        }
        parseStatementListItem() {
          let e;
          if (
            ((this.context.isAssignmentTarget = !0),
            (this.context.isBindingElement = !0),
            4 === this.lookahead.type)
          )
            switch (this.lookahead.value) {
              case 'function':
                e = this.parseFunctionDeclaration();
                break;
              default:
                e = this.parseStatement();
            }
          else e = this.parseStatement();
          return e;
        }
        parseBlock() {
          const e = this.createNode();
          this.expect('{');
          const t = [];
          for (; !this.match('}'); ) t.push(this.parseStatementListItem());
          return this.expect('}'), this.finalize(e, new ui(t));
        }
        parseBlockOrObjectInitialiser() {
          const e = this.createNode();
          if ((this.expect('{'), 3 === this.lookahead.type || 8 === this.lookahead.type)) {
            const t = this.scanner.saveState();
            this.scanner.scanComments();
            const n = this.scanner.lex();
            if ((this.scanner.restoreState(t), 7 === n.type && ':' === n.value)) {
              const t = [],
                n = { value: !1 };
              for (; !this.match('}'); )
                t.push(this.parseObjectProperty(n)), this.match('}') || this.expectCommaSeparator();
              return this.expect('}'), this.finalize(e, new Ci(t));
            }
          }
          const t = [];
          for (; !this.match('}'); ) t.push(this.parseStatementListItem());
          return this.expect('}'), this.finalize(e, new ui(t));
        }
        parseLexicalBinding(e, t) {
          const n = this.createNode(),
            r = this.parsePattern([], e);
          this.context.strict &&
            r.type === _r &&
            this.scanner.isRestrictedWord(r.name) &&
            this.tolerateError(Kr);
          let i = null;
          return (
            ((!t.inFor && r.type !== _r) || this.match('=')) &&
              (this.expect('='), (i = this.isolateCoverGrammar(this.parseAssignmentExpression))),
            this.finalize(n, new Ri(r, i))
          );
        }
        parseBindingList(e, t) {
          const n = [this.parseLexicalBinding(e, t)];
          for (; this.match(','); ) this.nextToken(), n.push(this.parseLexicalBinding(e, t));
          return n;
        }
        parseArrayPattern(e, t) {
          const n = this.createNode();
          this.expect('[');
          const r = [];
          for (; !this.match(']'); )
            this.match(',')
              ? (this.nextToken(), r.push(null))
              : (r.push(this.parsePatternWithDefault(e, t)), this.match(']') || this.expect(','));
          return this.expect(']'), this.finalize(n, new ii(r));
        }
        parsePropertyPattern(e, t) {
          const n = this.createNode();
          let r,
            i,
            s = !1,
            o = !1;
          if (3 === this.lookahead.type) {
            const s = this.lookahead;
            r = this.parseVariableIdentifier();
            const a = this.finalize(n, new xi(s.value));
            if (this.match('=')) {
              e.push(s), (o = !0), this.nextToken();
              const t = this.parseAssignmentExpression();
              i = this.finalize(this.startNode(s), new oi(a, t));
            } else
              this.match(':')
                ? (this.expect(':'), (i = this.parsePatternWithDefault(e, t)))
                : (e.push(s), (o = !0), (i = a));
          } else
            (s = this.match('[')),
              (r = this.parseObjectPropertyKey()),
              this.expect(':'),
              (i = this.parsePatternWithDefault(e, t));
          return this.finalize(n, new bi('init', r, s, i, !1, o));
        }
        parseObjectPattern(e, t) {
          const n = this.createNode(),
            r = [];
          for (this.expect('{'); !this.match('}'); )
            r.push(this.parsePropertyPattern(e, t)), this.match('}') || this.expect(',');
          return this.expect('}'), this.finalize(n, new Fi(r));
        }
        parsePattern(e, t) {
          let n;
          return (
            this.match('[')
              ? (n = this.parseArrayPattern(e, t))
              : this.match('{')
              ? (n = this.parseObjectPattern(e, t))
              : (!this.matchKeyword('let') ||
                  ('const' !== t && 'let' !== t) ||
                  this.tolerateUnexpectedToken(
                    this.lookahead,
                    'let is disallowed as a lexically bound name',
                  ),
                e.push(this.lookahead),
                (n = this.parseVariableIdentifier(t))),
            n
          );
        }
        parsePatternWithDefault(e, t) {
          const n = this.lookahead;
          let r = this.parsePattern(e, t);
          if (this.match('=')) {
            this.nextToken();
            const e = this.isolateCoverGrammar(this.parseAssignmentExpression);
            r = this.finalize(this.startNode(n), new oi(r, e));
          }
          return r;
        }
        parseVariableIdentifier(e) {
          const t = this.createNode(),
            n = this.nextToken();
          return (
            3 !== n.type &&
              (this.context.strict && 4 === n.type && this.scanner.isStrictModeReservedWord(n.value)
                ? this.tolerateUnexpectedToken(n, Wr)
                : (this.context.strict || 'let' !== n.value || 'var' !== e) &&
                  this.throwUnexpectedToken(n)),
            this.finalize(t, new xi(n.value))
          );
        }
        parseVariableDeclaration(e) {
          const t = this.createNode(),
            n = this.parsePattern([], 'var');
          this.context.strict &&
            n.type === _r &&
            this.scanner.isRestrictedWord(n.name) &&
            this.tolerateError(Kr);
          let r = null;
          return (
            this.match('=')
              ? (this.nextToken(), (r = this.isolateCoverGrammar(this.parseAssignmentExpression)))
              : n.type === _r || e.inFor || this.expect('='),
            this.finalize(t, new Ri(n, r))
          );
        }
        parseVariableDeclarationList(e) {
          const t = { inFor: e.inFor },
            n = [];
          for (n.push(this.parseVariableDeclaration(t)); this.match(','); )
            this.nextToken(), n.push(this.parseVariableDeclaration(t));
          return n;
        }
        parseVariableStatement() {
          const e = this.createNode();
          this.expectKeyword('var');
          const t = this.parseVariableDeclarationList({ inFor: !1 });
          return this.consumeSemicolon(), this.finalize(e, new Bi(t, 'var'));
        }
        parseEmptyStatement() {
          const e = this.createNode();
          return this.expect(';'), this.finalize(e, new pi());
        }
        parseExpressionStatement() {
          const e = this.createNode(),
            t = this.parseExpression();
          return this.consumeSemicolon(), this.finalize(e, new mi(t));
        }
        parseIfClause() {
          return (
            this.context.strict &&
              this.matchKeyword('function') &&
              this.tolerateError(
                'In strict mode code, functions can only be declared at top level or inside a block',
              ),
            this.parseStatement(!0)
          );
        }
        parseIfStatement() {
          const e = this.createNode();
          let t,
            n = null;
          this.expectKeyword('if'), this.expect('(');
          const r = this.parseExpression();
          return (
            !this.match(')') && this.config.tolerant
              ? (this.tolerateUnexpectedToken(this.nextToken()),
                (t = this.finalize(this.createNode(), new pi())))
              : (this.expect(')'),
                (t = this.parseIfClause()),
                this.matchKeyword('else') && (this.nextToken(), (n = this.parseIfClause()))),
            this.finalize(e, new Ai(r, t, n))
          );
        }
        parseForStatement() {
          let e,
            t,
            n = null,
            r = null,
            i = null;
          const s = this.createNode();
          if ((this.expectKeyword('for'), this.expect('('), this.match(';'))) this.nextToken();
          else if (this.matchKeyword('var')) {
            (n = this.createNode()), this.nextToken();
            const r = this.context.allowIn;
            this.context.allowIn = !1;
            const i = this.parseVariableDeclarationList({ inFor: !0 });
            if (((this.context.allowIn = r), 1 === i.length && this.matchKeyword('in'))) {
              const r = i[0];
              r.init &&
                (r.id.type === vr || r.id.type === Mr || this.context.strict) &&
                this.tolerateError(
                  '%0 loop variable declaration may not have an initializer',
                  'for-in',
                ),
                (n = this.finalize(n, new Bi(i, 'var'))),
                this.nextToken(),
                (e = n),
                (t = this.parseExpression()),
                (n = null);
            } else
              1 === i.length && null === i[0].init && this.matchContextualKeyword('of')
                ? ((n = this.finalize(n, new Bi(i, 'var'))),
                  this.nextToken(),
                  (e = n),
                  (t = this.parseAssignmentExpression()),
                  (n = null))
                : ((n = this.finalize(n, new Bi(i, 'var'))), this.expect(';'));
          } else {
            const r = this.lookahead,
              i = this.context.isBindingElement,
              s = this.context.isAssignmentTarget,
              o = this.context.firstCoverInitializedNameError,
              a = this.context.allowIn;
            if (
              ((this.context.allowIn = !1),
              (n = this.inheritCoverGrammar(this.parseAssignmentExpression)),
              (this.context.allowIn = a),
              this.matchKeyword('in'))
            )
              (this.context.isAssignmentTarget && n.type !== Sr) ||
                this.tolerateError('Invalid left-hand side in for-in'),
                this.nextToken(),
                this.reinterpretExpressionAsPattern(n),
                (e = n),
                (t = this.parseExpression()),
                (n = null);
            else {
              if (
                ((this.context.isBindingElement = i),
                (this.context.isAssignmentTarget = s),
                (this.context.firstCoverInitializedNameError = o),
                this.match(','))
              ) {
                const e = [n];
                for (; this.match(','); )
                  this.nextToken(),
                    e.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
                n = this.finalize(this.startNode(r), new Ii(e));
              }
              this.expect(';');
            }
          }
          let o;
          if (
            (void 0 === e &&
              (this.match(';') || (r = this.isolateCoverGrammar(this.parseExpression)),
              this.expect(';'),
              this.match(')') || (i = this.isolateCoverGrammar(this.parseExpression))),
            !this.match(')') && this.config.tolerant)
          )
            this.tolerateUnexpectedToken(this.nextToken()),
              (o = this.finalize(this.createNode(), new pi()));
          else {
            this.expect(')');
            const e = this.context.inIteration;
            (this.context.inIteration = !0),
              (o = this.isolateCoverGrammar(this.parseStatementBlockAllowed)),
              (this.context.inIteration = e);
          }
          return void 0 === e
            ? this.finalize(s, new Di(n, r, i, o))
            : this.finalize(s, new gi(e, t, o));
        }
        parseContinueStatement() {
          const e = this.createNode();
          this.expectKeyword('continue');
          let t = null;
          if (3 === this.lookahead.type && !this.hasLineTerminator) {
            const e = this.parseVariableIdentifier();
            t = e;
            const n = '$' + e.name;
            Object.prototype.hasOwnProperty.call(this.context.labelSet, n) ||
              this.throwError(ti, e.name);
          }
          return (
            this.consumeSemicolon(),
            null !== t || this.context.inIteration || this.throwError('Illegal continue statement'),
            this.finalize(e, new di(t))
          );
        }
        parseBreakStatement() {
          const e = this.createNode();
          this.expectKeyword('break');
          let t = null;
          if (3 === this.lookahead.type && !this.hasLineTerminator) {
            const e = this.parseVariableIdentifier(),
              n = '$' + e.name;
            Object.prototype.hasOwnProperty.call(this.context.labelSet, n) ||
              this.throwError(ti, e.name),
              (t = e);
          }
          return (
            this.consumeSemicolon(),
            null !== t ||
              this.context.inIteration ||
              this.context.inSwitch ||
              this.throwError('Illegal break statement'),
            this.finalize(e, new li(t))
          );
        }
        parseReturnStatement() {
          this.context.inFunctionBody || this.tolerateError('Illegal return statement');
          const e = this.createNode();
          this.expectKeyword('return');
          const t =
            (this.match(';') ||
              this.match('}') ||
              this.hasLineTerminator ||
              2 === this.lookahead.type) &&
            8 !== this.lookahead.type &&
            10 !== this.lookahead.type
              ? null
              : this.parseExpression();
          return this.consumeSemicolon(), this.finalize(e, new Ni(t));
        }
        parseLabelledStatement() {
          const e = this.createNode(),
            t = this.parseExpression();
          let n;
          return this.consumeSemicolon(), (n = new mi(t)), this.finalize(e, n);
        }
        parseStatementBlockAllowed() {
          return this.parseStatement(!0);
        }
        parseStatement(e = !1) {
          let t;
          switch (this.lookahead.type) {
            case 1:
            case 5:
            case 6:
            case 8:
            case 10:
            case 9:
              t = this.parseExpressionStatement();
              break;
            case 7: {
              const n = this.lookahead.value;
              t =
                '{' === n
                  ? e
                    ? this.parseBlockOrObjectInitialiser()
                    : this.parseObjectInitializer()
                  : '(' === n
                  ? this.parseExpressionStatement()
                  : ';' === n
                  ? this.parseEmptyStatement()
                  : this.parseExpressionStatement();
              break;
            }
            case 3:
              t = this.parseLabelledStatement();
              break;
            case 4:
              switch (this.lookahead.value.toLowerCase()) {
                case 'break':
                  t = this.parseBreakStatement();
                  break;
                case 'continue':
                  t = this.parseContinueStatement();
                  break;
                case 'for':
                  t = this.parseForStatement();
                  break;
                case 'function':
                  t = this.parseFunctionDeclaration();
                  break;
                case 'if':
                  t = this.parseIfStatement();
                  break;
                case 'return':
                  t = this.parseReturnStatement();
                  break;
                case 'var':
                  t = this.parseVariableStatement();
                  break;
                default:
                  t = this.parseExpressionStatement();
              }
              break;
            default:
              t = this.throwUnexpectedToken(this.lookahead);
          }
          return t;
        }
        parseFunctionSourceElements() {
          const e = this.createNode();
          this.expect('{');
          const t = [],
            n = this.context.labelSet,
            r = this.context.inIteration,
            i = this.context.inSwitch,
            s = this.context.inFunctionBody;
          for (
            this.context.labelSet = {},
              this.context.inIteration = !1,
              this.context.inSwitch = !1,
              this.context.inFunctionBody = !0;
            2 !== this.lookahead.type && !this.match('}');

          )
            t.push(this.parseStatementListItem());
          return (
            this.expect('}'),
            (this.context.labelSet = n),
            (this.context.inIteration = r),
            (this.context.inSwitch = i),
            (this.context.inFunctionBody = s),
            this.finalize(e, new ui(t))
          );
        }
        validateParam(e, t, n) {
          const r = '$' + n;
          this.context.strict
            ? (this.scanner.isRestrictedWord(n) && ((e.stricted = t), (e.message = Xr)),
              Object.prototype.hasOwnProperty.call(e.paramSet, r) &&
                ((e.stricted = t), (e.message = Jr)))
            : e.firstRestricted ||
              (this.scanner.isRestrictedWord(n)
                ? ((e.firstRestricted = t), (e.message = Xr))
                : this.scanner.isStrictModeReservedWord(n)
                ? ((e.firstRestricted = t), (e.message = Wr))
                : Object.prototype.hasOwnProperty.call(e.paramSet, r) &&
                  ((e.stricted = t), (e.message = Jr))),
            'function' == typeof Object.defineProperty
              ? Object.defineProperty(e.paramSet, r, {
                  value: !0,
                  enumerable: !0,
                  writable: !0,
                  configurable: !0,
                })
              : (e.paramSet[r] = !0);
        }
        parseFormalParameter(e) {
          const t = [],
            n = this.parsePatternWithDefault(t);
          for (let n = 0; n < t.length; n++) this.validateParam(e, t[n], t[n].value);
          (e.simple = e.simple && n instanceof xi), e.params.push(n);
        }
        parseFormalParameters(e) {
          const t = { simple: !0, params: [], firstRestricted: e };
          if ((this.expect('('), !this.match(')')))
            for (
              t.paramSet = {};
              2 !== this.lookahead.type &&
              (this.parseFormalParameter(t), !this.match(')')) &&
              (this.expect(','), !this.match(')'));

            );
          return (
            this.expect(')'),
            {
              simple: t.simple,
              params: t.params,
              stricted: t.stricted,
              firstRestricted: t.firstRestricted,
              message: t.message,
            }
          );
        }
        parseFunctionDeclaration(e) {
          const t = this.createNode();
          let n;
          this.expectKeyword('function');
          let r = null,
            i = null;
          if (!e || !this.match('(')) {
            const e = this.lookahead;
            (r = this.parseVariableIdentifier()),
              this.context.strict
                ? this.scanner.isRestrictedWord(e.value) && this.tolerateUnexpectedToken(e, qr)
                : this.scanner.isRestrictedWord(e.value)
                ? ((i = e), (n = qr))
                : this.scanner.isStrictModeReservedWord(e.value) && ((i = e), (n = Wr));
          }
          const s = this.parseFormalParameters(i),
            o = s.params,
            a = s.stricted;
          (i = s.firstRestricted), s.message && (n = s.message);
          const u = this.context.strict,
            l = this.context.allowStrictDirective;
          this.context.allowStrictDirective = s.simple;
          const c = this.parseFunctionSourceElements();
          return (
            this.context.strict && i && this.throwUnexpectedToken(i, n),
            this.context.strict && a && this.tolerateUnexpectedToken(a, n),
            (this.context.strict = u),
            (this.context.allowStrictDirective = l),
            this.finalize(t, new yi(r, o, c, !1))
          );
        }
        parseFunctionExpression() {
          const e = this.createNode();
          let t;
          this.expectKeyword('function');
          let n,
            r = null;
          if (!this.match('(')) {
            const e = this.lookahead;
            (r = this.parseVariableIdentifier()),
              this.context.strict
                ? this.scanner.isRestrictedWord(e.value) && this.tolerateUnexpectedToken(e, qr)
                : this.scanner.isRestrictedWord(e.value)
                ? ((n = e), (t = qr))
                : this.scanner.isStrictModeReservedWord(e.value) && ((n = e), (t = Wr));
          }
          const i = this.parseFormalParameters(n),
            s = i.params,
            o = i.stricted;
          (n = i.firstRestricted), i.message && (t = i.message);
          const a = this.context.strict,
            u = this.context.allowStrictDirective;
          this.context.allowStrictDirective = i.simple;
          const l = this.parseFunctionSourceElements();
          return (
            this.context.strict && n && this.throwUnexpectedToken(n, t),
            this.context.strict && o && this.tolerateUnexpectedToken(o, t),
            (this.context.strict = a),
            (this.context.allowStrictDirective = u),
            this.finalize(e, new Ei(r, s, l, !1))
          );
        }
        qualifiedPropertyName(e) {
          switch (e.type) {
            case 3:
            case 8:
            case 1:
            case 5:
            case 6:
            case 4:
              return !0;
            case 7:
              return '[' === e.value;
          }
          return !1;
        }
        isStartOfExpression() {
          let e = !0;
          const t = this.lookahead.value;
          switch (this.lookahead.type) {
            case 7:
              e =
                '[' === t ||
                '(' === t ||
                '{' === t ||
                '+' === t ||
                '-' === t ||
                '!' === t ||
                '~' === t ||
                '++' === t ||
                '--' === t ||
                '/' === t ||
                '/=' === t;
              break;
            case 4:
              e =
                'class' === t ||
                'delete' === t ||
                'function' === t ||
                'let' === t ||
                'new' === t ||
                'super' === t ||
                'this' === t ||
                'typeof' === t ||
                'void' === t ||
                'yield' === t;
          }
          return e;
        }
        parseScript() {
          const e = this.createNode(),
            t = [];
          for (; 2 !== this.lookahead.type; ) t.push(this.parseStatementListItem());
          return this.finalize(e, new Si(t));
        }
      }
      function ji(e, t, n) {
        let r = null;
        const i = (e, t) => {
          n && n(e, t), r && r.visit(e, t);
        };
        let s = 'function' == typeof n ? i : null,
          o = !1;
        if (t) {
          o = 'boolean' == typeof t.comment && t.comment;
          const e = 'boolean' == typeof t.attachComment && t.attachComment;
          (o || e) && ((r = new Gr()), (r.attach = e), (t.comment = !0), (s = i));
        }
        const a = new zi(e, t, s),
          u = a.parseScript();
        return (
          o && r && (u.comments = r.comments),
          a.config.tokens && (u.tokens = a.tokens),
          a.config.tolerant && (u.errors = a.errorHandler.errors),
          u
        );
      }
      function Vi(e, t = []) {
        const n = ji('function _() { ' + e + '\n}');
        if (null === n.body || void 0 === n.body) throw new Error('No formula provided.');
        if (0 === n.body.length) throw new Error('No formula provided.');
        if (0 === n.body.length) throw new Error('No formula provided.');
        if ('BlockStatement' !== n.body[0].body.type) throw new Error('Invalid formula content.');
        const r = pt(n);
        if ('' !== r) throw new Error(r);
        return Et(n, t), n;
      }
      function Yi(e, t, n, r, i) {
        const s = [],
          o = 'function _() { \n'.length - 1,
          a = 'function _() { \n' + e + '\n}';
        try {
          const e = ji(a, { tolerant: !0, loc: !0, range: !0 }),
            u = e.errors;
          if (u.length > 0)
            for (let e = 0; e < u.length; e++)
              s.push({
                line: u[e].lineNumber - 2,
                character: u[e].column,
                reason: u[e].description,
              });
          const l = (function (e, t, n, r = 'async', i = $e) {
            const s = [];
            if ('BlockStatement' !== e.body[0].body.type)
              return [{ line: 0, character: 0, reason: 'Invalid Body' }];
            null == t && (t = { vars: {}, customFunctions: [] });
            const o = { globalScope: ft(t.vars, i, t.customFunctions, r), localScope: null };
            try {
              Dt(e.body[0].body, o, n, s);
            } catch (e) {}
            return s;
          })(e, t, n, r, i);
          for (let e = 0; e < l.length; e++)
            (l[e].line = l[e].line - 2),
              l[e].range && (l[e].range = [l[e][0] - o, l[e][1] - o]),
              l[e].loc &&
                ((l[e].loc.start.line = l[e].loc.start.line - 2),
                (l[e].loc.end.line = l[e].loc.end.line - 2)),
              s.push(l[e]);
        } catch (e) {
          try {
            if ('Unexpected token }' === e.description) {
              const t = a.split('\n').length;
              e.lineNumber === t
                ? ((e.index = a.length - 1),
                  s.push({
                    line: e.lineNumber - 4,
                    character: e.column,
                    reason: 'Unexpected end of script',
                  }))
                : ((e.index = a.length - 1),
                  s.push({
                    line: e.lineNumber - 2,
                    character: e.column,
                    reason: 'Unexpected end of script',
                  }));
            } else s.push({ line: e.lineNumber - 2, character: e.column, reason: e.description });
          } catch (e) {}
        }
        return s;
      }
      const qi = [
          'feature',
          'angle',
          'bearing',
          'centroid',
          'envelopeintersects',
          'extent',
          'geometry',
          'isselfintersecting',
          'ringisclockwise',
        ],
        Hi = (function () {
          if ((0, h.h)('csp-restrictions')) return !1;
          try {
            return new Function('function* test() {}; return true')();
          } catch (e) {
            return !1;
          }
        })();
      let Ji = !1,
        Xi = !1,
        Wi = null,
        Ki = [];
      function $i(e, t) {
        return !0 === t.useAsync || !0 === e.isAsync
          ? (function (e, t) {
              if (null === Wi) throw new Error('Async Arcade must be enabled for this script');
              return (0, h.h)('csp-restrictions') || !1 === Hi
                ? function (t) {
                    return Wi.executeScript(e, t);
                  }
                : ur(e, t, !0);
            })(e, t)
          : (0, h.h)('csp-restrictions')
          ? function (t) {
              return Nr(e, t);
            }
          : ur(e, t);
      }
      function Qi(e, t = []) {
        return Vi(e, t);
      }
      function es(e, t) {
        if (!0 === t.useAsync || !0 === e.isAsync) {
          if (null === Wi) throw new Error('Async Arcade must be enabled for this script');
          return Wi.executeScript(e, t);
        }
        return Nr(e, t);
      }
      function ts(e, t) {
        return (function (e, t) {
          return ut(e, t);
        })(e, t);
      }
      function ns(e, t = !1) {
        return (function (e, t) {
          return ct(e);
        })(e);
      }
      function rs(e, t = []) {
        return void 0 === e.usesGeometry && Et(e, t), !0 === e.usesGeometry;
      }
      let is = null;
      function ss() {
        return (
          is ||
          ((is = (0, i.$6)([
            Promise.all([n.e(3361), n.e(9077)]).then(n.bind(n, 19077)),
            Promise.resolve().then(function () {
              return qt;
            }),
          ]).then(([e, t]) => ((Xi = !0), t.setGeometryEngine(e), !0))),
          is)
        );
      }
      let os = null;
      function as() {
        return (
          null !== os ||
            (os = n
              .e(9052)
              .then(n.bind(n, 39052))
              .then((e) => (rr([e], 'async'), !0))
              .then(() => Promise.all([n.e(9052), n.e(5501)]).then(n.bind(n, 95501)))
              .then((e) => {
                Wi = e;
                for (const e of Ki) Wi.extend(e), rr(e, 'async');
                return (Ki = null), !0;
              })),
          os
        );
      }
      function us() {
        return Ji;
      }
      function ls() {
        return !!Wi;
      }
      function cs() {
        return Xi;
      }
      let hs = null;
      function fs() {
        return (
          hs ||
          ((hs = as().then(() =>
            (0, i.$6)([
              Promise.all([
                n.e(4851),
                n.e(135),
                n.e(6748),
                n.e(5959),
                n.e(208),
                n.e(1292),
                n.e(3770),
                n.e(8824),
                n.e(2274),
                n.e(9506),
                n.e(1503),
                n.e(5754),
                n.e(5528),
                n.e(2256),
                n.e(874),
              ])
                .then(n.bind(n, 97944))
                .then(function (e) {
                  return e.n;
                }),
              Promise.all([
                n.e(4851),
                n.e(135),
                n.e(6748),
                n.e(5959),
                n.e(208),
                n.e(1292),
                n.e(3770),
                n.e(8824),
                n.e(2274),
                n.e(9506),
                n.e(1503),
                n.e(5754),
                n.e(5528),
                n.e(2256),
                n.e(874),
                n.e(332),
              ]).then(n.bind(n, 60332)),
              Promise.all([n.e(2274), n.e(2256), n.e(5073)]).then(n.bind(n, 32727)),
              Promise.all([n.e(2274), n.e(9263)]).then(n.bind(n, 9263)),
              n.e(3092).then(n.bind(n, 93092)),
            ]).then(
              ([e, t, n, r, i]) => (
                (gs = e), Wi.extend([t, n, r, i]), rr([t, n, r, i], 'async'), (Ji = !0), !0
              ),
            ),
          )),
          hs)
        );
      }
      function ds(e, t = []) {
        return void 0 === e.usesFeatureSet && Et(e, t), !0 === e.usesFeatureSet;
      }
      function ps(e, t, n = [], r = !1) {
        return (0, i.Ue)((s, o) => {
          const a = 'string' == typeof e ? Qi(e) : e,
            u = [];
          u.push(ys()),
            a &&
              (!1 === cs() && (rs(a) || r) && u.push(ss()),
              !1 === ls() && (!0 === a.isAsync || t) && u.push(as()),
              !1 === us() &&
                (ds(a) ||
                  (function (e, t) {
                    if (t) {
                      for (const n of t) if (ts(e, n)) return !0;
                      return !1;
                    }
                    return !1;
                  })(a, n)) &&
                u.push(fs())),
            u
              ? (0, i.$6)(u).then(() => {
                  s(!0);
                }, o)
              : s(!0);
        });
      }
      function ms(e) {
        if (rs(e)) return !0;
        const t = yt(e);
        let n = !1;
        for (let e = 0; e < t.length; e++)
          if (qi.indexOf(t[e]) > -1) {
            n = !0;
            break;
          }
        return n;
      }
      let gs = null;
      function Ds() {
        return gs;
      }
      function ys() {
        return null !== Es || (Es = (0, y.l)().then((e) => ((be.Moment = e), !0))), Es;
      }
      let Es = null;
      var xs = Object.freeze({
        __proto__: null,
        compileScript: $i,
        extend: function (e) {
          !(function (e) {
            const t = {
              mode: 'sync',
              compiled: !1,
              functions: {},
              signatures: [],
              standardFunction: lr,
              evaluateIdentifier: mr,
              arcadeCustomFunctionHandler: Cr,
            };
            for (let n = 0; n < e.length; n++) e[n].registerFunctions(t);
            for (const e in t.functions)
              (gr[e] = { value: new I(t.functions[e]), valueset: !0, node: null }),
                (Fr.prototype[e] = gr[e]);
            for (let e = 0; e < t.signatures.length; e++) tt(t.signatures[e], 'async');
          })(e),
            rr(e, 'sync'),
            null === Wi ? Ki.push(e) : (rr(e, 'async'), Wi.extend(e));
        },
        parseScript: Qi,
        validateScript: function (e, t, n = '') {
          return (function (e, t, n) {
            return dt(e, t, n);
          })(e, t, n);
        },
        scriptCheck: function (e, t, n, r = '') {
          return Yi(e, t, n, r);
        },
        parseAndExecuteScript: function (e, t, n = []) {
          return es(Vi(e, n), t);
        },
        executeScript: es,
        referencesMember: ts,
        referencesFunction: function (e, t) {
          return (function (e, t) {
            return lt(e, t);
          })(e, t);
        },
        extractFieldLiterals: ns,
        scriptUsesGeometryEngine: rs,
        enableGeometrySupport: ss,
        enableAsyncSupport: as,
        isFeatureSetSupportEnabled: us,
        isAsyncEnabled: ls,
        isGeometryEnabled: cs,
        enableFeatureSetSupport: fs,
        scriptUsesFeatureSet: ds,
        scriptIsAsync: function (e, t = []) {
          return void 0 === e.isAsync && Et(e, t), !0 === e.isAsync;
        },
        loadScriptDependencies: ps,
        scriptTouchesGeometry: ms,
        featureSetUtils: Ds,
        load: ys,
      });
      const As = /^\$feature\./i,
        ws = { vars: { $feature: 'any', $view: 'any' }, spatialReference: null };
      function Cs(e) {
        if (!e) return null;
        try {
          return Qi(e);
        } catch (e) {}
        return null;
      }
      function Fs(e, t) {
        if (!e) return !1;
        if ('string' == typeof e) return t(e);
        const n = e;
        if (
          'simple' === (r = n).type ||
          'class-breaks' === r.type ||
          'unique-value' === r.type ||
          'dot-density' === r.type ||
          'dictionary' === r.type
        ) {
          if ('dot-density' === n.type) {
            const e = n.attributes.some((e) => t(e.valueExpression));
            if (e) return e;
          }
          const e = n.visualVariables,
            r =
              !!e &&
              e.some((e) => {
                let n = t(e.valueExpression);
                return (
                  'size' === e.type &&
                    ((0, E.i)(e.minSize) && (n = n || t(e.minSize.valueExpression)),
                    (0, E.i)(e.maxSize) && (n = n || t(e.maxSize.valueExpression))),
                  n
                );
              });
          return !(!('valueExpression' in n) || !t(n.valueExpression)) || r;
        }
        var r;
        if ('esri.layers.support.LabelClass' === n.declaredClass) {
          const e = n.labelExpressionInfo && n.labelExpressionInfo.expression;
          return !(!e || !t(e)) || !1;
        }
        return (
          'esri.PopupTemplate' === n.declaredClass &&
          !!n.expressionInfos &&
          n.expressionInfos.some((e) => t(e.expression))
        );
      }
      function bs(e) {
        const t = Cs(e);
        return !!t && ms(t);
      }
      function Ns(e) {
        const t = Cs(e);
        return !!t && rs(t);
      }
      var Ss = Object.freeze({
        __proto__: null,
        createSyntaxTree: Cs,
        createFunction: function (e, t) {
          const n = 'string' == typeof e ? Cs(e) : e;
          if (!n) return null;
          try {
            return $i(n, (t = t || (0, h.d9)(ws)));
          } catch (e) {}
          return null;
        },
        createExecContext: function (e, t) {
          return {
            vars: { $feature: null == e ? new Ke() : Ke.createFromGraphic(e), $view: t && t.view },
            spatialReference: t && t.sr,
          };
        },
        createFeature: function (e, t, n) {
          return Ke.createFromGraphicLikeObject(t, e, n);
        },
        updateExecContext: function (e, t) {
          e.vars.$feature = t;
        },
        evalSyntaxTree: function (e, t) {
          let n;
          try {
            n = es(e, t);
          } catch (e) {
            n = null;
          }
          return n;
        },
        executeFunction: function (e, t) {
          let n;
          try {
            n = e ? e(t) : null;
          } catch (e) {
            n = null;
          }
          return n;
        },
        executeAsyncFunction: function (e, t) {
          try {
            return e ? e(t) : Promise.resolve(null);
          } catch (e) {
            return Promise.resolve(null);
          }
        },
        extractFieldNames: function (e) {
          if (!e) return [];
          const t = 'string' == typeof e ? Cs(e) : e;
          if (!t) return [];
          const n = ns(t),
            r = new Array();
          return (
            n.forEach((e) => {
              As.test(e) && ((e = e.replace(As, '')), r.push(e));
            }),
            r.sort(),
            r.filter((e, t) => 0 === t || r[t - 1] !== e)
          );
        },
        dependsOnView: function (e) {
          return ts(e, '$view');
        },
        hasVariable: function (e, t) {
          return !!e && ts(e, t);
        },
        getViewInfo: function (e) {
          if (e && (null != e.spatialReference || (null != e.scale && null != e.viewingMode)))
            return {
              view:
                e.viewingMode && null != e.scale
                  ? new _e({ viewingMode: e.viewingMode, scale: e.scale })
                  : null,
              sr: e.spatialReference,
            };
        },
        convertServiceUrlToWorkspace: function (e, t) {
          const n = Ds();
          return n ? n.createFeatureSetCollectionFromService(e, t) : null;
        },
        convertFeatureLayerToFeatureSet: function (e, t) {
          if (null === e) return null;
          const n = Ds();
          return n ? n.constructFeatureSet(e, t) : null;
        },
        convertMapToFeatureSetCollection: function (e) {
          if (null === e || null === e.map) return null;
          const t = Ds();
          return t ? t.createFeatureSetCollectionFromMap(e.map, e.spatialReference) : null;
        },
        loadScriptDependencies: function (e, t, n = []) {
          return ps(e, t, n);
        },
        enableGeometryOperations: function () {
          return ss();
        },
        enableFeatureSetOperations: function () {
          return fs();
        },
        hasGeometryFunctions: function (e) {
          return Fs(e, bs);
        },
        hasGeometryOperations: function (e) {
          return Fs(e, Ns);
        },
        arcade: xs,
        arcadeFeature: Ke,
        Dictionary: _e,
      });
    },
    71331: (e, t, n) => {
      'use strict';
      function r(e, t) {
        return e ? (t ? 4 : 3) : t ? 3 : 2;
      }
      function i(e, t, n, i, c) {
        if (!t || !t.lengths.length) return null;
        const h = 'upperLeft' === (null == c ? void 0 : c.originPosition) ? -1 : 1;
        e.lengths.length && (e.lengths.length = 0), e.coords.length && (e.coords.length = 0);
        const f = e.coords,
          d = [],
          p = n
            ? [
                Number.POSITIVE_INFINITY,
                Number.NEGATIVE_INFINITY,
                Number.POSITIVE_INFINITY,
                Number.NEGATIVE_INFINITY,
                Number.POSITIVE_INFINITY,
                Number.NEGATIVE_INFINITY,
              ]
            : [
                Number.POSITIVE_INFINITY,
                Number.NEGATIVE_INFINITY,
                Number.POSITIVE_INFINITY,
                Number.NEGATIVE_INFINITY,
              ],
          { lengths: m, coords: g } = t,
          D = r(n, i);
        let y = 0;
        for (const e of m) {
          const t = s(p, g, y, e, n, i, h);
          t && d.push(t), (y += e * D);
        }
        if (
          (d.sort((e, t) => {
            let r = h * e[2] - h * t[2];
            return 0 === r && n && (r = e[4] - t[4]), r;
          }),
          d.length)
        ) {
          let e = 6 * d[0][2];
          (f[0] = d[0][0] / e),
            (f[1] = d[0][1] / e),
            n && ((e = 6 * d[0][4]), (f[2] = 0 !== e ? d[0][3] / e : 0)),
            (f[0] < p[0] ||
              f[0] > p[1] ||
              f[1] < p[2] ||
              f[1] > p[3] ||
              (n && (f[2] < p[4] || f[2] > p[5]))) &&
              (f.length = 0);
        }
        if (!f.length) {
          const e = t.lengths[0]
            ? (function (e, t, n, i, s) {
                const c = r(i, s);
                let h = 0,
                  f = 0 + c,
                  d = 0,
                  p = 0,
                  m = 0,
                  g = 0;
                for (let t = 0, r = n - 1; t < r; t++, h += c, f += c) {
                  const t = e[h],
                    n = e[h + 1],
                    r = e[h + 2],
                    s = e[f],
                    c = e[f + 1],
                    D = e[f + 2],
                    y = i ? a(t, n, r, s, c, D) : o(t, n, s, c);
                  if (y)
                    if (((d += y), i)) {
                      const e = l(t, n, r, s, c, D);
                      (p += y * e[0]), (m += y * e[1]), (g += y * e[2]);
                    } else {
                      const e = u(t, n, s, c);
                      (p += y * e[0]), (m += y * e[1]);
                    }
                }
                return d > 0
                  ? i
                    ? [p / d, m / d, g / d]
                    : [p / d, m / d]
                  : n > 0
                  ? i
                    ? [e[0], e[1], e[2]]
                    : [e[0], e[1]]
                  : null;
              })(g, 0, m[0], n, i)
            : null;
          if (!e) return null;
          (f[0] = e[0]), (f[1] = e[1]), n && e.length > 2 && (f[2] = e[2]);
        }
        return e;
      }
      function s(e, t, n, i, s, o, a = 1) {
        const u = r(s, o);
        let l = n,
          c = n + u,
          h = 0,
          f = 0,
          d = 0,
          p = 0,
          m = 0;
        for (let n = 0, r = i - 1; n < r; n++, l += u, c += u) {
          const n = t[l],
            r = t[l + 1],
            i = t[l + 2],
            o = t[c],
            a = t[c + 1],
            u = t[c + 2];
          let g = n * a - o * r;
          (p += g),
            (h += (n + o) * g),
            (f += (r + a) * g),
            s && ((g = n * u - o * i), (d += (i + u) * g), (m += g)),
            n < e[0] && (e[0] = n),
            n > e[1] && (e[1] = n),
            r < e[2] && (e[2] = r),
            r > e[3] && (e[3] = r),
            s && (i < e[4] && (e[4] = i), i > e[5] && (e[5] = i));
        }
        if ((p * a > 0 && (p *= -1), m * a > 0 && (m *= -1), !p)) return null;
        const g = [h, f, 0.5 * p];
        return s && ((g[3] = d), (g[4] = 0.5 * m)), g;
      }
      function o(e, t, n, r) {
        const i = n - e,
          s = r - t;
        return Math.sqrt(i * i + s * s);
      }
      function a(e, t, n, r, i, s) {
        const o = r - e,
          a = i - t,
          u = s - n;
        return Math.sqrt(o * o + a * a + u * u);
      }
      function u(e, t, n, r) {
        return [e + 0.5 * (n - e), t + 0.5 * (r - t)];
      }
      function l(e, t, n, r, i, s) {
        return [e + 0.5 * (r - e), t + 0.5 * (i - t), n + 0.5 * (s - n)];
      }
      n.d(t, { g: () => i });
    },
    40267: (e, t, n) => {
      'use strict';
      n.d(t, {
        a: () => V,
        b: () => Z,
        c: () => z,
        e: () => R,
        f: () => x,
        g: () => $,
        h: () => X,
        i: () => _,
        j: () => B,
        k: () => v,
        l: () => q,
        m: () => Y,
        n: () => L,
        o: () => G,
        p: () => U,
        q: () => J,
        r: () => ee,
        s: () => H,
        t: () => g,
        u: () => Q,
        v: () => D,
        w: () => ne,
        z: () => re,
      });
      var r = n(60991),
        i = n(92143),
        s = n(32422),
        o = n(85674),
        a = n(9006);
      function u(e, t) {
        return e ? (t ? 4 : 3) : t ? 3 : 2;
      }
      const l = i.L.getLogger('esri.tasks.support.optimizedFeatureSet'),
        c = {
          esriGeometryPoint: 0,
          esriGeometryPolyline: 2,
          esriGeometryPolygon: 3,
          esriGeometryMultipoint: 0,
        },
        h = (e, t, n, r, i, s) => {
          (e[n] = i), (e[n + 1] = s);
        },
        f = (e, t, n, r, i, s) => {
          (e[n] = i), (e[n + 1] = s), (e[n + 2] = t[r + 2]);
        },
        d = (e, t, n, r, i, s) => {
          (e[n] = i), (e[n + 1] = s), (e[n + 2] = t[r + 3]);
        },
        p = (e, t, n, r, i, s) => {
          (e[n] = i), (e[n + 1] = s), (e[n + 2] = t[r + 2]), (e[n + 3] = t[r + 3]);
        };
      function m(e, t, n, r) {
        if (e) {
          if (n) return t && r ? p : f;
          if (t && r) return d;
        } else if (t && r) return f;
        return h;
      }
      function g({ scale: e, translate: t }, n) {
        return Math.round((n - t[0]) / e[0]);
      }
      function D({ scale: e, translate: t }, n) {
        return Math.round((t[1] - n) / e[1]);
      }
      function y({ scale: e, translate: t }, n) {
        return n * e[0] + t[0];
      }
      function E({ scale: e, translate: t }, n) {
        return t[1] - n * e[1];
      }
      function x(e, t, n) {
        return e ? (t ? (n ? S(e) : C(e)) : n ? b(e) : A(e)) : null;
      }
      function A(e) {
        const t = e.coords;
        return { x: t[0], y: t[1] };
      }
      function w(e, t) {
        return (e.coords[0] = t.x), (e.coords[1] = t.y), e;
      }
      function C(e) {
        const t = e.coords;
        return { x: t[0], y: t[1], z: t[2] };
      }
      function F(e, t) {
        return (e.coords[0] = t.x), (e.coords[1] = t.y), (e.coords[2] = t.z), e;
      }
      function b(e) {
        const t = e.coords;
        return { x: t[0], y: t[1], m: t[2] };
      }
      function N(e, t) {
        return (e.coords[0] = t.x), (e.coords[1] = t.y), (e.coords[2] = t.m), e;
      }
      function S(e) {
        const t = e.coords;
        return { x: t[0], y: t[1], z: t[2], m: t[3] };
      }
      function I(e, t) {
        return (
          (e.coords[0] = t.x), (e.coords[1] = t.y), (e.coords[2] = t.z), (e.coords[3] = t.m), e
        );
      }
      function T(e, t) {
        return e && t ? I : e ? F : t ? N : w;
      }
      function v(e, t, n) {
        if (!e) return null;
        const r = u(t, n),
          i = [];
        for (let t = 0; t < e.coords.length; t += r) {
          const n = [];
          for (let i = 0; i < r; i++) n.push(e.coords[t + i]);
          i.push(n);
        }
        return t
          ? n
            ? { points: i, hasZ: t, hasM: n }
            : { points: i, hasZ: t }
          : n
          ? { points: i, hasM: n }
          : { points: i };
      }
      function k(e, t, n = u(t.hasZ, t.hasM)) {
        e.lengths[0] = t.points.length;
        const r = e.coords;
        let i = 0;
        for (const e of t.points) for (let t = 0; t < n; t++) r[i++] = e[t];
        return e;
      }
      function _(e, t, n) {
        if (!e) return null;
        const r = u(t, n),
          { coords: i, lengths: s } = e,
          o = [];
        let a = 0;
        for (const e of s) {
          const t = [];
          for (let n = 0; n < e; n++) {
            const e = [];
            for (let t = 0; t < r; t++) e.push(i[a++]);
            t.push(e);
          }
          o.push(t);
        }
        return t
          ? n
            ? { paths: o, hasZ: t, hasM: n }
            : { paths: o, hasZ: t }
          : n
          ? { paths: o, hasM: n }
          : { paths: o };
      }
      function O(e, t, n = u(t.hasZ, t.hasM)) {
        const { lengths: r, coords: i } = e;
        let s = 0;
        for (const e of t.paths) {
          for (const t of e) for (let e = 0; e < n; e++) i[s++] = t[e];
          r.push(e.length);
        }
        return e;
      }
      function B(e, t, n) {
        if (!e) return null;
        const r = u(t, n),
          { coords: i, lengths: s } = e,
          o = [];
        let a = 0;
        for (const e of s) {
          const t = [];
          for (let n = 0; n < e; n++) {
            const e = [];
            for (let t = 0; t < r; t++) e.push(i[a++]);
            t.push(e);
          }
          o.push(t);
        }
        return t
          ? n
            ? { rings: o, hasZ: t, hasM: n }
            : { rings: o, hasZ: t }
          : n
          ? { rings: o, hasM: n }
          : { rings: o };
      }
      function R(e, t, n = t.hasZ, r = t.hasM) {
        return (
          (function (e, t, n, r) {
            const i = u(n, r),
              { lengths: s, coords: o } = e;
            let a = 0;
            s.length = o.length = 0;
            for (const e of t) {
              for (const t of e) for (let e = 0; e < i; e++) o[a++] = t[e];
              s.push(e.length);
            }
          })(e, t.rings, n, r),
          e
        );
      }
      const M = [],
        P = [];
      function U(e, t, n, r, i) {
        M[0] = e;
        const [s] = L(P, M, t, n, r, i);
        return (M.length = P.length = 0), s;
      }
      function L(e, t, n, i, s, a) {
        if (((e.length = 0), !n)) {
          for (const n of t) {
            const t = n.attributes[a];
            e.push(new o.O(null, n.attributes, null, t));
          }
          return e;
        }
        switch (n) {
          case 'esriGeometryPoint':
            return (function (e, t, n, r, i) {
              const s = T(n, r);
              for (const n of t) {
                const { geometry: t, attributes: r } = n;
                let a;
                t && (a = s(new o.a(), t)), e.push(new o.O(a, r, null, r[i]));
              }
              return e;
            })(e, t, i, s, a);
          case 'esriGeometryMultipoint':
            return (function (e, t, n, r, i) {
              const s = u(n, r);
              for (const n of t) {
                const t = n.geometry,
                  r = n.attributes;
                let a;
                t && (a = k(new o.a(), t, s)), e.push(new o.O(a, r, null, r[i]));
              }
              return e;
            })(e, t, i, s, a);
          case 'esriGeometryPolyline':
            return (function (e, t, n, r, i) {
              const s = u(n, r);
              for (const n of t) {
                const t = n.geometry,
                  r = n.attributes;
                let a;
                t && (a = O(new o.a(), t, s)), e.push(new o.O(a, r, null, r[i]));
              }
              return e;
            })(e, t, i, s, a);
          case 'esriGeometryPolygon':
            return (function (e, t, n, r, i) {
              for (const s of t) {
                const t = s.geometry,
                  a = s.centroid,
                  u = s.attributes;
                let l;
                t && (l = R(new o.a(), t, n, r)),
                  a
                    ? e.push(new o.O(l, u, w(new o.a(), a), u[i]))
                    : e.push(new o.O(l, u, null, u[i]));
              }
              return e;
            })(e, t, i, s, a);
          default:
            l.error(
              'convertToFeatureSet:unknown-geometry',
              new r.Z(`Unable to parse unknown geometry type '${n}'`),
            ),
              (e.length = 0);
        }
        return e;
      }
      function G(e, t, n, r) {
        (P[0] = e), j(M, P, t, n, r);
        const i = M[0];
        return (M.length = P.length = 0), i;
      }
      function Z(e, t, n) {
        if (!e) return null;
        const i = new o.a();
        return (
          'hasZ' in e && null == t && (t = e.hasZ),
          'hasM' in e && null == n && (n = e.hasM),
          (0, s.wp)(e)
            ? T(null != t ? t : null != e.z, null != n ? n : null != e.m)(i, e)
            : (0, s.oU)(e)
            ? R(i, e, t, n)
            : (0, s.l9)(e)
            ? O(i, e, u(t, n))
            : (0, s.aW)(e)
            ? k(i, e, u(t, n))
            : void l.error(
                'convertFromGeometry:unknown-geometry',
                new r.Z(`Unable to parse unknown geometry type '${e}'`),
              )
        );
      }
      function z(e, t, n, i) {
        const s = e && ('coords' in e ? e : e.geometry);
        if (!s) return null;
        switch (t) {
          case 'esriGeometryPoint': {
            let e = A;
            return n && i ? (e = S) : n ? (e = C) : i && (e = b), e(s);
          }
          case 'esriGeometryMultipoint':
            return v(s, n, i);
          case 'esriGeometryPolyline':
            return _(s, n, i);
          case 'esriGeometryPolygon':
            return B(s, n, i);
          default:
            return void l.error(
              'convertToGeometry:unknown-geometry',
              new r.Z(`Unable to parse unknown geometry type '${t}'`),
            );
        }
      }
      function j(e, t, n, i, s) {
        switch (((e.length = 0), n)) {
          case 'esriGeometryPoint':
            return (function (e, t, n, r) {
              let i = A;
              n && r ? (i = S) : n ? (i = C) : r && (i = b);
              for (const n of t) {
                const { geometry: t, attributes: r } = n,
                  s = t ? i(t) : null;
                e.push({ attributes: r, geometry: s });
              }
              return e;
            })(e, t, i, s);
          case 'esriGeometryMultipoint':
            return (function (e, t, n, r) {
              for (const i of t) {
                const { geometry: t, attributes: s } = i;
                let o;
                t && (o = v(t, n, r)), e.push({ attributes: s, geometry: o });
              }
              return e;
            })(e, t, i, s);
          case 'esriGeometryPolyline':
            return (function (e, t, n, r) {
              for (const i of t) {
                const { geometry: t, attributes: s } = i;
                let o;
                t && (o = _(t, n, r)), e.push({ attributes: s, geometry: o });
              }
              return e;
            })(e, t, i, s);
          case 'esriGeometryPolygon':
            return (function (e, t, n, r) {
              for (const i of t) {
                const { geometry: t, attributes: s, centroid: o } = i;
                let a;
                if ((t && (a = B(t, n, r)), o)) {
                  const t = A(o);
                  e.push({ attributes: s, centroid: t, geometry: a });
                } else e.push({ attributes: s, geometry: a });
              }
              return e;
            })(e, t, i, s);
          default:
            l.error(
              'convertToFeatureSet:unknown-geometry',
              new r.Z(`Unable to parse unknown geometry type '${n}'`),
            );
        }
        return e;
      }
      function V(e) {
        const {
            objectIdFieldName: t,
            spatialReference: n,
            transform: r,
            fields: i,
            hasM: s,
            hasZ: o,
            features: a,
            geometryType: u,
            exceededTransferLimit: l,
            uniqueIdField: c,
            queryGeometry: h,
            queryGeometryType: f,
          } = e,
          d = {
            features: j([], a, u, o, s),
            fields: i,
            geometryType: u,
            objectIdFieldName: t,
            spatialReference: n,
            uniqueIdField: c,
            queryGeometry: z(h, f, !1, !1),
          };
        return (
          r && (d.transform = r),
          l && (d.exceededTransferLimit = l),
          s && (d.hasM = s),
          o && (d.hasZ = o),
          d
        );
      }
      function Y(e, t) {
        const n = new a.O(),
          {
            hasM: i,
            hasZ: s,
            features: o,
            objectIdFieldName: u,
            spatialReference: c,
            geometryType: h,
            exceededTransferLimit: f,
            transform: d,
            fields: p,
          } = e;
        return (
          p && (n.fields = p),
          (n.geometryType = h),
          (n.objectIdFieldName = u || t),
          (n.spatialReference = c),
          n.objectIdFieldName
            ? (o && L(n.features, o, h, s, i, n.objectIdFieldName),
              f && (n.exceededTransferLimit = f),
              i && (n.hasM = i),
              s && (n.hasZ = s),
              d && (n.transform = d),
              n)
            : (l.error(
                new r.Z(
                  'optimized-features:invalid-objectIdFieldName',
                  'objectIdFieldName is missing',
                ),
              ),
              n)
        );
      }
      function q(e) {
        const { transform: t, features: n, hasM: r, hasZ: i } = e;
        if (!t) return e;
        for (const e of n)
          e.geometry && Q(e.geometry, e.geometry, r, i, t),
            e.centroid && Q(e.centroid, e.centroid, r, i, t);
        return (e.transform = null), e;
      }
      function H(e, t) {
        const { geometryType: n, features: r, hasM: i, hasZ: s } = t;
        if (!e) return t;
        for (let t = 0; t < r.length; t++) {
          const a = r[t],
            u = a.weakClone();
          (u.geometry = new o.a()),
            J(u.geometry, a.geometry, i, s, n, e),
            a.centroid &&
              ((u.centroid = new o.a()), J(u.centroid, a.centroid, i, s, 'esriGeometryPoint', e)),
            (r[t] = u);
        }
        return (t.transform = e), t;
      }
      function J(e, t, n, r, i, s, o = n, a = r) {
        if (
          (e.lengths.length && (e.lengths.length = 0),
          e.coords.length && (e.coords.length = 0),
          !t || !t.coords.length)
        )
          return null;
        const l = c[i],
          { coords: h, lengths: f } = t,
          d = u(n, r),
          p = u(n && o, r && a),
          y = m(n, r, o, a);
        if (!f.length)
          return (
            y(e.coords, h, 0, 0, g(s, h[0]), D(s, h[1])),
            e.lengths.length && (e.lengths.length = 0),
            (e.coords.length = d),
            e
          );
        let E,
          x,
          A,
          w,
          C = 0,
          F = 0,
          b = F;
        for (const t of f) {
          if (t < l) continue;
          let n = 0;
          (F = b),
            (A = E = g(s, h[C])),
            (w = x = D(s, h[C + 1])),
            y(e.coords, h, F, C, A, w),
            n++,
            (C += d),
            (F += p);
          for (let r = 1; r < t; r++, C += d)
            (A = g(s, h[C])),
              (w = D(s, h[C + 1])),
              (A === E && w === x) ||
                (y(e.coords, h, F, C, A - E, w - x), (F += p), n++, (E = A), (x = w));
          n >= l && (e.lengths.push(n), (b = F));
        }
        return (e.coords.length = b), e.coords.length ? e : null;
      }
      function X(e, t, n, r, i, s, o = n, a = r) {
        if (
          (e.lengths.length && (e.lengths.length = 0),
          e.coords.length && (e.coords.length = 0),
          !t || !t.coords.length)
        )
          return null;
        const l = c[i],
          { coords: h, lengths: f } = t,
          d = u(n, r),
          p = u(n && o, r && a),
          g = m(n, r, o, a);
        if (!f.length)
          return (
            g(e.coords, h, 0, 0, h[0], h[1]),
            e.lengths.length && (e.lengths.length = 0),
            (e.coords.length = d),
            e
          );
        let D = 0;
        const y = s * s;
        for (const t of f) {
          if (t < l) {
            D += t * d;
            continue;
          }
          const n = e.coords.length / p,
            r = D,
            i = D + (t - 1) * d;
          g(e.coords, h, e.coords.length, r, h[r], h[r + 1]),
            K(e.coords, h, d, y, g, r, i),
            g(e.coords, h, e.coords.length, i, h[i], h[i + 1]);
          const s = e.coords.length / p - n;
          s >= l ? e.lengths.push(s) : (e.coords.length = n * p), (D += t * d);
        }
        return e.coords.length ? e : null;
      }
      function W(e, t, n, r) {
        const i = e[t],
          s = e[t + 1],
          o = e[n],
          a = e[n + 1],
          u = e[r],
          l = e[r + 1];
        let c = o,
          h = a,
          f = u - c,
          d = l - h;
        if (0 !== f || 0 !== d) {
          const e = ((i - c) * f + (s - h) * d) / (f * f + d * d);
          e > 1 ? ((c = u), (h = l)) : e > 0 && ((c += f * e), (h += d * e));
        }
        return (f = i - c), (d = s - h), f * f + d * d;
      }
      function K(e, t, n, r, i, s, o) {
        let a,
          u = r,
          l = 0;
        for (let e = s + n; e < o; e += n) (a = W(t, e, s, o)), a > u && ((l = e), (u = a));
        u > r &&
          (l - s > n && K(e, t, n, r, i, s, l),
          i(e, t, e.length, l, t[l], t[l + 1]),
          o - l > n && K(e, t, n, r, i, l, o));
      }
      function $(e, t, n, r) {
        if (!t || !t.coords || !t.coords.length) return null;
        const i = u(n, r);
        let s = Number.POSITIVE_INFINITY,
          o = Number.POSITIVE_INFINITY,
          a = Number.NEGATIVE_INFINITY,
          l = Number.NEGATIVE_INFINITY;
        if (t && t.coords) {
          const e = t.coords;
          for (let t = 0; t < e.length; t += i) {
            const n = e[t],
              r = e[t + 1];
            (s = Math.min(s, n)), (a = Math.max(a, n)), (o = Math.min(o, r)), (l = Math.max(l, r));
          }
        }
        return (e[0] = s), (e[1] = o), (e[2] = a), (e[3] = l), e;
      }
      function Q(e, t, n, r, i) {
        const { coords: s, lengths: o } = t,
          a = n ? (r ? p : f) : r ? f : h,
          l = u(n, r);
        if (!s.length) return e !== t && ((e.lengths.length = 0), (e.coords.length = 0)), e;
        if (!o.length)
          return (
            a(e.coords, s, 0, 0, y(i, s[0]), E(i, s[1])),
            e !== t && ((e.lengths.length = 0), (e.coords.length = l)),
            e
          );
        const [c, d] = i.scale;
        let m = 0;
        for (let t = 0; t < o.length; t++) {
          const n = o[t];
          e.lengths[t] = n;
          let r = y(i, s[m]),
            u = E(i, s[m + 1]);
          a(e.coords, s, m, m, r, u), (m += l);
          for (let t = 1; t < n; t++, m += l)
            (r += s[m] * c), (u -= s[m + 1] * d), a(e.coords, s, m, m, r, u);
        }
        return e !== t && ((e.lengths.length = o.length), (e.coords.length = s.length)), e;
      }
      function ee(e, t, n, r, i, s) {
        const o = u(n, r),
          a = m(n, r, i, s),
          l = t.coords;
        (e.coords.length = 0), (e.lengths.length = 0), e.lengths.push(...t.lengths);
        for (let t = 0; t < l.length; t += o) a(e.coords, l, e.coords.length, t, l[t], l[t + 1]);
        return e;
      }
      function te(e, t, n, r) {
        let i = 0,
          s = e[r * t],
          o = e[r * (t + 1)];
        for (let a = 1; a < n; a++) {
          const n = s + e[r * (t + a)],
            u = o + e[r * (t + a) + 1],
            l = (n - s) * (u + o);
          (s = n), (o = u), (i += l);
        }
        return 0.5 * i;
      }
      function ne(e, t) {
        const { coords: n, lengths: r } = e;
        let i = 0,
          s = 0;
        for (let e = 0; e < r.length; e++) (s += te(n, i, r[e], t)), (i += e);
        return Math.abs(s);
      }
      function re(e, t) {
        const n = e.clone(),
          r = e.coords,
          i = e.lengths;
        let s = 0;
        for (let e = 0; e < i.length; e++) {
          const o = i[e];
          let a = r[t * s],
            u = r[t * s + 1];
          for (let e = 1; e < o; e++) {
            const i = a + r[t * (s + e)],
              o = u + r[t * (s + e) + 1];
            (n.coords[t * (s + e)] = i), (n.coords[t * (s + e) + 1] = o), (a = i), (u = o);
          }
          s += o;
        }
        return n;
      }
    },
    54732: (e, t, n) => {
      'use strict';
      n.d(t, { k: () => r });
      const r = new (n(57251).J)({
        esriFieldTypeSmallInteger: 'small-integer',
        esriFieldTypeInteger: 'integer',
        esriFieldTypeSingle: 'single',
        esriFieldTypeDouble: 'double',
        esriFieldTypeLong: 'long',
        esriFieldTypeString: 'string',
        esriFieldTypeDate: 'date',
        esriFieldTypeOID: 'oid',
        esriFieldTypeGeometry: 'geometry',
        esriFieldTypeBlob: 'blob',
        esriFieldTypeRaster: 'raster',
        esriFieldTypeGUID: 'guid',
        esriFieldTypeGlobalID: 'global-id',
        esriFieldTypeXML: 'xml',
      });
    },
    3482: (e, t, n) => {
      'use strict';
      n.d(t, { b: () => p, g: () => c, o: () => f });
      var r,
        i,
        s,
        o = n(76506);
      let a;
      const u =
        null != (r = null == (i = o.g.esriConfig) ? void 0 : i.locale)
          ? r
          : null == (s = o.g.dojoConfig)
          ? void 0
          : s.locale;
      function l() {
        var e, t;
        return null != (e = null != u ? u : null == (t = o.g.navigator) ? void 0 : t.language)
          ? e
          : 'en';
      }
      function c() {
        return void 0 === a && (a = l()), a;
      }
      const h = [];
      function f(e) {
        return (
          h.push(e),
          {
            remove() {
              h.splice(h.indexOf(e), 1);
            },
          }
        );
      }
      const d = [];
      function p(e) {
        return (
          d.push(e),
          {
            remove() {
              h.splice(d.indexOf(e), 1);
            },
          }
        );
      }
      null == o.g.addEventListener ||
        o.g.addEventListener('languagechange', function () {
          const e = null != undefined ? undefined : l();
          a !== e &&
            ((a = e),
            [...d].forEach((t) => {
              t.call(null, e);
            }),
            [...h].forEach((t) => {
              t.call(null, e);
            }));
        });
    },
    92228: (e, t, n) => {
      'use strict';
      n.d(t, { l: () => s });
      var r = n(3482);
      const i = new Map([
        [
          'ar',
          () =>
            Promise.all([n.e(4385), n.e(1594)])
              .then(n.bind(n, 41594))
              .then(function (e) {
                return e.a;
              }),
        ],
        [
          'ar-dz',
          () =>
            Promise.all([n.e(4385), n.e(2570)])
              .then(n.bind(n, 12570))
              .then(function (e) {
                return e.a;
              }),
        ],
        [
          'ar-kw',
          () =>
            Promise.all([n.e(4385), n.e(7903)])
              .then(n.bind(n, 7903))
              .then(function (e) {
                return e.a;
              }),
        ],
        [
          'ar-ly',
          () =>
            Promise.all([n.e(4385), n.e(6854)])
              .then(n.bind(n, 76854))
              .then(function (e) {
                return e.a;
              }),
        ],
        [
          'ar-ma',
          () =>
            Promise.all([n.e(4385), n.e(4824)])
              .then(n.bind(n, 54824))
              .then(function (e) {
                return e.a;
              }),
        ],
        [
          'ar-sa',
          () =>
            Promise.all([n.e(4385), n.e(4936)])
              .then(n.bind(n, 74936))
              .then(function (e) {
                return e.a;
              }),
        ],
        [
          'ar-tn',
          () =>
            Promise.all([n.e(4385), n.e(2829)])
              .then(n.bind(n, 42829))
              .then(function (e) {
                return e.a;
              }),
        ],
        [
          'bs',
          () =>
            Promise.all([n.e(4385), n.e(7657)])
              .then(n.bind(n, 77657))
              .then(function (e) {
                return e.b;
              }),
        ],
        [
          'ca',
          () =>
            Promise.all([n.e(4385), n.e(5527)])
              .then(n.bind(n, 45527))
              .then(function (e) {
                return e.c;
              }),
        ],
        [
          'cs',
          () =>
            Promise.all([n.e(4385), n.e(8293)])
              .then(n.bind(n, 38293))
              .then(function (e) {
                return e.c;
              }),
        ],
        [
          'da',
          () =>
            Promise.all([n.e(4385), n.e(522)])
              .then(n.bind(n, 60522))
              .then(function (e) {
                return e.d;
              }),
        ],
        [
          'de',
          () =>
            Promise.all([n.e(4385), n.e(8991)])
              .then(n.bind(n, 18991))
              .then(function (e) {
                return e.d;
              }),
        ],
        [
          'de-at',
          () =>
            Promise.all([n.e(4385), n.e(3554)])
              .then(n.bind(n, 93554))
              .then(function (e) {
                return e.d;
              }),
        ],
        [
          'de-ch',
          () =>
            Promise.all([n.e(4385), n.e(2740)])
              .then(n.bind(n, 62740))
              .then(function (e) {
                return e.d;
              }),
        ],
        [
          'el',
          () =>
            Promise.all([n.e(4385), n.e(5230)])
              .then(n.bind(n, 85230))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'en-au',
          () =>
            Promise.all([n.e(4385), n.e(1991)])
              .then(n.bind(n, 61991))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'en-ca',
          () =>
            Promise.all([n.e(4385), n.e(4075)])
              .then(n.bind(n, 34075))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'en-gb',
          () =>
            Promise.all([n.e(4385), n.e(8944)])
              .then(n.bind(n, 88944))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'en-ie',
          () =>
            Promise.all([n.e(4385), n.e(631)])
              .then(n.bind(n, 50631))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'en-il',
          () =>
            Promise.all([n.e(4385), n.e(4509)])
              .then(n.bind(n, 4509))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'en-in',
          () =>
            Promise.all([n.e(4385), n.e(17)])
              .then(n.bind(n, 40017))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'en-nz',
          () =>
            Promise.all([n.e(4385), n.e(4459)])
              .then(n.bind(n, 4459))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'en-sg',
          () =>
            Promise.all([n.e(4385), n.e(2011)])
              .then(n.bind(n, 52011))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'es',
          () =>
            Promise.all([n.e(4385), n.e(572)])
              .then(n.bind(n, 50572))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'es-do',
          () =>
            Promise.all([n.e(4385), n.e(8819)])
              .then(n.bind(n, 78819))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'es-mx',
          () =>
            Promise.all([n.e(4385), n.e(7442)])
              .then(n.bind(n, 7442))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'es-us',
          () =>
            Promise.all([n.e(4385), n.e(2168)])
              .then(n.bind(n, 42168))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'et',
          () =>
            Promise.all([n.e(4385), n.e(4801)])
              .then(n.bind(n, 84801))
              .then(function (e) {
                return e.e;
              }),
        ],
        [
          'fi',
          () =>
            Promise.all([n.e(4385), n.e(8615)])
              .then(n.bind(n, 48615))
              .then(function (e) {
                return e.f;
              }),
        ],
        [
          'fr',
          () =>
            Promise.all([n.e(4385), n.e(9218)])
              .then(n.bind(n, 29218))
              .then(function (e) {
                return e.f;
              }),
        ],
        [
          'fr-ca',
          () =>
            Promise.all([n.e(4385), n.e(2206)])
              .then(n.bind(n, 82206))
              .then(function (e) {
                return e.f;
              }),
        ],
        [
          'fr-ch',
          () =>
            Promise.all([n.e(4385), n.e(9930)])
              .then(n.bind(n, 19930))
              .then(function (e) {
                return e.f;
              }),
        ],
        [
          'he',
          () =>
            Promise.all([n.e(4385), n.e(5728)])
              .then(n.bind(n, 65728))
              .then(function (e) {
                return e.h;
              }),
        ],
        [
          'hr',
          () =>
            Promise.all([n.e(4385), n.e(5122)])
              .then(n.bind(n, 75122))
              .then(function (e) {
                return e.h;
              }),
        ],
        [
          'hu',
          () =>
            Promise.all([n.e(4385), n.e(3344)])
              .then(n.bind(n, 83344))
              .then(function (e) {
                return e.h;
              }),
        ],
        [
          'id',
          () =>
            Promise.all([n.e(4385), n.e(2772)])
              .then(n.bind(n, 52772))
              .then(function (e) {
                return e.i;
              }),
        ],
        [
          'it',
          () =>
            Promise.all([n.e(4385), n.e(4396)])
              .then(n.bind(n, 24396))
              .then(function (e) {
                return e.i;
              }),
        ],
        [
          'it-ch',
          () =>
            Promise.all([n.e(4385), n.e(9032)])
              .then(n.bind(n, 19032))
              .then(function (e) {
                return e.i;
              }),
        ],
        [
          'ja',
          () =>
            Promise.all([n.e(4385), n.e(8710)])
              .then(n.bind(n, 38710))
              .then(function (e) {
                return e.j;
              }),
        ],
        [
          'ko',
          () =>
            Promise.all([n.e(4385), n.e(9716)])
              .then(n.bind(n, 79716))
              .then(function (e) {
                return e.k;
              }),
        ],
        [
          'lt',
          () =>
            Promise.all([n.e(4385), n.e(7612)])
              .then(n.bind(n, 27612))
              .then(function (e) {
                return e.l;
              }),
        ],
        [
          'lv',
          () =>
            Promise.all([n.e(4385), n.e(4378)])
              .then(n.bind(n, 34378))
              .then(function (e) {
                return e.l;
              }),
        ],
        [
          'nb',
          () =>
            Promise.all([n.e(4385), n.e(1648)])
              .then(n.bind(n, 31648))
              .then(function (e) {
                return e.n;
              }),
        ],
        [
          'nl',
          () =>
            Promise.all([n.e(4385), n.e(605)])
              .then(n.bind(n, 20605))
              .then(function (e) {
                return e.n;
              }),
        ],
        [
          'nl-be',
          () =>
            Promise.all([n.e(4385), n.e(7318)])
              .then(n.bind(n, 57318))
              .then(function (e) {
                return e.n;
              }),
        ],
        [
          'pl',
          () =>
            Promise.all([n.e(4385), n.e(6175)])
              .then(n.bind(n, 6175))
              .then(function (e) {
                return e.p;
              }),
        ],
        [
          'pt',
          () =>
            Promise.all([n.e(4385), n.e(935)])
              .then(n.bind(n, 20935))
              .then(function (e) {
                return e.p;
              }),
        ],
        [
          'pt-br',
          () =>
            Promise.all([n.e(4385), n.e(9588)])
              .then(n.bind(n, 49588))
              .then(function (e) {
                return e.p;
              }),
        ],
        [
          'ro',
          () =>
            Promise.all([n.e(4385), n.e(3717)])
              .then(n.bind(n, 13717))
              .then(function (e) {
                return e.r;
              }),
        ],
        [
          'ru',
          () =>
            Promise.all([n.e(4385), n.e(5269)])
              .then(n.bind(n, 55269))
              .then(function (e) {
                return e.r;
              }),
        ],
        [
          'sk',
          () =>
            Promise.all([n.e(4385), n.e(3442)])
              .then(n.bind(n, 43442))
              .then(function (e) {
                return e.s;
              }),
        ],
        [
          'sl',
          () =>
            Promise.all([n.e(4385), n.e(5796)])
              .then(n.bind(n, 55796))
              .then(function (e) {
                return e.s;
              }),
        ],
        [
          'sr',
          () =>
            Promise.all([n.e(4385), n.e(7585)])
              .then(n.bind(n, 97585))
              .then(function (e) {
                return e.s;
              }),
        ],
        [
          'sr-cyrl',
          () =>
            Promise.all([n.e(4385), n.e(6776)])
              .then(n.bind(n, 76776))
              .then(function (e) {
                return e.s;
              }),
        ],
        [
          'sv',
          () =>
            Promise.all([n.e(4385), n.e(2255)])
              .then(n.bind(n, 12255))
              .then(function (e) {
                return e.s;
              }),
        ],
        [
          'th',
          () =>
            Promise.all([n.e(4385), n.e(1210)])
              .then(n.bind(n, 61210))
              .then(function (e) {
                return e.t;
              }),
        ],
        [
          'tr',
          () =>
            Promise.all([n.e(4385), n.e(6046)])
              .then(n.bind(n, 46046))
              .then(function (e) {
                return e.t;
              }),
        ],
        [
          'uk',
          () =>
            Promise.all([n.e(4385), n.e(3318)])
              .then(n.bind(n, 63318))
              .then(function (e) {
                return e.u;
              }),
        ],
        [
          'vi',
          () =>
            Promise.all([n.e(4385), n.e(7802)])
              .then(n.bind(n, 67802))
              .then(function (e) {
                return e.v;
              }),
        ],
        [
          'zh-cn',
          () =>
            Promise.all([n.e(4385), n.e(3685)])
              .then(n.bind(n, 43685))
              .then(function (e) {
                return e.z;
              }),
        ],
        [
          'zh-hk',
          () =>
            Promise.all([n.e(4385), n.e(1511)])
              .then(n.bind(n, 41511))
              .then(function (e) {
                return e.z;
              }),
        ],
        [
          'zh-mo',
          () =>
            Promise.all([n.e(4385), n.e(3579)])
              .then(n.bind(n, 73579))
              .then(function (e) {
                return e.z;
              }),
        ],
        [
          'zh-tw',
          () =>
            Promise.all([n.e(4385), n.e(3172)])
              .then(n.bind(n, 99214))
              .then(function (e) {
                return e.z;
              }),
        ],
      ]);
      async function s(e = (0, r.g)()) {
        const t = (
          await n
            .e(4385)
            .then(n.bind(n, 34385))
            .then(function (e) {
              return e.m;
            })
        ).default;
        e = e.toLowerCase();
        let s = i.has(e);
        if (!s) {
          const t = e.split('-');
          t.length > 1 && i.has(t[0]) && ((e = t[0]), (s = !0));
        }
        return s ? await i.get(e)() : (e = 'en'), e !== t.locale() && t.locale(e), t;
      }
    },
    56240: (e, t, n) => {
      'use strict';
      n.d(t, { _: () => l, f: () => a, p: () => c });
      var r = n(40642),
        i = n(3482);
      const s = {
        ar: ['.', ','],
        bs: [',', '.'],
        ca: [',', '.'],
        cs: [',', ' '],
        da: [',', '.'],
        de: [',', '.'],
        'de-ch': ['.', '’'],
        el: [',', '.'],
        en: ['.', ','],
        'en-au': ['.', ','],
        es: [',', '.'],
        'es-mx': ['.', ','],
        et: [',', ' '],
        fi: [',', ' '],
        fr: [',', ' '],
        'fr-ch': [',', ' '],
        he: ['.', ','],
        hi: ['.', ',', '#,##,##0.###'],
        hr: [',', '.'],
        hu: [',', ' '],
        id: [',', '.'],
        it: [',', '.'],
        'it-ch': ['.', '’'],
        ja: ['.', ','],
        ko: ['.', ','],
        lt: [',', ' '],
        lv: [',', ' '],
        mk: [',', '.'],
        nb: [',', ' '],
        nl: [',', '.'],
        pl: [',', ' '],
        pt: [',', '.'],
        'pt-pt': [',', ' '],
        ro: [',', '.'],
        ru: [',', ' '],
        sk: [',', ' '],
        sl: [',', '.'],
        sr: [',', '.'],
        sv: [',', ' '],
        th: ['.', ','],
        tr: [',', '.'],
        uk: [',', ' '],
        vi: [',', '.'],
        zh: ['.', ','],
      };
      function o(e) {
        e || (e = (0, i.g)());
        let t = e in s;
        if (!t) {
          const n = e.split('-');
          n.length > 1 && n[0] in s && ((e = n[0]), (t = !0)), t || (e = 'en');
        }
        const [n, r, o = '#,##0.###'] = s[e];
        return { decimal: n, group: r, pattern: o };
      }
      function a(e, t) {
        const n = o((t = { ...t }).locale);
        t.customs = n;
        const r = t.pattern || n.pattern;
        return isNaN(e) || Math.abs(e) === 1 / 0
          ? null
          : (function (e, t, n) {
              const r = (n = n || {}).customs.group,
                i = n.customs.decimal,
                s = t.split(';'),
                o = s[0];
              if (-1 !== (t = s[e < 0 ? 1 : 0] || '-' + o).indexOf('%')) e *= 100;
              else if (-1 !== t.indexOf('‰')) e *= 1e3;
              else {
                if (-1 !== t.indexOf('¤')) throw new Error('currency notation not supported');
                if (-1 !== t.indexOf('E')) throw new Error('exponential notation not supported');
              }
              const a = u,
                l = o.match(a);
              if (!l) throw new Error('unable to find a number expression in pattern: ' + t);
              return (
                !1 === n.fractional && (n.places = 0),
                t.replace(
                  a,
                  (function (e, t, n) {
                    !0 === (n = n || {}).places && (n.places = 0),
                      n.places === 1 / 0 && (n.places = 6);
                    const r = t.split('.'),
                      i = 'string' == typeof n.places && n.places.indexOf(',');
                    let s = n.places;
                    i ? (s = n.places.substring(i + 1)) : s >= 0 || (s = (r[1] || []).length),
                      n.round < 0 || (e = Number(e.toFixed(Number(s))));
                    const o = String(Math.abs(e)).split('.'),
                      a = o[1] || '';
                    if (r[1] || n.places) {
                      i && (n.places = n.places.substring(0, i));
                      const e = void 0 !== n.places ? n.places : r[1] && r[1].lastIndexOf('0') + 1;
                      e > a.length && (o[1] = a.padEnd(Number(e), '0')),
                        s < a.length && (o[1] = a.substr(0, Number(s)));
                    } else o[1] && o.pop();
                    const u = r[0].replace(',', '');
                    let l = u.indexOf('0');
                    -1 !== l &&
                      ((l = u.length - l),
                      l > o[0].length && (o[0] = o[0].padStart(l, '0')),
                      -1 === u.indexOf('#') && (o[0] = o[0].substr(o[0].length - l)));
                    let c,
                      h,
                      f = r[0].lastIndexOf(',');
                    if (-1 !== f) {
                      c = r[0].length - f - 1;
                      const e = r[0].substr(0, f);
                      (f = e.lastIndexOf(',')), -1 !== f && (h = e.length - f - 1);
                    }
                    const d = [];
                    for (let e = o[0]; e; ) {
                      const t = e.length - c;
                      d.push(t > 0 ? e.substr(t) : e),
                        (e = t > 0 ? e.slice(0, t) : ''),
                        h && ((c = h), (h = void 0));
                    }
                    return (o[0] = d.reverse().join(n.group || ',')), o.join(n.decimal || '.');
                  })(e, l[0], { decimal: i, group: r, places: n.places, round: n.round }),
                )
              );
            })(e, r, t);
      }
      const u = /[#0,]*[#0](?:\.0*#*)?/;
      function l(e) {
        const t = o((e = e || {}).locale),
          n = e.pattern || t.pattern,
          i = t.group,
          s = t.decimal;
        let a = 1;
        if (-1 !== n.indexOf('%')) a /= 100;
        else if (-1 !== n.indexOf('‰')) a /= 1e3;
        else if (-1 !== n.indexOf('¤')) throw new Error('currency notation not supported');
        const l = n.split(';');
        return (
          1 === l.length && l.push('-' + l[0]),
          {
            regexp: f(
              l,
              function (t) {
                return (t = '(?:' + (0, r.e)(t, '.') + ')').replace(u, function (t) {
                  const n = {
                      signed: !1,
                      separator: e.strict ? i : [i, ''],
                      fractional: e.fractional,
                      decimal: s,
                      exponent: !1,
                    },
                    r = t.split('.');
                  let o = e.places;
                  1 === r.length && 1 !== a && (r[1] = '###'),
                    1 === r.length || 0 === o
                      ? (n.fractional = !1)
                      : (void 0 === o && (o = e.pattern ? r[1].lastIndexOf('0') + 1 : 1 / 0),
                        o && null == e.fractional && (n.fractional = !0),
                        !e.places && o < r[1].length && (o += ',' + r[1].length),
                        (n.places = o));
                  const u = r[0].split(',');
                  return (
                    u.length > 1 &&
                      ((n.groupSize = u.pop().length),
                      u.length > 1 && (n.groupSize2 = u.pop().length)),
                    '(' +
                      (function (e) {
                        'places' in (e = e || {}) || (e.places = 1 / 0),
                          'string' != typeof e.decimal && (e.decimal = '.'),
                          ('fractional' in e && !/^0/.test(String(e.places))) ||
                            (e.fractional = [!0, !1]),
                          'exponent' in e || (e.exponent = [!0, !1]),
                          'eSigned' in e || (e.eSigned = [!0, !1]);
                        const t = h(e),
                          n = f(
                            e.fractional,
                            function (t) {
                              let n = '';
                              return (
                                t &&
                                  0 !== e.places &&
                                  ((n = '\\' + e.decimal),
                                  e.places === 1 / 0
                                    ? (n = '(?:' + n + '\\d+)?')
                                    : (n += '\\d{' + e.places + '}')),
                                n
                              );
                            },
                            !0,
                          );
                        let r = t + n;
                        return (
                          n && (r = '(?:(?:' + r + ')|(?:' + n + '))'),
                          r +
                            f(e.exponent, function (t) {
                              return t ? '([eE]' + h({ signed: e.eSigned }) + ')' : '';
                            })
                        );
                      })(n) +
                      ')'
                  );
                });
              },
              !0,
            ).replace(/[\xa0 ]/g, '[\\s\\xa0]'),
            group: i,
            decimal: s,
            factor: a,
          }
        );
      }
      function c(e, t) {
        const n = l(t),
          r = new RegExp('^' + n.regexp + '$').exec(e);
        if (!r) return NaN;
        let i = r[1];
        if (!r[1]) {
          if (!r[2]) return NaN;
          (i = r[2]), (n.factor *= -1);
        }
        return (
          (i = i.replace(new RegExp('[' + n.group + '\\s\\xa0]', 'g'), '').replace(n.decimal, '.')),
          Number(i) * n.factor
        );
      }
      function h(e) {
        return (
          'signed' in (e = e || {}) || (e.signed = [!0, !1]),
          'separator' in e ? 'groupSize' in e || (e.groupSize = 3) : (e.separator = ''),
          f(
            e.signed,
            function (e) {
              return e ? '[-+]' : '';
            },
            !0,
          ) +
            f(
              e.separator,
              function (t) {
                if (!t) return '(?:\\d+)';
                ' ' === (t = (0, r.e)(t)) ? (t = '\\s') : ' ' === t && (t = '\\s\\xa0');
                const n = e.groupSize,
                  i = e.groupSize2;
                if (i) {
                  const e =
                    '(?:0|[1-9]\\d{0,' +
                    (i - 1) +
                    '}(?:[' +
                    t +
                    ']\\d{' +
                    i +
                    '})*[' +
                    t +
                    ']\\d{' +
                    n +
                    '})';
                  return n - i > 0 ? '(?:' + e + '|(?:0|[1-9]\\d{0,' + (n - 1) + '}))' : e;
                }
                return '(?:0|[1-9]\\d{0,' + (n - 1) + '}(?:[' + t + ']\\d{' + n + '})*)';
              },
              !0,
            )
        );
      }
      const f = function (e, t, n) {
          if (!(e instanceof Array)) return t(e);
          const r = [];
          for (let n = 0; n < e.length; n++) r.push(t(e[n]));
          return d(r.join('|'), n);
        },
        d = function (e, t) {
          return '(' + (t ? '?:' : '') + e + ')';
        };
    },
    52228: (e, t, n) => {
      'use strict';
      function r(e) {
        return e && 'esri.renderers.visualVariables.SizeVariable' === e.declaredClass;
      }
      function i(e) {
        return null != e && !isNaN(e) && isFinite(e);
      }
      function s(e) {
        return e.valueExpression
          ? 'expression'
          : e.field && 'string' == typeof e.field
          ? 'field'
          : 'unknown';
      }
      function o(e, t) {
        const n = t || s(e),
          r = e.valueUnit || 'unknown';
        return 'unknown' === n
          ? 'constant'
          : e.stops
          ? 'stops'
          : null != e.minSize &&
            null != e.maxSize &&
            null != e.minDataValue &&
            null != e.maxDataValue
          ? 'clamped-linear'
          : 'unknown' === r
          ? null != e.minSize && null != e.minDataValue
            ? e.minSize && e.minDataValue
              ? 'proportional'
              : 'additive'
            : 'identity'
          : 'real-world-size';
      }
      n.d(t, { a: () => o, b: () => i, g: () => s, i: () => r });
    },
    97546: (e, t, n) => {
      'use strict';
      n.d(t, { Z: () => g });
      var r,
        i = n(29768),
        s = n(57251),
        o = n(74673),
        a = n(34250),
        u = (n(76506), n(91306)),
        l = (n(92143), n(59465)),
        c = n(97714),
        h = n(17533),
        f = n(9801),
        d = n(54732);
      n(71552),
        n(21972),
        n(23639),
        n(86656),
        n(22723),
        n(91055),
        n(27794),
        n(6906),
        n(50406),
        n(60991),
        n(81172),
        n(31450),
        n(40642),
        n(26341),
        n(53523),
        n(42911),
        n(46826),
        n(45433);
      const p = new s.J({
        binary: 'binary',
        coordinate: 'coordinate',
        countOrAmount: 'count-or-amount',
        dateAndTime: 'date-and-time',
        description: 'description',
        locationOrPlaceName: 'location-or-place-name',
        measurement: 'measurement',
        nameOrTitle: 'name-or-title',
        none: 'none',
        orderedOrRanked: 'ordered-or-ranked',
        percentageOrRatio: 'percentage-or-ratio',
        typeOrCategory: 'type-or-category',
        uniqueIdentifier: 'unique-identifier',
      });
      let m = (r = class extends o.a {
        constructor(e) {
          super(e),
            (this.alias = null),
            (this.defaultValue = void 0),
            (this.description = null),
            (this.domain = null),
            (this.editable = !0),
            (this.length = -1),
            (this.name = null),
            (this.nullable = !0),
            (this.type = null),
            (this.valueType = null);
        }
        readDescription(e, { description: t }) {
          let n;
          try {
            n = JSON.parse(t);
          } catch (e) {}
          return n ? n.value : null;
        }
        readValueType(e, { description: t }) {
          let n;
          try {
            n = JSON.parse(t);
          } catch (e) {}
          return n ? p.fromJSON(n.fieldValueType) : null;
        }
        clone() {
          return new r({
            alias: this.alias,
            defaultValue: this.defaultValue,
            description: this.description,
            domain: (this.domain && this.domain.clone()) || null,
            editable: this.editable,
            length: this.length,
            name: this.name,
            nullable: this.nullable,
            type: this.type,
            valueType: this.valueType,
          });
        }
      });
      (0, i._)([(0, a.Cb)({ type: String, json: { write: !0 } })], m.prototype, 'alias', void 0),
        (0, i._)(
          [(0, a.Cb)({ type: [String, Number], json: { write: { allowNull: !0 } } })],
          m.prototype,
          'defaultValue',
          void 0,
        ),
        (0, i._)([(0, a.Cb)()], m.prototype, 'description', void 0),
        (0, i._)([(0, c.r)('description')], m.prototype, 'readDescription', null),
        (0, i._)(
          [(0, a.Cb)({ types: f.t, json: { read: { reader: f.f }, write: !0 } })],
          m.prototype,
          'domain',
          void 0,
        ),
        (0, i._)(
          [(0, a.Cb)({ type: Boolean, json: { write: !0 } })],
          m.prototype,
          'editable',
          void 0,
        ),
        (0, i._)([(0, a.Cb)({ type: u.I, json: { write: !0 } })], m.prototype, 'length', void 0),
        (0, i._)([(0, a.Cb)({ type: String, json: { write: !0 } })], m.prototype, 'name', void 0),
        (0, i._)(
          [(0, a.Cb)({ type: Boolean, json: { write: !0 } })],
          m.prototype,
          'nullable',
          void 0,
        ),
        (0, i._)([(0, l.e)(d.k)], m.prototype, 'type', void 0),
        (0, i._)([(0, a.Cb)()], m.prototype, 'valueType', void 0),
        (0, i._)([(0, c.r)('valueType', ['description'])], m.prototype, 'readValueType', null),
        (m = r = (0, i._)([(0, h.j)('esri.layers.support.Field')], m));
      const g = m;
    },
  },
]);
