@vitessce/ome-tiff 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 "react";
6
2
  function _mergeNamespaces(n3, m) {
7
3
  for (var i2 = 0; i2 < m.length; i2++) {
@@ -17360,8 +17356,8 @@ function fitBounds(options) {
17360
17356
  } = options;
17361
17357
  const [[west, south], [east, north]] = bounds2;
17362
17358
  const padding = getPaddingObject(options.padding);
17363
- const nw = lngLatToWorld([west, clamp$2(north, -85.051129, MAX_LATITUDE)]);
17364
- const se = lngLatToWorld([east, clamp$2(south, -85.051129, MAX_LATITUDE)]);
17359
+ const nw = lngLatToWorld([west, clamp$2(north, -MAX_LATITUDE, MAX_LATITUDE)]);
17360
+ const se = lngLatToWorld([east, clamp$2(south, -MAX_LATITUDE, MAX_LATITUDE)]);
17365
17361
  const size2 = [Math.max(Math.abs(se[0] - nw[0]), minExtent), Math.max(Math.abs(se[1] - nw[1]), minExtent)];
17366
17362
  const targetSize = [width - padding.left - padding.right - Math.abs(offset[0]) * 2, height - padding.top - padding.bottom - Math.abs(offset[1]) * 2];
17367
17363
  assert$6(targetSize[0] > 0 && targetSize[1] > 0);
@@ -23377,7 +23373,12 @@ function getAugmentedNamespace(n3) {
23377
23373
  var f2 = n3.default;
23378
23374
  if (typeof f2 == "function") {
23379
23375
  var a2 = function a3() {
23380
- if (this instanceof a3) {
23376
+ var isInstance = false;
23377
+ try {
23378
+ isInstance = this instanceof a3;
23379
+ } catch {
23380
+ }
23381
+ if (isInstance) {
23381
23382
  return Reflect.construct(f2, arguments, this.constructor);
23382
23383
  }
23383
23384
  return f2.apply(this, arguments);
@@ -35739,7 +35740,7 @@ function requireTinySdf() {
35739
35740
  function edt1d(grid, offset, stride, length2, f2, v, z) {
35740
35741
  var q, k, s2, r2;
35741
35742
  v[0] = 0;
35742
- z[0] = -1e20;
35743
+ z[0] = -INF;
35743
35744
  z[1] = INF;
35744
35745
  for (q = 0; q < length2; q++) f2[q] = grid[offset + q * stride];
35745
35746
  for (q = 1, k = 0, s2 = 0; q < length2; q++) {
@@ -38899,51 +38900,51 @@ const ONE6TH = 1 / 6;
38899
38900
  const OFFSET = {
38900
38901
  N: [0, HALF],
38901
38902
  E: [HALF, 0],
38902
- S: [0, -0.5],
38903
- W: [-0.5, 0],
38903
+ S: [0, -HALF],
38904
+ W: [-HALF, 0],
38904
38905
  NE: [HALF, HALF],
38905
- NW: [-0.5, HALF],
38906
- SE: [HALF, -0.5],
38907
- SW: [-0.5, -0.5]
38906
+ NW: [-HALF, HALF],
38907
+ SE: [HALF, -HALF],
38908
+ SW: [-HALF, -HALF]
38908
38909
  };
38909
38910
  const SW_TRIANGLE = [OFFSET.W, OFFSET.SW, OFFSET.S];
38910
38911
  const SE_TRIANGLE = [OFFSET.S, OFFSET.SE, OFFSET.E];
38911
38912
  const NE_TRIANGLE = [OFFSET.E, OFFSET.NE, OFFSET.N];
38912
38913
  const NW_TRIANGLE = [OFFSET.NW, OFFSET.W, OFFSET.N];
38913
- const SW_TRAPEZOID = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5]];
38914
- const SE_TRAPEZOID = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH]];
38915
- const NE_TRAPEZOID = [[HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
38916
- const NW_TRAPEZOID = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
38914
+ const SW_TRAPEZOID = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF]];
38915
+ const SE_TRAPEZOID = [[-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH]];
38916
+ const NE_TRAPEZOID = [[HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
38917
+ const NW_TRAPEZOID = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
38917
38918
  const S_RECTANGLE = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E];
38918
38919
  const E_RECTANGLE = [OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
38919
38920
  const N_RECTANGLE = [OFFSET.NW, OFFSET.W, OFFSET.E, OFFSET.NE];
38920
38921
  const W_RECTANGLE = [OFFSET.NW, OFFSET.SW, OFFSET.S, OFFSET.N];
38921
- const EW_RECTANGEL = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [HALF, -0.16666666666666666], [HALF, ONE6TH]];
38922
- const SN_RECTANGEL = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
38922
+ const EW_RECTANGEL = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [HALF, -ONE6TH], [HALF, ONE6TH]];
38923
+ const SN_RECTANGEL = [[-ONE6TH, -HALF], [ONE6TH, -HALF], [ONE6TH, HALF], [-ONE6TH, HALF]];
38923
38924
  const SQUARE = [OFFSET.NW, OFFSET.SW, OFFSET.SE, OFFSET.NE];
38924
38925
  const SW_PENTAGON = [OFFSET.NW, OFFSET.SW, OFFSET.SE, OFFSET.E, OFFSET.N];
38925
38926
  const SE_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.NE, OFFSET.N];
38926
38927
  const NE_PENTAGON = [OFFSET.NW, OFFSET.W, OFFSET.S, OFFSET.SE, OFFSET.NE];
38927
38928
  const NW_PENTAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, OFFSET.E, OFFSET.NE];
38928
- const NW_N_PENTAGON = [OFFSET.NW, OFFSET.W, [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
38929
- const NE_E_PENTAGON = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE, OFFSET.N];
38930
- const SE_S_PENTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.E];
38931
- const SW_W_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
38932
- const NW_W_PENTAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.N];
38933
- const NE_N_PENTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.E, OFFSET.NE, OFFSET.N];
38934
- const SE_E_PENTAGON = [OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
38935
- const SW_S_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH]];
38936
- const S_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
38937
- const E_HEXAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
38938
- const N_HEXAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE];
38939
- const W_HEXAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
38929
+ const NW_N_PENTAGON = [OFFSET.NW, OFFSET.W, [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
38930
+ const NE_E_PENTAGON = [[-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE, OFFSET.N];
38931
+ const SE_S_PENTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.E];
38932
+ const SW_W_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [ONE6TH, HALF], [-ONE6TH, HALF]];
38933
+ const NW_W_PENTAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.N];
38934
+ const NE_N_PENTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.E, OFFSET.NE, OFFSET.N];
38935
+ const SE_E_PENTAGON = [OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
38936
+ const SW_S_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH]];
38937
+ const S_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
38938
+ const E_HEXAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
38939
+ const N_HEXAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE];
38940
+ const W_HEXAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
38940
38941
  const SW_NE_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, OFFSET.E, OFFSET.NE, OFFSET.N];
38941
38942
  const NW_SE_HEXAGON = [OFFSET.NW, OFFSET.W, OFFSET.S, OFFSET.SE, OFFSET.E, OFFSET.N];
