@vitessce/gl 3.6.17 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- var _a2, _b;
5
1
  import * as React from "react";
6
2
  import { useLayoutEffect, useEffect, cloneElement, createElement, forwardRef, useState, useRef, useMemo, useImperativeHandle } from "react";
7
3
  function _mergeNamespaces(n2, m) {
@@ -17355,8 +17351,8 @@ function fitBounds(options) {
17355
17351
  } = options;
17356
17352
  const [[west, south], [east, north]] = bounds2;
17357
17353
  const padding = getPaddingObject(options.padding);
17358
- const nw = lngLatToWorld([west, clamp$1(north, -85.051129, MAX_LATITUDE)]);
17359
- const se = lngLatToWorld([east, clamp$1(south, -85.051129, MAX_LATITUDE)]);
17354
+ const nw = lngLatToWorld([west, clamp$1(north, -MAX_LATITUDE, MAX_LATITUDE)]);
17355
+ const se = lngLatToWorld([east, clamp$1(south, -MAX_LATITUDE, MAX_LATITUDE)]);
17360
17356
  const size = [Math.max(Math.abs(se[0] - nw[0]), minExtent), Math.max(Math.abs(se[1] - nw[1]), minExtent)];
17361
17357
  const targetSize = [width - padding.left - padding.right - Math.abs(offset[0]) * 2, height - padding.top - padding.bottom - Math.abs(offset[1]) * 2];
17362
17358
  assert$6(targetSize[0] > 0 && targetSize[1] > 0);
@@ -23372,7 +23368,12 @@ function getAugmentedNamespace(n2) {
23372
23368
  var f2 = n2.default;
23373
23369
  if (typeof f2 == "function") {
23374
23370
  var a2 = function a3() {
23375
- if (this instanceof a3) {
23371
+ var isInstance = false;
23372
+ try {
23373
+ isInstance = this instanceof a3;
23374
+ } catch {
23375
+ }
23376
+ if (isInstance) {
23376
23377
  return Reflect.construct(f2, arguments, this.constructor);
23377
23378
  }
23378
23379
  return f2.apply(this, arguments);
@@ -36035,7 +36036,7 @@ function requireTinySdf() {
36035
36036
  function edt1d(grid, offset, stride, length2, f2, v, z) {
36036
36037
  var q, k, s2, r2;
36037
36038
  v[0] = 0;
36038
- z[0] = -1e20;
36039
+ z[0] = -INF;
36039
36040
  z[1] = INF;
36040
36041
  for (q = 0; q < length2; q++) f2[q] = grid[offset + q * stride];
36041
36042
  for (q = 1, k = 0, s2 = 0; q < length2; q++) {
@@ -39195,51 +39196,51 @@ const ONE6TH = 1 / 6;
39195
39196
  const OFFSET = {
39196
39197
  N: [0, HALF],
39197
39198
  E: [HALF, 0],
39198
- S: [0, -0.5],
39199
- W: [-0.5, 0],
39199
+ S: [0, -HALF],
39200
+ W: [-HALF, 0],
39200
39201
  NE: [HALF, HALF],
39201
- NW: [-0.5, HALF],
39202
- SE: [HALF, -0.5],
39203
- SW: [-0.5, -0.5]
39202
+ NW: [-HALF, HALF],
39203
+ SE: [HALF, -HALF],
39204
+ SW: [-HALF, -HALF]
39204
39205
  };
39205
39206
  const SW_TRIANGLE = [OFFSET.W, OFFSET.SW, OFFSET.S];
39206
39207
  const SE_TRIANGLE = [OFFSET.S, OFFSET.SE, OFFSET.E];
39207
39208
  const NE_TRIANGLE = [OFFSET.E, OFFSET.NE, OFFSET.N];
39208
39209
  const NW_TRIANGLE = [OFFSET.NW, OFFSET.W, OFFSET.N];
39209
- const SW_TRAPEZOID = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5]];
39210
- const SE_TRAPEZOID = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH]];
39211
- const NE_TRAPEZOID = [[HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
39212
- const NW_TRAPEZOID = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
39210
+ const SW_TRAPEZOID = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF]];
39211
+ const SE_TRAPEZOID = [[-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH]];
39212
+ const NE_TRAPEZOID = [[HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
39213
+ const NW_TRAPEZOID = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
39213
39214
  const S_RECTANGLE = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E];
39214
39215
  const E_RECTANGLE = [OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
39215
39216
  const N_RECTANGLE = [OFFSET.NW, OFFSET.W, OFFSET.E, OFFSET.NE];
39216
39217
  const W_RECTANGLE = [OFFSET.NW, OFFSET.SW, OFFSET.S, OFFSET.N];
39217
- const EW_RECTANGEL = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [HALF, -0.16666666666666666], [HALF, ONE6TH]];
39218
- const SN_RECTANGEL = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
39218
+ const EW_RECTANGEL = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [HALF, -ONE6TH], [HALF, ONE6TH]];
39219
+ const SN_RECTANGEL = [[-ONE6TH, -HALF], [ONE6TH, -HALF], [ONE6TH, HALF], [-ONE6TH, HALF]];
39219
39220
  const SQUARE = [OFFSET.NW, OFFSET.SW, OFFSET.SE, OFFSET.NE];
39220
39221
  const SW_PENTAGON = [OFFSET.NW, OFFSET.SW, OFFSET.SE, OFFSET.E, OFFSET.N];
39221
39222
  const SE_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.NE, OFFSET.N];
39222
39223
  const NE_PENTAGON = [OFFSET.NW, OFFSET.W, OFFSET.S, OFFSET.SE, OFFSET.NE];
39223
39224
  const NW_PENTAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, OFFSET.E, OFFSET.NE];
39224
- const NW_N_PENTAGON = [OFFSET.NW, OFFSET.W, [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
39225
- const NE_E_PENTAGON = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE, OFFSET.N];
39226
- const SE_S_PENTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.E];
39227
- const SW_W_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
39228
- const NW_W_PENTAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.N];
39229
- const NE_N_PENTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.E, OFFSET.NE, OFFSET.N];
39230
- const SE_E_PENTAGON = [OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
39231
- const SW_S_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH]];
39232
- const S_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
39233
- const E_HEXAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
39234
- const N_HEXAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE];
39235
- const W_HEXAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
39225
+ const NW_N_PENTAGON = [OFFSET.NW, OFFSET.W, [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
39226
+ const NE_E_PENTAGON = [[-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE, OFFSET.N];
39227
+ const SE_S_PENTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.E];
39228
+ const SW_W_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [ONE6TH, HALF], [-ONE6TH, HALF]];
39229
+ const NW_W_PENTAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.N];
39230
+ const NE_N_PENTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.E, OFFSET.NE, OFFSET.N];
39231
+ const SE_E_PENTAGON = [OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
39232
+ const SW_S_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH]];
39233
+ const S_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
39234
+ const E_HEXAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
39235
+ const N_HEXAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE];
39236
+ const W_HEXAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
39236
39237
  const SW_NE_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, OFFSET.E, OFFSET.NE, OFFSET.N];
39237
39238
  const NW_SE_HEXAGON = [OFFSET.NW, OFFSET.W, OFFSET.S, OFFSET.SE, OFFSET.E, OFFSET.N];
