@loaders.gl/tiles-3d 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.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
  3. package/dist/3d-tiles/dist.dev.js +941 -621
  4. package/dist/3d-tiles/dist.min.js +37 -37
  5. package/dist/3d-tiles/index.cjs +876 -947
  6. package/dist/3d-tiles/index.cjs.map +3 -3
  7. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js +5 -1
  8. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  9. package/dist/3d-tiles/lib/utils/version.js +1 -1
  10. package/dist/3d-tiles-archive-writer.cjs +1 -1
  11. package/dist/cesium-ion-loader-with-parser.cjs +821 -942
  12. package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
  13. package/dist/copc/copc-source-loader.js +2 -2
  14. package/dist/copc/copc-source-loader.js.map +1 -1
  15. package/dist/copc/copc-writer.js +1 -1
  16. package/dist/copc/index.cjs +121 -181
  17. package/dist/copc/index.cjs.map +3 -3
  18. package/dist/dist.dev.js +323 -40
  19. package/dist/dist.min.js +10 -10
  20. package/dist/i3s/arcgis-webscene-loader.js +1 -1
  21. package/dist/i3s/dist.dev.js +3173 -712
  22. package/dist/i3s/dist.min.js +47 -47
  23. package/dist/i3s/i3s-attribute-loader.js +1 -1
  24. package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
  25. package/dist/i3s/i3s-content-loader.js +1 -1
  26. package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
  27. package/dist/i3s/i3s-loader.js +1 -1
  28. package/dist/i3s/i3s-node-page-loader.js +1 -1
  29. package/dist/i3s/i3s-slpk-loader.js +1 -1
  30. package/dist/i3s/i3s-slpk-writer.js +1 -1
  31. package/dist/i3s/index.cjs +2097 -544
  32. package/dist/i3s/index.cjs.map +3 -3
  33. package/dist/i3s-content-worker-node.js +11 -11
  34. package/dist/i3s-content-worker-node.js.map +4 -4
  35. package/dist/i3s-content-worker.js +768 -346
  36. package/dist/i3s-lepcc-worker-node.js +245 -12
  37. package/dist/i3s-lepcc-worker-node.js.map +4 -4
  38. package/dist/i3s-lepcc-worker.js +240 -12
  39. package/dist/i3s-mesh-writer.cjs +1749 -290
  40. package/dist/i3s-mesh-writer.cjs.map +3 -3
  41. package/dist/i3s-slpk-writer.cjs +1 -1
  42. package/dist/index.cjs +98 -4
  43. package/dist/index.cjs.map +2 -2
  44. package/dist/point-cloud-tile-source-loader-types.js +1 -1
  45. package/dist/point-cloud-tile-source-loader.cjs +46 -2
  46. package/dist/point-cloud-tile-source-loader.cjs.map +2 -2
  47. package/dist/point-cloud-tile-source.cjs +45 -1
  48. package/dist/point-cloud-tile-source.cjs.map +1 -1
  49. package/dist/potree/dist.dev.js +325 -91
  50. package/dist/potree/dist.min.js +30 -30
  51. package/dist/potree/index.cjs +115 -176
  52. package/dist/potree/index.cjs.map +3 -3
  53. package/dist/potree/potree-bin-loader.js +1 -1
  54. package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
  55. package/dist/potree/potree-loader-types.js +1 -1
  56. package/dist/potree/potree-source-loader.js +1 -1
  57. package/dist/potree/potree-writer.js +1 -1
  58. package/dist/potree/potree2-source.d.ts.map +1 -1
  59. package/dist/potree/potree2-source.js +3 -13
  60. package/dist/potree/potree2-source.js.map +1 -1
  61. package/dist/potree-loader.cjs +1 -1
  62. package/package.json +13 -13
  63. package/src/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.ts +4 -1
  64. package/src/copc/copc-source-loader.ts +1 -1
  65. package/src/potree/potree2-source.ts +3 -14
