@miris-inc/components 0.0.7-9be4c0d → 0.0.7-eebce5d

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 (2) hide show
  1. package/components.mjs +659 -646
  2. package/package.json +1 -1
package/components.mjs CHANGED
@@ -420,23 +420,23 @@ function ri() {
420
420
  if (MM) return TG;
421
421
  MM = 1;
422
422
  var g = CC(), A = Cw(), I = Oc(), B = Ew(), C = Bw(), Q = TypeError, E = Object.defineProperty, G = Object.getOwnPropertyDescriptor, D = "enumerable", R = "configurable", M = "writable";
423
- return TG.f = g ? I ? function(o, U, y) {
424
- if (B(o), U = C(U), B(y), typeof o == "function" && U === "prototype" && "value" in y && M in y && !y[M]) {
425
- var F = G(o, U);
426
- F && F[M] && (o[U] = y.value, y = {
423
+ return TG.f = g ? I ? function(o, w, y) {
424
+ if (B(o), w = C(w), B(y), typeof o == "function" && w === "prototype" && "value" in y && M in y && !y[M]) {
425
+ var F = G(o, w);
426
+ F && F[M] && (o[w] = y.value, y = {
427
427
  configurable: R in y ? y[R] : F[R],
428
428
  enumerable: D in y ? y[D] : F[D],
429
429
  writable: !1
430
430
  });
431
431
  }
432
- return E(o, U, y);
433
- } : E : function(o, U, y) {
434
- if (B(o), U = C(U), B(y), A) try {
435
- return E(o, U, y);
432
+ return E(o, w, y);
433
+ } : E : function(o, w, y) {
434
+ if (B(o), w = C(w), B(y), A) try {
435
+ return E(o, w, y);
436
436
  } catch {
437
437
  }
438
438
  if ("get" in y || "set" in y) throw new Q("Accessors not supported");
439
- return "value" in y && (o[U] = y.value), o;
439
+ return "value" in y && (o[w] = y.value), o;
440
440
  }, TG;
441
441
  }
442
442
  var OG, oM;
@@ -495,8 +495,8 @@ var $G, tM;
495
495
  function Pc() {
496
496
  if (tM) return $G;
497
497
  tM = 1;
498
- var g = Xc(), A = HI(), I = qC(), B = Gw(), C = rB(), Q = Ji(), E = zc(), G = Rw(), D = "Object already initialized", R = A.TypeError, M = A.WeakMap, i, o, U, y = function(x) {
499
- return U(x) ? o(x) : i(x, {});
498
+ var g = Xc(), A = HI(), I = qC(), B = Gw(), C = rB(), Q = Ji(), E = zc(), G = Rw(), D = "Object already initialized", R = A.TypeError, M = A.WeakMap, i, o, w, y = function(x) {
499
+ return w(x) ? o(x) : i(x, {});
500
500
  }, F = function(x) {
501
501
  return function(c) {
502
502
  var N;
@@ -506,14 +506,14 @@ function Pc() {
506
506
  };
507
507
  };
508
508
  if (g || Q.state) {
509
- var w = Q.state || (Q.state = new M());
510
- w.get = w.get, w.has = w.has, w.set = w.set, i = function(x, c) {
511
- if (w.has(x)) throw new R(D);
512
- return c.facade = x, w.set(x, c), c;
509
+ var U = Q.state || (Q.state = new M());
510
+ U.get = U.get, U.has = U.has, U.set = U.set, i = function(x, c) {
511
+ if (U.has(x)) throw new R(D);
512
+ return c.facade = x, U.set(x, c), c;
513
513
  }, o = function(x) {
514
- return w.get(x) || {};
515
- }, U = function(x) {
516
- return w.has(x);
514
+ return U.get(x) || {};
515
+ }, w = function(x) {
516
+ return U.has(x);
517
517
  };
518
518
  } else {
519
519
  var s = E("state");
@@ -522,14 +522,14 @@ function Pc() {
522
522
  return c.facade = x, B(x, s, c), c;
523
523
  }, o = function(x) {
524
524
  return C(x, s) ? x[s] : {};
525
- }, U = function(x) {
525
+ }, w = function(x) {
526
526
  return C(x, s);
527
527
  };
528
528
  }
529
529
  return $G = {
530
530
  set: i,
531
531
  get: o,
532
- has: U,
532
+ has: w,
533
533
  enforce: y,
534
534
  getterFor: F
535
535
  }, $G;
@@ -538,17 +538,17 @@ var cM;
538
538
  function _c() {
539
539
  if (cM) return vG.exports;
540
540
  cM = 1;
541
- var g = sg(), A = ZB(), I = lg(), B = rB(), C = CC(), Q = vc().CONFIGURABLE, E = Wc(), G = Pc(), D = G.enforce, R = G.get, M = String, i = Object.defineProperty, o = g("".slice), U = g("".replace), y = g([].join), F = C && !A(function() {
541
+ var g = sg(), A = ZB(), I = lg(), B = rB(), C = CC(), Q = vc().CONFIGURABLE, E = Wc(), G = Pc(), D = G.enforce, R = G.get, M = String, i = Object.defineProperty, o = g("".slice), w = g("".replace), y = g([].join), F = C && !A(function() {
542
542
  return i(function() {
543
543
  }, "length", { value: 8 }).length !== 8;
544
- }), w = String(String).split("String"), s = vG.exports = function(x, c, N) {
545
- o(M(c), 0, 7) === "Symbol(" && (c = "[" + U(M(c), /^Symbol\(([^)]*)\).*$/, "$1") + "]"), N && N.getter && (c = "get " + c), N && N.setter && (c = "set " + c), (!B(x, "name") || Q && x.name !== c) && (C ? i(x, "name", { value: c, configurable: !0 }) : x.name = c), F && N && B(N, "arity") && x.length !== N.arity && i(x, "length", { value: N.arity });
544
+ }), U = String(String).split("String"), s = vG.exports = function(x, c, N) {
545
+ o(M(c), 0, 7) === "Symbol(" && (c = "[" + w(M(c), /^Symbol\(([^)]*)\).*$/, "$1") + "]"), N && N.getter && (c = "get " + c), N && N.setter && (c = "set " + c), (!B(x, "name") || Q && x.name !== c) && (C ? i(x, "name", { value: c, configurable: !0 }) : x.name = c), F && N && B(N, "arity") && x.length !== N.arity && i(x, "length", { value: N.arity });
546
546
  try {
547
547
  N && B(N, "constructor") && N.constructor ? C && i(x, "prototype", { writable: !1 }) : x.prototype && (x.prototype = void 0);
548
548
  } catch {
549
549
  }
550
550
  var S = D(x);
551
- return B(S, "source") || (S.source = y(w, typeof c == "string" ? c : "")), x;
551
+ return B(S, "source") || (S.source = y(U, typeof c == "string" ? c : "")), x;
552
552
  };
553
553
  return Function.prototype.toString = s(function() {
554
554
  return I(this) && R(this).source || E(this);
@@ -731,13 +731,13 @@ function TC() {
731
731
  JM = 1;
732
732
  var g = HI(), A = Qw().f, I = Gw(), B = $c(), C = ei(), Q = Dx(), E = ix();
733
733
  return wR = function(G, D) {
734
- var R = G.target, M = G.global, i = G.stat, o, U, y, F, w, s;
735
- if (M ? U = g : i ? U = g[R] || C(R, {}) : U = g[R] && g[R].prototype, U) for (y in D) {
736
- if (w = D[y], G.dontCallGetSet ? (s = A(U, y), F = s && s.value) : F = U[y], o = E(M ? y : R + (i ? "." : "#") + y, G.forced), !o && F !== void 0) {
737
- if (typeof w == typeof F) continue;
738
- Q(w, F);
734
+ var R = G.target, M = G.global, i = G.stat, o, w, y, F, U, s;
735
+ if (M ? w = g : i ? w = g[R] || C(R, {}) : w = g[R] && g[R].prototype, w) for (y in D) {
736
+ if (U = D[y], G.dontCallGetSet ? (s = A(w, y), F = s && s.value) : F = w[y], o = E(M ? y : R + (i ? "." : "#") + y, G.forced), !o && F !== void 0) {
737
+ if (typeof U == typeof F) continue;
738
+ Q(U, F);
739
739
  }
740
- (G.sham || F && F.sham) && I(w, "sham", !0), B(U, y, w, G);
740
+ (G.sham || F && F.sham) && I(U, "sham", !0), B(w, y, U, G);
741
741
  }
742
742
  }, wR;
743
743
  }
@@ -851,17 +851,17 @@ var SR, VM;
851
851
  function ww() {
852
852
  if (VM) return SR;
853
853
  VM = 1;
854
- var g = HI(), A = sg(), I = Mw(), B = di(), C = rB(), Q = ow(), E = sw(), G = pE(), D = Q.c2i, R = Q.c2iUrl, M = g.SyntaxError, i = g.TypeError, o = A("".charAt), U = function(w, s) {
855
- for (var x = w.length; s < x; s++) {
856
- var c = o(w, s);
854
+ var g = HI(), A = sg(), I = Mw(), B = di(), C = rB(), Q = ow(), E = sw(), G = pE(), D = Q.c2i, R = Q.c2iUrl, M = g.SyntaxError, i = g.TypeError, o = A("".charAt), w = function(U, s) {
855
+ for (var x = U.length; s < x; s++) {
856
+ var c = o(U, s);
857
857
  if (c !== " " && c !== " " && c !== `
858
858
  ` && c !== "\f" && c !== "\r") break;
859
859
  }
860
860
  return s;
861
- }, y = function(w, s, x) {
862
- var c = w.length;
863
- c < 4 && (w += c === 2 ? "AA" : "A");
864
- var N = (s[o(w, 0)] << 18) + (s[o(w, 1)] << 12) + (s[o(w, 2)] << 6) + s[o(w, 3)], S = [
861
+ }, y = function(U, s, x) {
862
+ var c = U.length;
863
+ c < 4 && (U += c === 2 ? "AA" : "A");
864
+ var N = (s[o(U, 0)] << 18) + (s[o(U, 1)] << 12) + (s[o(U, 2)] << 6) + s[o(U, 3)], S = [
865
865
  N >> 16 & 255,
866
866
  N >> 8 & 255,
867
867
  N & 255
@@ -877,20 +877,20 @@ function ww() {
877
877
  return [S[0], S[1]];
878
878
  }
879
879
  return S;
880
- }, F = function(w, s, x) {
880
+ }, F = function(U, s, x) {
881
881
  for (var c = s.length, N = 0; N < c; N++)
882
- w[x + N] = s[N];
882
+ U[x + N] = s[N];
883
883
  return x + c;
884
884
  };
885
- return SR = function(w, s, x, c) {
886
- B(w), I(s);
885
+ return SR = function(U, s, x, c) {
886
+ B(U), I(s);
887
887
  var N = E(s) === "base64" ? D : R, S = s ? s.lastChunkHandling : void 0;
888
888
  if (S === void 0 && (S = "loose"), S !== "loose" && S !== "strict" && S !== "stop-before-partial")
889
889
  throw new i("Incorrect `lastChunkHandling` option");
890
890
  x && G(x.buffer);
891
- var a = w.length, j = x || [], n = 0, h = 0, Y = "", k = 0;
891
+ var a = U.length, j = x || [], n = 0, h = 0, Y = "", k = 0;
892
892
  if (c) for (; ; ) {
893
- if (k = U(w, k), k === a) {
893
+ if (k = w(U, k), k === a) {
894
894
  if (Y.length > 0) {
895
895
  if (S === "stop-before-partial")
896
896
  break;
@@ -904,17 +904,17 @@ function ww() {
904
904
  h = a;
905
905
  break;
906
906
  }
907
- var l = o(w, k);
907
+ var l = o(U, k);
908
908
  if (++k, l === "=") {
909
909
  if (Y.length < 2)
910
910
  throw new M("Padding is too early");
911
- if (k = U(w, k), Y.length === 2) {
911
+ if (k = w(U, k), Y.length === 2) {
912
912
  if (k === a) {
913
913
  if (S === "stop-before-partial")
914
914
  break;
915
915
  throw new M("Malformed padding: only one =");
916
916
  }
917
- o(w, k) === "=" && (++k, k = U(w, k));
917
+ o(U, k) === "=" && (++k, k = w(U, k));
918
918
  }
919
919
  if (k < a)
920
920
  throw new M("Unexpected character after padding");
@@ -965,12 +965,12 @@ function Uw() {
965
965
  return aR = function(R, M) {
966
966
  var i = R.length;
967
967
  if (i % 2 !== 0) throw new B("String should be an even number of characters");
968
- for (var o = M ? Q(M.length, i / 2) : i / 2, U = M || new I(o), y = 0, F = 0; F < o; ) {
969
- var w = D(R, y, y += 2);
970
- if (G(E, w)) throw new B("String should only contain hex characters");
971
- U[F++] = C(w, 16);
968
+ for (var o = M ? Q(M.length, i / 2) : i / 2, w = M || new I(o), y = 0, F = 0; F < o; ) {
969
+ var U = D(R, y, y += 2);
970
+ if (G(E, U)) throw new B("String should only contain hex characters");
971
+ w[F++] = C(U, 16);
972
972
  }
973
- return { bytes: U, read: y };
973
+ return { bytes: w, read: y };
974
974
  }, aR;
975
975
  }
976
976
  var PM;
@@ -1087,18 +1087,18 @@ function ax() {
1087
1087
  oo = 1;
1088
1088
  var g = TC(), A = HI(), I = sg(), B = Mw(), C = uE(), Q = pE(), E = ow(), G = sw(), D = E.i2c, R = E.i2cUrl, M = I("".charAt), i = A.Uint8Array, o = !i || !i.prototype.toBase64 || !(function() {
1089
1089
  try {
1090
- var U = new i();
1091
- U.toBase64(null);
1090
+ var w = new i();
1091
+ w.toBase64(null);
1092
1092
  } catch {
1093
1093
  return !0;
1094
1094
  }
1095
1095
  })();
1096
1096
  return i && g({ target: "Uint8Array", proto: !0, forced: o }, {
1097
1097
  toBase64: function() {
1098
- var y = C(this), F = arguments.length ? B(arguments[0]) : void 0, w = G(F) === "base64" ? D : R, s = !!F && !!F.omitPadding;
1098
+ var y = C(this), F = arguments.length ? B(arguments[0]) : void 0, U = G(F) === "base64" ? D : R, s = !!F && !!F.omitPadding;
1099
1099
  Q(this.buffer);
1100
1100
  for (var x = "", c = 0, N = y.length, S, a = function(j) {
1101
- return M(w, S >> 6 * j & 63);
1101
+ return M(U, S >> 6 * j & 63);
1102
1102
  }; c + 2 < N; c += 3)
1103
1103
  S = (y[c] << 16) + (y[c + 1] << 8) + y[c + 2], x += a(3) + a(2) + a(1) + a(0);
1104
1104
  return c + 2 === N ? (S = (y[c] << 16) + (y[c + 1] << 8), x += a(3) + a(2) + a(1) + (s ? "" : "=")) : c + 1 === N && (S = y[c] << 16, x += a(3) + a(2) + (s ? "" : "==")), x;
@@ -1367,6 +1367,7 @@ let oh = class aC {
1367
1367
  return this._keyMap.get(A);
1368
1368
  }
1369
1369
  #A;
1370
+ #g = !1;
1370
1371
  get key() {
1371
1372
  return this.#A ?? null;
1372
1373
  }
@@ -1374,7 +1375,7 @@ let oh = class aC {
1374
1375
  LC._keyMap.delete(this.key), (A || A === 0) && LC._keyMap.set(A, this), this.#A = A;
1375
1376
  }
1376
1377
  // prettier-ignore
1377
- #g = [
1378
+ #I = [
1378
1379
  1,
1379
1380
  0,
1380
1381
  0,
@@ -1393,12 +1394,12 @@ let oh = class aC {
1393
1394
  1
1394
1395
  ];
1395
1396
  get matrix() {
1396
- return this.#g;
1397
+ return this.#I;
1397
1398
  }
1398
1399
  set matrix(A) {
1399
- this.#g = A;
1400
- const I = LE(this.#g.length * 4);
1401
- aE.set(Float32Array.from(this.#g), I / 4), gh(this.scene.handle, this.id, I), li(I);
1400
+ this.#I = A;
1401
+ const I = LE(this.#I.length * 4);
1402
+ aE.set(Float32Array.from(this.#I), I / 4), gh(this.scene.handle, this.id, I), li(I);
1402
1403
  }
1403
1404
  get boundingBox() {
1404
1405
  const A = LE(24);
@@ -1421,9 +1422,9 @@ let oh = class aC {
1421
1422
  };
1422
1423
  return Object.freeze(D), D;
1423
1424
  }
1424
- #I = /* @__PURE__ */ new Set();
1425
+ #B = /* @__PURE__ */ new Set();
1425
1426
  get chunks() {
1426
- return new Set(this.#I);
1427
+ return new Set(this.#B);
1427
1428
  }
1428
1429
  constructor(A) {
1429
1430
  this.init(A), LC._idMap.set(this.id, this), A.scene.add(this);
@@ -1436,14 +1437,17 @@ let oh = class aC {
1436
1437
  id: { value: C }
1437
1438
  });
1438
1439
  }
1440
+ onStreamLoaded() {
1441
+ this.#g || (this.key?.onStreamLoaded(), this.#g = !0);
1442
+ }
1439
1443
  add(A) {
1440
- this.#I.add(A);
1444
+ this.#B.add(A);
1441
1445
  }
1442
1446
  end() {
1443
1447
  Px(this.scene.handle, this.id);
1444
- for (const A of this.#I)
1448
+ for (const A of this.#B)
1445
1449
  A.dispose();
1446
- this.#I.clear(), LC._idMap.delete(this.id), LC._keyMap.delete(this.key), this.scene.streams.has(this) && this.scene.delete(this);
1450
+ this.#B.clear(), LC._idMap.delete(this.id), LC._keyMap.delete(this.key), this.scene.streams.has(this) && this.scene.delete(this);
1447
1451
  }
1448
1452
  };
1449
1453
  const sh = 2048, wh = 4, ho = sh * wh;
@@ -1583,34 +1587,35 @@ let yh = class {
1583
1587
  A.handle,
1584
1588
  B
1585
1589
  ) === VB.GaussianSplats) {
1586
- const Q = this.#E(
1590
+ A.getStreamForDescendentId(B)?.onStreamLoaded();
1591
+ const E = this.#E(
1587
1592
  A.handle,
1588
1593
  B,
1589
1594
  6,
1590
1595
  Fw
1591
- ), E = Eh(A.handle, B), G = new wE();
1596
+ ), G = Eh(A.handle, B), D = new wE();
1592
1597
  try {
1593
- const { ptr: D } = G.$$;
1594
- yE(A.handle, B, "sparkPackedSplats", D);
1595
- const R = UE(G), M = Math.ceil(R.length / ho) * ho, i = new Uint32Array(M);
1596
- i.set(R);
1597
- const o = GQ.forId(B);
1598
- if (!o) {
1598
+ const { ptr: R } = D.$$;
1599
+ yE(A.handle, B, "sparkPackedSplats", R);
1600
+ const M = UE(D), i = Math.ceil(M.length / ho) * ho, o = new Uint32Array(i);
1601
+ o.set(M);
1602
+ const w = GQ.forId(B);
1603
+ if (!w) {
1599
1604
  console.warn(
1600
1605
  `Received modified event for LOD ${B} which does not exist.`
1601
1606
  );
1602
1607
  continue;
1603
1608
  }
1604
- o.splats = i, o.bounds = Q, o.lodIndex = E, Uh(
1609
+ w.splats = o, w.bounds = E, w.lodIndex = G, Uh(
1605
1610
  A.handle,
1606
1611
  B,
1607
- M,
1608
- o
1612
+ i,
1613
+ w
1609
1614
  );
1610
- const U = new dQ({ type: "created", lod: o });
1611
- this.#g.push(U), this.#B.delete(B) && this.#g.push(new dQ({ type: "activated", lod: o }));
1615
+ const y = new dQ({ type: "created", lod: w });
1616
+ this.#g.push(y), this.#B.delete(B) && this.#g.push(new dQ({ type: "activated", lod: w }));
1612
1617
  } finally {
1613
- G.delete();
1618
+ D.delete();
1614
1619
  }
1615
1620
  }
1616
1621
  for (const B of dx(this.#I))
@@ -1763,8 +1768,8 @@ let yh = class {
1763
1768
  uuid: M,
1764
1769
  tags: []
1765
1770
  }, o = D.size();
1766
- for (let U = 0; U < o; U += 1) {
1767
- const y = D.get(U);
1771
+ for (let w = 0; w < o; w += 1) {
1772
+ const y = D.get(w);
1768
1773
  i.tags.push(y);
1769
1774
  }
1770
1775
  Q.push(i);
@@ -2522,24 +2527,24 @@ class LI {
2522
2527
  * @see {@link Quaternion#slerp}
2523
2528
  */
2524
2529
  static slerpFlat(A, I, B, C, Q, E, G) {
2525
- let D = B[C + 0], R = B[C + 1], M = B[C + 2], i = B[C + 3], o = Q[E + 0], U = Q[E + 1], y = Q[E + 2], F = Q[E + 3];
2530
+ let D = B[C + 0], R = B[C + 1], M = B[C + 2], i = B[C + 3], o = Q[E + 0], w = Q[E + 1], y = Q[E + 2], F = Q[E + 3];
2526
2531
  if (G <= 0) {
2527
2532
  A[I + 0] = D, A[I + 1] = R, A[I + 2] = M, A[I + 3] = i;
2528
2533
  return;
2529
2534
  }
2530
2535
  if (G >= 1) {
2531
- A[I + 0] = o, A[I + 1] = U, A[I + 2] = y, A[I + 3] = F;
2536
+ A[I + 0] = o, A[I + 1] = w, A[I + 2] = y, A[I + 3] = F;
2532
2537
  return;
2533
2538
  }
2534
- if (i !== F || D !== o || R !== U || M !== y) {
2535
- let w = D * o + R * U + M * y + i * F;
2536
- w < 0 && (o = -o, U = -U, y = -y, F = -F, w = -w);
2539
+ if (i !== F || D !== o || R !== w || M !== y) {
2540
+ let U = D * o + R * w + M * y + i * F;
2541
+ U < 0 && (o = -o, w = -w, y = -y, F = -F, U = -U);
2537
2542
  let s = 1 - G;
2538
- if (w < 0.9995) {
2539
- const x = Math.acos(w), c = Math.sin(x);
2540
- s = Math.sin(s * x) / c, G = Math.sin(G * x) / c, D = D * s + o * G, R = R * s + U * G, M = M * s + y * G, i = i * s + F * G;
2543
+ if (U < 0.9995) {
2544
+ const x = Math.acos(U), c = Math.sin(x);
2545
+ s = Math.sin(s * x) / c, G = Math.sin(G * x) / c, D = D * s + o * G, R = R * s + w * G, M = M * s + y * G, i = i * s + F * G;
2541
2546
  } else {
2542
- D = D * s + o * G, R = R * s + U * G, M = M * s + y * G, i = i * s + F * G;
2547
+ D = D * s + o * G, R = R * s + w * G, M = M * s + y * G, i = i * s + F * G;
2543
2548
  const x = 1 / Math.sqrt(D * D + R * R + M * M + i * i);
2544
2549
  D *= x, R *= x, M *= x, i *= x;
2545
2550
  }
@@ -2560,8 +2565,8 @@ class LI {
2560
2565
  * @see {@link Quaternion#multiplyQuaternions}.
2561
2566
  */
2562
2567
  static multiplyQuaternionsFlat(A, I, B, C, Q, E) {
2563
- const G = B[C], D = B[C + 1], R = B[C + 2], M = B[C + 3], i = Q[E], o = Q[E + 1], U = Q[E + 2], y = Q[E + 3];
2564
- return A[I] = G * y + M * i + D * U - R * o, A[I + 1] = D * y + M * o + R * i - G * U, A[I + 2] = R * y + M * U + G * o - D * i, A[I + 3] = M * y - G * i - D * o - R * U, A;
2568
+ const G = B[C], D = B[C + 1], R = B[C + 2], M = B[C + 3], i = Q[E], o = Q[E + 1], w = Q[E + 2], y = Q[E + 3];
2569
+ return A[I] = G * y + M * i + D * w - R * o, A[I + 1] = D * y + M * o + R * i - G * w, A[I + 2] = R * y + M * w + G * o - D * i, A[I + 3] = M * y - G * i - D * o - R * w, A;
2565
2570
  }
2566
2571
  /**
2567
2572
  * The x value of this quaternion.
@@ -2649,25 +2654,25 @@ class LI {
2649
2654
  * @return {Quaternion} A reference to this quaternion.
2650
2655
  */
2651
2656
  setFromEuler(A, I = !0) {
2652
- const B = A._x, C = A._y, Q = A._z, E = A._order, G = Math.cos, D = Math.sin, R = G(B / 2), M = G(C / 2), i = G(Q / 2), o = D(B / 2), U = D(C / 2), y = D(Q / 2);
2657
+ const B = A._x, C = A._y, Q = A._z, E = A._order, G = Math.cos, D = Math.sin, R = G(B / 2), M = G(C / 2), i = G(Q / 2), o = D(B / 2), w = D(C / 2), y = D(Q / 2);
2653
2658
  switch (E) {
2654
2659
  case "XYZ":
2655
- this._x = o * M * i + R * U * y, this._y = R * U * i - o * M * y, this._z = R * M * y + o * U * i, this._w = R * M * i - o * U * y;
2660
+ this._x = o * M * i + R * w * y, this._y = R * w * i - o * M * y, this._z = R * M * y + o * w * i, this._w = R * M * i - o * w * y;
2656
2661
  break;
2657
2662
  case "YXZ":
2658
- this._x = o * M * i + R * U * y, this._y = R * U * i - o * M * y, this._z = R * M * y - o * U * i, this._w = R * M * i + o * U * y;
2663
+ this._x = o * M * i + R * w * y, this._y = R * w * i - o * M * y, this._z = R * M * y - o * w * i, this._w = R * M * i + o * w * y;
2659
2664
  break;
2660
2665
  case "ZXY":
2661
- this._x = o * M * i - R * U * y, this._y = R * U * i + o * M * y, this._z = R * M * y + o * U * i, this._w = R * M * i - o * U * y;
2666
+ this._x = o * M * i - R * w * y, this._y = R * w * i + o * M * y, this._z = R * M * y + o * w * i, this._w = R * M * i - o * w * y;
2662
2667
  break;
2663
2668
  case "ZYX":
2664
- this._x = o * M * i - R * U * y, this._y = R * U * i + o * M * y, this._z = R * M * y - o * U * i, this._w = R * M * i + o * U * y;
2669
+ this._x = o * M * i - R * w * y, this._y = R * w * i + o * M * y, this._z = R * M * y - o * w * i, this._w = R * M * i + o * w * y;
2665
2670
  break;
2666
2671
  case "YZX":
2667
- this._x = o * M * i + R * U * y, this._y = R * U * i + o * M * y, this._z = R * M * y - o * U * i, this._w = R * M * i - o * U * y;
2672
+ this._x = o * M * i + R * w * y, this._y = R * w * i + o * M * y, this._z = R * M * y - o * w * i, this._w = R * M * i - o * w * y;
2668
2673
  break;
2669
2674
  case "XZY":
2670
- this._x = o * M * i - R * U * y, this._y = R * U * i - o * M * y, this._z = R * M * y + o * U * i, this._w = R * M * i + o * U * y;
2675
+ this._x = o * M * i - R * w * y, this._y = R * w * i - o * M * y, this._z = R * M * y + o * w * i, this._w = R * M * i + o * w * y;
2671
2676
  break;
2672
2677
  default:
2673
2678
  ZA("Quaternion: .setFromEuler() encountered an unknown order: " + E);
@@ -2694,17 +2699,17 @@ class LI {
2694
2699
  setFromRotationMatrix(A) {
2695
2700
  const I = A.elements, B = I[0], C = I[4], Q = I[8], E = I[1], G = I[5], D = I[9], R = I[2], M = I[6], i = I[10], o = B + G + i;
2696
2701
  if (o > 0) {
2697
- const U = 0.5 / Math.sqrt(o + 1);
2698
- this._w = 0.25 / U, this._x = (M - D) * U, this._y = (Q - R) * U, this._z = (E - C) * U;
2702
+ const w = 0.5 / Math.sqrt(o + 1);
2703
+ this._w = 0.25 / w, this._x = (M - D) * w, this._y = (Q - R) * w, this._z = (E - C) * w;
2699
2704
  } else if (B > G && B > i) {
2700
- const U = 2 * Math.sqrt(1 + B - G - i);
2701
- this._w = (M - D) / U, this._x = 0.25 * U, this._y = (C + E) / U, this._z = (Q + R) / U;
2705
+ const w = 2 * Math.sqrt(1 + B - G - i);
2706
+ this._w = (M - D) / w, this._x = 0.25 * w, this._y = (C + E) / w, this._z = (Q + R) / w;
2702
2707
  } else if (G > i) {
2703
- const U = 2 * Math.sqrt(1 + G - B - i);
2704
- this._w = (Q - R) / U, this._x = (C + E) / U, this._y = 0.25 * U, this._z = (D + M) / U;
2708
+ const w = 2 * Math.sqrt(1 + G - B - i);
2709
+ this._w = (Q - R) / w, this._x = (C + E) / w, this._y = 0.25 * w, this._z = (D + M) / w;
2705
2710
  } else {
2706
- const U = 2 * Math.sqrt(1 + i - B - G);
2707
- this._w = (E - C) / U, this._x = (Q + R) / U, this._y = (D + M) / U, this._z = 0.25 * U;
2711
+ const w = 2 * Math.sqrt(1 + i - B - G);
2712
+ this._w = (E - C) / w, this._x = (Q + R) / w, this._y = (D + M) / w, this._z = 0.25 * w;
2708
2713
  }
2709
2714
  return this._onChangeCallback(), this;
2710
2715
  }
@@ -3836,8 +3841,8 @@ class fA {
3836
3841
  * @return {Matrix3} A reference to this matrix.
3837
3842
  */
3838
3843
  multiplyMatrices(A, I) {
3839
- const B = A.elements, C = I.elements, Q = this.elements, E = B[0], G = B[3], D = B[6], R = B[1], M = B[4], i = B[7], o = B[2], U = B[5], y = B[8], F = C[0], w = C[3], s = C[6], x = C[1], c = C[4], N = C[7], S = C[2], a = C[5], j = C[8];
3840
- return Q[0] = E * F + G * x + D * S, Q[3] = E * w + G * c + D * a, Q[6] = E * s + G * N + D * j, Q[1] = R * F + M * x + i * S, Q[4] = R * w + M * c + i * a, Q[7] = R * s + M * N + i * j, Q[2] = o * F + U * x + y * S, Q[5] = o * w + U * c + y * a, Q[8] = o * s + U * N + y * j, this;
3844
+ const B = A.elements, C = I.elements, Q = this.elements, E = B[0], G = B[3], D = B[6], R = B[1], M = B[4], i = B[7], o = B[2], w = B[5], y = B[8], F = C[0], U = C[3], s = C[6], x = C[1], c = C[4], N = C[7], S = C[2], a = C[5], j = C[8];
3845
+ return Q[0] = E * F + G * x + D * S, Q[3] = E * U + G * c + D * a, Q[6] = E * s + G * N + D * j, Q[1] = R * F + M * x + i * S, Q[4] = R * U + M * c + i * a, Q[7] = R * s + M * N + i * j, Q[2] = o * F + w * x + y * S, Q[5] = o * U + w * c + y * a, Q[8] = o * s + w * N + y * j, this;
3841
3846
  }
3842
3847
  /**
3843
3848
  * Multiplies every component of the matrix by the given scalar.
@@ -3866,10 +3871,10 @@ class fA {
3866
3871
  * @return {Matrix3} A reference to this matrix.
3867
3872
  */
3868
3873
  invert() {
3869
- const A = this.elements, I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], G = A[5], D = A[6], R = A[7], M = A[8], i = M * E - G * R, o = G * D - M * Q, U = R * Q - E * D, y = I * i + B * o + C * U;
3874
+ const A = this.elements, I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], G = A[5], D = A[6], R = A[7], M = A[8], i = M * E - G * R, o = G * D - M * Q, w = R * Q - E * D, y = I * i + B * o + C * w;
3870
3875
  if (y === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
3871
3876
  const F = 1 / y;
3872
- return A[0] = i * F, A[1] = (C * R - M * B) * F, A[2] = (G * B - C * E) * F, A[3] = o * F, A[4] = (M * I - C * D) * F, A[5] = (C * Q - G * I) * F, A[6] = U * F, A[7] = (B * D - R * I) * F, A[8] = (E * I - B * Q) * F, this;
3877
+ return A[0] = i * F, A[1] = (C * R - M * B) * F, A[2] = (G * B - C * E) * F, A[3] = o * F, A[4] = (M * I - C * D) * F, A[5] = (C * Q - G * I) * F, A[6] = w * F, A[7] = (B * D - R * I) * F, A[8] = (E * I - B * Q) * F, this;
3873
3878
  }
3874
3879
  /**
3875
3880
  * Transposes this matrix in place.
@@ -4813,16 +4818,16 @@ class BI {
4813
4818
  */
4814
4819
  setAxisAngleFromRotationMatrix(A) {
4815
4820
  let I, B, C, Q;
4816
- const D = A.elements, R = D[0], M = D[4], i = D[8], o = D[1], U = D[5], y = D[9], F = D[2], w = D[6], s = D[10];
4817
- if (Math.abs(M - o) < 0.01 && Math.abs(i - F) < 0.01 && Math.abs(y - w) < 0.01) {
4818
- if (Math.abs(M + o) < 0.1 && Math.abs(i + F) < 0.1 && Math.abs(y + w) < 0.1 && Math.abs(R + U + s - 3) < 0.1)
4821
+ const D = A.elements, R = D[0], M = D[4], i = D[8], o = D[1], w = D[5], y = D[9], F = D[2], U = D[6], s = D[10];
4822
+ if (Math.abs(M - o) < 0.01 && Math.abs(i - F) < 0.01 && Math.abs(y - U) < 0.01) {
4823
+ if (Math.abs(M + o) < 0.1 && Math.abs(i + F) < 0.1 && Math.abs(y + U) < 0.1 && Math.abs(R + w + s - 3) < 0.1)
4819
4824
  return this.set(1, 0, 0, 0), this;
4820
4825
  I = Math.PI;
4821
- const c = (R + 1) / 2, N = (U + 1) / 2, S = (s + 1) / 2, a = (M + o) / 4, j = (i + F) / 4, n = (y + w) / 4;
4826
+ const c = (R + 1) / 2, N = (w + 1) / 2, S = (s + 1) / 2, a = (M + o) / 4, j = (i + F) / 4, n = (y + U) / 4;
4822
4827
  return c > N && c > S ? c < 0.01 ? (B = 0, C = 0.707106781, Q = 0.707106781) : (B = Math.sqrt(c), C = a / B, Q = j / B) : N > S ? N < 0.01 ? (B = 0.707106781, C = 0, Q = 0.707106781) : (C = Math.sqrt(N), B = a / C, Q = n / C) : S < 0.01 ? (B = 0.707106781, C = 0.707106781, Q = 0) : (Q = Math.sqrt(S), B = j / Q, C = n / Q), this.set(B, C, Q, I), this;
4823
4828
  }
4824
- let x = Math.sqrt((w - y) * (w - y) + (i - F) * (i - F) + (o - M) * (o - M));
4825
- return Math.abs(x) < 1e-3 && (x = 1), this.x = (w - y) / x, this.y = (i - F) / x, this.z = (o - M) / x, this.w = Math.acos((R + U + s - 1) / 2), this;
4829
+ let x = Math.sqrt((U - y) * (U - y) + (i - F) * (i - F) + (o - M) * (o - M));
4830
+ return Math.abs(x) < 1e-3 && (x = 1), this.x = (U - y) / x, this.y = (i - F) / x, this.z = (o - M) / x, this.w = Math.acos((R + w + s - 1) / 2), this;
4826
4831
  }
4827
4832
  /**
4828
4833
  * Sets the vector components to the position elements of the
@@ -6019,22 +6024,22 @@ class mE {
6019
6024
  distanceSqToSegment(A, I, B, C) {
6020
6025
  uR.copy(A).add(I).multiplyScalar(0.5), qQ.copy(I).sub(A).normalize(), cB.copy(this.origin).sub(uR);
6021
6026
  const Q = A.distanceTo(I) * 0.5, E = -this.direction.dot(qQ), G = cB.dot(this.direction), D = -cB.dot(qQ), R = cB.lengthSq(), M = Math.abs(1 - E * E);
6022
- let i, o, U, y;
6027
+ let i, o, w, y;
6023
6028
  if (M > 0)
6024
6029
  if (i = E * D - G, o = E * G - D, y = Q * M, i >= 0)
6025
6030
  if (o >= -y)
6026
6031
  if (o <= y) {
6027
6032
  const F = 1 / M;
6028
- i *= F, o *= F, U = i * (i + E * o + 2 * G) + o * (E * i + o + 2 * D) + R;
6033
+ i *= F, o *= F, w = i * (i + E * o + 2 * G) + o * (E * i + o + 2 * D) + R;
6029
6034
  } else
6030
- o = Q, i = Math.max(0, -(E * o + G)), U = -i * i + o * (o + 2 * D) + R;
6035
+ o = Q, i = Math.max(0, -(E * o + G)), w = -i * i + o * (o + 2 * D) + R;
6031
6036
  else
6032
- o = -Q, i = Math.max(0, -(E * o + G)), U = -i * i + o * (o + 2 * D) + R;
6037
+ o = -Q, i = Math.max(0, -(E * o + G)), w = -i * i + o * (o + 2 * D) + R;
6033
6038
  else
6034
- o <= -y ? (i = Math.max(0, -(-E * Q + G)), o = i > 0 ? -Q : Math.min(Math.max(-Q, -D), Q), U = -i * i + o * (o + 2 * D) + R) : o <= y ? (i = 0, o = Math.min(Math.max(-Q, -D), Q), U = o * (o + 2 * D) + R) : (i = Math.max(0, -(E * Q + G)), o = i > 0 ? Q : Math.min(Math.max(-Q, -D), Q), U = -i * i + o * (o + 2 * D) + R);
6039
+ o <= -y ? (i = Math.max(0, -(-E * Q + G)), o = i > 0 ? -Q : Math.min(Math.max(-Q, -D), Q), w = -i * i + o * (o + 2 * D) + R) : o <= y ? (i = 0, o = Math.min(Math.max(-Q, -D), Q), w = o * (o + 2 * D) + R) : (i = Math.max(0, -(E * Q + G)), o = i > 0 ? Q : Math.min(Math.max(-Q, -D), Q), w = -i * i + o * (o + 2 * D) + R);
6035
6040
  else
6036
- o = E > 0 ? -Q : Q, i = Math.max(0, -(E * o + G)), U = -i * i + o * (o + 2 * D) + R;
6037
- return B && B.copy(this.origin).addScaledVector(this.direction, i), C && C.copy(uR).addScaledVector(qQ, o), U;
6041
+ o = E > 0 ? -Q : Q, i = Math.max(0, -(E * o + G)), w = -i * i + o * (o + 2 * D) + R;
6042
+ return B && B.copy(this.origin).addScaledVector(this.direction, i), C && C.copy(uR).addScaledVector(qQ, o), w;
6038
6043
  }
6039
6044
  /**
6040
6045
  * Intersects this ray with the given sphere, returning the intersection
@@ -6199,7 +6204,7 @@ class XA {
6199
6204
  * @param {number} [n43] - 4-3 matrix element.
6200
6205
  * @param {number} [n44] - 4-4 matrix element.
6201
6206
  */
6202
- constructor(A, I, B, C, Q, E, G, D, R, M, i, o, U, y, F, w) {
6207
+ constructor(A, I, B, C, Q, E, G, D, R, M, i, o, w, y, F, U) {
6203
6208
  XA.prototype.isMatrix4 = !0, this.elements = [
6204
6209
  1,
6205
6210
  0,
@@ -6217,7 +6222,7 @@ class XA {
6217
6222
  0,
6218
6223
  0,
6219
6224
  1
6220
- ], A !== void 0 && this.set(A, I, B, C, Q, E, G, D, R, M, i, o, U, y, F, w);
6225
+ ], A !== void 0 && this.set(A, I, B, C, Q, E, G, D, R, M, i, o, w, y, F, U);
6221
6226
  }
6222
6227
  /**
6223
6228
  * Sets the elements of the matrix.The arguments are supposed to be
@@ -6241,9 +6246,9 @@ class XA {
6241
6246
  * @param {number} [n44] - 4-4 matrix element.
6242
6247
  * @return {Matrix4} A reference to this matrix.
6243
6248
  */
6244
- set(A, I, B, C, Q, E, G, D, R, M, i, o, U, y, F, w) {
6249
+ set(A, I, B, C, Q, E, G, D, R, M, i, o, w, y, F, U) {
6245
6250
  const s = this.elements;
6246
- return s[0] = A, s[4] = I, s[8] = B, s[12] = C, s[1] = Q, s[5] = E, s[9] = G, s[13] = D, s[2] = R, s[6] = M, s[10] = i, s[14] = o, s[3] = U, s[7] = y, s[11] = F, s[15] = w, this;
6251
+ return s[0] = A, s[4] = I, s[8] = B, s[12] = C, s[1] = Q, s[5] = E, s[9] = G, s[13] = D, s[2] = R, s[6] = M, s[10] = i, s[14] = o, s[3] = w, s[7] = y, s[11] = F, s[15] = U, this;
6247
6252
  }
6248
6253
  /**
6249
6254
  * Sets this matrix to the 4x4 identity matrix.
@@ -6393,23 +6398,23 @@ class XA {
6393
6398
  makeRotationFromEuler(A) {
6394
6399
  const I = this.elements, B = A.x, C = A.y, Q = A.z, E = Math.cos(B), G = Math.sin(B), D = Math.cos(C), R = Math.sin(C), M = Math.cos(Q), i = Math.sin(Q);
6395
6400
  if (A.order === "XYZ") {
6396
- const o = E * M, U = E * i, y = G * M, F = G * i;
6397
- I[0] = D * M, I[4] = -D * i, I[8] = R, I[1] = U + y * R, I[5] = o - F * R, I[9] = -G * D, I[2] = F - o * R, I[6] = y + U * R, I[10] = E * D;
6401
+ const o = E * M, w = E * i, y = G * M, F = G * i;
6402
+ I[0] = D * M, I[4] = -D * i, I[8] = R, I[1] = w + y * R, I[5] = o - F * R, I[9] = -G * D, I[2] = F - o * R, I[6] = y + w * R, I[10] = E * D;
6398
6403
  } else if (A.order === "YXZ") {
6399
- const o = D * M, U = D * i, y = R * M, F = R * i;
6400
- I[0] = o + F * G, I[4] = y * G - U, I[8] = E * R, I[1] = E * i, I[5] = E * M, I[9] = -G, I[2] = U * G - y, I[6] = F + o * G, I[10] = E * D;
6404
+ const o = D * M, w = D * i, y = R * M, F = R * i;
6405
+ I[0] = o + F * G, I[4] = y * G - w, I[8] = E * R, I[1] = E * i, I[5] = E * M, I[9] = -G, I[2] = w * G - y, I[6] = F + o * G, I[10] = E * D;
6401
6406
  } else if (A.order === "ZXY") {
6402
- const o = D * M, U = D * i, y = R * M, F = R * i;
6403
- I[0] = o - F * G, I[4] = -E * i, I[8] = y + U * G, I[1] = U + y * G, I[5] = E * M, I[9] = F - o * G, I[2] = -E * R, I[6] = G, I[10] = E * D;
6407
+ const o = D * M, w = D * i, y = R * M, F = R * i;
6408
+ I[0] = o - F * G, I[4] = -E * i, I[8] = y + w * G, I[1] = w + y * G, I[5] = E * M, I[9] = F - o * G, I[2] = -E * R, I[6] = G, I[10] = E * D;
6404
6409
  } else if (A.order === "ZYX") {
6405
- const o = E * M, U = E * i, y = G * M, F = G * i;
6406
- I[0] = D * M, I[4] = y * R - U, I[8] = o * R + F, I[1] = D * i, I[5] = F * R + o, I[9] = U * R - y, I[2] = -R, I[6] = G * D, I[10] = E * D;
6410
+ const o = E * M, w = E * i, y = G * M, F = G * i;
6411
+ I[0] = D * M, I[4] = y * R - w, I[8] = o * R + F, I[1] = D * i, I[5] = F * R + o, I[9] = w * R - y, I[2] = -R, I[6] = G * D, I[10] = E * D;
6407
6412
  } else if (A.order === "YZX") {
6408
- const o = E * D, U = E * R, y = G * D, F = G * R;
6409
- I[0] = D * M, I[4] = F - o * i, I[8] = y * i + U, I[1] = i, I[5] = E * M, I[9] = -G * M, I[2] = -R * M, I[6] = U * i + y, I[10] = o - F * i;
6413
+ const o = E * D, w = E * R, y = G * D, F = G * R;
6414
+ I[0] = D * M, I[4] = F - o * i, I[8] = y * i + w, I[1] = i, I[5] = E * M, I[9] = -G * M, I[2] = -R * M, I[6] = w * i + y, I[10] = o - F * i;
6410
6415
  } else if (A.order === "XZY") {
6411
- const o = E * D, U = E * R, y = G * D, F = G * R;
6412
- I[0] = D * M, I[4] = -i, I[8] = R * M, I[1] = o * i + F, I[5] = E * M, I[9] = U * i - y, I[2] = y * i - U, I[6] = G * M, I[10] = F * i + o;
6416
+ const o = E * D, w = E * R, y = G * D, F = G * R;
6417
+ I[0] = D * M, I[4] = -i, I[8] = R * M, I[1] = o * i + F, I[5] = E * M, I[9] = w * i - y, I[2] = y * i - w, I[6] = G * M, I[10] = F * i + o;
6413
6418
  }
6414
6419
  return I[3] = 0, I[7] = 0, I[11] = 0, I[12] = 0, I[13] = 0, I[14] = 0, I[15] = 1, this;
6415
6420
  }
@@ -6464,8 +6469,8 @@ class XA {
6464
6469
  * @return {Matrix4} A reference to this matrix.
6465
6470
  */
6466
6471
  multiplyMatrices(A, I) {
6467
- const B = A.elements, C = I.elements, Q = this.elements, E = B[0], G = B[4], D = B[8], R = B[12], M = B[1], i = B[5], o = B[9], U = B[13], y = B[2], F = B[6], w = B[10], s = B[14], x = B[3], c = B[7], N = B[11], S = B[15], a = C[0], j = C[4], n = C[8], h = C[12], Y = C[1], k = C[5], l = C[9], p = C[13], m = C[2], v = C[6], u = C[10], f = C[14], z = C[3], IA = C[7], gA = C[11], CA = C[15];
6468
- return Q[0] = E * a + G * Y + D * m + R * z, Q[4] = E * j + G * k + D * v + R * IA, Q[8] = E * n + G * l + D * u + R * gA, Q[12] = E * h + G * p + D * f + R * CA, Q[1] = M * a + i * Y + o * m + U * z, Q[5] = M * j + i * k + o * v + U * IA, Q[9] = M * n + i * l + o * u + U * gA, Q[13] = M * h + i * p + o * f + U * CA, Q[2] = y * a + F * Y + w * m + s * z, Q[6] = y * j + F * k + w * v + s * IA, Q[10] = y * n + F * l + w * u + s * gA, Q[14] = y * h + F * p + w * f + s * CA, Q[3] = x * a + c * Y + N * m + S * z, Q[7] = x * j + c * k + N * v + S * IA, Q[11] = x * n + c * l + N * u + S * gA, Q[15] = x * h + c * p + N * f + S * CA, this;
6472
+ const B = A.elements, C = I.elements, Q = this.elements, E = B[0], G = B[4], D = B[8], R = B[12], M = B[1], i = B[5], o = B[9], w = B[13], y = B[2], F = B[6], U = B[10], s = B[14], x = B[3], c = B[7], N = B[11], S = B[15], a = C[0], j = C[4], n = C[8], h = C[12], Y = C[1], k = C[5], l = C[9], p = C[13], m = C[2], v = C[6], u = C[10], f = C[14], z = C[3], IA = C[7], gA = C[11], CA = C[15];
6473
+ return Q[0] = E * a + G * Y + D * m + R * z, Q[4] = E * j + G * k + D * v + R * IA, Q[8] = E * n + G * l + D * u + R * gA, Q[12] = E * h + G * p + D * f + R * CA, Q[1] = M * a + i * Y + o * m + w * z, Q[5] = M * j + i * k + o * v + w * IA, Q[9] = M * n + i * l + o * u + w * gA, Q[13] = M * h + i * p + o * f + w * CA, Q[2] = y * a + F * Y + U * m + s * z, Q[6] = y * j + F * k + U * v + s * IA, Q[10] = y * n + F * l + U * u + s * gA, Q[14] = y * h + F * p + U * f + s * CA, Q[3] = x * a + c * Y + N * m + S * z, Q[7] = x * j + c * k + N * v + S * IA, Q[11] = x * n + c * l + N * u + S * gA, Q[15] = x * h + c * p + N * f + S * CA, this;
6469
6474
  }
6470
6475
  /**
6471
6476
  * Multiplies every component of the matrix by the given scalar.
@@ -6485,8 +6490,8 @@ class XA {
6485
6490
  * @return {number} The determinant.
6486
6491
  */
6487
6492
  determinant() {
6488
- const A = this.elements, I = A[0], B = A[4], C = A[8], Q = A[12], E = A[1], G = A[5], D = A[9], R = A[13], M = A[2], i = A[6], o = A[10], U = A[14], y = A[3], F = A[7], w = A[11], s = A[15], x = D * U - R * o, c = G * U - R * i, N = G * o - D * i, S = E * U - R * M, a = E * o - D * M, j = E * i - G * M;
6489
- return I * (F * x - w * c + s * N) - B * (y * x - w * S + s * a) + C * (y * c - F * S + s * j) - Q * (y * N - F * a + w * j);
6493
+ const A = this.elements, I = A[0], B = A[4], C = A[8], Q = A[12], E = A[1], G = A[5], D = A[9], R = A[13], M = A[2], i = A[6], o = A[10], w = A[14], y = A[3], F = A[7], U = A[11], s = A[15], x = D * w - R * o, c = G * w - R * i, N = G * o - D * i, S = E * w - R * M, a = E * o - D * M, j = E * i - G * M;
6494
+ return I * (F * x - U * c + s * N) - B * (y * x - U * S + s * a) + C * (y * c - F * S + s * j) - Q * (y * N - F * a + U * j);
6490
6495
  }
6491
6496
  /**
6492
6497
  * Transposes this matrix in place.
@@ -6519,10 +6524,10 @@ class XA {
6519
6524
  * @return {Matrix4} A reference to this matrix.
6520
6525
  */
6521
6526
  invert() {
6522
- const A = this.elements, I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], G = A[5], D = A[6], R = A[7], M = A[8], i = A[9], o = A[10], U = A[11], y = A[12], F = A[13], w = A[14], s = A[15], x = i * w * R - F * o * R + F * D * U - G * w * U - i * D * s + G * o * s, c = y * o * R - M * w * R - y * D * U + E * w * U + M * D * s - E * o * s, N = M * F * R - y * i * R + y * G * U - E * F * U - M * G * s + E * i * s, S = y * i * D - M * F * D - y * G * o + E * F * o + M * G * w - E * i * w, a = I * x + B * c + C * N + Q * S;
6527
+ const A = this.elements, I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], G = A[5], D = A[6], R = A[7], M = A[8], i = A[9], o = A[10], w = A[11], y = A[12], F = A[13], U = A[14], s = A[15], x = i * U * R - F * o * R + F * D * w - G * U * w - i * D * s + G * o * s, c = y * o * R - M * U * R - y * D * w + E * U * w + M * D * s - E * o * s, N = M * F * R - y * i * R + y * G * w - E * F * w - M * G * s + E * i * s, S = y * i * D - M * F * D - y * G * o + E * F * o + M * G * U - E * i * U, a = I * x + B * c + C * N + Q * S;
6523
6528
  if (a === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
6524
6529
  const j = 1 / a;
6525
- return A[0] = x * j, A[1] = (F * o * Q - i * w * Q - F * C * U + B * w * U + i * C * s - B * o * s) * j, A[2] = (G * w * Q - F * D * Q + F * C * R - B * w * R - G * C * s + B * D * s) * j, A[3] = (i * D * Q - G * o * Q - i * C * R + B * o * R + G * C * U - B * D * U) * j, A[4] = c * j, A[5] = (M * w * Q - y * o * Q + y * C * U - I * w * U - M * C * s + I * o * s) * j, A[6] = (y * D * Q - E * w * Q - y * C * R + I * w * R + E * C * s - I * D * s) * j, A[7] = (E * o * Q - M * D * Q + M * C * R - I * o * R - E * C * U + I * D * U) * j, A[8] = N * j, A[9] = (y * i * Q - M * F * Q - y * B * U + I * F * U + M * B * s - I * i * s) * j, A[10] = (E * F * Q - y * G * Q + y * B * R - I * F * R - E * B * s + I * G * s) * j, A[11] = (M * G * Q - E * i * Q - M * B * R + I * i * R + E * B * U - I * G * U) * j, A[12] = S * j, A[13] = (M * F * C - y * i * C + y * B * o - I * F * o - M * B * w + I * i * w) * j, A[14] = (y * G * C - E * F * C - y * B * D + I * F * D + E * B * w - I * G * w) * j, A[15] = (E * i * C - M * G * C + M * B * D - I * i * D - E * B * o + I * G * o) * j, this;
6530
+ return A[0] = x * j, A[1] = (F * o * Q - i * U * Q - F * C * w + B * U * w + i * C * s - B * o * s) * j, A[2] = (G * U * Q - F * D * Q + F * C * R - B * U * R - G * C * s + B * D * s) * j, A[3] = (i * D * Q - G * o * Q - i * C * R + B * o * R + G * C * w - B * D * w) * j, A[4] = c * j, A[5] = (M * U * Q - y * o * Q + y * C * w - I * U * w - M * C * s + I * o * s) * j, A[6] = (y * D * Q - E * U * Q - y * C * R + I * U * R + E * C * s - I * D * s) * j, A[7] = (E * o * Q - M * D * Q + M * C * R - I * o * R - E * C * w + I * D * w) * j, A[8] = N * j, A[9] = (y * i * Q - M * F * Q - y * B * w + I * F * w + M * B * s - I * i * s) * j, A[10] = (E * F * Q - y * G * Q + y * B * R - I * F * R - E * B * s + I * G * s) * j, A[11] = (M * G * Q - E * i * Q - M * B * R + I * i * R + E * B * w - I * G * w) * j, A[12] = S * j, A[13] = (M * F * C - y * i * C + y * B * o - I * F * o - M * B * U + I * i * U) * j, A[14] = (y * G * C - E * F * C - y * B * D + I * F * D + E * B * U - I * G * U) * j, A[15] = (E * i * C - M * G * C + M * B * D - I * i * D - E * B * o + I * G * o) * j, this;
6526
6531
  }
6527
6532
  /**
6528
6533
  * Multiplies the columns of this matrix by the given vector.
@@ -6773,8 +6778,8 @@ class XA {
6773
6778
  * @return {Matrix4} A reference to this matrix.
6774
6779
  */
6775
6780
  compose(A, I, B) {
6776
- const C = this.elements, Q = I._x, E = I._y, G = I._z, D = I._w, R = Q + Q, M = E + E, i = G + G, o = Q * R, U = Q * M, y = Q * i, F = E * M, w = E * i, s = G * i, x = D * R, c = D * M, N = D * i, S = B.x, a = B.y, j = B.z;
6777
- return C[0] = (1 - (F + s)) * S, C[1] = (U + N) * S, C[2] = (y - c) * S, C[3] = 0, C[4] = (U - N) * a, C[5] = (1 - (o + s)) * a, C[6] = (w + x) * a, C[7] = 0, C[8] = (y + c) * j, C[9] = (w - x) * j, C[10] = (1 - (o + F)) * j, C[11] = 0, C[12] = A.x, C[13] = A.y, C[14] = A.z, C[15] = 1, this;
6781
+ const C = this.elements, Q = I._x, E = I._y, G = I._z, D = I._w, R = Q + Q, M = E + E, i = G + G, o = Q * R, w = Q * M, y = Q * i, F = E * M, U = E * i, s = G * i, x = D * R, c = D * M, N = D * i, S = B.x, a = B.y, j = B.z;
6782
+ return C[0] = (1 - (F + s)) * S, C[1] = (w + N) * S, C[2] = (y - c) * S, C[3] = 0, C[4] = (w - N) * a, C[5] = (1 - (o + s)) * a, C[6] = (U + x) * a, C[7] = 0, C[8] = (y + c) * j, C[9] = (U - x) * j, C[10] = (1 - (o + F)) * j, C[11] = 0, C[12] = A.x, C[13] = A.y, C[14] = A.z, C[15] = 1, this;
6778
6783
  }
6779
6784
  /**
6780
6785
  * Decomposes this matrix into its position, rotation and scale components
@@ -6814,7 +6819,7 @@ class XA {
6814
6819
  * @return {Matrix4} A reference to this matrix.
6815
6820
  */
6816
6821
  makePerspective(A, I, B, C, Q, E, G = Og, D = !1) {
6817
- const R = this.elements, M = 2 * Q / (I - A), i = 2 * Q / (B - C), o = (I + A) / (I - A), U = (B + C) / (B - C);
6822
+ const R = this.elements, M = 2 * Q / (I - A), i = 2 * Q / (B - C), o = (I + A) / (I - A), w = (B + C) / (B - C);
6818
6823
  let y, F;
6819
6824
  if (D)
6820
6825
  y = Q / (E - Q), F = E * Q / (E - Q);
@@ -6824,7 +6829,7 @@ class XA {
6824
6829
  y = -E / (E - Q), F = -E * Q / (E - Q);
6825
6830
  else
6826
6831
  throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + G);
6827
- return R[0] = M, R[4] = 0, R[8] = o, R[12] = 0, R[1] = 0, R[5] = i, R[9] = U, R[13] = 0, R[2] = 0, R[6] = 0, R[10] = y, R[14] = F, R[3] = 0, R[7] = 0, R[11] = -1, R[15] = 0, this;
6832
+ return R[0] = M, R[4] = 0, R[8] = o, R[12] = 0, R[1] = 0, R[5] = i, R[9] = w, R[13] = 0, R[2] = 0, R[6] = 0, R[10] = y, R[14] = F, R[3] = 0, R[7] = 0, R[11] = -1, R[15] = 0, this;
6828
6833
  }
6829
6834
  /**
6830
6835
  * Creates a orthographic projection matrix. This is used internally by
@@ -6841,7 +6846,7 @@ class XA {
6841
6846
  * @return {Matrix4} A reference to this matrix.
6842
6847
  */
6843
6848
  makeOrthographic(A, I, B, C, Q, E, G = Og, D = !1) {
6844
- const R = this.elements, M = 2 / (I - A), i = 2 / (B - C), o = -(I + A) / (I - A), U = -(B + C) / (B - C);
6849
+ const R = this.elements, M = 2 / (I - A), i = 2 / (B - C), o = -(I + A) / (I - A), w = -(B + C) / (B - C);
6845
6850
  let y, F;
6846
6851
  if (D)
6847
6852
  y = 1 / (E - Q), F = E / (E - Q);
@@ -6851,7 +6856,7 @@ class XA {
6851
6856
  y = -1 / (E - Q), F = -Q / (E - Q);
6852
6857
  else
6853
6858
  throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + G);
6854
- return R[0] = M, R[4] = 0, R[8] = 0, R[12] = o, R[1] = 0, R[5] = i, R[9] = 0, R[13] = U, R[2] = 0, R[6] = 0, R[10] = y, R[14] = F, R[3] = 0, R[7] = 0, R[11] = 0, R[15] = 1, this;
6859
+ return R[0] = M, R[4] = 0, R[8] = 0, R[12] = o, R[1] = 0, R[5] = i, R[9] = 0, R[13] = w, R[2] = 0, R[6] = 0, R[10] = y, R[14] = F, R[3] = 0, R[7] = 0, R[11] = 0, R[15] = 1, this;
6855
6860
  }
6856
6861
  /**
6857
6862
  * Returns `true` if this matrix is equal with the given one.
@@ -6989,25 +6994,25 @@ class dg {
6989
6994
  * @return {Euler} A reference to this Euler instance.
6990
6995
  */
6991
6996
  setFromRotationMatrix(A, I = this._order, B = !0) {
6992
- const C = A.elements, Q = C[0], E = C[4], G = C[8], D = C[1], R = C[5], M = C[9], i = C[2], o = C[6], U = C[10];
6997
+ const C = A.elements, Q = C[0], E = C[4], G = C[8], D = C[1], R = C[5], M = C[9], i = C[2], o = C[6], w = C[10];
6993
6998
  switch (I) {
6994
6999
  case "XYZ":
6995
- this._y = Math.asin(WA(G, -1, 1)), Math.abs(G) < 0.9999999 ? (this._x = Math.atan2(-M, U), this._z = Math.atan2(-E, Q)) : (this._x = Math.atan2(o, R), this._z = 0);
7000
+ this._y = Math.asin(WA(G, -1, 1)), Math.abs(G) < 0.9999999 ? (this._x = Math.atan2(-M, w), this._z = Math.atan2(-E, Q)) : (this._x = Math.atan2(o, R), this._z = 0);
6996
7001
  break;
6997
7002
  case "YXZ":
6998
- this._x = Math.asin(-WA(M, -1, 1)), Math.abs(M) < 0.9999999 ? (this._y = Math.atan2(G, U), this._z = Math.atan2(D, R)) : (this._y = Math.atan2(-i, Q), this._z = 0);
7003
+ this._x = Math.asin(-WA(M, -1, 1)), Math.abs(M) < 0.9999999 ? (this._y = Math.atan2(G, w), this._z = Math.atan2(D, R)) : (this._y = Math.atan2(-i, Q), this._z = 0);
6999
7004
  break;
7000
7005
  case "ZXY":
7001
- this._x = Math.asin(WA(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._y = Math.atan2(-i, U), this._z = Math.atan2(-E, R)) : (this._y = 0, this._z = Math.atan2(D, Q));
7006
+ this._x = Math.asin(WA(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._y = Math.atan2(-i, w), this._z = Math.atan2(-E, R)) : (this._y = 0, this._z = Math.atan2(D, Q));
7002
7007
  break;
7003
7008
  case "ZYX":
7004
- this._y = Math.asin(-WA(i, -1, 1)), Math.abs(i) < 0.9999999 ? (this._x = Math.atan2(o, U), this._z = Math.atan2(D, Q)) : (this._x = 0, this._z = Math.atan2(-E, R));
7009
+ this._y = Math.asin(-WA(i, -1, 1)), Math.abs(i) < 0.9999999 ? (this._x = Math.atan2(o, w), this._z = Math.atan2(D, Q)) : (this._x = 0, this._z = Math.atan2(-E, R));
7005
7010
  break;
7006
7011
  case "YZX":
7007
- this._z = Math.asin(WA(D, -1, 1)), Math.abs(D) < 0.9999999 ? (this._x = Math.atan2(-M, R), this._y = Math.atan2(-i, Q)) : (this._x = 0, this._y = Math.atan2(G, U));
7012
+ this._z = Math.asin(WA(D, -1, 1)), Math.abs(D) < 0.9999999 ? (this._x = Math.atan2(-M, R), this._y = Math.atan2(-i, Q)) : (this._x = 0, this._y = Math.atan2(G, w));
7008
7013
  break;
7009
7014
  case "XZY":
7010
- this._z = Math.asin(-WA(E, -1, 1)), Math.abs(E) < 0.9999999 ? (this._x = Math.atan2(o, R), this._y = Math.atan2(G, Q)) : (this._x = Math.atan2(-M, U), this._y = 0);
7015
+ this._z = Math.asin(-WA(E, -1, 1)), Math.abs(E) < 0.9999999 ? (this._x = Math.atan2(o, R), this._y = Math.atan2(G, Q)) : (this._x = Math.atan2(-M, w), this._y = 0);
7011
7016
  break;
7012
7017
  default:
7013
7018
  ZA("Euler: .setFromRotationMatrix() encountered an unknown order: " + I);
@@ -7779,8 +7784,8 @@ class fI extends QC {
7779
7784
  }
7780
7785
  }
7781
7786
  if (I) {
7782
- const G = E(A.geometries), D = E(A.materials), R = E(A.textures), M = E(A.images), i = E(A.shapes), o = E(A.skeletons), U = E(A.animations), y = E(A.nodes);
7783
- G.length > 0 && (B.geometries = G), D.length > 0 && (B.materials = D), R.length > 0 && (B.textures = R), M.length > 0 && (B.images = M), i.length > 0 && (B.shapes = i), o.length > 0 && (B.skeletons = o), U.length > 0 && (B.animations = U), y.length > 0 && (B.nodes = y);
7787
+ const G = E(A.geometries), D = E(A.materials), R = E(A.textures), M = E(A.images), i = E(A.shapes), o = E(A.skeletons), w = E(A.animations), y = E(A.nodes);
7788
+ G.length > 0 && (B.geometries = G), D.length > 0 && (B.materials = D), R.length > 0 && (B.textures = R), M.length > 0 && (B.images = M), i.length > 0 && (B.shapes = i), o.length > 0 && (B.skeletons = o), w.length > 0 && (B.animations = w), y.length > 0 && (B.nodes = y);
7784
7789
  }
7785
7790
  return B.object = C, B;
7786
7791
  function E(G) {
@@ -7862,8 +7867,8 @@ class bg {
7862
7867
  const E = ng.dot(ng), G = ng.dot(BB), D = ng.dot(mR), R = BB.dot(BB), M = BB.dot(mR), i = E * R - G * G;
7863
7868
  if (i === 0)
7864
7869
  return Q.set(0, 0, 0), null;
7865
- const o = 1 / i, U = (R * D - G * M) * o, y = (E * M - G * D) * o;
7866
- return Q.set(1 - U - y, y, U);
7870
+ const o = 1 / i, w = (R * D - G * M) * o, y = (E * M - G * D) * o;
7871
+ return Q.set(1 - w - y, y, w);
7867
7872
  }
7868
7873
  /**
7869
7874
  * Returns `true` if the given point, when projected onto the plane of the
@@ -8085,16 +8090,16 @@ class bg {
8085
8090
  if (o <= 0 && D >= 0 && M <= 0)
8086
8091
  return E = D / (D - M), I.copy(B).addScaledVector(tC, E);
8087
8092
  vR.subVectors(A, Q);
8088
- const U = tC.dot(vR), y = cC.dot(vR);
8089
- if (y >= 0 && U <= y)
8093
+ const w = tC.dot(vR), y = cC.dot(vR);
8094
+ if (y >= 0 && w <= y)
8090
8095
  return I.copy(Q);
8091
- const F = U * R - D * y;
8096
+ const F = w * R - D * y;
8092
8097
  if (F <= 0 && R >= 0 && y <= 0)
8093
8098
  return G = R / (R - y), I.copy(B).addScaledVector(cC, G);
8094
- const w = M * y - U * i;
8095
- if (w <= 0 && i - M >= 0 && U - y >= 0)
8096
- return qo.subVectors(Q, C), G = (i - M) / (i - M + (U - y)), I.copy(C).addScaledVector(qo, G);
8097
- const s = 1 / (w + F + o);
8099
+ const U = M * y - w * i;
8100
+ if (U <= 0 && i - M >= 0 && w - y >= 0)
8101
+ return qo.subVectors(Q, C), G = (i - M) / (i - M + (w - y)), I.copy(C).addScaledVector(qo, G);
8102
+ const s = 1 / (U + F + o);
8098
8103
  return E = F * s, G = o * s, I.copy(B).addScaledVector(tC, E).addScaledVector(cC, G);
8099
8104
  }
8100
8105
  /**
@@ -9596,11 +9601,11 @@ class wg extends QC {
9596
9601
  const E = this.getAttribute("tangent"), G = [], D = [];
9597
9602
  for (let n = 0; n < B.count; n++)
9598
9603
  G[n] = new H(), D[n] = new H();
9599
- const R = new H(), M = new H(), i = new H(), o = new HA(), U = new HA(), y = new HA(), F = new H(), w = new H();
9604
+ const R = new H(), M = new H(), i = new H(), o = new HA(), w = new HA(), y = new HA(), F = new H(), U = new H();
9600
9605
  function s(n, h, Y) {
9601
- R.fromBufferAttribute(B, n), M.fromBufferAttribute(B, h), i.fromBufferAttribute(B, Y), o.fromBufferAttribute(Q, n), U.fromBufferAttribute(Q, h), y.fromBufferAttribute(Q, Y), M.sub(R), i.sub(R), U.sub(o), y.sub(o);
9602
- const k = 1 / (U.x * y.y - y.x * U.y);
9603
- isFinite(k) && (F.copy(M).multiplyScalar(y.y).addScaledVector(i, -U.y).multiplyScalar(k), w.copy(i).multiplyScalar(U.x).addScaledVector(M, -y.x).multiplyScalar(k), G[n].add(F), G[h].add(F), G[Y].add(F), D[n].add(w), D[h].add(w), D[Y].add(w));
9606
+ R.fromBufferAttribute(B, n), M.fromBufferAttribute(B, h), i.fromBufferAttribute(B, Y), o.fromBufferAttribute(Q, n), w.fromBufferAttribute(Q, h), y.fromBufferAttribute(Q, Y), M.sub(R), i.sub(R), w.sub(o), y.sub(o);
9607
+ const k = 1 / (w.x * y.y - y.x * w.y);
9608
+ isFinite(k) && (F.copy(M).multiplyScalar(y.y).addScaledVector(i, -w.y).multiplyScalar(k), U.copy(i).multiplyScalar(w.x).addScaledVector(M, -y.x).multiplyScalar(k), G[n].add(F), G[h].add(F), G[Y].add(F), D[n].add(U), D[h].add(U), D[Y].add(U));
9604
9609
  }
9605
9610
  let x = this.groups;
9606
9611
  x.length === 0 && (x = [{
@@ -9643,16 +9648,16 @@ class wg extends QC {
9643
9648
  if (B === void 0)
9644
9649
  B = new xg(new Float32Array(I.count * 3), 3), this.setAttribute("normal", B);
9645
9650
  else
9646
- for (let o = 0, U = B.count; o < U; o++)
9651
+ for (let o = 0, w = B.count; o < w; o++)
9647
9652
  B.setXYZ(o, 0, 0, 0);
9648
9653
  const C = new H(), Q = new H(), E = new H(), G = new H(), D = new H(), R = new H(), M = new H(), i = new H();
9649
9654
  if (A)
9650
- for (let o = 0, U = A.count; o < U; o += 3) {
9651
- const y = A.getX(o + 0), F = A.getX(o + 1), w = A.getX(o + 2);
9652
- C.fromBufferAttribute(I, y), Q.fromBufferAttribute(I, F), E.fromBufferAttribute(I, w), M.subVectors(E, Q), i.subVectors(C, Q), M.cross(i), G.fromBufferAttribute(B, y), D.fromBufferAttribute(B, F), R.fromBufferAttribute(B, w), G.add(M), D.add(M), R.add(M), B.setXYZ(y, G.x, G.y, G.z), B.setXYZ(F, D.x, D.y, D.z), B.setXYZ(w, R.x, R.y, R.z);
9655
+ for (let o = 0, w = A.count; o < w; o += 3) {
9656
+ const y = A.getX(o + 0), F = A.getX(o + 1), U = A.getX(o + 2);
9657
+ C.fromBufferAttribute(I, y), Q.fromBufferAttribute(I, F), E.fromBufferAttribute(I, U), M.subVectors(E, Q), i.subVectors(C, Q), M.cross(i), G.fromBufferAttribute(B, y), D.fromBufferAttribute(B, F), R.fromBufferAttribute(B, U), G.add(M), D.add(M), R.add(M), B.setXYZ(y, G.x, G.y, G.z), B.setXYZ(F, D.x, D.y, D.z), B.setXYZ(U, R.x, R.y, R.z);
9653
9658
  }
9654
9659
  else
9655
- for (let o = 0, U = I.count; o < U; o += 3)
9660
+ for (let o = 0, w = I.count; o < w; o += 3)
9656
9661
  C.fromBufferAttribute(I, o + 0), Q.fromBufferAttribute(I, o + 1), E.fromBufferAttribute(I, o + 2), M.subVectors(E, Q), i.subVectors(C, Q), M.cross(i), B.setXYZ(o + 0, M.x, M.y, M.z), B.setXYZ(o + 1, M.x, M.y, M.z), B.setXYZ(o + 2, M.x, M.y, M.z);
9657
9662
  this.normalizeNormals(), B.needsUpdate = !0;
9658
9663
  }
@@ -9675,11 +9680,11 @@ class wg extends QC {
9675
9680
  toNonIndexed() {
9676
9681
  function A(G, D) {
9677
9682
  const R = G.array, M = G.itemSize, i = G.normalized, o = new R.constructor(D.length * M);
9678
- let U = 0, y = 0;
9679
- for (let F = 0, w = D.length; F < w; F++) {
9680
- G.isInterleavedBufferAttribute ? U = D[F] * G.data.stride + G.offset : U = D[F] * M;
9683
+ let w = 0, y = 0;
9684
+ for (let F = 0, U = D.length; F < U; F++) {
9685
+ G.isInterleavedBufferAttribute ? w = D[F] * G.data.stride + G.offset : w = D[F] * M;
9681
9686
  for (let s = 0; s < M; s++)
9682
- o[y++] = R[U++];
9687
+ o[y++] = R[w++];
9683
9688
  }
9684
9689
  return new xg(o, M, i);
9685
9690
  }
@@ -9694,8 +9699,8 @@ class wg extends QC {
9694
9699
  for (const G in Q) {
9695
9700
  const D = [], R = Q[G];
9696
9701
  for (let M = 0, i = R.length; M < i; M++) {
9697
- const o = R[M], U = A(o, B);
9698
- D.push(U);
9702
+ const o = R[M], w = A(o, B);
9703
+ D.push(w);
9699
9704
  }
9700
9705
  I.morphAttributes[G] = D;
9701
9706
  }
@@ -9742,8 +9747,8 @@ class wg extends QC {
9742
9747
  for (const D in this.morphAttributes) {
9743
9748
  const R = this.morphAttributes[D], M = [];
9744
9749
  for (let i = 0, o = R.length; i < o; i++) {
9745
- const U = R[i];
9746
- M.push(U.toJSON(A.data));
9750
+ const w = R[i];
9751
+ M.push(w.toJSON(A.data));
9747
9752
  }
9748
9753
  M.length > 0 && (C[D] = M, Q = !0);
9749
9754
  }
@@ -9781,7 +9786,7 @@ class wg extends QC {
9781
9786
  const Q = A.morphAttributes;
9782
9787
  for (const R in Q) {
9783
9788
  const M = [], i = Q[R];
9784
- for (let o = 0, U = i.length; o < U; o++)
9789
+ for (let o = 0, w = i.length; o < w; o++)
9785
9790
  M.push(i[o].clone(I));
9786
9791
  this.morphAttributes[R] = M;
9787
9792
  }
@@ -9871,37 +9876,37 @@ class og extends fI {
9871
9876
  }
9872
9877
  _computeIntersections(A, I, B) {
9873
9878
  let C;
9874
- const Q = this.geometry, E = this.material, G = Q.index, D = Q.attributes.position, R = Q.attributes.uv, M = Q.attributes.uv1, i = Q.attributes.normal, o = Q.groups, U = Q.drawRange;
9879
+ const Q = this.geometry, E = this.material, G = Q.index, D = Q.attributes.position, R = Q.attributes.uv, M = Q.attributes.uv1, i = Q.attributes.normal, o = Q.groups, w = Q.drawRange;
9875
9880
  if (G !== null)
9876
9881
  if (Array.isArray(E))
9877
9882
  for (let y = 0, F = o.length; y < F; y++) {
9878
- const w = o[y], s = E[w.materialIndex], x = Math.max(w.start, U.start), c = Math.min(G.count, Math.min(w.start + w.count, U.start + U.count));
9883
+ const U = o[y], s = E[U.materialIndex], x = Math.max(U.start, w.start), c = Math.min(G.count, Math.min(U.start + U.count, w.start + w.count));
9879
9884
  for (let N = x, S = c; N < S; N += 3) {
9880
9885
  const a = G.getX(N), j = G.getX(N + 1), n = G.getX(N + 2);
9881
- C = AE(this, s, A, B, R, M, i, a, j, n), C && (C.faceIndex = Math.floor(N / 3), C.face.materialIndex = w.materialIndex, I.push(C));
9886
+ C = AE(this, s, A, B, R, M, i, a, j, n), C && (C.faceIndex = Math.floor(N / 3), C.face.materialIndex = U.materialIndex, I.push(C));
9882
9887
  }
9883
9888
  }
9884
9889
  else {
9885
- const y = Math.max(0, U.start), F = Math.min(G.count, U.start + U.count);
9886
- for (let w = y, s = F; w < s; w += 3) {
9887
- const x = G.getX(w), c = G.getX(w + 1), N = G.getX(w + 2);
9888
- C = AE(this, E, A, B, R, M, i, x, c, N), C && (C.faceIndex = Math.floor(w / 3), I.push(C));
9890
+ const y = Math.max(0, w.start), F = Math.min(G.count, w.start + w.count);
9891
+ for (let U = y, s = F; U < s; U += 3) {
9892
+ const x = G.getX(U), c = G.getX(U + 1), N = G.getX(U + 2);
9893
+ C = AE(this, E, A, B, R, M, i, x, c, N), C && (C.faceIndex = Math.floor(U / 3), I.push(C));
9889
9894
  }
9890
9895
  }
9891
9896
  else if (D !== void 0)
9892
9897
  if (Array.isArray(E))
9893
9898
  for (let y = 0, F = o.length; y < F; y++) {
9894
- const w = o[y], s = E[w.materialIndex], x = Math.max(w.start, U.start), c = Math.min(D.count, Math.min(w.start + w.count, U.start + U.count));
9899
+ const U = o[y], s = E[U.materialIndex], x = Math.max(U.start, w.start), c = Math.min(D.count, Math.min(U.start + U.count, w.start + w.count));
9895
9900
  for (let N = x, S = c; N < S; N += 3) {
9896
9901
  const a = N, j = N + 1, n = N + 2;
9897
- C = AE(this, s, A, B, R, M, i, a, j, n), C && (C.faceIndex = Math.floor(N / 3), C.face.materialIndex = w.materialIndex, I.push(C));
9902
+ C = AE(this, s, A, B, R, M, i, a, j, n), C && (C.faceIndex = Math.floor(N / 3), C.face.materialIndex = U.materialIndex, I.push(C));
9898
9903
  }
9899
9904
  }
9900
9905
  else {
9901
- const y = Math.max(0, U.start), F = Math.min(D.count, U.start + U.count);
9902
- for (let w = y, s = F; w < s; w += 3) {
9903
- const x = w, c = w + 1, N = w + 2;
9904
- C = AE(this, E, A, B, R, M, i, x, c, N), C && (C.faceIndex = Math.floor(w / 3), I.push(C));
9906
+ const y = Math.max(0, w.start), F = Math.min(D.count, w.start + w.count);
9907
+ for (let U = y, s = F; U < s; U += 3) {
9908
+ const x = U, c = U + 1, N = U + 2;
9909
+ C = AE(this, E, A, B, R, M, i, x, c, N), C && (C.faceIndex = Math.floor(U / 3), I.push(C));
9905
9910
  }
9906
9911
  }
9907
9912
  }
@@ -9957,9 +9962,9 @@ class VC extends wg {
9957
9962
  const G = this;
9958
9963
  C = Math.floor(C), Q = Math.floor(Q), E = Math.floor(E);
9959
9964
  const D = [], R = [], M = [], i = [];
9960
- let o = 0, U = 0;
9965
+ let o = 0, w = 0;
9961
9966
  y("z", "y", "x", -1, -1, B, I, A, E, Q, 0), y("z", "y", "x", 1, -1, B, I, -A, E, Q, 1), y("x", "z", "y", 1, 1, A, B, I, C, E, 2), y("x", "z", "y", 1, -1, A, B, -I, C, E, 3), y("x", "y", "z", 1, -1, A, I, B, C, Q, 4), y("x", "y", "z", -1, -1, A, I, -B, C, Q, 5), this.setIndex(D), this.setAttribute("position", new Mg(R, 3)), this.setAttribute("normal", new Mg(M, 3)), this.setAttribute("uv", new Mg(i, 2));
9962
- function y(F, w, s, x, c, N, S, a, j, n, h) {
9967
+ function y(F, U, s, x, c, N, S, a, j, n, h) {
9963
9968
  const Y = N / j, k = S / n, l = N / 2, p = S / 2, m = a / 2, v = j + 1, u = n + 1;
9964
9969
  let f = 0, z = 0;
9965
9970
  const IA = new H();
@@ -9967,7 +9972,7 @@ class VC extends wg {
9967
9972
  const CA = gA * k - p;
9968
9973
  for (let KA = 0; KA < v; KA++) {
9969
9974
  const SA = KA * Y - l;
9970
- IA[F] = SA * x, IA[w] = CA * c, IA[s] = m, R.push(IA.x, IA.y, IA.z), IA[F] = 0, IA[w] = 0, IA[s] = a > 0 ? 1 : -1, M.push(IA.x, IA.y, IA.z), i.push(KA / j), i.push(1 - gA / n), f += 1;
9975
+ IA[F] = SA * x, IA[U] = CA * c, IA[s] = m, R.push(IA.x, IA.y, IA.z), IA[F] = 0, IA[U] = 0, IA[s] = a > 0 ? 1 : -1, M.push(IA.x, IA.y, IA.z), i.push(KA / j), i.push(1 - gA / n), f += 1;
9971
9976
  }
9972
9977
  }
9973
9978
  for (let gA = 0; gA < n; gA++)
@@ -9975,7 +9980,7 @@ class VC extends wg {
9975
9980
  const KA = o + CA + v * gA, SA = o + CA + v * (gA + 1), PA = o + (CA + 1) + v * (gA + 1), vA = o + (CA + 1) + v * gA;
9976
9981
  D.push(KA, SA, vA), D.push(SA, PA, vA), z += 6;
9977
9982
  }
9978
- G.addGroup(U, z, h), U += z, o += f;
9983
+ G.addGroup(w, z, h), w += z, o += f;
9979
9984
  }
9980
9985
  }
9981
9986
  copy(A) {
@@ -10348,10 +10353,10 @@ class mw extends fI {
10348
10353
  this.parent === null && this.updateMatrixWorld();
10349
10354
  const { renderTarget: B, activeMipmapLevel: C } = this;
10350
10355
  this.coordinateSystem !== A.coordinateSystem && (this.coordinateSystem = A.coordinateSystem, this.updateCoordinateSystem());
10351
- const [Q, E, G, D, R, M] = this.children, i = A.getRenderTarget(), o = A.getActiveCubeFace(), U = A.getActiveMipmapLevel(), y = A.xr.enabled;
10356
+ const [Q, E, G, D, R, M] = this.children, i = A.getRenderTarget(), o = A.getActiveCubeFace(), w = A.getActiveMipmapLevel(), y = A.xr.enabled;
10352
10357
  A.xr.enabled = !1;
10353
10358
  const F = B.texture.generateMipmaps;
10354
- B.texture.generateMipmaps = !1, A.setRenderTarget(B, 0, C), A.render(I, Q), A.setRenderTarget(B, 1, C), A.render(I, E), A.setRenderTarget(B, 2, C), A.render(I, G), A.setRenderTarget(B, 3, C), A.render(I, D), A.setRenderTarget(B, 4, C), A.render(I, R), B.texture.generateMipmaps = F, A.setRenderTarget(B, 5, C), A.render(I, M), A.setRenderTarget(i, o, U), A.xr.enabled = y, B.texture.needsPMREMUpdate = !0;
10359
+ B.texture.generateMipmaps = !1, A.setRenderTarget(B, 0, C), A.render(I, Q), A.setRenderTarget(B, 1, C), A.render(I, E), A.setRenderTarget(B, 2, C), A.render(I, G), A.setRenderTarget(B, 3, C), A.render(I, D), A.setRenderTarget(B, 4, C), A.render(I, R), B.texture.generateMipmaps = F, A.setRenderTarget(B, 5, C), A.render(I, M), A.setRenderTarget(i, o, w), A.xr.enabled = y, B.texture.needsPMREMUpdate = !0;
10355
10360
  }
10356
10361
  }
10357
10362
  class Vw extends jg {
@@ -10567,15 +10572,15 @@ class AD {
10567
10572
  if (R && A.hand) {
10568
10573
  E = !0;
10569
10574
  for (const F of A.hand.values()) {
10570
- const w = I.getJointPose(F, B), s = this._getHandJoint(R, F);
10571
- w !== null && (s.matrix.fromArray(w.transform.matrix), s.matrix.decompose(s.position, s.rotation, s.scale), s.matrixWorldNeedsUpdate = !0, s.jointRadius = w.radius), s.visible = w !== null;
10575
+ const U = I.getJointPose(F, B), s = this._getHandJoint(R, F);
10576
+ U !== null && (s.matrix.fromArray(U.transform.matrix), s.matrix.decompose(s.position, s.rotation, s.scale), s.matrixWorldNeedsUpdate = !0, s.jointRadius = U.radius), s.visible = U !== null;
10572
10577
  }
10573
- const M = R.joints["index-finger-tip"], i = R.joints["thumb-tip"], o = M.position.distanceTo(i.position), U = 0.02, y = 5e-3;
10574
- R.inputState.pinching && o > U + y ? (R.inputState.pinching = !1, this.dispatchEvent({
10578
+ const M = R.joints["index-finger-tip"], i = R.joints["thumb-tip"], o = M.position.distanceTo(i.position), w = 0.02, y = 5e-3;
10579
+ R.inputState.pinching && o > w + y ? (R.inputState.pinching = !1, this.dispatchEvent({
10575
10580
  type: "pinchend",
10576
10581
  handedness: A.handedness,
10577
10582
  target: this
10578
- })) : !R.inputState.pinching && o <= U - y && (R.inputState.pinching = !0, this.dispatchEvent({
10583
+ })) : !R.inputState.pinching && o <= w - y && (R.inputState.pinching = !0, this.dispatchEvent({
10579
10584
  type: "pinchstart",
10580
10585
  handedness: A.handedness,
10581
10586
  target: this
@@ -10920,13 +10925,13 @@ class Ww {
10920
10925
  * @return {Frustum} A reference to this frustum.
10921
10926
  */
10922
10927
  setFromProjectionMatrix(A, I = Og, B = !1) {
10923
- const C = this.planes, Q = A.elements, E = Q[0], G = Q[1], D = Q[2], R = Q[3], M = Q[4], i = Q[5], o = Q[6], U = Q[7], y = Q[8], F = Q[9], w = Q[10], s = Q[11], x = Q[12], c = Q[13], N = Q[14], S = Q[15];
10924
- if (C[0].setComponents(R - E, U - M, s - y, S - x).normalize(), C[1].setComponents(R + E, U + M, s + y, S + x).normalize(), C[2].setComponents(R + G, U + i, s + F, S + c).normalize(), C[3].setComponents(R - G, U - i, s - F, S - c).normalize(), B)
10925
- C[4].setComponents(D, o, w, N).normalize(), C[5].setComponents(R - D, U - o, s - w, S - N).normalize();
10926
- else if (C[4].setComponents(R - D, U - o, s - w, S - N).normalize(), I === Og)
10927
- C[5].setComponents(R + D, U + o, s + w, S + N).normalize();
10928
+ const C = this.planes, Q = A.elements, E = Q[0], G = Q[1], D = Q[2], R = Q[3], M = Q[4], i = Q[5], o = Q[6], w = Q[7], y = Q[8], F = Q[9], U = Q[10], s = Q[11], x = Q[12], c = Q[13], N = Q[14], S = Q[15];
10929
+ if (C[0].setComponents(R - E, w - M, s - y, S - x).normalize(), C[1].setComponents(R + E, w + M, s + y, S + x).normalize(), C[2].setComponents(R + G, w + i, s + F, S + c).normalize(), C[3].setComponents(R - G, w - i, s - F, S - c).normalize(), B)
10930
+ C[4].setComponents(D, o, U, N).normalize(), C[5].setComponents(R - D, w - o, s - U, S - N).normalize();
10931
+ else if (C[4].setComponents(R - D, w - o, s - U, S - N).normalize(), I === Og)
10932
+ C[5].setComponents(R + D, w + o, s + U, S + N).normalize();
10928
10933
  else if (I === KE)
10929
- C[5].setComponents(D, o, w, N).normalize();
10934
+ C[5].setComponents(D, o, U, N).normalize();
10930
10935
  else
10931
10936
  throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: " + I);
10932
10937
  return this;
@@ -11070,23 +11075,23 @@ class YN extends fI {
11070
11075
  Wo.copy(C).invert(), CQ.copy(A.ray).applyMatrix4(Wo);
11071
11076
  const G = Q / ((this.scale.x + this.scale.y + this.scale.z) / 3), D = G * G, R = this.isLineSegments ? 2 : 1, M = B.index, o = B.attributes.position;
11072
11077
  if (M !== null) {
11073
- const U = Math.max(0, E.start), y = Math.min(M.count, E.start + E.count);
11074
- for (let F = U, w = y - 1; F < w; F += R) {
11078
+ const w = Math.max(0, E.start), y = Math.min(M.count, E.start + E.count);
11079
+ for (let F = w, U = y - 1; F < U; F += R) {
11075
11080
  const s = M.getX(F), x = M.getX(F + 1), c = BE(this, A, CQ, D, s, x, F);
11076
11081
  c && I.push(c);
11077
11082
  }
11078
11083
  if (this.isLineLoop) {
11079
- const F = M.getX(y - 1), w = M.getX(U), s = BE(this, A, CQ, D, F, w, y - 1);
11084
+ const F = M.getX(y - 1), U = M.getX(w), s = BE(this, A, CQ, D, F, U, y - 1);
11080
11085
  s && I.push(s);
11081
11086
  }
11082
11087
  } else {
11083
- const U = Math.max(0, E.start), y = Math.min(o.count, E.start + E.count);
11084
- for (let F = U, w = y - 1; F < w; F += R) {
11088
+ const w = Math.max(0, E.start), y = Math.min(o.count, E.start + E.count);
11089
+ for (let F = w, U = y - 1; F < U; F += R) {
11085
11090
  const s = BE(this, A, CQ, D, F, F + 1, F);
11086
11091
  s && I.push(s);
11087
11092
  }
11088
11093
  if (this.isLineLoop) {
11089
- const F = BE(this, A, CQ, D, y - 1, U, y - 1);
11094
+ const F = BE(this, A, CQ, D, y - 1, w, y - 1);
11090
11095
  F && I.push(F);
11091
11096
  }
11092
11097
  }
@@ -11237,14 +11242,14 @@ class LN extends wg {
11237
11242
  geometry: A,
11238
11243
  thresholdAngle: I
11239
11244
  }, A !== null) {
11240
- const C = Math.pow(10, 4), Q = Math.cos(sQ * I), E = A.getIndex(), G = A.getAttribute("position"), D = E ? E.count : G.count, R = [0, 0, 0], M = ["a", "b", "c"], i = new Array(3), o = {}, U = [];
11245
+ const C = Math.pow(10, 4), Q = Math.cos(sQ * I), E = A.getIndex(), G = A.getAttribute("position"), D = E ? E.count : G.count, R = [0, 0, 0], M = ["a", "b", "c"], i = new Array(3), o = {}, w = [];
11241
11246
  for (let y = 0; y < D; y += 3) {
11242
11247
  E ? (R[0] = E.getX(y), R[1] = E.getX(y + 1), R[2] = E.getX(y + 2)) : (R[0] = y, R[1] = y + 1, R[2] = y + 2);
11243
- const { a: F, b: w, c: s } = EE;
11244
- if (F.fromBufferAttribute(G, R[0]), w.fromBufferAttribute(G, R[1]), s.fromBufferAttribute(G, R[2]), EE.getNormal(BD), i[0] = `${Math.round(F.x * C)},${Math.round(F.y * C)},${Math.round(F.z * C)}`, i[1] = `${Math.round(w.x * C)},${Math.round(w.y * C)},${Math.round(w.z * C)}`, i[2] = `${Math.round(s.x * C)},${Math.round(s.y * C)},${Math.round(s.z * C)}`, !(i[0] === i[1] || i[1] === i[2] || i[2] === i[0]))
11248
+ const { a: F, b: U, c: s } = EE;
11249
+ if (F.fromBufferAttribute(G, R[0]), U.fromBufferAttribute(G, R[1]), s.fromBufferAttribute(G, R[2]), EE.getNormal(BD), i[0] = `${Math.round(F.x * C)},${Math.round(F.y * C)},${Math.round(F.z * C)}`, i[1] = `${Math.round(U.x * C)},${Math.round(U.y * C)},${Math.round(U.z * C)}`, i[2] = `${Math.round(s.x * C)},${Math.round(s.y * C)},${Math.round(s.z * C)}`, !(i[0] === i[1] || i[1] === i[2] || i[2] === i[0]))
11245
11250
  for (let x = 0; x < 3; x++) {
11246
11251
  const c = (x + 1) % 3, N = i[x], S = i[c], a = EE[M[x]], j = EE[M[c]], n = `${N}_${S}`, h = `${S}_${N}`;
11247
- h in o && o[h] ? (BD.dot(o[h].normal) <= Q && (U.push(a.x, a.y, a.z), U.push(j.x, j.y, j.z)), o[h] = null) : n in o || (o[n] = {
11252
+ h in o && o[h] ? (BD.dot(o[h].normal) <= Q && (w.push(a.x, a.y, a.z), w.push(j.x, j.y, j.z)), o[h] = null) : n in o || (o[n] = {
11248
11253
  index0: R[x],
11249
11254
  index1: R[c],
11250
11255
  normal: BD.clone()
@@ -11253,10 +11258,10 @@ class LN extends wg {
11253
11258
  }
11254
11259
  for (const y in o)
11255
11260
  if (o[y]) {
11256
- const { index0: F, index1: w } = o[y];
11257
- CE.fromBufferAttribute(G, F), QE.fromBufferAttribute(G, w), U.push(CE.x, CE.y, CE.z), U.push(QE.x, QE.y, QE.z);
11261
+ const { index0: F, index1: U } = o[y];
11262
+ CE.fromBufferAttribute(G, F), QE.fromBufferAttribute(G, U), w.push(CE.x, CE.y, CE.z), w.push(QE.x, QE.y, QE.z);
11258
11263
  }
11259
- this.setAttribute("position", new Mg(U, 3));
11264
+ this.setAttribute("position", new Mg(w, 3));
11260
11265
  }
11261
11266
  }
11262
11267
  copy(A) {
@@ -11279,20 +11284,20 @@ class VE extends wg {
11279
11284
  widthSegments: B,
11280
11285
  heightSegments: C
11281
11286
  };
11282
- const Q = A / 2, E = I / 2, G = Math.floor(B), D = Math.floor(C), R = G + 1, M = D + 1, i = A / G, o = I / D, U = [], y = [], F = [], w = [];
11287
+ const Q = A / 2, E = I / 2, G = Math.floor(B), D = Math.floor(C), R = G + 1, M = D + 1, i = A / G, o = I / D, w = [], y = [], F = [], U = [];
11283
11288
  for (let s = 0; s < M; s++) {
11284
11289
  const x = s * o - E;
11285
11290
  for (let c = 0; c < R; c++) {
11286
11291
  const N = c * i - Q;
11287
- y.push(N, -x, 0), F.push(0, 0, 1), w.push(c / G), w.push(1 - s / D);
11292
+ y.push(N, -x, 0), F.push(0, 0, 1), U.push(c / G), U.push(1 - s / D);
11288
11293
  }
11289
11294
  }
11290
11295
  for (let s = 0; s < D; s++)
11291
11296
  for (let x = 0; x < G; x++) {
11292
11297
  const c = x + R * s, N = x + R * (s + 1), S = x + 1 + R * (s + 1), a = x + 1 + R * s;
11293
- U.push(c, N, a), U.push(N, S, a);
11298
+ w.push(c, N, a), w.push(N, S, a);
11294
11299
  }
11295
- this.setIndex(U), this.setAttribute("position", new Mg(y, 3)), this.setAttribute("normal", new Mg(F, 3)), this.setAttribute("uv", new Mg(w, 2));
11300
+ this.setIndex(w), this.setAttribute("position", new Mg(y, 3)), this.setAttribute("normal", new Mg(F, 3)), this.setAttribute("uv", new Mg(U, 2));
11296
11301
  }
11297
11302
  copy(A) {
11298
11303
  return super.copy(A), this.parameters = Object.assign({}, A.parameters), this;
@@ -11458,8 +11463,8 @@ class kN {
11458
11463
  return i !== -1 && R.splice(i, 2), this;
11459
11464
  }, this.getHandler = function(M) {
11460
11465
  for (let i = 0, o = R.length; i < o; i += 2) {
11461
- const U = R[i], y = R[i + 1];
11462
- if (U.global && (U.lastIndex = 0), U.test(M))
11466
+ const w = R[i], y = R[i + 1];
11467
+ if (w.global && (w.lastIndex = 0), w.test(M))
11463
11468
  return y;
11464
11469
  }
11465
11470
  return null;
@@ -11636,9 +11641,9 @@ class eN extends zi {
11636
11641
  if (R.status === 200 || R.status === 0) {
11637
11642
  if (R.status === 0 && ZA("FileLoader: HTTP Status 0 received."), typeof ReadableStream > "u" || R.body === void 0 || R.body.getReader === void 0)
11638
11643
  return R;
11639
- const M = QB[A], i = R.body.getReader(), o = R.headers.get("X-File-Size") || R.headers.get("Content-Length"), U = o ? parseInt(o) : 0, y = U !== 0;
11644
+ const M = QB[A], i = R.body.getReader(), o = R.headers.get("X-File-Size") || R.headers.get("Content-Length"), w = o ? parseInt(o) : 0, y = w !== 0;
11640
11645
  let F = 0;
11641
- const w = new ReadableStream({
11646
+ const U = new ReadableStream({
11642
11647
  start(s) {
11643
11648
  x();
11644
11649
  function x() {
@@ -11647,7 +11652,7 @@ class eN extends zi {
11647
11652
  s.close();
11648
11653
  else {
11649
11654
  F += N.byteLength;
11650
- const S = new ProgressEvent("progress", { lengthComputable: y, loaded: F, total: U });
11655
+ const S = new ProgressEvent("progress", { lengthComputable: y, loaded: F, total: w });
11651
11656
  for (let a = 0, j = M.length; a < j; a++) {
11652
11657
  const n = M[a];
11653
11658
  n.onProgress && n.onProgress(S);
@@ -11660,7 +11665,7 @@ class eN extends zi {
11660
11665
  }
11661
11666
  }
11662
11667
  });
11663
- return new Response(w);
11668
+ return new Response(U);
11664
11669
  } else
11665
11670
  throw new nN(`fetch for "${R.url}" responded with ${R.status}: ${R.statusText}`, R);
11666
11671
  }).then((R) => {
@@ -11677,8 +11682,8 @@ class eN extends zi {
11677
11682
  if (G === "")
11678
11683
  return R.text();
11679
11684
  {
11680
- const i = /charset="?([^;"\s]*)"?/i.exec(G), o = i && i[1] ? i[1].toLowerCase() : void 0, U = new TextDecoder(o);
11681
- return R.arrayBuffer().then((y) => U.decode(y));
11685
+ const i = /charset="?([^;"\s]*)"?/i.exec(G), o = i && i[1] ? i[1].toLowerCase() : void 0, w = new TextDecoder(o);
11686
+ return R.arrayBuffer().then((y) => w.decode(y));
11682
11687
  }
11683
11688
  }
11684
11689
  }).then((R) => {
@@ -11686,8 +11691,8 @@ class eN extends zi {
11686
11691
  const M = QB[A];
11687
11692
  delete QB[A];
11688
11693
  for (let i = 0, o = M.length; i < o; i++) {
11689
- const U = M[i];
11690
- U.onLoad && U.onLoad(R);
11694
+ const w = M[i];
11695
+ w.onLoad && w.onLoad(R);
11691
11696
  }
11692
11697
  }).catch((R) => {
11693
11698
  const M = QB[A];
@@ -11695,8 +11700,8 @@ class eN extends zi {
11695
11700
  throw this.manager.itemError(A), R;
11696
11701
  delete QB[A];
11697
11702
  for (let i = 0, o = M.length; i < o; i++) {
11698
- const U = M[i];
11699
- U.onError && U.onError(R);
11703
+ const w = M[i];
11704
+ w.onError && w.onError(R);
11700
11705
  }
11701
11706
  this.manager.itemError(A);
11702
11707
  }).finally(() => {
@@ -12291,30 +12296,30 @@ function dN(g) {
12291
12296
  function I(G, D) {
12292
12297
  const R = G.array, M = G.usage, i = R.byteLength, o = g.createBuffer();
12293
12298
  g.bindBuffer(D, o), g.bufferData(D, R, M), G.onUploadCallback();
12294
- let U;
12299
+ let w;
12295
12300
  if (R instanceof Float32Array)
12296
- U = g.FLOAT;
12301
+ w = g.FLOAT;
12297
12302
  else if (typeof Float16Array < "u" && R instanceof Float16Array)
12298
- U = g.HALF_FLOAT;
12303
+ w = g.HALF_FLOAT;
12299
12304
  else if (R instanceof Uint16Array)
12300
- G.isFloat16BufferAttribute ? U = g.HALF_FLOAT : U = g.UNSIGNED_SHORT;
12305
+ G.isFloat16BufferAttribute ? w = g.HALF_FLOAT : w = g.UNSIGNED_SHORT;
12301
12306
  else if (R instanceof Int16Array)
12302
- U = g.SHORT;
12307
+ w = g.SHORT;
12303
12308
  else if (R instanceof Uint32Array)
12304
- U = g.UNSIGNED_INT;
12309
+ w = g.UNSIGNED_INT;
12305
12310
  else if (R instanceof Int32Array)
12306
- U = g.INT;
12311
+ w = g.INT;
12307
12312
  else if (R instanceof Int8Array)
12308
- U = g.BYTE;
12313
+ w = g.BYTE;
12309
12314
  else if (R instanceof Uint8Array)
12310
- U = g.UNSIGNED_BYTE;
12315
+ w = g.UNSIGNED_BYTE;
12311
12316
  else if (R instanceof Uint8ClampedArray)
12312
- U = g.UNSIGNED_BYTE;
12317
+ w = g.UNSIGNED_BYTE;
12313
12318
  else
12314
12319
  throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: " + R);
12315
12320
  return {
12316
12321
  buffer: o,
12317
- type: U,
12322
+ type: w,
12318
12323
  bytesPerElement: R.BYTES_PER_ELEMENT,
12319
12324
  version: G.version,
12320
12325
  size: i
@@ -12325,18 +12330,18 @@ function dN(g) {
12325
12330
  if (g.bindBuffer(R, G), i.length === 0)
12326
12331
  g.bufferSubData(R, 0, M);
12327
12332
  else {
12328
- i.sort((U, y) => U.start - y.start);
12333
+ i.sort((w, y) => w.start - y.start);
12329
12334
  let o = 0;
12330
- for (let U = 1; U < i.length; U++) {
12331
- const y = i[o], F = i[U];
12335
+ for (let w = 1; w < i.length; w++) {
12336
+ const y = i[o], F = i[w];
12332
12337
  F.start <= y.start + y.count + 1 ? y.count = Math.max(
12333
12338
  y.count,
12334
12339
  F.start + F.count - y.start
12335
12340
  ) : (++o, i[o] = F);
12336
12341
  }
12337
12342
  i.length = o + 1;
12338
- for (let U = 0, y = i.length; U < y; U++) {
12339
- const F = i[U];
12343
+ for (let w = 0, y = i.length; w < y; w++) {
12344
+ const F = i[w];
12340
12345
  g.bufferSubData(
12341
12346
  R,
12342
12347
  F.start * M.BYTES_PER_ELEMENT,
@@ -16534,7 +16539,7 @@ qg.physical = {
16534
16539
  const GE = { r: 0, b: 0, g: 0 }, TB = /* @__PURE__ */ new dg(), FS = /* @__PURE__ */ new XA();
16535
16540
  function tS(g, A, I, B, C, Q, E) {
16536
16541
  const G = new VA(0);
16537
- let D = Q === !0 ? 0 : 1, R, M, i = null, o = 0, U = null;
16542
+ let D = Q === !0 ? 0 : 1, R, M, i = null, o = 0, w = null;
16538
16543
  function y(c) {
16539
16544
  let N = c.isScene === !0 ? c.background : null;
16540
16545
  return N && N.isTexture && (N = (c.backgroundBlurriness > 0 ? I : A).get(N)), N;
@@ -16546,7 +16551,7 @@ function tS(g, A, I, B, C, Q, E) {
16546
16551
  const a = g.xr.getEnvironmentBlendMode();
16547
16552
  a === "additive" ? B.buffers.color.setClear(0, 0, 0, 1, E) : a === "alpha-blend" && B.buffers.color.setClear(0, 0, 0, 0, E), (g.autoClear || N) && (B.buffers.depth.setTest(!0), B.buffers.depth.setMask(!0), B.buffers.color.setMask(!0), g.clear(g.autoClearColor, g.autoClearDepth, g.autoClearStencil));
16548
16553
  }
16549
- function w(c, N) {
16554
+ function U(c, N) {
16550
16555
  const S = y(N);
16551
16556
  S && (S.isCubeTexture || S.mapping === fE) ? (M === void 0 && (M = new og(
16552
16557
  new VC(1, 1, 1),
@@ -16567,7 +16572,7 @@ function tS(g, A, I, B, C, Q, E) {
16567
16572
  get: function() {
16568
16573
  return this.uniforms.envMap.value;
16569
16574
  }
16570
- }), C.update(M)), TB.copy(N.backgroundRotation), TB.x *= -1, TB.y *= -1, TB.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (TB.y *= -1, TB.z *= -1), M.material.uniforms.envMap.value = S, M.material.uniforms.flipEnvMap.value = S.isCubeTexture && S.isRenderTargetTexture === !1 ? -1 : 1, M.material.uniforms.backgroundBlurriness.value = N.backgroundBlurriness, M.material.uniforms.backgroundIntensity.value = N.backgroundIntensity, M.material.uniforms.backgroundRotation.value.setFromMatrix4(FS.makeRotationFromEuler(TB)), M.material.toneMapped = II.getTransfer(S.colorSpace) !== MI, (i !== S || o !== S.version || U !== g.toneMapping) && (M.material.needsUpdate = !0, i = S, o = S.version, U = g.toneMapping), M.layers.enableAll(), c.unshift(M, M.geometry, M.material, 0, 0, null)) : S && S.isTexture && (R === void 0 && (R = new og(
16575
+ }), C.update(M)), TB.copy(N.backgroundRotation), TB.x *= -1, TB.y *= -1, TB.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (TB.y *= -1, TB.z *= -1), M.material.uniforms.envMap.value = S, M.material.uniforms.flipEnvMap.value = S.isCubeTexture && S.isRenderTargetTexture === !1 ? -1 : 1, M.material.uniforms.backgroundBlurriness.value = N.backgroundBlurriness, M.material.uniforms.backgroundIntensity.value = N.backgroundIntensity, M.material.uniforms.backgroundRotation.value.setFromMatrix4(FS.makeRotationFromEuler(TB)), M.material.toneMapped = II.getTransfer(S.colorSpace) !== MI, (i !== S || o !== S.version || w !== g.toneMapping) && (M.material.needsUpdate = !0, i = S, o = S.version, w = g.toneMapping), M.layers.enableAll(), c.unshift(M, M.geometry, M.material, 0, 0, null)) : S && S.isTexture && (R === void 0 && (R = new og(
16571
16576
  new VE(2, 2),
16572
16577
  new Lg({
16573
16578
  name: "BackgroundMaterial",
@@ -16584,7 +16589,7 @@ function tS(g, A, I, B, C, Q, E) {
16584
16589
  get: function() {
16585
16590
  return this.uniforms.t2D.value;
16586
16591
  }
16587
- }), C.update(R)), R.material.uniforms.t2D.value = S, R.material.uniforms.backgroundIntensity.value = N.backgroundIntensity, R.material.toneMapped = II.getTransfer(S.colorSpace) !== MI, S.matrixAutoUpdate === !0 && S.updateMatrix(), R.material.uniforms.uvTransform.value.copy(S.matrix), (i !== S || o !== S.version || U !== g.toneMapping) && (R.material.needsUpdate = !0, i = S, o = S.version, U = g.toneMapping), R.layers.enableAll(), c.unshift(R, R.geometry, R.material, 0, 0, null));
16592
+ }), C.update(R)), R.material.uniforms.t2D.value = S, R.material.uniforms.backgroundIntensity.value = N.backgroundIntensity, R.material.toneMapped = II.getTransfer(S.colorSpace) !== MI, S.matrixAutoUpdate === !0 && S.updateMatrix(), R.material.uniforms.uvTransform.value.copy(S.matrix), (i !== S || o !== S.version || w !== g.toneMapping) && (R.material.needsUpdate = !0, i = S, o = S.version, w = g.toneMapping), R.layers.enableAll(), c.unshift(R, R.geometry, R.material, 0, 0, null));
16588
16593
  }
16589
16594
  function s(c, N) {
16590
16595
  c.getRGB(GE, qw(g)), B.buffers.color.setClear(GE.r, GE.g, GE.b, N, E);
@@ -16606,7 +16611,7 @@ function tS(g, A, I, B, C, Q, E) {
16606
16611
  D = c, s(G, D);
16607
16612
  },
16608
16613
  render: F,
16609
- addToRenderList: w,
16614
+ addToRenderList: U,
16610
16615
  dispose: x
16611
16616
  };
16612
16617
  }
@@ -16616,7 +16621,7 @@ function cS(g, A) {
16616
16621
  function G(Y, k, l, p, m) {
16617
16622
  let v = !1;
16618
16623
  const u = i(p, l, k);
16619
- Q !== u && (Q = u, R(Q.object)), v = U(Y, p, l, m), v && y(Y, p, l, m), m !== null && A.update(m, g.ELEMENT_ARRAY_BUFFER), (v || E) && (E = !1, N(Y, k, l, p), m !== null && g.bindBuffer(g.ELEMENT_ARRAY_BUFFER, A.get(m).buffer));
16624
+ Q !== u && (Q = u, R(Q.object)), v = w(Y, p, l, m), v && y(Y, p, l, m), m !== null && A.update(m, g.ELEMENT_ARRAY_BUFFER), (v || E) && (E = !1, N(Y, k, l, p), m !== null && g.bindBuffer(g.ELEMENT_ARRAY_BUFFER, A.get(m).buffer));
16620
16625
  }
16621
16626
  function D() {
16622
16627
  return g.createVertexArray();
@@ -16653,7 +16658,7 @@ function cS(g, A) {
16653
16658
  index: null
16654
16659
  };
16655
16660
  }
16656
- function U(Y, k, l, p) {
16661
+ function w(Y, k, l, p) {
16657
16662
  const m = Q.attributes, v = k.attributes;
16658
16663
  let u = 0;
16659
16664
  const f = l.getAttributes();
@@ -16684,7 +16689,7 @@ function cS(g, A) {
16684
16689
  for (let k = 0, l = Y.length; k < l; k++)
16685
16690
  Y[k] = 0;
16686
16691
  }
16687
- function w(Y) {
16692
+ function U(Y) {
16688
16693
  s(Y, 0);
16689
16694
  }
16690
16695
  function s(Y, k) {
@@ -16718,7 +16723,7 @@ function cS(g, A) {
16718
16723
  Y.isInstancedMesh !== !0 && p._maxInstanceCount === void 0 && (p._maxInstanceCount = O.meshPerAttribute * O.count);
16719
16724
  } else
16720
16725
  for (let wA = 0; wA < z.locationSize; wA++)
16721
- w(z.location + wA);
16726
+ U(z.location + wA);
16722
16727
  g.bindBuffer(g.ARRAY_BUFFER, SA);
16723
16728
  for (let wA = 0; wA < z.locationSize; wA++)
16724
16729
  c(
@@ -16737,7 +16742,7 @@ function cS(g, A) {
16737
16742
  Y.isInstancedMesh !== !0 && p._maxInstanceCount === void 0 && (p._maxInstanceCount = IA.meshPerAttribute * IA.count);
16738
16743
  } else
16739
16744
  for (let O = 0; O < z.locationSize; O++)
16740
- w(z.location + O);
16745
+ U(z.location + O);
16741
16746
  g.bindBuffer(g.ARRAY_BUFFER, SA);
16742
16747
  for (let O = 0; O < z.locationSize; O++)
16743
16748
  c(
@@ -16819,7 +16824,7 @@ function cS(g, A) {
16819
16824
  releaseStatesOfGeometry: a,
16820
16825
  releaseStatesOfProgram: j,
16821
16826
  initAttributes: F,
16822
- enableAttribute: w,
16827
+ enableAttribute: U,
16823
16828
  disableUnusedAttributes: x
16824
16829
  };
16825
16830
  }
@@ -16837,19 +16842,19 @@ function xS(g, A, I) {
16837
16842
  function G(R, M, i) {
16838
16843
  if (i === 0) return;
16839
16844
  A.get("WEBGL_multi_draw").multiDrawArraysWEBGL(B, R, 0, M, 0, i);
16840
- let U = 0;
16845
+ let w = 0;
16841
16846
  for (let y = 0; y < i; y++)
16842
- U += M[y];
16843
- I.update(U, B, 1);
16847
+ w += M[y];
16848
+ I.update(w, B, 1);
16844
16849
  }
16845
16850
  function D(R, M, i, o) {
16846
16851
  if (i === 0) return;
16847
- const U = A.get("WEBGL_multi_draw");
16848
- if (U === null)
16852
+ const w = A.get("WEBGL_multi_draw");
16853
+ if (w === null)
16849
16854
  for (let y = 0; y < R.length; y++)
16850
16855
  E(R[y], M[y], o[y]);
16851
16856
  else {
16852
- U.multiDrawArraysInstancedWEBGL(B, R, 0, M, 0, o, 0, i);
16857
+ w.multiDrawArraysInstancedWEBGL(B, R, 0, M, 0, o, 0, i);
16853
16858
  let y = 0;
16854
16859
  for (let F = 0; F < i; F++)
16855
16860
  y += M[F] * o[F];
@@ -16888,7 +16893,7 @@ function hS(g, A, I, B) {
16888
16893
  let R = I.precision !== void 0 ? I.precision : "highp";
16889
16894
  const M = D(R);
16890
16895
  M !== R && (ZA("WebGLRenderer:", R, "not supported, using", M, "instead."), R = M);
16891
- const i = I.logarithmicDepthBuffer === !0, o = I.reversedDepthBuffer === !0 && A.has("EXT_clip_control"), U = g.getParameter(g.MAX_TEXTURE_IMAGE_UNITS), y = g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS), F = g.getParameter(g.MAX_TEXTURE_SIZE), w = g.getParameter(g.MAX_CUBE_MAP_TEXTURE_SIZE), s = g.getParameter(g.MAX_VERTEX_ATTRIBS), x = g.getParameter(g.MAX_VERTEX_UNIFORM_VECTORS), c = g.getParameter(g.MAX_VARYING_VECTORS), N = g.getParameter(g.MAX_FRAGMENT_UNIFORM_VECTORS), S = g.getParameter(g.MAX_SAMPLES), a = g.getParameter(g.SAMPLES);
16896
+ const i = I.logarithmicDepthBuffer === !0, o = I.reversedDepthBuffer === !0 && A.has("EXT_clip_control"), w = g.getParameter(g.MAX_TEXTURE_IMAGE_UNITS), y = g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS), F = g.getParameter(g.MAX_TEXTURE_SIZE), U = g.getParameter(g.MAX_CUBE_MAP_TEXTURE_SIZE), s = g.getParameter(g.MAX_VERTEX_ATTRIBS), x = g.getParameter(g.MAX_VERTEX_UNIFORM_VECTORS), c = g.getParameter(g.MAX_VARYING_VECTORS), N = g.getParameter(g.MAX_FRAGMENT_UNIFORM_VECTORS), S = g.getParameter(g.MAX_SAMPLES), a = g.getParameter(g.SAMPLES);
16892
16897
  return {
16893
16898
  isWebGL2: !0,
16894
16899
  // keeping this for backwards compatibility
@@ -16899,10 +16904,10 @@ function hS(g, A, I, B) {
16899
16904
  precision: R,
16900
16905
  logarithmicDepthBuffer: i,
16901
16906
  reversedDepthBuffer: o,
16902
- maxTextures: U,
16907
+ maxTextures: w,
16903
16908
  maxVertexTextures: y,
16904
16909
  maxTextureSize: F,
16905
- maxCubemapSize: w,
16910
+ maxCubemapSize: U,
16906
16911
  maxAttributes: s,
16907
16912
  maxVertexUniforms: x,
16908
16913
  maxVaryings: c,
@@ -16916,24 +16921,24 @@ function NS(g) {
16916
16921
  let I = null, B = 0, C = !1, Q = !1;
16917
16922
  const E = new LB(), G = new fA(), D = { value: null, needsUpdate: !1 };
16918
16923
  this.uniform = D, this.numPlanes = 0, this.numIntersection = 0, this.init = function(i, o) {
16919
- const U = i.length !== 0 || o || // enable state of previous frame - the clipping code has to
16924
+ const w = i.length !== 0 || o || // enable state of previous frame - the clipping code has to
16920
16925
  // run another frame in order to reset the state:
16921
16926
  B !== 0 || C;
16922
- return C = o, B = i.length, U;
16927
+ return C = o, B = i.length, w;
16923
16928
  }, this.beginShadows = function() {
16924
16929
  Q = !0, M(null);
16925
16930
  }, this.endShadows = function() {
16926
16931
  Q = !1;
16927
16932
  }, this.setGlobalState = function(i, o) {
16928
16933
  I = M(i, o, 0);
16929
- }, this.setState = function(i, o, U) {
16930
- const y = i.clippingPlanes, F = i.clipIntersection, w = i.clipShadows, s = g.get(i);
16931
- if (!C || y === null || y.length === 0 || Q && !w)
16934
+ }, this.setState = function(i, o, w) {
16935
+ const y = i.clippingPlanes, F = i.clipIntersection, U = i.clipShadows, s = g.get(i);
16936
+ if (!C || y === null || y.length === 0 || Q && !U)
16932
16937
  Q ? M(null) : R();
16933
16938
  else {
16934
16939
  const x = Q ? 0 : B, c = x * 4;
16935
16940
  let N = s.clippingState || null;
16936
- D.value = N, N = M(y, o, c, U);
16941
+ D.value = N, N = M(y, o, c, w);
16937
16942
  for (let S = 0; S !== c; ++S)
16938
16943
  N[S] = I[S];
16939
16944
  s.clippingState = N, this.numIntersection = F ? this.numPlanes : 0, this.numPlanes += x;
@@ -16942,19 +16947,19 @@ function NS(g) {
16942
16947
  function R() {
16943
16948
  D.value !== I && (D.value = I, D.needsUpdate = B > 0), A.numPlanes = B, A.numIntersection = 0;
16944
16949
  }
16945
- function M(i, o, U, y) {
16950
+ function M(i, o, w, y) {
16946
16951
  const F = i !== null ? i.length : 0;
16947
- let w = null;
16952
+ let U = null;
16948
16953
  if (F !== 0) {
16949
- if (w = D.value, y !== !0 || w === null) {
16950
- const s = U + F * 4, x = o.matrixWorldInverse;
16951
- G.getNormalMatrix(x), (w === null || w.length < s) && (w = new Float32Array(s));
16952
- for (let c = 0, N = U; c !== F; ++c, N += 4)
16953
- E.copy(i[c]).applyMatrix4(x, G), E.normal.toArray(w, N), w[N + 3] = E.constant;
16954
+ if (U = D.value, y !== !0 || U === null) {
16955
+ const s = w + F * 4, x = o.matrixWorldInverse;
16956
+ G.getNormalMatrix(x), (U === null || U.length < s) && (U = new Float32Array(s));
16957
+ for (let c = 0, N = w; c !== F; ++c, N += 4)
16958
+ E.copy(i[c]).applyMatrix4(x, G), E.normal.toArray(U, N), U[N + 3] = E.constant;
16954
16959
  }
16955
- D.value = w, D.needsUpdate = !0;
16960
+ D.value = U, D.needsUpdate = !0;
16956
16961
  }
16957
- return A.numPlanes = F, A.numIntersection = 0, w;
16962
+ return A.numPlanes = F, A.numIntersection = 0, U;
16958
16963
  }
16959
16964
  }
16960
16965
  function bS(g) {
@@ -17115,7 +17120,7 @@ class yi {
17115
17120
  this._renderer.compile(I, QQ);
17116
17121
  }
17117
17122
  _sceneToCubeUV(A, I, B, C, Q) {
17118
- const D = new bI(90, 1, I, B), R = [1, -1, 1, 1, 1, 1], M = [1, 1, 1, -1, -1, -1], i = this._renderer, o = i.autoClear, U = i.toneMapping;
17123
+ const D = new bI(90, 1, I, B), R = [1, -1, 1, 1, 1, 1], M = [1, 1, 1, -1, -1, -1], i = this._renderer, o = i.autoClear, w = i.toneMapping;
17119
17124
  i.getClearColor(Qs), i.toneMapping = Wg, i.autoClear = !1, i.state.buffers.depth.getReversed() && (i.setRenderTarget(C), i.clearDepth(), i.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new og(
17120
17125
  new VC(),
17121
17126
  new pw({
@@ -17125,17 +17130,17 @@ class yi {
17125
17130
  depthTest: !1
17126
17131
  })
17127
17132
  ));
17128
- const F = this._backgroundBox, w = F.material;
17133
+ const F = this._backgroundBox, U = F.material;
17129
17134
  let s = !1;
17130
17135
  const x = A.background;
17131
- x ? x.isColor && (w.color.copy(x), A.background = null, s = !0) : (w.color.copy(Qs), s = !0);
17136
+ x ? x.isColor && (U.color.copy(x), A.background = null, s = !0) : (U.color.copy(Qs), s = !0);
17132
17137
  for (let c = 0; c < 6; c++) {
17133
17138
  const N = c % 3;
17134
17139
  N === 0 ? (D.up.set(0, R[c], 0), D.position.set(Q.x, Q.y, Q.z), D.lookAt(Q.x + M[c], Q.y, Q.z)) : N === 1 ? (D.up.set(0, 0, R[c]), D.position.set(Q.x, Q.y, Q.z), D.lookAt(Q.x, Q.y + M[c], Q.z)) : (D.up.set(0, R[c], 0), D.position.set(Q.x, Q.y, Q.z), D.lookAt(Q.x, Q.y, Q.z + M[c]));
17135
17140
  const S = this._cubeSize;
17136
17141
  bC(C, N * S, c > 2 ? S : 0, S, S), i.setRenderTarget(C), s && i.render(F, D), i.render(A, D);
17137
17142
  }
17138
- i.toneMapping = U, i.autoClear = o, A.background = x;
17143
+ i.toneMapping = w, i.autoClear = o, A.background = x;
17139
17144
  }
17140
17145
  _textureToCubeUV(A, I) {
17141
17146
  const B = this._renderer, C = A.mapping === gC || A.mapping === dC;
@@ -17169,8 +17174,8 @@ class yi {
17169
17174
  _applyGGXFilter(A, I, B) {
17170
17175
  const C = this._renderer, Q = this._pingPongRenderTarget, E = this._ggxMaterial, G = this._lodMeshes[B];
17171
17176
  G.material = E;
17172
- const D = E.uniforms, R = B / (this._lodMeshes.length - 1), M = I / (this._lodMeshes.length - 1), i = Math.sqrt(R * R - M * M), o = 0 + R * 1.25, U = i * o, { _lodMax: y } = this, F = this._sizeLods[B], w = 3 * F * (B > y - kB ? B - y + kB : 0), s = 4 * (this._cubeSize - F);
17173
- D.envMap.value = A.texture, D.roughness.value = U, D.mipInt.value = y - I, bC(Q, w, s, 3 * F, 2 * F), C.setRenderTarget(Q), C.render(G, QQ), D.envMap.value = Q.texture, D.roughness.value = 0, D.mipInt.value = y - B, bC(A, w, s, 3 * F, 2 * F), C.setRenderTarget(A), C.render(G, QQ);
17177
+ const D = E.uniforms, R = B / (this._lodMeshes.length - 1), M = I / (this._lodMeshes.length - 1), i = Math.sqrt(R * R - M * M), o = 0 + R * 1.25, w = i * o, { _lodMax: y } = this, F = this._sizeLods[B], U = 3 * F * (B > y - kB ? B - y + kB : 0), s = 4 * (this._cubeSize - F);
17178
+ D.envMap.value = A.texture, D.roughness.value = w, D.mipInt.value = y - I, bC(Q, U, s, 3 * F, 2 * F), C.setRenderTarget(Q), C.render(G, QQ), D.envMap.value = Q.texture, D.roughness.value = 0, D.mipInt.value = y - B, bC(A, U, s, 3 * F, 2 * F), C.setRenderTarget(A), C.render(G, QQ);
17174
17179
  }
17175
17180
  /**
17176
17181
  * This is a two-pass Gaussian blur for a cubemap. Normally this is done
@@ -17215,17 +17220,17 @@ class yi {
17215
17220
  );
17216
17221
  const M = 3, i = this._lodMeshes[C];
17217
17222
  i.material = R;
17218
- const o = R.uniforms, U = this._sizeLods[B] - 1, y = isFinite(Q) ? Math.PI / (2 * U) : 2 * Math.PI / (2 * PB - 1), F = Q / y, w = isFinite(Q) ? 1 + Math.floor(M * F) : PB;
17219
- w > PB && ZA(`sigmaRadians, ${Q}, is too large and will clip, as it requested ${w} samples when the maximum is set to ${PB}`);
17223
+ const o = R.uniforms, w = this._sizeLods[B] - 1, y = isFinite(Q) ? Math.PI / (2 * w) : 2 * Math.PI / (2 * PB - 1), F = Q / y, U = isFinite(Q) ? 1 + Math.floor(M * F) : PB;
17224
+ U > PB && ZA(`sigmaRadians, ${Q}, is too large and will clip, as it requested ${U} samples when the maximum is set to ${PB}`);
17220
17225
  const s = [];
17221
17226
  let x = 0;
17222
17227
  for (let j = 0; j < PB; ++j) {
17223
17228
  const n = j / F, h = Math.exp(-n * n / 2);
17224
- s.push(h), j === 0 ? x += h : j < w && (x += 2 * h);
17229
+ s.push(h), j === 0 ? x += h : j < U && (x += 2 * h);
17225
17230
  }
17226
17231
  for (let j = 0; j < s.length; j++)
17227
17232
  s[j] = s[j] / x;
17228
- o.envMap.value = A.texture, o.samples.value = w, o.weights.value = s, o.latitudinal.value = E === "latitudinal", G && (o.poleAxis.value = G);
17233
+ o.envMap.value = A.texture, o.samples.value = U, o.weights.value = s, o.latitudinal.value = E === "latitudinal", G && (o.poleAxis.value = G);
17229
17234
  const { _lodMax: c } = this;
17230
17235
  o.dTheta.value = y, o.mipInt.value = c - B;
17231
17236
  const N = this._sizeLods[C], S = 3 * N * (C > c - kB ? C - c + kB : 0), a = 4 * (this._cubeSize - N);
@@ -17241,8 +17246,8 @@ function aS(g) {
17241
17246
  A.push(G);
17242
17247
  let D = 1 / G;
17243
17248
  E > g - kB ? D = Cs[E - g + kB - 1] : E === 0 && (D = 0), I.push(D);
17244
- const R = 1 / (G - 2), M = -R, i = 1 + R, o = [M, M, i, M, i, i, M, M, i, i, M, i], U = 6, y = 6, F = 3, w = 2, s = 1, x = new Float32Array(F * y * U), c = new Float32Array(w * y * U), N = new Float32Array(s * y * U);
17245
- for (let a = 0; a < U; a++) {
17249
+ const R = 1 / (G - 2), M = -R, i = 1 + R, o = [M, M, i, M, i, i, M, M, i, i, M, i], w = 6, y = 6, F = 3, U = 2, s = 1, x = new Float32Array(F * y * w), c = new Float32Array(U * y * w), N = new Float32Array(s * y * w);
17250
+ for (let a = 0; a < w; a++) {
17246
17251
  const j = a % 3 * 2 / 3 - 1, n = a > 2 ? 0 : -1, h = [
17247
17252
  j,
17248
17253
  n,
@@ -17263,12 +17268,12 @@ function aS(g) {
17263
17268
  n + 1,
17264
17269
  0
17265
17270
  ];
17266
- x.set(h, F * y * a), c.set(o, w * y * a);
17271
+ x.set(h, F * y * a), c.set(o, U * y * a);
17267
17272
  const Y = [a, a, a, a, a, a];
17268
17273
  N.set(Y, s * y * a);
17269
17274
  }
17270
17275
  const S = new wg();
17271
- S.setAttribute("position", new xg(x, F)), S.setAttribute("uv", new xg(c, w)), S.setAttribute("faceIndex", new xg(N, s)), B.push(new og(S, null)), C > kB && C--;
17276
+ S.setAttribute("position", new xg(x, F)), S.setAttribute("uv", new xg(c, U)), S.setAttribute("faceIndex", new xg(N, s)), B.push(new og(S, null)), C > kB && C--;
17272
17277
  }
17273
17278
  return { lodMeshes: B, sizeLods: A, sigmas: I };
17274
17279
  }
@@ -17642,8 +17647,8 @@ function HS(g) {
17642
17647
  if (i !== void 0)
17643
17648
  return i.texture;
17644
17649
  {
17645
- const U = G.image;
17646
- return R && U && U.height > 0 || M && U && C(U) ? (I === null && (I = new yi(g)), i = R ? I.fromEquirectangular(G) : I.fromCubemap(G), i.texture.pmremVersion = G.pmremVersion, A.set(G, i), G.addEventListener("dispose", Q), i.texture) : null;
17650
+ const w = G.image;
17651
+ return R && w && w.height > 0 || M && w && C(w) ? (I === null && (I = new yi(g)), i = R ? I.fromEquirectangular(G) : I.fromCubemap(G), i.texture.pmremVersion = G.pmremVersion, A.set(G, i), G.addEventListener("dispose", Q), i.texture) : null;
17647
17652
  }
17648
17653
  }
17649
17654
  }
@@ -17699,23 +17704,23 @@ function KS(g, A, I, B) {
17699
17704
  for (const y in o.attributes)
17700
17705
  A.remove(o.attributes[y]);
17701
17706
  o.removeEventListener("dispose", E), delete C[o.id];
17702
- const U = Q.get(o);
17703
- U && (A.remove(U), Q.delete(o)), B.releaseStatesOfGeometry(o), o.isInstancedBufferGeometry === !0 && delete o._maxInstanceCount, I.memory.geometries--;
17707
+ const w = Q.get(o);
17708
+ w && (A.remove(w), Q.delete(o)), B.releaseStatesOfGeometry(o), o.isInstancedBufferGeometry === !0 && delete o._maxInstanceCount, I.memory.geometries--;
17704
17709
  }
17705
17710
  function G(i, o) {
17706
17711
  return C[o.id] === !0 || (o.addEventListener("dispose", E), C[o.id] = !0, I.memory.geometries++), o;
17707
17712
  }
17708
17713
  function D(i) {
17709
17714
  const o = i.attributes;
17710
- for (const U in o)
17711
- A.update(o[U], g.ARRAY_BUFFER);
17715
+ for (const w in o)
17716
+ A.update(o[w], g.ARRAY_BUFFER);
17712
17717
  }
17713
17718
  function R(i) {
17714
- const o = [], U = i.index, y = i.attributes.position;
17719
+ const o = [], w = i.index, y = i.attributes.position;
17715
17720
  let F = 0;
17716
- if (U !== null) {
17717
- const x = U.array;
17718
- F = U.version;
17721
+ if (w !== null) {
17722
+ const x = w.array;
17723
+ F = w.version;
17719
17724
  for (let c = 0, N = x.length; c < N; c += 3) {
17720
17725
  const S = x[c + 0], a = x[c + 1], j = x[c + 2];
17721
17726
  o.push(S, a, a, j, j, S);
@@ -17729,16 +17734,16 @@ function KS(g, A, I, B) {
17729
17734
  }
17730
17735
  } else
17731
17736
  return;
17732
- const w = new (Zw(o) ? fw : uw)(o, 1);
17733
- w.version = F;
17737
+ const U = new (Zw(o) ? fw : uw)(o, 1);
17738
+ U.version = F;
17734
17739
  const s = Q.get(i);
17735
- s && A.remove(s), Q.set(i, w);
17740
+ s && A.remove(s), Q.set(i, U);
17736
17741
  }
17737
17742
  function M(i) {
17738
17743
  const o = Q.get(i);
17739
17744
  if (o) {
17740
- const U = i.index;
17741
- U !== null && o.version < U.version && R(i);
17745
+ const w = i.index;
17746
+ w !== null && o.version < w.version && R(i);
17742
17747
  } else
17743
17748
  R(i);
17744
17749
  return Q.get(i);
@@ -17758,31 +17763,31 @@ function nS(g, A, I) {
17758
17763
  function G(o) {
17759
17764
  Q = o.type, E = o.bytesPerElement;
17760
17765
  }
17761
- function D(o, U) {
17762
- g.drawElements(B, U, Q, o * E), I.update(U, B, 1);
17766
+ function D(o, w) {
17767
+ g.drawElements(B, w, Q, o * E), I.update(w, B, 1);
17763
17768
  }
17764
- function R(o, U, y) {
17765
- y !== 0 && (g.drawElementsInstanced(B, U, Q, o * E, y), I.update(U, B, y));
17769
+ function R(o, w, y) {
17770
+ y !== 0 && (g.drawElementsInstanced(B, w, Q, o * E, y), I.update(w, B, y));
17766
17771
  }
17767
- function M(o, U, y) {
17772
+ function M(o, w, y) {
17768
17773
  if (y === 0) return;
17769
- A.get("WEBGL_multi_draw").multiDrawElementsWEBGL(B, U, 0, Q, o, 0, y);
17770
- let w = 0;
17774
+ A.get("WEBGL_multi_draw").multiDrawElementsWEBGL(B, w, 0, Q, o, 0, y);
17775
+ let U = 0;
17771
17776
  for (let s = 0; s < y; s++)
17772
- w += U[s];
17773
- I.update(w, B, 1);
17777
+ U += w[s];
17778
+ I.update(U, B, 1);
17774
17779
  }
17775
- function i(o, U, y, F) {
17780
+ function i(o, w, y, F) {
17776
17781
  if (y === 0) return;
17777
- const w = A.get("WEBGL_multi_draw");
17778
- if (w === null)
17782
+ const U = A.get("WEBGL_multi_draw");
17783
+ if (U === null)
17779
17784
  for (let s = 0; s < o.length; s++)
17780
- R(o[s] / E, U[s], F[s]);
17785
+ R(o[s] / E, w[s], F[s]);
17781
17786
  else {
17782
- w.multiDrawElementsInstancedWEBGL(B, U, 0, Q, o, 0, F, 0, y);
17787
+ U.multiDrawElementsInstancedWEBGL(B, w, 0, Q, o, 0, F, 0, y);
17783
17788
  let s = 0;
17784
17789
  for (let x = 0; x < y; x++)
17785
- s += U[x] * F[x];
17790
+ s += w[x] * F[x];
17786
17791
  I.update(s, B, 1);
17787
17792
  }
17788
17793
  }
@@ -17843,19 +17848,19 @@ function JS(g, A, I) {
17843
17848
  j.dispose(), B.delete(G), G.removeEventListener("dispose", h);
17844
17849
  };
17845
17850
  o !== void 0 && o.texture.dispose();
17846
- const U = G.morphAttributes.position !== void 0, y = G.morphAttributes.normal !== void 0, F = G.morphAttributes.color !== void 0, w = G.morphAttributes.position || [], s = G.morphAttributes.normal || [], x = G.morphAttributes.color || [];
17851
+ const w = G.morphAttributes.position !== void 0, y = G.morphAttributes.normal !== void 0, F = G.morphAttributes.color !== void 0, U = G.morphAttributes.position || [], s = G.morphAttributes.normal || [], x = G.morphAttributes.color || [];
17847
17852
  let c = 0;
17848
- U === !0 && (c = 1), y === !0 && (c = 2), F === !0 && (c = 3);
17853
+ w === !0 && (c = 1), y === !0 && (c = 2), F === !0 && (c = 3);
17849
17854
  let N = G.attributes.position.count * c, S = 1;
17850
17855
  N > A.maxTextureSize && (S = Math.ceil(N / A.maxTextureSize), N = A.maxTextureSize);
17851
17856
  const a = new Float32Array(N * S * 4 * i), j = new Xg(a, N, S, i);
17852
17857
  j.type = Vg, j.needsUpdate = !0;
17853
17858
  const n = c * 4;
17854
17859
  for (let Y = 0; Y < i; Y++) {
17855
- const k = w[Y], l = s[Y], p = x[Y], m = N * S * 4 * Y;
17860
+ const k = U[Y], l = s[Y], p = x[Y], m = N * S * 4 * Y;
17856
17861
  for (let v = 0; v < k.count; v++) {
17857
17862
  const u = v * n;
17858
- U === !0 && (C.fromBufferAttribute(k, v), a[m + u + 0] = C.x, a[m + u + 1] = C.y, a[m + u + 2] = C.z, a[m + u + 3] = 0), y === !0 && (C.fromBufferAttribute(l, v), a[m + u + 4] = C.x, a[m + u + 5] = C.y, a[m + u + 6] = C.z, a[m + u + 7] = 0), F === !0 && (C.fromBufferAttribute(p, v), a[m + u + 8] = C.x, a[m + u + 9] = C.y, a[m + u + 10] = C.z, a[m + u + 11] = p.itemSize === 4 ? C.w : 1);
17863
+ w === !0 && (C.fromBufferAttribute(k, v), a[m + u + 0] = C.x, a[m + u + 1] = C.y, a[m + u + 2] = C.z, a[m + u + 3] = 0), y === !0 && (C.fromBufferAttribute(l, v), a[m + u + 4] = C.x, a[m + u + 5] = C.y, a[m + u + 6] = C.z, a[m + u + 7] = 0), F === !0 && (C.fromBufferAttribute(p, v), a[m + u + 8] = C.x, a[m + u + 9] = C.y, a[m + u + 10] = C.z, a[m + u + 11] = p.itemSize === 4 ? C.w : 1);
17859
17864
  }
17860
17865
  }
17861
17866
  o = {
@@ -17867,10 +17872,10 @@ function JS(g, A, I) {
17867
17872
  if (E.isInstancedMesh === !0 && E.morphTexture !== null)
17868
17873
  D.getUniforms().setValue(g, "morphTexture", E.morphTexture, I);
17869
17874
  else {
17870
- let U = 0;
17875
+ let w = 0;
17871
17876
  for (let F = 0; F < R.length; F++)
17872
- U += R[F];
17873
- const y = G.morphTargetsRelative ? 1 : 1 - U;
17877
+ w += R[F];
17878
+ const y = G.morphTargetsRelative ? 1 : 1 - w;
17874
17879
  D.getUniforms().setValue(g, "morphTargetBaseInfluence", y), D.getUniforms().setValue(g, "morphTargetInfluences", R);
17875
17880
  }
17876
17881
  D.getUniforms().setValue(g, "morphTargetsTexture", o.texture, I), D.getUniforms().setValue(g, "morphTargetsTextureSize", o.size);
@@ -17982,22 +17987,22 @@ function dS(g, A, I, B, C) {
17982
17987
  depthTest: !1,
17983
17988
  depthWrite: !1
17984
17989
  }), R = new og(G, D), M = new bQ(-1, 1, 1, -1, 0, 1);
17985
- let i = null, o = null, U = !1, y, F = null, w = [], s = !1;
17990
+ let i = null, o = null, w = !1, y, F = null, U = [], s = !1;
17986
17991
  this.setSize = function(x, c) {
17987
17992
  Q.setSize(x, c), E.setSize(x, c);
17988
- for (let N = 0; N < w.length; N++) {
17989
- const S = w[N];
17993
+ for (let N = 0; N < U.length; N++) {
17994
+ const S = U[N];
17990
17995
  S.setSize && S.setSize(x, c);
17991
17996
  }
17992
17997
  }, this.setEffects = function(x) {
17993
- w = x, s = w.length > 0 && w[0].isRenderPass === !0;
17998
+ U = x, s = U.length > 0 && U[0].isRenderPass === !0;
17994
17999
  const c = Q.width, N = Q.height;
17995
- for (let S = 0; S < w.length; S++) {
17996
- const a = w[S];
18000
+ for (let S = 0; S < U.length; S++) {
18001
+ const a = U[S];
17997
18002
  a.setSize && a.setSize(c, N);
17998
18003
  }
17999
18004
  }, this.begin = function(x, c) {
18000
- if (U || x.toneMapping === Wg && w.length === 0) return !1;
18005
+ if (w || x.toneMapping === Wg && U.length === 0) return !1;
18001
18006
  if (F = c, c !== null) {
18002
18007
  const N = c.width, S = c.height;
18003
18008
  (Q.width !== N || Q.height !== S) && this.setSize(N, S);
@@ -18006,10 +18011,10 @@ function dS(g, A, I, B, C) {
18006
18011
  }, this.hasRenderPass = function() {
18007
18012
  return s;
18008
18013
  }, this.end = function(x, c) {
18009
- x.toneMapping = y, U = !0;
18014
+ x.toneMapping = y, w = !0;
18010
18015
  let N = Q, S = E;
18011
- for (let a = 0; a < w.length; a++) {
18012
- const j = w[a];
18016
+ for (let a = 0; a < U.length; a++) {
18017
+ const j = U[a];
18013
18018
  if (j.enabled !== !1 && (j.render(x, S, N, c), j.needsSwap !== !1)) {
18014
18019
  const n = N;
18015
18020
  N = S, S = n;
@@ -18020,9 +18025,9 @@ function dS(g, A, I, B, C) {
18020
18025
  const a = rS[o];
18021
18026
  a && (D.defines[a] = ""), D.needsUpdate = !0;
18022
18027
  }
18023
- D.uniforms.tDiffuse.value = N.texture, x.setRenderTarget(F), x.render(R, M), F = null, U = !1;
18028
+ D.uniforms.tDiffuse.value = N.texture, x.setRenderTarget(F), x.render(R, M), F = null, w = !1;
18024
18029
  }, this.isCompositing = function() {
18025
- return U;
18030
+ return w;
18026
18031
  }, this.dispose = function() {
18027
18032
  Q.dispose(), E.dispose(), G.dispose(), D.dispose();
18028
18033
  };
@@ -18728,22 +18733,22 @@ function _a(g) {
18728
18733
  function $a(g, A, I, B) {
18729
18734
  const C = g.getContext(), Q = I.defines;
18730
18735
  let E = I.vertexShader, G = I.fragmentShader;
18731
- const D = Va(I), R = va(I), M = Xa(I), i = Pa(I), o = _a(I), U = ra(I), y = da(Q), F = C.createProgram();
18732
- let w, s, x = I.glslVersion ? "#version " + I.glslVersion + `
18736
+ const D = Va(I), R = va(I), M = Xa(I), i = Pa(I), o = _a(I), w = ra(I), y = da(Q), F = C.createProgram();
18737
+ let U, s, x = I.glslVersion ? "#version " + I.glslVersion + `
18733
18738
  ` : "";
18734
- I.isRawShaderMaterial ? (w = [
18739
+ I.isRawShaderMaterial ? (U = [
18735
18740
  "#define SHADER_TYPE " + I.shaderType,
18736
18741
  "#define SHADER_NAME " + I.shaderName,
18737
18742
  y
18738
18743
  ].filter(DQ).join(`
18739
- `), w.length > 0 && (w += `
18744
+ `), U.length > 0 && (U += `
18740
18745
  `), s = [
18741
18746
  "#define SHADER_TYPE " + I.shaderType,
18742
18747
  "#define SHADER_NAME " + I.shaderName,
18743
18748
  y
18744
18749
  ].filter(DQ).join(`
18745
18750
  `), s.length > 0 && (s += `
18746
- `)) : (w = [
18751
+ `)) : (U = [
18747
18752
  hs(I),
18748
18753
  "#define SHADER_TYPE " + I.shaderType,
18749
18754
  "#define SHADER_NAME " + I.shaderName,
@@ -18961,14 +18966,14 @@ function $a(g, A, I, B) {
18961
18966
  `
18962
18967
  ].filter(DQ).join(`
18963
18968
  `)), E = ti(E), E = ts(E, I), E = cs(E, I), G = ti(G), G = ts(G, I), G = cs(G, I), E = xs(E), G = xs(G), I.isRawShaderMaterial !== !0 && (x = `#version 300 es
18964
- `, w = [
18965
- U,
18969
+ `, U = [
18970
+ w,
18966
18971
  "#define attribute in",
18967
18972
  "#define varying out",
18968
18973
  "#define texture2D texture"
18969
18974
  ].join(`
18970
18975
  `) + `
18971
- ` + w, s = [
18976
+ ` + U, s = [
18972
18977
  "#define varying in",
18973
18978
  I.glslVersion === kE ? "" : "layout(location = 0) out highp vec4 pc_fragColor;",
18974
18979
  I.glslVersion === kE ? "" : "#define gl_FragColor pc_fragColor",
@@ -18985,7 +18990,7 @@ function $a(g, A, I, B) {
18985
18990
  ].join(`
18986
18991
  `) + `
18987
18992
  ` + s);
18988
- const c = x + w + E, N = x + s + G, S = Us(C, C.VERTEX_SHADER, c), a = Us(C, C.FRAGMENT_SHADER, N);
18993
+ const c = x + U + E, N = x + s + G, S = Us(C, C.VERTEX_SHADER, c), a = Us(C, C.FRAGMENT_SHADER, N);
18989
18994
  C.attachShader(F, S), C.attachShader(F, a), I.index0AttributeName !== void 0 ? C.bindAttribLocation(F, 0, I.index0AttributeName) : I.morphTargets === !0 && C.bindAttribLocation(F, 0, "position"), C.linkProgram(F);
18990
18995
  function j(k) {
18991
18996
  if (g.debug.checkShaderErrors) {
@@ -19013,7 +19018,7 @@ Program Info Log: ` + v + `
19013
19018
  programLog: v,
19014
19019
  vertexShader: {
19015
19020
  log: u,
19016
- prefix: w
19021
+ prefix: U
19017
19022
  },
19018
19023
  fragmentShader: {
19019
19024
  log: f,
@@ -19080,7 +19085,7 @@ class gL {
19080
19085
  }
19081
19086
  function BL(g, A, I, B, C, Q, E) {
19082
19087
  const G = new Wi(), D = new IL(), R = /* @__PURE__ */ new Set(), M = [], i = /* @__PURE__ */ new Map(), o = C.logarithmicDepthBuffer;
19083
- let U = C.precision;
19088
+ let w = C.precision;
19084
19089
  const y = {
19085
19090
  MeshDepthMaterial: "depth",
19086
19091
  MeshDistanceMaterial: "distance",
@@ -19101,9 +19106,9 @@ function BL(g, A, I, B, C, Q, E) {
19101
19106
  function F(h) {
19102
19107
  return R.add(h), h === 0 ? "uv" : `uv${h}`;
19103
19108
  }
19104
- function w(h, Y, k, l, p) {
19109
+ function U(h, Y, k, l, p) {
19105
19110
  const m = l.fog, v = p.geometry, u = h.isMeshStandardMaterial ? l.environment : null, f = (h.isMeshStandardMaterial ? I : A).get(h.envMap || u), z = f && f.mapping === fE ? f.image.height : null, IA = y[h.type];
19106
- h.precision !== null && (U = C.getMaxPrecision(h.precision), U !== h.precision && ZA("WebGLProgram.getParameters:", h.precision, "not supported, using", U, "instead."));
19111
+ h.precision !== null && (w = C.getMaxPrecision(h.precision), w !== h.precision && ZA("WebGLProgram.getParameters:", h.precision, "not supported, using", w, "instead."));
19107
19112
  const gA = v.morphAttributes.position || v.morphAttributes.normal || v.morphAttributes.color, CA = gA !== void 0 ? gA.length : 0;
19108
19113
  let KA = 0;
19109
19114
  v.morphAttributes.position !== void 0 && (KA = 1), v.morphAttributes.normal !== void 0 && (KA = 2), v.morphAttributes.color !== void 0 && (KA = 3);
@@ -19127,7 +19132,7 @@ function BL(g, A, I, B, C, Q, E) {
19127
19132
  customFragmentShaderID: W,
19128
19133
  isRawShaderMaterial: h.isRawShaderMaterial === !0,
19129
19134
  glslVersion: h.glslVersion,
19130
- precision: U,
19135
+ precision: w,
19131
19136
  batching: wA,
19132
19137
  batchingColor: wA && p._colorsTexture !== null,
19133
19138
  instancing: aA,
@@ -19289,7 +19294,7 @@ function BL(g, A, I, B, C, Q, E) {
19289
19294
  D.dispose();
19290
19295
  }
19291
19296
  return {
19292
- getParameters: w,
19297
+ getParameters: U,
19293
19298
  getProgramCacheKey: s,
19294
19299
  getUniforms: N,
19295
19300
  acquireProgram: S,
@@ -19339,35 +19344,35 @@ function bs() {
19339
19344
  function Q() {
19340
19345
  A = 0, I.length = 0, B.length = 0, C.length = 0;
19341
19346
  }
19342
- function E(i, o, U, y, F, w) {
19347
+ function E(i, o, w, y, F, U) {
19343
19348
  let s = g[A];
19344
19349
  return s === void 0 ? (s = {
19345
19350
  id: i.id,
19346
19351
  object: i,
19347
19352
  geometry: o,
19348
- material: U,
19353
+ material: w,
19349
19354
  groupOrder: y,
19350
19355
  renderOrder: i.renderOrder,
19351
19356
  z: F,
19352
- group: w
19353
- }, g[A] = s) : (s.id = i.id, s.object = i, s.geometry = o, s.material = U, s.groupOrder = y, s.renderOrder = i.renderOrder, s.z = F, s.group = w), A++, s;
19357
+ group: U
19358
+ }, g[A] = s) : (s.id = i.id, s.object = i, s.geometry = o, s.material = w, s.groupOrder = y, s.renderOrder = i.renderOrder, s.z = F, s.group = U), A++, s;
19354
19359
  }
19355
- function G(i, o, U, y, F, w) {
19356
- const s = E(i, o, U, y, F, w);
19357
- U.transmission > 0 ? B.push(s) : U.transparent === !0 ? C.push(s) : I.push(s);
19360
+ function G(i, o, w, y, F, U) {
19361
+ const s = E(i, o, w, y, F, U);
19362
+ w.transmission > 0 ? B.push(s) : w.transparent === !0 ? C.push(s) : I.push(s);
19358
19363
  }
19359
- function D(i, o, U, y, F, w) {
19360
- const s = E(i, o, U, y, F, w);
19361
- U.transmission > 0 ? B.unshift(s) : U.transparent === !0 ? C.unshift(s) : I.unshift(s);
19364
+ function D(i, o, w, y, F, U) {
19365
+ const s = E(i, o, w, y, F, U);
19366
+ w.transmission > 0 ? B.unshift(s) : w.transparent === !0 ? C.unshift(s) : I.unshift(s);
19362
19367
  }
19363
19368
  function R(i, o) {
19364
19369
  I.length > 1 && I.sort(i || QL), B.length > 1 && B.sort(o || Ns), C.length > 1 && C.sort(o || Ns);
19365
19370
  }
19366
19371
  function M() {
19367
19372
  for (let i = A, o = g.length; i < o; i++) {
19368
- const U = g[i];
19369
- if (U.id === null) break;
19370
- U.id = null, U.object = null, U.geometry = null, U.material = null, U.group = null;
19373
+ const w = g[i];
19374
+ if (w.id === null) break;
19375
+ w.id = null, w.object = null, w.geometry = null, w.material = null, w.group = null;
19371
19376
  }
19372
19377
  }
19373
19378
  return {
@@ -19537,7 +19542,7 @@ function ML(g) {
19537
19542
  function G(R) {
19538
19543
  let M = 0, i = 0, o = 0;
19539
19544
  for (let h = 0; h < 9; h++) B.probe[h].set(0, 0, 0);
19540
- let U = 0, y = 0, F = 0, w = 0, s = 0, x = 0, c = 0, N = 0, S = 0, a = 0, j = 0;
19545
+ let w = 0, y = 0, F = 0, U = 0, s = 0, x = 0, c = 0, N = 0, S = 0, a = 0, j = 0;
19541
19546
  R.sort(iL);
19542
19547
  for (let h = 0, Y = R.length; h < Y; h++) {
19543
19548
  const k = R[h], l = k.color, p = k.intensity, m = k.distance;
@@ -19552,9 +19557,9 @@ function ML(g) {
19552
19557
  const u = A.get(k);
19553
19558
  if (u.color.copy(k.color).multiplyScalar(k.intensity), k.castShadow) {
19554
19559
  const f = k.shadow, z = I.get(k);
19555
- z.shadowIntensity = f.intensity, z.shadowBias = f.bias, z.shadowNormalBias = f.normalBias, z.shadowRadius = f.radius, z.shadowMapSize = f.mapSize, B.directionalShadow[U] = z, B.directionalShadowMap[U] = v, B.directionalShadowMatrix[U] = k.shadow.matrix, x++;
19560
+ z.shadowIntensity = f.intensity, z.shadowBias = f.bias, z.shadowNormalBias = f.normalBias, z.shadowRadius = f.radius, z.shadowMapSize = f.mapSize, B.directionalShadow[w] = z, B.directionalShadowMap[w] = v, B.directionalShadowMatrix[w] = k.shadow.matrix, x++;
19556
19561
  }
19557
- B.directional[U] = u, U++;
19562
+ B.directional[w] = u, w++;
19558
19563
  } else if (k.isSpotLight) {
19559
19564
  const u = A.get(k);
19560
19565
  u.position.setFromMatrixPosition(k.matrixWorld), u.color.copy(l).multiplyScalar(p), u.distance = m, u.coneCos = Math.cos(k.angle), u.penumbraCos = Math.cos(k.angle * (1 - k.penumbra)), u.decay = k.decay, B.spot[F] = u;
@@ -19566,7 +19571,7 @@ function ML(g) {
19566
19571
  F++;
19567
19572
  } else if (k.isRectAreaLight) {
19568
19573
  const u = A.get(k);
19569
- u.color.copy(l).multiplyScalar(p), u.halfWidth.set(k.width * 0.5, 0, 0), u.halfHeight.set(0, k.height * 0.5, 0), B.rectArea[w] = u, w++;
19574
+ u.color.copy(l).multiplyScalar(p), u.halfWidth.set(k.width * 0.5, 0, 0), u.halfHeight.set(0, k.height * 0.5, 0), B.rectArea[U] = u, U++;
19570
19575
  } else if (k.isPointLight) {
19571
19576
  const u = A.get(k);
19572
19577
  if (u.color.copy(k.color).multiplyScalar(k.intensity), u.distance = k.distance, u.decay = k.decay, k.castShadow) {
@@ -19579,30 +19584,30 @@ function ML(g) {
19579
19584
  u.skyColor.copy(k.color).multiplyScalar(p), u.groundColor.copy(k.groundColor).multiplyScalar(p), B.hemi[s] = u, s++;
19580
19585
  }
19581
19586
  }
19582
- w > 0 && (g.has("OES_texture_float_linear") === !0 ? (B.rectAreaLTC1 = iA.LTC_FLOAT_1, B.rectAreaLTC2 = iA.LTC_FLOAT_2) : (B.rectAreaLTC1 = iA.LTC_HALF_1, B.rectAreaLTC2 = iA.LTC_HALF_2)), B.ambient[0] = M, B.ambient[1] = i, B.ambient[2] = o;
19587
+ U > 0 && (g.has("OES_texture_float_linear") === !0 ? (B.rectAreaLTC1 = iA.LTC_FLOAT_1, B.rectAreaLTC2 = iA.LTC_FLOAT_2) : (B.rectAreaLTC1 = iA.LTC_HALF_1, B.rectAreaLTC2 = iA.LTC_HALF_2)), B.ambient[0] = M, B.ambient[1] = i, B.ambient[2] = o;
19583
19588
  const n = B.hash;
19584
- (n.directionalLength !== U || n.pointLength !== y || n.spotLength !== F || n.rectAreaLength !== w || n.hemiLength !== s || n.numDirectionalShadows !== x || n.numPointShadows !== c || n.numSpotShadows !== N || n.numSpotMaps !== S || n.numLightProbes !== j) && (B.directional.length = U, B.spot.length = F, B.rectArea.length = w, B.point.length = y, B.hemi.length = s, B.directionalShadow.length = x, B.directionalShadowMap.length = x, B.pointShadow.length = c, B.pointShadowMap.length = c, B.spotShadow.length = N, B.spotShadowMap.length = N, B.directionalShadowMatrix.length = x, B.pointShadowMatrix.length = c, B.spotLightMatrix.length = N + S - a, B.spotLightMap.length = S, B.numSpotLightShadowsWithMaps = a, B.numLightProbes = j, n.directionalLength = U, n.pointLength = y, n.spotLength = F, n.rectAreaLength = w, n.hemiLength = s, n.numDirectionalShadows = x, n.numPointShadows = c, n.numSpotShadows = N, n.numSpotMaps = S, n.numLightProbes = j, B.version = DL++);
19589
+ (n.directionalLength !== w || n.pointLength !== y || n.spotLength !== F || n.rectAreaLength !== U || n.hemiLength !== s || n.numDirectionalShadows !== x || n.numPointShadows !== c || n.numSpotShadows !== N || n.numSpotMaps !== S || n.numLightProbes !== j) && (B.directional.length = w, B.spot.length = F, B.rectArea.length = U, B.point.length = y, B.hemi.length = s, B.directionalShadow.length = x, B.directionalShadowMap.length = x, B.pointShadow.length = c, B.pointShadowMap.length = c, B.spotShadow.length = N, B.spotShadowMap.length = N, B.directionalShadowMatrix.length = x, B.pointShadowMatrix.length = c, B.spotLightMatrix.length = N + S - a, B.spotLightMap.length = S, B.numSpotLightShadowsWithMaps = a, B.numLightProbes = j, n.directionalLength = w, n.pointLength = y, n.spotLength = F, n.rectAreaLength = U, n.hemiLength = s, n.numDirectionalShadows = x, n.numPointShadows = c, n.numSpotShadows = N, n.numSpotMaps = S, n.numLightProbes = j, B.version = DL++);
19585
19590
  }
19586
19591
  function D(R, M) {
19587
- let i = 0, o = 0, U = 0, y = 0, F = 0;
19588
- const w = M.matrixWorldInverse;
19592
+ let i = 0, o = 0, w = 0, y = 0, F = 0;
19593
+ const U = M.matrixWorldInverse;
19589
19594
  for (let s = 0, x = R.length; s < x; s++) {
19590
19595
  const c = R[s];
19591
19596
  if (c.isDirectionalLight) {
19592
19597
  const N = B.directional[i];
19593
- N.direction.setFromMatrixPosition(c.matrixWorld), C.setFromMatrixPosition(c.target.matrixWorld), N.direction.sub(C), N.direction.transformDirection(w), i++;
19598
+ N.direction.setFromMatrixPosition(c.matrixWorld), C.setFromMatrixPosition(c.target.matrixWorld), N.direction.sub(C), N.direction.transformDirection(U), i++;
19594
19599
  } else if (c.isSpotLight) {
19595
- const N = B.spot[U];
19596
- N.position.setFromMatrixPosition(c.matrixWorld), N.position.applyMatrix4(w), N.direction.setFromMatrixPosition(c.matrixWorld), C.setFromMatrixPosition(c.target.matrixWorld), N.direction.sub(C), N.direction.transformDirection(w), U++;
19600
+ const N = B.spot[w];
19601
+ N.position.setFromMatrixPosition(c.matrixWorld), N.position.applyMatrix4(U), N.direction.setFromMatrixPosition(c.matrixWorld), C.setFromMatrixPosition(c.target.matrixWorld), N.direction.sub(C), N.direction.transformDirection(U), w++;
19597
19602
  } else if (c.isRectAreaLight) {
19598
19603
  const N = B.rectArea[y];
19599
- N.position.setFromMatrixPosition(c.matrixWorld), N.position.applyMatrix4(w), E.identity(), Q.copy(c.matrixWorld), Q.premultiply(w), E.extractRotation(Q), N.halfWidth.set(c.width * 0.5, 0, 0), N.halfHeight.set(0, c.height * 0.5, 0), N.halfWidth.applyMatrix4(E), N.halfHeight.applyMatrix4(E), y++;
19604
+ N.position.setFromMatrixPosition(c.matrixWorld), N.position.applyMatrix4(U), E.identity(), Q.copy(c.matrixWorld), Q.premultiply(U), E.extractRotation(Q), N.halfWidth.set(c.width * 0.5, 0, 0), N.halfHeight.set(0, c.height * 0.5, 0), N.halfWidth.applyMatrix4(E), N.halfHeight.applyMatrix4(E), y++;
19600
19605
  } else if (c.isPointLight) {
19601
19606
  const N = B.point[o];
19602
- N.position.setFromMatrixPosition(c.matrixWorld), N.position.applyMatrix4(w), o++;
19607
+ N.position.setFromMatrixPosition(c.matrixWorld), N.position.applyMatrix4(U), o++;
19603
19608
  } else if (c.isHemisphereLight) {
19604
19609
  const N = B.hemi[F];
19605
- N.direction.setFromMatrixPosition(c.matrixWorld), N.direction.transformDirection(w), F++;
19610
+ N.direction.setFromMatrixPosition(c.matrixWorld), N.direction.transformDirection(U), F++;
19606
19611
  }
19607
19612
  }
19608
19613
  }
@@ -19715,8 +19720,8 @@ function FL(g, A, I) {
19715
19720
  },
19716
19721
  vertexShader: sL,
19717
19722
  fragmentShader: wL
19718
- }), U = o.clone();
19719
- U.defines.HORIZONTAL_PASS = 1;
19723
+ }), w = o.clone();
19724
+ w.defines.HORIZONTAL_PASS = 1;
19720
19725
  const y = new wg();
19721
19726
  y.setAttribute(
19722
19727
  "position",
@@ -19725,11 +19730,11 @@ function FL(g, A, I) {
19725
19730
  3
19726
19731
  )
19727
19732
  );
19728
- const F = new og(y, o), w = this;
19733
+ const F = new og(y, o), U = this;
19729
19734
  this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = FE;
19730
19735
  let s = this.type;
19731
19736
  this.render = function(a, j, n) {
19732
- if (w.enabled === !1 || w.autoUpdate === !1 && w.needsUpdate === !1 || a.length === 0) return;
19737
+ if (U.enabled === !1 || U.autoUpdate === !1 && U.needsUpdate === !1 || a.length === 0) return;
19733
19738
  a.type === ch && (ZA("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."), a.type = FE);
19734
19739
  const h = g.getRenderTarget(), Y = g.getActiveCubeFace(), k = g.getActiveMipmapLevel(), l = g.state;
19735
19740
  l.setBlending(RB), l.buffers.depth.getReversed() === !0 ? l.buffers.color.setClear(0, 0, 0, 0) : l.buffers.color.setClear(1, 1, 1, 1), l.buffers.depth.setTest(!0), l.setScissorTest(!1);
@@ -19789,14 +19794,14 @@ function FL(g, A, I) {
19789
19794
  }
19790
19795
  f.isPointLightShadow !== !0 && this.type === RQ && x(f, n), f.needsUpdate = !1;
19791
19796
  }
19792
- s = this.type, w.needsUpdate = !1, g.setRenderTarget(h, Y, k);
19797
+ s = this.type, U.needsUpdate = !1, g.setRenderTarget(h, Y, k);
19793
19798
  };
19794
19799
  function x(a, j) {
19795
19800
  const n = A.update(F);
19796
- o.defines.VSM_SAMPLES !== a.blurSamples && (o.defines.VSM_SAMPLES = a.blurSamples, U.defines.VSM_SAMPLES = a.blurSamples, o.needsUpdate = !0, U.needsUpdate = !0), a.mapPass === null && (a.mapPass = new cg(C.x, C.y, {
19801
+ o.defines.VSM_SAMPLES !== a.blurSamples && (o.defines.VSM_SAMPLES = a.blurSamples, w.defines.VSM_SAMPLES = a.blurSamples, o.needsUpdate = !0, w.needsUpdate = !0), a.mapPass === null && (a.mapPass = new cg(C.x, C.y, {
19797
19802
  format: lC,
19798
19803
  type: oB
19799
- })), o.uniforms.shadow_pass.value = a.map.depthTexture, o.uniforms.resolution.value = a.mapSize, o.uniforms.radius.value = a.radius, g.setRenderTarget(a.mapPass), g.clear(), g.renderBufferDirect(j, null, n, o, F, null), U.uniforms.shadow_pass.value = a.mapPass.texture, U.uniforms.resolution.value = a.mapSize, U.uniforms.radius.value = a.radius, g.setRenderTarget(a.map), g.clear(), g.renderBufferDirect(j, null, n, U, F, null);
19804
+ })), o.uniforms.shadow_pass.value = a.map.depthTexture, o.uniforms.resolution.value = a.mapSize, o.uniforms.radius.value = a.radius, g.setRenderTarget(a.mapPass), g.clear(), g.renderBufferDirect(j, null, n, o, F, null), w.uniforms.shadow_pass.value = a.mapPass.texture, w.uniforms.resolution.value = a.mapSize, w.uniforms.radius.value = a.radius, g.setRenderTarget(a.map), g.clear(), g.renderBufferDirect(j, null, n, w, F, null);
19800
19805
  }
19801
19806
  function c(a, j, n, h) {
19802
19807
  let Y = null;
@@ -19969,7 +19974,7 @@ function cL(g, A) {
19969
19974
  };
19970
19975
  }
19971
19976
  const Q = new I(), E = new B(), G = new C(), D = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap();
19972
- let M = {}, i = {}, o = /* @__PURE__ */ new WeakMap(), U = [], y = null, F = !1, w = null, s = null, x = null, c = null, N = null, S = null, a = null, j = new VA(0, 0, 0), n = 0, h = !1, Y = null, k = null, l = null, p = null, m = null;
19977
+ let M = {}, i = {}, o = /* @__PURE__ */ new WeakMap(), w = [], y = null, F = !1, U = null, s = null, x = null, c = null, N = null, S = null, a = null, j = new VA(0, 0, 0), n = 0, h = !1, Y = null, k = null, l = null, p = null, m = null;
19973
19978
  const v = g.getParameter(g.MAX_COMBINED_TEXTURE_IMAGE_UNITS);
19974
19979
  let u = !1, f = 0;
19975
19980
  const z = g.getParameter(g.VERSION);
@@ -19995,7 +20000,7 @@ function cL(g, A) {
19995
20000
  return i[e] !== sA ? (g.bindFramebuffer(e, sA), i[e] = sA, e === g.DRAW_FRAMEBUFFER && (i[g.FRAMEBUFFER] = sA), e === g.FRAMEBUFFER && (i[g.DRAW_FRAMEBUFFER] = sA), !0) : !1;
19996
20001
  }
19997
20002
  function wA(e, sA) {
19998
- let BA = U, UA = !1;
20003
+ let BA = w, UA = !1;
19999
20004
  if (e) {
20000
20005
  BA = o.get(sA), BA === void 0 && (BA = [], o.set(sA, BA));
20001
20006
  const $ = e.textures;
@@ -20040,7 +20045,7 @@ function cL(g, A) {
20040
20045
  return;
20041
20046
  }
20042
20047
  if (F === !1 && (O(g.BLEND), F = !0), e !== xh) {
20043
- if (e !== w || DI !== h) {
20048
+ if (e !== U || DI !== h) {
20044
20049
  if ((s !== zB || N !== zB) && (g.blendEquation(g.FUNC_ADD), s = zB, N = zB), DI)
20045
20050
  switch (e) {
20046
20051
  case KC:
@@ -20077,11 +20082,11 @@ function cL(g, A) {
20077
20082
  AI("WebGLState: Invalid blending: ", e);
20078
20083
  break;
20079
20084
  }
20080
- x = null, c = null, S = null, a = null, j.set(0, 0, 0), n = 0, w = e, h = DI;
20085
+ x = null, c = null, S = null, a = null, j.set(0, 0, 0), n = 0, U = e, h = DI;
20081
20086
  }
20082
20087
  return;
20083
20088
  }
20084
- $ = $ || sA, P = P || BA, EA = EA || UA, (sA !== s || $ !== N) && (g.blendEquationSeparate(yI[sA], yI[$]), s = sA, N = $), (BA !== x || UA !== c || P !== S || EA !== a) && (g.blendFuncSeparate(qA[BA], qA[UA], qA[P], qA[EA]), x = BA, c = UA, S = P, a = EA), (uA.equals(j) === !1 || xI !== n) && (g.blendColor(uA.r, uA.g, uA.b, xI), j.copy(uA), n = xI), w = e, h = !1;
20089
+ $ = $ || sA, P = P || BA, EA = EA || UA, (sA !== s || $ !== N) && (g.blendEquationSeparate(yI[sA], yI[$]), s = sA, N = $), (BA !== x || UA !== c || P !== S || EA !== a) && (g.blendFuncSeparate(qA[BA], qA[UA], qA[P], qA[EA]), x = BA, c = UA, S = P, a = EA), (uA.equals(j) === !1 || xI !== n) && (g.blendColor(uA.r, uA.g, uA.b, xI), j.copy(uA), n = xI), U = e, h = !1;
20085
20090
  }
20086
20091
  function zA(e, sA) {
20087
20092
  e.side === Tg ? MA(g.CULL_FACE) : O(g.CULL_FACE);
@@ -20204,7 +20209,7 @@ function cL(g, A) {
20204
20209
  D.get(sA) !== UA && (g.uniformBlockBinding(sA, UA, e.__bindingPointIndex), D.set(sA, UA));
20205
20210
  }
20206
20211
  function mA() {
20207
- g.disable(g.BLEND), g.disable(g.CULL_FACE), g.disable(g.DEPTH_TEST), g.disable(g.POLYGON_OFFSET_FILL), g.disable(g.SCISSOR_TEST), g.disable(g.STENCIL_TEST), g.disable(g.SAMPLE_ALPHA_TO_COVERAGE), g.blendEquation(g.FUNC_ADD), g.blendFunc(g.ONE, g.ZERO), g.blendFuncSeparate(g.ONE, g.ZERO, g.ONE, g.ZERO), g.blendColor(0, 0, 0, 0), g.colorMask(!0, !0, !0, !0), g.clearColor(0, 0, 0, 0), g.depthMask(!0), g.depthFunc(g.LESS), E.setReversed(!1), g.clearDepth(1), g.stencilMask(4294967295), g.stencilFunc(g.ALWAYS, 0, 4294967295), g.stencilOp(g.KEEP, g.KEEP, g.KEEP), g.clearStencil(0), g.cullFace(g.BACK), g.frontFace(g.CCW), g.polygonOffset(0, 0), g.activeTexture(g.TEXTURE0), g.bindFramebuffer(g.FRAMEBUFFER, null), g.bindFramebuffer(g.DRAW_FRAMEBUFFER, null), g.bindFramebuffer(g.READ_FRAMEBUFFER, null), g.useProgram(null), g.lineWidth(1), g.scissor(0, 0, g.canvas.width, g.canvas.height), g.viewport(0, 0, g.canvas.width, g.canvas.height), M = {}, IA = null, gA = {}, i = {}, o = /* @__PURE__ */ new WeakMap(), U = [], y = null, F = !1, w = null, s = null, x = null, c = null, N = null, S = null, a = null, j = new VA(0, 0, 0), n = 0, h = !1, Y = null, k = null, l = null, p = null, m = null, SA.set(0, 0, g.canvas.width, g.canvas.height), PA.set(0, 0, g.canvas.width, g.canvas.height), Q.reset(), E.reset(), G.reset();
20212
+ g.disable(g.BLEND), g.disable(g.CULL_FACE), g.disable(g.DEPTH_TEST), g.disable(g.POLYGON_OFFSET_FILL), g.disable(g.SCISSOR_TEST), g.disable(g.STENCIL_TEST), g.disable(g.SAMPLE_ALPHA_TO_COVERAGE), g.blendEquation(g.FUNC_ADD), g.blendFunc(g.ONE, g.ZERO), g.blendFuncSeparate(g.ONE, g.ZERO, g.ONE, g.ZERO), g.blendColor(0, 0, 0, 0), g.colorMask(!0, !0, !0, !0), g.clearColor(0, 0, 0, 0), g.depthMask(!0), g.depthFunc(g.LESS), E.setReversed(!1), g.clearDepth(1), g.stencilMask(4294967295), g.stencilFunc(g.ALWAYS, 0, 4294967295), g.stencilOp(g.KEEP, g.KEEP, g.KEEP), g.clearStencil(0), g.cullFace(g.BACK), g.frontFace(g.CCW), g.polygonOffset(0, 0), g.activeTexture(g.TEXTURE0), g.bindFramebuffer(g.FRAMEBUFFER, null), g.bindFramebuffer(g.DRAW_FRAMEBUFFER, null), g.bindFramebuffer(g.READ_FRAMEBUFFER, null), g.useProgram(null), g.lineWidth(1), g.scissor(0, 0, g.canvas.width, g.canvas.height), g.viewport(0, 0, g.canvas.width, g.canvas.height), M = {}, IA = null, gA = {}, i = {}, o = /* @__PURE__ */ new WeakMap(), w = [], y = null, F = !1, U = null, s = null, x = null, c = null, N = null, S = null, a = null, j = new VA(0, 0, 0), n = 0, h = !1, Y = null, k = null, l = null, p = null, m = null, SA.set(0, 0, g.canvas.width, g.canvas.height), PA.set(0, 0, g.canvas.width, g.canvas.height), Q.reset(), E.reset(), G.reset();
20208
20213
  }
20209
20214
  return {
20210
20215
  buffers: {
@@ -20248,13 +20253,13 @@ function xL(g, A, I, B, C, Q, E) {
20248
20253
  const G = A.has("WEBGL_multisampled_render_to_texture") ? A.get("WEBGL_multisampled_render_to_texture") : null, D = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), R = new HA(), M = /* @__PURE__ */ new WeakMap();
20249
20254
  let i;
20250
20255
  const o = /* @__PURE__ */ new WeakMap();
20251
- let U = !1;
20256
+ let w = !1;
20252
20257
  try {
20253
- U = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
20258
+ w = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
20254
20259
  } catch {
20255
20260
  }
20256
20261
  function y(L, t) {
20257
- return U ? new OffscreenCanvas(L, t) : nE("canvas");
20262
+ return w ? new OffscreenCanvas(L, t) : nE("canvas");
20258
20263
  }
20259
20264
  function F(L, t, J) {
20260
20265
  let X = 1;
@@ -20269,7 +20274,7 @@ function xL(g, A, I, B, C, Q, E) {
20269
20274
  return "data" in L && ZA("WebGLRenderer: Image in DataTexture is too big (" + _.width + "x" + _.height + ")."), L;
20270
20275
  return L;
20271
20276
  }
20272
- function w(L) {
20277
+ function U(L) {
20273
20278
  return L.generateMipmaps;
20274
20279
  }
20275
20280
  function s(L) {
@@ -20295,7 +20300,7 @@ function xL(g, A, I, B, C, Q, E) {
20295
20300
  return L ? t === null || t === vI || t === xQ ? J = g.DEPTH24_STENCIL8 : t === Vg ? J = g.DEPTH32F_STENCIL8 : t === cQ && (J = g.DEPTH24_STENCIL8, ZA("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : t === null || t === vI || t === xQ ? J = g.DEPTH_COMPONENT24 : t === Vg ? J = g.DEPTH_COMPONENT32F : t === cQ && (J = g.DEPTH_COMPONENT16), J;
20296
20301
  }
20297
20302
  function S(L, t) {
20298
- return w(L) === !0 || L.isFramebufferTexture && L.minFilter !== jI && L.minFilter !== $I ? Math.log2(Math.max(t.width, t.height)) + 1 : L.mipmaps !== void 0 && L.mipmaps.length > 0 ? L.mipmaps.length : L.isCompressedTexture && Array.isArray(L.image) ? t.mipmaps.length : 1;
20303
+ return U(L) === !0 || L.isFramebufferTexture && L.minFilter !== jI && L.minFilter !== $I ? Math.log2(Math.max(t.width, t.height)) + 1 : L.mipmaps !== void 0 && L.mipmaps.length > 0 ? L.mipmaps.length : L.isCompressedTexture && Array.isArray(L.image) ? t.mipmaps.length : 1;
20299
20304
  }
20300
20305
  function a(L) {
20301
20306
  const t = L.target;
@@ -20575,7 +20580,7 @@ function xL(g, A, I, B, C, Q, E) {
20575
20580
  BA && I.texSubImage2D(g.TEXTURE_2D, 0, 0, 0, RA, tA, AA);
20576
20581
  } else
20577
20582
  I.texImage2D(g.TEXTURE_2D, 0, NA, RA, tA, AA);
20578
- w(t) && s(X), xA.__version = V.version, t.onUpdate && t.onUpdate(t);
20583
+ U(t) && s(X), xA.__version = V.version, t.onUpdate && t.onUpdate(t);
20579
20584
  }
20580
20585
  L.__version = t.version;
20581
20586
  }
@@ -20625,7 +20630,7 @@ function xL(g, A, I, B, C, Q, E) {
20625
20630
  }
20626
20631
  }
20627
20632
  }
20628
- w(t) && s(g.TEXTURE_CUBE_MAP), V.__version = _.version, t.onUpdate && t.onUpdate(t);
20633
+ U(t) && s(g.TEXTURE_CUBE_MAP), V.__version = _.version, t.onUpdate && t.onUpdate(t);
20629
20634
  }
20630
20635
  L.__version = t.version;
20631
20636
  }
@@ -20762,12 +20767,12 @@ function xL(g, A, I, B, C, Q, E) {
20762
20767
  MA(J.__webglFramebuffer[QA][hA], L, t, g.COLOR_ATTACHMENT0, g.TEXTURE_CUBE_MAP_POSITIVE_X + QA, hA);
20763
20768
  else
20764
20769
  MA(J.__webglFramebuffer[QA], L, t, g.COLOR_ATTACHMENT0, g.TEXTURE_CUBE_MAP_POSITIVE_X + QA, 0);
20765
- w(t) && s(g.TEXTURE_CUBE_MAP), I.unbindTexture();
20770
+ U(t) && s(g.TEXTURE_CUBE_MAP), I.unbindTexture();
20766
20771
  } else if (xA) {
20767
20772
  for (let QA = 0, hA = _.length; QA < hA; QA++) {
20768
20773
  const dA = _[QA], AA = B.get(dA);
20769
20774
  let RA = g.TEXTURE_2D;
20770
- (L.isWebGL3DRenderTarget || L.isWebGLArrayRenderTarget) && (RA = L.isWebGL3DRenderTarget ? g.TEXTURE_3D : g.TEXTURE_2D_ARRAY), I.bindTexture(RA, AA.__webglTexture), KA(RA, dA), MA(J.__webglFramebuffer, L, dA, g.COLOR_ATTACHMENT0 + QA, RA, 0), w(dA) && s(RA);
20775
+ (L.isWebGL3DRenderTarget || L.isWebGLArrayRenderTarget) && (RA = L.isWebGL3DRenderTarget ? g.TEXTURE_3D : g.TEXTURE_2D_ARRAY), I.bindTexture(RA, AA.__webglTexture), KA(RA, dA), MA(J.__webglFramebuffer, L, dA, g.COLOR_ATTACHMENT0 + QA, RA, 0), U(dA) && s(RA);
20771
20776
  }
20772
20777
  I.unbindTexture();
20773
20778
  } else {
@@ -20777,7 +20782,7 @@ function xL(g, A, I, B, C, Q, E) {
20777
20782
  MA(J.__webglFramebuffer[hA], L, t, g.COLOR_ATTACHMENT0, QA, hA);
20778
20783
  else
20779
20784
  MA(J.__webglFramebuffer, L, t, g.COLOR_ATTACHMENT0, QA, 0);
20780
- w(t) && s(QA), I.unbindTexture();
20785
+ U(t) && s(QA), I.unbindTexture();
20781
20786
  }
20782
20787
  L.depthBuffer && pA(L);
20783
20788
  }
@@ -20785,7 +20790,7 @@ function xL(g, A, I, B, C, Q, E) {
20785
20790
  const t = L.textures;
20786
20791
  for (let J = 0, X = t.length; J < X; J++) {
20787
20792
  const _ = t[J];
20788
- if (w(_)) {
20793
+ if (U(_)) {
20789
20794
  const V = x(L), xA = B.get(_).__webglTexture;
20790
20795
  I.bindTexture(V, xA), s(V), I.unbindTexture();
20791
20796
  }
@@ -21034,8 +21039,8 @@ class SL extends QC {
21034
21039
  constructor(A, I) {
21035
21040
  super();
21036
21041
  const B = this;
21037
- let C = null, Q = 1, E = null, G = "local-floor", D = 1, R = null, M = null, i = null, o = null, U = null, y = null;
21038
- const F = typeof XRWebGLBinding < "u", w = new YL(), s = {}, x = I.getContextAttributes();
21042
+ let C = null, Q = 1, E = null, G = "local-floor", D = 1, R = null, M = null, i = null, o = null, w = null, y = null;
21043
+ const F = typeof XRWebGLBinding < "u", U = new YL(), s = {}, x = I.getContextAttributes();
21039
21044
  let c = null, N = null;
21040
21045
  const S = [], a = [], j = new HA();
21041
21046
  let n = null;
@@ -21068,10 +21073,10 @@ class SL extends QC {
21068
21073
  const O = a[W];
21069
21074
  O !== null && (a[W] = null, S[W].disconnect(O));
21070
21075
  }
21071
- p = null, m = null, w.reset();
21076
+ p = null, m = null, U.reset();
21072
21077
  for (const W in s)
21073
21078
  delete s[W];
21074
- A.setRenderTarget(c), U = null, o = null, i = null, C = null, N = null, vA.stop(), B.isPresenting = !1, A.setPixelRatio(n), A.setSize(j.width, j.height, !1), B.dispatchEvent({ type: "sessionend" });
21079
+ A.setRenderTarget(c), w = null, o = null, i = null, C = null, N = null, vA.stop(), B.isPresenting = !1, A.setPixelRatio(n), A.setSize(j.width, j.height, !1), B.dispatchEvent({ type: "sessionend" });
21075
21080
  }
21076
21081
  this.setFramebufferScaleFactor = function(W) {
21077
21082
  Q = W, B.isPresenting === !0 && ZA("WebXRManager: Cannot change framebuffer scale while presenting.");
@@ -21082,7 +21087,7 @@ class SL extends QC {
21082
21087
  }, this.setReferenceSpace = function(W) {
21083
21088
  R = W;
21084
21089
  }, this.getBaseLayer = function() {
21085
- return o !== null ? o : U;
21090
+ return o !== null ? o : w;
21086
21091
  }, this.getBinding = function() {
21087
21092
  return i === null && F && (i = new XRWebGLBinding(C, I)), i;
21088
21093
  }, this.getFrame = function() {
@@ -21121,16 +21126,16 @@ class SL extends QC {
21121
21126
  stencil: x.stencil,
21122
21127
  framebufferScaleFactor: Q
21123
21128
  };
21124
- U = new XRWebGLLayer(C, I, MA), C.updateRenderState({ baseLayer: U }), A.setPixelRatio(1), A.setSize(U.framebufferWidth, U.framebufferHeight, !1), N = new cg(
21125
- U.framebufferWidth,
21126
- U.framebufferHeight,
21129
+ w = new XRWebGLLayer(C, I, MA), C.updateRenderState({ baseLayer: w }), A.setPixelRatio(1), A.setSize(w.framebufferWidth, w.framebufferHeight, !1), N = new cg(
21130
+ w.framebufferWidth,
21131
+ w.framebufferHeight,
21127
21132
  {
21128
21133
  format: mI,
21129
21134
  type: TI,
21130
21135
  colorSpace: A.outputColorSpace,
21131
21136
  stencilBuffer: x.stencil,
21132
- resolveDepthBuffer: U.ignoreDepthValues === !1,
21133
- resolveStencilBuffer: U.ignoreDepthValues === !1
21137
+ resolveDepthBuffer: w.ignoreDepthValues === !1,
21138
+ resolveStencilBuffer: w.ignoreDepthValues === !1
21134
21139
  }
21135
21140
  );
21136
21141
  }
@@ -21140,7 +21145,7 @@ class SL extends QC {
21140
21145
  if (C !== null)
21141
21146
  return C.environmentBlendMode;
21142
21147
  }, this.getDepthTexture = function() {
21143
- return w.getDepthTexture();
21148
+ return U.getDepthTexture();
21144
21149
  };
21145
21150
  function f(W) {
21146
21151
  for (let O = 0; O < W.removed.length; O++) {
@@ -21182,7 +21187,7 @@ class SL extends QC {
21182
21187
  this.updateCamera = function(W) {
21183
21188
  if (C === null) return;
21184
21189
  let O = W.near, MA = W.far;
21185
- w.texture !== null && (w.depthNear > 0 && (O = w.depthNear), w.depthFar > 0 && (MA = w.depthFar)), l.near = Y.near = h.near = O, l.far = Y.far = h.far = MA, (p !== l.near || m !== l.far) && (C.updateRenderState({
21190
+ U.texture !== null && (U.depthNear > 0 && (O = U.depthNear), U.depthFar > 0 && (MA = U.depthFar)), l.near = Y.near = h.near = O, l.far = Y.far = h.far = MA, (p !== l.near || m !== l.far) && (C.updateRenderState({
21186
21191
  depthNear: l.near,
21187
21192
  depthFar: l.far
21188
21193
  }), p = l.near, m = l.far), l.layers.mask = W.layers.mask | 6, h.layers.mask = l.layers.mask & 3, Y.layers.mask = l.layers.mask & 5;
@@ -21198,14 +21203,14 @@ class SL extends QC {
21198
21203
  this.getCamera = function() {
21199
21204
  return l;
21200
21205
  }, this.getFoveation = function() {
21201
- if (!(o === null && U === null))
21206
+ if (!(o === null && w === null))
21202
21207
  return D;
21203
21208
  }, this.setFoveation = function(W) {
21204
- D = W, o !== null && (o.fixedFoveation = W), U !== null && U.fixedFoveation !== void 0 && (U.fixedFoveation = W);
21209
+ D = W, o !== null && (o.fixedFoveation = W), w !== null && w.fixedFoveation !== void 0 && (w.fixedFoveation = W);
21205
21210
  }, this.hasDepthSensing = function() {
21206
- return w.texture !== null;
21211
+ return U.texture !== null;
21207
21212
  }, this.getDepthSensingMesh = function() {
21208
- return w.getMesh(l);
21213
+ return U.getMesh(l);
21209
21214
  }, this.getCameraTexture = function(W) {
21210
21215
  return s[W];
21211
21216
  };
@@ -21213,14 +21218,14 @@ class SL extends QC {
21213
21218
  function PA(W, O) {
21214
21219
  if (M = O.getViewerPose(R || E), y = O, M !== null) {
21215
21220
  const MA = M.views;
21216
- U !== null && (A.setRenderTargetFramebuffer(N, U.framebuffer), A.setRenderTarget(N));
21221
+ w !== null && (A.setRenderTargetFramebuffer(N, w.framebuffer), A.setRenderTarget(N));
21217
21222
  let aA = !1;
21218
21223
  MA.length !== l.cameras.length && (l.cameras.length = 0, aA = !0);
21219
21224
  for (let qA = 0; qA < MA.length; qA++) {
21220
21225
  const _A = MA[qA];
21221
21226
  let zA = null;
21222
- if (U !== null)
21223
- zA = U.getViewport(_A);
21227
+ if (w !== null)
21228
+ zA = w.getViewport(_A);
21224
21229
  else {
21225
21230
  const FI = i.getViewSubImage(o, _A);
21226
21231
  zA = FI.viewport, qA === 0 && (A.setRenderTargetTextures(
@@ -21236,7 +21241,7 @@ class SL extends QC {
21236
21241
  if (wA && wA.includes("depth-sensing") && C.depthUsage == "gpu-optimized" && F) {
21237
21242
  i = B.getBinding();
21238
21243
  const qA = i.getDepthInformation(MA[0]);
21239
- qA && qA.isValid && qA.texture && w.init(qA, C.renderState);
21244
+ qA && qA.isValid && qA.texture && U.init(qA, C.renderState);
21240
21245
  }
21241
21246
  if (wA && wA.includes("camera-access") && F) {
21242
21247
  A.state.unbindTexture(), i = B.getBinding();
@@ -21266,50 +21271,50 @@ class SL extends QC {
21266
21271
  }
21267
21272
  const mB = /* @__PURE__ */ new dg(), aL = /* @__PURE__ */ new XA();
21268
21273
  function LL(g, A) {
21269
- function I(w, s) {
21270
- w.matrixAutoUpdate === !0 && w.updateMatrix(), s.value.copy(w.matrix);
21274
+ function I(U, s) {
21275
+ U.matrixAutoUpdate === !0 && U.updateMatrix(), s.value.copy(U.matrix);
21271
21276
  }
21272
- function B(w, s) {
21273
- s.color.getRGB(w.fogColor.value, qw(g)), s.isFog ? (w.fogNear.value = s.near, w.fogFar.value = s.far) : s.isFogExp2 && (w.fogDensity.value = s.density);
21277
+ function B(U, s) {
21278
+ s.color.getRGB(U.fogColor.value, qw(g)), s.isFog ? (U.fogNear.value = s.near, U.fogFar.value = s.far) : s.isFogExp2 && (U.fogDensity.value = s.density);
21274
21279
  }
21275
- function C(w, s, x, c, N) {
21276
- s.isMeshBasicMaterial || s.isMeshLambertMaterial ? Q(w, s) : s.isMeshToonMaterial ? (Q(w, s), i(w, s)) : s.isMeshPhongMaterial ? (Q(w, s), M(w, s)) : s.isMeshStandardMaterial ? (Q(w, s), o(w, s), s.isMeshPhysicalMaterial && U(w, s, N)) : s.isMeshMatcapMaterial ? (Q(w, s), y(w, s)) : s.isMeshDepthMaterial ? Q(w, s) : s.isMeshDistanceMaterial ? (Q(w, s), F(w, s)) : s.isMeshNormalMaterial ? Q(w, s) : s.isLineBasicMaterial ? (E(w, s), s.isLineDashedMaterial && G(w, s)) : s.isPointsMaterial ? D(w, s, x, c) : s.isSpriteMaterial ? R(w, s) : s.isShadowMaterial ? (w.color.value.copy(s.color), w.opacity.value = s.opacity) : s.isShaderMaterial && (s.uniformsNeedUpdate = !1);
21280
+ function C(U, s, x, c, N) {
21281
+ s.isMeshBasicMaterial || s.isMeshLambertMaterial ? Q(U, s) : s.isMeshToonMaterial ? (Q(U, s), i(U, s)) : s.isMeshPhongMaterial ? (Q(U, s), M(U, s)) : s.isMeshStandardMaterial ? (Q(U, s), o(U, s), s.isMeshPhysicalMaterial && w(U, s, N)) : s.isMeshMatcapMaterial ? (Q(U, s), y(U, s)) : s.isMeshDepthMaterial ? Q(U, s) : s.isMeshDistanceMaterial ? (Q(U, s), F(U, s)) : s.isMeshNormalMaterial ? Q(U, s) : s.isLineBasicMaterial ? (E(U, s), s.isLineDashedMaterial && G(U, s)) : s.isPointsMaterial ? D(U, s, x, c) : s.isSpriteMaterial ? R(U, s) : s.isShadowMaterial ? (U.color.value.copy(s.color), U.opacity.value = s.opacity) : s.isShaderMaterial && (s.uniformsNeedUpdate = !1);
21277
21282
  }
21278
- function Q(w, s) {
21279
- w.opacity.value = s.opacity, s.color && w.diffuse.value.copy(s.color), s.emissive && w.emissive.value.copy(s.emissive).multiplyScalar(s.emissiveIntensity), s.map && (w.map.value = s.map, I(s.map, w.mapTransform)), s.alphaMap && (w.alphaMap.value = s.alphaMap, I(s.alphaMap, w.alphaMapTransform)), s.bumpMap && (w.bumpMap.value = s.bumpMap, I(s.bumpMap, w.bumpMapTransform), w.bumpScale.value = s.bumpScale, s.side === ig && (w.bumpScale.value *= -1)), s.normalMap && (w.normalMap.value = s.normalMap, I(s.normalMap, w.normalMapTransform), w.normalScale.value.copy(s.normalScale), s.side === ig && w.normalScale.value.negate()), s.displacementMap && (w.displacementMap.value = s.displacementMap, I(s.displacementMap, w.displacementMapTransform), w.displacementScale.value = s.displacementScale, w.displacementBias.value = s.displacementBias), s.emissiveMap && (w.emissiveMap.value = s.emissiveMap, I(s.emissiveMap, w.emissiveMapTransform)), s.specularMap && (w.specularMap.value = s.specularMap, I(s.specularMap, w.specularMapTransform)), s.alphaTest > 0 && (w.alphaTest.value = s.alphaTest);
21283
+ function Q(U, s) {
21284
+ U.opacity.value = s.opacity, s.color && U.diffuse.value.copy(s.color), s.emissive && U.emissive.value.copy(s.emissive).multiplyScalar(s.emissiveIntensity), s.map && (U.map.value = s.map, I(s.map, U.mapTransform)), s.alphaMap && (U.alphaMap.value = s.alphaMap, I(s.alphaMap, U.alphaMapTransform)), s.bumpMap && (U.bumpMap.value = s.bumpMap, I(s.bumpMap, U.bumpMapTransform), U.bumpScale.value = s.bumpScale, s.side === ig && (U.bumpScale.value *= -1)), s.normalMap && (U.normalMap.value = s.normalMap, I(s.normalMap, U.normalMapTransform), U.normalScale.value.copy(s.normalScale), s.side === ig && U.normalScale.value.negate()), s.displacementMap && (U.displacementMap.value = s.displacementMap, I(s.displacementMap, U.displacementMapTransform), U.displacementScale.value = s.displacementScale, U.displacementBias.value = s.displacementBias), s.emissiveMap && (U.emissiveMap.value = s.emissiveMap, I(s.emissiveMap, U.emissiveMapTransform)), s.specularMap && (U.specularMap.value = s.specularMap, I(s.specularMap, U.specularMapTransform)), s.alphaTest > 0 && (U.alphaTest.value = s.alphaTest);
21280
21285
  const x = A.get(s), c = x.envMap, N = x.envMapRotation;
21281
- c && (w.envMap.value = c, mB.copy(N), mB.x *= -1, mB.y *= -1, mB.z *= -1, c.isCubeTexture && c.isRenderTargetTexture === !1 && (mB.y *= -1, mB.z *= -1), w.envMapRotation.value.setFromMatrix4(aL.makeRotationFromEuler(mB)), w.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1, w.reflectivity.value = s.reflectivity, w.ior.value = s.ior, w.refractionRatio.value = s.refractionRatio), s.lightMap && (w.lightMap.value = s.lightMap, w.lightMapIntensity.value = s.lightMapIntensity, I(s.lightMap, w.lightMapTransform)), s.aoMap && (w.aoMap.value = s.aoMap, w.aoMapIntensity.value = s.aoMapIntensity, I(s.aoMap, w.aoMapTransform));
21286
+ c && (U.envMap.value = c, mB.copy(N), mB.x *= -1, mB.y *= -1, mB.z *= -1, c.isCubeTexture && c.isRenderTargetTexture === !1 && (mB.y *= -1, mB.z *= -1), U.envMapRotation.value.setFromMatrix4(aL.makeRotationFromEuler(mB)), U.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1, U.reflectivity.value = s.reflectivity, U.ior.value = s.ior, U.refractionRatio.value = s.refractionRatio), s.lightMap && (U.lightMap.value = s.lightMap, U.lightMapIntensity.value = s.lightMapIntensity, I(s.lightMap, U.lightMapTransform)), s.aoMap && (U.aoMap.value = s.aoMap, U.aoMapIntensity.value = s.aoMapIntensity, I(s.aoMap, U.aoMapTransform));
21282
21287
  }
21283
- function E(w, s) {
21284
- w.diffuse.value.copy(s.color), w.opacity.value = s.opacity, s.map && (w.map.value = s.map, I(s.map, w.mapTransform));
21288
+ function E(U, s) {
21289
+ U.diffuse.value.copy(s.color), U.opacity.value = s.opacity, s.map && (U.map.value = s.map, I(s.map, U.mapTransform));
21285
21290
  }
21286
- function G(w, s) {
21287
- w.dashSize.value = s.dashSize, w.totalSize.value = s.dashSize + s.gapSize, w.scale.value = s.scale;
21291
+ function G(U, s) {
21292
+ U.dashSize.value = s.dashSize, U.totalSize.value = s.dashSize + s.gapSize, U.scale.value = s.scale;
21288
21293
  }
21289
- function D(w, s, x, c) {
21290
- w.diffuse.value.copy(s.color), w.opacity.value = s.opacity, w.size.value = s.size * x, w.scale.value = c * 0.5, s.map && (w.map.value = s.map, I(s.map, w.uvTransform)), s.alphaMap && (w.alphaMap.value = s.alphaMap, I(s.alphaMap, w.alphaMapTransform)), s.alphaTest > 0 && (w.alphaTest.value = s.alphaTest);
21294
+ function D(U, s, x, c) {
21295
+ U.diffuse.value.copy(s.color), U.opacity.value = s.opacity, U.size.value = s.size * x, U.scale.value = c * 0.5, s.map && (U.map.value = s.map, I(s.map, U.uvTransform)), s.alphaMap && (U.alphaMap.value = s.alphaMap, I(s.alphaMap, U.alphaMapTransform)), s.alphaTest > 0 && (U.alphaTest.value = s.alphaTest);
21291
21296
  }
21292
- function R(w, s) {
21293
- w.diffuse.value.copy(s.color), w.opacity.value = s.opacity, w.rotation.value = s.rotation, s.map && (w.map.value = s.map, I(s.map, w.mapTransform)), s.alphaMap && (w.alphaMap.value = s.alphaMap, I(s.alphaMap, w.alphaMapTransform)), s.alphaTest > 0 && (w.alphaTest.value = s.alphaTest);
21297
+ function R(U, s) {
21298
+ U.diffuse.value.copy(s.color), U.opacity.value = s.opacity, U.rotation.value = s.rotation, s.map && (U.map.value = s.map, I(s.map, U.mapTransform)), s.alphaMap && (U.alphaMap.value = s.alphaMap, I(s.alphaMap, U.alphaMapTransform)), s.alphaTest > 0 && (U.alphaTest.value = s.alphaTest);
21294
21299
  }
21295
- function M(w, s) {
21296
- w.specular.value.copy(s.specular), w.shininess.value = Math.max(s.shininess, 1e-4);
21300
+ function M(U, s) {
21301
+ U.specular.value.copy(s.specular), U.shininess.value = Math.max(s.shininess, 1e-4);
21297
21302
  }
21298
- function i(w, s) {
21299
- s.gradientMap && (w.gradientMap.value = s.gradientMap);
21303
+ function i(U, s) {
21304
+ s.gradientMap && (U.gradientMap.value = s.gradientMap);
21300
21305
  }
21301
- function o(w, s) {
21302
- w.metalness.value = s.metalness, s.metalnessMap && (w.metalnessMap.value = s.metalnessMap, I(s.metalnessMap, w.metalnessMapTransform)), w.roughness.value = s.roughness, s.roughnessMap && (w.roughnessMap.value = s.roughnessMap, I(s.roughnessMap, w.roughnessMapTransform)), s.envMap && (w.envMapIntensity.value = s.envMapIntensity);
21306
+ function o(U, s) {
21307
+ U.metalness.value = s.metalness, s.metalnessMap && (U.metalnessMap.value = s.metalnessMap, I(s.metalnessMap, U.metalnessMapTransform)), U.roughness.value = s.roughness, s.roughnessMap && (U.roughnessMap.value = s.roughnessMap, I(s.roughnessMap, U.roughnessMapTransform)), s.envMap && (U.envMapIntensity.value = s.envMapIntensity);
21303
21308
  }
21304
- function U(w, s, x) {
21305
- w.ior.value = s.ior, s.sheen > 0 && (w.sheenColor.value.copy(s.sheenColor).multiplyScalar(s.sheen), w.sheenRoughness.value = s.sheenRoughness, s.sheenColorMap && (w.sheenColorMap.value = s.sheenColorMap, I(s.sheenColorMap, w.sheenColorMapTransform)), s.sheenRoughnessMap && (w.sheenRoughnessMap.value = s.sheenRoughnessMap, I(s.sheenRoughnessMap, w.sheenRoughnessMapTransform))), s.clearcoat > 0 && (w.clearcoat.value = s.clearcoat, w.clearcoatRoughness.value = s.clearcoatRoughness, s.clearcoatMap && (w.clearcoatMap.value = s.clearcoatMap, I(s.clearcoatMap, w.clearcoatMapTransform)), s.clearcoatRoughnessMap && (w.clearcoatRoughnessMap.value = s.clearcoatRoughnessMap, I(s.clearcoatRoughnessMap, w.clearcoatRoughnessMapTransform)), s.clearcoatNormalMap && (w.clearcoatNormalMap.value = s.clearcoatNormalMap, I(s.clearcoatNormalMap, w.clearcoatNormalMapTransform), w.clearcoatNormalScale.value.copy(s.clearcoatNormalScale), s.side === ig && w.clearcoatNormalScale.value.negate())), s.dispersion > 0 && (w.dispersion.value = s.dispersion), s.iridescence > 0 && (w.iridescence.value = s.iridescence, w.iridescenceIOR.value = s.iridescenceIOR, w.iridescenceThicknessMinimum.value = s.iridescenceThicknessRange[0], w.iridescenceThicknessMaximum.value = s.iridescenceThicknessRange[1], s.iridescenceMap && (w.iridescenceMap.value = s.iridescenceMap, I(s.iridescenceMap, w.iridescenceMapTransform)), s.iridescenceThicknessMap && (w.iridescenceThicknessMap.value = s.iridescenceThicknessMap, I(s.iridescenceThicknessMap, w.iridescenceThicknessMapTransform))), s.transmission > 0 && (w.transmission.value = s.transmission, w.transmissionSamplerMap.value = x.texture, w.transmissionSamplerSize.value.set(x.width, x.height), s.transmissionMap && (w.transmissionMap.value = s.transmissionMap, I(s.transmissionMap, w.transmissionMapTransform)), w.thickness.value = s.thickness, s.thicknessMap && (w.thicknessMap.value = s.thicknessMap, I(s.thicknessMap, w.thicknessMapTransform)), w.attenuationDistance.value = s.attenuationDistance, w.attenuationColor.value.copy(s.attenuationColor)), s.anisotropy > 0 && (w.anisotropyVector.value.set(s.anisotropy * Math.cos(s.anisotropyRotation), s.anisotropy * Math.sin(s.anisotropyRotation)), s.anisotropyMap && (w.anisotropyMap.value = s.anisotropyMap, I(s.anisotropyMap, w.anisotropyMapTransform))), w.specularIntensity.value = s.specularIntensity, w.specularColor.value.copy(s.specularColor), s.specularColorMap && (w.specularColorMap.value = s.specularColorMap, I(s.specularColorMap, w.specularColorMapTransform)), s.specularIntensityMap && (w.specularIntensityMap.value = s.specularIntensityMap, I(s.specularIntensityMap, w.specularIntensityMapTransform));
21309
+ function w(U, s, x) {
21310
+ U.ior.value = s.ior, s.sheen > 0 && (U.sheenColor.value.copy(s.sheenColor).multiplyScalar(s.sheen), U.sheenRoughness.value = s.sheenRoughness, s.sheenColorMap && (U.sheenColorMap.value = s.sheenColorMap, I(s.sheenColorMap, U.sheenColorMapTransform)), s.sheenRoughnessMap && (U.sheenRoughnessMap.value = s.sheenRoughnessMap, I(s.sheenRoughnessMap, U.sheenRoughnessMapTransform))), s.clearcoat > 0 && (U.clearcoat.value = s.clearcoat, U.clearcoatRoughness.value = s.clearcoatRoughness, s.clearcoatMap && (U.clearcoatMap.value = s.clearcoatMap, I(s.clearcoatMap, U.clearcoatMapTransform)), s.clearcoatRoughnessMap && (U.clearcoatRoughnessMap.value = s.clearcoatRoughnessMap, I(s.clearcoatRoughnessMap, U.clearcoatRoughnessMapTransform)), s.clearcoatNormalMap && (U.clearcoatNormalMap.value = s.clearcoatNormalMap, I(s.clearcoatNormalMap, U.clearcoatNormalMapTransform), U.clearcoatNormalScale.value.copy(s.clearcoatNormalScale), s.side === ig && U.clearcoatNormalScale.value.negate())), s.dispersion > 0 && (U.dispersion.value = s.dispersion), s.iridescence > 0 && (U.iridescence.value = s.iridescence, U.iridescenceIOR.value = s.iridescenceIOR, U.iridescenceThicknessMinimum.value = s.iridescenceThicknessRange[0], U.iridescenceThicknessMaximum.value = s.iridescenceThicknessRange[1], s.iridescenceMap && (U.iridescenceMap.value = s.iridescenceMap, I(s.iridescenceMap, U.iridescenceMapTransform)), s.iridescenceThicknessMap && (U.iridescenceThicknessMap.value = s.iridescenceThicknessMap, I(s.iridescenceThicknessMap, U.iridescenceThicknessMapTransform))), s.transmission > 0 && (U.transmission.value = s.transmission, U.transmissionSamplerMap.value = x.texture, U.transmissionSamplerSize.value.set(x.width, x.height), s.transmissionMap && (U.transmissionMap.value = s.transmissionMap, I(s.transmissionMap, U.transmissionMapTransform)), U.thickness.value = s.thickness, s.thicknessMap && (U.thicknessMap.value = s.thicknessMap, I(s.thicknessMap, U.thicknessMapTransform)), U.attenuationDistance.value = s.attenuationDistance, U.attenuationColor.value.copy(s.attenuationColor)), s.anisotropy > 0 && (U.anisotropyVector.value.set(s.anisotropy * Math.cos(s.anisotropyRotation), s.anisotropy * Math.sin(s.anisotropyRotation)), s.anisotropyMap && (U.anisotropyMap.value = s.anisotropyMap, I(s.anisotropyMap, U.anisotropyMapTransform))), U.specularIntensity.value = s.specularIntensity, U.specularColor.value.copy(s.specularColor), s.specularColorMap && (U.specularColorMap.value = s.specularColorMap, I(s.specularColorMap, U.specularColorMapTransform)), s.specularIntensityMap && (U.specularIntensityMap.value = s.specularIntensityMap, I(s.specularIntensityMap, U.specularIntensityMapTransform));
21306
21311
  }
21307
- function y(w, s) {
21308
- s.matcap && (w.matcap.value = s.matcap);
21312
+ function y(U, s) {
21313
+ s.matcap && (U.matcap.value = s.matcap);
21309
21314
  }
21310
- function F(w, s) {
21315
+ function F(U, s) {
21311
21316
  const x = A.get(s).light;
21312
- w.referencePosition.value.setFromMatrixPosition(x.matrixWorld), w.nearDistance.value = x.shadow.camera.near, w.farDistance.value = x.shadow.camera.far;
21317
+ U.referencePosition.value.setFromMatrixPosition(x.matrixWorld), U.nearDistance.value = x.shadow.camera.near, U.farDistance.value = x.shadow.camera.far;
21313
21318
  }
21314
21319
  return {
21315
21320
  refreshFogUniforms: B,
@@ -21325,7 +21330,7 @@ function jL(g, A, I, B) {
21325
21330
  }
21326
21331
  function R(x, c) {
21327
21332
  let N = C[x.id];
21328
- N === void 0 && (y(x), N = M(x), C[x.id] = N, x.addEventListener("dispose", w));
21333
+ N === void 0 && (y(x), N = M(x), C[x.id] = N, x.addEventListener("dispose", U));
21329
21334
  const S = c.program;
21330
21335
  B.updateUBOMapping(x, S);
21331
21336
  const a = A.render.frame;
@@ -21350,7 +21355,7 @@ function jL(g, A, I, B) {
21350
21355
  const n = Array.isArray(N[a]) ? N[a] : [N[a]];
21351
21356
  for (let h = 0, Y = n.length; h < Y; h++) {
21352
21357
  const k = n[h];
21353
- if (U(k, a, h, S) === !0) {
21358
+ if (w(k, a, h, S) === !0) {
21354
21359
  const l = k.__offset, p = Array.isArray(k.value) ? k.value : [k.value];
21355
21360
  let m = 0;
21356
21361
  for (let v = 0; v < p.length; v++) {
@@ -21363,7 +21368,7 @@ function jL(g, A, I, B) {
21363
21368
  }
21364
21369
  g.bindBuffer(g.UNIFORM_BUFFER, null);
21365
21370
  }
21366
- function U(x, c, N, S) {
21371
+ function w(x, c, N, S) {
21367
21372
  const a = x.value, j = c + "_" + N;
21368
21373
  if (S[j] === void 0)
21369
21374
  return typeof a == "number" || typeof a == "boolean" ? S[j] = a : S[j] = a.clone(), !0;
@@ -21403,9 +21408,9 @@ function jL(g, A, I, B) {
21403
21408
  };
21404
21409
  return typeof x == "number" || typeof x == "boolean" ? (c.boundary = 4, c.storage = 4) : x.isVector2 ? (c.boundary = 8, c.storage = 8) : x.isVector3 || x.isColor ? (c.boundary = 16, c.storage = 12) : x.isVector4 ? (c.boundary = 16, c.storage = 16) : x.isMatrix3 ? (c.boundary = 48, c.storage = 48) : x.isMatrix4 ? (c.boundary = 64, c.storage = 64) : x.isTexture ? ZA("WebGLRenderer: Texture samplers can not be part of an uniforms group.") : ZA("WebGLRenderer: Unsupported uniform value type.", x), c;
21405
21410
  }
21406
- function w(x) {
21411
+ function U(x) {
21407
21412
  const c = x.target;
21408
- c.removeEventListener("dispose", w);
21413
+ c.removeEventListener("dispose", U);
21409
21414
  const N = E.indexOf(c.__bindingPointIndex);
21410
21415
  E.splice(N, 1), g.deleteBuffer(C[c.id]), delete C[c.id], delete Q[c.id];
21411
21416
  }
@@ -21957,7 +21962,7 @@ class QU {
21957
21962
  powerPreference: M = "default",
21958
21963
  failIfMajorPerformanceCaveat: i = !1,
21959
21964
  reversedDepthBuffer: o = !1,
21960
- outputBufferType: U = TI
21965
+ outputBufferType: w = TI
21961
21966
  } = A;
21962
21967
  this.isWebGLRenderer = !0;
21963
21968
  let y;
@@ -21967,7 +21972,7 @@ class QU {
21967
21972
  y = B.getContextAttributes().alpha;
21968
21973
  } else
21969
21974
  y = E;
21970
- const F = U, w = /* @__PURE__ */ new Set([
21975
+ const F = w, U = /* @__PURE__ */ new Set([
21971
21976
  DB,
21972
21977
  qE,
21973
21978
  mi
@@ -22111,7 +22116,7 @@ class QU {
22111
22116
  let r = !1;
22112
22117
  if (p !== null) {
22113
22118
  const DA = p.texture.format;
22114
- r = w.has(DA);
22119
+ r = U.has(DA);
22115
22120
  }
22116
22121
  if (r) {
22117
22122
  const DA = p.texture.type, yA = s.has(DA), oA = GA.getClearColor(), FA = GA.getClearAlpha(), bA = oA.r, eA = oA.g, LA = oA.b;
@@ -22809,14 +22814,14 @@ var uL = /* @__PURE__ */ UQ(jQ, 9), fL = /* @__PURE__ */ UQ(sU, 5), iD = functio
22809
22814
  var qA = new uI(Math.max(yI * 2, pA));
22810
22815
  qA.set(I), I = qA;
22811
22816
  }
22812
- }, M = A.f || 0, i = A.p || 0, o = A.b || 0, U = A.l, y = A.d, F = A.m, w = A.n, s = C * 8;
22817
+ }, M = A.f || 0, i = A.p || 0, o = A.b || 0, w = A.l, y = A.d, F = A.m, U = A.n, s = C * 8;
22813
22818
  do {
22814
- if (!U) {
22819
+ if (!w) {
22815
22820
  M = eg(g, i, 1);
22816
22821
  var x = eg(g, i + 1, 3);
22817
22822
  if (i += 3, x)
22818
22823
  if (x == 1)
22819
- U = uL, y = fL, F = 9, w = 5;
22824
+ w = uL, y = fL, F = 9, U = 5;
22820
22825
  else if (x == 2) {
22821
22826
  var a = eg(g, i, 31) + 257, j = eg(g, i + 10, 15) + 4, n = a + eg(g, i + 5, 31) + 1;
22822
22827
  i += 14;
@@ -22836,7 +22841,7 @@ var uL = /* @__PURE__ */ UQ(jQ, 9), fL = /* @__PURE__ */ UQ(sU, 5), iD = functio
22836
22841
  }
22837
22842
  }
22838
22843
  var z = h.subarray(0, a), IA = h.subarray(a);
22839
- F = iD(z), w = iD(IA), U = UQ(z, F), y = UQ(IA, w);
22844
+ F = iD(z), U = iD(IA), w = UQ(z, F), y = UQ(IA, U);
22840
22845
  } else
22841
22846
  Bg(1);
22842
22847
  else {
@@ -22854,8 +22859,8 @@ var uL = /* @__PURE__ */ UQ(jQ, 9), fL = /* @__PURE__ */ UQ(sU, 5), iD = functio
22854
22859
  }
22855
22860
  }
22856
22861
  G && R(o + 131072);
22857
- for (var gA = (1 << F) - 1, CA = (1 << w) - 1, KA = i; ; KA = i) {
22858
- var u = U[MD(g, i) & gA], SA = u >> 4;
22862
+ for (var gA = (1 << F) - 1, CA = (1 << U) - 1, KA = i; ; KA = i) {
22863
+ var u = w[MD(g, i) & gA], SA = u >> 4;
22859
22864
  if (i += u & 15, i > s) {
22860
22865
  D && Bg(0);
22861
22866
  break;
@@ -22863,7 +22868,7 @@ var uL = /* @__PURE__ */ UQ(jQ, 9), fL = /* @__PURE__ */ UQ(sU, 5), iD = functio
22863
22868
  if (u || Bg(2), SA < 256)
22864
22869
  I[o++] = SA;
22865
22870
  else if (SA == 256) {
22866
- KA = i, U = null;
22871
+ KA = i, w = null;
22867
22872
  break;
22868
22873
  } else {
22869
22874
  var PA = SA - 254;
@@ -22893,7 +22898,7 @@ var uL = /* @__PURE__ */ UQ(jQ, 9), fL = /* @__PURE__ */ UQ(sU, 5), iD = functio
22893
22898
  I[o] = I[o - IA];
22894
22899
  }
22895
22900
  }
22896
- A.l = U, A.p = KA, A.b = o, A.f = M, U && (M = 1, A.m = F, A.d = y, A.n = w);
22901
+ A.l = w, A.p = KA, A.b = o, A.f = M, w && (M = 1, A.m = F, A.d = y, A.n = U);
22897
22902
  } while (!M);
22898
22903
  return o != I.length && E ? eC(I, 0, o) : I.subarray(0, o);
22899
22904
  }, TL = /* @__PURE__ */ new uI(0), mg = function(g, A) {
@@ -22995,13 +23000,13 @@ function $L(g, A) {
22995
23000
  E = Jg(g, G) == 101075792, E && (C = Jg(g, G + 32), Q = Jg(g, G + 48));
22996
23001
  }
22997
23002
  for (var D = A && A.filter, R = 0; R < C; ++R) {
22998
- var M = PL(g, Q, E), i = M[0], o = M[1], U = M[2], y = M[3], F = M[4], w = M[5], s = zL(g, w);
23003
+ var M = PL(g, Q, E), i = M[0], o = M[1], w = M[2], y = M[3], F = M[4], U = M[5], s = zL(g, U);
22999
23004
  Q = F, (!D || D({
23000
23005
  name: y,
23001
23006
  size: o,
23002
- originalSize: U,
23007
+ originalSize: w,
23003
23008
  compression: i
23004
- })) && (i ? i == 8 ? I[y] = VL(g.subarray(s, s + o), { out: new uI(U) }) : Bg(14, "unknown compression type " + i) : I[y] = eC(g, s, s + o));
23009
+ })) && (i ? i == 8 ? I[y] = VL(g.subarray(s, s + o), { out: new uI(w) }) : Bg(14, "unknown compression type " + i) : I[y] = eC(g, s, s + o));
23005
23010
  }
23006
23011
  return I;
23007
23012
  }
@@ -23502,24 +23507,24 @@ class _g extends RI {
23502
23507
  }) {
23503
23508
  var C, Q;
23504
23509
  const E = {}, G = {};
23505
- for (const w in A)
23506
- A[w] != null && (E[w] = new JC(this.inTypes[w], A[w]));
23507
- for (const w in I)
23508
- I[w] != null && (G[w] = new KB(this.outTypes[w]));
23510
+ for (const U in A)
23511
+ A[U] != null && (E[U] = new JC(this.inTypes[U], A[U]));
23512
+ for (const U in I)
23513
+ I[U] != null && (G[U] = new KB(this.outTypes[U]));
23509
23514
  const D = { roots: [] }, R = this.construct(E, G, D);
23510
- for (const w of ((C = this.globals) == null ? void 0 : C.call(this, { inputs: A, outputs: I, compile: B })) ?? [])
23511
- B.globals.add(w);
23515
+ for (const U of ((C = this.globals) == null ? void 0 : C.call(this, { inputs: A, outputs: I, compile: B })) ?? [])
23516
+ B.globals.add(U);
23512
23517
  const M = [], i = /* @__PURE__ */ new Map();
23513
- function o(w, s, x) {
23514
- let c = i.get(w);
23518
+ function o(U, s, x) {
23519
+ let c = i.get(U);
23515
23520
  if (!c) {
23516
23521
  c = {
23517
23522
  sequence: B.nextSequence(),
23518
23523
  outNames: /* @__PURE__ */ new Map(),
23519
23524
  newOuts: /* @__PURE__ */ new Set()
23520
- }, i.set(w, c);
23521
- for (const N in w.inputs) {
23522
- let S = w.inputs[N];
23525
+ }, i.set(U, c);
23526
+ for (const N in U.inputs) {
23527
+ let S = U.inputs[N];
23523
23528
  for (; S; ) {
23524
23529
  if (S instanceof KB) {
23525
23530
  S instanceof CI && o(S.dyno, S.key);
@@ -23528,28 +23533,28 @@ class _g extends RI {
23528
23533
  S = S.dynoOut();
23529
23534
  }
23530
23535
  }
23531
- M.push(w);
23536
+ M.push(U);
23532
23537
  }
23533
23538
  s && (x || c.newOuts.add(s), c.outNames.set(s, x ?? `${s}_${c.sequence}`));
23534
23539
  }
23535
- for (const w of D.roots)
23536
- o(w);
23537
- for (const w in G) {
23538
- let s = R?.[w] ?? G[w];
23540
+ for (const U of D.roots)
23541
+ o(U);
23542
+ for (const U in G) {
23543
+ let s = R?.[U] ?? G[U];
23539
23544
  for (; s; ) {
23540
23545
  if (s instanceof KB) {
23541
- s instanceof CI && o(s.dyno, s.key, I[w]);
23546
+ s instanceof CI && o(s.dyno, s.key, I[U]);
23542
23547
  break;
23543
23548
  }
23544
23549
  s = s.dynoOut();
23545
23550
  }
23546
- G[w] = s;
23551
+ G[U] = s;
23547
23552
  }
23548
- const U = [];
23549
- for (const w of M) {
23553
+ const w = [];
23554
+ for (const U of M) {
23550
23555
  const s = {}, x = {};
23551
- for (const S in w.inputs) {
23552
- let a = w.inputs[S];
23556
+ for (const S in U.inputs) {
23557
+ let a = U.inputs[S];
23553
23558
  for (; a; ) {
23554
23559
  if (a instanceof KB) {
23555
23560
  if (a instanceof JC)
@@ -23567,18 +23572,18 @@ class _g extends RI {
23567
23572
  a = a.dynoOut();
23568
23573
  }
23569
23574
  }
23570
- const c = i.get(w) ?? { outNames: /* @__PURE__ */ new Map() };
23575
+ const c = i.get(U) ?? { outNames: /* @__PURE__ */ new Map() };
23571
23576
  for (const [S, a] of c.outNames.entries())
23572
23577
  x[S] = a;
23573
- const N = w.compile({ inputs: s, outputs: x, compile: B });
23574
- U.push(N);
23578
+ const N = U.compile({ inputs: s, outputs: x, compile: B });
23579
+ w.push(N);
23575
23580
  }
23576
23581
  const y = [];
23577
- for (const w in I)
23578
- G[w] instanceof JC && y.push(
23579
- `${I[w]} = ${G[w].getLiteral()};`
23582
+ for (const U in I)
23583
+ G[U] instanceof JC && y.push(
23584
+ `${I[U]} = ${G[U].getLiteral()};`
23580
23585
  );
23581
- return y.length > 0 && U.push(y), { statements: U.flatMap((w, s) => s === 0 ? w : ["", ...w]) };
23586
+ return y.length > 0 && w.push(y), { statements: w.flatMap((U, s) => s === 0 ? U : ["", ...U]) };
23582
23587
  }
23583
23588
  }
23584
23589
  function Pg(g, A, I, { update: B, globals: C } = {}) {
@@ -23687,7 +23692,7 @@ const eI = { type: "Gsplat" }, nQ = { type: "PackedSplats" }, yj = (g) => new aU
23687
23692
  y: M,
23688
23693
  z: i,
23689
23694
  r: o,
23690
- g: U,
23695
+ g: w,
23691
23696
  b: y
23692
23697
  }) => new KU({
23693
23698
  gsplat: g,
@@ -23703,7 +23708,7 @@ const eI = { type: "Gsplat" }, nQ = { type: "PackedSplats" }, yj = (g) => new aU
23703
23708
  y: M,
23704
23709
  z: i,
23705
23710
  r: o,
23706
- g: U,
23711
+ g: w,
23707
23712
  b: y
23708
23713
  }), Fj = (g) => new eU({ gsplat: g }), _i = (g, {
23709
23714
  scale: A,
@@ -23854,10 +23859,10 @@ class kU extends RI {
23854
23859
  quaternion: M,
23855
23860
  rgba: i,
23856
23861
  rgb: o,
23857
- opacity: U,
23862
+ opacity: w,
23858
23863
  x: y,
23859
23864
  y: F,
23860
- z: w,
23865
+ z: U,
23861
23866
  r: s,
23862
23867
  g: x,
23863
23868
  b: c
@@ -23871,10 +23876,10 @@ class kU extends RI {
23871
23876
  M ? `${M} = ${C ? `${C}.quaternion` : "vec4(0.0, 0.0, 0.0, 1.0)"};` : null,
23872
23877
  i ? `${i} = ${C ? `${C}.rgba` : "vec4(0.0, 0.0, 0.0, 0.0)"};` : null,
23873
23878
  o ? `${o} = ${C ? `${C}.rgba.rgb` : "vec3(0.0, 0.0, 0.0)"};` : null,
23874
- U ? `${U} = ${C ? `${C}.rgba.a` : "0.0"};` : null,
23879
+ w ? `${w} = ${C ? `${C}.rgba.a` : "0.0"};` : null,
23875
23880
  y ? `${y} = ${C ? `${C}.center.x` : "0.0"};` : null,
23876
23881
  F ? `${F} = ${C ? `${C}.center.y` : "0.0"};` : null,
23877
- w ? `${w} = ${C ? `${C}.center.z` : "0.0"};` : null,
23882
+ U ? `${U} = ${C ? `${C}.center.z` : "0.0"};` : null,
23878
23883
  s ? `${s} = ${C ? `${C}.rgba.r` : "0.0"};` : null,
23879
23884
  x ? `${x} = ${C ? `${C}.rgba.g` : "0.0"};` : null,
23880
23885
  c ? `${c} = ${C ? `${C}.rgba.b` : "0.0"};` : null
@@ -23897,7 +23902,7 @@ class KU extends RI {
23897
23902
  x: M,
23898
23903
  y: i,
23899
23904
  z: o,
23900
- r: U,
23905
+ r: w,
23901
23906
  g: y,
23902
23907
  b: F
23903
23908
  }) {
@@ -23933,12 +23938,12 @@ class KU extends RI {
23933
23938
  x: M,
23934
23939
  y: i,
23935
23940
  z: o,
23936
- r: U,
23941
+ r: w,
23937
23942
  g: y,
23938
23943
  b: F
23939
23944
  },
23940
23945
  globals: () => [Hg],
23941
- statements: ({ inputs: w, outputs: s }) => {
23946
+ statements: ({ inputs: U, outputs: s }) => {
23942
23947
  const { gsplat: x } = s;
23943
23948
  if (!x)
23944
23949
  return [];
@@ -23958,7 +23963,7 @@ class KU extends RI {
23958
23963
  r: v,
23959
23964
  g: u,
23960
23965
  b: f
23961
- } = w;
23966
+ } = U;
23962
23967
  return [
23963
23968
  `${x}.flags = ${N ?? (c ? `${c}.flags` : "0u")};`,
23964
23969
  `${x}.index = ${S ?? (c ? `${c}.index` : "0")};`,
@@ -24026,7 +24031,7 @@ class JU extends RI {
24026
24031
  const { gsplat: R } = G;
24027
24032
  if (!R || !E.gsplat)
24028
24033
  return [];
24029
- const { scale: M, rotate: i, translate: o, recolor: U } = E, y = D.indent;
24034
+ const { scale: M, rotate: i, translate: o, recolor: w } = E, y = D.indent;
24030
24035
  return [
24031
24036
  `${R} = ${E.gsplat};`,
24032
24037
  `if (isGsplatActive(${R}.flags)) {`,
@@ -24035,7 +24040,7 @@ class JU extends RI {
24035
24040
  o ? `${y}${R}.center += ${o};` : null,
24036
24041
  M ? `${y}${R}.scales *= ${M};` : null,
24037
24042
  i ? `${y}${R}.quaternion = quatQuat(${i}, ${R}.quaternion);` : null,
24038
- U ? `${y}${R}.rgba *= ${U};` : null,
24043
+ w ? `${y}${R}.rgba *= ${w};` : null,
24039
24044
  "}"
24040
24045
  ].filter(Boolean);
24041
24046
  }
@@ -24594,10 +24599,10 @@ class wH {
24594
24599
  this.dispose && this.dispose(A), A = this.items.pop();
24595
24600
  }
24596
24601
  }
24597
- function Ls(g, A, I, B, C, Q, E, G, D, R, M, i, o, U, y, F, w) {
24598
- const s = w?.rgbMin ?? 0, c = (w?.rgbMax ?? 1) - s, N = DE((U - s) / c), S = DE((y - s) / c), a = DE((F - s) / c), j = DE(o), n = LH(
24602
+ function Ls(g, A, I, B, C, Q, E, G, D, R, M, i, o, w, y, F, U) {
24603
+ const s = U?.rgbMin ?? 0, c = (U?.rgbMax ?? 1) - s, N = DE((w - s) / c), S = DE((y - s) / c), a = DE((F - s) / c), j = DE(o), n = LH(
24599
24604
  UH.set(D, R, M, i)
24600
- ), h = n & 255, Y = n >>> 8 & 255, k = n >>> 16 & 255, l = w?.lnScaleMin ?? wB, m = 254 / ((w?.lnScaleMax ?? UB) - l), v = Q < wD ? 0 : Math.min(
24605
+ ), h = n & 255, Y = n >>> 8 & 255, k = n >>> 16 & 255, l = U?.lnScaleMin ?? wB, m = 254 / ((U?.lnScaleMax ?? UB) - l), v = Q < wD ? 0 : Math.min(
24601
24606
  255,
24602
24607
  Math.max(
24603
24608
  1,
@@ -24638,8 +24643,8 @@ function js(g, A, I) {
24638
24643
  );
24639
24644
  const o = I?.lnScaleMin ?? wB, y = ((I?.lnScaleMax ?? UB) - o) / 254, F = D & 255;
24640
24645
  B.scales.x = F === 0 ? 0 : Math.exp(o + (F - 1) * y);
24641
- const w = D >>> 8 & 255;
24642
- B.scales.y = w === 0 ? 0 : Math.exp(o + (w - 1) * y);
24646
+ const U = D >>> 8 & 255;
24647
+ B.scales.y = U === 0 ? 0 : Math.exp(o + (U - 1) * y);
24643
24648
  const s = D >>> 16 & 255;
24644
24649
  B.scales.z = s === 0 ? 0 : Math.exp(o + (s - 1) * y);
24645
24650
  const x = G >>> 16 & 65535 | D >>> 8 & 16711680;
@@ -24703,8 +24708,8 @@ function LH(g) {
24703
24708
  ), C = B < 1e-6 ? hi.set(1, 0, 0) : hi.set(A.x, A.y, A.z).divideScalar(B), Q = Math.abs(C.x) + Math.abs(C.y) + Math.abs(C.z);
24704
24709
  let E = C.x / Q, G = C.y / Q;
24705
24710
  if (C.z < 0) {
24706
- const U = E;
24707
- E = (1 - Math.abs(G)) * (E >= 0 ? 1 : -1), G = (1 - Math.abs(U)) * (G >= 0 ? 1 : -1);
24711
+ const w = E;
24712
+ E = (1 - Math.abs(G)) * (E >= 0 ? 1 : -1), G = (1 - Math.abs(w)) * (G >= 0 ? 1 : -1);
24708
24713
  }
24709
24714
  const D = E * 0.5 + 0.5, R = G * 0.5 + 0.5, M = Math.round(D * 255), i = Math.round(R * 255);
24710
24715
  return Math.round(I * (255 / Math.PI)) << 16 | i << 8 | M;
@@ -24714,7 +24719,7 @@ function jH(g, A) {
24714
24719
  let G = (Q - 0.5) * 2, D = (E - 0.5) * 2;
24715
24720
  const R = 1 - (Math.abs(G) + Math.abs(D)), M = Math.max(-R, 0);
24716
24721
  G += G >= 0 ? -M : M, D += D >= 0 ? -M : M;
24717
- const i = hi.set(G, D, R).normalize(), U = C / 255 * Math.PI * 0.5, y = Math.sin(U), F = Math.cos(U);
24722
+ const i = hi.set(G, D, R).normalize(), w = C / 255 * Math.PI * 0.5, y = Math.sin(w), F = Math.cos(w);
24718
24723
  return A.set(i.x * y, i.y * y, i.z * y, F), A;
24719
24724
  }
24720
24725
  function HH(g, A) {
@@ -25893,7 +25898,7 @@ class Ut extends RI {
25893
25898
  constructor({ vector: A }) {
25894
25899
  const B = { vector: EI(A) }, C = ZK(B.vector);
25895
25900
  super({ inTypes: B, outTypes: C, inputs: { vector: A } }), this.statements = ({ inputs: Q, outputs: E }) => {
25896
- const { x: G, y: D, z: R, w: M, r: i, g: o, b: U, a: y } = E, { vector: F } = Q;
25901
+ const { x: G, y: D, z: R, w: M, r: i, g: o, b: w, a: y } = E, { vector: F } = Q;
25897
25902
  return [
25898
25903
  G ? `${G} = ${F}.x;` : null,
25899
25904
  D ? `${D} = ${F}.y;` : null,
@@ -25901,7 +25906,7 @@ class Ut extends RI {
25901
25906
  M ? `${M} = ${F}.w;` : null,
25902
25907
  i ? `${i} = ${F}.r;` : null,
25903
25908
  o ? `${o} = ${F}.g;` : null,
25904
- U ? `${U} = ${F}.b;` : null,
25909
+ w ? `${w} = ${F}.b;` : null,
25905
25910
  y ? `${y} = ${F}.a;` : null
25906
25911
  ].filter(Boolean);
25907
25912
  };
@@ -25922,14 +25927,14 @@ class yt extends RI {
25922
25927
  }) {
25923
25928
  if (!A && !I)
25924
25929
  throw new Error("Either vector or vectorType must be provided");
25925
- const i = I ?? EI(A), o = cU(i), U = xU(i), y = {
25930
+ const i = I ?? EI(A), o = cU(i), w = xU(i), y = {
25926
25931
  vector: i,
25927
25932
  x: o,
25928
25933
  y: o,
25929
25934
  r: o,
25930
25935
  g: o
25931
25936
  }, F = { vector: A, x: B, y: C, r: G, g: D };
25932
- U >= 3 && (Object.assign(y, { z: o, b: o }), Object.assign(F, { z: Q, b: R })), U >= 4 && (Object.assign(y, { w: o, a: o }), Object.assign(F, { w: E, a: M })), super({ inTypes: y, outTypes: { vector: i }, inputs: F }), this.statements = ({ inputs: w, outputs: s }) => {
25937
+ w >= 3 && (Object.assign(y, { z: o, b: o }), Object.assign(F, { z: Q, b: R })), w >= 4 && (Object.assign(y, { w: o, a: o }), Object.assign(F, { w: E, a: M })), super({ inTypes: y, outTypes: { vector: i }, inputs: F }), this.statements = ({ inputs: U, outputs: s }) => {
25933
25938
  const { vector: x } = s, {
25934
25939
  vector: c,
25935
25940
  x: N,
@@ -25940,13 +25945,13 @@ class yt extends RI {
25940
25945
  g: h,
25941
25946
  b: Y,
25942
25947
  a: k
25943
- } = w, l = [
25948
+ } = U, l = [
25944
25949
  `${x}.x = ${N ?? n ?? (c ? `${c}.x` : MQ(o))};`,
25945
25950
  `${x}.y = ${S ?? h ?? (c ? `${c}.y` : MQ(o))};`
25946
25951
  ];
25947
- return U >= 3 && l.push(
25952
+ return w >= 3 && l.push(
25948
25953
  `${x}.z = ${a ?? Y ?? (c ? `${c}.z` : MQ(o))};`
25949
- ), U >= 4 && l.push(
25954
+ ), w >= 4 && l.push(
25950
25955
  `${x}.w = ${j ?? k ?? (c ? `${c}.w` : MQ(o))};`
25951
25956
  ), l;
25952
25957
  };
@@ -27177,7 +27182,7 @@ const _E = class SB {
27177
27182
  const i = cI * M * 4, o = C.subarray(
27178
27183
  R * 4,
27179
27184
  R * 4 + i
27180
- ), U = I?.readRenderTargetPixelsAsync(
27185
+ ), w = I?.readRenderTargetPixelsAsync(
27181
27186
  this.target,
27182
27187
  0,
27183
27188
  0,
@@ -27185,7 +27190,7 @@ const _E = class SB {
27185
27190
  M,
27186
27191
  o
27187
27192
  );
27188
- G.push(U), E += cI * M;
27193
+ G.push(w), E += cI * M;
27189
27194
  }
27190
27195
  return Promise.all(G).then(() => A);
27191
27196
  }
@@ -27532,9 +27537,9 @@ class Sn {
27532
27537
  let i = !1;
27533
27538
  i = this.updateSdfFloatData(R + 0, C?.x ?? 0) || i, i = this.updateSdfFloatData(R + 1, C?.y ?? 0) || i, i = this.updateSdfFloatData(R + 2, C?.z ?? 0) || i, i = this.updateSdfData(R + 3, M) || i, i = this.updateSdfFloatData(R + 4, Q?.x ?? 0) || i, i = this.updateSdfFloatData(R + 5, Q?.y ?? 0) || i, i = this.updateSdfFloatData(R + 6, Q?.z ?? 0) || i, i = this.updateSdfFloatData(R + 7, Q?.w ?? 0) || i, i = this.updateSdfFloatData(R + 8, E?.x ?? 0) || i, i = this.updateSdfFloatData(R + 9, E?.y ?? 0) || i, i = this.updateSdfFloatData(R + 10, E?.z ?? 0) || i, i = this.updateSdfData(R + 11, 0) || i, i = this.updateSdfFloatData(R + 12, G?.x ?? 0) || i, i = this.updateSdfFloatData(R + 13, G?.y ?? 0) || i, i = this.updateSdfFloatData(R + 14, G?.z ?? 0) || i, i = this.updateSdfFloatData(R + 15, G?.w ?? 0) || i;
27534
27539
  const o = Math.min(4, D.length);
27535
- for (let U = 0; U < o; ++U) {
27536
- const y = R + 16 + U * 4;
27537
- i = this.updateSdfFloatData(y + 0, D[U].x) || i, i = this.updateSdfFloatData(y + 1, D[U].y) || i, i = this.updateSdfFloatData(y + 2, D[U].z) || i, i = this.updateSdfFloatData(y + 3, D[U].w) || i;
27540
+ for (let w = 0; w < o; ++w) {
27541
+ const y = R + 16 + w * 4;
27542
+ i = this.updateSdfFloatData(y + 0, D[w].x) || i, i = this.updateSdfFloatData(y + 1, D[w].y) || i, i = this.updateSdfFloatData(y + 2, D[w].z) || i, i = this.updateSdfFloatData(y + 3, D[w].w) || i;
27538
27543
  }
27539
27544
  return i;
27540
27545
  }
@@ -27547,17 +27552,17 @@ class Sn {
27547
27552
  }), C = [new BI(), new BI()], Q = new H(), E = new LI(), G = new H(), D = new BI();
27548
27553
  let R = 0, M = B;
27549
27554
  A.length !== this.dynoNumEdits.value && (this.dynoNumEdits.value = A.length, this.numEdits = A.length, M = !0);
27550
- for (const [i, { edit: o, sdfs: U }] of A.entries()) {
27555
+ for (const [i, { edit: o, sdfs: w }] of A.entries()) {
27551
27556
  M = this.encodeEdit(i, {
27552
27557
  sdfFirst: R,
27553
- sdfCount: U.length,
27558
+ sdfCount: w.length,
27554
27559
  invert: o.invert,
27555
27560
  rgbaBlendMode: bn(o.rgbaBlendMode),
27556
27561
  softEdge: o.softEdge,
27557
27562
  sdfSmooth: o.sdfSmooth
27558
27563
  }) || M;
27559
27564
  let y = !1;
27560
- for (const F of U)
27565
+ for (const F of w)
27561
27566
  D.set(F.scale.x, F.scale.y, F.scale.z, F.radius), F.scale.setScalar(1), F.updateMatrixWorld(), F.matrixWorld.clone().invert().decompose(Q, E, G), F.scale.set(D.x, D.y, D.z), F.updateMatrixWorld(), C[0].set(F.color.r, F.color.g, F.color.b, F.opacity), C[1].set(F.displace.x, F.displace.y, F.displace.z, 1), y = this.encodeSdf(
27562
27567
  R,
27563
27568
  {
@@ -27944,7 +27949,7 @@ const SQ = class Si extends Yi {
27944
27949
  deltaTime: D
27945
27950
  };
27946
27951
  if (super({
27947
- update: ({ time: M, deltaTime: i, viewToWorld: o, globalEdits: U }) => this.update({ time: M, deltaTime: i, viewToWorld: o, globalEdits: U })
27952
+ update: ({ time: M, deltaTime: i, viewToWorld: o, globalEdits: w }) => this.update({ time: M, deltaTime: i, viewToWorld: o, globalEdits: w })
27948
27953
  }), this.isInitialized = !1, this.recolor = new VA(1, 1, 1), this.opacity = 1, this.enableViewToObject = !1, this.enableViewToWorld = !1, this.enableWorldToView = !1, this.skinning = null, this.edits = null, this.rgbaDisplaceEdits = null, this.splatRgba = null, this.maxSh = 3, this.packedSplats = A.packedSplats ?? new yB(), this.packedSplats && (this.packedSplats.splatEncoding = A.splatEncoding ?? {
27949
27954
  ...AG
27950
27955
  }), this.numSplats = this.packedSplats ? this.packedSplats.numSplats : 0, this.editable = A.editable ?? !0, this.onFrame = A.onFrame, this.context = R, this.objectModifier = A.objectModifier, this.worldModifier = A.worldModifier, this.updateGenerator(), A.url || A.fileBytes || A.constructSplats || A.packedSplats && !A.packedSplats.isInitialized)
@@ -28035,10 +28040,10 @@ const SQ = class Si extends Yi {
28035
28040
  if (A)
28036
28041
  I.min(D), B.max(D);
28037
28042
  else
28038
- for (const U of Q)
28043
+ for (const w of Q)
28039
28044
  for (const y of Q)
28040
28045
  for (const F of Q)
28041
- C.set(U * R.x, y * R.y, F * R.z), C.applyQuaternion(M), C.add(D), I.min(C), B.max(C);
28046
+ C.set(w * R.x, y * R.y, F * R.z), C.applyQuaternion(M), C.add(D), I.min(C), B.max(C);
28042
28047
  }
28043
28048
  ), new rg(I, B)) : new rg();
28044
28049
  }
@@ -28058,8 +28063,8 @@ const SQ = class Si extends Yi {
28058
28063
  const { x: S, y: a } = _F(N).outputs, j = vg(HB(S, a), zg("float", 0.5)), n = vg(Ni(a, S), zg("float", 0.5));
28059
28064
  return HB(j, vg(c, n));
28060
28065
  };
28061
- const U = B.translate, { center: y } = yQ(G).outputs, F = PF(Ni(y, U)), w = kn(G, R, F);
28062
- let s = o(w, this.packedSplats?.dynoSh1MinMax);
28066
+ const w = B.translate, { center: y } = yQ(G).outputs, F = PF(Ni(y, w)), U = kn(G, R, F);
28067
+ let s = o(U, this.packedSplats?.dynoSh1MinMax);
28063
28068
  if (this.maxSh >= 2 && M) {
28064
28069
  const c = Kn(G, M, F);
28065
28070
  s = HB(
@@ -28112,12 +28117,12 @@ const SQ = class Si extends Yi {
28112
28117
  this.context.viewToWorld.updateFromMatrix(I) && this.enableViewToWorld && (R = !0);
28113
28118
  const M = I.clone().invert();
28114
28119
  this.context.worldToView.updateFromMatrix(M) && this.enableWorldToView && (R = !0);
28115
- const U = new XA().compose(
28120
+ const w = new XA().compose(
28116
28121
  E.translate.value,
28117
28122
  E.rotate.value,
28118
28123
  new H().setScalar(E.scale.value)
28119
28124
  ).invert().multiply(I);
28120
- G.updateFromMatrix(U) && (this.enableViewToObject || this.packedSplats && this.packedSplats.extra.sh1) && (R = !0);
28125
+ G.updateFromMatrix(w) && (this.enableViewToObject || this.packedSplats && this.packedSplats.extra.sh1) && (R = !0);
28121
28126
  const y = new BI(
28122
28127
  this.recolor.r,
28123
28128
  this.recolor.g,
@@ -28129,7 +28134,7 @@ const SQ = class Si extends Yi {
28129
28134
  this.editable && !this.edits && this.traverseVisible((s) => {
28130
28135
  s instanceof Rc && F.push(s);
28131
28136
  }), F.sort((s, x) => s.ordering - x.ordering);
28132
- const w = F.map((s) => {
28137
+ const U = F.map((s) => {
28133
28138
  if (s.sdfs != null)
28134
28139
  return { edit: s, sdfs: s.sdfs };
28135
28140
  const x = [];
@@ -28137,8 +28142,8 @@ const SQ = class Si extends Yi {
28137
28142
  c instanceof Yn && x.push(c);
28138
28143
  }), { edit: s, sdfs: x };
28139
28144
  });
28140
- if (w.length > 0 && !this.rgbaDisplaceEdits) {
28141
- const s = w.length, x = w.reduce(
28145
+ if (U.length > 0 && !this.rgbaDisplaceEdits) {
28146
+ const s = U.length, x = U.reduce(
28142
28147
  (c, N) => c + N.sdfs.length,
28143
28148
  0
28144
28149
  );
@@ -28148,7 +28153,7 @@ const SQ = class Si extends Yi {
28148
28153
  }), this.updateGenerator();
28149
28154
  }
28150
28155
  if (this.rgbaDisplaceEdits) {
28151
- const s = this.rgbaDisplaceEdits.update(w);
28156
+ const s = this.rgbaDisplaceEdits.update(U);
28152
28157
  R || (R = s.updated), s.dynoUpdated && this.updateGenerator();
28153
28158
  }
28154
28159
  R && this.updateVersion(), (Q = this.onFrame) == null || Q.call(this, { mesh: this, time: A, deltaTime: B });
@@ -28178,10 +28183,10 @@ const SQ = class Si extends Yi {
28178
28183
  ((C = this.packedSplats.splatEncoding) == null ? void 0 : C.lnScaleMax) ?? UB
28179
28184
  );
28180
28185
  for (const F of y) {
28181
- const w = G.direction.clone().multiplyScalar(F).add(G.origin);
28186
+ const U = G.direction.clone().multiplyScalar(F).add(G.origin);
28182
28187
  I.push({
28183
28188
  distance: F,
28184
- point: w,
28189
+ point: U,
28185
28190
  object: this
28186
28191
  });
28187
28192
  }
@@ -28542,7 +28547,7 @@ const Hs = [
28542
28547
  (x, c) => [0, 1, 2].map((N, S) => 8 + c + S * s / 3)
28543
28548
  ), R = Q >= 1 ? new Float32Array(9) : void 0, M = Q >= 2 ? new Float32Array(15) : void 0, i = Q >= 3 ? new Float32Array(21) : void 0;
28544
28549
  }
28545
- function U(s, x) {
28550
+ function w(s, x) {
28546
28551
  if (!R)
28547
28552
  throw new Error("Missing sh1");
28548
28553
  const c = x.f_rest;
@@ -28618,7 +28623,7 @@ const Hs = [
28618
28623
  }
28619
28624
  function F(s) {
28620
28625
  if (I && s.name === "sh")
28621
- return Q = ai(s.properties), o(), U;
28626
+ return Q = ai(s.properties), o(), w;
28622
28627
  if (s.name !== "vertex")
28623
28628
  return null;
28624
28629
  const { packed_position: x, packed_rotation: c, packed_scale: N, packed_color: S } = s.properties;
@@ -28676,7 +28681,7 @@ const Hs = [
28676
28681
  );
28677
28682
  };
28678
28683
  }
28679
- const w = (s) => {
28684
+ const U = (s) => {
28680
28685
  if (s.name === "chunk")
28681
28686
  return y(s);
28682
28687
  if (B)
@@ -28739,7 +28744,7 @@ const Hs = [
28739
28744
  }
28740
28745
  };
28741
28746
  };
28742
- this.parseData(w);
28747
+ this.parseData(U);
28743
28748
  }
28744
28749
  // Inject RGBA values into original PLY file, which can be used to modify
28745
28750
  // the color/opacity of the Gsplats and write out the modified PLY file.
@@ -28762,21 +28767,21 @@ const Hs = [
28762
28767
  for (const [i, o] of Object.entries(G))
28763
28768
  if (o.isList)
28764
28769
  D.push(() => {
28765
- const U = HC[o.countType](
28770
+ const w = HC[o.countType](
28766
28771
  B,
28767
28772
  I,
28768
28773
  this.littleEndian
28769
28774
  );
28770
- I += Zg[o.countType], I += U * Zg[o.type];
28775
+ I += Zg[o.countType], I += w * Zg[o.type];
28771
28776
  });
28772
28777
  else {
28773
28778
  if (M)
28774
28779
  if (i === "f_dc_0" || i === "f_dc_1" || i === "f_dc_2") {
28775
- const U = Number.parseInt(
28780
+ const w = Number.parseInt(
28776
28781
  i.slice(5)
28777
28782
  );
28778
28783
  D.push(() => {
28779
- const y = (A[R + U] / 255 - 0.5) / ME;
28784
+ const y = (A[R + w] / 255 - 0.5) / ME;
28780
28785
  ks[o.type](
28781
28786
  B,
28782
28787
  I,
@@ -28785,7 +28790,7 @@ const Hs = [
28785
28790
  );
28786
28791
  });
28787
28792
  } else i === "opacity" && D.push(() => {
28788
- const U = Math.max(
28793
+ const w = Math.max(
28789
28794
  -100,
28790
28795
  Math.min(
28791
28796
  100,
@@ -28796,7 +28801,7 @@ const Hs = [
28796
28801
  B,
28797
28802
  I,
28798
28803
  this.littleEndian,
28799
- U
28804
+ w
28800
28805
  );
28801
28806
  });
28802
28807
  D.push(() => {
@@ -36664,7 +36669,7 @@ class zn extends zi {
36664
36669
  total: M.byteLength
36665
36670
  })
36666
36671
  ];
36667
- function U() {
36672
+ function w() {
36668
36673
  if (B) {
36669
36674
  const s = o.every((N) => N.lengthComputable || N.loaded === 0 && N.total === 0), x = o.reduce((N, S) => N + S.loaded, 0), c = o.reduce((N, S) => N + S.total, 0);
36670
36675
  B(
@@ -36676,19 +36681,19 @@ class zn extends zi {
36676
36681
  );
36677
36682
  }
36678
36683
  }
36679
- const y = {}, F = [], w = Fc(M);
36680
- if (R === "pcsogs" && w === void 0)
36684
+ const y = {}, F = [], U = Fc(M);
36685
+ if (R === "pcsogs" && U === void 0)
36681
36686
  throw new Error("Invalid PC SOGS file");
36682
- if (w !== void 0) {
36687
+ if (U !== void 0) {
36683
36688
  R = "pcsogs";
36684
36689
  for (const s of ["means", "scales", "quats", "sh0", "shN"]) {
36685
- const x = w[s];
36690
+ const x = U[s];
36686
36691
  if (x)
36687
36692
  for (const c of x.files) {
36688
36693
  const N = new URL(c, Q).toString(), S = o.length;
36689
36694
  o.push(new ProgressEvent("progress")), this.manager.itemStart(N);
36690
36695
  const a = new Request(N, { headers: E, credentials: G }), j = ns(a, (n) => {
36691
- o[S] = n, U();
36696
+ o[S] = n, w();
36692
36697
  }).then((n) => {
36693
36698
  y[c] = n;
36694
36699
  }).catch((n) => {
@@ -36857,11 +36862,11 @@ async function tc({
36857
36862
  splatEncoding: C
36858
36863
  };
36859
36864
  return await XB(async (i) => {
36860
- const { packedArray: o, numSplats: U, extra: y } = await i.call(
36865
+ const { packedArray: o, numSplats: w, extra: y } = await i.call(
36861
36866
  "unpackPly",
36862
36867
  M
36863
36868
  );
36864
- return { packedArray: o, numSplats: U, extra: y };
36869
+ return { packedArray: o, numSplats: w, extra: y };
36865
36870
  });
36866
36871
  }
36867
36872
  case "spz":
@@ -37291,7 +37296,7 @@ const AG = {
37291
37296
  for (E.uniforms.targetBase.value = I, E.uniforms.targetCount.value = B; I < D; ) {
37292
37297
  const M = Math.floor(I / R);
37293
37298
  E.uniforms.targetLayer.value = M;
37294
- const i = M * R, o = Math.floor((I - i) / cI), U = Math.min(
37299
+ const i = M * R, o = Math.floor((I - i) / cI), w = Math.min(
37295
37300
  IC,
37296
37301
  Math.ceil((D - i) / cI)
37297
37302
  );
@@ -37299,8 +37304,8 @@ const AG = {
37299
37304
  0,
37300
37305
  o,
37301
37306
  cI,
37302
- U - o
37303
- ), C.setRenderTarget(this.target, M), C.xr.enabled = !1, C.autoClear = !1, zI.fullScreenQuad.render(C), I += cI * (U - o);
37307
+ w - o
37308
+ ), C.setRenderTarget(this.target, M), C.xr.enabled = !1, C.autoClear = !1, zI.fullScreenQuad.render(C), I += cI * (w - o);
37304
37309
  }
37305
37310
  return this.resetRenderState(C, G), { nextBase: D };
37306
37311
  }
@@ -37485,18 +37490,18 @@ const ge = new Float32Array([
37485
37490
  const { superPixels: D, pixels: R } = this, M = C * C;
37486
37491
  for (let i = 0; i < E; i++) {
37487
37492
  const o = i * Q;
37488
- for (let U = 0; U < Q; U++) {
37489
- const y = U * C;
37490
- let F = 0, w = 0, s = 0, x = 0;
37493
+ for (let w = 0; w < Q; w++) {
37494
+ const y = w * C;
37495
+ let F = 0, U = 0, s = 0, x = 0;
37491
37496
  for (let N = 0; N < C; N++) {
37492
37497
  const S = (i * C + N) * this.target.width;
37493
37498
  for (let a = 0; a < C; a++) {
37494
37499
  const j = (S + y + a) * 4;
37495
- F += D[j], w += D[j + 1], s += D[j + 2], x += D[j + 3];
37500
+ F += D[j], U += D[j + 1], s += D[j + 2], x += D[j + 3];
37496
37501
  }
37497
37502
  }
37498
- const c = (o + U) * 4;
37499
- R[c] = F / M, R[c + 1] = w / M, R[c + 2] = s / M, R[c + 3] = x / M;
37503
+ const c = (o + w) * 4;
37504
+ R[c] = F / M, R[c + 1] = U / M, R[c + 2] = s / M, R[c + 3] = x / M;
37500
37505
  }
37501
37506
  }
37502
37507
  return R;
@@ -37584,10 +37589,10 @@ const ge = new Float32Array([
37584
37589
  sort32Reader: M,
37585
37590
  dynoSortRadial: i,
37586
37591
  dynoOrigin: o,
37587
- dynoDirection: U,
37592
+ dynoDirection: w,
37588
37593
  dynoDepthBias: y,
37589
37594
  dynoSort360: F,
37590
- dynoSplats: w
37595
+ dynoSplats: U
37591
37596
  } = oQ.makeSorter(), s = this.sort32 ?? !1;
37592
37597
  let x;
37593
37598
  if (s)
@@ -37597,7 +37602,7 @@ const ge = new Float32Array([
37597
37602
  this.readback16 = D.ensureBuffer(n, this.readback16), x = this.readback16;
37598
37603
  }
37599
37604
  const c = A.toWorld.clone().invert(), N = I.clone().premultiply(c);
37600
- i.value = this.sort360 ? !0 : this.sortRadial, o.value.set(0, 0, 0).applyMatrix4(N), U.value.set(0, 0, -1).applyMatrix4(N).sub(o.value).normalize(), y.value = this.depthBias ?? 1, F.value = this.sort360 ?? !1, w.packedSplats = A.splats;
37605
+ i.value = this.sort360 ? !0 : this.sortRadial, o.value.set(0, 0, 0).applyMatrix4(N), w.value.set(0, 0, -1).applyMatrix4(N).sub(o.value).normalize(), y.value = this.depthBias ?? 1, F.value = this.sort360 ?? !1, U.packedSplats = A.splats;
37601
37606
  const S = s ? M : R, a = s ? C : Math.ceil(C / 2);
37602
37607
  await D.renderReadback({
37603
37608
  renderer: this.spark.renderer,
@@ -37658,13 +37663,13 @@ const ge = new Float32Array([
37658
37663
  sortDirection: B,
37659
37664
  sortDepthBias: C,
37660
37665
  sort360: Q
37661
- }, o = vg(M, zg("int", 2)), U = ZC(E, o), y = FD({ gsplat: U, ...i }), F = ZC(
37666
+ }, o = vg(M, zg("int", 2)), w = ZC(E, o), y = FD({ gsplat: w, ...i }), F = ZC(
37662
37667
  E,
37663
37668
  HB(o, zg("int", 1))
37664
- ), w = FD({ gsplat: F, ...i }), s = eQ({
37669
+ ), U = FD({ gsplat: F, ...i }), s = eQ({
37665
37670
  vectorType: "vec2",
37666
37671
  x: y,
37667
- y: w
37672
+ y: U
37668
37673
  });
37669
37674
  return { rgba8: bi(xF(s)) };
37670
37675
  }
@@ -37680,8 +37685,8 @@ const ge = new Float32Array([
37680
37685
  sortDirection: B,
37681
37686
  sortDepthBias: C,
37682
37687
  sort360: Q
37683
- }, o = ZC(E, M), U = FD({ gsplat: o, ...i });
37684
- return { rgba8: bi(cF(U)) };
37688
+ }, o = ZC(E, M), w = FD({ gsplat: o, ...i });
37689
+ return { rgba8: bi(cF(w)) };
37685
37690
  }
37686
37691
  );
37687
37692
  oQ.dynos = {
@@ -37751,10 +37756,10 @@ function FD({
37751
37756
  sortOrigin: M,
37752
37757
  sortDirection: i,
37753
37758
  sortDepthBias: o,
37754
- sort360: U
37759
+ sort360: w
37755
37760
  } = E;
37756
37761
  return pg(`
37757
- ${G.metric} = computeSort(${D}, ${R}, ${M}, ${i}, ${o}, ${U});
37762
+ ${G.metric} = computeSort(${D}, ${R}, ${M}, ${i}, ${o}, ${w});
37758
37763
  `);
37759
37764
  }
37760
37765
  }).outputs.metric;
@@ -37776,23 +37781,23 @@ class tD {
37776
37781
  }) {
37777
37782
  const E = this.mapping.reduce((R, M) => (R.set(M.node, M), R), /* @__PURE__ */ new Map());
37778
37783
  let G = 0, D = 0;
37779
- for (const { node: R, generator: M, version: i, base: o, count: U } of B) {
37784
+ for (const { node: R, generator: M, version: i, base: o, count: w } of B) {
37780
37785
  const y = E.get(R);
37781
- if ((C || M !== y?.generator || i !== y?.version || o !== y?.base || U !== y?.count) && M && U > 0) {
37786
+ if ((C || M !== y?.generator || i !== y?.version || o !== y?.base || w !== y?.count) && M && w > 0) {
37782
37787
  const F = I.apply(M);
37783
37788
  try {
37784
37789
  this.splats.generate({
37785
37790
  generator: F,
37786
37791
  base: o,
37787
- count: U,
37792
+ count: w,
37788
37793
  renderer: A
37789
37794
  });
37790
- } catch (w) {
37791
- R.generator = void 0, R.generatorError = w;
37795
+ } catch (U) {
37796
+ R.generator = void 0, R.generatorError = U;
37792
37797
  }
37793
37798
  G += 1;
37794
37799
  }
37795
- D = Math.max(D, o + U);
37800
+ D = Math.max(D, o + w);
37796
37801
  }
37797
37802
  return this.splats.numSplats = D, this.toWorld.copy(Q), this.mapping = B, G !== 0;
37798
37803
  }
@@ -38534,7 +38539,7 @@ const Js = 5, IG = class PI extends og {
38534
38539
  this.defaultView.viewToWorld = B.matrixWorld.clone(), this.defaultCameras = [this.defaultView.viewToWorld];
38535
38540
  else {
38536
38541
  const F = A.xr.getCamera().cameras;
38537
- this.defaultCameras = F.map((w) => w.matrixWorld), this.defaultView.viewToWorld = De(this.defaultCameras) ?? new XA();
38542
+ this.defaultCameras = F.map((U) => U.matrixWorld), this.defaultView.viewToWorld = De(this.defaultCameras) ?? new XA();
38538
38543
  }
38539
38544
  this.autoUpdate && this.update({ scene: I, viewToWorld: this.defaultView.viewToWorld });
38540
38545
  }
@@ -38548,14 +38553,14 @@ const Js = 5, IG = class PI extends og {
38548
38553
  this.uniforms.renderSize.value
38549
38554
  );
38550
38555
  if (F.x === 1 && F.y === 1) {
38551
- const w = (C = A.xr.getSession()) == null ? void 0 : C.renderState.baseLayer;
38552
- w && (F.x = w.framebufferWidth, F.y = w.framebufferHeight);
38556
+ const U = (C = A.xr.getSession()) == null ? void 0 : C.renderState.baseLayer;
38557
+ U && (F.x = U.framebufferWidth, F.y = U.framebufferHeight);
38553
38558
  }
38554
38559
  }
38555
38560
  const i = B;
38556
38561
  if (this.uniforms.near.value = i.near, this.uniforms.far.value = i.far, this.uniforms.encodeLinear.value = M.encodeLinear, this.uniforms.maxStdDev.value = this.maxStdDev, this.uniforms.minPixelRadius.value = this.minPixelRadius, this.uniforms.maxPixelRadius.value = this.maxPixelRadius, this.uniforms.minAlpha.value = this.minAlpha, this.uniforms.stochastic.value = M.stochastic, this.uniforms.enable2DGS.value = this.enable2DGS, this.uniforms.preBlurAmount.value = this.preBlurAmount, this.uniforms.blurAmount.value = this.blurAmount, this.uniforms.focalDistance.value = this.focalDistance, this.uniforms.apertureAngle.value = this.apertureAngle, this.uniforms.falloff.value = this.falloff, this.uniforms.clipXY.value = this.clipXY, this.uniforms.focalAdjustment.value = this.focalAdjustment, this.lastStochastic !== !M.stochastic && (this.lastStochastic = !M.stochastic, this.material.transparent = !M.stochastic, this.material.depthWrite = M.stochastic, this.material.needsUpdate = !0), this.splatTexture) {
38557
- const { enable: F, texture: w, multiply: s, add: x, near: c, far: N, mid: S } = this.splatTexture;
38558
- F && w ? (this.uniforms.splatTexEnable.value = !0, this.uniforms.splatTexture.value = w, s ? this.uniforms.splatTexMul.value.fromArray(s.elements) : this.uniforms.splatTexMul.value.set(
38562
+ const { enable: F, texture: U, multiply: s, add: x, near: c, far: N, mid: S } = this.splatTexture;
38563
+ F && U ? (this.uniforms.splatTexEnable.value = !0, this.uniforms.splatTexture.value = U, s ? this.uniforms.splatTexMul.value.fromArray(s.elements) : this.uniforms.splatTexMul.value.set(
38559
38564
  0.5 / this.maxStdDev,
38560
38565
  0,
38561
38566
  0,
@@ -38563,8 +38568,8 @@ const Js = 5, IG = class PI extends og {
38563
38568
  ), this.uniforms.splatTexAdd.value.set(x?.x ?? 0.5, x?.y ?? 0.5), this.uniforms.splatTexNear.value = c ?? this.uniforms.near.value, this.uniforms.splatTexFar.value = N ?? this.uniforms.far.value, this.uniforms.splatTexMid.value = S ?? 0) : (this.uniforms.splatTexEnable.value = !1, this.uniforms.splatTexture.value = PI.EMPTY_SPLAT_TEXTURE);
38564
38569
  } else
38565
38570
  this.uniforms.splatTexEnable.value = !1, this.uniforms.splatTexture.value = PI.EMPTY_SPLAT_TEXTURE;
38566
- const o = ((Q = M.display) == null ? void 0 : Q.accumulator.toWorld) ?? new XA(), U = B.matrixWorld.clone().invert();
38567
- o.clone().premultiply(U).decompose(
38571
+ const o = ((Q = M.display) == null ? void 0 : Q.accumulator.toWorld) ?? new XA(), w = B.matrixWorld.clone().invert();
38572
+ o.clone().premultiply(w).decompose(
38568
38573
  this.uniforms.renderToViewPos.value,
38569
38574
  this.uniforms.renderToViewQuat.value,
38570
38575
  new H()
@@ -38618,7 +38623,7 @@ const Js = 5, IG = class PI extends og {
38618
38623
  I || (I = this.active.toWorld), B = B ?? I.clone();
38619
38624
  const Q = this.time ?? this.clock.getElapsedTime(), E = Q - (this.lastUpdateTime ?? Q);
38620
38625
  this.lastUpdateTime = Q;
38621
- const G = this.active.mapping.reduce((F, w) => (F.set(w.node, w), F), /* @__PURE__ */ new Map()), { generators: D, visibleGenerators: R, globalEdits: M } = this.compileScene(A);
38626
+ const G = this.active.mapping.reduce((F, U) => (F.set(U.node, U), F), /* @__PURE__ */ new Map()), { generators: D, visibleGenerators: R, globalEdits: M } = this.compileScene(A);
38622
38627
  for (const F of D)
38623
38628
  (C = F.frameUpdate) == null || C.call(F, {
38624
38629
  object: F,
@@ -38629,20 +38634,20 @@ const Js = 5, IG = class PI extends og {
38629
38634
  });
38630
38635
  const i = new Set(R.map((F) => F.uuid));
38631
38636
  for (const F of D) {
38632
- const w = G.get(F), x = F.generator && i.has(F.uuid) ? F.numSplats : 0;
38633
- (this.needsUpdate || F.generator !== w?.generator || x !== w?.count) && F.updateVersion();
38637
+ const U = G.get(F), x = F.generator && i.has(F.uuid) ? F.numSplats : 0;
38638
+ (this.needsUpdate || F.generator !== U?.generator || x !== U?.count) && F.updateVersion();
38634
38639
  }
38635
38640
  const o = !xi({
38636
38641
  matrix1: I,
38637
38642
  matrix2: this.active.toWorld,
38638
38643
  maxDistance: this.originDistance
38639
- }), U = this.needsUpdate || o || D.length !== G.size || D.some((F) => {
38640
- var w;
38641
- return F.version !== ((w = G.get(F)) == null ? void 0 : w.version);
38644
+ }), w = this.needsUpdate || o || D.length !== G.size || D.some((F) => {
38645
+ var U;
38646
+ return F.version !== ((U = G.get(F)) == null ? void 0 : U.version);
38642
38647
  });
38643
38648
  this.needsUpdate = !1;
38644
38649
  let y = null;
38645
- if (U) {
38650
+ if (w) {
38646
38651
  if (y = this.maybeAllocAccumulator(), !y)
38647
38652
  throw new Error("Unreachable");
38648
38653
  const F = !xi({
@@ -38732,20 +38737,20 @@ const Js = 5, IG = class PI extends og {
38732
38737
  format: mI,
38733
38738
  generateMipmaps: !0,
38734
38739
  minFilter: fh
38735
- }), w = new mw(Q, E, F);
38736
- PI.cubeRender = { target: F, camera: w, near: Q, far: E };
38740
+ }), U = new mw(Q, E, F);
38741
+ PI.cubeRender = { target: F, camera: U, near: Q, far: E };
38737
38742
  }
38738
38743
  PI.pmrem || (PI.pmrem = new yi(A ?? this.renderer));
38739
38744
  const i = new XA().setPosition(B);
38740
38745
  await ((R = this.envViewpoint) == null ? void 0 : R.prepare({ scene: I, viewToWorld: i, update: D }));
38741
- const { target: o, camera: U } = PI.cubeRender;
38742
- U.position.copy(B);
38746
+ const { target: o, camera: w } = PI.cubeRender;
38747
+ w.position.copy(B);
38743
38748
  const y = /* @__PURE__ */ new Map();
38744
38749
  for (const F of G)
38745
38750
  y.set(F, F.visible), F.visible = !1;
38746
- this.prepareViewpoint(this.envViewpoint), U.update(A ?? this.renderer, I), this.prepareViewpoint(this.defaultView);
38747
- for (const [F, w] of y.entries())
38748
- F.visible = w;
38751
+ this.prepareViewpoint(this.envViewpoint), w.update(A ?? this.renderer, I), this.prepareViewpoint(this.defaultView);
38752
+ for (const [F, U] of y.entries())
38753
+ F.visible = U;
38749
38754
  return (M = PI.pmrem) == null ? void 0 : M.fromCubemap(o.texture).texture;
38750
38755
  }
38751
38756
  // Utility function to recursively set the envMap property for any
@@ -38901,10 +38906,10 @@ const cc = class ji {
38901
38906
  function E() {
38902
38907
  let i = null;
38903
38908
  async function o(F) {
38904
- console.log("onSessionStarted"), F.addEventListener("end", U), await A.xr.setSession(F), Q.textContent = "EXIT VR", i = F;
38909
+ console.log("onSessionStarted"), F.addEventListener("end", w), await A.xr.setSession(F), Q.textContent = "EXIT VR", i = F;
38905
38910
  }
38906
- function U() {
38907
- console.log("onSessionEnded"), i?.removeEventListener("end", U), Q.textContent = "ENTER VR", i = null;
38911
+ function w() {
38912
+ console.log("onSessionEnded"), i?.removeEventListener("end", w), Q.textContent = "ENTER VR", i = null;
38908
38913
  }
38909
38914
  Q.style.display = "", Q.style.cursor = "pointer", Q.style.left = "calc(50% - 100px)", Q.style.width = "200px", Q.style.height = "100px", Q.textContent = "ENTER VR";
38910
38915
  const y = {
@@ -39086,8 +39091,8 @@ class Ue {
39086
39091
  [E, G, D]
39087
39092
  ];
39088
39093
  let M = 1 / 0, i = -1 / 0;
39089
- for (const [o, U, y] of R) {
39090
- const F = -(I[2] * o + I[6] * U + I[10] * y + I[14]);
39094
+ for (const [o, w, y] of R) {
39095
+ const F = -(I[2] * o + I[6] * w + I[10] * y + I[14]);
39091
39096
  F > 0 && (M = Math.min(M, F), i = Math.max(i, F));
39092
39097
  }
39093
39098
  M < i && (this.#C.value = M, this.#Q.value = i);
@@ -39337,11 +39342,14 @@ class i0 extends AC {
39337
39342
  B.instanceCount = I, B.attributes.instanceMatrix.needsUpdate = !0, B.attributes.instanceColor.needsUpdate = !0;
39338
39343
  }
39339
39344
  }
39345
+ onStreamLoaded() {
39346
+ this.dispatchEvent({ type: "streamloaded" });
39347
+ }
39340
39348
  getObjectBounds() {
39341
39349
  const A = new rg(), I = this.#C(), B = I.length;
39342
39350
  for (let E = 0; E < B; E++) {
39343
- const G = I[E].bounds(), D = new H(G[0], G[1], G[2]), M = new H().fromArray(G.slice(3, 6)).clone().multiplyScalar(0.5), i = D.clone().sub(M), o = D.clone().add(M), U = new rg(i, o), y = I[E].parentedTransform().premultiply(this.matrix);
39344
- U.applyMatrix4(y), A.union(U);
39351
+ const G = I[E].bounds(), D = new H(G[0], G[1], G[2]), M = new H().fromArray(G.slice(3, 6)).clone().multiplyScalar(0.5), i = D.clone().sub(M), o = D.clone().add(M), w = new rg(i, o), y = I[E].parentedTransform().premultiply(this.matrix);
39352
+ w.applyMatrix4(y), A.union(w);
39345
39353
  }
39346
39354
  const C = new H();
39347
39355
  C.subVectors(A.max, A.min);
@@ -42524,8 +42532,8 @@ class aQ extends HTMLElement {
42524
42532
  _enable() {
42525
42533
  if (!this.getRootNode().contains(this) || !this._threeObject)
42526
42534
  return;
42527
- const { position: A, rotation: I, scale: B, zoom: C } = this, { x: Q, y: E, z: G } = A, { x: D, y: R, z: M } = I, { x: i, y: o, z: U } = B;
42528
- this._threeObject.position.set(Q, E, G), this._threeObject.rotation.set(D, R, M), this._threeObject.scale.set(C * i, C * o, C * U), this._parent && pI.publish(this._parent, "add", this._threeObject);
42535
+ const { position: A, rotation: I, scale: B, zoom: C } = this, { x: Q, y: E, z: G } = A, { x: D, y: R, z: M } = I, { x: i, y: o, z: w } = B;
42536
+ this._threeObject.position.set(Q, E, G), this._threeObject.rotation.set(D, R, M), this._threeObject.scale.set(C * i, C * o, C * w), this._parent && pI.publish(this._parent, "add", this._threeObject);
42529
42537
  }
42530
42538
  _disable() {
42531
42539
  this._parent && pI.publish(this._parent, "remove", this._threeObject), this._threeObject = null;
@@ -42752,7 +42760,9 @@ class pe extends aQ {
42752
42760
  key: this.key ?? void 0,
42753
42761
  authToken: this.#C ?? void 0,
42754
42762
  drmKey: this.#Q ?? void 0
42755
- }), this._threeObject.name = this.uuid), super._enable(), !this._parent && this.uuid && this.#s(), this.#o && this._threeObject && this.#o.add(this._threeObject), this.controls && this.#U());
42763
+ }), this._threeObject.name = this.uuid, this._threeObject.addEventListener("streamloaded", () => {
42764
+ this.#F();
42765
+ })), super._enable(), !this._parent && this.uuid && this.#s(), this.#o && this._threeObject && this.#o.add(this._threeObject), this.controls && this.#U());
42756
42766
  }
42757
42767
  #w() {
42758
42768
  this.#D && (this.#D?.dispose(), this.#D = null), this.#i && (this.#i?.disconnect(), this.#i = null);
@@ -42770,6 +42780,9 @@ class pe extends aQ {
42770
42780
  const A = this.closest("miris-scene");
42771
42781
  A && pI.publish(A, "uncontrol", this._threeObject);
42772
42782
  }
42783
+ #F() {
42784
+ this.dispatchEvent(new CustomEvent("streamloaded", { bubbles: !0 }));
42785
+ }
42773
42786
  attributeChangedCallback(A, I, B) {
42774
42787
  switch (super.attributeChangedCallback(A, I, B), A) {
42775
42788
  case "auth-token":