@vitessce/zarr 3.6.18 → 3.7.1

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.
package/dist/index.js CHANGED
@@ -1,12 +1,3 @@
1
- var __typeError = (msg) => {
2
- throw TypeError(msg);
3
- };
4
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
5
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
6
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
7
- var __privateSet = (obj, member, value, setter2) => (__accessCheck(obj, member, "write to private field"), setter2 ? setter2.call(obj, value) : member.set(obj, value), value);
8
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
9
- var _overrides, _use_suffix_request, _FetchStore_instances, merge_init_fn, _bytes, _encoder, _data, _stride, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _encoder_config, _decoder_config, _order, _inverseOrder, _shape2, _strides, _metadata, _metadata2, _a2, _overrides2, _refs, _opts, _overrides3;
10
1
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
11
2
  function getDefaultExportFromCjs(x) {
12
3
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -16,7 +7,12 @@ function getAugmentedNamespace(n) {
16
7
  var f = n.default;
17
8
  if (typeof f == "function") {
18
9
  var a = function a2() {
19
- if (this instanceof a2) {
10
+ var isInstance = false;
11
+ try {
12
+ isInstance = this instanceof a2;
13
+ } catch {
14
+ }
15
+ if (isInstance) {
20
16
  return Reflect.construct(f, arguments, this.constructor);
21
17
  }
22
18
  return f.apply(this, arguments);
@@ -366,72 +362,68 @@ async function fetch_suffix(url, suffix_length, init, use_suffix_request) {
366
362
  return fetch_range(url, length - suffix_length, length, init);
367
363
  }
368
364
  class FetchStore {
365
+ #overrides;
366
+ #use_suffix_request;
369
367
  constructor(url, options = {}) {
370
- __privateAdd(this, _FetchStore_instances);
371
- __privateAdd(this, _overrides);
372
- __privateAdd(this, _use_suffix_request);
373
368
  this.url = url;
374
- __privateSet(this, _overrides, options.overrides ?? {});
375
- __privateSet(this, _use_suffix_request, options.useSuffixRequest ?? false);
369
+ this.#overrides = options.overrides ?? {};
370
+ this.#use_suffix_request = options.useSuffixRequest ?? false;
371
+ }
372
+ #merge_init(overrides) {
373
+ return merge_init(this.#overrides, overrides);
376
374
  }
377
375
  async get(key, options = {}) {
378
376
  let href = resolve(this.url, key).href;
379
- let response = await fetch(href, __privateMethod(this, _FetchStore_instances, merge_init_fn).call(this, options));
377
+ let response = await fetch(href, this.#merge_init(options));
380
378
  return handle_response(response);
381
379
  }
382
380
  async getRange(key, range2, options = {}) {
383
381
  let url = resolve(this.url, key);
384
- let init = __privateMethod(this, _FetchStore_instances, merge_init_fn).call(this, options);
382
+ let init = this.#merge_init(options);
385
383
  let response;
386
384
  if ("suffixLength" in range2) {
387
- response = await fetch_suffix(url, range2.suffixLength, init, __privateGet(this, _use_suffix_request));
385
+ response = await fetch_suffix(url, range2.suffixLength, init, this.#use_suffix_request);
388
386
  } else {
389
387
  response = await fetch_range(url, range2.offset, range2.length, init);
390
388
  }
391
389
  return handle_response(response);
392
390
  }
393
391
  }
394
- _overrides = new WeakMap();
395
- _use_suffix_request = new WeakMap();
396
- _FetchStore_instances = new WeakSet();
397
- merge_init_fn = function(overrides) {
398
- return merge_init(__privateGet(this, _overrides), overrides);
399
- };
400
392
  class BoolArray {
393
+ #bytes;
401
394
  constructor(x, byteOffset, length) {
402
- __privateAdd(this, _bytes);
403
395
  if (typeof x === "number") {
404
- __privateSet(this, _bytes, new Uint8Array(x));
396
+ this.#bytes = new Uint8Array(x);
405
397
  } else if (x instanceof ArrayBuffer) {
406
- __privateSet(this, _bytes, new Uint8Array(x, byteOffset, length));
398
+ this.#bytes = new Uint8Array(x, byteOffset, length);
407
399
  } else {
408
- __privateSet(this, _bytes, new Uint8Array(Array.from(x, (v) => v ? 1 : 0)));
400
+ this.#bytes = new Uint8Array(Array.from(x, (v) => v ? 1 : 0));
409
401
  }
410
402
  }
411
403
  get BYTES_PER_ELEMENT() {
412
404
  return 1;
413
405
  }
414
406
  get byteOffset() {
415
- return __privateGet(this, _bytes).byteOffset;
407
+ return this.#bytes.byteOffset;
416
408
  }
417
409
  get byteLength() {
418
- return __privateGet(this, _bytes).byteLength;
410
+ return this.#bytes.byteLength;
419
411
  }
420
412
  get buffer() {
421
- return __privateGet(this, _bytes).buffer;
413
+ return this.#bytes.buffer;
422
414
  }
423
415
  get length() {
424
- return __privateGet(this, _bytes).length;
416
+ return this.#bytes.length;
425
417
  }
426
418
  get(idx) {
427
- let value = __privateGet(this, _bytes)[idx];
419
+ let value = this.#bytes[idx];
428
420
  return typeof value === "number" ? value !== 0 : value;
429
421
  }
430
422
  set(idx, value) {
431
- __privateGet(this, _bytes)[idx] = value ? 1 : 0;
423
+ this.#bytes[idx] = value ? 1 : 0;
432
424
  }
433
425
  fill(value) {
434
- __privateGet(this, _bytes).fill(value ? 1 : 0);
426
+ this.#bytes.fill(value ? 1 : 0);
435
427
  }
436
428
  *[Symbol.iterator]() {
437
429
  for (let i = 0; i < this.length; i++) {
@@ -439,12 +431,11 @@ class BoolArray {
439
431
  }
440
432
  }
441
433
  }
442
- _bytes = new WeakMap();
443
434
  class ByteStringArray {
435
+ #encoder;
444
436
  constructor(chars, x, byteOffset, length) {
445
- __privateAdd(this, _encoder);
446
437
  this.chars = chars;
447
- __privateSet(this, _encoder, new TextEncoder());
438
+ this.#encoder = new TextEncoder();
448
439
  if (typeof x === "number") {
449
440
  this._data = new Uint8Array(x * chars);
450
441
  } else if (x instanceof ArrayBuffer) {
@@ -481,10 +472,10 @@ class ByteStringArray {
481
472
  set(idx, value) {
482
473
  const view = new Uint8Array(this.buffer, this.byteOffset + this.chars * idx, this.chars);
483
474
  view.fill(0);
484
- view.set(__privateGet(this, _encoder).encode(value));
475
+ view.set(this.#encoder.encode(value));
485
476
  }
486
477
  fill(value) {
487
- const encoded = __privateGet(this, _encoder).encode(value);
478
+ const encoded = this.#encoder.encode(value);
488
479
  for (let i = 0; i < this.length; i++) {
489
480
  this._data.set(encoded, i * this.chars);
490
481
  }
@@ -495,54 +486,53 @@ class ByteStringArray {
495
486
  }
496
487
  }
497
488
  }
498
- _encoder = new WeakMap();
499
- const _UnicodeStringArray = class _UnicodeStringArray {
489
+ class UnicodeStringArray {
490
+ #data;
500
491
  constructor(chars, x, byteOffset, length) {
501
- __privateAdd(this, _data);
502
492
  this.chars = chars;
503
493
  if (typeof x === "number") {
504
- __privateSet(this, _data, new Int32Array(x * chars));
494
+ this.#data = new Int32Array(x * chars);
505
495
  } else if (x instanceof ArrayBuffer) {
506
496
  if (length)
507
497
  length *= chars;
508
- __privateSet(this, _data, new Int32Array(x, byteOffset, length));
498
+ this.#data = new Int32Array(x, byteOffset, length);
509
499
  } else {
510
500
  const values = x;
511
- const d = new _UnicodeStringArray(chars, 1);
512
- __privateSet(this, _data, new Int32Array(function* () {
501
+ const d = new UnicodeStringArray(chars, 1);
502
+ this.#data = new Int32Array(function* () {
513
503
  for (let str of values) {
514
504
  d.set(0, str);
515
- yield* __privateGet(d, _data);
505
+ yield* d.#data;
516
506
  }
517
- }()));
507
+ }());
518
508
  }
519
509
  }
520
510
  get BYTES_PER_ELEMENT() {
521
- return __privateGet(this, _data).BYTES_PER_ELEMENT * this.chars;
511
+ return this.#data.BYTES_PER_ELEMENT * this.chars;
522
512
  }
523
513
  get byteLength() {
524
- return __privateGet(this, _data).byteLength;
514
+ return this.#data.byteLength;
525
515
  }
526
516
  get byteOffset() {
527
- return __privateGet(this, _data).byteOffset;
517
+ return this.#data.byteOffset;
528
518
  }
529
519
  get buffer() {
530
- return __privateGet(this, _data).buffer;
520
+ return this.#data.buffer;
531
521
  }
532
522
  get length() {
533
- return __privateGet(this, _data).length / this.chars;
523
+ return this.#data.length / this.chars;
534
524
  }
535
525
  get(idx) {
536
526
  const offset = this.chars * idx;
537
527
  let result = "";
538
528
  for (let i = 0; i < this.chars; i++) {
539
- result += String.fromCodePoint(__privateGet(this, _data)[offset + i]);
529
+ result += String.fromCodePoint(this.#data[offset + i]);
540
530
  }
541
531
  return result.replace(/\u0000/g, "");
542
532
  }
543
533
  set(idx, value) {
544
534
  const offset = this.chars * idx;
545
- const view = __privateGet(this, _data).subarray(offset, offset + this.chars);
535
+ const view = this.#data.subarray(offset, offset + this.chars);
546
536
  view.fill(0);
547
537
  for (let i = 0; i < this.chars; i++) {
548
538
  view[i] = value.codePointAt(i) ?? 0;
@@ -550,9 +540,9 @@ const _UnicodeStringArray = class _UnicodeStringArray {
550
540
  }
551
541
  fill(value) {
552
542
  this.set(0, value);
553
- let encoded = __privateGet(this, _data).subarray(0, this.chars);
543
+ let encoded = this.#data.subarray(0, this.chars);
554
544
  for (let i = 1; i < this.length; i++) {
555
- __privateGet(this, _data).set(encoded, i * this.chars);
545
+ this.#data.set(encoded, i * this.chars);
556
546
  }
557
547
  }
558
548
  *[Symbol.iterator]() {
@@ -560,9 +550,7 @@ const _UnicodeStringArray = class _UnicodeStringArray {
560
550
  yield this.get(i);
561
551
  }
562
552
  }
563
- };
564
- _data = new WeakMap();
565
- let UnicodeStringArray = _UnicodeStringArray;
553
+ }
566
554
  function json_decode_object(bytes) {
567
555
  const str = new TextDecoder().decode(bytes);
568
556
  return JSON.parse(str);
@@ -621,11 +609,11 @@ function get_strides(shape, order) {
621
609
  }
622
610
  function create_chunk_key_encoder({ name, configuration }) {
623
611
  if (name === "default") {
624
- const separator = (configuration == null ? void 0 : configuration.separator) ?? "/";
612
+ const separator = configuration?.separator ?? "/";
625
613
  return (chunk_coords) => ["c", ...chunk_coords].join(separator);
626
614
  }
627
615
  if (name === "v2") {
628
- const separator = (configuration == null ? void 0 : configuration.separator) ?? ".";
616
+ const separator = configuration?.separator ?? ".";
629
617
  return (chunk_coords) => chunk_coords.join(separator) || "0";
630
618
  }
631
619
  throw new Error(`Unknown chunk key encoding: ${name}`);
@@ -721,7 +709,7 @@ function is_dtype(dtype, query) {
721
709
  return !is_string && !is_bigint && !is_boolean && !is_object;
722
710
  }
723
711
  function is_sharding_codec(codec) {
724
- return (codec == null ? void 0 : codec.name) === "sharding_indexed";
712
+ return codec?.name === "sharding_indexed";
725
713
  }
726
714
  function ensure_correct_scalar(metadata) {
727
715
  if ((metadata.data_type === "uint64" || metadata.data_type === "int64") && metadata.fill_value != null) {
@@ -747,7 +735,7 @@ async function decompress(data, { format, signal }) {
747
735
  const buffer = await decompressedResponse.arrayBuffer();
748
736
  return buffer;
749
737
  } catch {
750
- signal == null ? void 0 : signal.throwIfAborted();
738
+ signal?.throwIfAborted();
751
739
  throw new Error(`Failed to decode ${format}`);
752
740
  }
753
741
  }
@@ -787,48 +775,42 @@ function bytes_per_element(TypedArray) {
787
775
  }
788
776
  return 4;
789
777
  }
790
- const _BytesCodec = class _BytesCodec {
778
+ class BytesCodec {
791
779
  constructor(configuration, meta) {
792
- __privateAdd(this, _stride);
793
- __privateAdd(this, _TypedArray);
794
- __privateAdd(this, _BYTES_PER_ELEMENT);
795
- __privateAdd(this, _shape);
796
- __privateAdd(this, _endian);
797
780
  this.kind = "array_to_bytes";
798
- __privateSet(this, _endian, configuration == null ? void 0 : configuration.endian);
799
- __privateSet(this, _TypedArray, get_ctr(meta.data_type));
800
- __privateSet(this, _shape, meta.shape);
801
- __privateSet(this, _stride, get_strides(meta.shape, "C"));
802
- const sample = new (__privateGet(this, _TypedArray))(0);
803
- __privateSet(this, _BYTES_PER_ELEMENT, sample.BYTES_PER_ELEMENT);
804
- }
781
+ this.#endian = configuration?.endian;
782
+ this.#TypedArray = get_ctr(meta.data_type);
783
+ this.#shape = meta.shape;
784
+ this.#stride = get_strides(meta.shape, "C");
785
+ const sample = new this.#TypedArray(0);
786
+ this.#BYTES_PER_ELEMENT = sample.BYTES_PER_ELEMENT;
787
+ }
788
+ #stride;
789
+ #TypedArray;
790
+ #BYTES_PER_ELEMENT;
791
+ #shape;
792
+ #endian;
805
793
  static fromConfig(configuration, meta) {
806
- return new _BytesCodec(configuration, meta);
794
+ return new BytesCodec(configuration, meta);
807
795
  }
808
796
  encode(arr) {
809
797
  let bytes = new Uint8Array(arr.data.buffer);
810
- if (LITTLE_ENDIAN_OS && __privateGet(this, _endian) === "big") {
811
- byteswap_inplace(bytes, bytes_per_element(__privateGet(this, _TypedArray)));
798
+ if (LITTLE_ENDIAN_OS && this.#endian === "big") {
799
+ byteswap_inplace(bytes, bytes_per_element(this.#TypedArray));
812
800
  }
813
801
  return bytes;
814
802
  }
815
803
  decode(bytes) {
816
- if (LITTLE_ENDIAN_OS && __privateGet(this, _endian) === "big") {
817
- byteswap_inplace(bytes, bytes_per_element(__privateGet(this, _TypedArray)));
804
+ if (LITTLE_ENDIAN_OS && this.#endian === "big") {
805
+ byteswap_inplace(bytes, bytes_per_element(this.#TypedArray));
818
806
  }
819
807
  return {
820
- data: new (__privateGet(this, _TypedArray))(bytes.buffer, bytes.byteOffset, bytes.byteLength / __privateGet(this, _BYTES_PER_ELEMENT)),
821
- shape: __privateGet(this, _shape),
822
- stride: __privateGet(this, _stride)
808
+ data: new this.#TypedArray(bytes.buffer, bytes.byteOffset, bytes.byteLength / this.#BYTES_PER_ELEMENT),
809
+ shape: this.#shape,
810
+ stride: this.#stride
823
811
  };
824
812
  }
825
- };
826
- _stride = new WeakMap();
827
- _TypedArray = new WeakMap();
828
- _BYTES_PER_ELEMENT = new WeakMap();
829
- _shape = new WeakMap();
830
- _endian = new WeakMap();
831
- let BytesCodec = _BytesCodec;
813
+ }
832
814
  class Crc32cCodec {
833
815
  constructor() {
834
816
  this.kind = "bytes_to_bytes";
@@ -850,7 +832,7 @@ class GzipCodec {
850
832
  static fromConfig(_) {
851
833
  return new GzipCodec();
852
834
  }
853
- encode(_bytes2) {
835
+ encode(_bytes) {
854
836
  throw new Error("Gzip encoding is not enabled by default. Please register a custom codec with `numcodecs/gzip`.");
855
837
  }
856
838
  async decode(bytes) {
@@ -870,10 +852,8 @@ function sort_keys_replacer(_key, value) {
870
852
  return sorted;
871
853
  }, {}) : value;
872
854
  }
873
- const _JsonCodec = class _JsonCodec {
855
+ class JsonCodec {
874
856
  constructor(configuration = {}) {
875
- __privateAdd(this, _encoder_config);
876
- __privateAdd(this, _decoder_config);
877
857
  this.kind = "array_to_bytes";
878
858
  this.configuration = configuration;
879
859
  const { encoding = "utf-8", skipkeys = false, ensure_ascii = true, check_circular = true, allow_nan = true, sort_keys = true, indent, strict = true } = configuration;
@@ -885,7 +865,7 @@ const _JsonCodec = class _JsonCodec {
885
865
  separators = [", ", ": "];
886
866
  }
887
867
  }
888
- __privateSet(this, _encoder_config, {
868
+ this.#encoder_config = {
889
869
  encoding,
890
870
  skipkeys,
891
871
  ensure_ascii,
@@ -894,14 +874,16 @@ const _JsonCodec = class _JsonCodec {
894
874
  indent,
895
875
  separators,
896
876
  sort_keys
897
- });
898
- __privateSet(this, _decoder_config, { strict });
877
+ };
878
+ this.#decoder_config = { strict };
899
879
  }
880
+ #encoder_config;
881
+ #decoder_config;
900
882
  static fromConfig(configuration) {
901
- return new _JsonCodec(configuration);
883
+ return new JsonCodec(configuration);
902
884
  }
903
885
  encode(buf) {
904
- const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = __privateGet(this, _encoder_config);
886
+ const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = this.#encoder_config;
905
887
  assert(encoding === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
906
888
  const replacer_functions = [];
907
889
  assert(check_circular, "JsonCodec does not yet support skipping the check for circular references during encoding.");
@@ -935,7 +917,7 @@ const _JsonCodec = class _JsonCodec {
935
917
  return new TextEncoder().encode(json_str);
936
918
  }
937
919
  decode(bytes) {
938
- const { strict } = __privateGet(this, _decoder_config);
920
+ const { strict } = this.#decoder_config;
939
921
  assert(strict, "JsonCodec does not yet support non-strict decoding.");
940
922
  const items = json_decode_object(bytes);
941
923
  const shape = items.pop();
@@ -945,10 +927,7 @@ const _JsonCodec = class _JsonCodec {
945
927
  const data = items;
946
928
  return { data, shape, stride };
947
929
  }
948
- };
949
- _encoder_config = new WeakMap();
950
- _decoder_config = new WeakMap();
951
- let JsonCodec = _JsonCodec;
930
+ }
952
931
  function proxy(arr) {
953
932
  if (arr instanceof BoolArray || arr instanceof ByteStringArray || arr instanceof UnicodeStringArray) {
954
933
  const arrp = new Proxy(arr, {
@@ -1017,10 +996,8 @@ function matches_order(chunk, target) {
1017
996
  assert(source.length === target.length, "Orders must match");
1018
997
  return source.every((dim, i) => dim === target[i]);
1019
998
  }
1020
- const _TransposeCodec = class _TransposeCodec {
999
+ class TransposeCodec {
1021
1000
  constructor(configuration, meta) {
1022
- __privateAdd(this, _order);
1023
- __privateAdd(this, _inverseOrder);
1024
1001
  this.kind = "array_to_array";
1025
1002
  let value = configuration.order ?? "C";
1026
1003
  let rank = meta.shape.length;
@@ -1043,39 +1020,38 @@ const _TransposeCodec = class _TransposeCodec {
1043
1020
  inverseOrder[x] = i;
1044
1021
  });
1045
1022
  }
1046
- __privateSet(this, _order, order);
1047
- __privateSet(this, _inverseOrder, inverseOrder);
1023
+ this.#order = order;
1024
+ this.#inverseOrder = inverseOrder;
1048
1025
  }
1026
+ #order;
1027
+ #inverseOrder;
1049
1028
  static fromConfig(configuration, meta) {
1050
- return new _TransposeCodec(configuration, meta);
1029
+ return new TransposeCodec(configuration, meta);
1051
1030
  }
1052
1031
  encode(arr) {
1053
- if (matches_order(arr, __privateGet(this, _inverseOrder))) {
1032
+ if (matches_order(arr, this.#inverseOrder)) {
1054
1033
  return arr;
1055
1034
  }
1056
- return convert_array_order(arr, __privateGet(this, _inverseOrder));
1035
+ return convert_array_order(arr, this.#inverseOrder);
1057
1036
  }
1058
1037
  decode(arr) {
1059
1038
  return {
1060
1039
  data: arr.data,
1061
1040
  shape: arr.shape,
1062
- stride: get_strides(arr.shape, __privateGet(this, _order))
1041
+ stride: get_strides(arr.shape, this.#order)
1063
1042
  };
1064
1043
  }
1065
- };
1066
- _order = new WeakMap();
1067
- _inverseOrder = new WeakMap();
1068
- let TransposeCodec = _TransposeCodec;
1069
- const _VLenUTF8 = class _VLenUTF8 {
1044
+ }
1045
+ class VLenUTF8 {
1070
1046
  constructor(shape) {
1071
- __privateAdd(this, _shape2);
1072
- __privateAdd(this, _strides);
1073
1047
  this.kind = "array_to_bytes";
1074
- __privateSet(this, _shape2, shape);
1075
- __privateSet(this, _strides, get_strides(shape, "C"));
1048
+ this.#shape = shape;
1049
+ this.#strides = get_strides(shape, "C");
1076
1050
  }
1051
+ #shape;
1052
+ #strides;
1077
1053
  static fromConfig(_, meta) {
1078
- return new _VLenUTF8(meta.shape);
1054
+ return new VLenUTF8(meta.shape);
1079
1055
  }
1080
1056
  encode(_chunk) {
1081
1057
  throw new Error("Method not implemented.");
@@ -1091,12 +1067,9 @@ const _VLenUTF8 = class _VLenUTF8 {
1091
1067
  data[i] = decoder.decode(bytes.buffer.slice(pos, pos + item_length));
1092
1068
  pos += item_length;
1093
1069
  }
1094
- return { data, shape: __privateGet(this, _shape2), stride: __privateGet(this, _strides) };
1070
+ return { data, shape: this.#shape, stride: this.#strides };
1095
1071
  }
1096
- };
1097
- _shape2 = new WeakMap();
1098
- _strides = new WeakMap();
1099
- let VLenUTF8 = _VLenUTF8;
1072
+ }
1100
1073
  class ZlibCodec {
1101
1074
  constructor() {
1102
1075
  this.kind = "bytes_to_bytes";
@@ -1104,7 +1077,7 @@ class ZlibCodec {
1104
1077
  static fromConfig(_) {
1105
1078
  return new ZlibCodec();
1106
1079
  }
1107
- encode(_bytes2) {
1080
+ encode(_bytes) {
1108
1081
  throw new Error("Zlib encoding is not enabled by default. Please register a codec with `numcodecs/zlib`.");
1109
1082
  }
1110
1083
  async decode(bytes) {
@@ -1113,7 +1086,7 @@ class ZlibCodec {
1113
1086
  }
1114
1087
  }
1115
1088
  function create_default_registry() {
1116
- return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-B8fjEpk7.js").then((m) => m.default)).set("lz4", () => import("./lz4-C9lm_i9S.js").then((m) => m.default)).set("zstd", () => import("./zstd-y75FARxZ.js").then((m) => m.default)).set("gzip", () => GzipCodec).set("zlib", () => ZlibCodec).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec).set("bitround", () => BitroundCodec);
1089
+ return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-DvQQ1ST0.js").then((m) => m.default)).set("lz4", () => import("./lz4-BIbM36RN.js").then((m) => m.default)).set("zstd", () => import("./zstd-CO575QiM.js").then((m) => m.default)).set("gzip", () => GzipCodec).set("zlib", () => ZlibCodec).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec).set("bitround", () => BitroundCodec);
1117
1090
  }
1118
1091
  const registry = create_default_registry();
1119
1092
  function create_codec_pipeline(chunk_metadata) {
@@ -1147,8 +1120,7 @@ function create_codec_pipeline(chunk_metadata) {
1147
1120
  }
1148
1121
  async function load_codecs(chunk_meta) {
1149
1122
  let promises = chunk_meta.codecs.map(async (meta) => {
1150
- var _a3;
1151
- let Codec = await ((_a3 = registry.get(meta.name)) == null ? void 0 : _a3());
1123
+ let Codec = await registry.get(meta.name)?.();
1152
1124
  assert(Codec, `Unknown codec: ${meta.name}`);
1153
1125
  return { Codec, meta };
1154
1126
  });
@@ -1247,19 +1219,17 @@ function root$1(store) {
1247
1219
  class Group extends Location {
1248
1220
  constructor(store, path, metadata) {
1249
1221
  super(store, path);
1250
- __privateAdd(this, _metadata);
1251
1222
  this.kind = "group";
1252
- __privateSet(this, _metadata, metadata);
1223
+ this.#metadata = metadata;
1253
1224
  }
1225
+ #metadata;
1254
1226
  get attrs() {
1255
- return __privateGet(this, _metadata).attributes;
1227
+ return this.#metadata.attributes;
1256
1228
  }
1257
1229
  }
1258
- _metadata = new WeakMap();
1259
1230
  function get_array_order(codecs) {
1260
- var _a3;
1261
1231
  const maybe_transpose_codec = codecs.find((c) => c.name === "transpose");
1262
- return ((_a3 = maybe_transpose_codec == null ? void 0 : maybe_transpose_codec.configuration) == null ? void 0 : _a3.order) ?? "C";
1232
+ return maybe_transpose_codec?.configuration?.order ?? "C";
1263
1233
  }
1264
1234
  const CONTEXT_MARKER = Symbol("zarrita.context");
1265
1235
  function get_context(obj) {
@@ -1309,28 +1279,28 @@ function create_context(location, metadata) {
1309
1279
  }
1310
1280
  };
1311
1281
  }
1312
- let Array$1 = (_a2 = class extends (_a = Location, _a) {
1282
+ let Array$1 = class Array2 extends (_a = Location, _a) {
1313
1283
  constructor(store, path, metadata) {
1314
1284
  super(store, path);
1315
- __privateAdd(this, _metadata2);
1316
1285
  this.kind = "array";
1317
- __privateSet(this, _metadata2, {
1286
+ this.#metadata = {
1318
1287
  ...metadata,
1319
1288
  fill_value: ensure_correct_scalar(metadata)
1320
- });
1289
+ };
1321
1290
  this[CONTEXT_MARKER] = create_context(this, metadata);
1322
1291
  }
1292
+ #metadata;
1323
1293
  get attrs() {
1324
- return __privateGet(this, _metadata2).attributes;
1294
+ return this.#metadata.attributes;
1325
1295
  }
1326
1296
  get shape() {
1327
- return __privateGet(this, _metadata2).shape;
1297
+ return this.#metadata.shape;
1328
1298
  }
1329
1299
  get chunks() {
1330
1300
  return this[CONTEXT_MARKER].chunk_shape;
1331
1301
  }
1332
1302
  get dtype() {
1333
- return __privateGet(this, _metadata2).data_type;
1303
+ return this.#metadata.data_type;
1334
1304
  }
1335
1305
  async getChunk(chunk_coords, options) {
1336
1306
  let context = this[CONTEXT_MARKER];
@@ -1367,7 +1337,7 @@ let Array$1 = (_a2 = class extends (_a = Location, _a) {
1367
1337
  is(query) {
1368
1338
  return is_dtype(this.dtype, query);
1369
1339
  }
1370
- }, _metadata2 = new WeakMap(), _a2);
1340
+ };
1371
1341
  function* range$3(start, stop, step = 1) {
1372
1342
  if (stop === void 0) {
1373
1343
  stop = start;
@@ -1581,7 +1551,6 @@ function unwrap(arr, idx) {
1581
1551
  return "get" in arr ? arr.get(idx) : arr[idx];
1582
1552
  }
1583
1553
  async function get$1(arr, selection, opts, setter2) {
1584
- var _a3;
1585
1554
  let context = get_context(arr);
1586
1555
  let indexer = new BasicIndexer({
1587
1556
  selection,
@@ -1589,7 +1558,7 @@ async function get$1(arr, selection, opts, setter2) {
1589
1558
  chunk_shape: arr.chunks
1590
1559
  });
1591
1560
  let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a, b) => a * b, 1)), indexer.shape, context.get_strides(indexer.shape));
1592
- let queue = ((_a3 = opts.create_queue) == null ? void 0 : _a3.call(opts)) ?? create_queue();
1561
+ let queue = opts.create_queue?.() ?? create_queue();
1593
1562
  for (const { chunk_coords, mapping } of indexer) {
1594
1563
  queue.add(async () => {
1595
1564
  let { data, shape, stride } = await arr.getChunk(chunk_coords, opts.opts);
@@ -2688,15 +2657,15 @@ class BlobReader2 {
2688
2657
  }
2689
2658
  }
2690
2659
  class HTTPRangeReader {
2660
+ #overrides;
2691
2661
  constructor(url, opts = {}) {
2692
- __privateAdd(this, _overrides2);
2693
2662
  this.url = url;
2694
- __privateSet(this, _overrides2, opts.overrides ?? {});
2663
+ this.#overrides = opts.overrides ?? {};
2695
2664
  }
2696
2665
  async getLength() {
2697
2666
  if (this.length === void 0) {
2698
2667
  const req = await fetch(this.url, {
2699
- ...__privateGet(this, _overrides2),
2668
+ ...this.#overrides,
2700
2669
  method: "HEAD"
2701
2670
  });
2702
2671
  assert$1(req.ok, `failed http request ${this.url}, status: ${req.status}: ${req.statusText}`);
@@ -2711,12 +2680,11 @@ class HTTPRangeReader {
2711
2680
  if (size === 0) {
2712
2681
  return new Uint8Array(0);
2713
2682
  }
2714
- const req = await fetch_range(this.url, offset, size, __privateGet(this, _overrides2));
2683
+ const req = await fetch_range(this.url, offset, size, this.#overrides);
2715
2684
  assert$1(req.ok, `failed http request ${this.url}, status: ${req.status} offset: ${offset} size: ${size}: ${req.statusText}`);
2716
2685
  return new Uint8Array(await req.arrayBuffer());
2717
2686
  }
2718
2687
  }
2719
- _overrides2 = new WeakMap();
2720
2688
  class ZipFileStore {
2721
2689
  constructor(reader, opts = {}) {
2722
2690
  this.info = unzip(reader).then((info) => {
@@ -2763,14 +2731,13 @@ function parse$1(template, re2 = /{{(.*?)}}/) {
2763
2731
  }
2764
2732
  function matchFn(str) {
2765
2733
  const match = str.match(/(?<fname>[A-Z_][A-Z_1-9]*)\((?<args>[^)]+)\)/i);
2766
- if (!(match == null ? void 0 : match.groups)) return;
2734
+ if (!match?.groups) return;
2767
2735
  const { fname, args } = match.groups;
2768
2736
  const ctx = Object.fromEntries(
2769
2737
  args.split(",").map((kwarg) => {
2770
- var _a3;
2771
- const { key, num, str: str2 } = ((_a3 = kwarg.match(
2738
+ const { key, num, str: str2 } = kwarg.match(
2772
2739
  /(?<key>[a-z_0-9]*)\s*=\s*((?<num>[0-9.]+)|('|")(?<str>.*)('|"))/i
2773
- )) == null ? void 0 : _a3.groups) ?? {};
2740
+ )?.groups ?? {};
2774
2741
  if (!key || !(num || str2)) {
2775
2742
  throw Error(`Failed to match fn kwarg: ${kwarg}`);
2776
2743
  }
@@ -2842,7 +2809,6 @@ function parseV0(spec) {
2842
2809
  return new Map(Object.entries(spec));
2843
2810
  }
2844
2811
  function parseV1(spec, renderString) {
2845
- var _a3;
2846
2812
  const context = {};
2847
2813
  for (const [key, template] of Object.entries(spec.templates ?? {})) {
2848
2814
  if (template.includes("{{")) {
@@ -2859,7 +2825,7 @@ function parseV1(spec, renderString) {
2859
2825
  if (typeof ref === "string") {
2860
2826
  refs.set(key, ref);
2861
2827
  } else {
2862
- const url = ((_a3 = ref[0]) == null ? void 0 : _a3.includes("{{")) ? render2(ref[0]) : ref[0];
2828
+ const url = ref[0]?.includes("{{") ? render2(ref[0]) : ref[0];
2863
2829
  refs.set(key, ref.length === 1 ? [url] : [url, ref[1], ref[2]]);
2864
2830
  }
2865
2831
  }
@@ -2958,17 +2924,17 @@ function to_binary(base64) {
2958
2924
  }
2959
2925
  return bytes;
2960
2926
  }
2961
- const _ReferenceStore = class _ReferenceStore {
2927
+ class ReferenceStore {
2928
+ #refs;
2929
+ #opts;
2930
+ #overrides;
2962
2931
  constructor(refs, opts = {}) {
2963
- __privateAdd(this, _refs);
2964
- __privateAdd(this, _opts);
2965
- __privateAdd(this, _overrides3);
2966
- __privateSet(this, _refs, Promise.resolve(refs));
2967
- __privateSet(this, _opts, opts);
2968
- __privateSet(this, _overrides3, opts.overrides || {});
2932
+ this.#refs = Promise.resolve(refs);
2933
+ this.#opts = opts;
2934
+ this.#overrides = opts.overrides || {};
2969
2935
  }
2970
2936
  async get(key, opts = {}) {
2971
- let ref = (await __privateGet(this, _refs)).get(strip_prefix(key));
2937
+ let ref = (await this.#refs).get(strip_prefix(key));
2972
2938
  if (!ref)
2973
2939
  return;
2974
2940
  if (typeof ref === "string") {
@@ -2978,11 +2944,11 @@ const _ReferenceStore = class _ReferenceStore {
2978
2944
  return new TextEncoder().encode(ref);
2979
2945
  }
2980
2946
  let [urlOrNull, offset, size] = ref;
2981
- let url = urlOrNull ?? __privateGet(this, _opts).target;
2947
+ let url = urlOrNull ?? this.#opts.target;
2982
2948
  if (!url) {
2983
2949
  throw Error(`No url for key ${key}, and no target url provided.`);
2984
2950
  }
2985
- let res = await fetch_range(uri2href(url), offset, size, merge_init(__privateGet(this, _overrides3), opts));
2951
+ let res = await fetch_range(uri2href(url), offset, size, merge_init(this.#overrides, opts));
2986
2952
  if (res.status === 200 || res.status === 206) {
2987
2953
  return new Uint8Array(await res.arrayBuffer());
2988
2954
  }
@@ -2990,17 +2956,13 @@ const _ReferenceStore = class _ReferenceStore {
2990
2956
  }
2991
2957
  static fromSpec(spec, opts) {
2992
2958
  let refs = Promise.resolve(spec).then((spec2) => parse(spec2));
2993
- return new _ReferenceStore(refs, opts);
2959
+ return new ReferenceStore(refs, opts);
2994
2960
  }
2995
2961
  static fromUrl(url, opts) {
2996
- let spec = fetch(url, opts == null ? void 0 : opts.overrides).then((res) => res.json());
2997
- return _ReferenceStore.fromSpec(spec, opts);
2962
+ let spec = fetch(url, opts?.overrides).then((res) => res.json());
2963
+ return ReferenceStore.fromSpec(spec, opts);
2998
2964
  }
2999
- };
3000
- _refs = new WeakMap();
3001
- _opts = new WeakMap();
3002
- _overrides3 = new WeakMap();
3003
- let ReferenceStore = _ReferenceStore;
2965
+ }
3004
2966
  class RelaxedFetchStore extends FetchStore {
3005
2967
  // This allows returning `undefined` for 403 responses,
3006
2968
  // as opposed to completely erroring.
@@ -3009,11 +2971,10 @@ class RelaxedFetchStore extends FetchStore {
3009
2971
  // custom error handling function or additional options
3010
2972
  // to the zarrita FetchStore so that a subclass is not required.
3011
2973
  async get(key, options = {}) {
3012
- var _a3;
3013
2974
  try {
3014
2975
  return await super.get(key, options);
3015
2976
  } catch (e) {
3016
- if (((_a3 = e == null ? void 0 : e.message) == null ? void 0 : _a3.startsWith("Unexpected response status 403")) && true) {
2977
+ if (e?.message?.startsWith("Unexpected response status 403") && true) {
3017
2978
  return void 0;
3018
2979
  }
3019
2980
  throw e;
@@ -3021,7 +2982,7 @@ class RelaxedFetchStore extends FetchStore {
3021
2982
  }
3022
2983
  }
3023
2984
  function transformEntriesForZipFileStore(entries) {
3024
- const topLevelZarrDirectories = new Set(Object.keys(entries).map((k) => k.split("/")[0]).filter((firstPathItem) => firstPathItem == null ? void 0 : firstPathItem.endsWith(".zarr")));
2985
+ const topLevelZarrDirectories = new Set(Object.keys(entries).map((k) => k.split("/")[0]).filter((firstPathItem) => firstPathItem?.endsWith(".zarr")));
3025
2986
  if (topLevelZarrDirectories.size === 0) {
3026
2987
  return entries;
3027
2988
  }
@@ -3042,11 +3003,11 @@ function zarrOpenRoot(url, fileType, opts) {
3042
3003
  let store;
3043
3004
  if (fileType && fileType.endsWith(".zip")) {
3044
3005
  store = ZipFileStore.fromUrl(url, {
3045
- overrides: opts == null ? void 0 : opts.requestInit,
3006
+ overrides: opts?.requestInit,
3046
3007
  transformEntries: transformEntriesForZipFileStore
3047
3008
  });
3048
3009
  } else if (fileType && fileType.endsWith(".h5ad")) {
3049
- if (!(opts == null ? void 0 : opts.refSpecUrl)) {
3010
+ if (!opts?.refSpecUrl) {
3050
3011
  throw new Error("refSpecUrl is required for H5AD files");
3051
3012
  }
3052
3013
  const referenceSpecPromise = fetch(opts.refSpecUrl).then((res) => res.json()).then((referenceSpec) => Object.fromEntries(
@@ -3060,9 +3021,9 @@ function zarrOpenRoot(url, fileType, opts) {
3060
3021
  return [key, entry];
3061
3022
  })
3062
3023
  ));
3063
- store = ReferenceStore.fromSpec(referenceSpecPromise, { target: url, overrides: opts == null ? void 0 : opts.requestInit });
3024
+ store = ReferenceStore.fromSpec(referenceSpecPromise, { target: url, overrides: opts?.requestInit });
3064
3025
  } else {
3065
- store = new RelaxedFetchStore(url, { overrides: opts == null ? void 0 : opts.requestInit });
3026
+ store = new RelaxedFetchStore(url, { overrides: opts?.requestInit });
3066
3027
  }
3067
3028
  return root$1(store);
3068
3029
  }
@@ -3321,11 +3282,10 @@ class AnnDataSource extends ZarrDataSource {
3321
3282
  * @returns {Promise<string[]>} The data from the zarr array.
3322
3283
  */
3323
3284
  async getFlatArrDecompressed(path) {
3324
- var _a3;
3325
3285
  const { storeRoot } = this;
3326
3286
  const arr = await open(storeRoot.resolve(path), { kind: "array" });
3327
3287
  const data = await get(arr);
3328
- if ((_a3 = data.data) == null ? void 0 : _a3[Symbol.iterator]) {
3288
+ if (data.data?.[Symbol.iterator]) {
3329
3289
  return (
3330
3290
  /** @type {string[]} */
3331
3291
  Array.from(data.data)
@@ -4648,6 +4608,7 @@ const CoordinationType$1 = {
4648
4608
  CoordinationType$1.SPATIAL_ROTATION_Y,
4649
4609
  CoordinationType$1.SPATIAL_ROTATION_Z,
4650
4610
  CoordinationType$1.SPATIAL_AXIS_FIXED,
4611
+ CoordinationType$1.SPATIAL_ROTATION_ORBIT,
4651
4612
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
4652
4613
  CoordinationType$1.SPATIAL_ZOOM,
4653
4614
  CoordinationType$1.OBS_FILTER,
@@ -4655,14 +4616,11 @@ const CoordinationType$1 = {
4655
4616
  CoordinationType$1.OBS_SET_SELECTION,
4656
4617
  CoordinationType$1.OBS_SET_FILTER,
4657
4618
  CoordinationType$1.OBS_SET_HIGHLIGHT,
4658
- CoordinationType$1.OBS_SET_COLOR,
4659
4619
  CoordinationType$1.OBS_TYPE,
4660
- CoordinationType$1.ADDITIONAL_OBS_SETS,
4661
4620
  CoordinationType$1.OBS_SET_COLOR,
4662
4621
  CoordinationType$1.OBS_COLOR_ENCODING,
4663
- CoordinationType$1.OBS_SET_SELECTION,
4664
4622
  CoordinationType$1.EMBEDDING_TYPE,
4665
- CoordinationType$1.OBS_COLOR_ENCODING,
4623
+ CoordinationType$1.ADDITIONAL_OBS_SETS,
4666
4624
  CoordinationType$1.TOOLTIPS_VISIBLE
4667
4625
  ],
4668
4626
  [ViewType$1.SCATTERPLOT]: [
@@ -5867,7 +5825,6 @@ class ObsSegmentationsAnndataLoader extends AbstractTwoStepLoader {
5867
5825
  return this.segmentations;
5868
5826
  }
5869
5827
  async load() {
5870
- var _a3;
5871
5828
  const { path } = this.options;
5872
5829
  const channelCoordination = [{
5873
5830
  // obsType: null,
@@ -5890,7 +5847,7 @@ class ObsSegmentationsAnndataLoader extends AbstractTwoStepLoader {
5890
5847
  // spatialTargetT: imageWrapper.getDefaultTargetT(),
5891
5848
  segmentationLayer: CL([
5892
5849
  {
5893
- fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
5850
+ fileUid: this.coordinationValues?.fileUid || null,
5894
5851
  spatialLayerOpacity: 1,
5895
5852
  spatialLayerVisible: true,
5896
5853
  segmentationChannel: CL(channelCoordination)
@@ -6030,7 +5987,7 @@ function toFinite(value) {
6030
5987
  return value === 0 ? value : 0;
6031
5988
  }
6032
5989
  value = toNumber(value);
6033
- if (value === INFINITY || value === -Infinity) {
5990
+ if (value === INFINITY || value === -INFINITY) {
6034
5991
  var sign = value < 0 ? -1 : 1;
6035
5992
  return sign * MAX_INTEGER;
6036
5993
  }
@@ -6475,8 +6432,8 @@ Stack.prototype.set = stackSet;
6475
6432
  var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
6476
6433
  var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
6477
6434
  var moduleExports = freeModule && freeModule.exports === freeExports;
6478
- var Buffer2 = moduleExports ? root.Buffer : void 0;
6479
- Buffer2 ? Buffer2.allocUnsafe : void 0;
6435
+ var Buffer = moduleExports ? root.Buffer : void 0;
6436
+ Buffer ? Buffer.allocUnsafe : void 0;
6480
6437
  function cloneBuffer(buffer, isDeep) {
6481
6438
  {
6482
6439
  return buffer.slice();
@@ -8206,11 +8163,11 @@ class ZodType {
8206
8163
  throw result.error;
8207
8164
  }
8208
8165
  safeParse(data, params) {
8209
- var _a3;
8166
+ var _a2;
8210
8167
  const ctx = {
8211
8168
  common: {
8212
8169
  issues: [],
8213
- async: (_a3 = params === null || params === void 0 ? void 0 : params.async) !== null && _a3 !== void 0 ? _a3 : false,
8170
+ async: (_a2 = params === null || params === void 0 ? void 0 : params.async) !== null && _a2 !== void 0 ? _a2 : false,
8214
8171
  contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
8215
8172
  },
8216
8173
  path: (params === null || params === void 0 ? void 0 : params.path) || [],
@@ -8552,7 +8509,7 @@ class ZodString extends ZodType {
8552
8509
  } else if (check.kind === "url") {
8553
8510
  try {
8554
8511
  new URL(input.data);
8555
- } catch (_a3) {
8512
+ } catch (_a2) {
8556
8513
  ctx = this._getOrReturnCtx(input, ctx);
8557
8514
  addIssueToContext(ctx, {
8558
8515
  validation: "url",
@@ -8674,7 +8631,7 @@ class ZodString extends ZodType {
8674
8631
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
8675
8632
  }
8676
8633
  datetime(options) {
8677
- var _a3;
8634
+ var _a2;
8678
8635
  if (typeof options === "string") {
8679
8636
  return this._addCheck({
8680
8637
  kind: "datetime",
@@ -8686,7 +8643,7 @@ class ZodString extends ZodType {
8686
8643
  return this._addCheck({
8687
8644
  kind: "datetime",
8688
8645
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
8689
- offset: (_a3 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a3 !== void 0 ? _a3 : false,
8646
+ offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false,
8690
8647
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
8691
8648
  });
8692
8649
  }
@@ -8814,11 +8771,11 @@ class ZodString extends ZodType {
8814
8771
  }
8815
8772
  }
8816
8773
  ZodString.create = (params) => {
8817
- var _a3;
8774
+ var _a2;
8818
8775
  return new ZodString({
8819
8776
  checks: [],
8820
8777
  typeName: ZodFirstPartyTypeKind.ZodString,
8821
- coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
8778
+ coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
8822
8779
  ...processCreateParams(params)
8823
8780
  });
8824
8781
  };
@@ -9219,11 +9176,11 @@ class ZodBigInt extends ZodType {
9219
9176
  }
9220
9177
  }
9221
9178
  ZodBigInt.create = (params) => {
9222
- var _a3;
9179
+ var _a2;
9223
9180
  return new ZodBigInt({
9224
9181
  checks: [],
9225
9182
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
9226
- coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
9183
+ coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
9227
9184
  ...processCreateParams(params)
9228
9185
  });
9229
9186
  };
@@ -9728,8 +9685,8 @@ class ZodObject extends ZodType {
9728
9685
  unknownKeys: "strict",
9729
9686
  ...message !== void 0 ? {
9730
9687
  errorMap: (issue, ctx) => {
9731
- var _a3, _b, _c, _d;
9732
- const defaultError = (_c = (_b = (_a3 = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a3, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
9688
+ var _a2, _b, _c, _d;
9689
+ const defaultError = (_c = (_b = (_a2 = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a2, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
9733
9690
  if (issue.code === "unrecognized_keys")
9734
9691
  return {
9735
9692
  message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
@@ -11139,10 +11096,10 @@ ZodReadonly.create = (type, params) => {
11139
11096
  const custom = (check, params = {}, fatal) => {
11140
11097
  if (check)
11141
11098
  return ZodAny.create().superRefine((data, ctx) => {
11142
- var _a3, _b;
11099
+ var _a2, _b;
11143
11100
  if (!check(data)) {
11144
11101
  const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
11145
- const _fatal = (_b = (_a3 = p.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b !== void 0 ? _b : true;
11102
+ const _fatal = (_b = (_a2 = p.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
11146
11103
  const p2 = typeof p === "string" ? { message: p } : p;
11147
11104
  ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
11148
11105
  }
@@ -11640,13 +11597,12 @@ function upgradeFrom0_1_0(config2, datasetUid = null) {
11640
11597
  };
11641
11598
  const layout = [];
11642
11599
  config2.staticLayout.forEach((componentDef) => {
11643
- var _a3, _b, _c;
11644
11600
  let newComponentDef = {
11645
11601
  ...componentDef,
11646
11602
  coordinationScopes: {}
11647
11603
  };
11648
11604
  if (componentDef.component === "scatterplot") {
11649
- if (((_a3 = componentDef.props) == null ? void 0 : _a3.mapping) && typeof componentDef.props.mapping === "string") {
11605
+ if (componentDef.props?.mapping && typeof componentDef.props.mapping === "string") {
11650
11606
  coordinationSpace.embeddingType[componentDef.props.mapping] = componentDef.props.mapping;
11651
11607
  newComponentDef = {
11652
11608
  ...newComponentDef,
@@ -11656,7 +11612,7 @@ function upgradeFrom0_1_0(config2, datasetUid = null) {
11656
11612
  }
11657
11613
  };
11658
11614
  }
11659
- if ((_b = componentDef.props) == null ? void 0 : _b.view) {
11615
+ if (componentDef.props?.view) {
11660
11616
  const newScopeValues = upgradeReplaceViewProp("embedding", componentDef.props.view, coordinationSpace);
11661
11617
  newComponentDef = {
11662
11618
  ...newComponentDef,
@@ -11668,7 +11624,7 @@ function upgradeFrom0_1_0(config2, datasetUid = null) {
11668
11624
  }
11669
11625
  }
11670
11626
  if (componentDef.component === "spatial") {
11671
- if ((_c = componentDef == null ? void 0 : componentDef.props) == null ? void 0 : _c.view) {
11627
+ if (componentDef?.props?.view) {
11672
11628
  const newScopeValues = upgradeReplaceViewProp("spatial", componentDef.props.view, coordinationSpace);
11673
11629
  newComponentDef = {
11674
11630
  ...newComponentDef,
@@ -11758,7 +11714,6 @@ function upgradeFrom1_0_0(config2) {
11758
11714
  };
11759
11715
  }
11760
11716
  function upgradeFrom1_0_1(config2) {
11761
- var _a3;
11762
11717
  const layout = config2.layout.map((component) => {
11763
11718
  const newComponent = { ...component };
11764
11719
  if (newComponent.component === "layerController") {
@@ -11770,9 +11725,8 @@ function upgradeFrom1_0_1(config2) {
11770
11725
  return newComponent;
11771
11726
  });
11772
11727
  const newConfig = cloneDeep(config2);
11773
- Object.keys(((_a3 = newConfig == null ? void 0 : newConfig.coordinationSpace) == null ? void 0 : _a3.spatialRasterLayers) || {}).forEach((key) => {
11774
- var _a4, _b;
11775
- if ((_b = (_a4 = newConfig.coordinationSpace) == null ? void 0 : _a4.spatialRasterLayers) == null ? void 0 : _b[key]) {
11728
+ Object.keys(newConfig?.coordinationSpace?.spatialRasterLayers || {}).forEach((key) => {
11729
+ if (newConfig.coordinationSpace?.spatialRasterLayers?.[key]) {
11776
11730
  newConfig.coordinationSpace.spatialRasterLayers[key].forEach((layer, index) => {
11777
11731
  if (newConfig.coordinationSpace) {
11778
11732
  newConfig.coordinationSpace.spatialRasterLayers[key][index].type = ["bitmask", "raster"].includes(layer.type) ? layer.type : "raster";
@@ -11913,7 +11867,7 @@ function upgradeFrom1_0_10(config2) {
11913
11867
  function upgradeFrom1_0_11(config2) {
11914
11868
  const newConfig = cloneDeep(config2);
11915
11869
  const { datasets, coordinationSpace } = newConfig;
11916
- if (coordinationSpace == null ? void 0 : coordinationSpace.embeddingType) {
11870
+ if (coordinationSpace?.embeddingType) {
11917
11871
  const embeddingTypes = Object.values(coordinationSpace.embeddingType);
11918
11872
  datasets.forEach((dataset, i) => {
11919
11873
  const { files } = dataset;
@@ -11946,7 +11900,7 @@ function upgradeFrom1_0_12(config2) {
11946
11900
  if (options && "factors" in options && Array.isArray(options.factors)) {
11947
11901
  const obsLabelsTypeScopes = [];
11948
11902
  options.factors.forEach((olt) => {
11949
- const nextScope = getNextScope(Object.keys((coordinationSpace == null ? void 0 : coordinationSpace.obsLabelsType) || {}));
11903
+ const nextScope = getNextScope(Object.keys(coordinationSpace?.obsLabelsType || {}));
11950
11904
  newCoordinationSpace.obsLabelsType = {
11951
11905
  ...newCoordinationSpace.obsLabelsType,
11952
11906
  // Need to remove the obs/ prefix.
@@ -11960,8 +11914,7 @@ function upgradeFrom1_0_12(config2) {
11960
11914
  });
11961
11915
  });
11962
11916
  function getDatasetUidForView(viewDef) {
11963
- var _a3, _b;
11964
- if (((_a3 = viewDef.coordinationScopes) == null ? void 0 : _a3.dataset) && typeof ((_b = viewDef.coordinationScopes) == null ? void 0 : _b.dataset) === "string") {
11917
+ if (viewDef.coordinationScopes?.dataset && typeof viewDef.coordinationScopes?.dataset === "string") {
11965
11918
  return newCoordinationSpace.dataset[viewDef.coordinationScopes.dataset];
11966
11919
  }
11967
11920
  if (datasets.length > 0) {
@@ -12024,8 +11977,7 @@ function upgradeFrom1_0_14(config2) {
12024
11977
  };
12025
11978
  newLayout.forEach((viewDef) => {
12026
11979
  Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
12027
- var _a3;
12028
- if ((_a3 = viewDef.props) == null ? void 0 : _a3[oldProp]) {
11980
+ if (viewDef.props?.[oldProp]) {
12029
11981
  log.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
12030
11982
  }
12031
11983
  });
@@ -12042,7 +11994,7 @@ function upgradeFrom1_0_15(config2) {
12042
11994
  const newLayout = layout.map((view) => {
12043
11995
  const { coordinationScopes } = view;
12044
11996
  const newCoordinationScopes = {};
12045
- if ((coordinationScopes == null ? void 0 : coordinationScopes.dataset) && Array.isArray(coordinationScopes.dataset)) {
11997
+ if (coordinationScopes?.dataset && Array.isArray(coordinationScopes.dataset)) {
12046
11998
  const coordinationScopesBy = {
12047
11999
  dataset: {}
12048
12000
  };
@@ -16218,28 +16170,28 @@ function requireJson2csv_umd() {
16218
16170
  return toString.call(arr) == "[object Array]";
16219
16171
  };
16220
16172
  var INSPECT_MAX_BYTES = 50;
16221
- Buffer3.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== void 0 ? global$1.TYPED_ARRAY_SUPPORT : true;
16173
+ Buffer2.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== void 0 ? global$1.TYPED_ARRAY_SUPPORT : true;
16222
16174
  function kMaxLength() {
16223
- return Buffer3.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
16175
+ return Buffer2.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
16224
16176
  }
16225
16177
  function createBuffer(that, length) {
16226
16178
  if (kMaxLength() < length) {
16227
16179
  throw new RangeError("Invalid typed array length");
16228
16180
  }
16229
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
16181
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
16230
16182
  that = new Uint8Array(length);
16231
- that.__proto__ = Buffer3.prototype;
16183
+ that.__proto__ = Buffer2.prototype;
16232
16184
  } else {
16233
16185
  if (that === null) {
16234
- that = new Buffer3(length);
16186
+ that = new Buffer2(length);
16235
16187
  }
16236
16188
  that.length = length;
16237
16189
  }
16238
16190
  return that;
16239
16191
  }
16240
- function Buffer3(arg, encodingOrOffset, length) {
16241
- if (!Buffer3.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer3)) {
16242
- return new Buffer3(arg, encodingOrOffset, length);
16192
+ function Buffer2(arg, encodingOrOffset, length) {
16193
+ if (!Buffer2.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer2)) {
16194
+ return new Buffer2(arg, encodingOrOffset, length);
16243
16195
  }
16244
16196
  if (typeof arg === "number") {
16245
16197
  if (typeof encodingOrOffset === "string") {
@@ -16251,9 +16203,9 @@ function requireJson2csv_umd() {
16251
16203
  }
16252
16204
  return from(this, arg, encodingOrOffset, length);
16253
16205
  }
16254
- Buffer3.poolSize = 8192;
16255
- Buffer3._augment = function(arr) {
16256
- arr.__proto__ = Buffer3.prototype;
16206
+ Buffer2.poolSize = 8192;
16207
+ Buffer2._augment = function(arr) {
16208
+ arr.__proto__ = Buffer2.prototype;
16257
16209
  return arr;
16258
16210
  };
16259
16211
  function from(that, value, encodingOrOffset, length) {
@@ -16268,12 +16220,12 @@ function requireJson2csv_umd() {
16268
16220
  }
16269
16221
  return fromObject(that, value);
16270
16222
  }
16271
- Buffer3.from = function(value, encodingOrOffset, length) {
16223
+ Buffer2.from = function(value, encodingOrOffset, length) {
16272
16224
  return from(null, value, encodingOrOffset, length);
16273
16225
  };
16274
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
16275
- Buffer3.prototype.__proto__ = Uint8Array.prototype;
16276
- Buffer3.__proto__ = Uint8Array;
16226
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
16227
+ Buffer2.prototype.__proto__ = Uint8Array.prototype;
16228
+ Buffer2.__proto__ = Uint8Array;
16277
16229
  }
16278
16230
  function assertSize(size) {
16279
16231
  if (typeof size !== "number") {
@@ -16292,30 +16244,30 @@ function requireJson2csv_umd() {
16292
16244
  }
16293
16245
  return createBuffer(that, size);
16294
16246
  }
16295
- Buffer3.alloc = function(size, fill, encoding) {
16247
+ Buffer2.alloc = function(size, fill, encoding) {
16296
16248
  return alloc(null, size, fill, encoding);
16297
16249
  };
16298
16250
  function allocUnsafe(that, size) {
16299
16251
  assertSize(size);
16300
16252
  that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
16301
- if (!Buffer3.TYPED_ARRAY_SUPPORT) {
16253
+ if (!Buffer2.TYPED_ARRAY_SUPPORT) {
16302
16254
  for (var i = 0; i < size; ++i) {
16303
16255
  that[i] = 0;
16304
16256
  }
16305
16257
  }
16306
16258
  return that;
16307
16259
  }
16308
- Buffer3.allocUnsafe = function(size) {
16260
+ Buffer2.allocUnsafe = function(size) {
16309
16261
  return allocUnsafe(null, size);
16310
16262
  };
16311
- Buffer3.allocUnsafeSlow = function(size) {
16263
+ Buffer2.allocUnsafeSlow = function(size) {
16312
16264
  return allocUnsafe(null, size);
16313
16265
  };
16314
16266
  function fromString(that, string, encoding) {
16315
16267
  if (typeof encoding !== "string" || encoding === "") {
16316
16268
  encoding = "utf8";
16317
16269
  }
16318
- if (!Buffer3.isEncoding(encoding)) {
16270
+ if (!Buffer2.isEncoding(encoding)) {
16319
16271
  throw new TypeError('"encoding" must be a valid string encoding');
16320
16272
  }
16321
16273
  var length = byteLength(string, encoding) | 0;
@@ -16349,9 +16301,9 @@ function requireJson2csv_umd() {
16349
16301
  } else {
16350
16302
  array = new Uint8Array(array, byteOffset, length);
16351
16303
  }
16352
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
16304
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
16353
16305
  that = array;
16354
- that.__proto__ = Buffer3.prototype;
16306
+ that.__proto__ = Buffer2.prototype;
16355
16307
  } else {
16356
16308
  that = fromArrayLike(that, array);
16357
16309
  }
@@ -16386,11 +16338,11 @@ function requireJson2csv_umd() {
16386
16338
  }
16387
16339
  return length | 0;
16388
16340
  }
16389
- Buffer3.isBuffer = isBuffer2;
16341
+ Buffer2.isBuffer = isBuffer2;
16390
16342
  function internalIsBuffer(b) {
16391
16343
  return !!(b != null && b._isBuffer);
16392
16344
  }
16393
- Buffer3.compare = function compare(a, b) {
16345
+ Buffer2.compare = function compare(a, b) {
16394
16346
  if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
16395
16347
  throw new TypeError("Arguments must be Buffers");
16396
16348
  }
@@ -16408,7 +16360,7 @@ function requireJson2csv_umd() {
16408
16360
  if (y < x) return 1;
16409
16361
  return 0;
16410
16362
  };
16411
- Buffer3.isEncoding = function isEncoding(encoding) {
16363
+ Buffer2.isEncoding = function isEncoding(encoding) {
16412
16364
  switch (String(encoding).toLowerCase()) {
16413
16365
  case "hex":
16414
16366
  case "utf8":
@@ -16426,12 +16378,12 @@ function requireJson2csv_umd() {
16426
16378
  return false;
16427
16379
  }
16428
16380
  };
16429
- Buffer3.concat = function concat(list, length) {
16381
+ Buffer2.concat = function concat(list, length) {
16430
16382
  if (!isArray2(list)) {
16431
16383
  throw new TypeError('"list" argument must be an Array of Buffers');
16432
16384
  }
16433
16385
  if (list.length === 0) {
16434
- return Buffer3.alloc(0);
16386
+ return Buffer2.alloc(0);
16435
16387
  }
16436
16388
  var i;
16437
16389
  if (length === void 0) {
@@ -16440,7 +16392,7 @@ function requireJson2csv_umd() {
16440
16392
  length += list[i].length;
16441
16393
  }
16442
16394
  }
16443
- var buffer = Buffer3.allocUnsafe(length);
16395
+ var buffer = Buffer2.allocUnsafe(length);
16444
16396
  var pos = 0;
16445
16397
  for (i = 0; i < list.length; ++i) {
16446
16398
  var buf = list[i];
@@ -16491,7 +16443,7 @@ function requireJson2csv_umd() {
16491
16443
  }
16492
16444
  }
16493
16445
  }
16494
- Buffer3.byteLength = byteLength;
16446
+ Buffer2.byteLength = byteLength;
16495
16447
  function slowToString(encoding, start, end) {
16496
16448
  var loweredCase = false;
16497
16449
  if (start === void 0 || start < 0) {
@@ -16538,13 +16490,13 @@ function requireJson2csv_umd() {
16538
16490
  }
16539
16491
  }
16540
16492
  }
16541
- Buffer3.prototype._isBuffer = true;
16493
+ Buffer2.prototype._isBuffer = true;
16542
16494
  function swap(b, n, m) {
16543
16495
  var i = b[n];
16544
16496
  b[n] = b[m];
16545
16497
  b[m] = i;
16546
16498
  }
16547
- Buffer3.prototype.swap16 = function swap16() {
16499
+ Buffer2.prototype.swap16 = function swap16() {
16548
16500
  var len = this.length;
16549
16501
  if (len % 2 !== 0) {
16550
16502
  throw new RangeError("Buffer size must be a multiple of 16-bits");
@@ -16554,7 +16506,7 @@ function requireJson2csv_umd() {
16554
16506
  }
16555
16507
  return this;
16556
16508
  };
16557
- Buffer3.prototype.swap32 = function swap32() {
16509
+ Buffer2.prototype.swap32 = function swap32() {
16558
16510
  var len = this.length;
16559
16511
  if (len % 4 !== 0) {
16560
16512
  throw new RangeError("Buffer size must be a multiple of 32-bits");
@@ -16565,7 +16517,7 @@ function requireJson2csv_umd() {
16565
16517
  }
16566
16518
  return this;
16567
16519
  };
16568
- Buffer3.prototype.swap64 = function swap64() {
16520
+ Buffer2.prototype.swap64 = function swap64() {
16569
16521
  var len = this.length;
16570
16522
  if (len % 8 !== 0) {
16571
16523
  throw new RangeError("Buffer size must be a multiple of 64-bits");
@@ -16578,18 +16530,18 @@ function requireJson2csv_umd() {
16578
16530
  }
16579
16531
  return this;
16580
16532
  };
16581
- Buffer3.prototype.toString = function toString2() {
16533
+ Buffer2.prototype.toString = function toString2() {
16582
16534
  var length = this.length | 0;
16583
16535
  if (length === 0) return "";
16584
16536
  if (arguments.length === 0) return utf8Slice(this, 0, length);
16585
16537
  return slowToString.apply(this, arguments);
16586
16538
  };
16587
- Buffer3.prototype.equals = function equals(b) {
16539
+ Buffer2.prototype.equals = function equals(b) {
16588
16540
  if (!internalIsBuffer(b)) throw new TypeError("Argument must be a Buffer");
16589
16541
  if (this === b) return true;
16590
- return Buffer3.compare(this, b) === 0;
16542
+ return Buffer2.compare(this, b) === 0;
16591
16543
  };
16592
- Buffer3.prototype.inspect = function inspect2() {
16544
+ Buffer2.prototype.inspect = function inspect2() {
16593
16545
  var str = "";
16594
16546
  var max = INSPECT_MAX_BYTES;
16595
16547
  if (this.length > 0) {
@@ -16598,7 +16550,7 @@ function requireJson2csv_umd() {
16598
16550
  }
16599
16551
  return "<Buffer " + str + ">";
16600
16552
  };
16601
- Buffer3.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
16553
+ Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
16602
16554
  if (!internalIsBuffer(target)) {
16603
16555
  throw new TypeError("Argument must be a Buffer");
16604
16556
  }
@@ -16670,7 +16622,7 @@ function requireJson2csv_umd() {
16670
16622
  else return -1;
16671
16623
  }
16672
16624
  if (typeof val === "string") {
16673
- val = Buffer3.from(val, encoding);
16625
+ val = Buffer2.from(val, encoding);
16674
16626
  }
16675
16627
  if (internalIsBuffer(val)) {
16676
16628
  if (val.length === 0) {
@@ -16679,7 +16631,7 @@ function requireJson2csv_umd() {
16679
16631
  return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
16680
16632
  } else if (typeof val === "number") {
16681
16633
  val = val & 255;
16682
- if (Buffer3.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === "function") {
16634
+ if (Buffer2.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === "function") {
16683
16635
  if (dir) {
16684
16636
  return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
16685
16637
  } else {
@@ -16740,13 +16692,13 @@ function requireJson2csv_umd() {
16740
16692
  }
16741
16693
  return -1;
16742
16694
  }
16743
- Buffer3.prototype.includes = function includes(val, byteOffset, encoding) {
16695
+ Buffer2.prototype.includes = function includes(val, byteOffset, encoding) {
16744
16696
  return this.indexOf(val, byteOffset, encoding) !== -1;
16745
16697
  };
16746
- Buffer3.prototype.indexOf = function indexOf2(val, byteOffset, encoding) {
16698
+ Buffer2.prototype.indexOf = function indexOf2(val, byteOffset, encoding) {
16747
16699
  return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
16748
16700
  };
16749
- Buffer3.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
16701
+ Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
16750
16702
  return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
16751
16703
  };
16752
16704
  function hexWrite(buf, string, offset, length) {
@@ -16787,7 +16739,7 @@ function requireJson2csv_umd() {
16787
16739
  function ucs2Write(buf, string, offset, length) {
16788
16740
  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
16789
16741
  }
16790
- Buffer3.prototype.write = function write2(string, offset, length, encoding) {
16742
+ Buffer2.prototype.write = function write2(string, offset, length, encoding) {
16791
16743
  if (offset === void 0) {
16792
16744
  encoding = "utf8";
16793
16745
  length = this.length;
@@ -16843,7 +16795,7 @@ function requireJson2csv_umd() {
16843
16795
  }
16844
16796
  }
16845
16797
  };
16846
- Buffer3.prototype.toJSON = function toJSON() {
16798
+ Buffer2.prototype.toJSON = function toJSON() {
16847
16799
  return {
16848
16800
  type: "Buffer",
16849
16801
  data: Array.prototype.slice.call(this._arr || this, 0)
@@ -16966,7 +16918,7 @@ function requireJson2csv_umd() {
16966
16918
  }
16967
16919
  return res;
16968
16920
  }
16969
- Buffer3.prototype.slice = function slice2(start, end) {
16921
+ Buffer2.prototype.slice = function slice2(start, end) {
16970
16922
  var len = this.length;
16971
16923
  start = ~~start;
16972
16924
  end = end === void 0 ? len : ~~end;
@@ -16984,12 +16936,12 @@ function requireJson2csv_umd() {
16984
16936
  }
16985
16937
  if (end < start) end = start;
16986
16938
  var newBuf;
16987
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
16939
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
16988
16940
  newBuf = this.subarray(start, end);
16989
- newBuf.__proto__ = Buffer3.prototype;
16941
+ newBuf.__proto__ = Buffer2.prototype;
16990
16942
  } else {
16991
16943
  var sliceLen = end - start;
16992
- newBuf = new Buffer3(sliceLen, void 0);
16944
+ newBuf = new Buffer2(sliceLen, void 0);
16993
16945
  for (var i = 0; i < sliceLen; ++i) {
16994
16946
  newBuf[i] = this[i + start];
16995
16947
  }
@@ -17000,7 +16952,7 @@ function requireJson2csv_umd() {
17000
16952
  if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
17001
16953
  if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
17002
16954
  }
17003
- Buffer3.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {
16955
+ Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {
17004
16956
  offset = offset | 0;
17005
16957
  byteLength2 = byteLength2 | 0;
17006
16958
  if (!noAssert) checkOffset(offset, byteLength2, this.length);
@@ -17012,7 +16964,7 @@ function requireJson2csv_umd() {
17012
16964
  }
17013
16965
  return val;
17014
16966
  };
17015
- Buffer3.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {
16967
+ Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) {
17016
16968
  offset = offset | 0;
17017
16969
  byteLength2 = byteLength2 | 0;
17018
16970
  if (!noAssert) {
@@ -17025,27 +16977,27 @@ function requireJson2csv_umd() {
17025
16977
  }
17026
16978
  return val;
17027
16979
  };
17028
- Buffer3.prototype.readUInt8 = function readUInt8(offset, noAssert) {
16980
+ Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) {
17029
16981
  if (!noAssert) checkOffset(offset, 1, this.length);
17030
16982
  return this[offset];
17031
16983
  };
17032
- Buffer3.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
16984
+ Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
17033
16985
  if (!noAssert) checkOffset(offset, 2, this.length);
17034
16986
  return this[offset] | this[offset + 1] << 8;
17035
16987
  };
17036
- Buffer3.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
16988
+ Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
17037
16989
  if (!noAssert) checkOffset(offset, 2, this.length);
17038
16990
  return this[offset] << 8 | this[offset + 1];
17039
16991
  };
17040
- Buffer3.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
16992
+ Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
17041
16993
  if (!noAssert) checkOffset(offset, 4, this.length);
17042
16994
  return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
17043
16995
  };
17044
- Buffer3.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
16996
+ Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
17045
16997
  if (!noAssert) checkOffset(offset, 4, this.length);
17046
16998
  return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
17047
16999
  };
17048
- Buffer3.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {
17000
+ Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {
17049
17001
  offset = offset | 0;
17050
17002
  byteLength2 = byteLength2 | 0;
17051
17003
  if (!noAssert) checkOffset(offset, byteLength2, this.length);
@@ -17059,7 +17011,7 @@ function requireJson2csv_umd() {
17059
17011
  if (val >= mul) val -= Math.pow(2, 8 * byteLength2);
17060
17012
  return val;
17061
17013
  };
17062
- Buffer3.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {
17014
+ Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {
17063
17015
  offset = offset | 0;
17064
17016
  byteLength2 = byteLength2 | 0;
17065
17017
  if (!noAssert) checkOffset(offset, byteLength2, this.length);
@@ -17073,42 +17025,42 @@ function requireJson2csv_umd() {
17073
17025
  if (val >= mul) val -= Math.pow(2, 8 * byteLength2);
17074
17026
  return val;
17075
17027
  };
17076
- Buffer3.prototype.readInt8 = function readInt8(offset, noAssert) {
17028
+ Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) {
17077
17029
  if (!noAssert) checkOffset(offset, 1, this.length);
17078
17030
  if (!(this[offset] & 128)) return this[offset];
17079
17031
  return (255 - this[offset] + 1) * -1;
17080
17032
  };
17081
- Buffer3.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
17033
+ Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
17082
17034
  if (!noAssert) checkOffset(offset, 2, this.length);
17083
17035
  var val = this[offset] | this[offset + 1] << 8;
17084
17036
  return val & 32768 ? val | 4294901760 : val;
17085
17037
  };
17086
- Buffer3.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
17038
+ Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
17087
17039
  if (!noAssert) checkOffset(offset, 2, this.length);
17088
17040
  var val = this[offset + 1] | this[offset] << 8;
17089
17041
  return val & 32768 ? val | 4294901760 : val;
17090
17042
  };
17091
- Buffer3.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
17043
+ Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
17092
17044
  if (!noAssert) checkOffset(offset, 4, this.length);
17093
17045
  return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
17094
17046
  };
17095
- Buffer3.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
17047
+ Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
17096
17048
  if (!noAssert) checkOffset(offset, 4, this.length);
17097
17049
  return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
17098
17050
  };
17099
- Buffer3.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
17051
+ Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
17100
17052
  if (!noAssert) checkOffset(offset, 4, this.length);
17101
17053
  return read(this, offset, true, 23, 4);
17102
17054
  };
17103
- Buffer3.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
17055
+ Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
17104
17056
  if (!noAssert) checkOffset(offset, 4, this.length);
17105
17057
  return read(this, offset, false, 23, 4);
17106
17058
  };
17107
- Buffer3.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
17059
+ Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
17108
17060
  if (!noAssert) checkOffset(offset, 8, this.length);
17109
17061
  return read(this, offset, true, 52, 8);
17110
17062
  };
17111
- Buffer3.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
17063
+ Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
17112
17064
  if (!noAssert) checkOffset(offset, 8, this.length);
17113
17065
  return read(this, offset, false, 52, 8);
17114
17066
  };
@@ -17117,7 +17069,7 @@ function requireJson2csv_umd() {
17117
17069
  if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
17118
17070
  if (offset + ext > buf.length) throw new RangeError("Index out of range");
17119
17071
  }
17120
- Buffer3.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {
17072
+ Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {
17121
17073
  value = +value;
17122
17074
  offset = offset | 0;
17123
17075
  byteLength2 = byteLength2 | 0;
@@ -17133,7 +17085,7 @@ function requireJson2csv_umd() {
17133
17085
  }
17134
17086
  return offset + byteLength2;
17135
17087
  };
17136
- Buffer3.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {
17088
+ Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) {
17137
17089
  value = +value;
17138
17090
  offset = offset | 0;
17139
17091
  byteLength2 = byteLength2 | 0;
@@ -17149,11 +17101,11 @@ function requireJson2csv_umd() {
17149
17101
  }
17150
17102
  return offset + byteLength2;
17151
17103
  };
17152
- Buffer3.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
17104
+ Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
17153
17105
  value = +value;
17154
17106
  offset = offset | 0;
17155
17107
  if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
17156
- if (!Buffer3.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
17108
+ if (!Buffer2.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
17157
17109
  this[offset] = value & 255;
17158
17110
  return offset + 1;
17159
17111
  };
@@ -17163,11 +17115,11 @@ function requireJson2csv_umd() {
17163
17115
  buf[offset + i] = (value & 255 << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;
17164
17116
  }
17165
17117
  }
17166
- Buffer3.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
17118
+ Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
17167
17119
  value = +value;
17168
17120
  offset = offset | 0;
17169
17121
  if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
17170
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
17122
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
17171
17123
  this[offset] = value & 255;
17172
17124
  this[offset + 1] = value >>> 8;
17173
17125
  } else {
@@ -17175,11 +17127,11 @@ function requireJson2csv_umd() {
17175
17127
  }
17176
17128
  return offset + 2;
17177
17129
  };
17178
- Buffer3.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
17130
+ Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
17179
17131
  value = +value;
17180
17132
  offset = offset | 0;
17181
17133
  if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
17182
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
17134
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
17183
17135
  this[offset] = value >>> 8;
17184
17136
  this[offset + 1] = value & 255;
17185
17137
  } else {
@@ -17193,11 +17145,11 @@ function requireJson2csv_umd() {
17193
17145
  buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 255;
17194
17146
  }
17195
17147
  }
17196
- Buffer3.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
17148
+ Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
17197
17149
  value = +value;
17198
17150
  offset = offset | 0;
17199
17151
  if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
17200
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
17152
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
17201
17153
  this[offset + 3] = value >>> 24;
17202
17154
  this[offset + 2] = value >>> 16;
17203
17155
  this[offset + 1] = value >>> 8;
@@ -17207,11 +17159,11 @@ function requireJson2csv_umd() {
17207
17159
  }
17208
17160
  return offset + 4;
17209
17161
  };
17210
- Buffer3.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
17162
+ Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
17211
17163
  value = +value;
17212
17164
  offset = offset | 0;
17213
17165
  if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
17214
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
17166
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
17215
17167
  this[offset] = value >>> 24;
17216
17168
  this[offset + 1] = value >>> 16;
17217
17169
  this[offset + 2] = value >>> 8;
@@ -17221,7 +17173,7 @@ function requireJson2csv_umd() {
17221
17173
  }
17222
17174
  return offset + 4;
17223
17175
  };
17224
- Buffer3.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {
17176
+ Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) {
17225
17177
  value = +value;
17226
17178
  offset = offset | 0;
17227
17179
  if (!noAssert) {
@@ -17240,7 +17192,7 @@ function requireJson2csv_umd() {
17240
17192
  }
17241
17193
  return offset + byteLength2;
17242
17194
  };
17243
- Buffer3.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {
17195
+ Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) {
17244
17196
  value = +value;
17245
17197
  offset = offset | 0;
17246
17198
  if (!noAssert) {
@@ -17259,20 +17211,20 @@ function requireJson2csv_umd() {
17259
17211
  }
17260
17212
  return offset + byteLength2;
17261
17213
  };
17262
- Buffer3.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
17214
+ Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
17263
17215
  value = +value;
17264
17216
  offset = offset | 0;
17265
17217
  if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
17266
- if (!Buffer3.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
17218
+ if (!Buffer2.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
17267
17219
  if (value < 0) value = 255 + value + 1;
17268
17220
  this[offset] = value & 255;
17269
17221
  return offset + 1;
17270
17222
  };
17271
- Buffer3.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
17223
+ Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
17272
17224
  value = +value;
17273
17225
  offset = offset | 0;
17274
17226
  if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
17275
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
17227
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
17276
17228
  this[offset] = value & 255;
17277
17229
  this[offset + 1] = value >>> 8;
17278
17230
  } else {
@@ -17280,11 +17232,11 @@ function requireJson2csv_umd() {
17280
17232
  }
17281
17233
  return offset + 2;
17282
17234
  };
17283
- Buffer3.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
17235
+ Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
17284
17236
  value = +value;
17285
17237
  offset = offset | 0;
17286
17238
  if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
17287
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
17239
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
17288
17240
  this[offset] = value >>> 8;
17289
17241
  this[offset + 1] = value & 255;
17290
17242
  } else {
@@ -17292,11 +17244,11 @@ function requireJson2csv_umd() {
17292
17244
  }
17293
17245
  return offset + 2;
17294
17246
  };
17295
- Buffer3.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
17247
+ Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
17296
17248
  value = +value;
17297
17249
  offset = offset | 0;
17298
17250
  if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
17299
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
17251
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
17300
17252
  this[offset] = value & 255;
17301
17253
  this[offset + 1] = value >>> 8;
17302
17254
  this[offset + 2] = value >>> 16;
@@ -17306,12 +17258,12 @@ function requireJson2csv_umd() {
17306
17258
  }
17307
17259
  return offset + 4;
17308
17260
  };
17309
- Buffer3.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
17261
+ Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
17310
17262
  value = +value;
17311
17263
  offset = offset | 0;
17312
17264
  if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
17313
17265
  if (value < 0) value = 4294967295 + value + 1;
17314
- if (Buffer3.TYPED_ARRAY_SUPPORT) {
17266
+ if (Buffer2.TYPED_ARRAY_SUPPORT) {
17315
17267
  this[offset] = value >>> 24;
17316
17268
  this[offset + 1] = value >>> 16;
17317
17269
  this[offset + 2] = value >>> 8;
@@ -17332,10 +17284,10 @@ function requireJson2csv_umd() {
17332
17284
  write(buf, value, offset, littleEndian, 23, 4);
17333
17285
  return offset + 4;
17334
17286
  }
17335
- Buffer3.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
17287
+ Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
17336
17288
  return writeFloat(this, value, offset, true, noAssert);
17337
17289
  };
17338
- Buffer3.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
17290
+ Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
17339
17291
  return writeFloat(this, value, offset, false, noAssert);
17340
17292
  };
17341
17293
  function writeDouble(buf, value, offset, littleEndian, noAssert) {
@@ -17345,13 +17297,13 @@ function requireJson2csv_umd() {
17345
17297
  write(buf, value, offset, littleEndian, 52, 8);
17346
17298
  return offset + 8;
17347
17299
  }
17348
- Buffer3.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
17300
+ Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
17349
17301
  return writeDouble(this, value, offset, true, noAssert);
17350
17302
  };
17351
- Buffer3.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
17303
+ Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
17352
17304
  return writeDouble(this, value, offset, false, noAssert);
17353
17305
  };
17354
- Buffer3.prototype.copy = function copy(target, targetStart, start, end) {
17306
+ Buffer2.prototype.copy = function copy(target, targetStart, start, end) {
17355
17307
  if (!start) start = 0;
17356
17308
  if (!end && end !== 0) end = this.length;
17357
17309
  if (targetStart >= target.length) targetStart = target.length;
@@ -17374,7 +17326,7 @@ function requireJson2csv_umd() {
17374
17326
  for (i = len - 1; i >= 0; --i) {
17375
17327
  target[i + targetStart] = this[i + start];
17376
17328
  }
17377
- } else if (len < 1e3 || !Buffer3.TYPED_ARRAY_SUPPORT) {
17329
+ } else if (len < 1e3 || !Buffer2.TYPED_ARRAY_SUPPORT) {
17378
17330
  for (i = 0; i < len; ++i) {
17379
17331
  target[i + targetStart] = this[i + start];
17380
17332
  }
@@ -17387,7 +17339,7 @@ function requireJson2csv_umd() {
17387
17339
  }
17388
17340
  return len;
17389
17341
  };
17390
- Buffer3.prototype.fill = function fill(val, start, end, encoding) {
17342
+ Buffer2.prototype.fill = function fill(val, start, end, encoding) {
17391
17343
  if (typeof val === "string") {
17392
17344
  if (typeof start === "string") {
17393
17345
  encoding = start;
@@ -17406,7 +17358,7 @@ function requireJson2csv_umd() {
17406
17358
  if (encoding !== void 0 && typeof encoding !== "string") {
17407
17359
  throw new TypeError("encoding must be a string");
17408
17360
  }
17409
- if (typeof encoding === "string" && !Buffer3.isEncoding(encoding)) {
17361
+ if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) {
17410
17362
  throw new TypeError("Unknown encoding: " + encoding);
17411
17363
  }
17412
17364
  } else if (typeof val === "number") {
@@ -17427,7 +17379,7 @@ function requireJson2csv_umd() {
17427
17379
  this[i] = val;
17428
17380
  }
17429
17381
  } else {
17430
- var bytes = internalIsBuffer(val) ? val : utf8ToBytes(new Buffer3(val, encoding).toString());
17382
+ var bytes = internalIsBuffer(val) ? val : utf8ToBytes(new Buffer2(val, encoding).toString());
17431
17383
  var len = bytes.length;
17432
17384
  for (i = 0; i < end - start; ++i) {
17433
17385
  this[i + start] = bytes[i % len];
@@ -18107,9 +18059,9 @@ function requireJson2csv_umd() {
18107
18059
  return ret;
18108
18060
  };
18109
18061
  BufferList.prototype.concat = function(n) {
18110
- if (this.length === 0) return Buffer3.alloc(0);
18062
+ if (this.length === 0) return Buffer2.alloc(0);
18111
18063
  if (this.length === 1) return this.head.data;
18112
- var ret = Buffer3.allocUnsafe(n >>> 0);
18064
+ var ret = Buffer2.allocUnsafe(n >>> 0);
18113
18065
  var p = this.head;
18114
18066
  var i = 0;
18115
18067
  while (p) {
@@ -18119,7 +18071,7 @@ function requireJson2csv_umd() {
18119
18071
  }
18120
18072
  return ret;
18121
18073
  };
18122
- var isBufferEncoding = Buffer3.isEncoding || function(encoding) {
18074
+ var isBufferEncoding = Buffer2.isEncoding || function(encoding) {
18123
18075
  switch (encoding && encoding.toLowerCase()) {
18124
18076
  case "hex":
18125
18077
  case "utf8":
@@ -18162,7 +18114,7 @@ function requireJson2csv_umd() {
18162
18114
  this.write = passThroughWrite;
18163
18115
  return;
18164
18116
  }
18165
- this.charBuffer = new Buffer3(6);
18117
+ this.charBuffer = new Buffer2(6);
18166
18118
  this.charReceived = 0;
18167
18119
  this.charLength = 0;
18168
18120
  }
@@ -18312,7 +18264,7 @@ function requireJson2csv_umd() {
18312
18264
  if (!state.objectMode && typeof chunk === "string") {
18313
18265
  encoding = encoding || state.defaultEncoding;
18314
18266
  if (encoding !== state.encoding) {
18315
- chunk = Buffer3.from(chunk, encoding);
18267
+ chunk = Buffer2.from(chunk, encoding);
18316
18268
  encoding = "";
18317
18269
  }
18318
18270
  }
@@ -18804,7 +18756,7 @@ function requireJson2csv_umd() {
18804
18756
  return ret;
18805
18757
  }
18806
18758
  function copyFromBuffer(n, list) {
18807
- var ret = Buffer3.allocUnsafe(n);
18759
+ var ret = Buffer2.allocUnsafe(n);
18808
18760
  var p = list.head;
18809
18761
  var c = 1;
18810
18762
  p.data.copy(ret);
@@ -18936,7 +18888,7 @@ function requireJson2csv_umd() {
18936
18888
  var er = false;
18937
18889
  if (chunk === null) {
18938
18890
  er = new TypeError("May not write null values to stream");
18939
- } else if (!Buffer3.isBuffer(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
18891
+ } else if (!Buffer2.isBuffer(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
18940
18892
  er = new TypeError("Invalid non-string/buffer chunk");
18941
18893
  }
18942
18894
  if (er) {
@@ -18953,7 +18905,7 @@ function requireJson2csv_umd() {
18953
18905
  cb = encoding;
18954
18906
  encoding = null;
18955
18907
  }
18956
- if (Buffer3.isBuffer(chunk)) encoding = "buffer";
18908
+ if (Buffer2.isBuffer(chunk)) encoding = "buffer";
18957
18909
  else if (!encoding) encoding = state.defaultEncoding;
18958
18910
  if (typeof cb !== "function") cb = nop;
18959
18911
  if (state.ended) writeAfterEnd(this, cb);
@@ -18982,13 +18934,13 @@ function requireJson2csv_umd() {
18982
18934
  };
18983
18935
  function decodeChunk(state, chunk, encoding) {
18984
18936
  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
18985
- chunk = Buffer3.from(chunk, encoding);
18937
+ chunk = Buffer2.from(chunk, encoding);
18986
18938
  }
18987
18939
  return chunk;
18988
18940
  }
18989
18941
  function writeOrBuffer(stream, state, chunk, encoding, cb) {
18990
18942
  chunk = decodeChunk(state, chunk, encoding);
18991
- if (Buffer3.isBuffer(chunk)) encoding = "buffer";
18943
+ if (Buffer2.isBuffer(chunk)) encoding = "buffer";
18992
18944
  var len = state.objectMode ? 1 : chunk.length;
18993
18945
  state.length += len;
18994
18946
  var ret = state.length < state.highWaterMark;
@@ -20111,7 +20063,7 @@ function requireJson2csv_umd() {
20111
20063
  this.tState = START;
20112
20064
  this.value = void 0;
20113
20065
  this.string = void 0;
20114
- this.stringBuffer = Buffer3.alloc ? Buffer3.alloc(STRING_BUFFER_SIZE) : new Buffer3(STRING_BUFFER_SIZE);
20066
+ this.stringBuffer = Buffer2.alloc ? Buffer2.alloc(STRING_BUFFER_SIZE) : new Buffer2(STRING_BUFFER_SIZE);
20115
20067
  this.stringBufferOffset = 0;
20116
20068
  this.unicode = void 0;
20117
20069
  this.highSurrogate = void 0;
@@ -20121,7 +20073,7 @@ function requireJson2csv_umd() {
20121
20073
  this.state = VALUE;
20122
20074
  this.bytes_remaining = 0;
20123
20075
  this.bytes_in_sequence = 0;
20124
- this.temp_buffs = { "2": new Buffer3(2), "3": new Buffer3(3), "4": new Buffer3(4) };
20076
+ this.temp_buffs = { "2": new Buffer2(2), "3": new Buffer2(3), "4": new Buffer2(4) };
20125
20077
  this.offset = -1;
20126
20078
  }
20127
20079
  Parser.toknam = function(code) {
@@ -20173,7 +20125,7 @@ function requireJson2csv_umd() {
20173
20125
  this.stringBufferOffset += size;
20174
20126
  };
20175
20127
  proto.write = function(buffer) {
20176
- if (typeof buffer === "string") buffer = new Buffer3(buffer);
20128
+ if (typeof buffer === "string") buffer = new Buffer2(buffer);
20177
20129
  var n;
20178
20130
  for (var i = 0, l = buffer.length; i < l; i++) {
20179
20131
  if (this.tState === START) {
@@ -20244,7 +20196,7 @@ function requireJson2csv_umd() {
20244
20196
  this.string += this.stringBuffer.toString("utf8", 0, this.stringBufferOffset);
20245
20197
  this.stringBufferOffset = 0;
20246
20198
  this.onToken(STRING, this.string);
20247
- this.offset += Buffer3.byteLength(this.string, "utf8") + 1;
20199
+ this.offset += Buffer2.byteLength(this.string, "utf8") + 1;
20248
20200
  this.string = void 0;
20249
20201
  } else if (n === 92) {
20250
20202
  this.tState = STRING2;
@@ -20293,16 +20245,16 @@ function requireJson2csv_umd() {
20293
20245
  var intVal = parseInt(this.unicode, 16);
20294
20246
  this.unicode = void 0;
20295
20247
  if (this.highSurrogate !== void 0 && intVal >= 56320 && intVal < 57343 + 1) {
20296
- this.appendStringBuf(new Buffer3(String.fromCharCode(this.highSurrogate, intVal)));
20248
+ this.appendStringBuf(new Buffer2(String.fromCharCode(this.highSurrogate, intVal)));
20297
20249
  this.highSurrogate = void 0;
20298
20250
  } else if (this.highSurrogate === void 0 && intVal >= 55296 && intVal < 56319 + 1) {
20299
20251
  this.highSurrogate = intVal;
20300
20252
  } else {
20301
20253
  if (this.highSurrogate !== void 0) {
20302
- this.appendStringBuf(new Buffer3(String.fromCharCode(this.highSurrogate)));
20254
+ this.appendStringBuf(new Buffer2(String.fromCharCode(this.highSurrogate)));
20303
20255
  this.highSurrogate = void 0;
20304
20256
  }
20305
- this.appendStringBuf(new Buffer3(String.fromCharCode(intVal)));
20257
+ this.appendStringBuf(new Buffer2(String.fromCharCode(intVal)));
20306
20258
  }
20307
20259
  this.tState = STRING1;
20308
20260
  }
@@ -21050,9 +21002,8 @@ class ObsSetsAnndataLoader extends AbstractTwoStepLoader {
21050
21002
  this.tablePath = null;
21051
21003
  }
21052
21004
  loadObsIndices() {
21053
- var _a3;
21054
21005
  const { options } = this;
21055
- const obsIndexPromises = (_a3 = options.obsSets) == null ? void 0 : _a3.map(({ path }) => path).map((pathOrPaths) => {
21006
+ const obsIndexPromises = options.obsSets?.map(({ path }) => path).map((pathOrPaths) => {
21056
21007
  if (Array.isArray(pathOrPaths)) {
21057
21008
  if (pathOrPaths.length > 0) {
21058
21009
  return this.dataSource.loadObsIndex(pathOrPaths[0]);
@@ -21064,15 +21015,13 @@ class ObsSetsAnndataLoader extends AbstractTwoStepLoader {
21064
21015
  return Promise.all(obsIndexPromises);
21065
21016
  }
21066
21017
  loadCellSetIds() {
21067
- var _a3;
21068
21018
  const { options } = this;
21069
- const cellSetZarrLocation = (_a3 = options.obsSets) == null ? void 0 : _a3.map(({ path }) => path);
21019
+ const cellSetZarrLocation = options.obsSets?.map(({ path }) => path);
21070
21020
  return this.dataSource.loadObsColumns(cellSetZarrLocation);
21071
21021
  }
21072
21022
  loadCellSetScores() {
21073
- var _a3;
21074
21023
  const { options } = this;
21075
- const cellSetScoreZarrLocation = (_a3 = options.obsSets) == null ? void 0 : _a3.map((option) => option.scorePath || void 0);
21024
+ const cellSetScoreZarrLocation = options.obsSets?.map((option) => option.scorePath || void 0);
21076
21025
  return this.dataSource.loadObsColumns(cellSetScoreZarrLocation);
21077
21026
  }
21078
21027
  async load() {
@@ -21162,7 +21111,7 @@ class FeatureLabelsAnndataLoader extends AbstractTwoStepLoader {
21162
21111
  {
21163
21112
  featureIndex,
21164
21113
  featureLabels,
21165
- featureLabelsMap: new Map(featureIndex.map((key, i) => [key, featureLabels == null ? void 0 : featureLabels[i]]))
21114
+ featureLabelsMap: new Map(featureIndex.map((key, i) => [key, featureLabels?.[i]]))
21166
21115
  },
21167
21116
  null
21168
21117
  );
@@ -21174,13 +21123,12 @@ class ObsFeatureColumnsAnndataLoader extends AbstractTwoStepLoader {
21174
21123
  * @returns {Promise} A promise for an array of columns.
21175
21124
  */
21176
21125
  async loadObsFeatureColumns() {
21177
- var _a3;
21178
21126
  const { options } = this;
21179
21127
  if (this.obsFeatureColumns) {
21180
21128
  return this.obsFeatureColumns;
21181
21129
  }
21182
21130
  if (!this.obsFeatureColumns) {
21183
- const colPaths = (_a3 = options.obsFeatureColumns) == null ? void 0 : _a3.map(({ path }) => path);
21131
+ const colPaths = options.obsFeatureColumns?.map(({ path }) => path);
21184
21132
  const firstPath = colPaths[0];
21185
21133
  const obsIndex = await this.dataSource.loadObsIndex(firstPath);
21186
21134
  const featureIndex = colPaths.map((colPath) => basename(colPath));
@@ -21243,9 +21191,8 @@ class SampleEdgesAnndataLoader extends AbstractTwoStepLoader {
21243
21191
  }
21244
21192
  class SampleSetsAnndataLoader extends AbstractTwoStepLoader {
21245
21193
  loadObsIndices() {
21246
- var _a3;
21247
21194
  const { options } = this;
21248
- const obsIndexPromises = (_a3 = options.sampleSets) == null ? void 0 : _a3.map(({ path }) => path).map((pathOrPaths) => {
21195
+ const obsIndexPromises = options.sampleSets?.map(({ path }) => path).map((pathOrPaths) => {
21249
21196
  if (Array.isArray(pathOrPaths)) {
21250
21197
  if (pathOrPaths.length > 0) {
21251
21198
  return this.dataSource.loadDataFrameIndex(pathOrPaths[0]);
@@ -21257,15 +21204,13 @@ class SampleSetsAnndataLoader extends AbstractTwoStepLoader {
21257
21204
  return Promise.all(obsIndexPromises);
21258
21205
  }
21259
21206
  loadCellSetIds() {
21260
- var _a3;
21261
21207
  const { options } = this;
21262
- const cellSetZarrLocation = (_a3 = options.sampleSets) == null ? void 0 : _a3.map(({ path }) => path);
21208
+ const cellSetZarrLocation = options.sampleSets?.map(({ path }) => path);
21263
21209
  return this.dataSource.loadObsColumns(cellSetZarrLocation);
21264
21210
  }
21265
21211
  loadCellSetScores() {
21266
- var _a3;
21267
21212
  const { options } = this;
21268
- const cellSetScoreZarrLocation = (_a3 = options.sampleSets) == null ? void 0 : _a3.map((option) => option.scorePath || void 0);
21213
+ const cellSetScoreZarrLocation = options.sampleSets?.map((option) => option.scorePath || void 0);
21269
21214
  return this.dataSource.loadObsColumns(cellSetScoreZarrLocation);
21270
21215
  }
21271
21216
  async load() {
@@ -21550,14 +21495,13 @@ class FeatureStatsAnndataLoader2 extends AbstractTwoStepLoader {
21550
21495
  Object.values(metadata.comparisons).forEach((comparisonGroupObject) => {
21551
21496
  const { results } = comparisonGroupObject;
21552
21497
  results.forEach((resultObject) => {
21553
- var _a3;
21554
21498
  const {
21555
21499
  analysis_type,
21556
21500
  analysis_params,
21557
21501
  coordination_values
21558
21502
  // path,
21559
21503
  } = resultObject;
21560
- if (analysis_type === targetAnalysisType && ((_a3 = analysis_params == null ? void 0 : analysis_params.pertpy_hypergeometric) == null ? void 0 : _a3.enrichr_library_name) === targetFeatureSetLibrary) {
21504
+ if (analysis_type === targetAnalysisType && analysis_params?.pertpy_hypergeometric?.enrichr_library_name === targetFeatureSetLibrary) {
21561
21505
  if (sampleSetSelection) {
21562
21506
  rawObsSetSelection.forEach((obsSetPath) => {
21563
21507
  if (isEqual([obsSetPath], coordination_values.obsSetFilter)) {
@@ -21691,7 +21635,7 @@ class ObsSetStatsAnndataLoader extends AbstractTwoStepLoader {
21691
21635
  const { sampleSetSelection, obsSetSelection } = volcanoOptions || {};
21692
21636
  const rawObsSetSelection = obsSetSelection;
21693
21637
  const rawSampleSetSelection = sampleSetSelection;
21694
- if (!sampleSetSelection || (sampleSetSelection == null ? void 0 : sampleSetSelection.length) !== 2) {
21638
+ if (!sampleSetSelection || sampleSetSelection?.length !== 2) {
21695
21639
  return null;
21696
21640
  }
21697
21641
  if (!obsSetSelection) {
@@ -21699,7 +21643,7 @@ class ObsSetStatsAnndataLoader extends AbstractTwoStepLoader {
21699
21643
  }
21700
21644
  const metadata = await this.loadMetadata();
21701
21645
  const rawObsSetGroups = Array.from(
21702
- new Set(rawObsSetSelection.map((setPath) => setPath == null ? void 0 : setPath[0]))
21646
+ new Set(rawObsSetSelection.map((setPath) => setPath?.[0]))
21703
21647
  );
21704
21648
  const matchingComparisons = [];
21705
21649
  Object.values(metadata.comparisons).forEach((comparisonGroupObject) => {