@loaders.gl/3d-tiles 3.2.12 → 3.3.0-alpha.10

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.
Files changed (165) hide show
  1. package/dist/dist.min.js +1247 -1414
  2. package/dist/es5/bundle.js +0 -1
  3. package/dist/es5/bundle.js.map +1 -1
  4. package/dist/es5/cesium-ion-loader.js +7 -26
  5. package/dist/es5/cesium-ion-loader.js.map +1 -1
  6. package/dist/es5/index.js +14 -23
  7. package/dist/es5/index.js.map +1 -1
  8. package/dist/es5/lib/classes/helpers/tile-3d-accessor-utils.js +1 -5
  9. package/dist/es5/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
  10. package/dist/es5/lib/classes/tile-3d-batch-table-hierarchy.js +1 -40
  11. package/dist/es5/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
  12. package/dist/es5/lib/classes/tile-3d-batch-table.js +12 -59
  13. package/dist/es5/lib/classes/tile-3d-batch-table.js.map +1 -1
  14. package/dist/es5/lib/classes/tile-3d-feature-table.js +4 -23
  15. package/dist/es5/lib/classes/tile-3d-feature-table.js.map +1 -1
  16. package/dist/es5/lib/constants.js +3 -1
  17. package/dist/es5/lib/constants.js.map +1 -1
  18. package/dist/es5/lib/encoders/encode-3d-tile-batched-model.js +7 -16
  19. package/dist/es5/lib/encoders/encode-3d-tile-batched-model.js.map +1 -1
  20. package/dist/es5/lib/encoders/encode-3d-tile-composite.js +2 -11
  21. package/dist/es5/lib/encoders/encode-3d-tile-composite.js.map +1 -1
  22. package/dist/es5/lib/encoders/encode-3d-tile-instanced-model.js +10 -17
  23. package/dist/es5/lib/encoders/encode-3d-tile-instanced-model.js.map +1 -1
  24. package/dist/es5/lib/encoders/encode-3d-tile-point-cloud.js +8 -16
  25. package/dist/es5/lib/encoders/encode-3d-tile-point-cloud.js.map +1 -1
  26. package/dist/es5/lib/encoders/encode-3d-tile.js +0 -12
  27. package/dist/es5/lib/encoders/encode-3d-tile.js.map +1 -1
  28. package/dist/es5/lib/encoders/helpers/encode-3d-tile-header.js +6 -9
  29. package/dist/es5/lib/encoders/helpers/encode-3d-tile-header.js.map +1 -1
  30. package/dist/es5/lib/ion/ion.js +5 -46
  31. package/dist/es5/lib/ion/ion.js.map +1 -1
  32. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js +2 -11
  33. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
  34. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-normals.js +0 -8
  35. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
  36. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-positions.js +0 -5
  37. package/dist/es5/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
  38. package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js +19 -51
  39. package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
  40. package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js +6 -25
  41. package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
  42. package/dist/es5/lib/parsers/helpers/parse-3d-tile-header.js +1 -1
  43. package/dist/es5/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
  44. package/dist/es5/lib/parsers/helpers/parse-3d-tile-subtree.js +40 -49
  45. package/dist/es5/lib/parsers/helpers/parse-3d-tile-subtree.js.map +1 -1
  46. package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js +6 -14
  47. package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
  48. package/dist/es5/lib/parsers/helpers/parse-utils.js +1 -3
  49. package/dist/es5/lib/parsers/helpers/parse-utils.js.map +1 -1
  50. package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js +0 -16
  51. package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
  52. package/dist/es5/lib/parsers/parse-3d-tile-composite.js +1 -11
  53. package/dist/es5/lib/parsers/parse-3d-tile-composite.js.map +1 -1
  54. package/dist/es5/lib/parsers/parse-3d-tile-gltf.js +0 -8
  55. package/dist/es5/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
  56. package/dist/es5/lib/parsers/parse-3d-tile-header.js +127 -111
  57. package/dist/es5/lib/parsers/parse-3d-tile-header.js.map +1 -1
  58. package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js +5 -41
  59. package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  60. package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js +4 -71
  61. package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
  62. package/dist/es5/lib/parsers/parse-3d-tile.js +5 -28
  63. package/dist/es5/lib/parsers/parse-3d-tile.js.map +1 -1
  64. package/dist/es5/lib/utils/version.js +1 -1
  65. package/dist/es5/lib/utils/version.js.map +1 -1
  66. package/dist/es5/tile-3d-subtree-loader.js +0 -4
  67. package/dist/es5/tile-3d-subtree-loader.js.map +1 -1
  68. package/dist/es5/tile-3d-writer.js +0 -6
  69. package/dist/es5/tile-3d-writer.js.map +1 -1
  70. package/dist/es5/tiles-3d-loader.js +5 -55
  71. package/dist/es5/tiles-3d-loader.js.map +1 -1
  72. package/dist/es5/types.js.map +1 -1
  73. package/dist/esm/bundle.js +1 -1
  74. package/dist/esm/bundle.js.map +1 -1
  75. package/dist/esm/cesium-ion-loader.js +9 -7
  76. package/dist/esm/cesium-ion-loader.js.map +1 -1
  77. package/dist/esm/index.js +4 -0
  78. package/dist/esm/index.js.map +1 -1
  79. package/dist/esm/lib/classes/helpers/tile-3d-accessor-utils.js +1 -0
  80. package/dist/esm/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
  81. package/dist/esm/lib/classes/tile-3d-batch-table-hierarchy.js +3 -40
  82. package/dist/esm/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
  83. package/dist/esm/lib/classes/tile-3d-batch-table.js +7 -67
  84. package/dist/esm/lib/classes/tile-3d-batch-table.js.map +1 -1
  85. package/dist/esm/lib/classes/tile-3d-feature-table.js +5 -26
  86. package/dist/esm/lib/classes/tile-3d-feature-table.js.map +1 -1
  87. package/dist/esm/lib/constants.js +3 -0
  88. package/dist/esm/lib/constants.js.map +1 -1
  89. package/dist/esm/lib/encoders/encode-3d-tile-batched-model.js +5 -3
  90. package/dist/esm/lib/encoders/encode-3d-tile-batched-model.js.map +1 -1
  91. package/dist/esm/lib/encoders/encode-3d-tile-composite.js +2 -2
  92. package/dist/esm/lib/encoders/encode-3d-tile-composite.js.map +1 -1
  93. package/dist/esm/lib/encoders/encode-3d-tile-instanced-model.js +5 -1
  94. package/dist/esm/lib/encoders/encode-3d-tile-instanced-model.js.map +1 -1
  95. package/dist/esm/lib/encoders/encode-3d-tile-point-cloud.js +4 -1
  96. package/dist/esm/lib/encoders/encode-3d-tile-point-cloud.js.map +1 -1
  97. package/dist/esm/lib/encoders/encode-3d-tile.js +2 -6
  98. package/dist/esm/lib/encoders/encode-3d-tile.js.map +1 -1
  99. package/dist/esm/lib/encoders/helpers/encode-3d-tile-header.js +3 -3
  100. package/dist/esm/lib/encoders/helpers/encode-3d-tile-header.js.map +1 -1
  101. package/dist/esm/lib/ion/ion.js +10 -8
  102. package/dist/esm/lib/ion/ion.js.map +1 -1
  103. package/dist/esm/lib/parsers/helpers/normalize-3d-tile-colors.js +1 -6
  104. package/dist/esm/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
  105. package/dist/esm/lib/parsers/helpers/normalize-3d-tile-normals.js +0 -4
  106. package/dist/esm/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
  107. package/dist/esm/lib/parsers/helpers/normalize-3d-tile-positions.js +1 -2
  108. package/dist/esm/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
  109. package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js +4 -16
  110. package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
  111. package/dist/esm/lib/parsers/helpers/parse-3d-tile-gltf-view.js +6 -9
  112. package/dist/esm/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
  113. package/dist/esm/lib/parsers/helpers/parse-3d-tile-header.js +5 -2
  114. package/dist/esm/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
  115. package/dist/esm/lib/parsers/helpers/parse-3d-tile-subtree.js +26 -17
  116. package/dist/esm/lib/parsers/helpers/parse-3d-tile-subtree.js.map +1 -1
  117. package/dist/esm/lib/parsers/helpers/parse-3d-tile-tables.js +4 -7
  118. package/dist/esm/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
  119. package/dist/esm/lib/parsers/helpers/parse-utils.js +6 -1
  120. package/dist/esm/lib/parsers/helpers/parse-utils.js.map +1 -1
  121. package/dist/esm/lib/parsers/parse-3d-tile-batched-model.js +3 -4
  122. package/dist/esm/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
  123. package/dist/esm/lib/parsers/parse-3d-tile-composite.js +5 -1
  124. package/dist/esm/lib/parsers/parse-3d-tile-composite.js.map +1 -1
  125. package/dist/esm/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
  126. package/dist/esm/lib/parsers/parse-3d-tile-header.js +35 -40
  127. package/dist/esm/lib/parsers/parse-3d-tile-header.js.map +1 -1
  128. package/dist/esm/lib/parsers/parse-3d-tile-instanced-model.js +7 -25
  129. package/dist/esm/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  130. package/dist/esm/lib/parsers/parse-3d-tile-point-cloud.js +9 -37
  131. package/dist/esm/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
  132. package/dist/esm/lib/parsers/parse-3d-tile.js +8 -6
  133. package/dist/esm/lib/parsers/parse-3d-tile.js.map +1 -1
  134. package/dist/esm/lib/utils/version.js +2 -1
  135. package/dist/esm/lib/utils/version.js.map +1 -1
  136. package/dist/esm/tile-3d-subtree-loader.js +1 -0
  137. package/dist/esm/tile-3d-subtree-loader.js.map +1 -1
  138. package/dist/esm/tile-3d-writer.js +1 -1
  139. package/dist/esm/tile-3d-writer.js.map +1 -1
  140. package/dist/esm/tiles-3d-loader.js +3 -17
  141. package/dist/esm/tiles-3d-loader.js.map +1 -1
  142. package/dist/esm/types.js.map +1 -1
  143. package/dist/index.d.ts +1 -1
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/lib/classes/helpers/tile-3d-accessor-utils.d.ts +1 -1
  146. package/dist/lib/classes/tile-3d-batch-table.d.ts +1 -1
  147. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
  148. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +2 -13
  149. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts +2 -1
  150. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts.map +1 -1
  151. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js +36 -7
  152. package/dist/lib/parsers/parse-3d-tile-header.d.ts +5 -4
  153. package/dist/lib/parsers/parse-3d-tile-header.d.ts.map +1 -1
  154. package/dist/lib/parsers/parse-3d-tile-header.js +37 -18
  155. package/dist/tiles-3d-loader.d.ts.map +1 -1
  156. package/dist/tiles-3d-loader.js +1 -8
  157. package/dist/types.d.ts +26 -13
  158. package/dist/types.d.ts.map +1 -1
  159. package/package.json +7 -7
  160. package/src/index.ts +1 -1
  161. package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +2 -14
  162. package/src/lib/parsers/helpers/parse-3d-tile-subtree.ts +50 -7
  163. package/src/lib/parsers/parse-3d-tile-header.ts +59 -21
  164. package/src/tiles-3d-loader.ts +2 -16
  165. package/src/types.ts +18 -3
package/dist/dist.min.js CHANGED
@@ -14,19 +14,19 @@
14
14
  };
15
15
  var __export = (target, all) => {
16
16
  __markAsModule(target);
17
- for (var name8 in all)
18
- __defProp(target, name8, { get: all[name8], enumerable: true });
17
+ for (var name10 in all)
18
+ __defProp(target, name10, { get: all[name10], enumerable: true });
19
19
  };
20
- var __reExport = (target, module2, desc) => {
21
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
22
- for (let key of __getOwnPropNames(module2))
20
+ var __reExport = (target, module, desc) => {
21
+ if (module && typeof module === "object" || typeof module === "function") {
22
+ for (let key of __getOwnPropNames(module))
23
23
  if (!__hasOwnProp.call(target, key) && key !== "default")
24
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
24
+ __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
25
25
  }
26
26
  return target;
27
27
  };
28
- var __toModule = (module2) => {
29
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
28
+ var __toModule = (module) => {
29
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
30
30
  };
31
31
 
32
32
  // ../loader-utils/src/lib/env-utils/assert.ts
@@ -64,7 +64,7 @@
64
64
  var DEFAULT_VERSION, VERSION;
65
65
  var init_version = __esm({
66
66
  "../worker-utils/src/lib/env-utils/version.ts"() {
67
- DEFAULT_VERSION = "latest";
67
+ DEFAULT_VERSION = "beta";
68
68
  VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : DEFAULT_VERSION;
69
69
  if (typeof __VERSION__ === "undefined") {
70
70
  console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
@@ -252,9 +252,9 @@
252
252
  constructor(props) {
253
253
  this.terminated = false;
254
254
  this._loadableURL = "";
255
- const { name: name8, source, url } = props;
255
+ const { name: name10, source, url } = props;
256
256
  assert3(source || url);
257
- this.name = name8;
257
+ this.name = name10;
258
258
  this.source = source;
259
259
  this.url = url;
260
260
  this.onMessage = NOOP;
@@ -379,9 +379,9 @@
379
379
  this.onDebug = props.onDebug;
380
380
  }
381
381
  }
382
- async startJob(name8, onMessage2 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
382
+ async startJob(name10, onMessage2 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
383
383
  const startPromise = new Promise((onStart) => {
384
- this.jobQueue.push({ name: name8, onMessage: onMessage2, onError, onStart });
384
+ this.jobQueue.push({ name: name10, onMessage: onMessage2, onError, onStart });
385
385
  return this;
386
386
  });
387
387
  this._startQueuedJob();
@@ -432,8 +432,8 @@
432
432
  }
433
433
  if (this.count < this._getMaxConcurrency()) {
434
434
  this.count++;
435
- const name8 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
436
- return new WorkerThread({ name: name8, source: this.source, url: this.url });
435
+ const name10 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
436
+ return new WorkerThread({ name: name10, source: this.source, url: this.url });
437
437
  }
438
438
  return null;
439
439
  }
@@ -485,16 +485,16 @@
485
485
  }
486
486
  }
487
487
  getWorkerPool(options) {
488
- const { name: name8, source, url } = options;
489
- let workerPool = this.workerPools.get(name8);
488
+ const { name: name10, source, url } = options;
489
+ let workerPool = this.workerPools.get(name10);
490
490
  if (!workerPool) {
491
491
  workerPool = new WorkerPool({
492
- name: name8,
492
+ name: name10,
493
493
  source,
494
494
  url
495
495
  });
496
496
  workerPool.setProps(this._getWorkerPoolProps());
497
- this.workerPools.set(name8, workerPool);
497
+ this.workerPools.set(name10, workerPool);
498
498
  }
499
499
  return workerPool;
500
500
  }
@@ -536,7 +536,7 @@
536
536
  var init_get_worker_url = __esm({
537
537
  "../worker-utils/src/lib/worker-api/get-worker-url.ts"() {
538
538
  init_assert2();
539
- NPM_TAG = "latest";
539
+ NPM_TAG = "beta";
540
540
  }
541
541
  });
542
542
 
@@ -634,7 +634,7 @@
634
634
  node = __toModule(require_require_utils());
635
635
  init_assert2();
636
636
  init_version();
637
- LATEST = "latest";
637
+ LATEST = "beta";
638
638
  VERSION2 = typeof VERSION !== "undefined" ? VERSION : LATEST;
639
639
  loadLibraryPromises = {};
640
640
  }
@@ -663,10 +663,10 @@
663
663
  return loader.worker && options?.worker;
664
664
  }
665
665
  async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
666
- const name8 = loader.id;
666
+ const name10 = loader.id;
667
667
  const url = getWorkerURL(loader, options);
668
668
  const workerFarm = WorkerFarm.getWorkerFarm(options);
669
- const workerPool = workerFarm.getWorkerPool({ name: name8, url });
669
+ const workerPool = workerFarm.getWorkerPool({ name: name10, url });
670
670
  options = JSON.parse(JSON.stringify(options));
671
671
  context = JSON.parse(JSON.stringify(context || {}));
672
672
  const job = await workerPool.startJob("process-on-worker", onMessage.bind(null, parseOnMainThread));
@@ -1024,11 +1024,8 @@
1024
1024
  });
1025
1025
 
1026
1026
  // ../../node_modules/@math.gl/core/dist/esm/lib/common.js
1027
- function round(value) {
1028
- return Math.round(value / config.EPSILON) * config.EPSILON;
1029
- }
1030
1027
  function formatValue(value, {
1031
- precision = config.precision || 4
1028
+ precision = config.precision
1032
1029
  } = {}) {
1033
1030
  value = round(value);
1034
1031
  return "".concat(parseFloat(value.toPrecision(precision)));
@@ -1036,19 +1033,6 @@
1036
1033
  function isArray(value) {
1037
1034
  return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);
1038
1035
  }
1039
- function duplicateArray(array) {
1040
- return array.clone ? array.clone() : new Array(array.length);
1041
- }
1042
- function map(value, func, result) {
1043
- if (isArray(value)) {
1044
- result = result || duplicateArray(value);
1045
- for (let i2 = 0; i2 < result.length && i2 < value.length; ++i2) {
1046
- result[i2] = func(value[i2], i2, result);
1047
- }
1048
- return result;
1049
- }
1050
- return func(value);
1051
- }
1052
1036
  function toRadians(degrees2) {
1053
1037
  return radians(degrees2);
1054
1038
  }
@@ -1090,7 +1074,7 @@
1090
1074
  if (b && b.equals) {
1091
1075
  return b.equals(a2);
1092
1076
  }
1093
- if (Number.isFinite(a2) && Number.isFinite(b)) {
1077
+ if (typeof a2 === "number" && typeof b === "number") {
1094
1078
  return Math.abs(a2 - b) <= config.EPSILON * Math.max(1, Math.abs(a2), Math.abs(b));
1095
1079
  }
1096
1080
  return false;
@@ -1098,18 +1082,36 @@
1098
1082
  config.EPSILON = oldEpsilon;
1099
1083
  }
1100
1084
  }
1085
+ function round(value) {
1086
+ return Math.round(value / config.EPSILON) * config.EPSILON;
1087
+ }
1088
+ function duplicateArray(array) {
1089
+ return array.clone ? array.clone() : new Array(array.length);
1090
+ }
1091
+ function map(value, func, result) {
1092
+ if (isArray(value)) {
1093
+ const array = value;
1094
+ result = result || duplicateArray(array);
1095
+ for (let i2 = 0; i2 < result.length && i2 < array.length; ++i2) {
1096
+ result[i2] = func(value[i2], i2, result);
1097
+ }
1098
+ return result;
1099
+ }
1100
+ return func(value);
1101
+ }
1101
1102
  var RADIANS_TO_DEGREES, DEGREES_TO_RADIANS, config;
1102
1103
  var init_common = __esm({
1103
1104
  "../../node_modules/@math.gl/core/dist/esm/lib/common.js"() {
1104
1105
  RADIANS_TO_DEGREES = 1 / Math.PI * 180;
1105
1106
  DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
1106
- config = {};
1107
- config.EPSILON = 1e-12;
1108
- config.debug = false;
1109
- config.precision = 4;
1110
- config.printTypes = false;
1111
- config.printDegrees = false;
1112
- config.printRowMajor = true;
1107
+ config = {
1108
+ EPSILON: 1e-12,
1109
+ debug: false,
1110
+ precision: 4,
1111
+ printTypes: false,
1112
+ printDegrees: false,
1113
+ printRowMajor: true
1114
+ };
1113
1115
  }
1114
1116
  });
1115
1117
 
@@ -1139,24 +1141,25 @@
1139
1141
  var init_math_array = __esm({
1140
1142
  "../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js"() {
1141
1143
  init_common();
1142
- init_assert3();
1143
1144
  MathArray = class extends _extendableBuiltin(Array) {
1144
- get ELEMENTS() {
1145
- assert4(false);
1146
- return 0;
1147
- }
1148
1145
  clone() {
1149
1146
  return new this.constructor().copy(this);
1150
1147
  }
1151
- from(arrayOrObject) {
1152
- return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
1153
- }
1154
1148
  fromArray(array, offset = 0) {
1155
1149
  for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
1156
1150
  this[i2] = array[i2 + offset];
1157
1151
  }
1158
1152
  return this.check();
1159
1153
  }
1154
+ toArray(targetArray = [], offset = 0) {
1155
+ for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
1156
+ targetArray[offset + i2] = this[i2];
1157
+ }
1158
+ return targetArray;
1159
+ }
1160
+ from(arrayOrObject) {
1161
+ return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
1162
+ }
1160
1163
  to(arrayOrObject) {
1161
1164
  if (arrayOrObject === this) {
1162
1165
  return this;
@@ -1166,12 +1169,6 @@
1166
1169
  toTarget(target) {
1167
1170
  return target ? this.to(target) : this;
1168
1171
  }
1169
- toArray(array = [], offset = 0) {
1170
- for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
1171
- array[offset + i2] = this[i2];
1172
- }
1173
- return array;
1174
- }
1175
1172
  toFloat32Array() {
1176
1173
  return new Float32Array(this);
1177
1174
  }
@@ -1215,9 +1212,7 @@
1215
1212
  }
1216
1213
  lerp(a2, b, t2) {
1217
1214
  if (t2 === void 0) {
1218
- t2 = b;
1219
- b = a2;
1220
- a2 = this;
1215
+ return this.lerp(this, a2, b);
1221
1216
  }
1222
1217
  for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
1223
1218
  const ai = a2[i2];
@@ -1260,14 +1255,36 @@
1260
1255
  return this.check();
1261
1256
  }
1262
1257
  scale(scale5) {
1263
- if (Array.isArray(scale5)) {
1264
- return this.multiply(scale5);
1258
+ if (typeof scale5 === "number") {
1259
+ for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
1260
+ this[i2] *= scale5;
1261
+ }
1262
+ } else {
1263
+ for (let i2 = 0; i2 < this.ELEMENTS && i2 < scale5.length; ++i2) {
1264
+ this[i2] *= scale5[i2];
1265
+ }
1265
1266
  }
1267
+ return this.check();
1268
+ }
1269
+ multiplyByScalar(scalar) {
1266
1270
  for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
1267
- this[i2] *= scale5;
1271
+ this[i2] *= scalar;
1268
1272
  }
1269
1273
  return this.check();
1270
1274
  }
1275
+ check() {
1276
+ if (config.debug && !this.validate()) {
1277
+ throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
1278
+ }
1279
+ return this;
1280
+ }
1281
+ validate() {
1282
+ let valid = this.length === this.ELEMENTS;
1283
+ for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
1284
+ valid = valid && Number.isFinite(this[i2]);
1285
+ }
1286
+ return valid;
1287
+ }
1271
1288
  sub(a2) {
1272
1289
  return this.subtract(a2);
1273
1290
  }
@@ -1293,7 +1310,7 @@
1293
1310
  return this.check();
1294
1311
  }
1295
1312
  divideScalar(a2) {
1296
- return this.scale(1 / a2);
1313
+ return this.multiplyByScalar(1 / a2);
1297
1314
  }
