@tomorrowevening/hermes 0.0.116 → 0.0.117

Sign up to get free protection for your applications and to get access to all the features.
package/dist/hermes.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { OrthographicCamera as Ai, Scene as Hs, MeshBasicMaterial as Je, BufferGeometry as gt, Float32BufferAttribute as Ke, Mesh as M, LinearSRGBColorSpace as Ut, EventDispatcher as Ys, Texture as Bn, RepeatWrapping as is, Color as et, ColorManagement as pt, WebGLRenderTarget as Vn, FrontSide as Zn, BackSide as Bs, DoubleSide as Ni, NoBlending as Wn, NormalBlending as Gn, AdditiveBlending as Xn, SubtractiveBlending as $n, MultiplyBlending as qn, CustomBlending as Kn, AddEquation as Qn, SubtractEquation as Jn, ReverseSubtractEquation as ea, MinEquation as ta, MaxEquation as ia, ZeroFactor as Vs, OneFactor as Zs, SrcColorFactor as Ws, OneMinusSrcColorFactor as Gs, SrcAlphaFactor as Xs, OneMinusSrcAlphaFactor as $s, DstAlphaFactor as qs, OneMinusDstAlphaFactor as Ks, DstColorFactor as Qs, OneMinusDstColorFactor as Js, SrcAlphaSaturateFactor as sa, ConstantColorFactor as en, OneMinusConstantColorFactor as tn, ConstantAlphaFactor as sn, OneMinusConstantAlphaFactor as nn, Line as Ie, LineBasicMaterial as Fi, Ray as na, Plane as aa, MathUtils as ra, Vector3 as A, Controls as an, MOUSE as ft, TOUCH as mt, Quaternion as Ee, Spherical as Pi, Vector2 as ue, ShaderMaterial as rn, GLSL3 as oa, PlaneGeometry as on, Raycaster as ii, Euler as ln, Matrix4 as ri, Object3D as _t, CylinderGeometry as _e, BoxGeometry as he, OctahedronGeometry as Bt, SphereGeometry as cn, TorusGeometry as bt, CatmullRomCurve3 as ss, Group as la, AxesHelper as ns, MeshDepthMaterial as ca, MeshNormalMaterial as ha, PerspectiveCamera as Et, WebGLRenderer as da, CameraHelper as ua, SkinnedMesh as pa, SpotLightHelper as ma, PointLightHelper as fa, HemisphereLightHelper as ga, DirectionalLightHelper as _a, Clock as va, Vector4 as ya, Box3 as ba, Sphere as Ea, SkeletonHelper as Ca, SRGBColorSpace as as, NoToneMapping as rs, NoColorSpace as Sa, LinearToneMapping as wa, ReinhardToneMapping as xa, CineonToneMapping as Oa, ACESFilmicToneMapping as Ta, AgXToneMapping as Ma, NeutralToneMapping as Aa, CustomToneMapping as Pa } from "three";
2
- import hn, { useState as X, useRef as ne, useEffect as tt, useMemo as kt, Component as jt, createRef as Ve, forwardRef as Da } from "react";
1
+ import { OrthographicCamera as Ai, Scene as Hs, MeshBasicMaterial as Je, BufferGeometry as gt, Float32BufferAttribute as Ke, Mesh as O, LinearSRGBColorSpace as Ut, EventDispatcher as Ys, Texture as Bn, RepeatWrapping as is, Color as et, ColorManagement as pt, WebGLRenderTarget as Vn, FrontSide as Zn, BackSide as Bs, DoubleSide as Ni, NoBlending as Wn, NormalBlending as Gn, AdditiveBlending as Xn, SubtractiveBlending as $n, MultiplyBlending as qn, CustomBlending as Kn, AddEquation as Qn, SubtractEquation as Jn, ReverseSubtractEquation as ea, MinEquation as ta, MaxEquation as ia, ZeroFactor as Vs, OneFactor as Zs, SrcColorFactor as Ws, OneMinusSrcColorFactor as Gs, SrcAlphaFactor as Xs, OneMinusSrcAlphaFactor as $s, DstAlphaFactor as qs, OneMinusDstAlphaFactor as Ks, DstColorFactor as Qs, OneMinusDstColorFactor as Js, SrcAlphaSaturateFactor as sa, ConstantColorFactor as en, OneMinusConstantColorFactor as tn, ConstantAlphaFactor as sn, OneMinusConstantAlphaFactor as nn, Line as Ie, LineBasicMaterial as Fi, Ray as na, Plane as aa, MathUtils as ra, Vector3 as A, Controls as an, MOUSE as ft, TOUCH as mt, Quaternion as Ee, Spherical as Pi, Vector2 as ue, ShaderMaterial as rn, GLSL3 as oa, PlaneGeometry as on, Raycaster as ii, Euler as ln, Matrix4 as ri, Object3D as _t, CylinderGeometry as _e, BoxGeometry as he, OctahedronGeometry as Bt, SphereGeometry as cn, TorusGeometry as bt, CatmullRomCurve3 as ss, Group as la, AxesHelper as ns, MeshDepthMaterial as ca, MeshNormalMaterial as ha, PerspectiveCamera as Et, WebGLRenderer as da, CameraHelper as ua, SkinnedMesh as pa, SpotLightHelper as ma, PointLightHelper as fa, HemisphereLightHelper as ga, DirectionalLightHelper as _a, Clock as va, Vector4 as ya, Box3 as ba, Sphere as Ea, SkeletonHelper as Ca, SRGBColorSpace as as, NoToneMapping as rs, NoColorSpace as Sa, LinearToneMapping as wa, ReinhardToneMapping as xa, CineonToneMapping as Oa, ACESFilmicToneMapping as Ta, AgXToneMapping as Ma, NeutralToneMapping as Aa, CustomToneMapping as Pa } from "three";
2
+ import hn, { useState as B, useRef as ne, useEffect as tt, useMemo as kt, Component as jt, createRef as Ve, forwardRef as Da } from "react";
3
3
  import { Reorder as dn } from "framer-motion";
4
4
  const un = () => {
5
5
  }, _o = () => {
@@ -93,7 +93,7 @@ class Jt {
93
93
  this.camera = new Ai(-0.5, 0.5, 0.5, -0.5, 0, 100), this.scene = new Hs(), this.material = new Je();
94
94
  const t = new gt();
95
95
  t.setAttribute("position", new Ke([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3)), t.setAttribute("normal", new Ke([0, 0, 1, 0, 0, 1], 3)), t.setAttribute("uv", new Ke([0, 0, 2, 0, 0, 2], 2));
96
- const i = new M(t, this.material);
96
+ const i = new O(t, this.material);
97
97
  this.scene.add(i);
98
98
  }
99
99
  if (e.isRenderTargetTexture)
@@ -161,16 +161,16 @@ function ja(s, e, t) {
161
161
  enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
162
162
  gl_FragColor = enc;
163
163
  }
164
- `, m = l.createShader(35633), _ = l.createShader(35632), E = l.createProgram();
165
- if (!(_ && m && E))
164
+ `, m = l.createShader(35633), g = l.createShader(35632), S = l.createProgram();
165
+ if (!(g && m && S))
166
166
  return;
167
- l.shaderSource(m, d), l.shaderSource(_, p), l.compileShader(m), l.compileShader(_), l.attachShader(E, m), l.attachShader(E, _), l.linkProgram(E), l.detachShader(E, m), l.detachShader(E, _), l.deleteShader(m), l.deleteShader(_), l.useProgram(E);
168
- const O = l.createBuffer();
169
- l.bindBuffer(34962, O), l.bufferData(34962, new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]), 35044);
170
- const T = l.getAttribLocation(E, "aPosition");
171
- l.vertexAttribPointer(T, 3, 5126, !1, 0, 0), l.enableVertexAttribArray(T), l.clearColor(1, 1, 1, 1), l.clear(16384), l.viewport(0, 0, 1, 1), l.drawArrays(4, 0, 3);
167
+ l.shaderSource(m, d), l.shaderSource(g, p), l.compileShader(m), l.compileShader(g), l.attachShader(S, m), l.attachShader(S, g), l.linkProgram(S), l.detachShader(S, m), l.detachShader(S, g), l.deleteShader(m), l.deleteShader(g), l.useProgram(S);
168
+ const T = l.createBuffer();
169
+ l.bindBuffer(34962, T), l.bufferData(34962, new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]), 35044);
170
+ const M = l.getAttribLocation(S, "aPosition");
171
+ l.vertexAttribPointer(M, 3, 5126, !1, 0, 0), l.enableVertexAttribArray(M), l.clearColor(1, 1, 1, 1), l.clear(16384), l.viewport(0, 0, 1, 1), l.drawArrays(4, 0, 3);
172
172
  const f = new Uint8Array(4);
173
- return l.readPixels(0, 0, 1, 1, 6408, 5121, f), l.deleteProgram(E), l.deleteBuffer(O), f.join("");
173
+ return l.readPixels(0, 0, 1, 1, 6408, 5121, f), l.deleteProgram(S), l.deleteBuffer(T), f.join("");
174
174
  }(s), n = "801621810", r = "8016218135", a = "80162181161", o = Le?.isIpad ? [["a7", a, 12], ["a8", r, 15], ["a8x", r, 15], ["a9", r, 15], ["a9x", r, 15], ["a10", r, 15], ["a10x", r, 15], ["a12", n, 15], ["a12x", n, 15], ["a12z", n, 15], ["a14", n, 15], ["a15", n, 15], ["m1", n, 15], ["m2", n, 15]] : [["a7", a, 12], ["a8", r, 12], ["a9", r, 15], ["a10", r, 15], ["a11", n, 15], ["a12", n, 15], ["a13", n, 15], ["a14", n, 15], ["a15", n, 15], ["a16", n, 15], ["a17", n, 15]];
175
175
  let c;
176
176
  return i === "80162181255" ? c = o.filter(([, , l]) => l >= 14) : (c = o.filter(([, l]) => l === i), c.length || (c = o)), c.map(([l]) => `apple ${l} gpu`);
