softbox 4.1.2 → 4.1.3

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.
@@ -161,7 +161,7 @@ class Ac {
161
161
  * aborts before touching a disposed renderer/scene.
162
162
  */
163
163
  async configureEnvironment(e, t, n, s, r, o) {
164
- var u, h, f, p, w, _;
164
+ var u, h, f, p, y, S;
165
165
  const a = await t.initialize({ renderer: s, autoDispose: !0 });
166
166
  if (o())
167
167
  return;
@@ -172,25 +172,25 @@ class Ac {
172
172
  environmentIntensity: (f = r.environment) == null ? void 0 : f.environmentIntensity
173
173
  }, d = (p = r.environment) == null ? void 0 : p.url;
174
174
  if (d) {
175
- const y = await t.loadEnvironmentMap(d);
175
+ const w = await t.loadEnvironmentMap(d);
176
176
  if (o())
177
177
  return;
178
- y.ok ? t.applyToScene(e, y.value, c) : console.warn("Failed to load environment map:", y.error);
179
- } else if ((w = r.helpers) != null && w.studioEnvironment) {
180
- const y = t.createStudioEnvironment();
181
- if (y.ok) {
182
- if (t.applyToScene(e, y.value, {
178
+ w.ok ? t.applyToScene(e, w.value, c) : console.warn("Failed to load environment map:", w.error);
179
+ } else if ((y = r.helpers) != null && y.studioEnvironment) {
180
+ const w = t.createStudioEnvironment();
181
+ if (w.ok) {
182
+ if (t.applyToScene(e, w.value, {
183
183
  ...c,
184
184
  setBackground: !1
185
- }), (_ = r.helpers) != null && _.darkStudioMode && n) {
186
- const S = n.createGradientBackground(e, {
185
+ }), (S = r.helpers) != null && S.darkStudioMode && n) {
186
+ const x = n.createGradientBackground(e, {
187
187
  topColor: Cr,
188
188
  bottomColor: Cr
189
189
  });
190
- S.ok || console.warn("Failed to set dark studio background:", S.error);
190
+ x.ok || console.warn("Failed to set dark studio background:", x.error);
191
191
  }
192
192
  } else
193
- console.warn("Failed to create studio environment:", y.error);
193
+ console.warn("Failed to create studio environment:", w.error);
194
194
  }
195
195
  }
196
196
  }
@@ -999,11 +999,11 @@ class Dc {
999
999
  }, d = `video-capture:${Do()}`;
1000
1000
  return this.deps.renderLoopManager.requireContinuous(d), this.deps.reviveRenderLoop(), this.deps.renderLoopManager.requestRender(), new Promise((h) => {
1001
1001
  const f = [];
1002
- let p = null, w = !1;
1003
- const _ = (S) => {
1004
- w || (w = !0, this.pendingSettlers.delete(y), c(), p !== null && clearTimeout(p), this.deps.renderLoopManager.releaseContinuous(d), s.getTracks().forEach((E) => E.stop()), h(S));
1005
- }, y = () => {
1006
- _(
1002
+ let p = null, y = !1;
1003
+ const S = (x) => {
1004
+ y || (y = !0, this.pendingSettlers.delete(w), c(), p !== null && clearTimeout(p), this.deps.renderLoopManager.releaseContinuous(d), s.getTracks().forEach((E) => E.stop()), h(x));
1005
+ }, w = () => {
1006
+ S(
1007
1007
  B.err(
1008
1008
  new W("Viewer was disposed during video capture", Y.INVALID_STATE)
1009
1009
  )
@@ -1013,12 +1013,12 @@ class Dc {
1013
1013
  } catch {
1014
1014
  }
1015
1015
  };
1016
- this.pendingSettlers.add(y), r.ondataavailable = (S) => {
1017
- S.data.size > 0 && f.push(S.data);
1016
+ this.pendingSettlers.add(w), r.ondataavailable = (x) => {
1017
+ x.data.size > 0 && f.push(x.data);
1018
1018
  }, r.onstop = () => {
1019
- _(B.ok(new Blob(f, { type: r.mimeType || "video/webm" })));
1019
+ S(B.ok(new Blob(f, { type: r.mimeType || "video/webm" })));
1020
1020
  }, r.onerror = () => {
1021
- _(
1021
+ S(
1022
1022
  B.err(
1023
1023
  new W("Video recording failed", Y.OPERATION_FAILED)
1024
1024
  )
@@ -1079,17 +1079,17 @@ class Dc {
1079
1079
  e.width ?? (e.height !== void 0 ? e.height * h : d * a)
1080
1080
  ), p = Math.round(
1081
1081
  e.height ?? (e.width !== void 0 ? e.width / h : u * a)
1082
- ), w = t.capabilities.maxTextureSize;
1083
- if (!Number.isFinite(f) || !Number.isFinite(p) || f <= 0 || p <= 0 || f > w || p > w)
1082
+ ), y = t.capabilities.maxTextureSize;
1083
+ if (!Number.isFinite(f) || !Number.isFinite(p) || f <= 0 || p <= 0 || f > y || p > y)
1084
1084
  return B.err(
1085
1085
  new W(
1086
- `Requested still size ${f}x${p} is outside 1..${w}`,
1086
+ `Requested still size ${f}x${p} is outside 1..${y}`,
1087
1087
  Y.INVALID_PARAMETER
1088
1088
  )
1089
1089
  );
1090
1090
  t.setPixelRatio(1), t.setSize(f, p), Mi(s, f / p);
1091
- const _ = t.render(n, s), y = _.ok ? this.readCanvasPng() : B.err(_.error);
1092
- return t.setSize(d, u), t.setPixelRatio(a), Mi(s, h), t.render(n, s), r.requestRender(), y;
1091
+ const S = t.render(n, s), w = S.ok ? this.readCanvasPng() : B.err(S.error);
1092
+ return t.setSize(d, u), t.setPixelRatio(a), Mi(s, h), t.render(n, s), r.requestRender(), w;
1093
1093
  }
1094
1094
  readCanvasPng() {
1095
1095
  const e = Oo(this.deps.renderer.getDomElement());
@@ -1294,7 +1294,7 @@ class Nc {
1294
1294
  * helpers — take effect at construction time and require a rebuild.
1295
1295
  */
1296
1296
  updateOptions(e) {
1297
- var u, h, f, p, w, _, y, S;
1297
+ var u, h, f, p, y, S, w, x;
1298
1298
  if (this.disposed)
1299
1299
  return;
1300
1300
  const t = (u = this.options.animations) == null ? void 0 : u.autoplay;
@@ -1307,12 +1307,12 @@ class Nc {
1307
1307
  r !== void 0 && (this.scene.setEnvironmentIntensity(r), n = !0);
1308
1308
  const o = (p = e.controls) == null ? void 0 : p.autoRotate;
1309
1309
  o !== void 0 && (this.controls.autoRotate = o, o ? this.renderLoopManager.requireContinuous("turntable") : this.renderLoopManager.releaseContinuous("turntable"), n = !0);
1310
- const a = (w = e.controls) == null ? void 0 : w.autoRotateSpeed;
1310
+ const a = (y = e.controls) == null ? void 0 : y.autoRotateSpeed;
1311
1311
  a !== void 0 && (this.controls.autoRotateSpeed = a, n = !0);
1312
- const c = (_ = e.animations) == null ? void 0 : _.autoplay;
1312
+ const c = (S = e.animations) == null ? void 0 : S.autoplay;
1313
1313
  c !== void 0 && c !== t && (c ? this.playAnimations(typeof c == "string" ? c : void 0) : this.pauseAnimations(), n = !0);
1314
- const d = (y = e.animations) == null ? void 0 : y.speed;
1315
- d !== void 0 && ((S = this.animationService) == null || S.setSpeed(d), n = !0), n && (this.reviveRenderLoop(), this.renderLoopManager.requestRender());
1314
+ const d = (w = e.animations) == null ? void 0 : w.speed;
1315
+ d !== void 0 && ((x = this.animationService) == null || x.setSpeed(d), n = !0), n && (this.reviveRenderLoop(), this.renderLoopManager.requestRender());
1316
1316
  }
1317
1317
  applyBackgroundColor(e) {
1318
1318
  var n;
@@ -1594,17 +1594,17 @@ function Fd(i) {
1594
1594
  return i;
1595
1595
  }
1596
1596
  function ii(i, e, t, n, s) {
1597
- let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, d = -1 / 0, u = -1 / 0, h = 1 / 0, f = 1 / 0, p = 1 / 0, w = -1 / 0, _ = -1 / 0, y = -1 / 0;
1598
- const S = i.offset || 0;
1599
- for (let E = (e - S) * 6, b = (e + t - S) * 6; E < b; E += 6) {
1600
- const x = i[E + 0], v = i[E + 1], L = x - v, C = x + v;
1601
- L < r && (r = L), C > c && (c = C), x < h && (h = x), x > w && (w = x);
1602
- const M = i[E + 2], D = i[E + 3], I = M - D, N = M + D;
1603
- I < o && (o = I), N > d && (d = N), M < f && (f = M), M > _ && (_ = M);
1597
+ let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, d = -1 / 0, u = -1 / 0, h = 1 / 0, f = 1 / 0, p = 1 / 0, y = -1 / 0, S = -1 / 0, w = -1 / 0;
1598
+ const x = i.offset || 0;
1599
+ for (let E = (e - x) * 6, b = (e + t - x) * 6; E < b; E += 6) {
1600
+ const _ = i[E + 0], A = i[E + 1], P = _ - A, I = _ + A;
1601
+ P < r && (r = P), I > c && (c = I), _ < h && (h = _), _ > y && (y = _);
1602
+ const M = i[E + 2], D = i[E + 3], C = M - D, N = M + D;
1603
+ C < o && (o = C), N > d && (d = N), M < f && (f = M), M > S && (S = M);
1604
1604
  const O = i[E + 4], F = i[E + 5], V = O - F, te = O + F;
1605
- V < a && (a = V), te > u && (u = te), O < p && (p = O), O > y && (y = O);
1605
+ V < a && (a = V), te > u && (u = te), O < p && (p = O), O > w && (w = O);
1606
1606
  }
1607
- n[0] = r, n[1] = o, n[2] = a, n[3] = c, n[4] = d, n[5] = u, s[0] = h, s[1] = f, s[2] = p, s[3] = w, s[4] = _, s[5] = y;
1607
+ n[0] = r, n[1] = o, n[2] = a, n[3] = c, n[4] = d, n[5] = u, s[0] = h, s[1] = f, s[2] = p, s[3] = y, s[4] = S, s[5] = w;
1608
1608
  }
1609
1609
  const Ct = 32, zc = (i, e) => i.candidate - e.candidate, zt = /* @__PURE__ */ new Array(Ct).fill().map(() => ({
1610
1610
  count: 0,
@@ -1624,76 +1624,76 @@ function Bc(i, e, t, n, s, r) {
1624
1624
  let d = si * s;
1625
1625
  const u = t.offset || 0, h = (n - u) * 6, f = (n + s - u) * 6;
1626
1626
  for (let p = 0; p < 3; p++) {
1627
- const w = e[p], S = (e[p + 3] - w) / Ct;
1627
+ const y = e[p], x = (e[p + 3] - y) / Ct;
1628
1628
  if (s < Ct / 4) {
1629
1629
  const E = [...zt];
1630
1630
  E.length = s;
1631
1631
  let b = 0;
1632
- for (let v = h; v < f; v += 6, b++) {
1633
- const L = E[b];
1634
- L.candidate = t[v + 2 * p], L.count = 0;
1632
+ for (let A = h; A < f; A += 6, b++) {
1633
+ const P = E[b];
1634
+ P.candidate = t[A + 2 * p], P.count = 0;
1635
1635
  const {
1636
- bounds: C,
1636
+ bounds: I,
1637
1637
  leftCacheBounds: M,
1638
1638
  rightCacheBounds: D
1639
- } = L;
1640
- for (let I = 0; I < 3; I++)
1641
- D[I] = 1 / 0, D[I + 3] = -1 / 0, M[I] = 1 / 0, M[I + 3] = -1 / 0, C[I] = 1 / 0, C[I + 3] = -1 / 0;
1642
- ps(v, t, C);
1639
+ } = P;
1640
+ for (let C = 0; C < 3; C++)
1641
+ D[C] = 1 / 0, D[C + 3] = -1 / 0, M[C] = 1 / 0, M[C + 3] = -1 / 0, I[C] = 1 / 0, I[C + 3] = -1 / 0;
1642
+ ps(A, t, I);
1643
1643
  }
1644
1644
  E.sort(zc);
1645
- let x = s;
1646
- for (let v = 0; v < x; v++) {
1647
- const L = E[v];
1648
- for (; v + 1 < x && E[v + 1].candidate === L.candidate; )
1649
- E.splice(v + 1, 1), x--;
1645
+ let _ = s;
1646
+ for (let A = 0; A < _; A++) {
1647
+ const P = E[A];
1648
+ for (; A + 1 < _ && E[A + 1].candidate === P.candidate; )
1649
+ E.splice(A + 1, 1), _--;
1650
1650
  }
1651
- for (let v = h; v < f; v += 6) {
1652
- const L = t[v + 2 * p];
1653
- for (let C = 0; C < x; C++) {
1654
- const M = E[C];
1655
- L >= M.candidate ? ps(v, t, M.rightCacheBounds) : (ps(v, t, M.leftCacheBounds), M.count++);
1651
+ for (let A = h; A < f; A += 6) {
1652
+ const P = t[A + 2 * p];
1653
+ for (let I = 0; I < _; I++) {
1654
+ const M = E[I];
1655
+ P >= M.candidate ? ps(A, t, M.rightCacheBounds) : (ps(A, t, M.leftCacheBounds), M.count++);
1656
1656
  }
1657
1657
  }
1658
- for (let v = 0; v < x; v++) {
1659
- const L = E[v], C = L.count, M = s - L.count, D = L.leftCacheBounds, I = L.rightCacheBounds;
1658
+ for (let A = 0; A < _; A++) {
1659
+ const P = E[A], I = P.count, M = s - P.count, D = P.leftCacheBounds, C = P.rightCacheBounds;
1660
1660
  let N = 0;
1661
- C !== 0 && (N = Cn(D) / c);
1661
+ I !== 0 && (N = Cn(D) / c);
1662
1662
  let O = 0;
1663
- M !== 0 && (O = Cn(I) / c);
1664
- const F = Lr + si * (N * C + O * M);
1665
- F < d && (o = p, d = F, a = L.candidate);
1663
+ M !== 0 && (O = Cn(C) / c);
1664
+ const F = Lr + si * (N * I + O * M);
1665
+ F < d && (o = p, d = F, a = P.candidate);
1666
1666
  }
1667
1667
  } else {
1668
- for (let x = 0; x < Ct; x++) {
1669
- const v = zt[x];
1670
- v.count = 0, v.candidate = w + S + x * S;
1671
- const L = v.bounds;
1672
- for (let C = 0; C < 3; C++)
1673
- L[C] = 1 / 0, L[C + 3] = -1 / 0;
1668
+ for (let _ = 0; _ < Ct; _++) {
1669
+ const A = zt[_];
1670
+ A.count = 0, A.candidate = y + x + _ * x;
1671
+ const P = A.bounds;
1672
+ for (let I = 0; I < 3; I++)
1673
+ P[I] = 1 / 0, P[I + 3] = -1 / 0;
1674
1674
  }
1675
- for (let x = h; x < f; x += 6) {
1676
- let C = ~~((t[x + 2 * p] - w) / S);
1677
- C >= Ct && (C = Ct - 1);
1678
- const M = zt[C];
1679
- M.count++, ps(x, t, M.bounds);
1675
+ for (let _ = h; _ < f; _ += 6) {
1676
+ let I = ~~((t[_ + 2 * p] - y) / x);
1677
+ I >= Ct && (I = Ct - 1);
1678
+ const M = zt[I];
1679
+ M.count++, ps(_, t, M.bounds);
1680
1680
  }
1681
1681
  const E = zt[Ct - 1];
1682
1682
  Dr(E.bounds, E.rightCacheBounds);
1683
- for (let x = Ct - 2; x >= 0; x--) {
1684
- const v = zt[x], L = zt[x + 1];
1685
- Nr(v.bounds, L.rightCacheBounds, v.rightCacheBounds);
1683
+ for (let _ = Ct - 2; _ >= 0; _--) {
1684
+ const A = zt[_], P = zt[_ + 1];
1685
+ Nr(A.bounds, P.rightCacheBounds, A.rightCacheBounds);
1686
1686
  }
1687
1687
  let b = 0;
1688
- for (let x = 0; x < Ct - 1; x++) {
1689
- const v = zt[x], L = v.count, C = v.bounds, D = zt[x + 1].rightCacheBounds;
1690
- L !== 0 && (b === 0 ? Dr(C, ms) : Nr(C, ms, ms)), b += L;
1691
- let I = 0, N = 0;
1692
- b !== 0 && (I = Cn(ms) / c);
1688
+ for (let _ = 0; _ < Ct - 1; _++) {
1689
+ const A = zt[_], P = A.count, I = A.bounds, D = zt[_ + 1].rightCacheBounds;
1690
+ P !== 0 && (b === 0 ? Dr(I, ms) : Nr(I, ms, ms)), b += P;
1691
+ let C = 0, N = 0;
1692
+ b !== 0 && (C = Cn(ms) / c);
1693
1693
  const O = s - b;
1694
1694
  O !== 0 && (N = Cn(D) / c);
1695
- const F = Lr + si * (I * b + N * O);
1696
- F < d && (o = p, d = F, a = v.candidate);
1695
+ const F = Lr + si * (C * b + N * O);
1696
+ F < d && (o = p, d = F, a = A.candidate);
1697
1697
  }
1698
1698
  }
1699
1699
  }
@@ -1727,8 +1727,8 @@ function Hc(i, e, t, n, s, r) {
1727
1727
  i[o * e + h] = i[a * e + h], i[a * e + h] = f;
1728
1728
  }
1729
1729
  for (let h = 0; h < 6; h++) {
1730
- const f = o - u, p = a - u, w = t[f * 6 + h];
1731
- t[f * 6 + h] = t[p * 6 + h], t[p * 6 + h] = w;
1730
+ const f = o - u, p = a - u, y = t[f * 6 + h];
1731
+ t[f * 6 + h] = t[p * 6 + h], t[p * 6 + h] = y;
1732
1732
  }
1733
1733
  o++, a--;
1734
1734
  } else
@@ -1766,27 +1766,27 @@ function Vc(i, e, t, n, s, r) {
1766
1766
  strategy: d,
1767
1767
  onProgress: u
1768
1768
  } = s, h = i.primitiveBuffer, f = i.primitiveBufferStride, p = new Float32Array(6);
1769
- let w = !1;
1770
- const _ = new ri();
1771
- return ii(e, t, n, _.boundingData, p), S(_, t, n, p), _;
1772
- function y(E) {
1769
+ let y = !1;
1770
+ const S = new ri();
1771
+ return ii(e, t, n, S.boundingData, p), x(S, t, n, p), S;
1772
+ function w(E) {
1773
1773
  u && u((E - r.offset) / r.count);
1774
1774
  }
1775
- function S(E, b, x, v = null, L = 0) {
1776
- if (!w && L >= o && (w = !0, a && console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)), x <= c || L >= o)
1777
- return y(b + x), E.offset = b, E.count = x, E;
1778
- const C = Bc(E.boundingData, v, e, b, x, d);
1779
- if (C.axis === -1)
1780
- return y(b + x), E.offset = b, E.count = x, E;
1781
- const M = Hc(h, f, e, b, x, C);
1782
- if (M === b || M === b + x)
1783
- y(b + x), E.offset = b, E.count = x;
1775
+ function x(E, b, _, A = null, P = 0) {
1776
+ if (!y && P >= o && (y = !0, a && console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)), _ <= c || P >= o)
1777
+ return w(b + _), E.offset = b, E.count = _, E;
1778
+ const I = Bc(E.boundingData, A, e, b, _, d);
1779
+ if (I.axis === -1)
1780
+ return w(b + _), E.offset = b, E.count = _, E;
1781
+ const M = Hc(h, f, e, b, _, I);
1782
+ if (M === b || M === b + _)
1783
+ w(b + _), E.offset = b, E.count = _;
1784
1784
  else {
1785
- E.splitAxis = C.axis;
1786
- const D = new ri(), I = b, N = M - b;
1787
- E.left = D, ii(e, I, N, D.boundingData, p), S(D, I, N, p, L + 1);
1788
- const O = new ri(), F = M, V = x - N;
1789
- E.right = O, ii(e, F, V, O.boundingData, p), S(O, F, V, p, L + 1);
1785
+ E.splitAxis = I.axis;
1786
+ const D = new ri(), C = b, N = M - b;
1787
+ E.left = D, ii(e, C, N, D.boundingData, p), x(D, C, N, p, P + 1);
1788
+ const O = new ri(), F = M, V = _ - N;
1789
+ E.right = O, ii(e, F, V, O.boundingData, p), x(O, F, V, p, P + 1);
1790
1790
  }
1791
1791
  return E;
1792
1792
  }
@@ -1842,7 +1842,7 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
1842
1842
  const f = qe(i, d), p = Qe(u, c);
1843
1843
  return xe(i, a, Vt), n(f, p, !1, o, r + i / Oe, Vt);
1844
1844
  } else {
1845
- let I = function(O) {
1845
+ let C = function(O) {
1846
1846
  const { uint16Array: F, uint32Array: V } = be;
1847
1847
  let te = O * 2;
1848
1848
  for (; !De(te, F); )
@@ -1856,21 +1856,21 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
1856
1856
  return qe(O, V) + Qe(te, F);
1857
1857
  };
1858
1858
  const f = Fe(i), p = ze(i, d);
1859
- let w = f, _ = p, y, S, E, b;
1860
- if (s && (E = Vt, b = _n, xe(w, a, E), xe(_, a, b), y = s(E), S = s(b), S < y)) {
1861
- w = p, _ = f;
1862
- const O = y;
1863
- y = S, S = O, E = b;
1864
- }
1865
- E || (E = Vt, xe(w, a, E));
1866
- const x = De(w * 2, c), v = t(E, x, y, o + 1, r + w / Oe);
1867
- let L;
1868
- if (v === Pr) {
1869
- const O = I(w), V = N(w) - O;
1870
- L = n(O, V, !0, o + 1, r + w / Oe, E);
1859
+ let y = f, S = p, w, x, E, b;
1860
+ if (s && (E = Vt, b = _n, xe(y, a, E), xe(S, a, b), w = s(E), x = s(b), x < w)) {
1861
+ y = p, S = f;
1862
+ const O = w;
1863
+ w = x, x = O, E = b;
1864
+ }
1865
+ E || (E = Vt, xe(y, a, E));
1866
+ const _ = De(y * 2, c), A = t(E, _, w, o + 1, r + y / Oe);
1867
+ let P;
1868
+ if (A === Pr) {
1869
+ const O = C(y), V = N(y) - O;
1870
+ P = n(O, V, !0, o + 1, r + y / Oe, E);
1871
1871
  } else
1872
- L = v && Li(
1873
- w,
1872
+ P = A && Li(
1873
+ y,
1874
1874
  e,
1875
1875
  t,
1876
1876
  n,
@@ -1878,16 +1878,16 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
1878
1878
  r,
1879
1879
  o + 1
1880
1880
  );
1881
- if (L) return !0;
1882
- b = _n, xe(_, a, b);
1883
- const C = De(_ * 2, c), M = t(b, C, S, o + 1, r + _ / Oe);
1881
+ if (P) return !0;
1882
+ b = _n, xe(S, a, b);
1883
+ const I = De(S * 2, c), M = t(b, I, x, o + 1, r + S / Oe);
1884
1884
  let D;
1885
1885
  if (M === Pr) {
1886
- const O = I(_), V = N(_) - O;
1887
- D = n(O, V, !0, o + 1, r + _ / Oe, b);
1886
+ const O = C(S), V = N(S) - O;
1887
+ D = n(O, V, !0, o + 1, r + S / Oe, b);
1888
1888
  } else
1889
1889
  D = M && Li(
1890
- _,
1890
+ S,
1891
1891
  e,
1892
1892
  t,
1893
1893
  n,
@@ -1911,7 +1911,7 @@ function Xc(i, e, t, n) {
1911
1911
  Zn.setBuffer(s[u]), c = 0;
1912
1912
  const f = Ht.getPrimitive();
1913
1913
  xe(0, Zn.float32Array, f), f.applyMatrix4(d);
1914
- for (let p = 0, w = r.length; p < w && (Gs.setBuffer(r[p]), o = mt(
1914
+ for (let p = 0, y = r.length; p < y && (Gs.setBuffer(r[p]), o = mt(
1915
1915
  0,
1916
1916
  0,
1917
1917
  t,
@@ -1932,35 +1932,35 @@ function Xc(i, e, t, n) {
1932
1932
  function mt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, d = null, u = !1) {
1933
1933
  let h, f;
1934
1934
  u ? (h = Gs, f = Zn) : (h = Zn, f = Gs);
1935
- const p = h.float32Array, w = h.uint32Array, _ = h.uint16Array, y = f.float32Array, S = f.uint32Array, E = f.uint16Array, b = i * 2, x = e * 2, v = De(b, _), L = De(x, E);
1936
- let C = !1;
1937
- if (L && v)
1938
- u ? C = s(
1939
- qe(e, S),
1935
+ const p = h.float32Array, y = h.uint32Array, S = h.uint16Array, w = f.float32Array, x = f.uint32Array, E = f.uint16Array, b = i * 2, _ = e * 2, A = De(b, S), P = De(_, E);
1936
+ let I = !1;
1937
+ if (P && A)
1938
+ u ? I = s(
1939
+ qe(e, x),
1940
1940
  Qe(e * 2, E),
1941
- qe(i, w),
1942
- Qe(i * 2, _),
1941
+ qe(i, y),
1942
+ Qe(i * 2, S),
1943
1943
  c,
1944
1944
  o + e / Oe,
1945
1945
  a,
1946
1946
  r + i / Oe
1947
- ) : C = s(
1948
- qe(i, w),
1949
- Qe(i * 2, _),
1950
- qe(e, S),
1947
+ ) : I = s(
1948
+ qe(i, y),
1949
+ Qe(i * 2, S),
1950
+ qe(e, x),
1951
1951
  Qe(e * 2, E),
1952
1952
  a,
1953
1953
  r + i / Oe,
1954
1954
  c,
1955
1955
  o + e / Oe
1956
1956
  );
1957
- else if (L) {
1957
+ else if (P) {
1958
1958
  const M = Ht.getPrimitive();
1959
- xe(e, y, M), M.applyMatrix4(t);
1960
- const D = Fe(i), I = ze(i, w);
1961
- xe(D, p, ln), xe(I, p, hn);
1959
+ xe(e, w, M), M.applyMatrix4(t);
1960
+ const D = Fe(i), C = ze(i, y);
1961
+ xe(D, p, ln), xe(C, p, hn);
1962
1962
  const N = M.intersectsBox(ln), O = M.intersectsBox(hn);
1963
- C = N && mt(
1963
+ I = N && mt(
1964
1964
  e,
1965
1965
  D,
1966
1966
  n,
@@ -1974,7 +1974,7 @@ function mt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, d = null, u = !1) {
1974
1974
  !u
1975
1975
  ) || O && mt(
1976
1976
  e,
1977
- I,
1977
+ C,
1978
1978
  n,
1979
1979
  t,
1980
1980
  s,
@@ -1986,11 +1986,11 @@ function mt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, d = null, u = !1) {
1986
1986
  !u
1987
1987
  ), Ht.releasePrimitive(M);
1988
1988
  } else {
1989
- const M = Fe(e), D = ze(e, S);
1990
- xe(M, y, oi), xe(D, y, ai);
1991
- const I = d.intersectsBox(oi), N = d.intersectsBox(ai);
1992
- if (I && N)
1993
- C = mt(
1989
+ const M = Fe(e), D = ze(e, x);
1990
+ xe(M, w, oi), xe(D, w, ai);
1991
+ const C = d.intersectsBox(oi), N = d.intersectsBox(ai);
1992
+ if (C && N)
1993
+ I = mt(
1994
1994
  i,
1995
1995
  M,
1996
1996
  t,
@@ -2015,9 +2015,9 @@ function mt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, d = null, u = !1) {
2015
2015
  d,
2016
2016
  u
2017
2017
  );
2018
- else if (I)
2019
- if (v)
2020
- C = mt(
2018
+ else if (C)
2019
+ if (A)
2020
+ I = mt(
2021
2021
  i,
2022
2022
  M,
2023
2023
  t,
@@ -2033,10 +2033,10 @@ function mt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, d = null, u = !1) {
2033
2033
  else {
2034
2034
  const O = Ht.getPrimitive();
2035
2035
  O.copy(oi).applyMatrix4(t);
2036
- const F = Fe(i), V = ze(i, w);
2036
+ const F = Fe(i), V = ze(i, y);
2037
2037
  xe(F, p, ln), xe(V, p, hn);
2038
2038
  const te = O.intersectsBox(ln), re = O.intersectsBox(hn);
2039
- C = te && mt(
2039
+ I = te && mt(
2040
2040
  M,
2041
2041
  F,
2042
2042
  n,
@@ -2063,8 +2063,8 @@ function mt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, d = null, u = !1) {
2063
2063
  ), Ht.releasePrimitive(O);
2064
2064
  }
2065
2065
  else if (N)
2066
- if (v)
2067
- C = mt(
2066
+ if (A)
2067
+ I = mt(
2068
2068
  i,
2069
2069
  D,
2070
2070
  t,
@@ -2080,10 +2080,10 @@ function mt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, d = null, u = !1) {
2080
2080
  else {
2081
2081
  const O = Ht.getPrimitive();
2082
2082
  O.copy(ai).applyMatrix4(t);
2083
- const F = Fe(i), V = ze(i, w);
2083
+ const F = Fe(i), V = ze(i, y);
2084
2084
  xe(F, p, ln), xe(V, p, hn);
2085
2085
  const te = O.intersectsBox(ln), re = O.intersectsBox(hn);
2086
- C = te && mt(
2086
+ I = te && mt(
2087
2087
  D,
2088
2088
  F,
2089
2089
  n,
@@ -2110,7 +2110,7 @@ function mt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, d = null, u = !1) {
2110
2110
  ), Ht.releasePrimitive(O);
2111
2111
  }
2112
2112
  }
2113
- return C;
2113
+ return I;
2114
2114
  }
2115
2115
  const kr = /* @__PURE__ */ new _t(), un = /* @__PURE__ */ new Float32Array(6);
2116
2116
  class Yc {
@@ -2137,8 +2137,8 @@ class Yc {
2137
2137
  let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, d = -1 / 0, u = -1 / 0;
2138
2138
  for (let h = e, f = e + t; h < f; h++) {
2139
2139
  this.writePrimitiveBounds(h, un, 0);
2140
- const [p, w, _, y, S, E] = un;
2141
- p < r && (r = p), y > c && (c = y), w < o && (o = w), S > d && (d = S), _ < a && (a = _), E > u && (u = E);
2140
+ const [p, y, S, w, x, E] = un;
2141
+ p < r && (r = p), w > c && (c = w), y < o && (o = y), x > d && (d = x), S < a && (a = S), E > u && (u = E);
2142
2142
  }
2143
2143
  return n[s + 0] = r, n[s + 1] = o, n[s + 2] = a, n[s + 3] = c, n[s + 4] = d, n[s + 5] = u, n;
2144
2144
  }
@@ -2146,8 +2146,8 @@ class Yc {
2146
2146
  const s = n.offset || 0;
2147
2147
  for (let r = e, o = e + t; r < o; r++) {
2148
2148
  this.writePrimitiveBounds(r, un, 0);
2149
- const [a, c, d, u, h, f] = un, p = (a + u) / 2, w = (c + h) / 2, _ = (d + f) / 2, y = (u - a) / 2, S = (h - c) / 2, E = (f - d) / 2, b = (r - s) * 6;
2150
- n[b + 0] = p, n[b + 1] = y + (Math.abs(p) + y) * Fs, n[b + 2] = w, n[b + 3] = S + (Math.abs(w) + S) * Fs, n[b + 4] = _, n[b + 5] = E + (Math.abs(_) + E) * Fs;
2149
+ const [a, c, d, u, h, f] = un, p = (a + u) / 2, y = (c + h) / 2, S = (d + f) / 2, w = (u - a) / 2, x = (h - c) / 2, E = (f - d) / 2, b = (r - s) * 6;
2150
+ n[b + 0] = p, n[b + 1] = w + (Math.abs(p) + w) * Fs, n[b + 2] = y, n[b + 3] = x + (Math.abs(y) + x) * Fs, n[b + 4] = S, n[b + 5] = E + (Math.abs(S) + E) * Fs;
2151
2151
  }
2152
2152
  return n;
2153
2153
  }
@@ -2207,13 +2207,13 @@ class Yc {
2207
2207
  for (let d = c - 1; d >= 0; d--) {
2208
2208
  const u = d * Oe, h = u * 2;
2209
2209
  if (De(h, o)) {
2210
- const p = qe(u, r), w = Qe(h, o);
2211
- this.writePrimitiveRangeBounds(p, w, un, 0), a.set(un, u);
2210
+ const p = qe(u, r), y = Qe(h, o);
2211
+ this.writePrimitiveRangeBounds(p, y, un, 0), a.set(un, u);
2212
2212
  } else {
2213
- const p = Fe(u), w = ze(u, r);
2214
- for (let _ = 0; _ < 3; _++) {
2215
- const y = a[p + _], S = a[p + _ + 3], E = a[w + _], b = a[w + _ + 3];
2216
- a[u + _] = y < E ? y : E, a[u + _ + 3] = S > b ? S : b;
2213
+ const p = Fe(u), y = ze(u, r);
2214
+ for (let S = 0; S < 3; S++) {
2215
+ const w = a[p + S], x = a[p + S + 3], E = a[y + S], b = a[y + S + 3];
2216
+ a[u + S] = w < E ? w : E, a[u + S + 3] = x > b ? x : b;
2217
2217
  }
2218
2218
  }
2219
2219
  }
@@ -2255,8 +2255,8 @@ class Yc {
2255
2255
  } = e;
2256
2256
  if (s && r) {
2257
2257
  const h = s;
2258
- s = (f, p, w, _, y) => h(f, p, w, _, y) ? !0 : a(f, p, this, r, w, _, o);
2259
- } else s || (r ? s = (h, f, p, w) => a(h, f, this, r, p, w, o) : s = (h, f, p) => p);
2258
+ s = (f, p, y, S, w) => h(f, p, y, S, w) ? !0 : a(f, p, this, r, y, S, o);
2259
+ } else s || (r ? s = (h, f, p, y) => a(h, f, this, r, p, y, o) : s = (h, f, p) => p);
2260
2260
  let c = !1, d = 0;
2261
2261
  const u = this._roots;
2262
2262
  for (let h = 0, f = u.length; h < f; h++) {
@@ -2322,8 +2322,8 @@ function Fr(i, e, t) {
2322
2322
  return [n];
2323
2323
  const r = [], o = n.offset, a = n.offset + n.count, c = ar(i) / t, d = [];
2324
2324
  for (const f of s) {
2325
- const { offset: p, count: w } = f, _ = p, y = isFinite(w) ? w : c - p, S = p + y;
2326
- _ < a && S > o && (d.push({ pos: Math.max(o, _), isStart: !0 }), d.push({ pos: Math.min(a, S), isStart: !1 }));
2325
+ const { offset: p, count: y } = f, S = p, w = isFinite(y) ? y : c - p, x = p + w;
2326
+ S < a && x > o && (d.push({ pos: Math.max(o, S), isStart: !0 }), d.push({ pos: Math.min(a, x), isStart: !1 }));
2327
2327
  }
2328
2328
  d.sort((f, p) => f.pos !== p.pos ? f.pos - p.pos : f.type === "end" ? -1 : 1);
2329
2329
  let u = 0, h = null;
@@ -2442,9 +2442,9 @@ const sl = /* @__PURE__ */ (function() {
2442
2442
  return function(s, r, o) {
2443
2443
  const a = s.start, c = i, d = r.start, u = e;
2444
2444
  t.subVectors(a, d), i.subVectors(s.end, s.start), e.subVectors(r.end, r.start);
2445
- const h = t.dot(u), f = u.dot(c), p = u.dot(u), w = t.dot(c), y = c.dot(c) * p - f * f;
2446
- let S, E;
2447
- y !== 0 ? S = (h * f - w * p) / y : S = 0, E = (h + S * f) / p, o.x = S, o.y = E;
2445
+ const h = t.dot(u), f = u.dot(c), p = u.dot(u), y = t.dot(c), w = c.dot(c) * p - f * f;
2446
+ let x, E;
2447
+ w !== 0 ? x = (h * f - y * p) / w : x = 0, E = (h + x * f) / p, o.x = x, o.y = E;
2448
2448
  };
2449
2449
  })(), cr = /* @__PURE__ */ (function() {
2450
2450
  const i = /* @__PURE__ */ new pe(), e = /* @__PURE__ */ new q(), t = /* @__PURE__ */ new q();
@@ -2480,10 +2480,10 @@ const sl = /* @__PURE__ */ (function() {
2480
2480
  return function(r, o) {
2481
2481
  const { radius: a, center: c } = r, { a: d, b: u, c: h } = o;
2482
2482
  if (n.start = d, n.end = u, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a || (n.start = d, n.end = h, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a) || (n.start = u, n.end = h, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a)) return !0;
2483
- const _ = o.getPlane(t);
2484
- if (Math.abs(_.distanceToPoint(c)) <= a) {
2485
- const S = _.projectPoint(c, e);
2486
- if (o.containsPoint(S)) return !0;
2483
+ const S = o.getPlane(t);
2484
+ if (Math.abs(S.distanceToPoint(c)) <= a) {
2485
+ const x = S.projectPoint(c, e);
2486
+ if (o.containsPoint(x)) return !0;
2487
2487
  }
2488
2488
  return !1;
2489
2489
  };
@@ -2510,10 +2510,10 @@ class Tt extends En {
2510
2510
  d.subVectors(e, t), u.setFromPoints(d, s);
2511
2511
  const h = r[2], f = o[2];
2512
2512
  h.subVectors(t, n), f.setFromPoints(h, s);
2513
- const p = r[3], w = o[3];
2514
- p.subVectors(n, e), w.setFromPoints(p, s);
2515
- const _ = d.length(), y = h.length(), S = p.length();
2516
- this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, _ < Pt ? y < Pt || S < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : y < Pt ? S < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : S < Pt && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(a, e), this.needsUpdate = !1;
2513
+ const p = r[3], y = o[3];
2514
+ p.subVectors(n, e), y.setFromPoints(p, s);
2515
+ const S = d.length(), w = h.length(), x = p.length();
2516
+ this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, S < Pt ? w < Pt || x < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : w < Pt ? x < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : x < Pt && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(a, e), this.needsUpdate = !1;
2517
2517
  }
2518
2518
  }
2519
2519
  Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
@@ -2530,87 +2530,87 @@ Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
2530
2530
  })();
2531
2531
  Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2532
2532
  const i = /* @__PURE__ */ new Tt(), e = /* @__PURE__ */ new Nt(), t = /* @__PURE__ */ new Nt(), n = /* @__PURE__ */ new q(), s = /* @__PURE__ */ new q(), r = /* @__PURE__ */ new q(), o = /* @__PURE__ */ new q(), a = /* @__PURE__ */ new Dt(), c = /* @__PURE__ */ new Dt(), d = /* @__PURE__ */ new q(), u = /* @__PURE__ */ new pe(), h = /* @__PURE__ */ new pe();
2533
- function f(b, x, v, L) {
2534
- const C = n;
2535
- !b.isDegenerateIntoPoint && !b.isDegenerateIntoSegment ? C.copy(b.plane.normal) : C.copy(x.plane.normal);
2533
+ function f(b, _, A, P) {
2534
+ const I = n;
2535
+ !b.isDegenerateIntoPoint && !b.isDegenerateIntoSegment ? I.copy(b.plane.normal) : I.copy(_.plane.normal);
2536
2536
  const M = b.satBounds, D = b.satAxes;
2537
2537
  for (let O = 1; O < 4; O++) {
2538
2538
  const F = M[O], V = D[O];
2539
- if (e.setFromPoints(V, x.points), F.isSeparated(e) || (o.copy(C).cross(V), e.setFromPoints(o, b.points), t.setFromPoints(o, x.points), e.isSeparated(t))) return !1;
2539
+ if (e.setFromPoints(V, _.points), F.isSeparated(e) || (o.copy(I).cross(V), e.setFromPoints(o, b.points), t.setFromPoints(o, _.points), e.isSeparated(t))) return !1;
2540
2540
  }
2541
- const I = x.satBounds, N = x.satAxes;
2541
+ const C = _.satBounds, N = _.satAxes;
2542
2542
  for (let O = 1; O < 4; O++) {
2543
- const F = I[O], V = N[O];
2544
- if (e.setFromPoints(V, b.points), F.isSeparated(e) || (o.crossVectors(C, V), e.setFromPoints(o, b.points), t.setFromPoints(o, x.points), e.isSeparated(t))) return !1;
2543
+ const F = C[O], V = N[O];
2544
+ if (e.setFromPoints(V, b.points), F.isSeparated(e) || (o.crossVectors(I, V), e.setFromPoints(o, b.points), t.setFromPoints(o, _.points), e.isSeparated(t))) return !1;
2545
2545
  }
2546
- return v && (L || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), v.start.set(0, 0, 0), v.end.set(0, 0, 0)), !0;
2546
+ return A && (P || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), A.start.set(0, 0, 0), A.end.set(0, 0, 0)), !0;
2547
2547
  }
2548
- function p(b, x, v, L, C, M, D, I, N, O, F) {
2549
- let V = D / (D - I);
2550
- O.x = L + (C - L) * V, F.start.subVectors(x, b).multiplyScalar(V).add(b), V = D / (D - N), O.y = L + (M - L) * V, F.end.subVectors(v, b).multiplyScalar(V).add(b);
2548
+ function p(b, _, A, P, I, M, D, C, N, O, F) {
2549
+ let V = D / (D - C);
2550
+ O.x = P + (I - P) * V, F.start.subVectors(_, b).multiplyScalar(V).add(b), V = D / (D - N), O.y = P + (M - P) * V, F.end.subVectors(A, b).multiplyScalar(V).add(b);
2551
2551
  }
2552
- function w(b, x, v, L, C, M, D, I, N, O, F) {
2553
- if (C > 0)
2554
- p(b.c, b.a, b.b, L, x, v, N, D, I, O, F);
2552
+ function y(b, _, A, P, I, M, D, C, N, O, F) {
2553
+ if (I > 0)
2554
+ p(b.c, b.a, b.b, P, _, A, N, D, C, O, F);
2555
2555
  else if (M > 0)
2556
- p(b.b, b.a, b.c, v, x, L, I, D, N, O, F);
2557
- else if (I * N > 0 || D != 0)
2558
- p(b.a, b.b, b.c, x, v, L, D, I, N, O, F);
2559
- else if (I != 0)
2560
- p(b.b, b.a, b.c, v, x, L, I, D, N, O, F);
2556
+ p(b.b, b.a, b.c, A, _, P, C, D, N, O, F);
2557
+ else if (C * N > 0 || D != 0)
2558
+ p(b.a, b.b, b.c, _, A, P, D, C, N, O, F);
2559
+ else if (C != 0)
2560
+ p(b.b, b.a, b.c, A, _, P, C, D, N, O, F);
2561
2561
  else if (N != 0)
2562
- p(b.c, b.a, b.b, L, x, v, N, D, I, O, F);
2562
+ p(b.c, b.a, b.b, P, _, A, N, D, C, O, F);
2563
2563
  else
2564
2564
  return !0;
2565
2565
  return !1;
2566
2566
  }
2567
- function _(b, x, v, L) {
2568
- const C = x.degenerateSegment, M = b.plane.distanceToPoint(C.start), D = b.plane.distanceToPoint(C.end);
2569
- return ot(M) ? ot(D) ? f(b, x, v, L) : (v && (v.start.copy(C.start), v.end.copy(C.start)), b.containsPoint(C.start)) : ot(D) ? (v && (v.start.copy(C.end), v.end.copy(C.end)), b.containsPoint(C.end)) : b.plane.intersectLine(C, n) != null ? (v && (v.start.copy(n), v.end.copy(n)), b.containsPoint(n)) : !1;
2567
+ function S(b, _, A, P) {
2568
+ const I = _.degenerateSegment, M = b.plane.distanceToPoint(I.start), D = b.plane.distanceToPoint(I.end);
2569
+ return ot(M) ? ot(D) ? f(b, _, A, P) : (A && (A.start.copy(I.start), A.end.copy(I.start)), b.containsPoint(I.start)) : ot(D) ? (A && (A.start.copy(I.end), A.end.copy(I.end)), b.containsPoint(I.end)) : b.plane.intersectLine(I, n) != null ? (A && (A.start.copy(n), A.end.copy(n)), b.containsPoint(n)) : !1;
2570
2570
  }
2571
- function y(b, x, v) {
2572
- const L = x.a;
2573
- return ot(b.plane.distanceToPoint(L)) && b.containsPoint(L) ? (v && (v.start.copy(L), v.end.copy(L)), !0) : !1;
2571
+ function w(b, _, A) {
2572
+ const P = _.a;
2573
+ return ot(b.plane.distanceToPoint(P)) && b.containsPoint(P) ? (A && (A.start.copy(P), A.end.copy(P)), !0) : !1;
2574
2574
  }
2575
- function S(b, x, v) {
2576
- const L = b.degenerateSegment, C = x.a;
2577
- return L.closestPointToPoint(C, !0, n), C.distanceToSquared(n) < zr ? (v && (v.start.copy(C), v.end.copy(C)), !0) : !1;
2575
+ function x(b, _, A) {
2576
+ const P = b.degenerateSegment, I = _.a;
2577
+ return P.closestPointToPoint(I, !0, n), I.distanceToSquared(n) < zr ? (A && (A.start.copy(I), A.end.copy(I)), !0) : !1;
2578
2578
  }
2579
- function E(b, x, v, L) {
2579
+ function E(b, _, A, P) {
2580
2580
  if (b.isDegenerateIntoSegment)
2581
- if (x.isDegenerateIntoSegment) {
2582
- const C = b.degenerateSegment, M = x.degenerateSegment, D = s, I = r;
2583
- C.delta(D), M.delta(I);
2584
- const N = n.subVectors(M.start, C.start), O = D.x * I.y - D.y * I.x;
2581
+ if (_.isDegenerateIntoSegment) {
2582
+ const I = b.degenerateSegment, M = _.degenerateSegment, D = s, C = r;
2583
+ I.delta(D), M.delta(C);
2584
+ const N = n.subVectors(M.start, I.start), O = D.x * C.y - D.y * C.x;
2585
2585
  if (ot(O))
2586
2586
  return !1;
2587
- const F = (N.x * I.y - N.y * I.x) / O, V = -(D.x * N.y - D.y * N.x) / O;
2587
+ const F = (N.x * C.y - N.y * C.x) / O, V = -(D.x * N.y - D.y * N.x) / O;
2588
2588
  if (F < 0 || F > 1 || V < 0 || V > 1)
2589
2589
  return !1;
2590
- const te = C.start.z + D.z * F, re = M.start.z + I.z * V;
2591
- return ot(te - re) ? (v && (v.start.copy(C.start).addScaledVector(D, F), v.end.copy(C.start).addScaledVector(D, F)), !0) : !1;
2592
- } else return x.isDegenerateIntoPoint ? S(b, x, v) : _(x, b, v, L);
2590
+ const te = I.start.z + D.z * F, re = M.start.z + C.z * V;
2591
+ return ot(te - re) ? (A && (A.start.copy(I.start).addScaledVector(D, F), A.end.copy(I.start).addScaledVector(D, F)), !0) : !1;
2592
+ } else return _.isDegenerateIntoPoint ? x(b, _, A) : S(_, b, A, P);
2593
2593
  else {
2594
2594
  if (b.isDegenerateIntoPoint)
2595
- return x.isDegenerateIntoPoint ? x.a.distanceToSquared(b.a) < zr ? (v && (v.start.copy(b.a), v.end.copy(b.a)), !0) : !1 : x.isDegenerateIntoSegment ? S(x, b, v) : y(x, b, v);
2596
- if (x.isDegenerateIntoPoint)
2597
- return y(b, x, v);
2598
- if (x.isDegenerateIntoSegment)
2599
- return _(b, x, v, L);
2600
- }
2601
- }
2602
- return function(x, v = null, L = !1) {
2603
- this.needsUpdate && this.update(), x.isExtendedTriangle ? x.needsUpdate && x.update() : (i.copy(x), i.update(), x = i);
2604
- const C = E(this, x, v, L);
2605
- if (C !== void 0)
2606
- return C;
2607
- const M = this.plane, D = x.plane;
2608
- let I = D.distanceToPoint(this.a), N = D.distanceToPoint(this.b), O = D.distanceToPoint(this.c);
2609
- ot(I) && (I = 0), ot(N) && (N = 0), ot(O) && (O = 0);
2610
- const F = I * N, V = I * O;
2595
+ return _.isDegenerateIntoPoint ? _.a.distanceToSquared(b.a) < zr ? (A && (A.start.copy(b.a), A.end.copy(b.a)), !0) : !1 : _.isDegenerateIntoSegment ? x(_, b, A) : w(_, b, A);
2596
+ if (_.isDegenerateIntoPoint)
2597
+ return w(b, _, A);
2598
+ if (_.isDegenerateIntoSegment)
2599
+ return S(b, _, A, P);
2600
+ }
2601
+ }
2602
+ return function(_, A = null, P = !1) {
2603
+ this.needsUpdate && this.update(), _.isExtendedTriangle ? _.needsUpdate && _.update() : (i.copy(_), i.update(), _ = i);
2604
+ const I = E(this, _, A, P);
2605
+ if (I !== void 0)
2606
+ return I;
2607
+ const M = this.plane, D = _.plane;
2608
+ let C = D.distanceToPoint(this.a), N = D.distanceToPoint(this.b), O = D.distanceToPoint(this.c);
2609
+ ot(C) && (C = 0), ot(N) && (N = 0), ot(O) && (O = 0);
2610
+ const F = C * N, V = C * O;
2611
2611
  if (F > 0 && V > 0)
2612
2612
  return !1;
2613
- let te = M.distanceToPoint(x.a), re = M.distanceToPoint(x.b), Ne = M.distanceToPoint(x.c);
2613
+ let te = M.distanceToPoint(_.a), re = M.distanceToPoint(_.b), Ne = M.distanceToPoint(_.c);
2614
2614
  ot(te) && (te = 0), ot(re) && (re = 0), ot(Ne) && (Ne = 0);
2615
2615
  const ut = te * re, Re = te * Ne;
2616
2616
  if (ut > 0 && Re > 0)
@@ -2620,11 +2620,11 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2620
2620
  let Ge = 0, Ae = Math.abs(Ue.x);
2621
2621
  const ge = Math.abs(Ue.y);
2622
2622
  ge > Ae && (Ae = ge, Ge = 1), Math.abs(Ue.z) > Ae && (Ge = 2);
2623
- const Ve = rl[Ge], kt = this.a[Ve], me = this.b[Ve], dt = this.c[Ve], ft = x.a[Ve], An = x.b[Ve], rn = x.c[Ve];
2624
- if (w(this, kt, me, dt, F, V, I, N, O, u, a))
2625
- return f(this, x, v, L);
2626
- if (w(x, ft, An, rn, ut, Re, te, re, Ne, h, c))
2627
- return f(this, x, v, L);
2623
+ const Ve = rl[Ge], kt = this.a[Ve], me = this.b[Ve], dt = this.c[Ve], ft = _.a[Ve], An = _.b[Ve], rn = _.c[Ve];
2624
+ if (y(this, kt, me, dt, F, V, C, N, O, u, a))
2625
+ return f(this, _, A, P);
2626
+ if (y(_, ft, An, rn, ut, Re, te, re, Ne, h, c))
2627
+ return f(this, _, A, P);
2628
2628
  if (u.y < u.x) {
2629
2629
  const It = u.y;
2630
2630
  u.y = u.x, u.x = It, d.copy(a.start), a.start.copy(a.end), a.end.copy(d);
@@ -2633,7 +2633,7 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2633
2633
  const It = h.y;
2634
2634
  h.y = h.x, h.x = It, d.copy(c.start), c.start.copy(c.end), c.end.copy(d);
2635
2635
  }
2636
- return u.y < h.x || h.y < u.x ? !1 : (v && (h.x > u.x ? v.start.copy(c.start) : v.start.copy(a.start), h.y < u.y ? v.end.copy(c.end) : v.end.copy(a.end)), !0);
2636
+ return u.y < h.x || h.y < u.x ? !1 : (A && (h.x > u.x ? A.start.copy(c.start) : A.start.copy(a.start), h.y < u.y ? A.end.copy(c.end) : A.end.copy(a.end)), !0);
2637
2637
  };
2638
2638
  })();
2639
2639
  Tt.prototype.distanceToPoint = /* @__PURE__ */ (function() {
@@ -2651,19 +2651,19 @@ Tt.prototype.distanceToTriangle = /* @__PURE__ */ (function() {
2651
2651
  let u = 1 / 0;
2652
2652
  for (let h = 0; h < 3; h++) {
2653
2653
  let f;
2654
- const p = t[h], w = o[p];
2655
- this.closestPointToPoint(w, i), f = w.distanceToSquared(i), f < u && (u = f, a && a.copy(i), c && c.copy(w));
2656
- const _ = this[p];
2657
- o.closestPointToPoint(_, i), f = _.distanceToSquared(i), f < u && (u = f, a && a.copy(_), c && c.copy(i));
2654
+ const p = t[h], y = o[p];
2655
+ this.closestPointToPoint(y, i), f = y.distanceToSquared(i), f < u && (u = f, a && a.copy(i), c && c.copy(y));
2656
+ const S = this[p];
2657
+ o.closestPointToPoint(S, i), f = S.distanceToSquared(i), f < u && (u = f, a && a.copy(S), c && c.copy(i));
2658
2658
  }
2659
2659
  for (let h = 0; h < 3; h++) {
2660
2660
  const f = t[h], p = t[(h + 1) % 3];
2661
2661
  n.set(this[f], this[p]);
2662
- for (let w = 0; w < 3; w++) {
2663
- const _ = t[w], y = t[(w + 1) % 3];
2664
- s.set(o[_], o[y]), cr(n, s, i, e);
2665
- const S = i.distanceToSquared(e);
2666
- S < u && (u = S, a && a.copy(i), c && c.copy(e));
2662
+ for (let y = 0; y < 3; y++) {
2663
+ const S = t[y], w = t[(y + 1) % 3];
2664
+ s.set(o[S], o[w]), cr(n, s, i, e);
2665
+ const x = i.distanceToSquared(e);
2666
+ x < u && (u = x, a && a.copy(i), c && c.copy(e));
2667
2667
  }
2668
2668
  }
2669
2669
  return Math.sqrt(u);
@@ -2724,19 +2724,19 @@ Je.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2724
2724
  const a = this.satBounds, c = this.satAxes;
2725
2725
  e[0] = o.a, e[1] = o.b, e[2] = o.c;
2726
2726
  for (let f = 0; f < 3; f++) {
2727
- const p = a[f], w = c[f];
2728
- if (t.setFromPoints(w, e), p.isSeparated(t)) return !1;
2727
+ const p = a[f], y = c[f];
2728
+ if (t.setFromPoints(y, e), p.isSeparated(t)) return !1;
2729
2729
  }
2730
2730
  const d = o.satBounds, u = o.satAxes, h = this.points;
2731
2731
  for (let f = 0; f < 3; f++) {
2732
- const p = d[f], w = u[f];
2733
- if (t.setFromPoints(w, h), p.isSeparated(t)) return !1;
2732
+ const p = d[f], y = u[f];
2733
+ if (t.setFromPoints(y, h), p.isSeparated(t)) return !1;
2734
2734
  }
2735
2735
  for (let f = 0; f < 3; f++) {
2736
2736
  const p = c[f];
2737
- for (let w = 0; w < 4; w++) {
2738
- const _ = u[w];
2739
- if (s.crossVectors(p, _), t.setFromPoints(s, e), n.setFromPoints(s, h), t.isSeparated(n)) return !1;
2737
+ for (let y = 0; y < 4; y++) {
2738
+ const S = u[y];
2739
+ if (s.crossVectors(p, S), t.setFromPoints(s, e), n.setFromPoints(s, h), t.isSeparated(n)) return !1;
2740
2740
  }
2741
2741
  }
2742
2742
  return !0;
@@ -2759,42 +2759,42 @@ Je.prototype.distanceToBox = /* @__PURE__ */ (function() {
2759
2759
  if (this.needsUpdate && this.update(), this.intersectsBox(o))
2760
2760
  return (c || d) && (o.getCenter(s), this.closestPointToPoint(s, n), o.closestPointToPoint(n, s), c && c.copy(n), d && d.copy(s)), 0;
2761
2761
  const u = a * a, h = o.min, f = o.max, p = this.points;
2762
- let w = 1 / 0;
2763
- for (let y = 0; y < 8; y++) {
2764
- const S = p[y];
2765
- s.copy(S).clamp(h, f);
2766
- const E = S.distanceToSquared(s);
2767
- if (E < w && (w = E, c && c.copy(S), d && d.copy(s), E < u))
2762
+ let y = 1 / 0;
2763
+ for (let w = 0; w < 8; w++) {
2764
+ const x = p[w];
2765
+ s.copy(x).clamp(h, f);
2766
+ const E = x.distanceToSquared(s);
2767
+ if (E < y && (y = E, c && c.copy(x), d && d.copy(s), E < u))
2768
2768
  return Math.sqrt(E);
2769
2769
  }
2770
- let _ = 0;
2771
- for (let y = 0; y < 3; y++)
2772
- for (let S = 0; S <= 1; S++)
2770
+ let S = 0;
2771
+ for (let w = 0; w < 3; w++)
2772
+ for (let x = 0; x <= 1; x++)
2773
2773
  for (let E = 0; E <= 1; E++) {
2774
- const b = (y + 1) % 3, x = (y + 2) % 3, v = S << b | E << x, L = 1 << y | S << b | E << x, C = p[v], M = p[L];
2775
- e[_].set(C, M);
2776
- const I = i[y], N = i[b], O = i[x], F = t[_], V = F.start, te = F.end;
2777
- V[I] = h[I], V[N] = S ? h[N] : f[N], V[O] = E ? h[O] : f[N], te[I] = f[I], te[N] = S ? h[N] : f[N], te[O] = E ? h[O] : f[N], _++;
2774
+ const b = (w + 1) % 3, _ = (w + 2) % 3, A = x << b | E << _, P = 1 << w | x << b | E << _, I = p[A], M = p[P];
2775
+ e[S].set(I, M);
2776
+ const C = i[w], N = i[b], O = i[_], F = t[S], V = F.start, te = F.end;
2777
+ V[C] = h[C], V[N] = x ? h[N] : f[N], V[O] = E ? h[O] : f[N], te[C] = f[C], te[N] = x ? h[N] : f[N], te[O] = E ? h[O] : f[N], S++;
2778
2778
  }
2779
- for (let y = 0; y <= 1; y++)
2780
- for (let S = 0; S <= 1; S++)
2779
+ for (let w = 0; w <= 1; w++)
2780
+ for (let x = 0; x <= 1; x++)
2781
2781
  for (let E = 0; E <= 1; E++) {
2782
- s.x = y ? f.x : h.x, s.y = S ? f.y : h.y, s.z = E ? f.z : h.z, this.closestPointToPoint(s, n);
2782
+ s.x = w ? f.x : h.x, s.y = x ? f.y : h.y, s.z = E ? f.z : h.z, this.closestPointToPoint(s, n);
2783
2783
  const b = s.distanceToSquared(n);
2784
- if (b < w && (w = b, c && c.copy(n), d && d.copy(s), b < u))
2784
+ if (b < y && (y = b, c && c.copy(n), d && d.copy(s), b < u))
2785
2785
  return Math.sqrt(b);
2786
2786
  }
2787
- for (let y = 0; y < 12; y++) {
2788
- const S = e[y];
2787
+ for (let w = 0; w < 12; w++) {
2788
+ const x = e[w];
2789
2789
  for (let E = 0; E < 12; E++) {
2790
2790
  const b = t[E];
2791
- cr(S, b, n, s);
2792
- const x = n.distanceToSquared(s);
2793
- if (x < w && (w = x, c && c.copy(n), d && d.copy(s), x < u))
2794
- return Math.sqrt(x);
2791
+ cr(x, b, n, s);
2792
+ const _ = n.distanceToSquared(s);
2793
+ if (_ < y && (y = _, c && c.copy(n), d && d.copy(s), _ < u))
2794
+ return Math.sqrt(_);
2795
2795
  }
2796
2796
  }
2797
- return Math.sqrt(w);
2797
+ return Math.sqrt(y);
2798
2798
  };
2799
2799
  })();
2800
2800
  class ol extends or {
@@ -2871,22 +2871,22 @@ function qs(i, e, t, n, s, r, o) {
2871
2871
  let c = a + 0, d = a + 1, u = a + 2;
2872
2872
  const { index: h, groups: f } = i;
2873
2873
  i.index && (c = h.getX(c), d = h.getX(d), u = h.getX(u));
2874
- const { position: p, normal: w, uv: _, uv1: y } = i.attributes;
2874
+ const { position: p, normal: y, uv: S, uv1: w } = i.attributes;
2875
2875
  if (Array.isArray(e)) {
2876
- const S = n * 3;
2876
+ const x = n * 3;
2877
2877
  for (let E = 0, b = f.length; E < b; E++) {
2878
- const { start: x, count: v, materialIndex: L } = f[E];
2879
- if (S >= x && S < x + v) {
2880
- const C = Gr(e[L]), M = jr(t, p, w, _, y, c, d, u, C, r, o);
2878
+ const { start: _, count: A, materialIndex: P } = f[E];
2879
+ if (x >= _ && x < _ + A) {
2880
+ const I = Gr(e[P]), M = jr(t, p, y, S, w, c, d, u, I, r, o);
2881
2881
  if (M)
2882
- if (M.faceIndex = n, M.face.materialIndex = L, s)
2882
+ if (M.faceIndex = n, M.face.materialIndex = P, s)
2883
2883
  s.push(M);
2884
2884
  else
2885
2885
  return M;
2886
2886
  }
2887
2887
  }
2888
2888
  } else {
2889
- const S = Gr(e), E = jr(t, p, w, _, y, c, d, u, S, r, o);
2889
+ const x = Gr(e), E = jr(t, p, y, S, w, c, d, u, x, r, o);
2890
2890
  if (E)
2891
2891
  if (E.faceIndex = n, E.face.materialIndex = 0, s)
2892
2892
  s.push(E);
@@ -2930,37 +2930,37 @@ function fl(i, e = null) {
2930
2930
  const u = i._roots;
2931
2931
  for (let f = 0, p = u.length; f < p; f++)
2932
2932
  r = u[f], o = new Uint32Array(r), a = new Uint16Array(r), c = new Float32Array(r), h(0, d), d += r.byteLength;
2933
- function h(f, p, w = !1) {
2934
- const _ = f * 2;
2935
- if (De(_, a)) {
2936
- const y = qe(f, o), S = Qe(_, a);
2937
- let E = 1 / 0, b = 1 / 0, x = 1 / 0, v = -1 / 0, L = -1 / 0, C = -1 / 0;
2938
- for (let M = 3 * y, D = 3 * (y + S); M < D; M++) {
2939
- let I = n[M];
2940
- const N = s.getX(I), O = s.getY(I), F = s.getZ(I);
2941
- N < E && (E = N), N > v && (v = N), O < b && (b = O), O > L && (L = O), F < x && (x = F), F > C && (C = F);
2942
- }
2943
- return c[f + 0] !== E || c[f + 1] !== b || c[f + 2] !== x || c[f + 3] !== v || c[f + 4] !== L || c[f + 5] !== C ? (c[f + 0] = E, c[f + 1] = b, c[f + 2] = x, c[f + 3] = v, c[f + 4] = L, c[f + 5] = C, !0) : !1;
2933
+ function h(f, p, y = !1) {
2934
+ const S = f * 2;
2935
+ if (De(S, a)) {
2936
+ const w = qe(f, o), x = Qe(S, a);
2937
+ let E = 1 / 0, b = 1 / 0, _ = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
2938
+ for (let M = 3 * w, D = 3 * (w + x); M < D; M++) {
2939
+ let C = n[M];
2940
+ const N = s.getX(C), O = s.getY(C), F = s.getZ(C);
2941
+ N < E && (E = N), N > A && (A = N), O < b && (b = O), O > P && (P = O), F < _ && (_ = F), F > I && (I = F);
2942
+ }
2943
+ return c[f + 0] !== E || c[f + 1] !== b || c[f + 2] !== _ || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = E, c[f + 1] = b, c[f + 2] = _, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
2944
2944
  } else {
2945
- const y = Fe(f), S = ze(f, o);
2946
- let E = w, b = !1, x = !1;
2945
+ const w = Fe(f), x = ze(f, o);
2946
+ let E = y, b = !1, _ = !1;
2947
2947
  if (e) {
2948
2948
  if (!E) {
2949
- const I = y / Oe + p / Ye, N = S / Oe + p / Ye;
2950
- b = e.has(I), x = e.has(N), E = !b && !x;
2949
+ const C = w / Oe + p / Ye, N = x / Oe + p / Ye;
2950
+ b = e.has(C), _ = e.has(N), E = !b && !_;
2951
2951
  }
2952
2952
  } else
2953
- b = !0, x = !0;
2954
- const v = E || b, L = E || x;
2955
- let C = !1;
2956
- v && (C = h(y, p, E));
2953
+ b = !0, _ = !0;
2954
+ const A = E || b, P = E || _;
2955
+ let I = !1;
2956
+ A && (I = h(w, p, E));
2957
2957
  let M = !1;
2958
- L && (M = h(S, p, E));
2959
- const D = C || M;
2958
+ P && (M = h(x, p, E));
2959
+ const D = I || M;
2960
2960
  if (D)
2961
- for (let I = 0; I < 3; I++) {
2962
- const N = y + I, O = S + I, F = c[N], V = c[N + 3], te = c[O], re = c[O + 3];
2963
- c[f + I] = F < te ? F : te, c[f + I + 3] = V > re ? V : re;
2961
+ for (let C = 0; C < 3; C++) {
2962
+ const N = w + C, O = x + C, F = c[N], V = c[N + 3], te = c[O], re = c[O + 3];
2963
+ c[f + C] = F < te ? F : te, c[f + C + 3] = V > re ? V : re;
2964
2964
  }
2965
2965
  return D;
2966
2966
  }
@@ -2968,9 +2968,9 @@ function fl(i, e = null) {
2968
2968
  }
2969
2969
  function Kt(i, e, t, n, s) {
2970
2970
  let r, o, a, c, d, u;
2971
- const h = 1 / t.direction.x, f = 1 / t.direction.y, p = 1 / t.direction.z, w = t.origin.x, _ = t.origin.y, y = t.origin.z;
2972
- let S = e[i], E = e[i + 3], b = e[i + 1], x = e[i + 3 + 1], v = e[i + 2], L = e[i + 3 + 2];
2973
- return h >= 0 ? (r = (S - w) * h, o = (E - w) * h) : (r = (E - w) * h, o = (S - w) * h), f >= 0 ? (a = (b - _) * f, c = (x - _) * f) : (a = (x - _) * f, c = (b - _) * f), r > c || a > o || ((a > r || isNaN(r)) && (r = a), (c < o || isNaN(o)) && (o = c), p >= 0 ? (d = (v - y) * p, u = (L - y) * p) : (d = (L - y) * p, u = (v - y) * p), r > u || d > o) ? !1 : ((d > r || r !== r) && (r = d), (u < o || o !== o) && (o = u), r <= s && o >= n);
2971
+ const h = 1 / t.direction.x, f = 1 / t.direction.y, p = 1 / t.direction.z, y = t.origin.x, S = t.origin.y, w = t.origin.z;
2972
+ let x = e[i], E = e[i + 3], b = e[i + 1], _ = e[i + 3 + 1], A = e[i + 2], P = e[i + 3 + 2];
2973
+ return h >= 0 ? (r = (x - y) * h, o = (E - y) * h) : (r = (E - y) * h, o = (x - y) * h), f >= 0 ? (a = (b - S) * f, c = (_ - S) * f) : (a = (_ - S) * f, c = (b - S) * f), r > c || a > o || ((a > r || isNaN(r)) && (r = a), (c < o || isNaN(o)) && (o = c), p >= 0 ? (d = (A - w) * p, u = (P - w) * p) : (d = (P - w) * p, u = (A - w) * p), r > u || d > o) ? !1 : ((d > r || r !== r) && (r = d), (u < o || o !== o) && (o = u), r <= s && o >= n);
2974
2974
  }
2975
2975
  function pl(i, e, t, n, s, r, o, a) {
2976
2976
  const { geometry: c, _indirectBuffer: d } = i;
@@ -3025,20 +3025,20 @@ function Di(i, e, t, n, s, r) {
3025
3025
  const h = qe(i, c), f = Qe(d, a);
3026
3026
  return ul(e, t, n, h, f, s, r);
3027
3027
  } else {
3028
- const h = rr(i, c), f = wl[h], w = n.direction[f] >= 0;
3029
- let _, y;
3030
- w ? (_ = Fe(i), y = ze(i, c)) : (_ = ze(i, c), y = Fe(i));
3031
- const E = Kt(_, o, n, s, r) ? Di(_, e, t, n, s, r) : null;
3028
+ const h = rr(i, c), f = wl[h], y = n.direction[f] >= 0;
3029
+ let S, w;
3030
+ y ? (S = Fe(i), w = ze(i, c)) : (S = ze(i, c), w = Fe(i));
3031
+ const E = Kt(S, o, n, s, r) ? Di(S, e, t, n, s, r) : null;
3032
3032
  if (E) {
3033
- const v = E.point[f];
3034
- if (w ? v <= o[y + h] : (
3033
+ const A = E.point[f];
3034
+ if (y ? A <= o[w + h] : (
3035
3035
  // min bounding data
3036
- v >= o[y + h + 3]
3036
+ A >= o[w + h + 3]
3037
3037
  ))
3038
3038
  return E;
3039
3039
  }
3040
- const x = Kt(y, o, n, s, r) ? Di(y, e, t, n, s, r) : null;
3041
- return E && x ? E.distance <= x.distance ? E : x : E || x || null;
3040
+ const _ = Kt(w, o, n, s, r) ? Di(w, e, t, n, s, r) : null;
3041
+ return E && _ ? E.distance <= _.distance ? E : _ : E || _ || null;
3042
3042
  }
3043
3043
  }
3044
3044
  const _s = /* @__PURE__ */ new _t(), dn = /* @__PURE__ */ new Tt(), fn = /* @__PURE__ */ new Tt(), On = /* @__PURE__ */ new ht(), Vr = /* @__PURE__ */ new Je(), Ss = /* @__PURE__ */ new Je();
@@ -3051,24 +3051,24 @@ function Ni(i, e, t, n, s = null) {
3051
3051
  const { float32Array: r, uint16Array: o, uint32Array: a } = be;
3052
3052
  let c = i * 2;
3053
3053
  if (s === null && (t.boundingBox || t.computeBoundingBox(), Vr.set(t.boundingBox.min, t.boundingBox.max, n), s = Vr), De(c, o)) {
3054
- const u = e.geometry, h = u.index, f = u.attributes.position, p = t.index, w = t.attributes.position, _ = qe(i, a), y = Qe(c, o);
3054
+ const u = e.geometry, h = u.index, f = u.attributes.position, p = t.index, y = t.attributes.position, S = qe(i, a), w = Qe(c, o);
3055
3055
  if (On.copy(n).invert(), t.boundsTree)
3056
3056
  return xe(i, r, Ss), Ss.matrix.copy(On), Ss.needsUpdate = !0, t.boundsTree.shapecast({
3057
3057
  intersectsBounds: (E) => Ss.intersectsBox(E),
3058
3058
  intersectsTriangle: (E) => {
3059
3059
  E.a.applyMatrix4(n), E.b.applyMatrix4(n), E.c.applyMatrix4(n), E.needsUpdate = !0;
3060
- for (let b = _ * 3, x = (y + _) * 3; b < x; b += 3)
3060
+ for (let b = S * 3, _ = (w + S) * 3; b < _; b += 3)
3061
3061
  if (Ie(fn, b, h, f), fn.needsUpdate = !0, E.intersectsTriangle(fn))
3062
3062
  return !0;
3063
3063
  return !1;
3064
3064
  }
3065
3065
  });
3066
3066
  {
3067
- const S = Ys(t);
3068
- for (let E = _ * 3, b = (y + _) * 3; E < b; E += 3) {
3067
+ const x = Ys(t);
3068
+ for (let E = S * 3, b = (w + S) * 3; E < b; E += 3) {
3069
3069
  Ie(dn, E, h, f), dn.a.applyMatrix4(On), dn.b.applyMatrix4(On), dn.c.applyMatrix4(On), dn.needsUpdate = !0;
3070
- for (let x = 0, v = S * 3; x < v; x += 3)
3071
- if (Ie(fn, x, p, w), fn.needsUpdate = !0, dn.intersectsTriangle(fn))
3070
+ for (let _ = 0, A = x * 3; _ < A; _ += 3)
3071
+ if (Ie(fn, _, p, y), fn.needsUpdate = !0, dn.intersectsTriangle(fn))
3072
3072
  return !0;
3073
3073
  }
3074
3074
  }
@@ -3081,45 +3081,45 @@ const bs = /* @__PURE__ */ new ht(), hi = /* @__PURE__ */ new Je(), Dn = /* @__P
3081
3081
  function Al(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3082
3082
  e.boundingBox || e.computeBoundingBox(), hi.set(e.boundingBox.min, e.boundingBox.max, t), hi.needsUpdate = !0;
3083
3083
  const a = i.geometry, c = a.attributes.position, d = a.index, u = e.attributes.position, h = e.index, f = lt.getPrimitive(), p = lt.getPrimitive();
3084
- let w = _l, _ = Sl, y = null, S = null;
3085
- s && (y = bl, S = xl);
3086
- let E = 1 / 0, b = null, x = null;
3084
+ let y = _l, S = Sl, w = null, x = null;
3085
+ s && (w = bl, x = xl);
3086
+ let E = 1 / 0, b = null, _ = null;
3087
3087
  return bs.copy(t).invert(), Dn.matrix.copy(bs), i.shapecast(
3088
3088
  {
3089
- boundsTraverseOrder: (v) => hi.distanceToBox(v),
3090
- intersectsBounds: (v, L, C) => C < E && C < o ? (L && (Dn.min.copy(v.min), Dn.max.copy(v.max), Dn.needsUpdate = !0), !0) : !1,
3091
- intersectsRange: (v, L) => {
3089
+ boundsTraverseOrder: (A) => hi.distanceToBox(A),
3090
+ intersectsBounds: (A, P, I) => I < E && I < o ? (P && (Dn.min.copy(A.min), Dn.max.copy(A.max), Dn.needsUpdate = !0), !0) : !1,
3091
+ intersectsRange: (A, P) => {
3092
3092
  if (e.boundsTree)
3093
3093
  return e.boundsTree.shapecast({
3094
3094
  boundsTraverseOrder: (M) => Dn.distanceToBox(M),
3095
- intersectsBounds: (M, D, I) => I < E && I < o,
3095
+ intersectsBounds: (M, D, C) => C < E && C < o,
3096
3096
  intersectsRange: (M, D) => {
3097
- for (let I = M, N = M + D; I < N; I++) {
3098
- Ie(p, 3 * I, h, u), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
3099
- for (let O = v, F = v + L; O < F; O++) {
3097
+ for (let C = M, N = M + D; C < N; C++) {
3098
+ Ie(p, 3 * C, h, u), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
3099
+ for (let O = A, F = A + P; O < F; O++) {
3100
3100
  Ie(f, 3 * O, d, c), f.needsUpdate = !0;
3101
- const V = f.distanceToTriangle(p, w, y);
3102
- if (V < E && (_.copy(w), S && S.copy(y), E = V, b = O, x = I), V < r)
3101
+ const V = f.distanceToTriangle(p, y, w);
3102
+ if (V < E && (S.copy(y), x && x.copy(w), E = V, b = O, _ = C), V < r)
3103
3103
  return !0;
3104
3104
  }
3105
3105
  }
3106
3106
  }
3107
3107
  });
3108
3108
  {
3109
- const C = Ys(e);
3110
- for (let M = 0, D = C; M < D; M++) {
3109
+ const I = Ys(e);
3110
+ for (let M = 0, D = I; M < D; M++) {
3111
3111
  Ie(p, 3 * M, h, u), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
3112
- for (let I = v, N = v + L; I < N; I++) {
3113
- Ie(f, 3 * I, d, c), f.needsUpdate = !0;
3114
- const O = f.distanceToTriangle(p, w, y);
3115
- if (O < E && (_.copy(w), S && S.copy(y), E = O, b = I, x = M), O < r)
3112
+ for (let C = A, N = A + P; C < N; C++) {
3113
+ Ie(f, 3 * C, d, c), f.needsUpdate = !0;
3114
+ const O = f.distanceToTriangle(p, y, w);
3115
+ if (O < E && (S.copy(y), x && x.copy(w), E = O, b = C, _ = M), O < r)
3116
3116
  return !0;
3117
3117
  }
3118
3118
  }
3119
3119
  }
3120
3120
  }
3121
3121
  }
3122
- ), lt.releasePrimitive(f), lt.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(_) : n.point = _.clone(), n.distance = E, n.faceIndex = b, s && (s.point ? s.point.copy(S) : s.point = S.clone(), s.point.applyMatrix4(bs), _.applyMatrix4(bs), s.distance = _.sub(s.point).length(), s.faceIndex = x), n);
3122
+ ), lt.releasePrimitive(f), lt.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(S) : n.point = S.clone(), n.distance = E, n.faceIndex = b, s && (s.point ? s.point.copy(x) : s.point = x.clone(), s.point.applyMatrix4(bs), S.applyMatrix4(bs), s.distance = S.sub(s.point).length(), s.faceIndex = _), n);
3123
3123
  }
3124
3124
  function vl(i, e = null) {
3125
3125
  e && Array.isArray(e) && (e = new Set(e));
@@ -3128,41 +3128,41 @@ function vl(i, e = null) {
3128
3128
  const u = i._roots;
3129
3129
  for (let f = 0, p = u.length; f < p; f++)
3130
3130
  r = u[f], o = new Uint32Array(r), a = new Uint16Array(r), c = new Float32Array(r), h(0, d), d += r.byteLength;
3131
- function h(f, p, w = !1) {
3132
- const _ = f * 2;
3133
- if (De(_, a)) {
3134
- const y = qe(f, o), S = Qe(_, a);
3135
- let E = 1 / 0, b = 1 / 0, x = 1 / 0, v = -1 / 0, L = -1 / 0, C = -1 / 0;
3136
- for (let M = y, D = y + S; M < D; M++) {
3137
- const I = 3 * i.resolveTriangleIndex(M);
3131
+ function h(f, p, y = !1) {
3132
+ const S = f * 2;
3133
+ if (De(S, a)) {
3134
+ const w = qe(f, o), x = Qe(S, a);
3135
+ let E = 1 / 0, b = 1 / 0, _ = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
3136
+ for (let M = w, D = w + x; M < D; M++) {
3137
+ const C = 3 * i.resolveTriangleIndex(M);
3138
3138
  for (let N = 0; N < 3; N++) {
3139
- let O = I + N;
3139
+ let O = C + N;
3140
3140
  O = n ? n[O] : O;
3141
3141
  const F = s.getX(O), V = s.getY(O), te = s.getZ(O);
3142
- F < E && (E = F), F > v && (v = F), V < b && (b = V), V > L && (L = V), te < x && (x = te), te > C && (C = te);
3142
+ F < E && (E = F), F > A && (A = F), V < b && (b = V), V > P && (P = V), te < _ && (_ = te), te > I && (I = te);
3143
3143
  }
3144
3144
  }
3145
- return c[f + 0] !== E || c[f + 1] !== b || c[f + 2] !== x || c[f + 3] !== v || c[f + 4] !== L || c[f + 5] !== C ? (c[f + 0] = E, c[f + 1] = b, c[f + 2] = x, c[f + 3] = v, c[f + 4] = L, c[f + 5] = C, !0) : !1;
3145
+ return c[f + 0] !== E || c[f + 1] !== b || c[f + 2] !== _ || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = E, c[f + 1] = b, c[f + 2] = _, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
3146
3146
  } else {
3147
- const y = Fe(f), S = ze(f, o);
3148
- let E = w, b = !1, x = !1;
3147
+ const w = Fe(f), x = ze(f, o);
3148
+ let E = y, b = !1, _ = !1;
3149
3149
  if (e) {
3150
3150
  if (!E) {
3151
- const I = y / Oe + p / Ye, N = S / Oe + p / Ye;
3152
- b = e.has(I), x = e.has(N), E = !b && !x;
3151
+ const C = w / Oe + p / Ye, N = x / Oe + p / Ye;
3152
+ b = e.has(C), _ = e.has(N), E = !b && !_;
3153
3153
  }
3154
3154
  } else
3155
- b = !0, x = !0;
3156
- const v = E || b, L = E || x;
3157
- let C = !1;
3158
- v && (C = h(y, p, E));
3155
+ b = !0, _ = !0;
3156
+ const A = E || b, P = E || _;
3157
+ let I = !1;
3158
+ A && (I = h(w, p, E));
3159
3159
  let M = !1;
3160
- L && (M = h(S, p, E));
3161
- const D = C || M;
3160
+ P && (M = h(x, p, E));
3161
+ const D = I || M;
3162
3162
  if (D)
3163
- for (let I = 0; I < 3; I++) {
3164
- const N = y + I, O = S + I, F = c[N], V = c[N + 3], te = c[O], re = c[O + 3];
3165
- c[f + I] = F < te ? F : te, c[f + I + 3] = V > re ? V : re;
3163
+ for (let C = 0; C < 3; C++) {
3164
+ const N = w + C, O = x + C, F = c[N], V = c[N + 3], te = c[O], re = c[O + 3];
3165
+ c[f + C] = F < te ? F : te, c[f + C + 3] = V > re ? V : re;
3166
3166
  }
3167
3167
  return D;
3168
3168
  }
@@ -3196,20 +3196,20 @@ function Fi(i, e, t, n, s, r) {
3196
3196
  const h = qe(i, c), f = Qe(d, a);
3197
3197
  return ml(e, t, n, h, f, s, r);
3198
3198
  } else {
3199
- const h = rr(i, c), f = Ml[h], w = n.direction[f] >= 0;
3200
- let _, y;
3201
- w ? (_ = Fe(i), y = ze(i, c)) : (_ = ze(i, c), y = Fe(i));
3202
- const E = Kt(_, o, n, s, r) ? Fi(_, e, t, n, s, r) : null;
3199
+ const h = rr(i, c), f = Ml[h], y = n.direction[f] >= 0;
3200
+ let S, w;
3201
+ y ? (S = Fe(i), w = ze(i, c)) : (S = ze(i, c), w = Fe(i));
3202
+ const E = Kt(S, o, n, s, r) ? Fi(S, e, t, n, s, r) : null;
3203
3203
  if (E) {
3204
- const v = E.point[f];
3205
- if (w ? v <= o[y + h] : (
3204
+ const A = E.point[f];
3205
+ if (y ? A <= o[w + h] : (
3206
3206
  // min bounding data
3207
- v >= o[y + h + 3]
3207
+ A >= o[w + h + 3]
3208
3208
  ))
3209
3209
  return E;
3210
3210
  }
3211
- const x = Kt(y, o, n, s, r) ? Fi(y, e, t, n, s, r) : null;
3212
- return E && x ? E.distance <= x.distance ? E : x : E || x || null;
3211
+ const _ = Kt(w, o, n, s, r) ? Fi(w, e, t, n, s, r) : null;
3212
+ return E && _ ? E.distance <= _.distance ? E : _ : E || _ || null;
3213
3213
  }
3214
3214
  }
3215
3215
  const xs = /* @__PURE__ */ new _t(), pn = /* @__PURE__ */ new Tt(), mn = /* @__PURE__ */ new Tt(), Nn = /* @__PURE__ */ new ht(), Zr = /* @__PURE__ */ new Je(), As = /* @__PURE__ */ new Je();
@@ -3222,25 +3222,25 @@ function zi(i, e, t, n, s = null) {
3222
3222
  const { float32Array: r, uint16Array: o, uint32Array: a } = be;
3223
3223
  let c = i * 2;
3224
3224
  if (s === null && (t.boundingBox || t.computeBoundingBox(), Zr.set(t.boundingBox.min, t.boundingBox.max, n), s = Zr), De(c, o)) {
3225
- const u = e.geometry, h = u.index, f = u.attributes.position, p = t.index, w = t.attributes.position, _ = qe(i, a), y = Qe(c, o);
3225
+ const u = e.geometry, h = u.index, f = u.attributes.position, p = t.index, y = t.attributes.position, S = qe(i, a), w = Qe(c, o);
3226
3226
  if (Nn.copy(n).invert(), t.boundsTree)
3227
3227
  return xe(i, r, As), As.matrix.copy(Nn), As.needsUpdate = !0, t.boundsTree.shapecast({
3228
3228
  intersectsBounds: (E) => As.intersectsBox(E),
3229
3229
  intersectsTriangle: (E) => {
3230
3230
  E.a.applyMatrix4(n), E.b.applyMatrix4(n), E.c.applyMatrix4(n), E.needsUpdate = !0;
3231
- for (let b = _, x = y + _; b < x; b++)
3231
+ for (let b = S, _ = w + S; b < _; b++)
3232
3232
  if (Ie(mn, 3 * e.resolveTriangleIndex(b), h, f), mn.needsUpdate = !0, E.intersectsTriangle(mn))
3233
3233
  return !0;
3234
3234
  return !1;
3235
3235
  }
3236
3236
  });
3237
3237
  {
3238
- const S = Ys(t);
3239
- for (let E = _, b = y + _; E < b; E++) {
3240
- const x = e.resolveTriangleIndex(E);
3241
- Ie(pn, 3 * x, h, f), pn.a.applyMatrix4(Nn), pn.b.applyMatrix4(Nn), pn.c.applyMatrix4(Nn), pn.needsUpdate = !0;
3242
- for (let v = 0, L = S * 3; v < L; v += 3)
3243
- if (Ie(mn, v, p, w), mn.needsUpdate = !0, pn.intersectsTriangle(mn))
3238
+ const x = Ys(t);
3239
+ for (let E = S, b = w + S; E < b; E++) {
3240
+ const _ = e.resolveTriangleIndex(E);
3241
+ Ie(pn, 3 * _, h, f), pn.a.applyMatrix4(Nn), pn.b.applyMatrix4(Nn), pn.c.applyMatrix4(Nn), pn.needsUpdate = !0;
3242
+ for (let A = 0, P = x * 3; A < P; A += 3)
3243
+ if (Ie(mn, A, p, y), mn.needsUpdate = !0, pn.intersectsTriangle(mn))
3244
3244
  return !0;
3245
3245
  }
3246
3246
  }
@@ -3253,49 +3253,49 @@ const vs = /* @__PURE__ */ new ht(), ui = /* @__PURE__ */ new Je(), kn = /* @__P
3253
3253
  function Nl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3254
3254
  e.boundingBox || e.computeBoundingBox(), ui.set(e.boundingBox.min, e.boundingBox.max, t), ui.needsUpdate = !0;
3255
3255
  const a = i.geometry, c = a.attributes.position, d = a.index, u = e.attributes.position, h = e.index, f = lt.getPrimitive(), p = lt.getPrimitive();
3256
- let w = Pl, _ = Ll, y = null, S = null;
3257
- s && (y = Ol, S = Dl);
3258
- let E = 1 / 0, b = null, x = null;
3256
+ let y = Pl, S = Ll, w = null, x = null;
3257
+ s && (w = Ol, x = Dl);
3258
+ let E = 1 / 0, b = null, _ = null;
3259
3259
  return vs.copy(t).invert(), kn.matrix.copy(vs), i.shapecast(
3260
3260
  {
3261
- boundsTraverseOrder: (v) => ui.distanceToBox(v),
3262
- intersectsBounds: (v, L, C) => C < E && C < o ? (L && (kn.min.copy(v.min), kn.max.copy(v.max), kn.needsUpdate = !0), !0) : !1,
3263
- intersectsRange: (v, L) => {
3261
+ boundsTraverseOrder: (A) => ui.distanceToBox(A),
3262
+ intersectsBounds: (A, P, I) => I < E && I < o ? (P && (kn.min.copy(A.min), kn.max.copy(A.max), kn.needsUpdate = !0), !0) : !1,
3263
+ intersectsRange: (A, P) => {
3264
3264
  if (e.boundsTree) {
3265
- const C = e.boundsTree;
3266
- return C.shapecast({
3265
+ const I = e.boundsTree;
3266
+ return I.shapecast({
3267
3267
  boundsTraverseOrder: (M) => kn.distanceToBox(M),
3268
- intersectsBounds: (M, D, I) => I < E && I < o,
3268
+ intersectsBounds: (M, D, C) => C < E && C < o,
3269
3269
  intersectsRange: (M, D) => {
3270
- for (let I = M, N = M + D; I < N; I++) {
3271
- const O = C.resolveTriangleIndex(I);
3270
+ for (let C = M, N = M + D; C < N; C++) {
3271
+ const O = I.resolveTriangleIndex(C);
3272
3272
  Ie(p, 3 * O, h, u), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
3273
- for (let F = v, V = v + L; F < V; F++) {
3273
+ for (let F = A, V = A + P; F < V; F++) {
3274
3274
  const te = i.resolveTriangleIndex(F);
3275
3275
  Ie(f, 3 * te, d, c), f.needsUpdate = !0;
3276
- const re = f.distanceToTriangle(p, w, y);
3277
- if (re < E && (_.copy(w), S && S.copy(y), E = re, b = F, x = I), re < r)
3276
+ const re = f.distanceToTriangle(p, y, w);
3277
+ if (re < E && (S.copy(y), x && x.copy(w), E = re, b = F, _ = C), re < r)
3278
3278
  return !0;
3279
3279
  }
3280
3280
  }
3281
3281
  }
3282
3282
  });
3283
3283
  } else {
3284
- const C = Ys(e);
3285
- for (let M = 0, D = C; M < D; M++) {
3284
+ const I = Ys(e);
3285
+ for (let M = 0, D = I; M < D; M++) {
3286
3286
  Ie(p, 3 * M, h, u), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
3287
- for (let I = v, N = v + L; I < N; I++) {
3288
- const O = i.resolveTriangleIndex(I);
3287
+ for (let C = A, N = A + P; C < N; C++) {
3288
+ const O = i.resolveTriangleIndex(C);
3289
3289
  Ie(f, 3 * O, d, c), f.needsUpdate = !0;
3290
- const F = f.distanceToTriangle(p, w, y);
3291
- if (F < E && (_.copy(w), S && S.copy(y), E = F, b = I, x = M), F < r)
3290
+ const F = f.distanceToTriangle(p, y, w);
3291
+ if (F < E && (S.copy(y), x && x.copy(w), E = F, b = C, _ = M), F < r)
3292
3292
  return !0;
3293
3293
  }
3294
3294
  }
3295
3295
  }
3296
3296
  }
3297
3297
  }
3298
- ), lt.releasePrimitive(f), lt.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(_) : n.point = _.clone(), n.distance = E, n.faceIndex = b, s && (s.point ? s.point.copy(S) : s.point = S.clone(), s.point.applyMatrix4(vs), _.applyMatrix4(vs), s.distance = _.sub(s.point).length(), s.faceIndex = x), n);
3298
+ ), lt.releasePrimitive(f), lt.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(S) : n.point = S.clone(), n.distance = E, n.faceIndex = b, s && (s.point ? s.point.copy(x) : s.point = x.clone(), s.point.applyMatrix4(vs), S.applyMatrix4(vs), s.distance = S.sub(s.point).length(), s.faceIndex = _), n);
3299
3299
  }
3300
3300
  function Wr(i, e, t) {
3301
3301
  return i === null ? null : (i.point.applyMatrix4(e.matrixWorld), i.distance = i.point.distanceTo(t.ray.origin), i.object = e, i);
@@ -3366,9 +3366,9 @@ class Vs extends nl {
3366
3366
  function c(d) {
3367
3367
  for (let u = 0; u < d.length; u++) {
3368
3368
  const h = d[u], f = new Uint32Array(h), p = new Uint16Array(h);
3369
- for (let w = 0, _ = h.byteLength / Ye; w < _; w++) {
3370
- const y = Oe * w, S = 2 * y;
3371
- De(S, p) || (f[y + 6] = f[y + 6] / Oe - w);
3369
+ for (let y = 0, S = h.byteLength / Ye; y < S; y++) {
3370
+ const w = Oe * y, x = 2 * w;
3371
+ De(x, p) || (f[w + 6] = f[w + 6] / Oe - y);
3372
3372
  }
3373
3373
  }
3374
3374
  }
@@ -3412,11 +3412,11 @@ class Vs extends nl {
3412
3412
  let u = d + 0, h = d + 1, f = d + 2;
3413
3413
  a && (u = a[u], h = a[h], f = a[f]);
3414
3414
  for (let p = 0; p < 3; p++) {
3415
- const w = o[di[p]](u), _ = o[di[p]](h), y = o[di[p]](f);
3416
- let S = w;
3417
- _ < S && (S = _), y < S && (S = y);
3418
- let E = w;
3419
- _ > E && (E = _), y > E && (E = y), t[n + p] = S, t[n + p + 3] = E;
3415
+ const y = o[di[p]](u), S = o[di[p]](h), w = o[di[p]](f);
3416
+ let x = y;
3417
+ S < x && (x = S), w < x && (x = w);
3418
+ let E = y;
3419
+ S > E && (E = S), w > E && (E = w), t[n + p] = x, t[n + p + 3] = E;
3420
3420
  }
3421
3421
  return t;
3422
3422
  }
@@ -3432,19 +3432,19 @@ class Vs extends nl {
3432
3432
  let h = 3;
3433
3433
  o.isInterleavedBufferAttribute && (h = o.data.stride);
3434
3434
  const f = ["getX", "getY", "getZ"], p = n.offset;
3435
- for (let w = e, _ = e + t; w < _; w++) {
3436
- const S = (r ? r[w] : w) * 3, E = (w - p) * 6;
3437
- let b = S + 0, x = S + 1, v = S + 2;
3438
- a && (b = a[b], x = a[x], v = a[v]), c || (b = b * h + u, x = x * h + u, v = v * h + u);
3439
- for (let L = 0; L < 3; L++) {
3440
- let C, M, D;
3441
- c ? (C = o[f[L]](b), M = o[f[L]](x), D = o[f[L]](v)) : (C = d[b + L], M = d[x + L], D = d[v + L]);
3442
- let I = C;
3443
- M < I && (I = M), D < I && (I = D);
3444
- let N = C;
3435
+ for (let y = e, S = e + t; y < S; y++) {
3436
+ const x = (r ? r[y] : y) * 3, E = (y - p) * 6;
3437
+ let b = x + 0, _ = x + 1, A = x + 2;
3438
+ a && (b = a[b], _ = a[_], A = a[A]), c || (b = b * h + u, _ = _ * h + u, A = A * h + u);
3439
+ for (let P = 0; P < 3; P++) {
3440
+ let I, M, D;
3441
+ c ? (I = o[f[P]](b), M = o[f[P]](_), D = o[f[P]](A)) : (I = d[b + P], M = d[_ + P], D = d[A + P]);
3442
+ let C = I;
3443
+ M < C && (C = M), D < C && (C = D);
3444
+ let N = I;
3445
3445
  M > N && (N = M), D > N && (N = D);
3446
- const O = (N - I) / 2, F = L * 2;
3447
- n[E + F + 0] = I + O, n[E + F + 1] = O + (Math.abs(I) + O) * Fs;
3446
+ const O = (N - C) / 2, F = P * 2;
3447
+ n[E + F + 0] = C + O, n[E + F + 1] = O + (Math.abs(C) + O) * Fs;
3448
3448
  }
3449
3449
  }
3450
3450
  return n;
@@ -3600,36 +3600,36 @@ class Vs extends nl {
3600
3600
  intersectsRanges: s,
3601
3601
  intersectsTriangles: r
3602
3602
  } = n;
3603
- const o = lt.getPrimitive(), a = this.geometry.index, c = this.geometry.attributes.position, d = this.indirect ? (w) => {
3604
- const _ = this.resolveTriangleIndex(w);
3605
- Ie(o, _ * 3, a, c);
3606
- } : (w) => {
3607
- Ie(o, w * 3, a, c);
3608
- }, u = lt.getPrimitive(), h = e.geometry.index, f = e.geometry.attributes.position, p = e.indirect ? (w) => {
3609
- const _ = e.resolveTriangleIndex(w);
3610
- Ie(u, _ * 3, h, f);
3611
- } : (w) => {
3612
- Ie(u, w * 3, h, f);
3603
+ const o = lt.getPrimitive(), a = this.geometry.index, c = this.geometry.attributes.position, d = this.indirect ? (y) => {
3604
+ const S = this.resolveTriangleIndex(y);
3605
+ Ie(o, S * 3, a, c);
3606
+ } : (y) => {
3607
+ Ie(o, y * 3, a, c);
3608
+ }, u = lt.getPrimitive(), h = e.geometry.index, f = e.geometry.attributes.position, p = e.indirect ? (y) => {
3609
+ const S = e.resolveTriangleIndex(y);
3610
+ Ie(u, S * 3, h, f);
3611
+ } : (y) => {
3612
+ Ie(u, y * 3, h, f);
3613
3613
  };
3614
3614
  if (r) {
3615
3615
  if (!(e instanceof Vs))
3616
3616
  throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');
3617
- const w = (_, y, S, E, b, x, v, L) => {
3618
- for (let C = S, M = S + E; C < M; C++) {
3619
- p(C), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
3620
- for (let D = _, I = _ + y; D < I; D++)
3621
- if (d(D), o.needsUpdate = !0, r(o, u, D, C, b, x, v, L))
3617
+ const y = (S, w, x, E, b, _, A, P) => {
3618
+ for (let I = x, M = x + E; I < M; I++) {
3619
+ p(I), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
3620
+ for (let D = S, C = S + w; D < C; D++)
3621
+ if (d(D), o.needsUpdate = !0, r(o, u, D, I, b, _, A, P))
3622
3622
  return !0;
3623
3623
  }
3624
3624
  return !1;
3625
3625
  };
3626
3626
  if (s) {
3627
- const _ = s;
3628
- s = function(y, S, E, b, x, v, L, C) {
3629
- return _(y, S, E, b, x, v, L, C) ? !0 : w(y, S, E, b, x, v, L, C);
3627
+ const S = s;
3628
+ s = function(w, x, E, b, _, A, P, I) {
3629
+ return S(w, x, E, b, _, A, P, I) ? !0 : y(w, x, E, b, _, A, P, I);
3630
3630
  };
3631
3631
  } else
3632
- s = w;
3632
+ s = y;
3633
3633
  }
3634
3634
  return super.bvhcast(e, t, { intersectsRanges: s });
3635
3635
  }
@@ -4937,16 +4937,16 @@ class oh {
4937
4937
  a.push(this.parser.getDependency("accessor", o[d]).then((u) => (c[d] = u, c[d])));
4938
4938
  return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((d) => {
4939
4939
  const u = d.pop(), h = u.isGroup ? u.children : [u], f = d[0].count, p = [];
4940
- for (const w of h) {
4941
- const _ = new ht(), y = new q(), S = new xn(), E = new q(1, 1, 1), b = new Ao(w.geometry, w.material, f);
4942
- for (let x = 0; x < f; x++)
4943
- c.TRANSLATION && y.fromBufferAttribute(c.TRANSLATION, x), c.ROTATION && S.fromBufferAttribute(c.ROTATION, x), c.SCALE && E.fromBufferAttribute(c.SCALE, x), b.setMatrixAt(x, _.compose(y, S, E));
4944
- for (const x in c)
4945
- if (x === "_COLOR_0") {
4946
- const v = c[x];
4947
- b.instanceColor = new Qa(v.array, v.itemSize, v.normalized);
4948
- } else x !== "TRANSLATION" && x !== "ROTATION" && x !== "SCALE" && w.geometry.setAttribute(x, c[x]);
4949
- er.prototype.copy.call(b, w), this.parser.assignFinalMaterial(b), p.push(b);
4940
+ for (const y of h) {
4941
+ const S = new ht(), w = new q(), x = new xn(), E = new q(1, 1, 1), b = new Ao(y.geometry, y.material, f);
4942
+ for (let _ = 0; _ < f; _++)
4943
+ c.TRANSLATION && w.fromBufferAttribute(c.TRANSLATION, _), c.ROTATION && x.fromBufferAttribute(c.ROTATION, _), c.SCALE && E.fromBufferAttribute(c.SCALE, _), b.setMatrixAt(_, S.compose(w, x, E));
4944
+ for (const _ in c)
4945
+ if (_ === "_COLOR_0") {
4946
+ const A = c[_];
4947
+ b.instanceColor = new Qa(A.array, A.itemSize, A.normalized);
4948
+ } else _ !== "TRANSLATION" && _ !== "ROTATION" && _ !== "SCALE" && y.geometry.setAttribute(_, c[_]);
4949
+ er.prototype.copy.call(b, y), this.parser.assignFinalMaterial(b), p.push(b);
4950
4950
  }
4951
4951
  return u.isGroup ? (u.clear(), u.add(...p), u) : p[0];
4952
4952
  }));
@@ -5006,9 +5006,9 @@ class ch {
5006
5006
  return t.getDependency("bufferView", r).then(function(u) {
5007
5007
  return new Promise(function(h, f) {
5008
5008
  s.decodeDracoFile(u, function(p) {
5009
- for (const w in p.attributes) {
5010
- const _ = p.attributes[w], y = c[w];
5011
- y !== void 0 && (_.normalized = y);
5009
+ for (const y in p.attributes) {
5010
+ const S = p.attributes[y], w = c[y];
5011
+ w !== void 0 && (S.normalized = w);
5012
5012
  }
5013
5013
  h(p);
5014
5014
  }, a, d, je, f);
@@ -5040,10 +5040,10 @@ class Go extends Ec {
5040
5040
  return t;
5041
5041
  }
5042
5042
  interpolate_(e, t, n, s) {
5043
- const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = a * 2, d = a * 3, u = s - t, h = (n - t) / u, f = h * h, p = f * h, w = e * d, _ = w - d, y = -2 * p + 3 * f, S = p - f, E = 1 - y, b = S - f + h;
5044
- for (let x = 0; x !== a; x++) {
5045
- const v = o[_ + x + a], L = o[_ + x + c] * u, C = o[w + x + a], M = o[w + x] * u;
5046
- r[x] = E * v + b * L + y * C + S * M;
5043
+ const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = a * 2, d = a * 3, u = s - t, h = (n - t) / u, f = h * h, p = f * h, y = e * d, S = y - d, w = -2 * p + 3 * f, x = p - f, E = 1 - w, b = x - f + h;
5044
+ for (let _ = 0; _ !== a; _++) {
5045
+ const A = o[S + _ + a], P = o[S + _ + c] * u, I = o[y + _ + a], M = o[y + _] * u;
5046
+ r[_] = E * A + b * P + w * I + x * M;
5047
5047
  }
5048
5048
  return r;
5049
5049
  }
@@ -5468,24 +5468,24 @@ class Th {
5468
5468
  }
5469
5469
  const r = [];
5470
5470
  return s.bufferView !== void 0 ? r.push(this.getDependency("bufferView", s.bufferView)) : r.push(null), s.sparse !== void 0 && (r.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(r).then(function(o) {
5471
- const a = o[0], c = fi[s.type], d = bn[s.componentType], u = d.BYTES_PER_ELEMENT, h = u * c, f = s.byteOffset || 0, p = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, w = s.normalized === !0;
5472
- let _, y;
5471
+ const a = o[0], c = fi[s.type], d = bn[s.componentType], u = d.BYTES_PER_ELEMENT, h = u * c, f = s.byteOffset || 0, p = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, y = s.normalized === !0;
5472
+ let S, w;
5473
5473
  if (p && p !== h) {
5474
- const S = Math.floor(f / p), E = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + S + ":" + s.count;
5474
+ const x = Math.floor(f / p), E = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + x + ":" + s.count;
5475
5475
  let b = t.cache.get(E);
5476
- b || (_ = new d(a, S * p, s.count * p / u), b = new tc(_, p / u), t.cache.add(E, b)), y = new nc(b, c, f % p / u, w);
5476
+ b || (S = new d(a, x * p, s.count * p / u), b = new tc(S, p / u), t.cache.add(E, b)), w = new nc(b, c, f % p / u, y);
5477
5477
  } else
5478
- a === null ? _ = new d(s.count * c) : _ = new d(a, f, s.count * c), y = new jn(_, c, w);
5478
+ a === null ? S = new d(s.count * c) : S = new d(a, f, s.count * c), w = new jn(S, c, y);
5479
5479
  if (s.sparse !== void 0) {
5480
- const S = fi.SCALAR, E = bn[s.sparse.indices.componentType], b = s.sparse.indices.byteOffset || 0, x = s.sparse.values.byteOffset || 0, v = new E(o[1], b, s.sparse.count * S), L = new d(o[2], x, s.sparse.count * c);
5481
- a !== null && (y = new jn(y.array.slice(), y.itemSize, y.normalized)), y.normalized = !1;
5482
- for (let C = 0, M = v.length; C < M; C++) {
5483
- const D = v[C];
5484
- if (y.setX(D, L[C * c]), c >= 2 && y.setY(D, L[C * c + 1]), c >= 3 && y.setZ(D, L[C * c + 2]), c >= 4 && y.setW(D, L[C * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
5480
+ const x = fi.SCALAR, E = bn[s.sparse.indices.componentType], b = s.sparse.indices.byteOffset || 0, _ = s.sparse.values.byteOffset || 0, A = new E(o[1], b, s.sparse.count * x), P = new d(o[2], _, s.sparse.count * c);
5481
+ a !== null && (w = new jn(w.array.slice(), w.itemSize, w.normalized)), w.normalized = !1;
5482
+ for (let I = 0, M = A.length; I < M; I++) {
5483
+ const D = A[I];
5484
+ if (w.setX(D, P[I * c]), c >= 2 && w.setY(D, P[I * c + 1]), c >= 3 && w.setZ(D, P[I * c + 2]), c >= 4 && w.setW(D, P[I * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
5485
5485
  }
5486
- y.normalized = w;
5486
+ w.normalized = y;
5487
5487
  }
5488
- return y;
5488
+ return w;
5489
5489
  });
5490
5490
  }
5491
5491
  /**
@@ -5533,11 +5533,11 @@ class Th {
5533
5533
  throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
5534
5534
  const u = Promise.resolve(c).then(function(h) {
5535
5535
  return new Promise(function(f, p) {
5536
- let w = f;
5537
- t.isImageBitmapLoader === !0 && (w = function(_) {
5538
- const y = new xr(_);
5539
- y.needsUpdate = !0, f(y);
5540
- }), t.load(Gn.resolveURL(h, r.path), w, void 0, p);
5536
+ let y = f;
5537
+ t.isImageBitmapLoader === !0 && (y = function(S) {
5538
+ const w = new xr(S);
5539
+ w.needsUpdate = !0, f(w);
5540
+ }), t.load(Gn.resolveURL(h, r.path), y, void 0, p);
5541
5541
  });
5542
5542
  }).then(function(h) {
5543
5543
  return d === !0 && a.revokeObjectURL(c), vt(h, o), h.userData.mimeType = o.mimeType || wh(o.uri), h;
@@ -5699,25 +5699,25 @@ class Th {
5699
5699
  }
5700
5700
  return a.push(t.loadGeometries(o)), Promise.all(a).then(function(c) {
5701
5701
  const d = c.slice(0, c.length - 1), u = c[c.length - 1], h = [];
5702
- for (let p = 0, w = u.length; p < w; p++) {
5703
- const _ = u[p], y = o[p];
5704
- let S;
5702
+ for (let p = 0, y = u.length; p < y; p++) {
5703
+ const S = u[p], w = o[p];
5704
+ let x;
5705
5705
  const E = d[p];
5706
- if (y.mode === at.TRIANGLES || y.mode === at.TRIANGLE_STRIP || y.mode === at.TRIANGLE_FAN || y.mode === void 0)
5707
- S = r.isSkinnedMesh === !0 ? new dc(_, E) : new yt(_, E), S.isSkinnedMesh === !0 && S.normalizeSkinWeights(), y.mode === at.TRIANGLE_STRIP ? S.geometry = Qr(S.geometry, So) : y.mode === at.TRIANGLE_FAN && (S.geometry = Qr(S.geometry, vi));
5708
- else if (y.mode === at.LINES)
5709
- S = new qi(_, E);
5710
- else if (y.mode === at.LINE_STRIP)
5711
- S = new Qi(_, E);
5712
- else if (y.mode === at.LINE_LOOP)
5713
- S = new $i(_, E);
5714
- else if (y.mode === at.POINTS)
5715
- S = new Ji(_, E);
5706
+ if (w.mode === at.TRIANGLES || w.mode === at.TRIANGLE_STRIP || w.mode === at.TRIANGLE_FAN || w.mode === void 0)
5707
+ x = r.isSkinnedMesh === !0 ? new dc(S, E) : new yt(S, E), x.isSkinnedMesh === !0 && x.normalizeSkinWeights(), w.mode === at.TRIANGLE_STRIP ? x.geometry = Qr(x.geometry, So) : w.mode === at.TRIANGLE_FAN && (x.geometry = Qr(x.geometry, vi));
5708
+ else if (w.mode === at.LINES)
5709
+ x = new qi(S, E);
5710
+ else if (w.mode === at.LINE_STRIP)
5711
+ x = new Qi(S, E);
5712
+ else if (w.mode === at.LINE_LOOP)
5713
+ x = new $i(S, E);
5714
+ else if (w.mode === at.POINTS)
5715
+ x = new Ji(S, E);
5716
5716
  else
5717
- throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode);
5718
- Object.keys(S.geometry.morphAttributes).length > 0 && gh(S, r), S.name = t.createUniqueName(r.name || "mesh_" + e), vt(S, r), y.extensions && Jt(s, S, y), t.assignFinalMaterial(S), h.push(S);
5717
+ throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + w.mode);
5718
+ Object.keys(x.geometry.morphAttributes).length > 0 && gh(x, r), x.name = t.createUniqueName(r.name || "mesh_" + e), vt(x, r), w.extensions && Jt(s, x, w), t.assignFinalMaterial(x), h.push(x);
5719
5719
  }
5720
- for (let p = 0, w = h.length; p < w; p++)
5720
+ for (let p = 0, y = h.length; p < y; p++)
5721
5721
  t.associations.set(h[p], {
5722
5722
  meshes: e,
5723
5723
  primitives: p
@@ -5726,7 +5726,7 @@ class Th {
5726
5726
  return r.extensions && Jt(s, h[0], r), h[0];
5727
5727
  const f = new ti();
5728
5728
  r.extensions && Jt(s, f, r), t.associations.set(f, { meshes: e });
5729
- for (let p = 0, w = h.length; p < w; p++)
5729
+ for (let p = 0, y = h.length; p < y; p++)
5730
5730
  f.add(h[p]);
5731
5731
  return f;
5732
5732
  });
@@ -5782,8 +5782,8 @@ class Th {
5782
5782
  loadAnimation(e) {
5783
5783
  const t = this.json, n = this, s = t.animations[e], r = s.name ? s.name : "animation_" + e, o = [], a = [], c = [], d = [], u = [];
5784
5784
  for (let h = 0, f = s.channels.length; h < f; h++) {
5785
- const p = s.channels[h], w = s.samplers[p.sampler], _ = p.target, y = _.node, S = s.parameters !== void 0 ? s.parameters[w.input] : w.input, E = s.parameters !== void 0 ? s.parameters[w.output] : w.output;
5786
- _.node !== void 0 && (o.push(this.getDependency("node", y)), a.push(this.getDependency("accessor", S)), c.push(this.getDependency("accessor", E)), d.push(w), u.push(_));
5785
+ const p = s.channels[h], y = s.samplers[p.sampler], S = p.target, w = S.node, x = s.parameters !== void 0 ? s.parameters[y.input] : y.input, E = s.parameters !== void 0 ? s.parameters[y.output] : y.output;
5786
+ S.node !== void 0 && (o.push(this.getDependency("node", w)), a.push(this.getDependency("accessor", x)), c.push(this.getDependency("accessor", E)), d.push(y), u.push(S));
5787
5787
  }
5788
5788
  return Promise.all([
5789
5789
  Promise.all(o),
@@ -5792,17 +5792,17 @@ class Th {
5792
5792
  Promise.all(d),
5793
5793
  Promise.all(u)
5794
5794
  ]).then(function(h) {
5795
- const f = h[0], p = h[1], w = h[2], _ = h[3], y = h[4], S = [];
5796
- for (let b = 0, x = f.length; b < x; b++) {
5797
- const v = f[b], L = p[b], C = w[b], M = _[b], D = y[b];
5798
- if (v === void 0) continue;
5799
- v.updateMatrix && v.updateMatrix();
5800
- const I = n._createAnimationTracks(v, L, C, M, D);
5801
- if (I)
5802
- for (let N = 0; N < I.length; N++)
5803
- S.push(I[N]);
5804
- }
5805
- const E = new gc(r, void 0, S);
5795
+ const f = h[0], p = h[1], y = h[2], S = h[3], w = h[4], x = [];
5796
+ for (let b = 0, _ = f.length; b < _; b++) {
5797
+ const A = f[b], P = p[b], I = y[b], M = S[b], D = w[b];
5798
+ if (A === void 0) continue;
5799
+ A.updateMatrix && A.updateMatrix();
5800
+ const C = n._createAnimationTracks(A, P, I, M, D);
5801
+ if (C)
5802
+ for (let N = 0; N < C.length; N++)
5803
+ x.push(C[N]);
5804
+ }
5805
+ const E = new gc(r, void 0, x);
5806
5806
  return vt(E, s), E;
5807
5807
  });
5808
5808
  }
@@ -5838,11 +5838,11 @@ class Th {
5838
5838
  f !== null && u.traverse(function(p) {
5839
5839
  p.isSkinnedMesh && p.bind(f, Eh);
5840
5840
  });
5841
- for (let p = 0, w = h.length; p < w; p++)
5841
+ for (let p = 0, y = h.length; p < y; p++)
5842
5842
  u.add(h[p]);
5843
5843
  if (u.userData.pivot !== void 0 && h.length > 0) {
5844
- const p = u.userData.pivot, w = h[0];
5845
- u.pivot = new q().fromArray(p), u.position.x -= p[0], u.position.y -= p[1], u.position.z -= p[2], w.position.set(0, 0, 0), delete u.userData.pivot;
5844
+ const p = u.userData.pivot, y = h[0];
5845
+ u.pivot = new q().fromArray(p), u.position.x -= p[0], u.position.y -= p[1], u.position.z -= p[2], y.position.set(0, 0, 0), delete u.userData.pivot;
5846
5846
  }
5847
5847
  return u;
5848
5848
  });
@@ -5943,14 +5943,14 @@ class Th {
5943
5943
  break;
5944
5944
  }
5945
5945
  const h = s.interpolation !== void 0 ? fh[s.interpolation] : Mo, f = this._getArrayFromAccessor(n);
5946
- for (let p = 0, w = c.length; p < w; p++) {
5947
- const _ = new u(
5946
+ for (let p = 0, y = c.length; p < y; p++) {
5947
+ const S = new u(
5948
5948
  c[p] + "." + Bt[r.path],
5949
5949
  t.array,
5950
5950
  f,
5951
5951
  h
5952
5952
  );
5953
- s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(_), o.push(_);
5953
+ s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(S), o.push(S);
5954
5954
  }
5955
5955
  return o;
5956
5956
  }
@@ -5995,11 +5995,11 @@ function _h(i, e, t) {
5995
5995
  for (let d = 0, u = r.length; d < u; d++) {
5996
5996
  const h = r[d];
5997
5997
  if (h.POSITION !== void 0) {
5998
- const f = t.json.accessors[h.POSITION], p = f.min, w = f.max;
5999
- if (p !== void 0 && w !== void 0) {
6000
- if (c.setX(Math.max(Math.abs(p[0]), Math.abs(w[0]))), c.setY(Math.max(Math.abs(p[1]), Math.abs(w[1]))), c.setZ(Math.max(Math.abs(p[2]), Math.abs(w[2]))), f.normalized) {
6001
- const _ = Hi(bn[f.componentType]);
6002
- c.multiplyScalar(_);
5998
+ const f = t.json.accessors[h.POSITION], p = f.min, y = f.max;
5999
+ if (p !== void 0 && y !== void 0) {
6000
+ if (c.setX(Math.max(Math.abs(p[0]), Math.abs(y[0]))), c.setY(Math.max(Math.abs(p[1]), Math.abs(y[1]))), c.setZ(Math.max(Math.abs(p[2]), Math.abs(y[2]))), f.normalized) {
6001
+ const S = Hi(bn[f.componentType]);
6002
+ c.multiplyScalar(S);
6003
6003
  }
6004
6004
  a.max(c);
6005
6005
  } else
@@ -6911,13 +6911,13 @@ const Gi = "contact-shadow-baked", Yn = "contact-shadow-live", ao = Math.PI * (3
6911
6911
  f.rotation.x = -Math.PI / 2, f.position.set(s.center.x, 0, s.center.z), f.receiveShadow = !0, a.add(f);
6912
6912
  const p = this.createBakeCamera(s);
6913
6913
  a.add(p);
6914
- const w = e.getRenderTarget(), _ = e.autoClear, y = e.getClearColor(new T.Color()), S = e.getClearAlpha(), E = e.shadowMap.autoUpdate;
6914
+ const y = e.getRenderTarget(), S = e.autoClear, w = e.getClearColor(new T.Color()), x = e.getClearAlpha(), E = e.shadowMap.autoUpdate;
6915
6915
  try {
6916
6916
  e.shadowMap.autoUpdate = !0, e.setRenderTarget(r), e.setClearColor(0, 0), e.clear(!0, !1, !1), e.autoClear = !1;
6917
6917
  for (const b of this.sampleLightPositions(n))
6918
6918
  u.position.copy(b), e.render(a, p);
6919
6919
  } finally {
6920
- e.autoClear = _, e.setClearColor(y, S), e.setRenderTarget(w), e.shadowMap.autoUpdate = E, this.restoreColorWrite(d), c ? c.add(t) : a.remove(t), u.dispose(), h.dispose();
6920
+ e.autoClear = S, e.setClearColor(w, x), e.setRenderTarget(y), e.shadowMap.autoUpdate = E, this.restoreColorWrite(d), c ? c.add(t) : a.remove(t), u.dispose(), h.dispose();
6921
6921
  }
6922
6922
  }
6923
6923
  /**
@@ -6955,22 +6955,22 @@ const Gi = "contact-shadow-baked", Yn = "contact-shadow-live", ao = Math.PI * (3
6955
6955
  const t = e.position.clone(), n = e.target.parent ? e.target.getWorldPosition(new T.Vector3()) : e.target.position.clone(), s = n.clone().sub(t), r = s.length(), o = s.normalize(), a = new T.Vector3().crossVectors(o, new T.Vector3(0, 1, 0));
6956
6956
  a.lengthSq() < 1e-6 && a.set(1, 0, 0), a.normalize();
6957
6957
  const c = new T.Vector3().crossVectors(o, a), d = Math.round(this.passes * Ke.AMBIENT_RATIO), u = this.passes - d, h = T.MathUtils.degToRad(Ke.LIGHT_APERTURE_DEGREES), f = Math.tan(h / 2) * r, p = [];
6958
- for (let y = 0; y < u; y++) {
6959
- const S = f * Math.sqrt((y + 0.5) / u), E = y * ao;
6958
+ for (let w = 0; w < u; w++) {
6959
+ const x = f * Math.sqrt((w + 0.5) / u), E = w * ao;
6960
6960
  p.push(
6961
- t.clone().addScaledVector(a, S * Math.cos(E)).addScaledVector(c, S * Math.sin(E))
6961
+ t.clone().addScaledVector(a, x * Math.cos(E)).addScaledVector(c, x * Math.sin(E))
6962
6962
  );
6963
6963
  }
6964
- const w = Math.sin(
6964
+ const y = Math.sin(
6965
6965
  T.MathUtils.degToRad(Ke.AMBIENT_MIN_ELEVATION_DEGREES)
6966
- ), _ = 0.98;
6967
- for (let y = 0; y < d; y++) {
6968
- const S = Math.sqrt((y + 0.5) / d), E = w + (_ - w) * S, b = Math.sqrt(1 - E * E), x = y * ao;
6966
+ ), S = 0.98;
6967
+ for (let w = 0; w < d; w++) {
6968
+ const x = Math.sqrt((w + 0.5) / d), E = y + (S - y) * x, b = Math.sqrt(1 - E * E), _ = w * ao;
6969
6969
  p.push(
6970
6970
  new T.Vector3(
6971
- b * Math.cos(x),
6971
+ b * Math.cos(_),
6972
6972
  E,
6973
- b * Math.sin(x)
6973
+ b * Math.sin(_)
6974
6974
  ).multiplyScalar(r).add(n)
6975
6975
  );
6976
6976
  }
@@ -7103,14 +7103,14 @@ class Gh {
7103
7103
  }), c = s * Math.sqrt(3), d = s * 2;
7104
7104
  for (let h = -n; h <= n; h++) {
7105
7105
  const f = Math.max(-n, -h - n), p = Math.min(n, -h + n);
7106
- for (let w = f; w <= p; w++) {
7107
- const _ = c * (h + w / 2), y = d * 0.75 * w, S = [], E = Math.PI * 2 / 6;
7108
- for (let v = 0; v <= 6; v++) {
7109
- const L = v * E + Math.PI / 6, C = _ + s * Math.cos(L), M = y + s * Math.sin(L);
7110
- S.push(new T.Vector3(C, 0, M));
7106
+ for (let y = f; y <= p; y++) {
7107
+ const S = c * (h + y / 2), w = d * 0.75 * y, x = [], E = Math.PI * 2 / 6;
7108
+ for (let A = 0; A <= 6; A++) {
7109
+ const P = A * E + Math.PI / 6, I = S + s * Math.cos(P), M = w + s * Math.sin(P);
7110
+ x.push(new T.Vector3(I, 0, M));
7111
7111
  }
7112
- const b = new T.BufferGeometry().setFromPoints(S), x = new T.Line(b, a);
7113
- t.add(x);
7112
+ const b = new T.BufferGeometry().setFromPoints(x), _ = new T.Line(b, a);
7113
+ t.add(_);
7114
7114
  }
7115
7115
  }
7116
7116
  return t;
@@ -7124,9 +7124,9 @@ class Vh {
7124
7124
  }
7125
7125
  createMesh() {
7126
7126
  const e = new T.Shape(), t = this.size + this.bevel, n = Math.PI * 2 / 6;
7127
- for (let _ = 0; _ < 6; _++) {
7128
- const y = t * Math.cos(_ * n), S = t * Math.sin(_ * n);
7129
- _ === 0 ? e.moveTo(y, S) : e.lineTo(y, S);
7127
+ for (let S = 0; S < 6; S++) {
7128
+ const w = t * Math.cos(S * n), x = t * Math.sin(S * n);
7129
+ S === 0 ? e.moveTo(w, x) : e.lineTo(w, x);
7130
7130
  }
7131
7131
  e.closePath();
7132
7132
  const s = {
@@ -7163,8 +7163,8 @@ class Vh {
7163
7163
  // Enable environment map reflections
7164
7164
  }), p = new T.Mesh(r, f);
7165
7165
  p.receiveShadow = !0;
7166
- const w = new T.Group();
7167
- return w.add(p), w.position.set(this.position.x, this.position.y, this.position.z), w.rotation.x = Math.PI / 2, w.rotation.z = Math.PI / 6, w;
7166
+ const y = new T.Group();
7167
+ return y.add(p), y.position.set(this.position.x, this.position.y, this.position.z), y.rotation.x = Math.PI / 2, y.rotation.z = Math.PI / 6, y;
7168
7168
  }
7169
7169
  }
7170
7170
  class Zh {
@@ -7172,17 +7172,17 @@ class Zh {
7172
7172
  this.name = "Hexagonal Glass Grid";
7173
7173
  }
7174
7174
  createGrid(e) {
7175
- var d, u, h, f, p, w, _;
7175
+ var d, u, h, f, p, y, S;
7176
7176
  const t = new T.Group(), n = ((d = e.styleOptions) == null ? void 0 : d.hexRadius) || Math.floor(e.divisions / 2), s = ((u = e.styleOptions) == null ? void 0 : u.tileSize) || 1, r = String(e.color || "#ffffff"), o = sn.getGridSpacing(s), a = o.width, c = o.height;
7177
- for (let y = -n; y <= n; y++) {
7178
- const S = Math.max(-n, -y - n), E = Math.min(n, -y + n);
7179
- for (let b = S; b <= E; b++) {
7180
- const x = a * (y + b / 2), v = c * 0.75 * b, L = sn.getYPosition(s), M = new Vh(new T.Vector3(x, L, v), s, r, {
7177
+ for (let w = -n; w <= n; w++) {
7178
+ const x = Math.max(-n, -w - n), E = Math.min(n, -w + n);
7179
+ for (let b = x; b <= E; b++) {
7180
+ const _ = a * (w + b / 2), A = c * 0.75 * b, P = sn.getYPosition(s), M = new Vh(new T.Vector3(_, P, A), s, r, {
7181
7181
  metalness: (h = e.styleOptions) == null ? void 0 : h.metalness,
7182
7182
  roughness: (f = e.styleOptions) == null ? void 0 : f.roughness,
7183
7183
  transmission: (p = e.styleOptions) == null ? void 0 : p.transmission,
7184
- thickness: (w = e.styleOptions) == null ? void 0 : w.thickness,
7185
- ior: (_ = e.styleOptions) == null ? void 0 : _.ior
7184
+ thickness: (y = e.styleOptions) == null ? void 0 : y.thickness,
7185
+ ior: (S = e.styleOptions) == null ? void 0 : S.ior
7186
7186
  }).createMesh();
7187
7187
  t.add(M);
7188
7188
  }
@@ -7204,22 +7204,22 @@ class Wh {
7204
7204
  this.name = "Stone Tile Grid", this.textureLoader = new T.TextureLoader();
7205
7205
  }
7206
7206
  createGrid(e) {
7207
- var p, w, _, y;
7208
- const t = new T.Group(), n = e.size, s = Math.max(1, e.divisions), r = n / s, o = r * 0.02, a = r - o, c = ((p = e.styleOptions) == null ? void 0 : p.height) || r * 0.05, d = ((w = e.styleOptions) == null ? void 0 : w.bevelSize) || c * 0.2, u = ((_ = e.styleOptions) == null ? void 0 : _.randomHeight) || !1, h = ((y = e.styleOptions) == null ? void 0 : y.randomRotation) || !1, f = this.createStoneMaterial(e);
7209
- for (let S = 0; S < s; S++)
7207
+ var p, y, S, w;
7208
+ const t = new T.Group(), n = e.size, s = Math.max(1, e.divisions), r = n / s, o = r * 0.02, a = r - o, c = ((p = e.styleOptions) == null ? void 0 : p.height) || r * 0.05, d = ((y = e.styleOptions) == null ? void 0 : y.bevelSize) || c * 0.2, u = ((S = e.styleOptions) == null ? void 0 : S.randomHeight) || !1, h = ((w = e.styleOptions) == null ? void 0 : w.randomRotation) || !1, f = this.createStoneMaterial(e);
7209
+ for (let x = 0; x < s; x++)
7210
7210
  for (let E = 0; E < s; E++) {
7211
- const b = (S - s / 2) * r + r / 2, x = (E - s / 2) * r + r / 2, v = u ? c * (0.8 + Math.random() * 0.4) : c, L = new T.Shape(), C = a / 2;
7212
- L.moveTo(-C, -C), L.lineTo(C, -C), L.lineTo(C, C), L.lineTo(-C, C), L.closePath();
7211
+ const b = (x - s / 2) * r + r / 2, _ = (E - s / 2) * r + r / 2, A = u ? c * (0.8 + Math.random() * 0.4) : c, P = new T.Shape(), I = a / 2;
7212
+ P.moveTo(-I, -I), P.lineTo(I, -I), P.lineTo(I, I), P.lineTo(-I, I), P.closePath();
7213
7213
  const M = {
7214
- depth: v,
7214
+ depth: A,
7215
7215
  bevelEnabled: !0,
7216
7216
  bevelSize: d,
7217
7217
  bevelThickness: d,
7218
7218
  bevelSegments: 2
7219
- }, D = new T.ExtrudeGeometry(L, M);
7219
+ }, D = new T.ExtrudeGeometry(P, M);
7220
7220
  D.rotateX(-Math.PI / 2);
7221
- const I = new T.Mesh(D, f);
7222
- I.position.set(b, -v / 2, x), I.castShadow = !0, I.receiveShadow = !0, h && (I.rotation.y = Math.floor(Math.random() * 4) * (Math.PI / 2)), t.add(I);
7221
+ const C = new T.Mesh(D, f);
7222
+ C.position.set(b, -A / 2, _), C.castShadow = !0, C.receiveShadow = !0, h && (C.rotation.y = Math.floor(Math.random() * 4) * (Math.PI / 2)), t.add(C);
7223
7223
  }
7224
7224
  return t;
7225
7225
  }
@@ -7375,8 +7375,8 @@ class Kh {
7375
7375
  return B.ok(void 0);
7376
7376
  const c = [];
7377
7377
  r.traverse((M) => {
7378
- var D, I, N;
7379
- ((D = M.userData) != null && D.isGrid || (I = M.userData) != null && I.isHexGrid || (N = M.userData) != null && N.isDefaultGrid) && c.push(M);
7378
+ var D, C, N;
7379
+ ((D = M.userData) != null && D.isGrid || (C = M.userData) != null && C.isHexGrid || (N = M.userData) != null && N.isDefaultGrid) && c.push(M);
7380
7380
  }), c.forEach((M) => {
7381
7381
  $s(M), r.remove(M);
7382
7382
  });
@@ -7385,26 +7385,26 @@ class Kh {
7385
7385
  const u = new T.Box3().setFromObject(d), h = u.getSize(new T.Vector3());
7386
7386
  if (u.isEmpty() || !Number.isFinite(h.x) || !Number.isFinite(h.z))
7387
7387
  return console.warn("Skipping dynamic grid: object has an empty or non-finite bounding box"), B.ok(void 0);
7388
- const f = (s = a.styleOptions) == null ? void 0 : s.tileSize, p = typeof f == "number" ? f : 1, _ = sn.getGridSpacing(p).width, y = Math.max(h.x, h.z) * n + h.y;
7389
- let S = y <= _ ? 0 : Math.ceil((y / _ - 1) / 2);
7388
+ const f = (s = a.styleOptions) == null ? void 0 : s.tileSize, p = typeof f == "number" ? f : 1, S = sn.getGridSpacing(p).width, w = Math.max(h.x, h.z) * n + h.y;
7389
+ let x = w <= S ? 0 : Math.ceil((w / S - 1) / 2);
7390
7390
  const E = 60;
7391
- S > E && (console.warn(
7392
- `Dynamic grid would need ${S} rings to cover the object; capping at ${E}. The floor will not fully reach the configured coverage for this tileSize/object-size combination.`
7393
- ), S = E), y < _ * 0.8 ? S = 0 : S < 3 && y > _ * 2 && (S = 3);
7394
- const b = a.type || Ot.HEXAGONAL_GLASS, v = {
7391
+ x > E && (console.warn(
7392
+ `Dynamic grid would need ${x} rings to cover the object; capping at ${E}. The floor will not fully reach the configured coverage for this tileSize/object-size combination.`
7393
+ ), x = E), w < S * 0.8 ? x = 0 : x < 3 && w > S * 2 && (x = 3);
7394
+ const b = a.type || Ot.HEXAGONAL_GLASS, A = {
7395
7395
  size: Math.max(h.x, h.z) * n,
7396
- divisions: S * 2 + 1,
7396
+ divisions: x * 2 + 1,
7397
7397
  color: a.color,
7398
7398
  opacity: a.opacity,
7399
7399
  styleOptions: {
7400
- hexRadius: S,
7400
+ hexRadius: x,
7401
7401
  tileSize: p,
7402
7402
  ...a.styleOptions
7403
7403
  }
7404
- }, L = Zs.createGrid(b, v);
7405
- L.userData.isGrid = !0, L.userData.isHexGrid = !0;
7406
- const C = L.getObjectByName(Yn);
7407
- return C && (C.position.y = T.MathUtils.clamp(h.y * 25e-4, 2e-4, 2e-3)), r.add(L), B.ok(void 0);
7404
+ }, P = Zs.createGrid(b, A);
7405
+ P.userData.isGrid = !0, P.userData.isHexGrid = !0;
7406
+ const I = P.getObjectByName(Yn);
7407
+ return I && (I.position.y = T.MathUtils.clamp(h.y * 25e-4, 2e-4, 2e-3)), r.add(P), B.ok(void 0);
7408
7408
  } catch (r) {
7409
7409
  return B.err(
7410
7410
  new W(
@@ -7426,47 +7426,50 @@ class Kh {
7426
7426
  );
7427
7427
  let n;
7428
7428
  t instanceof Le || "getThreeObject" in t && typeof t.getThreeObject == "function" ? n = t.getThreeObject() : n = t;
7429
- const s = (y) => {
7430
- var E, b, x;
7431
- let S = y;
7432
- for (; S; ) {
7433
- if ((E = S.userData) != null && E.isGrid || (b = S.userData) != null && b.isHexGrid || (x = S.userData) != null && x.isDefaultGrid)
7429
+ const s = (_) => {
7430
+ var P, I, M;
7431
+ let A = _;
7432
+ for (; A; ) {
7433
+ if ((P = A.userData) != null && P.isGrid || (I = A.userData) != null && I.isHexGrid || (M = A.userData) != null && M.isDefaultGrid)
7434
7434
  return !0;
7435
- S = S.parent;
7435
+ A = A.parent;
7436
7436
  }
7437
7437
  return !1;
7438
7438
  }, r = e.getThreeScene();
7439
7439
  r.updateMatrixWorld(!0);
7440
7440
  const o = [];
7441
- r.traverse((y) => {
7442
- y.isMesh && s(y) && o.push(y);
7441
+ r.traverse((_) => {
7442
+ _.isMesh && s(_) && o.push(_);
7443
7443
  });
7444
7444
  const a = [];
7445
- if (n.traverse((y) => {
7446
- y.isMesh && a.push(y);
7445
+ if (n.traverse((_) => {
7446
+ _.isMesh && a.push(_);
7447
7447
  }), o.length === 0 || a.length === 0)
7448
7448
  return B.ok(void 0);
7449
7449
  let c = -1 / 0;
7450
7450
  const d = new T.Box3();
7451
- for (const y of o)
7452
- d.setFromObject(y), Number.isFinite(d.max.y) && (c = Math.max(c, d.max.y));
7451
+ for (const _ of o)
7452
+ d.setFromObject(_), Number.isFinite(d.max.y) && (c = Math.max(c, d.max.y));
7453
7453
  if (!Number.isFinite(c))
7454
7454
  return B.ok(void 0);
7455
7455
  const u = new T.Box3().setFromObject(n);
7456
7456
  if (u.isEmpty() || !Number.isFinite(u.min.x) || !Number.isFinite(u.max.x))
7457
7457
  return B.ok(void 0);
7458
- const h = 40, f = u.max.y + Math.max(1, u.max.y - u.min.y), p = new T.Raycaster(), w = new T.Vector3(0, -1, 0);
7459
- let _ = 1 / 0;
7460
- for (let y = 0; y <= h; y++)
7461
- for (let S = 0; S <= h; S++) {
7462
- const E = u.min.x + (u.max.x - u.min.x) * (y / h), b = u.min.z + (u.max.z - u.min.z) * (S / h);
7463
- p.set(new T.Vector3(E, f, b), w);
7464
- for (const x of p.intersectObjects(a, !1))
7465
- x.point.y < _ && (_ = x.point.y);
7458
+ const h = 40, f = Math.max(1, u.max.y - u.min.y), p = u.max.y + f, y = u.min.y - f, S = new T.Raycaster(), w = new T.Vector3(0, -1, 0), x = new T.Vector3(0, 1, 0);
7459
+ let E = 1 / 0;
7460
+ const b = (_, A, P, I) => {
7461
+ S.set(new T.Vector3(_, A, P), I);
7462
+ for (const M of S.intersectObjects(a, !1))
7463
+ M.point.y < E && (E = M.point.y);
7464
+ };
7465
+ for (let _ = 0; _ <= h; _++)
7466
+ for (let A = 0; A <= h; A++) {
7467
+ const P = u.min.x + (u.max.x - u.min.x) * (_ / h), I = u.min.z + (u.max.z - u.min.z) * (A / h);
7468
+ b(P, p, I, w), b(P, y, I, x);
7466
7469
  }
7467
- if (Number.isFinite(_)) {
7468
- const y = _ - c;
7469
- Math.abs(y) > 1e-4 && (n.position.y -= y);
7470
+ if (Number.isFinite(E)) {
7471
+ const _ = E - c;
7472
+ Math.abs(_) > 1e-4 && (n.position.y -= _);
7470
7473
  }
7471
7474
  return B.ok(void 0);
7472
7475
  } catch (n) {
@@ -7685,8 +7688,8 @@ class Kh {
7685
7688
  "fov" in r ? h = r.fov * (Math.PI / 180) : h = 50 * (Math.PI / 180);
7686
7689
  let f = Math.abs(u / 2 / Math.tan(h / 2));
7687
7690
  f *= 2;
7688
- const p = -Math.PI / 4, w = Math.PI / 8, _ = c.x + f * Math.sin(p) * Math.cos(w), y = c.y + f * Math.sin(w), S = c.z + f * Math.cos(p) * Math.cos(w);
7689
- return r.position.set(_, y, S), r.lookAt(c), r.updateProjectionMatrix(), o && o.target && (o.target.copy(c), o.update()), B.ok(void 0);
7691
+ const p = -Math.PI / 4, y = Math.PI / 8, S = c.x + f * Math.sin(p) * Math.cos(y), w = c.y + f * Math.sin(y), x = c.z + f * Math.cos(p) * Math.cos(y);
7692
+ return r.position.set(S, w, x), r.lookAt(c), r.updateProjectionMatrix(), o && o.target && (o.target.copy(c), o.update()), B.ok(void 0);
7690
7693
  } catch (s) {
7691
7694
  return B.err(
7692
7695
  new W(
@@ -7703,7 +7706,7 @@ class Xh {
7703
7706
  this.events = new nr(), this.disposed = !1;
7704
7707
  }
7705
7708
  async initialize(e) {
7706
- const { ThreePathTracingService: t } = await import("./ThreePathTracingService-BmpaPOib.js");
7709
+ const { ThreePathTracingService: t } = await import("./ThreePathTracingService-D0KG3Ciu.js");
7707
7710
  if (this.disposed)
7708
7711
  return B.ok(void 0);
7709
7712
  const n = new t();
@@ -7911,21 +7914,21 @@ var eu = /* @__PURE__ */ Wn(es, 9, 1), tu = /* @__PURE__ */ Wn(ea, 5, 1), Ei = f
7911
7914
  var ts = new ct(Math.max(It * 2, rn));
7912
7915
  ts.set(t), t = ts;
7913
7916
  }
7914
- }, u = e.f || 0, h = e.p || 0, f = e.b || 0, p = e.l, w = e.d, _ = e.m, y = e.n, S = s * 8;
7917
+ }, u = e.f || 0, h = e.p || 0, f = e.b || 0, p = e.l, y = e.d, S = e.m, w = e.n, x = s * 8;
7915
7918
  do {
7916
7919
  if (!p) {
7917
7920
  u = pt(i, h, 1);
7918
7921
  var E = pt(i, h + 1, 3);
7919
7922
  if (h += 3, E)
7920
7923
  if (E == 1)
7921
- p = eu, w = tu, _ = 9, y = 5;
7924
+ p = eu, y = tu, S = 9, w = 5;
7922
7925
  else if (E == 2) {
7923
- var L = pt(i, h, 31) + 257, C = pt(i, h + 10, 15) + 4, M = L + pt(i, h + 5, 31) + 1;
7926
+ var P = pt(i, h, 31) + 257, I = pt(i, h + 10, 15) + 4, M = P + pt(i, h + 5, 31) + 1;
7924
7927
  h += 14;
7925
- for (var D = new ct(M), I = new ct(19), N = 0; N < C; ++N)
7926
- I[qh[N]] = pt(i, h + N * 3, 7);
7927
- h += C * 3;
7928
- for (var O = Ei(I), F = (1 << O) - 1, V = Wn(I, O, 1), N = 0; N < M; ) {
7928
+ for (var D = new ct(M), C = new ct(19), N = 0; N < I; ++N)
7929
+ C[qh[N]] = pt(i, h + N * 3, 7);
7930
+ h += I * 3;
7931
+ for (var O = Ei(C), F = (1 << O) - 1, V = Wn(C, O, 1), N = 0; N < M; ) {
7929
7932
  var te = V[pt(i, h, F)];
7930
7933
  h += te & 15;
7931
7934
  var b = te >> 4;
@@ -7937,28 +7940,28 @@ var eu = /* @__PURE__ */ Wn(es, 9, 1), tu = /* @__PURE__ */ Wn(ea, 5, 1), Ei = f
7937
7940
  D[N++] = re;
7938
7941
  }
7939
7942
  }
7940
- var ut = D.subarray(0, L), Re = D.subarray(L);
7941
- _ = Ei(ut), y = Ei(Re), p = Wn(ut, _, 1), w = Wn(Re, y, 1);
7943
+ var ut = D.subarray(0, P), Re = D.subarray(P);
7944
+ S = Ei(ut), w = Ei(Re), p = Wn(ut, S, 1), y = Wn(Re, w, 1);
7942
7945
  } else
7943
7946
  gt(1);
7944
7947
  else {
7945
- var b = nu(h) + 4, x = i[b - 4] | i[b - 3] << 8, v = b + x;
7946
- if (v > s) {
7948
+ var b = nu(h) + 4, _ = i[b - 4] | i[b - 3] << 8, A = b + _;
7949
+ if (A > s) {
7947
7950
  c && gt(0);
7948
7951
  break;
7949
7952
  }
7950
- a && d(f + x), t.set(i.subarray(b, v), f), e.b = f += x, e.p = h = v * 8, e.f = u;
7953
+ a && d(f + _), t.set(i.subarray(b, A), f), e.b = f += _, e.p = h = A * 8, e.f = u;
7951
7954
  continue;
7952
7955
  }
7953
- if (h > S) {
7956
+ if (h > x) {
7954
7957
  c && gt(0);
7955
7958
  break;
7956
7959
  }
7957
7960
  }
7958
7961
  a && d(f + 131072);
7959
- for (var Ue = (1 << _) - 1, Ge = (1 << y) - 1, Ae = h; ; Ae = h) {
7962
+ for (var Ue = (1 << S) - 1, Ge = (1 << w) - 1, Ae = h; ; Ae = h) {
7960
7963
  var re = p[Ti(i, h) & Ue], ge = re >> 4;
7961
- if (h += re & 15, h > S) {
7964
+ if (h += re & 15, h > x) {
7962
7965
  c && gt(0);
7963
7966
  break;
7964
7967
  }
@@ -7973,14 +7976,14 @@ var eu = /* @__PURE__ */ Wn(es, 9, 1), tu = /* @__PURE__ */ Wn(ea, 5, 1), Ei = f
7973
7976
  var N = ge - 257, Ve = Yo[N];
7974
7977
  St = pt(i, h, (1 << Ve) - 1) + Jo[N], h += Ve;
7975
7978
  }
7976
- var kt = w[Ti(i, h) & Ge], me = kt >> 4;
7979
+ var kt = y[Ti(i, h) & Ge], me = kt >> 4;
7977
7980
  kt || gt(3), h += kt & 15;
7978
7981
  var Re = Jh[me];
7979
7982
  if (me > 3) {
7980
7983
  var Ve = qo[me];
7981
7984
  Re += Ti(i, h) & (1 << Ve) - 1, h += Ve;
7982
7985
  }
7983
- if (h > S) {
7986
+ if (h > x) {
7984
7987
  c && gt(0);
7985
7988
  break;
7986
7989
  }
@@ -7995,7 +7998,7 @@ var eu = /* @__PURE__ */ Wn(es, 9, 1), tu = /* @__PURE__ */ Wn(ea, 5, 1), Ei = f
7995
7998
  t[f] = t[f - Re];
7996
7999
  }
7997
8000
  }
7998
- e.l = p, e.p = Ae, e.b = f, e.f = u, p && (u = 1, e.m = _, e.d = w, e.n = y);
8001
+ e.l = p, e.p = Ae, e.b = f, e.f = u, p && (u = 1, e.m = S, e.d = y, e.n = w);
7999
8002
  } while (!u);
8000
8003
  return f != t.length && o ? su(t, 0, f) : t.subarray(0, f);
8001
8004
  }, ou = /* @__PURE__ */ new ct(0), au = function(i, e) {
@@ -8026,11 +8029,11 @@ class hu extends Co {
8026
8029
  */
8027
8030
  parse(e) {
8028
8031
  const D = Math.pow(2.7182818, 2.2);
8029
- let I = null;
8032
+ let C = null;
8030
8033
  function N(l, m) {
8031
8034
  let g = 0;
8032
- for (let P = 0; P < 65536; ++P)
8033
- (P == 0 || l[P >> 3] & 1 << (P & 7)) && (m[g++] = P);
8035
+ for (let L = 0; L < 65536; ++L)
8036
+ (L == 0 || l[L >> 3] & 1 << (L & 7)) && (m[g++] = L);
8034
8037
  const R = g - 1;
8035
8038
  for (; g < 65536; ) m[g++] = 0;
8036
8039
  return R;
@@ -8040,9 +8043,9 @@ class hu extends Co {
8040
8043
  l[m] = {}, l[m].len = 0, l[m].lit = 0, l[m].p = null;
8041
8044
  }
8042
8045
  const F = { l: 0, c: 0, lc: 0 };
8043
- function V(l, m, g, R, P) {
8046
+ function V(l, m, g, R, L) {
8044
8047
  for (; g < l; )
8045
- m = m << 8 | Er(R, P), g += 8;
8048
+ m = m << 8 | Er(R, L), g += 8;
8046
8049
  g -= l, F.l = m >> g & (1 << l) - 1, F.c = m, F.lc = g;
8047
8050
  }
8048
8051
  const te = new Array(59);
@@ -8059,25 +8062,25 @@ class hu extends Co {
8059
8062
  R > 0 && (l[g] = R | te[R]++ << 6);
8060
8063
  }
8061
8064
  }
8062
- function Ne(l, m, g, R, P, z) {
8063
- const A = m;
8065
+ function Ne(l, m, g, R, L, z) {
8066
+ const v = m;
8064
8067
  let H = 0, k = 0;
8065
- for (; R <= P; R++) {
8066
- if (A.value - m.value > g) return !1;
8067
- V(6, H, k, l, A);
8068
+ for (; R <= L; R++) {
8069
+ if (v.value - m.value > g) return !1;
8070
+ V(6, H, k, l, v);
8068
8071
  const U = F.l;
8069
8072
  if (H = F.c, k = F.lc, z[R] = U, U == 63) {
8070
- if (A.value - m.value > g)
8073
+ if (v.value - m.value > g)
8071
8074
  throw new Error("THREE.EXRLoader: Something wrong with hufUnpackEncTable");
8072
- V(8, H, k, l, A);
8075
+ V(8, H, k, l, v);
8073
8076
  let j = F.l + 6;
8074
- if (H = F.c, k = F.lc, R + j > P + 1)
8077
+ if (H = F.c, k = F.lc, R + j > L + 1)
8075
8078
  throw new Error("THREE.EXRLoader: Something wrong with hufUnpackEncTable");
8076
8079
  for (; j--; ) z[R++] = 0;
8077
8080
  R--;
8078
8081
  } else if (U >= 59) {
8079
8082
  let j = U - 59 + 2;
8080
- if (R + j > P + 1)
8083
+ if (R + j > L + 1)
8081
8084
  throw new Error("THREE.EXRLoader: Something wrong with hufUnpackEncTable");
8082
8085
  for (; j--; ) z[R++] = 0;
8083
8086
  R--;
@@ -8093,28 +8096,28 @@ class hu extends Co {
8093
8096
  }
8094
8097
  function Ue(l, m, g, R) {
8095
8098
  for (; m <= g; m++) {
8096
- const P = Re(l[m]), z = ut(l[m]);
8097
- if (P >> z)
8099
+ const L = Re(l[m]), z = ut(l[m]);
8100
+ if (L >> z)
8098
8101
  throw new Error("THREE.EXRLoader: Invalid table entry");
8099
8102
  if (z > 14) {
8100
- const A = R[P >> z - 14];
8101
- if (A.len)
8103
+ const v = R[L >> z - 14];
8104
+ if (v.len)
8102
8105
  throw new Error("THREE.EXRLoader: Invalid table entry");
8103
- if (A.lit++, A.p) {
8104
- const H = A.p;
8105
- A.p = new Array(A.lit);
8106
- for (let k = 0; k < A.lit - 1; ++k)
8107
- A.p[k] = H[k];
8106
+ if (v.lit++, v.p) {
8107
+ const H = v.p;
8108
+ v.p = new Array(v.lit);
8109
+ for (let k = 0; k < v.lit - 1; ++k)
8110
+ v.p[k] = H[k];
8108
8111
  } else
8109
- A.p = new Array(1);
8110
- A.p[A.lit - 1] = m;
8112
+ v.p = new Array(1);
8113
+ v.p[v.lit - 1] = m;
8111
8114
  } else if (z) {
8112
- let A = 0;
8115
+ let v = 0;
8113
8116
  for (let H = 1 << 14 - z; H > 0; H--) {
8114
- const k = R[(P << 14 - z) + A];
8117
+ const k = R[(L << 14 - z) + v];
8115
8118
  if (k.len || k.p)
8116
8119
  throw new Error("THREE.EXRLoader: Invalid table entry");
8117
- k.len = z, k.lit = m, A++;
8120
+ k.len = z, k.lit = m, v++;
8118
8121
  }
8119
8122
  }
8120
8123
  }
@@ -8125,17 +8128,17 @@ class hu extends Co {
8125
8128
  l = l << 8 | Er(g, R), m += 8, Ge.c = l, Ge.lc = m;
8126
8129
  }
8127
8130
  const ge = { c: 0, lc: 0 };
8128
- function St(l, m, g, R, P, z, A, H, k) {
8131
+ function St(l, m, g, R, L, z, v, H, k) {
8129
8132
  if (l == m) {
8130
- R < 8 && (Ae(g, R, P, z), g = Ge.c, R = Ge.lc), R -= 8;
8133
+ R < 8 && (Ae(g, R, L, z), g = Ge.c, R = Ge.lc), R -= 8;
8131
8134
  let U = g >> R;
8132
8135
  if (U = new Uint8Array([U])[0], H.value + U > k)
8133
8136
  return !1;
8134
- const j = A[H.value - 1];
8137
+ const j = v[H.value - 1];
8135
8138
  for (; U-- > 0; )
8136
- A[H.value++] = j;
8139
+ v[H.value++] = j;
8137
8140
  } else if (H.value < k)
8138
- A[H.value++] = l;
8141
+ v[H.value++] = l;
8139
8142
  else
8140
8143
  return !1;
8141
8144
  ge.c = g, ge.lc = R;
@@ -8149,20 +8152,20 @@ class hu extends Co {
8149
8152
  }
8150
8153
  const me = { a: 0, b: 0 };
8151
8154
  function dt(l, m) {
8152
- const g = kt(l), P = kt(m), z = g + (P & 1) + (P >> 1), A = z, H = z - P;
8153
- me.a = A, me.b = H;
8155
+ const g = kt(l), L = kt(m), z = g + (L & 1) + (L >> 1), v = z, H = z - L;
8156
+ me.a = v, me.b = H;
8154
8157
  }
8155
8158
  function ft(l, m) {
8156
- const g = Ve(l), R = Ve(m), P = g - (R >> 1) & 65535, z = R + P - 32768 & 65535;
8157
- me.a = z, me.b = P;
8159
+ const g = Ve(l), R = Ve(m), L = g - (R >> 1) & 65535, z = R + L - 32768 & 65535;
8160
+ me.a = z, me.b = L;
8158
8161
  }
8159
- function An(l, m, g, R, P, z, A) {
8160
- const H = A < 16384, k = g > P ? P : g;
8162
+ function An(l, m, g, R, L, z, v) {
8163
+ const H = v < 16384, k = g > L ? L : g;
8161
8164
  let U = 1, j, Z;
8162
8165
  for (; U <= k; ) U <<= 1;
8163
8166
  for (U >>= 1, j = U, U >>= 1; U >= 1; ) {
8164
8167
  Z = 0;
8165
- const G = Z + z * (P - j), X = z * U, J = z * j, K = R * U, $ = R * j;
8168
+ const G = Z + z * (L - j), X = z * U, J = z * j, K = R * U, $ = R * j;
8166
8169
  let ie, le, oe, ue;
8167
8170
  for (; Z <= G; Z += J) {
8168
8171
  let ne = Z;
@@ -8176,7 +8179,7 @@ class hu extends Co {
8176
8179
  H ? dt(l[ne + m], l[se + m]) : ft(l[ne + m], l[se + m]), ie = me.a, l[se + m] = me.b, l[ne + m] = ie;
8177
8180
  }
8178
8181
  }
8179
- if (P & U) {
8182
+ if (L & U) {
8180
8183
  let ne = Z;
8181
8184
  const ee = Z + R * (g - j);
8182
8185
  for (; ne <= ee; ne += $) {
@@ -8188,9 +8191,9 @@ class hu extends Co {
8188
8191
  }
8189
8192
  return Z;
8190
8193
  }
8191
- function rn(l, m, g, R, P, z, A, H, k) {
8194
+ function rn(l, m, g, R, L, z, v, H, k) {
8192
8195
  let U = 0, j = 0;
8193
- const Z = A, G = Math.trunc(R.value + (P + 7) / 8);
8196
+ const Z = v, G = Math.trunc(R.value + (L + 7) / 8);
8194
8197
  for (; R.value < G; )
8195
8198
  for (Ae(U, j, g, R), U = Ge.c, j = Ge.lc; j >= 14; ) {
8196
8199
  const J = U >> j - 14 & 16383, K = m[J];
@@ -8213,7 +8216,7 @@ class hu extends Co {
8213
8216
  throw new Error("THREE.EXRLoader: hufDecode issues");
8214
8217
  }
8215
8218
  }
8216
- const X = 8 - P & 7;
8219
+ const X = 8 - L & 7;
8217
8220
  for (U >>= X, j -= X; j > 0; ) {
8218
8221
  const J = m[U << 14 - j & 16383];
8219
8222
  if (J.len)
@@ -8223,8 +8226,8 @@ class hu extends Co {
8223
8226
  }
8224
8227
  return !0;
8225
8228
  }
8226
- function It(l, m, g, R, P, z) {
8227
- const A = { value: 0 }, H = g.value, k = st(m, g), U = st(m, g);
8229
+ function It(l, m, g, R, L, z) {
8230
+ const v = { value: 0 }, H = g.value, k = st(m, g), U = st(m, g);
8228
8231
  g.value += 4;
8229
8232
  const j = st(m, g);
8230
8233
  if (g.value += 4, k < 0 || k >= 65537 || U < 0 || U >= 65537)
@@ -8234,7 +8237,7 @@ class hu extends Co {
8234
8237
  const X = R - (g.value - H);
8235
8238
  if (Ne(l, g, X, k, U, Z), j > 8 * (R - (g.value - H)))
8236
8239
  throw new Error("THREE.EXRLoader: Something wrong with hufUncompress");
8237
- Ue(Z, k, U, G), rn(Z, G, l, g, j, U, z, P, A);
8240
+ Ue(Z, k, U, G), rn(Z, G, l, g, j, U, z, L, v);
8238
8241
  }
8239
8242
  function ts(l, m, g) {
8240
8243
  for (let R = 0; R < g; ++R)
@@ -8247,35 +8250,35 @@ class hu extends Co {
8247
8250
  }
8248
8251
  }
8249
8252
  function ss(l, m) {
8250
- let g = 0, R = Math.floor((l.length + 1) / 2), P = 0;
8253
+ let g = 0, R = Math.floor((l.length + 1) / 2), L = 0;
8251
8254
  const z = l.length - 1;
8252
- for (; !(P > z || (m[P++] = l[g++], P > z)); )
8253
- m[P++] = l[R++];
8255
+ for (; !(L > z || (m[L++] = l[g++], L > z)); )
8256
+ m[L++] = l[R++];
8254
8257
  }
8255
8258
  function Qs(l) {
8256
8259
  let m = l.byteLength;
8257
8260
  const g = new Array();
8258
8261
  let R = 0;
8259
- const P = new DataView(l);
8262
+ const L = new DataView(l);
8260
8263
  for (; m > 0; ) {
8261
- const z = P.getInt8(R++);
8264
+ const z = L.getInt8(R++);
8262
8265
  if (z < 0) {
8263
- const A = -z;
8264
- m -= A + 1;
8265
- for (let H = 0; H < A; H++)
8266
- g.push(P.getUint8(R++));
8266
+ const v = -z;
8267
+ m -= v + 1;
8268
+ for (let H = 0; H < v; H++)
8269
+ g.push(L.getUint8(R++));
8267
8270
  } else {
8268
- const A = z;
8271
+ const v = z;
8269
8272
  m -= 2;
8270
- const H = P.getUint8(R++);
8271
- for (let k = 0; k < A + 1; k++)
8273
+ const H = L.getUint8(R++);
8274
+ for (let k = 0; k < v + 1; k++)
8272
8275
  g.push(H);
8273
8276
  }
8274
8277
  }
8275
8278
  return g;
8276
8279
  }
8277
- function ua(l, m, g, R, P, z) {
8278
- let A = new DataView(z.buffer);
8280
+ function ua(l, m, g, R, L, z) {
8281
+ let v = new DataView(z.buffer);
8279
8282
  const H = g[l.idx[0]].width, k = g[l.idx[0]].height, U = 3, j = Math.floor(H / 8), Z = Math.ceil(H / 8), G = Math.ceil(k / 8), X = H - (Z - 1) * 8, J = k - (G - 1) * 8, K = { value: 0 }, $ = new Array(U), ie = new Array(U), le = new Array(U), oe = new Array(U), ue = new Array(U);
8280
8283
  for (let ee = 0; ee < U; ++ee)
8281
8284
  ue[ee] = m[l.idx[ee]], $[ee] = ee < 1 ? 0 : $[ee - 1] + Z * G, ie[ee] = new Float32Array(64), le[ee] = new Uint16Array(64), oe[ee] = new Uint16Array(Z * 64);
@@ -8286,7 +8289,7 @@ class hu extends Co {
8286
8289
  for (let ae = 0; ae < Z; ++ae) {
8287
8290
  ae == Z - 1 && (ye = X);
8288
8291
  for (let he = 0; he < U; ++he)
8289
- le[he].fill(0), le[he][0] = P[$[he]++], pr(K, R, le[he]), mr(le[he], ie[he]), gr(ie[he]);
8292
+ le[he].fill(0), le[he][0] = L[$[he]++], pr(K, R, le[he]), mr(le[he], ie[he]), gr(ie[he]);
8290
8293
  fa(ie);
8291
8294
  for (let he = 0; he < U; ++he)
8292
8295
  yr(ie[he], oe[he], ae * 64);
@@ -8298,19 +8301,19 @@ class hu extends Co {
8298
8301
  fe = ue[ae][Me];
8299
8302
  for (let it = 0; it < j; ++it) {
8300
8303
  const _e = it * 64 + (Me & 7) * 8;
8301
- A.setUint16(fe + 0 * he, oe[ae][_e + 0], !0), A.setUint16(fe + 2 * he, oe[ae][_e + 1], !0), A.setUint16(fe + 4 * he, oe[ae][_e + 2], !0), A.setUint16(fe + 6 * he, oe[ae][_e + 3], !0), A.setUint16(fe + 8 * he, oe[ae][_e + 4], !0), A.setUint16(fe + 10 * he, oe[ae][_e + 5], !0), A.setUint16(fe + 12 * he, oe[ae][_e + 6], !0), A.setUint16(fe + 14 * he, oe[ae][_e + 7], !0), fe += 16 * he;
8304
+ v.setUint16(fe + 0 * he, oe[ae][_e + 0], !0), v.setUint16(fe + 2 * he, oe[ae][_e + 1], !0), v.setUint16(fe + 4 * he, oe[ae][_e + 2], !0), v.setUint16(fe + 6 * he, oe[ae][_e + 3], !0), v.setUint16(fe + 8 * he, oe[ae][_e + 4], !0), v.setUint16(fe + 10 * he, oe[ae][_e + 5], !0), v.setUint16(fe + 12 * he, oe[ae][_e + 6], !0), v.setUint16(fe + 14 * he, oe[ae][_e + 7], !0), fe += 16 * he;
8302
8305
  }
8303
8306
  }
8304
8307
  if (j != Z)
8305
8308
  for (let Me = 8 * ee; Me < 8 * ee + se; ++Me) {
8306
8309
  const it = ue[ae][Me] + 8 * j * 2 * he, _e = j * 64 + (Me & 7) * 8;
8307
8310
  for (let bt = 0; bt < ye; ++bt)
8308
- A.setUint16(it + bt * 2 * he, oe[ae][_e + bt], !0);
8311
+ v.setUint16(it + bt * 2 * he, oe[ae][_e + bt], !0);
8309
8312
  }
8310
8313
  }
8311
8314
  }
8312
8315
  const ne = new Uint16Array(H);
8313
- A = new DataView(z.buffer);
8316
+ v = new DataView(z.buffer);
8314
8317
  for (let ee = 0; ee < U; ++ee) {
8315
8318
  g[l.idx[ee]].decoded = !0;
8316
8319
  const se = g[l.idx[ee]].type;
@@ -8318,59 +8321,59 @@ class hu extends Co {
8318
8321
  for (let ye = 0; ye < k; ++ye) {
8319
8322
  const fe = ue[ee][ye];
8320
8323
  for (let ae = 0; ae < H; ++ae)
8321
- ne[ae] = A.getUint16(fe + ae * 2 * se, !0);
8324
+ ne[ae] = v.getUint16(fe + ae * 2 * se, !0);
8322
8325
  for (let ae = 0; ae < H; ++ae)
8323
- A.setFloat32(fe + ae * 2 * se, Q(ne[ae]), !0);
8326
+ v.setFloat32(fe + ae * 2 * se, Q(ne[ae]), !0);
8324
8327
  }
8325
8328
  }
8326
8329
  }
8327
- function da(l, m, g, R, P, z) {
8328
- const A = new DataView(z.buffer), H = g[l], k = H.width, U = H.height, j = Math.ceil(k / 8), Z = Math.ceil(U / 8), G = Math.floor(k / 8), X = k - (j - 1) * 8, J = U - (Z - 1) * 8, K = { value: 0 };
8330
+ function da(l, m, g, R, L, z) {
8331
+ const v = new DataView(z.buffer), H = g[l], k = H.width, U = H.height, j = Math.ceil(k / 8), Z = Math.ceil(U / 8), G = Math.floor(k / 8), X = k - (j - 1) * 8, J = U - (Z - 1) * 8, K = { value: 0 };
8329
8332
  let $ = 0;
8330
8333
  const ie = new Float32Array(64), le = new Uint16Array(64), oe = new Uint16Array(j * 64);
8331
8334
  for (let ue = 0; ue < Z; ++ue) {
8332
8335
  let ne = 8;
8333
8336
  ue == Z - 1 && (ne = J);
8334
8337
  for (let ee = 0; ee < j; ++ee)
8335
- le.fill(0), le[0] = P[$++], pr(K, R, le), mr(le, ie), gr(ie), yr(ie, oe, ee * 64);
8338
+ le.fill(0), le[0] = L[$++], pr(K, R, le), mr(le, ie), gr(ie), yr(ie, oe, ee * 64);
8336
8339
  for (let ee = 8 * ue; ee < 8 * ue + ne; ++ee) {
8337
8340
  let se = m[l][ee];
8338
8341
  for (let ye = 0; ye < G; ++ye) {
8339
8342
  const fe = ye * 64 + (ee & 7) * 8;
8340
8343
  for (let ae = 0; ae < 8; ++ae)
8341
- A.setUint16(se + ae * 2 * H.type, oe[fe + ae], !0);
8344
+ v.setUint16(se + ae * 2 * H.type, oe[fe + ae], !0);
8342
8345
  se += 16 * H.type;
8343
8346
  }
8344
8347
  if (j != G) {
8345
8348
  const ye = G * 64 + (ee & 7) * 8;
8346
8349
  for (let fe = 0; fe < X; ++fe)
8347
- A.setUint16(se + fe * 2 * H.type, oe[ye + fe], !0);
8350
+ v.setUint16(se + fe * 2 * H.type, oe[ye + fe], !0);
8348
8351
  }
8349
8352
  }
8350
8353
  }
8351
8354
  H.decoded = !0;
8352
8355
  }
8353
8356
  function pr(l, m, g) {
8354
- let R, P = 1;
8355
- for (; P < 64; )
8356
- R = m[l.value], R == 65280 ? P = 64 : R >> 8 == 255 ? P += R & 255 : (g[P] = R, P++), l.value++;
8357
+ let R, L = 1;
8358
+ for (; L < 64; )
8359
+ R = m[l.value], R == 65280 ? L = 64 : R >> 8 == 255 ? L += R & 255 : (g[L] = R, L++), l.value++;
8357
8360
  }
8358
8361
  function mr(l, m) {
8359
8362
  m[0] = Q(l[0]), m[1] = Q(l[1]), m[2] = Q(l[5]), m[3] = Q(l[6]), m[4] = Q(l[14]), m[5] = Q(l[15]), m[6] = Q(l[27]), m[7] = Q(l[28]), m[8] = Q(l[2]), m[9] = Q(l[4]), m[10] = Q(l[7]), m[11] = Q(l[13]), m[12] = Q(l[16]), m[13] = Q(l[26]), m[14] = Q(l[29]), m[15] = Q(l[42]), m[16] = Q(l[3]), m[17] = Q(l[8]), m[18] = Q(l[12]), m[19] = Q(l[17]), m[20] = Q(l[25]), m[21] = Q(l[30]), m[22] = Q(l[41]), m[23] = Q(l[43]), m[24] = Q(l[9]), m[25] = Q(l[11]), m[26] = Q(l[18]), m[27] = Q(l[24]), m[28] = Q(l[31]), m[29] = Q(l[40]), m[30] = Q(l[44]), m[31] = Q(l[53]), m[32] = Q(l[10]), m[33] = Q(l[19]), m[34] = Q(l[23]), m[35] = Q(l[32]), m[36] = Q(l[39]), m[37] = Q(l[45]), m[38] = Q(l[52]), m[39] = Q(l[54]), m[40] = Q(l[20]), m[41] = Q(l[22]), m[42] = Q(l[33]), m[43] = Q(l[38]), m[44] = Q(l[46]), m[45] = Q(l[51]), m[46] = Q(l[55]), m[47] = Q(l[60]), m[48] = Q(l[21]), m[49] = Q(l[34]), m[50] = Q(l[37]), m[51] = Q(l[47]), m[52] = Q(l[50]), m[53] = Q(l[56]), m[54] = Q(l[59]), m[55] = Q(l[61]), m[56] = Q(l[35]), m[57] = Q(l[36]), m[58] = Q(l[48]), m[59] = Q(l[49]), m[60] = Q(l[57]), m[61] = Q(l[58]), m[62] = Q(l[62]), m[63] = Q(l[63]);
8360
8363
  }
8361
8364
  function gr(l) {
8362
- const m = 0.5 * Math.cos(0.7853975), g = 0.5 * Math.cos(3.14159 / 16), R = 0.5 * Math.cos(3.14159 / 8), P = 0.5 * Math.cos(3 * 3.14159 / 16), z = 0.5 * Math.cos(5 * 3.14159 / 16), A = 0.5 * Math.cos(3 * 3.14159 / 8), H = 0.5 * Math.cos(7 * 3.14159 / 16), k = new Array(4), U = new Array(4), j = new Array(4), Z = new Array(4);
8365
+ const m = 0.5 * Math.cos(0.7853975), g = 0.5 * Math.cos(3.14159 / 16), R = 0.5 * Math.cos(3.14159 / 8), L = 0.5 * Math.cos(3 * 3.14159 / 16), z = 0.5 * Math.cos(5 * 3.14159 / 16), v = 0.5 * Math.cos(3 * 3.14159 / 8), H = 0.5 * Math.cos(7 * 3.14159 / 16), k = new Array(4), U = new Array(4), j = new Array(4), Z = new Array(4);
8363
8366
  for (let G = 0; G < 8; ++G) {
8364
8367
  const X = G * 8;
8365
- k[0] = R * l[X + 2], k[1] = A * l[X + 2], k[2] = R * l[X + 6], k[3] = A * l[X + 6], U[0] = g * l[X + 1] + P * l[X + 3] + z * l[X + 5] + H * l[X + 7], U[1] = P * l[X + 1] - H * l[X + 3] - g * l[X + 5] - z * l[X + 7], U[2] = z * l[X + 1] - g * l[X + 3] + H * l[X + 5] + P * l[X + 7], U[3] = H * l[X + 1] - z * l[X + 3] + P * l[X + 5] - g * l[X + 7], j[0] = m * (l[X + 0] + l[X + 4]), j[3] = m * (l[X + 0] - l[X + 4]), j[1] = k[0] + k[3], j[2] = k[1] - k[2], Z[0] = j[0] + j[1], Z[1] = j[3] + j[2], Z[2] = j[3] - j[2], Z[3] = j[0] - j[1], l[X + 0] = Z[0] + U[0], l[X + 1] = Z[1] + U[1], l[X + 2] = Z[2] + U[2], l[X + 3] = Z[3] + U[3], l[X + 4] = Z[3] - U[3], l[X + 5] = Z[2] - U[2], l[X + 6] = Z[1] - U[1], l[X + 7] = Z[0] - U[0];
8368
+ k[0] = R * l[X + 2], k[1] = v * l[X + 2], k[2] = R * l[X + 6], k[3] = v * l[X + 6], U[0] = g * l[X + 1] + L * l[X + 3] + z * l[X + 5] + H * l[X + 7], U[1] = L * l[X + 1] - H * l[X + 3] - g * l[X + 5] - z * l[X + 7], U[2] = z * l[X + 1] - g * l[X + 3] + H * l[X + 5] + L * l[X + 7], U[3] = H * l[X + 1] - z * l[X + 3] + L * l[X + 5] - g * l[X + 7], j[0] = m * (l[X + 0] + l[X + 4]), j[3] = m * (l[X + 0] - l[X + 4]), j[1] = k[0] + k[3], j[2] = k[1] - k[2], Z[0] = j[0] + j[1], Z[1] = j[3] + j[2], Z[2] = j[3] - j[2], Z[3] = j[0] - j[1], l[X + 0] = Z[0] + U[0], l[X + 1] = Z[1] + U[1], l[X + 2] = Z[2] + U[2], l[X + 3] = Z[3] + U[3], l[X + 4] = Z[3] - U[3], l[X + 5] = Z[2] - U[2], l[X + 6] = Z[1] - U[1], l[X + 7] = Z[0] - U[0];
8366
8369
  }
8367
8370
  for (let G = 0; G < 8; ++G)
8368
- k[0] = R * l[16 + G], k[1] = A * l[16 + G], k[2] = R * l[48 + G], k[3] = A * l[48 + G], U[0] = g * l[8 + G] + P * l[24 + G] + z * l[40 + G] + H * l[56 + G], U[1] = P * l[8 + G] - H * l[24 + G] - g * l[40 + G] - z * l[56 + G], U[2] = z * l[8 + G] - g * l[24 + G] + H * l[40 + G] + P * l[56 + G], U[3] = H * l[8 + G] - z * l[24 + G] + P * l[40 + G] - g * l[56 + G], j[0] = m * (l[G] + l[32 + G]), j[3] = m * (l[G] - l[32 + G]), j[1] = k[0] + k[3], j[2] = k[1] - k[2], Z[0] = j[0] + j[1], Z[1] = j[3] + j[2], Z[2] = j[3] - j[2], Z[3] = j[0] - j[1], l[0 + G] = Z[0] + U[0], l[8 + G] = Z[1] + U[1], l[16 + G] = Z[2] + U[2], l[24 + G] = Z[3] + U[3], l[32 + G] = Z[3] - U[3], l[40 + G] = Z[2] - U[2], l[48 + G] = Z[1] - U[1], l[56 + G] = Z[0] - U[0];
8371
+ k[0] = R * l[16 + G], k[1] = v * l[16 + G], k[2] = R * l[48 + G], k[3] = v * l[48 + G], U[0] = g * l[8 + G] + L * l[24 + G] + z * l[40 + G] + H * l[56 + G], U[1] = L * l[8 + G] - H * l[24 + G] - g * l[40 + G] - z * l[56 + G], U[2] = z * l[8 + G] - g * l[24 + G] + H * l[40 + G] + L * l[56 + G], U[3] = H * l[8 + G] - z * l[24 + G] + L * l[40 + G] - g * l[56 + G], j[0] = m * (l[G] + l[32 + G]), j[3] = m * (l[G] - l[32 + G]), j[1] = k[0] + k[3], j[2] = k[1] - k[2], Z[0] = j[0] + j[1], Z[1] = j[3] + j[2], Z[2] = j[3] - j[2], Z[3] = j[0] - j[1], l[0 + G] = Z[0] + U[0], l[8 + G] = Z[1] + U[1], l[16 + G] = Z[2] + U[2], l[24 + G] = Z[3] + U[3], l[32 + G] = Z[3] - U[3], l[40 + G] = Z[2] - U[2], l[48 + G] = Z[1] - U[1], l[56 + G] = Z[0] - U[0];
8369
8372
  }
8370
8373
  function fa(l) {
8371
8374
  for (let m = 0; m < 64; ++m) {
8372
- const g = l[0][m], R = l[1][m], P = l[2][m];
8373
- l[0][m] = g + 1.5747 * P, l[1][m] = g - 0.1873 * R - 0.4682 * P, l[2][m] = g + 1.8556 * R;
8375
+ const g = l[0][m], R = l[1][m], L = l[2][m];
8376
+ l[0][m] = g + 1.5747 * L, l[1][m] = g - 0.1873 * R - 0.4682 * L, l[2][m] = g + 1.8556 * R;
8374
8377
  }
8375
8378
  }
8376
8379
  function yr(l, m, g) {
@@ -8392,22 +8395,22 @@ class hu extends Co {
8392
8395
  return ns(g), ss(g, R), new DataView(R.buffer);
8393
8396
  }
8394
8397
  function ga(l) {
8395
- const m = l.viewer, g = { value: l.offset.value }, R = new Uint16Array(l.columns * l.lines * (l.inputChannels.length * l.type)), P = new Uint8Array(8192);
8398
+ const m = l.viewer, g = { value: l.offset.value }, R = new Uint16Array(l.columns * l.lines * (l.inputChannels.length * l.type)), L = new Uint8Array(8192);
8396
8399
  let z = 0;
8397
- const A = new Array(l.inputChannels.length);
8400
+ const v = new Array(l.inputChannels.length);
8398
8401
  for (let J = 0, K = l.inputChannels.length; J < K; J++)
8399
- A[J] = {}, A[J].start = z, A[J].end = A[J].start, A[J].nx = l.columns, A[J].ny = l.lines, A[J].size = l.type, z += A[J].nx * A[J].ny * A[J].size;
8402
+ v[J] = {}, v[J].start = z, v[J].end = v[J].start, v[J].nx = l.columns, v[J].ny = l.lines, v[J].size = l.type, z += v[J].nx * v[J].ny * v[J].size;
8400
8403
  const H = vn(m, g), k = vn(m, g);
8401
8404
  if (k >= 8192)
8402
8405
  throw new Error("THREE.EXRLoader: Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");
8403
8406
  if (H <= k)
8404
8407
  for (let J = 0; J < k - H + 1; J++)
8405
- P[J + H] = Ft(m, g);
8406
- const U = new Uint16Array(65536), j = N(P, U), Z = st(m, g);
8408
+ L[J + H] = Ft(m, g);
8409
+ const U = new Uint16Array(65536), j = N(L, U), Z = st(m, g);
8407
8410
  It(l.array, m, g, Z, R, z);
8408
8411
  for (let J = 0; J < l.inputChannels.length; ++J) {
8409
- const K = A[J];
8410
- for (let $ = 0; $ < A[J].size; ++$)
8412
+ const K = v[J];
8413
+ for (let $ = 0; $ < v[J].size; ++$)
8411
8414
  An(
8412
8415
  R,
8413
8416
  K.start + $,
@@ -8423,28 +8426,28 @@ class hu extends Co {
8423
8426
  const X = new Uint8Array(R.buffer.byteLength);
8424
8427
  for (let J = 0; J < l.lines; J++)
8425
8428
  for (let K = 0; K < l.inputChannels.length; K++) {
8426
- const $ = A[K], ie = $.nx * $.size, le = new Uint8Array(R.buffer, $.end * 2, ie * 2);
8429
+ const $ = v[K], ie = $.nx * $.size, le = new Uint8Array(R.buffer, $.end * 2, ie * 2);
8427
8430
  X.set(le, G), G += ie * 2, $.end += ie;
8428
8431
  }
8429
8432
  return new DataView(X.buffer);
8430
8433
  }
8431
8434
  function ya(l) {
8432
- const m = l.array.slice(l.offset.value, l.offset.value + l.size), g = zn(m), R = l.inputChannels.length * l.lines * l.columns * l.totalBytes, P = new ArrayBuffer(R), z = new DataView(P);
8433
- let A = 0, H = 0;
8435
+ const m = l.array.slice(l.offset.value, l.offset.value + l.size), g = zn(m), R = l.inputChannels.length * l.lines * l.columns * l.totalBytes, L = new ArrayBuffer(R), z = new DataView(L);
8436
+ let v = 0, H = 0;
8434
8437
  const k = new Array(4);
8435
8438
  for (let U = 0; U < l.lines; U++)
8436
8439
  for (let j = 0; j < l.inputChannels.length; j++) {
8437
8440
  let Z = 0;
8438
8441
  switch (l.inputChannels[j].pixelType) {
8439
8442
  case 1:
8440
- k[0] = A, k[1] = k[0] + l.columns, A = k[1] + l.columns;
8443
+ k[0] = v, k[1] = k[0] + l.columns, v = k[1] + l.columns;
8441
8444
  for (let X = 0; X < l.columns; ++X) {
8442
8445
  const J = g[k[0]++] << 8 | g[k[1]++];
8443
8446
  Z += J, z.setUint16(H, Z, !0), H += 2;
8444
8447
  }
8445
8448
  break;
8446
8449
  case 2:
8447
- k[0] = A, k[1] = k[0] + l.columns, k[2] = k[1] + l.columns, A = k[2] + l.columns;
8450
+ k[0] = v, k[1] = k[0] + l.columns, k[2] = k[1] + l.columns, v = k[2] + l.columns;
8448
8451
  for (let X = 0; X < l.columns; ++X) {
8449
8452
  const J = g[k[0]++] << 24 | g[k[1]++] << 16 | g[k[2]++] << 8;
8450
8453
  Z += J, z.setUint32(H, Z, !0), H += 4;
@@ -8457,14 +8460,14 @@ class hu extends Co {
8457
8460
  function wa(l) {
8458
8461
  const m = l.array;
8459
8462
  let g = l.offset.value;
8460
- const R = l.columns, P = l.lines, z = l.inputChannels, A = l.totalBytes, H = We.compression === "B44A_COMPRESSION", k = new Uint8Array(P * R * A), U = new Uint16Array(16);
8463
+ const R = l.columns, L = l.lines, z = l.inputChannels, v = l.totalBytes, H = We.compression === "B44A_COMPRESSION", k = new Uint8Array(L * R * v), U = new Uint16Array(16);
8461
8464
  let j = 0;
8462
8465
  for (let Z = 0; Z < z.length; Z++) {
8463
- const G = z[Z], X = G.pixelType * 2, J = Math.ceil(R / G.xSampling), K = Math.ceil(P / G.ySampling), $ = G.xSampling === 1 && G.ySampling === 1;
8466
+ const G = z[Z], X = G.pixelType * 2, J = Math.ceil(R / G.xSampling), K = Math.ceil(L / G.ySampling), $ = G.xSampling === 1 && G.ySampling === 1;
8464
8467
  if (G.pixelType !== 1) {
8465
8468
  for (let oe = 0; oe < K; oe++)
8466
8469
  if ($) {
8467
- const ue = oe * R * A + j * R;
8470
+ const ue = oe * R * v + j * R;
8468
8471
  for (let ne = 0; ne < J * X; ne++)
8469
8472
  k[ue + ne] = m[g++];
8470
8473
  } else
@@ -8485,17 +8488,17 @@ class hu extends Co {
8485
8488
  g += 14;
8486
8489
  }
8487
8490
  if (G.pLinear) {
8488
- if (I === null) {
8489
- I = new Uint16Array(65536);
8491
+ if (C === null) {
8492
+ C = new Uint16Array(65536);
8490
8493
  for (let ne = 0; ne < 65536; ne++)
8491
8494
  if ((ne & 31744) === 31744 || ne > 32768)
8492
- I[ne] = 0;
8495
+ C[ne] = 0;
8493
8496
  else {
8494
8497
  const ee = Q(ne);
8495
- I[ne] = ee <= 0 ? 0 : wt.toHalfFloat(8 * Math.log(ee));
8498
+ C[ne] = ee <= 0 ? 0 : wt.toHalfFloat(8 * Math.log(ee));
8496
8499
  }
8497
8500
  }
8498
- for (let ne = 0; ne < 16; ne++) U[ne] = I[U[ne]];
8501
+ for (let ne = 0; ne < 16; ne++) U[ne] = C[U[ne]];
8499
8502
  }
8500
8503
  for (let ne = 0; ne < 4; ne++) {
8501
8504
  const ee = oe * 4 + ne;
@@ -8506,11 +8509,11 @@ class hu extends Co {
8506
8509
  const fe = U[ne * 4 + se];
8507
8510
  for (let ae = 0; ae < G.ySampling; ae++) {
8508
8511
  const he = ee * G.ySampling + ae;
8509
- if (!(he >= P))
8512
+ if (!(he >= L))
8510
8513
  for (let Me = 0; Me < G.xSampling; Me++) {
8511
8514
  const it = ye * G.xSampling + Me;
8512
8515
  if (it >= R) continue;
8513
- const _e = he * R * A + j * R + it * 2;
8516
+ const _e = he * R * v + j * R + it * 2;
8514
8517
  k[_e] = fe & 255, k[_e + 1] = fe >> 8 & 255;
8515
8518
  }
8516
8519
  }
@@ -8522,7 +8525,7 @@ class hu extends Co {
8522
8525
  return new DataView(k.buffer);
8523
8526
  }
8524
8527
  function wr(l) {
8525
- const m = l.viewer, g = { value: l.offset.value }, R = new Uint8Array(l.columns * l.lines * (l.inputChannels.length * l.type * 2)), P = {
8528
+ const m = l.viewer, g = { value: l.offset.value }, R = new Uint8Array(l.columns * l.lines * (l.inputChannels.length * l.type * 2)), L = {
8526
8529
  version: ke(m, g),
8527
8530
  unknownUncompressedSize: ke(m, g),
8528
8531
  unknownCompressedSize: ke(m, g),
@@ -8535,18 +8538,18 @@ class hu extends Co {
8535
8538
  totalDcUncompressedCount: ke(m, g),
8536
8539
  acCompression: ke(m, g)
8537
8540
  };
8538
- if (P.version < 2)
8539
- throw new Error("THREE.EXRLoader: " + We.compression + " version " + P.version + " is unsupported");
8541
+ if (L.version < 2)
8542
+ throw new Error("THREE.EXRLoader: " + We.compression + " version " + L.version + " is unsupported");
8540
8543
  const z = new Array();
8541
- let A = vn(m, g) - 2;
8542
- for (; A > 0; ) {
8544
+ let v = vn(m, g) - 2;
8545
+ for (; v > 0; ) {
8543
8546
  const K = rs(m.buffer, g), $ = Ft(m, g), ie = $ >> 2 & 3, le = ($ >> 4) - 1, oe = new Int8Array([le])[0], ue = Ft(m, g);
8544
8547
  z.push({
8545
8548
  name: K,
8546
8549
  index: oe,
8547
8550
  type: ue,
8548
8551
  compression: ie
8549
- }), A -= K.length + 3;
8552
+ }), v -= K.length + 3;
8550
8553
  }
8551
8554
  const H = We.channels, k = new Array(l.inputChannels.length);
8552
8555
  for (let K = 0; K < l.inputChannels.length; ++K) {
@@ -8564,27 +8567,27 @@ class hu extends Co {
8564
8567
  }
8565
8568
  }
8566
8569
  let j, Z, G;
8567
- if (P.acCompressedSize > 0)
8568
- switch (P.acCompression) {
8570
+ if (L.acCompressedSize > 0)
8571
+ switch (L.acCompression) {
8569
8572
  case 0:
8570
- j = new Uint16Array(P.totalAcUncompressedCount), It(l.array, m, g, P.acCompressedSize, j, P.totalAcUncompressedCount);
8573
+ j = new Uint16Array(L.totalAcUncompressedCount), It(l.array, m, g, L.acCompressedSize, j, L.totalAcUncompressedCount);
8571
8574
  break;
8572
8575
  case 1:
8573
- const K = l.array.slice(g.value, g.value + P.totalAcUncompressedCount), $ = zn(K);
8574
- j = new Uint16Array($.buffer), g.value += P.totalAcUncompressedCount;
8576
+ const K = l.array.slice(g.value, g.value + L.totalAcUncompressedCount), $ = zn(K);
8577
+ j = new Uint16Array($.buffer), g.value += L.totalAcUncompressedCount;
8575
8578
  break;
8576
8579
  }
8577
- if (P.dcCompressedSize > 0) {
8580
+ if (L.dcCompressedSize > 0) {
8578
8581
  const K = {
8579
8582
  array: l.array,
8580
8583
  offset: g,
8581
- size: P.dcCompressedSize
8584
+ size: L.dcCompressedSize
8582
8585
  };
8583
- Z = new Uint16Array(Js(K).buffer), g.value += P.dcCompressedSize;
8586
+ Z = new Uint16Array(Js(K).buffer), g.value += L.dcCompressedSize;
8584
8587
  }
8585
- if (P.rleRawSize > 0) {
8586
- const K = l.array.slice(g.value, g.value + P.rleCompressedSize), $ = zn(K);
8587
- G = Qs($.buffer), g.value += P.rleCompressedSize;
8588
+ if (L.rleRawSize > 0) {
8589
+ const K = l.array.slice(g.value, g.value + L.rleCompressedSize), $ = zn(K);
8590
+ G = Qs($.buffer), g.value += L.rleCompressedSize;
8588
8591
  }
8589
8592
  let X = 0;
8590
8593
  const J = new Array(k.length);
@@ -8624,10 +8627,10 @@ class hu extends Co {
8624
8627
  let R = 0;
8625
8628
  for (; g[m.value + R] != 0; )
8626
8629
  R += 1;
8627
- const P = new TextDecoder().decode(
8630
+ const L = new TextDecoder().decode(
8628
8631
  g.slice(m.value, m.value + R)
8629
8632
  );
8630
- return m.value = m.value + R + 1, P;
8633
+ return m.value = m.value + R + 1, L;
8631
8634
  }
8632
8635
  function Ea(l, m, g) {
8633
8636
  const R = new TextDecoder().decode(
@@ -8682,13 +8685,13 @@ class hu extends Co {
8682
8685
  return Q(vn(l, m));
8683
8686
  }
8684
8687
  function xa(l, m, g, R) {
8685
- const P = g.value, z = [];
8686
- for (; g.value < P + R - 1; ) {
8687
- const A = rs(m, g), H = et(l, g), k = Ft(l, g);
8688
+ const L = g.value, z = [];
8689
+ for (; g.value < L + R - 1; ) {
8690
+ const v = rs(m, g), H = et(l, g), k = Ft(l, g);
8688
8691
  g.value += 3;
8689
8692
  const U = et(l, g), j = et(l, g);
8690
8693
  z.push({
8691
- name: A,
8694
+ name: v,
8692
8695
  pixelType: H,
8693
8696
  pLinear: k,
8694
8697
  xSampling: U,
@@ -8698,8 +8701,8 @@ class hu extends Co {
8698
8701
  return g.value += 1, z;
8699
8702
  }
8700
8703
  function Aa(l, m) {
8701
- const g = Ze(l, m), R = Ze(l, m), P = Ze(l, m), z = Ze(l, m), A = Ze(l, m), H = Ze(l, m), k = Ze(l, m), U = Ze(l, m);
8702
- return { redX: g, redY: R, greenX: P, greenY: z, blueX: A, blueY: H, whiteX: k, whiteY: U };
8704
+ const g = Ze(l, m), R = Ze(l, m), L = Ze(l, m), z = Ze(l, m), v = Ze(l, m), H = Ze(l, m), k = Ze(l, m), U = Ze(l, m);
8705
+ return { redX: g, redY: R, greenX: L, greenY: z, blueX: v, blueY: H, whiteX: k, whiteY: U };
8703
8706
  }
8704
8707
  function va(l, m) {
8705
8708
  const g = [
@@ -8717,8 +8720,8 @@ class hu extends Co {
8717
8720
  return g[R];
8718
8721
  }
8719
8722
  function Ra(l, m) {
8720
- const g = et(l, m), R = et(l, m), P = et(l, m), z = et(l, m);
8721
- return { xMin: g, yMin: R, xMax: P, yMax: z };
8723
+ const g = et(l, m), R = et(l, m), L = et(l, m), z = et(l, m);
8724
+ return { xMin: g, yMin: R, xMax: L, yMax: z };
8722
8725
  }
8723
8726
  function Ma(l, m) {
8724
8727
  const g = [
@@ -8743,12 +8746,12 @@ class hu extends Co {
8743
8746
  ], R = [
8744
8747
  "ROUND_DOWN",
8745
8748
  "ROUND_UP"
8746
- ], P = st(l, m), z = st(l, m), A = Ft(l, m);
8749
+ ], L = st(l, m), z = st(l, m), v = Ft(l, m);
8747
8750
  return {
8748
- xSize: P,
8751
+ xSize: L,
8749
8752
  ySize: z,
8750
- levelMode: g[A & 15],
8751
- roundingMode: R[A >> 4]
8753
+ levelMode: g[v & 15],
8754
+ roundingMode: R[v >> 4]
8752
8755
  };
8753
8756
  }
8754
8757
  function Pa(l, m) {
@@ -8756,14 +8759,14 @@ class hu extends Co {
8756
8759
  return [g, R];
8757
8760
  }
8758
8761
  function La(l, m) {
8759
- const g = Ze(l, m), R = Ze(l, m), P = Ze(l, m);
8760
- return [g, R, P];
8762
+ const g = Ze(l, m), R = Ze(l, m), L = Ze(l, m);
8763
+ return [g, R, L];
8761
8764
  }
8762
- function Oa(l, m, g, R, P) {
8765
+ function Oa(l, m, g, R, L) {
8763
8766
  if (R === "string" || R === "stringvector" || R === "iccProfile")
8764
- return Ea(m, g, P);
8767
+ return Ea(m, g, L);
8765
8768
  if (R === "chlist")
8766
- return xa(l, m, g, P);
8769
+ return xa(l, m, g, L);
8767
8770
  if (R === "chromaticities")
8768
8771
  return Aa(l, g);
8769
8772
  if (R === "compression")
@@ -8789,8 +8792,8 @@ class hu extends Co {
8789
8792
  if (R === "timecode")
8790
8793
  return _a(l, g);
8791
8794
  if (R === "preview" || R === "deepImageState" || R === "idmanifest")
8792
- return g.value += P, "skipped";
8793
- g.value += P;
8795
+ return g.value += L, "skipped";
8796
+ g.value += L;
8794
8797
  }
8795
8798
  function Da(l, m) {
8796
8799
  const g = Math.log2(l);
@@ -8811,23 +8814,23 @@ class hu extends Co {
8811
8814
  return R;
8812
8815
  }
8813
8816
  function Tr(l, m, g, R) {
8814
- const P = new Array(l);
8817
+ const L = new Array(l);
8815
8818
  for (let z = 0; z < l; z++) {
8816
- const A = 1 << z;
8817
- let H = m / A | 0;
8818
- R == "ROUND_UP" && H * A < m && (H += 1);
8819
+ const v = 1 << z;
8820
+ let H = m / v | 0;
8821
+ R == "ROUND_UP" && H * v < m && (H += 1);
8819
8822
  const k = Math.max(H, 1);
8820
- P[z] = (k + g - 1) / g | 0;
8823
+ L[z] = (k + g - 1) / g | 0;
8821
8824
  }
8822
- return P;
8825
+ return L;
8823
8826
  }
8824
8827
  function ka() {
8825
8828
  const l = this, m = l.offset, g = { value: 0 };
8826
8829
  for (let R = 0; R < l.tileCount; R++) {
8827
- const P = et(l.viewer, m), z = et(l.viewer, m);
8830
+ const L = et(l.viewer, m), z = et(l.viewer, m);
8828
8831
  m.value += 8, l.size = st(l.viewer, m);
8829
- const A = P * l.blockWidth, H = z * l.blockHeight;
8830
- l.columns = A + l.blockWidth > l.width ? l.width - A : l.blockWidth, l.lines = H + l.blockHeight > l.height ? l.height - H : l.blockHeight;
8832
+ const v = L * l.blockWidth, H = z * l.blockHeight;
8833
+ l.columns = v + l.blockWidth > l.width ? l.width - v : l.blockWidth, l.lines = H + l.blockHeight > l.height ? l.height - H : l.blockHeight;
8831
8834
  const k = l.columns * l.totalBytes, j = l.size < l.lines * k ? l.uncompress(l) : is(l);
8832
8835
  m.value += l.size;
8833
8836
  for (let Z = 0; Z < l.lines; Z++) {
@@ -8838,7 +8841,7 @@ class hu extends Co {
8838
8841
  g.value = G + K;
8839
8842
  const ie = (l.height - (1 + H + Z)) * l.outLineWidth;
8840
8843
  for (let le = 0; le < l.columns; le++) {
8841
- const oe = ie + (le + A) * l.outputChannels + $;
8844
+ const oe = ie + (le + v) * l.outputChannels + $;
8842
8845
  l.byteArray[oe] = l.getter(j, g);
8843
8846
  }
8844
8847
  }
@@ -8848,12 +8851,12 @@ class hu extends Co {
8848
8851
  function Fa() {
8849
8852
  const l = this, m = l.offset, g = { value: 0 };
8850
8853
  for (let R = 0; R < l.height / l.blockHeight; R++) {
8851
- const P = et(l.viewer, m) - We.dataWindow.yMin;
8852
- l.size = st(l.viewer, m), l.lines = P + l.blockHeight > l.height ? l.height - P : l.blockHeight;
8854
+ const L = et(l.viewer, m) - We.dataWindow.yMin;
8855
+ l.size = st(l.viewer, m), l.lines = L + l.blockHeight > l.height ? l.height - L : l.blockHeight;
8853
8856
  const z = l.columns * l.totalBytes, H = l.size < l.lines * z ? l.uncompress(l) : is(l);
8854
8857
  m.value += l.size;
8855
8858
  for (let k = 0; k < l.lines; k++) {
8856
- const U = P + k, j = k * z, Z = (l.height - 1 - U) * l.outLineWidth;
8859
+ const U = L + k, j = k * z, Z = (l.height - 1 - U) * l.outLineWidth;
8857
8860
  for (let G = 0; G < l.inputChannels.length; G++) {
8858
8861
  const X = We.channels[G].name, J = l.channelByteOffsets[X] * l.columns, K = l.decodeChannels[X];
8859
8862
  if (K !== void 0) {
@@ -8870,16 +8873,16 @@ class hu extends Co {
8870
8873
  function za() {
8871
8874
  const l = this, m = l.chunkOffsets, g = { value: 0 };
8872
8875
  for (let R = 0; R < m.length; R++) {
8873
- const P = { value: m[R] };
8874
- P.value += 4;
8875
- const z = et(l.viewer, P) - We.dataWindow.yMin;
8876
- l.size = st(l.viewer, P), l.lines = z + l.blockHeight > l.height ? l.height - z : l.blockHeight;
8877
- const A = l.columns * l.totalBytes, H = l.size < l.lines * A, k = l.offset;
8878
- l.offset = P;
8876
+ const L = { value: m[R] };
8877
+ L.value += 4;
8878
+ const z = et(l.viewer, L) - We.dataWindow.yMin;
8879
+ l.size = st(l.viewer, L), l.lines = z + l.blockHeight > l.height ? l.height - z : l.blockHeight;
8880
+ const v = l.columns * l.totalBytes, H = l.size < l.lines * v, k = l.offset;
8881
+ l.offset = L;
8879
8882
  const U = H ? l.uncompress(l) : is(l);
8880
8883
  l.offset = k;
8881
8884
  for (let j = 0; j < l.lines; j++) {
8882
- const Z = z + j, G = j * A, X = (l.height - 1 - Z) * l.outLineWidth;
8885
+ const Z = z + j, G = j * v, X = (l.height - 1 - Z) * l.outLineWidth;
8883
8886
  for (let J = 0; J < l.inputChannels.length; J++) {
8884
8887
  const K = We.channels[J].name, $ = l.channelByteOffsets[K] * l.columns, ie = l.decodeChannels[K];
8885
8888
  if (ie !== void 0) {
@@ -8895,33 +8898,33 @@ class hu extends Co {
8895
8898
  }
8896
8899
  function _r(l, m, g, R) {
8897
8900
  if (g === 0) return null;
8898
- const P = l.slice(m, m + g);
8901
+ const L = l.slice(m, m + g);
8899
8902
  switch (R) {
8900
8903
  case "NO_COMPRESSION":
8901
- return new DataView(P.buffer, P.byteOffset, P.byteLength);
8904
+ return new DataView(L.buffer, L.byteOffset, L.byteLength);
8902
8905
  case "RLE_COMPRESSION": {
8903
- const z = new Uint8Array(Qs(P.buffer.slice(P.byteOffset, P.byteOffset + P.byteLength))), A = new Uint8Array(z.length);
8904
- return ns(z), ss(z, A), new DataView(A.buffer);
8906
+ const z = new Uint8Array(Qs(L.buffer.slice(L.byteOffset, L.byteOffset + L.byteLength))), v = new Uint8Array(z.length);
8907
+ return ns(z), ss(z, v), new DataView(v.buffer);
8905
8908
  }
8906
8909
  case "ZIPS_COMPRESSION": {
8907
- const z = zn(P), A = new Uint8Array(z.length);
8908
- return ns(z), ss(z, A), new DataView(A.buffer);
8910
+ const z = zn(L), v = new Uint8Array(z.length);
8911
+ return ns(z), ss(z, v), new DataView(v.buffer);
8909
8912
  }
8910
8913
  default:
8911
8914
  throw new Error("THREE.EXRLoader: " + R + " is unsupported for deep data");
8912
8915
  }
8913
8916
  }
8914
8917
  function Ba() {
8915
- const l = this, m = l.chunkOffsets, g = l.width, R = l.height, P = l.deepChannels, z = We.compression, A = l.multiPart, H = l.decodeChannels, k = l.outputChannels, U = l.byteArray instanceof Uint16Array;
8918
+ const l = this, m = l.chunkOffsets, g = l.width, R = l.height, L = l.deepChannels, z = We.compression, v = l.multiPart, H = l.decodeChannels, k = l.outputChannels, U = l.byteArray instanceof Uint16Array;
8916
8919
  let j = -1;
8917
- for (let Z = 0; Z < P.length; Z++)
8918
- if (P[Z].name === "A") {
8920
+ for (let Z = 0; Z < L.length; Z++)
8921
+ if (L[Z].name === "A") {
8919
8922
  j = Z;
8920
8923
  break;
8921
8924
  }
8922
8925
  for (let Z = 0; Z < m.length; Z++) {
8923
8926
  const G = { value: m[Z] };
8924
- A && (G.value += 4);
8927
+ v && (G.value += 4);
8925
8928
  const X = et(l.viewer, G) - We.dataWindow.yMin, J = ke(l.viewer, G), K = ke(l.viewer, G);
8926
8929
  ke(l.viewer, G);
8927
8930
  const $ = _r(l.array, G.value, J, z);
@@ -8936,8 +8939,8 @@ class hu extends Co {
8936
8939
  }
8937
8940
  const oe = _r(l.array, G.value, K, z), ue = [];
8938
8941
  let ne = 0;
8939
- for (let se = 0; se < P.length; se++)
8940
- ue.push(ne), ne += le * P[se].bytesPerSample;
8942
+ for (let se = 0; se < L.length; se++)
8943
+ ue.push(ne), ne += le * L[se].bytesPerSample;
8941
8944
  const ee = (R - 1 - X) * l.outLineWidth;
8942
8945
  for (let se = 0; se < g; se++) {
8943
8946
  const ye = se === 0 ? 0 : ie[se - 1], ae = ie[se] - ye;
@@ -8949,11 +8952,11 @@ class hu extends Co {
8949
8952
  if (on <= 0) break;
8950
8953
  let Rn = 1;
8951
8954
  if (j >= 0) {
8952
- const xt = P[j].bytesPerSample, Xt = ue[j] + bt * xt;
8955
+ const xt = L[j].bytesPerSample, Xt = ue[j] + bt * xt;
8953
8956
  Rn = xt === 2 ? Q(oe.getUint16(Xt, !0)) : oe.getFloat32(Xt, !0);
8954
8957
  }
8955
- for (let xt = 0; xt < P.length; xt++) {
8956
- const Xt = P[xt], ls = H[Xt.name];
8958
+ for (let xt = 0; xt < L.length; xt++) {
8959
+ const Xt = L[xt], ls = H[Xt.name];
8957
8960
  if (ls === void 0) continue;
8958
8961
  const hs = Xt.bytesPerSample, us = ue[xt] + bt * hs, Mn = hs === 2 ? Q(oe.getUint16(us, !0)) : oe.getFloat32(us, !0);
8959
8962
  he[ls] += Mn * on;
@@ -8969,43 +8972,43 @@ class hu extends Co {
8969
8972
  }
8970
8973
  function Sr(l, m, g) {
8971
8974
  const R = {};
8972
- let P = !1;
8975
+ let L = !1;
8973
8976
  for (; ; ) {
8974
8977
  const z = rs(m, g);
8975
8978
  if (z === "") break;
8976
- P = !0;
8977
- const A = rs(m, g), H = st(l, g), k = Oa(l, m, g, A, H);
8978
- k === void 0 ? console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${A}'.`) : R[z] = k;
8979
+ L = !0;
8980
+ const v = rs(m, g), H = st(l, g), k = Oa(l, m, g, v, H);
8981
+ k === void 0 ? console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${v}'.`) : R[z] = k;
8979
8982
  }
8980
- return P ? R : null;
8983
+ return L ? R : null;
8981
8984
  }
8982
8985
  function Ua(l, m, g) {
8983
8986
  if (l.getUint32(0, !0) != 20000630)
8984
8987
  throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");
8985
- const R = l.getUint8(4), P = l.getUint8(5), z = {
8986
- singleTile: !!(P & 2),
8987
- longName: !!(P & 4),
8988
- deepFormat: !!(P & 8),
8989
- multiPart: !!(P & 16)
8988
+ const R = l.getUint8(4), L = l.getUint8(5), z = {
8989
+ singleTile: !!(L & 2),
8990
+ longName: !!(L & 4),
8991
+ deepFormat: !!(L & 8),
8992
+ multiPart: !!(L & 16)
8990
8993
  };
8991
8994
  g.value = 8;
8992
- const A = [];
8995
+ const v = [];
8993
8996
  if (z.multiPart) {
8994
8997
  for (; ; ) {
8995
8998
  const H = Sr(l, m, g);
8996
8999
  if (H === null) break;
8997
- H.version = R, H.spec = z, A.push(H);
9000
+ H.version = R, H.spec = z, v.push(H);
8998
9001
  }
8999
- if (A.length === 0)
9002
+ if (v.length === 0)
9000
9003
  throw new Error("THREE.EXRLoader: No valid part headers found.");
9001
9004
  } else {
9002
9005
  const H = Sr(l, m, g);
9003
- H.version = R, H.spec = z, A.push(H);
9006
+ H.version = R, H.spec = z, v.push(H);
9004
9007
  }
9005
- return A;
9008
+ return v;
9006
9009
  }
9007
- function Ha(l, m, g, R, P, z) {
9008
- const A = {
9010
+ function Ha(l, m, g, R, L, z) {
9011
+ const v = {
9009
9012
  size: 0,
9010
9013
  viewer: m,
9011
9014
  array: g,
@@ -9027,32 +9030,32 @@ class hu extends Co {
9027
9030
  };
9028
9031
  switch (l.compression) {
9029
9032
  case "NO_COMPRESSION":
9030
- A.blockHeight = 1, A.uncompress = is;
9033
+ v.blockHeight = 1, v.uncompress = is;
9031
9034
  break;
9032
9035
  case "RLE_COMPRESSION":
9033
- A.blockHeight = 1, A.uncompress = ma;
9036
+ v.blockHeight = 1, v.uncompress = ma;
9034
9037
  break;
9035
9038
  case "ZIPS_COMPRESSION":
9036
- A.blockHeight = 1, A.uncompress = Js;
9039
+ v.blockHeight = 1, v.uncompress = Js;
9037
9040
  break;
9038
9041
  case "ZIP_COMPRESSION":
9039
- A.blockHeight = 16, A.uncompress = Js;
9042
+ v.blockHeight = 16, v.uncompress = Js;
9040
9043
  break;
9041
9044
  case "PIZ_COMPRESSION":
9042
- A.blockHeight = 32, A.uncompress = ga;
9045
+ v.blockHeight = 32, v.uncompress = ga;
9043
9046
  break;
9044
9047
  case "PXR24_COMPRESSION":
9045
- A.blockHeight = 16, A.uncompress = ya;
9048
+ v.blockHeight = 16, v.uncompress = ya;
9046
9049
  break;
9047
9050
  case "B44_COMPRESSION":
9048
9051
  case "B44A_COMPRESSION":
9049
- A.blockHeight = 32, A.uncompress = wa;
9052
+ v.blockHeight = 32, v.uncompress = wa;
9050
9053
  break;
9051
9054
  case "DWAA_COMPRESSION":
9052
- A.blockHeight = 32, A.uncompress = wr;
9055
+ v.blockHeight = 32, v.uncompress = wr;
9053
9056
  break;
9054
9057
  case "DWAB_COMPRESSION":
9055
- A.blockHeight = 256, A.uncompress = wr;
9058
+ v.blockHeight = 256, v.uncompress = wr;
9056
9059
  break;
9057
9060
  default:
9058
9061
  throw new Error("THREE.EXRLoader: " + l.compression + " is unsupported");
@@ -9067,94 +9070,94 @@ class hu extends Co {
9067
9070
  case "G":
9068
9071
  case "B":
9069
9072
  case "A":
9070
- H[G.name] = !0, A.type = G.pixelType;
9073
+ H[G.name] = !0, v.type = G.pixelType;
9071
9074
  }
9072
9075
  let k = !1, U = !1;
9073
9076
  if (H.Y && H.RY && H.BY)
9074
- A.outputChannels = 4, A.yCbCr = !0;
9077
+ v.outputChannels = 4, v.yCbCr = !0;
9075
9078
  else if (H.R && H.G && H.B)
9076
- A.outputChannels = 4;
9079
+ v.outputChannels = 4;
9077
9080
  else if (H.Y)
9078
- A.outputChannels = 1;
9081
+ v.outputChannels = 1;
9079
9082
  else
9080
9083
  throw new Error("THREE.EXRLoader: file contains unsupported data channels.");
9081
- switch (A.outputChannels) {
9084
+ switch (v.outputChannels) {
9082
9085
  case 4:
9083
- z == Yt ? (k = !H.A, A.format = Yt, A.colorSpace = je, A.outputChannels = 4, A.decodeChannels = { R: 0, G: 1, B: 2, A: 3 }) : z == In ? (A.format = In, A.colorSpace = je, A.outputChannels = 2, A.decodeChannels = { R: 0, G: 1 }) : z == ds ? (A.format = ds, A.colorSpace = je, A.outputChannels = 1, A.decodeChannels = { R: 0 }) : U = !0;
9086
+ z == Yt ? (k = !H.A, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.decodeChannels = { R: 0, G: 1, B: 2, A: 3 }) : z == In ? (v.format = In, v.colorSpace = je, v.outputChannels = 2, v.decodeChannels = { R: 0, G: 1 }) : z == ds ? (v.format = ds, v.colorSpace = je, v.outputChannels = 1, v.decodeChannels = { R: 0 }) : U = !0;
9084
9087
  break;
9085
9088
  case 1:
9086
- z == Yt ? (k = !0, A.format = Yt, A.colorSpace = je, A.outputChannels = 4, A.shouldExpand = !0, A.decodeChannels = { Y: 0 }) : z == In ? (A.format = In, A.colorSpace = je, A.outputChannels = 2, A.shouldExpand = !0, A.decodeChannels = { Y: 0 }) : z == ds ? (A.format = ds, A.colorSpace = je, A.outputChannels = 1, A.decodeChannels = { Y: 0 }) : U = !0;
9089
+ z == Yt ? (k = !0, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z == In ? (v.format = In, v.colorSpace = je, v.outputChannels = 2, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z == ds ? (v.format = ds, v.colorSpace = je, v.outputChannels = 1, v.decodeChannels = { Y: 0 }) : U = !0;
9087
9090
  break;
9088
9091
  default:
9089
9092
  U = !0;
9090
9093
  }
9091
9094
  if (U) throw new Error("THREE.EXRLoader: invalid output format for specified file.");
9092
- if (A.yCbCr && (A.format = Yt, A.outputChannels = 4, A.decodeChannels = { Y: 0, RY: 1, BY: 2 }, k = !0), A.type == 1)
9093
- switch (P) {
9095
+ if (v.yCbCr && (v.format = Yt, v.outputChannels = 4, v.decodeChannels = { Y: 0, RY: 1, BY: 2 }, k = !0), v.type == 1)
9096
+ switch (L) {
9094
9097
  case Vn:
9095
- A.getter = ba;
9098
+ v.getter = ba;
9096
9099
  break;
9097
9100
  case Gt:
9098
- A.getter = vn;
9101
+ v.getter = vn;
9099
9102
  break;
9100
9103
  }
9101
- else if (A.type == 2)
9102
- switch (P) {
9104
+ else if (v.type == 2)
9105
+ switch (L) {
9103
9106
  case Vn:
9104
- A.getter = Ze;
9107
+ v.getter = Ze;
9105
9108
  break;
9106
9109
  case Gt:
9107
- A.getter = Sa;
9110
+ v.getter = Sa;
9108
9111
  }
9109
9112
  else
9110
- throw new Error("THREE.EXRLoader: unsupported pixelType " + A.type + " for " + l.compression + ".");
9111
- A.columns = A.width;
9112
- const j = A.width * A.height * A.outputChannels;
9113
- switch (P) {
9113
+ throw new Error("THREE.EXRLoader: unsupported pixelType " + v.type + " for " + l.compression + ".");
9114
+ v.columns = v.width;
9115
+ const j = v.width * v.height * v.outputChannels;
9116
+ switch (L) {
9114
9117
  case Vn:
9115
- A.byteArray = new Float32Array(j), k && A.byteArray.fill(1, 0, j);
9118
+ v.byteArray = new Float32Array(j), k && v.byteArray.fill(1, 0, j);
9116
9119
  break;
9117
9120
  case Gt:
9118
- A.byteArray = new Uint16Array(j), k && A.byteArray.fill(15360, 0, j);
9121
+ v.byteArray = new Uint16Array(j), k && v.byteArray.fill(15360, 0, j);
9119
9122
  break;
9120
9123
  default:
9121
- console.error("THREE.EXRLoader: unsupported type: ", P);
9124
+ console.error("THREE.EXRLoader: unsupported type: ", L);
9122
9125
  break;
9123
9126
  }
9124
9127
  let Z = 0;
9125
9128
  for (const G of l.channels)
9126
- A.decodeChannels[G.name] !== void 0 && (A.channelByteOffsets[G.name] = Z), Z += G.pixelType * 2;
9127
- if (A.totalBytes = Z, A.outLineWidth = A.width * A.outputChannels, l.spec.deepFormat) {
9128
- A.deepChannels = [];
9129
+ v.decodeChannels[G.name] !== void 0 && (v.channelByteOffsets[G.name] = Z), Z += G.pixelType * 2;
9130
+ if (v.totalBytes = Z, v.outLineWidth = v.width * v.outputChannels, l.spec.deepFormat) {
9131
+ v.deepChannels = [];
9129
9132
  let G = 0;
9130
9133
  for (const X of l.channels) {
9131
9134
  const J = X.pixelType === 0 ? 4 : X.pixelType * 2;
9132
- A.deepChannels.push({
9135
+ v.deepChannels.push({
9133
9136
  name: X.name,
9134
9137
  pixelType: X.pixelType,
9135
9138
  bytesPerSample: J
9136
9139
  }), G += J;
9137
9140
  }
9138
- A.deepBytesPerSample = G, A.chunkOffsets = l._chunkOffsets, A.multiPart = l.spec.multiPart, A.decode = Ba.bind(A);
9141
+ v.deepBytesPerSample = G, v.chunkOffsets = l._chunkOffsets, v.multiPart = l.spec.multiPart, v.decode = Ba.bind(v);
9139
9142
  } else if (l.spec.singleTile) {
9140
- A.blockHeight = l.tiles.ySize, A.blockWidth = l.tiles.xSize;
9141
- const G = Na(l.tiles, A.width, A.height), X = Tr(G, A.width, l.tiles.xSize, l.tiles.roundingMode), J = Tr(G, A.height, l.tiles.ySize, l.tiles.roundingMode);
9142
- A.tileCount = X[0] * J[0];
9143
+ v.blockHeight = l.tiles.ySize, v.blockWidth = l.tiles.xSize;
9144
+ const G = Na(l.tiles, v.width, v.height), X = Tr(G, v.width, l.tiles.xSize, l.tiles.roundingMode), J = Tr(G, v.height, l.tiles.ySize, l.tiles.roundingMode);
9145
+ v.tileCount = X[0] * J[0];
9143
9146
  for (let K = 0; K < G; K++)
9144
9147
  for (let $ = 0; $ < J[K]; $++)
9145
9148
  for (let ie = 0; ie < X[K]; ie++)
9146
9149
  ke(m, R);
9147
- A.decode = ka.bind(A);
9150
+ v.decode = ka.bind(v);
9148
9151
  } else if (l.spec.multiPart)
9149
- A.blockWidth = A.width, A.chunkOffsets = l._chunkOffsets, A.decode = za.bind(A);
9152
+ v.blockWidth = v.width, v.chunkOffsets = l._chunkOffsets, v.decode = za.bind(v);
9150
9153
  else {
9151
- A.blockWidth = A.width;
9152
- const G = Math.ceil(A.height / A.blockHeight);
9154
+ v.blockWidth = v.width;
9155
+ const G = Math.ceil(v.height / v.blockHeight);
9153
9156
  for (let X = 0; X < G; X++)
9154
9157
  ke(m, R);
9155
- A.decode = Fa.bind(A);
9158
+ v.decode = Fa.bind(v);
9156
9159
  }
9157
- return A;
9160
+ return v;
9158
9161
  }
9159
9162
  const os = { value: 0 }, as = new DataView(e), ja = new Uint8Array(e), cs = Ua(as, e, os), br = Math.max(0, Math.min(this.part, cs.length - 1)), We = cs[br];
9160
9163
  if (We.spec.multiPart || We.spec.deepFormat)
@@ -9182,13 +9185,13 @@ class hu extends Co {
9182
9185
  const l = rt.byteArray, m = rt.width * rt.height;
9183
9186
  if (this.type === Gt)
9184
9187
  for (let g = 0; g < m; g++) {
9185
- const R = g * 4, P = Q(l[R]), z = Q(l[R + 1]), A = Q(l[R + 2]), H = (1 + z) * P, k = (1 + A) * P, U = (P - H * 0.2126 - k * 0.0722) / 0.7152;
9188
+ const R = g * 4, L = Q(l[R]), z = Q(l[R + 1]), v = Q(l[R + 2]), H = (1 + z) * L, k = (1 + v) * L, U = (L - H * 0.2126 - k * 0.0722) / 0.7152;
9186
9189
  l[R] = wt.toHalfFloat(Math.max(0, H)), l[R + 1] = wt.toHalfFloat(Math.max(0, U)), l[R + 2] = wt.toHalfFloat(Math.max(0, k));
9187
9190
  }
9188
9191
  else
9189
9192
  for (let g = 0; g < m; g++) {
9190
- const R = g * 4, P = l[R], z = l[R + 1], A = l[R + 2], H = (1 + z) * P, k = (1 + A) * P;
9191
- l[R] = Math.max(0, H), l[R + 1] = Math.max(0, (P - H * 0.2126 - k * 0.0722) / 0.7152), l[R + 2] = Math.max(0, k);
9193
+ const R = g * 4, L = l[R], z = l[R + 1], v = l[R + 2], H = (1 + z) * L, k = (1 + v) * L;
9194
+ l[R] = Math.max(0, H), l[R + 1] = Math.max(0, (L - H * 0.2126 - k * 0.0722) / 0.7152), l[R + 2] = Math.max(0, k);
9192
9195
  }
9193
9196
  }
9194
9197
  return {
@@ -9261,7 +9264,7 @@ class uu extends Co {
9261
9264
  case 4:
9262
9265
  throw new Error("THREE.HDRLoader: Memory Error: " + (D || ""));
9263
9266
  }
9264
- }, h = function(M, D, I) {
9267
+ }, h = function(M, D, C) {
9265
9268
  D = D || 1024;
9266
9269
  let O = M.pos, F = -1, V = 0, te = "", re = String.fromCharCode.apply(null, new Uint16Array(M.subarray(O, O + 128)));
9267
9270
  for (; 0 > (F = re.indexOf(`
@@ -9269,7 +9272,7 @@ class uu extends Co {
9269
9272
  te += re, V += re.length, O += 128, re = String.fromCharCode.apply(null, new Uint16Array(M.subarray(O, O + 128)));
9270
9273
  return -1 < F ? (M.pos += V + F + 1, te + re.slice(0, F)) : !1;
9271
9274
  }, f = function(M) {
9272
- const D = /^#\?(\S+)/, I = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/, N = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/, O = /^\s*FORMAT=(\S+)\s*$/, F = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/, V = {
9275
+ const D = /^#\?(\S+)/, C = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/, N = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/, O = /^\s*FORMAT=(\S+)\s*$/, F = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/, V = {
9273
9276
  valid: 0,
9274
9277
  /* indicate which fields are valid */
9275
9278
  string: "",
@@ -9297,10 +9300,10 @@ class uu extends Co {
9297
9300
  `;
9298
9301
  continue;
9299
9302
  }
9300
- if ((re = te.match(I)) && (V.gamma = parseFloat(re[1])), (re = te.match(N)) && (V.exposure = parseFloat(re[1])), (re = te.match(O)) && (V.valid |= 2, V.format = re[1]), (re = te.match(F)) && (V.valid |= 4, V.height = parseInt(re[1], 10), V.width = parseInt(re[2], 10)), V.valid & 2 && V.valid & 4) break;
9303
+ if ((re = te.match(C)) && (V.gamma = parseFloat(re[1])), (re = te.match(N)) && (V.exposure = parseFloat(re[1])), (re = te.match(O)) && (V.valid |= 2, V.format = re[1]), (re = te.match(F)) && (V.valid |= 4, V.height = parseInt(re[1], 10), V.width = parseInt(re[2], 10)), V.valid & 2 && V.valid & 4) break;
9301
9304
  }
9302
9305
  return V.valid & 2 || o(3, "missing format specifier"), V.valid & 4 || o(3, "missing image size specifier"), V;
9303
- }, p = function(M, D, I) {
9306
+ }, p = function(M, D, C) {
9304
9307
  const N = D;
9305
9308
  if (
9306
9309
  // run length encoding is not allowed so read flat
@@ -9309,11 +9312,11 @@ class uu extends Co {
9309
9312
  )
9310
9313
  return new Uint8Array(M);
9311
9314
  N !== (M[2] << 8 | M[3]) && o(3, "wrong scanline width");
9312
- const O = new Uint8Array(4 * D * I);
9315
+ const O = new Uint8Array(4 * D * C);
9313
9316
  O.length || o(4, "unable to allocate buffer space");
9314
9317
  let F = 0, V = 0;
9315
9318
  const te = 4 * N, re = new Uint8Array(4), Ne = new Uint8Array(te);
9316
- let ut = I;
9319
+ let ut = C;
9317
9320
  for (; ut > 0 && V < M.byteLength; ) {
9318
9321
  V + 4 > M.byteLength && o(1), re[0] = M[V++], re[1] = M[V++], re[2] = M[V++], re[3] = M[V++], (re[0] != 2 || re[1] != 2 || (re[2] << 8 | re[3]) != N) && o(3, "bad rgbe scanline format");
9319
9322
  let Re = 0, Ue;
@@ -9335,30 +9338,30 @@ class uu extends Co {
9335
9338
  ut--;
9336
9339
  }
9337
9340
  return O;
9338
- }, w = function(M, D, I, N) {
9341
+ }, y = function(M, D, C, N) {
9339
9342
  const O = M[D + 3], F = Math.pow(2, O - 128) / 255;
9340
- I[N + 0] = M[D + 0] * F, I[N + 1] = M[D + 1] * F, I[N + 2] = M[D + 2] * F, I[N + 3] = 1;
9341
- }, _ = function(M, D, I, N) {
9343
+ C[N + 0] = M[D + 0] * F, C[N + 1] = M[D + 1] * F, C[N + 2] = M[D + 2] * F, C[N + 3] = 1;
9344
+ }, S = function(M, D, C, N) {
9342
9345
  const O = M[D + 3], F = Math.pow(2, O - 128) / 255;
9343
- I[N + 0] = wt.toHalfFloat(Math.min(M[D + 0] * F, 65504)), I[N + 1] = wt.toHalfFloat(Math.min(M[D + 1] * F, 65504)), I[N + 2] = wt.toHalfFloat(Math.min(M[D + 2] * F, 65504)), I[N + 3] = wt.toHalfFloat(1);
9344
- }, y = new Uint8Array(e);
9345
- y.pos = 0;
9346
- const S = f(y), E = S.width, b = S.height, x = p(y.subarray(y.pos), E, b);
9347
- let v, L, C;
9346
+ C[N + 0] = wt.toHalfFloat(Math.min(M[D + 0] * F, 65504)), C[N + 1] = wt.toHalfFloat(Math.min(M[D + 1] * F, 65504)), C[N + 2] = wt.toHalfFloat(Math.min(M[D + 2] * F, 65504)), C[N + 3] = wt.toHalfFloat(1);
9347
+ }, w = new Uint8Array(e);
9348
+ w.pos = 0;
9349
+ const x = f(w), E = x.width, b = x.height, _ = p(w.subarray(w.pos), E, b);
9350
+ let A, P, I;
9348
9351
  switch (this.type) {
9349
9352
  case Vn:
9350
- C = x.length / 4;
9351
- const M = new Float32Array(C * 4);
9352
- for (let I = 0; I < C; I++)
9353
- w(x, I * 4, M, I * 4);
9354
- v = M, L = Vn;
9353
+ I = _.length / 4;
9354
+ const M = new Float32Array(I * 4);
9355
+ for (let C = 0; C < I; C++)
9356
+ y(_, C * 4, M, C * 4);
9357
+ A = M, P = Vn;
9355
9358
  break;
9356
9359
  case Gt:
9357
- C = x.length / 4;
9358
- const D = new Uint16Array(C * 4);
9359
- for (let I = 0; I < C; I++)
9360
- _(x, I * 4, D, I * 4);
9361
- v = D, L = Gt;
9360
+ I = _.length / 4;
9361
+ const D = new Uint16Array(I * 4);
9362
+ for (let C = 0; C < I; C++)
9363
+ S(_, C * 4, D, C * 4);
9364
+ A = D, P = Gt;
9362
9365
  break;
9363
9366
  default:
9364
9367
  throw new Error("THREE.HDRLoader: Unsupported type: " + this.type);
@@ -9366,11 +9369,11 @@ class uu extends Co {
9366
9369
  return {
9367
9370
  width: E,
9368
9371
  height: b,
9369
- data: v,
9370
- header: S.string,
9371
- gamma: S.gamma,
9372
- exposure: S.exposure,
9373
- type: L,
9372
+ data: A,
9373
+ header: x.string,
9374
+ gamma: x.gamma,
9375
+ exposure: x.exposure,
9376
+ type: P,
9374
9377
  colorSpace: je,
9375
9378
  minFilter: nn,
9376
9379
  magFilter: nn,
@@ -9872,7 +9875,7 @@ class xu {
9872
9875
  * Create a ViewerCore instance with Three.js implementations
9873
9876
  */
9874
9877
  static createViewer(e, t) {
9875
- var E, b, x;
9878
+ var E, b, _;
9876
9879
  Po(t.units);
9877
9880
  const n = new Ul(e), s = new Lt(), r = this.createCamera(t), o = this.createControls(
9878
9881
  r.getThreeCamera(),
@@ -9885,27 +9888,27 @@ class xu {
9885
9888
  }), c = new Kh(), d = new pu();
9886
9889
  let u;
9887
9890
  (((b = t.pathTracing) == null ? void 0 : b.enabled) ?? !1) && (u = new Xh());
9888
- const f = new gu(), p = new yu(), w = new Tu(), _ = new _u(), y = bu.convertRendererOptions(
9891
+ const f = new gu(), p = new yu(), y = new Tu(), S = new _u(), w = bu.convertRendererOptions(
9889
9892
  t.renderer || {}
9890
9893
  );
9891
- (t.replaceWithScreenshotOnComplete || (x = t.pathTracing) != null && x.enabled) && (y.preserveDrawingBuffer = !0);
9892
- const S = {
9894
+ (t.replaceWithScreenshotOnComplete || (_ = t.pathTracing) != null && _.enabled) && (w.preserveDrawingBuffer = !0);
9895
+ const x = {
9893
9896
  renderer: n,
9894
9897
  scene: s,
9895
9898
  camera: r,
9896
9899
  controls: o,
9897
9900
  modelLoader: a,
9898
9901
  options: t,
9899
- rendererOptions: y,
9902
+ rendererOptions: w,
9900
9903
  sceneSetupService: c,
9901
9904
  environmentService: d,
9902
9905
  pathTracingService: u,
9903
9906
  floorAlignmentService: f,
9904
9907
  selectionService: p,
9905
- anchorProjectionService: w,
9906
- animationService: _
9908
+ anchorProjectionService: y,
9909
+ animationService: S
9907
9910
  };
9908
- return new Nc(S);
9911
+ return new Nc(x);
9909
9912
  }
9910
9913
  static createCamera(e) {
9911
9914
  const n = e.camera || {}, s = n.fov || n.cameraFov || 75, r = n.near || n.cameraNear || 0.1, o = n.far || n.cameraFar || 1e5, a = n.position || n.cameraPosition, c = n.target || n.cameraTarget, d = lr.create(
@@ -10231,16 +10234,16 @@ function Pu(i, e) {
10231
10234
  let d = null;
10232
10235
  const u = (p) => {
10233
10236
  if (i.current && t.current) {
10234
- const w = i.current.parentElement || i.current;
10235
- let { clientWidth: _, clientHeight: y } = w;
10237
+ const y = i.current.parentElement || i.current;
10238
+ let { clientWidth: S, clientHeight: w } = y;
10236
10239
  if (p && p[0]) {
10237
- const { width: S, height: E } = p[0].contentRect;
10238
- _ = Math.floor(S), y = Math.floor(E);
10240
+ const { width: x, height: E } = p[0].contentRect;
10241
+ S = Math.floor(x), w = Math.floor(E);
10239
10242
  }
10240
- if (c.current.width === _ && c.current.height === y)
10243
+ if (c.current.width === S && c.current.height === w)
10241
10244
  return;
10242
10245
  d !== null && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
10243
- t.current && i.current && (t.current.resize(_, y), c.current = { width: _, height: y });
10246
+ t.current && i.current && (t.current.resize(S, w), c.current = { width: S, height: w });
10244
10247
  });
10245
10248
  }
10246
10249
  };
@@ -11202,8 +11205,8 @@ class ld {
11202
11205
  createAxis(e) {
11203
11206
  const { color: t, direction: n, length: s, origin: r, lineWidth: o, label: a } = e, c = new T.Group(), d = o / 2, u = new T.CylinderGeometry(d, d, s, 32), h = new T.MeshBasicMaterial({ color: t }), f = new T.Mesh(u, h);
11204
11207
  if (f.position.copy(r).add(n.clone().multiplyScalar(s / 2)), !n.equals(new T.Vector3(0, 1, 0))) {
11205
- const w = new T.Vector3(0, 1, 0).cross(n).normalize(), _ = Math.acos(new T.Vector3(0, 1, 0).dot(n));
11206
- f.setRotationFromAxisAngle(w, _);
11208
+ const y = new T.Vector3(0, 1, 0).cross(n).normalize(), S = Math.acos(new T.Vector3(0, 1, 0).dot(n));
11209
+ f.setRotationFromAxisAngle(y, S);
11207
11210
  }
11208
11211
  c.add(f);
11209
11212
  const p = cd(a, t);
@@ -11464,30 +11467,30 @@ function Td({
11464
11467
  gizmoControlRef: s
11465
11468
  }) {
11466
11469
  const r = $e(null), o = $e(null), a = $e(new T.Raycaster()).current, c = $e(new T.Vector2()).current, d = Rt(() => {
11467
- const _ = e.getObjectByName(qn), y = yd(t);
11468
- if (_ && y) {
11469
- e.remove(_);
11470
+ const S = e.getObjectByName(qn), w = yd(t);
11471
+ if (S && w) {
11472
+ e.remove(S);
11470
11473
  return;
11471
11474
  }
11472
- if (_ || y) return;
11473
- const S = new gd().create();
11474
- S.rotation.copy(t.rotation), e.add(S);
11475
+ if (S || w) return;
11476
+ const x = new gd().create();
11477
+ x.rotation.copy(t.rotation), e.add(x);
11475
11478
  }, [e, t]), u = Rt(() => {
11476
- const _ = e.getObjectByName(qn);
11477
- _ && e.remove(_);
11479
+ const S = e.getObjectByName(qn);
11480
+ S && e.remove(S);
11478
11481
  }, [e]), h = Rt(
11479
- ud((_) => {
11482
+ ud((S) => {
11480
11483
  if (!s.current || !i) return;
11481
- go(_, i, c);
11482
- const y = ca(
11484
+ go(S, i, c);
11485
+ const w = ca(
11483
11486
  c,
11484
11487
  t,
11485
11488
  e,
11486
11489
  a
11487
- ), S = la(y);
11488
- S != null && S.userData.gizmoCube ? S.userData.gizmoCube.highlightObject(S) : e.traverse((E) => {
11490
+ ), x = la(w);
11491
+ x != null && x.userData.gizmoCube ? x.userData.gizmoCube.highlightObject(x) : e.traverse((E) => {
11489
11492
  E.userData.gizmoCube && E.userData.gizmoCube.highlightObject(null);
11490
- }), y.length > 0 ? d() : u();
11493
+ }), w.length > 0 ? d() : u();
11491
11494
  }, 1e3 / wd),
11492
11495
  [
11493
11496
  s,
@@ -11499,26 +11502,26 @@ function Td({
11499
11502
  d,
11500
11503
  u
11501
11504
  ]
11502
- ), f = Rt((_) => {
11503
- r.current = Date.now(), o.current = { x: _.clientX, y: _.clientY };
11505
+ ), f = Rt((S) => {
11506
+ r.current = Date.now(), o.current = { x: S.clientX, y: S.clientY };
11504
11507
  }, []), p = Rt(
11505
- (_) => {
11506
- var y;
11507
- const S = _.name === Ks ? 1 : -1, E = 90 * Math.PI / 180, b = new T.Vector3(0, 0, 0), x = S * E, v = new T.Matrix4();
11508
- v.makeRotationZ(x), t.up.applyMatrix4(v), t.lookAt(b), (y = s.current) == null || y.gizmoControls.update();
11508
+ (S) => {
11509
+ var w;
11510
+ const x = S.name === Ks ? 1 : -1, E = 90 * Math.PI / 180, b = new T.Vector3(0, 0, 0), _ = x * E, A = new T.Matrix4();
11511
+ A.makeRotationZ(_), t.up.applyMatrix4(A), t.lookAt(b), (w = s.current) == null || w.gizmoControls.update();
11509
11512
  },
11510
11513
  [t, s]
11511
- ), w = Rt(
11512
- (_) => {
11514
+ ), y = Rt(
11515
+ (S) => {
11513
11516
  if ((r.current ? Date.now() - r.current : 0) < Ed) {
11514
- go(_, i, c);
11515
- const y = dd(
11517
+ go(S, i, c);
11518
+ const w = dd(
11516
11519
  c,
11517
11520
  t,
11518
11521
  e,
11519
11522
  a
11520
11523
  );
11521
- y != null && y.name && td.includes(y.name) ? p(y) : fd(y, n);
11524
+ w != null && w.name && td.includes(w.name) ? p(w) : fd(w, n);
11522
11525
  }
11523
11526
  r.current = null, o.current = null;
11524
11527
  },
@@ -11535,7 +11538,7 @@ function Td({
11535
11538
  return {
11536
11539
  onMouseDown: f,
11537
11540
  onMouseMove: h,
11538
- onMouseUp: w,
11541
+ onMouseUp: y,
11539
11542
  onMouseLeave: u
11540
11543
  };
11541
11544
  }
@@ -11551,59 +11554,59 @@ const _d = ({
11551
11554
  d,
11552
11555
  u,
11553
11556
  h
11554
- ), p = $e(f).current, w = $e(null), _ = Rt(() => {
11557
+ ), p = $e(f).current, y = $e(null), S = Rt(() => {
11555
11558
  a && (n(), a.render(o, p));
11556
- }, [n, a, o, p]), y = Rt(
11557
- (v) => {
11559
+ }, [n, a, o, p]), w = Rt(
11560
+ (A) => {
11558
11561
  if (!i || !e) return;
11559
- const L = i.position.length(), C = v.clone().multiplyScalar(L), M = 400, D = new T.Matrix4();
11560
- D.lookAt(C, new T.Vector3(0, 0, 0), new T.Vector3(0, 1, 0));
11561
- const I = new T.Quaternion();
11562
- I.setFromRotationMatrix(D), i.quaternion.copy(I), Bu(
11562
+ const P = i.position.length(), I = A.clone().multiplyScalar(P), M = 400, D = new T.Matrix4();
11563
+ D.lookAt(I, new T.Vector3(0, 0, 0), new T.Vector3(0, 1, 0));
11564
+ const C = new T.Quaternion();
11565
+ C.setFromRotationMatrix(D), i.quaternion.copy(C), Bu(
11563
11566
  i,
11564
11567
  e,
11565
11568
  i.position.clone(),
11566
- C,
11569
+ I,
11567
11570
  M,
11568
- _
11571
+ S
11569
11572
  ), i.up.set(0, 1, 0), i.lookAt(new T.Vector3(0, 0, 0)), e.target.set(0, 0, 0), e.update();
11570
11573
  },
11571
- [i, e, _, o]
11572
- ), { onMouseDown: S, onMouseMove: E, onMouseUp: b, onMouseLeave: x } = Td({
11574
+ [i, e, S, o]
11575
+ ), { onMouseDown: x, onMouseMove: E, onMouseUp: b, onMouseLeave: _ } = Td({
11573
11576
  gizmoRenderer: a,
11574
11577
  gizmoScene: o,
11575
11578
  gizmoCamera: p,
11576
- alignCameraWithVector: y,
11577
- gizmoControlRef: w
11579
+ alignCameraWithVector: w,
11580
+ gizmoControlRef: y
11578
11581
  });
11579
11582
  return Et(() => {
11580
- const v = r.current;
11581
- if (!v || !i || !e || !a) return;
11582
- w.current && w.current.dispose();
11583
- const L = {
11584
- gizmoDiv: v,
11583
+ const A = r.current;
11584
+ if (!A || !i || !e || !a) return;
11585
+ y.current && y.current.dispose();
11586
+ const P = {
11587
+ gizmoDiv: A,
11585
11588
  gizmoScene: o,
11586
11589
  gizmoRenderer: a,
11587
11590
  gizmoCamera: p
11588
- }, C = {
11591
+ }, I = {
11589
11592
  mainCamera: i,
11590
11593
  mainControls: e,
11591
- renderGizmo: _
11594
+ renderGizmo: S
11592
11595
  }, M = {
11593
11596
  syncGizmoCameraWithMain: mo,
11594
11597
  syncMainCameraWithGizmo: sd
11595
11598
  };
11596
- return w.current = new hd({
11597
- gizmoParams: L,
11598
- mainParams: C,
11599
+ return y.current = new hd({
11600
+ gizmoParams: P,
11601
+ mainParams: I,
11599
11602
  syncFunctions: M,
11600
11603
  options: s
11601
- }), v.addEventListener("mousedown", S), v.addEventListener("mousemove", E), v.addEventListener("mouseup", b), v.addEventListener("mouseleave", x), () => {
11602
- w.current && (w.current.dispose(), w.current = null), v.removeEventListener("mousedown", S), v.removeEventListener("mousemove", E), v.removeEventListener("mouseup", b), v.removeEventListener("mouseleave", x);
11604
+ }), A.addEventListener("mousedown", x), A.addEventListener("mousemove", E), A.addEventListener("mouseup", b), A.addEventListener("mouseleave", _), () => {
11605
+ y.current && (y.current.dispose(), y.current = null), A.removeEventListener("mousedown", x), A.removeEventListener("mousemove", E), A.removeEventListener("mouseup", b), A.removeEventListener("mouseleave", _);
11603
11606
  };
11604
- }, [i, e, _, E, S, b]), Et(() => {
11605
- i && (mo(p, i, o), _());
11606
- }, [i, _]), /* @__PURE__ */ Te(
11607
+ }, [i, e, S, E, x, b]), Et(() => {
11608
+ i && (mo(p, i, o), S());
11609
+ }, [i, S]), /* @__PURE__ */ Te(
11607
11610
  "div",
11608
11611
  {
11609
11612
  className: t ? `${t}` : "gizmo-default",
@@ -11810,7 +11813,7 @@ function Cd(i) {
11810
11813
  }
11811
11814
  const ks = () => new W("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), ha = yo(
11812
11815
  ({ object: i, options: e = {}, preset: t, pathTraced: n, turntable: s, animations: r, children: o }, a) => {
11813
- var I, N;
11816
+ var C, N;
11814
11817
  const c = $e(null), d = e.preset ?? t, { activePreset: u, pickerEnabled: h, selectPreset: f } = Ou(
11815
11818
  d,
11816
11819
  e.ui
@@ -11820,70 +11823,70 @@ const ks = () => new W("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), ha =
11820
11823
  n,
11821
11824
  s,
11822
11825
  r
11823
- ), { viewer: w, isInitialized: _ } = Pu(c, p), y = Nu(w, _, i), S = ku(w), E = w ? Jn(w.getCamera()) : null, b = w ? ur(w.getControls()) : null, x = w ? Xo(w.getRenderer()) : null, v = Rt(() => {
11824
- w == null || w.requestRender();
11825
- }, [w]), L = ((I = e.helpers) == null ? void 0 : I.gizmo) !== void 0 && e.helpers.gizmo !== !1, C = typeof ((N = e.helpers) == null ? void 0 : N.gizmo) == "object" ? e.helpers.gizmo : {}, M = Zt(
11826
+ ), { viewer: y, isInitialized: S } = Pu(c, p), w = Nu(y, S, i), x = ku(y), E = y ? Jn(y.getCamera()) : null, b = y ? ur(y.getControls()) : null, _ = y ? Xo(y.getRenderer()) : null, A = Rt(() => {
11827
+ y == null || y.requestRender();
11828
+ }, [y]), P = ((C = e.helpers) == null ? void 0 : C.gizmo) !== void 0 && e.helpers.gizmo !== !1, I = typeof ((N = e.helpers) == null ? void 0 : N.gizmo) == "object" ? e.helpers.gizmo : {}, M = Zt(
11826
11829
  () => Cd(e.loadingIndicator),
11827
11830
  [e.loadingIndicator]
11828
- ), D = M.enabled && (y.status === "loading" || y.status === "error");
11831
+ ), D = M.enabled && (w.status === "loading" || w.status === "error");
11829
11832
  return Wa(a, () => ({
11830
- scene: w ? ji(w.getScene()) : null,
11833
+ scene: y ? ji(y.getScene()) : null,
11831
11834
  camera: E,
11832
- renderer: x,
11835
+ renderer: _,
11833
11836
  controls: b,
11834
- events: S,
11837
+ events: x,
11835
11838
  loadModel: async (O) => {
11836
- if (!w)
11839
+ if (!y)
11837
11840
  throw ks();
11838
- const F = typeof O == "string" ? O : new Le(O), V = await w.loadModel(F);
11841
+ const F = typeof O == "string" ? O : new Le(O), V = await y.loadModel(F);
11839
11842
  if (!V.ok)
11840
11843
  throw V.error;
11841
11844
  },
11842
11845
  captureStill: async (O) => {
11843
- if (!w)
11846
+ if (!y)
11844
11847
  throw ks();
11845
- const F = await w.captureStill(O);
11848
+ const F = await y.captureStill(O);
11846
11849
  if (!F.ok)
11847
11850
  throw F.error;
11848
11851
  return F.value;
11849
11852
  },
11850
11853
  captureVideo: async (O) => {
11851
- if (!w)
11854
+ if (!y)
11852
11855
  throw ks();
11853
- const F = await w.captureVideo(O);
11856
+ const F = await y.captureVideo(O);
11854
11857
  if (!F.ok)
11855
11858
  throw F.error;
11856
11859
  return F.value;
11857
11860
  },
11858
- getAnimationNames: () => (w == null ? void 0 : w.getAnimationNames()) ?? [],
11861
+ getAnimationNames: () => (y == null ? void 0 : y.getAnimationNames()) ?? [],
11859
11862
  playAnimations: (O) => {
11860
- if (!w)
11863
+ if (!y)
11861
11864
  throw ks();
11862
- w.playAnimations(O);
11865
+ y.playAnimations(O);
11863
11866
  },
11864
11867
  pauseAnimations: () => {
11865
- w == null || w.pauseAnimations();
11868
+ y == null || y.pauseAnimations();
11866
11869
  },
11867
11870
  dispose: () => {
11868
- w == null || w.dispose();
11871
+ y == null || y.dispose();
11869
11872
  }
11870
- }), [w, E, x, b, S]), /* @__PURE__ */ Te(xd, { children: /* @__PURE__ */ Te(Fu, { viewer: w, canvasRef: c, children: /* @__PURE__ */ Hn("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
11873
+ }), [y, E, _, b, x]), /* @__PURE__ */ Te(xd, { children: /* @__PURE__ */ Te(Fu, { viewer: y, canvasRef: c, children: /* @__PURE__ */ Hn("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
11871
11874
  /* @__PURE__ */ Te(zu, {}),
11872
- L && _ && E && b && /* @__PURE__ */ Te(
11875
+ P && S && E && b && /* @__PURE__ */ Te(
11873
11876
  bd,
11874
11877
  {
11875
11878
  camera: E,
11876
11879
  controls: b,
11877
- render: v,
11878
- placement: C.placement,
11879
- size: C.size
11880
+ render: A,
11881
+ placement: I.placement,
11882
+ size: I.size
11880
11883
  }
11881
11884
  ),
11882
11885
  D && /* @__PURE__ */ Te(
11883
11886
  Ad,
11884
11887
  {
11885
- status: y.status === "error" ? "error" : "loading",
11886
- label: y.status === "error" ? M.errorLabel ?? y.error ?? "Failed to load model" : M.label,
11888
+ status: w.status === "error" ? "error" : "loading",
11889
+ label: w.status === "error" ? M.errorLabel ?? w.error ?? "Failed to load model" : M.label,
11887
11890
  color: M.color,
11888
11891
  backdrop: M.backdrop
11889
11892
  }
@@ -11927,25 +11930,25 @@ function Bd({ position: i, occlude: e = !1, children: t }) {
11927
11930
  if (!u)
11928
11931
  return;
11929
11932
  const h = { x: r, y: o, z: a }, f = () => {
11930
- const y = u.project(h, e);
11931
- if (y) {
11932
- if (!y.visible) {
11933
+ const w = u.project(h, e);
11934
+ if (w) {
11935
+ if (!w.visible) {
11933
11936
  d.style.visibility = "hidden";
11934
11937
  return;
11935
11938
  }
11936
- d.style.visibility = "visible", d.style.left = `${y.left}px`, d.style.top = `${y.top}px`;
11939
+ d.style.visibility = "visible", d.style.left = `${w.left}px`, d.style.top = `${w.top}px`;
11937
11940
  }
11938
11941
  }, p = () => {
11939
11942
  u.invalidate(), f();
11940
11943
  };
11941
11944
  f();
11942
- const w = n.getEvents(), _ = [
11943
- w.on("render:complete", f),
11944
- w.on("controls:change", f),
11945
- w.on("model:loaded", p)
11945
+ const y = n.getEvents(), S = [
11946
+ y.on("render:complete", f),
11947
+ y.on("controls:change", f),
11948
+ y.on("model:loaded", p)
11946
11949
  ];
11947
11950
  return window.addEventListener("resize", p), () => {
11948
- _.forEach((y) => y()), window.removeEventListener("resize", p);
11951
+ S.forEach((w) => w()), window.removeEventListener("resize", p);
11949
11952
  };
11950
11953
  }, [n, r, o, a, e]);
11951
11954
  const c = t != null && t !== !1;