@needle-tools/engine 4.8.2 → 4.8.3-next.64a46ce

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,5 +1,5 @@
1
1
  import { Vector2 as J, Vector3 as b, Vector4 as de, Quaternion as $, PlaneGeometry as Nn, WebGLRenderer as dr, PerspectiveCamera as pe, OrthographicCamera as Md, Scene as bi, Mesh as H, Texture as Te, Uniform$1 as Ui, Color as se, ShaderMaterial as jn, Box3 as yi, ShadowMaterial as ab, Euler as Tt, MeshStandardMaterial as ct, Box3Helper as qw, GridHelper as rm, Object3D as M, Material as _e, Matrix3 as lb, Matrix4 as te, Layers as lo, Ray as co, MathUtils as gs, AxesHelper as _i, MeshBasicMaterial as we, DoubleSide as vi, BufferGeometry as In, Group as no, CylinderGeometry as cb, SphereGeometry as Rd, BoxGeometry as la, SpriteMaterial as Xw, Sprite as Qw, Shape as Yw, ExtrudeGeometry as Kw, Fog as hb, DirectionalLight as Zf, PointLight as am, EdgesGeometry as Zw, LineSegments as db, LineBasicMaterial as ub, Line as Zl, BufferAttribute as ht, Raycaster as Td, Sphere as Ed, ArrayCamera as Jw, Plane as ir, SkinnedMesh as ys, InterleavedBufferAttribute as fb, Skeleton as ex, Bone as tx, Source as ix, WebGLCubeRenderTarget as nx, CubeCamera as sx, AnimationClip as so, FileLoader as lm, TextureLoader as Qr, PropertyBinding as ca, LinearSRGBColorSpace as Ss, ShaderChunk as Vt, UniformsLib as ox, DataTexture as cm, RGBAFormat as Ad, EquirectangularReflectionMapping as _s, SRGBColorSpace as Cs, Clock as rx, NeutralToneMapping as ha, AgXToneMapping as Id, ACESFilmicToneMapping as Ld, NoToneMapping as Vh, PCFSoftShadowMap$1 as ax, BasicNodeLibrary as lx, WebGLRenderTarget as Bn, DepthTexture as pb, NearestFilter as Hh, LoopRepeat as cx, LoopOnce as Jf, AnimationMixer as hm, CompressedTexture as hx, FrontSide as ho, Camera as dx, Frustum as Gg, AudioListener as ux, PositionalAudio as fx, AudioLoader as ep, EventDispatcher as dm, BackSide as Dd, MeshDepthMaterial as px, CustomBlending as mx, MaxEquation as gx, AmbientLight as yx, HemisphereLight as _x, AlwaysStencilFunc as bx, GreaterEqualStencilFunc as vx, NotEqualStencilFunc as wx, GreaterStencilFunc as xx, LessEqualStencilFunc as Sx, EqualStencilFunc as Cx, LessStencilFunc as Px, NeverStencilFunc as qg, InvertStencilOp as Ox, DecrementWrapStencilOp as kx, IncrementWrapStencilOp as Mx, DecrementStencilOp as Rx, IncrementStencilOp as Tx, ReplaceStencilOp as Ex, ZeroStencilOp as Ax, KeepStencilOp as Ix, RawShaderMaterial as mb, GLSL3 as Lx, AlwaysDepth as Dx, GreaterEqualDepth as jx, GreaterDepth as Bx, LessEqualDepth as Fx, LessDepth as zx, NotEqualDepth as Ux, EqualDepth as Nx, BatchedMesh as Xg, MeshPhysicalMaterial as tp, LinearFilter as Gh, UnsignedByteType as $x, RingGeometry as Wx, Line3 as Vx, AdditiveBlending as gb, BoxHelper as Hx, SpotLight as Gx, DirectionalLightHelper as qx, CameraHelper as Xx, LOD as Qx, Triangle as Yx, NormalBlending as Kx, ReinhardToneMapping as um, LinearToneMapping as fm, HalfFloatType as Nu, VideoTexture as Zx, CubeTexture as Jx, CompressedCubeTexture as eS, EquirectangularRefractionMapping as tS, VectorKeyframeTrack as iS, QuaternionKeyframeTrack as nS, Audio as sS, ShaderLib as qh, UniformsUtils as yb, MirroredRepeatWrapping as Qg, MeshNormalMaterial as oS, AudioContext as rS, PMREMGenerator$1 as aS } from "./three-DrqIzZTH.js";
2
- import { createLoaders as pm, getRaycastMesh as _b, LODsManager as Io, NEEDLE_progressive as We, addDracoAndKTX2Loaders as lS, configureLoader as cS, setKTX2TranscoderLocation as hS, setDracoDecoderLocation as dS } from "./gltf-progressive-Do1XJNMG.js";
2
+ import { createLoaders as pm, getRaycastMesh as _b, LODsManager as Io, NEEDLE_progressive as We, addDracoAndKTX2Loaders as lS, configureLoader as cS, setKTX2TranscoderLocation as hS, setDracoDecoderLocation as dS } from "./gltf-progressive-DVx_cW0s.js";
3
3
  import { GroundedSkybox as da, Font as uS, TextGeometry as fS, FontLoader as pS, GLTFLoader as Ps, TransformControlsGizmo as bb, EXRLoader as Xh, RGBELoader as ip, Stats as mS, nodeFrame as gS, OrbitControls as vb, PositionalAudioHelper as yS, HorizontalBlurShader as _S, VerticalBlurShader as bS, GLTFExporter as wb, strToU8 as xb, zipSync as vS, XRControllerModelFactory as wS, XRHandMeshModel as xS, Line2 as SS, LineGeometry as CS, LineMaterial as PS, KTX2Loader as OS, TransformControls as kS, InteractiveGroup as MS, HTMLMesh as RS, VertexNormalsHelper as TS, OBJLoader as mm, FBXLoader as Sb, mergeVertices as ES } from "./three-examples-BIuXQPSf.js";
4
4
  import { fetchProfile as AS, MotionController as IS, $70d766613f57b014$export$2e2bcd8739ae039 as Yg, ByteBuffer as LS, v5 as Kg, md5 as Zg, SIZE_PREFIX_LENGTH as Cb, Builder as gm, createNoise4D as DS, Matrix4 as $u, BatchedParticleRenderer as jS, ParticleSystem as BS, RenderMode as as, ConstantColor as FS, Vector4 as zS, ConstantValue as US, TrailParticle as Jg, WorkerBase as NS, MeshBVH as $S } from "./vendor-CGONwIc0.js";
5
5
  import { __webpack_exports__default as Ce, __webpack_exports__Text as Pb, __webpack_exports__Block as Ob, __webpack_exports__update as WS, SimpleStateBehavior as VS, __webpack_exports__Inline as Wu, __webpack_exports__FontLibrary as ey, ThreeMeshUI as ty } from "./three-mesh-ui-D6Mz5Yl7.js";
@@ -1582,14 +1582,14 @@ function Wb(s, ...e) {
1582
1582
  }
1583
1583
  }
1584
1584
  const GC = w("nodevlogs");
