(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [6913, 9214],
  {
    31712: (e, t, s) => {
      'use strict';
      s.d(t, { C: () => i });
      var r = s(76506);
      class i {
        constructor(e = Number.POSITIVE_INFINITY) {
          (this.size = 0),
            (this._start = 0),
            (this.maxSize = e),
            (this._buffer = isFinite(e) ? new Array(e) : []);
        }
        get entries() {
          return this._buffer;
        }
        enqueue(e) {
          if (this.size === this.maxSize) {
            const t = this._buffer[this._start];
            return (
              (this._buffer[this._start] = e), (this._start = (this._start + 1) % this.maxSize), t
            );
          }
          return (
            isFinite(this.maxSize)
              ? (this._buffer[(this._start + this.size++) % this.maxSize] = e)
              : (this._buffer[this._start + this.size++] = e),
            null
          );
        }
        dequeue() {
          if (0 === this.size) return null;
          const e = this._buffer[this._start];
          return (
            (this._buffer[this._start] = null),
            this.size--,
            (this._start = (this._start + 1) % this.maxSize),
            e
          );
        }
        peek() {
          return 0 === this.size ? null : this._buffer[this._start];
        }
        find(e) {
          if (0 === this.size) return null;
          for (const t of this._buffer) if ((0, r.i)(t) && e(t)) return t;
          return null;
        }
        clear(e) {
          let t = this.dequeue();
          for (; (0, r.i)(t); ) e && e(t), (t = this.dequeue());
        }
      }
    },
    21929: (e, t, s) => {
      'use strict';
      s.d(t, { F: () => c, S: () => h }), s(74569);
      var r = s(76506),
        i = s(71331),
        n = s(40267),
        o = s(85674),
        a = s(32422);
      class h {
        constructor(e, t) {
          (this._mask = 0), (this._buf = e), (this._mask = t);
        }
        static fromBuffer(e, t) {
          return new h(e, t);
        }
        static create(e, t = 4294967295) {
          const s = new Uint32Array(Math.ceil(e / 32));
          return new h(s, 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 s = e,
            r = t;
          for (; s % 32 && s !== r; ) {
            if (this.has(s)) return !0;
            s++;
          }
          for (; r % 32 && s !== r; ) {
            if (this.has(s)) return !0;
            r--;
          }
          if (s === r) return !1;
          for (let e = s / 32; e !== r / 32; e++) if (this._buf[e]) return !0;
          return !1;
        }
        set(e) {
          const t = this._mask & e,
            s = this._getIndex(t),
            r = 1 << t % 32;
          this._buf[s] |= r;
        }
        setRange(e, t) {
          let s = e,
            r = t;
          for (; s % 32 && s !== r; ) this.set(s++);
          for (; r % 32 && s !== r; ) this.set(r--);
          if (s !== r) for (let e = s / 32; e !== r / 32; e++) this._buf[e] = 4294967295;
        }
        unset(e) {
          const t = this._mask & e,
            s = this._getIndex(t),
            r = 1 << t % 32;
          this._buf[s] &= 4294967295 ^ r;
        }
        resize(e) {
          const t = this._buf,
            s = new Uint32Array(Math.ceil(e / 32));
          s.set(t), (this._buf = s);
        }
        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 h(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 s = this._buf[t],
              r = 32 * t;
            if (s) for (; s; ) 1 & s && e(r), (s >>>= 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, s, r) {
          const i = this.copy();
          return (i._tx += e), (i._ty += t), (i._sx *= s), (i._sy *= r), i;
        }
        readAttribute(e, t = !1) {
          const s = this._readAttribute(e, t);
          if (void 0 !== s) return s;
          for (const s of this._joined) {
            s.setIndex(this.getIndex());
            const r = s._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 s = t._readAttributes();
            for (const t of Object.keys(s)) e[t] = s[t];
          }
          return e;
        }
        joinAttributes(e) {
          this._joined.push(e);
        }
        readArcadeFeature() {
          return this;
        }
        geometry() {
          const e = this.readHydratedGeometry(),
            t = (0, n.c)(e, this.geometryType, this.hasZ, this.hasM),
            s = (0, a.im)(t);
          return s && (s.spatialReference = this._arcadeSpatialReference), s;
        }
        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 s of e) t.has(s) && this.removeAtIndex(t.get(s));
        }
        removeAtIndex(e) {
          (0, r.b)(this._deleted) && (this._deleted = h.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);
        }
      }
    },
    59751: (e, t, s) => {
      'use strict';
      s.d(t, { F: () => g, S: () => p, a: () => b, f: () => y });
      var r = s(31712),
        i = s(76996),
        n = s(76506),
        o = s(3498),
        a = s(53326),
        h = s(93939),
        l = s(60217),
        c = s(92143),
        u = s(21929);
      const d = s.e(6078).then(s.bind(s, 76078));
      class p {
        constructor(e, t) {
          (this._canCacheExpressionValue = !1),
            (this._sourceInfo = e),
            (this._bitsets = { computed: t.getBitset(t.createBitset()) });
        }
        invalidate() {
          this._bitsets.computed.clear();
        }
        async updateSchema(e, t) {
          const s = (0, h.d)(this._schema, t);
          if (((this._schema = t), !t || (0, n.b)(s) || !(0, h.h)(s, 'attributes'))) return;
          (0, n.h)('esri-2d-update-debug') && console.debug('Applying Update - Store:', s),
            this._bitsets.computed.clear(),
            (e.targets[t.name] = !0);
          const r = t.attributes,
            i = [],
            o = [];
          for (const e in r) {
            const t = r[e];
            switch (t.type) {
              case 'field':
                break;
              case 'expression':
                i.push(this._createArcadeComputedField(t));
                break;
              case 'label-expression':
                i.push(this._createLabelArcadeComputedField(t));
                break;
              case 'statistic':
                o.push(t);
            }
          }
          (this._computedFields = await Promise.all(i)),
            (this._canCacheExpressionValue = !this._computedFields.some(
              (e) => 'expression' === e.type && e.expression.referencesScale(),
            )),
            (this._statisticFields = o);
        }
        setComputedAttributes(e, t, s, r) {
          const i = this._bitsets.computed;
          if (!this._canCacheExpressionValue || !i.has(s)) {
            i.set(s);
            for (const i of this._computedFields) {
              const n = this._evaluateField(t, i, r);
              switch (i.resultType) {
                case 'numeric':
                  e.setComputedNumericAtIndex(s, i.fieldIndex, n);
                  break;
                case 'string':
                  e.setComputedStringAtIndex(s, i.fieldIndex, n);
              }
            }
          }
        }
        async _createArcadeComputedField(e) {
          const t = this._sourceInfo.spatialReference,
            s = this._sourceInfo.fieldsIndex;
          return { ...e, expression: await (0, l.a)(e.valueExpression, t, s) };
        }
        async _createLabelArcadeComputedField(e) {
          const t = this._sourceInfo.spatialReference,
            s = this._sourceInfo.fieldsIndex,
            { createLabelFunction: r } = await d,
            i = await r(e.label, s, t);
          return { ...e, builder: i };
        }
        _evaluateField(e, t, s) {
          switch (t.type) {
            case 'label-expression': {
              const s = e.readArcadeFeature();
              return t.builder.evaluate(s) || '';
            }
            case 'expression': {
              const { expression: r } = t;
              return (function (e, t, s) {
                e.referencesGeometry();
                const r = t.readArcadeFeature();
                try {
                  return e.evaluate({ ...s, $feature: r });
                } catch (e) {
                  return (
                    c.L.getLogger('esri.views.2d.support.arcadeOnDemand').warn(
                      'Feature arcade evaluation failed:',
                      e,
                    ),
                    null
                  );
                }
              })(r, e, { $view: { scale: s } });
            }
          }
        }
      }
      class g extends u.F {
        constructor(e, t) {
          super(u.F.createInstance()),
            (this._currentIndex = -1),
            (this._reader = e),
            (this._indices = t);
        }
        static from(e, t) {
          return new g(e.copy(), t);
        }
        get hasNext() {
          return this._currentIndex + 1 < this._indices.length;
        }
        getSize() {
          return this._indices.length;
        }
        getCursor() {
          return this.copy();
        }
        copy() {
          const e = new g(this._reader.copy(), this._indices);
          return (e._currentIndex = this._currentIndex), e;
        }
        next() {
          for (; this._nextIndex() && !this._reader._getExists(); );
          return this._currentIndex < this._indices.length;
        }
        _nextIndex() {
          return (
            ++this._currentIndex < this._indices.length &&
            (this._reader.setIndex(this._indices[this._currentIndex]), !0)
          );
        }
        setArcadeSpatialReference(e) {
          this._reader.setArcadeSpatialReference(e);
        }
        attachStorage(e) {
          this._reader.attachStorage(e);
        }
        get geometryType() {
          return this._reader.geometryType;
        }
        get hasFeatures() {
          return this._reader.hasFeatures;
        }
        get exceededTransferLimit() {
          return this._reader.exceededTransferLimit;
        }
        get hasZ() {
          return this._reader.hasZ;
        }
        get hasM() {
          return this._reader.hasM;
        }
        getStorage() {
          return this._reader.getStorage();
        }
        getComputedNumeric(e) {
          return this._reader.getComputedNumericAtIndex(0);
        }
        setComputedNumeric(e, t) {
          return this._reader.setComputedNumericAtIndex(t, 0);
        }
        getComputedString(e) {
          return this._reader.getComputedStringAtIndex(0);
        }
        setComputedString(e, t) {
          return this._reader.setComputedStringAtIndex(0, t);
        }
        getComputedNumericAtIndex(e) {
          return this._reader.getComputedNumericAtIndex(e);
        }
        setComputedNumericAtIndex(e, t) {
          this._reader.setComputedNumericAtIndex(e, t);
        }
        getComputedStringAtIndex(e) {
          return this._reader.getComputedStringAtIndex(e);
        }
        setComputedStringAtIndex(e, t) {
          return this._reader.setComputedStringAtIndex(e, t);
        }
        transform(e, t, s, r) {
          const i = this.copy();
          return (i._reader = this._reader.transform(e, t, s, r)), i;
        }
        readAttribute(e, t = !1) {
          return this._reader.readAttribute(e, t);
        }
        readAttributes() {
          return this._reader.readAttributes();
        }
        joinAttributes(e) {
          return this._reader.joinAttributes(e);
        }
        readArcadeFeature() {
          return this._reader.readArcadeFeature();
        }
        geometry() {
          return this._reader.geometry();
        }
        field(e) {
          return this.readAttribute(e, !0);
        }
        hasField(e) {
          return this._reader.hasField(e);
        }
        setField(e, t) {
          return this._reader.setField(e, t);
        }
        keys() {
          return this._reader.keys();
        }
        castToText() {
          return this._reader.castToText();
        }
        getQuantizationTransform() {
          return this._reader.getQuantizationTransform();
        }
        getAttributeHash() {
          return this._reader.getAttributeHash();
        }
        getObjectId() {
          return this._reader.getObjectId();
        }
        getDisplayId() {
          return this._reader.getDisplayId();
        }
        setDisplayId(e) {
          return this._reader.setDisplayId(e);
        }
        getGroupId() {
          return this._reader.getGroupId();
        }
        setGroupId(e) {
          return this._reader.setGroupId(e);
        }
        getXHydrate() {
          return this._reader.getXHydrate();
        }
        getYHydrate() {
          return this._reader.getYHydrate();
        }
        getX() {
          return this._reader.getX();
        }
        getY() {
          return this._reader.getY();
        }
        setIndex(e) {
          return this._reader.setIndex(e);
        }
        getIndex() {
          return this._reader.getIndex();
        }
        readLegacyFeature() {
          return this._reader.readLegacyFeature();
        }
        readOptimizedFeature() {
          return this._reader.readOptimizedFeature();
        }
        readLegacyPointGeometry() {
          return this._reader.readLegacyPointGeometry();
        }
        readLegacyGeometry() {
          return this._reader.readLegacyGeometry();
        }
        readLegacyCentroid() {
          return this._reader.readLegacyCentroid();
        }
        readGeometryArea() {
          return this._reader.readGeometryArea();
        }
        readUnquantizedGeometry() {
          return this._reader.readUnquantizedGeometry();
        }
        readHydratedGeometry() {
          return this._reader.readHydratedGeometry();
        }
        readGeometry() {
          return this._reader.readGeometry();
        }
        readCentroid() {
          return this._reader.readCentroid();
        }
        _readAttribute(e, t) {
          throw new Error('Error: Should not be called. Underlying _reader should be used instead');
        }
        _readAttributes() {
          throw new Error('Error: Should not be called. Underlying _reader should be used instead');
        }
      }
      function f(e, t) {
        return (e << 16) | t;
      }
      function _(e) {
        return (4294901760 & e) >>> 16;
      }
      function m(e) {
        return 65535 & e;
      }
      const y = {
        getObjectId: (e) => e.getObjectId(),
        getAttributes: (e) => e.readAttributes(),
        getAttribute: (e, t) => e.readAttribute(t),
        cloneWithGeometry: (e, t) => e,
        getGeometry: (e) => e.readHydratedGeometry(),
        getCentroid: (e, t) => e.readCentroid(),
      };
      class b extends p {
        constructor(e, t, s) {
          super(e, t),
            (this.featureAdapter = y),
            (this.events = new i.E()),
            (this._featureSetsByInstance = new Map()),
            (this._objectIdToDisplayId = new Map()),
            (this._spatialIndexInvalid = !0),
            (this._indexSearchCache = new r.C(50)),
            (this._index = (0, o.r)(9, (e) => ({
              minX: this._storage.getXMin(e),
              minY: this._storage.getYMin(e),
              maxX: this._storage.getXMax(e),
              maxY: this._storage.getYMax(e),
            }))),
            (this._storage = t),
            (this.mode = s);
        }
        get storage() {
          return this._storage;
        }
        get storeStatistics() {
          return { featureCount: 0, vertexCount: 0 };
        }
        hasInstance(e) {
          return this._featureSetsByInstance.has(e);
        }
        onTileData(e, t) {
          if ((0, n.b)(t.addOrUpdate)) return t;
          if ((t.addOrUpdate.attachStorage(this._storage), 'snapshot' === this.mode)) {
            const s = t.addOrUpdate.getCursor();
            for (; s.next(); ) {
              const t = s.getDisplayId();
              this.setComputedAttributes(this._storage, s, t, e.scale);
            }
            return t;
          }
          this._featureSetsByInstance.set(t.addOrUpdate.instance, t.addOrUpdate);
          const s = t.addOrUpdate.getCursor();
          for (; s.next(); ) this._insertFeature(s, e.scale);
          return (this._spatialIndexInvalid = !0), this.events.emit('changed'), t;
        }
        search(e) {
          this._rebuildIndex();
          const t = e.id,
            s = this._indexSearchCache.find((e) => e.tileId === t);
          if ((0, n.i)(s)) return s.readers;
          const r = new Map(),
            i = this._searchIndex(e.bounds),
            o = [];
          for (const e of i) {
            const t = this._storage.getInstanceId(e),
              s = _(t),
              i = m(t);
            r.has(s) || r.set(s, []), r.get(s).push(i);
          }
          return (
            r.forEach((e, t) => {
              const s = this._featureSetsByInstance.get(t);
              o.push(g.from(s, e));
            }),
            this._indexSearchCache.enqueue({ tileId: t, readers: o }),
            o
          );
        }
        insert(e) {
          const t = e.getCursor(),
            s = this._storage;
          for (; t.next(); ) {
            var r;
            const e = f(t.instance, t.getIndex()),
              i = t.getObjectId(),
              n =
                null != (r = this._objectIdToDisplayId.get(i))
                  ? r
                  : this._storage.createDisplayId();
            t.setDisplayId(n), s.setInstanceId(n, e), this._objectIdToDisplayId.set(i, n);
          }
          this._featureSetsByInstance.set(e.instance, e), (this._spatialIndexInvalid = !0);
        }
        remove(e) {
          const t = this._objectIdToDisplayId.get(e);
          if (!t) return;
          const s = this._storage.getInstanceId(t),
            r = m(s),
            i = _(s),
            n = this._featureSetsByInstance.get(i);
          this._objectIdToDisplayId.delete(e),
            this._storage.releaseDisplayId(t),
            n.removeAtIndex(r),
            n.isEmpty && this._featureSetsByInstance.delete(i),
            (this._spatialIndexInvalid = !0);
        }
        forEach(e) {
          this._objectIdToDisplayId.forEach((t) => {
            const s = this._storage.getInstanceId(t),
              r = this._lookupFeature(s);
            e(r);
          });
        }
        forEachUnsafe(e) {
          this._objectIdToDisplayId.forEach((t) => {
            const s = this._storage.getInstanceId(t),
              r = _(s),
              i = m(s),
              n = this._getFeatureSet(r);
            n.setIndex(i), e(n);
          });
        }
        forEachInBounds(e, t) {
          const s = this._searchIndex(e);
          for (const e of s) {
            const s = this.lookupFeatureByDisplayId(e, this._storage);
            t((0, n.u)(s));
          }
        }
        forEachBounds(e, t, s) {
          this._rebuildIndex();
          const r = [0, 0, 0, 0];
          for (const i of e) {
            if (!i.readGeometry()) continue;
            const e = i.getDisplayId();
            (r[0] = this._storage.getXMin(e)),
              (r[1] = this._storage.getYMin(e)),
              (r[2] = this._storage.getXMax(e)),
              (r[3] = this._storage.getYMax(e)),
              t((0, a.C)(s, r));
          }
        }
        sweepFeatures(e, t, s) {
          (this._spatialIndexInvalid = !0),
            this._objectIdToDisplayId.forEach((r, i) => {
              e.has(r) ||
                (t.releaseDisplayId(r),
                s && s.unsetAttributeData(r),
                this._objectIdToDisplayId.delete(i));
            }),
            this.events.emit('changed');
        }
        sweepFeatureSets(e) {
          (this._spatialIndexInvalid = !0),
            this._featureSetsByInstance.forEach((t, s) => {
              e.has(s) || this._featureSetsByInstance.delete(s);
            });
        }
        lookupObjectId(e, t) {
          const s = this.lookupFeatureByDisplayId(e, t);
          return (0, n.b)(s) ? null : s.getObjectId();
        }
        lookupDisplayId(e) {
          return this._objectIdToDisplayId.get(e);
        }
        lookupFeatureByDisplayId(e, t) {
          const s = t.getInstanceId(e);
          return this._lookupFeature(s);
        }
        lookupByDisplayIdUnsafe(e) {
          const t = this._storage.getInstanceId(e),
            s = _(t),
            r = m(t),
            i = this._getFeatureSet(s);
          return i ? (i.setIndex(r), i) : null;
        }
        _insertFeature(e, t) {
          const s = this._storage,
            r = e.getObjectId(),
            i = f(e.instance, e.getIndex());
          s.getInstanceId(e.getDisplayId());
          let n = this._objectIdToDisplayId.get(r);
          n ||
            ((n = s.createDisplayId()),
            this._objectIdToDisplayId.set(r, n),
            (this._spatialIndexInvalid = !0)),
            e.setDisplayId(n),
            s.setInstanceId(n, i),
            this.setComputedAttributes(s, e, n, t);
        }
        _searchIndex(e) {
          this._rebuildIndex();
          const t = { minX: e[0], minY: e[1], maxX: e[2], maxY: e[3] };
          return this._index.search(t);
        }
        _rebuildIndex() {
          if (!this._spatialIndexInvalid) return;
          const e = [];
          'snapshot' === this.mode
            ? this._featureSetsByInstance.forEach((t) => {
                const s = t.getCursor();
                for (; s.next(); ) {
                  const t = s.getDisplayId();
                  this._storage.setBounds(t, s) && e.push(t);
                }
              })
            : this._objectIdToDisplayId.forEach((t) => {
                const s = this._storage.getInstanceId(t);
                this._storage.setBounds(t, this._lookupFeature(s)) && e.push(t);
              }),
            this._index.clear(),
            this._index.load(e),
            this._indexSearchCache.clear(),
            (this._spatialIndexInvalid = !1);
        }
        _lookupFeature(e) {
          const t = _(e),
            s = m(e),
            r = this._getFeatureSet(t);
          if (!r) return null;
          const i = r.getCursor();
          return i.setIndex(s), i;
        }
        _getFeatureSet(e) {
          return this._featureSetsByInstance.get(e);
        }
      }
    },
    76913: (e, t, s) => {
      'use strict';
      s.r(t), s.d(t, { default: () => Be, getInstances: () => qe });
      var r = s(29768),
        i = s(95873),
        n = s(76506),
        o = s(34250),
        a = (s(91306), s(92143)),
        h = s(17533),
        l = s(43352),
        c = s(50406),
        u = s(617),
        d = s(40267),
        p = s(50815),
        g = s(1709),
        f = s(59751),
        _ = s(21132),
        m = s(82058),
        y = s(60991),
        b = s(31292),
        x = s(65514),
        I = s(71435),
        w = s(51637),
        v = s(49214),
        S = s(3498),
        T = s(11385),
        F = s(85674),
        k = s(21929),
        E = s(76733),
        C = s(93314),
        M = s(76996),
        A = s(93939),
        O = s(31712),
        R = s(2267),
        L = s(82426),
        P = (s(74569), s(92847)),
        D = s(32422),
        U = s(60947);
      class N {
        constructor(e, t, s, r, i = 128) {
          (this._trackIdToObservations = new Map()),
            (this._idCounter = 0),
            (this._lastPurge = performance.now()),
            (this._addOrUpdated = new Map()),
            (this._removed = []),
            (this._maxAge = 0),
            (this._timeInfo = s),
            (this._purgeOptions = r),
            (this.store = e),
            (this.objectIdField = t),
            (this.purgeInterval = i),
            (this._useGeneratedIds = '__esri_stream_id__' === this.objectIdField);
        }
        add(e) {
          if (this._useGeneratedIds) {
            const t = this._nextId();
            (e.attributes[this.objectIdField] = t), (e.objectId = t);
          } else e.objectId = e.attributes[this.objectIdField];
          if (
            (this._addOrUpdated.set(e.objectId, e),
            (this._maxAge = Math.max(this._maxAge, e.attributes[this._timeInfo.startTimeField])),
            !this._timeInfo.trackIdField)
          )
            return (
              (0, n.b)(this._trackIdLessObservations) &&
                (this._trackIdLessObservations = new O.C(1e5)),
              void this._trackIdLessObservations.enqueue(e.objectId)
            );
          const t = e.attributes[this._timeInfo.trackIdField];
          if (!this._trackIdToObservations.has(t)) {
            const e =
                (0, n.i)(this._purgeOptions) && null != this._purgeOptions.maxObservations
                  ? this._purgeOptions.maxObservations
                  : 1e3,
              s = (0, L.c)(e, 0, 1e3);
            this._trackIdToObservations.set(t, new O.C(s));
          }
          const s = this._trackIdToObservations.get(t).enqueue(e.objectId);
          (0, n.i)(s) &&
            (this._addOrUpdated.has(s) ? this._addOrUpdated.delete(s) : this._removed.push(s));
        }
        checkForUpdates() {
          const e = this._getToAdd(),
            t = this._getToRemove(),
            s = performance.now();
          s - this._lastPurge >= this.purgeInterval && (this._purge(s), (this._lastPurge = s));
          const r = [];
          if ((0, n.i)(t))
            for (const e of t) {
              const t = this.store.removeById(e);
              (0, n.i)(t) && r.push(t);
            }
          if ((0, n.i)(e))
            for (const t of e) (t.attributes.__esri_timestamp__ = s), this.store.add(t);
          (e || r) && this.store.update(e, r);
        }
        _getToAdd() {
          if (!this._addOrUpdated.size) return null;
          const e = new Array(this._addOrUpdated.size);
          let t = 0;
          return this._addOrUpdated.forEach((s) => (e[t++] = s)), this._addOrUpdated.clear(), e;
        }
        _getToRemove() {
          const e = this._removed;
          return this._removed.length ? ((this._removed = []), e) : null;
        }
        _nextId() {
          const e = this._idCounter;
          return (this._idCounter = ((this._idCounter + 1) % 4294967294) + 1), e;
        }
        _purge(e) {
          const t = this._purgeOptions;
          (0, n.i)(t) &&
            (this._purgeSomeByDisplayCount(t),
            this._purgeByAge(t),
            this._purgeByAgeReceived(e, t),
            this._purgeTracks());
        }
        _purgeSomeByDisplayCount(e) {
          if (!e.displayCount) return;
          let t = this.store.size;
          if (t > e.displayCount) {
            if (this._timeInfo.trackIdField)
              for (const s of this._trackIdToObservations.values())
                if (t > e.displayCount && s.size) {
                  const e = (0, n.u)(s.dequeue());
                  this._removed.push(e), t--;
                }
            if ((0, n.i)(this._trackIdLessObservations)) {
              let s = t - e.displayCount;
              for (; s-- > 0; ) {
                const e = this._trackIdLessObservations.dequeue();
                (0, n.i)(e) && this._removed.push(e);
              }
            }
          }
        }
        _purgeByAge(e) {
          var t;
          if (!e.age || null == (t = this._timeInfo) || !t.startTimeField) return;
          const s = 60 * e.age * 1e3,
            r = this._maxAge - s;
          this.store.forEach((e) => {
            e.attributes[this._timeInfo.startTimeField] < r && this._removed.push(e.objectId);
          });
        }
        _purgeByAgeReceived(e, t) {
          if (!t.ageReceived) return;
          const s = e - 60 * t.ageReceived * 1e3;
          this.store.forEach((e) => {
            e.attributes.__esri_timestamp__ < s && this._removed.push(e.objectId);
          });
        }
        _purgeTracks() {
          this._trackIdToObservations.forEach((e, t) => {
            0 === e.size && this._trackIdToObservations.delete(t);
          });
        }
      }
      let q = class extends M.E.EventedMixin(i.r) {
        onFeature(e) {
          this.emit('feature', e);
        }
      };
      q = (0, r._)([(0, h.j)('esri.layers.graphics.sources.connections.StreamConnection')], q);
      var z = q;
      const B = a.L.getLogger('esri.layers.graphics.sources.connections.WebSocketConnection');
      var j, G;
      ((G = j || (j = {}))[(G.CONNECTING = 0)] = 'CONNECTING'),
        (G[(G.OPEN = 1)] = 'OPEN'),
        (G[(G.CLOSING = 2)] = 'CLOSING'),
        (G[(G.CLOSED = 3)] = 'CLOSED');
      let X = class extends z {
        constructor(e) {
          super(), (this.errorString = null);
          const { geometryType: t, spatialReference: s, sourceSpatialReference: r } = e;
          (this._config = e), (this._featureZScaler = (0, P.g)(t, r, s)), this._open();
        }
        async _open() {
          await this._tryCreateWebSocket(), this.destroyed || (await this._handshake());
        }
        destroy() {
          (0, n.i)(this._websocket) &&
            ((this._websocket.onopen = null),
            (this._websocket.onclose = null),
            (this._websocket.onerror = null),
            (this._websocket.onmessage = null),
            this._websocket.close()),
            (this._websocket = null);
        }
        get connectionStatus() {
          if ((0, n.b)(this._websocket)) return 'disconnected';
          switch (this._websocket.readyState) {
            case j.CONNECTING:
            case j.OPEN:
              return 'connected';
            case j.CLOSING:
            case j.CLOSED:
              return 'disconnected';
          }
        }
        async _tryCreateWebSocket(e = this._config.source.path, t = 1e3, s = 0) {
          try {
            if (this.destroyed) return;
            (this._websocket = await this._createWebSocket(e)),
              this.notifyChange('connectionStatus');
          } catch (r) {
            const i = t / 1e3;
            return this._config.maxReconnectionAttempts && s >= this._config.maxReconnectionAttempts
              ? (B.error(
                  new y.Z(
                    'websocket-connection',
                    'Exceeded maxReconnectionAttempts attempts. No further attempts will be made',
                  ),
                ),
                void this.destroy())
              : (B.error(
                  new y.Z(
                    'websocket-connection',
                    `Failed to connect. Attempting to reconnect in ${i}s`,
                    r,
                  ),
                ),
                await (0, c.e4)(t),
                this._tryCreateWebSocket(
                  e,
                  Math.min(1.5 * t, 1e3 * this._config.maxReconnectionInterval),
                  s + 1,
                ));
          }
        }
        _createWebSocket(e) {
          const t = new WebSocket(e),
            s = new Promise((e, s) => {
              (t.onopen = () => e(t)), (t.onclose = (e) => s(e));
            });
          return (
            s.then(() => {
              if (this.destroyed) return (t.onclose = () => {}), void t.close();
              (t.onclose = (e) => this._onClose(e)),
                (t.onerror = (e) => this._onError(e)),
                (t.onmessage = (e) => this._onMessage(e));
            }),
            s
          );
        }
        async _handshake(e = 1e4) {
          const t = this._websocket;
          if ((0, n.b)(t)) return;
          const s = (0, c.hh)(),
            r = t.onmessage,
            { filter: i, outFields: o, spatialReference: a } = this._config;
          return (
            s.timeout(e),
            (t.onmessage = (e) => {
              var n;
              let h = null;
              try {
                h = JSON.parse(e.data);
              } catch (e) {}
              (h && 'object' == typeof h) ||
                (B.error(
                  new y.Z(
                    'websocket-connection',
                    'Protocol violation. Handshake failed - malformed message',
                    e.data,
                  ),
                ),
                s.reject(),
                this.destroy()),
                (null == (n = h.spatialReference) ? void 0 : n.wkid) !==
                  (null == a ? void 0 : a.wkid) &&
                  (B.error(
                    new y.Z(
                      'websocket-connection',
                      `Protocol violation. Handshake failed - expected wkid of ${a.wkid}`,
                      e.data,
                    ),
                  ),
                  s.reject(),
                  this.destroy()),
                'json' !== h.format &&
                  (B.error(
                    new y.Z(
                      'websocket-connection',
                      'Protocol violation. Handshake failed - format is not set',
                      e.data,
                    ),
                  ),
                  s.reject(),
                  this.destroy()),
                i &&
                  h.filter !== i &&
                  B.error(
                    new y.Z(
                      'websocket-connection',
                      "Tried to set filter, but server doesn't support it",
                    ),
                  ),
                o &&
                  h.outFields !== o &&
                  B.error(
                    new y.Z(
                      'websocket-connection',
                      "Tried to set outFields, but server doesn't support it",
                    ),
                  ),
                (t.onmessage = r),
                s.resolve();
            }),
            t.send(
              JSON.stringify({
                filter: i,
                outFields: o,
                format: 'json',
                spatialReference: { wkid: a.wkid },
              }),
            ),
            s.promise
          );
        }
        _onMessage(e) {
          try {
            const t = JSON.parse(e.data);
            if ('featureResult' !== t.type)
              throw new y.Z(
                'websocket-connection',
                "Protocol violation - Expected to find message of type 'featureResult'",
                t,
              );
            for (const e of t.features)
              this._featureZScaler && this._featureZScaler(e.geometry), this.onFeature(e);
          } catch (e) {
            return (
              B.error(new y.Z('websocket-connection', 'Failed to parse message', e)),
              void this.destroy()
            );
          }
        }
        _onError(e) {
          const t = 'Encountered an error over WebSocket connection';
          this._set('errorString', t), B.error('websocket-connection', t);
        }
        _onClose(e) {
          (this._websocket = null),
            this.notifyChange('connectionStatus'),
            1e3 !== e.code &&
              B.error(
                'websocket-connection',
                `WebSocket closed unexpectedly with error code ${e.code}`,
              ),
            this.destroyed || this._open();
        }
      };
      (0, r._)([(0, o.Cb)()], X.prototype, 'connectionStatus', null),
        (0, r._)([(0, o.Cb)()], X.prototype, 'errorString', void 0),
        (X = (0, r._)(
          [(0, h.j)('esri.layers.graphics.sources.connections.WebSocketConnection')],
          X,
        ));
      const Y = a.L.getLogger('esri.layers.graphics.sources.connections.GeoEventConnection'),
        V = { maxQueryDepth: 5, maxRecordCountFactor: 3 };
      let H = class extends X {
        constructor(e) {
          super({ ...V, ...e });
        }
        async _open() {
          const e = await this._fetchServiceDefinition(this._config.source);
          e.timeInfo.trackIdField ||
            Y.warn(
              'GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.',
            );
          const t = await this._fetchWebSocketUrl(e.streamUrls, this._config.spatialReference);
          this._buddyServicesQuery || (this._buddyServicesQuery = this._queryBuddyServices()),
            await this._buddyServicesQuery,
            await this._tryCreateWebSocket(t);
          const { filter: s, outFields: r } = this._config;
          this.destroyed || this._setFilter(s, r);
        }
        _onMessage(e) {
          let t;
          try {
            (t = this._enrich(JSON.parse(e.data))),
              this._featureZScaler && this._featureZScaler(t.geometry);
          } catch (e) {
            return void Y.error(new y.Z('geoevent-connection', 'Failed to parse message', e));
          }
          this.onFeature(t);
        }
        async _fetchServiceDefinition(e) {
          const t = (0, m.default)(e.path, { query: { f: 'json' }, responseType: 'json' }),
            s = (await t).data;
          return (this._serviceDefinition = s), s;
        }
        async _fetchWebSocketUrl(e, t) {
          const s = e[0],
            { urls: r, token: i } = s;
          return `${this._inferWebSocketBaseUrl(r)}/subscribe?outSR=${t.wkid}${
            i ? '&token=' + i : ''
          }`;
        }
        _inferWebSocketBaseUrl(e) {
          if (1 === e.length) return e[0];
          for (const t of e) if (-1 !== t.indexOf('wss')) return t;
          return Y.error(new y.Z('geoevent-connection', 'Unable to infer WebSocket url', e)), null;
        }
        async _setFilter(e, t) {
          const s = this._websocket;
          if ((0, n.b)(s) || ((0, n.b)(e) && (0, n.b)(t))) return;
          const r = JSON.stringify({ filter: this._serializeFilter(e, t) });
          let i = !1;
          const o = (0, c.hh)();
          return (
            (s.onmessage = (e) => {
              const t = JSON.parse(e.data);
              t.filter &&
                (t.error &&
                  (Y.error(new y.Z('geoevent-connection', 'Failed to set service filter', t.error)),
                  this._set('errorString', `Could not set service filter - ${t.error}`),
                  o.reject(t.error)),
                (s.onmessage = this._onMessage.bind(this)),
                (i = !0),
                o.resolve());
            }),
            s.send(r),
            setTimeout(() => {
              i ||
                (this.destroyed ||
                  this._websocket !== s ||
                  Y.error(new y.Z('geoevent-connection', 'Server timed out when setting filter')),
                o.reject());
            }, 1e4),
            o.promise
          );
        }
        _serializeFilter(e, t) {
          const s = {};
          if ((0, n.b)(e) && (0, n.b)(t)) return s;
          if ((0, n.i)(e) && e.geometry)
            try {
              const t = (0, D.im)(e.geometry);
              if ('extent' !== t.type) throw new y.Z(`Expected extent but found type ${t.type}`);
              s.geometry = JSON.stringify(t.shiftCentralMeridian());
            } catch (e) {
              Y.error(
                new y.Z(
                  'geoevent-connection',
                  'Encountered an error when setting connection geometryDefinition',
                  e,
                ),
              );
            }
          return (
            (0, n.i)(e) && e.where && '1 = 1' !== e.where && (s.where = e.where),
            (0, n.i)(t) && (s.outFields = t.join(',')),
            s
          );
        }
        _enrich(e) {
          if (!this._relatedFeatures) return e;
          const t = this._serviceDefinition.relatedFeatures.joinField,
            s = e.attributes[t];
          if (!this._relatedFeatures.has(s))
            return (
              Y.warn(
                'geoevent-connection',
                'Feature join failed. Is the join field configured correctly?',
                e,
              ),
              e
            );
          const { attributes: r, geometry: i } = this._relatedFeatures.get(s);
          for (const t in r) e.attributes[t] = r[t];
          return (
            i && (e.geometry = i),
            e.geometry ||
              e.centroid ||
              Y.error(
                new y.Z('geoevent-connection', 'Found malformed feature - no geometry found', e),
              ),
            e
          );
        }
        async _queryBuddyServices() {
          try {
            const { relatedFeatures: e, keepLatestArchive: t } = this._serviceDefinition,
              s = this._queryRelatedFeatures(e),
              r = this._queryArchive(t);
            await s;
            const i = await r;
            if (!i) return;
            for (const e of i.features) this.onFeature(this._enrich(e));
          } catch (e) {
            Y.error(
              new y.Z('geoevent-connection', 'Encountered an error when querying buddy services', {
                error: e,
              }),
            );
          }
        }
        async _queryRelatedFeatures(e) {
          if (!e) return;
          const t = await this._queryBuddy(e.featuresUrl);
          this._addRelatedFeatures(t);
        }
        async _queryArchive(e) {
          if (e) return this._queryBuddy(e.featuresUrl);
        }
        async _queryBuddy(e) {
          const t = new (
              await Promise.all([
                s.e(4851),
                s.e(5959),
                s.e(208),
                s.e(3770),
                s.e(8824),
                s.e(9506),
                s.e(3602),
              ]).then(s.bind(s, 9506))
            ).default({ url: e }),
            { capabilities: r } = await t.load(),
            i = r.query.supportsMaxRecordCountFactor,
            o = r.query.supportsPagination,
            a = r.query.supportsCentroid,
            h = this._config.maxRecordCountFactor,
            l = t.capabilities.query.maxRecordCount,
            c = i ? l * h : l,
            u = new b.Z();
          if (
            ((u.outFields = (0, n.d)(this._config.outFields, ['*'])),
            (u.where = (0, n.d)((0, n.c)(this._config.filter, 'where'), '1=1')),
            (u.returnGeometry = !0),
            (u.returnExceededLimitFeatures = !0),
            (u.outSpatialReference = U.Z.fromJSON(this._config.spatialReference)),
            a && (u.returnCentroid = !0),
            i && (u.maxRecordCountFactor = h),
            o)
          )
            return (u.num = c), t.destroy(), this._queryPages(e, u);
          const d = await (0, v.c)(e, u, this._config.sourceSpatialReference);
          return t.destroy(), d.data;
        }
        async _queryPages(e, t, s = [], r = 0) {
          t.start = (0, n.i)(t.num) ? r * t.num : null;
          const { data: i } = await (0, v.c)(e, t, this._config.sourceSpatialReference);
          return i.exceededTransferLimit && r < this._config.maxQueryDepth
            ? (i.features.forEach((e) => s.push(e)), this._queryPages(e, t, s, r + 1))
            : (s.forEach((e) => i.features.push(e)), i);
        }
        _addRelatedFeatures(e) {
          const t = new Map(),
            s = e.features,
            r = this._serviceDefinition.relatedFeatures.joinField;
          for (const e of s) {
            const s = e.attributes[r];
            t.set(s, e);
          }
          this._relatedFeatures = t;
        }
      };
      H = (0, r._)([(0, h.j)('esri.layers.graphics.sources.connections.GeoEventConnection')], H);
      var Z = H,
        Q = s(27794),
        W = s(89623),
        $ = s(24251),
        J = s(82356),
        K = s(11084);
      s(21972),
        s(23639),
        s(86656),
        s(22723),
        s(91055),
        s(6906),
        s(31450),
        s(71552),
        s(40642),
        s(81172),
        s(82933),
        s(15324),
        s(57251),
        s(74673),
        s(26341),
        s(53785),
        s(95587),
        s(97714),
        s(2906),
        s(91597),
        s(86787),
        s(73796),
        s(35132),
        s(92482),
        s(21801),
        s(92817),
        s(84069),
        s(44567),
        s(98380),
        s(92896),
        s(91700),
        s(53326),
        s(95533),
        s(94751),
        s(32101),
        s(22781),
        s(88762),
        s(30831),
        s(72274),
        s(5777),
        s(89219),
        s(19124),
        s(14249),
        s(9801),
        s(53523),
        s(59465),
        s(42911),
        s(46826),
        s(45433),
        s(60217),
        s(7176),
        s(14172),
        s(20438),
        s(40705),
        s(60599),
        s(10401),
        s(22739),
        s(20543),
        s(91162),
        s(41864),
        s(49900),
        s(66284),
        s(33921),
        s(3482),
        s(73173),
        s(67477),
        s(78533),
        s(74653),
        s(91091),
        s(58943),
        s(56420),
        s(74742),
        s(28239),
        s(88610),
        s(38742),
        s(69218),
        s(97546),
        s(54732),
        s(27207),
        s(35197),
        s(46987),
        s(37453),
        s(90995),
        s(4571),
        s(6941),
        s(87258),
        s(23761),
        s(86748),
        s(29107),
        s(30574),
        s(2157),
        s(25977),
        s(7471),
        s(54414),
        s(1648),
        s(8925),
        s(45154),
        s(16769),
        s(55531),
        s(30582),
        s(593),
        s(85699),
        s(63136),
        s(96055),
        s(47776),
        s(18033),
        s(6331),
        s(62048),
        s(4292),
        s(75626),
        s(72652),
        s(29641),
        s(30493),
        s(70821),
        s(82673),
        s(34229),
        s(37029),
        s(96467),
        s(63571),
        s(30776),
        s(48027),
        s(54174),
        s(63130),
        s(25696),
        s(66396),
        s(42775),
        s(95834),
        s(34394),
        s(57150),
        s(76726),
        s(20444),
        s(76393),
        s(78548),
        s(2497),
        s(49906),
        s(46527),
        s(48649),
        s(9960),
        s(3101),
        s(5853),
        s(39141),
        s(48243),
        s(34635),
        s(70737),
        s(8487),
        s(17817),
        s(90814),
        s(15459),
        s(61847),
        s(16796),
        s(16955),
        s(22401),
        s(77894),
        s(55187),
        s(8586),
        s(44509),
        s(69814),
        s(11305),
        s(62259),
        s(44790),
        s(5909),
        s(60669),
        s(48208),
        s(51589),
        s(55823),
        s(55029),
        s(30752),
        s(10638),
        s(86929),
        s(98788),
        s(98576),
        s(6687),
        s(15173),
        s(72334),
        s(65775),
        s(12381),
        s(92624),
        s(77314);
      class ee {
        constructor() {
          (this.fieldMap = new Map()),
            (this.fields = []),
            (this.hasFeatures = !1),
            (this.fieldCount = 0),
            (this.featureCount = 0),
            (this.objectIdFieldIndex = 0),
            (this.offsets = { attributes: new Array(), geometry: new Array() }),
            (this.centroid = new Array());
        }
        hasField(e) {
          return this.fieldMap.has(e);
        }
        isDateField(e) {
          var t;
          return null == (t = this.fieldMap.get(e)) ? void 0 : t.isDate;
        }
        getFieldIndex(e) {
          var t;
          return null == (t = this.fieldMap.get(e)) ? void 0 : t.index;
        }
      }
      function te(e) {
        const t = e.getLength(),
          s = e.pos() + t,
          r = { name: '', isDate: !1 };
        for (; e.pos() < s && e.next(); )
          switch (e.tag()) {
            case 1:
              r.name = e.getString();
              break;
            case 2:
              'esriFieldTypeDate' === (0, E.b)(e.getEnum()) && (r.isDate = !0);
              break;
            default:
              e.skip();
          }
        return r;
      }
      const se = a.L.getLogger('esri.view.2d.layers.features.support.FeatureSetReaderPBF');
      function re(e) {
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              return e.getMessage();
            default:
              e.skip();
          }
        return null;
      }
      class ie extends k.F {
        constructor(e, t, s, r) {
          super(e),
            (this._hasNext = !1),
            (this._isPoints = !1),
            (this._isPolygons = !1),
            (this._featureIndex = -1),
            (this._featureOffset = 0),
            (this._cache = {
              area: 0,
              unquantGeometry: void 0,
              geometry: void 0,
              centroid: void 0,
              legacyFeature: void 0,
              optFeature: void 0,
            }),
            (this._geometryType = r),
            (this._reader = t),
            (this._header = s),
            (this._hasNext = s.hasFeatures),
            (this._isPoints = 'esriGeometryPoint' === r),
            (this._isPolygons = 'esriGeometryPolygon' === r);
        }
        static fromBuffer(e, t, s = !1) {
          const r = (function (e) {
              try {
                const t = 2,
                  s = new T.P(new Uint8Array(e), new DataView(e));
                for (; s.next(); )
                  switch (s.tag()) {
                    case t:
                      return re(s.getMessage());
                    default:
                      s.skip();
                  }
              } catch (e) {
                const t = new y.Z(
                  'query:parsing-pbf',
                  'Error while parsing FeatureSet PBF payload',
                  { error: e },
                );
                se.error(t);
              }
              return null;
            })(e),
            i = (function (e, t, s = !1) {
              const r = e.pos(),
                i = new ee();
              let n = 0,
                o = 0,
                a = null,
                h = null,
                l = null,
                c = !1;
              for (; e.next(); )
                switch (e.tag()) {
                  case 1:
                    a = e.getString();
                    break;
                  case 3:
                    h = e.getString();
                    break;
                  case 12:
                    l = e.processMessage(E.a);
                    break;
                  case 9:
                    if (((i.exceededTransferLimit = e.getBool()), i.exceededTransferLimit)) {
                      (i.offsets.geometry = s ? new Float64Array(8e3) : new Int32Array(8e3)),
                        (i.centroid = s ? new Float64Array(16e3) : new Int32Array(16e3));
                      for (let e = 0; e < i.centroid.length; e++) i.centroid[e] = 268435455;
                    }
                    break;
                  case 13: {
                    const t = te(e),
                      s = t.name,
                      r = t.name.toLowerCase().trim(),
                      o = { fieldName: s, index: n++, isDate: t.isDate };
                    i.fields.push(o), i.fieldMap.set(t.name, o), i.fieldMap.set(r, o);
                    break;
                  }
                  case 15: {
                    const r = e.getLength(),
                      a = e.pos() + r;
                    if (!i.exceededTransferLimit) {
                      const e = i.offsets.geometry,
                        t = i.centroid;
                      e.push(0), t.push(268435455), t.push(268435455);
                    }
                    !c &&
                      i.exceededTransferLimit &&
                      ((c = !0),
                      (i.offsets.attributes = s
                        ? new Float64Array(8e3 * n)
                        : new Uint32Array(8e3 * n)));
                    let h = o * n;
                    for (; e.pos() < a && e.next(); )
                      switch (e.tag()) {
                        case 1: {
                          c
                            ? (i.offsets.attributes[h++] = e.pos())
                            : i.offsets.attributes.push(e.pos());
                          const t = e.getLength();
                          e.skipLen(t);
                          break;
                        }
                        case 2:
                          if (t) {
                            const t = e.getLength(),
                              s = e.pos() + t;
                            for (; e.pos() < s && e.next(); )
                              switch (e.tag()) {
                                case 3: {
                                  e.getUInt32();
                                  const t = e.getSInt64(),
                                    s = e.getSInt64();
                                  (i.centroid[2 * o] = t), (i.centroid[2 * o + 1] = s);
                                  break;
                                }
                                default:
                                  e.skip();
                              }
                          } else {
                            i.offsets.geometry[o] = e.pos();
                            const t = e.getLength();
                            e.skipLen(t);
                          }
                          break;
                        case 4: {
                          const t = e.getLength(),
                            s = e.pos() + t;
                          for (; e.pos() < s && e.next(); )
                            switch (e.tag()) {
                              case 3: {
                                e.getUInt32();
                                const t = e.getSInt64(),
                                  s = e.getSInt64();
                                (i.centroid[2 * o] = t), (i.centroid[2 * o + 1] = s);
                                break;
                              }
                              default:
                                e.skip();
                            }
                          break;
                        }
                        default:
                          e.skip();
                      }
                    o++, (i.hasFeatures = !0);
                    break;
                  }
                  default:
                    e.skip();
                }
              const u = a || h;
              if (!u) throw new y.Z('FeatureSet has no objectId or globalId field name');
              return (
                (i.featureCount = o),
                (i.fieldCount = n),
                (i.objectIdFieldIndex = i.getFieldIndex(u)),
                (i.transform = l),
                (i.displayIds = new Uint32Array(i.featureCount)),
                (i.groupIds = new Uint16Array(i.featureCount)),
                e.move(r),
                i
              );
            })(r, 'esriGeometryPoint' === t, s),
            n = k.F.createInstance();
          return new ie(n, r, i, t);
        }
        get geometryType() {
          return this._geometryType;
        }
        get size() {
          return this._header.featureCount;
        }
        get hasZ() {
          return !1;
        }
        get hasM() {
          return !1;
        }
        get stride() {
          return 2 + (this.hasZ ? 1 : 0) + (this.hasM ? 1 : 0);
        }
        get hasFeatures() {
          return this._header.hasFeatures;
        }
        get hasNext() {
          return this._hasNext;
        }
        get exceededTransferLimit() {
          return this._header.exceededTransferLimit;
        }
        getSize() {
          return this.size;
        }
        getQuantizationTransform() {
          return this._header.transform;
        }
        getCursor() {
          return this.copy();
        }
        getIndex() {
          return this._featureIndex;
        }
        setIndex(e) {
          (this._cache.area = 0),
            (this._cache.unquantGeometry = void 0),
            (this._cache.geometry = void 0),
            (this._cache.centroid = void 0),
            (this._cache.legacyFeature = void 0),
            (this._cache.optFeature = void 0),
            (this._featureIndex = e);
        }
        getAttributeHash() {
          let e = '';
          return (
            this._header.fields.forEach(({ index: t }) => {
              e += this._readAttributeAtIndex(t) + '.';
            }),
            e
          );
        }
        getObjectId() {
          return this._readAttributeAtIndex(this._header.objectIdFieldIndex);
        }
        getDisplayId() {
          return this._header.displayIds[this._featureIndex];
        }
        setDisplayId(e) {
          this._header.displayIds[this._featureIndex] = e;
        }
        getGroupId() {
          return this._header.groupIds[this._featureIndex];
        }
        setGroupId(e) {
          this._header.groupIds[this._featureIndex] = e;
        }
        readLegacyFeature() {
          if (void 0 === this._cache.legacyFeature) {
            var e;
            const t = this.readCentroid(),
              s = {
                attributes: this.readAttributes(),
                geometry: this._isPoints
                  ? this.readLegacyPointGeometry()
                  : this.readLegacyGeometry(),
                centroid: null != (e = t && { x: t.coords[0], y: t.coords[1] }) ? e : null,
              };
            return (this._cache.legacyFeature = s), s;
          }
          return this._cache.legacyFeature;
        }
        readOptimizedFeature() {
          if (void 0 === this._cache.optFeature) {
            const e = new F.O(this.readGeometry(), this.readAttributes(), this.readCentroid());
            return (
              (e.objectId = this.getObjectId()),
              (e.displayId = this.getDisplayId()),
              (this._cache.optFeature = e),
              e
            );
          }
          return this._cache.optFeature;
        }
        getXHydrate() {
          const e = this._header.centroid[2 * this._featureIndex],
            t = this.getQuantizationTransform();
          return (0, n.b)(t) ? e : e * t.scale[0] + t.translate[0];
        }
        getYHydrate() {
          const e = this._header.centroid[2 * this._featureIndex + 1],
            t = this.getQuantizationTransform();
          return (0, n.b)(t) ? e : t.translate[1] - e * t.scale[1];
        }
        getX() {
          return this._header.centroid[2 * this._featureIndex] * this._sx + this._tx;
        }
        getY() {
          return this._header.centroid[2 * this._featureIndex + 1] * this._sy + this._ty;
        }
        readLegacyPointGeometry() {
          return { x: this.getX(), y: this.getY() };
        }
        readLegacyGeometry() {
          const e = this.readGeometry();
          return (0, d.c)(e, this.geometryType, !1, !1);
        }
        readLegacyCentroid() {
          const e = this.readCentroid();
          if (!e) return null;
          const [t, s] = e.coords;
          return { x: t, y: s };
        }
        readGeometryArea() {
          return this._cache.area || this.readGeometry(), this._cache.area;
        }
        readUnquantizedGeometry() {
          if (void 0 === this._cache.unquantGeometry) {
            const e = this.readGeometry();
            if (!e) return (this._cache.unquantGeometry = null), null;
            const t = e.clone(),
              s = t.lengths,
              r = t.coords;
            for (let e = 0, t = 2; e < s.length; e++, t += 2) {
              const i = s[e];
              for (let e = 1; e < i; e += 1, t += 2) (r[t] += r[t - 2]), (r[t + 1] += r[t - 1]);
            }
            return (this._cache.unquantGeometry = t), t;
          }
          return this._cache.unquantGeometry;
        }
        readHydratedGeometry() {
          if (this._isPoints) {
            if (268435455 === this._header.centroid[2 * this._featureIndex]) return null;
            const e = this.getXHydrate(),
              t = this.getYHydrate();
            return new F.a([], [e, t]);
          }
          const e = this.readGeometry();
          if (!e) return null;
          const t = e.clone(),
            s = this.getQuantizationTransform();
          return (0, n.i)(s) && (0, d.u)(t, t, this.hasZ, this.hasM, s), t;
        }
        readGeometry() {
          if (void 0 === this._cache.geometry) {
            let e = null;
            if (this._isPoints) {
              if (268435455 === this._header.centroid[2 * this._featureIndex]) return null;
              const t = this.getX(),
                s = this.getY();
              e = new F.a([], [t, s]);
            } else {
              const t = this._header.offsets.geometry[this._featureIndex],
                s = this._reader;
              if (0 === t) return null;
              s.move(t);
              try {
                e = this._parseGeometry(s);
              } catch (e) {
                return console.error('Failed to parse geometry!', e), null;
              }
            }
            return (this._cache.geometry = e), e;
          }
          return this._cache.geometry;
        }
        readCentroid() {
          if (void 0 === this._cache.centroid) {
            let e = null;
            const t = this._header.centroid[2 * this._featureIndex] + this._tx,
              s = this._header.centroid[2 * this._featureIndex + 1] + this._ty;
            return (
              268435455 === t
                ? ((e = this._computeCentroid()),
                  e &&
                    ((this._header.centroid[2 * this._featureIndex] = e.coords[0] - this._tx),
                    (this._header.centroid[2 * this._featureIndex + 1] = e.coords[1] - this._ty)))
                : (e = new F.a([], [t, s])),
              (this._cache.centroid = e),
              e
            );
          }
          return this._cache.centroid;
        }
        copy() {
          const e = this._reader.clone(),
            t = new ie(this.instance, e, this._header, this.geometryType);
          return this.copyInto(t), t;
        }
        next() {
          for (
            this._cache.area = 0,
              this._cache.unquantGeometry = void 0,
              this._cache.geometry = void 0,
              this._cache.centroid = void 0,
              this._cache.legacyFeature = void 0,
              this._cache.optFeature = void 0;
            ++this._featureIndex < this.size && !this._getExists();

          );
          return this._featureIndex < this.size;
        }
        _readAttribute(e, t) {
          const s = this._header.hasField(e)
              ? e
              : (function (e) {
                  return e.toLowerCase().trim();
                })(e),
            r = this._header.getFieldIndex(s);
          if (null == r) return;
          const i = this._readAttributeAtIndex(r);
          return t ? (null == i ? i : this._header.isDateField(s) ? new Date(i) : i) : i;
        }
        _readAttributes() {
          const e = {};
          return (
            this._header.fields.forEach(({ fieldName: t, index: s }) => {
              e[t] = this._readAttributeAtIndex(s);
            }),
            e
          );
        }
        copyInto(e) {
          super.copyInto(e),
            (e._featureIndex = this._featureIndex),
            (e._featureOffset = this._featureOffset),
            (e._hasNext = this._hasNext);
        }
        _readAttributeAtIndex(e) {
          const t = this._header.offsets.attributes[
              this._featureIndex * this._header.fieldCount + e
            ],
            s = this._reader;
          return (
            s.move(t),
            (function (e) {
              const t = e.getLength(),
                s = e.pos() + t;
              for (; e.pos() < s && e.next(); )
                switch (e.tag()) {
                  case 1:
                    return e.getString();
                  case 2:
                    return e.getFloat();
                  case 3:
                    return e.getDouble();
                  case 4:
                    return e.getSInt32();
                  case 5:
                    return e.getUInt32();
                  case 6:
                    return e.getInt64();
                  case 7:
                    return e.getUInt64();
                  case 8:
                    return e.getSInt64();
                  case 9:
                    return e.getBool();
                  default:
                    return e.skip(), null;
                }
              return null;
            })(s)
          );
        }
        _preprocessPolygon(e, t) {
          let s = 0,
            r = 0,
            i = 0,
            n = !1,
            o = !1,
            a = !1,
            h = -1;
          const l = [];
          let c = 0,
            u = !1;
          for (let d = 0; d < t.length; d++) {
            const p = t[d];
            let g = e[2 * s],
              f = e[2 * s + 1],
              _ = 0;
            for (let t = 1; t < p; t++) {
              const r = g,
                i = f,
                n = g + e[2 * (s + t)],
                o = f + e[2 * (s + t) + 1];
              (g = n), (f = o), (_ += (n - r) * (o + i) * 0.5);
            }
            const m = _ > 0;
            if ((m && u && (r += p), m || (h++, (u = !1)), h >= 1e6)) break;
            (c += _), n && m && o && (a = !0);
            {
              (e[2 * i] = e[2 * r]), (e[2 * i++ + 1] = e[2 * r++ + 1]);
              let t = 1,
                s = e[2 * r],
                n = e[2 * r++ + 1];
              for (let o = 2; o < p; o++) {
                const o = e[2 * r],
                  a = e[2 * r++ + 1];
                0 == s * a - o * n && s * o + n * a > 0
                  ? ((s += o), (n += a))
                  : ((e[2 * i] = s), (e[2 * i++ + 1] = n), t++, (s = o), (n = a));
              }
              (e[2 * i] = s), (e[2 * i++ + 1] = n), t++, l.push(t);
            }
            (n = !1), (o = !0), (s += p);
          }
          return l.length ? ((this._cache.area = Math.abs(c)), new F.a(l, e, a)) : null;
        }
        _parseGeometry(e) {
          const t = e.getLength(),
            s = e.pos() + t,
            r = [],
            i = [];
          for (; e.pos() < s && e.next(); )
            switch (e.tag()) {
              case 2: {
                const t = e.getUInt32(),
                  s = e.pos() + t;
                for (; e.pos() < s; ) i.push(e.getUInt32());
                break;
              }
              case 3: {
                const t = e.getUInt32(),
                  s = e.pos() + t;
                for (; e.pos() < s; )
                  r.push(e.getSInt32()),
                    r.push(e.getSInt32()),
                    this.hasZ && e.getSInt32(),
                    this.hasM && e.getSInt32();
                break;
              }
              case 1:
              default:
                e.skip();
            }
          let n = 0;
          for (const e of i) (r[2 * n] += this._tx), (r[2 * n + 1] += this._ty), (n += e);
          return this._isPolygons ? this._preprocessPolygon(r, i) : new F.a(i, r);
        }
      }
      class ne {
        constructor(e) {
          this.service = e;
        }
        destroy() {}
      }
      class oe extends ne {
        constructor(e) {
          super(e), (this._portsOpen = (0, x.Mz)(e.source).then((e) => (this.client = e)));
        }
        destroy() {
          this.client.close(), (this.client = null);
        }
        async executeQuery(e, t) {
          await this._portsOpen;
          const s = await this.client.invoke('queryFeatures', e.toJSON(), t);
          return S.F.fromFeatureSet(s, this.service.objectIdField);
        }
      }
      class ae extends ne {
        async executeQuery(e, t) {
          const { data: s } = await (0, v.f)(this.service.source, e, {
              signal: null == t ? void 0 : t.signal,
              query: { ...(null == t ? void 0 : t.query), ...this.service.customParameters },
            }),
            r = !e.quantizationParameters;
          return ie.fromBuffer(s, this.service.geometryType, r);
        }
      }
      class he extends ne {
        async executeQuery(e, t) {
          const {
            source: s,
            capabilities: r,
            spatialReference: i,
            objectIdField: o,
          } = this.service;
          if ((0, n.i)(e.quantizationParameters) && !r.query.supportsQuantization) {
            const r = e.clone(),
              a = (0, I.t)((0, n.u)(r.quantizationParameters));
            r.quantizationParameters = null;
            const { data: h } = await (0, v.c)(s, r, i, {
                signal: null == t ? void 0 : t.signal,
                query: { ...(null == t ? void 0 : t.query), ...this.service.customParameters },
              }),
              l = (0, d.m)(h, o);
            return (0, d.s)(a, l), S.F.fromOptimizedFeatureSet(l);
          }
          const { data: a } = await (0, v.c)(s, e, this.service.spatialReference, {
            ...t,
            query: { ...(null == t ? void 0 : t.query), ...this.service.customParameters },
          });
          return S.F.fromFeatureSet(a, this.service.objectIdField);
        }
      }
      class le extends ne {
        async executeQuery(e, t) {
          const { capabilities: s } = this.service;
          if (e.quantizationParameters && !s.query.supportsQuantization) {
            const s = e.clone(),
              r = (0, I.t)((0, n.u)(s.quantizationParameters));
            s.quantizationParameters = null;
            const i = await (0, w.h)(this.service.source, e, t);
            return (0, d.s)(r, i), S.F.fromOptimizedFeatureSet(i);
          }
          const r = await (0, w.h)(this.service.source, e, t);
          return S.F.fromOptimizedFeatureSet(r);
        }
      }
      class ce {
        constructor() {
          (this.source = !1),
            (this.targets = { feature: !1, aggregate: !1 }),
            (this.storage = { filters: !1, data: !1 }),
            (this.mesh = !1),
            (this.queryFilter = !1),
            (this.why = { mesh: [], source: [] });
        }
        static create(e) {
          const t = new ce();
          for (const s in e) {
            const r = e[s];
            if ('object' == typeof r)
              for (const e in r) {
                const i = r[e];
                t[s][e] = i;
              }
            t[s] = r;
          }
          return t;
        }
        static empty() {
          return ce.create({});
        }
        static all() {
          return ce.create({
            source: !0,
            targets: { feature: !0, aggregate: !0 },
            storage: { filters: !0, data: !0 },
            mesh: !0,
          });
        }
        unset(e) {
          e.source && (this.source = !1),
            e.targets.feature && (this.targets.feature = !1),
            e.targets.aggregate && (this.targets.aggregate = !1),
            e.storage.filters && (this.storage.filters = !1),
            e.storage.data && (this.storage.data = !1),
            e.mesh && (this.mesh = !1),
            e.queryFilter && (this.queryFilter = !1);
        }
        any() {
          return (
            this.source ||
            this.mesh ||
            this.storage.filters ||
            this.storage.data ||
            this.targets.feature ||
            this.targets.aggregate ||
            this.queryFilter
          );
        }
        describe() {
          let e = 0,
            t = '';
          if (this.mesh) {
            (e += 20), (t += '-> (20) Mesh needs update\n');
            for (const e of this.why.mesh) t += `    + ${e}\n`;
          }
          if (this.source) {
            (e += 10), (t += '-> (10) The source needs update\n');
            for (const e of this.why.source) t += `    + ${e}\n`;
          }
          this.targets.feature && ((e += 5), (t += '-> (5) Feature target parameters changed\n')),
            this.storage.filters && ((e += 5), (t += '-> (5) Feature filter parameters changed\n')),
            this.targets.aggregate &&
              ((e += 4), (t += '-> (4) Aggregate target parameters changed\n')),
            this.storage.data && ((e += 1), (t += '-> (1) Texture storage parameters changed'));
          const s =
            e < 5
              ? 'Fastest'
              : e < 10
              ? 'Fast'
              : e < 15
              ? 'Moderate'
              : e < 20
              ? 'Slow'
              : 'Very Slow';
          console.debug(`Applying ${s} update of cost ${e}/45 `), console.debug(t);
        }
        toJSON() {
          return {
            queryFilter: this.queryFilter,
            source: this.source,
            targets: this.targets,
            storage: this.storage,
            mesh: this.mesh,
          };
        }
      }
      class ue {
        constructor(e) {
          (this.requests = { done: new Array(), stream: new O.C(10) }),
            (this._edits = null),
            (this._abortController = new AbortController()),
            (this._done = !1),
            (this.didSend = !1),
            (this.tile = e);
        }
        get signal() {
          return this._abortController.signal;
        }
        get options() {
          return { signal: this._abortController.signal };
        }
        get empty() {
          return !this.requests.done.length;
        }
        get edits() {
          return this._edits;
        }
        get done() {
          return this._done;
        }
        end() {
          this._done = !0;
        }
        clear() {
          this.requests.done = [];
        }
        applyUpdate(e) {
          this.requests.done.forEach((t) => t.message.status.unset(e)),
            (0, n.i)(this._edits) && this._edits.status.unset(e);
        }
        add(e) {
          var t;
          (e.message.status = null != (t = e.message.status) ? t : ce.empty()),
            e.message.end &&
              this.requests.done.forEach((e) => {
                (0, n.i)(e.message) && e.message.end && (e.message.end = !1);
              }),
            this.requests.done.push(e);
        }
        edit(e, t) {
          const s = e.getQuantizationTransform(),
            r = e.geometryType,
            i = Array.from(e.features()),
            o = [...t, ...i.map((e) => e.objectId)];
          this.removeIds(o),
            this._invalidate(),
            (0, n.b)(this._edits)
              ? (this._edits = {
                  type: 'append',
                  addOrUpdate: S.F.fromOptimizedFeatures(i, r, (0, n.u)(s)),
                  id: this.tile.id,
                  status: ce.empty(),
                  end: !0,
                })
              : (this.requests.done.forEach((e) => (e.message.end = !1)),
                (0, n.u)(this._edits.addOrUpdate).append(e.features()));
        }
        *readers() {
          for (const { message: e } of this.requests.done)
            (0, n.i)(e.addOrUpdate) && (yield e.addOrUpdate);
          (0, n.i)(this._edits) &&
            (0, n.i)(this._edits.addOrUpdate) &&
            (yield this._edits.addOrUpdate);
        }
        _invalidate() {
          for (const e of this.requests.done) e.message.status = ce.empty();
          (0, n.i)(this._edits) && (this._edits.status = ce.empty());
        }
        removeIds(e) {
          this._invalidate();
          for (const { message: t } of this.requests.done) {
            const s = t.addOrUpdate;
            (0, n.i)(s) && (s.removeIds(e), s.isEmpty && (t.addOrUpdate = null));
          }
          (0, n.i)(this._edits) &&
            (0, n.i)(this._edits.addOrUpdate) &&
            this._edits.addOrUpdate.removeIds(e),
            (this.requests.done = this.requests.done.filter(
              (e) => e.message.addOrUpdate || e.message.end,
            ));
        }
        abort() {
          this._abortController.abort();
        }
      }
      class de {
        constructor(e) {
          (this.events = new M.E()),
            (this._resolver = (0, c.hh)()),
            (this._didEdit = !1),
            (this._subscriptions = new Map()),
            (this._outSR = e.outSR),
            (this._serviceInfo = e.serviceInfo),
            (this._onTileUpdateMessage = e.onMessage);
        }
        destroy() {}
        async _onMessage(e) {
          var t;
          const s = this._subscriptions.get(e.id);
          if (!s) return;
          const r = { ...e, remove: null != (t = e.remove) ? t : [], status: e.status };
          return this._onTileUpdateMessage(r, s.options);
        }
        update(e, t) {
          var s;
          const r = t.fields.length;
          (t.outFields = (function (e, t) {
            const s = new Set();
            return (
              e && e.forEach((e) => s.add(e)),
              t && t.forEach((e) => s.add(e)),
              s.has('*') ? ['*'] : Array.from(s)
            );
          })(null == (s = this._schema) ? void 0 : s.outFields, t.outFields)),
            (t.outFields = t.outFields.length >= 0.75 * r ? ['*'] : t.outFields),
            t.outFields.sort();
          const i = (0, A.d)(this._schema, t);
          if (!i) return;
          (0, n.h)('esri-2d-update-debug') && console.debug('Applying Update - Source:', i);
          const o = {
              returnCentroid:
                (0, n.h)('esri-2d-query-centroid-enabled') &&
                'esriGeometryPolygon' === this._serviceInfo.geometryType,
              returnGeometry: !0,
              outFields: t.outFields,
              outSpatialReference: this._outSR,
              orderByFields: [`${this._serviceInfo.objectIdField} ASC`],
              where: t.definitionExpression || '1=1',
              gdbVersion: t.gdbVersion,
              historicMoment: t.historicMoment,
              timeExtent: C.Z.fromJSON(t.timeExtent),
            },
            a = this._schema && (0, A.h)(i, 'outFields');
          this._schema &&
            (0, A.a)(i, ['timeExtent', 'definitionExpression', 'gdbVersion', 'historicMoment']) &&
            (e.why.mesh.push('Layer filter changed'),
            e.why.source.push('Layer filter changed'),
            (e.mesh = !0),
            (e.source = !0),
            (e.queryFilter = !0)),
            a && (e.why.source.push('Layer required fields changed'), (e.source = !0)),
            (0, A.d)(o, this._queryInfo) && (this._queryInfo = o),
            (this._schema = t),
            this._resolver.resolve();
        }
        whenInitialized() {
          return this._resolver.promise;
        }
        async applyUpdate(e) {
          if (e.queryFilter || (e.source && this._didEdit))
            return this.refresh(), void (this._didEdit = !1);
          this._subscriptions.forEach((t) => t.applyUpdate(e)), await this.resend();
        }
        refresh() {
          for (const e of this._tiles()) this.unsubscribe(e), this.subscribe(e);
        }
        subscribe(e) {
          const t = new ue(e);
          this._subscriptions.set(e.id, t);
        }
        unsubscribe(e) {
          const t = this.get(e.id);
          (0, n.i)(t) && t.abort(), this._subscriptions.delete(e.id);
        }
        createQuery(e = {}) {
          const t = this._queryInfo.historicMoment
            ? new Date(this._queryInfo.historicMoment)
            : null;
          return new b.Z({ ...this._queryInfo, historicMoment: t, ...e });
        }
        get(e) {
          return this._subscriptions.has(e) ? this._subscriptions.get(e) : null;
        }
        async queryLastEditDate() {
          throw new Error('Service does not support query type');
        }
        async query(e) {
          throw new Error('Service does not support query');
        }
        *_tiles() {
          const e = Array.from(this._subscriptions.values());
          for (const t of e) yield t.tile;
        }
        async edit(e, t) {
          const s = Array.from(this._subscriptions.values()),
            r = s.map(({ tile: e }) => e);
          for (const e of s) e.removeIds(t);
          if (e.length) {
            const s = r
                .map((t) => {
                  const s = this.createTileQuery(t);
                  return (s.objectIds = e), { tile: t, query: s };
                })
                .map(async ({ tile: e, query: t }) => ({
                  tile: e,
                  result: await this.query(t),
                  query: t,
                })),
              i = (await (0, c.WW)(s)).map(async ({ tile: s, result: r }) => {
                if (!r.hasFeatures && !t.length && !e.length) return;
                const i = this._subscriptions.get(s.key.id);
                i && i.edit(r, e);
              });
            await (0, c.as)(i);
          }
          this._didEdit = !0;
        }
      }
      const pe = a.L.getLogger('esri.views.2d.layers.features.sources.BaseFeatureSource');
      class ge extends de {
        constructor(e) {
          super(e),
            (this.type = 'feature'),
            (this.mode = 'on-demand'),
            (this._adapter = (function (e) {
              const { capabilities: t } = e;
              return (s = e.source) && s.capabilities && s.collection && s.layerDefinition
                ? new le(e)
                : (function (e) {
                    return Array.isArray(e.source);
                  })(e)
                ? new oe(e)
                : t.query.supportsFormatPBF && (0, n.h)('featurelayer-pbf')
                ? new ae(e)
                : new he(e);
              var s;
            })(e.serviceInfo)),
            (this._queue = new R.Q({
              concurrency: 8,
              process: async (e) => {
                if (((0, c.k_)(e), (0, n.i)(e.tile))) {
                  const t = e.tile.key.id,
                    { signal: s } = e,
                    r = (0, n.h)('esri-tiles-debug')
                      ? { tile: t.replace(/\//g, '.'), depth: e.depth }
                      : void 0;
                  return this._adapter.executeQuery(e.query, { query: r, signal: s });
                }
                return this._adapter.executeQuery(e.query, e);
              },
            })),
            (this._patchQueue = new R.Q({
              concurrency: 8,
              process: async (e) => {
                if (((0, c.k_)(e), (0, n.i)(e.tile))) {
                  const t = e.tile.key.id,
                    { signal: s } = e,
                    r = (0, n.h)('esri-tiles-debug')
                      ? { tile: t.replace(/\//g, '.'), depth: e.depth }
                      : void 0;
                  return this._adapter.executeQuery(e.query, { query: r, signal: s });
                }
                return this._adapter.executeQuery(e.query, e);
              },
            }));
        }
        destroy() {
          super.destroy(),
            this._adapter.destroy(),
            this._queue.destroy(),
            this._patchQueue.destroy();
        }
        get updating() {
          return (
            !!this._queue.length || Array.from(this._subscriptions.values()).some((e) => !e.done)
          );
        }
        get maxRecordCountFactor() {
          const { query: e } = this._serviceInfo.capabilities;
          return e.supportsMaxRecordCountFactor ? 4 : null;
        }
        get maxPageSize() {
          var e;
          const { query: t } = this._serviceInfo.capabilities;
          return (
            (null != (e = t.maxRecordCount) ? e : 8e3) * (0, n.d)(this.maxRecordCountFactor, 1)
          );
        }
        get pageSize() {
          return Math.min(8e3, this.maxPageSize);
        }
        enableEvent(e, t) {}
        subscribe(e) {
          super.subscribe(e);
          const t = this._subscriptions.get(e.id);
          this._fetchDataTile(e)
            .catch((t) => {
              (0, c.D_)(t) ||
                pe.error(
                  new y.Z('mapview-query-error', 'Encountered error when fetching tile', {
                    tile: e,
                    error: t,
                  }),
                );
            })
            .then(() => t.end());
        }
        unsubscribe(e) {
          super.unsubscribe(e);
        }
        readers(e) {
          return this._subscriptions.get(e).readers();
        }
        async query(e) {
          return this._adapter.executeQuery(e);
        }
        async queryLastEditDate() {
          const e = this._serviceInfo.source,
            t = { ...e.query, f: 'json' };
          return (await (0, m.default)(e.path, { query: t, responseType: 'json' })).data.editingInfo
            .lastEditDate;
        }
        createTileQuery(e) {
          const t = this.createQuery();
          return (
            (t.quantizationParameters = e.getQuantizationParameters()),
            (t.resultType = 'tile'),
            (t.geometry = e.extent),
            'esriGeometryPolyline' === this._serviceInfo.geometryType &&
              (t.maxAllowableOffset = e.resolution),
            this._serviceInfo.capabilities.query.supportsQuantization ||
              ((t.quantizationParameters = null), (t.maxAllowableOffset = e.resolution)),
            t
          );
        }
        _createQuery(e, t) {
          const s = this._queryInfo.historicMoment
              ? new Date(this._queryInfo.historicMoment)
              : null,
            r = new b.Z({ ...this._queryInfo, historicMoment: s, ...t });
          return (
            this._serviceInfo.capabilities.query.supportsQuantization ||
              ((t.quantizationParameters = null), (r.maxAllowableOffset = e.resolution)),
            t.quantizationParameters &&
              'esriGeometryPolyline' === this._serviceInfo.geometryType &&
              (r.maxAllowableOffset = e.resolution),
            (r.resultType = 'tile'),
            (r.geometry = e.extent),
            r
          );
        }
        async _executePatchQuery(e, t, s, r) {
          const i = t.clone();
          (i.outFields = [this._serviceInfo.objectIdField, ...s]),
            (i.returnCentroid = !1),
            (i.returnGeometry = !1);
          const o = (0, n.i)(i.start) ? i.start / 8e3 : 0,
            a = r.signal;
          return this._patchQueue.push({ tile: e, query: i, signal: a, depth: o });
        }
        async _resend(e, t) {
          const { query: s, message: r } = e,
            i = (0, n.i)(s.outFields) ? s.outFields : [],
            o = this._queryInfo.outFields,
            a = o.filter((e) => -1 === i.indexOf(e));
          if ((0, n.b)(r.addOrUpdate)) this._onMessage({ ...r, type: 'append' });
          else if (a.length)
            try {
              const e = this._subscriptions.get(r.id).tile,
                i = await this._executePatchQuery(e, s, a, t);
              (0, c.k_)(t),
                (s.outFields = o),
                r.addOrUpdate.joinAttributes(i),
                this._onMessage({ ...r, end: r.end, type: 'append' });
            } catch (e) {}
          else this._onMessage({ ...r, type: 'append' });
        }
        async _resendSubscription(e) {
          if (e.empty)
            return this._onMessage({ id: e.tile.id, addOrUpdate: null, end: !1, type: 'append' });
          const t = e.signal;
          for (const s of e.requests.done) await this._resend(s, { signal: t });
          return (0, n.i)(e.edits) ? this._onMessage(e.edits) : void 0;
        }
        async resend() {
          const e = Array.from(this._subscriptions.values());
          await Promise.all(e.map((e) => this._resendSubscription(e)));
        }
      }
      const fe = (0, n.h)('esri-mobile'),
        _e = { maxDrillLevel: fe ? 1 : 4, maxRecordCountFactor: fe ? 1 : 3 };
      class me extends ge {
        constructor(e) {
          super(e);
        }
        async _fetchDataTile(e) {
          const t = this._serviceInfo.capabilities.query.supportsMaxRecordCountFactor,
            s = this._subscriptions.get(e.key.id),
            r = s.signal,
            i = e.getQuantizationParameters();
          let n = 0;
          const o = async (a, h) => {
            const l = this._queryInfo,
              u = this._createQuery(a, {
                maxRecordCountFactor: t ? _e.maxRecordCountFactor : void 0,
                returnExceededLimitFeatures: !1,
                quantizationParameters: i,
              });
            n++;
            try {
              const t = await this._queue.push({ tile: e, query: u, signal: r, depth: h });
              if ((n--, (0, c.k_)(r), !t)) return;
              if (l !== this._queryInfo) return void o(a, h);
              if (t.exceededTransferLimit && h < _e.maxDrillLevel) {
                for (const e of a.createChildTiles()) o(e, h + 1);
                return;
              }
              const i = { id: e.id, addOrUpdate: t, end: 0 === n, type: 'append' };
              s.add({ query: u, message: i }), this._onMessage(i);
            } catch (t) {
              (0, c.D_)(t) ||
                this._onMessage({ id: e.id, addOrUpdate: null, end: !0, type: 'append' });
            }
          };
          o(e, 0);
        }
      }
      function ye(e, t) {
        const s = e.weakClone(),
          r = (0, d.t)(t, e.geometry.coords[0]),
          i = (0, d.v)(t, e.geometry.coords[1]);
        return (s.geometry = new F.a([], [r, i])), s;
      }
      class be {
        constructor(e, t) {
          (this.onUpdate = e), (this._geometryType = t), (this._objectIdToFeature = new Map());
        }
        get _features() {
          const e = [];
          return this._objectIdToFeature.forEach((t) => e.push(t)), e;
        }
        add(e) {
          this._objectIdToFeature.set(e.objectId, e), (this._index = null);
        }
        get(e) {
          return this._objectIdToFeature.has(e) ? this._objectIdToFeature.get(e) : null;
        }
        forEach(e) {
          this._objectIdToFeature.forEach(e);
        }
        search(e) {
          return (
            this._index ||
              (this._index = (function (e, t) {
                const s = (0, S.r)(
                  9,
                  (function (e) {
                    switch (e) {
                      case 'esriGeometryPoint':
                        return (e) => ({
                          minX: e.geometry.coords[0],
                          minY: e.geometry.coords[1],
                          maxX: e.geometry.coords[0],
                          maxY: e.geometry.coords[1],
                        });
                      default:
                        return (e) => {
                          let t = 1 / 0,
                            s = 1 / 0,
                            r = -1 / 0,
                            i = -1 / 0;
                          return (
                            e.geometry.forEachVertex((e, n) => {
                              (t = Math.min(t, e)),
                                (s = Math.min(s, n)),
                                (r = Math.max(r, e)),
                                (i = Math.max(i, n));
                            }),
                            { minX: t, minY: s, maxX: r, maxY: i }
                          );
                        };
                    }
                  })(t),
                );
                return s.load(e), s;
              })(this._features, this._geometryType)),
            (function (e, t) {
              return e.search({
                minX: t.bounds[0],
                minY: t.bounds[1],
                maxX: t.bounds[2],
                maxY: t.bounds[3],
              });
            })(this._index, e)
          );
        }
        removeById(e) {
          const t = this._objectIdToFeature.get(e);
          return t ? (this._objectIdToFeature.delete(e), (this._index = null), t) : null;
        }
        update(e, t) {
          this.onUpdate(e, t);
        }
        get size() {
          return this._objectIdToFeature.size;
        }
      }
      class xe extends de {
        constructor(e) {
          super(e),
            (this.type = 'geoevent'),
            (this._dataReceiveEventEnabled = !1),
            (this._level = 0),
            (this._updateInfo = { websocket: 0, client: 0 });
          const { outSR: t } = e,
            {
              geometryType: s,
              objectIdField: r,
              timeInfo: i,
              purgeOptions: n,
              source: o,
              spatialReference: a,
              serviceFilter: h,
              maxReconnectionAttempts: l,
              maxReconnectionInterval: c,
              updateInterval: u,
            } = e.serviceInfo,
            p = new be(this._onUpdate.bind(this), s),
            g = new N(p, r, i, n),
            f = (function (e, t, s, r, i, n, o) {
              const a = 0 === e.path.indexOf('wss://') || 0 === e.path.indexOf('ws://'),
                h = {
                  source: e,
                  sourceSpatialReference: t,
                  spatialReference: s,
                  geometryType: r,
                  filter: i,
                  maxReconnectionAttempts: n,
                  maxReconnectionInterval: o,
                };
              return a ? new X(h) : new Z(h);
            })(o, a, t, s, h, l, c);
          (this._store = p),
            (this._manager = g),
            (this._connection = f),
            (this._quantize = (function (e) {
              switch (e) {
                case 'esriGeometryPoint':
                  return ye;
                case 'esriGeometryPolygon':
                case 'esriGeometryPolyline':
                default:
                  return (t, s) => {
                    const r = t.weakClone(),
                      i = new F.a(),
                      n = (0, d.q)(i, t.geometry, !1, !1, e, s, !1, !1);
                    return (r.geometry = n), r;
                  };
              }
            })(s)),
            (this._handles = [
              this._connection.on('feature', (e) => this._onFeature(e)),
              this._connection.watch('connectionStatus', (e) =>
                this.events.emit('connectionStatus', e),
              ),
              this._connection.watch('errorString', (e) => this.events.emit('errorString', e)),
            ]);
          let _ = performance.now();
          this._updateIntervalId = setInterval(() => {
            const t = performance.now(),
              s = t - _;
            if (s > 2500) {
              _ = t;
              const e = Math.round(this._updateInfo.client / (s / 1e3)),
                r = Math.round(this._updateInfo.websocket / (s / 1e3));
              (this._updateInfo.client = 0),
                (this._updateInfo.websocket = 0),
                this.events.emit('updateRate', { client: e, websocket: r });
            }
            e.canAcceptRequest() && this._manager.checkForUpdates();
          }, u);
        }
        destroy() {
          super.destroy(),
            clearInterval(this._updateIntervalId),
            this._handles.forEach((e) => e.remove()),
            this._connection.destroy();
        }
        _fetchDataTile() {}
        resume() {}
        enableEvent(e, t) {
          'data-received' === e && (this._dataReceiveEventEnabled = t);
        }
        get updating() {
          return !1;
        }
        subscribe(e) {
          super.subscribe(e);
          const t = this._subscriptions.get(e.id);
          this._level = e.level;
          const s = this._getTileFeatures(e);
          this._onMessage({ type: 'append', id: e.key.id, addOrUpdate: s, end: !0 }),
            (t.didSend = !0);
        }
        unsubscribe(e) {
          super.unsubscribe(e);
        }
        *readers(e) {
          const t = this._subscriptions.get(e),
            { tile: s } = t;
          yield this._getTileFeatures(s);
          for (const e of t.requests.stream.entries)
            (0, n.i)(e) && (0, n.i)(e.addOrUpdate) && (yield e.addOrUpdate);
        }
        createTileQuery(e) {
          throw new Error('Service does not support tile  queries');
        }
        async resend() {
          this._subscriptions.forEach((e) => {
            const { tile: t } = e,
              s = { type: 'append', id: t.id, addOrUpdate: this._getTileFeatures(t), end: !0 };
            this._onMessage(s);
          });
        }
        _getTileFeatures(e) {
          const t = this._store.search(e).map((t) => this._quantize(t, e.transform));
          return S.F.fromOptimizedFeatures(t, this._serviceInfo.geometryType, e.transform);
        }
        _onFeature(e) {
          this._updateInfo.websocket++;
          try {
            this._dataReceiveEventEnabled && this.events.emit('feature', e);
            const t = (0, d.p)(
              e,
              this._serviceInfo.geometryType,
              !1,
              !1,
              this._serviceInfo.objectIdField,
            );
            this._manager.add(t);
          } catch (e) {}
        }
        _onUpdate(e, t) {
          (0, n.i)(e) && (this._updateInfo.client += e.length),
            this._subscriptions.forEach((e, t) => {
              e.didSend &&
                e.tile.level === this._level &&
                this._onMessage({ type: 'append', id: t, addOrUpdate: null, clear: !0, end: !1 });
            }),
            this._subscriptions.forEach((e, t) => {
              if (!e.didSend || e.tile.level !== this._level) return;
              const s = e.tile,
                r = {
                  type: 'append',
                  id: t,
                  addOrUpdate: this._getTileFeatures(s),
                  remove: [],
                  end: !0,
                  status: ce.empty(),
                };
              e.requests.stream.enqueue(r), this._onMessage(r);
            });
        }
      }
      const Ie = a.L.getLogger('esri.views.2d.layers.features.sources.FeatureSource');
      class we extends ge {
        constructor(e) {
          super(e);
        }
        async _fetchDataTile(e) {
          const t = this._subscriptions.get(e.key.id);
          let s = !1,
            r = 0,
            i = 0;
          const n = (r, n) => {
            i--, (0, c.k_)(t);
            const o = e.id,
              a = r.reader,
              h = r.query;
            if (!a.exceededTransferLimit) {
              if (((s = !0), 0 !== n && !a.hasFeatures)) {
                const e = { id: o, addOrUpdate: a, end: 0 === i, type: 'append' };
                return t.add({ message: e, query: h }), void this._onMessage(e);
              }
              const e = { id: o, addOrUpdate: a, end: 0 === i, type: 'append' };
              return t.add({ message: e, query: h }), void this._onMessage(e);
            }
            const l = { id: o, addOrUpdate: a, end: s && 0 === i, type: 'append' };
            t.add({ message: l, query: h }), this._onMessage(l);
          };
          let o = 0,
            a = 0;
          for (; !s && a++ < 20; ) {
            let a;
            for (let h = 0; h < o + 1; h++) {
              const o = r++;
              i++,
                (a = this._fetchDataTilePage(e, o, t)
                  .then((e) => e && n(e, o))
                  .catch((t) => {
                    (s = !0),
                      (0, c.D_)(t) ||
                        (Ie.error(
                          new y.Z('mapview-query-error', 'Encountered error when fetching tile', {
                            tile: e,
                            error: t,
                          }),
                        ),
                        this._onMessage({ id: e.id, addOrUpdate: null, end: s, type: 'append' }));
                  }));
            }
            await a, (0, c.k_)(t), (o = Math.min(o + 2, 6));
          }
        }
        async _fetchDataTilePage(e, t, s) {
          const r = this._queryInfo,
            i = {
              start: this.pageSize * t,
              num: this.pageSize,
              returnExceededLimitFeatures: !0,
              quantizationParameters: e.getQuantizationParameters(),
            };
          (0, n.i)(this.maxRecordCountFactor) &&
            (i.maxRecordCountFactor = this.maxRecordCountFactor);
          const o = this._createQuery(e, i);
          try {
            const i = s.signal,
              n = await this._queue.push({ tile: e, query: o, signal: i, depth: t });
            return (
              (0, c.k_)(s),
              n
                ? r !== this._queryInfo
                  ? this._fetchDataTilePage(e, t, s)
                  : { reader: n, query: o }
                : null
            );
          } catch (e) {
            return (0, c.H9)(e), null;
          }
        }
      }
      const ve = a.L.getLogger('esri.views.2d.layers.features.sources.SnapshotFeatureSource');
      function Se(e, t, s) {
        const r = e.getXHydrate(),
          i = e.getYHydrate(),
          n = t.getColumnForX(r),
          o = Math.floor(t.normalizeCol(n));
        return `${s}/${Math.floor(t.getRowForY(i))}/${o}`;
      }
      function Te(e, t) {
        if ((0, n.b)(e)) return null;
        const s = t.transform,
          r = e.getQuantizationTransform();
        if ((0, n.b)(r)) {
          const [t, r] = s.scale,
            [i, n] = s.translate,
            o = -i / t,
            a = 1 / t,
            h = n / r,
            l = 1 / -r;
          return e.transform(o, h, a, l);
        }
        const [i, o] = r.scale,
          [a, h] = r.translate,
          [l, c] = s.scale,
          [u, d] = s.translate,
          p = i / l,
          g = (a - u) / l,
          f = o / c,
          _ = (-h + d) / c;
        return e.transform(g, _, p, f);
      }
      class Fe extends ge {
        constructor(e) {
          super(e),
            (this.mode = 'snapshot'),
            (this._loading = !0),
            (this._controller = new AbortController()),
            (this._downloadPromise = null),
            (this._didSendEnd = !1),
            (this._queries = new Array()),
            (this._invalidated = !1),
            (this._hasAggregates = !1),
            (this._random = new Q.R(1e3)),
            (this._featureCount = e.featureCount),
            (this._store = e.store),
            (this._markedIdsBufId = this._store.storage.createBitset());
        }
        destroy() {
          super.destroy(), this._controller.abort();
        }
        get loading() {
          return this._loading;
        }
        get _signal() {
          return this._controller.signal;
        }
        update(e, t) {
          super.update(e, t), (this._hasAggregates = e.targets.aggregate);
        }
        async resend(e = !1) {
          if ((await this._downloadPromise, this._invalidated || e))
            return (
              (this._invalidated = !1),
              this._subscriptions.forEach((e) => e.clear()),
              (this._downloadPromise = this._download(this._featureCount)),
              void (await this._downloadPromise)
            );
          const t = this._queries.map(({ query: e, reader: t }) => this._sendPatchQuery(e, t));
          await Promise.all(t),
            this._subscriptions.forEach((e) => {
              e.requests.done.forEach((e) => this._onMessage(e.message));
            });
        }
        async refresh() {
          await this.resend(!0);
        }
        async _sendPatchQuery(e, t) {
          const s = (0, n.i)(e.outFields) ? e.outFields : [],
            r = this._queryInfo.outFields,
            i = r.filter((e) => -1 === s.indexOf(e));
          if (!i.length) return;
          const o = e.clone(),
            a = this._signal;
          (o.returnGeometry = !1), (o.returnCentroid = !1), (o.outFields = i), (e.outFields = r);
          const h = await this._queue.push({ query: o, depth: 0, signal: a });
          (0, c.k_)({ signal: a }), t.joinAttributes(h);
        }
        async _fetchDataTile(e) {
          this._downloadPromise || (this._downloadPromise = this._download(this._featureCount));
          const t = this._store.search(e),
            s = this._subscriptions.get(e.key.id),
            r = t.length - 1;
          for (let i = 0; i < r; i++) {
            const r = Te(t[i], e),
              n = { type: 'append', id: e.id, addOrUpdate: r, end: !1, status: ce.empty() };
            s.add({ query: null, message: n }),
              this._hasAggregates || (await (0, c.e4)(1)),
              this._onMessage(n);
          }
          const i = Te(r >= 0 ? t[r] : null, e),
            n = this._didSendEnd,
            o = { type: 'append', id: e.id, addOrUpdate: i, end: n, status: ce.empty() };
          s.add({ query: null, message: o }), this._onMessage(o);
        }
        async _download(e) {
          try {
            await this.whenInitialized();
            const t = this._store.storage.getBitset(this._markedIdsBufId),
              s = new Set();
            t.clear();
            const r = Math.ceil(e / this.pageSize),
              i = Array.from({ length: r }, (e, t) => t)
                .sort((e, t) => this._random.getInt() - this._random.getInt())
                .map((e) => this._downloadPage(e, t, s));
            await Promise.all(i),
              this._store.sweepFeatures(t, this._store.storage),
              this._store.sweepFeatureSets(s);
          } catch (e) {
            ve.error(
              'mapview-snapshot-source',
              'Encountered and error when downloading feature snapshot',
              e,
            );
          }
          this._sendEnd(), (this._loading = !1);
        }
        async _downloadPage(e, t, s) {
          const r = this.pageSize,
            i = { start: e * r, num: r, cacheHint: !0 };
          (0, n.i)(this.maxRecordCountFactor) &&
            (i.maxRecordCountFactor = this.maxRecordCountFactor);
          const o = this.createQuery(i),
            a = this._signal,
            h = await this._queue.push({ query: o, depth: e, signal: a });
          (0, c.k_)({ signal: a }),
            this._queries.push({ query: o, reader: h }),
            this._store.insert(h),
            s.add(h.instance);
          const l = h.getCursor();
          for (; l.next(); ) t.set(l.getDisplayId());
          this._send(h);
        }
        _send(e) {
          if (!this._subscriptions.size) return;
          let t = null;
          const s = new Map(),
            r = new Set(),
            i = new Map();
          this._subscriptions.forEach((e) => {
            var n;
            const o = e.tile;
            s.set(o.key.id, null), (t = o.tileInfoView), r.add(o.level);
            const { row: a, col: h } = o.key,
              l = `${o.level}/${a}/${h}`,
              c = null != (n = i.get(l)) ? n : [];
            c.push(e), i.set(l, c);
          });
          for (const o of r) {
            const r = t.getLODInfoAt(o),
              a = e.getCursor();
            for (; a.next(); ) {
              const e = Se(a, r, o),
                t = a.getIndex();
              if (i.has(e))
                for (const r of i.get(e)) {
                  const e = r.tile.id;
                  let i = s.get(e);
                  (0, n.b)(i) && ((i = []), s.set(e, i)), i.push(t);
                }
            }
          }
          s.forEach((t, s) => {
            if ((0, n.i)(t)) {
              const r = this._subscriptions.get(s),
                i = {
                  type: 'append',
                  id: s,
                  addOrUpdate: Te(f.F.from(e, t), r.tile),
                  end: !1,
                  status: ce.empty(),
                };
              r.add({ query: null, message: i }), this._onMessage(i);
            }
          });
        }
        _sendEnd() {
          this._subscriptions.forEach((e) => {
            const t = {
              type: 'append',
              id: e.tile.id,
              addOrUpdate: null,
              end: !0,
              status: ce.empty(),
            };
            e.add({ query: null, message: t }), this._onMessage(t);
          }),
            (this._didSendEnd = !0);
        }
      }
      function ke(e, t, s, r) {
        r % 2 && (r += 1);
        let i = 0,
          n = 0,
          o = -90,
          a = 90,
          h = -180,
          l = 180;
        for (let e = 0; e < r / 2; e++) {
          for (let t = 0; t < 5; t++) {
            const r = (h + l) / 2,
              n = s > r ? 1 : 0;
            (i |= n << (29 - (t + 5 * e))), (h = (1 - n) * h + n * r), (l = (1 - n) * r + n * l);
          }
          for (let s = 0; s < 5; s++) {
            const r = (o + a) / 2,
              i = t > r ? 1 : 0;
            (n |= i << (29 - (s + 5 * e))), (o = (1 - i) * o + i * r), (a = (1 - i) * r + i * a);
          }
        }
        (e.geohashX = i), (e.geohashY = n);
      }
      function Ee(e, t, s, r, i) {
        i % 2 && (i += 1);
        let n = 0,
          o = 0,
          a = -90,
          h = 90,
          l = -180,
          c = 180;
        for (let e = 0; e < i / 2; e++) {
          for (let t = 0; t < 5; t++) {
            const s = (l + c) / 2,
              i = r > s ? 1 : 0;
            (n |= i << (29 - (t + 5 * e))), (l = (1 - i) * l + i * s), (c = (1 - i) * s + i * c);
          }
          for (let t = 0; t < 5; t++) {
            const r = (a + h) / 2,
              i = s > r ? 1 : 0;
            (o |= i << (29 - (t + 5 * e))), (a = (1 - i) * a + i * r), (h = (1 - i) * r + i * h);
          }
        }
        (e[2 * t] = n), (e[2 * t + 1] = o);
      }
      class Ce {
        constructor(e = [], t = 8096) {
          (this._nodes = 0),
            (this._root = new Me(0, 0, 0)),
            (this._statisticFields = e),
            (this._pool = t ? new O.C(8096) : null);
        }
        _acquire(e, t, s) {
          this._nodes++;
          let r = null;
          return (
            (0, n.i)(this._pool) && (r = this._pool.dequeue()),
            (0, n.i)(r) ? r.realloc(e, t, s) : new Me(e, t, s)
          );
        }
        _release(e) {
          this._nodes--, (0, n.i)(this._pool) && this._pool.enqueue(e);
        }
        get count() {
          return this._root.count;
        }
        get size() {
          return this._nodes;
        }
        get poolSize() {
          return (0, n.m)(this._pool, 0, (e) => e.size);
        }
        get depth() {
          let e = 0;
          return this._forEachNode((t) => (e = Math.max(e, t.depth))), e;
        }
        dropLevels(e) {
          this._forEachNode((t) => {
            if (t.depth >= e)
              for (let e = 0; e < t.children.length; e++) {
                const s = t.children[e];
                (t.children[e] = null), s && this._release(s);
              }
          });
        }
        clear() {
          this.dropLevels(0);
        }
        insert(e, t, s = 0) {
          const r = S.F.fromOptimizedFeatures([e], 'esriGeometryPoint').getCursor();
          r.next();
          const i = r.readGeometry();
          if (!i) return;
          const [n, o] = i.coords,
            a = e.geohashX,
            h = e.geohashY;
          this.insertCursor(r, e.displayId, n, o, a, h, t, s);
        }
        insertCursor(e, t, s, r, i, n, o, a = 0) {
          let h = this._root,
            l = 0,
            c = 0,
            u = 0;
          for (; null !== h; ) {
            if (
              (h.depth >= a &&
                ((h.count += 1),
                (h.xTotal += s),
                (h.yTotal += r),
                (h.xGeohashTotal += i),
                (h.yGeohashTotal += n),
                (h.displayId = t),
                this._updateStatisticsCursor(e, h, 1)),
              l >= o)
            )
              return void h.add(t);
            const d = Math.ceil((l + 1) / 2),
              p = Math.floor((l + 1) / 2),
              g = 1 - (l % 2),
              f = 30 - (3 * d + 2 * p),
              _ = 30 - (2 * d + 3 * p),
              m = (i & ((7 * g + 3 * (1 - g)) << f)) >> f,
              y = (n & ((3 * g + 7 * (1 - g)) << _)) >> _,
              b = m + y * (8 * g + 4 * (1 - g));
            (c = (c << (3 * g + 2 * (1 - g))) | m),
              (u = (u << (2 * g + 3 * (1 - g))) | y),
              null == h.children[b] && (h.children[b] = this._acquire(c, u, l + 1)),
              (l += 1),
              (h = h.children[b]);
          }
        }
        remove(e, t) {
          const s = S.F.fromOptimizedFeatures([e], 'esriGeometryPoint').getCursor();
          s.next();
          const r = s.readGeometry();
          if (!r) return;
          const [i, n] = r.coords,
            o = e.geohashX,
            a = e.geohashY;
          this.removeCursor(s, i, n, o, a, t);
        }
        removeCursor(e, t, s, r, i, n) {
          let o = this._root,
            a = 0;
          for (; null !== o; ) {
            if (
              ((o.count -= 1),
              (o.xTotal -= t),
              (o.yTotal -= s),
              (o.xGeohashTotal -= r),
              (o.yGeohashTotal -= i),
              this._updateStatisticsCursor(e, o, -1),
              a >= n)
            )
              return void o.remove(e.getDisplayId());
            const h = Math.ceil((a + 1) / 2),
              l = Math.floor((a + 1) / 2),
              c = 1 - (a % 2),
              u = 30 - (3 * h + 2 * l),
              d = 30 - (2 * h + 3 * l),
              p =
                ((r & ((7 * c + 3 * (1 - c)) << u)) >> u) +
                ((i & ((3 * c + 7 * (1 - c)) << d)) >> d) * (8 * c + 4 * (1 - c)),
              g = o.children[p];
            1 === g.count && (this._release(g), (o.children[p] = null)), (a += 1), (o = g);
          }
        }
        find(e, t, s) {
          return this._root.find(e, t, s, 0, 0, 0);
        }
        findSingleOccupancyNode(e, t, s, r, i) {
          let n = this._root;
          for (; null !== n; ) {
            const o = n.depth,
              a = n.xNode,
              h = n.yNode,
              l = 1 - (o % 2),
              c = n.xGeohashTotal / n.count,
              u = n.yGeohashTotal / n.count;
            if (1 === n.count && e < c && c <= s && t < u && u <= r) return n;
            if (o >= i) {
              n = n.next;
              continue;
            }
            const d = Math.ceil((o + 1) / 2),
              p = Math.floor((o + 1) / 2),
              g = 30 - (3 * d + 2 * p),
              f = 30 - (2 * d + 3 * p),
              _ = ~((1 << g) - 1),
              m = ~((1 << f) - 1),
              y = (e & _) >> g,
              b = (t & m) >> f,
              x = (s & _) >> g,
              I = (r & m) >> f,
              w = a << (3 * l + 2 * (1 - l)),
              v = h << (2 * l + 3 * (1 - l)),
              S = w + 8 * l + 4 * (1 - l),
              T = v + 4 * l + 8 * (1 - l),
              F = Math.max(w, y),
              k = Math.max(v, b),
              E = Math.min(S, x),
              C = Math.min(T, I);
            let M = null,
              A = null;
            for (let e = k; e <= C; e++)
              for (let t = F; t <= E; t++) {
                const s = t - w + (e - v) * (8 * l + 4 * (1 - l)),
                  r = n.children[s];
                r &&
                  (M || ((M = r), (M.next = n.next)),
                  A && (A.next = r),
                  (A = r),
                  (r.next = n.next));
              }
            n = M || n.next;
          }
          return null;
        }
        getRegionDisplayIds(e, t, s, r, i) {
          let n = this._root;
          const o = [];
          for (; null !== n; ) {
            const a = n.depth,
              h = n.xNode,
              l = n.yNode;
            if (a >= i) {
              const i = n.xGeohashTotal / n.count,
                a = n.yGeohashTotal / n.count;
              e <= i && i <= s && t <= a && a <= r && n.displayIds.forEach((e) => o.push(e)),
                (n = n.next);
              continue;
            }
            const c = Math.ceil((a + 1) / 2),
              u = Math.floor((a + 1) / 2),
              d = 1 - (a % 2),
              p = 30 - (3 * c + 2 * u),
              g = 30 - (2 * c + 3 * u),
              f = ~((1 << p) - 1),
              _ = ~((1 << g) - 1),
              m = (e & f) >> p,
              y = (t & _) >> g,
              b = (s & f) >> p,
              x = (r & _) >> g,
              I = h << (3 * d + 2 * (1 - d)),
              w = l << (2 * d + 3 * (1 - d)),
              v = I + 8 * d + 4 * (1 - d),
              S = w + 4 * d + 8 * (1 - d),
              T = Math.max(I, m),
              F = Math.max(w, y),
              k = Math.min(v, b),
              E = Math.min(S, x);
            let C = null,
              M = null;
            for (let e = F; e <= E; e++)
              for (let t = T; t <= k; t++) {
                const s = t - I + (e - w) * (8 * d + 4 * (1 - d)),
                  r = n.children[s];
                r &&
                  (C || ((C = r), (C.next = n.next)),
                  M && (M.next = r),
                  (M = r),
                  (r.next = n.next));
              }
            n = C || n.next;
          }
          return o;
        }
        getRegionStatistics(e, t, s, r, i) {
          let n = this._root,
            o = 0,
            a = 0,
            h = 0;
          const l = {};
          let c = 0;
          for (; null !== n; ) {
            const u = n.depth,
              d = n.xNode,
              p = n.yNode;
            if (u >= i) {
              const i = n.xGeohashTotal / n.count,
                u = n.yGeohashTotal / n.count;
              e < i &&
                i <= s &&
                t < u &&
                u <= r &&
                ((o += n.count),
                (a += n.xTotal),
                (h += n.yTotal),
                1 === n.count && (c = n.displayId),
                this._aggregateStatistics(l, n.statistics)),
                (n = n.next);
              continue;
            }
            const g = Math.ceil((u + 1) / 2),
              f = Math.floor((u + 1) / 2),
              _ = 1 - (u % 2),
              m = 30 - (3 * g + 2 * f),
              y = 30 - (2 * g + 3 * f),
              b = ~((1 << m) - 1),
              x = ~((1 << y) - 1),
              I = (e & b) >> m,
              w = (t & x) >> y,
              v = (s & b) >> m,
              S = (r & x) >> y,
              T = d << (3 * _ + 2 * (1 - _)),
              F = p << (2 * _ + 3 * (1 - _)),
              k = T + 8 * _ + 4 * (1 - _),
              E = F + 4 * _ + 8 * (1 - _),
              C = Math.max(T, I),
              M = Math.max(F, w),
              A = Math.min(k, v),
              O = Math.min(E, S);
            let R = null,
              L = null;
            for (let i = M; i <= O; i++)
              for (let u = C; u <= A; u++) {
                const d = u - T + (i - F) * (8 * _ + 4 * (1 - _)),
                  p = n.children[d];
                if (p) {
                  if (i !== M && i !== O && u !== C && u !== A) {
                    const i = p.xGeohashTotal / p.count,
                      n = p.yGeohashTotal / p.count;
                    e < i &&
                      i <= s &&
                      t < n &&
                      n <= r &&
                      ((o += p.count),
                      (a += p.xTotal),
                      (h += p.yTotal),
                      1 === p.count && (c = p.displayId),
                      this._aggregateStatistics(l, p.statistics));
                    continue;
                  }
                  R || ((R = p), (R.next = n.next)), L && (L.next = p), (L = p), (p.next = n.next);
                }
              }
            n = R || n.next;
          }
          return {
            count: o,
            attributes: this._normalizeStatistics(l, o),
            xTotal: a,
            yTotal: h,
            referenceId: c,
          };
        }
        _forEachNode(e) {
          let t = this._root;
          for (; null !== t; ) {
            const s = this._linkChildren(t) || t.next;
            e(t), (t = s);
          }
        }
        _linkChildren(e) {
          let t = null,
            s = null;
          for (let r = 0; r <= e.children.length; r++) {
            const i = e.children[r];
            i && (t || ((t = i), (t.next = e.next)), s && (s.next = i), (s = i), (i.next = e.next));
          }
          return t;
        }
        _updateStatisticsCursor(e, t, s) {
          for (const r of this._statisticFields) {
            const i = r.name,
              n = r.inField
                ? e.readAttribute(r.inField)
                : e.getComputedNumericAtIndex(r.inFieldIndex);
            switch (r.statisticType) {
              case 'norm': {
                t.statistics[i] || (t.statistics[i] = {});
                const o = r.inNormalizationField,
                  a = e.readAttribute(o),
                  h = t.statistics[i].onStatisticField || 0,
                  l = t.statistics[i].onStatisticNormalizationField || 0;
                null == n ||
                  isNaN(n) ||
                  null == a ||
                  0 === a ||
                  isNaN(a) ||
                  ((t.statistics[i].onStatisticField = h + s * n),
                  (t.statistics[i].onStatisticNormalizationField = l + s * a));
                break;
              }
              case 'sum':
              case 'avg': {
                t.statistics[i] || (t.statistics[i] = { value: 0, nanCount: 0 });
                const e = t.statistics[i].value,
                  r = t.statistics[i].nanCount;
                null == n || isNaN(n)
                  ? (t.statistics[i].nanCount = r + s)
                  : (t.statistics[i].value = e + s * n);
                break;
              }
              case 'avg_angle': {
                t.statistics[i] || (t.statistics[i] = { x: 0, y: 0, nanCount: 0 });
                const e = t.statistics[i].x,
                  r = t.statistics[i].y,
                  o = t.statistics[i].nanCount,
                  a = Math.PI / 180;
                null == n || isNaN(n)
                  ? (t.statistics[i].nanCount = o + s)
                  : ((t.statistics[i].x = e + s * Math.cos(n * a)),
                    (t.statistics[i].y = r + s * Math.sin(n * a)));
                break;
              }
              case 'mode': {
                t.statistics[i] || (t.statistics[i] = {});
                const e = t.statistics[i][n] || 0;
                t.statistics[i][n] = e + s;
                break;
              }
            }
          }
        }
        _aggregateStatistics(e, t) {
          for (const s of this._statisticFields) {
            const r = s.name;
            switch (s.statisticType) {
              case 'sum':
              case 'avg':
              case 'avg_angle':
              case 'mode':
              case 'norm':
                e[r] || (e[r] = {});
                for (const s in t[r]) {
                  const i = e[r][s] || 0;
                  e[r][s] = i + t[r][s];
                }
            }
          }
        }
        _normalizeStatistics(e, t) {
          const s = {};
          for (const r of this._statisticFields) {
            const i = r.name;
            switch (r.statisticType) {
              case 'norm': {
                const r = e[i];
                if (t && null == r.onStatisticNormalizationField) break;
                if (t && r.onStatisticNormalizationField) {
                  s[i] = r.onStatisticField / r.onStatisticNormalizationField;
                  break;
                }
                s[i] = 0;
                break;
              }
              case 'sum': {
                if (!t) break;
                const { value: r, nanCount: n } = e[i];
                if (!(t - n)) break;
                s[i] = r;
                break;
              }
              case 'avg': {
                if (!t) break;
                const { value: r, nanCount: n } = e[i];
                if (!(t - n)) break;
                s[i] = r / (t - n);
                break;
              }
              case 'avg_angle': {
                if (!t) break;
                const { x: r, y: n, nanCount: o } = e[i];
                if (!(t - o)) break;
                const a = r / (t - o),
                  h = n / (t - o),
                  l = 180 / Math.PI,
                  c = Math.atan2(h, a) * l;
                s[i] = c;
                break;
              }
              case 'mode': {
                const t = e[i];
                let r = 0,
                  n = null;
                for (const e in t) {
                  const s = t[e];
                  s > r && ((r = s), (n = e));
                }
                s[i] = 'null' === n ? null : n;
                break;
              }
            }
          }
          return s;
        }
      }
      class Me {
        constructor(e, t, s) {
          (this.count = 0),
            (this.xTotal = 0),
            (this.yTotal = 0),
            (this.statistics = {}),
            (this.displayId = 0),
            (this.displayIds = new Set()),
            (this.next = null),
            (this.depth = 0),
            (this.xNode = 0),
            (this.yNode = 0),
            (this.xGeohashTotal = 0),
            (this.yGeohashTotal = 0),
            (this.children = new Array(32));
          for (let e = 0; e < this.children.length; e++) this.children[e] = null;
          (this.xNode = e), (this.yNode = t), (this.depth = s);
        }
        realloc(e, t, s) {
          for (let e = 0; e < this.children.length; e++) this.children[e] = null;
          return (
            (this.xNode = e),
            (this.yNode = t),
            (this.depth = s),
            (this.next = null),
            (this.xGeohashTotal = 0),
            (this.yGeohashTotal = 0),
            (this.xTotal = 0),
            (this.yTotal = 0),
            (this.count = 0),
            (this.statistics = {}),
            this.displayIds.clear(),
            this
          );
        }
        add(e) {
          this.displayIds.add(e);
        }
        remove(e) {
          this.displayIds.delete(e);
        }
        getLngLatBounds() {
          const e = this.depth,
            t = Math.ceil(e / 2),
            s = Math.floor(e / 2),
            r = 30 - (3 * t + 2 * s),
            i = 30 - (2 * t + 3 * s);
          return (function (e, t) {
            let s = -90,
              r = 90,
              i = -180,
              n = 180;
            for (let o = 0; o < t; o++) {
              const t = Math.ceil((o + 1) / 2),
                a = Math.floor((o + 1) / 2),
                h = 1 - (o % 2),
                l = 30 - (3 * t + 2 * a),
                c = 30 - (2 * t + 3 * a),
                u = 2 * h + 3 * (1 - h),
                d = (((7 * h + 3 * (1 - h)) << l) & e.geohashX) >> l,
                p = (((3 * h + 7 * (1 - h)) << c) & e.geohashY) >> c;
              for (let e = 3 * h + 2 * (1 - h) - 1; e >= 0; e--) {
                const t = (i + n) / 2,
                  s = d & (1 << e) ? 1 : 0;
                (i = (1 - s) * i + s * t), (n = (1 - s) * t + s * n);
              }
              for (let e = u - 1; e >= 0; e--) {
                const t = (s + r) / 2,
                  i = p & (1 << e) ? 1 : 0;
                (s = (1 - i) * s + i * t), (r = (1 - i) * t + i * r);
              }
            }
            return [i, s, n, r];
          })({ geohashX: this.xNode << r, geohashY: this.yNode << i }, this.depth);
        }
        find(e, t, s, r, i, n) {
          if (r >= s) return this;
          const o = 1 - (r % 2),
            a = 3 * o + 2 * (1 - o),
            h = 2 * o + 3 * (1 - o),
            l = 30 - i - a,
            c = 30 - n - h,
            u =
              ((e & ((7 * o + 3 * (1 - o)) << l)) >> l) +
              ((t & ((3 * o + 7 * (1 - o)) << c)) >> c) * (8 * o + 4 * (1 - o)),
            d = this.children[u];
          return null == d ? null : d.find(e, t, s, r + 1, i + a, n + h);
        }
      }
      class Ae extends F.O {
        constructor(e, t, s, r, i) {
          super(new F.a([], [t, s]), r, null, e), (this.geohashBoundsInfo = i);
        }
        get count() {
          return this.attributes.cluster_count;
        }
        static create(e, t, s, r, i, n, o, a) {
          const h = new Ae(t, s, r, n, o);
          return (h.displayId = e.createDisplayId(!0)), (h.referenceId = a), (h.tileLevel = i), h;
        }
        update(e, t, s, r, i, n) {
          return (
            (this.geometry.coords[0] = e),
            (this.geometry.coords[1] = t),
            (this.tileLevel = s),
            (this.attributes = r),
            (this.geohashBoundsInfo = i),
            (this.referenceId = null),
            (this.referenceId = n),
            this
          );
        }
        toJSON() {
          return {
            objectId: this.objectId,
            referenceId: 1 === this.attributes.cluster_count ? this.referenceId : null,
            attributes: { ...this.attributes, clusterId: this.objectId },
            geometry: { x: this.geometry.coords[0], y: this.geometry.coords[1] },
          };
        }
      }
      function Oe(e) {
        return 57.29577951308232 * e;
      }
      class Re extends f.S {
        constructor(e, t, s) {
          super(e, s),
            (this.events = new M.E()),
            (this._geohashLevel = 0),
            (this._aggregateValueRanges = {}),
            (this._aggregateValueRangesChanged = !1),
            (this._geohashBuf = []),
            (this._clusters = new Map()),
            (this._tiles = new Map()),
            (this.geometryInfo = e.geometryInfo),
            (this._spatialReference = t),
            (this._projectionSupportCheck = (0, $.c)(t, U.Z.WGS84)),
            (this._bitsets.geohash = s.getBitset(s.createBitset())),
            (this._bitsets.inserted = s.getBitset(s.createBitset()));
        }
        async updateSchema(e, t) {
          const s = this._schema;
          try {
            await super.updateSchema(e, t), await this._projectionSupportCheck;
          } catch (e) {}
          const r = (0, A.d)(s, t);
          t && (!(0, n.b)(r) || e.source || e.storage.filters)
            ? (((0, A.h)(r, 'params.fields') || !this._tree || e.source) &&
                ((this._tree = new Ce(this._statisticFields)),
                this._rebuildTree(),
                (0, n.h)('esri-2d-update-debug') &&
                  console.debug('Aggregate mesh needs update due to tree changing')),
              (0, n.h)('esri-2d-update-debug') &&
                console.debug('Applying Update - ClusterStore:', r),
              (e.targets[t.name] = !0),
              (e.mesh = !1),
              (this._aggregateValueRanges = {}))
            : s && (e.mesh = !0);
        }
        sweepFeatures(e, t) {
          this._bitsets.inserted.forEachSet((s) => {
            if (!e.has(s)) {
              const e = t.lookupByDisplayIdUnsafe(s);
              this._remove(e);
            }
          });
        }
        sweepClusters(e, t, s) {
          this._clusters.forEach((r, i) => {
            r &&
              r.tileLevel !== s &&
              (e.releaseDisplayId(r.displayId),
              t.unsetAttributeData(r.displayId),
              this._clusters.delete(i));
          });
        }
        onTileData(e, t, s, r, i = !0) {
          if (!this._schema || (0, n.b)(t.addOrUpdate)) return t;
          const o = this._tree,
            a = this._getTransforms(e, this._spatialReference);
          {
            const e = t.addOrUpdate.getCursor();
            for (; e.next(); ) this._update(e, r, o);
          }
          if (t.status.mesh || !i) return t;
          const h = new Array(),
            l = this._schema.params.clusterRadius;
          this._getClustersForTile(h, e, l, s, o, a),
            (t.addOrUpdate = S.F.fromOptimizedFeatures(h, 'esriGeometryPoint')),
            t.addOrUpdate.attachStorage(s),
            (t.end = !0);
          {
            const r = t.addOrUpdate.getCursor();
            for (; r.next(); ) {
              const t = r.getDisplayId();
              this._bitsets.computed.unset(t), this.setComputedAttributes(s, r, t, e.scale);
            }
          }
          return (
            this._aggregateValueRangesChanged &&
              t.end &&
              (this.events.emit('valueRangesChanged', { valueRanges: this._aggregateValueRanges }),
              (this._aggregateValueRangesChanged = !1)),
            t
          );
        }
        onTileUpdate({ added: e, removed: t }) {
          if (e.length) {
            const t = e[0].level;
            this._setGeohashLevel(t);
          }
          if (!this._schema) return;
          const s = this._schema.params.clusterRadius;
          t.forEach((e) => {
            this._tiles.delete(e.key.id), this._markTileClustersForDeletion(e, s);
          });
        }
        getAggregate(e) {
          let t = null;
          return (
            this._clusters.forEach((s) => {
              s && s.displayId === e && (t = s.toJSON());
            }),
            t
          );
        }
        getDisplayId(e) {
          const t = this._clusters.get(e);
          return t ? t.displayId : null;
        }
        getFeatureDisplayIdsForAggregate(e) {
          const t = this._clusters.get(e);
          if (!t) return [];
          const s = t.geohashBoundsInfo;
          return this._tree.getRegionDisplayIds(s.xLL, s.yLL, s.xTR, s.yTR, s.level);
        }
        getDisplayIdForReferenceId(e) {
          let t;
          return (
            this._clusters.forEach((s) => {
              s && s.referenceId === e && (t = s.displayId);
            }),
            t
          );
        }
        getAggregateValueRanges() {
          return this._aggregateValueRanges;
        }
        forEach(e) {
          this._clusters.forEach((t, s) => {
            t && e(t, s);
          });
        }
        size() {
          let e = 0;
          return this.forEach((t) => e++), e;
        }
        _rebuildTree() {
          this._bitsets.computed.clear(),
            this._bitsets.inserted.clear(),
            this._tree && this._tree.clear();
        }
        _remove(e) {
          const t = e.getDisplayId(),
            s = e.getXHydrate(),
            r = e.getYHydrate(),
            i = this._geohashBuf[2 * t],
            n = this._geohashBuf[2 * t + 1];
          this._bitsets.inserted.has(t) &&
            (this._bitsets.inserted.unset(t),
            this._tree.removeCursor(e, s, r, i, n, this._geohashLevel));
        }
        _update(e, t, s) {
          const r = e.getDisplayId(),
            i = this._bitsets.inserted,
            n = t.isVisible(r);
          if (n === i.has(r)) return;
          if (!n) return void this._remove(e);
          const o = e.getXHydrate(),
            a = e.getYHydrate();
          if (!this._setGeohash(r, o, a)) return;
          const h = this._geohashBuf[2 * r],
            l = this._geohashBuf[2 * r + 1];
          s.insertCursor(e, r, o, a, h, l, this._geohashLevel), i.set(r);
        }
        _setGeohash(e, t, s) {
          if (this._bitsets.geohash.has(e)) return !0;
          const r = this._geohashBuf;
          if (this._spatialReference.isWebMercator) {
            const i = Oe(t / W.e.radius),
              n = i - 360 * Math.floor((i + 180) / 360);
            Ee(r, e, Oe(Math.PI / 2 - 2 * Math.atan(Math.exp((-1 * s) / W.e.radius))), n, 12);
          } else {
            const i = (0, $.p)({ x: t, y: s }, this._spatialReference, U.Z.WGS84);
            if (!i) return !1;
            Ee(r, e, i.y, i.x, 12);
          }
          return this._bitsets.geohash.set(e), !0;
        }
        _getClustersForTile(e, t, s, r, i, o, a = !0) {
          const h = this._schema.params.clusterPixelBuffer,
            l = 2 * s,
            c = this._getGeohashLevel(t.key.level),
            u = Math.ceil((2 ** t.key.level * J.k) / l),
            p = Math.ceil(h / l) + 0,
            g = Math.ceil(J.k / l),
            { row: f, col: _ } = t.key,
            m = _ * J.k,
            y = f * J.k,
            b = Math.floor(m / l) - p,
            x = Math.floor(y / l) - p,
            I = b + g + 2 * p,
            w = x + g + 2 * p,
            v = t.tileInfoView.getLODInfoAt(t.key.level);
          for (let s = b; s <= I; s++)
            for (let h = x; h <= w; h++) {
              let l = s;
              v.wrap && (l = s < 0 ? s + u : s % u);
              const p = v.wrap && s < 0,
                g = v.wrap && s % u !== s,
                f = this._lookupCluster(r, v, t.key.level, l, h, c, i);
              if ((0, n.i)(f)) {
                const t = (0, n.e)(o, (e) => (p ? e.left : g ? e.right : e.tile));
                if (a && (0, n.b)(t)) continue;
                if (!f.count) continue;
                if ((0, n.i)(t) && a) {
                  const s = f.geometry.clone();
                  let r = f.attributes;
                  (s.coords[0] = (0, d.t)(t, s.coords[0])),
                    (s.coords[1] = (0, d.v)(t, s.coords[1])),
                    1 === f.count &&
                      (0, n.i)(f.referenceId) &&
                      (r = { ...f.attributes, referenceId: f.referenceId });
                  const i = new F.O(s, r);
                  (i.displayId = f.displayId), e.push(i);
                }
              }
            }
        }
        _getGeohashLevel(e) {
          return Math.min(Math.ceil(e / 2 + 2), 12);
        }
        _setGeohashLevel(e) {
          const t = this._getGeohashLevel(e),
            s = 1 * (Math.floor(t / 1) + 1) - 1;
          if (this._geohashLevel !== s)
            return (
              (this._geohashLevel = s), this._rebuildTree(), void this._bitsets.geohash.clear()
            );
        }
        _getTransforms(e, t) {
          const s = {
              originPosition: 'upperLeft',
              scale: [e.resolution, e.resolution],
              translate: [e.bounds[0], e.bounds[3]],
            },
            r = (0, U.g)(t);
          if (!r) return { tile: s, left: null, right: null };
          const [i, n] = r.valid;
          return {
            tile: s,
            left: { ...s, translate: [n, e.bounds[3]] },
            right: { ...s, translate: [i - n + e.bounds[0], e.bounds[3]] },
          };
        }
        _getClusterId(e, t, s) {
          return ((15 & e) << 28) | ((16383 & t) << 14) | (16383 & s);
        }
        _markForDeletion(e, t, s) {
          const r = this._getClusterId(e, t, s);
          this._clusters.delete(r);
        }
        _getClusterBounds(e, t, s) {
          const r = this._schema.params.clusterRadius,
            i = 2 * r;
          let n = s % 2 ? t * i : t * i - r;
          const o = s * i;
          let a = n + i;
          const h = o - i,
            l = 2 ** e.level * J.k;
          e.wrap && n < 0 && (n = 0), e.wrap && a > l && (a = l);
          const c = n / J.k,
            u = o / J.k,
            d = a / J.k,
            p = h / J.k;
          return [e.getXForColumn(c), e.getYForRow(u), e.getXForColumn(d), e.getYForRow(p)];
        }
        _lookupCluster(e, t, s, r, i, o, a) {
          const h = this._getClusterId(s, r, i),
            l = this._clusters.get(h),
            [c, u, d, p] = this._getClusterBounds(t, r, i),
            g = { x: c, y: u },
            f = { x: d, y: p };
          let _ = 0,
            m = 0,
            y = 0,
            b = 0;
          if (this._spatialReference.isWebMercator) {
            {
              const e = Oe(g.x / W.e.radius);
              (_ = e - 360 * Math.floor((e + 180) / 360)),
                (m = Oe(Math.PI / 2 - 2 * Math.atan(Math.exp((-1 * g.y) / W.e.radius))));
            }
            {
              const e = Oe(f.x / W.e.radius);
              (y = e - 360 * Math.floor((e + 180) / 360)),
                (b = Oe(Math.PI / 2 - 2 * Math.atan(Math.exp((-1 * f.y) / W.e.radius))));
            }
          } else {
            const e = (0, $.p)(g, this._spatialReference, U.Z.WGS84),
              t = (0, $.p)(f, this._spatialReference, U.Z.WGS84);
            if (!e || !t) return null;
            (_ = e.x), (m = e.y), (y = t.x), (b = t.y);
          }
          const x = { geohashX: 0, geohashY: 0 },
            I = { geohashX: 0, geohashY: 0 };
          ke(x, m, _, o), ke(I, b, y, o);
          const w = x.geohashX,
            v = x.geohashY,
            S = I.geohashX,
            T = I.geohashY,
            F = { xLL: w, yLL: v, xTR: S, yTR: T, level: o },
            k = a.getRegionStatistics(w, v, S, T, o),
            { count: E, xTotal: C, yTotal: M, referenceId: A } = k,
            O = E ? C / E : 0,
            R = E ? M / E : 0;
          if (0 === E) return this._clusters.set(h, null), null;
          const L = { cluster_count: E, ...k.attributes },
            P = (0, n.i)(l) ? l.update(O, R, s, L, F, A) : Ae.create(e, h, O, R, s, L, F, A);
          return (
            0 === E && ((P.geometry.coords[0] = (c + d) / 2), (P.geometry.coords[1] = (u + p) / 2)),
            this._clusters.set(h, P),
            this._updateAggregateValueRangeForCluster(P, P.tileLevel),
            P
          );
        }
        _updateAggregateValueRangeForCluster(e, t) {
          const s = this._aggregateValueRanges[t] || { minValue: 1 / 0, maxValue: 0 },
            r = s.minValue,
            i = s.maxValue;
          (s.minValue = Math.min(r, e.count)),
            (s.maxValue = Math.max(i, e.count)),
            (this._aggregateValueRanges[t] = s),
            (r === s.minValue && i === s.maxValue) || (this._aggregateValueRangesChanged = !0);
        }
        _markTileClustersForDeletion(e, t) {
          const s = 2 * t,
            r = Math.ceil(J.k / s),
            { row: i, col: n } = e.key,
            o = n * J.k,
            a = i * J.k,
            h = Math.floor(o / s),
            l = Math.floor(a / s);
          for (let t = h; t < h + r; t++)
            for (let s = l; s < l + r; s++) this._markForDeletion(e.key.level, t, s);
        }
      }
      function Le(e) {
        if (
          !(0, c.D_)(e) &&
          !(function (e) {
            return 'worker:port-closed' === e.name;
          })(e)
        )
          throw e;
      }
      function Pe(e) {
        return 'feature' === e.type && 'snapshot' === e.mode;
      }
      let De = class extends i.r {
        constructor() {
          super(...arguments),
            (this._storage = new S.C()),
            (this._markedIdsBufId = this._storage.createBitset()),
            (this._lastCleanup = performance.now()),
            (this._cleanupNeeded = !1),
            (this._invalidated = !1),
            (this._tileToResolver = new Map()),
            (this._didEdit = !1),
            (this.tileStore = null),
            (this.config = null),
            (this.processor = null),
            (this.remoteClient = null),
            (this.service = null);
        }
        initialize() {
          this._initAttributeStore(),
            this._initStores(),
            this._initQueryEngine(),
            this._initSource(),
            (this._updateQueue = new R.Q({
              concurrency: 'geoevent' === this._source.type ? 1 : 4,
              process: (e, t) => this._onTileMessage(e, { signal: t }),
            })),
            this.handles.add([
              this.tileStore.on('update', this.onTileUpdate.bind(this)),
              this.watch('updating', (e) => !e && this.onIdle()),
            ]),
            (this._checkUpdating = setInterval(() => this.notifyChange('updating'), 300));
        }
        async startup() {
          this._initAttributeStore(),
            this.tileStore.tiles.forEach((e) => this._source.subscribe(e));
        }
        _initSource() {
          const e = this.tileStore.tileScheme;
          (this._source = (function (e, t, s, r, i, o) {
            const a = (function (e, t, s, r, i, o) {
              switch (e.type) {
                case 'snapshot':
                  return {
                    type: 'feature',
                    origin: 'snapshot',
                    featureCount: (0, n.d)(e.featureCount, 0),
                    serviceInfo: e,
                    onMessage: r,
                    outSR: t,
                    tileInfoView: s,
                    canAcceptRequest: i,
                    store: o,
                  };
                case 'stream':
                  return {
                    type: 'geoevent',
                    serviceInfo: e,
                    onMessage: r,
                    outSR: t,
                    canAcceptRequest: i,
                  };
                case 'memory':
                case 'on-demand':
                  return {
                    type: 'feature',
                    serviceInfo: e,
                    onMessage: r,
                    outSR: t,
                    origin: (function (e) {
                      return Array.isArray(e)
                        ? 'local'
                        : 'path' in e && (0, _.b)(e.path)
                        ? 'hosted'
                        : 'unknown';
                    })(e.source),
                    tileInfoView: s,
                    canAcceptRequest: i,
                  };
              }
            })(e, t, s, r, i, o);
            switch (a.type) {
              case 'feature':
                switch (a.origin) {
                  case 'hosted':
                  case 'local':
                    return new we(a);
                  case 'snapshot':
                    return new Fe(a);
                  case 'unknown':
                    return new me(a);
                }
              case 'geoevent':
                return new xe(a);
            }
          })(
            this.service,
            this.spatialReference,
            e,
            (e, t) => ((this._invalidated = !0), this._patchTile(e, t)),
            () => this._updateQueue.length < 50,
            this.featureStore,
          )),
            this._proxyEvents();
        }
        _proxyEvents() {
          if ('geoevent' === this._source.type) {
            const e = this._source.events;
            this.handles.add([
              e.on('connectionStatus', (e) =>
                this.remoteClient
                  .invoke('setProperty', { propertyName: 'connectionStatus', value: e })
                  .catch(Le),
              ),
              e.on('errorString', (e) =>
                this.remoteClient
                  .invoke('setProperty', { propertyName: 'errorString', value: e })
                  .catch(Le),
              ),
              e.on('feature', (e) =>
                this.remoteClient
                  .invoke('emitEvent', {
                    name: 'data-received',
                    event: { attributes: e.attributes, centroid: e.centroid, geometry: e.geometry },
                  })
                  .catch(Le),
              ),
              e.on('updateRate', (e) =>
                this.remoteClient
                  .invoke('emitEvent', { name: 'update-rate', event: { ...e } })
                  .catch(Le),
              ),
            ]);
          }
        }
        _initAttributeStore() {
          this.attributeStore
            ? this.attributeStore.invalidateResources()
            : (this.attributeStore = new S.A(
                {
                  type: 'remote',
                  initialize: (e, t) =>
                    (0, c.R8)(
                      this.remoteClient
                        .invoke('tileRenderer.featuresView.attributeView.initialize', e, {
                          signal: t,
                        })
                        .catch(Le),
                    ),
                  update: (e, t) =>
                    (0, c.R8)(
                      this.remoteClient
                        .invoke('tileRenderer.featuresView.attributeView.requestUpdate', e, {
                          signal: t,
                        })
                        .catch(Le),
                    ),
                  render: (e) =>
                    (0, c.R8)(
                      this.remoteClient
                        .invoke('tileRenderer.featuresView.requestRender', void 0, { signal: e })
                        .catch(Le),
                    ),
                },
                this.config,
              ));
        }
        _initStores() {
          const e = 'snapshot' === this.service.type ? 'snapshot' : 'on-demand',
            t = {
              geometryInfo: { geometryType: this.service.geometryType, hasM: !1, hasZ: !1 },
              spatialReference: this.spatialReference,
              fieldsIndex: this.fieldsIndex,
              fields: this.service.fields,
            };
          (this.featureStore = new f.a(t, this._storage, e)),
            (this.aggregateStore = new Re(t, this.spatialReference, this._storage)),
            this.handles.add(
              this.aggregateStore.events.on('valueRangesChanged', (e) => {
                this.remoteClient
                  .invoke('emitEvent', {
                    name: 'valueRangesChanged',
                    event: { valueRanges: e.valueRanges },
                  })
                  .catch(Le);
              }),
            );
        }
        _initQueryEngine() {
          var e;
          const t = this;
          null == (e = this.queryEngine) || e.destroy(),
            (this.queryEngine = new p.Q({
              definitionExpression: this.config.definitionExpression,
              fields: this.service.fields,
              geometryType: this.service.geometryType,
              objectIdField: this.service.objectIdField,
              hasM: !1,
              hasZ: !1,
              spatialReference: this.spatialReference.toJSON(),
              cacheSpatialQueries: !0,
              featureStore: this.featureStore,
              aggregateAdapter: {
                getFeatureObjectIds: (e) =>
                  t.aggregateStore.getFeatureDisplayIdsForAggregate(e).map((e) => t.getObjectId(e)),
              },
              timeInfo: this.service.timeInfo,
            }));
        }
        destroy() {
          this._updateQueue.destroy(),
            this._source.destroy(),
            this.queryEngine.destroy(),
            this.attributeStore && this.attributeStore.destroy(),
            clearInterval(this._checkUpdating);
        }
        get fieldsIndex() {
          return new g.Z(this.service.fields);
        }
        get hasAggregates() {
          return !!this.config.schema.targets.aggregate;
        }
        get spatialReference() {
          return this.tileStore.tileScheme.spatialReference;
        }
        get updating() {
          return this.isUpdating();
        }
        isUpdating() {
          return this._source.updating || !!this._updateQueue.length;
        }
        enableEvent(e) {
          this._source.enableEvent(e.name, e.value);
        }
        pause() {
          this._updateQueue.pause(), this._updateQueue.clear();
        }
        async update(e, t) {
          this._set('config', t),
            (this._schema = t.schema),
            this._initQueryEngine(),
            await Promise.all([
              this._source.update(e, t.schema.source),
              this.featureStore.updateSchema(e, t.schema.targets.feature),
              this.attributeStore.update(e, t),
              this.attributeStore.updateFilters(e, this),
            ]),
            await this.aggregateStore.updateSchema(e, t.schema.targets.aggregate),
            (0, n.h)('esri-2d-update-debug') && e.describe();
        }
        async applyUpdate(e) {
          e.mesh && this.clearTiles(),
            this._updateQueue.resume(),
            await this._source.applyUpdate(e),
            this.notifyChange('updating'),
            await (0, u.OY)(this, 'updating', !0),
            this.hasAggregates && (await (0, c.e4)(10), await (0, u.OY)(this, 'updating', !0));
        }
        async onEdits({ edits: e }) {
          (0, n.h)('esri-2d-update-debug') && console.debug('Applying Edit:', e),
            (this._didEdit = !0);
          try {
            const t = e.removed.map((e) =>
                e.objectId && -1 !== e.objectId
                  ? e.objectId
                  : this._lookupObjectIdByGlobalId(e.globalId),
              ),
              s = e.addOrModified.map(({ objectId: e }) => e);
            this.featureStore.invalidate(),
              await this._source.edit(s, t),
              this.clearTiles(),
              this.notifyChange('updating'),
              await this._source.resend(),
              await (0, u.OY)(this, 'updating', !0);
          } catch (e) {}
        }
        async refresh() {
          this.featureStore.invalidate(),
            this.clearTiles(),
            this._source.refresh(),
            (this._cleanupNeeded = !0),
            this.notifyChange('updating'),
            await (0, u.OY)(this, 'updating', !0);
        }
        clearTiles() {
          for (const e of this.tileStore.tiles) this.processor.onTileClear(e);
        }
        onTileUpdate(e) {
          this.aggregateStore.onTileUpdate(e);
          for (const t of e.added) this._source.subscribe(t), (this._level = t.level);
          for (const t of e.removed)
            this._source.unsubscribe(t),
              (this._cleanupNeeded = !0),
              this._tileToResolver.has(t.id) &&
                (this._tileToResolver.get(t.id).resolve(), this._tileToResolver.delete(t.id));
          this.notifyChange('updating');
        }
        onIdle() {
          this._invalidated &&
            ((this.hasAggregates || 'heatmap' === this.processor.type) &&
              this._repushCurrentLevelTiles(),
            (this._invalidated = !1)),
            this._markAndSweep();
        }
        async querySummaryStatistics({ query: e, params: t }) {
          return this.queryEngine.executeQueryForSummaryStatistics(e, t);
        }
        queryExtent(e) {
          return this.queryEngine.executeQueryForExtent(e);
        }
        queryFeatures(e) {
          return this.queryEngine.executeQuery(e);
        }
        queryFeatureCount(e) {
          return this.queryEngine.executeQueryForCount(e);
        }
        queryLatestObservations(e) {
          return this.queryEngine.executeQueryForLatestObservations(e);
        }
        queryObjectIds(e) {
          return this.queryEngine.executeQueryForIds(e);
        }
        async queryStatistics() {
          return {
            ...this.featureStore.storeStatistics,
            displayedFeatureCount: 0,
            displayedVertexCount: 0,
            displayPreProcessTime: 0,
          };
        }
        getObjectId(e) {
          return this.featureStore.lookupObjectId(e, this._storage);
        }
        getDisplayId(e) {
          if (this._schema.targets.aggregate) {
            const t = this.aggregateStore.getDisplayId(e);
            if ((0, n.b)(t)) {
              const t = this.featureStore.lookupDisplayId(e);
              return this.aggregateStore.getDisplayIdForReferenceId(t);
            }
            return t;
          }
          return this.featureStore.lookupDisplayId(e);
        }
        getFeature(e) {
          const t = this.featureStore.lookupFeatureByDisplayId(e, this._storage);
          if ((0, n.b)(t)) return null;
          const s = t.readHydratedGeometry(),
            r = (0, d.c)(s, t.geometryType, t.hasZ, t.hasM);
          return { attributes: t.readAttributes(), geometry: r };
        }
        getAggregate(e) {
          return this.aggregateStore.getAggregate(e);
        }
        async setHighlight(e) {
          const t = e.map((e) => this.getDisplayId(e));
          return this.attributeStore.setHighlight(e, t);
        }
        _lookupObjectIdByGlobalId(e) {
          const t = this.service.globalIdField;
          if ((0, n.b)(t)) throw new Error('Expected globalIdField to be defined');
          let s = null;
          if (
            (this.featureStore.forEach((r) => {
              e === r.readAttribute(t) && (s = r.getObjectId());
            }),
            (0, n.b)(s))
          )
            throw new Error(`Expected to find a feature with globalId ${e}`);
          return s;
        }
        _repushCurrentLevelTiles() {
          const e = this.tileStore.tiles.filter((e) => e.level === this._level);
          for (const t of e)
            this._patchTile({
              type: 'append',
              id: t.key.id,
              addOrUpdate: S.F.fromOptimizedFeatures([], this.service.geometryType),
              remove: [],
              end: !0,
              status: ce.empty(),
            });
        }
        _maybeForceCleanup() {
          performance.now() - this._lastCleanup > 5e3 && this._markAndSweep();
        }
        _patchTile(e, t) {
          const s = this._updateQueue
            .push(e, t)
            .then(() => {
              this.notifyChange('updating');
            })
            .catch((e) => {
              this.notifyChange('updating');
            });
          return this.notifyChange('updating'), s;
        }
        async _onTileMessage(e, t) {
          (0, c.k_)(t);
          const s = this.tileStore.get(e.id);
          if (!s) return;
          if (e.clear) return this.processor.onTileClear(s);
          const r = e.status;
          this._cleanupNeeded = !0;
          const i = [];
          for (const t of e.remove) {
            const e = this.featureStore.lookupDisplayId(t);
            e && i.push(e);
          }
          e.remove = i;
          try {
            if ((0, n.b)(e.addOrUpdate))
              return void this.processor
                .onTileMessage(s, { ...e, addOrUpdate: null }, this.hasAggregates, t)
                .catch(c.H9);
            if (
              (e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),
              (this.featureStore.hasInstance(e.addOrUpdate.instance) && r.targets.feature) ||
                ((r.targets.feature = !0), this.featureStore.onTileData(s, e)),
              (r.storage.data && r.storage.filters) ||
                ((r.storage.data = !0),
                (r.storage.filters = !0),
                this.attributeStore.onTileData(s, e),
                'geoevent' === this._source.type || this._didEdit
                  ? (await this.attributeStore.sendUpdates(), (0, c.k_)(t))
                  : this.attributeStore.sendUpdates()),
              this.hasAggregates && !r.targets.aggregate)
            ) {
              r.targets.aggregate = !0;
              const t = Pe(this._source) && this._source.loading,
                i = !Pe(this._source) || t || e.end;
              if ((this.aggregateStore.onTileData(s, e, this._storage, this.attributeStore, i), !i))
                return;
              r.mesh ||
                (this.attributeStore.onTileData(s, e),
                await this.attributeStore.sendUpdates(),
                this.processor.onTileClear(s));
            }
            r.mesh ||
              ((r.mesh = !0),
              await this.processor.onTileMessage(s, e, this.hasAggregates, t),
              (0, c.k_)(t)),
              this._maybeForceCleanup();
          } catch (e) {
            (0, c.H9)(e);
          }
        }
        _mark(e, t, s) {
          const r = (4294901760 & this._storage.getInstanceId(e)) >>> 16;
          e && (t.add(r), s.set(e));
        }
        _markAndSweep() {
          if (
            ((this._lastCleanup = performance.now()),
            ('feature' === this._source.type && 'snapshot' === this._source.mode) ||
              ('geoevent' !== this._source.type && !this._cleanupNeeded))
          )
            return;
          this._cleanupNeeded = !1;
          const e = this._storage.getBitset(this._markedIdsBufId),
            t = new Set();
          e.clear();
          for (const s of this.tileStore.tiles)
            for (const r of this._source.readers(s.id)) {
              const s = r.getCursor();
              for (; s.next(); ) {
                let r = s.getDisplayId();
                if (!r) {
                  const e = s.getObjectId();
                  r = this.featureStore.lookupDisplayId(e);
                }
                this._mark(r, t, e);
              }
            }
          this._updateQueue.forEach((s) => {
            for (const r of s.remove) {
              const s = this.featureStore.lookupDisplayId(r);
              this._mark(s, t, e);
            }
          }),
            this.config.schema.targets.aggregate &&
              (this.aggregateStore.sweepFeatures(e, this.featureStore),
              this.aggregateStore.sweepClusters(this._storage, this.attributeStore, this._level)),
            this.featureStore.sweepFeatures(e, this._storage, this.attributeStore),
            this.featureStore.sweepFeatureSets(t);
        }
      };
      (0, r._)([(0, o.Cb)({ constructOnly: !0 })], De.prototype, 'tileStore', void 0),
        (0, r._)([(0, o.Cb)()], De.prototype, 'config', void 0),
        (0, r._)([(0, o.Cb)({ readOnly: !0 })], De.prototype, 'fieldsIndex', null),
        (0, r._)([(0, o.Cb)()], De.prototype, 'processor', void 0),
        (0, r._)([(0, o.Cb)({ constructOnly: !0 })], De.prototype, 'remoteClient', void 0),
        (0, r._)([(0, o.Cb)({ constructOnly: !0 })], De.prototype, 'service', void 0),
        (0, r._)([(0, o.Cb)()], De.prototype, 'spatialReference', null),
        (0, r._)([(0, o.Cb)()], De.prototype, 'updating', null),
        (De = (0, r._)(
          [(0, h.j)('esri.views.2d.layers.features.controllers.FeatureController2D')],
          De,
        ));
      var Ue = De;
      const Ne = new Set();
      function qe() {
        return Ne;
      }
      let ze = class extends i.r {
        constructor() {
          super(...arguments),
            (this.controller = null),
            (this.processor = null),
            (this.remoteClient = null),
            (this.tileStore = null),
            (this.service = null),
            (this.viewState = null);
        }
        initialize() {
          this.handles.add(
            this.watch('updating', (e) => {
              this.remoteClient.invoke('setUpdating', e).catch((e) => {});
            }),
          );
        }
        destroy() {
          var e, t, s;
          null == (e = this.controller) || e.destroy(),
            null == (t = this.processor) || t.destroy(),
            null == (s = this.tileStore) || s.destroy(),
            (this.controller = this.processor = this.tileStore = this.remoteClient = null);
        }
        get updating() {
          return !this.controller || this.controller.updating;
        }
        async startup({ service: e, config: t, tileInfo: s, tiles: r }) {
          if (((this.service = e), !this.tileStore)) {
            const e = new K.T(l.Z.fromJSON(s));
            this.tileStore = new S.T(e);
          }
          this.tileStore.clear(),
            await this._createProcessorAndController(t),
            await this.update({ config: t }, !0),
            this.tileStore.updateTiles(r);
        }
        async updateTiles(e) {
          this.tileStore.updateTiles(e);
        }
        async update({ config: e }, t = !1) {
          const s = ce.empty();
          return (
            t || this.controller.pause(),
            await Promise.all([this.processor.update(s, e), this.controller.update(s, e)]),
            s.toJSON()
          );
        }
        async applyUpdate(e) {
          return this.controller.applyUpdate(ce.create(e));
        }
        async _createProcessorAndController(e) {
          await Promise.all([this._handleControllerConfig(e), this._handleProcessorConfig(e)]),
            (this.controller.processor = this.processor);
        }
        async _handleControllerConfig(e) {
          const t = await this._createController(this.service, e);
          return await t.startup(), t;
        }
        async _handleProcessorConfig(e) {
          return this._createProcessor(this.service, e);
        }
        async _createController(e, t) {
          this.controller && this.controller.destroy();
          const { tileStore: s, remoteClient: r } = this,
            i = new Ue({ service: e, config: t, tileStore: s, remoteClient: r });
          return (this.controller = i), i;
        }
        async _createProcessor(e, t) {
          const r = t.schema.processors[0].type,
            i = (
              await ((n = r),
              'heatmap' === n
                ? s.e(4599).then(s.bind(s, 4599))
                : Promise.all([s.e(5959), s.e(208), s.e(3106), s.e(5022)]).then(s.bind(s, 25022)))
            ).default;
          var n;
          const { remoteClient: o, tileStore: a } = this,
            h = new i({ service: e, config: t, tileStore: a, remoteClient: o });
          return this.processor && this.processor.destroy(), (this.processor = h), h;
        }
      };
      (0, r._)([(0, o.Cb)()], ze.prototype, 'controller', void 0),
        (0, r._)([(0, o.Cb)()], ze.prototype, 'processor', void 0),
        (0, r._)([(0, o.Cb)()], ze.prototype, 'updating', null),
        (0, r._)([(0, o.Cb)()], ze.prototype, 'viewState', void 0),
        (ze = (0, r._)([(0, h.j)('esri.views.2d.layers.features.Pipeline')], ze));
      const Be = ze;
    },
    15173: (e, t, s) => {
      'use strict';
      s.d(t, { Q: () => i });
      var r = s(76506);
      class i {
        constructor(e = (e) => e.values().next().value) {
          (this._peeker = e), (this._items = new Set());
        }
        get length() {
          return this._items.size;
        }
        clear() {
          this._items.clear();
        }
        last() {
          if (0 === this._items.size) return;
          let e;
          for (e of this._items);
          return e;
        }
        peek() {
          if (0 !== this._items.size) return this._peeker(this._items);
        }
        push(e) {
          this.contains(e) || this._items.add(e);
        }
        contains(e) {
          return this._items.has(e);
        }
        pop() {
          if (0 === this.length) return;
          const e = this.peek();
          return this._items.delete((0, r.a)(e)), e;
        }
        popLast() {
          if (0 === this.length) return;
          const e = this.last();
          return this._items.delete((0, r.a)(e)), e;
        }
        remove(e) {
          this._items.delete(e);
        }
        filter(e) {
          return (
            this._items.forEach((t) => {
              e(t) || this._items.delete(t);
            }),
            this
          );
        }
      }
    },
    2267: (e, t, s) => {
      'use strict';
      s.d(t, { Q: () => h });
      var r = s(76506),
        i = s(50406),
        n = s(15173),
        o = s(6906);
      class a {
        constructor(e, t) {
          (this.item = e), (this.controller = t), (this.promise = null);
        }
      }
      class h {
        constructor(e) {
          (this._deferreds = new Map()),
            (this._controllers = new Map()),
            (this._processingItems = new Map()),
            (this._isPaused = !1),
            (this._schedule = null),
            (this._task = null),
            (this.concurrency = 1),
            e.concurrency && (this.concurrency = e.concurrency),
            (this._queue = new n.Q(e.peeker)),
            (this.process = e.process);
          const t = e.scheduler;
          e.priority && (0, r.i)(t) && (this._task = t.registerTask(e.priority, this));
        }
        destroy() {
          this.clear(),
            this._schedule && (this._schedule.remove(), (this._schedule = null)),
            this._task && (this._task.remove(), (this._task = null));
        }
        get length() {
          return this._processingItems.size + this._queue.length;
        }
        abort(e) {
          const t = this._controllers.get(e);
          t && t.abort();
        }
        clear() {
          this._queue.clear();
          const e = [];
          this._controllers.forEach((t) => e.push(t)),
            this._controllers.clear(),
            e.forEach((e) => e.abort()),
            this._processingItems.clear(),
            this._cancelNext();
        }
        forEach(e) {
          this._deferreds.forEach((t, s) => e(s));
        }
        get(e) {
          const t = this._deferreds.get(e);
          return t ? t.promise : void 0;
        }
        isOngoing(e) {
          return this._processingItems.has(e);
        }
        has(e) {
          return this._deferreds.has(e);
        }
        pause() {
          this._isPaused || ((this._isPaused = !0), this._cancelNext());
        }
        push(e, t) {
          const s = this.get(e);
          if (s) return s;
          const n = (0, i.yi)();
          let o = null;
          t && (o = (0, i.fu)(t, () => n.abort()));
          const a = () => {
              h.remove(),
                (0, r.i)(o) && o.remove(),
                this._deferreds.delete(e),
                this._controllers.delete(e),
                this._queue.remove(e),
                this._processingItems.delete(e),
                this._scheduleNext();
            },
            h = (0, i.$F)(n.signal, () => {
              const t = this._processingItems.get(e);
              t && t.controller.abort(), a(), l.reject((0, i.zE)());
            }),
            l = (0, i.dD)();
          return (
            this._deferreds.set(e, l),
            this._controllers.set(e, n),
            l.promise.then(a, a),
            this._queue.push(e),
            this._scheduleNext(),
            l.promise
          );
        }
        last() {
          return this._queue.last();
        }
        peek() {
          return this._queue.peek();
        }
        popLast() {
          return this._queue.popLast();
        }
        reset() {
          const e = [];
          this._processingItems.forEach((t) => e.push(t)), this._processingItems.clear();
          for (const t of e) this._queue.push(t.item), t.controller.abort();
          this._scheduleNext();
        }
        resume() {
          this._isPaused && ((this._isPaused = !1), this._scheduleNext());
        }
        takeAll() {
          const e = [];
          for (; this._queue.length; ) e.push(this._queue.pop());
          return this.clear(), e;
        }
        get running() {
          return (
            !this._isPaused &&
            this._queue.length > 0 &&
            this._processingItems.size < this.concurrency
          );
        }
        runTask(e) {
          for (
            ;
            !e.done && this._queue.length > 0 && this._processingItems.size < this.concurrency;

          )
            this._process(this._queue.pop()), e.madeProgress();
        }
        _scheduleNext() {
          this._task ||
            this._isPaused ||
            this._schedule ||
            (this._schedule = (0, o.Os)(() => {
              (this._schedule = null), this._next();
            }));
        }
        _next() {
          for (; this._queue.length > 0 && this._processingItems.size < this.concurrency; )
            this._process(this._queue.pop());
        }
        _cancelNext() {
          this._schedule && (this._schedule.remove(), (this._schedule = null));
        }
        _processResult(e, t) {
          this._canProcessFulfillment(e) &&
            (this._scheduleNext(), this._deferreds.get(e.item).resolve(t));
        }
        _processError(e, t) {
          this._canProcessFulfillment(e) &&
            (this._scheduleNext(), this._deferreds.get(e.item).reject(t));
        }
        _canProcessFulfillment(e) {
          return !!this._deferreds.get(e.item) && this._processingItems.get(e.item) === e;
        }
        _process(e) {
          if ((0, r.b)(e)) return;
          let t;
          const s = (0, i.yi)(),
            n = new a(e, s);
          this._processingItems.set(e, n);
          try {
            t = this.process(e, s.signal);
          } catch (e) {
            this._processError(n, e);
          }
          (0, i.y8)(t)
            ? ((n.promise = t),
              t.then(
                (e) => this._processResult(n, e),
                (e) => this._processError(n, e),
              ))
            : this._processResult(n, t);
        }
        get test() {
          return { update: (e) => this.runTask(e) };
        }
      }
    },
    10638: (e, t, s) => {
      'use strict';
      s.d(t, { R: () => r, T: () => h, i: () => a });
      var r,
        i,
        n = s(82426),
        o = s(76506);
      function a(e) {
        return window.WebGL2RenderingContext && e instanceof window.WebGL2RenderingContext;
      }
      ((i = r || (r = {}))[(i.Texture = 0)] = 'Texture'),
        (i[(i.Buffer = 1)] = 'Buffer'),
        (i[(i.VAO = 2)] = 'VAO'),
        (i[(i.Program = 3)] = 'Program'),
        (i[(i.Framebuffer = 4)] = 'Framebuffer'),
        (i[(i.Renderbuffer = 5)] = 'Renderbuffer'),
        (i[(i.COUNT = 6)] = 'COUNT');
      class h {
        constructor(e, t, s = null) {
          (this._context = e),
            (this.type = 'texture'),
            (this._glName = null),
            (this._descriptor = void 0),
            (this._samplingModeDirty = !1),
            (this._wrapModeDirty = !1),
            e.instanceCounter.increment(r.Texture, this),
            (this._descriptor = {
              target: 3553,
              samplingMode: 9729,
              wrapMode: 10497,
              flipped: !1,
              hasMipmap: !1,
              isOpaque: !1,
              unpackAlignment: 4,
              preMultiplyAlpha: !1,
              ...t,
            }),
            this.setData(s);
        }
        get glName() {
          return this._glName;
        }
        get descriptor() {
          return this._descriptor;
        }
        dispose() {
          this._context.gl &&
            this._glName &&
            (this._context.unbindTextureAllUnits(this),
            this._context.gl.deleteTexture(this._glName),
            (this._glName = null),
            this._context.instanceCounter.decrement(r.Texture, this));
        }
        release() {
          this.dispose();
        }
        resize(e, t) {
          const s = this._descriptor;
          (s.width === e && s.height === t) || ((s.width = e), (s.height = t), this.setData(null));
        }
        setData(e) {
          if (!this._context || !this._context.gl) return;
          const t = this._context.gl;
          this._glName || (this._glName = t.createTexture()),
            void 0 === e && (e = null),
            null === e &&
              ((this._descriptor.width = this._descriptor.width || 4),
              (this._descriptor.height = this._descriptor.height || 4));
          const s = this._context.bindTexture(this, h.TEXTURE_UNIT_FOR_UPDATES),
            r = this._descriptor;
          h._validateTexture(this._context, r),
            t.pixelStorei(t.UNPACK_ALIGNMENT, r.unpackAlignment),
            t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, r.flipped ? 1 : 0),
            t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, r.preMultiplyAlpha ? 1 : 0);
          const i = r.pixelFormat;
          let n = r.internalFormat ? r.internalFormat : i;
          if (
            e instanceof ImageData ||
            e instanceof HTMLImageElement ||
            e instanceof HTMLCanvasElement ||
            e instanceof HTMLVideoElement
          ) {
            let s = e.width,
              o = e.height;
            e instanceof HTMLVideoElement && ((s = e.videoWidth), (o = e.videoHeight)),
              r.width && r.height,
              t.texImage2D(t.TEXTURE_2D, 0, n, i, r.dataType, e),
              r.hasMipmap && this.generateMipmap(),
              void 0 === r.width && (r.width = s),
              void 0 === r.height && (r.height = o);
          } else {
            (null != r.width && null != r.height) ||
              console.error('Width and height must be specified!'),
              t.DEPTH24_STENCIL8 && n === t.DEPTH_STENCIL && (n = t.DEPTH24_STENCIL8);
            let s = r.width,
              a = r.height;
            if (
              (function (e) {
                return (0, o.i)(e) && 'type' in e && 'compressed' === e.type;
              })(e)
            ) {
              const i = Math.round(Math.log(Math.max(s, a)) / Math.LN2) + 1;
              r.hasMipmap = r.hasMipmap && i === e.levels.length;
              for (let i = 0; ; ++i) {
                const o = e.levels[Math.min(i, e.levels.length - 1)];
                if (
                  (t.compressedTexImage2D(t.TEXTURE_2D, i, n, s, a, 0, o),
                  (1 === s && 1 === a) || !r.hasMipmap)
                )
                  break;
                (s = Math.max(1, s >> 1)), (a = Math.max(1, a >> 1));
              }
            } else if ((0, o.i)(e))
              t.texImage2D(t.TEXTURE_2D, 0, n, s, a, 0, i, r.dataType, e),
                r.hasMipmap && this.generateMipmap();
            else
              for (
                let e = 0;
                t.texImage2D(t.TEXTURE_2D, e, n, s, a, 0, i, r.dataType, null),
                  (1 !== s || 1 !== a) && r.hasMipmap;
                ++e
              )
                (s = Math.max(1, s >> 1)), (a = Math.max(1, a >> 1));
          }
          h._applySamplingMode(t, this._descriptor),
            h._applyWrapMode(t, this._descriptor),
            h._applyAnisotropicFilteringParameters(this._context, this._descriptor),
            this._context.bindTexture(s, h.TEXTURE_UNIT_FOR_UPDATES);
        }
        updateData(e, t, s, r, i, n) {
          n || console.error('An attempt to use uninitialized data!'),
            this._glName || console.error('An attempt to update uninitialized texture!');
          const o = this._context.gl,
            a = this._descriptor,
            l = this._context.bindTexture(this, h.TEXTURE_UNIT_FOR_UPDATES);
          (t < 0 || s < 0 || r > a.width || i > a.height || t + r > a.width || s + i > a.height) &&
            console.error('An attempt to update out of bounds of the texture!'),
            o.pixelStorei(o.UNPACK_ALIGNMENT, a.unpackAlignment),
            o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, a.flipped ? 1 : 0),
            o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL, a.preMultiplyAlpha ? 1 : 0),
            n instanceof ImageData ||
            n instanceof HTMLImageElement ||
            n instanceof HTMLCanvasElement ||
            n instanceof HTMLVideoElement
              ? o.texSubImage2D(o.TEXTURE_2D, e, t, s, a.pixelFormat, a.dataType, n)
              : o.texSubImage2D(o.TEXTURE_2D, e, t, s, r, i, a.pixelFormat, a.dataType, n),
            this._context.bindTexture(l, h.TEXTURE_UNIT_FOR_UPDATES);
        }
        generateMipmap() {
          const e = this._descriptor;
          e.hasMipmap ||
            ((e.hasMipmap = !0),
            (this._samplingModeDirty = !0),
            h._validateTexture(this._context, e)),
            9729 === e.samplingMode
              ? ((this._samplingModeDirty = !0), (e.samplingMode = 9985))
              : 9728 === e.samplingMode &&
                ((this._samplingModeDirty = !0), (e.samplingMode = 9984));
          const t = this._context.bindTexture(this, h.TEXTURE_UNIT_FOR_UPDATES),
            s = this._context.gl;
          s.generateMipmap(s.TEXTURE_2D), this._context.bindTexture(t, h.TEXTURE_UNIT_FOR_UPDATES);
        }
        setSamplingMode(e) {
          e !== this._descriptor.samplingMode &&
            ((this._descriptor.samplingMode = e), (this._samplingModeDirty = !0));
        }
        setWrapMode(e) {
          e !== this._descriptor.wrapMode &&
            ((this._descriptor.wrapMode = e),
            h._validateTexture(this._context, this._descriptor),
            (this._wrapModeDirty = !0));
        }
        applyChanges() {
          const e = this._context.gl,
            t = this._descriptor;
          this._samplingModeDirty && (h._applySamplingMode(e, t), (this._samplingModeDirty = !1)),
            this._wrapModeDirty && (h._applyWrapMode(e, t), (this._wrapModeDirty = !1));
        }
        static _validateTexture(e, t) {
          (t.width < 0 || t.height < 0) &&
            console.error('Negative dimension parameters are not allowed!');
          const s = (0, n.a6)(t.width) && (0, n.a6)(t.height);
          a(e.gl) ||
            s ||
            ('number' == typeof t.wrapMode
              ? 33071 !== t.wrapMode &&
                console.error('Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!')
              : (33071 === t.wrapMode.s && 33071 === t.wrapMode.t) ||
                console.error('Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!'),
            t.hasMipmap && console.error('Mipmapping requires power-of-two textures!'));
        }
        static _applySamplingMode(e, t) {
          let s = t.samplingMode,
            r = t.samplingMode;
          9985 === s || 9987 === s
            ? ((s = 9729), t.hasMipmap || (r = 9729))
            : (9984 !== s && 9986 !== s) || ((s = 9728), t.hasMipmap || (r = 9728)),
            e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, s),
            e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, r);
        }
        static _applyWrapMode(e, t) {
          'number' == typeof t.wrapMode
            ? (e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, t.wrapMode),
              e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, t.wrapMode))
            : (e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, t.wrapMode.s),
              e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, t.wrapMode.t));
        }
        static _applyAnisotropicFilteringParameters(e, t) {
          var s;
          const r = e.capabilities.textureFilterAnisotropic;
          if (!r) return;
          const i = e.gl;
          i.texParameterf(
            i.TEXTURE_2D,
            r.TEXTURE_MAX_ANISOTROPY,
            null != (s = t.maxAnisotropy) ? s : 1,
          );
        }
      }
      h.TEXTURE_UNIT_FOR_UPDATES = 0;
    },
    11084: (e, t, s) => {
      'use strict';
      s.d(t, { T: () => f, a: () => c });
      var r = s(60947),
        i = s(6687),
        n = s(91055);
      function o(e, t) {
        return [e, t];
      }
      function a(e, t, s) {
        return (e[0] = t), (e[1] = s), e;
      }
      const h = new i.T('0/0/0/0');
      class l {
        constructor(e, t, s, r, i, n, o, a, h, l, c, u) {
          (this.level = e),
            (this.resolution = t),
            (this.scale = s),
            (this.origin = r),
            (this.first = i),
            (this.last = n),
            (this.size = o),
            (this.norm = a),
            (this.worldStart = h),
            (this.worldEnd = l),
            (this.worldSize = c),
            (this.wrap = u);
        }
        static create(e, t, s) {
          const i = (0, r.g)(e.spatialReference),
            n = o(e.origin.x, e.origin.y),
            h = o(e.size[0] * t.resolution, e.size[1] * t.resolution),
            c = o(-1 / 0, -1 / 0),
            u = o(1 / 0, 1 / 0),
            d = o(1 / 0, 1 / 0);
          let p, g, f, _;
          return (
            s &&
              (a(
                c,
                Math.max(0, Math.floor((s.xmin - n[0]) / h[0])),
                Math.max(0, Math.floor((n[1] - s.ymax) / h[1])),
              ),
              a(
                u,
                Math.max(0, Math.floor((s.xmax - n[0]) / h[0])),
                Math.max(0, Math.floor((n[1] - s.ymin) / h[1])),
              ),
              a(d, u[0] - c[0] + 1, u[1] - c[1] + 1)),
            e.isWrappable
              ? ((p = o(
                  Math.ceil(Math.round((i.valid[1] - i.valid[0]) / t.resolution) / e.size[0]),
                  d[1],
                )),
                (g = o(Math.floor((i.origin[0] - n[0]) / h[0]), c[1])),
                (f = o(p[0] + g[0] - 1, u[1])),
                (_ = !0))
              : ((g = c), (f = u), (p = d), (_ = !1)),
            new l(t.level, t.resolution, t.scale, n, c, u, d, h, g, f, p, _)
          );
        }
        normalizeCol(e) {
          if (!this.wrap) return e;
          const t = this.worldSize[0];
          return e < 0 ? t - 1 - Math.abs((e + 1) % t) : e % t;
        }
        denormalizeCol(e, t) {
          return this.wrap ? this.worldSize[0] * t + e : e;
        }
        getWorldForColumn(e) {
          return this.wrap ? Math.floor(e / this.worldSize[0]) : 0;
        }
        getFirstColumnForWorld(e) {
          return e * this.worldSize[0] + this.first[0];
        }
        getLastColumnForWorld(e) {
          return e * this.worldSize[0] + this.first[0] + this.size[0] - 1;
        }
        getColumnForX(e) {
          return (e - this.origin[0]) / this.norm[0];
        }
        getXForColumn(e) {
          return this.origin[0] + e * this.norm[0];
        }
        getRowForY(e) {
          return (this.origin[1] - e) / this.norm[1];
        }
        getYForRow(e) {
          return this.origin[1] - e * this.norm[1];
        }
        getTileBounds(e, t, s = !1) {
          h.set(t);
          const r = s ? h.col : this.denormalizeCol(h.col, h.world),
            i = h.row;
          return (
            (function (e, t, s, r, i) {
              (e[0] = t), (e[1] = s), (e[2] = r), (e[3] = i);
            })(
              e,
              this.getXForColumn(r),
              this.getYForRow(i + 1),
              this.getXForColumn(r + 1),
              this.getYForRow(i),
            ),
            e
          );
        }
        getTileCoords(e, t, s = !1) {
          h.set(t);
          const r = s ? h.col : this.denormalizeCol(h.col, h.world);
          return (
            Array.isArray(e)
              ? a(e, this.getXForColumn(r), this.getYForRow(h.row))
              : ((e.x = this.getXForColumn(r)), (e.y = this.getYForRow(h.row))),
            e
          );
        }
      }
      class c {
        constructor() {
          this.spans = [];
        }
        acquire(e) {
          this.lodInfo = e;
        }
        release() {
          (this.lodInfo = null), (this.spans.length = 0);
        }
        forEach(e, t) {
          const { spans: s, lodInfo: r } = this,
            { level: i } = r;
          if (0 !== s.length)
            for (const { row: n, colFrom: o, colTo: a } of s)
              for (let s = o; s <= a; s++)
                e.call(t, i, n, r.normalizeCol(s), r.getWorldForColumn(s));
        }
      }
      c.pool = new n.O(c);
      class u {
        constructor(e, t, s) {
          (this.row = e), (this.colFrom = t), (this.colTo = s);
        }
      }
      const d = new i.T('0/0/0/0');
      class p {
        constructor(e, t, s, r, i, n, o, a) {
          (this.x = e),
            (this.ymin = t),
            (this.ymax = s),
            (this.invM = r),
            (this.leftAdjust = i),
            (this.rightAdjust = n),
            (this.leftBound = o),
            (this.rightBound = a);
        }
        static create(e, t) {
          e[1] > t[1] && ([e, t] = [t, e]);
          const [s, r] = e,
            [i, n] = t,
            o = i - s,
            a = n - r,
            h = 0 !== a ? o / a : 0,
            l = (Math.ceil(r) - r) * h,
            c = (Math.floor(r) - r) * h;
          return new p(
            s,
            Math.floor(r),
            Math.ceil(n),
            h,
            o < 0 ? l : c,
            o < 0 ? c : l,
            o < 0 ? i : s,
            o < 0 ? s : i,
          );
        }
        incrRow() {
          this.x += this.invM;
        }
        getLeftCol() {
          return Math.max(this.x + this.leftAdjust, this.leftBound);
        }
        getRightCol() {
          return Math.min(this.x + this.rightAdjust, this.rightBound);
        }
      }
      const g = [
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
      ];
      class f {
        constructor(e, t) {
          (this.tileInfo = e),
            (this.fullExtent = t),
            (this.scales = []),
            (this._lodInfos = null),
            (this._infoByScale = {}),
            (this._infoByLevel = {});
          const s = e.lods.slice();
          s.sort(function (e, t) {
            return t.scale - e.scale;
          });
          const r = (this._lodInfos = s.map((s) => l.create(e, s, t)));
          s.forEach((e, t) => {
            (this._infoByLevel[e.level] = r[t]),
              (this._infoByScale[e.scale] = r[t]),
              (this.scales[t] = e.scale);
          }, this),
            (this._wrap = e.isWrappable);
        }
        get spatialReference() {
          return this.tileInfo.spatialReference;
        }
        getLODInfoAt(e) {
          return this._infoByLevel['number' == typeof e ? e : e.level];
        }
        getTileBounds(e, t, s = !1) {
          d.set(t);
          const r = this._infoByLevel[d.level];
          return r ? r.getTileBounds(e, d, s) : e;
        }
        getTileCoords(e, t, s = !1) {
          d.set(t);
          const r = this._infoByLevel[d.level];
          return r ? r.getTileCoords(e, d, s) : e;
        }
        getTileCoverage(e, t = 192, s = 'closest') {
          const r =
              'closest' === s
                ? this.getClosestInfoForScale(e.scale)
                : this.getSmallestInfoForScale(e.scale),
            i = c.pool.acquire(r),
            n = this._wrap;
          let o,
            a,
            h,
            l = 1 / 0,
            d = -1 / 0;
          const f = i.spans;
          (g[0][0] = g[0][1] = g[1][1] = g[3][0] = -t),
            (g[1][0] = g[2][0] = e.size[0] + t),
            (g[2][1] = g[3][1] = e.size[1] + t);
          for (const t of g)
            e.toMap(t, t), (t[0] = r.getColumnForX(t[0])), (t[1] = r.getRowForY(t[1]));
          const _ = [];
          let m = 3;
          for (let e = 0; e < 4; e++) {
            if (g[e][1] === g[m][1]) {
              m = e;
              continue;
            }
            const t = p.create(g[e], g[m]);
            (l = Math.min(t.ymin, l)),
              (d = Math.max(t.ymax, d)),
              void 0 === _[t.ymin] && (_[t.ymin] = []),
              _[t.ymin].push(t),
              (m = e);
          }
          if (null == l || null == d || d - l > 100) return null;
          let y = [];
          for (o = l; o < d; ) {
            null != _[o] && (y = y.concat(_[o])), (a = 1 / 0), (h = -1 / 0);
            for (let e = y.length - 1; e >= 0; e--) {
              const t = y[e];
              (a = Math.min(a, t.getLeftCol())), (h = Math.max(h, t.getRightCol()));
            }
            if (((a = Math.floor(a)), (h = Math.floor(h)), o >= r.first[1] && o <= r.last[1]))
              if (n)
                if (r.size[0] < r.worldSize[0]) {
                  const e = Math.floor(h / r.worldSize[0]);
                  for (let t = Math.floor(a / r.worldSize[0]); t <= e; t++)
                    f.push(
                      new u(
                        o,
                        Math.max(r.getFirstColumnForWorld(t), a),
                        Math.min(r.getLastColumnForWorld(t), h),
                      ),
                    );
                } else f.push(new u(o, a, h));
              else
                a > r.last[0] ||
                  h < r.first[0] ||
                  ((a = Math.max(a, r.first[0])),
                  (h = Math.min(h, r.last[0])),
                  f.push(new u(o, a, h)));
            o += 1;
            for (let e = y.length - 1; e >= 0; e--) {
              const t = y[e];
              t.ymax >= o ? t.incrRow() : y.splice(e, 1);
            }
          }
          return i;
        }
        getTileParentId(e) {
          d.set(e);
          const t = this._infoByLevel[d.level],
            s = this._lodInfos.indexOf(t) - 1;
          return s < 0 ? null : (this._getTileIdAtLOD(d, this._lodInfos[s], d), d.id);
        }
        getTileResolution(e) {
          const t = this._infoByLevel['object' == typeof e ? e.level : e];
          return t ? t.resolution : -1;
        }
        getTileScale(e) {
          const t = this._infoByLevel[e.level];
          return t ? t.scale : -1;
        }
        intersects(e, t) {
          d.set(t);
          const s = this._infoByLevel[d.level],
            r = e.lodInfo;
          if (r.resolution > s.resolution) {
            this._getTileIdAtLOD(d, r, d);
            const t = r.denormalizeCol(d.col, d.world);
            for (const s of e.spans)
              if (s.row === d.row && s.colFrom <= t && s.colTo >= t) return !0;
          }
          if (r.resolution < s.resolution) {
            const [t, i, n, o] = e.spans.reduce(
                (e, t) => (
                  (e[0] = Math.min(e[0], t.row)),
                  (e[1] = Math.max(e[1], t.row)),
                  (e[2] = Math.min(e[2], t.colFrom)),
                  (e[3] = Math.max(e[3], t.colTo)),
                  e
                ),
                [1 / 0, -1 / 0, 1 / 0, -1 / 0],
              ),
              a = s.denormalizeCol(d.col, d.world),
              h = r.getColumnForX(s.getXForColumn(a)),
              l = r.getRowForY(s.getYForRow(d.row)),
              c = r.getColumnForX(s.getXForColumn(a + 1)) - 1,
              u = r.getRowForY(s.getYForRow(d.row + 1)) - 1;
            return !(h > o || c < n || l > i || u < t);
          }
          const i = r.denormalizeCol(d.col, d.world);
          return e.spans.some((e) => e.row === d.row && e.colFrom <= i && e.colTo >= i);
        }
        normalizeBounds(e, t, s) {
          if (((e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), this._wrap)) {
            const t = (0, r.g)(this.tileInfo.spatialReference),
              i = -s * (t.valid[1] - t.valid[0]);
            (e[0] += i), (e[2] += i);
          }
          return e;
        }
        getSmallestInfoForScale(e) {
          const t = this.scales;
          if (this._infoByScale[e]) return this._infoByScale[e];
          if (e > t[0]) return this._infoByScale[t[0]];
          for (let s = 1; s < t.length - 1; s++)
            if (e > t[s] + 1e-6) return this._infoByScale[t[s - 1]];
          return this._infoByScale[t[t.length - 1]];
        }
        getClosestInfoForScale(e) {
          const t = this.scales;
          return (
            this._infoByScale[e] ||
              (e = t.reduce((t, s) => (Math.abs(s - e) < Math.abs(t - e) ? s : t), t[0])),
            this._infoByScale[e]
          );
        }
        scaleToLevel(e) {
          const t = this.scales;
          if (this._infoByScale[e]) return this._infoByScale[e].level;
          for (let s = t.length - 1; s >= 0; s--)
            if (e < t[s])
              return s === t.length - 1
                ? this._infoByScale[t[t.length - 1]].level
                : this._infoByScale[t[s]].level + (t[s] - e) / (t[s] - t[s + 1]);
          return this._infoByScale[t[0]].level;
        }
        scaleToZoom(e) {
          return this.tileInfo.scaleToZoom(e);
        }
        _getTileIdAtLOD(e, t, s) {
          const r = this._infoByLevel[s.level];
          return (
            e.set(s),
            t.resolution < r.resolution
              ? null
              : (t.resolution === r.resolution ||
                  ((e.level = t.level),
                  (e.col = Math.floor((s.col * r.resolution) / t.resolution + 0.01)),
                  (e.row = Math.floor((s.row * r.resolution) / t.resolution + 0.01))),
                e)
          );
        }
      }
    },
    6687: (e, t, s) => {
      'use strict';
      s.d(t, { T: () => i });
      var r = s(91055);
      class i {
        constructor(e, t, s, r) {
          this.set(e, t, s, r);
        }
        static getId(e, t, s, r) {
          return 'object' == typeof e
            ? `${e.level}/${e.row}/${e.col}/${e.world}`
            : `${e}/${t}/${s}/${r}`;
        }
        get key() {
          return this;
        }
        get id() {
          return this.toString();
        }
        set id(e) {
          this.set(e);
        }
        acquire(e, t, s, r) {
          this.set(e, t, s, r);
        }
        contains(e) {
          const t = e.level - this.level;
          return this.row === e.row >> t && this.col === e.col >> t && this.world === e.world;
        }
        equals(e) {
          return (
            this.level === e.level &&
            this.row === e.row &&
            this.col === e.col &&
            this.world === e.world
          );
        }
        clone() {
          return new i(this);
        }
        release() {
          (this.level = 0), (this.row = 0), (this.col = 0), (this.world = 0);
        }
        set(e, t, s, r) {
          if (null == e) (this.level = 0), (this.row = 0), (this.col = 0), (this.world = 0);
          else if ('object' == typeof e)
            (this.level = e.level || 0),
              (this.row = e.row || 0),
              (this.col = e.col || 0),
              (this.world = e.world || 0);
          else if ('string' == typeof e) {
            const [t, s, r, i] = e.split('/');
            (this.level = parseFloat(t)),
              (this.row = parseFloat(s)),
              (this.col = parseFloat(r)),
              (this.world = parseFloat(i));
          } else (this.level = +e), (this.row = +t), (this.col = +s), (this.world = +r || 0);
          return this;
        }
        toString() {
          return `${this.level}/${this.row}/${this.col}/${this.world}`;
        }
        getParentKey() {
          return this.level <= 0
            ? null
            : new i(this.level - 1, this.row >> 1, this.col >> 1, this.world);
        }
        getChildKeys() {
          const e = this.level + 1,
            t = this.row << 1,
            s = this.col << 1,
            r = this.world;
          return [
            new i(e, t, s, r),
            new i(e, t, s + 1, r),
            new i(e, t + 1, s, r),
            new i(e, t + 1, s + 1, r),
          ];
        }
        compareRowMajor(e) {
          return this.row < e.row
            ? -1
            : this.row > e.row
            ? 1
            : this.col < e.col
            ? -1
            : this.col > e.col
            ? 1
            : 0;
        }
      }
      i.pool = new r.O(i, null, null, 25, 50);
    },
    3498: (e, t, s) => {
      'use strict';
      s.d(t, {
        A: () => Y,
        C: () => Z,
        F: () => D,
        T: () => K,
        g: () => z,
        i: () => B,
        r: () => v,
      });
      var r = s(76506),
        i = s(40267),
        n = s(21929),
        o = s(60991),
        a = s(92143),
        h = s(82426),
        l = s(50406),
        c = s(93939),
        u = s(1709),
        d = s(82356),
        p = s(55029),
        g = s(86929),
        f = s(76996),
        _ = s(98576),
        m = s(91055),
        y = s(21801),
        b = s(92482),
        x = s(31292),
        I = s(6687),
        w = s(11084);
      function v(e, t) {
        if (!(this instanceof v)) return new v(e, t);
        (this._maxEntries = Math.max(4, e || 9)),
          (this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries))),
          t && ('function' == typeof t ? (this.toBBox = t) : this._initFormat(t)),
          this.clear();
      }
      function S(e, t, s) {
        if (!s) return t.indexOf(e);
        for (var r = 0; r < t.length; r++) if (s(e, t[r])) return r;
        return -1;
      }
      function T(e, t) {
        F(e, 0, e.children.length, t, e);
      }
      function F(e, t, s, r, i) {
        i || (i = L(null)),
          (i.minX = 1 / 0),
          (i.minY = 1 / 0),
          (i.maxX = -1 / 0),
          (i.maxY = -1 / 0);
        for (var n, o = t; o < s; o++) (n = e.children[o]), k(i, e.leaf ? r(n) : n);
        return i;
      }
      function k(e, t) {
        return (
          (e.minX = Math.min(e.minX, t.minX)),
          (e.minY = Math.min(e.minY, t.minY)),
          (e.maxX = Math.max(e.maxX, t.maxX)),
          (e.maxY = Math.max(e.maxY, t.maxY)),
          e
        );
      }
      function E(e, t) {
        return e.minX - t.minX;
      }
      function C(e, t) {
        return e.minY - t.minY;
      }
      function M(e) {
        return (e.maxX - e.minX) * (e.maxY - e.minY);
      }
      function A(e) {
        return e.maxX - e.minX + (e.maxY - e.minY);
      }
      function O(e, t) {
        return e.minX <= t.minX && e.minY <= t.minY && t.maxX <= e.maxX && t.maxY <= e.maxY;
      }
      function R(e, t) {
        return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
      }
      function L(e) {
        return {
          children: e,
          height: 1,
          leaf: !0,
          minX: 1 / 0,
          minY: 1 / 0,
          maxX: -1 / 0,
          maxY: -1 / 0,
        };
      }
      function P(e, t, s, r, i) {
        for (var n, o = [t, s]; o.length; )
          (s = o.pop()) - (t = o.pop()) <= r ||
            ((n = t + Math.ceil((s - t) / r / 2) * r), (0, _.q)(e, n, t, s, i), o.push(t, n, n, s));
      }
      v.prototype = {
        all: function () {
          return this._all(this.data, []);
        },
        search: function (e) {
          var t = this.data,
            s = [],
            r = this.toBBox;
          if (!R(e, t)) return s;
          for (var i, n, o, a, h = []; t; ) {
            for (i = 0, n = t.children.length; i < n; i++)
              (o = t.children[i]),
                R(e, (a = t.leaf ? r(o) : o)) &&
                  (t.leaf ? s.push(o) : O(e, a) ? this._all(o, s) : h.push(o));
            t = h.pop();
          }
          return s;
        },
        collides: function (e) {
          var t = this.data,
            s = this.toBBox;
          if (!R(e, t)) return !1;
          for (var r, i, n, o, a = []; t; ) {
            for (r = 0, i = t.children.length; r < i; r++)
              if (((n = t.children[r]), R(e, (o = t.leaf ? s(n) : n)))) {
                if (t.leaf || O(e, o)) return !0;
                a.push(n);
              }
            t = a.pop();
          }
          return !1;
        },
        load: function (e) {
          if (!e || !e.length) return this;
          if (e.length < this._minEntries) {
            for (var t = 0, s = e.length; t < s; t++) this.insert(e[t]);
            return this;
          }
          var r = this._build(e.slice(), 0, e.length - 1, 0);
          if (this.data.children.length)
            if (this.data.height === r.height) this._splitRoot(this.data, r);
            else {
              if (this.data.height < r.height) {
                var i = this.data;
                (this.data = r), (r = i);
              }
              this._insert(r, this.data.height - r.height - 1, !0);
            }
          else this.data = r;
          return this;
        },
        insert: function (e) {
          return e && this._insert(e, this.data.height - 1), this;
        },
        clear: function () {
          return (this.data = L([])), this;
        },
        remove: function (e, t) {
          if (!e) return this;
          for (var s, r, i, n, o = this.data, a = this.toBBox(e), h = [], l = []; o || h.length; ) {
            if (
              (o || ((o = h.pop()), (r = h[h.length - 1]), (s = l.pop()), (n = !0)),
              o.leaf && -1 !== (i = S(e, o.children, t)))
            )
              return o.children.splice(i, 1), h.push(o), this._condense(h), this;
            n || o.leaf || !O(o, a)
              ? r
                ? (s++, (o = r.children[s]), (n = !1))
                : (o = null)
              : (h.push(o), l.push(s), (s = 0), (r = o), (o = o.children[0]));
          }
          return this;
        },
        toBBox: function (e) {
          return e;
        },
        compareMinX: E,
        compareMinY: C,
        toJSON: function () {
          return this.data;
        },
        fromJSON: function (e) {
          return (this.data = e), this;
        },
        _all: function (e, t) {
          for (var s = []; e; )
            e.leaf ? t.push.apply(t, e.children) : s.push.apply(s, e.children), (e = s.pop());
          return t;
        },
        _build: function (e, t, s, r) {
          var i,
            n = s - t + 1,
            o = this._maxEntries;
          if (n <= o) return T((i = L(e.slice(t, s + 1))), this.toBBox), i;
          r ||
            ((r = Math.ceil(Math.log(n) / Math.log(o))), (o = Math.ceil(n / Math.pow(o, r - 1)))),
            ((i = L([])).leaf = !1),
            (i.height = r);
          var a,
            h,
            l,
            c,
            u = Math.ceil(n / o),
            d = u * Math.ceil(Math.sqrt(o));
          for (P(e, t, s, d, this.compareMinX), a = t; a <= s; a += d)
            for (P(e, a, (l = Math.min(a + d - 1, s)), u, this.compareMinY), h = a; h <= l; h += u)
              (c = Math.min(h + u - 1, l)), i.children.push(this._build(e, h, c, r - 1));
          return T(i, this.toBBox), i;
        },
        _chooseSubtree: function (e, t, s, r) {
          for (var i, n, o, a, h, l, c, u, d, p; r.push(t), !t.leaf && r.length - 1 !== s; ) {
            for (c = u = 1 / 0, i = 0, n = t.children.length; i < n; i++)
              (h = M((o = t.children[i]))),
                (d = e),
                (p = o),
                (l =
                  (Math.max(p.maxX, d.maxX) - Math.min(p.minX, d.minX)) *
                    (Math.max(p.maxY, d.maxY) - Math.min(p.minY, d.minY)) -
                  h) < u
                  ? ((u = l), (c = h < c ? h : c), (a = o))
                  : l === u && h < c && ((c = h), (a = o));
            t = a || t.children[0];
          }
          return t;
        },
        _insert: function (e, t, s) {
          var r = this.toBBox,
            i = s ? e : r(e),
            n = [],
            o = this._chooseSubtree(i, this.data, t, n);
          for (o.children.push(e), k(o, i); t >= 0 && n[t].children.length > this._maxEntries; )
            this._split(n, t), t--;
          this._adjustParentBBoxes(i, n, t);
        },
        _split: function (e, t) {
          var s = e[t],
            r = s.children.length,
            i = this._minEntries;
          this._chooseSplitAxis(s, i, r);
          var n = this._chooseSplitIndex(s, i, r),
            o = L(s.children.splice(n, s.children.length - n));
          (o.height = s.height),
            (o.leaf = s.leaf),
            T(s, this.toBBox),
            T(o, this.toBBox),
            t ? e[t - 1].children.push(o) : this._splitRoot(s, o);
        },
        _splitRoot: function (e, t) {
          (this.data = L([e, t])),
            (this.data.height = e.height + 1),
            (this.data.leaf = !1),
            T(this.data, this.toBBox);
        },
        _chooseSplitIndex: function (e, t, s) {
          var r, i, n, o, a, h, l, c, u, d, p, g, f, _;
          for (h = l = 1 / 0, r = t; r <= s - t; r++)
            (u = i = F(e, 0, r, this.toBBox)),
              (d = n = F(e, r, s, this.toBBox)),
              (p = Math.max(u.minX, d.minX)),
              (g = Math.max(u.minY, d.minY)),
              (f = Math.min(u.maxX, d.maxX)),
              (_ = Math.min(u.maxY, d.maxY)),
              (o = Math.max(0, f - p) * Math.max(0, _ - g)),
              (a = M(i) + M(n)),
              o < h
                ? ((h = o), (c = r), (l = a < l ? a : l))
                : o === h && a < l && ((l = a), (c = r));
          return c;
        },
        _chooseSplitAxis: function (e, t, s) {
          var r = e.leaf ? this.compareMinX : E,
            i = e.leaf ? this.compareMinY : C;
          this._allDistMargin(e, t, s, r) < this._allDistMargin(e, t, s, i) && e.children.sort(r);
        },
        _allDistMargin: function (e, t, s, r) {
          e.children.sort(r);
          var i,
            n,
            o = this.toBBox,
            a = F(e, 0, t, o),
            h = F(e, s - t, s, o),
            l = A(a) + A(h);
          for (i = t; i < s - t; i++) (n = e.children[i]), k(a, e.leaf ? o(n) : n), (l += A(a));
          for (i = s - t - 1; i >= t; i--)
            (n = e.children[i]), k(h, e.leaf ? o(n) : n), (l += A(h));
          return l;
        },
        _adjustParentBBoxes: function (e, t, s) {
          for (var r = s; r >= 0; r--) k(t[r], e);
        },
        _condense: function (e) {
          for (var t, s = e.length - 1; s >= 0; s--)
            0 === e[s].children.length
              ? s > 0
                ? (t = e[s - 1].children).splice(t.indexOf(e[s]), 1)
                : this.clear()
              : T(e[s], this.toBBox);
        },
        _initFormat: function (e) {
          var t = ['return a', ' - b', ';'];
          (this.compareMinX = new Function('a', 'b', t.join(e[0]))),
            (this.compareMinY = new Function('a', 'b', t.join(e[1]))),
            (this.toBBox = new Function(
              'a',
              'return {minX: a' +
                e[0] +
                ', minY: a' +
                e[1] +
                ', maxX: a' +
                e[2] +
                ', maxY: a' +
                e[3] +
                '};',
            ));
        },
      };
      class D extends n.F {
        constructor(e, t, s) {
          super(e),
            (this._featureIndex = -1),
            (this._dateFields = new Set()),
            (this._geometryType = s),
            (this._features = t);
        }
        static fromFeatures(e, t, s) {
          const r = (0, i.n)([], e, t, !1, !1, s);
          for (let t = 0; t < r.length; t++) r[t].displayId = e[t].displayId;
          return D.fromOptimizedFeatures(r, t);
        }
        static fromFeatureSet(e, t) {
          const s = (0, i.m)(e, t);
          return D.fromOptimizedFeatureSet(s);
        }
        static fromOptimizedFeatureSet(e) {
          const { features: t, geometryType: s } = e,
            r = D.fromOptimizedFeatures(t, s);
          (r._exceededTransferLimit = e.exceededTransferLimit), (r._transform = e.transform);
          for (const t of e.fields) 'esriFieldTypeDate' === t.type && r._dateFields.add(t.name);
          return r;
        }
        static fromOptimizedFeatures(e, t, s) {
          const r = n.F.createInstance(),
            i = new D(r, e, t);
          return (i._transform = s), i;
        }
        get _current() {
          return this._features[this._featureIndex];
        }
        get geometryType() {
          return this._geometryType;
        }
        get hasFeatures() {
          return !!this._features.length;
        }
        get hasNext() {
          return this._featureIndex + 1 < this._features.length;
        }
        get exceededTransferLimit() {
          return this._exceededTransferLimit;
        }
        get hasZ() {
          return !1;
        }
        get hasM() {
          return !1;
        }
        removeIds(e) {
          const t = new Set(e);
          this._features = this._features.filter((e) => !t.has(e.objectId));
        }
        append(e) {
          for (const t of e) this._features.push(t);
        }
        getSize() {
          return this._features.length;
        }
        getCursor() {
          return this.copy();
        }
        getQuantizationTransform() {
          return this._transform;
        }
        getAttributeHash() {
          let e = '';
          for (const t in this._current.attributes) e += this._current.attributes[t];
          return e;
        }
        getIndex() {
          return this._featureIndex;
        }
        setIndex(e) {
          this._featureIndex = e;
        }
        getObjectId() {
          return this._current.objectId;
        }
        getDisplayId() {
          return this._current.displayId;
        }
        setDisplayId(e) {
          this._current.displayId = e;
        }
        getGroupId() {
          return this._current.groupId;
        }
        setGroupId(e) {
          this._current.groupId = e;
        }
        copy() {
          const e = new D(this.instance, this._features, this.geometryType);
          return this.copyInto(e), e;
        }
        next() {
          for (; ++this._featureIndex < this._features.length && !this._getExists(); );
          return this._featureIndex < this._features.length;
        }
        readLegacyFeature() {
          return (0, i.o)(this._current, this.geometryType, this.hasZ, this.hasM);
        }
        readOptimizedFeature() {
          return this._current;
        }
        readLegacyPointGeometry() {
          return this.readGeometry() ? { x: this.getX(), y: this.getY() } : null;
        }
        readLegacyGeometry() {
          const e = this.readGeometry();
          return (0, i.c)(e, this.geometryType, this.hasZ, this.hasM);
        }
        readLegacyCentroid() {
          const e = this.readCentroid();
          return e
            ? { x: e.coords[0] * this._sx + this._tx, y: e.coords[1] * this._sy + this._ty }
            : null;
        }
        readGeometryArea() {
          return (0, i.w)(this._current.geometry, 2);
        }
        readUnquantizedGeometry() {
          const e = this.readGeometry();
          if ('esriGeometryPoint' === this.geometryType || !e) return e;
          const t = e.clone();
          return (
            (function ({ coords: e, lengths: t }) {
              let s = 0;
              for (const r of t) {
                for (let t = 1; t < r; t++)
                  (e[2 * (s + t)] += e[2 * (s + t) - 2]),
                    (e[2 * (s + t) + 1] += e[2 * (s + t) - 1]);
                s += r;
              }
            })(t),
            t
          );
        }
        readHydratedGeometry() {
          const e = this._current.geometry;
          if (!e) return null;
          const t = e.clone();
          return (
            (0, r.i)(this._transform) && (0, i.u)(t, t, this.hasZ, this.hasM, this._transform), t
          );
        }
        getXHydrate() {
          const e = this._current.geometry.coords[0],
            t = this.getQuantizationTransform();
          return (0, r.b)(t) ? e : e * t.scale[0] + t.translate[0];
        }
        getYHydrate() {
          const e = this._current.geometry.coords[1],
            t = this.getQuantizationTransform();
          return (0, r.b)(t) ? e : t.translate[1] - e * t.scale[1];
        }
        getX() {
          return this._current.geometry.coords[0] * this._sx + this._tx;
        }
        getY() {
          return this._current.geometry.coords[1] * this._sy + this._ty;
        }
        readGeometry() {
          if (!this._current.hasGeometry) return null;
          const e = this._current.geometry.clone();
          if (e.isPoint)
            return (
              (e.coords[0] = e.coords[0] * this._sx + this._tx),
              (e.coords[1] = e.coords[1] * this._sy + this._ty),
              e
            );
          let t = 0;
          for (const s of e.lengths)
            (e.coords[2 * t] = e.coords[2 * t] * this._sx + this._tx),
              (e.coords[2 * t + 1] = e.coords[2 * t + 1] * this._sy + this._ty),
              (t += s);
          return e;
        }
        readCentroid() {
          if (!this._current.hasGeometry) return null;
          if (!this._current.centroid) {
            const e = this._computeCentroid();
            if (!e) return null;
            (e.coords[0] = (e.coords[0] - this._tx) / this._sx),
              (e.coords[1] = (e.coords[1] - this._ty) / this._sy),
              (this._current.centroid = e);
          }
          const e = this._current.centroid.clone();
          return (
            (e.coords[0] = e.coords[0] * this._sx + this._tx),
            (e.coords[1] = e.coords[1] * this._sx + this._ty),
            e
          );
        }
        _readAttribute(e, t) {
          const s = this._current.attributes[e];
          if (void 0 !== s) return null != s && t && this._dateFields.has(e) ? new Date(s) : s;
          const r = this.readAttributes(),
            i = e.toLocaleLowerCase().trim();
          for (const e in r)
            if (e.toLocaleLowerCase().trim() === i) {
              const s = this._current.attributes[e];
              return null != s && t && this._dateFields.has(e) ? new Date(s) : s;
            }
        }
        copyInto(e) {
          super.copyInto(e),
            (e._featureIndex = this._featureIndex),
            (e._transform = this._transform),
            (e._dateFields = this._dateFields);
        }
        _readAttributes() {
          return this._current.attributes;
        }
      }
      const U = a.L.getLogger('esri.views.layers.2d.features.support.AttributeStore'),
        N = (0, g.c)(g.D, U),
        q = (e) => (2147483648 & e) >>> 31,
        z = (e) => 2147483647 & e;
      function B(e) {
        return 1 === q(e);
      }
      const j = {
        sharedArrayBuffer: (0, r.h)('esri-shared-array-buffer'),
        atomics: (0, r.h)('esri-atomics'),
      };
      function G(e, t) {
        return (s) => t(e(s));
      }
      class X {
        constructor(e, t, s, r) {
          (this.size = 0), (this.texelSize = 4);
          const { pixelType: i, layout: n, textureOnly: o } = r;
          (this.textureOnly = o || !1),
            (this.pixelType = i),
            (this._ctype = t),
            (this.layout = n),
            this._resetRange(),
            (this._shared = e),
            (this.size = s),
            o || (this.data = this._initData(i, s, e, t));
        }
        get buffer() {
          return (0, r.e)(this.data, (e) => e.buffer);
        }
        unsetComponentAllTexels(e, t) {
          const s = (0, r.u)(this.data);
          for (let r = 0; r < this.size * this.size; r++) s[r * this.texelSize + e] &= ~t;
          (this.dirtyStart = 0), (this.dirtyEnd = this.size * this.size - 1);
        }
        setComponentAllTexels(e, t) {
          const s = (0, r.u)(this.data);
          for (let r = 0; r < this.size * this.size; r++) s[r * this.texelSize + e] |= 255 & t;
          (this.dirtyStart = 0), (this.dirtyEnd = this.size * this.size - 1);
        }
        setComponent(e, t, s) {
          const i = (0, r.u)(this.data);
          for (const r of s)
            (i[r * this.texelSize + e] |= t),
              (this.dirtyStart = Math.min(this.dirtyStart, r)),
              (this.dirtyEnd = Math.max(this.dirtyEnd, r));
        }
        setComponentTexel(e, t, s) {
          ((0, r.u)(this.data)[s * this.texelSize + e] |= t),
            (this.dirtyStart = Math.min(this.dirtyStart, s)),
            (this.dirtyEnd = Math.max(this.dirtyEnd, s));
        }
        unsetComponentTexel(e, t, s) {
          ((0, r.u)(this.data)[s * this.texelSize + e] &= ~t),
            (this.dirtyStart = Math.min(this.dirtyStart, s)),
            (this.dirtyEnd = Math.max(this.dirtyEnd, s));
        }
        getData(e, t) {
          const s = z(e);
          return (0, r.u)(this.data)[s * this.texelSize + t];
        }
        setData(e, t, s) {
          const r = z(e),
            i = 1 << t;
          0 != (this.layout & i)
            ? ((this.data[r * this.texelSize + t] = s),
              (this.dirtyStart = Math.min(this.dirtyStart, r)),
              (this.dirtyEnd = Math.max(this.dirtyEnd, r)))
            : U.error(
                'mapview-attributes-store',
                "Tried to set a value for a texel's readonly component",
              );
        }
        lock() {
          5121 === this.pixelType &&
            this._shared &&
            j.atomics &&
            'local' !== this._ctype &&
            Atomics.store(this.data, 0, 1);
        }
        unlock() {
          5121 === this.pixelType &&
            this._shared &&
            j.atomics &&
            'local' !== this._ctype &&
            Atomics.store(this.data, 0, 0);
        }
        expand(e) {
          if (((this.size = e), !this.textureOnly)) {
            const t = this._initData(this.pixelType, e, this._shared, this._ctype),
              s = (0, r.u)(this.data);
            t.set(s), (this.data = t);
          }
        }
        toMessage() {
          const e = this.dirtyStart,
            t = this.dirtyEnd,
            s = this.texelSize;
          if (e > t) return null;
          this._resetRange();
          const i = !(this._shared || 'local' === this._ctype),
            n = this.pixelType,
            o = this.layout,
            a = (0, r.u)(this.data);
          return {
            start: e,
            end: t,
            data: (i && a.slice(e * s, (t + 1) * s)) || null,
            pixelType: n,
            layout: o,
          };
        }
        _initData(e, t, s, r) {
          const i = s && 'local' !== r ? SharedArrayBuffer : ArrayBuffer,
            n = (0, p.g)(e),
            o = new n(new i(t * t * 4 * n.BYTES_PER_ELEMENT));
          for (let e = 0; e < o.length; e += 4) o[e + 1] = 255;
          return o;
        }
        _resetRange() {
          (this.dirtyStart = 2147483647), (this.dirtyEnd = 0);
        }
      }
      class Y {
        constructor(e, t) {
          (this._client = e),
            (this.config = t),
            (this._attributeComputeMap = new Map()),
            (this._blocks = new Array()),
            (this._filters = new Array(d.l)),
            (this._targetType = 0),
            (this._abortController = (0, l.yi)()),
            (this._hasScaleExpr = !1),
            (this._size = 32),
            (this._idsToHighlight = new Set());
          const s = t.supportsTextureFloat ? 5126 : 5121;
          N(`Creating AttributeStore ${j.sharedArrayBuffer ? 'with' : 'without'} shared memory`),
            (this._blockDescriptors = [
              { pixelType: 5121, layout: 1 },
              { pixelType: 5121, layout: 15, textureOnly: !0 },
              { pixelType: s, layout: 15 },
              { pixelType: s, layout: 15 },
            ]),
            (this._blocks = this._blockDescriptors.map(() => null));
        }
        destroy() {
          this._abortController.abort();
        }
        get hasScaleExpr() {
          return this._hasScaleExpr;
        }
        get _signal() {
          return this._abortController.signal;
        }
        update(e, t) {
          this.config = t;
          const s = t.schema.processors[0].storage,
            i = (0, c.d)(this._schema, s);
          if (
            ((e.targets.feature || e.targets.aggregate) && (e.storage.data = !0),
            i &&
              ((0, r.h)('esri-2d-update-debug') &&
                console.debug('Applying Update - AttributeStore:', i),
              (e.storage.data = !0),
              (this._schema = s),
              this._attributeComputeMap.clear(),
              !(0, r.b)(s)))
          ) {
            switch (s.target) {
              case 'feature':
                this._targetType = 0;
                break;
              case 'aggregate':
                this._targetType = 1;
            }
            if ('subtype' === s.type)
              for (const e in s.mapping) {
                const t = s.mapping[e];
                if ((0, r.i)(t)) for (const e of t.mapping) this._bindAttribute(e);
              }
            else for (const e of s.mapping) this._bindAttribute(e);
          }
        }
        onTileData(e, t) {
          if ((0, r.b)(t.addOrUpdate)) return;
          const s = t.addOrUpdate.getCursor();
          for (; s.next(); ) {
            const e = s.getDisplayId();
            this.setAttributeData(e, s);
          }
        }
        invalidateResources() {
          (this._createResourcesPromise = null),
            this._abortController.abort(),
            (this._abortController = (0, l.yi)());
        }
        async setHighlight(e, t) {
          const s = this._getBlock(0),
            r = t.map((e) => z(e));
          s.lock(),
            s.unsetComponentAllTexels(0, 1),
            s.setComponent(0, 1, r),
            s.unlock(),
            this._idsToHighlight.clear();
          for (const t of e) this._idsToHighlight.add(t);
          await this.sendUpdates();
        }
        async updateFilters(e, t) {
          const { config: s, service: i, spatialReference: n } = t,
            { filters: o } = s,
            a = o.map((e, t) => this._updateFilter(e, t, i, n));
          (await Promise.all(a)).some((e) => e) &&
            ((e.storage.filters = !0),
            (0, r.h)('esri-2d-update-debug') &&
              console.debug('Applying Update - AttributeStore:', 'Filters changed'));
        }
        setData(e, t, s, r) {
          const i = z(e);
          this._ensureSizeForTexel(i), this._getBlock(t).setData(e, s, r);
        }
        getData(e, t, s) {
          return this._getBlock(t).getData(e, s);
        }
        getHighlightFlag(e) {
          return this._idsToHighlight.has(e) ? d.H : 0;
        }
        unsetAttributeData(e) {
          const t = z(e);
          this._getBlock(0).setData(t, 0, 0);
        }
        setAttributeData(e, t) {
          const s = z(e);
          if (
            (this._ensureSizeForTexel(s),
            this._getBlock(0).setData(s, 0, this.getFilterFlags(t)),
            this._targetType !== q(e))
          )
            return;
          const r = this._attributeComputeMap,
            i = this.config.supportsTextureFloat ? 1 : 2;
          r.size &&
            r.forEach((e, r) => {
              const n = (r * i) % 4,
                o = Math.floor((r * i) / 4),
                a = this._getBlock(o + d.A),
                l = e(t);
              if (this.config.supportsTextureFloat) a.setData(s, n, l);
              else if (l === d.N) a.setData(s, n, 255), a.setData(s, n + 1, 255);
              else {
                const e = (0, h.c)(Math.round(l), -32767, 32766) + 32768,
                  t = 255 & e,
                  r = (65280 & e) >> 8;
                a.setData(s, n, t), a.setData(s, n + 1, r);
              }
            });
        }
        sendUpdates() {
          if (this._nextUpdate) return this._nextUpdate.promise;
          if (this._currUpdate) return (this._nextUpdate = (0, l.hh)()), this._nextUpdate.promise;
          const e = { blocks: this._blocks.map((e) => ((0, r.i)(e) ? e.toMessage() : null)) };
          return (
            (this._currUpdate = this._createResources()
              .then(() => {
                const t = () => {
                    if (((this._currUpdate = null), this._nextUpdate)) {
                      const e = this._nextUpdate;
                      (this._nextUpdate = null), this.sendUpdates().then(() => e.resolve());
                    }
                  },
                  s = this._client.update(e, this._signal).then(t).catch(t);
                return this._client.render(this._signal), s;
              })
              .catch((e) =>
                (0, l.D_)(e)
                  ? ((this._createResourcesPromise = null), this._createResources())
                  : (U.error(
                      new o.Z(
                        'mapview-attribute-store',
                        'Encountered an error during client update',
                        e,
                      ),
                    ),
                    Promise.resolve()),
              )),
            this._currUpdate
          );
        }
        _ensureSizeForTexel(e) {
          for (; e >= this._size * this._size; ) if (this._expand()) return;
        }
        _bindAttribute(e) {
          let t;
          if (null != e.fieldIndex)
            e.normalizationField &&
              U.warn(
                'mapview-arcade',
                'Ignoring normalizationField specified with an arcade expression which is not supported.',
              ),
              (t = (t) => t.getComputedNumericAtIndex(e.fieldIndex));
          else {
            if (!e.field) return;
            t = e.normalizationField
              ? (t) => {
                  const s = t.readAttribute(e.normalizationField);
                  return s ? t.readAttribute(e.field) / s : null;
                }
              : (t) => t.readAttribute(e.field);
          }
          e.valueRepresentation && (t = G(t, (t) => (0, g.g)(t, e.valueRepresentation))),
            this._attributeComputeMap.set(
              e.binding,
              G(t, (e) => (null === e || isNaN(e) || e === 1 / 0 ? d.N : e)),
            );
        }
        _createResources() {
          if ((0, r.i)(this._createResourcesPromise)) return this._createResourcesPromise;
          this._getBlock(d.m), N('Initializing AttributeStore');
          const e = {
              shared: j.sharedArrayBuffer && !('local' === this._client.type),
              size: this._size,
              blocks: (0, r.F)(this._blocks, (e) => ({
                textureOnly: e.textureOnly,
                buffer: e.buffer,
                pixelType: e.pixelType,
              })),
            },
            t = this._client.initialize(e, this._signal).catch((e) => {
              (0, l.D_)(e)
                ? (this._createResourcesPromise = null)
                : U.error(
                    new o.Z(
                      'mapview-attribute-store',
                      'Encountered an error during client initialization',
                      e,
                    ),
                  );
            });
          return (
            (this._createResourcesPromise = t),
            t.then(() =>
              (0, r.b)(this._createResourcesPromise) ? this._createResources() : void 0,
            ),
            t
          );
        }
        _getBlock(e) {
          const t = this._blocks[e];
          if ((0, r.i)(t)) return t;
          N(`Initializing AttributeBlock at index ${e}`);
          const s = j.sharedArrayBuffer,
            i = this._client.type,
            n = new X(s, i, this._size, this._blockDescriptors[e]);
          return (this._blocks[e] = n), (this._createResourcesPromise = null), n;
        }
        _expand() {
          if (this._size < this.config.maxTextureSize) {
            const e = (this._size <<= 1);
            return (
              N('Expanding block size to', e, this._blocks),
              (0, r.D)(this._blocks, (t) => t.expand(e)),
              (this._createResourcesPromise = null),
              (this._size = e),
              0
            );
          }
          return (
            U.error(
              new o.Z('mapview-limitations', 'Maximum number of onscreen features exceeded.'),
            ),
            -1
          );
        }
        async _updateFilter(e, t, s, i) {
          const n = this._filters[t],
            o = (0, r.i)(n) && n.hash;
          if (!n && !e) return !1;
          if (o === JSON.stringify(e)) return !1;
          if ((0, r.b)(e)) {
            if (!n) return !1;
            const e = 1 << (t + 1),
              s = this._getBlock(0);
            return (this._filters[t] = null), s.setComponentAllTexels(0, e), this.sendUpdates(), !0;
          }
          const a = await this._getFilter(t, s);
          return await a.update(e, i), !0;
        }
        async _getFilter(e, t) {
          const i = this._filters[e];
          if ((0, r.i)(i)) return i;
          const { default: n } = await s.e(4151).then(s.bind(s, 24151)),
            o = new n({
              geometryType: t.geometryType,
              hasM: !1,
              hasZ: !1,
              timeInfo: t.timeInfo,
              fieldsIndex: new u.Z(t.fields),
            });
          return (this._filters[e] = o), o;
        }
        isVisible(e) {
          return !!(2 & this._getBlock(0).getData(e, 0));
        }
        getFilterFlags(e) {
          let t = 0;
          const s = ((i = e.getDisplayId()), 1 === q(i) ? 254 : 255);
          var i;
          for (let i = 0; i < this._filters.length; i++) {
            const n = !!(s & (1 << i)),
              o = this._filters[i];
            t |= (!n || (0, r.b)(o) || o.check(e) ? 1 : 0) << i;
          }
          let n = 0;
          if (this._idsToHighlight.size) {
            const t = e.getObjectId();
            n = this.getHighlightFlag(t);
          }
          return (t << 1) | n;
        }
      }
      class V {
        constructor() {
          (this._freeIds = []), (this._idCounter = 1);
        }
        createId(e = !1) {
          return (function (e, t) {
            return ((t ? 2147483648 : 0) | e) >>> 0;
          })(this._getFreeId(), e);
        }
        releaseId(e) {
          this._freeIds.push(e);
        }
        _getFreeId() {
          return this._freeIds.length ? this._freeIds.pop() : this._idCounter++;
        }
      }
      function H(e, t, s) {
        if (!(e.length > t)) for (; e.length <= t; ) e.push(s);
      }
      class Z {
        constructor() {
          (this._numerics = []),
            (this._strings = []),
            (this._idGenerator = new V()),
            (this._allocatedSize = 256),
            (this._bitsets = []),
            (this._instanceIds = []),
            (this._bounds = []);
        }
        createBitset() {
          const e = this._bitsets.length;
          return this._bitsets.push(n.S.create(this._allocatedSize, 2147483647)), e + 1;
        }
        getBitset(e) {
          return this._bitsets[e - 1];
        }
        _expand() {
          this._allocatedSize <<= 1;
          for (const e of this._bitsets) e.resize(this._allocatedSize);
        }
        _ensureNumeric(e, t) {
          this._numerics[e] || (this._numerics[e] = []), H(this._numerics[e], t, 0);
        }
        _ensureInstanceId(e) {
          H(this._instanceIds, e, 0);
        }
        _ensureString(e, t) {
          this._strings[e] || (this._strings[e] = []), H(this._strings[e], t, null);
        }
        createDisplayId(e = !1) {
          const t = this._idGenerator.createId();
          return (
            t > this._allocatedSize && this._expand(),
            ((e, t) => ((t ? 2147483648 : 0) | e) >>> 0)(t, e)
          );
        }
        releaseDisplayId(e) {
          for (const t of this._bitsets) t.unset(e);
          return this._idGenerator.releaseId(2147483647 & e);
        }
        getComputedNumeric(e, t) {
          return this.getComputedNumericAtIndex(2147483647 & e, 0);
        }
        setComputedNumeric(e, t, s) {
          return this.setComputedNumericAtIndex(2147483647 & e, s, 0);
        }
        getComputedString(e, t) {
          return this.getComputedStringAtIndex(2147483647 & e, 0);
        }
        setComputedString(e, t, s) {
          return this.setComputedStringAtIndex(2147483647 & e, 0, s);
        }
        getComputedNumericAtIndex(e, t) {
          const s = 2147483647 & e;
          return this._ensureNumeric(t, s), this._numerics[t][s];
        }
        setComputedNumericAtIndex(e, t, s) {
          const r = 2147483647 & e;
          this._ensureNumeric(t, r), (this._numerics[t][r] = s);
        }
        getInstanceId(e) {
          const t = 2147483647 & e;
          return this._ensureInstanceId(t), this._instanceIds[t];
        }
        setInstanceId(e, t) {
          const s = 2147483647 & e;
          this._ensureInstanceId(s), (this._instanceIds[s] = t);
        }
        getComputedStringAtIndex(e, t) {
          const s = 2147483647 & e;
          return this._ensureString(t, s), this._strings[t][s];
        }
        setComputedStringAtIndex(e, t, s) {
          const r = 2147483647 & e;
          this._ensureString(t, r), (this._strings[t][r] = s);
        }
        getXMin(e) {
          return this._bounds[4 * (2147483647 & e)];
        }
        getYMin(e) {
          return this._bounds[4 * (2147483647 & e) + 1];
        }
        getXMax(e) {
          return this._bounds[4 * (2147483647 & e) + 2];
        }
        getYMax(e) {
          return this._bounds[4 * (2147483647 & e) + 3];
        }
        setBounds(e, t) {
          const s = t.readHydratedGeometry();
          if (!s || !s.coords.length) return !1;
          let r = 1 / 0,
            i = 1 / 0,
            n = -1 / 0,
            o = -1 / 0;
          s.forEachVertex((e, t) => {
            (r = Math.min(r, e)), (i = Math.min(i, t)), (n = Math.max(n, e)), (o = Math.max(o, t));
          });
          const a = 2147483647 & e;
          return (
            H(this._bounds, 4 * a + 4, 0),
            (this._bounds[4 * a] = r),
            (this._bounds[4 * a + 1] = i),
            (this._bounds[4 * a + 2] = n),
            (this._bounds[4 * a + 3] = o),
            !0
          );
        }
      }
      class Q {
        constructor(e, t) {
          (this.key = new I.T(0, 0, 0, 0)),
            (this.bounds = (0, b.a)()),
            (this.objectIds = new Set()),
            this.key.set(t);
          const s = e.getLODInfoAt(this.key);
          (this.tileInfoView = e),
            this.tileInfoView.getTileBounds(this.bounds, this.key, !0),
            (this.resolution = s.resolution),
            (this.scale = s.scale),
            (this.level = s.level),
            (this.needsClear = !0);
        }
        get id() {
          return this.key.id;
        }
        get extent() {
          return y.Z.fromBounds(this.bounds, this.tileInfoView.tileInfo.spatialReference);
        }
        get transform() {
          return {
            originPosition: 'upperLeft',
            scale: [this.resolution, this.resolution],
            translate: [this.bounds[0], this.bounds[3]],
          };
        }
        get bbox() {
          const e = this.bounds;
          return { minX: e[0], minY: e[1], maxX: e[2], maxY: e[3] };
        }
        clone() {
          return new Q(this.tileInfoView, this.key);
        }
        createChildTiles() {
          const e = this.key.getChildKeys(),
            t = m.A.acquire();
          for (let s = 0; s < e.length; s++) t[s] = new Q(this.tileInfoView, e[s]);
          return t;
        }
        getQuantizationParameters() {
          return x.Q.fromJSON({
            mode: 'view',
            originPosition: 'upperLeft',
            tolerance: this.resolution,
            extent: {
              xmin: this.bounds[0],
              ymin: this.bounds[1],
              xmax: this.bounds[2],
              ymax: this.bounds[3],
              spatialReference: this.tileInfoView.tileInfo.spatialReference,
            },
          });
        }
      }
      const W = { added: [], removed: [] },
        $ = new Set(),
        J = new I.T(0, 0, 0, 0);
      class K extends f.E {
        constructor(e) {
          super(),
            (this._tiles = new Map()),
            (this._index = v(
              9,
              (0, r.h)('csp-restrictions')
                ? (e) => ({
                    minX: e.bounds[0],
                    minY: e.bounds[1],
                    maxX: e.bounds[2],
                    maxY: e.bounds[3],
                  })
                : ['.bounds[0]', '.bounds[1]', '.bounds[2]', '.bounds[3]'],
            )),
            (this.tiles = []),
            (this.tileScheme = e);
        }
        destroy() {
          this.clear();
        }
        clear() {
          (this.tiles.length = 0), this._tiles.clear(), this._index.clear();
        }
        has(e) {
          return this._tiles.has(e);
        }
        get(e) {
          return this._tiles.get(e);
        }
        boundsIntersections(e) {
          return this._index.search({ minX: e[0], minY: e[1], maxX: e[2], maxY: e[3] });
        }
        updateTiles(e) {
          const t = { added: [], removed: [] };
          for (const s of e.added)
            if (!this.has(s)) {
              const e = new Q(this.tileScheme, s);
              this._tiles.set(s, e), this._index.insert(e), t.added.push(e);
            }
          for (const s of e.removed)
            if (this.has(s)) {
              const e = this.get(s);
              this._tiles.delete(s), this._index.remove(e), t.removed.push(e);
            }
          (this.tiles.length = 0),
            this._tiles.forEach((e) => this.tiles.push(e)),
            (t.added.length || t.removed.length) && this.emit('update', t);
        }
        setViewState(e) {
          const t = this.tileScheme.getTileCoverage(e, 0);
          if (!t) return;
          const { spans: s, lodInfo: r } = t,
            { level: i } = r;
          if (s.length > 0)
            for (const { row: e, colFrom: t, colTo: n } of s)
              for (let s = t; s <= n; s++) {
                const t = J.set(i, e, r.normalizeCol(s), r.getWorldForColumn(s)).id;
                if (($.add(t), !this.has(t))) {
                  const e = new Q(this.tileScheme, t);
                  this._tiles.set(t, e), this._index.insert(e), this.tiles.push(e), W.added.push(e);
                }
              }
          for (let e = this.tiles.length - 1; e >= 0; e--) {
            const t = this.tiles[e];
            $.has(t.id) ||
              (this._tiles.delete(t.id),
              this.tiles.splice(e, 1),
              this._index.remove(t),
              W.removed.push(t));
          }
          (W.added.length || W.removed.length) && this.emit('update', W),
            w.a.pool.release(t),
            $.clear(),
            (W.added.length = 0),
            (W.removed.length = 0);
        }
      }
    },
    55029: (e, t, s) => {
      'use strict';
      s.d(t, { f: () => _, g: () => x, h: () => I, i: () => m, j: () => y, k: () => b });
      var r = s(60991),
        i = s(92143),
        n = (s(82426), s(30752)),
        o = s(91055);
      s(10638);
      class a {
        constructor() {
          (this.color = [0, 0, 0, 0]),
            (this.haloColor = [0, 0, 0, 0]),
            (this.haloSize = 0),
            (this.size = 12),
            (this.angle = 0),
            (this.offsetX = 0),
            (this.offsetY = 0),
            (this.hAnchor = 0),
            (this.vAnchor = 0);
        }
        acquire(e, t, s, r, i, n, o, a, h) {
          (this.color = e),
            (this.haloColor = t),
            (this.haloSize = s),
            (this.size = r),
            (this.angle = i),
            (this.offsetX = n),
            (this.offsetY = o),
            (this.hAnchor = a),
            (this.vAnchor = h);
        }
        release() {
          (this.color[0] = this.color[1] = this.color[2] = this.color[3] = 0),
            (this.haloColor[0] = this.haloColor[1] = this.haloColor[2] = this.haloColor[3] = 0),
            (this.haloSize = 0),
            (this.size = 0),
            (this.angle = 0),
            (this.offsetX = 0),
            (this.offsetY = 0),
            (this.hAnchor = 0),
            (this.vAnchor = 0);
        }
      }
      a.pool = new o.O(a);
      const h = i.L.getLogger('esri.views.2d.engine.webgl.Utils');
      function l(e) {
        const t = {};
        for (const s of e) t[s.name] = s.strideInBytes;
        return t;
      }
      const c = l([{ name: 'geometry', strideInBytes: 36, divisor: 0 }]),
        u = l([{ name: 'geometry', strideInBytes: 36, divisor: 0 }]),
        d = l([{ name: 'geometry', strideInBytes: 12, divisor: 0 }]),
        p = l([{ name: 'geometry', strideInBytes: 40, divisor: 0 }]),
        g = l([{ name: 'geometry', strideInBytes: 36, divisor: 0 }]),
        f = l([{ name: 'geometry', strideInBytes: 36, divisor: 0 }]);
      function _(e, t) {
        switch (e) {
          case n.a.MARKER:
            return c;
          case n.a.FILL:
            return t ? d : u;
          case n.a.LINE:
            return p;
          case n.a.TEXT:
            return g;
          case n.a.LABEL:
            return f;
        }
      }
      function m(e) {
        return 'number' == typeof e;
      }
      function y(e) {
        switch (e) {
          case 'butt':
            return 0;
          case 'round':
            return 1;
          case 'square':
            return 2;
          default:
            return (
              h.error(
                new r.Z(
                  'mapview-invalid-type',
                  `Cap type ${e} is not a valid option. Defaulting to round`,
                ),
              ),
              1
            );
        }
      }
      function b(e) {
        switch (e) {
          case 'miter':
            return 2;
          case 'bevel':
            return 0;
          case 'round':
            return 1;
          default:
            return (
              h.error(
                new r.Z(
                  'mapview-invalid-type',
                  `Join type ${e} is not a valid option. Defaulting to round`,
                ),
              ),
              1
            );
        }
      }
      function x(e) {
        switch (e) {
          case 5121:
            return Uint8Array;
          case 32819:
            return Uint16Array;
          case 5126:
            return Float32Array;
          default:
            return void h.error(new r.Z('webgl-utils', `Unable to handle type ${e}`));
        }
      }
      function I(e) {
        e(n.a.FILL), e(n.a.LINE), e(n.a.MARKER), e(n.a.TEXT), e(n.a.LABEL);
      }
      new Map();
    },
    21132: (e, t, s) => {
      'use strict';
      s.d(t, {
        a: () => m,
        b: () => f,
        c: () => p,
        d: () => c,
        e: () => b,
        f: () => d,
        p: () => u,
        s: () => _,
        t: () => g,
        w: () => y,
      });
      var r = s(76506),
        i = s(32101),
        n = s(38742);
      const o = [
          'MapServer',
          'ImageServer',
          'FeatureServer',
          'SceneServer',
          'StreamServer',
          'VectorTileServer',
        ],
        a = new RegExp(
          `^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join(
            '|',
          )}))(?:\\/(?:layers\\/)?(\\d+))?`,
          'i',
        ),
        h = new RegExp(
          `^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join(
            '|',
          )}))(?:\\/(?:layers\\/)?(\\d+))?`,
          'i',
        ),
        l = /(.*?)\/(?:layers\/)?(\d+)\/?$/i;
      function c(e) {
        return !!a.test(e);
      }
      function u(e) {
        const t = (0, i.mN)(e),
          s = t.path.match(a) || t.path.match(h);
        if (!s) return null;
        const [, r, n, o, l] = s,
          c = n.indexOf('/');
        return {
          title: p(-1 !== c ? n.slice(c + 1) : n),
          serverType: o,
          sublayer: null != l && '' !== l ? parseInt(l, 10) : null,
          url: { path: r },
        };
      }
      function d(e) {
        const t = (0, i.mN)(e).path.match(l);
        return t ? { serviceUrl: t[1], sublayerId: Number(t[2]) } : null;
      }
      function p(e) {
        return (e = e.replace(/\s*[/_]+\s*/g, ' '))[0].toUpperCase() + e.slice(1);
      }
      function g(e, t) {
        const s = [];
        if (e) {
          const t = u(e);
          (0, r.i)(t) && t.title && s.push(t.title);
        }
        if (t) {
          const e = p(t);
          s.push(e);
        }
        if (2 === s.length) {
          if (-1 !== s[0].toLowerCase().indexOf(s[1].toLowerCase())) return s[0];
          if (-1 !== s[1].toLowerCase().indexOf(s[0].toLowerCase())) return s[1];
        }
        return s.join(' - ');
      }
      function f(e) {
        if (!e) return !1;
        const t = -1 !== (e = e.toLowerCase()).indexOf('.arcgis.com/'),
          s =
            -1 !== e.indexOf('//services') ||
            -1 !== e.indexOf('//tiles') ||
            -1 !== e.indexOf('//features');
        return t && s;
      }
      function _(e, t) {
        return e ? (0, i.Qj)((0, i.Hu)(e, t)) : e;
      }
      function m(e) {
        let { url: t } = e;
        if (!t) return { url: t };
        t = (0, i.Hu)(t, e.logger);
        const s = (0, i.mN)(t),
          n = u(s.path);
        let o;
        if ((0, r.i)(n))
          null != n.sublayer && null == e.layer.layerId && (o = n.sublayer), (t = n.url.path);
        else if (e.nonStandardUrlAllowed) {
          const e = d(s.path);
          (0, r.i)(e) && ((t = e.serviceUrl), (o = e.sublayerId));
        }
        return { url: (0, i.Qj)(t), layerId: o };
      }
      function y(e, t, s, r, o) {
        (0, n.w)(t, r, 'url', o),
          r.url && null != e.layerId && (r.url = (0, i.v_)(r.url, s, e.layerId.toString()));
      }
      function b(e) {
        if (!e) return !1;
        const t = e.toLowerCase(),
          s = -1 !== t.indexOf('/services/'),
          r = -1 !== t.indexOf('/mapserver/wmsserver'),
          i = -1 !== t.indexOf('/imageserver/wmsserver'),
          n = -1 !== t.indexOf('/wmsserver');
        return s && (r || i || n);
      }
    },
    82356: (e, t, s) => {
      'use strict';
      s.d(t, {
        A: () => c,
        D: () => f,
        H: () => d,
        M: () => o,
        N: () => r,
        P: () => _,
        S: () => g,
        T: () => p,
        d: () => m,
        k: () => n,
        l: () => u,
        m: () => l,
        s: () => a,
        t: () => i,
        u: () => h,
      });
      const r = 1e-30,
        i = 4294967295,
        n = 512,
        o = 29,
        a = 8,
        h = { metrics: { width: 15, height: 17, left: 0, top: -7, advance: 14 } },
        l = 1,
        c = 2,
        u = 2,
        d = 1,
        p = 1.05,
        g = 2,
        f = 7,
        _ = 500,
        m = 10;
    },
    30752: (e, t, s) => {
      'use strict';
      var r, i, n, o, a, h, l;
      s.d(t, { a: () => r, b: () => a, c: () => h }),
        (function (e) {
          (e[(e.FILL = 0)] = 'FILL'),
            (e[(e.LINE = 1)] = 'LINE'),
            (e[(e.MARKER = 2)] = 'MARKER'),
            (e[(e.TEXT = 3)] = 'TEXT'),
            (e[(e.LABEL = 4)] = 'LABEL');
        })(r || (r = {})),
        (function (e) {
          (e[(e.SUCCEEDED = 0)] = 'SUCCEEDED'),
            (e[(e.FAILED_OUT_OF_MEMORY = 1)] = 'FAILED_OUT_OF_MEMORY');
        })(i || (i = {})),
        (function (e) {
          (e[(e.NONE = 0)] = 'NONE'),
            (e[(e.MAP = 1)] = 'MAP'),
            (e[(e.LABEL = 2)] = 'LABEL'),
            (e[(e.LABEL_ALPHA = 4)] = 'LABEL_ALPHA'),
            (e[(e.HITTEST = 8)] = 'HITTEST'),
            (e[(e.HIGHLIGHT = 16)] = 'HIGHLIGHT'),
            (e[(e.CLIP = 32)] = 'CLIP'),
            (e[(e.DEBUG = 64)] = 'DEBUG'),
            (e[(e.NUM_DRAW_PHASES = 9)] = 'NUM_DRAW_PHASES');
        })(n || (n = {})),
        (function (e) {
          (e[(e.SIZE = 0)] = 'SIZE'),
            (e[(e.COLOR = 1)] = 'COLOR'),
            (e[(e.OPACITY = 2)] = 'OPACITY'),
            (e[(e.ROTATION = 3)] = 'ROTATION');
        })(o || (o = {})),
        (function (e) {
          (e[(e.NONE = 0)] = 'NONE'),
            (e[(e.OPACITY = 1)] = 'OPACITY'),
            (e[(e.COLOR = 2)] = 'COLOR'),
            (e[(e.ROTATION = 4)] = 'ROTATION'),
            (e[(e.SIZE_MINMAX_VALUE = 8)] = 'SIZE_MINMAX_VALUE'),
            (e[(e.SIZE_SCALE_STOPS = 16)] = 'SIZE_SCALE_STOPS'),
            (e[(e.SIZE_FIELD_STOPS = 32)] = 'SIZE_FIELD_STOPS'),
            (e[(e.SIZE_UNIT_VALUE = 64)] = 'SIZE_UNIT_VALUE');
        })(a || (a = {})),
        (function (e) {
          (e[(e.MINMAX_TARGETS_OUTLINE = 128)] = 'MINMAX_TARGETS_OUTLINE'),
            (e[(e.SCALE_TARGETS_OUTLINE = 256)] = 'SCALE_TARGETS_OUTLINE'),
            (e[(e.FIELD_TARGETS_OUTLINE = 512)] = 'FIELD_TARGETS_OUTLINE'),
            (e[(e.UNIT_TARGETS_OUTLINE = 1024)] = 'UNIT_TARGETS_OUTLINE');
        })(h || (h = {})),
        (function (e) {
          (e[(e.SPRITE = 0)] = 'SPRITE'), (e[(e.GLYPH = 1)] = 'GLYPH');
        })(l || (l = {}));
    },
    33957: (e, t, s) => {
      'use strict';
      function r(e, t) {
        return (65535 & e) | (t << 16);
      }
      function i(e, t, s, r) {
        return (255 & e) | ((255 & t) << 8) | ((255 & s) << 16) | (r << 24);
      }
      s.d(t, { a: () => i, i: () => r });
    },
    11385: (e, t, s) => {
      'use strict';
      s.d(t, { P: () => a });
      var r = s(76506),
        i = s(91055);
      const n = (0, r.h)('esri-text-decoder') ? new TextDecoder('utf-8') : null,
        o = (0, r.h)('safari') || (0, r.h)('ios') ? 6 : (0, r.h)('ff') ? 12 : 32;
      class a {
        constructor(e, t, s = 0, r = e ? e.byteLength : 0) {
          (this._tag = 0), (this._dataType = 99), this.init(e, t, s, r);
        }
        init(e, t, s, r) {
          (this._data = e), (this._dataView = t), (this._pos = s), (this._end = r);
        }
        clone() {
          return new a(this._data, this._dataView, this._pos, this._end);
        }
        pos() {
          return this._pos;
        }
        move(e) {
          this._pos = e;
        }
        nextTag(e) {
          for (;;) {
            if (this._pos === this._end) return !1;
            const t = this._decodeVarint();
            if (((this._tag = t >> 3), (this._dataType = 7 & t), !e || e === this._tag)) break;
            this.skip();
          }
          return !0;
        }
        next() {
          if (this._pos === this._end) return !1;
          const e = this._decodeVarint();
          return (this._tag = e >> 3), (this._dataType = 7 & e), !0;
        }
        empty() {
          return this._pos >= this._end;
        }
        tag() {
          return this._tag;
        }
        getInt32() {
          return this._decodeVarint();
        }
        getInt64() {
          return this._decodeVarint();
        }
        getUInt32() {
          let e = 4294967295;
          return (
            (e = (127 & this._data[this._pos]) >>> 0),
            this._data[this._pos++] < 128
              ? e
              : ((e = (e | ((127 & this._data[this._pos]) << 7)) >>> 0),
                this._data[this._pos++] < 128
                  ? e
                  : ((e = (e | ((127 & this._data[this._pos]) << 14)) >>> 0),
                    this._data[this._pos++] < 128
                      ? e
                      : ((e = (e | ((127 & this._data[this._pos]) << 21)) >>> 0),
                        this._data[this._pos++] < 128
                          ? e
                          : ((e = (e | ((15 & this._data[this._pos]) << 28)) >>> 0),
                            this._data[this._pos++] < 128 ? e : void 0))))
          );
        }
        getUInt64() {
          return this._decodeVarint();
        }
        getSInt32() {
          const e = this.getUInt32();
          return ((e >>> 1) ^ -(1 & e)) | 0;
        }
        getSInt64() {
          return this._decodeSVarint();
        }
        getBool() {
          const e = 0 !== this._data[this._pos];
          return this._skip(1), e;
        }
        getEnum() {
          return this._decodeVarint();
        }
        getFixed64() {
          const e = this._dataView,
            t = this._pos,
            s = e.getUint32(t, !0) + 4294967296 * e.getUint32(t + 4, !0);
          return this._skip(8), s;
        }
        getSFixed64() {
          const e = this._dataView,
            t = this._pos,
            s = e.getUint32(t, !0) + 4294967296 * e.getInt32(t + 4, !0);
          return this._skip(8), s;
        }
        getDouble() {
          const e = this._dataView.getFloat64(this._pos, !0);
          return this._skip(8), e;
        }
        getFixed32() {
          const e = this._dataView.getUint32(this._pos, !0);
          return this._skip(4), e;
        }
        getSFixed32() {
          const e = this._dataView.getInt32(this._pos, !0);
          return this._skip(4), e;
        }
        getFloat() {
          const e = this._dataView.getFloat32(this._pos, !0);
          return this._skip(4), e;
        }
        getString() {
          const e = this._getLength(),
            t = this._pos,
            s = this._toString(this._data, t, t + e);
          return this._skip(e), s;
        }
        getBytes() {
          const e = this._getLength(),
            t = this._pos,
            s = this._toBytes(this._data, t, t + e);
          return this._skip(e), s;
        }
        getLength() {
          return this._getLengthUnsafe();
        }
        processMessageWithArgs(e, t, s, r) {
          const i = this.getMessage(),
            n = e(i, t, s, r);
          return i.release(), n;
        }
        processMessage(e) {
          const t = this.getMessage(),
            s = e(t);
          return t.release(), s;
        }
        getMessage() {
          const e = this._getLength(),
            t = a.pool.acquire();
          return t.init(this._data, this._dataView, this._pos, this._pos + e), this._skip(e), t;
        }
        release() {
          a.pool.release(this);
        }
        dataType() {
          return this._dataType;
        }
        skip() {
          switch (this._dataType) {
            case 0:
              this._decodeVarint();
              break;
            case 1:
              this._skip(8);
              break;
            case 2:
              this._skip(this._getLength());
              break;
            case 5:
              this._skip(4);
              break;
            default:
              throw new Error('Invalid data type!');
          }
        }
        skipLen(e) {
          this._skip(e);
        }
        _skip(e) {
          if (this._pos + e > this._end) throw new Error('Attempt to skip past the end of buffer!');
          this._pos += e;
        }
        _decodeVarint() {
          const e = this._data;
          let t,
            s = this._pos,
            r = 0;
          if (this._end - s >= 10)
            do {
              if (((t = e[s++]), (r |= 127 & t), 0 == (128 & t))) break;
              if (((t = e[s++]), (r |= (127 & t) << 7), 0 == (128 & t))) break;
              if (((t = e[s++]), (r |= (127 & t) << 14), 0 == (128 & t))) break;
              if (((t = e[s++]), (r |= (127 & t) << 21), 0 == (128 & t))) break;
              if (((t = e[s++]), (r += 268435456 * (127 & t)), 0 == (128 & t))) break;
              if (((t = e[s++]), (r += 34359738368 * (127 & t)), 0 == (128 & t))) break;
              if (((t = e[s++]), (r += 4398046511104 * (127 & t)), 0 == (128 & t))) break;
              if (((t = e[s++]), (r += 562949953421312 * (127 & t)), 0 == (128 & t))) break;
              if (((t = e[s++]), (r += 72057594037927940 * (127 & t)), 0 == (128 & t))) break;
              if (((t = e[s++]), (r += 0x8000000000000000 * (127 & t)), 0 == (128 & t))) break;
              throw new Error('Varint too long!');
            } while (0);
          else {
            let i = 1;
            for (; s !== this._end && ((t = e[s]), 0 != (128 & t)); )
              ++s, (r += (127 & t) * i), (i *= 128);
            if (s === this._end) throw new Error('Varint overrun!');
            ++s, (r += t * i);
          }
          return (this._pos = s), r;
        }
        _decodeSVarint() {
          const e = this._decodeVarint();
          return e % 2 ? -(e + 1) / 2 : e / 2;
        }
        _getLength() {
          if (2 !== this._dataType) throw new Error('Not a delimited data type!');
          return this._decodeVarint();
        }
        _getLengthUnsafe() {
          return this.getUInt32();
        }
        _toString(e, t, s) {
          if ((s = Math.min(this._end, s)) - t > o && n) {
            const r = e.subarray(t, s);
            return n.decode(r);
          }
          let r = '',
            i = '';
          for (let n = t; n < s; ++n) {
            const t = e[n];
            128 & t
              ? (i += '%' + t.toString(16))
              : ((r += decodeURIComponent(i) + String.fromCharCode(t)), (i = ''));
          }
          return i.length && (r += decodeURIComponent(i)), r;
        }
        _toBytes(e, t, s) {
          return (s = Math.min(this._end, s)), new Uint8Array(e.buffer, t, s - t);
        }
      }
      a.pool = new i.O(a, null, (e) => {
        (e._data = null), (e._dataView = null);
      });
    },
    76733: (e, t, s) => {
      'use strict';
      s.d(t, { O: () => u, a: () => k, b: () => f, p: () => O });
      var r = s(60991),
        i = s(76506),
        n = s(11385),
        o = s(85674),
        a = s(53785),
        h = s(60947),
        l = s(9006);
      const c = [
        'esriGeometryPoint',
        'esriGeometryMultipoint',
        'esriGeometryPolyline',
        'esriGeometryPolygon',
      ];
      class u {
        constructor(e) {
          (this.options = e),
            (this.geometryTypes = c),
            (this._coordinatePtr = 0),
            (this._vertexDimension = 0);
        }
        createFeatureResult() {
          return new l.O();
        }
        prepareFeatures(e) {
          (this._vertexDimension = 2),
            e.hasZ && this._vertexDimension++,
            e.hasM && this._vertexDimension++;
        }
        finishFeatureResult(e) {
          if (
            !e ||
            !e.features ||
            !e.hasZ ||
            !this.options.sourceSpatialReference ||
            !e.spatialReference ||
            (0, h.e)(e.spatialReference, this.options.sourceSpatialReference) ||
            e.spatialReference.vcsWkid
          )
            return;
          const t = (0, a.d)(this.options.sourceSpatialReference) / (0, a.d)(e.spatialReference);
          if (1 !== t)
            for (const s of e.features) {
              if (!s.geometry || !s.geometry.coords) continue;
              const e = s.geometry.coords;
              for (let s = 2; s < e.length; s += 3) e[s] *= t;
            }
        }
        addFeature(e, t) {
          e.features.push(t);
        }
        createFeature() {
          return new o.O();
        }
        createSpatialReference() {
          return { wkid: 0 };
        }
        createGeometry() {
          return new o.a();
        }
        addField(e, t) {
          e.fields.push(t);
        }
        allocateCoordinates(e) {
          (e.coords.length = e.lengths.reduce((e, t) => e + t, 0) * this._vertexDimension),
            (this._coordinatePtr = 0);
        }
        addCoordinate(e, t) {
          e.coords[this._coordinatePtr++] = t;
        }
        addCoordinatePoint(e, t) {
          e.coords.push(t);
        }
        addLength(e, t) {
          e.lengths.push(t);
        }
        addQueryGeometry(e, t) {
          (e.queryGeometry = t.queryGeometry), (e.queryGeometryType = t.queryGeometryType);
        }
        createPointGeometry() {
          return new o.a();
        }
      }
      const d = [
          'esriFieldTypeSmallInteger',
          'esriFieldTypeInteger',
          'esriFieldTypeSingle',
          'esriFieldTypeDouble',
          'esriFieldTypeString',
          'esriFieldTypeDate',
          'esriFieldTypeOID',
          'esriFieldTypeGeometry',
          'esriFieldTypeBlob',
          'esriFieldTypeRaster',
          'esriFieldTypeGUID',
          'esriFieldTypeGlobalID',
          'esriFieldTypeXML',
        ],
        p = [
          'sqlTypeBigInt',
          'sqlTypeBinary',
          'sqlTypeBit',
          'sqlTypeChar',
          'sqlTypeDate',
          'sqlTypeDecimal',
          'sqlTypeDouble',
          'sqlTypeFloat',
          'sqlTypeGeometry',
          'sqlTypeGUID',
          'sqlTypeInteger',
          'sqlTypeLongNVarchar',
          'sqlTypeLongVarbinary',
          'sqlTypeLongVarchar',
          'sqlTypeNChar',
          'sqlTypeNVarchar',
          'sqlTypeOther',
          'sqlTypeReal',
          'sqlTypeSmallInt',
          'sqlTypeSqlXml',
          'sqlTypeTime',
          'sqlTypeTimestamp',
          'sqlTypeTimestamp2',
          'sqlTypeTinyInt',
          'sqlTypeVarbinary',
          'sqlTypeVarchar',
        ],
        g = ['upperLeft', 'lowerLeft'];
      function f(e) {
        return e >= d.length ? null : d[e];
      }
      function _(e) {
        return e >= g.length ? null : g[e];
      }
      function m(e, t) {
        return t >= e.geometryTypes.length ? null : e.geometryTypes[t];
      }
      function y(e, t, s) {
        const r = t.createPointGeometry(s);
        for (; e.next(); )
          switch (e.tag()) {
            case 3: {
              const s = e.getUInt32(),
                i = e.pos() + s;
              let n = 0;
              for (; e.pos() < i; ) t.addCoordinatePoint(r, e.getSInt64(), n++);
              break;
            }
            case 1:
            case 2:
            default:
              e.skip();
          }
        return r;
      }
      function b(e, t, s) {
        const r = t.createGeometry(s),
          i = 2 + (s.hasZ ? 1 : 0) + (s.hasM ? 1 : 0);
        for (; e.next(); )
          switch (e.tag()) {
            case 2: {
              const s = e.getUInt32(),
                i = e.pos() + s;
              let n = 0;
              for (; e.pos() < i; ) t.addLength(r, e.getUInt32(), n++);
              break;
            }
            case 3: {
              const s = e.getUInt32(),
                n = e.pos() + s;
              let o = 0;
              for (t.allocateCoordinates(r); e.pos() < n; )
                t.addCoordinate(r, e.getSInt64(), o), o++, o === i && (o = 0);
              break;
            }
            case 1:
            default:
              e.skip();
          }
        return r;
      }
      function x(e) {
        const t = new o.a();
        let s = 'esriGeometryPoint';
        for (; e.next(); )
          switch (e.tag()) {
            case 2: {
              const s = e.getUInt32(),
                r = e.pos() + s;
              for (; e.pos() < r; ) t.lengths.push(e.getUInt32());
              break;
            }
            case 3: {
              const s = e.getUInt32(),
                r = e.pos() + s;
              for (; e.pos() < r; ) t.coords.push(e.getSInt64());
              break;
            }
            case 1:
              s = c[e.getEnum()];
              break;
            default:
              e.skip();
          }
        return { queryGeometry: t, queryGeometryType: s };
      }
      function I(e) {
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              return e.getString();
            case 2:
              return e.getFloat();
            case 3:
              return e.getDouble();
            case 4:
              return e.getSInt32();
            case 5:
              return e.getUInt32();
            case 6:
              return e.getInt64();
            case 7:
              return e.getUInt64();
            case 8:
              return e.getSInt64();
            case 9:
              return e.getBool();
            default:
              return e.skip(), null;
          }
        return null;
      }
      function w(e) {
        const t = { type: f(0) };
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t.name = e.getString();
              break;
            case 2:
              t.type = f(e.getEnum());
              break;
            case 3:
              t.alias = e.getString();
              break;
            case 4:
              t.sqlType = (s = e.getEnum()) >= p.length ? null : p[s];
              break;
            case 5:
              e.skip();
              break;
            case 6:
              t.defaultValue = e.getString();
              break;
            default:
              e.skip();
          }
        var s;
        return t;
      }
      function v(e) {
        const t = {};
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t.name = e.getString();
              break;
            case 2:
              t.isSystemMaintained = e.getBool();
              break;
            default:
              e.skip();
          }
        return t;
      }
      function S(e, t, s, r) {
        const i = t.createFeature(s);
        let n = 0;
        for (; e.next(); )
          switch (e.tag()) {
            case 1: {
              const t = r[n++].name;
              i.attributes[t] = e.processMessage(I);
              break;
            }
            case 2:
              i.geometry = e.processMessageWithArgs(b, t, s);
              break;
            case 4:
              i.centroid = e.processMessageWithArgs(y, t, s);
              break;
            default:
              e.skip();
          }
        return i;
      }
      function T(e) {
        const t = [1, 1, 1, 1];
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t[0] = e.getDouble();
              break;
            case 2:
              t[1] = e.getDouble();
              break;
            case 4:
              t[2] = e.getDouble();
              break;
            case 3:
              t[3] = e.getDouble();
              break;
            default:
              e.skip();
          }
        return t;
      }
      function F(e) {
        const t = [0, 0, 0, 0];
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t[0] = e.getDouble();
              break;
            case 2:
              t[1] = e.getDouble();
              break;
            case 4:
              t[2] = e.getDouble();
              break;
            case 3:
              t[3] = e.getDouble();
              break;
            default:
              e.skip();
          }
        return t;
      }
      function k(e) {
        const t = { originPosition: _(0) };
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t.originPosition = _(e.getEnum());
              break;
            case 2:
              t.scale = e.processMessage(T);
              break;
            case 3:
              t.translate = e.processMessage(F);
              break;
            default:
              e.skip();
          }
        return t;
      }
      function E(e) {
        const t = {};
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              t.shapeAreaFieldName = e.getString();
              break;
            case 2:
              t.shapeLengthFieldName = e.getString();
              break;
            case 3:
              t.units = e.getString();
              break;
            default:
              e.skip();
          }
        return t;
      }
      function C(e, t) {
        const s = t.createSpatialReference();
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              s.wkid = e.getUInt32();
              break;
            case 5:
              s.wkt = e.getString();
              break;
            case 2:
              s.latestWkid = e.getUInt32();
              break;
            case 3:
              s.vcsWkid = e.getUInt32();
              break;
            case 4:
              s.latestVcsWkid = e.getUInt32();
              break;
            default:
              e.skip();
          }
        return s;
      }
      function M(e, t) {
        const s = t.createFeatureResult();
        s.geometryType = m(t, 0);
        let r = !1;
        for (; e.next(); )
          switch (e.tag()) {
            case 1:
              s.objectIdFieldName = e.getString();
              break;
            case 3:
              s.globalIdFieldName = e.getString();
              break;
            case 4:
              s.geohashFieldName = e.getString();
              break;
            case 5:
              s.geometryProperties = e.processMessage(E);
              break;
            case 7:
              s.geometryType = m(t, e.getEnum());
              break;
            case 8:
              s.spatialReference = e.processMessageWithArgs(C, t);
              break;
            case 10:
              s.hasZ = e.getBool();
              break;
            case 11:
              s.hasM = e.getBool();
              break;
            case 12:
              s.transform = e.processMessage(k);
              break;
            case 9: {
              const t = e.getBool();
              s.exceededTransferLimit = t;
              break;
            }
            case 13:
              t.addField(s, e.processMessage(w));
              break;
            case 15:
              r || (t.prepareFeatures(s), (r = !0)),
                t.addFeature(s, e.processMessageWithArgs(S, t, s, s.fields));
              break;
            case 2:
              s.uniqueIdField = e.processMessage(v);
              break;
            case 6:
            default:
              e.skip();
          }
        return t.finishFeatureResult(s), s;
      }
      function A(e, t) {
        const s = {};
        let r = null;
        for (; e.next(); )
          switch (e.tag()) {
            case 4:
              r = e.processMessageWithArgs(x);
              break;
            case 1:
              s.featureResult = e.processMessageWithArgs(M, t);
              break;
            case 2:
            case 3:
            default:
              e.skip();
          }
        return (0, i.i)(r) && s.featureResult && t.addQueryGeometry(s, r), s;
      }
      function O(e, t) {
        const s = (function (e, t) {
            try {
              const s = 2,
                r = new n.P(new Uint8Array(e), new DataView(e)),
                i = {};
              for (; r.next(); )
                switch (r.tag()) {
                  case s:
                    i.queryResult = r.processMessageWithArgs(A, t);
                    break;
                  default:
                    r.skip();
                }
              return i;
            } catch (e) {
              throw new r.Z('query:parsing-pbf', 'Error while parsing FeatureSet PBF payload', {
                error: e,
              });
            }
          })(e, t),
          i = s.queryResult.featureResult,
          o = s.queryResult.queryGeometry,
          a = s.queryResult.queryGeometryType;
        if (i && i.features && i.features.length && i.objectIdFieldName) {
          const e = i.objectIdFieldName;
          for (const t of i.features) t.attributes && (t.objectId = t.attributes[e]);
        }
        return i && ((i.queryGeometry = o), (i.queryGeometryType = a)), i;
      }
    },
    49214: (e, t, s) => {
      'use strict';
      s.r(t),
        s.d(t, {
          a: () => m,
          b: () => f,
          c: () => d,
          d: () => p,
          e: () => _,
          f: () => g,
          m: () => c,
          q: () => b,
          r: () => y,
        });
      var r = s(82058),
        i = s(76506),
        n = s(32101),
        o = s(32422),
        a = s(95533),
        h = s(76733),
        l = s(55823);
      function c(e) {
        const t = {};
        for (const s in e) {
          if ('declaredClass' === s) continue;
          const r = e[s];
          if (null != r && 'function' != typeof r)
            if (Array.isArray(r)) {
              t[s] = [];
              for (let e = 0; e < r.length; e++) t[s][e] = c(r[e]);
            } else 'object' == typeof r ? r.toJSON && (t[s] = JSON.stringify(r)) : (t[s] = r);
        }
        return t;
      }
      function u(e, t) {
        const s = e.geometry,
          r = e.toJSON(),
          n = r;
        if (
          ((0, i.i)(s) &&
            ((n.geometry = JSON.stringify(s)),
            (n.geometryType = (0, o.Ji)(s)),
            (n.inSR = s.spatialReference.wkid || JSON.stringify(s.spatialReference))),
          r.groupByFieldsForStatistics &&
            (n.groupByFieldsForStatistics = r.groupByFieldsForStatistics.join(',')),
          r.objectIds && (n.objectIds = r.objectIds.join(',')),
          r.orderByFields && (n.orderByFields = r.orderByFields.join(',')),
          !r.outFields ||
          (!r.returnDistinctValues &&
            ((null != t && t.returnCountOnly) ||
              (null != t && t.returnExtentOnly) ||
              (null != t && t.returnIdsOnly)))
            ? delete n.outFields
            : -1 !== r.outFields.indexOf('*')
            ? (n.outFields = '*')
            : (n.outFields = r.outFields.join(',')),
          r.outSR
            ? (n.outSR = r.outSR.wkid || JSON.stringify(r.outSR))
            : s && (r.returnGeometry || r.returnCentroid) && (n.outSR = n.inSR),
          r.returnGeometry && delete r.returnGeometry,
          r.outStatistics && (n.outStatistics = JSON.stringify(r.outStatistics)),
          r.pixelSize && (n.pixelSize = JSON.stringify(r.pixelSize)),
          r.quantizationParameters &&
            (n.quantizationParameters = JSON.stringify(r.quantizationParameters)),
          r.parameterValues && (n.parameterValues = JSON.stringify(r.parameterValues)),
          r.rangeValues && (n.rangeValues = JSON.stringify(r.rangeValues)),
          r.dynamicDataSource &&
            ((n.layer = JSON.stringify({ source: r.dynamicDataSource })),
            delete r.dynamicDataSource),
          r.timeExtent)
        ) {
          const e = r.timeExtent,
            { start: t, end: s } = e;
          (null == t && null == s) ||
            (n.time = t === s ? t : `${null == t ? 'null' : t},${null == s ? 'null' : s}`),
            delete r.timeExtent;
        }
        return n;
      }
      async function d(e, t, s, r) {
        const n =
          (0, i.i)(t.timeExtent) && t.timeExtent.isEmpty
            ? { data: { features: [] } }
            : await y(e, t, 'json', r);
        return (0, l.a)(t, s, n.data), n;
      }
      async function p(e, t, s, r) {
        if ((0, i.i)(t.timeExtent) && t.timeExtent.isEmpty)
          return Promise.resolve({ data: s.createFeatureResult() });
        const n = await g(e, t, r),
          o = n;
        return (o.data = (0, h.p)(n.data, s)), o;
      }
      function g(e, t, s) {
        return y(e, t, 'pbf', s);
      }
      function f(e, t, s) {
        return (0, i.i)(t.timeExtent) && t.timeExtent.isEmpty
          ? Promise.resolve({ data: { objectIds: [] } })
          : y(e, t, 'json', s, { returnIdsOnly: !0 });
      }
      function _(e, t, s) {
        return (0, i.i)(t.timeExtent) && t.timeExtent.isEmpty
          ? Promise.resolve({ data: { count: 0 } })
          : y(e, t, 'json', s, { returnIdsOnly: !0, returnCountOnly: !0 });
      }
      function m(e, t, s) {
        return (0, i.i)(t.timeExtent) && t.timeExtent.isEmpty
          ? Promise.resolve({ data: { count: 0, extent: null } })
          : y(e, t, 'json', s, { returnExtentOnly: !0, returnCountOnly: !0 }).then((e) => {
              const t = e.data;
              if (t.hasOwnProperty('extent')) return e;
              if (t.features) throw new Error('Layer does not support extent calculation.');
              if (t.hasOwnProperty('count'))
                throw new Error('Layer does not support extent calculation.');
              return e;
            });
      }
      function y(e, t, s, o = {}, h = {}) {
        const l = 'string' == typeof e ? (0, n.mN)(e) : e,
          d = t.geometry ? [t.geometry] : [];
        return (
          (o.responseType = 'pbf' === s ? 'array-buffer' : 'json'),
          (0, a.aX)(d, null, o).then((e) => {
            const a = e && e[0];
            (0, i.i)(a) && ((t = t.clone()).geometry = a);
            const d = c({ ...l.query, f: s, ...h, ...u(t, h) });
            return (0, r.default)((0, n.v_)(l.path, 'query'), {
              ...o,
              query: { ...d, ...o.query },
            });
          })
        );
      }
      var b = Object.freeze({
        __proto__: null,
        queryToQueryStringParameters: u,
        executeQuery: d,
        executeQueryPBF: p,
        executeQueryPBFBuffer: g,
        executeQueryForIds: f,
        executeQueryForCount: _,
        executeQueryForExtent: m,
        runQuery: y,
      });
    },
    55823: (e, t, s) => {
      'use strict';
      s.d(t, { a: () => i });
      var r = s(92847);
      function i(e, t, s) {
        if (!s || !s.features || !s.hasZ) return;
        const i = (0, r.g)(s.geometryType, t, e.outSpatialReference);
        if (i) for (const e of s.features) i(e.geometry);
      }
    },
    86929: (e, t, s) => {
      'use strict';
      s.d(t, { D: () => a, a: () => i, c: () => o, g: () => h, p: () => n }), s(76506);
      var r = s(33957);
      function i(e) {
        if (!e) return 0;
        const { r: t, g: s, b: i, a: n } = e;
        return (0, r.a)(t * n, s * n, i * n, 255 * n);
      }
      function n(e) {
        if (!e) return 0;
        const [t, s, i, n] = e;
        return (0, r.a)(t * (n / 255), s * (n / 255), i * (n / 255), n);
      }
      s(82356), s(30752), s(98788);
      const o = (e, t) => (e && ((...e) => t.warn('DEBUG:', ...e))) || (() => null),
        a = !1;
      function h(e, t) {
        if (!e || !t) return e;
        switch (t) {
          case 'radius':
          case 'distance':
            return 2 * e;
          case 'diameter':
          case 'width':
            return e;
          case 'area':
            return Math.sqrt(e);
        }
        return e;
      }
    },
    98788: (e, t, s) => {
      'use strict';
      s.d(t, { g: () => h });
      var r = s(60991),
        i = s(92143),
        n = s(30752),
        o = s(55029);
      const a = i.L.getLogger('esri.views.2d.engine.webgl');
      function h(e) {
        return (0, o.i)(e.minDataValue) &&
          (0, o.i)(e.maxDataValue) &&
          null != e.minSize &&
          null != e.maxSize
          ? n.b.SIZE_MINMAX_VALUE
          : ((e.expression && 'view.scale' === e.expression) ||
              (e.valueExpression && '$view.scale' === e.valueExpression)) &&
            Array.isArray(e.stops)
          ? n.b.SIZE_SCALE_STOPS
          : (null != e.field ||
              (e.expression && 'view.scale' !== e.expression) ||
              (e.valueExpression && '$view.scale' !== e.valueExpression)) &&
            (Array.isArray(e.stops) || ('levels' in e && e.levels))
          ? n.b.SIZE_FIELD_STOPS
          : (null != e.field ||
              (e.expression && 'view.scale' !== e.expression) ||
              (e.valueExpression && '$view.scale' !== e.valueExpression)) &&
            null != e.valueUnit
          ? n.b.SIZE_UNIT_VALUE
          : (a.error(new r.Z('mapview-bad-type', 'Found invalid size VisualVariable', e)),
            n.b.NONE);
      }
    },
    92847: (e, t, s) => {
      'use strict';
      s.d(t, { g: () => o, u: () => h });
      var r = s(76506),
        i = s(53785),
        n = s(60947);
      function o(e, t, s) {
        if ((0, r.b)(t) || (0, r.b)(s) || s.vcsWkid || (0, n.e)(t, s)) return null;
        const o = (0, i.d)(t) / (0, i.d)(s);
        if (1 === o) return null;
        switch (e) {
          case 'point':
          case 'esriGeometryPoint':
            return (e) => {
              return (s = o), void ((t = e) && null != t.z && (t.z *= s));
              var t, s;
            };
          case 'polyline':
          case 'esriGeometryPolyline':
            return (e) =>
              (function (e, t) {
                if (e) for (const s of e.paths) for (const e of s) e.length > 2 && (e[2] *= t);
              })(e, o);
          case 'polygon':
          case 'esriGeometryPolygon':
            return (e) =>
              (function (e, t) {
                if (e) for (const s of e.rings) for (const e of s) e.length > 2 && (e[2] *= t);
              })(e, o);
          case 'multipoint':
          case 'esriGeometryMultipoint':
            return (e) =>
              (function (e, t) {
                if (e) for (const s of e.points) s.length > 2 && (s[2] *= t);
              })(e, o);
          default:
            return null;
        }
      }
      function a(e, t, s) {
        if (null == e.hasM || e.hasZ)
          for (const e of t) for (const t of e) t.length > 2 && (t[2] *= s);
      }
      function h(e, t, s) {
        if ((!e && !t) || !s) return;
        const r = (0, i.d)(s);
        l(e, s, r), l(t, s, r);
      }
      function l(e, t, s) {
        if (e) for (const r of e) c(r.geometry, t, s);
      }
      function c(e, t, s) {
        if (!e || !e.spatialReference || (0, n.e)(e.spatialReference, t)) return;
        const r = (0, i.d)(e.spatialReference) / s;
        if (1 !== r)
          if ('x' in e) null != e.z && (e.z *= r);
          else if ('rings' in e) a(e, e.rings, r);
          else if ('paths' in e) a(e, e.paths, r);
          else if ('points' in e && (null == e.hasM || e.hasZ))
            for (const t of e.points) t.length > 2 && (t[2] *= r);
      }
    },
    95873: (e, t, s) => {
      'use strict';
      s.d(t, { r: () => g, p: () => p, W: () => u });
      var r = s(29768),
        i = s(21972),
        n = s(82933),
        o = s(34250),
        a = s(17533),
        h = s(76506),
        l = s(6906),
        c = s(617);
      s(23639),
        s(92143),
        s(31450),
        s(71552),
        s(40642),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(91306),
        s(81172),
        s(50406),
        s(60991),
        s(15324),
        s(76996);
      let u = class extends i.Z {
        constructor() {
          super(...arguments),
            (this.updating = !1),
            (this.handleId = 0),
            (this.handles = new n.Z()),
            (this.scheduleHandleId = 0),
            (this.pendingPromises = new Set());
        }
        destroy() {
          this.removeAll(), this.handles.destroy();
        }
        add(e, t, s, r = 0) {
          const i = 0 != (1 & r),
            n = ++this.handleId;
          i || this.installSyncUpdatingWatch(e, t, n);
          const o = 0 != (2 & r) ? (0, c.S1)(e, t, s, i) : e.watch(t, s, i);
          return this.handles.add(o, n), { remove: () => this.handles.remove(n) };
        }
        addOnCollectionPropertyChange(e, t, s, r = 0) {
          const i = 0 != (2 & r),
            n = ++this.handleId;
          return (
            this.handles.add(
              [
                (0, c.on)(e, t, 'after-changes', this.createSyncUpdatingCallback()),
                (0, c.on)(
                  e,
                  t,
                  'change',
                  s,
                  i
                    ? (e) => {
                        s({ added: e.items, removed: [], moved: [], target: e });
                      }
                    : void 0,
                ),
              ],
              n,
            ),
            {
              remove: () => {
                this.handles.remove(n);
              },
            }
          );
        }
        addOnCollectionChange(e, t, s = 0) {
          const r = 0 != (2 & s),
            i = ++this.handleId;
          return (
            this.handles.add(
              [e.on('after-changes', this.createSyncUpdatingCallback()), e.on('change', t)],
              i,
            ),
            r && t({ added: e.items, removed: [], moved: [], target: e }),
            {
              remove: () => {
                this.handles.remove(i);
              },
            }
          );
        }
        addPromise(e) {
          if ((0, h.b)(e)) return e;
          const t = ++this.handleId;
          this.handles.add(
            {
              remove: () => {
                this.pendingPromises.delete(e) &&
                  (0 !== this.pendingPromises.size ||
                    this.handles.has(d) ||
                    this._set('updating', !1));
              },
            },
            t,
          ),
            this.pendingPromises.add(e),
            this._set('updating', !0);
          const s = () => this.handles.remove(t);
          return e.then(s, s), e;
        }
        removeAll() {
          this.pendingPromises.clear(), this.handles.removeAll(), this._set('updating', !1);
        }
        installSyncUpdatingWatch(e, t, s) {
          const r = this.createSyncUpdatingCallback(),
            n = (0, i.r)(() => (0, o.v)(e, t), r);
          return this.handles.add(n, s), n;
        }
        createSyncUpdatingCallback() {
          return () => {
            this.handles.remove(d), ++this.scheduleHandleId;
            const e = this.scheduleHandleId;
            this._get('updating') || this._set('updating', !0),
              this.handles.add(
                (0, l.Os)(() => {
                  e === this.scheduleHandleId &&
                    (this._set('updating', this.pendingPromises.size > 0), this.handles.remove(d));
                }),
                d,
              );
          };
        }
      };
      (0, r._)([(0, o.Cb)({ readOnly: !0 })], u.prototype, 'updating', void 0),
        (u = (0, r._)([(0, a.j)('esri.views.support.WatchUpdatingTracking')], u));
      const d = -42,
        p = (e) => {
          let t = class extends e {
            destroy() {
              this.destroyed || (this.handles.destroy(), this.updatingHandles.destroy());
            }
            get handles() {
              return this._get('handles') || new n.Z();
            }
            get updatingHandles() {
              return this._get('updatingHandles') || new u();
            }
          };
          return (
            (0, r._)([(0, o.Cb)({ readOnly: !0 })], t.prototype, 'handles', null),
            (0, r._)([(0, o.Cb)({ readOnly: !0 })], t.prototype, 'updatingHandles', null),
            (t = (0, r._)([(0, a.j)('esri.core.HandleOwner')], t)),
            t
          );
        };
      let g = class extends p(i.Z) {};
      g = (0, r._)([(0, a.j)('esri.core.HandleOwner')], g);
    },
    82933: (e, t, s) => {
      'use strict';
      s.d(t, { Z: () => c });
      var r = s(29768),
        i = s(21972),
        n = s(15324),
        o = s(76506),
        a = s(34250),
        h = s(17533);
      s(23639),
        s(92143),
        s(31450),
        s(71552),
        s(40642),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(6906),
        s(50406),
        s(60991),
        s(81172),
        s(91306),
        s(76996);
      let l = class extends i.Z {
        constructor(e) {
          super(e), (this._groups = new Map());
        }
        destroy() {
          this.removeAll();
        }
        get size() {
          let e = 0;
          return (
            this._groups.forEach((t) => {
              e += t.length;
            }),
            e
          );
        }
        add(e, t) {
          if (!this._isHandle(e) && !Array.isArray(e) && !n.Z.isCollection(e)) return this;
          const s = this._getOrCreateGroup(t);
          return (
            Array.isArray(e) || n.Z.isCollection(e)
              ? e.forEach((e) => this._isHandle(e) && s.push(e))
              : s.push(e),
            this.notifyChange('size'),
            this
          );
        }
        forEach(e, t) {
          if ('function' == typeof e) this._groups.forEach((t) => t.forEach(e));
          else {
            const s = this._getGroup(e);
            s && t && s.forEach(t);
          }
        }
        has(e) {
          return this._groups.has(this._ensureGroupKey(e));
        }
        remove(e) {
          if (Array.isArray(e) || n.Z.isCollection(e)) return e.forEach(this.remove, this), this;
          if (!this.has(e)) return this;
          const t = this._getGroup(e);
          for (let e = 0; e < t.length; e++) t[e].remove();
          return this._deleteGroup(e), this.notifyChange('size'), this;
        }
        removeAll() {
          return (
            this._groups.forEach((e) => {
              for (let t = 0; t < e.length; t++) e[t].remove();
            }),
            this._groups.clear(),
            this.notifyChange('size'),
            this
          );
        }
        _isHandle(e) {
          return e && !!e.remove;
        }
        _getOrCreateGroup(e) {
          if (this.has(e)) return this._getGroup(e);
          const t = [];
          return this._groups.set(this._ensureGroupKey(e), t), t;
        }
        _getGroup(e) {
          return (0, o.a)(this._groups.get(this._ensureGroupKey(e)));
        }
        _deleteGroup(e) {
          return this._groups.delete(this._ensureGroupKey(e));
        }
        _ensureGroupKey(e) {
          return e || '_default_';
        }
      };
      (0, r._)([(0, a.Cb)({ readOnly: !0 })], l.prototype, 'size', null),
        (l = (0, r._)([(0, h.j)('esri.core.Handles')], l));
      const c = l;
    },
    617: (e, t, s) => {
      'use strict';
      s.d(t, {
        S1: () => c,
        on: () => f,
        OY: () => g,
        cm: () => d,
        N1: () => u,
        LR: () => p,
        tH: () => i,
      });
      var r = s(50406);
      function i(e, t, s, i, n) {
        const o = 'function' == typeof i ? i : null,
          a = 'object' == typeof i ? i : null;
        'boolean' == typeof i && (n = i);
        let h,
          l = !1;
        function c() {
          h && (h.remove(), (h = null));
        }
        const u = (0, r.dD)();
        (0, r.fu)(a, () => {
          c(), u.reject((0, r.zE)());
        });
        const d = {
          then: u.promise.then.bind(u.promise),
          catch: u.promise.catch.bind(u.promise),
          remove: c,
        };
        return (
          Object.freeze(d),
          (h = (function (e, t, s, r, i) {
            const n = e.watch(
              t,
              (t, i, n, o) => {
                (s && !s(t)) || null == r || r.call(e, t, i, n, o);
              },
              i,
            );
            if (Array.isArray(t))
              for (const i of t) {
                const n = e.get(i);
                s && s(n) && (null == r || r.call(e, n, n, t, e));
              }
            else {
              const i = e.get(t);
              s && s(i) && (null == r || r.call(e, i, i, t, e));
            }
            return n;
          })(
            e,
            t,
            s,
            (t, s, r, i) => {
              (l = !0),
                c(),
                o && o.call(e, t, s, r, i),
                u.resolve({ value: t, oldValue: s, propertyName: r, target: i });
            },
            n,
          )),
          l && c(),
          d
        );
      }
      function n(e) {
        return !!e;
      }
      function o(e) {
        return !e;
      }
      function a(e) {
        return !0 === e;
      }
      function h(e) {
        return !1 === e;
      }
      s(76506), s(60991), s(92143), s(31450), s(71552), s(40642), s(81172);
      const l = /\?(\.|$)/g;
      function c(e, t, s, r) {
        const i = Array.isArray(t) ? t : t.indexOf(',') > -1 ? t.split(',') : [t],
          n = (function (e, t, s, r) {
            return e.watch(t, s, r);
          })(e, t, s, r);
        for (const t of i) {
          const r = t.trim().replace(l, '$1'),
            i = e.get(r);
          s.call(e, i, i, r, e);
        }
        return n;
      }
      function u(e, t, s, r) {
        return i(e, t, n, s, r);
      }
      function d(e, t, s, r) {
        return i(e, t, o, s, r);
      }
      function p(e, t, s, r) {
        return i(e, t, a, s, r);
      }
      function g(e, t, s, r) {
        return i(e, t, h, s, r);
      }
      function f(e, t, s, i, n, o, a) {
        const h = {};
        function l(t) {
          const r = h[t];
          r && (o && o(r.target, t, e, s), r.handle.remove(), delete h[t]);
        }
        const u = c(
          e,
          t,
          (t, o, a) => {
            l(a),
              (0, r.i)(t) &&
                ((h[a] = { handle: (0, r.o)(t, s, i), target: t }), n && n(t, a, e, s));
          },
          a,
        );
        return {
          remove() {
            u.remove();
            for (const e in h) l(e);
          },
        };
      }
    },
    46987: (e, t, s) => {
      'use strict';
      s.d(t, { Z: () => h });
      var r = s(22723),
        i = s(92143),
        n = s(50406),
        o = s(37453);
      s(76506), s(31450), s(71552), s(40642), s(60991), s(81172), s(88762), s(32101);
      const a = i.L.getLogger('esri.core.workers.Connection'),
        h = class {
          constructor() {
            (this._clients = new Array()),
              (this._clientPromises = new Array()),
              (this._clientIdx = 0);
          }
          destroy() {
            this.close();
          }
          get closed() {
            return !this._clients || !this._clients.length;
          }
          open(e, t) {
            return new Promise((s, r) => {
              let i = !0;
              const a = (e) => {
                (0, n.k_)(t.signal), i && ((i = !1), e());
              };
              (this._clients.length = e.length), (this._clientPromises.length = e.length);
              for (let i = 0; i < e.length; ++i) {
                const h = e[i];
                (0, n.y8)(h)
                  ? (this._clientPromises[i] = h.then(
                      (e) => ((this._clients[i] = new o.default(e, t)), a(s), this._clients[i]),
                      () => (a(r), null),
                    ))
                  : ((this._clients[i] = new o.default(h, t)),
                    (this._clientPromises[i] = Promise.resolve(this._clients[i])),
                    a(s));
              }
            });
          }
          broadcast(e, t, s) {
            const r = new Array(this._clientPromises.length);
            for (let i = 0; i < this._clientPromises.length; ++i) {
              const n = this._clientPromises[i];
              r[i] = n.then((r) => r.invoke(e, t, s));
            }
            return r;
          }
          close() {
            for (const e of this._clientPromises) e.then((e) => e.close());
            (this._clients.length = 0), (this._clientPromises.length = 0);
          }
          getAvailableClient() {
            let e;
            for (let t = 0; t < this._clients.length; ++t) {
              const s = this._clients[t];
              if (s) {
                if (!s.isBusy()) return Promise.resolve(s);
              } else (e = e || []), e.push(this._clientPromises[t]);
            }
            return e
              ? Promise.race(e)
              : ((this._clientIdx = (this._clientIdx + 1) % this._clients.length),
                Promise.resolve(this._clients[this._clientIdx]));
          }
          invoke(e, t, s) {
            let r = null;
            return (
              Array.isArray(s)
                ? (a.warn(
                    'invoke()',
                    'The transferList parameter is deprecated, use the options object instead',
                  ),
                  (r = { transferList: s }))
                : (r = s),
              this.closed
                ? Promise.reject(new Error('Connection closed'))
                : this.getAvailableClient().then((s) => s.invoke(e, t, r))
            );
          }
          on(e, t) {
            return Promise.all(this._clientPromises).then(() =>
              (0, r.h)(this._clients.map((s) => s.on(e, t))),
            );
          }
          openPorts() {
            return new Promise((e) => {
              const t = new Array(this._clientPromises.length);
              let s = t.length;
              for (let r = 0; r < this._clientPromises.length; ++r)
                this._clientPromises[r].then((i) => {
                  (t[r] = i.openPort()), 0 == --s && e(t);
                });
            });
          }
          get test() {
            return { numClients: this._clients.length };
          }
        };
    },
    65514: (e, t, s) => {
      'use strict';
      s.d(t, { bA: () => z, Mz: () => N });
      var r = s(60991),
        i = s(76506),
        n = s(50406),
        o = s(46987),
        a = s(37453),
        h = s(88762),
        l = s(92143),
        c = s(73173),
        u = s(31450),
        d = (s(66284), s(32101)),
        p = s(3482);
      s(81172), s(71552), s(40642), s(22723), s(82058), s(33921), s(57251);
      let g = null;
      g = (0, d.hF)((0, c.g)('esri/core/workers/init.js'));
      const f = {};
      (f.baseUrl = (0, d.hF)((0, c.g)('dojo/'))),
        (f.packages = [{ name: 'esri', location: '../esri' }]);
      class _ {
        constructor() {
          const e = document.createDocumentFragment();
          ['addEventListener', 'dispatchEvent', 'removeEventListener'].forEach((t) => {
            this[t] = (...s) => e[t](...s);
          });
        }
      }
      const m = i.g.MutationObserver || i.g.WebKitMutationObserver,
        y = (function () {
          let e;
          if (i.g.process && i.g.process.nextTick)
            e = (e) => {
              i.g.process.nextTick(e);
            };
          else if (i.g.Promise)
            e = (e) => {
              i.g.Promise.resolve().then(e);
            };
          else if (m) {
            const t = [],
              s = document.createElement('div');
            new m(() => {
              for (; t.length > 0; ) t.shift()();
            }).observe(s, { attributes: !0 }),
              (e = (e) => {
                t.push(e), s.setAttribute('queueStatus', '1');
              });
          }
          return e;
        })(),
        b = (() => {
          const e = i.g.MessageEvent;
          try {
            new e('message', { data: null });
          } catch {
            return (e, t = {}) => {
              const { data: s, bubbles: r = !1, cancelable: i = !1 } = t,
                n = document.createEvent('Event');
              return n.initEvent(e, r, i), (n.data = s), n;
            };
          }
          return (t, s) => new e(t, s);
        })();
      class x {
        constructor() {
          (this._dispatcher = new _()), this._workerPostMessage({ type: a.M.HANDSHAKE });
        }
        terminate() {}
        get onmessage() {
          return this._onmessageHandler;
        }
        set onmessage(e) {
          this._onmessageHandler && this.removeEventListener('message', this._onmessageHandler),
            (this._onmessageHandler = e),
            e && this.addEventListener('message', e);
        }
        get onmessageerror() {
          return this._onmessageerrorHandler;
        }
        set onmessageerror(e) {
          this._onmessageerrorHandler &&
            this.removeEventListener('messageerror', this._onmessageerrorHandler),
            (this._onmessageerrorHandler = e),
            e && this.addEventListener('messageerror', e);
        }
        get onerror() {
          return this._onerrorHandler;
        }
        set onerror(e) {
          this._onerrorHandler && this.removeEventListener('error', this._onerrorHandler),
            (this._onerrorHandler = e),
            e && this.addEventListener('error', e);
        }
        postMessage(e) {
          y(() => {
            this._workerMessageHandler(b('message', { data: e }));
          });
        }
        dispatchEvent(e) {
          return this._dispatcher.dispatchEvent(e);
        }
        addEventListener(e, t, s) {
          this._dispatcher.addEventListener(e, t, s);
        }
        removeEventListener(e, t, s) {
          this._dispatcher.removeEventListener(e, t, s);
        }
        _workerPostMessage(e) {
          y(() => {
            this.dispatchEvent(b('message', { data: e }));
          });
        }
        async _workerMessageHandler(e) {
          const t = (0, a.r)(e);
          if (t && t.type === a.M.OPEN) {
            const { modulePath: e, jobId: s } = t;
            let r = await a.default.loadWorker(e);
            r || (r = await import(e));
            const i = a.default.connect(r);
            this._workerPostMessage({ type: a.M.OPENED, jobId: s, data: i });
          }
        }
      }
      const I = l.L.getLogger('esri.core.workers'),
        { HANDSHAKE: w } = a.M;
      let v, S;
      const T = 'Failed to create Worker. Fallback to execute module in main thread';
      async function F(e) {
        return new Promise((t) => {
          function s(i) {
            const n = (0, a.r)(i);
            n &&
              n.type === w &&
              (e.removeEventListener('message', s), e.removeEventListener('error', r), t(e));
          }
          function r(t) {
            t.preventDefault(),
              e.removeEventListener('message', s),
              e.removeEventListener('error', r),
              I.warn('Failed to create Worker. Fallback to execute module in main thread', t),
              (e = new x()).addEventListener('message', s),
              e.addEventListener('error', r);
          }
          e.addEventListener('message', s), e.addEventListener('error', r);
        });
      }
      let k = 0;
      const E = l.L.getLogger('esri.core.workers'),
        { ABORT: C, INVOKE: M, OPEN: A, OPENED: O, RESPONSE: R } = a.M;
      class L {
        constructor(e, t) {
          (this._outJobs = new Map()),
            (this._inJobs = new Map()),
            (this.worker = e),
            (this.id = t),
            e.addEventListener('message', this._onMessage.bind(this)),
            e.addEventListener('error', (e) => {
              e.preventDefault(), E.error(e);
            });
        }
        static async create(e) {
          const t = await (async function () {
            if (!(0, i.h)('esri-workers')) return F(new x());
            if (!v && !S)
              try {
                const e = 'let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.replace(
                  '"{CONFIGURATION}"',
                  `'${(function () {
                    let e;
                    if (null != u.Z.default) {
                      const t = { ...u.Z };
                      delete t.default, (e = JSON.parse(JSON.stringify(t)));
                    } else e = JSON.parse(JSON.stringify(u.Z));
                    (e.assetsPath = (0, d.hF)(e.assetsPath)),
                      (e.request.interceptors = []),
                      (e.log.interceptors = []),
                      (e.locale = (0, p.g)()),
                      (e.has = {
                        'csp-restrictions': (0, i.h)('csp-restrictions'),
                        'esri-2d-debug': !1,
                        'esri-2d-update-debug': (0, i.h)('esri-2d-update-debug'),
                        'esri-2d-query-centroid-enabled': (0, i.h)(
                          'esri-2d-query-centroid-enabled',
                        ),
                        'featurelayer-pbf': (0, i.h)('featurelayer-pbf'),
                        'esri-atomics': (0, i.h)('esri-atomics'),
                        'esri-shared-array-buffer': (0, i.h)('esri-shared-array-buffer'),
                        'esri-tiles-debug': (0, i.h)('esri-tiles-debug'),
                        'esri-workers-arraybuffer-transfer': (0, i.h)(
                          'esri-workers-arraybuffer-transfer',
                        ),
                        'host-webworker': 1,
                      }),
                      e.workers.loaderUrl
                        ? (e.workers.loaderUrl = (0, d.hF)(e.workers.loaderUrl))
                        : g && (e.workers.loaderUrl = g),
                      e.workers.workerPath
                        ? (e.workers.workerPath = (0, d.hF)(e.workers.workerPath))
                        : (e.workers.workerPath = 'esri/core/workers/RemoteClient');
                    const t = u.Z.workers.loaderConfig,
                      s = (function (e) {
                        var t;
                        const s = {
                          async: e.async,
                          isDebug: e.isDebug,
                          locale: e.locale,
                          baseUrl: e.baseUrl,
                          has: { ...e.has },
                          map: { ...e.map },
                          packages: (e.packages && e.packages.concat()) || [],
                          paths: { ...e.paths },
                        };
                        return (
                          e.hasOwnProperty('async') || (s.async = !0),
                          e.hasOwnProperty('isDebug') || (s.isDebug = !1),
                          e.baseUrl || (s.baseUrl = f.baseUrl),
                          null == (t = f.packages) ||
                            t.forEach((e) => {
                              !(function (e, t) {
                                for (const s of e) if (s.name === t.name) return;
                                e.push(t);
                              })(s.packages, e);
                            }),
                          s
                        );
                      })({
                        baseUrl: null == t ? void 0 : t.baseUrl,
                        locale: (0, p.g)(),
                        has: {
                          'csp-restrictions': (0, i.h)('csp-restrictions'),
                          'dojo-test-sniff': 0,
                          'host-webworker': 1,
                          ...(null == t ? void 0 : t.has),
                        },
                        map: { ...(null == t ? void 0 : t.map) },
                        paths: { ...(null == t ? void 0 : t.paths) },
                        packages: (null == t ? void 0 : t.packages) || [],
                      }),
                      r = { version: h.i8, buildDate: h.rh, revision: h.LB };
                    return JSON.stringify({ esriConfig: e, loaderConfig: s, kernelInfo: r });
                  })()}'`,
                );
                v = URL.createObjectURL(new Blob([e], { type: 'text/javascript' }));
              } catch (e) {
                S = e || {};
              }
            let e;
            if (v)
              try {
                e = new Worker(v, { name: 'esri-worker-' + k++ });
              } catch (t) {
                I.warn(T, S), (e = new x());
              }
            else I.warn(T, S), (e = new x());
            return F(e);
          })();
          return new L(t, e);
        }
        terminate() {
          this.worker.terminate();
        }
        async open(e, t = {}) {
          const { signal: s } = t,
            r = (0, a.n)();
          return new Promise((t, i) => {
            const o = {
              resolve: t,
              reject: i,
              abortHandle: (0, n.$F)(s, () => {
                this._outJobs.delete(r), this._post({ type: C, jobId: r });
              }),
            };
            this._outJobs.set(r, o), this._post({ type: A, jobId: r, modulePath: e });
          });
        }
        _onMessage(e) {
          const t = (0, a.r)(e);
          if (t)
            switch (t.type) {
              case O:
                this._onOpenedMessage(t);
                break;
              case R:
                this._onResponseMessage(t);
                break;
              case C:
                this._onAbortMessage(t);
                break;
              case M:
                this._onInvokeMessage(t);
            }
        }
        _onAbortMessage(e) {
          const t = this._inJobs,
            s = e.jobId,
            r = t.get(s);
          r && (r.controller && r.controller.abort(), t.delete(s));
        }
        _onInvokeMessage(e) {
          const { methodName: t, jobId: s, data: r, abortable: i } = e,
            o = i ? (0, n.yi)() : null,
            l = this._inJobs,
            c = h.Nv[t];
          let u;
          try {
            if ('function' != typeof c) throw new TypeError(`${t} is not a function`);
            u = c.call(null, r, { signal: o ? o.signal : null });
          } catch (e) {
            return void this._post({ type: R, jobId: s, error: (0, a.t)(e) });
          }
          (0, n.y8)(u)
            ? (l.set(s, { controller: o, promise: u }),
              u.then(
                (e) => {
                  l.has(s) && (l.delete(s), this._post({ type: R, jobId: s }, e));
                },
                (e) => {
                  l.has(s) &&
                    (l.delete(s),
                    e || (e = { message: 'Error encountered at method' + t }),
                    (0, n.D_)(e) ||
                      this._post({
                        type: R,
                        jobId: s,
                        error: (0, a.t)(e || { message: `Error encountered at method ${t}` }),
                      }));
                },
              ))
            : this._post({ type: R, jobId: s }, u);
        }
        _onOpenedMessage(e) {
          var t;
          const { jobId: s, data: r } = e,
            i = this._outJobs.get(s);
          i && (this._outJobs.delete(s), null == (t = i.abortHandle) || t.remove(), i.resolve(r));
        }
        _onResponseMessage(e) {
          var t;
          const { jobId: s, error: i, data: n } = e,
            o = this._outJobs.get(s);
          o &&
            (this._outJobs.delete(s),
            null == (t = o.abortHandle) || t.remove(),
            i ? o.reject(r.Z.fromJSON(JSON.parse(i))) : o.resolve(n));
        }
        _post(e, t, s) {
          return (0, a.p)(this.worker, e, t, s);
        }
      }
      let P = (0, i.h)('esri-workers-debug')
        ? 1
        : (0, i.h)('host-browser')
        ? navigator.hardwareConcurrency - 1
        : 0;
      P || (P = ((0, i.h)('safari') && (0, i.h)('mac')) || (0, i.h)('trident') ? 7 : 2);
      let D = 0;
      const U = [];
      function N(e, t) {
        return q(e, { client: t });
      }
      async function q(e, t) {
        const s = new o.Z();
        return await s.open(e, t), s;
      }
      async function z(e, t = {}) {
        if ('string' != typeof e)
          throw new r.Z('workers:undefined-module', 'modulePath is missing');
        let s = t.strategy || 'distributed';
        if (
          ((0, i.h)('host-webworker') && !(0, i.h)('esri-workers') && (s = 'local'), 'local' === s)
        ) {
          let s = await a.default.loadWorker(e);
          s || (s = await import(e)), (0, n.k_)(t.signal);
          const r = t.client || s;
          return q([a.default.connect(s)], { ...t, client: r });
        }
        if (
          (await (async function () {
            if (j) return j;
            B = (0, n.yi)();
            const e = [];
            for (let t = 0; t < P; t++) {
              const s = L.create(t).then((e) => ((U[t] = e), e));
              e.push(s);
            }
            return (j = Promise.all(e)), j;
          })(),
          (0, n.k_)(t.signal),
          'dedicated' === s)
        ) {
          const s = D++ % P;
          return q([await U[s].open(e, t)], t);
        }
        if (t.maxNumWorkers && t.maxNumWorkers > 0) {
          const s = Math.min(t.maxNumWorkers, P);
          if (s < P) {
            const r = new Array(s);
            for (let i = 0; i < s; ++i) {
              const s = D++ % P;
              r[i] = U[s].open(e, t);
            }
            return q(r, t);
          }
        }
        return q(
          U.map((s) => s.open(e, t)),
          t,
        );
      }
      let B,
        j = null;
    },
    92817: (e, t, s) => {
      'use strict';
      s.d(t, { Z: () => c });
      var r,
        i = s(29768),
        n = s(74673),
        o = s(34250),
        a = (s(76506), s(91306)),
        h = (s(92143), s(17533));
      s(21972),
        s(23639),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(6906),
        s(50406),
        s(60991),
        s(81172),
        s(71552),
        s(31450),
        s(40642),
        s(26341);
      let l = (r = class extends n.a {
        constructor(e) {
          super(e),
            (this.level = 0),
            (this.levelValue = null),
            (this.resolution = 0),
            (this.scale = 0);
        }
        clone() {
          return new r({
            level: this.level,
            levelValue: this.levelValue,
            resolution: this.resolution,
            scale: this.scale,
          });
        }
      });
      (0, i._)([(0, o.Cb)({ type: a.I, json: { write: !0 } })], l.prototype, 'level', void 0),
        (0, i._)(
          [(0, o.Cb)({ type: String, json: { write: !0 } })],
          l.prototype,
          'levelValue',
          void 0,
        ),
        (0, i._)(
          [(0, o.Cb)({ type: Number, json: { write: !0 } })],
          l.prototype,
          'resolution',
          void 0,
        ),
        (0, i._)([(0, o.Cb)({ type: Number, json: { write: !0 } })], l.prototype, 'scale', void 0),
        (l = r = (0, i._)([(0, h.j)('esri.layers.support.LOD')], l));
      const c = l;
    },
    43352: (e, t, s) => {
      'use strict';
      s.d(t, { Z: () => x });
      var r,
        i = s(29768),
        n = s(57251),
        o = s(74673),
        a = s(53785),
        h = s(34250),
        l = (s(76506), s(91306)),
        c = (s(92143), s(97714)),
        u = s(17533),
        d = s(2906),
        p = s(91597),
        g = s(60947),
        f = s(92482),
        _ = s(35132),
        m = s(92817);
      s(71552),
        s(21972),
        s(23639),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(6906),
        s(50406),
        s(60991),
        s(81172),
        s(31450),
        s(40642),
        s(26341),
        s(95587),
        s(89623),
        s(86787),
        s(73796),
        s(21801);
      const y = new n.J({
        PNG: 'png',
        PNG8: 'png8',
        PNG24: 'png24',
        PNG32: 'png32',
        JPEG: 'jpg',
        JPG: 'jpg',
        DIB: 'dib',
        TIFF: 'tiff',
        EMF: 'emf',
        PS: 'ps',
        PDF: 'pdf',
        GIF: 'gif',
        SVG: 'svg',
        SVGZ: 'svgz',
        Mixed: 'mixed',
        MIXED: 'mixed',
        LERC: 'lerc',
        LERC2D: 'lerc2d',
        RAW: 'raw',
        pbf: 'pbf',
      });
      let b = (r = class extends o.a {
        constructor(e) {
          super(e),
            (this.dpi = 96),
            (this.format = null),
            (this.origin = null),
            (this.minScale = 0),
            (this.maxScale = 0),
            (this.size = null),
            (this.spatialReference = null);
        }
        static create(e = {}) {
          const {
            resolutionFactor: t = 1,
            scales: s,
            size: i = 256,
            spatialReference: n = g.Z.WebMercator,
            numLODs: o = 24,
          } = e;
          if (!(0, g.j)(n)) {
            const e = [];
            if (s)
              for (let t = 0; t < s.length; t++) {
                const r = s[t];
                e.push({ level: t, scale: r, resolution: r });
              }
            else {
              let t = 5e-4;
              for (let s = o - 1; s >= 0; s--)
                e.unshift({ level: s, scale: t, resolution: t }), (t *= 2);
            }
            return new r({
              dpi: 96,
              lods: e,
              origin: new p.Z(0, 0, n),
              size: [i, i],
              spatialReference: n,
            });
          }
          const h = (0, g.g)(n),
            l = e.origin
              ? new p.Z({ x: e.origin.x, y: e.origin.y, spatialReference: n })
              : new p.Z(
                  h
                    ? { x: h.origin[0], y: h.origin[1], spatialReference: n }
                    : { x: 0, y: 0, spatialReference: n },
                ),
            c = 1 / (39.37 * (0, a.a)(n) * 96),
            u = [];
          if (s)
            for (let e = 0; e < s.length; e++) {
              const t = s[e],
                r = t * c;
              u.push({ level: e, scale: t, resolution: r });
            }
          else {
            let e = (0, g.l)(n) ? (512 / i) * 591657527.5917094 : (256 / i) * 591657527.591555;
            const s = Math.ceil(o / t);
            u.push({ level: 0, scale: e, resolution: e * c });
            for (let r = 1; r < s; r++) {
              const s = e / 2 ** t,
                i = s * c;
              u.push({ level: r, scale: s, resolution: i }), (e = s);
            }
          }
          return new r({ dpi: 96, lods: u, origin: l, size: [i, i], spatialReference: n });
        }
        get isWrappable() {
          const { spatialReference: e, origin: t } = this;
          if (e && t) {
            const s = (0, g.g)(e);
            return e.isWrappable && Math.abs(s.origin[0] - t.x) <= s.dx;
          }
          return !1;
        }
        readOrigin(e, t) {
          return p.Z.fromJSON({ spatialReference: t.spatialReference, ...e });
        }
        set lods(e) {
          let t = 0,
            s = 0;
          const r = [];
          (this._levelToLOD = {}),
            e &&
              ((t = -1 / 0),
              (s = 1 / 0),
              e.forEach((e) => {
                r.push(e.scale),
                  (t = e.scale > t ? e.scale : t),
                  (s = e.scale < s ? e.scale : s),
                  (this._levelToLOD[e.level] = e);
              })),
            this._set('scales', r),
            this._set('minScale', t),
            this._set('maxScale', s),
            this._set('lods', e),
            this._initializeUpsampleLevels();
        }
        readSize(e, t) {
          return [t.cols, t.rows];
        }
        writeSize(e, t) {
          (t.cols = e[0]), (t.rows = e[0]);
        }
        zoomToScale(e) {
          const t = this.scales;
          if (e <= 0) return t[0];
          if (e >= t.length - 1) return t[t.length - 1];
          {
            const s = Math.floor(e),
              r = s + 1;
            return t[s] / (t[s] / t[r]) ** (e - s);
          }
        }
        scaleToZoom(e) {
          const t = this.scales,
            s = t.length - 1;
          let r = 0;
          for (; r < s; r++) {
            const s = t[r],
              i = t[r + 1];
            if (s <= e) return r;
            if (i === e) return r + 1;
            if (s > e && i < e) return r + Math.log(s / e) / Math.log(s / i);
          }
          return r;
        }
        snapScale(e, t = 0.95) {
          const s = this.scaleToZoom(e);
          return s % Math.floor(s) >= t
            ? this.zoomToScale(Math.ceil(s))
            : this.zoomToScale(Math.floor(s));
        }
        tileAt(e, t, s, r) {
          const i = this.lodAt(e);
          if (!i) return null;
          let n, o;
          if ('number' == typeof t) (n = t), (o = s);
          else if ((0, g.e)(t.spatialReference, this.spatialReference))
            (n = t.x), (o = t.y), (r = s);
          else {
            const e = (0, _.iV)(t, this.spatialReference);
            if (!e) return null;
            (n = e.x), (o = e.y), (r = s);
          }
          const a = i.resolution * this.size[0],
            h = i.resolution * this.size[1];
          return (
            r || (r = { id: null, level: 0, row: 0, col: 0, extent: (0, f.a)() }),
            (r.level = e),
            (r.row = Math.floor((this.origin.y - o) / h + 0.001)),
            (r.col = Math.floor((n - this.origin.x) / a + 0.001)),
            this.updateTileInfo(r),
            r
          );
        }
        updateTileInfo(e, t = 0) {
          let s = this.lodAt(e.level);
          if (!s && 1 === t) {
            const t = this.lods[this.lods.length - 1];
            t.level < e.level && (s = t);
          }
          if (!s) return;
          const r = e.level - s.level,
            i = (s.resolution * this.size[0]) / 2 ** r,
            n = (s.resolution * this.size[1]) / 2 ** r;
          (e.id = `${e.level}/${e.row}/${e.col}`),
            e.extent || (e.extent = (0, f.a)()),
            (e.extent[0] = this.origin.x + e.col * i),
            (e.extent[1] = this.origin.y - (e.row + 1) * n),
            (e.extent[2] = e.extent[0] + i),
            (e.extent[3] = e.extent[1] + n);
        }
        upsampleTile(e) {
          const t = this._upsampleLevels[e.level];
          return !(
            !t ||
            -1 === t.parentLevel ||
            ((e.level = t.parentLevel),
            (e.row = Math.floor(e.row / t.factor + 0.001)),
            (e.col = Math.floor(e.col / t.factor + 0.001)),
            this.updateTileInfo(e),
            0)
          );
        }
        getTileBounds(e, t) {
          const { resolution: s } = this.lodAt(t.level),
            r = s * this.size[0],
            i = s * this.size[1];
          return (
            (e[0] = this.origin.x + t.col * r),
            (e[1] = this.origin.y - (t.row + 1) * i),
            (e[2] = e[0] + r),
            (e[3] = e[1] + i),
            e
          );
        }
        lodAt(e) {
          return (this._levelToLOD && this._levelToLOD[e]) || null;
        }
        clone() {
          return r.fromJSON(this.write({}));
        }
        _initializeUpsampleLevels() {
          const e = this.lods;
          this._upsampleLevels = [];
          let t = null;
          for (let s = 0; s < e.length; s++) {
            const r = e[s];
            (this._upsampleLevels[r.level] = {
              parentLevel: t ? t.level : -1,
              factor: t ? t.resolution / r.resolution : 0,
            }),
              (t = r);
          }
        }
      });
      (0, i._)(
        [(0, h.Cb)({ type: Number, json: { write: !0 } })],
        b.prototype,
        'compressionQuality',
        void 0,
      ),
        (0, i._)([(0, h.Cb)({ type: Number, json: { write: !0 } })], b.prototype, 'dpi', void 0),
        (0, i._)(
          [
            (0, h.Cb)({
              type: String,
              json: {
                read: y.read,
                write: y.write,
                origins: { 'web-scene': { read: !1, write: !1 } },
              },
            }),
          ],
          b.prototype,
          'format',
          void 0,
        ),
        (0, i._)([(0, h.Cb)({ readOnly: !0 })], b.prototype, 'isWrappable', null),
        (0, i._)([(0, h.Cb)({ type: p.Z, json: { write: !0 } })], b.prototype, 'origin', void 0),
        (0, i._)([(0, c.r)('origin')], b.prototype, 'readOrigin', null),
        (0, i._)(
          [(0, h.Cb)({ type: [m.Z], value: null, json: { write: !0 } })],
          b.prototype,
          'lods',
          null,
        ),
        (0, i._)([(0, h.Cb)({ readOnly: !0 })], b.prototype, 'minScale', void 0),
        (0, i._)([(0, h.Cb)({ readOnly: !0 })], b.prototype, 'maxScale', void 0),
        (0, i._)([(0, h.Cb)({ readOnly: !0 })], b.prototype, 'scales', void 0),
        (0, i._)(
          [
            (0, h.Cb)({
              cast: (e) => (Array.isArray(e) ? e : 'number' == typeof e ? [e, e] : [256, 256]),
            }),
          ],
          b.prototype,
          'size',
          void 0,
        ),
        (0, i._)([(0, c.r)('size', ['rows', 'cols'])], b.prototype, 'readSize', null),
        (0, i._)(
          [(0, d.w)('size', { cols: { type: l.I }, rows: { type: l.I } })],
          b.prototype,
          'writeSize',
          null,
        ),
        (0, i._)(
          [(0, h.Cb)({ type: g.Z, json: { write: !0 } })],
          b.prototype,
          'spatialReference',
          void 0,
        ),
        (b = r = (0, i._)([(0, u.j)('esri.layers.support.TileInfo')], b));
      const x = b;
    },
  },
]);
