@loaders.gl/core 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 +224 -850
- package/dist/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/core-addons/write-file-browser.js +2 -0
- package/dist/es5/core-addons/write-file-browser.js.map +1 -1
- package/dist/es5/index.js +108 -130
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/iterators/batch-iterators/timed-batch-iterator.js +34 -69
- package/dist/es5/iterators/batch-iterators/timed-batch-iterator.js.map +1 -1
- package/dist/es5/iterators/make-iterator/make-array-buffer-iterator.js +9 -17
- package/dist/es5/iterators/make-iterator/make-array-buffer-iterator.js.map +1 -1
- package/dist/es5/iterators/make-iterator/make-blob-iterator.js +0 -11
- package/dist/es5/iterators/make-iterator/make-blob-iterator.js.map +1 -1
- package/dist/es5/iterators/make-iterator/make-iterator.js +0 -11
- package/dist/es5/iterators/make-iterator/make-iterator.js.map +1 -1
- package/dist/es5/iterators/make-iterator/make-stream-iterator.js +29 -75
- package/dist/es5/iterators/make-iterator/make-stream-iterator.js.map +1 -1
- package/dist/es5/iterators/make-iterator/make-string-iterator.js +1 -8
- package/dist/es5/iterators/make-iterator/make-string-iterator.js.map +1 -1
- package/dist/es5/iterators/make-stream/make-dom-stream.js +2 -17
- package/dist/es5/iterators/make-stream/make-dom-stream.js.map +1 -1
- package/dist/es5/iterators/make-stream/make-node-stream.js +13 -56
- package/dist/es5/iterators/make-stream/make-node-stream.js.map +1 -1
- package/dist/es5/javascript-utils/is-type.js +1 -34
- package/dist/es5/javascript-utils/is-type.js.map +1 -1
- package/dist/es5/lib/api/encode.js +42 -118
- package/dist/es5/lib/api/encode.js.map +1 -1
- package/dist/es5/lib/api/load-in-batches.js +1 -15
- package/dist/es5/lib/api/load-in-batches.js.map +1 -1
- package/dist/es5/lib/api/load.js +0 -18
- package/dist/es5/lib/api/load.js.map +1 -1
- package/dist/es5/lib/api/loader-options.js +4 -5
- package/dist/es5/lib/api/loader-options.js.map +1 -1
- package/dist/es5/lib/api/parse-in-batches.js +122 -196
- package/dist/es5/lib/api/parse-in-batches.js.map +1 -1
- package/dist/es5/lib/api/parse-sync.js +2 -16
- package/dist/es5/lib/api/parse-sync.js.map +1 -1
- package/dist/es5/lib/api/parse.js +3 -42
- package/dist/es5/lib/api/parse.js.map +1 -1
- package/dist/es5/lib/api/register-loaders.js +3 -14
- package/dist/es5/lib/api/register-loaders.js.map +1 -1
- package/dist/es5/lib/api/save.js +0 -11
- package/dist/es5/lib/api/save.js.map +1 -1
- package/dist/es5/lib/api/select-loader.js +18 -91
- package/dist/es5/lib/api/select-loader.js.map +1 -1
- package/dist/es5/lib/common.js.map +1 -1
- package/dist/es5/lib/fetch/fetch-error-message.js +1 -15
- package/dist/es5/lib/fetch/fetch-error-message.js.map +1 -1
- package/dist/es5/lib/fetch/fetch-file.js +0 -14
- package/dist/es5/lib/fetch/fetch-file.js.map +1 -1
- package/dist/es5/lib/fetch/read-array-buffer.js +0 -20
- package/dist/es5/lib/fetch/read-array-buffer.js.map +1 -1
- package/dist/es5/lib/fetch/read-file.js +0 -3
- package/dist/es5/lib/fetch/read-file.js.map +1 -1
- package/dist/es5/lib/fetch/write-file.js +0 -13
- package/dist/es5/lib/fetch/write-file.js.map +1 -1
- package/dist/es5/lib/filesystems/browser-filesystem.js +9 -55
- package/dist/es5/lib/filesystems/browser-filesystem.js.map +1 -1
- package/dist/es5/lib/filesystems/filesystem.js.map +1 -1
- package/dist/es5/lib/filesystems/read-array-buffer.js +0 -10
- package/dist/es5/lib/filesystems/read-array-buffer.js.map +1 -1
- package/dist/es5/lib/init.js +1 -4
- package/dist/es5/lib/init.js.map +1 -1
- package/dist/es5/lib/loader-utils/check-errors.js +0 -14
- package/dist/es5/lib/loader-utils/check-errors.js.map +1 -1
- package/dist/es5/lib/loader-utils/get-data.js +2 -64
- package/dist/es5/lib/loader-utils/get-data.js.map +1 -1
- package/dist/es5/lib/loader-utils/loader-context.js +2 -15
- package/dist/es5/lib/loader-utils/loader-context.js.map +1 -1
- package/dist/es5/lib/loader-utils/loggers.js +4 -22
- package/dist/es5/lib/loader-utils/loggers.js.map +1 -1
- package/dist/es5/lib/loader-utils/normalize-loader.js +4 -16
- package/dist/es5/lib/loader-utils/normalize-loader.js.map +1 -1
- package/dist/es5/lib/loader-utils/option-defaults.js +2 -3
- package/dist/es5/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/es5/lib/loader-utils/option-utils.js +10 -38
- package/dist/es5/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/es5/lib/progress/fetch-progress.js +6 -35
- package/dist/es5/lib/progress/fetch-progress.js.map +1 -1
- package/dist/es5/lib/utils/log.js +0 -1
- package/dist/es5/lib/utils/log.js.map +1 -1
- package/dist/es5/lib/utils/mime-type-utils.js +1 -4
- package/dist/es5/lib/utils/mime-type-utils.js.map +1 -1
- package/dist/es5/lib/utils/resource-utils.js +1 -11
- package/dist/es5/lib/utils/resource-utils.js.map +1 -1
- package/dist/es5/lib/utils/response-utils.js +1 -47
- package/dist/es5/lib/utils/response-utils.js.map +1 -1
- package/dist/es5/null-loader.js +32 -67
- package/dist/es5/null-loader.js.map +1 -1
- package/dist/es5/workers/null-worker.js +0 -2
- package/dist/es5/workers/null-worker.js.map +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/core-addons/write-file-browser.js.map +1 -1
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/iterators/batch-iterators/timed-batch-iterator.js +1 -3
- package/dist/esm/iterators/batch-iterators/timed-batch-iterator.js.map +1 -1
- package/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js +5 -2
- package/dist/esm/iterators/make-iterator/make-array-buffer-iterator.js.map +1 -1
- package/dist/esm/iterators/make-iterator/make-blob-iterator.js +1 -1
- package/dist/esm/iterators/make-iterator/make-blob-iterator.js.map +1 -1
- package/dist/esm/iterators/make-iterator/make-iterator.js +1 -5
- package/dist/esm/iterators/make-iterator/make-iterator.js.map +1 -1
- package/dist/esm/iterators/make-iterator/make-stream-iterator.js +1 -5
- package/dist/esm/iterators/make-iterator/make-stream-iterator.js.map +1 -1
- package/dist/esm/iterators/make-iterator/make-string-iterator.js +2 -1
- package/dist/esm/iterators/make-iterator/make-string-iterator.js.map +1 -1
- package/dist/esm/iterators/make-stream/make-dom-stream.js +3 -6
- package/dist/esm/iterators/make-stream/make-dom-stream.js.map +1 -1
- package/dist/esm/iterators/make-stream/make-node-stream.js +3 -19
- package/dist/esm/iterators/make-stream/make-node-stream.js.map +1 -1
- package/dist/esm/javascript-utils/is-type.js +4 -2
- package/dist/esm/javascript-utils/is-type.js.map +1 -1
- package/dist/esm/lib/api/encode.js +8 -15
- package/dist/esm/lib/api/encode.js.map +1 -1
- package/dist/esm/lib/api/load-in-batches.js +1 -2
- package/dist/esm/lib/api/load-in-batches.js.map +1 -1
- package/dist/esm/lib/api/load.js +2 -1
- package/dist/esm/lib/api/load.js.map +1 -1
- package/dist/esm/lib/api/loader-options.js.map +1 -1
- package/dist/esm/lib/api/parse-in-batches.js +12 -12
- package/dist/esm/lib/api/parse-in-batches.js.map +1 -1
- package/dist/esm/lib/api/parse-sync.js +3 -5
- package/dist/esm/lib/api/parse-sync.js.map +1 -1
- package/dist/esm/lib/api/parse.js +5 -5
- package/dist/esm/lib/api/parse.js.map +1 -1
- package/dist/esm/lib/api/register-loaders.js +1 -2
- package/dist/esm/lib/api/register-loaders.js.map +1 -1
- package/dist/esm/lib/api/save.js.map +1 -1
- package/dist/esm/lib/api/select-loader.js +17 -35
- package/dist/esm/lib/api/select-loader.js.map +1 -1
- package/dist/esm/lib/common.js.map +1 -1
- package/dist/esm/lib/fetch/fetch-error-message.js +0 -3
- package/dist/esm/lib/fetch/fetch-error-message.js.map +1 -1
- package/dist/esm/lib/fetch/fetch-file.js +1 -3
- package/dist/esm/lib/fetch/fetch-file.js.map +1 -1
- package/dist/esm/lib/fetch/read-array-buffer.js +3 -6
- package/dist/esm/lib/fetch/read-array-buffer.js.map +1 -1
- package/dist/esm/lib/fetch/read-file.js +4 -2
- package/dist/esm/lib/fetch/read-file.js.map +1 -1
- package/dist/esm/lib/fetch/write-file.js +1 -4
- package/dist/esm/lib/fetch/write-file.js.map +1 -1
- package/dist/esm/lib/filesystems/browser-filesystem.js +6 -19
- package/dist/esm/lib/filesystems/browser-filesystem.js.map +1 -1
- package/dist/esm/lib/filesystems/filesystem.js.map +1 -1
- package/dist/esm/lib/filesystems/read-array-buffer.js +2 -1
- package/dist/esm/lib/filesystems/read-array-buffer.js.map +1 -1
- package/dist/esm/lib/init.js +3 -2
- package/dist/esm/lib/init.js.map +1 -1
- package/dist/esm/lib/loader-utils/check-errors.js +2 -5
- package/dist/esm/lib/loader-utils/check-errors.js.map +1 -1
- package/dist/esm/lib/loader-utils/get-data.js +3 -23
- package/dist/esm/lib/loader-utils/get-data.js.map +1 -1
- package/dist/esm/lib/loader-utils/loader-context.js +4 -6
- package/dist/esm/lib/loader-utils/loader-context.js.map +1 -1
- package/dist/esm/lib/loader-utils/loggers.js +19 -14
- package/dist/esm/lib/loader-utils/loggers.js.map +1 -1
- package/dist/esm/lib/loader-utils/normalize-loader.js +6 -9
- package/dist/esm/lib/loader-utils/normalize-loader.js.map +1 -1
- package/dist/esm/lib/loader-utils/option-defaults.js +2 -0
- package/dist/esm/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/esm/lib/loader-utils/option-utils.js +14 -14
- package/dist/esm/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/esm/lib/progress/fetch-progress.js +5 -10
- package/dist/esm/lib/progress/fetch-progress.js.map +1 -1
- package/dist/esm/lib/utils/log.js +1 -0
- package/dist/esm/lib/utils/log.js.map +1 -1
- package/dist/esm/lib/utils/mime-type-utils.js +4 -4
- package/dist/esm/lib/utils/mime-type-utils.js.map +1 -1
- package/dist/esm/lib/utils/resource-utils.js +2 -7
- package/dist/esm/lib/utils/resource-utils.js.map +1 -1
- package/dist/esm/lib/utils/response-utils.js +5 -18
- package/dist/esm/lib/utils/response-utils.js.map +1 -1
- package/dist/esm/null-loader.js +2 -1
- package/dist/esm/null-loader.js.map +1 -1
- package/dist/esm/workers/null-worker.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/iterators/make-iterator/make-iterator.d.ts +1 -1
- package/dist/iterators/make-iterator/make-iterator.d.ts.map +1 -1
- package/dist/iterators/make-iterator/make-stream-iterator.d.ts +1 -1
- package/dist/iterators/make-iterator/make-stream-iterator.d.ts.map +1 -1
- package/dist/iterators/make-stream/make-dom-stream.d.ts +1 -1
- package/dist/iterators/make-stream/make-dom-stream.d.ts.map +1 -1
- package/dist/iterators/make-stream/make-dom-stream.js +1 -1
- package/dist/iterators/make-stream/make-node-stream.d.ts +8 -3
- package/dist/iterators/make-stream/make-node-stream.d.ts.map +1 -1
- package/dist/iterators/make-stream/make-node-stream.js +28 -2
- package/dist/javascript-utils/is-type.d.ts +1 -1
- package/dist/javascript-utils/is-type.d.ts.map +1 -1
- package/dist/lib/api/load-in-batches.d.ts +1 -1
- package/dist/lib/api/load-in-batches.d.ts.map +1 -1
- package/dist/lib/api/register-loaders.d.ts +1 -1
- package/dist/lib/api/register-loaders.d.ts.map +1 -1
- package/dist/lib/fetch/fetch-file.js +1 -1
- package/dist/lib/filesystems/browser-filesystem.d.ts +1 -1
- package/dist/lib/filesystems/browser-filesystem.d.ts.map +1 -1
- package/dist/lib/filesystems/filesystem.d.ts +2 -2
- package/dist/lib/filesystems/filesystem.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.d.ts +2 -1
- package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.js +2 -2
- package/dist/lib/loader-utils/option-utils.d.ts +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/null-worker.js +1 -1
- package/package.json +6 -7
- package/src/index.ts +17 -0
- package/src/iterators/make-stream/make-dom-stream.ts +1 -1
- package/src/iterators/make-stream/make-node-stream.ts +8 -2
- package/src/lib/api/register-loaders.ts +1 -1
- package/src/lib/loader-utils/loggers.ts +1 -1
package/dist/dist.min.js
CHANGED
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
for (var name in all)
|
|
18
18
|
__defProp(target, name, { get: all[name], 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
|
});
|
|
@@ -232,6 +234,22 @@
|
|
|
232
234
|
}
|
|
233
235
|
return false;
|
|
234
236
|
}
|
|
237
|
+
function getTransferListForWriter(object) {
|
|
238
|
+
if (object === null) {
|
|
239
|
+
return {};
|
|
240
|
+
}
|
|
241
|
+
const clone = Object.assign({}, object);
|
|
242
|
+
Object.keys(clone).forEach((key) => {
|
|
243
|
+
if (typeof object[key] === "object" && !ArrayBuffer.isView(object[key]) && !(object[key] instanceof Array)) {
|
|
244
|
+
clone[key] = getTransferListForWriter(object[key]);
|
|
245
|
+
} else if (typeof clone[key] === "function" || clone[key] instanceof RegExp) {
|
|
246
|
+
clone[key] = {};
|
|
247
|
+
} else {
|
|
248
|
+
clone[key] = object[key];
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
return clone;
|
|
252
|
+
}
|
|
235
253
|
var init_get_transfer_list = __esm({
|
|
236
254
|
"../worker-utils/src/lib/worker-utils/get-transfer-list.ts"() {
|
|
237
255
|
}
|
|
@@ -262,7 +280,7 @@
|
|
|
262
280
|
this.worker = isBrowser2 ? this._createBrowserWorker() : this._createNodeWorker();
|
|
263
281
|
}
|
|
264
282
|
static isSupported() {
|
|
265
|
-
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !==
|
|
283
|
+
return typeof Worker !== "undefined" && isBrowser2 || typeof Worker2 !== "undefined" && !isBrowser2;
|
|
266
284
|
}
|
|
267
285
|
destroy() {
|
|
268
286
|
this.onMessage = NOOP;
|
|
@@ -510,31 +528,6 @@
|
|
|
510
528
|
}
|
|
511
529
|
});
|
|
512
530
|
|
|
513
|
-
// ../worker-utils/src/lib/worker-utils/remove-nontransferable-options.ts
|
|
514
|
-
function removeNontransferableOptions(object) {
|
|
515
|
-
return JSON.parse(stringifyJSON(object));
|
|
516
|
-
}
|
|
517
|
-
function stringifyJSON(v) {
|
|
518
|
-
const cache3 = new Set();
|
|
519
|
-
return JSON.stringify(v, (key, value) => {
|
|
520
|
-
if (typeof value === "object" && value !== null) {
|
|
521
|
-
if (cache3.has(value)) {
|
|
522
|
-
try {
|
|
523
|
-
return JSON.parse(JSON.stringify(value));
|
|
524
|
-
} catch (err) {
|
|
525
|
-
return void 0;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
cache3.add(value);
|
|
529
|
-
}
|
|
530
|
-
return value;
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
var init_remove_nontransferable_options = __esm({
|
|
534
|
-
"../worker-utils/src/lib/worker-utils/remove-nontransferable-options.ts"() {
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
|
|
538
531
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
539
532
|
function getWorkerName(worker) {
|
|
540
533
|
const warning = worker.version !== VERSION2 ? ` (worker-utils@${VERSION2})` : "";
|
|
@@ -583,7 +576,7 @@
|
|
|
583
576
|
const workerPool = workerFarm.getWorkerPool(workerPoolProps);
|
|
584
577
|
const jobName = options.jobName || worker.name;
|
|
585
578
|
const job = await workerPool.startJob(jobName, onMessage.bind(null, context));
|
|
586
|
-
const transferableOptions =
|
|
579
|
+
const transferableOptions = getTransferListForWriter(options);
|
|
587
580
|
job.postMessage("process", { input: data, options: transferableOptions });
|
|
588
581
|
const result = await job.result;
|
|
589
582
|
return result.result;
|
|
@@ -617,8 +610,8 @@
|
|
|
617
610
|
var init_process_on_worker = __esm({
|
|
618
611
|
"../worker-utils/src/lib/worker-api/process-on-worker.ts"() {
|
|
619
612
|
init_worker_farm();
|
|
620
|
-
init_remove_nontransferable_options();
|
|
621
613
|
init_get_worker_url();
|
|
614
|
+
init_get_transfer_list();
|
|
622
615
|
}
|
|
623
616
|
});
|
|
624
617
|
|
|
@@ -1591,7 +1584,7 @@
|
|
|
1591
1584
|
}
|
|
1592
1585
|
});
|
|
1593
1586
|
|
|
1594
|
-
// ../../node_modules
|
|
1587
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
|
|
1595
1588
|
function isElectron(mockUserAgent) {
|
|
1596
1589
|
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
1597
1590
|
return true;
|
|
@@ -1607,25 +1600,25 @@
|
|
|
1607
1600
|
return false;
|
|
1608
1601
|
}
|
|
1609
1602
|
var init_is_electron = __esm({
|
|
1610
|
-
"../../node_modules
|
|
1603
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
1611
1604
|
}
|
|
1612
1605
|
});
|
|
1613
1606
|
|
|
1614
|
-
// ../../node_modules
|
|
1607
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
|
|
1615
1608
|
function isBrowser3() {
|
|
1616
1609
|
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
1617
1610
|
return !isNode || isElectron();
|
|
1618
1611
|
}
|
|
1619
1612
|
var init_is_browser = __esm({
|
|
1620
|
-
"../../node_modules
|
|
1613
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
1621
1614
|
init_is_electron();
|
|
1622
1615
|
}
|
|
1623
1616
|
});
|
|
1624
1617
|
|
|
1625
|
-
// ../../node_modules
|
|
1626
|
-
var globals3, self_3, window_3,
|
|
1618
|
+
// ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
|
|
1619
|
+
var globals3, self_3, window_3, document_3, process_;
|
|
1627
1620
|
var init_globals3 = __esm({
|
|
1628
|
-
"../../node_modules
|
|
1621
|
+
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
1629
1622
|
globals3 = {
|
|
1630
1623
|
self: typeof self !== "undefined" && self,
|
|
1631
1624
|
window: typeof window !== "undefined" && window,
|
|
@@ -1635,24 +1628,31 @@
|
|
|
1635
1628
|
};
|
|
1636
1629
|
self_3 = globals3.self || globals3.window || globals3.global;
|
|
1637
1630
|
window_3 = globals3.window || globals3.self || globals3.global;
|
|
1638
|
-
global_3 = globals3.global || globals3.self || globals3.window;
|
|
1639
1631
|
document_3 = globals3.document || {};
|
|
1640
1632
|
process_ = globals3.process || {};
|
|
1641
1633
|
}
|
|
1642
1634
|
});
|
|
1643
1635
|
|
|
1644
|
-
// ../../node_modules
|
|
1636
|
+
// ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
|
|
1645
1637
|
var VERSION4, isBrowser4;
|
|
1646
1638
|
var init_globals4 = __esm({
|
|
1647
|
-
"../../node_modules
|
|
1639
|
+
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
1648
1640
|
init_is_browser();
|
|
1649
|
-
init_globals3();
|
|
1650
1641
|
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
1651
1642
|
isBrowser4 = isBrowser3();
|
|
1652
1643
|
}
|
|
1653
1644
|
});
|
|
1654
1645
|
|
|
1655
|
-
// ../../node_modules
|
|
1646
|
+
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
1647
|
+
var init_esm2 = __esm({
|
|
1648
|
+
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
1649
|
+
init_globals4();
|
|
1650
|
+
init_globals3();
|
|
1651
|
+
init_is_browser();
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1654
|
+
|
|
1655
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
|
|
1656
1656
|
function getStorage(type) {
|
|
1657
1657
|
try {
|
|
1658
1658
|
const storage = window[type];
|
|
@@ -1666,9 +1666,15 @@
|
|
|
1666
1666
|
}
|
|
1667
1667
|
var LocalStorage;
|
|
1668
1668
|
var init_local_storage = __esm({
|
|
1669
|
-
"../../node_modules
|
|
1669
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
1670
|
+
init_defineProperty();
|
|
1670
1671
|
LocalStorage = class {
|
|
1671
|
-
constructor(id
|
|
1672
|
+
constructor(id) {
|
|
1673
|
+
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1674
|
+
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
1675
|
+
_defineProperty(this, "storage", void 0);
|
|
1676
|
+
_defineProperty(this, "id", void 0);
|
|
1677
|
+
_defineProperty(this, "config", {});
|
|
1672
1678
|
this.storage = getStorage(type);
|
|
1673
1679
|
this.id = id;
|
|
1674
1680
|
this.config = {};
|
|
@@ -1703,7 +1709,7 @@
|
|
|
1703
1709
|
}
|
|
1704
1710
|
});
|
|
1705
1711
|
|
|
1706
|
-
// ../../node_modules
|
|
1712
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
1707
1713
|
function formatTime(ms) {
|
|
1708
1714
|
let formatted;
|
|
1709
1715
|
if (ms < 10) {
|
|
@@ -1717,11 +1723,13 @@
|
|
|
1717
1723
|
}
|
|
1718
1724
|
return formatted;
|
|
1719
1725
|
}
|
|
1720
|
-
function leftPad(string
|
|
1726
|
+
function leftPad(string) {
|
|
1727
|
+
let length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
1721
1728
|
const padLength = Math.max(length - string.length, 0);
|
|
1722
1729
|
return "".concat(" ".repeat(padLength)).concat(string);
|
|
1723
1730
|
}
|
|
1724
|
-
function formatImage(image, message, scale
|
|
1731
|
+
function formatImage(image, message, scale) {
|
|
1732
|
+
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
1725
1733
|
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
1726
1734
|
if (image.width > maxWidth) {
|
|
1727
1735
|
scale = Math.min(scale, maxWidth / image.width);
|
|
@@ -1732,16 +1740,16 @@
|
|
|
1732
1740
|
return ["".concat(message, " %c+"), style];
|
|
1733
1741
|
}
|
|
1734
1742
|
var init_formatters = __esm({
|
|
1735
|
-
"../../node_modules
|
|
1743
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
1736
1744
|
}
|
|
1737
1745
|
});
|
|
1738
1746
|
|
|
1739
|
-
// ../../node_modules
|
|
1747
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
1740
1748
|
function getColor(color) {
|
|
1741
1749
|
return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
|
|
1742
1750
|
}
|
|
1743
1751
|
function addColor(string, color, background) {
|
|
1744
|
-
if (!
|
|
1752
|
+
if (!isBrowser3 && typeof string === "string") {
|
|
1745
1753
|
if (color) {
|
|
1746
1754
|
color = getColor(color);
|
|
1747
1755
|
string = "[".concat(color, "m").concat(string, "[39m");
|
|
@@ -1755,31 +1763,32 @@
|
|
|
1755
1763
|
}
|
|
1756
1764
|
var COLOR;
|
|
1757
1765
|
var init_color = __esm({
|
|
1758
|
-
"../../node_modules
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
BLACK
|
|
1762
|
-
RED
|
|
1763
|
-
GREEN
|
|
1764
|
-
YELLOW
|
|
1765
|
-
BLUE
|
|
1766
|
-
MAGENTA
|
|
1767
|
-
CYAN
|
|
1768
|
-
WHITE
|
|
1769
|
-
BRIGHT_BLACK
|
|
1770
|
-
BRIGHT_RED
|
|
1771
|
-
BRIGHT_GREEN
|
|
1772
|
-
BRIGHT_YELLOW
|
|
1773
|
-
BRIGHT_BLUE
|
|
1774
|
-
BRIGHT_MAGENTA
|
|
1775
|
-
BRIGHT_CYAN
|
|
1776
|
-
BRIGHT_WHITE
|
|
1777
|
-
};
|
|
1766
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
1767
|
+
init_esm2();
|
|
1768
|
+
(function(COLOR2) {
|
|
1769
|
+
COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
|
|
1770
|
+
COLOR2[COLOR2["RED"] = 31] = "RED";
|
|
1771
|
+
COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
|
|
1772
|
+
COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
|
|
1773
|
+
COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
|
|
1774
|
+
COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
|
|
1775
|
+
COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
|
|
1776
|
+
COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
|
|
1777
|
+
COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
1778
|
+
COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
1779
|
+
COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
1780
|
+
COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
1781
|
+
COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
1782
|
+
COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
1783
|
+
COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
1784
|
+
COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
1785
|
+
})(COLOR || (COLOR = {}));
|
|
1778
1786
|
}
|
|
1779
1787
|
});
|
|
1780
1788
|
|
|
1781
|
-
// ../../node_modules
|
|
1782
|
-
function autobind(obj
|
|
1789
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
1790
|
+
function autobind(obj) {
|
|
1791
|
+
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
1783
1792
|
const proto = Object.getPrototypeOf(obj);
|
|
1784
1793
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
1785
1794
|
for (const key of propNames) {
|
|
@@ -1791,28 +1800,30 @@
|
|
|
1791
1800
|
}
|
|
1792
1801
|
}
|
|
1793
1802
|
var init_autobind = __esm({
|
|
1794
|
-
"../../node_modules
|
|
1803
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
1795
1804
|
}
|
|
1796
1805
|
});
|
|
1797
1806
|
|
|
1798
|
-
// ../../node_modules
|
|
1807
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
1799
1808
|
function assert3(condition, message) {
|
|
1800
1809
|
if (!condition) {
|
|
1801
1810
|
throw new Error(message || "Assertion failed");
|
|
1802
1811
|
}
|
|
1803
1812
|
}
|
|
1804
1813
|
var init_assert3 = __esm({
|
|
1805
|
-
"../../node_modules
|
|
1814
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
1806
1815
|
}
|
|
1807
1816
|
});
|
|
1808
1817
|
|
|
1809
|
-
// ../../node_modules
|
|
1818
|
+
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
1810
1819
|
function getHiResTimestamp2() {
|
|
1811
1820
|
let timestamp;
|
|
1812
|
-
if (
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1821
|
+
if (isBrowser3 && "performance" in window_3) {
|
|
1822
|
+
var _window$performance, _window$performance$n;
|
|
1823
|
+
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);
|
|
1824
|
+
} else if ("hrtime" in process_) {
|
|
1825
|
+
var _process$hrtime;
|
|
1826
|
+
const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
|
|
1816
1827
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
1817
1828
|
} else {
|
|
1818
1829
|
timestamp = Date.now();
|
|
@@ -1820,21 +1831,19 @@
|
|
|
1820
1831
|
return timestamp;
|
|
1821
1832
|
}
|
|
1822
1833
|
var init_hi_res_timestamp2 = __esm({
|
|
1823
|
-
"../../node_modules
|
|
1824
|
-
|
|
1834
|
+
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
1835
|
+
init_esm2();
|
|
1825
1836
|
}
|
|
1826
1837
|
});
|
|
1827
1838
|
|
|
1828
|
-
//
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
function getTableHeader(table) {
|
|
1832
|
-
for (const key in table) {
|
|
1833
|
-
for (const title in table[key]) {
|
|
1834
|
-
return title || "untitled";
|
|
1835
|
-
}
|
|
1839
|
+
// (disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image
|
|
1840
|
+
var init_node_asciify_image = __esm({
|
|
1841
|
+
"(disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image"() {
|
|
1836
1842
|
}
|
|
1837
|
-
|
|
1843
|
+
});
|
|
1844
|
+
|
|
1845
|
+
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
1846
|
+
function noop() {
|
|
1838
1847
|
}
|
|
1839
1848
|
function normalizeLogLevel(logLevel) {
|
|
1840
1849
|
if (!logLevel) {
|
|
@@ -1863,7 +1872,6 @@
|
|
|
1863
1872
|
const args = opts.args ? Array.from(opts.args) : [];
|
|
1864
1873
|
while (args.length && args.shift() !== message) {
|
|
1865
1874
|
}
|
|
1866
|
-
opts.args = args;
|
|
1867
1875
|
switch (typeof logLevel) {
|
|
1868
1876
|
case "string":
|
|
1869
1877
|
case "function":
|
|
@@ -1882,7 +1890,9 @@
|
|
|
1882
1890
|
}
|
|
1883
1891
|
const messageType = typeof opts.message;
|
|
1884
1892
|
assert3(messageType === "string" || messageType === "object");
|
|
1885
|
-
return Object.assign(opts,
|
|
1893
|
+
return Object.assign(opts, {
|
|
1894
|
+
args
|
|
1895
|
+
}, opts.opts);
|
|
1886
1896
|
}
|
|
1887
1897
|
function decorateMessage(id, message, opts) {
|
|
1888
1898
|
if (typeof message === "string") {
|
|
@@ -1892,29 +1902,25 @@
|
|
|
1892
1902
|
}
|
|
1893
1903
|
return message;
|
|
1894
1904
|
}
|
|
1895
|
-
function logImageInNode({
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
return () => asciify(image, {
|
|
1907
|
-
fit: "box",
|
|
1908
|
-
width: "".concat(Math.round(80 * scale), "%")
|
|
1909
|
-
}).then((data) => console.log(data));
|
|
1910
|
-
}
|
|
1905
|
+
function logImageInNode(_ref2) {
|
|
1906
|
+
let {
|
|
1907
|
+
image,
|
|
1908
|
+
message = "",
|
|
1909
|
+
scale = 1
|
|
1910
|
+
} = _ref2;
|
|
1911
|
+
asciify.nodeAsciifyImage({
|
|
1912
|
+
image,
|
|
1913
|
+
message,
|
|
1914
|
+
scale
|
|
1915
|
+
});
|
|
1911
1916
|
return noop;
|
|
1912
1917
|
}
|
|
1913
|
-
function logImageInBrowser({
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
+
function logImageInBrowser(_ref3) {
|
|
1919
|
+
let {
|
|
1920
|
+
image,
|
|
1921
|
+
message = "",
|
|
1922
|
+
scale = 1
|
|
1923
|
+
} = _ref3;
|
|
1918
1924
|
if (typeof image === "string") {
|
|
1919
1925
|
const img = new Image();
|
|
1920
1926
|
img.onload = () => {
|
|
@@ -1937,18 +1943,28 @@
|
|
|
1937
1943
|
}
|
|
1938
1944
|
return noop;
|
|
1939
1945
|
}
|
|
1946
|
+
function getTableHeader(table) {
|
|
1947
|
+
for (const key in table) {
|
|
1948
|
+
for (const title in table[key]) {
|
|
1949
|
+
return title || "untitled";
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
return "empty";
|
|
1953
|
+
}
|
|
1940
1954
|
var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
|
|
1941
1955
|
var init_log = __esm({
|
|
1942
|
-
"../../node_modules
|
|
1943
|
-
|
|
1956
|
+
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
1957
|
+
init_defineProperty();
|
|
1958
|
+
init_esm2();
|
|
1944
1959
|
init_local_storage();
|
|
1945
1960
|
init_formatters();
|
|
1946
1961
|
init_color();
|
|
1947
1962
|
init_autobind();
|
|
1948
1963
|
init_assert3();
|
|
1949
1964
|
init_hi_res_timestamp2();
|
|
1965
|
+
init_node_asciify_image();
|
|
1950
1966
|
originalConsole = {
|
|
1951
|
-
debug:
|
|
1967
|
+
debug: isBrowser3 ? console.debug || console.log : console.log,
|
|
1952
1968
|
log: console.log,
|
|
1953
1969
|
info: console.info,
|
|
1954
1970
|
warn: console.warn,
|
|
@@ -1963,16 +1979,20 @@
|
|
|
1963
1979
|
once: true
|
|
1964
1980
|
};
|
|
1965
1981
|
Log = class {
|
|
1966
|
-
constructor({
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1982
|
+
constructor() {
|
|
1983
|
+
let {
|
|
1984
|
+
id
|
|
1985
|
+
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
1986
|
+
id: ""
|
|
1987
|
+
};
|
|
1988
|
+
_defineProperty(this, "id", void 0);
|
|
1989
|
+
_defineProperty(this, "VERSION", VERSION4);
|
|
1990
|
+
_defineProperty(this, "_startTs", getHiResTimestamp2());
|
|
1991
|
+
_defineProperty(this, "_deltaTs", getHiResTimestamp2());
|
|
1992
|
+
_defineProperty(this, "_storage", void 0);
|
|
1993
|
+
_defineProperty(this, "userData", {});
|
|
1994
|
+
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
1971
1995
|
this.id = id;
|
|
1972
|
-
this.VERSION = VERSION4;
|
|
1973
|
-
this._startTs = getHiResTimestamp2();
|
|
1974
|
-
this._deltaTs = getHiResTimestamp2();
|
|
1975
|
-
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
1976
1996
|
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
1977
1997
|
this.userData = {};
|
|
1978
1998
|
this.timeStamp("".concat(this.id, " started"));
|
|
@@ -2006,7 +2026,8 @@
|
|
|
2006
2026
|
getPriority() {
|
|
2007
2027
|
return this.level;
|
|
2008
2028
|
}
|
|
2009
|
-
enable(
|
|
2029
|
+
enable() {
|
|
2030
|
+
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
2010
2031
|
this._storage.updateConfiguration({
|
|
2011
2032
|
enabled
|
|
2012
2033
|
});
|
|
@@ -2018,6 +2039,21 @@
|
|
|
2018
2039
|
});
|
|
2019
2040
|
return this;
|
|
2020
2041
|
}
|
|
2042
|
+
get(setting) {
|
|
2043
|
+
return this._storage.config[setting];
|
|
2044
|
+
}
|
|
2045
|
+
set(setting, value) {
|
|
2046
|
+
this._storage.updateConfiguration({
|
|
2047
|
+
[setting]: value
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
settings() {
|
|
2051
|
+
if (console.table) {
|
|
2052
|
+
console.table(this._storage.config);
|
|
2053
|
+
} else {
|
|
2054
|
+
console.log(this._storage.config);
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2021
2057
|
assert(condition, message) {
|
|
2022
2058
|
assert3(condition, message);
|
|
2023
2059
|
}
|
|
@@ -2046,6 +2082,9 @@
|
|
|
2046
2082
|
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
2047
2083
|
}
|
|
2048
2084
|
once(logLevel, message) {
|
|
2085
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
2086
|
+
args[_key - 2] = arguments[_key];
|
|
2087
|
+
}
|
|
2049
2088
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
2050
2089
|
}
|
|
2051
2090
|
table(logLevel, table, columns) {
|
|
@@ -2056,17 +2095,18 @@
|
|
|
2056
2095
|
}
|
|
2057
2096
|
return noop;
|
|
2058
2097
|
}
|
|
2059
|
-
image({
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2098
|
+
image(_ref) {
|
|
2099
|
+
let {
|
|
2100
|
+
logLevel,
|
|
2101
|
+
priority,
|
|
2102
|
+
image,
|
|
2103
|
+
message = "",
|
|
2104
|
+
scale = 1
|
|
2105
|
+
} = _ref;
|
|
2066
2106
|
if (!this._shouldLog(logLevel || priority)) {
|
|
2067
2107
|
return noop;
|
|
2068
2108
|
}
|
|
2069
|
-
return
|
|
2109
|
+
return isBrowser3 ? logImageInBrowser({
|
|
2070
2110
|
image,
|
|
2071
2111
|
message,
|
|
2072
2112
|
scale
|
|
@@ -2076,21 +2116,6 @@
|
|
|
2076
2116
|
scale
|
|
2077
2117
|
});
|
|
2078
2118
|
}
|
|
2079
|
-
settings() {
|
|
2080
|
-
if (console.table) {
|
|
2081
|
-
console.table(this._storage.config);
|
|
2082
|
-
} else {
|
|
2083
|
-
console.log(this._storage.config);
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
get(setting) {
|
|
2087
|
-
return this._storage.config[setting];
|
|
2088
|
-
}
|
|
2089
|
-
set(setting, value) {
|
|
2090
|
-
this._storage.updateConfiguration({
|
|
2091
|
-
[setting]: value
|
|
2092
|
-
});
|
|
2093
|
-
}
|
|
2094
2119
|
time(logLevel, message) {
|
|
2095
2120
|
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
2096
2121
|
}
|
|
@@ -2100,10 +2125,11 @@
|
|
|
2100
2125
|
timeStamp(logLevel, message) {
|
|
2101
2126
|
return this._getLogFunction(logLevel, message, console.timeStamp || noop);
|
|
2102
2127
|
}
|
|
2103
|
-
group(logLevel, message
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2128
|
+
group(logLevel, message) {
|
|
2129
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
2130
|
+
collapsed: false
|
|
2131
|
+
};
|
|
2132
|
+
const options = normalizeArguments({
|
|
2107
2133
|
logLevel,
|
|
2108
2134
|
message,
|
|
2109
2135
|
opts
|
|
@@ -2111,10 +2137,11 @@
|
|
|
2111
2137
|
const {
|
|
2112
2138
|
collapsed
|
|
2113
2139
|
} = opts;
|
|
2114
|
-
|
|
2115
|
-
return this._getLogFunction(
|
|
2140
|
+
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
2141
|
+
return this._getLogFunction(options);
|
|
2116
2142
|
}
|
|
2117
|
-
groupCollapsed(logLevel, message
|
|
2143
|
+
groupCollapsed(logLevel, message) {
|
|
2144
|
+
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2118
2145
|
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
2119
2146
|
collapsed: true
|
|
2120
2147
|
}));
|
|
@@ -2138,7 +2165,7 @@
|
|
|
2138
2165
|
_shouldLog(logLevel) {
|
|
2139
2166
|
return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
|
|
2140
2167
|
}
|
|
2141
|
-
_getLogFunction(logLevel, message, method, args
|
|
2168
|
+
_getLogFunction(logLevel, message, method, args, opts) {
|
|
2142
2169
|
if (this._shouldLog(logLevel)) {
|
|
2143
2170
|
opts = normalizeArguments({
|
|
2144
2171
|
logLevel,
|
|
@@ -2165,48 +2192,18 @@
|
|
|
2165
2192
|
return noop;
|
|
2166
2193
|
}
|
|
2167
2194
|
};
|
|
2168
|
-
Log
|
|
2169
|
-
}
|
|
2170
|
-
});
|
|
2171
|
-
|
|
2172
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
|
|
2173
|
-
var init_hi_res_timestamp3 = __esm({
|
|
2174
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
|
|
2175
|
-
}
|
|
2176
|
-
});
|
|
2177
|
-
|
|
2178
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js
|
|
2179
|
-
var init_stat2 = __esm({
|
|
2180
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
|
|
2181
|
-
init_hi_res_timestamp3();
|
|
2182
|
-
}
|
|
2183
|
-
});
|
|
2184
|
-
|
|
2185
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js
|
|
2186
|
-
var init_stats2 = __esm({
|
|
2187
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
|
|
2188
|
-
init_stat2();
|
|
2189
|
-
}
|
|
2190
|
-
});
|
|
2191
|
-
|
|
2192
|
-
// ../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js
|
|
2193
|
-
var init_esm2 = __esm({
|
|
2194
|
-
"../../node_modules/probe.gl/node_modules/@probe.gl/stats/dist/esm/index.js"() {
|
|
2195
|
-
init_stats2();
|
|
2196
|
-
init_stat2();
|
|
2197
|
-
init_hi_res_timestamp3();
|
|
2195
|
+
_defineProperty(Log, "VERSION", VERSION4);
|
|
2198
2196
|
}
|
|
2199
2197
|
});
|
|
2200
2198
|
|
|
2201
|
-
// ../../node_modules
|
|
2199
|
+
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
2202
2200
|
var esm_default;
|
|
2203
2201
|
var init_esm3 = __esm({
|
|
2204
|
-
"../../node_modules
|
|
2202
|
+
"../../node_modules/@probe.gl/log/dist/esm/index.js"() {
|
|
2205
2203
|
init_log();
|
|
2206
2204
|
init_log();
|
|
2207
|
-
init_esm2();
|
|
2208
2205
|
esm_default = new Log({
|
|
2209
|
-
id: "probe.gl"
|
|
2206
|
+
id: "@probe.gl/log"
|
|
2210
2207
|
});
|
|
2211
2208
|
}
|
|
2212
2209
|
});
|
|
@@ -2497,658 +2494,35 @@
|
|
|
2497
2494
|
}
|
|
2498
2495
|
});
|
|
2499
2496
|
|
|
2500
|
-
//
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
return true;
|
|
2507
|
-
}
|
|
2508
|
-
const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
|
|
2509
|
-
const userAgent = mockUserAgent || realUserAgent;
|
|
2510
|
-
if (userAgent && userAgent.indexOf("Electron") >= 0) {
|
|
2511
|
-
return true;
|
|
2512
|
-
}
|
|
2513
|
-
return false;
|
|
2514
|
-
}
|
|
2515
|
-
var init_is_electron2 = __esm({
|
|
2516
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
|
|
2497
|
+
// src/lib/utils/log.ts
|
|
2498
|
+
var log;
|
|
2499
|
+
var init_log2 = __esm({
|
|
2500
|
+
"src/lib/utils/log.ts"() {
|
|
2501
|
+
init_esm3();
|
|
2502
|
+
log = new Log({ id: "loaders.gl" });
|
|
2517
2503
|
}
|
|
2518
2504
|
});
|
|
2519
2505
|
|
|
2520
|
-
//
|
|
2521
|
-
function
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
}
|
|
2525
|
-
var init_is_browser2 = __esm({
|
|
2526
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
|
|
2527
|
-
init_is_electron2();
|
|
2506
|
+
// src/lib/api/select-loader.ts
|
|
2507
|
+
async function selectLoader(data, loaders = [], options, context) {
|
|
2508
|
+
if (!validHTTPResponse(data)) {
|
|
2509
|
+
return null;
|
|
2528
2510
|
}
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
var globals4, self_4, window_4, document_4, process_2;
|
|
2533
|
-
var init_globals5 = __esm({
|
|
2534
|
-
"../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
|
|
2535
|
-
globals4 = {
|
|
2536
|
-
self: typeof self !== "undefined" && self,
|
|
2537
|
-
window: typeof window !== "undefined" && window,
|
|
2538
|
-
global: typeof global !== "undefined" && global,
|
|
2539
|
-
document: typeof document !== "undefined" && document,
|
|
2540
|
-
process: typeof process === "object" && process
|
|
2541
|
-
};
|
|
2542
|
-
self_4 = globals4.self || globals4.window || globals4.global;
|
|
2543
|
-
window_4 = globals4.window || globals4.self || globals4.global;
|
|
2544
|
-
document_4 = globals4.document || {};
|
|
2545
|
-
process_2 = globals4.process || {};
|
|
2511
|
+
let loader = selectLoaderSync(data, loaders, { ...options, nothrow: true }, context);
|
|
2512
|
+
if (loader) {
|
|
2513
|
+
return loader;
|
|
2546
2514
|
}
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
var VERSION5, isBrowser6;
|
|
2551
|
-
var init_globals6 = __esm({
|
|
2552
|
-
"../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
|
|
2553
|
-
init_is_browser2();
|
|
2554
|
-
VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
2555
|
-
isBrowser6 = isBrowser5();
|
|
2515
|
+
if (isBlob(data)) {
|
|
2516
|
+
data = await data.slice(0, 10).arrayBuffer();
|
|
2517
|
+
loader = selectLoaderSync(data, loaders, options, context);
|
|
2556
2518
|
}
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
// ../../node_modules/@probe.gl/env/dist/esm/index.js
|
|
2560
|
-
var init_esm4 = __esm({
|
|
2561
|
-
"../../node_modules/@probe.gl/env/dist/esm/index.js"() {
|
|
2562
|
-
init_globals6();
|
|
2563
|
-
init_globals5();
|
|
2564
|
-
init_is_browser2();
|
|
2519
|
+
if (!loader && !options?.nothrow) {
|
|
2520
|
+
throw new Error(getNoValidLoaderMessage(data));
|
|
2565
2521
|
}
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
try {
|
|
2571
|
-
const storage = window[type];
|
|
2572
|
-
const x = "__storage_test__";
|
|
2573
|
-
storage.setItem(x, x);
|
|
2574
|
-
storage.removeItem(x);
|
|
2575
|
-
return storage;
|
|
2576
|
-
} catch (e) {
|
|
2577
|
-
return null;
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2580
|
-
var LocalStorage2;
|
|
2581
|
-
var init_local_storage2 = __esm({
|
|
2582
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
|
|
2583
|
-
init_defineProperty();
|
|
2584
|
-
LocalStorage2 = class {
|
|
2585
|
-
constructor(id) {
|
|
2586
|
-
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2587
|
-
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
2588
|
-
_defineProperty(this, "storage", void 0);
|
|
2589
|
-
_defineProperty(this, "id", void 0);
|
|
2590
|
-
_defineProperty(this, "config", {});
|
|
2591
|
-
this.storage = getStorage2(type);
|
|
2592
|
-
this.id = id;
|
|
2593
|
-
this.config = {};
|
|
2594
|
-
Object.assign(this.config, defaultSettings);
|
|
2595
|
-
this._loadConfiguration();
|
|
2596
|
-
}
|
|
2597
|
-
getConfiguration() {
|
|
2598
|
-
return this.config;
|
|
2599
|
-
}
|
|
2600
|
-
setConfiguration(configuration) {
|
|
2601
|
-
this.config = {};
|
|
2602
|
-
return this.updateConfiguration(configuration);
|
|
2603
|
-
}
|
|
2604
|
-
updateConfiguration(configuration) {
|
|
2605
|
-
Object.assign(this.config, configuration);
|
|
2606
|
-
if (this.storage) {
|
|
2607
|
-
const serialized = JSON.stringify(this.config);
|
|
2608
|
-
this.storage.setItem(this.id, serialized);
|
|
2609
|
-
}
|
|
2610
|
-
return this;
|
|
2611
|
-
}
|
|
2612
|
-
_loadConfiguration() {
|
|
2613
|
-
let configuration = {};
|
|
2614
|
-
if (this.storage) {
|
|
2615
|
-
const serializedConfiguration = this.storage.getItem(this.id);
|
|
2616
|
-
configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
|
|
2617
|
-
}
|
|
2618
|
-
Object.assign(this.config, configuration);
|
|
2619
|
-
return this;
|
|
2620
|
-
}
|
|
2621
|
-
};
|
|
2622
|
-
}
|
|
2623
|
-
});
|
|
2624
|
-
|
|
2625
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
|
|
2626
|
-
function formatTime2(ms) {
|
|
2627
|
-
let formatted;
|
|
2628
|
-
if (ms < 10) {
|
|
2629
|
-
formatted = "".concat(ms.toFixed(2), "ms");
|
|
2630
|
-
} else if (ms < 100) {
|
|
2631
|
-
formatted = "".concat(ms.toFixed(1), "ms");
|
|
2632
|
-
} else if (ms < 1e3) {
|
|
2633
|
-
formatted = "".concat(ms.toFixed(0), "ms");
|
|
2634
|
-
} else {
|
|
2635
|
-
formatted = "".concat((ms / 1e3).toFixed(2), "s");
|
|
2636
|
-
}
|
|
2637
|
-
return formatted;
|
|
2638
|
-
}
|
|
2639
|
-
function leftPad2(string) {
|
|
2640
|
-
let length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 8;
|
|
2641
|
-
const padLength = Math.max(length - string.length, 0);
|
|
2642
|
-
return "".concat(" ".repeat(padLength)).concat(string);
|
|
2643
|
-
}
|
|
2644
|
-
function formatImage2(image, message, scale) {
|
|
2645
|
-
let maxWidth = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 600;
|
|
2646
|
-
const imageUrl = image.src.replace(/\(/g, "%28").replace(/\)/g, "%29");
|
|
2647
|
-
if (image.width > maxWidth) {
|
|
2648
|
-
scale = Math.min(scale, maxWidth / image.width);
|
|
2649
|
-
}
|
|
2650
|
-
const width = image.width * scale;
|
|
2651
|
-
const height = image.height * scale;
|
|
2652
|
-
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("");
|
|
2653
|
-
return ["".concat(message, " %c+"), style];
|
|
2654
|
-
}
|
|
2655
|
-
var init_formatters2 = __esm({
|
|
2656
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
|
|
2657
|
-
}
|
|
2658
|
-
});
|
|
2659
|
-
|
|
2660
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
|
|
2661
|
-
function getColor2(color) {
|
|
2662
|
-
return typeof color === "string" ? COLOR2[color.toUpperCase()] || COLOR2.WHITE : color;
|
|
2663
|
-
}
|
|
2664
|
-
function addColor2(string, color, background) {
|
|
2665
|
-
if (!isBrowser5 && typeof string === "string") {
|
|
2666
|
-
if (color) {
|
|
2667
|
-
color = getColor2(color);
|
|
2668
|
-
string = "[".concat(color, "m").concat(string, "[39m");
|
|
2669
|
-
}
|
|
2670
|
-
if (background) {
|
|
2671
|
-
color = getColor2(background);
|
|
2672
|
-
string = "[".concat(background + 10, "m").concat(string, "[49m");
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
return string;
|
|
2676
|
-
}
|
|
2677
|
-
var COLOR2;
|
|
2678
|
-
var init_color2 = __esm({
|
|
2679
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
|
|
2680
|
-
init_esm4();
|
|
2681
|
-
(function(COLOR3) {
|
|
2682
|
-
COLOR3[COLOR3["BLACK"] = 30] = "BLACK";
|
|
2683
|
-
COLOR3[COLOR3["RED"] = 31] = "RED";
|
|
2684
|
-
COLOR3[COLOR3["GREEN"] = 32] = "GREEN";
|
|
2685
|
-
COLOR3[COLOR3["YELLOW"] = 33] = "YELLOW";
|
|
2686
|
-
COLOR3[COLOR3["BLUE"] = 34] = "BLUE";
|
|
2687
|
-
COLOR3[COLOR3["MAGENTA"] = 35] = "MAGENTA";
|
|
2688
|
-
COLOR3[COLOR3["CYAN"] = 36] = "CYAN";
|
|
2689
|
-
COLOR3[COLOR3["WHITE"] = 37] = "WHITE";
|
|
2690
|
-
COLOR3[COLOR3["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
2691
|
-
COLOR3[COLOR3["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
2692
|
-
COLOR3[COLOR3["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
2693
|
-
COLOR3[COLOR3["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
2694
|
-
COLOR3[COLOR3["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
2695
|
-
COLOR3[COLOR3["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
2696
|
-
COLOR3[COLOR3["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
2697
|
-
COLOR3[COLOR3["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
2698
|
-
})(COLOR2 || (COLOR2 = {}));
|
|
2699
|
-
}
|
|
2700
|
-
});
|
|
2701
|
-
|
|
2702
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
|
|
2703
|
-
function autobind2(obj) {
|
|
2704
|
-
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
2705
|
-
const proto = Object.getPrototypeOf(obj);
|
|
2706
|
-
const propNames = Object.getOwnPropertyNames(proto);
|
|
2707
|
-
for (const key of propNames) {
|
|
2708
|
-
if (typeof obj[key] === "function") {
|
|
2709
|
-
if (!predefined.find((name) => key === name)) {
|
|
2710
|
-
obj[key] = obj[key].bind(obj);
|
|
2711
|
-
}
|
|
2712
|
-
}
|
|
2713
|
-
}
|
|
2714
|
-
}
|
|
2715
|
-
var init_autobind2 = __esm({
|
|
2716
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
|
|
2717
|
-
}
|
|
2718
|
-
});
|
|
2719
|
-
|
|
2720
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
|
|
2721
|
-
function assert4(condition, message) {
|
|
2722
|
-
if (!condition) {
|
|
2723
|
-
throw new Error(message || "Assertion failed");
|
|
2724
|
-
}
|
|
2725
|
-
}
|
|
2726
|
-
var init_assert4 = __esm({
|
|
2727
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
|
|
2728
|
-
}
|
|
2729
|
-
});
|
|
2730
|
-
|
|
2731
|
-
// ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
|
|
2732
|
-
function getHiResTimestamp4() {
|
|
2733
|
-
let timestamp;
|
|
2734
|
-
if (isBrowser5 && "performance" in window_4) {
|
|
2735
|
-
var _window$performance, _window$performance$n;
|
|
2736
|
-
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);
|
|
2737
|
-
} else if ("hrtime" in process_2) {
|
|
2738
|
-
var _process$hrtime;
|
|
2739
|
-
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);
|
|
2740
|
-
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
2741
|
-
} else {
|
|
2742
|
-
timestamp = Date.now();
|
|
2743
|
-
}
|
|
2744
|
-
return timestamp;
|
|
2745
|
-
}
|
|
2746
|
-
var init_hi_res_timestamp4 = __esm({
|
|
2747
|
-
"../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
|
|
2748
|
-
init_esm4();
|
|
2749
|
-
}
|
|
2750
|
-
});
|
|
2751
|
-
|
|
2752
|
-
// ../../node_modules/@probe.gl/log/dist/esm/log.js
|
|
2753
|
-
function noop2() {
|
|
2754
|
-
}
|
|
2755
|
-
function normalizeLogLevel2(logLevel) {
|
|
2756
|
-
if (!logLevel) {
|
|
2757
|
-
return 0;
|
|
2758
|
-
}
|
|
2759
|
-
let resolvedLevel;
|
|
2760
|
-
switch (typeof logLevel) {
|
|
2761
|
-
case "number":
|
|
2762
|
-
resolvedLevel = logLevel;
|
|
2763
|
-
break;
|
|
2764
|
-
case "object":
|
|
2765
|
-
resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
|
|
2766
|
-
break;
|
|
2767
|
-
default:
|
|
2768
|
-
return 0;
|
|
2769
|
-
}
|
|
2770
|
-
assert4(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
|
|
2771
|
-
return resolvedLevel;
|
|
2772
|
-
}
|
|
2773
|
-
function normalizeArguments2(opts) {
|
|
2774
|
-
const {
|
|
2775
|
-
logLevel,
|
|
2776
|
-
message
|
|
2777
|
-
} = opts;
|
|
2778
|
-
opts.logLevel = normalizeLogLevel2(logLevel);
|
|
2779
|
-
const args = opts.args ? Array.from(opts.args) : [];
|
|
2780
|
-
while (args.length && args.shift() !== message) {
|
|
2781
|
-
}
|
|
2782
|
-
switch (typeof logLevel) {
|
|
2783
|
-
case "string":
|
|
2784
|
-
case "function":
|
|
2785
|
-
if (message !== void 0) {
|
|
2786
|
-
args.unshift(message);
|
|
2787
|
-
}
|
|
2788
|
-
opts.message = logLevel;
|
|
2789
|
-
break;
|
|
2790
|
-
case "object":
|
|
2791
|
-
Object.assign(opts, logLevel);
|
|
2792
|
-
break;
|
|
2793
|
-
default:
|
|
2794
|
-
}
|
|
2795
|
-
if (typeof opts.message === "function") {
|
|
2796
|
-
opts.message = opts.message();
|
|
2797
|
-
}
|
|
2798
|
-
const messageType = typeof opts.message;
|
|
2799
|
-
assert4(messageType === "string" || messageType === "object");
|
|
2800
|
-
return Object.assign(opts, {
|
|
2801
|
-
args
|
|
2802
|
-
}, opts.opts);
|
|
2803
|
-
}
|
|
2804
|
-
function decorateMessage2(id, message, opts) {
|
|
2805
|
-
if (typeof message === "string") {
|
|
2806
|
-
const time = opts.time ? leftPad2(formatTime2(opts.total)) : "";
|
|
2807
|
-
message = opts.time ? "".concat(id, ": ").concat(time, " ").concat(message) : "".concat(id, ": ").concat(message);
|
|
2808
|
-
message = addColor2(message, opts.color, opts.background);
|
|
2809
|
-
}
|
|
2810
|
-
return message;
|
|
2811
|
-
}
|
|
2812
|
-
function logImageInNode2(_ref2) {
|
|
2813
|
-
let {
|
|
2814
|
-
image,
|
|
2815
|
-
message = "",
|
|
2816
|
-
scale = 1
|
|
2817
|
-
} = _ref2;
|
|
2818
|
-
let asciify = null;
|
|
2819
|
-
try {
|
|
2820
|
-
asciify = module.require("asciify-image");
|
|
2821
|
-
} catch (error) {
|
|
2822
|
-
}
|
|
2823
|
-
if (asciify) {
|
|
2824
|
-
return () => asciify(image, {
|
|
2825
|
-
fit: "box",
|
|
2826
|
-
width: "".concat(Math.round(80 * scale), "%")
|
|
2827
|
-
}).then((data) => console.log(data));
|
|
2828
|
-
}
|
|
2829
|
-
return noop2;
|
|
2830
|
-
}
|
|
2831
|
-
function logImageInBrowser2(_ref3) {
|
|
2832
|
-
let {
|
|
2833
|
-
image,
|
|
2834
|
-
message = "",
|
|
2835
|
-
scale = 1
|
|
2836
|
-
} = _ref3;
|
|
2837
|
-
if (typeof image === "string") {
|
|
2838
|
-
const img = new Image();
|
|
2839
|
-
img.onload = () => {
|
|
2840
|
-
const args = formatImage2(img, message, scale);
|
|
2841
|
-
console.log(...args);
|
|
2842
|
-
};
|
|
2843
|
-
img.src = image;
|
|
2844
|
-
return noop2;
|
|
2845
|
-
}
|
|
2846
|
-
const element = image.nodeName || "";
|
|
2847
|
-
if (element.toLowerCase() === "img") {
|
|
2848
|
-
console.log(...formatImage2(image, message, scale));
|
|
2849
|
-
return noop2;
|
|
2850
|
-
}
|
|
2851
|
-
if (element.toLowerCase() === "canvas") {
|
|
2852
|
-
const img = new Image();
|
|
2853
|
-
img.onload = () => console.log(...formatImage2(img, message, scale));
|
|
2854
|
-
img.src = image.toDataURL();
|
|
2855
|
-
return noop2;
|
|
2856
|
-
}
|
|
2857
|
-
return noop2;
|
|
2858
|
-
}
|
|
2859
|
-
function getTableHeader2(table) {
|
|
2860
|
-
for (const key in table) {
|
|
2861
|
-
for (const title in table[key]) {
|
|
2862
|
-
return title || "untitled";
|
|
2863
|
-
}
|
|
2864
|
-
}
|
|
2865
|
-
return "empty";
|
|
2866
|
-
}
|
|
2867
|
-
var originalConsole2, DEFAULT_SETTINGS2, cache2, ONCE2, Log2;
|
|
2868
|
-
var init_log2 = __esm({
|
|
2869
|
-
"../../node_modules/@probe.gl/log/dist/esm/log.js"() {
|
|
2870
|
-
init_defineProperty();
|
|
2871
|
-
init_esm4();
|
|
2872
|
-
init_local_storage2();
|
|
2873
|
-
init_formatters2();
|
|
2874
|
-
init_color2();
|
|
2875
|
-
init_autobind2();
|
|
2876
|
-
init_assert4();
|
|
2877
|
-
init_hi_res_timestamp4();
|
|
2878
|
-
originalConsole2 = {
|
|
2879
|
-
debug: isBrowser5 ? console.debug || console.log : console.log,
|
|
2880
|
-
log: console.log,
|
|
2881
|
-
info: console.info,
|
|
2882
|
-
warn: console.warn,
|
|
2883
|
-
error: console.error
|
|
2884
|
-
};
|
|
2885
|
-
DEFAULT_SETTINGS2 = {
|
|
2886
|
-
enabled: true,
|
|
2887
|
-
level: 0
|
|
2888
|
-
};
|
|
2889
|
-
cache2 = {};
|
|
2890
|
-
ONCE2 = {
|
|
2891
|
-
once: true
|
|
2892
|
-
};
|
|
2893
|
-
Log2 = class {
|
|
2894
|
-
constructor() {
|
|
2895
|
-
let {
|
|
2896
|
-
id
|
|
2897
|
-
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
2898
|
-
id: ""
|
|
2899
|
-
};
|
|
2900
|
-
_defineProperty(this, "id", void 0);
|
|
2901
|
-
_defineProperty(this, "VERSION", VERSION5);
|
|
2902
|
-
_defineProperty(this, "_startTs", getHiResTimestamp4());
|
|
2903
|
-
_defineProperty(this, "_deltaTs", getHiResTimestamp4());
|
|
2904
|
-
_defineProperty(this, "_storage", void 0);
|
|
2905
|
-
_defineProperty(this, "userData", {});
|
|
2906
|
-
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
2907
|
-
this.id = id;
|
|
2908
|
-
this._storage = new LocalStorage2("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS2);
|
|
2909
|
-
this.userData = {};
|
|
2910
|
-
this.timeStamp("".concat(this.id, " started"));
|
|
2911
|
-
autobind2(this);
|
|
2912
|
-
Object.seal(this);
|
|
2913
|
-
}
|
|
2914
|
-
set level(newLevel) {
|
|
2915
|
-
this.setLevel(newLevel);
|
|
2916
|
-
}
|
|
2917
|
-
get level() {
|
|
2918
|
-
return this.getLevel();
|
|
2919
|
-
}
|
|
2920
|
-
isEnabled() {
|
|
2921
|
-
return this._storage.config.enabled;
|
|
2922
|
-
}
|
|
2923
|
-
getLevel() {
|
|
2924
|
-
return this._storage.config.level;
|
|
2925
|
-
}
|
|
2926
|
-
getTotal() {
|
|
2927
|
-
return Number((getHiResTimestamp4() - this._startTs).toPrecision(10));
|
|
2928
|
-
}
|
|
2929
|
-
getDelta() {
|
|
2930
|
-
return Number((getHiResTimestamp4() - this._deltaTs).toPrecision(10));
|
|
2931
|
-
}
|
|
2932
|
-
set priority(newPriority) {
|
|
2933
|
-
this.level = newPriority;
|
|
2934
|
-
}
|
|
2935
|
-
get priority() {
|
|
2936
|
-
return this.level;
|
|
2937
|
-
}
|
|
2938
|
-
getPriority() {
|
|
2939
|
-
return this.level;
|
|
2940
|
-
}
|
|
2941
|
-
enable() {
|
|
2942
|
-
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
2943
|
-
this._storage.updateConfiguration({
|
|
2944
|
-
enabled
|
|
2945
|
-
});
|
|
2946
|
-
return this;
|
|
2947
|
-
}
|
|
2948
|
-
setLevel(level) {
|
|
2949
|
-
this._storage.updateConfiguration({
|
|
2950
|
-
level
|
|
2951
|
-
});
|
|
2952
|
-
return this;
|
|
2953
|
-
}
|
|
2954
|
-
get(setting) {
|
|
2955
|
-
return this._storage.config[setting];
|
|
2956
|
-
}
|
|
2957
|
-
set(setting, value) {
|
|
2958
|
-
this._storage.updateConfiguration({
|
|
2959
|
-
[setting]: value
|
|
2960
|
-
});
|
|
2961
|
-
}
|
|
2962
|
-
settings() {
|
|
2963
|
-
if (console.table) {
|
|
2964
|
-
console.table(this._storage.config);
|
|
2965
|
-
} else {
|
|
2966
|
-
console.log(this._storage.config);
|
|
2967
|
-
}
|
|
2968
|
-
}
|
|
2969
|
-
assert(condition, message) {
|
|
2970
|
-
assert4(condition, message);
|
|
2971
|
-
}
|
|
2972
|
-
warn(message) {
|
|
2973
|
-
return this._getLogFunction(0, message, originalConsole2.warn, arguments, ONCE2);
|
|
2974
|
-
}
|
|
2975
|
-
error(message) {
|
|
2976
|
-
return this._getLogFunction(0, message, originalConsole2.error, arguments);
|
|
2977
|
-
}
|
|
2978
|
-
deprecated(oldUsage, newUsage) {
|
|
2979
|
-
return this.warn("`".concat(oldUsage, "` is deprecated and will be removed in a later version. Use `").concat(newUsage, "` instead"));
|
|
2980
|
-
}
|
|
2981
|
-
removed(oldUsage, newUsage) {
|
|
2982
|
-
return this.error("`".concat(oldUsage, "` has been removed. Use `").concat(newUsage, "` instead"));
|
|
2983
|
-
}
|
|
2984
|
-
probe(logLevel, message) {
|
|
2985
|
-
return this._getLogFunction(logLevel, message, originalConsole2.log, arguments, {
|
|
2986
|
-
time: true,
|
|
2987
|
-
once: true
|
|
2988
|
-
});
|
|
2989
|
-
}
|
|
2990
|
-
log(logLevel, message) {
|
|
2991
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug, arguments);
|
|
2992
|
-
}
|
|
2993
|
-
info(logLevel, message) {
|
|
2994
|
-
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
2995
|
-
}
|
|
2996
|
-
once(logLevel, message) {
|
|
2997
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
2998
|
-
args[_key - 2] = arguments[_key];
|
|
2999
|
-
}
|
|
3000
|
-
return this._getLogFunction(logLevel, message, originalConsole2.debug || originalConsole2.info, arguments, ONCE2);
|
|
3001
|
-
}
|
|
3002
|
-
table(logLevel, table, columns) {
|
|
3003
|
-
if (table) {
|
|
3004
|
-
return this._getLogFunction(logLevel, table, console.table || noop2, columns && [columns], {
|
|
3005
|
-
tag: getTableHeader2(table)
|
|
3006
|
-
});
|
|
3007
|
-
}
|
|
3008
|
-
return noop2;
|
|
3009
|
-
}
|
|
3010
|
-
image(_ref) {
|
|
3011
|
-
let {
|
|
3012
|
-
logLevel,
|
|
3013
|
-
priority,
|
|
3014
|
-
image,
|
|
3015
|
-
message = "",
|
|
3016
|
-
scale = 1
|
|
3017
|
-
} = _ref;
|
|
3018
|
-
if (!this._shouldLog(logLevel || priority)) {
|
|
3019
|
-
return noop2;
|
|
3020
|
-
}
|
|
3021
|
-
return isBrowser5 ? logImageInBrowser2({
|
|
3022
|
-
image,
|
|
3023
|
-
message,
|
|
3024
|
-
scale
|
|
3025
|
-
}) : logImageInNode2({
|
|
3026
|
-
image,
|
|
3027
|
-
message,
|
|
3028
|
-
scale
|
|
3029
|
-
});
|
|
3030
|
-
}
|
|
3031
|
-
time(logLevel, message) {
|
|
3032
|
-
return this._getLogFunction(logLevel, message, console.time ? console.time : console.info);
|
|
3033
|
-
}
|
|
3034
|
-
timeEnd(logLevel, message) {
|
|
3035
|
-
return this._getLogFunction(logLevel, message, console.timeEnd ? console.timeEnd : console.info);
|
|
3036
|
-
}
|
|
3037
|
-
timeStamp(logLevel, message) {
|
|
3038
|
-
return this._getLogFunction(logLevel, message, console.timeStamp || noop2);
|
|
3039
|
-
}
|
|
3040
|
-
group(logLevel, message) {
|
|
3041
|
-
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
3042
|
-
collapsed: false
|
|
3043
|
-
};
|
|
3044
|
-
const options = normalizeArguments2({
|
|
3045
|
-
logLevel,
|
|
3046
|
-
message,
|
|
3047
|
-
opts
|
|
3048
|
-
});
|
|
3049
|
-
const {
|
|
3050
|
-
collapsed
|
|
3051
|
-
} = opts;
|
|
3052
|
-
options.method = (collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
3053
|
-
return this._getLogFunction(options);
|
|
3054
|
-
}
|
|
3055
|
-
groupCollapsed(logLevel, message) {
|
|
3056
|
-
let opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
3057
|
-
return this.group(logLevel, message, Object.assign({}, opts, {
|
|
3058
|
-
collapsed: true
|
|
3059
|
-
}));
|
|
3060
|
-
}
|
|
3061
|
-
groupEnd(logLevel) {
|
|
3062
|
-
return this._getLogFunction(logLevel, "", console.groupEnd || noop2);
|
|
3063
|
-
}
|
|
3064
|
-
withGroup(logLevel, message, func) {
|
|
3065
|
-
this.group(logLevel, message)();
|
|
3066
|
-
try {
|
|
3067
|
-
func();
|
|
3068
|
-
} finally {
|
|
3069
|
-
this.groupEnd(logLevel)();
|
|
3070
|
-
}
|
|
3071
|
-
}
|
|
3072
|
-
trace() {
|
|
3073
|
-
if (console.trace) {
|
|
3074
|
-
console.trace();
|
|
3075
|
-
}
|
|
3076
|
-
}
|
|
3077
|
-
_shouldLog(logLevel) {
|
|
3078
|
-
return this.isEnabled() && this.getLevel() >= normalizeLogLevel2(logLevel);
|
|
3079
|
-
}
|
|
3080
|
-
_getLogFunction(logLevel, message, method, args, opts) {
|
|
3081
|
-
if (this._shouldLog(logLevel)) {
|
|
3082
|
-
opts = normalizeArguments2({
|
|
3083
|
-
logLevel,
|
|
3084
|
-
message,
|
|
3085
|
-
args,
|
|
3086
|
-
opts
|
|
3087
|
-
});
|
|
3088
|
-
method = method || opts.method;
|
|
3089
|
-
assert4(method);
|
|
3090
|
-
opts.total = this.getTotal();
|
|
3091
|
-
opts.delta = this.getDelta();
|
|
3092
|
-
this._deltaTs = getHiResTimestamp4();
|
|
3093
|
-
const tag = opts.tag || opts.message;
|
|
3094
|
-
if (opts.once) {
|
|
3095
|
-
if (!cache2[tag]) {
|
|
3096
|
-
cache2[tag] = getHiResTimestamp4();
|
|
3097
|
-
} else {
|
|
3098
|
-
return noop2;
|
|
3099
|
-
}
|
|
3100
|
-
}
|
|
3101
|
-
message = decorateMessage2(this.id, opts.message, opts);
|
|
3102
|
-
return method.bind(console, message, ...opts.args);
|
|
3103
|
-
}
|
|
3104
|
-
return noop2;
|
|
3105
|
-
}
|
|
3106
|
-
};
|
|
3107
|
-
_defineProperty(Log2, "VERSION", VERSION5);
|
|
3108
|
-
}
|
|
3109
|
-
});
|
|
3110
|
-
|
|
3111
|
-
// ../../node_modules/@probe.gl/log/dist/esm/index.js
|
|
3112
|
-
var esm_default2;
|
|
3113
|
-
var init_esm5 = __esm({
|
|
3114
|
-
"../../node_modules/@probe.gl/log/dist/esm/index.js"() {
|
|
3115
|
-
init_log2();
|
|
3116
|
-
init_log2();
|
|
3117
|
-
esm_default2 = new Log2({
|
|
3118
|
-
id: "@probe.gl/log"
|
|
3119
|
-
});
|
|
3120
|
-
}
|
|
3121
|
-
});
|
|
3122
|
-
|
|
3123
|
-
// src/lib/utils/log.ts
|
|
3124
|
-
var log;
|
|
3125
|
-
var init_log3 = __esm({
|
|
3126
|
-
"src/lib/utils/log.ts"() {
|
|
3127
|
-
init_esm5();
|
|
3128
|
-
log = new Log2({ id: "loaders.gl" });
|
|
3129
|
-
}
|
|
3130
|
-
});
|
|
3131
|
-
|
|
3132
|
-
// src/lib/api/select-loader.ts
|
|
3133
|
-
async function selectLoader(data, loaders = [], options, context) {
|
|
3134
|
-
if (!validHTTPResponse(data)) {
|
|
3135
|
-
return null;
|
|
3136
|
-
}
|
|
3137
|
-
let loader = selectLoaderSync(data, loaders, { ...options, nothrow: true }, context);
|
|
3138
|
-
if (loader) {
|
|
3139
|
-
return loader;
|
|
3140
|
-
}
|
|
3141
|
-
if (isBlob(data)) {
|
|
3142
|
-
data = await data.slice(0, 10).arrayBuffer();
|
|
3143
|
-
loader = selectLoaderSync(data, loaders, options, context);
|
|
3144
|
-
}
|
|
3145
|
-
if (!loader && !options?.nothrow) {
|
|
3146
|
-
throw new Error(getNoValidLoaderMessage(data));
|
|
3147
|
-
}
|
|
3148
|
-
return loader;
|
|
3149
|
-
}
|
|
3150
|
-
function selectLoaderSync(data, loaders = [], options, context) {
|
|
3151
|
-
if (!validHTTPResponse(data)) {
|
|
2522
|
+
return loader;
|
|
2523
|
+
}
|
|
2524
|
+
function selectLoaderSync(data, loaders = [], options, context) {
|
|
2525
|
+
if (!validHTTPResponse(data)) {
|
|
3152
2526
|
return null;
|
|
3153
2527
|
}
|
|
3154
2528
|
if (loaders && !Array.isArray(loaders)) {
|
|
@@ -3314,7 +2688,7 @@
|
|
|
3314
2688
|
"src/lib/api/select-loader.ts"() {
|
|
3315
2689
|
init_src2();
|
|
3316
2690
|
init_normalize_loader();
|
|
3317
|
-
|
|
2691
|
+
init_log2();
|
|
3318
2692
|
init_resource_utils();
|
|
3319
2693
|
init_register_loaders();
|
|
3320
2694
|
init_is_type();
|
|
@@ -3955,15 +3329,15 @@
|
|
|
3955
3329
|
context = context && JSON.parse(JSON.stringify(context));
|
|
3956
3330
|
return { arrayBuffer, options, context };
|
|
3957
3331
|
}
|
|
3958
|
-
var
|
|
3332
|
+
var VERSION5, NullWorkerLoader, NullLoader;
|
|
3959
3333
|
var init_null_loader = __esm({
|
|
3960
3334
|
"src/null-loader.ts"() {
|
|
3961
|
-
|
|
3335
|
+
VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
3962
3336
|
NullWorkerLoader = {
|
|
3963
3337
|
name: "Null loader",
|
|
3964
3338
|
id: "null",
|
|
3965
3339
|
module: "core",
|
|
3966
|
-
version:
|
|
3340
|
+
version: VERSION5,
|
|
3967
3341
|
worker: true,
|
|
3968
3342
|
mimeTypes: ["application/x.empty"],
|
|
3969
3343
|
extensions: ["null"],
|
|
@@ -3976,7 +3350,7 @@
|
|
|
3976
3350
|
name: "Null loader",
|
|
3977
3351
|
id: "null",
|
|
3978
3352
|
module: "core",
|
|
3979
|
-
version:
|
|
3353
|
+
version: VERSION5,
|
|
3980
3354
|
mimeTypes: ["application/x.empty"],
|
|
3981
3355
|
extensions: ["null"],
|
|
3982
3356
|
parse: async (arrayBuffer, options, context) => parseSync2(arrayBuffer, options, context),
|
|
@@ -4223,10 +3597,10 @@
|
|
|
4223
3597
|
|
|
4224
3598
|
// src/bundle.ts
|
|
4225
3599
|
var require_bundle = __commonJS({
|
|
4226
|
-
"src/bundle.ts"(exports,
|
|
3600
|
+
"src/bundle.ts"(exports, module) {
|
|
4227
3601
|
var moduleExports = (init_src3(), src_exports);
|
|
4228
3602
|
globalThis.loaders = globalThis.loaders || {};
|
|
4229
|
-
|
|
3603
|
+
module.exports = Object.assign(globalThis.loaders, moduleExports);
|
|
4230
3604
|
}
|
|
4231
3605
|
});
|
|
4232
3606
|
require_bundle();
|