1585
- function je(s, e = Ni.Log) {
1585
+ function Be(s, e = Ni.Log) {
1586
1586
  kn(e, s);
1587
1587
  }
1588
1588
  function me(s) {
1589
- je(s, Ni.Warn);
1589
+ Be(s, Ni.Warn);
1590
1590
  }
1591
1591
  function Nd(s) {
1592
- je(s, Ni.Error);
1592
+ Be(s, Ni.Error);
1593
1593
  }
1594
1594
  let cp, Yu;
1595
1595
  function L() {
@@ -1785,11 +1785,11 @@ po('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"]
1785
1785
  po('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');
1786
1786
  po('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');
1787
1787
  po('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
1788
- po('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.8.2";');
1788
+ po('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.8.3";');
1789
1789
  po('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
1790
- po('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Aug 18 2025 09:21:15 GMT+0000 (Coordinated Universal Time)";');
1790
+ po('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Aug 18 2025 13:45:57 GMT+0000 (Coordinated Universal Time)";');
1791
1791
  po('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
1792
- const Ln = "4.8.2", wm = "undefined", Qb = "Mon Aug 18 2025 09:21:15 GMT+0000 (Coordinated Universal Time)";
1792
+ const Ln = "4.8.3", wm = "undefined", Qb = "Mon Aug 18 2025 13:45:57 GMT+0000 (Coordinated Universal Time)";
1793
1793
  Xb && console.log(`Engine version: ${Ln} (generator: ${wm})
1794
1794
  Project built at ${Qb}`);
1795
1795
  const vl = NEEDLE_PUBLIC_KEY, ro = "needle_isActiveInHierarchy", jr = "builtin_components", Oh = "needle_editor_guid";
@@ -1911,7 +1911,7 @@ function o1(s) {
1911
1911
  pa[e](s);
1912
1912
  }
1913
1913
  const tt = w("debuginput");
1914
- var Pm = /* @__PURE__ */ ((s) => (s.Mouse = "mouse", s.Touch = "touch", s.Controller = "controller", s.Hand = "hand", s))(Pm || {}), Le = /* @__PURE__ */ ((s) => (s.PointerDown = "pointerdown", s.PointerUp = "pointerup", s.PointerMove = "pointermove", s.KeyDown = "keydown", s.KeyUp = "keyup", s.KeyPressed = "keypress", s))(Le || {});
1914
+ var Pm = /* @__PURE__ */ ((s) => (s.Mouse = "mouse", s.Touch = "touch", s.Controller = "controller", s.Hand = "hand", s))(Pm || {}), De = /* @__PURE__ */ ((s) => (s.PointerDown = "pointerdown", s.PointerUp = "pointerup", s.PointerMove = "pointermove", s.KeyDown = "keydown", s.KeyUp = "keyup", s.KeyPressed = "keypress", s))(De || {});
1915
1915
  class Vs extends PointerEvent {
1916
1916
  /**
1917
1917
  * Spatial input data
@@ -2396,13 +2396,13 @@ class r1 {
2396
2396
  createInputEvent(e) {
2397
2397
  switch (e.type) {
2398
2398
  case "pointerdown":
2399
- tt && je("Create Pointer down"), this.onDownButton(e.deviceIndex, e.button), this.onDown(e);
2399
+ tt && Be("Create Pointer down"), this.onDownButton(e.deviceIndex, e.button), this.onDown(e);
2400
2400
  break;
2401
2401
  case "pointermove":
2402
- tt && je("Create Pointer move"), this.onMove(e);
2402
+ tt && Be("Create Pointer move"), this.onMove(e);
2403
2403
  break;
2404
2404
  case "pointerup":
2405
- tt && je("Create Pointer up"), this.onUp(e), this.onReleaseButton(e.deviceIndex, e.button);
2405
+ tt && Be("Create Pointer up"), this.onUp(e), this.onReleaseButton(e.deviceIndex, e.button);
2406
2406
  break;
2407
2407
  }
2408
2408
  }
@@ -2496,7 +2496,7 @@ class r1 {
2496
2496
  if (this.context.isInAR || this.canReceiveInput(e) === !1) return;
2497
2497
  e.target instanceof HTMLElement && e.target.setPointerCapture(e.pointerId);
2498
2498
  const t = this.getPointerId(e);
2499
- tt && je(`pointer down #${t}, identifier:${e.pointerId}`);
2499
+ tt && Be(`pointer down #${t}, identifier:${e.pointerId}`);
2500
2500
  const i = this.getAndUpdateSpatialObjectForScreenPosition(t, e.clientX, e.clientY), n = new Vs("pointerdown", e, { origin: this, mode: "screen", deviceIndex: 0, pointerId: t, button: e.button, clientX: e.clientX, clientY: e.clientY, pointerType: e.pointerType, buttonName: this.getButtonName(e), device: i, pressure: e.pressure });
2501
2501
  this.onDown(n);
2502
2502
  };
@@ -3178,16 +3178,16 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
3178
3178
  if (!this.emitPointerDownEvent || this.inputSource !== e.inputSource) return;
3179
3179
  this.onUpdateFrame(e.frame), this._hasSelectEvent = !0;
3180
3180
  const t = this._layout?.selectComponentId, i = this._layout?.components[t]?.gamepadIndices?.button;
3181
- i !== void 0 && (this._selectButtonIndex = i), !Xc && (Yn && F.DrawDirection(this.rayWorldPosition, G(0, 0.01, 1).applyQuaternion(this.rayWorldQuaternion), 16711680, 10), this.emitPointerEvent(Le.PointerDown, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3181
+ 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));
3182
3182
  };
3183
3183
  onSelectEnd = (e) => {
3184
- this.emitPointerUpEvent && (Xc || this.inputSource === e.inputSource && this.emitPointerEvent(Le.PointerUp, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3184
+ this.emitPointerUpEvent && (Xc || this.inputSource === e.inputSource && this.emitPointerEvent(De.PointerUp, this._selectButtonIndex || 0, "xr-standard-trigger", !0, e));
3185
3185
  };
3186
3186
  onSequeezeStart = (e) => {
3187
- 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(Le.PointerDown, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e)));
3187
+ 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)));
3188
3188
  };
3189
3189
  onSequeezeEnd = (e) => {
3190
- this.emitPointerUpEvent && this.inputSource === e.inputSource && this._squeezeButtonIndex !== void 0 && this.emitPointerEvent(Le.PointerUp, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e);
3190
+ this.emitPointerUpEvent && this.inputSource === e.inputSource && this._squeezeButtonIndex !== void 0 && this.emitPointerEvent(De.PointerUp, this._squeezeButtonIndex || 0, "xr-standard-squeeze", !0, e);
3191
3191
  };
3192
3192
  /** Index = button index */
3193
3193
  states = {};
@@ -3252,7 +3252,7 @@ Pinch: ${this.getGesture("pinch")?.value.toFixed(3)}`), n += `
3252
3252
  pointerInit;
3253
3253
  emitPointerEvent(e, t, i, n, o = null, r) {
3254
3254
  if (!this.emitEvents) {
3255
- Yn && e !== Le.PointerMove && console.warn("Pointer events are disabled for this controller", this.index, e, t);
3255
+ Yn && e !== De.PointerMove && console.warn("Pointer events are disabled for this controller", this.index, e, t);
3256
3256
  return;
3257
3257
  }
3258
3258
  if (this.xr.mode === "immersive-vr" || this.xr.isPassThrough) {
@@ -4752,7 +4752,7 @@ class K {
4752
4752
  a.onBeforeXR && a.onBeforeXR(e, t);
4753
4753
  for (const a of this._sessionRequestStartListeners)
4754
4754
  a({ mode: e, init: t });
4755
- He && je("Requesting " + e + " session (" + Date.now() + ")"), this._currentSessionRequest = navigator.xr?.requestSession(e, t), this._currentSessionRequestMode = e;
4755
+ He && Be("Requesting " + e + " session (" + Date.now() + ")"), this._currentSessionRequest = navigator.xr?.requestSession(e, t), this._currentSessionRequestMode = e;
4756
4756
  const o = await this._currentSessionRequest?.catch((a) => {
4757
4757
  console.error(a, "Code: " + a.code), a.code === 9 && me("Make sure your device has the required permissions (e.g. camera access)"), console.log("If the specified XR configuration is not supported (e.g. entering AR doesnt work) - make sure you access the website on a secure connection (HTTPS) and your device has the required permissions (e.g. camera access)"), location.protocol === "http:" && me("XR requires a secure connection (HTTPS)");
4758
4758
  });
@@ -10983,13 +10983,13 @@ Start a coroutine from a component by calling "this.startCoroutine(myCoroutine()
10983
10983
  get isVisibleToUser() {
10984
10984
  if (this.isInXR) return !0;
10985
10985
  if (!this._isVisible) return !1;
10986
- if (this.time.frame === this._lastStyleComputedFrame) return this._lastStyleComputedResult;
10987
- this._lastStyleComputedFrame = this.time.frame;
10986
+ if (!this._needsVisibleUpdate && this._lastStyleComputedResult !== void 0) return this._lastStyleComputedResult;
10987
+ this._needsVisibleUpdate = !1;
10988
10988
  const e = getComputedStyle(this.domElement);
10989
10989
  return this._lastStyleComputedResult = e.visibility !== "hidden" && e.display !== "none" && e.opacity !== "0", this._lastStyleComputedResult;
10990
10990
  }
10991
- _lastStyleComputedFrame = -1;
10992
- _lastStyleComputedResult = !0;
10991
+ _needsVisibleUpdate = !0;
10992
+ _lastStyleComputedResult = void 0;
10993
10993
  _createId = 0;
10994
10994
  async internalOnCreate(e) {
10995
10995
  const t = ++this._createId;
@@ -11141,7 +11141,7 @@ Possible solutions:
11141
11141
  try {
11142
11142
  this.internalStep(e, t), this._renderlooperrors = 0;
11143
11143
  } catch (i) {
11144
- this._renderlooperrors += 1, (L() || Xe) && (i instanceof Error || i instanceof TypeError) && je("Caught unhandled exception during render-loop - see console for details.", Ni.Error), console.error("Frame #" + this.time.frame + `
11144
+ this._renderlooperrors += 1, (L() || Xe) && (i instanceof Error || i instanceof TypeError) && Be("Caught unhandled exception during render-loop - see console for details.", Ni.Error), console.error("Frame #" + this.time.frame + `
11145
11145
  `, i), this._renderlooperrors >= 3 && (console.warn("Stopping render loop due to error"), this.renderer.setAnimationLoop(null)), this.domElement.dispatchEvent(new CustomEvent("error", { detail: i }));
11146
11146
  }
11147
11147
  else
@@ -11162,7 +11162,7 @@ Possible solutions:
11162
11162
  this.internalOnBeforeRender(e, t) !== !1 && (this.internalOnRender(), this.internalOnAfterRender());
11163
11163
  }
11164
11164
  internalOnBeforeRender(e, t) {
11165
- this.renderer.info.autoReset = !!t, this.renderer.info.autoReset === !1 && this.renderer.info.reset();
11165
+ this.renderer.info.autoReset = !!t, this.renderer.info.autoReset === !1 && this.renderer.info.reset(), this._needsVisibleUpdate = !0;
11166
11166
  const i = t !== null && this._xrFrame === null;
11167
11167
  if (this._xrFrame = t, i && this.domElement.dispatchEvent(new CustomEvent("xr-session-started", { detail: { context: this, session: this.xrSession, frame: t } })), this._currentFrameEvent = -1, this.isManagedExternally === !1 && this.isInXR === !1 && this.targetFrameRate !== void 0) {
11168
11168
  this._lastTimestamp === 0 && (this._lastTimestamp = e), this._accumulatedTime += (e - this._lastTimestamp) / 1e3, this._lastTimestamp = e;
@@ -11194,28 +11194,26 @@ Possible solutions:
11194
11194
  const o = this.scripts_earlyUpdate[n];
11195
11195
  o.activeAndEnabled && o.earlyUpdate !== void 0 && (N.Current = this, o.earlyUpdate());
11196
11196
  }
11197
- if (this.executeCoroutines(
11197
+ this.executeCoroutines(
11198
11198
  0
11199
11199
  /* EarlyUpdate */
11200
11200
  ), yn(
11201
11201
  this,
11202
11202
  0
11203
11203
  /* EarlyUpdate */
11204
- ), this.onHandlePaused()) return !1;
11205
- this._currentFrameEvent = 1;
11204
+ ), this._currentFrameEvent = 1;
11206
11205
  for (let n = 0; n < this.scripts_update.length; n++) {
11207
11206
  const o = this.scripts_update[n];
11208
11207
  o.activeAndEnabled && o.update !== void 0 && (N.Current = this, o.update());
11209
11208
  }
11210
- if (this.executeCoroutines(
11209
+ this.executeCoroutines(
11211
11210
  1
11212
11211
  /* Update */
11213
11212
  ), yn(
11214
11213
  this,
11215
11214
  1
11216
11215
  /* Update */
11217
- ), this.onHandlePaused()) return !1;
11218
- this._currentFrameEvent = 2;
11216
+ ), this._currentFrameEvent = 2;
11219
11217
  for (let n = 0; n < this.scripts_lateUpdate.length; n++) {
11220
11218
  const o = this.scripts_lateUpdate[n];
11221
11219
  o.activeAndEnabled && o.lateUpdate !== void 0 && (N.Current = this, o.lateUpdate());
@@ -11227,8 +11225,7 @@ Possible solutions:
11227
11225
  this,
11228
11226
  2
11229
11227
  /* LateUpdate */
11230
- ), this.onHandlePaused() || (this.physicsSteps === void 0 && (this.physicsSteps = 1), this.physics.engine && this.physicsSteps > 0 && this.internalUpdatePhysics(this.physicsSteps), this.onHandlePaused())) return !1;
11231
- if (this.isVisibleToUser || this.runInBackground) {
11228
+ ), this.physicsSteps === void 0 && (this.physicsSteps = 1), this.physics.engine && this.physicsSteps > 0 && this.internalUpdatePhysics(this.physicsSteps), this.isVisibleToUser || this.runInBackground) {
11232
11229
  this._currentFrameEvent = 3;
11233
11230
  for (let n = 0; n < this.scripts_onBeforeRender.length; n++) {
11234
11231
  const o = this.scripts_onBeforeRender[n];
@@ -11290,14 +11287,12 @@ Target Framerate: ` + this.targetFrameRate)), this._dispatchReadyAfterFrame && (
11290
11287
  renderNow(e) {
11291
11288
  if (!e && (e = this.mainCamera, !e))
11292
11289
  return !1;
11293
- if (this.handleRendererContextLost(), this.time.frame % 10 === 0) {
11294
- if (this._isRendering = !0, this.renderRequiredTextures(), this.renderer.toneMapping !== Vh && L0(), this.composer && !this.isInXR) {
11295
- e && "setMainCamera" in this.composer && this.composer.passes[0]?.mainCamera != e && this.composer.setMainCamera(e);
11296
- const t = this.renderer.getClearColor(this._tempClearColor), i = this.renderer.getClearAlpha();
11297
- this._tempClearColor2.copy(t), this.renderer.setClearColor(t.convertSRGBToLinear(), this.renderer.getClearAlpha()), this.composer.render(this.time.deltaTime), this.renderer.setClearColor(this._tempClearColor2, i);
11298
- } else e && (this.isInXR && q.isMacOS() && this.renderer.clearDepth(), this.renderer.render(this.scene, e));
11299
- return this._isRendering = !1, !0;
11300
- }
11290
+ if (this.handleRendererContextLost(), this._isRendering = !0, this.renderRequiredTextures(), this.renderer.toneMapping !== Vh && L0(), this.composer && !this.isInXR) {
11291
+ e && "setMainCamera" in this.composer && this.composer.passes[0]?.mainCamera != e && this.composer.setMainCamera(e);
11292
+ const t = this.renderer.getClearColor(this._tempClearColor), i = this.renderer.getClearAlpha();
11293
+ this._tempClearColor2.copy(t), this.renderer.setClearColor(t.convertSRGBToLinear(), this.renderer.getClearAlpha()), this.composer.render(this.time.deltaTime), this.renderer.setClearColor(this._tempClearColor2, i);
11294
+ } else e && (this.isInXR && q.isMacOS() && this.renderer.clearDepth(), this.renderer.render(this.scene, e));
11295
+ return this._isRendering = !1, !0;
11301
11296
  }
11302
11297
  _contextRestoreTries = 0;
11303
11298
  handleRendererContextLost() {
@@ -14261,7 +14256,7 @@ const Lt = function(s, e) {
14261
14256
  function UO(s, e, t, i, n) {
14262
14257
  if (!n && !i && !s.onValidate) return;
14263
14258
  if (t !== void 0) {
14264
- console.error("Invalid usage of validate decorator. Only fields can be validated.", s, e, t), je("Invalid usage of validate decorator. Only fields can be validated. Property: " + e, Ni.Error);
14259
+ console.error("Invalid usage of validate decorator. Only fields can be validated.", s, e, t), Be("Invalid usage of validate decorator. Only fields can be validated. Property: " + e, Ni.Error);
14265
14260
  return;
14266
14261
  }
14267
14262
  let o = "";
@@ -15487,10 +15482,10 @@ class ei extends T {
15487
15482
  this.context.scene.getComponent(Sa) || this.context.scene.addComponent(Gi);
15488
15483
  }
15489
15484
  onEnable() {
15490
- this.context.input.addEventListener(Le.PointerDown, this.onPointerEvent), this.context.input.addEventListener(Le.PointerUp, this.onPointerEvent), this.context.input.addEventListener(Le.PointerMove, this.onPointerEvent);
15485
+ this.context.input.addEventListener(De.PointerDown, this.onPointerEvent), this.context.input.addEventListener(De.PointerUp, this.onPointerEvent), this.context.input.addEventListener(De.PointerMove, this.onPointerEvent);
15491
15486
  }
15492
15487
  onDisable() {
15493
- this.context.input.removeEventListener(Le.PointerDown, this.onPointerEvent), this.context.input.removeEventListener(Le.PointerUp, this.onPointerEvent), this.context.input.removeEventListener(Le.PointerMove, this.onPointerEvent);
15488
+ this.context.input.removeEventListener(De.PointerDown, this.onPointerEvent), this.context.input.removeEventListener(De.PointerUp, this.onPointerEvent), this.context.input.removeEventListener(De.PointerMove, this.onPointerEvent);
15494
15489
  }
15495
15490
  /**
15496
15491
  * all pointers that have pressed something
@@ -15515,7 +15510,7 @@ class ei extends T {
15515
15510
  onPointerEvent = (e) => {
15516
15511
  if (e === void 0 || e.propagationStopped || e.defaultPrevented || e.used) return;
15517
15512
  const t = new Zd(this.context.input, e);
15518
- this._currentPointerEventName = e.type, t.inputSource = this.context.input, t.isClick = e.isClick, t.isDoubleClick = e.isDoubleClick, t.isDown = e.type == Le.PointerDown, t.isUp = e.type == Le.PointerUp, t.isPressed = this.context.input.getPointerPressed(e.pointerId);
15513
+ this._currentPointerEventName = e.type, t.inputSource = this.context.input, t.isClick = e.isClick, t.isDoubleClick = e.isDoubleClick, t.isDown = e.type == De.PointerDown, t.isUp = e.type == De.PointerUp, t.isPressed = this.context.input.getPointerPressed(e.pointerId);
15519
15514
  const i = new pr();
15520
15515
  e.hasRay ? i.ray = e.ray : i.screenPoint = this.context.input.getPointerPositionRC(e.pointerId), i.allowSlowRaycastFallback = e.isClick || e.isDoubleClick;
15521
15516
  const n = this.performRaycast(i);
@@ -15528,7 +15523,7 @@ class ei extends T {
15528
15523
  hits: n
15529
15524
  });
15530
15525
  }
15531
- Gs && t.isClick && je("EventSystem: " + t.pointerId + " - " + this.context.time.frame + " - Up:" + t.isUp + ", Down:" + t.isDown);
15526
+ Gs && t.isClick && Be("EventSystem: " + t.pointerId + " - " + this.context.time.frame + " - Up:" + t.isUp + ", Down:" + t.isDown);
15532
15527
  const o = {
15533
15528
  sender: this,
15534
15529
  args: t,
@@ -15747,7 +15742,7 @@ class ei extends T {
15747
15742
  }
15748
15743
  /** invoke the pointerMove event on all captured handlers */
15749
15744
  invokePointerCapture(e) {
15750
- if (e.event.type === Le.PointerMove) {
15745
+ if (e.event.type === De.PointerMove) {
15751
15746
  const t = e.pointerId, i = this._capturedPointer[t];
15752
15747
  if (i) {
15753
15748
  Gs && console.log("Captured", t, i);
@@ -16100,6 +16095,9 @@ class ge extends T {
16100
16095
  afterHandleInput(e) {
16101
16096
  e.detail.args.pointerId === 0 && (e.detail.args.isDown ? this._controls && this._eventSystem && (this._shouldDisable = this._eventSystem.hasActiveUI) : (!e.detail.args.isPressed || e.detail.args.isUp) && (this._shouldDisable = !1));
16102
16097
  }
16098
+ onPausedChanged(e) {
16099
+ this._controls && e && (this._controls.enabled = !1);
16100
+ }
16103
16101
  /** @internal */
16104
16102
  onBeforeRender() {
16105
16103
  if (!this._controls) return;
@@ -16718,7 +16716,7 @@ const qs = w("debugcam"), u_ = w("debugscreenpointtoray"), Dt = class Cl extends
16718
16716
  if (typeof t._transparent == "boolean")
16719
16717
  return t._transparent;
16720
16718
  const i = t.environmentBlendMode;
16721
- qs && je("Environment blend mode: " + i + " on " + navigator.userAgent);
16719
+ qs && Be("Environment blend mode: " + i + " on " + navigator.userAgent);
16722
16720
  let n = i === "additive" || i === "alpha-blend";
16723
16721
  return e.isInAR && i === "opaque" && (navigator.userAgent?.includes("OculusBrowser") || navigator.userAgent?.includes("Mozilla") && navigator.userAgent?.includes("Mobile WebXRViewer/v2")) && (n = !0), t._transparent = n, n;
16724
16722
  }
@@ -17168,29 +17166,29 @@ fn([
17168
17166
  ], Ki.prototype, "rollOffMode", 2);
17169
17167
  let hn = Ki;
17170
17168
  const uk = w("debugavatar");
17171
- class De extends T {
17169
+ class je extends T {
17172
17170
  static getAvatar(e) {
17173
- return e >= 0 && e < De.instances.length ? De.instances[e] : null;
17171
+ return e >= 0 && e < je.instances.length ? je.instances[e] : null;
17174
17172
  }
17175
17173
  static instances = [];
17176
17174
  static onAvatarMarkerCreated(e) {
17177
- return De._onNewAvatarMarkerAdded.push(e), e;
17175
+ return je._onNewAvatarMarkerAdded.push(e), e;
17178
17176
  }
17179
17177
  static onAvatarMarkerDestroyed(e) {
17180
- return De._onAvatarMarkerDestroyed.push(e), e;
17178
+ return je._onAvatarMarkerDestroyed.push(e), e;
17181
17179
  }
17182
17180
  static _onNewAvatarMarkerAdded = [];
17183
17181
  static _onAvatarMarkerDestroyed = [];
17184
17182
  connectionId;
17185
17183
  avatar;
17186
17184
  awake() {
17187
- De.instances.push(this), uk && console.log(this);
17188
- for (const e of De._onNewAvatarMarkerAdded)
17185
+ je.instances.push(this), uk && console.log(this);
17186
+ for (const e of je._onNewAvatarMarkerAdded)
17189
17187
  e({ avatarMarker: this, gameObject: this.gameObject });
17190
17188
  }
17191
17189
  onDestroy() {
17192
- De.instances.splice(De.instances.indexOf(this), 1);
17193
- for (const e of De._onAvatarMarkerDestroyed)
17190
+ je.instances.splice(je.instances.indexOf(this), 1);
17191
+ for (const e of je._onAvatarMarkerDestroyed)
17194
17192
  e({ avatarMarker: this, gameObject: this.gameObject });
17195
17193
  }
17196
17194
  isLocalAvatar() {
@@ -17240,8 +17238,8 @@ class ud extends T {
17240
17238
  _lookDuration = 0;
17241
17239
  _lastPoiChangedTime = 0;
17242
17240
  awake() {
17243
- if (this.avatar = x.getComponentInParent(this.gameObject, De), this.avatar) {
17244
- const e = x.getComponentInParent(this.gameObject, De);
17241
+ if (this.avatar = x.getComponentInParent(this.gameObject, je), this.avatar) {
17242
+ const e = x.getComponentInParent(this.gameObject, je);
17245
17243
  this._model = new o0(this.context.connection, this.guid), e?.isLocalAvatar && this._model.requestOwnership();
17246
17244
  }
17247
17245
  this.context.connection.beginListen("avatar-look-target-changed", (e) => {
@@ -17334,7 +17332,7 @@ class _k {
17334
17332
  this.object = e, this.collider = t;
17335
17333
  }
17336
17334
  }
17337
- const Ne = w("debugnetworkingstreams");
17335
+ const Le = w("debugnetworkingstreams");
17338
17336
  var ps = /* @__PURE__ */ ((s) => (s.Connected = "peer-user-connected", s.StreamReceived = "receive-stream", s.StreamEnded = "call-ended", s.Disconnected = "peer-user-disconnected", s.UserJoined = "user-joined", s))(ps || {});
17339
17337
  class X0 {
17340
17338
  type = "call-ended";
@@ -17388,7 +17386,7 @@ class xk extends dm {
17388
17386
  }
17389
17387
  constructor(e, t, i, n = null) {
17390
17388
  super(), this.peerId = t.peer, this.userId = e, this.call = t, this.direction = i, this._stream = n, t.on("stream", (o) => {
17391
- if (Ne && console.log("Receive stream", `
17389
+ if (Le && console.log("Receive stream", `
17392
17390
  Audio:`, o.getAudioTracks(), `
17393
17391
  Video:`, o.getVideoTracks()), this._stream = o, i === "incoming") {
17394
17392
  const r = new bk(e, o, this);
@@ -17422,7 +17420,7 @@ class to extends dm {
17422
17420
  }
17423
17421
  makeCall(e, t) {
17424
17422
  if (!t?.id) {
17425
- Ne ? console.warn("Can not make a call: mediastream has no id or is undefined") : console.debug("Can not make a call: mediastream has no id or is undefined");
17423
+ Le ? console.warn("Can not make a call: mediastream has no id or is undefined") : console.debug("Can not make a call: mediastream has no id or is undefined");
17426
17424
  return;
17427
17425
  }
17428
17426
  const i = {
@@ -17434,10 +17432,10 @@ class to extends dm {
17434
17432
  }, n = this._peer?.call(e, t, i);
17435
17433
  if (n) {
17436
17434
  const o = this.registerCall(n, "outgoing", t);
17437
- return Ne && console.warn(`📞 CALL ${e}`, `
17435
+ return Le && console.warn(`📞 CALL ${e}`, `
17438
17436
  Outgoing:`, this._outgoingCalls, `
17439
17437
  Incoming:`, this._incomingCalls), o;
17440
- } else Ne && console.error("Failed to make call", e, t, this._peer);
17438
+ } else Le && console.error("Failed to make call", e, t, this._peer);
17441
17439
  }
17442
17440
  closeAll() {
17443
17441
  for (const e of this._incomingCalls)
@@ -17454,7 +17452,7 @@ Incoming:`, this._incomingCalls), o;
17454
17452
  for (let e = this._outgoingCalls.length - 1; e >= 0; e--) {
17455
17453
  const t = this._outgoingCalls[e];
17456
17454
  let i = !1;
17457
- t.isClosed && !t.isOpening && (t.stream?.active ? Ne && console.warn("!!! Stream is still active, don't remove call", t.userId, "Your id: " + this.context.connection.connectionId) : (Ne && console.warn("!!! Remove closed call", t.userId), i = !0)), this.context.connection.userIsInRoom(t.userId) === !1 && (Ne && console.warn("!!! User is not in room anymore, remove call", t.userId), i = !0), i && (t.close(), this._outgoingCalls.splice(e, 1));
17455
+ t.isClosed && !t.isOpening && (t.stream?.active ? Le && console.warn("!!! Stream is still active, don't remove call", t.userId, "Your id: " + this.context.connection.connectionId) : (Le && console.warn("!!! Remove closed call", t.userId), i = !0)), this.context.connection.userIsInRoom(t.userId) === !1 && (Le && console.warn("!!! User is not in room anymore, remove call", t.userId), i = !0), i && (t.close(), this._outgoingCalls.splice(e, 1));
17458
17456
  }
17459
17457
  };
17460
17458
  get peer() {
@@ -17469,7 +17467,13 @@ Incoming:`, this._incomingCalls), o;
17469
17467
  _outgoingCalls = [];
17470
17468
  _peer;
17471
17469
  constructor(e, t) {
17472
- super(), this.context = e, this.id = t, this.setupPeer(), navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
17470
+ super(), this.context = e, this.id = t, this.setupPeer();
17471
+ const i = Object.getOwnPropertyDescriptor(navigator, "getUserMedia")?.writable;
17472
+ try {
17473
+ i ? navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia : Le && console.warn("[PeerJs] getUserMedia is not writable");
17474
+ } catch (n) {
17475
+ Le && console.error("[PeerJs] Error setting getUserMedia", n);
17476
+ }
17473
17477
  }
17474
17478
  _enabled = !1;
17475
17479
  _enabledPeer = !1;
@@ -17509,7 +17513,7 @@ Incoming:`, this._incomingCalls), o;
17509
17513
  * @param id ID of the peer
17510
17514
  */
17511
17515
  onPeerConnect = (e) => {
17512
- if (Ne && console.log("PEER opened as", e), e === null) {
17516
+ if (Le && console.log("PEER opened as", e), e === null) {
17513
17517
  console.error("Peer connection failed", e);
17514
17518
  return;
17515
17519
  }
@@ -17517,17 +17521,17 @@ Incoming:`, this._incomingCalls), o;
17517
17521
  };
17518
17522
  /** Emitted when the peer is destroyed and can no longer accept or create any new connections. At this time, the peer's connections will all be closed. */
17519
17523
  onPeerClose = () => {
17520
- Ne && console.log("PEER closed"), this.updateCalls();
17524
+ Le && console.log("PEER closed"), this.updateCalls();
17521
17525
  };
17522
17526
  /** Emitted when the peer is disconnected from the signalling server, either manually or because the connection to the signalling server was lost. */
17523
17527
  onPeerDisconnected = () => {
17524
- Ne && console.log("PEER disconnected"), this.updateCalls();
17528
+ Le && console.log("PEER disconnected"), this.updateCalls();
17525
17529
  };
17526
17530
  /**
17527
17531
  * Errors on the peer are almost always fatal and will destroy the peer. Errors from the underlying socket and PeerConnections are forwarded here.
17528
17532
  */
17529
17533
  onPeerError = (e) => {
17530
- Ne && console.error("PEER error", e);
17534
+ Le && console.error("PEER error", e);
17531
17535
  };
17532
17536
  onPeerReceivingCall = (e) => {
17533
17537
  e.answer(void 0, {
@@ -17538,12 +17542,12 @@ Incoming:`, this._incomingCalls), o;
17538
17542
  const n = e.metadata;
17539
17543
  (!n || !n.userId) && console.error("Missing call metadata", e);
17540
17544
  const o = n.userId;
17541
- t === "incoming" && Ne ? console.warn("← Receive call from", e.metadata, e.connectionId) : Ne && console.warn("→ Make call to", e.metadata);
17545
+ t === "incoming" && Le ? console.warn("← Receive call from", e.metadata, e.connectionId) : Le && console.warn("→ Make call to", e.metadata);
17542
17546
  const r = t === "incoming" ? this._incomingCalls : this._outgoingCalls, a = new xk(o, e, t, i);
17543
17547
  return r.push(a), e.on("error", (l) => {
17544
17548
  console.error("Call error", l);
17545
17549
  }), e.on("close", () => {
17546
- Ne && console.log("Call ended", e.metadata);
17550
+ Le && console.log("Call ended", e.metadata);
17547
17551
  const l = r.indexOf(a);
17548
17552
  l !== -1 && r.splice(l, 1), a.close(), this.dispatchEvent(new X0(o, t));
17549
17553
  }), a.addEventListener("call-ended", (l) => {
@@ -17551,11 +17555,11 @@ Incoming:`, this._incomingCalls), o;
17551
17555
  }), t === "incoming" && (a.addEventListener("receive-stream", (l) => {
17552
17556
  this.dispatchEvent(l);
17553
17557
  }), e.on("stream", () => {
17554
- Ne && console.log("Received stream for call", e.metadata);
17558
+ Le && console.log("Received stream for call", e.metadata);
17555
17559
  let l = 0;
17556
17560
  const c = setInterval(() => {
17557
17561
  const h = l === 0;
17558
- !a.isOpen && h && (Ne && console.warn("Close call because stream is not active", e.metadata), l += 1, clearInterval(c), a.close());
17562
+ !a.isOpen && h && (Le && console.warn("Close call because stream is not active", e.metadata), l += 1, clearInterval(c), a.close());
17559
17563
  }, 2e3);
17560
17564
  })), a;
17561
17565
  }
@@ -17588,7 +17592,7 @@ class Jd extends dm {
17588
17592
  if (!(e instanceof N)) throw new Error("Failed to create NetworkedStreams because context is not an instance of Context");
17589
17593
  } else throw new Error("Failed to create NetworkedStreams because context is undefined");
17590
17594
  if (!t) throw new Error("Failed to create NetworkedStreams because peer is undefined");
17591
- this.context = e, this.peer = t, Ne && (this.debug = !0);
17595
+ this.context = e, this.peer = t, Le && (this.debug = !0);
17592
17596
  }
17593
17597
  startSendingStream(e) {
17594
17598
  this._sendingStreams.has(e) ? console.warn("Received start sending stream with stream that is already being sent") : (this._sendingStreams.set(e, []), this.updateSendingCalls());
@@ -17650,7 +17654,7 @@ class Jd extends dm {
17650
17654
  const t = this._sendingStreams.keys().next().value;
17651
17655
  this.peer.makeCall(e.peerId, t);
17652
17656
  } else
17653
- Ne && console.log("Unknown user connected", e.guid, e.peerId);
17657
+ Le && console.log("Unknown user connected", e.guid, e.peerId);
17654
17658
  };
17655
17659
  onUserLeft = (e) => {
17656
17660
  this.debug && console.log("User left room: " + e.userId), this.stopCallsToUsersThatAreNotInTheRoomAnymore();
@@ -17663,7 +17667,7 @@ class Jd extends dm {
17663
17667
  if (n === e) continue;
17664
17668
  const o = this.peer.getPeerIdFromUserId(n);
17665
17669
  if (i.find((a) => a.peerId === o && a.direction === "outgoing" && !a.isClosed && a.stream?.active))
17666
- Ne && console.debug("Already have a call with user " + n + " / peer " + o);
17670
+ Le && console.debug("Already have a call with user " + n + " / peer " + o);
17667
17671
  else {
17668
17672
  const a = this.peer.makeCall(o, t);
17669
17673
  a && i.push(a);
@@ -17694,7 +17698,7 @@ class Jd extends dm {
17694
17698
  if (t)
17695
17699
  for (let i = t.length - 1; i >= 0; i--) {
17696
17700
  const n = t[i];
17697
- this.context.connection.userIsInRoom(n.userId) ? Ne && (this.context.connection.connectionId === n.userId ? console.warn(`You are still in the room [${i}] ${n.userId}`) : console.log(`User is still in room [${i}] ${n.userId}`)) : (Ne && console.log(`Remove call ${[i]} to user that is not in room anymore ${n.userId}`), n.close(), t.splice(i, 1));
17701
+ this.context.connection.userIsInRoom(n.userId) ? Le && (this.context.connection.connectionId === n.userId ? console.warn(`You are still in the room [${i}] ${n.userId}`) : console.log(`User is still in room [${i}] ${n.userId}`)) : (Le && console.log(`Remove call ${[i]} to user that is not in room anymore ${n.userId}`), n.close(), t.splice(i, 1));
17698
17702
  }
17699
17703
  }
17700
17704
  this.peer.updateCalls(), this.debug && this.debugLogCurrentState();
@@ -17892,7 +17896,7 @@ class eu extends T {
17892
17896
  mouthChangeLength = 0;
17893
17897
  awake() {
17894
17898
  setTimeout(() => {
17895
- this.voip = x.findObjectOfType(yr, this.context), this.marker || (this.marker = x.getComponentInParent(this.gameObject, De));
17899
+ this.voip = x.findObjectOfType(yr, this.context), this.marker || (this.marker = x.getComponentInParent(this.gameObject, je));
17896
17900
  }, 3e3);
17897
17901
  }
17898
17902
  update() {
@@ -17950,7 +17954,7 @@ class Y0 extends T {
17950
17954
  marker = null;
17951
17955
  _startPosition = null;
17952
17956
  awake() {
17953
- this.voip = x.findObjectOfType(yr, this.context), this.marker = x.getComponentInParent(this.gameObject, De);
17957
+ this.voip = x.findObjectOfType(yr, this.context), this.marker = x.getComponentInParent(this.gameObject, je);
17954
17958
  }
17955
17959
  update() {
17956
17960
  if (!this.voip || !this.marker || this.context.time.frameCount % 10 !== 0) return;
@@ -23956,7 +23960,7 @@ class Go {
23956
23960
  return this._start === void 0 && (this._start = this.ext.getStartTimeByClip(this.clip)), this._start;
23957
23961
  }
23958
23962
  get duration() {
23959
- return this.clip?.duration ?? ze.restPoseClipDuration;
23963
+ return this.clip?.duration ?? Ue.restPoseClipDuration;
23960
23964
  }
23961
23965
  get nearestAnimatedRoot() {
23962
23966
  return this._nearestAnimatedRoot;
@@ -24008,7 +24012,7 @@ class Go {
24008
24012
  return e;
24009
24013
  }
24010
24014
  }
24011
- class ze {
24015
+ class Ue {
24012
24016
  clip;
24013
24017
  pos;
24014
24018
  rot;
@@ -24024,7 +24028,7 @@ class ze {
24024
24028
  static animationDurationPadding = 6 / 60;
24025
24029
  static restPoseClipDuration = 6 / 60;
24026
24030
  constructor(e, t, i) {
24027
- if (this.root = e, this.target = t, this.clip = i, i ? this.duration = i.duration : this.duration = ze.restPoseClipDuration, i && i.tracks) {
24031
+ if (this.root = e, this.target = t, this.clip = i, i ? this.duration = i.duration : this.duration = Ue.restPoseClipDuration, i && i.tracks) {
24028
24032
  const o = Math.max(...i.tracks.map((r) => r.times[r.times.length - 1]));
24029
24033
  o !== this.duration && (console.warn("USDZExporter: Animation clip duration does not match the maximum time value in the tracks.", i, o, this.duration), this.duration = o);
24030
24034
  }
@@ -24067,7 +24071,7 @@ class ze {
24067
24071
  const f = 0;
24068
24072
  for (let p = 0 - f; p < e.length + f; p++) {
24069
24073
  let g = 0, _ = 0;
24070
- if (p < 0 ? (g = e[0], _ = g - ze.animationDurationPadding / 2 + 1 / 60) : p >= e.length ? (g = e[e.length - 1], _ = g + ze.animationDurationPadding / 2 - 1 / 60) : (g = e[p], _ = g), c) {
24074
+ if (p < 0 ? (g = e[0], _ = g - Ue.animationDurationPadding / 2 + 1 / 60) : p >= e.length ? (g = e[e.length - 1], _ = g + Ue.animationDurationPadding / 2 - 1 / 60) : (g = e[p], _ = g), c) {
24071
24075
  const m = c.evaluate(g);
24072
24076
  o.set(m[0], m[1], m[2]);
24073
24077
  }
@@ -24127,7 +24131,7 @@ class ag {
24127
24131
  this.injectRestPoses = e, this.injectImplicitBehaviours = e;
24128
24132
  }
24129
24133
  getStartTimeCode() {
24130
- return !this.injectRestPoses || this.rootAndClipToRegisteredAnimationMap.size === 0 ? 0 : (ze.restPoseClipDuration + ze.animationDurationPadding) * 60;
24134
+ return !this.injectRestPoses || this.rootAndClipToRegisteredAnimationMap.size === 0 ? 0 : (Ue.restPoseClipDuration + Ue.animationDurationPadding) * 60;
24131
24135
  }
24132
24136
  /** Returns the end time code, based on 60 frames per second, for all registered animations.
24133
24137
  * This matches the highest time value in the USDZ file. */
@@ -24215,9 +24219,9 @@ class ag {
24215
24219
  console.warn("no transform data found for target ", d, "at slot " + o + ", this is likely a bug");
24216
24220
  continue;
24217
24221
  }
24218
- a.delete(d), this.injectRestPoses && !f[0] && (console.log("Injecting rest pose", d, t, "at slot", o), f[0] = new ze(null, d, null));
24222
+ a.delete(d), this.injectRestPoses && !f[0] && (console.log("Injecting rest pose", d, t, "at slot", o), f[0] = new Ue(null, d, null));
24219
24223
  let p = f[o];
24220
- p || (p = new ze(e, d, t), f[o] = p), p.addTrack(c), r?.includes(d) || r?.push(d);
24224
+ p || (p = new Ue(e, d, t), f[o] = p), p.addTrack(c), r?.includes(d) || r?.push(d);
24221
24225
  }
24222
24226
  Pn && console.log("Unregistered nodes for this clip", a, "clip", t, "at slot", o, "for root", e, "targets", r);
24223
24227
  for (const c of a) {
@@ -24225,18 +24229,18 @@ class ag {
24225
24229
  if (!h) continue;
24226
24230
  if (this.injectRestPoses && !h[0]) {
24227
24231
  console.warn("Adding rest pose for ", c, t, "at slot", o, "This is likely a bug, should have been added earlier.");
24228
- const f = new ze(null, c, null);
24232
+ const f = new Ue(null, c, null);
24229
24233
  h[0] = f;
24230
24234
  }
24231
24235
  let d = h[o];
24232
- d || (Pn && console.log("Adding padding clip for ", c, t, "at slot", o), d = new ze(e, c, t), h[o] = d);
24236
+ d || (Pn && console.log("Adding padding clip for ", c, t, "at slot", o), d = new Ue(e, c, t), h[o] = d);
24233
24237
  }
24234
24238
  const l = new Go(this, e, t);
24235
24239
  if (this.rootAndClipToRegisteredAnimationMap.set(i, l), Pn && console.log({ root: e, clip: t, info: l }), t) {
24236
24240
  const c = this.rootToRegisteredClip.get(e);
24237
24241
  if (c ? c.push(t) : this.rootToRegisteredClip.set(e, [t]), !this.clipToStartTime.get(t)) {
24238
- this.lastClipEndTime == null && (this.lastClipEndTime = ze.restPoseClipDuration);
24239
- let d = this.lastClipEndTime + ze.animationDurationPadding, f = d + t.duration;
24242
+ this.lastClipEndTime == null && (this.lastClipEndTime = Ue.restPoseClipDuration);
24243
+ let d = this.lastClipEndTime + Ue.animationDurationPadding, f = d + t.duration;
24240
24244
  const p = Math.round(d * 60) / 60, g = Math.round(f * 60) / 60;
24241
24245
  Math.abs(p - d) < 0.01 && (d = p), Math.abs(g - f) < 0.01 && (f = g), d = Math.ceil(d), f = d + t.duration, this.clipToStartTime.set(t, d), this.lastClipEndTime = f;
24242
24246
  }
@@ -24264,7 +24268,7 @@ class ag {
24264
24268
  let c = a[l];
24265
24269
  if (!c) {
24266
24270
  const d = l - (this.injectRestPoses ? 1 : 0);
24267
- a[l] = new ze(null, r, this.rootToRegisteredClip.get(t)[d]), c = a[l];
24271
+ a[l] = new Ue(null, r, this.rootToRegisteredClip.get(t)[d]), c = a[l];
24268
24272
  }
24269
24273
  const h = c.getDuration();
24270
24274
  if (o[l] === void 0) o[l] = h;
@@ -24350,7 +24354,7 @@ class KM {
24350
24354
  for (const Je of W) {
24351
24355
  const Ri = A.get(Je);
24352
24356
  let Vc;
24353
- Ri ? console.assert(Ri.length === Se, "We should have the same number of TransformData entries for each bone", Ri, U) : Vc = new ze(null, Je, null);
24357
+ Ri ? console.assert(Ri.length === Se, "We should have the same number of TransformData entries for each bone", Ri, U) : Vc = new Ue(null, Je, null);
24354
24358
  for (let js = 0; js < Se; js++) {
24355
24359
  const Uu = Ri ? Ri[js] : Vc, Or = U[js];
24356
24360
  for (const { time: Ya, translation: Ka } of Uu.getValues(Or.pos, !0, !1, !1)) {
@@ -24470,7 +24474,7 @@ class KM {
24470
24474
  const i = this.animationData.get(this.object);
24471
24475
  if (i)
24472
24476
  for (let h = 0; h < i.length; h++)
24473
- i[h] === void 0 && (i[h] = new ze(null, this.object, null));
24477
+ i[h] === void 0 && (i[h] = new Ue(null, this.object, null));
24474
24478
  const n = this.ext;
24475
24479
  this.skinnedMeshExport(e, t, n);
24476
24480
  const o = this.object, r = this.model, a = this.animationData.get(o);
@@ -24509,21 +24513,21 @@ class KM {
24509
24513
  const v = !g.clip, y = d === "position" && (g.pos || v), S = d === "rotation" && (g.rot || v), I = d === "scale" && (g.scale || v);
24510
24514
  if (y || S || I) {
24511
24515
  const O = g.clip?.name ?? "rest", k = g.getDuration();
24512
- Pn && console.log("Write .timeSamples:", O, _, k, h), e.appendLine("# " + O + ": start=" + l.format(_ * ze.frameRate) + ", length=" + l.format(k * ze.frameRate) + ", frames=" + g.getFrames());
24516
+ Pn && console.log("Write .timeSamples:", O, _, k, h), e.appendLine("# " + O + ": start=" + l.format(_ * Ue.frameRate) + ", length=" + l.format(k * Ue.frameRate) + ", frames=" + g.getFrames());
24513
24517
  }
24514
24518
  if (y)
24515
24519
  for (const { time: O, translation: k } of g.getValues(m, !0, !1, !1)) {
24516
- const z = `${l.format((_ + O) * ze.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24520
+ const z = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24517
24521
  e.appendLine(z);
24518
24522
  }
24519
24523
  if (S)
24520
24524
  for (const { time: O, rotation: k } of g.getValues(m, !1, !0, !1)) {
24521
- const z = `${l.format((_ + O) * ze.frameRate)}: (${ae(k.w)}, ${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24525
+ const z = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.w)}, ${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24522
24526
  e.appendLine(z);
24523
24527
  }
24524
24528
  if (I)
24525
24529
  for (const { time: O, scale: k } of g.getValues(m, !1, !1, !0)) {
24526
- const z = `${l.format((_ + O) * ze.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24530
+ const z = `${l.format((_ + O) * Ue.frameRate)}: (${ae(k.x)}, ${ae(k.y)}, ${ae(k.z)}),`;
24527
24531
  e.appendLine(z);
24528
24532
  }
24529
24533
  }
@@ -24573,7 +24577,7 @@ class La {
24573
24577
  }
24574
24578
  }
24575
24579
  }
24576
- var JM = Object.defineProperty, Be = (s, e, t, i) => {
24580
+ var JM = Object.defineProperty, Fe = (s, e, t, i) => {
24577
24581
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
24578
24582
  (r = s[o]) && (n = r(e, t, n) || n);
24579
24583
  return n && JM(e, t, n), n;
@@ -24629,16 +24633,16 @@ class Da extends T {
24629
24633
  }
24630
24634
  }
24631
24635
  }
24632
- Be([
24636
+ Fe([
24633
24637
  u(M)
24634
24638
  ], Da.prototype, "object");
24635
- Be([
24639
+ Fe([
24636
24640
  u(M)
24637
24641
  ], Da.prototype, "target");
24638
- Be([
24642
+ Fe([
24639
24643
  u()
24640
24644
  ], Da.prototype, "duration");
24641
- Be([
24645
+ Fe([
24642
24646
  u()
24643
24647
  ], Da.prototype, "relativeMotion");
24644
24648
  const lu = class Ut extends T {
@@ -24733,13 +24737,13 @@ const lu = class Ut extends T {
24733
24737
  return e;
24734
24738
  }
24735
24739
  };
24736
- Be([
24740
+ Fe([
24737
24741
  u(_e)
24738
24742
  ], lu.prototype, "materialToSwitch");
24739
- Be([
24743
+ Fe([
24740
24744
  u(_e)
24741
24745
  ], lu.prototype, "variantMaterial");
24742
- Be([
24746
+ Fe([
24743
24747
  u()
24744
24748
  ], lu.prototype, "fadeDuration");
24745
24749
  let Iv = lu;
@@ -24822,16 +24826,16 @@ const Sc = class Ae extends T {
24822
24826
  this.gameObject[Ae.wasVisible] !== void 0 && (this.gameObject.visible = this.gameObject[Ae.wasVisible], delete this.gameObject[Ae.wasVisible]), this.target && this.target[Ae.wasVisible] !== void 0 && (this.target.visible = this.target[Ae.wasVisible], delete this.target[Ae.wasVisible]), delete this.gameObject[Ae.toggleClone], delete this.gameObject[Ae.reverseToggleClone];
24823
24827
  }
24824
24828
  };
24825
- Be([
24829
+ Fe([
24826
24830
  u(M)
24827
24831
  ], Sc.prototype, "target");
24828
- Be([
24832
+ Fe([
24829
24833
  u()
24830
24834
  ], Sc.prototype, "toggleOnClick");
24831
- Be([
24835
+ Fe([
24832
24836
  u()
24833
24837
  ], Sc.prototype, "targetState");
24834
- Be([
24838
+ Fe([
24835
24839
  u()
24836
24840
  ], Sc.prototype, "hideSelf");
24837
24841
  let Lv = Sc;
@@ -24879,13 +24883,13 @@ class Cc extends T {
24879
24883
  afterCreateDocument(e, t) {
24880
24884
  }
24881
24885
  }
24882
- Be([
24886
+ Fe([
24883
24887
  u()
24884
24888
  ], Cc.prototype, "target");
24885
- Be([
24889
+ Fe([
24886
24890
  u()
24887
24891
  ], Cc.prototype, "duration");
24888
- Be([
24892
+ Fe([
24889
24893
  u()
24890
24894
  ], Cc.prototype, "motionType");
24891
24895
  class or extends T {
@@ -24944,13 +24948,13 @@ class or extends T {
24944
24948
  }
24945
24949
  }
24946
24950
  }
24947
- Be([
24951
+ Fe([
24948
24952
  u(hn)
24949
24953
  ], or.prototype, "target");
24950
- Be([
24954
+ Fe([
24951
24955
  u(URL)
24952
24956
  ], or.prototype, "clip");
24953
- Be([
24957
+ Fe([
24954
24958
  u()
24955
24959
  ], or.prototype, "toggleOnClick");
24956
24960
  const lg = class bn extends T {
@@ -25152,10 +25156,10 @@ const lg = class bn extends T {
25152
25156
  n && (this.animationSequence = n.animationSequence, this.animationLoopAfterSequence = n.animationLoopAfterSequence, this.randomOffsetNormalized = n.randomTimeOffset, this.stateAnimationModel = t);
25153
25157
  }
25154
25158
  };
25155
- Be([
25159
+ Fe([
25156
25160
  u(It)
25157
25161
  ], lg.prototype, "animator");
25158
- Be([
25162
+ Fe([
25159
25163
  u()
25160
25164
  ], lg.prototype, "stateName");
25161
25165
  let gd = lg;
@@ -25166,13 +25170,13 @@ class Pc extends T {
25166
25170
  getDuration() {
25167
25171
  }
25168
25172
  }
25169
- Be([
25173
+ Fe([
25170
25174
  u(M)
25171
25175
  ], Pc.prototype, "target");
25172
25176
  class cu extends T {
25173
25177
  target;
25174
25178
  }
25175
- Be([
25179
+ Fe([
25176
25180
  u(Pc)
25177
25181
  ], cu.prototype, "target");
25178
25182
  class hu extends Pc {
@@ -25190,10 +25194,10 @@ class hu extends Pc {
25190
25194
  return this.duration;
25191
25195
  }
25192
25196
  }
25193
- Be([
25197
+ Fe([
25194
25198
  u()
25195
25199
  ], hu.prototype, "type");
25196
- Be([
25200
+ Fe([
25197
25201
  u()
25198
25202
  ], hu.prototype, "duration");
25199
25203
  class Dv extends cu {
@@ -25280,7 +25284,7 @@ class tr {
25280
25284
  const e = "https://oculus.com/open_url/?url=", t = document.createElement("button");
25281
25285
  return this._sendToQuestButton = t, t.dataset.needle = "webxr-sendtoquest-button", t.innerText = "Open on Quest", t.prepend(Rt("share_windows")), t.title = "Click to send this page to the Oculus Browser on your Quest", t.addEventListener("click", () => {
25282
25286
  const i = encodeURIComponent(window.location.href), n = e + i;
25283
- window.open(n) == null && je("This page doesn't allow popups. Please paste " + n + " into your browser.");
25287
+ window.open(n) == null && Be("This page doesn't allow popups. Please paste " + n + " into your browser.");
25284
25288
  }), this.listenToXRSessionState(t), this.hideElementDuringXRSession(t), q.isMozillaXR() || navigator.xr?.addEventListener("devicechange", () => {
25285
25289
  navigator.xr?.isSessionSupported("immersive-vr") ? t.style.display = "none" : t.style.display = "";
25286
25290
  }), t;
@@ -26397,12 +26401,12 @@ class ar extends T {
26397
26401
  rl && console.warn("AVATAR ENTER XR", this.guid, this.sourceId, this, this.activeAndEnabled), this._syncTransforms && (this._syncTransforms.length = 0), await this.prepareAvatar();
26398
26402
  const t = En.getFor(this);
26399
26403
  if (t?.owner) {
26400
- const i = this.gameObject.addComponent(De);
26404
+ const i = this.gameObject.addComponent(je);
26401
26405
  i.avatar = this.gameObject, i.connectionId = t.owner;
26402
26406
  } else this.context.connection.isConnected ? console.error("No player state found for avatar", this) : t && !this.context.connection.isConnected && (t.dontDestroy = !0);
26403
26407
  }
26404
26408
  onLeaveXR(e) {
26405
- const t = this.gameObject.getComponent(De);
26409
+ const t = this.gameObject.getComponent(je);
26406
26410
  t && t.destroy();
26407
26411
  }
26408
26412
  onUpdateXR(e) {
@@ -29024,11 +29028,11 @@ const si = class Wp extends T {
29024
29028
  /** @internal */
29025
29029
  onEnable() {
29026
29030
  const e = q.supportsQuickLookAR(), t = q.isiOS() || q.isiPad();
29027
- !this.button && (oi || 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)), oi && je("USDZ Exporter enabled: " + this.name), document.getElementById("open-in-ar")?.addEventListener("click", this.onClickedOpenInARElement), ic.registerExporter(this);
29031
+ !this.button && (oi || 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)), oi && Be("USDZ Exporter enabled: " + this.name), document.getElementById("open-in-ar")?.addEventListener("click", this.onClickedOpenInARElement), ic.registerExporter(this);
29028
29032
  }
29029
29033
  /** @internal */
29030
29034
  onDisable() {
29031
- this.button?.remove(), this.link?.removeEventListener("message", this.lastCallback), oi && je("USDZ Exporter disabled: " + this.name), document.getElementById("open-in-ar")?.removeEventListener("click", this.onClickedOpenInARElement), ic.unregisterExporter(this);
29035
+ this.button?.remove(), this.link?.removeEventListener("message", this.lastCallback), oi && Be("USDZ Exporter disabled: " + this.name), document.getElementById("open-in-ar")?.removeEventListener("click", this.onClickedOpenInARElement), ic.unregisterExporter(this);
29032
29036
  }
29033
29037
  onClickedOpenInARElement = (e) => {
29034
29038
  e.preventDefault(), this.exportAndOpen();
@@ -29100,7 +29104,7 @@ const si = class Wp extends T {
29100
29104
  }));
29101
29105
  }
29102
29106
  }
29103
- oi && je("Progressive Loading: " + n.length), await Promise.all(n), oi && je("Progressive Loading: done"), le.end("export-usdz-textures");
29107
+ oi && Be("Progressive Loading: " + n.length), await Promise.all(n), oi && Be("Progressive Loading: done"), le.end("export-usdz-textures");
29104
29108
  const r = Jt.Global.Mask;
29105
29109
  Jt.Global.Set(us.AR);
29106
29110
  const a = new jM(), l = new ag(this.quickLookCompatible);
@@ -29183,7 +29187,7 @@ const si = class Wp extends T {
29183
29187
  const i = new URLSearchParams(this.link.href);
29184
29188
  if (i) {
29185
29189
  const n = i.get("callToActionURL");
29186
- oi && je("Quicklook url: " + n), n && (bs() ? globalThis.open(n, "_blank") : console.warn("Quicklook closed: custom redirects require a Needle Engine Pro license: https://needle.tools/pricing", n));
29190
+ oi && Be("Quicklook url: " + n), n && (bs() ? globalThis.open(n, "_blank") : console.warn("Quicklook closed: custom redirects require a Needle Engine Pro license: https://needle.tools/pricing", n));
29187
29191
  }
29188
29192
  }
29189
29193
  }
@@ -30884,7 +30888,7 @@ C([
30884
30888
  C([
30885
30889
  u()
30886
30890
  ], ve.prototype, "strengthZMultiplier");
30887
- class Ue {
30891
+ class Ne {
30888
30892
  enabled;
30889
30893
  attachRibbonToTransform = !1;
30890
30894
  colorOverLifetime;
@@ -30916,64 +30920,64 @@ class Ue {
30916
30920
  }
30917
30921
  C([
30918
30922
  u()
30919
- ], Ue.prototype, "enabled");
30923
+ ], Ne.prototype, "enabled");
30920
30924
  C([
30921
30925
  u()
30922
- ], Ue.prototype, "attachRibbonToTransform");
30926
+ ], Ne.prototype, "attachRibbonToTransform");
30923
30927
  C([
30924
30928
  u(Wa)
30925
- ], Ue.prototype, "colorOverLifetime");
30929
+ ], Ne.prototype, "colorOverLifetime");
30926
30930
  C([
30927
30931
  u(Wa)
30928
- ], Ue.prototype, "colorOverTrail");
30932
+ ], Ne.prototype, "colorOverTrail");
30929
30933
  C([
30930
30934
  u()
30931
- ], Ue.prototype, "dieWithParticles");
30935
+ ], Ne.prototype, "dieWithParticles");
30932
30936
  C([
30933
30937
  u()
30934
- ], Ue.prototype, "inheritParticleColor");
30938
+ ], Ne.prototype, "inheritParticleColor");
30935
30939
  C([
30936
30940
  u(Y)
30937
- ], Ue.prototype, "lifetime");
30941
+ ], Ne.prototype, "lifetime");
30938
30942
  C([
30939
30943
  u()
30940
- ], Ue.prototype, "lifetimeMultiplier");
30944
+ ], Ne.prototype, "lifetimeMultiplier");
30941
30945
  C([
30942
30946
  u()
30943
- ], Ue.prototype, "minVertexDistance");
30947
+ ], Ne.prototype, "minVertexDistance");
30944
30948
  C([
30945
30949
  u()
30946
- ], Ue.prototype, "mode");
30950
+ ], Ne.prototype, "mode");
30947
30951
  C([
30948
30952
  u()
30949
- ], Ue.prototype, "ratio");
30953
+ ], Ne.prototype, "ratio");
30950
30954
  C([
30951
30955
  u()
30952
- ], Ue.prototype, "ribbonCount");
30956
+ ], Ne.prototype, "ribbonCount");
30953
30957
  C([
30954
30958
  u()
30955
- ], Ue.prototype, "shadowBias");
30959
+ ], Ne.prototype, "shadowBias");
30956
30960
  C([
30957
30961
  u()
30958
- ], Ue.prototype, "sizeAffectsLifetime");
30962
+ ], Ne.prototype, "sizeAffectsLifetime");
30959
30963
  C([
30960
30964
  u()
30961
- ], Ue.prototype, "sizeAffectsWidth");
30965
+ ], Ne.prototype, "sizeAffectsWidth");
30962
30966
  C([
30963
30967
  u()
30964
- ], Ue.prototype, "splitSubEmitterRibbons");
30968
+ ], Ne.prototype, "splitSubEmitterRibbons");
30965
30969
  C([
30966
30970
  u()
30967
- ], Ue.prototype, "textureMode");
30971
+ ], Ne.prototype, "textureMode");
30968
30972
  C([
30969
30973
  u(Y)
30970
- ], Ue.prototype, "widthOverTrail");
30974
+ ], Ne.prototype, "widthOverTrail");
30971
30975
  C([
30972
30976
  u()
30973
- ], Ue.prototype, "widthOverTrailMultiplier");
30977
+ ], Ne.prototype, "widthOverTrailMultiplier");
30974
30978
  C([
30975
30979
  u()
30976
- ], Ue.prototype, "worldSpace");
30980
+ ], Ne.prototype, "worldSpace");
30977
30981
  class Ve {
30978
30982
  enabled;
30979
30983
  space = 0;
@@ -31506,7 +31510,7 @@ class ow {
31506
31510
  ), this.particleSystem.worldSpace || i.multiplyMatrices(this._emitterMatrix, i), this.subParticleSystem.emit(t, e.emissionState, i);
31507
31511
  }
31508
31512
  }
31509
- var oT = Object.defineProperty, Fe = (s, e, t, i) => {
31513
+ var oT = Object.defineProperty, ze = (s, e, t, i) => {
31510
31514
  for (var n = void 0, o = s.length - 1, r; o >= 0; o--)
31511
31515
  (r = s[o]) && (n = r(e, t, n) || n);
31512
31516
  return n && oT(e, t, n), n;
@@ -31556,28 +31560,28 @@ class mn extends T {
31556
31560
  return new H(t, this.getMaterial());
31557
31561
  }
31558
31562
  }
31559
- Fe([
31563
+ ze([
31560
31564
  u()
31561
31565
  ], mn.prototype, "renderMode");
31562
- Fe([
31566
+ ze([
31563
31567
  u(_e)
31564
31568
  ], mn.prototype, "particleMaterial");
31565
- Fe([
31569
+ ze([
31566
31570
  u(_e)
31567
31571
  ], mn.prototype, "trailMaterial");
31568
- Fe([
31572
+ ze([
31569
31573
  u()
31570
31574
  ], mn.prototype, "maxParticleSize");
31571
- Fe([
31575
+ ze([
31572
31576
  u()
31573
31577
  ], mn.prototype, "minParticleSize");
31574
- Fe([
31578
+ ze([
31575
31579
  u()
31576
31580
  ], mn.prototype, "velocityScale");
31577
- Fe([
31581
+ ze([
31578
31582
  u()
31579
31583
  ], mn.prototype, "cameraVelocityScale");
31580
- Fe([
31584
+ ze([
31581
31585
  u()
31582
31586
  ], mn.prototype, "lengthScale");
31583
31587
  class vh {
@@ -32214,49 +32218,49 @@ const jt = class Uh extends T {
32214
32218
  }
32215
32219
  }
32216
32220
  };
32217
- Fe([
32221
+ ze([
32218
32222
  u(Cg)
32219
32223
  ], jt.prototype, "colorOverLifetime");
32220
- Fe([
32224
+ ze([
32221
32225
  u(Qt)
32222
32226
  ], jt.prototype, "main");
32223
- Fe([
32227
+ ze([
32224
32228
  u(Co)
32225
32229
  ], jt.prototype, "emission");
32226
- Fe([
32230
+ ze([
32227
32231
  u(Va)
32228
32232
  ], jt.prototype, "sizeOverLifetime");
32229
- Fe([
32233
+ ze([
32230
32234
  u(iw)
32231
32235
  ], jt.prototype, "shape");
32232
- Fe([
32236
+ ze([
32233
32237
  u(ve)
32234
32238
  ], jt.prototype, "noise");
32235
- Fe([
32236
- u(Ue)
32239
+ ze([
32240
+ u(Ne)
32237
32241
  ], jt.prototype, "trails");
32238
- Fe([
32242
+ ze([
32239
32243
  u(Ve)
32240
32244
  ], jt.prototype, "velocityOverLifetime");
32241
- Fe([
32245
+ ze([
32242
32246
  u(yt)
32243
32247
  ], jt.prototype, "limitVelocityOverLifetime");
32244
- Fe([
32248
+ ze([
32245
32249
  u(sw)
32246
32250
  ], jt.prototype, "inheritVelocity");
32247
- Fe([
32251
+ ze([
32248
32252
  u(Ic)
32249
32253
  ], jt.prototype, "colorBySpeed");
32250
- Fe([
32254
+ ze([
32251
32255
  u(Yt)
32252
32256
  ], jt.prototype, "textureSheetAnimation");
32253
- Fe([
32257
+ ze([
32254
32258
  u(Gn)
32255
32259
  ], jt.prototype, "rotationOverLifetime");
32256
- Fe([
32260
+ ze([
32257
32261
  u(pn)
32258
32262
  ], jt.prototype, "rotationBySpeed");
32259
- Fe([
32263
+ ze([
32260
32264
  u(Oi)
32261
32265
  ], jt.prototype, "sizeBySpeed");
32262
32266
  let bd = jt;
@@ -32305,7 +32309,7 @@ class uc extends T {
32305
32309
  const e = x.getComponentInParent(this.gameObject, En);
32306
32310
  if (e && e.owner)
32307
32311
  return this._didAssignPlayerColor = !0, this.assignUserColor(e.owner), !0;
32308
- const t = x.getComponentInParent(this.gameObject, De);
32312
+ const t = x.getComponentInParent(this.gameObject, je);
32309
32313
  return t?.connectionId ? (this._didAssignPlayerColor = !0, this.assignUserColor(t.connectionId), !0) : !1;
32310
32314
  };
32311
32315
  assignUserColor(e) {
@@ -33590,7 +33594,7 @@ class Dc extends T {
33590
33594
  /** @internal */
33591
33595
  awake() {
33592
33596
  Bo && (console.log("PostprocessingManager Awake", this), console.log("Press P to toggle post processing"), window.addEventListener("keydown", (e) => {
33593
- e.key === "p" && (this.enabled = !this.enabled, je("Toggle PostProcessing " + this.name + ": Enabled=" + this.enabled), this.markDirty());
33597
+ e.key === "p" && (this.enabled = !this.enabled, Be("Toggle PostProcessing " + this.name + ": Enabled=" + this.enabled), this.markDirty());
33594
33598
  })), this.sharedProfile?.__init(this);
33595
33599
  }
33596
33600
  _componentEnabledTime = -1;
@@ -33788,7 +33792,7 @@ class Ze extends T {
33788
33792
  }
33789
33793
  /** @internal */
33790
33794
  async onEnable() {
33791
- if (globalThis.addEventListener("popstate", this.onPopState), this.context.input.addEventListener(Le.KeyDown, this.onInputKeyDown), this.context.input.addEventListener(Le.PointerMove, this.onInputPointerMove), this.context.input.addEventListener(Le.PointerUp, this.onInputPointerUp), this._engineElementOverserver || (this._engineElementOverserver = new MutationObserver((e) => {
33795
+ if (globalThis.addEventListener("popstate", this.onPopState), this.context.input.addEventListener(De.KeyDown, this.onInputKeyDown), this.context.input.addEventListener(De.PointerMove, this.onInputPointerMove), this.context.input.addEventListener(De.PointerUp, this.onInputPointerUp), this._engineElementOverserver || (this._engineElementOverserver = new MutationObserver((e) => {
33792
33796
  for (const t of e)
33793
33797
  if (t.type === "attributes" && t.attributeName === $h) {
33794
33798
  const i = this.context.domElement.getAttribute($h);
@@ -33820,7 +33824,7 @@ class Ze extends T {
33820
33824
  }
33821
33825
  /** @internal */
33822
33826
  onDisable() {
33823
- if (globalThis.removeEventListener("popstate", this.onPopState), this.context.input.removeEventListener(Le.KeyDown, this.onInputKeyDown), this.context.input.removeEventListener(Le.PointerMove, this.onInputPointerMove), this.context.input.removeEventListener(Le.PointerUp, this.onInputPointerUp), this._preloadScheduler?.stop(), this._menuButtons) {
33827
+ if (globalThis.removeEventListener("popstate", this.onPopState), this.context.input.removeEventListener(De.KeyDown, this.onInputKeyDown), this.context.input.removeEventListener(De.PointerMove, this.onInputPointerMove), this.context.input.removeEventListener(De.PointerUp, this.onInputPointerUp), this._preloadScheduler?.stop(), this._menuButtons) {
33824
33828
  for (const e of this._menuButtons)
33825
33829
  e.remove();
33826
33830
  this._menuButtons = void 0;
@@ -35857,7 +35861,7 @@ class Lg extends T {
35857
35861
  */
35858
35862
  setAvatarFlagsBeforeRender() {
35859
35863
  const e = this._mode === 0;
35860
- for (const t of De.instances)
35864
+ for (const t of je.instances)
35861
35865
  if (t.avatar && "isLocalAvatar" in t.avatar && "flags" in t.avatar) {
35862
35866
  let i = us.All;
35863
35867
  this.isSpectatingSelf && (i = e && t.avatar.isLocalAvatar ? us.FirstPerson : us.ThirdPerson);
@@ -35871,7 +35875,7 @@ class Lg extends T {
35871
35875
  * Restores avatar visibility flags after spectator rendering
35872
35876
  */
35873
35877
  resetAvatarFlags() {
35874
- for (const e of De.instances)
35878
+ for (const e of je.instances)
35875
35879
  if (e.avatar && "flags" in e.avatar) {
35876
35880
  const t = e.avatar.flags;
35877
35881
  if (!t) continue;
@@ -35957,9 +35961,9 @@ class OE {
35957
35961
  n.key === "Escape" && this.spectator.stopSpectating();
35958
35962
  });
35959
35963
  let i = 0;
35960
- this.context.input.addEventListener(Le.PointerDown, (n) => {
35964
+ this.context.input.addEventListener(De.PointerDown, (n) => {
35961
35965
  i = this.context.time.time;
35962
- }), this.context.input.addEventListener(Le.PointerUp, (n) => {
35966
+ }), this.context.input.addEventListener(De.PointerUp, (n) => {
35963
35967
  const o = this.context.time.time - i;
35964
35968
  o > 1 ? this.spectator.stopSpectating() : this.context.input.getPointerClicked(0) && o < 0.3 && this.trySelectObject();
35965
35969
  });
@@ -35974,7 +35978,7 @@ class OE {
35974
35978
  if (pi && console.log(...t), t?.length)
35975
35979
  for (const i of t) {
35976
35980
  if (i.distance < 0.2) continue;
35977
- const n = i.object, o = x.getComponentInParent(n, De), r = o?.connectionId;
35981
+ const n = i.object, o = x.getComponentInParent(n, je), r = o?.connectionId;
35978
35982
  if (r) {
35979
35983
  const a = this.context.players.getPlayerView(r);
35980
35984
  this.spectator.target = a, pi && console.log("spectate", r, o);
@@ -36256,7 +36260,7 @@ const xw = class em extends T {
36256
36260
  l.context = this.context;
36257
36261
  const c = x.instantiate(this.cameraPrefab, l);
36258
36262
  n = this.remoteCams[t] = { obj: c, lastUpdate: this.context.time.realtimeSinceStartup, userId: i }, n.obj.visible = !0, this.gameObject.add(c), this.userToCamMap[i] = t, em.instances.push(n);
36259
- const h = x.getOrAddComponent(c, De);
36263
+ const h = x.getOrAddComponent(c, je);
36260
36264
  h.connectionId = i, h.avatar = c;
36261
36265
  } else
36262
36266
  return;
@@ -36417,7 +36421,7 @@ C) Set "joinRandomRoom" to true`), !1) : (qf && console.log("Join " + this.roomN
36417
36421
  const t = this.getViewOnlyUrl();
36418
36422
  t?.length ? navigator.canShare({ url: t }) ? navigator.share({ url: t })?.catch((i) => {
36419
36423
  console.warn(i);
36420
- }) : (navigator.clipboard.writeText(t), je("View only URL copied to clipboard")) : me("Could not create view only URL");
36424
+ }) : (navigator.clipboard.writeText(t), Be("View only URL copied to clipboard")) : me("Could not create view only URL");
36421
36425
  }, e.title = "Copy the view only URL: A page accessed by the view only URL can not be modified by visiting users.", e.textContent = "Share View URL", e.prepend(Rt("visibility"));
36422
36426
  }
36423
36427
  this.context.menu.appendChild(this._viewOnlyButton);
@@ -37788,7 +37792,7 @@ class Mo extends T {
37788
37792
  Fo && console.warn("Button Up", this.animationTriggers?.highlightedTrigger, this.animator, this._isHovered), this.interactable && (this.transition == 3 && this.animationTriggers && this.animator ? this.animator.setTrigger(this._isHovered ? this.animationTriggers.highlightedTrigger : this.animationTriggers.normalTrigger) : this.transition === 1 && this.colors && this._image?.setState(this._isHovered ? "hovered" : "normal"));
37789
37793
  }
37790
37794
  onPointerClick(e) {
37791
- if (this.interactable && !(e.button !== 0 && e.event.pointerType === Pm.Mouse) && (Fo && (console.warn("Button Click", this.onClick), je("CLICKED button " + this.name + " at " + this.context.time.frameCount)), this.onClick && this.onClick.listenerCount > 0 && (this.onClick.invoke(), e.use(), Fo))) {
37795
+ if (this.interactable && !(e.button !== 0 && e.event.pointerType === Pm.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))) {
37792
37796
  const t = this.gameObject.worldPosition;
37793
37797
  t.add(this.gameObject.worldUp.multiplyScalar(1 + Math.random() * 0.5)), F.DrawLabel(t, "CLICK:" + Date.now(), 0.1, 1 + Math.random() * 0.5);
37794
37798
  }
@@ -38362,7 +38366,7 @@ class Wc extends T {
38362
38366
  }
38363
38367
  this._validateUrl();
38364
38368
  let e = this.url;
38365
- switch (!e.startsWith("mailto:") && e.includes("@") && (e = "mailto:" + e), L() && je("Open URL: " + e), this.mode) {
38369
+ switch (!e.startsWith("mailto:") && e.includes("@") && (e = "mailto:" + e), L() && Be("Open URL: " + e), this.mode) {
38366
38370
  case 0:
38367
38371
  q.isSafari(), globalThis.open(e, "_blank");
38368
38372
  break;
@@ -39539,7 +39543,7 @@ P.add("TeleportTarget", ug);
39539
39543
  P.add("WebARCameraBackground", zu);
39540
39544
  P.add("WebARSessionRoot", $i);
39541
39545
  P.add("WebXR", fg);
39542
- P.add("AvatarMarker", De);
39546
+ P.add("AvatarMarker", je);
39543
39547
  P.add("WebXRImageTracking", Pd);
39544
39548
  P.add("WebXRPlaneTracking", Ao);
39545
39549
  P.add("XRRig", Vg);
@@ -39628,7 +39632,7 @@ async function sm(s, e, t, i) {
39628
39632
  }
39629
39633
  if (ul.length > 0) {
39630
39634
  const r = ul.join(", ");
39631
- console.warn("unknown components: " + r), ul.length = 0, ti() && je(`<strong>Unknown components in scene</strong>:
39635
+ console.warn("unknown components: " + r), ul.length = 0, ti() && Be(`<strong>Unknown components in scene</strong>:
39632
39636
 
39633
39637
  ${r}
39634
39638
 
@@ -39811,7 +39815,7 @@ function xA(s) {
39811
39815
  if (new URL(s, window.location.href).href.startsWith("file://")) {
39812
39816
  const t = `Hi - it looks like you are trying to load a local file which will not work. You need to use a webserver to serve your files.
39813
39817
  Please refer to the documentation on <a href="https://fwd.needle.tools/needle-engine/docs/local-server">https://docs.needle.tools</a> or ask for help in our <a href="https://discord.needle.tools">discord community</a>`;
39814
- je(t), console.warn(t);
39818
+ Be(t), console.warn(t);
39815
39819
  }
39816
39820
  }
39817
39821
  function SA(s, e) {
@@ -41740,7 +41744,7 @@ const pL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41740
41744
  AvatarBlink_Simple: Ta,
41741
41745
  AvatarEyeLook_Rotation: ev,
41742
41746
  AvatarLoader: FA,
41743
- AvatarMarker: De,
41747
+ AvatarMarker: je,
41744
41748
  AvatarModel: Hw,
41745
41749
  Avatar_Brain_LookAt: ud,
41746
41750
  Avatar_MouthShapes: eu,
@@ -41901,8 +41905,8 @@ const pL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41901
41905
  TextureSheetAnimationModule: Yt,
41902
41906
  TiltShiftEffect: Ds,
41903
41907
  ToneMappingEffect: cr,
41904
- TrailModule: Ue,
41905
- TransformData: ze,
41908
+ TrailModule: Ne,
41909
+ TransformData: Ue,
41906
41910
  TransformGizmo: qa,
41907
41911
  TriggerBuilder: Gt,
41908
41912
  TriggerModel: er,
@@ -42005,11 +42009,7 @@ he.registerCallback(ce.ContextCreated, (s) => {
42005
42009
  });
42006
42010
  class NA extends NS {
42007
42011
  constructor() {
42008
- super(new Worker(new URL(
42009
- /* @vite-ignore */
42010
- "/generateMeshBVH.worker-2qGLkQjg.js",
42011
- import.meta.url
42012
- ), { type: "module" })), this.name = "GenerateMeshBVHWorker";
42012
+ super(new Worker(URL.createObjectURL(new Blob(["import '" + `${new URL('./generateMeshBVH.worker-2qGLkQjg.js', import.meta.url).toString()}` + "';"], { type: 'text/javascript' })), { type: "module" })), this.name = "GenerateMeshBVHWorker";
42013
42013
  }
42014
42014
  runTask(e, t, i = {}) {
42015
42015
  return new Promise((n, o) => {
@@ -42083,7 +42083,7 @@ export {
42083
42083
  Ta as AvatarBlink_Simple,
42084
42084
  ev as AvatarEyeLook_Rotation,
42085
42085
  FA as AvatarLoader,
42086
- De as AvatarMarker,
42086
+ je as AvatarMarker,
42087
42087
  Hw as AvatarModel,
42088
42088
  ud as Avatar_Brain_LookAt,
42089
42089
  eu as Avatar_MouthShapes,
@@ -42190,7 +42190,7 @@ export {
42190
42190
  sw as InheritVelocityModule,
42191
42191
  r1 as Input,
42192
42192
  di as InputEventQueue,
42193
- Le as InputEvents,
42193
+ De as InputEvents,
42194
42194
  Rw as InputField,
42195
42195
  ra as InstanceHandle,
42196
42196
  Pa as InstancingHandler,
@@ -42358,8 +42358,8 @@ export {
42358
42358
  cr as ToneMappingEffect,
42359
42359
  Iu as TrackHandler,
42360
42360
  Bi as TrackType,
42361
- Ue as TrailModule,
42362
- ze as TransformData,
42361
+ Ne as TrailModule,
42362
+ Ue as TransformData,
42363
42363
  qa as TransformGizmo,
42364
42364
  Gt as TriggerBuilder,
42365
42365
  er as TriggerModel,
@@ -42605,7 +42605,7 @@ export {
42605
42605
  Ud as setWorldRotationXYZ,
42606
42606
  tc as setWorldScale,
42607
42607
  Nd as showBalloonError,
42608
- je as showBalloonMessage,
42608
+ Be as showBalloonMessage,
42609
42609
  me as showBalloonWarning,
42610
42610
  Hb as showDebugConsole,
42611
42611
  pI as slerp,