@@ -209,88 +209,88 @@ const za = ({ mobileTiers: s = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
209
209
  const a = {};
210
210
  if (pn)
211
211
  return { tier: 0, type: "SSR" };
212
- const { isIpad: o = !!Le?.isIpad, isMobile: c = !!Le?.isMobile, screenSize: l = window.screen, loadBenchmarks: d = (S) => fi(void 0, void 0, void 0, function* () {
213
- const w = yield fetch(`${r}/${S}`).then((I) => I.json());
212
+ const { isIpad: o = !!Le?.isIpad, isMobile: c = !!Le?.isMobile, screenSize: l = window.screen, loadBenchmarks: d = (C) => fi(void 0, void 0, void 0, function* () {
213
+ const w = yield fetch(`${r}/${C}`).then((I) => I.json());
214
214
  if (parseInt(w.shift().split(".")[0], 10) < 4)
215
215
  throw new hs("Detect GPU benchmark data is out of date. Please update to version 4x");
216
216
  return w;
217
217
  }) } = t;
218
218
  let { renderer: p } = t;
219
- const m = (S, w, I, U, K) => ({ device: K, fps: U, gpu: I, isMobile: c, tier: S, type: w });
220
- let _, E = "";
219
+ const m = (C, w, I, U, K) => ({ device: K, fps: U, gpu: I, isMobile: c, tier: C, type: w });
220
+ let g, S = "";
221
221
  if (p)
222
- p = cs(p), _ = [p];
222
+ p = cs(p), g = [p];
223
223
  else {
224
- const S = i || function(I, U = !1) {
224
+ const C = i || function(I, U = !1) {
225
225
  const K = { alpha: !1, antialias: !1, depth: !1, failIfMajorPerformanceCaveat: U, powerPreference: "high-performance", stencil: !1 };
226
226
  I && delete K.powerPreference;
227
227
  const me = window.document.createElement("canvas"), Ae = me.getContext("webgl", K) || me.getContext("experimental-webgl", K);
228
228
  return Ae ?? void 0;
229
229
  }(Le?.isSafari12, n);
230
- if (!S)
230
+ if (!C)
231
231
  return m(0, "WEBGL_UNSUPPORTED");
232
- const w = Le?.isFirefox ? null : S.getExtension("WEBGL_debug_renderer_info");
233
- if (p = w ? S.getParameter(w.UNMASKED_RENDERER_WEBGL) : S.getParameter(S.RENDERER), !p)
232
+ const w = Le?.isFirefox ? null : C.getExtension("WEBGL_debug_renderer_info");
233
+ if (p = w ? C.getParameter(w.UNMASKED_RENDERER_WEBGL) : C.getParameter(C.RENDERER), !p)
234
234
  return m(1, "FALLBACK");
235
- E = p, p = cs(p), _ = function(I, U, K) {
235
+ S = p, p = cs(p), g = function(I, U, K) {
236
236
  return U === "apple gpu" ? ja(I, U, K) : [U];
237
- }(S, p, c);
237
+ }(C, p, c);
238
238
  }
239
- const O = (yield Promise.all(_.map(function(S) {
239
+ const T = (yield Promise.all(g.map(function(C) {
240
240
  var w;
241
241
  return fi(this, void 0, void 0, function* () {
242
- const I = ((B) => {
242
+ const I = ((V) => {
243
243
  const re = c ? ["adreno", "apple", "mali-t", "mali", "nvidia", "powervr", "samsung"] : ["intel", "apple", "amd", "radeon", "nvidia", "geforce", "adreno"];
244
244
  for (const Oe of re)
245
- if (B.includes(Oe))
245
+ if (V.includes(Oe))
246
246
  return Oe;
247
- })(S);
247
+ })(C);
248
248
  if (!I)
249
249
  return;
250
250
  const U = `${c ? "m" : "d"}-${I}${o ? "-ipad" : ""}.json`, K = a[U] = (w = a[U]) !== null && w !== void 0 ? w : d(U);
251
251
  let me;
252
252
  try {
253
253
  me = yield K;
254
- } catch (B) {
255
- if (B instanceof hs)
256
- throw B;
254
+ } catch (V) {
255
+ if (V instanceof hs)
256
+ throw V;
257
257
  return;
258
258
  }
259
- const Ae = function(B) {
259
+ const Ae = function(V) {
260
260
  var re;
261
- const Oe = (B = B.replace(/\([^)]+\)/, "")).match(/\d+/) || B.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);
261
+ const Oe = (V = V.replace(/\([^)]+\)/, "")).match(/\d+/) || V.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);
262
262
  return (re = Oe?.join("").replace(/\W|amd/g, "")) !== null && re !== void 0 ? re : "";
263
- }(S);
264
- let Ce = me.filter(([, B]) => B === Ae);
265
- Ce.length || (Ce = me.filter(([B]) => B.includes(S)));
263
+ }(C);
264
+ let Ce = me.filter(([, V]) => V === Ae);
265
+ Ce.length || (Ce = me.filter(([V]) => V.includes(C)));
266
266
  const le = Ce.length;
267
267
  if (le === 0)
268
268
  return;
269
- const Q = S.split(/[.,()\[\]/\s]/g).sort().filter((B, re, Oe) => re === 0 || B !== Oe[re - 1]).join(" ");
270
- let W, [Ue, , , , ce] = le > 1 ? Ce.map((B) => [B, Na(Q, B[2])]).sort(([, B], [, re]) => B - re)[0][0] : Ce[0], be = Number.MAX_VALUE;
269
+ const Q = C.split(/[.,()\[\]/\s]/g).sort().filter((V, re, Oe) => re === 0 || V !== Oe[re - 1]).join(" ");
270
+ let G, [Ue, , , , ce] = le > 1 ? Ce.map((V) => [V, Na(Q, V[2])]).sort(([, V], [, re]) => V - re)[0][0] : Ce[0], be = Number.MAX_VALUE;
271
271
  const { devicePixelRatio: te } = window, je = l.width * te * l.height * te;
272
- for (const B of ce) {
273
- const [re, Oe] = B, vt = re * Oe, it = Math.abs(je - vt);
274
- it < be && (be = it, W = B);
272
+ for (const V of ce) {
273
+ const [re, Oe] = V, vt = re * Oe, it = Math.abs(je - vt);
274
+ it < be && (be = it, G = V);
275
275
  }
276
- if (!W)
276
+ if (!G)
277
277
  return;
278
- const [, , Ne, Fe] = W;
278
+ const [, , Ne, Fe] = G;
279
279
  return [be, Ne, Ue, Fe];
280
280
  });
281
- }))).filter(Fa).sort(([S = Number.MAX_VALUE, w], [I = Number.MAX_VALUE, U]) => S === I ? w - U : S - I);
282
- if (!O.length) {
283
- const S = Ua.find((w) => p.includes(w));
284
- return S ? m(0, "BLOCKLISTED", S) : m(1, "FALLBACK", `${p} (${E})`);
285
- }
286
- const [, T, f, v] = O[0];
287
- if (T === -1)
288
- return m(0, "BLOCKLISTED", f, T, v);
289
- const C = c ? s : e;
281
+ }))).filter(Fa).sort(([C = Number.MAX_VALUE, w], [I = Number.MAX_VALUE, U]) => C === I ? w - U : C - I);
282
+ if (!T.length) {
283
+ const C = Ua.find((w) => p.includes(w));
284
+ return C ? m(0, "BLOCKLISTED", C) : m(1, "FALLBACK", `${p} (${S})`);
285
+ }
286
+ const [, M, f, v] = T[0];
287
+ if (M === -1)
288
+ return m(0, "BLOCKLISTED", f, M, v);
289
+ const E = c ? s : e;
290
290
  let b = 0;
291
- for (let S = 0; S < C.length; S++)
292
- T >= C[S] && (b = S);
293
- return m(b, "BENCHMARK", f, T, v);
291
+ for (let C = 0; C < E.length; C++)
292
+ M >= E[C] && (b = C);
293
+ return m(b, "BENCHMARK", f, M, v);
294
294
  });
295
295
  var Ha = /* @__PURE__ */ ((s) => (s[s.High = 0] = "High", s[s.Medium = 1] = "Medium", s[s.Low = 2] = "Low", s))(Ha || {});
296
296
  function yo(s) {
@@ -554,13 +554,13 @@ class wo extends zi {
554
554
  l !== void 0 ? l = a.object(t, { ...i, ...l.value }, { reconfigure: !0 }) : l = a.object(t, i), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n : un);
555
555
  const d = l.onValuesChange((p) => {
556
556
  if (this.app.editor) {
557
- for (const _ in p) {
558
- const E = p[_];
559
- typeof E == "object" && La(E) && (p[_] = {
560
- r: E.r,
561
- g: E.g,
562
- b: E.b,
563
- a: E.a
557
+ for (const g in p) {
558
+ const S = p[g];
559
+ typeof S == "object" && La(S) && (p[g] = {
560
+ r: S.r,
561
+ g: S.g,
562
+ b: S.b,
563
+ a: S.a
564
564
  });
565
565
  }
566
566
  this.app.send({
@@ -1237,14 +1237,14 @@ function Ga() {
1237
1237
  ps = 1;
1238
1238
  var s = hn, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, n = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, r = { key: !0, ref: !0, __self: !0, __source: !0 };
1239
1239
  function a(o, c, l) {
1240
- var d, p = {}, m = null, _ = null;
1241
- l !== void 0 && (m = "" + l), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (_ = c.ref);
1240
+ var d, p = {}, m = null, g = null;
1241
+ l !== void 0 && (m = "" + l), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (g = c.ref);
1242
1242
  for (d in c)
1243
1243
  i.call(c, d) && !r.hasOwnProperty(d) && (p[d] = c[d]);
1244
1244
  if (o && o.defaultProps)
1245
1245
  for (d in c = o.defaultProps, c)
1246
1246
  p[d] === void 0 && (p[d] = c[d]);
1247
- return { $$typeof: e, type: o, key: m, ref: _, props: p, _owner: n.current };
1247
+ return { $$typeof: e, type: o, key: m, ref: g, props: p, _owner: n.current };
1248
1248
  }
1249
1249
  return Ct.Fragment = t, Ct.jsx = a, Ct.jsxs = a, Ct;
1250
1250
  }
@@ -1261,11 +1261,11 @@ var St = {};
1261
1261
  var ms;
1262
1262
  function Xa() {
1263
1263
  return ms || (ms = 1, process.env.NODE_ENV !== "production" && function() {
1264
- var s = hn, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), o = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), E = Symbol.iterator, O = "@@iterator";
1265
- function T(h) {
1264
+ var s = hn, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), o = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), S = Symbol.iterator, T = "@@iterator";
1265
+ function M(h) {
1266
1266
  if (h === null || typeof h != "object")
1267
1267
  return null;
1268
- var y = E && h[E] || h[O];
1268
+ var y = S && h[S] || h[T];
1269
1269
  return typeof y == "function" ? y : null;
1270
1270
  }
1271
1271
  var f = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
@@ -1273,23 +1273,23 @@ function Xa() {
1273
1273
  {
1274
1274
  for (var y = arguments.length, x = new Array(y > 1 ? y - 1 : 0), L = 1; L < y; L++)
1275
1275
  x[L - 1] = arguments[L];
1276
- C("error", h, x);
1276
+ E("error", h, x);
1277
1277
  }
1278
1278
  }
1279
- function C(h, y, x) {
1279
+ function E(h, y, x) {
1280
1280
  {
1281
1281
  var L = f.ReactDebugCurrentFrame, z = L.getStackAddendum();
1282
1282
  z !== "" && (y += "%s", x = x.concat([z]));
1283
- var V = x.map(function(N) {
1283
+ var Z = x.map(function(N) {
1284
1284
  return String(N);
1285
1285
  });
1286
- V.unshift("Warning: " + y), Function.prototype.apply.call(console[h], console, V);
1286
+ Z.unshift("Warning: " + y), Function.prototype.apply.call(console[h], console, Z);
1287
1287
  }
1288
1288
  }
1289
- var b = !1, S = !1, w = !1, I = !1, U = !1, K;
1289
+ var b = !1, C = !1, w = !1, I = !1, U = !1, K;
1290
1290
  K = Symbol.for("react.module.reference");
1291
1291
  function me(h) {
1292
- return !!(typeof h == "string" || typeof h == "function" || h === i || h === r || U || h === n || h === l || h === d || I || h === _ || b || S || w || typeof h == "object" && h !== null && (h.$$typeof === m || h.$$typeof === p || h.$$typeof === a || h.$$typeof === o || h.$$typeof === c || // This needs to include all possible module reference object
1292
+ return !!(typeof h == "string" || typeof h == "function" || h === i || h === r || U || h === n || h === l || h === d || I || h === g || b || C || w || typeof h == "object" && h !== null && (h.$$typeof === m || h.$$typeof === p || h.$$typeof === a || h.$$typeof === o || h.$$typeof === c || // This needs to include all possible module reference object
1293
1293
  // types supported by any Flight configuration anywhere since
1294
1294
  // we don't know which Flight build this will end up being used
1295
1295
  // with.
@@ -1340,9 +1340,9 @@ function Xa() {
1340
1340
  var L = h.displayName || null;
1341
1341
  return L !== null ? L : le(h.type) || "Memo";
1342
1342
  case m: {
1343
- var z = h, V = z._payload, N = z._init;
1343
+ var z = h, Z = z._payload, N = z._init;
1344
1344
  try {
1345
- return le(N(V));
1345
+ return le(N(Z));
1346
1346
  } catch {
1347
1347
  return null;
1348
1348
  }
@@ -1350,18 +1350,18 @@ function Xa() {
1350
1350
  }
1351
1351
  return null;
1352
1352
  }
1353
- var Q = Object.assign, W = 0, Ue, ce, be, te, je, Ne, Fe;
1354
- function B() {
1353
+ var Q = Object.assign, G = 0, Ue, ce, be, te, je, Ne, Fe;
1354
+ function V() {
1355
1355
  }
1356
- B.__reactDisabledLog = !0;
1356
+ V.__reactDisabledLog = !0;
1357
1357
  function re() {
1358
1358
  {
1359
- if (W === 0) {
1359
+ if (G === 0) {
1360
1360
  Ue = console.log, ce = console.info, be = console.warn, te = console.error, je = console.group, Ne = console.groupCollapsed, Fe = console.groupEnd;
1361
1361
  var h = {
1362
1362
  configurable: !0,
1363
1363
  enumerable: !0,
1364
- value: B,
1364
+ value: V,
1365
1365
  writable: !0
1366
1366
  };
1367
1367
  Object.defineProperties(console, {
@@ -1374,12 +1374,12 @@ function Xa() {
1374
1374
  groupEnd: h
1375
1375
  });
1376
1376
  }
1377
- W++;
1377
+ G++;
1378
1378
  }
1379
1379
  }
1380
1380
  function Oe() {
1381
1381
  {
1382
- if (W--, W === 0) {
1382
+ if (G--, G === 0) {
1383
1383
  var h = {
1384
1384
  configurable: !0,
1385
1385
  enumerable: !0,
@@ -1409,7 +1409,7 @@ function Xa() {
1409
1409
  })
1410
1410
  });
1411
1411
  }
1412
- W < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1412
+ G < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1413
1413
  }
1414
1414
  }
1415
1415
  var vt = f.ReactCurrentDispatcher, it;
@@ -1443,8 +1443,8 @@ function Xa() {
1443
1443
  ci = !0;
1444
1444
  var z = Error.prepareStackTrace;
1445
1445
  Error.prepareStackTrace = void 0;
1446
- var V;
1447
- V = vt.current, vt.current = null, re();
1446
+ var Z;
1447
+ Z = vt.current, vt.current = null, re();
1448
1448
  try {
1449
1449
  if (y) {
1450
1450
  var N = function() {
@@ -1497,7 +1497,7 @@ function Xa() {
1497
1497
  }
1498
1498
  }
1499
1499
  } finally {
1500
- ci = !1, vt.current = V, Oe(), Error.prepareStackTrace = z;
1500
+ ci = !1, vt.current = Z, Oe(), Error.prepareStackTrace = z;
1501
1501
  }
1502
1502
  var nt = h ? h.displayName || h.name : "", ts = nt ? Nt(nt) : "";
1503
1503
  return typeof h == "function" && Ft.set(h, ts), ts;
@@ -1529,9 +1529,9 @@ function Xa() {
1529
1529
  case p:
1530
1530
  return zt(h.type, y, x);
1531
1531
  case m: {
1532
- var L = h, z = L._payload, V = L._init;
1532
+ var L = h, z = L._payload, Z = L._init;
1533
1533
  try {
1534
- return zt(V(z), y, x);
1534
+ return zt(Z(z), y, x);
1535
1535
  } catch {
1536
1536
  }
1537
1537
  }
@@ -1548,9 +1548,9 @@ function Xa() {
1548
1548
  }
1549
1549
  function Sn(h, y, x, L, z) {
1550
1550
  {
1551
- var V = Function.call.bind(Ht);
1551
+ var Z = Function.call.bind(Ht);
1552
1552
  for (var N in h)
1553
- if (V(h, N)) {
1553
+ if (Z(h, N)) {
1554
1554
  var j = void 0;
1555
1555
  try {
1556
1556
  if (typeof h[N] != "function") {
@@ -1640,7 +1640,7 @@ function Xa() {
1640
1640
  });
1641
1641
  }
1642
1642
  }
1643
- var In = function(h, y, x, L, z, V, N) {
1643
+ var In = function(h, y, x, L, z, Z, N) {
1644
1644
  var j = {
1645
1645
  // This tag allows us to uniquely identify this as a React Element
1646
1646
  $$typeof: e,
@@ -1650,7 +1650,7 @@ function Xa() {
1650
1650
  ref: x,
1651
1651
  props: N,
1652
1652
  // Record the component responsible for creating this element.
1653
- _owner: V
1653
+ _owner: Z
1654
1654
  };
1655
1655
  return j._store = {}, Object.defineProperty(j._store, "validated", {
1656
1656
  configurable: !1,
@@ -1671,14 +1671,14 @@ function Xa() {
1671
1671
  };
1672
1672
  function Ln(h, y, x, L, z) {
1673
1673
  {
1674
- var V, N = {}, j = null, fe = null;
1674
+ var Z, N = {}, j = null, fe = null;
1675
1675
  x !== void 0 && (Wi(x), j = "" + x), An(y) && (Wi(y.key), j = "" + y.key), Mn(y) && (fe = y.ref, Pn(y, z));
1676
- for (V in y)
1677
- Ht.call(y, V) && !Tn.hasOwnProperty(V) && (N[V] = y[V]);
1676
+ for (Z in y)
1677
+ Ht.call(y, Z) && !Tn.hasOwnProperty(Z) && (N[Z] = y[Z]);
1678
1678
  if (h && h.defaultProps) {
1679
1679
  var J = h.defaultProps;
1680
- for (V in J)
1681
- N[V] === void 0 && (N[V] = J[V]);
1680
+ for (Z in J)
1681
+ N[Z] === void 0 && (N[Z] = J[Z]);
1682
1682
  }
1683
1683
  if (j || fe) {
1684
1684
  var ie = typeof h == "function" ? h.displayName || h.name || "Unknown" : h;
@@ -1761,9 +1761,9 @@ Check the top-level render call using <` + x + ">.");
1761
1761
  else if (mi(h))
1762
1762
  h._store && (h._store.validated = !0);
1763
1763
  else if (h) {
1764
- var z = T(h);
1764
+ var z = M(h);
1765
1765
  if (typeof z == "function" && z !== h.entries)
1766
- for (var V = z.call(h), N; !(N = V.next()).done; )
1766
+ for (var Z = z.call(h), N; !(N = Z.next()).done; )
1767
1767
  mi(N.value) && Qi(N.value, y);
1768
1768
  }
1769
1769
  }
@@ -1805,7 +1805,7 @@ Check the top-level render call using <` + x + ">.");
1805
1805
  h.ref !== null && (st(h), v("Invalid attribute `ref` supplied to `React.Fragment`."), st(null));
1806
1806
  }
1807
1807
  }
1808
- function es(h, y, x, L, z, V) {
1808
+ function es(h, y, x, L, z, Z) {
1809
1809
  {
1810
1810
  var N = me(h);
1811
1811
  if (!N) {
@@ -1816,7 +1816,7 @@ Check the top-level render call using <` + x + ">.");
1816
1816
  var J;
1817
1817
  h === null ? J = "null" : hi(h) ? J = "array" : h !== void 0 && h.$$typeof === e ? (J = "<" + (le(h.type) || "Unknown") + " />", j = " Did you accidentally export a JSX literal instead of a component?") : J = typeof h, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", J, j);
1818
1818
  }
1819
- var ie = Ln(h, y, x, z, V);
1819
+ var ie = Ln(h, y, x, z, Z);
1820
1820
  if (ie == null)
1821
1821
  return ie;
1822
1822
  if (N) {
@@ -1872,7 +1872,7 @@ function Ka(s) {
1872
1872
  ] }) }, s.title);
1873
1873
  }
1874
1874
  function Qa(s) {
1875
- const [e, t] = X(!1), [i, n] = X(s.options), r = (l) => {
1875
+ const [e, t] = B(!1), [i, n] = B(s.options), r = (l) => {
1876
1876
  s.onDragComplete(l), n(l);
1877
1877
  }, a = (l) => {
1878
1878
  const d = [...i];
@@ -1888,7 +1888,7 @@ function Qa(s) {
1888
1888
  ] });
1889
1889
  }
1890
1890
  function Ja(s) {
1891
- const [e, t] = X(!1), i = [];
1891
+ const [e, t] = B(!1), i = [];
1892
1892
  s.options.map((r, a) => {
1893
1893
  s.onSelect !== void 0 && (r.onSelect = s.onSelect), i.push(/* @__PURE__ */ u.jsx(er, { option: r }, a));
1894
1894
  });
@@ -1913,7 +1913,7 @@ function Ja(s) {
1913
1913
  );
1914
1914
  }
1915
1915
  function er(s) {
1916
- const { option: e } = s, [t, i] = X("");
1916
+ const { option: e } = s, [t, i] = B("");
1917
1917
  let n;
1918
1918
  switch (e.type) {
1919
1919
  case "draggable":
@@ -1978,7 +1978,7 @@ function Oo(s, e, t) {
1978
1978
  };
1979
1979
  }
1980
1980
  function ni(s) {
1981
- const [e, t] = X(s.open !== void 0 ? s.open : !0), i = !e || s.children === void 0, n = () => {
1981
+ const [e, t] = B(s.open !== void 0 ? s.open : !0), i = !e || s.children === void 0, n = () => {
1982
1982
  D.dispatchEvent({ type: P.REMOVE_SCENE, value: s.scene });
1983
1983
  };
1984
1984
  return /* @__PURE__ */ u.jsxs("div", { className: `accordion ${i ? "hide" : ""}`, children: [
@@ -2011,7 +2011,7 @@ function ni(s) {
2011
2011
  ] });
2012
2012
  }
2013
2013
  function gn(s) {
2014
- const e = ne(null), [t, i] = X(!1), n = s.child !== void 0 && s.child.children.length > 0, r = [];
2014
+ const e = ne(null), [t, i] = B(!1), n = s.child !== void 0 && s.child.children.length > 0, r = [];
2015
2015
  return s.child !== void 0 && s.child.children.length > 0 && s.child.children.map((a, o) => {
2016
2016
  r.push(/* @__PURE__ */ u.jsx(gn, { child: a, three: s.three }, o));
2017
2017
  }), tt(() => {
@@ -2080,46 +2080,43 @@ function fs(s) {
2080
2080
  }), /* @__PURE__ */ u.jsx("div", { className: `scene ${s.class !== void 0 ? s.class : ""}`, children: e });
2081
2081
  }
2082
2082
  function tr(s) {
2083
- const [e, t] = X(s.defaultValue);
2083
+ const [e, t] = B(s.defaultValue);
2084
2084
  return tt(() => {
2085
2085
  let i = !1, n = -1, r = 0, a = s.defaultValue, o = !1;
2086
- const c = (E) => {
2087
- o = E.ctrlKey;
2088
- }, l = (E) => {
2089
- i = !0, r = Number(s.input.current?.value), n = E.clientX, document.addEventListener("mouseup", p, !1), document.addEventListener("mousemove", d, !1), document.addEventListener("contextmenu", p, !1);
2090
- }, d = (E) => {
2086
+ const c = (g) => {
2087
+ o = g.ctrlKey;
2088
+ }, l = (g) => {
2089
+ i = !0, r = Number(s.input.current?.value), n = g.clientX, document.addEventListener("mouseup", p, !1), document.addEventListener("mousemove", d, !1), document.addEventListener("contextmenu", p, !1);
2090
+ }, d = (g) => {
2091
2091
  if (!i)
2092
2092
  return;
2093
- const O = s.step !== void 0 ? s.step : 1, T = (E.clientX - n) * O * (o ? 10 : 1);
2093
+ const S = s.step !== void 0 ? s.step : 1, T = (g.clientX - n) * S * (o ? 10 : 1);
2094
2094
  a = Number((r + T).toFixed(4)), s.min !== void 0 && (a = Math.max(a, s.min)), s.max !== void 0 && (a = Math.min(a, s.max)), s.onChange !== void 0 && s.onChange(a), t(a);
2095
2095
  }, p = () => {
2096
2096
  i = !1, document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", p);
2097
- }, m = (E) => {
2098
- const O = Number(E.target.value);
2099
- t(O);
2100
- }, _ = (E) => {
2101
- const O = Number(E.target.value);
2102
- s.onChange !== void 0 && s.onChange(O), t(O);
2097
+ }, m = (g) => {
2098
+ const S = Number(g.target.value);
2099
+ s.onChange !== void 0 && s.onChange(S), t(S);
2103
2100
  };
2104
- return s.input.current?.addEventListener("input", m), s.label.current?.addEventListener("mousedown", l, !1), s.sliderRef !== void 0 && s.sliderRef.current?.addEventListener("input", _), document.addEventListener("keydown", c, !1), document.addEventListener("keyup", c, !1), () => {
2105
- s.input.current?.removeEventListener("input", m), s.label.current?.removeEventListener("mousedown", l), s.sliderRef !== void 0 && s.sliderRef.current?.removeEventListener("input", _), document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", p), document.removeEventListener("keydown", c), document.addEventListener("keyup", c, !1);
2101
+ return s.label.current?.addEventListener("mousedown", l, !1), s.sliderRef !== void 0 && s.sliderRef.current?.addEventListener("input", m), document.addEventListener("keydown", c, !1), document.addEventListener("keyup", c, !1), () => {
2102
+ s.label.current?.removeEventListener("mousedown", l), s.sliderRef !== void 0 && s.sliderRef.current?.removeEventListener("input", m), document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", p), document.removeEventListener("keydown", c), document.addEventListener("keyup", c, !1);
2106
2103
  };
2107
2104
  }, []), e;
2108
2105
  }
2109
2106
  function Qe(s) {
2110
- const e = ne(null), t = ne(null), i = tr({
2107
+ const e = ne(null), t = ne(null), [i, n] = B(s.value);
2108
+ return tr({
2111
2109
  label: s.labelRef,
2112
2110
  input: e,
2113
2111
  sliderRef: t,
2114
- defaultValue: s.value,
2112
+ defaultValue: i,
2115
2113
  min: s.min,
2116
2114
  max: s.max,
2117
2115
  step: s.step,
2118
- onChange: (n) => {
2119
- s.onChange !== void 0 && s.onChange(s.prop, n);
2116
+ onChange: (r) => {
2117
+ n(r), s.onChange !== void 0 && s.onChange(s.prop, r);
2120
2118
  }
2121
- });
2122
- return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2119
+ }), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2123
2120
  s.type === "number" && /* @__PURE__ */ u.jsx(
2124
2121
  "input",
2125
2122
  {
@@ -2132,9 +2129,11 @@ function Qe(s) {
2132
2129
  max: s.max,
2133
2130
  step: s.step,
2134
2131
  disabled: s.disabled,
2135
- onChange: (n) => {
2136
- const r = Number(n.target.value);
2137
- s.onChange !== void 0 && s.onChange(s.prop, r);
2132
+ onChange: (r) => {
2133
+ if (n(r.target.value), r.target.value.length === 0)
2134
+ return;
2135
+ const a = Number(r.target.value);
2136
+ isNaN(a) || s.onChange !== void 0 && s.onChange(s.prop, a);
2138
2137
  }
2139
2138
  }
2140
2139
  ),
@@ -2143,13 +2142,15 @@ function Qe(s) {
2143
2142
  "input",
2144
2143
  {
2145
2144
  type: "text",
2146
- value: i.toString(),
2145
+ value: s.value.toString(),
2147
2146
  disabled: s.disabled,
2148
2147
  ref: e,
2149
2148
  className: "min",
2150
- onChange: (n) => {
2151
- const r = Number(n.target.value);
2152
- s.onChange !== void 0 && s.onChange(s.prop, r);
2149
+ onChange: (r) => {
2150
+ if (r.target.value.length === 0)
2151
+ return;
2152
+ const a = Number(r.target.value);
2153
+ isNaN(a) || s.onChange !== void 0 && s.onChange(s.prop, a);
2153
2154
  }
2154
2155
  }
2155
2156
  ),
@@ -2158,7 +2159,7 @@ function Qe(s) {
2158
2159
  {
2159
2160
  disabled: s.disabled,
2160
2161
  type: "range",
2161
- value: i,
2162
+ value: s.value,
2162
2163
  min: s.min,
2163
2164
  max: s.max,
2164
2165
  step: s.step,
@@ -2170,23 +2171,23 @@ function Qe(s) {
2170
2171
  ] });
2171
2172
  }
2172
2173
  function ir(s) {
2173
- const e = ne(null), t = ne(null), i = ne(null), n = ne(null), r = ne(null), a = ne(null), [o, c] = X(s.value), [l, d] = X({
2174
+ const e = ne(null), t = ne(null), i = ne(null), n = ne(null), r = ne(null), a = ne(null), [o, c] = B(s.value), [l, d] = B({
2174
2175
  min: Math.min(s.min, Math.min(s.value.x, s.value.y)),
2175
2176
  max: Math.max(s.max, Math.max(s.value.x, s.value.y))
2176
- }), [p, m] = X(!1);
2177
- function _() {
2178
- p || (window.addEventListener("mousemove", O), window.addEventListener("mouseup", E), window.addEventListener("mouseup", E), m(!0));
2177
+ }), [p, m] = B(!1);
2178
+ function g() {
2179
+ p || (window.addEventListener("mousemove", T), window.addEventListener("mouseup", S), window.addEventListener("mouseup", S), m(!0));
2179
2180
  }
2180
- function E() {
2181
- window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", E), m(!1);
2181
+ function S() {
2182
+ window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", S), m(!1);
2182
2183
  }
2183
- function O(b) {
2184
- const S = r.current.getBoundingClientRect(), w = $e(0, 99, b.clientX - S.left) / 99, I = $e(0, 99, b.clientY - S.top) / 99, U = Me(Ii(l.min, l.max, w), 3), K = Me(Ii(l.min, l.max, I), 3);
2184
+ function T(b) {
2185
+ const C = r.current.getBoundingClientRect(), w = $e(0, 99, b.clientX - C.left) / 99, I = $e(0, 99, b.clientY - C.top) / 99, U = Me(Ii(l.min, l.max, w), 3), K = Me(Ii(l.min, l.max, I), 3);
2185
2186
  s.onChange({ target: { value: { x: U, y: K } } }), c({ x: U, y: K });
2186
2187
  }
2187
- function T(b) {
2188
- let S = o.x, w = o.y;
2189
- b.target === e.current ? S = Number(b.target.value) : w = Number(b.target.value), c({ x: S, y: w });
2188
+ function M(b) {
2189
+ let C = o.x, w = o.y;
2190
+ b.target === e.current ? C = Number(b.target.value) : w = Number(b.target.value), c({ x: C, y: w });
2190
2191
  }
2191
2192
  function f() {
2192
2193
  const b = Number(i.current.value);
@@ -2197,10 +2198,10 @@ function ir(s) {
2197
2198
  d({ min: l.min, max: b }), (o.x > b || o.y > b) && c({ x: $e(l.min, b, o.x), y: $e(l.min, b, o.y) });
2198
2199
  }
2199
2200
  tt(() => {
2200
- const b = us(l.min, l.max, o.x), S = us(l.min, l.max, o.y);
2201
- a.current.style.left = `${b * 100}%`, a.current.style.top = `${S * 100}%`;
2201
+ const b = us(l.min, l.max, o.x), C = us(l.min, l.max, o.y);
2202
+ a.current.style.left = `${b * 100}%`, a.current.style.top = `${C * 100}%`;
2202
2203
  }, [l, o]);
2203
- const C = s.step !== void 0 ? s.step : 0.01;
2204
+ const E = s.step !== void 0 ? s.step : 0.01;
2204
2205
  return /* @__PURE__ */ u.jsxs("div", { className: "vector2", children: [
2205
2206
  /* @__PURE__ */ u.jsxs("div", { className: "fields", children: [
2206
2207
  /* @__PURE__ */ u.jsxs("div", { children: [
@@ -2213,8 +2214,8 @@ function ir(s) {
2213
2214
  value: o.x,
2214
2215
  min: l.min,
2215
2216
  max: l.max,
2216
- step: C,
2217
- onChange: T
2217
+ step: E,
2218
+ onChange: M
2218
2219
  }
2219
2220
  )
2220
2221
  ] }),
@@ -2228,8 +2229,8 @@ function ir(s) {
2228
2229
  value: o.y,
2229
2230
  min: l.min,
2230
2231
  max: l.max,
2231
- step: C,
2232
- onChange: T
2232
+ step: E,
2233
+ onChange: M
2233
2234
  }
2234
2235
  )
2235
2236
  ] }),
@@ -2241,7 +2242,7 @@ function ir(s) {
2241
2242
  ref: i,
2242
2243
  type: "number",
2243
2244
  value: l.min,
2244
- step: C,
2245
+ step: E,
2245
2246
  onChange: f
2246
2247
  }
2247
2248
  )
@@ -2254,13 +2255,13 @@ function ir(s) {
2254
2255
  ref: n,
2255
2256
  type: "number",
2256
2257
  value: l.max,
2257
- step: C,
2258
+ step: E,
2258
2259
  onChange: v
2259
2260
  }
2260
2261
  )
2261
2262
  ] })
2262
2263
  ] }),
2263
- /* @__PURE__ */ u.jsxs("div", { className: "input", ref: r, onMouseDown: _, onMouseUp: E, children: [
2264
+ /* @__PURE__ */ u.jsxs("div", { className: "input", ref: r, onMouseDown: g, onMouseUp: S, children: [
2264
2265
  /* @__PURE__ */ u.jsx("div", { className: "x" }),
2265
2266
  /* @__PURE__ */ u.jsx("div", { className: "y" }),
2266
2267
  /* @__PURE__ */ u.jsx("div", { className: "pt", ref: a })
@@ -2995,8 +2996,8 @@ function Rt(s, e, t, i, n = "", r = !1) {
2995
2996
  i.updateObject(t.uuid, `material.${o}`, p);
2996
2997
  const m = i.getScene(t.uuid);
2997
2998
  if (m !== null) {
2998
- const _ = m.getObjectByProperty("uuid", t.uuid);
2999
- ee(_, `material.${o}`, p);
2999
+ const g = m.getObjectByProperty("uuid", t.uuid);
3000
+ ee(g, `material.${o}`, p);
3000
3001
  }
3001
3002
  }
3002
3003
  };
@@ -3014,8 +3015,8 @@ function Rt(s, e, t, i, n = "", r = !1) {
3014
3015
  i.updateObject(t.uuid, `material.${o}`, p);
3015
3016
  const m = i.getScene(t.uuid);
3016
3017
  if (m !== null) {
3017
- const _ = m.getObjectByProperty("uuid", t.uuid);
3018
- ee(_, `material.${o}`, p);
3018
+ const g = m.getObjectByProperty("uuid", t.uuid);
3019
+ ee(g, `material.${o}`, p);
3019
3020
  }
3020
3021
  }
3021
3022
  };
@@ -3024,11 +3025,11 @@ function Rt(s, e, t, i, n = "", r = !1) {
3024
3025
  for (const d in e) {
3025
3026
  const p = e[d], m = `[${d.toString()}]`;
3026
3027
  if (p.value !== void 0) {
3027
- const _ = Rt(`${m}.value`, p.value, t, i, o, r);
3028
- _ !== void 0 && l.push(_);
3028
+ const g = Rt(`${m}.value`, p.value, t, i, o, r);
3029
+ g !== void 0 && l.push(g);
3029
3030
  } else {
3030
- const _ = Rt(m, p, t, i, o, r);
3031
- _ !== void 0 && l.push(_);
3031
+ const g = Rt(m, p, t, i, o, r);
3032
+ g !== void 0 && l.push(g);
3032
3033
  }
3033
3034
  }
3034
3035
  if (l.length > 0)
@@ -3110,34 +3111,34 @@ function Rt(s, e, t, i, n = "", r = !1) {
3110
3111
  onChange: (l, d) => {
3111
3112
  const p = lr(s), m = n.length > 0 ? `${n}.${p}` : p;
3112
3113
  i.createTexture(t.uuid, `material.${m}`, d);
3113
- const _ = i.getScene(t.uuid);
3114
- if (_ !== null) {
3115
- const E = _.getObjectByProperty("uuid", t.uuid);
3116
- if (E !== void 0) {
3117
- const O = (T) => {
3118
- const f = E.material, v = m.split(".");
3114
+ const g = i.getScene(t.uuid);
3115
+ if (g !== null) {
3116
+ const S = g.getObjectByProperty("uuid", t.uuid);
3117
+ if (S !== void 0) {
3118
+ const T = (M) => {
3119
+ const f = S.material, v = m.split(".");
3119
3120
  switch (v.length) {
3120
3121
  case 1:
3121
- f[v[0]] = T;
3122
+ f[v[0]] = M;
3122
3123
  break;
3123
3124
  case 2:
3124
- f[v[0]][v[1]] = T;
3125
+ f[v[0]][v[1]] = M;
3125
3126
  break;
3126
3127
  case 3:
3127
- f[v[0]][v[1]][v[2]] = T;
3128
+ f[v[0]][v[1]][v[2]] = M;
3128
3129
  break;
3129
3130
  case 4:
3130
- f[v[0]][v[1]][v[2]][v[3]] = T;
3131
+ f[v[0]][v[1]][v[2]][v[3]] = M;
3131
3132
  break;
3132
3133
  case 5:
3133
- f[v[0]][v[1]][v[2]][v[3]][v[4]] = T;
3134
+ f[v[0]][v[1]][v[2]][v[3]][v[4]] = M;
3134
3135
  break;
3135
3136
  }
3136
3137
  f.needsUpdate = !0;
3137
3138
  };
3138
- d.src.length > 0 ? mn(d.src).then((T) => {
3139
- T.offset.set(d.offset[0], d.offset[1]), T.repeat.set(d.repeat[0], d.repeat[1]), O(T);
3140
- }) : O(null);
3139
+ d.src.length > 0 ? mn(d.src).then((M) => {
3140
+ M.offset.set(d.offset[0], d.offset[1]), M.repeat.set(d.repeat[0], d.repeat[1]), T(M);
3141
+ }) : T(null);
3141
3142
  }
3142
3143
  }
3143
3144
  }
@@ -3165,11 +3166,11 @@ function Rt(s, e, t, i, n = "", r = !1) {
3165
3166
  const m = e[p];
3166
3167
  if (m !== void 0)
3167
3168
  if (m.value !== void 0) {
3168
- const _ = Rt(`${p}.value`, m.value, t, i, o, d);
3169
- _ !== void 0 && l.push(_);
3169
+ const g = Rt(`${p}.value`, m.value, t, i, o, d);
3170
+ g !== void 0 && l.push(g);
3170
3171
  } else {
3171
- const _ = Rt(p, m, t, i, o, d);
3172
- _ !== void 0 && l.push(_);
3172
+ const g = Rt(p, m, t, i, o, d);
3173
+ g !== void 0 && l.push(g);
3173
3174
  }
3174
3175
  }
3175
3176
  } catch {
@@ -3253,38 +3254,38 @@ function Er(s, e) {
3253
3254
  }
3254
3255
  const vs = "data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDIgNzkuZGJhM2RhM2I1LCAyMDIzLzEyLzE1LTEwOjQyOjM3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMDk3M0NEODAxQjQxMUVGODVGNENDMkUyMUExNDk1NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDk3M0NEOTAxQjQxMUVGODVGNENDMkUyMUExNDk1NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE4ODc3Qzg5MDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkE4ODc3QzhBMDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAA4BZAAAAv+Mj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqTkJAGDQ+dnpuekmGgAKejpKuiZqmprKqoZKGyrbOlqrejub6xvLGyw8TFzcprurGuvqybxq7ETbrItsCz0l7Zpc+6p9/cS967w9/S2FTF0u/mzehK4Oqz3eTl9vf4+fr7/P3+//DzCgwIEECxo8iDChwoUMGzp8CDGixIkUK1q8iDGjxo0XHDt6/AgypMiRJEuaPIkypcqVLFt+KwAAOw==";
3255
3256
  function Cr(s) {
3256
- const e = s.step !== void 0 ? s.step : 0.01, t = ne(null), i = ne(null), n = ne(null), r = ne(null), a = ne(null), [o] = X(s.value), [c, l] = X(s.value.offset[0]), [d, p] = X(s.value.offset[1]), [m, _] = X(s.value.repeat[0]), [E, O] = X(s.value.repeat[1]);
3257
- function T(v, C, b, S, w) {
3257
+ const e = s.step !== void 0 ? s.step : 0.01, t = ne(null), i = ne(null), n = ne(null), r = ne(null), a = ne(null), [o] = B(s.value), [c, l] = B(s.value.offset[0]), [d, p] = B(s.value.offset[1]), [m, g] = B(s.value.repeat[0]), [S, T] = B(s.value.repeat[1]);
3258
+ function M(v, E, b, C, w) {
3258
3259
  if (s.onChange !== void 0) {
3259
3260
  const I = s.prop !== void 0 ? s.prop : s.title;
3260
3261
  s.onChange(I, {
3261
3262
  src: v,
3262
- offset: [C, b],
3263
- repeat: [S, w]
3263
+ offset: [E, b],
3264
+ repeat: [C, w]
3264
3265
  });
3265
3266
  }
3266
3267
  }
3267
3268
  function f(v) {
3268
- const C = t.current.src, b = v.target.value;
3269
+ const E = t.current.src, b = v.target.value;
3269
3270
  switch (v.target) {
3270
3271
  case i.current:
3271
- l(b), T(C, b, d, m, E);
3272
+ l(b), M(E, b, d, m, S);
3272
3273
  break;
3273
3274
  case n.current:
3274
- p(b), T(C, c, b, m, E);
3275
+ p(b), M(E, c, b, m, S);
3275
3276
  break;
3276
3277
  case r.current:
3277
- _(b), T(C, c, d, b, E);
3278
+ g(b), M(E, c, d, b, S);
3278
3279
  break;
3279
3280
  case a.current:
3280
- O(b), T(C, c, d, m, b);
3281
+ T(b), M(E, c, d, m, b);
3281
3282
  break;
3282
3283
  }
3283
3284
  }
3284
3285
  return /* @__PURE__ */ u.jsxs("div", { className: "imageField", children: [
3285
3286
  /* @__PURE__ */ u.jsx("img", { alt: s.title, ref: t, onClick: () => {
3286
3287
  cr().then((v) => {
3287
- t.current.src = v, T(v, c, d, m, E);
3288
+ t.current.src = v, M(v, c, d, m, S);
3288
3289
  });
3289
3290
  }, src: o.src.length > 0 ? o.src : vs }),
3290
3291
  /* @__PURE__ */ u.jsxs("div", { className: "fields", children: [
@@ -3328,14 +3329,14 @@ function Cr(s) {
3328
3329
  {
3329
3330
  ref: a,
3330
3331
  type: "number",
3331
- value: E,
3332
+ value: S,
3332
3333
  step: e,
3333
3334
  onChange: f
3334
3335
  }
3335
3336
  )
3336
3337
  ] }),
3337
3338
  /* @__PURE__ */ u.jsx("button", { onClick: () => {
3338
- T("", c, d, m, E), t.current.src = vs;
3339
+ M("", c, d, m, S), t.current.src = vs;
3339
3340
  }, children: "Clear" })
3340
3341
  ] })
3341
3342
  ] });
@@ -3343,7 +3344,7 @@ function Cr(s) {
3343
3344
  function ei(s) {
3344
3345
  let e = s.value;
3345
3346
  e !== void 0 && (e.isColor !== void 0 ? e = os(s.value) : s.type === "color" && (e = os(new et().setStyle(s.value, Ut))));
3346
- const [t, i] = X(e), n = ne(null), r = (l) => {
3347
+ const [t, i] = B(e), n = ne(null), r = (l) => {
3347
3348
  let d = l.target.value;
3348
3349
  if (s.type === "boolean")
3349
3350
  d = l.target.checked;
@@ -3719,7 +3720,7 @@ class xr extends Ie {
3719
3720
  const r = new Fi({ fog: !1 });
3720
3721
  super(n, r), this.light = e, this.color = t, this.type = "RectAreaLightHelper";
3721
3722
  const a = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new gt();
3722
- o.setAttribute("position", new Ke(a, 3)), o.computeBoundingSphere(), this.add(new M(o, new Je({ side: Bs, fog: !1 })));
3723
+ o.setAttribute("position", new Ke(a, 3)), o.computeBoundingSphere(), this.add(new O(o, new Je({ side: Bs, fog: !1 })));
3723
3724
  }
3724
3725
  updateMatrixWorld() {
3725
3726
  if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
@@ -4180,7 +4181,7 @@ const q = {
4180
4181
  LEFT: 1,
4181
4182
  RIGHT: 2,
4182
4183
  MIDDLE: 4
4183
- }, g = Object.freeze({
4184
+ }, _ = Object.freeze({
4184
4185
  NONE: 0,
4185
4186
  ROTATE: 1,
4186
4187
  TRUCK: 2,
@@ -4213,11 +4214,11 @@ const ct = Math.PI * 2, Cs = Math.PI / 2, yn = 1e-5, xt = Math.PI / 180;
4213
4214
  function Te(s, e, t) {
4214
4215
  return Math.max(e, Math.min(t, s));
4215
4216
  }
4216
- function G(s, e = yn) {
4217
+ function X(s, e = yn) {
4217
4218
  return Math.abs(s) < e;
4218
4219
  }
4219
4220
  function H(s, e, t = yn) {
4220
- return G(s - e, t);
4221
+ return X(s - e, t);
4221
4222
  }
4222
4223
  function Ss(s, e) {
4223
4224
  return Math.round(s / e) * e;
@@ -4236,23 +4237,23 @@ function Zt(s, e, t, i, n = 1 / 0, r) {
4236
4237
  l = Te(l, -p, p), e = s - l;
4237
4238
  const m = (t.value + a * l) * r;
4238
4239
  t.value = (t.value - a * m) * c;
4239
- let _ = e + (l + m) * c;
4240
- return d - s > 0 == _ > d && (_ = d, t.value = (_ - d) / r), _;
4240
+ let g = e + (l + m) * c;
4241
+ return d - s > 0 == g > d && (g = d, t.value = (g - d) / r), g;
4241
4242
  }
4242
4243
  function ws(s, e, t, i, n = 1 / 0, r, a) {
4243
4244
  i = Math.max(1e-4, i);
4244
4245
  const o = 2 / i, c = o * r, l = 1 / (1 + c + 0.48 * c * c + 0.235 * c * c * c);
4245
- let d = e.x, p = e.y, m = e.z, _ = s.x - d, E = s.y - p, O = s.z - m;
4246
- const T = d, f = p, v = m, C = n * i, b = C * C, S = _ * _ + E * E + O * O;
4247
- if (S > b) {
4248
- const W = Math.sqrt(S);
4249
- _ = _ / W * C, E = E / W * C, O = O / W * C;
4250
- }
4251
- d = s.x - _, p = s.y - E, m = s.z - O;
4252
- const w = (t.x + o * _) * r, I = (t.y + o * E) * r, U = (t.z + o * O) * r;
4253
- t.x = (t.x - o * w) * l, t.y = (t.y - o * I) * l, t.z = (t.z - o * U) * l, a.x = d + (_ + w) * l, a.y = p + (E + I) * l, a.z = m + (O + U) * l;
4254
- const K = T - s.x, me = f - s.y, Ae = v - s.z, Ce = a.x - T, le = a.y - f, Q = a.z - v;
4255
- return K * Ce + me * le + Ae * Q > 0 && (a.x = T, a.y = f, a.z = v, t.x = (a.x - T) / r, t.y = (a.y - f) / r, t.z = (a.z - v) / r), a;
4246
+ let d = e.x, p = e.y, m = e.z, g = s.x - d, S = s.y - p, T = s.z - m;
4247
+ const M = d, f = p, v = m, E = n * i, b = E * E, C = g * g + S * S + T * T;
4248
+ if (C > b) {
4249
+ const G = Math.sqrt(C);
4250
+ g = g / G * E, S = S / G * E, T = T / G * E;
4251
+ }
4252
+ d = s.x - g, p = s.y - S, m = s.z - T;
4253
+ const w = (t.x + o * g) * r, I = (t.y + o * S) * r, U = (t.z + o * T) * r;
4254
+ t.x = (t.x - o * w) * l, t.y = (t.y - o * I) * l, t.z = (t.z - o * U) * l, a.x = d + (g + w) * l, a.y = p + (S + I) * l, a.z = m + (T + U) * l;
4255
+ const K = M - s.x, me = f - s.y, Ae = v - s.z, Ce = a.x - M, le = a.y - f, Q = a.z - v;
4256
+ return K * Ce + me * le + Ae * Q > 0 && (a.x = M, a.y = f, a.z = v, t.x = (a.x - M) / r, t.y = (a.y - f) / r, t.z = (a.z - v) / r), a;
4256
4257
  }
4257
4258
  function yi(s, e) {
4258
4259
  e.set(0, 0), s.forEach((t) => {
@@ -4378,7 +4379,7 @@ class ke extends zr {
4378
4379
  * @category Statics
4379
4380
  */
4380
4381
  static get ACTION() {
4381
- return g;
4382
+ return _;
4382
4383
  }
4383
4384
  /**
4384
4385
  * Creates a `CameraControls` instance.
@@ -4399,47 +4400,47 @@ class ke extends zr {
4399
4400
  */
4400
4401
  constructor(e, t) {
4401
4402
  super(), this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.minDistance = Number.EPSILON, this.maxDistance = 1 / 0, this.infinityDolly = !1, this.minZoom = 0.01, this.maxZoom = 1 / 0, this.smoothTime = 0.25, this.draggingSmoothTime = 0.125, this.maxSpeed = 1 / 0, this.azimuthRotateSpeed = 1, this.polarRotateSpeed = 1, this.dollySpeed = 1, this.dollyDragInverted = !1, this.truckSpeed = 2, this.dollyToCursor = !1, this.dragToOffset = !1, this.verticalDragToForward = !1, this.boundaryFriction = 0, this.restThreshold = 0.01, this.colliderMeshes = [], this.cancel = () => {
4402
- }, this._enabled = !0, this._state = g.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = lt.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new R.Vector3(), this._focalOffsetVelocity = new R.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (f, v, C) => {
4403
- let b, S;
4403
+ }, this._enabled = !0, this._state = _.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = lt.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new R.Vector3(), this._focalOffsetVelocity = new R.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (f, v, E) => {
4404
+ let b, C;
4404
4405
  if (Ze(this._camera)) {
4405
4406
  const w = k.copy(this._camera.position).sub(this._target), I = this._camera.getEffectiveFOV() * xt, U = w.length() * Math.tan(I * 0.5);
4406
- b = this.truckSpeed * f * U / this._elementRect.height, S = this.truckSpeed * v * U / this._elementRect.height;
4407
+ b = this.truckSpeed * f * U / this._elementRect.height, C = this.truckSpeed * v * U / this._elementRect.height;
4407
4408
  } else if (Be(this._camera)) {
4408
4409
  const w = this._camera;
4409
- b = f * (w.right - w.left) / w.zoom / this._elementRect.width, S = v * (w.top - w.bottom) / w.zoom / this._elementRect.height;
4410
+ b = f * (w.right - w.left) / w.zoom / this._elementRect.width, C = v * (w.top - w.bottom) / w.zoom / this._elementRect.height;
4410
4411
  } else
4411
4412
  return;
4412
- this.verticalDragToForward ? (C ? this.setFocalOffset(this._focalOffsetEnd.x + b, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(b, 0, !0), this.forward(-S, !0)) : C ? this.setFocalOffset(this._focalOffsetEnd.x + b, this._focalOffsetEnd.y + S, this._focalOffsetEnd.z, !0) : this.truck(b, S, !0);
4413
+ this.verticalDragToForward ? (E ? this.setFocalOffset(this._focalOffsetEnd.x + b, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(b, 0, !0), this.forward(-C, !0)) : E ? this.setFocalOffset(this._focalOffsetEnd.x + b, this._focalOffsetEnd.y + C, this._focalOffsetEnd.z, !0) : this.truck(b, C, !0);
4413
4414
  }, this._rotateInternal = (f, v) => {
4414
- const C = ct * this.azimuthRotateSpeed * f / this._elementRect.height, b = ct * this.polarRotateSpeed * v / this._elementRect.height;
4415
- this.rotate(C, b, !0);
4416
- }, this._dollyInternal = (f, v, C) => {
4417
- const b = Math.pow(0.95, -f * this.dollySpeed), S = this._sphericalEnd.radius, w = this._sphericalEnd.radius * b, I = Te(w, this.minDistance, this.maxDistance), U = I - w;
4418
- this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(w, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(U, !0), this._dollyToNoClamp(I, !0)) : this._dollyToNoClamp(I, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? w : I) - S, this._dollyControlCoord.set(v, C)), this._lastDollyDirection = Math.sign(-f);
4419
- }, this._zoomInternal = (f, v, C) => {
4420
- const b = Math.pow(0.95, f * this.dollySpeed), S = this._zoom, w = this._zoom * b;
4421
- this.zoomTo(w, !0), this.dollyToCursor && (this._changedZoom += w - S, this._dollyControlCoord.set(v, C));
4422
- }, typeof R > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new R.Quaternion().setFromUnitVectors(this._camera.up, Gt), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = g.NONE, this._target = new R.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new R.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new R.Spherical().setFromVector3(k.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
4415
+ const E = ct * this.azimuthRotateSpeed * f / this._elementRect.height, b = ct * this.polarRotateSpeed * v / this._elementRect.height;
4416
+ this.rotate(E, b, !0);
4417
+ }, this._dollyInternal = (f, v, E) => {
4418
+ const b = Math.pow(0.95, -f * this.dollySpeed), C = this._sphericalEnd.radius, w = this._sphericalEnd.radius * b, I = Te(w, this.minDistance, this.maxDistance), U = I - w;
4419
+ this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(w, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(U, !0), this._dollyToNoClamp(I, !0)) : this._dollyToNoClamp(I, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? w : I) - C, this._dollyControlCoord.set(v, E)), this._lastDollyDirection = Math.sign(-f);
4420
+ }, this._zoomInternal = (f, v, E) => {
4421
+ const b = Math.pow(0.95, f * this.dollySpeed), C = this._zoom, w = this._zoom * b;
4422
+ this.zoomTo(w, !0), this.dollyToCursor && (this._changedZoom += w - C, this._dollyControlCoord.set(v, E));
4423
+ }, typeof R > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new R.Quaternion().setFromUnitVectors(this._camera.up, Gt), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = _.NONE, this._target = new R.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new R.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new R.Spherical().setFromVector3(k.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
4423
4424
  new R.Vector3(),
4424
4425
  new R.Vector3(),
4425
4426
  new R.Vector3(),
4426
4427
  new R.Vector3()
4427
4428
  ], this._updateNearPlaneCorners(), this._boundary = new R.Box3(new R.Vector3(-1 / 0, -1 / 0, -1 / 0), new R.Vector3(1 / 0, 1 / 0, 1 / 0)), this._cameraUp0 = this._camera.up.clone(), this._target0 = this._target.clone(), this._position0 = this._camera.position.clone(), this._zoom0 = this._zoom, this._focalOffset0 = this._focalOffset.clone(), this._dollyControlCoord = new R.Vector2(), this.mouseButtons = {
4428
- left: g.ROTATE,
4429
- middle: g.DOLLY,
4430
- right: g.TRUCK,
4431
- wheel: Ze(this._camera) ? g.DOLLY : Be(this._camera) ? g.ZOOM : g.NONE
4429
+ left: _.ROTATE,
4430
+ middle: _.DOLLY,
4431
+ right: _.TRUCK,
4432
+ wheel: Ze(this._camera) ? _.DOLLY : Be(this._camera) ? _.ZOOM : _.NONE
4432
4433
  }, this.touches = {
4433
- one: g.TOUCH_ROTATE,
4434
- two: Ze(this._camera) ? g.TOUCH_DOLLY_TRUCK : Be(this._camera) ? g.TOUCH_ZOOM_TRUCK : g.NONE,
4435
- three: g.TOUCH_TRUCK
4434
+ one: _.TOUCH_ROTATE,
4435
+ two: Ze(this._camera) ? _.TOUCH_DOLLY_TRUCK : Be(this._camera) ? _.TOUCH_ZOOM_TRUCK : _.NONE,
4436
+ three: _.TOUCH_TRUCK
4436
4437
  };
4437
4438
  const i = new R.Vector2(), n = new R.Vector2(), r = new R.Vector2(), a = (f) => {
4438
4439
  if (!this._enabled || !this._domElement)
4439
4440
  return;
4440
4441
  if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
4441
- const b = this._domElement.getBoundingClientRect(), S = f.clientX / b.width, w = f.clientY / b.height;
4442
- if (S < this._interactiveArea.left || S > this._interactiveArea.right || w < this._interactiveArea.top || w > this._interactiveArea.bottom)
4442
+ const b = this._domElement.getBoundingClientRect(), C = f.clientX / b.width, w = f.clientY / b.height;
4443
+ if (C < this._interactiveArea.left || C > this._interactiveArea.right || w < this._interactiveArea.top || w > this._interactiveArea.bottom)
4443
4444
  return;
4444
4445
  }
4445
4446
  const v = f.pointerType !== "mouse" ? null : (f.buttons & q.LEFT) === q.LEFT ? q.LEFT : (f.buttons & q.MIDDLE) === q.MIDDLE ? q.MIDDLE : (f.buttons & q.RIGHT) === q.RIGHT ? q.RIGHT : null;
@@ -4449,7 +4450,7 @@ class ke extends zr {
4449
4450
  }
4450
4451
  if ((f.buttons & q.LEFT) === q.LEFT && this._lockedPointer)
4451
4452
  return;
4452
- const C = {
4453
+ const E = {
4453
4454
  pointerId: f.pointerId,
4454
4455
  clientX: f.clientX,
4455
4456
  clientY: f.clientY,
@@ -4457,12 +4458,12 @@ class ke extends zr {
4457
4458
  deltaY: 0,
4458
4459
  mouseButton: v
4459
4460
  };
4460
- this._activePointers.push(C), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.addEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", c), this._isDragging = !0, m(f);
4461
+ this._activePointers.push(E), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.addEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", c), this._isDragging = !0, m(f);
4461
4462
  }, o = (f) => {
4462
4463
  f.cancelable && f.preventDefault();
4463
- const v = f.pointerId, C = this._lockedPointer || this._findPointerById(v);
4464
- if (C) {
4465
- if (C.clientX = f.clientX, C.clientY = f.clientY, C.deltaX = f.movementX, C.deltaY = f.movementY, this._state = 0, f.pointerType === "touch")
4464
+ const v = f.pointerId, E = this._lockedPointer || this._findPointerById(v);
4465
+ if (E) {
4466
+ if (E.clientX = f.clientX, E.clientY = f.clientY, E.deltaX = f.movementX, E.deltaY = f.movementY, this._state = 0, f.pointerType === "touch")
4466
4467
  switch (this._activePointers.length) {
4467
4468
  case 1:
4468
4469
  this._state = this.touches.one;
@@ -4476,7 +4477,7 @@ class ke extends zr {
4476
4477
  }
4477
4478
  else
4478
4479
  (!this._isDragging && this._lockedPointer || this._isDragging && (f.buttons & q.LEFT) === q.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (f.buttons & q.MIDDLE) === q.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (f.buttons & q.RIGHT) === q.RIGHT && (this._state = this._state | this.mouseButtons.right);
4479
- _();
4480
+ g();
4480
4481
  }
4481
4482
  }, c = (f) => {
4482
4483
  const v = this._findPointerById(f.pointerId);
@@ -4484,7 +4485,7 @@ class ke extends zr {
4484
4485
  if (v && this._disposePointer(v), f.pointerType === "touch")
4485
4486
  switch (this._activePointers.length) {
4486
4487
  case 0:
4487
- this._state = g.NONE;
4488
+ this._state = _.NONE;
4488
4489
  break;
4489
4490
  case 1:
4490
4491
  this._state = this.touches.one;
@@ -4497,43 +4498,43 @@ class ke extends zr {
4497
4498
  break;
4498
4499
  }
4499
4500
  else
4500
- this._state = g.NONE;
4501
- E();
4501
+ this._state = _.NONE;
4502
+ S();
4502
4503
  }
4503
4504
  };
4504
4505
  let l = -1;
4505
4506
  const d = (f) => {
4506
- if (!this._domElement || !this._enabled || this.mouseButtons.wheel === g.NONE)
4507
+ if (!this._domElement || !this._enabled || this.mouseButtons.wheel === _.NONE)
4507
4508
  return;
4508
4509
  if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
4509
4510
  const w = this._domElement.getBoundingClientRect(), I = f.clientX / w.width, U = f.clientY / w.height;
4510
4511
  if (I < this._interactiveArea.left || I > this._interactiveArea.right || U < this._interactiveArea.top || U > this._interactiveArea.bottom)
4511
4512
  return;
4512
4513
  }
4513
- if (f.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === g.ROTATE || this.mouseButtons.wheel === g.TRUCK) {
4514
+ if (f.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === _.ROTATE || this.mouseButtons.wheel === _.TRUCK) {
4514
4515
  const w = performance.now();
4515
4516
  l - w < 1e3 && this._getClientRect(this._elementRect), l = w;
4516
4517
  }
4517
- const v = Yr ? -1 : -3, C = f.deltaMode === 1 ? f.deltaY / v : f.deltaY / (v * 10), b = this.dollyToCursor ? (f.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, S = this.dollyToCursor ? (f.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
4518
+ const v = Yr ? -1 : -3, E = f.deltaMode === 1 ? f.deltaY / v : f.deltaY / (v * 10), b = this.dollyToCursor ? (f.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, C = this.dollyToCursor ? (f.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
4518
4519
  switch (this.mouseButtons.wheel) {
4519
- case g.ROTATE: {
4520
+ case _.ROTATE: {
4520
4521
  this._rotateInternal(f.deltaX, f.deltaY), this._isUserControllingRotate = !0;
4521
4522
  break;
4522
4523
  }
4523
- case g.TRUCK: {
4524
+ case _.TRUCK: {
4524
4525
  this._truckInternal(f.deltaX, f.deltaY, !1), this._isUserControllingTruck = !0;
4525
4526
  break;
4526
4527
  }
4527
- case g.OFFSET: {
4528
+ case _.OFFSET: {
4528
4529
  this._truckInternal(f.deltaX, f.deltaY, !0), this._isUserControllingOffset = !0;
4529
4530
  break;
4530
4531
  }
4531
- case g.DOLLY: {
4532
- this._dollyInternal(-C, b, S), this._isUserControllingDolly = !0;
4532
+ case _.DOLLY: {
4533
+ this._dollyInternal(-E, b, C), this._isUserControllingDolly = !0;
4533
4534
  break;
4534
4535
  }
4535
- case g.ZOOM: {
4536
- this._zoomInternal(-C, b, S), this._isUserControllingZoom = !0;
4536
+ case _.ZOOM: {
4537
+ this._zoomInternal(-E, b, C), this._isUserControllingZoom = !0;
4537
4538
  break;
4538
4539
  }
4539
4540
  }
@@ -4541,8 +4542,8 @@ class ke extends zr {
4541
4542
  }, p = (f) => {
4542
4543
  if (!(!this._domElement || !this._enabled)) {
4543
4544
  if (this.mouseButtons.right === ke.ACTION.NONE) {
4544
- const v = f instanceof PointerEvent ? f.pointerId : 0, C = this._findPointerById(v);
4545
- C && this._disposePointer(C), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c);
4545
+ const v = f instanceof PointerEvent ? f.pointerId : 0, E = this._findPointerById(v);
4546
+ E && this._disposePointer(E), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c);
4546
4547
  return;
4547
4548
  }
4548
4549
  f.preventDefault();
@@ -4551,8 +4552,8 @@ class ke extends zr {
4551
4552
  if (!this._enabled)
4552
4553
  return;
4553
4554
  if (yi(this._activePointers, ye), this._getClientRect(this._elementRect), i.copy(ye), n.copy(ye), this._activePointers.length >= 2) {
4554
- const C = ye.x - this._activePointers[1].clientX, b = ye.y - this._activePointers[1].clientY, S = Math.sqrt(C * C + b * b);
4555
- r.set(0, S);
4555
+ const E = ye.x - this._activePointers[1].clientX, b = ye.y - this._activePointers[1].clientY, C = Math.sqrt(E * E + b * b);
4556
+ r.set(0, C);
4556
4557
  const w = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, I = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
4557
4558
  n.set(w, I);
4558
4559
  }
@@ -4572,24 +4573,24 @@ class ke extends zr {
4572
4573
  }
4573
4574
  else
4574
4575
  !this._lockedPointer && (f.buttons & q.LEFT) === q.LEFT && (this._state = this._state | this.mouseButtons.left), (f.buttons & q.MIDDLE) === q.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & q.RIGHT) === q.RIGHT && (this._state = this._state | this.mouseButtons.right);
4575
- ((this._state & g.ROTATE) === g.ROTATE || (this._state & g.TOUCH_ROTATE) === g.TOUCH_ROTATE || (this._state & g.TOUCH_DOLLY_ROTATE) === g.TOUCH_DOLLY_ROTATE || (this._state & g.TOUCH_ZOOM_ROTATE) === g.TOUCH_ZOOM_ROTATE) && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((this._state & g.TRUCK) === g.TRUCK || (this._state & g.TOUCH_TRUCK) === g.TOUCH_TRUCK || (this._state & g.TOUCH_DOLLY_TRUCK) === g.TOUCH_DOLLY_TRUCK || (this._state & g.TOUCH_ZOOM_TRUCK) === g.TOUCH_ZOOM_TRUCK) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & g.DOLLY) === g.DOLLY || (this._state & g.TOUCH_DOLLY) === g.TOUCH_DOLLY || (this._state & g.TOUCH_DOLLY_TRUCK) === g.TOUCH_DOLLY_TRUCK || (this._state & g.TOUCH_DOLLY_OFFSET) === g.TOUCH_DOLLY_OFFSET || (this._state & g.TOUCH_DOLLY_ROTATE) === g.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & g.ZOOM) === g.ZOOM || (this._state & g.TOUCH_ZOOM) === g.TOUCH_ZOOM || (this._state & g.TOUCH_ZOOM_TRUCK) === g.TOUCH_ZOOM_TRUCK || (this._state & g.TOUCH_ZOOM_OFFSET) === g.TOUCH_ZOOM_OFFSET || (this._state & g.TOUCH_ZOOM_ROTATE) === g.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & g.OFFSET) === g.OFFSET || (this._state & g.TOUCH_OFFSET) === g.TOUCH_OFFSET || (this._state & g.TOUCH_DOLLY_OFFSET) === g.TOUCH_DOLLY_OFFSET || (this._state & g.TOUCH_ZOOM_OFFSET) === g.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
4576
- }, _ = () => {
4576
+ ((this._state & _.ROTATE) === _.ROTATE || (this._state & _.TOUCH_ROTATE) === _.TOUCH_ROTATE || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_ZOOM_ROTATE) === _.TOUCH_ZOOM_ROTATE) && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((this._state & _.TRUCK) === _.TRUCK || (this._state & _.TOUCH_TRUCK) === _.TOUCH_TRUCK || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_ZOOM_TRUCK) === _.TOUCH_ZOOM_TRUCK) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & _.DOLLY) === _.DOLLY || (this._state & _.TOUCH_DOLLY) === _.TOUCH_DOLLY || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & _.ZOOM) === _.ZOOM || (this._state & _.TOUCH_ZOOM) === _.TOUCH_ZOOM || (this._state & _.TOUCH_ZOOM_TRUCK) === _.TOUCH_ZOOM_TRUCK || (this._state & _.TOUCH_ZOOM_OFFSET) === _.TOUCH_ZOOM_OFFSET || (this._state & _.TOUCH_ZOOM_ROTATE) === _.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & _.OFFSET) === _.OFFSET || (this._state & _.TOUCH_OFFSET) === _.TOUCH_OFFSET || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET || (this._state & _.TOUCH_ZOOM_OFFSET) === _.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
4577
+ }, g = () => {
4577
4578
  if (!this._enabled || !this._dragNeedsUpdate)
4578
4579
  return;
4579
4580
  this._dragNeedsUpdate = !1, yi(this._activePointers, ye);
4580
- const v = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, C = v ? -v.deltaX : n.x - ye.x, b = v ? -v.deltaY : n.y - ye.y;
4581
- if (n.copy(ye), ((this._state & g.ROTATE) === g.ROTATE || (this._state & g.TOUCH_ROTATE) === g.TOUCH_ROTATE || (this._state & g.TOUCH_DOLLY_ROTATE) === g.TOUCH_DOLLY_ROTATE || (this._state & g.TOUCH_ZOOM_ROTATE) === g.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(C, b), this._isUserControllingRotate = !0), (this._state & g.DOLLY) === g.DOLLY || (this._state & g.ZOOM) === g.ZOOM) {
4582
- const S = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, w = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, I = this.dollyDragInverted ? -1 : 1;
4583
- (this._state & g.DOLLY) === g.DOLLY ? (this._dollyInternal(I * b * Wt, S, w), this._isUserControllingDolly = !0) : (this._zoomInternal(I * b * Wt, S, w), this._isUserControllingZoom = !0);
4581
+ const v = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = v ? -v.deltaX : n.x - ye.x, b = v ? -v.deltaY : n.y - ye.y;
4582
+ if (n.copy(ye), ((this._state & _.ROTATE) === _.ROTATE || (this._state & _.TOUCH_ROTATE) === _.TOUCH_ROTATE || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_ZOOM_ROTATE) === _.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, b), this._isUserControllingRotate = !0), (this._state & _.DOLLY) === _.DOLLY || (this._state & _.ZOOM) === _.ZOOM) {
4583
+ const C = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, w = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, I = this.dollyDragInverted ? -1 : 1;
4584
+ (this._state & _.DOLLY) === _.DOLLY ? (this._dollyInternal(I * b * Wt, C, w), this._isUserControllingDolly = !0) : (this._zoomInternal(I * b * Wt, C, w), this._isUserControllingZoom = !0);
4584
4585
  }
4585
- if ((this._state & g.TOUCH_DOLLY) === g.TOUCH_DOLLY || (this._state & g.TOUCH_ZOOM) === g.TOUCH_ZOOM || (this._state & g.TOUCH_DOLLY_TRUCK) === g.TOUCH_DOLLY_TRUCK || (this._state & g.TOUCH_ZOOM_TRUCK) === g.TOUCH_ZOOM_TRUCK || (this._state & g.TOUCH_DOLLY_OFFSET) === g.TOUCH_DOLLY_OFFSET || (this._state & g.TOUCH_ZOOM_OFFSET) === g.TOUCH_ZOOM_OFFSET || (this._state & g.TOUCH_DOLLY_ROTATE) === g.TOUCH_DOLLY_ROTATE || (this._state & g.TOUCH_ZOOM_ROTATE) === g.TOUCH_ZOOM_ROTATE) {
4586
- const S = ye.x - this._activePointers[1].clientX, w = ye.y - this._activePointers[1].clientY, I = Math.sqrt(S * S + w * w), U = r.y - I;
4586
+ if ((this._state & _.TOUCH_DOLLY) === _.TOUCH_DOLLY || (this._state & _.TOUCH_ZOOM) === _.TOUCH_ZOOM || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_ZOOM_TRUCK) === _.TOUCH_ZOOM_TRUCK || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET || (this._state & _.TOUCH_ZOOM_OFFSET) === _.TOUCH_ZOOM_OFFSET || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_ZOOM_ROTATE) === _.TOUCH_ZOOM_ROTATE) {
4587
+ const C = ye.x - this._activePointers[1].clientX, w = ye.y - this._activePointers[1].clientY, I = Math.sqrt(C * C + w * w), U = r.y - I;
4587
4588
  r.set(0, I);
4588
4589
  const K = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, me = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
4589
- (this._state & g.TOUCH_DOLLY) === g.TOUCH_DOLLY || (this._state & g.TOUCH_DOLLY_ROTATE) === g.TOUCH_DOLLY_ROTATE || (this._state & g.TOUCH_DOLLY_TRUCK) === g.TOUCH_DOLLY_TRUCK || (this._state & g.TOUCH_DOLLY_OFFSET) === g.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(U * Wt, K, me), this._isUserControllingDolly = !0) : (this._zoomInternal(U * Wt, K, me), this._isUserControllingZoom = !0);
4590
+ (this._state & _.TOUCH_DOLLY) === _.TOUCH_DOLLY || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(U * Wt, K, me), this._isUserControllingDolly = !0) : (this._zoomInternal(U * Wt, K, me), this._isUserControllingZoom = !0);
4590
4591
  }
4591
- ((this._state & g.TRUCK) === g.TRUCK || (this._state & g.TOUCH_TRUCK) === g.TOUCH_TRUCK || (this._state & g.TOUCH_DOLLY_TRUCK) === g.TOUCH_DOLLY_TRUCK || (this._state & g.TOUCH_ZOOM_TRUCK) === g.TOUCH_ZOOM_TRUCK) && (this._truckInternal(C, b, !1), this._isUserControllingTruck = !0), ((this._state & g.OFFSET) === g.OFFSET || (this._state & g.TOUCH_OFFSET) === g.TOUCH_OFFSET || (this._state & g.TOUCH_DOLLY_OFFSET) === g.TOUCH_DOLLY_OFFSET || (this._state & g.TOUCH_ZOOM_OFFSET) === g.TOUCH_ZOOM_OFFSET) && (this._truckInternal(C, b, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
4592
- }, E = () => {
4592
+ ((this._state & _.TRUCK) === _.TRUCK || (this._state & _.TOUCH_TRUCK) === _.TOUCH_TRUCK || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_ZOOM_TRUCK) === _.TOUCH_ZOOM_TRUCK) && (this._truckInternal(E, b, !1), this._isUserControllingTruck = !0), ((this._state & _.OFFSET) === _.OFFSET || (this._state & _.TOUCH_OFFSET) === _.TOUCH_OFFSET || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET || (this._state & _.TOUCH_ZOOM_OFFSET) === _.TOUCH_ZOOM_OFFSET) && (this._truckInternal(E, b, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
4593
+ }, S = () => {
4593
4594
  yi(this._activePointers, ye), n.copy(ye), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this.dispatchEvent({ type: "controlend" }));
4594
4595
  };
4595
4596
  this.lockPointer = () => {
@@ -4600,22 +4601,22 @@ class ke extends zr {
4600
4601
  deltaX: 0,
4601
4602
  deltaY: 0,
4602
4603
  mouseButton: null
4603
- }, this._activePointers.push(this._lockedPointer), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener("pointerlockchange", O), this._domElement.ownerDocument.addEventListener("pointerlockerror", T), this._domElement.ownerDocument.addEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", c), m());
4604
+ }, this._activePointers.push(this._lockedPointer), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener("pointerlockchange", T), this._domElement.ownerDocument.addEventListener("pointerlockerror", M), this._domElement.ownerDocument.addEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", c), m());
4604
4605
  }, this.unlockPointer = () => {
4605
- var f, v, C;
4606
- this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), (f = this._domElement) === null || f === void 0 || f.ownerDocument.exitPointerLock(), (v = this._domElement) === null || v === void 0 || v.ownerDocument.removeEventListener("pointerlockchange", O), (C = this._domElement) === null || C === void 0 || C.ownerDocument.removeEventListener("pointerlockerror", T), this.cancel();
4606
+ var f, v, E;
4607
+ this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), (f = this._domElement) === null || f === void 0 || f.ownerDocument.exitPointerLock(), (v = this._domElement) === null || v === void 0 || v.ownerDocument.removeEventListener("pointerlockchange", T), (E = this._domElement) === null || E === void 0 || E.ownerDocument.removeEventListener("pointerlockerror", M), this.cancel();
4607
4608
  };
4608
- const O = () => {
4609
+ const T = () => {
4609
4610
  this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement || this.unlockPointer();
4610
- }, T = () => {
4611
+ }, M = () => {
4611
4612
  this.unlockPointer();
4612
4613
  };
4613
4614
  this._addAllEventListeners = (f) => {
4614
4615
  this._domElement = f, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", a), this._domElement.addEventListener("pointercancel", c), this._domElement.addEventListener("wheel", d, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
4615
4616
  }, this._removeAllEventListeners = () => {
4616
- this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", a), this._domElement.removeEventListener("pointercancel", c), this._domElement.removeEventListener("wheel", d, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.removeEventListener("pointerlockchange", O), this._domElement.ownerDocument.removeEventListener("pointerlockerror", T));
4617
+ this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", a), this._domElement.removeEventListener("pointercancel", c), this._domElement.removeEventListener("wheel", d, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.removeEventListener("pointerlockchange", T), this._domElement.ownerDocument.removeEventListener("pointerlockerror", M));
4617
4618
  }, this.cancel = () => {
4618
- this._state !== g.NONE && (this._state = g.NONE, this._activePointers.length = 0, E());
4619
+ this._state !== _.NONE && (this._state = _.NONE, this._activePointers.length = 0, S());
4619
4620
  }, t && this.connect(t), this.update(0);
4620
4621
  }
4621
4622
  /**
@@ -4982,17 +4983,17 @@ class ke extends zr {
4982
4983
  l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
4983
4984
  const d = Ss(this._sphericalEnd.theta, Cs), p = Ss(this._sphericalEnd.phi, Cs);
4984
4985
  c.push(this.rotateTo(d, p, t));
4985
- const m = k.setFromSpherical(this._sphericalEnd).normalize(), _ = As.setFromUnitVectors(m, Ci), E = H(Math.abs(m.y), 1);
4986
- E && _.multiply(wi.setFromAxisAngle(Gt, d)), _.multiply(this._yAxisUpSpaceInverse);
4987
- const O = Ms.makeEmpty();
4988
- F.copy(l.min).applyQuaternion(_), O.expandByPoint(F), F.copy(l.min).setX(l.max.x).applyQuaternion(_), O.expandByPoint(F), F.copy(l.min).setY(l.max.y).applyQuaternion(_), O.expandByPoint(F), F.copy(l.max).setZ(l.min.z).applyQuaternion(_), O.expandByPoint(F), F.copy(l.min).setZ(l.max.z).applyQuaternion(_), O.expandByPoint(F), F.copy(l.max).setY(l.min.y).applyQuaternion(_), O.expandByPoint(F), F.copy(l.max).setX(l.min.x).applyQuaternion(_), O.expandByPoint(F), F.copy(l.max).applyQuaternion(_), O.expandByPoint(F), O.min.x -= n, O.min.y -= a, O.max.x += r, O.max.y += o, _.setFromUnitVectors(Ci, m), E && _.premultiply(wi.invert()), _.premultiply(this._yAxisUpSpace);
4989
- const T = O.getSize(k), f = O.getCenter(F).applyQuaternion(_);
4986
+ const m = k.setFromSpherical(this._sphericalEnd).normalize(), g = As.setFromUnitVectors(m, Ci), S = H(Math.abs(m.y), 1);
4987
+ S && g.multiply(wi.setFromAxisAngle(Gt, d)), g.multiply(this._yAxisUpSpaceInverse);
4988
+ const T = Ms.makeEmpty();
4989
+ F.copy(l.min).applyQuaternion(g), T.expandByPoint(F), F.copy(l.min).setX(l.max.x).applyQuaternion(g), T.expandByPoint(F), F.copy(l.min).setY(l.max.y).applyQuaternion(g), T.expandByPoint(F), F.copy(l.max).setZ(l.min.z).applyQuaternion(g), T.expandByPoint(F), F.copy(l.min).setZ(l.max.z).applyQuaternion(g), T.expandByPoint(F), F.copy(l.max).setY(l.min.y).applyQuaternion(g), T.expandByPoint(F), F.copy(l.max).setX(l.min.x).applyQuaternion(g), T.expandByPoint(F), F.copy(l.max).applyQuaternion(g), T.expandByPoint(F), T.min.x -= n, T.min.y -= a, T.max.x += r, T.max.y += o, g.setFromUnitVectors(Ci, m), S && g.premultiply(wi.invert()), g.premultiply(this._yAxisUpSpace);
4990
+ const M = T.getSize(k), f = T.getCenter(F).applyQuaternion(g);
4990
4991
  if (Ze(this._camera)) {
4991
- const v = this.getDistanceToFitBox(T.x, T.y, T.z, i);
4992
+ const v = this.getDistanceToFitBox(M.x, M.y, M.z, i);
4992
4993
  c.push(this.moveTo(f.x, f.y, f.z, t)), c.push(this.dollyTo(v, t)), c.push(this.setFocalOffset(0, 0, 0, t));
4993
4994
  } else if (Be(this._camera)) {
4994
- const v = this._camera, C = v.right - v.left, b = v.top - v.bottom, S = i ? Math.max(C / T.x, b / T.y) : Math.min(C / T.x, b / T.y);
4995
- c.push(this.moveTo(f.x, f.y, f.z, t)), c.push(this.zoomTo(S, t)), c.push(this.setFocalOffset(0, 0, 0, t));
4995
+ const v = this._camera, E = v.right - v.left, b = v.top - v.bottom, C = i ? Math.max(E / M.x, b / M.y) : Math.min(E / M.x, b / M.y);
4996
+ c.push(this.moveTo(f.x, f.y, f.z, t)), c.push(this.zoomTo(C, t)), c.push(this.setFocalOffset(0, 0, 0, t));
4996
4997
  }
4997
4998
  return Promise.all(c);
4998
4999
  }
@@ -5049,15 +5050,15 @@ class ke extends zr {
5049
5050
  * @param enableTransition
5050
5051
  * @category Methods
5051
5052
  */
5052
- lerpLookAt(e, t, i, n, r, a, o, c, l, d, p, m, _, E = !1) {
5053
+ lerpLookAt(e, t, i, n, r, a, o, c, l, d, p, m, g, S = !1) {
5053
5054
  this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = lt.NONE, this._changedDolly = 0;
5054
- const O = k.set(n, r, a), T = F.set(e, t, i);
5055
- we.setFromVector3(T.sub(O).applyQuaternion(this._yAxisUpSpace));
5055
+ const T = k.set(n, r, a), M = F.set(e, t, i);
5056
+ we.setFromVector3(M.sub(T).applyQuaternion(this._yAxisUpSpace));
5056
5057
  const f = ht.set(d, p, m), v = F.set(o, c, l);
5057
- At.setFromVector3(v.sub(f).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(O.lerp(f, _));
5058
- const C = At.theta - we.theta, b = At.phi - we.phi, S = At.radius - we.radius;
5059
- this._sphericalEnd.set(we.radius + S * _, we.phi + b * _, we.theta + C * _), this.normalizeRotations(), this._needsUpdate = !0, E || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
5060
- const w = !E || H(this._target.x, this._targetEnd.x, this.restThreshold) && H(this._target.y, this._targetEnd.y, this.restThreshold) && H(this._target.z, this._targetEnd.z, this.restThreshold) && H(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && H(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && H(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
5058
+ At.setFromVector3(v.sub(f).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(T.lerp(f, g));
5059
+ const E = At.theta - we.theta, b = At.phi - we.phi, C = At.radius - we.radius;
5060
+ this._sphericalEnd.set(we.radius + C * g, we.phi + b * g, we.theta + E * g), this.normalizeRotations(), this._needsUpdate = !0, S || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
5061
+ const w = !S || H(this._target.x, this._targetEnd.x, this.restThreshold) && H(this._target.y, this._targetEnd.y, this.restThreshold) && H(this._target.z, this._targetEnd.z, this.restThreshold) && H(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && H(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && H(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
5061
5062
  return this._createOnRestPromise(w);
5062
5063
  }
5063
5064
  /**
@@ -5267,37 +5268,37 @@ class ke extends zr {
5267
5268
  */
5268
5269
  update(e) {
5269
5270
  const t = this._sphericalEnd.theta - this._spherical.theta, i = this._sphericalEnd.phi - this._spherical.phi, n = this._sphericalEnd.radius - this._spherical.radius, r = Os.subVectors(this._targetEnd, this._target), a = Ts.subVectors(this._focalOffsetEnd, this._focalOffset), o = this._zoomEnd - this._zoom;
5270
- if (G(t))
5271
+ if (X(t))
5271
5272
  this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
5272
5273
  else {
5273
5274
  const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
5274
5275
  this._spherical.theta = Zt(this._spherical.theta, this._sphericalEnd.theta, this._thetaVelocity, p, 1 / 0, e), this._needsUpdate = !0;
5275
5276
  }
5276
- if (G(i))
5277
+ if (X(i))
5277
5278
  this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
5278
5279
  else {
5279
5280
  const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
5280
5281
  this._spherical.phi = Zt(this._spherical.phi, this._sphericalEnd.phi, this._phiVelocity, p, 1 / 0, e), this._needsUpdate = !0;
5281
5282
  }
5282
- if (G(n))
5283
+ if (X(n))
5283
5284
  this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
5284
5285
  else {
5285
5286
  const p = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
5286
5287
  this._spherical.radius = Zt(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity, p, this.maxSpeed, e), this._needsUpdate = !0;
5287
5288
  }
5288
- if (G(r.x) && G(r.y) && G(r.z))
5289
+ if (X(r.x) && X(r.y) && X(r.z))
5289
5290
  this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
5290
5291
  else {
5291
5292
  const p = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
5292
5293
  ws(this._target, this._targetEnd, this._targetVelocity, p, this.maxSpeed, e, this._target), this._needsUpdate = !0;
5293
5294
  }
5294
- if (G(a.x) && G(a.y) && G(a.z))
5295
+ if (X(a.x) && X(a.y) && X(a.z))
5295
5296
  this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
5296
5297
  else {
5297
5298
  const p = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
5298
5299
  ws(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, p, this.maxSpeed, e, this._focalOffset), this._needsUpdate = !0;
5299
5300
  }
5300
- if (G(o))
5301
+ if (X(o))
5301
5302
  this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
5302
5303
  else {
5303
5304
  const p = this._isUserControllingZoom ? this.draggingSmoothTime : this.smoothTime;
@@ -5305,29 +5306,29 @@ class ke extends zr {
5305
5306
  }
5306
5307
  if (this.dollyToCursor) {
5307
5308
  if (Ze(this._camera) && this._changedDolly !== 0) {
5308
- const p = this._spherical.radius - this._lastDistance, m = this._camera, _ = this._getCameraDirection(Mt), E = k.copy(_).cross(m.up).normalize();
5309
- E.lengthSq() === 0 && (E.x = 1);
5310
- const O = F.crossVectors(E, _), T = this._sphericalEnd.radius * Math.tan(m.getEffectiveFOV() * xt * 0.5), v = (this._sphericalEnd.radius - p - this._sphericalEnd.radius) / this._sphericalEnd.radius, C = ht.copy(this._targetEnd).add(E.multiplyScalar(this._dollyControlCoord.x * T * m.aspect)).add(O.multiplyScalar(this._dollyControlCoord.y * T)), b = k.copy(this._targetEnd).lerp(C, v), S = this._lastDollyDirection === lt.IN && this._spherical.radius <= this.minDistance, w = this._lastDollyDirection === lt.OUT && this.maxDistance <= this._spherical.radius;
5311
- if (this.infinityDolly && (S || w)) {
5309
+ const p = this._spherical.radius - this._lastDistance, m = this._camera, g = this._getCameraDirection(Mt), S = k.copy(g).cross(m.up).normalize();
5310
+ S.lengthSq() === 0 && (S.x = 1);
5311
+ const T = F.crossVectors(S, g), M = this._sphericalEnd.radius * Math.tan(m.getEffectiveFOV() * xt * 0.5), v = (this._sphericalEnd.radius - p - this._sphericalEnd.radius) / this._sphericalEnd.radius, E = ht.copy(this._targetEnd).add(S.multiplyScalar(this._dollyControlCoord.x * M * m.aspect)).add(T.multiplyScalar(this._dollyControlCoord.y * M)), b = k.copy(this._targetEnd).lerp(E, v), C = this._lastDollyDirection === lt.IN && this._spherical.radius <= this.minDistance, w = this._lastDollyDirection === lt.OUT && this.maxDistance <= this._spherical.radius;
5312
+ if (this.infinityDolly && (C || w)) {
5312
5313
  this._sphericalEnd.radius -= p, this._spherical.radius -= p;
5313
- const U = F.copy(_).multiplyScalar(-p);
5314
+ const U = F.copy(g).multiplyScalar(-p);
5314
5315
  b.add(U);
5315
5316
  }
5316
5317
  this._boundary.clampPoint(b, b);
5317
5318
  const I = F.subVectors(b, this._targetEnd);
5318
- this._targetEnd.copy(b), this._target.add(I), this._changedDolly -= p, G(this._changedDolly) && (this._changedDolly = 0);
5319
+ this._targetEnd.copy(b), this._target.add(I), this._changedDolly -= p, X(this._changedDolly) && (this._changedDolly = 0);
5319
5320
  } else if (Be(this._camera) && this._changedZoom !== 0) {
5320
- const p = this._zoom - this._lastZoom, m = this._camera, _ = k.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (m.near + m.far) / (m.near - m.far)).unproject(m), E = F.set(0, 0, -1).applyQuaternion(m.quaternion), O = ht.copy(_).add(E.multiplyScalar(-_.dot(m.up))), f = -(this._zoom - p - this._zoom) / this._zoom, v = this._getCameraDirection(Mt), C = this._targetEnd.dot(v), b = k.copy(this._targetEnd).lerp(O, f), S = b.dot(v), w = v.multiplyScalar(S - C);
5321
+ const p = this._zoom - this._lastZoom, m = this._camera, g = k.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (m.near + m.far) / (m.near - m.far)).unproject(m), S = F.set(0, 0, -1).applyQuaternion(m.quaternion), T = ht.copy(g).add(S.multiplyScalar(-g.dot(m.up))), f = -(this._zoom - p - this._zoom) / this._zoom, v = this._getCameraDirection(Mt), E = this._targetEnd.dot(v), b = k.copy(this._targetEnd).lerp(T, f), C = b.dot(v), w = v.multiplyScalar(C - E);
5321
5322
  b.sub(w), this._boundary.clampPoint(b, b);
5322
5323
  const I = F.subVectors(b, this._targetEnd);
5323
- this._targetEnd.copy(b), this._target.add(I), this._changedZoom -= p, G(this._changedZoom) && (this._changedZoom = 0);
5324
+ this._targetEnd.copy(b), this._target.add(I), this._changedZoom -= p, X(this._changedZoom) && (this._changedZoom = 0);
5324
5325
  }
5325
5326
  }
5326
5327
  this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
5327
5328
  const c = this._collisionTest();
5328
- this._spherical.radius = Math.min(this._spherical.radius, c), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!G(this._focalOffset.x) || !G(this._focalOffset.y) || !G(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Pe.setFromMatrixColumn(this._camera.matrix, 0), De.setFromMatrixColumn(this._camera.matrix, 1), We.setFromMatrixColumn(this._camera.matrix, 2), Pe.multiplyScalar(this._focalOffset.x), De.multiplyScalar(-this._focalOffset.y), We.multiplyScalar(this._focalOffset.z), k.copy(Pe).add(De).add(We), this._camera.position.add(k)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), k.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
5329
+ this._spherical.radius = Math.min(this._spherical.radius, c), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Pe.setFromMatrixColumn(this._camera.matrix, 0), De.setFromMatrixColumn(this._camera.matrix, 1), We.setFromMatrixColumn(this._camera.matrix, 2), Pe.multiplyScalar(this._focalOffset.x), De.multiplyScalar(-this._focalOffset.y), We.multiplyScalar(this._focalOffset.z), k.copy(Pe).add(De).add(We), this._camera.position.add(k)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), k.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
5329
5330
  const d = this._needsUpdate;
5330
- return d && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : d ? (this.dispatchEvent({ type: "update" }), G(t, this.restThreshold) && G(i, this.restThreshold) && G(n, this.restThreshold) && G(r.x, this.restThreshold) && G(r.y, this.restThreshold) && G(r.z, this.restThreshold) && G(a.x, this.restThreshold) && G(a.y, this.restThreshold) && G(a.z, this.restThreshold) && G(o, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !d && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = d, this._needsUpdate = !1, d;
5331
+ return d && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : d ? (this.dispatchEvent({ type: "update" }), X(t, this.restThreshold) && X(i, this.restThreshold) && X(n, this.restThreshold) && X(r.x, this.restThreshold) && X(r.y, this.restThreshold) && X(r.z, this.restThreshold) && X(a.x, this.restThreshold) && X(a.y, this.restThreshold) && X(a.z, this.restThreshold) && X(o, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !d && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = d, this._needsUpdate = !1, d;
5331
5332
  }
5332
5333
  /**
5333
5334
  * Get all state in JSON string
@@ -5525,7 +5526,7 @@ class ke extends zr {
5525
5526
  }
5526
5527
  }
5527
5528
  const ai = (s) => {
5528
- const [e, t] = X(s.options[s.index]), i = () => {
5529
+ const [e, t] = B(s.options[s.index]), i = () => {
5529
5530
  s.onToggle(!s.open);
5530
5531
  }, n = (r) => {
5531
5532
  r !== e && (s.onSelect(r), t(r)), s.onToggle(!1);
@@ -5541,7 +5542,7 @@ const ai = (s) => {
5541
5542
  "Normals",
5542
5543
  "UVs",
5543
5544
  "Wireframe"
5544
- ], [n, r] = X("Renderer"), [a, o] = X(!1), [c, l] = X(!1), [d, p] = X(!1);
5545
+ ], [n, r] = B("Renderer"), [a, o] = B(!1), [c, l] = B(!1), [d, p] = B(!1);
5545
5546
  return /* @__PURE__ */ u.jsxs("div", { className: `CameraWindow ${e.name}`, children: [
5546
5547
  /* @__PURE__ */ u.jsx("div", { ref: t, className: "clickable", onClick: () => {
5547
5548
  d && p(!1);
@@ -5571,8 +5572,8 @@ const ai = (s) => {
5571
5572
  onSelect: (m) => {
5572
5573
  if (m === n)
5573
5574
  return;
5574
- const _ = m;
5575
- e.onSelectRenderMode(_), r(_);
5575
+ const g = m;
5576
+ e.onSelectRenderMode(g), r(g);
5576
5577
  },
5577
5578
  onToggle: (m) => {
5578
5579
  a && o(!1), l(m);
@@ -5696,7 +5697,7 @@ class Br extends rn {
5696
5697
  });
5697
5698
  }
5698
5699
  }
5699
- class Vr extends M {
5700
+ class Vr extends O {
5700
5701
  gridMaterial;
5701
5702
  constructor() {
5702
5703
  const e = new Br();
@@ -5707,7 +5708,7 @@ class Vr extends M {
5707
5708
  }
5708
5709
  }
5709
5710
  function Ps(s) {
5710
- const [e, t] = X(s.selected), i = "toggle" + (e ? " selected" : "");
5711
+ const [e, t] = B(s.selected), i = "toggle" + (e ? " selected" : "");
5711
5712
  return /* @__PURE__ */ u.jsx(
5712
5713
  "button",
5713
5714
  {
@@ -5790,20 +5791,20 @@ class Xr extends an {
5790
5791
  const r = new io();
5791
5792
  this._plane = r, i.add(r);
5792
5793
  const a = this;
5793
- function o(C, b) {
5794
- let S = b;
5795
- Object.defineProperty(a, C, {
5794
+ function o(E, b) {
5795
+ let C = b;
5796
+ Object.defineProperty(a, E, {
5796
5797
  get: function() {
5797
- return S !== void 0 ? S : b;
5798
+ return C !== void 0 ? C : b;
5798
5799
  },
5799
5800
  set: function(w) {
5800
- S !== w && (S = w, r[C] = w, n[C] = w, a.dispatchEvent({ type: C + "-changed", value: w }), a.dispatchEvent(Oi));
5801
+ C !== w && (C = w, r[E] = w, n[E] = w, a.dispatchEvent({ type: E + "-changed", value: w }), a.dispatchEvent(Oi));
5801
5802
  }
5802
- }), a[C] = b, r[C] = b, n[C] = b;
5803
+ }), a[E] = b, r[E] = b, n[E] = b;
5803
5804
  }
5804
5805
  o("camera", e), o("object", void 0), o("enabled", !0), o("axis", null), o("mode", "translate"), o("translationSnap", null), o("rotationSnap", null), o("scaleSnap", null), o("space", "world"), o("size", 1), o("dragging", !1), o("showX", !0), o("showY", !0), o("showZ", !0);
5805
- const c = new A(), l = new A(), d = new Ee(), p = new Ee(), m = new A(), _ = new Ee(), E = new A(), O = new A(), T = new A(), f = 0, v = new A();
5806
- o("worldPosition", c), o("worldPositionStart", l), o("worldQuaternion", d), o("worldQuaternionStart", p), o("cameraPosition", m), o("cameraQuaternion", _), o("pointStart", E), o("pointEnd", O), o("rotationAxis", T), o("rotationAngle", f), o("eye", v), this._offset = new A(), this._startNorm = new A(), this._endNorm = new A(), this._cameraScale = new A(), this._parentPosition = new A(), this._parentQuaternion = new Ee(), this._parentQuaternionInv = new Ee(), this._parentScale = new A(), this._worldScaleStart = new A(), this._worldQuaternionInv = new Ee(), this._worldScale = new A(), this._positionStart = new A(), this._quaternionStart = new Ee(), this._scaleStart = new A(), this._getPointer = $r.bind(this), this._onPointerDown = Kr.bind(this), this._onPointerHover = qr.bind(this), this._onPointerMove = Qr.bind(this), this._onPointerUp = Jr.bind(this), t !== null && this.connect();
5806
+ const c = new A(), l = new A(), d = new Ee(), p = new Ee(), m = new A(), g = new Ee(), S = new A(), T = new A(), M = new A(), f = 0, v = new A();
5807
+ o("worldPosition", c), o("worldPositionStart", l), o("worldQuaternion", d), o("worldQuaternionStart", p), o("cameraPosition", m), o("cameraQuaternion", g), o("pointStart", S), o("pointEnd", T), o("rotationAxis", M), o("rotationAngle", f), o("eye", v), this._offset = new A(), this._startNorm = new A(), this._endNorm = new A(), this._cameraScale = new A(), this._parentPosition = new A(), this._parentQuaternion = new Ee(), this._parentQuaternionInv = new Ee(), this._parentScale = new A(), this._worldScaleStart = new A(), this._worldQuaternionInv = new Ee(), this._worldScale = new A(), this._positionStart = new A(), this._quaternionStart = new Ee(), this._scaleStart = new A(), this._getPointer = $r.bind(this), this._onPointerDown = Kr.bind(this), this._onPointerHover = qr.bind(this), this._onPointerMove = Qr.bind(this), this._onPointerUp = Jr.bind(this), t !== null && this.connect();
5807
5808
  }
5808
5809
  connect() {
5809
5810
  this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
@@ -5940,7 +5941,7 @@ function Ti(s, e, t) {
5940
5941
  return i[n];
5941
5942
  return !1;
5942
5943
  }
5943
- const $t = new ln(), Z = new A(0, 1, 0), ks = new A(0, 0, 0), Us = new ri(), qt = new Ee(), ti = new Ee(), Re = new A(), js = new ri(), It = new A(1, 0, 0), qe = new A(0, 1, 0), Lt = new A(0, 0, 1), Kt = new A(), Pt = new A(), Dt = new A();
5944
+ const $t = new ln(), W = new A(0, 1, 0), ks = new A(0, 0, 0), Us = new ri(), qt = new Ee(), ti = new Ee(), Re = new A(), js = new ri(), It = new A(1, 0, 0), qe = new A(0, 1, 0), Lt = new A(0, 0, 1), Kt = new A(), Pt = new A(), Dt = new A();
5944
5945
  class eo extends _t {
5945
5946
  constructor(e) {
5946
5947
  super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
@@ -5986,83 +5987,83 @@ class to extends _t {
5986
5987
  p.opacity = 0.25;
5987
5988
  const m = e.clone();
5988
5989
  m.color.setHex(16776960), m.opacity = 0.25, e.clone().color.setHex(16776960);
5989
- const E = e.clone();
5990
- E.color.setHex(7895160);
5991
- const O = new _e(0, 0.04, 0.1, 12);
5992
- O.translate(0, 0.05, 0);
5993
- const T = new he(0.08, 0.08, 0.08);
5994
- T.translate(0, 0.04, 0);
5990
+ const S = e.clone();
5991
+ S.color.setHex(7895160);
5992
+ const T = new _e(0, 0.04, 0.1, 12);
5993
+ T.translate(0, 0.05, 0);
5994
+ const M = new he(0.08, 0.08, 0.08);
5995
+ M.translate(0, 0.04, 0);
5995
5996
  const f = new gt();
5996
5997
  f.setAttribute("position", new Ke([0, 0, 0, 1, 0, 0], 3));
5997
5998
  const v = new _e(75e-4, 75e-4, 0.5, 3);
5998
5999
  v.translate(0, 0.25, 0);
5999
- function C(W, Ue) {
6000
- const ce = new bt(W, 75e-4, 3, 64, Ue * Math.PI * 2);
6000
+ function E(G, Ue) {
6001
+ const ce = new bt(G, 75e-4, 3, 64, Ue * Math.PI * 2);
6001
6002
  return ce.rotateY(Math.PI / 2), ce.rotateX(Math.PI / 2), ce;
6002
6003
  }
6003
6004
  function b() {
6004
- const W = new gt();
6005
- return W.setAttribute("position", new Ke([0, 0, 0, 1, 1, 1], 3)), W;
6005
+ const G = new gt();
6006
+ return G.setAttribute("position", new Ke([0, 0, 0, 1, 1, 1], 3)), G;
6006
6007
  }
6007
- const S = {
6008
+ const C = {
6008
6009
  X: [
6009
- [new M(O, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
6010
- [new M(O, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
6011
- [new M(v, r), [0, 0, 0], [0, 0, -Math.PI / 2]]
6010
+ [new O(T, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
6011
+ [new O(T, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
6012
+ [new O(v, r), [0, 0, 0], [0, 0, -Math.PI / 2]]
6012
6013
  ],
6013
6014
  Y: [
6014
- [new M(O, a), [0, 0.5, 0]],
6015
- [new M(O, a), [0, -0.5, 0], [Math.PI, 0, 0]],
6016
- [new M(v, a)]
6015
+ [new O(T, a), [0, 0.5, 0]],
6016
+ [new O(T, a), [0, -0.5, 0], [Math.PI, 0, 0]],
6017
+ [new O(v, a)]
6017
6018
  ],
6018
6019
  Z: [
6019
- [new M(O, o), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
6020
- [new M(O, o), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
6021
- [new M(v, o), null, [Math.PI / 2, 0, 0]]
6020
+ [new O(T, o), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
6021
+ [new O(T, o), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
6022
+ [new O(v, o), null, [Math.PI / 2, 0, 0]]
6022
6023
  ],
6023
6024
  XYZ: [
6024
- [new M(new Bt(0.1, 0), p.clone()), [0, 0, 0]]
6025
+ [new O(new Bt(0.1, 0), p.clone()), [0, 0, 0]]
6025
6026
  ],
6026
6027
  XY: [
6027
- [new M(new he(0.15, 0.15, 0.01), d.clone()), [0.15, 0.15, 0]]
6028
+ [new O(new he(0.15, 0.15, 0.01), d.clone()), [0.15, 0.15, 0]]
6028
6029
  ],
6029
6030
  YZ: [
6030
- [new M(new he(0.15, 0.15, 0.01), c.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
6031
+ [new O(new he(0.15, 0.15, 0.01), c.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
6031
6032
  ],
6032
6033
  XZ: [
6033
- [new M(new he(0.15, 0.15, 0.01), l.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
6034
+ [new O(new he(0.15, 0.15, 0.01), l.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
6034
6035
  ]
6035
6036
  }, w = {
6036
6037
  X: [
6037
- [new M(new _e(0.2, 0, 0.6, 4), i), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
6038
- [new M(new _e(0.2, 0, 0.6, 4), i), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
6038
+ [new O(new _e(0.2, 0, 0.6, 4), i), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
6039
+ [new O(new _e(0.2, 0, 0.6, 4), i), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
6039
6040
  ],
6040
6041
  Y: [
6041
- [new M(new _e(0.2, 0, 0.6, 4), i), [0, 0.3, 0]],
6042
- [new M(new _e(0.2, 0, 0.6, 4), i), [0, -0.3, 0], [0, 0, Math.PI]]
6042
+ [new O(new _e(0.2, 0, 0.6, 4), i), [0, 0.3, 0]],
6043
+ [new O(new _e(0.2, 0, 0.6, 4), i), [0, -0.3, 0], [0, 0, Math.PI]]
6043
6044
  ],
6044
6045
  Z: [
6045
- [new M(new _e(0.2, 0, 0.6, 4), i), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
6046
- [new M(new _e(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
6046
+ [new O(new _e(0.2, 0, 0.6, 4), i), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
6047
+ [new O(new _e(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
6047
6048
  ],
6048
6049
  XYZ: [
6049
- [new M(new Bt(0.2, 0), i)]
6050
+ [new O(new Bt(0.2, 0), i)]
6050
6051
  ],
6051
6052
  XY: [
6052
- [new M(new he(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
6053
+ [new O(new he(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
6053
6054
  ],
6054
6055
  YZ: [
6055
- [new M(new he(0.2, 0.2, 0.01), i), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
6056
+ [new O(new he(0.2, 0.2, 0.01), i), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
6056
6057
  ],
6057
6058
  XZ: [
6058
- [new M(new he(0.2, 0.2, 0.01), i), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
6059
+ [new O(new he(0.2, 0.2, 0.01), i), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
6059
6060
  ]
6060
6061
  }, I = {
6061
6062
  START: [
6062
- [new M(new Bt(0.01, 2), n), null, null, null, "helper"]
6063
+ [new O(new Bt(0.01, 2), n), null, null, null, "helper"]
6063
6064
  ],
6064
6065
  END: [
6065
- [new M(new Bt(0.01, 2), n), null, null, null, "helper"]
6066
+ [new O(new Bt(0.01, 2), n), null, null, null, "helper"]
6066
6067
  ],
6067
6068
  DELTA: [
6068
6069
  [new Ie(b(), n), null, null, null, "helper"]
@@ -6078,19 +6079,19 @@ class to extends _t {
6078
6079
  ]
6079
6080
  }, U = {
6080
6081
  XYZE: [
6081
- [new M(C(0.5, 1), E), null, [0, Math.PI / 2, 0]]
6082
+ [new O(E(0.5, 1), S), null, [0, Math.PI / 2, 0]]
6082
6083
  ],
6083
6084
  X: [
6084
- [new M(C(0.5, 0.5), r)]
6085
+ [new O(E(0.5, 0.5), r)]
6085
6086
  ],
6086
6087
  Y: [
6087
- [new M(C(0.5, 0.5), a), null, [0, 0, -Math.PI / 2]]
6088
+ [new O(E(0.5, 0.5), a), null, [0, 0, -Math.PI / 2]]
6088
6089
  ],
6089
6090
  Z: [
6090
- [new M(C(0.5, 0.5), o), null, [0, Math.PI / 2, 0]]
6091
+ [new O(E(0.5, 0.5), o), null, [0, Math.PI / 2, 0]]
6091
6092
  ],
6092
6093
  E: [
6093
- [new M(C(0.75, 1), m), null, [0, Math.PI / 2, 0]]
6094
+ [new O(E(0.75, 1), m), null, [0, Math.PI / 2, 0]]
6094
6095
  ]
6095
6096
  }, K = {
6096
6097
  AXIS: [
@@ -6098,72 +6099,72 @@ class to extends _t {
6098
6099
  ]
6099
6100
  }, me = {
6100
6101
  XYZE: [
6101
- [new M(new cn(0.25, 10, 8), i)]
6102
+ [new O(new cn(0.25, 10, 8), i)]
6102
6103
  ],
6103
6104
  X: [
6104
- [new M(new bt(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
6105
+ [new O(new bt(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
6105
6106
  ],
6106
6107
  Y: [
6107
- [new M(new bt(0.5, 0.1, 4, 24), i), [0, 0, 0], [Math.PI / 2, 0, 0]]
6108
+ [new O(new bt(0.5, 0.1, 4, 24), i), [0, 0, 0], [Math.PI / 2, 0, 0]]
6108
6109
  ],
6109
6110
  Z: [
6110
- [new M(new bt(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, 0, -Math.PI / 2]]
6111
+ [new O(new bt(0.5, 0.1, 4, 24), i), [0, 0, 0], [0, 0, -Math.PI / 2]]
6111
6112
  ],
6112
6113
  E: [
6113
- [new M(new bt(0.75, 0.1, 2, 24), i)]
6114
+ [new O(new bt(0.75, 0.1, 2, 24), i)]
6114
6115
  ]
6115
6116
  }, Ae = {
6116
6117
  X: [
6117
- [new M(T, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
6118
- [new M(v, r), [0, 0, 0], [0, 0, -Math.PI / 2]],
6119
- [new M(T, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
6118
+ [new O(M, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
6119
+ [new O(v, r), [0, 0, 0], [0, 0, -Math.PI / 2]],
6120
+ [new O(M, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
6120
6121
  ],
6121
6122
  Y: [
6122
- [new M(T, a), [0, 0.5, 0]],
6123
- [new M(v, a)],
6124
- [new M(T, a), [0, -0.5, 0], [0, 0, Math.PI]]
6123
+ [new O(M, a), [0, 0.5, 0]],
6124
+ [new O(v, a)],
6125
+ [new O(M, a), [0, -0.5, 0], [0, 0, Math.PI]]
6125
6126
  ],
6126
6127
  Z: [
6127
- [new M(T, o), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
6128
- [new M(v, o), [0, 0, 0], [Math.PI / 2, 0, 0]],
6129
- [new M(T, o), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
6128
+ [new O(M, o), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
6129
+ [new O(v, o), [0, 0, 0], [Math.PI / 2, 0, 0]],
6130
+ [new O(M, o), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
6130
6131
  ],
6131
6132
  XY: [
6132
- [new M(new he(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
6133
+ [new O(new he(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
6133
6134
  ],
6134
6135
  YZ: [
6135
- [new M(new he(0.15, 0.15, 0.01), c), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
6136
+ [new O(new he(0.15, 0.15, 0.01), c), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
6136
6137
  ],
6137
6138
  XZ: [
6138
- [new M(new he(0.15, 0.15, 0.01), l), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
6139
+ [new O(new he(0.15, 0.15, 0.01), l), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
6139
6140
  ],
6140
6141
  XYZ: [
6141
- [new M(new he(0.1, 0.1, 0.1), p.clone())]
6142
+ [new O(new he(0.1, 0.1, 0.1), p.clone())]
6142
6143
  ]
6143
6144
  }, Ce = {
6144
6145
  X: [
6145
- [new M(new _e(0.2, 0, 0.6, 4), i), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
6146
- [new M(new _e(0.2, 0, 0.6, 4), i), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
6146
+ [new O(new _e(0.2, 0, 0.6, 4), i), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
6147
+ [new O(new _e(0.2, 0, 0.6, 4), i), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
6147
6148
  ],
6148
6149
  Y: [
6149
- [new M(new _e(0.2, 0, 0.6, 4), i), [0, 0.3, 0]],
6150
- [new M(new _e(0.2, 0, 0.6, 4), i), [0, -0.3, 0], [0, 0, Math.PI]]
6150
+ [new O(new _e(0.2, 0, 0.6, 4), i), [0, 0.3, 0]],
6151
+ [new O(new _e(0.2, 0, 0.6, 4), i), [0, -0.3, 0], [0, 0, Math.PI]]
6151
6152
  ],
6152
6153
  Z: [
6153
- [new M(new _e(0.2, 0, 0.6, 4), i), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
6154
- [new M(new _e(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
6154
+ [new O(new _e(0.2, 0, 0.6, 4), i), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
6155
+ [new O(new _e(0.2, 0, 0.6, 4), i), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
6155
6156
  ],
6156
6157
  XY: [
6157
- [new M(new he(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
6158
+ [new O(new he(0.2, 0.2, 0.01), i), [0.15, 0.15, 0]]
6158
6159
  ],
6159
6160
  YZ: [
6160
- [new M(new he(0.2, 0.2, 0.01), i), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
6161
+ [new O(new he(0.2, 0.2, 0.01), i), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
6161
6162
  ],
6162
6163
  XZ: [
6163
- [new M(new he(0.2, 0.2, 0.01), i), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
6164
+ [new O(new he(0.2, 0.2, 0.01), i), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
6164
6165
  ],
6165
6166
  XYZ: [
6166
- [new M(new he(0.2, 0.2, 0.2), i), [0, 0, 0]]
6167
+ [new O(new he(0.2, 0.2, 0.2), i), [0, 0, 0]]
6167
6168
  ]
6168
6169
  }, le = {
6169
6170
  X: [
@@ -6176,18 +6177,18 @@ class to extends _t {
6176
6177
  [new Ie(f, n.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
6177
6178
  ]
6178
6179
  };
6179
- function Q(W) {
6180
+ function Q(G) {
6180
6181
  const Ue = new _t();
6181
- for (const ce in W)
6182
- for (let be = W[ce].length; be--; ) {
6183
- const te = W[ce][be][0].clone(), je = W[ce][be][1], Ne = W[ce][be][2], Fe = W[ce][be][3], B = W[ce][be][4];
6184
- te.name = ce, te.tag = B, je && te.position.set(je[0], je[1], je[2]), Ne && te.rotation.set(Ne[0], Ne[1], Ne[2]), Fe && te.scale.set(Fe[0], Fe[1], Fe[2]), te.updateMatrix();
6182
+ for (const ce in G)
6183
+ for (let be = G[ce].length; be--; ) {
6184
+ const te = G[ce][be][0].clone(), je = G[ce][be][1], Ne = G[ce][be][2], Fe = G[ce][be][3], V = G[ce][be][4];
6185
+ te.name = ce, te.tag = V, je && te.position.set(je[0], je[1], je[2]), Ne && te.rotation.set(Ne[0], Ne[1], Ne[2]), Fe && te.scale.set(Fe[0], Fe[1], Fe[2]), te.updateMatrix();
6185
6186
  const re = te.geometry.clone();
6186
6187
  re.applyMatrix4(te.matrix), te.geometry = re, te.renderOrder = 1 / 0, te.position.set(0, 0, 0), te.rotation.set(0, 0, 0), te.scale.set(1, 1, 1), Ue.add(te);
6187
6188
  }
6188
6189
  return Ue;
6189
6190
  }
6190
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = Q(S)), this.add(this.gizmo.rotate = Q(U)), this.add(this.gizmo.scale = Q(Ae)), this.add(this.picker.translate = Q(w)), this.add(this.picker.rotate = Q(me)), this.add(this.picker.scale = Q(Ce)), this.add(this.helper.translate = Q(I)), this.add(this.helper.rotate = Q(K)), this.add(this.helper.scale = Q(le)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
6191
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = Q(C)), this.add(this.gizmo.rotate = Q(U)), this.add(this.gizmo.scale = Q(Ae)), this.add(this.picker.translate = Q(w)), this.add(this.picker.rotate = Q(me)), this.add(this.picker.scale = Q(Ce)), this.add(this.helper.translate = Q(I)), this.add(this.helper.rotate = Q(K)), this.add(this.helper.scale = Q(le)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
6191
6192
  }
6192
6193
  // updateMatrixWorld will update transformations and appearance of individual handles
6193
6194
  updateMatrixWorld(e) {
@@ -6200,17 +6201,17 @@ class to extends _t {
6200
6201
  a.visible = !0, a.rotation.set(0, 0, 0), a.position.copy(this.worldPosition);
6201
6202
  let o;
6202
6203
  if (this.camera.isOrthographicCamera ? o = (this.camera.top - this.camera.bottom) / this.camera.zoom : o = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), a.scale.set(1, 1, 1).multiplyScalar(o * this.size / 4), a.tag === "helper") {
6203
- a.visible = !1, a.name === "AXIS" ? (a.visible = !!this.axis, this.axis === "X" && ($.setFromEuler($t.set(0, 0, 0)), a.quaternion.copy(i).multiply($), Math.abs(Z.copy(It).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Y" && ($.setFromEuler($t.set(0, 0, Math.PI / 2)), a.quaternion.copy(i).multiply($), Math.abs(Z.copy(qe).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Z" && ($.setFromEuler($t.set(0, Math.PI / 2, 0)), a.quaternion.copy(i).multiply($), Math.abs(Z.copy(Lt).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "XYZE" && ($.setFromEuler($t.set(0, Math.PI / 2, 0)), Z.copy(this.rotationAxis), a.quaternion.setFromRotationMatrix(Us.lookAt(ks, Z, qe)), a.quaternion.multiply($), a.visible = this.dragging), this.axis === "E" && (a.visible = !1)) : a.name === "START" ? (a.position.copy(this.worldPositionStart), a.visible = this.dragging) : a.name === "END" ? (a.position.copy(this.worldPosition), a.visible = this.dragging) : a.name === "DELTA" ? (a.position.copy(this.worldPositionStart), a.quaternion.copy(this.worldQuaternionStart), de.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), de.applyQuaternion(this.worldQuaternionStart.clone().invert()), a.scale.copy(de), a.visible = this.dragging) : (a.quaternion.copy(i), this.dragging ? a.position.copy(this.worldPositionStart) : a.position.copy(this.worldPosition), this.axis && (a.visible = this.axis.search(a.name) !== -1));
6204
+ a.visible = !1, a.name === "AXIS" ? (a.visible = !!this.axis, this.axis === "X" && ($.setFromEuler($t.set(0, 0, 0)), a.quaternion.copy(i).multiply($), Math.abs(W.copy(It).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Y" && ($.setFromEuler($t.set(0, 0, Math.PI / 2)), a.quaternion.copy(i).multiply($), Math.abs(W.copy(qe).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Z" && ($.setFromEuler($t.set(0, Math.PI / 2, 0)), a.quaternion.copy(i).multiply($), Math.abs(W.copy(Lt).applyQuaternion(i).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "XYZE" && ($.setFromEuler($t.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), a.quaternion.setFromRotationMatrix(Us.lookAt(ks, W, qe)), a.quaternion.multiply($), a.visible = this.dragging), this.axis === "E" && (a.visible = !1)) : a.name === "START" ? (a.position.copy(this.worldPositionStart), a.visible = this.dragging) : a.name === "END" ? (a.position.copy(this.worldPosition), a.visible = this.dragging) : a.name === "DELTA" ? (a.position.copy(this.worldPositionStart), a.quaternion.copy(this.worldQuaternionStart), de.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), de.applyQuaternion(this.worldQuaternionStart.clone().invert()), a.scale.copy(de), a.visible = this.dragging) : (a.quaternion.copy(i), this.dragging ? a.position.copy(this.worldPositionStart) : a.position.copy(this.worldPosition), this.axis && (a.visible = this.axis.search(a.name) !== -1));
6204
6205
  continue;
6205
6206
  }
6206
- a.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (a.name === "X" && Math.abs(Z.copy(It).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Y" && Math.abs(Z.copy(qe).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Z" && Math.abs(Z.copy(Lt).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XY" && Math.abs(Z.copy(Lt).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "YZ" && Math.abs(Z.copy(It).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XZ" && Math.abs(Z.copy(qe).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1)) : this.mode === "rotate" && (qt.copy(i), Z.copy(this.eye).applyQuaternion($.copy(i).invert()), a.name.search("E") !== -1 && a.quaternion.setFromRotationMatrix(Us.lookAt(this.eye, ks, qe)), a.name === "X" && ($.setFromAxisAngle(It, Math.atan2(-Z.y, Z.z)), $.multiplyQuaternions(qt, $), a.quaternion.copy($)), a.name === "Y" && ($.setFromAxisAngle(qe, Math.atan2(Z.x, Z.z)), $.multiplyQuaternions(qt, $), a.quaternion.copy($)), a.name === "Z" && ($.setFromAxisAngle(Lt, Math.atan2(Z.y, Z.x)), $.multiplyQuaternions(qt, $), a.quaternion.copy($))), a.visible = a.visible && (a.name.indexOf("X") === -1 || this.showX), a.visible = a.visible && (a.name.indexOf("Y") === -1 || this.showY), a.visible = a.visible && (a.name.indexOf("Z") === -1 || this.showZ), a.visible = a.visible && (a.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), a.material._color = a.material._color || a.material.color.clone(), a.material._opacity = a.material._opacity || a.material.opacity, a.material.color.copy(a.material._color), a.material.opacity = a.material._opacity, this.enabled && this.axis && (a.name === this.axis || this.axis.split("").some(function(c) {
6207
+ a.quaternion.copy(i), this.mode === "translate" || this.mode === "scale" ? (a.name === "X" && Math.abs(W.copy(It).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Y" && Math.abs(W.copy(qe).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Z" && Math.abs(W.copy(Lt).applyQuaternion(i).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XY" && Math.abs(W.copy(Lt).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "YZ" && Math.abs(W.copy(It).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XZ" && Math.abs(W.copy(qe).applyQuaternion(i).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1)) : this.mode === "rotate" && (qt.copy(i), W.copy(this.eye).applyQuaternion($.copy(i).invert()), a.name.search("E") !== -1 && a.quaternion.setFromRotationMatrix(Us.lookAt(this.eye, ks, qe)), a.name === "X" && ($.setFromAxisAngle(It, Math.atan2(-W.y, W.z)), $.multiplyQuaternions(qt, $), a.quaternion.copy($)), a.name === "Y" && ($.setFromAxisAngle(qe, Math.atan2(W.x, W.z)), $.multiplyQuaternions(qt, $), a.quaternion.copy($)), a.name === "Z" && ($.setFromAxisAngle(Lt, Math.atan2(W.y, W.x)), $.multiplyQuaternions(qt, $), a.quaternion.copy($))), a.visible = a.visible && (a.name.indexOf("X") === -1 || this.showX), a.visible = a.visible && (a.name.indexOf("Y") === -1 || this.showY), a.visible = a.visible && (a.name.indexOf("Z") === -1 || this.showZ), a.visible = a.visible && (a.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), a.material._color = a.material._color || a.material.color.clone(), a.material._opacity = a.material._opacity || a.material.opacity, a.material.color.copy(a.material._color), a.material.opacity = a.material._opacity, this.enabled && this.axis && (a.name === this.axis || this.axis.split("").some(function(c) {
6207
6208
  return a.name === c;
6208
6209
  })) && (a.material.color.setHex(16776960), a.material.opacity = 1);
6209
6210
  }
6210
6211
  super.updateMatrixWorld(e);
6211
6212
  }
6212
6213
  }
6213
- class io extends M {
6214
+ class io extends O {
6214
6215
  constructor() {
6215
6216
  super(
6216
6217
  new on(1e5, 1e5, 2, 2),
@@ -6219,18 +6220,18 @@ class io extends M {
6219
6220
  }
6220
6221
  updateMatrixWorld(e) {
6221
6222
  let t = this.space;
6222
- switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Kt.copy(It).applyQuaternion(t === "local" ? this.worldQuaternion : ti), Pt.copy(qe).applyQuaternion(t === "local" ? this.worldQuaternion : ti), Dt.copy(Lt).applyQuaternion(t === "local" ? this.worldQuaternion : ti), Z.copy(Pt), this.mode) {
6223
+ switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), Kt.copy(It).applyQuaternion(t === "local" ? this.worldQuaternion : ti), Pt.copy(qe).applyQuaternion(t === "local" ? this.worldQuaternion : ti), Dt.copy(Lt).applyQuaternion(t === "local" ? this.worldQuaternion : ti), W.copy(Pt), this.mode) {
6223
6224
  case "translate":
6224
6225
  case "scale":
6225
6226
  switch (this.axis) {
6226
6227
  case "X":
6227
- Z.copy(this.eye).cross(Kt), Re.copy(Kt).cross(Z);
6228
+ W.copy(this.eye).cross(Kt), Re.copy(Kt).cross(W);
6228
6229
  break;
6229
6230
  case "Y":
6230
- Z.copy(this.eye).cross(Pt), Re.copy(Pt).cross(Z);
6231
+ W.copy(this.eye).cross(Pt), Re.copy(Pt).cross(W);
6231
6232
  break;
6232
6233
  case "Z":
6233
- Z.copy(this.eye).cross(Dt), Re.copy(Dt).cross(Z);
6234
+ W.copy(this.eye).cross(Dt), Re.copy(Dt).cross(W);
6234
6235
  break;
6235
6236
  case "XY":
6236
6237
  Re.copy(Dt);
@@ -6239,7 +6240,7 @@ class io extends M {
6239
6240
  Re.copy(Kt);
6240
6241
  break;
6241
6242
  case "XZ":
6242
- Z.copy(Dt), Re.copy(Pt);
6243
+ W.copy(Dt), Re.copy(Pt);
6243
6244
  break;
6244
6245
  case "XYZ":
6245
6246
  case "E":
@@ -6251,7 +6252,7 @@ class io extends M {
6251
6252
  default:
6252
6253
  Re.set(0, 0, 0);
6253
6254
  }
6254
- Re.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (js.lookAt(de.set(0, 0, 0), Re, Z), this.quaternion.setFromRotationMatrix(js)), super.updateMatrixWorld(e);
6255
+ Re.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (js.lookAt(de.set(0, 0, 0), Re, W), this.quaternion.setFromRotationMatrix(js)), super.updateMatrixWorld(e);
6255
6256
  }
6256
6257
  }
6257
6258
  class ge extends Ys {
@@ -6346,7 +6347,7 @@ class Ns extends _t {
6346
6347
  group;
6347
6348
  constructor(e, t) {
6348
6349
  const i = new et(ot(0.5, 1, Math.random()), ot(0.5, 1, Math.random()), ot(0.5, 1, Math.random()));
6349
- super(), this.name = e, this.lineMaterial = new Fi({ color: i }), this.line = new Ie(new gt(), this.lineMaterial), this.line.name = "line", this.add(this.line), this._camera = t, this.curveType = "catmullrom", this.draggedMat.color = i, this.draggable = new _t(), this.draggable.name = "draggablePoints", this.add(this.draggable), this.curvePos = new M(new cn(1.5), new Je({ color: i })), this.curvePos.name = "curvePos", this.curvePos.scale.setScalar(this._draggableScale), this.curvePos.visible = !1, this.add(this.curvePos), this.raycaster = new ii(), this.raycaster.params.Line.threshold = 3, this.enable();
6350
+ super(), this.name = e, this.lineMaterial = new Fi({ color: i }), this.line = new Ie(new gt(), this.lineMaterial), this.line.name = "line", this.add(this.line), this._camera = t, this.curveType = "catmullrom", this.draggedMat.color = i, this.draggable = new _t(), this.draggable.name = "draggablePoints", this.add(this.draggable), this.curvePos = new O(new cn(1.5), new Je({ color: i })), this.curvePos.name = "curvePos", this.curvePos.scale.setScalar(this._draggableScale), this.curvePos.visible = !1, this.add(this.curvePos), this.raycaster = new ii(), this.raycaster.params.Line.threshold = 3, this.enable();
6350
6351
  }
6351
6352
  enable() {
6352
6353
  document.addEventListener("pointerdown", this.onMouseClick);
@@ -6387,7 +6388,7 @@ class Ns extends _t {
6387
6388
  this.addPoint(new A(-50, 0, 0), !1), this.addPoint(new A(50, 0, 0));
6388
6389
  };
6389
6390
  addPoint = (e, t = !0) => {
6390
- const i = this.draggable.children.length, n = new M(so, this.draggedMat);
6391
+ const i = this.draggable.children.length, n = new O(so, this.draggedMat);
6391
6392
  return n.name = `point_${i}`, n.position.copy(e), n.scale.setScalar(this._draggableScale), this.draggable.add(n), t && this.updateSpline(), n;
6392
6393
  };
6393
6394
  addNextPt = () => {
@@ -7218,7 +7219,7 @@ class pe extends jt {
7218
7219
  if (this.currentCamera.name === "UI")
7219
7220
  return;
7220
7221
  const t = this.controls.get(this.currentCamera.name);
7221
- e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof M || this.selectedItem instanceof pa ? (this.selectedItem.geometry.computeBoundingBox(), this.cameraControls.fitToBox(this.selectedItem.geometry.boundingBox, !0)) : this.cameraControls.fitToSphere(this.selectedItem, !0), this.updateCameraControls(t, !0)) : e.key === "1" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(0, Math.PI * 0.5, !0), this.cameraControls.moveTo(this.selectedItem.position.x, this.selectedItem.position.y, 0, !0), this.updateCameraControls(t)) : e.key === "2" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(0, 0, !0), this.cameraControls.moveTo(this.selectedItem.position.x, 0, this.selectedItem.position.z, !0), this.updateCameraControls(t)) : e.key === "3" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Math.PI / 2, Math.PI / 2, !0), this.cameraControls.moveTo(0, this.selectedItem.position.y, this.selectedItem.position.z, !0), this.updateCameraControls(t)) : e.key === "4" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Math.PI, Math.PI / 2, !0), this.cameraControls.moveTo(this.selectedItem.position.x, this.selectedItem.position.y, 0, !0), this.updateCameraControls(t)) : e.key === "5" && (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(ki(45), ki(45), !0), this.updateCameraControls(t));
7222
+ e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof O || this.selectedItem instanceof pa ? (this.selectedItem.geometry.computeBoundingBox(), this.cameraControls.fitToBox(this.selectedItem.geometry.boundingBox, !0)) : this.cameraControls.fitToSphere(this.selectedItem, !0), this.updateCameraControls(t, !0)) : e.key === "1" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(0, Math.PI * 0.5, !0), this.cameraControls.moveTo(this.selectedItem.position.x, this.selectedItem.position.y, 0, !0), this.updateCameraControls(t)) : e.key === "2" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(0, 0, !0), this.cameraControls.moveTo(this.selectedItem.position.x, 0, this.selectedItem.position.z, !0), this.updateCameraControls(t)) : e.key === "3" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Math.PI / 2, Math.PI / 2, !0), this.cameraControls.moveTo(0, this.selectedItem.position.y, this.selectedItem.position.z, !0), this.updateCameraControls(t)) : e.key === "4" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Math.PI, Math.PI / 2, !0), this.cameraControls.moveTo(this.selectedItem.position.x, this.selectedItem.position.y, 0, !0), this.updateCameraControls(t)) : e.key === "5" && (e.preventDefault(), this.clearControls(), this.cameraControls = new ke(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(ki(45), ki(45), !0), this.updateCameraControls(t));
7222
7223
  } else if (this.currentTransform !== void 0)
7223
7224
  switch (e.key) {
7224
7225
  case "r":
@@ -7548,8 +7549,8 @@ function oo(s, e) {
7548
7549
  e.updateObject(s.uuid, l, p);
7549
7550
  const m = e.getScene(s.uuid);
7550
7551
  if (m !== null) {
7551
- const _ = m.getObjectByProperty("uuid", s.uuid);
7552
- ee(_, l, p);
7552
+ const g = m.getObjectByProperty("uuid", s.uuid);
7553
+ ee(g, l, p);
7553
7554
  }
7554
7555
  }
7555
7556
  }) : a.push({
@@ -7627,30 +7628,30 @@ function lo(s) {
7627
7628
  if (p !== null) {
7628
7629
  const m = p.getObjectByProperty("uuid", e.uuid);
7629
7630
  if (m !== void 0) {
7630
- const _ = m.mixer;
7631
- if (_ !== void 0) {
7632
- const O = [
7631
+ const g = m.mixer;
7632
+ if (g !== void 0) {
7633
+ const T = [
7633
7634
  {
7634
7635
  title: "Time Scale",
7635
7636
  type: "range",
7636
- value: _.timeScale,
7637
+ value: g.timeScale,
7637
7638
  step: 0.01,
7638
7639
  min: -1,
7639
7640
  max: 2,
7640
- onChange: (T, f) => {
7641
- _.timeScale = f, t.updateObject(e.uuid, "mixer.timeScale", f);
7641
+ onChange: (M, f) => {
7642
+ g.timeScale = f, t.updateObject(e.uuid, "mixer.timeScale", f);
7642
7643
  }
7643
7644
  }
7644
7645
  ];
7645
- O.push({
7646
+ T.push({
7646
7647
  title: "Stop All",
7647
7648
  type: "button",
7648
7649
  onChange: () => {
7649
- _.stopAllAction(), t.requestMethod(e.uuid, "stopAllAction", void 0, "mixer");
7650
+ g.stopAllAction(), t.requestMethod(e.uuid, "stopAllAction", void 0, "mixer");
7650
7651
  }
7651
7652
  }), o.push({
7652
7653
  title: "Mixer",
7653
- items: O
7654
+ items: T
7654
7655
  }), d = new Ca(m), pe.instance?.scene.add(d);
7655
7656
  }
7656
7657
  }
@@ -7684,7 +7685,7 @@ const ji = {
7684
7685
  };
7685
7686
  let oe = { ...ji };
7686
7687
  function co(s) {
7687
- const [e, t] = X(-1);
7688
+ const [e, t] = B(-1);
7688
7689
  tt(() => {
7689
7690
  function a(c) {
7690
7691
  oe = { ...c.value }, t(Date.now());
@@ -7967,57 +7968,70 @@ class ho extends jt {
7967
7968
  }
7968
7969
  }
7969
7970
  function uo(s) {
7970
- const [e] = X([]), [t] = X([]), [i, n] = X(0), r = (c) => {
7971
- const l = c.value;
7972
- e.push(l), t.push(
7971
+ const [e] = B([]), [t] = B([]), [i, n] = B(0), r = (d) => {
7972
+ const p = d.value;
7973
+ e.push(p), t.push(
7973
7974
  /* @__PURE__ */ u.jsx(
7974
7975
  ni,
7975
7976
  {
7976
- label: `Scene: ${l.name}`,
7977
- scene: l,
7977
+ label: `Scene: ${p.name}`,
7978
+ scene: p,
7978
7979
  open: !0,
7979
7980
  onRefresh: () => {
7980
- s.three.refreshScene(l.name);
7981
+ s.three.refreshScene(p.name);
7981
7982
  },
7982
- children: /* @__PURE__ */ u.jsx(fs, { child: l, scene: l, three: s.three })
7983
+ children: /* @__PURE__ */ u.jsx(fs, { child: p, scene: p, three: s.three })
7983
7984
  },
7984
7985
  Math.random()
7985
7986
  )
7986
7987
  ), n(Date.now());
7987
- }, a = (c) => {
7988
- const l = c.value;
7989
- for (let d = 0; d < e.length; d++)
7990
- if (l.uuid === e[d].uuid) {
7991
- e[d] = l, t[d] = /* @__PURE__ */ u.jsx(
7988
+ }, a = (d) => {
7989
+ const p = d.value;
7990
+ for (let m = 0; m < e.length; m++)
7991
+ if (p.uuid === e[m].uuid) {
7992
+ e[m] = p, t[m] = /* @__PURE__ */ u.jsx(
7992
7993
  ni,
7993
7994
  {
7994
- label: `Scene: ${l.name}`,
7995
- scene: l,
7995
+ label: `Scene: ${p.name}`,
7996
+ scene: p,
7996
7997
  open: !0,
7997
7998
  onRefresh: () => {
7998
- s.three.refreshScene(l.name);
7999
+ s.three.refreshScene(p.name);
7999
8000
  },
8000
- children: /* @__PURE__ */ u.jsx(fs, { child: l, scene: l, three: s.three })
8001
+ children: /* @__PURE__ */ u.jsx(fs, { child: p, scene: p, three: s.three })
8001
8002
  },
8002
8003
  Math.random()
8003
8004
  ), n(Date.now());
8004
8005
  return;
8005
8006
  }
8006
- }, o = (c) => {
8007
- const l = c.value;
8008
- for (let d = 0; d < e.length; d++)
8009
- if (l.uuid === e[d].uuid) {
8010
- e.splice(d, 1), t.splice(d, 1), n(Date.now());
8007
+ }, o = (d) => {
8008
+ const p = d.value;
8009
+ for (let m = 0; m < e.length; m++)
8010
+ if (p.uuid === e[m].uuid) {
8011
+ e.splice(m, 1), t.splice(m, 1), n(Date.now());
8011
8012
  return;
8012
8013
  }
8013
8014
  };
8014
- return tt(() => (D.addEventListener(P.ADD_SCENE, r), D.addEventListener(P.REFRESH_SCENE, a), D.addEventListener(P.REMOVE_SCENE, o), () => {
8015
+ tt(() => (D.addEventListener(P.ADD_SCENE, r), D.addEventListener(P.REFRESH_SCENE, a), D.addEventListener(P.REMOVE_SCENE, o), () => {
8015
8016
  D.removeEventListener(P.ADD_SCENE, r), D.removeEventListener(P.REFRESH_SCENE, a), D.removeEventListener(P.REMOVE_SCENE, o);
8016
- }), []), /* @__PURE__ */ u.jsxs("div", { id: "SidePanel", children: [
8017
+ }), []);
8018
+ const [c, l] = B(0);
8019
+ return /* @__PURE__ */ u.jsxs("div", { id: "SidePanel", children: [
8017
8020
  /* @__PURE__ */ u.jsx("div", { className: "scenes", children: t }, i),
8018
8021
  /* @__PURE__ */ u.jsx(co, { three: s.three }),
8019
8022
  /* @__PURE__ */ u.jsx(ho, { three: s.three }),
8020
- /* @__PURE__ */ u.jsx(se, { three: s.three })
8023
+ /* @__PURE__ */ u.jsx(se, { three: s.three }),
8024
+ /* @__PURE__ */ u.jsx(
8025
+ "input",
8026
+ {
8027
+ type: "number",
8028
+ value: c,
8029
+ onChange: (d) => {
8030
+ const p = d.target.value;
8031
+ console.log(`Value: ${p}, Length: ${p.length}, #${Number(p)}`), l(p);
8032
+ }
8033
+ }
8034
+ )
8021
8035
  ] });
8022
8036
  }
8023
8037
  function To(s) {
@@ -8041,22 +8055,22 @@ function To(s) {
8041
8055
  const c = o.value, d = e(c.uuid)?.getObjectByProperty("uuid", c.uuid);
8042
8056
  if (d !== void 0) {
8043
8057
  const p = (m) => {
8044
- const _ = c.key.split(".");
8045
- switch (_.length) {
8058
+ const g = c.key.split(".");
8059
+ switch (g.length) {
8046
8060
  case 1:
8047
- d[_[0]] = m;
8061
+ d[g[0]] = m;
8048
8062
  break;
8049
8063
  case 2:
8050
- d[_[0]][_[1]] = m;
8064
+ d[g[0]][g[1]] = m;
8051
8065
  break;
8052
8066
  case 3:
8053
- d[_[0]][_[1]][_[2]] = m;
8067
+ d[g[0]][g[1]][g[2]] = m;
8054
8068
  break;
8055
8069
  case 4:
8056
- d[_[0]][_[1]][_[2]][_[3]] = m;
8070
+ d[g[0]][g[1]][g[2]][g[3]] = m;
8057
8071
  break;
8058
8072
  case 5:
8059
- d[_[0]][_[1]][_[2]][_[3]][_[4]] = m;
8073
+ d[g[0]][g[1]][g[2]][g[3]][g[4]] = m;
8060
8074
  break;
8061
8075
  }
8062
8076
  d.material.needsUpdate = !0;
@@ -8066,12 +8080,12 @@ function To(s) {
8066
8080
  }) : p(null);
8067
8081
  }
8068
8082
  }, a = (o) => {
8069
- const { key: c, uuid: l, value: d, subitem: p } = o.value, _ = e(l)?.getObjectByProperty("uuid", l);
8070
- if (_ !== void 0)
8083
+ const { key: c, uuid: l, value: d, subitem: p } = o.value, g = e(l)?.getObjectByProperty("uuid", l);
8084
+ if (g !== void 0)
8071
8085
  try {
8072
- p !== void 0 ? Za(_, p)[c](d) : _[c](d);
8073
- } catch (E) {
8074
- console.log("Error requesting method:"), console.log(E), console.log(c), console.log(d);
8086
+ p !== void 0 ? Za(g, p)[c](d) : g[c](d);
8087
+ } catch (S) {
8088
+ console.log("Error requesting method:"), console.log(S), console.log(c), console.log(d);
8075
8089
  }
8076
8090
  };
8077
8091
  return D.addEventListener(P.GET_OBJECT, t), D.addEventListener(P.UPDATE_OBJECT, n), D.addEventListener(P.CREATE_TEXTURE, r), D.addEventListener(P.REQUEST_METHOD, a), () => {