@vitessce/json 3.5.6 → 3.5.8

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.
@@ -26,7 +26,7 @@ var __privateMethod = (obj, member, method) => {
26
26
  __accessCheck(obj, member, "access private method");
27
27
  return method;
28
28
  };
29
- var _bytes, _encoder, _data, _strides, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _encoder_config, _decoder_config, _shape2, _strides2, _metadata, _metadata2, _a2, _b, _overrides, _use_suffix_request, _merge_init, merge_init_fn, _overrides2, _refs, _opts, _overrides3;
29
+ var _bytes, _encoder, _data, _stride, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _encoder_config, _decoder_config, _order, _inverseOrder, _shape2, _strides, _metadata, _metadata2, _a2, _b, _overrides, _use_suffix_request, _merge_init, merge_init_fn, _overrides2, _refs, _opts, _overrides3;
30
30
  import "react";
31
31
  function _mergeNamespaces(n3, m) {
32
32
  for (var i2 = 0; i2 < m.length; i2++) {
@@ -103,6 +103,296 @@ class AbstractLoaderError {
103
103
  throw new Error("The warnInConsole() method has not been implemented.");
104
104
  }
105
105
  }
106
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
107
+ function getDefaultExportFromCjs(x2) {
108
+ return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
109
+ }
110
+ function getAugmentedNamespace(n3) {
111
+ if (n3.__esModule)
112
+ return n3;
113
+ var f2 = n3.default;
114
+ if (typeof f2 == "function") {
115
+ var a2 = function a3() {
116
+ if (this instanceof a3) {
117
+ var args = [null];
118
+ args.push.apply(args, arguments);
119
+ var Ctor = Function.bind.apply(f2, args);
120
+ return new Ctor();
121
+ }
122
+ return f2.apply(this, arguments);
123
+ };
124
+ a2.prototype = f2.prototype;
125
+ } else
126
+ a2 = {};
127
+ Object.defineProperty(a2, "__esModule", { value: true });
128
+ Object.keys(n3).forEach(function(k) {
129
+ var d = Object.getOwnPropertyDescriptor(n3, k);
130
+ Object.defineProperty(a2, k, d.get ? d : {
131
+ enumerable: true,
132
+ get: function() {
133
+ return n3[k];
134
+ }
135
+ });
136
+ });
137
+ return a2;
138
+ }
139
+ var loglevel = { exports: {} };
140
+ (function(module2) {
141
+ (function(root2, definition) {
142
+ if (module2.exports) {
143
+ module2.exports = definition();
144
+ } else {
145
+ root2.log = definition();
146
+ }
147
+ })(commonjsGlobal, function() {
148
+ var noop2 = function() {
149
+ };
150
+ var undefinedType2 = "undefined";
151
+ var isIE = typeof window !== undefinedType2 && typeof window.navigator !== undefinedType2 && /Trident\/|MSIE /.test(window.navigator.userAgent);
152
+ var logMethods = [
153
+ "trace",
154
+ "debug",
155
+ "info",
156
+ "warn",
157
+ "error"
158
+ ];
159
+ var _loggersByName = {};
160
+ var defaultLogger = null;
161
+ function bindMethod(obj, methodName) {
162
+ var method = obj[methodName];
163
+ if (typeof method.bind === "function") {
164
+ return method.bind(obj);
165
+ } else {
166
+ try {
167
+ return Function.prototype.bind.call(method, obj);
168
+ } catch (e2) {
169
+ return function() {
170
+ return Function.prototype.apply.apply(method, [obj, arguments]);
171
+ };
172
+ }
173
+ }
174
+ }
175
+ function traceForIE() {
176
+ if (console.log) {
177
+ if (console.log.apply) {
178
+ console.log.apply(console, arguments);
179
+ } else {
180
+ Function.prototype.apply.apply(console.log, [console, arguments]);
181
+ }
182
+ }
183
+ if (console.trace)
184
+ console.trace();
185
+ }
186
+ function realMethod(methodName) {
187
+ if (methodName === "debug") {
188
+ methodName = "log";
189
+ }
190
+ if (typeof console === undefinedType2) {
191
+ return false;
192
+ } else if (methodName === "trace" && isIE) {
193
+ return traceForIE;
194
+ } else if (console[methodName] !== void 0) {
195
+ return bindMethod(console, methodName);
196
+ } else if (console.log !== void 0) {
197
+ return bindMethod(console, "log");
198
+ } else {
199
+ return noop2;
200
+ }
201
+ }
202
+ function replaceLoggingMethods() {
203
+ var level = this.getLevel();
204
+ for (var i2 = 0; i2 < logMethods.length; i2++) {
205
+ var methodName = logMethods[i2];
206
+ this[methodName] = i2 < level ? noop2 : this.methodFactory(methodName, level, this.name);
207
+ }
208
+ this.log = this.debug;
209
+ if (typeof console === undefinedType2 && level < this.levels.SILENT) {
210
+ return "No console available for logging";
211
+ }
212
+ }
213
+ function enableLoggingWhenConsoleArrives(methodName) {
214
+ return function() {
215
+ if (typeof console !== undefinedType2) {
216
+ replaceLoggingMethods.call(this);
217
+ this[methodName].apply(this, arguments);
218
+ }
219
+ };
220
+ }
221
+ function defaultMethodFactory(methodName, _level, _loggerName) {
222
+ return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
223
+ }
224
+ function Logger(name2, factory2) {
225
+ var self2 = this;
226
+ var inheritedLevel;
227
+ var defaultLevel;
228
+ var userLevel;
229
+ var storageKey = "loglevel";
230
+ if (typeof name2 === "string") {
231
+ storageKey += ":" + name2;
232
+ } else if (typeof name2 === "symbol") {
233
+ storageKey = void 0;
234
+ }
235
+ function persistLevelIfPossible(levelNum) {
236
+ var levelName = (logMethods[levelNum] || "silent").toUpperCase();
237
+ if (typeof window === undefinedType2 || !storageKey)
238
+ return;
239
+ try {
240
+ window.localStorage[storageKey] = levelName;
241
+ return;
242
+ } catch (ignore) {
243
+ }
244
+ try {
245
+ window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
246
+ } catch (ignore) {
247
+ }
248
+ }
249
+ function getPersistedLevel() {
250
+ var storedLevel;
251
+ if (typeof window === undefinedType2 || !storageKey)
252
+ return;
253
+ try {
254
+ storedLevel = window.localStorage[storageKey];
255
+ } catch (ignore) {
256
+ }
257
+ if (typeof storedLevel === undefinedType2) {
258
+ try {
259
+ var cookie = window.document.cookie;
260
+ var cookieName = encodeURIComponent(storageKey);
261
+ var location = cookie.indexOf(cookieName + "=");
262
+ if (location !== -1) {
263
+ storedLevel = /^([^;]+)/.exec(
264
+ cookie.slice(location + cookieName.length + 1)
265
+ )[1];
266
+ }
267
+ } catch (ignore) {
268
+ }
269
+ }
270
+ if (self2.levels[storedLevel] === void 0) {
271
+ storedLevel = void 0;
272
+ }
273
+ return storedLevel;
274
+ }
275
+ function clearPersistedLevel() {
276
+ if (typeof window === undefinedType2 || !storageKey)
277
+ return;
278
+ try {
279
+ window.localStorage.removeItem(storageKey);
280
+ } catch (ignore) {
281
+ }
282
+ try {
283
+ window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
284
+ } catch (ignore) {
285
+ }
286
+ }
287
+ function normalizeLevel(input) {
288
+ var level = input;
289
+ if (typeof level === "string" && self2.levels[level.toUpperCase()] !== void 0) {
290
+ level = self2.levels[level.toUpperCase()];
291
+ }
292
+ if (typeof level === "number" && level >= 0 && level <= self2.levels.SILENT) {
293
+ return level;
294
+ } else {
295
+ throw new TypeError("log.setLevel() called with invalid level: " + input);
296
+ }
297
+ }
298
+ self2.name = name2;
299
+ self2.levels = {
300
+ "TRACE": 0,
301
+ "DEBUG": 1,
302
+ "INFO": 2,
303
+ "WARN": 3,
304
+ "ERROR": 4,
305
+ "SILENT": 5
306
+ };
307
+ self2.methodFactory = factory2 || defaultMethodFactory;
308
+ self2.getLevel = function() {
309
+ if (userLevel != null) {
310
+ return userLevel;
311
+ } else if (defaultLevel != null) {
312
+ return defaultLevel;
313
+ } else {
314
+ return inheritedLevel;
315
+ }
316
+ };
317
+ self2.setLevel = function(level, persist) {
318
+ userLevel = normalizeLevel(level);
319
+ if (persist !== false) {
320
+ persistLevelIfPossible(userLevel);
321
+ }
322
+ return replaceLoggingMethods.call(self2);
323
+ };
324
+ self2.setDefaultLevel = function(level) {
325
+ defaultLevel = normalizeLevel(level);
326
+ if (!getPersistedLevel()) {
327
+ self2.setLevel(level, false);
328
+ }
329
+ };
330
+ self2.resetLevel = function() {
331
+ userLevel = null;
332
+ clearPersistedLevel();
333
+ replaceLoggingMethods.call(self2);
334
+ };
335
+ self2.enableAll = function(persist) {
336
+ self2.setLevel(self2.levels.TRACE, persist);
337
+ };
338
+ self2.disableAll = function(persist) {
339
+ self2.setLevel(self2.levels.SILENT, persist);
340
+ };
341
+ self2.rebuild = function() {
342
+ if (defaultLogger !== self2) {
343
+ inheritedLevel = normalizeLevel(defaultLogger.getLevel());
344
+ }
345
+ replaceLoggingMethods.call(self2);
346
+ if (defaultLogger === self2) {
347
+ for (var childName in _loggersByName) {
348
+ _loggersByName[childName].rebuild();
349
+ }
350
+ }
351
+ };
352
+ inheritedLevel = normalizeLevel(
353
+ defaultLogger ? defaultLogger.getLevel() : "WARN"
354
+ );
355
+ var initialLevel = getPersistedLevel();
356
+ if (initialLevel != null) {
357
+ userLevel = normalizeLevel(initialLevel);
358
+ }
359
+ replaceLoggingMethods.call(self2);
360
+ }
361
+ defaultLogger = new Logger();
362
+ defaultLogger.getLogger = function getLogger(name2) {
363
+ if (typeof name2 !== "symbol" && typeof name2 !== "string" || name2 === "") {
364
+ throw new TypeError("You must supply a name when creating a logger.");
365
+ }
366
+ var logger = _loggersByName[name2];
367
+ if (!logger) {
368
+ logger = _loggersByName[name2] = new Logger(
369
+ name2,
370
+ defaultLogger.methodFactory
371
+ );
372
+ }
373
+ return logger;
374
+ };
375
+ var _log = typeof window !== undefinedType2 ? window.log : void 0;
376
+ defaultLogger.noConflict = function() {
377
+ if (typeof window !== undefinedType2 && window.log === defaultLogger) {
378
+ window.log = _log;
379
+ }
380
+ return defaultLogger;
381
+ };
382
+ defaultLogger.getLoggers = function getLoggers2() {
383
+ return _loggersByName;
384
+ };
385
+ defaultLogger["default"] = defaultLogger;
386
+ return defaultLogger;
387
+ });
388
+ })(loglevel);
389
+ var loglevelExports = loglevel.exports;
390
+ const log$6 = /* @__PURE__ */ getDefaultExportFromCjs(loglevelExports);
391
+ const DEFAULT_DEBUG_MODE = false;
392
+ let GLOBAL_DEBUG_MODE = DEFAULT_DEBUG_MODE;
393
+ function getDebugMode() {
394
+ return GLOBAL_DEBUG_MODE;
395
+ }
106
396
  class LoaderValidationError extends AbstractLoaderError {
107
397
  constructor(datasetType, datasetFileType, datasetUrl, reason) {
108
398
  super(`Error while validating ${datasetType}.`);
@@ -111,10 +401,11 @@ class LoaderValidationError extends AbstractLoaderError {
111
401
  this.datasetFileType = datasetFileType;
112
402
  this.datasetUrl = datasetUrl;
113
403
  this.reason = reason;
404
+ this.message = `${datasetType} from ${datasetUrl}: validation failed`;
114
405
  }
115
406
  warnInConsole() {
116
- const { datasetType, datasetUrl, reason } = this;
117
- console.warn(`${datasetType} from ${datasetUrl}: validation failed`, JSON.stringify(reason, null, 2));
407
+ const { reason, message } = this;
408
+ log$6.warn(message, JSON.stringify(reason, null, 2));
118
409
  }
119
410
  }
120
411
  class DataSourceFetchError extends AbstractLoaderError {
@@ -123,10 +414,11 @@ class DataSourceFetchError extends AbstractLoaderError {
123
414
  this.source = source;
124
415
  this.url = url;
125
416
  this.headers = headers;
417
+ this.message = `${source} failed to fetch from ${url} with headers ${JSON.stringify(headers)}`;
126
418
  }
127
419
  warnInConsole() {
128
- const { source, url, headers } = this;
129
- console.warn(`${source} failed to fetch from ${url} with headers ${JSON.stringify(headers)}`);
420
+ const { message } = this;
421
+ log$6.warn(message);
130
422
  }
131
423
  }
132
424
  class JsonSource {
@@ -164,9 +456,15 @@ const ViewType$1 = {
164
456
  FEATURE_VALUE_HISTOGRAM: "featureValueHistogram",
165
457
  DOT_PLOT: "dotPlot",
166
458
  FEATURE_BAR_PLOT: "featureBarPlot",
459
+ VOLCANO_PLOT: "volcanoPlot",
460
+ OBS_SET_COMPOSITION_BAR_PLOT: "obsSetCompositionBarPlot",
461
+ FEATURE_SET_ENRICHMENT_BAR_PLOT: "featureSetEnrichmentBarPlot",
167
462
  BIOMARKER_SELECT: "biomarkerSelect",
463
+ COMPARATIVE_HEADING: "comparativeHeading",
168
464
  LINK_CONTROLLER: "linkController",
169
- DUAL_SCATTERPLOT: "dualScatterplot"
465
+ NEUROGLANCER: "neuroglancer",
466
+ DUAL_SCATTERPLOT: "dualScatterplot",
467
+ TREEMAP: "treemap"
170
468
  };
171
469
  const DataType$2 = {
172
470
  OBS_LABELS: "obsLabels",
@@ -182,7 +480,11 @@ const DataType$2 = {
182
480
  OBS_POINTS: "obsPoints",
183
481
  OBS_LOCATIONS: "obsLocations",
184
482
  SAMPLE_SETS: "sampleSets",
185
- SAMPLE_EDGES: "sampleEdges"
483
+ SAMPLE_EDGES: "sampleEdges",
484
+ COMPARISON_METADATA: "comparisonMetadata",
485
+ FEATURE_STATS: "featureStats",
486
+ FEATURE_SET_STATS: "featureSetStats",
487
+ OBS_SET_STATS: "obsSetStats"
186
488
  };
187
489
  const FileType$1 = {
188
490
  // Joint file types
@@ -220,6 +522,11 @@ const FileType$1 = {
220
522
  OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
221
523
  FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
222
524
  SAMPLE_EDGES_ANNDATA_ZARR: "sampleEdges.anndata.zarr",
525
+ SAMPLE_SETS_ANNDATA_ZARR: "sampleSets.anndata.zarr",
526
+ COMPARISON_METADATA_ANNDATA_ZARR: "comparisonMetadata.anndata.zarr",
527
+ COMPARATIVE_FEATURE_STATS_ANNDATA_ZARR: "comparativeFeatureStats.anndata.zarr",
528
+ COMPARATIVE_FEATURE_SET_STATS_ANNDATA_ZARR: "comparativeFeatureSetStats.anndata.zarr",
529
+ COMPARATIVE_OBS_SET_STATS_ANNDATA_ZARR: "comparativeObsSetStats.anndata.zarr",
223
530
  // AnnData - zipped
224
531
  OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: "obsFeatureMatrix.anndata.zarr.zip",
225
532
  OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: "obsFeatureColumns.anndata.zarr.zip",
@@ -232,6 +539,11 @@ const FileType$1 = {
232
539
  OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
233
540
  FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
234
541
  SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
542
+ SAMPLE_SETS_ANNDATA_ZARR_ZIP: "sampleSets.anndata.zarr.zip",
543
+ COMPARISON_METADATA_ANNDATA_ZARR_ZIP: "comparisonMetadata.anndata.zarr.zip",
544
+ COMPARATIVE_FEATURE_STATS_ANNDATA_ZARR_ZIP: "comparativeFeatureStats.anndata.zarr.zip",
545
+ COMPARATIVE_FEATURE_SET_STATS_ANNDATA_ZARR_ZIP: "comparativeFeatureSetStats.anndata.zarr.zip",
546
+ COMPARATIVE_OBS_SET_STATS_ANNDATA_ZARR_ZIP: "comparativeObsSetStats.anndata.zarr.zip",
235
547
  // AnnData - h5ad via reference spec
236
548
  OBS_FEATURE_MATRIX_ANNDATA_H5AD: "obsFeatureMatrix.anndata.h5ad",
237
549
  OBS_FEATURE_COLUMNS_ANNDATA_H5AD: "obsFeatureColumns.anndata.h5ad",
@@ -244,6 +556,11 @@ const FileType$1 = {
244
556
  OBS_LABELS_ANNDATA_H5AD: "obsLabels.anndata.h5ad",
245
557
  FEATURE_LABELS_ANNDATA_H5AD: "featureLabels.anndata.h5ad",
246
558
  SAMPLE_EDGES_ANNDATA_H5AD: "sampleEdges.anndata.h5ad",
559
+ SAMPLE_SETS_ANNDATA_H5AD: "sampleSets.anndata.h5ad",
560
+ COMPARISON_METADATA_ANNDATA_H5AD: "comparisonMetadata.anndata.h5ad",
561
+ COMPARATIVE_FEATURE_STATS_ANNDATA_H5AD: "comparativeFeatureStats.anndata.h5ad",
562
+ COMPARATIVE_FEATURE_SET_STATS_ANNDATA_H5AD: "comparativeFeatureSetStats.anndata.h5ad",
563
+ COMPARATIVE_OBS_SET_STATS_ANNDATA_H5AD: "comparativeObsSetStats.anndata.h5ad",
247
564
  // SpatialData
248
565
  IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
249
566
  LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
@@ -435,12 +752,20 @@ const CoordinationType$1 = {
435
752
  SAMPLE_SET_FILTER: "sampleSetFilter",
436
753
  SAMPLE_FILTER_MODE: "sampleFilterMode",
437
754
  SAMPLE_SET_COLOR: "sampleSetColor",
755
+ SAMPLE_HIGHLIGHT: "sampleHighlight",
438
756
  EMBEDDING_POINTS_VISIBLE: "embeddingPointsVisible",
439
757
  EMBEDDING_CONTOURS_VISIBLE: "embeddingContoursVisible",
440
758
  EMBEDDING_CONTOURS_FILLED: "embeddingContoursFilled",
441
759
  EMBEDDING_CONTOUR_PERCENTILES: "embeddingContourPercentiles",
442
760
  CONTOUR_COLOR_ENCODING: "contourColorEncoding",
443
- CONTOUR_COLOR: "contourColor"
761
+ CONTOUR_COLOR: "contourColor",
762
+ // For volcano plot:
763
+ FEATURE_POINT_SIGNIFICANCE_THRESHOLD: "featurePointSignificanceThreshold",
764
+ FEATURE_LABEL_SIGNIFICANCE_THRESHOLD: "featureLabelSignificanceThreshold",
765
+ FEATURE_POINT_FOLD_CHANGE_THRESHOLD: "featurePointFoldChangeThreshold",
766
+ FEATURE_LABEL_FOLD_CHANGE_THRESHOLD: "featureLabelFoldChangeThreshold",
767
+ // Treemap
768
+ HIERARCHY_LEVELS: "hierarchyLevels"
444
769
  };
445
770
  const GLOBAL_LABELS = ["z", "t"];
446
771
  const DEFAULT_RASTER_DOMAIN_TYPE = "Min/Max";
@@ -4546,7 +4871,7 @@ var reTrimStart = /^\s+/;
4546
4871
  function baseTrim(string) {
4547
4872
  return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
4548
4873
  }
4549
- function isObject$5(value) {
4874
+ function isObject$6(value) {
4550
4875
  var type2 = typeof value;
4551
4876
  return value != null && (type2 == "object" || type2 == "function");
4552
4877
  }
@@ -4562,9 +4887,9 @@ function toNumber$1(value) {
4562
4887
  if (isSymbol$1(value)) {
4563
4888
  return NAN$1;
4564
4889
  }
4565
- if (isObject$5(value)) {
4890
+ if (isObject$6(value)) {
4566
4891
  var other = typeof value.valueOf == "function" ? value.valueOf() : value;
4567
- value = isObject$5(other) ? other + "" : other;
4892
+ value = isObject$6(other) ? other + "" : other;
4568
4893
  }
4569
4894
  if (typeof value != "string") {
4570
4895
  return value === 0 ? value : +value;
@@ -4589,8 +4914,8 @@ function identity$6(value) {
4589
4914
  return value;
4590
4915
  }
4591
4916
  var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
4592
- function isFunction$3(value) {
4593
- if (!isObject$5(value)) {
4917
+ function isFunction$4(value) {
4918
+ if (!isObject$6(value)) {
4594
4919
  return false;
4595
4920
  }
4596
4921
  var tag2 = baseGetTag(value);
@@ -4629,10 +4954,10 @@ var reIsNative = RegExp(
4629
4954
  "^" + funcToString.call(hasOwnProperty$d).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
4630
4955
  );
4631
4956
  function baseIsNative(value) {
4632
- if (!isObject$5(value) || isMasked(value)) {
4957
+ if (!isObject$6(value) || isMasked(value)) {
4633
4958
  return false;
4634
4959
  }
4635
- var pattern = isFunction$3(value) ? reIsNative : reIsHostCtor;
4960
+ var pattern = isFunction$4(value) ? reIsNative : reIsHostCtor;
4636
4961
  return pattern.test(toSource(value));
4637
4962
  }
4638
4963
  function getValue$1(object2, key) {
@@ -4649,7 +4974,7 @@ var baseCreate = function() {
4649
4974
  function object2() {
4650
4975
  }
4651
4976
  return function(proto) {
4652
- if (!isObject$5(proto)) {
4977
+ if (!isObject$6(proto)) {
4653
4978
  return {};
4654
4979
  }
4655
4980
  if (objectCreate) {
@@ -4741,10 +5066,10 @@ function isLength(value) {
4741
5066
  return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$3;
4742
5067
  }
4743
5068
  function isArrayLike(value) {
4744
- return value != null && isLength(value.length) && !isFunction$3(value);
5069
+ return value != null && isLength(value.length) && !isFunction$4(value);
4745
5070
  }
4746
5071
  function isIterateeCall(value, index2, object2) {
4747
- if (!isObject$5(object2)) {
5072
+ if (!isObject$6(object2)) {
4748
5073
  return false;
4749
5074
  }
4750
5075
  var type2 = typeof index2;
@@ -4870,7 +5195,7 @@ function nativeKeysIn(object2) {
4870
5195
  var objectProto$7 = Object.prototype;
4871
5196
  var hasOwnProperty$8 = objectProto$7.hasOwnProperty;
4872
5197
  function baseKeysIn(object2) {
4873
- if (!isObject$5(object2)) {
5198
+ if (!isObject$6(object2)) {
4874
5199
  return nativeKeysIn(object2);
4875
5200
  }
4876
5201
  var isProto = isPrototype(object2), result = [];
@@ -5290,7 +5615,7 @@ function baseClone(value, bitmask, customizer, key, object2, stack2) {
5290
5615
  if (result !== void 0) {
5291
5616
  return result;
5292
5617
  }
5293
- if (!isObject$5(value)) {
5618
+ if (!isObject$6(value)) {
5294
5619
  return value;
5295
5620
  }
5296
5621
  var isArr = isArray$5(value);
@@ -5615,39 +5940,6 @@ const range$8 = range$7;
5615
5940
  function sum$3(array) {
5616
5941
  return array && array.length ? baseSum(array, identity$6) : 0;
5617
5942
  }
5618
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
5619
- function getDefaultExportFromCjs(x2) {
5620
- return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
5621
- }
5622
- function getAugmentedNamespace(n3) {
5623
- if (n3.__esModule)
5624
- return n3;
5625
- var f2 = n3.default;
5626
- if (typeof f2 == "function") {
5627
- var a2 = function a3() {
5628
- if (this instanceof a3) {
5629
- var args = [null];
5630
- args.push.apply(args, arguments);
5631
- var Ctor = Function.bind.apply(f2, args);
5632
- return new Ctor();
5633
- }
5634
- return f2.apply(this, arguments);
5635
- };
5636
- a2.prototype = f2.prototype;
5637
- } else
5638
- a2 = {};
5639
- Object.defineProperty(a2, "__esModule", { value: true });
5640
- Object.keys(n3).forEach(function(k) {
5641
- var d = Object.getOwnPropertyDescriptor(n3, k);
5642
- Object.defineProperty(a2, k, d.get ? d : {
5643
- enumerable: true,
5644
- get: function() {
5645
- return n3[k];
5646
- }
5647
- });
5648
- });
5649
- return a2;
5650
- }
5651
5943
  function commonjsRequire(path) {
5652
5944
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
5653
5945
  }
@@ -6475,7 +6767,7 @@ function upgradeFrom1_0_14(config3) {
6475
6767
  Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
6476
6768
  var _a3;
6477
6769
  if ((_a3 = viewDef.props) == null ? void 0 : _a3[oldProp]) {
6478
- console.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
6770
+ log$6.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
6479
6771
  }
6480
6772
  });
6481
6773
  });
@@ -6498,7 +6790,7 @@ function upgradeFrom1_0_15(config3) {
6498
6790
  Object.entries(coordinationScopes).forEach(([coordinationType, coordinationScope]) => {
6499
6791
  if (!Array.isArray(coordinationScope) && typeof coordinationScope === "object") {
6500
6792
  if (coordinationType === "dataset") {
6501
- console.error("Expected coordinationScopes.dataset value to be either string or string[], but got object.");
6793
+ log$6.error("Expected coordinationScopes.dataset value to be either string or string[], but got object.");
6502
6794
  }
6503
6795
  coordinationScopesBy.dataset[coordinationType] = coordinationScope;
6504
6796
  } else if (Array.isArray(coordinationScope) || typeof coordinationScope === "string") {
@@ -6608,9 +6900,9 @@ var debug_1 = debug$2;
6608
6900
  const re2 = exports2.re = [];
6609
6901
  const src = exports2.src = [];
6610
6902
  const t2 = exports2.t = {};
6611
- let R2 = 0;
6903
+ let R = 0;
6612
6904
  const createToken = (name2, value, isGlobal) => {
6613
- const index2 = R2++;
6905
+ const index2 = R++;
6614
6906
  debug2(name2, index2, value);
6615
6907
  t2[name2] = index2;
6616
6908
  src[index2] = value;
@@ -8857,7 +9149,7 @@ function makeConstantWithDeprecationMessage(currObj, oldObj) {
8857
9149
  const oldKeys = Object.keys(oldObj);
8858
9150
  const propKey = String(prop);
8859
9151
  if (oldKeys.includes(propKey)) {
8860
- console.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
9152
+ log$6.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
8861
9153
  ${oldObj[propKey][1]}`);
8862
9154
  return oldObj[propKey];
8863
9155
  }
@@ -8936,6 +9228,42 @@ const annDataConvenienceObsEmbeddingItem = z.object({
8936
9228
  dims: z.array(z.number()).optional(),
8937
9229
  embeddingType: z.string()
8938
9230
  });
9231
+ z.object({
9232
+ path: z.string().describe("Path to the comparison metadata, such as /uns/comparison_metadata")
9233
+ });
9234
+ z.object({
9235
+ // TODO: implement a featureStats.anndata.zarr loader
9236
+ // which does not depend on comparisonMetadata
9237
+ // (instead, would point directly to the root of
9238
+ // the dataframe containing a set of diff exp results)
9239
+ // path: z.string().describe('Path to the dataframe containing the results.'),
9240
+ metadataPath: z.string().describe("Path to the comparison metadata."),
9241
+ indexColumn: z.string().optional().describe("Provide a column to use for the feature index, if different than the default dataframe index."),
9242
+ pValueColumn: z.string(),
9243
+ foldChangeColumn: z.string(),
9244
+ pValueTransformation: z.enum(["minuslog10"]).optional(),
9245
+ pValueAdjusted: z.boolean().optional(),
9246
+ foldChangeTransformation: z.enum(["log2"]).optional()
9247
+ });
9248
+ z.object({
9249
+ metadataPath: z.string().describe("Path to the comparison metadata."),
9250
+ indexColumn: z.string().optional().describe("Provide a column to use for the feature set index, if different than the default dataframe index."),
9251
+ termColumn: z.string().optional(),
9252
+ pValueColumn: z.string(),
9253
+ pValueAdjusted: z.boolean().optional(),
9254
+ analysisType: z.string().optional().describe("Optionally, provide an analysis_type name. By default, pertpy_hypergeometric.")
9255
+ });
9256
+ z.object({
9257
+ metadataPath: z.string().describe("Path to the comparison metadata."),
9258
+ indexColumn: z.string().optional().describe("Provide a column to use for the obs set index, if different than the default dataframe index."),
9259
+ interceptExpectedSampleColumn: z.string().describe("If we had a new sample (with no active covariates) with a total number of cells equal to the mean sampling depth of the dataset, then this distribution over the cell types would be most likely."),
9260
+ effectExpectedSampleColumn: z.string().describe("If we had a new sample (with no active covariates) with a total number of cells equal to the mean sampling depth of the dataset, then this distribution over the cell types would be most likely."),
9261
+ foldChangeColumn: z.string().describe("The log-fold change is then calculated between this expected sample and the expected sample with no active covariates from the intercept section."),
9262
+ foldChangeTransformation: z.enum(["log2"]).optional(),
9263
+ isCredibleEffectColumn: z.string().describe("Column which annotates effects as being credible or not (boolean)."),
9264
+ covariateColumn: z.string().describe("Column which defines the covariate used in the analysis."),
9265
+ analysisType: z.string().optional().describe("Optionally, provide an analysis_type name. By default, sccoda_df.")
9266
+ });
8939
9267
  const annDataObsLabels = annDataObs;
8940
9268
  const annDataFeatureLabels = annDataObs;
8941
9269
  const annDataSampleEdges = annDataObs;
@@ -8955,6 +9283,9 @@ const annDataObsSetsArr = z.array(z.object({
8955
9283
  z.object({
8956
9284
  obsSets: annDataObsSetsArr
8957
9285
  });
9286
+ z.object({
9287
+ sampleSets: annDataObsSetsArr
9288
+ });
8958
9289
  const annDataObsFeatureColumnsArr = z.array(z.object({
8959
9290
  path: z.string()
8960
9291
  }));
@@ -9435,7 +9766,7 @@ function point(coordinates2, properties, options) {
9435
9766
  if (coordinates2.length < 2) {
9436
9767
  throw new Error("coordinates must be at least 2 numbers long");
9437
9768
  }
9438
- if (!isNumber$1(coordinates2[0]) || !isNumber$1(coordinates2[1])) {
9769
+ if (!isNumber$2(coordinates2[0]) || !isNumber$2(coordinates2[1])) {
9439
9770
  throw new Error("coordinates must contain numbers");
9440
9771
  }
9441
9772
  var geom = {
@@ -9636,10 +9967,10 @@ function convertArea(area2, originalUnit, finalUnit) {
9636
9967
  }
9637
9968
  return area2 / startFactor * finalFactor;
9638
9969
  }
9639
- function isNumber$1(num) {
9970
+ function isNumber$2(num) {
9640
9971
  return !isNaN(num) && num !== null && !Array.isArray(num);
9641
9972
  }
9642
- function isObject$4(input) {
9973
+ function isObject$5(input) {
9643
9974
  return !!input && input.constructor === Object;
9644
9975
  }
9645
9976
  function validateBBox(bbox2) {
@@ -9653,7 +9984,7 @@ function validateBBox(bbox2) {
9653
9984
  throw new Error("bbox must be an Array of 4 or 6 numbers");
9654
9985
  }
9655
9986
  bbox2.forEach(function(num) {
9656
- if (!isNumber$1(num)) {
9987
+ if (!isNumber$2(num)) {
9657
9988
  throw new Error("bbox must only contain numbers");
9658
9989
  }
9659
9990
  });
@@ -9679,8 +10010,8 @@ const es$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
9679
10010
  featureCollection: featureCollection$1,
9680
10011
  geometry: geometry$1,
9681
10012
  geometryCollection,
9682
- isNumber: isNumber$1,
9683
- isObject: isObject$4,
10013
+ isNumber: isNumber$2,
10014
+ isObject: isObject$5,
9684
10015
  lengthToDegrees,
9685
10016
  lengthToRadians,
9686
10017
  lineString,
@@ -10122,7 +10453,7 @@ function lineReduce$1(geojson, callback, initialValue) {
10122
10453
  }
10123
10454
  function findSegment$1(geojson, options) {
10124
10455
  options = options || {};
10125
- if (!isObject$4(options))
10456
+ if (!isObject$5(options))
10126
10457
  throw new Error("options is invalid");
10127
10458
  var featureIndex = options.featureIndex || 0;
10128
10459
  var multiFeatureIndex = options.multiFeatureIndex || 0;
@@ -10214,7 +10545,7 @@ function findSegment$1(geojson, options) {
10214
10545
  }
10215
10546
  function findPoint$1(geojson, options) {
10216
10547
  options = options || {};
10217
- if (!isObject$4(options))
10548
+ if (!isObject$5(options))
10218
10549
  throw new Error("options is invalid");
10219
10550
  var featureIndex = options.featureIndex || 0;
10220
10551
  var multiFeatureIndex = options.multiFeatureIndex || 0;
@@ -11072,14 +11403,14 @@ var tinycolor = { exports: {} };
11072
11403
  },
11073
11404
  getLuminance: function() {
11074
11405
  var rgb = this.toRgb();
11075
- var RsRGB, GsRGB, BsRGB, R2, G2, B2;
11406
+ var RsRGB, GsRGB, BsRGB, R, G2, B2;
11076
11407
  RsRGB = rgb.r / 255;
11077
11408
  GsRGB = rgb.g / 255;
11078
11409
  BsRGB = rgb.b / 255;
11079
11410
  if (RsRGB <= 0.03928) {
11080
- R2 = RsRGB / 12.92;
11411
+ R = RsRGB / 12.92;
11081
11412
  } else {
11082
- R2 = Math2.pow((RsRGB + 0.055) / 1.055, 2.4);
11413
+ R = Math2.pow((RsRGB + 0.055) / 1.055, 2.4);
11083
11414
  }
11084
11415
  if (GsRGB <= 0.03928) {
11085
11416
  G2 = GsRGB / 12.92;
@@ -11091,7 +11422,7 @@ var tinycolor = { exports: {} };
11091
11422
  } else {
11092
11423
  B2 = Math2.pow((BsRGB + 0.055) / 1.055, 2.4);
11093
11424
  }
11094
- return 0.2126 * R2 + 0.7152 * G2 + 0.0722 * B2;
11425
+ return 0.2126 * R + 0.7152 * G2 + 0.0722 * B2;
11095
11426
  },
11096
11427
  setAlpha: function(value) {
11097
11428
  this._a = boundAlpha(value);
@@ -12063,7 +12394,7 @@ var json2csv_umd = { exports: {} };
12063
12394
  }
12064
12395
  this._maxListeners = this._maxListeners || void 0;
12065
12396
  };
12066
- EventEmitter2.prototype.setMaxListeners = function setMaxListeners2(n3) {
12397
+ EventEmitter2.prototype.setMaxListeners = function setMaxListeners(n3) {
12067
12398
  if (typeof n3 !== "number" || n3 < 0 || isNaN(n3))
12068
12399
  throw new TypeError('"n" argument must be a positive number');
12069
12400
  this._maxListeners = n3;
@@ -12074,7 +12405,7 @@ var json2csv_umd = { exports: {} };
12074
12405
  return EventEmitter2.defaultMaxListeners;
12075
12406
  return that._maxListeners;
12076
12407
  }
12077
- EventEmitter2.prototype.getMaxListeners = function getMaxListeners2() {
12408
+ EventEmitter2.prototype.getMaxListeners = function getMaxListeners() {
12078
12409
  return $getMaxListeners(this);
12079
12410
  };
12080
12411
  function emitNone(handler, isFn, self2) {
@@ -12082,9 +12413,9 @@ var json2csv_umd = { exports: {} };
12082
12413
  handler.call(self2);
12083
12414
  else {
12084
12415
  var len2 = handler.length;
12085
- var listeners2 = arrayClone2(handler, len2);
12416
+ var listeners = arrayClone(handler, len2);
12086
12417
  for (var i2 = 0; i2 < len2; ++i2)
12087
- listeners2[i2].call(self2);
12418
+ listeners[i2].call(self2);
12088
12419
  }
12089
12420
  }
12090
12421
  function emitOne(handler, isFn, self2, arg1) {
@@ -12092,9 +12423,9 @@ var json2csv_umd = { exports: {} };
12092
12423
  handler.call(self2, arg1);
12093
12424
  else {
12094
12425
  var len2 = handler.length;
12095
- var listeners2 = arrayClone2(handler, len2);
12426
+ var listeners = arrayClone(handler, len2);
12096
12427
  for (var i2 = 0; i2 < len2; ++i2)
12097
- listeners2[i2].call(self2, arg1);
12428
+ listeners[i2].call(self2, arg1);
12098
12429
  }
12099
12430
  }
12100
12431
  function emitTwo(handler, isFn, self2, arg1, arg2) {
@@ -12102,9 +12433,9 @@ var json2csv_umd = { exports: {} };
12102
12433
  handler.call(self2, arg1, arg2);
12103
12434
  else {
12104
12435
  var len2 = handler.length;
12105
- var listeners2 = arrayClone2(handler, len2);
12436
+ var listeners = arrayClone(handler, len2);
12106
12437
  for (var i2 = 0; i2 < len2; ++i2)
12107
- listeners2[i2].call(self2, arg1, arg2);
12438
+ listeners[i2].call(self2, arg1, arg2);
12108
12439
  }
12109
12440
  }
12110
12441
  function emitThree(handler, isFn, self2, arg1, arg2, arg3) {
@@ -12112,9 +12443,9 @@ var json2csv_umd = { exports: {} };
12112
12443
  handler.call(self2, arg1, arg2, arg3);
12113
12444
  else {
12114
12445
  var len2 = handler.length;
12115
- var listeners2 = arrayClone2(handler, len2);
12446
+ var listeners = arrayClone(handler, len2);
12116
12447
  for (var i2 = 0; i2 < len2; ++i2)
12117
- listeners2[i2].call(self2, arg1, arg2, arg3);
12448
+ listeners[i2].call(self2, arg1, arg2, arg3);
12118
12449
  }
12119
12450
  }
12120
12451
  function emitMany(handler, isFn, self2, args) {
@@ -12122,12 +12453,12 @@ var json2csv_umd = { exports: {} };
12122
12453
  handler.apply(self2, args);
12123
12454
  else {
12124
12455
  var len2 = handler.length;
12125
- var listeners2 = arrayClone2(handler, len2);
12456
+ var listeners = arrayClone(handler, len2);
12126
12457
  for (var i2 = 0; i2 < len2; ++i2)
12127
- listeners2[i2].apply(self2, args);
12458
+ listeners[i2].apply(self2, args);
12128
12459
  }
12129
12460
  }
12130
- EventEmitter2.prototype.emit = function emit2(type3) {
12461
+ EventEmitter2.prototype.emit = function emit(type3) {
12131
12462
  var er, handler, len2, args, i2, events2, domain2;
12132
12463
  var doError = type3 === "error";
12133
12464
  events2 = this._events;
@@ -12180,7 +12511,7 @@ var json2csv_umd = { exports: {} };
12180
12511
  }
12181
12512
  return true;
12182
12513
  };
12183
- function _addListener2(target, type3, listener, prepend) {
12514
+ function _addListener(target, type3, listener, prepend) {
12184
12515
  var m;
12185
12516
  var events2;
12186
12517
  var existing;
@@ -12232,14 +12563,14 @@ var json2csv_umd = { exports: {} };
12232
12563
  function emitWarning(e2) {
12233
12564
  typeof console.warn === "function" ? console.warn(e2) : console.log(e2);
12234
12565
  }
12235
- EventEmitter2.prototype.addListener = function addListener2(type3, listener) {
12236
- return _addListener2(this, type3, listener, false);
12566
+ EventEmitter2.prototype.addListener = function addListener(type3, listener) {
12567
+ return _addListener(this, type3, listener, false);
12237
12568
  };
12238
12569
  EventEmitter2.prototype.on = EventEmitter2.prototype.addListener;
12239
- EventEmitter2.prototype.prependListener = function prependListener3(type3, listener) {
12240
- return _addListener2(this, type3, listener, true);
12570
+ EventEmitter2.prototype.prependListener = function prependListener2(type3, listener) {
12571
+ return _addListener(this, type3, listener, true);
12241
12572
  };
12242
- function _onceWrap2(target, type3, listener) {
12573
+ function _onceWrap(target, type3, listener) {
12243
12574
  var fired = false;
12244
12575
  function g2() {
12245
12576
  target.removeListener(type3, g2);
@@ -12251,19 +12582,19 @@ var json2csv_umd = { exports: {} };
12251
12582
  g2.listener = listener;
12252
12583
  return g2;
12253
12584
  }
12254
- EventEmitter2.prototype.once = function once3(type3, listener) {
12585
+ EventEmitter2.prototype.once = function once(type3, listener) {
12255
12586
  if (typeof listener !== "function")
12256
12587
  throw new TypeError('"listener" argument must be a function');
12257
- this.on(type3, _onceWrap2(this, type3, listener));
12588
+ this.on(type3, _onceWrap(this, type3, listener));
12258
12589
  return this;
12259
12590
  };
12260
- EventEmitter2.prototype.prependOnceListener = function prependOnceListener2(type3, listener) {
12591
+ EventEmitter2.prototype.prependOnceListener = function prependOnceListener(type3, listener) {
12261
12592
  if (typeof listener !== "function")
12262
12593
  throw new TypeError('"listener" argument must be a function');
12263
- this.prependListener(type3, _onceWrap2(this, type3, listener));
12594
+ this.prependListener(type3, _onceWrap(this, type3, listener));
12264
12595
  return this;
12265
12596
  };
12266
- EventEmitter2.prototype.removeListener = function removeListener2(type3, listener) {
12597
+ EventEmitter2.prototype.removeListener = function removeListener(type3, listener) {
12267
12598
  var list, events2, position, i2, originalListener;
12268
12599
  if (typeof listener !== "function")
12269
12600
  throw new TypeError('"listener" argument must be a function');
@@ -12301,15 +12632,15 @@ var json2csv_umd = { exports: {} };
12301
12632
  delete events2[type3];
12302
12633
  }
12303
12634
  } else {
12304
- spliceOne2(list, position);
12635
+ spliceOne(list, position);
12305
12636
  }
12306
12637
  if (events2.removeListener)
12307
12638
  this.emit("removeListener", type3, originalListener || listener);
12308
12639
  }
12309
12640
  return this;
12310
12641
  };
12311
- EventEmitter2.prototype.removeAllListeners = function removeAllListeners2(type3) {
12312
- var listeners2, events2;
12642
+ EventEmitter2.prototype.removeAllListeners = function removeAllListeners(type3) {
12643
+ var listeners, events2;
12313
12644
  events2 = this._events;
12314
12645
  if (!events2)
12315
12646
  return this;
@@ -12338,17 +12669,17 @@ var json2csv_umd = { exports: {} };
12338
12669
  this._eventsCount = 0;
12339
12670
  return this;
12340
12671
  }
12341
- listeners2 = events2[type3];
12342
- if (typeof listeners2 === "function") {
12343
- this.removeListener(type3, listeners2);
12344
- } else if (listeners2) {
12672
+ listeners = events2[type3];
12673
+ if (typeof listeners === "function") {
12674
+ this.removeListener(type3, listeners);
12675
+ } else if (listeners) {
12345
12676
  do {
12346
- this.removeListener(type3, listeners2[listeners2.length - 1]);
12347
- } while (listeners2[0]);
12677
+ this.removeListener(type3, listeners[listeners.length - 1]);
12678
+ } while (listeners[0]);
12348
12679
  }
12349
12680
  return this;
12350
12681
  };
12351
- EventEmitter2.prototype.listeners = function listeners2(type3) {
12682
+ EventEmitter2.prototype.listeners = function listeners(type3) {
12352
12683
  var evlistener;
12353
12684
  var ret;
12354
12685
  var events2 = this._events;
@@ -12361,7 +12692,7 @@ var json2csv_umd = { exports: {} };
12361
12692
  else if (typeof evlistener === "function")
12362
12693
  ret = [evlistener.listener || evlistener];
12363
12694
  else
12364
- ret = unwrapListeners2(evlistener);
12695
+ ret = unwrapListeners(evlistener);
12365
12696
  }
12366
12697
  return ret;
12367
12698
  };
@@ -12369,11 +12700,11 @@ var json2csv_umd = { exports: {} };
12369
12700
  if (typeof emitter.listenerCount === "function") {
12370
12701
  return emitter.listenerCount(type3);
12371
12702
  } else {
12372
- return listenerCount2.call(emitter, type3);
12703
+ return listenerCount.call(emitter, type3);
12373
12704
  }
12374
12705
  };
12375
- EventEmitter2.prototype.listenerCount = listenerCount2;
12376
- function listenerCount2(type3) {
12706
+ EventEmitter2.prototype.listenerCount = listenerCount;
12707
+ function listenerCount(type3) {
12377
12708
  var events2 = this._events;
12378
12709
  if (events2) {
12379
12710
  var evlistener = events2[type3];
@@ -12385,21 +12716,21 @@ var json2csv_umd = { exports: {} };
12385
12716
  }
12386
12717
  return 0;
12387
12718
  }
12388
- EventEmitter2.prototype.eventNames = function eventNames2() {
12719
+ EventEmitter2.prototype.eventNames = function eventNames() {
12389
12720
  return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
12390
12721
  };
12391
- function spliceOne2(list, index2) {
12722
+ function spliceOne(list, index2) {
12392
12723
  for (var i2 = index2, k = i2 + 1, n3 = list.length; k < n3; i2 += 1, k += 1)
12393
12724
  list[i2] = list[k];
12394
12725
  list.pop();
12395
12726
  }
12396
- function arrayClone2(arr, i2) {
12727
+ function arrayClone(arr, i2) {
12397
12728
  var copy2 = new Array(i2);
12398
12729
  while (i2--)
12399
12730
  copy2[i2] = arr[i2];
12400
12731
  return copy2;
12401
12732
  }
12402
- function unwrapListeners2(arr) {
12733
+ function unwrapListeners(arr) {
12403
12734
  var ret = new Array(arr.length);
12404
12735
  for (var i2 = 0; i2 < ret.length; ++i2) {
12405
12736
  ret[i2] = arr[i2].listener || arr[i2];
@@ -14731,7 +15062,7 @@ var json2csv_umd = { exports: {} };
14731
15062
  Readable.ReadableState = ReadableState;
14732
15063
  var debug2 = debuglog("stream");
14733
15064
  inherits$1(Readable, EventEmitter2);
14734
- function prependListener2(emitter, event, fn) {
15065
+ function prependListener(emitter, event, fn) {
14735
15066
  if (typeof emitter.prependListener === "function") {
14736
15067
  return emitter.prependListener(event, fn);
14737
15068
  } else {
@@ -15085,7 +15416,7 @@ var json2csv_umd = { exports: {} };
15085
15416
  if (listenerCount$1(dest, "error") === 0)
15086
15417
  dest.emit("error", er);
15087
15418
  }
15088
- prependListener2(dest, "error", onerror);
15419
+ prependListener(dest, "error", onerror);
15089
15420
  function onclose() {
15090
15421
  dest.removeListener("finish", onfinish);
15091
15422
  unpipe();
@@ -17962,7 +18293,7 @@ class MoleculesJsonAsObsLabelsLoader extends JsonLoader {
17962
18293
  return Promise.resolve(new LoaderResult(result, url));
17963
18294
  }
17964
18295
  }
17965
- function assert$d(condition, message) {
18296
+ function assert$f(condition, message) {
17966
18297
  if (!condition) {
17967
18298
  throw new Error("math.gl assertion ".concat(message));
17968
18299
  }
@@ -17979,7 +18310,7 @@ const config$3 = {
17979
18310
  };
17980
18311
  function configure(options) {
17981
18312
  for (const key in options) {
17982
- assert$d(key in config$3);
18313
+ assert$f(key in config$3);
17983
18314
  config$3[key] = options[key];
17984
18315
  }
17985
18316
  return config$3;
@@ -18429,11 +18760,11 @@ class Vector extends MathArray {
18429
18760
  return this.distanceSquared(vector);
18430
18761
  }
18431
18762
  getComponent(i2) {
18432
- assert$d(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
18763
+ assert$f(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
18433
18764
  return checkNumber(this[i2]);
18434
18765
  }
18435
18766
  setComponent(i2, value) {
18436
- assert$d(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
18767
+ assert$f(i2 >= 0 && i2 < this.ELEMENTS, "index is out of range");
18437
18768
  this[i2] = value;
18438
18769
  return this.check();
18439
18770
  }
@@ -21618,7 +21949,7 @@ const esm$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
21618
21949
  _SphericalCoordinates: SphericalCoordinates,
21619
21950
  acos: acos$2,
21620
21951
  asin: asin$2,
21621
- assert: assert$d,
21952
+ assert: assert$f,
21622
21953
  atan: atan$2,
21623
21954
  clamp: clamp$2,
21624
21955
  clone: clone$8,
@@ -21671,7 +22002,7 @@ var DEFAULT_CONFIG = {
21671
22002
  // null = randomly seed
21672
22003
  randomSeed: null
21673
22004
  };
21674
- function isNumber(x2) {
22005
+ function isNumber$1(x2) {
21675
22006
  return typeof x2 === "number";
21676
22007
  }
21677
22008
  function isBigNumber(x2) {
@@ -21726,7 +22057,7 @@ function isResultSet(x2) {
21726
22057
  function isHelp(x2) {
21727
22058
  return x2 && x2.constructor.prototype.isHelp === true || false;
21728
22059
  }
21729
- function isFunction$2(x2) {
22060
+ function isFunction$3(x2) {
21730
22061
  return typeof x2 === "function";
21731
22062
  }
21732
22063
  function isDate$1(x2) {
@@ -21735,13 +22066,13 @@ function isDate$1(x2) {
21735
22066
  function isRegExp(x2) {
21736
22067
  return x2 instanceof RegExp;
21737
22068
  }
21738
- function isObject$3(x2) {
22069
+ function isObject$4(x2) {
21739
22070
  return !!(x2 && typeof x2 === "object" && x2.constructor === Object && !isComplex(x2) && !isFraction(x2));
21740
22071
  }
21741
22072
  function isNull(x2) {
21742
22073
  return x2 === null;
21743
22074
  }
21744
- function isUndefined(x2) {
22075
+ function isUndefined$1(x2) {
21745
22076
  return x2 === void 0;
21746
22077
  }
21747
22078
  function isAccessorNode(x2) {
@@ -22792,9 +23123,9 @@ function format$3(value, options) {
22792
23123
  if (options.notation) {
22793
23124
  notation = options.notation;
22794
23125
  }
22795
- if (isNumber(options)) {
23126
+ if (isNumber$1(options)) {
22796
23127
  precision = options;
22797
- } else if (isNumber(options.precision)) {
23128
+ } else if (isNumber$1(options.precision)) {
22798
23129
  precision = options.precision;
22799
23130
  }
22800
23131
  if (options.wordSize) {
@@ -22862,7 +23193,7 @@ function toEngineering$1(value, precision) {
22862
23193
  var e2 = rounded.exponent;
22863
23194
  var c = rounded.coefficients;
22864
23195
  var newExp = e2 % 3 === 0 ? e2 : e2 < 0 ? e2 - 3 - e2 % 3 : e2 - e2 % 3;
22865
- if (isNumber(precision)) {
23196
+ if (isNumber$1(precision)) {
22866
23197
  while (precision > c.length || e2 - newExp + 1 > c.length) {
22867
23198
  c.push(0);
22868
23199
  }
@@ -22879,7 +23210,7 @@ function toEngineering$1(value, precision) {
22879
23210
  expDiff--;
22880
23211
  }
22881
23212
  var decimals = c.slice(decimalIdx).join("");
22882
- var decimalVal = isNumber(precision) && decimals.length || decimals.match(/[1-9]/) ? "." + decimals : "";
23213
+ var decimalVal = isNumber$1(precision) && decimals.length || decimals.match(/[1-9]/) ? "." + decimals : "";
22883
23214
  var str = c.slice(0, decimalIdx).join("") + decimalVal + "e" + (e2 >= 0 ? "+" : "") + newExp.toString();
22884
23215
  return rounded.sign + str;
22885
23216
  }
@@ -23262,7 +23593,7 @@ function validate$1(array, size2) {
23262
23593
  }
23263
23594
  }
23264
23595
  function validateIndex(index2, length2) {
23265
- if (!isNumber(index2) || !isInteger(index2)) {
23596
+ if (!isNumber$1(index2) || !isInteger(index2)) {
23266
23597
  throw new TypeError("Index must be an integer (value: " + index2 + ")");
23267
23598
  }
23268
23599
  if (index2 < 0 || typeof length2 === "number" && index2 >= length2) {
@@ -23277,7 +23608,7 @@ function resize(array, size2, defaultValue2) {
23277
23608
  throw new Error("Resizing to scalar is not supported");
23278
23609
  }
23279
23610
  size2.forEach(function(value) {
23280
- if (!isNumber(value) || !isInteger(value) || value < 0) {
23611
+ if (!isNumber$1(value) || !isInteger(value) || value < 0) {
23281
23612
  throw new TypeError("Invalid size, must contain positive integers (size: " + format$1(size2) + ")");
23282
23613
  }
23283
23614
  });
@@ -23573,7 +23904,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$Q, function crea
23573
23904
  typed2.types = [
23574
23905
  {
23575
23906
  name: "number",
23576
- test: isNumber
23907
+ test: isNumber$1
23577
23908
  },
23578
23909
  {
23579
23910
  name: "Complex",
@@ -23637,7 +23968,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$Q, function crea
23637
23968
  },
23638
23969
  {
23639
23970
  name: "function",
23640
- test: isFunction$2
23971
+ test: isFunction$3
23641
23972
  },
23642
23973
  {
23643
23974
  name: "Date",
@@ -23653,7 +23984,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$Q, function crea
23653
23984
  },
23654
23985
  {
23655
23986
  name: "undefined",
23656
- test: isUndefined
23987
+ test: isUndefined$1
23657
23988
  },
23658
23989
  {
23659
23990
  name: "AccessorNode",
@@ -23721,7 +24052,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$Q, function crea
23721
24052
  },
23722
24053
  {
23723
24054
  name: "Object",
23724
- test: isObject$3
24055
+ test: isObject$4
23725
24056
  }
23726
24057
  // order 'Object' last, it matches on other classes too
23727
24058
  ];
@@ -27293,7 +27624,7 @@ var createComplexClass = /* @__PURE__ */ factory(name$V, dependencies$O, () => {
27293
27624
  var re2 = this.re;
27294
27625
  var strRe = format$3(this.re, options);
27295
27626
  var strIm = format$3(this.im, options);
27296
- var precision = isNumber(options) ? options : options ? options.precision : null;
27627
+ var precision = isNumber$1(options) ? options : options ? options.precision : null;
27297
27628
  if (precision !== null) {
27298
27629
  var epsilon3 = Math.pow(10, -precision);
27299
27630
  if (Math.abs(re2 / im) < epsilon3) {
@@ -27343,11 +27674,11 @@ var createComplexClass = /* @__PURE__ */ factory(name$V, dependencies$O, () => {
27343
27674
  case 2: {
27344
27675
  var r2 = arguments[0];
27345
27676
  var phi = arguments[1];
27346
- if (isNumber(r2)) {
27677
+ if (isNumber$1(r2)) {
27347
27678
  if (isUnit(phi) && phi.hasBase("ANGLE")) {
27348
27679
  phi = phi.toNumber("rad");
27349
27680
  }
27350
- if (isNumber(phi)) {
27681
+ if (isNumber$1(phi)) {
27351
27682
  return new Complex$1({
27352
27683
  r: r2,
27353
27684
  phi
@@ -28480,7 +28811,7 @@ var createDenseMatrixClass = /* @__PURE__ */ factory(name$S, dependencies$L, (_r
28480
28811
  if (isBigNumber(k)) {
28481
28812
  k = k.toNumber();
28482
28813
  }
28483
- if (!isNumber(k) || !isInteger(k)) {
28814
+ if (!isNumber$1(k) || !isInteger(k)) {
28484
28815
  throw new TypeError("The parameter k must be an integer number");
28485
28816
  }
28486
28817
  } else {
@@ -28512,7 +28843,7 @@ var createDenseMatrixClass = /* @__PURE__ */ factory(name$S, dependencies$L, (_r
28512
28843
  if (isBigNumber(s2)) {
28513
28844
  s2 = s2.toNumber();
28514
28845
  }
28515
- if (!isNumber(s2) || !isInteger(s2) || s2 < 1) {
28846
+ if (!isNumber$1(s2) || !isInteger(s2) || s2 < 1) {
28516
28847
  throw new Error("Size values must be positive integers");
28517
28848
  }
28518
28849
  return s2;
@@ -28521,7 +28852,7 @@ var createDenseMatrixClass = /* @__PURE__ */ factory(name$S, dependencies$L, (_r
28521
28852
  if (isBigNumber(k)) {
28522
28853
  k = k.toNumber();
28523
28854
  }
28524
- if (!isNumber(k) || !isInteger(k)) {
28855
+ if (!isNumber$1(k) || !isInteger(k)) {
28525
28856
  throw new TypeError("The parameter k must be an integer number");
28526
28857
  }
28527
28858
  } else {
@@ -28572,7 +28903,7 @@ var createDenseMatrixClass = /* @__PURE__ */ factory(name$S, dependencies$L, (_r
28572
28903
  return new DenseMatrix2(json);
28573
28904
  };
28574
28905
  DenseMatrix2.prototype.swapRows = function(i2, j) {
28575
- if (!isNumber(i2) || !isInteger(i2) || !isNumber(j) || !isInteger(j)) {
28906
+ if (!isNumber$1(i2) || !isInteger(i2) || !isNumber$1(j) || !isInteger(j)) {
28576
28907
  throw new Error("Row index must be positive integers");
28577
28908
  }
28578
28909
  if (this._size.length !== 2) {
@@ -29058,7 +29389,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
29058
29389
  throw new Error("Only two dimensions matrix are supported");
29059
29390
  }
29060
29391
  sizeArray.forEach(function(value) {
29061
- if (!isNumber(value) || !isInteger(value) || value < 0) {
29392
+ if (!isNumber$1(value) || !isInteger(value) || value < 0) {
29062
29393
  throw new TypeError("Invalid size, must contain positive integers (size: " + format$1(sizeArray) + ")");
29063
29394
  }
29064
29395
  });
@@ -29139,7 +29470,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
29139
29470
  throw new Error("Sparse matrices can only be reshaped in two dimensions");
29140
29471
  }
29141
29472
  sizes.forEach(function(value) {
29142
- if (!isNumber(value) || !isInteger(value) || value <= -2 || value === 0) {
29473
+ if (!isNumber$1(value) || !isInteger(value) || value <= -2 || value === 0) {
29143
29474
  throw new TypeError("Invalid size, must contain positive integers or -1 (size: " + format$1(sizes) + ")");
29144
29475
  }
29145
29476
  });
@@ -29362,7 +29693,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
29362
29693
  if (isBigNumber(k)) {
29363
29694
  k = k.toNumber();
29364
29695
  }
29365
- if (!isNumber(k) || !isInteger(k)) {
29696
+ if (!isNumber$1(k) || !isInteger(k)) {
29366
29697
  throw new TypeError("The parameter k must be an integer number");
29367
29698
  }
29368
29699
  } else {
@@ -29411,7 +29742,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
29411
29742
  if (isBigNumber(s2)) {
29412
29743
  s2 = s2.toNumber();
29413
29744
  }
29414
- if (!isNumber(s2) || !isInteger(s2) || s2 < 1) {
29745
+ if (!isNumber$1(s2) || !isInteger(s2) || s2 < 1) {
29415
29746
  throw new Error("Size values must be positive integers");
29416
29747
  }
29417
29748
  return s2;
@@ -29420,7 +29751,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
29420
29751
  if (isBigNumber(k)) {
29421
29752
  k = k.toNumber();
29422
29753
  }
29423
- if (!isNumber(k) || !isInteger(k)) {
29754
+ if (!isNumber$1(k) || !isInteger(k)) {
29424
29755
  throw new TypeError("The parameter k must be an integer number");
29425
29756
  }
29426
29757
  } else {
@@ -29481,7 +29812,7 @@ var createSparseMatrixClass = /* @__PURE__ */ factory(name$P, dependencies$I, (_
29481
29812
  });
29482
29813
  };
29483
29814
  SparseMatrix2.prototype.swapRows = function(i2, j) {
29484
- if (!isNumber(i2) || !isInteger(i2) || !isNumber(j) || !isInteger(j)) {
29815
+ if (!isNumber$1(i2) || !isInteger(i2) || !isNumber$1(j) || !isInteger(j)) {
29485
29816
  throw new Error("Row index must be positive integers");
29486
29817
  }
29487
29818
  if (this._size.length !== 2) {
@@ -36679,7 +37010,7 @@ var unit = /* @__PURE__ */ createUnitFunction({
36679
37010
  Unit,
36680
37011
  typed
36681
37012
  });
36682
- function assert$c(condition, message) {
37013
+ function assert$e(condition, message) {
36683
37014
  if (!condition) {
36684
37015
  throw new Error(message || "loader assertion failed.");
36685
37016
  }
@@ -36688,7 +37019,7 @@ const isBrowser$3 = Boolean(typeof process !== "object" || String(process) !== "
36688
37019
  const matches$1 = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
36689
37020
  matches$1 && parseFloat(matches$1[1]) || 0;
36690
37021
  const VERSION$b = "3.2.10";
36691
- function assert$b(condition, message) {
37022
+ function assert$d(condition, message) {
36692
37023
  if (!condition) {
36693
37024
  throw new Error(message || "loaders.gl assertion failed.");
36694
37025
  }
@@ -36730,12 +37061,12 @@ class WorkerJob {
36730
37061
  });
36731
37062
  }
36732
37063
  done(value) {
36733
- assert$b(this.isRunning);
37064
+ assert$d(this.isRunning);
36734
37065
  this.isRunning = false;
36735
37066
  this._resolve(value);
36736
37067
  }
36737
37068
  error(error2) {
36738
- assert$b(this.isRunning);
37069
+ assert$d(this.isRunning);
36739
37070
  this.isRunning = false;
36740
37071
  this._reject(error2);
36741
37072
  }
@@ -36744,7 +37075,7 @@ let Worker$1 = class Worker2 {
36744
37075
  };
36745
37076
  const workerURLCache = /* @__PURE__ */ new Map();
36746
37077
  function getLoadableWorkerURL(props) {
36747
- assert$b(props.source && !props.url || !props.source && props.url);
37078
+ assert$d(props.source && !props.url || !props.source && props.url);
36748
37079
  let workerURL = workerURLCache.get(props.source || props.url);
36749
37080
  if (!workerURL) {
36750
37081
  if (props.url) {
@@ -36756,7 +37087,7 @@ function getLoadableWorkerURL(props) {
36756
37087
  workerURLCache.set(props.source, workerURL);
36757
37088
  }
36758
37089
  }
36759
- assert$b(workerURL);
37090
+ assert$d(workerURL);
36760
37091
  return workerURL;
36761
37092
  }
36762
37093
  function getLoadableWorkerURLFromURL(url) {
@@ -36830,7 +37161,7 @@ class WorkerThread {
36830
37161
  source,
36831
37162
  url
36832
37163
  } = props;
36833
- assert$b(source || url);
37164
+ assert$d(source || url);
36834
37165
  this.name = name2;
36835
37166
  this.source = source;
36836
37167
  this.url = url;
@@ -37115,11 +37446,11 @@ function getWorkerURL(worker, options = {}) {
37115
37446
  const versionTag = version2 ? "@".concat(version2) : "";
37116
37447
  url = "https://unpkg.com/@loaders.gl/".concat(worker.module).concat(versionTag, "/dist/").concat(workerFile);
37117
37448
  }
37118
- assert$b(url);
37449
+ assert$d(url);
37119
37450
  return url;
37120
37451
  }
37121
37452
  function validateWorkerVersion(worker, coreVersion = VERSION$b) {
37122
- assert$b(worker, "no worker provided");
37453
+ assert$d(worker, "no worker provided");
37123
37454
  const workerVersion = worker.version;
37124
37455
  if (!coreVersion || !workerVersion) {
37125
37456
  return false;
@@ -37147,7 +37478,7 @@ function getLibraryUrl(library, moduleName, options) {
37147
37478
  return "modules/".concat(moduleName, "/dist/libs/").concat(library);
37148
37479
  }
37149
37480
  if (options.CDN) {
37150
- assert$b(options.CDN.startsWith("http"));
37481
+ assert$d(options.CDN.startsWith("http"));
37151
37482
  return "".concat(options.CDN, "/").concat(moduleName, "@").concat(VERSION$a, "/dist/libs/").concat(library);
37152
37483
  }
37153
37484
  if (isWorker) {
@@ -37360,8 +37691,8 @@ function sliceArrayBuffer(arrayBuffer2, byteOffset, byteLength) {
37360
37691
  return arrayCopy.buffer;
37361
37692
  }
37362
37693
  function padToNBytes(byteLength, padding) {
37363
- assert$c(byteLength >= 0);
37364
- assert$c(padding > 0);
37694
+ assert$e(byteLength >= 0);
37695
+ assert$e(padding > 0);
37365
37696
  return byteLength + (padding - 1) & ~(padding - 1);
37366
37697
  }
37367
37698
  function copyToArray(source, target, targetOffset) {
@@ -37708,16 +38039,16 @@ function dirname(url) {
37708
38039
  return slashIndex >= 0 ? url.substr(0, slashIndex) : "";
37709
38040
  }
37710
38041
  const isBoolean = (x2) => typeof x2 === "boolean";
37711
- const isFunction$1 = (x2) => typeof x2 === "function";
37712
- const isObject$2 = (x2) => x2 !== null && typeof x2 === "object";
37713
- const isPureObject = (x2) => isObject$2(x2) && x2.constructor === {}.constructor;
38042
+ const isFunction$2 = (x2) => typeof x2 === "function";
38043
+ const isObject$3 = (x2) => x2 !== null && typeof x2 === "object";
38044
+ const isPureObject = (x2) => isObject$3(x2) && x2.constructor === {}.constructor;
37714
38045
  const isIterable = (x2) => x2 && typeof x2[Symbol.iterator] === "function";
37715
38046
  const isAsyncIterable$1 = (x2) => x2 && typeof x2[Symbol.asyncIterator] === "function";
37716
38047
  const isResponse = (x2) => typeof Response !== "undefined" && x2 instanceof Response || x2 && x2.arrayBuffer && x2.text && x2.json;
37717
38048
  const isBlob$1 = (x2) => typeof Blob !== "undefined" && x2 instanceof Blob;
37718
38049
  const isBuffer$1 = (x2) => x2 && typeof x2 === "object" && x2.isBuffer;
37719
- const isReadableDOMStream = (x2) => typeof ReadableStream !== "undefined" && x2 instanceof ReadableStream || isObject$2(x2) && isFunction$1(x2.tee) && isFunction$1(x2.cancel) && isFunction$1(x2.getReader);
37720
- const isReadableNodeStream = (x2) => isObject$2(x2) && isFunction$1(x2.read) && isFunction$1(x2.pipe) && isBoolean(x2.readable);
38050
+ const isReadableDOMStream = (x2) => typeof ReadableStream !== "undefined" && x2 instanceof ReadableStream || isObject$3(x2) && isFunction$2(x2.tee) && isFunction$2(x2.cancel) && isFunction$2(x2.getReader);
38051
+ const isReadableNodeStream = (x2) => isObject$3(x2) && isFunction$2(x2.read) && isFunction$2(x2.pipe) && isBoolean(x2.readable);
37721
38052
  const isReadableStream = (x2) => isReadableDOMStream(x2) || isReadableNodeStream(x2);
37722
38053
  const DATA_URL_PATTERN = /^data:([-\w.]+\/[-\w.+]+)(;|,)/;
37723
38054
  const MIME_TYPE_PATTERN = /^([-\w.]+\/[-\w.+]+)/;
@@ -38059,7 +38390,7 @@ function autobind(obj) {
38059
38390
  }
38060
38391
  }
38061
38392
  }
38062
- function assert$a(condition, message) {
38393
+ function assert$c(condition, message) {
38063
38394
  if (!condition) {
38064
38395
  throw new Error(message || "Assertion failed");
38065
38396
  }
@@ -38172,7 +38503,7 @@ class Log {
38172
38503
  }
38173
38504
  }
38174
38505
  assert(condition, message) {
38175
- assert$a(condition, message);
38506
+ assert$c(condition, message);
38176
38507
  }
38177
38508
  warn(message) {
38178
38509
  return this._getLogFunction(0, message, originalConsole.warn, arguments, ONCE);
@@ -38291,7 +38622,7 @@ class Log {
38291
38622
  opts: opts2
38292
38623
  });
38293
38624
  method = method || opts2.method;
38294
- assert$a(method);
38625
+ assert$c(method);
38295
38626
  opts2.total = this.getTotal();
38296
38627
  opts2.delta = this.getDelta();
38297
38628
  this._deltaTs = getHiResTimestamp();
@@ -38325,7 +38656,7 @@ function normalizeLogLevel(logLevel) {
38325
38656
  default:
38326
38657
  return 0;
38327
38658
  }
38328
- assert$a(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
38659
+ assert$c(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
38329
38660
  return resolvedLevel;
38330
38661
  }
38331
38662
  function normalizeArguments(opts2) {
@@ -38353,7 +38684,7 @@ function normalizeArguments(opts2) {
38353
38684
  opts2.message = opts2.message();
38354
38685
  }
38355
38686
  const messageType = typeof opts2.message;
38356
- assert$a(messageType === "string" || messageType === "object");
38687
+ assert$c(messageType === "string" || messageType === "object");
38357
38688
  return Object.assign(opts2, {
38358
38689
  args
38359
38690
  }, opts2.opts);
@@ -38517,7 +38848,7 @@ function getFetchFunction(options, context) {
38517
38848
  if (typeof fetchOptions.fetch === "function") {
38518
38849
  return fetchOptions.fetch;
38519
38850
  }
38520
- if (isObject$2(fetchOptions.fetch)) {
38851
+ if (isObject$3(fetchOptions.fetch)) {
38521
38852
  return (url) => fetchFile(url, fetchOptions);
38522
38853
  }
38523
38854
  if (context !== null && context !== void 0 && context.fetch) {
@@ -38538,7 +38869,7 @@ function validateOptionsObject(options, id, defaultOptions, deprecatedOptions, l
38538
38869
  const loaderName = id || "Top level";
38539
38870
  const prefix = id ? "".concat(id, ".") : "";
38540
38871
  for (const key in options) {
38541
- const isSubOptions = !id && isObject$2(options[key]);
38872
+ const isSubOptions = !id && isObject$3(options[key]);
38542
38873
  const isBaseUriOption = key === "baseUri" && !id;
38543
38874
  const isWorkerUrlOption = key === "workerUrl" && id;
38544
38875
  if (!(key in defaultOptions) && !isBaseUriOption && !isWorkerUrlOption) {
@@ -38614,8 +38945,8 @@ function isLoaderObject(loader) {
38614
38945
  }
38615
38946
  function normalizeLoader(loader) {
38616
38947
  var _loader2, _loader3;
38617
- assert$c(loader, "null loader");
38618
- assert$c(isLoaderObject(loader), "invalid loader");
38948
+ assert$e(loader, "null loader");
38949
+ assert$e(isLoaderObject(loader), "invalid loader");
38619
38950
  let options;
38620
38951
  if (Array.isArray(loader)) {
38621
38952
  options = loader[1];
@@ -39014,7 +39345,7 @@ function getLoadersFromContext(loaders, context) {
39014
39345
  return candidateLoaders && candidateLoaders.length ? candidateLoaders : null;
39015
39346
  }
39016
39347
  async function parse$5(data, loaders, options, context) {
39017
- assert$b(!context || typeof context === "object");
39348
+ assert$d(!context || typeof context === "object");
39018
39349
  if (loaders && !Array.isArray(loaders) && !isLoaderObject(loaders)) {
39019
39350
  context = void 0;
39020
39351
  options = loaders;
@@ -39076,7 +39407,7 @@ async function parseWithLoader(loader, data, options, context) {
39076
39407
  if (loader.parse) {
39077
39408
  return await loader.parse(data, options, context, loader);
39078
39409
  }
39079
- assert$b(!loader.parseSync);
39410
+ assert$d(!loader.parseSync);
39080
39411
  throw new Error("".concat(loader.id, " loader - no parser found and worker is disabled"));
39081
39412
  }
39082
39413
  async function load(url, loaders, options, context) {
@@ -39352,7 +39683,7 @@ async function parseToNodeImage(arrayBuffer2, options) {
39352
39683
  mimeType
39353
39684
  } = getBinaryImageMetadata(arrayBuffer2) || {};
39354
39685
  const _parseImageNode2 = globalThis._parseImageNode;
39355
- assert$c(_parseImageNode2);
39686
+ assert$e(_parseImageNode2);
39356
39687
  return await _parseImageNode2(arrayBuffer2, mimeType);
39357
39688
  }
39358
39689
  async function parseImage(arrayBuffer2, options, context) {
@@ -39375,7 +39706,7 @@ async function parseImage(arrayBuffer2, options, context) {
39375
39706
  image2 = await parseToNodeImage(arrayBuffer2);
39376
39707
  break;
39377
39708
  default:
39378
- assert$c(false);
39709
+ assert$e(false);
39379
39710
  }
39380
39711
  if (imageType === "data") {
39381
39712
  image2 = getImageData(image2);
@@ -39598,7 +39929,7 @@ const deckGlobal = globalThis.deck;
39598
39929
  const log$2 = new Log({
39599
39930
  id: "luma.gl"
39600
39931
  });
39601
- function assert$9(condition, message) {
39932
+ function assert$b(condition, message) {
39602
39933
  if (!condition) {
39603
39934
  throw new Error(message || "luma.gl: assertion failed.");
39604
39935
  }
@@ -39624,11 +39955,11 @@ function getWebGL2Context(gl) {
39624
39955
  return isWebGL2$1(gl) ? gl : null;
39625
39956
  }
39626
39957
  function assertWebGLContext(gl) {
39627
- assert$9(isWebGL(gl), ERR_CONTEXT);
39958
+ assert$b(isWebGL(gl), ERR_CONTEXT);
39628
39959
  return gl;
39629
39960
  }
39630
39961
  function assertWebGL2Context(gl) {
39631
- assert$9(isWebGL2$1(gl), ERR_WEBGL2);
39962
+ assert$b(isWebGL2$1(gl), ERR_WEBGL2);
39632
39963
  return gl;
39633
39964
  }
39634
39965
  const glErrorShadow = {};
@@ -39994,7 +40325,7 @@ const WEBGL2_CONTEXT_POLYFILLS = {
39994
40325
  suffix: "OES"
39995
40326
  },
39996
40327
  createVertexArray: () => {
39997
- assert$9(false, ERR_VAO_NOT_SUPPORTED);
40328
+ assert$b(false, ERR_VAO_NOT_SUPPORTED);
39998
40329
  },
39999
40330
  deleteVertexArray: () => {
40000
40331
  },
@@ -40007,7 +40338,7 @@ const WEBGL2_CONTEXT_POLYFILLS = {
40007
40338
  suffix: "ANGLE"
40008
40339
  },
40009
40340
  vertexAttribDivisor(location, divisor) {
40010
- assert$9(divisor === 0, "WebGL instanced rendering not supported");
40341
+ assert$b(divisor === 0, "WebGL instanced rendering not supported");
40011
40342
  },
40012
40343
  drawElementsInstanced: () => {
40013
40344
  },
@@ -40019,7 +40350,7 @@ const WEBGL2_CONTEXT_POLYFILLS = {
40019
40350
  suffix: "WEBGL"
40020
40351
  },
40021
40352
  drawBuffers: () => {
40022
- assert$9(false);
40353
+ assert$b(false);
40023
40354
  }
40024
40355
  },
40025
40356
  [EXT_disjoint_timer_query]: {
@@ -40027,13 +40358,13 @@ const WEBGL2_CONTEXT_POLYFILLS = {
40027
40358
  suffix: "EXT"
40028
40359
  },
40029
40360
  createQuery: () => {
40030
- assert$9(false);
40361
+ assert$b(false);
40031
40362
  },
40032
40363
  deleteQuery: () => {
40033
- assert$9(false);
40364
+ assert$b(false);
40034
40365
  },
40035
40366
  beginQuery: () => {
40036
- assert$9(false);
40367
+ assert$b(false);
40037
40368
  },
40038
40369
  endQuery: () => {
40039
40370
  },
@@ -40166,7 +40497,7 @@ function polyfillExtension(gl, _ref2) {
40166
40497
  target2
40167
40498
  } = _ref2;
40168
40499
  const defaults = WEBGL2_CONTEXT_POLYFILLS[extension];
40169
- assert$9(defaults);
40500
+ assert$b(defaults);
40170
40501
  const {
40171
40502
  meta: meta2 = {}
40172
40503
  } = defaults;
@@ -40635,7 +40966,7 @@ class GLState {
40635
40966
  this.stateStack.push({});
40636
40967
  }
40637
40968
  pop() {
40638
- assert$9(this.stateStack.length > 0);
40969
+ assert$b(this.stateStack.length > 0);
40639
40970
  const oldValues = this.stateStack[this.stateStack.length - 1];
40640
40971
  setParameters(this.gl, oldValues);
40641
40972
  this.stateStack.pop();
@@ -40645,7 +40976,7 @@ class GLState {
40645
40976
  let oldValue;
40646
40977
  const oldValues = this.stateStack.length > 0 && this.stateStack[this.stateStack.length - 1];
40647
40978
  for (const key in values2) {
40648
- assert$9(key !== void 0);
40979
+ assert$b(key !== void 0);
40649
40980
  const value = values2[key];
40650
40981
  const cached = this.cache[key];
40651
40982
  if (!deepArrayEqual(value, cached)) {
@@ -40669,7 +41000,7 @@ function trackContextState(gl) {
40669
41000
  enable: enable2 = true,
40670
41001
  copyState
40671
41002
  } = options;
40672
- assert$9(copyState !== void 0);
41003
+ assert$b(copyState !== void 0);
40673
41004
  if (!gl.state) {
40674
41005
  const {
40675
41006
  polyfillContext: polyfillContext2
@@ -40700,11 +41031,11 @@ function pushContextState(gl) {
40700
41031
  gl.state.push();
40701
41032
  }
40702
41033
  function popContextState(gl) {
40703
- assert$9(gl.state);
41034
+ assert$b(gl.state);
40704
41035
  gl.state.pop();
40705
41036
  }
40706
41037
  function setParameters(gl, values2) {
40707
- assert$9(isWebGL(gl), "setParameters requires a WebGL context");
41038
+ assert$b(isWebGL(gl), "setParameters requires a WebGL context");
40708
41039
  if (isObjectEmpty$1(values2)) {
40709
41040
  return;
40710
41041
  }
@@ -40835,7 +41166,7 @@ const CONTEXT_DEFAULTS = {
40835
41166
  };
40836
41167
  function createGLContext() {
40837
41168
  let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
40838
- assert$9(isBrowser, "createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils");
41169
+ assert$b(isBrowser, "createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils");
40839
41170
  options = Object.assign({}, CONTEXT_DEFAULTS, options);
40840
41171
  const {
40841
41172
  width,
@@ -41070,7 +41401,7 @@ function requestAnimationFrame$1(callback) {
41070
41401
  function cancelAnimationFrame(timerId) {
41071
41402
  return typeof window !== "undefined" && window.cancelAnimationFrame ? window.cancelAnimationFrame(timerId) : clearTimeout(timerId);
41072
41403
  }
41073
- function assert$8(condition, message) {
41404
+ function assert$a(condition, message) {
41074
41405
  if (!condition) {
41075
41406
  throw new Error(message || "luma.gl: assertion failed.");
41076
41407
  }
@@ -41085,7 +41416,7 @@ function getKeyValue(gl, name2) {
41085
41416
  }
41086
41417
  name2 = name2.replace(/^.*\./, "");
41087
41418
  const value = gl[name2];
41088
- assert$8(value !== void 0, "Accessing undefined constant GL.".concat(name2));
41419
+ assert$a(value !== void 0, "Accessing undefined constant GL.".concat(name2));
41089
41420
  return value;
41090
41421
  }
41091
41422
  function getKey(gl, value) {
@@ -41105,7 +41436,7 @@ function uid() {
41105
41436
  return "".concat(id, "-").concat(count2);
41106
41437
  }
41107
41438
  function isPowerOfTwo(n3) {
41108
- assert$8(typeof n3 === "number", "Input must be a number");
41439
+ assert$a(typeof n3 === "number", "Input must be a number");
41109
41440
  return n3 && (n3 & n3 - 1) === 0;
41110
41441
  }
41111
41442
  function isObjectEmpty(obj) {
@@ -41197,7 +41528,7 @@ let Resource$1 = class Resource {
41197
41528
  getParameter(pname) {
41198
41529
  let opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
41199
41530
  pname = getKeyValue(this.gl, pname);
41200
- assert$8(pname);
41531
+ assert$a(pname);
41201
41532
  const parameters = this.constructor.PARAMETERS || {};
41202
41533
  const parameter = parameters[pname];
41203
41534
  if (parameter) {
@@ -41237,7 +41568,7 @@ let Resource$1 = class Resource {
41237
41568
  }
41238
41569
  setParameter(pname, value) {
41239
41570
  pname = getKeyValue(this.gl, pname);
41240
- assert$8(pname);
41571
+ assert$a(pname);
41241
41572
  const parameters = this.constructor.PARAMETERS || {};
41242
41573
  const parameter = parameters[pname];
41243
41574
  if (parameter) {
@@ -41467,7 +41798,7 @@ class Accessor {
41467
41798
  return ArrayType.BYTES_PER_ELEMENT;
41468
41799
  }
41469
41800
  static getBytesPerVertex(accessor) {
41470
- assert$8(accessor.size);
41801
+ assert$a(accessor.size);
41471
41802
  const ArrayType = getTypedArrayFromGLType(accessor.type || 5126);
41472
41803
  return ArrayType.BYTES_PER_ELEMENT * accessor.size;
41473
41804
  }
@@ -41640,7 +41971,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
41640
41971
  srcOffset = 0
41641
41972
  } = props;
41642
41973
  const byteLength = props.byteLength || props.length;
41643
- assert$8(data);
41974
+ assert$a(data);
41644
41975
  const target = this.gl.webgl2 ? 36663 : this.target;
41645
41976
  this.gl.bindBuffer(target, this.handle);
41646
41977
  if (srcOffset !== 0 || byteLength !== void 0) {
@@ -41697,7 +42028,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
41697
42028
  }
41698
42029
  const copyElementCount = Math.min(sourceAvailableElementCount, dstAvailableElementCount);
41699
42030
  length2 = length2 || copyElementCount;
41700
- assert$8(length2 <= copyElementCount);
42031
+ assert$a(length2 <= copyElementCount);
41701
42032
  dstData = dstData || new ArrayType(dstElementCount);
41702
42033
  this.gl.bindBuffer(36662, this.handle);
41703
42034
  this.gl.getBufferSubData(36662, srcByteOffset, dstData, dstOffset, length2);
@@ -41715,7 +42046,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
41715
42046
  if (size2 !== void 0) {
41716
42047
  this.gl.bindBufferRange(target, index2, this.handle, offset, size2);
41717
42048
  } else {
41718
- assert$8(offset === 0);
42049
+ assert$a(offset === 0);
41719
42050
  this.gl.bindBufferBase(target, index2, this.handle);
41720
42051
  }
41721
42052
  } else {
@@ -41757,7 +42088,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
41757
42088
  _setData(data) {
41758
42089
  let offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
41759
42090
  let byteLength = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : data.byteLength + offset;
41760
- assert$8(ArrayBuffer.isView(data));
42091
+ assert$a(ArrayBuffer.isView(data));
41761
42092
  this._trackDeallocatedMemory();
41762
42093
  const target = this._getTarget();
41763
42094
  this.gl.bindBuffer(target, this.handle);
@@ -41768,7 +42099,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
41768
42099
  this.bytesUsed = byteLength;
41769
42100
  this._trackAllocatedMemory(byteLength);
41770
42101
  const type2 = getGLTypeFromTypedArray(data);
41771
- assert$8(type2);
42102
+ assert$a(type2);
41772
42103
  this.setAccessor(new Accessor(this.accessor, {
41773
42104
  type: type2
41774
42105
  }));
@@ -41776,7 +42107,7 @@ let Buffer$1 = class Buffer2 extends Resource$1 {
41776
42107
  }
41777
42108
  _setByteLength(byteLength) {
41778
42109
  let usage = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.usage;
41779
- assert$8(byteLength >= 0);
42110
+ assert$a(byteLength >= 0);
41780
42111
  this._trackDeallocatedMemory();
41781
42112
  let data = byteLength;
41782
42113
  if (byteLength === 0) {
@@ -42208,7 +42539,7 @@ class Texture extends Resource$1 {
42208
42539
  }
42209
42540
  break;
42210
42541
  default:
42211
- assert$8(false, "Unknown image data type");
42542
+ assert$a(false, "Unknown image data type");
42212
42543
  }
42213
42544
  });
42214
42545
  if (dataType === "compressed") {
@@ -42256,7 +42587,7 @@ class Texture extends Resource$1 {
42256
42587
  width,
42257
42588
  height
42258
42589
  }));
42259
- assert$8(this.depth === 0, "texSubImage not supported for 3D textures");
42590
+ assert$a(this.depth === 0, "texSubImage not supported for 3D textures");
42260
42591
  if (!data) {
42261
42592
  data = pixels;
42262
42593
  }
@@ -42430,9 +42761,9 @@ class Texture extends Resource$1 {
42430
42761
  height
42431
42762
  };
42432
42763
  }
42433
- assert$8(size2, "Could not deduced texture size");
42434
- assert$8(width === void 0 || size2.width === width, "Deduced texture width does not match supplied width");
42435
- assert$8(height === void 0 || size2.height === height, "Deduced texture height does not match supplied height");
42764
+ assert$a(size2, "Could not deduced texture size");
42765
+ assert$a(width === void 0 || size2.width === width, "Deduced texture width does not match supplied width");
42766
+ assert$a(height === void 0 || size2.height === height, "Deduced texture height does not match supplied height");
42436
42767
  return size2;
42437
42768
  }
42438
42769
  _createHandle() {
@@ -42465,7 +42796,7 @@ class Texture extends Resource$1 {
42465
42796
  break;
42466
42797
  case 4096:
42467
42798
  case 4097:
42468
- assert$8(false);
42799
+ assert$a(false);
42469
42800
  break;
42470
42801
  default:
42471
42802
  this.gl.texParameteri(this.target, pname, param);
@@ -42515,7 +42846,7 @@ class Texture extends Resource$1 {
42515
42846
  }
42516
42847
  let pathPrefix = "";
42517
42848
  function loadImage$1(url, opts2) {
42518
- assert$8(typeof url === "string");
42849
+ assert$a(typeof url === "string");
42519
42850
  url = pathPrefix + url;
42520
42851
  return new Promise((resolve2, reject) => {
42521
42852
  try {
@@ -42925,7 +43256,7 @@ class Renderbuffer extends Resource$1 {
42925
43256
  height = 1,
42926
43257
  samples = 0
42927
43258
  } = _ref2;
42928
- assert$8(format2, "Needs format");
43259
+ assert$a(format2, "Needs format");
42929
43260
  this._trackDeallocatedMemory();
42930
43261
  this.gl.bindRenderbuffer(36161, this.handle);
42931
43262
  if (samples !== 0 && isWebGL2$1(this.gl)) {
@@ -43015,7 +43346,7 @@ function clear(gl) {
43015
43346
  parameters.clearStencil = depth;
43016
43347
  }
43017
43348
  }
43018
- assert$8(clearFlags !== 0, ERR_ARGUMENTS);
43349
+ assert$a(clearFlags !== 0, ERR_ARGUMENTS);
43019
43350
  withParameters(gl, parameters, () => {
43020
43351
  gl.clear(clearFlags);
43021
43352
  });
@@ -43056,7 +43387,7 @@ function clearBuffer(gl) {
43056
43387
  gl.clearBufferfi(GL_DEPTH_STENCIL, 0, depth, stencil);
43057
43388
  break;
43058
43389
  default:
43059
- assert$8(false, ERR_ARGUMENTS);
43390
+ assert$a(false, ERR_ARGUMENTS);
43060
43391
  }
43061
43392
  });
43062
43393
  }
@@ -43076,7 +43407,7 @@ function glFormatToComponents(format2) {
43076
43407
  case 34836:
43077
43408
  return 4;
43078
43409
  default:
43079
- assert$8(false);
43410
+ assert$a(false);
43080
43411
  return 0;
43081
43412
  }
43082
43413
  }
@@ -43091,7 +43422,7 @@ function glTypeToBytes(type2) {
43091
43422
  case 5126:
43092
43423
  return 4;
43093
43424
  default:
43094
- assert$8(false);
43425
+ assert$a(false);
43095
43426
  return 0;
43096
43427
  }
43097
43428
  }
@@ -43113,7 +43444,7 @@ function readPixelsToArray(source) {
43113
43444
  framebuffer,
43114
43445
  deleteFramebuffer
43115
43446
  } = getFramebuffer$1(source);
43116
- assert$8(framebuffer);
43447
+ assert$a(framebuffer);
43117
43448
  const {
43118
43449
  gl,
43119
43450
  handle,
@@ -43124,7 +43455,7 @@ function readPixelsToArray(source) {
43124
43455
  if (sourceAttachment === 36064 && handle === null) {
43125
43456
  sourceAttachment = 1028;
43126
43457
  }
43127
- assert$8(attachments[sourceAttachment]);
43458
+ assert$a(attachments[sourceAttachment]);
43128
43459
  sourceType = sourceType || attachments[sourceAttachment].type;
43129
43460
  target = getPixelArray(target, sourceType, sourceFormat, sourceWidth, sourceHeight);
43130
43461
  sourceType = sourceType || getGLTypeFromTypedArray(target);
@@ -43151,7 +43482,7 @@ function readPixelsToBuffer(source, _ref) {
43151
43482
  framebuffer,
43152
43483
  deleteFramebuffer
43153
43484
  } = getFramebuffer$1(source);
43154
- assert$8(framebuffer);
43485
+ assert$a(framebuffer);
43155
43486
  sourceWidth = sourceWidth || framebuffer.width;
43156
43487
  sourceHeight = sourceHeight || framebuffer.height;
43157
43488
  const gl2 = assertWebGL2Context(framebuffer.gl);
@@ -43240,7 +43571,7 @@ function copyToTexture(source, target) {
43240
43571
  framebuffer,
43241
43572
  deleteFramebuffer
43242
43573
  } = getFramebuffer$1(source);
43243
- assert$8(framebuffer);
43574
+ assert$a(framebuffer);
43244
43575
  const {
43245
43576
  gl,
43246
43577
  handle
@@ -43250,7 +43581,7 @@ function copyToTexture(source, target) {
43250
43581
  targetY = targetY || 0;
43251
43582
  targetZ = targetZ || 0;
43252
43583
  const prevHandle = gl.bindFramebuffer(36160, handle);
43253
- assert$8(target);
43584
+ assert$a(target);
43254
43585
  let texture = null;
43255
43586
  if (target instanceof Texture) {
43256
43587
  texture = target;
@@ -43405,7 +43736,7 @@ function isFeatureSupported(gl, cap) {
43405
43736
  }
43406
43737
  function queryFeature(gl, cap) {
43407
43738
  const feature2 = WEBGL_FEATURES$1[cap];
43408
- assert$8(feature2, cap);
43739
+ assert$a(feature2, cap);
43409
43740
  let isSupported;
43410
43741
  const featureDefinition = isWebGL2$1(gl) ? feature2[1] || feature2[0] : feature2[0];
43411
43742
  if (typeof featureDefinition === "function") {
@@ -43420,7 +43751,7 @@ function queryFeature(gl, cap) {
43420
43751
  } else if (typeof featureDefinition === "boolean") {
43421
43752
  isSupported = featureDefinition;
43422
43753
  } else {
43423
- assert$8(false);
43754
+ assert$a(false);
43424
43755
  }
43425
43756
  return isSupported;
43426
43757
  }
@@ -43497,7 +43828,7 @@ class Framebuffer extends Resource$1 {
43497
43828
  readBuffer = void 0,
43498
43829
  drawBuffers = void 0
43499
43830
  } = _ref;
43500
- assert$8(width >= 0 && height >= 0, "Width and height need to be integers");
43831
+ assert$a(width >= 0 && height >= 0, "Width and height need to be integers");
43501
43832
  this.width = width;
43502
43833
  this.height = height;
43503
43834
  if (attachments) {
@@ -43561,7 +43892,7 @@ class Framebuffer extends Resource$1 {
43561
43892
  height
43562
43893
  } = options;
43563
43894
  if (this.handle === null) {
43564
- assert$8(width === void 0 && height === void 0);
43895
+ assert$a(width === void 0 && height === void 0);
43565
43896
  this.width = this.gl.drawingBufferWidth;
43566
43897
  this.height = this.gl.drawingBufferHeight;
43567
43898
  return this;
@@ -43599,7 +43930,7 @@ class Framebuffer extends Resource$1 {
43599
43930
  Object.assign(newAttachments, attachments);
43600
43931
  const prevHandle = this.gl.bindFramebuffer(36160, this.handle);
43601
43932
  for (const key in newAttachments) {
43602
- assert$8(key !== void 0, "Misspelled framebuffer binding point?");
43933
+ assert$a(key !== void 0, "Misspelled framebuffer binding point?");
43603
43934
  const attachment = Number(key);
43604
43935
  const descriptor = newAttachments[attachment];
43605
43936
  let object2 = descriptor;
@@ -43835,7 +44166,7 @@ class Framebuffer extends Resource$1 {
43835
44166
  });
43836
44167
  this.ownResources.push(defaultAttachments[36096]);
43837
44168
  } else if (stencil) {
43838
- assert$8(false);
44169
+ assert$a(false);
43839
44170
  }
43840
44171
  return defaultAttachments;
43841
44172
  }
@@ -43887,7 +44218,7 @@ class Framebuffer extends Resource$1 {
43887
44218
  gl.framebufferTexture2D(36160, attachment, 3553, texture.handle, level);
43888
44219
  break;
43889
44220
  default:
43890
- assert$8(false, "Illegal texture type");
44221
+ assert$a(false, "Illegal texture type");
43891
44222
  }
43892
44223
  gl.bindTexture(texture.target, null);
43893
44224
  this.attachments[attachment] = texture;
@@ -43897,7 +44228,7 @@ class Framebuffer extends Resource$1 {
43897
44228
  if (gl2) {
43898
44229
  gl2.readBuffer(readBuffer);
43899
44230
  } else {
43900
- assert$8(readBuffer === 36064 || readBuffer === 1029, ERR_MULTIPLE_RENDERTARGETS);
44231
+ assert$a(readBuffer === 36064 || readBuffer === 1029, ERR_MULTIPLE_RENDERTARGETS);
43901
44232
  }
43902
44233
  this.readBuffer = readBuffer;
43903
44234
  }
@@ -43913,7 +44244,7 @@ class Framebuffer extends Resource$1 {
43913
44244
  if (ext) {
43914
44245
  ext.drawBuffersWEBGL(drawBuffers);
43915
44246
  } else {
43916
- assert$8(drawBuffers.length === 1 && (drawBuffers[0] === 36064 || drawBuffers[0] === 1029), ERR_MULTIPLE_RENDERTARGETS);
44247
+ assert$a(drawBuffers.length === 1 && (drawBuffers[0] === 36064 || drawBuffers[0] === 1029), ERR_MULTIPLE_RENDERTARGETS);
43917
44248
  }
43918
44249
  }
43919
44250
  this.drawBuffers = drawBuffers;
@@ -43958,7 +44289,7 @@ function _getFrameBufferStatus(status) {
43958
44289
  const FRAMEBUFFER_ATTACHMENT_PARAMETERS = [36049, 36048, 33296, 33298, 33299, 33300, 33301, 33302, 33303];
43959
44290
  Framebuffer.ATTACHMENT_PARAMETERS = FRAMEBUFFER_ATTACHMENT_PARAMETERS;
43960
44291
  function cloneTextureFrom(refTexture, overrides) {
43961
- assert$8(refTexture instanceof Texture2D || refTexture instanceof TextureCube || refTexture instanceof Texture3D);
44292
+ assert$a(refTexture instanceof Texture2D || refTexture instanceof TextureCube || refTexture instanceof Texture3D);
43962
44293
  const TextureType = refTexture.constructor;
43963
44294
  const {
43964
44295
  gl,
@@ -44107,13 +44438,13 @@ class Shader extends Resource$1 {
44107
44438
  case 35632:
44108
44439
  return "fragment-shader";
44109
44440
  default:
44110
- assert$8(false);
44441
+ assert$a(false);
44111
44442
  return "unknown";
44112
44443
  }
44113
44444
  }
44114
44445
  constructor(gl, props) {
44115
44446
  assertWebGLContext(gl);
44116
- assert$8(typeof props.source === "string", ERR_SOURCE);
44447
+ assert$a(typeof props.source === "string", ERR_SOURCE);
44117
44448
  const id = getShaderName$1(props.source, null) || props.id || uid("unnamed ".concat(Shader.getTypeName(props.shaderType)));
44118
44449
  super(gl, {
44119
44450
  id
@@ -44401,7 +44732,7 @@ function getArraySetter(functionName, toArray, size2, uniformSetter) {
44401
44732
  cacheLength = length2;
44402
44733
  update = true;
44403
44734
  } else {
44404
- assert$8(cacheLength === length2, "Uniform length cannot change.");
44735
+ assert$a(cacheLength === length2, "Uniform length cannot change.");
44405
44736
  for (let i2 = 0; i2 < length2; ++i2) {
44406
44737
  if (arrayValue[i2] !== cache2[i2]) {
44407
44738
  update = true;
@@ -44502,7 +44833,7 @@ function getPrimitiveDrawMode(drawMode) {
44502
44833
  case GL_TRIANGLE_FAN:
44503
44834
  return GL_TRIANGLES;
44504
44835
  default:
44505
- assert$8(false);
44836
+ assert$a(false);
44506
44837
  return 0;
44507
44838
  }
44508
44839
  }
@@ -44691,8 +45022,8 @@ class Program extends Resource$1 {
44691
45022
  id: "".concat(props.id, "-fs"),
44692
45023
  source: fs2
44693
45024
  }) : fs2;
44694
- assert$8(this.vs instanceof VertexShader);
44695
- assert$8(this.fs instanceof FragmentShader);
45025
+ assert$a(this.vs instanceof VertexShader);
45026
+ assert$a(this.fs instanceof FragmentShader);
44696
45027
  this.uniforms = {};
44697
45028
  this._textureUniforms = {};
44698
45029
  if (varyings && varyings.length > 0) {
@@ -44746,7 +45077,7 @@ class Program extends Resource$1 {
44746
45077
  const message = "mode=".concat(getKey(this.gl, drawMode), " verts=").concat(vertexCount, " ") + "instances=".concat(instanceCount, " indexType=").concat(getKey(this.gl, indexType), " ") + "isInstanced=".concat(isInstanced, " isIndexed=").concat(isIndexed, " ") + "Framebuffer=".concat(fb);
44747
45078
  log$2.log(logPriority, message)();
44748
45079
  }
44749
- assert$8(vertexArray);
45080
+ assert$a(vertexArray);
44750
45081
  this.gl.useProgram(this.handle);
44751
45082
  if (!this._areTexturesRenderable() || vertexCount === 0 || isInstanced && instanceCount === 0) {
44752
45083
  return false;
@@ -44959,7 +45290,7 @@ class Query extends Resource$1 {
44959
45290
  supported = supported && hasTimerQuery;
44960
45291
  break;
44961
45292
  default:
44962
- assert$8(false);
45293
+ assert$a(false);
44963
45294
  }
44964
45295
  }
44965
45296
  return supported;
@@ -45276,7 +45607,7 @@ class VertexArrayObject extends Resource$1 {
45276
45607
  VertexArrayObject._setConstantUintArray(gl, location, array);
45277
45608
  break;
45278
45609
  default:
45279
- assert$8(false);
45610
+ assert$a(false);
45280
45611
  }
45281
45612
  }
45282
45613
  constructor(gl) {
@@ -45311,7 +45642,7 @@ class VertexArrayObject extends Resource$1 {
45311
45642
  }
45312
45643
  setElementBuffer() {
45313
45644
  let elementBuffer = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
45314
- assert$8(!elementBuffer || elementBuffer.target === 34963, ERR_ELEMENTS);
45645
+ assert$a(!elementBuffer || elementBuffer.target === 34963, ERR_ELEMENTS);
45315
45646
  this.bind(() => {
45316
45647
  this.gl.bindBuffer(34963, elementBuffer ? elementBuffer.handle : null);
45317
45648
  });
@@ -45338,7 +45669,7 @@ class VertexArrayObject extends Resource$1 {
45338
45669
  this.bind(() => {
45339
45670
  gl.bindBuffer(34962, buffer2.handle);
45340
45671
  if (integer) {
45341
- assert$8(isWebGL2$1(gl));
45672
+ assert$a(isWebGL2$1(gl));
45342
45673
  gl2.vertexAttribIPointer(location, size2, type2, stride, offset);
45343
45674
  } else {
45344
45675
  gl.vertexAttribPointer(location, size2, type2, normalized, stride, offset);
@@ -45412,11 +45743,11 @@ class VertexArrayObject extends Resource$1 {
45412
45743
  gl.vertexAttrib4fv(location, array);
45413
45744
  break;
45414
45745
  default:
45415
- assert$8(false);
45746
+ assert$a(false);
45416
45747
  }
45417
45748
  }
45418
45749
  static _setConstantIntArray(gl, location, array) {
45419
- assert$8(isWebGL2$1(gl));
45750
+ assert$a(isWebGL2$1(gl));
45420
45751
  switch (array.length) {
45421
45752
  case 1:
45422
45753
  gl.vertexAttribI1iv(location, array);
@@ -45431,11 +45762,11 @@ class VertexArrayObject extends Resource$1 {
45431
45762
  gl.vertexAttribI4iv(location, array);
45432
45763
  break;
45433
45764
  default:
45434
- assert$8(false);
45765
+ assert$a(false);
45435
45766
  }
45436
45767
  }
45437
45768
  static _setConstantUintArray(gl, location, array) {
45438
- assert$8(isWebGL2$1(gl));
45769
+ assert$a(isWebGL2$1(gl));
45439
45770
  switch (array.length) {
45440
45771
  case 1:
45441
45772
  gl.vertexAttribI1uiv(location, array);
@@ -45450,7 +45781,7 @@ class VertexArrayObject extends Resource$1 {
45450
45781
  gl.vertexAttribI4uiv(location, array);
45451
45782
  break;
45452
45783
  default:
45453
- assert$8(false);
45784
+ assert$a(false);
45454
45785
  }
45455
45786
  }
45456
45787
  _createHandle() {
@@ -45468,7 +45799,7 @@ class VertexArrayObject extends Resource$1 {
45468
45799
  let {
45469
45800
  location
45470
45801
  } = _ref;
45471
- assert$8(Number.isFinite(location));
45802
+ assert$a(Number.isFinite(location));
45472
45803
  return this.bind(() => {
45473
45804
  switch (pname) {
45474
45805
  case 34373:
@@ -45672,7 +46003,7 @@ class VertexArray {
45672
46003
  size: size2,
45673
46004
  type: type2
45674
46005
  } = accessor;
45675
- assert$8(Number.isFinite(size2) && Number.isFinite(type2));
46006
+ assert$a(Number.isFinite(size2) && Number.isFinite(type2));
45676
46007
  return {
45677
46008
  location,
45678
46009
  accessor
@@ -45848,7 +46179,7 @@ function getDebugTableForUniforms(_ref) {
45848
46179
  uniforms,
45849
46180
  undefinedOnly = false
45850
46181
  } = _ref;
45851
- assert$8(program);
46182
+ assert$a(program);
45852
46183
  const SHADER_MODULE_UNIFORM_REGEXP = ".*_.*";
45853
46184
  const PROJECT_MODULE_UNIFORM_REGEXP = ".*Matrix";
45854
46185
  const uniformLocations = program._uniformSetters;
@@ -46135,7 +46466,7 @@ class AnimationLoop {
46135
46466
  this._setDisplay(null);
46136
46467
  }
46137
46468
  setNeedsRedraw(reason) {
46138
- assert$8(typeof reason === "string");
46469
+ assert$a(typeof reason === "string");
46139
46470
  this.needsRedraw = this.needsRedraw || reason;
46140
46471
  return this;
46141
46472
  }
@@ -46484,7 +46815,7 @@ class AnimationLoop {
46484
46815
  }
46485
46816
  const VERTEX_SHADER$1 = "vs";
46486
46817
  const FRAGMENT_SHADER$1 = "fs";
46487
- function assert$7(condition, message) {
46818
+ function assert$9(condition, message) {
46488
46819
  if (!condition) {
46489
46820
  throw new Error(message || "shadertools: assertion failed.");
46490
46821
  }
@@ -46561,7 +46892,7 @@ class ShaderModule {
46561
46892
  vertexShader: vertexShader2,
46562
46893
  fragmentShader: fragmentShader2
46563
46894
  } = _ref;
46564
- assert$7(typeof name2 === "string");
46895
+ assert$9(typeof name2 === "string");
46565
46896
  this.name = name2;
46566
46897
  this.vs = vs2 || vertexShader2;
46567
46898
  this.fs = fs2 || fragmentShader2;
@@ -46584,7 +46915,7 @@ class ShaderModule {
46584
46915
  moduleSource = this.fs || "";
46585
46916
  break;
46586
46917
  default:
46587
- assert$7(false);
46918
+ assert$9(false);
46588
46919
  }
46589
46920
  return "#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi, "_"), "\n").concat(moduleSource, "// END MODULE_").concat(this.name, "\n\n");
46590
46921
  }
@@ -46631,7 +46962,7 @@ class ShaderModule {
46631
46962
  const propDef = propTypes[key];
46632
46963
  if (key in opts2 && !propDef.private) {
46633
46964
  if (propDef.validate) {
46634
- assert$7(propDef.validate(opts2[key], propDef), "".concat(this.name, ": invalid ").concat(key));
46965
+ assert$9(propDef.validate(opts2[key], propDef), "".concat(this.name, ": invalid ").concat(key));
46635
46966
  }
46636
46967
  uniforms[key] = opts2[key];
46637
46968
  } else {
@@ -46715,8 +47046,8 @@ function instantiateModules(modules, seen) {
46715
47046
  if (module2 instanceof ShaderModule) {
46716
47047
  return module2;
46717
47048
  }
46718
- assert$7(typeof module2 !== "string", "Shader module use by name is deprecated. Import shader module '".concat(module2, "' and use it directly."));
46719
- assert$7(module2.name, "shader module has no name");
47049
+ assert$9(typeof module2 !== "string", "Shader module use by name is deprecated. Import shader module '".concat(module2, "' and use it directly."));
47050
+ assert$9(module2.name, "shader module has no name");
46720
47051
  module2 = new ShaderModule(module2);
46721
47052
  module2.dependencies = instantiateModules(module2.dependencies);
46722
47053
  return module2;
@@ -46780,7 +47111,7 @@ const compiledGlslExtensions = {};
46780
47111
  function canCompileGLGSExtension(gl, cap) {
46781
47112
  let opts2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
46782
47113
  const feature2 = WEBGL_FEATURES[cap];
46783
- assert$7(feature2, cap);
47114
+ assert$9(feature2, cap);
46784
47115
  if (!isOldIE(opts2)) {
46785
47116
  return true;
46786
47117
  }
@@ -46800,10 +47131,10 @@ function canCompileGLGSExtension(gl, cap) {
46800
47131
  }
46801
47132
  function getFeature(gl, cap) {
46802
47133
  const feature2 = WEBGL_FEATURES[cap];
46803
- assert$7(feature2, cap);
47134
+ assert$9(feature2, cap);
46804
47135
  const extensionName = isWebGL2(gl) ? feature2[1] || feature2[0] : feature2[0];
46805
47136
  const value = typeof extensionName === "string" ? Boolean(gl.getExtension(extensionName)) : extensionName;
46806
- assert$7(value === false || value === true);
47137
+ assert$9(value === false || value === true);
46807
47138
  return value;
46808
47139
  }
46809
47140
  function hasFeatures(gl, features) {
@@ -46905,7 +47236,7 @@ function injectShader(source, type2, inject2) {
46905
47236
  }
46906
47237
  function combineInjects(injects) {
46907
47238
  const result = {};
46908
- assert$7(Array.isArray(injects) && injects.length > 1);
47239
+ assert$9(Array.isArray(injects) && injects.length > 1);
46909
47240
  injects.forEach((inject2) => {
46910
47241
  for (const key in inject2) {
46911
47242
  result[key] = result[key] ? "".concat(result[key], "\n").concat(inject2[key]) : inject2[key];
@@ -47002,7 +47333,7 @@ function assembleShader(gl, _ref) {
47002
47333
  prologue = true,
47003
47334
  log: log3
47004
47335
  } = _ref;
47005
- assert$7(typeof source === "string", "shader source must be a string");
47336
+ assert$9(typeof source === "string", "shader source must be a string");
47006
47337
  const isVertex = type2 === VERTEX_SHADER$1;
47007
47338
  const sourceLines = source.split("\n");
47008
47339
  let glslVersion = 100;
@@ -47219,7 +47550,7 @@ function typeToChannelSuffix(type2) {
47219
47550
  case "vec4":
47220
47551
  return "xyzw";
47221
47552
  default:
47222
- assert$7(false);
47553
+ assert$9(false);
47223
47554
  return null;
47224
47555
  }
47225
47556
  }
@@ -47234,7 +47565,7 @@ function typeToChannelCount(type2) {
47234
47565
  case "vec4":
47235
47566
  return 4;
47236
47567
  default:
47237
- assert$7(false);
47568
+ assert$9(false);
47238
47569
  return null;
47239
47570
  }
47240
47571
  }
@@ -47249,7 +47580,7 @@ function convertToVec4(variable, type2) {
47249
47580
  case "vec4":
47250
47581
  return variable;
47251
47582
  default:
47252
- assert$7(false);
47583
+ assert$9(false);
47253
47584
  return null;
47254
47585
  }
47255
47586
  }
@@ -47724,7 +48055,7 @@ function getBuffersFromGeometry(gl, geometry2, options) {
47724
48055
  }
47725
48056
  if (indices) {
47726
48057
  const data = indices.value || indices;
47727
- assert$8(data instanceof Uint16Array || data instanceof Uint32Array, 'attribute array for "indices" must be of integer type');
48058
+ assert$a(data instanceof Uint16Array || data instanceof Uint32Array, 'attribute array for "indices" must be of integer type');
47728
48059
  const accessor = {
47729
48060
  size: 1,
47730
48061
  isIndexed: indices.isIndexed === void 0 ? true : indices.isIndexed
@@ -47766,7 +48097,7 @@ function inferAttributeAccessor(attributeName, attribute) {
47766
48097
  attribute.size = attribute.size || 2;
47767
48098
  break;
47768
48099
  }
47769
- assert$8(Number.isFinite(attribute.size), "attribute ".concat(attributeName, " needs size"));
48100
+ assert$a(Number.isFinite(attribute.size), "attribute ".concat(attributeName, " needs size"));
47770
48101
  }
47771
48102
  const LOG_DRAW_PRIORITY = 2;
47772
48103
  const LOG_DRAW_TIMEOUT = 1e4;
@@ -47780,7 +48111,7 @@ class Model {
47780
48111
  const {
47781
48112
  id = uid("model")
47782
48113
  } = props;
47783
- assert$8(isWebGL(gl));
48114
+ assert$a(isWebGL(gl));
47784
48115
  this.id = id;
47785
48116
  this.gl = gl;
47786
48117
  this.id = props.id || uid("Model");
@@ -47832,7 +48163,7 @@ class Model {
47832
48163
  this.isInstanced = props.isInstanced || props.instanced || props.instanceCount > 0;
47833
48164
  this._setModelProps(props);
47834
48165
  this.geometry = {};
47835
- assert$8(this.drawMode !== void 0 && Number.isFinite(this.vertexCount), ERR_MODEL_PARAMS);
48166
+ assert$a(this.drawMode !== void 0 && Number.isFinite(this.vertexCount), ERR_MODEL_PARAMS);
47836
48167
  }
47837
48168
  setProps(props) {
47838
48169
  this._setModelProps(props);
@@ -47898,12 +48229,12 @@ class Model {
47898
48229
  return this;
47899
48230
  }
47900
48231
  setVertexCount(vertexCount) {
47901
- assert$8(Number.isFinite(vertexCount));
48232
+ assert$a(Number.isFinite(vertexCount));
47902
48233
  this.vertexCount = vertexCount;
47903
48234
  return this;
47904
48235
  }
47905
48236
  setInstanceCount(instanceCount) {
47906
- assert$8(Number.isFinite(instanceCount));
48237
+ assert$a(Number.isFinite(instanceCount));
47907
48238
  this.instanceCount = instanceCount;
47908
48239
  return this;
47909
48240
  }
@@ -48100,7 +48431,7 @@ class Model {
48100
48431
  this._programManagerState = this.programManager.stateHash;
48101
48432
  this._managedProgram = true;
48102
48433
  }
48103
- assert$8(program instanceof Program, "Model needs a program");
48434
+ assert$a(program instanceof Program, "Model needs a program");
48104
48435
  this._programDirty = false;
48105
48436
  if (program === this.program) {
48106
48437
  return;
@@ -48128,7 +48459,7 @@ class Model {
48128
48459
  }
48129
48460
  _setAnimationProps(animationProps) {
48130
48461
  if (this.animated) {
48131
- assert$8(animationProps, "Model.draw(): animated uniforms but no animationProps");
48462
+ assert$a(animationProps, "Model.draw(): animated uniforms but no animationProps");
48132
48463
  }
48133
48464
  }
48134
48465
  _setFeedbackBuffers() {
@@ -48286,7 +48617,7 @@ class BufferTransform {
48286
48617
  this._setupBuffers(props);
48287
48618
  this.varyings = props.varyings || Object.keys(this.bindings[this.currentIndex].feedbackBuffers);
48288
48619
  if (this.varyings.length > 0) {
48289
- assert$8(isWebGL2$1(this.gl));
48620
+ assert$a(isWebGL2$1(this.gl));
48290
48621
  }
48291
48622
  }
48292
48623
  _getFeedbackBuffers(props) {
@@ -48386,7 +48717,7 @@ class BufferTransform {
48386
48717
  const dstName = this.feedbackMap[srcName];
48387
48718
  sourceBuffers[srcName] = opts2.feedbackBuffers[dstName];
48388
48719
  feedbackBuffers[dstName] = opts2.sourceBuffers[srcName];
48389
- assert$8(feedbackBuffers[dstName] instanceof Buffer$1);
48720
+ assert$a(feedbackBuffers[dstName] instanceof Buffer$1);
48390
48721
  }
48391
48722
  return {
48392
48723
  sourceBuffers,
@@ -48443,7 +48774,7 @@ function updateForTextures(_ref) {
48443
48774
  }
48444
48775
  });
48445
48776
  if (targetTextureVarying) {
48446
- assert$8(targetTexture);
48777
+ assert$a(targetTexture);
48447
48778
  const sizeName = "".concat(SIZE_UNIFORM_PREFIX).concat(targetTextureVarying);
48448
48779
  const uniformDeclaration = "uniform vec2 ".concat(sizeName, ";\n");
48449
48780
  const posInstructions = " vec2 ".concat(VS_POS_VARIABLE, " = transform_getPos(").concat(sizeName, ");\n gl_Position = vec4(").concat(VS_POS_VARIABLE, ", 0, 1.);\n");
@@ -48914,7 +49245,7 @@ class Transform {
48914
49245
  for (const resourceTransform of resourceTransforms) {
48915
49246
  swapped = swapped || resourceTransform.swap();
48916
49247
  }
48917
- assert$8(swapped, "Nothing to swap");
49248
+ assert$a(swapped, "Nothing to swap");
48918
49249
  }
48919
49250
  getBuffer() {
48920
49251
  let varyingName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
@@ -48978,7 +49309,7 @@ class Transform {
48978
49309
  if (canCreateTextureTransform(props)) {
48979
49310
  this.textureTransform = new TextureTransform(gl, props);
48980
49311
  }
48981
- assert$8(this.bufferTransform || this.textureTransform, "must provide source/feedback buffers or source/target textures");
49312
+ assert$a(this.bufferTransform || this.textureTransform, "must provide source/feedback buffers or source/target textures");
48982
49313
  }
48983
49314
  _updateDrawOptions(opts2) {
48984
49315
  let updatedOpts = Object.assign({}, opts2);
@@ -49057,12 +49388,12 @@ class Geometry {
49057
49388
  attribute = ArrayBuffer.isView(attribute) ? {
49058
49389
  value: attribute
49059
49390
  } : attribute;
49060
- assert$8(ArrayBuffer.isView(attribute.value), "".concat(this._print(attributeName), ": must be typed array or object with value as typed array"));
49391
+ assert$a(ArrayBuffer.isView(attribute.value), "".concat(this._print(attributeName), ": must be typed array or object with value as typed array"));
49061
49392
  if ((attributeName === "POSITION" || attributeName === "positions") && !attribute.size) {
49062
49393
  attribute.size = 3;
49063
49394
  }
49064
49395
  if (attributeName === "indices") {
49065
- assert$8(!this.indices);
49396
+ assert$a(!this.indices);
49066
49397
  this.indices = attribute;
49067
49398
  } else {
49068
49399
  this.attributes[attributeName] = attribute;
@@ -49090,7 +49421,7 @@ class Geometry {
49090
49421
  vertexCount = Math.min(vertexCount, value.length / size2);
49091
49422
  }
49092
49423
  }
49093
- assert$8(Number.isFinite(vertexCount));
49424
+ assert$a(Number.isFinite(vertexCount));
49094
49425
  return vertexCount;
49095
49426
  }
49096
49427
  }
@@ -49873,7 +50204,7 @@ const esm$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
49873
50204
  TransformFeedback,
49874
50205
  TruncatedConeGeometry,
49875
50206
  VertexShader,
49876
- assert: assert$8,
50207
+ assert: assert$a,
49877
50208
  clear,
49878
50209
  cloneTextureFrom,
49879
50210
  copyToTexture,
@@ -50200,7 +50531,7 @@ function ieLog2(x2) {
50200
50531
  return Math.log(x2) * Math.LOG2E;
50201
50532
  }
50202
50533
  const log2 = Math.log2 || ieLog2;
50203
- function assert$6(condition, message) {
50534
+ function assert$8(condition, message) {
50204
50535
  if (!condition) {
50205
50536
  throw new Error(message || "@math.gl/web-mercator: assertion failed.");
50206
50537
  }
@@ -50221,8 +50552,8 @@ function scaleToZoom(scale2) {
50221
50552
  }
50222
50553
  function lngLatToWorld(lngLat) {
50223
50554
  const [lng, lat] = lngLat;
50224
- assert$6(Number.isFinite(lng));
50225
- assert$6(Number.isFinite(lat) && lat >= -90 && lat <= 90, "invalid latitude");
50555
+ assert$8(Number.isFinite(lng));
50556
+ assert$8(Number.isFinite(lat) && lat >= -90 && lat <= 90, "invalid latitude");
50226
50557
  const lambda22 = lng * DEGREES_TO_RADIANS$6;
50227
50558
  const phi2 = lat * DEGREES_TO_RADIANS$6;
50228
50559
  const x2 = TILE_SIZE$6 * (lambda22 + PI) / (2 * PI);
@@ -50239,7 +50570,7 @@ function getMeterZoom(options) {
50239
50570
  const {
50240
50571
  latitude
50241
50572
  } = options;
50242
- assert$6(Number.isFinite(latitude));
50573
+ assert$8(Number.isFinite(latitude));
50243
50574
  const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS$6);
50244
50575
  return scaleToZoom(EARTH_CIRCUMFERENCE$1 * latCosine) - 9;
50245
50576
  }
@@ -50253,7 +50584,7 @@ function getDistanceScales$1(options) {
50253
50584
  longitude,
50254
50585
  highPrecision = false
50255
50586
  } = options;
50256
- assert$6(Number.isFinite(latitude) && Number.isFinite(longitude));
50587
+ assert$8(Number.isFinite(latitude) && Number.isFinite(longitude));
50257
50588
  const worldSize = TILE_SIZE$6;
50258
50589
  const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS$6);
50259
50590
  const unitsPerDegreeX = worldSize / 360;
@@ -50369,12 +50700,12 @@ function fovyToAltitude(fovy) {
50369
50700
  }
50370
50701
  function worldToPixels(xyz, pixelProjectionMatrix) {
50371
50702
  const [x2, y2, z2 = 0] = xyz;
50372
- assert$6(Number.isFinite(x2) && Number.isFinite(y2) && Number.isFinite(z2));
50703
+ assert$8(Number.isFinite(x2) && Number.isFinite(y2) && Number.isFinite(z2));
50373
50704
  return transformVector$1(pixelProjectionMatrix, [x2, y2, z2, 1]);
50374
50705
  }
50375
50706
  function pixelsToWorld(xyz, pixelUnprojectionMatrix, targetZ = 0) {
50376
50707
  const [x2, y2, z2] = xyz;
50377
- assert$6(Number.isFinite(x2) && Number.isFinite(y2), "invalid pixel coordinate");
50708
+ assert$8(Number.isFinite(x2) && Number.isFinite(y2), "invalid pixel coordinate");
50378
50709
  if (Number.isFinite(z2)) {
50379
50710
  const coord = transformVector$1(pixelUnprojectionMatrix, [x2, y2, z2, 1]);
50380
50711
  return coord;
@@ -50401,7 +50732,7 @@ function fitBounds(options) {
50401
50732
  const se = lngLatToWorld([east, clamp(south, -MAX_LATITUDE, MAX_LATITUDE)]);
50402
50733
  const size2 = [Math.max(Math.abs(se[0] - nw[0]), minExtent), Math.max(Math.abs(se[1] - nw[1]), minExtent)];
50403
50734
  const targetSize = [width - padding.left - padding.right - Math.abs(offset[0]) * 2, height - padding.top - padding.bottom - Math.abs(offset[1]) * 2];
50404
- assert$6(targetSize[0] > 0 && targetSize[1] > 0);
50735
+ assert$8(targetSize[0] > 0 && targetSize[1] > 0);
50405
50736
  const scaleX2 = targetSize[0] / size2[0];
50406
50737
  const scaleY2 = targetSize[1] / size2[1];
50407
50738
  const offsetX = (padding.right - padding.left) / 2 / scaleX2;
@@ -50409,7 +50740,7 @@ function fitBounds(options) {
50409
50740
  const center2 = [(se[0] + nw[0]) / 2 + offsetX, (se[1] + nw[1]) / 2 + offsetY];
50410
50741
  const centerLngLat = worldToLngLat(center2);
50411
50742
  const zoom = Math.min(maxZoom, log2(Math.abs(Math.min(scaleX2, scaleY2))));
50412
- assert$6(Number.isFinite(zoom));
50743
+ assert$8(Number.isFinite(zoom));
50413
50744
  return {
50414
50745
  longitude: centerLngLat[0],
50415
50746
  latitude: centerLngLat[1],
@@ -50425,7 +50756,7 @@ function getPaddingObject(padding = 0) {
50425
50756
  right: padding
50426
50757
  };
50427
50758
  }
50428
- assert$6(Number.isFinite(padding.top) && Number.isFinite(padding.bottom) && Number.isFinite(padding.left) && Number.isFinite(padding.right));
50759
+ assert$8(Number.isFinite(padding.top) && Number.isFinite(padding.bottom) && Number.isFinite(padding.left) && Number.isFinite(padding.right));
50429
50760
  return padding;
50430
50761
  }
50431
50762
  const DEGREES_TO_RADIANS$5 = Math.PI / 180;
@@ -53258,7 +53589,7 @@ function parsePosition(value) {
53258
53589
  function getPosition$1(position, extent2) {
53259
53590
  return position.relative ? Math.round(position.position * extent2) : position.position;
53260
53591
  }
53261
- function assert$5(condition, message) {
53592
+ function assert$7(condition, message) {
53262
53593
  if (!condition) {
53263
53594
  throw new Error(message || "deck.gl: assertion failed.");
53264
53595
  }
@@ -53282,7 +53613,7 @@ class View {
53282
53613
  padding = null,
53283
53614
  viewportInstance
53284
53615
  } = props || {};
53285
- assert$5(!viewportInstance || viewportInstance instanceof Viewport);
53616
+ assert$7(!viewportInstance || viewportInstance instanceof Viewport);
53286
53617
  this.viewportInstance = viewportInstance;
53287
53618
  this.id = id || this.constructor.displayName || "view";
53288
53619
  this.props = {
@@ -53656,7 +53987,7 @@ class TransitionInterpolator {
53656
53987
  }
53657
53988
  this._requiredProps.forEach((propName) => {
53658
53989
  const value = props[propName];
53659
- assert$5(Number.isFinite(value) || Array.isArray(value), "".concat(propName, " is required for transition"));
53990
+ assert$7(Number.isFinite(value) || Array.isArray(value), "".concat(propName, " is required for transition"));
53660
53991
  });
53661
53992
  }
53662
53993
  }
@@ -53905,9 +54236,9 @@ class Controller {
53905
54236
  updateTransition() {
53906
54237
  this.transitionManager.updateTransition();
53907
54238
  }
53908
- toggleEvents(eventNames2, enabled) {
54239
+ toggleEvents(eventNames, enabled) {
53909
54240
  if (this.eventManager) {
53910
- eventNames2.forEach((eventName) => {
54241
+ eventNames.forEach((eventName) => {
53911
54242
  if (this._events[eventName] !== enabled) {
53912
54243
  this._events[eventName] = enabled;
53913
54244
  if (enabled) {
@@ -54401,9 +54732,9 @@ class MapState extends ViewState {
54401
54732
  startZoom,
54402
54733
  normalize: normalize2 = true
54403
54734
  } = options;
54404
- assert$5(Number.isFinite(longitude));
54405
- assert$5(Number.isFinite(latitude));
54406
- assert$5(Number.isFinite(zoom));
54735
+ assert$7(Number.isFinite(longitude));
54736
+ assert$7(Number.isFinite(latitude));
54737
+ assert$7(Number.isFinite(zoom));
54407
54738
  super({
54408
54739
  width,
54409
54740
  height,
@@ -57358,18 +57689,18 @@ var hammer$1 = { exports: {} };
57358
57689
  emit: function(input) {
57359
57690
  var self2 = this;
57360
57691
  var state = this.state;
57361
- function emit2(event) {
57692
+ function emit(event) {
57362
57693
  self2.manager.emit(event, input);
57363
57694
  }
57364
57695
  if (state < STATE_ENDED) {
57365
- emit2(self2.options.event + stateStr(state));
57696
+ emit(self2.options.event + stateStr(state));
57366
57697
  }
57367
- emit2(self2.options.event);
57698
+ emit(self2.options.event);
57368
57699
  if (input.additionalEvent) {
57369
- emit2(input.additionalEvent);
57700
+ emit(input.additionalEvent);
57370
57701
  }
57371
57702
  if (state >= STATE_ENDED) {
57372
- emit2(self2.options.event + stateStr(state));
57703
+ emit(self2.options.event + stateStr(state));
57373
57704
  }
57374
57705
  },
57375
57706
  /**
@@ -58729,7 +59060,7 @@ class EventRegistrar {
58729
59060
  isEmpty() {
58730
59061
  return !this._active;
58731
59062
  }
58732
- add(type2, handler, options, once3 = false, passive = false) {
59063
+ add(type2, handler, options, once = false, passive = false) {
58733
59064
  const { handlers, handlersByElement } = this;
58734
59065
  let opts2 = DEFAULT_OPTIONS$2;
58735
59066
  if (typeof options === "string" || options && options.addEventListener) {
@@ -58748,7 +59079,7 @@ class EventRegistrar {
58748
59079
  srcElement: opts2.srcElement,
58749
59080
  priority: opts2.priority
58750
59081
  };
58751
- if (once3) {
59082
+ if (once) {
58752
59083
  entry.once = true;
58753
59084
  }
58754
59085
  if (passive) {
@@ -58796,7 +59127,7 @@ class EventRegistrar {
58796
59127
  };
58797
59128
  const entriesToRemove = [];
58798
59129
  for (let i2 = 0; i2 < entries.length; i2++) {
58799
- const { type: type2, handler, once: once3 } = entries[i2];
59130
+ const { type: type2, handler, once } = entries[i2];
58800
59131
  handler({
58801
59132
  ...event,
58802
59133
  // @ts-ignore
@@ -58804,7 +59135,7 @@ class EventRegistrar {
58804
59135
  stopPropagation,
58805
59136
  stopImmediatePropagation
58806
59137
  });
58807
- if (once3) {
59138
+ if (once) {
58808
59139
  entriesToRemove.push(entries[i2]);
58809
59140
  }
58810
59141
  if (immediatePropagationStopped) {
@@ -58985,11 +59316,11 @@ class EventManager {
58985
59316
  /**
58986
59317
  * Process the event registration for a single event + handler.
58987
59318
  */
58988
- _addEventHandler(event, handler, opts2, once3, passive) {
59319
+ _addEventHandler(event, handler, opts2, once, passive) {
58989
59320
  if (typeof event !== "string") {
58990
59321
  opts2 = handler;
58991
59322
  for (const eventName in event) {
58992
- this._addEventHandler(eventName, event[eventName], opts2, once3, passive);
59323
+ this._addEventHandler(eventName, event[eventName], opts2, once, passive);
58993
59324
  }
58994
59325
  return;
58995
59326
  }
@@ -59004,7 +59335,7 @@ class EventManager {
59004
59335
  manager.on(eventAlias, eventRegistrar.handleEvent);
59005
59336
  }
59006
59337
  }
59007
- eventRegistrar.add(event, handler, opts2, once3, passive);
59338
+ eventRegistrar.add(event, handler, opts2, once, passive);
59008
59339
  if (!eventRegistrar.isEmpty()) {
59009
59340
  this._toggleRecognizer(eventRegistrar.recognizerName, true);
59010
59341
  }
@@ -59330,11 +59661,11 @@ class Deck {
59330
59661
  return this.viewManager !== null;
59331
59662
  }
59332
59663
  getViews() {
59333
- assert$5(this.viewManager);
59664
+ assert$7(this.viewManager);
59334
59665
  return this.viewManager.views;
59335
59666
  }
59336
59667
  getViewports(rect) {
59337
- assert$5(this.viewManager);
59668
+ assert$7(this.viewManager);
59338
59669
  return this.viewManager.getViewports(rect);
59339
59670
  }
59340
59671
  pickObject(opts2) {
@@ -59363,7 +59694,7 @@ class Deck {
59363
59694
  }
59364
59695
  }
59365
59696
  _pick(method, statKey, opts2) {
59366
- assert$5(this.deckPicker);
59697
+ assert$7(this.deckPicker);
59367
59698
  const {
59368
59699
  stats
59369
59700
  } = this;
@@ -59384,7 +59715,7 @@ class Deck {
59384
59715
  let canvas = props.canvas;
59385
59716
  if (typeof canvas === "string") {
59386
59717
  canvas = document.getElementById(canvas);
59387
- assert$5(canvas);
59718
+ assert$7(canvas);
59388
59719
  }
59389
59720
  if (!canvas) {
59390
59721
  canvas = document.createElement("canvas");
@@ -60623,7 +60954,7 @@ class Attribute extends DataColumn {
60623
60954
  };
60624
60955
  }
60625
60956
  const binaryValue = buffer2;
60626
- assert$5(ArrayBuffer.isView(binaryValue.value), "invalid ".concat(settings.accessor));
60957
+ assert$7(ArrayBuffer.isView(binaryValue.value), "invalid ".concat(settings.accessor));
60627
60958
  const needsNormalize = Boolean(binaryValue.size) && binaryValue.size !== this.size;
60628
60959
  state.binaryAccessor = getAccessorFromBuffer(binaryValue.value, {
60629
60960
  size: binaryValue.size || this.size,
@@ -60677,7 +61008,7 @@ class Attribute extends DataColumn {
60677
61008
  transform: transform2
60678
61009
  } = settings;
60679
61010
  const accessorFunc = state.binaryAccessor || (typeof accessor === "function" ? accessor : props[accessor]);
60680
- assert$5(typeof accessorFunc === "function", 'accessor "'.concat(accessor, '" is not a function'));
61011
+ assert$7(typeof accessorFunc === "function", 'accessor "'.concat(accessor, '" is not a function'));
60681
61012
  let i2 = attribute.getVertexOffset(startRow);
60682
61013
  const {
60683
61014
  iterable,
@@ -61725,7 +62056,7 @@ function getPropTypes(props) {
61725
62056
  const ERR_NOT_OBJECT = "count(): argument not an object";
61726
62057
  const ERR_NOT_CONTAINER = "count(): argument not a container";
61727
62058
  function count(container) {
61728
- if (!isObject$1(container)) {
62059
+ if (!isObject$2(container)) {
61729
62060
  throw new Error(ERR_NOT_OBJECT);
61730
62061
  }
61731
62062
  if (typeof container.count === "function") {
@@ -61745,7 +62076,7 @@ function count(container) {
61745
62076
  function isPlainObject(value) {
61746
62077
  return value !== null && typeof value === "object" && value.constructor === Object;
61747
62078
  }
61748
- function isObject$1(value) {
62079
+ function isObject$2(value) {
61749
62080
  return value !== null && typeof value === "object";
61750
62081
  }
61751
62082
  function mergeShaders(target, source) {
@@ -62629,7 +62960,7 @@ class Layer extends Component {
62629
62960
  return "".concat(className, "({id: '").concat(this.props.id, "'})");
62630
62961
  }
62631
62962
  project(xyz) {
62632
- assert$5(this.internalState);
62963
+ assert$7(this.internalState);
62633
62964
  const viewport = this.internalState.viewport || this.context.viewport;
62634
62965
  const worldPosition = getWorldPosition(xyz, {
62635
62966
  viewport,
@@ -62641,12 +62972,12 @@ class Layer extends Component {
62641
62972
  return xyz.length === 2 ? [x2, y2] : [x2, y2, z2];
62642
62973
  }
62643
62974
  unproject(xy) {
62644
- assert$5(this.internalState);
62975
+ assert$7(this.internalState);
62645
62976
  const viewport = this.internalState.viewport || this.context.viewport;
62646
62977
  return viewport.unproject(xy);
62647
62978
  }
62648
62979
  projectPosition(xyz, params) {
62649
- assert$5(this.internalState);
62980
+ assert$7(this.internalState);
62650
62981
  const viewport = this.internalState.viewport || this.context.viewport;
62651
62982
  return projectPosition(xyz, {
62652
62983
  viewport,
@@ -62731,7 +63062,7 @@ class Layer extends Component {
62731
63062
  return target;
62732
63063
  }
62733
63064
  decodePickingColor(color) {
62734
- assert$5(color instanceof Uint8Array);
63065
+ assert$7(color instanceof Uint8Array);
62735
63066
  const [i1, i2, i3] = color;
62736
63067
  const index2 = i1 + i2 * 256 + i3 * 65536 - 1;
62737
63068
  return index2;
@@ -63027,8 +63358,8 @@ class Layer extends Component {
63027
63358
  });
63028
63359
  }
63029
63360
  _initialize() {
63030
- assert$5(!this.internalState);
63031
- assert$5(Number.isFinite(this.props.coordinateSystem));
63361
+ assert$7(!this.internalState);
63362
+ assert$7(Number.isFinite(this.props.coordinateSystem));
63032
63363
  debug(TRACE_INITIALIZE, this);
63033
63364
  const attributeManager = this._getAttributeManager();
63034
63365
  if (attributeManager) {
@@ -64163,7 +64494,7 @@ class Tesselator {
64163
64494
  this.buffers = buffers;
64164
64495
  this.normalize = normalize2;
64165
64496
  if (geometryBuffer) {
64166
- assert$5(data.startIndices);
64497
+ assert$7(data.startIndices);
64167
64498
  this.getGeometry = this.getGeometryFromBuffer(geometryBuffer);
64168
64499
  if (!normalize2) {
64169
64500
  buffers.positions = geometryBuffer;
@@ -64344,7 +64675,7 @@ const esm$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
64344
64675
  _flatten: flatten,
64345
64676
  _memoize: memoize$1,
64346
64677
  _mergeShaders: mergeShaders,
64347
- assert: assert$5,
64678
+ assert: assert$7,
64348
64679
  createIterable,
64349
64680
  fp64LowPart,
64350
64681
  gouraudLighting,
@@ -72267,7 +72598,7 @@ class Plane {
72267
72598
  this.fromNormalDistance(normal, distance2);
72268
72599
  }
72269
72600
  fromNormalDistance(normal, distance2) {
72270
- assert$d(Number.isFinite(distance2));
72601
+ assert$f(Number.isFinite(distance2));
72271
72602
  this.normal.from(normal).normalize();
72272
72603
  this.distance = distance2;
72273
72604
  return this;
@@ -72281,7 +72612,7 @@ class Plane {
72281
72612
  }
72282
72613
  fromCoefficients(a2, b, c, d) {
72283
72614
  this.normal.set(a2, b, c);
72284
- assert$d(equals$3(this.normal.len(), 1));
72615
+ assert$f(equals$3(this.normal.len(), 1));
72285
72616
  this.distance = d;
72286
72617
  return this;
72287
72618
  }
@@ -72355,7 +72686,7 @@ class CullingVolume {
72355
72686
  return intersect2;
72356
72687
  }
72357
72688
  computeVisibilityWithPlaneMask(boundingVolume, parentPlaneMask) {
72358
- assert$d(Number.isFinite(parentPlaneMask), "parentPlaneMask is required.");
72689
+ assert$f(Number.isFinite(parentPlaneMask), "parentPlaneMask is required.");
72359
72690
  if (parentPlaneMask === CullingVolume.MASK_OUTSIDE || parentPlaneMask === CullingVolume.MASK_INSIDE) {
72360
72691
  return parentPlaneMask;
72361
72692
  }
@@ -85847,17 +86178,17 @@ class ScenegraphNode {
85847
86178
  return null;
85848
86179
  }
85849
86180
  setPosition(position) {
85850
- assert$8(position.length === 3, "setPosition requires vector argument");
86181
+ assert$a(position.length === 3, "setPosition requires vector argument");
85851
86182
  this.position = position;
85852
86183
  return this;
85853
86184
  }
85854
86185
  setRotation(rotation2) {
85855
- assert$8(rotation2.length === 3, "setRotation requires vector argument");
86186
+ assert$a(rotation2.length === 3, "setRotation requires vector argument");
85856
86187
  this.rotation = rotation2;
85857
86188
  return this;
85858
86189
  }
85859
86190
  setScale(scale2) {
85860
- assert$8(scale2.length === 3, "setScale requires vector argument");
86191
+ assert$a(scale2.length === 3, "setScale requires vector argument");
85861
86192
  this.scale = scale2;
85862
86193
  return this;
85863
86194
  }
@@ -85920,7 +86251,7 @@ class ScenegraphNode {
85920
86251
  return this;
85921
86252
  }
85922
86253
  getCoordinateUniforms(viewMatrix2, modelMatrix2) {
85923
- assert$8(viewMatrix2);
86254
+ assert$a(viewMatrix2);
85924
86255
  modelMatrix2 = modelMatrix2 || this.matrix;
85925
86256
  const worldMatrix = new Matrix4(viewMatrix2).multiplyRight(modelMatrix2);
85926
86257
  const worldInverse = worldMatrix.invert();
@@ -86157,7 +86488,7 @@ function interpolate$1(time, _ref2, target, path) {
86157
86488
  log$2.warn("Bad animation path ".concat(path))();
86158
86489
  }
86159
86490
  }
86160
- assert$8(target[path].length === output[previousIndex].length);
86491
+ assert$a(target[path].length === output[previousIndex].length);
86161
86492
  const previousTime = input[previousIndex];
86162
86493
  const nextTime = input[nextIndex];
86163
86494
  switch (interpolation) {
@@ -87090,7 +87421,7 @@ const BasisLoader = {
87090
87421
  ...BasisWorkerLoader,
87091
87422
  parse: parseBasis
87092
87423
  };
87093
- function assert$4(condition, message) {
87424
+ function assert$6(condition, message) {
87094
87425
  if (!condition) {
87095
87426
  throw new Error(message || "assert failed: gltf");
87096
87427
  }
@@ -87108,10 +87439,10 @@ function resolveUrl(url, options) {
87108
87439
  }
87109
87440
  function getTypedArrayForBufferView(json, buffers, bufferViewIndex) {
87110
87441
  const bufferView = json.bufferViews[bufferViewIndex];
87111
- assert$4(bufferView);
87442
+ assert$6(bufferView);
87112
87443
  const bufferIndex = bufferView.buffer;
87113
87444
  const binChunk = buffers[bufferIndex];
87114
- assert$4(binChunk);
87445
+ assert$6(binChunk);
87115
87446
  const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
87116
87447
  return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
87117
87448
  }
@@ -87160,7 +87491,7 @@ function getAccessorArrayTypeAndLength(accessor, bufferView) {
87160
87491
  const bytesPerComponent = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE[accessor.componentType];
87161
87492
  const length2 = accessor.count * components;
87162
87493
  const byteLength = accessor.count * components * bytesPerComponent;
87163
- assert$4(byteLength >= 0 && byteLength <= bufferView.byteLength);
87494
+ assert$6(byteLength >= 0 && byteLength <= bufferView.byteLength);
87164
87495
  return {
87165
87496
  ArrayType,
87166
87497
  length: length2,
@@ -87269,7 +87600,7 @@ class GLTFScenegraph {
87269
87600
  bufferView = this.getBufferView(bufferView);
87270
87601
  const bufferIndex = bufferView.buffer;
87271
87602
  const binChunk = this.gltf.buffers[bufferIndex];
87272
- assert$4(binChunk);
87603
+ assert$6(binChunk);
87273
87604
  const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
87274
87605
  return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
87275
87606
  }
@@ -87319,14 +87650,14 @@ class GLTFScenegraph {
87319
87650
  return extension;
87320
87651
  }
87321
87652
  addExtension(extensionName, extensionData = {}) {
87322
- assert$4(extensionData);
87653
+ assert$6(extensionData);
87323
87654
  this.json.extensions = this.json.extensions || {};
87324
87655
  this.json.extensions[extensionName] = extensionData;
87325
87656
  this.registerUsedExtension(extensionName);
87326
87657
  return extensionData;
87327
87658
  }
87328
87659
  addRequiredExtension(extensionName, extensionData = {}) {
87329
- assert$4(extensionData);
87660
+ assert$6(extensionData);
87330
87661
  this.addExtension(extensionName, extensionData);
87331
87662
  this.registerRequiredExtension(extensionName);
87332
87663
  return extensionData;
@@ -87434,7 +87765,7 @@ class GLTFScenegraph {
87434
87765
  }
87435
87766
  addBufferView(buffer2) {
87436
87767
  const byteLength = buffer2.byteLength;
87437
- assert$4(Number.isFinite(byteLength));
87768
+ assert$6(Number.isFinite(byteLength));
87438
87769
  this.sourceBuffers = this.sourceBuffers || [];
87439
87770
  this.sourceBuffers.push(buffer2);
87440
87771
  const glTFBufferView = {
@@ -87789,7 +88120,7 @@ function getMeshBoundingBox(attributes) {
87789
88120
  }
87790
88121
  return [[minX, minY, minZ], [maxX, maxY, maxZ]];
87791
88122
  }
87792
- function assert$3(condition, message) {
88123
+ function assert$5(condition, message) {
87793
88124
  if (!condition) {
87794
88125
  throw new Error(message || "loader assertion failed.");
87795
88126
  }
@@ -87798,7 +88129,7 @@ class Schema {
87798
88129
  constructor(fields, metadata) {
87799
88130
  _defineProperty$e(this, "fields", void 0);
87800
88131
  _defineProperty$e(this, "metadata", void 0);
87801
- assert$3(Array.isArray(fields));
88132
+ assert$5(Array.isArray(fields));
87802
88133
  checkNames(fields);
87803
88134
  this.fields = fields;
87804
88135
  this.metadata = metadata || /* @__PURE__ */ new Map();
@@ -88788,7 +89119,7 @@ async function encode$2(gltfData) {
88788
89119
  } = gltfScenegraph;
88789
89120
  if (json.lights) {
88790
89121
  const extension = gltfScenegraph.addExtension(KHR_LIGHTS_PUNCTUAL);
88791
- assert$4(!extension.lights);
89122
+ assert$6(!extension.lights);
88792
89123
  extension.lights = json.lights;
88793
89124
  delete json.lights;
88794
89125
  }
@@ -89206,7 +89537,7 @@ class GLTFPostProcessor {
89206
89537
  images = [],
89207
89538
  baseUri = ""
89208
89539
  } = gltf;
89209
- assert$4(json);
89540
+ assert$6(json);
89210
89541
  this.baseUri = baseUri;
89211
89542
  this.json = json;
89212
89543
  this.buffers = buffers;
@@ -89532,18 +89863,18 @@ function parseGLBSync(glb, arrayBuffer2, byteOffset = 0, options = {}) {
89532
89863
  }
89533
89864
  }
89534
89865
  function parseGLBV1(glb, dataView, byteOffset) {
89535
- assert$c(glb.header.byteLength > GLB_FILE_HEADER_SIZE + GLB_CHUNK_HEADER_SIZE);
89866
+ assert$e(glb.header.byteLength > GLB_FILE_HEADER_SIZE + GLB_CHUNK_HEADER_SIZE);
89536
89867
  const contentLength = dataView.getUint32(byteOffset + 0, LE);
89537
89868
  const contentFormat = dataView.getUint32(byteOffset + 4, LE);
89538
89869
  byteOffset += GLB_CHUNK_HEADER_SIZE;
89539
- assert$c(contentFormat === GLB_V1_CONTENT_FORMAT_JSON);
89870
+ assert$e(contentFormat === GLB_V1_CONTENT_FORMAT_JSON);
89540
89871
  parseJSONChunk(glb, dataView, byteOffset, contentLength);
89541
89872
  byteOffset += contentLength;
89542
89873
  byteOffset += parseBINChunk(glb, dataView, byteOffset, glb.header.byteLength);
89543
89874
  return byteOffset;
89544
89875
  }
89545
89876
  function parseGLBV2(glb, dataView, byteOffset, options) {
89546
- assert$c(glb.header.byteLength > GLB_FILE_HEADER_SIZE + GLB_CHUNK_HEADER_SIZE);
89877
+ assert$e(glb.header.byteLength > GLB_FILE_HEADER_SIZE + GLB_CHUNK_HEADER_SIZE);
89547
89878
  parseGLBChunksSync(glb, dataView, byteOffset, options);
89548
89879
  return byteOffset + glb.header.byteLength;
89549
89880
  }
@@ -89623,11 +89954,11 @@ function parseGLTFContainerSync(gltf, data, byteOffset, options) {
89623
89954
  } else if (data instanceof ArrayBuffer) {
89624
89955
  const glb = {};
89625
89956
  byteOffset = parseGLBSync(glb, data, byteOffset, options.glb);
89626
- assert$4(glb.type === "glTF", "Invalid GLB magic string ".concat(glb.type));
89957
+ assert$6(glb.type === "glTF", "Invalid GLB magic string ".concat(glb.type));
89627
89958
  gltf._glb = glb;
89628
89959
  gltf.json = glb.json;
89629
89960
  } else {
89630
- assert$4(false, "GLTF: must be ArrayBuffer or string");
89961
+ assert$6(false, "GLTF: must be ArrayBuffer or string");
89631
89962
  }
89632
89963
  const buffers = gltf.json.buffers || [];
89633
89964
  gltf.buffers = new Array(buffers.length).fill(null);
@@ -89653,7 +89984,7 @@ async function loadBuffers(gltf, options, context) {
89653
89984
  const {
89654
89985
  fetch: fetch2
89655
89986
  } = context;
89656
- assert$4(fetch2);
89987
+ assert$6(fetch2);
89657
89988
  const uri2 = resolveUrl(buffer2.uri, options);
89658
89989
  const response = await (context === null || context === void 0 ? void 0 : (_context$fetch = context.fetch) === null || _context$fetch === void 0 ? void 0 : _context$fetch.call(context, uri2));
89659
89990
  const arrayBuffer2 = await (response === null || response === void 0 ? void 0 : (_response$arrayBuffer = response.arrayBuffer) === null || _response$arrayBuffer === void 0 ? void 0 : _response$arrayBuffer.call(response));
@@ -89706,7 +90037,7 @@ async function loadImage(gltf, image2, index2, options, context) {
89706
90037
  const array = getTypedArrayForBufferView(gltf.json, gltf.buffers, image2.bufferView);
89707
90038
  arrayBuffer2 = sliceArrayBuffer(array.buffer, array.byteOffset, array.byteLength);
89708
90039
  }
89709
- assert$4(arrayBuffer2, "glTF image has no data");
90040
+ assert$6(arrayBuffer2, "glTF image has no data");
89710
90041
  let parsedImage = await parse2(arrayBuffer2, [ImageLoader, BasisLoader], {
89711
90042
  mimeType: image2.mimeType,
89712
90043
  basis: options.basis || {
@@ -90393,7 +90724,7 @@ const scratchVector2 = new Vector3();
90393
90724
  const scratchVector3 = new Vector3();
90394
90725
  function localFrameToFixedFrame(ellipsoid, firstAxis, secondAxis, thirdAxis, cartesianOrigin, result) {
90395
90726
  const thirdAxisInferred = VECTOR_PRODUCT_LOCAL_FRAME[firstAxis] && VECTOR_PRODUCT_LOCAL_FRAME[firstAxis][secondAxis];
90396
- assert$d(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
90727
+ assert$f(thirdAxisInferred && (!thirdAxis || thirdAxis === thirdAxisInferred));
90397
90728
  let firstAxisVector;
90398
90729
  let secondAxisVector;
90399
90730
  let thirdAxisVector;
@@ -90469,9 +90800,9 @@ class Ellipsoid {
90469
90800
  _defineProperty$e(this, "maximumRadius", void 0);
90470
90801
  _defineProperty$e(this, "centerToleranceSquared", _MathUtils.EPSILON1);
90471
90802
  _defineProperty$e(this, "squaredXOverSquaredZ", void 0);
90472
- assert$d(x2 >= 0);
90473
- assert$d(y2 >= 0);
90474
- assert$d(z2 >= 0);
90803
+ assert$f(x2 >= 0);
90804
+ assert$f(y2 >= 0);
90805
+ assert$f(z2 >= 0);
90475
90806
  this.radii = new Vector3(x2, y2, z2);
90476
90807
  this.radiiSquared = new Vector3(x2 * x2, y2 * y2, z2 * z2);
90477
90808
  this.radiiToTheFourth = new Vector3(x2 * x2 * x2 * x2, y2 * y2 * y2 * y2, z2 * z2 * z2 * z2);
@@ -90555,8 +90886,8 @@ class Ellipsoid {
90555
90886
  return scratchPosition$1.from(position).scale(this.radii).to(result);
90556
90887
  }
90557
90888
  getSurfaceNormalIntersectionWithZAxis(position, buffer2 = 0, result = [0, 0, 0]) {
90558
- assert$d(equals$3(this.radii.x, this.radii.y, _MathUtils.EPSILON15));
90559
- assert$d(this.radii.z > 0);
90889
+ assert$f(equals$3(this.radii.x, this.radii.y, _MathUtils.EPSILON15));
90890
+ assert$f(this.radii.z > 0);
90560
90891
  scratchPosition$1.from(position);
90561
90892
  const z2 = scratchPosition$1.z * (1 - this.squaredXOverSquaredZ);
90562
90893
  if (Math.abs(z2) >= this.radii.z - buffer2) {
@@ -90696,8 +91027,8 @@ class TilesetCache {
90696
91027
  }
90697
91028
  }
90698
91029
  function calculateTransformProps(tileHeader, tile) {
90699
- assert$c(tileHeader);
90700
- assert$c(tile);
91030
+ assert$e(tileHeader);
91031
+ assert$e(tile);
90701
91032
  const {
90702
91033
  rtcCenter,
90703
91034
  gltfUpAxis
@@ -90931,7 +91262,7 @@ const scratchScale = new Vector3();
90931
91262
  const scratchNorthWest = new Vector3();
90932
91263
  const scratchSouthEast = new Vector3();
90933
91264
  function createBoundingVolume(boundingVolumeHeader, transform2, result) {
90934
- assert$c(boundingVolumeHeader, "3D Tile: boundingVolume must be defined");
91265
+ assert$e(boundingVolumeHeader, "3D Tile: boundingVolume must be defined");
90935
91266
  if (boundingVolumeHeader.box) {
90936
91267
  return createBox(boundingVolumeHeader.box, transform2, result);
90937
91268
  }
@@ -91107,11 +91438,11 @@ class ManagedArray {
91107
91438
  return this._array;
91108
91439
  }
91109
91440
  get(index2) {
91110
- assert$c(index2 < this._array.length);
91441
+ assert$e(index2 < this._array.length);
91111
91442
  return this._array[index2];
91112
91443
  }
91113
91444
  set(index2, element) {
91114
- assert$c(index2 >= 0);
91445
+ assert$e(index2 >= 0);
91115
91446
  if (index2 >= this.length) {
91116
91447
  this.length = index2 + 1;
91117
91448
  }
@@ -91145,13 +91476,13 @@ class ManagedArray {
91145
91476
  return element;
91146
91477
  }
91147
91478
  reserve(length2) {
91148
- assert$c(length2 >= 0);
91479
+ assert$e(length2 >= 0);
91149
91480
  if (length2 > this._array.length) {
91150
91481
  this._array.length = length2;
91151
91482
  }
91152
91483
  }
91153
91484
  resize(length2) {
91154
- assert$c(length2 >= 0);
91485
+ assert$e(length2 >= 0);
91155
91486
  this.length = length2;
91156
91487
  }
91157
91488
  trim(length2) {
@@ -92099,7 +92430,7 @@ class Tileset3D {
92099
92430
  _defineProperty$e(this, "_emptyTiles", void 0);
92100
92431
  _defineProperty$e(this, "frameStateData", void 0);
92101
92432
  _defineProperty$e(this, "maximumMemoryUsage", void 0);
92102
- assert$c(json);
92433
+ assert$e(json);
92103
92434
  this.options = {
92104
92435
  ...DEFAULT_PROPS,
92105
92436
  ...options
@@ -92390,7 +92721,7 @@ class Tileset3D {
92390
92721
  }
92391
92722
  calculateViewPropsTiles3D() {
92392
92723
  const root2 = this.root;
92393
- assert$c(root2);
92724
+ assert$e(root2);
92394
92725
  const {
92395
92726
  center: center2
92396
92727
  } = root2.boundingVolume;
@@ -92609,7 +92940,7 @@ const TILE3D_TYPE = {
92609
92940
  GLTF: "glTF"
92610
92941
  };
92611
92942
  function getStringFromArrayBuffer(arrayBuffer2, byteOffset, byteLength) {
92612
- assert$c(arrayBuffer2 instanceof ArrayBuffer);
92943
+ assert$e(arrayBuffer2 instanceof ArrayBuffer);
92613
92944
  const textDecoder = new TextDecoder("utf8");
92614
92945
  const typedArray = new Uint8Array(arrayBuffer2, byteOffset, byteLength);
92615
92946
  const string = textDecoder.decode(typedArray);
@@ -92710,7 +93041,7 @@ class GLType {
92710
93041
  return new ArrayType(buffer2, byteOffset, length2);
92711
93042
  }
92712
93043
  }
92713
- function assert$2(condition, message) {
93044
+ function assert$4(condition, message) {
92714
93045
  if (!condition) {
92715
93046
  throw new Error("math.gl assertion failed. ".concat(message));
92716
93047
  }
@@ -92735,7 +93066,7 @@ function signNotZero(value) {
92735
93066
  return value < 0 ? -1 : 1;
92736
93067
  }
92737
93068
  function octDecodeInRange(x2, y2, rangeMax, result) {
92738
- assert$2(result);
93069
+ assert$4(result);
92739
93070
  if (x2 < 0 || x2 > rangeMax || y2 < 0 || y2 > rangeMax) {
92740
93071
  throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(rangeMax));
92741
93072
  }
@@ -92895,7 +93226,7 @@ function createTypedArrayFromAccessor(tile3DAccessor, buffer2, byteOffset, lengt
92895
93226
  const {
92896
93227
  componentType
92897
93228
  } = tile3DAccessor;
92898
- assert$c(tile3DAccessor.componentType);
93229
+ assert$e(tile3DAccessor.componentType);
92899
93230
  const type2 = typeof componentType === "string" ? GLType.fromName(componentType) : componentType;
92900
93231
  const size2 = COMPONENTS_PER_ATTRIBUTE[tile3DAccessor.type];
92901
93232
  const unpacker = UNPACKER[tile3DAccessor.type];
@@ -93098,7 +93429,7 @@ class Tile3DBatchTableParser {
93098
93429
  _defineProperty$e(this, "_properties", void 0);
93099
93430
  _defineProperty$e(this, "_binaryProperties", void 0);
93100
93431
  _defineProperty$e(this, "_hierarchy", void 0);
93101
- assert$c(featureCount >= 0);
93432
+ assert$e(featureCount >= 0);
93102
93433
  this.json = json || {};
93103
93434
  this.binary = binary;
93104
93435
  this.featureCount = featureCount;
@@ -93122,7 +93453,7 @@ class Tile3DBatchTableParser {
93122
93453
  }
93123
93454
  isClass(batchId, className) {
93124
93455
  this._checkBatchId(batchId);
93125
- assert$c(typeof className === "string", className);
93456
+ assert$e(typeof className === "string", className);
93126
93457
  if (this._hierarchy) {
93127
93458
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
93128
93459
  const classId = hierarchy.classIds[instanceIndex];
@@ -93134,7 +93465,7 @@ class Tile3DBatchTableParser {
93134
93465
  return false;
93135
93466
  }
93136
93467
  isExactClass(batchId, className) {
93137
- assert$c(typeof className === "string", className);
93468
+ assert$e(typeof className === "string", className);
93138
93469
  return this.getExactClassName(batchId) === className;
93139
93470
  }
93140
93471
  getExactClassName(batchId) {
@@ -93148,7 +93479,7 @@ class Tile3DBatchTableParser {
93148
93479
  }
93149
93480
  hasProperty(batchId, name2) {
93150
93481
  this._checkBatchId(batchId);
93151
- assert$c(typeof name2 === "string", name2);
93482
+ assert$e(typeof name2 === "string", name2);
93152
93483
  return defined(this._properties[name2]) || this._hasPropertyInHierarchy(batchId, name2);
93153
93484
  }
93154
93485
  getPropertyNames(batchId, results) {
@@ -93164,7 +93495,7 @@ class Tile3DBatchTableParser {
93164
93495
  }
93165
93496
  getProperty(batchId, name2) {
93166
93497
  this._checkBatchId(batchId);
93167
- assert$c(typeof name2 === "string", name2);
93498
+ assert$e(typeof name2 === "string", name2);
93168
93499
  if (this._binaryProperties) {
93169
93500
  const binaryProperty = this._binaryProperties[name2];
93170
93501
  if (defined(binaryProperty)) {
@@ -93186,7 +93517,7 @@ class Tile3DBatchTableParser {
93186
93517
  setProperty(batchId, name2, value) {
93187
93518
  const featureCount = this.featureCount;
93188
93519
  this._checkBatchId(batchId);
93189
- assert$c(typeof name2 === "string", name2);
93520
+ assert$e(typeof name2 === "string", name2);
93190
93521
  if (this._binaryProperties) {
93191
93522
  const binaryProperty = this._binaryProperties[name2];
93192
93523
  if (binaryProperty) {
@@ -93233,8 +93564,8 @@ class Tile3DBatchTableParser {
93233
93564
  _initializeBinaryProperty(name2, property) {
93234
93565
  if ("byteOffset" in property) {
93235
93566
  const tile3DAccessor = property;
93236
- assert$c(this.binary, "Property ".concat(name2, " requires a batch table binary."));
93237
- assert$c(tile3DAccessor.type, "Property ".concat(name2, " requires a type."));
93567
+ assert$e(this.binary, "Property ".concat(name2, " requires a batch table binary."));
93568
+ assert$e(tile3DAccessor.type, "Property ".concat(name2, " requires a type."));
93238
93569
  const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
93239
93570
  return {
93240
93571
  typedArray: accessor.values,
@@ -93291,7 +93622,7 @@ class Tile3DBatchTableParser {
93291
93622
  const indexInClass = hierarchy.classIndexes[instanceIndex];
93292
93623
  const propertyValues = instanceClass.instances[name2];
93293
93624
  if (defined(propertyValues)) {
93294
- assert$c(instanceIndex === batchId, 'Inherited property "'.concat(name2, '" is read-only.'));
93625
+ assert$e(instanceIndex === batchId, 'Inherited property "'.concat(name2, '" is read-only.'));
93295
93626
  if (defined(propertyValues.typedArray)) {
93296
93627
  this._setBinaryProperty(propertyValues, indexInClass, value);
93297
93628
  } else {
@@ -98381,7 +98712,7 @@ function getCoords$1(coords) {
98381
98712
  throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array");
98382
98713
  }
98383
98714
  function containsNumber$1(coordinates2) {
98384
- if (coordinates2.length > 1 && isNumber$1(coordinates2[0]) && isNumber$1(coordinates2[1])) {
98715
+ if (coordinates2.length > 1 && isNumber$2(coordinates2[0]) && isNumber$2(coordinates2[1])) {
98385
98716
  return true;
98386
98717
  }
98387
98718
  if (Array.isArray(coordinates2[0]) && coordinates2[0].length) {
@@ -101204,7 +101535,7 @@ var hasSymbols2 = typeof Symbol === "function" && typeof Symbol("foo") === "symb
101204
101535
  var toStr$1 = Object.prototype.toString;
101205
101536
  var concat = Array.prototype.concat;
101206
101537
  var defineDataProperty2 = defineDataProperty$1;
101207
- var isFunction = function(fn) {
101538
+ var isFunction$1 = function(fn) {
101208
101539
  return typeof fn === "function" && toStr$1.call(fn) === "[object Function]";
101209
101540
  };
101210
101541
  var supportsDescriptors$2 = hasPropertyDescriptors_1();
@@ -101214,7 +101545,7 @@ var defineProperty$1 = function(object2, name2, value, predicate) {
101214
101545
  if (object2[name2] === value) {
101215
101546
  return;
101216
101547
  }
101217
- } else if (!isFunction(predicate) || !predicate()) {
101548
+ } else if (!isFunction$1(predicate) || !predicate()) {
101218
101549
  return;
101219
101550
  }
101220
101551
  }
@@ -101598,7 +101929,7 @@ function lineOverlap(line1, line2, options) {
101598
101929
  options = {};
101599
101930
  }
101600
101931
  options = options || {};
101601
- if (!isObject$4(options))
101932
+ if (!isObject$5(options))
101602
101933
  throw new Error("options is invalid");
101603
101934
  var tolerance = options.tolerance || 0;
101604
101935
  var features = [];
@@ -102158,19 +102489,19 @@ var jsts_min = { exports: {} };
102158
102489
  }, Object.defineProperties(w2, O);
102159
102490
  var T = function(t3, e3) {
102160
102491
  return t3.interfaces_ && t3.interfaces_().indexOf(e3) > -1;
102161
- }, R2 = function() {
102492
+ }, R = function() {
102162
102493
  }, P2 = { LOG_10: { configurable: true } };
102163
- R2.prototype.interfaces_ = function() {
102494
+ R.prototype.interfaces_ = function() {
102164
102495
  return [];
102165
- }, R2.prototype.getClass = function() {
102166
- return R2;
102167
- }, R2.log10 = function(t3) {
102496
+ }, R.prototype.getClass = function() {
102497
+ return R;
102498
+ }, R.log10 = function(t3) {
102168
102499
  var e3 = Math.log(t3);
102169
- return v.isInfinite(e3) ? e3 : v.isNaN(e3) ? e3 : e3 / R2.LOG_10;
102170
- }, R2.min = function(t3, e3, n4, i3) {
102500
+ return v.isInfinite(e3) ? e3 : v.isNaN(e3) ? e3 : e3 / R.LOG_10;
102501
+ }, R.min = function(t3, e3, n4, i3) {
102171
102502
  var r3 = t3;
102172
102503
  return e3 < r3 && (r3 = e3), n4 < r3 && (r3 = n4), i3 < r3 && (r3 = i3), r3;
102173
- }, R2.clamp = function() {
102504
+ }, R.clamp = function() {
102174
102505
  if ("number" == typeof arguments[2] && "number" == typeof arguments[0] && "number" == typeof arguments[1]) {
102175
102506
  var t3 = arguments[0], e3 = arguments[1], n4 = arguments[2];
102176
102507
  return t3 < e3 ? e3 : t3 > n4 ? n4 : t3;
@@ -102179,9 +102510,9 @@ var jsts_min = { exports: {} };
102179
102510
  var i3 = arguments[0], r3 = arguments[1], o3 = arguments[2];
102180
102511
  return i3 < r3 ? r3 : i3 > o3 ? o3 : i3;
102181
102512
  }
102182
- }, R2.wrap = function(t3, e3) {
102513
+ }, R.wrap = function(t3, e3) {
102183
102514
  return t3 < 0 ? e3 - -t3 % e3 : t3 % e3;
102184
- }, R2.max = function() {
102515
+ }, R.max = function() {
102185
102516
  if (3 === arguments.length) {
102186
102517
  var t3 = arguments[0], e3 = arguments[1], n4 = arguments[2], i3 = t3;
102187
102518
  return e3 > i3 && (i3 = e3), n4 > i3 && (i3 = n4), i3;
@@ -102190,11 +102521,11 @@ var jsts_min = { exports: {} };
102190
102521
  var r3 = arguments[0], o3 = arguments[1], s3 = arguments[2], a3 = arguments[3], u2 = r3;
102191
102522
  return o3 > u2 && (u2 = o3), s3 > u2 && (u2 = s3), a3 > u2 && (u2 = a3), u2;
102192
102523
  }
102193
- }, R2.average = function(t3, e3) {
102524
+ }, R.average = function(t3, e3) {
102194
102525
  return (t3 + e3) / 2;
102195
102526
  }, P2.LOG_10.get = function() {
102196
102527
  return Math.log(10);
102197
- }, Object.defineProperties(R2, P2);
102528
+ }, Object.defineProperties(R, P2);
102198
102529
  var D2 = function(t3) {
102199
102530
  this.str = t3;
102200
102531
  };
@@ -103349,7 +103680,7 @@ var jsts_min = { exports: {} };
103349
103680
  }
103350
103681
  } else
103351
103682
  r3 = true;
103352
- return r3 ? R2.min(at.distancePointLine(t3, n4, i3), at.distancePointLine(e3, n4, i3), at.distancePointLine(n4, t3, e3), at.distancePointLine(i3, t3, e3)) : 0;
103683
+ return r3 ? R.min(at.distancePointLine(t3, n4, i3), at.distancePointLine(e3, n4, i3), at.distancePointLine(n4, t3, e3), at.distancePointLine(i3, t3, e3)) : 0;
103353
103684
  }, at.isPointInRing = function(t3, e3) {
103354
103685
  return at.locatePointInRing(t3, e3) !== w2.EXTERIOR;
103355
103686
  }, at.computeLength = function(t3) {
@@ -103939,8 +104270,8 @@ var jsts_min = { exports: {} };
103939
104270
  (null === e3 || e3.compareTo(t3[n4]) > 0) && (e3 = t3[n4]);
103940
104271
  return e3;
103941
104272
  }, Lt.extract = function(t3, e3, n4) {
103942
- e3 = R2.clamp(e3, 0, t3.length);
103943
- var i3 = (n4 = R2.clamp(n4, -1, t3.length)) - e3 + 1;
104273
+ e3 = R.clamp(e3, 0, t3.length);
104274
+ var i3 = (n4 = R.clamp(n4, -1, t3.length)) - e3 + 1;
103944
104275
  n4 < 0 && (i3 = 0), e3 >= t3.length && (i3 = 0), n4 < e3 && (i3 = 0);
103945
104276
  var r3 = new Array(i3).fill(null);
103946
104277
  if (0 === i3)
@@ -109685,7 +110016,7 @@ var jsts_min = { exports: {} };
109685
110016
  return f3.getResultGeometry(c2);
109686
110017
  }
109687
110018
  }, di.precisionScaleFactor = function(t3, e3, n4) {
109688
- var i3 = t3.getEnvelopeInternal(), r3 = R2.max(Math.abs(i3.getMaxX()), Math.abs(i3.getMaxY()), Math.abs(i3.getMinX()), Math.abs(i3.getMinY())) + 2 * (e3 > 0 ? e3 : 0), o3 = n4 - Math.trunc(Math.log(r3) / Math.log(10) + 1);
110019
+ var i3 = t3.getEnvelopeInternal(), r3 = R.max(Math.abs(i3.getMaxX()), Math.abs(i3.getMaxY()), Math.abs(i3.getMinX()), Math.abs(i3.getMinY())) + 2 * (e3 > 0 ? e3 : 0), o3 = n4 - Math.trunc(Math.log(r3) / Math.log(10) + 1);
109689
110020
  return Math.pow(10, o3);
109690
110021
  }, yi.CAP_ROUND.get = function() {
109691
110022
  return Cn.CAP_ROUND;
@@ -117076,372 +117407,216 @@ var layerMouseEvent = {};
117076
117407
  exports2["default"] = LayerMouseEvent;
117077
117408
  })(layerMouseEvent);
117078
117409
  var nebulaLayer = {};
117079
- var events = { exports: {} };
117080
- var R = typeof Reflect === "object" ? Reflect : null;
117081
- var ReflectApply$1 = R && typeof R.apply === "function" ? R.apply : function ReflectApply(target, receiver, args) {
117082
- return Function.prototype.apply.call(target, receiver, args);
117083
- };
117084
- var ReflectOwnKeys$1;
117085
- if (R && typeof R.ownKeys === "function") {
117086
- ReflectOwnKeys$1 = R.ownKeys;
117087
- } else if (Object.getOwnPropertySymbols) {
117088
- ReflectOwnKeys$1 = function ReflectOwnKeys2(target) {
117089
- return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
117090
- };
117091
- } else {
117092
- ReflectOwnKeys$1 = function ReflectOwnKeys2(target) {
117093
- return Object.getOwnPropertyNames(target);
117094
- };
117095
- }
117096
- function ProcessEmitWarning(warning) {
117097
- if (console && console.warn)
117098
- console.warn(warning);
117099
- }
117100
- var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
117101
- return value !== value;
117102
- };
117103
117410
  function EventEmitter() {
117104
- EventEmitter.init.call(this);
117411
+ this._events = this._events || {};
117412
+ this._maxListeners = this._maxListeners || void 0;
117105
117413
  }
117106
- events.exports = EventEmitter;
117107
- events.exports.once = once2;
117414
+ var events = EventEmitter;
117108
117415
  EventEmitter.EventEmitter = EventEmitter;
117109
117416
  EventEmitter.prototype._events = void 0;
117110
- EventEmitter.prototype._eventsCount = 0;
117111
117417
  EventEmitter.prototype._maxListeners = void 0;
117112
- var defaultMaxListeners = 10;
117113
- function checkListener(listener) {
117114
- if (typeof listener !== "function") {
117115
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
117116
- }
117117
- }
117118
- Object.defineProperty(EventEmitter, "defaultMaxListeners", {
117119
- enumerable: true,
117120
- get: function() {
117121
- return defaultMaxListeners;
117122
- },
117123
- set: function(arg) {
117124
- if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
117125
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
117126
- }
117127
- defaultMaxListeners = arg;
117128
- }
117129
- });
117130
- EventEmitter.init = function() {
117131
- if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
117132
- this._events = /* @__PURE__ */ Object.create(null);
117133
- this._eventsCount = 0;
117134
- }
117135
- this._maxListeners = this._maxListeners || void 0;
117136
- };
117137
- EventEmitter.prototype.setMaxListeners = function setMaxListeners(n3) {
117138
- if (typeof n3 !== "number" || n3 < 0 || NumberIsNaN(n3)) {
117139
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n3 + ".");
117140
- }
117418
+ EventEmitter.defaultMaxListeners = 10;
117419
+ EventEmitter.prototype.setMaxListeners = function(n3) {
117420
+ if (!isNumber(n3) || n3 < 0 || isNaN(n3))
117421
+ throw TypeError("n must be a positive number");
117141
117422
  this._maxListeners = n3;
117142
117423
  return this;
117143
117424
  };
117144
- function _getMaxListeners(that) {
117145
- if (that._maxListeners === void 0)
117146
- return EventEmitter.defaultMaxListeners;
117147
- return that._maxListeners;
117148
- }
117149
- EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
117150
- return _getMaxListeners(this);
117151
- };
117152
- EventEmitter.prototype.emit = function emit(type2) {
117153
- var args = [];
117154
- for (var i2 = 1; i2 < arguments.length; i2++)
117155
- args.push(arguments[i2]);
117156
- var doError = type2 === "error";
117157
- var events2 = this._events;
117158
- if (events2 !== void 0)
117159
- doError = doError && events2.error === void 0;
117160
- else if (!doError)
117161
- return false;
117162
- if (doError) {
117163
- var er;
117164
- if (args.length > 0)
117165
- er = args[0];
117166
- if (er instanceof Error) {
117167
- throw er;
117168
- }
117169
- var err2 = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
117170
- err2.context = er;
117171
- throw err2;
117172
- }
117173
- var handler = events2[type2];
117174
- if (handler === void 0)
117425
+ EventEmitter.prototype.emit = function(type2) {
117426
+ var er, handler, len2, args, i2, listeners;
117427
+ if (!this._events)
117428
+ this._events = {};
117429
+ if (type2 === "error") {
117430
+ if (!this._events.error || isObject$1(this._events.error) && !this._events.error.length) {
117431
+ er = arguments[1];
117432
+ if (er instanceof Error) {
117433
+ throw er;
117434
+ } else {
117435
+ var err2 = new Error('Uncaught, unspecified "error" event. (' + er + ")");
117436
+ err2.context = er;
117437
+ throw err2;
117438
+ }
117439
+ }
117440
+ }
117441
+ handler = this._events[type2];
117442
+ if (isUndefined(handler))
117175
117443
  return false;
117176
- if (typeof handler === "function") {
117177
- ReflectApply$1(handler, this, args);
117178
- } else {
117179
- var len2 = handler.length;
117180
- var listeners2 = arrayClone(handler, len2);
117181
- for (var i2 = 0; i2 < len2; ++i2)
117182
- ReflectApply$1(listeners2[i2], this, args);
117444
+ if (isFunction(handler)) {
117445
+ switch (arguments.length) {
117446
+ case 1:
117447
+ handler.call(this);
117448
+ break;
117449
+ case 2:
117450
+ handler.call(this, arguments[1]);
117451
+ break;
117452
+ case 3:
117453
+ handler.call(this, arguments[1], arguments[2]);
117454
+ break;
117455
+ default:
117456
+ args = Array.prototype.slice.call(arguments, 1);
117457
+ handler.apply(this, args);
117458
+ }
117459
+ } else if (isObject$1(handler)) {
117460
+ args = Array.prototype.slice.call(arguments, 1);
117461
+ listeners = handler.slice();
117462
+ len2 = listeners.length;
117463
+ for (i2 = 0; i2 < len2; i2++)
117464
+ listeners[i2].apply(this, args);
117183
117465
  }
117184
117466
  return true;
117185
117467
  };
117186
- function _addListener(target, type2, listener, prepend) {
117468
+ EventEmitter.prototype.addListener = function(type2, listener) {
117187
117469
  var m;
117188
- var events2;
117189
- var existing;
117190
- checkListener(listener);
117191
- events2 = target._events;
117192
- if (events2 === void 0) {
117193
- events2 = target._events = /* @__PURE__ */ Object.create(null);
117194
- target._eventsCount = 0;
117195
- } else {
117196
- if (events2.newListener !== void 0) {
117197
- target.emit(
117198
- "newListener",
117199
- type2,
117200
- listener.listener ? listener.listener : listener
117201
- );
117202
- events2 = target._events;
117203
- }
117204
- existing = events2[type2];
117205
- }
117206
- if (existing === void 0) {
117207
- existing = events2[type2] = listener;
117208
- ++target._eventsCount;
117209
- } else {
117210
- if (typeof existing === "function") {
117211
- existing = events2[type2] = prepend ? [listener, existing] : [existing, listener];
117212
- } else if (prepend) {
117213
- existing.unshift(listener);
117470
+ if (!isFunction(listener))
117471
+ throw TypeError("listener must be a function");
117472
+ if (!this._events)
117473
+ this._events = {};
117474
+ if (this._events.newListener)
117475
+ this.emit(
117476
+ "newListener",
117477
+ type2,
117478
+ isFunction(listener.listener) ? listener.listener : listener
117479
+ );
117480
+ if (!this._events[type2])
117481
+ this._events[type2] = listener;
117482
+ else if (isObject$1(this._events[type2]))
117483
+ this._events[type2].push(listener);
117484
+ else
117485
+ this._events[type2] = [this._events[type2], listener];
117486
+ if (isObject$1(this._events[type2]) && !this._events[type2].warned) {
117487
+ if (!isUndefined(this._maxListeners)) {
117488
+ m = this._maxListeners;
117214
117489
  } else {
117215
- existing.push(listener);
117490
+ m = EventEmitter.defaultMaxListeners;
117216
117491
  }
117217
- m = _getMaxListeners(target);
117218
- if (m > 0 && existing.length > m && !existing.warned) {
117219
- existing.warned = true;
117220
- var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type2) + " listeners added. Use emitter.setMaxListeners() to increase limit");
117221
- w2.name = "MaxListenersExceededWarning";
117222
- w2.emitter = target;
117223
- w2.type = type2;
117224
- w2.count = existing.length;
117225
- ProcessEmitWarning(w2);
117492
+ if (m && m > 0 && this._events[type2].length > m) {
117493
+ this._events[type2].warned = true;
117494
+ console.error(
117495
+ "(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",
117496
+ this._events[type2].length
117497
+ );
117498
+ if (typeof console.trace === "function") {
117499
+ console.trace();
117500
+ }
117226
117501
  }
117227
117502
  }
117228
- return target;
117229
- }
117230
- EventEmitter.prototype.addListener = function addListener(type2, listener) {
117231
- return _addListener(this, type2, listener, false);
117232
- };
117233
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
117234
- EventEmitter.prototype.prependListener = function prependListener(type2, listener) {
117235
- return _addListener(this, type2, listener, true);
117236
- };
117237
- function onceWrapper() {
117238
- if (!this.fired) {
117239
- this.target.removeListener(this.type, this.wrapFn);
117240
- this.fired = true;
117241
- if (arguments.length === 0)
117242
- return this.listener.call(this.target);
117243
- return this.listener.apply(this.target, arguments);
117244
- }
117245
- }
117246
- function _onceWrap(target, type2, listener) {
117247
- var state = { fired: false, wrapFn: void 0, target, type: type2, listener };
117248
- var wrapped = onceWrapper.bind(state);
117249
- wrapped.listener = listener;
117250
- state.wrapFn = wrapped;
117251
- return wrapped;
117252
- }
117253
- EventEmitter.prototype.once = function once(type2, listener) {
117254
- checkListener(listener);
117255
- this.on(type2, _onceWrap(this, type2, listener));
117256
117503
  return this;
117257
117504
  };
117258
- EventEmitter.prototype.prependOnceListener = function prependOnceListener(type2, listener) {
117259
- checkListener(listener);
117260
- this.prependListener(type2, _onceWrap(this, type2, listener));
117505
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
117506
+ EventEmitter.prototype.once = function(type2, listener) {
117507
+ if (!isFunction(listener))
117508
+ throw TypeError("listener must be a function");
117509
+ var fired = false;
117510
+ function g2() {
117511
+ this.removeListener(type2, g2);
117512
+ if (!fired) {
117513
+ fired = true;
117514
+ listener.apply(this, arguments);
117515
+ }
117516
+ }
117517
+ g2.listener = listener;
117518
+ this.on(type2, g2);
117261
117519
  return this;
117262
117520
  };
117263
- EventEmitter.prototype.removeListener = function removeListener(type2, listener) {
117264
- var list, events2, position, i2, originalListener;
117265
- checkListener(listener);
117266
- events2 = this._events;
117267
- if (events2 === void 0)
117521
+ EventEmitter.prototype.removeListener = function(type2, listener) {
117522
+ var list, position, length2, i2;
117523
+ if (!isFunction(listener))
117524
+ throw TypeError("listener must be a function");
117525
+ if (!this._events || !this._events[type2])
117268
117526
  return this;
117269
- list = events2[type2];
117270
- if (list === void 0)
117271
- return this;
117272
- if (list === listener || list.listener === listener) {
117273
- if (--this._eventsCount === 0)
117274
- this._events = /* @__PURE__ */ Object.create(null);
117275
- else {
117276
- delete events2[type2];
117277
- if (events2.removeListener)
117278
- this.emit("removeListener", type2, list.listener || listener);
117279
- }
117280
- } else if (typeof list !== "function") {
117281
- position = -1;
117282
- for (i2 = list.length - 1; i2 >= 0; i2--) {
117283
- if (list[i2] === listener || list[i2].listener === listener) {
117284
- originalListener = list[i2].listener;
117527
+ list = this._events[type2];
117528
+ length2 = list.length;
117529
+ position = -1;
117530
+ if (list === listener || isFunction(list.listener) && list.listener === listener) {
117531
+ delete this._events[type2];
117532
+ if (this._events.removeListener)
117533
+ this.emit("removeListener", type2, listener);
117534
+ } else if (isObject$1(list)) {
117535
+ for (i2 = length2; i2-- > 0; ) {
117536
+ if (list[i2] === listener || list[i2].listener && list[i2].listener === listener) {
117285
117537
  position = i2;
117286
117538
  break;
117287
117539
  }
117288
117540
  }
117289
117541
  if (position < 0)
117290
117542
  return this;
117291
- if (position === 0)
117292
- list.shift();
117293
- else {
117294
- spliceOne(list, position);
117543
+ if (list.length === 1) {
117544
+ list.length = 0;
117545
+ delete this._events[type2];
117546
+ } else {
117547
+ list.splice(position, 1);
117295
117548
  }
117296
- if (list.length === 1)
117297
- events2[type2] = list[0];
117298
- if (events2.removeListener !== void 0)
117299
- this.emit("removeListener", type2, originalListener || listener);
117549
+ if (this._events.removeListener)
117550
+ this.emit("removeListener", type2, listener);
117300
117551
  }
117301
117552
  return this;
117302
117553
  };
117303
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
117304
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(type2) {
117305
- var listeners2, events2, i2;
117306
- events2 = this._events;
117307
- if (events2 === void 0)
117554
+ EventEmitter.prototype.removeAllListeners = function(type2) {
117555
+ var key, listeners;
117556
+ if (!this._events)
117308
117557
  return this;
117309
- if (events2.removeListener === void 0) {
117310
- if (arguments.length === 0) {
117311
- this._events = /* @__PURE__ */ Object.create(null);
117312
- this._eventsCount = 0;
117313
- } else if (events2[type2] !== void 0) {
117314
- if (--this._eventsCount === 0)
117315
- this._events = /* @__PURE__ */ Object.create(null);
117316
- else
117317
- delete events2[type2];
117318
- }
117558
+ if (!this._events.removeListener) {
117559
+ if (arguments.length === 0)
117560
+ this._events = {};
117561
+ else if (this._events[type2])
117562
+ delete this._events[type2];
117319
117563
  return this;
117320
117564
  }
117321
117565
  if (arguments.length === 0) {
117322
- var keys3 = Object.keys(events2);
117323
- var key;
117324
- for (i2 = 0; i2 < keys3.length; ++i2) {
117325
- key = keys3[i2];
117566
+ for (key in this._events) {
117326
117567
  if (key === "removeListener")
117327
117568
  continue;
117328
117569
  this.removeAllListeners(key);
117329
117570
  }
117330
117571
  this.removeAllListeners("removeListener");
117331
- this._events = /* @__PURE__ */ Object.create(null);
117332
- this._eventsCount = 0;
117572
+ this._events = {};
117333
117573
  return this;
117334
117574
  }
117335
- listeners2 = events2[type2];
117336
- if (typeof listeners2 === "function") {
117337
- this.removeListener(type2, listeners2);
117338
- } else if (listeners2 !== void 0) {
117339
- for (i2 = listeners2.length - 1; i2 >= 0; i2--) {
117340
- this.removeListener(type2, listeners2[i2]);
117341
- }
117575
+ listeners = this._events[type2];
117576
+ if (isFunction(listeners)) {
117577
+ this.removeListener(type2, listeners);
117578
+ } else if (listeners) {
117579
+ while (listeners.length)
117580
+ this.removeListener(type2, listeners[listeners.length - 1]);
117342
117581
  }
117582
+ delete this._events[type2];
117343
117583
  return this;
117344
117584
  };
117345
- function _listeners(target, type2, unwrap2) {
117346
- var events2 = target._events;
117347
- if (events2 === void 0)
117348
- return [];
117349
- var evlistener = events2[type2];
117350
- if (evlistener === void 0)
117351
- return [];
117352
- if (typeof evlistener === "function")
117353
- return unwrap2 ? [evlistener.listener || evlistener] : [evlistener];
117354
- return unwrap2 ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
117355
- }
117356
- EventEmitter.prototype.listeners = function listeners(type2) {
117357
- return _listeners(this, type2, true);
117358
- };
117359
- EventEmitter.prototype.rawListeners = function rawListeners(type2) {
117360
- return _listeners(this, type2, false);
117361
- };
117362
- EventEmitter.listenerCount = function(emitter, type2) {
117363
- if (typeof emitter.listenerCount === "function") {
117364
- return emitter.listenerCount(type2);
117365
- } else {
117366
- return listenerCount.call(emitter, type2);
117367
- }
117585
+ EventEmitter.prototype.listeners = function(type2) {
117586
+ var ret;
117587
+ if (!this._events || !this._events[type2])
117588
+ ret = [];
117589
+ else if (isFunction(this._events[type2]))
117590
+ ret = [this._events[type2]];
117591
+ else
117592
+ ret = this._events[type2].slice();
117593
+ return ret;
117368
117594
  };
117369
- EventEmitter.prototype.listenerCount = listenerCount;
117370
- function listenerCount(type2) {
117371
- var events2 = this._events;
117372
- if (events2 !== void 0) {
117373
- var evlistener = events2[type2];
117374
- if (typeof evlistener === "function") {
117595
+ EventEmitter.prototype.listenerCount = function(type2) {
117596
+ if (this._events) {
117597
+ var evlistener = this._events[type2];
117598
+ if (isFunction(evlistener))
117375
117599
  return 1;
117376
- } else if (evlistener !== void 0) {
117600
+ else if (evlistener)
117377
117601
  return evlistener.length;
117378
- }
117379
117602
  }
117380
117603
  return 0;
117381
- }
117382
- EventEmitter.prototype.eventNames = function eventNames() {
117383
- return this._eventsCount > 0 ? ReflectOwnKeys$1(this._events) : [];
117384
117604
  };
117385
- function arrayClone(arr, n3) {
117386
- var copy2 = new Array(n3);
117387
- for (var i2 = 0; i2 < n3; ++i2)
117388
- copy2[i2] = arr[i2];
117389
- return copy2;
117390
- }
117391
- function spliceOne(list, index2) {
117392
- for (; index2 + 1 < list.length; index2++)
117393
- list[index2] = list[index2 + 1];
117394
- list.pop();
117395
- }
117396
- function unwrapListeners(arr) {
117397
- var ret = new Array(arr.length);
117398
- for (var i2 = 0; i2 < ret.length; ++i2) {
117399
- ret[i2] = arr[i2].listener || arr[i2];
117400
- }
117401
- return ret;
117605
+ EventEmitter.listenerCount = function(emitter, type2) {
117606
+ return emitter.listenerCount(type2);
117607
+ };
117608
+ function isFunction(arg) {
117609
+ return typeof arg === "function";
117402
117610
  }
117403
- function once2(emitter, name2) {
117404
- return new Promise(function(resolve2, reject) {
117405
- function errorListener(err2) {
117406
- emitter.removeListener(name2, resolver);
117407
- reject(err2);
117408
- }
117409
- function resolver() {
117410
- if (typeof emitter.removeListener === "function") {
117411
- emitter.removeListener("error", errorListener);
117412
- }
117413
- resolve2([].slice.call(arguments));
117414
- }
117415
- eventTargetAgnosticAddListener(emitter, name2, resolver, { once: true });
117416
- if (name2 !== "error") {
117417
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
117418
- }
117419
- });
117611
+ function isNumber(arg) {
117612
+ return typeof arg === "number";
117420
117613
  }
117421
- function addErrorHandlerIfEventEmitter(emitter, handler, flags3) {
117422
- if (typeof emitter.on === "function") {
117423
- eventTargetAgnosticAddListener(emitter, "error", handler, flags3);
117424
- }
117614
+ function isObject$1(arg) {
117615
+ return typeof arg === "object" && arg !== null;
117425
117616
  }
117426
- function eventTargetAgnosticAddListener(emitter, name2, listener, flags3) {
117427
- if (typeof emitter.on === "function") {
117428
- if (flags3.once) {
117429
- emitter.once(name2, listener);
117430
- } else {
117431
- emitter.on(name2, listener);
117432
- }
117433
- } else if (typeof emitter.addEventListener === "function") {
117434
- emitter.addEventListener(name2, function wrapListener(arg) {
117435
- if (flags3.once) {
117436
- emitter.removeEventListener(name2, wrapListener);
117437
- }
117438
- listener(arg);
117439
- });
117440
- } else {
117441
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
117442
- }
117617
+ function isUndefined(arg) {
117618
+ return arg === void 0;
117443
117619
  }
117444
- var eventsExports = events.exports;
117445
117620
  var getRandomValues = typeof crypto != "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != "undefined" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto);
117446
117621
  var rnds8 = new Uint8Array(16);
117447
117622
  function rng() {
@@ -117807,7 +117982,7 @@ const require$$1$3 = /* @__PURE__ */ getAugmentedNamespace(esmBrowser);
117807
117982
  value: true
117808
117983
  });
117809
117984
  exports2["default"] = void 0;
117810
- var _events = _interopRequireDefault2(eventsExports);
117985
+ var _events = _interopRequireDefault2(events);
117811
117986
  var _uuid = _interopRequireDefault2(require$$1$3);
117812
117987
  function _interopRequireDefault2(obj) {
117813
117988
  return obj && obj.__esModule ? obj : { "default": obj };
@@ -118291,7 +118466,7 @@ function rhumbDistance$2(from, to, options) {
118291
118466
  }
118292
118467
  function calculateRhumbDistance(origin, destination2, radius) {
118293
118468
  radius = radius === void 0 ? helpers_1$9.earthRadius : Number(radius);
118294
- var R2 = radius;
118469
+ var R = radius;
118295
118470
  var phi12 = origin[1] * Math.PI / 180;
118296
118471
  var phi2 = destination2[1] * Math.PI / 180;
118297
118472
  var DeltaPhi = phi2 - phi12;
@@ -118302,7 +118477,7 @@ function calculateRhumbDistance(origin, destination2, radius) {
118302
118477
  var DeltaPsi = Math.log(Math.tan(phi2 / 2 + Math.PI / 4) / Math.tan(phi12 / 2 + Math.PI / 4));
118303
118478
  var q = Math.abs(DeltaPsi) > 1e-11 ? DeltaPhi / DeltaPsi : Math.cos(phi12);
118304
118479
  var delta = Math.sqrt(DeltaPhi * DeltaPhi + q * q * DeltaLambda * DeltaLambda);
118305
- var dist = delta * R2;
118480
+ var dist = delta * R;
118306
118481
  return dist;
118307
118482
  }
118308
118483
  js$e.default = rhumbDistance$2;
@@ -132811,7 +132986,7 @@ var document_1 = doccy;
132811
132986
  value: true
132812
132987
  });
132813
132988
  exports2["default"] = void 0;
132814
- var _events = eventsExports;
132989
+ var _events = events;
132815
132990
  var _document = _interopRequireDefault2(document_1);
132816
132991
  var _core = require$$2$2;
132817
132992
  var _deckDrawer = _interopRequireDefault2(deckDrawer);
@@ -134727,7 +134902,7 @@ class SelectionExtension extends LayerExtension {
134727
134902
  SelectionExtension.extensionName = "SelectionExtension";
134728
134903
  function uncurryThis(target) {
134729
134904
  return (thisArg, ...args) => {
134730
- return ReflectApply2(target, thisArg, args);
134905
+ return ReflectApply(target, thisArg, args);
134731
134906
  };
134732
134907
  }
134733
134908
  function uncurryThisGetter(target, key) {
@@ -134739,7 +134914,7 @@ function uncurryThisGetter(target, key) {
134739
134914
  );
134740
134915
  }
134741
134916
  const {
134742
- apply: ReflectApply2,
134917
+ apply: ReflectApply,
134743
134918
  construct: ReflectConstruct,
134744
134919
  defineProperty: ReflectDefineProperty,
134745
134920
  get: ReflectGet,
@@ -135411,16 +135586,16 @@ async function getDecoder(fileDirectory) {
135411
135586
  const Decoder = await importFn();
135412
135587
  return new Decoder(fileDirectory);
135413
135588
  }
135414
- addDecoder([void 0, 1], () => import("./raw-6f9260ad.js").then((m) => m.default));
135415
- addDecoder(5, () => import("./lzw-8a1c6e8b.js").then((m) => m.default));
135589
+ addDecoder([void 0, 1], () => import("./raw-8900d89e.js").then((m) => m.default));
135590
+ addDecoder(5, () => import("./lzw-40a46f03.js").then((m) => m.default));
135416
135591
  addDecoder(6, () => {
135417
135592
  throw new Error("old style JPEG compression is not supported.");
135418
135593
  });
135419
- addDecoder(7, () => import("./jpeg-de6da3bd.js").then((m) => m.default));
135420
- addDecoder([8, 32946], () => import("./deflate-d056929f.js").then((m) => m.default));
135421
- addDecoder(32773, () => import("./packbits-f154ca3a.js").then((m) => m.default));
135422
- addDecoder(34887, () => import("./lerc-1a406d6c.js").then((m) => m.default));
135423
- addDecoder(50001, () => import("./webimage-8a3be067.js").then((m) => m.default));
135594
+ addDecoder(7, () => import("./jpeg-c498508c.js").then((m) => m.default));
135595
+ addDecoder([8, 32946], () => import("./deflate-3d6b2462.js").then((m) => m.default));
135596
+ addDecoder(32773, () => import("./packbits-86cc820a.js").then((m) => m.default));
135597
+ addDecoder(34887, () => import("./lerc-5613fd3d.js").then((m) => m.default));
135598
+ addDecoder(50001, () => import("./webimage-9dcbbafd.js").then((m) => m.default));
135424
135599
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
135425
135600
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
135426
135601
  }
@@ -138248,16 +138423,16 @@ createCommonjsModule(function(module2) {
138248
138423
  if (!new Events().__proto__)
138249
138424
  prefix = false;
138250
138425
  }
138251
- function EE(fn, context, once3) {
138426
+ function EE(fn, context, once) {
138252
138427
  this.fn = fn;
138253
138428
  this.context = context;
138254
- this.once = once3 || false;
138429
+ this.once = once || false;
138255
138430
  }
138256
- function addListener2(emitter, event, fn, context, once3) {
138431
+ function addListener(emitter, event, fn, context, once) {
138257
138432
  if (typeof fn !== "function") {
138258
138433
  throw new TypeError("The listener must be a function");
138259
138434
  }
138260
- var listener = new EE(fn, context || emitter, once3), evt = prefix ? prefix + event : event;
138435
+ var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
138261
138436
  if (!emitter._events[evt])
138262
138437
  emitter._events[evt] = listener, emitter._eventsCount++;
138263
138438
  else if (!emitter._events[evt].fn)
@@ -138276,7 +138451,7 @@ createCommonjsModule(function(module2) {
138276
138451
  this._events = new Events();
138277
138452
  this._eventsCount = 0;
138278
138453
  }
138279
- EventEmitter2.prototype.eventNames = function eventNames2() {
138454
+ EventEmitter2.prototype.eventNames = function eventNames() {
138280
138455
  var names = [], events2, name2;
138281
138456
  if (this._eventsCount === 0)
138282
138457
  return names;
@@ -138289,7 +138464,7 @@ createCommonjsModule(function(module2) {
138289
138464
  }
138290
138465
  return names;
138291
138466
  };
138292
- EventEmitter2.prototype.listeners = function listeners2(event) {
138467
+ EventEmitter2.prototype.listeners = function listeners(event) {
138293
138468
  var evt = prefix ? prefix + event : event, handlers = this._events[evt];
138294
138469
  if (!handlers)
138295
138470
  return [];
@@ -138300,76 +138475,76 @@ createCommonjsModule(function(module2) {
138300
138475
  }
138301
138476
  return ee;
138302
138477
  };
138303
- EventEmitter2.prototype.listenerCount = function listenerCount2(event) {
138304
- var evt = prefix ? prefix + event : event, listeners2 = this._events[evt];
138305
- if (!listeners2)
138478
+ EventEmitter2.prototype.listenerCount = function listenerCount(event) {
138479
+ var evt = prefix ? prefix + event : event, listeners = this._events[evt];
138480
+ if (!listeners)
138306
138481
  return 0;
138307
- if (listeners2.fn)
138482
+ if (listeners.fn)
138308
138483
  return 1;
138309
- return listeners2.length;
138484
+ return listeners.length;
138310
138485
  };
138311
- EventEmitter2.prototype.emit = function emit2(event, a1, a2, a3, a4, a5) {
138486
+ EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
138312
138487
  var evt = prefix ? prefix + event : event;
138313
138488
  if (!this._events[evt])
138314
138489
  return false;
138315
- var listeners2 = this._events[evt], len2 = arguments.length, args, i2;
138316
- if (listeners2.fn) {
138317
- if (listeners2.once)
138318
- this.removeListener(event, listeners2.fn, void 0, true);
138490
+ var listeners = this._events[evt], len2 = arguments.length, args, i2;
138491
+ if (listeners.fn) {
138492
+ if (listeners.once)
138493
+ this.removeListener(event, listeners.fn, void 0, true);
138319
138494
  switch (len2) {
138320
138495
  case 1:
138321
- return listeners2.fn.call(listeners2.context), true;
138496
+ return listeners.fn.call(listeners.context), true;
138322
138497
  case 2:
138323
- return listeners2.fn.call(listeners2.context, a1), true;
138498
+ return listeners.fn.call(listeners.context, a1), true;
138324
138499
  case 3:
138325
- return listeners2.fn.call(listeners2.context, a1, a2), true;
138500
+ return listeners.fn.call(listeners.context, a1, a2), true;
138326
138501
  case 4:
138327
- return listeners2.fn.call(listeners2.context, a1, a2, a3), true;
138502
+ return listeners.fn.call(listeners.context, a1, a2, a3), true;
138328
138503
  case 5:
138329
- return listeners2.fn.call(listeners2.context, a1, a2, a3, a4), true;
138504
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
138330
138505
  case 6:
138331
- return listeners2.fn.call(listeners2.context, a1, a2, a3, a4, a5), true;
138506
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
138332
138507
  }
138333
138508
  for (i2 = 1, args = new Array(len2 - 1); i2 < len2; i2++) {
138334
138509
  args[i2 - 1] = arguments[i2];
138335
138510
  }
138336
- listeners2.fn.apply(listeners2.context, args);
138511
+ listeners.fn.apply(listeners.context, args);
138337
138512
  } else {
138338
- var length2 = listeners2.length, j;
138513
+ var length2 = listeners.length, j;
138339
138514
  for (i2 = 0; i2 < length2; i2++) {
138340
- if (listeners2[i2].once)
138341
- this.removeListener(event, listeners2[i2].fn, void 0, true);
138515
+ if (listeners[i2].once)
138516
+ this.removeListener(event, listeners[i2].fn, void 0, true);
138342
138517
  switch (len2) {
138343
138518
  case 1:
138344
- listeners2[i2].fn.call(listeners2[i2].context);
138519
+ listeners[i2].fn.call(listeners[i2].context);
138345
138520
  break;
138346
138521
  case 2:
138347
- listeners2[i2].fn.call(listeners2[i2].context, a1);
138522
+ listeners[i2].fn.call(listeners[i2].context, a1);
138348
138523
  break;
138349
138524
  case 3:
138350
- listeners2[i2].fn.call(listeners2[i2].context, a1, a2);
138525
+ listeners[i2].fn.call(listeners[i2].context, a1, a2);
138351
138526
  break;
138352
138527
  case 4:
138353
- listeners2[i2].fn.call(listeners2[i2].context, a1, a2, a3);
138528
+ listeners[i2].fn.call(listeners[i2].context, a1, a2, a3);
138354
138529
  break;
138355
138530
  default:
138356
138531
  if (!args)
138357
138532
  for (j = 1, args = new Array(len2 - 1); j < len2; j++) {
138358
138533
  args[j - 1] = arguments[j];
138359
138534
  }
138360
- listeners2[i2].fn.apply(listeners2[i2].context, args);
138535
+ listeners[i2].fn.apply(listeners[i2].context, args);
138361
138536
  }
138362
138537
  }
138363
138538
  }
138364
138539
  return true;
138365
138540
  };
138366
138541
  EventEmitter2.prototype.on = function on(event, fn, context) {
138367
- return addListener2(this, event, fn, context, false);
138542
+ return addListener(this, event, fn, context, false);
138368
138543
  };
138369
- EventEmitter2.prototype.once = function once3(event, fn, context) {
138370
- return addListener2(this, event, fn, context, true);
138544
+ EventEmitter2.prototype.once = function once(event, fn, context) {
138545
+ return addListener(this, event, fn, context, true);
138371
138546
  };
138372
- EventEmitter2.prototype.removeListener = function removeListener2(event, fn, context, once3) {
138547
+ EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) {
138373
138548
  var evt = prefix ? prefix + event : event;
138374
138549
  if (!this._events[evt])
138375
138550
  return this;
@@ -138377,15 +138552,15 @@ createCommonjsModule(function(module2) {
138377
138552
  clearEvent(this, evt);
138378
138553
  return this;
138379
138554
  }
138380
- var listeners2 = this._events[evt];
138381
- if (listeners2.fn) {
138382
- if (listeners2.fn === fn && (!once3 || listeners2.once) && (!context || listeners2.context === context)) {
138555
+ var listeners = this._events[evt];
138556
+ if (listeners.fn) {
138557
+ if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
138383
138558
  clearEvent(this, evt);
138384
138559
  }
138385
138560
  } else {
138386
- for (var i2 = 0, events2 = [], length2 = listeners2.length; i2 < length2; i2++) {
138387
- if (listeners2[i2].fn !== fn || once3 && !listeners2[i2].once || context && listeners2[i2].context !== context) {
138388
- events2.push(listeners2[i2]);
138561
+ for (var i2 = 0, events2 = [], length2 = listeners.length; i2 < length2; i2++) {
138562
+ if (listeners[i2].fn !== fn || once && !listeners[i2].once || context && listeners[i2].context !== context) {
138563
+ events2.push(listeners[i2]);
138389
138564
  }
138390
138565
  }
138391
138566
  if (events2.length)
@@ -138395,7 +138570,7 @@ createCommonjsModule(function(module2) {
138395
138570
  }
138396
138571
  return this;
138397
138572
  };
138398
- EventEmitter2.prototype.removeAllListeners = function removeAllListeners2(event) {
138573
+ EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) {
138399
138574
  var evt;
138400
138575
  if (event) {
138401
138576
  evt = prefix ? prefix + event : event;
@@ -142878,7 +143053,7 @@ var blosc_codec = function() {
142878
143053
  b += Ga[z2[a2++]];
142879
143054
  return b;
142880
143055
  }
142881
- var Q2 = {}, R2 = {}, S = {};
143056
+ var Q2 = {}, R = {}, S = {};
142882
143057
  function Ha(a2) {
142883
143058
  if (void 0 === a2)
142884
143059
  return "_unknown";
@@ -142923,8 +143098,8 @@ var blosc_codec = function() {
142923
143098
  });
142924
143099
  var e2 = Array(a2.length), g2 = [], k = 0;
142925
143100
  a2.forEach(function(h, l2) {
142926
- R2.hasOwnProperty(h) ? e2[l2] = R2[h] : (g2.push(h), Q2.hasOwnProperty(h) || (Q2[h] = []), Q2[h].push(function() {
142927
- e2[l2] = R2[h];
143101
+ R.hasOwnProperty(h) ? e2[l2] = R[h] : (g2.push(h), Q2.hasOwnProperty(h) || (Q2[h] = []), Q2[h].push(function() {
143102
+ e2[l2] = R[h];
142928
143103
  ++k;
142929
143104
  k === g2.length && c(e2);
142930
143105
  }));
@@ -142937,12 +143112,12 @@ var blosc_codec = function() {
142937
143112
  throw new TypeError("registerType registeredInstance requires argPackAdvance");
142938
143113
  var d = b.name;
142939
143114
  a2 || T('type "' + d + '" must have a positive integer typeid pointer');
142940
- if (R2.hasOwnProperty(a2)) {
143115
+ if (R.hasOwnProperty(a2)) {
142941
143116
  if (c.U)
142942
143117
  return;
142943
143118
  T("Cannot register type '" + d + "' twice");
142944
143119
  }
142945
- R2[a2] = b;
143120
+ R[a2] = b;
142946
143121
  delete S[a2];
142947
143122
  Q2.hasOwnProperty(a2) && (b = Q2[a2], delete Q2[a2], b.forEach(function(e2) {
142948
143123
  e2();
@@ -143055,7 +143230,7 @@ var blosc_codec = function() {
143055
143230
  }
143056
143231
  function eb(a2, b) {
143057
143232
  function c(g2) {
143058
- e2[g2] || R2[g2] || (S[g2] ? S[g2].forEach(c) : (d.push(g2), e2[g2] = true));
143233
+ e2[g2] || R[g2] || (S[g2] ? S[g2].forEach(c) : (d.push(g2), e2[g2] = true));
143059
143234
  }
143060
143235
  var d = [], e2 = {};
143061
143236
  b.forEach(c);
@@ -143343,7 +143518,7 @@ var blosc_codec = function() {
143343
143518
  }, n: Qa, x: function(a2) {
143344
143519
  4 < a2 && (V[a2].P += 1);
143345
143520
  }, C: function(a2, b) {
143346
- var c = R2[a2];
143521
+ var c = R[a2];
143347
143522
  void 0 === c && T("_emval_take_value has unknown type " + cb(a2));
143348
143523
  a2 = c.readValueFromPointer(b);
143349
143524
  return Ra(a2);
@@ -143743,7 +143918,7 @@ function parseXML(xmlString) {
143743
143918
  );
143744
143919
  return xmlToJson(doc.documentElement, { attrtibutesKey: "attr" });
143745
143920
  }
143746
- function assert$1(condition, message) {
143921
+ function assert$3(condition, message) {
143747
143922
  if (!condition) {
143748
143923
  throw new Error(`Assert failed${message ? `: ${message}` : ""}`);
143749
143924
  }
@@ -143785,7 +143960,7 @@ function extractPhysicalSizesfromPixels(d) {
143785
143960
  return physicalSizes;
143786
143961
  }
143787
143962
  function parsePixelDataType(dtype) {
143788
- assert$1(dtype in DTYPE_LOOKUP$1, `Pixel type ${dtype} not supported.`);
143963
+ assert$3(dtype in DTYPE_LOOKUP$1, `Pixel type ${dtype} not supported.`);
143789
143964
  return DTYPE_LOOKUP$1[dtype];
143790
143965
  }
143791
143966
  function extractAxesFromPixels(d) {
@@ -143805,9 +143980,9 @@ function extractAxesFromPixels(d) {
143805
143980
  function getShapeForBinaryDownsampleLevel(options) {
143806
143981
  const { axes, level } = options;
143807
143982
  const xIndex = axes.labels.indexOf("x");
143808
- assert$1(xIndex !== -1, "x dimension not found");
143983
+ assert$3(xIndex !== -1, "x dimension not found");
143809
143984
  const yIndex = axes.labels.indexOf("y");
143810
- assert$1(yIndex !== -1, "y dimension not found");
143985
+ assert$3(yIndex !== -1, "y dimension not found");
143811
143986
  const resolutionShape = axes.shape.slice();
143812
143987
  resolutionShape[xIndex] = axes.shape[xIndex] >> level;
143813
143988
  resolutionShape[yIndex] = axes.shape[yIndex] >> level;
@@ -144167,9 +144342,9 @@ function createMultifileImageDataLookup(tiffData) {
144167
144342
  function keyFor({ t: t2, c, z: z2 }) {
144168
144343
  return `t${t2}.c${c}.z${z2}`;
144169
144344
  }
144170
- assert$1(tiffData, "No TiffData in OME-XML");
144345
+ assert$3(tiffData, "No TiffData in OME-XML");
144171
144346
  for (const imageData of tiffData) {
144172
- assert$1(isCompleteTiffDataItem(imageData), "Incomplete TiffData item");
144347
+ assert$3(isCompleteTiffDataItem(imageData), "Incomplete TiffData item");
144173
144348
  const key = keyFor({
144174
144349
  t: imageData["FirstT"],
144175
144350
  c: imageData["FirstC"],
@@ -144184,7 +144359,7 @@ function createMultifileImageDataLookup(tiffData) {
144184
144359
  return {
144185
144360
  getImageDataPointer(selection) {
144186
144361
  const entry = lookup.get(keyFor(selection));
144187
- assert$1(entry, `No image for selection: ${JSON.stringify(selection)}`);
144362
+ assert$3(entry, `No image for selection: ${JSON.stringify(selection)}`);
144188
144363
  return entry;
144189
144364
  }
144190
144365
  };
@@ -144234,7 +144409,7 @@ async function getPixelSourceOptionsForImage(metadata, config3) {
144234
144409
  };
144235
144410
  }
144236
144411
  async function loadMultifileOmeTiff(source, options = {}) {
144237
- assert$1(
144412
+ assert$3(
144238
144413
  !(source instanceof File),
144239
144414
  "File or Blob not supported for multifile OME-TIFF"
144240
144415
  );
@@ -148766,10 +148941,10 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
148766
148941
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
148767
148942
  const colorTexHeight = Math.max(2, Math.ceil(totalColorsLength / texSize));
148768
148943
  if (valueTexHeight > texSize) {
148769
- console.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
148944
+ log$6.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
148770
148945
  }
148771
148946
  if (colorTexHeight > texSize) {
148772
- console.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
148947
+ log$6.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
148773
148948
  }
148774
148949
  const totalData = new Uint8Array(texSize * valueTexHeight);
148775
148950
  const totalColors = new Uint8Array(texSize * colorTexHeight);
@@ -149444,11 +149619,9 @@ class BoolArray {
149444
149619
  get byteLength() {
149445
149620
  return __privateGet(this, _bytes).byteLength;
149446
149621
  }
149447
- /** @type {ArrayBuffer} */
149448
149622
  get buffer() {
149449
149623
  return __privateGet(this, _bytes).buffer;
149450
149624
  }
149451
- /** @type {number} */
149452
149625
  get length() {
149453
149626
  return __privateGet(this, _bytes).length;
149454
149627
  }
@@ -149499,11 +149672,9 @@ class ByteStringArray {
149499
149672
  get byteLength() {
149500
149673
  return this._data.byteLength;
149501
149674
  }
149502
- /** @type {ArrayBuffer} */
149503
149675
  get buffer() {
149504
149676
  return this._data.buffer;
149505
149677
  }
149506
- /** @type {number} */
149507
149678
  get length() {
149508
149679
  return this.byteLength / this.BYTES_PER_ELEMENT;
149509
149680
  }
@@ -149560,11 +149731,9 @@ const _UnicodeStringArray = class {
149560
149731
  get byteOffset() {
149561
149732
  return __privateGet(this, _data).byteOffset;
149562
149733
  }
149563
- /** @type {ArrayBuffer} */
149564
149734
  get buffer() {
149565
149735
  return __privateGet(this, _data).buffer;
149566
149736
  }
149567
- /** @type {number} */
149568
149737
  get length() {
149569
149738
  return __privateGet(this, _data).length / this.chars;
149570
149739
  }
@@ -149615,53 +149784,43 @@ function byteswap_inplace(view, bytes_per_element2) {
149615
149784
  }
149616
149785
  }
149617
149786
  }
149618
- const CONSTRUCTORS = {
149619
- int8: Int8Array,
149620
- int16: Int16Array,
149621
- int32: Int32Array,
149622
- int64: globalThis.BigInt64Array,
149623
- uint8: Uint8Array,
149624
- uint16: Uint16Array,
149625
- uint32: Uint32Array,
149626
- uint64: globalThis.BigUint64Array,
149627
- float32: Float32Array,
149628
- float64: Float64Array,
149629
- bool: BoolArray
149630
- };
149631
- const V2_STRING_REGEX = /v2:([US])(\d+)/;
149632
149787
  function get_ctr(data_type) {
149633
149788
  if (data_type === "v2:object") {
149634
149789
  return globalThis.Array;
149635
149790
  }
149636
- let match = data_type.match(V2_STRING_REGEX);
149791
+ let match = data_type.match(/v2:([US])(\d+)/);
149637
149792
  if (match) {
149638
149793
  let [, kind, chars] = match;
149639
149794
  return (kind === "U" ? UnicodeStringArray : ByteStringArray).bind(null, Number(chars));
149640
149795
  }
149641
- let ctr = CONSTRUCTORS[data_type];
149642
- if (!ctr) {
149643
- throw new Error(`Unknown or unsupported data_type: ${data_type}`);
149644
- }
149796
+ let ctr = {
149797
+ int8: Int8Array,
149798
+ int16: Int16Array,
149799
+ int32: Int32Array,
149800
+ int64: globalThis.BigInt64Array,
149801
+ uint8: Uint8Array,
149802
+ uint16: Uint16Array,
149803
+ uint32: Uint32Array,
149804
+ uint64: globalThis.BigUint64Array,
149805
+ float16: globalThis.Float16Array,
149806
+ float32: Float32Array,
149807
+ float64: Float64Array,
149808
+ bool: BoolArray
149809
+ }[data_type];
149810
+ assert$2(ctr, `Unknown or unsupported data_type: ${data_type}`);
149645
149811
  return ctr;
149646
149812
  }
149647
149813
  function get_strides(shape, order) {
149648
- return (order === "C" ? row_major_stride : col_major_stride)(shape);
149649
- }
149650
- function row_major_stride(shape) {
149651
- const ndim = shape.length;
149652
- const stride = globalThis.Array(ndim);
149653
- for (let i2 = ndim - 1, step = 1; i2 >= 0; i2--) {
149654
- stride[i2] = step;
149655
- step *= shape[i2];
149814
+ const rank2 = shape.length;
149815
+ if (typeof order === "string") {
149816
+ order = order === "C" ? Array.from({ length: rank2 }, (_, i2) => i2) : Array.from({ length: rank2 }, (_, i2) => rank2 - 1 - i2);
149656
149817
  }
149657
- return stride;
149658
- }
149659
- function col_major_stride(shape) {
149660
- const ndim = shape.length;
149661
- const stride = globalThis.Array(ndim);
149662
- for (let i2 = 0, step = 1; i2 < ndim; i2++) {
149663
- stride[i2] = step;
149664
- step *= shape[i2];
149818
+ assert$2(rank2 === order.length, "Order length must match the number of dimensions.");
149819
+ let step = 1;
149820
+ let stride = new Array(rank2);
149821
+ for (let i2 = order.length - 1; i2 >= 0; i2--) {
149822
+ stride[order[i2]] = step;
149823
+ step *= shape[order[i2]];
149665
149824
  }
149666
149825
  return stride;
149667
149826
  }
@@ -149676,20 +149835,12 @@ function create_chunk_key_encoder({ name: name2, configuration }) {
149676
149835
  }
149677
149836
  throw new Error(`Unknown chunk key encoding: ${name2}`);
149678
149837
  }
149679
- function get_array_order(codecs) {
149680
- var _a3;
149681
- const maybe_transpose_codec = codecs.find((c) => c.name === "transpose");
149682
- return ((_a3 = maybe_transpose_codec == null ? void 0 : maybe_transpose_codec.configuration) == null ? void 0 : _a3.order) === "F" ? "F" : "C";
149683
- }
149684
- const endian_regex = /^([<|>])(.*)$/;
149685
149838
  function coerce_dtype(dtype) {
149686
149839
  if (dtype === "|O") {
149687
149840
  return { data_type: "v2:object" };
149688
149841
  }
149689
- let match = dtype.match(endian_regex);
149690
- if (!match) {
149691
- throw new Error(`Invalid dtype: ${dtype}`);
149692
- }
149842
+ let match = dtype.match(/^([<|>])(.*)$/);
149843
+ assert$2(match, `Invalid dtype: ${dtype}`);
149693
149844
  let [, endian, rest] = match;
149694
149845
  let data_type = {
149695
149846
  b1: "bool",
@@ -149701,12 +149852,11 @@ function coerce_dtype(dtype) {
149701
149852
  u4: "uint32",
149702
149853
  i8: "int64",
149703
149854
  u8: "uint64",
149855
+ f2: "float16",
149704
149856
  f4: "float32",
149705
149857
  f8: "float64"
149706
149858
  }[rest] ?? (rest.startsWith("S") || rest.startsWith("U") ? `v2:${rest}` : void 0);
149707
- if (!data_type) {
149708
- throw new Error(`Unsupported or unknown dtype: ${dtype}`);
149709
- }
149859
+ assert$2(data_type, `Unsupported or unknown dtype: ${dtype}`);
149710
149860
  if (endian === "|") {
149711
149861
  return { data_type };
149712
149862
  }
@@ -149784,6 +149934,40 @@ function ensure_correct_scalar(metadata) {
149784
149934
  }
149785
149935
  return metadata.fill_value;
149786
149936
  }
149937
+ function rethrow_unless(error2, ...errors) {
149938
+ if (!errors.some((ErrorClass) => error2 instanceof ErrorClass)) {
149939
+ throw error2;
149940
+ }
149941
+ }
149942
+ function assert$2(expression, msg = "") {
149943
+ if (!expression) {
149944
+ throw new Error(msg);
149945
+ }
149946
+ }
149947
+ class BitroundCodec {
149948
+ constructor(configuration, _meta2) {
149949
+ __publicField(this, "kind", "array_to_array");
149950
+ assert$2(configuration.keepbits >= 0, "keepbits must be zero or positive");
149951
+ }
149952
+ static fromConfig(configuration, meta2) {
149953
+ return new BitroundCodec(configuration, meta2);
149954
+ }
149955
+ /**
149956
+ * Encode a chunk of data with bit-rounding.
149957
+ * @param _arr - The chunk to encode
149958
+ */
149959
+ encode(_arr) {
149960
+ throw new Error("`BitroundCodec.encode` is not implemented. Please open an issue at https://github.com/manzt/zarrita.js/issues.");
149961
+ }
149962
+ /**
149963
+ * Decode a chunk of data (no-op).
149964
+ * @param arr - The chunk to decode
149965
+ * @returns The decoded chunk
149966
+ */
149967
+ decode(arr) {
149968
+ return arr;
149969
+ }
149970
+ }
149787
149971
  const LITTLE_ENDIAN_OS = system_is_little_endian();
149788
149972
  function system_is_little_endian() {
149789
149973
  const a2 = new Uint32Array([305419896]);
@@ -149799,7 +149983,7 @@ function bytes_per_element(TypedArray2) {
149799
149983
  const _BytesCodec = class {
149800
149984
  constructor(configuration, meta2) {
149801
149985
  __publicField(this, "kind", "array_to_bytes");
149802
- __privateAdd(this, _strides, void 0);
149986
+ __privateAdd(this, _stride, void 0);
149803
149987
  __privateAdd(this, _TypedArray, void 0);
149804
149988
  __privateAdd(this, _BYTES_PER_ELEMENT, void 0);
149805
149989
  __privateAdd(this, _shape, void 0);
@@ -149807,7 +149991,7 @@ const _BytesCodec = class {
149807
149991
  __privateSet(this, _endian, configuration == null ? void 0 : configuration.endian);
149808
149992
  __privateSet(this, _TypedArray, get_ctr(meta2.data_type));
149809
149993
  __privateSet(this, _shape, meta2.shape);
149810
- __privateSet(this, _strides, get_strides(meta2.shape, get_array_order(meta2.codecs)));
149994
+ __privateSet(this, _stride, get_strides(meta2.shape, "C"));
149811
149995
  const sample = new (__privateGet(this, _TypedArray))(0);
149812
149996
  __privateSet(this, _BYTES_PER_ELEMENT, sample.BYTES_PER_ELEMENT);
149813
149997
  }
@@ -149828,12 +150012,12 @@ const _BytesCodec = class {
149828
150012
  return {
149829
150013
  data: new (__privateGet(this, _TypedArray))(bytes.buffer, bytes.byteOffset, bytes.byteLength / __privateGet(this, _BYTES_PER_ELEMENT)),
149830
150014
  shape: __privateGet(this, _shape),
149831
- stride: __privateGet(this, _strides)
150015
+ stride: __privateGet(this, _stride)
149832
150016
  };
149833
150017
  }
149834
150018
  };
149835
150019
  let BytesCodec = _BytesCodec;
149836
- _strides = new WeakMap();
150020
+ _stride = new WeakMap();
149837
150021
  _TypedArray = new WeakMap();
149838
150022
  _BYTES_PER_ELEMENT = new WeakMap();
149839
150023
  _shape = new WeakMap();
@@ -149853,15 +150037,9 @@ class Crc32cCodec {
149853
150037
  }
149854
150038
  }
149855
150039
  function throw_on_nan_replacer(_key, value) {
149856
- if (Number.isNaN(value)) {
149857
- throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");
149858
- }
149859
- if (value === Number.POSITIVE_INFINITY) {
149860
- throw new Error("JsonCodec allow_nan is false but Infinity was encountered during encoding.");
149861
- }
149862
- if (value === Number.NEGATIVE_INFINITY) {
149863
- throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
149864
- }
150040
+ assert$2(!Number.isNaN(value), "JsonCodec allow_nan is false but NaN was encountered during encoding.");
150041
+ assert$2(value !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding.");
150042
+ assert$2(value !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
149865
150043
  return value;
149866
150044
  }
149867
150045
  function sort_keys_replacer(_key, value) {
@@ -149903,13 +150081,9 @@ const _JsonCodec = class {
149903
150081
  }
149904
150082
  encode(buf) {
149905
150083
  const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = __privateGet(this, _encoder_config);
149906
- if (encoding !== "utf-8") {
149907
- throw new Error("JsonCodec does not yet support non-utf-8 encoding.");
149908
- }
150084
+ assert$2(encoding === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
149909
150085
  const replacer_functions = [];
149910
- if (!check_circular) {
149911
- throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");
149912
- }
150086
+ assert$2(check_circular, "JsonCodec does not yet support skipping the check for circular references during encoding.");
149913
150087
  if (!allow_nan) {
149914
150088
  replacer_functions.push(throw_on_nan_replacer);
149915
150089
  }
@@ -149941,15 +150115,11 @@ const _JsonCodec = class {
149941
150115
  }
149942
150116
  decode(bytes) {
149943
150117
  const { strict } = __privateGet(this, _decoder_config);
149944
- if (!strict) {
149945
- throw new Error("JsonCodec does not yet support non-strict decoding.");
149946
- }
150118
+ assert$2(strict, "JsonCodec does not yet support non-strict decoding.");
149947
150119
  const items = json_decode_object(bytes);
149948
150120
  const shape = items.pop();
149949
150121
  items.pop();
149950
- if (!shape) {
149951
- throw new Error("0D not implemented for JsonCodec.");
149952
- }
150122
+ assert$2(shape, "0D not implemented for JsonCodec.");
149953
150123
  const stride = get_strides(shape, "C");
149954
150124
  const data = items;
149955
150125
  return { data, shape, stride };
@@ -150016,39 +150186,72 @@ function convert_array_order(src, target) {
150016
150186
  }
150017
150187
  return out;
150018
150188
  }
150019
- function get_order(arr) {
150020
- if (!arr.stride)
150021
- return "C";
150022
- let row_major_strides = get_strides(arr.shape, "C");
150023
- return arr.stride.every((s2, i2) => s2 === row_major_strides[i2]) ? "C" : "F";
150189
+ function get_order(chunk) {
150190
+ let rank2 = chunk.shape.length;
150191
+ assert$2(rank2 === chunk.stride.length, "Shape and stride must have the same length.");
150192
+ return chunk.stride.map((s2, i2) => ({ stride: s2, index: i2 })).sort((a2, b) => b.stride - a2.stride).map((entry) => entry.index);
150024
150193
  }
150025
- class TransposeCodec {
150026
- constructor(configuration) {
150027
- __publicField(this, "configuration");
150194
+ function matches_order(chunk, target) {
150195
+ let source = get_order(chunk);
150196
+ assert$2(source.length === target.length, "Orders must match");
150197
+ return source.every((dim, i2) => dim === target[i2]);
150198
+ }
150199
+ const _TransposeCodec = class {
150200
+ constructor(configuration, meta2) {
150028
150201
  __publicField(this, "kind", "array_to_array");
150029
- this.configuration = configuration;
150202
+ __privateAdd(this, _order, void 0);
150203
+ __privateAdd(this, _inverseOrder, void 0);
150204
+ let value = configuration.order ?? "C";
150205
+ let rank2 = meta2.shape.length;
150206
+ let order = new Array(rank2);
150207
+ let inverseOrder = new Array(rank2);
150208
+ if (value === "C") {
150209
+ for (let i2 = 0; i2 < rank2; ++i2) {
150210
+ order[i2] = i2;
150211
+ inverseOrder[i2] = i2;
150212
+ }
150213
+ } else if (value === "F") {
150214
+ for (let i2 = 0; i2 < rank2; ++i2) {
150215
+ order[i2] = rank2 - i2 - 1;
150216
+ inverseOrder[i2] = rank2 - i2 - 1;
150217
+ }
150218
+ } else {
150219
+ order = value;
150220
+ order.forEach((x2, i2) => {
150221
+ assert$2(inverseOrder[x2] === void 0, `Invalid permutation: ${JSON.stringify(value)}`);
150222
+ inverseOrder[x2] = i2;
150223
+ });
150224
+ }
150225
+ __privateSet(this, _order, order);
150226
+ __privateSet(this, _inverseOrder, inverseOrder);
150030
150227
  }
150031
- static fromConfig(configuration) {
150032
- return new TransposeCodec(configuration);
150228
+ static fromConfig(configuration, meta2) {
150229
+ return new _TransposeCodec(configuration, meta2);
150033
150230
  }
150034
150231
  encode(arr) {
150035
- var _a3, _b2;
150036
- if (get_order(arr) === ((_a3 = this.configuration) == null ? void 0 : _a3.order)) {
150232
+ if (matches_order(arr, __privateGet(this, _inverseOrder))) {
150037
150233
  return arr;
150038
150234
  }
150039
- return convert_array_order(arr, ((_b2 = this.configuration) == null ? void 0 : _b2.order) ?? "C");
150235
+ return convert_array_order(arr, __privateGet(this, _inverseOrder));
150040
150236
  }
150041
150237
  decode(arr) {
150042
- return arr;
150238
+ return {
150239
+ data: arr.data,
150240
+ shape: arr.shape,
150241
+ stride: get_strides(arr.shape, __privateGet(this, _order))
150242
+ };
150043
150243
  }
150044
- }
150244
+ };
150245
+ let TransposeCodec = _TransposeCodec;
150246
+ _order = new WeakMap();
150247
+ _inverseOrder = new WeakMap();
150045
150248
  const _VLenUTF8 = class {
150046
150249
  constructor(shape) {
150047
150250
  __publicField(this, "kind", "array_to_bytes");
150048
150251
  __privateAdd(this, _shape2, void 0);
150049
- __privateAdd(this, _strides2, void 0);
150252
+ __privateAdd(this, _strides, void 0);
150050
150253
  __privateSet(this, _shape2, shape);
150051
- __privateSet(this, _strides2, get_strides(shape, "C"));
150254
+ __privateSet(this, _strides, get_strides(shape, "C"));
150052
150255
  }
150053
150256
  static fromConfig(_, meta2) {
150054
150257
  return new _VLenUTF8(meta2.shape);
@@ -150067,14 +150270,14 @@ const _VLenUTF8 = class {
150067
150270
  data[i2] = decoder.decode(bytes.buffer.slice(pos, pos + item_length));
150068
150271
  pos += item_length;
150069
150272
  }
150070
- return { data, shape: __privateGet(this, _shape2), stride: __privateGet(this, _strides2) };
150273
+ return { data, shape: __privateGet(this, _shape2), stride: __privateGet(this, _strides) };
150071
150274
  }
150072
150275
  };
150073
150276
  let VLenUTF8 = _VLenUTF8;
150074
150277
  _shape2 = new WeakMap();
150075
- _strides2 = new WeakMap();
150278
+ _strides = new WeakMap();
150076
150279
  function create_default_registry() {
150077
- return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-537fd004.js").then((m) => m.default)).set("gzip", () => import("./gzip-6a24f0fe.js").then((m) => m.default)).set("lz4", () => import("./lz4-bbd18009.js").then((m) => m.default)).set("zlib", () => import("./zlib-175cd38d.js").then((m) => m.default)).set("zstd", () => import("./zstd-ec5a40b8.js").then((m) => m.default)).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec);
150280
+ return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-537fd004.js").then((m) => m.default)).set("gzip", () => import("./gzip-6a24f0fe.js").then((m) => m.default)).set("lz4", () => import("./lz4-bbd18009.js").then((m) => m.default)).set("zlib", () => import("./zlib-175cd38d.js").then((m) => m.default)).set("zstd", () => import("./zstd-561fda0e.js").then((m) => m.default)).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec).set("bitround", () => BitroundCodec);
150078
150281
  }
150079
150282
  const registry = create_default_registry();
150080
150283
  function create_codec_pipeline(chunk_metadata) {
@@ -150110,9 +150313,7 @@ async function load_codecs(chunk_meta) {
150110
150313
  let promises = chunk_meta.codecs.map(async (meta2) => {
150111
150314
  var _a3;
150112
150315
  let Codec = await ((_a3 = registry.get(meta2.name)) == null ? void 0 : _a3());
150113
- if (!Codec) {
150114
- throw new Error(`Unknown codec: ${meta2.name}`);
150115
- }
150316
+ assert$2(Codec, `Unknown codec: ${meta2.name}`);
150116
150317
  return { Codec, meta: meta2 };
150117
150318
  });
150118
150319
  let array_to_array = [];
@@ -150132,9 +150333,7 @@ async function load_codecs(chunk_meta) {
150132
150333
  }
150133
150334
  }
150134
150335
  if (!array_to_bytes) {
150135
- if (!is_typed_array_like_meta(chunk_meta)) {
150136
- throw new Error(`Cannot encode ${chunk_meta.data_type} to bytes without a codec`);
150137
- }
150336
+ assert$2(is_typed_array_like_meta(chunk_meta), `Cannot encode ${chunk_meta.data_type} to bytes without a codec`);
150138
150337
  array_to_bytes = BytesCodec.fromConfig({ endian: "little" }, chunk_meta);
150139
150338
  }
150140
150339
  return { array_to_array, array_to_bytes, bytes_to_bytes };
@@ -150144,9 +150343,7 @@ function is_typed_array_like_meta(meta2) {
150144
150343
  }
150145
150344
  const MAX_BIG_UINT = 18446744073709551615n;
150146
150345
  function create_sharded_chunk_getter(location, shard_shape, encode_shard_key, sharding_config) {
150147
- if (location.store.getRange === void 0) {
150148
- throw new Error("Store does not support range requests");
150149
- }
150346
+ assert$2(location.store.getRange, "Store does not support range requests");
150150
150347
  let get_range = location.store.getRange.bind(location.store);
150151
150348
  let index_shape = shard_shape.map((d, i2) => d / sharding_config.chunk_shape[i2]);
150152
150349
  let index_codec = create_codec_pipeline({
@@ -150212,6 +150409,11 @@ class Group extends Location {
150212
150409
  }
150213
150410
  }
150214
150411
  _metadata = new WeakMap();
150412
+ function get_array_order(codecs) {
150413
+ var _a3;
150414
+ const maybe_transpose_codec = codecs.find((c) => c.name === "transpose");
150415
+ return ((_a3 = maybe_transpose_codec == null ? void 0 : maybe_transpose_codec.configuration) == null ? void 0 : _a3.order) ?? "C";
150416
+ }
150215
150417
  const CONTEXT_MARKER = Symbol("zarrita.context");
150216
150418
  function get_context(obj) {
150217
150419
  return obj[CONTEXT_MARKER];
@@ -150234,8 +150436,8 @@ function create_context(location, metadata) {
150234
150436
  shape: configuration.chunk_shape,
150235
150437
  codecs: configuration.codecs
150236
150438
  }),
150237
- get_strides(shape, order) {
150238
- return get_strides(shape, order ?? native_order2);
150439
+ get_strides(shape) {
150440
+ return get_strides(shape, native_order2);
150239
150441
  },
150240
150442
  get_chunk_bytes: create_sharded_chunk_getter(location, metadata.chunk_grid.configuration.chunk_shape, shared_context.encode_chunk_key, configuration)
150241
150443
  };
@@ -150250,8 +150452,8 @@ function create_context(location, metadata) {
150250
150452
  shape: metadata.chunk_grid.configuration.chunk_shape,
150251
150453
  codecs: metadata.codecs
150252
150454
  }),
150253
- get_strides(shape, order) {
150254
- return get_strides(shape, order ?? native_order);
150455
+ get_strides(shape) {
150456
+ return get_strides(shape, native_order);
150255
150457
  },
150256
150458
  async get_chunk_bytes(chunk_coords, options) {
150257
150459
  let chunk_key = shared_context.encode_chunk_key(chunk_coords);
@@ -150354,9 +150556,8 @@ async function open_v2(location, options = {}) {
150354
150556
  if (options.kind === "group")
150355
150557
  return open_group_v2(loc, attrs);
150356
150558
  return open_array_v2(loc, attrs).catch((err2) => {
150357
- if (err2 instanceof NodeNotFoundError)
150358
- return open_group_v2(loc, attrs);
150359
- throw err2;
150559
+ rethrow_unless(err2, NodeNotFoundError);
150560
+ return open_group_v2(loc, attrs);
150360
150561
  });
150361
150562
  }
150362
150563
  async function open_array_v2(location, attrs) {
@@ -150414,10 +150615,8 @@ async function open(location, options = {}) {
150414
150615
  let open_primary = version_max === "v2" ? open.v2 : open.v3;
150415
150616
  let open_secondary = version_max === "v2" ? open.v3 : open.v2;
150416
150617
  return open_primary(location, options).catch((err2) => {
150417
- if (err2 instanceof NodeNotFoundError) {
150418
- return open_secondary(location, options);
150419
- }
150420
- throw err2;
150618
+ rethrow_unless(err2, NodeNotFoundError);
150619
+ return open_secondary(location, options);
150421
150620
  });
150422
150621
  }
150423
150622
  open.v2 = open_v2;
@@ -150655,7 +150854,7 @@ async function get$1(arr, selection, opts2, setter2) {
150655
150854
  shape: arr.shape,
150656
150855
  chunk_shape: arr.chunks
150657
150856
  });
150658
- let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a2, b) => a2 * b, 1)), indexer.shape, context.get_strides(indexer.shape, opts2.order));
150857
+ let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a2, b) => a2 * b, 1)), indexer.shape, context.get_strides(indexer.shape));
150659
150858
  let queue = ((_a3 = opts2.create_queue) == null ? void 0 : _a3.call(opts2)) ?? create_queue();
150660
150859
  for (const { chunk_coords, mapping } of indexer) {
150661
150860
  queue.add(async () => {
@@ -150853,6 +151052,10 @@ function merge_init(storeOverrides, requestOverrides) {
150853
151052
  }
150854
151053
  };
150855
151054
  }
151055
+ function assert$1(expression, msg = "") {
151056
+ if (!expression)
151057
+ throw new Error(msg);
151058
+ }
150856
151059
  function resolve(root2, path) {
150857
151060
  const base = typeof root2 === "string" ? new URL(root2) : root2;
150858
151061
  if (!base.pathname.endsWith("/")) {
@@ -150863,7 +151066,7 @@ function resolve(root2, path) {
150863
151066
  return resolved;
150864
151067
  }
150865
151068
  async function handle_response(response) {
150866
- if (response.status === 404 || response.status === 403) {
151069
+ if (response.status === 404) {
150867
151070
  return void 0;
150868
151071
  }
150869
151072
  if (response.status === 200 || response.status === 206) {
@@ -151798,9 +152001,7 @@ class HTTPRangeReader {
151798
152001
  ...__privateGet(this, _overrides2),
151799
152002
  method: "HEAD"
151800
152003
  });
151801
- if (!req.ok) {
151802
- throw new Error(`failed http request ${this.url}, status: ${req.status}: ${req.statusText}`);
151803
- }
152004
+ assert$1(req.ok, `failed http request ${this.url}, status: ${req.status}: ${req.statusText}`);
151804
152005
  this.length = Number(req.headers.get("content-length"));
151805
152006
  if (Number.isNaN(this.length)) {
151806
152007
  throw Error("could not get length");
@@ -151813,9 +152014,7 @@ class HTTPRangeReader {
151813
152014
  return new Uint8Array(0);
151814
152015
  }
151815
152016
  const req = await fetch_range(this.url, offset, size2, __privateGet(this, _overrides2));
151816
- if (!req.ok) {
151817
- throw new Error(`failed http request ${this.url}, status: ${req.status} offset: ${offset} size: ${size2}: ${req.statusText}`);
151818
- }
152017
+ assert$1(req.ok, `failed http request ${this.url}, status: ${req.status} offset: ${offset} size: ${size2}: ${req.statusText}`);
151819
152018
  return new Uint8Array(await req.arrayBuffer());
151820
152019
  }
151821
152020
  }
@@ -152105,6 +152304,25 @@ _refs = new WeakMap();
152105
152304
  _opts = new WeakMap();
152106
152305
  _overrides3 = new WeakMap();
152107
152306
  const ReferenceStore$1 = ReferenceStore;
152307
+ class RelaxedFetchStore extends FetchStore$1 {
152308
+ // This allows returning `undefined` for 403 responses,
152309
+ // as opposed to completely erroring.
152310
+ // Needed due to https://github.com/manzt/zarrita.js/pull/212
152311
+ // In the future, perhaps we could contribute a way to pass a
152312
+ // custom error handling function or additional options
152313
+ // to the zarrita FetchStore so that a subclass is not required.
152314
+ async get(key, options = {}) {
152315
+ var _a3;
152316
+ try {
152317
+ return await super.get(key, options);
152318
+ } catch (e2) {
152319
+ if (((_a3 = e2 == null ? void 0 : e2.message) == null ? void 0 : _a3.startsWith("Unexpected response status 403")) && !getDebugMode()) {
152320
+ return void 0;
152321
+ }
152322
+ throw e2;
152323
+ }
152324
+ }
152325
+ }
152108
152326
  function zarrOpenRoot(url, fileType, opts2) {
152109
152327
  let store;
152110
152328
  if (fileType && fileType.endsWith(".zip")) {
@@ -152126,7 +152344,7 @@ function zarrOpenRoot(url, fileType, opts2) {
152126
152344
  ));
152127
152345
  store = ReferenceStore$1.fromSpec(referenceSpecPromise, { target: url, overrides: opts2 == null ? void 0 : opts2.requestInit });
152128
152346
  } else {
152129
- store = new FetchStore$1(url, { overrides: opts2 == null ? void 0 : opts2.requestInit });
152347
+ store = new RelaxedFetchStore(url, { overrides: opts2 == null ? void 0 : opts2.requestInit });
152130
152348
  }
152131
152349
  return root(store);
152132
152350
  }
@@ -152298,7 +152516,7 @@ async function initLoader(imageData) {
152298
152516
  const { metadata: loaderMetadata } = loader;
152299
152517
  const { omero, multiscales } = loaderMetadata;
152300
152518
  if (!Array.isArray(multiscales) || multiscales.length === 0) {
152301
- console.error("Multiscales array must exist and have at least one element");
152519
+ log$6.error("Multiscales array must exist and have at least one element");
152302
152520
  }
152303
152521
  const { coordinateTransformations } = multiscales[0];
152304
152522
  const axes = getNgffAxes(multiscales[0].axes);
@@ -152390,7 +152608,7 @@ class RasterJsonAsImageLoader extends RasterLoader {
152390
152608
  }
152391
152609
  });
152392
152610
  if (!(coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer)) {
152393
- console.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsImageLoader. This may be an indicator that the image could not be loaded.");
152611
+ log$6.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsImageLoader. This may be an indicator that the image could not be loaded.");
152394
152612
  }
152395
152613
  return new LoaderResult(
152396
152614
  {
@@ -152426,7 +152644,7 @@ class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
152426
152644
  }
152427
152645
  });
152428
152646
  if (!(coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer)) {
152429
- console.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsObsSegmentationsLoader. This may be an indicator that the image could not be loaded.");
152647
+ log$6.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsObsSegmentationsLoader. This may be an indicator that the image could not be loaded.");
152430
152648
  }
152431
152649
  return new LoaderResult(
152432
152650
  loaders.length > 0 && meta2.length > 0 ? {