@@ -780,6 +780,7 @@ var __exports__ = (() => {
780
780
  } catch {
781
781
  const moduleUrl = new URL(moduleLibraryUrl, globalThis.location.href).href;
782
782
  const library2 = await import(
783
+ /* webpackIgnore: true */
783
784
  /* @vite-ignore */
784
785
  moduleUrl
785
786
  );
@@ -2849,6 +2850,8 @@ var __exports__ = (() => {
2849
2850
  identityHints;
2850
2851
  /** Failure objects already included in telemetry. */
2851
2852
  countedFailures = /* @__PURE__ */ new WeakSet();
2853
+ /** Observer for cumulative transport counters, including asynchronous cancellation. */
2854
+ onTelemetry;
2852
2855
  /** Mutable counters backing immutable telemetry snapshots. */
2853
2856
  telemetry = {
2854
2857
  requestedBytes: 0,
@@ -2862,6 +2865,7 @@ var __exports__ = (() => {
2862
2865
  constructor(url2, options) {
2863
2866
  validateKnownByteLength(options.byteLength);
2864
2867
  this.url = url2;
2868
+ this.onTelemetry = options.onTelemetry;
2865
2869
  this.fetchFunction = options.fetch || ((input2, init) => globalThis.fetch(input2, init));
2866
2870
  this.fetchOptions = options.fetchOptions ? { ...options.fetchOptions, headers: new Headers(options.fetchOptions.headers) } : void 0;
2867
2871
  this.consistency = options.consistency || "best-effort";
@@ -2899,6 +2903,7 @@ var __exports__ = (() => {
2899
2903
  } else {
2900
2904
  this.telemetry.errorCount++;
2901
2905
  }
2906
+ this.onTelemetry?.(this.getTelemetry(), error62);
2902
2907
  }
2903
2908
  /** Performs and validates one exact HTTP range request. */
2904
2909
  async requestRange(offset2, length4, signal, expectedIdentity) {
@@ -2918,7 +2923,13 @@ var __exports__ = (() => {
2918
2923
  await cancelResponse(response);
2919
2924
  throw new Error(`HTTP byte-range request expected 206, received ${response.status}`);
2920
2925
  }
2921
- const contentRange = await readContentRange(response);
2926
+ const contentRange = response.headers.has("Content-Range") ? await readContentRange(response) : await this.inferContentRange(
2927
+ response,
2928
+ offset2,
2929
+ length4,
2930
+ expectedIdentity,
2931
+ abortContext.signal
2932
+ );
2922
2933
  const responseIdentity = getResponseIdentity(response, contentRange.byteLength);
2923
2934
  const responseError = getIdentityError(
2924
2935
  expectedIdentity,
@@ -2952,6 +2963,44 @@ var __exports__ = (() => {
2952
2963
  } finally {
2953
2964
  abortContext.removeAbortListeners();
2954
2965
  this.telemetry.networkTimeMs += getTimestamp2() - requestStartTime;
2966
+ this.onTelemetry?.(this.getTelemetry());
2967
+ }
2968
+ }
2969
+ /** Infers bounds for a CORS-filtered 206; the caller still validates the body length. */
2970
+ async inferContentRange(response, offset2, length4, expectedIdentity, signal) {
2971
+ try {
2972
+ let byteLength = expectedIdentity?.byteLength ?? this.identityHints.byteLength;
2973
+ if (byteLength === void 0) {
2974
+ const headers = new Headers(this.fetchOptions?.headers);
2975
+ headers.delete("Range");
2976
+ this.telemetry.requestCount++;
2977
+ const metadata = await this.fetchFunction(this.url, {
2978
+ ...this.fetchOptions,
2979
+ method: "HEAD",
2980
+ body: void 0,
2981
+ headers,
2982
+ signal
2983
+ });
2984
+ await cancelResponse(metadata);
2985
+ const value2 = metadata.headers.get("Content-Length");
2986
+ byteLength = value2 && /^\d+$/.test(value2) ? Number(value2) : NaN;
2987
+ if (metadata.status !== 200 || !Number.isSafeInteger(byteLength) || byteLength < offset2 + length4) {
2988
+ throw new Error(
2989
+ "HTTP byte-range response is missing Content-Range and HEAD did not provide a valid file length"
2990
+ );
2991
+ }
2992
+ const identityError = getIdentityError(
2993
+ getResponseIdentity(metadata, byteLength),
2994
+ getResponseIdentity(response, byteLength),
2995
+ this.identityHints,
2996
+ this.consistency
2997
+ );
2998
+ if (identityError) throw new Error(identityError);
2999
+ }
3000
+ return { offset: offset2, endOffset: offset2 + length4 - 1, byteLength };
3001
+ } catch (error62) {
3002
+ await cancelResponse(response);
3003
+ throw error62;
2955
3004
  }
2956
3005
  }
2957
3006
  /** Validates and consumes the special empty-object identity response. */
@@ -6042,6 +6091,35 @@ var __exports__ = (() => {
6042
6091
  out[15] = 1;
6043
6092
  return out;
6044
6093
  }
6094
+ function affineComponents(matrix) {
6095
+ if (matrix.length !== 16 || Array.from(matrix).some((x) => !Number.isFinite(x)) || matrix[3] !== 0 || matrix[7] !== 0 || matrix[11] !== 0 || matrix[15] !== 1) {
6096
+ throw new RangeError("Expected a finite affine matrix");
6097
+ }
6098
+ const scale6 = [
6099
+ Math.hypot(matrix[0], matrix[1], matrix[2]),
6100
+ Math.hypot(matrix[4], matrix[5], matrix[6]),
6101
+ Math.hypot(matrix[8], matrix[9], matrix[10])
6102
+ ];
6103
+ if (scale6.some((x) => x === 0 || !Number.isFinite(x)))
6104
+ throw new RangeError("Singular transform");
6105
+ const rotation2 = Array.from({ length: 9 }, (_, i) => matrix[Math.floor(i / 3) * 4 + i % 3] / scale6[Math.floor(i / 3)]);
6106
+ for (const [a, b] of [
6107
+ [0, 3],
6108
+ [0, 6],
6109
+ [3, 6]
6110
+ ]) {
6111
+ if (Math.abs(rotation2[a] * rotation2[b] + rotation2[a + 1] * rotation2[b + 1] + rotation2[a + 2] * rotation2[b + 2]) > 1e-7) {
6112
+ throw new RangeError("Sheared transforms do not have a TRS decomposition");
6113
+ }
6114
+ }
6115
+ const determinant3 = rotation2[0] * (rotation2[4] * rotation2[8] - rotation2[5] * rotation2[7]) - rotation2[3] * (rotation2[1] * rotation2[8] - rotation2[2] * rotation2[7]) + rotation2[6] * (rotation2[1] * rotation2[5] - rotation2[2] * rotation2[4]);
6116
+ if (determinant3 < 0) {
6117
+ scale6[0] = -scale6[0];
6118
+ for (let i = 0; i < 3; i++)
6119
+ rotation2[i] = -rotation2[i];
6120
+ }
6121
+ return { rotation: rotation2, scale: scale6, translation: [matrix[12], matrix[13], matrix[14]] };
6122
+ }
6045
6123
  var perspective, ortho;
6046
6124
  var init_mat4 = __esm({
6047
6125
  "../../node_modules/@math.gl/core/dist/gl-matrix/mat4.js"() {
@@ -6175,6 +6253,7 @@ var __exports__ = (() => {
6175
6253
  var init_matrix4 = __esm({
6176
6254
  "../../node_modules/@math.gl/core/dist/classes/matrix4.js"() {
6177
6255
  init_matrix();
6256
+ init_mat4();
6178
6257
  init_validators();
6179
6258
  init_gl_matrix_extras();
6180
6259
  init_mat4();
@@ -6459,27 +6538,15 @@ var __exports__ = (() => {
6459
6538
  * @returns self
6460
6539
  */
6461
6540
  getRotation(result, scaleResult) {
6462
- result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
6463
- scaleResult = scaleResult || [-0, -0, -0];
6464
- const scale6 = this.getScale(scaleResult);
6465
- const inverseScale0 = 1 / scale6[0];
6466
- const inverseScale1 = 1 / scale6[1];
6467
- const inverseScale2 = 1 / scale6[2];
6468
- result[0] = this[0] * inverseScale0;
6469
- result[1] = this[1] * inverseScale1;
6470
- result[2] = this[2] * inverseScale2;
6471
- result[3] = 0;
6472
- result[4] = this[4] * inverseScale0;
6473
- result[5] = this[5] * inverseScale1;
6474
- result[6] = this[6] * inverseScale2;
6475
- result[7] = 0;
6476
- result[8] = this[8] * inverseScale0;
6477
- result[9] = this[9] * inverseScale1;
6478
- result[10] = this[10] * inverseScale2;
6479
- result[11] = 0;
6480
- result[12] = 0;
6481
- result[13] = 0;
6482
- result[14] = 0;
6541
+ const { rotation: rotation2, scale: scale6 } = affineComponents(this);
6542
+ result = result || new Array(16);
6543
+ if (scaleResult)
6544
+ for (let i = 0; i < 3; i++)
6545
+ scaleResult[i] = scale6[i];
6546
+ for (let i = 0; i < 16; i++)
6547
+ result[i] = 0;
6548
+ for (let i = 0; i < 9; i++)
6549
+ result[Math.floor(i / 3) * 4 + i % 3] = rotation2[i];
6483
6550
  result[15] = 1;
6484
6551
  return result;
6485
6552
  }
@@ -6490,21 +6557,13 @@ var __exports__ = (() => {
6490
6557
  * @returns self
6491
6558
  */
6492
6559
  getRotationMatrix3(result, scaleResult) {
6493
- result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];
6494
- scaleResult = scaleResult || [-0, -0, -0];
6495
- const scale6 = this.getScale(scaleResult);
6496
- const inverseScale0 = 1 / scale6[0];
6497
- const inverseScale1 = 1 / scale6[1];
6498
- const inverseScale2 = 1 / scale6[2];
6499
- result[0] = this[0] * inverseScale0;
6500
- result[1] = this[1] * inverseScale1;
6501
- result[2] = this[2] * inverseScale2;
6502
- result[3] = this[4] * inverseScale0;
6503
- result[4] = this[5] * inverseScale1;
6504
- result[5] = this[6] * inverseScale2;
6505
- result[6] = this[8] * inverseScale0;
6506
- result[7] = this[9] * inverseScale1;
6507
- result[8] = this[10] * inverseScale2;
6560
+ const { rotation: rotation2, scale: scale6 } = affineComponents(this);
6561
+ result = result || new Array(9);
6562
+ if (scaleResult)
6563
+ for (let i = 0; i < 3; i++)
6564
+ scaleResult[i] = scale6[i];
6565
+ for (let i = 0; i < 9; i++)
6566
+ result[i] = rotation2[i];
6508
6567
  return result;
6509
6568
  }
6510
6569
  // Modifiers
@@ -6817,6 +6876,28 @@ var __exports__ = (() => {
6817
6876
  }
6818
6877
  return out;
6819
6878
  }
6879
+ function rotateTowards(out, a, b, step) {
6880
+ if (a.length !== 4 || b.length !== 4 || [...Array.from(a), ...Array.from(b), step].some((x) => !Number.isFinite(x))) {
6881
+ throw new RangeError("Expected finite quaternions and step");
6882
+ }
6883
+ if (a.length !== 4 || step < 0)
6884
+ throw new RangeError("Expected quaternions and a nonnegative step");
6885
+ const aScale = Math.max(...Array.from(a, Math.abs)), bScale = Math.max(...Array.from(b, Math.abs));
6886
+ if (!aScale || !bScale)
6887
+ throw new RangeError("Zero quaternion");
6888
+ const an = Array.from(a, (x) => x / aScale), bn = Array.from(b, (x) => x / bScale);
6889
+ const al = Math.hypot(...an), bl = Math.hypot(...bn);
6890
+ for (let i = 0; i < 4; i++) {
6891
+ an[i] /= al;
6892
+ bn[i] /= bl;
6893
+ }
6894
+ const dot5 = an.reduce((sum, x, i) => sum + x * bn[i], 0);
6895
+ const angle2 = 2 * Math.acos(Math.min(1, Math.abs(dot5)));
6896
+ if (out.length < 4)
6897
+ throw new RangeError("Result buffer is too short");
6898
+ slerp(out, an, bn, angle2 === 0 ? 0 : Math.min(1, step / angle2));
6899
+ return out;
6900
+ }
6820
6901
  var add2, scale4, dot3, lerp2, length3, squaredLength2, normalize3, rotationTo;
6821
6902
  var init_quat = __esm({
6822
6903
  "../../node_modules/@math.gl/core/dist/gl-matrix/quat.js"() {
@@ -6865,6 +6946,7 @@ var __exports__ = (() => {
6865
6946
  var Quaternion;
6866
6947
  var init_quaternion = __esm({
6867
6948
  "../../node_modules/@math.gl/core/dist/classes/quaternion.js"() {
6949
+ init_quat();
6868
6950
  init_math_array();
6869
6951
  init_validators();
6870
6952
  init_quat();
@@ -6938,6 +7020,9 @@ var __exports__ = (() => {
6938
7020
  return this.check();
6939
7021
  }
6940
7022
  /** Set a quat to the identity quaternion */
7023
+ rotateTowards(target, step) {
7024
+ return rotateTowards(this, this, target, step);
7025
+ }
6941
7026
  identity() {
6942
7027
  identity2(this);
6943
7028
  return this.check();
@@ -7413,6 +7498,19 @@ var __exports__ = (() => {
7413
7498
  }
7414
7499
  });
7415
7500
 
7501
+ // ../../node_modules/@math.gl/core/dist/projections.js
7502
+ function getProjectionDepthRange(options = {}) {
7503
+ const range = options.depthRange ?? "negative-one-to-one";
7504
+ if (range !== "negative-one-to-one" && range !== "zero-to-one")
7505
+ throw new RangeError("Unknown depth range");
7506
+ const low = range === "zero-to-one" ? 0 : -1;
7507
+ return options.reversedDepth ? [1, low] : [low, 1];
7508
+ }
7509
+ var init_projections = __esm({
7510
+ "../../node_modules/@math.gl/core/dist/projections.js"() {
7511
+ }
7512
+ });
7513
+
7416
7514
  // ../../node_modules/@math.gl/core/dist/index.js
7417
7515
  var init_dist = __esm({
7418
7516
  "../../node_modules/@math.gl/core/dist/index.js"() {
@@ -7434,6 +7532,7 @@ var __exports__ = (() => {
7434
7532
  init_vec32();
7435
7533
  init_vec42();
7436
7534
  init_mat42();
7535
+ init_projections();
7437
7536
  }
7438
7537
  });
7439
7538
 
@@ -8386,11 +8485,49 @@ var __exports__ = (() => {
8386
8485
  }
8387
8486
  });
8388
8487
 
8488
+ // ../../node_modules/@math.gl/geometry/dist/culling/frustum-planes.js
8489
+ function extractFrustumPlanes(matrix, options = {}) {
8490
+ if (matrix.length !== 16 || Array.from(matrix).some((x2) => !Number.isFinite(x2)))
8491
+ throw new RangeError("Expected a finite view-projection matrix");
8492
+ const [near, far] = getProjectionDepthRange(options);
8493
+ const low = Math.min(near, far), high = Math.max(near, far);
8494
+ const row = (i) => [matrix[i], matrix[i + 4], matrix[i + 8], matrix[i + 12]];
8495
+ const x = row(0), y = row(1), z2 = row(2), w = row(3);
8496
+ const combine2 = (a, b, factor) => a.map((v, i) => v + factor * b[i]);
8497
+ const lo = combine2(z2, w, -low), hi = w.map((v, i) => high * v - z2[i]);
8498
+ const coefficients = [
8499
+ combine2(w, x, 1),
8500
+ combine2(w, x, -1),
8501
+ combine2(w, y, 1),
8502
+ combine2(w, y, -1),
8503
+ ...options.reversedDepth ? [hi, lo] : [lo, hi]
8504
+ ];
8505
+ const planes = [];
8506
+ for (const [a, b, c, d] of coefficients) {
8507
+ const length4 = Math.hypot(a, b, c);
8508
+ if (length4 === 0) {
8509
+ if (d < 0)
8510
+ throw new RangeError("Empty clipping volume");
8511
+ } else
8512
+ planes.push(new Plane([a / length4, b / length4, c / length4], d / length4));
8513
+ }
8514
+ if (planes.length < 4)
8515
+ throw new RangeError("Degenerate clipping volume");
8516
+ return planes;
8517
+ }
8518
+ var init_frustum_planes = __esm({
8519
+ "../../node_modules/@math.gl/geometry/dist/culling/frustum-planes.js"() {
8520
+ init_dist();
8521
+ init_plane();
8522
+ }
8523
+ });
8524
+
8389
8525
  // ../../node_modules/@math.gl/geometry/dist/culling/lib/culling-volume.js
8390
8526
  var faces, scratchPlaneCenter, scratchPlaneNormal, CullingVolume;
8391
8527
  var init_culling_volume = __esm({
8392
8528
  "../../node_modules/@math.gl/geometry/dist/culling/lib/culling-volume.js"() {
8393
8529
  init_dist();
8530
+ init_frustum_planes();
8394
8531
  init_plane();
8395
8532
  faces = [new Vector3([1, 0, 0]), new Vector3([0, 1, 0]), new Vector3([0, 0, 1])];
8396
8533
  scratchPlaneCenter = new Vector3();
@@ -8430,6 +8567,12 @@ var __exports__ = (() => {
8430
8567
  }
8431
8568
  return this;
8432
8569
  }
8570
+ /** Replace planes from a view-projection matrix; validates before mutating. */
8571
+ fromViewProjection(matrix, options = {}) {
8572
+ const planes = extractFrustumPlanes(matrix, options);
8573
+ this.planes.splice(0, this.planes.length, ...planes);
8574
+ return this;
8575
+ }
8433
8576
  /** Determines whether a bounding volume intersects the culling volume. */
8434
8577
  computeVisibility(boundingVolume) {
8435
8578
  let intersect = "inside";
@@ -16421,19 +16564,26 @@ var __exports__ = (() => {
16421
16564
  for (const [primitiveIndex, primitive] of mesh.primitives.entries()) {
16422
16565
  const extension = primitive.extensions?.[name6];
16423
16566
  if (!extension) continue;
16567
+ const descriptor = descriptors.find(
16568
+ (item) => item.meshIndex === meshIndex && item.primitiveIndex === primitiveIndex
16569
+ );
16570
+ const legacyColorSpace = options?.gltf?.legacyGaussianSplatColorSpace;
16571
+ const normalizedExtension = legacyColorSpace && extension.extensions?.[SPZ_COMPRESSION_EXTENSION_NAME] ? {
16572
+ ...extension,
16573
+ kernel: extension.kernel ?? "ellipse",
16574
+ colorSpace: extension.colorSpace ?? legacyColorSpace
16575
+ } : extension;
16576
+ if (descriptor) descriptor.extension = normalizedExtension;
16424
16577
  validateGaussianSplatPrimitive(
16425
16578
  gltfData.json,
16426
16579
  primitive,
16427
- extension,
16580
+ normalizedExtension,
16428
16581
  meshIndex,
16429
16582
  primitiveIndex,
16430
16583
  iterator
16431
16584
  );
16432
16585
  const compression = extension.extensions?.[SPZ_COMPRESSION_EXTENSION_NAME];
16433
16586
  if (compression) {
16434
- const descriptor = descriptors.find(
16435
- (item) => item.meshIndex === meshIndex && item.primitiveIndex === primitiveIndex
16436
- );
16437
16587
  if (descriptor) {
16438
16588
  const decoder2 = options?.gltf?.splatDecoder;
16439
16589
  const bufferView = gltfData.json.bufferViews?.[compression.bufferView];
@@ -37949,7 +38099,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
37949
38099
  });
37950
38100
 
37951
38101
  // ../scene/src/gltf/lib/types/gltf-additional-extension-schemas.ts
37952
- var indexSchema, propertyShape, GLTFKHRMaterialVariantSchema, GLTFKHRMaterialsVariantsSchema, GLTFKHRMaterialVariantMappingSchema, GLTFKHRMaterialsVariantsPrimitiveSchema, GLTFEXTMeshGPUInstancingSchema, GLTFKHRAnimationPointerSchema, GLTFKHRNodeVisibilitySchema, GLTFKHRNodeSelectabilitySchema, GLTFKHRNodeHoverabilitySchema, GLTFKHRXMPPacketSchema, GLTFKHRXMPJSONLDSchema, GLTFKHRXMPJSONLDReferenceSchema;
38102
+ var indexSchema, propertyShape, GLTFKHRMaterialVariantSchema, GLTFKHRMaterialsVariantsSchema, GLTFKHRMaterialVariantMappingSchema, GLTFKHRMaterialsVariantsPrimitiveSchema, GLTFEXTMeshGPUInstancingSchema, GLTFKHRAnimationPointerSchema, GLTFKHRNodeVisibilitySchema, GLTFKHRNodeSelectabilitySchema, GLTFKHRNodeHoverabilitySchema, GLTFKHRXMPPacketSchema, GLTFKHRXMPJSONLDSchema, GLTFKHRXMPJSONLDReferenceSchema, GLTFKHRMaterialsEmissiveStrengthSchema, GLTFFBGeometryMetadataSchema;
37953
38103
  var init_gltf_additional_extension_schemas = __esm({
37954
38104
  "../scene/src/gltf/lib/types/gltf-additional-extension-schemas.ts"() {
37955
38105
  "use strict";
@@ -38024,6 +38174,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
38024
38174
  /** Index into the document-level packets array. */
38025
38175
  packet: indexSchema
38026
38176
  });
38177
+ GLTFKHRMaterialsEmissiveStrengthSchema = external_exports.looseObject({
38178
+ ...propertyShape,
38179
+ /** Unitless multiplier; defaults to one when omitted. */
38180
+ emissiveStrength: external_exports.number().nonnegative().optional()
38181
+ });
38182
+ GLTFFBGeometryMetadataSchema = external_exports.looseObject({
38183
+ ...propertyShape,
38184
+ /** Authored count of vertices. */
38185
+ vertexCount: external_exports.number().nonnegative().optional(),
38186
+ /** Authored count of primitives. */
38187
+ primitiveCount: external_exports.number().nonnegative().optional(),
38188
+ /** Static scene-space bounding box. */
38189
+ sceneBounds: external_exports.looseObject({
38190
+ ...propertyShape,
38191
+ min: external_exports.array(external_exports.number()).length(3),
38192
+ max: external_exports.array(external_exports.number()).length(3)
38193
+ }).optional()
38194
+ });
38027
38195
  }
38028
38196
  });
38029
38197
 
@@ -38175,7 +38343,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
38175
38343
  });
38176
38344
 
38177
38345
  // ../scene/src/gltf/lib/types/gltf-extension-schemas.ts
38178
- var GLTFPropertyExtensionsSchema, GLTFRootExtensionsSchema, GLTFNodeExtensionsSchema, GLTFSceneExtensionsSchema, GLTFMeshPrimitiveExtensionsSchema, GLTFAnimationTargetExtensionsSchema;
38346
+ var GLTFPropertyExtensionsSchema, GLTFMaterialExtensionsSchema, GLTFRootExtensionsSchema, GLTFNodeExtensionsSchema, GLTFSceneExtensionsSchema, GLTFMeshPrimitiveExtensionsSchema, GLTFAnimationTargetExtensionsSchema;
38179
38347
  var init_gltf_extension_schemas = __esm({
38180
38348
  "../scene/src/gltf/lib/types/gltf-extension-schemas.ts"() {
38181
38349
  "use strict";
@@ -38186,6 +38354,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
38186
38354
  /** Shared XMP packet reference. */
38187
38355
  KHR_xmp_json_ld: GLTFKHRXMPJSONLDReferenceSchema.optional()
38188
38356
  });
38357
+ GLTFMaterialExtensionsSchema = GLTFPropertyExtensionsSchema.extend({
38358
+ /** Emissive intensity multiplier. */
38359
+ KHR_materials_emissive_strength: GLTFKHRMaterialsEmissiveStrengthSchema.optional()
38360
+ });
38189
38361
  GLTFRootExtensionsSchema = external_exports.looseObject({
38190
38362
  /** Shared material variant declarations. */
38191
38363
  KHR_materials_variants: GLTFKHRMaterialsVariantsSchema.optional(),
@@ -38211,6 +38383,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
38211
38383
  MPEG_audio_spatial: GLTFMPEGAudioSpatialSchema.optional()
38212
38384
  });
38213
38385
  GLTFSceneExtensionsSchema = GLTFPropertyExtensionsSchema.extend({
38386
+ /** Authored static geometry summary. */
38387
+ FB_geometry_metadata: GLTFFBGeometryMetadataSchema.optional(),
38214
38388
  /** Attached global KHR audio emitters. */
38215
38389
  KHR_audio_emitter: GLTFKHRAudioAttachmentSchema.optional()
38216
38390
  });
@@ -54008,442 +54182,29 @@ return true;`);
54008
54182
  }
54009
54183
  });
54010
54184
 
54011
- // ../core/src/schema-utils/lib/schema/convert-arrow-schema.ts
54012
- function serializeArrowSchema(arrowSchema) {
54013
- return {
54014
- fields: arrowSchema.fields.map((arrowField) => serializeArrowField(arrowField)),
54015
- metadata: serializeArrowMetadata(arrowSchema.metadata)
54016
- };
54017
- }
54018
- function deserializeArrowSchema(schema, options) {
54019
- return new Schema2(
54020
- schema.fields.map((field) => deserializeArrowField(field, options)),
54021
- deserializeArrowMetadata(schema.metadata)
54022
- );
54023
- }
54024
- function serializeArrowMetadata(arrowMetadata) {
54025
- return Object.fromEntries(arrowMetadata);
54026
- }
54027
- function deserializeArrowMetadata(metadata) {
54028
- return metadata ? new Map(Object.entries(metadata)) : /* @__PURE__ */ new Map();
54029
- }
54030
- function serializeArrowField(field) {
54031
- return {
54032
- name: field.name,
54033
- type: serializeArrowType(field.type),
54034
- nullable: field.nullable,
54035
- metadata: serializeArrowMetadata(field.metadata)
54036
- };
54037
- }
54038
- function deserializeArrowField(field, options) {
54039
- return new Field2(
54040
- field.name,
54041
- deserializeArrowType(field.type, options),
54042
- field.nullable,
54043
- deserializeArrowMetadata(field.metadata)
54044
- );
54045
- }
54046
- function serializeArrowType(arrowType) {
54047
- if (isArrowViewType(arrowType, "BinaryView")) {
54048
- return "binary-view";
54049
- }
54050
- if (isArrowViewType(arrowType, "Utf8View")) {
54051
- return "utf8-view";
54052
- }
54053
- if (isOptionalArrowType(arrowType, "LargeList")) {
54054
- const largeListType = arrowType;
54055
- return {
54056
- type: "large-list",
54057
- children: [serializeArrowField(largeListType.valueField)]
54058
- };
54059
- }
54060
- switch (arrowType.constructor) {
54061
- case Null2:
54062
- return "null";
54063
- case Binary2:
54064
- return "binary";
54065
- case FixedSizeBinary2:
54066
- return {
54067
- type: "fixed-size-binary",
54068
- byteWidth: arrowType.byteWidth
54069
- };
54070
- case Bool2:
54071
- return "bool";
54072
- case Int_:
54073
- const intType = arrowType;
54074
- return `${intType.isSigned ? "" : "u"}int${intType.bitWidth}`;
54075
- case Int8:
54076
- return "int8";
54077
- case Int16:
54078
- return "int16";
54079
- case Int32:
54080
- return "int32";
54081
- case Int64:
54082
- return "int64";
54083
- case Uint8:
54084
- return "uint8";
54085
- case Uint16:
54086
- return "uint16";
54087
- case Uint32:
54088
- return "uint32";
54089
- case Uint64:
54090
- return "uint64";
54091
- case Float:
54092
- const precision = arrowType.precision;
54093
- switch (precision) {
54094
- case Precision.HALF:
54095
- return "float16";
54096
- case Precision.SINGLE:
54097
- return "float32";
54098
- case Precision.DOUBLE:
54099
- return "float64";
54100
- default:
54101
- return "float16";
54102
- }
54103
- case Float16:
54104
- return "float16";
54105
- case Float32:
54106
- return "float32";
54107
- case Float64:
54108
- return "float64";
54109
- case Utf82:
54110
- return "utf8";
54111
- case Decimal2:
54112
- const decimal = arrowType;
54113
- return {
54114
- type: "decimal",
54115
- bitWidth: decimal.bitWidth,
54116
- precision: decimal.precision,
54117
- scale: decimal.scale
54118
- };
54119
- case Date_:
54120
- const dateUnit = arrowType.unit;
54121
- return dateUnit === DateUnit.DAY ? "date-day" : "date-millisecond";
54122
- case DateDay:
54123
- return "date-day";
54124
- case DateMillisecond:
54125
- return "date-millisecond";
54126
- case Time_:
54127
- const timeUnit = arrowType.unit;
54128
- switch (timeUnit) {
54129
- case TimeUnit.SECOND:
54130
- return "time-second";
54131
- case TimeUnit.MILLISECOND:
54132
- return "time-millisecond";
54133
- case TimeUnit.MICROSECOND:
54134
- return "time-microsecond";
54135
- case TimeUnit.NANOSECOND:
54136
- return "time-nanosecond";
54137
- default:
54138
- return "time-second";
54139
- }
54140
- case TimeMillisecond:
54141
- return "time-millisecond";
54142
- case TimeSecond:
54143
- return "time-second";
54144
- case TimeMicrosecond:
54145
- return "time-microsecond";
54146
- case TimeNanosecond:
54147
- return "time-nanosecond";
54148
- case Timestamp_:
54149
- const timeStampUnit = arrowType.unit;
54150
- switch (timeStampUnit) {
54151
- case TimeUnit.SECOND:
54152
- return "timestamp-second";
54153
- case TimeUnit.MILLISECOND:
54154
- return "timestamp-millisecond";
54155
- case TimeUnit.MICROSECOND:
54156
- return "timestamp-microsecond";
54157
- case TimeUnit.NANOSECOND:
54158
- return "timestamp-nanosecond";
54159
- default:
54160
- return "timestamp-second";
54161
- }
54162
- case TimestampSecond:
54163
- return "timestamp-second";
54164
- case TimestampMillisecond:
54165
- return "timestamp-millisecond";
54166
- case TimestampMicrosecond:
54167
- return "timestamp-microsecond";
54168
- case TimestampNanosecond:
54169
- return "timestamp-nanosecond";
54170
- case Interval_:
54171
- const intervalUnit = arrowType.unit;
54172
- switch (intervalUnit) {
54173
- case IntervalUnit.DAY_TIME:
54174
- return "interval-daytime";
54175
- case IntervalUnit.YEAR_MONTH:
54176
- return "interval-yearmonth";
54177
- default:
54178
- return "interval-daytime";
54179
- }
54180
- case IntervalDayTime:
54181
- return "interval-daytime";
54182
- case IntervalYearMonth:
54183
- return "interval-yearmonth";
54184
- case Map_:
54185
- const mapType = arrowType;
54186
- return {
54187
- type: "map",
54188
- keysSorted: mapType.keysSorted,
54189
- children: mapType.children.map((arrowField) => serializeArrowField(arrowField))
54190
- };
54191
- case List2:
54192
- const listType = arrowType;
54193
- const listField = listType.valueField;
54194
- return {
54195
- type: "list",
54196
- children: [serializeArrowField(listField)]
54197
- };
54198
- case FixedSizeList2:
54199
- const fixedSizeList = arrowType;
54200
- return {
54201
- type: "fixed-size-list",
54202
- listSize: fixedSizeList.listSize,
54203
- children: [serializeArrowField(fixedSizeList.children[0])]
54204
- };
54205
- case Struct:
54206
- const structType = arrowType;
54207
- return {
54208
- type: "struct",
54209
- children: structType.children.map((arrowField) => serializeArrowField(arrowField))
54210
- };
54211
- case SparseUnion:
54212
- case DenseUnion:
54213
- const unionType = arrowType;
54214
- return {
54215
- type: unionType instanceof DenseUnion ? "dense-union" : "sparse-union",
54216
- typeIds: unionType.typeIds,
54217
- children: unionType.children.map((arrowField) => serializeArrowField(arrowField)),
54218
- typeIdToChildIndex: { ...unionType.typeIdToChildIndex }
54219
- };
54220
- case Dictionary:
54221
- const dictionaryType = arrowType;
54222
- return {
54223
- type: "dictionary",
54224
- id: dictionaryType.id,
54225
- indices: serializeArrowDictionaryKeyType(dictionaryType.indices),
54226
- dictionary: serializeArrowType(dictionaryType.dictionary),
54227
- isOrdered: dictionaryType.isOrdered
54228
- };
54229
- default:
54230
- throw new Error(`arrow type not supported: ${arrowType.constructor.name}`);
54231
- }
54185
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js
54186
+ function getArrowVariadicBuffers(data) {
54187
+ return data.variadicBuffers ?? [];
54232
54188
  }
54233
- function deserializeArrowType(dataType, options) {
54234
- if (typeof dataType === "object") {
54235
- switch (dataType.type) {
54236
- case "decimal":
54237
- return new Decimal2(dataType.scale, dataType.precision, dataType.bitWidth);
54238
- case "map": {
54239
- const children2 = dataType.children.map(
54240
- (arrowField) => deserializeArrowField(arrowField, options)
54241
- );
54242
- return new Map_(children2[0], dataType.keysSorted);
54243
- }
54244
- case "list": {
54245
- const field = deserializeArrowField(dataType.children[0], options);
54246
- return new List2(field);
54247
- }
54248
- case "large-list": {
54249
- const field = deserializeArrowField(dataType.children[0], options);
54250
- const LargeList3 = getOptionalArrowConstructor("LargeList");
54251
- if (!LargeList3) {
54252
- throw new Error(
54253
- "LargeList requires an Apache Arrow runtime that exports the LargeList constructor"
54254
- );
54255
- }
54256
- return new LargeList3(field);
54257
- }
54258
- case "fixed-size-list": {
54259
- const child2 = deserializeArrowField(dataType.children[0], options);
54260
- return new FixedSizeList2(dataType.listSize, child2);
54261
- }
54262
- case "fixed-size-binary":
54263
- return new FixedSizeBinary2(dataType.byteWidth);
54264
- case "struct": {
54265
- const children2 = dataType.children.map(
54266
- (arrowField) => deserializeArrowField(arrowField, options)
54267
- );
54268
- return new Struct(children2);
54269
- }
54270
- case "sparse-union":
54271
- case "dense-union": {
54272
- const children2 = dataType.children.map(
54273
- (arrowField) => deserializeArrowField(arrowField, options)
54274
- );
54275
- return dataType.type === "dense-union" ? new DenseUnion(dataType.typeIds, children2) : new SparseUnion(dataType.typeIds, children2);
54276
- }
54277
- case "dictionary": {
54278
- return new Dictionary(
54279
- deserializeArrowType(dataType.dictionary, options),
54280
- deserializeArrowDictionaryKeyType(dataType.indices),
54281
- dataType.id,
54282
- dataType.isOrdered
54283
- );
54284
- }
54285
- default:
54286
- throw new Error("array type not supported");
54287
- }
54288
- }
54289
- switch (dataType) {
54290
- case "null":
54291
- return new Null2();
54292
- case "binary":
54293
- return makeVariableWidthArrowType("BinaryView", new Binary2(), options);
54294
- case "binary-view":
54295
- return makeRequiredArrowViewType("BinaryView");
54296
- case "bool":
54297
- return new Bool2();
54298
- case "int8":
54299
- return new Int8();
54300
- case "int16":
54301
- return new Int16();
54302
- case "int32":
54303
- return new Int32();
54304
- case "int64":
54305
- return new Int64();
54306
- case "uint8":
54307
- return new Uint8();
54308
- case "uint16":
54309
- return new Uint16();
54310
- case "uint32":
54311
- return new Uint32();
54312
- case "uint64":
54313
- return new Uint64();
54314
- case "float16":
54315
- return new Float16();
54316
- case "float32":
54317
- return new Float32();
54318
- case "float64":
54319
- return new Float64();
54320
- case "utf8":
54321
- return makeVariableWidthArrowType("Utf8View", new Utf82(), options);
54322
- case "utf8-view":
54323
- return makeRequiredArrowViewType("Utf8View");
54324
- case "date-day":
54325
- return new DateDay();
54326
- case "date-millisecond":
54327
- return new DateMillisecond();
54328
- case "time-second":
54329
- return new TimeSecond();
54330
- case "time-millisecond":
54331
- return new TimeMillisecond();
54332
- case "time-microsecond":
54333
- return new TimeMicrosecond();
54334
- case "time-nanosecond":
54335
- return new TimeNanosecond();
54336
- case "timestamp-second":
54337
- return new TimestampSecond();
54338
- case "timestamp-millisecond":
54339
- return new TimestampMillisecond();
54340
- case "timestamp-microsecond":
54341
- return new TimestampMicrosecond();
54342
- case "timestamp-nanosecond":
54343
- return new TimestampNanosecond();
54344
- case "interval-daytime":
54345
- return new IntervalDayTime();
54346
- case "interval-yearmonth":
54347
- return new IntervalYearMonth();
54348
- default:
54349
- throw new Error("array type not supported");
54350
- }
54351
- }
54352
- function getOptionalArrowConstructor(typeName) {
54353
- return Arrow_dom_exports[typeName];
54354
- }
54355
- function isArrowViewType(arrowType, viewTypeName) {
54356
- const constructor = getOptionalArrowConstructor(viewTypeName);
54357
- if (constructor && arrowType instanceof constructor) {
54358
- return true;
54359
- }
54360
- const guards = DataType;
54361
- const guard = viewTypeName === "BinaryView" ? guards.isBinaryView : guards.isUtf8View;
54362
- return Boolean(guard?.(arrowType));
54363
- }
54364
- function isOptionalArrowType(arrowType, typeName) {
54365
- const constructor = getOptionalArrowConstructor(typeName);
54366
- return Boolean(constructor && arrowType instanceof constructor);
54367
- }
54368
- function makeVariableWidthArrowType(viewTypeName, fallbackType, options) {
54369
- const viewTypeMode = options?.viewTypes || "never";
54370
- if (viewTypeMode === "never") {
54371
- return fallbackType;
54372
- }
54373
- const constructor = getOptionalArrowConstructor(viewTypeName);
54374
- if (constructor) {
54375
- return new constructor();
54376
- }
54377
- if (viewTypeMode === "require") {
54378
- throw new Error(
54379
- `${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
54380
- );
54381
- }
54382
- return fallbackType;
54383
- }
54384
- function makeRequiredArrowViewType(viewTypeName) {
54385
- const constructor = getOptionalArrowConstructor(viewTypeName);
54386
- if (!constructor) {
54387
- throw new Error(
54388
- `${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
54389
- );
54390
- }
54391
- return new constructor();
54392
- }
54393
- function serializeArrowDictionaryKeyType(arrowType) {
54394
- if (arrowType instanceof Int_) {
54395
- const prefix = arrowType.isSigned ? "int" : "uint";
54396
- const keyType = `${prefix}${arrowType.bitWidth}`;
54397
- if (isSchemaDictionaryKeyType(keyType)) {
54398
- return keyType;
54399
- }
54400
- }
54401
- switch (arrowType.constructor) {
54402
- case Int8:
54403
- return "int8";
54404
- case Int16:
54405
- return "int16";
54406
- case Int32:
54407
- return "int32";
54408
- case Uint8:
54409
- return "uint8";
54410
- case Uint16:
54411
- return "uint16";
54412
- case Uint32:
54413
- return "uint32";
54414
- default:
54415
- throw new Error(`arrow dictionary index type not supported: ${arrowType.constructor.name}`);
54416
- }
54417
- }
54418
- function isSchemaDictionaryKeyType(keyType) {
54419
- return ["int8", "int16", "int32", "uint8", "uint16", "uint32"].includes(keyType);
54420
- }
54421
- function deserializeArrowDictionaryKeyType(keyType) {
54422
- switch (keyType) {
54423
- case "int8":
54424
- return new Int8();
54425
- case "int16":
54426
- return new Int16();
54427
- case "int32":
54428
- return new Int32();
54429
- case "uint8":
54430
- return new Uint8();
54431
- case "uint16":
54432
- return new Uint16();
54433
- case "uint32":
54434
- return new Uint32();
54435
- default:
54436
- throw new Error(`schema dictionary index type not supported: ${keyType}`);
54437
- }
54189
+ function createArrowData(type, offset2, length4, nullCount, buffers, children2, dictionary, variadicBuffers) {
54190
+ return Reflect.construct(Data, [
54191
+ type,
54192
+ offset2,
54193
+ length4,
54194
+ nullCount,
54195
+ buffers,
54196
+ children2,
54197
+ dictionary,
54198
+ variadicBuffers
54199
+ ]);
54438
54200
  }
54439
- var init_convert_arrow_schema = __esm({
54440
- "../core/src/schema-utils/lib/schema/convert-arrow-schema.ts"() {
54441
- "use strict";
54201
+ var init_arrow_data = __esm({
54202
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js"() {
54442
54203
  init_Arrow_dom();
54443
54204
  }
54444
54205
  });
54445
54206
 
54446
- // ../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts
54207
+ // ../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js
54447
54208
  function splitArrowBuffers(input2, options = {}) {
54448
54209
  const context = { ...options, copies: /* @__PURE__ */ new WeakMap() };
54449
54210
  if (isArrowTable2(input2)) {
@@ -54466,17 +54227,12 @@ return true;`);
54466
54227
  function isArrowVector2(input2) {
54467
54228
  return "data" in input2 && Array.isArray(input2.data);
54468
54229
  }
54469
- function splitArrowTableBuffersInternal(table, options) {
54470
- const recordBatches = table.batches.map(
54471
- (recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options)
54472
- );
54473
- return new Table(table.schema, recordBatches);
54230
+ function splitArrowTableBuffersInternal(arrowTable, options) {
54231
+ const recordBatches = arrowTable.batches.map((recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options));
54232
+ return new Table(arrowTable.schema, recordBatches);
54474
54233
  }
54475
54234
  function splitArrowRecordBatchBuffers(recordBatch, options) {
54476
- return new RecordBatch3(
54477
- recordBatch.schema,
54478
- splitArrowDataBuffers(recordBatch.data, options)
54479
- );
54235
+ return new RecordBatch3(recordBatch.schema, splitArrowDataBuffers(recordBatch.data, options));
54480
54236
  }
54481
54237
  function splitArrowDataBuffers(data, options) {
54482
54238
  const children2 = data.children.map((childData) => splitArrowDataBuffers(childData, options));
@@ -54487,7 +54243,7 @@ return true;`);
54487
54243
  [BufferType.VALIDITY]: splitArrowBuffer(data.buffers[BufferType.VALIDITY], options),
54488
54244
  [BufferType.TYPE]: splitArrowBuffer(data.buffers[BufferType.TYPE], options)
54489
54245
  };
54490
- return new Data(
54246
+ return createArrowData(
54491
54247
  data.type,
54492
54248
  data.offset,
54493
54249
  data.length,
@@ -54495,7 +54251,8 @@ return true;`);
54495
54251
  data._nullCount,
54496
54252
  buffers,
54497
54253
  children2,
54498
- dictionary
54254
+ dictionary,
54255
+ getArrowVariadicBuffers(data).map((buffer) => splitArrowBuffer(buffer, options))
54499
54256
  );
54500
54257
  }
54501
54258
  function splitArrowVectorBuffers(vector, options) {
@@ -54513,7 +54270,7 @@ return true;`);
54513
54270
  }
54514
54271
  let copy3 = options.copies.get(array3);
54515
54272
  if (!copy3) {
54516
- copy3 = array3.slice();
54273
+ copy3 = array3 instanceof Uint8Array ? new Uint8Array(array3) : array3.slice();
54517
54274
  options.copies.set(array3, copy3);
54518
54275
  }
54519
54276
  return copy3;
@@ -54522,29 +54279,106 @@ return true;`);
54522
54279
  return ArrayBuffer.isView(value2) && !(value2 instanceof DataView);
54523
54280
  }
54524
54281
  var init_split_arrow_buffers = __esm({
54525
- "../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts"() {
54526
- "use strict";
54282
+ "../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js"() {
54527
54283
  init_Arrow_dom();
54284
+ init_arrow_data();
54285
+ }
54286
+ });
54287
+
54288
+ // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js
54289
+ var init_indexed_arrow_vector = __esm({
54290
+ "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js"() {
54528
54291
  }
54529
54292
  });
54530
54293
 
54531
- // ../core/src/schema-utils/lib/arrow/arrow-table-transport.ts
54532
- function dehydrateArrowTable(table, options) {
54533
- const splitTable = splitArrowBuffers(table, options);
54294
+ // ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js
54295
+ var init_indexed_arrow_table = __esm({
54296
+ "../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js"() {
54297
+ }
54298
+ });
54299
+
54300
+ // ../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js
54301
+ var init_mapped_arrow_table = __esm({
54302
+ "../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js"() {
54303
+ }
54304
+ });
54305
+
54306
+ // ../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js
54307
+ var init_rename_arrow_columns = __esm({
54308
+ "../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js"() {
54309
+ }
54310
+ });
54311
+
54312
+ // ../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js
54313
+ function dehydrateArrowTable(arrowTable, options) {
54314
+ const splitTable = splitArrowBuffers(arrowTable, options);
54534
54315
  return {
54535
- shape: "arrow-table",
54536
54316
  transport: "arrow-js",
54537
- schema: serializeArrowSchema(splitTable.schema),
54538
- batches: splitTable.batches.map((recordBatch) => dehydrateArrowRecordBatch(recordBatch))
54317
+ version: 1,
54318
+ schema: tableToIPC(new Table(splitTable.schema, [])),
54319
+ metadataVersion: splitTable.schema.metadataVersion,
54320
+ batches: splitTable.batches.map((batch) => dehydrateArrowData(batch.data))
54539
54321
  };
54540
54322
  }
54541
54323
  function hydrateArrowTable(table) {
54542
- const schema = deserializeArrowSchema(table.schema);
54543
- const recordBatches = table.batches.map(
54544
- (recordBatch) => new RecordBatch3(schema, hydrateArrowData(recordBatch.data))
54545
- );
54546
- return new Table(schema, recordBatches);
54324
+ if (table.transport !== "arrow-js" || table.version !== 1) {
54325
+ throw new Error("Unsupported Arrow column-buffer transport protocol.");
54326
+ }
54327
+ const decodedSchema = tableFromIPC(table.schema).schema;
54328
+ const schema = new Schema2(decodedSchema.fields, decodedSchema.metadata, decodedSchema.dictionaries, table.metadataVersion);
54329
+ const type = new Struct(schema.fields);
54330
+ const batches = table.batches.map((data) => new RecordBatch3(schema, hydrateArrowData(data, type)));
54331
+ return new Table(schema, batches);
54547
54332
  }
54333
+ function dehydrateArrowData(data) {
54334
+ return {
54335
+ offset: data.offset,
54336
+ length: data.length,
54337
+ nullCount: data.nullCount,
54338
+ buffers: {
54339
+ [BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
54340
+ [BufferType.DATA]: data.buffers[BufferType.DATA],
54341
+ [BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
54342
+ [BufferType.TYPE]: data.buffers[BufferType.TYPE]
54343
+ },
54344
+ children: data.children.map((child2) => dehydrateArrowData(child2)),
54345
+ variadicBuffers: getArrowVariadicBuffers(data),
54346
+ dictionary: data.dictionary?.data.map((chunk) => dehydrateArrowData(chunk))
54347
+ };
54348
+ }
54349
+ function hydrateArrowData(data, type) {
54350
+ const children2 = data.children.map((child2, index) => hydrateArrowData(child2, type.children[index].type));
54351
+ const dictionary = data.dictionary && DataType.isDictionary(type) ? new Vector4(data.dictionary.map((chunk) => hydrateArrowData(chunk, type.dictionary))) : void 0;
54352
+ return createArrowData(type, data.offset, data.length, data.nullCount, data.buffers, children2, dictionary, data.variadicBuffers);
54353
+ }
54354
+ var init_arrow_table_transport = __esm({
54355
+ "../../node_modules/@math.gl/arrow/dist/arrow/arrow-table-transport.js"() {
54356
+ init_Arrow_dom();
54357
+ init_arrow_data();
54358
+ init_split_arrow_buffers();
54359
+ }
54360
+ });
54361
+
54362
+ // ../../node_modules/@math.gl/arrow/dist/arrow/index.js
54363
+ var init_arrow = __esm({
54364
+ "../../node_modules/@math.gl/arrow/dist/arrow/index.js"() {
54365
+ init_indexed_arrow_table();
54366
+ init_indexed_arrow_vector();
54367
+ init_mapped_arrow_table();
54368
+ init_rename_arrow_columns();
54369
+ init_split_arrow_buffers();
54370
+ init_arrow_table_transport();
54371
+ }
54372
+ });
54373
+
54374
+ // ../../node_modules/@math.gl/arrow/dist/index.js
54375
+ var init_dist4 = __esm({
54376
+ "../../node_modules/@math.gl/arrow/dist/index.js"() {
54377
+ init_arrow();
54378
+ }
54379
+ });
54380
+
54381
+ // ../core/src/arrow-worker-transport.ts
54548
54382
  function serializeArrowWorkerResult(result, options) {
54549
54383
  if (!isArrowTableWrapper(result)) {
54550
54384
  return result;
@@ -54574,60 +54408,10 @@ return true;`);
54574
54408
  table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
54575
54409
  );
54576
54410
  }
54577
- function dehydrateArrowRecordBatch(recordBatch) {
54578
- return { data: dehydrateArrowData(recordBatch.data) };
54579
- }
54580
- function dehydrateArrowData(data) {
54581
- return {
54582
- type: serializeArrowType(data.type),
54583
- offset: data.offset,
54584
- length: data.length,
54585
- // @ts-expect-error _nullCount is protected. Preserve the Arrow lazy null-count state.
54586
- nullCount: data._nullCount,
54587
- buffers: {
54588
- [BufferType.OFFSET]: data.buffers[BufferType.OFFSET],
54589
- [BufferType.DATA]: data.buffers[BufferType.DATA],
54590
- [BufferType.VALIDITY]: data.buffers[BufferType.VALIDITY],
54591
- [BufferType.TYPE]: data.buffers[BufferType.TYPE]
54592
- },
54593
- children: data.children.map((childData) => dehydrateArrowData(childData)),
54594
- dictionary: data.dictionary ? dehydrateArrowVector(data.dictionary) : void 0
54595
- };
54596
- }
54597
- function dehydrateArrowVector(vector) {
54598
- return { data: vector.data.map((data) => dehydrateArrowData(data)) };
54599
- }
54600
- function hydrateArrowData(data) {
54601
- const children2 = data.children.map((childData) => hydrateArrowData(childData));
54602
- const dictionary = data.dictionary ? hydrateArrowVector(data.dictionary) : void 0;
54603
- return new Data(
54604
- deserializeArrowType(data.type),
54605
- data.offset,
54606
- data.length,
54607
- data.nullCount,
54608
- data.buffers,
54609
- children2,
54610
- dictionary
54611
- );
54612
- }
54613
- function hydrateArrowVector(vector) {
54614
- return new Vector4(vector.data.map((data) => hydrateArrowData(data)));
54615
- }
54616
- var init_arrow_table_transport = __esm({
54617
- "../core/src/schema-utils/lib/arrow/arrow-table-transport.ts"() {
54411
+ var init_arrow_worker_transport = __esm({
54412
+ "../core/src/arrow-worker-transport.ts"() {
54618
54413
  "use strict";
54619
- init_Arrow_dom();
54620
- init_convert_arrow_schema();
54621
- init_split_arrow_buffers();
54622
- }
54623
- });
54624
-
54625
- // ../core/src/schema-utils/arrow-transport.ts
54626
- var init_arrow_transport = __esm({
54627
- "../core/src/schema-utils/arrow-transport.ts"() {
54628
- "use strict";
54629
- init_arrow_table_transport();
54630
- init_split_arrow_buffers();
54414
+ init_dist4();
54631
54415
  }
54632
54416
  });
54633
54417
 
@@ -54982,6 +54766,435 @@ return true;`);
54982
54766
  }
54983
54767
  });
54984
54768
 
54769
+ // ../core/src/schema-utils/lib/schema/convert-arrow-schema.ts
54770
+ function serializeArrowSchema(arrowSchema) {
54771
+ return {
54772
+ fields: arrowSchema.fields.map((arrowField) => serializeArrowField(arrowField)),
54773
+ metadata: serializeArrowMetadata(arrowSchema.metadata)
54774
+ };
54775
+ }
54776
+ function serializeArrowMetadata(arrowMetadata) {
54777
+ return Object.fromEntries(arrowMetadata);
54778
+ }
54779
+ function deserializeArrowMetadata(metadata) {
54780
+ return metadata ? new Map(Object.entries(metadata)) : /* @__PURE__ */ new Map();
54781
+ }
54782
+ function serializeArrowField(field) {
54783
+ return {
54784
+ name: field.name,
54785
+ type: serializeArrowType(field.type),
54786
+ nullable: field.nullable,
54787
+ metadata: serializeArrowMetadata(field.metadata)
54788
+ };
54789
+ }
54790
+ function deserializeArrowField(field, options) {
54791
+ return new Field2(
54792
+ field.name,
54793
+ deserializeArrowType(field.type, options),
54794
+ field.nullable,
54795
+ deserializeArrowMetadata(field.metadata)
54796
+ );
54797
+ }
54798
+ function serializeArrowType(arrowType) {
54799
+ if (isArrowViewType(arrowType, "BinaryView")) {
54800
+ return "binary-view";
54801
+ }
54802
+ if (isArrowViewType(arrowType, "Utf8View")) {
54803
+ return "utf8-view";
54804
+ }
54805
+ if (isOptionalArrowType(arrowType, "LargeList")) {
54806
+ const largeListType = arrowType;
54807
+ return {
54808
+ type: "large-list",
54809
+ children: [serializeArrowField(largeListType.valueField)]
54810
+ };
54811
+ }
54812
+ switch (arrowType.constructor) {
54813
+ case Null2:
54814
+ return "null";
54815
+ case Binary2:
54816
+ return "binary";
54817
+ case FixedSizeBinary2:
54818
+ return {
54819
+ type: "fixed-size-binary",
54820
+ byteWidth: arrowType.byteWidth
54821
+ };
54822
+ case Bool2:
54823
+ return "bool";
54824
+ case Int_:
54825
+ const intType = arrowType;
54826
+ return `${intType.isSigned ? "" : "u"}int${intType.bitWidth}`;
54827
+ case Int8:
54828
+ return "int8";
54829
+ case Int16:
54830
+ return "int16";
54831
+ case Int32:
54832
+ return "int32";
54833
+ case Int64:
54834
+ return "int64";
54835
+ case Uint8:
54836
+ return "uint8";
54837
+ case Uint16:
54838
+ return "uint16";
54839
+ case Uint32:
54840
+ return "uint32";
54841
+ case Uint64:
54842
+ return "uint64";
54843
+ case Float:
54844
+ const precision = arrowType.precision;
54845
+ switch (precision) {
54846
+ case Precision.HALF:
54847
+ return "float16";
54848
+ case Precision.SINGLE:
54849
+ return "float32";
54850
+ case Precision.DOUBLE:
54851
+ return "float64";
54852
+ default:
54853
+ return "float16";
54854
+ }
54855
+ case Float16:
54856
+ return "float16";
54857
+ case Float32:
54858
+ return "float32";
54859
+ case Float64:
54860
+ return "float64";
54861
+ case Utf82:
54862
+ return "utf8";
54863
+ case Decimal2:
54864
+ const decimal = arrowType;
54865
+ return {
54866
+ type: "decimal",
54867
+ bitWidth: decimal.bitWidth,
54868
+ precision: decimal.precision,
54869
+ scale: decimal.scale
54870
+ };
54871
+ case Date_:
54872
+ const dateUnit = arrowType.unit;
54873
+ return dateUnit === DateUnit.DAY ? "date-day" : "date-millisecond";
54874
+ case DateDay:
54875
+ return "date-day";
54876
+ case DateMillisecond:
54877
+ return "date-millisecond";
54878
+ case Time_:
54879
+ const timeUnit = arrowType.unit;
54880
+ switch (timeUnit) {
54881
+ case TimeUnit.SECOND:
54882
+ return "time-second";
54883
+ case TimeUnit.MILLISECOND:
54884
+ return "time-millisecond";
54885
+ case TimeUnit.MICROSECOND:
54886
+ return "time-microsecond";
54887
+ case TimeUnit.NANOSECOND:
54888
+ return "time-nanosecond";
54889
+ default:
54890
+ return "time-second";
54891
+ }
54892
+ case TimeMillisecond:
54893
+ return "time-millisecond";
54894
+ case TimeSecond:
54895
+ return "time-second";
54896
+ case TimeMicrosecond:
54897
+ return "time-microsecond";
54898
+ case TimeNanosecond:
54899
+ return "time-nanosecond";
54900
+ case Timestamp_:
54901
+ const timeStampUnit = arrowType.unit;
54902
+ switch (timeStampUnit) {
54903
+ case TimeUnit.SECOND:
54904
+ return "timestamp-second";
54905
+ case TimeUnit.MILLISECOND:
54906
+ return "timestamp-millisecond";
54907
+ case TimeUnit.MICROSECOND:
54908
+ return "timestamp-microsecond";
54909
+ case TimeUnit.NANOSECOND:
54910
+ return "timestamp-nanosecond";
54911
+ default:
54912
+ return "timestamp-second";
54913
+ }
54914
+ case TimestampSecond:
54915
+ return "timestamp-second";
54916
+ case TimestampMillisecond:
54917
+ return "timestamp-millisecond";
54918
+ case TimestampMicrosecond:
54919
+ return "timestamp-microsecond";
54920
+ case TimestampNanosecond:
54921
+ return "timestamp-nanosecond";
54922
+ case Interval_:
54923
+ const intervalUnit = arrowType.unit;
54924
+ switch (intervalUnit) {
54925
+ case IntervalUnit.DAY_TIME:
54926
+ return "interval-daytime";
54927
+ case IntervalUnit.YEAR_MONTH:
54928
+ return "interval-yearmonth";
54929
+ default:
54930
+ return "interval-daytime";
54931
+ }
54932
+ case IntervalDayTime:
54933
+ return "interval-daytime";
54934
+ case IntervalYearMonth:
54935
+ return "interval-yearmonth";
54936
+ case Map_:
54937
+ const mapType = arrowType;
54938
+ return {
54939
+ type: "map",
54940
+ keysSorted: mapType.keysSorted,
54941
+ children: mapType.children.map((arrowField) => serializeArrowField(arrowField))
54942
+ };
54943
+ case List2:
54944
+ const listType = arrowType;
54945
+ const listField = listType.valueField;
54946
+ return {
54947
+ type: "list",
54948
+ children: [serializeArrowField(listField)]
54949
+ };
54950
+ case FixedSizeList2:
54951
+ const fixedSizeList = arrowType;
54952
+ return {
54953
+ type: "fixed-size-list",
54954
+ listSize: fixedSizeList.listSize,
54955
+ children: [serializeArrowField(fixedSizeList.children[0])]
54956
+ };
54957
+ case Struct:
54958
+ const structType = arrowType;
54959
+ return {
54960
+ type: "struct",
54961
+ children: structType.children.map((arrowField) => serializeArrowField(arrowField))
54962
+ };
54963
+ case SparseUnion:
54964
+ case DenseUnion:
54965
+ const unionType = arrowType;
54966
+ return {
54967
+ type: unionType instanceof DenseUnion ? "dense-union" : "sparse-union",
54968
+ typeIds: unionType.typeIds,
54969
+ children: unionType.children.map((arrowField) => serializeArrowField(arrowField)),
54970
+ typeIdToChildIndex: { ...unionType.typeIdToChildIndex }
54971
+ };
54972
+ case Dictionary:
54973
+ const dictionaryType = arrowType;
54974
+ return {
54975
+ type: "dictionary",
54976
+ id: dictionaryType.id,
54977
+ indices: serializeArrowDictionaryKeyType(dictionaryType.indices),
54978
+ dictionary: serializeArrowType(dictionaryType.dictionary),
54979
+ isOrdered: dictionaryType.isOrdered
54980
+ };
54981
+ default:
54982
+ throw new Error(`arrow type not supported: ${arrowType.constructor.name}`);
54983
+ }
54984
+ }
54985
+ function deserializeArrowType(dataType, options) {
54986
+ if (typeof dataType === "object") {
54987
+ switch (dataType.type) {
54988
+ case "decimal":
54989
+ return new Decimal2(dataType.scale, dataType.precision, dataType.bitWidth);
54990
+ case "map": {
54991
+ const children2 = dataType.children.map(
54992
+ (arrowField) => deserializeArrowField(arrowField, options)
54993
+ );
54994
+ return new Map_(children2[0], dataType.keysSorted);
54995
+ }
54996
+ case "list": {
54997
+ const field = deserializeArrowField(dataType.children[0], options);
54998
+ return new List2(field);
54999
+ }
55000
+ case "large-list": {
55001
+ const field = deserializeArrowField(dataType.children[0], options);
55002
+ const LargeList3 = getOptionalArrowConstructor("LargeList");
55003
+ if (!LargeList3) {
55004
+ throw new Error(
55005
+ "LargeList requires an Apache Arrow runtime that exports the LargeList constructor"
55006
+ );
55007
+ }
55008
+ return new LargeList3(field);
55009
+ }
55010
+ case "fixed-size-list": {
55011
+ const child2 = deserializeArrowField(dataType.children[0], options);
55012
+ return new FixedSizeList2(dataType.listSize, child2);
55013
+ }
55014
+ case "fixed-size-binary":
55015
+ return new FixedSizeBinary2(dataType.byteWidth);
55016
+ case "struct": {
55017
+ const children2 = dataType.children.map(
55018
+ (arrowField) => deserializeArrowField(arrowField, options)
55019
+ );
55020
+ return new Struct(children2);
55021
+ }
55022
+ case "sparse-union":
55023
+ case "dense-union": {
55024
+ const children2 = dataType.children.map(
55025
+ (arrowField) => deserializeArrowField(arrowField, options)
55026
+ );
55027
+ return dataType.type === "dense-union" ? new DenseUnion(dataType.typeIds, children2) : new SparseUnion(dataType.typeIds, children2);
55028
+ }
55029
+ case "dictionary": {
55030
+ return new Dictionary(
55031
+ deserializeArrowType(dataType.dictionary, options),
55032
+ deserializeArrowDictionaryKeyType(dataType.indices),
55033
+ dataType.id,
55034
+ dataType.isOrdered
55035
+ );
55036
+ }
55037
+ default:
55038
+ throw new Error("array type not supported");
55039
+ }
55040
+ }
55041
+ switch (dataType) {
55042
+ case "null":
55043
+ return new Null2();
55044
+ case "binary":
55045
+ return makeVariableWidthArrowType("BinaryView", new Binary2(), options);
55046
+ case "binary-view":
55047
+ return makeRequiredArrowViewType("BinaryView");
55048
+ case "bool":
55049
+ return new Bool2();
55050
+ case "int8":
55051
+ return new Int8();
55052
+ case "int16":
55053
+ return new Int16();
55054
+ case "int32":
55055
+ return new Int32();
55056
+ case "int64":
55057
+ return new Int64();
55058
+ case "uint8":
55059
+ return new Uint8();
55060
+ case "uint16":
55061
+ return new Uint16();
55062
+ case "uint32":
55063
+ return new Uint32();
55064
+ case "uint64":
55065
+ return new Uint64();
55066
+ case "float16":
55067
+ return new Float16();
55068
+ case "float32":
55069
+ return new Float32();
55070
+ case "float64":
55071
+ return new Float64();
55072
+ case "utf8":
55073
+ return makeVariableWidthArrowType("Utf8View", new Utf82(), options);
55074
+ case "utf8-view":
55075
+ return makeRequiredArrowViewType("Utf8View");
55076
+ case "date-day":
55077
+ return new DateDay();
55078
+ case "date-millisecond":
55079
+ return new DateMillisecond();
55080
+ case "time-second":
55081
+ return new TimeSecond();
55082
+ case "time-millisecond":
55083
+ return new TimeMillisecond();
55084
+ case "time-microsecond":
55085
+ return new TimeMicrosecond();
55086
+ case "time-nanosecond":
55087
+ return new TimeNanosecond();
55088
+ case "timestamp-second":
55089
+ return new TimestampSecond();
55090
+ case "timestamp-millisecond":
55091
+ return new TimestampMillisecond();
55092
+ case "timestamp-microsecond":
55093
+ return new TimestampMicrosecond();
55094
+ case "timestamp-nanosecond":
55095
+ return new TimestampNanosecond();
55096
+ case "interval-daytime":
55097
+ return new IntervalDayTime();
55098
+ case "interval-yearmonth":
55099
+ return new IntervalYearMonth();
55100
+ default:
55101
+ throw new Error("array type not supported");
55102
+ }
55103
+ }
55104
+ function getOptionalArrowConstructor(typeName) {
55105
+ return Arrow_dom_exports[typeName];
55106
+ }
55107
+ function isArrowViewType(arrowType, viewTypeName) {
55108
+ const constructor = getOptionalArrowConstructor(viewTypeName);
55109
+ if (constructor && arrowType instanceof constructor) {
55110
+ return true;
55111
+ }
55112
+ const guards = DataType;
55113
+ const guard = viewTypeName === "BinaryView" ? guards.isBinaryView : guards.isUtf8View;
55114
+ return Boolean(guard?.(arrowType));
55115
+ }
55116
+ function isOptionalArrowType(arrowType, typeName) {
55117
+ const constructor = getOptionalArrowConstructor(typeName);
55118
+ return Boolean(constructor && arrowType instanceof constructor);
55119
+ }
55120
+ function makeVariableWidthArrowType(viewTypeName, fallbackType, options) {
55121
+ const viewTypeMode = options?.viewTypes || "never";
55122
+ if (viewTypeMode === "never") {
55123
+ return fallbackType;
55124
+ }
55125
+ const constructor = getOptionalArrowConstructor(viewTypeName);
55126
+ if (constructor) {
55127
+ return new constructor();
55128
+ }
55129
+ if (viewTypeMode === "require") {
55130
+ throw new Error(
55131
+ `${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
55132
+ );
55133
+ }
55134
+ return fallbackType;
55135
+ }
55136
+ function makeRequiredArrowViewType(viewTypeName) {
55137
+ const constructor = getOptionalArrowConstructor(viewTypeName);
55138
+ if (!constructor) {
55139
+ throw new Error(
55140
+ `${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
55141
+ );
55142
+ }
55143
+ return new constructor();
55144
+ }
55145
+ function serializeArrowDictionaryKeyType(arrowType) {
55146
+ if (arrowType instanceof Int_) {
55147
+ const prefix = arrowType.isSigned ? "int" : "uint";
55148
+ const keyType = `${prefix}${arrowType.bitWidth}`;
55149
+ if (isSchemaDictionaryKeyType(keyType)) {
55150
+ return keyType;
55151
+ }
55152
+ }
55153
+ switch (arrowType.constructor) {
55154
+ case Int8:
55155
+ return "int8";
55156
+ case Int16:
55157
+ return "int16";
55158
+ case Int32:
55159
+ return "int32";
55160
+ case Uint8:
55161
+ return "uint8";
55162
+ case Uint16:
55163
+ return "uint16";
55164
+ case Uint32:
55165
+ return "uint32";
55166
+ default:
55167
+ throw new Error(`arrow dictionary index type not supported: ${arrowType.constructor.name}`);
55168
+ }
55169
+ }
55170
+ function isSchemaDictionaryKeyType(keyType) {
55171
+ return ["int8", "int16", "int32", "uint8", "uint16", "uint32"].includes(keyType);
55172
+ }
55173
+ function deserializeArrowDictionaryKeyType(keyType) {
55174
+ switch (keyType) {
55175
+ case "int8":
55176
+ return new Int8();
55177
+ case "int16":
55178
+ return new Int16();
55179
+ case "int32":
55180
+ return new Int32();
55181
+ case "uint8":
55182
+ return new Uint8();
55183
+ case "uint16":
55184
+ return new Uint16();
55185
+ case "uint32":
55186
+ return new Uint32();
55187
+ default:
55188
+ throw new Error(`schema dictionary index type not supported: ${keyType}`);
55189
+ }
55190
+ }
55191
+ var init_convert_arrow_schema = __esm({
55192
+ "../core/src/schema-utils/lib/schema/convert-arrow-schema.ts"() {
55193
+ "use strict";
55194
+ init_Arrow_dom();
55195
+ }
55196
+ });
55197
+
54985
55198
  // ../core/src/schema-utils/lib/mesh/mesh-utils.ts
54986
55199
  function getMeshBoundingBox(attributes) {
54987
55200
  const positionAttribute = attributes?.POSITION;
@@ -56183,7 +56396,7 @@ return true;`);
56183
56396
  var init_draco_loader_types = __esm({
56184
56397
  "../scene/src/draco/draco-loader-types.ts"() {
56185
56398
  "use strict";
56186
- init_arrow_transport();
56399
+ init_arrow_worker_transport();
56187
56400
  init_version4();
56188
56401
  init_draco_format();
56189
56402
  init_draco_loader_options();
@@ -63613,6 +63826,59 @@ return true;`);
63613
63826
  }
63614
63827
  });
63615
63828
 
63829
+ // ../../node_modules/@math.gl/geospatial/dist/projection/experimental/transform-description.js
63830
+ function describeCRS(crs) {
63831
+ const ellipsoid = Object.freeze({ ...crs.ellipsoid });
63832
+ return Object.freeze({
63833
+ kind: crs.kind,
63834
+ projection: crs.projection,
63835
+ parameters: Object.freeze(Object.fromEntries(Object.entries(crs.parameters).map(([name22, value2]) => [name22, value2 ?? null]))),
63836
+ ellipsoid,
63837
+ datum: Object.freeze({
63838
+ ellipsoid: Object.freeze({ ...crs.datum.ellipsoid }),
63839
+ towgs84: crs.datum.towgs84 && Object.freeze([...crs.datum.towgs84]),
63840
+ grids: crs.datum.grids && Object.freeze(crs.datum.grids.map((reference) => Object.freeze({
63841
+ name: reference.name,
63842
+ optional: reference.optional,
63843
+ loaded: Boolean(reference.grid)
63844
+ })))
63845
+ }),
63846
+ angularUnit: crs.angularUnit,
63847
+ toMeter: crs.toMeter,
63848
+ verticalUnit: crs.verticalUnit,
63849
+ primeMeridian: crs.primeMeridian,
63850
+ axis: crs.axis,
63851
+ storedAxis: crs.storedAxis,
63852
+ longitudeWrap: crs.longitudeWrap,
63853
+ areaOfUse: crs.areaOfUse && Object.freeze([...crs.areaOfUse]),
63854
+ lossy: crs.lossy,
63855
+ algorithm: crs.algorithm && Object.freeze({ ...crs.algorithm })
63856
+ });
63857
+ }
63858
+ function describeTransform(source, target, forward33, inverse33) {
63859
+ const opaqueReasons = [];
63860
+ if (!source.algorithm)
63861
+ opaqueReasons.push("source-algorithm");
63862
+ if (!target.algorithm)
63863
+ opaqueReasons.push("target-algorithm");
63864
+ if (source.datum.grids || target.datum.grids || source.parameters["geoidgrids"] || target.parameters["geoidgrids"])
63865
+ opaqueReasons.push("grid-resource");
63866
+ return Object.freeze({
63867
+ version: 1,
63868
+ source,
63869
+ target,
63870
+ forward: forward33,
63871
+ inverse: inverse33,
63872
+ lossy: source.lossy || target.lossy,
63873
+ complete: opaqueReasons.length === 0,
63874
+ opaqueReasons: Object.freeze(opaqueReasons)
63875
+ });
63876
+ }
63877
+ var init_transform_description = __esm({
63878
+ "../../node_modules/@math.gl/geospatial/dist/projection/experimental/transform-description.js"() {
63879
+ }
63880
+ });
63881
+
63616
63882
  // ../../node_modules/@math.gl/geospatial/dist/projection/experimental/typescript-projection.js
63617
63883
  function requiredProjections(options) {
63618
63884
  const available = registry2(options.projections || []);
@@ -63682,7 +63948,8 @@ return true;`);
63682
63948
  const verticalGrid = compileVerticalGrid(crs.parameters["geoidgrids"], options.verticalGrids);
63683
63949
  if (verticalGrid && (crs.kind === "geocentric" || crs.kind === "identity" || crs.lossy))
63684
63950
  unsupportedStage("Vertical grids require a non-lossy geographic or projected CRS");
63685
- return { ...crs, datum, implementation, verticalGrid };
63951
+ const algorithm = plugin ? plugin.semantics : { id: "@math.gl/geospatial/" + crs.kind, version: 1 };
63952
+ return { ...crs, datum, implementation, verticalGrid, algorithm };
63686
63953
  }
63687
63954
  function finite(point) {
63688
63955
  return Number.isFinite(point.x) && Number.isFinite(point.y) && Number.isFinite(point.z);
@@ -63725,9 +63992,51 @@ return true;`);
63725
63992
  if (from.kind === "projected" && to.kind === "geographic")
63726
63993
  flat = from.implementation?.createInverseFlat?.(context);
63727
63994
  }
63995
+ const requiresInputZ = Boolean(from.verticalGrid || to.verticalGrid) || from.kind === "geocentric" || /[ud]/.test(fromAxis.slice(0, 2)) || /[ud]/.test(toAxis.slice(0, 2));
63996
+ const stages = [];
63997
+ if (inputAxis)
63998
+ stages.push("input-axis");
63999
+ if (horizontalOnly)
64000
+ stages.push("discard-height");
64001
+ if (inputScale !== 1)
64002
+ stages.push("input-scale");
64003
+ if (source)
64004
+ stages.push("source-inverse");
64005
+ if (inputVerticalScale !== 1)
64006
+ stages.push("input-height-scale");
64007
+ stages.push("geographic-domain-check");
64008
+ if (fromPrime)
64009
+ stages.push("source-prime-meridian");
64010
+ if (from.verticalGrid)
64011
+ stages.push("source-vertical-grid");
64012
+ if (datum)
64013
+ stages.push("datum");
64014
+ if (to.verticalGrid)
64015
+ stages.push("target-vertical-grid");
64016
+ if (toPrime)
64017
+ stages.push("target-prime-meridian");
64018
+ if (longitudeWrap !== void 0)
64019
+ stages.push("longitude-wrap");
64020
+ if (target)
64021
+ stages.push("target-forward");
64022
+ if (outputScale !== 1)
64023
+ stages.push("output-scale");
64024
+ if (outputVerticalScale !== 1)
64025
+ stages.push("output-height-scale");
64026
+ if (horizontalOnly)
64027
+ stages.push("restore-height");
64028
+ if (outputAxis)
64029
+ stages.push("output-axis");
63728
64030
  return {
64031
+ description: Object.freeze({
64032
+ inputAxis: fromAxis,
64033
+ outputAxis: toAxis,
64034
+ requiresInputZ,
64035
+ geocentricOutput: to.kind === "geocentric",
64036
+ stages: Object.freeze(stages)
64037
+ }),
63729
64038
  flat,
63730
- requiresInputZ: Boolean(from.verticalGrid || to.verticalGrid) || from.kind === "geocentric" || /[ud]/.test(fromAxis.slice(0, 2)) || /[ud]/.test(toAxis.slice(0, 2)),
64039
+ requiresInputZ,
63731
64040
  geocentricOutput: to.kind === "geocentric",
63732
64041
  run(point) {
63733
64042
  if (!finite(point))
@@ -63841,6 +64150,7 @@ return true;`);
63841
64150
  init_parameters();
63842
64151
  init_geographic_rendering_profile();
63843
64152
  init_vertical_datum();
64153
+ init_transform_description();
63844
64154
  ProjectionTransform = class _ProjectionTransform {
63845
64155
  /** Resolve required descriptors once, then return an ordinary synchronous instance. */
63846
64156
  static async create(options = {}) {
@@ -63854,6 +64164,10 @@ return true;`);
63854
64164
  getTargetRenderingProfile(coverage) {
63855
64165
  return this.targetRenderingProfile && resolveRenderingProfile(this.targetRenderingProfile, coverage);
63856
64166
  }
64167
+ /** Deferred transforms expose metadata only once their implementations are prepared. */
64168
+ get description() {
64169
+ return this.deferred?.implementation?.description ?? this.resolvedDescription;
64170
+ }
63857
64171
  constructor(options = {}) {
63858
64172
  this.coordinateScratch = new ProjectionScratch();
63859
64173
  this.targetLongitudeOrigin = 0;
@@ -63879,6 +64193,7 @@ return true;`);
63879
64193
  unsupportedStage("Horizontal extraction cannot be combined with vertical grids");
63880
64194
  this.forwardTransform = compileTransform(from, to, Boolean(options.enforceAxis));
63881
64195
  this.inverseTransform = compileTransform(to, from, Boolean(options.enforceAxis));
64196
+ this.resolvedDescription = describeTransform(describeCRS(from), describeCRS(to), this.forwardTransform.description, this.inverseTransform.description);
63882
64197
  }
63883
64198
  this.project = this.project.bind(this);
63884
64199
  this.unproject = this.unproject.bind(this);
@@ -64390,6 +64705,7 @@ return true;`);
64390
64705
  init_rendering_bounds();
64391
64706
  mercator = {
64392
64707
  name: "merc",
64708
+ semantics: { id: "@math.gl/geospatial/merc", version: 1 },
64393
64709
  aliases: [
64394
64710
  "Mercator",
64395
64711
  "Popular Visualisation Pseudo Mercator",
@@ -64483,6 +64799,7 @@ return true;`);
64483
64799
  init_rendering_bounds();
64484
64800
  equidistantCylindrical = {
64485
64801
  name: "eqc",
64802
+ semantics: { id: "@math.gl/geospatial/eqc", version: 1 },
64486
64803
  aliases: ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical"],
64487
64804
  parameters: ["lon_0", "lat_0", "lat_ts", "x_0", "y_0"],
64488
64805
  create({ semiMajorAxis: a, parameters, primeMeridian: primeMeridian2 = 0 }) {
@@ -72640,7 +72957,7 @@ return true;`);
72640
72957
  });
72641
72958
 
72642
72959
  // ../../node_modules/@math.gl/dggs/dist/index.js
72643
- var init_dist4 = __esm({
72960
+ var init_dist5 = __esm({
72644
72961
  "../../node_modules/@math.gl/dggs/dist/index.js"() {
72645
72962
  init_s2_decoder();
72646
72963
  init_s2_token();
@@ -72661,7 +72978,7 @@ return true;`);
72661
72978
  var init_s2_bounding_volume = __esm({
72662
72979
  "src/tileset-3d/helpers/s2-bounding-volume.ts"() {
72663
72980
  "use strict";
72664
- init_dist4();
72981
+ init_dist5();
72665
72982
  init_dist3();
72666
72983
  }
72667
72984
  });
@@ -73237,7 +73554,7 @@ return true;`);
73237
73554
  var init_implicit_tiling = __esm({
73238
73555
  "src/tileset-3d/format-3d-tiles/implicit-tiling.ts"() {
73239
73556
  "use strict";
73240
- init_dist4();
73557
+ init_dist5();
73241
73558
  init_s2_bounding_volume();
73242
73559
  QUADTREE_CHILD_COUNT = 4;
73243
73560
  OCTREE_CHILD_COUNT = 8;
@@ -75442,6 +75759,7 @@ return true;`);
75442
75759
  function extractInstancedAttributes(tile, featureTable, batchTable, instancesLength) {
75443
75760
  const instances = new Array(instancesLength);
75444
75761
  const instancePosition = new Vector3();
75762
+ const instanceFramePosition = new Vector3();
75445
75763
  const instanceNormalRight = new Vector3();
75446
75764
  const instanceNormalUp = new Vector3();
75447
75765
  const instanceNormalForward = new Vector3();
@@ -75536,7 +75854,9 @@ return true;`);
75536
75854
  tile.hasCustomOrientation = true;
75537
75855
  hasCustomOrientation = true;
75538
75856
  } else if (tile.eastNorthUp) {
75539
- eastNorthUpToFixedFrame(Ellipsoid.WGS84, instancePosition, instanceTransform);
75857
+ instanceFramePosition.copy(instancePosition);
75858
+ if (tile.rtcCenter) instanceFramePosition.add(tile.rtcCenter);
75859
+ eastNorthUpToFixedFrame(Ellipsoid.WGS84, instanceFramePosition, instanceTransform);
75540
75860
  instanceTransform.getRotationMatrix3(instanceRotation);
75541
75861
  } else {
75542
75862
  instanceRotation.identity();
@@ -81134,11 +81454,11 @@ return true;`);
81134
81454
  var bundle_exports = {};
81135
81455
  __export(bundle_exports, {
81136
81456
  CesiumIonLoader: () => CesiumIonLoader,
81137
- FetchError: () => import_core44.FetchError,
81138
- JSONLoader: () => import_core44.JSONLoader,
81139
- NullLoader: () => import_core44.NullLoader,
81140
- NullWorkerLoader: () => import_core44.NullWorkerLoader,
81141
- RequestScheduler: () => import_core44.RequestScheduler,
81457
+ FetchError: () => import_core45.FetchError,
81458
+ JSONLoader: () => import_core45.JSONLoader,
81459
+ NullLoader: () => import_core45.NullLoader,
81460
+ NullWorkerLoader: () => import_core45.NullWorkerLoader,
81461
+ RequestScheduler: () => import_core45.RequestScheduler,
81142
81462
  TILE3D_TYPE: () => TILE3D_TYPE,
81143
81463
  ThreeTZFormat: () => ThreeTZFormat,
81144
81464
  Tile3DBatchTable: () => Tile3DBatchTableParser,
@@ -81152,71 +81472,71 @@ return true;`);
81152
81472
  Tiles3DArchiveWriter: () => Tiles3DArchiveWriter,
81153
81473
  Tiles3DFormat: () => Tiles3DFormat,
81154
81474
  Tiles3DLoader: () => Tiles3DLoader,
81155
- _BrowserFileSystem: () => import_core44._BrowserFileSystem,
81156
- _fetchProgress: () => import_core44._fetchProgress,
81475
+ _BrowserFileSystem: () => import_core45._BrowserFileSystem,
81476
+ _fetchProgress: () => import_core45._fetchProgress,
81157
81477
  _getIonTilesetMetadata: () => getIonTilesetMetadata,
81158
- _selectSource: () => import_core44._selectSource,
81159
- _unregisterLoaders: () => import_core44._unregisterLoaders,
81160
- assert: () => import_core44.assert,
81161
- concatenateArrayBuffersAsync: () => import_core44.concatenateArrayBuffersAsync,
81162
- coreApi: () => import_core44.coreApi,
81163
- createDataSource: () => import_core44.createDataSource,
81478
+ _selectSource: () => import_core45._selectSource,
81479
+ _unregisterLoaders: () => import_core45._unregisterLoaders,
81480
+ assert: () => import_core45.assert,
81481
+ concatenateArrayBuffersAsync: () => import_core45.concatenateArrayBuffersAsync,
81482
+ coreApi: () => import_core45.coreApi,
81483
+ createDataSource: () => import_core45.createDataSource,
81164
81484
  createTile3DStyleInput: () => createTile3DStyleInput,
81165
- document: () => import_core44.document,
81166
- encode: () => import_core44.encode,
81167
- encodeInBatches: () => import_core44.encodeInBatches,
81168
- encodeSync: () => import_core44.encodeSync,
81169
- encodeTable: () => import_core44.encodeTable,
81170
- encodeTableAsText: () => import_core44.encodeTableAsText,
81171
- encodeTableInBatches: () => import_core44.encodeTableInBatches,
81172
- encodeText: () => import_core44.encodeText,
81173
- encodeTextSync: () => import_core44.encodeTextSync,
81174
- encodeURLtoURL: () => import_core44.encodeURLtoURL,
81175
- fetchFile: () => import_core44.fetchFile,
81176
- forEach: () => import_core44.forEach,
81177
- getLoaderOptions: () => import_core44.getLoaderOptions,
81178
- getPathPrefix: () => import_core44.getPathPrefix,
81485
+ document: () => import_core45.document,
81486
+ encode: () => import_core45.encode,
81487
+ encodeInBatches: () => import_core45.encodeInBatches,
81488
+ encodeSync: () => import_core45.encodeSync,
81489
+ encodeTable: () => import_core45.encodeTable,
81490
+ encodeTableAsText: () => import_core45.encodeTableAsText,
81491
+ encodeTableInBatches: () => import_core45.encodeTableInBatches,
81492
+ encodeText: () => import_core45.encodeText,
81493
+ encodeTextSync: () => import_core45.encodeTextSync,
81494
+ encodeURLtoURL: () => import_core45.encodeURLtoURL,
81495
+ fetchFile: () => import_core45.fetchFile,
81496
+ forEach: () => import_core45.forEach,
81497
+ getLoaderOptions: () => import_core45.getLoaderOptions,
81498
+ getPathPrefix: () => import_core45.getPathPrefix,
81179
81499
  getStructuralMetadataProperty: () => getStructuralMetadataProperty,
81180
81500
  getStructuralMetadataRow: () => getStructuralMetadataRow,
81181
81501
  getTile3DBatchTableProperties: () => getTile3DBatchTableProperties,
81182
81502
  getTile3DStyleProperty: () => getTile3DStyleProperty,
81183
- global: () => import_core44.global,
81184
- isAsyncIterable: () => import_core44.isAsyncIterable,
81185
- isBrowser: () => import_core44.isBrowser,
81186
- isIterable: () => import_core44.isIterable,
81187
- isIterator: () => import_core44.isIterator,
81188
- isPromise: () => import_core44.isPromise,
81189
- isPureObject: () => import_core44.isPureObject,
81190
- isReadableStream: () => import_core44.isReadableStream,
81191
- isResponse: () => import_core44.isResponse,
81192
- isWorker: () => import_core44.isWorker,
81193
- isWritableStream: () => import_core44.isWritableStream,
81194
- load: () => import_core44.load,
81195
- loadInBatches: () => import_core44.loadInBatches,
81196
- makeIterator: () => import_core44.makeIterator,
81197
- makeLineIterator: () => import_core44.makeLineIterator,
81198
- makeNumberedLineIterator: () => import_core44.makeNumberedLineIterator,
81199
- makeStream: () => import_core44.makeStream,
81200
- makeTextDecoderIterator: () => import_core44.makeTextDecoderIterator,
81201
- makeTextEncoderIterator: () => import_core44.makeTextEncoderIterator,
81202
- parse: () => import_core44.parse,
81503
+ global: () => import_core45.global,
81504
+ isAsyncIterable: () => import_core45.isAsyncIterable,
81505
+ isBrowser: () => import_core45.isBrowser,
81506
+ isIterable: () => import_core45.isIterable,
81507
+ isIterator: () => import_core45.isIterator,
81508
+ isPromise: () => import_core45.isPromise,
81509
+ isPureObject: () => import_core45.isPureObject,
81510
+ isReadableStream: () => import_core45.isReadableStream,
81511
+ isResponse: () => import_core45.isResponse,
81512
+ isWorker: () => import_core45.isWorker,
81513
+ isWritableStream: () => import_core45.isWritableStream,
81514
+ load: () => import_core45.load,
81515
+ loadInBatches: () => import_core45.loadInBatches,
81516
+ makeIterator: () => import_core45.makeIterator,
81517
+ makeLineIterator: () => import_core45.makeLineIterator,
81518
+ makeNumberedLineIterator: () => import_core45.makeNumberedLineIterator,
81519
+ makeStream: () => import_core45.makeStream,
81520
+ makeTextDecoderIterator: () => import_core45.makeTextDecoderIterator,
81521
+ makeTextEncoderIterator: () => import_core45.makeTextEncoderIterator,
81522
+ parse: () => import_core45.parse,
81203
81523
  parse3DTilesArchive: () => parse3DTilesArchive,
81204
- parseFile: () => import_core44.parseFile,
81205
- parseInBatches: () => import_core44.parseInBatches,
81206
- parseSync: () => import_core44.parseSync,
81207
- preload: () => import_core44.preload,
81208
- preloadSync: () => import_core44.preloadSync,
81209
- readArrayBuffer: () => import_core44.readArrayBuffer,
81210
- registerLoaders: () => import_core44.registerLoaders,
81211
- resolvePath: () => import_core44.resolvePath,
81212
- selectLoader: () => import_core44.selectLoader,
81213
- selectLoaderSync: () => import_core44.selectLoaderSync,
81214
- self: () => import_core44.self,
81215
- setLoaderOptions: () => import_core44.setLoaderOptions,
81216
- setPathPrefix: () => import_core44.setPathPrefix,
81217
- window: () => import_core44.window
81218
- });
81219
- var import_core44 = __toESM(require_core(), 1);
81524
+ parseFile: () => import_core45.parseFile,
81525
+ parseInBatches: () => import_core45.parseInBatches,
81526
+ parseSync: () => import_core45.parseSync,
81527
+ preload: () => import_core45.preload,
81528
+ preloadSync: () => import_core45.preloadSync,
81529
+ readArrayBuffer: () => import_core45.readArrayBuffer,
81530
+ registerLoaders: () => import_core45.registerLoaders,
81531
+ resolvePath: () => import_core45.resolvePath,
81532
+ selectLoader: () => import_core45.selectLoader,
81533
+ selectLoaderSync: () => import_core45.selectLoaderSync,
81534
+ self: () => import_core45.self,
81535
+ setLoaderOptions: () => import_core45.setLoaderOptions,
81536
+ setPathPrefix: () => import_core45.setPathPrefix,
81537
+ window: () => import_core45.window
81538
+ });
81539
+ var import_core45 = __toESM(require_core(), 1);
81220
81540
 
81221
81541
  // src/3d-tiles/index.ts
81222
81542
  init_tiles_3d_format();