softbox 4.3.2 → 4.4.0

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.
@@ -1,7 +1,7 @@
1
- import { jsx as Te, jsxs as Gn } from "react/jsx-runtime";
2
- import { useMemo as Dt, useRef as Ve, useState as Yn, useEffect as ht, useCallback as Rt, createContext as Wa, useContext as Za, Component as Ka, forwardRef as yo, useImperativeHandle as Xa } from "react";
1
+ import { jsx as Te, jsxs as jn } from "react/jsx-runtime";
2
+ import { useMemo as Dt, useState as An, useEffect as rt, useRef as Ve, useCallback as Rt, createContext as Wa, useContext as Za, Component as Ka, forwardRef as yo, useImperativeHandle as Xa } from "react";
3
3
  import * as w from "three";
4
- import { Box3 as _t, Matrix4 as ut, BufferAttribute as jn, Vector3 as $, Line3 as Nt, Plane as Qn, Vector2 as pe, Triangle as En, BackSide as wo, DoubleSide as Eo, REVISION as To, Ray as Yi, FrontSide as Ai, Mesh as wt, LineSegments as qi, LineLoop as $i, Line as Qi, Points as Ji, Sphere as _o, BatchedMesh as Ya, TrianglesDrawMode as qa, TriangleFanDrawMode as vi, TriangleStripDrawMode as So, Loader as $a, LoaderUtils as Vn, FileLoader as bo, MeshPhysicalMaterial as Mt, Color as tn, LinearSRGBColorSpace as je, SRGBColorSpace as qn, SpotLight as Qa, PointLight as xo, DirectionalLight as Ja, Quaternion as An, InstancedMesh as Ao, InstancedBufferAttribute as ec, Object3D as er, TextureLoader as tc, ImageBitmapLoader as nc, InterleavedBuffer as sc, InterleavedBufferAttribute as ic, LinearMipmapLinearFilter as vo, NearestMipmapLinearFilter as rc, LinearMipmapNearestFilter as oc, NearestMipmapNearestFilter as ac, LinearFilter as nn, NearestFilter as Ro, RepeatWrapping as Ri, MirroredRepeatWrapping as cc, ClampToEdgeWrapping as lc, PointsMaterial as hc, Material as ei, LineBasicMaterial as uc, MeshStandardMaterial as Hs, MeshBasicMaterial as Hn, PropertyBinding as dc, BufferGeometry as fc, SkinnedMesh as pc, Group as ti, PerspectiveCamera as mc, MathUtils as tr, OrthographicCamera as gc, Skeleton as yc, AnimationClip as wc, Bone as Ec, InterpolateDiscrete as Tc, InterpolateLinear as Mo, Texture as xr, VectorKeyframeTrack as Ar, NumberKeyframeTrack as vr, QuaternionKeyframeTrack as Rr, ColorManagement as Mr, Interpolant as _c, Controls as Io, MOUSE as Ue, TOUCH as Ye, Spherical as Gs, Raycaster as Sc, DataTextureLoader as Co, HalfFloatType as Vt, RGBAFormat as Yt, RGFormat as Cn, DataUtils as Et, RedFormat as fs, FloatType as Wn, Scene as bc, BoxGeometry as xc, MeshLambertMaterial as Ac } from "three";
4
+ import { Box3 as _t, Matrix4 as ut, BufferAttribute as Vn, Vector3 as $, Line3 as Nt, Plane as Qn, Vector2 as pe, Triangle as En, BackSide as wo, DoubleSide as Eo, REVISION as To, Ray as Yi, FrontSide as Ai, Mesh as wt, LineSegments as qi, LineLoop as $i, Line as Qi, Points as Ji, Sphere as _o, BatchedMesh as Ya, TrianglesDrawMode as qa, TriangleFanDrawMode as vi, TriangleStripDrawMode as So, Loader as $a, LoaderUtils as Wn, FileLoader as bo, MeshPhysicalMaterial as Mt, Color as tn, LinearSRGBColorSpace as je, SRGBColorSpace as qn, SpotLight as Qa, PointLight as xo, DirectionalLight as Ja, Quaternion as vn, InstancedMesh as Ao, InstancedBufferAttribute as ec, Object3D as er, TextureLoader as tc, ImageBitmapLoader as nc, InterleavedBuffer as sc, InterleavedBufferAttribute as ic, LinearMipmapLinearFilter as vo, NearestMipmapLinearFilter as rc, LinearMipmapNearestFilter as oc, NearestMipmapNearestFilter as ac, LinearFilter as nn, NearestFilter as Ro, RepeatWrapping as Ri, MirroredRepeatWrapping as cc, ClampToEdgeWrapping as lc, PointsMaterial as hc, Material as ei, LineBasicMaterial as uc, MeshStandardMaterial as Hs, MeshBasicMaterial as Gn, PropertyBinding as dc, BufferGeometry as fc, SkinnedMesh as pc, Group as ti, PerspectiveCamera as mc, MathUtils as tr, OrthographicCamera as gc, Skeleton as yc, AnimationClip as wc, Bone as Ec, InterpolateDiscrete as Tc, InterpolateLinear as Mo, Texture as xr, VectorKeyframeTrack as Ar, NumberKeyframeTrack as vr, QuaternionKeyframeTrack as Rr, ColorManagement as Mr, Interpolant as _c, Controls as Io, MOUSE as Ue, TOUCH as Ye, Spherical as Gs, Raycaster as Sc, DataTextureLoader as Co, HalfFloatType as Vt, RGBAFormat as Yt, RGFormat as Pn, DataUtils as Et, RedFormat as fs, FloatType as Zn, Scene as bc, BoxGeometry as xc, MeshLambertMaterial as Ac } from "three";
5
5
  class Z extends Error {
6
6
  constructor(e, t, n) {
7
7
  super(e), this.code = t, this.context = n, this.name = "ThreeViewerError", this.timestamp = /* @__PURE__ */ new Date(), Error.captureStackTrace && Error.captureStackTrace(this, Z);
@@ -161,7 +161,7 @@ class Rc {
161
161
  * aborts before touching a disposed renderer/scene.
162
162
  */
163
163
  async configureEnvironment(e, t, n, s, r, o) {
164
- var d, h, f, p, g, x;
164
+ var d, h, f, p, y, S;
165
165
  const a = await t.initialize({ renderer: s, autoDispose: !0 });
166
166
  if (o())
167
167
  return;
@@ -176,18 +176,18 @@ class Rc {
176
176
  if (o())
177
177
  return;
178
178
  _.ok ? t.applyToScene(e, _.value, c) : console.warn("Failed to load environment map:", _.error);
179
- } else if ((g = r.helpers) != null && g.studioEnvironment) {
179
+ } else if ((y = r.helpers) != null && y.studioEnvironment) {
180
180
  const _ = t.createStudioEnvironment();
181
181
  if (_.ok) {
182
182
  if (t.applyToScene(e, _.value, {
183
183
  ...c,
184
184
  setBackground: !1
185
- }), (x = r.helpers) != null && x.darkStudioMode && n) {
186
- const b = 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
- b.ok || console.warn("Failed to set dark studio background:", b.error);
190
+ x.ok || console.warn("Failed to set dark studio background:", x.error);
191
191
  }
192
192
  } else
193
193
  console.warn("Failed to create studio environment:", _.error);
@@ -1014,11 +1014,11 @@ class kc {
1014
1014
  }, u = `video-capture:${Do()}`;
1015
1015
  return this.deps.renderLoopManager.requireContinuous(u), this.deps.reviveRenderLoop(), this.deps.renderLoopManager.requestRender(), new Promise((h) => {
1016
1016
  const f = [];
1017
- let p = null, g = !1;
1018
- const x = (b) => {
1019
- g || (g = !0, this.pendingSettlers.delete(_), c(), p !== null && clearTimeout(p), this.deps.renderLoopManager.releaseContinuous(u), s.getTracks().forEach((E) => E.stop()), h(b));
1017
+ let p = null, y = !1;
1018
+ const S = (x) => {
1019
+ y || (y = !0, this.pendingSettlers.delete(_), c(), p !== null && clearTimeout(p), this.deps.renderLoopManager.releaseContinuous(u), s.getTracks().forEach((E) => E.stop()), h(x));
1020
1020
  }, _ = () => {
1021
- x(
1021
+ S(
1022
1022
  k.err(
1023
1023
  new Z("Viewer was disposed during video capture", Y.INVALID_STATE)
1024
1024
  )
@@ -1028,12 +1028,12 @@ class kc {
1028
1028
  } catch {
1029
1029
  }
1030
1030
  };
1031
- this.pendingSettlers.add(_), r.ondataavailable = (b) => {
1032
- b.data.size > 0 && f.push(b.data);
1031
+ this.pendingSettlers.add(_), r.ondataavailable = (x) => {
1032
+ x.data.size > 0 && f.push(x.data);
1033
1033
  }, r.onstop = () => {
1034
- x(k.ok(new Blob(f, { type: r.mimeType || "video/webm" })));
1034
+ S(k.ok(new Blob(f, { type: r.mimeType || "video/webm" })));
1035
1035
  }, r.onerror = () => {
1036
- x(
1036
+ S(
1037
1037
  k.err(
1038
1038
  new Z("Video recording failed", Y.OPERATION_FAILED)
1039
1039
  )
@@ -1104,16 +1104,16 @@ class kc {
1104
1104
  e.width ?? (e.height !== void 0 ? e.height * h : u * a)
1105
1105
  ), p = Math.round(
1106
1106
  e.height ?? (e.width !== void 0 ? e.width / h : d * a)
1107
- ), g = t.capabilities.maxTextureSize;
1108
- if (!Number.isFinite(f) || !Number.isFinite(p) || f <= 0 || p <= 0 || f > g || p > g)
1107
+ ), y = t.capabilities.maxTextureSize;
1108
+ if (!Number.isFinite(f) || !Number.isFinite(p) || f <= 0 || p <= 0 || f > y || p > y)
1109
1109
  return k.err(
1110
1110
  new Z(
1111
- `Requested still size ${f}x${p} is outside 1..${g}`,
1111
+ `Requested still size ${f}x${p} is outside 1..${y}`,
1112
1112
  Y.INVALID_PARAMETER
1113
1113
  )
1114
1114
  );
1115
1115
  t.setPixelRatio(1), t.setSize(f, p), Mi(s, f / p);
1116
- const x = t.render(n, s), _ = x.ok ? this.readCanvasPng() : k.err(x.error);
1116
+ const S = t.render(n, s), _ = S.ok ? this.readCanvasPng() : k.err(S.error);
1117
1117
  return t.setSize(u, d), t.setPixelRatio(a), Mi(s, h), t.render(n, s), r.requestRender(), _;
1118
1118
  }
1119
1119
  readCanvasPng() {
@@ -1319,7 +1319,7 @@ class Fc {
1319
1319
  * helpers — take effect at construction time and require a rebuild.
1320
1320
  */
1321
1321
  updateOptions(e) {
1322
- var h, f, p, g, x, _, b, E, S;
1322
+ var h, f, p, y, S, _, x, E, b;
1323
1323
  if (this.disposed)
1324
1324
  return;
1325
1325
  const t = (h = this.options.animations) == null ? void 0 : h.autoplay, n = (f = this.options.controls) == null ? void 0 : f.autoRotate;
@@ -1328,16 +1328,16 @@ class Fc {
1328
1328
  e.backgroundColor !== void 0 && this.applyBackgroundColor(e.backgroundColor);
1329
1329
  const r = (p = e.renderer) == null ? void 0 : p.toneMappingExposure;
1330
1330
  r !== void 0 && (this.renderer.setToneMappingExposure(r), s = !0);
1331
- const o = (g = e.environment) == null ? void 0 : g.environmentIntensity;
1331
+ const o = (y = e.environment) == null ? void 0 : y.environmentIntensity;
1332
1332
  o !== void 0 && (this.scene.setEnvironmentIntensity(o), s = !0);
1333
- const a = (x = e.controls) == null ? void 0 : x.autoRotate;
1333
+ const a = (S = e.controls) == null ? void 0 : S.autoRotate;
1334
1334
  a !== void 0 && a !== n && (this.controls.autoRotate = a, a ? (this.renderLoopManager.requireContinuous("turntable"), this.capture.notifyTurntableEnabled()) : this.renderLoopManager.releaseContinuous("turntable"), s = !0);
1335
1335
  const c = (_ = e.controls) == null ? void 0 : _.autoRotateSpeed;
1336
1336
  c !== void 0 && (this.controls.autoRotateSpeed = c, s = !0);
1337
- const u = (b = e.animations) == null ? void 0 : b.autoplay;
1337
+ const u = (x = e.animations) == null ? void 0 : x.autoplay;
1338
1338
  u !== void 0 && u !== t && (u ? this.modelManager.getCurrentModel() && this.autoplayFromOptions(u) : this.pauseAnimations(), s = !0);
1339
1339
  const d = (E = e.animations) == null ? void 0 : E.speed;
1340
- d !== void 0 && ((S = this.animationService) == null || S.setSpeed(d), s = !0), s && (this.reviveRenderLoop(), this.renderLoopManager.requestRender());
1340
+ d !== void 0 && ((b = this.animationService) == null || b.setSpeed(d), s = !0), s && (this.reviveRenderLoop(), this.renderLoopManager.requestRender());
1341
1341
  }
1342
1342
  applyBackgroundColor(e) {
1343
1343
  var n;
@@ -1573,7 +1573,7 @@ class Zt {
1573
1573
  return new Zt(new w.Vector3(e, t, n));
1574
1574
  }
1575
1575
  }
1576
- const No = 0, zc = 1, Bc = 2, Pr = 2, si = 1.25, Lr = 1, qe = 32, De = qe / 4, sr = 65535, Bd = sr << 16, zs = Math.pow(2, -24), ir = Symbol("SKIP_GENERATION"), ko = {
1576
+ const No = 0, zc = 1, Bc = 2, Pr = 2, si = 1.25, Lr = 1, qe = 32, De = qe / 4, sr = 65535, Hd = sr << 16, zs = Math.pow(2, -24), ir = Symbol("SKIP_GENERATION"), ko = {
1577
1577
  strategy: No,
1578
1578
  maxDepth: 40,
1579
1579
  maxLeafSize: 10,
@@ -1612,7 +1612,7 @@ function ms(i, e, t) {
1612
1612
  o < t[n] && (t[n] = o), a > t[n + 3] && (t[n + 3] = a);
1613
1613
  }
1614
1614
  }
1615
- function Pn(i) {
1615
+ function Ln(i) {
1616
1616
  const e = i[3] - i[0], t = i[4] - i[1], n = i[5] - i[2];
1617
1617
  return 2 * (e * t + t * n + n * e);
1618
1618
  }
@@ -1635,21 +1635,21 @@ function Be(i, e) {
1635
1635
  function rr(i, e) {
1636
1636
  return e[i + 7];
1637
1637
  }
1638
- function Ud(i) {
1638
+ function Gd(i) {
1639
1639
  return i;
1640
1640
  }
1641
1641
  function ii(i, e, t, n, s) {
1642
- let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, u = -1 / 0, d = -1 / 0, h = 1 / 0, f = 1 / 0, p = 1 / 0, g = -1 / 0, x = -1 / 0, _ = -1 / 0;
1643
- const b = i.offset || 0;
1644
- for (let E = (e - b) * 6, S = (e + t - b) * 6; E < S; E += 6) {
1642
+ let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, u = -1 / 0, d = -1 / 0, h = 1 / 0, f = 1 / 0, p = 1 / 0, y = -1 / 0, S = -1 / 0, _ = -1 / 0;
1643
+ const x = i.offset || 0;
1644
+ for (let E = (e - x) * 6, b = (e + t - x) * 6; E < b; E += 6) {
1645
1645
  const T = i[E + 0], A = i[E + 1], P = T - A, I = T + A;
1646
- P < r && (r = P), I > c && (c = I), T < h && (h = T), T > g && (g = T);
1646
+ P < r && (r = P), I > c && (c = I), T < h && (h = T), T > y && (y = T);
1647
1647
  const M = i[E + 2], O = i[E + 3], C = M - O, N = M + O;
1648
- C < o && (o = C), N > u && (u = N), M < f && (f = M), M > x && (x = M);
1648
+ C < o && (o = C), N > u && (u = N), M < f && (f = M), M > S && (S = M);
1649
1649
  const D = i[E + 4], H = i[E + 5], j = D - H, q = D + H;
1650
1650
  j < a && (a = j), q > d && (d = q), D < p && (p = D), D > _ && (_ = D);
1651
1651
  }
1652
- n[0] = r, n[1] = o, n[2] = a, n[3] = c, n[4] = u, n[5] = d, s[0] = h, s[1] = f, s[2] = p, s[3] = g, s[4] = x, s[5] = _;
1652
+ n[0] = r, n[1] = o, n[2] = a, n[3] = c, n[4] = u, n[5] = d, s[0] = h, s[1] = f, s[2] = p, s[3] = y, s[4] = S, s[5] = _;
1653
1653
  }
1654
1654
  const Ct = 32, Uc = (i, e) => i.candidate - e.candidate, Bt = /* @__PURE__ */ new Array(Ct).fill().map(() => ({
1655
1655
  count: 0,
@@ -1665,17 +1665,17 @@ function Hc(i, e, t, n, s, r) {
1665
1665
  else if (r === zc)
1666
1666
  o = Or(i), o !== -1 && (a = Gc(t, n, s, o));
1667
1667
  else if (r === Bc) {
1668
- const c = Pn(i);
1668
+ const c = Ln(i);
1669
1669
  let u = si * s;
1670
1670
  const d = t.offset || 0, h = (n - d) * 6, f = (n + s - d) * 6;
1671
1671
  for (let p = 0; p < 3; p++) {
1672
- const g = e[p], b = (e[p + 3] - g) / Ct;
1672
+ const y = e[p], x = (e[p + 3] - y) / Ct;
1673
1673
  if (s < Ct / 4) {
1674
1674
  const E = [...Bt];
1675
1675
  E.length = s;
1676
- let S = 0;
1677
- for (let A = h; A < f; A += 6, S++) {
1678
- const P = E[S];
1676
+ let b = 0;
1677
+ for (let A = h; A < f; A += 6, b++) {
1678
+ const P = E[b];
1679
1679
  P.candidate = t[A + 2 * p], P.count = 0;
1680
1680
  const {
1681
1681
  bounds: I,
@@ -1703,22 +1703,22 @@ function Hc(i, e, t, n, s, r) {
1703
1703
  for (let A = 0; A < T; A++) {
1704
1704
  const P = E[A], I = P.count, M = s - P.count, O = P.leftCacheBounds, C = P.rightCacheBounds;
1705
1705
  let N = 0;
1706
- I !== 0 && (N = Pn(O) / c);
1706
+ I !== 0 && (N = Ln(O) / c);
1707
1707
  let D = 0;
1708
- M !== 0 && (D = Pn(C) / c);
1708
+ M !== 0 && (D = Ln(C) / c);
1709
1709
  const H = Lr + si * (N * I + D * M);
1710
1710
  H < u && (o = p, u = H, a = P.candidate);
1711
1711
  }
1712
1712
  } else {
1713
1713
  for (let T = 0; T < Ct; T++) {
1714
1714
  const A = Bt[T];
1715
- A.count = 0, A.candidate = g + b + T * b;
1715
+ A.count = 0, A.candidate = y + x + T * x;
1716
1716
  const P = A.bounds;
1717
1717
  for (let I = 0; I < 3; I++)
1718
1718
  P[I] = 1 / 0, P[I + 3] = -1 / 0;
1719
1719
  }
1720
1720
  for (let T = h; T < f; T += 6) {
1721
- let I = ~~((t[T + 2 * p] - g) / b);
1721
+ let I = ~~((t[T + 2 * p] - y) / x);
1722
1722
  I >= Ct && (I = Ct - 1);
1723
1723
  const M = Bt[I];
1724
1724
  M.count++, ms(T, t, M.bounds);
@@ -1729,15 +1729,15 @@ function Hc(i, e, t, n, s, r) {
1729
1729
  const A = Bt[T], P = Bt[T + 1];
1730
1730
  Nr(A.bounds, P.rightCacheBounds, A.rightCacheBounds);
1731
1731
  }
1732
- let S = 0;
1732
+ let b = 0;
1733
1733
  for (let T = 0; T < Ct - 1; T++) {
1734
1734
  const A = Bt[T], P = A.count, I = A.bounds, O = Bt[T + 1].rightCacheBounds;
1735
- P !== 0 && (S === 0 ? Dr(I, gs) : Nr(I, gs, gs)), S += P;
1735
+ P !== 0 && (b === 0 ? Dr(I, gs) : Nr(I, gs, gs)), b += P;
1736
1736
  let C = 0, N = 0;
1737
- S !== 0 && (C = Pn(gs) / c);
1738
- const D = s - S;
1739
- D !== 0 && (N = Pn(O) / c);
1740
- const H = Lr + si * (C * S + N * D);
1737
+ b !== 0 && (C = Ln(gs) / c);
1738
+ const D = s - b;
1739
+ D !== 0 && (N = Ln(O) / c);
1740
+ const H = Lr + si * (C * b + N * D);
1741
1741
  H < u && (o = p, u = H, a = A.candidate);
1742
1742
  }
1743
1743
  }
@@ -1772,8 +1772,8 @@ function jc(i, e, t, n, s, r) {
1772
1772
  i[o * e + h] = i[a * e + h], i[a * e + h] = f;
1773
1773
  }
1774
1774
  for (let h = 0; h < 6; h++) {
1775
- const f = o - d, p = a - d, g = t[f * 6 + h];
1776
- t[f * 6 + h] = t[p * 6 + h], t[p * 6 + h] = g;
1775
+ const f = o - d, p = a - d, y = t[f * 6 + h];
1776
+ t[f * 6 + h] = t[p * 6 + h], t[p * 6 + h] = y;
1777
1777
  }
1778
1778
  o++, a--;
1779
1779
  } else
@@ -1811,27 +1811,27 @@ function Zc(i, e, t, n, s, r) {
1811
1811
  strategy: u,
1812
1812
  onProgress: d
1813
1813
  } = s, h = i.primitiveBuffer, f = i.primitiveBufferStride, p = new Float32Array(6);
1814
- let g = !1;
1815
- const x = new ri();
1816
- return ii(e, t, n, x.boundingData, p), b(x, t, n, p), x;
1814
+ let y = !1;
1815
+ const S = new ri();
1816
+ return ii(e, t, n, S.boundingData, p), x(S, t, n, p), S;
1817
1817
  function _(E) {
1818
1818
  d && d((E - r.offset) / r.count);
1819
1819
  }
1820
- function b(E, S, T, A = null, P = 0) {
1821
- if (!g && P >= o && (g = !0, a && console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)), T <= c || P >= o)
1822
- return _(S + T), E.offset = S, E.count = T, E;
1823
- const I = Hc(E.boundingData, A, e, S, T, u);
1820
+ function x(E, b, T, A = null, P = 0) {
1821
+ if (!y && P >= o && (y = !0, a && console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)), T <= c || P >= o)
1822
+ return _(b + T), E.offset = b, E.count = T, E;
1823
+ const I = Hc(E.boundingData, A, e, b, T, u);
1824
1824
  if (I.axis === -1)
1825
- return _(S + T), E.offset = S, E.count = T, E;
1826
- const M = jc(h, f, e, S, T, I);
1827
- if (M === S || M === S + T)
1828
- _(S + T), E.offset = S, E.count = T;
1825
+ return _(b + T), E.offset = b, E.count = T, E;
1826
+ const M = jc(h, f, e, b, T, I);
1827
+ if (M === b || M === b + T)
1828
+ _(b + T), E.offset = b, E.count = T;
1829
1829
  else {
1830
1830
  E.splitAxis = I.axis;
1831
- const O = new ri(), C = S, N = M - S;
1832
- E.left = O, ii(e, C, N, O.boundingData, p), b(O, C, N, p, P + 1);
1831
+ const O = new ri(), C = b, N = M - b;
1832
+ E.left = O, ii(e, C, N, O.boundingData, p), x(O, C, N, p, P + 1);
1833
1833
  const D = new ri(), H = M, j = T - N;
1834
- E.right = D, ii(e, H, j, D.boundingData, p), b(D, H, j, p, P + 1);
1834
+ E.right = D, ii(e, H, j, D.boundingData, p), x(D, H, j, p, P + 1);
1835
1835
  }
1836
1836
  return E;
1837
1837
  }
@@ -1901,21 +1901,21 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
1901
1901
  return $e(D, j) + Qe(q, H);
1902
1902
  };
1903
1903
  const f = ze(i), p = Be(i, u);
1904
- let g = f, x = p, _, b, E, S;
1905
- if (s && (E = Wt, S = _n, Ae(g, a, E), Ae(x, a, S), _ = s(E), b = s(S), b < _)) {
1906
- g = p, x = f;
1904
+ let y = f, S = p, _, x, E, b;
1905
+ if (s && (E = Wt, b = _n, Ae(y, a, E), Ae(S, a, b), _ = s(E), x = s(b), x < _)) {
1906
+ y = p, S = f;
1907
1907
  const D = _;
1908
- _ = b, b = D, E = S;
1908
+ _ = x, x = D, E = b;
1909
1909
  }
1910
- E || (E = Wt, Ae(g, a, E));
1911
- const T = Ne(g * 2, c), A = t(E, T, _, o + 1, r + g / De);
1910
+ E || (E = Wt, Ae(y, a, E));
1911
+ const T = Ne(y * 2, c), A = t(E, T, _, o + 1, r + y / De);
1912
1912
  let P;
1913
1913
  if (A === Pr) {
1914
- const D = C(g), j = N(g) - D;
1915
- P = n(D, j, !0, o + 1, r + g / De, E);
1914
+ const D = C(y), j = N(y) - D;
1915
+ P = n(D, j, !0, o + 1, r + y / De, E);
1916
1916
  } else
1917
1917
  P = A && Li(
1918
- g,
1918
+ y,
1919
1919
  e,
1920
1920
  t,
1921
1921
  n,
@@ -1924,15 +1924,15 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
1924
1924
  o + 1
1925
1925
  );
1926
1926
  if (P) return !0;
1927
- S = _n, Ae(x, a, S);
1928
- const I = Ne(x * 2, c), M = t(S, I, b, o + 1, r + x / De);
1927
+ b = _n, Ae(S, a, b);
1928
+ const I = Ne(S * 2, c), M = t(b, I, x, o + 1, r + S / De);
1929
1929
  let O;
1930
1930
  if (M === Pr) {
1931
- const D = C(x), j = N(x) - D;
1932
- O = n(D, j, !0, o + 1, r + x / De, S);
1931
+ const D = C(S), j = N(S) - D;
1932
+ O = n(D, j, !0, o + 1, r + S / De, b);
1933
1933
  } else
1934
1934
  O = M && Li(
1935
- x,
1935
+ S,
1936
1936
  e,
1937
1937
  t,
1938
1938
  n,
@@ -1943,7 +1943,7 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
1943
1943
  return !!O;
1944
1944
  }
1945
1945
  }
1946
- const Zn = /* @__PURE__ */ new be.constructor(), Vs = /* @__PURE__ */ new be.constructor(), Gt = /* @__PURE__ */ new or(() => new _t()), ln = /* @__PURE__ */ new _t(), hn = /* @__PURE__ */ new _t(), oi = /* @__PURE__ */ new _t(), ai = /* @__PURE__ */ new _t();
1946
+ const Kn = /* @__PURE__ */ new be.constructor(), Vs = /* @__PURE__ */ new be.constructor(), Gt = /* @__PURE__ */ new or(() => new _t()), ln = /* @__PURE__ */ new _t(), hn = /* @__PURE__ */ new _t(), oi = /* @__PURE__ */ new _t(), ai = /* @__PURE__ */ new _t();
1947
1947
  let ci = !1;
1948
1948
  function qc(i, e, t, n) {
1949
1949
  if (ci)
@@ -1953,10 +1953,10 @@ function qc(i, e, t, n) {
1953
1953
  let o, a = 0, c = 0;
1954
1954
  const u = new ut().copy(t).invert();
1955
1955
  for (let d = 0, h = s.length; d < h; d++) {
1956
- Zn.setBuffer(s[d]), c = 0;
1956
+ Kn.setBuffer(s[d]), c = 0;
1957
1957
  const f = Gt.getPrimitive();
1958
- Ae(0, Zn.float32Array, f), f.applyMatrix4(u);
1959
- for (let p = 0, g = r.length; p < g && (Vs.setBuffer(r[p]), o = gt(
1958
+ Ae(0, Kn.float32Array, f), f.applyMatrix4(u);
1959
+ for (let p = 0, y = r.length; p < y && (Vs.setBuffer(r[p]), o = gt(
1960
1960
  0,
1961
1961
  0,
1962
1962
  t,
@@ -1969,30 +1969,30 @@ function qc(i, e, t, n) {
1969
1969
  f
1970
1970
  ), Vs.clearBuffer(), c += r[p].byteLength / qe, !o); p++)
1971
1971
  ;
1972
- if (Gt.releasePrimitive(f), Zn.clearBuffer(), a += s[d].byteLength / qe, o)
1972
+ if (Gt.releasePrimitive(f), Kn.clearBuffer(), a += s[d].byteLength / qe, o)
1973
1973
  break;
1974
1974
  }
1975
1975
  return ci = !1, o;
1976
1976
  }
1977
1977
  function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
1978
1978
  let h, f;
1979
- d ? (h = Vs, f = Zn) : (h = Zn, f = Vs);
1980
- const p = h.float32Array, g = h.uint32Array, x = h.uint16Array, _ = f.float32Array, b = f.uint32Array, E = f.uint16Array, S = i * 2, T = e * 2, A = Ne(S, x), P = Ne(T, E);
1979
+ d ? (h = Vs, f = Kn) : (h = Kn, f = Vs);
1980
+ const p = h.float32Array, y = h.uint32Array, S = h.uint16Array, _ = f.float32Array, x = f.uint32Array, E = f.uint16Array, b = i * 2, T = e * 2, A = Ne(b, S), P = Ne(T, E);
1981
1981
  let I = !1;
1982
1982
  if (P && A)
1983
1983
  d ? I = s(
1984
- $e(e, b),
1984
+ $e(e, x),
1985
1985
  Qe(e * 2, E),
1986
- $e(i, g),
1987
- Qe(i * 2, x),
1986
+ $e(i, y),
1987
+ Qe(i * 2, S),
1988
1988
  c,
1989
1989
  o + e / De,
1990
1990
  a,
1991
1991
  r + i / De
1992
1992
  ) : I = s(
1993
- $e(i, g),
1994
- Qe(i * 2, x),
1995
- $e(e, b),
1993
+ $e(i, y),
1994
+ Qe(i * 2, S),
1995
+ $e(e, x),
1996
1996
  Qe(e * 2, E),
1997
1997
  a,
1998
1998
  r + i / De,
@@ -2002,7 +2002,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
2002
2002
  else if (P) {
2003
2003
  const M = Gt.getPrimitive();
2004
2004
  Ae(e, _, M), M.applyMatrix4(t);
2005
- const O = ze(i), C = Be(i, g);
2005
+ const O = ze(i), C = Be(i, y);
2006
2006
  Ae(O, p, ln), Ae(C, p, hn);
2007
2007
  const N = M.intersectsBox(ln), D = M.intersectsBox(hn);
2008
2008
  I = N && gt(
@@ -2031,7 +2031,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
2031
2031
  !d
2032
2032
  ), Gt.releasePrimitive(M);
2033
2033
  } else {
2034
- const M = ze(e), O = Be(e, b);
2034
+ const M = ze(e), O = Be(e, x);
2035
2035
  Ae(M, _, oi), Ae(O, _, ai);
2036
2036
  const C = u.intersectsBox(oi), N = u.intersectsBox(ai);
2037
2037
  if (C && N)
@@ -2078,7 +2078,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
2078
2078
  else {
2079
2079
  const D = Gt.getPrimitive();
2080
2080
  D.copy(oi).applyMatrix4(t);
2081
- const H = ze(i), j = Be(i, g);
2081
+ const H = ze(i), j = Be(i, y);
2082
2082
  Ae(H, p, ln), Ae(j, p, hn);
2083
2083
  const q = D.intersectsBox(ln), ie = D.intersectsBox(hn);
2084
2084
  I = q && gt(
@@ -2125,7 +2125,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
2125
2125
  else {
2126
2126
  const D = Gt.getPrimitive();
2127
2127
  D.copy(ai).applyMatrix4(t);
2128
- const H = ze(i), j = Be(i, g);
2128
+ const H = ze(i), j = Be(i, y);
2129
2129
  Ae(H, p, ln), Ae(j, p, hn);
2130
2130
  const q = D.intersectsBox(ln), ie = D.intersectsBox(hn);
2131
2131
  I = q && gt(
@@ -2182,8 +2182,8 @@ class $c {
2182
2182
  let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, u = -1 / 0, d = -1 / 0;
2183
2183
  for (let h = e, f = e + t; h < f; h++) {
2184
2184
  this.writePrimitiveBounds(h, un, 0);
2185
- const [p, g, x, _, b, E] = un;
2186
- p < r && (r = p), _ > c && (c = _), g < o && (o = g), b > u && (u = b), x < a && (a = x), E > d && (d = E);
2185
+ const [p, y, S, _, x, E] = un;
2186
+ p < r && (r = p), _ > c && (c = _), y < o && (o = y), x > u && (u = x), S < a && (a = S), E > d && (d = E);
2187
2187
  }
2188
2188
  return n[s + 0] = r, n[s + 1] = o, n[s + 2] = a, n[s + 3] = c, n[s + 4] = u, n[s + 5] = d, n;
2189
2189
  }
@@ -2191,8 +2191,8 @@ class $c {
2191
2191
  const s = n.offset || 0;
2192
2192
  for (let r = e, o = e + t; r < o; r++) {
2193
2193
  this.writePrimitiveBounds(r, un, 0);
2194
- const [a, c, u, d, h, f] = un, p = (a + d) / 2, g = (c + h) / 2, x = (u + f) / 2, _ = (d - a) / 2, b = (h - c) / 2, E = (f - u) / 2, S = (r - s) * 6;
2195
- n[S + 0] = p, n[S + 1] = _ + (Math.abs(p) + _) * zs, n[S + 2] = g, n[S + 3] = b + (Math.abs(g) + b) * zs, n[S + 4] = x, n[S + 5] = E + (Math.abs(x) + E) * zs;
2194
+ const [a, c, u, d, h, f] = un, p = (a + d) / 2, y = (c + h) / 2, S = (u + f) / 2, _ = (d - a) / 2, x = (h - c) / 2, E = (f - u) / 2, b = (r - s) * 6;
2195
+ n[b + 0] = p, n[b + 1] = _ + (Math.abs(p) + _) * zs, n[b + 2] = y, n[b + 3] = x + (Math.abs(y) + x) * zs, n[b + 4] = S, n[b + 5] = E + (Math.abs(S) + E) * zs;
2196
2196
  }
2197
2197
  return n;
2198
2198
  }
@@ -2252,13 +2252,13 @@ class $c {
2252
2252
  for (let u = c - 1; u >= 0; u--) {
2253
2253
  const d = u * De, h = d * 2;
2254
2254
  if (Ne(h, o)) {
2255
- const p = $e(d, r), g = Qe(h, o);
2256
- this.writePrimitiveRangeBounds(p, g, un, 0), a.set(un, d);
2255
+ const p = $e(d, r), y = Qe(h, o);
2256
+ this.writePrimitiveRangeBounds(p, y, un, 0), a.set(un, d);
2257
2257
  } else {
2258
- const p = ze(d), g = Be(d, r);
2259
- for (let x = 0; x < 3; x++) {
2260
- const _ = a[p + x], b = a[p + x + 3], E = a[g + x], S = a[g + x + 3];
2261
- a[d + x] = _ < E ? _ : E, a[d + x + 3] = b > S ? b : S;
2258
+ const p = ze(d), y = Be(d, r);
2259
+ for (let S = 0; S < 3; S++) {
2260
+ const _ = a[p + S], x = a[p + S + 3], E = a[y + S], b = a[y + S + 3];
2261
+ a[d + S] = _ < E ? _ : E, a[d + S + 3] = x > b ? x : b;
2262
2262
  }
2263
2263
  }
2264
2264
  }
@@ -2300,8 +2300,8 @@ class $c {
2300
2300
  } = e;
2301
2301
  if (s && r) {
2302
2302
  const h = s;
2303
- s = (f, p, g, x, _) => h(f, p, g, x, _) ? !0 : a(f, p, this, r, g, x, o);
2304
- } else s || (r ? s = (h, f, p, g) => a(h, f, this, r, p, g, o) : s = (h, f, p) => p);
2303
+ s = (f, p, y, S, _) => h(f, p, y, S, _) ? !0 : a(f, p, this, r, y, S, o);
2304
+ } else s || (r ? s = (h, f, p, y) => a(h, f, this, r, p, y, o) : s = (h, f, p) => p);
2305
2305
  let c = !1, u = 0;
2306
2306
  const d = this._roots;
2307
2307
  for (let h = 0, f = d.length; h < f; h++) {
@@ -2343,7 +2343,7 @@ function Jc(i, e = ArrayBuffer) {
2343
2343
  function el(i, e) {
2344
2344
  if (!i.index) {
2345
2345
  const t = i.attributes.position.count, n = e.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, s = Jc(t, n);
2346
- i.setIndex(new jn(s, 1));
2346
+ i.setIndex(new Vn(s, 1));
2347
2347
  for (let r = 0; r < t; r++)
2348
2348
  s[r] = r;
2349
2349
  }
@@ -2367,8 +2367,8 @@ function Fr(i, e, t) {
2367
2367
  return [n];
2368
2368
  const r = [], o = n.offset, a = n.offset + n.count, c = ar(i) / t, u = [];
2369
2369
  for (const f of s) {
2370
- const { offset: p, count: g } = f, x = p, _ = isFinite(g) ? g : c - p, b = p + _;
2371
- x < a && b > o && (u.push({ pos: Math.max(o, x), isStart: !0 }), u.push({ pos: Math.min(a, b), isStart: !1 }));
2370
+ const { offset: p, count: y } = f, S = p, _ = isFinite(y) ? y : c - p, x = p + _;
2371
+ S < a && x > o && (u.push({ pos: Math.max(o, S), isStart: !0 }), u.push({ pos: Math.min(a, x), isStart: !1 }));
2372
2372
  }
2373
2373
  u.sort((f, p) => f.pos !== p.pos ? f.pos - p.pos : f.type === "end" ? -1 : 1);
2374
2374
  let d = 0, h = null;
@@ -2487,9 +2487,9 @@ const rl = /* @__PURE__ */ (function() {
2487
2487
  return function(s, r, o) {
2488
2488
  const a = s.start, c = i, u = r.start, d = e;
2489
2489
  t.subVectors(a, u), i.subVectors(s.end, s.start), e.subVectors(r.end, r.start);
2490
- const h = t.dot(d), f = d.dot(c), p = d.dot(d), g = t.dot(c), _ = c.dot(c) * p - f * f;
2491
- let b, E;
2492
- _ !== 0 ? b = (h * f - g * p) / _ : b = 0, E = (h + b * f) / p, o.x = b, o.y = E;
2490
+ const h = t.dot(d), f = d.dot(c), p = d.dot(d), y = t.dot(c), _ = c.dot(c) * p - f * f;
2491
+ let x, E;
2492
+ _ !== 0 ? x = (h * f - y * p) / _ : x = 0, E = (h + x * f) / p, o.x = x, o.y = E;
2493
2493
  };
2494
2494
  })(), cr = /* @__PURE__ */ (function() {
2495
2495
  const i = /* @__PURE__ */ new pe(), e = /* @__PURE__ */ new $(), t = /* @__PURE__ */ new $();
@@ -2525,15 +2525,15 @@ const rl = /* @__PURE__ */ (function() {
2525
2525
  return function(r, o) {
2526
2526
  const { radius: a, center: c } = r, { a: u, b: d, c: h } = o;
2527
2527
  if (n.start = u, n.end = d, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a || (n.start = u, n.end = h, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a) || (n.start = d, n.end = h, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a)) return !0;
2528
- const x = o.getPlane(t);
2529
- if (Math.abs(x.distanceToPoint(c)) <= a) {
2530
- const b = x.projectPoint(c, e);
2531
- if (o.containsPoint(b)) return !0;
2528
+ const S = o.getPlane(t);
2529
+ if (Math.abs(S.distanceToPoint(c)) <= a) {
2530
+ const x = S.projectPoint(c, e);
2531
+ if (o.containsPoint(x)) return !0;
2532
2532
  }
2533
2533
  return !1;
2534
2534
  };
2535
2535
  })(), al = ["x", "y", "z"], Pt = 1e-15, zr = Pt * Pt;
2536
- function ot(i) {
2536
+ function at(i) {
2537
2537
  return Math.abs(i) < Pt;
2538
2538
  }
2539
2539
  class Tt extends En {
@@ -2555,10 +2555,10 @@ class Tt extends En {
2555
2555
  u.subVectors(e, t), d.setFromPoints(u, s);
2556
2556
  const h = r[2], f = o[2];
2557
2557
  h.subVectors(t, n), f.setFromPoints(h, s);
2558
- const p = r[3], g = o[3];
2559
- p.subVectors(n, e), g.setFromPoints(p, s);
2560
- const x = u.length(), _ = h.length(), b = p.length();
2561
- this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, x < Pt ? _ < Pt || b < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : _ < Pt ? b < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : b < Pt && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(a, e), this.needsUpdate = !1;
2558
+ const p = r[3], y = o[3];
2559
+ p.subVectors(n, e), y.setFromPoints(p, s);
2560
+ const S = u.length(), _ = h.length(), x = p.length();
2561
+ this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, S < Pt ? _ < Pt || x < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : _ < 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;
2562
2562
  }
2563
2563
  }
2564
2564
  Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
@@ -2575,73 +2575,73 @@ Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
2575
2575
  })();
2576
2576
  Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2577
2577
  const i = /* @__PURE__ */ new Tt(), e = /* @__PURE__ */ new kt(), t = /* @__PURE__ */ new kt(), n = /* @__PURE__ */ new $(), s = /* @__PURE__ */ new $(), r = /* @__PURE__ */ new $(), o = /* @__PURE__ */ new $(), a = /* @__PURE__ */ new Nt(), c = /* @__PURE__ */ new Nt(), u = /* @__PURE__ */ new $(), d = /* @__PURE__ */ new pe(), h = /* @__PURE__ */ new pe();
2578
- function f(S, T, A, P) {
2578
+ function f(b, T, A, P) {
2579
2579
  const I = n;
2580
- !S.isDegenerateIntoPoint && !S.isDegenerateIntoSegment ? I.copy(S.plane.normal) : I.copy(T.plane.normal);
2581
- const M = S.satBounds, O = S.satAxes;
2580
+ !b.isDegenerateIntoPoint && !b.isDegenerateIntoSegment ? I.copy(b.plane.normal) : I.copy(T.plane.normal);
2581
+ const M = b.satBounds, O = b.satAxes;
2582
2582
  for (let D = 1; D < 4; D++) {
2583
2583
  const H = M[D], j = O[D];
2584
- if (e.setFromPoints(j, T.points), H.isSeparated(e) || (o.copy(I).cross(j), e.setFromPoints(o, S.points), t.setFromPoints(o, T.points), e.isSeparated(t))) return !1;
2584
+ if (e.setFromPoints(j, T.points), H.isSeparated(e) || (o.copy(I).cross(j), e.setFromPoints(o, b.points), t.setFromPoints(o, T.points), e.isSeparated(t))) return !1;
2585
2585
  }
2586
2586
  const C = T.satBounds, N = T.satAxes;
2587
2587
  for (let D = 1; D < 4; D++) {
2588
2588
  const H = C[D], j = N[D];
2589
- if (e.setFromPoints(j, S.points), H.isSeparated(e) || (o.crossVectors(I, j), e.setFromPoints(o, S.points), t.setFromPoints(o, T.points), e.isSeparated(t))) return !1;
2589
+ if (e.setFromPoints(j, b.points), H.isSeparated(e) || (o.crossVectors(I, j), e.setFromPoints(o, b.points), t.setFromPoints(o, T.points), e.isSeparated(t))) return !1;
2590
2590
  }
2591
2591
  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;
2592
2592
  }
2593
- function p(S, T, A, P, I, M, O, C, N, D, H) {
2593
+ function p(b, T, A, P, I, M, O, C, N, D, H) {
2594
2594
  let j = O / (O - C);
2595
- D.x = P + (I - P) * j, H.start.subVectors(T, S).multiplyScalar(j).add(S), j = O / (O - N), D.y = P + (M - P) * j, H.end.subVectors(A, S).multiplyScalar(j).add(S);
2595
+ D.x = P + (I - P) * j, H.start.subVectors(T, b).multiplyScalar(j).add(b), j = O / (O - N), D.y = P + (M - P) * j, H.end.subVectors(A, b).multiplyScalar(j).add(b);
2596
2596
  }
2597
- function g(S, T, A, P, I, M, O, C, N, D, H) {
2597
+ function y(b, T, A, P, I, M, O, C, N, D, H) {
2598
2598
  if (I > 0)
2599
- p(S.c, S.a, S.b, P, T, A, N, O, C, D, H);
2599
+ p(b.c, b.a, b.b, P, T, A, N, O, C, D, H);
2600
2600
  else if (M > 0)
2601
- p(S.b, S.a, S.c, A, T, P, C, O, N, D, H);
2601
+ p(b.b, b.a, b.c, A, T, P, C, O, N, D, H);
2602
2602
  else if (C * N > 0 || O != 0)
2603
- p(S.a, S.b, S.c, T, A, P, O, C, N, D, H);
2603
+ p(b.a, b.b, b.c, T, A, P, O, C, N, D, H);
2604
2604
  else if (C != 0)
2605
- p(S.b, S.a, S.c, A, T, P, C, O, N, D, H);
2605
+ p(b.b, b.a, b.c, A, T, P, C, O, N, D, H);
2606
2606
  else if (N != 0)
2607
- p(S.c, S.a, S.b, P, T, A, N, O, C, D, H);
2607
+ p(b.c, b.a, b.b, P, T, A, N, O, C, D, H);
2608
2608
  else
2609
2609
  return !0;
2610
2610
  return !1;
2611
2611
  }
2612
- function x(S, T, A, P) {
2613
- const I = T.degenerateSegment, M = S.plane.distanceToPoint(I.start), O = S.plane.distanceToPoint(I.end);
2614
- return ot(M) ? ot(O) ? f(S, T, A, P) : (A && (A.start.copy(I.start), A.end.copy(I.start)), S.containsPoint(I.start)) : ot(O) ? (A && (A.start.copy(I.end), A.end.copy(I.end)), S.containsPoint(I.end)) : S.plane.intersectLine(I, n) != null ? (A && (A.start.copy(n), A.end.copy(n)), S.containsPoint(n)) : !1;
2612
+ function S(b, T, A, P) {
2613
+ const I = T.degenerateSegment, M = b.plane.distanceToPoint(I.start), O = b.plane.distanceToPoint(I.end);
2614
+ return at(M) ? at(O) ? f(b, T, A, P) : (A && (A.start.copy(I.start), A.end.copy(I.start)), b.containsPoint(I.start)) : at(O) ? (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;
2615
2615
  }
2616
- function _(S, T, A) {
2616
+ function _(b, T, A) {
2617
2617
  const P = T.a;
2618
- return ot(S.plane.distanceToPoint(P)) && S.containsPoint(P) ? (A && (A.start.copy(P), A.end.copy(P)), !0) : !1;
2618
+ return at(b.plane.distanceToPoint(P)) && b.containsPoint(P) ? (A && (A.start.copy(P), A.end.copy(P)), !0) : !1;
2619
2619
  }
2620
- function b(S, T, A) {
2621
- const P = S.degenerateSegment, I = T.a;
2620
+ function x(b, T, A) {
2621
+ const P = b.degenerateSegment, I = T.a;
2622
2622
  return P.closestPointToPoint(I, !0, n), I.distanceToSquared(n) < zr ? (A && (A.start.copy(I), A.end.copy(I)), !0) : !1;
2623
2623
  }
2624
- function E(S, T, A, P) {
2625
- if (S.isDegenerateIntoSegment)
2624
+ function E(b, T, A, P) {
2625
+ if (b.isDegenerateIntoSegment)
2626
2626
  if (T.isDegenerateIntoSegment) {
2627
- const I = S.degenerateSegment, M = T.degenerateSegment, O = s, C = r;
2627
+ const I = b.degenerateSegment, M = T.degenerateSegment, O = s, C = r;
2628
2628
  I.delta(O), M.delta(C);
2629
2629
  const N = n.subVectors(M.start, I.start), D = O.x * C.y - O.y * C.x;
2630
- if (ot(D))
2630
+ if (at(D))
2631
2631
  return !1;
2632
2632
  const H = (N.x * C.y - N.y * C.x) / D, j = -(O.x * N.y - O.y * N.x) / D;
2633
2633
  if (H < 0 || H > 1 || j < 0 || j > 1)
2634
2634
  return !1;
2635
2635
  const q = I.start.z + O.z * H, ie = M.start.z + C.z * j;
2636
- return ot(q - ie) ? (A && (A.start.copy(I.start).addScaledVector(O, H), A.end.copy(I.start).addScaledVector(O, H)), !0) : !1;
2637
- } else return T.isDegenerateIntoPoint ? b(S, T, A) : x(T, S, A, P);
2636
+ return at(q - ie) ? (A && (A.start.copy(I.start).addScaledVector(O, H), A.end.copy(I.start).addScaledVector(O, H)), !0) : !1;
2637
+ } else return T.isDegenerateIntoPoint ? x(b, T, A) : S(T, b, A, P);
2638
2638
  else {
2639
- if (S.isDegenerateIntoPoint)
2640
- return T.isDegenerateIntoPoint ? T.a.distanceToSquared(S.a) < zr ? (A && (A.start.copy(S.a), A.end.copy(S.a)), !0) : !1 : T.isDegenerateIntoSegment ? b(T, S, A) : _(T, S, A);
2639
+ if (b.isDegenerateIntoPoint)
2640
+ return T.isDegenerateIntoPoint ? T.a.distanceToSquared(b.a) < zr ? (A && (A.start.copy(b.a), A.end.copy(b.a)), !0) : !1 : T.isDegenerateIntoSegment ? x(T, b, A) : _(T, b, A);
2641
2641
  if (T.isDegenerateIntoPoint)
2642
- return _(S, T, A);
2642
+ return _(b, T, A);
2643
2643
  if (T.isDegenerateIntoSegment)
2644
- return x(S, T, A, P);
2644
+ return S(b, T, A, P);
2645
2645
  }
2646
2646
  }
2647
2647
  return function(T, A = null, P = !1) {
@@ -2651,12 +2651,12 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2651
2651
  return I;
2652
2652
  const M = this.plane, O = T.plane;
2653
2653
  let C = O.distanceToPoint(this.a), N = O.distanceToPoint(this.b), D = O.distanceToPoint(this.c);
2654
- ot(C) && (C = 0), ot(N) && (N = 0), ot(D) && (D = 0);
2654
+ at(C) && (C = 0), at(N) && (N = 0), at(D) && (D = 0);
2655
2655
  const H = C * N, j = C * D;
2656
2656
  if (H > 0 && j > 0)
2657
2657
  return !1;
2658
2658
  let q = M.distanceToPoint(T.a), ie = M.distanceToPoint(T.b), ke = M.distanceToPoint(T.c);
2659
- ot(q) && (q = 0), ot(ie) && (ie = 0), ot(ke) && (ke = 0);
2659
+ at(q) && (q = 0), at(ie) && (ie = 0), at(ke) && (ke = 0);
2660
2660
  const dt = q * ie, Me = q * ke;
2661
2661
  if (dt > 0 && Me > 0)
2662
2662
  return !1;
@@ -2665,10 +2665,10 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2665
2665
  let We = 0, ve = Math.abs(He.x);
2666
2666
  const ge = Math.abs(He.y);
2667
2667
  ge > ve && (ve = ge, We = 1), Math.abs(He.z) > ve && (We = 2);
2668
- const Ze = al[We], Ft = this.a[Ze], me = this.b[Ze], ft = this.c[Ze], pt = T.a[Ze], vn = T.b[Ze], rn = T.c[Ze];
2669
- if (g(this, Ft, me, ft, H, j, C, N, D, d, a))
2668
+ const Ze = al[We], Ft = this.a[Ze], me = this.b[Ze], ft = this.c[Ze], pt = T.a[Ze], Rn = T.b[Ze], rn = T.c[Ze];
2669
+ if (y(this, Ft, me, ft, H, j, C, N, D, d, a))
2670
2670
  return f(this, T, A, P);
2671
- if (g(T, pt, vn, rn, dt, Me, q, ie, ke, h, c))
2671
+ if (y(T, pt, Rn, rn, dt, Me, q, ie, ke, h, c))
2672
2672
  return f(this, T, A, P);
2673
2673
  if (d.y < d.x) {
2674
2674
  const It = d.y;
@@ -2696,19 +2696,19 @@ Tt.prototype.distanceToTriangle = /* @__PURE__ */ (function() {
2696
2696
  let d = 1 / 0;
2697
2697
  for (let h = 0; h < 3; h++) {
2698
2698
  let f;
2699
- const p = t[h], g = o[p];
2700
- this.closestPointToPoint(g, i), f = g.distanceToSquared(i), f < d && (d = f, a && a.copy(i), c && c.copy(g));
2701
- const x = this[p];
2702
- o.closestPointToPoint(x, i), f = x.distanceToSquared(i), f < d && (d = f, a && a.copy(x), c && c.copy(i));
2699
+ const p = t[h], y = o[p];
2700
+ this.closestPointToPoint(y, i), f = y.distanceToSquared(i), f < d && (d = f, a && a.copy(i), c && c.copy(y));
2701
+ const S = this[p];
2702
+ o.closestPointToPoint(S, i), f = S.distanceToSquared(i), f < d && (d = f, a && a.copy(S), c && c.copy(i));
2703
2703
  }
2704
2704
  for (let h = 0; h < 3; h++) {
2705
2705
  const f = t[h], p = t[(h + 1) % 3];
2706
2706
  n.set(this[f], this[p]);
2707
- for (let g = 0; g < 3; g++) {
2708
- const x = t[g], _ = t[(g + 1) % 3];
2709
- s.set(o[x], o[_]), cr(n, s, i, e);
2710
- const b = i.distanceToSquared(e);
2711
- b < d && (d = b, a && a.copy(i), c && c.copy(e));
2707
+ for (let y = 0; y < 3; y++) {
2708
+ const S = t[y], _ = t[(y + 1) % 3];
2709
+ s.set(o[S], o[_]), cr(n, s, i, e);
2710
+ const x = i.distanceToSquared(e);
2711
+ x < d && (d = x, a && a.copy(i), c && c.copy(e));
2712
2712
  }
2713
2713
  }
2714
2714
  return Math.sqrt(d);
@@ -2769,19 +2769,19 @@ Je.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2769
2769
  const a = this.satBounds, c = this.satAxes;
2770
2770
  e[0] = o.a, e[1] = o.b, e[2] = o.c;
2771
2771
  for (let f = 0; f < 3; f++) {
2772
- const p = a[f], g = c[f];
2773
- if (t.setFromPoints(g, e), p.isSeparated(t)) return !1;
2772
+ const p = a[f], y = c[f];
2773
+ if (t.setFromPoints(y, e), p.isSeparated(t)) return !1;
2774
2774
  }
2775
2775
  const u = o.satBounds, d = o.satAxes, h = this.points;
2776
2776
  for (let f = 0; f < 3; f++) {
2777
- const p = u[f], g = d[f];
2778
- if (t.setFromPoints(g, h), p.isSeparated(t)) return !1;
2777
+ const p = u[f], y = d[f];
2778
+ if (t.setFromPoints(y, h), p.isSeparated(t)) return !1;
2779
2779
  }
2780
2780
  for (let f = 0; f < 3; f++) {
2781
2781
  const p = c[f];
2782
- for (let g = 0; g < 4; g++) {
2783
- const x = d[g];
2784
- if (s.crossVectors(p, x), t.setFromPoints(s, e), n.setFromPoints(s, h), t.isSeparated(n)) return !1;
2782
+ for (let y = 0; y < 4; y++) {
2783
+ const S = d[y];
2784
+ if (s.crossVectors(p, S), t.setFromPoints(s, e), n.setFromPoints(s, h), t.isSeparated(n)) return !1;
2785
2785
  }
2786
2786
  }
2787
2787
  return !0;
@@ -2804,42 +2804,42 @@ Je.prototype.distanceToBox = /* @__PURE__ */ (function() {
2804
2804
  if (this.needsUpdate && this.update(), this.intersectsBox(o))
2805
2805
  return (c || u) && (o.getCenter(s), this.closestPointToPoint(s, n), o.closestPointToPoint(n, s), c && c.copy(n), u && u.copy(s)), 0;
2806
2806
  const d = a * a, h = o.min, f = o.max, p = this.points;
2807
- let g = 1 / 0;
2807
+ let y = 1 / 0;
2808
2808
  for (let _ = 0; _ < 8; _++) {
2809
- const b = p[_];
2810
- s.copy(b).clamp(h, f);
2811
- const E = b.distanceToSquared(s);
2812
- if (E < g && (g = E, c && c.copy(b), u && u.copy(s), E < d))
2809
+ const x = p[_];
2810
+ s.copy(x).clamp(h, f);
2811
+ const E = x.distanceToSquared(s);
2812
+ if (E < y && (y = E, c && c.copy(x), u && u.copy(s), E < d))
2813
2813
  return Math.sqrt(E);
2814
2814
  }
2815
- let x = 0;
2815
+ let S = 0;
2816
2816
  for (let _ = 0; _ < 3; _++)
2817
- for (let b = 0; b <= 1; b++)
2817
+ for (let x = 0; x <= 1; x++)
2818
2818
  for (let E = 0; E <= 1; E++) {
2819
- const S = (_ + 1) % 3, T = (_ + 2) % 3, A = b << S | E << T, P = 1 << _ | b << S | E << T, I = p[A], M = p[P];
2820
- e[x].set(I, M);
2821
- const C = i[_], N = i[S], D = i[T], H = t[x], j = H.start, q = H.end;
2822
- j[C] = h[C], j[N] = b ? h[N] : f[N], j[D] = E ? h[D] : f[N], q[C] = f[C], q[N] = b ? h[N] : f[N], q[D] = E ? h[D] : f[N], x++;
2819
+ const b = (_ + 1) % 3, T = (_ + 2) % 3, A = x << b | E << T, P = 1 << _ | x << b | E << T, I = p[A], M = p[P];
2820
+ e[S].set(I, M);
2821
+ const C = i[_], N = i[b], D = i[T], H = t[S], j = H.start, q = H.end;
2822
+ j[C] = h[C], j[N] = x ? h[N] : f[N], j[D] = E ? h[D] : f[N], q[C] = f[C], q[N] = x ? h[N] : f[N], q[D] = E ? h[D] : f[N], S++;
2823
2823
  }
2824
2824
  for (let _ = 0; _ <= 1; _++)
2825
- for (let b = 0; b <= 1; b++)
2825
+ for (let x = 0; x <= 1; x++)
2826
2826
  for (let E = 0; E <= 1; E++) {
2827
- s.x = _ ? f.x : h.x, s.y = b ? f.y : h.y, s.z = E ? f.z : h.z, this.closestPointToPoint(s, n);
2828
- const S = s.distanceToSquared(n);
2829
- if (S < g && (g = S, c && c.copy(n), u && u.copy(s), S < d))
2830
- return Math.sqrt(S);
2827
+ s.x = _ ? f.x : h.x, s.y = x ? f.y : h.y, s.z = E ? f.z : h.z, this.closestPointToPoint(s, n);
2828
+ const b = s.distanceToSquared(n);
2829
+ if (b < y && (y = b, c && c.copy(n), u && u.copy(s), b < d))
2830
+ return Math.sqrt(b);
2831
2831
  }
2832
2832
  for (let _ = 0; _ < 12; _++) {
2833
- const b = e[_];
2833
+ const x = e[_];
2834
2834
  for (let E = 0; E < 12; E++) {
2835
- const S = t[E];
2836
- cr(b, S, n, s);
2835
+ const b = t[E];
2836
+ cr(x, b, n, s);
2837
2837
  const T = n.distanceToSquared(s);
2838
- if (T < g && (g = T, c && c.copy(n), u && u.copy(s), T < d))
2838
+ if (T < y && (y = T, c && c.copy(n), u && u.copy(s), T < d))
2839
2839
  return Math.sqrt(T);
2840
2840
  }
2841
2841
  }
2842
- return Math.sqrt(g);
2842
+ return Math.sqrt(y);
2843
2843
  };
2844
2844
  })();
2845
2845
  class cl extends or {
@@ -2847,25 +2847,25 @@ class cl extends or {
2847
2847
  super(() => new Tt());
2848
2848
  }
2849
2849
  }
2850
- const lt = /* @__PURE__ */ new cl(), Ln = /* @__PURE__ */ new $(), li = /* @__PURE__ */ new $();
2850
+ const ht = /* @__PURE__ */ new cl(), On = /* @__PURE__ */ new $(), li = /* @__PURE__ */ new $();
2851
2851
  function ll(i, e, t = {}, n = 0, s = 1 / 0) {
2852
2852
  const r = n * n, o = s * s;
2853
2853
  let a = 1 / 0, c = null;
2854
2854
  if (i.shapecast(
2855
2855
  {
2856
- boundsTraverseOrder: (d) => (Ln.copy(e).clamp(d.min, d.max), Ln.distanceToSquared(e)),
2856
+ boundsTraverseOrder: (d) => (On.copy(e).clamp(d.min, d.max), On.distanceToSquared(e)),
2857
2857
  intersectsBounds: (d, h, f) => f < a && f < o,
2858
2858
  intersectsTriangle: (d, h) => {
2859
- d.closestPointToPoint(e, Ln);
2860
- const f = e.distanceToSquared(Ln);
2861
- return f < a && (li.copy(Ln), a = f, c = h), f < r;
2859
+ d.closestPointToPoint(e, On);
2860
+ const f = e.distanceToSquared(On);
2861
+ return f < a && (li.copy(On), a = f, c = h), f < r;
2862
2862
  }
2863
2863
  }
2864
2864
  ), a === 1 / 0) return null;
2865
2865
  const u = Math.sqrt(a);
2866
2866
  return t.point ? t.point.copy(li) : t.point = li.clone(), t.distance = u, t.faceIndex = c, t;
2867
2867
  }
2868
- const ws = parseInt(To) >= 169, hl = parseInt(To) <= 161, qt = /* @__PURE__ */ new $(), $t = /* @__PURE__ */ new $(), Qt = /* @__PURE__ */ new $(), Es = /* @__PURE__ */ new pe(), Ts = /* @__PURE__ */ new pe(), _s = /* @__PURE__ */ new pe(), Br = /* @__PURE__ */ new $(), Ur = /* @__PURE__ */ new $(), Hr = /* @__PURE__ */ new $(), On = /* @__PURE__ */ new $();
2868
+ const ws = parseInt(To) >= 169, hl = parseInt(To) <= 161, qt = /* @__PURE__ */ new $(), $t = /* @__PURE__ */ new $(), Qt = /* @__PURE__ */ new $(), Es = /* @__PURE__ */ new pe(), Ts = /* @__PURE__ */ new pe(), _s = /* @__PURE__ */ new pe(), Br = /* @__PURE__ */ new $(), Ur = /* @__PURE__ */ new $(), Hr = /* @__PURE__ */ new $(), Dn = /* @__PURE__ */ new $();
2869
2869
  function ul(i, e, t, n, s, r, o, a) {
2870
2870
  let c;
2871
2871
  if (r === wo ? c = i.intersectTriangle(n, t, e, !0, s) : c = i.intersectTriangle(e, t, n, r !== Eo, s), c === null) return null;
@@ -2877,21 +2877,21 @@ function ul(i, e, t, n, s, r, o, a) {
2877
2877
  }
2878
2878
  function Gr(i, e, t, n, s, r, o, a, c, u, d) {
2879
2879
  qt.fromBufferAttribute(e, r), $t.fromBufferAttribute(e, o), Qt.fromBufferAttribute(e, a);
2880
- const h = ul(i, qt, $t, Qt, On, c, u, d);
2880
+ const h = ul(i, qt, $t, Qt, Dn, c, u, d);
2881
2881
  if (h) {
2882
2882
  if (n) {
2883
2883
  Es.fromBufferAttribute(n, r), Ts.fromBufferAttribute(n, o), _s.fromBufferAttribute(n, a), h.uv = new pe();
2884
- const p = En.getInterpolation(On, qt, $t, Qt, Es, Ts, _s, h.uv);
2884
+ const p = En.getInterpolation(Dn, qt, $t, Qt, Es, Ts, _s, h.uv);
2885
2885
  ws || (h.uv = p);
2886
2886
  }
2887
2887
  if (s) {
2888
2888
  Es.fromBufferAttribute(s, r), Ts.fromBufferAttribute(s, o), _s.fromBufferAttribute(s, a), h.uv1 = new pe();
2889
- const p = En.getInterpolation(On, qt, $t, Qt, Es, Ts, _s, h.uv1);
2889
+ const p = En.getInterpolation(Dn, qt, $t, Qt, Es, Ts, _s, h.uv1);
2890
2890
  ws || (h.uv1 = p), hl && (h.uv2 = h.uv1);
2891
2891
  }
2892
2892
  if (t) {
2893
2893
  Br.fromBufferAttribute(t, r), Ur.fromBufferAttribute(t, o), Hr.fromBufferAttribute(t, a), h.normal = new $();
2894
- const p = En.getInterpolation(On, qt, $t, Qt, Br, Ur, Hr, h.normal);
2894
+ const p = En.getInterpolation(Dn, qt, $t, Qt, Br, Ur, Hr, h.normal);
2895
2895
  h.normal.dot(i.direction) > 0 && h.normal.multiplyScalar(-1), ws || (h.normal = p);
2896
2896
  }
2897
2897
  const f = {
@@ -2903,7 +2903,7 @@ function Gr(i, e, t, n, s, r, o, a, c, u, d) {
2903
2903
  };
2904
2904
  if (En.getNormal(qt, $t, Qt, f.normal), h.face = f, h.faceIndex = r, ws) {
2905
2905
  const p = new $();
2906
- En.getBarycoord(On, qt, $t, Qt, p), h.barycoord = p;
2906
+ En.getBarycoord(Dn, qt, $t, Qt, p), h.barycoord = p;
2907
2907
  }
2908
2908
  }
2909
2909
  return h;
@@ -2916,13 +2916,13 @@ function qs(i, e, t, n, s, r, o) {
2916
2916
  let c = a + 0, u = a + 1, d = a + 2;
2917
2917
  const { index: h, groups: f } = i;
2918
2918
  i.index && (c = h.getX(c), u = h.getX(u), d = h.getX(d));
2919
- const { position: p, normal: g, uv: x, uv1: _ } = i.attributes;
2919
+ const { position: p, normal: y, uv: S, uv1: _ } = i.attributes;
2920
2920
  if (Array.isArray(e)) {
2921
- const b = n * 3;
2922
- for (let E = 0, S = f.length; E < S; E++) {
2921
+ const x = n * 3;
2922
+ for (let E = 0, b = f.length; E < b; E++) {
2923
2923
  const { start: T, count: A, materialIndex: P } = f[E];
2924
- if (b >= T && b < T + A) {
2925
- const I = jr(e[P]), M = Gr(t, p, g, x, _, c, u, d, I, r, o);
2924
+ if (x >= T && x < T + A) {
2925
+ const I = jr(e[P]), M = Gr(t, p, y, S, _, c, u, d, I, r, o);
2926
2926
  if (M)
2927
2927
  if (M.faceIndex = n, M.face.materialIndex = P, s)
2928
2928
  s.push(M);
@@ -2931,7 +2931,7 @@ function qs(i, e, t, n, s, r, o) {
2931
2931
  }
2932
2932
  }
2933
2933
  } else {
2934
- const b = jr(e), E = Gr(t, p, g, x, _, c, u, d, b, r, o);
2934
+ const x = jr(e), E = Gr(t, p, y, S, _, c, u, d, x, r, o);
2935
2935
  if (E)
2936
2936
  if (E.faceIndex = n, E.face.materialIndex = 0, s)
2937
2937
  s.push(E);
@@ -2975,36 +2975,36 @@ function ml(i, e = null) {
2975
2975
  const d = i._roots;
2976
2976
  for (let f = 0, p = d.length; f < p; f++)
2977
2977
  r = d[f], o = new Uint32Array(r), a = new Uint16Array(r), c = new Float32Array(r), h(0, u), u += r.byteLength;
2978
- function h(f, p, g = !1) {
2979
- const x = f * 2;
2980
- if (Ne(x, a)) {
2981
- const _ = $e(f, o), b = Qe(x, a);
2982
- let E = 1 / 0, S = 1 / 0, T = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
2983
- for (let M = 3 * _, O = 3 * (_ + b); M < O; M++) {
2978
+ function h(f, p, y = !1) {
2979
+ const S = f * 2;
2980
+ if (Ne(S, a)) {
2981
+ const _ = $e(f, o), x = Qe(S, a);
2982
+ let E = 1 / 0, b = 1 / 0, T = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
2983
+ for (let M = 3 * _, O = 3 * (_ + x); M < O; M++) {
2984
2984
  let C = n[M];
2985
2985
  const N = s.getX(C), D = s.getY(C), H = s.getZ(C);
2986
- N < E && (E = N), N > A && (A = N), D < S && (S = D), D > P && (P = D), H < T && (T = H), H > I && (I = H);
2986
+ N < E && (E = N), N > A && (A = N), D < b && (b = D), D > P && (P = D), H < T && (T = H), H > I && (I = H);
2987
2987
  }
2988
- return c[f + 0] !== E || c[f + 1] !== S || c[f + 2] !== T || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = E, c[f + 1] = S, c[f + 2] = T, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
2988
+ return c[f + 0] !== E || c[f + 1] !== b || c[f + 2] !== T || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = E, c[f + 1] = b, c[f + 2] = T, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
2989
2989
  } else {
2990
- const _ = ze(f), b = Be(f, o);
2991
- let E = g, S = !1, T = !1;
2990
+ const _ = ze(f), x = Be(f, o);
2991
+ let E = y, b = !1, T = !1;
2992
2992
  if (e) {
2993
2993
  if (!E) {
2994
- const C = _ / De + p / qe, N = b / De + p / qe;
2995
- S = e.has(C), T = e.has(N), E = !S && !T;
2994
+ const C = _ / De + p / qe, N = x / De + p / qe;
2995
+ b = e.has(C), T = e.has(N), E = !b && !T;
2996
2996
  }
2997
2997
  } else
2998
- S = !0, T = !0;
2999
- const A = E || S, P = E || T;
2998
+ b = !0, T = !0;
2999
+ const A = E || b, P = E || T;
3000
3000
  let I = !1;
3001
3001
  A && (I = h(_, p, E));
3002
3002
  let M = !1;
3003
- P && (M = h(b, p, E));
3003
+ P && (M = h(x, p, E));
3004
3004
  const O = I || M;
3005
3005
  if (O)
3006
3006
  for (let C = 0; C < 3; C++) {
3007
- const N = _ + C, D = b + C, H = c[N], j = c[N + 3], q = c[D], ie = c[D + 3];
3007
+ const N = _ + C, D = x + C, H = c[N], j = c[N + 3], q = c[D], ie = c[D + 3];
3008
3008
  c[f + C] = H < q ? H : q, c[f + C + 3] = j > ie ? j : ie;
3009
3009
  }
3010
3010
  return O;
@@ -3013,9 +3013,9 @@ function ml(i, e = null) {
3013
3013
  }
3014
3014
  function Kt(i, e, t, n, s) {
3015
3015
  let r, o, a, c, u, d;
3016
- const h = 1 / t.direction.x, f = 1 / t.direction.y, p = 1 / t.direction.z, g = t.origin.x, x = t.origin.y, _ = t.origin.z;
3017
- let b = e[i], E = e[i + 3], S = e[i + 1], T = e[i + 3 + 1], A = e[i + 2], P = e[i + 3 + 2];
3018
- return h >= 0 ? (r = (b - g) * h, o = (E - g) * h) : (r = (E - g) * h, o = (b - g) * h), f >= 0 ? (a = (S - x) * f, c = (T - x) * f) : (a = (T - x) * f, c = (S - x) * f), r > c || a > o || ((a > r || isNaN(r)) && (r = a), (c < o || isNaN(o)) && (o = c), p >= 0 ? (u = (A - _) * p, d = (P - _) * p) : (u = (P - _) * p, d = (A - _) * p), r > d || u > o) ? !1 : ((u > r || r !== r) && (r = u), (d < o || o !== o) && (o = d), r <= s && o >= n);
3016
+ const h = 1 / t.direction.x, f = 1 / t.direction.y, p = 1 / t.direction.z, y = t.origin.x, S = t.origin.y, _ = t.origin.z;
3017
+ let x = e[i], E = e[i + 3], b = e[i + 1], T = e[i + 3 + 1], A = e[i + 2], P = e[i + 3 + 2];
3018
+ 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 = (T - S) * f) : (a = (T - S) * f, c = (b - S) * f), r > c || a > o || ((a > r || isNaN(r)) && (r = a), (c < o || isNaN(o)) && (o = c), p >= 0 ? (u = (A - _) * p, d = (P - _) * p) : (u = (P - _) * p, d = (A - _) * p), r > d || u > o) ? !1 : ((u > r || r !== r) && (r = u), (d < o || o !== o) && (o = d), r <= s && o >= n);
3019
3019
  }
3020
3020
  function gl(i, e, t, n, s, r, o, a) {
3021
3021
  const { geometry: c, _indirectBuffer: u } = i;
@@ -3070,13 +3070,13 @@ function Di(i, e, t, n, s, r) {
3070
3070
  const h = $e(i, c), f = Qe(u, a);
3071
3071
  return fl(e, t, n, h, f, s, r);
3072
3072
  } else {
3073
- const h = rr(i, c), f = Tl[h], g = n.direction[f] >= 0;
3074
- let x, _;
3075
- g ? (x = ze(i), _ = Be(i, c)) : (x = Be(i, c), _ = ze(i));
3076
- const E = Kt(x, o, n, s, r) ? Di(x, e, t, n, s, r) : null;
3073
+ const h = rr(i, c), f = Tl[h], y = n.direction[f] >= 0;
3074
+ let S, _;
3075
+ y ? (S = ze(i), _ = Be(i, c)) : (S = Be(i, c), _ = ze(i));
3076
+ const E = Kt(S, o, n, s, r) ? Di(S, e, t, n, s, r) : null;
3077
3077
  if (E) {
3078
3078
  const A = E.point[f];
3079
- if (g ? A <= o[_ + h] : (
3079
+ if (y ? A <= o[_ + h] : (
3080
3080
  // min bounding data
3081
3081
  A >= o[_ + h + 3]
3082
3082
  ))
@@ -3086,7 +3086,7 @@ function Di(i, e, t, n, s, r) {
3086
3086
  return E && T ? E.distance <= T.distance ? E : T : E || T || null;
3087
3087
  }
3088
3088
  }
3089
- const Ss = /* @__PURE__ */ new _t(), dn = /* @__PURE__ */ new Tt(), fn = /* @__PURE__ */ new Tt(), Dn = /* @__PURE__ */ new ut(), Vr = /* @__PURE__ */ new Je(), bs = /* @__PURE__ */ new Je();
3089
+ const Ss = /* @__PURE__ */ new _t(), dn = /* @__PURE__ */ new Tt(), fn = /* @__PURE__ */ new Tt(), Nn = /* @__PURE__ */ new ut(), Vr = /* @__PURE__ */ new Je(), bs = /* @__PURE__ */ new Je();
3090
3090
  function Sl(i, e, t, n) {
3091
3091
  be.setBuffer(i._roots[e]);
3092
3092
  const s = Ni(0, i, t, n);
@@ -3096,24 +3096,24 @@ function Ni(i, e, t, n, s = null) {
3096
3096
  const { float32Array: r, uint16Array: o, uint32Array: a } = be;
3097
3097
  let c = i * 2;
3098
3098
  if (s === null && (t.boundingBox || t.computeBoundingBox(), Vr.set(t.boundingBox.min, t.boundingBox.max, n), s = Vr), Ne(c, o)) {
3099
- const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, g = t.attributes.position, x = $e(i, a), _ = Qe(c, o);
3100
- if (Dn.copy(n).invert(), t.boundsTree)
3101
- return Ae(i, r, bs), bs.matrix.copy(Dn), bs.needsUpdate = !0, t.boundsTree.shapecast({
3099
+ const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, S = $e(i, a), _ = Qe(c, o);
3100
+ if (Nn.copy(n).invert(), t.boundsTree)
3101
+ return Ae(i, r, bs), bs.matrix.copy(Nn), bs.needsUpdate = !0, t.boundsTree.shapecast({
3102
3102
  intersectsBounds: (E) => bs.intersectsBox(E),
3103
3103
  intersectsTriangle: (E) => {
3104
3104
  E.a.applyMatrix4(n), E.b.applyMatrix4(n), E.c.applyMatrix4(n), E.needsUpdate = !0;
3105
- for (let S = x * 3, T = (_ + x) * 3; S < T; S += 3)
3106
- if (Ce(fn, S, h, f), fn.needsUpdate = !0, E.intersectsTriangle(fn))
3105
+ for (let b = S * 3, T = (_ + S) * 3; b < T; b += 3)
3106
+ if (Ce(fn, b, h, f), fn.needsUpdate = !0, E.intersectsTriangle(fn))
3107
3107
  return !0;
3108
3108
  return !1;
3109
3109
  }
3110
3110
  });
3111
3111
  {
3112
- const b = Ys(t);
3113
- for (let E = x * 3, S = (_ + x) * 3; E < S; E += 3) {
3114
- Ce(dn, E, h, f), dn.a.applyMatrix4(Dn), dn.b.applyMatrix4(Dn), dn.c.applyMatrix4(Dn), dn.needsUpdate = !0;
3115
- for (let T = 0, A = b * 3; T < A; T += 3)
3116
- if (Ce(fn, T, p, g), fn.needsUpdate = !0, dn.intersectsTriangle(fn))
3112
+ const x = Ys(t);
3113
+ for (let E = S * 3, b = (_ + S) * 3; E < b; E += 3) {
3114
+ Ce(dn, E, h, f), dn.a.applyMatrix4(Nn), dn.b.applyMatrix4(Nn), dn.c.applyMatrix4(Nn), dn.needsUpdate = !0;
3115
+ for (let T = 0, A = x * 3; T < A; T += 3)
3116
+ if (Ce(fn, T, p, y), fn.needsUpdate = !0, dn.intersectsTriangle(fn))
3117
3117
  return !0;
3118
3118
  }
3119
3119
  }
@@ -3122,29 +3122,29 @@ function Ni(i, e, t, n, s = null) {
3122
3122
  return Ae(d, r, Ss), !!(s.intersectsBox(Ss) && Ni(d, e, t, n, s) || (Ae(h, r, Ss), s.intersectsBox(Ss) && Ni(h, e, t, n, s)));
3123
3123
  }
3124
3124
  }
3125
- const xs = /* @__PURE__ */ new ut(), hi = /* @__PURE__ */ new Je(), Nn = /* @__PURE__ */ new Je(), bl = /* @__PURE__ */ new $(), xl = /* @__PURE__ */ new $(), Al = /* @__PURE__ */ new $(), vl = /* @__PURE__ */ new $();
3125
+ const xs = /* @__PURE__ */ new ut(), hi = /* @__PURE__ */ new Je(), kn = /* @__PURE__ */ new Je(), bl = /* @__PURE__ */ new $(), xl = /* @__PURE__ */ new $(), Al = /* @__PURE__ */ new $(), vl = /* @__PURE__ */ new $();
3126
3126
  function Rl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3127
3127
  e.boundingBox || e.computeBoundingBox(), hi.set(e.boundingBox.min, e.boundingBox.max, t), hi.needsUpdate = !0;
3128
- const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = lt.getPrimitive(), p = lt.getPrimitive();
3129
- let g = bl, x = xl, _ = null, b = null;
3130
- s && (_ = Al, b = vl);
3131
- let E = 1 / 0, S = null, T = null;
3132
- return xs.copy(t).invert(), Nn.matrix.copy(xs), i.shapecast(
3128
+ const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = ht.getPrimitive(), p = ht.getPrimitive();
3129
+ let y = bl, S = xl, _ = null, x = null;
3130
+ s && (_ = Al, x = vl);
3131
+ let E = 1 / 0, b = null, T = null;
3132
+ return xs.copy(t).invert(), kn.matrix.copy(xs), i.shapecast(
3133
3133
  {
3134
3134
  boundsTraverseOrder: (A) => hi.distanceToBox(A),
3135
- intersectsBounds: (A, P, I) => I < E && I < o ? (P && (Nn.min.copy(A.min), Nn.max.copy(A.max), Nn.needsUpdate = !0), !0) : !1,
3135
+ intersectsBounds: (A, P, I) => I < E && I < o ? (P && (kn.min.copy(A.min), kn.max.copy(A.max), kn.needsUpdate = !0), !0) : !1,
3136
3136
  intersectsRange: (A, P) => {
3137
3137
  if (e.boundsTree)
3138
3138
  return e.boundsTree.shapecast({
3139
- boundsTraverseOrder: (M) => Nn.distanceToBox(M),
3139
+ boundsTraverseOrder: (M) => kn.distanceToBox(M),
3140
3140
  intersectsBounds: (M, O, C) => C < E && C < o,
3141
3141
  intersectsRange: (M, O) => {
3142
3142
  for (let C = M, N = M + O; C < N; C++) {
3143
3143
  Ce(p, 3 * C, h, d), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
3144
3144
  for (let D = A, H = A + P; D < H; D++) {
3145
3145
  Ce(f, 3 * D, u, c), f.needsUpdate = !0;
3146
- const j = f.distanceToTriangle(p, g, _);
3147
- if (j < E && (x.copy(g), b && b.copy(_), E = j, S = D, T = C), j < r)
3146
+ const j = f.distanceToTriangle(p, y, _);
3147
+ if (j < E && (S.copy(y), x && x.copy(_), E = j, b = D, T = C), j < r)
3148
3148
  return !0;
3149
3149
  }
3150
3150
  }
@@ -3156,15 +3156,15 @@ function Rl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3156
3156
  Ce(p, 3 * M, h, d), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
3157
3157
  for (let C = A, N = A + P; C < N; C++) {
3158
3158
  Ce(f, 3 * C, u, c), f.needsUpdate = !0;
3159
- const D = f.distanceToTriangle(p, g, _);
3160
- if (D < E && (x.copy(g), b && b.copy(_), E = D, S = C, T = M), D < r)
3159
+ const D = f.distanceToTriangle(p, y, _);
3160
+ if (D < E && (S.copy(y), x && x.copy(_), E = D, b = C, T = M), D < r)
3161
3161
  return !0;
3162
3162
  }
3163
3163
  }
3164
3164
  }
3165
3165
  }
3166
3166
  }
3167
- ), lt.releasePrimitive(f), lt.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(x) : n.point = x.clone(), n.distance = E, n.faceIndex = S, s && (s.point ? s.point.copy(b) : s.point = b.clone(), s.point.applyMatrix4(xs), x.applyMatrix4(xs), s.distance = x.sub(s.point).length(), s.faceIndex = T), n);
3167
+ ), ht.releasePrimitive(f), ht.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(xs), S.applyMatrix4(xs), s.distance = S.sub(s.point).length(), s.faceIndex = T), n);
3168
3168
  }
3169
3169
  function Ml(i, e = null) {
3170
3170
  e && Array.isArray(e) && (e = new Set(e));
@@ -3173,40 +3173,40 @@ function Ml(i, e = null) {
3173
3173
  const d = i._roots;
3174
3174
  for (let f = 0, p = d.length; f < p; f++)
3175
3175
  r = d[f], o = new Uint32Array(r), a = new Uint16Array(r), c = new Float32Array(r), h(0, u), u += r.byteLength;
3176
- function h(f, p, g = !1) {
3177
- const x = f * 2;
3178
- if (Ne(x, a)) {
3179
- const _ = $e(f, o), b = Qe(x, a);
3180
- let E = 1 / 0, S = 1 / 0, T = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
3181
- for (let M = _, O = _ + b; M < O; M++) {
3176
+ function h(f, p, y = !1) {
3177
+ const S = f * 2;
3178
+ if (Ne(S, a)) {
3179
+ const _ = $e(f, o), x = Qe(S, a);
3180
+ let E = 1 / 0, b = 1 / 0, T = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
3181
+ for (let M = _, O = _ + x; M < O; M++) {
3182
3182
  const C = 3 * i.resolveTriangleIndex(M);
3183
3183
  for (let N = 0; N < 3; N++) {
3184
3184
  let D = C + N;
3185
3185
  D = n ? n[D] : D;
3186
3186
  const H = s.getX(D), j = s.getY(D), q = s.getZ(D);
3187
- H < E && (E = H), H > A && (A = H), j < S && (S = j), j > P && (P = j), q < T && (T = q), q > I && (I = q);
3187
+ H < E && (E = H), H > A && (A = H), j < b && (b = j), j > P && (P = j), q < T && (T = q), q > I && (I = q);
3188
3188
  }
3189
3189
  }
3190
- return c[f + 0] !== E || c[f + 1] !== S || c[f + 2] !== T || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = E, c[f + 1] = S, c[f + 2] = T, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
3190
+ return c[f + 0] !== E || c[f + 1] !== b || c[f + 2] !== T || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = E, c[f + 1] = b, c[f + 2] = T, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
3191
3191
  } else {
3192
- const _ = ze(f), b = Be(f, o);
3193
- let E = g, S = !1, T = !1;
3192
+ const _ = ze(f), x = Be(f, o);
3193
+ let E = y, b = !1, T = !1;
3194
3194
  if (e) {
3195
3195
  if (!E) {
3196
- const C = _ / De + p / qe, N = b / De + p / qe;
3197
- S = e.has(C), T = e.has(N), E = !S && !T;
3196
+ const C = _ / De + p / qe, N = x / De + p / qe;
3197
+ b = e.has(C), T = e.has(N), E = !b && !T;
3198
3198
  }
3199
3199
  } else
3200
- S = !0, T = !0;
3201
- const A = E || S, P = E || T;
3200
+ b = !0, T = !0;
3201
+ const A = E || b, P = E || T;
3202
3202
  let I = !1;
3203
3203
  A && (I = h(_, p, E));
3204
3204
  let M = !1;
3205
- P && (M = h(b, p, E));
3205
+ P && (M = h(x, p, E));
3206
3206
  const O = I || M;
3207
3207
  if (O)
3208
3208
  for (let C = 0; C < 3; C++) {
3209
- const N = _ + C, D = b + C, H = c[N], j = c[N + 3], q = c[D], ie = c[D + 3];
3209
+ const N = _ + C, D = x + C, H = c[N], j = c[N + 3], q = c[D], ie = c[D + 3];
3210
3210
  c[f + C] = H < q ? H : q, c[f + C + 3] = j > ie ? j : ie;
3211
3211
  }
3212
3212
  return O;
@@ -3241,13 +3241,13 @@ function Fi(i, e, t, n, s, r) {
3241
3241
  const h = $e(i, c), f = Qe(u, a);
3242
3242
  return yl(e, t, n, h, f, s, r);
3243
3243
  } else {
3244
- const h = rr(i, c), f = Cl[h], g = n.direction[f] >= 0;
3245
- let x, _;
3246
- g ? (x = ze(i), _ = Be(i, c)) : (x = Be(i, c), _ = ze(i));
3247
- const E = Kt(x, o, n, s, r) ? Fi(x, e, t, n, s, r) : null;
3244
+ const h = rr(i, c), f = Cl[h], y = n.direction[f] >= 0;
3245
+ let S, _;
3246
+ y ? (S = ze(i), _ = Be(i, c)) : (S = Be(i, c), _ = ze(i));
3247
+ const E = Kt(S, o, n, s, r) ? Fi(S, e, t, n, s, r) : null;
3248
3248
  if (E) {
3249
3249
  const A = E.point[f];
3250
- if (g ? A <= o[_ + h] : (
3250
+ if (y ? A <= o[_ + h] : (
3251
3251
  // min bounding data
3252
3252
  A >= o[_ + h + 3]
3253
3253
  ))
@@ -3257,7 +3257,7 @@ function Fi(i, e, t, n, s, r) {
3257
3257
  return E && T ? E.distance <= T.distance ? E : T : E || T || null;
3258
3258
  }
3259
3259
  }
3260
- const As = /* @__PURE__ */ new _t(), pn = /* @__PURE__ */ new Tt(), mn = /* @__PURE__ */ new Tt(), kn = /* @__PURE__ */ new ut(), Wr = /* @__PURE__ */ new Je(), vs = /* @__PURE__ */ new Je();
3260
+ const As = /* @__PURE__ */ new _t(), pn = /* @__PURE__ */ new Tt(), mn = /* @__PURE__ */ new Tt(), Fn = /* @__PURE__ */ new ut(), Wr = /* @__PURE__ */ new Je(), vs = /* @__PURE__ */ new Je();
3261
3261
  function Ll(i, e, t, n) {
3262
3262
  be.setBuffer(i._roots[e]);
3263
3263
  const s = zi(0, i, t, n);
@@ -3267,25 +3267,25 @@ function zi(i, e, t, n, s = null) {
3267
3267
  const { float32Array: r, uint16Array: o, uint32Array: a } = be;
3268
3268
  let c = i * 2;
3269
3269
  if (s === null && (t.boundingBox || t.computeBoundingBox(), Wr.set(t.boundingBox.min, t.boundingBox.max, n), s = Wr), Ne(c, o)) {
3270
- const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, g = t.attributes.position, x = $e(i, a), _ = Qe(c, o);
3271
- if (kn.copy(n).invert(), t.boundsTree)
3272
- return Ae(i, r, vs), vs.matrix.copy(kn), vs.needsUpdate = !0, t.boundsTree.shapecast({
3270
+ const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, S = $e(i, a), _ = Qe(c, o);
3271
+ if (Fn.copy(n).invert(), t.boundsTree)
3272
+ return Ae(i, r, vs), vs.matrix.copy(Fn), vs.needsUpdate = !0, t.boundsTree.shapecast({
3273
3273
  intersectsBounds: (E) => vs.intersectsBox(E),
3274
3274
  intersectsTriangle: (E) => {
3275
3275
  E.a.applyMatrix4(n), E.b.applyMatrix4(n), E.c.applyMatrix4(n), E.needsUpdate = !0;
3276
- for (let S = x, T = _ + x; S < T; S++)
3277
- if (Ce(mn, 3 * e.resolveTriangleIndex(S), h, f), mn.needsUpdate = !0, E.intersectsTriangle(mn))
3276
+ for (let b = S, T = _ + S; b < T; b++)
3277
+ if (Ce(mn, 3 * e.resolveTriangleIndex(b), h, f), mn.needsUpdate = !0, E.intersectsTriangle(mn))
3278
3278
  return !0;
3279
3279
  return !1;
3280
3280
  }
3281
3281
  });
3282
3282
  {
3283
- const b = Ys(t);
3284
- for (let E = x, S = _ + x; E < S; E++) {
3283
+ const x = Ys(t);
3284
+ for (let E = S, b = _ + S; E < b; E++) {
3285
3285
  const T = e.resolveTriangleIndex(E);
3286
- Ce(pn, 3 * T, h, f), pn.a.applyMatrix4(kn), pn.b.applyMatrix4(kn), pn.c.applyMatrix4(kn), pn.needsUpdate = !0;
3287
- for (let A = 0, P = b * 3; A < P; A += 3)
3288
- if (Ce(mn, A, p, g), mn.needsUpdate = !0, pn.intersectsTriangle(mn))
3286
+ Ce(pn, 3 * T, h, f), pn.a.applyMatrix4(Fn), pn.b.applyMatrix4(Fn), pn.c.applyMatrix4(Fn), pn.needsUpdate = !0;
3287
+ for (let A = 0, P = x * 3; A < P; A += 3)
3288
+ if (Ce(mn, A, p, y), mn.needsUpdate = !0, pn.intersectsTriangle(mn))
3289
3289
  return !0;
3290
3290
  }
3291
3291
  }
@@ -3294,22 +3294,22 @@ function zi(i, e, t, n, s = null) {
3294
3294
  return Ae(d, r, As), !!(s.intersectsBox(As) && zi(d, e, t, n, s) || (Ae(h, r, As), s.intersectsBox(As) && zi(h, e, t, n, s)));
3295
3295
  }
3296
3296
  }
3297
- const Rs = /* @__PURE__ */ new ut(), ui = /* @__PURE__ */ new Je(), Fn = /* @__PURE__ */ new Je(), Ol = /* @__PURE__ */ new $(), Dl = /* @__PURE__ */ new $(), Nl = /* @__PURE__ */ new $(), kl = /* @__PURE__ */ new $();
3297
+ const Rs = /* @__PURE__ */ new ut(), ui = /* @__PURE__ */ new Je(), zn = /* @__PURE__ */ new Je(), Ol = /* @__PURE__ */ new $(), Dl = /* @__PURE__ */ new $(), Nl = /* @__PURE__ */ new $(), kl = /* @__PURE__ */ new $();
3298
3298
  function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3299
3299
  e.boundingBox || e.computeBoundingBox(), ui.set(e.boundingBox.min, e.boundingBox.max, t), ui.needsUpdate = !0;
3300
- const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = lt.getPrimitive(), p = lt.getPrimitive();
3301
- let g = Ol, x = Dl, _ = null, b = null;
3302
- s && (_ = Nl, b = kl);
3303
- let E = 1 / 0, S = null, T = null;
3304
- return Rs.copy(t).invert(), Fn.matrix.copy(Rs), i.shapecast(
3300
+ const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = ht.getPrimitive(), p = ht.getPrimitive();
3301
+ let y = Ol, S = Dl, _ = null, x = null;
3302
+ s && (_ = Nl, x = kl);
3303
+ let E = 1 / 0, b = null, T = null;
3304
+ return Rs.copy(t).invert(), zn.matrix.copy(Rs), i.shapecast(
3305
3305
  {
3306
3306
  boundsTraverseOrder: (A) => ui.distanceToBox(A),
3307
- intersectsBounds: (A, P, I) => I < E && I < o ? (P && (Fn.min.copy(A.min), Fn.max.copy(A.max), Fn.needsUpdate = !0), !0) : !1,
3307
+ intersectsBounds: (A, P, I) => I < E && I < o ? (P && (zn.min.copy(A.min), zn.max.copy(A.max), zn.needsUpdate = !0), !0) : !1,
3308
3308
  intersectsRange: (A, P) => {
3309
3309
  if (e.boundsTree) {
3310
3310
  const I = e.boundsTree;
3311
3311
  return I.shapecast({
3312
- boundsTraverseOrder: (M) => Fn.distanceToBox(M),
3312
+ boundsTraverseOrder: (M) => zn.distanceToBox(M),
3313
3313
  intersectsBounds: (M, O, C) => C < E && C < o,
3314
3314
  intersectsRange: (M, O) => {
3315
3315
  for (let C = M, N = M + O; C < N; C++) {
@@ -3318,8 +3318,8 @@ function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3318
3318
  for (let H = A, j = A + P; H < j; H++) {
3319
3319
  const q = i.resolveTriangleIndex(H);
3320
3320
  Ce(f, 3 * q, u, c), f.needsUpdate = !0;
3321
- const ie = f.distanceToTriangle(p, g, _);
3322
- if (ie < E && (x.copy(g), b && b.copy(_), E = ie, S = H, T = C), ie < r)
3321
+ const ie = f.distanceToTriangle(p, y, _);
3322
+ if (ie < E && (S.copy(y), x && x.copy(_), E = ie, b = H, T = C), ie < r)
3323
3323
  return !0;
3324
3324
  }
3325
3325
  }
@@ -3332,15 +3332,15 @@ function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3332
3332
  for (let C = A, N = A + P; C < N; C++) {
3333
3333
  const D = i.resolveTriangleIndex(C);
3334
3334
  Ce(f, 3 * D, u, c), f.needsUpdate = !0;
3335
- const H = f.distanceToTriangle(p, g, _);
3336
- if (H < E && (x.copy(g), b && b.copy(_), E = H, S = C, T = M), H < r)
3335
+ const H = f.distanceToTriangle(p, y, _);
3336
+ if (H < E && (S.copy(y), x && x.copy(_), E = H, b = C, T = M), H < r)
3337
3337
  return !0;
3338
3338
  }
3339
3339
  }
3340
3340
  }
3341
3341
  }
3342
3342
  }
3343
- ), lt.releasePrimitive(f), lt.releasePrimitive(p), E === 1 / 0 ? null : (n.point ? n.point.copy(x) : n.point = x.clone(), n.distance = E, n.faceIndex = S, s && (s.point ? s.point.copy(b) : s.point = b.clone(), s.point.applyMatrix4(Rs), x.applyMatrix4(Rs), s.distance = x.sub(s.point).length(), s.faceIndex = T), n);
3343
+ ), ht.releasePrimitive(f), ht.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(Rs), S.applyMatrix4(Rs), s.distance = S.sub(s.point).length(), s.faceIndex = T), n);
3344
3344
  }
3345
3345
  function Zr(i, e, t) {
3346
3346
  return i === null ? null : (i.point.applyMatrix4(e.matrixWorld), i.distance = i.point.distanceTo(t.ray.origin), i.object = e, i);
@@ -3403,7 +3403,7 @@ class Ws extends il {
3403
3403
  if (a._roots = r, a._indirectBuffer = o || null, n.setIndex) {
3404
3404
  const u = t.getIndex();
3405
3405
  if (u === null) {
3406
- const d = new jn(e.index, 1, !1);
3406
+ const d = new Vn(e.index, 1, !1);
3407
3407
  t.setIndex(d);
3408
3408
  } else u.array !== s && (u.array.set(s), u.needsUpdate = !0);
3409
3409
  }
@@ -3411,9 +3411,9 @@ class Ws extends il {
3411
3411
  function c(u) {
3412
3412
  for (let d = 0; d < u.length; d++) {
3413
3413
  const h = u[d], f = new Uint32Array(h), p = new Uint16Array(h);
3414
- for (let g = 0, x = h.byteLength / qe; g < x; g++) {
3415
- const _ = De * g, b = 2 * _;
3416
- Ne(b, p) || (f[_ + 6] = f[_ + 6] / De - g);
3414
+ for (let y = 0, S = h.byteLength / qe; y < S; y++) {
3415
+ const _ = De * y, x = 2 * _;
3416
+ Ne(x, p) || (f[_ + 6] = f[_ + 6] / De - y);
3417
3417
  }
3418
3418
  }
3419
3419
  }
@@ -3457,11 +3457,11 @@ class Ws extends il {
3457
3457
  let d = u + 0, h = u + 1, f = u + 2;
3458
3458
  a && (d = a[d], h = a[h], f = a[f]);
3459
3459
  for (let p = 0; p < 3; p++) {
3460
- const g = o[di[p]](d), x = o[di[p]](h), _ = o[di[p]](f);
3461
- let b = g;
3462
- x < b && (b = x), _ < b && (b = _);
3463
- let E = g;
3464
- x > E && (E = x), _ > E && (E = _), t[n + p] = b, t[n + p + 3] = E;
3460
+ const y = o[di[p]](d), S = o[di[p]](h), _ = o[di[p]](f);
3461
+ let x = y;
3462
+ S < x && (x = S), _ < x && (x = _);
3463
+ let E = y;
3464
+ S > E && (E = S), _ > E && (E = _), t[n + p] = x, t[n + p + 3] = E;
3465
3465
  }
3466
3466
  return t;
3467
3467
  }
@@ -3477,13 +3477,13 @@ class Ws extends il {
3477
3477
  let h = 3;
3478
3478
  o.isInterleavedBufferAttribute && (h = o.data.stride);
3479
3479
  const f = ["getX", "getY", "getZ"], p = n.offset;
3480
- for (let g = e, x = e + t; g < x; g++) {
3481
- const b = (r ? r[g] : g) * 3, E = (g - p) * 6;
3482
- let S = b + 0, T = b + 1, A = b + 2;
3483
- a && (S = a[S], T = a[T], A = a[A]), c || (S = S * h + d, T = T * h + d, A = A * h + d);
3480
+ for (let y = e, S = e + t; y < S; y++) {
3481
+ const x = (r ? r[y] : y) * 3, E = (y - p) * 6;
3482
+ let b = x + 0, T = x + 1, A = x + 2;
3483
+ a && (b = a[b], T = a[T], A = a[A]), c || (b = b * h + d, T = T * h + d, A = A * h + d);
3484
3484
  for (let P = 0; P < 3; P++) {
3485
3485
  let I, M, O;
3486
- c ? (I = o[f[P]](S), M = o[f[P]](T), O = o[f[P]](A)) : (I = u[S + P], M = u[T + P], O = u[A + P]);
3486
+ c ? (I = o[f[P]](b), M = o[f[P]](T), O = o[f[P]](A)) : (I = u[b + P], M = u[T + P], O = u[A + P]);
3487
3487
  let C = I;
3488
3488
  M < C && (C = M), O < C && (C = O);
3489
3489
  let N = I;
@@ -3612,7 +3612,7 @@ class Ws extends il {
3612
3612
  * @returns {boolean}
3613
3613
  */
3614
3614
  shapecast(e) {
3615
- const t = lt.getPrimitive(), n = super.shapecast(
3615
+ const t = ht.getPrimitive(), n = super.shapecast(
3616
3616
  {
3617
3617
  ...e,
3618
3618
  intersectsPrimitive: e.intersectsTriangle,
@@ -3622,7 +3622,7 @@ class Ws extends il {
3622
3622
  iterate: this.indirect ? wl : pl
3623
3623
  }
3624
3624
  );
3625
- return lt.releasePrimitive(t), n;
3625
+ return ht.releasePrimitive(t), n;
3626
3626
  }
3627
3627
  /**
3628
3628
  * A generalized cast function that traverses two BVH structures simultaneously to perform
@@ -3645,36 +3645,36 @@ class Ws extends il {
3645
3645
  intersectsRanges: s,
3646
3646
  intersectsTriangles: r
3647
3647
  } = n;
3648
- const o = lt.getPrimitive(), a = this.geometry.index, c = this.geometry.attributes.position, u = this.indirect ? (g) => {
3649
- const x = this.resolveTriangleIndex(g);
3650
- Ce(o, x * 3, a, c);
3651
- } : (g) => {
3652
- Ce(o, g * 3, a, c);
3653
- }, d = lt.getPrimitive(), h = e.geometry.index, f = e.geometry.attributes.position, p = e.indirect ? (g) => {
3654
- const x = e.resolveTriangleIndex(g);
3655
- Ce(d, x * 3, h, f);
3656
- } : (g) => {
3657
- Ce(d, g * 3, h, f);
3648
+ const o = ht.getPrimitive(), a = this.geometry.index, c = this.geometry.attributes.position, u = this.indirect ? (y) => {
3649
+ const S = this.resolveTriangleIndex(y);
3650
+ Ce(o, S * 3, a, c);
3651
+ } : (y) => {
3652
+ Ce(o, y * 3, a, c);
3653
+ }, d = ht.getPrimitive(), h = e.geometry.index, f = e.geometry.attributes.position, p = e.indirect ? (y) => {
3654
+ const S = e.resolveTriangleIndex(y);
3655
+ Ce(d, S * 3, h, f);
3656
+ } : (y) => {
3657
+ Ce(d, y * 3, h, f);
3658
3658
  };
3659
3659
  if (r) {
3660
3660
  if (!(e instanceof Ws))
3661
3661
  throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');
3662
- const g = (x, _, b, E, S, T, A, P) => {
3663
- for (let I = b, M = b + E; I < M; I++) {
3662
+ const y = (S, _, x, E, b, T, A, P) => {
3663
+ for (let I = x, M = x + E; I < M; I++) {
3664
3664
  p(I), d.a.applyMatrix4(t), d.b.applyMatrix4(t), d.c.applyMatrix4(t), d.needsUpdate = !0;
3665
- for (let O = x, C = x + _; O < C; O++)
3666
- if (u(O), o.needsUpdate = !0, r(o, d, O, I, S, T, A, P))
3665
+ for (let O = S, C = S + _; O < C; O++)
3666
+ if (u(O), o.needsUpdate = !0, r(o, d, O, I, b, T, A, P))
3667
3667
  return !0;
3668
3668
  }
3669
3669
  return !1;
3670
3670
  };
3671
3671
  if (s) {
3672
- const x = s;
3673
- s = function(_, b, E, S, T, A, P, I) {
3674
- return x(_, b, E, S, T, A, P, I) ? !0 : g(_, b, E, S, T, A, P, I);
3672
+ const S = s;
3673
+ s = function(_, x, E, b, T, A, P, I) {
3674
+ return S(_, x, E, b, T, A, P, I) ? !0 : y(_, x, E, b, T, A, P, I);
3675
3675
  };
3676
3676
  } else
3677
- s = g;
3677
+ s = y;
3678
3678
  }
3679
3679
  return super.bvhcast(e, t, { intersectsRanges: s });
3680
3680
  }
@@ -4470,10 +4470,10 @@ class Vl extends $a {
4470
4470
  if (this.resourcePath !== "")
4471
4471
  o = this.resourcePath;
4472
4472
  else if (this.path !== "") {
4473
- const u = Vn.extractUrlBase(e);
4474
- o = Vn.resolveURL(u, this.path);
4473
+ const u = Wn.extractUrlBase(e);
4474
+ o = Wn.resolveURL(u, this.path);
4475
4475
  } else
4476
- o = Vn.extractUrlBase(e);
4476
+ o = Wn.extractUrlBase(e);
4477
4477
  this.manager.itemStart(e);
4478
4478
  const a = function(u) {
4479
4479
  s ? s(u) : console.error(u), r.manager.itemError(e), r.manager.itemEnd(e);
@@ -4715,7 +4715,7 @@ class Kl {
4715
4715
  this.name = ce.KHR_MATERIALS_UNLIT;
4716
4716
  }
4717
4717
  getMaterialType() {
4718
- return Hn;
4718
+ return Gn;
4719
4719
  }
4720
4720
  extendParams(e, t, n) {
4721
4721
  const s = [];
@@ -4975,33 +4975,33 @@ class ch {
4975
4975
  return null;
4976
4976
  const s = t.meshes[n.mesh];
4977
4977
  for (const u of s.primitives)
4978
- if (u.mode !== at.TRIANGLES && u.mode !== at.TRIANGLE_STRIP && u.mode !== at.TRIANGLE_FAN && u.mode !== void 0)
4978
+ if (u.mode !== ct.TRIANGLES && u.mode !== ct.TRIANGLE_STRIP && u.mode !== ct.TRIANGLE_FAN && u.mode !== void 0)
4979
4979
  return null;
4980
4980
  const o = n.extensions[this.name].attributes, a = [], c = {};
4981
4981
  for (const u in o)
4982
4982
  a.push(this.parser.getDependency("accessor", o[u]).then((d) => (c[u] = d, c[u])));
4983
4983
  return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((u) => {
4984
4984
  const d = u.pop(), h = d.isGroup ? d.children : [d], f = u[0].count, p = [];
4985
- for (const g of h) {
4986
- const x = new ut(), _ = new $(), b = new An(), E = new $(1, 1, 1), S = new Ao(g.geometry, g.material, f);
4985
+ for (const y of h) {
4986
+ const S = new ut(), _ = new $(), x = new vn(), E = new $(1, 1, 1), b = new Ao(y.geometry, y.material, f);
4987
4987
  for (let T = 0; T < f; T++)
4988
- c.TRANSLATION && _.fromBufferAttribute(c.TRANSLATION, T), c.ROTATION && b.fromBufferAttribute(c.ROTATION, T), c.SCALE && E.fromBufferAttribute(c.SCALE, T), S.setMatrixAt(T, x.compose(_, b, E));
4988
+ c.TRANSLATION && _.fromBufferAttribute(c.TRANSLATION, T), c.ROTATION && x.fromBufferAttribute(c.ROTATION, T), c.SCALE && E.fromBufferAttribute(c.SCALE, T), b.setMatrixAt(T, S.compose(_, x, E));
4989
4989
  for (const T in c)
4990
4990
  if (T === "_COLOR_0") {
4991
4991
  const A = c[T];
4992
- S.instanceColor = new ec(A.array, A.itemSize, A.normalized);
4993
- } else T !== "TRANSLATION" && T !== "ROTATION" && T !== "SCALE" && g.geometry.setAttribute(T, c[T]);
4994
- er.prototype.copy.call(S, g), this.parser.assignFinalMaterial(S), p.push(S);
4992
+ b.instanceColor = new ec(A.array, A.itemSize, A.normalized);
4993
+ } else T !== "TRANSLATION" && T !== "ROTATION" && T !== "SCALE" && y.geometry.setAttribute(T, c[T]);
4994
+ er.prototype.copy.call(b, y), this.parser.assignFinalMaterial(b), p.push(b);
4995
4995
  }
4996
4996
  return d.isGroup ? (d.clear(), d.add(...p), d) : p[0];
4997
4997
  }));
4998
4998
  }
4999
4999
  }
5000
- const Go = "glTF", zn = 12, eo = { JSON: 1313821514, BIN: 5130562 };
5000
+ const Go = "glTF", Bn = 12, eo = { JSON: 1313821514, BIN: 5130562 };
5001
5001
  class lh {
5002
5002
  constructor(e) {
5003
5003
  this.name = ce.KHR_BINARY_GLTF, this.content = null, this.body = null;
5004
- const t = new DataView(e, 0, zn), n = new TextDecoder();
5004
+ const t = new DataView(e, 0, Bn), n = new TextDecoder();
5005
5005
  if (this.header = {
5006
5006
  magic: n.decode(new Uint8Array(e.slice(0, 4))),
5007
5007
  version: t.getUint32(4, !0),
@@ -5010,17 +5010,17 @@ class lh {
5010
5010
  throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
5011
5011
  if (this.header.version < 2)
5012
5012
  throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
5013
- const s = this.header.length - zn, r = new DataView(e, zn);
5013
+ const s = this.header.length - Bn, r = new DataView(e, Bn);
5014
5014
  let o = 0;
5015
5015
  for (; o < s; ) {
5016
5016
  const a = r.getUint32(o, !0);
5017
5017
  o += 4;
5018
5018
  const c = r.getUint32(o, !0);
5019
5019
  if (o += 4, c === eo.JSON) {
5020
- const u = new Uint8Array(e, zn + o, a);
5020
+ const u = new Uint8Array(e, Bn + o, a);
5021
5021
  this.content = n.decode(u);
5022
5022
  } else if (c === eo.BIN) {
5023
- const u = zn + o;
5023
+ const u = Bn + o;
5024
5024
  this.body = e.slice(u, u + a);
5025
5025
  }
5026
5026
  o += a;
@@ -5051,9 +5051,9 @@ class hh {
5051
5051
  return t.getDependency("bufferView", r).then(function(d) {
5052
5052
  return new Promise(function(h, f) {
5053
5053
  s.decodeDracoFile(d, function(p) {
5054
- for (const g in p.attributes) {
5055
- const x = p.attributes[g], _ = c[g];
5056
- _ !== void 0 && (x.normalized = _);
5054
+ for (const y in p.attributes) {
5055
+ const S = p.attributes[y], _ = c[y];
5056
+ _ !== void 0 && (S.normalized = _);
5057
5057
  }
5058
5058
  h(p);
5059
5059
  }, a, u, je, f);
@@ -5085,22 +5085,22 @@ class jo extends _c {
5085
5085
  return t;
5086
5086
  }
5087
5087
  interpolate_(e, t, n, s) {
5088
- const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = a * 2, u = a * 3, d = s - t, h = (n - t) / d, f = h * h, p = f * h, g = e * u, x = g - u, _ = -2 * p + 3 * f, b = p - f, E = 1 - _, S = b - f + h;
5088
+ const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = a * 2, u = a * 3, d = s - t, h = (n - t) / d, f = h * h, p = f * h, y = e * u, S = y - u, _ = -2 * p + 3 * f, x = p - f, E = 1 - _, b = x - f + h;
5089
5089
  for (let T = 0; T !== a; T++) {
5090
- const A = o[x + T + a], P = o[x + T + c] * d, I = o[g + T + a], M = o[g + T] * d;
5091
- r[T] = E * A + S * P + _ * I + b * M;
5090
+ const A = o[S + T + a], P = o[S + T + c] * d, I = o[y + T + a], M = o[y + T] * d;
5091
+ r[T] = E * A + b * P + _ * I + x * M;
5092
5092
  }
5093
5093
  return r;
5094
5094
  }
5095
5095
  }
5096
- const fh = new An();
5096
+ const fh = new vn();
5097
5097
  class ph extends jo {
5098
5098
  interpolate_(e, t, n, s) {
5099
5099
  const r = super.interpolate_(e, t, n, s);
5100
5100
  return fh.fromArray(r).normalize().toArray(r), r;
5101
5101
  }
5102
5102
  }
5103
- const at = {
5103
+ const ct = {
5104
5104
  POINTS: 0,
5105
5105
  LINES: 1,
5106
5106
  LINE_LOOP: 2,
@@ -5479,7 +5479,7 @@ class Sh {
5479
5479
  return Promise.resolve(this.extensions[ce.KHR_BINARY_GLTF].body);
5480
5480
  const s = this.options;
5481
5481
  return new Promise(function(r, o) {
5482
- n.load(Vn.resolveURL(t.uri, s.path), r, void 0, function() {
5482
+ n.load(Wn.resolveURL(t.uri, s.path), r, void 0, function() {
5483
5483
  o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
5484
5484
  });
5485
5485
  });
@@ -5509,26 +5509,26 @@ class Sh {
5509
5509
  const t = this, n = this.json, s = this.json.accessors[e];
5510
5510
  if (s.bufferView === void 0 && s.sparse === void 0) {
5511
5511
  const o = fi[s.type], a = bn[s.componentType], c = s.normalized === !0, u = new a(s.count * o);
5512
- return Promise.resolve(new jn(u, o, c));
5512
+ return Promise.resolve(new Vn(u, o, c));
5513
5513
  }
5514
5514
  const r = [];
5515
5515
  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) {
5516
- const a = o[0], c = fi[s.type], u = bn[s.componentType], d = u.BYTES_PER_ELEMENT, h = d * c, f = s.byteOffset || 0, p = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, g = s.normalized === !0;
5517
- let x, _;
5516
+ const a = o[0], c = fi[s.type], u = bn[s.componentType], d = u.BYTES_PER_ELEMENT, h = d * c, f = s.byteOffset || 0, p = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, y = s.normalized === !0;
5517
+ let S, _;
5518
5518
  if (p && p !== h) {
5519
- const b = Math.floor(f / p), E = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + b + ":" + s.count;
5520
- let S = t.cache.get(E);
5521
- S || (x = new u(a, b * p, s.count * p / d), S = new sc(x, p / d), t.cache.add(E, S)), _ = new ic(S, c, f % p / d, g);
5519
+ const x = Math.floor(f / p), E = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + x + ":" + s.count;
5520
+ let b = t.cache.get(E);
5521
+ b || (S = new u(a, x * p, s.count * p / d), b = new sc(S, p / d), t.cache.add(E, b)), _ = new ic(b, c, f % p / d, y);
5522
5522
  } else
5523
- a === null ? x = new u(s.count * c) : x = new u(a, f, s.count * c), _ = new jn(x, c, g);
5523
+ a === null ? S = new u(s.count * c) : S = new u(a, f, s.count * c), _ = new Vn(S, c, y);
5524
5524
  if (s.sparse !== void 0) {
5525
- const b = fi.SCALAR, E = bn[s.sparse.indices.componentType], S = s.sparse.indices.byteOffset || 0, T = s.sparse.values.byteOffset || 0, A = new E(o[1], S, s.sparse.count * b), P = new u(o[2], T, s.sparse.count * c);
5526
- a !== null && (_ = new jn(_.array.slice(), _.itemSize, _.normalized)), _.normalized = !1;
5525
+ const x = fi.SCALAR, E = bn[s.sparse.indices.componentType], b = s.sparse.indices.byteOffset || 0, T = s.sparse.values.byteOffset || 0, A = new E(o[1], b, s.sparse.count * x), P = new u(o[2], T, s.sparse.count * c);
5526
+ a !== null && (_ = new Vn(_.array.slice(), _.itemSize, _.normalized)), _.normalized = !1;
5527
5527
  for (let I = 0, M = A.length; I < M; I++) {
5528
5528
  const O = A[I];
5529
5529
  if (_.setX(O, P[I * c]), c >= 2 && _.setY(O, P[I * c + 1]), c >= 3 && _.setZ(O, P[I * c + 2]), c >= 4 && _.setW(O, P[I * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
5530
5530
  }
5531
- _.normalized = g;
5531
+ _.normalized = y;
5532
5532
  }
5533
5533
  return _;
5534
5534
  });
@@ -5578,11 +5578,11 @@ class Sh {
5578
5578
  throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
5579
5579
  const d = Promise.resolve(c).then(function(h) {
5580
5580
  return new Promise(function(f, p) {
5581
- let g = f;
5582
- t.isImageBitmapLoader === !0 && (g = function(x) {
5583
- const _ = new xr(x);
5581
+ let y = f;
5582
+ t.isImageBitmapLoader === !0 && (y = function(S) {
5583
+ const _ = new xr(S);
5584
5584
  _.needsUpdate = !0, f(_);
5585
- }), t.load(Vn.resolveURL(h, r.path), g, void 0, p);
5585
+ }), t.load(Wn.resolveURL(h, r.path), y, void 0, p);
5586
5586
  });
5587
5587
  }).then(function(h) {
5588
5588
  return u === !0 && a.revokeObjectURL(c), vt(h, o), h.userData.mimeType = o.mimeType || Th(o.uri), h;
@@ -5677,15 +5677,15 @@ class Sh {
5677
5677
  }
5678
5678
  r.doubleSided === !0 && (a.side = Eo);
5679
5679
  const d = r.alphaMode || pi.OPAQUE;
5680
- if (d === pi.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === pi.MASK && (a.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && o !== Hn && (u.push(t.assignTexture(a, "normalMap", r.normalTexture)), a.normalScale = new pe(1, 1), r.normalTexture.scale !== void 0)) {
5680
+ if (d === pi.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, d === pi.MASK && (a.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && o !== Gn && (u.push(t.assignTexture(a, "normalMap", r.normalTexture)), a.normalScale = new pe(1, 1), r.normalTexture.scale !== void 0)) {
5681
5681
  const h = r.normalTexture.scale;
5682
5682
  a.normalScale.set(h, h);
5683
5683
  }
5684
- if (r.occlusionTexture !== void 0 && o !== Hn && (u.push(t.assignTexture(a, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && o !== Hn) {
5684
+ if (r.occlusionTexture !== void 0 && o !== Gn && (u.push(t.assignTexture(a, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && o !== Gn) {
5685
5685
  const h = r.emissiveFactor;
5686
5686
  a.emissive = new tn().setRGB(h[0], h[1], h[2], je);
5687
5687
  }
5688
- return r.emissiveTexture !== void 0 && o !== Hn && u.push(t.assignTexture(a, "emissiveMap", r.emissiveTexture, qn)), Promise.all(u).then(function() {
5688
+ return r.emissiveTexture !== void 0 && o !== Gn && u.push(t.assignTexture(a, "emissiveMap", r.emissiveTexture, qn)), Promise.all(u).then(function() {
5689
5689
  const h = new o(a);
5690
5690
  return r.name && (h.name = r.name), vt(h, r), t.associations.set(h, { materials: e }), r.extensions && Jt(s, h, r), h;
5691
5691
  });
@@ -5744,25 +5744,25 @@ class Sh {
5744
5744
  }
5745
5745
  return a.push(t.loadGeometries(o)), Promise.all(a).then(function(c) {
5746
5746
  const u = c.slice(0, c.length - 1), d = c[c.length - 1], h = [];
5747
- for (let p = 0, g = d.length; p < g; p++) {
5748
- const x = d[p], _ = o[p];
5749
- let b;
5747
+ for (let p = 0, y = d.length; p < y; p++) {
5748
+ const S = d[p], _ = o[p];
5749
+ let x;
5750
5750
  const E = u[p];
5751
- if (_.mode === at.TRIANGLES || _.mode === at.TRIANGLE_STRIP || _.mode === at.TRIANGLE_FAN || _.mode === void 0)
5752
- b = r.isSkinnedMesh === !0 ? new pc(x, E) : new wt(x, E), b.isSkinnedMesh === !0 && b.normalizeSkinWeights(), _.mode === at.TRIANGLE_STRIP ? b.geometry = Qr(b.geometry, So) : _.mode === at.TRIANGLE_FAN && (b.geometry = Qr(b.geometry, vi));
5753
- else if (_.mode === at.LINES)
5754
- b = new qi(x, E);
5755
- else if (_.mode === at.LINE_STRIP)
5756
- b = new Qi(x, E);
5757
- else if (_.mode === at.LINE_LOOP)
5758
- b = new $i(x, E);
5759
- else if (_.mode === at.POINTS)
5760
- b = new Ji(x, E);
5751
+ if (_.mode === ct.TRIANGLES || _.mode === ct.TRIANGLE_STRIP || _.mode === ct.TRIANGLE_FAN || _.mode === void 0)
5752
+ x = r.isSkinnedMesh === !0 ? new pc(S, E) : new wt(S, E), x.isSkinnedMesh === !0 && x.normalizeSkinWeights(), _.mode === ct.TRIANGLE_STRIP ? x.geometry = Qr(x.geometry, So) : _.mode === ct.TRIANGLE_FAN && (x.geometry = Qr(x.geometry, vi));
5753
+ else if (_.mode === ct.LINES)
5754
+ x = new qi(S, E);
5755
+ else if (_.mode === ct.LINE_STRIP)
5756
+ x = new Qi(S, E);
5757
+ else if (_.mode === ct.LINE_LOOP)
5758
+ x = new $i(S, E);
5759
+ else if (_.mode === ct.POINTS)
5760
+ x = new Ji(S, E);
5761
5761
  else
5762
5762
  throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + _.mode);
5763
- Object.keys(b.geometry.morphAttributes).length > 0 && wh(b, r), b.name = t.createUniqueName(r.name || "mesh_" + e), vt(b, r), _.extensions && Jt(s, b, _), t.assignFinalMaterial(b), h.push(b);
5763
+ Object.keys(x.geometry.morphAttributes).length > 0 && wh(x, r), x.name = t.createUniqueName(r.name || "mesh_" + e), vt(x, r), _.extensions && Jt(s, x, _), t.assignFinalMaterial(x), h.push(x);
5764
5764
  }
5765
- for (let p = 0, g = h.length; p < g; p++)
5765
+ for (let p = 0, y = h.length; p < y; p++)
5766
5766
  t.associations.set(h[p], {
5767
5767
  meshes: e,
5768
5768
  primitives: p
@@ -5771,7 +5771,7 @@ class Sh {
5771
5771
  return r.extensions && Jt(s, h[0], r), h[0];
5772
5772
  const f = new ti();
5773
5773
  r.extensions && Jt(s, f, r), t.associations.set(f, { meshes: e });
5774
- for (let p = 0, g = h.length; p < g; p++)
5774
+ for (let p = 0, y = h.length; p < y; p++)
5775
5775
  f.add(h[p]);
5776
5776
  return f;
5777
5777
  });
@@ -5827,8 +5827,8 @@ class Sh {
5827
5827
  loadAnimation(e) {
5828
5828
  const t = this.json, n = this, s = t.animations[e], r = s.name ? s.name : "animation_" + e, o = [], a = [], c = [], u = [], d = [];
5829
5829
  for (let h = 0, f = s.channels.length; h < f; h++) {
5830
- const p = s.channels[h], g = s.samplers[p.sampler], x = p.target, _ = x.node, b = s.parameters !== void 0 ? s.parameters[g.input] : g.input, E = s.parameters !== void 0 ? s.parameters[g.output] : g.output;
5831
- x.node !== void 0 && (o.push(this.getDependency("node", _)), a.push(this.getDependency("accessor", b)), c.push(this.getDependency("accessor", E)), u.push(g), d.push(x));
5830
+ const p = s.channels[h], y = s.samplers[p.sampler], S = p.target, _ = S.node, x = s.parameters !== void 0 ? s.parameters[y.input] : y.input, E = s.parameters !== void 0 ? s.parameters[y.output] : y.output;
5831
+ S.node !== void 0 && (o.push(this.getDependency("node", _)), a.push(this.getDependency("accessor", x)), c.push(this.getDependency("accessor", E)), u.push(y), d.push(S));
5832
5832
  }
5833
5833
  return Promise.all([
5834
5834
  Promise.all(o),
@@ -5837,17 +5837,17 @@ class Sh {
5837
5837
  Promise.all(u),
5838
5838
  Promise.all(d)
5839
5839
  ]).then(function(h) {
5840
- const f = h[0], p = h[1], g = h[2], x = h[3], _ = h[4], b = [];
5841
- for (let S = 0, T = f.length; S < T; S++) {
5842
- const A = f[S], P = p[S], I = g[S], M = x[S], O = _[S];
5840
+ const f = h[0], p = h[1], y = h[2], S = h[3], _ = h[4], x = [];
5841
+ for (let b = 0, T = f.length; b < T; b++) {
5842
+ const A = f[b], P = p[b], I = y[b], M = S[b], O = _[b];
5843
5843
  if (A === void 0) continue;
5844
5844
  A.updateMatrix && A.updateMatrix();
5845
5845
  const C = n._createAnimationTracks(A, P, I, M, O);
5846
5846
  if (C)
5847
5847
  for (let N = 0; N < C.length; N++)
5848
- b.push(C[N]);
5848
+ x.push(C[N]);
5849
5849
  }
5850
- const E = new wc(r, void 0, b);
5850
+ const E = new wc(r, void 0, x);
5851
5851
  return vt(E, s), E;
5852
5852
  });
5853
5853
  }
@@ -5883,11 +5883,11 @@ class Sh {
5883
5883
  f !== null && d.traverse(function(p) {
5884
5884
  p.isSkinnedMesh && p.bind(f, _h);
5885
5885
  });
5886
- for (let p = 0, g = h.length; p < g; p++)
5886
+ for (let p = 0, y = h.length; p < y; p++)
5887
5887
  d.add(h[p]);
5888
5888
  if (d.userData.pivot !== void 0 && h.length > 0) {
5889
- const p = d.userData.pivot, g = h[0];
5890
- d.pivot = new $().fromArray(p), d.position.x -= p[0], d.position.y -= p[1], d.position.z -= p[2], g.position.set(0, 0, 0), delete d.userData.pivot;
5889
+ const p = d.userData.pivot, y = h[0];
5890
+ d.pivot = new $().fromArray(p), d.position.x -= p[0], d.position.y -= p[1], d.position.z -= p[2], y.position.set(0, 0, 0), delete d.userData.pivot;
5891
5891
  }
5892
5892
  return d;
5893
5893
  });
@@ -5988,14 +5988,14 @@ class Sh {
5988
5988
  break;
5989
5989
  }
5990
5990
  const h = s.interpolation !== void 0 ? mh[s.interpolation] : Mo, f = this._getArrayFromAccessor(n);
5991
- for (let p = 0, g = c.length; p < g; p++) {
5992
- const x = new d(
5991
+ for (let p = 0, y = c.length; p < y; p++) {
5992
+ const S = new d(
5993
5993
  c[p] + "." + Ut[r.path],
5994
5994
  t.array,
5995
5995
  f,
5996
5996
  h
5997
5997
  );
5998
- s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(x), o.push(x);
5998
+ s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(S), o.push(S);
5999
5999
  }
6000
6000
  return o;
6001
6001
  }
@@ -6040,11 +6040,11 @@ function bh(i, e, t) {
6040
6040
  for (let u = 0, d = r.length; u < d; u++) {
6041
6041
  const h = r[u];
6042
6042
  if (h.POSITION !== void 0) {
6043
- const f = t.json.accessors[h.POSITION], p = f.min, g = f.max;
6044
- if (p !== void 0 && g !== void 0) {
6045
- if (c.setX(Math.max(Math.abs(p[0]), Math.abs(g[0]))), c.setY(Math.max(Math.abs(p[1]), Math.abs(g[1]))), c.setZ(Math.max(Math.abs(p[2]), Math.abs(g[2]))), f.normalized) {
6046
- const x = Hi(bn[f.componentType]);
6047
- c.multiplyScalar(x);
6043
+ const f = t.json.accessors[h.POSITION], p = f.min, y = f.max;
6044
+ if (p !== void 0 && y !== void 0) {
6045
+ 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) {
6046
+ const S = Hi(bn[f.componentType]);
6047
+ c.multiplyScalar(S);
6048
6048
  }
6049
6049
  a.max(c);
6050
6050
  } else
@@ -6225,7 +6225,7 @@ class Zo extends Io {
6225
6225
  * @param {?HTMLElement} domElement - The HTML element used for event listeners.
6226
6226
  */
6227
6227
  constructor(e, t = null) {
6228
- super(e, t), this.state = we.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ue.ROTATE, MIDDLE: Ue.DOLLY, RIGHT: Ue.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new An(), this._lastTargetPosition = new $(), this._quat = new An().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Gs(), this._sphericalDelta = new Gs(), this._scale = 1, this._panOffset = new $(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new $(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Ch.bind(this), this._onPointerDown = Ih.bind(this), this._onPointerUp = Ph.bind(this), this._onContextMenu = zh.bind(this), this._onMouseWheel = Dh.bind(this), this._onKeyDown = Nh.bind(this), this._onTouchStart = kh.bind(this), this._onTouchMove = Fh.bind(this), this._onMouseDown = Lh.bind(this), this._onMouseMove = Oh.bind(this), this._interceptControlDown = Bh.bind(this), this._interceptControlUp = Uh.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
6228
+ super(e, t), this.state = we.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ue.ROTATE, MIDDLE: Ue.DOLLY, RIGHT: Ue.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new vn(), this._lastTargetPosition = new $(), this._quat = new vn().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Gs(), this._sphericalDelta = new Gs(), this._scale = 1, this._panOffset = new $(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new $(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Ch.bind(this), this._onPointerDown = Ih.bind(this), this._onPointerUp = Ph.bind(this), this._onContextMenu = zh.bind(this), this._onMouseWheel = Dh.bind(this), this._onKeyDown = Nh.bind(this), this._onTouchStart = kh.bind(this), this._onTouchMove = Fh.bind(this), this._onMouseDown = Lh.bind(this), this._onMouseMove = Oh.bind(this), this._interceptControlDown = Bh.bind(this), this._interceptControlUp = Uh.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
6229
6229
  }
6230
6230
  /**
6231
6231
  * Defines the visual representation of the cursor.
@@ -6982,15 +6982,15 @@ const ji = "contact-shadow-baked", xn = "contact-shadow-live", Yo = "softboxCont
6982
6982
  f.rotation.x = -Math.PI / 2, f.position.set(s.center.x, 0, s.center.z), f.receiveShadow = !0, a.add(f);
6983
6983
  const p = this.createBakeCamera(s);
6984
6984
  a.add(p);
6985
- const g = e.getRenderTarget(), x = e.autoClear, _ = e.getClearColor(new w.Color()), b = e.getClearAlpha(), E = e.shadowMap.autoUpdate;
6985
+ const y = e.getRenderTarget(), S = e.autoClear, _ = e.getClearColor(new w.Color()), x = e.getClearAlpha(), E = e.shadowMap.autoUpdate;
6986
6986
  try {
6987
6987
  e.shadowMap.autoUpdate = !0, e.setRenderTarget(r), e.setClearColor(0, 0), e.clear(!0, !1, !1), e.autoClear = !1;
6988
- const S = this.explicitPasses ?? this.measureAffordablePasses(e, a, p, n, d, r);
6989
- h.opacity = 1 / S;
6990
- for (const T of this.sampleLightPositions(n, S))
6988
+ const b = this.explicitPasses ?? this.measureAffordablePasses(e, a, p, n, d, r);
6989
+ h.opacity = 1 / b;
6990
+ for (const T of this.sampleLightPositions(n, b))
6991
6991
  d.position.copy(T), e.render(a, p);
6992
6992
  } finally {
6993
- e.autoClear = x, e.setClearColor(_, b), e.setRenderTarget(g), e.shadowMap.autoUpdate = E, this.restoreColorWrite(u), c ? c.add(t) : a.remove(t), d.dispose(), h.dispose();
6993
+ e.autoClear = S, e.setClearColor(_, x), e.setRenderTarget(y), e.shadowMap.autoUpdate = E, this.restoreColorWrite(u), c ? c.add(t) : a.remove(t), d.dispose(), h.dispose();
6994
6994
  }
6995
6995
  }
6996
6996
  /**
@@ -7062,27 +7062,27 @@ const ji = "contact-shadow-baked", xn = "contact-shadow-live", Yo = "softboxCont
7062
7062
  sampleLightPositions(e, t) {
7063
7063
  const n = e.position.clone(), s = e.target.parent ? e.target.getWorldPosition(new w.Vector3()) : e.target.position.clone(), r = s.clone().sub(n), o = r.length(), a = r.normalize(), c = new w.Vector3().crossVectors(a, new w.Vector3(0, 1, 0));
7064
7064
  c.lengthSq() < 1e-6 && c.set(1, 0, 0), c.normalize();
7065
- const u = new w.Vector3().crossVectors(a, c), d = Math.round(t * xe.AMBIENT_RATIO), h = t - d, f = w.MathUtils.degToRad(xe.LIGHT_APERTURE_DEGREES), p = Math.tan(f / 2) * o, g = [];
7066
- for (let b = 0; b < h; b++) {
7067
- const E = p * Math.sqrt((b + 0.5) / h), S = b * ao;
7068
- g.push(
7069
- n.clone().addScaledVector(c, E * Math.cos(S)).addScaledVector(u, E * Math.sin(S))
7065
+ const u = new w.Vector3().crossVectors(a, c), d = Math.round(t * xe.AMBIENT_RATIO), h = t - d, f = w.MathUtils.degToRad(xe.LIGHT_APERTURE_DEGREES), p = Math.tan(f / 2) * o, y = [];
7066
+ for (let x = 0; x < h; x++) {
7067
+ const E = p * Math.sqrt((x + 0.5) / h), b = x * ao;
7068
+ y.push(
7069
+ n.clone().addScaledVector(c, E * Math.cos(b)).addScaledVector(u, E * Math.sin(b))
7070
7070
  );
7071
7071
  }
7072
- const x = Math.sin(
7072
+ const S = Math.sin(
7073
7073
  w.MathUtils.degToRad(xe.AMBIENT_MIN_ELEVATION_DEGREES)
7074
7074
  ), _ = 0.98;
7075
- for (let b = 0; b < d; b++) {
7076
- const E = Math.sqrt((b + 0.5) / d), S = x + (_ - x) * E, T = Math.sqrt(1 - S * S), A = b * ao;
7077
- g.push(
7075
+ for (let x = 0; x < d; x++) {
7076
+ const E = Math.sqrt((x + 0.5) / d), b = S + (_ - S) * E, T = Math.sqrt(1 - b * b), A = x * ao;
7077
+ y.push(
7078
7078
  new w.Vector3(
7079
7079
  T * Math.cos(A),
7080
- S,
7080
+ b,
7081
7081
  T * Math.sin(A)
7082
7082
  ).multiplyScalar(o).add(s)
7083
7083
  );
7084
7084
  }
7085
- return g;
7085
+ return y;
7086
7086
  }
7087
7087
  installBakedMesh(e, t, n, s) {
7088
7088
  this.evictBakedMesh(e);
@@ -7126,7 +7126,7 @@ const ji = "contact-shadow-baked", xn = "contact-shadow-live", Yo = "softboxCont
7126
7126
  };
7127
7127
  xe.AMBIENT_RATIO = 0.45, xe.LIGHT_APERTURE_DEGREES = 9, xe.AMBIENT_MIN_ELEVATION_DEGREES = 55, xe.ACCUMULATION_TEXTURE_SIZE = 1024, xe.BAKE_SHADOW_MAP_SIZE = 1024, xe.SHADOW_STRENGTH = 0.85, xe.BAKE_BUDGET_MS = 100, xe.MIN_PASSES = 24, xe.MAX_PASSES = 96;
7128
7128
  let Vi = xe;
7129
- const Xn = class Xn {
7129
+ const Yn = class Yn {
7130
7130
  // 10% gap between tiles
7131
7131
  /**
7132
7132
  * Get tile height based on tile size
@@ -7179,8 +7179,8 @@ const Xn = class Xn {
7179
7179
  return -this.getBevelSize(e);
7180
7180
  }
7181
7181
  };
7182
- Xn.HEIGHT_RATIO = 0.075, Xn.BEVEL_RATIO = 0.04, Xn.GAP_FACTOR = 1.05;
7183
- let sn = Xn;
7182
+ Yn.HEIGHT_RATIO = 0.075, Yn.BEVEL_RATIO = 0.04, Yn.GAP_FACTOR = 1.05;
7183
+ let sn = Yn;
7184
7184
  var Ot = /* @__PURE__ */ ((i) => (i.SQUARE_WIRE = "square_wire", i.HEXAGONAL_WIRE = "hexagonal_wire", i.HEXAGONAL_GLASS = "hexagonal_glass", i.STONE_TILES = "stone_tiles", i.CUSTOM = "custom", i))(Ot || {});
7185
7185
  class Vh {
7186
7186
  constructor() {
@@ -7210,13 +7210,13 @@ class Wh {
7210
7210
  }), c = s * Math.sqrt(3), u = s * 2;
7211
7211
  for (let h = -n; h <= n; h++) {
7212
7212
  const f = Math.max(-n, -h - n), p = Math.min(n, -h + n);
7213
- for (let g = f; g <= p; g++) {
7214
- const x = c * (h + g / 2), _ = u * 0.75 * g, b = [], E = Math.PI * 2 / 6;
7213
+ for (let y = f; y <= p; y++) {
7214
+ const S = c * (h + y / 2), _ = u * 0.75 * y, x = [], E = Math.PI * 2 / 6;
7215
7215
  for (let A = 0; A <= 6; A++) {
7216
- const P = A * E + Math.PI / 6, I = x + s * Math.cos(P), M = _ + s * Math.sin(P);
7217
- b.push(new w.Vector3(I, 0, M));
7216
+ const P = A * E + Math.PI / 6, I = S + s * Math.cos(P), M = _ + s * Math.sin(P);
7217
+ x.push(new w.Vector3(I, 0, M));
7218
7218
  }
7219
- const S = new w.BufferGeometry().setFromPoints(b), T = new w.Line(S, a);
7219
+ const b = new w.BufferGeometry().setFromPoints(x), T = new w.Line(b, a);
7220
7220
  t.add(T);
7221
7221
  }
7222
7222
  }
@@ -7289,8 +7289,8 @@ function Kh(i, e) {
7289
7289
  e.forEach((h, f) => {
7290
7290
  const p = f * n.length;
7291
7291
  o.set(n, p);
7292
- for (let g = p; g < p + n.length; g += 3)
7293
- o[g] += h.x, o[g + 1] += h.y, o[g + 2] += h.z;
7292
+ for (let y = p; y < p + n.length; y += 3)
7293
+ o[y] += h.x, o[y + 1] += h.y, o[y + 2] += h.z;
7294
7294
  a.set(s, f * s.length), c && r && c.set(r, f * r.length);
7295
7295
  });
7296
7296
  const u = new w.BufferGeometry();
@@ -7301,12 +7301,12 @@ class Xh {
7301
7301
  this.name = "Hexagonal Glass Grid";
7302
7302
  }
7303
7303
  createGrid(e) {
7304
- var g, x, _, b, E, S, T;
7305
- const t = new w.Group(), n = ((g = e.styleOptions) == null ? void 0 : g.hexRadius) ?? Math.floor(e.divisions / 2), s = ((x = e.styleOptions) == null ? void 0 : x.tileSize) || 1, r = String(e.color || "#ffffff"), o = sn.getGridSpacing(s), a = o.width, c = o.height, u = new Zh(new w.Vector3(0, 0, 0), s, r, {
7304
+ var y, S, _, x, E, b, T;
7305
+ const t = new w.Group(), n = ((y = e.styleOptions) == null ? void 0 : y.hexRadius) ?? Math.floor(e.divisions / 2), s = ((S = e.styleOptions) == null ? void 0 : S.tileSize) || 1, r = String(e.color || "#ffffff"), o = sn.getGridSpacing(s), a = o.width, c = o.height, u = new Zh(new w.Vector3(0, 0, 0), s, r, {
7306
7306
  metalness: (_ = e.styleOptions) == null ? void 0 : _.metalness,
7307
- roughness: (b = e.styleOptions) == null ? void 0 : b.roughness,
7307
+ roughness: (x = e.styleOptions) == null ? void 0 : x.roughness,
7308
7308
  transmission: (E = e.styleOptions) == null ? void 0 : E.transmission,
7309
- thickness: (S = e.styleOptions) == null ? void 0 : S.thickness,
7309
+ thickness: (b = e.styleOptions) == null ? void 0 : b.thickness,
7310
7310
  ior: (T = e.styleOptions) == null ? void 0 : T.ior
7311
7311
  }), d = u.createGeometry(), h = sn.getYPosition(s), f = [];
7312
7312
  for (let A = -n; A <= n; A++) {
@@ -7335,11 +7335,11 @@ class Yh {
7335
7335
  this.name = "Stone Tile Grid", this.textureLoader = new w.TextureLoader();
7336
7336
  }
7337
7337
  createGrid(e) {
7338
- var p, g, x, _;
7339
- const t = new w.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, u = ((g = e.styleOptions) == null ? void 0 : g.bevelSize) || c * 0.2, d = ((x = e.styleOptions) == null ? void 0 : x.randomHeight) || !1, h = ((_ = e.styleOptions) == null ? void 0 : _.randomRotation) || !1, f = this.createStoneMaterial(e);
7340
- for (let b = 0; b < s; b++)
7338
+ var p, y, S, _;
7339
+ const t = new w.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, u = ((y = e.styleOptions) == null ? void 0 : y.bevelSize) || c * 0.2, d = ((S = e.styleOptions) == null ? void 0 : S.randomHeight) || !1, h = ((_ = e.styleOptions) == null ? void 0 : _.randomRotation) || !1, f = this.createStoneMaterial(e);
7340
+ for (let x = 0; x < s; x++)
7341
7341
  for (let E = 0; E < s; E++) {
7342
- const S = (b - s / 2) * r + r / 2, T = (E - s / 2) * r + r / 2, A = d ? c * (0.8 + Math.random() * 0.4) : c, P = new w.Shape(), I = a / 2;
7342
+ const b = (x - s / 2) * r + r / 2, T = (E - s / 2) * r + r / 2, A = d ? c * (0.8 + Math.random() * 0.4) : c, P = new w.Shape(), I = a / 2;
7343
7343
  P.moveTo(-I, -I), P.lineTo(I, -I), P.lineTo(I, I), P.lineTo(-I, I), P.closePath();
7344
7344
  const M = {
7345
7345
  depth: A,
@@ -7350,7 +7350,7 @@ class Yh {
7350
7350
  }, O = new w.ExtrudeGeometry(P, M);
7351
7351
  O.rotateX(-Math.PI / 2);
7352
7352
  const C = new w.Mesh(O, f);
7353
- C.position.set(S, -A / 2, T), C.castShadow = !0, C.receiveShadow = !0, h && (C.rotation.y = Math.floor(Math.random() * 4) * (Math.PI / 2)), t.add(C);
7353
+ C.position.set(b, -A / 2, T), C.castShadow = !0, C.receiveShadow = !0, h && (C.rotation.y = Math.floor(Math.random() * 4) * (Math.PI / 2)), t.add(C);
7354
7354
  }
7355
7355
  return t;
7356
7356
  }
@@ -7516,23 +7516,23 @@ class qh {
7516
7516
  const d = new w.Box3().setFromObject(u), h = d.getSize(new w.Vector3());
7517
7517
  if (d.isEmpty() || !Number.isFinite(h.x) || !Number.isFinite(h.z))
7518
7518
  return console.warn("Skipping dynamic grid: object has an empty or non-finite bounding box"), k.ok(void 0);
7519
- const f = (s = a.styleOptions) == null ? void 0 : s.tileSize, p = typeof f == "number" ? f : 1, x = sn.getGridSpacing(p).width, _ = Math.max(h.x, h.z) * n + h.y;
7520
- let b = _ <= x ? 0 : Math.ceil((_ / x - 1) / 2);
7519
+ const f = (s = a.styleOptions) == null ? void 0 : s.tileSize, p = typeof f == "number" ? f : 1, S = sn.getGridSpacing(p).width, _ = Math.max(h.x, h.z) * n + h.y;
7520
+ let x = _ <= S ? 0 : Math.ceil((_ / S - 1) / 2);
7521
7521
  const E = 60;
7522
- b > E && (console.warn(
7523
- `Dynamic grid would need ${b} rings to cover the object; capping at ${E}. The floor will not fully reach the configured coverage for this tileSize/object-size combination.`
7524
- ), b = E), _ < x * 0.8 ? b = 0 : b < 3 && _ > x * 2 && (b = 3);
7525
- const S = a.type || Ot.HEXAGONAL_GLASS, A = {
7522
+ x > E && (console.warn(
7523
+ `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.`
7524
+ ), x = E), _ < S * 0.8 ? x = 0 : x < 3 && _ > S * 2 && (x = 3);
7525
+ const b = a.type || Ot.HEXAGONAL_GLASS, A = {
7526
7526
  size: Math.max(h.x, h.z) * n,
7527
- divisions: b * 2 + 1,
7527
+ divisions: x * 2 + 1,
7528
7528
  color: a.color,
7529
7529
  opacity: a.opacity,
7530
7530
  styleOptions: {
7531
- hexRadius: b,
7531
+ hexRadius: x,
7532
7532
  tileSize: p,
7533
7533
  ...a.styleOptions
7534
7534
  }
7535
- }, P = Zs.createGrid(S, A);
7535
+ }, P = Zs.createGrid(b, A);
7536
7536
  P.userData.isGrid = !0, P.userData.isHexGrid = !0;
7537
7537
  const I = P.getObjectByName(xn);
7538
7538
  return I && (I.position.y = w.MathUtils.clamp(h.y * 25e-4, 2e-4, 2e-3)), r.add(P), k.ok(void 0);
@@ -7586,17 +7586,17 @@ class qh {
7586
7586
  const d = new w.Box3().setFromObject(n);
7587
7587
  if (d.isEmpty() || !Number.isFinite(d.min.x) || !Number.isFinite(d.max.x))
7588
7588
  return k.ok(void 0);
7589
- const h = 40, f = Math.max(1, d.max.y - d.min.y), p = d.max.y + f, g = d.min.y - f, x = new w.Raycaster(), _ = new w.Vector3(0, -1, 0), b = new w.Vector3(0, 1, 0);
7589
+ const h = 40, f = Math.max(1, d.max.y - d.min.y), p = d.max.y + f, y = d.min.y - f, S = new w.Raycaster(), _ = new w.Vector3(0, -1, 0), x = new w.Vector3(0, 1, 0);
7590
7590
  let E = 1 / 0;
7591
- const S = (T, A, P, I) => {
7592
- x.set(new w.Vector3(T, A, P), I);
7593
- for (const M of x.intersectObjects(a, !1))
7591
+ const b = (T, A, P, I) => {
7592
+ S.set(new w.Vector3(T, A, P), I);
7593
+ for (const M of S.intersectObjects(a, !1))
7594
7594
  M.point.y < E && (E = M.point.y);
7595
7595
  };
7596
7596
  for (let T = 0; T <= h; T++)
7597
7597
  for (let A = 0; A <= h; A++) {
7598
7598
  const P = d.min.x + (d.max.x - d.min.x) * (T / h), I = d.min.z + (d.max.z - d.min.z) * (A / h);
7599
- S(P, p, I, _), S(P, g, I, b);
7599
+ b(P, p, I, _), b(P, y, I, x);
7600
7600
  }
7601
7601
  if (Number.isFinite(E)) {
7602
7602
  const T = E - c;
@@ -7819,8 +7819,8 @@ class qh {
7819
7819
  "fov" in r ? h = r.fov * (Math.PI / 180) : h = 50 * (Math.PI / 180);
7820
7820
  let f = Math.abs(d / 2 / Math.tan(h / 2));
7821
7821
  f *= 2;
7822
- const p = -Math.PI / 4, g = Math.PI / 8, x = c.x + f * Math.sin(p) * Math.cos(g), _ = c.y + f * Math.sin(g), b = c.z + f * Math.cos(p) * Math.cos(g);
7823
- return r.position.set(x, _, b), r.lookAt(c), r.updateProjectionMatrix(), o && o.target && (o.target.copy(c), o.update()), k.ok(void 0);
7822
+ const p = -Math.PI / 4, y = Math.PI / 8, S = c.x + f * Math.sin(p) * Math.cos(y), _ = c.y + f * Math.sin(y), x = c.z + f * Math.cos(p) * Math.cos(y);
7823
+ return r.position.set(S, _, x), r.lookAt(c), r.updateProjectionMatrix(), o && o.target && (o.target.copy(c), o.update()), k.ok(void 0);
7824
7824
  } catch (s) {
7825
7825
  return k.err(
7826
7826
  new Z(
@@ -7837,7 +7837,7 @@ class $h {
7837
7837
  this.events = new nr(), this.disposed = !1;
7838
7838
  }
7839
7839
  async initialize(e) {
7840
- const { ThreePathTracingService: t } = await import("./ThreePathTracingService-r9mlCyVS.js");
7840
+ const { ThreePathTracingService: t } = await import("./ThreePathTracingService-CZRttruH.js");
7841
7841
  if (this.disposed)
7842
7842
  return k.ok(void 0);
7843
7843
  const n = new t();
@@ -7885,7 +7885,7 @@ fflate - fast JavaScript compression/decompression
7885
7885
  Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
7886
7886
  version 0.8.2
7887
7887
  */
7888
- var ct = Uint8Array, Sn = Uint16Array, Qh = Int32Array, qo = new ct([
7888
+ var lt = Uint8Array, Sn = Uint16Array, Qh = Int32Array, qo = new lt([
7889
7889
  0,
7890
7890
  0,
7891
7891
  0,
@@ -7920,7 +7920,7 @@ var ct = Uint8Array, Sn = Uint16Array, Qh = Int32Array, qo = new ct([
7920
7920
  0,
7921
7921
  /* impossible */
7922
7922
  0
7923
- ]), $o = new ct([
7923
+ ]), $o = new lt([
7924
7924
  0,
7925
7925
  0,
7926
7926
  0,
@@ -7954,7 +7954,7 @@ var ct = Uint8Array, Sn = Uint16Array, Qh = Int32Array, qo = new ct([
7954
7954
  /* unused */
7955
7955
  0,
7956
7956
  0
7957
- ]), Jh = new ct([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Qo = function(i, e) {
7957
+ ]), Jh = new lt([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Qo = function(i, e) {
7958
7958
  for (var t = new Sn(31), n = 0; n < 31; ++n)
7959
7959
  t[n] = e += 1 << i[n - 1];
7960
7960
  for (var s = new Qh(t[30]), n = 1; n < 30; ++n)
@@ -7968,7 +7968,7 @@ for (var Se = 0; Se < 32768; ++Se) {
7968
7968
  var Ht = (Se & 43690) >> 1 | (Se & 21845) << 1;
7969
7969
  Ht = (Ht & 52428) >> 2 | (Ht & 13107) << 2, Ht = (Ht & 61680) >> 4 | (Ht & 3855) << 4, Wi[Se] = ((Ht & 65280) >> 8 | (Ht & 255) << 8) >> 1;
7970
7970
  }
7971
- var Kn = (function(i, e, t) {
7971
+ var Xn = (function(i, e, t) {
7972
7972
  for (var n = i.length, s = 0, r = new Sn(e); s < n; ++s)
7973
7973
  i[s] && ++r[i[s] - 1];
7974
7974
  var o = new Sn(e);
@@ -7986,7 +7986,7 @@ var Kn = (function(i, e, t) {
7986
7986
  for (a = new Sn(n), s = 0; s < n; ++s)
7987
7987
  i[s] && (a[s] = Wi[o[i[s] - 1]++] >> 15 - i[s]);
7988
7988
  return a;
7989
- }), ts = new ct(288);
7989
+ }), ts = new lt(288);
7990
7990
  for (var Se = 0; Se < 144; ++Se)
7991
7991
  ts[Se] = 8;
7992
7992
  for (var Se = 144; Se < 256; ++Se)
@@ -7995,10 +7995,10 @@ for (var Se = 256; Se < 280; ++Se)
7995
7995
  ts[Se] = 7;
7996
7996
  for (var Se = 280; Se < 288; ++Se)
7997
7997
  ts[Se] = 8;
7998
- var ta = new ct(32);
7998
+ var ta = new lt(32);
7999
7999
  for (var Se = 0; Se < 32; ++Se)
8000
8000
  ta[Se] = 5;
8001
- var su = /* @__PURE__ */ Kn(ts, 9, 1), iu = /* @__PURE__ */ Kn(ta, 5, 1), Ei = function(i) {
8001
+ var su = /* @__PURE__ */ Xn(ts, 9, 1), iu = /* @__PURE__ */ Xn(ta, 5, 1), Ei = function(i) {
8002
8002
  for (var e = i[0], t = 1; t < i.length; ++t)
8003
8003
  i[t] > e && (e = i[t]);
8004
8004
  return e;
@@ -8011,7 +8011,7 @@ var su = /* @__PURE__ */ Kn(ts, 9, 1), iu = /* @__PURE__ */ Kn(ta, 5, 1), Ei = f
8011
8011
  }, ru = function(i) {
8012
8012
  return (i + 7) / 8 | 0;
8013
8013
  }, ou = function(i, e, t) {
8014
- return (t == null || t > i.length) && (t = i.length), new ct(i.subarray(e, t));
8014
+ return (t == null || t > i.length) && (t = i.length), new lt(i.subarray(e, t));
8015
8015
  }, au = [
8016
8016
  "unexpected EOF",
8017
8017
  "invalid block type",
@@ -8036,63 +8036,63 @@ var su = /* @__PURE__ */ Kn(ts, 9, 1), iu = /* @__PURE__ */ Kn(ta, 5, 1), Ei = f
8036
8036
  }, cu = function(i, e, t, n) {
8037
8037
  var s = i.length, r = 0;
8038
8038
  if (!s || e.f && !e.l)
8039
- return t || new ct(0);
8039
+ return t || new lt(0);
8040
8040
  var o = !t, a = o || e.i != 2, c = e.i;
8041
- o && (t = new ct(s * 3));
8041
+ o && (t = new lt(s * 3));
8042
8042
  var u = function(rn) {
8043
8043
  var It = t.length;
8044
8044
  if (rn > It) {
8045
- var ns = new ct(Math.max(It * 2, rn));
8045
+ var ns = new lt(Math.max(It * 2, rn));
8046
8046
  ns.set(t), t = ns;
8047
8047
  }
8048
- }, d = e.f || 0, h = e.p || 0, f = e.b || 0, p = e.l, g = e.d, x = e.m, _ = e.n, b = s * 8;
8048
+ }, d = e.f || 0, h = e.p || 0, f = e.b || 0, p = e.l, y = e.d, S = e.m, _ = e.n, x = s * 8;
8049
8049
  do {
8050
8050
  if (!p) {
8051
8051
  d = mt(i, h, 1);
8052
8052
  var E = mt(i, h + 1, 3);
8053
8053
  if (h += 3, E)
8054
8054
  if (E == 1)
8055
- p = su, g = iu, x = 9, _ = 5;
8055
+ p = su, y = iu, S = 9, _ = 5;
8056
8056
  else if (E == 2) {
8057
8057
  var P = mt(i, h, 31) + 257, I = mt(i, h + 10, 15) + 4, M = P + mt(i, h + 5, 31) + 1;
8058
8058
  h += 14;
8059
- for (var O = new ct(M), C = new ct(19), N = 0; N < I; ++N)
8059
+ for (var O = new lt(M), C = new lt(19), N = 0; N < I; ++N)
8060
8060
  C[Jh[N]] = mt(i, h + N * 3, 7);
8061
8061
  h += I * 3;
8062
- for (var D = Ei(C), H = (1 << D) - 1, j = Kn(C, D, 1), N = 0; N < M; ) {
8062
+ for (var D = Ei(C), H = (1 << D) - 1, j = Xn(C, D, 1), N = 0; N < M; ) {
8063
8063
  var q = j[mt(i, h, H)];
8064
8064
  h += q & 15;
8065
- var S = q >> 4;
8066
- if (S < 16)
8067
- O[N++] = S;
8065
+ var b = q >> 4;
8066
+ if (b < 16)
8067
+ O[N++] = b;
8068
8068
  else {
8069
8069
  var ie = 0, ke = 0;
8070
- for (S == 16 ? (ke = 3 + mt(i, h, 3), h += 2, ie = O[N - 1]) : S == 17 ? (ke = 3 + mt(i, h, 7), h += 3) : S == 18 && (ke = 11 + mt(i, h, 127), h += 7); ke--; )
8070
+ for (b == 16 ? (ke = 3 + mt(i, h, 3), h += 2, ie = O[N - 1]) : b == 17 ? (ke = 3 + mt(i, h, 7), h += 3) : b == 18 && (ke = 11 + mt(i, h, 127), h += 7); ke--; )
8071
8071
  O[N++] = ie;
8072
8072
  }
8073
8073
  }
8074
8074
  var dt = O.subarray(0, P), Me = O.subarray(P);
8075
- x = Ei(dt), _ = Ei(Me), p = Kn(dt, x, 1), g = Kn(Me, _, 1);
8075
+ S = Ei(dt), _ = Ei(Me), p = Xn(dt, S, 1), y = Xn(Me, _, 1);
8076
8076
  } else
8077
8077
  yt(1);
8078
8078
  else {
8079
- var S = ru(h) + 4, T = i[S - 4] | i[S - 3] << 8, A = S + T;
8079
+ var b = ru(h) + 4, T = i[b - 4] | i[b - 3] << 8, A = b + T;
8080
8080
  if (A > s) {
8081
8081
  c && yt(0);
8082
8082
  break;
8083
8083
  }
8084
- a && u(f + T), t.set(i.subarray(S, A), f), e.b = f += T, e.p = h = A * 8, e.f = d;
8084
+ a && u(f + T), t.set(i.subarray(b, A), f), e.b = f += T, e.p = h = A * 8, e.f = d;
8085
8085
  continue;
8086
8086
  }
8087
- if (h > b) {
8087
+ if (h > x) {
8088
8088
  c && yt(0);
8089
8089
  break;
8090
8090
  }
8091
8091
  }
8092
8092
  a && u(f + 131072);
8093
- for (var He = (1 << x) - 1, We = (1 << _) - 1, ve = h; ; ve = h) {
8093
+ for (var He = (1 << S) - 1, We = (1 << _) - 1, ve = h; ; ve = h) {
8094
8094
  var ie = p[Ti(i, h) & He], ge = ie >> 4;
8095
- if (h += ie & 15, h > b) {
8095
+ if (h += ie & 15, h > x) {
8096
8096
  c && yt(0);
8097
8097
  break;
8098
8098
  }
@@ -8107,35 +8107,35 @@ var su = /* @__PURE__ */ Kn(ts, 9, 1), iu = /* @__PURE__ */ Kn(ta, 5, 1), Ei = f
8107
8107
  var N = ge - 257, Ze = qo[N];
8108
8108
  St = mt(i, h, (1 << Ze) - 1) + ea[N], h += Ze;
8109
8109
  }
8110
- var Ft = g[Ti(i, h) & We], me = Ft >> 4;
8110
+ var Ft = y[Ti(i, h) & We], me = Ft >> 4;
8111
8111
  Ft || yt(3), h += Ft & 15;
8112
8112
  var Me = nu[me];
8113
8113
  if (me > 3) {
8114
8114
  var Ze = $o[me];
8115
8115
  Me += Ti(i, h) & (1 << Ze) - 1, h += Ze;
8116
8116
  }
8117
- if (h > b) {
8117
+ if (h > x) {
8118
8118
  c && yt(0);
8119
8119
  break;
8120
8120
  }
8121
8121
  a && u(f + 131072);
8122
8122
  var ft = f + St;
8123
8123
  if (f < Me) {
8124
- var pt = r - Me, vn = Math.min(Me, ft);
8125
- for (pt + f < 0 && yt(3); f < vn; ++f)
8124
+ var pt = r - Me, Rn = Math.min(Me, ft);
8125
+ for (pt + f < 0 && yt(3); f < Rn; ++f)
8126
8126
  t[f] = n[pt + f];
8127
8127
  }
8128
8128
  for (; f < ft; ++f)
8129
8129
  t[f] = t[f - Me];
8130
8130
  }
8131
8131
  }
8132
- e.l = p, e.p = ve, e.b = f, e.f = d, p && (d = 1, e.m = x, e.d = g, e.n = _);
8132
+ e.l = p, e.p = ve, e.b = f, e.f = d, p && (d = 1, e.m = S, e.d = y, e.n = _);
8133
8133
  } while (!d);
8134
8134
  return f != t.length && o ? ou(t, 0, f) : t.subarray(0, f);
8135
- }, lu = /* @__PURE__ */ new ct(0), hu = function(i, e) {
8135
+ }, lu = /* @__PURE__ */ new lt(0), hu = function(i, e) {
8136
8136
  return ((i[0] & 15) != 8 || i[0] >> 4 > 7 || (i[0] << 8 | i[1]) % 31) && yt(6, "invalid zlib data"), (i[1] >> 5 & 1) == 1 && yt(6, "invalid zlib data: " + (i[1] & 32 ? "need" : "unexpected") + " dictionary"), (i[1] >> 3 & 4) + 2;
8137
8137
  };
8138
- function Bn(i, e) {
8138
+ function Un(i, e) {
8139
8139
  return cu(i.subarray(hu(i), -4), { i: 2 }, e, e);
8140
8140
  }
8141
8141
  var uu = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), du = 0;
@@ -8162,11 +8162,11 @@ class fu extends Co {
8162
8162
  const O = Math.pow(2.7182818, 2.2);
8163
8163
  let C = null;
8164
8164
  function N(l, m) {
8165
- let y = 0;
8165
+ let g = 0;
8166
8166
  for (let L = 0; L < 65536; ++L)
8167
- (L == 0 || l[L >> 3] & 1 << (L & 7)) && (m[y++] = L);
8168
- const R = y - 1;
8169
- for (; y < 65536; ) m[y++] = 0;
8167
+ (L == 0 || l[L >> 3] & 1 << (L & 7)) && (m[g++] = L);
8168
+ const R = g - 1;
8169
+ for (; g < 65536; ) m[g++] = 0;
8170
8170
  return R;
8171
8171
  }
8172
8172
  function D(l) {
@@ -8174,34 +8174,34 @@ class fu extends Co {
8174
8174
  l[m] = {}, l[m].len = 0, l[m].lit = 0, l[m].p = null;
8175
8175
  }
8176
8176
  const H = { l: 0, c: 0, lc: 0 };
8177
- function j(l, m, y, R, L) {
8178
- for (; y < l; )
8179
- m = m << 8 | Er(R, L), y += 8;
8180
- y -= l, H.l = m >> y & (1 << l) - 1, H.c = m, H.lc = y;
8177
+ function j(l, m, g, R, L) {
8178
+ for (; g < l; )
8179
+ m = m << 8 | Er(R, L), g += 8;
8180
+ g -= l, H.l = m >> g & (1 << l) - 1, H.c = m, H.lc = g;
8181
8181
  }
8182
8182
  const q = new Array(59);
8183
8183
  function ie(l) {
8184
- for (let y = 0; y <= 58; ++y) q[y] = 0;
8185
- for (let y = 0; y < 65537; ++y) q[l[y]] += 1;
8184
+ for (let g = 0; g <= 58; ++g) q[g] = 0;
8185
+ for (let g = 0; g < 65537; ++g) q[l[g]] += 1;
8186
8186
  let m = 0;
8187
- for (let y = 58; y > 0; --y) {
8188
- const R = m + q[y] >> 1;
8189
- q[y] = m, m = R;
8187
+ for (let g = 58; g > 0; --g) {
8188
+ const R = m + q[g] >> 1;
8189
+ q[g] = m, m = R;
8190
8190
  }
8191
- for (let y = 0; y < 65537; ++y) {
8192
- const R = l[y];
8193
- R > 0 && (l[y] = R | q[R]++ << 6);
8191
+ for (let g = 0; g < 65537; ++g) {
8192
+ const R = l[g];
8193
+ R > 0 && (l[g] = R | q[R]++ << 6);
8194
8194
  }
8195
8195
  }
8196
- function ke(l, m, y, R, L, z) {
8196
+ function ke(l, m, g, R, L, z) {
8197
8197
  const v = m;
8198
8198
  let U = 0, F = 0;
8199
8199
  for (; R <= L; R++) {
8200
- if (v.value - m.value > y) return !1;
8200
+ if (v.value - m.value > g) return !1;
8201
8201
  j(6, U, F, l, v);
8202
8202
  const B = H.l;
8203
8203
  if (U = H.c, F = H.lc, z[R] = B, B == 63) {
8204
- if (v.value - m.value > y)
8204
+ if (v.value - m.value > g)
8205
8205
  throw new Error("THREE.EXRLoader: Something wrong with hufUnpackEncTable");
8206
8206
  j(8, U, F, l, v);
8207
8207
  let G = H.l + 6;
@@ -8225,8 +8225,8 @@ class fu extends Co {
8225
8225
  function Me(l) {
8226
8226
  return l >> 6;
8227
8227
  }
8228
- function He(l, m, y, R) {
8229
- for (; m <= y; m++) {
8228
+ function He(l, m, g, R) {
8229
+ for (; m <= g; m++) {
8230
8230
  const L = Me(l[m]), z = dt(l[m]);
8231
8231
  if (L >> z)
8232
8232
  throw new Error("THREE.EXRLoader: Invalid table entry");
@@ -8255,14 +8255,14 @@ class fu extends Co {
8255
8255
  return !0;
8256
8256
  }
8257
8257
  const We = { c: 0, lc: 0 };
8258
- function ve(l, m, y, R) {
8259
- l = l << 8 | Er(y, R), m += 8, We.c = l, We.lc = m;
8258
+ function ve(l, m, g, R) {
8259
+ l = l << 8 | Er(g, R), m += 8, We.c = l, We.lc = m;
8260
8260
  }
8261
8261
  const ge = { c: 0, lc: 0 };
8262
- function St(l, m, y, R, L, z, v, U, F) {
8262
+ function St(l, m, g, R, L, z, v, U, F) {
8263
8263
  if (l == m) {
8264
- R < 8 && (ve(y, R, L, z), y = We.c, R = We.lc), R -= 8;
8265
- let B = y >> R;
8264
+ R < 8 && (ve(g, R, L, z), g = We.c, R = We.lc), R -= 8;
8265
+ let B = g >> R;
8266
8266
  if (B = new Uint8Array([B])[0], U.value + B > F)
8267
8267
  return !1;
8268
8268
  const G = v[U.value - 1];
@@ -8272,7 +8272,7 @@ class fu extends Co {
8272
8272
  v[U.value++] = l;
8273
8273
  else
8274
8274
  return !1;
8275
- ge.c = y, ge.lc = R;
8275
+ ge.c = g, ge.lc = R;
8276
8276
  }
8277
8277
  function Ze(l) {
8278
8278
  return l & 65535;
@@ -8283,15 +8283,15 @@ class fu extends Co {
8283
8283
  }
8284
8284
  const me = { a: 0, b: 0 };
8285
8285
  function ft(l, m) {
8286
- const y = Ft(l), L = Ft(m), z = y + (L & 1) + (L >> 1), v = z, U = z - L;
8286
+ const g = Ft(l), L = Ft(m), z = g + (L & 1) + (L >> 1), v = z, U = z - L;
8287
8287
  me.a = v, me.b = U;
8288
8288
  }
8289
8289
  function pt(l, m) {
8290
- const y = Ze(l), R = Ze(m), L = y - (R >> 1) & 65535, z = R + L - 32768 & 65535;
8290
+ const g = Ze(l), R = Ze(m), L = g - (R >> 1) & 65535, z = R + L - 32768 & 65535;
8291
8291
  me.a = z, me.b = L;
8292
8292
  }
8293
- function vn(l, m, y, R, L, z, v) {
8294
- const U = v < 16384, F = y > L ? L : y;
8293
+ function Rn(l, m, g, R, L, z, v) {
8294
+ const U = v < 16384, F = g > L ? L : g;
8295
8295
  let B = 1, G, W;
8296
8296
  for (; B <= F; ) B <<= 1;
8297
8297
  for (B >>= 1, G = B, B >>= 1; B >= 1; ) {
@@ -8300,19 +8300,19 @@ class fu extends Co {
8300
8300
  let re, le, oe, ue;
8301
8301
  for (; W <= V; W += ee) {
8302
8302
  let ne = W;
8303
- const te = W + R * (y - G);
8303
+ const te = W + R * (g - G);
8304
8304
  for (; ne <= te; ne += Q) {
8305
8305
  const se = ne + K, ye = ne + X, fe = ye + K;
8306
8306
  U ? (ft(l[ne + m], l[ye + m]), re = me.a, oe = me.b, ft(l[se + m], l[fe + m]), le = me.a, ue = me.b, ft(re, le), l[ne + m] = me.a, l[se + m] = me.b, ft(oe, ue), l[ye + m] = me.a, l[fe + m] = me.b) : (pt(l[ne + m], l[ye + m]), re = me.a, oe = me.b, pt(l[se + m], l[fe + m]), le = me.a, ue = me.b, pt(re, le), l[ne + m] = me.a, l[se + m] = me.b, pt(oe, ue), l[ye + m] = me.a, l[fe + m] = me.b);
8307
8307
  }
8308
- if (y & B) {
8308
+ if (g & B) {
8309
8309
  const se = ne + X;
8310
8310
  U ? ft(l[ne + m], l[se + m]) : pt(l[ne + m], l[se + m]), re = me.a, l[se + m] = me.b, l[ne + m] = re;
8311
8311
  }
8312
8312
  }
8313
8313
  if (L & B) {
8314
8314
  let ne = W;
8315
- const te = W + R * (y - G);
8315
+ const te = W + R * (g - G);
8316
8316
  for (; ne <= te; ne += Q) {
8317
8317
  const se = ne + K;
8318
8318
  U ? ft(l[ne + m], l[se + m]) : pt(l[ne + m], l[se + m]), re = me.a, l[se + m] = me.b, l[ne + m] = re;
@@ -8322,14 +8322,14 @@ class fu extends Co {
8322
8322
  }
8323
8323
  return W;
8324
8324
  }
8325
- function rn(l, m, y, R, L, z, v, U, F) {
8325
+ function rn(l, m, g, R, L, z, v, U, F) {
8326
8326
  let B = 0, G = 0;
8327
8327
  const W = v, V = Math.trunc(R.value + (L + 7) / 8);
8328
8328
  for (; R.value < V; )
8329
- for (ve(B, G, y, R), B = We.c, G = We.lc; G >= 14; ) {
8329
+ for (ve(B, G, g, R), B = We.c, G = We.lc; G >= 14; ) {
8330
8330
  const ee = B >> G - 14 & 16383, K = m[ee];
8331
8331
  if (K.len)
8332
- G -= K.len, St(K.lit, z, B, G, y, R, U, F, W), B = ge.c, G = ge.lc;
8332
+ G -= K.len, St(K.lit, z, B, G, g, R, U, F, W), B = ge.c, G = ge.lc;
8333
8333
  else {
8334
8334
  if (!K.p)
8335
8335
  throw new Error("THREE.EXRLoader: hufDecode issues");
@@ -8337,9 +8337,9 @@ class fu extends Co {
8337
8337
  for (Q = 0; Q < K.lit; Q++) {
8338
8338
  const re = dt(l[K.p[Q]]);
8339
8339
  for (; G < re && R.value < V; )
8340
- ve(B, G, y, R), B = We.c, G = We.lc;
8340
+ ve(B, G, g, R), B = We.c, G = We.lc;
8341
8341
  if (G >= re && Me(l[K.p[Q]]) == (B >> G - re & (1 << re) - 1)) {
8342
- G -= re, St(K.p[Q], z, B, G, y, R, U, F, W), B = ge.c, G = ge.lc;
8342
+ G -= re, St(K.p[Q], z, B, G, g, R, U, F, W), B = ge.c, G = ge.lc;
8343
8343
  break;
8344
8344
  }
8345
8345
  }
@@ -8351,44 +8351,44 @@ class fu extends Co {
8351
8351
  for (B >>= X, G -= X; G > 0; ) {
8352
8352
  const ee = m[B << 14 - G & 16383];
8353
8353
  if (ee.len)
8354
- G -= ee.len, St(ee.lit, z, B, G, y, R, U, F, W), B = ge.c, G = ge.lc;
8354
+ G -= ee.len, St(ee.lit, z, B, G, g, R, U, F, W), B = ge.c, G = ge.lc;
8355
8355
  else
8356
8356
  throw new Error("THREE.EXRLoader: hufDecode issues");
8357
8357
  }
8358
8358
  return !0;
8359
8359
  }
8360
- function It(l, m, y, R, L, z) {
8361
- const v = { value: 0 }, U = y.value, F = st(m, y), B = st(m, y);
8362
- y.value += 4;
8363
- const G = st(m, y);
8364
- if (y.value += 4, F < 0 || F >= 65537 || B < 0 || B >= 65537)
8360
+ function It(l, m, g, R, L, z) {
8361
+ const v = { value: 0 }, U = g.value, F = st(m, g), B = st(m, g);
8362
+ g.value += 4;
8363
+ const G = st(m, g);
8364
+ if (g.value += 4, F < 0 || F >= 65537 || B < 0 || B >= 65537)
8365
8365
  throw new Error("THREE.EXRLoader: Something wrong with HUF_ENCSIZE");
8366
8366
  const W = new Array(65537), V = new Array(16384);
8367
8367
  D(V);
8368
- const X = R - (y.value - U);
8369
- if (ke(l, y, X, F, B, W), G > 8 * (R - (y.value - U)))
8368
+ const X = R - (g.value - U);
8369
+ if (ke(l, g, X, F, B, W), G > 8 * (R - (g.value - U)))
8370
8370
  throw new Error("THREE.EXRLoader: Something wrong with hufUncompress");
8371
- He(W, F, B, V), rn(W, V, l, y, G, B, z, L, v);
8371
+ He(W, F, B, V), rn(W, V, l, g, G, B, z, L, v);
8372
8372
  }
8373
- function ns(l, m, y) {
8374
- for (let R = 0; R < y; ++R)
8373
+ function ns(l, m, g) {
8374
+ for (let R = 0; R < g; ++R)
8375
8375
  m[R] = l[m[R]];
8376
8376
  }
8377
8377
  function ss(l) {
8378
8378
  for (let m = 1; m < l.length; m++) {
8379
- const y = l[m - 1] + l[m] - 128;
8380
- l[m] = y;
8379
+ const g = l[m - 1] + l[m] - 128;
8380
+ l[m] = g;
8381
8381
  }
8382
8382
  }
8383
8383
  function is(l, m) {
8384
- let y = 0, R = Math.floor((l.length + 1) / 2), L = 0;
8384
+ let g = 0, R = Math.floor((l.length + 1) / 2), L = 0;
8385
8385
  const z = l.length - 1;
8386
- for (; !(L > z || (m[L++] = l[y++], L > z)); )
8386
+ for (; !(L > z || (m[L++] = l[g++], L > z)); )
8387
8387
  m[L++] = l[R++];
8388
8388
  }
8389
8389
  function Qs(l) {
8390
8390
  let m = l.byteLength;
8391
- const y = new Array();
8391
+ const g = new Array();
8392
8392
  let R = 0;
8393
8393
  const L = new DataView(l);
8394
8394
  for (; m > 0; ) {
@@ -8397,20 +8397,20 @@ class fu extends Co {
8397
8397
  const v = -z;
8398
8398
  m -= v + 1;
8399
8399
  for (let U = 0; U < v; U++)
8400
- y.push(L.getUint8(R++));
8400
+ g.push(L.getUint8(R++));
8401
8401
  } else {
8402
8402
  const v = z;
8403
8403
  m -= 2;
8404
8404
  const U = L.getUint8(R++);
8405
8405
  for (let F = 0; F < v + 1; F++)
8406
- y.push(U);
8406
+ g.push(U);
8407
8407
  }
8408
8408
  }
8409
- return y;
8409
+ return g;
8410
8410
  }
8411
- function fa(l, m, y, R, L, z) {
8411
+ function fa(l, m, g, R, L, z) {
8412
8412
  let v = new DataView(z.buffer);
8413
- const U = y[l.idx[0]].width, F = y[l.idx[0]].height, B = 3, G = Math.floor(U / 8), W = Math.ceil(U / 8), V = Math.ceil(F / 8), X = U - (W - 1) * 8, ee = F - (V - 1) * 8, K = { value: 0 }, Q = new Array(B), re = new Array(B), le = new Array(B), oe = new Array(B), ue = new Array(B);
8413
+ const U = g[l.idx[0]].width, F = g[l.idx[0]].height, B = 3, G = Math.floor(U / 8), W = Math.ceil(U / 8), V = Math.ceil(F / 8), X = U - (W - 1) * 8, ee = F - (V - 1) * 8, K = { value: 0 }, Q = new Array(B), re = new Array(B), le = new Array(B), oe = new Array(B), ue = new Array(B);
8414
8414
  for (let te = 0; te < B; ++te)
8415
8415
  ue[te] = m[l.idx[te]], Q[te] = te < 1 ? 0 : Q[te - 1] + W * V, re[te] = new Float32Array(64), le[te] = new Uint16Array(64), oe[te] = new Uint16Array(W * 64);
8416
8416
  for (let te = 0; te < V; ++te) {
@@ -8427,7 +8427,7 @@ class fu extends Co {
8427
8427
  }
8428
8428
  let fe = 0;
8429
8429
  for (let ae = 0; ae < B; ++ae) {
8430
- const he = y[l.idx[ae]].type;
8430
+ const he = g[l.idx[ae]].type;
8431
8431
  for (let Ie = 8 * te; Ie < 8 * te + se; ++Ie) {
8432
8432
  fe = ue[ae][Ie];
8433
8433
  for (let it = 0; it < G; ++it) {
@@ -8446,9 +8446,9 @@ class fu extends Co {
8446
8446
  const ne = new Uint16Array(U);
8447
8447
  v = new DataView(z.buffer);
8448
8448
  for (let te = 0; te < B; ++te) {
8449
- y[l.idx[te]].decoded = !0;
8450
- const se = y[l.idx[te]].type;
8451
- if (y[te].type == 2)
8449
+ g[l.idx[te]].decoded = !0;
8450
+ const se = g[l.idx[te]].type;
8451
+ if (g[te].type == 2)
8452
8452
  for (let ye = 0; ye < F; ++ye) {
8453
8453
  const fe = ue[te][ye];
8454
8454
  for (let ae = 0; ae < U; ++ae)
@@ -8458,8 +8458,8 @@ class fu extends Co {
8458
8458
  }
8459
8459
  }
8460
8460
  }
8461
- function pa(l, m, y, R, L, z) {
8462
- const v = new DataView(z.buffer), U = y[l], F = U.width, B = U.height, G = Math.ceil(F / 8), W = Math.ceil(B / 8), V = Math.floor(F / 8), X = F - (G - 1) * 8, ee = B - (W - 1) * 8, K = { value: 0 };
8461
+ function pa(l, m, g, R, L, z) {
8462
+ const v = new DataView(z.buffer), U = g[l], F = U.width, B = U.height, G = Math.ceil(F / 8), W = Math.ceil(B / 8), V = Math.floor(F / 8), X = F - (G - 1) * 8, ee = B - (W - 1) * 8, K = { value: 0 };
8463
8463
  let Q = 0;
8464
8464
  const re = new Float32Array(64), le = new Uint16Array(64), oe = new Uint16Array(G * 64);
8465
8465
  for (let ue = 0; ue < W; ++ue) {
@@ -8484,32 +8484,32 @@ class fu extends Co {
8484
8484
  }
8485
8485
  U.decoded = !0;
8486
8486
  }
8487
- function pr(l, m, y) {
8487
+ function pr(l, m, g) {
8488
8488
  let R, L = 1;
8489
8489
  for (; L < 64; )
8490
- R = m[l.value], R == 65280 ? L = 64 : R >> 8 == 255 ? L += R & 255 : (y[L] = R, L++), l.value++;
8490
+ R = m[l.value], R == 65280 ? L = 64 : R >> 8 == 255 ? L += R & 255 : (g[L] = R, L++), l.value++;
8491
8491
  }
8492
8492
  function mr(l, m) {
8493
8493
  m[0] = J(l[0]), m[1] = J(l[1]), m[2] = J(l[5]), m[3] = J(l[6]), m[4] = J(l[14]), m[5] = J(l[15]), m[6] = J(l[27]), m[7] = J(l[28]), m[8] = J(l[2]), m[9] = J(l[4]), m[10] = J(l[7]), m[11] = J(l[13]), m[12] = J(l[16]), m[13] = J(l[26]), m[14] = J(l[29]), m[15] = J(l[42]), m[16] = J(l[3]), m[17] = J(l[8]), m[18] = J(l[12]), m[19] = J(l[17]), m[20] = J(l[25]), m[21] = J(l[30]), m[22] = J(l[41]), m[23] = J(l[43]), m[24] = J(l[9]), m[25] = J(l[11]), m[26] = J(l[18]), m[27] = J(l[24]), m[28] = J(l[31]), m[29] = J(l[40]), m[30] = J(l[44]), m[31] = J(l[53]), m[32] = J(l[10]), m[33] = J(l[19]), m[34] = J(l[23]), m[35] = J(l[32]), m[36] = J(l[39]), m[37] = J(l[45]), m[38] = J(l[52]), m[39] = J(l[54]), m[40] = J(l[20]), m[41] = J(l[22]), m[42] = J(l[33]), m[43] = J(l[38]), m[44] = J(l[46]), m[45] = J(l[51]), m[46] = J(l[55]), m[47] = J(l[60]), m[48] = J(l[21]), m[49] = J(l[34]), m[50] = J(l[37]), m[51] = J(l[47]), m[52] = J(l[50]), m[53] = J(l[56]), m[54] = J(l[59]), m[55] = J(l[61]), m[56] = J(l[35]), m[57] = J(l[36]), m[58] = J(l[48]), m[59] = J(l[49]), m[60] = J(l[57]), m[61] = J(l[58]), m[62] = J(l[62]), m[63] = J(l[63]);
8494
8494
  }
8495
8495
  function gr(l) {
8496
- const m = 0.5 * Math.cos(0.7853975), y = 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), U = 0.5 * Math.cos(7 * 3.14159 / 16), F = new Array(4), B = new Array(4), G = new Array(4), W = new Array(4);
8496
+ 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), U = 0.5 * Math.cos(7 * 3.14159 / 16), F = new Array(4), B = new Array(4), G = new Array(4), W = new Array(4);
8497
8497
  for (let V = 0; V < 8; ++V) {
8498
8498
  const X = V * 8;
8499
- F[0] = R * l[X + 2], F[1] = v * l[X + 2], F[2] = R * l[X + 6], F[3] = v * l[X + 6], B[0] = y * l[X + 1] + L * l[X + 3] + z * l[X + 5] + U * l[X + 7], B[1] = L * l[X + 1] - U * l[X + 3] - y * l[X + 5] - z * l[X + 7], B[2] = z * l[X + 1] - y * l[X + 3] + U * l[X + 5] + L * l[X + 7], B[3] = U * l[X + 1] - z * l[X + 3] + L * l[X + 5] - y * l[X + 7], G[0] = m * (l[X + 0] + l[X + 4]), G[3] = m * (l[X + 0] - l[X + 4]), G[1] = F[0] + F[3], G[2] = F[1] - F[2], W[0] = G[0] + G[1], W[1] = G[3] + G[2], W[2] = G[3] - G[2], W[3] = G[0] - G[1], l[X + 0] = W[0] + B[0], l[X + 1] = W[1] + B[1], l[X + 2] = W[2] + B[2], l[X + 3] = W[3] + B[3], l[X + 4] = W[3] - B[3], l[X + 5] = W[2] - B[2], l[X + 6] = W[1] - B[1], l[X + 7] = W[0] - B[0];
8499
+ F[0] = R * l[X + 2], F[1] = v * l[X + 2], F[2] = R * l[X + 6], F[3] = v * l[X + 6], B[0] = g * l[X + 1] + L * l[X + 3] + z * l[X + 5] + U * l[X + 7], B[1] = L * l[X + 1] - U * l[X + 3] - g * l[X + 5] - z * l[X + 7], B[2] = z * l[X + 1] - g * l[X + 3] + U * l[X + 5] + L * l[X + 7], B[3] = U * l[X + 1] - z * l[X + 3] + L * l[X + 5] - g * l[X + 7], G[0] = m * (l[X + 0] + l[X + 4]), G[3] = m * (l[X + 0] - l[X + 4]), G[1] = F[0] + F[3], G[2] = F[1] - F[2], W[0] = G[0] + G[1], W[1] = G[3] + G[2], W[2] = G[3] - G[2], W[3] = G[0] - G[1], l[X + 0] = W[0] + B[0], l[X + 1] = W[1] + B[1], l[X + 2] = W[2] + B[2], l[X + 3] = W[3] + B[3], l[X + 4] = W[3] - B[3], l[X + 5] = W[2] - B[2], l[X + 6] = W[1] - B[1], l[X + 7] = W[0] - B[0];
8500
8500
  }
8501
8501
  for (let V = 0; V < 8; ++V)
8502
- F[0] = R * l[16 + V], F[1] = v * l[16 + V], F[2] = R * l[48 + V], F[3] = v * l[48 + V], B[0] = y * l[8 + V] + L * l[24 + V] + z * l[40 + V] + U * l[56 + V], B[1] = L * l[8 + V] - U * l[24 + V] - y * l[40 + V] - z * l[56 + V], B[2] = z * l[8 + V] - y * l[24 + V] + U * l[40 + V] + L * l[56 + V], B[3] = U * l[8 + V] - z * l[24 + V] + L * l[40 + V] - y * l[56 + V], G[0] = m * (l[V] + l[32 + V]), G[3] = m * (l[V] - l[32 + V]), G[1] = F[0] + F[3], G[2] = F[1] - F[2], W[0] = G[0] + G[1], W[1] = G[3] + G[2], W[2] = G[3] - G[2], W[3] = G[0] - G[1], l[0 + V] = W[0] + B[0], l[8 + V] = W[1] + B[1], l[16 + V] = W[2] + B[2], l[24 + V] = W[3] + B[3], l[32 + V] = W[3] - B[3], l[40 + V] = W[2] - B[2], l[48 + V] = W[1] - B[1], l[56 + V] = W[0] - B[0];
8502
+ F[0] = R * l[16 + V], F[1] = v * l[16 + V], F[2] = R * l[48 + V], F[3] = v * l[48 + V], B[0] = g * l[8 + V] + L * l[24 + V] + z * l[40 + V] + U * l[56 + V], B[1] = L * l[8 + V] - U * l[24 + V] - g * l[40 + V] - z * l[56 + V], B[2] = z * l[8 + V] - g * l[24 + V] + U * l[40 + V] + L * l[56 + V], B[3] = U * l[8 + V] - z * l[24 + V] + L * l[40 + V] - g * l[56 + V], G[0] = m * (l[V] + l[32 + V]), G[3] = m * (l[V] - l[32 + V]), G[1] = F[0] + F[3], G[2] = F[1] - F[2], W[0] = G[0] + G[1], W[1] = G[3] + G[2], W[2] = G[3] - G[2], W[3] = G[0] - G[1], l[0 + V] = W[0] + B[0], l[8 + V] = W[1] + B[1], l[16 + V] = W[2] + B[2], l[24 + V] = W[3] + B[3], l[32 + V] = W[3] - B[3], l[40 + V] = W[2] - B[2], l[48 + V] = W[1] - B[1], l[56 + V] = W[0] - B[0];
8503
8503
  }
8504
8504
  function ma(l) {
8505
8505
  for (let m = 0; m < 64; ++m) {
8506
- const y = l[0][m], R = l[1][m], L = l[2][m];
8507
- l[0][m] = y + 1.5747 * L, l[1][m] = y - 0.1873 * R - 0.4682 * L, l[2][m] = y + 1.8556 * R;
8506
+ const g = l[0][m], R = l[1][m], L = l[2][m];
8507
+ l[0][m] = g + 1.5747 * L, l[1][m] = g - 0.1873 * R - 0.4682 * L, l[2][m] = g + 1.8556 * R;
8508
8508
  }
8509
8509
  }
8510
- function yr(l, m, y) {
8510
+ function yr(l, m, g) {
8511
8511
  for (let R = 0; R < 64; ++R)
8512
- m[y + R] = Et.toHalfFloat(ga(l[R]));
8512
+ m[g + R] = Et.toHalfFloat(ga(l[R]));
8513
8513
  }
8514
8514
  function ga(l) {
8515
8515
  return l <= 1 ? Math.sign(l) * Math.pow(Math.abs(l), 2.2) : Math.sign(l) * Math.pow(O, Math.abs(l) - 1);
@@ -8518,31 +8518,31 @@ class fu extends Co {
8518
8518
  return new DataView(l.array.buffer, l.offset.value, l.size);
8519
8519
  }
8520
8520
  function ya(l) {
8521
- const m = l.viewer.buffer.slice(l.offset.value, l.offset.value + l.size), y = new Uint8Array(Qs(m)), R = new Uint8Array(y.length);
8522
- return ss(y), is(y, R), new DataView(R.buffer);
8521
+ const m = l.viewer.buffer.slice(l.offset.value, l.offset.value + l.size), g = new Uint8Array(Qs(m)), R = new Uint8Array(g.length);
8522
+ return ss(g), is(g, R), new DataView(R.buffer);
8523
8523
  }
8524
8524
  function Js(l) {
8525
- const m = l.array.slice(l.offset.value, l.offset.value + l.size), y = Bn(m), R = new Uint8Array(y.length);
8526
- return ss(y), is(y, R), new DataView(R.buffer);
8525
+ const m = l.array.slice(l.offset.value, l.offset.value + l.size), g = Un(m), R = new Uint8Array(g.length);
8526
+ return ss(g), is(g, R), new DataView(R.buffer);
8527
8527
  }
8528
8528
  function wa(l) {
8529
- const m = l.viewer, y = { value: l.offset.value }, R = new Uint16Array(l.columns * l.lines * (l.inputChannels.length * l.type)), L = new Uint8Array(8192);
8529
+ 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);
8530
8530
  let z = 0;
8531
8531
  const v = new Array(l.inputChannels.length);
8532
8532
  for (let ee = 0, K = l.inputChannels.length; ee < K; ee++)
8533
8533
  v[ee] = {}, v[ee].start = z, v[ee].end = v[ee].start, v[ee].nx = l.columns, v[ee].ny = l.lines, v[ee].size = l.type, z += v[ee].nx * v[ee].ny * v[ee].size;
8534
- const U = Rn(m, y), F = Rn(m, y);
8534
+ const U = Mn(m, g), F = Mn(m, g);
8535
8535
  if (F >= 8192)
8536
8536
  throw new Error("THREE.EXRLoader: Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");
8537
8537
  if (U <= F)
8538
8538
  for (let ee = 0; ee < F - U + 1; ee++)
8539
- L[ee + U] = zt(m, y);
8540
- const B = new Uint16Array(65536), G = N(L, B), W = st(m, y);
8541
- It(l.array, m, y, W, R, z);
8539
+ L[ee + U] = zt(m, g);
8540
+ const B = new Uint16Array(65536), G = N(L, B), W = st(m, g);
8541
+ It(l.array, m, g, W, R, z);
8542
8542
  for (let ee = 0; ee < l.inputChannels.length; ++ee) {
8543
8543
  const K = v[ee];
8544
8544
  for (let Q = 0; Q < v[ee].size; ++Q)
8545
- vn(
8545
+ Rn(
8546
8546
  R,
8547
8547
  K.start + Q,
8548
8548
  K.nx,
@@ -8563,7 +8563,7 @@ class fu extends Co {
8563
8563
  return new DataView(X.buffer);
8564
8564
  }
8565
8565
  function Ea(l) {
8566
- const m = l.array.slice(l.offset.value, l.offset.value + l.size), y = Bn(m), R = l.inputChannels.length * l.lines * l.columns * l.totalBytes, L = new ArrayBuffer(R), z = new DataView(L);
8566
+ const m = l.array.slice(l.offset.value, l.offset.value + l.size), g = Un(m), R = l.inputChannels.length * l.lines * l.columns * l.totalBytes, L = new ArrayBuffer(R), z = new DataView(L);
8567
8567
  let v = 0, U = 0;
8568
8568
  const F = new Array(4);
8569
8569
  for (let B = 0; B < l.lines; B++)
@@ -8573,14 +8573,14 @@ class fu extends Co {
8573
8573
  case 1:
8574
8574
  F[0] = v, F[1] = F[0] + l.columns, v = F[1] + l.columns;
8575
8575
  for (let X = 0; X < l.columns; ++X) {
8576
- const ee = y[F[0]++] << 8 | y[F[1]++];
8576
+ const ee = g[F[0]++] << 8 | g[F[1]++];
8577
8577
  W += ee, z.setUint16(U, W, !0), U += 2;
8578
8578
  }
8579
8579
  break;
8580
8580
  case 2:
8581
8581
  F[0] = v, F[1] = F[0] + l.columns, F[2] = F[1] + l.columns, v = F[2] + l.columns;
8582
8582
  for (let X = 0; X < l.columns; ++X) {
8583
- const ee = y[F[0]++] << 24 | y[F[1]++] << 16 | y[F[2]++] << 8;
8583
+ const ee = g[F[0]++] << 24 | g[F[1]++] << 16 | g[F[2]++] << 8;
8584
8584
  W += ee, z.setUint32(U, W, !0), U += 4;
8585
8585
  }
8586
8586
  break;
@@ -8590,7 +8590,7 @@ class fu extends Co {
8590
8590
  }
8591
8591
  function Ta(l) {
8592
8592
  const m = l.array;
8593
- let y = l.offset.value;
8593
+ let g = l.offset.value;
8594
8594
  const R = l.columns, L = l.lines, z = l.inputChannels, v = l.totalBytes, U = Xe.compression === "B44A_COMPRESSION", F = new Uint8Array(L * R * v), B = new Uint16Array(16);
8595
8595
  let G = 0;
8596
8596
  for (let W = 0; W < z.length; W++) {
@@ -8600,23 +8600,23 @@ class fu extends Co {
8600
8600
  if (Q) {
8601
8601
  const ue = oe * R * v + G * R;
8602
8602
  for (let ne = 0; ne < ee * X; ne++)
8603
- F[ue + ne] = m[y++];
8603
+ F[ue + ne] = m[g++];
8604
8604
  } else
8605
- y += ee * X;
8605
+ g += ee * X;
8606
8606
  G += X;
8607
8607
  continue;
8608
8608
  }
8609
8609
  const re = Math.ceil(ee / 4), le = Math.ceil(K / 4);
8610
8610
  for (let oe = 0; oe < le; oe++)
8611
8611
  for (let ue = 0; ue < re; ue++) {
8612
- if (U && m[y + 2] >= 52) {
8613
- const ne = m[y] << 8 | m[y + 1], te = ne & 32768 ? ne & 32767 : ~ne & 65535;
8614
- B.fill(te), y += 3;
8612
+ if (U && m[g + 2] >= 52) {
8613
+ const ne = m[g] << 8 | m[g + 1], te = ne & 32768 ? ne & 32767 : ~ne & 65535;
8614
+ B.fill(te), g += 3;
8615
8615
  } else {
8616
- const ne = m[y] << 8 | m[y + 1], te = m[y + 2] >> 2, se = 32 << te, ye = ne + ((m[y + 2] << 4 | m[y + 3] >> 4) & 63) * (1 << te) - se & 65535, fe = ye + ((m[y + 3] << 2 | m[y + 4] >> 6) & 63) * (1 << te) - se & 65535, ae = fe + (m[y + 4] & 63) * (1 << te) - se & 65535, he = ne + (m[y + 5] >> 2 & 63) * (1 << te) - se & 65535, Ie = ye + ((m[y + 5] << 4 | m[y + 6] >> 4) & 63) * (1 << te) - se & 65535, it = fe + ((m[y + 6] << 2 | m[y + 7] >> 6) & 63) * (1 << te) - se & 65535, _e = ae + (m[y + 7] & 63) * (1 << te) - se & 65535, bt = he + (m[y + 8] >> 2 & 63) * (1 << te) - se & 65535, on = Ie + ((m[y + 8] << 4 | m[y + 9] >> 4) & 63) * (1 << te) - se & 65535, Mn = it + ((m[y + 9] << 2 | m[y + 10] >> 6) & 63) * (1 << te) - se & 65535, xt = _e + (m[y + 10] & 63) * (1 << te) - se & 65535, Xt = bt + (m[y + 11] >> 2 & 63) * (1 << te) - se & 65535, hs = on + ((m[y + 11] << 4 | m[y + 12] >> 4) & 63) * (1 << te) - se & 65535, us = Mn + ((m[y + 12] << 2 | m[y + 13] >> 6) & 63) * (1 << te) - se & 65535, ds = xt + (m[y + 13] & 63) * (1 << te) - se & 65535, In = [ne, he, bt, Xt, ye, Ie, on, hs, fe, it, Mn, us, ae, _e, xt, ds];
8616
+ const ne = m[g] << 8 | m[g + 1], te = m[g + 2] >> 2, se = 32 << te, ye = ne + ((m[g + 2] << 4 | m[g + 3] >> 4) & 63) * (1 << te) - se & 65535, fe = ye + ((m[g + 3] << 2 | m[g + 4] >> 6) & 63) * (1 << te) - se & 65535, ae = fe + (m[g + 4] & 63) * (1 << te) - se & 65535, he = ne + (m[g + 5] >> 2 & 63) * (1 << te) - se & 65535, Ie = ye + ((m[g + 5] << 4 | m[g + 6] >> 4) & 63) * (1 << te) - se & 65535, it = fe + ((m[g + 6] << 2 | m[g + 7] >> 6) & 63) * (1 << te) - se & 65535, _e = ae + (m[g + 7] & 63) * (1 << te) - se & 65535, bt = he + (m[g + 8] >> 2 & 63) * (1 << te) - se & 65535, on = Ie + ((m[g + 8] << 4 | m[g + 9] >> 4) & 63) * (1 << te) - se & 65535, In = it + ((m[g + 9] << 2 | m[g + 10] >> 6) & 63) * (1 << te) - se & 65535, xt = _e + (m[g + 10] & 63) * (1 << te) - se & 65535, Xt = bt + (m[g + 11] >> 2 & 63) * (1 << te) - se & 65535, hs = on + ((m[g + 11] << 4 | m[g + 12] >> 4) & 63) * (1 << te) - se & 65535, us = In + ((m[g + 12] << 2 | m[g + 13] >> 6) & 63) * (1 << te) - se & 65535, ds = xt + (m[g + 13] & 63) * (1 << te) - se & 65535, Cn = [ne, he, bt, Xt, ye, Ie, on, hs, fe, it, In, us, ae, _e, xt, ds];
8617
8617
  for (let an = 0; an < 16; an++)
8618
- B[an] = In[an] & 32768 ? In[an] & 32767 : ~In[an] & 65535;
8619
- y += 14;
8618
+ B[an] = Cn[an] & 32768 ? Cn[an] & 32767 : ~Cn[an] & 65535;
8619
+ g += 14;
8620
8620
  }
8621
8621
  if (V.pLinear) {
8622
8622
  if (C === null) {
@@ -8656,25 +8656,25 @@ class fu extends Co {
8656
8656
  return new DataView(F.buffer);
8657
8657
  }
8658
8658
  function wr(l) {
8659
- const m = l.viewer, y = { value: l.offset.value }, R = new Uint8Array(l.columns * l.lines * (l.inputChannels.length * l.type * 2)), L = {
8660
- version: Fe(m, y),
8661
- unknownUncompressedSize: Fe(m, y),
8662
- unknownCompressedSize: Fe(m, y),
8663
- acCompressedSize: Fe(m, y),
8664
- dcCompressedSize: Fe(m, y),
8665
- rleCompressedSize: Fe(m, y),
8666
- rleUncompressedSize: Fe(m, y),
8667
- rleRawSize: Fe(m, y),
8668
- totalAcUncompressedCount: Fe(m, y),
8669
- totalDcUncompressedCount: Fe(m, y),
8670
- acCompression: Fe(m, y)
8659
+ const m = l.viewer, g = { value: l.offset.value }, R = new Uint8Array(l.columns * l.lines * (l.inputChannels.length * l.type * 2)), L = {
8660
+ version: Fe(m, g),
8661
+ unknownUncompressedSize: Fe(m, g),
8662
+ unknownCompressedSize: Fe(m, g),
8663
+ acCompressedSize: Fe(m, g),
8664
+ dcCompressedSize: Fe(m, g),
8665
+ rleCompressedSize: Fe(m, g),
8666
+ rleUncompressedSize: Fe(m, g),
8667
+ rleRawSize: Fe(m, g),
8668
+ totalAcUncompressedCount: Fe(m, g),
8669
+ totalDcUncompressedCount: Fe(m, g),
8670
+ acCompression: Fe(m, g)
8671
8671
  };
8672
8672
  if (L.version < 2)
8673
8673
  throw new Error("THREE.EXRLoader: " + Xe.compression + " version " + L.version + " is unsupported");
8674
8674
  const z = new Array();
8675
- let v = Rn(m, y) - 2;
8675
+ let v = Mn(m, g) - 2;
8676
8676
  for (; v > 0; ) {
8677
- const K = os(m.buffer, y), Q = zt(m, y), re = Q >> 2 & 3, le = (Q >> 4) - 1, oe = new Int8Array([le])[0], ue = zt(m, y);
8677
+ const K = os(m.buffer, g), Q = zt(m, g), re = Q >> 2 & 3, le = (Q >> 4) - 1, oe = new Int8Array([le])[0], ue = zt(m, g);
8678
8678
  z.push({
8679
8679
  name: K,
8680
8680
  index: oe,
@@ -8701,24 +8701,24 @@ class fu extends Co {
8701
8701
  if (L.acCompressedSize > 0)
8702
8702
  switch (L.acCompression) {
8703
8703
  case 0:
8704
- G = new Uint16Array(L.totalAcUncompressedCount), It(l.array, m, y, L.acCompressedSize, G, L.totalAcUncompressedCount);
8704
+ G = new Uint16Array(L.totalAcUncompressedCount), It(l.array, m, g, L.acCompressedSize, G, L.totalAcUncompressedCount);
8705
8705
  break;
8706
8706
  case 1:
8707
- const K = l.array.slice(y.value, y.value + L.totalAcUncompressedCount), Q = Bn(K);
8708
- G = new Uint16Array(Q.buffer), y.value += L.totalAcUncompressedCount;
8707
+ const K = l.array.slice(g.value, g.value + L.totalAcUncompressedCount), Q = Un(K);
8708
+ G = new Uint16Array(Q.buffer), g.value += L.totalAcUncompressedCount;
8709
8709
  break;
8710
8710
  }
8711
8711
  if (L.dcCompressedSize > 0) {
8712
8712
  const K = {
8713
8713
  array: l.array,
8714
- offset: y,
8714
+ offset: g,
8715
8715
  size: L.dcCompressedSize
8716
8716
  };
8717
- W = new Uint16Array(Js(K).buffer), y.value += L.dcCompressedSize;
8717
+ W = new Uint16Array(Js(K).buffer), g.value += L.dcCompressedSize;
8718
8718
  }
8719
8719
  if (L.rleRawSize > 0) {
8720
- const K = l.array.slice(y.value, y.value + L.rleCompressedSize), Q = Bn(K);
8721
- V = Qs(Q.buffer), y.value += L.rleCompressedSize;
8720
+ const K = l.array.slice(g.value, g.value + L.rleCompressedSize), Q = Un(K);
8721
+ V = Qs(Q.buffer), g.value += L.rleCompressedSize;
8722
8722
  }
8723
8723
  let X = 0;
8724
8724
  const ee = new Array(F.length);
@@ -8754,73 +8754,73 @@ class fu extends Co {
8754
8754
  return new DataView(R.buffer);
8755
8755
  }
8756
8756
  function os(l, m) {
8757
- const y = new Uint8Array(l);
8757
+ const g = new Uint8Array(l);
8758
8758
  let R = 0;
8759
- for (; y[m.value + R] != 0; )
8759
+ for (; g[m.value + R] != 0; )
8760
8760
  R += 1;
8761
8761
  const L = new TextDecoder().decode(
8762
- y.slice(m.value, m.value + R)
8762
+ g.slice(m.value, m.value + R)
8763
8763
  );
8764
8764
  return m.value = m.value + R + 1, L;
8765
8765
  }
8766
- function _a(l, m, y) {
8766
+ function _a(l, m, g) {
8767
8767
  const R = new TextDecoder().decode(
8768
- new Uint8Array(l).slice(m.value, m.value + y)
8768
+ new Uint8Array(l).slice(m.value, m.value + g)
8769
8769
  );
8770
- return m.value = m.value + y, R;
8770
+ return m.value = m.value + g, R;
8771
8771
  }
8772
8772
  function Sa(l, m) {
8773
- const y = et(l, m), R = st(l, m);
8774
- return [y, R];
8773
+ const g = et(l, m), R = st(l, m);
8774
+ return [g, R];
8775
8775
  }
8776
8776
  function ba(l, m) {
8777
- const y = st(l, m), R = st(l, m);
8778
- return [y, R];
8777
+ const g = st(l, m), R = st(l, m);
8778
+ return [g, R];
8779
8779
  }
8780
8780
  function et(l, m) {
8781
- const y = l.getInt32(m.value, !0);
8782
- return m.value = m.value + 4, y;
8781
+ const g = l.getInt32(m.value, !0);
8782
+ return m.value = m.value + 4, g;
8783
8783
  }
8784
8784
  function st(l, m) {
8785
- const y = l.getUint32(m.value, !0);
8786
- return m.value = m.value + 4, y;
8785
+ const g = l.getUint32(m.value, !0);
8786
+ return m.value = m.value + 4, g;
8787
8787
  }
8788
8788
  function Er(l, m) {
8789
- const y = l[m.value];
8790
- return m.value = m.value + 1, y;
8789
+ const g = l[m.value];
8790
+ return m.value = m.value + 1, g;
8791
8791
  }
8792
8792
  function zt(l, m) {
8793
- const y = l.getUint8(m.value);
8794
- return m.value = m.value + 1, y;
8793
+ const g = l.getUint8(m.value);
8794
+ return m.value = m.value + 1, g;
8795
8795
  }
8796
8796
  const Fe = function(l, m) {
8797
- const y = Number(l.getBigInt64(m.value, !0));
8798
- return m.value += 8, y;
8797
+ const g = Number(l.getBigInt64(m.value, !0));
8798
+ return m.value += 8, g;
8799
8799
  };
8800
8800
  function Ke(l, m) {
8801
- const y = l.getFloat32(m.value, !0);
8802
- return m.value += 4, y;
8801
+ const g = l.getFloat32(m.value, !0);
8802
+ return m.value += 4, g;
8803
8803
  }
8804
8804
  function xa(l, m) {
8805
8805
  return Et.toHalfFloat(Ke(l, m));
8806
8806
  }
8807
8807
  function J(l) {
8808
- const m = (l & 31744) >> 10, y = l & 1023;
8809
- return (l >> 15 ? -1 : 1) * (m ? m === 31 ? y ? NaN : 1 / 0 : Math.pow(2, m - 15) * (1 + y / 1024) : 6103515625e-14 * (y / 1024));
8808
+ const m = (l & 31744) >> 10, g = l & 1023;
8809
+ return (l >> 15 ? -1 : 1) * (m ? m === 31 ? g ? NaN : 1 / 0 : Math.pow(2, m - 15) * (1 + g / 1024) : 6103515625e-14 * (g / 1024));
8810
8810
  }
8811
- function Rn(l, m) {
8812
- const y = l.getUint16(m.value, !0);
8813
- return m.value += 2, y;
8811
+ function Mn(l, m) {
8812
+ const g = l.getUint16(m.value, !0);
8813
+ return m.value += 2, g;
8814
8814
  }
8815
8815
  function Aa(l, m) {
8816
- return J(Rn(l, m));
8817
- }
8818
- function va(l, m, y, R) {
8819
- const L = y.value, z = [];
8820
- for (; y.value < L + R - 1; ) {
8821
- const v = os(m, y), U = et(l, y), F = zt(l, y);
8822
- y.value += 3;
8823
- const B = et(l, y), G = et(l, y);
8816
+ return J(Mn(l, m));
8817
+ }
8818
+ function va(l, m, g, R) {
8819
+ const L = g.value, z = [];
8820
+ for (; g.value < L + R - 1; ) {
8821
+ const v = os(m, g), U = et(l, g), F = zt(l, g);
8822
+ g.value += 3;
8823
+ const B = et(l, g), G = et(l, g);
8824
8824
  z.push({
8825
8825
  name: v,
8826
8826
  pixelType: U,
@@ -8829,14 +8829,14 @@ class fu extends Co {
8829
8829
  ySampling: G
8830
8830
  });
8831
8831
  }
8832
- return y.value += 1, z;
8832
+ return g.value += 1, z;
8833
8833
  }
8834
8834
  function Ra(l, m) {
8835
- const y = Ke(l, m), R = Ke(l, m), L = Ke(l, m), z = Ke(l, m), v = Ke(l, m), U = Ke(l, m), F = Ke(l, m), B = Ke(l, m);
8836
- return { redX: y, redY: R, greenX: L, greenY: z, blueX: v, blueY: U, whiteX: F, whiteY: B };
8835
+ const g = Ke(l, m), R = Ke(l, m), L = Ke(l, m), z = Ke(l, m), v = Ke(l, m), U = Ke(l, m), F = Ke(l, m), B = Ke(l, m);
8836
+ return { redX: g, redY: R, greenX: L, greenY: z, blueX: v, blueY: U, whiteX: F, whiteY: B };
8837
8837
  }
8838
8838
  function Ma(l, m) {
8839
- const y = [
8839
+ const g = [
8840
8840
  "NO_COMPRESSION",
8841
8841
  "RLE_COMPRESSION",
8842
8842
  "ZIPS_COMPRESSION",
@@ -8848,29 +8848,29 @@ class fu extends Co {
8848
8848
  "DWAA_COMPRESSION",
8849
8849
  "DWAB_COMPRESSION"
8850
8850
  ], R = zt(l, m);
8851
- return y[R];
8851
+ return g[R];
8852
8852
  }
8853
8853
  function Ia(l, m) {
8854
- const y = et(l, m), R = et(l, m), L = et(l, m), z = et(l, m);
8855
- return { xMin: y, yMin: R, xMax: L, yMax: z };
8854
+ const g = et(l, m), R = et(l, m), L = et(l, m), z = et(l, m);
8855
+ return { xMin: g, yMin: R, xMax: L, yMax: z };
8856
8856
  }
8857
8857
  function Ca(l, m) {
8858
- const y = [
8858
+ const g = [
8859
8859
  "INCREASING_Y",
8860
8860
  "DECREASING_Y",
8861
8861
  "RANDOM_Y"
8862
8862
  ], R = zt(l, m);
8863
- return y[R];
8863
+ return g[R];
8864
8864
  }
8865
8865
  function Pa(l, m) {
8866
- const y = [
8866
+ const g = [
8867
8867
  "ENVMAP_LATLONG",
8868
8868
  "ENVMAP_CUBE"
8869
8869
  ], R = zt(l, m);
8870
- return y[R];
8870
+ return g[R];
8871
8871
  }
8872
8872
  function La(l, m) {
8873
- const y = [
8873
+ const g = [
8874
8874
  "ONE_LEVEL",
8875
8875
  "MIPMAP_LEVELS",
8876
8876
  "RIPMAP_LEVELS"
@@ -8881,82 +8881,82 @@ class fu extends Co {
8881
8881
  return {
8882
8882
  xSize: L,
8883
8883
  ySize: z,
8884
- levelMode: y[v & 15],
8884
+ levelMode: g[v & 15],
8885
8885
  roundingMode: R[v >> 4]
8886
8886
  };
8887
8887
  }
8888
8888
  function Oa(l, m) {
8889
- const y = Ke(l, m), R = Ke(l, m);
8890
- return [y, R];
8889
+ const g = Ke(l, m), R = Ke(l, m);
8890
+ return [g, R];
8891
8891
  }
8892
8892
  function Da(l, m) {
8893
- const y = Ke(l, m), R = Ke(l, m), L = Ke(l, m);
8894
- return [y, R, L];
8893
+ const g = Ke(l, m), R = Ke(l, m), L = Ke(l, m);
8894
+ return [g, R, L];
8895
8895
  }
8896
- function Na(l, m, y, R, L) {
8896
+ function Na(l, m, g, R, L) {
8897
8897
  if (R === "string" || R === "stringvector" || R === "iccProfile")
8898
- return _a(m, y, L);
8898
+ return _a(m, g, L);
8899
8899
  if (R === "chlist")
8900
- return va(l, m, y, L);
8900
+ return va(l, m, g, L);
8901
8901
  if (R === "chromaticities")
8902
- return Ra(l, y);
8902
+ return Ra(l, g);
8903
8903
  if (R === "compression")
8904
- return Ma(l, y);
8904
+ return Ma(l, g);
8905
8905
  if (R === "box2i")
8906
- return Ia(l, y);
8906
+ return Ia(l, g);
8907
8907
  if (R === "envmap")
8908
- return Pa(l, y);
8908
+ return Pa(l, g);
8909
8909
  if (R === "tiledesc")
8910
- return La(l, y);
8910
+ return La(l, g);
8911
8911
  if (R === "lineOrder")
8912
- return Ca(l, y);
8912
+ return Ca(l, g);
8913
8913
  if (R === "float")
8914
- return Ke(l, y);
8914
+ return Ke(l, g);
8915
8915
  if (R === "v2f")
8916
- return Oa(l, y);
8916
+ return Oa(l, g);
8917
8917
  if (R === "v3f")
8918
- return Da(l, y);
8918
+ return Da(l, g);
8919
8919
  if (R === "int")
8920
- return et(l, y);
8920
+ return et(l, g);
8921
8921
  if (R === "rational")
8922
- return Sa(l, y);
8922
+ return Sa(l, g);
8923
8923
  if (R === "timecode")
8924
- return ba(l, y);
8924
+ return ba(l, g);
8925
8925
  if (R === "preview" || R === "deepImageState" || R === "idmanifest")
8926
- return y.value += L, "skipped";
8927
- y.value += L;
8926
+ return g.value += L, "skipped";
8927
+ g.value += L;
8928
8928
  }
8929
8929
  function ka(l, m) {
8930
- const y = Math.log2(l);
8931
- return m == "ROUND_DOWN" ? Math.floor(y) : Math.ceil(y);
8930
+ const g = Math.log2(l);
8931
+ return m == "ROUND_DOWN" ? Math.floor(g) : Math.ceil(g);
8932
8932
  }
8933
- function Fa(l, m, y) {
8933
+ function Fa(l, m, g) {
8934
8934
  let R = 0;
8935
8935
  switch (l.levelMode) {
8936
8936
  case "ONE_LEVEL":
8937
8937
  R = 1;
8938
8938
  break;
8939
8939
  case "MIPMAP_LEVELS":
8940
- R = ka(Math.max(m, y), l.roundingMode) + 1;
8940
+ R = ka(Math.max(m, g), l.roundingMode) + 1;
8941
8941
  break;
8942
8942
  case "RIPMAP_LEVELS":
8943
8943
  throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.");
8944
8944
  }
8945
8945
  return R;
8946
8946
  }
8947
- function Tr(l, m, y, R) {
8947
+ function Tr(l, m, g, R) {
8948
8948
  const L = new Array(l);
8949
8949
  for (let z = 0; z < l; z++) {
8950
8950
  const v = 1 << z;
8951
8951
  let U = m / v | 0;
8952
8952
  R == "ROUND_UP" && U * v < m && (U += 1);
8953
8953
  const F = Math.max(U, 1);
8954
- L[z] = (F + y - 1) / y | 0;
8954
+ L[z] = (F + g - 1) / g | 0;
8955
8955
  }
8956
8956
  return L;
8957
8957
  }
8958
8958
  function za() {
8959
- const l = this, m = l.offset, y = { value: 0 };
8959
+ const l = this, m = l.offset, g = { value: 0 };
8960
8960
  for (let R = 0; R < l.tileCount; R++) {
8961
8961
  const L = et(l.viewer, m), z = et(l.viewer, m);
8962
8962
  m.value += 8, l.size = st(l.viewer, m);
@@ -8969,18 +8969,18 @@ class fu extends Co {
8969
8969
  for (let X = 0; X < l.inputChannels.length; X++) {
8970
8970
  const ee = Xe.channels[X].name, K = l.channelByteOffsets[ee] * l.columns, Q = l.decodeChannels[ee];
8971
8971
  if (Q === void 0) continue;
8972
- y.value = V + K;
8972
+ g.value = V + K;
8973
8973
  const re = (l.height - (1 + U + W)) * l.outLineWidth;
8974
8974
  for (let le = 0; le < l.columns; le++) {
8975
8975
  const oe = re + (le + v) * l.outputChannels + Q;
8976
- l.byteArray[oe] = l.getter(G, y);
8976
+ l.byteArray[oe] = l.getter(G, g);
8977
8977
  }
8978
8978
  }
8979
8979
  }
8980
8980
  }
8981
8981
  }
8982
8982
  function Ba() {
8983
- const l = this, m = l.offset, y = { value: 0 };
8983
+ const l = this, m = l.offset, g = { value: 0 };
8984
8984
  for (let R = 0; R < l.height / l.blockHeight; R++) {
8985
8985
  const L = et(l.viewer, m) - Xe.dataWindow.yMin;
8986
8986
  l.size = st(l.viewer, m), l.lines = L + l.blockHeight > l.height ? l.height - L : l.blockHeight;
@@ -8991,10 +8991,10 @@ class fu extends Co {
8991
8991
  for (let V = 0; V < l.inputChannels.length; V++) {
8992
8992
  const X = Xe.channels[V].name, ee = l.channelByteOffsets[X] * l.columns, K = l.decodeChannels[X];
8993
8993
  if (K !== void 0) {
8994
- y.value = G + ee;
8994
+ g.value = G + ee;
8995
8995
  for (let Q = 0; Q < l.columns; Q++) {
8996
8996
  const re = W + Q * l.outputChannels + K;
8997
- l.byteArray[re] = l.getter(U, y);
8997
+ l.byteArray[re] = l.getter(U, g);
8998
8998
  }
8999
8999
  }
9000
9000
  }
@@ -9002,7 +9002,7 @@ class fu extends Co {
9002
9002
  }
9003
9003
  }
9004
9004
  function Ua() {
9005
- const l = this, m = l.chunkOffsets, y = { value: 0 };
9005
+ const l = this, m = l.chunkOffsets, g = { value: 0 };
9006
9006
  for (let R = 0; R < m.length; R++) {
9007
9007
  const L = { value: m[R] };
9008
9008
  L.value += 4;
@@ -9017,19 +9017,19 @@ class fu extends Co {
9017
9017
  for (let ee = 0; ee < l.inputChannels.length; ee++) {
9018
9018
  const K = Xe.channels[ee].name, Q = l.channelByteOffsets[K] * l.columns, re = l.decodeChannels[K];
9019
9019
  if (re !== void 0) {
9020
- y.value = V + Q;
9020
+ g.value = V + Q;
9021
9021
  for (let le = 0; le < l.columns; le++) {
9022
9022
  const oe = X + le * l.outputChannels + re;
9023
- l.byteArray[oe] = l.getter(B, y);
9023
+ l.byteArray[oe] = l.getter(B, g);
9024
9024
  }
9025
9025
  }
9026
9026
  }
9027
9027
  }
9028
9028
  }
9029
9029
  }
9030
- function _r(l, m, y, R) {
9031
- if (y === 0) return null;
9032
- const L = l.slice(m, m + y);
9030
+ function _r(l, m, g, R) {
9031
+ if (g === 0) return null;
9032
+ const L = l.slice(m, m + g);
9033
9033
  switch (R) {
9034
9034
  case "NO_COMPRESSION":
9035
9035
  return new DataView(L.buffer, L.byteOffset, L.byteLength);
@@ -9038,7 +9038,7 @@ class fu extends Co {
9038
9038
  return ss(z), is(z, v), new DataView(v.buffer);
9039
9039
  }
9040
9040
  case "ZIPS_COMPRESSION": {
9041
- const z = Bn(L), v = new Uint8Array(z.length);
9041
+ const z = Un(L), v = new Uint8Array(z.length);
9042
9042
  return ss(z), is(z, v), new DataView(v.buffer);
9043
9043
  }
9044
9044
  default:
@@ -9046,7 +9046,7 @@ class fu extends Co {
9046
9046
  }
9047
9047
  }
9048
9048
  function Ha() {
9049
- const l = this, m = l.chunkOffsets, y = l.width, R = l.height, L = l.deepChannels, z = Xe.compression, v = l.multiPart, U = l.decodeChannels, F = l.outputChannels, B = l.byteArray instanceof Uint16Array;
9049
+ const l = this, m = l.chunkOffsets, g = l.width, R = l.height, L = l.deepChannels, z = Xe.compression, v = l.multiPart, U = l.decodeChannels, F = l.outputChannels, B = l.byteArray instanceof Uint16Array;
9050
9050
  let G = -1;
9051
9051
  for (let W = 0; W < L.length; W++)
9052
9052
  if (L[W].name === "A") {
@@ -9060,10 +9060,10 @@ class fu extends Co {
9060
9060
  Fe(l.viewer, V);
9061
9061
  const Q = _r(l.array, V.value, ee, z);
9062
9062
  if (V.value += ee, Q === null) continue;
9063
- const re = new Uint32Array(y);
9064
- for (let se = 0; se < y; se++)
9063
+ const re = new Uint32Array(g);
9064
+ for (let se = 0; se < g; se++)
9065
9065
  re[se] = Q.getUint32(se * 4, !0);
9066
- const le = re[y - 1];
9066
+ const le = re[g - 1];
9067
9067
  if (le === 0) {
9068
9068
  V.value += K;
9069
9069
  continue;
@@ -9073,7 +9073,7 @@ class fu extends Co {
9073
9073
  for (let se = 0; se < L.length; se++)
9074
9074
  ue.push(ne), ne += le * L[se].bytesPerSample;
9075
9075
  const te = (R - 1 - X) * l.outLineWidth;
9076
- for (let se = 0; se < y; se++) {
9076
+ for (let se = 0; se < g; se++) {
9077
9077
  const ye = se === 0 ? 0 : re[se - 1], ae = re[se] - ye;
9078
9078
  if (ae === 0) continue;
9079
9079
  const he = new Float32Array(F);
@@ -9081,18 +9081,18 @@ class fu extends Co {
9081
9081
  for (let _e = 0; _e < ae; _e++) {
9082
9082
  const bt = ye + _e, on = 1 - Ie;
9083
9083
  if (on <= 0) break;
9084
- let Mn = 1;
9084
+ let In = 1;
9085
9085
  if (G >= 0) {
9086
9086
  const xt = L[G].bytesPerSample, Xt = ue[G] + bt * xt;
9087
- Mn = xt === 2 ? J(oe.getUint16(Xt, !0)) : oe.getFloat32(Xt, !0);
9087
+ In = xt === 2 ? J(oe.getUint16(Xt, !0)) : oe.getFloat32(Xt, !0);
9088
9088
  }
9089
9089
  for (let xt = 0; xt < L.length; xt++) {
9090
9090
  const Xt = L[xt], hs = U[Xt.name];
9091
9091
  if (hs === void 0) continue;
9092
- const us = Xt.bytesPerSample, ds = ue[xt] + bt * us, In = us === 2 ? J(oe.getUint16(ds, !0)) : oe.getFloat32(ds, !0);
9093
- he[hs] += In * on;
9092
+ const us = Xt.bytesPerSample, ds = ue[xt] + bt * us, Cn = us === 2 ? J(oe.getUint16(ds, !0)) : oe.getFloat32(ds, !0);
9093
+ he[hs] += Cn * on;
9094
9094
  }
9095
- Ie += Mn * on;
9095
+ Ie += In * on;
9096
9096
  }
9097
9097
  U.A !== void 0 && (he[U.A] = Ie);
9098
9098
  const it = te + se * F;
@@ -9101,19 +9101,19 @@ class fu extends Co {
9101
9101
  }
9102
9102
  }
9103
9103
  }
9104
- function Sr(l, m, y) {
9104
+ function Sr(l, m, g) {
9105
9105
  const R = {};
9106
9106
  let L = !1;
9107
9107
  for (; ; ) {
9108
- const z = os(m, y);
9108
+ const z = os(m, g);
9109
9109
  if (z === "") break;
9110
9110
  L = !0;
9111
- const v = os(m, y), U = st(l, y), F = Na(l, m, y, v, U);
9111
+ const v = os(m, g), U = st(l, g), F = Na(l, m, g, v, U);
9112
9112
  F === void 0 ? console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${v}'.`) : R[z] = F;
9113
9113
  }
9114
9114
  return L ? R : null;
9115
9115
  }
9116
- function Ga(l, m, y) {
9116
+ function Ga(l, m, g) {
9117
9117
  if (l.getUint32(0, !0) != 20000630)
9118
9118
  throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");
9119
9119
  const R = l.getUint8(4), L = l.getUint8(5), z = {
@@ -9122,27 +9122,27 @@ class fu extends Co {
9122
9122
  deepFormat: !!(L & 8),
9123
9123
  multiPart: !!(L & 16)
9124
9124
  };
9125
- y.value = 8;
9125
+ g.value = 8;
9126
9126
  const v = [];
9127
9127
  if (z.multiPart) {
9128
9128
  for (; ; ) {
9129
- const U = Sr(l, m, y);
9129
+ const U = Sr(l, m, g);
9130
9130
  if (U === null) break;
9131
9131
  U.version = R, U.spec = z, v.push(U);
9132
9132
  }
9133
9133
  if (v.length === 0)
9134
9134
  throw new Error("THREE.EXRLoader: No valid part headers found.");
9135
9135
  } else {
9136
- const U = Sr(l, m, y);
9136
+ const U = Sr(l, m, g);
9137
9137
  U.version = R, U.spec = z, v.push(U);
9138
9138
  }
9139
9139
  return v;
9140
9140
  }
9141
- function ja(l, m, y, R, L, z) {
9141
+ function ja(l, m, g, R, L, z) {
9142
9142
  const v = {
9143
9143
  size: 0,
9144
9144
  viewer: m,
9145
- array: y,
9145
+ array: g,
9146
9146
  offset: R,
9147
9147
  width: l.dataWindow.xMax - l.dataWindow.xMin + 1,
9148
9148
  height: l.dataWindow.yMax - l.dataWindow.yMin + 1,
@@ -9214,10 +9214,10 @@ class fu extends Co {
9214
9214
  throw new Error("THREE.EXRLoader: file contains unsupported data channels.");
9215
9215
  switch (v.outputChannels) {
9216
9216
  case 4:
9217
- z == Yt ? (F = !U.A, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.decodeChannels = { R: 0, G: 1, B: 2, A: 3 }) : z == Cn ? (v.format = Cn, v.colorSpace = je, v.outputChannels = 2, v.decodeChannels = { R: 0, G: 1 }) : z == fs ? (v.format = fs, v.colorSpace = je, v.outputChannels = 1, v.decodeChannels = { R: 0 }) : B = !0;
9217
+ z == Yt ? (F = !U.A, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.decodeChannels = { R: 0, G: 1, B: 2, A: 3 }) : z == Pn ? (v.format = Pn, v.colorSpace = je, v.outputChannels = 2, v.decodeChannels = { R: 0, G: 1 }) : z == fs ? (v.format = fs, v.colorSpace = je, v.outputChannels = 1, v.decodeChannels = { R: 0 }) : B = !0;
9218
9218
  break;
9219
9219
  case 1:
9220
- z == Yt ? (F = !0, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z == Cn ? (v.format = Cn, v.colorSpace = je, v.outputChannels = 2, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z == fs ? (v.format = fs, v.colorSpace = je, v.outputChannels = 1, v.decodeChannels = { Y: 0 }) : B = !0;
9220
+ z == Yt ? (F = !0, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z == Pn ? (v.format = Pn, v.colorSpace = je, v.outputChannels = 2, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z == fs ? (v.format = fs, v.colorSpace = je, v.outputChannels = 1, v.decodeChannels = { Y: 0 }) : B = !0;
9221
9221
  break;
9222
9222
  default:
9223
9223
  B = !0;
@@ -9225,16 +9225,16 @@ class fu extends Co {
9225
9225
  if (B) throw new Error("THREE.EXRLoader: invalid output format for specified file.");
9226
9226
  if (v.yCbCr && (v.format = Yt, v.outputChannels = 4, v.decodeChannels = { Y: 0, RY: 1, BY: 2 }, F = !0), v.type == 1)
9227
9227
  switch (L) {
9228
- case Wn:
9228
+ case Zn:
9229
9229
  v.getter = Aa;
9230
9230
  break;
9231
9231
  case Vt:
9232
- v.getter = Rn;
9232
+ v.getter = Mn;
9233
9233
  break;
9234
9234
  }
9235
9235
  else if (v.type == 2)
9236
9236
  switch (L) {
9237
- case Wn:
9237
+ case Zn:
9238
9238
  v.getter = Ke;
9239
9239
  break;
9240
9240
  case Vt:
@@ -9245,7 +9245,7 @@ class fu extends Co {
9245
9245
  v.columns = v.width;
9246
9246
  const G = v.width * v.height * v.outputChannels;
9247
9247
  switch (L) {
9248
- case Wn:
9248
+ case Zn:
9249
9249
  v.byteArray = new Float32Array(G), F && v.byteArray.fill(1, 0, G);
9250
9250
  break;
9251
9251
  case Vt:
@@ -9296,42 +9296,42 @@ class fu extends Co {
9296
9296
  const m = ls[l].chunkCount;
9297
9297
  if (l === br) {
9298
9298
  Xe._chunkOffsets = [];
9299
- for (let y = 0; y < m; y++)
9299
+ for (let g = 0; g < m; g++)
9300
9300
  Xe._chunkOffsets.push(Fe(cs, as));
9301
9301
  } else
9302
- for (let y = 0; y < m; y++)
9302
+ for (let g = 0; g < m; g++)
9303
9303
  Fe(cs, as);
9304
9304
  }
9305
- const rt = ja(Xe, cs, Va, as, this.type, this.outputFormat);
9306
- if (rt.decode(), rt.shouldExpand) {
9307
- const l = rt.byteArray;
9305
+ const ot = ja(Xe, cs, Va, as, this.type, this.outputFormat);
9306
+ if (ot.decode(), ot.shouldExpand) {
9307
+ const l = ot.byteArray;
9308
9308
  if (this.outputFormat == Yt)
9309
9309
  for (let m = 0; m < l.length; m += 4)
9310
9310
  l[m + 2] = l[m + 1] = l[m];
9311
- else if (this.outputFormat == Cn)
9311
+ else if (this.outputFormat == Pn)
9312
9312
  for (let m = 0; m < l.length; m += 2)
9313
9313
  l[m + 1] = l[m];
9314
9314
  }
9315
- if (rt.yCbCr) {
9316
- const l = rt.byteArray, m = rt.width * rt.height;
9315
+ if (ot.yCbCr) {
9316
+ const l = ot.byteArray, m = ot.width * ot.height;
9317
9317
  if (this.type === Vt)
9318
- for (let y = 0; y < m; y++) {
9319
- const R = y * 4, L = J(l[R]), z = J(l[R + 1]), v = J(l[R + 2]), U = (1 + z) * L, F = (1 + v) * L, B = (L - U * 0.2126 - F * 0.0722) / 0.7152;
9318
+ for (let g = 0; g < m; g++) {
9319
+ const R = g * 4, L = J(l[R]), z = J(l[R + 1]), v = J(l[R + 2]), U = (1 + z) * L, F = (1 + v) * L, B = (L - U * 0.2126 - F * 0.0722) / 0.7152;
9320
9320
  l[R] = Et.toHalfFloat(Math.max(0, U)), l[R + 1] = Et.toHalfFloat(Math.max(0, B)), l[R + 2] = Et.toHalfFloat(Math.max(0, F));
9321
9321
  }
9322
9322
  else
9323
- for (let y = 0; y < m; y++) {
9324
- const R = y * 4, L = l[R], z = l[R + 1], v = l[R + 2], U = (1 + z) * L, F = (1 + v) * L;
9323
+ for (let g = 0; g < m; g++) {
9324
+ const R = g * 4, L = l[R], z = l[R + 1], v = l[R + 2], U = (1 + z) * L, F = (1 + v) * L;
9325
9325
  l[R] = Math.max(0, U), l[R + 1] = Math.max(0, (L - U * 0.2126 - F * 0.0722) / 0.7152), l[R + 2] = Math.max(0, F);
9326
9326
  }
9327
9327
  }
9328
9328
  return {
9329
9329
  header: Xe,
9330
- width: rt.width,
9331
- height: rt.height,
9332
- data: rt.byteArray,
9333
- format: rt.format,
9334
- colorSpace: rt.colorSpace,
9330
+ width: ot.width,
9331
+ height: ot.height,
9332
+ data: ot.byteArray,
9333
+ format: ot.format,
9334
+ colorSpace: ot.colorSpace,
9335
9335
  type: this.type,
9336
9336
  minFilter: nn,
9337
9337
  magFilter: nn,
@@ -9469,29 +9469,29 @@ class pu extends Co {
9469
9469
  dt--;
9470
9470
  }
9471
9471
  return D;
9472
- }, g = function(M, O, C, N) {
9472
+ }, y = function(M, O, C, N) {
9473
9473
  const D = M[O + 3], H = Math.pow(2, D - 128) / 255;
9474
9474
  C[N + 0] = M[O + 0] * H, C[N + 1] = M[O + 1] * H, C[N + 2] = M[O + 2] * H, C[N + 3] = 1;
9475
- }, x = function(M, O, C, N) {
9475
+ }, S = function(M, O, C, N) {
9476
9476
  const D = M[O + 3], H = Math.pow(2, D - 128) / 255;
9477
9477
  C[N + 0] = Et.toHalfFloat(Math.min(M[O + 0] * H, 65504)), C[N + 1] = Et.toHalfFloat(Math.min(M[O + 1] * H, 65504)), C[N + 2] = Et.toHalfFloat(Math.min(M[O + 2] * H, 65504)), C[N + 3] = Et.toHalfFloat(1);
9478
9478
  }, _ = new Uint8Array(e);
9479
9479
  _.pos = 0;
9480
- const b = f(_), E = b.width, S = b.height, T = p(_.subarray(_.pos), E, S);
9480
+ const x = f(_), E = x.width, b = x.height, T = p(_.subarray(_.pos), E, b);
9481
9481
  let A, P, I;
9482
9482
  switch (this.type) {
9483
- case Wn:
9483
+ case Zn:
9484
9484
  I = T.length / 4;
9485
9485
  const M = new Float32Array(I * 4);
9486
9486
  for (let C = 0; C < I; C++)
9487
- g(T, C * 4, M, C * 4);
9488
- A = M, P = Wn;
9487
+ y(T, C * 4, M, C * 4);
9488
+ A = M, P = Zn;
9489
9489
  break;
9490
9490
  case Vt:
9491
9491
  I = T.length / 4;
9492
9492
  const O = new Uint16Array(I * 4);
9493
9493
  for (let C = 0; C < I; C++)
9494
- x(T, C * 4, O, C * 4);
9494
+ S(T, C * 4, O, C * 4);
9495
9495
  A = O, P = Vt;
9496
9496
  break;
9497
9497
  default:
@@ -9499,11 +9499,11 @@ class pu extends Co {
9499
9499
  }
9500
9500
  return {
9501
9501
  width: E,
9502
- height: S,
9502
+ height: b,
9503
9503
  data: A,
9504
- header: b.string,
9505
- gamma: b.gamma,
9506
- exposure: b.exposure,
9504
+ header: x.string,
9505
+ gamma: x.gamma,
9506
+ exposure: x.exposure,
9507
9507
  type: P,
9508
9508
  colorSpace: je,
9509
9509
  minFilter: nn,
@@ -10022,7 +10022,7 @@ class Ru {
10022
10022
  * Create a ViewerCore instance with Three.js implementations
10023
10023
  */
10024
10024
  static createViewer(e, t) {
10025
- var E, S, T;
10025
+ var E, b, T;
10026
10026
  Po(t.units);
10027
10027
  const n = new Gl(e), s = new Lt(), r = this.createCamera(t), o = this.createControls(
10028
10028
  r.getThreeCamera(),
@@ -10034,12 +10034,12 @@ class Ru {
10034
10034
  ...t.loaders
10035
10035
  }), c = new qh(), u = new yu();
10036
10036
  let d;
10037
- (((S = t.pathTracing) == null ? void 0 : S.enabled) ?? !1) && (d = new $h());
10038
- const f = new Eu(), p = new Tu(), g = new bu(), x = new xu(), _ = vu.convertRendererOptions(
10037
+ (((b = t.pathTracing) == null ? void 0 : b.enabled) ?? !1) && (d = new $h());
10038
+ const f = new Eu(), p = new Tu(), y = new bu(), S = new xu(), _ = vu.convertRendererOptions(
10039
10039
  t.renderer || {}
10040
10040
  );
10041
10041
  (t.replaceWithScreenshotOnComplete || (T = t.pathTracing) != null && T.enabled) && (_.preserveDrawingBuffer = !0);
10042
- const b = {
10042
+ const x = {
10043
10043
  renderer: n,
10044
10044
  scene: s,
10045
10045
  camera: r,
@@ -10052,10 +10052,10 @@ class Ru {
10052
10052
  pathTracingService: d,
10053
10053
  floorAlignmentService: f,
10054
10054
  selectionService: p,
10055
- anchorProjectionService: g,
10056
- animationService: x
10055
+ anchorProjectionService: y,
10056
+ animationService: S
10057
10057
  };
10058
- return new Fc(b);
10058
+ return new Fc(x);
10059
10059
  }
10060
10060
  static createCamera(e) {
10061
10061
  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, u = lr.create(
@@ -10347,59 +10347,83 @@ function Ou(i) {
10347
10347
  }, [i.preset, i.backgroundColor, i.renderer, i.environment, i.controls, i.animations]);
10348
10348
  return { options: Dt(() => i, [e, t]), structuralKey: e, runtimeKey: t };
10349
10349
  }
10350
- function Du(i, e) {
10351
- const t = Ve(null), [n, s] = Yn(!1), [r, o] = Yn(null), { options: a, structuralKey: c, runtimeKey: u } = Ou(e);
10352
- ht(() => {
10353
- if (!i.current || t.current)
10350
+ const Du = "200px";
10351
+ function Nu(i, e) {
10352
+ const [t, n] = An(!e);
10353
+ return rt(() => {
10354
+ if (t)
10355
+ return;
10356
+ if (!e) {
10357
+ n(!0);
10358
+ return;
10359
+ }
10360
+ const s = i.current;
10361
+ if (!s || typeof IntersectionObserver > "u") {
10362
+ n(!0);
10363
+ return;
10364
+ }
10365
+ const r = new IntersectionObserver(
10366
+ (o) => {
10367
+ o.some((a) => a.isIntersecting) && n(!0);
10368
+ },
10369
+ { rootMargin: Du }
10370
+ );
10371
+ return r.observe(s), () => r.disconnect();
10372
+ }, [i, e, t]), t;
10373
+ }
10374
+ function ku(i, e) {
10375
+ const t = Ve(null), [n, s] = An(!1), [r, o] = An(null), { options: a, structuralKey: c, runtimeKey: u } = Ou(e), d = Nu(i, (e.loading ?? "eager") === "lazy");
10376
+ rt(() => {
10377
+ if (!d || !i.current || t.current)
10354
10378
  return;
10355
10379
  o(null);
10356
- const h = Ki(Zi, a);
10357
- let f;
10380
+ const f = Ki(Zi, a);
10381
+ let p;
10358
10382
  try {
10359
- f = Ru.createViewer(i.current, h);
10360
- } catch (g) {
10361
- console.error("Failed to create viewer:", g), o(g instanceof Error ? g : new Error(String(g)));
10383
+ p = Ru.createViewer(i.current, f);
10384
+ } catch (S) {
10385
+ console.error("Failed to create viewer:", S), o(S instanceof Error ? S : new Error(String(S)));
10362
10386
  return;
10363
10387
  }
10364
- t.current = f;
10365
- let p = !1;
10366
- return f.initialize().then((g) => {
10367
- p || (g.ok ? s(!0) : (console.error("Failed to initialize viewer:", g.error), o(g.error)));
10388
+ t.current = p;
10389
+ let y = !1;
10390
+ return p.initialize().then((S) => {
10391
+ y || (S.ok ? s(!0) : (console.error("Failed to initialize viewer:", S.error), o(S.error)));
10368
10392
  }), () => {
10369
- p = !0, f.dispose(), t.current = null, s(!1);
10393
+ y = !0, p.dispose(), t.current = null, s(!1);
10370
10394
  };
10371
- }, [i, c]), ht(() => {
10395
+ }, [i, c, d]), rt(() => {
10372
10396
  if (!t.current || !n)
10373
10397
  return;
10374
- const h = Ki(Zi, a);
10375
- t.current.updateOptions(na(h));
10398
+ const f = Ki(Zi, a);
10399
+ t.current.updateOptions(na(f));
10376
10400
  }, [u, n]);
10377
- const d = Ve({ width: 0, height: 0 });
10378
- return ht(() => {
10401
+ const h = Ve({ width: 0, height: 0 });
10402
+ return rt(() => {
10379
10403
  if (!t.current || !i.current)
10380
10404
  return;
10381
- let h = null;
10382
- const f = (x) => {
10405
+ let f = null;
10406
+ const p = (_) => {
10383
10407
  if (i.current && t.current) {
10384
- const _ = i.current.parentElement || i.current;
10385
- let { clientWidth: b, clientHeight: E } = _;
10386
- if (x && x[0]) {
10387
- const { width: S, height: T } = x[0].contentRect;
10388
- b = Math.floor(S), E = Math.floor(T);
10408
+ const x = i.current.parentElement || i.current;
10409
+ let { clientWidth: E, clientHeight: b } = x;
10410
+ if (_ && _[0]) {
10411
+ const { width: T, height: A } = _[0].contentRect;
10412
+ E = Math.floor(T), b = Math.floor(A);
10389
10413
  }
10390
- if (d.current.width === b && d.current.height === E)
10414
+ if (h.current.width === E && h.current.height === b)
10391
10415
  return;
10392
- h !== null && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
10393
- t.current && i.current && (t.current.resize(b, E), d.current = { width: b, height: E });
10416
+ f !== null && cancelAnimationFrame(f), f = requestAnimationFrame(() => {
10417
+ t.current && i.current && (t.current.resize(E, b), h.current = { width: E, height: b });
10394
10418
  });
10395
10419
  }
10396
10420
  };
10397
- f();
10398
- const p = () => f();
10399
- window.addEventListener("resize", p);
10400
- let g = null;
10401
- return typeof ResizeObserver < "u" && i.current.parentElement && (g = new ResizeObserver(f), g.observe(i.current.parentElement)), () => {
10402
- window.removeEventListener("resize", p), g == null || g.disconnect(), h !== null && cancelAnimationFrame(h);
10421
+ p();
10422
+ const y = () => p();
10423
+ window.addEventListener("resize", y);
10424
+ let S = null;
10425
+ return typeof ResizeObserver < "u" && i.current.parentElement && (S = new ResizeObserver(p), S.observe(i.current.parentElement)), () => {
10426
+ window.removeEventListener("resize", y), S == null || S.disconnect(), f !== null && cancelAnimationFrame(f);
10403
10427
  };
10404
10428
  }, [n, i]), {
10405
10429
  viewer: t.current,
@@ -10410,7 +10434,7 @@ function Du(i, e) {
10410
10434
  }
10411
10435
  function ia(i, e) {
10412
10436
  const t = Ve(e);
10413
- t.current = e, ht(() => {
10437
+ t.current = e, rt(() => {
10414
10438
  if (!i)
10415
10439
  return;
10416
10440
  const n = i.getEvents(), s = [], r = (o) => {
@@ -10427,9 +10451,9 @@ function ia(i, e) {
10427
10451
  };
10428
10452
  }, [i]);
10429
10453
  }
10430
- function Nu(i, e) {
10431
- const [t, n] = Yn(null), s = Ve(/* @__PURE__ */ new Set());
10432
- ht(() => {
10454
+ function Fu(i, e) {
10455
+ const [t, n] = An(null), s = Ve(/* @__PURE__ */ new Set());
10456
+ rt(() => {
10433
10457
  if (i !== void 0 && s.current.has(i)) {
10434
10458
  s.current.delete(i), n((c) => c === i ? null : c);
10435
10459
  return;
@@ -10437,7 +10461,7 @@ function Nu(i, e) {
10437
10461
  s.current.clear(), n(null);
10438
10462
  }, [i]);
10439
10463
  const r = !!(e != null && e.presets);
10440
- ht(() => {
10464
+ rt(() => {
10441
10465
  r || (s.current.clear(), n(null));
10442
10466
  }, [r]);
10443
10467
  const o = e == null ? void 0 : e.onPresetChange, a = Rt(
@@ -10452,7 +10476,7 @@ function Nu(i, e) {
10452
10476
  selectPreset: a
10453
10477
  };
10454
10478
  }
10455
- function ku(i, e, t, n, s) {
10479
+ function zu(i, e, t, n, s) {
10456
10480
  return Dt(() => {
10457
10481
  var u, d, h;
10458
10482
  const r = i.preset !== e, o = t === !0 && ((u = i.pathTracing) == null ? void 0 : u.enabled) === void 0, a = n !== void 0 && ((d = i.controls) == null ? void 0 : d.autoRotate) === void 0, c = s !== void 0 && ((h = i.animations) == null ? void 0 : h.autoplay) === void 0;
@@ -10465,18 +10489,18 @@ function ku(i, e, t, n, s) {
10465
10489
  };
10466
10490
  }, [i, e, t, n, s]);
10467
10491
  }
10468
- function Fu(i, e, t) {
10492
+ function Bu(i, e, t) {
10469
10493
  const n = Dt(() => {
10470
10494
  if (typeof t == "string")
10471
10495
  return t;
10472
10496
  if (t)
10473
10497
  return `object-${t.uuid || "no-uuid"}`;
10474
- }, [t]), [s, r] = Yn(() => ({
10498
+ }, [t]), [s, r] = An(() => ({
10475
10499
  status: t ? "loading" : "idle"
10476
10500
  }));
10477
- return ht(() => {
10501
+ return rt(() => {
10478
10502
  r({ status: t ? "loading" : "idle" });
10479
- }, [n]), ht(() => {
10503
+ }, [n]), rt(() => {
10480
10504
  if (!i || !e || !t)
10481
10505
  return;
10482
10506
  let o = !0;
@@ -10557,7 +10581,7 @@ class Si {
10557
10581
  };
10558
10582
  }
10559
10583
  }
10560
- function zu(i) {
10584
+ function Uu(i) {
10561
10585
  const e = Ve(new nr()), t = Dt(
10562
10586
  () => ({
10563
10587
  "model:loading": (n) => e.current.emit("model:loading", n),
@@ -10574,7 +10598,7 @@ function zu(i) {
10574
10598
  );
10575
10599
  return ia(i, t), e.current;
10576
10600
  }
10577
- function Bu(i, e, t) {
10601
+ function Hu(i, e, t) {
10578
10602
  const n = Ve(t);
10579
10603
  n.current = t;
10580
10604
  const s = Dt(
@@ -10600,7 +10624,7 @@ function Bu(i, e, t) {
10600
10624
  );
10601
10625
  ia(i, s);
10602
10626
  const r = Ve(null);
10603
- ht(() => {
10627
+ rt(() => {
10604
10628
  if (!e) {
10605
10629
  r.current = null;
10606
10630
  return;
@@ -10610,7 +10634,7 @@ function Bu(i, e, t) {
10610
10634
  });
10611
10635
  }
10612
10636
  const ra = Wa(null);
10613
- function Uu({ viewer: i, canvasRef: e, children: t }) {
10637
+ function Gu({ viewer: i, canvasRef: e, children: t }) {
10614
10638
  const n = Dt(() => ({ viewer: i, canvasRef: e }), [i, e]);
10615
10639
  return /* @__PURE__ */ Te(ra.Provider, { value: n, children: t });
10616
10640
  }
@@ -10620,7 +10644,7 @@ function oa() {
10620
10644
  throw new Error("useViewerContext must be used within ViewerProvider");
10621
10645
  return i;
10622
10646
  }
10623
- function Hu() {
10647
+ function ju() {
10624
10648
  const { canvasRef: i } = oa();
10625
10649
  return /* @__PURE__ */ Te(
10626
10650
  "canvas",
@@ -10648,13 +10672,13 @@ function Hu() {
10648
10672
  console.error("vite-plugin-css-injected-by-js", e);
10649
10673
  }
10650
10674
  })();
10651
- const Gu = (i, e, t, n, s, r) => {
10675
+ const Vu = (i, e, t, n, s, r) => {
10652
10676
  const o = performance.now(), a = () => {
10653
10677
  const c = performance.now() - o, u = Math.min(c / s, 1);
10654
10678
  i.position.lerpVectors(t, n, u), e == null || e.update(), r(), u < 1 && requestAnimationFrame(a);
10655
10679
  };
10656
10680
  requestAnimationFrame(a);
10657
- }, uo = { type: "change" }, dr = { type: "start" }, aa = { type: "end" }, Ds = new Yi(), fo = new Qn(), ju = Math.cos(70 * tr.DEG2RAD), Le = new $(), nt = 2 * Math.PI, Ee = {
10681
+ }, uo = { type: "change" }, dr = { type: "start" }, aa = { type: "end" }, Ds = new Yi(), fo = new Qn(), Wu = Math.cos(70 * tr.DEG2RAD), Le = new $(), nt = 2 * Math.PI, Ee = {
10658
10682
  NONE: -1,
10659
10683
  ROTATE: 0,
10660
10684
  DOLLY: 1,
@@ -10672,7 +10696,7 @@ class ca extends Io {
10672
10696
  * @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
10673
10697
  */
10674
10698
  constructor(e, t = null) {
10675
- super(e, t), this.state = Ee.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ue.ROTATE, MIDDLE: Ue.DOLLY, RIGHT: Ue.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new An(), this._lastTargetPosition = new $(), this._quat = new An().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Gs(), this._sphericalDelta = new Gs(), this._scale = 1, this._panOffset = new $(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new $(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Wu.bind(this), this._onPointerDown = Vu.bind(this), this._onPointerUp = Zu.bind(this), this._onContextMenu = Ju.bind(this), this._onMouseWheel = Yu.bind(this), this._onKeyDown = qu.bind(this), this._onTouchStart = $u.bind(this), this._onTouchMove = Qu.bind(this), this._onMouseDown = Ku.bind(this), this._onMouseMove = Xu.bind(this), this._interceptControlDown = ed.bind(this), this._interceptControlUp = td.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
10699
+ super(e, t), this.state = Ee.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Ue.ROTATE, MIDDLE: Ue.DOLLY, RIGHT: Ue.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new vn(), this._lastTargetPosition = new $(), this._quat = new vn().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Gs(), this._sphericalDelta = new Gs(), this._scale = 1, this._panOffset = new $(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new $(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Ku.bind(this), this._onPointerDown = Zu.bind(this), this._onPointerUp = Xu.bind(this), this._onContextMenu = td.bind(this), this._onMouseWheel = $u.bind(this), this._onKeyDown = Qu.bind(this), this._onTouchStart = Ju.bind(this), this._onTouchMove = ed.bind(this), this._onMouseDown = Yu.bind(this), this._onMouseMove = qu.bind(this), this._interceptControlDown = nd.bind(this), this._interceptControlUp = sd.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
10676
10700
  }
10677
10701
  connect(e) {
10678
10702
  super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
@@ -10763,7 +10787,7 @@ class ca extends Io {
10763
10787
  u.unproject(this.object), this.object.position.sub(u).add(a), this.object.updateMatrixWorld(), o = Le.length();
10764
10788
  } else
10765
10789
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
10766
- o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ds.origin.copy(this.object.position), Ds.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ds.direction)) < ju ? this.object.lookAt(this.target) : (fo.setFromNormalAndCoplanarPoint(this.object.up, this.target), Ds.intersectPlane(fo, this.target))));
10790
+ o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ds.origin.copy(this.object.position), Ds.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ds.direction)) < Wu ? this.object.lookAt(this.target) : (fo.setFromNormalAndCoplanarPoint(this.object.up, this.target), Ds.intersectPlane(fo, this.target))));
10767
10791
  } else if (this.object.isOrthographicCamera) {
10768
10792
  const o = this.object.zoom;
10769
10793
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), r = !0);
@@ -10960,13 +10984,13 @@ class ca extends Io {
10960
10984
  return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
10961
10985
  }
10962
10986
  }
10963
- function Vu(i) {
10987
+ function Zu(i) {
10964
10988
  this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
10965
10989
  }
10966
- function Wu(i) {
10990
+ function Ku(i) {
10967
10991
  this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
10968
10992
  }
10969
- function Zu(i) {
10993
+ function Xu(i) {
10970
10994
  switch (this._removePointer(i), this._pointers.length) {
10971
10995
  case 0:
10972
10996
  this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(aa), this.state = Ee.NONE;
@@ -10977,7 +11001,7 @@ function Zu(i) {
10977
11001
  break;
10978
11002
  }
10979
11003
  }
10980
- function Ku(i) {
11004
+ function Yu(i) {
10981
11005
  let e;
10982
11006
  switch (i.button) {
10983
11007
  case 0:
@@ -11020,7 +11044,7 @@ function Ku(i) {
11020
11044
  }
11021
11045
  this.state !== Ee.NONE && this.dispatchEvent(dr);
11022
11046
  }
11023
- function Xu(i) {
11047
+ function qu(i) {
11024
11048
  switch (this.state) {
11025
11049
  case Ee.ROTATE:
11026
11050
  if (this.enableRotate === !1) return;
@@ -11036,13 +11060,13 @@ function Xu(i) {
11036
11060
  break;
11037
11061
  }
11038
11062
  }
11039
- function Yu(i) {
11063
+ function $u(i) {
11040
11064
  this.enabled === !1 || this.enableZoom === !1 || this.state !== Ee.NONE || (i.preventDefault(), this.dispatchEvent(dr), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(aa));
11041
11065
  }
11042
- function qu(i) {
11066
+ function Qu(i) {
11043
11067
  this.enabled !== !1 && this._handleKeyDown(i);
11044
11068
  }
11045
- function $u(i) {
11069
+ function Ju(i) {
11046
11070
  switch (this._trackPointer(i), this._pointers.length) {
11047
11071
  case 1:
11048
11072
  switch (this.touches.ONE) {
@@ -11077,7 +11101,7 @@ function $u(i) {
11077
11101
  }
11078
11102
  this.state !== Ee.NONE && this.dispatchEvent(dr);
11079
11103
  }
11080
- function Qu(i) {
11104
+ function ed(i) {
11081
11105
  switch (this._trackPointer(i), this.state) {
11082
11106
  case Ee.TOUCH_ROTATE:
11083
11107
  if (this.enableRotate === !1) return;
@@ -11099,16 +11123,16 @@ function Qu(i) {
11099
11123
  this.state = Ee.NONE;
11100
11124
  }
11101
11125
  }
11102
- function Ju(i) {
11126
+ function td(i) {
11103
11127
  this.enabled !== !1 && i.preventDefault();
11104
11128
  }
11105
- function ed(i) {
11129
+ function nd(i) {
11106
11130
  i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
11107
11131
  }
11108
- function td(i) {
11132
+ function sd(i) {
11109
11133
  i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
11110
11134
  }
11111
- class nd extends ca {
11135
+ class id extends ca {
11112
11136
  constructor(e, t) {
11113
11137
  super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Ue.PAN, MIDDLE: Ue.DOLLY, RIGHT: Ue.ROTATE }, this.touches = { ONE: Ye.PAN, TWO: Ye.DOLLY_ROTATE };
11114
11138
  }
@@ -11129,7 +11153,7 @@ const de = {
11129
11153
  };
11130
11154
  var jt = /* @__PURE__ */ ((i) => (i.FRONT = "FRONT", i.BACK = "BACK", i.RIGHT = "RIGHT", i.LEFT = "LEFT", i.TOP = "TOP", i.BOTTOM = "BOTTOM", i))(jt || {});
11131
11155
  new w.Vector3(0, 1, 0);
11132
- const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-rotation-arrow-name", sd = "gizmo-group-name", id = [
11156
+ const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-rotation-arrow-name", rd = "gizmo-group-name", od = [
11133
11157
  Xs,
11134
11158
  Xi
11135
11159
  ], Us = {
@@ -11137,7 +11161,7 @@ const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-
11137
11161
  DEFAULT_UP: new w.Vector3(0, 1, 0),
11138
11162
  FORWARD: new w.Vector3(0, 0, -1)
11139
11163
  }, xi = (i) => Us.FORWARD.clone().applyQuaternion(i), po = (i, e, t = new w.Vector3()) => t.clone().add(i.multiplyScalar(-e));
11140
- class rd {
11164
+ class ad {
11141
11165
  constructor(e, t = $n) {
11142
11166
  this.gizmoScene = e, this.gizmoArrowsName = t;
11143
11167
  }
@@ -11152,7 +11176,7 @@ class rd {
11152
11176
  }
11153
11177
  syncMainWithGizmo(e, t, n) {
11154
11178
  const s = n.target.clone(), r = e.position.distanceTo(s), o = e.camera instanceof w.PerspectiveCamera;
11155
- n instanceof nd && !o ? this.syncMapControls(e, t, s, r) : this.syncOrbitControls(e, t, s, r), e.camera.updateMatrix(), e.camera.updateMatrixWorld(!0), n.update();
11179
+ n instanceof id && !o ? this.syncMapControls(e, t, s, r) : this.syncOrbitControls(e, t, s, r), e.camera.updateMatrix(), e.camera.updateMatrixWorld(!0), n.update();
11156
11180
  }
11157
11181
  syncMapControls(e, t, n, s) {
11158
11182
  const r = e.position.y - n.y, o = xi(t.quaternion);
@@ -11167,7 +11191,7 @@ class rd {
11167
11191
  e.position.copy(a), e.up.copy(o), e.camera.lookAt(n);
11168
11192
  }
11169
11193
  }
11170
- const la = (i) => new rd(i), mo = (i, e, t) => {
11194
+ const la = (i) => new ad(i), mo = (i, e, t) => {
11171
11195
  la(t).syncGizmoWithMain(
11172
11196
  {
11173
11197
  camera: i,
@@ -11182,7 +11206,7 @@ const la = (i) => new rd(i), mo = (i, e, t) => {
11182
11206
  up: e.up
11183
11207
  }
11184
11208
  );
11185
- }, od = (i, e, t) => {
11209
+ }, cd = (i, e, t) => {
11186
11210
  la(e.userData.scene).syncMainWithGizmo(
11187
11211
  {
11188
11212
  camera: i,
@@ -11198,14 +11222,14 @@ const la = (i) => new rd(i), mo = (i, e, t) => {
11198
11222
  },
11199
11223
  t
11200
11224
  );
11201
- }, ad = () => {
11225
+ }, ld = () => {
11202
11226
  try {
11203
11227
  const i = document.createElement("canvas");
11204
11228
  return !!(window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")));
11205
11229
  } catch {
11206
11230
  return !1;
11207
11231
  }
11208
- }, cd = () => ad() ? new w.WebGLRenderer({ alpha: !0, antialias: !1 }) : (console.error("WebGL is not supported in this environment."), null), ld = (i) => {
11232
+ }, hd = () => ld() ? new w.WebGLRenderer({ alpha: !0, antialias: !1 }) : (console.error("WebGL is not supported in this environment."), null), ud = (i) => {
11209
11233
  const e = new w.AmbientLight(16777215, 1);
11210
11234
  i.add(e);
11211
11235
  const t = new w.DirectionalLight(16777215, 1);
@@ -11215,7 +11239,7 @@ const la = (i) => new rd(i), mo = (i, e, t) => {
11215
11239
  const s = new w.PointLight(16777215, 1, 100);
11216
11240
  s.position.set(0, 0, 5), i.add(s), t.castShadow = !1, n.castShadow = !1, s.castShadow = !1;
11217
11241
  };
11218
- class hd {
11242
+ class dd {
11219
11243
  static createTextTexture(e) {
11220
11244
  const t = document.createElement("canvas"), n = t.getContext("2d");
11221
11245
  t.width = de.CANVAS_SIZE, t.height = de.CANVAS_SIZE, n && (n.clearRect(0, 0, t.width, t.height), n.font = `${de.FONT_SIZE} Arial`, n.fillStyle = de.TEXT_COLOR, n.textAlign = de.TEXT_ALIGN, n.textBaseline = de.TEXT_BASELINE, n.fillText(e, t.width / 2, t.height / 2));
@@ -11257,14 +11281,14 @@ class Ns {
11257
11281
  de.CUBE_SIZE - de.EDGE_SECTION_SIZE,
11258
11282
  de.CUBE_SIZE - de.EDGE_SECTION_SIZE
11259
11283
  ), u = new w.MeshStandardMaterial({
11260
- map: hd.createTextTexture(n),
11284
+ map: dd.createTextTexture(n),
11261
11285
  transparent: !0,
11262
11286
  depthWrite: !1
11263
11287
  }), d = new w.Mesh(c, u);
11264
11288
  return d.position.set(0, 0, de.FACE_THICKNESS / 2 + 0.01), s.add(d), s.position.copy(e), s.rotation.copy(t), s;
11265
11289
  }
11266
11290
  }
11267
- const ud = (i, e) => {
11291
+ const fd = (i, e) => {
11268
11292
  const t = document.createElement("canvas");
11269
11293
  t.width = 64, t.height = 64;
11270
11294
  const n = t.getContext("2d");
@@ -11272,7 +11296,7 @@ const ud = (i, e) => {
11272
11296
  const s = new w.CanvasTexture(t), r = new w.SpriteMaterial({ map: s }), o = new w.Sprite(r);
11273
11297
  return o.scale.set(0.5, 0.5, 0.5), o;
11274
11298
  };
11275
- class dd {
11299
+ class pd {
11276
11300
  constructor(e) {
11277
11301
  this.hoveredObject = null, this.originalColor = null, this.config = e;
11278
11302
  }
@@ -11390,11 +11414,11 @@ class dd {
11390
11414
  createAxis(e) {
11391
11415
  const { color: t, direction: n, length: s, origin: r, lineWidth: o, label: a } = e, c = new w.Group(), u = o / 2, d = new w.CylinderGeometry(u, u, s, 32), h = new w.MeshBasicMaterial({ color: t }), f = new w.Mesh(d, h);
11392
11416
  if (f.position.copy(r).add(n.clone().multiplyScalar(s / 2)), !n.equals(new w.Vector3(0, 1, 0))) {
11393
- const g = new w.Vector3(0, 1, 0).cross(n).normalize(), x = Math.acos(new w.Vector3(0, 1, 0).dot(n));
11394
- f.setRotationFromAxisAngle(g, x);
11417
+ const y = new w.Vector3(0, 1, 0).cross(n).normalize(), S = Math.acos(new w.Vector3(0, 1, 0).dot(n));
11418
+ f.setRotationFromAxisAngle(y, S);
11395
11419
  }
11396
11420
  c.add(f);
11397
- const p = ud(a, t);
11421
+ const p = fd(a, t);
11398
11422
  return p.position.copy(r).add(n.clone().multiplyScalar(s + 0.1)), c.add(p), c;
11399
11423
  }
11400
11424
  createCoordinateAxes() {
@@ -11437,7 +11461,7 @@ class dd {
11437
11461
  }
11438
11462
  create() {
11439
11463
  const e = new w.Group();
11440
- e.name = sd;
11464
+ e.name = rd;
11441
11465
  const t = this.createWireframe();
11442
11466
  e.add(t), this.createEdges(e), this.createCorners(e), this.createFaces(e);
11443
11467
  const n = this.createCoordinateAxes();
@@ -11462,7 +11486,7 @@ class dd {
11462
11486
  }
11463
11487
  }
11464
11488
  }
11465
- class fd {
11489
+ class md {
11466
11490
  constructor(e) {
11467
11491
  this.onChangeMainControlsListener = () => {
11468
11492
  }, this.onChangeGizmoControlsListener = () => {
@@ -11484,10 +11508,10 @@ class fd {
11484
11508
  }
11485
11509
  initializeScene() {
11486
11510
  var e;
11487
- const t = new dd({
11511
+ const t = new pd({
11488
11512
  initialFace: ((e = this.options) == null ? void 0 : e.initialFace) ?? jt.FRONT
11489
11513
  }).create();
11490
- this.gizmoScene.add(t), ld(this.gizmoScene);
11514
+ this.gizmoScene.add(t), ud(this.gizmoScene);
11491
11515
  }
11492
11516
  initializeControls() {
11493
11517
  this.onChangeMainControlsListener = () => this.syncFunctions.syncGizmoCameraWithMain(
@@ -11527,7 +11551,7 @@ class fd {
11527
11551
  ), this.gizmoScene.clear(), cancelAnimationFrame(this.animationId);
11528
11552
  }
11529
11553
  }
11530
- const pd = (i, e) => {
11554
+ const gd = (i, e) => {
11531
11555
  let t;
11532
11556
  return function(...n) {
11533
11557
  t || (i.apply(this, n), t = !0, setTimeout(() => t = !1, e));
@@ -11543,12 +11567,12 @@ const ha = (i, e, t, n) => (n.setFromCamera(i, e), n.intersectObjects(t.children
11543
11567
  const t = ["Wireframe", ""];
11544
11568
  return ((e = i.find((n) => !t.includes(n.object.name))) == null ? void 0 : e.object) || null;
11545
11569
  };
11546
- function md(i, e, t, n) {
11570
+ function yd(i, e, t, n) {
11547
11571
  if (!e || !t) return null;
11548
11572
  const s = ha(i, e, t, n);
11549
11573
  return ua(s);
11550
11574
  }
11551
- function gd(i, e) {
11575
+ function wd(i, e) {
11552
11576
  const t = i == null ? void 0 : i.userData.gizmoCube;
11553
11577
  if (i && t) {
11554
11578
  t.handleClick();
@@ -11556,22 +11580,22 @@ function gd(i, e) {
11556
11580
  n && e(n);
11557
11581
  }
11558
11582
  }
11559
- const yd = {
11583
+ const Ed = {
11560
11584
  radius: 2.1,
11561
11585
  color: 12369854,
11562
11586
  tubeRadius: 0.1,
11563
11587
  tubeSegments: 8,
11564
11588
  numPoints: 64,
11565
11589
  tubeOffset: 1.5
11566
- }, wd = {
11590
+ }, Td = {
11567
11591
  size: 0.2,
11568
11592
  depth: 0.1,
11569
11593
  heightRatio: 1.4,
11570
11594
  segments: 1
11571
11595
  };
11572
- class Ed {
11596
+ class _d {
11573
11597
  constructor(e = {}) {
11574
- this.config = { ...yd, ...e }, this.material = new w.MeshBasicMaterial({ color: this.config.color });
11598
+ this.config = { ...Ed, ...e }, this.material = new w.MeshBasicMaterial({ color: this.config.color });
11575
11599
  }
11576
11600
  create() {
11577
11601
  const e = new w.Group(), t = this.createQuarterCircleCurves();
@@ -11612,7 +11636,7 @@ class Ed {
11612
11636
  ];
11613
11637
  }
11614
11638
  createArrowHeads([e, t]) {
11615
- const { size: n, depth: s, heightRatio: r, segments: o } = wd, a = this.createArrowShape(n, r), c = new w.ExtrudeGeometry(a, {
11639
+ const { size: n, depth: s, heightRatio: r, segments: o } = Td, a = this.createArrowShape(n, r), c = new w.ExtrudeGeometry(a, {
11616
11640
  steps: o,
11617
11641
  depth: s,
11618
11642
  bevelEnabled: !1
@@ -11640,11 +11664,11 @@ class Ed {
11640
11664
  return Math.atan2(e.y, e.x);
11641
11665
  }
11642
11666
  }
11643
- const Td = (i) => {
11667
+ const Sd = (i) => {
11644
11668
  const e = i.rotation, t = 0.01, n = Math.PI, s = (Math.abs(e.x) % (2 * n) + 2 * n) % (2 * n), r = (Math.abs(e.y) % (2 * n) + 2 * n) % (2 * n), o = Math.abs(s - n / 2) < t || Math.abs(s - 3 * n / 2) < t || Math.abs(r - n / 2) < t || Math.abs(r - 3 * n / 2) < t, a = (Math.abs(s) < t || Math.abs(s - n) < t) && (Math.abs(r) < t || Math.abs(r - n) < t);
11645
11669
  return !(o || a);
11646
- }, _d = 25, Sd = 200;
11647
- function bd({
11670
+ }, bd = 25, xd = 200;
11671
+ function Ad({
11648
11672
  gizmoRenderer: i,
11649
11673
  gizmoScene: e,
11650
11674
  gizmoCamera: t,
@@ -11652,31 +11676,31 @@ function bd({
11652
11676
  gizmoControlRef: s
11653
11677
  }) {
11654
11678
  const r = Ve(null), o = Ve(null), a = Ve(new w.Raycaster()).current, c = Ve(new w.Vector2()).current, u = Rt(() => {
11655
- const x = e.getObjectByName($n), _ = Td(t);
11656
- if (x && _) {
11657
- e.remove(x);
11679
+ const S = e.getObjectByName($n), _ = Sd(t);
11680
+ if (S && _) {
11681
+ e.remove(S);
11658
11682
  return;
11659
11683
  }
11660
- if (x || _) return;
11661
- const b = new Ed().create();
11662
- b.rotation.copy(t.rotation), e.add(b);
11684
+ if (S || _) return;
11685
+ const x = new _d().create();
11686
+ x.rotation.copy(t.rotation), e.add(x);
11663
11687
  }, [e, t]), d = Rt(() => {
11664
- const x = e.getObjectByName($n);
11665
- x && e.remove(x);
11688
+ const S = e.getObjectByName($n);
11689
+ S && e.remove(S);
11666
11690
  }, [e]), h = Rt(
11667
- pd((x) => {
11691
+ gd((S) => {
11668
11692
  if (!s.current || !i) return;
11669
- go(x, i, c);
11693
+ go(S, i, c);
11670
11694
  const _ = ha(
11671
11695
  c,
11672
11696
  t,
11673
11697
  e,
11674
11698
  a
11675
- ), b = ua(_);
11676
- b != null && b.userData.gizmoCube ? b.userData.gizmoCube.highlightObject(b) : e.traverse((E) => {
11699
+ ), x = ua(_);
11700
+ x != null && x.userData.gizmoCube ? x.userData.gizmoCube.highlightObject(x) : e.traverse((E) => {
11677
11701
  E.userData.gizmoCube && E.userData.gizmoCube.highlightObject(null);
11678
11702
  }), _.length > 0 ? u() : d();
11679
- }, 1e3 / _d),
11703
+ }, 1e3 / bd),
11680
11704
  [
11681
11705
  s,
11682
11706
  i,
@@ -11687,26 +11711,26 @@ function bd({
11687
11711
  u,
11688
11712
  d
11689
11713
  ]
11690
- ), f = Rt((x) => {
11691
- r.current = Date.now(), o.current = { x: x.clientX, y: x.clientY };
11714
+ ), f = Rt((S) => {
11715
+ r.current = Date.now(), o.current = { x: S.clientX, y: S.clientY };
11692
11716
  }, []), p = Rt(
11693
- (x) => {
11717
+ (S) => {
11694
11718
  var _;
11695
- const b = x.name === Xs ? 1 : -1, E = 90 * Math.PI / 180, S = new w.Vector3(0, 0, 0), T = b * E, A = new w.Matrix4();
11696
- A.makeRotationZ(T), t.up.applyMatrix4(A), t.lookAt(S), (_ = s.current) == null || _.gizmoControls.update();
11719
+ const x = S.name === Xs ? 1 : -1, E = 90 * Math.PI / 180, b = new w.Vector3(0, 0, 0), T = x * E, A = new w.Matrix4();
11720
+ A.makeRotationZ(T), t.up.applyMatrix4(A), t.lookAt(b), (_ = s.current) == null || _.gizmoControls.update();
11697
11721
  },
11698
11722
  [t, s]
11699
- ), g = Rt(
11700
- (x) => {
11701
- if ((r.current ? Date.now() - r.current : 0) < Sd) {
11702
- go(x, i, c);
11703
- const _ = md(
11723
+ ), y = Rt(
11724
+ (S) => {
11725
+ if ((r.current ? Date.now() - r.current : 0) < xd) {
11726
+ go(S, i, c);
11727
+ const _ = yd(
11704
11728
  c,
11705
11729
  t,
11706
11730
  e,
11707
11731
  a
11708
11732
  );
11709
- _ != null && _.name && id.includes(_.name) ? p(_) : gd(_, n);
11733
+ _ != null && _.name && od.includes(_.name) ? p(_) : wd(_, n);
11710
11734
  }
11711
11735
  r.current = null, o.current = null;
11712
11736
  },
@@ -11723,23 +11747,23 @@ function bd({
11723
11747
  return {
11724
11748
  onMouseDown: f,
11725
11749
  onMouseMove: h,
11726
- onMouseUp: g,
11750
+ onMouseUp: y,
11727
11751
  onMouseLeave: d
11728
11752
  };
11729
11753
  }
11730
- const xd = ({
11754
+ const vd = ({
11731
11755
  camera: i,
11732
11756
  controls: e,
11733
11757
  className: t,
11734
11758
  render: n,
11735
11759
  options: s
11736
11760
  }) => {
11737
- const r = Ve(null), o = Ve(new w.Scene()).current, [a] = Yn(() => cd()), c = 30, u = 1, d = 0.1, h = 10, f = new w.PerspectiveCamera(
11761
+ const r = Ve(null), o = Ve(new w.Scene()).current, [a] = An(() => hd()), c = 30, u = 1, d = 0.1, h = 10, f = new w.PerspectiveCamera(
11738
11762
  c,
11739
11763
  u,
11740
11764
  d,
11741
11765
  h
11742
- ), p = Ve(f).current, g = Ve(null), x = Rt(() => {
11766
+ ), p = Ve(f).current, y = Ve(null), S = Rt(() => {
11743
11767
  a && (n(), a.render(o, p));
11744
11768
  }, [n, a, o, p]), _ = Rt(
11745
11769
  (A) => {
@@ -11747,27 +11771,27 @@ const xd = ({
11747
11771
  const P = i.position.length(), I = A.clone().multiplyScalar(P), M = 400, O = new w.Matrix4();
11748
11772
  O.lookAt(I, new w.Vector3(0, 0, 0), new w.Vector3(0, 1, 0));
11749
11773
  const C = new w.Quaternion();
11750
- C.setFromRotationMatrix(O), i.quaternion.copy(C), Gu(
11774
+ C.setFromRotationMatrix(O), i.quaternion.copy(C), Vu(
11751
11775
  i,
11752
11776
  e,
11753
11777
  i.position.clone(),
11754
11778
  I,
11755
11779
  M,
11756
- x
11780
+ S
11757
11781
  ), i.up.set(0, 1, 0), i.lookAt(new w.Vector3(0, 0, 0)), e.target.set(0, 0, 0), e.update();
11758
11782
  },
11759
- [i, e, x, o]
11760
- ), { onMouseDown: b, onMouseMove: E, onMouseUp: S, onMouseLeave: T } = bd({
11783
+ [i, e, S, o]
11784
+ ), { onMouseDown: x, onMouseMove: E, onMouseUp: b, onMouseLeave: T } = Ad({
11761
11785
  gizmoRenderer: a,
11762
11786
  gizmoScene: o,
11763
11787
  gizmoCamera: p,
11764
11788
  alignCameraWithVector: _,
11765
- gizmoControlRef: g
11789
+ gizmoControlRef: y
11766
11790
  });
11767
- return ht(() => {
11791
+ return rt(() => {
11768
11792
  const A = r.current;
11769
11793
  if (!A || !i || !e || !a) return;
11770
- g.current && g.current.dispose();
11794
+ y.current && y.current.dispose();
11771
11795
  const P = {
11772
11796
  gizmoDiv: A,
11773
11797
  gizmoScene: o,
@@ -11776,34 +11800,34 @@ const xd = ({
11776
11800
  }, I = {
11777
11801
  mainCamera: i,
11778
11802
  mainControls: e,
11779
- renderGizmo: x
11803
+ renderGizmo: S
11780
11804
  }, M = {
11781
11805
  syncGizmoCameraWithMain: mo,
11782
- syncMainCameraWithGizmo: od
11806
+ syncMainCameraWithGizmo: cd
11783
11807
  };
11784
- return g.current = new fd({
11808
+ return y.current = new md({
11785
11809
  gizmoParams: P,
11786
11810
  mainParams: I,
11787
11811
  syncFunctions: M,
11788
11812
  options: s
11789
- }), A.addEventListener("mousedown", b), A.addEventListener("mousemove", E), A.addEventListener("mouseup", S), A.addEventListener("mouseleave", T), () => {
11790
- g.current && (g.current.dispose(), g.current = null), A.removeEventListener("mousedown", b), A.removeEventListener("mousemove", E), A.removeEventListener("mouseup", S), A.removeEventListener("mouseleave", T);
11813
+ }), A.addEventListener("mousedown", x), A.addEventListener("mousemove", E), A.addEventListener("mouseup", b), A.addEventListener("mouseleave", T), () => {
11814
+ y.current && (y.current.dispose(), y.current = null), A.removeEventListener("mousedown", x), A.removeEventListener("mousemove", E), A.removeEventListener("mouseup", b), A.removeEventListener("mouseleave", T);
11791
11815
  };
11792
- }, [i, e, x, E, b, S]), ht(() => {
11793
- i && (mo(p, i, o), x());
11794
- }, [i, x]), /* @__PURE__ */ Te(
11816
+ }, [i, e, S, E, x, b]), rt(() => {
11817
+ i && (mo(p, i, o), S());
11818
+ }, [i, S]), /* @__PURE__ */ Te(
11795
11819
  "div",
11796
11820
  {
11797
11821
  className: t ? `${t}` : "gizmo-default",
11798
11822
  ref: r
11799
11823
  }
11800
11824
  );
11801
- }, ks = 10, Ad = (i) => ({
11825
+ }, ks = 10, Rd = (i) => ({
11802
11826
  top: i.startsWith("top") ? ks : "auto",
11803
11827
  bottom: i.startsWith("bottom") ? ks : "auto",
11804
11828
  left: i.endsWith("left") ? ks : "auto",
11805
11829
  right: i.endsWith("right") ? ks : "auto"
11806
- }), vd = ({
11830
+ }), Md = ({
11807
11831
  camera: i,
11808
11832
  controls: e,
11809
11833
  render: t,
@@ -11822,10 +11846,10 @@ const xd = ({
11822
11846
  width: s,
11823
11847
  height: s,
11824
11848
  zIndex: 1e3,
11825
- ...Ad(n)
11849
+ ...Rd(n)
11826
11850
  },
11827
11851
  children: /* @__PURE__ */ Te(
11828
- xd,
11852
+ vd,
11829
11853
  {
11830
11854
  camera: i,
11831
11855
  controls: r,
@@ -11835,7 +11859,7 @@ const xd = ({
11835
11859
  }
11836
11860
  );
11837
11861
  };
11838
- class Rd extends Ka {
11862
+ class Id extends Ka {
11839
11863
  constructor(e) {
11840
11864
  super(e), this.reset = () => {
11841
11865
  this.setState({ hasError: !1, error: null });
@@ -11860,16 +11884,16 @@ class Rd extends Ka {
11860
11884
  fontFamily: "sans-serif",
11861
11885
  padding: "20px",
11862
11886
  textAlign: "center"
11863
- }, children: /* @__PURE__ */ Gn("div", { children: [
11887
+ }, children: /* @__PURE__ */ jn("div", { children: [
11864
11888
  /* @__PURE__ */ Te("h3", { children: "Error Loading 3D Viewer" }),
11865
11889
  /* @__PURE__ */ Te("p", { children: ((e = this.state.error) == null ? void 0 : e.message) || "An unexpected error occurred" }),
11866
11890
  /* @__PURE__ */ Te("button", { type: "button", onClick: this.reset, children: "Try again" })
11867
11891
  ] }) }) : this.props.children;
11868
11892
  }
11869
11893
  }
11870
- function Md({ status: i, label: e, color: t, backdrop: n }) {
11894
+ function Cd({ status: i, label: e, color: t, backdrop: n }) {
11871
11895
  const s = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
11872
- return /* @__PURE__ */ Gn(
11896
+ return /* @__PURE__ */ jn(
11873
11897
  "div",
11874
11898
  {
11875
11899
  "data-testid": "viewer-loading-overlay",
@@ -11894,7 +11918,7 @@ function Md({ status: i, label: e, color: t, backdrop: n }) {
11894
11918
  fontSize: 14
11895
11919
  },
11896
11920
  children: [
11897
- i === "loading" ? /* @__PURE__ */ Gn("svg", { width: "44", height: "44", viewBox: "0 0 44 44", "aria-hidden": "true", children: [
11921
+ i === "loading" ? /* @__PURE__ */ jn("svg", { width: "44", height: "44", viewBox: "0 0 44 44", "aria-hidden": "true", children: [
11898
11922
  /* @__PURE__ */ Te("circle", { cx: "22", cy: "22", r: "18", fill: "none", stroke: t, strokeOpacity: "0.25", strokeWidth: "4" }),
11899
11923
  /* @__PURE__ */ Te("path", { d: "M22 4 a18 18 0 0 1 18 18", fill: "none", stroke: t, strokeWidth: "4", strokeLinecap: "round", children: !s && /* @__PURE__ */ Te(
11900
11924
  "animateTransform",
@@ -11907,7 +11931,7 @@ function Md({ status: i, label: e, color: t, backdrop: n }) {
11907
11931
  repeatCount: "indefinite"
11908
11932
  }
11909
11933
  ) })
11910
- ] }) : /* @__PURE__ */ Gn("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: t, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
11934
+ ] }) : /* @__PURE__ */ jn("svg", { width: "40", height: "40", viewBox: "0 0 24 24", fill: "none", stroke: t, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
11911
11935
  /* @__PURE__ */ Te("path", { d: "M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
11912
11936
  /* @__PURE__ */ Te("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
11913
11937
  /* @__PURE__ */ Te("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
@@ -11917,14 +11941,14 @@ function Md({ status: i, label: e, color: t, backdrop: n }) {
11917
11941
  }
11918
11942
  );
11919
11943
  }
11920
- const Id = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif', Cd = {
11944
+ const Pd = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif', Ld = {
11921
11945
  background: "rgba(255,255,255,0.78)",
11922
11946
  backdropFilter: "blur(16px)",
11923
11947
  WebkitBackdropFilter: "blur(16px)",
11924
11948
  border: "1px solid rgba(0,0,0,0.06)",
11925
11949
  boxShadow: "0 8px 30px rgba(0,0,0,0.10)"
11926
- }, Pd = Object.keys(sa);
11927
- function Ld({ active: i, onSelect: e }) {
11950
+ }, Od = Object.keys(sa);
11951
+ function Dd({ active: i, onSelect: e }) {
11928
11952
  return /* @__PURE__ */ Te(
11929
11953
  "div",
11930
11954
  {
@@ -11945,9 +11969,9 @@ function Ld({ active: i, onSelect: e }) {
11945
11969
  // instead of bleeding past the canvas edges.
11946
11970
  maxWidth: "calc(100% - 16px)",
11947
11971
  overflowX: "auto",
11948
- ...Cd
11972
+ ...Ld
11949
11973
  },
11950
- children: Pd.map((t) => /* @__PURE__ */ Te(
11974
+ children: Od.map((t) => /* @__PURE__ */ Te(
11951
11975
  "button",
11952
11976
  {
11953
11977
  type: "button",
@@ -11962,7 +11986,7 @@ function Ld({ active: i, onSelect: e }) {
11962
11986
  border: t === i ? "1px solid #111318" : "1px solid transparent",
11963
11987
  background: t === i ? "#111318" : "transparent",
11964
11988
  color: t === i ? "#fff" : "#3f3f4a",
11965
- fontFamily: Id,
11989
+ fontFamily: Pd,
11966
11990
  fontSize: 13,
11967
11991
  fontWeight: 500,
11968
11992
  lineHeight: 1,
@@ -11979,7 +12003,7 @@ function Ld({ active: i, onSelect: e }) {
11979
12003
  }
11980
12004
  );
11981
12005
  }
11982
- const Un = {
12006
+ const Hn = {
11983
12007
  enabled: !0,
11984
12008
  label: "Loading…",
11985
12009
  color: "#ffffff",
@@ -11987,84 +12011,84 @@ const Un = {
11987
12011
  // default light background (#f0f0f7) and dark studio mode.
11988
12012
  backdrop: "rgba(15,16,20,0.6)"
11989
12013
  };
11990
- function Od(i) {
11991
- return i === void 0 || i === !0 ? Un : i === !1 ? { ...Un, enabled: !1 } : {
12014
+ function Nd(i) {
12015
+ return i === void 0 || i === !0 ? Hn : i === !1 ? { ...Hn, enabled: !1 } : {
11992
12016
  enabled: i.enabled ?? !0,
11993
- label: i.label ?? Un.label,
12017
+ label: i.label ?? Hn.label,
11994
12018
  errorLabel: i.errorLabel,
11995
- color: i.color ?? Un.color,
11996
- backdrop: i.backdrop ?? Un.backdrop
12019
+ color: i.color ?? Hn.color,
12020
+ backdrop: i.backdrop ?? Hn.backdrop
11997
12021
  };
11998
12022
  }
11999
12023
  const Fs = () => new Z("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), da = yo(
12000
12024
  ({ object: i, options: e = {}, preset: t, pathTraced: n, turntable: s, animations: r, children: o }, a) => {
12001
12025
  var D, H;
12002
- const c = Ve(null), u = e.preset ?? t, { activePreset: d, pickerEnabled: h, selectPreset: f } = Nu(
12026
+ const c = Ve(null), u = e.preset ?? t, { activePreset: d, pickerEnabled: h, selectPreset: f } = Fu(
12003
12027
  u,
12004
12028
  e.ui
12005
- ), p = ku(
12029
+ ), p = zu(
12006
12030
  e,
12007
12031
  d,
12008
12032
  n,
12009
12033
  s,
12010
12034
  r
12011
- ), { viewer: g, isInitialized: x, initError: _ } = Du(c, p), b = Fu(g, x, i), E = zu(g);
12012
- Bu(g, _, e);
12013
- const S = g ? es(g.getCamera()) : null, T = g ? ur(g.getControls()) : null, A = g ? Xo(g.getRenderer()) : null, P = Rt(() => {
12014
- g == null || g.requestRender();
12015
- }, [g]), I = ((D = e.helpers) == null ? void 0 : D.gizmo) !== void 0 && e.helpers.gizmo !== !1, M = typeof ((H = e.helpers) == null ? void 0 : H.gizmo) == "object" ? e.helpers.gizmo : {}, O = Dt(
12016
- () => Od(e.loadingIndicator),
12035
+ ), { viewer: y, isInitialized: S, initError: _ } = ku(c, p), x = Bu(y, S, i), E = Uu(y);
12036
+ Hu(y, _, e);
12037
+ const b = y ? es(y.getCamera()) : null, T = y ? ur(y.getControls()) : null, A = y ? Xo(y.getRenderer()) : null, P = Rt(() => {
12038
+ y == null || y.requestRender();
12039
+ }, [y]), I = ((D = e.helpers) == null ? void 0 : D.gizmo) !== void 0 && e.helpers.gizmo !== !1, M = typeof ((H = e.helpers) == null ? void 0 : H.gizmo) == "object" ? e.helpers.gizmo : {}, O = Dt(
12040
+ () => Nd(e.loadingIndicator),
12017
12041
  [e.loadingIndicator]
12018
- ), C = b.status === "error" || !!_, N = O.enabled && (b.status === "loading" || C);
12042
+ ), C = x.status === "error" || !!_, N = O.enabled && (x.status === "loading" || C);
12019
12043
  return Xa(a, () => ({
12020
- scene: g ? Gi(g.getScene()) : null,
12021
- camera: S,
12044
+ scene: y ? Gi(y.getScene()) : null,
12045
+ camera: b,
12022
12046
  renderer: A,
12023
12047
  controls: T,
12024
12048
  events: E,
12025
12049
  loadModel: async (j) => {
12026
- if (!g)
12050
+ if (!y)
12027
12051
  throw Fs();
12028
- const q = typeof j == "string" ? j : new Oe(j), ie = await g.loadModel(q);
12052
+ const q = typeof j == "string" ? j : new Oe(j), ie = await y.loadModel(q);
12029
12053
  if (!ie.ok)
12030
12054
  throw ie.error;
12031
12055
  },
12032
12056
  captureStill: async (j) => {
12033
- if (!g)
12057
+ if (!y)
12034
12058
  throw Fs();
12035
- const q = await g.captureStill(j);
12059
+ const q = await y.captureStill(j);
12036
12060
  if (!q.ok)
12037
12061
  throw q.error;
12038
12062
  return q.value;
12039
12063
  },
12040
12064
  captureVideo: async (j) => {
12041
- if (!g)
12065
+ if (!y)
12042
12066
  throw Fs();
12043
- const q = await g.captureVideo(j);
12067
+ const q = await y.captureVideo(j);
12044
12068
  if (!q.ok)
12045
12069
  throw q.error;
12046
12070
  return q.value;
12047
12071
  },
12048
- getAnimationNames: () => (g == null ? void 0 : g.getAnimationNames()) ?? [],
12072
+ getAnimationNames: () => (y == null ? void 0 : y.getAnimationNames()) ?? [],
12049
12073
  playAnimations: (j) => {
12050
- if (!g)
12074
+ if (!y)
12051
12075
  throw Fs();
12052
- const q = g.playAnimations(j);
12076
+ const q = y.playAnimations(j);
12053
12077
  if (!q.ok)
12054
12078
  throw q.error;
12055
12079
  },
12056
12080
  pauseAnimations: () => {
12057
- g == null || g.pauseAnimations();
12081
+ y == null || y.pauseAnimations();
12058
12082
  },
12059
12083
  dispose: () => {
12060
- g == null || g.dispose();
12084
+ y == null || y.dispose();
12061
12085
  }
12062
- }), [g, S, A, T, E]), /* @__PURE__ */ Te(Rd, { children: /* @__PURE__ */ Te(Uu, { viewer: g, canvasRef: c, children: /* @__PURE__ */ Gn("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
12063
- /* @__PURE__ */ Te(Hu, {}),
12064
- I && x && S && T && /* @__PURE__ */ Te(
12065
- vd,
12086
+ }), [y, b, A, T, E]), /* @__PURE__ */ Te(Id, { children: /* @__PURE__ */ Te(Gu, { viewer: y, canvasRef: c, children: /* @__PURE__ */ jn("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
12087
+ /* @__PURE__ */ Te(ju, {}),
12088
+ I && S && b && T && /* @__PURE__ */ Te(
12089
+ Md,
12066
12090
  {
12067
- camera: S,
12091
+ camera: b,
12068
12092
  controls: T,
12069
12093
  render: P,
12070
12094
  placement: M.placement,
@@ -12072,27 +12096,27 @@ const Fs = () => new Z("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), da =
12072
12096
  }
12073
12097
  ),
12074
12098
  N && /* @__PURE__ */ Te(
12075
- Md,
12099
+ Cd,
12076
12100
  {
12077
12101
  status: C ? "error" : "loading",
12078
- label: C ? O.errorLabel ?? (_ == null ? void 0 : _.message) ?? b.error ?? "Failed to load model" : O.label,
12102
+ label: C ? O.errorLabel ?? (_ == null ? void 0 : _.message) ?? x.error ?? "Failed to load model" : O.label,
12079
12103
  color: O.color,
12080
12104
  backdrop: O.backdrop
12081
12105
  }
12082
12106
  ),
12083
12107
  h && /* The defaults ARE the studio look (pinned by presets.test.ts),
12084
12108
  so with no preset set the studio chip is the honest active one. */
12085
- /* @__PURE__ */ Te(Ld, { active: d ?? "studio", onSelect: f }),
12109
+ /* @__PURE__ */ Te(Dd, { active: d ?? "studio", onSelect: f }),
12086
12110
  o
12087
12111
  ] }) }) });
12088
12112
  }
12089
12113
  );
12090
12114
  da.displayName = "SimpleViewer";
12091
- const Dd = yo(
12115
+ const kd = yo(
12092
12116
  (i, e) => /* @__PURE__ */ Te(da, { ref: e, ...i })
12093
12117
  );
12094
- Dd.displayName = "SimpleViewer";
12095
- const Nd = () => /* @__PURE__ */ Te(
12118
+ kd.displayName = "SimpleViewer";
12119
+ const Fd = () => /* @__PURE__ */ Te(
12096
12120
  "span",
12097
12121
  {
12098
12122
  "aria-hidden": "true",
@@ -12107,9 +12131,9 @@ const Nd = () => /* @__PURE__ */ Te(
12107
12131
  }
12108
12132
  }
12109
12133
  );
12110
- function Gd({ position: i, occlude: e = !1, children: t }) {
12134
+ function Vd({ position: i, occlude: e = !1, children: t }) {
12111
12135
  const { viewer: n } = oa(), s = Ve(null), [r, o, a] = i;
12112
- ht(() => {
12136
+ rt(() => {
12113
12137
  if (!n)
12114
12138
  return;
12115
12139
  const u = s.current;
@@ -12131,13 +12155,13 @@ function Gd({ position: i, occlude: e = !1, children: t }) {
12131
12155
  d.invalidate(), f();
12132
12156
  };
12133
12157
  f();
12134
- const g = n.getEvents(), x = [
12135
- g.on("render:complete", f),
12136
- g.on("controls:change", f),
12137
- g.on("model:loaded", p)
12158
+ const y = n.getEvents(), S = [
12159
+ y.on("render:complete", f),
12160
+ y.on("controls:change", f),
12161
+ y.on("model:loaded", p)
12138
12162
  ];
12139
12163
  return window.addEventListener("resize", p), () => {
12140
- x.forEach((_) => _()), window.removeEventListener("resize", p);
12164
+ S.forEach((_) => _()), window.removeEventListener("resize", p);
12141
12165
  };
12142
12166
  }, [n, r, o, a, e]);
12143
12167
  const c = t != null && t !== !1;
@@ -12158,7 +12182,7 @@ function Gd({ position: i, occlude: e = !1, children: t }) {
12158
12182
  // interactive custom children keep receiving pointer events.
12159
12183
  pointerEvents: c ? "auto" : "none"
12160
12184
  },
12161
- children: c ? t : /* @__PURE__ */ Te(Nd, {})
12185
+ children: c ? t : /* @__PURE__ */ Te(Fd, {})
12162
12186
  }
12163
12187
  );
12164
12188
  }
@@ -12167,9 +12191,9 @@ export {
12167
12191
  Qe as C,
12168
12192
  Ir as D,
12169
12193
  Y as E,
12170
- Gd as H,
12194
+ Vd as H,
12171
12195
  Ne as I,
12172
- Bd as L,
12196
+ Hd as L,
12173
12197
  Ws as M,
12174
12198
  $e as O,
12175
12199
  k as R,
@@ -12177,14 +12201,14 @@ export {
12177
12201
  nr as T,
12178
12202
  sa as V,
12179
12203
  ar as a,
12180
- Ud as b,
12204
+ Gd as b,
12181
12205
  Bc as c,
12182
12206
  Yo as d,
12183
12207
  Z as e,
12184
12208
  Ks as f,
12185
12209
  Jc as g,
12186
12210
  Oc as h,
12187
- Dd as i,
12211
+ kd as i,
12188
12212
  Zi as j,
12189
12213
  Lu as r
12190
12214
  };