39238
- const NE_HEPTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE, OFFSET.N];
39239
- const SW_HEPTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
39240
- const NW_HEPTAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
39241
- const SE_HEPTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
39242
- const OCTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
39239
+ const NE_HEPTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE, OFFSET.N];
39240
+ const SW_HEPTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
39241
+ const NW_HEPTAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
39242
+ const SE_HEPTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
39243
+ const OCTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
39243
39244
  const ISOLINES_CODE_OFFSET_MAP = {
39244
39245
  0: [],
39245
39246
  1: [[OFFSET.W, OFFSET.S]],
@@ -40026,7 +40027,7 @@ function requireLong() {
40026
40027
  if (value >= TWO_PWR_64_DBL)
40027
40028
  return MAX_UNSIGNED_VALUE;
40028
40029
  } else {
40029
- if (value <= -9223372036854776e3)
40030
+ if (value <= -TWO_PWR_63_DBL)
40030
40031
  return MIN_VALUE;
40031
40032
  if (value + 1 >= TWO_PWR_63_DBL)
40032
40033
  return MAX_VALUE;
@@ -41642,7 +41643,7 @@ function getOSMTileIndices(viewport, maxZ, zRange, bounds2) {
41642
41643
  if (viewport instanceof WebMercatorViewport2 && viewport.subViewports && viewport.subViewports.length > 1) {
41643
41644
  traversalParams.offset = -1;
41644
41645
  while (root2.update(traversalParams)) {
41645
- if (--traversalParams.offset < -3) {
41646
+ if (--traversalParams.offset < -MAX_MAPS) {
41646
41647
  break;
41647
41648
  }
41648
41649
  }
@@ -44532,7 +44533,7 @@ var libh3 = function(libh32) {
44532
44533
  b[h >> 2] = 0;
44533
44534
  h = h + 4 | 0;
44534
44535
  } while ((h | 0) < (j | 0));
44535
- _b2(c, g3);
44536
+ _b(c, g3);
44536
44537
  h = g3;
44537
44538
  j = b[h >> 2] | 0;
44538
44539
  h = b[h + 4 >> 2] | 0;
@@ -44566,7 +44567,7 @@ var libh3 = function(libh32) {
44566
44567
  b[h >> 2] = 0;
44567
44568
  h = h + 4 | 0;
44568
44569
  } while ((h | 0) < (j | 0));
44569
- _b2(d, g3);
44570
+ _b(d, g3);
44570
44571
  j = g3;
44571
44572
  h = b[j >> 2] | 0;
44572
44573
  j = b[j + 4 >> 2] | 0;
@@ -45707,7 +45708,7 @@ var libh3 = function(libh32) {
45707
45708
  S = k;
45708
45709
  return;
45709
45710
  }
45710
- function _a3(a3, c, d, f2, g3) {
45711
+ function _a2(a3, c, d, f2, g3) {
45711
45712
  a3 = a3 | 0;
45712
45713
  c = c | 0;
45713
45714
  d = d | 0;
@@ -45753,7 +45754,7 @@ var libh3 = function(libh32) {
45753
45754
  S = S + 16 | 0;
45754
45755
  f2 = e3;
45755
45756
  Da(a3 + 4 | 0, f2);
45756
- _a3(f2, b[a3 >> 2] | 0, c, 0, d);
45757
+ _a2(f2, b[a3 >> 2] | 0, c, 0, d);
45757
45758
  S = e3;
45758
45759
  return;
45759
45760
  }
@@ -45865,12 +45866,12 @@ var libh3 = function(libh32) {
45865
45866
  }
45866
45867
  }
45867
45868
  Gc(w3, y2, f2, a3, C4);
45868
- _a3(C4, b[v2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45869
+ _a2(C4, b[v2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45869
45870
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
45870
45871
  }
45871
45872
  if ((j | 0) < (n2 | 0)) {
45872
45873
  Da(t2, v2);
45873
- _a3(v2, b[F2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45874
+ _a2(v2, b[F2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45874
45875
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
45875
45876
  }
45876
45877
  b[E2 >> 2] = b[F2 >> 2];
@@ -46130,13 +46131,13 @@ var libh3 = function(libh32) {
46130
46131
  }
46131
46132
  Gc(A3, s3, f2, a3, w3);
46132
46133
  if (!(Hc(A3, w3) | 0) ? !(Hc(s3, w3) | 0) : 0) {
46133
- _a3(w3, b[x2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
46134
+ _a2(w3, b[x2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
46134
46135
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
46135
46136
  }
46136
46137
  }
46137
46138
  if ((j | 0) < (l2 | 0)) {
46138
46139
  Da(q2, A3);
46139
- _a3(A3, b[z2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
46140
+ _a2(A3, b[z2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
46140
46141
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
46141
46142
  }
46142
46143
  j = j + 1 | 0;
@@ -48464,7 +48465,7 @@ var libh3 = function(libh32) {
48464
48465
  function Zb() {
48465
48466
  return 12;
48466
48467
  }
48467
- function _b2(a3, c) {
48468
+ function _b(a3, c) {
48468
48469
  a3 = a3 | 0;
48469
48470
  c = c | 0;
48470
48471
  var d = 0, e3 = 0, f2 = 0, g3 = 0, h = 0, i2 = 0, j = 0;
@@ -52909,7 +52910,7 @@ var libh3 = function(libh32) {
52909
52910
  _getH3UnidirectionalEdgeBoundary: gc,
52910
52911
  _getH3UnidirectionalEdgesFromHexagon: fc,
52911
52912
  _getOriginH3IndexFromUnidirectionalEdge: bc,
52912
- _getPentagonIndexes: _b2,
52913
+ _getPentagonIndexes: _b,
52913
52914
  _getRes0Indexes: va,
52914
52915
  _h3Distance: qc,
52915
52916
  _h3GetBaseCell: Ab,
@@ -67265,9 +67266,9 @@ var _GeojsonEquality = class _GeojsonEquality2 {
67265
67266
  constructor(opts) {
67266
67267
  this.direction = false;
67267
67268
  this.compareProperties = true;
67268
- var _a3, _b2, _c;
67269
- this.precision = 10 ** -((_a3 = opts == null ? void 0 : opts.precision) != null ? _a3 : 17);
67270
- this.direction = (_b2 = opts == null ? void 0 : opts.direction) != null ? _b2 : false;
67269
+ var _a2, _b, _c;
67270
+ this.precision = 10 ** -((_a2 = opts == null ? void 0 : opts.precision) != null ? _a2 : 17);
67271
+ this.direction = (_b = opts == null ? void 0 : opts.direction) != null ? _b : false;
67271
67272
  this.compareProperties = (_c = opts == null ? void 0 : opts.compareProperties) != null ? _c : true;
67272
67273
  }
67273
67274
  compare(g1, g2) {
@@ -78981,7 +78982,7 @@ var boundsStream$1 = {
78981
78982
  boundsStream$1.lineEnd = boundsLineEnd;
78982
78983
  if (areaRingSum$1 < 0) lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);
78983
78984
  else if (deltaSum > epsilon) phi1 = 90;
78984
- else if (deltaSum < -1e-6) phi0 = -90;
78985
+ else if (deltaSum < -epsilon) phi0 = -90;
78985
78986
  range$3[0] = lambda0$1, range$3[1] = lambda1;
78986
78987
  }
78987
78988
  };
@@ -79491,7 +79492,7 @@ function merge(arrays) {
79491
79492
  }
79492
79493
  return merged;
79493
79494
  }
79494
- var clipMax = 1e9, clipMin = -1e9;
79495
+ var clipMax = 1e9, clipMin = -clipMax;
79495
79496
  function clipExtent(x02, y02, x12, y12) {
79496
79497
  function visible(x, y) {
79497
79498
  return x02 <= x && x <= x12 && y02 <= y && y <= y12;
@@ -79645,7 +79646,7 @@ function polygonContains(polygon2, point2) {
79645
79646
  }
79646
79647
  }
79647
79648
  }
79648
- return (angle2 < -1e-6 || angle2 < epsilon && sum$1 < -1e-6) ^ winding & 1;
79649
+ return (angle2 < -epsilon || angle2 < epsilon && sum$1 < -epsilon) ^ winding & 1;
79649
79650
  }
79650
79651
  var lengthSum$1 = adder(), lambda0, sinPhi0, cosPhi0;
79651
79652
  var lengthStream$1 = {
@@ -81375,16 +81376,16 @@ function requirePolygonClipping_umd() {
81375
81376
  };
81376
81377
  Tree2.prototype.keys = function() {
81377
81378
  var keys = [];
81378
- this.forEach(function(_a3) {
81379
- var key = _a3.key;
81379
+ this.forEach(function(_a2) {
81380
+ var key = _a2.key;
81380
81381
  return keys.push(key);
81381
81382
  });
81382
81383
  return keys;
81383
81384
  };
81384
81385
  Tree2.prototype.values = function() {
81385
81386
  var values2 = [];
81386
- this.forEach(function(_a3) {
81387
- var data = _a3.data;
81387
+ this.forEach(function(_a2) {
81388
+ var data = _a2.data;
81388
81389
  return values2.push(data);
81389
81390
  });
81390
81391
  return values2;
@@ -81539,7 +81540,7 @@ function requirePolygonClipping_umd() {
81539
81540
  };
81540
81541
  Tree2.prototype.update = function(key, newKey, newData) {
81541
81542
  var comparator = this._comparator;
81542
- var _a3 = split(key, this._root, comparator), left = _a3.left, right = _a3.right;
81543
+ var _a2 = split(key, this._root, comparator), left = _a2.left, right = _a2.right;
81543
81544
  if (comparator(key, newKey) < 0) {
81544
81545
  right = insert(newKey, newData, right, comparator);
81545
81546
  } else {
@@ -83031,8 +83032,8 @@ function requireJs$j() {
83031
83032
  if (!featureCollection2 || featureCollection2.type !== "FeatureCollection") {
83032
83033
  throw new Error("Invalid input to " + name2 + ", FeatureCollection required");
83033
83034
  }
83034
- for (var _i = 0, _a3 = featureCollection2.features; _i < _a3.length; _i++) {
83035
- var feature2 = _a3[_i];
83035
+ for (var _i = 0, _a2 = featureCollection2.features; _i < _a2.length; _i++) {
83036
+ var feature2 = _a2[_i];
83036
83037
  if (!feature2 || feature2.type !== "Feature" || !feature2.geometry) {
83037
83038
  throw new Error("Invalid input to " + name2 + ", Feature with geometry required");
83038
83039
  }
@@ -84677,24 +84678,24 @@ function requireBignumber() {
84677
84678
  if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
84678
84679
  v = obj[p];
84679
84680
  if (v && v.pop) {
84680
- intCheck2(v[0], -1e9, 0, p);
84681
+ intCheck2(v[0], -MAX2, 0, p);
84681
84682
  intCheck2(v[1], 0, MAX2, p);
84682
84683
  TO_EXP_NEG = v[0];
84683
84684
  TO_EXP_POS = v[1];
84684
84685
  } else {
84685
- intCheck2(v, -1e9, MAX2, p);
84686
+ intCheck2(v, -MAX2, MAX2, p);
84686
84687
  TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
84687
84688
  }
84688
84689
  }
84689
84690
  if (obj.hasOwnProperty(p = "RANGE")) {
84690
84691
  v = obj[p];
84691
84692
  if (v && v.pop) {
84692
- intCheck2(v[0], -1e9, -1, p);
84693
+ intCheck2(v[0], -MAX2, -1, p);
84693
84694
  intCheck2(v[1], 1, MAX2, p);
84694
84695
  MIN_EXP = v[0];
84695
84696
  MAX_EXP = v[1];
84696
84697
  } else {
84697
- intCheck2(v, -1e9, MAX2, p);
84698
+ intCheck2(v, -MAX2, MAX2, p);
84698
84699
  if (v) {
84699
84700
  MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
84700
84701
  } else {
@@ -84764,7 +84765,7 @@ function requireBignumber() {
84764
84765
  if (!BigNumber3.DEBUG) return true;
84765
84766
  var i2, n2, c = v.c, e2 = v.e, s2 = v.s;
84766
84767
  out: if ({}.toString.call(c) == "[object Array]") {
84767
- if ((s2 === 1 || s2 === -1) && e2 >= -1e9 && e2 <= MAX2 && e2 === mathfloor2(e2)) {
84768
+ if ((s2 === 1 || s2 === -1) && e2 >= -MAX2 && e2 <= MAX2 && e2 === mathfloor2(e2)) {
84768
84769
  if (c[0] === 0) {
84769
84770
  if (e2 === 0 && c.length === 1) return true;
84770
84771
  break out;
@@ -85604,7 +85605,7 @@ function requireBignumber() {
85604
85605
  return n2;
85605
85606
  };
85606
85607
  P.shiftedBy = function(k) {
85607
- intCheck2(k, -9007199254740991, MAX_SAFE_INTEGER2);
85608
+ intCheck2(k, -MAX_SAFE_INTEGER2, MAX_SAFE_INTEGER2);
85608
85609
  return this.times("1e" + k);
85609
85610
  };
85610
85611
  P.squareRoot = P.sqrt = function() {
@@ -85867,26 +85868,25 @@ function requireBignumber() {
85867
85868
  var cjs$9;
85868
85869
  var hasRequiredCjs$a;
85869
85870
  function requireCjs$a() {
85870
- var _a3, _b2, _c, _d;
85871
85871
  if (hasRequiredCjs$a) return cjs$9;
85872
85872
  hasRequiredCjs$a = 1;
85873
- var __defProp3 = Object.defineProperty;
85873
+ var __defProp2 = Object.defineProperty;
85874
85874
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
85875
85875
  var __getOwnPropNames = Object.getOwnPropertyNames;
85876
85876
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
85877
85877
  var __export = (target, all) => {
85878
85878
  for (var name2 in all)
85879
- __defProp3(target, name2, { get: all[name2], enumerable: true });
85879
+ __defProp2(target, name2, { get: all[name2], enumerable: true });
85880
85880
  };
85881
85881
  var __copyProps = (to, from, except, desc) => {
85882
85882
  if (from && typeof from === "object" || typeof from === "function") {
85883
85883
  for (let key of __getOwnPropNames(from))
85884
85884
  if (!__hasOwnProp2.call(to, key) && key !== except)
85885
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
85885
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
85886
85886
  }
85887
85887
  return to;
85888
85888
  };
85889
- var __toCommonJS = (mod2) => __copyProps(__defProp3({}, "__esModule", { value: true }), mod2);
85889
+ var __toCommonJS = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2);
85890
85890
  var src_exports = {};
85891
85891
  __export(src_exports, {
85892
85892
  SplayTreeMap: () => SplayTreeMap,
@@ -85894,10 +85894,10 @@ function requireCjs$a() {
85894
85894
  });
85895
85895
  cjs$9 = __toCommonJS(src_exports);
85896
85896
  var SplayTreeNode2 = class {
85897
+ key;
85898
+ left = null;
85899
+ right = null;
85897
85900
  constructor(key) {
85898
- __publicField(this, "key");
85899
- __publicField(this, "left", null);
85900
- __publicField(this, "right", null);
85901
85901
  this.key = key;
85902
85902
  }
85903
85903
  };
@@ -85907,9 +85907,9 @@ function requireCjs$a() {
85907
85907
  }
85908
85908
  };
85909
85909
  var SplayTreeMapNode = class _SplayTreeMapNode extends SplayTreeNode2 {
85910
+ value;
85910
85911
  constructor(key, value) {
85911
85912
  super(key);
85912
- __publicField(this, "value");
85913
85913
  this.value = value;
85914
85914
  }
85915
85915
  replaceValue(value) {
@@ -85920,11 +85920,9 @@ function requireCjs$a() {
85920
85920
  }
85921
85921
  };
85922
85922
  var SplayTree2 = class {
85923
- constructor() {
85924
- __publicField(this, "size", 0);
85925
- __publicField(this, "modificationCount", 0);
85926
- __publicField(this, "splayCount", 0);
85927
- }
85923
+ size = 0;
85924
+ modificationCount = 0;
85925
+ splayCount = 0;
85928
85926
  splay(key) {
85929
85927
  const root2 = this.root;
85930
85928
  if (root2 == null) {
@@ -86109,12 +86107,11 @@ function requireCjs$a() {
86109
86107
  }
86110
86108
  };
86111
86109
  var SplayTreeMap = class extends SplayTree2 {
86110
+ root = null;
86111
+ compare;
86112
+ validKey;
86112
86113
  constructor(compare2, isValidKey) {
86113
86114
  super();
86114
- __publicField(this, "root", null);
86115
- __publicField(this, "compare");
86116
- __publicField(this, "validKey");
86117
- __publicField(this, _a3, "[object Map]");
86118
86115
  this.compare = compare2 ?? this.defaultCompare();
86119
86116
  this.validKey = isValidKey ?? ((a2) => a2 != null && a2 != void 0);
86120
86117
  }
@@ -86280,17 +86277,17 @@ function requireCjs$a() {
86280
86277
  entries() {
86281
86278
  return this[Symbol.iterator]();
86282
86279
  }
86283
- [(_b2 = Symbol.iterator, _a3 = Symbol.toStringTag, _b2)]() {
86280
+ [Symbol.iterator]() {
86284
86281
  return new SplayTreeMapEntryIterableIterator(this.wrap());
86285
86282
  }
86283
+ [Symbol.toStringTag] = "[object Map]";
86286
86284
  };
86287
86285
  var SplayTreeSet2 = class _SplayTreeSet2 extends SplayTree2 {
86286
+ root = null;
86287
+ compare;
86288
+ validKey;
86288
86289
  constructor(compare2, isValidKey) {
86289
86290
  super();
86290
- __publicField(this, "root", null);
86291
- __publicField(this, "compare");
86292
- __publicField(this, "validKey");
86293
- __publicField(this, _c, "[object Set]");
86294
86291
  this.compare = compare2 ?? this.defaultCompare();
86295
86292
  this.validKey = isValidKey ?? ((v) => v != null && v != void 0);
86296
86293
  }
@@ -86457,16 +86454,17 @@ function requireCjs$a() {
86457
86454
  values() {
86458
86455
  return this[Symbol.iterator]();
86459
86456
  }
86460
- [(_d = Symbol.iterator, _c = Symbol.toStringTag, _d)]() {
86457
+ [Symbol.iterator]() {
86461
86458
  return new SplayTreeKeyIterableIterator2(this.wrap());
86462
86459
  }
86460
+ [Symbol.toStringTag] = "[object Set]";
86463
86461
  };
86464
86462
  var SplayTreeIterableIterator2 = class {
86463
+ tree;
86464
+ path = new Array();
86465
+ modificationCount = null;
86466
+ splayCount;
86465
86467
  constructor(tree) {
86466
- __publicField(this, "tree");
86467
- __publicField(this, "path", new Array());
86468
- __publicField(this, "modificationCount", null);
86469
- __publicField(this, "splayCount");
86470
86468
  this.tree = tree;
86471
86469
  this.splayCount = tree.getSplayCount();
86472
86470
  }
@@ -86585,20 +86583,20 @@ function requireCjs$9() {
86585
86583
  if (hasRequiredCjs$9) return cjs$8;
86586
86584
  hasRequiredCjs$9 = 1;
86587
86585
  var __create = Object.create;
86588
- var __defProp3 = Object.defineProperty;
86586
+ var __defProp2 = Object.defineProperty;
86589
86587
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
86590
86588
  var __getOwnPropNames = Object.getOwnPropertyNames;
86591
86589
  var __getProtoOf = Object.getPrototypeOf;
86592
86590
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
86593
86591
  var __export = (target, all) => {
86594
86592
  for (var name2 in all)
86595
- __defProp3(target, name2, { get: all[name2], enumerable: true });
86593
+ __defProp2(target, name2, { get: all[name2], enumerable: true });
86596
86594
  };
86597
86595
  var __copyProps = (to, from, except, desc) => {
86598
86596
  if (from && typeof from === "object" || typeof from === "function") {
86599
86597
  for (let key of __getOwnPropNames(from))
86600
86598
  if (!__hasOwnProp2.call(to, key) && key !== except)
86601
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
86599
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
86602
86600
  }
86603
86601
  return to;
86604
86602
  };
@@ -86607,10 +86605,10 @@ function requireCjs$9() {
86607
86605
  // file that has been converted to a CommonJS file using a Babel-
86608
86606
  // compatible transform (i.e. "__esModule" has not been set), then set
86609
86607
  // "default" to the CommonJS "module.exports" for node compatibility.
86610
- __defProp3(target, "default", { value: mod2, enumerable: true }),
86608
+ __defProp2(target, "default", { value: mod2, enumerable: true }),
86611
86609
  mod2
86612
86610
  ));
86613
- var __toCommonJS = (mod2) => __copyProps(__defProp3({}, "__esModule", { value: true }), mod2);
86611
+ var __toCommonJS = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2);
86614
86612
  var src_exports = {};
86615
86613
  __export(src_exports, {
86616
86614
  difference: () => difference,
@@ -86730,18 +86728,11 @@ function requireCjs$9() {
86730
86728
  return { x, y };
86731
86729
  };
86732
86730
  var SweepEvent2 = class _SweepEvent2 {
86733
- // Warning: 'point' input will be modified and re-used (for performance)
86734
- constructor(point2, isLeft) {
86735
- __publicField(this, "point");
86736
- __publicField(this, "isLeft");
86737
- __publicField(this, "segment");
86738
- __publicField(this, "otherSE");
86739
- __publicField(this, "consumedBy");
86740
- if (point2.events === void 0) point2.events = [this];
86741
- else point2.events.push(this);
86742
- this.point = point2;
86743
- this.isLeft = isLeft;
86744
- }
86731
+ point;
86732
+ isLeft;
86733
+ segment;
86734
+ otherSE;
86735
+ consumedBy;
86745
86736
  // for ordering sweep events in the sweep event queue
86746
86737
  static compare(a2, b) {
86747
86738
  const ptCmp = _SweepEvent2.comparePoints(a2.point, b.point);
@@ -86758,6 +86749,13 @@ function requireCjs$9() {
86758
86749
  if (aPt.y.isGreaterThan(bPt.y)) return 1;
86759
86750
  return 0;
86760
86751
  }
86752
+ // Warning: 'point' input will be modified and re-used (for performance)
86753
+ constructor(point2, isLeft) {
86754
+ if (point2.events === void 0) point2.events = [this];
86755
+ else point2.events.push(this);
86756
+ this.point = point2;
86757
+ this.isLeft = isLeft;
86758
+ }
86761
86759
  link(other) {
86762
86760
  if (other.point === this.point) {
86763
86761
  throw new Error("Tried to link already linked events");
@@ -86836,17 +86834,10 @@ function requireCjs$9() {
86836
86834
  }
86837
86835
  };
86838
86836
  var RingOut2 = class _RingOut2 {
86839
- constructor(events2) {
86840
- __publicField(this, "events");
86841
- __publicField(this, "poly");
86842
- __publicField(this, "_isExteriorRing");
86843
- __publicField(this, "_enclosingRing");
86844
- this.events = events2;
86845
- for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
86846
- events2[i2].segment.ringOut = this;
86847
- }
86848
- this.poly = null;
86849
- }
86837
+ events;
86838
+ poly;
86839
+ _isExteriorRing;
86840
+ _enclosingRing;
86850
86841
  /* Given the segments from the sweep line pass, compute & return a series
86851
86842
  * of closed rings from all the segments marked to be part of the result */
86852
86843
  static factory(allSegments) {
@@ -86905,6 +86896,13 @@ function requireCjs$9() {
86905
86896
  }
86906
86897
  return ringsOut;
86907
86898
  }
86899
+ constructor(events2) {
86900
+ this.events = events2;
86901
+ for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
86902
+ events2[i2].segment.ringOut = this;
86903
+ }
86904
+ this.poly = null;
86905
+ }
86908
86906
  getGeom() {
86909
86907
  let prevPt = this.events[0].point;
86910
86908
  const points = [prevPt];
@@ -86943,7 +86941,6 @@ function requireCjs$9() {
86943
86941
  }
86944
86942
  /* Returns the ring that encloses this one, if any */
86945
86943
  _calcEnclosingRing() {
86946
- var _a3, _b2;
86947
86944
  let leftMostEvt = this.events[0];
86948
86945
  for (let i2 = 1, iMax = this.events.length; i2 < iMax; i2++) {
86949
86946
  const evt = this.events[i2];
@@ -86955,9 +86952,9 @@ function requireCjs$9() {
86955
86952
  if (!prevSeg) return null;
86956
86953
  if (!prevPrevSeg) return prevSeg.ringOut;
86957
86954
  if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
86958
- if (((_a3 = prevPrevSeg.ringOut) == null ? void 0 : _a3.enclosingRing()) !== prevSeg.ringOut) {
86955
+ if (prevPrevSeg.ringOut?.enclosingRing() !== prevSeg.ringOut) {
86959
86956
  return prevSeg.ringOut;
86960
- } else return (_b2 = prevSeg.ringOut) == null ? void 0 : _b2.enclosingRing();
86957
+ } else return prevSeg.ringOut?.enclosingRing();
86961
86958
  }
86962
86959
  prevSeg = prevPrevSeg.prevInResult();
86963
86960
  prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
@@ -86965,9 +86962,9 @@ function requireCjs$9() {
86965
86962
  }
86966
86963
  };
86967
86964
  var PolyOut2 = class {
86965
+ exteriorRing;
86966
+ interiorRings;
86968
86967
  constructor(exteriorRing) {
86969
- __publicField(this, "exteriorRing");
86970
- __publicField(this, "interiorRings");
86971
86968
  this.exteriorRing = exteriorRing;
86972
86969
  exteriorRing.poly = this;
86973
86970
  this.interiorRings = [];
@@ -86989,9 +86986,9 @@ function requireCjs$9() {
86989
86986
  }
86990
86987
  };
86991
86988
  var MultiPolyOut2 = class {
86989
+ rings;
86990
+ polys;
86992
86991
  constructor(rings) {
86993
- __publicField(this, "rings");
86994
- __publicField(this, "polys");
86995
86992
  this.rings = rings;
86996
86993
  this.polys = this._composePolys(rings);
86997
86994
  }
@@ -87005,7 +87002,6 @@ function requireCjs$9() {
87005
87002
  return geom;
87006
87003
  }
87007
87004
  _composePolys(rings) {
87008
- var _a3;
87009
87005
  const polys = [];
87010
87006
  for (let i2 = 0, iMax = rings.length; i2 < iMax; i2++) {
87011
87007
  const ring = rings[i2];
@@ -87013,8 +87009,8 @@ function requireCjs$9() {
87013
87009
  if (ring.isExteriorRing()) polys.push(new PolyOut2(ring));
87014
87010
  else {
87015
87011
  const enclosingRing = ring.enclosingRing();
87016
- if (!(enclosingRing == null ? void 0 : enclosingRing.poly)) polys.push(new PolyOut2(enclosingRing));
87017
- (_a3 = enclosingRing == null ? void 0 : enclosingRing.poly) == null ? void 0 : _a3.addInterior(ring);
87012
+ if (!enclosingRing?.poly) polys.push(new PolyOut2(enclosingRing));
87013
+ enclosingRing?.poly?.addInterior(ring);
87018
87014
  }
87019
87015
  }
87020
87016
  return polys;
@@ -87022,10 +87018,10 @@ function requireCjs$9() {
87022
87018
  };
87023
87019
  var import_splaytree_ts2 = requireCjs$a();
87024
87020
  var SweepLine2 = class {
87021
+ queue;
87022
+ tree;
87023
+ segments;
87025
87024
  constructor(queue, comparator = Segment3.compare) {
87026
- __publicField(this, "queue");
87027
- __publicField(this, "tree");
87028
- __publicField(this, "segments");
87029
87025
  this.queue = queue;
87030
87026
  this.tree = new import_splaytree_ts2.SplayTreeSet(comparator);
87031
87027
  this.segments = [];
@@ -87134,10 +87130,8 @@ function requireCjs$9() {
87134
87130
  }
87135
87131
  };
87136
87132
  var Operation2 = class {
87137
- constructor() {
87138
- __publicField(this, "type");
87139
- __publicField(this, "numMultiPolys");
87140
- }
87133
+ type;
87134
+ numMultiPolys;
87141
87135
  run(type, geom, moreGeoms) {
87142
87136
  operation2.type = type;
87143
87137
  const multipolys = [new MultiPolyIn2(geom, true)];
@@ -87197,31 +87191,18 @@ function requireCjs$9() {
87197
87191
  var operation_default2 = operation2;
87198
87192
  var segmentId2 = 0;
87199
87193
  var Segment3 = class _Segment2 {
87200
- /* Warning: a reference to ringWindings input will be stored,
87201
- * and possibly will be later modified */
87202
- constructor(leftSE, rightSE, rings, windings) {
87203
- __publicField(this, "id");
87204
- __publicField(this, "leftSE");
87205
- __publicField(this, "rightSE");
87206
- __publicField(this, "rings");
87207
- __publicField(this, "windings");
87208
- __publicField(this, "ringOut");
87209
- __publicField(this, "consumedBy");
87210
- __publicField(this, "prev");
87211
- __publicField(this, "_prevInResult");
87212
- __publicField(this, "_beforeState");
87213
- __publicField(this, "_afterState");
87214
- __publicField(this, "_isInResult");
87215
- this.id = ++segmentId2;
87216
- this.leftSE = leftSE;
87217
- leftSE.segment = this;
87218
- leftSE.otherSE = rightSE;
87219
- this.rightSE = rightSE;
87220
- rightSE.segment = this;
87221
- rightSE.otherSE = leftSE;
87222
- this.rings = rings;
87223
- this.windings = windings;
87224
- }
87194
+ id;
87195
+ leftSE;
87196
+ rightSE;
87197
+ rings;
87198
+ windings;
87199
+ ringOut;
87200
+ consumedBy;
87201
+ prev;
87202
+ _prevInResult;
87203
+ _beforeState;
87204
+ _afterState;
87205
+ _isInResult;
87225
87206
  /* This compare() function is for ordering segments in the sweep
87226
87207
  * line tree, and does so according to the following criteria:
87227
87208
  *
@@ -87293,6 +87274,19 @@ function requireCjs$9() {
87293
87274
  if (a2.id > b.id) return 1;
87294
87275
  return 0;
87295
87276
  }
87277
+ /* Warning: a reference to ringWindings input will be stored,
87278
+ * and possibly will be later modified */
87279
+ constructor(leftSE, rightSE, rings, windings) {
87280
+ this.id = ++segmentId2;
87281
+ this.leftSE = leftSE;
87282
+ leftSE.segment = this;
87283
+ leftSE.otherSE = rightSE;
87284
+ this.rightSE = rightSE;
87285
+ rightSE.segment = this;
87286
+ rightSE.otherSE = leftSE;
87287
+ this.rings = rings;
87288
+ this.windings = windings;
87289
+ }
87296
87290
  static fromRing(pt1, pt2, ring) {
87297
87291
  let leftPt, rightPt, winding;
87298
87292
  const cmpPts = SweepEvent2.comparePoints(pt1, pt2);
@@ -87593,11 +87587,11 @@ function requireCjs$9() {
87593
87587
  }
87594
87588
  };
87595
87589
  var RingIn2 = class {
87590
+ poly;
87591
+ isExterior;
87592
+ segments;
87593
+ bbox;
87596
87594
  constructor(geomRing, poly, isExterior) {
87597
- __publicField(this, "poly");
87598
- __publicField(this, "isExterior");
87599
- __publicField(this, "segments");
87600
- __publicField(this, "bbox");
87601
87595
  if (!Array.isArray(geomRing) || geomRing.length === 0) {
87602
87596
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
87603
87597
  }
@@ -87641,11 +87635,11 @@ function requireCjs$9() {
87641
87635
  }
87642
87636
  };
87643
87637
  var PolyIn2 = class {
87638
+ multiPoly;
87639
+ exteriorRing;
87640
+ interiorRings;
87641
+ bbox;
87644
87642
  constructor(geomPoly, multiPoly) {
87645
- __publicField(this, "multiPoly");
87646
- __publicField(this, "exteriorRing");
87647
- __publicField(this, "interiorRings");
87648
- __publicField(this, "bbox");
87649
87643
  if (!Array.isArray(geomPoly)) {
87650
87644
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
87651
87645
  }
@@ -87677,10 +87671,10 @@ function requireCjs$9() {
87677
87671
  }
87678
87672
  };
87679
87673
  var MultiPolyIn2 = class {
87674
+ isSubject;
87675
+ polys;
87676
+ bbox;
87680
87677
  constructor(geom, isSubject) {
87681
- __publicField(this, "isSubject");
87682
- __publicField(this, "polys");
87683
- __publicField(this, "bbox");
87684
87678
  if (!Array.isArray(geom)) {
87685
87679
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
87686
87680
  }
@@ -88591,9 +88585,9 @@ function requireUtils$2() {
88591
88585
  }
88592
88586
  break;
88593
88587
  case "MultiPolygon":
88594
- for (var _a3 = 0; _a3 < geometry2.coordinates.length; _a3++) {
88595
- for (var b = 0; b < geometry2.coordinates[_a3].length; b++) {
88596
- handles = handles.concat(getEditHandlesForCoordinates(geometry2.coordinates[_a3][b], [_a3, b], featureIndex, editHandleType));
88588
+ for (var _a2 = 0; _a2 < geometry2.coordinates.length; _a2++) {
88589
+ for (var b = 0; b < geometry2.coordinates[_a2].length; b++) {
88590
+ handles = handles.concat(getEditHandlesForCoordinates(geometry2.coordinates[_a2][b], [_a2, b], featureIndex, editHandleType));
88597
88591
  handles = handles.slice(0, -1);
88598
88592
  }
88599
88593
  }
@@ -89713,21 +89707,21 @@ function requireCjs$6() {
89713
89707
  if (hasRequiredCjs$6) return cjs$6;
89714
89708
  hasRequiredCjs$6 = 1;
89715
89709
  Object.defineProperty(cjs$6, "__esModule", { value: true });
89716
- var __defProp3 = Object.defineProperty;
89710
+ var __defProp2 = Object.defineProperty;
89717
89711
  var __defProps2 = Object.defineProperties;
89718
89712
  var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
89719
89713
  var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
89720
89714
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
89721
89715
  var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
89722
- var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
89716
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
89723
89717
  var __spreadValues2 = (a2, b) => {
89724
89718
  for (var prop in b || (b = {}))
89725
89719
  if (__hasOwnProp2.call(b, prop))
89726
- __defNormalProp3(a2, prop, b[prop]);
89720
+ __defNormalProp2(a2, prop, b[prop]);
89727
89721
  if (__getOwnPropSymbols2)
89728
89722
  for (var prop of __getOwnPropSymbols2(b)) {
89729
89723
  if (__propIsEnum2.call(b, prop))
89730
- __defNormalProp3(a2, prop, b[prop]);
89724
+ __defNormalProp2(a2, prop, b[prop]);
89731
89725
  }
89732
89726
  return a2;
89733
89727
  };
@@ -92753,9 +92747,9 @@ function requireExtrudeMode() {
92753
92747
  size = coordinates2[a2][b].length;
92754
92748
  }
92755
92749
  } else {
92756
- var _positionIndexes2 = _slicedToArray(positionIndexes, 1), _b2 = _positionIndexes2[0];
92757
- if (coordinates2.length && coordinates2[_b2].length) {
92758
- size = coordinates2[_b2].length;
92750
+ var _positionIndexes2 = _slicedToArray(positionIndexes, 1), _b = _positionIndexes2[0];
92751
+ if (coordinates2.length && coordinates2[_b].length) {
92752
+ size = coordinates2[_b].length;
92759
92753
  }
92760
92754
  }
92761
92755
  }
@@ -103581,7 +103575,7 @@ class SelectionLayer extends CompositeLayer {
103581
103575
  onSelect: layerOnSelect
103582
103576
  } = obsLayer;
103583
103577
  const pickingInfos = [];
103584
- obsQuadTree == null ? void 0 : obsQuadTree.visit((node, x02, y02, x12, y12) => {
103578
+ obsQuadTree?.visit((node, x02, y02, x12, y12) => {
103585
103579
  const nodePoints = [[[x02, y02], [x12, y02], [x12, y12], [x02, y12], [x02, y02]]];
103586
103580
  const nodePolygon = polygon(nodePoints);
103587
103581
  const nodePolygonContainsSelectedPolygon = booleanContains(nodePolygon, selectedPolygon);
@@ -103724,6 +103718,8 @@ const PIXELATED_TEXTURE_PARAMETERS = {
103724
103718
  [GL$1.TEXTURE_WRAP_T]: GL$1.CLAMP_TO_EDGE
103725
103719
  };
103726
103720
  const GLSL_COLORMAPS = [
103721
+ // NOTE: the ordering of these is important,
103722
+ // as the shader code in bitmask-layer-beta-shaders hardcodes their indices.
103727
103723
  "plasma",
103728
103724
  "viridis",
103729
103725
  "jet",
@@ -104212,13 +104208,12 @@ class HeatmapBitmapLayer extends BitmapLayer$1 {
104212
104208
  });
104213
104209
  }
104214
104210
  updateState(args) {
104215
- var _a3;
104216
104211
  super.updateState(args);
104217
104212
  this.loadTexture(this.props.image);
104218
104213
  const { props, oldProps } = args;
104219
104214
  if (props.colormap !== oldProps.colormap) {
104220
104215
  const { gl } = this.context;
104221
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
104216
+ this.state.model?.delete();
104222
104217
  this.state.model = this._getModel(gl);
104223
104218
  this.getAttributeManager().invalidateAll();
104224
104219
  }
@@ -104638,12 +104633,11 @@ class PaddedExpressionHeatmapBitmapLayer extends BitmapLayer$1 {
104638
104633
  });
104639
104634
  }
104640
104635
  updateState(args) {
104641
- var _a3;
104642
104636
  super.updateState(args);
104643
104637
  const { props, oldProps } = args;
104644
104638
  if (props.colormap !== oldProps.colormap) {
104645
104639
  const { gl } = this.context;
104646
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
104640
+ this.state.model?.delete();
104647
104641
  this.state.model = this._getModel(gl);
104648
104642
  this.getAttributeManager().invalidateAll();
104649
104643
  }
@@ -104769,21 +104763,20 @@ class ScaledExpressionExtension extends LayerExtension {
104769
104763
  };
104770
104764
  }
104771
104765
  updateState({ props, oldProps }) {
104772
- var _a3, _b2, _c, _d;
104773
104766
  if (props.colormap !== oldProps.colormap) {
104774
104767
  const { gl } = this.context;
104775
104768
  if (this.state.model) {
104776
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
104769
+ this.state.model?.delete();
104777
104770
  this.state.model = this._getModel(gl);
104778
104771
  } else {
104779
104772
  if (this.state.models) {
104780
- (_b2 = this.state.models) == null ? void 0 : _b2.forEach((model) => model == null ? void 0 : model.delete());
104773
+ this.state.models?.forEach((model) => model?.delete());
104781
104774
  }
104782
104775
  if (this.state.topModel) {
104783
- (_c = this.state.topModel) == null ? void 0 : _c.delete();
104776
+ this.state.topModel?.delete();
104784
104777
  }
104785
104778
  if (this.state.sideModel) {
104786
- (_d = this.state.sideModel) == null ? void 0 : _d.delete();
104779
+ this.state.sideModel?.delete();
104787
104780
  }
104788
104781
  if (this._getModels) {
104789
104782
  this.setState(this._getModels(this.context.gl));
@@ -104833,10 +104826,10 @@ class ScaledExpressionExtension extends LayerExtension {
104833
104826
  uColorScaleRange: [colorScaleLo, colorScaleHi],
104834
104827
  uIsExpressionMode: isExpressionMode
104835
104828
  };
104836
- model == null ? void 0 : model.setUniforms(uniforms);
104837
- models == null ? void 0 : models.forEach((m) => m.setUniforms(uniforms));
104838
- topModel == null ? void 0 : topModel.setUniforms(uniforms);
104839
- sideModel == null ? void 0 : sideModel.setUniforms(uniforms);
104829
+ model?.setUniforms(uniforms);
104830
+ models?.forEach((m) => m.setUniforms(uniforms));
104831
+ topModel?.setUniforms(uniforms);
104832
+ sideModel?.setUniforms(uniforms);
104840
104833
  }
104841
104834
  }
104842
104835
  ScaledExpressionExtension.extensionName = "ScaledExpressionExtension";
@@ -105575,22 +105568,22 @@ async function getDecoder(fileDirectory) {
105575
105568
  const Decoder = await importFn();
105576
105569
  return new Decoder(fileDirectory);
105577
105570
  }
105578
- addDecoder([void 0, 1], () => import("./raw-DsWQQPj3.js").then((m) => m.default));
105579
- addDecoder(5, () => import("./lzw-DciTuXP7.js").then((m) => m.default));
105571
+ addDecoder([void 0, 1], () => import("./raw-IyVgw_n6.js").then((m) => m.default));
105572
+ addDecoder(5, () => import("./lzw-CbB1fX6w.js").then((m) => m.default));
105580
105573
  addDecoder(6, () => {
105581
105574
  throw new Error("old style JPEG compression is not supported.");
105582
105575
  });
105583
- addDecoder(7, () => import("./jpeg-C1pGAkrD.js").then((m) => m.default));
105584
- addDecoder([8, 32946], () => import("./deflate-CdqU3BKr.js").then((m) => m.default));
105585
- addDecoder(32773, () => import("./packbits-v_UTB8wP.js").then((m) => m.default));
105576
+ addDecoder(7, () => import("./jpeg-DSA7QV1f.js").then((m) => m.default));
105577
+ addDecoder([8, 32946], () => import("./deflate-DOtZ5zRz.js").then((m) => m.default));
105578
+ addDecoder(32773, () => import("./packbits-ZKT7aLa5.js").then((m) => m.default));
105586
105579
  addDecoder(
105587
105580
  34887,
105588
- () => import("./lerc-DJ_lNURz.js").then(async (m) => {
105581
+ () => import("./lerc-DqlV4mq6.js").then(async (m) => {
105589
105582
  await m.zstd.init();
105590
105583
  return m;
105591
105584
  }).then((m) => m.default)
105592
105585
  );
105593
- addDecoder(50001, () => import("./webimage-BnADAK1o.js").then((m) => m.default));
105586
+ addDecoder(50001, () => import("./webimage-BWX8MQDR.js").then((m) => m.default));
105594
105587
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
105595
105588
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
105596
105589
  }
@@ -108967,11 +108960,11 @@ class ZodType {
108967
108960
  throw result.error;
108968
108961
  }
108969
108962
  safeParse(data, params) {
108970
- var _a3;
108963
+ var _a2;
108971
108964
  const ctx = {
108972
108965
  common: {
108973
108966
  issues: [],
108974
- async: (_a3 = params === null || params === void 0 ? void 0 : params.async) !== null && _a3 !== void 0 ? _a3 : false,
108967
+ async: (_a2 = params === null || params === void 0 ? void 0 : params.async) !== null && _a2 !== void 0 ? _a2 : false,
108975
108968
  contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
108976
108969
  },
108977
108970
  path: (params === null || params === void 0 ? void 0 : params.path) || [],
@@ -109313,7 +109306,7 @@ class ZodString extends ZodType {
109313
109306
  } else if (check.kind === "url") {
109314
109307
  try {
109315
109308
  new URL(input.data);
109316
- } catch (_a3) {
109309
+ } catch (_a2) {
109317
109310
  ctx = this._getOrReturnCtx(input, ctx);
109318
109311
  addIssueToContext(ctx, {
109319
109312
  validation: "url",
@@ -109435,7 +109428,7 @@ class ZodString extends ZodType {
109435
109428
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
109436
109429
  }
109437
109430
  datetime(options) {
109438
- var _a3;
109431
+ var _a2;
109439
109432
  if (typeof options === "string") {
109440
109433
  return this._addCheck({
109441
109434
  kind: "datetime",
@@ -109447,7 +109440,7 @@ class ZodString extends ZodType {
109447
109440
  return this._addCheck({
109448
109441
  kind: "datetime",
109449
109442
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
109450
- offset: (_a3 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a3 !== void 0 ? _a3 : false,
109443
+ offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false,
109451
109444
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
109452
109445
  });
109453
109446
  }
@@ -109575,11 +109568,11 @@ class ZodString extends ZodType {
109575
109568
  }
109576
109569
  }
109577
109570
  ZodString.create = (params) => {
109578
- var _a3;
109571
+ var _a2;
109579
109572
  return new ZodString({
109580
109573
  checks: [],
109581
109574
  typeName: ZodFirstPartyTypeKind.ZodString,
109582
- coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
109575
+ coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
109583
109576
  ...processCreateParams(params)
109584
109577
  });
109585
109578
  };
@@ -109980,11 +109973,11 @@ class ZodBigInt extends ZodType {
109980
109973
  }
109981
109974
  }
109982
109975
  ZodBigInt.create = (params) => {
109983
- var _a3;
109976
+ var _a2;
109984
109977
  return new ZodBigInt({
109985
109978
  checks: [],
109986
109979
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
109987
- coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
109980
+ coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
109988
109981
  ...processCreateParams(params)
109989
109982
  });
109990
109983
  };
@@ -110489,8 +110482,8 @@ class ZodObject extends ZodType {
110489
110482
  unknownKeys: "strict",
110490
110483
  ...message !== void 0 ? {
110491
110484
  errorMap: (issue, ctx) => {
110492
- var _a3, _b2, _c, _d;
110493
- const defaultError = (_c = (_b2 = (_a3 = this._def).errorMap) === null || _b2 === void 0 ? void 0 : _b2.call(_a3, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
110485
+ var _a2, _b, _c, _d;
110486
+ const defaultError = (_c = (_b = (_a2 = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a2, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
110494
110487
  if (issue.code === "unrecognized_keys")
110495
110488
  return {
110496
110489
  message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
@@ -117365,9 +117358,8 @@ function isText(node) {
117365
117358
  return node.nodeType === 3;
117366
117359
  }
117367
117360
  function xmlToJson(xmlNode, options) {
117368
- var _a3;
117369
117361
  if (isText(xmlNode)) {
117370
- return ((_a3 = xmlNode.nodeValue) == null ? void 0 : _a3.trim()) ?? "";
117362
+ return xmlNode.nodeValue?.trim() ?? "";
117371
117363
  }
117372
117364
  if (xmlNode.childNodes.length === 0 && (!xmlNode.attributes || xmlNode.attributes.length === 0)) {
117373
117365
  return "";
@@ -117681,14 +117673,13 @@ class TiffPixelSource {
117681
117673
  return this._readRasters(image, { window: window2, width, height, signal });
117682
117674
  }
117683
117675
  async _readRasters(image, props) {
117684
- var _a3;
117685
117676
  const interleave = isInterleaved(this.shape);
117686
117677
  const raster = await image.readRasters({
117687
117678
  interleave,
117688
117679
  ...props,
117689
117680
  pool: this.pool
117690
117681
  });
117691
- if ((_a3 = props == null ? void 0 : props.signal) == null ? void 0 : _a3.aborted) {
117682
+ if (props?.signal?.aborted) {
117692
117683
  throw SIGNAL_ABORTED;
117693
117684
  }
117694
117685
  const data = interleave ? raster : raster[0];
@@ -117961,10 +117952,10 @@ function getIndexer(labels) {
117961
117952
  return selection;
117962
117953
  };
117963
117954
  }
117964
- var __defProp2 = Object.defineProperty;
117965
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
117966
- var __publicField2 = (obj, key, value) => {
117967
- __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
117955
+ var __defProp = Object.defineProperty;
117956
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
117957
+ var __publicField = (obj, key, value) => {
117958
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
117968
117959
  return value;
117969
117960
  };
117970
117961
  const DTYPE_LOOKUP = {
@@ -117986,8 +117977,8 @@ class ZarrPixelSource {
117986
117977
  constructor(data, labels, tileSize) {
117987
117978
  this.labels = labels;
117988
117979
  this.tileSize = tileSize;
117989
- __publicField2(this, "_data");
117990
- __publicField2(this, "_indexer");
117980
+ __publicField(this, "_data");
117981
+ __publicField(this, "_indexer");
117991
117982
  this._indexer = getIndexer(labels);
117992
117983
  this._data = data;
117993
117984
  }
@@ -119563,8 +119554,7 @@ const defaultProps$4$1 = {
119563
119554
  };
119564
119555
  const AdditiveColormapExtension = class extends LayerExtension {
119565
119556
  getShaders() {
119566
- var _a3;
119567
- const name2 = ((_a3 = this == null ? void 0 : this.props) == null ? void 0 : _a3.colormap) || defaultProps$4$1.colormap.value;
119557
+ const name2 = this?.props?.colormap || defaultProps$4$1.colormap.value;
119568
119558
  const apply_cmap = cmaps[name2];
119569
119559
  if (!apply_cmap) {
119570
119560
  throw Error(`No colormap named ${name2} found in registry`);
@@ -119582,7 +119572,6 @@ const AdditiveColormapExtension = class extends LayerExtension {
119582
119572
  }
119583
119573
  }
119584
119574
  draw() {
119585
- var _a3;
119586
119575
  const {
119587
119576
  useTransparentColor = defaultProps$4$1.useTransparentColor.value,
119588
119577
  opacity = defaultProps$4$1.opacity.value
@@ -119591,7 +119580,7 @@ const AdditiveColormapExtension = class extends LayerExtension {
119591
119580
  opacity,
119592
119581
  useTransparentColor
119593
119582
  };
119594
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
119583
+ this.state.model?.setUniforms(uniforms);
119595
119584
  }
119596
119585
  };
119597
119586
  AdditiveColormapExtension.extensionName = "AdditiveColormapExtension";
@@ -119685,7 +119674,6 @@ const ColorPaletteExtension = class extends LayerExtension {
119685
119674
  };
119686
119675
  }
119687
119676
  draw() {
119688
- var _a3;
119689
119677
  const {
119690
119678
  colors,
119691
119679
  channelsVisible,
@@ -119703,7 +119691,7 @@ const ColorPaletteExtension = class extends LayerExtension {
119703
119691
  transparentColor: (transparentColor || [0, 0, 0]).map((i2) => i2 / 255),
119704
119692
  useTransparentColor: Boolean(useTransparentColor)
119705
119693
  };
119706
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
119694
+ this.state.model?.setUniforms(uniforms);
119707
119695
  }
119708
119696
  };
119709
119697
  ColorPaletteExtension.extensionName = "ColorPaletteExtension";
@@ -119852,7 +119840,6 @@ const LensExtension = class extends LayerExtension {
119852
119840
  this.setState({ onMouseMove, unprojectLensBounds: [0, 0, 0, 0] });
119853
119841
  }
119854
119842
  draw() {
119855
- var _a3;
119856
119843
  const { unprojectLensBounds = [0, 0, 0, 0] } = this.state;
119857
119844
  const {
119858
119845
  bounds: bounds2,
@@ -119886,15 +119873,14 @@ const LensExtension = class extends LayerExtension {
119886
119873
  lensBorderRadius,
119887
119874
  colors: paddedColors
119888
119875
  };
119889
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
119876
+ this.state.model?.setUniforms(uniforms);
119890
119877
  }
119891
119878
  finalizeState() {
119892
- var _a3, _b2, _c;
119893
119879
  if (this.context.deck) {
119894
119880
  this.context.deck.eventManager.off({
119895
- pointermove: (_a3 = this.state) == null ? void 0 : _a3.onMouseMove,
119896
- pointerleave: (_b2 = this.state) == null ? void 0 : _b2.onMouseMove,
119897
- wheel: (_c = this.state) == null ? void 0 : _c.onMouseMove
119881
+ pointermove: this.state?.onMouseMove,
119882
+ pointerleave: this.state?.onMouseMove,
119883
+ wheel: this.state?.onMouseMove
119898
119884
  });
119899
119885
  }
119900
119886
  }
@@ -119921,8 +119907,7 @@ const BaseExtension$1 = class BaseExtension extends LayerExtension {
119921
119907
  this.opts = this.opts || {};
119922
119908
  }
119923
119909
  getShaders() {
119924
- var _a3;
119925
- const name2 = ((_a3 = this == null ? void 0 : this.props) == null ? void 0 : _a3.colormap) || defaultProps$1$2.colormap.value;
119910
+ const name2 = this?.props?.colormap || defaultProps$1$2.colormap.value;
119926
119911
  const apply_cmap = cmaps[name2];
119927
119912
  return {
119928
119913
  ...super.getShaders(),
@@ -120036,7 +120021,6 @@ const BaseExtension2 = class extends LayerExtension {
120036
120021
  this.opts = this.opts || {};
120037
120022
  }
120038
120023
  draw() {
120039
- var _a3;
120040
120024
  const { colors, channelsVisible } = this.props;
120041
120025
  const paddedColors = padColors({
120042
120026
  channelsVisible: channelsVisible || this.selections.map(() => true),
@@ -120045,7 +120029,7 @@ const BaseExtension2 = class extends LayerExtension {
120045
120029
  const uniforms = {
120046
120030
  colors: paddedColors
120047
120031
  };
120048
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
120032
+ this.state.model?.setUniforms(uniforms);
120049
120033
  }
120050
120034
  };
120051
120035
  BaseExtension2.extensionName = "BaseExtension";
@@ -120187,9 +120171,8 @@ function padContrastLimits({
120187
120171
  return paddedContrastLimits;
120188
120172
  }
120189
120173
  function getPhysicalSizeScalingMatrix(loader) {
120190
- var _a3;
120191
- const { x, y, z } = ((_a3 = loader == null ? void 0 : loader.meta) == null ? void 0 : _a3.physicalSizes) ?? {};
120192
- if ((x == null ? void 0 : x.size) && (y == null ? void 0 : y.size) && (z == null ? void 0 : z.size)) {
120174
+ const { x, y, z } = loader?.meta?.physicalSizes ?? {};
120175
+ if (x?.size && y?.size && z?.size) {
120193
120176
  const min = Math.min(z.size, x.size, y.size);
120194
120177
  const ratio = [x.size / min, y.size / min, z.size / min];
120195
120178
  return new Matrix4().scale(ratio);
@@ -120416,11 +120399,11 @@ const XRLayer = class extends Layer {
120416
120399
  }
120417
120400
  _isHookDefinedByExtensions(hookName) {
120418
120401
  const { extensions } = this.props;
120419
- return extensions == null ? void 0 : extensions.some((e2) => {
120402
+ return extensions?.some((e2) => {
120420
120403
  const shaders = e2.getShaders();
120421
120404
  const { inject: inject2 = {}, modules = [] } = shaders;
120422
120405
  const definesInjection = inject2[hookName];
120423
- const moduleDefinesInjection = modules.some((m) => m == null ? void 0 : m.inject[hookName]);
120406
+ const moduleDefinesInjection = modules.some((m) => m?.inject[hookName]);
120424
120407
  return definesInjection || moduleDefinesInjection;
120425
120408
  });
120426
120409
  }
@@ -120469,7 +120452,6 @@ const XRLayer = class extends Layer {
120469
120452
  * and loading any textures that need be loading.
120470
120453
  */
120471
120454
  updateState({ props, oldProps, changeFlags, ...rest }) {
120472
- var _a3, _b2;
120473
120455
  super.updateState({ props, oldProps, changeFlags, ...rest });
120474
120456
  if (changeFlags.extensionsChanged || props.interpolation !== oldProps.interpolation) {
120475
120457
  const { gl } = this.context;
@@ -120479,7 +120461,7 @@ const XRLayer = class extends Layer {
120479
120461
  this.setState({ model: this._getModel(gl) });
120480
120462
  this.getAttributeManager().invalidateAll();
120481
120463
  }
120482
- if (props.channelData !== oldProps.channelData && ((_a3 = props.channelData) == null ? void 0 : _a3.data) !== ((_b2 = oldProps.channelData) == null ? void 0 : _b2.data) || props.interpolation !== oldProps.interpolation) {
120464
+ if (props.channelData !== oldProps.channelData && props.channelData?.data !== oldProps.channelData?.data || props.interpolation !== oldProps.interpolation) {
120483
120465
  this.loadChannelTextures(props.channelData);
120484
120466
  }
120485
120467
  const attributeManager = this.getAttributeManager();
@@ -120578,7 +120560,6 @@ const XRLayer = class extends Layer {
120578
120560
  * This function creates textures from the data
120579
120561
  */
120580
120562
  dataToTexture(data, width, height) {
120581
- var _a3;
120582
120563
  const { interpolation } = this.props;
120583
120564
  const attrs = getRenderingAttrs$1(
120584
120565
  this.props.dtype,
@@ -120588,7 +120569,7 @@ const XRLayer = class extends Layer {
120588
120569
  return new Texture2D(this.context.gl, {
120589
120570
  width,
120590
120571
  height,
120591
- data: ((_a3 = attrs.cast) == null ? void 0 : _a3.call(attrs, data)) ?? data,
120572
+ data: attrs.cast?.(data) ?? data,
120592
120573
  // we don't want or need mimaps
120593
120574
  mipmaps: false,
120594
120575
  parameters: {
@@ -120847,11 +120828,10 @@ const ImageLayer = class extends CompositeLayer {
120847
120828
  const getRaster = (selection) => loader.getRaster({ selection, signal });
120848
120829
  const dataPromises = selections.map(getRaster);
120849
120830
  Promise.all(dataPromises).then((rasters) => {
120850
- var _a3, _b2;
120851
120831
  const raster = {
120852
120832
  data: rasters.map((d) => d.data),
120853
- width: (_a3 = rasters[0]) == null ? void 0 : _a3.width,
120854
- height: (_b2 = rasters[0]) == null ? void 0 : _b2.height
120833
+ width: rasters[0]?.width,
120834
+ height: rasters[0]?.height
120855
120835
  };
120856
120836
  if (isInterleaved(loader.shape)) {
120857
120837
  raster.data = raster.data[0];
@@ -121572,13 +121552,13 @@ const XR3DLayer = class extends Layer {
121572
121552
  }
121573
121553
  _isHookDefinedByExtensions(hookName) {
121574
121554
  const { extensions } = this.props;
121575
- return extensions == null ? void 0 : extensions.some((e2) => {
121555
+ return extensions?.some((e2) => {
121576
121556
  const shaders = e2.getShaders();
121577
121557
  if (shaders) {
121578
121558
  const { inject: inject2 = {}, modules = [] } = shaders;
121579
121559
  const definesInjection = inject2[hookName];
121580
121560
  const moduleDefinesInjection = modules.some(
121581
- (m) => m.inject && (m == null ? void 0 : m.inject[hookName])
121561
+ (m) => m.inject && m?.inject[hookName]
121582
121562
  );
121583
121563
  return definesInjection || moduleDefinesInjection;
121584
121564
  }
@@ -121623,7 +121603,6 @@ const XR3DLayer = class extends Layer {
121623
121603
  * and loading any textures that need be loading.
121624
121604
  */
121625
121605
  updateState({ props, oldProps, changeFlags }) {
121626
- var _a3, _b2;
121627
121606
  if (changeFlags.extensionsChanged || props.colormap !== oldProps.colormap || props.renderingMode !== oldProps.renderingMode || props.clippingPlanes.length !== oldProps.clippingPlanes.length) {
121628
121607
  const { gl } = this.context;
121629
121608
  if (this.state.model) {
@@ -121631,7 +121610,7 @@ const XR3DLayer = class extends Layer {
121631
121610
  }
121632
121611
  this.setState({ model: this._getModel(gl) });
121633
121612
  }
121634
- if (props.channelData && ((_a3 = props == null ? void 0 : props.channelData) == null ? void 0 : _a3.data) !== ((_b2 = oldProps == null ? void 0 : oldProps.channelData) == null ? void 0 : _b2.data)) {
121613
+ if (props.channelData && props?.channelData?.data !== oldProps?.channelData?.data) {
121635
121614
  this.loadTexture(props.channelData);
121636
121615
  }
121637
121616
  }
@@ -121752,13 +121731,12 @@ const XR3DLayer = class extends Layer {
121752
121731
  * This function creates textures from the data
121753
121732
  */
121754
121733
  dataToTexture(data, width, height, depth) {
121755
- var _a3;
121756
121734
  const attrs = getRenderingAttrs();
121757
121735
  const texture = new Texture3D(this.context.gl, {
121758
121736
  width,
121759
121737
  height,
121760
121738
  depth,
121761
- data: ((_a3 = attrs.cast) == null ? void 0 : _a3.call(attrs, data)) ?? data,
121739
+ data: attrs.cast?.(data) ?? data,
121762
121740
  // ? Seems to be a luma.gl bug. Looks like Texture2D is wrong or this is but these are flipped somewhere.
121763
121741
  format: attrs.dataFormat,
121764
121742
  dataFormat: attrs.format,
@@ -121931,15 +121909,14 @@ const VolumeLayer = class extends CompositeLayer {
121931
121909
  loader[resolution]
121932
121910
  );
121933
121911
  Promise.all(volumePromises).then((volumes) => {
121934
- var _a3, _b2, _c;
121935
121912
  if (onViewportLoad) {
121936
121913
  onViewportLoad(volumes);
121937
121914
  }
121938
121915
  const volume = {
121939
121916
  data: volumes.map((d) => d.data),
121940
- width: (_a3 = volumes[0]) == null ? void 0 : _a3.width,
121941
- height: (_b2 = volumes[0]) == null ? void 0 : _b2.height,
121942
- depth: (_c = volumes[0]) == null ? void 0 : _c.depth
121917
+ width: volumes[0]?.width,
121918
+ height: volumes[0]?.height,
121919
+ depth: volumes[0]?.depth
121943
121920
  };
121944
121921
  this.setState({
121945
121922
  ...volume,
@@ -122350,7 +122327,7 @@ function toFinite(value) {
122350
122327
  return value === 0 ? value : 0;
122351
122328
  }
122352
122329
  value = toNumber(value);
122353
- if (value === INFINITY || value === -Infinity) {
122330
+ if (value === INFINITY || value === -INFINITY) {
122354
122331
  var sign2 = value < 0 ? -1 : 1;
122355
122332
  return sign2 * MAX_INTEGER;
122356
122333
  }
@@ -122465,7 +122442,7 @@ uniform float channelOpacities[7];
122465
122442
  uniform bool channelIsStaticColorMode[7]; // TODO: should this be a single float?
122466
122443
  uniform bool channelIsSetColorMode[7]; // TODO: should this be a single float?
122467
122444
 
122468
- // TODO: can array of tuples/vec2 be used?
122445
+ uniform int channelColormapFuncIndices[7];
122469
122446
  uniform float channelColormapRangeStarts[7];
122470
122447
  uniform float channelColormapRangeEnds[7];
122471
122448
 
@@ -122531,7 +122508,30 @@ vec3 sampleAndGetData(sampler2D dataTex, vec2 coord, bool isFilled, float stroke
122531
122508
  return vec3(clampedSampledData * float(isOn), sampledData, float(isEdge));
122532
122509
  }
122533
122510
 
122534
- vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
122511
+ vec3 colormapFunc(float clampedScaledExpressionValue, int colormapIndex) {
122512
+ // Map indices of GLSL_COLORMAPS array to their function calls.
122513
+ // GLSL_COLORMAPS is defined in ./constants.js and needs to stay manually synced.
122514
+ // 0: 'plasma',
122515
+ // 1: 'viridis',
122516
+ // 2: 'jet',
122517
+ // 3: 'greys',
122518
+
122519
+ if (colormapIndex <= 0) {
122520
+ // This should also match -1, to account for a failed Array.indexOf lookup.
122521
+ return plasma(clampedScaledExpressionValue).rgb;
122522
+ }
122523
+ if (colormapIndex == 1) {
122524
+ return viridis(clampedScaledExpressionValue).rgb;
122525
+ }
122526
+ if (colormapIndex == 2) {
122527
+ return jet(clampedScaledExpressionValue).rgb;
122528
+ }
122529
+ if (colormapIndex == 3) {
122530
+ return greys(clampedScaledExpressionValue).rgb;
122531
+ }
122532
+ }
122533
+
122534
+ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, int colormapFuncIndex, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
122535
122535
  float clampedSampledDataAndIsOn = sampledDataAndIsEdge.x;
122536
122536
  float sampledData = sampledDataAndIsEdge.y;
122537
122537
  float isEdge = sampledDataAndIsEdge.z;
@@ -122575,7 +122575,7 @@ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channel
122575
122575
  }
122576
122576
 
122577
122577
 
122578
- vec4 sampledColor = (1. - (float(isStaticColorMode) + float(isSetColorMode))) * vec4(COLORMAP_FUNC(clamp(scaledExpressionValue, 0.0, 1.0)).rgb, channelOpacity) + float(isStaticColorMode) * vec4(channelColor.rgb, channelOpacity) + float(isSetColorMode) * vec4(setColor, channelOpacity);
122578
+ vec4 sampledColor = (1. - (float(isStaticColorMode) + float(isSetColorMode))) * vec4(colormapFunc(clamp(scaledExpressionValue, 0.0, 1.0), colormapFuncIndex).rgb, channelOpacity) + float(isStaticColorMode) * vec4(channelColor.rgb, channelOpacity) + float(isSetColorMode) * vec4(setColor, channelOpacity);
122579
122579
  // Only return a color if the data is non-zero.
122580
122580
 
122581
122581
  return clampedSampledDataAndIsOn * isEdge * sampledColor;
@@ -122591,15 +122591,15 @@ void main() {
122591
122591
  vec3 dat4 = sampleAndGetData(channel4, vTexCoord, channelsFilled[4], channelStrokeWidths[4], channelsVisible[4]);
122592
122592
  vec3 dat5 = sampleAndGetData(channel5, vTexCoord, channelsFilled[5], channelStrokeWidths[5], channelsVisible[5]);
122593
122593
  vec3 dat6 = sampleAndGetData(channel6, vTexCoord, channelsFilled[6], channelStrokeWidths[6], channelsVisible[6]);
122594
-
122595
- vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
122596
- vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
122597
- vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
122598
- vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
122599
- vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
122600
- vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
122601
- vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
122602
-
122594
+
122595
+ vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapFuncIndices[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
122596
+ vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapFuncIndices[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
122597
+ vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapFuncIndices[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
122598
+ vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapFuncIndices[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
122599
+ vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapFuncIndices[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
122600
+ vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapFuncIndices[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
122601
+ vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapFuncIndices[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
122602
+
122603
122603
  // If all of the channels are "empty", then discard this pixel so that it is not considered during picking.
122604
122604
  float emptyDat = 0.;
122605
122605
  if(dat0.x == emptyDat && dat1.x == emptyDat && dat2.x == emptyDat && dat3.x == emptyDat && dat4.x == emptyDat && dat5.x == emptyDat && dat6.x == emptyDat) {
@@ -122923,12 +122923,11 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
122923
122923
  let totalValuesLength = 0;
122924
122924
  let totalColorsLength = 0;
122925
122925
  channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
122926
- var _a3, _b2, _c, _d;
122927
122926
  if (isSetColorMode) {
122928
- totalColorsLength += (((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.setColors) == null ? void 0 : _b2.length) ?? 0) * 3;
122929
- totalValuesLength += ((_c = setColorValues[channelIndex]) == null ? void 0 : _c.obsIndex) ? max(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
122927
+ totalColorsLength += (setColorValues[channelIndex]?.setColors?.length ?? 0) * 3;
122928
+ totalValuesLength += setColorValues[channelIndex]?.obsIndex ? max(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
122930
122929
  } else {
122931
- totalValuesLength += multiMatrixObsIndex[channelIndex] ? max(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : ((_d = multiFeatureValues[channelIndex]) == null ? void 0 : _d.length) ?? 0;
122930
+ totalValuesLength += multiMatrixObsIndex[channelIndex] ? max(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : multiFeatureValues[channelIndex]?.length ?? 0;
122932
122931
  }
122933
122932
  });
122934
122933
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
@@ -122970,8 +122969,8 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
122970
122969
  }
122971
122970
  indicesOffsets.push(indexOffset);
122972
122971
  colorsOffsets.push(colorOffset);
122973
- indexOffset += (obsIndex == null ? void 0 : obsIndex.length) || 0;
122974
- colorOffset += (setColors == null ? void 0 : setColors.length) || 0;
122972
+ indexOffset += obsIndex?.length || 0;
122973
+ colorOffset += setColors?.length || 0;
122975
122974
  } else {
122976
122975
  const featureArr = multiFeatureValues[channelIndex] ?? [];
122977
122976
  const normalizedFeatureArr = normalize(featureArr);
@@ -123040,14 +123039,10 @@ const defaultProps$1 = {
123040
123039
  class BitmaskLayer2 extends XRLayer {
123041
123040
  // eslint-disable-next-line class-methods-use-this
123042
123041
  getShaders() {
123043
- const { colormap } = this.props;
123044
123042
  return {
123045
123043
  fs,
123046
123044
  vs,
123047
- modules: [project32, picking],
123048
- defines: {
123049
- [COLORMAP_SHADER_PLACEHOLDER]: GLSL_COLORMAPS.includes(colormap) ? colormap : GLSL_COLORMAP_DEFAULT
123050
- }
123045
+ modules: [project32, picking]
123051
123046
  };
123052
123047
  }
123053
123048
  /**
@@ -123127,8 +123122,6 @@ class BitmaskLayer2 extends XRLayer {
123127
123122
  channelOpacities,
123128
123123
  channelColors,
123129
123124
  channelsVisible,
123130
- // TODO: use `channelFeatureValueColormaps` in shader,
123131
- // figure out how to call multiple GLSL colormap functions
123132
123125
  channelFeatureValueColormaps,
123133
123126
  channelFeatureValueColormapRanges,
123134
123127
  channelIsStaticColorMode,
@@ -123198,14 +123191,20 @@ class BitmaskLayer2 extends XRLayer {
123198
123191
  // There are six texture entries on the shaders
123199
123192
  MAX_CHANNELS - channelStrokeWidths.length
123200
123193
  ),
123194
+ channelColormapFuncIndices: padWithDefault(
123195
+ channelFeatureValueColormaps.map((d) => GLSL_COLORMAPS.indexOf(d)),
123196
+ 0,
123197
+ // There are six texture entries on the shaders
123198
+ MAX_CHANNELS - channelFeatureValueColormaps.length
123199
+ ),
123201
123200
  channelColormapRangeStarts: padWithDefault(
123202
- channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[0]) || 0),
123201
+ channelFeatureValueColormapRanges.map((r2) => r2?.[0] || 0),
123203
123202
  0,
123204
123203
  // There are six texture entries on the shaders
123205
123204
  MAX_CHANNELS - channelFeatureValueColormapRanges.length
123206
123205
  ),
123207
123206
  channelColormapRangeEnds: padWithDefault(
123208
- channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[1]) || 1),
123207
+ channelFeatureValueColormapRanges.map((r2) => r2?.[1] || 1),
123209
123208
  1,
123210
123209
  // There are six texture entries on the shaders
123211
123210
  MAX_CHANNELS - channelFeatureValueColormapRanges.length
@@ -123485,24 +123484,24 @@ function clone(configObject) {
123485
123484
  if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
123486
123485
  v = obj[p];
123487
123486
  if (v && v.pop) {
123488
- intCheck(v[0], -1e9, 0, p);
123487
+ intCheck(v[0], -MAX, 0, p);
123489
123488
  intCheck(v[1], 0, MAX, p);
123490
123489
  TO_EXP_NEG = v[0];
123491
123490
  TO_EXP_POS = v[1];
123492
123491
  } else {
123493
- intCheck(v, -1e9, MAX, p);
123492
+ intCheck(v, -MAX, MAX, p);
123494
123493
  TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
123495
123494
  }
123496
123495
  }
123497
123496
  if (obj.hasOwnProperty(p = "RANGE")) {
123498
123497
  v = obj[p];
123499
123498
  if (v && v.pop) {
123500
- intCheck(v[0], -1e9, -1, p);
123499
+ intCheck(v[0], -MAX, -1, p);
123501
123500
  intCheck(v[1], 1, MAX, p);
123502
123501
  MIN_EXP = v[0];
123503
123502
  MAX_EXP = v[1];
123504
123503
  } else {
123505
- intCheck(v, -1e9, MAX, p);
123504
+ intCheck(v, -MAX, MAX, p);
123506
123505
  if (v) {
123507
123506
  MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
123508
123507
  } else {
@@ -123572,7 +123571,7 @@ function clone(configObject) {
123572
123571
  if (!BigNumber2.DEBUG) return true;
123573
123572
  var i2, n2, c = v.c, e2 = v.e, s2 = v.s;
123574
123573
  out: if ({}.toString.call(c) == "[object Array]") {
123575
- if ((s2 === 1 || s2 === -1) && e2 >= -1e9 && e2 <= MAX && e2 === mathfloor(e2)) {
123574
+ if ((s2 === 1 || s2 === -1) && e2 >= -MAX && e2 <= MAX && e2 === mathfloor(e2)) {
123576
123575
  if (c[0] === 0) {
123577
123576
  if (e2 === 0 && c.length === 1) return true;
123578
123577
  break out;
@@ -124412,7 +124411,7 @@ function clone(configObject) {
124412
124411
  return n2;
124413
124412
  };
124414
124413
  P.shiftedBy = function(k) {
124415
- intCheck(k, -9007199254740991, MAX_SAFE_INTEGER);
124414
+ intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
124416
124415
  return this.times("1e" + k);
124417
124416
  };
124418
124417
  P.squareRoot = P.sqrt = function() {
@@ -124662,10 +124661,10 @@ function toFixedPoint(str, e2, z) {
124662
124661
  }
124663
124662
  var BigNumber = clone();
124664
124663
  var SplayTreeNode = class {
124664
+ key;
124665
+ left = null;
124666
+ right = null;
124665
124667
  constructor(key) {
124666
- __publicField(this, "key");
124667
- __publicField(this, "left", null);
124668
- __publicField(this, "right", null);
124669
124668
  this.key = key;
124670
124669
  }
124671
124670
  };
@@ -124675,11 +124674,9 @@ var SplayTreeSetNode = class extends SplayTreeNode {
124675
124674
  }
124676
124675
  };
124677
124676
  var SplayTree = class {
124678
- constructor() {
124679
- __publicField(this, "size", 0);
124680
- __publicField(this, "modificationCount", 0);
124681
- __publicField(this, "splayCount", 0);
124682
- }
124677
+ size = 0;
124678
+ modificationCount = 0;
124679
+ splayCount = 0;
124683
124680
  splay(key) {
124684
124681
  const root2 = this.root;
124685
124682
  if (root2 == null) {
@@ -124864,12 +124861,11 @@ var SplayTree = class {
124864
124861
  }
124865
124862
  };
124866
124863
  var SplayTreeSet = class _SplayTreeSet extends SplayTree {
124864
+ root = null;
124865
+ compare;
124866
+ validKey;
124867
124867
  constructor(compare2, isValidKey) {
124868
124868
  super();
124869
- __publicField(this, "root", null);
124870
- __publicField(this, "compare");
124871
- __publicField(this, "validKey");
124872
- __publicField(this, _a2, "[object Set]");
124873
124869
  this.compare = compare2 ?? this.defaultCompare();
124874
124870
  this.validKey = isValidKey ?? ((v) => v != null && v != void 0);
124875
124871
  }
@@ -125036,16 +125032,17 @@ var SplayTreeSet = class _SplayTreeSet extends SplayTree {
125036
125032
  values() {
125037
125033
  return this[Symbol.iterator]();
125038
125034
  }
125039
- [(_b = Symbol.iterator, _a2 = Symbol.toStringTag, _b)]() {
125035
+ [Symbol.iterator]() {
125040
125036
  return new SplayTreeKeyIterableIterator(this.wrap());
125041
125037
  }
125038
+ [Symbol.toStringTag] = "[object Set]";
125042
125039
  };
125043
125040
  var SplayTreeIterableIterator = class {
125041
+ tree;
125042
+ path = new Array();
125043
+ modificationCount = null;
125044
+ splayCount;
125044
125045
  constructor(tree) {
125045
- __publicField(this, "tree");
125046
- __publicField(this, "path", new Array());
125047
- __publicField(this, "modificationCount", null);
125048
- __publicField(this, "splayCount");
125049
125046
  this.tree = tree;
125050
125047
  this.splayCount = tree.getSplayCount();
125051
125048
  }
@@ -125222,18 +125219,11 @@ var intersection = (pt1, v12, pt2, v2) => {
125222
125219
  return { x, y };
125223
125220
  };
125224
125221
  var SweepEvent = class _SweepEvent {
125225
- // Warning: 'point' input will be modified and re-used (for performance)
125226
- constructor(point2, isLeft) {
125227
- __publicField(this, "point");
125228
- __publicField(this, "isLeft");
125229
- __publicField(this, "segment");
125230
- __publicField(this, "otherSE");
125231
- __publicField(this, "consumedBy");
125232
- if (point2.events === void 0) point2.events = [this];
125233
- else point2.events.push(this);
125234
- this.point = point2;
125235
- this.isLeft = isLeft;
125236
- }
125222
+ point;
125223
+ isLeft;
125224
+ segment;
125225
+ otherSE;
125226
+ consumedBy;
125237
125227
  // for ordering sweep events in the sweep event queue
125238
125228
  static compare(a2, b) {
125239
125229
  const ptCmp = _SweepEvent.comparePoints(a2.point, b.point);
@@ -125250,6 +125240,13 @@ var SweepEvent = class _SweepEvent {
125250
125240
  if (aPt.y.isGreaterThan(bPt.y)) return 1;
125251
125241
  return 0;
125252
125242
  }
125243
+ // Warning: 'point' input will be modified and re-used (for performance)
125244
+ constructor(point2, isLeft) {
125245
+ if (point2.events === void 0) point2.events = [this];
125246
+ else point2.events.push(this);
125247
+ this.point = point2;
125248
+ this.isLeft = isLeft;
125249
+ }
125253
125250
  link(other) {
125254
125251
  if (other.point === this.point) {
125255
125252
  throw new Error("Tried to link already linked events");
@@ -125328,17 +125325,10 @@ var SweepEvent = class _SweepEvent {
125328
125325
  }
125329
125326
  };
125330
125327
  var RingOut = class _RingOut {
125331
- constructor(events2) {
125332
- __publicField(this, "events");
125333
- __publicField(this, "poly");
125334
- __publicField(this, "_isExteriorRing");
125335
- __publicField(this, "_enclosingRing");
125336
- this.events = events2;
125337
- for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
125338
- events2[i2].segment.ringOut = this;
125339
- }
125340
- this.poly = null;
125341
- }
125328
+ events;
125329
+ poly;
125330
+ _isExteriorRing;
125331
+ _enclosingRing;
125342
125332
  /* Given the segments from the sweep line pass, compute & return a series
125343
125333
  * of closed rings from all the segments marked to be part of the result */
125344
125334
  static factory(allSegments) {
@@ -125397,6 +125387,13 @@ var RingOut = class _RingOut {
125397
125387
  }
125398
125388
  return ringsOut;
125399
125389
  }
125390
+ constructor(events2) {
125391
+ this.events = events2;
125392
+ for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
125393
+ events2[i2].segment.ringOut = this;
125394
+ }
125395
+ this.poly = null;
125396
+ }
125400
125397
  getGeom() {
125401
125398
  let prevPt = this.events[0].point;
125402
125399
  const points = [prevPt];
@@ -125435,7 +125432,6 @@ var RingOut = class _RingOut {
125435
125432
  }
125436
125433
  /* Returns the ring that encloses this one, if any */
125437
125434
  _calcEnclosingRing() {
125438
- var _a3, _b2;
125439
125435
  let leftMostEvt = this.events[0];
125440
125436
  for (let i2 = 1, iMax = this.events.length; i2 < iMax; i2++) {
125441
125437
  const evt = this.events[i2];
@@ -125447,9 +125443,9 @@ var RingOut = class _RingOut {
125447
125443
  if (!prevSeg) return null;
125448
125444
  if (!prevPrevSeg) return prevSeg.ringOut;
125449
125445
  if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
125450
- if (((_a3 = prevPrevSeg.ringOut) == null ? void 0 : _a3.enclosingRing()) !== prevSeg.ringOut) {
125446
+ if (prevPrevSeg.ringOut?.enclosingRing() !== prevSeg.ringOut) {
125451
125447
  return prevSeg.ringOut;
125452
- } else return (_b2 = prevSeg.ringOut) == null ? void 0 : _b2.enclosingRing();
125448
+ } else return prevSeg.ringOut?.enclosingRing();
125453
125449
  }
125454
125450
  prevSeg = prevPrevSeg.prevInResult();
125455
125451
  prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
@@ -125457,9 +125453,9 @@ var RingOut = class _RingOut {
125457
125453
  }
125458
125454
  };
125459
125455
  var PolyOut = class {
125456
+ exteriorRing;
125457
+ interiorRings;
125460
125458
  constructor(exteriorRing) {
125461
- __publicField(this, "exteriorRing");
125462
- __publicField(this, "interiorRings");
125463
125459
  this.exteriorRing = exteriorRing;
125464
125460
  exteriorRing.poly = this;
125465
125461
  this.interiorRings = [];
@@ -125481,9 +125477,9 @@ var PolyOut = class {
125481
125477
  }
125482
125478
  };
125483
125479
  var MultiPolyOut = class {
125480
+ rings;
125481
+ polys;
125484
125482
  constructor(rings) {
125485
- __publicField(this, "rings");
125486
- __publicField(this, "polys");
125487
125483
  this.rings = rings;
125488
125484
  this.polys = this._composePolys(rings);
125489
125485
  }
@@ -125497,7 +125493,6 @@ var MultiPolyOut = class {
125497
125493
  return geom;
125498
125494
  }
125499
125495
  _composePolys(rings) {
125500
- var _a3;
125501
125496
  const polys = [];
125502
125497
  for (let i2 = 0, iMax = rings.length; i2 < iMax; i2++) {
125503
125498
  const ring = rings[i2];
@@ -125505,18 +125500,18 @@ var MultiPolyOut = class {
125505
125500
  if (ring.isExteriorRing()) polys.push(new PolyOut(ring));
125506
125501
  else {
125507
125502
  const enclosingRing = ring.enclosingRing();
125508
- if (!(enclosingRing == null ? void 0 : enclosingRing.poly)) polys.push(new PolyOut(enclosingRing));
125509
- (_a3 = enclosingRing == null ? void 0 : enclosingRing.poly) == null ? void 0 : _a3.addInterior(ring);
125503
+ if (!enclosingRing?.poly) polys.push(new PolyOut(enclosingRing));
125504
+ enclosingRing?.poly?.addInterior(ring);
125510
125505
  }
125511
125506
  }
125512
125507
  return polys;
125513
125508
  }
125514
125509
  };
125515
125510
  var SweepLine = class {
125511
+ queue;
125512
+ tree;
125513
+ segments;
125516
125514
  constructor(queue, comparator = Segment2.compare) {
125517
- __publicField(this, "queue");
125518
- __publicField(this, "tree");
125519
- __publicField(this, "segments");
125520
125515
  this.queue = queue;
125521
125516
  this.tree = new SplayTreeSet(comparator);
125522
125517
  this.segments = [];
@@ -125625,10 +125620,8 @@ var SweepLine = class {
125625
125620
  }
125626
125621
  };
125627
125622
  var Operation = class {
125628
- constructor() {
125629
- __publicField(this, "type");
125630
- __publicField(this, "numMultiPolys");
125631
- }
125623
+ type;
125624
+ numMultiPolys;
125632
125625
  run(type, geom, moreGeoms) {
125633
125626
  operation.type = type;
125634
125627
  const multipolys = [new MultiPolyIn(geom, true)];
@@ -125688,31 +125681,18 @@ var operation = new Operation();
125688
125681
  var operation_default = operation;
125689
125682
  var segmentId = 0;
125690
125683
  var Segment2 = class _Segment {
125691
- /* Warning: a reference to ringWindings input will be stored,
125692
- * and possibly will be later modified */
125693
- constructor(leftSE, rightSE, rings, windings) {
125694
- __publicField(this, "id");
125695
- __publicField(this, "leftSE");
125696
- __publicField(this, "rightSE");
125697
- __publicField(this, "rings");
125698
- __publicField(this, "windings");
125699
- __publicField(this, "ringOut");
125700
- __publicField(this, "consumedBy");
125701
- __publicField(this, "prev");
125702
- __publicField(this, "_prevInResult");
125703
- __publicField(this, "_beforeState");
125704
- __publicField(this, "_afterState");
125705
- __publicField(this, "_isInResult");
125706
- this.id = ++segmentId;
125707
- this.leftSE = leftSE;
125708
- leftSE.segment = this;
125709
- leftSE.otherSE = rightSE;
125710
- this.rightSE = rightSE;
125711
- rightSE.segment = this;
125712
- rightSE.otherSE = leftSE;
125713
- this.rings = rings;
125714
- this.windings = windings;
125715
- }
125684
+ id;
125685
+ leftSE;
125686
+ rightSE;
125687
+ rings;
125688
+ windings;
125689
+ ringOut;
125690
+ consumedBy;
125691
+ prev;
125692
+ _prevInResult;
125693
+ _beforeState;
125694
+ _afterState;
125695
+ _isInResult;
125716
125696
  /* This compare() function is for ordering segments in the sweep
125717
125697
  * line tree, and does so according to the following criteria:
125718
125698
  *
@@ -125784,6 +125764,19 @@ var Segment2 = class _Segment {
125784
125764
  if (a2.id > b.id) return 1;
125785
125765
  return 0;
125786
125766
  }
125767
+ /* Warning: a reference to ringWindings input will be stored,
125768
+ * and possibly will be later modified */
125769
+ constructor(leftSE, rightSE, rings, windings) {
125770
+ this.id = ++segmentId;
125771
+ this.leftSE = leftSE;
125772
+ leftSE.segment = this;
125773
+ leftSE.otherSE = rightSE;
125774
+ this.rightSE = rightSE;
125775
+ rightSE.segment = this;
125776
+ rightSE.otherSE = leftSE;
125777
+ this.rings = rings;
125778
+ this.windings = windings;
125779
+ }
125787
125780
  static fromRing(pt1, pt2, ring) {
125788
125781
  let leftPt, rightPt, winding;
125789
125782
  const cmpPts = SweepEvent.comparePoints(pt1, pt2);
@@ -126084,11 +126077,11 @@ var Segment2 = class _Segment {
126084
126077
  }
126085
126078
  };
126086
126079
  var RingIn = class {
126080
+ poly;
126081
+ isExterior;
126082
+ segments;
126083
+ bbox;
126087
126084
  constructor(geomRing, poly, isExterior) {
126088
- __publicField(this, "poly");
126089
- __publicField(this, "isExterior");
126090
- __publicField(this, "segments");
126091
- __publicField(this, "bbox");
126092
126085
  if (!Array.isArray(geomRing) || geomRing.length === 0) {
126093
126086
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
126094
126087
  }
@@ -126132,11 +126125,11 @@ var RingIn = class {
126132
126125
  }
126133
126126
  };
126134
126127
  var PolyIn = class {
126128
+ multiPoly;
126129
+ exteriorRing;
126130
+ interiorRings;
126131
+ bbox;
126135
126132
  constructor(geomPoly, multiPoly) {
126136
- __publicField(this, "multiPoly");
126137
- __publicField(this, "exteriorRing");
126138
- __publicField(this, "interiorRings");
126139
- __publicField(this, "bbox");
126140
126133
  if (!Array.isArray(geomPoly)) {
126141
126134
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
126142
126135
  }
@@ -126168,10 +126161,10 @@ var PolyIn = class {
126168
126161
  }
126169
126162
  };
126170
126163
  var MultiPolyIn = class {
126164
+ isSubject;
126165
+ polys;
126166
+ bbox;
126171
126167
  constructor(geom, isSubject) {
126172
- __publicField(this, "isSubject");
126173
- __publicField(this, "polys");
126174
- __publicField(this, "bbox");
126175
126168
  if (!Array.isArray(geom)) {
126176
126169
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
126177
126170
  }
@@ -126333,17 +126326,17 @@ function getMaxAreaPolygon(levelToUse) {
126333
126326
  return [maxAreaValue, maxAreaPolygon];
126334
126327
  }
126335
126328
  function getMaxAreaPolygonAndLevel(contourPolygons) {
126336
- const l2 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 2)) ?? [];
126329
+ const l2 = contourPolygons?.filter((d) => d.contour.i === 2) ?? [];
126337
126330
  const [l2area, l2polygon] = getMaxAreaPolygon(l2);
126338
126331
  if (Math.log10(l2area) >= MIN_AREA_THRESHOLD) {
126339
126332
  return [l2area, l2polygon, 2];
126340
126333
  }
126341
- const l1 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 1)) ?? [];
126334
+ const l1 = contourPolygons?.filter((d) => d.contour.i === 1) ?? [];
126342
126335
  const [l1area, l1polygon] = getMaxAreaPolygon(l1);
126343
126336
  if (Math.log10(l1area) >= MIN_AREA_THRESHOLD) {
126344
126337
  return [l1area, l1polygon, 1];
126345
126338
  }
126346
- const l0 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 0)) ?? [];
126339
+ const l0 = contourPolygons?.filter((d) => d.contour.i === 0) ?? [];
126347
126340
  const [l0area, l0polygon] = getMaxAreaPolygon(l0);
126348
126341
  return [l0area, l0polygon, 0];
126349
126342
  }
@@ -126359,7 +126352,7 @@ class ContourLayerWithText extends ContourLayer {
126359
126352
  if (!circleInfo) {
126360
126353
  return lineAndTextLayers;
126361
126354
  }
126362
- const obsSetName = obsSetPath == null ? void 0 : obsSetPath.at(-1);
126355
+ const obsSetName = obsSetPath?.at(-1);
126363
126356
  const [maxAreaValue, maxAreaPolygon, levelI] = getMaxAreaPolygonAndLevel(contourPolygons);
126364
126357
  const { center, steps, polygon: circlePolygon } = circleInfo;
126365
126358
  if (maxAreaValue > 0 && maxAreaPolygon) {