@loaders.gl/scene 5.0.0-beta.6 → 5.0.0-beta.8
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.dev.js +989 -211
- package/dist/dist.min.js +18 -18
- package/dist/draco/lib/draco-parser.cjs +8 -5
- package/dist/draco/lib/draco-parser.cjs.map +2 -2
- package/dist/draco/lib/draco-parser.d.ts +2 -1
- package/dist/draco/lib/draco-parser.d.ts.map +1 -1
- package/dist/draco/lib/draco-parser.js +6 -3
- package/dist/draco/lib/draco-parser.js.map +1 -1
- package/dist/draco/lib/parse-draco.cjs +2 -1
- package/dist/draco/lib/parse-draco.cjs.map +2 -2
- package/dist/draco/lib/parse-draco.d.ts.map +1 -1
- package/dist/draco/lib/parse-draco.js +2 -1
- package/dist/draco/lib/parse-draco.js.map +1 -1
- package/dist/draco/lib/utils/version.cjs +1 -1
- package/dist/draco/lib/utils/version.js +1 -1
- package/dist/draco-worker-node.js +933 -152
- package/dist/draco-worker-node.js.map +4 -4
- package/dist/draco-worker.js +830 -56
- package/dist/draco-worker.js.map +4 -4
- package/dist/draco-writer-worker-node.cjs +773 -186
- package/dist/draco-writer-worker-node.cjs.map +4 -4
- package/dist/draco-writer-worker.js +630 -46
- package/dist/draco-writer-worker.js.map +4 -4
- package/dist/gltf/lib/parsers/parse-gltf.cjs +8 -7
- package/dist/gltf/lib/parsers/parse-gltf.cjs.map +3 -3
- package/dist/gltf/lib/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/lib/parsers/parse-gltf.js +3 -1
- package/dist/gltf/lib/parsers/parse-gltf.js.map +1 -1
- package/dist/gltf/lib/utils/version.cjs +1 -1
- package/dist/gltf/lib/utils/version.js +1 -1
- package/dist/mtl-loader-types.cjs +1 -1
- package/dist/obj/mtl-loader-types.cjs +1 -1
- package/dist/obj/mtl-loader-types.js +1 -1
- package/dist/obj/obj-loader-types.cjs +1 -1
- package/dist/obj/obj-loader-types.js +1 -1
- package/dist/obj/obj-writer.cjs +1 -1
- package/dist/obj/obj-writer.js +1 -1
- package/dist/obj-loader-types.cjs +1 -1
- package/dist/obj-worker.js +37 -1
- package/dist/obj-writer.cjs +1 -1
- package/dist/stl-loader-types.cjs +1 -1
- package/dist/stl-loader-types.js +1 -1
- package/dist/usd/usd-loader-types.cjs +1 -1
- package/dist/usd/usd-loader-types.js +1 -1
- package/dist/usd-loader-types.cjs +1 -1
- package/package.json +6 -6
- package/src/draco/lib/draco-parser.ts +6 -3
- package/src/draco/lib/parse-draco.ts +2 -1
- package/src/gltf/lib/parsers/parse-gltf.ts +2 -1
package/dist/draco-worker.js
CHANGED
|
@@ -15,6 +15,738 @@
|
|
|
15
15
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
// ../../node_modules/probe.gl/dist/env/lib/globals.js
|
|
19
|
+
var window_, document_, process_, console_, navigator_;
|
|
20
|
+
var init_globals = __esm({
|
|
21
|
+
"../../node_modules/probe.gl/dist/env/lib/globals.js"() {
|
|
22
|
+
window_ = globalThis;
|
|
23
|
+
document_ = globalThis.document || {};
|
|
24
|
+
process_ = globalThis.process || {};
|
|
25
|
+
console_ = globalThis.console;
|
|
26
|
+
navigator_ = globalThis.navigator || {};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// ../../node_modules/probe.gl/dist/env/lib/is-electron.js
|
|
31
|
+
function isElectron(mockUserAgent) {
|
|
32
|
+
if (typeof window !== "undefined" && window.process?.type === "renderer") {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
if (typeof process !== "undefined" && Boolean(process.versions?.["electron"])) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
const realUserAgent = typeof navigator !== "undefined" && navigator.userAgent;
|
|
39
|
+
const userAgent = mockUserAgent || realUserAgent;
|
|
40
|
+
return Boolean(userAgent && userAgent.indexOf("Electron") >= 0);
|
|
41
|
+
}
|
|
42
|
+
var init_is_electron = __esm({
|
|
43
|
+
"../../node_modules/probe.gl/dist/env/lib/is-electron.js"() {
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// ../../node_modules/probe.gl/dist/env/lib/is-browser.js
|
|
48
|
+
function isBrowser() {
|
|
49
|
+
const isNode = (
|
|
50
|
+
// @ts-expect-error
|
|
51
|
+
typeof process === "object" && String(process) === "[object process]" && !process?.browser
|
|
52
|
+
);
|
|
53
|
+
return !isNode || isElectron();
|
|
54
|
+
}
|
|
55
|
+
var init_is_browser = __esm({
|
|
56
|
+
"../../node_modules/probe.gl/dist/env/lib/is-browser.js"() {
|
|
57
|
+
init_is_electron();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// ../../node_modules/probe.gl/dist/env/lib/get-browser.js
|
|
62
|
+
var init_get_browser = __esm({
|
|
63
|
+
"../../node_modules/probe.gl/dist/env/lib/get-browser.js"() {
|
|
64
|
+
init_is_browser();
|
|
65
|
+
init_is_electron();
|
|
66
|
+
init_globals();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// ../../node_modules/probe.gl/dist/env/utils/assert.js
|
|
71
|
+
var init_assert = __esm({
|
|
72
|
+
"../../node_modules/probe.gl/dist/env/utils/assert.js"() {
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// ../../node_modules/probe.gl/dist/env/index.js
|
|
77
|
+
var VERSION;
|
|
78
|
+
var init_env = __esm({
|
|
79
|
+
"../../node_modules/probe.gl/dist/env/index.js"() {
|
|
80
|
+
init_globals();
|
|
81
|
+
init_is_browser();
|
|
82
|
+
init_get_browser();
|
|
83
|
+
init_is_electron();
|
|
84
|
+
init_assert();
|
|
85
|
+
VERSION = true ? "5.0.0" : "untranspiled source";
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// ../../node_modules/probe.gl/dist/log/utils/assert.js
|
|
90
|
+
function assert2(condition, message) {
|
|
91
|
+
if (!condition) {
|
|
92
|
+
throw new Error(message || "Assertion failed");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
var init_assert2 = __esm({
|
|
96
|
+
"../../node_modules/probe.gl/dist/log/utils/assert.js"() {
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// ../../node_modules/probe.gl/dist/log/loggers/log-utils.js
|
|
101
|
+
function normalizeLogLevel(logLevel) {
|
|
102
|
+
if (!logLevel) {
|
|
103
|
+
return 0;
|
|
104
|
+
}
|
|
105
|
+
let resolvedLevel;
|
|
106
|
+
switch (typeof logLevel) {
|
|
107
|
+
case "number":
|
|
108
|
+
resolvedLevel = logLevel;
|
|
109
|
+
break;
|
|
110
|
+
case "object":
|
|
111
|
+
resolvedLevel = logLevel.logLevel || logLevel.priority || 0;
|
|
112
|
+
break;
|
|
113
|
+
default:
|
|
114
|
+
return 0;
|
|
115
|
+
}
|
|
116
|
+
assert2(Number.isFinite(resolvedLevel) && resolvedLevel >= 0);
|
|
117
|
+
return resolvedLevel;
|
|
118
|
+
}
|
|
119
|
+
function normalizeArguments(opts) {
|
|
120
|
+
const { logLevel, message } = opts;
|
|
121
|
+
opts.logLevel = normalizeLogLevel(logLevel);
|
|
122
|
+
const args = opts.args ? Array.from(opts.args) : [];
|
|
123
|
+
while (args.length && args.shift() !== message) {
|
|
124
|
+
}
|
|
125
|
+
switch (typeof logLevel) {
|
|
126
|
+
case "string":
|
|
127
|
+
case "function":
|
|
128
|
+
if (message !== void 0) {
|
|
129
|
+
args.unshift(message);
|
|
130
|
+
}
|
|
131
|
+
opts.message = logLevel;
|
|
132
|
+
break;
|
|
133
|
+
case "object":
|
|
134
|
+
Object.assign(opts, logLevel);
|
|
135
|
+
break;
|
|
136
|
+
default:
|
|
137
|
+
}
|
|
138
|
+
if (typeof opts.message === "function") {
|
|
139
|
+
opts.message = opts.message();
|
|
140
|
+
}
|
|
141
|
+
const messageType = typeof opts.message;
|
|
142
|
+
assert2(messageType === "string" || messageType === "object");
|
|
143
|
+
return Object.assign(opts, { args }, opts.opts);
|
|
144
|
+
}
|
|
145
|
+
var init_log_utils = __esm({
|
|
146
|
+
"../../node_modules/probe.gl/dist/log/loggers/log-utils.js"() {
|
|
147
|
+
init_assert2();
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// ../../node_modules/probe.gl/dist/log/loggers/base-log.js
|
|
152
|
+
var noop, BaseLog;
|
|
153
|
+
var init_base_log = __esm({
|
|
154
|
+
"../../node_modules/probe.gl/dist/log/loggers/base-log.js"() {
|
|
155
|
+
init_log_utils();
|
|
156
|
+
noop = () => {
|
|
157
|
+
};
|
|
158
|
+
BaseLog = class {
|
|
159
|
+
constructor({ level = 0 } = {}) {
|
|
160
|
+
this.userData = {};
|
|
161
|
+
this._onceCache = /* @__PURE__ */ new Set();
|
|
162
|
+
this._level = level;
|
|
163
|
+
}
|
|
164
|
+
set level(newLevel) {
|
|
165
|
+
this.setLevel(newLevel);
|
|
166
|
+
}
|
|
167
|
+
get level() {
|
|
168
|
+
return this.getLevel();
|
|
169
|
+
}
|
|
170
|
+
setLevel(level) {
|
|
171
|
+
this._level = level;
|
|
172
|
+
return this;
|
|
173
|
+
}
|
|
174
|
+
getLevel() {
|
|
175
|
+
return this._level;
|
|
176
|
+
}
|
|
177
|
+
// Unconditional logging
|
|
178
|
+
warn(message, ...args) {
|
|
179
|
+
return this._log("warn", 0, message, args, { once: true });
|
|
180
|
+
}
|
|
181
|
+
error(message, ...args) {
|
|
182
|
+
return this._log("error", 0, message, args);
|
|
183
|
+
}
|
|
184
|
+
// Conditional logging
|
|
185
|
+
log(logLevel, message, ...args) {
|
|
186
|
+
return this._log("log", logLevel, message, args);
|
|
187
|
+
}
|
|
188
|
+
info(logLevel, message, ...args) {
|
|
189
|
+
return this._log("info", logLevel, message, args);
|
|
190
|
+
}
|
|
191
|
+
once(logLevel, message, ...args) {
|
|
192
|
+
return this._log("once", logLevel, message, args, { once: true });
|
|
193
|
+
}
|
|
194
|
+
_log(type, logLevel, message, args, options = {}) {
|
|
195
|
+
const normalized = normalizeArguments({
|
|
196
|
+
logLevel,
|
|
197
|
+
message,
|
|
198
|
+
args: this._buildArgs(logLevel, message, args),
|
|
199
|
+
opts: options
|
|
200
|
+
});
|
|
201
|
+
return this._createLogFunction(type, normalized, options);
|
|
202
|
+
}
|
|
203
|
+
_buildArgs(logLevel, message, args) {
|
|
204
|
+
return [logLevel, message, ...args];
|
|
205
|
+
}
|
|
206
|
+
_createLogFunction(type, normalized, options) {
|
|
207
|
+
if (!this._shouldLog(normalized.logLevel)) {
|
|
208
|
+
return noop;
|
|
209
|
+
}
|
|
210
|
+
const tag = this._getOnceTag(options.tag ?? normalized.tag ?? normalized.message);
|
|
211
|
+
if ((options.once || normalized.once) && tag !== void 0) {
|
|
212
|
+
if (this._onceCache.has(tag)) {
|
|
213
|
+
return noop;
|
|
214
|
+
}
|
|
215
|
+
this._onceCache.add(tag);
|
|
216
|
+
}
|
|
217
|
+
return this._emit(type, normalized);
|
|
218
|
+
}
|
|
219
|
+
_shouldLog(logLevel) {
|
|
220
|
+
return this.getLevel() >= normalizeLogLevel(logLevel);
|
|
221
|
+
}
|
|
222
|
+
_getOnceTag(tag) {
|
|
223
|
+
if (tag === void 0) {
|
|
224
|
+
return void 0;
|
|
225
|
+
}
|
|
226
|
+
try {
|
|
227
|
+
return typeof tag === "string" ? tag : String(tag);
|
|
228
|
+
} catch {
|
|
229
|
+
return void 0;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
// ../../node_modules/probe.gl/dist/log/utils/local-storage.js
|
|
237
|
+
function getStorage(type) {
|
|
238
|
+
try {
|
|
239
|
+
const storage = window[type];
|
|
240
|
+
const x = "__storage_test__";
|
|
241
|
+
storage.setItem(x, x);
|
|
242
|
+
storage.removeItem(x);
|
|
243
|
+
return storage;
|
|
244
|
+
} catch (e) {
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
var LocalStorage;
|
|
249
|
+
var init_local_storage = __esm({
|
|
250
|
+
"../../node_modules/probe.gl/dist/log/utils/local-storage.js"() {
|
|
251
|
+
LocalStorage = class {
|
|
252
|
+
constructor(id, defaultConfig, type = "sessionStorage") {
|
|
253
|
+
this.storage = getStorage(type);
|
|
254
|
+
this.id = id;
|
|
255
|
+
this.config = defaultConfig;
|
|
256
|
+
this._loadConfiguration();
|
|
257
|
+
}
|
|
258
|
+
getConfiguration() {
|
|
259
|
+
return this.config;
|
|
260
|
+
}
|
|
261
|
+
setConfiguration(configuration) {
|
|
262
|
+
Object.assign(this.config, configuration);
|
|
263
|
+
if (this.storage) {
|
|
264
|
+
const serialized = JSON.stringify(this.config);
|
|
265
|
+
this.storage.setItem(this.id, serialized);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// Get config from persistent store, if available
|
|
269
|
+
_loadConfiguration() {
|
|
270
|
+
let configuration = {};
|
|
271
|
+
if (this.storage) {
|
|
272
|
+
const serializedConfiguration = this.storage.getItem(this.id);
|
|
273
|
+
configuration = serializedConfiguration ? JSON.parse(serializedConfiguration) : {};
|
|
274
|
+
}
|
|
275
|
+
Object.assign(this.config, configuration);
|
|
276
|
+
return this;
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
// ../../node_modules/probe.gl/dist/log/utils/formatters.js
|
|
283
|
+
function formatTime(ms) {
|
|
284
|
+
let formatted;
|
|
285
|
+
if (ms < 10) {
|
|
286
|
+
formatted = `${ms.toFixed(2)}ms`;
|
|
287
|
+
} else if (ms < 100) {
|
|
288
|
+
formatted = `${ms.toFixed(1)}ms`;
|
|
289
|
+
} else if (ms < 1e3) {
|
|
290
|
+
formatted = `${ms.toFixed(0)}ms`;
|
|
291
|
+
} else {
|
|
292
|
+
formatted = `${(ms / 1e3).toFixed(2)}s`;
|
|
293
|
+
}
|
|
294
|
+
return formatted;
|
|
295
|
+
}
|
|
296
|
+
function leftPad(string, length = 8) {
|
|
297
|
+
const padLength = Math.max(length - string.length, 0);
|
|
298
|
+
return `${" ".repeat(padLength)}${string}`;
|
|
299
|
+
}
|
|
300
|
+
var init_formatters = __esm({
|
|
301
|
+
"../../node_modules/probe.gl/dist/log/utils/formatters.js"() {
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// ../../node_modules/probe.gl/dist/log/utils/color.js
|
|
306
|
+
function getColor(color) {
|
|
307
|
+
if (typeof color !== "string") {
|
|
308
|
+
return color;
|
|
309
|
+
}
|
|
310
|
+
color = color.toUpperCase();
|
|
311
|
+
return COLOR[color] || COLOR.WHITE;
|
|
312
|
+
}
|
|
313
|
+
function addColor(string, color, background) {
|
|
314
|
+
if (!isBrowser && typeof string === "string") {
|
|
315
|
+
if (color) {
|
|
316
|
+
const colorCode = getColor(color);
|
|
317
|
+
string = `\x1B[${colorCode}m${string}\x1B[39m`;
|
|
318
|
+
}
|
|
319
|
+
if (background) {
|
|
320
|
+
const colorCode = getColor(background);
|
|
321
|
+
string = `\x1B[${colorCode + BACKGROUND_INCREMENT}m${string}\x1B[49m`;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return string;
|
|
325
|
+
}
|
|
326
|
+
var COLOR, BACKGROUND_INCREMENT;
|
|
327
|
+
var init_color = __esm({
|
|
328
|
+
"../../node_modules/probe.gl/dist/log/utils/color.js"() {
|
|
329
|
+
init_env();
|
|
330
|
+
(function(COLOR2) {
|
|
331
|
+
COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
|
|
332
|
+
COLOR2[COLOR2["RED"] = 31] = "RED";
|
|
333
|
+
COLOR2[COLOR2["GREEN"] = 32] = "GREEN";
|
|
334
|
+
COLOR2[COLOR2["YELLOW"] = 33] = "YELLOW";
|
|
335
|
+
COLOR2[COLOR2["BLUE"] = 34] = "BLUE";
|
|
336
|
+
COLOR2[COLOR2["MAGENTA"] = 35] = "MAGENTA";
|
|
337
|
+
COLOR2[COLOR2["CYAN"] = 36] = "CYAN";
|
|
338
|
+
COLOR2[COLOR2["WHITE"] = 37] = "WHITE";
|
|
339
|
+
COLOR2[COLOR2["BRIGHT_BLACK"] = 90] = "BRIGHT_BLACK";
|
|
340
|
+
COLOR2[COLOR2["BRIGHT_RED"] = 91] = "BRIGHT_RED";
|
|
341
|
+
COLOR2[COLOR2["BRIGHT_GREEN"] = 92] = "BRIGHT_GREEN";
|
|
342
|
+
COLOR2[COLOR2["BRIGHT_YELLOW"] = 93] = "BRIGHT_YELLOW";
|
|
343
|
+
COLOR2[COLOR2["BRIGHT_BLUE"] = 94] = "BRIGHT_BLUE";
|
|
344
|
+
COLOR2[COLOR2["BRIGHT_MAGENTA"] = 95] = "BRIGHT_MAGENTA";
|
|
345
|
+
COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
346
|
+
COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
347
|
+
})(COLOR || (COLOR = {}));
|
|
348
|
+
BACKGROUND_INCREMENT = 10;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
// ../../node_modules/probe.gl/dist/log/utils/autobind.js
|
|
353
|
+
function autobind(obj, predefined = ["constructor"]) {
|
|
354
|
+
const proto = Object.getPrototypeOf(obj);
|
|
355
|
+
const propNames = Object.getOwnPropertyNames(proto);
|
|
356
|
+
const object = obj;
|
|
357
|
+
for (const key of propNames) {
|
|
358
|
+
const value = object[key];
|
|
359
|
+
if (typeof value === "function") {
|
|
360
|
+
if (!predefined.find((name) => key === name)) {
|
|
361
|
+
object[key] = value.bind(obj);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
var init_autobind = __esm({
|
|
367
|
+
"../../node_modules/probe.gl/dist/log/utils/autobind.js"() {
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
// ../../node_modules/probe.gl/dist/log/probe.js
|
|
372
|
+
var Probe, probe;
|
|
373
|
+
var init_probe = __esm({
|
|
374
|
+
"../../node_modules/probe.gl/dist/log/probe.js"() {
|
|
375
|
+
init_env();
|
|
376
|
+
Probe = class {
|
|
377
|
+
getHighResolutionTimer() {
|
|
378
|
+
let timestamp;
|
|
379
|
+
if (isBrowser() && window_.performance) {
|
|
380
|
+
timestamp = window_?.performance?.now?.();
|
|
381
|
+
} else if ("hrtime" in process_) {
|
|
382
|
+
const timeParts = process_?.hrtime?.();
|
|
383
|
+
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
384
|
+
} else {
|
|
385
|
+
timestamp = Date.now();
|
|
386
|
+
}
|
|
387
|
+
return timestamp;
|
|
388
|
+
}
|
|
389
|
+
getMemoryUsageMB() {
|
|
390
|
+
const performance2 = window_?.performance;
|
|
391
|
+
const usedJSHeapSize = performance2?.memory?.usedJSHeapSize;
|
|
392
|
+
if (usedJSHeapSize === void 0 || usedJSHeapSize === null) {
|
|
393
|
+
return null;
|
|
394
|
+
}
|
|
395
|
+
return Math.trunc(usedJSHeapSize / 1024 / 1024);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
probe = new Probe();
|
|
399
|
+
globalThis.Probe = Probe;
|
|
400
|
+
globalThis.probe = probe;
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
// ../../node_modules/probe.gl/dist/log/loggers/probe-log.js
|
|
405
|
+
function decorateMessage(id, message, opts) {
|
|
406
|
+
if (typeof message === "string") {
|
|
407
|
+
const time = opts.time ? leftPad(formatTime(opts.total)) : "";
|
|
408
|
+
message = opts.time ? `${id}: ${time} ${message}` : `${id}: ${message}`;
|
|
409
|
+
message = addColor(message, opts.color, opts.background);
|
|
410
|
+
}
|
|
411
|
+
return message;
|
|
412
|
+
}
|
|
413
|
+
function getTableHeader(table) {
|
|
414
|
+
for (const key in table) {
|
|
415
|
+
for (const title in table[key]) {
|
|
416
|
+
return title || "untitled";
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return "empty";
|
|
420
|
+
}
|
|
421
|
+
var originalConsole, DEFAULT_LOG_CONFIGURATION, ProbeLog;
|
|
422
|
+
var init_probe_log = __esm({
|
|
423
|
+
"../../node_modules/probe.gl/dist/log/loggers/probe-log.js"() {
|
|
424
|
+
init_env();
|
|
425
|
+
init_base_log();
|
|
426
|
+
init_local_storage();
|
|
427
|
+
init_formatters();
|
|
428
|
+
init_color();
|
|
429
|
+
init_autobind();
|
|
430
|
+
init_assert2();
|
|
431
|
+
init_probe();
|
|
432
|
+
init_log_utils();
|
|
433
|
+
init_log_utils();
|
|
434
|
+
originalConsole = {
|
|
435
|
+
debug: isBrowser() ? console.debug || console.log : console.log,
|
|
436
|
+
log: console.log,
|
|
437
|
+
info: console.info,
|
|
438
|
+
warn: console.warn,
|
|
439
|
+
error: console.error
|
|
440
|
+
};
|
|
441
|
+
DEFAULT_LOG_CONFIGURATION = {
|
|
442
|
+
enabled: true,
|
|
443
|
+
level: 0
|
|
444
|
+
};
|
|
445
|
+
ProbeLog = class extends BaseLog {
|
|
446
|
+
constructor({ id } = { id: "" }) {
|
|
447
|
+
super({ level: 0 });
|
|
448
|
+
this.VERSION = VERSION;
|
|
449
|
+
this._startTs = probe.getHighResolutionTimer();
|
|
450
|
+
this._deltaTs = probe.getHighResolutionTimer();
|
|
451
|
+
this.userData = {};
|
|
452
|
+
this.LOG_THROTTLE_TIMEOUT = 0;
|
|
453
|
+
this.id = id;
|
|
454
|
+
this.userData = {};
|
|
455
|
+
this._storage = new LocalStorage(`__probe-${this.id}__`, { [this.id]: DEFAULT_LOG_CONFIGURATION });
|
|
456
|
+
this.timeStamp(`${this.id} started`);
|
|
457
|
+
autobind(this);
|
|
458
|
+
Object.seal(this);
|
|
459
|
+
}
|
|
460
|
+
isEnabled() {
|
|
461
|
+
return this._getConfiguration().enabled;
|
|
462
|
+
}
|
|
463
|
+
getLevel() {
|
|
464
|
+
return this._getConfiguration().level;
|
|
465
|
+
}
|
|
466
|
+
/** @return milliseconds, with fractions */
|
|
467
|
+
getTotal() {
|
|
468
|
+
return Number((probe.getHighResolutionTimer() - this._startTs).toPrecision(10));
|
|
469
|
+
}
|
|
470
|
+
/** @return milliseconds, with fractions */
|
|
471
|
+
getDelta() {
|
|
472
|
+
return Number((probe.getHighResolutionTimer() - this._deltaTs).toPrecision(10));
|
|
473
|
+
}
|
|
474
|
+
/** @deprecated use logLevel */
|
|
475
|
+
set priority(newPriority) {
|
|
476
|
+
this.level = newPriority;
|
|
477
|
+
}
|
|
478
|
+
/** @deprecated use logLevel */
|
|
479
|
+
get priority() {
|
|
480
|
+
return this.level;
|
|
481
|
+
}
|
|
482
|
+
/** @deprecated use logLevel */
|
|
483
|
+
getPriority() {
|
|
484
|
+
return this.level;
|
|
485
|
+
}
|
|
486
|
+
// Configure
|
|
487
|
+
enable(enabled = true) {
|
|
488
|
+
this._updateConfiguration({ enabled });
|
|
489
|
+
return this;
|
|
490
|
+
}
|
|
491
|
+
setLevel(level) {
|
|
492
|
+
this._updateConfiguration({ level });
|
|
493
|
+
return this;
|
|
494
|
+
}
|
|
495
|
+
/** return the current status of the setting */
|
|
496
|
+
get(setting) {
|
|
497
|
+
return this._getConfiguration()[setting];
|
|
498
|
+
}
|
|
499
|
+
// update the status of the setting
|
|
500
|
+
set(setting, value) {
|
|
501
|
+
this._updateConfiguration({ [setting]: value });
|
|
502
|
+
}
|
|
503
|
+
/** Logs the current settings as a table */
|
|
504
|
+
settings() {
|
|
505
|
+
if (console.table) {
|
|
506
|
+
console.table(this._storage.config);
|
|
507
|
+
} else {
|
|
508
|
+
console.log(this._storage.config);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
// Unconditional logging
|
|
512
|
+
assert(condition, message) {
|
|
513
|
+
if (!condition) {
|
|
514
|
+
throw new Error(message || "Assertion failed");
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
warn(message, ...args) {
|
|
518
|
+
return this._log("warn", 0, message, args, {
|
|
519
|
+
method: originalConsole.warn,
|
|
520
|
+
once: true
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
error(message, ...args) {
|
|
524
|
+
return this._log("error", 0, message, args, {
|
|
525
|
+
method: originalConsole.error
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
/** Print a deprecation warning */
|
|
529
|
+
deprecated(oldUsage, newUsage) {
|
|
530
|
+
return this.warn(`\`${oldUsage}\` is deprecated and will be removed in a later version. Use \`${newUsage}\` instead`);
|
|
531
|
+
}
|
|
532
|
+
/** Print a removal warning */
|
|
533
|
+
removed(oldUsage, newUsage) {
|
|
534
|
+
return this.error(`\`${oldUsage}\` has been removed. Use \`${newUsage}\` instead`);
|
|
535
|
+
}
|
|
536
|
+
probe(logLevel, message, ...args) {
|
|
537
|
+
const memoryUsageMB = probe.getMemoryUsageMB();
|
|
538
|
+
if (memoryUsageMB !== null) {
|
|
539
|
+
const memoryUsagePrefix = `${memoryUsageMB}MB `;
|
|
540
|
+
if (typeof message === "function") {
|
|
541
|
+
message = () => `${memoryUsagePrefix}${message()}`;
|
|
542
|
+
} else if (typeof message === "string") {
|
|
543
|
+
message = `${memoryUsagePrefix}${message}`;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
return this._log("log", logLevel, message, args, {
|
|
547
|
+
method: originalConsole.log,
|
|
548
|
+
time: true,
|
|
549
|
+
once: true
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
log(logLevel, message, ...args) {
|
|
553
|
+
return this._log("log", logLevel, message, args, {
|
|
554
|
+
method: originalConsole.debug
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
info(logLevel, message, ...args) {
|
|
558
|
+
return this._log("info", logLevel, message, args, { method: console.info });
|
|
559
|
+
}
|
|
560
|
+
once(logLevel, message, ...args) {
|
|
561
|
+
return this._log("once", logLevel, message, args, {
|
|
562
|
+
method: originalConsole.debug || originalConsole.info,
|
|
563
|
+
once: true
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
/** Logs an object as a table */
|
|
567
|
+
table(logLevel, table, columns) {
|
|
568
|
+
if (table) {
|
|
569
|
+
return this._log("table", logLevel, table, columns && [columns] || [], {
|
|
570
|
+
method: console.table || noop,
|
|
571
|
+
tag: getTableHeader(table)
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
return noop;
|
|
575
|
+
}
|
|
576
|
+
time(logLevel, message) {
|
|
577
|
+
return this._log("time", logLevel, message, [], {
|
|
578
|
+
method: console.time ? console.time : console.info
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
timeEnd(logLevel, message) {
|
|
582
|
+
return this._log("time", logLevel, message, [], {
|
|
583
|
+
method: console.timeEnd ? console.timeEnd : console.info
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
timeStamp(logLevel, message) {
|
|
587
|
+
return this._log("time", logLevel, message, [], {
|
|
588
|
+
method: console.timeStamp || noop
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
group(logLevel, message, opts = { collapsed: false }) {
|
|
592
|
+
const method = (opts.collapsed ? console.groupCollapsed : console.group) || console.info;
|
|
593
|
+
return this._log("group", logLevel, message, [], { method });
|
|
594
|
+
}
|
|
595
|
+
groupCollapsed(logLevel, message, opts = {}) {
|
|
596
|
+
return this.group(logLevel, message, Object.assign({}, opts, { collapsed: true }));
|
|
597
|
+
}
|
|
598
|
+
groupEnd(logLevel) {
|
|
599
|
+
return this._log("groupEnd", logLevel, "", [], {
|
|
600
|
+
method: console.groupEnd || noop
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
// EXPERIMENTAL
|
|
604
|
+
withGroup(logLevel, message, func) {
|
|
605
|
+
this.group(logLevel, message)();
|
|
606
|
+
try {
|
|
607
|
+
func();
|
|
608
|
+
} finally {
|
|
609
|
+
this.groupEnd(logLevel)();
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
trace() {
|
|
613
|
+
if (console.trace) {
|
|
614
|
+
console.trace();
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
_shouldLog(logLevel) {
|
|
618
|
+
return this.isEnabled() && super._shouldLog(logLevel);
|
|
619
|
+
}
|
|
620
|
+
_emit(_type, normalized) {
|
|
621
|
+
const method = normalized.method;
|
|
622
|
+
assert2(method);
|
|
623
|
+
normalized.total = this.getTotal();
|
|
624
|
+
normalized.delta = this.getDelta();
|
|
625
|
+
this._deltaTs = probe.getHighResolutionTimer();
|
|
626
|
+
const message = decorateMessage(this.id, normalized.message, normalized);
|
|
627
|
+
return method.bind(console, message, ...normalized.args);
|
|
628
|
+
}
|
|
629
|
+
_getConfiguration() {
|
|
630
|
+
if (!this._storage.config[this.id]) {
|
|
631
|
+
this._updateConfiguration(DEFAULT_LOG_CONFIGURATION);
|
|
632
|
+
}
|
|
633
|
+
return this._storage.config[this.id];
|
|
634
|
+
}
|
|
635
|
+
_updateConfiguration(configuration) {
|
|
636
|
+
const currentConfiguration = this._storage.config[this.id] || {
|
|
637
|
+
...DEFAULT_LOG_CONFIGURATION
|
|
638
|
+
};
|
|
639
|
+
this._storage.setConfiguration({
|
|
640
|
+
[this.id]: { ...currentConfiguration, ...configuration }
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
ProbeLog.VERSION = VERSION;
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
|
|
648
|
+
// ../../node_modules/probe.gl/dist/log/loggers/console-log.js
|
|
649
|
+
var init_console_log = __esm({
|
|
650
|
+
"../../node_modules/probe.gl/dist/log/loggers/console-log.js"() {
|
|
651
|
+
init_base_log();
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
// ../../node_modules/probe.gl/dist/log/loggers/memory-log.js
|
|
656
|
+
var init_memory_log = __esm({
|
|
657
|
+
"../../node_modules/probe.gl/dist/log/loggers/memory-log.js"() {
|
|
658
|
+
init_base_log();
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
// ../../node_modules/probe.gl/dist/log/deprecated/hi-res-timestamp.js
|
|
663
|
+
var init_hi_res_timestamp = __esm({
|
|
664
|
+
"../../node_modules/probe.gl/dist/log/deprecated/hi-res-timestamp.js"() {
|
|
665
|
+
init_probe();
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
// ../../node_modules/probe.gl/dist/log/init.js
|
|
670
|
+
var init_init = __esm({
|
|
671
|
+
"../../node_modules/probe.gl/dist/log/init.js"() {
|
|
672
|
+
init_probe();
|
|
673
|
+
if (!globalThis.probe) {
|
|
674
|
+
globalThis.probe = probe;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
// ../../node_modules/probe.gl/dist/log/index.js
|
|
680
|
+
var log;
|
|
681
|
+
var init_log = __esm({
|
|
682
|
+
"../../node_modules/probe.gl/dist/log/index.js"() {
|
|
683
|
+
init_probe_log();
|
|
684
|
+
init_probe();
|
|
685
|
+
init_probe_log();
|
|
686
|
+
init_console_log();
|
|
687
|
+
init_base_log();
|
|
688
|
+
init_memory_log();
|
|
689
|
+
init_color();
|
|
690
|
+
init_color();
|
|
691
|
+
init_formatters();
|
|
692
|
+
init_autobind();
|
|
693
|
+
init_local_storage();
|
|
694
|
+
init_hi_res_timestamp();
|
|
695
|
+
init_init();
|
|
696
|
+
log = new ProbeLog({ id: "@probe.gl/log" });
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
// ../core/src/loader-utils/lib/log-utils/log.ts
|
|
701
|
+
function createLog() {
|
|
702
|
+
const log3 = new ProbeLog({ id: "loaders.gl" });
|
|
703
|
+
globalThis.loaders ||= {};
|
|
704
|
+
globalThis.loaders.log = log3;
|
|
705
|
+
globalThis.loaders.version = version;
|
|
706
|
+
globalThis.probe ||= {};
|
|
707
|
+
globalThis.probe.loaders = log3;
|
|
708
|
+
return log3;
|
|
709
|
+
}
|
|
710
|
+
function ignoreMessage() {
|
|
711
|
+
}
|
|
712
|
+
function getLoaderLog(options) {
|
|
713
|
+
const logger = options?.core?.log !== void 0 ? options.core.log : options?.log;
|
|
714
|
+
return logger === null ? nullLog : logger || log2;
|
|
715
|
+
}
|
|
716
|
+
var VERSION2, version, log2, NullLog, nullLog;
|
|
717
|
+
var init_log2 = __esm({
|
|
718
|
+
"../core/src/loader-utils/lib/log-utils/log.ts"() {
|
|
719
|
+
"use strict";
|
|
720
|
+
init_log();
|
|
721
|
+
VERSION2 = true ? "5.0.0-beta.8" : "latest";
|
|
722
|
+
version = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
|
|
723
|
+
log2 = createLog();
|
|
724
|
+
NullLog = class {
|
|
725
|
+
/** Discards debug messages. */
|
|
726
|
+
log() {
|
|
727
|
+
return ignoreMessage;
|
|
728
|
+
}
|
|
729
|
+
/** Discards informational messages. */
|
|
730
|
+
info() {
|
|
731
|
+
return ignoreMessage;
|
|
732
|
+
}
|
|
733
|
+
/** Discards messages marked to be emitted once. */
|
|
734
|
+
once() {
|
|
735
|
+
return ignoreMessage;
|
|
736
|
+
}
|
|
737
|
+
/** Discards warnings. */
|
|
738
|
+
warn() {
|
|
739
|
+
return ignoreMessage;
|
|
740
|
+
}
|
|
741
|
+
/** Discards errors. */
|
|
742
|
+
error() {
|
|
743
|
+
return ignoreMessage;
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
nullLog = new NullLog();
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
|
|
18
750
|
// ../core/src/loader-utils/lib/module-utils/initialize-wasm-module.ts
|
|
19
751
|
function initializeWasmModule(initialize, extractExports) {
|
|
20
752
|
return new Promise((resolve, reject) => {
|
|
@@ -52,34 +784,34 @@
|
|
|
52
784
|
|
|
53
785
|
// ../core/src/worker-utils/lib/env-utils/version.ts
|
|
54
786
|
function getVersion() {
|
|
55
|
-
const
|
|
787
|
+
const version2 = false ? NPM_TAG : "5.0.0-beta.8";
|
|
56
788
|
globalThis._loadersgl_ = globalThis._loadersgl_ || {};
|
|
57
|
-
globalThis._loadersgl_.version ||=
|
|
58
|
-
return
|
|
789
|
+
globalThis._loadersgl_.version ||= version2;
|
|
790
|
+
return version2;
|
|
59
791
|
}
|
|
60
|
-
var
|
|
792
|
+
var VERSION3;
|
|
61
793
|
var init_version = __esm({
|
|
62
794
|
"../core/src/worker-utils/lib/env-utils/version.ts"() {
|
|
63
795
|
"use strict";
|
|
64
|
-
|
|
796
|
+
VERSION3 = getVersion();
|
|
65
797
|
}
|
|
66
798
|
});
|
|
67
799
|
|
|
68
800
|
// ../core/src/worker-utils/lib/env-utils/assert.ts
|
|
69
|
-
function
|
|
801
|
+
function assert3(condition, message) {
|
|
70
802
|
if (!condition) {
|
|
71
803
|
throw new Error(message || "loaders.gl assertion failed.");
|
|
72
804
|
}
|
|
73
805
|
}
|
|
74
|
-
var
|
|
806
|
+
var init_assert3 = __esm({
|
|
75
807
|
"../core/src/worker-utils/lib/env-utils/assert.ts"() {
|
|
76
808
|
"use strict";
|
|
77
809
|
}
|
|
78
810
|
});
|
|
79
811
|
|
|
80
812
|
// ../core/src/worker-utils/lib/env-utils/globals.ts
|
|
81
|
-
var globals, self_,
|
|
82
|
-
var
|
|
813
|
+
var globals, self_, window_2, global_2, document_2, isBrowser2, isWorker, isMobile2, matches, nodeVersion;
|
|
814
|
+
var init_globals2 = __esm({
|
|
83
815
|
"../core/src/worker-utils/lib/env-utils/globals.ts"() {
|
|
84
816
|
"use strict";
|
|
85
817
|
globals = {
|
|
@@ -89,13 +821,13 @@
|
|
|
89
821
|
document: typeof document !== "undefined" && document
|
|
90
822
|
};
|
|
91
823
|
self_ = globals.self || globals.window || globals.global || {};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
824
|
+
window_2 = globals.window || globals.self || globals.global || {};
|
|
825
|
+
global_2 = globals.global || globals.self || globals.window || {};
|
|
826
|
+
document_2 = globals.document || {};
|
|
827
|
+
isBrowser2 = // @ts-ignore process.browser
|
|
96
828
|
typeof process !== "object" || String(process) !== "[object process]" || process.browser;
|
|
97
829
|
isWorker = typeof importScripts === "function";
|
|
98
|
-
|
|
830
|
+
isMobile2 = typeof window !== "undefined" && typeof window.orientation !== "undefined";
|
|
99
831
|
matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
|
|
100
832
|
nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
101
833
|
}
|
|
@@ -1240,15 +1972,15 @@
|
|
|
1240
1972
|
if (!options.useLocalLibraries && library.startsWith("http")) {
|
|
1241
1973
|
return library;
|
|
1242
1974
|
}
|
|
1243
|
-
if (!
|
|
1975
|
+
if (!isBrowser2) {
|
|
1244
1976
|
return `modules/${moduleName}/dist/libs/${libraryName}`;
|
|
1245
1977
|
}
|
|
1246
1978
|
if (options.CDN) {
|
|
1247
1979
|
if (typeof options.CDN !== "string") {
|
|
1248
1980
|
throw new Error("loadLibrary: options.CDN must be a string or null");
|
|
1249
1981
|
}
|
|
1250
|
-
|
|
1251
|
-
return `${options.CDN}/${moduleName}@${
|
|
1982
|
+
assert3(options.CDN.startsWith("http"));
|
|
1983
|
+
return `${options.CDN}/${moduleName}@${VERSION3}/dist/libs/${libraryName}`;
|
|
1252
1984
|
}
|
|
1253
1985
|
if (isWorker) {
|
|
1254
1986
|
return libraryName.endsWith(".mjs") ? `./libs/${libraryName}` : `../src/libs/${libraryName}`;
|
|
@@ -1259,7 +1991,7 @@
|
|
|
1259
1991
|
if (libraryUrl.endsWith("wasm")) {
|
|
1260
1992
|
return await loadAsArrayBuffer(libraryUrl);
|
|
1261
1993
|
}
|
|
1262
|
-
if (!
|
|
1994
|
+
if (!isBrowser2) {
|
|
1263
1995
|
const { requireFromFile } = globalThis.loaders || {};
|
|
1264
1996
|
try {
|
|
1265
1997
|
const result = await requireFromFile?.(libraryUrl);
|
|
@@ -1274,7 +2006,7 @@
|
|
|
1274
2006
|
} catch {
|
|
1275
2007
|
}
|
|
1276
2008
|
}
|
|
1277
|
-
|
|
2009
|
+
log2.error(String(error))();
|
|
1278
2010
|
return null;
|
|
1279
2011
|
}
|
|
1280
2012
|
}
|
|
@@ -1311,7 +2043,7 @@
|
|
|
1311
2043
|
}
|
|
1312
2044
|
async function loadAsArrayBuffer(url) {
|
|
1313
2045
|
const { readFileAsArrayBuffer } = globalThis.loaders || {};
|
|
1314
|
-
if (
|
|
2046
|
+
if (isBrowser2 || !readFileAsArrayBuffer || url.startsWith("http")) {
|
|
1315
2047
|
const response = await fetch(url);
|
|
1316
2048
|
return await response.arrayBuffer();
|
|
1317
2049
|
}
|
|
@@ -1326,7 +2058,7 @@
|
|
|
1326
2058
|
}
|
|
1327
2059
|
async function loadAsText(url) {
|
|
1328
2060
|
const { readFileAsText } = globalThis.loaders || {};
|
|
1329
|
-
if (
|
|
2061
|
+
if (isBrowser2 || !readFileAsText || url.startsWith("http")) {
|
|
1330
2062
|
const response = await fetch(url);
|
|
1331
2063
|
return await response.text();
|
|
1332
2064
|
}
|
|
@@ -1343,8 +2075,9 @@
|
|
|
1343
2075
|
var init_library_utils = __esm({
|
|
1344
2076
|
"../core/src/worker-utils/lib/library-utils/library-utils.ts"() {
|
|
1345
2077
|
"use strict";
|
|
1346
|
-
|
|
1347
|
-
|
|
2078
|
+
init_log2();
|
|
2079
|
+
init_globals2();
|
|
2080
|
+
init_assert3();
|
|
1348
2081
|
init_version();
|
|
1349
2082
|
loadLibraryPromises = {};
|
|
1350
2083
|
}
|
|
@@ -1354,7 +2087,7 @@
|
|
|
1354
2087
|
var init_worker_utils2 = __esm({
|
|
1355
2088
|
"../core/src/worker-utils/index.ts"() {
|
|
1356
2089
|
"use strict";
|
|
1357
|
-
|
|
2090
|
+
init_globals2();
|
|
1358
2091
|
init_create_worker2();
|
|
1359
2092
|
init_library_utils();
|
|
1360
2093
|
}
|
|
@@ -1633,6 +2366,7 @@
|
|
|
1633
2366
|
var init_loader_utils = __esm({
|
|
1634
2367
|
"../core/src/loader-utils/index.ts"() {
|
|
1635
2368
|
"use strict";
|
|
2369
|
+
init_log2();
|
|
1636
2370
|
init_initialize_wasm_module();
|
|
1637
2371
|
init_create_loader_worker();
|
|
1638
2372
|
}
|
|
@@ -9506,8 +10240,8 @@ return true;`);
|
|
|
9506
10240
|
static startFooter(builder) {
|
|
9507
10241
|
builder.startObject(5);
|
|
9508
10242
|
}
|
|
9509
|
-
static addVersion(builder,
|
|
9510
|
-
builder.addFieldInt16(0,
|
|
10243
|
+
static addVersion(builder, version2) {
|
|
10244
|
+
builder.addFieldInt16(0, version2, MetadataVersion.V1);
|
|
9511
10245
|
}
|
|
9512
10246
|
static addSchema(builder, schemaOffset) {
|
|
9513
10247
|
builder.addFieldOffset(1, schemaOffset, 0);
|
|
@@ -9753,9 +10487,9 @@ return true;`);
|
|
|
9753
10487
|
get numDictionaries() {
|
|
9754
10488
|
return this._dictionaryBatches.length;
|
|
9755
10489
|
}
|
|
9756
|
-
constructor(schema,
|
|
10490
|
+
constructor(schema, version2 = MetadataVersion.V5, recordBatches, dictionaryBatches) {
|
|
9757
10491
|
this.schema = schema;
|
|
9758
|
-
this.version =
|
|
10492
|
+
this.version = version2;
|
|
9759
10493
|
recordBatches && (this._recordBatches = recordBatches);
|
|
9760
10494
|
dictionaryBatches && (this._dictionaryBatches = dictionaryBatches);
|
|
9761
10495
|
}
|
|
@@ -9883,8 +10617,8 @@ return true;`);
|
|
|
9883
10617
|
static startMessage(builder) {
|
|
9884
10618
|
builder.startObject(5);
|
|
9885
10619
|
}
|
|
9886
|
-
static addVersion(builder,
|
|
9887
|
-
builder.addFieldInt16(0,
|
|
10620
|
+
static addVersion(builder, version2) {
|
|
10621
|
+
builder.addFieldInt16(0, version2, MetadataVersion.V1);
|
|
9888
10622
|
}
|
|
9889
10623
|
static addHeaderType(builder, headerType) {
|
|
9890
10624
|
builder.addFieldInt8(1, headerType, MessageHeader.NONE);
|
|
@@ -9918,9 +10652,9 @@ return true;`);
|
|
|
9918
10652
|
static finishSizePrefixedMessageBuffer(builder, offset) {
|
|
9919
10653
|
builder.finish(offset, void 0, true);
|
|
9920
10654
|
}
|
|
9921
|
-
static createMessage(builder,
|
|
10655
|
+
static createMessage(builder, version2, headerType, headerOffset, bodyLength, customMetadataOffset) {
|
|
9922
10656
|
_Message.startMessage(builder);
|
|
9923
|
-
_Message.addVersion(builder,
|
|
10657
|
+
_Message.addVersion(builder, version2);
|
|
9924
10658
|
_Message.addHeaderType(builder, headerType);
|
|
9925
10659
|
_Message.addHeader(builder, headerOffset);
|
|
9926
10660
|
_Message.addBodyLength(builder, bodyLength);
|
|
@@ -10292,16 +11026,16 @@ return true;`);
|
|
|
10292
11026
|
throw new Error(`Unrecognized Message type: { name: ${MessageHeader[type]}, type: ${type} }`);
|
|
10293
11027
|
});
|
|
10294
11028
|
}
|
|
10295
|
-
function decodeSchema(_schema, dictionaries = /* @__PURE__ */ new Map(),
|
|
11029
|
+
function decodeSchema(_schema, dictionaries = /* @__PURE__ */ new Map(), version2 = MetadataVersion.V5) {
|
|
10296
11030
|
const fields = decodeSchemaFields(_schema, dictionaries);
|
|
10297
|
-
return new Schema2(fields, decodeCustomMetadata(_schema), dictionaries,
|
|
11031
|
+
return new Schema2(fields, decodeCustomMetadata(_schema), dictionaries, version2);
|
|
10298
11032
|
}
|
|
10299
|
-
function decodeRecordBatch(batch,
|
|
10300
|
-
const recordBatch = new RecordBatch2(batch.length(), decodeFieldNodes(batch), decodeBuffers(batch,
|
|
11033
|
+
function decodeRecordBatch(batch, version2 = MetadataVersion.V5) {
|
|
11034
|
+
const recordBatch = new RecordBatch2(batch.length(), decodeFieldNodes(batch), decodeBuffers(batch, version2), decodeBodyCompression(batch.compression()), decodeVariadicBufferCounts(batch));
|
|
10301
11035
|
return recordBatch;
|
|
10302
11036
|
}
|
|
10303
|
-
function decodeDictionaryBatch(batch,
|
|
10304
|
-
return new DictionaryBatch2(RecordBatch2.decode(batch.data(),
|
|
11037
|
+
function decodeDictionaryBatch(batch, version2 = MetadataVersion.V5) {
|
|
11038
|
+
return new DictionaryBatch2(RecordBatch2.decode(batch.data(), version2), batch.id(), batch.isDelta());
|
|
10305
11039
|
}
|
|
10306
11040
|
function decodeBufferRegion(b) {
|
|
10307
11041
|
return new BufferRegion(b.offset(), b.length());
|
|
@@ -10318,11 +11052,11 @@ return true;`);
|
|
|
10318
11052
|
}
|
|
10319
11053
|
return nodes;
|
|
10320
11054
|
}
|
|
10321
|
-
function decodeBuffers(batch,
|
|
11055
|
+
function decodeBuffers(batch, version2) {
|
|
10322
11056
|
const bufferRegions = [];
|
|
10323
11057
|
for (let b, i = -1, j = -1, n = batch.buffersLength(); ++i < n; ) {
|
|
10324
11058
|
if (b = batch.buffers(i)) {
|
|
10325
|
-
if (
|
|
11059
|
+
if (version2 < MetadataVersion.V4) {
|
|
10326
11060
|
b.bb_pos += 8 * (i + 1);
|
|
10327
11061
|
}
|
|
10328
11062
|
bufferRegions[++j] = BufferRegion.decode(b);
|
|
@@ -10647,10 +11381,10 @@ return true;`);
|
|
|
10647
11381
|
buf = new ByteBuffer3(toUint8Array(buf));
|
|
10648
11382
|
const _message = Message.getRootAsMessage(buf);
|
|
10649
11383
|
const bodyLength = _message.bodyLength();
|
|
10650
|
-
const
|
|
11384
|
+
const version2 = _message.version();
|
|
10651
11385
|
const headerType = _message.headerType();
|
|
10652
11386
|
const metadata = decodeMessageCustomMetadata(_message);
|
|
10653
|
-
const message = new _Message(bodyLength,
|
|
11387
|
+
const message = new _Message(bodyLength, version2, headerType, void 0, metadata);
|
|
10654
11388
|
message._createHeader = decodeMessageHeader(_message, headerType);
|
|
10655
11389
|
return message;
|
|
10656
11390
|
}
|
|
@@ -10727,8 +11461,8 @@ return true;`);
|
|
|
10727
11461
|
isDictionaryBatch() {
|
|
10728
11462
|
return this.headerType === MessageHeader.DictionaryBatch;
|
|
10729
11463
|
}
|
|
10730
|
-
constructor(bodyLength,
|
|
10731
|
-
this._version =
|
|
11464
|
+
constructor(bodyLength, version2, headerType, header, metadata) {
|
|
11465
|
+
this._version = version2;
|
|
10732
11466
|
this._headerType = headerType;
|
|
10733
11467
|
this.body = new Uint8Array(0);
|
|
10734
11468
|
this._compression = header === null || header === void 0 ? void 0 : header.compression;
|
|
@@ -17540,6 +18274,7 @@ return true;`);
|
|
|
17540
18274
|
var init_draco_parser = __esm({
|
|
17541
18275
|
"src/draco/lib/draco-parser.ts"() {
|
|
17542
18276
|
"use strict";
|
|
18277
|
+
init_loader_utils();
|
|
17543
18278
|
init_schema_utils();
|
|
17544
18279
|
init_get_draco_schema();
|
|
17545
18280
|
DRACO_TO_GLTF_ATTRIBUTE_NAME_MAP = {
|
|
@@ -17564,15 +18299,17 @@ return true;`);
|
|
|
17564
18299
|
UINT16_INDEX_ITEM_SIZE = 2;
|
|
17565
18300
|
UINT32_INDEX_ITEM_SIZE = 4;
|
|
17566
18301
|
DracoParser = class {
|
|
17567
|
-
draco;
|
|
17568
|
-
decoder;
|
|
17569
|
-
metadataQuerier;
|
|
17570
18302
|
// draco - the draco decoder, either import `draco3d` or load dynamically
|
|
17571
|
-
constructor(draco) {
|
|
18303
|
+
constructor(draco, logger = getLoaderLog()) {
|
|
18304
|
+
this.logger = logger;
|
|
17572
18305
|
this.draco = draco;
|
|
17573
18306
|
this.decoder = new this.draco.Decoder();
|
|
17574
18307
|
this.metadataQuerier = new this.draco.MetadataQuerier();
|
|
17575
18308
|
}
|
|
18309
|
+
logger;
|
|
18310
|
+
draco;
|
|
18311
|
+
decoder;
|
|
18312
|
+
metadataQuerier;
|
|
17576
18313
|
/**
|
|
17577
18314
|
* Destroy draco resources
|
|
17578
18315
|
*/
|
|
@@ -17834,7 +18571,7 @@ return true;`);
|
|
|
17834
18571
|
_getAttributeValues(dracoGeometry, attribute) {
|
|
17835
18572
|
const TypedArrayCtor = DRACO_DATA_TYPE_TO_TYPED_ARRAY_MAP[attribute.data_type];
|
|
17836
18573
|
if (!TypedArrayCtor) {
|
|
17837
|
-
|
|
18574
|
+
this.logger.warn(`DRACO: Unsupported attribute type ${attribute.data_type}`)();
|
|
17838
18575
|
return null;
|
|
17839
18576
|
}
|
|
17840
18577
|
const numComponents = attribute.num_components;
|
|
@@ -18028,7 +18765,7 @@ return true;`);
|
|
|
18028
18765
|
reportProgress?.({ phase: "decode", completed: 0, total: 1, unit: "tasks" });
|
|
18029
18766
|
const { draco } = await loadDecoderModule();
|
|
18030
18767
|
(options?.signal || context?.signal)?.throwIfAborted();
|
|
18031
|
-
const dracoParser = new DracoParser(draco);
|
|
18768
|
+
const dracoParser = new DracoParser(draco, getLoaderLog(options));
|
|
18032
18769
|
try {
|
|
18033
18770
|
const mesh = dracoParser.parseSync(arrayBuffer, options?.draco);
|
|
18034
18771
|
reportProgress?.({ phase: "decode", completed: 1, total: 1, unit: "tasks" });
|
|
@@ -18043,6 +18780,7 @@ return true;`);
|
|
|
18043
18780
|
var init_parse_draco = __esm({
|
|
18044
18781
|
"src/draco/lib/parse-draco.ts"() {
|
|
18045
18782
|
"use strict";
|
|
18783
|
+
init_loader_utils();
|
|
18046
18784
|
init_schema_utils();
|
|
18047
18785
|
init_draco_parser();
|
|
18048
18786
|
}
|
|
@@ -18050,7 +18788,7 @@ return true;`);
|
|
|
18050
18788
|
|
|
18051
18789
|
// src/draco/lib/draco-library-loader.ts
|
|
18052
18790
|
async function loadLibrary2(libraryUrl, moduleName = null, options = {}, libraryName = null, moduleLibraryName = null) {
|
|
18053
|
-
if (
|
|
18791
|
+
if (isBrowser2 && options.useLocalLibraries && !options.CDN && libraryName && options.modules?.[libraryName] === void 0) {
|
|
18054
18792
|
const directory = isWorker ? "./libs" : `modules/${moduleName}/dist/libs`;
|
|
18055
18793
|
options = {
|
|
18056
18794
|
...options,
|
|
@@ -18179,7 +18917,7 @@ return true;`);
|
|
|
18179
18917
|
"draco_decoder.mjs"
|
|
18180
18918
|
);
|
|
18181
18919
|
} catch (error) {
|
|
18182
|
-
if (
|
|
18920
|
+
if (isBrowser2 || options.useLocalLibraries) {
|
|
18183
18921
|
throw error;
|
|
18184
18922
|
}
|
|
18185
18923
|
decoderLibrary2 = await loadLibrary2(
|
|
@@ -18198,7 +18936,7 @@ return true;`);
|
|
|
18198
18936
|
try {
|
|
18199
18937
|
[decoderLibrary, wasmBinary] = await loadDecoderWasmAssets(options, profile);
|
|
18200
18938
|
} catch (error) {
|
|
18201
|
-
if (
|
|
18939
|
+
if (isBrowser2 || options.useLocalLibraries) {
|
|
18202
18940
|
throw error;
|
|
18203
18941
|
}
|
|
18204
18942
|
[decoderLibrary, wasmBinary] = await loadDecoderWasmAssets(
|
|
@@ -18290,6 +19028,18 @@ return true;`);
|
|
|
18290
19028
|
}
|
|
18291
19029
|
});
|
|
18292
19030
|
|
|
19031
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-helpers.js
|
|
19032
|
+
var init_indexed_arrow_helpers = __esm({
|
|
19033
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-helpers.js"() {
|
|
19034
|
+
}
|
|
19035
|
+
});
|
|
19036
|
+
|
|
19037
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-schema-utils.js
|
|
19038
|
+
var init_arrow_schema_utils = __esm({
|
|
19039
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/arrow-schema-utils.js"() {
|
|
19040
|
+
}
|
|
19041
|
+
});
|
|
19042
|
+
|
|
18293
19043
|
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js
|
|
18294
19044
|
function getArrowVariadicBuffers(data) {
|
|
18295
19045
|
return data.variadicBuffers ?? [];
|
|
@@ -18393,27 +19143,43 @@ return true;`);
|
|
|
18393
19143
|
}
|
|
18394
19144
|
});
|
|
18395
19145
|
|
|
19146
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/take-arrow-rows.js
|
|
19147
|
+
var init_take_arrow_rows = __esm({
|
|
19148
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/take-arrow-rows.js"() {
|
|
19149
|
+
init_arrow_data();
|
|
19150
|
+
init_split_arrow_buffers();
|
|
19151
|
+
}
|
|
19152
|
+
});
|
|
19153
|
+
|
|
18396
19154
|
// ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js
|
|
18397
19155
|
var init_indexed_arrow_vector = __esm({
|
|
18398
19156
|
"../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js"() {
|
|
19157
|
+
init_indexed_arrow_helpers();
|
|
18399
19158
|
}
|
|
18400
19159
|
});
|
|
18401
19160
|
|
|
18402
19161
|
// ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js
|
|
18403
19162
|
var init_indexed_arrow_table = __esm({
|
|
18404
19163
|
"../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js"() {
|
|
19164
|
+
init_indexed_arrow_helpers();
|
|
19165
|
+
init_arrow_schema_utils();
|
|
19166
|
+
init_take_arrow_rows();
|
|
19167
|
+
init_indexed_arrow_vector();
|
|
18405
19168
|
}
|
|
18406
19169
|
});
|
|
18407
19170
|
|
|
18408
19171
|
// ../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js
|
|
18409
19172
|
var init_mapped_arrow_table = __esm({
|
|
18410
19173
|
"../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js"() {
|
|
19174
|
+
init_indexed_arrow_helpers();
|
|
19175
|
+
init_indexed_arrow_table();
|
|
18411
19176
|
}
|
|
18412
19177
|
});
|
|
18413
19178
|
|
|
18414
19179
|
// ../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js
|
|
18415
19180
|
var init_rename_arrow_columns = __esm({
|
|
18416
19181
|
"../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js"() {
|
|
19182
|
+
init_arrow_schema_utils();
|
|
18417
19183
|
}
|
|
18418
19184
|
});
|
|
18419
19185
|
|
|
@@ -18467,15 +19233,23 @@ return true;`);
|
|
|
18467
19233
|
}
|
|
18468
19234
|
});
|
|
18469
19235
|
|
|
19236
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js
|
|
19237
|
+
var init_arrow_column_utils = __esm({
|
|
19238
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js"() {
|
|
19239
|
+
}
|
|
19240
|
+
});
|
|
19241
|
+
|
|
18470
19242
|
// ../../node_modules/@math.gl/arrow/dist/arrow/index.js
|
|
18471
19243
|
var init_arrow = __esm({
|
|
18472
19244
|
"../../node_modules/@math.gl/arrow/dist/arrow/index.js"() {
|
|
18473
19245
|
init_indexed_arrow_table();
|
|
18474
19246
|
init_indexed_arrow_vector();
|
|
18475
19247
|
init_mapped_arrow_table();
|
|
19248
|
+
init_arrow_schema_utils();
|
|
18476
19249
|
init_rename_arrow_columns();
|
|
18477
19250
|
init_split_arrow_buffers();
|
|
18478
19251
|
init_arrow_table_transport();
|
|
19252
|
+
init_arrow_column_utils();
|
|
18479
19253
|
}
|
|
18480
19254
|
});
|
|
18481
19255
|
|
|
@@ -18524,11 +19298,11 @@ return true;`);
|
|
|
18524
19298
|
});
|
|
18525
19299
|
|
|
18526
19300
|
// src/draco/lib/utils/version.ts
|
|
18527
|
-
var
|
|
19301
|
+
var VERSION4;
|
|
18528
19302
|
var init_version2 = __esm({
|
|
18529
19303
|
"src/draco/lib/utils/version.ts"() {
|
|
18530
19304
|
"use strict";
|
|
18531
|
-
|
|
19305
|
+
VERSION4 = true ? "5.0.0-beta.8" : "latest";
|
|
18532
19306
|
}
|
|
18533
19307
|
});
|
|
18534
19308
|
|
|
@@ -18717,7 +19491,7 @@ return true;`);
|
|
|
18717
19491
|
batchType: null,
|
|
18718
19492
|
...DracoFormat,
|
|
18719
19493
|
// shapes: ['mesh'],
|
|
18720
|
-
version:
|
|
19494
|
+
version: VERSION4,
|
|
18721
19495
|
worker: true,
|
|
18722
19496
|
/** Node test workers live with the Draco implementation. */
|
|
18723
19497
|
workerSourceNode: "draco/workers/draco-worker-node.ts",
|