38942
- const NE_HEPTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE, OFFSET.N];
38943
- const SW_HEPTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
38944
- const NW_HEPTAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
38945
- const SE_HEPTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
38946
- 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]];
38943
+ const NE_HEPTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE, OFFSET.N];
38944
+ const SW_HEPTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
38945
+ const NW_HEPTAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
38946
+ const SE_HEPTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
38947
+ const OCTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
38947
38948
  const ISOLINES_CODE_OFFSET_MAP = {
38948
38949
  0: [],
38949
38950
  1: [[OFFSET.W, OFFSET.S]],
@@ -39730,7 +39731,7 @@ function requireLong() {
39730
39731
  if (value >= TWO_PWR_64_DBL)
39731
39732
  return MAX_UNSIGNED_VALUE;
39732
39733
  } else {
39733
- if (value <= -9223372036854776e3)
39734
+ if (value <= -TWO_PWR_63_DBL)
39734
39735
  return MIN_VALUE;
39735
39736
  if (value + 1 >= TWO_PWR_63_DBL)
39736
39737
  return MAX_VALUE;
@@ -41346,7 +41347,7 @@ function getOSMTileIndices(viewport, maxZ, zRange, bounds2) {
41346
41347
  if (viewport instanceof WebMercatorViewport2 && viewport.subViewports && viewport.subViewports.length > 1) {
41347
41348
  traversalParams.offset = -1;
41348
41349
  while (root2.update(traversalParams)) {
41349
- if (--traversalParams.offset < -3) {
41350
+ if (--traversalParams.offset < -MAX_MAPS) {
41350
41351
  break;
41351
41352
  }
41352
41353
  }
@@ -44236,7 +44237,7 @@ var libh3 = function(libh32) {
44236
44237
  b[h >> 2] = 0;
44237
44238
  h = h + 4 | 0;
44238
44239
  } while ((h | 0) < (j | 0));
44239
- _b2(c, g3);
44240
+ _b(c, g3);
44240
44241
  h = g3;
44241
44242
  j = b[h >> 2] | 0;
44242
44243
  h = b[h + 4 >> 2] | 0;
@@ -44270,7 +44271,7 @@ var libh3 = function(libh32) {
44270
44271
  b[h >> 2] = 0;
44271
44272
  h = h + 4 | 0;
44272
44273
  } while ((h | 0) < (j | 0));
44273
- _b2(d, g3);
44274
+ _b(d, g3);
44274
44275
  j = g3;
44275
44276
  h = b[j >> 2] | 0;
44276
44277
  j = b[j + 4 >> 2] | 0;
@@ -45411,7 +45412,7 @@ var libh3 = function(libh32) {
45411
45412
  S = k;
45412
45413
  return;
45413
45414
  }
45414
- function _a3(a3, c, d, f2, g3) {
45415
+ function _a2(a3, c, d, f2, g3) {
45415
45416
  a3 = a3 | 0;
45416
45417
  c = c | 0;
45417
45418
  d = d | 0;
@@ -45457,7 +45458,7 @@ var libh3 = function(libh32) {
45457
45458
  S = S + 16 | 0;
45458
45459
  f2 = e3;
45459
45460
  Da(a3 + 4 | 0, f2);
45460
- _a3(f2, b[a3 >> 2] | 0, c, 0, d);
45461
+ _a2(f2, b[a3 >> 2] | 0, c, 0, d);
45461
45462
  S = e3;
45462
45463
  return;
45463
45464
  }
@@ -45569,12 +45570,12 @@ var libh3 = function(libh32) {
45569
45570
  }
45570
45571
  }
45571
45572
  Gc(w3, y2, f2, a3, C4);
45572
- _a3(C4, b[v2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45573
+ _a2(C4, b[v2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45573
45574
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
45574
45575
  }
45575
45576
  if ((j | 0) < (n3 | 0)) {
45576
45577
  Da(t2, v2);
45577
- _a3(v2, b[F2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45578
+ _a2(v2, b[F2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45578
45579
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
45579
45580
  }
45580
45581
  b[E2 >> 2] = b[F2 >> 2];
@@ -45834,13 +45835,13 @@ var libh3 = function(libh32) {
45834
45835
  }
45835
45836
  Gc(A3, s3, f2, a3, w3);
45836
45837
  if (!(Hc(A3, w3) | 0) ? !(Hc(s3, w3) | 0) : 0) {
45837
- _a3(w3, b[x2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45838
+ _a2(w3, b[x2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45838
45839
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
45839
45840
  }
45840
45841
  }
45841
45842
  if ((j | 0) < (l2 | 0)) {
45842
45843
  Da(q2, A3);
45843
- _a3(A3, b[z2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45844
+ _a2(A3, b[z2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
45844
45845
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
45845
45846
  }
45846
45847
  j = j + 1 | 0;
@@ -48168,7 +48169,7 @@ var libh3 = function(libh32) {
48168
48169
  function Zb() {
48169
48170
  return 12;
48170
48171
  }
48171
- function _b2(a3, c) {
48172
+ function _b(a3, c) {
48172
48173
  a3 = a3 | 0;
48173
48174
  c = c | 0;
48174
48175
  var d = 0, e3 = 0, f2 = 0, g3 = 0, h = 0, i2 = 0, j = 0;
@@ -52613,7 +52614,7 @@ var libh3 = function(libh32) {
52613
52614
  _getH3UnidirectionalEdgeBoundary: gc,
52614
52615
  _getH3UnidirectionalEdgesFromHexagon: fc,
52615
52616
  _getOriginH3IndexFromUnidirectionalEdge: bc,
52616
- _getPentagonIndexes: _b2,
52617
+ _getPentagonIndexes: _b,
52617
52618
  _getRes0Indexes: va,
52618
52619
  _h3Distance: qc,
52619
52620
  _h3GetBaseCell: Ab,
@@ -66103,15 +66104,15 @@ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
66103
66104
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
66104
66105
  var __hasOwnProp = Object.prototype.hasOwnProperty;
66105
66106
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
66106
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
66107
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
66107
66108
  var __spreadValues = (a2, b) => {
66108
66109
  for (var prop in b || (b = {}))
66109
66110
  if (__hasOwnProp.call(b, prop))
66110
- __defNormalProp2(a2, prop, b[prop]);
66111
+ __defNormalProp(a2, prop, b[prop]);
66111
66112
  if (__getOwnPropSymbols)
66112
66113
  for (var prop of __getOwnPropSymbols(b)) {
66113
66114
  if (__propIsEnum.call(b, prop))
66114
- __defNormalProp2(a2, prop, b[prop]);
66115
+ __defNormalProp(a2, prop, b[prop]);
66115
66116
  }
66116
66117
  return a2;
66117
66118
  };
@@ -66581,15 +66582,15 @@ function lineIntersect(line1, line2, options = {}) {
66581
66582
  }
66582
66583
  return featureCollection(results.map((r2) => point(r2)));
66583
66584
  }
66584
- var __defProp2 = Object.defineProperty;
66585
- var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
66585
+ var __defProp = Object.defineProperty;
66586
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
66586
66587
  var _GeojsonEquality = class _GeojsonEquality2 {
66587
66588
  constructor(opts) {
66588
66589
  this.direction = false;
66589
66590
  this.compareProperties = true;
66590
- var _a3, _b2, _c;
66591
- this.precision = 10 ** -((_a3 = opts == null ? void 0 : opts.precision) != null ? _a3 : 17);
66592
- this.direction = (_b2 = opts == null ? void 0 : opts.direction) != null ? _b2 : false;
66591
+ var _a2, _b, _c;
66592
+ this.precision = 10 ** -((_a2 = opts == null ? void 0 : opts.precision) != null ? _a2 : 17);
66593
+ this.direction = (_b = opts == null ? void 0 : opts.direction) != null ? _b : false;
66593
66594
  this.compareProperties = (_c = opts == null ? void 0 : opts.compareProperties) != null ? _c : true;
66594
66595
  }
66595
66596
  compare(g1, g2) {
@@ -78303,7 +78304,7 @@ var boundsStream$1 = {
78303
78304
  boundsStream$1.lineEnd = boundsLineEnd;
78304
78305
  if (areaRingSum$1 < 0) lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);
78305
78306
  else if (deltaSum > epsilon) phi1 = 90;
78306
- else if (deltaSum < -1e-6) phi0 = -90;
78307
+ else if (deltaSum < -epsilon) phi0 = -90;
78307
78308
  range$3[0] = lambda0$1, range$3[1] = lambda1;
78308
78309
  }
78309
78310
  };
@@ -78813,7 +78814,7 @@ function merge(arrays) {
78813
78814
  }
78814
78815
  return merged;
78815
78816
  }
78816
- var clipMax = 1e9, clipMin = -1e9;
78817
+ var clipMax = 1e9, clipMin = -clipMax;
78817
78818
  function clipExtent(x02, y02, x12, y12) {
78818
78819
  function visible(x, y) {
78819
78820
  return x02 <= x && x <= x12 && y02 <= y && y <= y12;
@@ -78967,7 +78968,7 @@ function polygonContains(polygon2, point2) {
78967
78968
  }
78968
78969
  }
78969
78970
  }
78970
- return (angle2 < -1e-6 || angle2 < epsilon && sum$2 < -1e-6) ^ winding & 1;
78971
+ return (angle2 < -epsilon || angle2 < epsilon && sum$2 < -epsilon) ^ winding & 1;
78971
78972
  }
78972
78973
  var lengthSum$1 = adder(), lambda0, sinPhi0, cosPhi0;
78973
78974
  var lengthStream$1 = {
@@ -80697,16 +80698,16 @@ function requirePolygonClipping_umd() {
80697
80698
  };
80698
80699
  Tree2.prototype.keys = function() {
80699
80700
  var keys2 = [];
80700
- this.forEach(function(_a3) {
80701
- var key = _a3.key;
80701
+ this.forEach(function(_a2) {
80702
+ var key = _a2.key;
80702
80703
  return keys2.push(key);
80703
80704
  });
80704
80705
  return keys2;
80705
80706
  };
80706
80707
  Tree2.prototype.values = function() {
80707
80708
  var values2 = [];
80708
- this.forEach(function(_a3) {
80709
- var data = _a3.data;
80709
+ this.forEach(function(_a2) {
80710
+ var data = _a2.data;
80710
80711
  return values2.push(data);
80711
80712
  });
80712
80713
  return values2;
@@ -80861,7 +80862,7 @@ function requirePolygonClipping_umd() {
80861
80862
  };
80862
80863
  Tree2.prototype.update = function(key, newKey, newData) {
80863
80864
  var comparator = this._comparator;
80864
- var _a3 = split(key, this._root, comparator), left = _a3.left, right = _a3.right;
80865
+ var _a2 = split(key, this._root, comparator), left = _a2.left, right = _a2.right;
80865
80866
  if (comparator(key, newKey) < 0) {
80866
80867
  right = insert(newKey, newData, right, comparator);
80867
80868
  } else {
@@ -82353,8 +82354,8 @@ function requireJs$j() {
82353
82354
  if (!featureCollection2 || featureCollection2.type !== "FeatureCollection") {
82354
82355
  throw new Error("Invalid input to " + name2 + ", FeatureCollection required");
82355
82356
  }
82356
- for (var _i = 0, _a3 = featureCollection2.features; _i < _a3.length; _i++) {
82357
- var feature2 = _a3[_i];
82357
+ for (var _i = 0, _a2 = featureCollection2.features; _i < _a2.length; _i++) {
82358
+ var feature2 = _a2[_i];
82358
82359
  if (!feature2 || feature2.type !== "Feature" || !feature2.geometry) {
82359
82360
  throw new Error("Invalid input to " + name2 + ", Feature with geometry required");
82360
82361
  }
@@ -83999,24 +84000,24 @@ function requireBignumber() {
83999
84000
  if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
84000
84001
  v = obj[p];
84001
84002
  if (v && v.pop) {
84002
- intCheck2(v[0], -1e9, 0, p);
84003
+ intCheck2(v[0], -MAX2, 0, p);
84003
84004
  intCheck2(v[1], 0, MAX2, p);
84004
84005
  TO_EXP_NEG = v[0];
84005
84006
  TO_EXP_POS = v[1];
84006
84007
  } else {
84007
- intCheck2(v, -1e9, MAX2, p);
84008
+ intCheck2(v, -MAX2, MAX2, p);
84008
84009
  TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
84009
84010
  }
84010
84011
  }
84011
84012
  if (obj.hasOwnProperty(p = "RANGE")) {
84012
84013
  v = obj[p];
84013
84014
  if (v && v.pop) {
84014
- intCheck2(v[0], -1e9, -1, p);
84015
+ intCheck2(v[0], -MAX2, -1, p);
84015
84016
  intCheck2(v[1], 1, MAX2, p);
84016
84017
  MIN_EXP = v[0];
84017
84018
  MAX_EXP = v[1];
84018
84019
  } else {
84019
- intCheck2(v, -1e9, MAX2, p);
84020
+ intCheck2(v, -MAX2, MAX2, p);
84020
84021
  if (v) {
84021
84022
  MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
84022
84023
  } else {
@@ -84086,7 +84087,7 @@ function requireBignumber() {
84086
84087
  if (!BigNumber3.DEBUG) return true;
84087
84088
  var i2, n3, c = v.c, e2 = v.e, s2 = v.s;
84088
84089
  out: if ({}.toString.call(c) == "[object Array]") {
84089
- if ((s2 === 1 || s2 === -1) && e2 >= -1e9 && e2 <= MAX2 && e2 === mathfloor2(e2)) {
84090
+ if ((s2 === 1 || s2 === -1) && e2 >= -MAX2 && e2 <= MAX2 && e2 === mathfloor2(e2)) {
84090
84091
  if (c[0] === 0) {
84091
84092
  if (e2 === 0 && c.length === 1) return true;
84092
84093
  break out;
@@ -84926,7 +84927,7 @@ function requireBignumber() {
84926
84927
  return n3;
84927
84928
  };
84928
84929
  P2.shiftedBy = function(k) {
84929
- intCheck2(k, -9007199254740991, MAX_SAFE_INTEGER2);
84930
+ intCheck2(k, -MAX_SAFE_INTEGER2, MAX_SAFE_INTEGER2);
84930
84931
  return this.times("1e" + k);
84931
84932
  };
84932
84933
  P2.squareRoot = P2.sqrt = function() {
@@ -85189,26 +85190,25 @@ function requireBignumber() {
85189
85190
  var cjs$9;
85190
85191
  var hasRequiredCjs$a;
85191
85192
  function requireCjs$a() {
85192
- var _a3, _b2, _c, _d;
85193
85193
  if (hasRequiredCjs$a) return cjs$9;
85194
85194
  hasRequiredCjs$a = 1;
85195
- var __defProp3 = Object.defineProperty;
85195
+ var __defProp2 = Object.defineProperty;
85196
85196
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
85197
85197
  var __getOwnPropNames = Object.getOwnPropertyNames;
85198
85198
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
85199
85199
  var __export = (target, all) => {
85200
85200
  for (var name2 in all)
85201
- __defProp3(target, name2, { get: all[name2], enumerable: true });
85201
+ __defProp2(target, name2, { get: all[name2], enumerable: true });
85202
85202
  };
85203
85203
  var __copyProps = (to, from, except, desc) => {
85204
85204
  if (from && typeof from === "object" || typeof from === "function") {
85205
85205
  for (let key of __getOwnPropNames(from))
85206
85206
  if (!__hasOwnProp2.call(to, key) && key !== except)
85207
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
85207
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
85208
85208
  }
85209
85209
  return to;
85210
85210
  };
85211
- var __toCommonJS = (mod2) => __copyProps(__defProp3({}, "__esModule", { value: true }), mod2);
85211
+ var __toCommonJS = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2);
85212
85212
  var src_exports = {};
85213
85213
  __export(src_exports, {
85214
85214
  SplayTreeMap: () => SplayTreeMap,
@@ -85216,10 +85216,10 @@ function requireCjs$a() {
85216
85216
  });
85217
85217
  cjs$9 = __toCommonJS(src_exports);
85218
85218
  var SplayTreeNode2 = class {
85219
+ key;
85220
+ left = null;
85221
+ right = null;
85219
85222
  constructor(key) {
85220
- __publicField(this, "key");
85221
- __publicField(this, "left", null);
85222
- __publicField(this, "right", null);
85223
85223
  this.key = key;
85224
85224
  }
85225
85225
  };
@@ -85229,9 +85229,9 @@ function requireCjs$a() {
85229
85229
  }
85230
85230
  };
85231
85231
  var SplayTreeMapNode = class _SplayTreeMapNode extends SplayTreeNode2 {
85232
+ value;
85232
85233
  constructor(key, value) {
85233
85234
  super(key);
85234
- __publicField(this, "value");
85235
85235
  this.value = value;
85236
85236
  }
85237
85237
  replaceValue(value) {
@@ -85242,11 +85242,9 @@ function requireCjs$a() {
85242
85242
  }
85243
85243
  };
85244
85244
  var SplayTree2 = class {
85245
- constructor() {
85246
- __publicField(this, "size", 0);
85247
- __publicField(this, "modificationCount", 0);
85248
- __publicField(this, "splayCount", 0);
85249
- }
85245
+ size = 0;
85246
+ modificationCount = 0;
85247
+ splayCount = 0;
85250
85248
  splay(key) {
85251
85249
  const root2 = this.root;
85252
85250
  if (root2 == null) {
@@ -85431,12 +85429,11 @@ function requireCjs$a() {
85431
85429
  }
85432
85430
  };
85433
85431
  var SplayTreeMap = class extends SplayTree2 {
85432
+ root = null;
85433
+ compare;
85434
+ validKey;
85434
85435
  constructor(compare2, isValidKey) {
85435
85436
  super();
85436
- __publicField(this, "root", null);
85437
- __publicField(this, "compare");
85438
- __publicField(this, "validKey");
85439
- __publicField(this, _a3, "[object Map]");
85440
85437
  this.compare = compare2 ?? this.defaultCompare();
85441
85438
  this.validKey = isValidKey ?? ((a2) => a2 != null && a2 != void 0);
85442
85439
  }
@@ -85602,17 +85599,17 @@ function requireCjs$a() {
85602
85599
  entries() {
85603
85600
  return this[Symbol.iterator]();
85604
85601
  }
85605
- [(_b2 = Symbol.iterator, _a3 = Symbol.toStringTag, _b2)]() {
85602
+ [Symbol.iterator]() {
85606
85603
  return new SplayTreeMapEntryIterableIterator(this.wrap());
85607
85604
  }
85605
+ [Symbol.toStringTag] = "[object Map]";
85608
85606
  };
85609
85607
  var SplayTreeSet2 = class _SplayTreeSet2 extends SplayTree2 {
85608
+ root = null;
85609
+ compare;
85610
+ validKey;
85610
85611
  constructor(compare2, isValidKey) {
85611
85612
  super();
85612
- __publicField(this, "root", null);
85613
- __publicField(this, "compare");
85614
- __publicField(this, "validKey");
85615
- __publicField(this, _c, "[object Set]");
85616
85613
  this.compare = compare2 ?? this.defaultCompare();
85617
85614
  this.validKey = isValidKey ?? ((v) => v != null && v != void 0);
85618
85615
  }
@@ -85779,16 +85776,17 @@ function requireCjs$a() {
85779
85776
  values() {
85780
85777
  return this[Symbol.iterator]();
85781
85778
  }
85782
- [(_d = Symbol.iterator, _c = Symbol.toStringTag, _d)]() {
85779
+ [Symbol.iterator]() {
85783
85780
  return new SplayTreeKeyIterableIterator2(this.wrap());
85784
85781
  }
85782
+ [Symbol.toStringTag] = "[object Set]";
85785
85783
  };
85786
85784
  var SplayTreeIterableIterator2 = class {
85785
+ tree;
85786
+ path = new Array();
85787
+ modificationCount = null;
85788
+ splayCount;
85787
85789
  constructor(tree) {
85788
- __publicField(this, "tree");
85789
- __publicField(this, "path", new Array());
85790
- __publicField(this, "modificationCount", null);
85791
- __publicField(this, "splayCount");
85792
85790
  this.tree = tree;
85793
85791
  this.splayCount = tree.getSplayCount();
85794
85792
  }
@@ -85907,20 +85905,20 @@ function requireCjs$9() {
85907
85905
  if (hasRequiredCjs$9) return cjs$8;
85908
85906
  hasRequiredCjs$9 = 1;
85909
85907
  var __create = Object.create;
85910
- var __defProp3 = Object.defineProperty;
85908
+ var __defProp2 = Object.defineProperty;
85911
85909
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
85912
85910
  var __getOwnPropNames = Object.getOwnPropertyNames;
85913
85911
  var __getProtoOf = Object.getPrototypeOf;
85914
85912
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
85915
85913
  var __export = (target, all) => {
85916
85914
  for (var name2 in all)
85917
- __defProp3(target, name2, { get: all[name2], enumerable: true });
85915
+ __defProp2(target, name2, { get: all[name2], enumerable: true });
85918
85916
  };
85919
85917
  var __copyProps = (to, from, except, desc) => {
85920
85918
  if (from && typeof from === "object" || typeof from === "function") {
85921
85919
  for (let key of __getOwnPropNames(from))
85922
85920
  if (!__hasOwnProp2.call(to, key) && key !== except)
85923
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
85921
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
85924
85922
  }
85925
85923
  return to;
85926
85924
  };
@@ -85929,10 +85927,10 @@ function requireCjs$9() {
85929
85927
  // file that has been converted to a CommonJS file using a Babel-
85930
85928
  // compatible transform (i.e. "__esModule" has not been set), then set
85931
85929
  // "default" to the CommonJS "module.exports" for node compatibility.
85932
- __defProp3(target, "default", { value: mod2, enumerable: true }),
85930
+ __defProp2(target, "default", { value: mod2, enumerable: true }),
85933
85931
  mod2
85934
85932
  ));
85935
- var __toCommonJS = (mod2) => __copyProps(__defProp3({}, "__esModule", { value: true }), mod2);
85933
+ var __toCommonJS = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2);
85936
85934
  var src_exports = {};
85937
85935
  __export(src_exports, {
85938
85936
  difference: () => difference,
@@ -86052,18 +86050,11 @@ function requireCjs$9() {
86052
86050
  return { x, y };
86053
86051
  };
86054
86052
  var SweepEvent2 = class _SweepEvent2 {
86055
- // Warning: 'point' input will be modified and re-used (for performance)
86056
- constructor(point2, isLeft) {
86057
- __publicField(this, "point");
86058
- __publicField(this, "isLeft");
86059
- __publicField(this, "segment");
86060
- __publicField(this, "otherSE");
86061
- __publicField(this, "consumedBy");
86062
- if (point2.events === void 0) point2.events = [this];
86063
- else point2.events.push(this);
86064
- this.point = point2;
86065
- this.isLeft = isLeft;
86066
- }
86053
+ point;
86054
+ isLeft;
86055
+ segment;
86056
+ otherSE;
86057
+ consumedBy;
86067
86058
  // for ordering sweep events in the sweep event queue
86068
86059
  static compare(a2, b) {
86069
86060
  const ptCmp = _SweepEvent2.comparePoints(a2.point, b.point);
@@ -86080,6 +86071,13 @@ function requireCjs$9() {
86080
86071
  if (aPt.y.isGreaterThan(bPt.y)) return 1;
86081
86072
  return 0;
86082
86073
  }
86074
+ // Warning: 'point' input will be modified and re-used (for performance)
86075
+ constructor(point2, isLeft) {
86076
+ if (point2.events === void 0) point2.events = [this];
86077
+ else point2.events.push(this);
86078
+ this.point = point2;
86079
+ this.isLeft = isLeft;
86080
+ }
86083
86081
  link(other) {
86084
86082
  if (other.point === this.point) {
86085
86083
  throw new Error("Tried to link already linked events");
@@ -86158,17 +86156,10 @@ function requireCjs$9() {
86158
86156
  }
86159
86157
  };
86160
86158
  var RingOut2 = class _RingOut2 {
86161
- constructor(events2) {
86162
- __publicField(this, "events");
86163
- __publicField(this, "poly");
86164
- __publicField(this, "_isExteriorRing");
86165
- __publicField(this, "_enclosingRing");
86166
- this.events = events2;
86167
- for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
86168
- events2[i2].segment.ringOut = this;
86169
- }
86170
- this.poly = null;
86171
- }
86159
+ events;
86160
+ poly;
86161
+ _isExteriorRing;
86162
+ _enclosingRing;
86172
86163
  /* Given the segments from the sweep line pass, compute & return a series
86173
86164
  * of closed rings from all the segments marked to be part of the result */
86174
86165
  static factory(allSegments) {
@@ -86227,6 +86218,13 @@ function requireCjs$9() {
86227
86218
  }
86228
86219
  return ringsOut;
86229
86220
  }
86221
+ constructor(events2) {
86222
+ this.events = events2;
86223
+ for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
86224
+ events2[i2].segment.ringOut = this;
86225
+ }
86226
+ this.poly = null;
86227
+ }
86230
86228
  getGeom() {
86231
86229
  let prevPt = this.events[0].point;
86232
86230
  const points = [prevPt];
@@ -86265,7 +86263,6 @@ function requireCjs$9() {
86265
86263
  }
86266
86264
  /* Returns the ring that encloses this one, if any */
86267
86265
  _calcEnclosingRing() {
86268
- var _a3, _b2;
86269
86266
  let leftMostEvt = this.events[0];
86270
86267
  for (let i2 = 1, iMax = this.events.length; i2 < iMax; i2++) {
86271
86268
  const evt = this.events[i2];
@@ -86277,9 +86274,9 @@ function requireCjs$9() {
86277
86274
  if (!prevSeg) return null;
86278
86275
  if (!prevPrevSeg) return prevSeg.ringOut;
86279
86276
  if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
86280
- if (((_a3 = prevPrevSeg.ringOut) == null ? void 0 : _a3.enclosingRing()) !== prevSeg.ringOut) {
86277
+ if (prevPrevSeg.ringOut?.enclosingRing() !== prevSeg.ringOut) {
86281
86278
  return prevSeg.ringOut;
86282
- } else return (_b2 = prevSeg.ringOut) == null ? void 0 : _b2.enclosingRing();
86279
+ } else return prevSeg.ringOut?.enclosingRing();
86283
86280
  }
86284
86281
  prevSeg = prevPrevSeg.prevInResult();
86285
86282
  prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
@@ -86287,9 +86284,9 @@ function requireCjs$9() {
86287
86284
  }
86288
86285
  };
86289
86286
  var PolyOut2 = class {
86287
+ exteriorRing;
86288
+ interiorRings;
86290
86289
  constructor(exteriorRing) {
86291
- __publicField(this, "exteriorRing");
86292
- __publicField(this, "interiorRings");
86293
86290
  this.exteriorRing = exteriorRing;
86294
86291
  exteriorRing.poly = this;
86295
86292
  this.interiorRings = [];
@@ -86311,9 +86308,9 @@ function requireCjs$9() {
86311
86308
  }
86312
86309
  };
86313
86310
  var MultiPolyOut2 = class {
86311
+ rings;
86312
+ polys;
86314
86313
  constructor(rings) {
86315
- __publicField(this, "rings");
86316
- __publicField(this, "polys");
86317
86314
  this.rings = rings;
86318
86315
  this.polys = this._composePolys(rings);
86319
86316
  }
@@ -86327,7 +86324,6 @@ function requireCjs$9() {
86327
86324
  return geom;
86328
86325
  }
86329
86326
  _composePolys(rings) {
86330
- var _a3;
86331
86327
  const polys = [];
86332
86328
  for (let i2 = 0, iMax = rings.length; i2 < iMax; i2++) {
86333
86329
  const ring = rings[i2];
@@ -86335,8 +86331,8 @@ function requireCjs$9() {
86335
86331
  if (ring.isExteriorRing()) polys.push(new PolyOut2(ring));
86336
86332
  else {
86337
86333
  const enclosingRing = ring.enclosingRing();
86338
- if (!(enclosingRing == null ? void 0 : enclosingRing.poly)) polys.push(new PolyOut2(enclosingRing));
86339
- (_a3 = enclosingRing == null ? void 0 : enclosingRing.poly) == null ? void 0 : _a3.addInterior(ring);
86334
+ if (!enclosingRing?.poly) polys.push(new PolyOut2(enclosingRing));
86335
+ enclosingRing?.poly?.addInterior(ring);
86340
86336
  }
86341
86337
  }
86342
86338
  return polys;
@@ -86344,10 +86340,10 @@ function requireCjs$9() {
86344
86340
  };
86345
86341
  var import_splaytree_ts2 = requireCjs$a();
86346
86342
  var SweepLine2 = class {
86343
+ queue;
86344
+ tree;
86345
+ segments;
86347
86346
  constructor(queue, comparator = Segment3.compare) {
86348
- __publicField(this, "queue");
86349
- __publicField(this, "tree");
86350
- __publicField(this, "segments");
86351
86347
  this.queue = queue;
86352
86348
  this.tree = new import_splaytree_ts2.SplayTreeSet(comparator);
86353
86349
  this.segments = [];
@@ -86456,10 +86452,8 @@ function requireCjs$9() {
86456
86452
  }
86457
86453
  };
86458
86454
  var Operation2 = class {
86459
- constructor() {
86460
- __publicField(this, "type");
86461
- __publicField(this, "numMultiPolys");
86462
- }
86455
+ type;
86456
+ numMultiPolys;
86463
86457
  run(type, geom, moreGeoms) {
86464
86458
  operation2.type = type;
86465
86459
  const multipolys = [new MultiPolyIn2(geom, true)];
@@ -86519,31 +86513,18 @@ function requireCjs$9() {
86519
86513
  var operation_default2 = operation2;
86520
86514
  var segmentId2 = 0;
86521
86515
  var Segment3 = class _Segment2 {
86522
- /* Warning: a reference to ringWindings input will be stored,
86523
- * and possibly will be later modified */
86524
- constructor(leftSE, rightSE, rings, windings) {
86525
- __publicField(this, "id");
86526
- __publicField(this, "leftSE");
86527
- __publicField(this, "rightSE");
86528
- __publicField(this, "rings");
86529
- __publicField(this, "windings");
86530
- __publicField(this, "ringOut");
86531
- __publicField(this, "consumedBy");
86532
- __publicField(this, "prev");
86533
- __publicField(this, "_prevInResult");
86534
- __publicField(this, "_beforeState");
86535
- __publicField(this, "_afterState");
86536
- __publicField(this, "_isInResult");
86537
- this.id = ++segmentId2;
86538
- this.leftSE = leftSE;
86539
- leftSE.segment = this;
86540
- leftSE.otherSE = rightSE;
86541
- this.rightSE = rightSE;
86542
- rightSE.segment = this;
86543
- rightSE.otherSE = leftSE;
86544
- this.rings = rings;
86545
- this.windings = windings;
86546
- }
86516
+ id;
86517
+ leftSE;
86518
+ rightSE;
86519
+ rings;
86520
+ windings;
86521
+ ringOut;
86522
+ consumedBy;
86523
+ prev;
86524
+ _prevInResult;
86525
+ _beforeState;
86526
+ _afterState;
86527
+ _isInResult;
86547
86528
  /* This compare() function is for ordering segments in the sweep
86548
86529
  * line tree, and does so according to the following criteria:
86549
86530
  *
@@ -86615,6 +86596,19 @@ function requireCjs$9() {
86615
86596
  if (a2.id > b.id) return 1;
86616
86597
  return 0;
86617
86598
  }
86599
+ /* Warning: a reference to ringWindings input will be stored,
86600
+ * and possibly will be later modified */
86601
+ constructor(leftSE, rightSE, rings, windings) {
86602
+ this.id = ++segmentId2;
86603
+ this.leftSE = leftSE;
86604
+ leftSE.segment = this;
86605
+ leftSE.otherSE = rightSE;
86606
+ this.rightSE = rightSE;
86607
+ rightSE.segment = this;
86608
+ rightSE.otherSE = leftSE;
86609
+ this.rings = rings;
86610
+ this.windings = windings;
86611
+ }
86618
86612
  static fromRing(pt1, pt2, ring) {
86619
86613
  let leftPt, rightPt, winding;
86620
86614
  const cmpPts = SweepEvent2.comparePoints(pt1, pt2);
@@ -86915,11 +86909,11 @@ function requireCjs$9() {
86915
86909
  }
86916
86910
  };
86917
86911
  var RingIn2 = class {
86912
+ poly;
86913
+ isExterior;
86914
+ segments;
86915
+ bbox;
86918
86916
  constructor(geomRing, poly, isExterior) {
86919
- __publicField(this, "poly");
86920
- __publicField(this, "isExterior");
86921
- __publicField(this, "segments");
86922
- __publicField(this, "bbox");
86923
86917
  if (!Array.isArray(geomRing) || geomRing.length === 0) {
86924
86918
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
86925
86919
  }
@@ -86963,11 +86957,11 @@ function requireCjs$9() {
86963
86957
  }
86964
86958
  };
86965
86959
  var PolyIn2 = class {
86960
+ multiPoly;
86961
+ exteriorRing;
86962
+ interiorRings;
86963
+ bbox;
86966
86964
  constructor(geomPoly, multiPoly) {
86967
- __publicField(this, "multiPoly");
86968
- __publicField(this, "exteriorRing");
86969
- __publicField(this, "interiorRings");
86970
- __publicField(this, "bbox");
86971
86965
  if (!Array.isArray(geomPoly)) {
86972
86966
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
86973
86967
  }
@@ -86999,10 +86993,10 @@ function requireCjs$9() {
86999
86993
  }
87000
86994
  };
87001
86995
  var MultiPolyIn2 = class {
86996
+ isSubject;
86997
+ polys;
86998
+ bbox;
87002
86999
  constructor(geom, isSubject) {
87003
- __publicField(this, "isSubject");
87004
- __publicField(this, "polys");
87005
- __publicField(this, "bbox");
87006
87000
  if (!Array.isArray(geom)) {
87007
87001
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
87008
87002
  }
@@ -87913,9 +87907,9 @@ function requireUtils$2() {
87913
87907
  }
87914
87908
  break;
87915
87909
  case "MultiPolygon":
87916
- for (var _a3 = 0; _a3 < geometry2.coordinates.length; _a3++) {
87917
- for (var b = 0; b < geometry2.coordinates[_a3].length; b++) {
87918
- handles = handles.concat(getEditHandlesForCoordinates(geometry2.coordinates[_a3][b], [_a3, b], featureIndex, editHandleType));
87910
+ for (var _a2 = 0; _a2 < geometry2.coordinates.length; _a2++) {
87911
+ for (var b = 0; b < geometry2.coordinates[_a2].length; b++) {
87912
+ handles = handles.concat(getEditHandlesForCoordinates(geometry2.coordinates[_a2][b], [_a2, b], featureIndex, editHandleType));
87919
87913
  handles = handles.slice(0, -1);
87920
87914
  }
87921
87915
  }
@@ -89035,21 +89029,21 @@ function requireCjs$6() {
89035
89029
  if (hasRequiredCjs$6) return cjs$6;
89036
89030
  hasRequiredCjs$6 = 1;
89037
89031
  Object.defineProperty(cjs$6, "__esModule", { value: true });
89038
- var __defProp3 = Object.defineProperty;
89032
+ var __defProp2 = Object.defineProperty;
89039
89033
  var __defProps2 = Object.defineProperties;
89040
89034
  var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
89041
89035
  var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
89042
89036
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
89043
89037
  var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
89044
- var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
89038
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
89045
89039
  var __spreadValues2 = (a2, b) => {
89046
89040
  for (var prop in b || (b = {}))
89047
89041
  if (__hasOwnProp2.call(b, prop))
89048
- __defNormalProp3(a2, prop, b[prop]);
89042
+ __defNormalProp2(a2, prop, b[prop]);
89049
89043
  if (__getOwnPropSymbols2)
89050
89044
  for (var prop of __getOwnPropSymbols2(b)) {
89051
89045
  if (__propIsEnum2.call(b, prop))
89052
- __defNormalProp3(a2, prop, b[prop]);
89046
+ __defNormalProp2(a2, prop, b[prop]);
89053
89047
  }
89054
89048
  return a2;
89055
89049
  };
@@ -92075,9 +92069,9 @@ function requireExtrudeMode() {
92075
92069
  size2 = coordinates2[a2][b].length;
92076
92070
  }
92077
92071
  } else {
92078
- var _positionIndexes2 = _slicedToArray(positionIndexes, 1), _b2 = _positionIndexes2[0];
92079
- if (coordinates2.length && coordinates2[_b2].length) {
92080
- size2 = coordinates2[_b2].length;
92072
+ var _positionIndexes2 = _slicedToArray(positionIndexes, 1), _b = _positionIndexes2[0];
92073
+ if (coordinates2.length && coordinates2[_b].length) {
92074
+ size2 = coordinates2[_b].length;
92081
92075
  }
92082
92076
  }
92083
92077
  }
@@ -102895,7 +102889,7 @@ class SelectionLayer extends CompositeLayer {
102895
102889
  obsLayers.forEach((obsLayer) => {
102896
102890
  const { getObsCoords, obsQuadTree, obsIndex, onSelect: layerOnSelect } = obsLayer;
102897
102891
  const pickingInfos = [];
102898
- obsQuadTree == null ? void 0 : obsQuadTree.visit((node, x02, y02, x12, y12) => {
102892
+ obsQuadTree?.visit((node, x02, y02, x12, y12) => {
102899
102893
  const nodePoints = [[[x02, y02], [x12, y02], [x12, y12], [x02, y12], [x02, y02]]];
102900
102894
  const nodePolygon = polygon(nodePoints);
102901
102895
  const nodePolygonContainsSelectedPolygon = booleanContains(nodePolygon, selectedPolygon);
@@ -102999,6 +102993,8 @@ const PIXELATED_TEXTURE_PARAMETERS = {
102999
102993
  [GL$1.TEXTURE_WRAP_T]: GL$1.CLAMP_TO_EDGE
103000
102994
  };
103001
102995
  const GLSL_COLORMAPS = [
102996
+ // NOTE: the ordering of these is important,
102997
+ // as the shader code in bitmask-layer-beta-shaders hardcodes their indices.
103002
102998
  "plasma",
103003
102999
  "viridis",
103004
103000
  "jet",
@@ -103480,13 +103476,12 @@ class HeatmapBitmapLayer extends BitmapLayer$1 {
103480
103476
  });
103481
103477
  }
103482
103478
  updateState(args) {
103483
- var _a3;
103484
103479
  super.updateState(args);
103485
103480
  this.loadTexture(this.props.image);
103486
103481
  const { props, oldProps } = args;
103487
103482
  if (props.colormap !== oldProps.colormap) {
103488
103483
  const { gl } = this.context;
103489
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
103484
+ this.state.model?.delete();
103490
103485
  this.state.model = this._getModel(gl);
103491
103486
  this.getAttributeManager().invalidateAll();
103492
103487
  }
@@ -103856,12 +103851,11 @@ class PaddedExpressionHeatmapBitmapLayer extends BitmapLayer$1 {
103856
103851
  });
103857
103852
  }
103858
103853
  updateState(args) {
103859
- var _a3;
103860
103854
  super.updateState(args);
103861
103855
  const { props, oldProps } = args;
103862
103856
  if (props.colormap !== oldProps.colormap) {
103863
103857
  const { gl } = this.context;
103864
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
103858
+ this.state.model?.delete();
103865
103859
  this.state.model = this._getModel(gl);
103866
103860
  this.getAttributeManager().invalidateAll();
103867
103861
  }
@@ -103975,21 +103969,20 @@ class ScaledExpressionExtension extends LayerExtension {
103975
103969
  };
103976
103970
  }
103977
103971
  updateState({ props, oldProps }) {
103978
- var _a3, _b2, _c, _d;
103979
103972
  if (props.colormap !== oldProps.colormap) {
103980
103973
  const { gl } = this.context;
103981
103974
  if (this.state.model) {
103982
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
103975
+ this.state.model?.delete();
103983
103976
  this.state.model = this._getModel(gl);
103984
103977
  } else {
103985
103978
  if (this.state.models) {
103986
- (_b2 = this.state.models) == null ? void 0 : _b2.forEach((model) => model == null ? void 0 : model.delete());
103979
+ this.state.models?.forEach((model) => model?.delete());
103987
103980
  }
103988
103981
  if (this.state.topModel) {
103989
- (_c = this.state.topModel) == null ? void 0 : _c.delete();
103982
+ this.state.topModel?.delete();
103990
103983
  }
103991
103984
  if (this.state.sideModel) {
103992
- (_d = this.state.sideModel) == null ? void 0 : _d.delete();
103985
+ this.state.sideModel?.delete();
103993
103986
  }
103994
103987
  if (this._getModels) {
103995
103988
  this.setState(this._getModels(this.context.gl));
@@ -104030,10 +104023,10 @@ class ScaledExpressionExtension extends LayerExtension {
104030
104023
  uColorScaleRange: [colorScaleLo, colorScaleHi],
104031
104024
  uIsExpressionMode: isExpressionMode
104032
104025
  };
104033
- model == null ? void 0 : model.setUniforms(uniforms);
104034
- models == null ? void 0 : models.forEach((m) => m.setUniforms(uniforms));
104035
- topModel == null ? void 0 : topModel.setUniforms(uniforms);
104036
- sideModel == null ? void 0 : sideModel.setUniforms(uniforms);
104026
+ model?.setUniforms(uniforms);
104027
+ models?.forEach((m) => m.setUniforms(uniforms));
104028
+ topModel?.setUniforms(uniforms);
104029
+ sideModel?.setUniforms(uniforms);
104037
104030
  }
104038
104031
  }
104039
104032
  ScaledExpressionExtension.extensionName = "ScaledExpressionExtension";
@@ -104772,22 +104765,22 @@ async function getDecoder(fileDirectory) {
104772
104765
  const Decoder = await importFn();
104773
104766
  return new Decoder(fileDirectory);
104774
104767
  }
104775
- addDecoder([void 0, 1], () => import("./raw-BqYJ21Lo.js").then((m) => m.default));
104776
- addDecoder(5, () => import("./lzw-DgaeJZEg.js").then((m) => m.default));
104768
+ addDecoder([void 0, 1], () => import("./raw-DP_5N1Jo.js").then((m) => m.default));
104769
+ addDecoder(5, () => import("./lzw-BeXf3EsN.js").then((m) => m.default));
104777
104770
  addDecoder(6, () => {
104778
104771
  throw new Error("old style JPEG compression is not supported.");
104779
104772
  });
104780
- addDecoder(7, () => import("./jpeg-Dp1zNV18.js").then((m) => m.default));
104781
- addDecoder([8, 32946], () => import("./deflate-u7j5fAYD.js").then((m) => m.default));
104782
- addDecoder(32773, () => import("./packbits-ilQhXLbG.js").then((m) => m.default));
104773
+ addDecoder(7, () => import("./jpeg-BObK4ini.js").then((m) => m.default));
104774
+ addDecoder([8, 32946], () => import("./deflate-DmNqlBs9.js").then((m) => m.default));
104775
+ addDecoder(32773, () => import("./packbits-BuXgVzsG.js").then((m) => m.default));
104783
104776
  addDecoder(
104784
104777
  34887,
104785
- () => import("./lerc-D8aoR9iq.js").then(async (m) => {
104778
+ () => import("./lerc-C8MlNyxy.js").then(async (m) => {
104786
104779
  await m.zstd.init();
104787
104780
  return m;
104788
104781
  }).then((m) => m.default)
104789
104782
  );
104790
- addDecoder(50001, () => import("./webimage-C8B5E807.js").then((m) => m.default));
104783
+ addDecoder(50001, () => import("./webimage-D63RI41j.js").then((m) => m.default));
104791
104784
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
104792
104785
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
104793
104786
  }
@@ -108164,11 +108157,11 @@ class ZodType {
108164
108157
  throw result.error;
108165
108158
  }
108166
108159
  safeParse(data, params) {
108167
- var _a3;
108160
+ var _a2;
108168
108161
  const ctx = {
108169
108162
  common: {
108170
108163
  issues: [],
108171
- async: (_a3 = params === null || params === void 0 ? void 0 : params.async) !== null && _a3 !== void 0 ? _a3 : false,
108164
+ async: (_a2 = params === null || params === void 0 ? void 0 : params.async) !== null && _a2 !== void 0 ? _a2 : false,
108172
108165
  contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
108173
108166
  },
108174
108167
  path: (params === null || params === void 0 ? void 0 : params.path) || [],
@@ -108510,7 +108503,7 @@ class ZodString extends ZodType {
108510
108503
  } else if (check.kind === "url") {
108511
108504
  try {
108512
108505
  new URL(input.data);
108513
- } catch (_a3) {
108506
+ } catch (_a2) {
108514
108507
  ctx = this._getOrReturnCtx(input, ctx);
108515
108508
  addIssueToContext(ctx, {
108516
108509
  validation: "url",
@@ -108632,7 +108625,7 @@ class ZodString extends ZodType {
108632
108625
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
108633
108626
  }
108634
108627
  datetime(options) {
108635
- var _a3;
108628
+ var _a2;
108636
108629
  if (typeof options === "string") {
108637
108630
  return this._addCheck({
108638
108631
  kind: "datetime",
@@ -108644,7 +108637,7 @@ class ZodString extends ZodType {
108644
108637
  return this._addCheck({
108645
108638
  kind: "datetime",
108646
108639
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
108647
- offset: (_a3 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a3 !== void 0 ? _a3 : false,
108640
+ offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false,
108648
108641
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
108649
108642
  });
108650
108643
  }
@@ -108772,11 +108765,11 @@ class ZodString extends ZodType {
108772
108765
  }
108773
108766
  }
108774
108767
  ZodString.create = (params) => {
108775
- var _a3;
108768
+ var _a2;
108776
108769
  return new ZodString({
108777
108770
  checks: [],
108778
108771
  typeName: ZodFirstPartyTypeKind.ZodString,
108779
- coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
108772
+ coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
108780
108773
  ...processCreateParams(params)
108781
108774
  });
108782
108775
  };
@@ -109177,11 +109170,11 @@ class ZodBigInt extends ZodType {
109177
109170
  }
109178
109171
  }
109179
109172
  ZodBigInt.create = (params) => {
109180
- var _a3;
109173
+ var _a2;
109181
109174
  return new ZodBigInt({
109182
109175
  checks: [],
109183
109176
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
109184
- coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
109177
+ coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
109185
109178
  ...processCreateParams(params)
109186
109179
  });
109187
109180
  };
@@ -109686,8 +109679,8 @@ class ZodObject extends ZodType {
109686
109679
  unknownKeys: "strict",
109687
109680
  ...message !== void 0 ? {
109688
109681
  errorMap: (issue, ctx) => {
109689
- var _a3, _b2, _c, _d;
109690
- 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;
109682
+ var _a2, _b, _c, _d;
109683
+ 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;
109691
109684
  if (issue.code === "unrecognized_keys")
109692
109685
  return {
109693
109686
  message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
@@ -116562,9 +116555,8 @@ function isText(node) {
116562
116555
  return node.nodeType === 3;
116563
116556
  }
116564
116557
  function xmlToJson(xmlNode, options) {
116565
- var _a3;
116566
116558
  if (isText(xmlNode)) {
116567
- return ((_a3 = xmlNode.nodeValue) == null ? void 0 : _a3.trim()) ?? "";
116559
+ return xmlNode.nodeValue?.trim() ?? "";
116568
116560
  }
116569
116561
  if (xmlNode.childNodes.length === 0 && (!xmlNode.attributes || xmlNode.attributes.length === 0)) {
116570
116562
  return "";
@@ -116878,14 +116870,13 @@ class TiffPixelSource {
116878
116870
  return this._readRasters(image, { window: window2, width, height, signal });
116879
116871
  }
116880
116872
  async _readRasters(image, props) {
116881
- var _a3;
116882
116873
  const interleave = isInterleaved$1(this.shape);
116883
116874
  const raster = await image.readRasters({
116884
116875
  interleave,
116885
116876
  ...props,
116886
116877
  pool: this.pool
116887
116878
  });
116888
- if ((_a3 = props == null ? void 0 : props.signal) == null ? void 0 : _a3.aborted) {
116879
+ if (props?.signal?.aborted) {
116889
116880
  throw SIGNAL_ABORTED;
116890
116881
  }
116891
116882
  const data = interleave ? raster : raster[0];
@@ -118628,8 +118619,7 @@ const defaultProps$4$1 = {
118628
118619
  };
118629
118620
  const AdditiveColormapExtension = class extends LayerExtension {
118630
118621
  getShaders() {
118631
- var _a3;
118632
- const name2 = ((_a3 = this == null ? void 0 : this.props) == null ? void 0 : _a3.colormap) || defaultProps$4$1.colormap.value;
118622
+ const name2 = this?.props?.colormap || defaultProps$4$1.colormap.value;
118633
118623
  const apply_cmap = cmaps[name2];
118634
118624
  if (!apply_cmap) {
118635
118625
  throw Error(`No colormap named ${name2} found in registry`);
@@ -118647,7 +118637,6 @@ const AdditiveColormapExtension = class extends LayerExtension {
118647
118637
  }
118648
118638
  }
118649
118639
  draw() {
118650
- var _a3;
118651
118640
  const {
118652
118641
  useTransparentColor = defaultProps$4$1.useTransparentColor.value,
118653
118642
  opacity = defaultProps$4$1.opacity.value
@@ -118656,7 +118645,7 @@ const AdditiveColormapExtension = class extends LayerExtension {
118656
118645
  opacity,
118657
118646
  useTransparentColor
118658
118647
  };
118659
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
118648
+ this.state.model?.setUniforms(uniforms);
118660
118649
  }
118661
118650
  };
118662
118651
  AdditiveColormapExtension.extensionName = "AdditiveColormapExtension";
@@ -118750,7 +118739,6 @@ const ColorPaletteExtension = class extends LayerExtension {
118750
118739
  };
118751
118740
  }
118752
118741
  draw() {
118753
- var _a3;
118754
118742
  const {
118755
118743
  colors,
118756
118744
  channelsVisible,
@@ -118768,7 +118756,7 @@ const ColorPaletteExtension = class extends LayerExtension {
118768
118756
  transparentColor: (transparentColor || [0, 0, 0]).map((i2) => i2 / 255),
118769
118757
  useTransparentColor: Boolean(useTransparentColor)
118770
118758
  };
118771
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
118759
+ this.state.model?.setUniforms(uniforms);
118772
118760
  }
118773
118761
  };
118774
118762
  ColorPaletteExtension.extensionName = "ColorPaletteExtension";
@@ -118917,7 +118905,6 @@ const LensExtension = class extends LayerExtension {
118917
118905
  this.setState({ onMouseMove, unprojectLensBounds: [0, 0, 0, 0] });
118918
118906
  }
118919
118907
  draw() {
118920
- var _a3;
118921
118908
  const { unprojectLensBounds = [0, 0, 0, 0] } = this.state;
118922
118909
  const {
118923
118910
  bounds: bounds2,
@@ -118951,15 +118938,14 @@ const LensExtension = class extends LayerExtension {
118951
118938
  lensBorderRadius,
118952
118939
  colors: paddedColors
118953
118940
  };
118954
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
118941
+ this.state.model?.setUniforms(uniforms);
118955
118942
  }
118956
118943
  finalizeState() {
118957
- var _a3, _b2, _c;
118958
118944
  if (this.context.deck) {
118959
118945
  this.context.deck.eventManager.off({
118960
- pointermove: (_a3 = this.state) == null ? void 0 : _a3.onMouseMove,
118961
- pointerleave: (_b2 = this.state) == null ? void 0 : _b2.onMouseMove,
118962
- wheel: (_c = this.state) == null ? void 0 : _c.onMouseMove
118946
+ pointermove: this.state?.onMouseMove,
118947
+ pointerleave: this.state?.onMouseMove,
118948
+ wheel: this.state?.onMouseMove
118963
118949
  });
118964
118950
  }
118965
118951
  }
@@ -118986,8 +118972,7 @@ const BaseExtension$1 = class BaseExtension extends LayerExtension {
118986
118972
  this.opts = this.opts || {};
118987
118973
  }
118988
118974
  getShaders() {
118989
- var _a3;
118990
- const name2 = ((_a3 = this == null ? void 0 : this.props) == null ? void 0 : _a3.colormap) || defaultProps$1$2.colormap.value;
118975
+ const name2 = this?.props?.colormap || defaultProps$1$2.colormap.value;
118991
118976
  const apply_cmap = cmaps[name2];
118992
118977
  return {
118993
118978
  ...super.getShaders(),
@@ -119095,7 +119080,6 @@ const BaseExtension2 = class extends LayerExtension {
119095
119080
  this.opts = this.opts || {};
119096
119081
  }
119097
119082
  draw() {
119098
- var _a3;
119099
119083
  const { colors, channelsVisible } = this.props;
119100
119084
  const paddedColors = padColors({
119101
119085
  channelsVisible: channelsVisible || this.selections.map(() => true),
@@ -119104,7 +119088,7 @@ const BaseExtension2 = class extends LayerExtension {
119104
119088
  const uniforms = {
119105
119089
  colors: paddedColors
119106
119090
  };
119107
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
119091
+ this.state.model?.setUniforms(uniforms);
119108
119092
  }
119109
119093
  };
119110
119094
  BaseExtension2.extensionName = "BaseExtension";
@@ -119243,9 +119227,8 @@ function padContrastLimits({
119243
119227
  return paddedContrastLimits;
119244
119228
  }
119245
119229
  function getPhysicalSizeScalingMatrix(loader) {
119246
- var _a3;
119247
- const { x, y, z } = ((_a3 = loader == null ? void 0 : loader.meta) == null ? void 0 : _a3.physicalSizes) ?? {};
119248
- if ((x == null ? void 0 : x.size) && (y == null ? void 0 : y.size) && (z == null ? void 0 : z.size)) {
119230
+ const { x, y, z } = loader?.meta?.physicalSizes ?? {};
119231
+ if (x?.size && y?.size && z?.size) {
119249
119232
  const min2 = Math.min(z.size, x.size, y.size);
119250
119233
  const ratio = [x.size / min2, y.size / min2, z.size / min2];
119251
119234
  return new Matrix4().scale(ratio);
@@ -119472,11 +119455,11 @@ const XRLayer = class extends Layer {
119472
119455
  }
119473
119456
  _isHookDefinedByExtensions(hookName) {
119474
119457
  const { extensions } = this.props;
119475
- return extensions == null ? void 0 : extensions.some((e2) => {
119458
+ return extensions?.some((e2) => {
119476
119459
  const shaders = e2.getShaders();
119477
119460
  const { inject: inject2 = {}, modules = [] } = shaders;
119478
119461
  const definesInjection = inject2[hookName];
119479
- const moduleDefinesInjection = modules.some((m) => m == null ? void 0 : m.inject[hookName]);
119462
+ const moduleDefinesInjection = modules.some((m) => m?.inject[hookName]);
119480
119463
  return definesInjection || moduleDefinesInjection;
119481
119464
  });
119482
119465
  }
@@ -119525,7 +119508,6 @@ const XRLayer = class extends Layer {
119525
119508
  * and loading any textures that need be loading.
119526
119509
  */
119527
119510
  updateState({ props, oldProps, changeFlags, ...rest }) {
119528
- var _a3, _b2;
119529
119511
  super.updateState({ props, oldProps, changeFlags, ...rest });
119530
119512
  if (changeFlags.extensionsChanged || props.interpolation !== oldProps.interpolation) {
119531
119513
  const { gl } = this.context;
@@ -119535,7 +119517,7 @@ const XRLayer = class extends Layer {
119535
119517
  this.setState({ model: this._getModel(gl) });
119536
119518
  this.getAttributeManager().invalidateAll();
119537
119519
  }
119538
- 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) {
119520
+ if (props.channelData !== oldProps.channelData && props.channelData?.data !== oldProps.channelData?.data || props.interpolation !== oldProps.interpolation) {
119539
119521
  this.loadChannelTextures(props.channelData);
119540
119522
  }
119541
119523
  const attributeManager = this.getAttributeManager();
@@ -119634,7 +119616,6 @@ const XRLayer = class extends Layer {
119634
119616
  * This function creates textures from the data
119635
119617
  */
119636
119618
  dataToTexture(data, width, height) {
119637
- var _a3;
119638
119619
  const { interpolation } = this.props;
119639
119620
  const attrs = getRenderingAttrs$1(
119640
119621
  this.props.dtype,
@@ -119644,7 +119625,7 @@ const XRLayer = class extends Layer {
119644
119625
  return new Texture2D(this.context.gl, {
119645
119626
  width,
119646
119627
  height,
119647
- data: ((_a3 = attrs.cast) == null ? void 0 : _a3.call(attrs, data)) ?? data,
119628
+ data: attrs.cast?.(data) ?? data,
119648
119629
  // we don't want or need mimaps
119649
119630
  mipmaps: false,
119650
119631
  parameters: {
@@ -119903,11 +119884,10 @@ const ImageLayer = class extends CompositeLayer {
119903
119884
  const getRaster = (selection) => loader.getRaster({ selection, signal });
119904
119885
  const dataPromises = selections.map(getRaster);
119905
119886
  Promise.all(dataPromises).then((rasters) => {
119906
- var _a3, _b2;
119907
119887
  const raster = {
119908
119888
  data: rasters.map((d) => d.data),
119909
- width: (_a3 = rasters[0]) == null ? void 0 : _a3.width,
119910
- height: (_b2 = rasters[0]) == null ? void 0 : _b2.height
119889
+ width: rasters[0]?.width,
119890
+ height: rasters[0]?.height
119911
119891
  };
119912
119892
  if (isInterleaved$1(loader.shape)) {
119913
119893
  raster.data = raster.data[0];
@@ -120628,13 +120608,13 @@ const XR3DLayer = class extends Layer {
120628
120608
  }
120629
120609
  _isHookDefinedByExtensions(hookName) {
120630
120610
  const { extensions } = this.props;
120631
- return extensions == null ? void 0 : extensions.some((e2) => {
120611
+ return extensions?.some((e2) => {
120632
120612
  const shaders = e2.getShaders();
120633
120613
  if (shaders) {
120634
120614
  const { inject: inject2 = {}, modules = [] } = shaders;
120635
120615
  const definesInjection = inject2[hookName];
120636
120616
  const moduleDefinesInjection = modules.some(
120637
- (m) => m.inject && (m == null ? void 0 : m.inject[hookName])
120617
+ (m) => m.inject && m?.inject[hookName]
120638
120618
  );
120639
120619
  return definesInjection || moduleDefinesInjection;
120640
120620
  }
@@ -120679,7 +120659,6 @@ const XR3DLayer = class extends Layer {
120679
120659
  * and loading any textures that need be loading.
120680
120660
  */
120681
120661
  updateState({ props, oldProps, changeFlags }) {
120682
- var _a3, _b2;
120683
120662
  if (changeFlags.extensionsChanged || props.colormap !== oldProps.colormap || props.renderingMode !== oldProps.renderingMode || props.clippingPlanes.length !== oldProps.clippingPlanes.length) {
120684
120663
  const { gl } = this.context;
120685
120664
  if (this.state.model) {
@@ -120687,7 +120666,7 @@ const XR3DLayer = class extends Layer {
120687
120666
  }
120688
120667
  this.setState({ model: this._getModel(gl) });
120689
120668
  }
120690
- 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)) {
120669
+ if (props.channelData && props?.channelData?.data !== oldProps?.channelData?.data) {
120691
120670
  this.loadTexture(props.channelData);
120692
120671
  }
120693
120672
  }
@@ -120808,13 +120787,12 @@ const XR3DLayer = class extends Layer {
120808
120787
  * This function creates textures from the data
120809
120788
  */
120810
120789
  dataToTexture(data, width, height, depth) {
120811
- var _a3;
120812
120790
  const attrs = getRenderingAttrs();
120813
120791
  const texture = new Texture3D(this.context.gl, {
120814
120792
  width,
120815
120793
  height,
120816
120794
  depth,
120817
- data: ((_a3 = attrs.cast) == null ? void 0 : _a3.call(attrs, data)) ?? data,
120795
+ data: attrs.cast?.(data) ?? data,
120818
120796
  // ? Seems to be a luma.gl bug. Looks like Texture2D is wrong or this is but these are flipped somewhere.
120819
120797
  format: attrs.dataFormat,
120820
120798
  dataFormat: attrs.format,
@@ -120987,15 +120965,14 @@ const VolumeLayer = class extends CompositeLayer {
120987
120965
  loader[resolution]
120988
120966
  );
120989
120967
  Promise.all(volumePromises).then((volumes) => {
120990
- var _a3, _b2, _c;
120991
120968
  if (onViewportLoad) {
120992
120969
  onViewportLoad(volumes);
120993
120970
  }
120994
120971
  const volume = {
120995
120972
  data: volumes.map((d) => d.data),
120996
- width: (_a3 = volumes[0]) == null ? void 0 : _a3.width,
120997
- height: (_b2 = volumes[0]) == null ? void 0 : _b2.height,
120998
- depth: (_c = volumes[0]) == null ? void 0 : _c.depth
120973
+ width: volumes[0]?.width,
120974
+ height: volumes[0]?.height,
120975
+ depth: volumes[0]?.depth
120999
120976
  };
121000
120977
  this.setState({
121001
120978
  ...volume,
@@ -121361,7 +121338,7 @@ function toFinite(value) {
121361
121338
  return value === 0 ? value : 0;
121362
121339
  }
121363
121340
  value = toNumber(value);
121364
- if (value === INFINITY || value === -Infinity) {
121341
+ if (value === INFINITY || value === -INFINITY) {
121365
121342
  var sign2 = value < 0 ? -1 : 1;
121366
121343
  return sign2 * MAX_INTEGER;
121367
121344
  }
@@ -122111,7 +122088,7 @@ uniform float channelOpacities[7];
122111
122088
  uniform bool channelIsStaticColorMode[7]; // TODO: should this be a single float?
122112
122089
  uniform bool channelIsSetColorMode[7]; // TODO: should this be a single float?
122113
122090
 
122114
- // TODO: can array of tuples/vec2 be used?
122091
+ uniform int channelColormapFuncIndices[7];
122115
122092
  uniform float channelColormapRangeStarts[7];
122116
122093
  uniform float channelColormapRangeEnds[7];
122117
122094
 
@@ -122177,7 +122154,30 @@ vec3 sampleAndGetData(sampler2D dataTex, vec2 coord, bool isFilled, float stroke
122177
122154
  return vec3(clampedSampledData * float(isOn), sampledData, float(isEdge));
122178
122155
  }
122179
122156
 
122180
- vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
122157
+ vec3 colormapFunc(float clampedScaledExpressionValue, int colormapIndex) {
122158
+ // Map indices of GLSL_COLORMAPS array to their function calls.
122159
+ // GLSL_COLORMAPS is defined in ./constants.js and needs to stay manually synced.
122160
+ // 0: 'plasma',
122161
+ // 1: 'viridis',
122162
+ // 2: 'jet',
122163
+ // 3: 'greys',
122164
+
122165
+ if (colormapIndex <= 0) {
122166
+ // This should also match -1, to account for a failed Array.indexOf lookup.
122167
+ return plasma(clampedScaledExpressionValue).rgb;
122168
+ }
122169
+ if (colormapIndex == 1) {
122170
+ return viridis(clampedScaledExpressionValue).rgb;
122171
+ }
122172
+ if (colormapIndex == 2) {
122173
+ return jet(clampedScaledExpressionValue).rgb;
122174
+ }
122175
+ if (colormapIndex == 3) {
122176
+ return greys(clampedScaledExpressionValue).rgb;
122177
+ }
122178
+ }
122179
+
122180
+ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, int colormapFuncIndex, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
122181
122181
  float clampedSampledDataAndIsOn = sampledDataAndIsEdge.x;
122182
122182
  float sampledData = sampledDataAndIsEdge.y;
122183
122183
  float isEdge = sampledDataAndIsEdge.z;
@@ -122221,7 +122221,7 @@ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channel
122221
122221
  }
122222
122222
 
122223
122223
 
122224
- 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);
122224
+ 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);
122225
122225
  // Only return a color if the data is non-zero.
122226
122226
 
122227
122227
  return clampedSampledDataAndIsOn * isEdge * sampledColor;
@@ -122237,15 +122237,15 @@ void main() {
122237
122237
  vec3 dat4 = sampleAndGetData(channel4, vTexCoord, channelsFilled[4], channelStrokeWidths[4], channelsVisible[4]);
122238
122238
  vec3 dat5 = sampleAndGetData(channel5, vTexCoord, channelsFilled[5], channelStrokeWidths[5], channelsVisible[5]);
122239
122239
  vec3 dat6 = sampleAndGetData(channel6, vTexCoord, channelsFilled[6], channelStrokeWidths[6], channelsVisible[6]);
122240
-
122241
- vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
122242
- vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
122243
- vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
122244
- vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
122245
- vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
122246
- vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
122247
- vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
122248
-
122240
+
122241
+ vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapFuncIndices[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
122242
+ vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapFuncIndices[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
122243
+ vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapFuncIndices[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
122244
+ vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapFuncIndices[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
122245
+ vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapFuncIndices[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
122246
+ vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapFuncIndices[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
122247
+ vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapFuncIndices[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
122248
+
122249
122249
  // If all of the channels are "empty", then discard this pixel so that it is not considered during picking.
122250
122250
  float emptyDat = 0.;
122251
122251
  if(dat0.x == emptyDat && dat1.x == emptyDat && dat2.x == emptyDat && dat3.x == emptyDat && dat4.x == emptyDat && dat5.x == emptyDat && dat6.x == emptyDat) {
@@ -122567,12 +122567,11 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
122567
122567
  let totalValuesLength = 0;
122568
122568
  let totalColorsLength = 0;
122569
122569
  channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
122570
- var _a3, _b2, _c, _d;
122571
122570
  if (isSetColorMode) {
122572
- totalColorsLength += (((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.setColors) == null ? void 0 : _b2.length) ?? 0) * 3;
122573
- totalValuesLength += ((_c = setColorValues[channelIndex]) == null ? void 0 : _c.obsIndex) ? max$1(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
122571
+ totalColorsLength += (setColorValues[channelIndex]?.setColors?.length ?? 0) * 3;
122572
+ totalValuesLength += setColorValues[channelIndex]?.obsIndex ? max$1(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
122574
122573
  } else {
122575
- totalValuesLength += multiMatrixObsIndex[channelIndex] ? max$1(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : ((_d = multiFeatureValues[channelIndex]) == null ? void 0 : _d.length) ?? 0;
122574
+ totalValuesLength += multiMatrixObsIndex[channelIndex] ? max$1(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : multiFeatureValues[channelIndex]?.length ?? 0;
122576
122575
  }
122577
122576
  });
122578
122577
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
@@ -122614,8 +122613,8 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
122614
122613
  }
122615
122614
  indicesOffsets.push(indexOffset);
122616
122615
  colorsOffsets.push(colorOffset);
122617
- indexOffset += (obsIndex == null ? void 0 : obsIndex.length) || 0;
122618
- colorOffset += (setColors == null ? void 0 : setColors.length) || 0;
122616
+ indexOffset += obsIndex?.length || 0;
122617
+ colorOffset += setColors?.length || 0;
122619
122618
  } else {
122620
122619
  const featureArr = multiFeatureValues[channelIndex] ?? [];
122621
122620
  const normalizedFeatureArr = normalize(featureArr);
@@ -122684,14 +122683,10 @@ const defaultProps$1 = {
122684
122683
  class BitmaskLayer2 extends XRLayer {
122685
122684
  // eslint-disable-next-line class-methods-use-this
122686
122685
  getShaders() {
122687
- const { colormap } = this.props;
122688
122686
  return {
122689
122687
  fs,
122690
122688
  vs,
122691
- modules: [project32, picking],
122692
- defines: {
122693
- [COLORMAP_SHADER_PLACEHOLDER]: GLSL_COLORMAPS.includes(colormap) ? colormap : GLSL_COLORMAP_DEFAULT
122694
- }
122689
+ modules: [project32, picking]
122695
122690
  };
122696
122691
  }
122697
122692
  /**
@@ -122750,8 +122745,6 @@ class BitmaskLayer2 extends XRLayer {
122750
122745
  channelOpacities,
122751
122746
  channelColors,
122752
122747
  channelsVisible,
122753
- // TODO: use `channelFeatureValueColormaps` in shader,
122754
- // figure out how to call multiple GLSL colormap functions
122755
122748
  channelFeatureValueColormaps,
122756
122749
  channelFeatureValueColormapRanges,
122757
122750
  channelIsStaticColorMode,
@@ -122812,14 +122805,20 @@ class BitmaskLayer2 extends XRLayer {
122812
122805
  // There are six texture entries on the shaders
122813
122806
  MAX_CHANNELS - channelStrokeWidths.length
122814
122807
  ),
122808
+ channelColormapFuncIndices: padWithDefault(
122809
+ channelFeatureValueColormaps.map((d) => GLSL_COLORMAPS.indexOf(d)),
122810
+ 0,
122811
+ // There are six texture entries on the shaders
122812
+ MAX_CHANNELS - channelFeatureValueColormaps.length
122813
+ ),
122815
122814
  channelColormapRangeStarts: padWithDefault(
122816
- channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[0]) || 0),
122815
+ channelFeatureValueColormapRanges.map((r2) => r2?.[0] || 0),
122817
122816
  0,
122818
122817
  // There are six texture entries on the shaders
122819
122818
  MAX_CHANNELS - channelFeatureValueColormapRanges.length
122820
122819
  ),
122821
122820
  channelColormapRangeEnds: padWithDefault(
122822
- channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[1]) || 1),
122821
+ channelFeatureValueColormapRanges.map((r2) => r2?.[1] || 1),
122823
122822
  1,
122824
122823
  // There are six texture entries on the shaders
122825
122824
  MAX_CHANNELS - channelFeatureValueColormapRanges.length
@@ -123085,24 +123084,24 @@ function clone$2(configObject) {
123085
123084
  if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
123086
123085
  v = obj[p];
123087
123086
  if (v && v.pop) {
123088
- intCheck(v[0], -1e9, 0, p);
123087
+ intCheck(v[0], -MAX, 0, p);
123089
123088
  intCheck(v[1], 0, MAX, p);
123090
123089
  TO_EXP_NEG = v[0];
123091
123090
  TO_EXP_POS = v[1];
123092
123091
  } else {
123093
- intCheck(v, -1e9, MAX, p);
123092
+ intCheck(v, -MAX, MAX, p);
123094
123093
  TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
123095
123094
  }
123096
123095
  }
123097
123096
  if (obj.hasOwnProperty(p = "RANGE")) {
123098
123097
  v = obj[p];
123099
123098
  if (v && v.pop) {
123100
- intCheck(v[0], -1e9, -1, p);
123099
+ intCheck(v[0], -MAX, -1, p);
123101
123100
  intCheck(v[1], 1, MAX, p);
123102
123101
  MIN_EXP = v[0];
123103
123102
  MAX_EXP = v[1];
123104
123103
  } else {
123105
- intCheck(v, -1e9, MAX, p);
123104
+ intCheck(v, -MAX, MAX, p);
123106
123105
  if (v) {
123107
123106
  MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
123108
123107
  } else {
@@ -123172,7 +123171,7 @@ function clone$2(configObject) {
123172
123171
  if (!BigNumber2.DEBUG) return true;
123173
123172
  var i2, n3, c = v.c, e2 = v.e, s2 = v.s;
123174
123173
  out: if ({}.toString.call(c) == "[object Array]") {
123175
- if ((s2 === 1 || s2 === -1) && e2 >= -1e9 && e2 <= MAX && e2 === mathfloor$1(e2)) {
123174
+ if ((s2 === 1 || s2 === -1) && e2 >= -MAX && e2 <= MAX && e2 === mathfloor$1(e2)) {
123176
123175
  if (c[0] === 0) {
123177
123176
  if (e2 === 0 && c.length === 1) return true;
123178
123177
  break out;
@@ -124012,7 +124011,7 @@ function clone$2(configObject) {
124012
124011
  return n3;
124013
124012
  };
124014
124013
  P2.shiftedBy = function(k) {
124015
- intCheck(k, -9007199254740991, MAX_SAFE_INTEGER$1);
124014
+ intCheck(k, -MAX_SAFE_INTEGER$1, MAX_SAFE_INTEGER$1);
124016
124015
  return this.times("1e" + k);
124017
124016
  };
124018
124017
  P2.squareRoot = P2.sqrt = function() {
@@ -124262,10 +124261,10 @@ function toFixedPoint(str, e2, z) {
124262
124261
  }
124263
124262
  var BigNumber$1 = clone$2();
124264
124263
  var SplayTreeNode = class {
124264
+ key;
124265
+ left = null;
124266
+ right = null;
124265
124267
  constructor(key) {
124266
- __publicField(this, "key");
124267
- __publicField(this, "left", null);
124268
- __publicField(this, "right", null);
124269
124268
  this.key = key;
124270
124269
  }
124271
124270
  };
@@ -124275,11 +124274,9 @@ var SplayTreeSetNode = class extends SplayTreeNode {
124275
124274
  }
124276
124275
  };
124277
124276
  var SplayTree = class {
124278
- constructor() {
124279
- __publicField(this, "size", 0);
124280
- __publicField(this, "modificationCount", 0);
124281
- __publicField(this, "splayCount", 0);
124282
- }
124277
+ size = 0;
124278
+ modificationCount = 0;
124279
+ splayCount = 0;
124283
124280
  splay(key) {
124284
124281
  const root2 = this.root;
124285
124282
  if (root2 == null) {
@@ -124464,12 +124461,11 @@ var SplayTree = class {
124464
124461
  }
124465
124462
  };
124466
124463
  var SplayTreeSet = class _SplayTreeSet extends SplayTree {
124464
+ root = null;
124465
+ compare;
124466
+ validKey;
124467
124467
  constructor(compare2, isValidKey) {
124468
124468
  super();
124469
- __publicField(this, "root", null);
124470
- __publicField(this, "compare");
124471
- __publicField(this, "validKey");
124472
- __publicField(this, _a2, "[object Set]");
124473
124469
  this.compare = compare2 ?? this.defaultCompare();
124474
124470
  this.validKey = isValidKey ?? ((v) => v != null && v != void 0);
124475
124471
  }
@@ -124636,16 +124632,17 @@ var SplayTreeSet = class _SplayTreeSet extends SplayTree {
124636
124632
  values() {
124637
124633
  return this[Symbol.iterator]();
124638
124634
  }
124639
- [(_b = Symbol.iterator, _a2 = Symbol.toStringTag, _b)]() {
124635
+ [Symbol.iterator]() {
124640
124636
  return new SplayTreeKeyIterableIterator(this.wrap());
124641
124637
  }
124638
+ [Symbol.toStringTag] = "[object Set]";
124642
124639
  };
124643
124640
  var SplayTreeIterableIterator = class {
124641
+ tree;
124642
+ path = new Array();
124643
+ modificationCount = null;
124644
+ splayCount;
124644
124645
  constructor(tree) {
124645
- __publicField(this, "tree");
124646
- __publicField(this, "path", new Array());
124647
- __publicField(this, "modificationCount", null);
124648
- __publicField(this, "splayCount");
124649
124646
  this.tree = tree;
124650
124647
  this.splayCount = tree.getSplayCount();
124651
124648
  }
@@ -124822,18 +124819,11 @@ var intersection = (pt1, v12, pt2, v2) => {
124822
124819
  return { x, y };
124823
124820
  };
124824
124821
  var SweepEvent = class _SweepEvent {
124825
- // Warning: 'point' input will be modified and re-used (for performance)
124826
- constructor(point2, isLeft) {
124827
- __publicField(this, "point");
124828
- __publicField(this, "isLeft");
124829
- __publicField(this, "segment");
124830
- __publicField(this, "otherSE");
124831
- __publicField(this, "consumedBy");
124832
- if (point2.events === void 0) point2.events = [this];
124833
- else point2.events.push(this);
124834
- this.point = point2;
124835
- this.isLeft = isLeft;
124836
- }
124822
+ point;
124823
+ isLeft;
124824
+ segment;
124825
+ otherSE;
124826
+ consumedBy;
124837
124827
  // for ordering sweep events in the sweep event queue
124838
124828
  static compare(a2, b) {
124839
124829
  const ptCmp = _SweepEvent.comparePoints(a2.point, b.point);
@@ -124850,6 +124840,13 @@ var SweepEvent = class _SweepEvent {
124850
124840
  if (aPt.y.isGreaterThan(bPt.y)) return 1;
124851
124841
  return 0;
124852
124842
  }
124843
+ // Warning: 'point' input will be modified and re-used (for performance)
124844
+ constructor(point2, isLeft) {
124845
+ if (point2.events === void 0) point2.events = [this];
124846
+ else point2.events.push(this);
124847
+ this.point = point2;
124848
+ this.isLeft = isLeft;
124849
+ }
124853
124850
  link(other) {
124854
124851
  if (other.point === this.point) {
124855
124852
  throw new Error("Tried to link already linked events");
@@ -124928,17 +124925,10 @@ var SweepEvent = class _SweepEvent {
124928
124925
  }
124929
124926
  };
124930
124927
  var RingOut = class _RingOut {
124931
- constructor(events2) {
124932
- __publicField(this, "events");
124933
- __publicField(this, "poly");
124934
- __publicField(this, "_isExteriorRing");
124935
- __publicField(this, "_enclosingRing");
124936
- this.events = events2;
124937
- for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
124938
- events2[i2].segment.ringOut = this;
124939
- }
124940
- this.poly = null;
124941
- }
124928
+ events;
124929
+ poly;
124930
+ _isExteriorRing;
124931
+ _enclosingRing;
124942
124932
  /* Given the segments from the sweep line pass, compute & return a series
124943
124933
  * of closed rings from all the segments marked to be part of the result */
124944
124934
  static factory(allSegments) {
@@ -124997,6 +124987,13 @@ var RingOut = class _RingOut {
124997
124987
  }
124998
124988
  return ringsOut;
124999
124989
  }
124990
+ constructor(events2) {
124991
+ this.events = events2;
124992
+ for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
124993
+ events2[i2].segment.ringOut = this;
124994
+ }
124995
+ this.poly = null;
124996
+ }
125000
124997
  getGeom() {
125001
124998
  let prevPt = this.events[0].point;
125002
124999
  const points = [prevPt];
@@ -125035,7 +125032,6 @@ var RingOut = class _RingOut {
125035
125032
  }
125036
125033
  /* Returns the ring that encloses this one, if any */
125037
125034
  _calcEnclosingRing() {
125038
- var _a3, _b2;
125039
125035
  let leftMostEvt = this.events[0];
125040
125036
  for (let i2 = 1, iMax = this.events.length; i2 < iMax; i2++) {
125041
125037
  const evt = this.events[i2];
@@ -125047,9 +125043,9 @@ var RingOut = class _RingOut {
125047
125043
  if (!prevSeg) return null;
125048
125044
  if (!prevPrevSeg) return prevSeg.ringOut;
125049
125045
  if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
125050
- if (((_a3 = prevPrevSeg.ringOut) == null ? void 0 : _a3.enclosingRing()) !== prevSeg.ringOut) {
125046
+ if (prevPrevSeg.ringOut?.enclosingRing() !== prevSeg.ringOut) {
125051
125047
  return prevSeg.ringOut;
125052
- } else return (_b2 = prevSeg.ringOut) == null ? void 0 : _b2.enclosingRing();
125048
+ } else return prevSeg.ringOut?.enclosingRing();
125053
125049
  }
125054
125050
  prevSeg = prevPrevSeg.prevInResult();
125055
125051
  prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
@@ -125057,9 +125053,9 @@ var RingOut = class _RingOut {
125057
125053
  }
125058
125054
  };
125059
125055
  var PolyOut = class {
125056
+ exteriorRing;
125057
+ interiorRings;
125060
125058
  constructor(exteriorRing) {
125061
- __publicField(this, "exteriorRing");
125062
- __publicField(this, "interiorRings");
125063
125059
  this.exteriorRing = exteriorRing;
125064
125060
  exteriorRing.poly = this;
125065
125061
  this.interiorRings = [];
@@ -125081,9 +125077,9 @@ var PolyOut = class {
125081
125077
  }
125082
125078
  };
125083
125079
  var MultiPolyOut = class {
125080
+ rings;
125081
+ polys;
125084
125082
  constructor(rings) {
125085
- __publicField(this, "rings");
125086
- __publicField(this, "polys");
125087
125083
  this.rings = rings;
125088
125084
  this.polys = this._composePolys(rings);
125089
125085
  }
@@ -125097,7 +125093,6 @@ var MultiPolyOut = class {
125097
125093
  return geom;
125098
125094
  }
125099
125095
  _composePolys(rings) {
125100
- var _a3;
125101
125096
  const polys = [];
125102
125097
  for (let i2 = 0, iMax = rings.length; i2 < iMax; i2++) {
125103
125098
  const ring = rings[i2];
@@ -125105,18 +125100,18 @@ var MultiPolyOut = class {
125105
125100
  if (ring.isExteriorRing()) polys.push(new PolyOut(ring));
125106
125101
  else {
125107
125102
  const enclosingRing = ring.enclosingRing();
125108
- if (!(enclosingRing == null ? void 0 : enclosingRing.poly)) polys.push(new PolyOut(enclosingRing));
125109
- (_a3 = enclosingRing == null ? void 0 : enclosingRing.poly) == null ? void 0 : _a3.addInterior(ring);
125103
+ if (!enclosingRing?.poly) polys.push(new PolyOut(enclosingRing));
125104
+ enclosingRing?.poly?.addInterior(ring);
125110
125105
  }
125111
125106
  }
125112
125107
  return polys;
125113
125108
  }
125114
125109
  };
125115
125110
  var SweepLine = class {
125111
+ queue;
125112
+ tree;
125113
+ segments;
125116
125114
  constructor(queue, comparator = Segment2.compare) {
125117
- __publicField(this, "queue");
125118
- __publicField(this, "tree");
125119
- __publicField(this, "segments");
125120
125115
  this.queue = queue;
125121
125116
  this.tree = new SplayTreeSet(comparator);
125122
125117
  this.segments = [];
@@ -125225,10 +125220,8 @@ var SweepLine = class {
125225
125220
  }
125226
125221
  };
125227
125222
  var Operation = class {
125228
- constructor() {
125229
- __publicField(this, "type");
125230
- __publicField(this, "numMultiPolys");
125231
- }
125223
+ type;
125224
+ numMultiPolys;
125232
125225
  run(type, geom, moreGeoms) {
125233
125226
  operation.type = type;
125234
125227
  const multipolys = [new MultiPolyIn(geom, true)];
@@ -125288,31 +125281,18 @@ var operation = new Operation();
125288
125281
  var operation_default = operation;
125289
125282
  var segmentId = 0;
125290
125283
  var Segment2 = class _Segment {
125291
- /* Warning: a reference to ringWindings input will be stored,
125292
- * and possibly will be later modified */
125293
- constructor(leftSE, rightSE, rings, windings) {
125294
- __publicField(this, "id");
125295
- __publicField(this, "leftSE");
125296
- __publicField(this, "rightSE");
125297
- __publicField(this, "rings");
125298
- __publicField(this, "windings");
125299
- __publicField(this, "ringOut");
125300
- __publicField(this, "consumedBy");
125301
- __publicField(this, "prev");
125302
- __publicField(this, "_prevInResult");
125303
- __publicField(this, "_beforeState");
125304
- __publicField(this, "_afterState");
125305
- __publicField(this, "_isInResult");
125306
- this.id = ++segmentId;
125307
- this.leftSE = leftSE;
125308
- leftSE.segment = this;
125309
- leftSE.otherSE = rightSE;
125310
- this.rightSE = rightSE;
125311
- rightSE.segment = this;
125312
- rightSE.otherSE = leftSE;
125313
- this.rings = rings;
125314
- this.windings = windings;
125315
- }
125284
+ id;
125285
+ leftSE;
125286
+ rightSE;
125287
+ rings;
125288
+ windings;
125289
+ ringOut;
125290
+ consumedBy;
125291
+ prev;
125292
+ _prevInResult;
125293
+ _beforeState;
125294
+ _afterState;
125295
+ _isInResult;
125316
125296
  /* This compare() function is for ordering segments in the sweep
125317
125297
  * line tree, and does so according to the following criteria:
125318
125298
  *
@@ -125384,6 +125364,19 @@ var Segment2 = class _Segment {
125384
125364
  if (a2.id > b.id) return 1;
125385
125365
  return 0;
125386
125366
  }
125367
+ /* Warning: a reference to ringWindings input will be stored,
125368
+ * and possibly will be later modified */
125369
+ constructor(leftSE, rightSE, rings, windings) {
125370
+ this.id = ++segmentId;
125371
+ this.leftSE = leftSE;
125372
+ leftSE.segment = this;
125373
+ leftSE.otherSE = rightSE;
125374
+ this.rightSE = rightSE;
125375
+ rightSE.segment = this;
125376
+ rightSE.otherSE = leftSE;
125377
+ this.rings = rings;
125378
+ this.windings = windings;
125379
+ }
125387
125380
  static fromRing(pt1, pt2, ring) {
125388
125381
  let leftPt, rightPt, winding;
125389
125382
  const cmpPts = SweepEvent.comparePoints(pt1, pt2);
@@ -125684,11 +125677,11 @@ var Segment2 = class _Segment {
125684
125677
  }
125685
125678
  };
125686
125679
  var RingIn = class {
125680
+ poly;
125681
+ isExterior;
125682
+ segments;
125683
+ bbox;
125687
125684
  constructor(geomRing, poly, isExterior) {
125688
- __publicField(this, "poly");
125689
- __publicField(this, "isExterior");
125690
- __publicField(this, "segments");
125691
- __publicField(this, "bbox");
125692
125685
  if (!Array.isArray(geomRing) || geomRing.length === 0) {
125693
125686
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
125694
125687
  }
@@ -125732,11 +125725,11 @@ var RingIn = class {
125732
125725
  }
125733
125726
  };
125734
125727
  var PolyIn = class {
125728
+ multiPoly;
125729
+ exteriorRing;
125730
+ interiorRings;
125731
+ bbox;
125735
125732
  constructor(geomPoly, multiPoly) {
125736
- __publicField(this, "multiPoly");
125737
- __publicField(this, "exteriorRing");
125738
- __publicField(this, "interiorRings");
125739
- __publicField(this, "bbox");
125740
125733
  if (!Array.isArray(geomPoly)) {
125741
125734
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
125742
125735
  }
@@ -125768,10 +125761,10 @@ var PolyIn = class {
125768
125761
  }
125769
125762
  };
125770
125763
  var MultiPolyIn = class {
125764
+ isSubject;
125765
+ polys;
125766
+ bbox;
125771
125767
  constructor(geom, isSubject) {
125772
- __publicField(this, "isSubject");
125773
- __publicField(this, "polys");
125774
- __publicField(this, "bbox");
125775
125768
  if (!Array.isArray(geom)) {
125776
125769
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
125777
125770
  }
@@ -125933,17 +125926,17 @@ function getMaxAreaPolygon(levelToUse) {
125933
125926
  return [maxAreaValue, maxAreaPolygon];
125934
125927
  }
125935
125928
  function getMaxAreaPolygonAndLevel(contourPolygons) {
125936
- const l2 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 2)) ?? [];
125929
+ const l2 = contourPolygons?.filter((d) => d.contour.i === 2) ?? [];
125937
125930
  const [l2area, l2polygon] = getMaxAreaPolygon(l2);
125938
125931
  if (Math.log10(l2area) >= MIN_AREA_THRESHOLD) {
125939
125932
  return [l2area, l2polygon, 2];
125940
125933
  }
125941
- const l1 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 1)) ?? [];
125934
+ const l1 = contourPolygons?.filter((d) => d.contour.i === 1) ?? [];
125942
125935
  const [l1area, l1polygon] = getMaxAreaPolygon(l1);
125943
125936
  if (Math.log10(l1area) >= MIN_AREA_THRESHOLD) {
125944
125937
  return [l1area, l1polygon, 1];
125945
125938
  }
125946
- const l0 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 0)) ?? [];
125939
+ const l0 = contourPolygons?.filter((d) => d.contour.i === 0) ?? [];
125947
125940
  const [l0area, l0polygon] = getMaxAreaPolygon(l0);
125948
125941
  return [l0area, l0polygon, 0];
125949
125942
  }
@@ -125959,7 +125952,7 @@ class ContourLayerWithText extends ContourLayer {
125959
125952
  if (!circleInfo) {
125960
125953
  return lineAndTextLayers;
125961
125954
  }
125962
- const obsSetName = obsSetPath == null ? void 0 : obsSetPath.at(-1);
125955
+ const obsSetName = obsSetPath?.at(-1);
125963
125956
  const [maxAreaValue, maxAreaPolygon, levelI] = getMaxAreaPolygonAndLevel(contourPolygons);
125964
125957
  const { center, steps, polygon: circlePolygon } = circleInfo;
125965
125958
  if (maxAreaValue > 0 && maxAreaPolygon) {
@@ -128370,7 +128363,7 @@ var EXP_LIMIT = 9e15, MAX_DIGITS = 1e9, NUMERALS = "0123456789abcdef", LN10 = "2
128370
128363
  // 0 to EXP_LIMIT
128371
128364
  // The minimum exponent value, beneath which underflow to zero occurs.
128372
128365
  // JavaScript numbers: -324 (5e-324)
128373
- minE: -9e15,
128366
+ minE: -EXP_LIMIT,
128374
128367
  // -1 to -EXP_LIMIT
128375
128368
  // The maximum exponent value, above which overflow to Infinity occurs.
128376
128369
  // JavaScript numbers: 308 (1.7976931348623157e+308)
@@ -130125,7 +130118,7 @@ function config2(obj) {
130125
130118
  0,
130126
130119
  8,
130127
130120
  "toExpNeg",
130128
- -9e15,
130121
+ -EXP_LIMIT,
130129
130122
  0,
130130
130123
  "toExpPos",
130131
130124
  0,
@@ -130134,7 +130127,7 @@ function config2(obj) {
130134
130127
  0,
130135
130128
  EXP_LIMIT,
130136
130129
  "minE",
130137
- -9e15,
130130
+ -EXP_LIMIT,
130138
130131
  0,
130139
130132
  "modulo",
130140
130133
  0,
@@ -130550,15 +130543,15 @@ function requireComplex() {
130550
130543
  throw SyntaxError("Invalid Param");
130551
130544
  };
130552
130545
  function logHypot(a2, b) {
130553
- var _a3 = Math.abs(a2);
130554
- var _b2 = Math.abs(b);
130546
+ var _a2 = Math.abs(a2);
130547
+ var _b = Math.abs(b);
130555
130548
  if (a2 === 0) {
130556
- return Math.log(_b2);
130549
+ return Math.log(_b);
130557
130550
  }
130558
130551
  if (b === 0) {
130559
- return Math.log(_a3);
130552
+ return Math.log(_a2);
130560
130553
  }
130561
- if (_a3 < 3e3 && _b2 < 3e3) {
130554
+ if (_a2 < 3e3 && _b < 3e3) {
130562
130555
  return Math.log(a2 * a2 + b * b) * 0.5;
130563
130556
  }
130564
130557
  a2 = a2 / 2;
@@ -141401,9 +141394,8 @@ const getStatsForResolution = (loader, resolution) => {
141401
141394
  };
141402
141395
  };
141403
141396
  const canLoadResolution = (loader, resolution) => {
141404
- var _a3, _b2, _c;
141405
141397
  const { totalBytes, height, width, depthDownsampled } = getStatsForResolution(loader, resolution);
141406
- const maxHeapSize = ((_a3 = window.performance) == null ? void 0 : _a3.memory) && ((_c = (_b2 = window.performance) == null ? void 0 : _b2.memory) == null ? void 0 : _c.jsHeapSizeLimit) / 2;
141398
+ const maxHeapSize = window.performance?.memory && window.performance?.memory?.jsHeapSizeLimit / 2;
141407
141399
  const maxSize = maxHeapSize || 2 ** 31 - 1;
141408
141400
  return totalBytes < maxSize && height <= 2048 && depthDownsampled <= 2048 && width <= 2048 && depthDownsampled > 1;
141409
141401
  };
@@ -141441,24 +141433,17 @@ function physicalSizeToMatrix(xSize, ySize, zSize, xUnit, yUnit, zUnit) {
141441
141433
  }
141442
141434
  function getMetaWithTransformMatrices(imageMeta, imageLoaders) {
141443
141435
  const sources = imageLoaders.map((loader) => getSourceFromLoader(loader));
141444
- if (imageMeta.map((meta) => {
141445
- var _a3, _b2, _c, _d, _e, _f;
141446
- return ((_b2 = (_a3 = meta == null ? void 0 : meta.metadata) == null ? void 0 : _a3.transform) == null ? void 0 : _b2.matrix) || ((_d = (_c = meta == null ? void 0 : meta.metadata) == null ? void 0 : _c.transform) == null ? void 0 : _d.scale) || ((_f = (_e = meta == null ? void 0 : meta.metadata) == null ? void 0 : _e.transform) == null ? void 0 : _f.translate);
141447
- }).some(Boolean) || sources.every((source) => {
141448
- var _a3, _b2, _c, _d;
141449
- return !((_b2 = (_a3 = source.meta) == null ? void 0 : _a3.physicalSizes) == null ? void 0 : _b2.x) || !((_d = (_c = source.meta) == null ? void 0 : _c.physicalSizes) == null ? void 0 : _d.y);
141450
- })) {
141436
+ if (imageMeta.map((meta) => meta?.metadata?.transform?.matrix || meta?.metadata?.transform?.scale || meta?.metadata?.transform?.translate).some(Boolean) || sources.every((source) => !source.meta?.physicalSizes?.x || !source.meta?.physicalSizes?.y)) {
141451
141437
  return imageMeta;
141452
141438
  }
141453
141439
  const minPhysicalSize = sources.reduce((acc, source) => {
141454
- var _a3, _b2, _c, _d, _e, _f, _g, _h, _i;
141455
- const hasZPhyscialSize = (_c = (_b2 = (_a3 = source.meta) == null ? void 0 : _a3.physicalSizes) == null ? void 0 : _b2.z) == null ? void 0 : _c.size;
141440
+ const hasZPhyscialSize = source.meta?.physicalSizes?.z?.size;
141456
141441
  const sizes = [
141457
- unit(`${(_d = source.meta) == null ? void 0 : _d.physicalSizes.x.size} ${(_e = source.meta) == null ? void 0 : _e.physicalSizes.x.unit}`.replace("µ", "u")),
141458
- unit(`${(_f = source.meta) == null ? void 0 : _f.physicalSizes.y.size} ${(_g = source.meta) == null ? void 0 : _g.physicalSizes.y.unit}`.replace("µ", "u"))
141442
+ unit(`${source.meta?.physicalSizes.x.size} ${source.meta?.physicalSizes.x.unit}`.replace("µ", "u")),
141443
+ unit(`${source.meta?.physicalSizes.y.size} ${source.meta?.physicalSizes.y.unit}`.replace("µ", "u"))
141459
141444
  ];
141460
141445
  if (hasZPhyscialSize) {
141461
- sizes.push(unit(`${(_h = source.meta) == null ? void 0 : _h.physicalSizes.z.size} ${(_i = source.meta) == null ? void 0 : _i.physicalSizes.z.unit}`.replace("µ", "u")));
141446
+ sizes.push(unit(`${source.meta?.physicalSizes.z.size} ${source.meta?.physicalSizes.z.unit}`.replace("µ", "u")));
141462
141447
  }
141463
141448
  acc[0] = acc[0] === void 0 || compare(sizes[0], acc[0]) === -1 ? sizes[0] : acc[0];
141464
141449
  acc[1] = acc[1] === void 0 || compare(sizes[1], acc[1]) === -1 ? sizes[1] : acc[1];
@@ -141466,15 +141451,14 @@ function getMetaWithTransformMatrices(imageMeta, imageLoaders) {
141466
141451
  return acc;
141467
141452
  }, []);
141468
141453
  const imageMetaWithTransform = imageMeta.map((meta, j) => {
141469
- var _a3, _b2, _c, _d, _e, _f, _g, _h, _i;
141470
141454
  const source = sources[j];
141471
- const hasZPhyscialSize = (_c = (_b2 = (_a3 = source.meta) == null ? void 0 : _a3.physicalSizes) == null ? void 0 : _b2.z) == null ? void 0 : _c.size;
141455
+ const hasZPhyscialSize = source.meta?.physicalSizes?.z?.size;
141472
141456
  const sizes = [
141473
- unit(`${(_d = source.meta) == null ? void 0 : _d.physicalSizes.x.size} ${(_e = source.meta) == null ? void 0 : _e.physicalSizes.x.unit}`.replace("µ", "u")),
141474
- unit(`${(_f = source.meta) == null ? void 0 : _f.physicalSizes.y.size} ${(_g = source.meta) == null ? void 0 : _g.physicalSizes.y.unit}`.replace("µ", "u"))
141457
+ unit(`${source.meta?.physicalSizes.x.size} ${source.meta?.physicalSizes.x.unit}`.replace("µ", "u")),
141458
+ unit(`${source.meta?.physicalSizes.y.size} ${source.meta?.physicalSizes.y.unit}`.replace("µ", "u"))
141475
141459
  ];
141476
141460
  if (hasZPhyscialSize) {
141477
- sizes.push(unit(`${(_h = source.meta) == null ? void 0 : _h.physicalSizes.z.size} ${(_i = source.meta) == null ? void 0 : _i.physicalSizes.z.unit}`.replace("µ", "u")));
141461
+ sizes.push(unit(`${source.meta?.physicalSizes.z.size} ${source.meta?.physicalSizes.z.unit}`.replace("µ", "u")));
141478
141462
  }
141479
141463
  const scale2 = sizes.map((i2, k) => divide(i2, minPhysicalSize[k]));
141480
141464
  if (!sizes[0].equals(sizes[1])) {
@@ -141565,20 +141549,17 @@ async function initializeRasterLayersAndChannels(rasterLayers, rasterRenderLayer
141565
141549
  {
141566
141550
  const layerIndex = Math.floor(rasterLayers.length / 2);
141567
141551
  const loader = nextImageLoaders[layerIndex];
141568
- const autoImageLayerDefPromise = initializeLayerChannels(loader).then((channels2) => {
141569
- var _a3, _b2, _c, _d, _e;
141570
- return Promise.resolve({
141571
- type: ((_b2 = (_a3 = nextImageMetaAndLayers[layerIndex]) == null ? void 0 : _a3.metadata) == null ? void 0 : _b2.isBitmask) ? "bitmask" : "raster",
141572
- index: layerIndex,
141573
- ...DEFAULT_RASTER_LAYER_PROPS,
141574
- channels: channels2.map((channel, j) => ({
141575
- ...channel,
141576
- ...nextImageMetaAndLayers[layerIndex].channels ? nextImageMetaAndLayers[layerIndex].channels[j] : []
141577
- })),
141578
- modelMatrix: (_e = (_d = (_c = nextImageMetaAndLayers[layerIndex]) == null ? void 0 : _c.metadata) == null ? void 0 : _d.transform) == null ? void 0 : _e.matrix,
141579
- transparentColor: layerIndex > 0 ? [0, 0, 0] : null
141580
- });
141581
- });
141552
+ const autoImageLayerDefPromise = initializeLayerChannels(loader).then((channels2) => Promise.resolve({
141553
+ type: nextImageMetaAndLayers[layerIndex]?.metadata?.isBitmask ? "bitmask" : "raster",
141554
+ index: layerIndex,
141555
+ ...DEFAULT_RASTER_LAYER_PROPS,
141556
+ channels: channels2.map((channel, j) => ({
141557
+ ...channel,
141558
+ ...nextImageMetaAndLayers[layerIndex].channels ? nextImageMetaAndLayers[layerIndex].channels[j] : []
141559
+ })),
141560
+ modelMatrix: nextImageMetaAndLayers[layerIndex]?.metadata?.transform?.matrix,
141561
+ transparentColor: layerIndex > 0 ? [0, 0, 0] : null
141562
+ }));
141582
141563
  autoImageLayerDefPromises.push(autoImageLayerDefPromise);
141583
141564
  }
141584
141565
  const autoImageLayerDefs = await Promise.all(autoImageLayerDefPromises);
@@ -141745,7 +141726,6 @@ function getIntrinsicCoordinateSystem(normAxes) {
141745
141726
  return normAxes.map((axis) => axis.name).join("");
141746
141727
  }
141747
141728
  function normalizeCoordinateTransformations(coordinateTransformations, datasets) {
141748
- var _a3;
141749
141729
  let result = [];
141750
141730
  if (Array.isArray(coordinateTransformations)) {
141751
141731
  result = coordinateTransformations.flatMap((transform2) => {
@@ -141762,7 +141742,7 @@ function normalizeCoordinateTransformations(coordinateTransformations, datasets)
141762
141742
  return transform2;
141763
141743
  });
141764
141744
  }
141765
- if (Array.isArray((_a3 = datasets == null ? void 0 : datasets[0]) == null ? void 0 : _a3.coordinateTransformations)) {
141745
+ if (Array.isArray(datasets?.[0]?.coordinateTransformations)) {
141766
141746
  result = [
141767
141747
  ...datasets[0].coordinateTransformations,
141768
141748
  ...result
@@ -141803,10 +141783,10 @@ function getDomains() {
141803
141783
  }
141804
141784
  getDomains();
141805
141785
  class ImageWrapper {
141786
+ vivLoader;
141787
+ options;
141788
+ modelMatrix = null;
141806
141789
  constructor(vivLoader, options) {
141807
- __publicField(this, "vivLoader");
141808
- __publicField(this, "options");
141809
- __publicField(this, "modelMatrix", null);
141810
141790
  this.options = options || {};
141811
141791
  this.vivLoader = vivLoader;
141812
141792
  }
@@ -141900,7 +141880,7 @@ class ImageWrapper {
141900
141880
  }
141901
141881
  if ("channels_metadata" in this.vivLoader.metadata) {
141902
141882
  const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
141903
- return (channelsMetadata == null ? void 0 : channelsMetadata.channels.length) || 0;
141883
+ return channelsMetadata?.channels.length || 0;
141904
141884
  }
141905
141885
  if ("omero" in this.vivLoader.metadata) {
141906
141886
  const { omero: { channels: channels2 } } = this.vivLoader.metadata;
@@ -141922,7 +141902,7 @@ class ImageWrapper {
141922
141902
  }
141923
141903
  if ("channels_metadata" in this.vivLoader.metadata) {
141924
141904
  const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
141925
- if (channelsMetadata && Array.isArray(channelsMetadata == null ? void 0 : channelsMetadata.channels)) {
141905
+ if (channelsMetadata && Array.isArray(channelsMetadata?.channels)) {
141926
141906
  return channelsMetadata.channels.map((channel) => `Channel ${channel.label}`);
141927
141907
  }
141928
141908
  }
@@ -141955,7 +141935,7 @@ class ImageWrapper {
141955
141935
  }
141956
141936
  if ("channels_metadata" in this.vivLoader.metadata) {
141957
141937
  const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
141958
- if (channelsMetadata && Array.isArray(channelsMetadata == null ? void 0 : channelsMetadata.channels)) {
141938
+ if (channelsMetadata && Array.isArray(channelsMetadata?.channels)) {
141959
141939
  return channelsMetadata.channels.map((channel, i2) => ({
141960
141940
  name: `Channel ${channel.label}`,
141961
141941
  defaultColor: void 0,
@@ -142211,7 +142191,7 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
142211
142191
  const { url, requestInit } = this;
142212
142192
  const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options || {};
142213
142193
  const offsets = await this.loadOffsets();
142214
- const loader = await loadOmeTiff(url, { offsets, headers: requestInit == null ? void 0 : requestInit.headers });
142194
+ const loader = await loadOmeTiff(url, { offsets, headers: requestInit?.headers });
142215
142195
  const imageWrapper = new ImageWrapper(loader, this.options);
142216
142196
  const {
142217
142197
  Name: imageName,
@@ -142268,7 +142248,6 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
142268
142248
  );
142269
142249
  }
142270
142250
  return this.autoImageCache.then((autoImages) => {
142271
- var _a3;
142272
142251
  const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
142273
142252
  const coordinationValues = {
142274
142253
  // Old
@@ -142278,7 +142257,7 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
142278
142257
  spatialTargetT: imageWrapper.getDefaultTargetT(),
142279
142258
  imageLayer: CL([
142280
142259
  {
142281
- fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
142260
+ fileUid: this.coordinationValues?.fileUid || null,
142282
142261
  spatialLayerOpacity: 1,
142283
142262
  spatialLayerVisible: true,
142284
142263
  photometricInterpretation: imageWrapper.getPhotometricInterpretation(),
@@ -142314,7 +142293,7 @@ class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
142314
142293
  obsTypesFromChannelNames
142315
142294
  } = this.options || {};
142316
142295
  const offsets = await this.loadOffsets();
142317
- const loader = await loadOmeTiff(url, { offsets, headers: requestInit == null ? void 0 : requestInit.headers });
142296
+ const loader = await loadOmeTiff(url, { offsets, headers: requestInit?.headers });
142318
142297
  const imageWrapper = new ImageWrapper(loader, this.options);
142319
142298
  const {
142320
142299
  Name: imageName,
@@ -142380,7 +142359,6 @@ class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
142380
142359
  );
142381
142360
  }
142382
142361
  return this.autoImageCache.then((autoImages) => {
142383
- var _a3;
142384
142362
  const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
142385
142363
  const coordinationValues = {
142386
142364
  // Old
@@ -142390,7 +142368,7 @@ class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
142390
142368
  spatialTargetT: imageWrapper.getDefaultTargetT(),
142391
142369
  segmentationLayer: CL([
142392
142370
  {
142393
- fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
142371
+ fileUid: this.coordinationValues?.fileUid || null,
142394
142372
  spatialLayerOpacity: 1,
142395
142373
  spatialLayerVisible: true,
142396
142374
  segmentationChannel: CL(channelCoordination)