1298
1315
  clampScalar(min, max) {
1299
1316
  for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
@@ -1301,25 +1318,9 @@
1301
1318
  }
1302
1319
  return this.check();
1303
1320
  }
1304
- multiplyByScalar(scalar) {
1305
- return this.scale(scalar);
1306
- }
1307
1321
  get elements() {
1308
1322
  return this;
1309
1323
  }
1310
- check() {
1311
- if (config.debug && !this.validate()) {
1312
- throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
1313
- }
1314
- return this;
1315
- }
1316
- validate() {
1317
- let valid = this.length === this.ELEMENTS;
1318
- for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
1319
- valid = valid && Number.isFinite(this[i2]);
1320
- }
1321
- return valid;
1322
- }
1323
1324
  };
1324
1325
  }
1325
1326
  });
@@ -1348,17 +1349,9 @@
1348
1349
  }
1349
1350
  return v;
1350
1351
  }
1351
- function deprecated(method, version) {
1352
- if (!map2[method]) {
1353
- map2[method] = true;
1354
- console.warn("".concat(method, " has been removed in version ").concat(version, ", see upgrade guide for more information"));
1355
- }
1356
- }
1357
- var map2;
1358
1352
  var init_validators = __esm({
1359
1353
  "../../node_modules/@math.gl/core/dist/esm/lib/validators.js"() {
1360
1354
  init_common();
1361
- map2 = {};
1362
1355
  }
1363
1356
  });
1364
1357
 
@@ -1370,14 +1363,6 @@
1370
1363
  init_validators();
1371
1364
  init_assert3();
1372
1365
  Vector = class extends MathArray {
1373
- get ELEMENTS() {
1374
- assert4(false);
1375
- return 0;
1376
- }
1377
- copy(vector) {
1378
- assert4(false);
1379
- return this;
1380
- }
1381
1366
  get x() {
1382
1367
  return this[0];
1383
1368
  }
@@ -1594,6 +1579,15 @@
1594
1579
  out[2] = a2[2];
1595
1580
  return out;
1596
1581
  }
1582
+ function vec4_transformMat2(out, a2, m) {
1583
+ const x = a2[0];
1584
+ const y = a2[1];
1585
+ out[0] = m[0] * x + m[2] * y;
1586
+ out[1] = m[1] * x + m[3] * y;
1587
+ out[2] = a2[2];
1588
+ out[3] = a2[3];
1589
+ return out;
1590
+ }
1597
1591
  function vec4_transformMat3(out, a2, m) {
1598
1592
  const x = a2[0];
1599
1593
  const y = a2[1];
@@ -1851,7 +1845,7 @@
1851
1845
  });
1852
1846
 
1853
1847
  // ../../node_modules/@math.gl/core/dist/esm/classes/vector3.js
