@loaders.gl/3d-tiles 3.3.0-alpha.1 → 3.3.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.min.js +1103 -1457
- package/dist/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/cesium-ion-loader.js +7 -26
- package/dist/es5/cesium-ion-loader.js.map +1 -1
- package/dist/es5/index.js +14 -23
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/classes/helpers/tile-3d-accessor-utils.js +1 -5
- package/dist/es5/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
- package/dist/es5/lib/classes/tile-3d-batch-table-hierarchy.js +1 -40
- package/dist/es5/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
- package/dist/es5/lib/classes/tile-3d-batch-table.js +12 -59
- package/dist/es5/lib/classes/tile-3d-batch-table.js.map +1 -1
- package/dist/es5/lib/classes/tile-3d-feature-table.js +4 -23
- package/dist/es5/lib/classes/tile-3d-feature-table.js.map +1 -1
- package/dist/es5/lib/constants.js +3 -1
- package/dist/es5/lib/constants.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-batched-model.js +7 -16
- package/dist/es5/lib/encoders/encode-3d-tile-batched-model.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-composite.js +2 -11
- package/dist/es5/lib/encoders/encode-3d-tile-composite.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-instanced-model.js +10 -17
- package/dist/es5/lib/encoders/encode-3d-tile-instanced-model.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-point-cloud.js +8 -16
- package/dist/es5/lib/encoders/encode-3d-tile-point-cloud.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile.js +0 -12
- package/dist/es5/lib/encoders/encode-3d-tile.js.map +1 -1
- package/dist/es5/lib/encoders/helpers/encode-3d-tile-header.js +6 -9
- package/dist/es5/lib/encoders/helpers/encode-3d-tile-header.js.map +1 -1
- package/dist/es5/lib/ion/ion.js +5 -46
- package/dist/es5/lib/ion/ion.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js +2 -11
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-normals.js +0 -8
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-positions.js +0 -5
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js +19 -51
- package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js +6 -25
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-header.js +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-subtree.js +40 -49
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-subtree.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js +6 -14
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-utils.js +1 -3
- package/dist/es5/lib/parsers/helpers/parse-utils.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js +0 -16
- package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-composite.js +1 -11
- package/dist/es5/lib/parsers/parse-3d-tile-composite.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-gltf.js +0 -8
- package/dist/es5/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-header.js +127 -111
- package/dist/es5/lib/parsers/parse-3d-tile-header.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js +5 -41
- package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js +4 -71
- package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile.js +5 -28
- package/dist/es5/lib/parsers/parse-3d-tile.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/es5/lib/utils/version.js.map +1 -1
- package/dist/es5/tile-3d-subtree-loader.js +0 -4
- package/dist/es5/tile-3d-subtree-loader.js.map +1 -1
- package/dist/es5/tile-3d-writer.js +0 -6
- package/dist/es5/tile-3d-writer.js.map +1 -1
- package/dist/es5/tiles-3d-loader.js +5 -55
- package/dist/es5/tiles-3d-loader.js.map +1 -1
- package/dist/es5/types.js.map +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/cesium-ion-loader.js +9 -7
- package/dist/esm/cesium-ion-loader.js.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/classes/helpers/tile-3d-accessor-utils.js +1 -0
- package/dist/esm/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
- package/dist/esm/lib/classes/tile-3d-batch-table-hierarchy.js +3 -40
- package/dist/esm/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
- package/dist/esm/lib/classes/tile-3d-batch-table.js +7 -67
- package/dist/esm/lib/classes/tile-3d-batch-table.js.map +1 -1
- package/dist/esm/lib/classes/tile-3d-feature-table.js +5 -26
- package/dist/esm/lib/classes/tile-3d-feature-table.js.map +1 -1
- package/dist/esm/lib/constants.js +3 -0
- package/dist/esm/lib/constants.js.map +1 -1
- package/dist/esm/lib/encoders/encode-3d-tile-batched-model.js +5 -3
- package/dist/esm/lib/encoders/encode-3d-tile-batched-model.js.map +1 -1
- package/dist/esm/lib/encoders/encode-3d-tile-composite.js +2 -2
- package/dist/esm/lib/encoders/encode-3d-tile-composite.js.map +1 -1
- package/dist/esm/lib/encoders/encode-3d-tile-instanced-model.js +5 -1
- package/dist/esm/lib/encoders/encode-3d-tile-instanced-model.js.map +1 -1
- package/dist/esm/lib/encoders/encode-3d-tile-point-cloud.js +4 -1
- package/dist/esm/lib/encoders/encode-3d-tile-point-cloud.js.map +1 -1
- package/dist/esm/lib/encoders/encode-3d-tile.js +2 -6
- package/dist/esm/lib/encoders/encode-3d-tile.js.map +1 -1
- package/dist/esm/lib/encoders/helpers/encode-3d-tile-header.js +3 -3
- package/dist/esm/lib/encoders/helpers/encode-3d-tile-header.js.map +1 -1
- package/dist/esm/lib/ion/ion.js +10 -8
- package/dist/esm/lib/ion/ion.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/normalize-3d-tile-colors.js +1 -6
- package/dist/esm/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/normalize-3d-tile-normals.js +0 -4
- package/dist/esm/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/normalize-3d-tile-positions.js +1 -2
- package/dist/esm/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js +4 -16
- package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-gltf-view.js +6 -9
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-header.js +5 -2
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-subtree.js +26 -17
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-subtree.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-tables.js +4 -7
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-utils.js +6 -1
- package/dist/esm/lib/parsers/helpers/parse-utils.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-batched-model.js +3 -4
- package/dist/esm/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-composite.js +5 -1
- package/dist/esm/lib/parsers/parse-3d-tile-composite.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-header.js +35 -40
- package/dist/esm/lib/parsers/parse-3d-tile-header.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-instanced-model.js +7 -25
- package/dist/esm/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-point-cloud.js +9 -37
- package/dist/esm/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile.js +8 -6
- package/dist/esm/lib/parsers/parse-3d-tile.js.map +1 -1
- package/dist/esm/lib/utils/version.js +2 -1
- package/dist/esm/lib/utils/version.js.map +1 -1
- package/dist/esm/tile-3d-subtree-loader.js +1 -0
- package/dist/esm/tile-3d-subtree-loader.js.map +1 -1
- package/dist/esm/tile-3d-writer.js +1 -1
- package/dist/esm/tile-3d-writer.js.map +1 -1
- package/dist/esm/tiles-3d-loader.js +3 -17
- package/dist/esm/tiles-3d-loader.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/classes/helpers/tile-3d-accessor-utils.d.ts +1 -1
- package/dist/lib/classes/tile-3d-batch-table.d.ts +1 -1
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +2 -13
- package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts +2 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js +36 -7
- package/dist/lib/parsers/parse-3d-tile-batched-model.js +1 -1
- package/dist/lib/parsers/parse-3d-tile-header.d.ts +5 -4
- package/dist/lib/parsers/parse-3d-tile-header.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-header.js +37 -18
- package/dist/tiles-3d-loader.d.ts.map +1 -1
- package/dist/tiles-3d-loader.js +1 -8
- package/dist/types.d.ts +26 -13
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +1 -1
- package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +2 -14
- package/src/lib/parsers/helpers/parse-3d-tile-subtree.ts +50 -7
- package/src/lib/parsers/parse-3d-tile-header.ts +59 -21
- package/src/tiles-3d-loader.ts +2 -16
- 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
|
|
18
|
-
__defProp(target,
|
|
17
|
+
for (var name10 in all)
|
|
18
|
+
__defProp(target, name10, { get: all[name10], enumerable: true });
|
|
19
19
|
};
|
|
20
|
-
var __reExport = (target,
|
|
21
|
-
if (
|
|
22
|
-
for (let key of __getOwnPropNames(
|
|
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: () =>
|
|
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 = (
|
|
29
|
-
return __reExport(__markAsModule(__defProp(
|
|
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
|
|
@@ -145,11 +145,13 @@
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
|
|
148
|
-
// ../worker-utils/src/lib/node/worker_threads-browser.
|
|
148
|
+
// ../worker-utils/src/lib/node/worker_threads-browser.ts
|
|
149
149
|
var Worker2;
|
|
150
150
|
var init_worker_threads_browser = __esm({
|
|
151
|
-
"../worker-utils/src/lib/node/worker_threads-browser.
|
|
151
|
+
"../worker-utils/src/lib/node/worker_threads-browser.ts"() {
|
|
152
152
|
Worker2 = class {
|
|
153
|
+
terminate() {
|
|
154
|
+
}
|
|
153
155
|
};
|
|
154
156
|
}
|
|
155
157
|
});
|
|
@@ -252,9 +254,9 @@
|
|
|
252
254
|
constructor(props) {
|
|
253
255
|
this.terminated = false;
|
|
254
256
|
this._loadableURL = "";
|
|
255
|
-
const { name:
|
|
257
|
+
const { name: name10, source, url } = props;
|
|
256
258
|
assert3(source || url);
|
|
257
|
-
this.name =
|
|
259
|
+
this.name = name10;
|
|
258
260
|
this.source = source;
|
|
259
261
|
this.url = url;
|
|
260
262
|
this.onMessage = NOOP;
|
|
@@ -262,7 +264,7 @@
|
|
|
262
264
|
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
263
265
|
}
|
|
264
266
|
static isSupported() {
|
|
265
|
-
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !==
|
|
267
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== "undefined" && !isBrowser2;
|
|
266
268
|
}
|
|
267
269
|
destroy() {
|
|
268
270
|
this.onMessage = NOOP;
|
|
@@ -379,9 +381,9 @@
|
|
|
379
381
|
this.onDebug = props.onDebug;
|
|
380
382
|
}
|
|
381
383
|
}
|
|
382
|
-
async startJob(
|
|
384
|
+
async startJob(name10, onMessage2 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
|
|
383
385
|
const startPromise = new Promise((onStart) => {
|
|
384
|
-
this.jobQueue.push({ name:
|
|
386
|
+
this.jobQueue.push({ name: name10, onMessage: onMessage2, onError, onStart });
|
|
385
387
|
return this;
|
|
386
388
|
});
|
|
387
389
|
this._startQueuedJob();
|
|
@@ -432,8 +434,8 @@
|
|
|
432
434
|
}
|
|
433
435
|
if (this.count < this._getMaxConcurrency()) {
|
|
434
436
|
this.count++;
|
|
435
|
-
const
|
|
436
|
-
return new WorkerThread({ name:
|
|
437
|
+
const name10 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
|
|
438
|
+
return new WorkerThread({ name: name10, source: this.source, url: this.url });
|
|
437
439
|
}
|
|
438
440
|
return null;
|
|
439
441
|
}
|
|
@@ -485,16 +487,16 @@
|
|
|
485
487
|
}
|
|
486
488
|
}
|
|
487
489
|
getWorkerPool(options) {
|
|
488
|
-
const { name:
|
|
489
|
-
let workerPool = this.workerPools.get(
|
|
490
|
+
const { name: name10, source, url } = options;
|
|
491
|
+
let workerPool = this.workerPools.get(name10);
|
|
490
492
|
if (!workerPool) {
|
|
491
493
|
workerPool = new WorkerPool({
|
|
492
|
-
name:
|
|
494
|
+
name: name10,
|
|
493
495
|
source,
|
|
494
496
|
url
|
|
495
497
|
});
|
|
496
498
|
workerPool.setProps(this._getWorkerPoolProps());
|
|
497
|
-
this.workerPools.set(
|
|
499
|
+
this.workerPools.set(name10, workerPool);
|
|
498
500
|
}
|
|
499
501
|
return workerPool;
|
|
500
502
|
}
|
|
@@ -663,10 +665,10 @@
|
|
|
663
665
|
return loader.worker && options?.worker;
|
|
664
666
|
}
|
|
665
667
|
async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
|
|
666
|
-
const
|
|
668
|
+
const name10 = loader.id;
|
|
667
669
|
const url = getWorkerURL(loader, options);
|
|
668
670
|
const workerFarm = WorkerFarm.getWorkerFarm(options);
|
|
669
|
-
const workerPool = workerFarm.getWorkerPool({ name:
|
|
671
|
+
const workerPool = workerFarm.getWorkerPool({ name: name10, url });
|
|
670
672
|
options = JSON.parse(JSON.stringify(options));
|
|
671
673
|
context = JSON.parse(JSON.stringify(context || {}));
|
|
672
674
|
const job = await workerPool.startJob("process-on-worker", onMessage.bind(null, parseOnMainThread));
|
|
@@ -1024,11 +1026,8 @@
|
|
|
1024
1026
|
});
|
|
1025
1027
|
|
|
1026
1028
|
// ../../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
1029
|
function formatValue(value, {
|
|
1031
|
-
precision = config.precision
|
|
1030
|
+
precision = config.precision
|
|
1032
1031
|
} = {}) {
|
|
1033
1032
|
value = round(value);
|
|
1034
1033
|
return "".concat(parseFloat(value.toPrecision(precision)));
|
|
@@ -1036,19 +1035,6 @@
|
|
|
1036
1035
|
function isArray(value) {
|
|
1037
1036
|
return Array.isArray(value) || ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
1038
1037
|
}
|
|
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
1038
|
function toRadians(degrees2) {
|
|
1053
1039
|
return radians(degrees2);
|
|
1054
1040
|
}
|
|
@@ -1090,7 +1076,7 @@
|
|
|
1090
1076
|
if (b && b.equals) {
|
|
1091
1077
|
return b.equals(a2);
|
|
1092
1078
|
}
|
|
1093
|
-
if (
|
|
1079
|
+
if (typeof a2 === "number" && typeof b === "number") {
|
|
1094
1080
|
return Math.abs(a2 - b) <= config.EPSILON * Math.max(1, Math.abs(a2), Math.abs(b));
|
|
1095
1081
|
}
|
|
1096
1082
|
return false;
|
|
@@ -1098,18 +1084,36 @@
|
|
|
1098
1084
|
config.EPSILON = oldEpsilon;
|
|
1099
1085
|
}
|
|
1100
1086
|
}
|
|
1087
|
+
function round(value) {
|
|
1088
|
+
return Math.round(value / config.EPSILON) * config.EPSILON;
|
|
1089
|
+
}
|
|
1090
|
+
function duplicateArray(array) {
|
|
1091
|
+
return array.clone ? array.clone() : new Array(array.length);
|
|
1092
|
+
}
|
|
1093
|
+
function map(value, func, result) {
|
|
1094
|
+
if (isArray(value)) {
|
|
1095
|
+
const array = value;
|
|
1096
|
+
result = result || duplicateArray(array);
|
|
1097
|
+
for (let i2 = 0; i2 < result.length && i2 < array.length; ++i2) {
|
|
1098
|
+
result[i2] = func(value[i2], i2, result);
|
|
1099
|
+
}
|
|
1100
|
+
return result;
|
|
1101
|
+
}
|
|
1102
|
+
return func(value);
|
|
1103
|
+
}
|
|
1101
1104
|
var RADIANS_TO_DEGREES, DEGREES_TO_RADIANS, config;
|
|
1102
1105
|
var init_common = __esm({
|
|
1103
1106
|
"../../node_modules/@math.gl/core/dist/esm/lib/common.js"() {
|
|
1104
1107
|
RADIANS_TO_DEGREES = 1 / Math.PI * 180;
|
|
1105
1108
|
DEGREES_TO_RADIANS = 1 / 180 * Math.PI;
|
|
1106
|
-
config = {
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1109
|
+
config = {
|
|
1110
|
+
EPSILON: 1e-12,
|
|
1111
|
+
debug: false,
|
|
1112
|
+
precision: 4,
|
|
1113
|
+
printTypes: false,
|
|
1114
|
+
printDegrees: false,
|
|
1115
|
+
printRowMajor: true
|
|
1116
|
+
};
|
|
1113
1117
|
}
|
|
1114
1118
|
});
|
|
1115
1119
|
|
|
@@ -1139,24 +1143,25 @@
|
|
|
1139
1143
|
var init_math_array = __esm({
|
|
1140
1144
|
"../../node_modules/@math.gl/core/dist/esm/classes/base/math-array.js"() {
|
|
1141
1145
|
init_common();
|
|
1142
|
-
init_assert3();
|
|
1143
1146
|
MathArray = class extends _extendableBuiltin(Array) {
|
|
1144
|
-
get ELEMENTS() {
|
|
1145
|
-
assert4(false);
|
|
1146
|
-
return 0;
|
|
1147
|
-
}
|
|
1148
1147
|
clone() {
|
|
1149
1148
|
return new this.constructor().copy(this);
|
|
1150
1149
|
}
|
|
1151
|
-
from(arrayOrObject) {
|
|
1152
|
-
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
|
|
1153
|
-
}
|
|
1154
1150
|
fromArray(array, offset = 0) {
|
|
1155
1151
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
1156
1152
|
this[i2] = array[i2 + offset];
|
|
1157
1153
|
}
|
|
1158
1154
|
return this.check();
|
|
1159
1155
|
}
|
|
1156
|
+
toArray(targetArray = [], offset = 0) {
|
|
1157
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
1158
|
+
targetArray[offset + i2] = this[i2];
|
|
1159
|
+
}
|
|
1160
|
+
return targetArray;
|
|
1161
|
+
}
|
|
1162
|
+
from(arrayOrObject) {
|
|
1163
|
+
return Array.isArray(arrayOrObject) ? this.copy(arrayOrObject) : this.fromObject(arrayOrObject);
|
|
1164
|
+
}
|
|
1160
1165
|
to(arrayOrObject) {
|
|
1161
1166
|
if (arrayOrObject === this) {
|
|
1162
1167
|
return this;
|
|
@@ -1166,12 +1171,6 @@
|
|
|
1166
1171
|
toTarget(target) {
|
|
1167
1172
|
return target ? this.to(target) : this;
|
|
1168
1173
|
}
|
|
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
1174
|
toFloat32Array() {
|
|
1176
1175
|
return new Float32Array(this);
|
|
1177
1176
|
}
|
|
@@ -1215,9 +1214,7 @@
|
|
|
1215
1214
|
}
|
|
1216
1215
|
lerp(a2, b, t2) {
|
|
1217
1216
|
if (t2 === void 0) {
|
|
1218
|
-
|
|
1219
|
-
b = a2;
|
|
1220
|
-
a2 = this;
|
|
1217
|
+
return this.lerp(this, a2, b);
|
|
1221
1218
|
}
|
|
1222
1219
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
1223
1220
|
const ai = a2[i2];
|
|
@@ -1260,14 +1257,36 @@
|
|
|
1260
1257
|
return this.check();
|
|
1261
1258
|
}
|
|
1262
1259
|
scale(scale5) {
|
|
1263
|
-
if (
|
|
1264
|
-
|
|
1260
|
+
if (typeof scale5 === "number") {
|
|
1261
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
1262
|
+
this[i2] *= scale5;
|
|
1263
|
+
}
|
|
1264
|
+
} else {
|
|
1265
|
+
for (let i2 = 0; i2 < this.ELEMENTS && i2 < scale5.length; ++i2) {
|
|
1266
|
+
this[i2] *= scale5[i2];
|
|
1267
|
+
}
|
|
1265
1268
|
}
|
|
1269
|
+
return this.check();
|
|
1270
|
+
}
|
|
1271
|
+
multiplyByScalar(scalar) {
|
|
1266
1272
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
1267
|
-
this[i2] *=
|
|
1273
|
+
this[i2] *= scalar;
|
|
1268
1274
|
}
|
|
1269
1275
|
return this.check();
|
|
1270
1276
|
}
|
|
1277
|
+
check() {
|
|
1278
|
+
if (config.debug && !this.validate()) {
|
|
1279
|
+
throw new Error("math.gl: ".concat(this.constructor.name, " some fields set to invalid numbers'"));
|
|
1280
|
+
}
|
|
1281
|
+
return this;
|
|
1282
|
+
}
|
|
1283
|
+
validate() {
|
|
1284
|
+
let valid = this.length === this.ELEMENTS;
|
|
1285
|
+
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
1286
|
+
valid = valid && Number.isFinite(this[i2]);
|
|
1287
|
+
}
|
|
1288
|
+
return valid;
|
|
1289
|
+
}
|
|
1271
1290
|
sub(a2) {
|
|
1272
1291
|
return this.subtract(a2);
|
|
1273
1292
|
}
|
|
@@ -1293,7 +1312,7 @@
|
|
|
1293
1312
|
return this.check();
|
|
1294
1313
|
}
|
|
1295
1314
|
divideScalar(a2) {
|
|
1296
|
-
return this.
|
|
1315
|
+
return this.multiplyByScalar(1 / a2);
|
|
1297
1316
|
}
|
|
1298
1317
|
clampScalar(min, max) {
|
|
1299
1318
|
for (let i2 = 0; i2 < this.ELEMENTS; ++i2) {
|
|
@@ -1301,25 +1320,9 @@
|
|
|
1301
1320
|
}
|
|
1302
1321
|
return this.check();
|
|
1303
1322
|
}
|
|
1304
|
-
multiplyByScalar(scalar) {
|
|
1305
|
-
return this.scale(scalar);
|
|
1306
|
-
}
|
|
1307
1323
|
get elements() {
|
|
1308
1324
|
return this;
|
|
1309
1325
|
}
|
|
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
1326
|
};
|
|
1324
1327
|
}
|
|
1325
1328
|
});
|
|
@@ -1348,17 +1351,9 @@
|
|
|
1348
1351
|
}
|
|
1349
1352
|
return v;
|
|
1350
1353
|
}
|
|
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
1354
|
var init_validators = __esm({
|
|
1359
1355
|
"../../node_modules/@math.gl/core/dist/esm/lib/validators.js"() {
|
|
1360
1356
|
init_common();
|
|
1361
|
-
map2 = {};
|
|
1362
1357
|
}
|
|
1363
1358
|
});
|
|
1364
1359
|
|
|
@@ -1370,14 +1365,6 @@
|
|
|
1370
1365
|
init_validators();
|
|
1371
1366
|
init_assert3();
|
|
1372
1367
|
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
1368
|
get x() {
|
|
1382
1369
|
return this[0];
|
|
1383
1370
|
}
|
|
@@ -1594,6 +1581,15 @@
|
|
|
1594
1581
|
out[2] = a2[2];
|
|
1595
1582
|
return out;
|
|
1596
1583
|
}
|
|
1584
|
+
function vec4_transformMat2(out, a2, m) {
|
|
1585
|
+
const x = a2[0];
|
|
1586
|
+
const y = a2[1];
|
|
1587
|
+
out[0] = m[0] * x + m[2] * y;
|
|
1588
|
+
out[1] = m[1] * x + m[3] * y;
|
|
1589
|
+
out[2] = a2[2];
|
|
1590
|
+
out[3] = a2[3];
|
|
1591
|
+
return out;
|
|
1592
|
+
}
|
|
1597
1593
|
function vec4_transformMat3(out, a2, m) {
|
|
1598
1594
|
const x = a2[0];
|
|
1599
1595
|
const y = a2[1];
|
|
@@ -1851,7 +1847,7 @@
|
|
|
1851
1847
|
});
|
|
1852
1848
|
|
|
1853
1849
|
// ../../node_modules/@math.gl/core/dist/esm/classes/vector3.js
|
|
1854
|
-
var ORIGIN,
|
|
1850
|
+
var ORIGIN, ZERO, Vector3;
|
|
1855
1851
|
var init_vector3 = __esm({
|
|
1856
1852
|
"../../node_modules/@math.gl/core/dist/esm/classes/vector3.js"() {
|
|
1857
1853
|
init_vector();
|
|
@@ -1860,10 +1856,13 @@
|
|
|
1860
1856
|
init_vec3();
|
|
1861
1857
|
init_gl_matrix_extras();
|
|
1862
1858
|
ORIGIN = [0, 0, 0];
|
|
1863
|
-
constants = {};
|
|
1864
1859
|
Vector3 = class extends Vector {
|
|
1865
1860
|
static get ZERO() {
|
|
1866
|
-
|
|
1861
|
+
if (!ZERO) {
|
|
1862
|
+
ZERO = new Vector3(0, 0, 0);
|
|
1863
|
+
Object.freeze(ZERO);
|
|
1864
|
+
}
|
|
1865
|
+
return ZERO;
|
|
1867
1866
|
}
|
|
1868
1867
|
constructor(x = 0, y = 0, z = 0) {
|
|
1869
1868
|
super(-0, -0, -0);
|
|
@@ -1973,6 +1972,113 @@
|
|
|
1973
1972
|
}
|
|
1974
1973
|
});
|
|
1975
1974
|
|
|
1975
|
+
// ../../node_modules/@math.gl/core/dist/esm/classes/vector4.js
|
|
1976
|
+
var ZERO2, Vector4;
|
|
1977
|
+
var init_vector4 = __esm({
|
|
1978
|
+
"../../node_modules/@math.gl/core/dist/esm/classes/vector4.js"() {
|
|
1979
|
+
init_vector();
|
|
1980
|
+
init_common();
|
|
1981
|
+
init_validators();
|
|
1982
|
+
init_vec3();
|
|
1983
|
+
init_gl_matrix_extras();
|
|
1984
|
+
Vector4 = class extends Vector {
|
|
1985
|
+
static get ZERO() {
|
|
1986
|
+
if (!ZERO2) {
|
|
1987
|
+
ZERO2 = new Vector4(0, 0, 0, 0);
|
|
1988
|
+
Object.freeze(ZERO2);
|
|
1989
|
+
}
|
|
1990
|
+
return ZERO2;
|
|
1991
|
+
}
|
|
1992
|
+
constructor(x = 0, y = 0, z = 0, w = 0) {
|
|
1993
|
+
super(-0, -0, -0, -0);
|
|
1994
|
+
if (isArray(x) && arguments.length === 1) {
|
|
1995
|
+
this.copy(x);
|
|
1996
|
+
} else {
|
|
1997
|
+
if (config.debug) {
|
|
1998
|
+
checkNumber(x);
|
|
1999
|
+
checkNumber(y);
|
|
2000
|
+
checkNumber(z);
|
|
2001
|
+
checkNumber(w);
|
|
2002
|
+
}
|
|
2003
|
+
this[0] = x;
|
|
2004
|
+
this[1] = y;
|
|
2005
|
+
this[2] = z;
|
|
2006
|
+
this[3] = w;
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
set(x, y, z, w) {
|
|
2010
|
+
this[0] = x;
|
|
2011
|
+
this[1] = y;
|
|
2012
|
+
this[2] = z;
|
|
2013
|
+
this[3] = w;
|
|
2014
|
+
return this.check();
|
|
2015
|
+
}
|
|
2016
|
+
copy(array) {
|
|
2017
|
+
this[0] = array[0];
|
|
2018
|
+
this[1] = array[1];
|
|
2019
|
+
this[2] = array[2];
|
|
2020
|
+
this[3] = array[3];
|
|
2021
|
+
return this.check();
|
|
2022
|
+
}
|
|
2023
|
+
fromObject(object) {
|
|
2024
|
+
if (config.debug) {
|
|
2025
|
+
checkNumber(object.x);
|
|
2026
|
+
checkNumber(object.y);
|
|
2027
|
+
checkNumber(object.z);
|
|
2028
|
+
checkNumber(object.w);
|
|
2029
|
+
}
|
|
2030
|
+
this[0] = object.x;
|
|
2031
|
+
this[1] = object.y;
|
|
2032
|
+
this[2] = object.z;
|
|
2033
|
+
this[3] = object.w;
|
|
2034
|
+
return this;
|
|
2035
|
+
}
|
|
2036
|
+
toObject(object) {
|
|
2037
|
+
object.x = this[0];
|
|
2038
|
+
object.y = this[1];
|
|
2039
|
+
object.z = this[2];
|
|
2040
|
+
object.w = this[3];
|
|
2041
|
+
return object;
|
|
2042
|
+
}
|
|
2043
|
+
get ELEMENTS() {
|
|
2044
|
+
return 4;
|
|
2045
|
+
}
|
|
2046
|
+
get z() {
|
|
2047
|
+
return this[2];
|
|
2048
|
+
}
|
|
2049
|
+
set z(value) {
|
|
2050
|
+
this[2] = checkNumber(value);
|
|
2051
|
+
}
|
|
2052
|
+
get w() {
|
|
2053
|
+
return this[3];
|
|
2054
|
+
}
|
|
2055
|
+
set w(value) {
|
|
2056
|
+
this[3] = checkNumber(value);
|
|
2057
|
+
}
|
|
2058
|
+
transform(matrix4) {
|
|
2059
|
+
transformMat42(this, this, matrix4);
|
|
2060
|
+
return this.check();
|
|
2061
|
+
}
|
|
2062
|
+
transformByMatrix3(matrix3) {
|
|
2063
|
+
vec4_transformMat3(this, this, matrix3);
|
|
2064
|
+
return this.check();
|
|
2065
|
+
}
|
|
2066
|
+
transformByMatrix2(matrix2) {
|
|
2067
|
+
vec4_transformMat2(this, this, matrix2);
|
|
2068
|
+
return this.check();
|
|
2069
|
+
}
|
|
2070
|
+
transformByQuaternion(quaternion) {
|
|
2071
|
+
transformQuat(this, this, quaternion);
|
|
2072
|
+
return this.check();
|
|
2073
|
+
}
|
|
2074
|
+
applyMatrix4(m) {
|
|
2075
|
+
m.transform(this, this);
|
|
2076
|
+
return this;
|
|
2077
|
+
}
|
|
2078
|
+
};
|
|
2079
|
+
}
|
|
2080
|
+
});
|
|
2081
|
+
|
|
1976
2082
|
// ../../node_modules/@math.gl/core/dist/esm/classes/base/matrix.js
|
|
1977
2083
|
var Matrix;
|
|
1978
2084
|
var init_matrix = __esm({
|
|
@@ -1980,16 +2086,7 @@
|
|
|
1980
2086
|
init_math_array();
|
|
1981
2087
|
init_validators();
|
|
1982
2088
|
init_common();
|
|
1983
|
-
init_assert3();
|
|
1984
2089
|
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
2090
|
toString() {
|
|
1994
2091
|
let string = "[";
|
|
1995
2092
|
if (config.printRowMajor) {
|
|
@@ -2192,7 +2289,21 @@
|
|
|
2192
2289
|
});
|
|
2193
2290
|
|
|
2194
2291
|
// ../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js
|
|
2195
|
-
|
|
2292
|
+
function getZeroMatrix() {
|
|
2293
|
+
if (!ZERO_MATRIX3) {
|
|
2294
|
+
ZERO_MATRIX3 = new Matrix3([0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
2295
|
+
Object.freeze(ZERO_MATRIX3);
|
|
2296
|
+
}
|
|
2297
|
+
return ZERO_MATRIX3;
|
|
2298
|
+
}
|
|
2299
|
+
function getIdentityMatrix() {
|
|
2300
|
+
if (!IDENTITY_MATRIX3) {
|
|
2301
|
+
IDENTITY_MATRIX3 = new Matrix3();
|
|
2302
|
+
Object.freeze(IDENTITY_MATRIX3);
|
|
2303
|
+
}
|
|
2304
|
+
return IDENTITY_MATRIX3;
|
|
2305
|
+
}
|
|
2306
|
+
var INDICES, IDENTITY_MATRIX, Matrix3, ZERO_MATRIX3, IDENTITY_MATRIX3;
|
|
2196
2307
|
var init_matrix3 = __esm({
|
|
2197
2308
|
"../../node_modules/@math.gl/core/dist/esm/classes/matrix3.js"() {
|
|
2198
2309
|
init_matrix();
|
|
@@ -2201,28 +2312,24 @@
|
|
|
2201
2312
|
init_mat3();
|
|
2202
2313
|
init_vec2();
|
|
2203
2314
|
init_vec3();
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
});
|
|
2217
|
-
constants2 = {};
|
|
2315
|
+
(function(INDICES3) {
|
|
2316
|
+
INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
|
|
2317
|
+
INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
|
|
2318
|
+
INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
|
|
2319
|
+
INDICES3[INDICES3["COL1ROW0"] = 3] = "COL1ROW0";
|
|
2320
|
+
INDICES3[INDICES3["COL1ROW1"] = 4] = "COL1ROW1";
|
|
2321
|
+
INDICES3[INDICES3["COL1ROW2"] = 5] = "COL1ROW2";
|
|
2322
|
+
INDICES3[INDICES3["COL2ROW0"] = 6] = "COL2ROW0";
|
|
2323
|
+
INDICES3[INDICES3["COL2ROW1"] = 7] = "COL2ROW1";
|
|
2324
|
+
INDICES3[INDICES3["COL2ROW2"] = 8] = "COL2ROW2";
|
|
2325
|
+
})(INDICES || (INDICES = {}));
|
|
2326
|
+
IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 1, 0, 0, 0, 1]);
|
|
2218
2327
|
Matrix3 = class extends Matrix {
|
|
2219
2328
|
static get IDENTITY() {
|
|
2220
|
-
|
|
2221
|
-
return constants2.IDENTITY;
|
|
2329
|
+
return getIdentityMatrix();
|
|
2222
2330
|
}
|
|
2223
2331
|
static get ZERO() {
|
|
2224
|
-
|
|
2225
|
-
return constants2.ZERO;
|
|
2332
|
+
return getZeroMatrix();
|
|
2226
2333
|
}
|
|
2227
2334
|
get ELEMENTS() {
|
|
2228
2335
|
return 9;
|
|
@@ -2233,10 +2340,12 @@
|
|
|
2233
2340
|
get INDICES() {
|
|
2234
2341
|
return INDICES;
|
|
2235
2342
|
}
|
|
2236
|
-
constructor(array) {
|
|
2343
|
+
constructor(array, ...args) {
|
|
2237
2344
|
super(-0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
2238
2345
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
2239
2346
|
this.copy(array);
|
|
2347
|
+
} else if (args.length > 0) {
|
|
2348
|
+
this.copy([array, ...args]);
|
|
2240
2349
|
} else {
|
|
2241
2350
|
this.identity();
|
|
2242
2351
|
}
|
|
@@ -2253,6 +2362,16 @@
|
|
|
2253
2362
|
this[8] = array[8];
|
|
2254
2363
|
return this.check();
|
|
2255
2364
|
}
|
|
2365
|
+
identity() {
|
|
2366
|
+
return this.copy(IDENTITY_MATRIX);
|
|
2367
|
+
}
|
|
2368
|
+
fromObject(object) {
|
|
2369
|
+
return this.check();
|
|
2370
|
+
}
|
|
2371
|
+
fromQuaternion(q) {
|
|
2372
|
+
fromQuat(this, q);
|
|
2373
|
+
return this.check();
|
|
2374
|
+
}
|
|
2256
2375
|
set(m00, m10, m20, m01, m11, m21, m02, m12, m22) {
|
|
2257
2376
|
this[0] = m00;
|
|
2258
2377
|
this[1] = m10;
|
|
@@ -2280,13 +2399,6 @@
|
|
|
2280
2399
|
determinant() {
|
|
2281
2400
|
return determinant(this);
|
|
2282
2401
|
}
|
|
2283
|
-
identity() {
|
|
2284
|
-
return this.copy(IDENTITY);
|
|
2285
|
-
}
|
|
2286
|
-
fromQuaternion(q) {
|
|
2287
|
-
fromQuat(this, q);
|
|
2288
|
-
return this.check();
|
|
2289
|
-
}
|
|
2290
2402
|
transpose() {
|
|
2291
2403
|
transpose(this, this);
|
|
2292
2404
|
return this.check();
|
|
@@ -2311,7 +2423,7 @@
|
|
|
2311
2423
|
if (Array.isArray(factor)) {
|
|
2312
2424
|
scale(this, this, factor);
|
|
2313
2425
|
} else {
|
|
2314
|
-
scale(this, this, [factor, factor
|
|
2426
|
+
scale(this, this, [factor, factor]);
|
|
2315
2427
|
}
|
|
2316
2428
|
return this.check();
|
|
2317
2429
|
}
|
|
@@ -2320,32 +2432,30 @@
|
|
|
2320
2432
|
return this.check();
|
|
2321
2433
|
}
|
|
2322
2434
|
transform(vector, result) {
|
|
2435
|
+
let out;
|
|
2323
2436
|
switch (vector.length) {
|
|
2324
2437
|
case 2:
|
|
2325
|
-
|
|
2438
|
+
out = transformMat3(result || [-0, -0], vector, this);
|
|
2326
2439
|
break;
|
|
2327
2440
|
case 3:
|
|
2328
|
-
|
|
2441
|
+
out = transformMat32(result || [-0, -0, -0], vector, this);
|
|
2329
2442
|
break;
|
|
2330
2443
|
case 4:
|
|
2331
|
-
|
|
2444
|
+
out = vec4_transformMat3(result || [-0, -0, -0, -0], vector, this);
|
|
2332
2445
|
break;
|
|
2333
2446
|
default:
|
|
2334
2447
|
throw new Error("Illegal vector");
|
|
2335
2448
|
}
|
|
2336
|
-
checkVector(
|
|
2337
|
-
return
|
|
2449
|
+
checkVector(out, vector.length);
|
|
2450
|
+
return out;
|
|
2338
2451
|
}
|
|
2339
2452
|
transformVector(vector, result) {
|
|
2340
|
-
deprecated("Matrix3.transformVector");
|
|
2341
2453
|
return this.transform(vector, result);
|
|
2342
2454
|
}
|
|
2343
2455
|
transformVector2(vector, result) {
|
|
2344
|
-
deprecated("Matrix3.transformVector");
|
|
2345
2456
|
return this.transform(vector, result);
|
|
2346
2457
|
}
|
|
2347
2458
|
transformVector3(vector, result) {
|
|
2348
|
-
deprecated("Matrix3.transformVector");
|
|
2349
2459
|
return this.transform(vector, result);
|
|
2350
2460
|
}
|
|
2351
2461
|
};
|
|
@@ -2774,7 +2884,7 @@
|
|
|
2774
2884
|
out[15] = 0;
|
|
2775
2885
|
return out;
|
|
2776
2886
|
}
|
|
2777
|
-
function
|
|
2887
|
+
function perspectiveNO(out, fovy, aspect, near, far) {
|
|
2778
2888
|
var f2 = 1 / Math.tan(fovy / 2), nf;
|
|
2779
2889
|
out[0] = f2 / aspect;
|
|
2780
2890
|
out[1] = 0;
|
|
@@ -2800,7 +2910,7 @@
|
|
|
2800
2910
|
}
|
|
2801
2911
|
return out;
|
|
2802
2912
|
}
|
|
2803
|
-
function
|
|
2913
|
+
function orthoNO(out, left, right, bottom, top, near, far) {
|
|
2804
2914
|
var lr = 1 / (left - right);
|
|
2805
2915
|
var bt = 1 / (bottom - top);
|
|
2806
2916
|
var nf = 1 / (near - far);
|
|
@@ -2889,9 +2999,12 @@
|
|
|
2889
2999
|
out[15] = 1;
|
|
2890
3000
|
return out;
|
|
2891
3001
|
}
|
|
3002
|
+
var perspective, ortho;
|
|
2892
3003
|
var init_mat4 = __esm({
|
|
2893
3004
|
"../../node_modules/gl-matrix/esm/mat4.js"() {
|
|
2894
3005
|
init_common2();
|
|
3006
|
+
perspective = perspectiveNO;
|
|
3007
|
+
ortho = orthoNO;
|
|
2895
3008
|
}
|
|
2896
3009
|
});
|
|
2897
3010
|
|
|
@@ -3021,48 +3134,90 @@
|
|
|
3021
3134
|
});
|
|
3022
3135
|
|
|
3023
3136
|
// ../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js
|
|
3024
|
-
|
|
3137
|
+
function getZeroMatrix2() {
|
|
3138
|
+
if (!ZERO3) {
|
|
3139
|
+
ZERO3 = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
|
3140
|
+
Object.freeze(ZERO3);
|
|
3141
|
+
}
|
|
3142
|
+
return ZERO3;
|
|
3143
|
+
}
|
|
3144
|
+
function getIdentityMatrix2() {
|
|
3145
|
+
if (!IDENTITY) {
|
|
3146
|
+
IDENTITY = new Matrix4();
|
|
3147
|
+
Object.freeze(IDENTITY);
|
|
3148
|
+
}
|
|
3149
|
+
return IDENTITY;
|
|
3150
|
+
}
|
|
3151
|
+
function checkRadians(possiblyDegrees) {
|
|
3152
|
+
if (possiblyDegrees > Math.PI * 2) {
|
|
3153
|
+
throw Error("expected radians");
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
function computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, near) {
|
|
3157
|
+
const column0Row0 = 2 * near / (right - left);
|
|
3158
|
+
const column1Row1 = 2 * near / (top - bottom);
|
|
3159
|
+
const column2Row0 = (right + left) / (right - left);
|
|
3160
|
+
const column2Row1 = (top + bottom) / (top - bottom);
|
|
3161
|
+
const column2Row2 = -1;
|
|
3162
|
+
const column2Row3 = -1;
|
|
3163
|
+
const column3Row2 = -2 * near;
|
|
3164
|
+
result[0] = column0Row0;
|
|
3165
|
+
result[1] = 0;
|
|
3166
|
+
result[2] = 0;
|
|
3167
|
+
result[3] = 0;
|
|
3168
|
+
result[4] = 0;
|
|
3169
|
+
result[5] = column1Row1;
|
|
3170
|
+
result[6] = 0;
|
|
3171
|
+
result[7] = 0;
|
|
3172
|
+
result[8] = column2Row0;
|
|
3173
|
+
result[9] = column2Row1;
|
|
3174
|
+
result[10] = column2Row2;
|
|
3175
|
+
result[11] = column2Row3;
|
|
3176
|
+
result[12] = 0;
|
|
3177
|
+
result[13] = 0;
|
|
3178
|
+
result[14] = column3Row2;
|
|
3179
|
+
result[15] = 0;
|
|
3180
|
+
return result;
|
|
3181
|
+
}
|
|
3182
|
+
var INDICES2, DEFAULT_FOVY, DEFAULT_ASPECT, DEFAULT_NEAR, DEFAULT_FAR, IDENTITY_MATRIX2, Matrix4, ZERO3, IDENTITY;
|
|
3025
3183
|
var init_matrix4 = __esm({
|
|
3026
3184
|
"../../node_modules/@math.gl/core/dist/esm/classes/matrix4.js"() {
|
|
3027
|
-
init_validators();
|
|
3028
3185
|
init_matrix();
|
|
3186
|
+
init_validators();
|
|
3029
3187
|
init_gl_matrix_extras();
|
|
3030
3188
|
init_mat4();
|
|
3031
3189
|
init_vec2();
|
|
3032
3190
|
init_vec3();
|
|
3033
3191
|
init_vec4();
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3192
|
+
(function(INDICES3) {
|
|
3193
|
+
INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
|
|
3194
|
+
INDICES3[INDICES3["COL0ROW1"] = 1] = "COL0ROW1";
|
|
3195
|
+
INDICES3[INDICES3["COL0ROW2"] = 2] = "COL0ROW2";
|
|
3196
|
+
INDICES3[INDICES3["COL0ROW3"] = 3] = "COL0ROW3";
|
|
3197
|
+
INDICES3[INDICES3["COL1ROW0"] = 4] = "COL1ROW0";
|
|
3198
|
+
INDICES3[INDICES3["COL1ROW1"] = 5] = "COL1ROW1";
|
|
3199
|
+
INDICES3[INDICES3["COL1ROW2"] = 6] = "COL1ROW2";
|
|
3200
|
+
INDICES3[INDICES3["COL1ROW3"] = 7] = "COL1ROW3";
|
|
3201
|
+
INDICES3[INDICES3["COL2ROW0"] = 8] = "COL2ROW0";
|
|
3202
|
+
INDICES3[INDICES3["COL2ROW1"] = 9] = "COL2ROW1";
|
|
3203
|
+
INDICES3[INDICES3["COL2ROW2"] = 10] = "COL2ROW2";
|
|
3204
|
+
INDICES3[INDICES3["COL2ROW3"] = 11] = "COL2ROW3";
|
|
3205
|
+
INDICES3[INDICES3["COL3ROW0"] = 12] = "COL3ROW0";
|
|
3206
|
+
INDICES3[INDICES3["COL3ROW1"] = 13] = "COL3ROW1";
|
|
3207
|
+
INDICES3[INDICES3["COL3ROW2"] = 14] = "COL3ROW2";
|
|
3208
|
+
INDICES3[INDICES3["COL3ROW3"] = 15] = "COL3ROW3";
|
|
3209
|
+
})(INDICES2 || (INDICES2 = {}));
|
|
3210
|
+
DEFAULT_FOVY = 45 * Math.PI / 180;
|
|
3211
|
+
DEFAULT_ASPECT = 1;
|
|
3212
|
+
DEFAULT_NEAR = 0.1;
|
|
3213
|
+
DEFAULT_FAR = 500;
|
|
3214
|
+
IDENTITY_MATRIX2 = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
3055
3215
|
Matrix4 = class extends Matrix {
|
|
3056
3216
|
static get IDENTITY() {
|
|
3057
|
-
|
|
3058
|
-
return constants3.IDENTITY;
|
|
3217
|
+
return getIdentityMatrix2();
|
|
3059
3218
|
}
|
|
3060
3219
|
static get ZERO() {
|
|
3061
|
-
|
|
3062
|
-
return constants3.ZERO;
|
|
3063
|
-
}
|
|
3064
|
-
get INDICES() {
|
|
3065
|
-
return INDICES2;
|
|
3220
|
+
return getZeroMatrix2();
|
|
3066
3221
|
}
|
|
3067
3222
|
get ELEMENTS() {
|
|
3068
3223
|
return 16;
|
|
@@ -3070,6 +3225,9 @@
|
|
|
3070
3225
|
get RANK() {
|
|
3071
3226
|
return 4;
|
|
3072
3227
|
}
|
|
3228
|
+
get INDICES() {
|
|
3229
|
+
return INDICES2;
|
|
3230
|
+
}
|
|
3073
3231
|
constructor(array) {
|
|
3074
3232
|
super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);
|
|
3075
3233
|
if (arguments.length === 1 && Array.isArray(array)) {
|
|
@@ -3155,91 +3313,65 @@
|
|
|
3155
3313
|
return result;
|
|
3156
3314
|
}
|
|
3157
3315
|
identity() {
|
|
3158
|
-
return this.copy(
|
|
3316
|
+
return this.copy(IDENTITY_MATRIX2);
|
|
3159
3317
|
}
|
|
3160
|
-
|
|
3161
|
-
fromQuat2(this, q);
|
|
3318
|
+
fromObject(object) {
|
|
3162
3319
|
return this.check();
|
|
3163
3320
|
}
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3321
|
+
fromQuaternion(quaternion) {
|
|
3322
|
+
fromQuat2(this, quaternion);
|
|
3323
|
+
return this.check();
|
|
3324
|
+
}
|
|
3325
|
+
frustum(view) {
|
|
3326
|
+
const {
|
|
3327
|
+
left,
|
|
3328
|
+
right,
|
|
3329
|
+
bottom,
|
|
3330
|
+
top,
|
|
3331
|
+
near = DEFAULT_NEAR,
|
|
3332
|
+
far = DEFAULT_FAR
|
|
3333
|
+
} = view;
|
|
3172
3334
|
if (far === Infinity) {
|
|
3173
|
-
|
|
3335
|
+
computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);
|
|
3174
3336
|
} else {
|
|
3175
3337
|
frustum(this, left, right, bottom, top, near, far);
|
|
3176
3338
|
}
|
|
3177
3339
|
return this.check();
|
|
3178
3340
|
}
|
|
3179
|
-
|
|
3180
|
-
const
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
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];
|
|
3341
|
+
lookAt(view) {
|
|
3342
|
+
const {
|
|
3343
|
+
eye,
|
|
3344
|
+
center = [0, 0, 0],
|
|
3345
|
+
up = [0, 1, 0]
|
|
3346
|
+
} = view;
|
|
3215
3347
|
lookAt(this, eye, center, up);
|
|
3216
3348
|
return this.check();
|
|
3217
3349
|
}
|
|
3218
|
-
ortho({
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3350
|
+
ortho(view) {
|
|
3351
|
+
const {
|
|
3352
|
+
left,
|
|
3353
|
+
right,
|
|
3354
|
+
bottom,
|
|
3355
|
+
top,
|
|
3356
|
+
near = DEFAULT_NEAR,
|
|
3357
|
+
far = DEFAULT_FAR
|
|
3358
|
+
} = view;
|
|
3226
3359
|
ortho(this, left, right, bottom, top, near, far);
|
|
3227
3360
|
return this.check();
|
|
3228
3361
|
}
|
|
3229
|
-
orthographic({
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
}
|
|
3362
|
+
orthographic(view) {
|
|
3363
|
+
const {
|
|
3364
|
+
fovy = DEFAULT_FOVY,
|
|
3365
|
+
aspect = DEFAULT_ASPECT,
|
|
3366
|
+
focalDistance = 1,
|
|
3367
|
+
near = DEFAULT_NEAR,
|
|
3368
|
+
far = DEFAULT_FAR
|
|
3369
|
+
} = view;
|
|
3370
|
+
checkRadians(fovy);
|
|
3239
3371
|
const halfY = fovy / 2;
|
|
3240
3372
|
const top = focalDistance * Math.tan(halfY);
|
|
3241
3373
|
const right = top * aspect;
|
|
3242
|
-
return
|
|
3374
|
+
return this.ortho({
|
|
3243
3375
|
left: -right,
|
|
3244
3376
|
right,
|
|
3245
3377
|
bottom: -top,
|
|
@@ -3248,17 +3380,14 @@
|
|
|
3248
3380
|
far
|
|
3249
3381
|
});
|
|
3250
3382
|
}
|
|
3251
|
-
perspective({
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
fovy
|
|
3259
|
-
if (fovy > Math.PI * 2) {
|
|
3260
|
-
throw Error("radians");
|
|
3261
|
-
}
|
|
3383
|
+
perspective(view) {
|
|
3384
|
+
const {
|
|
3385
|
+
fovy = 45 * Math.PI / 180,
|
|
3386
|
+
aspect = 1,
|
|
3387
|
+
near = 0.1,
|
|
3388
|
+
far = 500
|
|
3389
|
+
} = view;
|
|
3390
|
+
checkRadians(fovy);
|
|
3262
3391
|
perspective(this, fovy, aspect, near, far);
|
|
3263
3392
|
return this.check();
|
|
3264
3393
|
}
|
|
@@ -3277,8 +3406,10 @@
|
|
|
3277
3406
|
result[2] = this[14];
|
|
3278
3407
|
return result;
|
|
3279
3408
|
}
|
|
3280
|
-
getRotation(result
|
|
3281
|
-
|
|
3409
|
+
getRotation(result, scaleResult) {
|
|
3410
|
+
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
3411
|
+
scaleResult = scaleResult || [-0, -0, -0];
|
|
3412
|
+
const scale5 = this.getScale(scaleResult);
|
|
3282
3413
|
const inverseScale0 = 1 / scale5[0];
|
|
3283
3414
|
const inverseScale1 = 1 / scale5[1];
|
|
3284
3415
|
const inverseScale2 = 1 / scale5[2];
|
|
@@ -3300,8 +3431,10 @@
|
|
|
3300
3431
|
result[15] = 1;
|
|
3301
3432
|
return result;
|
|
3302
3433
|
}
|
|
3303
|
-
getRotationMatrix3(result
|
|
3304
|
-
|
|
3434
|
+
getRotationMatrix3(result, scaleResult) {
|
|
3435
|
+
result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];
|
|
3436
|
+
scaleResult = scaleResult || [-0, -0, -0];
|
|
3437
|
+
const scale5 = this.getScale(scaleResult);
|
|
3305
3438
|
const inverseScale0 = 1 / scale5[0];
|
|
3306
3439
|
const inverseScale1 = 1 / scale5[1];
|
|
3307
3440
|
const inverseScale2 = 1 / scale5[2];
|
|
@@ -3344,23 +3477,19 @@
|
|
|
3344
3477
|
rotateZ2(this, this, radians2);
|
|
3345
3478
|
return this.check();
|
|
3346
3479
|
}
|
|
3347
|
-
rotateXYZ(
|
|
3348
|
-
return this.rotateX(
|
|
3480
|
+
rotateXYZ(angleXYZ) {
|
|
3481
|
+
return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);
|
|
3349
3482
|
}
|
|
3350
3483
|
rotateAxis(radians2, axis) {
|
|
3351
3484
|
rotate2(this, this, radians2, axis);
|
|
3352
3485
|
return this.check();
|
|
3353
3486
|
}
|
|
3354
3487
|
scale(factor) {
|
|
3355
|
-
|
|
3356
|
-
scale2(this, this, factor);
|
|
3357
|
-
} else {
|
|
3358
|
-
scale2(this, this, [factor, factor, factor]);
|
|
3359
|
-
}
|
|
3488
|
+
scale2(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);
|
|
3360
3489
|
return this.check();
|
|
3361
3490
|
}
|
|
3362
|
-
translate(
|
|
3363
|
-
translate2(this, this,
|
|
3491
|
+
translate(vector) {
|
|
3492
|
+
translate2(this, this, vector);
|
|
3364
3493
|
return this.check();
|
|
3365
3494
|
}
|
|
3366
3495
|
transform(vector, result) {
|
|
@@ -3375,51 +3504,50 @@
|
|
|
3375
3504
|
const {
|
|
3376
3505
|
length: length4
|
|
3377
3506
|
} = vector;
|
|
3507
|
+
let out;
|
|
3378
3508
|
switch (length4) {
|
|
3379
3509
|
case 2:
|
|
3380
|
-
|
|
3510
|
+
out = transformMat4(result || [-0, -0], vector, this);
|
|
3381
3511
|
break;
|
|
3382
3512
|
case 3:
|
|
3383
|
-
|
|
3513
|
+
out = transformMat42(result || [-0, -0, -0], vector, this);
|
|
3384
3514
|
break;
|
|
3385
3515
|
default:
|
|
3386
3516
|
throw new Error("Illegal vector");
|
|
3387
3517
|
}
|
|
3388
|
-
checkVector(
|
|
3389
|
-
return
|
|
3518
|
+
checkVector(out, vector.length);
|
|
3519
|
+
return out;
|
|
3390
3520
|
}
|
|
3391
3521
|
transformAsVector(vector, result) {
|
|
3522
|
+
let out;
|
|
3392
3523
|
switch (vector.length) {
|
|
3393
3524
|
case 2:
|
|
3394
|
-
|
|
3525
|
+
out = vec2_transformMat4AsVector(result || [-0, -0], vector, this);
|
|
3395
3526
|
break;
|
|
3396
3527
|
case 3:
|
|
3397
|
-
|
|
3528
|
+
out = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);
|
|
3398
3529
|
break;
|
|
3399
3530
|
default:
|
|
3400
3531
|
throw new Error("Illegal vector");
|
|
3401
3532
|
}
|
|
3402
|
-
checkVector(
|
|
3403
|
-
return
|
|
3404
|
-
}
|
|
3405
|
-
makeRotationX(radians2) {
|
|
3406
|
-
return this.identity().rotateX(radians2);
|
|
3407
|
-
}
|
|
3408
|
-
makeTranslation(x, y, z) {
|
|
3409
|
-
return this.identity().translate([x, y, z]);
|
|
3533
|
+
checkVector(out, vector.length);
|
|
3534
|
+
return out;
|
|
3410
3535
|
}
|
|
3411
3536
|
transformPoint(vector, result) {
|
|
3412
|
-
deprecated("Matrix4.transformPoint", "3.0");
|
|
3413
3537
|
return this.transformAsPoint(vector, result);
|
|
3414
3538
|
}
|
|
3415
3539
|
transformVector(vector, result) {
|
|
3416
|
-
deprecated("Matrix4.transformVector", "3.0");
|
|
3417
3540
|
return this.transformAsPoint(vector, result);
|
|
3418
3541
|
}
|
|
3419
3542
|
transformDirection(vector, result) {
|
|
3420
|
-
deprecated("Matrix4.transformDirection", "3.0");
|
|
3421
3543
|
return this.transformAsVector(vector, result);
|
|
3422
3544
|
}
|
|
3545
|
+
makeRotationX(radians2) {
|
|
3546
|
+
return this.identity().rotateX(radians2);
|
|
3547
|
+
}
|
|
3548
|
+
makeTranslation(x, y, z) {
|
|
3549
|
+
return this.identity().translate([x, y, z]);
|
|
3550
|
+
}
|
|
3423
3551
|
};
|
|
3424
3552
|
}
|
|
3425
3553
|
});
|
|
@@ -3646,7 +3774,7 @@
|
|
|
3646
3774
|
"../../node_modules/@math.gl/core/dist/esm/classes/quaternion.js"() {
|
|
3647
3775
|
init_math_array();
|
|
3648
3776
|
init_validators();
|
|
3649
|
-
|
|
3777
|
+
init_vector4();
|
|
3650
3778
|
init_quat();
|
|
3651
3779
|
init_vec4();
|
|
3652
3780
|
IDENTITY_QUATERNION = [0, 0, 0, 1];
|
|
@@ -3673,18 +3801,25 @@
|
|
|
3673
3801
|
this[3] = w;
|
|
3674
3802
|
return this.check();
|
|
3675
3803
|
}
|
|
3676
|
-
|
|
3677
|
-
|
|
3804
|
+
fromObject(object) {
|
|
3805
|
+
this[0] = object.x;
|
|
3806
|
+
this[1] = object.y;
|
|
3807
|
+
this[2] = object.z;
|
|
3808
|
+
this[3] = object.w;
|
|
3678
3809
|
return this.check();
|
|
3679
3810
|
}
|
|
3680
|
-
|
|
3681
|
-
|
|
3811
|
+
fromMatrix3(m) {
|
|
3812
|
+
fromMat3(this, m);
|
|
3682
3813
|
return this.check();
|
|
3683
3814
|
}
|
|
3684
3815
|
fromAxisRotation(axis, rad) {
|
|
3685
3816
|
setAxisAngle(this, axis, rad);
|
|
3686
3817
|
return this.check();
|
|
3687
3818
|
}
|
|
3819
|
+
identity() {
|
|
3820
|
+
identity2(this);
|
|
3821
|
+
return this.check();
|
|
3822
|
+
}
|
|
3688
3823
|
setAxisAngle(axis, rad) {
|
|
3689
3824
|
return this.fromAxisRotation(axis, rad);
|
|
3690
3825
|
}
|
|
@@ -3721,20 +3856,14 @@
|
|
|
3721
3856
|
lengthSquared() {
|
|
3722
3857
|
return squaredLength2(this);
|
|
3723
3858
|
}
|
|
3724
|
-
dot(a2
|
|
3725
|
-
if (b !== void 0) {
|
|
3726
|
-
throw new Error("Quaternion.dot only takes one argument");
|
|
3727
|
-
}
|
|
3859
|
+
dot(a2) {
|
|
3728
3860
|
return dot3(this, a2);
|
|
3729
3861
|
}
|
|
3730
3862
|
rotationTo(vectorA, vectorB) {
|
|
3731
3863
|
rotationTo(this, vectorA, vectorB);
|
|
3732
3864
|
return this.check();
|
|
3733
3865
|
}
|
|
3734
|
-
add(a2
|
|
3735
|
-
if (b !== void 0) {
|
|
3736
|
-
throw new Error("Quaternion.add only takes one argument");
|
|
3737
|
-
}
|
|
3866
|
+
add(a2) {
|
|
3738
3867
|
add2(this, this, a2);
|
|
3739
3868
|
return this.check();
|
|
3740
3869
|
}
|
|
@@ -3751,16 +3880,17 @@
|
|
|
3751
3880
|
return this.check();
|
|
3752
3881
|
}
|
|
3753
3882
|
lerp(a2, b, t2) {
|
|
3883
|
+
if (t2 === void 0) {
|
|
3884
|
+
return this.lerp(this, a2, b);
|
|
3885
|
+
}
|
|
3754
3886
|
lerp2(this, a2, b, t2);
|
|
3755
3887
|
return this.check();
|
|
3756
3888
|
}
|
|
3757
|
-
multiplyRight(a2
|
|
3758
|
-
assert4(!b);
|
|
3889
|
+
multiplyRight(a2) {
|
|
3759
3890
|
multiply3(this, this, a2);
|
|
3760
3891
|
return this.check();
|
|
3761
3892
|
}
|
|
3762
|
-
multiplyLeft(a2
|
|
3763
|
-
assert4(!b);
|
|
3893
|
+
multiplyLeft(a2) {
|
|
3764
3894
|
multiply3(this, a2, this);
|
|
3765
3895
|
return this.check();
|
|
3766
3896
|
}
|
|
@@ -3792,25 +3922,32 @@
|
|
|
3792
3922
|
scale4(this, this, b);
|
|
3793
3923
|
return this.check();
|
|
3794
3924
|
}
|
|
3795
|
-
slerp(
|
|
3925
|
+
slerp(arg0, arg1, arg2) {
|
|
3926
|
+
let start;
|
|
3927
|
+
let target;
|
|
3928
|
+
let ratio;
|
|
3796
3929
|
switch (arguments.length) {
|
|
3797
3930
|
case 1:
|
|
3798
3931
|
({
|
|
3799
3932
|
start = IDENTITY_QUATERNION,
|
|
3800
3933
|
target,
|
|
3801
3934
|
ratio
|
|
3802
|
-
} =
|
|
3935
|
+
} = arg0);
|
|
3803
3936
|
break;
|
|
3804
3937
|
case 2:
|
|
3805
|
-
[target, ratio] = arguments;
|
|
3806
3938
|
start = this;
|
|
3939
|
+
target = arg0;
|
|
3940
|
+
ratio = arg1;
|
|
3807
3941
|
break;
|
|
3808
3942
|
default:
|
|
3943
|
+
start = arg0;
|
|
3944
|
+
target = arg1;
|
|
3945
|
+
ratio = arg2;
|
|
3809
3946
|
}
|
|
3810
3947
|
slerp(this, start, target, ratio);
|
|
3811
3948
|
return this.check();
|
|
3812
3949
|
}
|
|
3813
|
-
transformVector4(vector, result =
|
|
3950
|
+
transformVector4(vector, result = new Vector4()) {
|
|
3814
3951
|
transformQuat2(result, vector, this);
|
|
3815
3952
|
return checkVector(result, 4);
|
|
3816
3953
|
}
|
|
@@ -3820,11 +3957,11 @@
|
|
|
3820
3957
|
setFromAxisAngle(axis, rad) {
|
|
3821
3958
|
return this.setAxisAngle(axis, rad);
|
|
3822
3959
|
}
|
|
3823
|
-
premultiply(a2
|
|
3824
|
-
return this.multiplyLeft(a2
|
|
3960
|
+
premultiply(a2) {
|
|
3961
|
+
return this.multiplyLeft(a2);
|
|
3825
3962
|
}
|
|
3826
|
-
multiply(a2
|
|
3827
|
-
return this.multiplyRight(a2
|
|
3963
|
+
multiply(a2) {
|
|
3964
|
+
return this.multiplyRight(a2);
|
|
3828
3965
|
}
|
|
3829
3966
|
};
|
|
3830
3967
|
}
|
|
@@ -3864,27 +4001,16 @@
|
|
|
3864
4001
|
});
|
|
3865
4002
|
|
|
3866
4003
|
// ../../node_modules/@math.gl/core/dist/esm/index.js
|
|
3867
|
-
var globals3, global_3;
|
|
3868
4004
|
var init_esm = __esm({
|
|
3869
4005
|
"../../node_modules/@math.gl/core/dist/esm/index.js"() {
|
|
3870
|
-
init_common();
|
|
3871
4006
|
init_vector2();
|
|
3872
4007
|
init_vector3();
|
|
3873
4008
|
init_matrix3();
|
|
3874
4009
|
init_matrix4();
|
|
3875
4010
|
init_quaternion();
|
|
3876
|
-
init_common();
|
|
3877
4011
|
init_math_utils();
|
|
3878
4012
|
init_assert3();
|
|
3879
|
-
|
|
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
|
-
};
|
|
4013
|
+
init_common();
|
|
3888
4014
|
}
|
|
3889
4015
|
});
|
|
3890
4016
|
|
|
@@ -3907,65 +4033,67 @@
|
|
|
3907
4033
|
});
|
|
3908
4034
|
|
|
3909
4035
|
// ../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js
|
|
3910
|
-
function
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
result[
|
|
3917
|
-
result[1] = map3(cartographic.latitude);
|
|
4036
|
+
function identity3(x) {
|
|
4037
|
+
return x;
|
|
4038
|
+
}
|
|
4039
|
+
function fromCartographic(cartographic, result = [], map2 = identity3) {
|
|
4040
|
+
if ("longitude" in cartographic) {
|
|
4041
|
+
result[0] = map2(cartographic.longitude);
|
|
4042
|
+
result[1] = map2(cartographic.latitude);
|
|
3918
4043
|
result[2] = cartographic.height;
|
|
3919
|
-
} else {
|
|
3920
|
-
result[0] =
|
|
3921
|
-
result[1] =
|
|
4044
|
+
} else if ("x" in cartographic) {
|
|
4045
|
+
result[0] = map2(cartographic.x);
|
|
4046
|
+
result[1] = map2(cartographic.y);
|
|
3922
4047
|
result[2] = cartographic.z;
|
|
4048
|
+
} else {
|
|
4049
|
+
result[0] = map2(cartographic[0]);
|
|
4050
|
+
result[1] = map2(cartographic[1]);
|
|
4051
|
+
result[2] = cartographic[2];
|
|
3923
4052
|
}
|
|
3924
4053
|
return result;
|
|
3925
4054
|
}
|
|
3926
|
-
function fromCartographicToRadians(cartographic, vector =
|
|
3927
|
-
return fromCartographic(cartographic, vector, config._cartographicRadians ?
|
|
4055
|
+
function fromCartographicToRadians(cartographic, vector = []) {
|
|
4056
|
+
return fromCartographic(cartographic, vector, config._cartographicRadians ? identity3 : toRadians);
|
|
3928
4057
|
}
|
|
3929
|
-
function toCartographic(vector, cartographic,
|
|
3930
|
-
if (
|
|
3931
|
-
cartographic
|
|
3932
|
-
cartographic
|
|
3933
|
-
cartographic[2] = vector[2];
|
|
3934
|
-
} else if ("longitude" in cartographic) {
|
|
3935
|
-
cartographic.longitude = map3(vector[0]);
|
|
3936
|
-
cartographic.latitude = map3(vector[1]);
|
|
4058
|
+
function toCartographic(vector, cartographic, map2 = identity3) {
|
|
4059
|
+
if ("longitude" in cartographic) {
|
|
4060
|
+
cartographic.longitude = map2(vector[0]);
|
|
4061
|
+
cartographic.latitude = map2(vector[1]);
|
|
3937
4062
|
cartographic.height = vector[2];
|
|
3938
|
-
} else {
|
|
3939
|
-
cartographic.x =
|
|
3940
|
-
cartographic.y =
|
|
4063
|
+
} else if ("x" in cartographic) {
|
|
4064
|
+
cartographic.x = map2(vector[0]);
|
|
4065
|
+
cartographic.y = map2(vector[1]);
|
|
3941
4066
|
cartographic.z = vector[2];
|
|
4067
|
+
} else {
|
|
4068
|
+
cartographic[0] = map2(vector[0]);
|
|
4069
|
+
cartographic[1] = map2(vector[1]);
|
|
4070
|
+
cartographic[2] = vector[2];
|
|
3942
4071
|
}
|
|
3943
4072
|
return cartographic;
|
|
3944
4073
|
}
|
|
3945
4074
|
function toCartographicFromRadians(vector, cartographic) {
|
|
3946
|
-
return toCartographic(vector, cartographic, config._cartographicRadians ?
|
|
4075
|
+
return toCartographic(vector, cartographic, config._cartographicRadians ? identity3 : toDegrees);
|
|
3947
4076
|
}
|
|
3948
|
-
var
|
|
4077
|
+
var scratchVector;
|
|
3949
4078
|
var init_type_utils = __esm({
|
|
3950
4079
|
"../../node_modules/@math.gl/geospatial/dist/esm/type-utils.js"() {
|
|
3951
4080
|
init_esm();
|
|
3952
4081
|
init_constants();
|
|
3953
|
-
noop = (x) => x;
|
|
3954
4082
|
scratchVector = new Vector3();
|
|
3955
4083
|
}
|
|
3956
4084
|
});
|
|
3957
4085
|
|
|
3958
4086
|
// ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/helpers/scale-to-geodetic-surface.js
|
|
3959
|
-
function scaleToGeodeticSurface(cartesian, ellipsoid, result =
|
|
4087
|
+
function scaleToGeodeticSurface(cartesian, ellipsoid, result = []) {
|
|
3960
4088
|
const {
|
|
3961
4089
|
oneOverRadii,
|
|
3962
4090
|
oneOverRadiiSquared,
|
|
3963
4091
|
centerToleranceSquared
|
|
3964
4092
|
} = ellipsoid;
|
|
3965
4093
|
scratchVector2.from(cartesian);
|
|
3966
|
-
const positionX =
|
|
3967
|
-
const positionY =
|
|
3968
|
-
const positionZ =
|
|
4094
|
+
const positionX = scratchVector2.x;
|
|
4095
|
+
const positionY = scratchVector2.y;
|
|
4096
|
+
const positionZ = scratchVector2.z;
|
|
3969
4097
|
const oneOverRadiiX = oneOverRadii.x;
|
|
3970
4098
|
const oneOverRadiiY = oneOverRadii.y;
|
|
3971
4099
|
const oneOverRadiiZ = oneOverRadii.z;
|
|
@@ -3987,7 +4115,7 @@
|
|
|
3987
4115
|
const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
|
|
3988
4116
|
const gradient = scaleToGeodeticSurfaceGradient;
|
|
3989
4117
|
gradient.set(intersection.x * oneOverRadiiSquaredX * 2, intersection.y * oneOverRadiiSquaredY * 2, intersection.z * oneOverRadiiSquaredZ * 2);
|
|
3990
|
-
let lambda = (1 - ratio) *
|
|
4118
|
+
let lambda = (1 - ratio) * scratchVector2.len() / (0.5 * gradient.len());
|
|
3991
4119
|
let correction = 0;
|
|
3992
4120
|
let xMultiplier;
|
|
3993
4121
|
let yMultiplier;
|
|
@@ -4150,9 +4278,10 @@
|
|
|
4150
4278
|
});
|
|
4151
4279
|
|
|
4152
4280
|
// ../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js
|
|
4153
|
-
var scratchVector4, scratchNormal, scratchK, scratchPosition, scratchHeight, scratchCartesian,
|
|
4281
|
+
var scratchVector4, scratchNormal, scratchK, scratchPosition, scratchHeight, scratchCartesian, Ellipsoid;
|
|
4154
4282
|
var init_ellipsoid = __esm({
|
|
4155
4283
|
"../../node_modules/@math.gl/geospatial/dist/esm/ellipsoid/ellipsoid.js"() {
|
|
4284
|
+
init_defineProperty();
|
|
4156
4285
|
init_esm();
|
|
4157
4286
|
init_vec3();
|
|
4158
4287
|
init_constants();
|
|
@@ -4166,11 +4295,16 @@
|
|
|
4166
4295
|
scratchHeight = new Vector3();
|
|
4167
4296
|
scratchCartesian = new Vector3();
|
|
4168
4297
|
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
4298
|
constructor(x = 0, y = 0, z = 0) {
|
|
4299
|
+
_defineProperty(this, "radii", void 0);
|
|
4300
|
+
_defineProperty(this, "radiiSquared", void 0);
|
|
4301
|
+
_defineProperty(this, "radiiToTheFourth", void 0);
|
|
4302
|
+
_defineProperty(this, "oneOverRadii", void 0);
|
|
4303
|
+
_defineProperty(this, "oneOverRadiiSquared", void 0);
|
|
4304
|
+
_defineProperty(this, "minimumRadius", void 0);
|
|
4305
|
+
_defineProperty(this, "maximumRadius", void 0);
|
|
4306
|
+
_defineProperty(this, "centerToleranceSquared", math_utils_default.EPSILON1);
|
|
4307
|
+
_defineProperty(this, "squaredXOverSquaredZ", void 0);
|
|
4174
4308
|
assert4(x >= 0);
|
|
4175
4309
|
assert4(y >= 0);
|
|
4176
4310
|
assert4(z >= 0);
|
|
@@ -4181,7 +4315,6 @@
|
|
|
4181
4315
|
this.oneOverRadiiSquared = new Vector3(x === 0 ? 0 : 1 / (x * x), y === 0 ? 0 : 1 / (y * y), z === 0 ? 0 : 1 / (z * z));
|
|
4182
4316
|
this.minimumRadius = Math.min(x, y, z);
|
|
4183
4317
|
this.maximumRadius = Math.max(x, y, z);
|
|
4184
|
-
this.centerToleranceSquared = math_utils_default.EPSILON1;
|
|
4185
4318
|
if (this.radiiSquared.z !== 0) {
|
|
4186
4319
|
this.squaredXOverSquaredZ = this.radiiSquared.x / this.radiiSquared.z;
|
|
4187
4320
|
}
|
|
@@ -4268,6 +4401,7 @@
|
|
|
4268
4401
|
return scratchPosition.set(0, 0, z).to(result);
|
|
4269
4402
|
}
|
|
4270
4403
|
};
|
|
4404
|
+
_defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
|
|
4271
4405
|
}
|
|
4272
4406
|
});
|
|
4273
4407
|
|
|
@@ -4477,7 +4611,7 @@
|
|
|
4477
4611
|
}
|
|
4478
4612
|
});
|
|
4479
4613
|
|
|
4480
|
-
// ../../node_modules
|
|
4614
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
|
|
4481
4615
|
function isElectron(mockUserAgent) {
|
|
4482
4616
|
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
4483
4617
|
return true;
|
|
@@ -4493,52 +4627,59 @@
|
|
|
4493
4627
|
return false;
|
|
4494
4628
|
}
|
|
4495
4629
|
var init_is_electron = __esm({
|
|
4496
|
-
"../../node_modules
|
|
4630
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
4497
4631
|
}
|
|
4498
4632
|
});
|
|
4499
4633
|
|
|
4500
|
-
// ../../node_modules
|
|
4634
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
|
|
4501
4635
|
function isBrowser3() {
|
|
4502
4636
|
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
4503
4637
|
return !isNode || isElectron();
|
|
4504
4638
|
}
|
|
4505
4639
|
var init_is_browser = __esm({
|
|
4506
|
-
"../../node_modules
|
|
4640
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
4507
4641
|
init_is_electron();
|
|
4508
4642
|
}
|
|
4509
4643
|
});
|
|
4510
4644
|
|
|
4511
|
-
// ../../node_modules
|
|
4512
|
-
var
|
|
4645
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
|
|
4646
|
+
var globals3, self_3, window_3, document_3, process_;
|
|
4513
4647
|
var init_globals3 = __esm({
|
|
4514
|
-
"../../node_modules
|
|
4515
|
-
|
|
4648
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
4649
|
+
globals3 = {
|
|
4516
4650
|
self: typeof self !== "undefined" && self,
|
|
4517
4651
|
window: typeof window !== "undefined" && window,
|
|
4518
4652
|
global: typeof global !== "undefined" && global,
|
|
4519
4653
|
document: typeof document !== "undefined" && document,
|
|
4520
4654
|
process: typeof process === "object" && process
|
|
4521
4655
|
};
|
|
4522
|
-
self_3 =
|
|
4523
|
-
window_3 =
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
process_ = globals4.process || {};
|
|
4656
|
+
self_3 = globals3.self || globals3.window || globals3.global;
|
|
4657
|
+
window_3 = globals3.window || globals3.self || globals3.global;
|
|
4658
|
+
document_3 = globals3.document || {};
|
|
4659
|
+
process_ = globals3.process || {};
|
|
4527
4660
|
}
|
|
4528
4661
|
});
|
|
4529
4662
|
|
|
4530
|
-
// ../../node_modules
|
|
4663
|
+
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
4531
4664
|
var VERSION3, isBrowser4;
|
|
4532
4665
|
var init_globals4 = __esm({
|
|
4533
|
-
"../../node_modules
|
|
4666
|
+
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
4534
4667
|
init_is_browser();
|
|
4535
|
-
init_globals3();
|
|
4536
4668
|
VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
4537
4669
|
isBrowser4 = isBrowser3();
|
|
4538
4670
|
}
|
|
4539
4671
|
});
|
|
4540
4672
|
|
|
4541
|
-
// ../../node_modules
|
|
4673
|
+
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
4674
|
+
var init_esm3 = __esm({
|
|
4675
|
+
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
4676
|
+
init_globals4();
|
|
4677
|
+
init_globals3();
|
|
4678
|
+
init_is_browser();
|
|
4679
|
+
}
|
|
4680
|
+
});
|
|
4681
|
+
|
|
4682
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
|
|
4542
4683
|
function getStorage(type) {
|
|
4543
4684
|
try {
|
|
4544
4685
|
const storage = window[type];
|
|
@@ -4552,9 +4693,15 @@
|
|
|
4552
4693
|
}
|
|
4553
4694
|
var LocalStorage;
|
|
4554
4695
|
var init_local_storage = __esm({
|
|
4555
|
-
"../../node_modules
|
|
4696
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
4697
|
+
init_defineProperty();
|
|
4556
4698
|
LocalStorage = class {
|
|
4557
|
-
constructor(id
|
|
4699
|
+
constructor(id) {
|
|
4700
|
+
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
4701
|
+
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
4702
|
+
_defineProperty(this, "storage", void 0);
|
|
4703
|
+
_defineProperty(this, "id", void 0);
|
|
4704
|
+
_defineProperty(this, "config", {});
|
|
4558
4705
|
this.storage = getStorage(type);
|
|
4559
4706
|
this.id = id;
|
|
4560
4707
|
this.config = {};
|
|
@@ -4589,7 +4736,7 @@
|
|
|
4589
4736
|
}
|
|
4590
4737
|
});
|
|
4591
4738
|
|
|
4592
|
-
// ../../node_modules
|
|
4739
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
4593
4740
|
function formatTime(ms) {
|
|
4594
4741
|
let formatted;
|
|
4595
4742
|
if (ms < 10) {
|
|
@@ -4603,11 +4750,13 @@
|
|
|
4603
4750
|
}
|
|
4604
4751
|
return formatted;
|
|
4605
4752
|
}
|
|
4606
|
-
function leftPad(string
|
|
4753
|
+
function leftPad(string) {
|
|
4754
|
+
let length4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
4607
4755
|
const padLength = Math.max(length4 - string.length, 0);
|
|
4608
4756
|
return "".concat(" ".repeat(padLength)).concat(string);
|
|
4609
4757
|
}
|
|
4610
|
-
function formatImage(image, message, scale5
|
|
4758
|
+
function formatImage(image, message, scale5) {
|
|
4759
|
+
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
4611
4760
|
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
4612
4761
|
if (image.width > maxWidth) {
|
|
4613
4762
|
scale5 = Math.min(scale5, maxWidth / image.width);
|
|
@@ -4618,16 +4767,16 @@
|
|
|
4618
4767
|
return ["".concat(message, " %c+"), style];
|
|
4619
4768
|
}
|
|
4620
4769
|
var init_formatters = __esm({
|
|
4621
|
-
"../../node_modules
|
|
4770
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
4622
4771
|
}
|
|
4623
4772
|
});
|
|
4624
4773
|
|
|
4625
|
-
// ../../node_modules
|
|
4774
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
4626
4775
|
function getColor(color) {
|
|
4627
4776
|
return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
|
|
4628
4777
|
}
|
|
4629
4778
|
function addColor(string, color, background) {
|
|
4630
|
-
if (!
|
|
4779
|
+
if (!isBrowser3 && typeof string === "string") {
|
|
4631
4780
|
if (color) {
|
|
4632
4781
|
color = getColor(color);
|
|
4633
4782
|
string = "[".concat(color, "m").concat(string, "[39m");
|
|
@@ -4641,64 +4790,67 @@
|
|
|
4641
4790
|
}
|
|
4642
4791
|
var COLOR;
|
|
4643
4792
|
var init_color = __esm({
|
|
4644
|
-
"../../node_modules
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
BLACK
|
|
4648
|
-
RED
|
|
4649
|
-
GREEN
|
|
4650
|
-
YELLOW
|
|
4651
|
-
BLUE
|
|
4652
|
-
MAGENTA
|
|
4653
|
-
CYAN
|
|
4654
|
-
WHITE
|
|
4655
|
-
BRIGHT_BLACK
|
|
4656
|
-
BRIGHT_RED
|
|
4657
|
-
BRIGHT_GREEN
|
|
4658
|
-
BRIGHT_YELLOW
|
|
4659
|
-
BRIGHT_BLUE
|
|
4660
|
-
BRIGHT_MAGENTA
|
|
4661
|
-
BRIGHT_CYAN
|
|
4662
|
-
BRIGHT_WHITE
|
|
4663
|
-
};
|
|
4664
|
-
}
|
|
4665
|
-
});
|
|
4666
|
-
|
|
4667
|
-
// ../../node_modules
|
|
4668
|
-
function autobind(obj
|
|
4793
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
4794
|
+
init_esm3();
|
|
4795
|
+
(function(COLOR2) {
|
|
4796
|
+
COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
|
|
4797
|
+
COLOR2[COLOR2["RED"] = 31] = "RED";
|
|
4798
|
+
COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
|
|
4799
|
+
COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
|
|
4800
|
+
COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
|
|
4801
|
+
COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
|
|
4802
|
+
COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
|
|
4803
|
+
COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
|
|
4804
|
+
COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
4805
|
+
COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
4806
|
+
COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
4807
|
+
COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
4808
|
+
COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
4809
|
+
COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
4810
|
+
COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
4811
|
+
COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
4812
|
+
})(COLOR || (COLOR = {}));
|
|
4813
|
+
}
|
|
4814
|
+
});
|
|
4815
|
+
|
|
4816
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
4817
|
+
function autobind(obj) {
|
|
4818
|
+
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
4669
4819
|
const proto = Object.getPrototypeOf(obj);
|
|
4670
4820
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
4671
4821
|
for (const key of propNames) {
|
|
4672
4822
|
if (typeof obj[key] === "function") {
|
|
4673
|
-
if (!predefined.find((
|
|
4823
|
+
if (!predefined.find((name10) => key === name10)) {
|
|
4674
4824
|
obj[key] = obj[key].bind(obj);
|
|
4675
4825
|
}
|
|
4676
4826
|
}
|
|
4677
4827
|
}
|
|
4678
4828
|
}
|
|
4679
4829
|
var init_autobind = __esm({
|
|
4680
|
-
"../../node_modules
|
|
4830
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
4681
4831
|
}
|
|
4682
4832
|
});
|
|
4683
4833
|
|
|
4684
|
-
// ../../node_modules
|
|
4834
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
4685
4835
|
function assert5(condition, message) {
|
|
4686
4836
|
if (!condition) {
|
|
4687
4837
|
throw new Error(message || "Assertion failed");
|
|
4688
4838
|
}
|
|
4689
4839
|
}
|
|
4690
4840
|
var init_assert4 = __esm({
|
|
4691
|
-
"../../node_modules
|
|
4841
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
4692
4842
|
}
|
|
4693
4843
|
});
|
|
4694
4844
|
|
|
4695
|
-
// ../../node_modules
|
|
4845
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
4696
4846
|
function getHiResTimestamp() {
|
|
4697
4847
|
let timestamp;
|
|
4698
|
-
if (
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4848
|
+
if (isBrowser3 && "performance" in window_3) {
|
|
4849
|
+
var _window$performance, _window$performance$n;
|
|
4850
|
+
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);
|
|
4851
|
+
} else if ("hrtime" in process_) {
|
|
4852
|
+
var _process$hrtime;
|
|
4853
|
+
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
4854
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
4703
4855
|
} else {
|
|
4704
4856
|
timestamp = Date.now();
|
|
@@ -4706,21 +4858,19 @@
|
|
|
4706
4858
|
return timestamp;
|
|
4707
4859
|
}
|
|
4708
4860
|
var init_hi_res_timestamp = __esm({
|
|
4709
|
-
"../../node_modules
|
|
4710
|
-
|
|
4861
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
4862
|
+
init_esm3();
|
|
4711
4863
|
}
|
|
4712
4864
|
});
|
|
4713
4865
|
|
|
4714
|
-
//
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
function getTableHeader(table) {
|
|
4718
|
-
for (const key in table) {
|
|
4719
|
-
for (const title in table[key]) {
|
|
4720
|
-
return title || "untitled";
|
|
4721
|
-
}
|
|
4866
|
+
// (disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image
|
|
4867
|
+
var init_node_asciify_image = __esm({
|
|
4868
|
+
"(disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image"() {
|
|
4722
4869
|
}
|
|
4723
|
-
|
|
4870
|
+
});
|
|
4871
|
+
|
|
4872
|
+
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
4873
|
+
function noop() {
|
|
4724
4874
|
}
|
|
4725
4875
|
function normalizeLogLevel(logLevel) {
|
|
4726
4876
|
if (!logLevel) {
|
|
@@ -4749,7 +4899,6 @@
|
|
|
4749
4899
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
4750
4900
|
while (args.length && args.shift() !== message) {
|
|
4751
4901
|
}
|
|
4752
|
-
opts.args = args;
|
|
4753
4902
|
switch (typeof logLevel) {
|
|
4754
4903
|
case "string":
|
|
4755
4904
|
case "function":
|
|
@@ -4768,7 +4917,9 @@
|
|
|
4768
4917
|
}
|
|
4769
4918
|
const messageType = typeof opts.message;
|
|
4770
4919
|
assert5(messageType === "string" || messageType === "object");
|
|
4771
|
-
return Object.assign(opts,
|
|
4920
|
+
return Object.assign(opts, {
|
|
4921
|
+
args
|
|
4922
|
+
}, opts.opts);
|
|
4772
4923
|
}
|
|
4773
4924
|
function decorateMessage(id, message, opts) {
|
|
4774
4925
|
if (typeof message === "string") {
|
|
@@ -4778,29 +4929,25 @@
|
|
|
4778
4929
|
}
|
|
4779
4930
|
return message;
|
|
4780
4931
|
}
|
|
4781
|
-
function logImageInNode({
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
fit: "box",
|
|
4794
|
-
width: "".concat(Math.round(80 * scale5), "%")
|
|
4795
|
-
}).then((data) => console.log(data));
|
|
4796
|
-
}
|
|
4797
|
-
return noop2;
|
|
4932
|
+
function logImageInNode(_ref2) {
|
|
4933
|
+
let {
|
|
4934
|
+
image,
|
|
4935
|
+
message = "",
|
|
4936
|
+
scale: scale5 = 1
|
|
4937
|
+
} = _ref2;
|
|
4938
|
+
asciify.nodeAsciifyImage({
|
|
4939
|
+
image,
|
|
4940
|
+
message,
|
|
4941
|
+
scale: scale5
|
|
4942
|
+
});
|
|
4943
|
+
return noop;
|
|
4798
4944
|
}
|
|
4799
|
-
function logImageInBrowser({
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4945
|
+
function logImageInBrowser(_ref3) {
|
|
4946
|
+
let {
|
|
4947
|
+
image,
|
|
4948
|
+
message = "",
|
|
4949
|
+
scale: scale5 = 1
|
|
4950
|
+
} = _ref3;
|
|
4804
4951
|
if (typeof image === "string") {
|
|
4805
4952
|
const img = new Image();
|
|
4806
4953
|
img.onload = () => {
|
|
@@ -4808,33 +4955,43 @@
|
|
|
4808
4955
|
console.log(...args);
|
|
4809
4956
|
};
|
|
4810
4957
|
img.src = image;
|
|
4811
|
-
return
|
|
4958
|
+
return noop;
|
|
4812
4959
|
}
|
|
4813
4960
|
const element = image.nodeName || "";
|
|
4814
4961
|
if (element.toLowerCase() === "img") {
|
|
4815
4962
|
console.log(...formatImage(image, message, scale5));
|
|
4816
|
-
return
|
|
4963
|
+
return noop;
|
|
4817
4964
|
}
|
|
4818
4965
|
if (element.toLowerCase() === "canvas") {
|
|
4819
4966
|
const img = new Image();
|
|
4820
4967
|
img.onload = () => console.log(...formatImage(img, message, scale5));
|
|
4821
4968
|
img.src = image.toDataURL();
|
|
4822
|
-
return
|
|
4969
|
+
return noop;
|
|
4970
|
+
}
|
|
4971
|
+
return noop;
|
|
4972
|
+
}
|
|
4973
|
+
function getTableHeader(table) {
|
|
4974
|
+
for (const key in table) {
|
|
4975
|
+
for (const title in table[key]) {
|
|
4976
|
+
return title || "untitled";
|
|
4977
|
+
}
|
|
4823
4978
|
}
|
|
4824
|
-
return
|
|
4979
|
+
return "empty";
|
|
4825
4980
|
}
|
|
4826
4981
|
var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
|
|
4827
4982
|
var init_log = __esm({
|
|
4828
|
-
"../../node_modules
|
|
4829
|
-
|
|
4983
|
+
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
4984
|
+
init_defineProperty();
|
|
4985
|
+
init_esm3();
|
|
4830
4986
|
init_local_storage();
|
|
4831
4987
|
init_formatters();
|
|
4832
4988
|
init_color();
|
|
4833
4989
|
init_autobind();
|
|
4834
4990
|
init_assert4();
|
|
4835
4991
|
init_hi_res_timestamp();
|
|
4992
|
+
init_node_asciify_image();
|
|
4836
4993
|
originalConsole = {
|
|
4837
|
-
debug:
|
|
4994
|
+
debug: isBrowser3 ? console.debug || console.log : console.log,
|
|
4838
4995
|
log: console.log,
|
|
4839
4996
|
info: console.info,
|
|
4840
4997
|
warn: console.warn,
|
|
@@ -4849,16 +5006,20 @@
|
|
|
4849
5006
|
once: true
|
|
4850
5007
|
};
|
|
4851
5008
|
Log = class {
|
|
4852
|
-
constructor({
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
5009
|
+
constructor() {
|
|
5010
|
+
let {
|
|
5011
|
+
id
|
|
5012
|
+
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
5013
|
+
id: ""
|
|
5014
|
+
};
|
|
5015
|
+
_defineProperty(this, "id", void 0);
|
|
5016
|
+
_defineProperty(this, "VERSION", VERSION3);
|
|
5017
|
+
_defineProperty(this, "_startTs", getHiResTimestamp());
|
|
5018
|
+
_defineProperty(this, "_deltaTs", getHiResTimestamp());
|
|
5019
|
+
_defineProperty(this, "_storage", void 0);
|
|
5020
|
+
_defineProperty(this, "userData", {});
|
|
5021
|
+
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
4857
5022
|
this.id = id;
|
|
4858
|
-
this.VERSION = VERSION3;
|
|
4859
|
-
this._startTs = getHiResTimestamp();
|
|
4860
|
-
this._deltaTs = getHiResTimestamp();
|
|
4861
|
-
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
4862
5023
|
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
4863
5024
|
this.userData = {};
|
|
4864
5025
|
this.timeStamp("".concat(this.id, " started"));
|
|
@@ -4892,7 +5053,8 @@
|
|
|
4892
5053
|
getPriority() {
|
|
4893
5054
|
return this.level;
|
|
4894
5055
|
}
|
|
4895
|
-
enable(
|
|
5056
|
+
enable() {
|
|
5057
|
+
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
4896
5058
|
this._storage.updateConfiguration({
|
|
4897
5059
|
enabled
|
|
4898
5060
|
});
|
|
@@ -4904,6 +5066,21 @@
|
|
|
4904
5066
|
});
|
|
4905
5067
|
return this;
|
|
4906
5068
|
}
|
|
5069
|
+
get(setting) {
|
|
5070
|
+
return this._storage.config[setting];
|
|
5071
|
+
}
|
|
5072
|
+
set(setting, value) {
|
|
5073
|
+
this._storage.updateConfiguration({
|
|
5074
|
+
[setting]: value
|
|
5075
|
+
});
|
|
5076
|
+
}
|
|
5077
|
+
settings() {
|
|
5078
|
+
if (console.table) {
|
|
5079
|
+
console.table(this._storage.config);
|
|
5080
|
+
} else {
|
|
5081
|
+
console.log(this._storage.config);
|
|
5082
|
+
}
|
|
5083
|
+
}
|
|
4907
5084
|
assert(condition, message) {
|
|
4908
5085
|
assert5(condition, message);
|
|
4909
5086
|
}
|
|
@@ -4932,27 +5109,31 @@
|
|
|
4932
5109
|
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
4933
5110
|
}
|
|
4934
5111
|
once(logLevel, message) {
|
|
5112
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
5113
|
+
args[_key - 2] = arguments[_key];
|
|
5114
|
+
}
|
|
4935
5115
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
4936
5116
|
}
|
|
4937
5117
|
table(logLevel, table, columns) {
|
|
4938
5118
|
if (table) {
|
|
4939
|
-
return this._getLogFunction(logLevel, table, console.table ||
|
|
5119
|
+
return this._getLogFunction(logLevel, table, console.table || noop, columns && [columns], {
|
|
4940
5120
|
tag: getTableHeader(table)
|
|
4941
5121
|
});
|
|
4942
5122
|
}
|
|
4943
|
-
return
|
|
5123
|
+
return noop;
|
|
4944
5124
|
}
|
|
4945
|
-
image({
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
5125
|
+
image(_ref) {
|
|
5126
|
+
let {
|
|
5127
|
+
logLevel,
|
|
5128
|
+
priority,
|
|
5129
|
+
image,
|
|
5130
|
+
message = "",
|
|
5131
|
+
scale: scale5 = 1
|
|
5132
|
+
} = _ref;
|
|
4952
5133
|
if (!this._shouldLog(logLevel || priority)) {
|
|
4953
|
-
return
|
|
5134
|
+
return noop;
|
|
4954
5135
|
}
|
|
4955
|
-
return
|
|
5136
|
+
return isBrowser3 ? logImageInBrowser({
|
|
4956
5137
|
image,
|
|
4957
5138
|
message,
|
|
4958
5139
|
scale: scale5
|
|
@@ -4962,21 +5143,6 @@
|
|
|
4962
5143
|
scale: scale5
|
|
4963
5144
|
});
|
|
4964
5145
|
}
|
|
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
5146
|
time(logLevel, message) {
|
|
4981
5147
|
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
4982
5148
|
}
|
|
@@ -4984,12 +5150,13 @@
|
|
|
4984
5150
|
return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
|
|
4985
5151
|
}
|
|
4986
5152
|
timeStamp(logLevel, message) {
|
|
4987
|
-
return this._getLogFunction(logLevel, message, console.timeStamp ||
|
|
5153
|
+
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
4988
5154
|
}
|
|
4989
|
-
group(logLevel, message
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
5155
|
+
group(logLevel, message) {
|
|
5156
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
5157
|
+
collapsed: false
|
|
5158
|
+
};
|
|
5159
|
+
const options = normalizeArguments({
|
|
4993
5160
|
logLevel,
|
|
4994
5161
|
message,
|
|
4995
5162
|
opts
|
|
@@ -4997,16 +5164,17 @@
|
|
|
4997
5164
|
const {
|
|
4998
5165
|
collapsed
|
|
4999
5166
|
} = opts;
|
|
5000
|
-
|
|
5001
|
-
return this._getLogFunction(
|
|
5167
|
+
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
5168
|
+
return this._getLogFunction(options);
|
|
5002
5169
|
}
|
|
5003
|
-
groupCollapsed(logLevel, message
|
|
5170
|
+
groupCollapsed(logLevel, message) {
|
|
5171
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
5004
5172
|
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
5005
5173
|
collapsed: true
|
|
5006
5174
|
}));
|
|
5007
5175
|
}
|
|
5008
5176
|
groupEnd(logLevel) {
|
|
5009
|
-
return this._getLogFunction(logLevel, "", console.groupEnd ||
|
|
5177
|
+
return this._getLogFunction(logLevel, "", console.groupEnd || noop);
|
|
5010
5178
|
}
|
|
5011
5179
|
withGroup(logLevel, message, func) {
|
|
5012
5180
|
this.group(logLevel, message)();
|
|
@@ -5024,7 +5192,7 @@
|
|
|
5024
5192
|
_shouldLog(logLevel) {
|
|
5025
5193
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
5026
5194
|
}
|
|
5027
|
-
_getLogFunction(logLevel, message, method, args
|
|
5195
|
+
_getLogFunction(logLevel, message, method, args, opts) {
|
|
5028
5196
|
if (this._shouldLog(logLevel)) {
|
|
5029
5197
|
opts = normalizeArguments({
|
|
5030
5198
|
logLevel,
|
|
@@ -5042,57 +5210,27 @@
|
|
|
5042
5210
|
if (!cache[tag]) {
|
|
5043
5211
|
cache[tag] = getHiResTimestamp();
|
|
5044
5212
|
} else {
|
|
5045
|
-
return
|
|
5213
|
+
return noop;
|
|
5046
5214
|
}
|
|
5047
5215
|
}
|
|
5048
5216
|
message = decorateMessage(this.id, opts.message, opts);
|
|
5049
5217
|
return method.bind(console, message, ...opts.args);
|
|
5050
5218
|
}
|
|
5051
|
-
return
|
|
5219
|
+
return noop;
|
|
5052
5220
|
}
|
|
5053
5221
|
};
|
|
5054
|
-
Log
|
|
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();
|
|
5222
|
+
_defineProperty(Log, "VERSION", VERSION3);
|
|
5084
5223
|
}
|
|
5085
5224
|
});
|
|
5086
5225
|
|
|
5087
|
-
// ../../node_modules
|
|
5226
|
+
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
5088
5227
|
var esm_default;
|
|
5089
5228
|
var init_esm4 = __esm({
|
|
5090
|
-
"../../node_modules
|
|
5229
|
+
"../../node_modules/@probe.gl/log/dist/esm/index.js"() {
|
|
5091
5230
|
init_log();
|
|
5092
5231
|
init_log();
|
|
5093
|
-
init_esm3();
|
|
5094
5232
|
esm_default = new Log({
|
|
5095
|
-
id: "probe.gl"
|
|
5233
|
+
id: "@probe.gl/log"
|
|
5096
5234
|
});
|
|
5097
5235
|
}
|
|
5098
5236
|
});
|
|
@@ -5206,784 +5344,161 @@
|
|
|
5206
5344
|
return fetchOptions.fetch;
|
|
5207
5345
|
}
|
|
5208
5346
|
if (isObject(fetchOptions.fetch)) {
|
|
5209
|
-
return (url) => fetchFile(url, fetchOptions);
|
|
5210
|
-
}
|
|
5211
|
-
if (context?.fetch) {
|
|
5212
|
-
return context?.fetch;
|
|
5213
|
-
}
|
|
5214
|
-
return fetchFile;
|
|
5215
|
-
}
|
|
5216
|
-
function validateOptions(options, loaders) {
|
|
5217
|
-
validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
|
|
5218
|
-
for (const loader of loaders) {
|
|
5219
|
-
const idOptions = options && options[loader.id] || {};
|
|
5220
|
-
const loaderOptions = loader.options && loader.options[loader.id] || {};
|
|
5221
|
-
const deprecatedOptions = loader.deprecatedOptions && loader.deprecatedOptions[loader.id] || {};
|
|
5222
|
-
validateOptionsObject(idOptions, loader.id, loaderOptions, deprecatedOptions, loaders);
|
|
5223
|
-
}
|
|
5224
|
-
}
|
|
5225
|
-
function validateOptionsObject(options, id, defaultOptions, deprecatedOptions, loaders) {
|
|
5226
|
-
const loaderName = id || "Top level";
|
|
5227
|
-
const prefix = id ? `${id}.` : "";
|
|
5228
|
-
for (const key in options) {
|
|
5229
|
-
const isSubOptions = !id && isObject(options[key]);
|
|
5230
|
-
const isBaseUriOption = key === "baseUri" && !id;
|
|
5231
|
-
const isWorkerUrlOption = key === "workerUrl" && id;
|
|
5232
|
-
if (!(key in defaultOptions) && !isBaseUriOption && !isWorkerUrlOption) {
|
|
5233
|
-
if (key in deprecatedOptions) {
|
|
5234
|
-
probeLog.warn(`${loaderName} loader option '${prefix}${key}' no longer supported, use '${deprecatedOptions[key]}'`)();
|
|
5235
|
-
} else if (!isSubOptions) {
|
|
5236
|
-
const suggestion = findSimilarOption(key, loaders);
|
|
5237
|
-
probeLog.warn(`${loaderName} loader option '${prefix}${key}' not recognized. ${suggestion}`)();
|
|
5238
|
-
}
|
|
5239
|
-
}
|
|
5240
|
-
}
|
|
5241
|
-
}
|
|
5242
|
-
function findSimilarOption(optionKey, loaders) {
|
|
5243
|
-
const lowerCaseOptionKey = optionKey.toLowerCase();
|
|
5244
|
-
let bestSuggestion = "";
|
|
5245
|
-
for (const loader of loaders) {
|
|
5246
|
-
for (const key in loader.options) {
|
|
5247
|
-
if (optionKey === key) {
|
|
5248
|
-
return `Did you mean '${loader.id}.${key}'?`;
|
|
5249
|
-
}
|
|
5250
|
-
const lowerCaseKey = key.toLowerCase();
|
|
5251
|
-
const isPartialMatch = lowerCaseOptionKey.startsWith(lowerCaseKey) || lowerCaseKey.startsWith(lowerCaseOptionKey);
|
|
5252
|
-
if (isPartialMatch) {
|
|
5253
|
-
bestSuggestion = bestSuggestion || `Did you mean '${loader.id}.${key}'?`;
|
|
5254
|
-
}
|
|
5255
|
-
}
|
|
5256
|
-
}
|
|
5257
|
-
return bestSuggestion;
|
|
5258
|
-
}
|
|
5259
|
-
function normalizeOptionsInternal(loader, options, url) {
|
|
5260
|
-
const loaderDefaultOptions = loader.options || {};
|
|
5261
|
-
const mergedOptions = { ...loaderDefaultOptions };
|
|
5262
|
-
addUrlOptions(mergedOptions, url);
|
|
5263
|
-
if (mergedOptions.log === null) {
|
|
5264
|
-
mergedOptions.log = new NullLog();
|
|
5265
|
-
}
|
|
5266
|
-
mergeNestedFields(mergedOptions, getGlobalLoaderOptions());
|
|
5267
|
-
mergeNestedFields(mergedOptions, options);
|
|
5268
|
-
return mergedOptions;
|
|
5269
|
-
}
|
|
5270
|
-
function mergeNestedFields(mergedOptions, options) {
|
|
5271
|
-
for (const key in options) {
|
|
5272
|
-
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, "[39m");
|
|
5527
|
-
}
|
|
5528
|
-
if (background) {
|
|
5529
|
-
color = getColor2(background);
|
|
5530
|
-
string = "[".concat(background + 10, "m").concat(string, "[49m");
|
|
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((name9) => key === name9)) {
|
|
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
|
-
}
|
|
5347
|
+
return (url) => fetchFile(url, fetchOptions);
|
|
5348
|
+
}
|
|
5349
|
+
if (context?.fetch) {
|
|
5350
|
+
return context?.fetch;
|
|
5351
|
+
}
|
|
5352
|
+
return fetchFile;
|
|
5353
|
+
}
|
|
5354
|
+
function validateOptions(options, loaders) {
|
|
5355
|
+
validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
|
|
5356
|
+
for (const loader of loaders) {
|
|
5357
|
+
const idOptions = options && options[loader.id] || {};
|
|
5358
|
+
const loaderOptions = loader.options && loader.options[loader.id] || {};
|
|
5359
|
+
const deprecatedOptions = loader.deprecatedOptions && loader.deprecatedOptions[loader.id] || {};
|
|
5360
|
+
validateOptionsObject(idOptions, loader.id, loaderOptions, deprecatedOptions, loaders);
|
|
5361
|
+
}
|
|
5362
|
+
}
|
|
5363
|
+
function validateOptionsObject(options, id, defaultOptions, deprecatedOptions, loaders) {
|
|
5364
|
+
const loaderName = id || "Top level";
|
|
5365
|
+
const prefix = id ? `${id}.` : "";
|
|
5366
|
+
for (const key in options) {
|
|
5367
|
+
const isSubOptions = !id && isObject(options[key]);
|
|
5368
|
+
const isBaseUriOption = key === "baseUri" && !id;
|
|
5369
|
+
const isWorkerUrlOption = key === "workerUrl" && id;
|
|
5370
|
+
if (!(key in defaultOptions) && !isBaseUriOption && !isWorkerUrlOption) {
|
|
5371
|
+
if (key in deprecatedOptions) {
|
|
5372
|
+
probeLog.warn(`${loaderName} loader option '${prefix}${key}' no longer supported, use '${deprecatedOptions[key]}'`)();
|
|
5373
|
+
} else if (!isSubOptions) {
|
|
5374
|
+
const suggestion = findSimilarOption(key, loaders);
|
|
5375
|
+
probeLog.warn(`${loaderName} loader option '${prefix}${key}' not recognized. ${suggestion}`)();
|
|
5929
5376
|
}
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5377
|
+
}
|
|
5378
|
+
}
|
|
5379
|
+
}
|
|
5380
|
+
function findSimilarOption(optionKey, loaders) {
|
|
5381
|
+
const lowerCaseOptionKey = optionKey.toLowerCase();
|
|
5382
|
+
let bestSuggestion = "";
|
|
5383
|
+
for (const loader of loaders) {
|
|
5384
|
+
for (const key in loader.options) {
|
|
5385
|
+
if (optionKey === key) {
|
|
5386
|
+
return `Did you mean '${loader.id}.${key}'?`;
|
|
5934
5387
|
}
|
|
5935
|
-
|
|
5936
|
-
|
|
5388
|
+
const lowerCaseKey = key.toLowerCase();
|
|
5389
|
+
const isPartialMatch = lowerCaseOptionKey.startsWith(lowerCaseKey) || lowerCaseKey.startsWith(lowerCaseOptionKey);
|
|
5390
|
+
if (isPartialMatch) {
|
|
5391
|
+
bestSuggestion = bestSuggestion || `Did you mean '${loader.id}.${key}'?`;
|
|
5937
5392
|
}
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
}
|
|
5962
|
-
|
|
5393
|
+
}
|
|
5394
|
+
}
|
|
5395
|
+
return bestSuggestion;
|
|
5396
|
+
}
|
|
5397
|
+
function normalizeOptionsInternal(loader, options, url) {
|
|
5398
|
+
const loaderDefaultOptions = loader.options || {};
|
|
5399
|
+
const mergedOptions = { ...loaderDefaultOptions };
|
|
5400
|
+
addUrlOptions(mergedOptions, url);
|
|
5401
|
+
if (mergedOptions.log === null) {
|
|
5402
|
+
mergedOptions.log = new NullLog();
|
|
5403
|
+
}
|
|
5404
|
+
mergeNestedFields(mergedOptions, getGlobalLoaderOptions());
|
|
5405
|
+
mergeNestedFields(mergedOptions, options);
|
|
5406
|
+
return mergedOptions;
|
|
5407
|
+
}
|
|
5408
|
+
function mergeNestedFields(mergedOptions, options) {
|
|
5409
|
+
for (const key in options) {
|
|
5410
|
+
if (key in options) {
|
|
5411
|
+
const value = options[key];
|
|
5412
|
+
if (isPureObject(value) && isPureObject(mergedOptions[key])) {
|
|
5413
|
+
mergedOptions[key] = {
|
|
5414
|
+
...mergedOptions[key],
|
|
5415
|
+
...options[key]
|
|
5416
|
+
};
|
|
5417
|
+
} else {
|
|
5418
|
+
mergedOptions[key] = options[key];
|
|
5963
5419
|
}
|
|
5420
|
+
}
|
|
5421
|
+
}
|
|
5422
|
+
}
|
|
5423
|
+
function addUrlOptions(options, url) {
|
|
5424
|
+
if (url && !("baseUri" in options)) {
|
|
5425
|
+
options.baseUri = url;
|
|
5426
|
+
}
|
|
5427
|
+
}
|
|
5428
|
+
var getGlobalLoaderOptions;
|
|
5429
|
+
var init_option_utils = __esm({
|
|
5430
|
+
"../core/src/lib/loader-utils/option-utils.ts"() {
|
|
5431
|
+
init_is_type();
|
|
5432
|
+
init_fetch_file();
|
|
5433
|
+
init_loggers();
|
|
5434
|
+
init_option_defaults();
|
|
5435
|
+
getGlobalLoaderOptions = () => {
|
|
5436
|
+
const state = getGlobalLoaderState();
|
|
5437
|
+
state.globalOptions = state.globalOptions || { ...DEFAULT_LOADER_OPTIONS };
|
|
5438
|
+
return state.globalOptions;
|
|
5964
5439
|
};
|
|
5965
|
-
_defineProperty(Log2, "VERSION", VERSION4);
|
|
5966
5440
|
}
|
|
5967
5441
|
});
|
|
5968
5442
|
|
|
5969
|
-
//
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5443
|
+
// ../core/src/lib/loader-utils/normalize-loader.ts
|
|
5444
|
+
function isLoaderObject(loader) {
|
|
5445
|
+
if (!loader) {
|
|
5446
|
+
return false;
|
|
5447
|
+
}
|
|
5448
|
+
if (Array.isArray(loader)) {
|
|
5449
|
+
loader = loader[0];
|
|
5450
|
+
}
|
|
5451
|
+
const hasExtensions = Array.isArray(loader?.extensions);
|
|
5452
|
+
return hasExtensions;
|
|
5453
|
+
}
|
|
5454
|
+
function normalizeLoader(loader) {
|
|
5455
|
+
assert2(loader, "null loader");
|
|
5456
|
+
assert2(isLoaderObject(loader), "invalid loader");
|
|
5457
|
+
let options;
|
|
5458
|
+
if (Array.isArray(loader)) {
|
|
5459
|
+
options = loader[1];
|
|
5460
|
+
loader = loader[0];
|
|
5461
|
+
loader = {
|
|
5462
|
+
...loader,
|
|
5463
|
+
options: { ...loader.options, ...options }
|
|
5464
|
+
};
|
|
5465
|
+
}
|
|
5466
|
+
if (loader?.parseTextSync || loader?.parseText) {
|
|
5467
|
+
loader.text = true;
|
|
5468
|
+
}
|
|
5469
|
+
if (!loader.text) {
|
|
5470
|
+
loader.binary = true;
|
|
5471
|
+
}
|
|
5472
|
+
return loader;
|
|
5473
|
+
}
|
|
5474
|
+
var init_normalize_loader = __esm({
|
|
5475
|
+
"../core/src/lib/loader-utils/normalize-loader.ts"() {
|
|
5476
|
+
init_src2();
|
|
5477
|
+
}
|
|
5478
|
+
});
|
|
5479
|
+
|
|
5480
|
+
// ../core/src/lib/api/register-loaders.ts
|
|
5481
|
+
function getRegisteredLoaders() {
|
|
5482
|
+
return getGlobalLoaderRegistry();
|
|
5483
|
+
}
|
|
5484
|
+
var getGlobalLoaderRegistry;
|
|
5485
|
+
var init_register_loaders = __esm({
|
|
5486
|
+
"../core/src/lib/api/register-loaders.ts"() {
|
|
5487
|
+
init_option_utils();
|
|
5488
|
+
getGlobalLoaderRegistry = () => {
|
|
5489
|
+
const state = getGlobalLoaderState();
|
|
5490
|
+
state.loaderRegistry = state.loaderRegistry || [];
|
|
5491
|
+
return state.loaderRegistry;
|
|
5492
|
+
};
|
|
5978
5493
|
}
|
|
5979
5494
|
});
|
|
5980
5495
|
|
|
5981
5496
|
// ../core/src/lib/utils/log.ts
|
|
5982
5497
|
var log;
|
|
5983
|
-
var
|
|
5498
|
+
var init_log2 = __esm({
|
|
5984
5499
|
"../core/src/lib/utils/log.ts"() {
|
|
5985
|
-
|
|
5986
|
-
log = new
|
|
5500
|
+
init_esm4();
|
|
5501
|
+
log = new Log({ id: "loaders.gl" });
|
|
5987
5502
|
}
|
|
5988
5503
|
});
|
|
5989
5504
|
|
|
@@ -6172,7 +5687,7 @@
|
|
|
6172
5687
|
"../core/src/lib/api/select-loader.ts"() {
|
|
6173
5688
|
init_src2();
|
|
6174
5689
|
init_normalize_loader();
|
|
6175
|
-
|
|
5690
|
+
init_log2();
|
|
6176
5691
|
init_resource_utils();
|
|
6177
5692
|
init_register_loaders();
|
|
6178
5693
|
init_is_type();
|
|
@@ -6525,10 +6040,10 @@
|
|
|
6525
6040
|
});
|
|
6526
6041
|
|
|
6527
6042
|
// src/lib/utils/version.ts
|
|
6528
|
-
var
|
|
6043
|
+
var VERSION4;
|
|
6529
6044
|
var init_version2 = __esm({
|
|
6530
6045
|
"src/lib/utils/version.ts"() {
|
|
6531
|
-
|
|
6046
|
+
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
6532
6047
|
}
|
|
6533
6048
|
});
|
|
6534
6049
|
|
|
@@ -6574,10 +6089,10 @@
|
|
|
6574
6089
|
});
|
|
6575
6090
|
|
|
6576
6091
|
// ../draco/src/lib/utils/version.ts
|
|
6577
|
-
var
|
|
6092
|
+
var VERSION5;
|
|
6578
6093
|
var init_version3 = __esm({
|
|
6579
6094
|
"../draco/src/lib/utils/version.ts"() {
|
|
6580
|
-
|
|
6095
|
+
VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
6581
6096
|
}
|
|
6582
6097
|
});
|
|
6583
6098
|
|
|
@@ -6585,6 +6100,7 @@
|
|
|
6585
6100
|
var DEFAULT_DRACO_OPTIONS, DracoLoader;
|
|
6586
6101
|
var init_draco_loader = __esm({
|
|
6587
6102
|
"../draco/src/draco-loader.ts"() {
|
|
6103
|
+
init_src();
|
|
6588
6104
|
init_version3();
|
|
6589
6105
|
DEFAULT_DRACO_OPTIONS = {
|
|
6590
6106
|
draco: {
|
|
@@ -6596,10 +6112,10 @@
|
|
|
6596
6112
|
};
|
|
6597
6113
|
DracoLoader = {
|
|
6598
6114
|
name: "Draco",
|
|
6599
|
-
id: "draco",
|
|
6115
|
+
id: isBrowser2 ? "draco" : "draco-nodejs",
|
|
6600
6116
|
module: "draco",
|
|
6601
6117
|
shapes: ["mesh"],
|
|
6602
|
-
version:
|
|
6118
|
+
version: VERSION5,
|
|
6603
6119
|
worker: true,
|
|
6604
6120
|
extensions: ["drc"],
|
|
6605
6121
|
mimeTypes: ["application/octet-stream"],
|
|
@@ -6642,12 +6158,12 @@
|
|
|
6642
6158
|
});
|
|
6643
6159
|
|
|
6644
6160
|
// ../schema/src/lib/utils/assert.ts
|
|
6645
|
-
function
|
|
6161
|
+
function assert6(condition, message) {
|
|
6646
6162
|
if (!condition) {
|
|
6647
6163
|
throw new Error(message || "loader assertion failed.");
|
|
6648
6164
|
}
|
|
6649
6165
|
}
|
|
6650
|
-
var
|
|
6166
|
+
var init_assert5 = __esm({
|
|
6651
6167
|
"../schema/src/lib/utils/assert.ts"() {
|
|
6652
6168
|
}
|
|
6653
6169
|
});
|
|
@@ -6668,10 +6184,10 @@
|
|
|
6668
6184
|
var Schema;
|
|
6669
6185
|
var init_schema = __esm({
|
|
6670
6186
|
"../schema/src/lib/schema/impl/schema.ts"() {
|
|
6671
|
-
|
|
6187
|
+
init_assert5();
|
|
6672
6188
|
Schema = class {
|
|
6673
6189
|
constructor(fields, metadata) {
|
|
6674
|
-
|
|
6190
|
+
assert6(Array.isArray(fields));
|
|
6675
6191
|
checkNames(fields);
|
|
6676
6192
|
this.fields = fields;
|
|
6677
6193
|
this.metadata = metadata || new Map();
|
|
@@ -6692,8 +6208,8 @@
|
|
|
6692
6208
|
}
|
|
6693
6209
|
select(...columnNames) {
|
|
6694
6210
|
const nameMap = Object.create(null);
|
|
6695
|
-
for (const
|
|
6696
|
-
nameMap[
|
|
6211
|
+
for (const name10 of columnNames) {
|
|
6212
|
+
nameMap[name10] = true;
|
|
6697
6213
|
}
|
|
6698
6214
|
const selectedFields = this.fields.filter((field) => nameMap[field.name]);
|
|
6699
6215
|
return new Schema(selectedFields, this.metadata);
|
|
@@ -6731,8 +6247,8 @@
|
|
|
6731
6247
|
var init_field = __esm({
|
|
6732
6248
|
"../schema/src/lib/schema/impl/field.ts"() {
|
|
6733
6249
|
Field = class {
|
|
6734
|
-
constructor(
|
|
6735
|
-
this.name =
|
|
6250
|
+
constructor(name10, type, nullable = false, metadata = new Map()) {
|
|
6251
|
+
this.name = name10;
|
|
6736
6252
|
this.type = type;
|
|
6737
6253
|
this.nullable = nullable;
|
|
6738
6254
|
this.metadata = metadata;
|
|
@@ -7617,15 +7133,17 @@
|
|
|
7617
7133
|
});
|
|
7618
7134
|
});
|
|
7619
7135
|
}
|
|
7620
|
-
var
|
|
7136
|
+
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
7137
|
var init_draco_module_loader = __esm({
|
|
7622
7138
|
"../draco/src/lib/draco-module-loader.ts"() {
|
|
7623
7139
|
init_src();
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7140
|
+
DRACO_DECODER_VERSION = "1.5.5";
|
|
7141
|
+
DRACO_ENCODER_VERSION = "1.4.1";
|
|
7142
|
+
STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
|
|
7143
|
+
DRACO_JS_DECODER_URL = `${STATIC_DECODER_URL}/draco_decoder.js`;
|
|
7144
|
+
DRACO_WASM_WRAPPER_URL = `${STATIC_DECODER_URL}/draco_wasm_wrapper.js`;
|
|
7145
|
+
DRACO_WASM_DECODER_URL = `${STATIC_DECODER_URL}/draco_decoder.wasm`;
|
|
7146
|
+
DRACO_ENCODER_URL = `https://raw.githubusercontent.com/google/draco/${DRACO_ENCODER_VERSION}/javascript/draco_encoder.js`;
|
|
7629
7147
|
}
|
|
7630
7148
|
});
|
|
7631
7149
|
|
|
@@ -7719,8 +7237,8 @@
|
|
|
7719
7237
|
}
|
|
7720
7238
|
throw new Error(ERR_TYPE_CONVERSION);
|
|
7721
7239
|
}
|
|
7722
|
-
static fromName(
|
|
7723
|
-
const glType = NAME_TO_GL_TYPE[
|
|
7240
|
+
static fromName(name10) {
|
|
7241
|
+
const glType = NAME_TO_GL_TYPE[name10];
|
|
7724
7242
|
if (!glType) {
|
|
7725
7243
|
throw new Error(ERR_TYPE_CONVERSION);
|
|
7726
7244
|
}
|
|
@@ -7759,12 +7277,12 @@
|
|
|
7759
7277
|
});
|
|
7760
7278
|
|
|
7761
7279
|
// ../math/src/geometry/utils/assert.ts
|
|
7762
|
-
function
|
|
7280
|
+
function assert7(condition, message) {
|
|
7763
7281
|
if (!condition) {
|
|
7764
7282
|
throw new Error(`math.gl assertion failed. ${message}`);
|
|
7765
7283
|
}
|
|
7766
7284
|
}
|
|
7767
|
-
var
|
|
7285
|
+
var init_assert6 = __esm({
|
|
7768
7286
|
"../math/src/geometry/utils/assert.ts"() {
|
|
7769
7287
|
}
|
|
7770
7288
|
});
|
|
@@ -7792,7 +7310,7 @@
|
|
|
7792
7310
|
return value < 0 ? -1 : 1;
|
|
7793
7311
|
}
|
|
7794
7312
|
function octDecodeInRange(x, y, rangeMax, result) {
|
|
7795
|
-
|
|
7313
|
+
assert7(result);
|
|
7796
7314
|
if (x < 0 || x > rangeMax || y < 0 || y > rangeMax) {
|
|
7797
7315
|
throw new Error(`x and y must be unsigned normalized integers between 0 and ${rangeMax}`);
|
|
7798
7316
|
}
|
|
@@ -7813,7 +7331,7 @@
|
|
|
7813
7331
|
var init_attribute_compression = __esm({
|
|
7814
7332
|
"../math/src/geometry/compression/attribute-compression.ts"() {
|
|
7815
7333
|
init_esm();
|
|
7816
|
-
|
|
7334
|
+
init_assert6();
|
|
7817
7335
|
RIGHT_SHIFT = 1 / 256;
|
|
7818
7336
|
scratchVector23 = new Vector2();
|
|
7819
7337
|
scratchVector32 = new Vector3();
|
|
@@ -8279,10 +7797,10 @@
|
|
|
8279
7797
|
}
|
|
8280
7798
|
return void 0;
|
|
8281
7799
|
}
|
|
8282
|
-
hasProperty(batchId,
|
|
7800
|
+
hasProperty(batchId, name10) {
|
|
8283
7801
|
this._checkBatchId(batchId);
|
|
8284
|
-
assert2(typeof
|
|
8285
|
-
return defined2(this._properties[
|
|
7802
|
+
assert2(typeof name10 === "string", name10);
|
|
7803
|
+
return defined2(this._properties[name10]) || this._hasPropertyInHierarchy(batchId, name10);
|
|
8286
7804
|
}
|
|
8287
7805
|
getPropertyNames(batchId, results) {
|
|
8288
7806
|
this._checkBatchId(batchId);
|
|
@@ -8295,47 +7813,47 @@
|
|
|
8295
7813
|
}
|
|
8296
7814
|
return results;
|
|
8297
7815
|
}
|
|
8298
|
-
getProperty(batchId,
|
|
7816
|
+
getProperty(batchId, name10) {
|
|
8299
7817
|
this._checkBatchId(batchId);
|
|
8300
|
-
assert2(typeof
|
|
7818
|
+
assert2(typeof name10 === "string", name10);
|
|
8301
7819
|
if (this._binaryProperties) {
|
|
8302
|
-
const binaryProperty = this._binaryProperties[
|
|
7820
|
+
const binaryProperty = this._binaryProperties[name10];
|
|
8303
7821
|
if (defined2(binaryProperty)) {
|
|
8304
7822
|
return this._getBinaryProperty(binaryProperty, batchId);
|
|
8305
7823
|
}
|
|
8306
7824
|
}
|
|
8307
|
-
const propertyValues = this._properties[
|
|
7825
|
+
const propertyValues = this._properties[name10];
|
|
8308
7826
|
if (defined2(propertyValues)) {
|
|
8309
7827
|
return clone3(propertyValues[batchId], true);
|
|
8310
7828
|
}
|
|
8311
7829
|
if (this._hierarchy) {
|
|
8312
|
-
const hierarchyProperty = this._getHierarchyProperty(batchId,
|
|
7830
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name10);
|
|
8313
7831
|
if (defined2(hierarchyProperty)) {
|
|
8314
7832
|
return hierarchyProperty;
|
|
8315
7833
|
}
|
|
8316
7834
|
}
|
|
8317
7835
|
return void 0;
|
|
8318
7836
|
}
|
|
8319
|
-
setProperty(batchId,
|
|
7837
|
+
setProperty(batchId, name10, value) {
|
|
8320
7838
|
const featureCount = this.featureCount;
|
|
8321
7839
|
this._checkBatchId(batchId);
|
|
8322
|
-
assert2(typeof
|
|
7840
|
+
assert2(typeof name10 === "string", name10);
|
|
8323
7841
|
if (this._binaryProperties) {
|
|
8324
|
-
const binaryProperty = this._binaryProperties[
|
|
7842
|
+
const binaryProperty = this._binaryProperties[name10];
|
|
8325
7843
|
if (binaryProperty) {
|
|
8326
7844
|
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
8327
7845
|
return;
|
|
8328
7846
|
}
|
|
8329
7847
|
}
|
|
8330
7848
|
if (this._hierarchy) {
|
|
8331
|
-
if (this._setHierarchyProperty(this, batchId,
|
|
7849
|
+
if (this._setHierarchyProperty(this, batchId, name10, value)) {
|
|
8332
7850
|
return;
|
|
8333
7851
|
}
|
|
8334
7852
|
}
|
|
8335
|
-
let propertyValues = this._properties[
|
|
7853
|
+
let propertyValues = this._properties[name10];
|
|
8336
7854
|
if (!defined2(propertyValues)) {
|
|
8337
|
-
this._properties[
|
|
8338
|
-
propertyValues = this._properties[
|
|
7855
|
+
this._properties[name10] = new Array(featureCount);
|
|
7856
|
+
propertyValues = this._properties[name10];
|
|
8339
7857
|
}
|
|
8340
7858
|
propertyValues[batchId] = clone3(value, true);
|
|
8341
7859
|
}
|
|
@@ -8353,21 +7871,21 @@
|
|
|
8353
7871
|
}
|
|
8354
7872
|
_initializeBinaryProperties() {
|
|
8355
7873
|
let binaryProperties = null;
|
|
8356
|
-
for (const
|
|
8357
|
-
const property = this._properties[
|
|
8358
|
-
const binaryProperty = this._initializeBinaryProperty(
|
|
7874
|
+
for (const name10 in this._properties) {
|
|
7875
|
+
const property = this._properties[name10];
|
|
7876
|
+
const binaryProperty = this._initializeBinaryProperty(name10, property);
|
|
8359
7877
|
if (binaryProperty) {
|
|
8360
7878
|
binaryProperties = binaryProperties || {};
|
|
8361
|
-
binaryProperties[
|
|
7879
|
+
binaryProperties[name10] = binaryProperty;
|
|
8362
7880
|
}
|
|
8363
7881
|
}
|
|
8364
7882
|
return binaryProperties;
|
|
8365
7883
|
}
|
|
8366
|
-
_initializeBinaryProperty(
|
|
7884
|
+
_initializeBinaryProperty(name10, property) {
|
|
8367
7885
|
if ("byteOffset" in property) {
|
|
8368
7886
|
const tile3DAccessor = property;
|
|
8369
|
-
assert2(this.binary, `Property ${
|
|
8370
|
-
assert2(tile3DAccessor.type, `Property ${
|
|
7887
|
+
assert2(this.binary, `Property ${name10} requires a batch table binary.`);
|
|
7888
|
+
assert2(tile3DAccessor.type, `Property ${name10} requires a type.`);
|
|
8371
7889
|
const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
|
|
8372
7890
|
return {
|
|
8373
7891
|
typedArray: accessor.values,
|
|
@@ -8378,14 +7896,14 @@
|
|
|
8378
7896
|
}
|
|
8379
7897
|
return null;
|
|
8380
7898
|
}
|
|
8381
|
-
_hasPropertyInHierarchy(batchId,
|
|
7899
|
+
_hasPropertyInHierarchy(batchId, name10) {
|
|
8382
7900
|
if (!this._hierarchy) {
|
|
8383
7901
|
return false;
|
|
8384
7902
|
}
|
|
8385
7903
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
8386
7904
|
const classId = hierarchy.classIds[instanceIndex];
|
|
8387
7905
|
const instances = hierarchy.classes[classId].instances;
|
|
8388
|
-
return defined2(instances[
|
|
7906
|
+
return defined2(instances[name10]);
|
|
8389
7907
|
});
|
|
8390
7908
|
return defined2(result);
|
|
8391
7909
|
}
|
|
@@ -8393,21 +7911,21 @@
|
|
|
8393
7911
|
traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
8394
7912
|
const classId = hierarchy.classIds[instanceIndex];
|
|
8395
7913
|
const instances = hierarchy.classes[classId].instances;
|
|
8396
|
-
for (const
|
|
8397
|
-
if (instances.hasOwnProperty(
|
|
8398
|
-
if (results.indexOf(
|
|
8399
|
-
results.push(
|
|
7914
|
+
for (const name10 in instances) {
|
|
7915
|
+
if (instances.hasOwnProperty(name10)) {
|
|
7916
|
+
if (results.indexOf(name10) === -1) {
|
|
7917
|
+
results.push(name10);
|
|
8400
7918
|
}
|
|
8401
7919
|
}
|
|
8402
7920
|
}
|
|
8403
7921
|
});
|
|
8404
7922
|
}
|
|
8405
|
-
_getHierarchyProperty(batchId,
|
|
7923
|
+
_getHierarchyProperty(batchId, name10) {
|
|
8406
7924
|
return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
8407
7925
|
const classId = hierarchy.classIds[instanceIndex];
|
|
8408
7926
|
const instanceClass = hierarchy.classes[classId];
|
|
8409
7927
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
8410
|
-
const propertyValues = instanceClass.instances[
|
|
7928
|
+
const propertyValues = instanceClass.instances[name10];
|
|
8411
7929
|
if (defined2(propertyValues)) {
|
|
8412
7930
|
if (defined2(propertyValues.typedArray)) {
|
|
8413
7931
|
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
@@ -8417,14 +7935,14 @@
|
|
|
8417
7935
|
return null;
|
|
8418
7936
|
});
|
|
8419
7937
|
}
|
|
8420
|
-
_setHierarchyProperty(batchTable, batchId,
|
|
7938
|
+
_setHierarchyProperty(batchTable, batchId, name10, value) {
|
|
8421
7939
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
8422
7940
|
const classId = hierarchy.classIds[instanceIndex];
|
|
8423
7941
|
const instanceClass = hierarchy.classes[classId];
|
|
8424
7942
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
8425
|
-
const propertyValues = instanceClass.instances[
|
|
7943
|
+
const propertyValues = instanceClass.instances[name10];
|
|
8426
7944
|
if (defined2(propertyValues)) {
|
|
8427
|
-
assert2(instanceIndex === batchId, `Inherited property "${
|
|
7945
|
+
assert2(instanceIndex === batchId, `Inherited property "${name10}" is read-only.`);
|
|
8428
7946
|
if (defined2(propertyValues.typedArray)) {
|
|
8429
7947
|
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
8430
7948
|
} else {
|
|
@@ -8865,18 +8383,18 @@
|
|
|
8865
8383
|
});
|
|
8866
8384
|
|
|
8867
8385
|
// ../gltf/src/lib/utils/version.ts
|
|
8868
|
-
var
|
|
8386
|
+
var VERSION6;
|
|
8869
8387
|
var init_version4 = __esm({
|
|
8870
8388
|
"../gltf/src/lib/utils/version.ts"() {
|
|
8871
|
-
|
|
8389
|
+
VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
8872
8390
|
}
|
|
8873
8391
|
});
|
|
8874
8392
|
|
|
8875
8393
|
// ../textures/src/lib/utils/version.ts
|
|
8876
|
-
var
|
|
8394
|
+
var VERSION7;
|
|
8877
8395
|
var init_version5 = __esm({
|
|
8878
8396
|
"../textures/src/lib/utils/version.ts"() {
|
|
8879
|
-
|
|
8397
|
+
VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
8880
8398
|
}
|
|
8881
8399
|
});
|
|
8882
8400
|
|
|
@@ -8905,8 +8423,8 @@
|
|
|
8905
8423
|
options.wasmBinary = wasmBinary;
|
|
8906
8424
|
}
|
|
8907
8425
|
return new Promise((resolve) => {
|
|
8908
|
-
BasisModule(options).then((
|
|
8909
|
-
const { BasisFile, initializeBasis } =
|
|
8426
|
+
BasisModule(options).then((module) => {
|
|
8427
|
+
const { BasisFile, initializeBasis } = module;
|
|
8910
8428
|
initializeBasis();
|
|
8911
8429
|
resolve({ BasisFile });
|
|
8912
8430
|
});
|
|
@@ -8936,20 +8454,20 @@
|
|
|
8936
8454
|
options.wasmBinary = wasmBinary;
|
|
8937
8455
|
}
|
|
8938
8456
|
return new Promise((resolve) => {
|
|
8939
|
-
BasisEncoderModule(options).then((
|
|
8940
|
-
const { BasisFile, KTX2File, initializeBasis, BasisEncoder } =
|
|
8457
|
+
BasisEncoderModule(options).then((module) => {
|
|
8458
|
+
const { BasisFile, KTX2File, initializeBasis, BasisEncoder } = module;
|
|
8941
8459
|
initializeBasis();
|
|
8942
8460
|
resolve({ BasisFile, KTX2File, BasisEncoder });
|
|
8943
8461
|
});
|
|
8944
8462
|
});
|
|
8945
8463
|
}
|
|
8946
|
-
var
|
|
8464
|
+
var VERSION8, BASIS_CDN_ENCODER_WASM, BASIS_CDN_ENCODER_JS, loadBasisTranscoderPromise, loadBasisEncoderPromise;
|
|
8947
8465
|
var init_basis_module_loader = __esm({
|
|
8948
8466
|
"../textures/src/lib/parsers/basis-module-loader.ts"() {
|
|
8949
8467
|
init_src();
|
|
8950
|
-
|
|
8951
|
-
BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${
|
|
8952
|
-
BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${
|
|
8468
|
+
VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
8469
|
+
BASIS_CDN_ENCODER_WASM = `https://unpkg.com/@loaders.gl/textures@${VERSION8}/dist/libs/basis_encoder.wasm`;
|
|
8470
|
+
BASIS_CDN_ENCODER_JS = `https://unpkg.com/@loaders.gl/textures@${VERSION8}/dist/libs/basis_encoder.js`;
|
|
8953
8471
|
}
|
|
8954
8472
|
});
|
|
8955
8473
|
|
|
@@ -9305,13 +8823,14 @@
|
|
|
9305
8823
|
var BasisWorkerLoader, BasisLoader;
|
|
9306
8824
|
var init_basis_loader = __esm({
|
|
9307
8825
|
"../textures/src/basis-loader.ts"() {
|
|
8826
|
+
init_src();
|
|
9308
8827
|
init_version5();
|
|
9309
8828
|
init_parse_basis();
|
|
9310
8829
|
BasisWorkerLoader = {
|
|
9311
8830
|
name: "Basis",
|
|
9312
|
-
id: "basis",
|
|
8831
|
+
id: isBrowser2 ? "basis" : "basis-nodejs",
|
|
9313
8832
|
module: "textures",
|
|
9314
|
-
version:
|
|
8833
|
+
version: VERSION7,
|
|
9315
8834
|
worker: true,
|
|
9316
8835
|
extensions: ["basis", "ktx2"],
|
|
9317
8836
|
mimeTypes: ["application/octet-stream", "image/ktx2"],
|
|
@@ -9334,10 +8853,10 @@
|
|
|
9334
8853
|
});
|
|
9335
8854
|
|
|
9336
8855
|
// ../images/src/lib/utils/version.ts
|
|
9337
|
-
var
|
|
8856
|
+
var VERSION9;
|
|
9338
8857
|
var init_version6 = __esm({
|
|
9339
8858
|
"../images/src/lib/utils/version.ts"() {
|
|
9340
|
-
|
|
8859
|
+
VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
9341
8860
|
}
|
|
9342
8861
|
});
|
|
9343
8862
|
|
|
@@ -9732,7 +9251,7 @@
|
|
|
9732
9251
|
id: "image",
|
|
9733
9252
|
module: "images",
|
|
9734
9253
|
name: "Images",
|
|
9735
|
-
version:
|
|
9254
|
+
version: VERSION9,
|
|
9736
9255
|
mimeTypes: MIME_TYPES,
|
|
9737
9256
|
extensions: EXTENSIONS,
|
|
9738
9257
|
parse: parseImage,
|
|
@@ -9801,12 +9320,12 @@
|
|
|
9801
9320
|
});
|
|
9802
9321
|
|
|
9803
9322
|
// ../gltf/src/lib/utils/assert.ts
|
|
9804
|
-
function
|
|
9323
|
+
function assert8(condition, message) {
|
|
9805
9324
|
if (!condition) {
|
|
9806
9325
|
throw new Error(message || "assert failed: gltf");
|
|
9807
9326
|
}
|
|
9808
9327
|
}
|
|
9809
|
-
var
|
|
9328
|
+
var init_assert7 = __esm({
|
|
9810
9329
|
"../gltf/src/lib/utils/assert.ts"() {
|
|
9811
9330
|
}
|
|
9812
9331
|
});
|
|
@@ -9831,16 +9350,16 @@
|
|
|
9831
9350
|
// ../gltf/src/lib/gltf-utils/get-typed-array.ts
|
|
9832
9351
|
function getTypedArrayForBufferView(json, buffers, bufferViewIndex) {
|
|
9833
9352
|
const bufferView = json.bufferViews[bufferViewIndex];
|
|
9834
|
-
|
|
9353
|
+
assert8(bufferView);
|
|
9835
9354
|
const bufferIndex = bufferView.buffer;
|
|
9836
9355
|
const binChunk = buffers[bufferIndex];
|
|
9837
|
-
|
|
9356
|
+
assert8(binChunk);
|
|
9838
9357
|
const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
|
|
9839
9358
|
return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
|
|
9840
9359
|
}
|
|
9841
9360
|
var init_get_typed_array = __esm({
|
|
9842
9361
|
"../gltf/src/lib/gltf-utils/get-typed-array.ts"() {
|
|
9843
|
-
|
|
9362
|
+
init_assert7();
|
|
9844
9363
|
}
|
|
9845
9364
|
});
|
|
9846
9365
|
|
|
@@ -9862,13 +9381,13 @@
|
|
|
9862
9381
|
const bytesPerComponent = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE[accessor.componentType];
|
|
9863
9382
|
const length4 = accessor.count * components;
|
|
9864
9383
|
const byteLength = accessor.count * components * bytesPerComponent;
|
|
9865
|
-
|
|
9384
|
+
assert8(byteLength >= 0 && byteLength <= bufferView.byteLength);
|
|
9866
9385
|
return { ArrayType, length: length4, byteLength };
|
|
9867
9386
|
}
|
|
9868
9387
|
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
9388
|
var init_gltf_utils = __esm({
|
|
9870
9389
|
"../gltf/src/lib/gltf-utils/gltf-utils.ts"() {
|
|
9871
|
-
|
|
9390
|
+
init_assert7();
|
|
9872
9391
|
TYPES = ["SCALAR", "VEC2", "VEC3", "VEC4"];
|
|
9873
9392
|
ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT = [
|
|
9874
9393
|
[Int8Array, 5120],
|
|
@@ -9914,7 +9433,7 @@
|
|
|
9914
9433
|
"../gltf/src/lib/api/gltf-scenegraph.ts"() {
|
|
9915
9434
|
init_src8();
|
|
9916
9435
|
init_src2();
|
|
9917
|
-
|
|
9436
|
+
init_assert7();
|
|
9918
9437
|
init_gltf_utils();
|
|
9919
9438
|
DEFAULT_GLTF_JSON = {
|
|
9920
9439
|
asset: {
|
|
@@ -9948,12 +9467,12 @@
|
|
|
9948
9467
|
return extras[key];
|
|
9949
9468
|
}
|
|
9950
9469
|
getExtension(extensionName) {
|
|
9951
|
-
const isExtension = this.getUsedExtensions().find((
|
|
9470
|
+
const isExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
|
|
9952
9471
|
const extensions = this.json.extensions || {};
|
|
9953
9472
|
return isExtension ? extensions[extensionName] || true : null;
|
|
9954
9473
|
}
|
|
9955
9474
|
getRequiredExtension(extensionName) {
|
|
9956
|
-
const isRequired = this.getRequiredExtensions().find((
|
|
9475
|
+
const isRequired = this.getRequiredExtensions().find((name10) => name10 === extensionName);
|
|
9957
9476
|
return isRequired ? this.getExtension(extensionName) : null;
|
|
9958
9477
|
}
|
|
9959
9478
|
getRequiredExtensions() {
|
|
@@ -9962,6 +9481,9 @@
|
|
|
9962
9481
|
getUsedExtensions() {
|
|
9963
9482
|
return this.json.extensionsUsed || [];
|
|
9964
9483
|
}
|
|
9484
|
+
getRemovedExtensions() {
|
|
9485
|
+
return this.json.extensionsRemoved || [];
|
|
9486
|
+
}
|
|
9965
9487
|
getObjectExtension(object, extensionName) {
|
|
9966
9488
|
const extensions = object.extensions || {};
|
|
9967
9489
|
return extensions[extensionName];
|
|
@@ -10013,7 +9535,7 @@
|
|
|
10013
9535
|
bufferView = this.getBufferView(bufferView);
|
|
10014
9536
|
const bufferIndex = bufferView.buffer;
|
|
10015
9537
|
const binChunk = this.gltf.buffers[bufferIndex];
|
|
10016
|
-
|
|
9538
|
+
assert8(binChunk);
|
|
10017
9539
|
const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
|
|
10018
9540
|
return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
|
|
10019
9541
|
}
|
|
@@ -10060,14 +9582,14 @@
|
|
|
10060
9582
|
return extension;
|
|
10061
9583
|
}
|
|
10062
9584
|
addExtension(extensionName, extensionData = {}) {
|
|
10063
|
-
|
|
9585
|
+
assert8(extensionData);
|
|
10064
9586
|
this.json.extensions = this.json.extensions || {};
|
|
10065
9587
|
this.json.extensions[extensionName] = extensionData;
|
|
10066
9588
|
this.registerUsedExtension(extensionName);
|
|
10067
9589
|
return extensionData;
|
|
10068
9590
|
}
|
|
10069
9591
|
addRequiredExtension(extensionName, extensionData = {}) {
|
|
10070
|
-
|
|
9592
|
+
assert8(extensionData);
|
|
10071
9593
|
this.addExtension(extensionName, extensionData);
|
|
10072
9594
|
this.registerRequiredExtension(extensionName);
|
|
10073
9595
|
return extensionData;
|
|
@@ -10086,6 +9608,9 @@
|
|
|
10086
9608
|
}
|
|
10087
9609
|
}
|
|
10088
9610
|
removeExtension(extensionName) {
|
|
9611
|
+
if (!this.getExtension(extensionName)) {
|
|
9612
|
+
return;
|
|
9613
|
+
}
|
|
10089
9614
|
if (this.json.extensionsRequired) {
|
|
10090
9615
|
this._removeStringFromArray(this.json.extensionsRequired, extensionName);
|
|
10091
9616
|
}
|
|
@@ -10095,6 +9620,13 @@
|
|
|
10095
9620
|
if (this.json.extensions) {
|
|
10096
9621
|
delete this.json.extensions[extensionName];
|
|
10097
9622
|
}
|
|
9623
|
+
if (!Array.isArray(this.json.extensionsRemoved)) {
|
|
9624
|
+
this.json.extensionsRemoved = [];
|
|
9625
|
+
}
|
|
9626
|
+
const extensionsRemoved = this.json.extensionsRemoved;
|
|
9627
|
+
if (!extensionsRemoved.includes(extensionName)) {
|
|
9628
|
+
extensionsRemoved.push(extensionName);
|
|
9629
|
+
}
|
|
10098
9630
|
}
|
|
10099
9631
|
setDefaultScene(sceneIndex) {
|
|
10100
9632
|
this.json.scene = sceneIndex;
|
|
@@ -10165,7 +9697,7 @@
|
|
|
10165
9697
|
}
|
|
10166
9698
|
addBufferView(buffer) {
|
|
10167
9699
|
const byteLength = buffer.byteLength;
|
|
10168
|
-
|
|
9700
|
+
assert8(Number.isFinite(byteLength));
|
|
10169
9701
|
this.sourceBuffers = this.sourceBuffers || [];
|
|
10170
9702
|
this.sourceBuffers.push(buffer);
|
|
10171
9703
|
const glTFBufferView = {
|
|
@@ -10607,11 +10139,11 @@
|
|
|
10607
10139
|
// ../gltf/src/lib/gltf-utils/gltf-attribute-utils.ts
|
|
10608
10140
|
function getGLTFAccessors(attributes) {
|
|
10609
10141
|
const accessors = {};
|
|
10610
|
-
for (const
|
|
10611
|
-
const attribute = attributes[
|
|
10612
|
-
if (
|
|
10142
|
+
for (const name10 in attributes) {
|
|
10143
|
+
const attribute = attributes[name10];
|
|
10144
|
+
if (name10 !== "indices") {
|
|
10613
10145
|
const glTFAccessor = getGLTFAccessor(attribute);
|
|
10614
|
-
accessors[
|
|
10146
|
+
accessors[name10] = glTFAccessor;
|
|
10615
10147
|
}
|
|
10616
10148
|
}
|
|
10617
10149
|
return accessors;
|
|
@@ -10989,7 +10521,7 @@
|
|
|
10989
10521
|
const { json } = gltfScenegraph;
|
|
10990
10522
|
if (json.lights) {
|
|
10991
10523
|
const extension = gltfScenegraph.addExtension(KHR_LIGHTS_PUNCTUAL);
|
|
10992
|
-
|
|
10524
|
+
assert8(!extension.lights);
|
|
10993
10525
|
extension.lights = json.lights;
|
|
10994
10526
|
delete json.lights;
|
|
10995
10527
|
}
|
|
@@ -11004,7 +10536,7 @@
|
|
|
11004
10536
|
var KHR_LIGHTS_PUNCTUAL, name6;
|
|
11005
10537
|
var init_KHR_lights_punctual = __esm({
|
|
11006
10538
|
"../gltf/src/lib/extensions/deprecated/KHR_lights_punctual.ts"() {
|
|
11007
|
-
|
|
10539
|
+
init_assert7();
|
|
11008
10540
|
init_gltf_scenegraph();
|
|
11009
10541
|
KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
|
|
11010
10542
|
name6 = KHR_LIGHTS_PUNCTUAL;
|
|
@@ -11021,7 +10553,6 @@
|
|
|
11021
10553
|
async function decode6(gltfData) {
|
|
11022
10554
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
11023
10555
|
const { json } = gltfScenegraph;
|
|
11024
|
-
gltfScenegraph.removeExtension(KHR_MATERIALS_UNLIT);
|
|
11025
10556
|
for (const material of json.materials || []) {
|
|
11026
10557
|
const extension = material.extensions && material.extensions.KHR_materials_unlit;
|
|
11027
10558
|
if (extension) {
|
|
@@ -11029,6 +10560,7 @@
|
|
|
11029
10560
|
}
|
|
11030
10561
|
gltfScenegraph.removeObjectExtension(material, KHR_MATERIALS_UNLIT);
|
|
11031
10562
|
}
|
|
10563
|
+
gltfScenegraph.removeExtension(KHR_MATERIALS_UNLIT);
|
|
11032
10564
|
}
|
|
11033
10565
|
function encode3(gltfData) {
|
|
11034
10566
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
@@ -11120,6 +10652,91 @@
|
|
|
11120
10652
|
}
|
|
11121
10653
|
});
|
|
11122
10654
|
|
|
10655
|
+
// ../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts
|
|
10656
|
+
var EXT_feature_metadata_exports = {};
|
|
10657
|
+
__export(EXT_feature_metadata_exports, {
|
|
10658
|
+
decode: () => decode8,
|
|
10659
|
+
name: () => name9
|
|
10660
|
+
});
|
|
10661
|
+
async function decode8(gltfData) {
|
|
10662
|
+
const scenegraph = new GLTFScenegraph(gltfData);
|
|
10663
|
+
decodeExtFeatureMetadata(scenegraph);
|
|
10664
|
+
}
|
|
10665
|
+
function decodeExtFeatureMetadata(scenegraph) {
|
|
10666
|
+
const extension = scenegraph.getExtension(EXT_FEATURE_METADATA);
|
|
10667
|
+
const schemaClasses = extension?.schema?.classes;
|
|
10668
|
+
const featureTables = extension?.featureTables;
|
|
10669
|
+
const featureTextures = extension?.featureTextures;
|
|
10670
|
+
if (featureTextures) {
|
|
10671
|
+
console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');
|
|
10672
|
+
}
|
|
10673
|
+
if (schemaClasses && featureTables) {
|
|
10674
|
+
for (const schemaName in schemaClasses) {
|
|
10675
|
+
const schemaClass = schemaClasses[schemaName];
|
|
10676
|
+
const featureTable = findFeatureTableByName(featureTables, schemaName);
|
|
10677
|
+
if (featureTable) {
|
|
10678
|
+
handleFeatureTableProperties(scenegraph, featureTable, schemaClass);
|
|
10679
|
+
}
|
|
10680
|
+
}
|
|
10681
|
+
}
|
|
10682
|
+
}
|
|
10683
|
+
function handleFeatureTableProperties(scenegraph, featureTable, schemaClass) {
|
|
10684
|
+
for (const propertyName in schemaClass.properties) {
|
|
10685
|
+
const schemaProperty = schemaClass.properties[propertyName];
|
|
10686
|
+
const featureTableProperty = featureTable?.properties?.[propertyName];
|
|
10687
|
+
const numberOfFeatures = featureTable.count;
|
|
10688
|
+
if (featureTableProperty) {
|
|
10689
|
+
const data = getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty);
|
|
10690
|
+
featureTableProperty.data = data;
|
|
10691
|
+
}
|
|
10692
|
+
}
|
|
10693
|
+
}
|
|
10694
|
+
function getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
|
|
10695
|
+
const bufferView = featureTableProperty.bufferView;
|
|
10696
|
+
let data = scenegraph.getTypedArrayForBufferView(bufferView);
|
|
10697
|
+
switch (schemaProperty.type) {
|
|
10698
|
+
case "STRING": {
|
|
10699
|
+
const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView;
|
|
10700
|
+
const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);
|
|
10701
|
+
data = getStringAttributes(data, offsetsData, numberOfFeatures);
|
|
10702
|
+
break;
|
|
10703
|
+
}
|
|
10704
|
+
default:
|
|
10705
|
+
}
|
|
10706
|
+
return data;
|
|
10707
|
+
}
|
|
10708
|
+
function findFeatureTableByName(featureTables, schemaClassName) {
|
|
10709
|
+
for (const featureTableName in featureTables) {
|
|
10710
|
+
const featureTable = featureTables[featureTableName];
|
|
10711
|
+
if (featureTable.class === schemaClassName) {
|
|
10712
|
+
return featureTable;
|
|
10713
|
+
}
|
|
10714
|
+
}
|
|
10715
|
+
return null;
|
|
10716
|
+
}
|
|
10717
|
+
function getStringAttributes(data, offsetsData, stringsCount) {
|
|
10718
|
+
const stringsArray = [];
|
|
10719
|
+
const textDecoder = new TextDecoder("utf8");
|
|
10720
|
+
let stringOffset = 0;
|
|
10721
|
+
const bytesPerStringSize = 4;
|
|
10722
|
+
for (let index = 0; index < stringsCount; index++) {
|
|
10723
|
+
const stringByteSize = offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];
|
|
10724
|
+
const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);
|
|
10725
|
+
const stringAttribute = textDecoder.decode(stringData);
|
|
10726
|
+
stringsArray.push(stringAttribute);
|
|
10727
|
+
stringOffset += stringByteSize;
|
|
10728
|
+
}
|
|
10729
|
+
return stringsArray;
|
|
10730
|
+
}
|
|
10731
|
+
var EXT_FEATURE_METADATA, name9;
|
|
10732
|
+
var init_EXT_feature_metadata = __esm({
|
|
10733
|
+
"../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts"() {
|
|
10734
|
+
init_gltf_scenegraph();
|
|
10735
|
+
EXT_FEATURE_METADATA = "EXT_feature_metadata";
|
|
10736
|
+
name9 = EXT_FEATURE_METADATA;
|
|
10737
|
+
}
|
|
10738
|
+
});
|
|
10739
|
+
|
|
11123
10740
|
// ../gltf/src/lib/api/gltf-extensions.ts
|
|
11124
10741
|
function preprocessExtensions(gltf, options = {}, context) {
|
|
11125
10742
|
const extensions = EXTENSIONS2.filter((extension) => useExtension(extension.name, options));
|
|
@@ -11149,6 +10766,7 @@
|
|
|
11149
10766
|
init_KHR_lights_punctual();
|
|
11150
10767
|
init_KHR_materials_unlit();
|
|
11151
10768
|
init_KHR_techniques_webgl();
|
|
10769
|
+
init_EXT_feature_metadata();
|
|
11152
10770
|
EXTENSIONS2 = [
|
|
11153
10771
|
EXT_meshopt_compression_exports,
|
|
11154
10772
|
EXT_texture_webp_exports,
|
|
@@ -11157,7 +10775,8 @@
|
|
|
11157
10775
|
KHR_lights_punctual_exports,
|
|
11158
10776
|
KHR_materials_unlit_exports,
|
|
11159
10777
|
KHR_techniques_webgl_exports,
|
|
11160
|
-
KHR_texture_transform_exports
|
|
10778
|
+
KHR_texture_transform_exports,
|
|
10779
|
+
EXT_feature_metadata_exports
|
|
11161
10780
|
];
|
|
11162
10781
|
}
|
|
11163
10782
|
});
|
|
@@ -11375,7 +10994,7 @@
|
|
|
11375
10994
|
metallicFactor: 1,
|
|
11376
10995
|
roughnessFactor: 1
|
|
11377
10996
|
};
|
|
11378
|
-
const textureId = material.values?.tex || material.values?.texture2d_0;
|
|
10997
|
+
const textureId = material.values?.tex || material.values?.texture2d_0 || material.values?.diffuseTex;
|
|
11379
10998
|
const textureIndex = json.textures.findIndex((texture) => texture.id === textureId);
|
|
11380
10999
|
if (textureIndex !== -1) {
|
|
11381
11000
|
material.pbrMetallicRoughness.baseColorTexture = { index: textureIndex };
|
|
@@ -11399,7 +11018,7 @@
|
|
|
11399
11018
|
var COMPONENTS2, BYTES2, GL_SAMPLER, SAMPLER_PARAMETER_GLTF_TO_GL, DEFAULT_SAMPLER, GLTFPostProcessor;
|
|
11400
11019
|
var init_post_process_gltf = __esm({
|
|
11401
11020
|
"../gltf/src/lib/api/post-process-gltf.ts"() {
|
|
11402
|
-
|
|
11021
|
+
init_assert7();
|
|
11403
11022
|
init_gltf_utils();
|
|
11404
11023
|
COMPONENTS2 = {
|
|
11405
11024
|
SCALAR: 1,
|
|
@@ -11448,7 +11067,7 @@
|
|
|
11448
11067
|
}
|
|
11449
11068
|
postProcess(gltf, options = {}) {
|
|
11450
11069
|
const { json, buffers = [], images = [], baseUri = "" } = gltf;
|
|
11451
|
-
|
|
11070
|
+
assert8(json);
|
|
11452
11071
|
this.baseUri = baseUri;
|
|
11453
11072
|
this.json = json;
|
|
11454
11073
|
this.buffers = buffers;
|
|
@@ -11852,11 +11471,11 @@
|
|
|
11852
11471
|
} else if (data instanceof ArrayBuffer) {
|
|
11853
11472
|
const glb = {};
|
|
11854
11473
|
byteOffset = parseGLBSync(glb, data, byteOffset, options.glb);
|
|
11855
|
-
|
|
11474
|
+
assert8(glb.type === "glTF", `Invalid GLB magic string ${glb.type}`);
|
|
11856
11475
|
gltf._glb = glb;
|
|
11857
11476
|
gltf.json = glb.json;
|
|
11858
11477
|
} else {
|
|
11859
|
-
|
|
11478
|
+
assert8(false, "GLTF: must be ArrayBuffer or string");
|
|
11860
11479
|
}
|
|
11861
11480
|
const buffers = gltf.json.buffers || [];
|
|
11862
11481
|
gltf.buffers = new Array(buffers.length).fill(null);
|
|
@@ -11877,7 +11496,7 @@
|
|
|
11877
11496
|
const buffer = buffers[i2];
|
|
11878
11497
|
if (buffer.uri) {
|
|
11879
11498
|
const { fetch: fetch2 } = context;
|
|
11880
|
-
|
|
11499
|
+
assert8(fetch2);
|
|
11881
11500
|
const uri = resolveUrl(buffer.uri, options);
|
|
11882
11501
|
const response = await context?.fetch?.(uri);
|
|
11883
11502
|
const arrayBuffer = await response?.arrayBuffer?.();
|
|
@@ -11918,16 +11537,19 @@
|
|
|
11918
11537
|
async function loadImage(gltf, image, index, options, context) {
|
|
11919
11538
|
const { fetch: fetch2, parse: parse5 } = context;
|
|
11920
11539
|
let arrayBuffer;
|
|
11921
|
-
if (image.uri) {
|
|
11540
|
+
if (image.uri && !image.hasOwnProperty("bufferView")) {
|
|
11922
11541
|
const uri = resolveUrl(image.uri, options);
|
|
11923
11542
|
const response = await fetch2(uri);
|
|
11924
11543
|
arrayBuffer = await response.arrayBuffer();
|
|
11544
|
+
image.bufferView = {
|
|
11545
|
+
data: arrayBuffer
|
|
11546
|
+
};
|
|
11925
11547
|
}
|
|
11926
11548
|
if (Number.isFinite(image.bufferView)) {
|
|
11927
11549
|
const array = getTypedArrayForBufferView(gltf.json, gltf.buffers, image.bufferView);
|
|
11928
11550
|
arrayBuffer = sliceArrayBuffer(array.buffer, array.byteOffset, array.byteLength);
|
|
11929
11551
|
}
|
|
11930
|
-
|
|
11552
|
+
assert8(arrayBuffer, "glTF image has no data");
|
|
11931
11553
|
let parsedImage = await parse5(arrayBuffer, [ImageLoader, BasisLoader], { mimeType: image.mimeType, basis: options.basis || { format: selectSupportedBasisFormat() } }, context);
|
|
11932
11554
|
if (parsedImage && parsedImage[0]) {
|
|
11933
11555
|
parsedImage = {
|
|
@@ -11946,7 +11568,7 @@
|
|
|
11946
11568
|
init_src9();
|
|
11947
11569
|
init_src8();
|
|
11948
11570
|
init_src2();
|
|
11949
|
-
|
|
11571
|
+
init_assert7();
|
|
11950
11572
|
init_resolve_url();
|
|
11951
11573
|
init_get_typed_array();
|
|
11952
11574
|
init_gltf_extensions();
|
|
@@ -11973,7 +11595,7 @@
|
|
|
11973
11595
|
name: "glTF",
|
|
11974
11596
|
id: "gltf",
|
|
11975
11597
|
module: "gltf",
|
|
11976
|
-
version:
|
|
11598
|
+
version: VERSION6,
|
|
11977
11599
|
extensions: ["gltf", "glb"],
|
|
11978
11600
|
mimeTypes: ["model/gltf+json", "model/gltf-binary"],
|
|
11979
11601
|
text: true,
|
|
@@ -12319,7 +11941,7 @@
|
|
|
12319
11941
|
});
|
|
12320
11942
|
|
|
12321
11943
|
// src/lib/parsers/helpers/parse-3d-tile-subtree.ts
|
|
12322
|
-
async function parse3DTilesSubtree(data) {
|
|
11944
|
+
async function parse3DTilesSubtree(data, options, context) {
|
|
12323
11945
|
const magic = new Uint32Array(data.slice(0, 4));
|
|
12324
11946
|
if (magic[0] !== SUBTREE_FILE_MAGIC) {
|
|
12325
11947
|
throw new Error("Wrong subtree file magic number");
|
|
@@ -12339,22 +11961,39 @@
|
|
|
12339
11961
|
internalBinaryBuffer = data.slice(24 + jsonByteLength);
|
|
12340
11962
|
}
|
|
12341
11963
|
if ("bufferView" in subtree.tileAvailability) {
|
|
12342
|
-
subtree.tileAvailability.explicitBitstream = await getExplicitBitstream(subtree, "tileAvailability", internalBinaryBuffer);
|
|
11964
|
+
subtree.tileAvailability.explicitBitstream = await getExplicitBitstream(subtree, "tileAvailability", internalBinaryBuffer, context);
|
|
12343
11965
|
}
|
|
12344
11966
|
if ("bufferView" in subtree.contentAvailability) {
|
|
12345
|
-
subtree.contentAvailability.explicitBitstream = await getExplicitBitstream(subtree, "contentAvailability", internalBinaryBuffer);
|
|
11967
|
+
subtree.contentAvailability.explicitBitstream = await getExplicitBitstream(subtree, "contentAvailability", internalBinaryBuffer, context);
|
|
12346
11968
|
}
|
|
12347
11969
|
if ("bufferView" in subtree.childSubtreeAvailability) {
|
|
12348
|
-
subtree.childSubtreeAvailability.explicitBitstream = await getExplicitBitstream(subtree, "childSubtreeAvailability", internalBinaryBuffer);
|
|
11970
|
+
subtree.childSubtreeAvailability.explicitBitstream = await getExplicitBitstream(subtree, "childSubtreeAvailability", internalBinaryBuffer, context);
|
|
12349
11971
|
}
|
|
12350
11972
|
return subtree;
|
|
12351
11973
|
}
|
|
12352
|
-
|
|
12353
|
-
const
|
|
11974
|
+
function resolveBufferUri(bitstreamRelativeUri, basePath) {
|
|
11975
|
+
const hasProtocol = basePath.startsWith("http");
|
|
11976
|
+
if (hasProtocol) {
|
|
11977
|
+
const resolvedUri2 = new URL(bitstreamRelativeUri, basePath);
|
|
11978
|
+
return decodeURI(resolvedUri2.toString());
|
|
11979
|
+
}
|
|
11980
|
+
const basePathWithProtocol = `http://${basePath}`;
|
|
11981
|
+
const resolvedUri = new URL(bitstreamRelativeUri, basePathWithProtocol);
|
|
11982
|
+
return `/${resolvedUri.host}${resolvedUri.pathname}`;
|
|
11983
|
+
}
|
|
11984
|
+
async function getExplicitBitstream(subtree, name10, internalBinaryBuffer, context) {
|
|
11985
|
+
const bufferViewIndex = subtree[name10].bufferView;
|
|
12354
11986
|
const bufferView = subtree.bufferViews[bufferViewIndex];
|
|
12355
11987
|
const buffer = subtree.buffers[bufferView.buffer];
|
|
11988
|
+
if (!context?.url || !context.fetch) {
|
|
11989
|
+
throw new Error("Url is not provided");
|
|
11990
|
+
}
|
|
11991
|
+
if (!context.fetch) {
|
|
11992
|
+
throw new Error("fetch is not provided");
|
|
11993
|
+
}
|
|
12356
11994
|
if (buffer.uri) {
|
|
12357
|
-
const
|
|
11995
|
+
const bufferUri = resolveBufferUri(buffer.uri, context?.url);
|
|
11996
|
+
const response = await context.fetch(bufferUri);
|
|
12358
11997
|
const data = await response.arrayBuffer();
|
|
12359
11998
|
return new Uint8Array(data, bufferView.byteOffset, bufferView.byteLength);
|
|
12360
11999
|
}
|
|
@@ -12369,7 +12008,6 @@
|
|
|
12369
12008
|
var SUBTREE_FILE_MAGIC, SUBTREE_FILE_VERSION;
|
|
12370
12009
|
var init_parse_3d_tile_subtree = __esm({
|
|
12371
12010
|
"src/lib/parsers/helpers/parse-3d-tile-subtree.ts"() {
|
|
12372
|
-
init_src3();
|
|
12373
12011
|
SUBTREE_FILE_MAGIC = 1952609651;
|
|
12374
12012
|
SUBTREE_FILE_VERSION = 1;
|
|
12375
12013
|
}
|
|
@@ -12385,7 +12023,7 @@
|
|
|
12385
12023
|
id: "3d-tiles-subtree",
|
|
12386
12024
|
name: "3D Tiles Subtree",
|
|
12387
12025
|
module: "3d-tiles",
|
|
12388
|
-
version:
|
|
12026
|
+
version: VERSION4,
|
|
12389
12027
|
extensions: ["subtree"],
|
|
12390
12028
|
mimeTypes: ["application/octet-stream"],
|
|
12391
12029
|
tests: ["subtree"],
|
|
@@ -12518,6 +12156,8 @@
|
|
|
12518
12156
|
type: getTileType2(tile),
|
|
12519
12157
|
lodMetricType,
|
|
12520
12158
|
lodMetricValue,
|
|
12159
|
+
geometricError: lodMetricValue,
|
|
12160
|
+
transform: tile.transform,
|
|
12521
12161
|
boundingVolume
|
|
12522
12162
|
};
|
|
12523
12163
|
}
|
|
@@ -12633,41 +12273,48 @@
|
|
|
12633
12273
|
tile.refine = getRefine(tile.refine);
|
|
12634
12274
|
return tile;
|
|
12635
12275
|
}
|
|
12636
|
-
function normalizeTileHeaders(tileset) {
|
|
12276
|
+
async function normalizeTileHeaders(tileset, options) {
|
|
12637
12277
|
const basePath = tileset.basePath;
|
|
12638
|
-
|
|
12278
|
+
let root;
|
|
12279
|
+
const rootImplicitTilingExtension = getImplicitTilingExtensionData(tileset?.root);
|
|
12280
|
+
if (rootImplicitTilingExtension && tileset.root) {
|
|
12281
|
+
root = await normalizeImplicitTileHeaders(tileset.root, tileset, rootImplicitTilingExtension, options);
|
|
12282
|
+
} else {
|
|
12283
|
+
root = normalizeTileData(tileset.root, tileset);
|
|
12284
|
+
}
|
|
12639
12285
|
const stack2 = [];
|
|
12640
12286
|
stack2.push(root);
|
|
12641
12287
|
while (stack2.length > 0) {
|
|
12642
12288
|
const tile = stack2.pop() || {};
|
|
12643
12289
|
const children = tile.children || [];
|
|
12644
|
-
for (
|
|
12645
|
-
|
|
12290
|
+
for (let childHeader of children) {
|
|
12291
|
+
const childImplicitTilingExtension = getImplicitTilingExtensionData(childHeader);
|
|
12292
|
+
if (childImplicitTilingExtension) {
|
|
12293
|
+
childHeader = await normalizeImplicitTileHeaders(childHeader, tileset, childImplicitTilingExtension, options);
|
|
12294
|
+
} else {
|
|
12295
|
+
normalizeTileData(childHeader, { basePath });
|
|
12296
|
+
}
|
|
12646
12297
|
stack2.push(childHeader);
|
|
12647
12298
|
}
|
|
12648
12299
|
}
|
|
12649
12300
|
return root;
|
|
12650
12301
|
}
|
|
12651
|
-
async function normalizeImplicitTileHeaders(tileset) {
|
|
12652
|
-
if (!tileset.root) {
|
|
12653
|
-
return null;
|
|
12654
|
-
}
|
|
12302
|
+
async function normalizeImplicitTileHeaders(tile, tileset, implicitTilingExtension, options) {
|
|
12655
12303
|
const basePath = tileset.basePath;
|
|
12656
|
-
const implicitTilingExtension = tileset.root.extensions["3DTILES_implicit_tiling"];
|
|
12657
12304
|
const {
|
|
12658
12305
|
subdivisionScheme,
|
|
12659
12306
|
maximumLevel,
|
|
12660
12307
|
subtreeLevels,
|
|
12661
12308
|
subtrees: { uri: subtreesUriTemplate }
|
|
12662
12309
|
} = implicitTilingExtension;
|
|
12663
|
-
const
|
|
12664
|
-
const
|
|
12665
|
-
const
|
|
12666
|
-
const contentUrlTemplate = resolveUri(
|
|
12667
|
-
const refine = tileset
|
|
12668
|
-
const rootLodMetricValue =
|
|
12669
|
-
const rootBoundingVolume =
|
|
12670
|
-
const
|
|
12310
|
+
const replacedUrlTemplate = replaceContentUrlTemplate(subtreesUriTemplate, 0, 0, 0, 0);
|
|
12311
|
+
const subtreeUrl = resolveUri(replacedUrlTemplate, basePath);
|
|
12312
|
+
const subtree = await load(subtreeUrl, Tile3DSubtreeLoader, options);
|
|
12313
|
+
const contentUrlTemplate = resolveUri(tile.content.uri, basePath);
|
|
12314
|
+
const refine = tileset?.root?.refine;
|
|
12315
|
+
const rootLodMetricValue = tile.geometricError;
|
|
12316
|
+
const rootBoundingVolume = tile.boundingVolume;
|
|
12317
|
+
const implicitOptions = {
|
|
12671
12318
|
contentUrlTemplate,
|
|
12672
12319
|
subtreesUriTemplate,
|
|
12673
12320
|
subdivisionScheme,
|
|
@@ -12681,7 +12328,7 @@
|
|
|
12681
12328
|
getTileType,
|
|
12682
12329
|
getRefine
|
|
12683
12330
|
};
|
|
12684
|
-
return await normalizeImplicitTileData(
|
|
12331
|
+
return await normalizeImplicitTileData(tile, subtree, implicitOptions);
|
|
12685
12332
|
}
|
|
12686
12333
|
async function normalizeImplicitTileData(tile, rootSubtree, options) {
|
|
12687
12334
|
if (!tile) {
|
|
@@ -12701,6 +12348,9 @@
|
|
|
12701
12348
|
tile.id = tile.contentUrl;
|
|
12702
12349
|
return tile;
|
|
12703
12350
|
}
|
|
12351
|
+
function getImplicitTilingExtensionData(tile) {
|
|
12352
|
+
return tile?.extensions?.["3DTILES_implicit_tiling"] || tile?.implicitTiling;
|
|
12353
|
+
}
|
|
12704
12354
|
var init_parse_3d_tile_header2 = __esm({
|
|
12705
12355
|
"src/lib/parsers/parse-3d-tile-header.ts"() {
|
|
12706
12356
|
init_tile_3d_subtree_loader();
|
|
@@ -12729,7 +12379,7 @@
|
|
|
12729
12379
|
tilesetJson.loader = options.loader || Tiles3DLoader;
|
|
12730
12380
|
tilesetJson.url = context.url;
|
|
12731
12381
|
tilesetJson.basePath = getBaseUri(tilesetJson);
|
|
12732
|
-
tilesetJson.root =
|
|
12382
|
+
tilesetJson.root = await normalizeTileHeaders(tilesetJson, options);
|
|
12733
12383
|
tilesetJson.type = TILESET_TYPE.TILES3D;
|
|
12734
12384
|
tilesetJson.lodMetricType = LOD_METRIC_TYPE.GEOMETRIC_ERROR;
|
|
12735
12385
|
tilesetJson.lodMetricValue = tilesetJson.root?.lodMetricValue || 0;
|
|
@@ -12750,10 +12400,7 @@
|
|
|
12750
12400
|
}
|
|
12751
12401
|
return data;
|
|
12752
12402
|
}
|
|
12753
|
-
|
|
12754
|
-
return tilesetJson?.extensionsRequired?.includes(IMPLICIT_TILING_EXTENSION_NAME) && tilesetJson?.extensionsUsed?.includes(IMPLICIT_TILING_EXTENSION_NAME);
|
|
12755
|
-
}
|
|
12756
|
-
var IMPLICIT_TILING_EXTENSION_NAME, Tiles3DLoader;
|
|
12403
|
+
var Tiles3DLoader;
|
|
12757
12404
|
var init_tiles_3d_loader = __esm({
|
|
12758
12405
|
"src/tiles-3d-loader.ts"() {
|
|
12759
12406
|
init_src2();
|
|
@@ -12761,12 +12408,11 @@
|
|
|
12761
12408
|
init_version2();
|
|
12762
12409
|
init_parse_3d_tile();
|
|
12763
12410
|
init_parse_3d_tile_header2();
|
|
12764
|
-
IMPLICIT_TILING_EXTENSION_NAME = "3DTILES_implicit_tiling";
|
|
12765
12411
|
Tiles3DLoader = {
|
|
12766
12412
|
id: "3d-tiles",
|
|
12767
12413
|
name: "3D Tiles",
|
|
12768
12414
|
module: "3d-tiles",
|
|
12769
|
-
version:
|
|
12415
|
+
version: VERSION4,
|
|
12770
12416
|
extensions: ["cmpt", "pnts", "b3dm", "i3dm"],
|
|
12771
12417
|
mimeTypes: ["application/octet-stream"],
|
|
12772
12418
|
tests: ["cmpt", "pnts", "b3dm", "i3dm"],
|
|
@@ -13086,7 +12732,7 @@
|
|
|
13086
12732
|
name: "3D Tile",
|
|
13087
12733
|
id: "3d-tiles",
|
|
13088
12734
|
module: "3d-tiles",
|
|
13089
|
-
version:
|
|
12735
|
+
version: VERSION4,
|
|
13090
12736
|
extensions: ["cmpt", "pnts", "b3dm", "i3dm"],
|
|
13091
12737
|
mimeTypes: ["application/octet-stream"],
|
|
13092
12738
|
encodeSync,
|
|
@@ -13125,10 +12771,10 @@
|
|
|
13125
12771
|
|
|
13126
12772
|
// src/bundle.ts
|
|
13127
12773
|
var require_bundle = __commonJS({
|
|
13128
|
-
"src/bundle.ts"(exports,
|
|
12774
|
+
"src/bundle.ts"(exports, module) {
|
|
13129
12775
|
var moduleExports = (init_src11(), src_exports);
|
|
13130
12776
|
globalThis.loaders = globalThis.loaders || {};
|
|
13131
|
-
|
|
12777
|
+
module.exports = Object.assign(globalThis.loaders, moduleExports);
|
|
13132
12778
|
}
|
|
13133
12779
|
});
|
|
13134
12780
|
require_bundle();
|