@loaders.gl/pointclouds 5.0.0-beta.4 → 5.0.0-beta.6
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/LAS-README.md +1 -1
- package/PCD-README.md +1 -1
- package/PLY-README.md +1 -1
- package/README.md +1 -1
- package/dist/dist.dev.js +129 -90
- package/dist/dist.min.js +20 -20
- package/dist/las/las-loader-shared.cjs +1 -1
- package/dist/las/las-loader-shared.js +1 -1
- package/dist/las/las-loader-types.d.ts +2 -2
- package/dist/las/las-loader.cjs +4 -4
- package/dist/las/las-loader.cjs.map +2 -2
- package/dist/las/las-loader.d.ts +1 -1
- package/dist/las/las-loader.d.ts.map +1 -1
- package/dist/las/las-loader.js +1 -1
- package/dist/las/las-loader.js.map +1 -1
- package/dist/las/las-writer.cjs +1 -1
- package/dist/las/las-writer.js +1 -1
- package/dist/las-loader.cjs +4 -4
- package/dist/las-loader.cjs.map +2 -2
- package/dist/las-worker.js +303 -80
- package/dist/las-writer.cjs +1 -1
- package/dist/pcd/pcd-loader-types.cjs +3 -3
- package/dist/pcd/pcd-loader-types.cjs.map +2 -2
- package/dist/pcd/pcd-loader-types.d.ts +1 -1
- package/dist/pcd/pcd-loader-types.d.ts.map +1 -1
- package/dist/pcd/pcd-loader-types.js +2 -2
- package/dist/pcd/pcd-loader-types.js.map +1 -1
- package/dist/pcd/pcd-loader.cjs +4 -4
- package/dist/pcd/pcd-loader.cjs.map +2 -2
- package/dist/pcd/pcd-loader.d.ts +1 -1
- package/dist/pcd/pcd-loader.d.ts.map +1 -1
- package/dist/pcd/pcd-loader.js +1 -1
- package/dist/pcd/pcd-loader.js.map +1 -1
- package/dist/pcd/pcd-writer.cjs +1 -1
- package/dist/pcd/pcd-writer.js +1 -1
- package/dist/pcd-loader-types.cjs +3 -3
- package/dist/pcd-loader-types.cjs.map +2 -2
- package/dist/pcd-loader.cjs +4 -4
- package/dist/pcd-loader.cjs.map +2 -2
- package/dist/pcd-worker.js +568 -287
- package/dist/pcd-writer.cjs +1 -1
- package/dist/ply/ply-loader-types.cjs +3 -3
- package/dist/ply/ply-loader-types.cjs.map +2 -2
- package/dist/ply/ply-loader-types.d.ts +1 -1
- package/dist/ply/ply-loader-types.d.ts.map +1 -1
- package/dist/ply/ply-loader-types.js +2 -2
- package/dist/ply/ply-loader-types.js.map +1 -1
- package/dist/ply/ply-loader.cjs +4 -4
- package/dist/ply/ply-loader.cjs.map +2 -2
- package/dist/ply/ply-loader.d.ts +1 -1
- package/dist/ply/ply-loader.d.ts.map +1 -1
- package/dist/ply/ply-loader.js +1 -1
- package/dist/ply/ply-loader.js.map +1 -1
- package/dist/ply/ply-writer.cjs +1 -1
- package/dist/ply/ply-writer.js +1 -1
- package/dist/ply-loader-types.cjs +3 -3
- package/dist/ply-loader-types.cjs.map +2 -2
- package/dist/ply-loader.cjs +4 -4
- package/dist/ply-loader.cjs.map +2 -2
- package/dist/ply-worker.js +394 -113
- package/dist/ply-writer.cjs +1 -1
- package/package.json +3 -3
- package/src/las/las-loader.ts +1 -1
- package/src/pcd/pcd-loader-types.ts +1 -1
- package/src/pcd/pcd-loader.ts +1 -1
- package/src/ply/ply-loader-types.ts +1 -1
- package/src/ply/ply-loader.ts +1 -1
package/dist/pcd-worker.js
CHANGED
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
// ../../node_modules/@math.gl/
|
|
18
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/node/worker_threads-browser.js
|
|
19
19
|
var parentPort;
|
|
20
20
|
var init_worker_threads_browser = __esm({
|
|
21
|
-
"../../node_modules/@math.gl/
|
|
21
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/node/worker_threads-browser.js"() {
|
|
22
22
|
parentPort = globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort ?? null;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
// ../../node_modules/@math.gl/
|
|
26
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-utils/get-transfer-list.js
|
|
27
27
|
function getTransferList(object, recursive = true, transfers) {
|
|
28
28
|
const transfersSet = transfers || /* @__PURE__ */ new Set();
|
|
29
29
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
return false;
|
|
75
75
|
}
|
|
76
76
|
var init_get_transfer_list = __esm({
|
|
77
|
-
"../../node_modules/@math.gl/
|
|
77
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-utils/get-transfer-list.js"() {
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
-
// ../../node_modules/@math.gl/
|
|
81
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-farm/worker-body.js
|
|
82
82
|
async function getParentPort() {
|
|
83
83
|
return parentPort;
|
|
84
84
|
}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
}
|
|
92
92
|
var onMessageWrapperMap, WorkerBody;
|
|
93
93
|
var init_worker_body = __esm({
|
|
94
|
-
"../../node_modules/@math.gl/
|
|
94
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-farm/worker-body.js"() {
|
|
95
95
|
init_get_transfer_list();
|
|
96
96
|
init_worker_threads_browser();
|
|
97
97
|
onMessageWrapperMap = /* @__PURE__ */ new Map();
|
|
@@ -172,10 +172,10 @@
|
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
174
|
|
|
175
|
-
// ../../node_modules/@math.gl/
|
|
175
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/async-queue/async-queue.js
|
|
176
176
|
var AsyncQueue;
|
|
177
177
|
var init_async_queue = __esm({
|
|
178
|
-
"../../node_modules/@math.gl/
|
|
178
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/async-queue/async-queue.js"() {
|
|
179
179
|
AsyncQueue = class {
|
|
180
180
|
constructor() {
|
|
181
181
|
this._values = [];
|
|
@@ -244,10 +244,10 @@
|
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
246
|
|
|
247
|
-
// ../../node_modules/@math.gl/
|
|
247
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/shared-state.js
|
|
248
248
|
var SharedWorkerState;
|
|
249
249
|
var init_shared_state = __esm({
|
|
250
|
-
"../../node_modules/@math.gl/
|
|
250
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/shared-state.js"() {
|
|
251
251
|
SharedWorkerState = class {
|
|
252
252
|
constructor(buffer) {
|
|
253
253
|
if (typeof SharedArrayBuffer === "undefined" || !(buffer instanceof SharedArrayBuffer) || buffer.byteLength !== 16)
|
|
@@ -288,18 +288,18 @@
|
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
290
|
|
|
291
|
-
// ../../node_modules/@math.gl/
|
|
291
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/validate-output-ownership.js
|
|
292
292
|
function validateOutputOwnership(ownership) {
|
|
293
293
|
if (ownership !== void 0 && ownership !== "copy" && ownership !== "transfer") {
|
|
294
294
|
throw new Error("Invalid worker output ownership");
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
var init_validate_output_ownership = __esm({
|
|
298
|
-
"../../node_modules/@math.gl/
|
|
298
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/validate-output-ownership.js"() {
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
301
|
|
|
302
|
-
// ../../node_modules/@math.gl/
|
|
302
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/create-worker.js
|
|
303
303
|
async function createWorker(process2, processInBatches, preload2) {
|
|
304
304
|
if (!await WorkerBody.inWorkerThread()) {
|
|
305
305
|
return;
|
|
@@ -504,7 +504,7 @@
|
|
|
504
504
|
}
|
|
505
505
|
var requestId, activeController, activeInputBatches, activeOutputAcknowledgements;
|
|
506
506
|
var init_create_worker = __esm({
|
|
507
|
-
"../../node_modules/@math.gl/
|
|
507
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/lib/worker-api/create-worker.js"() {
|
|
508
508
|
init_shared_state();
|
|
509
509
|
init_async_queue();
|
|
510
510
|
init_worker_body();
|
|
@@ -516,19 +516,20 @@
|
|
|
516
516
|
}
|
|
517
517
|
});
|
|
518
518
|
|
|
519
|
-
// ../../node_modules/@math.gl/
|
|
519
|
+
// ../../node_modules/@math.gl/tasks/dist/worker-utils/index.js
|
|
520
520
|
var import_meta, path, moduleUrl;
|
|
521
521
|
var init_worker_utils = __esm({
|
|
522
|
-
"../../node_modules/@math.gl/
|
|
522
|
+
"../../node_modules/@math.gl/tasks/dist/worker-utils/index.js"() {
|
|
523
523
|
init_worker_body();
|
|
524
524
|
init_create_worker();
|
|
525
|
+
init_get_transfer_list();
|
|
525
526
|
import_meta = {};
|
|
526
527
|
path = typeof __filename === "string" ? __filename.replace(/\\/g, "/") : "";
|
|
527
528
|
moduleUrl = path ? `file://${path.startsWith("/") ? "" : "/"}${encodeURI(path).replace(/#/g, "%23").replace(/\?/g, "%3F")}` : import_meta.url;
|
|
528
529
|
}
|
|
529
530
|
});
|
|
530
531
|
|
|
531
|
-
// ../../node_modules/@math.gl/
|
|
532
|
+
// ../../node_modules/@math.gl/tasks/dist/tasks/task-preload.js
|
|
532
533
|
function preloadTaskCode(task, signal) {
|
|
533
534
|
if (!task.preload)
|
|
534
535
|
return Promise.resolve();
|
|
@@ -564,23 +565,193 @@
|
|
|
564
565
|
}
|
|
565
566
|
var pending, loaded;
|
|
566
567
|
var init_task_preload = __esm({
|
|
567
|
-
"../../node_modules/@math.gl/
|
|
568
|
+
"../../node_modules/@math.gl/tasks/dist/tasks/task-preload.js"() {
|
|
568
569
|
pending = /* @__PURE__ */ new WeakMap();
|
|
569
570
|
loaded = /* @__PURE__ */ new WeakSet();
|
|
570
571
|
}
|
|
571
572
|
});
|
|
572
573
|
|
|
573
|
-
// ../../node_modules/@math.gl/
|
|
574
|
+
// ../../node_modules/@math.gl/tasks/dist/tasks/task-channel.js
|
|
575
|
+
var TaskRequestError, TaskChannel;
|
|
576
|
+
var init_task_channel = __esm({
|
|
577
|
+
"../../node_modules/@math.gl/tasks/dist/tasks/task-channel.js"() {
|
|
578
|
+
TaskRequestError = class extends Error {
|
|
579
|
+
};
|
|
580
|
+
TaskChannel = class {
|
|
581
|
+
constructor(options) {
|
|
582
|
+
this.options = options;
|
|
583
|
+
this.nextId = 1;
|
|
584
|
+
this.pending = /* @__PURE__ */ new Map();
|
|
585
|
+
this.incoming = /* @__PURE__ */ new Map();
|
|
586
|
+
}
|
|
587
|
+
/** Send a request without serializing other in-flight requests. */
|
|
588
|
+
request(operation, value, signal, transfer = []) {
|
|
589
|
+
if (this.failure)
|
|
590
|
+
return Promise.reject(this.failure.reason);
|
|
591
|
+
if (signal?.aborted)
|
|
592
|
+
return Promise.reject(signal.reason);
|
|
593
|
+
const id = this.nextId++;
|
|
594
|
+
return new Promise((resolve, reject) => {
|
|
595
|
+
const abort = () => {
|
|
596
|
+
const pending2 = this.pending.get(id);
|
|
597
|
+
if (!pending2)
|
|
598
|
+
return;
|
|
599
|
+
this.pending.delete(id);
|
|
600
|
+
pending2.cleanup();
|
|
601
|
+
reject(signal?.reason);
|
|
602
|
+
this.send({ source: "math.gl/tasks", kind: "cancel", id });
|
|
603
|
+
};
|
|
604
|
+
this.pending.set(id, {
|
|
605
|
+
resolve,
|
|
606
|
+
reject,
|
|
607
|
+
cleanup: () => signal?.removeEventListener("abort", abort)
|
|
608
|
+
});
|
|
609
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
610
|
+
this.send({ source: "math.gl/tasks", kind: "request", id, operation, value }, transfer);
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
/** Send a one-way notification. */
|
|
614
|
+
emit(operation, value, transfer = []) {
|
|
615
|
+
if (this.failure)
|
|
616
|
+
throw this.failure.reason;
|
|
617
|
+
this.send({ source: "math.gl/tasks", kind: "event", id: 0, operation, value }, transfer);
|
|
618
|
+
}
|
|
619
|
+
/** Dispatch a transport message; unrelated protocols are ignored. */
|
|
620
|
+
receive(message) {
|
|
621
|
+
if (this.failure || message?.source !== "math.gl/tasks")
|
|
622
|
+
return;
|
|
623
|
+
if (message.kind === "failure") {
|
|
624
|
+
const reason = new Error(message.error?.message ?? "Task channel failed");
|
|
625
|
+
this.close(reason);
|
|
626
|
+
this.options.onFailure?.(reason);
|
|
627
|
+
} else if (message.kind === "result" || message.kind === "error") {
|
|
628
|
+
const pending2 = this.pending.get(message.id);
|
|
629
|
+
if (!pending2)
|
|
630
|
+
return;
|
|
631
|
+
this.pending.delete(message.id);
|
|
632
|
+
pending2.cleanup();
|
|
633
|
+
if (message.kind === "result")
|
|
634
|
+
pending2.resolve(message.value);
|
|
635
|
+
else {
|
|
636
|
+
const error = new TaskRequestError(message.error?.message ?? "Task request failed");
|
|
637
|
+
error.name = message.error?.name ?? "Error";
|
|
638
|
+
pending2.reject(error);
|
|
639
|
+
}
|
|
640
|
+
} else if (message.kind === "cancel") {
|
|
641
|
+
this.incoming.get(message.id)?.abort(new DOMException("Task request cancelled", "AbortError"));
|
|
642
|
+
} else if (message.kind === "event") {
|
|
643
|
+
try {
|
|
644
|
+
this.options.handleEvent?.(message.operation, message.value);
|
|
645
|
+
} catch (error) {
|
|
646
|
+
this.fail(error);
|
|
647
|
+
}
|
|
648
|
+
} else if (message.kind === "request") {
|
|
649
|
+
if (this.incoming.has(message.id)) {
|
|
650
|
+
this.fail(new Error("Duplicate task request identifier"));
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
const controller = new AbortController();
|
|
654
|
+
this.incoming.set(message.id, controller);
|
|
655
|
+
void Promise.resolve().then(() => {
|
|
656
|
+
controller.signal.throwIfAborted();
|
|
657
|
+
return this.options.handleRequest(message.operation, message.value, controller.signal);
|
|
658
|
+
}).then((value) => {
|
|
659
|
+
if (!controller.signal.aborted && !this.failure) {
|
|
660
|
+
this.send({ source: "math.gl/tasks", kind: "result", id: message.id, value }, this.options.getResultTransferList?.(value, message.value));
|
|
661
|
+
}
|
|
662
|
+
}).catch((reason) => {
|
|
663
|
+
if (!controller.signal.aborted && !this.failure) {
|
|
664
|
+
this.send({
|
|
665
|
+
source: "math.gl/tasks",
|
|
666
|
+
kind: "error",
|
|
667
|
+
id: message.id,
|
|
668
|
+
error: {
|
|
669
|
+
name: reason instanceof Error ? reason.name : "Error",
|
|
670
|
+
message: reason instanceof Error ? reason.message : String(reason)
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
}).finally(() => this.incoming.delete(message.id));
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
/** Reject all outstanding calls with a common cause and abort incoming callbacks. */
|
|
678
|
+
close(reason = new Error("Task channel closed")) {
|
|
679
|
+
if (this.failure)
|
|
680
|
+
return;
|
|
681
|
+
this.failure = { reason };
|
|
682
|
+
for (const pending2 of this.pending.values()) {
|
|
683
|
+
pending2.cleanup();
|
|
684
|
+
pending2.reject(reason);
|
|
685
|
+
}
|
|
686
|
+
this.pending.clear();
|
|
687
|
+
for (const controller of this.incoming.values())
|
|
688
|
+
controller.abort(reason);
|
|
689
|
+
this.incoming.clear();
|
|
690
|
+
}
|
|
691
|
+
send(message, transfer = []) {
|
|
692
|
+
if (this.failure)
|
|
693
|
+
return;
|
|
694
|
+
try {
|
|
695
|
+
this.options.send(message, transfer);
|
|
696
|
+
} catch (error) {
|
|
697
|
+
this.fail(error);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
/** Invalidate the channel and notify the peer when the transport still works. */
|
|
701
|
+
fail(reason) {
|
|
702
|
+
if (this.failure)
|
|
703
|
+
return;
|
|
704
|
+
this.close(reason);
|
|
705
|
+
try {
|
|
706
|
+
this.options.send({
|
|
707
|
+
source: "math.gl/tasks",
|
|
708
|
+
kind: "failure",
|
|
709
|
+
id: 0,
|
|
710
|
+
error: {
|
|
711
|
+
name: reason instanceof Error ? reason.name : "Error",
|
|
712
|
+
message: reason instanceof Error ? reason.message : String(reason)
|
|
713
|
+
}
|
|
714
|
+
}, []);
|
|
715
|
+
} catch {
|
|
716
|
+
}
|
|
717
|
+
this.options.onFailure?.(reason);
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
// ../../node_modules/@math.gl/tasks/dist/tasks/task-runtime.js
|
|
574
724
|
function assertPayload(value) {
|
|
575
725
|
if (!value || typeof value !== "object" || Object.getPrototypeOf(value) !== Object.prototype) {
|
|
576
726
|
throw new TypeError("Task payloads must be plain objects with named fields");
|
|
577
727
|
}
|
|
578
728
|
}
|
|
729
|
+
function clonePayload(value, ownership = "copy") {
|
|
730
|
+
assertPayload(value);
|
|
731
|
+
if (!["copy", "transfer", "share"].includes(ownership))
|
|
732
|
+
throw new TypeError("Invalid input ownership");
|
|
733
|
+
const transfer = getTransferList(value);
|
|
734
|
+
if (ownership === "share" && transfer.length)
|
|
735
|
+
throw new TypeError("Share requires shared storage");
|
|
736
|
+
return structuredClone(value, {
|
|
737
|
+
transfer: ownership === "transfer" ? transfer : []
|
|
738
|
+
});
|
|
739
|
+
}
|
|
579
740
|
function taskContext(state, context = {}) {
|
|
580
741
|
const signal = context.signal ?? new AbortController().signal;
|
|
581
742
|
return {
|
|
582
743
|
state,
|
|
583
744
|
signal,
|
|
745
|
+
requestHost: async (operation, payload, controls) => {
|
|
746
|
+
signal.throwIfAborted();
|
|
747
|
+
if (!context.requestHost)
|
|
748
|
+
throw new Error("No host request handler configured");
|
|
749
|
+
return context.requestHost(operation, payload, controls);
|
|
750
|
+
},
|
|
751
|
+
emitHost: (operation, payload) => {
|
|
752
|
+
signal.throwIfAborted();
|
|
753
|
+
context.emitHost?.(operation, payload);
|
|
754
|
+
},
|
|
584
755
|
throwIfAborted: () => {
|
|
585
756
|
signal.throwIfAborted();
|
|
586
757
|
context.throwIfAborted?.();
|
|
@@ -599,6 +770,69 @@
|
|
|
599
770
|
throw new Error("A task is already installed in this worker");
|
|
600
771
|
installed = true;
|
|
601
772
|
const runtime = new TaskRuntime(task);
|
|
773
|
+
let channelStream;
|
|
774
|
+
const channel = new TaskChannel({
|
|
775
|
+
getResultTransferList: (value, request) => request.outputOwnership === "transfer" ? getTransferList(value) : [],
|
|
776
|
+
send: (message, transfer) => {
|
|
777
|
+
const snapshot = structuredClone(message, { transfer });
|
|
778
|
+
void WorkerBody.postMessage("task-channel", snapshot).catch((reason) => channel.fail(reason));
|
|
779
|
+
},
|
|
780
|
+
handleRequest: async (operation, value, signal) => {
|
|
781
|
+
const request = value;
|
|
782
|
+
const context = {
|
|
783
|
+
signal,
|
|
784
|
+
reportProgress: (progress) => channel.emit("task:progress", { id: request.progressId, progress }),
|
|
785
|
+
requestHost: (operation2, payload, controls = {}) => {
|
|
786
|
+
const request2 = {
|
|
787
|
+
operation: operation2,
|
|
788
|
+
payload: clonePayload(payload, controls.inputOwnership),
|
|
789
|
+
outputOwnership: controls.outputOwnership ?? "copy"
|
|
790
|
+
};
|
|
791
|
+
return channel.request("task:host-request", request2, signal, getTransferList(request2));
|
|
792
|
+
},
|
|
793
|
+
emitHost: (operation2, payload) => channel.emit("task:host-event", { operation: operation2, payload, id: request.progressId })
|
|
794
|
+
};
|
|
795
|
+
switch (operation) {
|
|
796
|
+
case "initialize":
|
|
797
|
+
return runtime.initialize(request.input, context);
|
|
798
|
+
case "process":
|
|
799
|
+
return runtime.process(request.input, request.options, context);
|
|
800
|
+
case "stream-open": {
|
|
801
|
+
if (channelStream)
|
|
802
|
+
throw new Error("A task stream is already open");
|
|
803
|
+
async function* inputs() {
|
|
804
|
+
while (true) {
|
|
805
|
+
const result = await channel.request("task:next-input", { outputOwnership: "transfer" }, signal);
|
|
806
|
+
if (result.done)
|
|
807
|
+
return;
|
|
808
|
+
yield result.value;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
channelStream = runtime.stream(inputs(), request.options, context)[Symbol.asyncIterator]();
|
|
812
|
+
return {};
|
|
813
|
+
}
|
|
814
|
+
case "stream-next":
|
|
815
|
+
if (!channelStream)
|
|
816
|
+
throw new Error("No active task stream");
|
|
817
|
+
return channelStream.next();
|
|
818
|
+
case "stream-close":
|
|
819
|
+
try {
|
|
820
|
+
await channelStream?.return?.();
|
|
821
|
+
} finally {
|
|
822
|
+
channelStream = void 0;
|
|
823
|
+
}
|
|
824
|
+
return {};
|
|
825
|
+
case "destroy":
|
|
826
|
+
return runtime.destroy();
|
|
827
|
+
default:
|
|
828
|
+
throw new Error("Unknown task channel operation");
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
await WorkerBody.addEventListener((type, payload) => {
|
|
833
|
+
if (type === "task-channel")
|
|
834
|
+
channel.receive(payload);
|
|
835
|
+
});
|
|
602
836
|
let streamOptions = {};
|
|
603
837
|
return createWorker(async (request, _options, context) => {
|
|
604
838
|
switch (request.operation) {
|
|
@@ -630,9 +864,10 @@
|
|
|
630
864
|
}
|
|
631
865
|
var TaskRuntime, installed;
|
|
632
866
|
var init_task_runtime = __esm({
|
|
633
|
-
"../../node_modules/@math.gl/
|
|
867
|
+
"../../node_modules/@math.gl/tasks/dist/tasks/task-runtime.js"() {
|
|
634
868
|
init_worker_utils();
|
|
635
869
|
init_task_preload();
|
|
870
|
+
init_task_channel();
|
|
636
871
|
TaskRuntime = class {
|
|
637
872
|
constructor(task) {
|
|
638
873
|
this.task = task;
|
|
@@ -683,13 +918,20 @@
|
|
|
683
918
|
}
|
|
684
919
|
});
|
|
685
920
|
|
|
686
|
-
// ../../node_modules/@math.gl/
|
|
921
|
+
// ../../node_modules/@math.gl/tasks/dist/tasks/index.js
|
|
687
922
|
var init_tasks = __esm({
|
|
688
|
-
"../../node_modules/@math.gl/
|
|
923
|
+
"../../node_modules/@math.gl/tasks/dist/tasks/index.js"() {
|
|
689
924
|
init_task_runtime();
|
|
690
925
|
}
|
|
691
926
|
});
|
|
692
927
|
|
|
928
|
+
// ../../node_modules/@math.gl/tasks/dist/index.js
|
|
929
|
+
var init_dist = __esm({
|
|
930
|
+
"../../node_modules/@math.gl/tasks/dist/index.js"() {
|
|
931
|
+
init_tasks();
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
|
|
693
935
|
// ../core/src/worker-utils/lib/node/worker_threads-browser.ts
|
|
694
936
|
var worker_threads_browser_exports = {};
|
|
695
937
|
__export(worker_threads_browser_exports, {
|
|
@@ -734,7 +976,7 @@
|
|
|
734
976
|
var init_task_runtime2 = __esm({
|
|
735
977
|
"../core/src/worker-utils/lib/worker-api/task-runtime.ts"() {
|
|
736
978
|
"use strict";
|
|
737
|
-
|
|
979
|
+
init_dist();
|
|
738
980
|
initializeTaskWorker2 = initializeTaskWorker;
|
|
739
981
|
}
|
|
740
982
|
});
|
|
@@ -1191,7 +1433,7 @@
|
|
|
1191
1433
|
});
|
|
1192
1434
|
|
|
1193
1435
|
// ../../node_modules/@math.gl/core/dist/index.js
|
|
1194
|
-
var
|
|
1436
|
+
var init_dist2 = __esm({
|
|
1195
1437
|
"../../node_modules/@math.gl/core/dist/index.js"() {
|
|
1196
1438
|
init_math_utils();
|
|
1197
1439
|
init_types2();
|
|
@@ -16114,6 +16356,304 @@ return true;`);
|
|
|
16114
16356
|
}
|
|
16115
16357
|
});
|
|
16116
16358
|
|
|
16359
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js
|
|
16360
|
+
function getArrowVariadicBuffers(data) {
|
|
16361
|
+
return data.variadicBuffers ?? [];
|
|
16362
|
+
}
|
|
16363
|
+
function createArrowData(type, offset, length, nullCount, buffers, children, dictionary, variadicBuffers) {
|
|
16364
|
+
return Reflect.construct(Data, [
|
|
16365
|
+
type,
|
|
16366
|
+
offset,
|
|
16367
|
+
length,
|
|
16368
|
+
nullCount,
|
|
16369
|
+
buffers,
|
|
16370
|
+
children,
|
|
16371
|
+
dictionary,
|
|
16372
|
+
variadicBuffers
|
|
16373
|
+
]);
|
|
16374
|
+
}
|
|
16375
|
+
var init_arrow_data = __esm({
|
|
16376
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js"() {
|
|
16377
|
+
init_Arrow_dom();
|
|
16378
|
+
}
|
|
16379
|
+
});
|
|
16380
|
+
|
|
16381
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js
|
|
16382
|
+
function splitArrowBuffers(input, options = {}) {
|
|
16383
|
+
const context = { ...options, copies: /* @__PURE__ */ new WeakMap() };
|
|
16384
|
+
if (isArrowTable2(input)) {
|
|
16385
|
+
return splitArrowTableBuffersInternal(input, context);
|
|
16386
|
+
}
|
|
16387
|
+
if (isArrowRecordBatch2(input)) {
|
|
16388
|
+
return splitArrowRecordBatchBuffers(input, context);
|
|
16389
|
+
}
|
|
16390
|
+
if (isArrowVector2(input)) {
|
|
16391
|
+
return splitArrowVectorBuffers(input, context);
|
|
16392
|
+
}
|
|
16393
|
+
return splitArrowDataBuffers(input, context);
|
|
16394
|
+
}
|
|
16395
|
+
function isArrowTable2(input) {
|
|
16396
|
+
return "batches" in input;
|
|
16397
|
+
}
|
|
16398
|
+
function isArrowRecordBatch2(input) {
|
|
16399
|
+
return "schema" in input && "data" in input && !Array.isArray(input.data);
|
|
16400
|
+
}
|
|
16401
|
+
function isArrowVector2(input) {
|
|
16402
|
+
return "data" in input && Array.isArray(input.data);
|
|
16403
|
+
}
|
|
16404
|
+
function splitArrowTableBuffersInternal(arrowTable, options) {
|
|
16405
|
+
const recordBatches = arrowTable.batches.map((recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options));
|
|
16406
|
+
return new Table(arrowTable.schema, recordBatches);
|
|
16407
|
+
}
|
|
16408
|
+
function splitArrowRecordBatchBuffers(recordBatch, options) {
|
|
16409
|
+
return new RecordBatch3(recordBatch.schema, splitArrowDataBuffers(recordBatch.data, options));
|
|
16410
|
+
}
|
|
16411
|
+
function splitArrowDataBuffers(data, options) {
|
|
16412
|
+
const children = data.children.map((childData) => splitArrowDataBuffers(childData, options));
|
|
16413
|
+
const dictionary = data.dictionary ? splitArrowVectorBuffers(data.dictionary, options) : void 0;
|
|
16414
|
+
const buffers = {
|
|
16415
|
+
[BufferType.OFFSET]: splitArrowBuffer(data.buffers[BufferType.OFFSET], options),
|
|
16416
|
+
[BufferType.DATA]: splitArrowBuffer(data.buffers[BufferType.DATA], options),
|
|
16417
|
+
[BufferType.VALIDITY]: splitArrowBuffer(data.buffers[BufferType.VALIDITY], options),
|
|
16418
|
+
[BufferType.TYPE]: splitArrowBuffer(data.buffers[BufferType.TYPE], options)
|
|
16419
|
+
};
|
|
16420
|
+
return createArrowData(
|
|
16421
|
+
data.type,
|
|
16422
|
+
data.offset,
|
|
16423
|
+
data.length,
|
|
16424
|
+
// @ts-expect-error _nullCount is protected. Reuse it to preserve lazy null-count state.
|
|
16425
|
+
data._nullCount,
|
|
16426
|
+
buffers,
|
|
16427
|
+
children,
|
|
16428
|
+
dictionary,
|
|
16429
|
+
getArrowVariadicBuffers(data).map((buffer) => splitArrowBuffer(buffer, options))
|
|
16430
|
+
);
|
|
16431
|
+
}
|
|
16432
|
+
function splitArrowVectorBuffers(vector, options) {
|
|
16433
|
+
return new Vector(vector.data.map((data) => splitArrowDataBuffers(data, options)));
|
|
16434
|
+
}
|
|
16435
|
+
function splitArrowBuffer(array, options) {
|
|
16436
|
+
if (!isArrowTypedArray(array)) {
|
|
16437
|
+
return array;
|
|
16438
|
+
}
|
|
16439
|
+
if (options.copy === "none") {
|
|
16440
|
+
return array;
|
|
16441
|
+
}
|
|
16442
|
+
if (options.copy !== "all" && array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {
|
|
16443
|
+
return array;
|
|
16444
|
+
}
|
|
16445
|
+
let copy = options.copies.get(array);
|
|
16446
|
+
if (!copy) {
|
|
16447
|
+
copy = array instanceof Uint8Array ? new Uint8Array(array) : array.slice();
|
|
16448
|
+
options.copies.set(array, copy);
|
|
16449
|
+
}
|
|
16450
|
+
return copy;
|
|
16451
|
+
}
|
|
16452
|
+
function isArrowTypedArray(value) {
|
|
16453
|
+
return ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
16454
|
+
}
|
|
16455
|
+
var init_split_arrow_buffers = __esm({
|
|
16456
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js"() {
|
|
16457
|
+
init_Arrow_dom();
|
|
16458
|
+
init_arrow_data();
|
|
16459
|
+
}
|
|
16460
|
+
});
|
|
16461
|
+
|
|
16462
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js
|
|
16463
|
+
var init_indexed_arrow_vector = __esm({
|
|
16464
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js"() {
|
|
16465
|
+
}
|
|
16466
|
+
});
|
|
16467
|
+
|
|
16468
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js
|
|
16469
|
+
var init_indexed_arrow_table = __esm({
|
|
16470
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js"() {
|
|
16471
|
+
}
|
|
16472
|
+
});
|
|
16473
|
+
|
|
16474
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js
|
|
16475
|
+
var init_mapped_arrow_table = __esm({
|
|
16476
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js"() {
|
|
16477
|
+
}
|
|
16478
|
+
});
|
|
16479
|
+
|
|
16480
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js
|
|
16481
|
+
var init_rename_arrow_columns = __esm({
|
|
16482
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js"() {
|
|
16483
|
+
}
|
|
16484
|
+
});
|
|
16485
|
+
|
|
16486
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js
|
|
16487
|
+
function dehydrateArrowTable(arrowTable, options) {
|
|
16488
|
+
const splitTable = splitArrowBuffers(arrowTable, options);
|
|
16489
|
+
return {
|
|
16490
|
+
transport: "arrow-js",
|
|
16491
|
+
version: 1,
|
|
16492
|
+
schema: tableToIPC(new Table(splitTable.schema, [])),
|
|
16493
|
+
metadataVersion: splitTable.schema.metadataVersion,
|
|
16494
|
+
batches: splitTable.batches.map((batch) => dehydrateArrowData(batch.data))
|
|
16495
|
+
};
|
|
16496
|
+
}
|
|
16497
|
+
function hydrateArrowTable(table) {
|
|
16498
|
+
if (table.transport !== "arrow-js" || table.version !== 1) {
|
|
16499
|
+
throw new Error("Unsupported Arrow column-buffer transport protocol.");
|
|
16500
|
+
}
|
|
16501
|
+
const decodedSchema = tableFromIPC(table.schema).schema;
|
|
16502
|
+
const schema = new Schema2(decodedSchema.fields, decodedSchema.metadata, decodedSchema.dictionaries, table.metadataVersion);
|
|
16503
|
+
const type = new Struct(schema.fields);
|
|
16504
|
+
const batches = table.batches.map((data) => new RecordBatch3(schema, hydrateArrowData(data, type)));
|
|
16505
|
+
return new Table(schema, batches);
|
|
16506
|
+
}
|
|
16507
|
+
function dehydrateArrowData(data) {
|
|
16508
|
+
return {
|
|
16509
|
+
offset: data.offset,
|
|
16510
|
+
length: data.length,
|
|
16511
|
+
nullCount: data.nullCount,
|
|
16512
|
+
buffers: {
|
|
16513
|
+
[BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
|
|
16514
|
+
[BufferType.DATA]: data.buffers[BufferType.DATA],
|
|
16515
|
+
[BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
|
|
16516
|
+
[BufferType.TYPE]: data.buffers[BufferType.TYPE]
|
|
16517
|
+
},
|
|
16518
|
+
children: data.children.map((child) => dehydrateArrowData(child)),
|
|
16519
|
+
variadicBuffers: getArrowVariadicBuffers(data),
|
|
16520
|
+
dictionary: data.dictionary?.data.map((chunk) => dehydrateArrowData(chunk))
|
|
16521
|
+
};
|
|
16522
|
+
}
|
|
16523
|
+
function hydrateArrowData(data, type) {
|
|
16524
|
+
const children = data.children.map((child, index) => hydrateArrowData(child, type.children[index].type));
|
|
16525
|
+
const dictionary = data.dictionary && DataType.isDictionary(type) ? new Vector(data.dictionary.map((chunk) => hydrateArrowData(chunk, type.dictionary))) : void 0;
|
|
16526
|
+
return createArrowData(type, data.offset, data.length, data.nullCount, data.buffers, children, dictionary, data.variadicBuffers);
|
|
16527
|
+
}
|
|
16528
|
+
var init_arrow_table_transport = __esm({
|
|
16529
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js"() {
|
|
16530
|
+
init_Arrow_dom();
|
|
16531
|
+
init_arrow_data();
|
|
16532
|
+
init_split_arrow_buffers();
|
|
16533
|
+
}
|
|
16534
|
+
});
|
|
16535
|
+
|
|
16536
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/index.js
|
|
16537
|
+
var init_arrow = __esm({
|
|
16538
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/index.js"() {
|
|
16539
|
+
init_indexed_arrow_table();
|
|
16540
|
+
init_indexed_arrow_vector();
|
|
16541
|
+
init_mapped_arrow_table();
|
|
16542
|
+
init_rename_arrow_columns();
|
|
16543
|
+
init_split_arrow_buffers();
|
|
16544
|
+
init_arrow_table_transport();
|
|
16545
|
+
}
|
|
16546
|
+
});
|
|
16547
|
+
|
|
16548
|
+
// ../../node_modules/@math.gl/arrow/dist/index.js
|
|
16549
|
+
var init_dist3 = __esm({
|
|
16550
|
+
"../../node_modules/@math.gl/arrow/dist/index.js"() {
|
|
16551
|
+
init_arrow();
|
|
16552
|
+
}
|
|
16553
|
+
});
|
|
16554
|
+
|
|
16555
|
+
// ../core/src/arrow-worker-transport.ts
|
|
16556
|
+
function serializeArrowWorkerTable(result) {
|
|
16557
|
+
if (!isArrowTableWrapper(result)) {
|
|
16558
|
+
throw new Error("Workers require Arrow table output");
|
|
16559
|
+
}
|
|
16560
|
+
const { data, ...metadata } = result;
|
|
16561
|
+
return {
|
|
16562
|
+
...structuredClone(metadata),
|
|
16563
|
+
data: dehydrateArrowTable(data, { copy: "all" })
|
|
16564
|
+
};
|
|
16565
|
+
}
|
|
16566
|
+
function deserializeArrowWorkerTable(result) {
|
|
16567
|
+
if (!isDehydratedArrowTableWrapper(result)) {
|
|
16568
|
+
throw new Error("Workers require Arrow column transport");
|
|
16569
|
+
}
|
|
16570
|
+
return { ...result, data: hydrateArrowTable(result.data) };
|
|
16571
|
+
}
|
|
16572
|
+
function isArrowTableWrapper(value) {
|
|
16573
|
+
const table = value;
|
|
16574
|
+
return Boolean(
|
|
16575
|
+
table && table.shape === "arrow-table" && table.data && typeof table.data === "object" && "batches" in table.data
|
|
16576
|
+
);
|
|
16577
|
+
}
|
|
16578
|
+
function isDehydratedArrowTableWrapper(value) {
|
|
16579
|
+
const table = value;
|
|
16580
|
+
return Boolean(
|
|
16581
|
+
table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
|
|
16582
|
+
);
|
|
16583
|
+
}
|
|
16584
|
+
var init_arrow_worker_transport = __esm({
|
|
16585
|
+
"../core/src/arrow-worker-transport.ts"() {
|
|
16586
|
+
"use strict";
|
|
16587
|
+
init_dist3();
|
|
16588
|
+
}
|
|
16589
|
+
});
|
|
16590
|
+
|
|
16591
|
+
// ../core/src/schema-utils/lib/schema/data-type.ts
|
|
16592
|
+
function getDataTypeFromValue(value, defaultNumberType = "float32") {
|
|
16593
|
+
if (value instanceof Date) {
|
|
16594
|
+
return "date-millisecond";
|
|
16595
|
+
}
|
|
16596
|
+
if (typeof value === "number") {
|
|
16597
|
+
return defaultNumberType;
|
|
16598
|
+
}
|
|
16599
|
+
if (typeof value === "boolean") {
|
|
16600
|
+
return "bool";
|
|
16601
|
+
}
|
|
16602
|
+
if (typeof value === "string") {
|
|
16603
|
+
return "utf8";
|
|
16604
|
+
}
|
|
16605
|
+
if (value === null || value === "undefined") {
|
|
16606
|
+
return "null";
|
|
16607
|
+
}
|
|
16608
|
+
return "null";
|
|
16609
|
+
}
|
|
16610
|
+
function getDataTypeFromArray(array) {
|
|
16611
|
+
let type = getDataTypeFromTypedArray(array);
|
|
16612
|
+
if (type !== "null") {
|
|
16613
|
+
return { type, nullable: false };
|
|
16614
|
+
}
|
|
16615
|
+
if (array.length > 0) {
|
|
16616
|
+
type = getDataTypeFromValue(array[0]);
|
|
16617
|
+
return { type, nullable: true };
|
|
16618
|
+
}
|
|
16619
|
+
return { type: "null", nullable: true };
|
|
16620
|
+
}
|
|
16621
|
+
function getDataTypeFromTypedArray(array) {
|
|
16622
|
+
if (typeof Float16Array !== "undefined" && array instanceof Float16Array) {
|
|
16623
|
+
return "float16";
|
|
16624
|
+
}
|
|
16625
|
+
switch (array.constructor) {
|
|
16626
|
+
case Int8Array:
|
|
16627
|
+
return "int8";
|
|
16628
|
+
case Uint8Array:
|
|
16629
|
+
case Uint8ClampedArray:
|
|
16630
|
+
return "uint8";
|
|
16631
|
+
case Int16Array:
|
|
16632
|
+
return "int16";
|
|
16633
|
+
case Uint16Array:
|
|
16634
|
+
return "uint16";
|
|
16635
|
+
case Int32Array:
|
|
16636
|
+
return "int32";
|
|
16637
|
+
case Uint32Array:
|
|
16638
|
+
return "uint32";
|
|
16639
|
+
case BigInt64Array:
|
|
16640
|
+
return "int64";
|
|
16641
|
+
case BigUint64Array:
|
|
16642
|
+
return "uint64";
|
|
16643
|
+
case Float32Array:
|
|
16644
|
+
return "float32";
|
|
16645
|
+
case Float64Array:
|
|
16646
|
+
return "float64";
|
|
16647
|
+
default:
|
|
16648
|
+
return "null";
|
|
16649
|
+
}
|
|
16650
|
+
}
|
|
16651
|
+
var init_data_type = __esm({
|
|
16652
|
+
"../core/src/schema-utils/lib/schema/data-type.ts"() {
|
|
16653
|
+
"use strict";
|
|
16654
|
+
}
|
|
16655
|
+
});
|
|
16656
|
+
|
|
16117
16657
|
// ../core/src/schema-utils/lib/schema/convert-arrow-schema.ts
|
|
16118
16658
|
function serializeArrowSchema(arrowSchema) {
|
|
16119
16659
|
return {
|
|
@@ -16121,12 +16661,6 @@ return true;`);
|
|
|
16121
16661
|
metadata: serializeArrowMetadata(arrowSchema.metadata)
|
|
16122
16662
|
};
|
|
16123
16663
|
}
|
|
16124
|
-
function deserializeArrowSchema(schema, options) {
|
|
16125
|
-
return new Schema2(
|
|
16126
|
-
schema.fields.map((field) => deserializeArrowField(field, options)),
|
|
16127
|
-
deserializeArrowMetadata(schema.metadata)
|
|
16128
|
-
);
|
|
16129
|
-
}
|
|
16130
16664
|
function serializeArrowMetadata(arrowMetadata) {
|
|
16131
16665
|
return Object.fromEntries(arrowMetadata);
|
|
16132
16666
|
}
|
|
@@ -16549,259 +17083,6 @@ return true;`);
|
|
|
16549
17083
|
}
|
|
16550
17084
|
});
|
|
16551
17085
|
|
|
16552
|
-
// ../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts
|
|
16553
|
-
function splitArrowBuffers(input, options = {}) {
|
|
16554
|
-
const context = { ...options, copies: /* @__PURE__ */ new WeakMap() };
|
|
16555
|
-
if (isArrowTable2(input)) {
|
|
16556
|
-
return splitArrowTableBuffersInternal(input, context);
|
|
16557
|
-
}
|
|
16558
|
-
if (isArrowRecordBatch2(input)) {
|
|
16559
|
-
return splitArrowRecordBatchBuffers(input, context);
|
|
16560
|
-
}
|
|
16561
|
-
if (isArrowVector2(input)) {
|
|
16562
|
-
return splitArrowVectorBuffers(input, context);
|
|
16563
|
-
}
|
|
16564
|
-
return splitArrowDataBuffers(input, context);
|
|
16565
|
-
}
|
|
16566
|
-
function isArrowTable2(input) {
|
|
16567
|
-
return "batches" in input;
|
|
16568
|
-
}
|
|
16569
|
-
function isArrowRecordBatch2(input) {
|
|
16570
|
-
return "schema" in input && "data" in input && !Array.isArray(input.data);
|
|
16571
|
-
}
|
|
16572
|
-
function isArrowVector2(input) {
|
|
16573
|
-
return "data" in input && Array.isArray(input.data);
|
|
16574
|
-
}
|
|
16575
|
-
function splitArrowTableBuffersInternal(table, options) {
|
|
16576
|
-
const recordBatches = table.batches.map(
|
|
16577
|
-
(recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options)
|
|
16578
|
-
);
|
|
16579
|
-
return new Table(table.schema, recordBatches);
|
|
16580
|
-
}
|
|
16581
|
-
function splitArrowRecordBatchBuffers(recordBatch, options) {
|
|
16582
|
-
return new RecordBatch3(
|
|
16583
|
-
recordBatch.schema,
|
|
16584
|
-
splitArrowDataBuffers(recordBatch.data, options)
|
|
16585
|
-
);
|
|
16586
|
-
}
|
|
16587
|
-
function splitArrowDataBuffers(data, options) {
|
|
16588
|
-
const children = data.children.map((childData) => splitArrowDataBuffers(childData, options));
|
|
16589
|
-
const dictionary = data.dictionary ? splitArrowVectorBuffers(data.dictionary, options) : void 0;
|
|
16590
|
-
const buffers = {
|
|
16591
|
-
[BufferType.OFFSET]: splitArrowBuffer(data.buffers[BufferType.OFFSET], options),
|
|
16592
|
-
[BufferType.DATA]: splitArrowBuffer(data.buffers[BufferType.DATA], options),
|
|
16593
|
-
[BufferType.VALIDITY]: splitArrowBuffer(data.buffers[BufferType.VALIDITY], options),
|
|
16594
|
-
[BufferType.TYPE]: splitArrowBuffer(data.buffers[BufferType.TYPE], options)
|
|
16595
|
-
};
|
|
16596
|
-
return new Data(
|
|
16597
|
-
data.type,
|
|
16598
|
-
data.offset,
|
|
16599
|
-
data.length,
|
|
16600
|
-
// @ts-expect-error _nullCount is protected. Reuse it to preserve lazy null-count state.
|
|
16601
|
-
data._nullCount,
|
|
16602
|
-
buffers,
|
|
16603
|
-
children,
|
|
16604
|
-
dictionary
|
|
16605
|
-
);
|
|
16606
|
-
}
|
|
16607
|
-
function splitArrowVectorBuffers(vector, options) {
|
|
16608
|
-
return new Vector(vector.data.map((data) => splitArrowDataBuffers(data, options)));
|
|
16609
|
-
}
|
|
16610
|
-
function splitArrowBuffer(array, options) {
|
|
16611
|
-
if (!isArrowTypedArray(array)) {
|
|
16612
|
-
return array;
|
|
16613
|
-
}
|
|
16614
|
-
if (options.copy === "none") {
|
|
16615
|
-
return array;
|
|
16616
|
-
}
|
|
16617
|
-
if (options.copy !== "all" && array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {
|
|
16618
|
-
return array;
|
|
16619
|
-
}
|
|
16620
|
-
let copy = options.copies.get(array);
|
|
16621
|
-
if (!copy) {
|
|
16622
|
-
copy = array.slice();
|
|
16623
|
-
options.copies.set(array, copy);
|
|
16624
|
-
}
|
|
16625
|
-
return copy;
|
|
16626
|
-
}
|
|
16627
|
-
function isArrowTypedArray(value) {
|
|
16628
|
-
return ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
16629
|
-
}
|
|
16630
|
-
var init_split_arrow_buffers = __esm({
|
|
16631
|
-
"../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts"() {
|
|
16632
|
-
"use strict";
|
|
16633
|
-
init_Arrow_dom();
|
|
16634
|
-
}
|
|
16635
|
-
});
|
|
16636
|
-
|
|
16637
|
-
// ../core/src/schema-utils/lib/arrow/arrow-table-transport.ts
|
|
16638
|
-
function dehydrateArrowTable(table, options) {
|
|
16639
|
-
const splitTable = splitArrowBuffers(table, options);
|
|
16640
|
-
return {
|
|
16641
|
-
shape: "arrow-table",
|
|
16642
|
-
transport: "arrow-js",
|
|
16643
|
-
schema: serializeArrowSchema(splitTable.schema),
|
|
16644
|
-
batches: splitTable.batches.map((recordBatch) => dehydrateArrowRecordBatch(recordBatch))
|
|
16645
|
-
};
|
|
16646
|
-
}
|
|
16647
|
-
function hydrateArrowTable(table) {
|
|
16648
|
-
const schema = deserializeArrowSchema(table.schema);
|
|
16649
|
-
const recordBatches = table.batches.map(
|
|
16650
|
-
(recordBatch) => new RecordBatch3(schema, hydrateArrowData(recordBatch.data))
|
|
16651
|
-
);
|
|
16652
|
-
return new Table(schema, recordBatches);
|
|
16653
|
-
}
|
|
16654
|
-
function serializeArrowWorkerTable(result) {
|
|
16655
|
-
if (!isArrowTableWrapper(result)) {
|
|
16656
|
-
throw new Error("Workers require Arrow table output");
|
|
16657
|
-
}
|
|
16658
|
-
const { data, ...metadata } = result;
|
|
16659
|
-
return {
|
|
16660
|
-
...structuredClone(metadata),
|
|
16661
|
-
data: dehydrateArrowTable(data, { copy: "all" })
|
|
16662
|
-
};
|
|
16663
|
-
}
|
|
16664
|
-
function deserializeArrowWorkerTable(result) {
|
|
16665
|
-
if (!isDehydratedArrowTableWrapper(result)) {
|
|
16666
|
-
throw new Error("Workers require Arrow column transport");
|
|
16667
|
-
}
|
|
16668
|
-
return { ...result, data: hydrateArrowTable(result.data) };
|
|
16669
|
-
}
|
|
16670
|
-
function isArrowTableWrapper(value) {
|
|
16671
|
-
const table = value;
|
|
16672
|
-
return Boolean(
|
|
16673
|
-
table && table.shape === "arrow-table" && table.data && typeof table.data === "object" && "batches" in table.data
|
|
16674
|
-
);
|
|
16675
|
-
}
|
|
16676
|
-
function isDehydratedArrowTableWrapper(value) {
|
|
16677
|
-
const table = value;
|
|
16678
|
-
return Boolean(
|
|
16679
|
-
table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
|
|
16680
|
-
);
|
|
16681
|
-
}
|
|
16682
|
-
function dehydrateArrowRecordBatch(recordBatch) {
|
|
16683
|
-
return { data: dehydrateArrowData(recordBatch.data) };
|
|
16684
|
-
}
|
|
16685
|
-
function dehydrateArrowData(data) {
|
|
16686
|
-
return {
|
|
16687
|
-
type: serializeArrowType(data.type),
|
|
16688
|
-
offset: data.offset,
|
|
16689
|
-
length: data.length,
|
|
16690
|
-
// @ts-expect-error _nullCount is protected. Preserve the Arrow lazy null-count state.
|
|
16691
|
-
nullCount: data._nullCount,
|
|
16692
|
-
buffers: {
|
|
16693
|
-
[BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
|
|
16694
|
-
[BufferType.DATA]: data.buffers[BufferType.DATA],
|
|
16695
|
-
[BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
|
|
16696
|
-
[BufferType.TYPE]: data.buffers[BufferType.TYPE]
|
|
16697
|
-
},
|
|
16698
|
-
children: data.children.map((childData) => dehydrateArrowData(childData)),
|
|
16699
|
-
dictionary: data.dictionary ? dehydrateArrowVector(data.dictionary) : void 0
|
|
16700
|
-
};
|
|
16701
|
-
}
|
|
16702
|
-
function dehydrateArrowVector(vector) {
|
|
16703
|
-
return { data: vector.data.map((data) => dehydrateArrowData(data)) };
|
|
16704
|
-
}
|
|
16705
|
-
function hydrateArrowData(data) {
|
|
16706
|
-
const children = data.children.map((childData) => hydrateArrowData(childData));
|
|
16707
|
-
const dictionary = data.dictionary ? hydrateArrowVector(data.dictionary) : void 0;
|
|
16708
|
-
return new Data(
|
|
16709
|
-
deserializeArrowType(data.type),
|
|
16710
|
-
data.offset,
|
|
16711
|
-
data.length,
|
|
16712
|
-
data.nullCount,
|
|
16713
|
-
data.buffers,
|
|
16714
|
-
children,
|
|
16715
|
-
dictionary
|
|
16716
|
-
);
|
|
16717
|
-
}
|
|
16718
|
-
function hydrateArrowVector(vector) {
|
|
16719
|
-
return new Vector(vector.data.map((data) => hydrateArrowData(data)));
|
|
16720
|
-
}
|
|
16721
|
-
var init_arrow_table_transport = __esm({
|
|
16722
|
-
"../core/src/schema-utils/lib/arrow/arrow-table-transport.ts"() {
|
|
16723
|
-
"use strict";
|
|
16724
|
-
init_Arrow_dom();
|
|
16725
|
-
init_convert_arrow_schema();
|
|
16726
|
-
init_split_arrow_buffers();
|
|
16727
|
-
}
|
|
16728
|
-
});
|
|
16729
|
-
|
|
16730
|
-
// ../core/src/schema-utils/arrow-transport.ts
|
|
16731
|
-
var init_arrow_transport = __esm({
|
|
16732
|
-
"../core/src/schema-utils/arrow-transport.ts"() {
|
|
16733
|
-
"use strict";
|
|
16734
|
-
init_arrow_table_transport();
|
|
16735
|
-
init_split_arrow_buffers();
|
|
16736
|
-
}
|
|
16737
|
-
});
|
|
16738
|
-
|
|
16739
|
-
// ../core/src/schema-utils/lib/schema/data-type.ts
|
|
16740
|
-
function getDataTypeFromValue(value, defaultNumberType = "float32") {
|
|
16741
|
-
if (value instanceof Date) {
|
|
16742
|
-
return "date-millisecond";
|
|
16743
|
-
}
|
|
16744
|
-
if (typeof value === "number") {
|
|
16745
|
-
return defaultNumberType;
|
|
16746
|
-
}
|
|
16747
|
-
if (typeof value === "boolean") {
|
|
16748
|
-
return "bool";
|
|
16749
|
-
}
|
|
16750
|
-
if (typeof value === "string") {
|
|
16751
|
-
return "utf8";
|
|
16752
|
-
}
|
|
16753
|
-
if (value === null || value === "undefined") {
|
|
16754
|
-
return "null";
|
|
16755
|
-
}
|
|
16756
|
-
return "null";
|
|
16757
|
-
}
|
|
16758
|
-
function getDataTypeFromArray(array) {
|
|
16759
|
-
let type = getDataTypeFromTypedArray(array);
|
|
16760
|
-
if (type !== "null") {
|
|
16761
|
-
return { type, nullable: false };
|
|
16762
|
-
}
|
|
16763
|
-
if (array.length > 0) {
|
|
16764
|
-
type = getDataTypeFromValue(array[0]);
|
|
16765
|
-
return { type, nullable: true };
|
|
16766
|
-
}
|
|
16767
|
-
return { type: "null", nullable: true };
|
|
16768
|
-
}
|
|
16769
|
-
function getDataTypeFromTypedArray(array) {
|
|
16770
|
-
if (typeof Float16Array !== "undefined" && array instanceof Float16Array) {
|
|
16771
|
-
return "float16";
|
|
16772
|
-
}
|
|
16773
|
-
switch (array.constructor) {
|
|
16774
|
-
case Int8Array:
|
|
16775
|
-
return "int8";
|
|
16776
|
-
case Uint8Array:
|
|
16777
|
-
case Uint8ClampedArray:
|
|
16778
|
-
return "uint8";
|
|
16779
|
-
case Int16Array:
|
|
16780
|
-
return "int16";
|
|
16781
|
-
case Uint16Array:
|
|
16782
|
-
return "uint16";
|
|
16783
|
-
case Int32Array:
|
|
16784
|
-
return "int32";
|
|
16785
|
-
case Uint32Array:
|
|
16786
|
-
return "uint32";
|
|
16787
|
-
case BigInt64Array:
|
|
16788
|
-
return "int64";
|
|
16789
|
-
case BigUint64Array:
|
|
16790
|
-
return "uint64";
|
|
16791
|
-
case Float32Array:
|
|
16792
|
-
return "float32";
|
|
16793
|
-
case Float64Array:
|
|
16794
|
-
return "float64";
|
|
16795
|
-
default:
|
|
16796
|
-
return "null";
|
|
16797
|
-
}
|
|
16798
|
-
}
|
|
16799
|
-
var init_data_type = __esm({
|
|
16800
|
-
"../core/src/schema-utils/lib/schema/data-type.ts"() {
|
|
16801
|
-
"use strict";
|
|
16802
|
-
}
|
|
16803
|
-
});
|
|
16804
|
-
|
|
16805
17086
|
// ../core/src/schema-utils/lib/mesh/mesh-utils.ts
|
|
16806
17087
|
function getMeshBoundingBox(attributes) {
|
|
16807
17088
|
const positionAttribute = attributes?.POSITION;
|
|
@@ -16910,7 +17191,7 @@ return true;`);
|
|
|
16910
17191
|
var init_float162 = __esm({
|
|
16911
17192
|
"../core/src/schema/float16.ts"() {
|
|
16912
17193
|
"use strict";
|
|
16913
|
-
|
|
17194
|
+
init_dist2();
|
|
16914
17195
|
}
|
|
16915
17196
|
});
|
|
16916
17197
|
|
|
@@ -17816,8 +18097,8 @@ return true;`);
|
|
|
17816
18097
|
"src/pcd/pcd-loader-types.ts"() {
|
|
17817
18098
|
"use strict";
|
|
17818
18099
|
init_pcd_format();
|
|
17819
|
-
|
|
17820
|
-
VERSION = true ? "5.0.0-beta.
|
|
18100
|
+
init_arrow_worker_transport();
|
|
18101
|
+
VERSION = true ? "5.0.0-beta.6" : "latest";
|
|
17821
18102
|
PCDLoader = {
|
|
17822
18103
|
...PCDFormat,
|
|
17823
18104
|
dataType: null,
|
|
@@ -17929,7 +18210,7 @@ return true;`);
|
|
|
17929
18210
|
"src/pcd/pcd-loader.ts"() {
|
|
17930
18211
|
"use strict";
|
|
17931
18212
|
init_loader_utils();
|
|
17932
|
-
|
|
18213
|
+
init_arrow_worker_transport();
|
|
17933
18214
|
init_schema_utils();
|
|
17934
18215
|
init_parse_pcd();
|
|
17935
18216
|
init_pcd_loader_types();
|