igv 2.15.11 → 2.15.13

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/README.md CHANGED
@@ -18,19 +18,19 @@ Below are examples and a quickstart guide. See the [Wiki](https://github.com/ig
18
18
 
19
19
  # Examples
20
20
 
21
- ***[Alignments](https://igv.org/web/release/2.15.10/examples/cram-vcf.html)***
21
+ ***[Alignments](https://igv.org/web/release/2.15.13/examples/cram-vcf.html)***
22
22
 
23
- ***[Interactions](https://igv.org/web/release/2.15.10/examples/interact.html)***
23
+ ***[Interactions](https://igv.org/web/release/2.15.13/examples/interact.html)***
24
24
 
25
- ***[Copy number](https://igv.org/web/release/2.15.10/examples/copyNumber.html)***
25
+ ***[Copy number](https://igv.org/web/release/2.15.13/examples/copyNumber.html)***
26
26
 
27
- ***[Multiple regions](https://igv.org/web/release/2.15.10/examples/multi-locus.html)***
27
+ ***[Multiple regions](https://igv.org/web/release/2.15.13/examples/multi-locus.html)***
28
28
 
29
- ***[Mutation Annotation Format (MAF)](https://igv.org/web/release/2.15.10/examples/maf-tcga.html)***
29
+ ***[Mutation Annotation Format (MAF)](https://igv.org/web/release/2.15.13/examples/maf-tcga.html)***
30
30
 
31
- ***[Variant color options](https://igv.org/web/release/2.15.10/examples/variant-colors.html)***
31
+ ***[Variant color options](https://igv.org/web/release/2.15.13/examples/variant-colors.html)***
32
32
 
33
- ***[More](https://igv.org/web/release/2.15.10/examples/)***
33
+ ***[More](https://igv.org/web/release/2.15.13/examples/)***
34
34
 
35
35
 
36
36
  # Quickstart
@@ -39,18 +39,18 @@ Below are examples and a quickstart guide. See the [Wiki](https://github.com/ig
39
39
  igv.js consists of a single javascript file with no external dependencies.
40
40
 
41
41
  Pre-built files for script include, AMD, or CJS module systems (igv.min.js) and an ES6 module (igv.esm.min.js)
42
- can be downloaded from [https://cdn.jsdelivr.net/npm/igv@2.15.10/dist/](https://cdn.jsdelivr.net/npm/igv@2.15.10/dist/).
42
+ can be downloaded from [https://cdn.jsdelivr.net/npm/igv@2.15.13/dist/](https://cdn.jsdelivr.net/npm/igv@2.15.13/dist/).
43
43
 
44
44
  To import igv as an ES6 module
45
45
 
46
46
  ```javascript
47
- import igv from "https://cdn.jsdelivr.net/npm/igv@2.15.10/dist/igv.esm.min.js"
47
+ import igv from "https://cdn.jsdelivr.net/npm/igv@2.15.13/dist/igv.esm.min.js"
48
48
  ```
49
49
 
50
50
  Or as a script include (defines the "igv" global)
51
51
 
52
52
  ```html
53
- <script src="https://cdn.jsdelivr.net/npm/igv@2.15.10/dist/igv.min.js"></script>
53
+ <script src="https://cdn.jsdelivr.net/npm/igv@2.15.13/dist/igv.min.js"></script>
54
54
  ```
55
55
 
56
56
  Alternatively you can install with npm
package/dist/igv.esm.js CHANGED
@@ -19240,7 +19240,7 @@ BinaryHeap.prototype = {
19240
19240
  */
19241
19241
 
19242
19242
  function _random(min, max) {
19243
- return Math.random() * (max - min) + min;
19243
+ return Math.random() * (max - min) + min
19244
19244
  }
19245
19245
 
19246
19246
  const IGVColor = {
@@ -19260,7 +19260,7 @@ const IGVColor = {
19260
19260
  accumulation.pop();
19261
19261
  accumulation.push(IGVColor.rgbColor(16, 16, 16));
19262
19262
 
19263
- return accumulation;
19263
+ return accumulation
19264
19264
  },
19265
19265
 
19266
19266
  rgbToHex: function (rgb) {
@@ -19268,7 +19268,7 @@ const IGVColor = {
19268
19268
  return (rgb && rgb.length === 4) ? "#" +
19269
19269
  ("0" + parseInt(rgb[1], 10).toString(16)).slice(-2) +
19270
19270
  ("0" + parseInt(rgb[2], 10).toString(16)).slice(-2) +
19271
- ("0" + parseInt(rgb[3], 10).toString(16)).slice(-2) : '';
19271
+ ("0" + parseInt(rgb[3], 10).toString(16)).slice(-2) : ''
19272
19272
  },
19273
19273
 
19274
19274
  hexToRgb: function (hex) {
@@ -19276,10 +19276,10 @@ const IGVColor = {
19276
19276
  var cooked = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
19277
19277
 
19278
19278
  if (null === cooked) {
19279
- return undefined;
19279
+ return undefined
19280
19280
  }
19281
19281
 
19282
- return "rgb(" + parseInt(cooked[1], 16) + "," + parseInt(cooked[2], 16) + "," + parseInt(cooked[3], 16) + ")";
19282
+ return "rgb(" + parseInt(cooked[1], 16) + "," + parseInt(cooked[2], 16) + "," + parseInt(cooked[3], 16) + ")"
19283
19283
  },
19284
19284
 
19285
19285
  /**
@@ -19307,25 +19307,25 @@ const IGVColor = {
19307
19307
  switch (i % 6) {
19308
19308
  case 0:
19309
19309
  r = v, g = t, b = p;
19310
- break;
19310
+ break
19311
19311
  case 1:
19312
19312
  r = q, g = v, b = p;
19313
- break;
19313
+ break
19314
19314
  case 2:
19315
19315
  r = p, g = v, b = t;
19316
- break;
19316
+ break
19317
19317
  case 3:
19318
19318
  r = p, g = q, b = v;
19319
- break;
19319
+ break
19320
19320
  case 4:
19321
19321
  r = t, g = p, b = v;
19322
- break;
19322
+ break
19323
19323
  case 5:
19324
19324
  r = v, g = p, b = q;
19325
- break;
19325
+ break
19326
19326
  }
19327
19327
 
19328
- return [Math.floor(r * 255), Math.floor(g * 255), Math.floor(b * 255)];
19328
+ return [Math.floor(r * 255), Math.floor(g * 255), Math.floor(b * 255)]
19329
19329
  },
19330
19330
 
19331
19331
  /**
@@ -19357,16 +19357,16 @@ const IGVColor = {
19357
19357
  b = IGVColor.hue2rgb(p, q, h - 1 / 3);
19358
19358
  }
19359
19359
 
19360
- return [r * 255, g * 255, b * 255];
19360
+ return [r * 255, g * 255, b * 255]
19361
19361
  },
19362
19362
 
19363
19363
  hue2rgb: (p, q, t) => {
19364
19364
  if (t < 0) t += 1;
19365
19365
  if (t > 1) t -= 1;
19366
- if (t < 1 / 6) return p + (q - p) * 6 * t;
19367
- if (t < 1 / 2) return q;
19368
- if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
19369
- return p;
19366
+ if (t < 1 / 6) return p + (q - p) * 6 * t
19367
+ if (t < 1 / 2) return q
19368
+ if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6
19369
+ return p
19370
19370
  },
19371
19371
 
19372
19372
  rgbaColor: function (r, g, b, a) {
@@ -19376,7 +19376,7 @@ const IGVColor = {
19376
19376
  b = IGVMath.clamp(b, 0, 255);
19377
19377
  a = IGVMath.clamp(a, 0.0, 1.0);
19378
19378
 
19379
- return "rgba(" + r + "," + g + "," + b + "," + a + ")";
19379
+ return "rgba(" + r + "," + g + "," + b + "," + a + ")"
19380
19380
  },
19381
19381
 
19382
19382
  rgbColor: function (r, g, b) {
@@ -19385,14 +19385,14 @@ const IGVColor = {
19385
19385
  g = IGVMath.clamp(g, 0, 255);
19386
19386
  b = IGVMath.clamp(b, 0, 255);
19387
19387
 
19388
- return "rgb(" + r + "," + g + "," + b + ")";
19388
+ return "rgb(" + r + "," + g + "," + b + ")"
19389
19389
  },
19390
19390
 
19391
19391
  greyScale: function (value) {
19392
19392
 
19393
19393
  var grey = IGVMath.clamp(value, 0, 255);
19394
19394
 
19395
- return "rgb(" + grey + "," + grey + "," + grey + ")";
19395
+ return "rgb(" + grey + "," + grey + "," + grey + ")"
19396
19396
  },
19397
19397
 
19398
19398
  randomGrey: function (min, max) {
@@ -19402,7 +19402,7 @@ const IGVColor = {
19402
19402
 
19403
19403
  var g = Math.round(_random(min, max)).toString(10);
19404
19404
 
19405
- return "rgb(" + g + "," + g + "," + g + ")";
19405
+ return "rgb(" + g + "," + g + "," + g + ")"
19406
19406
  },
19407
19407
 
19408
19408
  randomRGB: function (min, max) {
@@ -19414,7 +19414,7 @@ const IGVColor = {
19414
19414
  var g = Math.round(_random(min, max)).toString(10);
19415
19415
  var b = Math.round(_random(min, max)).toString(10);
19416
19416
 
19417
- return "rgb(" + r + "," + g + "," + b + ")";
19417
+ return "rgb(" + r + "," + g + "," + b + ")"
19418
19418
  },
19419
19419
 
19420
19420
  randomRGBConstantAlpha: function (min, max, alpha) {
@@ -19426,12 +19426,12 @@ const IGVColor = {
19426
19426
  var g = Math.round(_random(min, max)).toString(10);
19427
19427
  var b = Math.round(_random(min, max)).toString(10);
19428
19428
 
19429
- return "rgba(" + r + "," + g + "," + b + "," + alpha + ")";
19429
+ return "rgba(" + r + "," + g + "," + b + "," + alpha + ")"
19430
19430
  },
19431
19431
 
19432
19432
  addAlpha: function (color, alpha) {
19433
19433
 
19434
- if(color === "0" || color === ".") {
19434
+ if (color === "0" || color === ".") {
19435
19435
  color = "rgb(0,0,0)";
19436
19436
  } else {
19437
19437
  const c = this.colorNameToHex(color);
@@ -19444,7 +19444,7 @@ const IGVColor = {
19444
19444
 
19445
19445
  if (color.startsWith("rgba")) {
19446
19446
  const idx = color.lastIndexOf(",");
19447
- return color.substring(0, idx+1) + alpha.toString() + ")";
19447
+ return color.substring(0, idx + 1) + alpha.toString() + ")"
19448
19448
  }
19449
19449
 
19450
19450
  if (isHex) {
@@ -19452,38 +19452,37 @@ const IGVColor = {
19452
19452
  }
19453
19453
 
19454
19454
  if (color.startsWith("rgb")) {
19455
- return color.replace("rgb", "rgba").replace(")", ", " + alpha + ")");
19455
+ return color.replace("rgb", "rgba").replace(")", ", " + alpha + ")")
19456
19456
  } else {
19457
19457
  console.log(color + " is not an rgb style string");
19458
- return color;
19458
+ return color
19459
19459
  }
19460
19460
  },
19461
19461
 
19462
19462
  rgbComponents: function (color) {
19463
19463
 
19464
- if(color === "0" || color === ".") {
19465
- return [0,0,0];
19464
+ if (color === "0" || color === ".") {
19465
+ return [0, 0, 0]
19466
19466
  }
19467
19467
  const isHex = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color);
19468
19468
  if (isHex) {
19469
19469
  color = IGVColor.hexToRgb(color);
19470
19470
  } else {
19471
- if(!color.startsWith("rgb")) {
19471
+ if (!color.startsWith("rgb")) {
19472
19472
  const hex = this.colorNameToHex(color);
19473
19473
  color = this.hexToRgb(hex);
19474
19474
  }
19475
19475
  }
19476
19476
 
19477
19477
  if (color.startsWith("rgb(")) {
19478
- return color.substring(4, color.length-1).split(",").map(s => Number.parseInt(s.trim()));
19479
- } else if (color.startsWith("rgba(")) {
19480
- return color.substring(5, color.length-1).split(",").map((s, i) => {
19478
+ return color.substring(4, color.length - 1).split(",").map(s => Number.parseInt(s.trim()))
19479
+ } else if (color.startsWith("rgba(")) {
19480
+ return color.substring(5, color.length - 1).split(",").map((s, i) => {
19481
19481
  s = s.trim();
19482
19482
  return i === 3 ? Number.parseFloat(s) : Number.parseInt(s)
19483
- });
19484
- }
19485
- else {
19486
- throw Error("Unrecognized color string: color");
19483
+ })
19484
+ } else {
19485
+ throw Error("Unrecognized color string: color")
19487
19486
  }
19488
19487
  },
19489
19488
 
@@ -19500,19 +19499,46 @@ const IGVColor = {
19500
19499
  g = Math.floor(alpha * src[1] + (1 - alpha) * dest[1]),
19501
19500
  b = Math.floor(alpha * src[2] + (1 - alpha) * dest[2]);
19502
19501
 
19503
- return "rgb(" + r + "," + g + "," + b + ")";
19502
+ return "rgb(" + r + "," + g + "," + b + ")"
19504
19503
 
19505
19504
  },
19506
19505
 
19507
-
19506
+ /**
19507
+ * Return a color represented by the string. If the string is not a recognized color format return the
19508
+ * string itself. This function exists for backward compatibility, createColorStringSafe is preferredz
19509
+ * @param str
19510
+ */
19508
19511
  createColorString: function (str) {
19512
+ // Excel will quote color strings, strip all quotes
19513
+ const color = this.createColorStringSafe(str);
19514
+ return color ? color : str
19515
+ },
19516
+
19517
+ /**
19518
+ * If str is a recognized color format return a string encoding the color
19519
+ * @param str
19520
+ */
19521
+ createColorStringSafe: function (str) {
19509
19522
  // Excel will quote color strings, strip all quotes
19510
19523
  str = stripQuotes$1(str);
19511
19524
 
19512
- if (str.includes(",")) {
19513
- return str.startsWith("rgb") ? str : "rgb(" + str + ")";
19514
- } else {
19515
- return str;
19525
+ if (str.startsWith('rgb(') && str.endsWith(')')) {
19526
+ return str
19527
+ }
19528
+ if (str.startsWith('#') && str.length < 8) {
19529
+ return str
19530
+ }
19531
+
19532
+ // See if string is a recognized web color
19533
+ const hex = this.colorNameToHex(str);
19534
+ if (hex) {
19535
+ return hex
19536
+ }
19537
+
19538
+ // UCSC format (e.g. 0,0,255)
19539
+ const tokens = str.split(",");
19540
+ if (tokens.length === 3 && isColorComponent(tokens[0]) && isColorComponent(tokens[1]) && isColorComponent(tokens[2])) {
19541
+ return `rgb(${str})`
19516
19542
  }
19517
19543
  },
19518
19544
 
@@ -19520,8 +19546,8 @@ const IGVColor = {
19520
19546
 
19521
19547
  let src;
19522
19548
  let hexColor = this.colorNameToHex(color);
19523
- if(hexColor) {
19524
- src = IGVColor.hexToRgb(hexColor);
19549
+ if (hexColor) {
19550
+ src = IGVColor.hexToRgb(hexColor);
19525
19551
  } else {
19526
19552
  src = color.startsWith('rgb(') ? color : IGVColor.hexToRgb(color);
19527
19553
  }
@@ -19532,7 +19558,7 @@ const IGVColor = {
19532
19558
  const g = Math.max(0, Math.min(255, Number.parseInt(components[1].trim()) + amt));
19533
19559
  const b = Math.max(0, Math.min(255, Number.parseInt(components[2].trim()) + amt));
19534
19560
 
19535
- return 'rgb(' + r.toString() + ',' + g.toString() + ',' + b.toString() + ')';
19561
+ return 'rgb(' + r.toString() + ',' + g.toString() + ',' + b.toString() + ')'
19536
19562
 
19537
19563
  },
19538
19564
 
@@ -19691,10 +19717,15 @@ const IGVColor = {
19691
19717
  "lightslategrey": "#778899",
19692
19718
  "slategrey": "#708090"
19693
19719
  };
19694
- return definedColorNames[colorName];
19720
+ return definedColorNames[colorName]
19695
19721
  }
19696
19722
  };
19697
19723
 
19724
+ function isColorComponent(str) {
19725
+ const num = Number.parseInt(str);
19726
+ return !Number.isNaN(num) && num >= 0 && num <= 255
19727
+ }
19728
+
19698
19729
  // Support for oauth token based authorization
19699
19730
  // This class supports explicit setting of an oauth token either globally or for specific hosts.
19700
19731
  //
@@ -19921,7 +19952,7 @@ async function init$1(config) {
19921
19952
 
19922
19953
  // Note: callback is added when accessToken is requested
19923
19954
  const codeClientConfig = {
19924
- client_id: config.client_id,
19955
+ client_id: config.client_id || config.clientId,
19925
19956
  scope: config.scope || 'https://www.googleapis.com/auth/userinfo.profile',
19926
19957
  state: config.state || 'igv',
19927
19958
  error: (err) => {
@@ -20001,7 +20032,7 @@ async function getAccessToken(scope) {
20001
20032
 
20002
20033
  function getScopeForURL(url) {
20003
20034
  if (isGoogleDriveURL(url)) {
20004
- return "https://www.googleapis.com/auth/drive.readonly"
20035
+ return "https://www.googleapis.com/auth/drive.file"
20005
20036
  } else if (isGoogleStorageURL(url)) {
20006
20037
  return "https://www.googleapis.com/auth/devstorage.read_only"
20007
20038
  } else {
@@ -20237,6 +20268,24 @@ class IGVXhr {
20237
20268
  }
20238
20269
  }
20239
20270
 
20271
+ /**
20272
+ * A wrapper around loadArrayBuffer that inflates gzipped data
20273
+ * @param url
20274
+ * @param options
20275
+ * @returns {Promise<Uint8Array>}
20276
+ */
20277
+ async loadByteArray(url, options) {
20278
+ const arraybuffer = await this.loadArrayBuffer(url, options);
20279
+ let plain;
20280
+ if (isgzipped(arraybuffer)) {
20281
+ plain = ungzip_blocks(arraybuffer);
20282
+ } else {
20283
+ plain = new Uint8Array(arraybuffer);
20284
+ }
20285
+ return plain
20286
+ }
20287
+
20288
+
20240
20289
  async loadJson(url, options) {
20241
20290
  options = options || {};
20242
20291
  const method = options.method || (options.sendData ? "POST" : "GET");
@@ -20407,7 +20456,7 @@ class IGVXhr {
20407
20456
  }
20408
20457
  } else if (xhr.status === 416) {
20409
20458
  handleError(Error(`416 Unsatisfiable Range`));
20410
- } else if ((typeof gapi !== "undefined") &&
20459
+ } else if (isInitialized() &&
20411
20460
  ((xhr.status === 404 || xhr.status === 401 || xhr.status === 403) &&
20412
20461
  isGoogleURL(url)) &&
20413
20462
  !options.retries) {
@@ -25616,7 +25665,7 @@ const Cytoband = function (start, end, name, typestain) {
25616
25665
  }
25617
25666
  };
25618
25667
 
25619
- const _version = "2.15.11";
25668
+ const _version = "2.15.13";
25620
25669
  function version() {
25621
25670
  return _version
25622
25671
  }
@@ -41910,11 +41959,7 @@ function renderFeatureLabel(ctx, feature, featureX, featureX1, featureY, referen
41910
41959
  if (name === undefined) name = feature.id || feature.ID;
41911
41960
  if (!name || name === '.') return
41912
41961
 
41913
-
41914
- let pixelXOffset = options.pixelXOffset || 0;
41915
- const t1 = Math.max(featureX, -pixelXOffset);
41916
- const t2 = Math.min(featureX1, -pixelXOffset + options.viewportWidth);
41917
- let centerX = (t1 + t2) / 2;
41962
+ let centerX = (featureX + featureX1) / 2;
41918
41963
 
41919
41964
  let transform;
41920
41965
  if (this.displayMode === "COLLAPSED" && this.labelDisplayMode === "SLANT") {
@@ -51290,6 +51335,13 @@ class BlobFile {
51290
51335
  }
51291
51336
  }
51292
51337
 
51338
+ var __defProp = Object.defineProperty;
51339
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
51340
+ var __publicField = (obj, key, value) => {
51341
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
51342
+ return value;
51343
+ };
51344
+
51293
51345
  // esm/core.js
51294
51346
  async function _unpack_struct_from_async(structure, async_buf, offset = 0) {
51295
51347
  var output = /* @__PURE__ */ new Map();
@@ -51406,7 +51458,7 @@ var Struct = class {
51406
51458
  return big_endian;
51407
51459
  }
51408
51460
  async unpack_from_async(fmt, async_buf, offset) {
51409
- var offset = Number(offset || 0);
51461
+ offset = Number.parseInt(offset || 0);
51410
51462
  const total_size = this.calcsize(fmt);
51411
51463
  const local_buffer = await async_buf.slice(offset, offset + total_size);
51412
51464
  let local_offset = 0;
@@ -51433,7 +51485,7 @@ var Struct = class {
51433
51485
  return output;
51434
51486
  }
51435
51487
  unpack_from(fmt, buffer, offset) {
51436
- var offset = Number(offset || 0);
51488
+ offset = Number.parseInt(offset || 0);
51437
51489
  const total_size = this.calcsize(fmt);
51438
51490
  const local_buffer = buffer.slice(offset, offset + total_size);
51439
51491
  let local_offset = 0;
@@ -51471,7 +51523,7 @@ var DataView64 = class extends DataView {
51471
51523
  const left = BigInt(this.getUint32(byteOffset, littleEndian));
51472
51524
  const right = BigInt(this.getUint32(byteOffset + 4, littleEndian));
51473
51525
  let combined = littleEndian ? left + (right << 32n) : (left << 32n) + right;
51474
- return Number(combined);
51526
+ return Number.parseInt(combined);
51475
51527
  }
51476
51528
  getInt64(byteOffset, littleEndian) {
51477
51529
  var low, high;
@@ -51483,7 +51535,7 @@ var DataView64 = class extends DataView {
51483
51535
  low = this.getUint32(byteOffset + 4, false);
51484
51536
  }
51485
51537
  let combined = BigInt(low) + (BigInt(high) << 32n);
51486
- return Number(combined);
51538
+ return Number.parseInt(combined);
51487
51539
  }
51488
51540
  getString(byteOffset, littleEndian, length) {
51489
51541
  const str_buffer = this.buffer.slice(byteOffset, byteOffset + length);
@@ -53936,14 +53988,17 @@ var AbstractBTree = class {
53936
53988
  }
53937
53989
  };
53938
53990
  var BTreeV1 = class extends AbstractBTree {
53939
- B_LINK_NODE = /* @__PURE__ */ new Map([
53940
- ["signature", "4s"],
53941
- ["node_type", "B"],
53942
- ["node_level", "B"],
53943
- ["entries_used", "H"],
53944
- ["left_sibling", "Q"],
53945
- ["right_sibling", "Q"]
53946
- ]);
53991
+ constructor() {
53992
+ super(...arguments);
53993
+ __publicField(this, "B_LINK_NODE", /* @__PURE__ */ new Map([
53994
+ ["signature", "4s"],
53995
+ ["node_type", "B"],
53996
+ ["node_level", "B"],
53997
+ ["entries_used", "H"],
53998
+ ["left_sibling", "Q"],
53999
+ ["right_sibling", "Q"]
54000
+ ]));
54001
+ }
53947
54002
  async _read_node_header(offset, node_level) {
53948
54003
  let node = await _unpack_struct_from_async(this.B_LINK_NODE, this.fh, offset);
53949
54004
  if (node_level != null) {
@@ -53955,9 +54010,9 @@ var BTreeV1 = class extends AbstractBTree {
53955
54010
  }
53956
54011
  };
53957
54012
  var BTreeV1Groups = class extends BTreeV1 {
53958
- NODE_TYPE = 0;
53959
54013
  constructor(fh, offset) {
53960
54014
  super(fh, offset);
54015
+ __publicField(this, "NODE_TYPE", 0);
53961
54016
  this.ready = this.init();
53962
54017
  }
53963
54018
  async _read_node(offset, node_level) {
@@ -53989,9 +54044,9 @@ var BTreeV1Groups = class extends BTreeV1 {
53989
54044
  }
53990
54045
  };
53991
54046
  var BTreeV1RawDataChunks = class extends BTreeV1 {
53992
- NODE_TYPE = 1;
53993
54047
  constructor(fh, offset, dims) {
53994
54048
  super(fh, offset);
54049
+ __publicField(this, "NODE_TYPE", 1);
53995
54050
  this.dims = dims;
53996
54051
  this.ready = this.init();
53997
54052
  }
@@ -54030,7 +54085,7 @@ var BTreeV1RawDataChunks = class extends BTreeV1 {
54030
54085
  if (size != 8) {
54031
54086
  throw "NotImplementedError('Unsupported Reference type')";
54032
54087
  }
54033
- var dtype = "<u8";
54088
+ dtype = "<u8";
54034
54089
  item_getter = "getUint64";
54035
54090
  item_big_endian = false;
54036
54091
  item_size = 8;
@@ -54137,26 +54192,26 @@ var BTreeV1RawDataChunks = class extends BTreeV1 {
54137
54192
  }
54138
54193
  };
54139
54194
  var BTreeV2 = class extends AbstractBTree {
54140
- B_TREE_HEADER = /* @__PURE__ */ new Map([
54141
- ["signature", "4s"],
54142
- ["version", "B"],
54143
- ["node_type", "B"],
54144
- ["node_size", "I"],
54145
- ["record_size", "H"],
54146
- ["depth", "H"],
54147
- ["split_percent", "B"],
54148
- ["merge_percent", "B"],
54149
- ["root_address", "Q"],
54150
- ["root_nrecords", "H"],
54151
- ["total_nrecords", "Q"]
54152
- ]);
54153
- B_LINK_NODE = /* @__PURE__ */ new Map([
54154
- ["signature", "4s"],
54155
- ["version", "B"],
54156
- ["node_type", "B"]
54157
- ]);
54158
54195
  constructor(fh, offset) {
54159
54196
  super(fh, offset);
54197
+ __publicField(this, "B_TREE_HEADER", /* @__PURE__ */ new Map([
54198
+ ["signature", "4s"],
54199
+ ["version", "B"],
54200
+ ["node_type", "B"],
54201
+ ["node_size", "I"],
54202
+ ["record_size", "H"],
54203
+ ["depth", "H"],
54204
+ ["split_percent", "B"],
54205
+ ["merge_percent", "B"],
54206
+ ["root_address", "Q"],
54207
+ ["root_nrecords", "H"],
54208
+ ["total_nrecords", "Q"]
54209
+ ]));
54210
+ __publicField(this, "B_LINK_NODE", /* @__PURE__ */ new Map([
54211
+ ["signature", "4s"],
54212
+ ["version", "B"],
54213
+ ["node_type", "B"]
54214
+ ]));
54160
54215
  this.ready = this.init();
54161
54216
  }
54162
54217
  async _read_root_node() {
@@ -54282,7 +54337,10 @@ var BTreeV2 = class extends AbstractBTree {
54282
54337
  }
54283
54338
  };
54284
54339
  var BTreeV2GroupNames = class extends BTreeV2 {
54285
- NODE_TYPE = 5;
54340
+ constructor() {
54341
+ super(...arguments);
54342
+ __publicField(this, "NODE_TYPE", 5);
54343
+ }
54286
54344
  async _parse_record(buf, offset, size) {
54287
54345
  let namehash = (await struct.unpack_from_async("<I", buf, offset))[0];
54288
54346
  offset += 4;
@@ -54291,7 +54349,10 @@ var BTreeV2GroupNames = class extends BTreeV2 {
54291
54349
  }
54292
54350
  };
54293
54351
  var BTreeV2GroupOrders = class extends BTreeV2 {
54294
- NODE_TYPE = 6;
54352
+ constructor() {
54353
+ super(...arguments);
54354
+ __publicField(this, "NODE_TYPE", 6);
54355
+ }
54295
54356
  async _parse_record(buf, offset, size) {
54296
54357
  let creationorder = (await struct.unpack_from_async("<Q", buf, offset))[0];
54297
54358
  offset += 8;
@@ -55725,8 +55786,11 @@ var Dataset = class extends Array {
55725
55786
  }
55726
55787
  async getValue(data) {
55727
55788
  const dtype = await this.dtype;
55728
- if (dtype.startsWith("S")) {
55729
- return (await data).map((s) => s.substr(0, s.indexOf("\0")));
55789
+ if ((typeof dtype === "string" || dtype instanceof String) && dtype.startsWith("S")) {
55790
+ return (await data).map((s) => {
55791
+ let idx = s.indexOf("\0");
55792
+ return idx >= 0 ? s.substring(0, idx) : s;
55793
+ });
55730
55794
  } else {
55731
55795
  return data;
55732
55796
  }