@speridlabs/visus 2.0.1 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var ve = Object.defineProperty;
2
2
  var we = (A, e, n) => e in A ? ve(A, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : A[e] = n;
3
- var d = (A, e, n) => we(A, typeof e != "symbol" ? e + "" : e, n);
3
+ var h = (A, e, n) => we(A, typeof e != "symbol" ? e + "" : e, n);
4
4
  import be, { useRef as Se, useMemo as Me, useEffect as _e } from "react";
5
5
  import { useLoader as Ae } from "@react-three/fiber";
6
6
  import * as l from "three";
@@ -15,23 +15,23 @@ var ce = { exports: {} }, ae = {};
15
15
  * LICENSE file in the root directory of this source tree.
16
16
  */
17
17
  var pe;
18
- function Ce() {
18
+ function Te() {
19
19
  if (pe) return ae;
20
20
  pe = 1;
21
21
  var A = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
22
- function n(t, o, r) {
22
+ function n(r, t, o) {
23
23
  var a = null;
24
- if (r !== void 0 && (a = "" + r), o.key !== void 0 && (a = "" + o.key), "key" in o) {
25
- r = {};
26
- for (var i in o)
27
- i !== "key" && (r[i] = o[i]);
28
- } else r = o;
29
- return o = r.ref, {
24
+ if (o !== void 0 && (a = "" + o), t.key !== void 0 && (a = "" + t.key), "key" in t) {
25
+ o = {};
26
+ for (var i in t)
27
+ i !== "key" && (o[i] = t[i]);
28
+ } else o = t;
29
+ return t = o.ref, {
30
30
  $$typeof: A,
31
- type: t,
31
+ type: r,
32
32
  key: a,
33
- ref: o !== void 0 ? o : null,
34
- props: r
33
+ ref: t !== void 0 ? t : null,
34
+ props: o
35
35
  };
36
36
  }
37
37
  return ae.Fragment = e, ae.jsx = n, ae.jsxs = n, ae;
@@ -47,12 +47,12 @@ var ie = {};
47
47
  * LICENSE file in the root directory of this source tree.
48
48
  */
49
49
  var me;
50
- function Te() {
50
+ function Ce() {
51
51
  return me || (me = 1, process.env.NODE_ENV !== "production" && function() {
52
52
  function A(s) {
53
53
  if (s == null) return null;
54
54
  if (typeof s == "function")
55
- return s.$$typeof === g ? null : s.displayName || s.name || null;
55
+ return s.$$typeof === y ? null : s.displayName || s.name || null;
56
56
  if (typeof s == "string") return s;
57
57
  switch (s) {
58
58
  case I:
@@ -61,11 +61,11 @@ function Te() {
61
61
  return "Profiler";
62
62
  case z:
63
63
  return "StrictMode";
64
- case L:
64
+ case W:
65
65
  return "Suspense";
66
66
  case _:
67
67
  return "SuspenseList";
68
- case C:
68
+ case T:
69
69
  return "Activity";
70
70
  }
71
71
  if (typeof s == "object")
@@ -74,7 +74,7 @@ function Te() {
74
74
  ), s.$$typeof) {
75
75
  case b:
76
76
  return "Portal";
77
- case W:
77
+ case L:
78
78
  return (s.displayName || "Context") + ".Provider";
79
79
  case H:
80
80
  return (s._context.displayName || "Context") + ".Consumer";
@@ -112,7 +112,7 @@ function Te() {
112
112
  ), e(s);
113
113
  }
114
114
  }
115
- function t(s) {
115
+ function r(s) {
116
116
  if (s === I) return "<>";
117
117
  if (typeof s == "object" && s !== null && s.$$typeof === D)
118
118
  return "<...>";
@@ -123,11 +123,11 @@ function Te() {
123
123
  return "<...>";
124
124
  }
125
125
  }
126
- function o() {
126
+ function t() {
127
127
  var s = R.A;
128
128
  return s === null ? null : s.getOwner();
129
129
  }
130
- function r() {
130
+ function o() {
131
131
  return Error("react-stack-top-frame");
132
132
  }
133
133
  function a(s) {
@@ -155,7 +155,7 @@ function Te() {
155
155
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
156
156
  )), s = this.props.ref, s !== void 0 ? s : null;
157
157
  }
158
- function v(s, p, S, E, m, c, y, P) {
158
+ function v(s, p, S, E, m, c, g, P) {
159
159
  return S = c.ref, s = {
160
160
  $$typeof: w,
161
161
  type: s,
@@ -179,7 +179,7 @@ function Te() {
179
179
  configurable: !1,
180
180
  enumerable: !1,
181
181
  writable: !0,
182
- value: y
182
+ value: g
183
183
  }), Object.defineProperty(s, "_debugTask", {
184
184
  configurable: !1,
185
185
  enumerable: !1,
@@ -187,25 +187,25 @@ function Te() {
187
187
  value: P
188
188
  }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
189
189
  }
190
- function M(s, p, S, E, m, c, y, P) {
191
- var h = p.children;
192
- if (h !== void 0)
190
+ function M(s, p, S, E, m, c, g, P) {
191
+ var f = p.children;
192
+ if (f !== void 0)
193
193
  if (E)
194
- if (X(h)) {
195
- for (E = 0; E < h.length; E++)
196
- T(h[E]);
197
- Object.freeze && Object.freeze(h);
194
+ if (X(f)) {
195
+ for (E = 0; E < f.length; E++)
196
+ C(f[E]);
197
+ Object.freeze && Object.freeze(f);
198
198
  } else
199
199
  console.error(
200
200
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
201
201
  );
202
- else T(h);
202
+ else C(f);
203
203
  if (B.call(p, "key")) {
204
- h = A(s);
204
+ f = A(s);
205
205
  var k = Object.keys(p).filter(function(V) {
206
206
  return V !== "key";
207
207
  });
208
- E = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", te[h + E] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
208
+ E = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", te[f + E] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
209
209
  `A props object containing a "key" prop is being spread into JSX:
210
210
  let props = %s;
211
211
  <%s {...props} />
@@ -213,45 +213,45 @@ React keys must be passed directly to JSX without using spread:
213
213
  let props = %s;
214
214
  <%s key={someKey} {...props} />`,
215
215
  E,
216
- h,
216
+ f,
217
217
  k,
218
- h
219
- ), te[h + E] = !0);
218
+ f
219
+ ), te[f + E] = !0);
220
220
  }
221
- if (h = null, S !== void 0 && (n(S), h = "" + S), a(p) && (n(p.key), h = "" + p.key), "key" in p) {
221
+ if (f = null, S !== void 0 && (n(S), f = "" + S), a(p) && (n(p.key), f = "" + p.key), "key" in p) {
222
222
  S = {};
223
223
  for (var O in p)
224
224
  O !== "key" && (S[O] = p[O]);
225
225
  } else S = p;
226
- return h && i(
226
+ return f && i(
227
227
  S,
228
228
  typeof s == "function" ? s.displayName || s.name || "Unknown" : s
229
229
  ), v(
230
230
  s,
231
- h,
231
+ f,
232
232
  c,
233
233
  m,
234
- o(),
234
+ t(),
235
235
  S,
236
- y,
236
+ g,
237
237
  P
238
238
  );
239
239
  }
240
- function T(s) {
240
+ function C(s) {
241
241
  typeof s == "object" && s !== null && s.$$typeof === w && s._store && (s._store.validated = 1);
242
242
  }
243
- var f = be, w = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), I = Symbol.for("react.fragment"), z = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), H = Symbol.for("react.consumer"), W = Symbol.for("react.context"), ne = Symbol.for("react.forward_ref"), L = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), C = Symbol.for("react.activity"), g = Symbol.for("react.client.reference"), R = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, X = Array.isArray, $ = console.createTask ? console.createTask : function() {
243
+ var d = be, w = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), I = Symbol.for("react.fragment"), z = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), H = Symbol.for("react.consumer"), L = Symbol.for("react.context"), ne = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), T = Symbol.for("react.activity"), y = Symbol.for("react.client.reference"), R = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, X = Array.isArray, $ = console.createTask ? console.createTask : function() {
244
244
  return null;
245
245
  };
246
- f = {
246
+ d = {
247
247
  "react-stack-bottom-frame": function(s) {
248
248
  return s();
249
249
  }
250
250
  };
251
- var Z, U = {}, F = f["react-stack-bottom-frame"].bind(
252
- f,
253
- r
254
- )(), N = $(t(r)), te = {};
251
+ var Z, U = {}, F = d["react-stack-bottom-frame"].bind(
252
+ d,
253
+ o
254
+ )(), N = $(r(o)), te = {};
255
255
  ie.Fragment = I, ie.jsx = function(s, p, S, E, m) {
256
256
  var c = 1e4 > R.recentlyCreatedOwnerStacks++;
257
257
  return M(
@@ -262,7 +262,7 @@ React keys must be passed directly to JSX without using spread:
262
262
  E,
263
263
  m,
264
264
  c ? Error("react-stack-top-frame") : F,
265
- c ? $(t(s)) : N
265
+ c ? $(r(s)) : N
266
266
  );
267
267
  }, ie.jsxs = function(s, p, S, E, m) {
268
268
  var c = 1e4 > R.recentlyCreatedOwnerStacks++;
@@ -274,23 +274,23 @@ React keys must be passed directly to JSX without using spread:
274
274
  E,
275
275
  m,
276
276
  c ? Error("react-stack-top-frame") : F,
277
- c ? $(t(s)) : N
277
+ c ? $(r(s)) : N
278
278
  );
279
279
  };
280
280
  }()), ie;
281
281
  }
282
282
  var xe;
283
283
  function ke() {
284
- return xe || (xe = 1, process.env.NODE_ENV === "production" ? ce.exports = Ce() : ce.exports = Te()), ce.exports;
284
+ return xe || (xe = 1, process.env.NODE_ENV === "production" ? ce.exports = Te() : ce.exports = Ce()), ce.exports;
285
285
  }
286
286
  var Ee = ke();
287
- class he {
287
+ class fe {
288
288
  constructor() {
289
- d(this, "min", new l.Vector3(1 / 0, 1 / 0, 1 / 0));
290
- d(this, "max", new l.Vector3(-1 / 0, -1 / 0, -1 / 0));
291
- d(this, "center", new l.Vector3());
289
+ h(this, "min", new l.Vector3(1 / 0, 1 / 0, 1 / 0));
290
+ h(this, "max", new l.Vector3(-1 / 0, -1 / 0, -1 / 0));
291
+ h(this, "center", new l.Vector3());
292
292
  /** Half extents (size/2) */
293
- d(this, "halfExtents", new l.Vector3());
293
+ h(this, "halfExtents", new l.Vector3());
294
294
  }
295
295
  /**
296
296
  * Reset the bounding box to its initial state
@@ -338,20 +338,20 @@ class he {
338
338
  * @returns New bounding box with the same values
339
339
  */
340
340
  clone() {
341
- const e = new he();
341
+ const e = new fe();
342
342
  return e.min.copy(this.min), e.max.copy(this.max), e.center.copy(this.center), e.halfExtents.copy(this.halfExtents), e;
343
343
  }
344
344
  }
345
345
  class Ie {
346
346
  // TODO: there is no sh spherical harmonics
347
347
  constructor(e = 0) {
348
- d(this, "numSplats", 0);
349
- d(this, "positions");
350
- d(this, "rotations");
351
- d(this, "scales");
352
- d(this, "colors");
353
- d(this, "opacities");
354
- d(this, "boundingBox", new he());
348
+ h(this, "numSplats", 0);
349
+ h(this, "positions");
350
+ h(this, "rotations");
351
+ h(this, "scales");
352
+ h(this, "colors");
353
+ h(this, "opacities");
354
+ h(this, "boundingBox", new fe());
355
355
  this.numSplats = e, this.allocateBuffers(e);
356
356
  }
357
357
  allocateBuffers(e) {
@@ -366,13 +366,13 @@ class Ie {
366
366
  * @param color Color
367
367
  * @param opacity Opacity value
368
368
  */
369
- setSplat(e, n, t, o, r, a) {
369
+ setSplat(e, n, r, t, o, a) {
370
370
  if (e >= this.numSplats)
371
371
  throw new Error(
372
372
  `Splat index out of bounds: ${e} >= ${this.numSplats}`
373
373
  );
374
374
  const i = e * 3, u = e * 4, v = e * 3, M = e * 3;
375
- this.positions[i] = n.x, this.positions[i + 1] = n.y, this.positions[i + 2] = n.z, this.rotations[u] = t.x, this.rotations[u + 1] = t.y, this.rotations[u + 2] = t.z, this.rotations[u + 3] = t.w, this.scales[v] = o.x, this.scales[v + 1] = o.y, this.scales[v + 2] = o.z, this.colors[M] = r.r, this.colors[M + 1] = r.g, this.colors[M + 2] = r.b, this.opacities[e] = a;
375
+ this.positions[i] = n.x, this.positions[i + 1] = n.y, this.positions[i + 2] = n.z, this.rotations[u] = r.x, this.rotations[u + 1] = r.y, this.rotations[u + 2] = r.z, this.rotations[u + 3] = r.w, this.scales[v] = t.x, this.scales[v + 1] = t.y, this.scales[v + 2] = t.z, this.colors[M] = o.r, this.colors[M + 1] = o.g, this.colors[M + 2] = o.b, this.opacities[e] = a;
376
376
  }
377
377
  /**
378
378
  * Get a splat's data
@@ -384,7 +384,7 @@ class Ie {
384
384
  throw new Error(
385
385
  `Splat index out of bounds: ${e} >= ${this.numSplats}`
386
386
  );
387
- const n = e * 3, t = e * 4, o = e * 3, r = e * 3;
387
+ const n = e * 3, r = e * 4, t = e * 3, o = e * 3;
388
388
  return {
389
389
  position: new l.Vector3(
390
390
  this.positions[n],
@@ -392,21 +392,21 @@ class Ie {
392
392
  this.positions[n + 2]
393
393
  ),
394
394
  rotation: new l.Quaternion(
395
- this.rotations[t],
396
- this.rotations[t + 1],
397
- this.rotations[t + 2],
398
- this.rotations[t + 3]
395
+ this.rotations[r],
396
+ this.rotations[r + 1],
397
+ this.rotations[r + 2],
398
+ this.rotations[r + 3]
399
399
  ),
400
400
  // Convert log scale back to linear scale for external use
401
401
  scale: new l.Vector3(
402
- Math.exp(this.scales[o]),
403
- Math.exp(this.scales[o + 1]),
404
- Math.exp(this.scales[o + 2])
402
+ Math.exp(this.scales[t]),
403
+ Math.exp(this.scales[t + 1]),
404
+ Math.exp(this.scales[t + 2])
405
405
  ),
406
406
  color: new l.Color(
407
- this.colors[r],
408
- this.colors[r + 1],
409
- this.colors[r + 2]
407
+ this.colors[o],
408
+ this.colors[o + 1],
409
+ this.colors[o + 2]
410
410
  ),
411
411
  opacity: this.opacities[e]
412
412
  };
@@ -419,11 +419,11 @@ class Ie {
419
419
  this.boundingBox.reset();
420
420
  const e = new l.Vector3();
421
421
  for (let n = 0; n < this.numSplats; n++) {
422
- const t = n * 3;
422
+ const r = n * 3;
423
423
  e.set(
424
- this.positions[t],
425
- this.positions[t + 1],
426
- this.positions[t + 2]
424
+ this.positions[r],
425
+ this.positions[r + 1],
426
+ this.positions[r + 2]
427
427
  ), this.boundingBox.expandByPoint(e);
428
428
  }
429
429
  return this.boundingBox;
@@ -438,15 +438,15 @@ class Ie {
438
438
  "position",
439
439
  new l.BufferAttribute(this.positions, 3)
440
440
  );
441
- const n = new Float32Array(this.numSplats * 3), t = new l.Quaternion(), o = new l.Euler();
442
- for (let r = 0; r < this.numSplats; r++) {
443
- const a = r * 4, i = r * 3;
444
- t.set(
441
+ const n = new Float32Array(this.numSplats * 3), r = new l.Quaternion(), t = new l.Euler();
442
+ for (let o = 0; o < this.numSplats; o++) {
443
+ const a = o * 4, i = o * 3;
444
+ r.set(
445
445
  this.rotations[a],
446
446
  this.rotations[a + 1],
447
447
  this.rotations[a + 2],
448
448
  this.rotations[a + 3]
449
- ), o.setFromQuaternion(t), n[i] = o.x, n[i + 1] = o.y, n[i + 2] = o.z;
449
+ ), t.setFromQuaternion(r), n[i] = t.x, n[i + 1] = t.y, n[i + 2] = t.z;
450
450
  }
451
451
  return e.setAttribute(
452
452
  "rotation",
@@ -466,32 +466,32 @@ class Ie {
466
466
  class Re extends l.Loader {
467
467
  constructor(n) {
468
468
  super(n);
469
- d(this, "requestId", 0);
470
- d(this, "worker");
471
- d(this, "pendingCallbacks", /* @__PURE__ */ new Map());
472
- const t = this.createWorkerCode(), o = new Blob([t], { type: "application/javascript" });
473
- this.worker = new Worker(URL.createObjectURL(o)), this.worker.onmessage = this.onWorkerMessage.bind(this);
469
+ h(this, "requestId", 0);
470
+ h(this, "worker");
471
+ h(this, "pendingCallbacks", /* @__PURE__ */ new Map());
472
+ const r = this.createWorkerCode(), t = new Blob([r], { type: "application/javascript" });
473
+ this.worker = new Worker(URL.createObjectURL(t)), this.worker.onmessage = this.onWorkerMessage.bind(this);
474
474
  }
475
475
  /**
476
476
  * Handles messages received from the parsing worker
477
477
  * @param event The message event from the worker
478
478
  */
479
479
  onWorkerMessage(n) {
480
- const { requestId: t, error: o, result: r } = n.data, a = this.pendingCallbacks.get(t);
481
- if (!a) return console.warn(`PlyLoader: Received response for unknown request ${t}`);
482
- if (this.pendingCallbacks.delete(t), o) return a.reject(new Error(o));
483
- if (!r) return a.reject(new Error("Worker returned no result"));
480
+ const { requestId: r, error: t, result: o } = n.data, a = this.pendingCallbacks.get(r);
481
+ if (!a) return console.warn(`PlyLoader: Received response for unknown request ${r}`);
482
+ if (this.pendingCallbacks.delete(r), t) return a.reject(new Error(t));
483
+ if (!o) return a.reject(new Error("Worker returned no result"));
484
484
  try {
485
485
  const i = new Ie(0);
486
- i.numSplats = r.numSplats, i.positions = new Float32Array(r.positions), i.rotations = new Float32Array(r.rotations), i.scales = new Float32Array(r.scales), i.colors = new Float32Array(r.colors), i.opacities = new Float32Array(r.opacities), i.boundingBox.min.set(
487
- r.boundingBox.minX,
488
- r.boundingBox.minY,
489
- r.boundingBox.minZ
486
+ i.numSplats = o.numSplats, i.positions = new Float32Array(o.positions), i.rotations = new Float32Array(o.rotations), i.scales = new Float32Array(o.scales), i.colors = new Float32Array(o.colors), i.opacities = new Float32Array(o.opacities), i.boundingBox.min.set(
487
+ o.boundingBox.minX,
488
+ o.boundingBox.minY,
489
+ o.boundingBox.minZ
490
490
  ), i.boundingBox.max.set(
491
- r.boundingBox.maxX,
492
- r.boundingBox.maxY,
493
- r.boundingBox.maxZ
494
- ), a.resolve(i);
491
+ o.boundingBox.maxX,
492
+ o.boundingBox.maxY,
493
+ o.boundingBox.maxZ
494
+ ), this.worker.terminate(), a.resolve(i);
495
495
  } catch (i) {
496
496
  a.reject(i);
497
497
  }
@@ -503,19 +503,19 @@ class Re extends l.Loader {
503
503
  * @param onProgress Optional progress callback
504
504
  * @param onError Optional error callback
505
505
  */
506
- load(n, t, o, r) {
506
+ load(n, r, t, o) {
507
507
  const a = new l.FileLoader(this.manager);
508
508
  a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setPath(this.path), a.setWithCredentials(this.withCredentials), a.load(
509
509
  n,
510
510
  (i) => {
511
511
  this.parseAsync(i).then((u) => {
512
- t && t(u);
512
+ r && r(u);
513
513
  }).catch((u) => {
514
- r ? r(u) : console.error(u), this.manager.itemError(n);
514
+ o ? o(u) : console.error(u), this.manager.itemError(n);
515
515
  });
516
516
  },
517
- o,
518
- r
517
+ t,
518
+ o
519
519
  );
520
520
  }
521
521
  /**
@@ -524,19 +524,19 @@ class Re extends l.Loader {
524
524
  * @param onProgress Optional progress callback
525
525
  * @returns A Promise that resolves with the parsed SplatData
526
526
  */
527
- loadAsync(n, t) {
528
- return new Promise((o, r) => {
527
+ loadAsync(n, r) {
528
+ return new Promise((t, o) => {
529
529
  const a = new l.FileLoader(this.manager);
530
530
  a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setPath(this.path), a.setWithCredentials(this.withCredentials), a.load(
531
531
  n,
532
532
  (i) => {
533
- this.parseAsync(i).then(o).catch((u) => {
534
- r(u), this.manager.itemError(n);
533
+ this.parseAsync(i).then(t).catch((u) => {
534
+ o(u), this.manager.itemError(n);
535
535
  });
536
536
  },
537
- t,
537
+ r,
538
538
  (i) => {
539
- r(i), this.manager.itemError(n);
539
+ o(i), this.manager.itemError(n);
540
540
  }
541
541
  );
542
542
  });
@@ -547,11 +547,11 @@ class Re extends l.Loader {
547
547
  * @returns Promise that resolves with parsed SplatData
548
548
  */
549
549
  parseAsync(n) {
550
- return new Promise((t, o) => {
551
- const r = this.requestId++;
552
- this.pendingCallbacks.set(r, { resolve: t, reject: o });
550
+ return new Promise((r, t) => {
551
+ const o = this.requestId++;
552
+ this.pendingCallbacks.set(o, { resolve: r, reject: t });
553
553
  const a = {
554
- requestId: r,
554
+ requestId: o,
555
555
  buffer: n
556
556
  };
557
557
  this.worker.postMessage(a, [n]);
@@ -569,11 +569,11 @@ class Re extends l.Loader {
569
569
  */
570
570
  createWorkerCode() {
571
571
  return `(${(function() {
572
- self.onmessage = (o) => {
573
- const { requestId: r, buffer: a } = o.data;
572
+ self.onmessage = (t) => {
573
+ const { requestId: o, buffer: a } = t.data;
574
574
  try {
575
- const i = t(a), u = {
576
- requestId: r,
575
+ const i = r(a), u = {
576
+ requestId: o,
577
577
  result: i
578
578
  };
579
579
  self.postMessage(u, [
@@ -585,14 +585,14 @@ class Re extends l.Loader {
585
585
  ]);
586
586
  } catch (i) {
587
587
  const u = {
588
- requestId: r,
588
+ requestId: o,
589
589
  error: i instanceof Error ? i.message : String(i)
590
590
  };
591
591
  self.postMessage(u);
592
592
  }
593
593
  };
594
- function t(o) {
595
- const r = new TextDecoder(), a = new Uint8Array(o), i = [112, 108, 121, 10], u = `
594
+ function r(t) {
595
+ const o = new TextDecoder(), a = new Uint8Array(t), i = [112, 108, 121, 10], u = `
596
596
  end_header
597
597
  `;
598
598
  for (let m = 0; m < i.length; m++)
@@ -603,8 +603,8 @@ end_header
603
603
  let v = 0;
604
604
  for (let m = 0; m < a.length - u.length; m++) {
605
605
  let c = !0;
606
- for (let y = 0; y < u.length; y++)
607
- if (a[m + y] !== u.charCodeAt(y)) {
606
+ for (let g = 0; g < u.length; g++)
607
+ if (a[m + g] !== u.charCodeAt(g)) {
608
608
  c = !1;
609
609
  break;
610
610
  }
@@ -617,50 +617,50 @@ end_header
617
617
  throw new Error(
618
618
  "Invalid PLY file: Could not find end of header"
619
619
  );
620
- const T = r.decode(
620
+ const C = o.decode(
621
621
  a.subarray(0, v)
622
622
  ).split(`
623
- `), f = [];
623
+ `), d = [];
624
624
  let w = null;
625
- for (let m = 1; m < T.length; m++) {
626
- const c = T[m].trim();
625
+ for (let m = 1; m < C.length; m++) {
626
+ const c = C[m].trim();
627
627
  if (c === "" || c === "end_header") continue;
628
- const y = c.split(" ");
629
- switch (y[0]) {
628
+ const g = c.split(" ");
629
+ switch (g[0]) {
630
630
  case "format":
631
- w = y[1];
631
+ w = g[1];
632
632
  break;
633
633
  case "element":
634
- f.push({
635
- name: y[1],
636
- count: parseInt(y[2], 10),
634
+ d.push({
635
+ name: g[1],
636
+ count: parseInt(g[2], 10),
637
637
  properties: []
638
638
  });
639
639
  break;
640
640
  case "property":
641
- if (f.length === 0)
641
+ if (d.length === 0)
642
642
  throw new Error(
643
643
  "Invalid PLY file: Property without element"
644
644
  );
645
- f[f.length - 1].properties.push({
646
- type: y[1],
647
- name: y[2]
645
+ d[d.length - 1].properties.push({
646
+ type: g[1],
647
+ name: g[2]
648
648
  });
649
649
  break;
650
650
  }
651
651
  }
652
652
  if (w !== "binary_little_endian")
653
653
  throw new Error(`Unsupported PLY format: ${w}`);
654
- const b = f.find((m) => m.name === "vertex");
654
+ const b = d.find((m) => m.name === "vertex");
655
655
  if (!b)
656
656
  throw new Error(
657
657
  "Invalid PLY file: No vertex element found"
658
658
  );
659
- const I = b.count, z = new Float32Array(I * 3), j = new Float32Array(I * 4), H = new Float32Array(I * 3), W = new Float32Array(I * 3), ne = new Float32Array(I), L = new DataView(o);
659
+ const I = b.count, z = new Float32Array(I * 3), j = new Float32Array(I * 4), H = new Float32Array(I * 3), L = new Float32Array(I * 3), ne = new Float32Array(I), W = new DataView(t);
660
660
  let _ = v;
661
661
  const x = (m) => b.properties.findIndex(
662
662
  (c) => c.name === m
663
- ), D = x("x"), C = x("y"), g = x("z"), R = [
663
+ ), D = x("x"), T = x("y"), y = x("z"), R = [
664
664
  x("rot_0"),
665
665
  x("rot_1"),
666
666
  x("rot_2"),
@@ -676,8 +676,8 @@ end_header
676
676
  ], $ = x("opacity");
677
677
  if ([
678
678
  D,
679
- C,
680
- g,
679
+ T,
680
+ y,
681
681
  ...R,
682
682
  ...B,
683
683
  ...X,
@@ -694,43 +694,43 @@ end_header
694
694
  let N = 1 / 0, te = 1 / 0, s = 1 / 0, p = -1 / 0, S = -1 / 0, E = -1 / 0;
695
695
  for (let m = 0; m < I; m++) {
696
696
  const c = [];
697
- for (let fe = 0; fe < b.properties.length; fe++) {
698
- const de = b.properties[fe].type;
697
+ for (let de = 0; de < b.properties.length; de++) {
698
+ const he = b.properties[de].type;
699
699
  let ee;
700
- switch (de) {
700
+ switch (he) {
701
701
  case "char":
702
- ee = L.getInt8(_), _ += 1;
702
+ ee = W.getInt8(_), _ += 1;
703
703
  break;
704
704
  case "uchar":
705
- ee = L.getUint8(_), _ += 1;
705
+ ee = W.getUint8(_), _ += 1;
706
706
  break;
707
707
  case "short":
708
- ee = L.getInt16(_, !0), _ += 2;
708
+ ee = W.getInt16(_, !0), _ += 2;
709
709
  break;
710
710
  case "ushort":
711
- ee = L.getUint16(_, !0), _ += 2;
711
+ ee = W.getUint16(_, !0), _ += 2;
712
712
  break;
713
713
  case "int":
714
- ee = L.getInt32(_, !0), _ += 4;
714
+ ee = W.getInt32(_, !0), _ += 4;
715
715
  break;
716
716
  case "uint":
717
- ee = L.getUint32(_, !0), _ += 4;
717
+ ee = W.getUint32(_, !0), _ += 4;
718
718
  break;
719
719
  case "float":
720
- ee = L.getFloat32(_, !0), _ += 4;
720
+ ee = W.getFloat32(_, !0), _ += 4;
721
721
  break;
722
722
  case "double":
723
- ee = L.getFloat64(_, !0), _ += 8;
723
+ ee = W.getFloat64(_, !0), _ += 8;
724
724
  break;
725
725
  default:
726
726
  throw new Error(
727
- `Unsupported property type: ${de}`
727
+ `Unsupported property type: ${he}`
728
728
  );
729
729
  }
730
730
  c.push(ee);
731
731
  }
732
- const y = c[D], P = c[C], h = c[g], k = m * 3;
733
- z[k] = y, z[k + 1] = P, z[k + 2] = h, N = Math.min(N, y), te = Math.min(te, P), s = Math.min(s, h), p = Math.max(p, y), S = Math.max(S, P), E = Math.max(E, h);
732
+ const g = c[D], P = c[T], f = c[y], k = m * 3;
733
+ z[k] = g, z[k + 1] = P, z[k + 2] = f, N = Math.min(N, g), te = Math.min(te, P), s = Math.min(s, f), p = Math.max(p, g), S = Math.max(S, P), E = Math.max(E, f);
734
734
  let O = c[R[1]], V = c[R[2]], G = c[R[3]], q = c[R[0]];
735
735
  const Y = Math.sqrt(
736
736
  O * O + V * V + G * G + q * q
@@ -743,14 +743,14 @@ end_header
743
743
  let re = 0.5 + c[X[0]] * U, oe = 0.5 + c[X[1]] * U, J = 0.5 + c[X[2]] * U;
744
744
  re = Math.max(0, Math.min(1, re)), oe = Math.max(0, Math.min(1, oe)), J = Math.max(0, Math.min(1, J));
745
745
  const ue = m * 3;
746
- W[ue] = re, W[ue + 1] = oe, W[ue + 2] = J, ne[m] = F(c[$]);
746
+ L[ue] = re, L[ue + 1] = oe, L[ue + 2] = J, ne[m] = F(c[$]);
747
747
  }
748
748
  return {
749
749
  numSplats: I,
750
750
  positions: z.buffer,
751
751
  rotations: j.buffer,
752
752
  scales: H.buffer,
753
- colors: W.buffer,
753
+ colors: L.buffer,
754
754
  opacities: ne.buffer,
755
755
  boundingBox: {
756
756
  minX: N,
@@ -768,15 +768,15 @@ end_header
768
768
  class Pe extends l.EventDispatcher {
769
769
  constructor() {
770
770
  super();
771
- d(this, "worker");
772
- d(this, "centers", null);
773
- d(this, "orderTexture", null);
771
+ h(this, "worker");
772
+ h(this, "centers", null);
773
+ h(this, "orderTexture", null);
774
774
  /** Bounding box data for optimization */
775
- d(this, "chunks", null);
776
- d(this, "lastCameraPosition", new l.Vector3());
777
- d(this, "lastCameraDirection", new l.Vector3());
778
- const n = this.createWorkerCode(), t = new Blob([n], { type: "application/javascript" });
779
- this.worker = new Worker(URL.createObjectURL(t)), this.worker.onmessage = this.onWorkerMessage.bind(this);
775
+ h(this, "chunks", null);
776
+ h(this, "lastCameraPosition", new l.Vector3());
777
+ h(this, "lastCameraDirection", new l.Vector3());
778
+ const n = this.createWorkerCode(), r = new Blob([n], { type: "application/javascript" });
779
+ this.worker = new Worker(URL.createObjectURL(r)), this.worker.onmessage = this.onWorkerMessage.bind(this);
780
780
  }
781
781
  /**
782
782
  * Handles messages received from the sorting worker.
@@ -785,14 +785,14 @@ class Pe extends l.EventDispatcher {
785
785
  onWorkerMessage(n) {
786
786
  if (!this.orderTexture || !this.orderTexture.image)
787
787
  return console.error("SplatSorter: Order texture not initialized!");
788
- const { order: t, count: o } = n.data, r = this.orderTexture.image.data;
789
- if (!(r instanceof Uint32Array))
788
+ const { order: r, count: t } = n.data, o = this.orderTexture.image.data;
789
+ if (!(o instanceof Uint32Array))
790
790
  return console.error(
791
791
  "SplatSorter: Order texture data is not a Uint32Array!"
792
792
  );
793
- r.set(new Uint32Array(t)), this.orderTexture.needsUpdate = !0;
794
- const a = r.buffer.slice(0), i = { order: a };
795
- this.worker.postMessage(i, [a]), this.dispatchEvent({ type: "updated", count: o });
793
+ o.set(new Uint32Array(r)), this.orderTexture.source.data.updateRanges || (this.orderTexture.source.data.updateRanges = []), this.orderTexture.needsUpdate = !0;
794
+ const a = o.buffer.slice(0), i = { order: a };
795
+ this.worker.postMessage(i, [a]), this.dispatchEvent({ type: "updated", count: t });
796
796
  }
797
797
  /**
798
798
  * Initializes the sorter with necessary data and textures.
@@ -801,31 +801,35 @@ class Pe extends l.EventDispatcher {
801
801
  * @param chunks Optional: A Float32Array containing bounding box chunk data [minX, minY, minZ, maxX, maxY, maxZ, ...] for optimization.
802
802
  * @param transferOwnership Optional: If true, transfers ownership of centers buffer to worker (saves memory, main thread loses access). Default: false.
803
803
  */
804
- init(n, t, o, r = !1) {
804
+ init(n, r, t, o = !1) {
805
805
  if (!n || !(n.image.data instanceof Uint32Array))
806
806
  throw new Error("SplatSorter: Invalid orderTexture provided. Must be DataTexture with Uint32Array data.");
807
- if (!t || t.length % 3 !== 0)
807
+ if (!r || r.length % 3 !== 0)
808
808
  throw new Error("SplatSorter: Invalid centers array provided. Length must be multiple of 3.");
809
- if (n.image.data.length < t.length / 3)
809
+ if (n.image.data.length < r.length / 3)
810
810
  throw new Error("SplatSorter: orderTexture data buffer is smaller than the number of splats.");
811
- const a = t.length / 3;
812
- this.orderTexture = n, r ? this.centers = null : this.centers = t.slice();
811
+ if (r.buffer.byteLength === 0)
812
+ throw new Error(
813
+ "SplatSorter: positions buffer is detached (likely React StrictMode + cached asset). "
814
+ );
815
+ const a = r.length / 3;
816
+ this.orderTexture = n, o ? this.centers = null : this.centers = r.slice();
813
817
  const i = this.orderTexture.image.data;
814
- for (let f = 0; f < a; f++) i[f] = f;
815
- this.orderTexture.needsUpdate = !0;
816
- const u = i.buffer.slice(0), v = r ? t.buffer : t.buffer.slice(0), M = {
818
+ for (let d = 0; d < a; d++) i[d] = d;
819
+ this.orderTexture.source.data.updateRanges || (this.orderTexture.source.data.updateRanges = []), this.orderTexture.needsUpdate = !0;
820
+ const u = i.buffer.slice(0), v = o ? r.buffer : r.buffer.slice(0), M = {
817
821
  order: u,
818
822
  centers: v
819
- }, T = [
823
+ }, C = [
820
824
  u,
821
825
  v
822
826
  ];
823
- if (o) {
824
- this.chunks = o.slice();
825
- const f = this.chunks.buffer.slice(0);
826
- M.chunks = f, T.push(f);
827
+ if (t) {
828
+ this.chunks = t.slice();
829
+ const d = this.chunks.buffer.slice(0);
830
+ M.chunks = d, C.push(d);
827
831
  }
828
- this.worker.postMessage(M, T), queueMicrotask(() => {
832
+ this.worker.postMessage(M, C), queueMicrotask(() => {
829
833
  this.dispatchEvent({
830
834
  type: "updated",
831
835
  count: a
@@ -842,16 +846,16 @@ class Pe extends l.EventDispatcher {
842
846
  return console.warn(
843
847
  "SplatSorter: Cannot set mapping before initialization."
844
848
  );
845
- let t;
846
- const o = [];
849
+ let r;
850
+ const t = [];
847
851
  if (!n) {
848
852
  const u = this.centers.buffer.slice(0);
849
- return t = {
853
+ return r = {
850
854
  centers: u,
851
855
  mapping: null
852
- }, o.push(u), this.worker.postMessage(t, o);
856
+ }, t.push(u), this.worker.postMessage(r, t);
853
857
  }
854
- const r = new Float32Array(n.length * 3);
858
+ const o = new Float32Array(n.length * 3);
855
859
  for (let u = 0; u < n.length; u++) {
856
860
  const v = n[u];
857
861
  if (v * 3 + 2 >= this.centers.length) {
@@ -860,28 +864,28 @@ class Pe extends l.EventDispatcher {
860
864
  );
861
865
  continue;
862
866
  }
863
- const M = v * 3, T = u * 3;
864
- r[T + 0] = this.centers[M + 0], r[T + 1] = this.centers[M + 1], r[T + 2] = this.centers[M + 2];
867
+ const M = v * 3, C = u * 3;
868
+ o[C + 0] = this.centers[M + 0], o[C + 1] = this.centers[M + 1], o[C + 2] = this.centers[M + 2];
865
869
  }
866
- const a = r.buffer.slice(0), i = n.buffer.slice(0);
867
- t = {
870
+ const a = o.buffer.slice(0), i = n.buffer.slice(0);
871
+ r = {
868
872
  centers: a,
869
873
  mapping: i
870
- }, o.push(a, i), this.worker.postMessage(t, o);
874
+ }, t.push(a, i), this.worker.postMessage(r, t);
871
875
  }
872
876
  /**
873
877
  * Updates the camera parameters used for sorting.
874
878
  * @param position The camera's position in the sorter's local coordinate space.
875
879
  * @param direction The camera's forward direction in the sorter's local coordinate space.
876
880
  */
877
- setCamera(n, t) {
878
- const o = this.lastCameraPosition.distanceToSquared(n) > 1e-7, r = this.lastCameraDirection.dot(t) < 0.9999;
879
- if (!o && !r)
881
+ setCamera(n, r) {
882
+ const t = this.lastCameraPosition.distanceToSquared(n) > 1e-7, o = this.lastCameraDirection.dot(r) < 0.9999;
883
+ if (!t && !o)
880
884
  return;
881
- this.lastCameraPosition.copy(n), this.lastCameraDirection.copy(t);
885
+ this.lastCameraPosition.copy(n), this.lastCameraDirection.copy(r);
882
886
  const a = {
883
887
  cameraPosition: { x: n.x, y: n.y, z: n.z },
884
- cameraDirection: { x: t.x, y: t.y, z: t.z }
888
+ cameraDirection: { x: r.x, y: r.y, z: r.z }
885
889
  };
886
890
  this.worker.postMessage(a);
887
891
  }
@@ -897,49 +901,49 @@ class Pe extends l.EventDispatcher {
897
901
  */
898
902
  createWorkerCode() {
899
903
  return `(${(function() {
900
- let t = null, o = null, r = null, a = null, i = null, u = null, v = !1;
901
- const M = { x: 0, y: 0, z: 0 }, T = { x: 0, y: 0, z: 0 }, f = { x: 0, y: 0, z: 0 }, w = { x: 0, y: 0, z: 0 };
904
+ let r = null, t = null, o = null, a = null, i = null, u = null, v = !1;
905
+ const M = { x: 0, y: 0, z: 0 }, C = { x: 0, y: 0, z: 0 }, d = { x: 0, y: 0, z: 0 }, w = { x: 0, y: 0, z: 0 };
902
906
  let b = null, I = null;
903
- const z = 32, j = new Array(z).fill(0), H = new Array(z).fill(0), W = new Array(z).fill(0), ne = (_, x, D) => {
907
+ const z = 32, j = new Array(z).fill(0), H = new Array(z).fill(0), L = new Array(z).fill(0), ne = (_, x, D) => {
904
908
  for (; _ <= x; ) {
905
- const C = x + _ >> 1, g = D(C);
906
- if (g > 0) _ = C + 1;
907
- else if (g < 0) x = C - 1;
908
- else return C;
909
+ const T = x + _ >> 1, y = D(T);
910
+ if (y > 0) _ = T + 1;
911
+ else if (y < 0) x = T - 1;
912
+ else return T;
909
913
  }
910
914
  return ~_;
911
- }, L = () => {
912
- if (!t || !o || !i || !u)
915
+ }, W = () => {
916
+ if (!r || !t || !i || !u)
913
917
  return;
914
- if (o.length === 0) {
918
+ if (t.length === 0) {
915
919
  const c = {
916
- order: t.buffer,
920
+ order: r.buffer,
917
921
  count: 0
918
922
  };
919
- self.postMessage(c, [t.buffer]), t = null;
923
+ self.postMessage(c, [r.buffer]), r = null;
920
924
  return;
921
925
  }
922
- const _ = i.x, x = i.y, D = i.z, C = u.x, g = u.y, R = u.z, B = 1e-4, X = Math.abs(_ - M.x) > B || Math.abs(x - M.y) > B || Math.abs(D - M.z) > B, $ = Math.abs(C - T.x) > B || Math.abs(g - T.y) > B || Math.abs(R - T.z) > B;
926
+ const _ = i.x, x = i.y, D = i.z, T = u.x, y = u.y, R = u.z, B = 1e-4, X = Math.abs(_ - M.x) > B || Math.abs(x - M.y) > B || Math.abs(D - M.z) > B, $ = Math.abs(T - C.x) > B || Math.abs(y - C.y) > B || Math.abs(R - C.z) > B;
923
927
  if (!v && !X && !$)
924
928
  return;
925
- v = !1, M.x = _, M.y = x, M.z = D, T.x = C, T.y = g, T.z = R;
929
+ v = !1, M.x = _, M.y = x, M.z = D, C.x = T, C.y = y, C.z = R;
926
930
  let Z = 1 / 0, U = -1 / 0;
927
931
  for (let c = 0; c < 8; ++c) {
928
- const y = c & 1 ? f.x : w.x, P = c & 2 ? f.y : w.y, h = c & 4 ? f.z : w.z, k = y * C + P * g + h * R;
932
+ const g = c & 1 ? d.x : w.x, P = c & 2 ? d.y : w.y, f = c & 4 ? d.z : w.z, k = g * T + P * y + f * R;
929
933
  Z = Math.min(Z, k), U = Math.max(U, k);
930
934
  }
931
- const F = o.length / 3, N = U - Z, s = (1 << Math.max(
935
+ const F = t.length / 3, N = U - Z, s = (1 << Math.max(
932
936
  10,
933
937
  Math.min(20, Math.ceil(Math.log2(F / 4)))
934
938
  )) + 1;
935
939
  if ((!b || b.length !== F) && (b = new Uint32Array(F)), !I || I.length !== s ? I = new Uint32Array(s) : I.fill(0), N < 1e-7) {
936
940
  for (let c = 0; c < F; ++c) b[c] = 0;
937
941
  I[0] = F;
938
- } else if (r && r.length > 0) {
939
- const c = r.length / 6;
942
+ } else if (o && o.length > 0) {
943
+ const c = o.length / 6;
940
944
  j.fill(0);
941
- for (let h = 0; h < c; ++h) {
942
- const k = h * 6, O = r[k + 0], V = r[k + 1], G = r[k + 2], q = r[k + 3], Y = O * C + V * g + G * R - Z, Q = Y - q, K = Y + q, re = Math.max(
945
+ for (let f = 0; f < c; ++f) {
946
+ const k = f * 6, O = o[k + 0], V = o[k + 1], G = o[k + 2], q = o[k + 3], Y = O * T + V * y + G * R - Z, Q = Y - q, K = Y + q, re = Math.max(
943
947
  0,
944
948
  Math.floor(Q * z / N)
945
949
  ), oe = Math.min(
@@ -949,43 +953,43 @@ class Pe extends l.EventDispatcher {
949
953
  for (let J = re; J < oe; ++J)
950
954
  j[J]++;
951
955
  }
952
- let y = 0;
953
- for (let h = 0; h < z; ++h) y += j[h];
954
- W[0] = 0, H[0] = 0;
955
- for (let h = 1; h < z; ++h)
956
- W[h - 1] = j[h - 1] / y * s >>> 0, H[h] = H[h - 1] + W[h - 1];
957
- W[z - 1] = j[z - 1] / y * s >>> 0;
956
+ let g = 0;
957
+ for (let f = 0; f < z; ++f) g += j[f];
958
+ L[0] = 0, H[0] = 0;
959
+ for (let f = 1; f < z; ++f)
960
+ L[f - 1] = j[f - 1] / g * s >>> 0, H[f] = H[f - 1] + L[f - 1];
961
+ L[z - 1] = j[z - 1] / g * s >>> 0;
958
962
  const P = N / z;
959
- for (let h = 0; h < F; ++h) {
960
- const k = h * 3, O = o[k + 0], V = o[k + 1], G = o[k + 2], q = O * C + V * g + G * R, Q = (U - q) / P, K = Math.max(
963
+ for (let f = 0; f < F; ++f) {
964
+ const k = f * 3, O = t[k + 0], V = t[k + 1], G = t[k + 2], q = O * T + V * y + G * R, Q = (U - q) / P, K = Math.max(
961
965
  0,
962
966
  Math.min(
963
967
  z - 1,
964
968
  Math.floor(Q)
965
969
  )
966
- ), re = Q - K, oe = H[K] + W[K] * re >>> 0, J = Math.min(oe, s - 1);
967
- b[h] = J, I[J]++;
970
+ ), re = Q - K, oe = H[K] + L[K] * re >>> 0, J = Math.min(oe, s - 1);
971
+ b[f] = J, I[J]++;
968
972
  }
969
973
  } else {
970
974
  const c = (s - 1) / N;
971
- for (let y = 0; y < F; ++y) {
972
- const P = y * 3, h = o[P + 0], k = o[P + 1], O = o[P + 2], V = h * C + k * g + O * R, q = (U - V) * c >>> 0, Y = Math.min(q, s - 1);
973
- b[y] = Y, I[Y]++;
975
+ for (let g = 0; g < F; ++g) {
976
+ const P = g * 3, f = t[P + 0], k = t[P + 1], O = t[P + 2], V = f * T + k * y + O * R, q = (U - V) * c >>> 0, Y = Math.min(q, s - 1);
977
+ b[g] = Y, I[Y]++;
974
978
  }
975
979
  }
976
980
  for (let c = 1; c < s; c++)
977
981
  I[c] += I[c - 1];
978
982
  for (let c = F - 1; c >= 0; c--) {
979
- const y = b[c], P = --I[y];
980
- t[P] = a ? a[c] : c;
983
+ const g = b[c], P = --I[g];
984
+ r[P] = a ? a[c] : c;
981
985
  }
982
- const p = _ * C + x * g + D * R, S = (c) => {
983
- if (!t) return -1 / 0;
984
- const y = t[c], P = y;
985
- if (!o || P * 3 + 2 >= o.length)
986
+ const p = _ * T + x * y + D * R, S = (c) => {
987
+ if (!r) return -1 / 0;
988
+ const g = r[c], P = g;
989
+ if (!t || P * 3 + 2 >= t.length)
986
990
  return -1 / 0;
987
- const h = P * 3;
988
- return o[h] * C + o[h + 1] * g + o[h + 2] * R - p;
991
+ const f = P * 3;
992
+ return t[f] * T + t[f + 1] * y + t[f + 2] * R - p;
989
993
  };
990
994
  let E = F;
991
995
  if (F > 0 && S(F - 1) < 0) {
@@ -997,63 +1001,63 @@ class Pe extends l.EventDispatcher {
997
1001
  E = c < 0 ? ~c : c;
998
1002
  }
999
1003
  const m = {
1000
- order: t.buffer,
1004
+ order: r.buffer,
1001
1005
  count: E
1002
1006
  };
1003
- self.postMessage(m, [t.buffer]), t = null;
1007
+ self.postMessage(m, [r.buffer]), r = null;
1004
1008
  };
1005
1009
  self.onmessage = (_) => {
1006
1010
  const x = _.data;
1007
- x.order && (t = new Uint32Array(x.order));
1011
+ x.order && (r = new Uint32Array(x.order));
1008
1012
  let D = !1;
1009
- if (x.centers && (o = new Float32Array(x.centers), D = !0, v = !0), Object.prototype.hasOwnProperty.call(x, "mapping") && (a = x.mapping ? new Uint32Array(x.mapping) : null, v = !0), x.chunks) {
1010
- if (r = new Float32Array(x.chunks), r.length > 0 && r[3] > 0)
1011
- for (let C = 0; C < r.length / 6; ++C) {
1012
- const g = C * 6, R = r[g + 0], B = r[g + 1], X = r[g + 2], $ = r[g + 3], Z = r[g + 4], U = r[g + 5];
1013
- r[g + 0] = (R + $) * 0.5, r[g + 1] = (B + Z) * 0.5, r[g + 2] = (X + U) * 0.5, r[g + 3] = Math.sqrt(
1013
+ if (x.centers && (t = new Float32Array(x.centers), D = !0, v = !0), Object.prototype.hasOwnProperty.call(x, "mapping") && (a = x.mapping ? new Uint32Array(x.mapping) : null, v = !0), x.chunks) {
1014
+ if (o = new Float32Array(x.chunks), o.length > 0 && o[3] > 0)
1015
+ for (let T = 0; T < o.length / 6; ++T) {
1016
+ const y = T * 6, R = o[y + 0], B = o[y + 1], X = o[y + 2], $ = o[y + 3], Z = o[y + 4], U = o[y + 5];
1017
+ o[y + 0] = (R + $) * 0.5, o[y + 1] = (B + Z) * 0.5, o[y + 2] = (X + U) * 0.5, o[y + 3] = Math.sqrt(
1014
1018
  ($ - R) ** 2 + (Z - B) ** 2 + (U - X) ** 2
1015
1019
  ) * 0.5;
1016
1020
  }
1017
1021
  v = !0;
1018
1022
  }
1019
- if (D && o && o.length > 0) {
1020
- f.x = w.x = o[0], f.y = w.y = o[1], f.z = w.z = o[2];
1021
- for (let C = 1; C < o.length / 3; C++) {
1022
- const g = C * 3;
1023
- f.x = Math.min(f.x, o[g + 0]), w.x = Math.max(w.x, o[g + 0]), f.y = Math.min(f.y, o[g + 1]), w.y = Math.max(w.y, o[g + 1]), f.z = Math.min(f.z, o[g + 2]), w.z = Math.max(w.z, o[g + 2]);
1023
+ if (D && t && t.length > 0) {
1024
+ d.x = w.x = t[0], d.y = w.y = t[1], d.z = w.z = t[2];
1025
+ for (let T = 1; T < t.length / 3; T++) {
1026
+ const y = T * 3;
1027
+ d.x = Math.min(d.x, t[y + 0]), w.x = Math.max(w.x, t[y + 0]), d.y = Math.min(d.y, t[y + 1]), w.y = Math.max(w.y, t[y + 1]), d.z = Math.min(d.z, t[y + 2]), w.z = Math.max(w.z, t[y + 2]);
1024
1028
  }
1025
- } else D && o && o.length === 0 && (f.x = w.x = f.y = w.y = f.z = w.z = 0);
1026
- x.cameraPosition && (i = x.cameraPosition), x.cameraDirection && (u = x.cameraDirection), L();
1029
+ } else D && t && t.length === 0 && (d.x = w.x = d.y = w.y = d.z = w.z = 0);
1030
+ x.cameraPosition && (i = x.cameraPosition), x.cameraDirection && (u = x.cameraDirection), W();
1027
1031
  };
1028
1032
  }).toString()})();`;
1029
1033
  }
1030
1034
  }
1031
1035
  const ze = (A, e) => {
1032
- const n = ye(A), t = ye(e);
1033
- return n | t << 16;
1036
+ const n = ge(A), r = ge(e);
1037
+ return n | r << 16;
1034
1038
  };
1035
- function ye(A) {
1036
- const e = new Float32Array([A]), t = new Int32Array(e.buffer)[0];
1037
- let o = t >> 16 & 32768, r = t >> 12 & 2047;
1038
- const a = t >> 23 & 255;
1039
- return a < 103 ? o : a > 142 ? (o |= 31744, o |= (a === 255 ? 0 : 1) && t & 8388607, o) : a < 113 ? (r |= 2048, o |= (r >> 114 - a) + (r >> 113 - a & 1), o) : (o |= a - 112 << 10 | r >> 1, o += r & 1, o);
1039
+ function ge(A) {
1040
+ const e = new Float32Array([A]), r = new Int32Array(e.buffer)[0];
1041
+ let t = r >> 16 & 32768, o = r >> 12 & 2047;
1042
+ const a = r >> 23 & 255;
1043
+ return a < 103 ? t : a > 142 ? (t |= 31744, t |= (a === 255 ? 0 : 1) && r & 8388607, t) : a < 113 ? (o |= 2048, t |= (o >> 114 - a) + (o >> 113 - a & 1), t) : (t |= a - 112 << 10 | o >> 1, t += o & 1, t);
1040
1044
  }
1041
- const Be = new ArrayBuffer(4), ge = new DataView(Be), Fe = (A) => (ge.setUint32(0, A, !0), ge.getFloat32(0, !0));
1045
+ const Be = new ArrayBuffer(4), ye = new DataView(Be), Fe = (A) => (ye.setUint32(0, A, !0), ye.getFloat32(0, !0));
1042
1046
  class Oe {
1043
1047
  /**
1044
1048
  * Create a new TextureManager for a set of splats
1045
1049
  * @param splatData The splat data to manage textures for
1046
1050
  */
1047
1051
  constructor(e) {
1048
- d(this, "transformA");
1052
+ h(this, "textureWidth");
1053
+ h(this, "textureHeight");
1054
+ h(this, "transformA");
1049
1055
  // position xyz and rotation quaternion y,z components
1050
- d(this, "transformB");
1056
+ h(this, "transformB");
1051
1057
  // rotation quaternion x and scale xyz
1052
- d(this, "colorTexture");
1058
+ h(this, "colorTexture");
1053
1059
  // color an opacity
1054
- d(this, "orderTexture");
1055
- d(this, "textureWidth");
1056
- d(this, "textureHeight");
1060
+ h(this, "orderTexture");
1057
1061
  const n = e.numSplats;
1058
1062
  this.textureWidth = Math.ceil(Math.sqrt(n)), this.textureHeight = Math.ceil(n / this.textureWidth), this.transformA = this.createTransformATexture(e), this.transformB = this.createTransformBTexture(e), this.colorTexture = this.createColorTexture(e), this.orderTexture = this.createOrderTexture(n);
1059
1063
  }
@@ -1063,24 +1067,24 @@ class Oe {
1063
1067
  * @returns DataTexture containing position data
1064
1068
  */
1065
1069
  createTransformATexture(e) {
1066
- const n = e.numSplats, t = new Float32Array(
1070
+ const n = e.numSplats, r = new Float32Array(
1067
1071
  this.textureWidth * this.textureHeight * 4
1068
1072
  );
1069
- for (let r = 0; r < n; r++) {
1070
- const a = r * 4, i = r * 3, u = r * 4;
1071
- t[a] = e.positions[i], t[a + 1] = e.positions[i + 1], t[a + 2] = e.positions[i + 2];
1072
- const v = e.rotations[u + 0], M = e.rotations[u + 1], T = ze(v, M);
1073
- t[a + 3] = Fe(T);
1073
+ for (let o = 0; o < n; o++) {
1074
+ const a = o * 4, i = o * 3, u = o * 4;
1075
+ r[a] = e.positions[i], r[a + 1] = e.positions[i + 1], r[a + 2] = e.positions[i + 2];
1076
+ const v = e.rotations[u + 0], M = e.rotations[u + 1], C = ze(v, M);
1077
+ r[a + 3] = Fe(C);
1074
1078
  }
1075
- const o = new l.DataTexture(
1076
- t,
1079
+ const t = new l.DataTexture(
1080
+ r,
1077
1081
  this.textureWidth,
1078
1082
  this.textureHeight,
1079
1083
  l.RGBAFormat,
1080
1084
  l.FloatType
1081
1085
  // Store as Float32, shader will reinterpret bits
1082
1086
  );
1083
- return o.needsUpdate = !0, o.magFilter = l.NearestFilter, o.minFilter = l.NearestFilter, o;
1087
+ return t.magFilter = l.NearestFilter, t.minFilter = l.NearestFilter, t.source.data.updateRanges || (t.source.data.updateRanges = []), t.needsUpdate = !0, t;
1084
1088
  }
1085
1089
  /**
1086
1090
  * Create the transform B texture (scale and rotation xyz)
@@ -1088,21 +1092,21 @@ class Oe {
1088
1092
  * @returns DataTexture containing scale and rotation data
1089
1093
  */
1090
1094
  createTransformBTexture(e) {
1091
- const n = e.numSplats, t = new Float32Array(
1095
+ const n = e.numSplats, r = new Float32Array(
1092
1096
  this.textureWidth * this.textureHeight * 4
1093
1097
  );
1094
- for (let r = 0; r < n; r++) {
1095
- const a = r * 4, i = r * 3, u = r * 4;
1096
- t[a] = e.scales[i], t[a + 1] = e.scales[i + 1], t[a + 2] = e.scales[i + 2], t[a + 3] = e.rotations[u + 2];
1098
+ for (let o = 0; o < n; o++) {
1099
+ const a = o * 4, i = o * 3, u = o * 4;
1100
+ r[a] = e.scales[i], r[a + 1] = e.scales[i + 1], r[a + 2] = e.scales[i + 2], r[a + 3] = e.rotations[u + 2];
1097
1101
  }
1098
- const o = new l.DataTexture(
1099
- t,
1102
+ const t = new l.DataTexture(
1103
+ r,
1100
1104
  this.textureWidth,
1101
1105
  this.textureHeight,
1102
1106
  l.RGBAFormat,
1103
1107
  l.FloatType
1104
1108
  );
1105
- return o.needsUpdate = !0, o.magFilter = l.NearestFilter, o.minFilter = l.NearestFilter, o;
1109
+ return t.magFilter = l.NearestFilter, t.minFilter = l.NearestFilter, t.source.data.updateRanges || (t.source.data.updateRanges = []), t.needsUpdate = !0, t;
1106
1110
  }
1107
1111
  /**
1108
1112
  * Create the color texture (RGB and opacity)
@@ -1110,21 +1114,21 @@ class Oe {
1110
1114
  * @returns DataTexture containing color data
1111
1115
  */
1112
1116
  createColorTexture(e) {
1113
- const n = e.numSplats, t = new Float32Array(
1117
+ const n = e.numSplats, r = new Float32Array(
1114
1118
  this.textureWidth * this.textureHeight * 4
1115
1119
  );
1116
- for (let r = 0; r < n; r++) {
1117
- const a = r * 4, i = r * 3;
1118
- t[a] = e.colors[i], t[a + 1] = e.colors[i + 1], t[a + 2] = e.colors[i + 2], t[a + 3] = e.opacities[r];
1120
+ for (let o = 0; o < n; o++) {
1121
+ const a = o * 4, i = o * 3;
1122
+ r[a] = e.colors[i], r[a + 1] = e.colors[i + 1], r[a + 2] = e.colors[i + 2], r[a + 3] = e.opacities[o];
1119
1123
  }
1120
- const o = new l.DataTexture(
1121
- t,
1124
+ const t = new l.DataTexture(
1125
+ r,
1122
1126
  this.textureWidth,
1123
1127
  this.textureHeight,
1124
1128
  l.RGBAFormat,
1125
1129
  l.FloatType
1126
1130
  );
1127
- return o.needsUpdate = !0, o;
1131
+ return t.source.data.updateRanges || (t.source.data.updateRanges = []), t.needsUpdate = !0, t;
1128
1132
  }
1129
1133
  /**
1130
1134
  * Create the order texture for sorting
@@ -1133,16 +1137,16 @@ class Oe {
1133
1137
  */
1134
1138
  createOrderTexture(e) {
1135
1139
  const n = new Uint32Array(this.textureWidth * this.textureHeight);
1136
- for (let o = 0; o < e; o++)
1137
- n[o] = o;
1138
- const t = new l.DataTexture(
1140
+ for (let t = 0; t < e; t++)
1141
+ n[t] = t;
1142
+ const r = new l.DataTexture(
1139
1143
  n,
1140
1144
  this.textureWidth,
1141
1145
  this.textureHeight,
1142
1146
  l.RedIntegerFormat,
1143
1147
  l.UnsignedIntType
1144
1148
  );
1145
- return t.needsUpdate = !0, t;
1149
+ return r.source.data.updateRanges || (r.source.data.updateRanges = []), r.needsUpdate = !0, r;
1146
1150
  }
1147
1151
  dispose() {
1148
1152
  this.transformA.dispose(), this.transformB.dispose(), this.colorTexture.dispose(), this.orderTexture.dispose();
@@ -1534,33 +1538,33 @@ const se = class se extends l.Mesh {
1534
1538
  * @param splatData The splat data to render
1535
1539
  * @param options Rendering options
1536
1540
  */
1537
- constructor(n, t = {}) {
1538
- const o = new Ve(t), r = se.createInstancedGeometry(n.numSplats, se.INSTANCE_SIZE);
1539
- super(r, o);
1540
- d(this, "sorter");
1541
- d(this, "splatData");
1542
- d(this, "options");
1543
- d(this, "textureManager");
1544
- d(this, "material");
1545
- d(this, "geometry");
1546
- d(this, "lastCameraPositionLocal", new l.Vector3());
1547
- d(this, "lastCameraDirectionLocal", new l.Vector3());
1548
- d(this, "invModelMatrix", new l.Matrix4());
1541
+ constructor(n, r = {}) {
1542
+ const t = new Ve(r), o = se.createInstancedGeometry(n.numSplats, se.INSTANCE_SIZE);
1543
+ super(o, t);
1544
+ h(this, "sorter");
1545
+ h(this, "splatData");
1546
+ h(this, "options");
1547
+ h(this, "textureManager");
1548
+ h(this, "material");
1549
+ h(this, "geometry");
1550
+ h(this, "lastCameraPositionLocal", new l.Vector3());
1551
+ h(this, "lastCameraDirectionLocal", new l.Vector3());
1552
+ h(this, "invModelMatrix", new l.Matrix4());
1549
1553
  // Cached inverse matrix
1550
- d(this, "_vpW", -1);
1551
- d(this, "_vpH", -1);
1552
- d(this, "_size", new l.Vector2());
1553
- d(this, "_camPosW", new l.Vector3());
1554
- d(this, "_camDirW", new l.Vector3());
1555
- d(this, "_camPosL", new l.Vector3());
1556
- d(this, "_camDirL", new l.Vector3());
1557
- d(this, "onSorterUpdated", (n) => {
1558
- const t = n.count;
1559
- this.geometry.instanceCount = Math.ceil(t / se.INSTANCE_SIZE), this.material.setNumSplats(t);
1554
+ h(this, "_vpW", -1);
1555
+ h(this, "_vpH", -1);
1556
+ h(this, "_size", new l.Vector2());
1557
+ h(this, "_camPosW", new l.Vector3());
1558
+ h(this, "_camDirW", new l.Vector3());
1559
+ h(this, "_camPosL", new l.Vector3());
1560
+ h(this, "_camDirL", new l.Vector3());
1561
+ h(this, "onSorterUpdated", (n) => {
1562
+ const r = n.count;
1563
+ this.geometry.instanceCount = Math.ceil(r / se.INSTANCE_SIZE), this.material.setNumSplats(r);
1560
1564
  });
1561
- this.geometry = r, this.material = o, this.splatData = n, this.frustumCulled = !1, this.options = {
1565
+ this.geometry = o, this.material = t, this.splatData = n, this.frustumCulled = !1, this.options = {
1562
1566
  autoSort: !0,
1563
- ...t
1567
+ ...r
1564
1568
  }, this.textureManager = new Oe(n), this.sorter = new Pe();
1565
1569
  let a = this.createChunks() || void 0;
1566
1570
  a === null && console.warn("Visus: Could not create sorter chunks, bounding box might be invalid."), a = void 0, this.sorter.addEventListener("updated", this.onSorterUpdated), this.sorter.init(
@@ -1576,8 +1580,8 @@ const se = class se extends l.Mesh {
1576
1580
  * @param instanceSize Number of splats per instance.
1577
1581
  * @returns InstancedBufferGeometry
1578
1582
  */
1579
- static createInstancedGeometry(n, t) {
1580
- const o = Math.ceil(n / t), r = new l.BufferGeometry(), a = new Float32Array([
1583
+ static createInstancedGeometry(n, r) {
1584
+ const t = Math.ceil(n / r), o = new l.BufferGeometry(), a = new Float32Array([
1581
1585
  // x, y, splat_index_in_instance
1582
1586
  -1,
1583
1587
  -1,
@@ -1591,24 +1595,24 @@ const se = class se extends l.Mesh {
1591
1595
  -1,
1592
1596
  1,
1593
1597
  0
1594
- ]), i = new Uint16Array([0, 1, 2, 0, 2, 3]), u = new Float32Array(4 * 3 * t);
1595
- for (let f = 0; f < t; f++) {
1596
- const w = f * 4 * 3;
1598
+ ]), i = new Uint16Array([0, 1, 2, 0, 2, 3]), u = new Float32Array(4 * 3 * r);
1599
+ for (let d = 0; d < r; d++) {
1600
+ const w = d * 4 * 3;
1597
1601
  for (let b = 0; b < 4; b++)
1598
- u[w + b * 3 + 0] = a[b * 3 + 0], u[w + b * 3 + 1] = a[b * 3 + 1], u[w + b * 3 + 2] = f;
1602
+ u[w + b * 3 + 0] = a[b * 3 + 0], u[w + b * 3 + 1] = a[b * 3 + 1], u[w + b * 3 + 2] = d;
1599
1603
  }
1600
- const v = new Uint32Array(6 * t);
1601
- for (let f = 0; f < t; f++) {
1602
- const w = f * 6, b = f * 4;
1604
+ const v = new Uint32Array(6 * r);
1605
+ for (let d = 0; d < r; d++) {
1606
+ const w = d * 6, b = d * 4;
1603
1607
  v[w + 0] = i[0] + b, v[w + 1] = i[1] + b, v[w + 2] = i[2] + b, v[w + 3] = i[3] + b, v[w + 4] = i[4] + b, v[w + 5] = i[5] + b;
1604
1608
  }
1605
- r.setAttribute("position", new l.BufferAttribute(u, 3)), r.setIndex(new l.BufferAttribute(v, 1));
1609
+ o.setAttribute("position", new l.BufferAttribute(u, 3)), o.setIndex(new l.BufferAttribute(v, 1));
1606
1610
  const M = new l.InstancedBufferGeometry();
1607
- M.index = r.index, M.setAttribute("position", r.getAttribute("position"));
1608
- const T = new Uint32Array(o);
1609
- for (let f = 0; f < o; f++)
1610
- T[f] = f * t;
1611
- return M.setAttribute("splatInstanceIndex", new l.InstancedBufferAttribute(T, 1, !1)), M.instanceCount = 0, M;
1611
+ M.index = o.index, M.setAttribute("position", o.getAttribute("position"));
1612
+ const C = new Uint32Array(t);
1613
+ for (let d = 0; d < t; d++)
1614
+ C[d] = d * r;
1615
+ return M.setAttribute("splatInstanceIndex", new l.InstancedBufferAttribute(C, 1, !1)), M.instanceCount = 0, M;
1612
1616
  }
1613
1617
  /**
1614
1618
  * Create chunks data (bounding box min/max) for the sorter.
@@ -1632,8 +1636,8 @@ const se = class se extends l.Mesh {
1632
1636
  * @param width Viewport width
1633
1637
  * @param height Viewport height
1634
1638
  */
1635
- updateViewport(n, t) {
1636
- n === this._vpW && t === this._vpH || (this._vpW = n, this._vpH = t, this.material.updateViewport(n, t));
1639
+ updateViewport(n, r) {
1640
+ n === this._vpW && r === this._vpH || (this._vpW = n, this._vpH = r, this.material.updateViewport(n, r));
1637
1641
  }
1638
1642
  /**
1639
1643
  * Sorts splats based on camera position and direction.
@@ -1641,8 +1645,8 @@ const se = class se extends l.Mesh {
1641
1645
  */
1642
1646
  sort(n) {
1643
1647
  n.getWorldPosition(this._camPosW), n.getWorldDirection(this._camDirW), this.invModelMatrix.copy(this.matrixWorld).invert(), this._camPosL.copy(this._camPosW).applyMatrix4(this.invModelMatrix), this._camDirL.copy(this._camDirW).transformDirection(this.invModelMatrix);
1644
- const t = this.lastCameraPositionLocal.distanceToSquared(this._camPosL) > 1e-6, o = this.lastCameraDirectionLocal.dot(this._camDirL) < 0.999;
1645
- this.options.autoSort && (t || o) && (this.lastCameraPositionLocal.copy(this._camPosL), this.lastCameraDirectionLocal.copy(this._camDirL), this.sorter.setCamera(this._camPosL, this._camDirL));
1648
+ const r = this.lastCameraPositionLocal.distanceToSquared(this._camPosL) > 1e-6, t = this.lastCameraDirectionLocal.dot(this._camDirL) < 0.999;
1649
+ this.options.autoSort && (r || t) && (this.lastCameraPositionLocal.copy(this._camPosL), this.lastCameraDirectionLocal.copy(this._camDirL), this.sorter.setCamera(this._camPosL, this._camDirL));
1646
1650
  }
1647
1651
  /**
1648
1652
  * THREE.js hook called before rendering the object.
@@ -1653,8 +1657,8 @@ const se = class se extends l.Mesh {
1653
1657
  */
1654
1658
  // prettier-ignore
1655
1659
  // @ts-expect-error scene is not used
1656
- onBeforeRender(n, t, o) {
1657
- this.sort(o), n.getSize(this._size), this.updateViewport(this._size.x, this._size.y);
1660
+ onBeforeRender(n, r, t) {
1661
+ this.sort(t), n.getSize(this._size), this.updateViewport(this._size.x, this._size.y);
1658
1662
  }
1659
1663
  /**
1660
1664
  * Dispose of resources
@@ -1664,7 +1668,7 @@ const se = class se extends l.Mesh {
1664
1668
  }
1665
1669
  };
1666
1670
  /** Number of splats combined into a single instanced draw call. */
1667
- d(se, "INSTANCE_SIZE", 128);
1671
+ h(se, "INSTANCE_SIZE", 128);
1668
1672
  let le = se;
1669
1673
  const qe = Symbol.for("@speridlabs/visus/SplatMesh");
1670
1674
  try {
@@ -1681,16 +1685,16 @@ const Ye = ({
1681
1685
  plyUrl: A,
1682
1686
  debug: e = !1,
1683
1687
  splatOptions: n = {},
1684
- ...t
1688
+ ...r
1685
1689
  }) => {
1686
- typeof window < "u" && e && (window.__VISUS_SPLAT_DEBUG__ = !0), e && console.debug("SPLAT: rendering", { plyUrl: A, splatOptions: n, meshProps: t });
1687
- const o = Se(null), r = Ae(Re, A), a = Me(
1688
- () => new le(r, n || {}),
1689
- [r, n]
1690
+ typeof window < "u" && e && (window.__VISUS_SPLAT_DEBUG__ = !0), e && console.debug("SPLAT: rendering", { plyUrl: A, splatOptions: n, meshProps: r });
1691
+ const t = Se(null), o = Ae(Re, A), a = Me(
1692
+ () => new le(o, n || {}),
1693
+ [o, n]
1690
1694
  );
1691
1695
  return _e(() => () => {
1692
1696
  e && console.debug("SPLAT: disposing mesh for", A), typeof (a == null ? void 0 : a.dispose) == "function" && a.dispose();
1693
- }, [a]), /* @__PURE__ */ Ee.jsx("primitive", { ref: o, object: a, ...t });
1697
+ }, [a]), /* @__PURE__ */ Ee.jsx("primitive", { ref: t, object: a, ...r });
1694
1698
  };
1695
1699
  export {
1696
1700
  Re as PlyLoader,