1854
- var ORIGIN, constants, Vector3;
1848
+ var ORIGIN, ZERO, Vector3;
1855
1849
  var init_vector3 = __esm({
1856
1850
  "../../node_modules/@math.gl/core/dist/esm/classes/vector3.js"() {
1857
1851
  init_vector();
@@ -1860,10 +1854,13 @@
1860
1854
  init_vec3();
1861
1855
  init_gl_matrix_extras();
1862
1856
  ORIGIN = [0, 0, 0];
1863
- constants = {};
1864
1857
  Vector3 = class extends Vector {
1865
1858
  static get ZERO() {
1866
- return constants.ZERO = constants.ZERO || Object.freeze(new Vector3(0, 0, 0, 0));
1859
+ if (!ZERO) {
1860
+ ZERO = new Vector3(0, 0, 0);
1861
+ Object.freeze(ZERO);
1862
+ }
1863
+ return ZERO;
1867
1864
  }
1868
1865
  constructor(x = 0, y = 0, z = 0) {
1869
1866
  super(-0, -0, -0);
@@ -1973,6 +1970,113 @@
1973
1970
  }
1974
1971
  });
1975
1972
 
1973
+ // ../../node_modules/@math.gl/core/dist/esm/classes/vector4.js
1974
+ var ZERO2, Vector4;
1975
+ var init_vector4 = __esm({
1976
+ "../../node_modules/@math.gl/core/dist/esm/classes/vector4.js"() {
1977
+ init_vector();
1978
+ init_common();
1979
+ init_validators();
1980
+ init_vec3();
1981
+ init_gl_matrix_extras();
1982
+ Vector4 = class extends Vector {
1983
+ static get ZERO() {
1984
+ if (!ZERO2) {
1985
+ ZERO2 = new Vector4(0, 0, 0, 0);
1986
+ Object.freeze(ZERO2);
1987
+ }
1988
+ return ZERO2;
1989
+ }
1990
+ constructor(x = 0, y = 0, z = 0, w = 0) {
1991
+ super(-0, -0, -0, -0);
1992
+ if (isArray(x) && arguments.length === 1) {
1993
+ this.copy(x);
1994
+ } else {
1995
+ if (config.debug) {
1996
+ checkNumber(x);
1997
+ checkNumber(y);
1998
+ checkNumber(z);
1999
+ checkNumber(w);
2000
+ }
2001
+ this[0] = x;
2002
+ this[1] = y;
2003
+ this[2] = z;
2004
+ this[3] = w;
2005
+ }
2006
+ }
2007
+ set(x, y, z, w) {
2008
+ this[0] = x;
2009
+ this[1] = y;
2010
+ this[2] = z;
2011
+ this[3] = w;
2012
+ return this.check();
2013
+ }
2014
+ copy(array) {
2015
+ this[0] = array[0];
2016
+ this[1] = array[1];
2017
+ this[2] = array[2];
2018
+ this[3] = array[3];
2019
+ return this.check();
2020
+ }
2021
+ fromObject(object) {
2022
+ if (config.debug) {
2023
+ checkNumber(object.x);
2024
+ checkNumber(object.y);
2025
+ checkNumber(object.z);
2026
+ checkNumber(object.w);
2027
+ }
2028
+ this[0] = object.x;
2029
+ this[1] = object.y;
2030
+ this[2] = object.z;
2031
+ this[3] = object.w;
2032
+ return this;
2033
+ }
2034
+ toObject(object) {
2035
+ object.x = this[0];
2036
+ object.y = this[1];
2037
+ object.z = this[2];
2038
+ object.w = this[3];
2039
+ return object;
2040
+ }
2041
+ get ELEMENTS() {
2042
+ return 4;
2043
+ }
2044
+ get z() {
2045
+ return this[2];
2046
+ }
2047
+ set z(value) {
2048
+ this[2] = checkNumber(value);
2049
+ }
2050
+ get w() {
2051
+ return this[3];
2052
+ }
2053
+ set w(value) {
2054
+ this[3] = checkNumber(value);
2055
+ }
2056
+ transform(matrix4) {
2057
+ transformMat42(this, this, matrix4);
2058
+ return this.check();
2059
+ }
2060
+ transformByMatrix3(matrix3) {
2061
+ vec4_transformMat3(this, this, matrix3);
2062
+ return this.check();
2063
+ }
2064
+ transformByMatrix2(matrix2) {
2065
+ vec4_transformMat2(this, this, matrix2);
2066
+ return this.check();
2067
+ }
2068
+ transformByQuaternion(quaternion) {
2069
+ transformQuat(this, this, quaternion);
2070
+ return this.check();
2071
+ }
2072
+ applyMatrix4(m) {
2073
+ m.transform(this, this);
2074
+ return this;
2075
+ }
2076
+ };
2077
+ }
2078
+ });
2079
+
1976
2080
  // ../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js
1977
2081
  var Matrix;
1978
2082
  var init_matrix = __esm({
@@ -1980,16 +2084,7 @@
1980
2084
  init_math_array();
1981
2085
  init_validators();
1982
2086
  init_common();
1983
- init_assert3();
1984
2087
  Matrix = class extends MathArray {
1985
- get ELEMENTS() {
1986
- assert4(false);
1987
- return 0;
1988
- }
1989
- get RANK() {
1990
- assert4(false);
1991
- return 0;
1992
- }
1993
2088
  toString() {
1994
2089
  let string = "[";
1995
2090
  if (config.printRowMajor) {
@@ -2192,7 +2287,21 @@
2192
2287
  });
2193
2288
 
2194
2289
  // ../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js
2195
- var IDENTITY, ZERO, INDICES, constants2, Matrix3;
2290
+ function getZeroMatrix() {
2291
+ if (!ZERO_MATRIX3) {
2292
+ ZERO_MATRIX3 = new Matrix3([0, 0, 0, 0, 0, 0, 0, 0, 0]);
2293
+ Object.freeze(ZERO_MATRIX3);
2294
+ }
2295
+ return ZERO_MATRIX3;
2296
+ }
2297
+ function getIdentityMatrix() {
2298
+ if (!IDENTITY_MATRIX3) {
2299
+ IDENTITY_MATRIX3 = new Matrix3();
2300
+ Object.freeze(IDENTITY_MATRIX3);
2301
+ }
2302
+ return IDENTITY_MATRIX3;
2303
+ }
2304
+ var INDICES, IDENTITY_MATRIX, Matrix3, ZERO_MATRIX3, IDENTITY_MATRIX3;
2196
2305
  var init_matrix3 = __esm({
2197
2306
  "../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js"() {
2198
2307
  init_matrix();
@@ -2201,28 +2310,24 @@
2201
2310
  init_mat3();
2202
2311
  init_vec2();
2203
2312
  init_vec3();
2204
- IDENTITY = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
2205
- ZERO = Object.freeze([0, 0, 0, 0, 0, 0, 0, 0, 0]);
2206
- INDICES = Object.freeze({
2207
- COL0ROW0: 0,
2208
- COL0ROW1: 1,
2209
- COL0ROW2: 2,
2210
- COL1ROW0: 3,
2211
- COL1ROW1: 4,
2212
- COL1ROW2: 5,
2213
- COL2ROW0: 6,
2214
- COL2ROW1: 7,
2215
- COL2ROW2: 8
2216
- });
2217
- constants2 = {};
2313
+ (function(INDICES3) {
2314
+ INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
2315
+ INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
2316
+ INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
2317
+ INDICES3[INDICES3["COL1ROW0"] = 3] = "COL1ROW0";
2318
+ INDICES3[INDICES3["COL1ROW1"] = 4] = "COL1ROW1";
2319
+ INDICES3[INDICES3["COL1ROW2"] = 5] = "COL1ROW2";
2320
+ INDICES3[INDICES3["COL2ROW0"] = 6] = "COL2ROW0";
2321
+ INDICES3[INDICES3["COL2ROW1"] = 7] = "COL2ROW1";
2322
+ INDICES3[INDICES3["COL2ROW2"] = 8] = "COL2ROW2";
2323
+ })(INDICES || (INDICES = {}));
2324
+ IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
2218
2325
  Matrix3 = class extends Matrix {
2219
2326
  static get IDENTITY() {
2220
- constants2.IDENTITY = constants2.IDENTITY || Object.freeze(new Matrix3(IDENTITY));
2221
- return constants2.IDENTITY;
2327
+ return getIdentityMatrix();
2222
2328
  }
2223
2329
  static get ZERO() {
2224
- constants2.ZERO = constants2.ZERO || Object.freeze(new Matrix3(ZERO));
2225
- return constants2.ZERO;
2330
+ return getZeroMatrix();
2226
2331
  }
2227
2332
  get ELEMENTS() {
2228
2333
  return 9;
@@ -2233,10 +2338,12 @@
2233
2338
  get INDICES() {
2234
2339
  return INDICES;
2235
2340
  }
2236
- constructor(array) {
2341
+ constructor(array, ...args) {
2237
2342
  super(-0, -0, -0, -0, -0, -0, -0, -0, -0);
2238
2343
  if (arguments.length === 1 && Array.isArray(array)) {
2239
2344
  this.copy(array);
2345
+ } else if (args.length > 0) {
2346
+ this.copy([array, ...args]);
2240
2347
  } else {
2241
2348
  this.identity();
2242
2349
  }
@@ -2253,6 +2360,16 @@
2253
2360
  this[8] = array[8];
2254
2361
  return this.check();
2255
2362
  }
2363
+ identity() {
2364
+ return this.copy(IDENTITY_MATRIX);
2365
+ }
2366
+ fromObject(object) {
2367
+ return this.check();
2368
+ }
2369
+ fromQuaternion(q) {
2370
+ fromQuat(this, q);
2371
+ return this.check();
2372
+ }
2256
2373
  set(m00, m10, m20, m01, m11, m21, m02, m12, m22) {
2257
2374
  this[0] = m00;
2258
2375
  this[1] = m10;
@@ -2280,13 +2397,6 @@
2280
2397
  determinant() {
2281
2398
  return determinant(this);
2282
2399
  }
2283
- identity() {
2284
- return this.copy(IDENTITY);
2285
- }
2286
- fromQuaternion(q) {
2287
- fromQuat(this, q);
2288
- return this.check();
2289
- }
2290
2400
  transpose() {
2291
2401
  transpose(this, this);
2292
2402
  return this.check();
@@ -2311,7 +2421,7 @@
2311
2421
  if (Array.isArray(factor)) {
2312
2422
  scale(this, this, factor);
2313
2423
  } else {
2314
- scale(this, this, [factor, factor, factor]);
2424
+ scale(this, this, [factor, factor]);
2315
2425
  }
2316
2426
  return this.check();
2317
2427
  }
@@ -2320,32 +2430,30 @@
2320
2430
  return this.check();
2321
2431
  }
2322
2432
  transform(vector, result) {
2433
+ let out;
2323
2434
  switch (vector.length) {
2324
2435
  case 2:
2325
- result = transformMat3(result || [-0, -0], vector, this);
2436
+ out = transformMat3(result || [-0, -0], vector, this);
2326
2437
  break;
2327
2438
  case 3:
2328
- result = transformMat32(result || [-0, -0, -0], vector, this);
2439
+ out = transformMat32(result || [-0, -0, -0], vector, this);
2329
2440
  break;
2330
2441
  case 4:
2331
- result = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);
2442
+ out = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);
2332
2443
  break;
2333
2444
  default:
2334
2445
  throw new Error("Illegal vector");
2335
2446
  }
2336
- checkVector(result, vector.length);
2337
- return result;
2447
+ checkVector(out, vector.length);
2448
+ return out;
2338
2449
  }
2339
2450
  transformVector(vector, result) {
2340
- deprecated("Matrix3.transformVector");
2341
2451
  return this.transform(vector, result);
2342
2452
  }
2343
2453
  transformVector2(vector, result) {
2344
- deprecated("Matrix3.transformVector");
2345
2454
  return this.transform(vector, result);
2346
2455
  }
2347
2456
  transformVector3(vector, result) {
2348
- deprecated("Matrix3.transformVector");
2349
2457
  return this.transform(vector, result);
2350
2458
  }
2351
2459
  };
@@ -2774,7 +2882,7 @@
2774
2882
  out[15] = 0;
2775
2883
  return out;
2776
2884
  }
2777
- function perspective(out, fovy, aspect, near, far) {
2885
+ function perspectiveNO(out, fovy, aspect, near, far) {
2778
2886
  var f2 = 1 / Math.tan(fovy / 2), nf;
2779
2887
  out[0] = f2 / aspect;
2780
2888
  out[1] = 0;
@@ -2800,7 +2908,7 @@
2800
2908
  }
2801
2909
  return out;
2802
2910
  }
2803
- function ortho(out, left, right, bottom, top, near, far) {
2911
+ function orthoNO(out, left, right, bottom, top, near, far) {
2804
2912
  var lr = 1 / (left - right);
2805
2913
  var bt = 1 / (bottom - top);
2806
2914
  var nf = 1 / (near - far);
@@ -2889,9 +2997,12 @@
2889
2997
  out[15] = 1;
2890
2998
  return out;
2891
2999
  }
3000
+ var perspective, ortho;
2892
3001
  var init_mat4 = __esm({
2893
3002
  "../../node_modules/gl-matrix/esm/mat4.js"() {
2894
3003
  init_common2();
3004
+ perspective = perspectiveNO;
3005
+ ortho = orthoNO;
2895
3006
  }
2896
3007
  });
2897
3008
 
@@ -3021,48 +3132,90 @@
3021
3132
  });
3022
3133
 
3023
3134
  // ../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js
3024
- var IDENTITY2, ZERO2, INDICES2, constants3, Matrix4;
3135
+ function getZeroMatrix2() {
3136
+ if (!ZERO3) {
3137
+ ZERO3 = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
3138
+ Object.freeze(ZERO3);
3139
+ }
3140
+ return ZERO3;
3141
+ }
3142
+ function getIdentityMatrix2() {
3143
+ if (!IDENTITY) {
3144
+ IDENTITY = new Matrix4();
3145
+ Object.freeze(IDENTITY);
3146
+ }
3147
+ return IDENTITY;
3148
+ }
3149
+ function checkRadians(possiblyDegrees) {
3150
+ if (possiblyDegrees > Math.PI * 2) {
3151
+ throw Error("expected radians");
3152
+ }
3153
+ }
3154
+ function computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {
3155
+ const column0Row0 = 2 * near / (right - left);
3156
+ const column1Row1 = 2 * near / (top - bottom);
3157
+ const column2Row0 = (right + left) / (right - left);
3158
+ const column2Row1 = (top + bottom) / (top - bottom);
3159
+ const column2Row2 = -1;
3160
+ const column2Row3 = -1;
3161
+ const column3Row2 = -2 * near;
3162
+ result[0] = column0Row0;
3163
+ result[1] = 0;
3164
+ result[2] = 0;
3165
+ result[3] = 0;
3166
+ result[4] = 0;
3167
+ result[5] = column1Row1;
3168
+ result[6] = 0;
3169
+ result[7] = 0;
3170
+ result[8] = column2Row0;
3171
+ result[9] = column2Row1;
3172
+ result[10] = column2Row2;
3173
+ result[11] = column2Row3;
3174
+ result[12] = 0;
3175
+ result[13] = 0;
3176
+ result[14] = column3Row2;
3177
+ result[15] = 0;
3178
+ return result;
3179
+ }
3180
+ var INDICES2, DEFAULT_FOVY, DEFAULT_ASPECT, DEFAULT_NEAR, DEFAULT_FAR, IDENTITY_MATRIX2, Matrix4, ZERO3, IDENTITY;
3025
3181
  var init_matrix4 = __esm({
3026
3182
  "../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js"() {
3027
- init_validators();
3028
3183
  init_matrix();
3184
+ init_validators();
3029
3185
  init_gl_matrix_extras();
3030
3186
  init_mat4();
3031
3187
  init_vec2();
3032
3188
  init_vec3();
3033
3189
  init_vec4();
3034
- IDENTITY2 = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
3035
- ZERO2 = Object.freeze([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
3036
- INDICES2 = Object.freeze({
3037
- COL0ROW0: 0,
3038
- COL0ROW1: 1,
3039
- COL0ROW2: 2,
3040
- COL0ROW3: 3,
3041
- COL1ROW0: 4,
3042
- COL1ROW1: 5,
3043
- COL1ROW2: 6,
3044
- COL1ROW3: 7,
3045
- COL2ROW0: 8,
3046
- COL2ROW1: 9,
3047
- COL2ROW2: 10,
3048
- COL2ROW3: 11,
3049
- COL3ROW0: 12,
3050
- COL3ROW1: 13,
3051
- COL3ROW2: 14,
3052
- COL3ROW3: 15
3053
- });
3054
- constants3 = {};
3190
+ (function(INDICES3) {
3191
+ INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
3192
+ INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
3193
+ INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
3194
+ INDICES3[INDICES3["COL0ROW3"] = 3] = "COL0ROW3";
3195
+ INDICES3[INDICES3["COL1ROW0"] = 4] = "COL1ROW0";
3196
+ INDICES3[INDICES3["COL1ROW1"] = 5] = "COL1ROW1";
3197
+ INDICES3[INDICES3["COL1ROW2"] = 6] = "COL1ROW2";
3198
+ INDICES3[INDICES3["COL1ROW3"] = 7] = "COL1ROW3";
3199
+ INDICES3[INDICES3["COL2ROW0"] = 8] = "COL2ROW0";
3200
+ INDICES3[INDICES3["COL2ROW1"] = 9] = "COL2ROW1";
3201
+ INDICES3[INDICES3["COL2ROW2"] = 10] = "COL2ROW2";
3202
+ INDICES3[INDICES3["COL2ROW3"] = 11] = "COL2ROW3";
3203
+ INDICES3[INDICES3["COL3ROW0"] = 12] = "COL3ROW0";
3204
+ INDICES3[INDICES3["COL3ROW1"] = 13] = "COL3ROW1";
3205
+ INDICES3[INDICES3["COL3ROW2"] = 14] = "COL3ROW2";
3206
+ INDICES3[INDICES3["COL3ROW3"] = 15] = "COL3ROW3";
3207
+ })(INDICES2 || (INDICES2 = {}));
3208
+ DEFAULT_FOVY = 45 * Math.PI / 180;
3209
+ DEFAULT_ASPECT = 1;
3210
+ DEFAULT_NEAR = 0.1;
3211
+ DEFAULT_FAR = 500;
3212
+ IDENTITY_MATRIX2 = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
3055
3213
  Matrix4 = class extends Matrix {
3056
3214
  static get IDENTITY() {
3057
- constants3.IDENTITY = constants3.IDENTITY || Object.freeze(new Matrix4(IDENTITY2));
3058
- return constants3.IDENTITY;
3215
+ return getIdentityMatrix2();
3059
3216
  }
3060
3217
  static get ZERO() {
3061
- constants3.ZERO = constants3.ZERO || Object.freeze(new Matrix4(ZERO2));
3062
- return constants3.ZERO;
3063
- }
3064
- get INDICES() {
3065
- return INDICES2;
3218
+ return getZeroMatrix2();
3066
3219
  }
3067
3220
  get ELEMENTS() {
3068
3221
  return 16;
@@ -3070,6 +3223,9 @@
3070
3223
  get RANK() {
3071
3224
  return 4;
3072
3225
  }
3226
+ get INDICES() {
3227
+ return INDICES2;
3228
+ }
3073
3229
  constructor(array) {
3074
3230
  super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);
3075
3231
  if (arguments.length === 1 && Array.isArray(array)) {
@@ -3155,91 +3311,65 @@
3155
3311
  return result;
3156
3312
  }
3157
3313
  identity() {
3158
- return this.copy(IDENTITY2);
3314
+ return this.copy(IDENTITY_MATRIX2);
3159
3315
  }
3160
- fromQuaternion(q) {
3161
- fromQuat2(this, q);
3316
+ fromObject(object) {
3162
3317
  return this.check();
3163
3318
  }
3164
- frustum({
3165
- left,
3166
- right,
3167
- bottom,
3168
- top,
3169
- near,
3170
- far
3171
- }) {
3319
+ fromQuaternion(quaternion) {
3320
+ fromQuat2(this, quaternion);
3321
+ return this.check();
3322
+ }
3323
+ frustum(view) {
3324
+ const {
3325
+ left,
3326
+ right,
3327
+ bottom,
3328
+ top,
3329
+ near = DEFAULT_NEAR,
3330
+ far = DEFAULT_FAR
3331
+ } = view;
3172
3332
  if (far === Infinity) {
3173
- Matrix4._computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);
3333
+ computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);
3174
3334
  } else {
3175
3335
  frustum(this, left, right, bottom, top, near, far);
3176
3336
  }
3177
3337
  return this.check();
3178
3338
  }
3179
- static _computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {
3180
- const column0Row0 = 2 * near / (right - left);
3181
- const column1Row1 = 2 * near / (top - bottom);
3182
- const column2Row0 = (right + left) / (right - left);
3183
- const column2Row1 = (top + bottom) / (top - bottom);
3184
- const column2Row2 = -1;
3185
- const column2Row3 = -1;
3186
- const column3Row2 = -2 * near;
3187
- result[0] = column0Row0;
3188
- result[1] = 0;
3189
- result[2] = 0;
3190
- result[3] = 0;
3191
- result[4] = 0;
3192
- result[5] = column1Row1;
3193
- result[6] = 0;
3194
- result[7] = 0;
3195
- result[8] = column2Row0;
3196
- result[9] = column2Row1;
3197
- result[10] = column2Row2;
3198
- result[11] = column2Row3;
3199
- result[12] = 0;
3200
- result[13] = 0;
3201
- result[14] = column3Row2;
3202
- result[15] = 0;
3203
- return result;
3204
- }
3205
- lookAt(eye, center, up) {
3206
- if (arguments.length === 1) {
3207
- ({
3208
- eye,
3209
- center,
3210
- up
3211
- } = eye);
3212
- }
3213
- center = center || [0, 0, 0];
3214
- up = up || [0, 1, 0];
3339
+ lookAt(view) {
3340
+ const {
3341
+ eye,
3342
+ center = [0, 0, 0],
3343
+ up = [0, 1, 0]
3344
+ } = view;
3215
3345
  lookAt(this, eye, center, up);
3216
3346
  return this.check();
3217
3347
  }
3218
- ortho({
3219
- left,
3220
- right,
3221
- bottom,
3222
- top,
3223
- near = 0.1,
3224
- far = 500
3225
- }) {
3348
+ ortho(view) {
3349
+ const {
3350
+ left,
3351
+ right,
3352
+ bottom,
3353
+ top,
3354
+ near = DEFAULT_NEAR,
3355
+ far = DEFAULT_FAR
3356
+ } = view;
3226
3357
  ortho(this, left, right, bottom, top, near, far);
3227
3358
  return this.check();
3228
3359
  }
3229
- orthographic({
3230
- fovy = 45 * Math.PI / 180,
3231
- aspect = 1,
3232
- focalDistance = 1,
3233
- near = 0.1,
3234
- far = 500
3235
- }) {
3236
- if (fovy > Math.PI * 2) {
3237
- throw Error("radians");
3238
- }
3360
+ orthographic(view) {
3361
+ const {
3362
+ fovy = DEFAULT_FOVY,
3363
+ aspect = DEFAULT_ASPECT,
3364
+ focalDistance = 1,
3365
+ near = DEFAULT_NEAR,
3366
+ far = DEFAULT_FAR
3367
+ } = view;
3368
+ checkRadians(fovy);
3239
3369
  const halfY = fovy / 2;
3240
3370
  const top = focalDistance * Math.tan(halfY);
3241
3371
  const right = top * aspect;
3242
- return new Matrix4().ortho({
3372
+ return this.ortho({
3243
3373
  left: -right,
3244
3374
  right,
3245
3375
  bottom: -top,
@@ -3248,17 +3378,14 @@
3248
3378
  far
3249
3379
  });
3250
3380
  }
3251
- perspective({
3252
- fovy = void 0,
3253
- fov = 45 * Math.PI / 180,
3254
- aspect = 1,
3255
- near = 0.1,
3256
- far = 500
3257
- } = {}) {
3258
- fovy = fovy || fov;
3259
- if (fovy > Math.PI * 2) {
3260
- throw Error("radians");
3261
- }
3381
+ perspective(view) {
3382
+ const {
3383
+ fovy = 45 * Math.PI / 180,
3384
+ aspect = 1,
3385
+ near = 0.1,
3386
+ far = 500
3387
+ } = view;
3388
+ checkRadians(fovy);
3262
3389
  perspective(this, fovy, aspect, near, far);
3263
3390
  return this.check();
3264
3391
  }
@@ -3277,8 +3404,10 @@
3277
3404
  result[2] = this[14];
3278
3405
  return result;
3279
3406
  }
3280
- getRotation(result = [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0], scaleResult = null) {
3281
- const scale5 = this.getScale(scaleResult || [-0, -0, -0]);
3407
+ getRotation(result, scaleResult) {
3408
+ result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
3409
+ scaleResult = scaleResult || [-0, -0, -0];
3410
+ const scale5 = this.getScale(scaleResult);
3282
3411
  const inverseScale0 = 1 / scale5[0];
3283
3412
  const inverseScale1 = 1 / scale5[1];
3284
3413
  const inverseScale2 = 1 / scale5[2];
@@ -3300,8 +3429,10 @@
3300
3429
  result[15] = 1;
3301
3430
  return result;
3302
3431
  }
3303
- getRotationMatrix3(result = [-0, -0, -0, -0, -0, -0, -0, -0, -0], scaleResult = null) {
3304
- const scale5 = this.getScale(scaleResult || [-0, -0, -0]);
3432
+ getRotationMatrix3(result, scaleResult) {
3433
+ result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];
3434
+ scaleResult = scaleResult || [-0, -0, -0];
3435
+ const scale5 = this.getScale(scaleResult);
3305
3436
  const inverseScale0 = 1 / scale5[0];
3306
3437
  const inverseScale1 = 1 / scale5[1];
3307
3438
  const inverseScale2 = 1 / scale5[2];
@@ -3344,23 +3475,19 @@
3344
3475
  rotateZ2(this, this, radians2);
3345
3476
  return this.check();
3346
3477
  }
3347
- rotateXYZ([rx, ry, rz]) {
3348
- return this.rotateX(rx).rotateY(ry).rotateZ(rz);
3478
+ rotateXYZ(angleXYZ) {
3479
+ return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);
3349
3480
  }
3350
3481
  rotateAxis(radians2, axis) {
3351
3482
  rotate2(this, this, radians2, axis);
3352
3483
  return this.check();
3353
3484
  }
3354
3485
  scale(factor) {
3355
- if (Array.isArray(factor)) {
3356
- scale2(this, this, factor);
3357
- } else {
3358
- scale2(this, this, [factor, factor, factor]);
3359
- }
3486
+ scale2(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);
3360
3487
  return this.check();
3361
3488
  }
3362
- translate(vec) {
3363
- translate2(this, this, vec);
3489
+ translate(vector) {
3490
+ translate2(this, this, vector);
3364
3491
  return this.check();
3365
3492
  }
3366
3493
  transform(vector, result) {
@@ -3375,51 +3502,50 @@
3375
3502
  const {
3376
3503
  length: length4
3377
3504
  } = vector;
3505
+ let out;
3378
3506
  switch (length4) {
3379
3507
  case 2:
3380
- result = transformMat4(result || [-0, -0], vector, this);
3508
+ out = transformMat4(result || [-0, -0], vector, this);
3381
3509
  break;
3382
3510
  case 3:
3383
- result = transformMat42(result || [-0, -0, -0], vector, this);
3511
+ out = transformMat42(result || [-0, -0, -0], vector, this);
3384
3512
  break;
3385
3513
  default:
3386
3514
  throw new Error("Illegal vector");
3387
3515
  }
3388
- checkVector(result, vector.length);
3389
- return result;
3516
+ checkVector(out, vector.length);
3517
+ return out;
3390
3518
  }
3391
3519
  transformAsVector(vector, result) {
3520
+ let out;
3392
3521
  switch (vector.length) {
3393
3522
  case 2:
3394
- result = vec2_transformMat4AsVector(result || [-0, -0], vector, this);
3523
+ out = vec2_transformMat4AsVector(result || [-0, -0], vector, this);
3395
3524
  break;
3396
3525
  case 3:
3397
- result = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);
3526
+ out = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);
3398
3527
  break;
3399
3528
  default:
3400
3529
  throw new Error("Illegal vector");
3401
3530
  }
3402
- checkVector(result, vector.length);
3403
- return result;
3404
- }
3405
- makeRotationX(radians2) {
3406
- return this.identity().rotateX(radians2);
3407
- }
3408
- makeTranslation(x, y, z) {
3409
- return this.identity().translate([x, y, z]);
3531
+ checkVector(out, vector.length);
3532
+ return out;
3410
3533
  }
3411
3534
  transformPoint(vector, result) {
3412
- deprecated("Matrix4.transformPoint", "3.0");
3413
3535
  return this.transformAsPoint(vector, result);
3414
3536
  }
3415
3537
  transformVector(vector, result) {
3416
- deprecated("Matrix4.transformVector", "3.0");
3417
3538
  return this.transformAsPoint(vector, result);
3418
3539
  }
3419
3540
  transformDirection(vector, result) {
3420
- deprecated("Matrix4.transformDirection", "3.0");
3421
3541
  return this.transformAsVector(vector, result);
3422
3542
  }
3543
+ makeRotationX(radians2) {
3544
+ return this.identity().rotateX(radians2);
3545
+ }
3546
+ makeTranslation(x, y, z) {
3547
+ return this.identity().translate([x, y, z]);
3548
+ }
3423
3549
  };
3424
3550
  }
3425
3551
  });
@@ -3646,7 +3772,7 @@
3646
3772
  "../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js"() {
3647
3773
  init_math_array();
3648
3774
  init_validators();
3649
- init_assert3();
3775
+ init_vector4();
3650
3776
  init_quat();
3651
3777
  init_vec4();
3652
3778
  IDENTITY_QUATERNION = [0, 0, 0, 1];
@@ -3673,18 +3799,25 @@
3673
3799
  this[3] = w;
3674
3800
  return this.check();
3675
3801
  }
3676
- fromMatrix3(m) {
3677
- fromMat3(this, m);
3802
+ fromObject(object) {
3803
+ this[0] = object.x;
3804
+ this[1] = object.y;
3805
+ this[2] = object.z;
3806
+ this[3] = object.w;
3678
3807
  return this.check();
3679
3808
  }
3680
- identity() {
3681
- identity2(this);
3809
+ fromMatrix3(m) {
3810
+ fromMat3(this, m);
3682
3811
  return this.check();
3683
3812
  }
3684
3813
  fromAxisRotation(axis, rad) {
3685
3814
  setAxisAngle(this, axis, rad);
3686
3815
  return this.check();
3687
3816
  }
3817
+ identity() {
3818
+ identity2(this);
3819
+ return this.check();
3820
+ }
3688
3821
  setAxisAngle(axis, rad) {
3689
3822
  return this.fromAxisRotation(axis, rad);
3690
3823
  }
@@ -3721,20 +3854,14 @@
3721
3854
  lengthSquared() {
3722
3855
  return squaredLength2(this);
3723
3856
  }
3724
- dot(a2, b) {
3725
- if (b !== void 0) {
3726
- throw new Error("Quaternion.dot only takes one argument");
3727
- }
3857
+ dot(a2) {
3728
3858
  return dot3(this, a2);
3729
3859
  }
3730
3860
  rotationTo(vectorA, vectorB) {
3731
3861
  rotationTo(this, vectorA, vectorB);
3732
3862
  return this.check();
3733
3863
  }
3734
- add(a2, b) {
3735
- if (b !== void 0) {
3736
- throw new Error("Quaternion.add only takes one argument");
3737
- }
3864
+ add(a2) {
3738
3865
  add2(this, this, a2);
3739
3866
  return this.check();
3740
3867
  }
@@ -3751,16 +3878,17 @@
3751
3878
  return this.check();
3752
3879
  }
3753
3880
  lerp(a2, b, t2) {
3881
+ if (t2 === void 0) {
3882
+ return this.lerp(this, a2, b);
3883
+ }
3754
3884
  lerp2(this, a2, b, t2);
3755
3885
  return this.check();
3756
3886
  }
3757
- multiplyRight(a2, b) {
3758
- assert4(!b);
3887
+ multiplyRight(a2) {
3759
3888
  multiply3(this, this, a2);
3760
3889
  return this.check();
3761
3890
  }
3762
- multiplyLeft(a2, b) {
3763
- assert4(!b);
3891
+ multiplyLeft(a2) {
3764
3892
  multiply3(this, a2, this);
3765
3893
  return this.check();
3766
3894
  }
@@ -3792,25 +3920,32 @@
3792
3920
  scale4(this, this, b);
3793
3921
  return this.check();
3794
3922
  }
3795
- slerp(start, target, ratio) {
3923
+ slerp(arg0, arg1, arg2) {
3924
+ let start;
3925
+ let target;
3926
+ let ratio;
3796
3927
  switch (arguments.length) {
3797
3928
  case 1:
3798
3929
  ({
3799
3930
  start = IDENTITY_QUATERNION,
3800
3931
  target,
3801
3932
  ratio
3802
- } = arguments[0]);
3933
+ } = arg0);
3803
3934
  break;
3804
3935
  case 2:
3805
- [target, ratio] = arguments;
3806
3936
  start = this;
3937
+ target = arg0;
3938
+ ratio = arg1;
3807
3939
  break;
3808
3940
  default:
3941
+ start = arg0;
3942
+ target = arg1;
3943
+ ratio = arg2;
3809
3944
  }
3810
3945
  slerp(this, start, target, ratio);
3811
3946
  return this.check();
3812
3947
  }
3813
- transformVector4(vector, result = vector) {
3948
+ transformVector4(vector, result = new Vector4()) {
3814
3949
  transformQuat2(result, vector, this);
3815
3950
  return checkVector(result, 4);
3816
3951
  }
@@ -3820,11 +3955,11 @@
3820
3955
  setFromAxisAngle(axis, rad) {
3821
3956
  return this.setAxisAngle(axis, rad);
3822
3957
  }
3823
- premultiply(a2, b) {
3824
- return this.multiplyLeft(a2, b);
3958
+ premultiply(a2) {
3959
+ return this.multiplyLeft(a2);
3825
3960
  }
3826
- multiply(a2, b) {
3827
- return this.multiplyRight(a2, b);
3961
+ multiply(a2) {
3962
+ return this.multiplyRight(a2);
3828
3963
  }
3829
3964
  };
3830
3965
  }
@@ -3864,27 +3999,16 @@
3864
3999
  });
3865
4000
 
3866
4001
  // ../../node_modules/@math.gl/core/dist/esm/index.js
3867
- var globals3, global_3;
3868
4002
  var init_esm = __esm({
3869
4003
  "../../node_modules/@math.gl/core/dist/esm/index.js"() {
3870
- init_common();
3871
4004
  init_vector2();
3872
4005
  init_vector3();
3873
4006
  init_matrix3();
3874
4007
  init_matrix4();
3875
4008
  init_quaternion();
3876
- init_common();
3877
4009
  init_math_utils();
3878
4010
  init_assert3();
3879
- globals3 = {
3880
- self: typeof self !== "undefined" && self,
3881
- window: typeof window !== "undefined" && window,
3882
- global: typeof global !== "undefined" && global
3883
- };
3884
- global_3 = globals3.global || globals3.self || globals3.window;
3885
- global_3.mathgl = {
3886
- config
3887
- };
4011
+ init_common();
3888
4012
  }
3889
4013
  });
3890
4014
 
@@ -3907,65 +4031,67 @@
3907
4031
  });
3908
4032
 
3909
4033
  // ../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js
3910
- function fromCartographic(cartographic, result, map3 = noop) {
3911
- if (isArray(cartographic)) {
3912
- result[0] = map3(cartographic[0]);
3913
- result[1] = map3(cartographic[1]);
3914
- result[2] = cartographic[2];
3915
- } else if ("longitude" in cartographic) {
3916
- result[0] = map3(cartographic.longitude);
3917
- result[1] = map3(cartographic.latitude);
4034
+ function identity3(x) {
4035
+ return x;
4036
+ }
4037
+ function fromCartographic(cartographic, result = [], map2 = identity3) {
4038
+ if ("longitude" in cartographic) {
4039
+ result[0] = map2(cartographic.longitude);
4040
+ result[1] = map2(cartographic.latitude);
3918
4041
  result[2] = cartographic.height;
3919
- } else {
3920
- result[0] = map3(cartographic.x);
3921
- result[1] = map3(cartographic.y);
4042
+ } else if ("x" in cartographic) {
4043
+ result[0] = map2(cartographic.x);
4044
+ result[1] = map2(cartographic.y);
3922
4045
  result[2] = cartographic.z;
4046
+ } else {
4047
+ result[0] = map2(cartographic[0]);
4048
+ result[1] = map2(cartographic[1]);
4049
+ result[2] = cartographic[2];
3923
4050
  }
3924
4051
  return result;
3925
4052
  }
3926
- function fromCartographicToRadians(cartographic, vector = scratchVector) {
3927
- return fromCartographic(cartographic, vector, config._cartographicRadians ? noop : toRadians);
4053
+ function fromCartographicToRadians(cartographic, vector = []) {
4054
+ return fromCartographic(cartographic, vector, config._cartographicRadians ? identity3 : toRadians);
3928
4055
  }
3929
- function toCartographic(vector, cartographic, map3 = noop) {
3930
- if (isArray(cartographic)) {
3931
- cartographic[0] = map3(vector[0]);
3932
- cartographic[1] = map3(vector[1]);
3933
- cartographic[2] = vector[2];
3934
- } else if ("longitude" in cartographic) {
3935
- cartographic.longitude = map3(vector[0]);
3936
- cartographic.latitude = map3(vector[1]);
4056
+ function toCartographic(vector, cartographic, map2 = identity3) {
4057
+ if ("longitude" in cartographic) {
4058
+ cartographic.longitude = map2(vector[0]);
4059
+ cartographic.latitude = map2(vector[1]);
3937
4060
  cartographic.height = vector[2];
3938
- } else {
3939
- cartographic.x = map3(vector[0]);
3940
- cartographic.y = map3(vector[1]);
4061
+ } else if ("x" in cartographic) {
4062
+ cartographic.x = map2(vector[0]);
4063
+ cartographic.y = map2(vector[1]);
3941
4064
  cartographic.z = vector[2];
4065
+ } else {
4066
+ cartographic[0] = map2(vector[0]);
4067
+ cartographic[1] = map2(vector[1]);
4068
+ cartographic[2] = vector[2];
3942
4069
  }
3943
4070
  return cartographic;
3944
4071
  }
3945
4072
  function toCartographicFromRadians(vector, cartographic) {
3946
- return toCartographic(vector, cartographic, config._cartographicRadians ? noop : toDegrees);
4073
+ return toCartographic(vector, cartographic, config._cartographicRadians ? identity3 : toDegrees);
3947
4074
  }
3948
- var noop, scratchVector;
4075
+ var scratchVector;
3949
4076
  var init_type_utils = __esm({
3950
4077
  "../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js"() {
3951
4078
  init_esm();
3952
4079
  init_constants();
3953
- noop = (x) => x;
3954
4080
  scratchVector = new Vector3();
3955
4081
  }
3956
4082
  });
3957
4083
 
3958
4084
  // ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js
3959
- function scaleToGeodeticSurface(cartesian, ellipsoid, result = new Vector3()) {
4085
+ function scaleToGeodeticSurface(cartesian, ellipsoid, result = []) {
3960
4086
  const {
3961
4087
  oneOverRadii,
3962
4088
  oneOverRadiiSquared,
3963
4089
  centerToleranceSquared
3964
4090
  } = ellipsoid;
3965
4091
  scratchVector2.from(cartesian);
3966
- const positionX = cartesian.x;
3967
- const positionY = cartesian.y;
3968
- const positionZ = cartesian.z;
4092
+ const positionX = scratchVector2.x;
4093
+ const positionY = scratchVector2.y;
4094
+ const positionZ = scratchVector2.z;
3969
4095
  const oneOverRadiiX = oneOverRadii.x;
3970
4096
  const oneOverRadiiY = oneOverRadii.y;
3971
4097
  const oneOverRadiiZ = oneOverRadii.z;
@@ -3987,7 +4113,7 @@
3987
4113
  const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
3988
4114
  const gradient = scaleToGeodeticSurfaceGradient;
3989
4115
  gradient.set(intersection.x * oneOverRadiiSquaredX * 2, intersection.y * oneOverRadiiSquaredY * 2, intersection.z * oneOverRadiiSquaredZ * 2);
3990
- let lambda = (1 - ratio) * cartesian.len() / (0.5 * gradient.len());
4116
+ let lambda = (1 - ratio) * scratchVector2.len() / (0.5 * gradient.len());
3991
4117
  let correction = 0;
3992
4118
  let xMultiplier;
3993
4119
  let yMultiplier;
@@ -4150,9 +4276,10 @@
4150
4276
  });
4151
4277
 
4152
4278
  // ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js
4153
- var scratchVector4, scratchNormal, scratchK, scratchPosition, scratchHeight, scratchCartesian, wgs84, Ellipsoid;
4279
+ var scratchVector4, scratchNormal, scratchK, scratchPosition, scratchHeight, scratchCartesian, Ellipsoid;
4154
4280
  var init_ellipsoid = __esm({
4155
4281
  "../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js"() {
4282
+ init_defineProperty();
4156
4283
  init_esm();
4157
4284
  init_vec3();
4158
4285
  init_constants();
@@ -4166,11 +4293,16 @@
4166
4293
  scratchHeight = new Vector3();
4167
4294
  scratchCartesian = new Vector3();
4168
4295
  Ellipsoid = class {
4169
- static get WGS84() {
4170
- wgs84 = wgs84 || new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z);
4171
- return wgs84;
4172
- }
4173
4296
  constructor(x = 0, y = 0, z = 0) {
4297
+ _defineProperty(this, "radii", void 0);
4298
+ _defineProperty(this, "radiiSquared", void 0);
4299
+ _defineProperty(this, "radiiToTheFourth", void 0);
4300
+ _defineProperty(this, "oneOverRadii", void 0);
4301
+ _defineProperty(this, "oneOverRadiiSquared", void 0);
4302
+ _defineProperty(this, "minimumRadius", void 0);
4303
+ _defineProperty(this, "maximumRadius", void 0);
4304
+ _defineProperty(this, "centerToleranceSquared", math_utils_default.EPSILON1);
4305
+ _defineProperty(this, "squaredXOverSquaredZ", void 0);
4174
4306
  assert4(x >= 0);
4175
4307
  assert4(y >= 0);
4176
4308
  assert4(z >= 0);
@@ -4181,7 +4313,6 @@
4181
4313
  this.oneOverRadiiSquared = new Vector3(x === 0 ? 0 : 1 / (x * x), y === 0 ? 0 : 1 / (y * y), z === 0 ? 0 : 1 / (z * z));
4182
4314
  this.minimumRadius = Math.min(x, y, z);
4183
4315
  this.maximumRadius = Math.max(x, y, z);
4184
- this.centerToleranceSquared = math_utils_default.EPSILON1;
4185
4316
  if (this.radiiSquared.z !== 0) {
4186
4317
  this.squaredXOverSquaredZ = this.radiiSquared.x / this.radiiSquared.z;
4187
4318
  }
@@ -4268,6 +4399,7 @@
4268
4399
  return scratchPosition.set(0, 0, z).to(result);
4269
4400
  }
4270
4401
  };
4402
+ _defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
4271
4403
  }
4272
4404
  });
4273
4405
 
@@ -4477,7 +4609,7 @@
4477
4609
  }
4478
4610
  });
4479
4611
 
4480
- // ../../node_modules/probe.gl/dist/esm/env/is-electron.js
4612
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
4481
4613
  function isElectron(mockUserAgent) {
4482
4614
  if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
4483
4615
  return true;
@@ -4493,52 +4625,59 @@
4493
4625
  return false;
4494
4626
  }
4495
4627
  var init_is_electron = __esm({
4496
- "../../node_modules/probe.gl/dist/esm/env/is-electron.js"() {
4628
+ "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
4497
4629
  }
4498
4630
  });
4499
4631
 
4500
- // ../../node_modules/probe.gl/dist/esm/env/is-browser.js
4632
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
4501
4633
  function isBrowser3() {
4502
4634
  const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
4503
4635
  return !isNode || isElectron();
4504
4636
  }
4505
4637
  var init_is_browser = __esm({
4506
- "../../node_modules/probe.gl/dist/esm/env/is-browser.js"() {
4638
+ "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
4507
4639
  init_is_electron();
4508
4640
  }
4509
4641
  });
4510
4642
 
4511
- // ../../node_modules/probe.gl/dist/esm/env/globals.js
4512
- var globals4, self_3, window_3, global_4, document_3, process_;
4643
+ // ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
4644
+ var globals3, self_3, window_3, document_3, process_;
4513
4645
  var init_globals3 = __esm({
4514
- "../../node_modules/probe.gl/dist/esm/env/globals.js"() {
4515
- globals4 = {
4646
+ "../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
4647
+ globals3 = {
4516
4648
  self: typeof self !== "undefined" && self,
4517
4649
  window: typeof window !== "undefined" && window,
4518
4650
  global: typeof global !== "undefined" && global,
4519
4651
  document: typeof document !== "undefined" && document,
4520
4652
  process: typeof process === "object" && process
4521
4653
  };
4522
- self_3 = globals4.self || globals4.window || globals4.global;
4523
- window_3 = globals4.window || globals4.self || globals4.global;
4524
- global_4 = globals4.global || globals4.self || globals4.window;
4525
- document_3 = globals4.document || {};
4526
- process_ = globals4.process || {};
4654
+ self_3 = globals3.self || globals3.window || globals3.global;
4655
+ window_3 = globals3.window || globals3.self || globals3.global;
4656
+ document_3 = globals3.document || {};
4657
+ process_ = globals3.process || {};
4527
4658
  }
4528
4659
  });
4529
4660
 
4530
- // ../../node_modules/probe.gl/dist/esm/utils/globals.js
4661
+ // ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
4531
4662
  var VERSION3, isBrowser4;
4532
4663
  var init_globals4 = __esm({
4533
- "../../node_modules/probe.gl/dist/esm/utils/globals.js"() {
4664
+ "../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
4534
4665
  init_is_browser();
4535
- init_globals3();
4536
4666
  VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
4537
4667
  isBrowser4 = isBrowser3();
4538
4668
  }
4539
4669
  });
4540
4670
 
4541
- // ../../node_modules/probe.gl/dist/esm/utils/local-storage.js
4671
+ // ../../node_modules/@probe.gl/env/dist/esm/index.js
4672
+ var init_esm3 = __esm({
4673
+ "../../node_modules/@probe.gl/env/dist/esm/index.js"() {
4674
+ init_globals4();
4675
+ init_globals3();
4676
+ init_is_browser();
4677
+ }
4678
+ });
4679
+
4680
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
4542
4681
  function getStorage(type) {
4543
4682
  try {
4544
4683
  const storage = window[type];
@@ -4552,9 +4691,15 @@
4552
4691
  }
4553
4692
  var LocalStorage;
4554
4693
  var init_local_storage = __esm({
4555
- "../../node_modules/probe.gl/dist/esm/utils/local-storage.js"() {
4694
+ "../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
4695
+ init_defineProperty();
4556
4696
  LocalStorage = class {
4557
- constructor(id, defaultSettings, type = "sessionStorage") {
4697
+ constructor(id) {
4698
+ let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4699
+ let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
4700
+ _defineProperty(this, "storage", void 0);
4701
+ _defineProperty(this, "id", void 0);
4702
+ _defineProperty(this, "config", {});
4558
4703
  this.storage = getStorage(type);
4559
4704
  this.id = id;
4560
4705
  this.config = {};
@@ -4589,7 +4734,7 @@
4589
4734
  }
4590
4735
  });
4591
4736
 
4592
- // ../../node_modules/probe.gl/dist/esm/utils/formatters.js
4737
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
4593
4738
  function formatTime(ms) {
4594
4739
  let formatted;
4595
4740
  if (ms < 10) {
@@ -4603,11 +4748,13 @@
4603
4748
  }
4604
4749
  return formatted;
4605
4750
  }
4606
- function leftPad(string, length4 = 8) {
4751
+ function leftPad(string) {
4752
+ let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
4607
4753
  const padLength = Math.max(length4 - string.length, 0);
4608
4754
  return "".concat(" ".repeat(padLength)).concat(string);
4609
4755
  }
4610
- function formatImage(image, message, scale5, maxWidth = 600) {
4756
+ function formatImage(image, message, scale5) {
4757
+ let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
4611
4758
  const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
4612
4759
  if (image.width > maxWidth) {
4613
4760
  scale5 = Math.min(scale5, maxWidth / image.width);
@@ -4618,16 +4765,16 @@
4618
4765
  return ["".concat(message, " %c+"), style];
4619
4766
  }
4620
4767
  var init_formatters = __esm({
4621
- "../../node_modules/probe.gl/dist/esm/utils/formatters.js"() {
4768
+ "../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
4622
4769
  }
4623
4770
  });
4624
4771
 
4625
- // ../../node_modules/probe.gl/dist/esm/utils/color.js
4772
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
4626
4773
  function getColor(color) {
4627
4774
  return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
4628
4775
  }
4629
4776
  function addColor(string, color, background) {
4630
- if (!isBrowser4 && typeof string === "string") {
4777
+ if (!isBrowser3 && typeof string === "string") {
4631
4778
  if (color) {
4632
4779
  color = getColor(color);
4633
4780
  string = "[".concat(color, "m").concat(string, "");
@@ -4641,64 +4788,67 @@
4641
4788
  }
4642
4789
  var COLOR;
4643
4790
  var init_color = __esm({
4644
- "../../node_modules/probe.gl/dist/esm/utils/color.js"() {
4645
- init_globals4();
4646
- COLOR = {
4647
- BLACK: 30,
4648
- RED: 31,
4649
- GREEN: 32,
4650
- YELLOW: 33,
4651
- BLUE: 34,
4652
- MAGENTA: 35,
4653
- CYAN: 36,
4654
- WHITE: 37,
4655
- BRIGHT_BLACK: 90,
4656
- BRIGHT_RED: 91,
4657
- BRIGHT_GREEN: 92,
4658
- BRIGHT_YELLOW: 93,
4659
- BRIGHT_BLUE: 94,
4660
- BRIGHT_MAGENTA: 95,
4661
- BRIGHT_CYAN: 96,
4662
- BRIGHT_WHITE: 97
4663
- };
4664
- }
4665
- });
4666
-
4667
- // ../../node_modules/probe.gl/dist/esm/utils/autobind.js
4668
- function autobind(obj, predefined = ["constructor"]) {
4791
+ "../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
4792
+ init_esm3();
4793
+ (function(COLOR2) {
4794
+ COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
4795
+ COLOR2[COLOR2["RED"] = 31] = "RED";
4796
+ COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
4797
+ COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
4798
+ COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
4799
+ COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
4800
+ COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
4801
+ COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
4802
+ COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
4803
+ COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
4804
+ COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
4805
+ COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
4806
+ COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
4807
+ COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
4808
+ COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
4809
+ COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
4810
+ })(COLOR || (COLOR = {}));
4811
+ }
4812
+ });
4813
+
4814
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
4815
+ function autobind(obj) {
4816
+ let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
4669
4817
  const proto = Object.getPrototypeOf(obj);
4670
4818
  const propNames = Object.getOwnPropertyNames(proto);
4671
4819
  for (const key of propNames) {
4672
4820
  if (typeof obj[key] === "function") {
4673
- if (!predefined.find((name8) => key === name8)) {
4821
+ if (!predefined.find((name10) => key === name10)) {
4674
4822
  obj[key] = obj[key].bind(obj);
4675
4823
  }
4676
4824
  }
4677
4825
  }
4678
4826
  }
4679
4827
  var init_autobind = __esm({
4680
- "../../node_modules/probe.gl/dist/esm/utils/autobind.js"() {
4828
+ "../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
4681
4829
  }
4682
4830
  });
4683
4831
 
4684
- // ../../node_modules/probe.gl/dist/esm/utils/assert.js
4832
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
4685
4833
  function assert5(condition, message) {
4686
4834
  if (!condition) {
4687
4835
  throw new Error(message || "Assertion failed");
4688
4836
  }
4689
4837
  }
4690
4838
  var init_assert4 = __esm({
4691
- "../../node_modules/probe.gl/dist/esm/utils/assert.js"() {
4839
+ "../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
4692
4840
  }
4693
4841
  });
4694
4842
 
4695
- // ../../node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js
4843
+ // ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
4696
4844
  function getHiResTimestamp() {
4697
4845
  let timestamp;
4698
- if (isBrowser4 && window_3.performance) {
4699
- timestamp = window_3.performance.now();
4700
- } else if (process_.hrtime) {
4701
- const timeParts = process_.hrtime();
4846
+ if (isBrowser3 && "performance" in window_3) {
4847
+ var _window$performance, _window$performance$n;
4848
+ timestamp = window_3 === null || window_3 === void 0 ? void 0 : (_window$performance = window_3.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
4849
+ } else if ("hrtime" in process_) {
4850
+ var _process$hrtime;
4851
+ const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
4702
4852
  timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
4703
4853
  } else {
4704
4854
  timestamp = Date.now();
@@ -4706,21 +4856,19 @@
4706
4856
  return timestamp;
4707
4857
  }
4708
4858
  var init_hi_res_timestamp = __esm({
4709
- "../../node_modules/probe.gl/dist/esm/utils/hi-res-timestamp.js"() {
4710
- init_globals4();
4859
+ "../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
4860
+ init_esm3();
4711
4861
  }
4712
4862
  });
4713
4863
 
4714
- // ../../node_modules/probe.gl/dist/esm/lib/log.js
4715
- function noop2() {
4716
- }
4717
- function getTableHeader(table) {
4718
- for (const key in table) {
4719
- for (const title in table[key]) {
4720
- return title || "untitled";
4721
- }
4864
+ // (disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image
4865
+ var init_node_asciify_image = __esm({
4866
+ "(disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image"() {
4722
4867
  }
4723
- return "empty";
4868
+ });
4869
+
4870
+ // ../../node_modules/@probe.gl/log/dist/esm/log.js
4871
+ function noop() {
4724
4872
  }
4725
4873
  function normalizeLogLevel(logLevel) {
4726
4874
  if (!logLevel) {
@@ -4749,7 +4897,6 @@
4749
4897
  const args = opts.args ? Array.from(opts.args) : [];
4750
4898
  while (args.length && args.shift() !== message) {
4751
4899
  }
4752
- opts.args = args;
4753
4900
  switch (typeof logLevel) {
4754
4901
  case "string":
4755
4902
  case "function":
@@ -4768,7 +4915,9 @@
4768
4915
  }
4769
4916
  const messageType = typeof opts.message;
4770
4917
  assert5(messageType === "string" || messageType === "object");
4771
- return Object.assign(opts, opts.opts);
4918
+ return Object.assign(opts, {
4919
+ args
4920
+ }, opts.opts);
4772
4921
  }
4773
4922
  function decorateMessage(id, message, opts) {
4774
4923
  if (typeof message === "string") {
@@ -4778,29 +4927,25 @@
4778
4927
  }
4779
4928
  return message;
4780
4929
  }
4781
- function logImageInNode({
4782
- image,
4783
- message = "",
4784
- scale: scale5 = 1
4785
- }) {
4786
- let asciify = null;
4787
- try {
4788
- asciify = module.require("asciify-image");
4789
- } catch (error) {
4790
- }
4791
- if (asciify) {
4792
- return () => asciify(image, {
4793
- fit: "box",
4794
- width: "".concat(Math.round(80 * scale5), "%")
4795
- }).then((data) => console.log(data));
4796
- }
4797
- return noop2;
4930
+ function logImageInNode(_ref2) {
4931
+ let {
4932
+ image,
4933
+ message = "",
4934
+ scale: scale5 = 1
4935
+ } = _ref2;
4936
+ asciify.nodeAsciifyImage({
4937
+ image,
4938
+ message,
4939
+ scale: scale5
4940
+ });
4941
+ return noop;
4798
4942
  }
4799
- function logImageInBrowser({
4800
- image,
4801
- message = "",
4802
- scale: scale5 = 1
4803
- }) {
4943
+ function logImageInBrowser(_ref3) {
4944
+ let {
4945
+ image,
4946
+ message = "",
4947
+ scale: scale5 = 1
4948
+ } = _ref3;
4804
4949
  if (typeof image === "string") {
4805
4950
  const img = new Image();
4806
4951
  img.onload = () => {
@@ -4808,33 +4953,43 @@
4808
4953
  console.log(...args);
4809
4954
  };
4810
4955
  img.src = image;
4811
- return noop2;
4956
+ return noop;
4812
4957
  }
4813
4958
  const element = image.nodeName || "";
4814
4959
  if (element.toLowerCase() === "img") {
4815
4960
  console.log(...formatImage(image, message, scale5));
4816
- return noop2;
4961
+ return noop;
4817
4962
  }
4818
4963
  if (element.toLowerCase() === "canvas") {
4819
4964
  const img = new Image();
4820
4965
  img.onload = () => console.log(...formatImage(img, message, scale5));
4821
4966
  img.src = image.toDataURL();
4822
- return noop2;
4967
+ return noop;
4823
4968
  }
4824
- return noop2;
4969
+ return noop;
4970
+ }
4971
+ function getTableHeader(table) {
4972
+ for (const key in table) {
4973
+ for (const title in table[key]) {
4974
+ return title || "untitled";
4975
+ }
4976
+ }
4977
+ return "empty";
4825
4978
  }
4826
4979
  var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
4827
4980
  var init_log = __esm({
4828
- "../../node_modules/probe.gl/dist/esm/lib/log.js"() {
4829
- init_globals4();
4981
+ "../../node_modules/@probe.gl/log/dist/esm/log.js"() {
4982
+ init_defineProperty();
4983
+ init_esm3();
4830
4984
  init_local_storage();
4831
4985
  init_formatters();
4832
4986
  init_color();
4833
4987
  init_autobind();
4834
4988
  init_assert4();
4835
4989
  init_hi_res_timestamp();
4990
+ init_node_asciify_image();
4836
4991
  originalConsole = {
4837
- debug: isBrowser4 ? console.debug || console.log : console.log,
4992
+ debug: isBrowser3 ? console.debug || console.log : console.log,
4838
4993
  log: console.log,
4839
4994
  info: console.info,
4840
4995
  warn: console.warn,
@@ -4849,16 +5004,20 @@
4849
5004
  once: true
4850
5005
  };
4851
5006
  Log = class {
4852
- constructor({
4853
- id
4854
- } = {
4855
- id: ""
4856
- }) {
5007
+ constructor() {
5008
+ let {
5009
+ id
5010
+ } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
5011
+ id: ""
5012
+ };
5013
+ _defineProperty(this, "id", void 0);
5014
+ _defineProperty(this, "VERSION", VERSION3);
5015
+ _defineProperty(this, "_startTs", getHiResTimestamp());
5016
+ _defineProperty(this, "_deltaTs", getHiResTimestamp());
5017
+ _defineProperty(this, "_storage", void 0);
5018
+ _defineProperty(this, "userData", {});
5019
+ _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
4857
5020
  this.id = id;
4858
- this.VERSION = VERSION3;
4859
- this._startTs = getHiResTimestamp();
4860
- this._deltaTs = getHiResTimestamp();
4861
- this.LOG_THROTTLE_TIMEOUT = 0;
4862
5021
  this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
4863
5022
  this.userData = {};
4864
5023
  this.timeStamp("".concat(this.id, " started"));
@@ -4892,7 +5051,8 @@
4892
5051
  getPriority() {
4893
5052
  return this.level;
4894
5053
  }
4895
- enable(enabled = true) {
5054
+ enable() {
5055
+ let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
4896
5056
  this._storage.updateConfiguration({
4897
5057
  enabled
4898
5058
  });
@@ -4904,6 +5064,21 @@
4904
5064
  });
4905
5065
  return this;
4906
5066
  }
5067
+ get(setting) {
5068
+ return this._storage.config[setting];
5069
+ }
5070
+ set(setting, value) {
5071
+ this._storage.updateConfiguration({
5072
+ [setting]: value
5073
+ });
5074
+ }
5075
+ settings() {
5076
+ if (console.table) {
5077
+ console.table(this._storage.config);
5078
+ } else {
5079
+ console.log(this._storage.config);
5080
+ }
5081
+ }
4907
5082
  assert(condition, message) {
4908
5083
  assert5(condition, message);
4909
5084
  }
@@ -4932,27 +5107,31 @@
4932
5107
  return this._getLogFunction(logLevel, message, console.info, arguments);
4933
5108
  }
4934
5109
  once(logLevel, message) {
5110
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
5111
+ args[_key - 2] = arguments[_key];
5112
+ }
4935
5113
  return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
4936
5114
  }
4937
5115
  table(logLevel, table, columns) {
4938
5116
  if (table) {
4939
- return this._getLogFunction(logLevel, table, console.table || noop2, columns && [columns], {
5117
+ return this._getLogFunction(logLevel, table, console.table || noop, columns && [columns], {
4940
5118
  tag: getTableHeader(table)
4941
5119
  });
4942
5120
  }
4943
- return noop2;
5121
+ return noop;
4944
5122
  }
4945
- image({
4946
- logLevel,
4947
- priority,
4948
- image,
4949
- message = "",
4950
- scale: scale5 = 1
4951
- }) {
5123
+ image(_ref) {
5124
+ let {
5125
+ logLevel,
5126
+ priority,
5127
+ image,
5128
+ message = "",
5129
+ scale: scale5 = 1
5130
+ } = _ref;
4952
5131
  if (!this._shouldLog(logLevel || priority)) {
4953
- return noop2;
5132
+ return noop;
4954
5133
  }
4955
- return isBrowser4 ? logImageInBrowser({
5134
+ return isBrowser3 ? logImageInBrowser({
4956
5135
  image,
4957
5136
  message,
4958
5137
  scale: scale5
@@ -4962,21 +5141,6 @@
4962
5141
  scale: scale5
4963
5142
  });
4964
5143
  }
4965
- settings() {
4966
- if (console.table) {
4967
- console.table(this._storage.config);
4968
- } else {
4969
- console.log(this._storage.config);
4970
- }
4971
- }
4972
- get(setting) {
4973
- return this._storage.config[setting];
4974
- }
4975
- set(setting, value) {
4976
- this._storage.updateConfiguration({
4977
- [setting]: value
4978
- });
4979
- }
4980
5144
  time(logLevel, message) {
4981
5145
  return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
4982
5146
  }
@@ -4984,12 +5148,13 @@
4984
5148
  return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
4985
5149
  }
4986
5150
  timeStamp(logLevel, message) {
4987
- return this._getLogFunction(logLevel, message, console.timeStamp || noop2);
5151
+ return this._getLogFunction(logLevel, message, console.timeStamp || noop);
4988
5152
  }
4989
- group(logLevel, message, opts = {
4990
- collapsed: false
4991
- }) {
4992
- opts = normalizeArguments({
5153
+ group(logLevel, message) {
5154
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
5155
+ collapsed: false
5156
+ };
5157
+ const options = normalizeArguments({
4993
5158
  logLevel,
4994
5159
  message,
4995
5160
  opts
@@ -4997,16 +5162,17 @@
4997
5162
  const {
4998
5163
  collapsed
4999
5164
  } = opts;
5000
- opts.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
5001
- return this._getLogFunction(opts);
5165
+ options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
5166
+ return this._getLogFunction(options);
5002
5167
  }
5003
- groupCollapsed(logLevel, message, opts = {}) {
5168
+ groupCollapsed(logLevel, message) {
5169
+ let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
5004
5170
  return this.group(logLevel, message, Object.assign({}, opts, {
5005
5171
  collapsed: true
5006
5172
  }));
5007
5173
  }
5008
5174
  groupEnd(logLevel) {
5009
- return this._getLogFunction(logLevel, "", console.groupEnd || noop2);
5175
+ return this._getLogFunction(logLevel, "", console.groupEnd || noop);
5010
5176
  }
5011
5177
  withGroup(logLevel, message, func) {
5012
5178
  this.group(logLevel, message)();
@@ -5024,7 +5190,7 @@
5024
5190
  _shouldLog(logLevel) {
5025
5191
  return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
5026
5192
  }
5027
- _getLogFunction(logLevel, message, method, args = [], opts) {
5193
+ _getLogFunction(logLevel, message, method, args, opts) {
5028
5194
  if (this._shouldLog(logLevel)) {
5029
5195
  opts = normalizeArguments({
5030
5196
  logLevel,
@@ -5042,57 +5208,27 @@
5042
5208
  if (!cache[tag]) {
5043
5209
  cache[tag] = getHiResTimestamp();
5044
5210
  } else {
5045
- return noop2;
5211
+ return noop;
5046
5212
  }
5047
5213
  }
5048
5214
  message = decorateMessage(this.id, opts.message, opts);
5049
5215
  return method.bind(console, message, ...opts.args);
5050
5216
  }
5051
- return noop2;
5217
+ return noop;
5052
5218
  }
5053
5219
  };
5054
- Log.VERSION = VERSION3;
5055
- }
5056
- });
5057
-
5058
- // ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
5059
- var init_hi_res_timestamp2 = __esm({
5060
- "../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
5061
- }
5062
- });
5063
-
5064
- // ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js
5065
- var init_stat = __esm({
5066
- "../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
5067
- init_hi_res_timestamp2();
5068
- }
5069
- });
5070
-
5071
- // ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js
5072
- var init_stats = __esm({
5073
- "../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
5074
- init_stat();
5075
- }
5076
- });
5077
-
5078
- // ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js
5079
- var init_esm3 = __esm({
5080
- "../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js"() {
5081
- init_stats();
5082
- init_stat();
5083
- init_hi_res_timestamp2();
5220
+ _defineProperty(Log, "VERSION", VERSION3);
5084
5221
  }
5085
5222
  });
5086
5223
 
5087
- // ../../node_modules/probe.gl/dist/esm/index.js
5224
+ // ../../node_modules/@probe.gl/log/dist/esm/index.js
5088
5225
  var esm_default;
5089
5226
  var init_esm4 = __esm({
5090
- "../../node_modules/probe.gl/dist/esm/index.js"() {
5227
+ "../../node_modules/@probe.gl/log/dist/esm/index.js"() {
5091
5228
  init_log();
5092
5229
  init_log();
5093
- init_esm3();
5094
5230
  esm_default = new Log({
5095
- id: "probe.gl"
5231
+ id: "@probe.gl/log"
5096
5232
  });
5097
5233
  }
5098
5234
  });
@@ -5270,720 +5406,97 @@
5270
5406
  function mergeNestedFields(mergedOptions, options) {
5271
5407
  for (const key in options) {
5272
5408
  if (key in options) {
5273
- const value = options[key];
5274
- if (isPureObject(value) && isPureObject(mergedOptions[key])) {
5275
- mergedOptions[key] = {
5276
- ...mergedOptions[key],
5277
- ...options[key]
5278
- };
5279
- } else {
5280
- mergedOptions[key] = options[key];
5281
- }
5282
- }
5283
- }
5284
- }
5285
- function addUrlOptions(options, url) {
5286
- if (url && !("baseUri" in options)) {
5287
- options.baseUri = url;
5288
- }
5289
- }
5290
- var getGlobalLoaderOptions;
5291
- var init_option_utils = __esm({
5292
- "../core/src/lib/loader-utils/option-utils.ts"() {
5293
- init_is_type();
5294
- init_fetch_file();
5295
- init_loggers();
5296
- init_option_defaults();
5297
- getGlobalLoaderOptions = () => {
5298
- const state = getGlobalLoaderState();
5299
- state.globalOptions = state.globalOptions || { ...DEFAULT_LOADER_OPTIONS };
5300
- return state.globalOptions;
5301
- };
5302
- }
5303
- });
5304
-
5305
- // ../core/src/lib/loader-utils/normalize-loader.ts
5306
- function isLoaderObject(loader) {
5307
- if (!loader) {
5308
- return false;
5309
- }
5310
- if (Array.isArray(loader)) {
5311
- loader = loader[0];
5312
- }
5313
- const hasExtensions = Array.isArray(loader?.extensions);
5314
- return hasExtensions;
5315
- }
5316
- function normalizeLoader(loader) {
5317
- assert2(loader, "null loader");
5318
- assert2(isLoaderObject(loader), "invalid loader");
5319
- let options;
5320
- if (Array.isArray(loader)) {
5321
- options = loader[1];
5322
- loader = loader[0];
5323
- loader = {
5324
- ...loader,
5325
- options: { ...loader.options, ...options }
5326
- };
5327
- }
5328
- if (loader?.parseTextSync || loader?.parseText) {
5329
- loader.text = true;
5330
- }
5331
- if (!loader.text) {
5332
- loader.binary = true;
5333
- }
5334
- return loader;
5335
- }
5336
- var init_normalize_loader = __esm({
5337
- "../core/src/lib/loader-utils/normalize-loader.ts"() {
5338
- init_src2();
5339
- }
5340
- });
5341
-
5342
- // ../core/src/lib/api/register-loaders.ts
5343
- function getRegisteredLoaders() {
5344
- return getGlobalLoaderRegistry();
5345
- }
5346
- var getGlobalLoaderRegistry;
5347
- var init_register_loaders = __esm({
5348
- "../core/src/lib/api/register-loaders.ts"() {
5349
- init_option_utils();
5350
- getGlobalLoaderRegistry = () => {
5351
- const state = getGlobalLoaderState();
5352
- state.loaderRegistry = state.loaderRegistry || [];
5353
- return state.loaderRegistry;
5354
- };
5355
- }
5356
- });
5357
-
5358
- // ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
5359
- function isElectron2(mockUserAgent) {
5360
- if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
5361
- return true;
5362
- }
5363
- if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions.electron)) {
5364
- return true;
5365
- }
5366
- const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
5367
- const userAgent = mockUserAgent || realUserAgent;
5368
- if (userAgent && userAgent.indexOf("Electron") >= 0) {
5369
- return true;
5370
- }
5371
- return false;
5372
- }
5373
- var init_is_electron2 = __esm({
5374
- "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
5375
- }
5376
- });
5377
-
5378
- // ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
5379
- function isBrowser5() {
5380
- const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
5381
- return !isNode || isElectron2();
5382
- }
5383
- var init_is_browser2 = __esm({
5384
- "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
5385
- init_is_electron2();
5386
- }
5387
- });
5388
-
5389
- // ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
5390
- var globals5, self_4, window_4, document_4, process_2;
5391
- var init_globals5 = __esm({
5392
- "../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
5393
- globals5 = {
5394
- self: typeof self !== "undefined" && self,
5395
- window: typeof window !== "undefined" && window,
5396
- global: typeof global !== "undefined" && global,
5397
- document: typeof document !== "undefined" && document,
5398
- process: typeof process === "object" && process
5399
- };
5400
- self_4 = globals5.self || globals5.window || globals5.global;
5401
- window_4 = globals5.window || globals5.self || globals5.global;
5402
- document_4 = globals5.document || {};
5403
- process_2 = globals5.process || {};
5404
- }
5405
- });
5406
-
5407
- // ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
5408
- var VERSION4, isBrowser6;
5409
- var init_globals6 = __esm({
5410
- "../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
5411
- init_is_browser2();
5412
- VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
5413
- isBrowser6 = isBrowser5();
5414
- }
5415
- });
5416
-
5417
- // ../../node_modules/@probe.gl/env/dist/esm/index.js
5418
- var init_esm5 = __esm({
5419
- "../../node_modules/@probe.gl/env/dist/esm/index.js"() {
5420
- init_globals6();
5421
- init_globals5();
5422
- init_is_browser2();
5423
- }
5424
- });
5425
-
5426
- // ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
5427
- function getStorage2(type) {
5428
- try {
5429
- const storage = window[type];
5430
- const x = "__storage_test__";
5431
- storage.setItem(x, x);
5432
- storage.removeItem(x);
5433
- return storage;
5434
- } catch (e) {
5435
- return null;
5436
- }
5437
- }
5438
- var LocalStorage2;
5439
- var init_local_storage2 = __esm({
5440
- "../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
5441
- init_defineProperty();
5442
- LocalStorage2 = class {
5443
- constructor(id) {
5444
- let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5445
- let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
5446
- _defineProperty(this, "storage", void 0);
5447
- _defineProperty(this, "id", void 0);
5448
- _defineProperty(this, "config", {});
5449
- this.storage = getStorage2(type);
5450
- this.id = id;
5451
- this.config = {};
5452
- Object.assign(this.config, defaultSettings);
5453
- this._loadConfiguration();
5454
- }
5455
- getConfiguration() {
5456
- return this.config;
5457
- }
5458
- setConfiguration(configuration) {
5459
- this.config = {};
5460
- return this.updateConfiguration(configuration);
5461
- }
5462
- updateConfiguration(configuration) {
5463
- Object.assign(this.config, configuration);
5464
- if (this.storage) {
5465
- const serialized = JSON.stringify(this.config);
5466
- this.storage.setItem(this.id, serialized);
5467
- }
5468
- return this;
5469
- }
5470
- _loadConfiguration() {
5471
- let configuration = {};
5472
- if (this.storage) {
5473
- const serializedConfiguration = this.storage.getItem(this.id);
5474
- configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
5475
- }
5476
- Object.assign(this.config, configuration);
5477
- return this;
5478
- }
5479
- };
5480
- }
5481
- });
5482
-
5483
- // ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
5484
- function formatTime2(ms) {
5485
- let formatted;
5486
- if (ms < 10) {
5487
- formatted = "".concat(ms.toFixed(2), "ms");
5488
- } else if (ms < 100) {
5489
- formatted = "".concat(ms.toFixed(1), "ms");
5490
- } else if (ms < 1e3) {
5491
- formatted = "".concat(ms.toFixed(0), "ms");
5492
- } else {
5493
- formatted = "".concat((ms / 1e3).toFixed(2), "s");
5494
- }
5495
- return formatted;
5496
- }
5497
- function leftPad2(string) {
5498
- let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
5499
- const padLength = Math.max(length4 - string.length, 0);
5500
- return "".concat(" ".repeat(padLength)).concat(string);
5501
- }
5502
- function formatImage2(image, message, scale5) {
5503
- let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
5504
- const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
5505
- if (image.width > maxWidth) {
5506
- scale5 = Math.min(scale5, maxWidth / image.width);
5507
- }
5508
- const width = image.width * scale5;
5509
- const height = image.height * scale5;
5510
- const style = ["font-size:1px;", "padding:".concat(Math.floor(height / 2), "px ").concat(Math.floor(width / 2), "px;"), "line-height:".concat(height, "px;"), "background:url(".concat(imageUrl, ");"), "background-size:".concat(width, "px ").concat(height, "px;"), "color:transparent;"].join("");
5511
- return ["".concat(message, " %c+"), style];
5512
- }
5513
- var init_formatters2 = __esm({
5514
- "../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
5515
- }
5516
- });
5517
-
5518
- // ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
5519
- function getColor2(color) {
5520
- return typeof color === "string" ? COLOR2[color.toUpperCase()] || COLOR2.WHITE : color;
5521
- }
5522
- function addColor2(string, color, background) {
5523
- if (!isBrowser5 && typeof string === "string") {
5524
- if (color) {
5525
- color = getColor2(color);
5526
- string = "[".concat(color, "m").concat(string, "");
5527
- }
5528
- if (background) {
5529
- color = getColor2(background);
5530
- string = "[".concat(background + 10, "m").concat(string, "");
5531
- }
5532
- }
5533
- return string;
5534
- }
5535
- var COLOR2;
5536
- var init_color2 = __esm({
5537
- "../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
5538
- init_esm5();
5539
- (function(COLOR3) {
5540
- COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
5541
- COLOR3[COLOR3["RED"] = 31] = "RED";
5542
- COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
5543
- COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
5544
- COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
5545
- COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
5546
- COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
5547
- COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
5548
- COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
5549
- COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
5550
- COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
5551
- COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
5552
- COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
5553
- COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
5554
- COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
5555
- COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
5556
- })(COLOR2 || (COLOR2 = {}));
5557
- }
5558
- });
5559
-
5560
- // ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
5561
- function autobind2(obj) {
5562
- let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
5563
- const proto = Object.getPrototypeOf(obj);
5564
- const propNames = Object.getOwnPropertyNames(proto);
5565
- for (const key of propNames) {
5566
- if (typeof obj[key] === "function") {
5567
- if (!predefined.find((name8) => key === name8)) {
5568
- obj[key] = obj[key].bind(obj);
5569
- }
5570
- }
5571
- }
5572
- }
5573
- var init_autobind2 = __esm({
5574
- "../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
5575
- }
5576
- });
5577
-
5578
- // ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
5579
- function assert6(condition, message) {
5580
- if (!condition) {
5581
- throw new Error(message || "Assertion failed");
5582
- }
5583
- }
5584
- var init_assert5 = __esm({
5585
- "../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
5586
- }
5587
- });
5588
-
5589
- // ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
5590
- function getHiResTimestamp3() {
5591
- let timestamp;
5592
- if (isBrowser5 && "performance" in window_4) {
5593
- var _window$performance, _window$performance$n;
5594
- timestamp = window_4 === null || window_4 === void 0 ? void 0 : (_window$performance = window_4.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
5595
- } else if ("hrtime" in process_2) {
5596
- var _process$hrtime;
5597
- const timeParts = process_2 === null || process_2 === void 0 ? void 0 : (_process$hrtime = process_2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_2);
5598
- timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
5599
- } else {
5600
- timestamp = Date.now();
5601
- }
5602
- return timestamp;
5603
- }
5604
- var init_hi_res_timestamp3 = __esm({
5605
- "../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
5606
- init_esm5();
5607
- }
5608
- });
5609
-
5610
- // ../../node_modules/@probe.gl/log/dist/esm/log.js
5611
- function noop3() {
5612
- }
5613
- function normalizeLogLevel2(logLevel) {
5614
- if (!logLevel) {
5615
- return 0;
5616
- }
5617
- let resolvedLevel;
5618
- switch (typeof logLevel) {
5619
- case "number":
5620
- resolvedLevel = logLevel;
5621
- break;
5622
- case "object":
5623
- resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
5624
- break;
5625
- default:
5626
- return 0;
5627
- }
5628
- assert6(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
5629
- return resolvedLevel;
5630
- }
5631
- function normalizeArguments2(opts) {
5632
- const {
5633
- logLevel,
5634
- message
5635
- } = opts;
5636
- opts.logLevel = normalizeLogLevel2(logLevel);
5637
- const args = opts.args ? Array.from(opts.args) : [];
5638
- while (args.length && args.shift() !== message) {
5639
- }
5640
- switch (typeof logLevel) {
5641
- case "string":
5642
- case "function":
5643
- if (message !== void 0) {
5644
- args.unshift(message);
5645
- }
5646
- opts.message = logLevel;
5647
- break;
5648
- case "object":
5649
- Object.assign(opts, logLevel);
5650
- break;
5651
- default:
5652
- }
5653
- if (typeof opts.message === "function") {
5654
- opts.message = opts.message();
5655
- }
5656
- const messageType = typeof opts.message;
5657
- assert6(messageType === "string" || messageType === "object");
5658
- return Object.assign(opts, {
5659
- args
5660
- }, opts.opts);
5661
- }
5662
- function decorateMessage2(id, message, opts) {
5663
- if (typeof message === "string") {
5664
- const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
5665
- message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
5666
- message = addColor2(message, opts.color, opts.background);
5667
- }
5668
- return message;
5669
- }
5670
- function logImageInNode2(_ref2) {
5671
- let {
5672
- image,
5673
- message = "",
5674
- scale: scale5 = 1
5675
- } = _ref2;
5676
- let asciify = null;
5677
- try {
5678
- asciify = module.require("asciify-image");
5679
- } catch (error) {
5680
- }
5681
- if (asciify) {
5682
- return () => asciify(image, {
5683
- fit: "box",
5684
- width: "".concat(Math.round(80 * scale5), "%")
5685
- }).then((data) => console.log(data));
5686
- }
5687
- return noop3;
5688
- }
5689
- function logImageInBrowser2(_ref3) {
5690
- let {
5691
- image,
5692
- message = "",
5693
- scale: scale5 = 1
5694
- } = _ref3;
5695
- if (typeof image === "string") {
5696
- const img = new Image();
5697
- img.onload = () => {
5698
- const args = formatImage2(img, message, scale5);
5699
- console.log(...args);
5700
- };
5701
- img.src = image;
5702
- return noop3;
5703
- }
5704
- const element = image.nodeName || "";
5705
- if (element.toLowerCase() === "img") {
5706
- console.log(...formatImage2(image, message, scale5));
5707
- return noop3;
5708
- }
5709
- if (element.toLowerCase() === "canvas") {
5710
- const img = new Image();
5711
- img.onload = () => console.log(...formatImage2(img, message, scale5));
5712
- img.src = image.toDataURL();
5713
- return noop3;
5714
- }
5715
- return noop3;
5716
- }
5717
- function getTableHeader2(table) {
5718
- for (const key in table) {
5719
- for (const title in table[key]) {
5720
- return title || "untitled";
5721
- }
5722
- }
5723
- return "empty";
5724
- }
5725
- var originalConsole2, DEFAULT_SETTINGS2, cache2, ONCE2, Log2;
5726
- var init_log2 = __esm({
5727
- "../../node_modules/@probe.gl/log/dist/esm/log.js"() {
5728
- init_defineProperty();
5729
- init_esm5();
5730
- init_local_storage2();
5731
- init_formatters2();
5732
- init_color2();
5733
- init_autobind2();
5734
- init_assert5();
5735
- init_hi_res_timestamp3();
5736
- originalConsole2 = {
5737
- debug: isBrowser5 ? console.debug || console.log : console.log,
5738
- log: console.log,
5739
- info: console.info,
5740
- warn: console.warn,
5741
- error: console.error
5742
- };
5743
- DEFAULT_SETTINGS2 = {
5744
- enabled: true,
5745
- level: 0
5746
- };
5747
- cache2 = {};
5748
- ONCE2 = {
5749
- once: true
5750
- };
5751
- Log2 = class {
5752
- constructor() {
5753
- let {
5754
- id
5755
- } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
5756
- id: ""
5757
- };
5758
- _defineProperty(this, "id", void 0);
5759
- _defineProperty(this, "VERSION", VERSION4);
5760
- _defineProperty(this, "_startTs", getHiResTimestamp3());
5761
- _defineProperty(this, "_deltaTs", getHiResTimestamp3());
5762
- _defineProperty(this, "_storage", void 0);
5763
- _defineProperty(this, "userData", {});
5764
- _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
5765
- this.id = id;
5766
- this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS2);
5767
- this.userData = {};
5768
- this.timeStamp("".concat(this.id, " started"));
5769
- autobind2(this);
5770
- Object.seal(this);
5771
- }
5772
- set level(newLevel) {
5773
- this.setLevel(newLevel);
5774
- }
5775
- get level() {
5776
- return this.getLevel();
5777
- }
5778
- isEnabled() {
5779
- return this._storage.config.enabled;
5780
- }
5781
- getLevel() {
5782
- return this._storage.config.level;
5783
- }
5784
- getTotal() {
5785
- return Number((getHiResTimestamp3() - this._startTs).toPrecision(10));
5786
- }
5787
- getDelta() {
5788
- return Number((getHiResTimestamp3() - this._deltaTs).toPrecision(10));
5789
- }
5790
- set priority(newPriority) {
5791
- this.level = newPriority;
5792
- }
5793
- get priority() {
5794
- return this.level;
5795
- }
5796
- getPriority() {
5797
- return this.level;
5798
- }
5799
- enable() {
5800
- let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
5801
- this._storage.updateConfiguration({
5802
- enabled
5803
- });
5804
- return this;
5805
- }
5806
- setLevel(level) {
5807
- this._storage.updateConfiguration({
5808
- level
5809
- });
5810
- return this;
5811
- }
5812
- get(setting) {
5813
- return this._storage.config[setting];
5814
- }
5815
- set(setting, value) {
5816
- this._storage.updateConfiguration({
5817
- [setting]: value
5818
- });
5819
- }
5820
- settings() {
5821
- if (console.table) {
5822
- console.table(this._storage.config);
5823
- } else {
5824
- console.log(this._storage.config);
5825
- }
5826
- }
5827
- assert(condition, message) {
5828
- assert6(condition, message);
5829
- }
5830
- warn(message) {
5831
- return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
5832
- }
5833
- error(message) {
5834
- return this._getLogFunction(0, message, originalConsole2.error, arguments);
5835
- }
5836
- deprecated(oldUsage, newUsage) {
5837
- return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
5838
- }
5839
- removed(oldUsage, newUsage) {
5840
- return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
5841
- }
5842
- probe(logLevel, message) {
5843
- return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
5844
- time: true,
5845
- once: true
5846
- });
5847
- }
5848
- log(logLevel, message) {
5849
- return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
5850
- }
5851
- info(logLevel, message) {
5852
- return this._getLogFunction(logLevel, message, console.info, arguments);
5853
- }
5854
- once(logLevel, message) {
5855
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
5856
- args[_key - 2] = arguments[_key];
5857
- }
5858
- return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
5859
- }
5860
- table(logLevel, table, columns) {
5861
- if (table) {
5862
- return this._getLogFunction(logLevel, table, console.table || noop3, columns && [columns], {
5863
- tag: getTableHeader2(table)
5864
- });
5865
- }
5866
- return noop3;
5867
- }
5868
- image(_ref) {
5869
- let {
5870
- logLevel,
5871
- priority,
5872
- image,
5873
- message = "",
5874
- scale: scale5 = 1
5875
- } = _ref;
5876
- if (!this._shouldLog(logLevel || priority)) {
5877
- return noop3;
5878
- }
5879
- return isBrowser5 ? logImageInBrowser2({
5880
- image,
5881
- message,
5882
- scale: scale5
5883
- }) : logImageInNode2({
5884
- image,
5885
- message,
5886
- scale: scale5
5887
- });
5888
- }
5889
- time(logLevel, message) {
5890
- return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
5891
- }
5892
- timeEnd(logLevel, message) {
5893
- return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
5894
- }
5895
- timeStamp(logLevel, message) {
5896
- return this._getLogFunction(logLevel, message, console.timeStamp || noop3);
5897
- }
5898
- group(logLevel, message) {
5899
- let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
5900
- collapsed: false
5901
- };
5902
- const options = normalizeArguments2({
5903
- logLevel,
5904
- message,
5905
- opts
5906
- });
5907
- const {
5908
- collapsed
5909
- } = opts;
5910
- options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
5911
- return this._getLogFunction(options);
5912
- }
5913
- groupCollapsed(logLevel, message) {
5914
- let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
5915
- return this.group(logLevel, message, Object.assign({}, opts, {
5916
- collapsed: true
5917
- }));
5918
- }
5919
- groupEnd(logLevel) {
5920
- return this._getLogFunction(logLevel, "", console.groupEnd || noop3);
5921
- }
5922
- withGroup(logLevel, message, func) {
5923
- this.group(logLevel, message)();
5924
- try {
5925
- func();
5926
- } finally {
5927
- this.groupEnd(logLevel)();
5928
- }
5929
- }
5930
- trace() {
5931
- if (console.trace) {
5932
- console.trace();
5933
- }
5934
- }
5935
- _shouldLog(logLevel) {
5936
- return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
5937
- }
5938
- _getLogFunction(logLevel, message, method, args, opts) {
5939
- if (this._shouldLog(logLevel)) {
5940
- opts = normalizeArguments2({
5941
- logLevel,
5942
- message,
5943
- args,
5944
- opts
5945
- });
5946
- method = method || opts.method;
5947
- assert6(method);
5948
- opts.total = this.getTotal();
5949
- opts.delta = this.getDelta();
5950
- this._deltaTs = getHiResTimestamp3();
5951
- const tag = opts.tag || opts.message;
5952
- if (opts.once) {
5953
- if (!cache2[tag]) {
5954
- cache2[tag] = getHiResTimestamp3();
5955
- } else {
5956
- return noop3;
5957
- }
5958
- }
5959
- message = decorateMessage2(this.id, opts.message, opts);
5960
- return method.bind(console, message, ...opts.args);
5961
- }
5962
- return noop3;
5409
+ const value = options[key];
5410
+ if (isPureObject(value) && isPureObject(mergedOptions[key])) {
5411
+ mergedOptions[key] = {
5412
+ ...mergedOptions[key],
5413
+ ...options[key]
5414
+ };
5415
+ } else {
5416
+ mergedOptions[key] = options[key];
5963
5417
  }
5418
+ }
5419
+ }
5420
+ }
5421
+ function addUrlOptions(options, url) {
5422
+ if (url && !("baseUri" in options)) {
5423
+ options.baseUri = url;
5424
+ }
5425
+ }
5426
+ var getGlobalLoaderOptions;
5427
+ var init_option_utils = __esm({
5428
+ "../core/src/lib/loader-utils/option-utils.ts"() {
5429
+ init_is_type();
5430
+ init_fetch_file();
5431
+ init_loggers();
5432
+ init_option_defaults();
5433
+ getGlobalLoaderOptions = () => {
5434
+ const state = getGlobalLoaderState();
5435
+ state.globalOptions = state.globalOptions || { ...DEFAULT_LOADER_OPTIONS };
5436
+ return state.globalOptions;
5964
5437
  };
5965
- _defineProperty(Log2, "VERSION", VERSION4);
5966
5438
  }
5967
5439
  });
5968
5440
 
5969
- // ../../node_modules/@probe.gl/log/dist/esm/index.js
5970
- var esm_default2;
5971
- var init_esm6 = __esm({
5972
- "../../node_modules/@probe.gl/log/dist/esm/index.js"() {
5973
- init_log2();
5974
- init_log2();
5975
- esm_default2 = new Log2({
5976
- id: "@probe.gl/log"
5977
- });
5441
+ // ../core/src/lib/loader-utils/normalize-loader.ts
5442
+ function isLoaderObject(loader) {
5443
+ if (!loader) {
5444
+ return false;
5445
+ }
5446
+ if (Array.isArray(loader)) {
5447
+ loader = loader[0];
5448
+ }
5449
+ const hasExtensions = Array.isArray(loader?.extensions);
5450
+ return hasExtensions;
5451
+ }
5452
+ function normalizeLoader(loader) {
5453
+ assert2(loader, "null loader");
5454
+ assert2(isLoaderObject(loader), "invalid loader");
5455
+ let options;
5456
+ if (Array.isArray(loader)) {
5457
+ options = loader[1];
5458
+ loader = loader[0];
5459
+ loader = {
5460
+ ...loader,
5461
+ options: { ...loader.options, ...options }
5462
+ };
5463
+ }
5464
+ if (loader?.parseTextSync || loader?.parseText) {
5465
+ loader.text = true;
5466
+ }
5467
+ if (!loader.text) {
5468
+ loader.binary = true;
5469
+ }
5470
+ return loader;
5471
+ }
5472
+ var init_normalize_loader = __esm({
5473
+ "../core/src/lib/loader-utils/normalize-loader.ts"() {
5474
+ init_src2();
5475
+ }
5476
+ });
5477
+
5478
+ // ../core/src/lib/api/register-loaders.ts
5479
+ function getRegisteredLoaders() {
5480
+ return getGlobalLoaderRegistry();
5481
+ }
5482
+ var getGlobalLoaderRegistry;
5483
+ var init_register_loaders = __esm({
5484
+ "../core/src/lib/api/register-loaders.ts"() {
5485
+ init_option_utils();
5486
+ getGlobalLoaderRegistry = () => {
5487
+ const state = getGlobalLoaderState();
5488
+ state.loaderRegistry = state.loaderRegistry || [];
5489
+ return state.loaderRegistry;
5490
+ };
5978
5491
  }
5979
5492
  });
5980
5493
 
5981
5494
  // ../core/src/lib/utils/log.ts
5982
5495
  var log;
5983
- var init_log3 = __esm({
5496
+ var init_log2 = __esm({
5984
5497
  "../core/src/lib/utils/log.ts"() {
5985
- init_esm6();
5986
- log = new Log2({ id: "loaders.gl" });
5498
+ init_esm4();
5499
+ log = new Log({ id: "loaders.gl" });
5987
5500
  }
5988
5501
  });
5989
5502
 
@@ -6172,7 +5685,7 @@
6172
5685
  "../core/src/lib/api/select-loader.ts"() {
6173
5686
  init_src2();
6174
5687
  init_normalize_loader();
6175
- init_log3();
5688
+ init_log2();
6176
5689
  init_resource_utils();
6177
5690
  init_register_loaders();
6178
5691
  init_is_type();
@@ -6525,10 +6038,10 @@
6525
6038
  });
6526
6039
 
6527
6040
  // src/lib/utils/version.ts
6528
- var VERSION5;
6041
+ var VERSION4;
6529
6042
  var init_version2 = __esm({
6530
6043
  "src/lib/utils/version.ts"() {
6531
- VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
6044
+ VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
6532
6045
  }
6533
6046
  });
6534
6047
 
@@ -6574,10 +6087,10 @@
6574
6087
  });
6575
6088
 
6576
6089
  // ../draco/src/lib/utils/version.ts
6577
- var VERSION6;
6090
+ var VERSION5;
6578
6091
  var init_version3 = __esm({
6579
6092
  "../draco/src/lib/utils/version.ts"() {
6580
- VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
6093
+ VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
6581
6094
  }
6582
6095
  });
6583
6096
 
@@ -6585,6 +6098,7 @@
6585
6098
  var DEFAULT_DRACO_OPTIONS, DracoLoader;
6586
6099
  var init_draco_loader = __esm({
6587
6100
  "../draco/src/draco-loader.ts"() {
6101
+ init_src();
6588
6102
  init_version3();
6589
6103
  DEFAULT_DRACO_OPTIONS = {
6590
6104
  draco: {
@@ -6596,10 +6110,10 @@
6596
6110
  };
6597
6111
  DracoLoader = {
6598
6112
  name: "Draco",
6599
- id: "draco",
6113
+ id: isBrowser2 ? "draco" : "draco-nodejs",
6600
6114
  module: "draco",
6601
6115
  shapes: ["mesh"],
6602
- version: VERSION6,
6116
+ version: VERSION5,
6603
6117
  worker: true,
6604
6118
  extensions: ["drc"],
6605
6119
  mimeTypes: ["application/octet-stream"],
@@ -6642,12 +6156,12 @@
6642
6156
  });
6643
6157
 
6644
6158
  // ../schema/src/lib/utils/assert.ts
6645
- function assert7(condition, message) {
6159
+ function assert6(condition, message) {
6646
6160
  if (!condition) {
6647
6161
  throw new Error(message || "loader assertion failed.");
6648
6162
  }
6649
6163
  }
6650
- var init_assert6 = __esm({
6164
+ var init_assert5 = __esm({
6651
6165
  "../schema/src/lib/utils/assert.ts"() {
6652
6166
  }
6653
6167
  });
@@ -6668,10 +6182,10 @@
6668
6182
  var Schema;
6669
6183
  var init_schema = __esm({
6670
6184
  "../schema/src/lib/schema/impl/schema.ts"() {
6671
- init_assert6();
6185
+ init_assert5();
6672
6186
  Schema = class {
6673
6187
  constructor(fields, metadata) {
6674
- assert7(Array.isArray(fields));
6188
+ assert6(Array.isArray(fields));
6675
6189
  checkNames(fields);
6676
6190
  this.fields = fields;
6677
6191
  this.metadata = metadata || new Map();
@@ -6692,8 +6206,8 @@
6692
6206
  }
6693
6207
  select(...columnNames) {
6694
6208
  const nameMap = Object.create(null);
6695
- for (const name8 of columnNames) {
6696
- nameMap[name8] = true;
6209
+ for (const name10 of columnNames) {
6210
+ nameMap[name10] = true;
6697
6211
  }
6698
6212
  const selectedFields = this.fields.filter((field) => nameMap[field.name]);
6699
6213
  return new Schema(selectedFields, this.metadata);
@@ -6731,8 +6245,8 @@
6731
6245
  var init_field = __esm({
6732
6246
  "../schema/src/lib/schema/impl/field.ts"() {
6733
6247
  Field = class {
6734
- constructor(name8, type, nullable = false, metadata = new Map()) {
6735
- this.name = name8;
6248
+ constructor(name10, type, nullable = false, metadata = new Map()) {
6249
+ this.name = name10;
6736
6250
  this.type = type;
6737
6251
  this.nullable = nullable;
6738
6252
  this.metadata = metadata;
@@ -7617,15 +7131,17 @@
7617
7131
  });
7618
7132
  });
7619
7133
  }
7620
- var DRACO_VERSION, DRACO_JS_DECODER_URL, DRACO_WASM_WRAPPER_URL, DRACO_WASM_DECODER_URL, DRACO_ENCODER_URL, loadDecoderPromise;
7134
+ var DRACO_DECODER_VERSION, DRACO_ENCODER_VERSION, STATIC_DECODER_URL, DRACO_JS_DECODER_URL, DRACO_WASM_WRAPPER_URL, DRACO_WASM_DECODER_URL, DRACO_ENCODER_URL, loadDecoderPromise;
7621
7135
  var init_draco_module_loader = __esm({
7622
7136
  "../draco/src/lib/draco-module-loader.ts"() {
7623
7137
  init_src();
7624
- DRACO_VERSION = "1.4.1";
7625
- DRACO_JS_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_VERSION}/draco_decoder.js`;
7626
- DRACO_WASM_WRAPPER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_VERSION}/draco_wasm_wrapper.js`;
7627
- DRACO_WASM_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_VERSION}/draco_decoder.wasm`;
7628
- DRACO_ENCODER_URL = `https://raw.githubusercontent.com/google/draco/${DRACO_VERSION}/javascript/draco_encoder.js`;
7138
+ DRACO_DECODER_VERSION = "1.5.5";
7139
+ DRACO_ENCODER_VERSION = "1.4.1";
7140
+ STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
7141
+ DRACO_JS_DECODER_URL = `${STATIC_DECODER_URL}/draco_decoder.js`;
7142
+ DRACO_WASM_WRAPPER_URL = `${STATIC_DECODER_URL}/draco_wasm_wrapper.js`;
7143
+ DRACO_WASM_DECODER_URL = `${STATIC_DECODER_URL}/draco_decoder.wasm`;
7144
+ DRACO_ENCODER_URL = `https://raw.githubusercontent.com/google/draco/${DRACO_ENCODER_VERSION}/javascript/draco_encoder.js`;
7629
7145
  }
7630
7146
  });
7631
7147
 
@@ -7719,8 +7235,8 @@
7719
7235
  }
7720
7236
  throw new Error(ERR_TYPE_CONVERSION);
7721
7237
  }
7722
- static fromName(name8) {
7723
- const glType = NAME_TO_GL_TYPE[name8];
7238
+ static fromName(name10) {
7239
+ const glType = NAME_TO_GL_TYPE[name10];
7724
7240
  if (!glType) {
7725
7241
  throw new Error(ERR_TYPE_CONVERSION);
7726
7242
  }
@@ -7759,12 +7275,12 @@
7759
7275
  });
7760
7276
 
7761
7277
  // ../math/src/geometry/utils/assert.ts
7762
- function assert8(condition, message) {
7278
+ function assert7(condition, message) {
7763
7279
  if (!condition) {
7764
7280
  throw new Error(`math.gl assertion failed. ${message}`);
7765
7281
  }
7766
7282
  }
7767
- var init_assert7 = __esm({
7283
+ var init_assert6 = __esm({
7768
7284
  "../math/src/geometry/utils/assert.ts"() {
7769
7285
  }
7770
7286
  });
@@ -7792,7 +7308,7 @@
7792
7308
  return value < 0 ? -1 : 1;
7793
7309
  }
7794
7310
  function octDecodeInRange(x, y, rangeMax, result) {
7795
- assert8(result);
7311
+ assert7(result);
7796
7312
  if (x < 0 || x > rangeMax || y < 0 || y > rangeMax) {
7797
7313
  throw new Error(`x and y must be unsigned normalized integers between 0 and ${rangeMax}`);
7798
7314
  }
@@ -7813,7 +7329,7 @@
7813
7329
  var init_attribute_compression = __esm({
7814
7330
  "../math/src/geometry/compression/attribute-compression.ts"() {
7815
7331
  init_esm();
7816
- init_assert7();
7332
+ init_assert6();
7817
7333
  RIGHT_SHIFT = 1 / 256;
7818
7334
  scratchVector23 = new Vector2();
7819
7335
  scratchVector32 = new Vector3();
@@ -8279,10 +7795,10 @@
8279
7795
  }
8280
7796
  return void 0;
8281
7797
  }
8282
- hasProperty(batchId, name8) {
7798
+ hasProperty(batchId, name10) {
8283
7799
  this._checkBatchId(batchId);
8284
- assert2(typeof name8 === "string", name8);
8285
- return defined2(this._properties[name8]) || this._hasPropertyInHierarchy(batchId, name8);
7800
+ assert2(typeof name10 === "string", name10);
7801
+ return defined2(this._properties[name10]) || this._hasPropertyInHierarchy(batchId, name10);
8286
7802
  }
8287
7803
  getPropertyNames(batchId, results) {
8288
7804
  this._checkBatchId(batchId);
@@ -8295,47 +7811,47 @@
8295
7811
  }
8296
7812
  return results;
8297
7813
  }
8298
- getProperty(batchId, name8) {
7814
+ getProperty(batchId, name10) {
8299
7815
  this._checkBatchId(batchId);
8300
- assert2(typeof name8 === "string", name8);
7816
+ assert2(typeof name10 === "string", name10);
8301
7817
  if (this._binaryProperties) {
8302
- const binaryProperty = this._binaryProperties[name8];
7818
+ const binaryProperty = this._binaryProperties[name10];
8303
7819
  if (defined2(binaryProperty)) {
8304
7820
  return this._getBinaryProperty(binaryProperty, batchId);
8305
7821
  }
8306
7822
  }
8307
- const propertyValues = this._properties[name8];
7823
+ const propertyValues = this._properties[name10];
8308
7824
  if (defined2(propertyValues)) {
8309
7825
  return clone3(propertyValues[batchId], true);
8310
7826
  }
8311
7827
  if (this._hierarchy) {
8312
- const hierarchyProperty = this._getHierarchyProperty(batchId, name8);
7828
+ const hierarchyProperty = this._getHierarchyProperty(batchId, name10);
8313
7829
  if (defined2(hierarchyProperty)) {
8314
7830
  return hierarchyProperty;
8315
7831
  }
8316
7832
  }
8317
7833
  return void 0;
8318
7834
  }
8319
- setProperty(batchId, name8, value) {
7835
+ setProperty(batchId, name10, value) {
8320
7836
  const featureCount = this.featureCount;
8321
7837
  this._checkBatchId(batchId);
8322
- assert2(typeof name8 === "string", name8);
7838
+ assert2(typeof name10 === "string", name10);
8323
7839
  if (this._binaryProperties) {
8324
- const binaryProperty = this._binaryProperties[name8];
7840
+ const binaryProperty = this._binaryProperties[name10];
8325
7841
  if (binaryProperty) {
8326
7842
  this._setBinaryProperty(binaryProperty, batchId, value);
8327
7843
  return;
8328
7844
  }
8329
7845
  }
8330
7846
  if (this._hierarchy) {
8331
- if (this._setHierarchyProperty(this, batchId, name8, value)) {
7847
+ if (this._setHierarchyProperty(this, batchId, name10, value)) {
8332
7848
  return;
8333
7849
  }
8334
7850
  }
8335
- let propertyValues = this._properties[name8];
7851
+ let propertyValues = this._properties[name10];
8336
7852
  if (!defined2(propertyValues)) {
8337
- this._properties[name8] = new Array(featureCount);
8338
- propertyValues = this._properties[name8];
7853
+ this._properties[name10] = new Array(featureCount);
7854
+ propertyValues = this._properties[name10];
8339
7855
  }
8340
7856
  propertyValues[batchId] = clone3(value, true);
8341
7857
  }
@@ -8353,21 +7869,21 @@
8353
7869
  }
8354
7870
  _initializeBinaryProperties() {
8355
7871
  let binaryProperties = null;
8356
- for (const name8 in this._properties) {
8357
- const property = this._properties[name8];
8358
- const binaryProperty = this._initializeBinaryProperty(name8, property);
7872
+ for (const name10 in this._properties) {
7873
+ const property = this._properties[name10];
7874
+ const binaryProperty = this._initializeBinaryProperty(name10, property);
8359
7875
  if (binaryProperty) {
8360
7876
  binaryProperties = binaryProperties || {};
8361
- binaryProperties[name8] = binaryProperty;
7877
+ binaryProperties[name10] = binaryProperty;
8362
7878
  }
8363
7879
  }
8364
7880
  return binaryProperties;
8365
7881
  }
8366
- _initializeBinaryProperty(name8, property) {
7882
+ _initializeBinaryProperty(name10, property) {
8367
7883
  if ("byteOffset" in property) {
8368
7884
  const tile3DAccessor = property;
8369
- assert2(this.binary, `Property ${name8} requires a batch table binary.`);
8370
- assert2(tile3DAccessor.type, `Property ${name8} requires a type.`);
7885
+ assert2(this.binary, `Property ${name10} requires a batch table binary.`);
7886
+ assert2(tile3DAccessor.type, `Property ${name10} requires a type.`);
8371
7887
  const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
8372
7888
  return {
8373
7889
  typedArray: accessor.values,
@@ -8378,14 +7894,14 @@
8378
7894
  }
8379
7895
  return null;
8380
7896
  }
8381
- _hasPropertyInHierarchy(batchId, name8) {
7897
+ _hasPropertyInHierarchy(batchId, name10) {
8382
7898
  if (!this._hierarchy) {
8383
7899
  return false;
8384
7900
  }
8385
7901
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
8386
7902
  const classId = hierarchy.classIds[instanceIndex];
8387
7903
  const instances = hierarchy.classes[classId].instances;
8388
- return defined2(instances[name8]);
7904
+ return defined2(instances[name10]);
8389
7905
  });
8390
7906
  return defined2(result);
8391
7907
  }
@@ -8393,21 +7909,21 @@
8393
7909
  traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
8394
7910
  const classId = hierarchy.classIds[instanceIndex];
8395
7911
  const instances = hierarchy.classes[classId].instances;
8396
- for (const name8 in instances) {
8397
- if (instances.hasOwnProperty(name8)) {
8398
- if (results.indexOf(name8) === -1) {
8399
- results.push(name8);
7912
+ for (const name10 in instances) {
7913
+ if (instances.hasOwnProperty(name10)) {
7914
+ if (results.indexOf(name10) === -1) {
7915
+ results.push(name10);
8400
7916
  }
8401
7917
  }
8402
7918
  }
8403
7919
  });
8404
7920
  }
8405
- _getHierarchyProperty(batchId, name8) {
7921
+ _getHierarchyProperty(batchId, name10) {
8406
7922
  return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
8407
7923
  const classId = hierarchy.classIds[instanceIndex];
8408
7924
  const instanceClass = hierarchy.classes[classId];
8409
7925
  const indexInClass = hierarchy.classIndexes[instanceIndex];
8410
- const propertyValues = instanceClass.instances[name8];
7926
+ const propertyValues = instanceClass.instances[name10];
8411
7927
  if (defined2(propertyValues)) {
8412
7928
  if (defined2(propertyValues.typedArray)) {
8413
7929
  return this._getBinaryProperty(propertyValues, indexInClass);
@@ -8417,14 +7933,14 @@
8417
7933
  return null;
8418
7934
  });
8419
7935
  }
8420
- _setHierarchyProperty(batchTable, batchId, name8, value) {
7936
+ _setHierarchyProperty(batchTable, batchId, name10, value) {
8421
7937
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
8422
7938
  const classId = hierarchy.classIds[instanceIndex];
8423
7939
  const instanceClass = hierarchy.classes[classId];
8424
7940
  const indexInClass = hierarchy.classIndexes[instanceIndex];
8425
- const propertyValues = instanceClass.instances[name8];
7941
+ const propertyValues = instanceClass.instances[name10];
8426
7942
  if (defined2(propertyValues)) {
8427
- assert2(instanceIndex === batchId, `Inherited property "${name8}" is read-only.`);
7943
+ assert2(instanceIndex === batchId, `Inherited property "${name10}" is read-only.`);
8428
7944
  if (defined2(propertyValues.typedArray)) {
8429
7945
  this._setBinaryProperty(propertyValues, indexInClass, value);
8430
7946
  } else {
@@ -8865,18 +8381,18 @@
8865
8381
  });
8866
8382
 
8867
8383
  // ../gltf/src/lib/utils/version.ts
8868
- var VERSION7;
8384
+ var VERSION6;
8869
8385
  var init_version4 = __esm({
8870
8386
  "../gltf/src/lib/utils/version.ts"() {
8871
- VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
8387
+ VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
8872
8388
  }
8873
8389
  });
8874
8390
 
8875
8391
  // ../textures/src/lib/utils/version.ts
8876
- var VERSION8;
8392
+ var VERSION7;
8877
8393
  var init_version5 = __esm({
8878
8394
  "../textures/src/lib/utils/version.ts"() {
8879
- VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
8395
+ VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
8880
8396
  }
8881
8397
  });
8882
8398
 
@@ -8905,8 +8421,8 @@
8905
8421
  options.wasmBinary = wasmBinary;
8906
8422
  }
8907
8423
  return new Promise((resolve) => {
8908
- BasisModule(options).then((module2) => {
8909
- const { BasisFile, initializeBasis } = module2;
8424
+ BasisModule(options).then((module) => {
8425
+ const { BasisFile, initializeBasis } = module;
8910
8426
  initializeBasis();
8911
8427
  resolve({ BasisFile });
8912
8428
  });
@@ -8936,20 +8452,20 @@
8936
8452
  options.wasmBinary = wasmBinary;
8937
8453
  }
8938
8454
  return new Promise((resolve) => {
8939
- BasisEncoderModule(options).then((module2) => {
8940
- const { BasisFile, KTX2File, initializeBasis, BasisEncoder } = module2;
8455
+ BasisEncoderModule(options).then((module) => {
8456
+ const { BasisFile, KTX2File, initializeBasis, BasisEncoder } = module;
8941
8457
  initializeBasis();
8942
8458
  resolve({ BasisFile, KTX2File, BasisEncoder });
8943
8459
  });
8944
8460
  });
8945
8461
  }
8946
- var VERSION9, BASIS_CDN_ENCODER_WASM, BASIS_CDN_ENCODER_JS, loadBasisTranscoderPromise, loadBasisEncoderPromise;
8462
+ var VERSION8, BASIS_CDN_ENCODER_WASM, BASIS_CDN_ENCODER_JS, loadBasisTranscoderPromise, loadBasisEncoderPromise;
8947
8463
  var init_basis_module_loader = __esm({
8948
8464
  "../textures/src/lib/parsers/basis-module-loader.ts"() {
8949
8465
  init_src();
8950
- VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
8951
- BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION9}/dist/libs/basis_encoder.wasm`;
8952
- BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION9}/dist/libs/basis_encoder.js`;
8466
+ VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
8467
+ BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION8}/dist/libs/basis_encoder.wasm`;
8468
+ BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION8}/dist/libs/basis_encoder.js`;
8953
8469
  }
8954
8470
  });
8955
8471
 
@@ -9305,13 +8821,14 @@
9305
8821
  var BasisWorkerLoader, BasisLoader;
9306
8822
  var init_basis_loader = __esm({
9307
8823
  "../textures/src/basis-loader.ts"() {
8824
+ init_src();
9308
8825
  init_version5();
9309
8826
  init_parse_basis();
9310
8827
  BasisWorkerLoader = {
9311
8828
  name: "Basis",
9312
- id: "basis",
8829
+ id: isBrowser2 ? "basis" : "basis-nodejs",
9313
8830
  module: "textures",
9314
- version: VERSION8,
8831
+ version: VERSION7,
9315
8832
  worker: true,
9316
8833
  extensions: ["basis", "ktx2"],
9317
8834
  mimeTypes: ["application/octet-stream", "image/ktx2"],
@@ -9334,10 +8851,10 @@
9334
8851
  });
9335
8852
 
9336
8853
  // ../images/src/lib/utils/version.ts
9337
- var VERSION10;
8854
+ var VERSION9;
9338
8855
  var init_version6 = __esm({
9339
8856
  "../images/src/lib/utils/version.ts"() {
9340
- VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
8857
+ VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
9341
8858
  }
9342
8859
  });
9343
8860
 
@@ -9732,7 +9249,7 @@
9732
9249
  id: "image",
9733
9250
  module: "images",
9734
9251
  name: "Images",
9735
- version: VERSION10,
9252
+ version: VERSION9,
9736
9253
  mimeTypes: MIME_TYPES,
9737
9254
  extensions: EXTENSIONS,
9738
9255
  parse: parseImage,
@@ -9801,12 +9318,12 @@
9801
9318
  });
9802
9319
 
9803
9320
  // ../gltf/src/lib/utils/assert.ts
9804
- function assert9(condition, message) {
9321
+ function assert8(condition, message) {
9805
9322
  if (!condition) {
9806
9323
  throw new Error(message || "assert failed: gltf");
9807
9324
  }
9808
9325
  }
9809
- var init_assert8 = __esm({
9326
+ var init_assert7 = __esm({
9810
9327
  "../gltf/src/lib/utils/assert.ts"() {
9811
9328
  }
9812
9329
  });
@@ -9831,16 +9348,16 @@
9831
9348
  // ../gltf/src/lib/gltf-utils/get-typed-array.ts
9832
9349
  function getTypedArrayForBufferView(json, buffers, bufferViewIndex) {
9833
9350
  const bufferView = json.bufferViews[bufferViewIndex];
9834
- assert9(bufferView);
9351
+ assert8(bufferView);
9835
9352
  const bufferIndex = bufferView.buffer;
9836
9353
  const binChunk = buffers[bufferIndex];
9837
- assert9(binChunk);
9354
+ assert8(binChunk);
9838
9355
  const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
9839
9356
  return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
9840
9357
  }
9841
9358
  var init_get_typed_array = __esm({
9842
9359
  "../gltf/src/lib/gltf-utils/get-typed-array.ts"() {
9843
- init_assert8();
9360
+ init_assert7();
9844
9361
  }
9845
9362
  });
9846
9363
 
@@ -9862,13 +9379,13 @@
9862
9379
  const bytesPerComponent = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE[accessor.componentType];
9863
9380
  const length4 = accessor.count * components;
9864
9381
  const byteLength = accessor.count * components * bytesPerComponent;
9865
- assert9(byteLength >= 0 && byteLength <= bufferView.byteLength);
9382
+ assert8(byteLength >= 0 && byteLength <= bufferView.byteLength);
9866
9383
  return { ArrayType, length: length4, byteLength };
9867
9384
  }
9868
9385
  var TYPES, ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT, ARRAY_TO_COMPONENT_TYPE, ATTRIBUTE_TYPE_TO_COMPONENTS, ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE, ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY;
9869
9386
  var init_gltf_utils = __esm({
9870
9387
  "../gltf/src/lib/gltf-utils/gltf-utils.ts"() {
9871
- init_assert8();
9388
+ init_assert7();
9872
9389
  TYPES = ["SCALAR", "VEC2", "VEC3", "VEC4"];
9873
9390
  ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT = [
9874
9391
  [Int8Array, 5120],
@@ -9914,7 +9431,7 @@
9914
9431
  "../gltf/src/lib/api/gltf-scenegraph.ts"() {
9915
9432
  init_src8();
9916
9433
  init_src2();
9917
- init_assert8();
9434
+ init_assert7();
9918
9435
  init_gltf_utils();
9919
9436
  DEFAULT_GLTF_JSON = {
9920
9437
  asset: {
@@ -9948,12 +9465,12 @@
9948
9465
  return extras[key];
9949
9466
  }
9950
9467
  getExtension(extensionName) {
9951
- const isExtension = this.getUsedExtensions().find((name8) => name8 === extensionName);
9468
+ const isExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
9952
9469
  const extensions = this.json.extensions || {};
9953
9470
  return isExtension ? extensions[extensionName] || true : null;
9954
9471
  }
9955
9472
  getRequiredExtension(extensionName) {
9956
- const isRequired = this.getRequiredExtensions().find((name8) => name8 === extensionName);
9473
+ const isRequired = this.getRequiredExtensions().find((name10) => name10 === extensionName);
9957
9474
  return isRequired ? this.getExtension(extensionName) : null;
9958
9475
  }
9959
9476
  getRequiredExtensions() {
@@ -9962,6 +9479,9 @@
9962
9479
  getUsedExtensions() {
9963
9480
  return this.json.extensionsUsed || [];
9964
9481
  }
9482
+ getRemovedExtensions() {
9483
+ return this.json.extensionsRemoved || [];
9484
+ }
9965
9485
  getObjectExtension(object, extensionName) {
9966
9486
  const extensions = object.extensions || {};
9967
9487
  return extensions[extensionName];
@@ -10013,7 +9533,7 @@
10013
9533
  bufferView = this.getBufferView(bufferView);
10014
9534
  const bufferIndex = bufferView.buffer;
10015
9535
  const binChunk = this.gltf.buffers[bufferIndex];
10016
- assert9(binChunk);
9536
+ assert8(binChunk);
10017
9537
  const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
10018
9538
  return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
10019
9539
  }
@@ -10060,14 +9580,14 @@
10060
9580
  return extension;
10061
9581
  }
10062
9582
  addExtension(extensionName, extensionData = {}) {
10063
- assert9(extensionData);
9583
+ assert8(extensionData);
10064
9584
  this.json.extensions = this.json.extensions || {};
10065
9585
  this.json.extensions[extensionName] = extensionData;
10066
9586
  this.registerUsedExtension(extensionName);
10067
9587
  return extensionData;
10068
9588
  }
10069
9589
  addRequiredExtension(extensionName, extensionData = {}) {
10070
- assert9(extensionData);
9590
+ assert8(extensionData);
10071
9591
  this.addExtension(extensionName, extensionData);
10072
9592
  this.registerRequiredExtension(extensionName);
10073
9593
  return extensionData;
@@ -10086,6 +9606,9 @@
10086
9606
  }
10087
9607
  }
10088
9608
  removeExtension(extensionName) {
9609
+ if (!this.getExtension(extensionName)) {
9610
+ return;
9611
+ }
10089
9612
  if (this.json.extensionsRequired) {
10090
9613
  this._removeStringFromArray(this.json.extensionsRequired, extensionName);
10091
9614
  }
@@ -10095,6 +9618,13 @@
10095
9618
  if (this.json.extensions) {
10096
9619
  delete this.json.extensions[extensionName];
10097
9620
  }
9621
+ if (!Array.isArray(this.json.extensionsRemoved)) {
9622
+ this.json.extensionsRemoved = [];
9623
+ }
9624
+ const extensionsRemoved = this.json.extensionsRemoved;
9625
+ if (!extensionsRemoved.includes(extensionName)) {
9626
+ extensionsRemoved.push(extensionName);
9627
+ }
10098
9628
  }
10099
9629
  setDefaultScene(sceneIndex) {
10100
9630
  this.json.scene = sceneIndex;
@@ -10165,7 +9695,7 @@
10165
9695
  }
10166
9696
  addBufferView(buffer) {
10167
9697
  const byteLength = buffer.byteLength;
10168
- assert9(Number.isFinite(byteLength));
9698
+ assert8(Number.isFinite(byteLength));
10169
9699
  this.sourceBuffers = this.sourceBuffers || [];
10170
9700
  this.sourceBuffers.push(buffer);
10171
9701
  const glTFBufferView = {
@@ -10607,11 +10137,11 @@
10607
10137
  // ../gltf/src/lib/gltf-utils/gltf-attribute-utils.ts
10608
10138
  function getGLTFAccessors(attributes) {
10609
10139
  const accessors = {};
10610
- for (const name8 in attributes) {
10611
- const attribute = attributes[name8];
10612
- if (name8 !== "indices") {
10140
+ for (const name10 in attributes) {
10141
+ const attribute = attributes[name10];
10142
+ if (name10 !== "indices") {
10613
10143
  const glTFAccessor = getGLTFAccessor(attribute);
10614
- accessors[name8] = glTFAccessor;
10144
+ accessors[name10] = glTFAccessor;
10615
10145
  }
10616
10146
  }
10617
10147
  return accessors;
@@ -10774,14 +10304,201 @@
10774
10304
  }
10775
10305
  });
10776
10306
 
10307
+ // ../gltf/src/lib/gltf-utils/gltf-constants.ts
10308
+ var COMPONENTS, BYTES;
10309
+ var init_gltf_constants = __esm({
10310
+ "../gltf/src/lib/gltf-utils/gltf-constants.ts"() {
10311
+ COMPONENTS = {
10312
+ SCALAR: 1,
10313
+ VEC2: 2,
10314
+ VEC3: 3,
10315
+ VEC4: 4,
10316
+ MAT2: 4,
10317
+ MAT3: 9,
10318
+ MAT4: 16
10319
+ };
10320
+ BYTES = {
10321
+ 5120: 1,
10322
+ 5121: 1,
10323
+ 5122: 2,
10324
+ 5123: 2,
10325
+ 5125: 4,
10326
+ 5126: 4
10327
+ };
10328
+ }
10329
+ });
10330
+
10331
+ // ../gltf/src/lib/extensions/KHR_texture_transform.ts
10332
+ var KHR_texture_transform_exports = {};
10333
+ __export(KHR_texture_transform_exports, {
10334
+ decode: () => decode4,
10335
+ name: () => name5
10336
+ });
10337
+ async function decode4(gltfData, options) {
10338
+ const gltfScenegraph = new GLTFScenegraph(gltfData);
10339
+ const extension = gltfScenegraph.getExtension(EXT_MESHOPT_TRANSFORM);
10340
+ if (!extension) {
10341
+ return;
10342
+ }
10343
+ const materials = gltfData.json.materials || [];
10344
+ for (let i2 = 0; i2 < materials.length; i2++) {
10345
+ transformTexCoords(i2, gltfData);
10346
+ }
10347
+ }
10348
+ function transformTexCoords(materialIndex, gltfData) {
10349
+ const processedTexCoords = [];
10350
+ const material = gltfData.json.materials?.[materialIndex];
10351
+ const baseColorTexture = material?.pbrMetallicRoughness?.baseColorTexture;
10352
+ if (baseColorTexture) {
10353
+ transformPrimitives(gltfData, materialIndex, baseColorTexture, processedTexCoords);
10354
+ }
10355
+ const emisiveTexture = material?.emissiveTexture;
10356
+ if (emisiveTexture) {
10357
+ transformPrimitives(gltfData, materialIndex, emisiveTexture, processedTexCoords);
10358
+ }
10359
+ const normalTexture = material?.normalTexture;
10360
+ if (normalTexture) {
10361
+ transformPrimitives(gltfData, materialIndex, normalTexture, processedTexCoords);
10362
+ }
10363
+ const occlusionTexture = material?.occlusionTexture;
10364
+ if (occlusionTexture) {
10365
+ transformPrimitives(gltfData, materialIndex, occlusionTexture, processedTexCoords);
10366
+ }
10367
+ const metallicRoughnessTexture = material?.pbrMetallicRoughness?.metallicRoughnessTexture;
10368
+ if (metallicRoughnessTexture) {
10369
+ transformPrimitives(gltfData, materialIndex, metallicRoughnessTexture, processedTexCoords);
10370
+ }
10371
+ }
10372
+ function transformPrimitives(gltfData, materialIndex, texture, processedTexCoords) {
10373
+ const transformParameters = getTransformParameters(texture, processedTexCoords);
10374
+ if (!transformParameters) {
10375
+ return;
10376
+ }
10377
+ const meshes = gltfData.json.meshes || [];
10378
+ for (const mesh of meshes) {
10379
+ for (const primitive of mesh.primitives) {
10380
+ const material = primitive.material;
10381
+ if (Number.isFinite(material) && materialIndex === material) {
10382
+ transformPrimitive(gltfData, primitive, transformParameters);
10383
+ }
10384
+ }
10385
+ }
10386
+ }
10387
+ function getTransformParameters(texture, processedTexCoords) {
10388
+ const textureInfo = texture.extensions?.[EXT_MESHOPT_TRANSFORM];
10389
+ const { texCoord: originalTexCoord = 0 } = texture;
10390
+ const { texCoord = originalTexCoord } = textureInfo;
10391
+ const isProcessed = processedTexCoords.findIndex(([original, newTexCoord]) => original === originalTexCoord && newTexCoord === texCoord) !== -1;
10392
+ if (!isProcessed) {
10393
+ const matrix = makeTransformationMatrix(textureInfo);
10394
+ if (originalTexCoord !== texCoord) {
10395
+ texture.texCoord = texCoord;
10396
+ }
10397
+ processedTexCoords.push([originalTexCoord, texCoord]);
10398
+ return { originalTexCoord, texCoord, matrix };
10399
+ }
10400
+ return null;
10401
+ }
10402
+ function transformPrimitive(gltfData, primitive, transformParameters) {
10403
+ const { originalTexCoord, texCoord, matrix } = transformParameters;
10404
+ const texCoordAccessor = primitive.attributes[`TEXCOORD_${originalTexCoord}`];
10405
+ if (Number.isFinite(texCoordAccessor)) {
10406
+ const accessor = gltfData.json.accessors?.[texCoordAccessor];
10407
+ if (accessor && accessor.bufferView) {
10408
+ const bufferView = gltfData.json.bufferViews?.[accessor.bufferView];
10409
+ if (bufferView) {
10410
+ const { arrayBuffer, byteOffset: bufferByteOffset } = gltfData.buffers[bufferView.buffer];
10411
+ const byteOffset = (bufferByteOffset || 0) + (accessor.byteOffset || 0) + (bufferView.byteOffset || 0);
10412
+ const { ArrayType, length: length4 } = getAccessorArrayTypeAndLength(accessor, bufferView);
10413
+ const bytes = BYTES[accessor.componentType];
10414
+ const components = COMPONENTS[accessor.type];
10415
+ const elementAddressScale = bufferView.byteStride || bytes * components;
10416
+ const result = new Float32Array(length4);
10417
+ for (let i2 = 0; i2 < accessor.count; i2++) {
10418
+ const uv = new ArrayType(arrayBuffer, byteOffset + i2 * elementAddressScale, 2);
10419
+ scratchVector5.set(uv[0], uv[1], 1);
10420
+ scratchVector5.transformByMatrix3(matrix);
10421
+ result.set([scratchVector5[0], scratchVector5[1]], i2 * components);
10422
+ }
10423
+ if (originalTexCoord === texCoord) {
10424
+ updateGltf(accessor, bufferView, gltfData.buffers, result);
10425
+ } else {
10426
+ createAttribute(texCoord, accessor, primitive, gltfData, result);
10427
+ }
10428
+ }
10429
+ }
10430
+ }
10431
+ }
10432
+ function updateGltf(accessor, bufferView, buffers, newTexCoordArray) {
10433
+ accessor.componentType = 5126;
10434
+ buffers.push({
10435
+ arrayBuffer: newTexCoordArray.buffer,
10436
+ byteOffset: 0,
10437
+ byteLength: newTexCoordArray.buffer.byteLength
10438
+ });
10439
+ bufferView.buffer = buffers.length - 1;
10440
+ bufferView.byteLength = newTexCoordArray.buffer.byteLength;
10441
+ bufferView.byteOffset = 0;
10442
+ delete bufferView.byteStride;
10443
+ }
10444
+ function createAttribute(newTexCoord, originalAccessor, primitive, gltfData, newTexCoordArray) {
10445
+ gltfData.buffers.push({
10446
+ arrayBuffer: newTexCoordArray.buffer,
10447
+ byteOffset: 0,
10448
+ byteLength: newTexCoordArray.buffer.byteLength
10449
+ });
10450
+ const bufferViews = gltfData.json.bufferViews;
10451
+ if (!bufferViews) {
10452
+ return;
10453
+ }
10454
+ bufferViews.push({
10455
+ buffer: gltfData.buffers.length - 1,
10456
+ byteLength: newTexCoordArray.buffer.byteLength,
10457
+ byteOffset: 0
10458
+ });
10459
+ const accessors = gltfData.json.accessors;
10460
+ if (!accessors) {
10461
+ return;
10462
+ }
10463
+ accessors.push({
10464
+ bufferView: bufferViews?.length - 1,
10465
+ byteOffset: 0,
10466
+ componentType: 5126,
10467
+ count: originalAccessor.count,
10468
+ type: "VEC2"
10469
+ });
10470
+ primitive.attributes[`TEXCOORD_${newTexCoord}`] = accessors.length - 1;
10471
+ }
10472
+ function makeTransformationMatrix(extensionData) {
10473
+ const { offset = [0, 0], rotation = 0, scale: scale5 = [1, 1] } = extensionData;
10474
+ const translationMatirx = new Matrix3().set(1, 0, 0, 0, 1, 0, offset[0], offset[1], 1);
10475
+ const rotationMatirx = scratchRotationMatrix.set(Math.cos(rotation), Math.sin(rotation), 0, -Math.sin(rotation), Math.cos(rotation), 0, 0, 0, 1);
10476
+ const scaleMatrix = scratchScaleMatrix.set(scale5[0], 0, 0, 0, scale5[1], 0, 0, 0, 1);
10477
+ return translationMatirx.multiplyRight(rotationMatirx).multiplyRight(scaleMatrix);
10478
+ }
10479
+ var EXT_MESHOPT_TRANSFORM, name5, scratchVector5, scratchRotationMatrix, scratchScaleMatrix;
10480
+ var init_KHR_texture_transform = __esm({
10481
+ "../gltf/src/lib/extensions/KHR_texture_transform.ts"() {
10482
+ init_esm();
10483
+ init_gltf_utils();
10484
+ init_gltf_constants();
10485
+ init_gltf_scenegraph();
10486
+ EXT_MESHOPT_TRANSFORM = "KHR_texture_transform";
10487
+ name5 = EXT_MESHOPT_TRANSFORM;
10488
+ scratchVector5 = new Vector3();
10489
+ scratchRotationMatrix = new Matrix3();
10490
+ scratchScaleMatrix = new Matrix3();
10491
+ }
10492
+ });
10493
+
10777
10494
  // ../gltf/src/lib/extensions/deprecated/KHR_lights_punctual.ts
10778
10495
  var KHR_lights_punctual_exports = {};
10779
10496
  __export(KHR_lights_punctual_exports, {
10780
- decode: () => decode4,
10497
+ decode: () => decode5,
10781
10498
  encode: () => encode2,
10782
- name: () => name5
10499
+ name: () => name6
10783
10500
  });
10784
- async function decode4(gltfData) {
10501
+ async function decode5(gltfData) {
10785
10502
  const gltfScenegraph = new GLTFScenegraph(gltfData);
10786
10503
  const { json } = gltfScenegraph;
10787
10504
  const extension = gltfScenegraph.getExtension(KHR_LIGHTS_PUNCTUAL);
@@ -10802,7 +10519,7 @@
10802
10519
  const { json } = gltfScenegraph;
10803
10520
  if (json.lights) {
10804
10521
  const extension = gltfScenegraph.addExtension(KHR_LIGHTS_PUNCTUAL);
10805
- assert9(!extension.lights);
10522
+ assert8(!extension.lights);
10806
10523
  extension.lights = json.lights;
10807
10524
  delete json.lights;
10808
10525
  }
@@ -10814,27 +10531,26 @@
10814
10531
  delete gltfScenegraph.json.lights;
10815
10532
  }
10816
10533
  }
10817
- var KHR_LIGHTS_PUNCTUAL, name5;
10534
+ var KHR_LIGHTS_PUNCTUAL, name6;
10818
10535
  var init_KHR_lights_punctual = __esm({
10819
10536
  "../gltf/src/lib/extensions/deprecated/KHR_lights_punctual.ts"() {
10820
- init_assert8();
10537
+ init_assert7();
10821
10538
  init_gltf_scenegraph();
10822
10539
  KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
10823
- name5 = KHR_LIGHTS_PUNCTUAL;
10540
+ name6 = KHR_LIGHTS_PUNCTUAL;
10824
10541
  }
10825
10542
  });
10826
10543
 
10827
10544
  // ../gltf/src/lib/extensions/deprecated/KHR_materials_unlit.ts
10828
10545
  var KHR_materials_unlit_exports = {};
10829
10546
  __export(KHR_materials_unlit_exports, {
10830
- decode: () => decode5,
10547
+ decode: () => decode6,
10831
10548
  encode: () => encode3,
10832
- name: () => name6
10549
+ name: () => name7
10833
10550
  });
10834
- async function decode5(gltfData) {
10551
+ async function decode6(gltfData) {
10835
10552
  const gltfScenegraph = new GLTFScenegraph(gltfData);
10836
10553
  const { json } = gltfScenegraph;
10837
- gltfScenegraph.removeExtension(KHR_MATERIALS_UNLIT);
10838
10554
  for (const material of json.materials || []) {
10839
10555
  const extension = material.extensions && material.extensions.KHR_materials_unlit;
10840
10556
  if (extension) {
@@ -10842,6 +10558,7 @@
10842
10558
  }
10843
10559
  gltfScenegraph.removeObjectExtension(material, KHR_MATERIALS_UNLIT);
10844
10560
  }
10561
+ gltfScenegraph.removeExtension(KHR_MATERIALS_UNLIT);
10845
10562
  }
10846
10563
  function encode3(gltfData) {
10847
10564
  const gltfScenegraph = new GLTFScenegraph(gltfData);
@@ -10856,23 +10573,23 @@
10856
10573
  }
10857
10574
  }
10858
10575
  }
10859
- var KHR_MATERIALS_UNLIT, name6;
10576
+ var KHR_MATERIALS_UNLIT, name7;
10860
10577
  var init_KHR_materials_unlit = __esm({
10861
10578
  "../gltf/src/lib/extensions/deprecated/KHR_materials_unlit.ts"() {
10862
10579
  init_gltf_scenegraph();
10863
10580
  KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
10864
- name6 = KHR_MATERIALS_UNLIT;
10581
+ name7 = KHR_MATERIALS_UNLIT;
10865
10582
  }
10866
10583
  });
10867
10584
 
10868
10585
  // ../gltf/src/lib/extensions/deprecated/KHR_techniques_webgl.ts
10869
10586
  var KHR_techniques_webgl_exports = {};
10870
10587
  __export(KHR_techniques_webgl_exports, {
10871
- decode: () => decode6,
10588
+ decode: () => decode7,
10872
10589
  encode: () => encode4,
10873
- name: () => name7
10590
+ name: () => name8
10874
10591
  });
10875
- async function decode6(gltfData) {
10592
+ async function decode7(gltfData) {
10876
10593
  const gltfScenegraph = new GLTFScenegraph(gltfData);
10877
10594
  const { json } = gltfScenegraph;
10878
10595
  const extension = gltfScenegraph.getExtension(KHR_TECHNIQUES_WEBGL);
@@ -10924,12 +10641,97 @@
10924
10641
  });
10925
10642
  return values;
10926
10643
  }
10927
- var KHR_TECHNIQUES_WEBGL, name7;
10644
+ var KHR_TECHNIQUES_WEBGL, name8;
10928
10645
  var init_KHR_techniques_webgl = __esm({
10929
10646
  "../gltf/src/lib/extensions/deprecated/KHR_techniques_webgl.ts"() {
10930
10647
  init_gltf_scenegraph();
10931
10648
  KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
10932
- name7 = KHR_TECHNIQUES_WEBGL;
10649
+ name8 = KHR_TECHNIQUES_WEBGL;
10650
+ }
10651
+ });
10652
+
10653
+ // ../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts
10654
+ var EXT_feature_metadata_exports = {};
10655
+ __export(EXT_feature_metadata_exports, {
10656
+ decode: () => decode8,
10657
+ name: () => name9
10658
+ });
10659
+ async function decode8(gltfData) {
10660
+ const scenegraph = new GLTFScenegraph(gltfData);
10661
+ decodeExtFeatureMetadata(scenegraph);
10662
+ }
10663
+ function decodeExtFeatureMetadata(scenegraph) {
10664
+ const extension = scenegraph.getExtension(EXT_FEATURE_METADATA);
10665
+ const schemaClasses = extension?.schema?.classes;
10666
+ const featureTables = extension?.featureTables;
10667
+ const featureTextures = extension?.featureTextures;
10668
+ if (featureTextures) {
10669
+ console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');
10670
+ }
10671
+ if (schemaClasses && featureTables) {
10672
+ for (const schemaName in schemaClasses) {
10673
+ const schemaClass = schemaClasses[schemaName];
10674
+ const featureTable = findFeatureTableByName(featureTables, schemaName);
10675
+ if (featureTable) {
10676
+ handleFeatureTableProperties(scenegraph, featureTable, schemaClass);
10677
+ }
10678
+ }
10679
+ }
10680
+ }
10681
+ function handleFeatureTableProperties(scenegraph, featureTable, schemaClass) {
10682
+ for (const propertyName in schemaClass.properties) {
10683
+ const schemaProperty = schemaClass.properties[propertyName];
10684
+ const featureTableProperty = featureTable?.properties?.[propertyName];
10685
+ const numberOfFeatures = featureTable.count;
10686
+ if (featureTableProperty) {
10687
+ const data = getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty);
10688
+ featureTableProperty.data = data;
10689
+ }
10690
+ }
10691
+ }
10692
+ function getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
10693
+ const bufferView = featureTableProperty.bufferView;
10694
+ let data = scenegraph.getTypedArrayForBufferView(bufferView);
10695
+ switch (schemaProperty.type) {
10696
+ case "STRING": {
10697
+ const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView;
10698
+ const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);
10699
+ data = getStringAttributes(data, offsetsData, numberOfFeatures);
10700
+ break;
10701
+ }
10702
+ default:
10703
+ }
10704
+ return data;
10705
+ }
10706
+ function findFeatureTableByName(featureTables, schemaClassName) {
10707
+ for (const featureTableName in featureTables) {
10708
+ const featureTable = featureTables[featureTableName];
10709
+ if (featureTable.class === schemaClassName) {
10710
+ return featureTable;
10711
+ }
10712
+ }
10713
+ return null;
10714
+ }
10715
+ function getStringAttributes(data, offsetsData, stringsCount) {
10716
+ const stringsArray = [];
10717
+ const textDecoder = new TextDecoder("utf8");
10718
+ let stringOffset = 0;
10719
+ const bytesPerStringSize = 4;
10720
+ for (let index = 0; index < stringsCount; index++) {
10721
+ const stringByteSize = offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];
10722
+ const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);
10723
+ const stringAttribute = textDecoder.decode(stringData);
10724
+ stringsArray.push(stringAttribute);
10725
+ stringOffset += stringByteSize;
10726
+ }
10727
+ return stringsArray;
10728
+ }
10729
+ var EXT_FEATURE_METADATA, name9;
10730
+ var init_EXT_feature_metadata = __esm({
10731
+ "../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts"() {
10732
+ init_gltf_scenegraph();
10733
+ EXT_FEATURE_METADATA = "EXT_feature_metadata";
10734
+ name9 = EXT_FEATURE_METADATA;
10933
10735
  }
10934
10736
  });
10935
10737
 
@@ -10958,9 +10760,11 @@
10958
10760
  init_EXT_texture_webp();
10959
10761
  init_KHR_texture_basisu();
10960
10762
  init_KHR_draco_mesh_compression();
10763
+ init_KHR_texture_transform();
10961
10764
  init_KHR_lights_punctual();
10962
10765
  init_KHR_materials_unlit();
10963
10766
  init_KHR_techniques_webgl();
10767
+ init_EXT_feature_metadata();
10964
10768
  EXTENSIONS2 = [
10965
10769
  EXT_meshopt_compression_exports,
10966
10770
  EXT_texture_webp_exports,
@@ -10968,7 +10772,9 @@
10968
10772
  KHR_draco_mesh_compression_exports,
10969
10773
  KHR_lights_punctual_exports,
10970
10774
  KHR_materials_unlit_exports,
10971
- KHR_techniques_webgl_exports
10775
+ KHR_techniques_webgl_exports,
10776
+ KHR_texture_transform_exports,
10777
+ EXT_feature_metadata_exports
10972
10778
  ];
10973
10779
  }
10974
10780
  });
@@ -11199,20 +11005,20 @@
11199
11005
 
11200
11006
  // ../gltf/src/lib/api/post-process-gltf.ts
11201
11007
  function getBytesFromComponentType(componentType) {
11202
- return BYTES[componentType];
11008
+ return BYTES2[componentType];
11203
11009
  }
11204
11010
  function getSizeFromAccessorType(type) {
11205
- return COMPONENTS[type];
11011
+ return COMPONENTS2[type];
11206
11012
  }
11207
11013
  function postProcessGLTF(gltf, options) {
11208
11014
  return new GLTFPostProcessor().postProcess(gltf, options);
11209
11015
  }
11210
- var COMPONENTS, BYTES, GL_SAMPLER, SAMPLER_PARAMETER_GLTF_TO_GL, DEFAULT_SAMPLER, GLTFPostProcessor;
11016
+ var COMPONENTS2, BYTES2, GL_SAMPLER, SAMPLER_PARAMETER_GLTF_TO_GL, DEFAULT_SAMPLER, GLTFPostProcessor;
11211
11017
  var init_post_process_gltf = __esm({
11212
11018
  "../gltf/src/lib/api/post-process-gltf.ts"() {
11213
- init_assert8();
11019
+ init_assert7();
11214
11020
  init_gltf_utils();
11215
- COMPONENTS = {
11021
+ COMPONENTS2 = {
11216
11022
  SCALAR: 1,
11217
11023
  VEC2: 2,
11218
11024
  VEC3: 3,
@@ -11221,7 +11027,7 @@
11221
11027
  MAT3: 9,
11222
11028
  MAT4: 16
11223
11029
  };
11224
- BYTES = {
11030
+ BYTES2 = {
11225
11031
  5120: 1,
11226
11032
  5121: 1,
11227
11033
  5122: 2,
@@ -11259,7 +11065,7 @@
11259
11065
  }
11260
11066
  postProcess(gltf, options = {}) {
11261
11067
  const { json, buffers = [], images = [], baseUri = "" } = gltf;
11262
- assert9(json);
11068
+ assert8(json);
11263
11069
  this.baseUri = baseUri;
11264
11070
  this.json = json;
11265
11071
  this.buffers = buffers;
@@ -11663,11 +11469,11 @@
11663
11469
  } else if (data instanceof ArrayBuffer) {
11664
11470
  const glb = {};
11665
11471
  byteOffset = parseGLBSync(glb, data, byteOffset, options.glb);
11666
- assert9(glb.type === "glTF", `Invalid GLB magic string ${glb.type}`);
11472
+ assert8(glb.type === "glTF", `Invalid GLB magic string ${glb.type}`);
11667
11473
  gltf._glb = glb;
11668
11474
  gltf.json = glb.json;
11669
11475
  } else {
11670
- assert9(false, "GLTF: must be ArrayBuffer or string");
11476
+ assert8(false, "GLTF: must be ArrayBuffer or string");
11671
11477
  }
11672
11478
  const buffers = gltf.json.buffers || [];
11673
11479
  gltf.buffers = new Array(buffers.length).fill(null);
@@ -11688,7 +11494,7 @@
11688
11494
  const buffer = buffers[i2];
11689
11495
  if (buffer.uri) {
11690
11496
  const { fetch: fetch2 } = context;
11691
- assert9(fetch2);
11497
+ assert8(fetch2);
11692
11498
  const uri = resolveUrl(buffer.uri, options);
11693
11499
  const response = await context?.fetch?.(uri);
11694
11500
  const arrayBuffer = await response?.arrayBuffer?.();
@@ -11733,12 +11539,15 @@
11733
11539
  const uri = resolveUrl(image.uri, options);
11734
11540
  const response = await fetch2(uri);
11735
11541
  arrayBuffer = await response.arrayBuffer();
11542
+ image.bufferView = {
11543
+ data: arrayBuffer
11544
+ };
11736
11545
  }
11737
11546
  if (Number.isFinite(image.bufferView)) {
11738
11547
  const array = getTypedArrayForBufferView(gltf.json, gltf.buffers, image.bufferView);
11739
11548
  arrayBuffer = sliceArrayBuffer(array.buffer, array.byteOffset, array.byteLength);
11740
11549
  }
11741
- assert9(arrayBuffer, "glTF image has no data");
11550
+ assert8(arrayBuffer, "glTF image has no data");
11742
11551
  let parsedImage = await parse5(arrayBuffer, [ImageLoader, BasisLoader], { mimeType: image.mimeType, basis: options.basis || { format: selectSupportedBasisFormat() } }, context);
11743
11552
  if (parsedImage && parsedImage[0]) {
11744
11553
  parsedImage = {
@@ -11757,7 +11566,7 @@
11757
11566
  init_src9();
11758
11567
  init_src8();
11759
11568
  init_src2();
11760
- init_assert8();
11569
+ init_assert7();
11761
11570
  init_resolve_url();
11762
11571
  init_get_typed_array();
11763
11572
  init_gltf_extensions();
@@ -11784,7 +11593,7 @@
11784
11593
  name: "glTF",
11785
11594
  id: "gltf",
11786
11595
  module: "gltf",
11787
- version: VERSION7,
11596
+ version: VERSION6,
11788
11597
  extensions: ["gltf", "glb"],
11789
11598
  mimeTypes: ["model/gltf+json", "model/gltf-binary"],
11790
11599
  text: true,
@@ -12130,7 +11939,7 @@
12130
11939
  });
12131
11940
 
12132
11941
  // src/lib/parsers/helpers/parse-3d-tile-subtree.ts
12133
- async function parse3DTilesSubtree(data) {
11942
+ async function parse3DTilesSubtree(data, options, context) {
12134
11943
  const magic = new Uint32Array(data.slice(0, 4));
12135
11944
  if (magic[0] !== SUBTREE_FILE_MAGIC) {
12136
11945
  throw new Error("Wrong subtree file magic number");
@@ -12150,22 +11959,39 @@
12150
11959
  internalBinaryBuffer = data.slice(24 + jsonByteLength);
12151
11960
  }
12152
11961
  if ("bufferView" in subtree.tileAvailability) {
12153
- subtree.tileAvailability.explicitBitstream = await getExplicitBitstream(subtree, "tileAvailability", internalBinaryBuffer);
11962
+ subtree.tileAvailability.explicitBitstream = await getExplicitBitstream(subtree, "tileAvailability", internalBinaryBuffer, context);
12154
11963
  }
12155
11964
  if ("bufferView" in subtree.contentAvailability) {
12156
- subtree.contentAvailability.explicitBitstream = await getExplicitBitstream(subtree, "contentAvailability", internalBinaryBuffer);
11965
+ subtree.contentAvailability.explicitBitstream = await getExplicitBitstream(subtree, "contentAvailability", internalBinaryBuffer, context);
12157
11966
  }
12158
11967
  if ("bufferView" in subtree.childSubtreeAvailability) {
12159
- subtree.childSubtreeAvailability.explicitBitstream = await getExplicitBitstream(subtree, "childSubtreeAvailability", internalBinaryBuffer);
11968
+ subtree.childSubtreeAvailability.explicitBitstream = await getExplicitBitstream(subtree, "childSubtreeAvailability", internalBinaryBuffer, context);
12160
11969
  }
12161
11970
  return subtree;
12162
11971
  }
12163
- async function getExplicitBitstream(subtree, name8, internalBinaryBuffer) {
12164
- const bufferViewIndex = subtree[name8].bufferView;
11972
+ function resolveBufferUri(bitstreamRelativeUri, basePath) {
11973
+ const hasProtocol = basePath.startsWith("http");
11974
+ if (hasProtocol) {
11975
+ const resolvedUri2 = new URL(bitstreamRelativeUri, basePath);
11976
+ return decodeURI(resolvedUri2.toString());
11977
+ }
11978
+ const basePathWithProtocol = `http://${basePath}`;
11979
+ const resolvedUri = new URL(bitstreamRelativeUri, basePathWithProtocol);
11980
+ return `/${resolvedUri.host}${resolvedUri.pathname}`;
11981
+ }
11982
+ async function getExplicitBitstream(subtree, name10, internalBinaryBuffer, context) {
11983
+ const bufferViewIndex = subtree[name10].bufferView;
12165
11984
  const bufferView = subtree.bufferViews[bufferViewIndex];
12166
11985
  const buffer = subtree.buffers[bufferView.buffer];
11986
+ if (!context?.url || !context.fetch) {
11987
+ throw new Error("Url is not provided");
11988
+ }
11989
+ if (!context.fetch) {
11990
+ throw new Error("fetch is not provided");
11991
+ }
12167
11992
  if (buffer.uri) {
12168
- const response = await fetchFile(buffer.uri);
11993
+ const bufferUri = resolveBufferUri(buffer.uri, context?.url);
11994
+ const response = await context.fetch(bufferUri);
12169
11995
  const data = await response.arrayBuffer();
12170
11996
  return new Uint8Array(data, bufferView.byteOffset, bufferView.byteLength);
12171
11997
  }
@@ -12180,7 +12006,6 @@
12180
12006
  var SUBTREE_FILE_MAGIC, SUBTREE_FILE_VERSION;
12181
12007
  var init_parse_3d_tile_subtree = __esm({
12182
12008
  "src/lib/parsers/helpers/parse-3d-tile-subtree.ts"() {
12183
- init_src3();
12184
12009
  SUBTREE_FILE_MAGIC = 1952609651;
12185
12010
  SUBTREE_FILE_VERSION = 1;
12186
12011
  }
@@ -12196,7 +12021,7 @@
12196
12021
  id: "3d-tiles-subtree",
12197
12022
  name: "3D Tiles Subtree",
12198
12023
  module: "3d-tiles",
12199
- version: VERSION5,
12024
+ version: VERSION4,
12200
12025
  extensions: ["subtree"],
12201
12026
  mimeTypes: ["application/octet-stream"],
12202
12027
  tests: ["subtree"],
@@ -12329,6 +12154,8 @@
12329
12154
  type: getTileType2(tile),
12330
12155
  lodMetricType,
12331
12156
  lodMetricValue,
12157
+ geometricError: lodMetricValue,
12158
+ transform: tile.transform,
12332
12159
  boundingVolume
12333
12160
  };
12334
12161
  }
@@ -12444,41 +12271,48 @@
12444
12271
  tile.refine = getRefine(tile.refine);
12445
12272
  return tile;
12446
12273
  }
12447
- function normalizeTileHeaders(tileset) {
12274
+ async function normalizeTileHeaders(tileset, options) {
12448
12275
  const basePath = tileset.basePath;
12449
- const root = normalizeTileData(tileset.root, tileset);
12276
+ let root;
12277
+ const rootImplicitTilingExtension = getImplicitTilingExtensionData(tileset?.root);
12278
+ if (rootImplicitTilingExtension && tileset.root) {
12279
+ root = await normalizeImplicitTileHeaders(tileset.root, tileset, rootImplicitTilingExtension, options);
12280
+ } else {
12281
+ root = normalizeTileData(tileset.root, tileset);
12282
+ }
12450
12283
  const stack2 = [];
12451
12284
  stack2.push(root);
12452
12285
  while (stack2.length > 0) {
12453
12286
  const tile = stack2.pop() || {};
12454
12287
  const children = tile.children || [];
12455
- for (const childHeader of children) {
12456
- normalizeTileData(childHeader, { basePath });
12288
+ for (let childHeader of children) {
12289
+ const childImplicitTilingExtension = getImplicitTilingExtensionData(childHeader);
12290
+ if (childImplicitTilingExtension) {
12291
+ childHeader = await normalizeImplicitTileHeaders(childHeader, tileset, childImplicitTilingExtension, options);
12292
+ } else {
12293
+ normalizeTileData(childHeader, { basePath });
12294
+ }
12457
12295
  stack2.push(childHeader);
12458
12296
  }
12459
12297
  }
12460
12298
  return root;
12461
12299
  }
12462
- async function normalizeImplicitTileHeaders(tileset) {
12463
- if (!tileset.root) {
12464
- return null;
12465
- }
12300
+ async function normalizeImplicitTileHeaders(tile, tileset, implicitTilingExtension, options) {
12466
12301
  const basePath = tileset.basePath;
12467
- const implicitTilingExtension = tileset.root.extensions["3DTILES_implicit_tiling"];
12468
12302
  const {
12469
12303
  subdivisionScheme,
12470
12304
  maximumLevel,
12471
12305
  subtreeLevels,
12472
12306
  subtrees: { uri: subtreesUriTemplate }
12473
12307
  } = implicitTilingExtension;
12474
- const subtreeUrl = replaceContentUrlTemplate(subtreesUriTemplate, 0, 0, 0, 0);
12475
- const rootSubtreeUrl = resolveUri(subtreeUrl, basePath);
12476
- const rootSubtree = await load(rootSubtreeUrl, Tile3DSubtreeLoader);
12477
- const contentUrlTemplate = resolveUri(tileset.root.content.uri, basePath);
12478
- const refine = tileset.root.refine;
12479
- const rootLodMetricValue = tileset.root.geometricError;
12480
- const rootBoundingVolume = tileset.root.boundingVolume;
12481
- const options = {
12308
+ const replacedUrlTemplate = replaceContentUrlTemplate(subtreesUriTemplate, 0, 0, 0, 0);
12309
+ const subtreeUrl = resolveUri(replacedUrlTemplate, basePath);
12310
+ const subtree = await load(subtreeUrl, Tile3DSubtreeLoader, options);
12311
+ const contentUrlTemplate = resolveUri(tile.content.uri, basePath);
12312
+ const refine = tileset?.root?.refine;
12313
+ const rootLodMetricValue = tile.geometricError;
12314
+ const rootBoundingVolume = tile.boundingVolume;
12315
+ const implicitOptions = {
12482
12316
  contentUrlTemplate,
12483
12317
  subtreesUriTemplate,
12484
12318
  subdivisionScheme,
@@ -12492,7 +12326,7 @@
12492
12326
  getTileType,
12493
12327
  getRefine
12494
12328
  };
12495
- return await normalizeImplicitTileData(tileset.root, rootSubtree, options);
12329
+ return await normalizeImplicitTileData(tile, subtree, implicitOptions);
12496
12330
  }
12497
12331
  async function normalizeImplicitTileData(tile, rootSubtree, options) {
12498
12332
  if (!tile) {
@@ -12512,6 +12346,9 @@
12512
12346
  tile.id = tile.contentUrl;
12513
12347
  return tile;
12514
12348
  }
12349
+ function getImplicitTilingExtensionData(tile) {
12350
+ return tile?.extensions?.["3DTILES_implicit_tiling"] || tile?.implicitTiling;
12351
+ }
12515
12352
  var init_parse_3d_tile_header2 = __esm({
12516
12353
  "src/lib/parsers/parse-3d-tile-header.ts"() {
12517
12354
  init_tile_3d_subtree_loader();
@@ -12540,7 +12377,7 @@
12540
12377
  tilesetJson.loader = options.loader || Tiles3DLoader;
12541
12378
  tilesetJson.url = context.url;
12542
12379
  tilesetJson.basePath = getBaseUri(tilesetJson);
12543
- tilesetJson.root = hasImplicitTilingExtension(tilesetJson) ? await normalizeImplicitTileHeaders(tilesetJson) : normalizeTileHeaders(tilesetJson);
12380
+ tilesetJson.root = await normalizeTileHeaders(tilesetJson, options);
12544
12381
  tilesetJson.type = TILESET_TYPE.TILES3D;
12545
12382
  tilesetJson.lodMetricType = LOD_METRIC_TYPE.GEOMETRIC_ERROR;
12546
12383
  tilesetJson.lodMetricValue = tilesetJson.root?.lodMetricValue || 0;
@@ -12561,10 +12398,7 @@
12561
12398
  }
12562
12399
  return data;
12563
12400
  }
12564
- function hasImplicitTilingExtension(tilesetJson) {
12565
- return tilesetJson?.extensionsRequired?.includes(IMPLICIT_TILING_EXTENSION_NAME) && tilesetJson?.extensionsUsed?.includes(IMPLICIT_TILING_EXTENSION_NAME);
12566
- }
12567
- var IMPLICIT_TILING_EXTENSION_NAME, Tiles3DLoader;
12401
+ var Tiles3DLoader;
12568
12402
  var init_tiles_3d_loader = __esm({
12569
12403
  "src/tiles-3d-loader.ts"() {
12570
12404
  init_src2();
@@ -12572,12 +12406,11 @@
12572
12406
  init_version2();
12573
12407
  init_parse_3d_tile();
12574
12408
  init_parse_3d_tile_header2();
12575
- IMPLICIT_TILING_EXTENSION_NAME = "3DTILES_implicit_tiling";
12576
12409
  Tiles3DLoader = {
12577
12410
  id: "3d-tiles",
12578
12411
  name: "3D Tiles",
12579
12412
  module: "3d-tiles",
12580
- version: VERSION5,
12413
+ version: VERSION4,
12581
12414
  extensions: ["cmpt", "pnts", "b3dm", "i3dm"],
12582
12415
  mimeTypes: ["application/octet-stream"],
12583
12416
  tests: ["cmpt", "pnts", "b3dm", "i3dm"],
@@ -12897,7 +12730,7 @@
12897
12730
  name: "3D Tile",
12898
12731
  id: "3d-tiles",
12899
12732
  module: "3d-tiles",
12900
- version: VERSION5,
12733
+ version: VERSION4,
12901
12734
  extensions: ["cmpt", "pnts", "b3dm", "i3dm"],
12902
12735
  mimeTypes: ["application/octet-stream"],
12903
12736
  encodeSync,
@@ -12936,10 +12769,10 @@
12936
12769
 
12937
12770
  // src/bundle.ts
12938
12771
  var require_bundle = __commonJS({
12939
- "src/bundle.ts"(exports, module2) {
12772
+ "src/bundle.ts"(exports, module) {
12940
12773
  var moduleExports = (init_src11(), src_exports);
12941
12774
  globalThis.loaders = globalThis.loaders || {};
12942
- module2.exports = Object.assign(globalThis.loaders, moduleExports);
12775
+ module.exports = Object.assign(globalThis.loaders, moduleExports);
12943
12776
  }
12944
12777
  });
12945
12778
  require_bundle();