@needle-tools/engine 4.8.8-next.e4d7577 → 4.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { Vector2 as J, Vector3 as b, Vector4 as de, Quaternion as N, PlaneGeometry as Un, WebGLRenderer as ur, PerspectiveCamera as pe, OrthographicCamera as Td, Scene as gi, Mesh as H, Texture as Te, Uniform$1 as zi, Color as se, ShaderMaterial as Ln, Box3 as pi, ShadowMaterial as ob, Euler as Rt, MeshStandardMaterial as ct, Box3Helper as Ww, GridHelper as am, Object3D as M, Material as _e, Matrix3 as rb, Matrix4 as te, Layers as ao, Ray as lo, MathUtils as gs, AxesHelper as mi, MeshBasicMaterial as we, DoubleSide as yi, BufferGeometry as Tn, Group as io, CylinderGeometry as ab, SphereGeometry as Ed, BoxGeometry as la, SpriteMaterial as Vw, Sprite as Hw, Shape as Gw, ExtrudeGeometry as qw, Fog as lb, DirectionalLight as ip, PointLight as lm, EdgesGeometry as Xw, LineSegments as cb, LineBasicMaterial as hb, Line as Zl, BufferAttribute as ht, Raycaster as Ad, Sphere as Id, ArrayCamera as Qw, Plane as nr, SkinnedMesh as ys, InterleavedBufferAttribute as db, Skeleton as Yw, Bone as Kw, Source as Zw, WebGLCubeRenderTarget as Jw, CubeCamera as ex, AnimationClip as no, FileLoader as cm, TextureLoader as Jl, PropertyBinding as ca, LinearSRGBColorSpace as Ss, ShaderChunk as Wt, UniformsLib as tx, DataTexture as hm, RGBAFormat as Ld, EquirectangularReflectionMapping as _s, SRGBColorSpace as Cs, Clock as ix, NeutralToneMapping as ha, AgXToneMapping as Dd, ACESFilmicToneMapping as jd, NoToneMapping as Gh, PCFSoftShadowMap$1 as nx, BasicNodeLibrary as sx, WebGLRenderTarget as Dn, DepthTexture as ub, NearestFilter as qh, LoopRepeat as ox, LoopOnce as np, AnimationMixer as dm, CompressedTexture as rx, FrontSide as co, Camera as ax, Frustum as Gg, AudioListener as lx, PositionalAudio as cx, AudioLoader as sp, EventDispatcher as um, BackSide as Bd, MeshDepthMaterial as hx, CustomBlending as dx, MaxEquation as ux, AmbientLight as fx, HemisphereLight as px, AlwaysStencilFunc as mx, GreaterEqualStencilFunc as gx, NotEqualStencilFunc as yx, GreaterStencilFunc as _x, LessEqualStencilFunc as bx, EqualStencilFunc as vx, LessStencilFunc as wx, NeverStencilFunc as qg, InvertStencilOp as xx, DecrementWrapStencilOp as Sx, IncrementWrapStencilOp as Cx, DecrementStencilOp as Px, IncrementStencilOp as Ox, ReplaceStencilOp as kx, ZeroStencilOp as Mx, KeepStencilOp as Rx, RawShaderMaterial as fb, GLSL3 as Tx, AlwaysDepth as Ex, GreaterEqualDepth as Ax, GreaterDepth as Ix, LessEqualDepth as Lx, LessDepth as Dx, NotEqualDepth as jx, EqualDepth as Bx, BatchedMesh as Xg, MeshPhysicalMaterial as op, LinearFilter as Xh, UnsignedByteType as Fx, RingGeometry as zx, Line3 as Ux, AdditiveBlending as pb, BoxHelper as Nx, SpotLight as $x, DirectionalLightHelper as Wx, CameraHelper as Vx, LOD as Hx, Triangle as Gx, NormalBlending as qx, ReinhardToneMapping as fm, LinearToneMapping as pm, HalfFloatType as Vu, VideoTexture as Xx, CubeUVReflectionMapping as mb, CubeTexture as Qx, CompressedCubeTexture as Yx, EquirectangularRefractionMapping as Kx, VectorKeyframeTrack as Zx, QuaternionKeyframeTrack as Jx, Audio as eS, ShaderLib as Qh, UniformsUtils as gb, MirroredRepeatWrapping as Qg, MeshNormalMaterial as tS, AudioContext as iS, PMREMGenerator$1 as nS } from "./three-BRSLmpyi.js";
1
+ import { Vector2 as J, Vector3 as b, Vector4 as de, Quaternion as $, PlaneGeometry as Un, WebGLRenderer as ur, PerspectiveCamera as pe, OrthographicCamera as Td, Scene as gi, Mesh as H, Texture as Te, Uniform$1 as zi, Color as se, ShaderMaterial as Ln, Box3 as pi, ShadowMaterial as ob, Euler as Rt, MeshStandardMaterial as ct, Box3Helper as Ww, GridHelper as am, Object3D as M, Material as _e, Matrix3 as rb, Matrix4 as te, Layers as ao, Ray as lo, MathUtils as gs, AxesHelper as mi, MeshBasicMaterial as we, DoubleSide as yi, BufferGeometry as Tn, Group as io, CylinderGeometry as ab, SphereGeometry as Ed, BoxGeometry as la, SpriteMaterial as Vw, Sprite as Hw, Shape as Gw, ExtrudeGeometry as qw, Fog as lb, DirectionalLight as ip, PointLight as lm, EdgesGeometry as Xw, LineSegments as cb, LineBasicMaterial as hb, Line as Zl, BufferAttribute as ht, Raycaster as Ad, Sphere as Id, ArrayCamera as Qw, Plane as nr, SkinnedMesh as ys, InterleavedBufferAttribute as db, Skeleton as Yw, Bone as Kw, Source as Zw, WebGLCubeRenderTarget as Jw, CubeCamera as ex, AnimationClip as no, FileLoader as cm, TextureLoader as Jl, PropertyBinding as ca, LinearSRGBColorSpace as Ss, ShaderChunk as Wt, UniformsLib as tx, DataTexture as hm, RGBAFormat as Ld, EquirectangularReflectionMapping as _s, SRGBColorSpace as Cs, Clock as ix, NeutralToneMapping as ha, AgXToneMapping as Dd, ACESFilmicToneMapping as jd, NoToneMapping as Gh, PCFSoftShadowMap$1 as nx, BasicNodeLibrary as sx, WebGLRenderTarget as Dn, DepthTexture as ub, NearestFilter as qh, LoopRepeat as ox, LoopOnce as np, AnimationMixer as dm, CompressedTexture as rx, FrontSide as co, Camera as ax, Frustum as Gg, AudioListener as lx, PositionalAudio as cx, AudioLoader as sp, EventDispatcher as um, BackSide as Bd, MeshDepthMaterial as hx, CustomBlending as dx, MaxEquation as ux, AmbientLight as fx, HemisphereLight as px, AlwaysStencilFunc as mx, GreaterEqualStencilFunc as gx, NotEqualStencilFunc as yx, GreaterStencilFunc as _x, LessEqualStencilFunc as bx, EqualStencilFunc as vx, LessStencilFunc as wx, NeverStencilFunc as qg, InvertStencilOp as xx, DecrementWrapStencilOp as Sx, IncrementWrapStencilOp as Cx, DecrementStencilOp as Px, IncrementStencilOp as Ox, ReplaceStencilOp as kx, ZeroStencilOp as Mx, KeepStencilOp as Rx, RawShaderMaterial as fb, GLSL3 as Tx, AlwaysDepth as Ex, GreaterEqualDepth as Ax, GreaterDepth as Ix, LessEqualDepth as Lx, LessDepth as Dx, NotEqualDepth as jx, EqualDepth as Bx, BatchedMesh as Xg, MeshPhysicalMaterial as op, LinearFilter as Xh, UnsignedByteType as Fx, RingGeometry as zx, Line3 as Ux, AdditiveBlending as pb, BoxHelper as Nx, SpotLight as $x, DirectionalLightHelper as Wx, CameraHelper as Vx, LOD as Hx, Triangle as Gx, NormalBlending as qx, ReinhardToneMapping as fm, LinearToneMapping as pm, HalfFloatType as Vu, VideoTexture as Xx, CubeUVReflectionMapping as mb, CubeTexture as Qx, CompressedCubeTexture as Yx, EquirectangularRefractionMapping as Kx, VectorKeyframeTrack as Zx, QuaternionKeyframeTrack as Jx, Audio as eS, ShaderLib as Qh, UniformsUtils as gb, MirroredRepeatWrapping as Qg, MeshNormalMaterial as tS, AudioContext as iS, PMREMGenerator$1 as nS } from "./three-BRSLmpyi.js";
2
2
  import { createLoaders as mm, getRaycastMesh as yb, LODsManager as Ao, NEEDLE_progressive as We, addDracoAndKTX2Loaders as sS, configureLoader as oS, setKTX2TranscoderLocation as rS, setDracoDecoderLocation as aS } from "./gltf-progressive-BcHT3Nyo.js";
3
3
  import { GroundedSkybox as da, Font as lS, TextGeometry as cS, FontLoader as hS, GLTFLoader as Ps, TransformControlsGizmo as _b, EXRLoader as gm, RGBELoader as bb, Stats as dS, nodeFrame as uS, OrbitControls as vb, PositionalAudioHelper as fS, HorizontalBlurShader as pS, VerticalBlurShader as mS, GLTFExporter as wb, strToU8 as xb, zipSync as gS, XRControllerModelFactory as yS, XRHandMeshModel as _S, Line2 as bS, LineGeometry as vS, LineMaterial as wS, TransformControls as xS, InteractiveGroup as SS, HTMLMesh as CS, VertexNormalsHelper as PS, OBJLoader as ym, FBXLoader as Sb, mergeVertices as OS } from "./three-examples-CNexix3E.js";
4
4
  import { fetchProfile as kS, MotionController as MS, $70d766613f57b014$export$2e2bcd8739ae039 as Yg, ByteBuffer as RS, v5 as Kg, md5 as Zg, SIZE_PREFIX_LENGTH as Cb, Builder as _m, createNoise4D as TS, Matrix4 as Hu, BatchedParticleRenderer as ES, ParticleSystem as AS, RenderMode as as, ConstantColor as IS, Vector4 as LS, ConstantValue as DS, TrailParticle as Jg, WorkerBase as jS, MeshBVH as BS } from "./vendor-Z4SPrTcP.js";
@@ -329,7 +329,7 @@ function bm(s, e) {
329
329
  s[jr] = new so(s, ["x", "y"]);
330
330
  else if (s instanceof b)
331
331
  s[jr] = new so(s, ["x", "y", "z"]);
332
- else if (s instanceof de || s instanceof N)
332
+ else if (s instanceof de || s instanceof $)
333
333
  s[jr] = new so(s, ["x", "y", "z", "w"]);
334
334
  else
335
335
  return !1;
@@ -340,12 +340,12 @@ function Rb(s, e) {
340
340
  const t = s[jr];
341
341
  t && t.unsubscribeWrite(e);
342
342
  }
343
- var q;
343
+ var X;
344
344
  ((s) => {
345
345
  let e;
346
346
  function t() {
347
347
  if (e !== void 0) return e;
348
- const V = window.navigator.userAgent, ne = /Windows|MacOS|Mac OS/.test(V), re = /Windows NT/.test(V) && /Edg/.test(V) && !/Win64/.test(V);
348
+ const W = window.navigator.userAgent, ne = /Windows|MacOS|Mac OS/.test(W), re = /Windows NT/.test(W) && /Edg/.test(W) && !/Win64/.test(W);
349
349
  return e = ne && !re && !y();
350
350
  }
351
351
  s.isDesktop = t;
@@ -379,8 +379,8 @@ var q;
379
379
  if (navigator.userAgentData)
380
380
  return f = navigator.userAgentData.platform === "macOS";
381
381
  {
382
- const V = navigator.userAgent.toLowerCase();
383
- return f = V.includes("mac os x") || V.includes("macintosh");
382
+ const W = navigator.userAgent.toLowerCase();
383
+ return f = W.includes("mac os x") || W.includes("macintosh");
384
384
  }
385
385
  }
386
386
  s.isMacOS = p;
@@ -406,69 +406,69 @@ var q;
406
406
  }
407
407
  s.isQuest = k;
408
408
  let E;
409
- function B() {
409
+ function z() {
410
410
  return E !== void 0 || (E = document.createElement("a").relList.supports("ar")), E;
411
411
  }
412
- s.supportsQuickLookAR = B;
413
- async function L() {
412
+ s.supportsQuickLookAR = z;
413
+ async function D() {
414
414
  try {
415
415
  return (await navigator.permissions.query({ name: "microphone" })).state !== "denied";
416
- } catch (V) {
417
- return console.error("Error querying `microphone` permissions.", V), !1;
416
+ } catch (W) {
417
+ return console.error("Error querying `microphone` permissions.", W), !1;
418
418
  }
419
419
  }
420
- s.microphonePermissionsGranted = L;
421
- let W;
422
- function X() {
423
- if (W !== void 0) return W;
424
- const V = navigator.userAgent.match(/iPhone OS (\d+_\d+)/);
425
- if (V && (W = V[1].replace("_", ".")), !W) {
420
+ s.microphonePermissionsGranted = D;
421
+ let V;
422
+ function q() {
423
+ if (V !== void 0) return V;
424
+ const W = navigator.userAgent.match(/iPhone OS (\d+_\d+)/);
425
+ if (W && (V = W[1].replace("_", ".")), !V) {
426
426
  const ne = navigator.userAgent.match(/(?:\(Macintosh;|iPhone;|iPad;).*Version\/(\d+\.\d+)/);
427
- ne && (W = ne[1]);
427
+ ne && (V = ne[1]);
428
428
  }
429
- return W || (W = null), W;
429
+ return V || (V = null), V;
430
430
  }
431
- s.getiOSVersion = X;
431
+ s.getiOSVersion = q;
432
432
  let A;
433
- function $() {
433
+ function U() {
434
434
  if (A !== void 0) return A;
435
- const V = navigator.userAgent.match(/(?:CriOS|Chrome)\/(\d+\.\d+\.\d+\.\d+)/);
436
- return V ? A = V[1].replace("_", ".") : A = null, A;
435
+ const W = navigator.userAgent.match(/(?:CriOS|Chrome)\/(\d+\.\d+\.\d+\.\d+)/);
436
+ return W ? A = W[1].replace("_", ".") : A = null, A;
437
437
  }
438
- s.getChromeVersion = $;
439
- })(q || (q = {}));
438
+ s.getChromeVersion = U;
439
+ })(X || (X = {}));
440
440
  function sI() {
441
- return q.isDesktop();
441
+ return X.isDesktop();
442
442
  }
443
443
  function oI() {
444
- return q.isMobileDevice();
444
+ return X.isMobileDevice();
445
445
  }
446
446
  function rI() {
447
- return q.isiPad();
447
+ return X.isiPad();
448
448
  }
449
449
  function aI() {
450
- return q.isiPad();
450
+ return X.isiPad();
451
451
  }
452
452
  function lI() {
453
- return q.isAndroidDevice();
453
+ return X.isAndroidDevice();
454
454
  }
455
455
  function cI() {
456
- return q.isMozillaXR();
456
+ return X.isMozillaXR();
457
457
  }
458
458
  function hI() {
459
- return q.isMacOS();
459
+ return X.isMacOS();
460
460
  }
461
461
  function dI() {
462
- return q.isiOS();
462
+ return X.isiOS();
463
463
  }
464
464
  function uI() {
465
- return q.isSafari();
465
+ return X.isSafari();
466
466
  }
467
467
  function fI() {
468
- return q.isQuest();
468
+ return X.isQuest();
469
469
  }
470
470
  async function pI() {
471
- return q.microphonePermissionsGranted();
471
+ return X.microphonePermissionsGranted();
472
472
  }
473
473
  const Zs = /* @__PURE__ */ new WeakMap();
474
474
  function iC(s, e, t) {
@@ -581,12 +581,12 @@ async function rC(s, e) {
581
581
  if (h) {
582
582
  const y = a.width / a.height;
583
583
  y > 1 ? _ = g / y : g = _ * y;
584
- const x = n * s.width, I = Math.max(g, _), O = Math.round(I + x), k = Math.round(I + x), E = (d.width - I) / 2, B = (d.height - I) / 2;
584
+ const x = n * s.width, I = Math.max(g, _), O = Math.round(I + x), k = Math.round(I + x), E = (d.width - I) / 2, z = (d.height - I) / 2;
585
585
  f.shadowColor = o, f.shadowBlur = i;
586
- const L = r, W = Math.round(E - x / 2), X = Math.round(B - x / 2);
587
- f.beginPath(), f.moveTo(W + L, X), f.lineTo(W + O - L, X), f.quadraticCurveTo(W + O, X, W + O, X + L), f.lineTo(W + O, X + k - L), f.quadraticCurveTo(W + O, X + k, W + O - L, X + k), f.lineTo(W + L, X + k), f.quadraticCurveTo(W, X + k, W, X + k - L), f.lineTo(W, X + L), f.quadraticCurveTo(W, X, W + L, X), f.fillStyle = "#ffffff", f.closePath(), f.fill(), f.clip(), f.shadowColor = "transparent";
588
- const A = (d.width - g) / 2, $ = (d.height - _) / 2;
589
- f.drawImage(a, A, $, g, _);
586
+ const D = r, V = Math.round(E - x / 2), q = Math.round(z - x / 2);
587
+ f.beginPath(), f.moveTo(V + D, q), f.lineTo(V + O - D, q), f.quadraticCurveTo(V + O, q, V + O, q + D), f.lineTo(V + O, q + k - D), f.quadraticCurveTo(V + O, q + k, V + O - D, q + k), f.lineTo(V + D, q + k), f.quadraticCurveTo(V, q + k, V, q + k - D), f.lineTo(V, q + D), f.quadraticCurveTo(V, q, V + D, q), f.fillStyle = "#ffffff", f.closePath(), f.fill(), f.clip(), f.shadowColor = "transparent";
588
+ const A = (d.width - g) / 2, U = (d.height - _) / 2;
589
+ f.drawImage(a, A, U, g, _);
590
590
  }
591
591
  const m = d.toDataURL("image/png"), v = document.createElement("img");
592
592
  return v.src = m, v.style.width = "100%", v.style.height = "auto", v;
@@ -971,7 +971,7 @@ function yI(s, e, t) {
971
971
  const i = s.length(), n = e.length(), o = j.lerp(i, n, t);
972
972
  return s.lerp(e, t).normalize().multiplyScalar(o);
973
973
  }
974
- const Ku = new N(), jb = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
974
+ const Ku = new $(), jb = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI);
975
975
  function _I(s, e) {
976
976
  s.lookAt(e), s.quaternion.multiply(jb);
977
977
  }
@@ -1014,10 +1014,10 @@ function OC(s) {
1014
1014
  const e = PC.get();
1015
1015
  return s ? e.copy(s) : e.set(0, 0, 0), e;
1016
1016
  }
1017
- const kC = new $i(() => new N(), 100);
1017
+ const kC = new $i(() => new $(), 100);
1018
1018
  function bn(s) {
1019
1019
  const e = kC.get();
1020
- return e.identity(), s instanceof N ? e.copy(s) : s instanceof DOMPointReadOnly && e.set(s.x, s.y, s.z, s.w), e;
1020
+ return e.identity(), s instanceof $ ? e.copy(s) : s instanceof DOMPointReadOnly && e.set(s.x, s.y, s.z, s.w), e;
1021
1021
  }
1022
1022
  const wm = new $i(() => new b(), 100), hy = Symbol("lastMatrixWorldUpdateKey");
1023
1023
  function Z(s, e = null, t = !0) {
@@ -1033,7 +1033,7 @@ function ua(s, e, t, i) {
1033
1033
  const n = wm.get();
1034
1034
  return n.set(e, t, i), ut(s, n), s;
1035
1035
  }
1036
- const Zh = new $i(() => new N(), 100), Xo = new N(), Zu = new N();
1036
+ const Zh = new $i(() => new $(), 100), Xo = new $(), Zu = new $();
1037
1037
  function be(s, e = null) {
1038
1038
  if (!s) return Zh.get().identity();
1039
1039
  const t = e ?? Zh.get();
@@ -1063,11 +1063,11 @@ function tc(s, e) {
1063
1063
  const t = RC;
1064
1064
  s.parent.getWorldScale(t), s.scale.copy(e), s.scale.divide(t);
1065
1065
  }
1066
- const TC = new b(), dy = new N();
1066
+ const TC = new b(), dy = new $();
1067
1067
  function vI(s) {
1068
1068
  return be(s, dy), TC.set(0, 0, 1).applyQuaternion(dy);
1069
1069
  }
1070
- const EC = new $i(() => new b(), 100), uy = new N();
1070
+ const EC = new $i(() => new b(), 100), uy = new $();
1071
1071
  function AC(s, e) {
1072
1072
  return e || (e = EC.get().set(0, 0, 1)), be(s, uy), e.applyQuaternion(uy);
1073
1073
  }
@@ -1330,7 +1330,7 @@ function Nb(s, e, t, i) {
1330
1330
  }
1331
1331
  let Gc = !1;
1332
1332
  lC((...s) => {
1333
- D() && he.Current?.isInXR && (Yr(!0), $b("error", ...s));
1333
+ L() && he.Current?.isInXR && (Yr(!0), $b("error", ...s));
1334
1334
  });
1335
1335
  function Yr(s) {
1336
1336
  if (s) {
@@ -1545,7 +1545,7 @@ function $b(s, ...e) {
1545
1545
  if (o instanceof J) return `(${i(o.x)}, ${i(o.y)})`;
1546
1546
  if (o instanceof b) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)})`;
1547
1547
  if (o instanceof de) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
1548
- if (o instanceof N) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
1548
+ if (o instanceof $) return `(${i(o.x)}, ${i(o.y)}, ${i(o.z)}, ${i(o.w)})`;
1549
1549
  if (o instanceof _e || o instanceof Te) return o.name;
1550
1550
  if (o instanceof rb) return `[${o.elements.join(", ")}]`;
1551
1551
  if (o instanceof te) return `[${o.elements.join(", ")}]`;
@@ -1589,7 +1589,7 @@ function Wd(s) {
1589
1589
  Be(s, Ui.Error);
1590
1590
  }
1591
1591
  let dp, Ju;
1592
- function D() {
1592
+ function L() {
1593
1593
  if (HC) return !1;
1594
1594
  if (dp !== void 0) return dp;
1595
1595
  if (Ju !== void 0) return Ju;
@@ -1765,9 +1765,9 @@ fo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUIL
1765
1765
  fo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
1766
1766
  fo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.8.8";');
1767
1767
  fo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
1768
- fo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Sep 01 2025 10:35:17 GMT+0000 (Coordinated Universal Time)";');
1768
+ fo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Fri Aug 29 2025 17:31:49 GMT+0000 (Coordinated Universal Time)";');
1769
1769
  fo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
1770
- const En = "4.8.8", Sm = "undefined", Gb = "Mon Sep 01 2025 10:35:17 GMT+0000 (Coordinated Universal Time)";
1770
+ const En = "4.8.8", Sm = "undefined", Gb = "Fri Aug 29 2025 17:31:49 GMT+0000 (Coordinated Universal Time)";
1771
1771
  Hb && console.log(`Engine version: ${En} (generator: ${Sm})
1772
1772
  Project built at ${Gb}`);
1773
1773
  const bl = NEEDLE_PUBLIC_KEY, oo = "needle_isActiveInHierarchy", Br = "builtin_components", Mh = "needle_editor_guid";
@@ -2428,7 +2428,7 @@ class a1 {
2428
2428
  this._mouseWheelDeltaY[e] = 0;
2429
2429
  };
2430
2430
  canReceiveInput(e) {
2431
- return e.target === this.context.renderer?.domElement || e.target === this.context.domElement || this.context.isInAR || this.context.isInAR && e.target === document.body && q.isMozillaXR() ? !0 : (tt && console.warn("CanReceiveInput:False for", e.target), !1);
2431
+ return e.target === this.context.renderer?.domElement || e.target === this.context.domElement || this.context.isInAR || this.context.isInAR && e.target === document.body && X.isMozillaXR() ? !0 : (tt && console.warn("CanReceiveInput:False for", e.target), !1);
2432
2432
  }
2433
2433
  onContextMenu = (e) => {
2434
2434
  this.canReceiveInput(e) !== !1 && e instanceof PointerEvent && e.pointerType;
@@ -2640,15 +2640,15 @@ class a1 {
2640
2640
  return t[e] = i, i;
2641
2641
  }
2642
2642
  onDispatchEvent(e) {
2643
- const t = U.Current;
2643
+ const t = N.Current;
2644
2644
  try {
2645
- U.Current = this.context, this.dispatchEvent(e);
2645
+ N.Current = this.context, this.dispatchEvent(e);
2646
2646
  } finally {
2647
- U.Current = t;
2647
+ N.Current = t;
2648
2648
  }
2649
2649
  }
2650
2650
  }
2651
- const Kr = new te().makeRotationY(Math.PI), ji = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI), l1 = w("debugwebxr");
2651
+ const Kr = new te().makeRotationY(Math.PI), ji = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI), l1 = w("debugwebxr");
2652
2652
  class c1 {
2653
2653
  priority = -1e5;
2654
2654
  gameObject;
@@ -2665,7 +2665,7 @@ class c1 {
2665
2665
  }
2666
2666
  }
2667
2667
  }
2668
- const Yn = w("debugwebxr"), Xc = w("debugcustomgesture"), h1 = "https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles", d1 = "generic-trigger", u1 = new N().setFromEuler(new Rt(gs.degToRad(0), gs.degToRad(-90), gs.degToRad(-90))), f1 = new b(0.04, -0.04, 0);
2668
+ const Yn = w("debugwebxr"), Xc = w("debugcustomgesture"), h1 = "https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles", d1 = "generic-trigger", u1 = new $().setFromEuler(new Rt(gs.degToRad(0), gs.degToRad(-90), gs.degToRad(-90))), f1 = new b(0.04, -0.04, 0);
2669
2669
  class Zb {
2670
2670
  /** the Needle XR Session */
2671
2671
  xr;
@@ -2797,16 +2797,16 @@ class Zb {
2797
2797
  /** Grip position in grip space */
2798
2798
  _gripPosition = new b();
2799
2799
  /** Grip rotation in grip space */
2800
- _gripQuaternion = new N();
2800
+ _gripQuaternion = new $();
2801
2801
  _linearVelocity = new b();
2802
2802
  _rayPositionRaw = new b();
2803
- _rayRotationRaw = new N();
2803
+ _rayRotationRaw = new $();
2804
2804
  /** ray matrix in grip space */
2805
2805
  _rayMatrix = new te();
2806
2806
  /** Ray position in rig space */
2807
2807
  _rayPosition = new b();
2808
2808
  /** Ray rotation in rig space */
2809
- _rayQuaternion = new N();
2809
+ _rayQuaternion = new $();
2810
2810
  /** Grip position in rig space */
2811
2811
  get gripPosition() {
2812
2812
  return G(this._gripPosition);
@@ -2841,7 +2841,7 @@ class Zb {
2841
2841
  get gripWorldQuaternion() {
2842
2842
  return bn(this._gripWorldQuaternion);
2843
2843
  }
2844
- _gripWorldQuaternion = new N();
2844
+ _gripWorldQuaternion = new $();
2845
2845
  /** Controller ray position in worldspace (this value is calculated once per frame by default - call `updateRayWorldPosition` to force an update) */
2846
2846
  get rayWorldPosition() {
2847
2847
  return G(this._rayWorldPosition);
@@ -2856,7 +2856,7 @@ class Zb {
2856
2856
  get rayWorldQuaternion() {
2857
2857
  return bn(this._rayWorldQuaternion);
2858
2858
  }
2859
- _rayWorldQuaternion = new N();
2859
+ _rayWorldQuaternion = new $();
2860
2860
  get pinchPosition() {
2861
2861
  return G(this._pinchPosition);
2862
2862
  }
@@ -2943,7 +2943,7 @@ class Zb {
2943
2943
  this.onUpdateFrame(e), this.updateInputEvents(), this.onUpdateMove();
2944
2944
  }
2945
2945
  onRenderDebug() {
2946
- z.DrawSphere(this.rayWorldPosition, 3e-3), z.DrawDirection(this.rayWorldPosition, G(0, 0, 10).applyQuaternion(this.rayWorldQuaternion));
2946
+ F.DrawSphere(this.rayWorldPosition, 3e-3), F.DrawDirection(this.rayWorldPosition, G(0, 0, 10).applyQuaternion(this.rayWorldQuaternion));
2947
2947
  const t = (this.inputSource.gripSpace ? this.gripWorldPosition : this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(0.1)), i = this.inputSource.profiles.join(`
2948
2948
  `);
2949
2949
  let n = `Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
@@ -2958,7 +2958,7 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
2958
2958
  [axes ` + o.axes.length + "]: " + o.axes.map((a) => a.toPrecision(1)).join(","), n += `
2959
2959
  ` + r;
2960
2960
  }
2961
- z.DrawLabel(t, n, 6e-3);
2961
+ F.DrawLabel(t, n, 6e-3);
2962
2962
  }
2963
2963
  onUpdateFrame(e) {
2964
2964
  if (this._handJointPoses.clear(), this._hand_wristDotUp = void 0, !this.xr.referenceSpace) {
@@ -3156,13 +3156,13 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
3156
3156
  if (!this.emitPointerDownEvent || this.inputSource !== e.inputSource) return;
3157
3157
  this.onUpdateFrame(e.frame), this._hasSelectEvent = !0;
3158
3158
  const t = this._layout?.selectComponentId, i = this._layout?.components[t]?.gamepadIndices?.button;
3159
- i !== void 0 && (this._selectButtonIndex = i), !Xc && (Yn && z.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(De.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3159
+ i !== void 0 && (this._selectButtonIndex = i), !Xc && (Yn && F.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(De.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3160
3160
  };
3161
3161
  onSelectEnd = (e) => {
3162
3162
  this.emitPointerUpEvent && (Xc || this.inputSource === e.inputSource && this.emitPointerEvent(De.PointerUp, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3163
3163
  };
3164
3164
  onSequeezeStart = (e) => {
3165
- this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (Yn && z.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(De.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
3165
+ this.emitPointerDownEvent && this.inputSource === e.inputSource && (this._squeezeButtonIndex = this._layout?.components["xr-standard-squeeze"]?.gamepadIndices?.button, this._squeezeButtonIndex !== void 0 && (Yn && F.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 255, 10), this.emitPointerEvent(De.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
3166
3166
  };
3167
3167
  onSequeezeEnd = (e) => {
3168
3168
  this.emitPointerUpEvent && this.inputSource === e.inputSource && this._squeezeButtonIndex !== void 0 && this.emitPointerEvent(De.PointerUp, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e);
@@ -3213,12 +3213,12 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
3213
3213
  }
3214
3214
  _didMoveLastFrame = !1;
3215
3215
  _lastPointerMovePosition = new b();
3216
- _lastPointerMoveQuaternion = new N();
3216
+ _lastPointerMoveQuaternion = new $();
3217
3217
  onUpdateMove() {
3218
3218
  if (!this.emitPointerMoveEvent) return;
3219
3219
  let e = !1;
3220
3220
  if (this._lastPointerMovePosition.distanceTo(this.gripWorldPosition) > this.pointerMoveDistanceThreshold * this.xr.rigScale && (e = !0), e || this._lastPointerMoveQuaternion.angleTo(this.gripWorldQuaternion) > this.pointerMoveAngleThreshold && (e = !0), e) {
3221
- this._didMoveLastFrame = !0, this._lastPointerMovePosition.copy(this.gripWorldPosition), this._lastPointerMoveQuaternion.copy(this.gripWorldQuaternion), Yn && z.DrawLabel(this.rayWorldPosition.add(this.object.worldForward.multiplyScalar(0.1)), "move", 0.01);
3221
+ this._didMoveLastFrame = !0, this._lastPointerMovePosition.copy(this.gripWorldPosition), this._lastPointerMoveQuaternion.copy(this.gripWorldQuaternion), Yn && F.DrawLabel(this.rayWorldPosition.add(this.object.worldForward.multiplyScalar(0.1)), "move", 0.01);
3222
3222
  let i = this.xr.context.input.getFirstPressedButtonForPointer(this.index);
3223
3223
  i === void 0 && (i = 0);
3224
3224
  const n = this.gamepad?.buttons[i]?.value;
@@ -3235,8 +3235,8 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
3235
3235
  }
3236
3236
  if (this.xr.mode === "immersive-vr" || this.xr.isPassThrough) {
3237
3237
  this.pointerInit.origin = this, this.pointerInit.pointerId = this.getPointerId(t), this.pointerInit.pointerType = this.hand ? "hand" : "controller", this.pointerInit.button = t, this.pointerInit.buttonName = i, this.pointerInit.isPrimary = n, this.pointerInit.mode = this.inputSource.targetRayMode, this.pointerInit.ray = this.ray, this.pointerInit.device = this.object, this.pointerInit.pressure = r, this.pointerInit.clientX = this._rayPosition.x / this.xr.rigScale, this.pointerInit.clientY = this._rayPosition.y / this.xr.rigScale, this.pointerInit.clientZ = this._rayPosition.z / this.xr.rigScale;
3238
- const a = U.Current;
3239
- U.Current = this.xr.context, Yn && e !== "pointermove" && console.warn("Pointer event", e, t, i, { ...this.pointerInit }), this.xr.context.input.createInputEvent(new Ws(e, o, this.pointerInit)), U.Current = a;
3238
+ const a = N.Current;
3239
+ N.Current = this.xr.context, Yn && e !== "pointermove" && console.warn("Pointer event", e, t, i, { ...this.pointerInit }), this.xr.context.input.createInputEvent(new Ws(e, o, this.pointerInit)), N.Current = a;
3240
3240
  }
3241
3241
  }
3242
3242
  }
@@ -3268,7 +3268,7 @@ let ed = !1;
3268
3268
  const Vr = [];
3269
3269
  function pr() {
3270
3270
  if (ed) return;
3271
- D() && console.debug("User interaction registered: audio can now be played"), ed = !0;
3271
+ L() && console.debug("User interaction registered: audio can now be played"), ed = !0;
3272
3272
  const s = [...Vr];
3273
3273
  Vr.length = 0, s.forEach((e) => e());
3274
3274
  }
@@ -3866,7 +3866,7 @@ class x1 {
3866
3866
  console.debug(`⊡ Connecting to networking backend on
3867
3867
  ` + Mi);
3868
3868
  const o = await import("./vendor-Z4SPrTcP.js").then((c) => c.index), r = o.default?.WebsocketBuilder ?? o.WebsocketBuilder, a = o.default?.ExponentialBackoff ?? o.ExponentialBackoff, l = new r(Mi).withMaxRetries(10).withBackoff(new a(2e3, 4)).onOpen(() => {
3869
- this._connectingToWebsocketPromise = null, this._ws = l, this.connected = !0, D() || oi ? console.log(`⊞ Connected to networking backend
3869
+ this._connectingToWebsocketPromise = null, this._ws = l, this.connected = !0, L() || oi ? console.log(`⊞ Connected to networking backend
3870
3870
  ` + Mi) : console.debug("⊞ Connected to networking backend", Mi), n(!0), this.onSendQueued(vn.OnConnection);
3871
3871
  }).onClose((c) => {
3872
3872
  this._connectingToWebsocketPromise = null, this.connected = !1, this._isInRoom = !1, n(!1);
@@ -3896,7 +3896,7 @@ class x1 {
3896
3896
  else this.handleIncomingStringMessage(n);
3897
3897
  return;
3898
3898
  } catch (n) {
3899
- oi && i === "pong" ? console.log("<<", i) : D() && console.error("Failed to parse message", n);
3899
+ oi && i === "pong" ? console.log("<<", i) : L() && console.error("Failed to parse message", n);
3900
3900
  }
3901
3901
  }
3902
3902
  async handleIncomingBinaryMessage(e) {
@@ -3926,7 +3926,7 @@ class x1 {
3926
3926
  if (oi && console.log(e), e) {
3927
3927
  this._isInRoom = !0;
3928
3928
  const r = e;
3929
- this._currentRoomName = r.room, this._currentRoomViewId = r.viewId, this._currentRoomAllowEditing = r.allowEditing ?? !0, this._currentInRoom.length = 0, this._currentInRoom.push(...r.inRoom), (Kc || D()) && console.debug("Joined Needle Engine Room: " + r.room);
3929
+ this._currentRoomName = r.room, this._currentRoomViewId = r.viewId, this._currentRoomAllowEditing = r.allowEditing ?? !0, this._currentInRoom.length = 0, this._currentInRoom.push(...r.inRoom), (Kc || L()) && console.debug("Joined Needle Engine Room: " + r.room);
3930
3930
  const a = new URL(window.location.href);
3931
3931
  a.searchParams.has("room") && a.searchParams.delete("room"), a.searchParams.set("view", this._currentRoomViewId), console.debug(`Room view id: ${this._currentRoomViewId}
3932
3932
  ${a.href}`);
@@ -3935,7 +3935,7 @@ ${a.href}`);
3935
3935
  break;
3936
3936
  case "left-room":
3937
3937
  const n = e;
3938
- n.room === this.currentRoomName && (this._isInRoom = !1, this._currentRoomName = null, this._currentRoomAllowEditing = !0, this._currentInRoom.length = 0, (Kc || D()) && console.debug("Left Needle Engine Room: " + n.room));
3938
+ n.room === this.currentRoomName && (this._isInRoom = !1, this._currentRoomName = null, this._currentRoomAllowEditing = !0, this._currentInRoom.length = 0, (Kc || L()) && console.debug("Left Needle Engine Room: " + n.room));
3939
3939
  break;
3940
3940
  case "user-joined-room":
3941
3941
  if (e.data) {
@@ -4480,7 +4480,7 @@ async function M1() {
4480
4480
  const s = sessionStorage.getItem("needle_xr_session_mode"), e = sessionStorage.getItem("needle_xr_session_init") ?? null, t = e ? JSON.parse(e) : null;
4481
4481
  let i = null;
4482
4482
  if (n0() && (await ga.start(s || "immersive-vr", t || K.getDefaultSessionInit("immersive-vr")), await E1(), i = await ga.handoff()), i)
4483
- K.setSession(i.mode, i.session, i.init, U.Current);
4483
+ K.setSession(i.mode, i.session, i.init, N.Current);
4484
4484
  else if (s && e) {
4485
4485
  console.log("Session Granted: Restore last session");
4486
4486
  const n = JSON.parse(e);
@@ -4515,7 +4515,7 @@ function E1() {
4515
4515
  }, 100);
4516
4516
  });
4517
4517
  }
4518
- q.isDesktop() && D() && window.addEventListener("keydown", (s) => {
4518
+ X.isDesktop() && L() && window.addEventListener("keydown", (s) => {
4519
4519
  (s.key === "x" || s.key === "Escape") && K.active && K.stop();
4520
4520
  });
4521
4521
  function A1(s) {
@@ -4662,12 +4662,12 @@ class K {
4662
4662
  switch (e) {
4663
4663
  case "immersive-ar":
4664
4664
  const t = ["anchors", "local-floor", "layers", "dom-overlay", "hit-test", "unbounded"];
4665
- return q.isVisionOS() || t.push("hand-tracking"), {
4665
+ return X.isVisionOS() || t.push("hand-tracking"), {
4666
4666
  optionalFeatures: t
4667
4667
  };
4668
4668
  case "immersive-vr":
4669
4669
  const i = ["local-floor", "bounded-floor", "high-fixed-foveation-level", "layers"];
4670
- return q.isVisionOS() || i.push("hand-tracking"), {
4670
+ return X.isVisionOS() || i.push("hand-tracking"), {
4671
4671
  optionalFeatures: i
4672
4672
  };
4673
4673
  default:
@@ -4681,20 +4681,20 @@ class K {
4681
4681
  * @param context The Needle Engine context to use
4682
4682
  */
4683
4683
  static async start(e, t, i) {
4684
- if (q.isiOS()) {
4684
+ if (X.isiOS()) {
4685
4685
  if (e === "ar")
4686
4686
  if (await this.isARSupported())
4687
4687
  e = "immersive-ar";
4688
4688
  else
4689
4689
  return ic.exportAndOpen(), null;
4690
4690
  } else e == "ar" && (e = "immersive-ar");
4691
- if (D() && w("debugxrpreroom"))
4691
+ if (L() && w("debugxrpreroom"))
4692
4692
  return console.warn("Debug: Starting temporary XR session"), await ga.start(e, t || K.getDefaultSessionInit(e)), null;
4693
4693
  if (this._currentSessionRequest)
4694
- return console.warn("A XRSession is already being requested"), (He || D()) && ge("A XRSession is already being requested"), this._currentSessionRequest.then(() => this._activeSession);
4694
+ return console.warn("A XRSession is already being requested"), (He || L()) && ge("A XRSession is already being requested"), this._currentSessionRequest.then(() => this._activeSession);
4695
4695
  if (this._activeSession)
4696
4696
  return console.error("A XRSession is already running"), this._activeSession;
4697
- if (i || (i = U.Current), i || (i = he.All[0]), !i) throw new Error("No Needle Engine Context found");
4697
+ if (i || (i = N.Current), i || (i = he.All[0]), !i) throw new Error("No Needle Engine Context found");
4698
4698
  switch (t || (t = {}), e) {
4699
4699
  // Setup VR initialization parameters
4700
4700
  case "immersive-ar":
@@ -4702,7 +4702,7 @@ class K {
4702
4702
  if (await this.xrSystem?.isSessionSupported("immersive-ar") !== !0)
4703
4703
  return console.error(e + " is not supported by this browser."), null;
4704
4704
  const l = this.getDefaultSessionInit(e), c = k1(i.domElement);
4705
- c && !q.isQuest() && (l.domOverlay = { root: c }, l.optionalFeatures.push("dom-overlay")), t = {
4705
+ c && !X.isQuest() && (l.domOverlay = { root: c }, l.optionalFeatures.push("dom-overlay")), t = {
4706
4706
  ...l,
4707
4707
  ...t
4708
4708
  };
@@ -4831,7 +4831,7 @@ class K {
4831
4831
  }
4832
4832
  /** Returns true if running in pass through mode in immersive AR (e.g. user is wearing a headset while in AR) */
4833
4833
  get isPassThrough() {
4834
- return !!(this.environmentBlendMode !== "opaque" && this.interactionMode === "world-space" || this.mode === "immersive-ar" && this.environmentBlendMode !== "opaque" && this.controllers.some((e) => e.inputSource.targetRayMode === "tracked-pointer") || D() && q.isDesktop() && this.mode === "immersive-ar");
4834
+ return !!(this.environmentBlendMode !== "opaque" && this.interactionMode === "world-space" || this.mode === "immersive-ar" && this.environmentBlendMode !== "opaque" && this.controllers.some((e) => e.inputSource.targetRayMode === "tracked-pointer") || L() && X.isDesktop() && this.mode === "immersive-ar");
4835
4835
  }
4836
4836
  get isAR() {
4837
4837
  return this.mode === "immersive-ar";
@@ -4995,7 +4995,7 @@ class K {
4995
4995
  */
4996
4996
  _mainCamera = null;
4997
4997
  constructor(e, t, i, n) {
4998
- R1(e, n.init), this.session = t, this.mode = e, this.context = i, (He || w("console")) && Yr(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((o) => typeof o.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, ks(this.onBefore, xe.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), (n.init.optionalFeatures?.includes("hit-test") || n.init.requiredFeatures?.includes("hit-test")) && t.requestReferenceSpace("viewer").then((o) => t.requestHitTestSource?.call(t, { space: o })?.then((r) => this._viewerHitTestSource = r).catch((r) => console.error(r))).catch((o) => console.error(o)), this.context.mainCamera && (this._originalCameraWorldPosition = Z(this.context.mainCamera, new b()), this._originalCameraWorldRotation = be(this.context.mainCamera, new N()), this._originalCameraWorldScale = $e(this.context.mainCamera, new b()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new c1(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
4998
+ R1(e, n.init), this.session = t, this.mode = e, this.context = i, (He || w("console")) && Yr(!0), this._xr_scripts = [...n.scripts], this._xr_update_scripts = this._xr_scripts.filter((o) => typeof o.onUpdateXR == "function"), this._controllerAdded = n.controller_added, this._controllerRemoved = n.controller_removed, ks(this.onBefore, xe.LateUpdate), this.context.pre_render_callbacks.push(this.onBeforeRender), this.context.post_render_callbacks.push(this.onAfterRender), (n.init.optionalFeatures?.includes("hit-test") || n.init.requiredFeatures?.includes("hit-test")) && t.requestReferenceSpace("viewer").then((o) => t.requestHitTestSource?.call(t, { space: o })?.then((r) => this._viewerHitTestSource = r).catch((r) => console.error(r))).catch((o) => console.error(o)), this.context.mainCamera && (this._originalCameraWorldPosition = Z(this.context.mainCamera, new b()), this._originalCameraWorldRotation = be(this.context.mainCamera, new $()), this._originalCameraWorldScale = $e(this.context.mainCamera, new b()), this._originalCameraParent = this.context.mainCamera.parent), this._defaultRig = new c1(), this.context.scene.add(this._defaultRig.gameObject), this.addRig(this._defaultRig);
4999
4999
  for (let o = 0; o < t.inputSources.length; o++) {
5000
5000
  const r = t.inputSources[o];
5001
5001
  if (!r.handedness) {
@@ -5202,14 +5202,14 @@ class K {
5202
5202
  for (const o of this.controllers)
5203
5203
  n += `
5204
5204
  ${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.connected} tr:${o.isTracking} hts:${o.hasHitTestSource ? "yes" : "no"}`;
5205
- of = 0, z.DrawLabel(e, n, void 0, 1 / 60 * 20);
5205
+ of = 0, F.DrawLabel(e, n, void 0, 1 / 60 * 20);
5206
5206
  }
5207
5207
  }
5208
5208
  onBeforeRender = () => {
5209
5209
  this.context.mainCamera && this.updateFade(this.context.mainCamera);
5210
5210
  };
5211
5211
  onAfterRender = () => {
5212
- if (this.onUpdateFade_PostRender(), q.isDesktop() || !this._renderOnceOnDevice) {
5212
+ if (this.onUpdateFade_PostRender(), X.isDesktop() || !this._renderOnceOnDevice) {
5213
5213
  const e = this.context.renderer;
5214
5214
  if (e.xr.isPresenting && this.context.mainCamera) {
5215
5215
  this._renderOnceOnDevice = !0;
@@ -5311,7 +5311,7 @@ ${o.hand ? "hand" : "ctrl"} ${o.inputSource.handedness}[${o.index}] con:${o.conn
5311
5311
  this._camera && this._previousCameraParent && this._previousCameraParent.add(this._camera), this._previousCameraParent = null, this._camera instanceof pe && this.originalCameraNearPlane != null && (this._camera.near = this.originalCameraNearPlane);
5312
5312
  }
5313
5313
  _viewerPose;
5314
- _transformOrientation = new N();
5314
+ _transformOrientation = new $();
5315
5315
  _transformPosition = new b();
5316
5316
  internalUpdateState() {
5317
5317
  const e = this.context.renderer.xr.getReferenceSpace();
@@ -5359,8 +5359,8 @@ class I1 {
5359
5359
  }
5360
5360
  }
5361
5361
  }
5362
- const Ot = new b(), Ey = new b(), Ay = new N(), L1 = w("debuggizmos"), Zi = 8947848, af = 32;
5363
- class z {
5362
+ const Ot = new b(), Ey = new b(), Ay = new $(), L1 = w("debuggizmos"), Zi = 8947848, af = 32;
5363
+ class F {
5364
5364
  constructor() {
5365
5365
  }
5366
5366
  /**
@@ -5391,7 +5391,7 @@ class z {
5391
5391
  * @returns a handle to the label that can be used to update the text
5392
5392
  */
5393
5393
  static DrawLabel(e, t, i = 0.05, n = 0, o, r, a) {
5394
- if (!z.enabled) return null;
5394
+ if (!F.enabled) return null;
5395
5395
  o || (o = Zi);
5396
5396
  const l = K.active?.rigScale ?? 1, c = Ri.getTextLabel(n, t, i * l, o, r);
5397
5397
  return a instanceof M && a.add(c), c.position.x = e.x, c.position.y = e.y, c.position.z = e.z, c;
@@ -5405,7 +5405,7 @@ class z {
5405
5405
  * @param depthTest if true the ray will be rendered with depth test
5406
5406
  */
5407
5407
  static DrawRay(e, t, i = Zi, n = 0, o = !0) {
5408
- if (!z.enabled) return;
5408
+ if (!F.enabled) return;
5409
5409
  const r = Ri.getLine(n), a = r.geometry.getAttribute("position");
5410
5410
  a.setXYZ(0, e.x, e.y, e.z), Ot.set(t.x, t.y, t.z).multiplyScalar(999999999), a.setXYZ(1, e.x + Ot.x, e.y + Ot.y, e.z + Ot.z), a.needsUpdate = !0, r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1;
5411
5411
  }
@@ -5419,7 +5419,7 @@ class z {
5419
5419
  * @param lengthFactor the length of the line. Default is 1
5420
5420
  */
5421
5421
  static DrawDirection(e, t, i = Zi, n = 0, o = !0, r = 1) {
5422
- if (!z.enabled) return;
5422
+ if (!F.enabled) return;
5423
5423
  const a = Ri.getLine(n), l = a.geometry.getAttribute("position");
5424
5424
  l.setXYZ(0, e.x, e.y, e.z), t.w !== void 0 ? (Ot.set(0, 0, -r), Ay.set(t.x, t.y, t.z, t.w), Ot.applyQuaternion(Ay)) : (Ot.set(t.x, t.y, t.z), Ot.multiplyScalar(r)), l.setXYZ(1, e.x + Ot.x, e.y + Ot.y, e.z + Ot.z), l.needsUpdate = !0, a.material.color.set(i), a.material.depthTest = o, a.material.depthWrite = !1;
5425
5425
  }
@@ -5432,7 +5432,7 @@ class z {
5432
5432
  * @param depthTest if true the line will be rendered with depth test
5433
5433
  */
5434
5434
  static DrawLine(e, t, i = Zi, n = 0, o = !0) {
5435
- if (!z.enabled) return;
5435
+ if (!F.enabled) return;
5436
5436
  const r = Ri.getLine(n), a = r.geometry.getAttribute("position");
5437
5437
  a.setXYZ(0, e.x, e.y, e.z), a.setXYZ(1, t.x, t.y, t.z), a.needsUpdate = !0, r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1, r.material.fog = !1;
5438
5438
  }
@@ -5446,7 +5446,7 @@ class z {
5446
5446
  * @param depthTest if true the circle will be rendered with depth test
5447
5447
  */
5448
5448
  static DrawCircle(e, t, i, n = Zi, o = 0, r = !0) {
5449
- if (!z.enabled) return;
5449
+ if (!F.enabled) return;
5450
5450
  const a = Ri.getCircle(o);
5451
5451
  a.position.set(e.x, e.y, e.z), a.scale.set(i, i, i), a.quaternion.setFromUnitVectors(this._up, Ot.set(t.x, t.y, t.z).normalize()), a.material.color.set(n), a.material.depthTest = r, a.material.depthWrite = !1, a.material.fog = !1;
5452
5452
  }
@@ -5459,7 +5459,7 @@ class z {
5459
5459
  * @param depthTest if true the sphere will be rendered with depth test
5460
5460
  */
5461
5461
  static DrawWireSphere(e, t, i = Zi, n = 0, o = !0) {
5462
- if (!z.enabled) return;
5462
+ if (!F.enabled) return;
5463
5463
  const r = Ri.getSphere(t, n, !0);
5464
5464
  ua(r, e.x, e.y, e.z), r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1, r.material.fog = !1;
5465
5465
  }
@@ -5472,7 +5472,7 @@ class z {
5472
5472
  * @param depthTest if true the sphere will be rendered with depth test
5473
5473
  */
5474
5474
  static DrawSphere(e, t, i = Zi, n = 0, o = !0) {
5475
- if (!z.enabled) return;
5475
+ if (!F.enabled) return;
5476
5476
  const r = Ri.getSphere(t, n, !1);
5477
5477
  ua(r, e.x, e.y, e.z), r.material.color.set(i), r.material.depthTest = o, r.material.depthWrite = !1;
5478
5478
  }
@@ -5486,7 +5486,7 @@ class z {
5486
5486
  * @param depthTest if true the box will be rendered with depth test
5487
5487
  */
5488
5488
  static DrawWireBox(e, t, i = Zi, n = 0, o = !0, r = void 0) {
5489
- if (!z.enabled) return;
5489
+ if (!F.enabled) return;
5490
5490
  const a = Ri.getBox(n);
5491
5491
  a.position.set(e.x, e.y, e.z), a.scale.set(t.x, t.y, t.z), r ? a.quaternion.copy(r) : a.quaternion.identity(), a.material.color.set(i), a.material.depthTest = o, a.material.wireframe = !0, a.material.depthWrite = !1, a.material.fog = !1;
5492
5492
  }
@@ -5498,7 +5498,7 @@ class z {
5498
5498
  * @param depthTest if true the box will be rendered with depth test
5499
5499
  */
5500
5500
  static DrawWireBox3(e, t = Zi, i = 0, n = !0) {
5501
- if (!z.enabled) return;
5501
+ if (!F.enabled) return;
5502
5502
  const o = Ri.getBox(i);
5503
5503
  o.position.copy(e.getCenter(Ot)), o.scale.copy(e.getSize(Ot)), o.material.color.set(t), o.material.depthTest = n, o.material.wireframe = !0, o.material.depthWrite = !1, o.material.fog = !1;
5504
5504
  }
@@ -5513,7 +5513,7 @@ class z {
5513
5513
  * @param wireframe if true the arrow will be rendered as wireframe
5514
5514
  */
5515
5515
  static DrawArrow(e, t, i = Zi, n = 0, o = !0, r = !1) {
5516
- if (!z.enabled) return;
5516
+ if (!F.enabled) return;
5517
5517
  const a = Ri.getArrowHead(n);
5518
5518
  a.position.set(t.x, t.y, t.z), a.quaternion.setFromUnitVectors(this._up.set(0, 1, 0), Ot.set(t.x, t.y, t.z).sub(Ey.set(e.x, e.y, e.z)).normalize());
5519
5519
  const c = Ot.set(t.x, t.y, t.z).sub(Ey.set(e.x, e.y, e.z)).length() * 0.1;
@@ -5582,7 +5582,7 @@ class Ri {
5582
5582
  this.set({ textContent: d }), c.tmuiNeedsUpdate = !0;
5583
5583
  };
5584
5584
  }
5585
- return this.tmuiNeedsUpdate = !0, this.registerTimedObject(U.Current, r, e, this.textLabelCache), r;
5585
+ return this.tmuiNeedsUpdate = !0, this.registerTimedObject(N.Current, r, e, this.textLabelCache), r;
5586
5586
  }
5587
5587
  static getBox(e) {
5588
5588
  let t = this.boxesCache.pop();
@@ -5590,7 +5590,7 @@ class Ri {
5590
5590
  const i = new la(1, 1, 1);
5591
5591
  t = new H(i);
5592
5592
  }
5593
- return this.registerTimedObject(U.Current, t, e, this.boxesCache), t;
5593
+ return this.registerTimedObject(N.Current, t, e, this.boxesCache), t;
5594
5594
  }
5595
5595
  static getLine(e) {
5596
5596
  let t = this.linesCache.pop();
@@ -5599,7 +5599,7 @@ class Ri {
5599
5599
  let i = t.geometry.getAttribute("position");
5600
5600
  i || (i = new ht(new Float32Array(6), 3), t.geometry.setAttribute("position", i));
5601
5601
  }
5602
- return t.frustumCulled = !1, this.registerTimedObject(U.Current, t, e, this.linesCache), t;
5602
+ return t.frustumCulled = !1, this.registerTimedObject(N.Current, t, e, this.linesCache), t;
5603
5603
  }
5604
5604
  static getCircle(e) {
5605
5605
  let t = this.circlesCache.pop();
@@ -5619,19 +5619,19 @@ class Ri {
5619
5619
  }
5620
5620
  }
5621
5621
  }
5622
- return t.frustumCulled = !1, this.registerTimedObject(U.Current, t, e, this.circlesCache), t;
5622
+ return t.frustumCulled = !1, this.registerTimedObject(N.Current, t, e, this.circlesCache), t;
5623
5623
  }
5624
5624
  static getSphere(e, t, i) {
5625
5625
  let n = this.spheresCache.pop();
5626
- return n || (n = new H(new Ed(1, 8, 8))), n.scale.set(e, e, e), n.material.wireframe = i, this.registerTimedObject(U.Current, n, t, this.spheresCache), n;
5626
+ return n || (n = new H(new Ed(1, 8, 8))), n.scale.set(e, e, e), n.material.wireframe = i, this.registerTimedObject(N.Current, n, t, this.spheresCache), n;
5627
5627
  }
5628
5628
  static getArrowHead(e) {
5629
5629
  let t = this.arrowHeadsCache.pop();
5630
- return t || (t = new H(new ab(0, 0.5, 1, 8))), this.registerTimedObject(U.Current, t, e, this.arrowHeadsCache), t;
5630
+ return t || (t = new H(new ab(0, 0.5, 1, 8))), this.registerTimedObject(N.Current, t, e, this.arrowHeadsCache), t;
5631
5631
  }
5632
5632
  static getMesh(e) {
5633
5633
  let t = this.mesh.pop();
5634
- return t || (t = new H(), t.material = new we()), this.registerTimedObject(U.Current, t, e, this.mesh), t;
5634
+ return t || (t = new H(), t.material = new we()), this.registerTimedObject(N.Current, t, e, this.mesh), t;
5635
5635
  }
5636
5636
  static linesCache = [];
5637
5637
  static circlesCache = [];
@@ -5670,7 +5670,7 @@ class Ri {
5670
5670
  }
5671
5671
  t.traverse((a) => {
5672
5672
  a.layers.disableAll(), a.layers.enable(2);
5673
- }), t.renderOrder = 999999, t[mp] = n, t.castShadow = !1, t.receiveShadow = !1, t.isGizmo = !0, this.timedObjectsBuffer.push(t), this.timesBuffer.push(U.Current.time.realtimeSinceStartup + i), e.scene.add(t);
5673
+ }), t.renderOrder = 999999, t[mp] = n, t.castShadow = !1, t.receiveShadow = !1, t.isGizmo = !0, this.timedObjectsBuffer.push(t), this.timesBuffer.push(N.Current.time.realtimeSinceStartup + i), e.scene.add(t);
5674
5674
  }
5675
5675
  static timedObjectsBuffer = new Array();
5676
5676
  static timesBuffer = new Array();
@@ -5825,7 +5825,7 @@ class nc {
5825
5825
  }
5826
5826
  intersect(e, t, i, n) {
5827
5827
  for (const o of t) {
5828
- if (!o || o.visible === !1 || z.isGizmo(o) || n.lineThreshold !== void 0 && n.lineThreshold < 0 && o instanceof Zl)
5828
+ if (!o || o.visible === !1 || F.isGizmo(o) || n.lineThreshold !== void 0 && n.lineThreshold < 0 && o instanceof Zl)
5829
5829
  continue;
5830
5830
  let r = !0;
5831
5831
  const a = o, l = a.geometry;
@@ -5842,7 +5842,7 @@ class nc {
5842
5842
  let d = !0;
5843
5843
  if (n.precise === !1 && (d = !1), d ||= l.getAttribute("position")?.array?.length < 64, a instanceof da && (d = !1), !d && B1(a, e, i) || (n.useAcceleratedRaycast !== !1 ? td.runMeshBVHRaycast(e, a, i, this.context, n) : e.intersectObject(a, !1, i)), $t && i.length != h) {
5844
5844
  const f = i[i.length - 1], p = c ? 8969557 : 7798784;
5845
- z.DrawWireSphere(f.point, 0.1, p, 1, !1), z.DrawWireMesh({ mesh: o, depthTest: !1, duration: 0.2, color: p });
5845
+ F.DrawWireSphere(f.point, 0.1, p, 1, !1), F.DrawWireMesh({ mesh: o, depthTest: !1, duration: 0.2, color: p });
5846
5846
  }
5847
5847
  a.geometry = l;
5848
5848
  }
@@ -5852,7 +5852,7 @@ class nc {
5852
5852
  }
5853
5853
  tempBoundingBox = new pi();
5854
5854
  intersectSphere(e, t, i, n, o, r, a, l) {
5855
- let c = e && e.isMesh && e.layers.test(n) && !z.isGizmo(e);
5855
+ let c = e && e.isMesh && e.layers.test(n) && !F.isGizmo(e);
5856
5856
  c &&= e.visible, c &&= !(e instanceof Zl), c &&= !(e instanceof da);
5857
5857
  const h = e, d = h.geometry;
5858
5858
  if (c && l) {
@@ -5925,37 +5925,37 @@ var td;
5925
5925
  return !1;
5926
5926
  const k = y.geometry;
5927
5927
  if (y?.isSkinnedMesh) {
5928
- const E = y, B = E.bvhNeedsUpdate;
5928
+ const E = y, z = E.bvhNeedsUpdate;
5929
5929
  if (!E.staticGenerator)
5930
5930
  a(), o && (E.staticGenerator = new o(y), E.staticGenerator.applyWorldTransforms = !1, E.staticGeometry = E.staticGenerator.generate(), k.boundsTree = r?.call(E.staticGeometry), E.staticGeometryLastUpdate = performance.now() + Math.random() * 200, E.bvhNeedsUpdate = !0);
5931
- else if (k.boundsTree && (E.autoUpdateMeshBvhInterval !== void 0 && E.autoUpdateMeshBvhInterval >= 0 || B === !0)) {
5932
- const L = performance.now(), W = L - E.staticGeometryLastUpdate, X = E.autoUpdateMeshBvhInterval ?? 100;
5933
- (B || W > X) && ($t && console.warn(`Physics: updating skinned mesh bvh for ${y.name} after ${W.toFixed(2)}ms`), E.bvhNeedsUpdate = !1, E.staticGeometryLastUpdate = L, E.staticGenerator?.generate(E.staticGeometry), k.boundsTree.refit());
5931
+ else if (k.boundsTree && (E.autoUpdateMeshBvhInterval !== void 0 && E.autoUpdateMeshBvhInterval >= 0 || z === !0)) {
5932
+ const D = performance.now(), V = D - E.staticGeometryLastUpdate, q = E.autoUpdateMeshBvhInterval ?? 100;
5933
+ (z || V > q) && ($t && console.warn(`Physics: updating skinned mesh bvh for ${y.name} after ${V.toFixed(2)}ms`), E.bvhNeedsUpdate = !1, E.staticGeometryLastUpdate = D, E.staticGenerator?.generate(E.staticGeometry), k.boundsTree.refit());
5934
5934
  }
5935
5935
  } else if (!k.boundsTree) {
5936
5936
  c || m();
5937
5937
  let E = !0;
5938
5938
  if ((I.xr || k[p] === !1 || k.getAttribute("position")?.isInterleavedBufferAttribute || k.index && k.index?.isInterleavedBufferAttribute) && (E = !1), E && d) {
5939
5939
  if (k[f] === void 0) {
5940
- let B = null;
5940
+ let z = null;
5941
5941
  if (_.length > 0) {
5942
- const L = _.shift();
5943
- L && !L.running && (B = L);
5942
+ const D = _.shift();
5943
+ D && !D.running && (z = D);
5944
5944
  }
5945
- if (!B && g.length < 3 && (B = new d(), g.push(B)), B != null && !B.running) {
5946
- const L = y.name;
5947
- $t && console.log("<<<< worker start", L, B), k[f] = "queued", performance.mark("bvh.create.start");
5948
- const W = k.clone();
5945
+ if (!z && g.length < 3 && (z = new d(), g.push(z)), z != null && !z.running) {
5946
+ const D = y.name;
5947
+ $t && console.log("<<<< worker start", D, z), k[f] = "queued", performance.mark("bvh.create.start");
5948
+ const V = k.clone();
5949
5949
  try {
5950
- B.generate(W).then((X) => {
5951
- k[f] = "done", k.boundsTree = X;
5952
- }).catch((X) => {
5953
- k[f] = "failed - " + X?.message, k[p] = !1, $t && console.error("Failed to generate mesh bvh on worker", X);
5950
+ z.generate(V).then((q) => {
5951
+ k[f] = "done", k.boundsTree = q;
5952
+ }).catch((q) => {
5953
+ k[f] = "failed - " + q?.message, k[p] = !1, $t && console.error("Failed to generate mesh bvh on worker", q);
5954
5954
  }).finally(() => {
5955
- $t && console.log(">>>>> worker done", L, { hasBoundsTre: k.boundsTree != null }), _.push(B), W.dispose(), performance.mark("bvh.create.end"), performance.measure("bvh.create (worker)", "bvh.create.start", "bvh.create.end");
5955
+ $t && console.log(">>>>> worker done", D, { hasBoundsTre: k.boundsTree != null }), _.push(z), V.dispose(), performance.mark("bvh.create.end"), performance.measure("bvh.create (worker)", "bvh.create.start", "bvh.create.end");
5956
5956
  });
5957
- } catch (X) {
5958
- console.error("Failed to generate mesh bvh on worker", X);
5957
+ } catch (q) {
5958
+ console.error("Failed to generate mesh bvh on worker", q);
5959
5959
  }
5960
5960
  } else
5961
5961
  $t && console.warn("No worker available");
@@ -5963,19 +5963,19 @@ var td;
5963
5963
  } else (!h || !E) && (a(), n && (performance.mark("bvh.create.start"), k.boundsTree = new n(k), performance.mark("bvh.create.end"), performance.measure("bvh.create", "bvh.create.start", "bvh.create.end")));
5964
5964
  }
5965
5965
  if (v instanceof Ad) {
5966
- const E = v, B = y.raycast;
5966
+ const E = v, z = y.raycast;
5967
5967
  if (k.boundsTree)
5968
5968
  a(), i && (y.acceleratedRaycast || (y.acceleratedRaycast = i.bind(y), $t && console.debug(`Physics: bind acceleratedRaycast fn to "${y.name}"`)), y.raycast = y.acceleratedRaycast);
5969
5969
  else if ($t && console.warn("No bounds tree found for mesh", y.name, { workerTask: k[f], hasAcceleratedRaycast: i != null }), O.allowSlowRaycastFallback === !1)
5970
5970
  return $t && console.warn("Skipping raycast because no bounds tree is available and allowSlowRaycastFallback is false"), !1;
5971
- const L = E.firstHitOnly;
5972
- return E.firstHitOnly = !1, E.intersectObject(y, !1, x), E.firstHitOnly = L, y.raycast = B, !0;
5971
+ const D = E.firstHitOnly;
5972
+ return E.firstHitOnly = !1, E.intersectObject(y, !1, x), E.firstHitOnly = D, y.raycast = z, !0;
5973
5973
  } else if (v instanceof Id) {
5974
5974
  const E = k.boundsTree;
5975
5975
  if (E) {
5976
- const B = v;
5977
- if (l.copy(y.matrixWorld).invert(), B.applyMatrix4(l), E.intersectsSphere(B)) {
5978
- const W = Z(y), X = W.distanceTo(B.center), A = new s0(y, X, W);
5976
+ const z = v;
5977
+ if (l.copy(y.matrixWorld).invert(), z.applyMatrix4(l), E.intersectsSphere(z)) {
5978
+ const V = Z(y), q = V.distanceTo(z.center), A = new s0(y, q, V);
5979
5979
  x.push(A);
5980
5980
  }
5981
5981
  }
@@ -5989,7 +5989,7 @@ var td;
5989
5989
  t || (t = !0, import("./vendor-Z4SPrTcP.js").then((v) => v.index$1).then((v) => {
5990
5990
  i = v.acceleratedRaycast, n = v.MeshBVH, o = v.StaticGeometryGenerator, r = v.computeBoundsTree;
5991
5991
  }).catch((v) => {
5992
- ($t || D()) && console.error("Failed to load BVH library...", v.message);
5992
+ ($t || L()) && console.error("Failed to load BVH library...", v.message);
5993
5993
  }));
5994
5994
  }
5995
5995
  const l = new te();
@@ -5999,7 +5999,7 @@ var td;
5999
5999
  c = !0, h = !0, Promise.resolve().then(() => HA).then((v) => {
6000
6000
  d = v.GenerateMeshBVHWorker;
6001
6001
  }).catch((v) => {
6002
- ($t || D()) && console.warn("Failed to setup mesh bvh worker");
6002
+ ($t || L()) && console.warn("Failed to setup mesh bvh worker");
6003
6003
  }).finally(() => {
6004
6004
  h = !1;
6005
6005
  });
@@ -6266,7 +6266,7 @@ function sd(s) {
6266
6266
  try {
6267
6267
  const t = ke[e];
6268
6268
  if (t.isComponent !== !0) {
6269
- (D() || yp) && console.error(`Registered script is not a Needle Engine component.
6269
+ (L() || yp) && console.error(`Registered script is not a Needle Engine component.
6270
6270
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
6271
6271
  `, t), ke.splice(e, 1), e--;
6272
6272
  continue;
@@ -6367,7 +6367,7 @@ function Rh(s, e = !1) {
6367
6367
  return;
6368
6368
  }
6369
6369
  const t = yc(s);
6370
- u0(s, t, !0) || (yp || D() ? console.error(`Error updating hierarchy
6370
+ u0(s, t, !0) || (yp || L() ? console.error(`Error updating hierarchy
6371
6371
  Do you have circular references in your project? <a target="_blank" href="https://docs.needle.tools/circular-reference"> Click here for more information.`, s) : console.error('Failed to update active state in hierarchy of "' + s.name + '"', s), console.warn(" ↑ this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."));
6372
6372
  }
6373
6373
  function u0(s, e, t, i = 0) {
@@ -6486,7 +6486,7 @@ function Hd(s, e, t = !0, i) {
6486
6486
  return;
6487
6487
  }
6488
6488
  if (!e.isConnected) {
6489
- D() && console.debug("Can not send destroy: not connected", s.guid);
6489
+ L() && console.debug("Can not send destroy: not connected", s.guid);
6490
6490
  return;
6491
6491
  }
6492
6492
  let o = s.guid;
@@ -6543,7 +6543,7 @@ function m0(s, e, t, i) {
6543
6543
  const n = s;
6544
6544
  if (!n.guid)
6545
6545
  return console.warn("Can not instantiate: No guid", n), null;
6546
- if (e.context || (e.context = U.Current), !e.context)
6546
+ if (e.context || (e.context = N.Current), !e.context)
6547
6547
  return console.error("Missing network instantiate options / reference to network connection in sync instantiate"), null;
6548
6548
  const o = e ? { ...e } : null, { instance: r, seed: a } = nP(n, e);
6549
6549
  if (r) {
@@ -6551,7 +6551,7 @@ function m0(s, e, t, i) {
6551
6551
  if (l.guid) {
6552
6552
  od && console.log("[Local] new instance", "gameobject:", r?.guid);
6553
6553
  const c = new eP(n.guid, l.guid);
6554
- c.seed = a, e.deleteOnDisconnect === !0 && (c.deleteStateOnDisconnect = !0), o && (o.position && (c.position = { x: o.position.x, y: o.position.y, z: o.position.z }), o.rotation && (c.rotation = { x: o.rotation.x, y: o.rotation.y, z: o.rotation.z, w: o.rotation.w }), o.scale && (c.scale = { x: o.scale.x, y: o.scale.y, z: o.scale.z })), c.position || (c.position = { x: l.position.x, y: l.position.y, z: l.position.z }), c.rotation || (c.rotation = { x: l.quaternion.x, y: l.quaternion.y, z: l.quaternion.z, w: l.quaternion.w }), c.scale || (c.scale = { x: l.scale.x, y: l.scale.y, z: l.scale.z }), c.visible = n.visible, o?.parent && (typeof o.parent == "string" ? c.parent = o.parent : c.parent = o.parent.guid), c.hostData = t, i === !1 && (c.dontSave = !0), !e?.context?.connection && D() && console.debug("Object will be instantiated but it will not be synced: not connected", n.guid), e.context.connection.isInRoom && Fr.push(new WeakRef(l)), e?.context?.connection.send("new-instance-created", c);
6554
+ c.seed = a, e.deleteOnDisconnect === !0 && (c.deleteStateOnDisconnect = !0), o && (o.position && (c.position = { x: o.position.x, y: o.position.y, z: o.position.z }), o.rotation && (c.rotation = { x: o.rotation.x, y: o.rotation.y, z: o.rotation.z, w: o.rotation.w }), o.scale && (c.scale = { x: o.scale.x, y: o.scale.y, z: o.scale.z })), c.position || (c.position = { x: l.position.x, y: l.position.y, z: l.position.z }), c.rotation || (c.rotation = { x: l.quaternion.x, y: l.quaternion.y, z: l.quaternion.z, w: l.quaternion.w }), c.scale || (c.scale = { x: l.scale.x, y: l.scale.y, z: l.scale.z }), c.visible = n.visible, o?.parent && (typeof o.parent == "string" ? c.parent = o.parent : c.parent = o.parent.guid), c.hostData = t, i === !1 && (c.dontSave = !0), !e?.context?.connection && L() && console.debug("Object will be instantiated but it will not be synced: not connected", n.guid), e.context.connection.isInRoom && Fr.push(new WeakRef(l)), e?.context?.connection.send("new-instance-created", c);
6555
6555
  } else console.warn("Missing guid, can not send new instance event", l);
6556
6556
  }
6557
6557
  return r;
@@ -6570,7 +6570,7 @@ function iP(s) {
6570
6570
  return;
6571
6571
  }
6572
6572
  const i = new Nn();
6573
- e.position && (i.position = new b(e.position.x, e.position.y, e.position.z)), e.rotation && (i.rotation = new N(e.rotation.x, e.rotation.y, e.rotation.z, e.rotation.w)), e.scale && (i.scale = new b(e.scale.x, e.scale.y, e.scale.z)), i.parent = e.parent, e.seed && (i.idProvider = new Tt(e.seed)), i.visible = e.visible, i.context = s, od && s.alias && console.log("[Remote] instantiate in: " + s.alias);
6573
+ e.position && (i.position = new b(e.position.x, e.position.y, e.position.z)), e.rotation && (i.rotation = new $(e.rotation.x, e.rotation.y, e.rotation.z, e.rotation.w)), e.scale && (i.scale = new b(e.scale.x, e.scale.y, e.scale.z)), i.parent = e.parent, e.seed && (i.idProvider = new Tt(e.seed)), i.visible = e.visible, i.context = s, od && s.alias && console.log("[Remote] instantiate in: " + s.alias);
6574
6574
  const n = va(t, i);
6575
6575
  Fr.push(new WeakRef(n)), n && (e.parent === "scene" && s.scene.add(n), od && console.log("[Remote] new instance", "gameobject:", n?.guid, t));
6576
6576
  }), s.connection.beginListen("left-room", () => {
@@ -7254,7 +7254,7 @@ function TP(s) {
7254
7254
  const e = s.gameObject.userData.components.indexOf(s);
7255
7255
  s.gameObject.userData.components.splice(e, 1);
7256
7256
  }
7257
- s.__internalDisable && s.__internalDisable(), cs(s, s.context ?? U.Current), s.destroy(), s.gameObject = null;
7257
+ s.__internalDisable && s.__internalDisable(), cs(s, s.context ?? N.Current), s.destroy(), s.gameObject = null;
7258
7258
  }
7259
7259
  let Hy = !1;
7260
7260
  function P0(s, e, t) {
@@ -7321,7 +7321,7 @@ function Dm(s, e, t, i = !0) {
7321
7321
  }
7322
7322
  function Qd(s, e = void 0, t = !0) {
7323
7323
  if (!s) return null;
7324
- if (!e && (e = U.Current, !e))
7324
+ if (!e && (e = N.Current, !e))
7325
7325
  return console.error("Can not search object without any needle context or scene!!!"), null;
7326
7326
  let i = e;
7327
7327
  if (i.isScene || (i = e?.scene), !i) return null;
@@ -7330,7 +7330,7 @@ function Qd(s, e = void 0, t = !0) {
7330
7330
  }
7331
7331
  function EP(s, e, t = void 0) {
7332
7332
  if (!s) return e ?? [];
7333
- if (e || (e = []), e.length = 0, !t && (t = U.Current, !t))
7333
+ if (e || (e = []), e.length = 0, !t && (t = N.Current, !t))
7334
7334
  return console.error("Can not search object without any needle context or scene!!!"), e;
7335
7335
  "scene" in t && (t = t.scene);
7336
7336
  const i = t;
@@ -7638,7 +7638,7 @@ function va(s, e) {
7638
7638
  return s.instantiate(e ?? void 0);
7639
7639
  let t = null;
7640
7640
  e != null && (e.x !== void 0 ? (t = new Nn(), t.position = e) : t = e);
7641
- let i = U.Current;
7641
+ let i = N.Current;
7642
7642
  t?.context && (i = t.context), Ah && i.alias && console.log("context", i.alias), t && !t.idProvider && (t.idProvider = new Tt(Date.now()));
7643
7643
  const n = [], o = {}, r = {}, a = R0(i, s, t, n, o, r);
7644
7644
  a && (jP(o), DP(r, o)), Ah && (hp(s, !0), hp(a, !0));
@@ -7848,7 +7848,7 @@ var wa;
7848
7848
  headers: v,
7849
7849
  body: p,
7850
7850
  signal: d?.abort
7851
- }).then((B) => (d?.onProgress?.call(null, { progress01: 1, state: "finished" }), B)).catch((B) => B);
7851
+ }).then((z) => (d?.onProgress?.call(null, { progress01: 1, state: "finished" }), z)).catch((z) => z);
7852
7852
  };
7853
7853
  console.debug("Uploading file", y.upload);
7854
7854
  let I = !1, O = null;
@@ -7936,7 +7936,7 @@ class ie {
7936
7936
  * @returns the AssetReference for the URL
7937
7937
  */
7938
7938
  static getOrCreateFromUrl(e, t) {
7939
- if (!t && (t = U.Current, !t))
7939
+ if (!t && (t = N.Current, !t))
7940
7940
  throw new Error('Context is required when sourceId is a string. When you call this method from a component you can call it with "getOrCreate(this, url)" where "this" is the component.');
7941
7941
  const i = t.addressables, n = i.findAssetReference(e);
7942
7942
  if (n) return n;
@@ -7949,7 +7949,7 @@ class ie {
7949
7949
  */
7950
7950
  static getOrCreate(e, t, i) {
7951
7951
  if (typeof e == "string") {
7952
- if (!i && (i = U.Current, !i))
7952
+ if (!i && (i = N.Current, !i))
7953
7953
  throw new Error('Context is required when sourceId is a string. When you call this method from a component you can call it with "getOrCreate(this, url)" where "this" is the component.');
7954
7954
  } else
7955
7955
  i = e.context, e = e.sourceId;
@@ -8031,7 +8031,7 @@ class ie {
8031
8031
  }
8032
8032
  /** frees previously allocated memory and destroys the current `asset` instance (if any) */
8033
8033
  unload() {
8034
- this.asset && (js && console.log("Unload", this.asset), "scene" in this.asset && this.asset.scene && Wi(this.asset.scene, !0, !0), Wi(this.asset, !0, !0)), this.asset = null, this._rawBinary = void 0, this._glbRoot = null, this._loadingPromise = null, U.Current && U.Current.addressables.unregisterAssetReference(this);
8034
+ this.asset && (js && console.log("Unload", this.asset), "scene" in this.asset && this.asset.scene && Wi(this.asset.scene, !0, !0), Wi(this.asset, !0, !0)), this.asset = null, this._rawBinary = void 0, this._glbRoot = null, this._loadingPromise = null, N.Current && N.Current.addressables.unregisterAssetReference(this);
8035
8035
  }
8036
8036
  /** loads the asset binary without creating an instance */
8037
8037
  async preload() {
@@ -8051,7 +8051,7 @@ class ie {
8051
8051
  if (js && console.log("[AssetReference] loadAssetAsync", this.url), !this.mustLoad) return this.asset;
8052
8052
  if (e && this._progressListeners.push(e), this._loadingPromise !== null)
8053
8053
  return this._loadingPromise.then((n) => this.asset);
8054
- const t = U.Current;
8054
+ const t = N.Current;
8055
8055
  if (this._rawBinary) {
8056
8056
  if (!(this._rawBinary instanceof ArrayBuffer))
8057
8057
  return console.error("[AssetReference] Failed loading – Invalid data. Must be of type ArrayBuffer. " + typeof this._rawBinary), null;
@@ -8085,7 +8085,7 @@ class ie {
8085
8085
  }
8086
8086
  static currentlyInstantiating = /* @__PURE__ */ new Map();
8087
8087
  async onInstantiate(e, t = !1, i) {
8088
- const n = U.Current, o = new Nn();
8088
+ const n = N.Current, o = new Nn();
8089
8089
  if (e instanceof M ? o.parent = e : e && (Object.assign(o, e), o.cloneAssign(e)), o.parent === void 0 && (o.parent = n.scene), this.mustLoad && await this.loadAssetAsync(), js && console.log("Instantiate", this.url, "parent:", e), this.asset) {
8090
8090
  js && console.log("Add to scene", this.asset);
8091
8091
  let r = ie.currentlyInstantiating.get(this.url);
@@ -8341,7 +8341,7 @@ class rc {
8341
8341
  }
8342
8342
  }
8343
8343
  function* T0(s, e = null) {
8344
- const t = e ? e.time : U.Current.time, i = t.time;
8344
+ const t = e ? e.time : N.Current.time, i = t.time;
8345
8345
  for (; t.time - i < s; )
8346
8346
  yield;
8347
8347
  }
@@ -8389,7 +8389,7 @@ class VP {
8389
8389
  h && a.push(h);
8390
8390
  }
8391
8391
  const l = await Tb(a);
8392
- l?.anyFailed && D() && console.error("Failed to load lightmap extension", l), o();
8392
+ l?.anyFailed && L() && console.error("Failed to load lightmap extension", l), o();
8393
8393
  })) : null;
8394
8394
  }
8395
8395
  }
@@ -8504,7 +8504,7 @@ class GP {
8504
8504
  }
8505
8505
  /** @internal */
8506
8506
  setRenderer(e) {
8507
- this._lodsManager?.disable(), Ao.removePlugin(this), Ao.addPlugin(this), Ao.debugDrawLine = z.DrawLine, this._lodsManager = Ao.get(e, { engine: "needle-engine" }), this.applySettings(), this._lodsManager.enable();
8507
+ this._lodsManager?.disable(), Ao.removePlugin(this), Ao.addPlugin(this), Ao.debugDrawLine = F.DrawLine, this._lodsManager = Ao.get(e, { engine: "needle-engine" }), this.applySettings(), this._lodsManager.enable();
8508
8508
  }
8509
8509
  disable() {
8510
8510
  this._lodsManager?.disable(), Ao.removePlugin(this);
@@ -8524,7 +8524,7 @@ class GP {
8524
8524
  th.copy(a), th.applyMatrix4(t.matrixWorld);
8525
8525
  const l = th.center, c = th.radius, h = ["#76c43e", "#bcc43e", "#c4ac3e", "#c4673e", "#ff3e3e"];
8526
8526
  if (r)
8527
- z.DrawWireSphere(l, c, h[o], 0.1);
8527
+ F.DrawWireSphere(l, c, h[o], 0.1);
8528
8528
  else {
8529
8529
  const d = t.geometry.index?.count ?? 0, f = We.getMeshLODExtension(t.geometry)?.lods;
8530
8530
  o = f ? Math.min(f?.length - 1, o) : 0;
@@ -8543,8 +8543,8 @@ TEX ` + i.texture_lod;
8543
8543
  ` + (n.lastScreenCoverage * 100).toFixed(1) + `% cov
8544
8544
  ` + (n.lastCentrality * 100).toFixed(1) + `% centr
8545
8545
  ` + (eh.min.x.toFixed(2) + "-" + eh.max.x.toFixed(2) + "x" + eh.min.y.toFixed(2) + "-" + eh.max.y.toFixed(2)) + " scr"), n.lastScreenCoverage > 0.1) {
8546
- const m = e, v = m.worldForward, y = m.worldPosition, I = G(v).multiplyScalar(c * 0.7).add(l), O = I.distanceTo(y), k = h[Math.min(h.length - 1, Math.max(0, o))] + "88", E = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1, B = e.isPerspectiveCamera ? Math.tan(e.fov * Math.PI / 180 / 2) : 1;
8547
- z.DrawLabel(I, _, O * 0.012 * E * B, void 0, 16777215, k);
8546
+ const m = e, v = m.worldForward, y = m.worldPosition, I = G(v).multiplyScalar(c * 0.7).add(l), O = I.distanceTo(y), k = h[Math.min(h.length - 1, Math.max(0, o))] + "88", E = this.context.domHeight > 0 ? screen.height / this.context.domHeight : 1, z = e.isPerspectiveCamera ? Math.tan(e.fov * Math.PI / 180 / 2) : 1;
8547
+ F.DrawLabel(I, _, O * 0.012 * E * z, void 0, 16777215, k);
8548
8548
  }
8549
8549
  }
8550
8550
  }
@@ -8977,7 +8977,7 @@ vec3 NeutralToneMapping( vec3 color ) {
8977
8977
  if (i >= 0 && n >= 0) {
8978
8978
  const o = Wt.tonemapping_pars_fragment.substring(i, n + t.length);
8979
8979
  Wt.tonemapping_pars_fragment = Wt.tonemapping_pars_fragment.replace(o, s);
8980
- } else D() && console.error("Couldn't find NeutralToneMapping in ShaderChunk.tonemapping_pars_fragment");
8980
+ } else L() && console.error("Couldn't find NeutralToneMapping in ShaderChunk.tonemapping_pars_fragment");
8981
8981
  }
8982
8982
  function rO() {
8983
8983
  const s = `
@@ -9095,7 +9095,7 @@ vec3 AgXToneMapping( vec3 color ) {
9095
9095
  if (i >= 0 && n >= 0) {
9096
9096
  const o = Wt.tonemapping_pars_fragment.substring(i, n + t.length);
9097
9097
  Wt.tonemapping_pars_fragment = Wt.tonemapping_pars_fragment.replace(o, s);
9098
- } else D() && console.error("Couldn't find AgXToneMapping in ShaderChunk.tonemapping_pars_fragment");
9098
+ } else L() && console.error("Couldn't find AgXToneMapping in ShaderChunk.tonemapping_pars_fragment");
9099
9099
  }
9100
9100
  function A0(s) {
9101
9101
  if (typeof s == "string")
@@ -9171,7 +9171,7 @@ class On {
9171
9171
  if (this._fullscreenButton)
9172
9172
  return this._fullscreenButton;
9173
9173
  if (!document.fullscreenEnabled)
9174
- return D() && console.warn("NeedleMenu: Fullscreen button could not be created, device doesn't support the Fullscreen API"), null;
9174
+ return L() && console.warn("NeedleMenu: Fullscreen button could not be created, device doesn't support the Fullscreen API"), null;
9175
9175
  const t = document.createElement("button");
9176
9176
  this._fullscreenButton = t, t.classList.add("fullscreen-button"), t.title = "Click to enter fullscreen mode";
9177
9177
  const i = Mt("fullscreen"), n = Mt("fullscreen_exit");
@@ -9243,7 +9243,7 @@ class On {
9243
9243
  const n = document.createElement("div");
9244
9244
  n.classList.add("qr-code-container"), i.appendChild(n), t.addEventListener("click", () => {
9245
9245
  if (i.parentNode) return r();
9246
- D() && window.location.href.includes("://localhost") && ge("To access your website from another device in the same local network you have to use the IP address instead of localhost. The IP address is logged in your development server console when you start the server."), o();
9246
+ L() && window.location.href.includes("://localhost") && ge("To access your website from another device in the same local network you have to use the IP address instead of localhost. The IP address is logged in your development server console when you start the server."), o();
9247
9247
  });
9248
9248
  async function o() {
9249
9249
  await a();
@@ -9396,7 +9396,7 @@ class lO {
9396
9396
  this.menu?.removeFromParent();
9397
9397
  return;
9398
9398
  }
9399
- if (mf && q.isDesktop() && this.updateMenu(), !this._context.xr?.running) {
9399
+ if (mf && X.isDesktop() && this.updateMenu(), !this._context.xr?.running) {
9400
9400
  this._wasInXR && (this._wasInXR = !1, this.onExitXR());
9401
9401
  return;
9402
9402
  }
@@ -9432,7 +9432,7 @@ class lO {
9432
9432
  const t = this._context.mainCamera, n = this._context.xr?.rigScale || 1;
9433
9433
  if (t) {
9434
9434
  const o = t.worldPosition, r = t.worldForward.multiplyScalar(-1), a = r.y > 0.6, l = r.y > 0.4, c = (e.visible ? l : a) || this.userRequestedMenu, h = !e.visible && c;
9435
- e.visible = c || q.isDesktop() && mf, r.multiplyScalar(3 * n), o.add(r), (h || !1) && (e.position.copy(this._menuTarget.position), e.position.y += 0.25, this._menuTarget.position.copy(e.position), this.positionFilter.reset(e.position), e.quaternion.copy(this._menuTarget.quaternion), this.markDirty());
9435
+ e.visible = c || X.isDesktop() && mf, r.multiplyScalar(3 * n), o.add(r), (h || !1) && (e.position.copy(this._menuTarget.position), e.position.y += 0.25, this._menuTarget.position.copy(e.position), this.positionFilter.reset(e.position), e.quaternion.copy(this._menuTarget.quaternion), this.markDirty());
9436
9436
  const f = this._menuTarget.position.distanceTo(o);
9437
9437
  (h || f > 1.5 * n) && (this.ensureRenderOnTop(this.menu), this._menuTarget.position.copy(o), this._context.scene.add(this._menuTarget), Nd(this._menuTarget, this._context.mainCamera, !0, !0), this._menuTarget.removeFromParent()), this.positionFilter.filter(this._menuTarget.position, e.position, this._context.time.time), this.menu?.quaternion.slerp(this._menuTarget.quaternion, this._context.time.deltaTime * 5), this.menu?.scale.setScalar(n);
9438
9438
  }
@@ -9738,7 +9738,7 @@ let hO = class {
9738
9738
  * If enabled=true then a button will be added to the menu that will show a QR code for the current page when clicked.
9739
9739
  */
9740
9740
  showQRCodeButton(e) {
9741
- if (e === "desktop-only" && (e = !q.isMobileDevice()), e) {
9741
+ if (e === "desktop-only" && (e = !X.isMobileDevice()), e) {
9742
9742
  const t = On.getOrCreate().createQRCode();
9743
9743
  return t.style.display = "", this._menu.appendChild(t), t;
9744
9744
  } else {
@@ -10412,32 +10412,32 @@ var xe = /* @__PURE__ */ ((s) => (s[s.Start = -1] = "Start", s[s.EarlyUpdate = 0
10412
10412
  function Um(s, e) {
10413
10413
  if (!s) return;
10414
10414
  if (!s.isComponent) {
10415
- (D() || Xe) && console.error(`Registered script is not a Needle Engine component.
10415
+ (L() || Xe) && console.error(`Registered script is not a Needle Engine component.
10416
10416
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
10417
10417
  `, s);
10418
10418
  return;
10419
10419
  }
10420
- e || (e = U.Current, Xe && console.warn("> Registering component without context"));
10420
+ e || (e = N.Current, Xe && console.warn("> Registering component without context"));
10421
10421
  const t = e?.new_scripts;
10422
10422
  t.includes(s) || t.push(s);
10423
10423
  }
10424
- class U {
10424
+ class N {
10425
10425
  static _defaultTargetFramerate = { value: 90, toString() {
10426
10426
  return this.value;
10427
10427
  } };
10428
10428
  /** When a new context is created this is the framerate that will be used by default */
10429
10429
  static get DefaultTargetFrameRate() {
10430
- return U._defaultTargetFramerate.value;
10430
+ return N._defaultTargetFramerate.value;
10431
10431
  }
10432
10432
  /** When a new context is created this is the framerate that will be used by default */
10433
10433
  static set DefaultTargetFrameRate(e) {
10434
- U._defaultTargetFramerate.value = e;
10434
+ N._defaultTargetFramerate.value = e;
10435
10435
  }
10436
10436
  static _defaultWebglRendererParameters = {
10437
10437
  antialias: !0,
10438
10438
  alpha: !1,
10439
10439
  // Note: this is due to a bug on OSX devices. See NE-5370
10440
- powerPreference: q.isiOS() || q.isMacOS() ? "default" : "high-performance",
10440
+ powerPreference: X.isiOS() || X.isMacOS() ? "default" : "high-performance",
10441
10441
  stencil: !0
10442
10442
  // logarithmicDepthBuffer: true,
10443
10443
  // reverseDepthBuffer: true, // https://github.com/mrdoob/three.js/issues/29770
@@ -10451,7 +10451,7 @@ class U {
10451
10451
  * ```
10452
10452
  */
10453
10453
  static get DefaultWebGLRendererParameters() {
10454
- return U._defaultWebglRendererParameters;
10454
+ return N._defaultWebglRendererParameters;
10455
10455
  }
10456
10456
  /** The needle engine version */
10457
10457
  get version() {
@@ -10764,11 +10764,11 @@ class U {
10764
10764
  * @returns {WebGLRenderer} the newly created renderer
10765
10765
  */
10766
10766
  createNewRenderer(e) {
10767
- if (this.renderer?.dispose(), e = { ...U.DefaultWebGLRendererParameters, ...e }, !e.canvas) {
10767
+ if (this.renderer?.dispose(), e = { ...N.DefaultWebGLRendererParameters, ...e }, !e.canvas) {
10768
10768
  const t = this.domElement?.shadowRoot?.querySelector("canvas");
10769
10769
  t && (e.canvas = t, Xe && console.log("Using canvas from shadow root", t));
10770
10770
  }
10771
- return Xe && console.log("Using Renderer Parameters:", e, this.domElement), this.renderer = new ur(e), this.renderer.debug.checkShaderErrors = D() || w("checkshadererrors") === !0, this.renderer.toneMappingExposure = 1, this.renderer.toneMapping = Gh, this.renderer.setClearColor(new se("lightgrey"), 0), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = nx, this.renderer.setSize(this.domWidth, this.domHeight), this.renderer.outputColorSpace = Cs, this.renderer.nodes = {
10771
+ return Xe && console.log("Using Renderer Parameters:", e, this.domElement), this.renderer = new ur(e), this.renderer.debug.checkShaderErrors = L() || w("checkshadererrors") === !0, this.renderer.toneMappingExposure = 1, this.renderer.toneMapping = Gh, this.renderer.setClearColor(new se("lightgrey"), 0), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = nx, this.renderer.setSize(this.domWidth, this.domHeight), this.renderer.outputColorSpace = Cs, this.renderer.nodes = {
10772
10772
  library: new sx(),
10773
10773
  modelViewMatrix: null,
10774
10774
  modelNormalViewMatrix: null
@@ -10876,14 +10876,14 @@ class U {
10876
10876
  this.internalOnDestroy();
10877
10877
  }
10878
10878
  internalOnDestroy() {
10879
- U.Current = this, he.dispatchCallback(ce.ContextDestroying, this), mn(this, ce.ContextDestroying), this.clear(), this.renderer?.setAnimationLoop(null), this.renderer && (this.renderer.setClearAlpha(0), this.renderer.clear(), this.isManagedExternally || (Xe && console.log("Disposing renderer"), this.renderer.dispose())), this.scene = null, this.renderer = null, this.input.dispose(), this.menu.onDestroy(), this.animations.onDestroy();
10879
+ N.Current = this, he.dispatchCallback(ce.ContextDestroying, this), mn(this, ce.ContextDestroying), this.clear(), this.renderer?.setAnimationLoop(null), this.renderer && (this.renderer.setClearAlpha(0), this.renderer.clear(), this.isManagedExternally || (Xe && console.log("Disposing renderer"), this.renderer.dispose())), this.scene = null, this.renderer = null, this.input.dispose(), this.menu.onDestroy(), this.animations.onDestroy();
10880
10880
  for (const e of this._disposeCallbacks)
10881
10881
  try {
10882
10882
  e();
10883
10883
  } catch (t) {
10884
10884
  console.error("Error in on dispose callback:", t, e);
10885
10885
  }
10886
- this.domElement?.parentElement && this.domElement.parentElement.removeChild(this.domElement), this._isCreated = !1, he.dispatchCallback(ce.ContextDestroyed, this), mn(this, ce.ContextDestroyed), he.unregister(this), U.Current === this && (U.Current = null);
10886
+ this.domElement?.parentElement && this.domElement.parentElement.removeChild(this.domElement), this._isCreated = !1, he.dispatchCallback(ce.ContextDestroyed, this), mn(this, ce.ContextDestroyed), he.unregister(this), N.Current === this && (N.Current = null);
10887
10887
  }
10888
10888
  /** @internal Automatically called by components when you call `startCoroutine`. Use `startCoroutine` instead */
10889
10889
  registerCoroutineUpdate(e, t, i) {
@@ -11016,7 +11016,7 @@ Start a coroutine from a component by calling "this.startCoroutine(myCoroutine()
11016
11016
  Xe && console.log("Creating context", this.name, e);
11017
11017
  const i = globalThis["needle:dependencies:ready"];
11018
11018
  i instanceof Promise && (Xe && console.log("Waiting for dependencies to be ready"), await i.catch((c) => {
11019
- if (Xe || D()) {
11019
+ if (Xe || L()) {
11020
11020
  if (Wd("Needle Engine dependencies failed to load. Please check the console for more details"), c instanceof ReferenceError) {
11021
11021
  let h = "YourComponentName";
11022
11022
  const d = c.message.indexOf("'");
@@ -11044,10 +11044,10 @@ Possible solutions:
11044
11044
  Xe && console.log("Needle Engine dependencies are ready");
11045
11045
  })), this.clear();
11046
11046
  const n = this.renderer, o = !n || n.isDisposed === !0;
11047
- this.isManagedExternally === !1 && o ? this.createNewRenderer() : this.lodsManager.setRenderer(this.renderer), this.renderer?.setAnimationLoop(null), U.Current = this, await he.dispatchCallback(ce.ContextCreationStart, this);
11047
+ this.isManagedExternally === !1 && o ? this.createNewRenderer() : this.lodsManager.setRenderer(this.renderer), this.renderer?.setAnimationLoop(null), N.Current = this, await he.dispatchCallback(ce.ContextCreationStart, this);
11048
11048
  let r = !0, a;
11049
11049
  try {
11050
- U.Current = this, e ? a = await this.internalLoadInitialContent(t, e) : a = [];
11050
+ N.Current = this, e ? a = await this.internalLoadInitialContent(t, e) : a = [];
11051
11051
  } catch (c) {
11052
11052
  console.error(c), r = !1;
11053
11053
  }
@@ -11057,7 +11057,7 @@ Possible solutions:
11057
11057
  return !1;
11058
11058
  if (this.internalOnUpdateVisible(), !this.renderer)
11059
11059
  return Xe && console.warn("Context has no renderer (perhaps it was disconnected?", this.domElement.isConnected), !1;
11060
- !this.isManagedExternally && !this.domElement.shadowRoot && this.domElement.prepend(this.renderer.domElement), U.Current = this, U.Current = this;
11060
+ !this.isManagedExternally && !this.domElement.shadowRoot && this.domElement.prepend(this.renderer.domElement), N.Current = this, N.Current = this;
11061
11061
  for (let c = 0; c < this.new_scripts.length; c++) {
11062
11062
  const h = this.new_scripts[c];
11063
11063
  if (h.gameObject !== void 0 && h.gameObject !== null) {
@@ -11068,9 +11068,9 @@ Possible solutions:
11068
11068
  }
11069
11069
  if (this.post_setup_callbacks)
11070
11070
  for (let c = 0; c < this.post_setup_callbacks.length; c++)
11071
- U.Current = this, await this.post_setup_callbacks[c](this);
11071
+ N.Current = this, await this.post_setup_callbacks[c](this);
11072
11072
  if (!this._mainCamera) {
11073
- U.Current = this;
11073
+ N.Current = this;
11074
11074
  let c = null;
11075
11075
  ba(this.scene, (h) => {
11076
11076
  const d = h;
@@ -11082,7 +11082,7 @@ Possible solutions:
11082
11082
  }
11083
11083
  }), c ? this.setCurrentCamera(c) : !he.dispatchCallback(ce.MissingCamera, this, { files: a }) && !this.mainCamera && !this.isManagedExternally && console.warn("Missing camera in main scene", this);
11084
11084
  }
11085
- this.input.bindEvents(), U.Current = this, sd(this), this.physics.engine && (this.physics.engine?.step(0), this.physics.engine?.postStep()), !this.isManagedExternally && this.composer && this.mainCamera, this._needsUpdateSize = !0, this._stats && (this._stats.showPanel(0), this._stats.dom.style.position = "absolute", this.domElement.shadowRoot?.appendChild(this._stats.dom)), Xe && hp(this.scene, !0), this.targetFrameRate === void 0 ? (Xe && console.warn("No target framerate set, using default", U.DefaultTargetFrameRate), this.targetFrameRate = U._defaultTargetFramerate) : Xe && console.log("Target framerate set to", this.targetFrameRate), this._dispatchReadyAfterFrame = !0;
11085
+ this.input.bindEvents(), N.Current = this, sd(this), this.physics.engine && (this.physics.engine?.step(0), this.physics.engine?.postStep()), !this.isManagedExternally && this.composer && this.mainCamera, this._needsUpdateSize = !0, this._stats && (this._stats.showPanel(0), this._stats.dom.style.position = "absolute", this.domElement.shadowRoot?.appendChild(this._stats.dom)), Xe && hp(this.scene, !0), this.targetFrameRate === void 0 ? (Xe && console.warn("No target framerate set, using default", N.DefaultTargetFrameRate), this.targetFrameRate = N._defaultTargetFramerate) : Xe && console.log("Target framerate set to", this.targetFrameRate), this._dispatchReadyAfterFrame = !0;
11086
11086
  const l = he.dispatchCallback(ce.ContextCreated, this, { files: a });
11087
11087
  if (l) {
11088
11088
  const c = this.domElement;
@@ -11157,11 +11157,11 @@ Possible solutions:
11157
11157
  _renderlooperrors = 0;
11158
11158
  /** Performs a full update step including script callbacks, rendering (unless isManagedExternally is set to false) and post render callbacks */
11159
11159
  update(e, t) {
11160
- if (t === void 0 && (t = null), D() || Xe || G1())
11160
+ if (t === void 0 && (t = null), L() || Xe || G1())
11161
11161
  try {
11162
11162
  this.internalStep(e, t), this._renderlooperrors = 0;
11163
11163
  } catch (i) {
11164
- this._renderlooperrors += 1, (D() || Xe) && (i instanceof Error || i instanceof TypeError) && Be("Caught unhandled exception during render-loop - see console for details.", Ui.Error), console.error("Frame #" + this.time.frame + `
11164
+ this._renderlooperrors += 1, (L() || Xe) && (i instanceof Error || i instanceof TypeError) && Be("Caught unhandled exception during render-loop - see console for details.", Ui.Error), console.error("Frame #" + this.time.frame + `
11165
11165
  `, i), this._renderlooperrors >= 3 && (console.warn("Stopping render loop due to error"), this.renderer.setAnimationLoop(null)), this.domElement.dispatchEvent(new CustomEvent("error", { detail: i }));
11166
11166
  }
11167
11167
  else
@@ -11203,8 +11203,8 @@ Possible solutions:
11203
11203
  return !1;
11204
11204
  this._accumulatedTime = 0;
11205
11205
  }
11206
- if (this._stats?.begin(), U.Current = this, this.onHandlePaused()) return !1;
11207
- for (U.Current = this, this.time.update(), fO && console.log("FPS", this.time.smoothedFps.toFixed(0)), sd(this), Rh(this.scene), d0(this), mn(
11206
+ if (this._stats?.begin(), N.Current = this, this.onHandlePaused()) return !1;
11207
+ for (N.Current = this, this.time.update(), fO && console.log("FPS", this.time.smoothedFps.toFixed(0)), sd(this), Rh(this.scene), d0(this), mn(
11208
11208
  this,
11209
11209
  -1
11210
11210
  /* Start */
@@ -11224,7 +11224,7 @@ Possible solutions:
11224
11224
  this._currentFrameEvent = 0;
11225
11225
  for (let n = 0; n < this.scripts_earlyUpdate.length; n++) {
11226
11226
  const o = this.scripts_earlyUpdate[n];
11227
- o.activeAndEnabled && o.earlyUpdate !== void 0 && (U.Current = this, o.earlyUpdate());
11227
+ o.activeAndEnabled && o.earlyUpdate !== void 0 && (N.Current = this, o.earlyUpdate());
11228
11228
  }
11229
11229
  this.executeCoroutines(
11230
11230
  0
@@ -11236,7 +11236,7 @@ Possible solutions:
11236
11236
  ), this._currentFrameEvent = 1;
11237
11237
  for (let n = 0; n < this.scripts_update.length; n++) {
11238
11238
  const o = this.scripts_update[n];
11239
- o.activeAndEnabled && o.update !== void 0 && (U.Current = this, o.update());
11239
+ o.activeAndEnabled && o.update !== void 0 && (N.Current = this, o.update());
11240
11240
  }
11241
11241
  this.executeCoroutines(
11242
11242
  1
@@ -11248,7 +11248,7 @@ Possible solutions:
11248
11248
  ), this._currentFrameEvent = 2;
11249
11249
  for (let n = 0; n < this.scripts_lateUpdate.length; n++) {
11250
11250
  const o = this.scripts_lateUpdate[n];
11251
- o.activeAndEnabled && o.lateUpdate !== void 0 && (U.Current = this, o.lateUpdate());
11251
+ o.activeAndEnabled && o.lateUpdate !== void 0 && (N.Current = this, o.lateUpdate());
11252
11252
  }
11253
11253
  if (this.executeCoroutines(
11254
11254
  2
@@ -11261,7 +11261,7 @@ Possible solutions:
11261
11261
  this._focusRect && this.mainCamera instanceof pe && SC(this._focusRect, this.time.deltaTime / 0.05, this.mainCamera, this.renderer), this._currentFrameEvent = 3;
11262
11262
  for (let n = 0; n < this.scripts_onBeforeRender.length; n++) {
11263
11263
  const o = this.scripts_onBeforeRender[n];
11264
- o.activeAndEnabled && o.onBeforeRender !== void 0 && (U.Current = this, o.onBeforeRender(t));
11264
+ o.activeAndEnabled && o.onBeforeRender !== void 0 && (N.Current = this, o.onBeforeRender(t));
11265
11265
  }
11266
11266
  if (this.executeCoroutines(
11267
11267
  3
@@ -11296,7 +11296,7 @@ Possible solutions:
11296
11296
  if (this.isVisibleToUser || this.runInBackground) {
11297
11297
  for (let e = 0; e < this.scripts_onAfterRender.length; e++) {
11298
11298
  const t = this.scripts_onAfterRender[e];
11299
- t.activeAndEnabled && t.onAfterRender !== void 0 && (U.Current = this, t.onAfterRender());
11299
+ t.activeAndEnabled && t.onAfterRender !== void 0 && (N.Current = this, t.onAfterRender());
11300
11300
  }
11301
11301
  if (this.executeCoroutines(
11302
11302
  4
@@ -11323,7 +11323,7 @@ Target Framerate: ` + this.targetFrameRate)), this._dispatchReadyAfterFrame && (
11323
11323
  e && "setMainCamera" in this.composer && this.composer.passes[0]?.mainCamera != e && this.composer.setMainCamera(e);
11324
11324
  const t = this.renderer.getClearColor(this._tempClearColor), i = this.renderer.getClearAlpha();
11325
11325
  this._tempClearColor2.copy(t), this.renderer.setClearColor(t.convertSRGBToLinear(), this.renderer.getClearAlpha()), this.composer.render(this.time.deltaTime), this.renderer.setClearColor(this._tempClearColor2, i);
11326
- } else e && (this.isInXR && q.isMacOS() && this.renderer.clearDepth(), this.renderer.render(this.scene, e));
11326
+ } else e && (this.isInXR && X.isMacOS() && this.renderer.clearDepth(), this.renderer.render(this.scene, e));
11327
11327
  return this._isRendering = !1, !0;
11328
11328
  }
11329
11329
  _contextRestoreTries = 0;
@@ -11338,7 +11338,7 @@ Target Framerate: ` + this.targetFrameRate)), this._dispatchReadyAfterFrame && (
11338
11338
  uO && console.log("Paused?", e, "context:" + this.alias);
11339
11339
  for (let t = 0; t < this.scripts_pausedChanged.length; t++) {
11340
11340
  const i = this.scripts_pausedChanged[t];
11341
- i.activeAndEnabled && i.onPausedChanged !== void 0 && (U.Current = this, i.onPausedChanged(e, this._wasPaused));
11341
+ i.activeAndEnabled && i.onPausedChanged !== void 0 && (N.Current = this, i.onPausedChanged(e, this._wasPaused));
11342
11342
  }
11343
11343
  }
11344
11344
  return this._wasPaused = e, e;
@@ -11597,7 +11597,7 @@ async function bO(s) {
11597
11597
  border-radius: .5em;
11598
11598
  border: 2px solid rgba(160,160,160,.3);
11599
11599
  `, n = `Needle Engine — No license active, commercial use is not allowed. Visit https://needle.tools/pricing for more information and licensing options! v${En}`;
11600
- U.Current?.xr ? console.log(n) : console.log("%c " + n, t);
11600
+ N.Current?.xr ? console.log(n) : console.log("%c " + n, t);
11601
11601
  }
11602
11602
  async function vO(s) {
11603
11603
  if (window.crossOriginIsolated) return;
@@ -11828,7 +11828,7 @@ class S extends M {
11828
11828
  * @param processStart Whether to process the start callbacks if being activated
11829
11829
  */
11830
11830
  static setActive(e, t, i = !0) {
11831
- e && (Ih(e, t), Rh(e), t && i && d0(U.Current, e));
11831
+ e && (Ih(e, t), Rh(e), t && i && d0(N.Current, e));
11832
11832
  }
11833
11833
  /**
11834
11834
  * Checks if the GameObject itself is active (same as go.visible)
@@ -11893,7 +11893,7 @@ class S extends M {
11893
11893
  static destroySynced(e, t, i = !0) {
11894
11894
  if (!e) return;
11895
11895
  const n = e;
11896
- t = t ?? U.Current, Hd(n, t.connection, i);
11896
+ t = t ?? N.Current, Hd(n, t.connection, i);
11897
11897
  }
11898
11898
  /**
11899
11899
  * Destroys an object
@@ -11915,7 +11915,7 @@ class S extends M {
11915
11915
  console.warn("Can not add object to self", e);
11916
11916
  return;
11917
11917
  }
11918
- i || (i = U.Current), t.add(e), Ih(e, !0), Rh(e), i ? S.foreachComponent(e, (n) => {
11918
+ i || (i = N.Current), t.add(e), Ih(e, !0), Rh(e), i ? S.foreachComponent(e, (n) => {
11919
11919
  Am(n, i), !n.__internalDidAwakeAndStart && i.new_script_start.includes(n) === !1 && i.new_script_start.push(n);
11920
11920
  }, !0) : console.warn("Missing context");
11921
11921
  }
@@ -12029,7 +12029,7 @@ class S extends M {
12029
12029
  * @returns The first matching component if found, otherwise null
12030
12030
  */
12031
12031
  static findObjectOfType(e, t, i = !0) {
12032
- return Qd(e, t ?? U.Current, i);
12032
+ return Qd(e, t ?? N.Current, i);
12033
12033
  }
12034
12034
  /**
12035
12035
  * Finds all objects of the specified component type in the scene
@@ -12114,7 +12114,7 @@ class T {
12114
12114
  * including physics, timing utilities, camera, and scene
12115
12115
  */
12116
12116
  get context() {
12117
- return this.__context ?? U.Current;
12117
+ return this.__context ?? N.Current;
12118
12118
  }
12119
12119
  set context(e) {
12120
12120
  this.__context = e;
@@ -12327,7 +12327,7 @@ class T {
12327
12327
  }
12328
12328
  /** @internal */
12329
12329
  __internalEnable(e) {
12330
- return this.__destroyed ? (D() && console.warn("[Needle Engine Dev] Trying to enable destroyed component"), !1) : this.__didAwake ? this.__didEnable ? (e !== !0 && (this.__isEnabled = !0), !1) : (this.__didEnable = !0, this.__isEnabled = !0, this.onEnable(), !0) : !1;
12330
+ return this.__destroyed ? (L() && console.warn("[Needle Engine Dev] Trying to enable destroyed component"), !1) : this.__didAwake ? this.__didEnable ? (e !== !0 && (this.__isEnabled = !0), !1) : (this.__didEnable = !0, this.__isEnabled = !0, this.onEnable(), !0) : !1;
12331
12331
  }
12332
12332
  /** @internal */
12333
12333
  __internalDisable(e) {
@@ -12352,7 +12352,7 @@ class T {
12352
12352
  }
12353
12353
  set enabled(e) {
12354
12354
  if (this.__destroyed) {
12355
- D() && console.warn(`[Needle Engine Dev] Trying to ${e ? "enable" : "disable"} destroyed component`);
12355
+ L() && console.warn(`[Needle Engine Dev] Trying to ${e ? "enable" : "disable"} destroyed component`);
12356
12356
  return;
12357
12357
  }
12358
12358
  if (typeof e == "number" && (e >= 0.5 ? e = !0 : e = !1), !this.__didAwake) {
@@ -12860,7 +12860,7 @@ function EO(s) {
12860
12860
  class YI {
12861
12861
  _context;
12862
12862
  get context() {
12863
- return this._context ?? U.Current;
12863
+ return this._context ?? N.Current;
12864
12864
  }
12865
12865
  get isStateMachineBehaviour() {
12866
12866
  return !0;
@@ -13230,7 +13230,7 @@ class on {
13230
13230
  }
13231
13231
  }
13232
13232
  setStartTransition() {
13233
- this.model.layers.length > 1 && (et || D()) && console.warn("Multiple layers are not supported yet " + this.animator?.name);
13233
+ this.model.layers.length > 1 && (et || L()) && console.warn("Multiple layers are not supported yet " + this.animator?.name);
13234
13234
  for (const e of this.model.layers) {
13235
13235
  const t = e.stateMachine;
13236
13236
  t.defaultState === void 0 && (et && console.warn("AnimatorController default state is undefined, will assign state 0 as default", e), t.defaultState = 0);
@@ -13381,7 +13381,7 @@ Exit Time: ` + c, o.hasExitTime);
13381
13381
  r.conditions || (r.conditions = []);
13382
13382
  if (o.motion || (et && console.warn("No motion", o), o.motion = AO(o.name)), this.animator && o.motion.clips) {
13383
13383
  const r = o.motion.clips?.find((a) => a.node.name === this.animator?.gameObject?.name);
13384
- r ? o.motion.clip = r.clip : (et || D()) && console.warn('Could not find clip for animator "' + this.animator?.gameObject?.name + '"', o.motion.clips.map((a) => a.node.name));
13384
+ r ? o.motion.clip = r.clip : (et || L()) && console.warn('Could not find clip for animator "' + this.animator?.gameObject?.name + '"', o.motion.clips.map((a) => a.node.name));
13385
13385
  }
13386
13386
  if (!o.motion.clip) {
13387
13387
  et && console.warn("No clip assigned to state", o);
@@ -13394,7 +13394,7 @@ Exit Time: ` + c, o.hasExitTime);
13394
13394
  const a = this.createAction(r);
13395
13395
  o.motion.action = a;
13396
13396
  } else
13397
- (et || D()) && console.warn("No valid animationclip assigned", o);
13397
+ (et || L()) && console.warn("No valid animationclip assigned", o);
13398
13398
  }
13399
13399
  if (o.behaviours && Array.isArray(o.behaviours))
13400
13400
  for (const r of o.behaviours) {
@@ -13404,7 +13404,7 @@ Exit Time: ` + c, o.hasExitTime);
13404
13404
  const l = new a();
13405
13405
  l.isStateMachineBehaviour && (l._context = this.context ?? void 0, ya(l, r.properties), r.instance = l), et && console.log("Created animator controller behaviour", o.name, r.typeName, r.properties, l);
13406
13406
  } else
13407
- (et || D()) && console.warn("Could not find AnimatorBehaviour type: " + r.typeName);
13407
+ (et || L()) && console.warn("Could not find AnimatorBehaviour type: " + r.typeName);
13408
13408
  }
13409
13409
  }
13410
13410
  }
@@ -13483,13 +13483,13 @@ class nt {
13483
13483
  rotationWrapper = null;
13484
13484
  context;
13485
13485
  positionChange = new b();
13486
- rotationChange = new N();
13486
+ rotationChange = new $();
13487
13487
  constructor(e, t, i, n, o) {
13488
- if (this.context = e, this.root = t, this.clip = i, nt.firstKeyframeRotation[this.cacheId] || (nt.firstKeyframeRotation[this.cacheId] = new N()), o) {
13488
+ if (this.context = e, this.root = t, this.clip = i, nt.firstKeyframeRotation[this.cacheId] || (nt.firstKeyframeRotation[this.cacheId] = new $()), o) {
13489
13489
  const r = o.values;
13490
13490
  nt.firstKeyframeRotation[this.cacheId].set(r[0], r[1], r[2], r[3]);
13491
13491
  }
13492
- nt.spaceRotation[this.cacheId] || (nt.spaceRotation[this.cacheId] = new N()), nt.effectiveSpaceRotation[this.cacheId] || (nt.effectiveSpaceRotation[this.cacheId] = new N()), nt.clipOffsetRotation[this.cacheId] = new N(), o && nt.clipOffsetRotation[this.cacheId].set(o.values[0], o.values[1], o.values[2], o.values[3]).invert(), this.handlePosition(i, n), this.handleRotation(i, o);
13492
+ nt.spaceRotation[this.cacheId] || (nt.spaceRotation[this.cacheId] = new $()), nt.effectiveSpaceRotation[this.cacheId] || (nt.effectiveSpaceRotation[this.cacheId] = new $()), nt.clipOffsetRotation[this.cacheId] = new $(), o && nt.clipOffsetRotation[this.cacheId].set(o.values[0], o.values[1], o.values[2], o.values[3]).invert(), this.handlePosition(i, n), this.handleRotation(i, o);
13493
13493
  }
13494
13494
  onStart(e) {
13495
13495
  if (e.getClip() !== this.clip) return;
@@ -13515,17 +13515,17 @@ class nt {
13515
13515
  });
13516
13516
  }
13517
13517
  }
13518
- static identityQuaternion = new N();
13518
+ static identityQuaternion = new $();
13519
13519
  handleRotation(e, t) {
13520
13520
  if (t) {
13521
13521
  if (oh) {
13522
- const r = t.values, a = new Rt().setFromQuaternion(new N(r[0], r[1], r[2], r[3]));
13522
+ const r = t.values, a = new Rt().setFromQuaternion(new $(r[0], r[1], r[2], r[3]));
13523
13523
  console.log(e.name, t.name, "FIRST ROTATION IN TRACK", j.toDegrees(a.y));
13524
- const l = t.values.length - 4, c = new N().set(r[l], r[l + 1], r[l + 2], r[l + 3]), h = new Rt().setFromQuaternion(c);
13524
+ const l = t.values.length - 4, c = new $().set(r[l], r[l + 1], r[l + 2], r[l + 3]), h = new Rt().setFromQuaternion(c);
13525
13525
  console.log(e.name, t.name, "LAST ROTATION IN TRACK", j.toDegrees(h.y));
13526
13526
  }
13527
13527
  let i = 0;
13528
- const n = new N(), o = new N();
13528
+ const n = new $(), o = new $();
13529
13529
  this.rotationWrapper = new c_(t, (r, a) => (r > i && (o.set(a[0], a[1], a[2], a[3]), n.invert(), o.multiply(n), this.rotationChange.copy(o)), n.fromArray(a), i = r, a[0] = 0, a[1] = 0, a[2] = 0, a[3] = 1, a));
13530
13530
  }
13531
13531
  }
@@ -13542,7 +13542,7 @@ class IO {
13542
13542
  handler = [];
13543
13543
  root;
13544
13544
  basePosition = new b();
13545
- baseQuaternion = new N();
13545
+ baseQuaternion = new $();
13546
13546
  baseRotation = new Rt();
13547
13547
  constructor(e) {
13548
13548
  this.controller = e;
@@ -13564,7 +13564,7 @@ class IO {
13564
13564
  t.onBeforeUpdate(e);
13565
13565
  }
13566
13566
  summedPosition = new b();
13567
- summedRotation = new N();
13567
+ summedRotation = new $();
13568
13568
  onAfterUpdate(e) {
13569
13569
  if (!(e <= 0)) {
13570
13570
  this.root.position.copy(this.basePosition), this.root.quaternion.copy(this.baseQuaternion), this.summedPosition.set(0, 0, 0), this.summedRotation.set(0, 0, 0, 1);
@@ -13997,7 +13997,7 @@ class Ms extends T {
13997
13997
  const l = $e(this.gameObject).x;
13998
13998
  a.y = r + this._height * l - i, a.z = o.min.z + (o.max.z - o.min.z) * 0.5, ut(this._projection, a);
13999
13999
  }
14000
- rh && z.DrawWireBox3(o, 65280, 5);
14000
+ rh && F.DrawWireBox3(o, 65280, 5);
14001
14001
  }
14002
14002
  this.context.scene.backgroundBlurriness > 1e-3 && this._needsTextureUpdate && this.updateBlurriness(e, this.context.scene.backgroundBlurriness), this._lastBackground = e, this._lastHeight = this._height, this._lastRadius = this._radius, this._needsTextureUpdate = !1;
14003
14003
  }
@@ -14303,13 +14303,13 @@ function $O(s, e, t, i, n) {
14303
14303
  const r = Symbol(o), a = s.__internalAwake;
14304
14304
  s.__internalAwake = function() {
14305
14305
  if (!this.onValidate) {
14306
- D() && console.warn('Usage of @validate decorate detected but there is no onValidate method in your class: "' + s.constructor?.name + '"');
14306
+ L() && console.warn('Usage of @validate decorate detected but there is no onValidate method in your class: "' + s.constructor?.name + '"');
14307
14307
  return;
14308
14308
  }
14309
14309
  if (this[r] === void 0) {
14310
14310
  this[r] = this[o];
14311
14311
  const l = this[o];
14312
- if (l instanceof J || l instanceof b || l instanceof de || l instanceof N) {
14312
+ if (l instanceof J || l instanceof b || l instanceof de || l instanceof $) {
14313
14313
  const c = this[o];
14314
14314
  bm(c, () => {
14315
14315
  this.onValidate(o);
@@ -14521,7 +14521,7 @@ const ei = class Bh extends T {
14521
14521
  this._watch = void 0, this._propertiesChanged = !1;
14522
14522
  }
14523
14523
  onEnable() {
14524
- this._watch || (this._watch = new HO(this.gameObject, this.context)), this._watch.start(!0, !0), this.startCoroutine(this.beforePhysics(), xe.LateUpdate), D() && (globalThis.NEEDLE_USE_RAPIER ? R.RAPIER_PHYSICS.ready().then(async () => {
14524
+ this._watch || (this._watch = new HO(this.gameObject, this.context)), this._watch.start(!0, !0), this.startCoroutine(this.beforePhysics(), xe.LateUpdate), L() && (globalThis.NEEDLE_USE_RAPIER ? R.RAPIER_PHYSICS.ready().then(async () => {
14525
14525
  await Ud(3), this.context.physics.engine?.getBody(this) || console.warn(`Rigidbody could not be created. Ensure "${this.name}" has a Collider component.`);
14526
14526
  }) : console.warn("Rigidbody could not be created: Rapier physics are explicitly disabled."));
14527
14527
  }
@@ -14762,7 +14762,7 @@ class Fn extends T {
14762
14762
  receivedDataCallback = null;
14763
14763
  /** @internal */
14764
14764
  awake() {
14765
- Vs && console.log("new instance", this.guid, this), this._receivedDataBefore = !1, this._targetPosition = new b(), this._targetRotation = new N(), this.lastPosition = new b(), this.lastRotation = new N(), this.lastScale = new b(), this.rb = S.getComponentInChildren(this.gameObject, ft), this.rb && (this._wasKinematic = this.rb.isKinematic), this.receivedUpdate = !0, this._model = new i0(this.context.connection, this.guid), this.context.connection.isConnected && this.tryGetLastState(), this.joinedRoomCallback = this.tryGetLastState.bind(this), this.context.connection.beginListen(ee.JoinedRoom, this.joinedRoomCallback), this.receivedDataCallback = this.onReceivedData.bind(this), this.context.connection.beginListenBinary(lc, this.receivedDataCallback);
14765
+ Vs && console.log("new instance", this.guid, this), this._receivedDataBefore = !1, this._targetPosition = new b(), this._targetRotation = new $(), this.lastPosition = new b(), this.lastRotation = new $(), this.lastScale = new b(), this.rb = S.getComponentInChildren(this.gameObject, ft), this.rb && (this._wasKinematic = this.rb.isKinematic), this.receivedUpdate = !0, this._model = new i0(this.context.connection, this.guid), this.context.connection.isConnected && this.tryGetLastState(), this.joinedRoomCallback = this.tryGetLastState.bind(this), this.context.connection.beginListen(ee.JoinedRoom, this.joinedRoomCallback), this.receivedDataCallback = this.onReceivedData.bind(this), this.context.connection.beginListenBinary(lc, this.receivedDataCallback);
14766
14766
  }
14767
14767
  /** @internal */
14768
14768
  onDestroy() {
@@ -15031,7 +15031,7 @@ class me {
15031
15031
  if (l) {
15032
15032
  const c = o.arguments?.map((h) => h instanceof Object && h.uuid ? e[h.uuid] : h?.isComponent ? e[h.guid] : h);
15033
15033
  t.push(new Qs(l.clone, o.methodName, c, o.enabled));
15034
- } else D() && console.warn("Could not find target for event listener");
15034
+ } else L() && console.warn("Could not find target for event listener");
15035
15035
  }
15036
15036
  }
15037
15037
  }
@@ -15154,7 +15154,7 @@ class QO extends Xi {
15154
15154
  if (e.endsWith(".glb") || e.endsWith(".gltf")) {
15155
15155
  if (t.serializable instanceof Array && t.serializable.includes(ie))
15156
15156
  return;
15157
- D() && ge("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");
15157
+ L() && ge("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");
15158
15158
  const i = t.target?.constructor?.name;
15159
15159
  console.warn(`Wrong usage of @serializable detected in your script "${i}"
15160
15160
 
@@ -15179,7 +15179,7 @@ ${t.path}! : AssetReference;
15179
15179
  }
15180
15180
  let i;
15181
15181
  const n = t.gltf?.scene;
15182
- return n && (i = S.findByGuid(e.guid, n)), i || (i = S.findByGuid(e.guid, t.context.scene)), i ? (i && i.isComponent === !0 && (dt && console.warn("Deserialized object reference is a component"), i = i.gameObject), dt && console.log("Deserialized object reference?", e, i, t?.nodeToObject)) : ((D() || dt) && console.warn("Could not resolve object reference", t.path, e, t.target, t.context.scene), e.could_not_resolve = !0), i;
15182
+ return n && (i = S.findByGuid(e.guid, n)), i || (i = S.findByGuid(e.guid, t.context.scene)), i ? (i && i.isComponent === !0 && (dt && console.warn("Deserialized object reference is a component"), i = i.gameObject), dt && console.log("Deserialized object reference?", e, i, t?.nodeToObject)) : ((L() || dt) && console.warn("Could not resolve object reference", t.path, e, t.target, t.context.scene), e.could_not_resolve = !0), i;
15183
15183
  }
15184
15184
  }
15185
15185
  }
@@ -15204,7 +15204,7 @@ class KO extends Xi {
15204
15204
  let n = this.findObjectForGuid(e.guid, t.root);
15205
15205
  if (n || t.context && (n = this.findObjectForGuid(e.guid, t.context?.scene), n))
15206
15206
  return n;
15207
- (D() || dt) && console.warn('Could not resolve component reference: "' + i + '" using guid ' + e.guid, t.target), e.could_not_resolve = !0;
15207
+ (L() || dt) && console.warn('Could not resolve component reference: "' + i + '" using guid ' + e.guid, t.target), e.could_not_resolve = !0;
15208
15208
  return;
15209
15209
  }
15210
15210
  }
@@ -15271,7 +15271,7 @@ Could not find method ${r.method} on object ${l.name}`, l, typeof l[r.method]);
15271
15271
  }
15272
15272
  p = Object.getPrototypeOf(p);
15273
15273
  }
15274
- !f && (D() || dt) && h();
15274
+ !f && (L() || dt) && h();
15275
15275
  }
15276
15276
  }
15277
15277
  if (l) {
@@ -15283,7 +15283,7 @@ Could not find method ${r.method} on object ${l.name}`, l, typeof l[r.method]);
15283
15283
  const f = new Qs(l, r.method, h, r.enabled);
15284
15284
  i.push(f);
15285
15285
  }
15286
- } else D() && console.warn(`[Dev] EventList: Could not find event listener in scene (${t.object?.name})`, r);
15286
+ } else L() && console.warn(`[Dev] EventList: Could not find event listener in scene (${t.object?.name})`, r);
15287
15287
  }
15288
15288
  const n = new me(i);
15289
15289
  dt && console.log(n);
@@ -15498,7 +15498,7 @@ class Jt extends T {
15498
15498
  }
15499
15499
  /** Get the currently active event system */
15500
15500
  static get instance() {
15501
- return this.get(U.Current);
15501
+ return this.get(N.Current);
15502
15502
  }
15503
15503
  raycaster = [];
15504
15504
  register(e) {
@@ -15768,7 +15768,7 @@ class Jt extends T {
15768
15768
  const n = this._capturedPointer[i] || [];
15769
15769
  n.push(t), this._capturedPointer[i] = n;
15770
15770
  } else
15771
- D() && !t.z__warned_no_pointermove && (t.z__warned_no_pointermove = !0, console.warn("PointerCapture was requested but the component doesn't implement onPointerMove. It will not receive any pointer events"));
15771
+ L() && !t.z__warned_no_pointermove && (t.z__warned_no_pointermove = !0, console.warn("PointerCapture was requested but the component doesn't implement onPointerMove. It will not receive any pointer events"));
15772
15772
  } else e.z__pointer_cture_rleased && (e.z__pointer_cture_rleased = !1, this.releasePointerCapture(e, t));
15773
15773
  }
15774
15774
  /** removes the component from the pointer capture list */
@@ -16064,7 +16064,7 @@ class ye extends T {
16064
16064
  this._controls.target.copy(l);
16065
16065
  }
16066
16066
  if (this._controls)
16067
- if (bf && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, q.isMobileDevice() && (this.doubleClickToFocus = !0)), this._controls.addEventListener("start", this.onControlsChangeStarted), this._controls.addEventListener("endMovement", this.onControlsChangeEnded), !this._startedListeningToKeyEvents && this.enableKeys)
16067
+ if (bf && (this.enablePan = !0, this.enableZoom = !0, this.middleClickToFocus = !0, X.isMobileDevice() && (this.doubleClickToFocus = !0)), this._controls.addEventListener("start", this.onControlsChangeStarted), this._controls.addEventListener("endMovement", this.onControlsChangeEnded), !this._startedListeningToKeyEvents && this.enableKeys)
16068
16068
  this._startedListeningToKeyEvents = !0, this._controls.listenToKeyEvents(this.context.domElement);
16069
16069
  else
16070
16070
  try {
@@ -16117,7 +16117,7 @@ class ye extends T {
16117
16117
  };
16118
16118
  updateTargetNow(e) {
16119
16119
  const t = new lo(this._cameraObject?.worldPosition, this._cameraObject?.worldForward.multiplyScalar(-1)), i = this.context.physics.raycastFromRay(t, e), n = i.length > 0 ? i[0] : void 0;
16120
- n && n.distance > this.minZoom && n.distance < this.maxZoom && (Ai && z.DrawWireSphere(n.point, 0.1, 16711680, 2), this._controls?.target.copy(i[0].point));
16120
+ n && n.distance > this.minZoom && n.distance < this.maxZoom && (Ai && F.DrawWireSphere(n.point, 0.1, 16711680, 2), this._controls?.target.copy(i[0].point));
16121
16121
  }
16122
16122
  _orbitStartAngle = 0;
16123
16123
  _zoomStartDistance = 0;
@@ -16149,7 +16149,7 @@ class ye extends T {
16149
16149
  if (t && !this.setLookTargetFromConstraint()) {
16150
16150
  this.debugLog && console.log("NO TARGET");
16151
16151
  const i = Z(t.threeCamera), n = Math.max(0.01, i.length()), o = new b(0, 0, -n).applyMatrix4(t.threeCamera.matrixWorld);
16152
- Ai && z.DrawLine(i, o, 5592575, 10), this.setLookTargetPosition(o, !0);
16152
+ Ai && F.DrawLine(i, o, 5592575, 10), this.setLookTargetPosition(o, !0);
16153
16153
  }
16154
16154
  if (!this.setLookTargetFromConstraint()) {
16155
16155
  const i = new mr();
@@ -16190,7 +16190,7 @@ class ye extends T {
16190
16190
  const t = typeof ah == "number" ? ah : 0.99;
16191
16191
  this._controls.dampingFactor = Math.max(1e-3, 1 - Math.min(1, t));
16192
16192
  }
16193
- this.allowInterrupt || (this._lookTargetLerpActive && (this._controls.enablePan = !1), this._cameraLerpActive && (this._controls.enableRotate = !1, this._controls.autoRotate = !1), (this._lookTargetLerpActive || this._cameraLerpActive) && (this._controls.enableZoom = !1)), this.context.isInXR || (!bf && this.lookAtConstraint?.locked && !this._lookTargetLerpActive && this.setLookTargetFromConstraint(0, this.lookAtConstraint01), this._controls.update(this.context.time.deltaTime), Ai && z.DrawWireSphere(this._controls.target, 0.1, 65280));
16193
+ this.allowInterrupt || (this._lookTargetLerpActive && (this._controls.enablePan = !1), this._cameraLerpActive && (this._controls.enableRotate = !1, this._controls.autoRotate = !1), (this._lookTargetLerpActive || this._cameraLerpActive) && (this._controls.enableZoom = !1)), this.context.isInXR || (!bf && this.lookAtConstraint?.locked && !this._lookTargetLerpActive && this.setLookTargetFromConstraint(0, this.lookAtConstraint01), this._controls.update(this.context.time.deltaTime), Ai && F.DrawWireSphere(this._controls.target, 0.1, 65280));
16194
16194
  }
16195
16195
  }
16196
16196
  __onPreRender = () => {
@@ -16212,14 +16212,14 @@ class ye extends T {
16212
16212
  */
16213
16213
  setCameraAndLookTarget(e, t = !1) {
16214
16214
  if (!e)
16215
- return (D() || Ai) && console.warn("[OrbitControls] setCameraAndLookTarget target is null"), !1;
16215
+ return (L() || Ai) && console.warn("[OrbitControls] setCameraAndLookTarget target is null"), !1;
16216
16216
  if (!(e instanceof M) && !(e instanceof ui))
16217
- return (D() || Ai) && console.warn("[OrbitControls] setCameraAndLookTarget target is not an Object3D or Camera"), !1;
16217
+ return (L() || Ai) && console.warn("[OrbitControls] setCameraAndLookTarget target is not an Object3D or Camera"), !1;
16218
16218
  e instanceof ui && (e = e.gameObject);
16219
16219
  const i = e.worldPosition, n = e.worldForward;
16220
16220
  e instanceof ax && (Ai && console.debug("[OrbitControls] setCameraAndLookTarget flip forward direction for camera"), n.multiplyScalar(-1));
16221
16221
  const o = new lo(i, n);
16222
- return Ai && z.DrawRay(o.origin, o.direction, 16711680, 10), this.setTargetFromRaycast(o, t) || this.setLookTargetPosition(o.at(2, G()), t), this.setCameraTargetPosition(i, t), !0;
16222
+ return Ai && F.DrawRay(o.origin, o.direction, 16711680, 10), this.setTargetFromRaycast(o, t) || this.setLookTargetPosition(o.at(2, G()), t), this.setCameraTargetPosition(i, t), !0;
16223
16223
  }
16224
16224
  /** Moves the camera to position smoothly.
16225
16225
  * @param position The position in local space of the controllerObject to move the camera to. If null the camera will stop lerping to the target.
@@ -16270,7 +16270,7 @@ class ye extends T {
16270
16270
  * @param immediateOrDuration If true the camera target will move immediately to the new position, otherwise it will lerp. If a number is passed in it will be used as the duration of the lerp.
16271
16271
  */
16272
16272
  setLookTargetPosition(e = null, t = !1) {
16273
- this._controls && e && (e instanceof M && (e = Z(e)), this._lookTargetEndPosition.copy(e), this._didSetTarget++, Ai && (console.warn("OrbitControls: setLookTargetPosition", e, t), z.DrawWireSphere(this._lookTargetEndPosition, 0.2, 16711680, 2)), t === !0 ? this.lerpLookTarget(this._lookTargetEndPosition, this._lookTargetEndPosition, 1) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof t == "number" ? this._lookTargetLerpDuration = t : this._lookTargetLerpDuration = this.targetLerpDuration));
16273
+ this._controls && e && (e instanceof M && (e = Z(e)), this._lookTargetEndPosition.copy(e), this._didSetTarget++, Ai && (console.warn("OrbitControls: setLookTargetPosition", e, t), F.DrawWireSphere(this._lookTargetEndPosition, 0.2, 16711680, 2)), t === !0 ? this.lerpLookTarget(this._lookTargetEndPosition, this._lookTargetEndPosition, 1) : (this._lookTargetLerpActive = !0, this._lookTargetLerp01 = 0, this._lookTargetStartPosition.copy(this._controls.target), typeof t == "number" ? this._lookTargetLerpDuration = t : this._lookTargetLerpDuration = this.targetLerpDuration));
16274
16274
  }
16275
16275
  /** True while the camera look target is being lerped */
16276
16276
  get lookTargetLerpActive() {
@@ -16310,10 +16310,8 @@ class ye extends T {
16310
16310
  return !1;
16311
16311
  }
16312
16312
  fitCamera(e, t) {
16313
- if (this.context.isInXR) {
16314
- console.warn("[OrbitControls] Can not fit camera while XR session is active");
16313
+ if (this.context.isInXR)
16315
16314
  return;
16316
- }
16317
16315
  let i;
16318
16316
  if (Array.isArray(e) ? i = e : e && "type" in e ? i = e.children : e && typeof e == "object" && !(e instanceof M) && !Array.isArray(e) && (t = e, i = t.objects), i && !Array.isArray(i) && (i = i.children), (!Array.isArray(i) || i && i.length <= 0) && (i = this.context.scene.children), !Array.isArray(i) || i.length <= 0) {
16319
16317
  console.warn("No objects to fit camera to...");
@@ -16325,7 +16323,7 @@ class ye extends T {
16325
16323
  return;
16326
16324
  }
16327
16325
  t || (t = {});
16328
- const { immediate: r = !1, centerCamera: a, cameraNearFar: l = "auto", fitOffset: c = 1.1, fov: h = n?.fov } = t, d = new b(), f = new b(), p = _i(i, void 0, this._camera?.threeCamera?.layers), g = p.clone();
16326
+ const { immediate: r = !1, centerCamera: a = "y", cameraNearFar: l = "auto", fitOffset: c = 1.1, fov: h = n?.fov } = t, d = new b(), f = new b(), p = _i(i, void 0, this._camera?.threeCamera?.layers), g = p.clone();
16329
16327
  n.updateMatrixWorld(), n.updateProjectionMatrix(), p.getCenter(f);
16330
16328
  const _ = new b();
16331
16329
  if (p.getSize(_), p.applyMatrix4(n.matrixWorldInverse), p.getSize(d), p.setFromCenterAndSize(f, d), Number.isNaN(d.x) || Number.isNaN(d.y) || Number.isNaN(d.z)) {
@@ -16339,21 +16337,21 @@ class ye extends T {
16339
16337
  const m = h, v = 2 * Math.atan(Math.tan(m * Math.PI / 360 / 2) * n.aspect) / Math.PI * 360, y = d.y / (2 * Math.atan(Math.PI * m / 360)), x = d.x / (2 * Math.atan(Math.PI * v / 360)), I = c * Math.max(y, x) + d.z / 2;
16340
16338
  nl && console.log("Fit camera to objects", { fitHeightDistance: y, fitWidthDistance: x, distance: I, verticalFov: m, horizontalFov: v }), this.maxZoom = I * 10, this.minZoom = I * 0.01;
16341
16339
  const O = 0.05, k = f.clone();
16342
- if (k.y -= d.y * O, t.targetOffset && (t.targetOffset.x !== void 0 && (k.x += t.targetOffset.x), t.targetOffset.y !== void 0 && (k.y += t.targetOffset.y), t.targetOffset.z !== void 0 && (k.z += t.targetOffset.z)), t.relativeTargetOffset && (t.relativeTargetOffset.x !== void 0 && (k.x += t.relativeTargetOffset.x * d.x), t.relativeTargetOffset.y !== void 0 && (k.y += t.relativeTargetOffset.y * d.y), t.relativeTargetOffset.z !== void 0 && (k.z += t.relativeTargetOffset.z * d.z)), this.setLookTargetPosition(k, r), this.setFieldOfView(t.fov, r), l == null || l == "auto") {
16343
- const W = S.findObjectOfType(Ms), X = W ? W.radius : 0, A = Math.max(_.x, _.y, _.z, X);
16344
- n.near = I / 100, n.far = A + I * 10, W && (this.maxZoom = Math.max(Math.min(this.maxZoom, X * 0.5), I));
16340
+ if (k.y -= d.y * O, this.setLookTargetPosition(k, r), this.setFieldOfView(t.fov, r), l == null || l == "auto") {
16341
+ const q = S.findObjectOfType(Ms), A = q ? q.radius : 0, U = Math.max(_.x, _.y, _.z, A);
16342
+ n.near = I / 100, n.far = U + I * 10, q && (this.maxZoom = Math.max(Math.min(this.maxZoom, A * 0.5), I));
16345
16343
  }
16346
16344
  const E = o.getDistance();
16347
16345
  E < this.minZoom && (this.minZoom = E * 0.9), E > this.maxZoom && (this.maxZoom = E * 1.1), n.updateMatrixWorld(), n.updateProjectionMatrix();
16348
- const B = f.clone();
16349
- t.fitDirection ? B.sub(new b().copy(t.fitDirection).multiplyScalar(1e6)) : B.sub(n.worldPosition), a === "y" && (B.y = 0), B.normalize(), B.multiplyScalar(I), a === "y" && (B.y += -O * 4 * I);
16350
- let L = f.clone().sub(B);
16351
- t.cameraOffset && (t.cameraOffset.x !== void 0 && (L.x += t.cameraOffset.x), t.cameraOffset.y !== void 0 && (L.y += t.cameraOffset.y), t.cameraOffset.z !== void 0 && (L.z += t.cameraOffset.z)), t.relativeCameraOffset && (t.relativeCameraOffset.x !== void 0 && (L.x += t.relativeCameraOffset.x * d.x), t.relativeCameraOffset.y !== void 0 && (L.y += t.relativeCameraOffset.y * d.y), t.relativeCameraOffset.z !== void 0 && (L.z += t.relativeCameraOffset.z * d.z)), n.parent && (L = n.parent.worldToLocal(L)), this.setCameraTargetPosition(L, r), (nl || t.debug) && (z.DrawWireBox3(p, 16777011, 10), z.DrawWireBox3(g, 65280, 10), !this._haveAttachedKeyboardEvents && nl && (this._haveAttachedKeyboardEvents = !0, document.body.addEventListener("keydown", (W) => {
16352
- if (W.code === "KeyF") {
16353
- let X;
16354
- this._cameraObject instanceof pe && (X = Math.random() * Math.random() * 170 + 10), this.fitCamera({ objects: i, fitOffset: c, immediate: !1, fov: X });
16355
- }
16356
- W.code === "KeyV" && this._cameraObject instanceof pe && (this._cameraObject.fov = 60);
16346
+ const z = Z(n), D = f.clone();
16347
+ D.sub(z), a === "y" && (D.y = 0), D.normalize(), D.multiplyScalar(I), a === "y" && (D.y += -O * 4 * I);
16348
+ let V = f.clone().sub(D);
16349
+ n.parent && (V = n.parent.worldToLocal(V)), this.setCameraTargetPosition(V, r), (nl || t.debug) && (F.DrawWireBox3(p, 16777011, 10), F.DrawWireBox3(g, 65280, 10), !this._haveAttachedKeyboardEvents && nl && (this._haveAttachedKeyboardEvents = !0, document.body.addEventListener("keydown", (q) => {
16350
+ if (q.code === "KeyF") {
16351
+ let A;
16352
+ this._cameraObject instanceof pe && (A = Math.random() * Math.random() * 170 + 10), this.fitCamera({ objects: i, fitOffset: c, immediate: !1, fov: A });
16353
+ }
16354
+ q.code === "KeyV" && this._cameraObject instanceof pe && (this._cameraObject.fov = 60);
16357
16355
  }))), this.onBeforeRender();
16358
16356
  }
16359
16357
  _haveAttachedKeyboardEvents = !1;
@@ -16652,7 +16650,7 @@ const Gs = w("debugcam"), u_ = w("debugscreenpointtoray"), Lt = class Sl extends
16652
16650
  const t = e.clientX, i = e.clientY;
16653
16651
  console.log("touch", t.toFixed(2), i.toFixed(2));
16654
16652
  const n = this.screenPointToRay(t, i), o = "#" + Math.floor(Math.random() * 16777215).toString(16);
16655
- z.DrawRay(n.origin, n.direction, o, 10);
16653
+ F.DrawRay(n.origin, n.direction, o, 10);
16656
16654
  });
16657
16655
  }
16658
16656
  /** @internal */
@@ -16663,9 +16661,6 @@ const Gs = w("debugcam"), u_ = w("debugscreenpointtoray"), Lt = class Sl extends
16663
16661
  onDisable() {
16664
16662
  this.context.removeCamera(this);
16665
16663
  }
16666
- onLeaveXR(e) {
16667
- this.fieldOfView = this._fov;
16668
- }
16669
16664
  /** @internal */
16670
16665
  onBeforeRender() {
16671
16666
  if (this._cam && (this._frustum && this.updateFrustum(), this._clearFlags === 2 && this.applyClearFlagsIfIsActiveCamera(), this._targetTexture)) {
@@ -16712,7 +16707,7 @@ const Gs = w("debugcam"), u_ = w("debugscreenpointtoray"), Lt = class Sl extends
16712
16707
  Gs && console.log("Camera does not exist (apply clear flags)");
16713
16708
  return;
16714
16709
  }
16715
- if (this.fieldOfView = this.fieldOfView, Gs) {
16710
+ if (this.fieldOfView = this._fov, Gs) {
16716
16711
  const i = `[Camera] Apply ClearFlags: ${sa[this._clearFlags]} - "${this.name}"`;
16717
16712
  console.debug(i);
16718
16713
  }
@@ -17071,7 +17066,7 @@ const bt = w("debugaudio"), Qi = class qs extends T {
17071
17066
  onVisibilityChanged = () => {
17072
17067
  switch (document.visibilityState) {
17073
17068
  case "hidden":
17074
- (this.playInBackground === !1 || q.isMobileDevice()) && (this.wasPlaying = this.isPlaying, this.isPlaying && this.pause());
17069
+ (this.playInBackground === !1 || X.isMobileDevice()) && (this.wasPlaying = this.isPlaying, this.isPlaying && this.pause());
17075
17070
  break;
17076
17071
  case "visible":
17077
17072
  bt && console.log("visible", this.enabled, this.playOnAwake, !this.isPlaying, qs.userInteractionRegistered, this.wasPlaying), this.enabled && this.playOnAwake && !this.isPlaying && qs.userInteractionRegistered && this.wasPlaying && this.play();
@@ -17137,7 +17132,7 @@ const bt = w("debugaudio"), Qi = class qs extends T {
17137
17132
  * @param clip - Optional audio clip or {@link MediaStream} to play
17138
17133
  */
17139
17134
  play(e = void 0) {
17140
- !e && this.clip && (e = this.clip), e !== void 0 && typeof e != "string" && !(e instanceof MediaStream) && (D() && console.warn("Called play on AudioSource with unknown argument type:", e + `
17135
+ !e && this.clip && (e = this.clip), e !== void 0 && typeof e != "string" && !(e instanceof MediaStream) && (L() && console.warn("Called play on AudioSource with unknown argument type:", e + `
17141
17136
  Using the assigned clip instead:`, this.clip), e = this.clip);
17142
17137
  let t = !this.sound || e && e !== this.clip;
17143
17138
  if (typeof e == "string" && !this.audioLoader && (t = !0), (e instanceof MediaStream || typeof e == "string") && (this.clip = e), t) {
@@ -17249,7 +17244,7 @@ class oa {
17249
17244
  if (t) {
17250
17245
  for (const i of this.Pois)
17251
17246
  if (i.obj === t) {
17252
- this.Pois.splice(this.Pois.indexOf(i), 1), this.LastChangeTime = e?.time.time ?? U.Current?.time.time;
17247
+ this.Pois.splice(this.Pois.indexOf(i), 1), this.LastChangeTime = e?.time.time ?? N.Current?.time.time;
17253
17248
  return;
17254
17249
  }
17255
17250
  }
@@ -17629,7 +17624,7 @@ class tu extends um {
17629
17624
  e = i.context, t = eo.getOrCreate(i.context, i.guid);
17630
17625
  } else typeof t == "string" && (t = eo.getOrCreate(e, t));
17631
17626
  if (e) {
17632
- if (!(e instanceof U)) throw new Error("Failed to create NetworkedStreams because context is not an instance of Context");
17627
+ if (!(e instanceof N)) throw new Error("Failed to create NetworkedStreams because context is not an instance of Context");
17633
17628
  } else throw new Error("Failed to create NetworkedStreams because context is undefined");
17634
17629
  if (!t) throw new Error("Failed to create NetworkedStreams because peer is undefined");
17635
17630
  this.context = e, this.peer = t, Le && (this.debug = !0);
@@ -17812,10 +17807,10 @@ class _r extends T {
17812
17807
  if (!this._net)
17813
17808
  return console.error("Cannot connect to voice chat - NetworkedStreams not initialized. Make sure the component is enabled before calling this method."), !1;
17814
17809
  if (this.context.connection.isConnected) {
17815
- if (!await q.microphonePermissionsGranted())
17810
+ if (!await X.microphonePermissionsGranted())
17816
17811
  return console.error("Cannot connect to voice chat - microphone permissions not granted"), this.updateButton(), !1;
17817
17812
  } else return console.error("Cannot connect to voice chat - not connected to server"), this.updateButton(), !1;
17818
- return this._allowSending = !0, this._net?.stopSendingStream(this._outputStream), ms(this._outputStream), this._outputStream = await this.getAudioStream(e), this._outputStream ? (this.debug && console.log("VOIP: Got audio stream"), this._net?.startSendingStream(this._outputStream), this.updateButton(), !0) : (this.updateButton(), await q.microphonePermissionsGranted() ? console.error("VOIP: Could not get audio stream - please make sure to connect an audio device and grant microphone permissions") : Wd("Microphone permissions not granted: Please grant microphone permissions to use voice chat"), (this.debug || D()) && console.log("VOIP: Failed to get audio stream"), !1);
17813
+ return this._allowSending = !0, this._net?.stopSendingStream(this._outputStream), ms(this._outputStream), this._outputStream = await this.getAudioStream(e), this._outputStream ? (this.debug && console.log("VOIP: Got audio stream"), this._net?.startSendingStream(this._outputStream), this.updateButton(), !0) : (this.updateButton(), await X.microphonePermissionsGranted() ? console.error("VOIP: Could not get audio stream - please make sure to connect an audio device and grant microphone permissions") : Wd("Microphone permissions not granted: Please grant microphone permissions to use voice chat"), (this.debug || L()) && console.log("VOIP: Failed to get audio stream"), !1);
17819
17814
  }
17820
17815
  /** Stop sending audio (muting your own microphone) */
17821
17816
  disconnect(e) {
@@ -17843,27 +17838,27 @@ class _r extends T {
17843
17838
  async updateButton() {
17844
17839
  if (this.createMenuButton) {
17845
17840
  if (this._menubutton || (this._menubutton = document.createElement("button"), this._menubutton.addEventListener("click", () => {
17846
- this.isSending ? this.disconnect({ remember: !0 }) : this.connect(), q.microphonePermissionsGranted().then((e) => {
17841
+ this.isSending ? this.disconnect({ remember: !0 }) : this.connect(), X.microphonePermissionsGranted().then((e) => {
17847
17842
  e || ge("<strong>Microphone permissions not granted</strong>. Please allow your browser to use the microphone to be able to talk. Click on the button on the left side of your browser's address bar to allow microphone permissions.");
17848
17843
  });
17849
17844
  })), this._menubutton) {
17850
17845
  this.context.menu.appendChild(this._menubutton), this.activeAndEnabled ? this._menubutton.style.display = "" : this._menubutton.style.display = "none", this._menubutton.title = this.isSending ? "Click to disable your microphone" : "Click to enable your microphone";
17851
17846
  let e = (this.isSending, ""), t = this.isSending ? "mic" : "mic_off";
17852
- await q.microphonePermissionsGranted() || (e = "No Permission", t = "mic_off", this._menubutton.title = "Microphone permissions not granted. Please allow your browser to use the microphone to be able to talk. This can usually be done in the addressbar of the webpage."), this._menubutton.innerText = e, this._menubutton.prepend(Mt(t)), this.context.connection.isConnected == !1 ? this._menubutton.setAttribute("disabled", "") : this._menubutton.removeAttribute("disabled");
17847
+ await X.microphonePermissionsGranted() || (e = "No Permission", t = "mic_off", this._menubutton.title = "Microphone permissions not granted. Please allow your browser to use the microphone to be able to talk. This can usually be done in the addressbar of the webpage."), this._menubutton.innerText = e, this._menubutton.prepend(Mt(t)), this.context.connection.isConnected == !1 ? this._menubutton.setAttribute("disabled", "") : this._menubutton.removeAttribute("disabled");
17853
17848
  }
17854
17849
  } else this.activeAndEnabled || this._menubutton?.remove();
17855
17850
  }
17856
17851
  // private _analyzer?: AudioAnalyser;
17857
17852
  /** @deprecated */
17858
17853
  getFrequency(e) {
17859
- return this.unsupported_getfrequency || (this.unsupported_getfrequency = !0, D() && ge("VOIP: getFrequency is currently not supported"), console.warn("VOIP: getFrequency is currently not supported")), null;
17854
+ return this.unsupported_getfrequency || (this.unsupported_getfrequency = !0, L() && ge("VOIP: getFrequency is currently not supported"), console.warn("VOIP: getFrequency is currently not supported")), null;
17860
17855
  }
17861
17856
  async getAudioStream(e) {
17862
17857
  if (!navigator.mediaDevices.getUserMedia)
17863
17858
  return console.error("No getDisplayMedia support"), null;
17864
17859
  const t = async (n) => await navigator.mediaDevices.getUserMedia({ audio: n ?? !0, video: !1 }).catch((o) => (console.warn("VOIP failed getting audio stream", o), null)), i = await t(e);
17865
17860
  if (!i) return null;
17866
- if (q.isiOS() && e?.deviceId === void 0) {
17861
+ if (X.isiOS() && e?.deviceId === void 0) {
17867
17862
  const o = (await navigator.mediaDevices.enumerateDevices()).find((r) => (r.kind === "audioinput" || r.kind === "audiooutput") && !r.label.includes("iPhone"));
17868
17863
  if (o) {
17869
17864
  const r = Object.assign({}, e);
@@ -18237,7 +18232,7 @@ class Ct extends T {
18237
18232
  }
18238
18233
  this.updateBox();
18239
18234
  const t = this.box?.intersectsBox(Ct.testBox);
18240
- return t && jk && z.DrawWireBox3(Ct.testBox, 16711680, 5), t;
18235
+ return t && jk && F.DrawWireBox3(Ct.testBox, 16711680, 5), t;
18241
18236
  }
18242
18237
  /**
18243
18238
  * Tests if this helper's bounding box intersects with another box
@@ -18424,7 +18419,7 @@ const Zm = class J0 extends wi {
18424
18419
  const t = this.gameObject, i = t.position.clone(), n = t.quaternion.clone(), o = t.scale.clone(), r = t.parent;
18425
18420
  t.position.set(0, 0, 0), t.quaternion.set(0, 0, 0, 1), t.scale.set(1, 1, 1), t.parent = null, t.updateMatrix();
18426
18421
  const a = _i([t]);
18427
- t.position.copy(i), t.quaternion.copy(n), t.scale.copy(o), t.parent = r, e?.debug === !0 && z.DrawWireBox3(a, 16768256, 20), this.size = a.getSize(new b()) || new b(1, 1, 1), this.center = a.getCenter(new b()) || new b(0, 0, 0), this.size.length() <= 0 && this.size.set(0.01, 0.01, 0.01);
18422
+ t.position.copy(i), t.quaternion.copy(n), t.scale.copy(o), t.parent = r, e?.debug === !0 && F.DrawWireBox3(a, 16768256, 20), this.size = a.getSize(new b()) || new b(1, 1, 1), this.center = a.getCenter(new b()) || new b(0, 0, 0), this.size.length() <= 0 && this.size.set(0.01, 0.01, 0.01);
18428
18423
  }
18429
18424
  };
18430
18425
  ti([
@@ -18467,7 +18462,7 @@ class br extends wi {
18467
18462
  r && this.activeAndEnabled && (o.geometry = r, this.context.physics.engine?.addMeshCollider(this, o, this.convex));
18468
18463
  });
18469
18464
  } else
18470
- (D() || w("showcolliders")) && console.warn(`[MeshCollider] A MeshCollider mesh is assigned to an unknown object on "${this.gameObject.name}", but it's neither a Mesh nor a Group. Please double check that you attached the collider component to the right object and report a bug otherwise!`, this);
18465
+ (L() || w("showcolliders")) && console.warn(`[MeshCollider] A MeshCollider mesh is assigned to an unknown object on "${this.gameObject.name}", but it's neither a Mesh nor a Group. Please double check that you attached the collider component to the right object and report a bug otherwise!`, this);
18471
18466
  }
18472
18467
  }
18473
18468
  }
@@ -18564,7 +18559,7 @@ class mo extends T {
18564
18559
  animator;
18565
18560
  lookForward = !0;
18566
18561
  awake() {
18567
- this._currentRotation = new N();
18562
+ this._currentRotation = new $();
18568
18563
  }
18569
18564
  update() {
18570
18565
  const e = this.context.input;
@@ -18657,7 +18652,7 @@ const vr = class Cl extends T {
18657
18652
  * @returns The instance of the contact shadows.
18658
18653
  */
18659
18654
  static auto(e) {
18660
- if (e || (e = U.Current), !e)
18655
+ if (e || (e = N.Current), !e)
18661
18656
  throw new Error("No context provided and no current context set.");
18662
18657
  let t = this._instances.get(e);
18663
18658
  if (!t || t.destroyed) {
@@ -18716,7 +18711,7 @@ const vr = class Cl extends T {
18716
18711
  fitShadows() {
18717
18712
  sl && console.warn("Fitting shadows to scene"), cp(this.shadowsRoot, !1);
18718
18713
  const e = _i(this.context.scene.children, [this.shadowsRoot]), t = Math.max(1, this.blur / 32), i = e.max.x - e.min.x, n = e.max.z - e.min.z;
18719
- e.expandByVector(new b(t * i, 0, t * n)), sl && z.DrawWireBox3(e, 16776960, 60), this.gameObject.parent && e.applyMatrix4(this.gameObject.parent.matrixWorld.clone().invert());
18714
+ e.expandByVector(new b(t * i, 0, t * n)), sl && F.DrawWireBox3(e, 16776960, 60), this.gameObject.parent && e.applyMatrix4(this.gameObject.parent.matrixWorld.clone().invert());
18720
18715
  const o = e.min, r = Math.max(1e-5, (e.max.y - o.y) * 2e-3);
18721
18716
  e.max.y += r, this.shadowsRoot.position.set((o.x + e.max.x) / 2, o.y - r, (o.z + e.max.z) / 2), this.shadowsRoot.scale.set(e.max.x - o.x, e.max.y - o.y, e.max.z - o.z), this.applyMinSize(), this.shadowsRoot.matrixWorldNeedsUpdate = !0, sl && console.log("Fitted shadows to scene", this.shadowsRoot.scale.clone());
18722
18717
  }
@@ -18877,7 +18872,7 @@ class iv extends T {
18877
18872
  try {
18878
18873
  if (e.box) {
18879
18874
  const o = e.box, r = Ct.testBox;
18880
- z.DrawWireBox3(o, 16711680, 5), z.DrawWireBox3(r, 255, 5), console.log("DeleteBox: Destroying", this.gameObject, { deleteBoxArea: o, deletedObjectArea: r });
18875
+ F.DrawWireBox3(o, 16711680, 5), F.DrawWireBox3(r, 255, 5), console.log("DeleteBox: Destroying", this.gameObject, { deleteBoxArea: o, deletedObjectArea: r });
18881
18876
  } else
18882
18877
  console.log("DeleteBox: Destroying", this.gameObject);
18883
18878
  } catch {
@@ -18902,7 +18897,7 @@ class eg extends T {
18902
18897
  this.test() || S.setActive(this.gameObject, !1);
18903
18898
  }
18904
18899
  test() {
18905
- return this.visibleOn < 0 ? !0 : q.isMobileDevice() ? (this.visibleOn & 2) !== 0 : (this.visibleOn & 1) !== 0;
18900
+ return this.visibleOn < 0 ? !0 : X.isMobileDevice() ? (this.visibleOn & 2) !== 0 : (this.visibleOn & 1) !== 0;
18906
18901
  }
18907
18902
  }
18908
18903
  $k([
@@ -19053,7 +19048,7 @@ const go = class Ii extends T {
19053
19048
  * @internal
19054
19049
  */
19055
19050
  onPointerUp(e) {
19056
- if (kn && z.DrawLabel(e.point ?? this.gameObject.worldPosition, "POINTERUP:" + e.pointerId + ", " + e.button, 0.03, 3), !this.allowEdit(this.gameObject) || e.button !== 0) return;
19051
+ if (kn && F.DrawLabel(e.point ?? this.gameObject.worldPosition, "POINTERUP:" + e.pointerId + ", " + e.button, 0.03, 3), !this.allowEdit(this.gameObject) || e.button !== 0) return;
19057
19052
  this._potentialDragStartEvt = null;
19058
19053
  const t = this._dragHandlers.get(e.event.space), i = this._dragHandlers.get(this.gameObject);
19059
19054
  i && (i.handlerA === t || i.handlerB === t) && (this._dragHandlers.delete(this.gameObject), i.onDragEnd(e)), t && (Ii._active > 0 && (Ii._active -= 1), this.setTargetObject(null), t.onDragEnd && t.onDragEnd(e), this._dragHandlers.delete(e.event.space), this._dragHandlers.size === 0 && this.onLastDragEnd(e), e.use());
@@ -19160,7 +19155,7 @@ class Vk {
19160
19155
  _followObject;
19161
19156
  _manipulatorObject;
19162
19157
  _deviceMode;
19163
- _followObjectStartWorldQuaternion = new N();
19158
+ _followObjectStartWorldQuaternion = new $();
19164
19159
  constructor(e, t, i, n) {
19165
19160
  this.context = e.context, this.settings = e, this.gameObject = t, this.handlerA = i, this.handlerB = n, this._followObject = new M(), this._manipulatorObject = new M(), this.context.scene.add(this._manipulatorObject);
19166
19161
  const o = K.active?.rig?.gameObject;
@@ -19171,7 +19166,7 @@ class Vk {
19171
19166
  if (this._tempVec1.copy(this.handlerA.hitPointInLocalSpace), this._tempVec2.copy(this.handlerB.hitPointInLocalSpace), this.gameObject.localToWorld(this._tempVec1), this.gameObject.localToWorld(this._tempVec2), o && (o.worldToLocal(this._tempVec1), o.worldToLocal(this._tempVec2)), this._initialDistance = this._tempVec1.distanceTo(this._tempVec2), this._initialDistance < 0.02 ? (kn && console.log("Finding alternative drag attachment points since initial distance is too low: " + this._initialDistance.toFixed(2)), this.handlerA.followObject.parent.getWorldPosition(this._tempVec1), this.handlerB.followObject.parent.getWorldPosition(this._tempVec2), this._handlerAAttachmentPoint.copy(this._tempVec1), this._handlerBAttachmentPoint.copy(this._tempVec2), this.gameObject.worldToLocal(this._handlerAAttachmentPoint), this.gameObject.worldToLocal(this._handlerBAttachmentPoint), this._initialDistance = this._tempVec1.distanceTo(this._tempVec2), this._initialDistance < 1e-3 && (console.warn("Not supported right now – controller drag points for multitouch are too close!"), this._initialDistance = 1)) : (this._handlerAAttachmentPoint.copy(this.handlerA.hitPointInLocalSpace), this._handlerBAttachmentPoint.copy(this.handlerB.hitPointInLocalSpace)), this._tempVec3.lerpVectors(this._tempVec1, this._tempVec2, 0.5), this._initialScale.copy(t.scale), kn) {
19172
19167
  this._followObject.add(new mi(2)), this._manipulatorObject.add(new mi(5));
19173
19168
  const r = (a) => `${a.x.toFixed(2)}, ${a.y.toFixed(2)}, ${a.z.toFixed(2)}`;
19174
- z.DrawLine(this._tempVec1, this._tempVec2, 65535, 0, !1), z.DrawLabel(this._tempVec3, "A:B " + this._initialDistance.toFixed(2) + `
19169
+ F.DrawLine(this._tempVec1, this._tempVec2, 65535, 0, !1), F.DrawLabel(this._tempVec3, "A:B " + this._initialDistance.toFixed(2) + `
19175
19170
  ` + r(this._tempVec1) + `
19176
19171
  ` + r(this._tempVec2), 0.03, 5);
19177
19172
  }
@@ -19187,7 +19182,7 @@ class Vk {
19187
19182
  this.handlerA.recenter(), this.handlerB.recenter(), this._manipulatorObject.removeFromParent(), this._followObject.removeFromParent(), this._manipulatorObject.destroy(), this._followObject.destroy();
19188
19183
  }
19189
19184
  _manipulatorPosOffset = new b();
19190
- _manipulatorRotOffset = new N();
19185
+ _manipulatorRotOffset = new $();
19191
19186
  _manipulatorScaleOffset = new b();
19192
19187
  _tempVec1 = new b();
19193
19188
  _tempVec2 = new b();
@@ -19208,7 +19203,7 @@ class Vk {
19208
19203
  const e = this.context.mainCamera;
19209
19204
  this.tempLookMatrix.lookAt(this._tempVec3, this._tempVec2, e.worldUp), this._manipulatorObject.quaternion.setFromRotationMatrix(this.tempLookMatrix);
19210
19205
  const t = this._tempVec1.distanceTo(this._tempVec2);
19211
- this._manipulatorObject.scale.copy(this._initialScale).multiplyScalar(t / this._initialDistance), this._manipulatorObject.updateMatrix(), this._manipulatorObject.updateMatrixWorld(!0), kn && (z.DrawLabel(this._tempVec3.clone().add(new b(0, 0.2, 0)), "A:B " + t.toFixed(2), 0.03), z.DrawLine(this._tempVec1, this._tempVec2, 65280, 0, !1));
19206
+ this._manipulatorObject.scale.copy(this._initialScale).multiplyScalar(t / this._initialDistance), this._manipulatorObject.updateMatrix(), this._manipulatorObject.updateMatrixWorld(!0), kn && (F.DrawLabel(this._tempVec3.clone().add(new b(0, 0.2, 0)), "A:B " + t.toFixed(2), 0.03), F.DrawLine(this._tempVec1, this._tempVec2, 65280, 0, !1));
19212
19207
  }
19213
19208
  onDragUpdate() {
19214
19209
  this.alignManipulator();
@@ -19271,8 +19266,8 @@ class Cf {
19271
19266
  _grabStartDistance = 0;
19272
19267
  _deviceMode;
19273
19268
  _followObjectStartPosition = new b();
19274
- _followObjectStartQuaternion = new N();
19275
- _followObjectStartWorldQuaternion = new N();
19269
+ _followObjectStartQuaternion = new $();
19270
+ _followObjectStartWorldQuaternion = new $();
19276
19271
  _lastDragPosRigSpace;
19277
19272
  _tempVec = new b();
19278
19273
  _tempMat = new te();
@@ -19308,7 +19303,7 @@ class Cf {
19308
19303
  const t = this._hitPointInLocalSpace.clone();
19309
19304
  this.gameObject.localToWorld(t), this._grabStartDistance = t.distanceTo(e.worldPosition);
19310
19305
  const n = K.active?.rig?.gameObject?.worldScale.x || 1;
19311
- this._grabStartDistance /= n, this._totalMovementAlongRayDirection = 0, this._lastDragPosRigSpace = void 0, kn && (z.DrawLine(t, e.worldPosition, 65280, 0.5, !1), z.DrawLabel(e.worldPosition.add(new b(0, 0.1, 0)), this._grabStartDistance.toFixed(2), 0.03, 0.5));
19306
+ this._grabStartDistance /= n, this._totalMovementAlongRayDirection = 0, this._lastDragPosRigSpace = void 0, kn && (F.DrawLine(t, e.worldPosition, 65280, 0.5, !1), F.DrawLabel(e.worldPosition.add(new b(0, 0.1, 0)), this._grabStartDistance.toFixed(2), 0.03, 0.5));
19312
19307
  }
19313
19308
  onDragStart(e) {
19314
19309
  if (!this.gameObject) {
@@ -19362,7 +19357,7 @@ class Cf {
19362
19357
  const n = e.worldForward;
19363
19358
  if (i && (this._tempMat.copy(i.matrixWorld).invert(), n.transformDirection(this._tempMat)), this._totalMovementAlongRayDirection += n.dot(this._tempVec), this._tempVec.x = Math.abs(this._tempVec.x), this._tempVec.y = Math.abs(this._tempVec.y), this._tempVec.z = Math.abs(this._tempVec.z), this._totalMovement.add(this._tempVec), this._lastDragPosRigSpace.copy(t), kn) {
19364
19359
  let o = t;
19365
- i && (o = o.clone(), o.transformDirection(i.matrixWorld)), z.DrawRay(o, n, 255);
19360
+ i && (o = o.clone(), o.transformDirection(i.matrixWorld)), F.DrawRay(o, n, 255);
19366
19361
  }
19367
19362
  }
19368
19363
  onDragUpdate(e) {
@@ -19400,15 +19395,15 @@ class Cf {
19400
19395
  const x = y[0];
19401
19396
  if (this._draggedOverObject === x.object ? this._draggedOverObjectDuration += this.context.time.deltaTime : (this._draggedOverObject = x.object, this._draggedOverObjectDuration = 0), x.face) {
19402
19397
  this._hasLastSurfaceHitPoint = !0, this._lastSurfaceHitPoint.copy(x.point);
19403
- const O = this._draggedOverObjectDuration >= 0.15, E = this._totalMovement.length() >= 1e-3, B = G(x.normal || x.face.normal).applyQuaternion(x.object.worldQuaternion);
19404
- if ((O || E) && (this._draggedOverObjectLastSetUp !== this._draggedOverObject || this._draggedOverObjectLastNormal.dot(B) < 0.999999 || this.context.time.frame % 60 === 0)) {
19398
+ const O = this._draggedOverObjectDuration >= 0.15, E = this._totalMovement.length() >= 1e-3, z = G(x.normal || x.face.normal).applyQuaternion(x.object.worldQuaternion);
19399
+ if ((O || E) && (this._draggedOverObjectLastSetUp !== this._draggedOverObject || this._draggedOverObjectLastNormal.dot(z) < 0.999999 || this.context.time.frame % 60 === 0)) {
19405
19400
  this._draggedOverObjectLastSetUp = this._draggedOverObject, this._draggedOverObjectLastNormal.copy(x.face.normal);
19406
- const L = G(), W = G();
19407
- this._bounds.getCenter(L), this._bounds.getSize(W), L.sub(W.multiplyScalar(0.5).multiply(B)), this._hitPointInLocalSpace.copy(L), this._hitNormalInLocalSpace.copy(x.face.normal), this._bounds.getCenter(L), this._bounds.getSize(W), L.add(W.multiplyScalar(0.5).multiply(x.face.normal));
19408
- const X = G(this._hitPointInLocalSpace).add(L);
19409
- this._followObject.localToWorld(X);
19401
+ const D = G(), V = G();
19402
+ this._bounds.getCenter(D), this._bounds.getSize(V), D.sub(V.multiplyScalar(0.5).multiply(z)), this._hitPointInLocalSpace.copy(D), this._hitNormalInLocalSpace.copy(x.face.normal), this._bounds.getCenter(D), this._bounds.getSize(V), D.add(V.multiplyScalar(0.5).multiply(x.face.normal));
19403
+ const q = G(this._hitPointInLocalSpace).add(D);
19404
+ this._followObject.localToWorld(q);
19410
19405
  const A = x.point;
19411
- this._dragPlane.setFromNormalAndCoplanarPoint(B, A);
19406
+ this._dragPlane.setFromNormalAndCoplanarPoint(z, A);
19412
19407
  } else if (!(O || E))
19413
19408
  return;
19414
19409
  }
@@ -19417,7 +19412,7 @@ class Cf {
19417
19412
  if (l !== 1 && p.intersectPlane(this._dragPlane, this._tempVec)) {
19418
19413
  this._followObject.worldPosition = this._tempVec, this._followObject.updateMatrix(), this._followObject.updateMatrixWorld(!0);
19419
19414
  const y = G(this._hitPointInLocalSpace);
19420
- this._followObject.localToWorld(y), kn && z.DrawLine(y, this._tempVec, 65535, 0, !1), this._followObject.worldPosition = this._tempVec.multiplyScalar(2).sub(y), this._followObject.updateMatrix(), this._followObject.updateMatrix();
19415
+ this._followObject.localToWorld(y), kn && F.DrawLine(y, this._tempVec, 65535, 0, !1), this._followObject.worldPosition = this._tempVec.multiplyScalar(2).sub(y), this._followObject.updateMatrix(), this._followObject.updateMatrix();
19421
19416
  }
19422
19417
  if (this.settings.snapGridResolution > 0) {
19423
19418
  const y = this._followObject.worldPosition, x = this.settings.snapGridResolution;
@@ -19429,9 +19424,9 @@ class Cf {
19429
19424
  const v = t.worldQuaternion;
19430
19425
  if (v.slerp(this._followObject.worldQuaternion, _), t.worldQuaternion = v, kn) {
19431
19426
  const y = this._hitPointInLocalSpace.clone();
19432
- t.localToWorld(y), z.DrawSphere(y, 0.02, 16711680);
19427
+ t.localToWorld(y), F.DrawSphere(y, 0.02, 16711680);
19433
19428
  const x = this._hitNormalInLocalSpace.clone();
19434
- x.applyQuaternion(v), z.DrawRay(y, x, 16711680), z.DrawLabel(
19429
+ x.applyQuaternion(v), F.DrawRay(y, x, 16711680), F.DrawLabel(
19435
19430
  m.add(new b(0, 0.25, 0)),
19436
19431
  `Distance: ${this._totalMovement.length().toFixed(2)}
19437
19432
 
@@ -19445,7 +19440,7 @@ class Cf {
19445
19440
  0.03
19446
19441
  );
19447
19442
  const I = this._bottomCenter.clone(), O = this._backCenter.clone(), k = this._backBottomCenter.clone();
19448
- t.localToWorld(I), t.localToWorld(O), t.localToWorld(k), z.DrawSphere(I, 0.01, 65280, 0, !1), z.DrawSphere(O, 0.01, 255, 0, !1), z.DrawSphere(k, 0.01, 16711935, 0, !1), z.DrawLine(I, k, 65535, 0, !1), z.DrawLine(k, O, 65535, 0, !1);
19443
+ t.localToWorld(I), t.localToWorld(O), t.localToWorld(k), F.DrawSphere(I, 0.01, 65280, 0, !1), F.DrawSphere(O, 0.01, 255, 0, !1), F.DrawSphere(k, 0.01, 16711935, 0, !1), F.DrawLine(I, k, 65535, 0, !1), F.DrawLine(k, O, 65535, 0, !1);
19449
19444
  }
19450
19445
  }
19451
19446
  onDragEnd(e) {
@@ -19769,7 +19764,7 @@ function Xk(s, e, t) {
19769
19764
  if (r)
19770
19765
  return Vl && console.debug(`Mimetype callback returned: ${r}`), r;
19771
19766
  }
19772
- if (D() || Vl) {
19767
+ if (L() || Vl) {
19773
19768
  const o = new TextDecoder().decode(e.slice(0, Math.min(e.byteLength, 32)));
19774
19769
  console.warn(`Could not determine file type.
19775
19770
 
@@ -19992,7 +19987,7 @@ class yo extends T {
19992
19987
  const r = n.scene;
19993
19988
  this.gameObject.attach(r), r.position.set(0, 0, 0), r.quaternion.identity(), this._addedObjects.push(r), this._addedModels.push(n);
19994
19989
  const a = new pi().setFromCenterAndSize(new b(0, this.fitVolumeSize.y * 0.5, 0).add(this.gameObject.worldPosition), this.fitVolumeSize);
19995
- if (ri && z.DrawWireBox3(a, 255, 5), this.fitIntoVolume && UC(r, a, {
19990
+ if (ri && F.DrawWireBox3(a, 255, 5), this.fitIntoVolume && UC(r, a, {
19996
19991
  position: !this.placeAtHitPosition
19997
19992
  }), this.placeAtHitPosition && t && t.screenposition) {
19998
19993
  r.visible = !1;
@@ -20061,7 +20056,7 @@ class yo extends T {
20061
20056
  recursive: !0,
20062
20057
  testObject: (n) => !this._addedObjects.includes(n)
20063
20058
  }).length)
20064
- return D() && console.log(`Dropped outside of drop area for DropListener "${this.name}".`), !1;
20059
+ return L() && console.log(`Dropped outside of drop area for DropListener "${this.name}".`), !1;
20065
20060
  }
20066
20061
  return !0;
20067
20062
  }
@@ -20105,7 +20100,7 @@ var md;
20105
20100
  async function t(i, n) {
20106
20101
  return new Promise(async (o, r) => {
20107
20102
  const a = new Tt(n.guid), l = i.toString();
20108
- ri && z.DrawWireSphere(n.point, 0.1, 16711680, 3);
20103
+ ri && F.DrawWireSphere(n.point, 0.1, 16711680, 3);
20109
20104
  const c = Wo.addPreview({
20110
20105
  guid: n.guid,
20111
20106
  parent: n.parent,
@@ -20149,7 +20144,7 @@ const au = class ov extends T {
20149
20144
  }
20150
20145
  this.object.visible = !1;
20151
20146
  const e = this.gameObject.getComponent(Gr);
20152
- e && (e.enabled = !1), this._startPosition = this.object.position?.clone() ?? new b(0, 0, 0), this._startQuaternion = this.object.quaternion?.clone() ?? new N(0, 0, 0, 1);
20147
+ e && (e.enabled = !1), this._startPosition = this.object.position?.clone() ?? new b(0, 0, 0), this._startQuaternion = this.object.quaternion?.clone() ?? new $(0, 0, 0, 1);
20153
20148
  }
20154
20149
  this.gameObject.getComponentInParent(Vi) || this.gameObject.addComponent(Vi);
20155
20150
  }
@@ -20169,7 +20164,7 @@ const au = class ov extends T {
20169
20164
  const t = this.handleDuplication();
20170
20165
  if (t) {
20171
20166
  const i = S.getComponent(t, Gr);
20172
- i ? (i.onPointerDown(e), this._forwardPointerEvents.set(e.event.space, i)) : D() && console.warn(`Duplicated object (${t.name}) does not have DragControls`);
20167
+ i ? (i.onPointerDown(e), this._forwardPointerEvents.set(e.event.space, i)) : L() && console.warn(`Duplicated object (${t.name}) does not have DragControls`);
20173
20168
  } else
20174
20169
  this._currentCount >= this.limitCount ? console.warn(`[Duplicatable] Limit of ${this.limitCount} objects created within a few seconds reached. Please wait a moment before creating more objects.`) : console.warn("[Duplicatable] Could not duplicate object.");
20175
20170
  }
@@ -20267,7 +20262,7 @@ class av {
20267
20262
  }
20268
20263
  class tM extends av {
20269
20264
  beforeWriteNode(e, t) {
20270
- z.isGizmo(e) && (t.keep = !1);
20265
+ F.isGizmo(e) && (t.keep = !1);
20271
20266
  }
20272
20267
  }
20273
20268
  class lv extends av {
@@ -20702,12 +20697,12 @@ class Me extends fb {
20702
20697
  return dv(e), e;
20703
20698
  }
20704
20699
  constructor(e, ...t) {
20705
- super(...t), this.identifier = e, _n && console.log(this), this.type = "NEEDLE_CUSTOM_SHADER", this.uniforms[this._objToWorldName] || (this.uniforms[this._objToWorldName] = { value: [] }), this.uniforms[this._worldToObjectName] || (this.uniforms[this._worldToObjectName] = { value: [] }), this.uniforms[this._viewProjectionName] || (this.uniforms[this._viewProjectionName] = { value: [] }), this.uniforms[this._sphericalHarmonicsName], (this.depthTextureUniform || this.opaqueTextureUniform) && U.Current.pre_render_callbacks.push(this.onBeforeRenderSceneCallback);
20700
+ super(...t), this.identifier = e, _n && console.log(this), this.type = "NEEDLE_CUSTOM_SHADER", this.uniforms[this._objToWorldName] || (this.uniforms[this._objToWorldName] = { value: [] }), this.uniforms[this._worldToObjectName] || (this.uniforms[this._worldToObjectName] = { value: [] }), this.uniforms[this._viewProjectionName] || (this.uniforms[this._viewProjectionName] = { value: [] }), this.uniforms[this._sphericalHarmonicsName], (this.depthTextureUniform || this.opaqueTextureUniform) && N.Current.pre_render_callbacks.push(this.onBeforeRenderSceneCallback);
20706
20701
  }
20707
20702
  dispose() {
20708
20703
  super.dispose();
20709
- const e = U.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
20710
- e >= 0 && U.Current.pre_render_callbacks.splice(e, 1);
20704
+ const e = N.Current.pre_render_callbacks.indexOf(this.onBeforeRenderSceneCallback);
20705
+ e >= 0 && N.Current.pre_render_callbacks.splice(e, 1);
20711
20706
  }
20712
20707
  /* REMOVED, we don't have Lit shader support for now
20713
20708
  async waitForLighting() {
@@ -20759,13 +20754,13 @@ class Me extends fb {
20759
20754
  return this.uniforms._CameraOpaqueTexture;
20760
20755
  }
20761
20756
  onBeforeRenderScene() {
20762
- this.opaqueTextureUniform && U.Current.setRequireColor(!0), this.depthTextureUniform && U.Current.setRequireDepth(!0);
20757
+ this.opaqueTextureUniform && N.Current.setRequireColor(!0), this.depthTextureUniform && N.Current.setRequireDepth(!0);
20763
20758
  }
20764
20759
  onBeforeRender(e, t, i, n, o, r) {
20765
20760
  n.attributes.tangent || n.computeTangents(), this.onUpdateUniforms(i, o);
20766
20761
  }
20767
20762
  onUpdateUniforms(e, t) {
20768
- const i = U.Current;
20763
+ const i = N.Current;
20769
20764
  if (e && (Me.viewProjection && this.uniforms[this._viewProjectionName] && (Me.viewProjection.copy(e.projectionMatrix).multiply(e.matrixWorldInverse), ld(Me.viewProjection, Me._viewProjectionValues)), Me.viewMatrix && this.uniforms[this._viewMatrixName] && (Me.viewMatrix.copy(e.matrixWorldInverse), ld(Me.viewMatrix, Me._viewMatrixValues)), this.uniforms[Me._worldSpaceCameraPosName] && Me._worldSpaceCameraPos.setFromMatrixPosition(e.matrixWorld)), this.uniforms._TimeParameters && (this.uniforms._TimeParameters.value = i.sceneLighting.timeVec4), this.uniforms._Time) {
20770
20765
  const a = this.uniforms._Time.value;
20771
20766
  a.x = i.sceneLighting.timeVec4.x / 20, a.y = i.sceneLighting.timeVec4.x, a.z = i.sceneLighting.timeVec4.x * 2, a.w = i.sceneLighting.timeVec4.x * 3;
@@ -21028,7 +21023,7 @@ async function Fp(s, e, t) {
21028
21023
  const o = new gd(n);
21029
21024
  return o.setAnimationPointerResolver.bind(o)(new gM()), o;
21030
21025
  } else
21031
- return (pM || D()) && console.error("Missing KHR_animation_pointer extension..."), {
21026
+ return (pM || L()) && console.error("Missing KHR_animation_pointer extension..."), {
21032
21027
  name: "KHR_animation_pointer_NOT_AVAILABLE"
21033
21028
  };
21034
21029
  });
@@ -21055,7 +21050,7 @@ class pv {
21055
21050
  const a = new Array(), l = new Array(), c = new Array();
21056
21051
  for (let p = 0; p < e.count; p++) {
21057
21052
  e.getMatrixAt(p, r);
21058
- let g = new b(), _ = new N(), m = new b();
21053
+ let g = new b(), _ = new $(), m = new b();
21059
21054
  r.decompose(g, _, m), a.push(g.x, g.y, g.z), l.push(_.x, _.y, _.z, _.w), c.push(m.x, m.y, m.z);
21060
21055
  }
21061
21056
  const h = new Float32Array(a), d = new Float32Array(l), f = new Float32Array(c);
@@ -21116,7 +21111,7 @@ const ol = w("debugreflectionprobe"), v_ = w("noreflectionprobe"), Mf = Symbol("
21116
21111
  this._boxHelper = this.gameObject.addComponent(Ct), this._boxHelper.updateBox(!0), ol && this._boxHelper.showHelper(5592320, !0), this._texture && (this._texture.mapping = _s, this._texture.colorSpace = Ss, this._texture.needsUpdate = !0);
21117
21112
  }
21118
21113
  start() {
21119
- !this._texture && D() && (console.warn(`[ReflectionProbe] Missing texture. Please assign a custom cubemap texture. To use reflection probes assign them to your renderer's "anchor" property.`), ge("ReflectionProbe configuration hint: See browser console for details"));
21114
+ !this._texture && L() && (console.warn(`[ReflectionProbe] Missing texture. Please assign a custom cubemap texture. To use reflection probes assign them to your renderer's "anchor" property.`), ge("ReflectionProbe configuration hint: See browser console for details"));
21120
21115
  }
21121
21116
  onDestroy() {
21122
21117
  const e = ss._probes.get(this.context);
@@ -21304,7 +21299,7 @@ class ra {
21304
21299
  return i(`Instancing: Can not update geometry (${this.name}), reserved index range is too small: ${this.__reservedIndexRange.toLocaleString()} < ${this.indexCount.toLocaleString()} indices for ${this.name}`);
21305
21300
  return this.renderer.updateGeometry(e, this.__geometryIndex);
21306
21301
  function i(n) {
21307
- return t.updateMeshInformation() && (t.renderer.remove(t, !0), t.renderer.add(t)) ? !0 : ((D() || Qt) && console.error(n), !1);
21302
+ return t.updateMeshInformation() && (t.renderer.remove(t, !0), t.renderer.add(t)) ? !0 : ((L() || Qt) && console.error(n), !1);
21308
21303
  }
21309
21304
  }
21310
21305
  /** Adds this object to the instancing renderer (effectively activating instancing) */
@@ -21362,7 +21357,7 @@ class bM {
21362
21357
  updateBounds(e = !0, t = !0) {
21363
21358
  if (this._needUpdateBounds = !1, e && this._batchedMesh.computeBoundingBox(), t && this._batchedMesh.computeBoundingSphere(), Qt && this._batchedMesh.boundingSphere) {
21364
21359
  const i = this._batchedMesh.boundingSphere;
21365
- z.DrawWireSphere(i.center, i.radius, 65280);
21360
+ F.DrawWireSphere(i.center, i.radius, 65280);
21366
21361
  }
21367
21362
  }
21368
21363
  _context;
@@ -21401,7 +21396,7 @@ class bM {
21401
21396
  this.add(t);
21402
21397
  } catch (i) {
21403
21398
  if (console.error(`Failed adding mesh to instancing (object name: "${e.name}", instances: ${this._currentInstanceCount.toLocaleString()}/${this._maxInstanceCount.toLocaleString()}, vertices: ${this._currentVertexCount.toLocaleString()}/${this._maxVertexCount.toLocaleString()}, indices: ${this._currentIndexCount.toLocaleString()}/${this._maxIndexCount.toLocaleString()})
21404
- `, i), D()) {
21399
+ `, i), L()) {
21405
21400
  Wd("Failed instancing mesh. See the browser console for details.");
21406
21401
  debugger;
21407
21402
  }
@@ -21439,7 +21434,7 @@ class bM {
21439
21434
  const t = this.geometry;
21440
21435
  for (const i in t.attributes)
21441
21436
  if (i !== "batchId" && !e.hasAttribute(i))
21442
- return D() && console.warn(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`), !1;
21437
+ return L() && console.warn(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`), !1;
21443
21438
  return !0;
21444
21439
  }
21445
21440
  markNeedsUpdate() {
@@ -21464,7 +21459,7 @@ ${c.vertexCount} vertices, ${c.indexCount} indices
21464
21459
  Max count ${this._maxInstanceCount} → ${i}
21465
21460
  Max vertex count ${this._maxVertexCount} -> ${o}
21466
21461
  Max index count ${this._maxIndexCount} -> ${r}`), this._debugMaterial = x_();
21467
- } else D() && console.debug(`[Instancing] Growing Buffer
21462
+ } else L() && console.debug(`[Instancing] Growing Buffer
21468
21463
  Mesh: "${this.name}${e.name?.length ? "/" + e.name : ""}"
21469
21464
  Max count ${this._maxInstanceCount} → ${i}
21470
21465
  Max vertex count ${this._maxVertexCount} -> ${o}
@@ -21528,7 +21523,7 @@ Index: ${e.__instanceIndex}`), this._batchedMesh.deleteInstance(e.__instanceInde
21528
21523
  }
21529
21524
  function Vo(s) {
21530
21525
  if (!s)
21531
- return D() && console.error("Cannot get mesh information from null geometry"), { vertexCount: 0, indexCount: 0 };
21526
+ return L() && console.error("Cannot get mesh information from null geometry"), { vertexCount: 0, indexCount: 0 };
21532
21527
  let e = s.attributes?.position?.count || 0, t = s.index ? s.index.count : 0;
21533
21528
  const i = We.getMeshLODExtension(s);
21534
21529
  if (i) {
@@ -21993,7 +21988,7 @@ const $n = class zh extends T {
21993
21988
  if (this._probeAnchorLastFrame !== this.probeAnchor && (this._reflectionProbe?.onUnset(this), this.updateReflectionProbe()), Pl == this.name && this.gameObject instanceof H) {
21994
21989
  this.gameObject.geometry.computeBoundingSphere();
21995
21990
  const e = G(this.gameObject.geometry.boundingSphere.center).applyMatrix4(this.gameObject.matrixWorld);
21996
- z.DrawWireSphere(e, this.gameObject.geometry.boundingSphere.radius, 56831);
21991
+ F.DrawWireSphere(e, this.gameObject.geometry.boundingSphere.radius, 56831);
21997
21992
  }
21998
21993
  if (this.isMultiMaterialObject(this.gameObject) && this.gameObject.children?.length > 0)
21999
21994
  for (const e of this.gameObject.children)
@@ -22120,7 +22115,7 @@ class gv extends lu {
22120
22115
  for (const e of this.sharedMeshes)
22121
22116
  if (e instanceof ys && e.boundingSphere) {
22122
22117
  const t = G(e.boundingSphere.center).applyMatrix4(e.matrixWorld);
22123
- z.DrawWireSphere(t, e.boundingSphere.radius, "red");
22118
+ F.DrawWireSphere(t, e.boundingSphere.radius, "red");
22124
22119
  }
22125
22120
  }
22126
22121
  }
@@ -22683,7 +22678,7 @@ function xv(s) {
22683
22678
  }
22684
22679
  return t;
22685
22680
  }
22686
- const IM = new b(), LM = new N(), DM = new b(1, 1, 1);
22681
+ const IM = new b(), LM = new $(), DM = new b(1, 1, 1);
22687
22682
  class st {
22688
22683
  static USDObject_export_id = 0;
22689
22684
  uuid;
@@ -22705,7 +22700,7 @@ class st {
22705
22700
  this.transform = null;
22706
22701
  return;
22707
22702
  }
22708
- const t = new b(), i = new N(), n = new b();
22703
+ const t = new b(), i = new $(), n = new b();
22709
22704
  e.decompose(t, i, n), this.transform = { position: t, quaternion: i, scale: n };
22710
22705
  }
22711
22706
  /** @deprecated Use `transform`, or `getMatrix()` if you really need the matrix */
@@ -22993,13 +22988,13 @@ let FM = class {
22993
22988
  le.report("export-usdz-textures", { message: "read back texture", autoStep: !0 });
22994
22989
  const E = x.scale !== void 0 && x.scale.x !== 1 && x.scale.y !== 1 && x.scale.z !== 1 && x.scale.w !== 1;
22995
22990
  (I.isCompressedTexture || I.isRenderTargetTexture || E) && (k = await UM(I, t.maxTextureSize, g, x.scale)), le.report("export-usdz-textures", { message: "convert texture to canvas", autoStep: !0 });
22996
- const B = await $M(k.imageBitmap || k.imageData, t.maxTextureSize).catch((L) => {
22997
- console.error("Error converting texture to canvas", I, L);
22991
+ const z = await $M(k.imageBitmap || k.imageData, t.maxTextureSize).catch((D) => {
22992
+ console.error("Error converting texture to canvas", I, D);
22998
22993
  });
22999
- if (B) {
22994
+ if (z) {
23000
22995
  le.report("export-usdz-textures", { message: "convert canvas to blob", autoStep: !0 });
23001
- const L = await B.convertToBlob({ type: O ? "image/png" : "image/jpeg", quality: 0.95 });
23002
- n[`textures/${y}.${O ? "png" : "jpg"}`] = new Uint8Array(await L.arrayBuffer());
22996
+ const D = await z.convertToBlob({ type: O ? "image/png" : "image/jpeg", quality: 0.95 });
22997
+ n[`textures/${y}.${O ? "png" : "jpg"}`] = new Uint8Array(await D.arrayBuffer());
23003
22998
  } else
23004
22999
  console.warn("Can`t export texture: ", I);
23005
23000
  };
@@ -23487,7 +23482,7 @@ function Fs(s, e, t, i, n, o, r = void 0, a = void 0) {
23487
23482
  // MirroredRepeatWrapping
23488
23483
  }, _ = s.repeat.clone(), m = s.offset.clone(), v = s.rotation, y = Math.sin(v), x = Math.cos(v);
23489
23484
  m.y = 1 - m.y - _.y, t ? (_.x === 0 && (_.x = 1e-4), _.y === 0 && (_.y = 1e-4), m.x = m.x / _.x, m.y = m.y / _.y, m.x += y / _.x, m.y += x - 1) : (m.x += y * _.x, m.y += (1 - x) * _.y);
23490
- const I = cu(n), O = _.x != 1 || _.y != 1 || m.x != 0 || m.y != 0 || v != 0, k = `${Ut}/${I}/${"uvReader_" + f}.outputs:result>`, E = `${Ut}/${I}/Transform2d_${e}.outputs:result>`, B = e !== "normal" && r && (r.r !== 1 || r.g !== 1 || r.b !== 1 || a !== 1) || !1, L = e === "normal", W = n instanceof ct && n.normalScale ? n.normalScale.x * 2 : 2, X = W.toFixed(Oe), A = (-1 * (W / 2)).toFixed(Oe), $ = (1 - W).toFixed(Oe);
23485
+ const I = cu(n), O = _.x != 1 || _.y != 1 || m.x != 0 || m.y != 0 || v != 0, k = `${Ut}/${I}/${"uvReader_" + f}.outputs:result>`, E = `${Ut}/${I}/Transform2d_${e}.outputs:result>`, z = e !== "normal" && r && (r.r !== 1 || r.g !== 1 || r.b !== 1 || a !== 1) || !1, D = e === "normal", V = n instanceof ct && n.normalScale ? n.normalScale.x * 2 : 2, q = V.toFixed(Oe), A = (-1 * (V / 2)).toFixed(Oe), U = (1 - V).toFixed(Oe);
23491
23486
  return `
23492
23487
  ${O ? `def Shader "Transform2d_${e}" (
23493
23488
  sdrMetadata = {
@@ -23509,12 +23504,12 @@ function Fs(s, e, t, i, n, o, r = void 0, a = void 0) {
23509
23504
  asset inputs:file = @textures/${c}.${p ? "png" : "jpg"}@
23510
23505
  token inputs:sourceColorSpace = "${s.colorSpace === "srgb" ? "sRGB" : "raw"}"
23511
23506
  float2 inputs:st.connect = ${O ? E : k}
23512
- ${B ? `
23507
+ ${z ? `
23513
23508
  float4 inputs:scale = (${r ? r.r + ", " + r.g + ", " + r.b : "1, 1, 1"}, ${a})
23514
23509
  ` : ""}
23515
- ${L ? `
23516
- float4 inputs:scale = (${X}, ${X}, ${X}, 1)
23517
- float4 inputs:bias = (${A}, ${A}, ${$}, 0)
23510
+ ${D ? `
23511
+ float4 inputs:scale = (${q}, ${q}, ${q}, 1)
23512
+ float4 inputs:bias = (${A}, ${A}, ${U}, 0)
23518
23513
  ` : ""}
23519
23514
  token inputs:wrapS = "${g[s.wrapS]}"
23520
23515
  token inputs:wrapT = "${g[s.wrapT]}"
@@ -24080,7 +24075,7 @@ class Ue {
24080
24075
  console.error("This is a rest clip but you're trying to add tracks to it – this is likely a bug");
24081
24076
  return;
24082
24077
  }
24083
- e.name.endsWith("position") ? this.pos = e : e.name.endsWith("quaternion") ? this.rot = e : e.name.endsWith("scale") ? this.scale = e : (e.name.endsWith("activeSelf") ? console.warn("[USDZ] Animation of enabled/disabled state is not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Animate scale 0/1 instead.") : console.warn("[USDZ] Animation track type not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Only .position, .rotation, .scale are supported."), D() && ge("[USDZ] Some animations can't be exported. See console for details."));
24078
+ e.name.endsWith("position") ? this.pos = e : e.name.endsWith("quaternion") ? this.rot = e : e.name.endsWith("scale") ? this.scale = e : (e.name.endsWith("activeSelf") ? console.warn("[USDZ] Animation of enabled/disabled state is not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Animate scale 0/1 instead.") : console.warn("[USDZ] Animation track type not supported for USDZ export and will NOT be exported: " + e.name + " on " + (this.root?.name ?? this.target.name) + ". Only .position, .rotation, .scale are supported."), L() && ge("[USDZ] Some animations can't be exported. See console for details."));
24084
24079
  }
24085
24080
  getFrames() {
24086
24081
  return this.clip ? Math.max(this.pos?.times?.length ?? 0, this.rot?.times?.length ?? 0, this.scale?.times?.length ?? 0) : 2;
@@ -24106,7 +24101,7 @@ class Ue {
24106
24101
  * @param generateScale
24107
24102
  */
24108
24103
  *getValues(e, t = !0, i = !0, n = !0) {
24109
- const o = new b(), r = new N(), a = new b(1, 1, 1), l = this.target, c = t ? this.pos?.createInterpolant() : void 0, h = i ? this.rot?.createInterpolant() : void 0, d = n ? this.scale?.createInterpolant() : void 0;
24104
+ const o = new b(), r = new $(), a = new b(1, 1, 1), l = this.target, c = t ? this.pos?.createInterpolant() : void 0, h = i ? this.rot?.createInterpolant() : void 0, d = n ? this.scale?.createInterpolant() : void 0;
24110
24105
  c || o.set(l.position.x, l.position.y, l.position.z), h || r.set(l.quaternion.x, l.quaternion.y, l.quaternion.z, l.quaternion.w), d || a.set(l.scale.x, l.scale.y, l.scale.z), c && c.valueSize !== 3 && (c.valueSize = 3), h && h.valueSize !== 4 && (h.valueSize = 4), d && d.valueSize !== 3 && (d.valueSize = 3);
24111
24106
  const f = 0;
24112
24107
  for (let p = 0 - f; p < e.length + f; p++) {
@@ -24349,35 +24344,35 @@ class JM {
24349
24344
  const n = this.model, o = this.animationData;
24350
24345
  if (n && n.skinnedMesh) {
24351
24346
  let r = function(A) {
24352
- const $ = [];
24353
- for (const [V, ne] of A) {
24354
- let re = `${V} : [`;
24347
+ const U = [];
24348
+ for (const [W, ne] of A) {
24349
+ let re = `${W} : [`;
24355
24350
  const ue = [];
24356
24351
  for (const Se of ne)
24357
24352
  ue.push(`(${ae(Se.x)}, ${ae(Se.y)}, ${ae(Se.z)})`);
24358
- re = re.concat(ue.join(", ")), re = re.concat("],"), $.push(re);
24353
+ re = re.concat(ue.join(", ")), re = re.concat("],"), U.push(re);
24359
24354
  }
24360
- return $;
24355
+ return U;
24361
24356
  }, a = function(A) {
24362
- const $ = [];
24363
- for (const [V, ne] of A) {
24364
- let re = `${V} : [`;
24357
+ const U = [];
24358
+ for (const [W, ne] of A) {
24359
+ let re = `${W} : [`;
24365
24360
  const ue = [];
24366
24361
  for (const Se of ne)
24367
24362
  ue.push(`(${ae(Se.w)}, ${ae(Se.x)}, ${ae(Se.y)}, ${ae(Se.z)})`);
24368
- re = re.concat(ue.join(", ")), re = re.concat("],"), $.push(re);
24363
+ re = re.concat(ue.join(", ")), re = re.concat("],"), U.push(re);
24369
24364
  }
24370
- return $;
24365
+ return U;
24371
24366
  }, l = function(A) {
24372
- let $, V = !0;
24367
+ let U, W = !0;
24373
24368
  const ne = /* @__PURE__ */ new Map();
24374
24369
  for (const [ue, Se] of A) {
24375
- $ === void 0 && ($ = Se.length), $ !== Se.length && (V = !1);
24370
+ U === void 0 && (U = Se.length), U !== Se.length && (W = !1);
24376
24371
  let Je = 0;
24377
24372
  for (const ki of Se)
24378
24373
  Je++, ki || (ne.has(ue) || ne.set(ue, []), ne.get(ue).push(Je));
24379
24374
  }
24380
- Sn && console.log("Bone count: ", A.size, "TransformData entries per bone: ", $, "Undefined bone entries: ", ne), console.assert(V, "All bones should have the same number of TransformData entries", A), console.assert(ne.size === 0, "All TransformData entries should be set", ne);
24375
+ Sn && console.log("Bone count: ", A.size, "TransformData entries per bone: ", U, "Undefined bone entries: ", ne), console.assert(W, "All bones should have the same number of TransformData entries", A), console.assert(ne.size === 0, "All TransformData entries should be set", ne);
24381
24376
  const re = [];
24382
24377
  for (const [ue, Se] of A)
24383
24378
  for (let Je = 0; Je < Se.length; Je++) {
@@ -24389,14 +24384,14 @@ class JM {
24389
24384
  for (const ue of re)
24390
24385
  ue.pos.sort((Se, Je) => Se - Je), ue.rot.sort((Se, Je) => Se - Je), ue.scale.sort((Se, Je) => Se - Je), ue.pos = [...new Set(ue.pos)], ue.rot = [...new Set(ue.rot)], ue.scale = [...new Set(ue.scale)];
24391
24386
  return re;
24392
- }, c = function(A, $, V) {
24393
- const ne = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map(), Se = $.length;
24394
- for (const Je of V) {
24387
+ }, c = function(A, U, W) {
24388
+ const ne = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map(), Se = U.length;
24389
+ for (const Je of W) {
24395
24390
  const ki = A.get(Je);
24396
24391
  let Vc;
24397
- ki ? console.assert(ki.length === Se, "We should have the same number of TransformData entries for each bone", ki, $) : Vc = new Ue(null, Je, null);
24392
+ ki ? console.assert(ki.length === Se, "We should have the same number of TransformData entries for each bone", ki, U) : Vc = new Ue(null, Je, null);
24398
24393
  for (let Ds = 0; Ds < Se; Ds++) {
24399
- const Wu = ki ? ki[Ds] : Vc, kr = $[Ds];
24394
+ const Wu = ki ? ki[Ds] : Vc, kr = U[Ds];
24400
24395
  for (const { time: Ya, translation: Ka } of Wu.getValues(kr.pos, !0, !1, !1)) {
24401
24396
  const Ki = (Ya + kr.timeOffset) * 60;
24402
24397
  ne.has(Ki) || ne.set(Ki, new Array()), ne.get(Ki).push(Ka.clone());
@@ -24417,93 +24412,93 @@ class JM {
24417
24412
  scale: ue.size == 0 ? void 0 : ue
24418
24413
  };
24419
24414
  }, h = function(A) {
24420
- const $ = [];
24421
- for (const V of A)
24422
- $.push(`(${ae(V.x)}, ${ae(V.y)}, ${ae(V.z)})`);
24423
- return $.join(", ");
24415
+ const U = [];
24416
+ for (const W of A)
24417
+ U.push(`(${ae(W.x)}, ${ae(W.y)}, ${ae(W.z)})`);
24418
+ return U.join(", ");
24424
24419
  }, d = function(A) {
24425
- const $ = [];
24426
- for (const V of A)
24427
- $.push(`(${ae(V.w)}, ${ae(V.x)}, ${ae(V.y)}, ${ae(V.z)})`);
24428
- return $.join(", ");
24420
+ const U = [];
24421
+ for (const W of A)
24422
+ U.push(`(${ae(W.w)}, ${ae(W.x)}, ${ae(W.y)}, ${ae(W.z)})`);
24423
+ return U.join(", ");
24429
24424
  }, f = function(A) {
24430
- const $ = /* @__PURE__ */ new Map();
24425
+ const U = /* @__PURE__ */ new Map();
24431
24426
  if (Sn) {
24432
- const V = new Array();
24427
+ const W = new Array();
24433
24428
  for (const [ne, re] of o)
24434
- V.push(ne.uuid + ": " + re.length + " " + re.map((ue) => ue.clip?.uuid.substring(0, 6)).join(" "));
24429
+ W.push(ne.uuid + ": " + re.length + " " + re.map((ue) => ue.clip?.uuid.substring(0, 6)).join(" "));
24435
24430
  console.log(`getPerBoneTransformData
24436
- ` + V.join(`
24431
+ ` + W.join(`
24437
24432
  `));
24438
24433
  }
24439
- for (const V of A) {
24440
- const ne = o.get(V);
24441
- ne && $.set(V, ne);
24434
+ for (const W of A) {
24435
+ const ne = o.get(W);
24436
+ ne && U.set(W, ne);
24442
24437
  }
24443
- return $;
24438
+ return U;
24444
24439
  }, p = function(A) {
24445
- const $ = f(A), V = l($);
24446
- return c($, V, A);
24440
+ const U = f(A), W = l(U);
24441
+ return c(U, W, A);
24447
24442
  };
24448
24443
  const g = n.skinnedMesh.skeleton, _ = new Array(), m = [], v = [];
24449
24444
  for (const A of g.bones) {
24450
24445
  m.push(A), v.push(A.uuid);
24451
- const $ = g.boneInverses[g.bones.indexOf(A)];
24452
- _.push({ bone: A, inverse: $ });
24446
+ const U = g.boneInverses[g.bones.indexOf(A)];
24447
+ _.push({ bone: A, inverse: U });
24453
24448
  }
24454
24449
  let y = 1e4;
24455
24450
  for (; v.length < g.bones.length && y-- > 0; )
24456
24451
  for (const A of m) {
24457
- const $ = A.children;
24458
- for (const V of $)
24459
- if (v.indexOf(V.uuid) === -1 && g.bones.indexOf(V) !== -1) {
24460
- m.push(V), v.push(V.uuid);
24461
- const ne = g.boneInverses[g.bones.indexOf(V)];
24462
- _.push({ bone: V, inverse: ne });
24452
+ const U = A.children;
24453
+ for (const W of U)
24454
+ if (v.indexOf(W.uuid) === -1 && g.bones.indexOf(W) !== -1) {
24455
+ m.push(W), v.push(W.uuid);
24456
+ const ne = g.boneInverses[g.bones.indexOf(W)];
24457
+ _.push({ bone: W, inverse: ne });
24463
24458
  }
24464
24459
  }
24465
24460
  y <= 0 && console.error("Failed to sort bones in skinned mesh", n.skinnedMesh, g.bones, v);
24466
24461
  for (const A of xv(g.bones))
24467
24462
  _.push({ bone: A, inverse: A.matrixWorld.clone().invert() });
24468
24463
  const x = _[0].bone.parent;
24469
- x || console.error("No bone parent found for skinned mesh during USDZ export", n.skinnedMesh), _.sort((A, $) => aa(A.bone, x) > aa($.bone, x) ? 1 : -1);
24470
- const I = t.quickLookCompatible, O = [], k = [], E = [], B = [];
24464
+ x || console.error("No bone parent found for skinned mesh during USDZ export", n.skinnedMesh), _.sort((A, U) => aa(A.bone, x) > aa(U.bone, x) ? 1 : -1);
24465
+ const I = t.quickLookCompatible, O = [], k = [], E = [], z = [];
24471
24466
  for (const { bone: A } of _) {
24472
24467
  if (I) {
24473
- const $ = A.scale;
24474
- $.x == 0 && ($.x = 1e-5), $.y == 0 && ($.y = 1e-5), $.z == 0 && ($.z = 1e-5), O.push(new te().compose(A.position, A.quaternion, A.scale));
24468
+ const U = A.scale;
24469
+ U.x == 0 && (U.x = 1e-5), U.y == 0 && (U.y = 1e-5), U.z == 0 && (U.z = 1e-5), O.push(new te().compose(A.position, A.quaternion, A.scale));
24475
24470
  } else
24476
24471
  O.push(A.matrix.clone());
24477
- k.push(A.position), E.push(A.quaternion), B.push(A.scale);
24472
+ k.push(A.position), E.push(A.quaternion), z.push(A.scale);
24478
24473
  }
24479
- const L = _.map((A) => '"' + aa(A.bone, x) + '"').join(", "), W = _.map((A) => k_(A.inverse.clone().invert())).join(", ");
24480
- e.beginBlock('def Skeleton "Rig"'), e.appendLine(`uniform matrix4d[] bindTransforms = [${W}]`), e.appendLine(`uniform token[] joints = [${L}]`), e.appendLine('uniform token purpose = "guide"'), e.appendLine(`uniform matrix4d[] restTransforms = [${O.map((A) => k_(A)).join(", ")}]`);
24481
- const X = p(_.map((A) => A.bone));
24474
+ const D = _.map((A) => '"' + aa(A.bone, x) + '"').join(", "), V = _.map((A) => k_(A.inverse.clone().invert())).join(", ");
24475
+ e.beginBlock('def Skeleton "Rig"'), e.appendLine(`uniform matrix4d[] bindTransforms = [${V}]`), e.appendLine(`uniform token[] joints = [${D}]`), e.appendLine('uniform token purpose = "guide"'), e.appendLine(`uniform matrix4d[] restTransforms = [${O.map((A) => k_(A)).join(", ")}]`);
24476
+ const q = p(_.map((A) => A.bone));
24482
24477
  if (Sn) {
24483
- let A = 1e7, $ = 0;
24484
- for (const V of X.position?.keys() ?? [])
24485
- A = Math.min(A, V), $ = Math.max($, V);
24486
- console.log("Time samples", A, $, X);
24478
+ let A = 1e7, U = 0;
24479
+ for (const W of q.position?.keys() ?? [])
24480
+ A = Math.min(A, W), U = Math.max(U, W);
24481
+ console.log("Time samples", A, U, q);
24487
24482
  }
24488
- if (e.beginBlock('def SkelAnimation "_anim"'), e.appendLine(`uniform token[] joints = [${L}]`), e.appendLine(`quatf[] rotations = [${d(E)}]`), X && X.quaternion) {
24483
+ if (e.beginBlock('def SkelAnimation "_anim"'), e.appendLine(`uniform token[] joints = [${D}]`), e.appendLine(`quatf[] rotations = [${d(E)}]`), q && q.quaternion) {
24489
24484
  e.beginBlock("quatf[] rotations.timeSamples = {", "");
24490
- const A = a(X.quaternion);
24491
- for (const $ of A)
24492
- e.appendLine($);
24485
+ const A = a(q.quaternion);
24486
+ for (const U of A)
24487
+ e.appendLine(U);
24493
24488
  e.closeBlock();
24494
24489
  }
24495
- if (e.appendLine(`half3[] scales = [${h(B)}]`), X && X.scale) {
24490
+ if (e.appendLine(`half3[] scales = [${h(z)}]`), q && q.scale) {
24496
24491
  e.beginBlock("half3[] scales.timeSamples = {", "");
24497
- const A = r(X.scale);
24498
- for (const $ of A)
24499
- e.appendLine($);
24492
+ const A = r(q.scale);
24493
+ for (const U of A)
24494
+ e.appendLine(U);
24500
24495
  e.closeBlock();
24501
24496
  }
24502
- if (e.appendLine(`float3[] translations = [${h(k)}]`), X && X.position) {
24497
+ if (e.appendLine(`float3[] translations = [${h(k)}]`), q && q.position) {
24503
24498
  e.beginBlock("float3[] translations.timeSamples = {", "");
24504
- const A = r(X.position);
24505
- for (const $ of A)
24506
- e.appendLine($);
24499
+ const A = r(q.position);
24500
+ for (const U of A)
24501
+ e.appendLine(U);
24507
24502
  e.closeBlock();
24508
24503
  }
24509
24504
  e.closeBlock(), e.closeBlock();
@@ -24557,18 +24552,18 @@ class JM {
24557
24552
  }
24558
24553
  if (y)
24559
24554
  for (const { time: O, translation: k } of g.getValues(m, !0, !1, !1)) {
24560
- const B = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24561
- e.appendLine(B);
24555
+ const z = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24556
+ e.appendLine(z);
24562
24557
  }
24563
24558
  if (x)
24564
24559
  for (const { time: O, rotation: k } of g.getValues(m, !1, !0, !1)) {
24565
- const B = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.w)}, ${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24566
- e.appendLine(B);
24560
+ const z = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.w)}, ${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24561
+ e.appendLine(z);
24567
24562
  }
24568
24563
  if (I)
24569
24564
  for (const { time: O, scale: k } of g.getValues(m, !1, !1, !0)) {
24570
- const B = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24571
- e.appendLine(B);
24565
+ const z = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24566
+ e.appendLine(z);
24572
24567
  }
24573
24568
  }
24574
24569
  e.closeBlock();
@@ -24624,7 +24619,7 @@ var tR = Object.defineProperty, Fe = (s, e, t, i) => {
24624
24619
  };
24625
24620
  const A_ = w("debugusdzbehaviours");
24626
24621
  function xc(s) {
24627
- s && (s.getComponentInParent(Sa) || (D() && console.debug('Raycaster on "' + s.name + '" was automatically added, because no raycaster was found in the parent hierarchy.'), s.addComponent(Vi)));
24622
+ s && (s.getComponentInParent(Sa) || (L() && console.debug('Raycaster on "' + s.name + '" was automatically added, because no raycaster was found in the parent hierarchy.'), s.addComponent(Vi)));
24628
24623
  }
24629
24624
  class Da extends T {
24630
24625
  object;
@@ -24633,7 +24628,7 @@ class Da extends T {
24633
24628
  relativeMotion = !1;
24634
24629
  coroutine = null;
24635
24630
  targetPos = new b();
24636
- targetRot = new N();
24631
+ targetRot = new $();
24637
24632
  targetScale = new b();
24638
24633
  start() {
24639
24634
  xc(this.gameObject);
@@ -24690,7 +24685,7 @@ const hu = class zt extends T {
24690
24685
  variantMaterial;
24691
24686
  fadeDuration = 0;
24692
24687
  start() {
24693
- this._objectsWithThisMaterial = this.objectsWithThisMaterial, xc(this.gameObject), D() && this._objectsWithThisMaterial.length <= 0 && console.warn('ChangeMaterialOnClick: No objects found with material "' + this.materialToSwitch?.name + '"');
24688
+ this._objectsWithThisMaterial = this.objectsWithThisMaterial, xc(this.gameObject), L() && this._objectsWithThisMaterial.length <= 0 && console.warn('ChangeMaterialOnClick: No objects found with material "' + this.materialToSwitch?.name + '"');
24694
24689
  }
24695
24690
  onPointerEnter(e) {
24696
24691
  this.context.input.setCursor("pointer");
@@ -25029,7 +25024,7 @@ const cg = class yn extends T {
25029
25024
  afterSerialize() {
25030
25025
  if (yn.rootsWithExclusivePlayback.size > 1) {
25031
25026
  const e = 'Multiple root objects targeted by more than one animation. To work around QuickLook bug FB13410767, animations will be set as "exclusive" and activating them will stop other animations being marked as exclusive.';
25032
- D() && ge(e), console.warn(e, ...yn.rootsWithExclusivePlayback);
25027
+ L() && ge(e), console.warn(e, ...yn.rootsWithExclusivePlayback);
25033
25028
  }
25034
25029
  yn.animationActions = [], yn.rootsWithExclusivePlayback = /* @__PURE__ */ new Set();
25035
25030
  }
@@ -25038,7 +25033,7 @@ const cg = class yn extends T {
25038
25033
  const i = t.document, n = t.extensions.find((a) => a instanceof lg);
25039
25034
  if (!n) return;
25040
25035
  const o = n.getClipCount(this.target) > 1;
25041
- o && (D() && console.warn("Setting exclusive playback for " + this.target.name + "@" + this.stateName + " because it has " + n.getClipCount(this.target) + " animations. This works around QuickLook bug FB13410767."), yn.rootsWithExclusivePlayback.add(this.target));
25036
+ o && (L() && console.warn("Setting exclusive playback for " + this.target.name + "@" + this.stateName + " because it has " + n.getClipCount(this.target) + " animations. This works around QuickLook bug FB13410767."), yn.rootsWithExclusivePlayback.add(this.target));
25042
25037
  const r = this.name ? this.name : "";
25043
25038
  i.traverse((a) => {
25044
25039
  if (a.uuid === this.target?.uuid) {
@@ -25136,8 +25131,8 @@ const cg = class yn extends T {
25136
25131
  y.tracks = v.tracks.map((O) => {
25137
25132
  const k = O.clone();
25138
25133
  k.times = new Float32Array([0, I]);
25139
- const E = O.values.length, B = O.getValueSize(), L = O.values.slice(E - B, E);
25140
- return k.values = new Float32Array(2 * B), k.values.set(L, 0), k.values.set(L, B), k;
25134
+ const E = O.values.length, z = O.getValueSize(), D = O.values.slice(E - z, E);
25135
+ return k.values = new Float32Array(2 * z), k.values.set(D, 0), k.values.set(D, z), k;
25141
25136
  }), y.name = x, e.holdClipMap.set(v, y);
25142
25137
  }
25143
25138
  if (y) {
@@ -25280,11 +25275,11 @@ class ir {
25280
25275
  if (this._quicklookButton) return this._quicklookButton;
25281
25276
  const e = document.createElement("button");
25282
25277
  this._quicklookButton = e, e.dataset.needle = "quicklook-button";
25283
- const t = q.supportsQuickLookAR();
25278
+ const t = X.supportsQuickLookAR();
25284
25279
  e.innerText = "View in AR", e.prepend(Mt("view_in_ar"));
25285
25280
  let i = !1, n = null;
25286
25281
  return e.addEventListener("click", () => {
25287
- n = Qd(ws), n || (i = !0, n = new ws()), i && (n.objectToExport = U.Current.scene), n ? (e.classList.add("this-mode-is-requested"), n.exportAndOpen().then(() => {
25282
+ n = Qd(ws), n || (i = !0, n = new ws()), i && (n.objectToExport = N.Current.scene), n ? (e.classList.add("this-mode-is-requested"), n.exportAndOpen().then(() => {
25288
25283
  e.classList.remove("this-mode-is-requested");
25289
25284
  }).catch((o) => {
25290
25285
  e.classList.remove("this-mode-is-requested"), console.error(o);
@@ -25301,7 +25296,7 @@ class ir {
25301
25296
  createARButton(e) {
25302
25297
  if (this._arButton) return this._arButton;
25303
25298
  const t = "immersive-ar", i = document.createElement("button");
25304
- return this._arButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-ar-button", i.innerText = "Enter AR", i.prepend(Mt("view_in_ar")), i.title = "Click to start an AR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
25299
+ return this._arButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-ar-button", i.innerText = "Enter AR", i.prepend(Mt("view_in_ar")), i.title = "Click to start an AR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), X.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
25305
25300
  }
25306
25301
  /** get or create the WebXR VR button
25307
25302
  * @param init optional session init options
@@ -25313,7 +25308,7 @@ class ir {
25313
25308
  createVRButton(e) {
25314
25309
  if (this._vrButton) return this._vrButton;
25315
25310
  const t = "immersive-vr", i = document.createElement("button");
25316
- return this._vrButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-vr-button", i.innerText = "Enter VR", i.prepend(Mt("panorama_photosphere")), i.title = "Click to start a VR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
25311
+ return this._vrButton = i, i.classList.add("webxr-button"), i.dataset.needle = "webxr-vr-button", i.innerText = "Enter VR", i.prepend(Mt("panorama_photosphere")), i.title = "Click to start a VR session", i.addEventListener("click", () => K.start(t, e)), this.updateSessionSupported(i, t), this.listenToXRSessionState(i, t), this.hideElementDuringXRSession(i), this.isSecureConnection || (i.disabled = !0, i.title = "WebXR requires a secure connection (HTTPS)"), X.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(i, t)), i;
25317
25312
  }
25318
25313
  /** get or create the Send To Quest button
25319
25314
  * Behaviour of the button:
@@ -25325,7 +25320,7 @@ class ir {
25325
25320
  return this._sendToQuestButton = t, t.dataset.needle = "webxr-sendtoquest-button", t.innerText = "Open on Quest", t.prepend(Mt("share_windows")), t.title = "Click to send this page to the Oculus Browser on your Quest", t.addEventListener("click", () => {
25326
25321
  const i = encodeURIComponent(window.location.href), n = e + i;
25327
25322
  window.open(n) == null && Be("This page doesn't allow popups. Please paste " + n + " into your browser.");
25328
- }), this.listenToXRSessionState(t), this.hideElementDuringXRSession(t), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => {
25323
+ }), this.listenToXRSessionState(t), this.hideElementDuringXRSession(t), X.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => {
25329
25324
  navigator.xr?.isSessionSupported("immersive-vr") ? t.style.display = "none" : t.style.display = "";
25330
25325
  }), t;
25331
25326
  }
@@ -25341,7 +25336,7 @@ class ir {
25341
25336
  return;
25342
25337
  }
25343
25338
  K.isSessionSupported(t).then((i) => {
25344
- e.style.display = i ? "" : "none", D() && !i && console.log('[WebXR] "' + t + '" is not supported on this device – make sure your server runs using HTTPS and you have a device connected that supports ' + t);
25339
+ e.style.display = i ? "" : "none", L() && !i && console.log('[WebXR] "' + t + '" is not supported on this device – make sure your server runs using HTTPS and you have a device connected that supports ' + t);
25345
25340
  });
25346
25341
  }
25347
25342
  hideElementDuringXRSession(e) {
@@ -25848,7 +25843,7 @@ class Ni extends T {
25848
25843
  }
25849
25844
  async onCreateAnchor(e, t) {
25850
25845
  if (t.createAnchor === void 0) {
25851
- console.warn("Hit does not support creating an anchor", t), D() && ge("Hit does not support creating an anchor");
25846
+ console.warn("Hit does not support creating an anchor", t), L() && ge("Hit does not support creating an anchor");
25852
25847
  return;
25853
25848
  } else {
25854
25849
  const i = await t.createAnchor(e.viewerPose.transform);
@@ -25953,7 +25948,7 @@ class vd {
25953
25948
  touchStart = (e) => {
25954
25949
  if (!e.defaultPrevented)
25955
25950
  for (let t = 0; t < e.changedTouches.length; t++) {
25956
- const i = e.changedTouches[t], n = q.isAndroidDevice() && i.clientY < window.innerHeight * 0.1;
25951
+ const i = e.changedTouches[t], n = X.isAndroidDevice() && i.clientY < window.innerHeight * 0.1;
25957
25952
  this.prev.has(i.identifier) || this.prev.set(i.identifier, {
25958
25953
  ignore: n,
25959
25954
  x: 0,
@@ -26105,10 +26100,10 @@ const Lv = function(s = null) {
26105
26100
  let i = "";
26106
26101
  typeof t == "string" ? i = t : i = t.name;
26107
26102
  let n = null, o;
26108
- typeof s == "string" ? o = e[s] : typeof s == "function" && (o = s), o == null && (D() || Ks) && s != null && console.warn('syncField: no callback function found for property "' + i + '"', '"' + s + '"');
26103
+ typeof s == "string" ? o = e[s] : typeof s == "function" && (o = s), o == null && (L() || Ks) && s != null && console.warn('syncField: no callback function found for property "' + i + '"', '"' + s + '"');
26109
26104
  const r = e, a = r.__internalAwake;
26110
26105
  if (typeof a != "function") {
26111
- (Ks || D()) && console.error('@syncField can currently only used on Needle Engine Components, custom object of type "' + e?.constructor?.name + '" is not supported', e);
26106
+ (Ks || L()) && console.error('@syncField can currently only used on Needle Engine Components, custom object of type "' + e?.constructor?.name + '" is not supported', e);
26112
26107
  return;
26113
26108
  }
26114
26109
  Ks && console.log(i);
@@ -26122,7 +26117,7 @@ const Lv = function(s = null) {
26122
26117
  set: function(f) {
26123
26118
  const p = this[l];
26124
26119
  if (this[l] = f, d) {
26125
- (D() || Ks) && console.warn("Recursive call detected", i);
26120
+ (L() || Ks) && console.warn("Recursive call detected", i);
26126
26121
  return;
26127
26122
  }
26128
26123
  d = !0;
@@ -26402,7 +26397,7 @@ class Es extends T {
26402
26397
  * Applies all configured options to the active {@link Context.menu}.
26403
26398
  */
26404
26399
  applyOptions() {
26405
- this.context.menu.setPosition(this.position), this.context.menu.showNeedleLogo(this.showNeedleLogo), this.createFullscreenButton === !0 && this.context.menu.showFullscreenOption(!0), this.createMuteButton === !0 && this.context.menu.showAudioPlaybackOption(!0), this.showSpatialMenu === !0 && this.context.menu.showSpatialMenu(this.showSpatialMenu), this.createQRCodeButton === !0 && (q.isMobileDevice() || this.context.menu.showQRCodeButton(!0));
26400
+ this.context.menu.setPosition(this.position), this.context.menu.showNeedleLogo(this.showNeedleLogo), this.createFullscreenButton === !0 && this.context.menu.showFullscreenOption(!0), this.createMuteButton === !0 && this.context.menu.showAudioPlaybackOption(!0), this.showSpatialMenu === !0 && this.context.menu.showSpatialMenu(this.showSpatialMenu), this.createQRCodeButton === !0 && (X.isMobileDevice() || this.context.menu.showQRCodeButton(!0));
26406
26401
  }
26407
26402
  }
26408
26403
  ja([
@@ -26428,7 +26423,7 @@ var mR = Object.defineProperty, ug = (s, e, t, i) => {
26428
26423
  (r = s[o]) && (n = r(e, t, n) || n);
26429
26424
  return n && mR(e, t, n), n;
26430
26425
  };
26431
- const rl = w("debugwebxr"), L_ = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
26426
+ const rl = w("debugwebxr"), L_ = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI);
26432
26427
  class lr extends T {
26433
26428
  head;
26434
26429
  leftHand;
@@ -26651,7 +26646,7 @@ class uo extends T {
26651
26646
  }
26652
26647
  async loadHandModel(e, t) {
26653
26648
  const i = this.context, n = i.renderer.xr.getHand(t.index);
26654
- n || (Jn ? z.DrawLabel(t.rayWorldPosition, "No hand found for index " + t.index, 0.05, 5) : console.warn("No hand found for index " + t.index));
26649
+ n || (Jn ? F.DrawLabel(t.rayWorldPosition, "No hand found for index " + t.index, 0.05, 5) : console.warn("No hand found for index " + t.index));
26655
26650
  const o = new Ps();
26656
26651
  $m(o, i), await Fp(o, i, this.sourceId ?? "");
26657
26652
  const r = uv(o);
@@ -26664,7 +26659,7 @@ class uo extends T {
26664
26659
  const f = r?.gltf;
26665
26660
  f?.scene.children?.length === 0 && (f.scene.children[0] = d), r?.gltf && jn().createBuiltinComponents(e.context, e.sourceId || a, r.gltf, null, r), d.traverse((p) => {
26666
26661
  p.layers.set(2), K.active?.isPassThrough && !l && this.makeOccluder(p), p instanceof H && We.assignMeshLOD(p, 0);
26667
- }), t.connected || (Jn && z.DrawLabel(t.rayWorldPosition, "Hand is loaded but not connected anymore", 0.05, 5), d.removeFromParent());
26662
+ }), t.connected || (Jn && F.DrawLabel(t.rayWorldPosition, "Hand is loaded but not connected anymore", 0.05, 5), d.removeFromParent());
26668
26663
  });
26669
26664
  if (Jn && c.add(new mi(0.5)), t.inputSource.hand) {
26670
26665
  Jn && console.log(t.inputSource.hand);
@@ -26674,7 +26669,7 @@ class uo extends T {
26674
26669
  f.matrixAutoUpdate = !1, f.visible = !0, n.joints[d.jointName] = f, n.add(f);
26675
26670
  }
26676
26671
  } else
26677
- Jn && z.DrawLabel(t.rayWorldPosition, "No inputSource.hand found for index " + t.index, 0.05, 5);
26672
+ Jn && F.DrawLabel(t.rayWorldPosition, "No inputSource.hand found for index " + t.index, 0.05, 5);
26678
26673
  return { handObject: c, handmesh: h };
26679
26674
  }
26680
26675
  makeOccluder(e) {
@@ -26789,9 +26784,9 @@ class Gi extends T {
26789
26784
  if (this.useTeleportTarget && !S.getComponentInParent(n.object, fg))
26790
26785
  return;
26791
26786
  const r = o.clone();
26792
- if (jf && z.DrawSphere(o, 0.025, 16711680, 5), this.context.mainCamera?.position) {
26787
+ if (jf && F.DrawSphere(o, 0.025, 16711680, 5), this.context.mainCamera?.position) {
26793
26788
  const l = this.context.xr?.getUserOffsetInRig();
26794
- l && (l.y = 0, r.sub(l), jf && z.DrawWireSphere(l.add(r), 0.025, 65280, 5));
26789
+ l && (l.y = 0, r.sub(l), jf && F.DrawWireSphere(l.add(r), 0.025, 65280, 5));
26795
26790
  }
26796
26791
  this._teleportBuffer.push(t.matrix.clone()), this._teleportBuffer.length > 10 && this._teleportBuffer.shift(), this.useTeleportFade ? e.xr.fadeTransition()?.then(() => {
26797
26792
  t.worldPosition = r;
@@ -26854,7 +26849,7 @@ class Gi extends T {
26854
26849
  if (c || (c = l[0]), n && (n.controller = i, n.hit = c), this._hitDistances[t] = c?.distance || null, c) {
26855
26850
  this._lastHitDistances[t] = c.distance;
26856
26851
  const h = e.rigScale ?? 1;
26857
- jf && (z.DrawWireSphere(c.point, 0.025 * h, 16711680), z.DrawLabel(G(0, 0.2, 0).add(c.point), c.object.name, 0.02, 0)), n || (n = this.createHitPointObject(), this._hitDiscs[t] = n), n.hit = c, n.visible = c.distance > h * 0.05;
26852
+ jf && (F.DrawWireSphere(c.point, 0.025 * h, 16711680), F.DrawLabel(G(0, 0.2, 0).add(c.point), c.object.name, 0.02, 0)), n || (n = this.createHitPointObject(), this._hitDiscs[t] = n), n.hit = c, n.visible = c.distance > h * 0.05;
26858
26853
  let d = 0.01 * (h + c.distance);
26859
26854
  const f = i.getButton("primary")?.pressed;
26860
26855
  f && (d *= 1.1), n.scale.set(d, d, d), n.layers.set(2);
@@ -27079,7 +27074,7 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
27079
27074
  for (const o of this.context.scene.children)
27080
27075
  n.add(o);
27081
27076
  this.context.scene.add(n), i = S.addComponent(n, Ni), this._createdComponentsInSession.push(i);
27082
- } else (al || D()) && console.warn("WebXR: No WebARSessionRoot found in scene and usePlacementReticle is disabled in WebXR component.");
27077
+ } else (al || L()) && console.warn("WebXR: No WebARSessionRoot found in scene and usePlacementReticle is disabled in WebXR component.");
27083
27078
  this._activeWebARSessionRoot = i, i && (i.customReticle = this.customARPlacementReticle, i.arScale = this.arScale, i.arTouchTransform = this.usePlacementAdjustment, i.autoPlace = this.autoPlace, i.autoCenter = this.autoCenter, i.useXRAnchor = this.useXRAnchor);
27084
27079
  }
27085
27080
  this.useDefaultControls && this.setDefaultMovementEnabled(!0), (this.showControllerModels || this.showHandModels) && this.setDefaultControllerRenderingEnabled(!0), this.useSpatialGrab && (this._spatialGrabRaycaster = S.findObjectOfType(Ca) ?? void 0, this._spatialGrabRaycaster || (this._spatialGrabRaycaster = this.gameObject.addComponent(Ca))), this.createLocalAvatar(e.xr), e.xr.isScreenBasedAR || (this._exitXRMenuButton = this.context.menu.appendChild({
@@ -27162,7 +27157,7 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
27162
27157
  */
27163
27158
  handleCreatingHTML() {
27164
27159
  if (this.createARButton || this.createVRButton || this.useQuicklookExport) {
27165
- if ((q.isiOS() && q.isSafari() || vR) && this.useQuicklookExport) {
27160
+ if ((X.isiOS() && X.isSafari() || vR) && this.useQuicklookExport) {
27166
27161
  const t = S.findObjectOfType(ws);
27167
27162
  if (!t || t && t.allowCreateQuicklookButton) {
27168
27163
  const i = this.getButtonsFactory().createQuicklookButton();
@@ -27178,7 +27173,7 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
27178
27173
  this.addButton(t, 50);
27179
27174
  }
27180
27175
  }
27181
- if (this.createSendToQuestButton && !q.isQuest() && K.isVRSupported().then((t) => {
27176
+ if (this.createSendToQuestButton && !X.isQuest() && K.isVRSupported().then((t) => {
27182
27177
  if (!t) {
27183
27178
  const i = this.getButtonsFactory().createSendToQuestButton();
27184
27179
  this.addButton(i, 50);
@@ -27186,8 +27181,8 @@ const al = w("debugwebxr"), vR = w("debugusdz"), rt = class Wr extends T {
27186
27181
  }), this.createQRCode) {
27187
27182
  const t = Qd(Es);
27188
27183
  if (t && t.createQRCodeButton === !1)
27189
- D() && console.warn("WebXR: QRCode button is disabled in the Needle Menu component");
27190
- else if (!q.isMobileDevice()) {
27184
+ L() && console.warn("WebXR: QRCode button is disabled in the Needle Menu component");
27185
+ else if (!X.isMobileDevice()) {
27191
27186
  const i = On.getOrCreate().createQRCode();
27192
27187
  this.addButton(i, 50);
27193
27188
  }
@@ -27592,7 +27587,7 @@ class PR {
27592
27587
  width;
27593
27588
  height;
27594
27589
  }
27595
- const en = new b(), ll = new te(), gh = new N(), Ba = class zv extends hn {
27590
+ const en = new b(), ll = new te(), gh = new $(), Ba = class zv extends hn {
27596
27591
  get parent() {
27597
27592
  return this._parentRectTransform;
27598
27593
  }
@@ -28508,8 +28503,8 @@ class vo extends Si {
28508
28503
  a ? m += this.padding.left : m += this.padding.top;
28509
28504
  let v = 0, y = 0;
28510
28505
  for (let E = 0; E < this.gameObject.children.length; E++) {
28511
- const B = this.gameObject.children[E], L = S.getComponent(B, zn);
28512
- L?.activeAndEnabled && (y += 1, a ? v += L.width : v += L.height);
28506
+ const z = this.gameObject.children[E], D = S.getComponent(z, zn);
28507
+ D?.activeAndEnabled && (y += 1, a ? v += D.width : v += D.height);
28513
28508
  }
28514
28509
  let x = 0;
28515
28510
  const I = this.spacing * (y - 1);
@@ -28521,20 +28516,20 @@ class vo extends Si {
28521
28516
  O += this.padding.left, O -= this.padding.right, _ !== 0 && (m = g - v, m *= _, m -= I * _, a ? (m -= this.padding.right * _, m += this.padding.left * (1 - _), m < this.padding.left && (m = this.padding.left)) : (m -= this.padding.bottom * _, m += this.padding.top * (1 - _), m < this.padding.top && (m = this.padding.top)));
28522
28517
  let k = 1;
28523
28518
  for (let E = 0; E < this.gameObject.children.length; E++) {
28524
- const B = this.gameObject.children[E], L = S.getComponent(B, zn);
28525
- if (L?.activeAndEnabled) {
28526
- L.pivot?.set(0.5, 0.5), L.anchorMin.set(0, 1), L.anchorMax.set(0, 1);
28527
- const W = i * 0.5 + O * 0.5;
28528
- L.anchoredPosition.x !== W && (L.anchoredPosition.x = W);
28529
- const X = o * -0.5;
28530
- L.anchoredPosition.y !== X && (L.anchoredPosition.y = X), f && h && L.sizeDelta[l] !== p && (L.sizeDelta[l] = p), d && c && L.sizeDelta[t] !== x && (L.sizeDelta[t] = x);
28531
- const A = a ? L.width : L.height, $ = A * 0.5;
28532
- if (m += $, d) {
28519
+ const z = this.gameObject.children[E], D = S.getComponent(z, zn);
28520
+ if (D?.activeAndEnabled) {
28521
+ D.pivot?.set(0.5, 0.5), D.anchorMin.set(0, 1), D.anchorMax.set(0, 1);
28522
+ const V = i * 0.5 + O * 0.5;
28523
+ D.anchoredPosition.x !== V && (D.anchoredPosition.x = V);
28524
+ const q = o * -0.5;
28525
+ D.anchoredPosition.y !== q && (D.anchoredPosition.y = q), f && h && D.sizeDelta[l] !== p && (D.sizeDelta[l] = p), d && c && D.sizeDelta[t] !== x && (D.sizeDelta[t] = x);
28526
+ const A = a ? D.width : D.height, U = A * 0.5;
28527
+ if (m += U, d) {
28533
28528
  const ne = x * k - x * 0.5;
28534
- ne > m && (m = ne - x * 0.5 + A + this.padding.left, m -= $);
28529
+ ne > m && (m = ne - x * 0.5 + A + this.padding.left, m -= U);
28535
28530
  }
28536
- let V = m;
28537
- t === "y" && (V = -V), L.anchoredPosition[t] !== V && (L.anchoredPosition[t] = V), m += $, m += this.spacing, k += 1;
28531
+ let W = m;
28532
+ t === "y" && (W = -W), D.anchoredPosition[t] !== W && (D.anchoredPosition[t] = W), m += U, m += this.spacing, k += 1;
28538
28533
  }
28539
28534
  }
28540
28535
  }
@@ -29069,7 +29064,7 @@ const ii = class Tl extends T {
29069
29064
  }
29070
29065
  /** @internal */
29071
29066
  onEnable() {
29072
- const e = q.supportsQuickLookAR(), t = q.isiOS() || q.isiPad();
29067
+ const e = X.supportsQuickLookAR(), t = X.isiOS() || X.isiPad();
29073
29068
  !this.button && (ni || e || t) && (this.allowCreateQuicklookButton && (this.button = this.createQuicklookButton()), this.lastCallback = this.quicklookCallback.bind(this), this.link = j_(this.context, e), this.link.addEventListener("message", this.lastCallback)), ni && Be("USDZ Exporter enabled: " + this.name), document.getElementById("open-in-ar")?.addEventListener("click", this.onClickedOpenInARElement), ic.registerExporter(this);
29074
29069
  }
29075
29070
  /** @internal */
@@ -29093,7 +29088,7 @@ const ii = class Tl extends T {
29093
29088
  */
29094
29089
  async exportAndOpen() {
29095
29090
  let e = this.exportFileName ?? this.objectToExport?.name ?? this.name;
29096
- if (e += "-" + OM(), bs() || (e !== "" && (e += "-"), e += "MadeWithNeedle"), this.link || (this.link = j_(this.context, q.supportsQuickLookAR())), this.customUsdzFile)
29091
+ if (e += "-" + OM(), bs() || (e !== "" && (e += "-"), e += "MadeWithNeedle"), this.link || (this.link = j_(this.context, X.supportsQuickLookAR())), this.customUsdzFile)
29097
29092
  return ni && console.log("Exporting custom usdz", this.customUsdzFile), this.openInQuickLook(this.customUsdzFile, e), null;
29098
29093
  if (!this.objectToExport)
29099
29094
  return console.warn("No object to export", this), null;
@@ -29133,19 +29128,19 @@ const ii = class Tl extends T {
29133
29128
  for (const k of O.sharedMeshes)
29134
29129
  if (k) {
29135
29130
  const E = We.assignMeshLOD(k, 0);
29136
- E instanceof Promise && n.push(new Promise((B, L) => {
29131
+ E instanceof Promise && n.push(new Promise((z, D) => {
29137
29132
  E.then(() => {
29138
- o++, le.report("export-usdz-textures", { message: "Loaded progressive mesh", currentStep: o, totalSteps: n.length }), B();
29139
- }).catch((W) => L(W));
29133
+ o++, le.report("export-usdz-textures", { message: "Loaded progressive mesh", currentStep: o, totalSteps: n.length }), z();
29134
+ }).catch((V) => D(V));
29140
29135
  }));
29141
29136
  }
29142
29137
  for (const k of O.sharedMaterials)
29143
29138
  if (k) {
29144
29139
  const E = We.assignTextureLOD(k, 0);
29145
- E instanceof Promise && n.push(new Promise((B, L) => {
29140
+ E instanceof Promise && n.push(new Promise((z, D) => {
29146
29141
  E.then(() => {
29147
- o++, le.report("export-usdz-textures", { message: "Loaded progressive texture", currentStep: o, totalSteps: n.length }), B();
29148
- }).catch((W) => L(W));
29142
+ o++, le.report("export-usdz-textures", { message: "Loaded progressive texture", currentStep: o, totalSteps: n.length }), z();
29143
+ }).catch((V) => D(V));
29149
29144
  }));
29150
29145
  }
29151
29146
  }
@@ -29155,7 +29150,7 @@ const ii = class Tl extends T {
29155
29150
  const a = new FM(), l = new lg(this.quickLookCompatible);
29156
29151
  let c;
29157
29152
  const h = [];
29158
- this.interactive && (h.push(new Bv()), h.push(new La()), globalThis.NEEDLE_USE_RAPIER && S.getComponentsInChildren(e, ft).length > 0 && (this.physics ? (c = new Fv(), h.push(c)) : D() && console.warn("USDZExporter: Physics export is disabled, but there are active Rigidbody components in the scene. They will not be exported.")), h.push(new gg()), h.push(new Qv()));
29153
+ this.interactive && (h.push(new Bv()), h.push(new La()), globalThis.NEEDLE_USE_RAPIER && S.getComponentsInChildren(e, ft).length > 0 && (this.physics ? (c = new Fv(), h.push(c)) : L() && console.warn("USDZExporter: Physics export is disabled, but there are active Rigidbody components in the scene. They will not be exported.")), h.push(new gg()), h.push(new Qv()));
29159
29154
  const d = [l, ...h, ...this.extensions], f = { self: this, exporter: a, extensions: d, object: e };
29160
29155
  le.report("export-usdz", "Invoking before-export"), this.dispatchEvent(new CustomEvent("before-export", { detail: f })), this.applyWebARSessionRoot(), this._previousTimeScale = this.context.time.timeScale, this.context.time.timeScale = 0, le.report("export-usdz", "auto export animations and audio sources");
29161
29156
  const p = new Array();
@@ -29166,11 +29161,11 @@ const ii = class Tl extends T {
29166
29161
  const E = S.getComponent(O, Hi);
29167
29162
  return E && !E.enabled && (k = !1), k && _.includes(O) && (k = !1), k && S.getComponentInParent(O, ou) && (k = !1), k && S.getComponentInParent(O, Ms) && (k = !1), ni && !k && console.log("USDZExporter: Discarding object", O), k;
29168
29163
  }, a.beforeWritingDocument = () => {
29169
- if (D() && l && c) {
29164
+ if (L() && l && c) {
29170
29165
  const O = l.animatedRoots;
29171
29166
  for (const k of O) {
29172
- const E = S.getComponentsInChildren(k, ft).filter((L) => L.enabled), B = S.getComponents(k, wi).filter((L) => L.enabled && !L.isTrigger);
29173
- (E.length > 0 || B.length > 0) && console.error("An animated object has physics components in its child hierarchy. This can lead to undefined behaviour due to a bug in Apple's QuickLook (FB15925487). Remove the physics components from child objects or verify that you get the expected results.", k);
29167
+ const E = S.getComponentsInChildren(k, ft).filter((D) => D.enabled), z = S.getComponents(k, wi).filter((D) => D.enabled && !D.isTrigger);
29168
+ (E.length > 0 || z.length > 0) && console.error("An animated object has physics components in its child hierarchy. This can lead to undefined behaviour due to a bug in Apple's QuickLook (FB15925487). Remove the physics components from child objects or verify that you get the expected results.", k);
29174
29169
  }
29175
29170
  }
29176
29171
  };
@@ -29242,10 +29237,10 @@ const ii = class Tl extends T {
29242
29237
  return this.customBranding && Object.assign(e, this.customBranding), bs() || (console.log("Custom Quicklook banner text requires pro license: https://needle.tools/pricing"), e.callToAction = "Close", e.checkoutTitle = "🌵 Made with Needle", e.checkoutSubtitle = "_"), (e.callToAction?.length || e.checkoutTitle?.length || e.checkoutSubtitle?.length) && (e.callToAction?.length || (e.callToAction = "\0"), e.checkoutTitle?.length || (e.checkoutTitle = "\0"), e.checkoutSubtitle?.length || (e.checkoutSubtitle = "\0")), this.dispatchEvent(new CustomEvent("quicklook-overlay", { detail: e })), e;
29243
29238
  }
29244
29239
  static invertForwardMatrix = new te().makeRotationY(Math.PI);
29245
- static invertForwardQuaternion = new N().setFromEuler(new Rt(0, Math.PI, 0));
29240
+ static invertForwardQuaternion = new $().setFromEuler(new Rt(0, Math.PI, 0));
29246
29241
  _rootSessionRootWasAppliedTo = null;
29247
29242
  _rootPositionBeforeExport = new b();
29248
- _rootRotationBeforeExport = new N();
29243
+ _rootRotationBeforeExport = new $();
29249
29244
  _rootScaleBeforeExport = new b();
29250
29245
  getARScaleAndTarget() {
29251
29246
  if (!this.objectToExport) return { scale: 1, _invertForward: !1, target: this.gameObject, sessionRoot: null };
@@ -29989,7 +29984,7 @@ class Na extends T {
29989
29984
  a.projectPoint(e, c), e.copy(c);
29990
29985
  }
29991
29986
  this.affectPosition && ut(this.gameObject, e);
29992
- const n = new Rt(this.rotationOffset.x, this.rotationOffset.y, this.rotationOffset.z), o = new N().setFromEuler(n);
29987
+ const n = new Rt(this.rotationOffset.x, this.rotationOffset.y, this.rotationOffset.z), o = new $().setFromEuler(n);
29993
29988
  this.affectRotation && an(this.gameObject, t.multiply(o));
29994
29989
  const r = new b();
29995
29990
  this.from.getWorldDirection(r).multiplyScalar(50), this.levelLookDirection && (r.y = 0), this.alignLookDirection && this.gameObject.lookAt(r);
@@ -30606,7 +30601,7 @@ const Ke = class Il {
30606
30601
  if (i && (n *= this.system.worldScale.x), this.enabled) {
30607
30602
  switch (this.shapeType) {
30608
30603
  case 5:
30609
- bh && z.DrawWireBox(this.position, this.scale, 14540253, 1), this._vector.x = Math.random() * this.scale.x - this.scale.x / 2, this._vector.y = Math.random() * this.scale.y - this.scale.y / 2, this._vector.z = Math.random() * this.scale.z - this.scale.z / 2, this._vector.add(t);
30604
+ bh && F.DrawWireBox(this.position, this.scale, 14540253, 1), this._vector.x = Math.random() * this.scale.x - this.scale.x / 2, this._vector.y = Math.random() * this.scale.y - this.scale.y / 2, this._vector.z = Math.random() * this.scale.z - this.scale.z / 2, this._vector.add(t);
30610
30605
  break;
30611
30606
  case 4:
30612
30607
  this.randomConePoint(this.position, this.angle, n, this.radiusThickness, this.arc, this.arcMode, this._vector);
@@ -30648,12 +30643,12 @@ const Ke = class Il {
30648
30643
  }
30649
30644
  break;
30650
30645
  default:
30651
- this._vector.set(0, 0, 0), D() && !globalThis.__particlesystem_shapetype_unsupported && (console.warn("ParticleSystem ShapeType is not supported:", Gp[this.shapeType]), globalThis.__particlesystem_shapetype_unsupported = !0);
30646
+ this._vector.set(0, 0, 0), L() && !globalThis.__particlesystem_shapetype_unsupported && (console.warn("ParticleSystem ShapeType is not supported:", Gp[this.shapeType]), globalThis.__particlesystem_shapetype_unsupported = !0);
30652
30647
  break;
30653
30648
  }
30654
30649
  this.randomizePosition(this._vector, this.randomPositionAmount);
30655
30650
  }
30656
- this.applyRotation(this._vector), i && (this._vector.applyQuaternion(this.system.worldQuaternion), this._vector.add(this.system.worldPos)), bh && z.DrawSphere(this._vector, 0.03, 16711680, 0.5, !0);
30651
+ this.applyRotation(this._vector), i && (this._vector.applyQuaternion(this.system.worldQuaternion), this._vector.add(this.system.worldPos)), bh && F.DrawSphere(this._vector, 0.03, 16711680, 0.5, !0);
30657
30652
  }
30658
30653
  _dir = new b();
30659
30654
  getDirection(e, t) {
@@ -30700,9 +30695,9 @@ const Ke = class Il {
30700
30695
  this._dir.set(0, 0, 1);
30701
30696
  break;
30702
30697
  }
30703
- return this._space === 1 && this._dir.applyQuaternion(this.system.worldQuaternion), this.applyRotation(this._dir), this._dir.normalize(), this.spherizeDirection(this._dir, this.sphericalDirectionAmount), this.randomizeDirection(this._dir, this.randomDirectionAmount), bh && (z.DrawSphere(t, 0.01, 8925952, 0.5, !0), z.DrawDirection(t, this._dir, 8925952, 0.5, !0)), this._dir;
30698
+ return this._space === 1 && this._dir.applyQuaternion(this.system.worldQuaternion), this.applyRotation(this._dir), this._dir.normalize(), this.spherizeDirection(this._dir, this.sphericalDirectionAmount), this.randomizeDirection(this._dir, this.randomDirectionAmount), bh && (F.DrawSphere(t, 0.01, 8925952, 0.5, !0), F.DrawDirection(t, this._dir, 8925952, 0.5, !0)), this._dir;
30704
30699
  }
30705
- static _randomQuat = new N();
30700
+ static _randomQuat = new $();
30706
30701
  static _tempVec = new b();
30707
30702
  randomizePosition(e, t) {
30708
30703
  if (t <= 0) return;
@@ -31061,7 +31056,7 @@ class Ve {
31061
31056
  if (!this.enabled) return;
31062
31057
  const l = r / a, c = this.speedModifier.evaluate(l) * this.speedModifierMultiplier, h = this.x.evaluate(l), d = this.y.evaluate(l), f = this.z.evaluate(l);
31063
31058
  if (this._temp.set(-h, d, f), this._system && this._system.main.simulationSpace === 1 && this._temp.applyQuaternion(this._system.worldQuaternion), this._hasOrbital && this._system?.worldPos) {
31064
- const g = this._temp2.set(i.x, i.y, i.z), _ = this.orbitalXMultiplier, m = this.orbitalYMultiplier, v = this.orbitalZMultiplier, y = c * Math.PI * 2 * 10, x = Math.cos(y * _), I = Math.sin(y * _), O = Math.cos(y * m), k = Math.sin(y * m), E = Math.cos(y * v), B = Math.sin(y * v), L = g.x * (O * E) + g.y * (O * B) + g.z * -k, W = g.x * (I * k * E - x * B) + g.y * (I * k * B + x * E) + g.z * (I * O), X = g.x * (x * k * E + I * B) + g.y * (x * k * B - I * E) + g.z * (x * O), A = this._temp3.set(g.x - L, g.y - W, g.z - X);
31059
+ const g = this._temp2.set(i.x, i.y, i.z), _ = this.orbitalXMultiplier, m = this.orbitalYMultiplier, v = this.orbitalZMultiplier, y = c * Math.PI * 2 * 10, x = Math.cos(y * _), I = Math.sin(y * _), O = Math.cos(y * m), k = Math.sin(y * m), E = Math.cos(y * v), z = Math.sin(y * v), D = g.x * (O * E) + g.y * (O * z) + g.z * -k, V = g.x * (I * k * E - x * z) + g.y * (I * k * z + x * E) + g.z * (I * O), q = g.x * (x * k * E + I * z) + g.y * (x * k * z - I * E) + g.z * (x * O), A = this._temp3.set(g.x - D, g.y - V, g.z - q);
31065
31060
  A.normalize(), A.multiplyScalar(0.2 / o * Math.max(this.orbitalXMultiplier, this.orbitalYMultiplier, this.orbitalZMultiplier)), n.x += A.x, n.y += A.y, n.z += A.z;
31066
31061
  }
31067
31062
  n.x += this._temp.x, n.y += this._temp.y, n.z += this._temp.z, n.x *= c, n.y *= c, n.z *= c;
@@ -31498,7 +31493,7 @@ class iw {
31498
31493
  emitterType;
31499
31494
  emitterProbability;
31500
31495
  //private matrix_ = new Matrix4();
31501
- q_ = new N();
31496
+ q_ = new $();
31502
31497
  v_ = new b();
31503
31498
  v2_ = new b();
31504
31499
  _emitterMatrix = new Hu();
@@ -31574,7 +31569,7 @@ class fn extends T {
31574
31569
  cameraVelocityScale;
31575
31570
  lengthScale;
31576
31571
  start() {
31577
- if (this.maxParticleSize !== 0.5 && this.minParticleSize !== 0 && D()) {
31572
+ if (this.maxParticleSize !== 0.5 && this.minParticleSize !== 0 && L()) {
31578
31573
  const e = `ParticleSystem "${this.name}" has non-default min/max particle size. This may not render correctly. Please set min size to 0 and the max size to 0.5 and use the "StartSize" setting instead`;
31579
31574
  console.warn(e);
31580
31575
  }
@@ -32067,11 +32062,11 @@ const Dt = class $h extends T {
32067
32062
  get localspace() {
32068
32063
  return this.main.simulationSpace === dc.Local;
32069
32064
  }
32070
- __worldQuaternion = new N();
32065
+ __worldQuaternion = new $();
32071
32066
  get worldQuaternion() {
32072
32067
  return this.__worldQuaternion;
32073
32068
  }
32074
- _worldQuaternionInverted = new N();
32069
+ _worldQuaternionInverted = new $();
32075
32070
  get worldQuaternionInverted() {
32076
32071
  return this._worldQuaternionInverted;
32077
32072
  }
@@ -32116,7 +32111,7 @@ const Dt = class $h extends T {
32116
32111
  if (!this._particleSystem)
32117
32112
  return !1;
32118
32113
  const t = this._particleSystem.behaviors, i = t.indexOf(e);
32119
- return i !== -1 && ((D() || Xs) && console.debug("Remove custom ParticleSystem Behaviour", i, e), t.splice(i, 1)), !0;
32114
+ return i !== -1 && ((L() || Xs) && console.debug("Remove custom ParticleSystem Behaviour", i, e), t.splice(i, 1)), !0;
32120
32115
  }
32121
32116
  /** Removes all behaviours from the particle system
32122
32117
  * **Note:** this will also remove the default behaviours like SizeBehaviour, ColorBehaviour etc.
@@ -32253,7 +32248,7 @@ const Dt = class $h extends T {
32253
32248
  addSubParticleSystems() {
32254
32249
  if (this._subEmitterSystems && this._particleSystem)
32255
32250
  for (const e of this._subEmitterSystems) {
32256
- e.particleSystem && (e.particleSystem.__internalAwake ? e.particleSystem.__internalAwake() : D() && console.warn("SubParticleSystem serialization issue(?)", e.particleSystem, e));
32251
+ e.particleSystem && (e.particleSystem.__internalAwake ? e.particleSystem.__internalAwake() : L() && console.warn("SubParticleSystem serialization issue(?)", e.particleSystem, e));
32257
32252
  const t = e.particleSystem?._particleSystem;
32258
32253
  if (t) {
32259
32254
  e.particleSystem._isUsedAsSubsystem = !0;
@@ -32331,7 +32326,7 @@ function nw(s, e) {
32331
32326
  if (!s.unsupported_scaling_mode) {
32332
32327
  s.unsupported_scaling_mode = !0;
32333
32328
  const t = "ParticleSystem scale mode " + qp[s.main.scalingMode] + " is not supported";
32334
- D() && ge(t), console.warn(t, s.name, s);
32329
+ L() && ge(t), console.warn(t, s.name, s);
32335
32330
  }
32336
32331
  e = $e(s.gameObject, e);
32337
32332
  break;
@@ -32407,7 +32402,7 @@ function ST(s) {
32407
32402
  const t = s.scene;
32408
32403
  e = An(t, Zp);
32409
32404
  } else
32410
- D() && console.warn("No post processing manager found");
32405
+ L() && console.warn("No post processing manager found");
32411
32406
  return e;
32412
32407
  }
32413
32408
  const lt = {
@@ -32443,7 +32438,7 @@ var PT = Object.defineProperty, OT = Object.getOwnPropertyDescriptor, ow = (s, e
32443
32438
  return n && PT(e, t, n), n;
32444
32439
  };
32445
32440
  const kT = w("debugpost");
32446
- class F {
32441
+ class B {
32447
32442
  isVolumeParameter = !0;
32448
32443
  constructor(e) {
32449
32444
  e !== void 0 && this.initialize(e);
@@ -32497,20 +32492,20 @@ class F {
32497
32492
  }
32498
32493
  ow([
32499
32494
  u()
32500
- ], F.prototype, "overrideState");
32495
+ ], B.prototype, "overrideState");
32501
32496
  ow([
32502
32497
  u()
32503
- ], F.prototype, "value");
32498
+ ], B.prototype, "value");
32504
32499
  class MT extends Xi {
32505
32500
  constructor() {
32506
- super([F]);
32501
+ super([B]);
32507
32502
  }
32508
32503
  onSerialize(e, t) {
32509
32504
  }
32510
32505
  onDeserialize(e, t) {
32511
32506
  const i = t.target, n = t.path;
32512
32507
  let o;
32513
- if (i && n && (o = i[n]), (typeof o != "object" || typeof o == "object" && o.isVolumeParameter !== !0) && (o = new F()), typeof e == "object" && "value" in e) {
32508
+ if (i && n && (o = i[n]), (typeof o != "object" || typeof o == "object" && o.isVolumeParameter !== !0) && (o = new B()), typeof e == "object" && "value" in e) {
32514
32509
  const r = e.value;
32515
32510
  o.initialize(r), o.overrideState = e.overrideState;
32516
32511
  } else
@@ -32551,7 +32546,7 @@ class ot extends T {
32551
32546
  if (super(), e)
32552
32547
  for (const t of Object.keys(e)) {
32553
32548
  const i = e[t], n = this[t];
32554
- n instanceof F ? n.initialize(i) : n !== void 0 && (this[t] = i);
32549
+ n instanceof B ? n.initialize(i) : n !== void 0 && (this[t] = i);
32555
32550
  }
32556
32551
  }
32557
32552
  active = !0;
@@ -32588,14 +32583,14 @@ class ot extends T {
32588
32583
  const e = Object.keys(this);
32589
32584
  for (const t of e) {
32590
32585
  const i = this[t];
32591
- i instanceof F && i.__init();
32586
+ i instanceof B && i.__init();
32592
32587
  }
32593
32588
  }
32594
32589
  // TODO this is currently not used for post processing effects that are part of Volume stacks,
32595
32590
  // since these handle that already.
32596
32591
  onEditorModification(e) {
32597
32592
  const t = e.propertyName;
32598
- if (this[t] instanceof F) {
32593
+ if (this[t] instanceof B) {
32599
32594
  const i = e.value;
32600
32595
  return this[t].value = i, !0;
32601
32596
  }
@@ -32648,7 +32643,7 @@ class Cu extends ot {
32648
32643
  get typeName() {
32649
32644
  return "Antialiasing";
32650
32645
  }
32651
- preset = new F(2);
32646
+ preset = new B(2);
32652
32647
  // 2 is HIGH: https://github.com/pmndrs/postprocessing/blob/main/src/enums/SMAAPreset.js#L14
32653
32648
  onCreateEffect() {
32654
32649
  const e = new R.POSTPROCESSING.MODULE.SMAAEffect({
@@ -32663,7 +32658,7 @@ class Cu extends ot {
32663
32658
  }
32664
32659
  }
32665
32660
  jT([
32666
- u(F)
32661
+ u(B)
32667
32662
  ], Cu.prototype, "preset");
32668
32663
  pn("Antialiasing", Cu);
32669
32664
  var FT = Object.defineProperty, Mg = (s, e, t, i) => {
@@ -32677,9 +32672,9 @@ const Pu = class rw extends ot {
32677
32672
  get typeName() {
32678
32673
  return "Bloom";
32679
32674
  }
32680
- threshold = new F(0.9);
32681
- intensity = new F(1);
32682
- scatter = new F(0.7);
32675
+ threshold = new B(0.9);
32676
+ intensity = new B(1);
32677
+ scatter = new B(0.7);
32683
32678
  /**
32684
32679
  * Set to true to use selective bloom when the effect gets created.
32685
32680
  * @default false
@@ -32721,13 +32716,13 @@ const Pu = class rw extends ot {
32721
32716
  }
32722
32717
  };
32723
32718
  Mg([
32724
- u(F)
32719
+ u(B)
32725
32720
  ], Pu.prototype, "threshold");
32726
32721
  Mg([
32727
- u(F)
32722
+ u(B)
32728
32723
  ], Pu.prototype, "intensity");
32729
32724
  Mg([
32730
- u(F)
32725
+ u(B)
32731
32726
  ], Pu.prototype, "scatter");
32732
32727
  let Rg = Pu;
32733
32728
  pn("Bloom", Rg);
@@ -32740,7 +32735,7 @@ class Ou extends ot {
32740
32735
  get typeName() {
32741
32736
  return "ChromaticAberration";
32742
32737
  }
32743
- intensity = new F(0);
32738
+ intensity = new B(0);
32744
32739
  onCreateEffect() {
32745
32740
  const e = new R.POSTPROCESSING.MODULE.ChromaticAberrationEffect();
32746
32741
  return e.offset = new J(0, 0), e.radialModulation = !0, e.modulationOffset = 0.15, this.intensity.valueProcessor = (t) => t * 0.02, this.intensity.onValueChanged = (t) => {
@@ -32749,7 +32744,7 @@ class Ou extends ot {
32749
32744
  }
32750
32745
  }
32751
32746
  UT([
32752
- u(F)
32747
+ u(B)
32753
32748
  ], Ou.prototype, "intensity");
32754
32749
  pn("ChromaticAberration", Ou);
32755
32750
  var Dl = /* @__PURE__ */ ((s) => (s[s.None = 0] = "None", s[s.Neutral = 1] = "Neutral", s[s.ACES = 2] = "ACES", s[s.AgX = 3] = "AgX", s[s.KhronosNeutral = 4] = "KhronosNeutral", s))(Dl || {});
@@ -32812,8 +32807,8 @@ class hr extends ot {
32812
32807
  get typeName() {
32813
32808
  return "ToneMapping";
32814
32809
  }
32815
- mode = new F(void 0);
32816
- exposure = new F(1);
32810
+ mode = new B(void 0);
32811
+ exposure = new B(1);
32817
32812
  /** Set the tonemapping mode to e.g. "agx" */
32818
32813
  setMode(e) {
32819
32814
  const t = Dl[e];
@@ -32854,10 +32849,10 @@ class hr extends ot {
32854
32849
  }
32855
32850
  }
32856
32851
  aw([
32857
- u(F)
32852
+ u(B)
32858
32853
  ], hr.prototype, "mode");
32859
32854
  aw([
32860
- u(F)
32855
+ u(B)
32861
32856
  ], hr.prototype, "exposure");
32862
32857
  pn("Tonemapping", hr);
32863
32858
  var WT = Object.defineProperty, ku = (s, e, t, i) => {
@@ -32873,10 +32868,10 @@ class Sr extends ot {
32873
32868
  * Whether values for contrast, hueshift or saturation are remapped to a different range.
32874
32869
  */
32875
32870
  remap = !0;
32876
- postExposure = new F(1);
32877
- contrast = new F(0);
32878
- hueShift = new F(0);
32879
- saturation = new F(0);
32871
+ postExposure = new B(1);
32872
+ contrast = new B(0);
32873
+ hueShift = new B(0);
32874
+ saturation = new B(0);
32880
32875
  init() {
32881
32876
  this.postExposure.valueProcessor = (e) => (this.remap && (e = Math.pow(2, e)), e), this.contrast.valueProcessor = (e) => {
32882
32877
  if (!this.remap) return e;
@@ -32897,16 +32892,16 @@ class Sr extends ot {
32897
32892
  }
32898
32893
  }
32899
32894
  ku([
32900
- u(F)
32895
+ u(B)
32901
32896
  ], Sr.prototype, "postExposure");
32902
32897
  ku([
32903
- u(F)
32898
+ u(B)
32904
32899
  ], Sr.prototype, "contrast");
32905
32900
  ku([
32906
- u(F)
32901
+ u(B)
32907
32902
  ], Sr.prototype, "hueShift");
32908
32903
  ku([
32909
- u(F)
32904
+ u(B)
32910
32905
  ], Sr.prototype, "saturation");
32911
32906
  pn("ColorAdjustments", Sr);
32912
32907
  var VT = Object.defineProperty, Cr = (s, e, t, i) => {
@@ -32920,12 +32915,12 @@ class Gn extends ot {
32920
32915
  return "DepthOfField";
32921
32916
  }
32922
32917
  mode;
32923
- focusDistance = new F(1);
32924
- focalLength = new F(0.2);
32925
- aperture = new F(20);
32926
- gaussianMaxRadius = new F();
32927
- resolutionScale = new F(1 / window.devicePixelRatio);
32928
- bokehScale = new F();
32918
+ focusDistance = new B(1);
32919
+ focalLength = new B(0.2);
32920
+ aperture = new B(20);
32921
+ gaussianMaxRadius = new B();
32922
+ resolutionScale = new B(1 / window.devicePixelRatio);
32923
+ bokehScale = new B();
32929
32924
  init() {
32930
32925
  this.focalLength.valueProcessor = (t) => {
32931
32926
  const i = t / 300;
@@ -32959,22 +32954,22 @@ Cr([
32959
32954
  u()
32960
32955
  ], Gn.prototype, "mode");
32961
32956
  Cr([
32962
- u(F)
32957
+ u(B)
32963
32958
  ], Gn.prototype, "focusDistance");
32964
32959
  Cr([
32965
- u(F)
32960
+ u(B)
32966
32961
  ], Gn.prototype, "focalLength");
32967
32962
  Cr([
32968
- u(F)
32963
+ u(B)
32969
32964
  ], Gn.prototype, "aperture");
32970
32965
  Cr([
32971
- u(F)
32966
+ u(B)
32972
32967
  ], Gn.prototype, "gaussianMaxRadius");
32973
32968
  Cr([
32974
- u(F)
32969
+ u(B)
32975
32970
  ], Gn.prototype, "resolutionScale");
32976
32971
  Cr([
32977
- u(F)
32972
+ u(B)
32978
32973
  ], Gn.prototype, "bokehScale");
32979
32974
  pn("DepthOfField", Gn);
32980
32975
  class xd extends ot {
@@ -32998,7 +32993,7 @@ class Mu extends ot {
32998
32993
  get typeName() {
32999
32994
  return "PixelationEffect";
33000
32995
  }
33001
- granularity = new F(10);
32996
+ granularity = new B(10);
33002
32997
  onCreateEffect() {
33003
32998
  const e = new R.POSTPROCESSING.MODULE.PixelationEffect();
33004
32999
  return this.granularity.onValueChanged = (t) => {
@@ -33007,7 +33002,7 @@ class Mu extends ot {
33007
33002
  }
33008
33003
  }
33009
33004
  qT([
33010
- u(F)
33005
+ u(B)
33011
33006
  ], Mu.prototype, "granularity");
33012
33007
  pn("PixelationEffect", Mu);
33013
33008
  var XT = Object.defineProperty, Lc = (s, e, t, i) => {
@@ -33019,11 +33014,11 @@ class Co extends ot {
33019
33014
  get typeName() {
33020
33015
  return "ScreenSpaceAmbientOcclusion";
33021
33016
  }
33022
- intensity = new F(2);
33023
- falloff = new F(1);
33024
- samples = new F(9);
33025
- color = new F(new se(0, 0, 0));
33026
- luminanceInfluence = new F(0.7);
33017
+ intensity = new B(2);
33018
+ falloff = new B(1);
33019
+ samples = new B(9);
33020
+ color = new B(new se(0, 0, 0));
33021
+ luminanceInfluence = new B(0.7);
33027
33022
  onBeforeRender() {
33028
33023
  if (this._ssao && this.context.mainCamera instanceof pe) {
33029
33024
  const e = this.context.mainCamera.far - this.context.mainCamera.near;
@@ -33063,19 +33058,19 @@ class Co extends ot {
33063
33058
  }
33064
33059
  }
33065
33060
  Lc([
33066
- u(F)
33061
+ u(B)
33067
33062
  ], Co.prototype, "intensity");
33068
33063
  Lc([
33069
- u(F)
33064
+ u(B)
33070
33065
  ], Co.prototype, "falloff");
33071
33066
  Lc([
33072
- u(F)
33067
+ u(B)
33073
33068
  ], Co.prototype, "samples");
33074
33069
  Lc([
33075
- u(F)
33070
+ u(B)
33076
33071
  ], Co.prototype, "color");
33077
33072
  Lc([
33078
- u(F)
33073
+ u(B)
33079
33074
  ], Co.prototype, "luminanceInfluence");
33080
33075
  pn("ScreenSpaceAmbientOcclusion", Co);
33081
33076
  var QT = Object.defineProperty, Pr = (s, e, t, i) => {
@@ -33093,10 +33088,10 @@ class qn extends ot {
33093
33088
  return this._ssao;
33094
33089
  }
33095
33090
  gammaCorrection = !0;
33096
- aoRadius = new F(1);
33097
- falloff = new F(1);
33098
- intensity = new F(1);
33099
- color = new F(new se(0, 0, 0));
33091
+ aoRadius = new B(1);
33092
+ falloff = new B(1);
33093
+ intensity = new B(1);
33094
+ color = new B(new se(0, 0, 0));
33100
33095
  screenspaceRadius = !1;
33101
33096
  quality = 2;
33102
33097
  _ssao;
@@ -33134,16 +33129,16 @@ Pr([
33134
33129
  u()
33135
33130
  ], qn.prototype, "gammaCorrection");
33136
33131
  Pr([
33137
- u(F)
33132
+ u(B)
33138
33133
  ], qn.prototype, "aoRadius");
33139
33134
  Pr([
33140
- u(F)
33135
+ u(B)
33141
33136
  ], qn.prototype, "falloff");
33142
33137
  Pr([
33143
- u(F)
33138
+ u(B)
33144
33139
  ], qn.prototype, "intensity");
33145
33140
  Pr([
33146
- u(F)
33141
+ u(B)
33147
33142
  ], qn.prototype, "color");
33148
33143
  Pr([
33149
33144
  It(),
@@ -33270,12 +33265,12 @@ class Ls extends ot {
33270
33265
  get typeName() {
33271
33266
  return "TiltShiftEffect";
33272
33267
  }
33273
- offset = new F(0);
33274
- rotation = new F(0);
33275
- focusArea = new F(0.4);
33276
- feather = new F(0.3);
33277
- kernelSize = new F(2);
33278
- resolutionScale = new F(1 / window.devicePixelRatio);
33268
+ offset = new B(0);
33269
+ rotation = new B(0);
33270
+ focusArea = new B(0.4);
33271
+ feather = new B(0.3);
33272
+ kernelSize = new B(2);
33273
+ resolutionScale = new B(1 / window.devicePixelRatio);
33279
33274
  init() {
33280
33275
  this.offset.defaultValue = 0, this.rotation.defaultValue = 0, this.focusArea.defaultValue = 0.4, this.feather.defaultValue = 0.3, this.kernelSize.defaultValue = R.POSTPROCESSING.MODULE.KernelSize.MEDIUM, this.resolutionScale.defaultValue = 1 / window.devicePixelRatio;
33281
33276
  }
@@ -33291,22 +33286,22 @@ class Ls extends ot {
33291
33286
  }
33292
33287
  }
33293
33288
  Ha([
33294
- u(F)
33289
+ u(B)
33295
33290
  ], Ls.prototype, "offset");
33296
33291
  Ha([
33297
- u(F)
33292
+ u(B)
33298
33293
  ], Ls.prototype, "rotation");
33299
33294
  Ha([
33300
- u(F)
33295
+ u(B)
33301
33296
  ], Ls.prototype, "focusArea");
33302
33297
  Ha([
33303
- u(F)
33298
+ u(B)
33304
33299
  ], Ls.prototype, "feather");
33305
33300
  Ha([
33306
- u(F)
33301
+ u(B)
33307
33302
  ], Ls.prototype, "kernelSize");
33308
33303
  Ha([
33309
- u(F)
33304
+ u(B)
33310
33305
  ], Ls.prototype, "resolutionScale");
33311
33306
  pn("TiltShiftEffect", Ls);
33312
33307
  var tE = Object.defineProperty, Tg = (s, e, t, i) => {
@@ -33318,9 +33313,9 @@ class Ga extends ot {
33318
33313
  get typeName() {
33319
33314
  return "Vignette";
33320
33315
  }
33321
- color = new F({ r: 0, g: 0, b: 0, a: 1 });
33322
- intensity = new F(0);
33323
- center = new F({ x: 0.5, y: 0.5 });
33316
+ color = new B({ r: 0, g: 0, b: 0, a: 1 });
33317
+ intensity = new B(0);
33318
+ center = new B({ x: 0.5, y: 0.5 });
33324
33319
  init() {
33325
33320
  this.color.defaultValue = { r: 0, g: 0, b: 0, a: 1 }, this.intensity.defaultValue = 0, this.center.defaultValue = { x: 0.5, y: 0.5 };
33326
33321
  }
@@ -33338,13 +33333,13 @@ class Ga extends ot {
33338
33333
  }
33339
33334
  }
33340
33335
  Tg([
33341
- u(F)
33336
+ u(B)
33342
33337
  ], Ga.prototype, "color");
33343
33338
  Tg([
33344
- u(F)
33339
+ u(B)
33345
33340
  ], Ga.prototype, "intensity");
33346
33341
  Tg([
33347
- u(F)
33342
+ u(B)
33348
33343
  ], Ga.prototype, "center");
33349
33344
  pn("Vignette", Ga);
33350
33345
  globalThis.NEEDLE_USE_POSTPROCESSING = globalThis.NEEDLE_USE_POSTPROCESSING !== void 0 ? globalThis.NEEDLE_USE_POSTPROCESSING : !0;
@@ -33658,7 +33653,7 @@ class Dc extends T {
33658
33653
  if (!this.context.isInXR && (this.context.mainCamera && this._isDirty && this.apply(), this.context.composer && this._postprocessing && this._postprocessing.composer === this.context.composer)) {
33659
33654
  if (this.context.renderer.getContext().isContextLost() && this.context.renderer.forceContextRestore(), this.context.composer.getRenderer() !== this.context.renderer && this.context.composer.setRenderer(this.context.renderer), this.context.composer.setMainScene(this.context.scene), this.multisampling === "auto")
33660
33655
  if (this._postprocessing && this._postprocessing.hasSmaaEffect)
33661
- this._postprocessing.multisampling !== 0 && (this._postprocessing.multisampling = 0, (Bo || D()) && console.log(`[PostProcessing] multisampling is disabled because it's set to 'auto' on your PostprocessingManager/Volume component that also has an SMAA effect.
33656
+ this._postprocessing.multisampling !== 0 && (this._postprocessing.multisampling = 0, (Bo || L()) && console.log(`[PostProcessing] multisampling is disabled because it's set to 'auto' on your PostprocessingManager/Volume component that also has an SMAA effect.
33662
33657
 
33663
33658
  If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`));
33664
33659
  else {
@@ -33698,7 +33693,7 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
33698
33693
  _rapidApplyCount = 0;
33699
33694
  _isDirty = !1;
33700
33695
  apply() {
33701
- if (Bo && console.log(`Apply PostProcessing "${this.name || "unnamed"}"`), D() && (this._lastApplyTime !== void 0 && Date.now() - this._lastApplyTime < 100 && (this._rapidApplyCount++, this._rapidApplyCount === 5 && console.warn("Detected rapid post processing modifications - this might be a bug", this)), this._lastApplyTime = Date.now()), this._isDirty = !1, this._activeEffects.length = 0, this.sharedProfile?.components) {
33696
+ if (Bo && console.log(`Apply PostProcessing "${this.name || "unnamed"}"`), L() && (this._lastApplyTime !== void 0 && Date.now() - this._lastApplyTime < 100 && (this._rapidApplyCount++, this._rapidApplyCount === 5 && console.warn("Detected rapid post processing modifications - this might be a bug", this)), this._lastApplyTime = Date.now()), this._isDirty = !1, this._activeEffects.length = 0, this.sharedProfile?.components) {
33702
33697
  const e = this.sharedProfile.components;
33703
33698
  for (const t of e)
33704
33699
  t.active && t.enabled && !this._activeEffects.includes(t) && this._activeEffects.push(t);
@@ -33706,7 +33701,7 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
33706
33701
  for (const e of this._effects)
33707
33702
  e.active && e.enabled && !this._activeEffects.includes(e) && this._activeEffects.push(e);
33708
33703
  this._activeEffects.length > 0 ? (this._postprocessing || (this._postprocessing = new cw(this.context)), this._postprocessing.apply(this._activeEffects)?.then(() => {
33709
- this.activeAndEnabled && (this._applyPostQueue(), this._postprocessing ? (this.multisampling === "auto" ? this._postprocessing.multisampling = q.isMobileDevice() ? 2 : 4 : this._postprocessing.multisampling = Math.max(0, Math.min(this.multisampling, this.context.renderer.capabilities.maxSamples)), Bo && console.debug(`[PostProcessing] Set multisampling to ${this._postprocessing.multisampling} (Is Mobile: ${q.isMobileDevice()})`)) : Bo && console.warn("[PostProcessing] No composer found"));
33704
+ this.activeAndEnabled && (this._applyPostQueue(), this._postprocessing ? (this.multisampling === "auto" ? this._postprocessing.multisampling = X.isMobileDevice() ? 2 : 4 : this._postprocessing.multisampling = Math.max(0, Math.min(this.multisampling, this.context.renderer.capabilities.maxSamples)), Bo && console.debug(`[PostProcessing] Set multisampling to ${this._postprocessing.multisampling} (Is Mobile: ${X.isMobileDevice()})`)) : Bo && console.warn("[PostProcessing] No composer found"));
33710
33705
  })) : this._postprocessing?.unapply(!1);
33711
33706
  }
33712
33707
  _applyPostQueue() {
@@ -33735,14 +33730,14 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
33735
33730
  Sh.set(i, r);
33736
33731
  const a = Object.keys(o);
33737
33732
  for (const l of a)
33738
- o[l] instanceof F && r.push(l);
33733
+ o[l] instanceof B && r.push(l);
33739
33734
  }
33740
33735
  if (Sh.has(i)) {
33741
33736
  const r = n.toLowerCase(), a = Sh.get(i);
33742
33737
  for (const l of a)
33743
33738
  if (l.toLowerCase() === r) {
33744
33739
  const c = o[l];
33745
- c instanceof F && (t.length === 4 && t[3] === "active" ? (c.overrideState = e.value, this.scheduleRecreate()) : c && c.value !== void 0 && (c.value = e.value));
33740
+ c instanceof B && (t.length === 4 && t[3] === "active" ? (c.overrideState = e.value, this.scheduleRecreate()) : c && c.value !== void 0 && (c.value = e.value));
33746
33741
  return;
33747
33742
  }
33748
33743
  }
@@ -34479,7 +34474,7 @@ class pt extends T {
34479
34474
  return this.clip;
34480
34475
  }
34481
34476
  set audioOutputMode(e) {
34482
- e !== this._audioOutputMode && (e === 1 && D() && console.warn("VideoAudioOutputMode.AudioSource is not yet implemented"), this._audioOutputMode = e, this.updateVideoElementSettings());
34477
+ e !== this._audioOutputMode && (e === 1 && L() && console.warn("VideoAudioOutputMode.AudioSource is not yet implemented"), this._audioOutputMode = e, this.updateVideoElementSettings());
34483
34478
  }
34484
34479
  get audioOutputMode() {
34485
34480
  return this._audioOutputMode;
@@ -35051,7 +35046,7 @@ class Or extends T {
35051
35046
  }
35052
35047
  async internalShare(e) {
35053
35048
  if (this.context.connection.isInRoom === !1) {
35054
- console.warn("Can not start screensharing: requires network connection"), D() && ge("Can not start screensharing: requires network connection. Add a SyncedRoom component or join a room first.");
35049
+ console.warn("Can not start screensharing: requires network connection"), L() && ge("Can not start screensharing: requires network connection. Add a SyncedRoom component or join a room first.");
35055
35050
  return;
35056
35051
  }
35057
35052
  if (e?.device && (this.device = e.device), !this.videoPlayer && this.requiresVideoPlayer && (this._videoPlayer || (this._videoPlayer = S.getComponent(this.gameObject, pt) ?? void 0), this.videoPlayer || this._ensureVideoPlayer(), !this.videoPlayer)) {
@@ -35199,7 +35194,7 @@ class Or extends T {
35199
35194
  } else
35200
35195
  console.error("Failed to get user media", r.message, r.code, r);
35201
35196
  }
35202
- !n && D() && (ge("No camera found for sharing. Please connect a camera (see console for more information)"), console.warn("No camera found for sharing. Please connect a camera", i, this.deviceName, "Using deviceFilter? " + this.deviceFilter != null, "Using options? " + t != null, "Using deviceName? " + this.deviceName != null, "Using options.deviceId? " + t?.deviceId != null, "Using options.deviceFilter? " + t?.deviceFilter != null));
35197
+ !n && L() && (ge("No camera found for sharing. Please connect a camera (see console for more information)"), console.warn("No camera found for sharing. Please connect a camera", i, this.deviceName, "Using deviceFilter? " + this.deviceFilter != null, "Using options? " + t != null, "Using deviceName? " + this.deviceName != null, "Using options.deviceId? " + t?.deviceId != null, "Using options.deviceFilter? " + t?.deviceFilter != null));
35203
35198
  }
35204
35199
  // private _cameraSelectionWindow : Window | null = null;
35205
35200
  // private openWindowToSelectCamera(){
@@ -35541,7 +35536,7 @@ const Fc = class gw extends T {
35541
35536
  rotateFactor = 0.1;
35542
35537
  positionAxes = xl.All;
35543
35538
  flipForward = !1;
35544
- static _invertForward = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
35539
+ static _invertForward = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI);
35545
35540
  _firstUpdate = !0;
35546
35541
  /**
35547
35542
  * Update the position and rotation of the GameObject to follow the target.
@@ -35978,7 +35973,7 @@ class OE {
35978
35973
  }
35979
35974
  }
35980
35975
  }
35981
- const kE = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
35976
+ const kE = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI);
35982
35977
  class ME {
35983
35978
  context;
35984
35979
  spectator;
@@ -36260,7 +36255,7 @@ const _w = class tm extends T {
36260
36255
  for (const n in this.remoteCams) {
36261
36256
  const o = this.remoteCams[n], r = this.context.time.realtimeSinceStartup - o.lastUpdate;
36262
36257
  if (!o || r > this._camTimeoutInSeconds) {
36263
- D() && console.log("Remote cam timeout", n), o?.obj && S.destroy(o.obj), delete this.remoteCams[n], o && delete this.userToCamMap[o.userId], tm.instances.push(o), this.context.players.removePlayerView(o.userId, Zo.Browser);
36258
+ L() && console.log("Remote cam timeout", n), o?.obj && S.destroy(o.obj), delete this.remoteCams[n], o && delete this.userToCamMap[o.userId], tm.instances.push(o), this.context.players.removePlayerView(o.userId, Zo.Browser);
36264
36259
  continue;
36265
36260
  }
36266
36261
  }
@@ -36375,7 +36370,7 @@ class Xn extends T {
36375
36370
  return this.tryJoinRoom(e + 1);
36376
36371
  } else
36377
36372
  this.joinRandomRoom && (this.roomName === null || this.roomName === void 0 || this.roomName.length <= 0) && (this.roomName = this.generateRoomName());
36378
- return this.requireRoomParameter && !t ? ((Kf || D()) && console.warn('[SyncedRoom] Missing required room parameter "' + this.urlParameterName + `" in url - will not connect.
36373
+ return this.requireRoomParameter && !t ? ((Kf || L()) && console.warn('[SyncedRoom] Missing required room parameter "' + this.urlParameterName + `" in url - will not connect.
36379
36374
  To allow joining a room without a query parameter you can set "requireRoomParameter" to false.`), !1) : (this.context.connection.isConnected || this.context.connection.connect(), this._lastJoinedRoom = this.roomName, this._roomPrefix && (this.roomName = this._roomPrefix + this.roomName), this.roomName.length <= 0 ? (console.warn(`[SyncedRoom] Room name is not set so we can not join a networked room.
36380
36375
  Please choose one of the following options to fix this:
36381
36376
  A) Set a room name in the SyncedRoom component
@@ -36387,7 +36382,7 @@ C) Set "joinRandomRoom" to true`), !1) : (Kf && console.log("Join " + this.roomN
36387
36382
  _userWantsToBeInARoom = !1;
36388
36383
  /** @internal */
36389
36384
  update() {
36390
- this.context.connection.isConnected && (this.context.time.time - this._lastPingTime > 3 && (this._lastPingTime = this.context.time.time, this.context.connection.sendPing()), this.context.connection.isInRoom && (this._lastRoomTime = this.context.time.time)), this._lastRoomTime > 0 && this.context.time.time - this._lastRoomTime > 0.3 && (this._lastRoomTime = -1, this.autoRejoin ? this._userWantsToBeInARoom && (console.log("Disconnected from networking backend - attempt reconnecting now"), this.tryJoinRoom()) : D() && console.warn("You are not connected to a room anymore (possibly because the tab was inactive for too long and the server kicked you?)"));
36385
+ this.context.connection.isConnected && (this.context.time.time - this._lastPingTime > 3 && (this._lastPingTime = this.context.time.time, this.context.connection.sendPing()), this.context.connection.isInRoom && (this._lastRoomTime = this.context.time.time)), this._lastRoomTime > 0 && this.context.time.time - this._lastRoomTime > 0.3 && (this._lastRoomTime = -1, this.autoRejoin ? this._userWantsToBeInARoom && (console.log("Disconnected from networking backend - attempt reconnecting now"), this.tryJoinRoom()) : L() && console.warn("You are not connected to a room anymore (possibly because the tab was inactive for too long and the server kicked you?)"));
36391
36386
  }
36392
36387
  /**
36393
36388
  * Get the URL to view the current room in view only mode.
@@ -36732,7 +36727,7 @@ class $E {
36732
36727
  if (!(r.times.length <= 0)) {
36733
36728
  if (r.name.endsWith(n))
36734
36729
  this.rootStartPosition = new b().fromArray(r.values, 0), this.rootEndPosition = new b().fromArray(r.values, r.values.length - 3), this.rootPositionOffset = this.rootEndPosition.clone().sub(this.rootStartPosition), Rn && console.log(this.rootPositionOffset);
36735
- else if (r.name.endsWith(o) && (this.rootStartQuaternion = new N().fromArray(r.values, 0), this.rootEndQuaternion = new N().fromArray(r.values, r.values.length - 4), this.rootQuaternionOffset = this.rootEndQuaternion.clone().multiply(this.rootStartQuaternion), Rn)) {
36730
+ else if (r.name.endsWith(o) && (this.rootStartQuaternion = new $().fromArray(r.values, 0), this.rootEndQuaternion = new $().fromArray(r.values, r.values.length - 4), this.rootQuaternionOffset = this.rootEndQuaternion.clone().multiply(this.rootStartQuaternion), Rn)) {
36736
36731
  const a = new Rt().setFromQuaternion(this.rootQuaternionOffset);
36737
36732
  console.log("ROT", a);
36738
36733
  }
@@ -36810,7 +36805,7 @@ class Bg extends Du {
36810
36805
  this.target && (this._animator = S.getComponent(this.target, At) ?? null, this._animator && l_(this._animator.gameObject, this, !0));
36811
36806
  for (const e of this.models) {
36812
36807
  const t = e.asset, i = t.position, n = t.rotation;
36813
- i && i.x !== void 0 && (i.isVector3 || (t.position = new b(i.x, i.y, i.z)), n.isQuaternion || (t.rotation = new N(n.x, n.y, n.z, n.w)));
36808
+ i && i.x !== void 0 && (i.isVector3 || (t.position = new b(i.x, i.y, i.z)), n.isQuaternion || (t.rotation = new $(n.x, n.y, n.z, n.w)));
36814
36809
  }
36815
36810
  this.ensureTrackOffsets();
36816
36811
  }
@@ -36820,19 +36815,19 @@ class Bg extends Du {
36820
36815
  const e = this.trackOffset.position;
36821
36816
  e && (e.isVector3 || (this.trackOffset.position = new b(e.x, e.y, e.z)));
36822
36817
  const t = this.trackOffset.rotation;
36823
- t && (t.isQuaternion || (this.trackOffset.rotation = new N(t.x, t.y, t.z, t.w)));
36818
+ t && (t.isQuaternion || (this.trackOffset.rotation = new $(t.x, t.y, t.z, t.w)));
36824
36819
  }
36825
36820
  }
36826
36821
  _useclipOffsets = !0;
36827
36822
  _totalOffsetPosition = new b();
36828
- _totalOffsetRotation = new N();
36823
+ _totalOffsetRotation = new $();
36829
36824
  _totalOffsetPosition2 = new b();
36830
- _totalOffsetRotation2 = new N();
36825
+ _totalOffsetRotation2 = new $();
36831
36826
  _summedPos = new b();
36832
36827
  _tempPos = new b();
36833
- _summedRot = new N();
36834
- _tempRot = new N();
36835
- _clipRotQuat = new N();
36828
+ _summedRot = new $();
36829
+ _tempRot = new $();
36830
+ _clipRotQuat = new $();
36836
36831
  evaluate(e) {
36837
36832
  if (this.track.muted || !this.mixer) return;
36838
36833
  this.bind(), this._totalOffsetPosition.set(0, 0, 0), this._totalOffsetRotation.set(0, 0, 0, 1), this._totalOffsetPosition2.set(0, 0, 0), this._totalOffsetRotation2.set(0, 0, 0, 1);
@@ -36872,33 +36867,33 @@ class Bg extends Du {
36872
36867
  x %= O;
36873
36868
  break;
36874
36869
  case rs.PingPong:
36875
- const B = Math.floor(x / O) % 2 !== 0;
36876
- x %= O, B && (x = O - x);
36870
+ const z = Math.floor(x / O) % 2 !== 0;
36871
+ x %= O, z && (x = O - x);
36877
36872
  break;
36878
36873
  }
36879
36874
  l.reversed === !0 ? c.time = c.getClip().duration - x : c.time = x, c.timeScale = 0;
36880
36875
  const k = Math.max(0, v);
36881
36876
  if (c.weight = k, r += k, c.clampWhenFinished = !1, c.isRunning() || c.play(), this._useclipOffsets) {
36882
- const E = t == 0 ? this._totalOffsetPosition : this._totalOffsetPosition2, B = t == 0 ? this._totalOffsetRotation : this._totalOffsetRotation2;
36877
+ const E = t == 0 ? this._totalOffsetPosition : this._totalOffsetPosition2, z = t == 0 ? this._totalOffsetRotation : this._totalOffsetRotation2;
36883
36878
  t < 1 && (i = 1 - v), t += 1;
36884
- const L = this._summedPos.set(0, 0, 0), W = this._tempPos.set(0, 0, 0), X = this._summedRot.identity(), A = this._tempRot.identity(), $ = h.rotation;
36885
- $ && (this._clipRotQuat.identity(), this._clipRotQuat.slerp($, v));
36886
- const V = this._actionOffsets[a];
36887
- if (V.hasOffsets)
36879
+ const D = this._summedPos.set(0, 0, 0), V = this._tempPos.set(0, 0, 0), q = this._summedRot.identity(), A = this._tempRot.identity(), U = h.rotation;
36880
+ U && (this._clipRotQuat.identity(), this._clipRotQuat.slerp(U, v));
36881
+ const W = this._actionOffsets[a];
36882
+ if (W.hasOffsets)
36888
36883
  for (let ne = 0; ne < I; ne++)
36889
- V.rootPositionOffset ? W.copy(V.rootPositionOffset) : W.set(0, 0, 0), W.applyQuaternion(X), this._clipRotQuat && W.applyQuaternion(this._clipRotQuat), V.rootQuaternionOffset && (A.copy(V.rootQuaternionOffset), X.multiply(A)), L.add(W);
36890
- this._clipRotQuat && B.multiply(this._clipRotQuat), B.multiply(X), h.position && L.add(h.position), E.add(L);
36884
+ W.rootPositionOffset ? V.copy(W.rootPositionOffset) : V.set(0, 0, 0), V.applyQuaternion(q), this._clipRotQuat && V.applyQuaternion(this._clipRotQuat), W.rootQuaternionOffset && (A.copy(W.rootQuaternionOffset), q.multiply(A)), D.add(V);
36885
+ this._clipRotQuat && z.multiply(this._clipRotQuat), z.multiply(q), h.position && D.add(h.position), E.add(D);
36891
36886
  }
36892
36887
  }
36893
36888
  }
36894
- if (this._useclipOffsets && (this._totalOffsetPosition.lerp(this._totalOffsetPosition2, i), this._totalOffsetRotation.slerp(this._totalOffsetRotation2, i)), this.__mixerError === void 0 && (Rn || D()) && this._animator?.runtimeAnimatorController?.mixer && this.mixer !== this._animator?.runtimeAnimatorController?.mixer && (this.__mixerError = !0, console.error("AnimationTrack mixer is not shared with the animator controller - this might result in the timeline to not animate properly. Please report a bug to the Needle Engine team!", this)), this._animator?.runtimeAnimatorController) {
36889
+ if (this._useclipOffsets && (this._totalOffsetPosition.lerp(this._totalOffsetPosition2, i), this._totalOffsetRotation.slerp(this._totalOffsetRotation2, i)), this.__mixerError === void 0 && (Rn || L()) && this._animator?.runtimeAnimatorController?.mixer && this.mixer !== this._animator?.runtimeAnimatorController?.mixer && (this.__mixerError = !0, console.error("AnimationTrack mixer is not shared with the animator controller - this might result in the timeline to not animate properly. Please report a bug to the Needle Engine team!", this)), this._animator?.runtimeAnimatorController) {
36895
36890
  const a = Math.max(0, 1 - r);
36896
36891
  this._animator?.runtimeAnimatorController?.update(a);
36897
36892
  } else
36898
36893
  this.mixer.update(e);
36899
36894
  }
36900
36895
  createRotationInterpolant(e, t, i) {
36901
- const n = i.createInterpolant.bind(i), o = new N();
36896
+ const n = i.createInterpolant.bind(i), o = new $();
36902
36897
  this.ensureTrackOffsets();
36903
36898
  const r = this.trackOffset?.rotation;
36904
36899
  i.createInterpolant = () => {
@@ -37194,7 +37189,7 @@ const ts = w("debugtimeline"), zg = class im extends T {
37194
37189
  _speed = 1;
37195
37190
  /** @internal */
37196
37191
  awake() {
37197
- ts && console.log(this, this.playableAsset?.tracks), this.rebuildGraph(), !this.isValid() && (ts || D()) && (ts ? console.warn("PlayableDirector is not valid", "Asset?", this.playableAsset, "Tracks:", this.playableAsset?.tracks, "IsArray?", Array.isArray(this.playableAsset?.tracks), this) : this.playableAsset?.tracks?.length ? console.warn("PlayableDirector is not valid") : console.warn("PlayableDirector has no tracks"));
37192
+ ts && console.log(this, this.playableAsset?.tracks), this.rebuildGraph(), !this.isValid() && (ts || L()) && (ts ? console.warn("PlayableDirector is not valid", "Asset?", this.playableAsset, "Tracks:", this.playableAsset?.tracks, "IsArray?", Array.isArray(this.playableAsset?.tracks), this) : this.playableAsset?.tracks?.length ? console.warn("PlayableDirector is not valid") : console.warn("PlayableDirector has no tracks"));
37198
37193
  }
37199
37194
  /** @internal */
37200
37195
  onEnable() {
@@ -37824,7 +37819,7 @@ class ko extends T {
37824
37819
  onPointerClick(e) {
37825
37820
  if (this.interactable && !(e.button !== 0 && e.event.pointerType === km.Mouse) && (Fo && (console.warn("Button Click", this.onClick), Be("CLICKED button " + this.name + " at " + this.context.time.frameCount)), this.onClick && this.onClick.listenerCount > 0 && (this.onClick.invoke(), e.use(), Fo))) {
37826
37821
  const t = this.gameObject.worldPosition;
37827
- t.add(this.gameObject.worldUp.multiplyScalar(1 + Math.random() * 0.5)), z.DrawLabel(t, "CLICK:" + Date.now(), 0.1, 1 + Math.random() * 0.5);
37822
+ t.add(this.gameObject.worldUp.multiplyScalar(1 + Math.random() * 0.5)), F.DrawLabel(t, "CLICK:" + Date.now(), 0.1, 1 + Math.random() * 0.5);
37828
37823
  }
37829
37824
  }
37830
37825
  colors;
@@ -37957,7 +37952,7 @@ const $s = w("debuginputfield"), Nc = class Q extends T {
37957
37952
  $s && console.log(this.name, this);
37958
37953
  }
37959
37954
  onEnable() {
37960
- Q.htmlField || (Q.htmlField = document.createElement("input"), Q.htmlField.style.width = "0px", Q.htmlField.style.height = "0px", Q.htmlField.style.padding = "0px", Q.htmlField.style.border = "none", Q.htmlField.style.overflow = "hidden", Q.htmlField.style.caretColor = "transparent", Q.htmlField.style.outline = "none", Q.htmlField.classList.add("ar"), Q.htmlField.onfocus = () => Q.htmlFieldFocused = !0, Q.htmlField.onblur = () => Q.htmlFieldFocused = !1, document.body.append(Q.htmlField)), this.inputEventFn || (this.inputEventFn = this.onInput.bind(this)), Q.htmlField.addEventListener("keyup", this.inputEventFn), this.placeholder && this.textComponent?.text.length && S.setActive(this.placeholder.gameObject, !1), q.isiOS() && (this._iosEventFn = this.processInputOniOS.bind(this), window.addEventListener("click", this._iosEventFn));
37955
+ Q.htmlField || (Q.htmlField = document.createElement("input"), Q.htmlField.style.width = "0px", Q.htmlField.style.height = "0px", Q.htmlField.style.padding = "0px", Q.htmlField.style.border = "none", Q.htmlField.style.overflow = "hidden", Q.htmlField.style.caretColor = "transparent", Q.htmlField.style.outline = "none", Q.htmlField.classList.add("ar"), Q.htmlField.onfocus = () => Q.htmlFieldFocused = !0, Q.htmlField.onblur = () => Q.htmlFieldFocused = !1, document.body.append(Q.htmlField)), this.inputEventFn || (this.inputEventFn = this.onInput.bind(this)), Q.htmlField.addEventListener("keyup", this.inputEventFn), this.placeholder && this.textComponent?.text.length && S.setActive(this.placeholder.gameObject, !1), X.isiOS() && (this._iosEventFn = this.processInputOniOS.bind(this), window.addEventListener("click", this._iosEventFn));
37961
37956
  }
37962
37957
  onDisable() {
37963
37958
  Q.htmlField?.removeEventListener("keyup", this.inputEventFn), this.onDeselected(), this._iosEventFn && window.removeEventListener("click", this._iosEventFn);
@@ -38022,7 +38017,7 @@ const $s = w("debuginputfield"), Nc = class Q extends T {
38022
38017
  }
38023
38018
  }
38024
38019
  selectInputField() {
38025
- Q.htmlField && ($s && console.log("Focus Inputfield", Q.htmlFieldFocused), Q.htmlField.setSelectionRange(Q.htmlField.value.length, Q.htmlField.value.length), q.isiOS() ? Q.htmlField.focus({ preventScroll: !0 }) : setTimeout(() => Q.htmlField?.focus(), 1));
38020
+ Q.htmlField && ($s && console.log("Focus Inputfield", Q.htmlFieldFocused), Q.htmlField.setSelectionRange(Q.htmlField.value.length, Q.htmlField.value.length), X.isiOS() ? Q.htmlField.focus({ preventScroll: !0 }) : setTimeout(() => Q.htmlField?.focus(), 1));
38026
38021
  }
38027
38022
  processInputOniOS() {
38028
38023
  const e = this.context.physics.raycast();
@@ -38332,7 +38327,7 @@ const $c = class kw extends T {
38332
38327
  invertForward = !1;
38333
38328
  keepUpDirection = !0;
38334
38329
  copyTargetRotation = !1;
38335
- static flipYQuat = new N().setFromAxisAngle(new b(0, 1, 0), Math.PI);
38330
+ static flipYQuat = new $().setFromAxisAngle(new b(0, 1, 0), Math.PI);
38336
38331
  /** @internal */
38337
38332
  onBeforeRender() {
38338
38333
  let e = this.target;
@@ -38396,15 +38391,15 @@ class Wc extends T {
38396
38391
  }
38397
38392
  this._validateUrl();
38398
38393
  let e = this.url;
38399
- switch (!e.startsWith("mailto:") && e.includes("@") && (e = "mailto:" + e), D() && Be("Open URL: " + e), this.mode) {
38394
+ switch (!e.startsWith("mailto:") && e.includes("@") && (e = "mailto:" + e), L() && Be("Open URL: " + e), this.mode) {
38400
38395
  case 0:
38401
- q.isSafari(), globalThis.open(e, "_blank");
38396
+ X.isSafari(), globalThis.open(e, "_blank");
38402
38397
  break;
38403
38398
  case 1:
38404
- q.isSafari() && q.isiOS() ? globalThis.open(e, "_top") : globalThis.open(e, "_self");
38399
+ X.isSafari() && X.isiOS() ? globalThis.open(e, "_top") : globalThis.open(e, "_self");
38405
38400
  break;
38406
38401
  case 2:
38407
- q.isSafari() ? globalThis.open(e, "_top") : globalThis.open(e, "_new");
38402
+ X.isSafari() ? globalThis.open(e, "_top") : globalThis.open(e, "_new");
38408
38403
  break;
38409
38404
  }
38410
38405
  }
@@ -38425,7 +38420,7 @@ class Wc extends T {
38425
38420
  this.clickable && !e.used && this.url?.length && this.open();
38426
38421
  }
38427
38422
  _validateUrl() {
38428
- this.url && this.url.startsWith("www.") && (D() && console.warn("URL is not valid, adding https:// to the start of the URL", this.url), this.url = "https://" + this.url);
38423
+ this.url && this.url.startsWith("www.") && (L() && console.warn("URL is not valid, adding https:// to the start of the URL", this.url), this.url = "https://" + this.url);
38429
38424
  }
38430
38425
  }
38431
38426
  Wg([
@@ -38454,7 +38449,7 @@ class Mo extends T {
38454
38449
  useGripSpace = !1;
38455
38450
  resetTransformAfterXRSession = !0;
38456
38451
  _startPosition = new b();
38457
- _startRotation = new N();
38452
+ _startRotation = new $();
38458
38453
  _startScale = new b();
38459
38454
  /** @internal */
38460
38455
  onEnterXR(e) {
@@ -38511,7 +38506,7 @@ NeedleXRSession.onSessionRequestStart(evt => {
38511
38506
  evt.init.optionalFeatures = evt.init.optionalFeatures || [];
38512
38507
  evt.init.optionalFeatures.push('camera-access');
38513
38508
  });
38514
- `), D() && Wd("No camera feed available - please request the 'camera-access' feature before starting WebXR or add the ARCameraBackground component to your scene"), !1;
38509
+ `), L() && Wd("No camera feed available - please request the 'camera-access' feature before starting WebXR or add the ARCameraBackground component to your scene"), !1;
38515
38510
  const n = t.getViewerPose(s.xr.getReferenceSpace());
38516
38511
  if (n)
38517
38512
  for (const o of n.views)
@@ -38559,9 +38554,9 @@ function Tw(s) {
38559
38554
  const a = i.renderer, l = a.xr.enabled && a.xr.isPresenting;
38560
38555
  if (l && i.currentFrameEvent != xe.EarlyUpdate)
38561
38556
  return console.warn("Screenshot: defer to access XR frame"), new Promise((E) => {
38562
- ks((B) => {
38563
- const L = Tw(s);
38564
- E(L);
38557
+ ks((z) => {
38558
+ const D = Tw(s);
38559
+ E(D);
38565
38560
  }, xe.EarlyUpdate, { once: !0 });
38566
38561
  });
38567
38562
  const c = a.domElement, h = c.width, d = c.height;
@@ -38576,20 +38571,20 @@ function Tw(s) {
38576
38571
  const k = s.render_events !== !1, E = new Array();
38577
38572
  k && (gc(i.scene, Hi, E), E.forEach((A) => {
38578
38573
  if (A?.onBeforeRender(), A.isInstancingActive && A.instances)
38579
- for (let $ = 0; $ < A.instances?.length; $++) {
38580
- const V = A.instances[$];
38581
- hs(V.object, !0);
38574
+ for (let U = 0; U < A.instances?.length; U++) {
38575
+ const W = A.instances[U];
38576
+ hs(W.object, !0);
38582
38577
  }
38583
38578
  })), e && (i.scene.background = null, a.setClearColor(0, 0)), s.background && (i.scene.background = null, a.setClearColor(s.background), s.background instanceof oe && a.setClearAlpha(s.background.a)), e && a.setClearAlpha(0), a.setSize(n, o, !1), "cam" in r && (r = r.threeCamera), r instanceof pe && (r.aspect = n / o, r.updateProjectionMatrix());
38584
- const B = "type" in s && s.type === "texture";
38585
- let L = null;
38586
- B && (L = new Dn(n, o, {
38579
+ const z = "type" in s && s.type === "texture";
38580
+ let D = null;
38581
+ z && (D = new Dn(n, o, {
38587
38582
  wrapS: Qg,
38588
38583
  wrapT: Qg,
38589
38584
  format: 1023
38590
- }), a.setRenderTarget(L));
38591
- let W = c;
38592
- if (l ? (L && console.error('Taking XR screenshots with { type: "texture" } is currently not supported.'), W = Od.compositeWithCameraImage({
38585
+ }), a.setRenderTarget(D));
38586
+ let V = c;
38587
+ if (l ? (D && console.error('Taking XR screenshots with { type: "texture" } is currently not supported.'), V = Od.compositeWithCameraImage({
38593
38588
  width: f,
38594
38589
  height: p,
38595
38590
  scene: i.scene,
@@ -38609,21 +38604,21 @@ function Tw(s) {
38609
38604
  break;
38610
38605
  }
38611
38606
  if (e && s.trim === !0) {
38612
- const A = oA(W);
38613
- A && (W = A);
38607
+ const A = oA(V);
38608
+ A && (V = A);
38614
38609
  }
38615
38610
  if ("type" in s) {
38616
38611
  if (s.type === "texture")
38617
- return L ? (s.target && (s.target.image = L?.texture.image, s.target.needsUpdate = !0), L.texture.offset.set(0, -1), L.texture.needsUpdate = !0, L.texture) : (console.error("No target texture found"), null);
38612
+ return D ? (s.target && (s.target.image = D?.texture.image, s.target.needsUpdate = !0), D.texture.offset.set(0, -1), D.texture.needsUpdate = !0, D.texture) : (console.error("No target texture found"), null);
38618
38613
  if (s.type === "blob")
38619
- return new Promise(($, V) => {
38620
- W.toBlob((ne) => {
38621
- $(ne);
38614
+ return new Promise((U, W) => {
38615
+ V.toBlob((ne) => {
38616
+ U(ne);
38622
38617
  }, t);
38623
38618
  });
38624
38619
  if (s.type === "share")
38625
- return new Promise(($, V) => {
38626
- W.toBlob((ne) => {
38620
+ return new Promise((U, W) => {
38621
+ V.toBlob((ne) => {
38627
38622
  if (ne && "share" in navigator) {
38628
38623
  let re = "file_type" in s && s.file_type || t;
38629
38624
  t || (re = "image/png");
@@ -38636,7 +38631,7 @@ function Tw(s) {
38636
38631
  }).catch((Je) => {
38637
38632
  console.warn("User cancelled share", Je.message);
38638
38633
  }).finally(() => {
38639
- $({ blob: ne, shared: !0 });
38634
+ U({ blob: ne, shared: !0 });
38640
38635
  });
38641
38636
  }
38642
38637
  return {
@@ -38646,17 +38641,17 @@ function Tw(s) {
38646
38641
  }, t);
38647
38642
  });
38648
38643
  }
38649
- const X = W.toDataURL(t);
38644
+ const q = V.toDataURL(t);
38650
38645
  if ("download_filename" in s && s.download_filename) {
38651
38646
  let A = s.download_filename;
38652
- if (q.isMobileDevice() && typeof window < "u") {
38653
- const $ = A + "_screenshots", V = A.split("."), ne = V.pop()?.toLowerCase();
38647
+ if (X.isMobileDevice() && typeof window < "u") {
38648
+ const U = A + "_screenshots", W = A.split("."), ne = W.pop()?.toLowerCase();
38654
38649
  let re = 0;
38655
- localStorage.getItem($) && (re = parseInt(sessionStorage.getItem($) || "0")), re > 0 && (A = `${V.join()}-${re}.${ne}`), re += 1, sessionStorage.setItem($, re.toString());
38650
+ localStorage.getItem(U) && (re = parseInt(sessionStorage.getItem(U) || "0")), re > 0 && (A = `${W.join()}-${re}.${ne}`), re += 1, sessionStorage.setItem(U, re.toString());
38656
38651
  }
38657
- rA(X, A);
38652
+ rA(q, A);
38658
38653
  }
38659
- return X;
38654
+ return q;
38660
38655
  } finally {
38661
38656
  a.setRenderTarget(v), i.scene.background = I, a.setSize(h, d, !1), a.setClearColor(y, x), O != null && r instanceof pe && (r.aspect = O, r.updateProjectionMatrix()), a.xr.enabled = m, a.xr.isPresenting = l, l || i.updateSize(!0);
38662
38657
  }
@@ -38882,7 +38877,7 @@ class pc {
38882
38877
  t && (t *= Math.max(1, i)), t === void 0 || t >= 1 ? (e.position.copy(this._position), e.quaternion.copy(this._rotation)) : (t = Math.max(0, Math.min(1, t)), e.position.lerp(this._position, t), e.quaternion.slerp(this._rotation, t));
38883
38878
  }
38884
38879
  static _positionBuffer = new $i(() => new b(), 20);
38885
- static _rotationBuffer = new $i(() => new N(), 20);
38880
+ static _rotationBuffer = new $i(() => new $(), 20);
38886
38881
  _position;
38887
38882
  _rotation;
38888
38883
  ensureTransformData() {
@@ -38943,11 +38938,11 @@ class dA {
38943
38938
  const n = i;
38944
38939
  return n.isImageTrackingExtension && n.component.activeAndEnabled && n.component.trackedImages?.length > 0;
38945
38940
  }).indexOf(this);
38946
- this.shouldExport = t === 0, this.shouldExport && this.component.trackedImages?.length > 1 && (kd || D()) && (ge("USDZ: Only one tracked image is supported."), console.warn("USDZ: Only one tracked image is supported. Will choose the first one in the trackedImages list"));
38941
+ this.shouldExport = t === 0, this.shouldExport && this.component.trackedImages?.length > 1 && (kd || L()) && (ge("USDZ: Only one tracked image is supported."), console.warn("USDZ: Only one tracked image is supported. Will choose the first one in the trackedImages list"));
38947
38942
  }
38948
38943
  onAfterHierarchy(e, t) {
38949
38944
  if (!this.shouldExport) return;
38950
- const i = q.getiOSVersion(), r = (i ? parseInt(i.split(".")[0]) : 18) >= 18 ? 1 : 100;
38945
+ const i = X.getiOSVersion(), r = (i ? parseInt(i.split(".")[0]) : 18) >= 18 ? 1 : 100;
38951
38946
  t.beginBlock('def Preliminary_ReferenceImage "AnchoringReferenceImage"'), t.appendLine("uniform asset image = @image_tracking/" + this.filename + "@"), t.appendLine("uniform double physicalWidth = " + (this.imageModel.widthInMeters * r).toFixed(8)), t.closeBlock();
38952
38947
  }
38953
38948
  async onAfterSerialize(e) {
@@ -39027,7 +39022,7 @@ class $u extends T {
39027
39022
  t.frames = 0;
39028
39023
  }
39029
39024
  onLeaveXR(e) {
39030
- if (!this.supported && q.isAndroidDevice() && ge(this.webXRIncubationsWarning), this.trackedImages) {
39025
+ if (!this.supported && X.isAndroidDevice() && ge(this.webXRIncubationsWarning), this.trackedImages) {
39031
39026
  for (const t of this.trackedImages)
39032
39027
  if (t.object?.asset) {
39033
39028
  const i = t.object.asset;
@@ -39189,7 +39184,7 @@ class Eo extends T {
39189
39184
  for (const d of this._allPlanes.values())
39190
39185
  !d.mesh || !d.mesh.visible || (this.bounds.makeEmpty(), d.mesh.traverse((f) => {
39191
39186
  f instanceof H && this.bounds.expandByObject(f);
39192
- }), this.bounds.getCenter(this.center), this.labelOffset.copy(h).sub(this.center).normalize().multiplyScalar(0.1), z.DrawLabel(
39187
+ }), this.bounds.getCenter(this.center), this.labelOffset.copy(h).sub(this.center).normalize().multiplyScalar(0.1), F.DrawLabel(
39193
39188
  this.center.add(this.labelOffset),
39194
39189
  (d.xrData.semanticLabel || "plane").toUpperCase() + `
39195
39190
  ` + d.xrData.lastChangedTime.toFixed(2),
@@ -39743,7 +39738,7 @@ Use import { NeedleEngineModelLoader } from "@needle-tools/engine" namespace to
39743
39738
  }
39744
39739
  }
39745
39740
  function uL(s, e) {
39746
- return Lw(e?.context || U.Current, s, s, e?.seed || null, e?.onprogress);
39741
+ return Lw(e?.context || N.Current, s, s, e?.seed || null, e?.onprogress);
39747
39742
  }
39748
39743
  async function SA(s, e, t, i) {
39749
39744
  typeof t != "string" && (console.warn("Parse gltf binary without path, this might lead to errors in resolving extensions. Please provide the source path of the gltf/glb file", t, typeof t), t = ""), Aw && console.log("Parse glTF", t);
@@ -39888,7 +39883,7 @@ class MA {
39888
39883
  this.onRequestedEndAR();
39889
39884
  };
39890
39885
  onBegin(e, t, i) {
39891
- if (this.currentSession = i, this.arContainer = t, q.isMozillaXR()) {
39886
+ if (this.currentSession = i, this.arContainer = t, X.isMozillaXR()) {
39892
39887
  const n = e.domElement.children;
39893
39888
  for (let o = 0; o < n?.length; o++) {
39894
39889
  const r = n[o];
@@ -39906,7 +39901,7 @@ class MA {
39906
39901
  const i = t.el;
39907
39902
  t.previousParent?.appendChild(i);
39908
39903
  }
39909
- this._reparentedObjects.length = 0, q.isMozillaXR() && setTimeout(() => {
39904
+ this._reparentedObjects.length = 0, X.isMozillaXR() && setTimeout(() => {
39910
39905
  const t = e.renderer.domElement;
39911
39906
  t && e.domElement.shadowRoot?.prepend(t);
39912
39907
  const i = document.querySelectorAll("*");
@@ -39922,7 +39917,7 @@ class MA {
39922
39917
  const t = e.shadowRoot.querySelector(".content");
39923
39918
  this.contentElement = t;
39924
39919
  const i = e.shadowRoot.querySelector(".overlay-content");
39925
- return i && t.appendChild(i), fl && !q.isMobileDevice() && this.ensureQuitARButton(t), t;
39920
+ return i && t.appendChild(i), fl && !X.isMobileDevice() && this.ensureQuitARButton(t), t;
39926
39921
  }
39927
39922
  onRequestedEndAR() {
39928
39923
  this.currentSession && (this.currentSession.end(), this.currentSession = null);
@@ -40097,7 +40092,7 @@ class Md {
40097
40092
  Z_ && console.log("Loading UI has commercial license?", t);
40098
40093
  const i = document.createElement("div");
40099
40094
  i.style.paddingTop = ".6em", i.style.fontSize = ".8em", i.style.textTransform = "uppercase", i.innerText = `NEEDLE ENGINE NON COMMERCIAL VERSION
40100
- CLICK HERE TO GET A LICENSE`, i.style.cursor = "pointer", i.style.userSelect = "none", i.style.textAlign = "center", i.style.pointerEvents = "all", i.addEventListener("click", () => window.open("https://needle.tools/pricing", "_self")), i.style.opacity = "0", e.appendChild(i), !D() && xa && (Z_ && console.log("Waiting for runtime license check"), await xa, t = vs()), !t && (i.style.transition = "opacity .5s ease-in-out", i.style.opacity = "1");
40095
+ CLICK HERE TO GET A LICENSE`, i.style.cursor = "pointer", i.style.userSelect = "none", i.style.textAlign = "center", i.style.pointerEvents = "all", i.addEventListener("click", () => window.open("https://needle.tools/pricing", "_self")), i.style.opacity = "0", e.appendChild(i), !L() && xa && (Z_ && console.log("Waiting for runtime license check"), await xa, t = vs()), !t && (i.style.transition = "opacity .5s ease-in-out", i.style.opacity = "1");
40101
40096
  }
40102
40097
  }
40103
40098
  Xb(Ew);
@@ -40257,7 +40252,7 @@ class Uw extends HTMLElement {
40257
40252
  <div class="content">
40258
40253
  <slot class="overlay-content"></slot>
40259
40254
  </div>
40260
- `, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new U({ domElement: this }), this.addEventListener("error", this.onError);
40255
+ `, this.shadowRoot && this.shadowRoot.appendChild(e.content.cloneNode(!0)), this._context = new N({ domElement: this }), this.addEventListener("error", this.onError);
40261
40256
  }
40262
40257
  /**
40263
40258
  * @internal
@@ -40344,7 +40339,7 @@ changed from "`, t, '" to "', i, '"'), this.onLoad();
40344
40339
  _createContextPromise = null;
40345
40340
  async onLoad() {
40346
40341
  if (!this.isConnected) return;
40347
- if (this._context || (Pe && console.warn("Create new context"), this._context = new U({ domElement: this })), !this._context) {
40342
+ if (this._context || (Pe && console.warn("Create new context"), this._context = new N({ domElement: this })), !this._context) {
40348
40343
  console.error("Needle Engine: Context not initialized");
40349
40344
  return;
40350
40345
  }
@@ -40370,7 +40365,7 @@ changed from "`, t, '" to "', i, '"'), this.onLoad();
40370
40365
  const g = this.getAttribute("hide-loading-overlay");
40371
40366
  g != null && g !== "0" && (o = !1);
40372
40367
  }
40373
- o === !1 && !n && (D() || (o = !0), console.warn("Needle Engine: You need a commercial license to override the default loading view. Visit https://needle.tools/pricing"), D() && ge('You need a <a target="_blank" href="https://needle.tools/pricing">commercial license</a> to override the default loading view. This will not work in production.')), !this._loadingView && o && (this._loadingView = new Md(this)), o && (this._didFullyLoad !== !0 ? this._loadingView?.onLoadingBegin("begin load") : setTimeout(() => {
40368
+ o === !1 && !n && (L() || (o = !0), console.warn("Needle Engine: You need a commercial license to override the default loading view. Visit https://needle.tools/pricing"), L() && ge('You need a <a target="_blank" href="https://needle.tools/pricing">commercial license</a> to override the default loading view. This will not work in production.')), !this._loadingView && o && (this._loadingView = new Md(this)), o && (this._didFullyLoad !== !0 ? this._loadingView?.onLoadingBegin("begin load") : setTimeout(() => {
40374
40369
  this._loadingView && this._loadingProgress01 < 0.3 && this._loadId === t && this._loadingView.onLoadingBegin("begin load");
40375
40370
  }, 300)), Pe && console.warn(`--------------
40376
40371
  Needle Engine: Begin loading ` + t + `
@@ -40594,9 +40589,9 @@ function EA(s) {
40594
40589
  let f = t[d];
40595
40590
  (f === "_" || f === "-") && (f = " "), !(f === " " && l.length <= 0 || h.includes(f) || (l.length === 0 && (f = f.toUpperCase()), c && f === " ")) && (c && (f = f.toUpperCase()), c = !1, l += f, f === " " && (c = !0));
40596
40591
  }
40597
- return D() && t !== l && console.debug('Generated display name: "' + t + '" → "' + l + '"'), l.trim();
40592
+ return L() && t !== l && console.debug('Generated display name: "' + t + '" → "' + l + '"'), l.trim();
40598
40593
  }
40599
- return D() && console.debug("Loading: use default name", t), t;
40594
+ return L() && console.debug("Loading: use default name", t), t;
40600
40595
  }
40601
40596
  function AA(s) {
40602
40597
  B0((e) => {
@@ -40683,7 +40678,7 @@ class Kl {
40683
40678
  this.world?.removeCollider(o, !0);
40684
40679
  const r = o.parent();
40685
40680
  r && r.numColliders() <= 0 && (r[Yt] || this.world?.removeRigidBody(r));
40686
- } else n instanceof R.RAPIER_PHYSICS.MODULE.RigidBody && (n.numColliders() <= 0 ? this.world?.removeRigidBody(n) : D() && (n.did_log_removing || setTimeout(() => {
40681
+ } else n instanceof R.RAPIER_PHYSICS.MODULE.RigidBody && (n.numColliders() <= 0 ? this.world?.removeRigidBody(n) : L() && (n.did_log_removing || setTimeout(() => {
40687
40682
  n.numColliders() > 0 && (n.did_log_removing = !0, console.warn("RapierPhysics: removing rigidbody with colliders from the physics world is not possible right now, please remove the colliders first"));
40688
40683
  }, 1)));
40689
40684
  }
@@ -40784,7 +40779,7 @@ class Kl {
40784
40779
  n === void 0 && (n = 1 / 0), o === void 0 && (o = !0);
40785
40780
  const r = this.getPhysicsRay(this.rapierRay, e, t);
40786
40781
  if (!r) return null;
40787
- (this.debugRenderRaycasts || Oh) && z.DrawRay(r.origin, r.dir, 255, 1);
40782
+ (this.debugRenderRaycasts || Oh) && F.DrawRay(r.origin, r.dir, 255, 1);
40788
40783
  const a = this.world?.castRay(r, n, o, i?.queryFilterFlags, i?.filterGroups, void 0, void 0, (l) => {
40789
40784
  const c = l[Yt];
40790
40785
  return i?.filterPredicate ? i.filterPredicate(c) : i?.useIgnoreRaycastLayer !== !1 ? !c?.gameObject.layers.isEnabled(2) : !0;
@@ -40802,7 +40797,7 @@ class Kl {
40802
40797
  n === void 0 && (n = 1 / 0), o === void 0 && (o = !0);
40803
40798
  const r = this.getPhysicsRay(this.rapierRay, e, t);
40804
40799
  if (!r) return null;
40805
- (this.debugRenderRaycasts || Oh) && z.DrawRay(r.origin, r.dir, 255, 1);
40800
+ (this.debugRenderRaycasts || Oh) && F.DrawRay(r.origin, r.dir, 255, 1);
40806
40801
  const a = this.world?.castRayAndGetNormal(r, n, o, i?.queryFilterFlags, i?.filterGroups, void 0, void 0, (l) => {
40807
40802
  const c = l[Yt];
40808
40803
  return i?.filterPredicate ? i.filterPredicate(c) : i?.useIgnoreRaycastLayer !== !1 ? !c?.gameObject.layers.isEnabled(2) : !0;
@@ -40851,7 +40846,7 @@ class Kl {
40851
40846
  * @returns array of colliders that overlap with the sphere. Note: they currently only contain the collider and the gameobject
40852
40847
  */
40853
40848
  sphereOverlap(e, t) {
40854
- return this.rapierSphere ??= new R.RAPIER_PHYSICS.MODULE.Ball(t), this.rapierSphere.radius = t, (this.debugRenderRaycasts || Oh) && z.DrawWireSphere(e, t, 3359999, 1), this.shapeOverlap(e, this.rapierIdentityRotation, this.rapierSphere);
40849
+ return this.rapierSphere ??= new R.RAPIER_PHYSICS.MODULE.Ball(t), this.rapierSphere.radius = t, (this.debugRenderRaycasts || Oh) && F.DrawWireSphere(e, t, 3359999, 1), this.shapeOverlap(e, this.rapierIdentityRotation, this.rapierSphere);
40855
40850
  }
40856
40851
  /** box overlap detection using rapier against colliders
40857
40852
  * @param point center of the box in worldspace
@@ -40860,7 +40855,7 @@ class Kl {
40860
40855
  * @returns array of colliders that overlap with the box. Note: they currently only contain the collider and the gameobject
40861
40856
  */
40862
40857
  boxOverlap(e, t, i = null) {
40863
- return i === null && (i = this.rapierIdentityRotation), this.rapierBox ??= new R.RAPIER_PHYSICS.MODULE.Cuboid(1, 1, 1), this.rapierBox.halfExtents.x = t.x * 0.5, this.rapierBox.halfExtents.y = t.y * 0.5, this.rapierBox.halfExtents.z = t.z * 0.5, (this.debugRenderRaycasts || Oh) && z.DrawWireBox(e, t, 3359999, 1, !0, i), this.shapeOverlap(e, i, this.rapierBox);
40858
+ return i === null && (i = this.rapierIdentityRotation), this.rapierBox ??= new R.RAPIER_PHYSICS.MODULE.Cuboid(1, 1, 1), this.rapierBox.halfExtents.x = t.x * 0.5, this.rapierBox.halfExtents.y = t.y * 0.5, this.rapierBox.halfExtents.z = t.z * 0.5, (this.debugRenderRaycasts || Oh) && F.DrawWireBox(e, t, 3359999, 1, !0, i), this.shapeOverlap(e, i, this.rapierBox);
40864
40859
  }
40865
40860
  shapeOverlap(e, t, i) {
40866
40861
  return this.rapierColliderArray.length = 0, this._isInitialized ? this.world ? (this.world.intersectionsWithShape(
@@ -40887,7 +40882,7 @@ class Kl {
40887
40882
  return this._world;
40888
40883
  }
40889
40884
  _tempPosition = new b();
40890
- _tempQuaternion = new N();
40885
+ _tempQuaternion = new $();
40891
40886
  _tempScale = new b();
40892
40887
  _tempMatrix = new te();
40893
40888
  static _didLoadPhysicsEngine = !1;
@@ -40976,7 +40971,7 @@ class Kl {
40976
40971
  if (this._meshCache.has(d))
40977
40972
  Qe && console.warn("Use cached mesh collider"), r = this._meshCache.get(d);
40978
40973
  else {
40979
- (Qe || D()) && console.debug(`[Performance] Your MeshCollider "${e.name}" is scaled: consider applying the scale to the collider mesh instead (${c.x}, ${c.y}, ${c.z})`);
40974
+ (Qe || L()) && console.debug(`[Performance] Your MeshCollider "${e.name}" is scaled: consider applying the scale to the collider mesh instead (${c.x}, ${c.y}, ${c.z})`);
40980
40975
  const f = new Float32Array(r.length);
40981
40976
  for (let p = 0; p < r.length; p += 3)
40982
40977
  f[p] = r[p] * c.x, f[p + 1] = r[p + 1] * c.y, f[p + 2] = r[p + 2] * c.z;
@@ -41206,7 +41201,7 @@ Error:`, r), null;
41206
41201
  }
41207
41202
  const o = i.translation(), r = i.rotation();
41208
41203
  if (Number.isNaN(o.x) || Number.isNaN(r.x)) {
41209
- !n.__COLLIDER_NAN && D() && (console.warn("Collider has NaN values", n.name, n.gameObject, i), n.__COLLIDER_NAN = !0);
41204
+ !n.__COLLIDER_NAN && L() && (console.warn("Collider has NaN values", n.name, n.gameObject, i), n.__COLLIDER_NAN = !0);
41210
41205
  continue;
41211
41206
  }
41212
41207
  const a = t.center;
@@ -41246,7 +41241,7 @@ Error:`, r), null;
41246
41241
  }
41247
41242
  _tempCenterPos = new b();
41248
41243
  _tempCenterVec = new b();
41249
- _tempCenterQuaternion = new N();
41244
+ _tempCenterQuaternion = new $();
41250
41245
  tryApplyCenter(e, t) {
41251
41246
  const i = e.center;
41252
41247
  i && e.gameObject && (i.x !== 0 || i.y !== 0 || i.z !== 0) && (this._tempCenterPos.x = i.x, this._tempCenterPos.y = i.y, this._tempCenterPos.z = i.z, $e(e.gameObject, this._tempCenterVec), this._tempCenterPos.multiply(this._tempCenterVec), e.attachedRigidbody ? this._tempCenterPos.applyQuaternion(e.gameObject.quaternion) : (be(e.gameObject, this._tempCenterQuaternion), this._tempCenterPos.applyQuaternion(this._tempCenterQuaternion)), t.x += this._tempCenterPos.x, t.y += this._tempCenterPos.y, t.z += this._tempCenterPos.z);
@@ -41336,7 +41331,7 @@ class jA {
41336
41331
  const g = a.solverContactPoint(p), _ = a.contactImpulse(p);
41337
41332
  if (g) {
41338
41333
  const m = a.contactDist(p), v = a.solverContactFriction(p), y = a.solverContactTangentVelocity(p), x = new _k(g, m, f, _, v, y);
41339
- d.push(x), ep && z.DrawDirection(g, f, 16711680, 3, !0);
41334
+ d.push(x), ep && F.DrawDirection(g, f, 16711680, 3, !0);
41340
41335
  }
41341
41336
  }
41342
41337
  o = new bk(r, i, d);
@@ -41545,7 +41540,7 @@ function zA(s, e, t) {
41545
41540
  const i = new Set(t);
41546
41541
  return Array.from(i);
41547
41542
  }
41548
- const sb = "needle-button", tp = D();
41543
+ const sb = "needle-button", tp = L();
41549
41544
  class UA extends HTMLElement {
41550
41545
  static observedAttributes = ["ar", "vr", "quicklook"];
41551
41546
  constructor() {
@@ -41976,7 +41971,7 @@ const yL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41976
41971
  VisibilityAction: uu,
41977
41972
  Voip: _r,
41978
41973
  Volume: Dc,
41979
- VolumeParameter: F,
41974
+ VolumeParameter: B,
41980
41975
  VolumeProfile: kg,
41981
41976
  WebARCameraBackground: Nu,
41982
41977
  WebARSessionRoot: Ni,
@@ -42181,7 +42176,7 @@ export {
42181
42176
  v1 as ConnectionEvents,
42182
42177
  _k as ContactPoint,
42183
42178
  ou as ContactShadows,
42184
- U as Context,
42179
+ N as Context,
42185
42180
  NI as ContextArgs,
42186
42181
  ce as ContextEvent,
42187
42182
  he as ContextRegistry,
@@ -42193,7 +42188,7 @@ export {
42193
42188
  er as DeleteBox,
42194
42189
  Gn as DepthOfField,
42195
42190
  eg as DeviceFlag,
42196
- q as DeviceUtilities,
42191
+ X as DeviceUtilities,
42197
42192
  $A as DocumentExtension,
42198
42193
  Gr as DragControls,
42199
42194
  nv as DragMode,
@@ -42218,7 +42213,7 @@ export {
42218
42213
  xe as FrameEvent,
42219
42214
  Sm as GENERATOR,
42220
42215
  S as GameObject,
42221
- z as Gizmos,
42216
+ F as Gizmos,
42222
42217
  bv as GltfExport,
42223
42218
  _v as GltfExportBox,
42224
42219
  $a as Gradient,
@@ -42437,7 +42432,7 @@ export {
42437
42432
  uu as VisibilityAction,
42438
42433
  _r as Voip,
42439
42434
  Dc as Volume,
42440
- F as VolumeParameter,
42435
+ B as VolumeParameter,
42441
42436
  kg as VolumeProfile,
42442
42437
  FI as WaitForFrames,
42443
42438
  WP as WaitForPromise,
@@ -42556,7 +42551,7 @@ export {
42556
42551
  JA as isDebugMode,
42557
42552
  sI as isDesktop,
42558
42553
  _a as isDestroyed,
42559
- D as isDevEnvironment,
42554
+ L as isDevEnvironment,
42560
42555
  LI as isDisposed,
42561
42556
  mL as isExporting,
42562
42557
  gk as isGLTFModel,