(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [4599],
  {
    97853: (e, t, r) => {
      'use strict';
      r.d(t, { B: () => l });
      var s = r(29768),
        n = r(95873),
        o = r(34250),
        i = (r(76506), r(91306), r(92143), r(17533));
      let a = class extends n.r {
        initialize() {}
        destroy() {}
        get supportsTileUpdates() {
          return !1;
        }
        get spatialReference() {
          const e = this.get('tileStore.tileScheme.spatialReference');
          return (e && e.toJSON()) || null;
        }
      };
      (0, s._)([(0, o.Cb)({ readOnly: !0 })], a.prototype, 'supportsTileUpdates', null),
        (0, s._)([(0, o.Cb)({ constructOnly: !0 })], a.prototype, 'remoteClient', void 0),
        (0, s._)([(0, o.Cb)({ constructOnly: !0 })], a.prototype, 'service', void 0),
        (0, s._)([(0, o.Cb)()], a.prototype, 'spatialReference', null),
        (0, s._)([(0, o.Cb)({ constructOnly: !0 })], a.prototype, 'tileInfo', void 0),
        (0, s._)([(0, o.Cb)({ constructOnly: !0 })], a.prototype, 'tileStore', void 0),
        (a = (0, s._)([(0, i.j)('esri.views.2d.layers.features.processors.BaseProcessor')], a));
      var l = a;
    },
    4599: (e, t, r) => {
      'use strict';
      r.r(t), r.d(t, { default: () => h });
      var s = r(29768),
        n = r(76506),
        o = (r(34250), r(91306), r(92143), r(17533)),
        i = r(93939);
      r(82426),
        (() => {
          if (!('document' in n.g)) return () => null;
          const e = document.createElement('canvas');
          e.getContext('2d');
          (e.height = 512), (e.width = 1);
        })();
      var a = r(82356),
        l = r(97853),
        d = r(53257);
      r(86656),
        r(22723),
        r(31450),
        r(71552),
        r(40642),
        r(81172),
        r(21972),
        r(23639),
        r(91055),
        r(27794),
        r(6906),
        r(50406),
        r(60991),
        r(15324),
        r(76996),
        r(95873),
        r(82933),
        r(617),
        r(21801),
        r(73796),
        r(74673),
        r(26341),
        r(97714),
        r(60947),
        r(2906),
        r(91597),
        r(86787),
        r(35132),
        r(89623),
        r(31292),
        r(74569),
        r(84069),
        r(44567),
        r(98380),
        r(92896),
        r(22781),
        r(57251),
        r(32422),
        r(93314),
        r(35197),
        r(59465),
        r(69218),
        r(97546),
        r(9801),
        r(53523),
        r(42911),
        r(46826),
        r(45433),
        r(54732),
        r(27207),
        r(6687);
      class c {
        constructor(e, t) {
          (this.offset = e), (this.extent = t);
        }
      }
      let u = class extends l.B {
        constructor() {
          super(...arguments), (this.type = 'heatmap'), (this._tileKeyToFeatureSets = new Map());
        }
        initialize() {
          this.handles.add([this.tileStore.on('update', this.onTileUpdate.bind(this))]);
        }
        async update(e, t) {
          const r = t.schema.processors[0];
          'heatmap' === r.type && (0, i.d)(this._schema, r) && ((e.mesh = !0), (this._schema = r));
        }
        onTileUpdate(e) {
          for (const t of e.removed) this._tileKeyToFeatureSets.delete(t.key.id);
        }
        onTileClear(e) {
          return (
            this._tileKeyToFeatureSets.delete(e.key.id),
            this.remoteClient.invoke('tileRenderer.onTileData', {
              tileKey: e.id,
              data: { clear: !0 },
            })
          );
        }
        async onTileMessage(e, t, r) {
          this._tileKeyToFeatureSets.has(e.key.id) ||
            this._tileKeyToFeatureSets.set(e.key.id, new Map());
          const s = this._tileKeyToFeatureSets.get(e.key.id);
          if (
            ((0, n.i)(t.addOrUpdate) &&
              t.addOrUpdate.hasFeatures &&
              s.set(t.addOrUpdate.instance, t),
            t.end)
          ) {
            const t = [],
              s = (function (e) {
                const t = e.key,
                  r = new Map(),
                  s = 256,
                  n = a.k,
                  o = e.tileInfoView.tileInfo.isWrappable;
                return (
                  r.set((0, d.g)(t, -1, -1, o).id, new c([-n, -n], [n - s, n - s, n, n])),
                  r.set((0, d.g)(t, 0, -1, o).id, new c([0, -n], [0, n - s, n, n])),
                  r.set((0, d.g)(t, 1, -1, o).id, new c([n, -n], [0, n - s, s, n])),
                  r.set((0, d.g)(t, -1, 0, o).id, new c([-n, 0], [n - s, 0, n, n])),
                  r.set((0, d.g)(t, 1, 0, o).id, new c([n, 0], [0, 0, s, n])),
                  r.set((0, d.g)(t, -1, 1, o).id, new c([-n, n], [n - s, 0, n, s])),
                  r.set((0, d.g)(t, 0, 1, o).id, new c([0, n], [0, 0, n, s])),
                  r.set((0, d.g)(t, 1, 1, o).id, new c([n, n], [0, 0, s, s])),
                  r
                );
              })(e);
            this._tileKeyToFeatureSets.forEach((r, o) => {
              if (o === e.key.id) r.forEach((e) => (0, n.e)(e.addOrUpdate, (e) => t.push(e)));
              else if (s.has(o)) {
                const e = s.get(o),
                  [i, a] = e.offset;
                r.forEach((e) =>
                  (0, n.e)(e.addOrUpdate, (e) => {
                    const r = e.transform(i, a, 1, 1);
                    t.push(r);
                  }),
                );
              }
            });
            const o = (function (e, t, r, s) {
                const { blurRadius: n, fieldOffset: o, field: i } = t,
                  a = new Float64Array(r * s),
                  l = (function (e) {
                    const t = Math.round(3 * e),
                      r = 2 * e * e,
                      s = new Float64Array(2 * t + 1);
                    for (let n = 0; n <= s.length; n++)
                      s[n] = (Math.exp(-((n - t) ** 2) / r) / Math.sqrt(2 * Math.PI)) * (e / 2);
                    return s;
                  })(n),
                  d = Math.round(3 * n);
                let c,
                  u = Number.NEGATIVE_INFINITY;
                const h = (function (e, t) {
                    return null != e
                      ? 'string' == typeof t
                        ? (t) => -1 * +t.readAttribute(e)
                        : (r) => +r.readAttribute(e) + t
                      : (e) => 1;
                  })(i, o),
                  p = new Set();
                for (const t of e) {
                  const e = t.getCursor();
                  for (; e.next(); ) {
                    const t = e.getObjectId();
                    if (p.has(t)) continue;
                    p.add(t);
                    const n = e.readLegacyPointGeometry(),
                      o = 128;
                    if (n.x < -o || n.x >= r + o || n.y < -o || n.y > s + o) continue;
                    const i = +h(e),
                      f = Math.round(n.x) - d,
                      y = Math.round(n.y) - d,
                      m = Math.max(0, f),
                      w = Math.max(0, y),
                      g = Math.min(s, Math.round(n.y) + d),
                      T = Math.min(r, Math.round(n.x) + d);
                    for (let e = w; e < g; e++) {
                      const t = l[e - y];
                      for (let s = m; s < T; s++) {
                        const n = l[s - f];
                        (c = a[e * r + s] += t * n * i), c > u && (u = c);
                      }
                    }
                  }
                }
                return { matrix: a.buffer, max: u };
              })(t, this._schema.mesh, 512, 512),
              i = { tileKey: e.key.id, intensityInfo: o },
              l = [o.matrix];
            return this.remoteClient.invoke('tileRenderer.onTileData', i, {
              ...r,
              transferList: l,
            });
          }
        }
        onTileError(e, t, r) {
          return this.remoteClient.invoke(
            'tileRenderer.onTileError',
            { tileKey: e.id, error: t },
            r,
          );
        }
      };
      u = (0, s._)([(0, o.j)('esri.views.2d.layers.features.processors.HeatmapProcessor')], u);
      const h = u;
    },
    53257: (e, t, r) => {
      'use strict';
      function s(e, t, r, s) {
        const n = e.clone(),
          o = 1 << n.level,
          i = n.col + t,
          a = n.row + r;
        return (
          s && i < 0
            ? ((n.col = i + o), (n.world -= 1))
            : i >= o
            ? ((n.col = i - o), (n.world += 1))
            : (n.col = i),
          (n.row = a),
          n
        );
      }
      r.d(t, { g: () => s }), r(91055), r(21801), r(76506), r(31292), r(6687);
    },
  },
]);
