@needle-tools/engine 5.1.0-beta → 5.1.0-beta.1

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/gltf-progressive-BGQ-cjly.umd.cjs +10 -0
  3. package/dist/gltf-progressive-BvQHrERj.min.js +10 -0
  4. package/dist/{gltf-progressive-CH7aqHHr.js → gltf-progressive-CtYnVfLc.js} +420 -351
  5. package/dist/{needle-engine.bundle-BWkDSRyF.js → needle-engine.bundle-CFo3xWPu.js} +11 -11
  6. package/dist/{needle-engine.bundle-CdVr_iIe.umd.cjs → needle-engine.bundle-CWiO9cA8.umd.cjs} +4 -4
  7. package/dist/{needle-engine.bundle-BvgS8xMP.min.js → needle-engine.bundle-DxJaiP7e.min.js} +3 -3
  8. package/dist/needle-engine.d.ts +11 -11
  9. package/dist/needle-engine.js +87 -87
  10. package/dist/needle-engine.min.js +1 -1
  11. package/dist/needle-engine.umd.cjs +1 -1
  12. package/dist/three.js +3 -0
  13. package/dist/three.min.js +22 -22
  14. package/dist/three.umd.cjs +24 -24
  15. package/lib/engine/api.d.ts +1 -1
  16. package/lib/engine/api.js +1 -1
  17. package/lib/engine/api.js.map +1 -1
  18. package/lib/engine/engine_init.js +2 -2
  19. package/lib/engine/engine_init.js.map +1 -1
  20. package/lib/engine/engine_license.d.ts +7 -7
  21. package/lib/engine/engine_license.js +72 -72
  22. package/lib/engine/engine_license.js.map +1 -1
  23. package/lib/engine/engine_networking_blob.js +3 -3
  24. package/lib/engine/engine_networking_blob.js.map +1 -1
  25. package/lib/engine/engine_utils_qrcode.js +2 -2
  26. package/lib/engine/engine_utils_qrcode.js.map +1 -1
  27. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -2
  28. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
  29. package/lib/engine/webcomponents/needle menu/needle-menu.js +5 -5
  30. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  31. package/lib/engine/webcomponents/needle-engine.js +2 -2
  32. package/lib/engine/webcomponents/needle-engine.js.map +1 -1
  33. package/lib/engine/webcomponents/needle-engine.loading.js +2 -2
  34. package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
  35. package/lib/engine/xr/TempXRContext.js +2 -2
  36. package/lib/engine/xr/TempXRContext.js.map +1 -1
  37. package/lib/engine-components/export/usdz/USDZExporter.js +4 -4
  38. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  39. package/package.json +2 -2
  40. package/plugins/common/license.js +4 -4
  41. package/plugins/vite/license.js +4 -4
  42. package/src/engine/api.ts +1 -1
  43. package/src/engine/engine_init.ts +2 -2
  44. package/src/engine/engine_license.ts +69 -69
  45. package/src/engine/engine_networking_blob.ts +3 -3
  46. package/src/engine/engine_utils_qrcode.ts +2 -2
  47. package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -2
  48. package/src/engine/webcomponents/needle menu/needle-menu.ts +5 -5
  49. package/src/engine/webcomponents/needle-engine.loading.ts +6 -6
  50. package/src/engine/webcomponents/needle-engine.ts +2 -2
  51. package/src/engine/xr/TempXRContext.ts +2 -2
  52. package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
  53. package/dist/gltf-progressive-9tlS5iCx.umd.cjs +0 -10
  54. package/dist/gltf-progressive-CVg80COO.min.js +0 -10
@@ -1,4 +1,4 @@
1
- import { createLoaders as $g, LODsManager as or, NEEDLE_progressive as Ge, getRaycastMesh as R0, calculateMeshLODLevel as wC, getLODColor as xC, addDracoAndKTX2Loaders as SC, configureLoader as CC, setKTX2TranscoderLocation as PC, setDracoDecoderLocation as kC } from "./gltf-progressive-CH7aqHHr.js";
1
+ import { createLoaders as $g, LODsManager as or, NEEDLE_progressive as Ge, getRaycastMesh as R0, calculateMeshLODLevel as wC, getLODColor as xC, addDracoAndKTX2Loaders as SC, configureLoader as CC, setKTX2TranscoderLocation as PC, setDracoDecoderLocation as kC } from "./gltf-progressive-CtYnVfLc.js";
2
2
  import { Vector2 as Z, Vector3 as v, Vector4 as ye, Quaternion as z, Box3 as si, ShadowMaterial as A0, Euler as Be, PlaneGeometry as An, WebGLRenderer as Wr, PerspectiveCamera as fe, OrthographicCamera as Vu, Scene as ji, Mesh as H, Texture as Se, Uniform$1 as tn, Color as se, ShaderMaterial as is, MeshStandardMaterial as xt, Box3Helper as OC, GridHelper as I0, Object3D as T, Material as be, Matrix3 as L0, Matrix4 as J, Layers as Ao, PropertyBinding as Ha, AnimationClip as Vt, KeyframeTrack as EC, FileLoader as D0, BufferGeometry as En, TextureLoader as Ir, MeshBasicMaterial as Oe, DoubleSide as Bi, Group as Is, CylinderGeometry as j0, SphereGeometry as Wg, BoxGeometry as Ga, SpriteMaterial as TC, Sprite as MC, Shape as RC, ExtrudeGeometry as AC, Ray as Us, CubeUVReflectionMapping as sn, LinearSRGBColorSpace as Ns, ShaderChunk as ii, Sphere as Hu, DataTexture as Vg, RGBAFormat as Gu, EquirectangularReflectionMapping as Ls, SRGBColorSpace as $s, Clock as IC, NeutralToneMapping as qa, AgXToneMapping as qu, ACESFilmicToneMapping as Xu, NoToneMapping as ru, AxesHelper as Di, MathUtils as Ds, Fog as B0, DirectionalLight as bm, PointLight as Hg, PCFSoftShadowMap$1 as LC, BasicNodeLibrary as DC, WebGLRenderTarget as ns, DepthTexture as F0, NearestFilter as au, EdgesGeometry as jC, LineSegments as vm, LineBasicMaterial as lu, Line as $c, BufferAttribute as st, Raycaster as Gg, ArrayCamera as BC, Plane as ll, SkinnedMesh as ko, InterleavedBufferAttribute as z0, Skeleton as FC, Bone as zC, WebGLCubeRenderTarget as UC, CubeCamera as NC, LoopRepeat as $C, LoopOnce as wm, AnimationMixer as qg, InterpolateLinear as WC, InterpolateDiscrete as VC, InterpolateSmooth as HC, QuaternionKeyframeTrack as rc, BooleanKeyframeTrack as z_, VectorKeyframeTrack as ac, ColorKeyframeTrack as U_, NumberKeyframeTrack as ip, AudioContext as U0, CompressedTexture as GC, FrontSide as Io, Camera as qC, Frustum as N_, AudioListener as XC, PositionalAudio as QC, Audio as YC, AudioLoader as KC, BackSide as Qu, PMREMGenerator$1 as ZC, EquirectangularRefractionMapping as Xg, CubeTexture as Qg, CompressedCubeTexture as N0, MeshDepthMaterial as JC, CustomBlending as e1, MaxEquation as t1, AlwaysStencilFunc as i1, GreaterEqualStencilFunc as n1, NotEqualStencilFunc as s1, GreaterStencilFunc as o1, LessEqualStencilFunc as r1, EqualStencilFunc as a1, LessStencilFunc as l1, NeverStencilFunc as $_, InvertStencilOp as c1, DecrementWrapStencilOp as h1, IncrementWrapStencilOp as d1, DecrementStencilOp as u1, IncrementStencilOp as f1, ReplaceStencilOp as p1, ZeroStencilOp as m1, KeepStencilOp as g1, AmbientLight as y1, HemisphereLight as _1, Loader as b1, GLSL3 as v1, AlwaysDepth as w1, GreaterEqualDepth as x1, GreaterDepth as S1, LessEqualDepth as C1, LessDepth as P1, NotEqualDepth as k1, EqualDepth as O1, RawShaderMaterial as $0, BatchedMesh as W_, LinearFilter as cu, UnsignedByteType as E1, MeshPhysicalMaterial as V_, RingGeometry as T1, Line3 as M1, AdditiveBlending as W0, BoxHelper as R1, SpotLight as A1, DirectionalLightHelper as I1, CameraHelper as L1, LOD as D1, Triangle as j1, NormalBlending as B1, ReinhardToneMapping as Yg, LinearToneMapping as Kg, EventDispatcher as Zg, VideoTexture as F1, CatmullRomCurve3 as z1, MirroredRepeatWrapping as H_, ShaderLib as hu, UniformsUtils as V0, MeshNormalMaterial as U1, HalfFloatType as np, Source as N1 } from "./three.js";
3
3
  import { GroundedSkybox as Xa, Font as $1, TextGeometry as W1, FontLoader as V1, GLTFLoader as Lo, EXRLoader as Jg, RGBELoader as H0, Stats as H1, nodeFrame as G_, TransformControlsGizmo as q_, OrbitControls as G1, PositionalAudioHelper as q1, HorizontalBlurShader as X1, VerticalBlurShader as Q1, GLTFExporter as G0, strToU8 as q0, zipSync as Y1, XRControllerModelFactory as K1, XRHandMeshModel as Z1, Line2 as J1, LineGeometry as eP, LineMaterial as tP, TransformControls as iP, InteractiveGroup as nP, HTMLMesh as sP, VertexNormalsHelper as oP, OBJLoader as ey, FBXLoader as X0, mergeVertices as rP } from "./three-examples.js";
4
4
  import { v5 as xm, ByteBuffer as aP, fetchProfile as lP, MotionController as cP, SIZE_PREFIX_LENGTH as Q0, Builder as ty, createNoise4D as hP, Matrix4 as sp, BatchedParticleRenderer as dP, ParticleSystem as uP, RenderMode as ws, ConstantColor as fP, Vector4 as pP, ConstantValue as mP, TrailParticle as X_, WorkerBase as gP, MeshBVH as yP } from "./vendor-BslSKZPo.js";
@@ -2294,11 +2294,11 @@ zo('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"]
2294
2294
  zo('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');
2295
2295
  zo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');
2296
2296
  zo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
2297
- zo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "5.1.0-beta";');
2297
+ zo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "5.1.0-beta.1";');
2298
2298
  zo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
2299
- zo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Jun 08 2026 13:29:07 GMT+0000 (Coordinated Universal Time)";');
2299
+ zo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Tue Jun 09 2026 16:30:29 GMT+0000 (Coordinated Universal Time)";');
2300
2300
  zo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
2301
- const Ii = "5.1.0-beta", Vc = "undefined", gu = "Mon Jun 08 2026 13:29:07 GMT+0000 (Coordinated Universal Time)";
2301
+ const Ii = "5.1.0-beta.1", Vc = "undefined", gu = "Tue Jun 09 2026 16:30:29 GMT+0000 (Coordinated Universal Time)";
2302
2302
  bw && console.log(`Engine version: ${Ii} (generator: ${Vc})
2303
2303
  Project built at ${gu}`);
2304
2304
  const xr = NEEDLE_PUBLIC_KEY, Os = "needle_isActiveInHierarchy", ga = "builtin_components", Bd = "needle_editor_guid";
@@ -46543,7 +46543,7 @@ class $u {
46543
46543
  }
46544
46544
  // private async handleRuntimeLicense(loadingElement: HTMLElement) {
46545
46545
  // // First check if we have a commercial license
46546
- // let commercialLicense = $fwGZrGe();
46546
+ // let commercialLicense = __Aale();
46547
46547
  // // if it's the case then we don't need to perform a runtime check
46548
46548
  // if (commercialLicense) return;
46549
46549
  // // If we don't have a commercial license, then we need to display our message
@@ -46561,10 +46561,10 @@ class $u {
46561
46561
  // nonCommercialContainer.style.opacity = "0";
46562
46562
  // loadingElement.appendChild(nonCommercialContainer);
46563
46563
  // // Use the runtime license check
46564
- // if (!isDevEnvironment() && ICD) {
46564
+ // if (!isDevEnvironment() && _AaROCyv) {
46565
46565
  // if (debugLicense) console.log("Waiting for runtime license check");
46566
- // await ICD;
46567
- // commercialLicense = $fwGZrGe();
46566
+ // await _AaROCyv;
46567
+ // commercialLicense = __Aale();
46568
46568
  // }
46569
46569
  // if (commercialLicense) return;
46570
46570
  // nonCommercialContainer.style.transition = "opacity .5s ease-in-out";
@@ -48257,8 +48257,8 @@ const U3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48257
48257
  GenerateMeshBVHWorker: z3
48258
48258
  }, Symbol.toStringTag, { value: "Module" }));
48259
48259
  export {
48260
+ js as $KhjWEFh,
48260
48261
  Am as $componentName,
48261
- ts as $fwGZrGe,
48262
48262
  _j as $physicsKey,
48263
48263
  ge as ActionBuilder,
48264
48264
  MI as ActionCollection,
@@ -48646,8 +48646,8 @@ export {
48646
48646
  D_ as XRRig,
48647
48647
  gi as XRState,
48648
48648
  ks as XRStateFlag,
48649
- nf as _$qWUhYZU,
48650
- js as _XtEQ,
48649
+ nf as _$WfJljBK,
48650
+ ts as __Aale,
48651
48651
  F3 as __Ignore,
48652
48652
  Nj as __internalNotifyObjectDestroyed,
48653
48653
  Os as activeInHierarchyFieldName,
@@ -1,4 +1,4 @@
1
- "use strict";const ne=require("./gltf-progressive-9tlS5iCx.umd.cjs"),c=require("./three.umd.cjs"),X=require("./three-examples.umd.cjs"),de=require("./vendor-1UvpPPSB.umd.cjs"),se=require("./three-mesh-ui-Chib781Y.umd.cjs");var Pa=typeof document<"u"?document.currentScript:null;const L_=typeof window<"u"?window.location.search.includes("debugcontext"):!1;var le=(s=>(s.ContextRegistered="ContextRegistered",s.ContextCreationStart="ContextCreationStart",s.ContextCreated="ContextCreated",s.ContextFirstFrameRendered="ContextFirstFrameRendered",s.ContextDestroying="ContextDestroying",s.ContextDestroyed="ContextDestroyed",s.MissingCamera="MissingCamera",s.ContextClearing="ContextClearing",s.ContextCleared="ContextCleared",s))(le||{});class ae{static get Current(){return globalThis["NeedleEngine.Context.Current"]}static set Current(e){globalThis["NeedleEngine.Context.Current"]=e}static get All(){return this.Registered}static Registered=[];static register(e){this.Registered.indexOf(e)===-1&&(L_&&console.warn("Registering context"),this.Registered.push(e),this.dispatchCallback("ContextRegistered",e))}static unregister(e){const t=this.Registered.indexOf(e);t!==-1&&(L_&&console.warn("Unregistering context"),this.Registered.splice(t,1))}static _callbacks={};static registerCallback(e,t){return this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].indexOf(t)!==-1?()=>this.unregisterCallback(e,t):(this._callbacks[e].push(t),()=>this.unregisterCallback(e,t))}static unregisterCallback(e,t){if(!this._callbacks[e])return;const i=this._callbacks[e].indexOf(t);i!==-1&&this._callbacks[e].splice(i,1)}static dispatchCallback(e,t,i){if(!this._callbacks[e])return!0;const n={event:e,context:t};if(i)for(const r in i)n[r]=i[r];const o=new Array;return this._callbacks[e].forEach(r=>{const a=r(n);a instanceof Promise&&o.push(a)}),Promise.all(o)}static addContextCreatedCallback(e){this.registerCallback("ContextCreated",e)}static addContextDestroyedCallback(e){this.registerCallback("ContextDestroyed",e)}}const Jf=new Map;function wi(s=globalThis.location?.hostname){if(Jf.has(s))return Jf.get(s);const e=/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|localhost/.test(s);return Jf.set(s,e),e===!0}function r0(){return window.location.hostname.includes("glitch.me")}const a0=()=>s=>s;function dC(s){return a0()(s)}function uC(){return!!x("debug")}class xi{_factory;_cache=[];_maxSize;_index=0;constructor(e,t){this._factory=e,this._maxSize=t}get(){const e=this._index%this._maxSize;return this._index++,this._cache.length<=e&&(this._cache[e]=this._factory()),this._cache[e]}}let Xo=!1;const cm=new Array;typeof window<"u"&&setTimeout(()=>{if(Xo){const s={},e=new URL(window.location.href),t=new URL(e);t.searchParams.append("console","");const i=t.toString().replace(/=$|=(?=&)/g,"");for(const o of cm){const r=new URL(e);r.searchParams.append(o,""),s[o]=r.toString().replace(/=$|=(?=&)/g,"")}console.log(`🌵 ?help: Debug Options for Needle Engine.
1
+ "use strict";const ne=require("./gltf-progressive-BGQ-cjly.umd.cjs"),c=require("./three.umd.cjs"),X=require("./three-examples.umd.cjs"),de=require("./vendor-1UvpPPSB.umd.cjs"),se=require("./three-mesh-ui-Chib781Y.umd.cjs");var Pa=typeof document<"u"?document.currentScript:null;const L_=typeof window<"u"?window.location.search.includes("debugcontext"):!1;var le=(s=>(s.ContextRegistered="ContextRegistered",s.ContextCreationStart="ContextCreationStart",s.ContextCreated="ContextCreated",s.ContextFirstFrameRendered="ContextFirstFrameRendered",s.ContextDestroying="ContextDestroying",s.ContextDestroyed="ContextDestroyed",s.MissingCamera="MissingCamera",s.ContextClearing="ContextClearing",s.ContextCleared="ContextCleared",s))(le||{});class ae{static get Current(){return globalThis["NeedleEngine.Context.Current"]}static set Current(e){globalThis["NeedleEngine.Context.Current"]=e}static get All(){return this.Registered}static Registered=[];static register(e){this.Registered.indexOf(e)===-1&&(L_&&console.warn("Registering context"),this.Registered.push(e),this.dispatchCallback("ContextRegistered",e))}static unregister(e){const t=this.Registered.indexOf(e);t!==-1&&(L_&&console.warn("Unregistering context"),this.Registered.splice(t,1))}static _callbacks={};static registerCallback(e,t){return this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].indexOf(t)!==-1?()=>this.unregisterCallback(e,t):(this._callbacks[e].push(t),()=>this.unregisterCallback(e,t))}static unregisterCallback(e,t){if(!this._callbacks[e])return;const i=this._callbacks[e].indexOf(t);i!==-1&&this._callbacks[e].splice(i,1)}static dispatchCallback(e,t,i){if(!this._callbacks[e])return!0;const n={event:e,context:t};if(i)for(const r in i)n[r]=i[r];const o=new Array;return this._callbacks[e].forEach(r=>{const a=r(n);a instanceof Promise&&o.push(a)}),Promise.all(o)}static addContextCreatedCallback(e){this.registerCallback("ContextCreated",e)}static addContextDestroyedCallback(e){this.registerCallback("ContextDestroyed",e)}}const Jf=new Map;function wi(s=globalThis.location?.hostname){if(Jf.has(s))return Jf.get(s);const e=/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|localhost/.test(s);return Jf.set(s,e),e===!0}function r0(){return window.location.hostname.includes("glitch.me")}const a0=()=>s=>s;function dC(s){return a0()(s)}function uC(){return!!x("debug")}class xi{_factory;_cache=[];_maxSize;_index=0;constructor(e,t){this._factory=e,this._maxSize=t}get(){const e=this._index%this._maxSize;return this._index++,this._cache.length<=e&&(this._cache[e]=this._factory()),this._cache[e]}}let Xo=!1;const cm=new Array;typeof window<"u"&&setTimeout(()=>{if(Xo){const s={},e=new URL(window.location.href),t=new URL(e);t.searchParams.append("console","");const i=t.toString().replace(/=$|=(?=&)/g,"");for(const o of cm){const r=new URL(e);r.searchParams.append(o,""),s[o]=r.toString().replace(/=$|=(?=&)/g,"")}console.log(`🌵 ?help: Debug Options for Needle Engine.
2
2
  Append any of these parameters to the URL to enable specific debug options.
3
3
  Example: ${i} will show an onscreen console window.`);const n=Xo===!0?"":` (containing "${Xo}")`;console.group("Available URL parameters:"+n);for(const o of Object.keys(s).sort())typeof Xo=="string"&&!o.toLowerCase().includes(Xo.toLowerCase())||(console.groupCollapsed(o),console.log("Reload with this flag enabled:"),console.log(s[o]),console.groupEnd());console.groupEnd()}},100);function Yc(){return new URLSearchParams(globalThis.location?.search)}function x(s){Xo&&!cm.includes(s)&&cm.push(s);const e=Yc();if(e.has(s)){const t=e.get(s);if(t){const i=Number(t);return isNaN(i)?t:i}else return!0}return!1}Xo=x("help");function fC(s,e){const t=Yc();t.has(s)?t.set(s,e):t.append(s,e),document.location.search=t.toString()}function kc(s,e,t=!0){const i=Yc();i.has(s)?e===null?i.delete(s):i.set(s,e):e!==null&&i.append(s,e),t?l0(s,i):bg(s,i)}function hm(s,e,t){s.has(e)?s.set(e,t.toString()):s.append(e,t.toString())}function l0(s,e,t){window.history.pushState(t,s,"?"+e.toString()+window.location.hash)}function bg(s,e,t){window.history.replaceState(t,s,"?"+e.toString()+window.location.hash)}function pC(s){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=t.length,n=0;n<s;n++)e+=t.charAt(Math.floor(Math.random()*i));return e}function mC(s,e){return Math.floor(Math.random()*(e-s+1))+s}const j_=["smol","tiny","giant","interesting","smart","bright","dull","extreme","beautiful","pretty","dark","epic","salty","silly","funny","lame","lazy","loud","lucky","mad","mean","mighty","mysterious","nasty","odd","old","powerful","quiet","rapid","scary","shiny","shy","silly","smooth","sour","spicy","stupid","sweet","tasty","terrible","ugly","unusual","vast","wet","wild","witty","wrong","zany","zealous","zippy","zombie","zorro"],B_=["cat","dog","mouse","pig","cow","horse","sheep","chicken","duck","goat","panda","tiger","lion","elephant","monkey","bird","fish","snake","frog","turtle","hamster","penguin","kangaroo","whale","dolphin","crocodile","snail","ant","bee","beetle","butterfly","dragon","eagle","fish","giraffe","lizard","panda","penguin","rabbit","snake","spider","tiger","zebra"];function c0(){const s=j_[Math.floor(Math.random()*j_.length)],e=B_[Math.floor(Math.random()*B_.length)];return s+"_"+e}function h0(s){return s=s.replace(/[^a-z0-9áéíóúñü \.,_-]/gim,""),s.trim()}function Oc(s,e,t=!0,i=!1){if(e==null)return null;if(e.userData&&e.userData.guid===s)return e;if(e.guid==s)return e;if(i&&e.userData?.components){for(const n of e.userData.components)if(n.guid===s)return n}if(t){if(e.scenes)for(const n in e.scenes){const o=e.scenes[n],r=Oc(s,o,t,i);if(r)return r}if(e.children)for(const n in e.children){const o=e.children[n],r=Oc(s,o,t,i);if(r)return r}}}function gC(s){return!!(typeof EventTarget<"u"&&s instanceof EventTarget||s instanceof Date||s instanceof RegExp||s instanceof Map||s instanceof Set||s instanceof WeakMap||s instanceof WeakSet||s instanceof Promise||typeof ArrayBuffer<"u"&&s instanceof ArrayBuffer||ArrayBuffer.isView(s))}function Kc(s,e,t){if(s!=null&&typeof s=="object"){if(t||(t=new WeakSet),t.has(s)||(t.add(s),gC(s)))return s;let i;if(Array.isArray(s))i=[];else{i=Object.create(Object.getPrototypeOf(s));const n=Object.getOwnPropertyDescriptors(s);for(const o in n){const r=n[o];if(r.set||r.writable!==!1)try{i[o]=s[o]}catch{}}}for(const n of Object.keys(s)){const o=s[n];e&&!e(s,n,o)?i[n]=o:o?.clone!==void 0&&typeof o.clone=="function"?i[n]=o.clone():i[n]=Kc(o,e,t)}return i}return s}function Cs(s){return new Promise((e,t)=>{setTimeout(e,s)})}function ju(s,e){if(s<=0)return Promise.resolve();if(e||(e=ae.Current),!e)return Promise.reject("No context");const t=e.time.frameCount+s;return new Promise((i,n)=>{if(!e)return n("No context");const o=()=>{e.time.frameCount>=t&&(e.pre_update_callbacks.splice(e.pre_update_callbacks.indexOf(o),1),i())};e.pre_update_callbacks.push(o)})}const Vh=x("debugresolveurl"),d0="rel:";function yC(s,e){return Yn(s,e)}function Yn(s,e){if(e===void 0)return Vh&&console.warn("getPath: uri is undefined, returning uri",e),e;if(e.startsWith("./"))return e;if(e.startsWith("http"))return Vh&&console.warn("getPath: uri is absolute, returning uri",e),e;if(s===void 0)return Vh&&console.warn("getPath: source is undefined, returning uri",e),e;e.startsWith(d0)&&(e=e.substring(4));const t=s.lastIndexOf("/");if(t>=0){const i=s.substring(0,t+1);for(;i.endsWith("/")&&e.startsWith("/");)e=e.substring(1);const n=i+e;return Vh&&console.log("source:",s,`changed uri
4
4
  from`,e,`
@@ -140,7 +140,7 @@ void main(){
140
140
  #__vconsole .vc-mask {
141
141
  overflow: hidden;
142
142
  }
143
- `,jo?.prepend(i),s===!0&&p0()<=0&&D0(),console.log("🌵 Debug console has loaded")}},e.onerror=()=>{console.warn("🌵 Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),Al=!1,ni=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function x1(){if(!globalThis.VConsole)return;const s=new VConsole.VConsolePlugin("needle-console","🌵 Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+s._id+" iframe");return s.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const o=n.indexOf("?");o>-1&&(n=n.substring(0,o));const a=location.protocol+"//"+location.host+location.pathname+"/"+n,l=encodeURIComponent(a);s.fullUrl="https://viewer.needle.tools?inspect&file="+l;var h='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(h)}),s.on("show",function(){const t=e();t&&t.src!==s.fullUrl&&(t.src=s.fullUrl)}),s.on("hide",function(){const t=e();t&&(t.src="")}),s.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window ↗",onClick:function(n){window.open(s.fullUrl,"_blank"),ni?.hide()}}),i.push({name:"Reload",onClick:function(n){const o=e();o&&(o.src=s.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const o=e();o.requestFullscreen?o.requestFullscreen():o.webkitRequestFullscreen instanceof Function&&o.webkitRequestFullscreen()}}),t(i)}),s}const gm="padding: 10px; font-family: monospace;",Q_="margin-bottom: 10px;",Bo="margin-bottom: 10px; margin-top: 15px;",S1="width: 100%; border-collapse: collapse; border: 1px solid rgba(0,0,0,0.1); table-layout: fixed;",I0="border: 1px solid rgba(0,0,0,0.1); padding: 5px;",C1=I0,P1=I0+" word-break: break-all;";function Dn(s,e=!1){e&&s.sort((i,n)=>(n.value?1:0)-(i.value?1:0));let t=`<table style='${S1}'>`;t+="<tbody>";for(const i of s){const n=typeof i.value=="boolean"?i.value?"✅":"❌":i.value;t+=`<tr><td style='${C1}'>${i.label}</td><td style='${P1}'>${n}</td></tr>`}return t+="</tbody></table>",t}function L0(){try{if(document.createElement("canvas").getContext("webgl2"))return"✅"}catch{}return"❌"}function k1(){if(!globalThis.VConsole)return;const s=new VConsole.VConsolePlugin("device-utilities","📱 Device Info");return s.on("renderTab",function(e){let t=`<div style='${gm}'>`;const i=j1();t+=`<h3 style='${Q_}'>Device: ${i}</h3>`,t+=Dn([{label:"💻 Desktop",value:exports.DeviceUtilities.isDesktop()},{label:"📱 Mobile Device",value:exports.DeviceUtilities.isMobileDevice()},{label:"🍎 iOS",value:exports.DeviceUtilities.isiOS()},{label:"📱 iPad",value:exports.DeviceUtilities.isiPad()},{label:"🤖 Android",value:exports.DeviceUtilities.isAndroidDevice()},{label:"🦊 Mozilla XR",value:exports.DeviceUtilities.isMozillaXR()},{label:"🌵 Needle App Clip",value:exports.DeviceUtilities.isNeedleAppClip()},{label:"🍏 macOS",value:exports.DeviceUtilities.isMacOS()},{label:"👓 VisionOS",value:exports.DeviceUtilities.isVisionOS()},{label:"🧭 Safari",value:exports.DeviceUtilities.isSafari()},{label:"🕶️ Meta Quest",value:exports.DeviceUtilities.isQuest()},{label:"🔗 QuickLook AR Support",value:exports.DeviceUtilities.supportsQuickLookAR()}],!0);const n=[],o=exports.DeviceUtilities.getiOSVersion();o&&n.push({label:"🍎 iOS Version",value:o});const r=exports.DeviceUtilities.getChromeVersion();r&&n.push({label:"🌐 Chrome Version",value:r});const a=exports.DeviceUtilities.getSafariVersion();a&&n.push({label:"🧭 Safari Version",value:a}),n.length>0&&(t+=Dn(n,!1)),t+="</div>",t+=`<div style='${gm} margin-top: 20px;'>`,t+=`<h3 style='${Q_}'>User Agent Info</h3>`;const l=[{label:"User Agent",value:navigator.userAgent},{label:"Platform",value:navigator.platform},{label:"App Version",value:navigator.appVersion},{label:"User Agent Data",value:navigator.userAgentData?`Platform: ${navigator.userAgentData.platform}, Mobile: ${navigator.userAgentData.mobile}`:"Not supported"},{label:"WebXR",value:"xr"in navigator?"✅":"❌"},{label:"WebGPU",value:"gpu"in navigator?"✅":"❌"},{label:"WebGL 2",value:L0()}];t+=Dn(l,!1),t+="</div>",e(t)}),s}function O1(){if(!globalThis.VConsole)return;const s=new VConsole.VConsolePlugin("graphics-info","🎨 Graphics Info");return s.on("renderTab",async function(e){let t=`<div style='${gm}'>`;const i=M1();i.length>0&&(t+=`<h3 style='${Bo}'>General GPU Info</h3>`,t+=Dn(i,!1));const n=T1();n.length>0&&(t+=`<h3 style='${Bo}'>WebGL</h3>`,t+=Dn(n,!1));const o=R1();o.length>0&&(t+=`<h3 style='${Bo}'>WebGL 2 Features</h3>`,t+=Dn(o,!1));const r=A1();r.length>0&&(t+=`<h3 style='${Bo}'>WebGL Limits</h3>`,t+=Dn(r,!1));const a=D1();a.length>0&&(t+=`<h3 style='${Bo}'>Texture Formats</h3>`,t+=Dn(a,!1));const l=await I1();if(l.length>0&&(t+=`<h3 style='${Bo}'>WebGPU</h3>`,t+=Dn(l,!1)),exports.DeviceUtilities.isSafari()){const h=L1();h.length>0&&(t+=`<h3 style='${Bo}'>Safari GPU Info</h3>`,t+=Dn(h,!1))}t+="</div>",e(t)}),s}function M1(){const s=[],e=window.devicePixelRatio;s.push({label:"Device Pixel Ratio",value:e.toString()}),s.push({label:"Width (px)",value:(window.innerWidth*e).toString()}),s.push({label:"Height (px)",value:(window.innerHeight*e).toString()});const i=exports.DeviceUtilities.isMobileDevice()?150:96,n=screen.width/i,o=screen.height/i,r=n*2.54,a=o*2.54;s.push({label:"Estimated Width (cm)",value:r.toFixed(1)}),s.push({label:"Estimated Height (cm)",value:a.toFixed(1)});const l=j0();if(l){s.push({label:"GPU",value:l.renderer}),s.push({label:"Driver",value:l.vendor}),s.push({label:"ANGLE",value:l.angle||"Not detected"});const h=E1(l.renderer);h&&(h.manufacturer&&s.push({label:"Manufacturer",value:h.manufacturer}),h.cardVersion&&s.push({label:"Card Version",value:h.cardVersion}),h.brand&&s.push({label:"Brand",value:h.brand}),s.push({label:"Integrated",value:h.integrated?"Yes":"No"}),h.layer&&s.push({label:"WebGL Layer",value:h.layer}))}return s}function E1(s){if(!s)return null;const e=(h,d)=>{const u=d.match(h);return u&&u[0]},t=e(/(ANGLE)/g,s)||void 0,i=e(/((NVIDIA|AMD|Intel)[^\d]*[^\s]+)/,s)||s,n=i.split(" ");n.shift();const o=e(/(NVIDIA|AMD|Intel)/g,i)||void 0,r=n.length>0?n.pop():void 0,a=n.length>0?n.join(" "):void 0;return{manufacturer:o,cardVersion:r,brand:a,integrated:o==="Intel",layer:t,card:i}}function T1(){const s=[],e=j0();return e&&(s.push({label:"📊 WebGL Version",value:e.version}),s.push({label:"🎮 WebGL 2 Available",value:L0()})),s}function R1(){const s=[];try{const t=document.createElement("canvas").getContext("webgl2");if(!t)return s;s.push({label:"Float Color Buffer",value:t.getExtension("EXT_color_buffer_float")?"✅":"❌"}),s.push({label:"Anisotropic Filtering",value:t.getExtension("EXT_texture_filter_anisotropic")?"✅":"❌"}),s.push({label:"Float Texture Linear",value:t.getExtension("OES_texture_float_linear")?"✅":"❌"}),s.push({label:"S3TC Compression",value:t.getExtension("WEBGL_compressed_texture_s3tc")?"✅":"❌"}),s.push({label:"ETC Compression",value:t.getExtension("WEBGL_compressed_texture_etc")?"✅":"❌"}),s.push({label:"PVRTC Compression",value:t.getExtension("WEBGL_compressed_texture_pvrtc")?"✅":"❌"}),s.push({label:"ASTC Compression",value:t.getExtension("WEBGL_compressed_texture_astc")?"✅":"❌"})}catch{}return s}function A1(){const s=[];try{const e=document.createElement("canvas"),t=e.getContext("webgl2")||e.getContext("webgl");if(!t)return s;const i=t instanceof WebGL2RenderingContext;s.push({label:"📏 Max Texture Size",value:t.getParameter(t.MAX_TEXTURE_SIZE).toString()}),s.push({label:"🎨 Max Renderbuffer Size",value:t.getParameter(t.MAX_RENDERBUFFER_SIZE).toString()}),s.push({label:"🔗 Max Vertex Attribs",value:t.getParameter(t.MAX_VERTEX_ATTRIBS).toString()}),s.push({label:"🎯 Max Texture Units",value:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS).toString()}),i&&(s.push({label:"⚡ Max Samples",value:t.getParameter(t.MAX_SAMPLES).toString()}),s.push({label:"🔄 Max Uniform Buffer Bindings",value:t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS).toString()}),s.push({label:"📐 Max 3D Texture Size",value:t.getParameter(t.MAX_3D_TEXTURE_SIZE).toString()}))}catch{}return s}function D1(){const s=[];try{document.createElement("canvas").getContext("webgl")&&(s.push({label:"WebGL 1 RGBA",value:"✅"}),s.push({label:"WebGL 1 RGB",value:"✅"}));const n=document.createElement("canvas").getContext("webgl2");n&&(s.push({label:"WebGL 2 RGBA32F",value:n.getExtension("EXT_color_buffer_float")?"✅":"❌"}),s.push({label:"WebGL 2 RGB32F",value:n.getExtension("EXT_color_buffer_float")?"✅":"❌"}),s.push({label:"WebGL 2 R11F_G11F_B10F",value:"✅"}),s.push({label:"WebGL 2 RGB565",value:"✅"}),s.push({label:"WebGL 2 RGB5_A1",value:"✅"}),s.push({label:"WebGL 2 RGBA4444",value:"✅"}))}catch{}return s}async function I1(){const s=[];if(!("gpu"in navigator))return s.push({label:"🚀 WebGPU Support",value:"❌ Not supported"}),s;s.push({label:"🚀 WebGPU Support",value:"✅ Supported"});try{const e=await navigator.gpu.requestAdapter();if(!e)return s.push({label:"🎯 Adapter",value:"No adapter available"}),s;s.push({label:"🎯 Adapter",value:e.name||"Unknown Adapter"});const t=await e.requestDevice();s.push({label:"🔧 Device",value:t.label||"WebGPU Device"}),s.push({label:"📏 Max Texture 2D",value:t.limits.maxTextureDimension2D.toString()}),s.push({label:"📐 Max Texture 3D",value:t.limits.maxTextureDimension3D.toString()}),s.push({label:"📊 Max Texture Array Layers",value:t.limits.maxTextureArrayLayers.toString()}),s.push({label:"💾 Max Buffer Size",value:`${(t.limits.maxBufferSize/1024/1024).toFixed(1)}MB`}),s.push({label:"🔗 Max Bind Groups",value:t.limits.maxBindGroups.toString()})}catch(e){s.push({label:"❌ Error",value:e.message})}return s}function j0(){try{const s=document.createElement("canvas"),e=s.getContext("webgl2")||s.getContext("webgl");if(!e)return null;const t=e.getExtension("WEBGL_debug_renderer_info"),i=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),n=t?e.getParameter(t.UNMASKED_VENDOR_WEBGL):e.getParameter(e.VENDOR),o=e.getParameter(e.VERSION);let r;if(i&&i.includes("ANGLE")){const a=i.match(/ANGLE \(([^)]+)\)/);a&&(r=a[1])}return{renderer:i,vendor:n,version:o,angle:r}}catch{return null}}function L1(){const s=[];try{const t=document.createElement("canvas").getContext("webgl");if(t){const i=t.getExtension("WEBGL_debug_renderer_info");if(i){const n=t.getParameter(i.UNMASKED_RENDERER_WEBGL);n&&n.includes("Apple")&&s.push({label:"🍎 Apple GPU",value:n})}}}catch{}try{const t=document.createElement("canvas").getContext("webgl");t&&(t.getSupportedExtensions()||[]).includes("WEBGL_compressed_texture_pvrtc")&&s.push({label:"🗜️ PVRTC Support",value:"✅"})}catch{}return s}function j1(){return exports.DeviceUtilities.isQuest()?"Meta Quest":exports.DeviceUtilities.isVisionOS()?"Vision Pro":exports.DeviceUtilities.isiOS()?exports.DeviceUtilities.isiPad()?"iPad":"iPhone/iPod":exports.DeviceUtilities.isAndroidDevice()?"Android Device":exports.DeviceUtilities.isMozillaXR()?"Mozilla XR Browser":exports.DeviceUtilities.isNeedleAppClip()?"Needle App Clip":exports.DeviceUtilities.isMacOS()?"Mac":exports.DeviceUtilities.isDesktop()?"Desktop PC":"Unknown Device"}function B1(){const s=document.querySelector("#__vconsole .vc-switch");return s||null}function F1(){const s=document.querySelector("#__vconsole");return s||null}const Gh=x("debugtypes");class U1{_types=new Map;_reverseTypes=new Map;_lazyLoaders=new Map;constructor(){Gh&&console.warn("TypeStore: Created",this)}add(e,t){Gh&&console.warn("ADD TYPE",e);const i=this._types.get(e);i?Gh&&i!==t&&console.warn("Type name exists multiple times in your project and may lead to runtime errors:",e):(this._types.set(e,t),this._reverseTypes.set(t,e))}addLazy(e,t){this._types.has(e)||this._lazyLoaders.set(e,t)}get(e){return this._types.get(e)||null}async getAsync(e){const t=this._types.get(e);if(t)return t;const i=this._lazyLoaders.get(e);if(i){Gh&&console.warn("LAZY LOAD TYPE",e);const n=await i();return this.add(e,n),this._lazyLoaders.delete(e),n}return null}getKey(e){return this._reverseTypes.get(e)||null}}const z1=Symbol("BuiltInType"),P=new U1,Rg=function(s){P.get(s.name)||P.add(s.name,s)};class N1{context;mixers=[];constructor(e){this.context=e}onDestroy(){this.mixers.forEach(e=>e.stopAllAction()),this.mixers.length=0}registerAnimationMixer(e){if(!e){console.warn("AnimationsRegistry.registerAnimationMixer called with null or undefined mixer");return}this.mixers.includes(e)||this.mixers.push(e)}unregisterAnimationMixer(e){if(!e){console.warn("AnimationsRegistry.unregisterAnimationMixer called with null or undefined mixer");return}const t=this.mixers.indexOf(e);t!==-1&&this.mixers.splice(t,1)}}exports.AnimationUtils=void 0;(s=>{function e(d,u){const f=d.getRoot();return f&&(f.userData.static||f.matrixAutoUpdate===!1||f.matrixWorldAutoUpdate===!1)?((u===!0||u===void 0&&T())&&console.warn(`AnimationUtils: The root object (${f.name||f.type}) of this AnimationAction has matrixAutoUpdate or matrixWorldAutoUpdate set to false. This may prevent the animation from working correctly. If the object is marked as static, try to change it to dynamic.`,{static:f.userData.static,name:f.userData.name,tag:f.userData.tag,matrixAutoUpdate:f.matrixAutoUpdate,matrixWorldAutoUpdate:f.matrixWorldAutoUpdate}),!1):!0}s.testIfRootCanAnimate=e;function t(d){const u=d._actions;return u||null}s.tryGetActionsFromMixer=t;function i(d,u){if(u||(u=new Array),d)d.animations&&u.push(...d.animations);else return u;if(d.children)for(const f of d.children)i(f,u);return u}s.tryGetAnimationClipsFromObjectHierarchy=i;const n=Symbol("objectIsAnimatedData");function o(d,u,f){if(!d)return;if(d[n]===void 0){if(!f)return;d[n]=new Set}const m=d[n];f?m.add(u):m.has(u)&&m.delete(u)}s.setObjectAnimated=o;function r(d){if(!d)return!1;const u=d[n];return u!==void 0&&u.size>0}s.getObjectAnimated=r;function a(d){if(!d||!d.animations)return console.debug("No animations found in file"),null;const u="scene"in d?d.scene:d,f=new Array;for(let g=0;g<d.animations.length;g++){const b=d.animations[g];if(!b.tracks||b.tracks.length<=0){console.warn("Animation has no tracks");continue}for(const y in b.tracks){const _=b.tracks[y],v=c.PropertyBinding.parseTrackName(_.name);let w=c.PropertyBinding.findNode(u,v.nodeName);if(!w){const k=_.__objectName??_.name.substring(0,_.name.indexOf("."));if(w=u.getObjectByProperty("uuid",k),!w)continue}let O=m(w)||m(u);if(!O){const k=P.get("Animation");if(O=u.addComponent(k),!O){console.error("Failed creating Animation component: No 'Animation' component found in TypeStore");break}}f.push(O),O.addClip&&O.addClip(b)}}return f;function m(g){if(!g)return null;const b=g.userData?.components;if(b&&b.length>0)for(let y=0;y<b.length;y++){const _=b[y];if(_.isAnimationComponent===!0)return _}return m(g.parent)}}s.autoplayAnimations=a;function l(){return new c.AnimationClip("empty",0,[])}s.emptyClip=l;function h(d){const u=d?.duration??.3;let f={x:1,y:1,z:1};d?.scale!==void 0&&(typeof d.scale=="number"?f={x:d.scale,y:d.scale,z:d.scale}:f=d.scale);const m=d?.type??"linear",g=d?.scaleFactor??1.2,b=new Array,y=new Array;switch(m){case"linear":b.push(0,u),y.push(f.x,f.y,f.z,f.x*g,f.y*g,f.z*g);break;case"spring":b.push(0,u*.3,u*.5,u*.7,u*.9,u),y.push(f.x,f.y,f.z,f.x*g,f.y*g,f.z*g,f.x*.9,f.y*.9,f.z*.9,f.x*1.05,f.y*1.05,f.z*1.05,f.x*.98,f.y*.98,f.z*.98,f.x,f.y,f.z);break}const _=new c.KeyframeTrack(".scale",b,y);return new c.AnimationClip("scale",b[b.length-1],[_])}s.createScaleClip=h})(exports.AnimationUtils||(exports.AnimationUtils={}));const Ue=function(s){return p(s)},p=function(s){if(s===void 0&&(s=null),!Array.isArray(s))s=Y_(s);else for(let e=0;e<s.length;e++){const t=s[e];s[e]=Y_(t)}return function(e,t){if(!e){const n=typeof t=="string"?t:t.name;console.warn(`@serializable without a target at '${n}'.`);return}typeof t!="string"&&(t=t.name),Object.getOwnPropertyDescriptor(e,"$serializedTypes")||(e.$serializedTypes={});const i=e.$serializedTypes=e.$serializedTypes||{};i[t]=s}};function Y_(s){switch(s?.prototype?.constructor?.name){case"Number":case"String":case"Boolean":return null}return s}const K_=x("debugcomponentevents");class Uu{static eventListeners=new Map;static addComponentLifecylceEventListener(e,t){this.eventListeners.has(e)&&this.eventListeners.set(e,[]);let i=this.eventListeners.get(e);i||(i=[]),i.push(t),this.eventListeners.set(e,i),K_&&console.log("Added event listener for "+e,this.eventListeners)}static removeComponentLifecylceEventListener(e,t){const i=this.eventListeners.get(e);if(!i)return;const n=i.indexOf(t);n<0||i.splice(n,1)}static dispatchComponentLifecycleEvent(e,t){const i=this.eventListeners.get(e);if(K_&&console.log("Dispatching event "+e,i),!!i)for(const n of i)n(t)}}const B0=x("debugdefines");vo('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";');vo('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');vo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');vo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');vo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "5.1.0-beta";');vo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');vo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Jun 08 2026 13:29:07 GMT+0000 (Coordinated Universal Time)";');vo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const ci="5.1.0-beta",Ba="undefined",Mc="Mon Jun 08 2026 13:29:07 GMT+0000 (Coordinated Universal Time)";B0&&console.log(`Engine version: ${ci} (generator: ${Ba})
143
+ `,jo?.prepend(i),s===!0&&p0()<=0&&D0(),console.log("🌵 Debug console has loaded")}},e.onerror=()=>{console.warn("🌵 Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),Al=!1,ni=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function x1(){if(!globalThis.VConsole)return;const s=new VConsole.VConsolePlugin("needle-console","🌵 Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+s._id+" iframe");return s.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const o=n.indexOf("?");o>-1&&(n=n.substring(0,o));const a=location.protocol+"//"+location.host+location.pathname+"/"+n,l=encodeURIComponent(a);s.fullUrl="https://viewer.needle.tools?inspect&file="+l;var h='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(h)}),s.on("show",function(){const t=e();t&&t.src!==s.fullUrl&&(t.src=s.fullUrl)}),s.on("hide",function(){const t=e();t&&(t.src="")}),s.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window ↗",onClick:function(n){window.open(s.fullUrl,"_blank"),ni?.hide()}}),i.push({name:"Reload",onClick:function(n){const o=e();o&&(o.src=s.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const o=e();o.requestFullscreen?o.requestFullscreen():o.webkitRequestFullscreen instanceof Function&&o.webkitRequestFullscreen()}}),t(i)}),s}const gm="padding: 10px; font-family: monospace;",Q_="margin-bottom: 10px;",Bo="margin-bottom: 10px; margin-top: 15px;",S1="width: 100%; border-collapse: collapse; border: 1px solid rgba(0,0,0,0.1); table-layout: fixed;",I0="border: 1px solid rgba(0,0,0,0.1); padding: 5px;",C1=I0,P1=I0+" word-break: break-all;";function Dn(s,e=!1){e&&s.sort((i,n)=>(n.value?1:0)-(i.value?1:0));let t=`<table style='${S1}'>`;t+="<tbody>";for(const i of s){const n=typeof i.value=="boolean"?i.value?"✅":"❌":i.value;t+=`<tr><td style='${C1}'>${i.label}</td><td style='${P1}'>${n}</td></tr>`}return t+="</tbody></table>",t}function L0(){try{if(document.createElement("canvas").getContext("webgl2"))return"✅"}catch{}return"❌"}function k1(){if(!globalThis.VConsole)return;const s=new VConsole.VConsolePlugin("device-utilities","📱 Device Info");return s.on("renderTab",function(e){let t=`<div style='${gm}'>`;const i=j1();t+=`<h3 style='${Q_}'>Device: ${i}</h3>`,t+=Dn([{label:"💻 Desktop",value:exports.DeviceUtilities.isDesktop()},{label:"📱 Mobile Device",value:exports.DeviceUtilities.isMobileDevice()},{label:"🍎 iOS",value:exports.DeviceUtilities.isiOS()},{label:"📱 iPad",value:exports.DeviceUtilities.isiPad()},{label:"🤖 Android",value:exports.DeviceUtilities.isAndroidDevice()},{label:"🦊 Mozilla XR",value:exports.DeviceUtilities.isMozillaXR()},{label:"🌵 Needle App Clip",value:exports.DeviceUtilities.isNeedleAppClip()},{label:"🍏 macOS",value:exports.DeviceUtilities.isMacOS()},{label:"👓 VisionOS",value:exports.DeviceUtilities.isVisionOS()},{label:"🧭 Safari",value:exports.DeviceUtilities.isSafari()},{label:"🕶️ Meta Quest",value:exports.DeviceUtilities.isQuest()},{label:"🔗 QuickLook AR Support",value:exports.DeviceUtilities.supportsQuickLookAR()}],!0);const n=[],o=exports.DeviceUtilities.getiOSVersion();o&&n.push({label:"🍎 iOS Version",value:o});const r=exports.DeviceUtilities.getChromeVersion();r&&n.push({label:"🌐 Chrome Version",value:r});const a=exports.DeviceUtilities.getSafariVersion();a&&n.push({label:"🧭 Safari Version",value:a}),n.length>0&&(t+=Dn(n,!1)),t+="</div>",t+=`<div style='${gm} margin-top: 20px;'>`,t+=`<h3 style='${Q_}'>User Agent Info</h3>`;const l=[{label:"User Agent",value:navigator.userAgent},{label:"Platform",value:navigator.platform},{label:"App Version",value:navigator.appVersion},{label:"User Agent Data",value:navigator.userAgentData?`Platform: ${navigator.userAgentData.platform}, Mobile: ${navigator.userAgentData.mobile}`:"Not supported"},{label:"WebXR",value:"xr"in navigator?"✅":"❌"},{label:"WebGPU",value:"gpu"in navigator?"✅":"❌"},{label:"WebGL 2",value:L0()}];t+=Dn(l,!1),t+="</div>",e(t)}),s}function O1(){if(!globalThis.VConsole)return;const s=new VConsole.VConsolePlugin("graphics-info","🎨 Graphics Info");return s.on("renderTab",async function(e){let t=`<div style='${gm}'>`;const i=M1();i.length>0&&(t+=`<h3 style='${Bo}'>General GPU Info</h3>`,t+=Dn(i,!1));const n=T1();n.length>0&&(t+=`<h3 style='${Bo}'>WebGL</h3>`,t+=Dn(n,!1));const o=R1();o.length>0&&(t+=`<h3 style='${Bo}'>WebGL 2 Features</h3>`,t+=Dn(o,!1));const r=A1();r.length>0&&(t+=`<h3 style='${Bo}'>WebGL Limits</h3>`,t+=Dn(r,!1));const a=D1();a.length>0&&(t+=`<h3 style='${Bo}'>Texture Formats</h3>`,t+=Dn(a,!1));const l=await I1();if(l.length>0&&(t+=`<h3 style='${Bo}'>WebGPU</h3>`,t+=Dn(l,!1)),exports.DeviceUtilities.isSafari()){const h=L1();h.length>0&&(t+=`<h3 style='${Bo}'>Safari GPU Info</h3>`,t+=Dn(h,!1))}t+="</div>",e(t)}),s}function M1(){const s=[],e=window.devicePixelRatio;s.push({label:"Device Pixel Ratio",value:e.toString()}),s.push({label:"Width (px)",value:(window.innerWidth*e).toString()}),s.push({label:"Height (px)",value:(window.innerHeight*e).toString()});const i=exports.DeviceUtilities.isMobileDevice()?150:96,n=screen.width/i,o=screen.height/i,r=n*2.54,a=o*2.54;s.push({label:"Estimated Width (cm)",value:r.toFixed(1)}),s.push({label:"Estimated Height (cm)",value:a.toFixed(1)});const l=j0();if(l){s.push({label:"GPU",value:l.renderer}),s.push({label:"Driver",value:l.vendor}),s.push({label:"ANGLE",value:l.angle||"Not detected"});const h=E1(l.renderer);h&&(h.manufacturer&&s.push({label:"Manufacturer",value:h.manufacturer}),h.cardVersion&&s.push({label:"Card Version",value:h.cardVersion}),h.brand&&s.push({label:"Brand",value:h.brand}),s.push({label:"Integrated",value:h.integrated?"Yes":"No"}),h.layer&&s.push({label:"WebGL Layer",value:h.layer}))}return s}function E1(s){if(!s)return null;const e=(h,d)=>{const u=d.match(h);return u&&u[0]},t=e(/(ANGLE)/g,s)||void 0,i=e(/((NVIDIA|AMD|Intel)[^\d]*[^\s]+)/,s)||s,n=i.split(" ");n.shift();const o=e(/(NVIDIA|AMD|Intel)/g,i)||void 0,r=n.length>0?n.pop():void 0,a=n.length>0?n.join(" "):void 0;return{manufacturer:o,cardVersion:r,brand:a,integrated:o==="Intel",layer:t,card:i}}function T1(){const s=[],e=j0();return e&&(s.push({label:"📊 WebGL Version",value:e.version}),s.push({label:"🎮 WebGL 2 Available",value:L0()})),s}function R1(){const s=[];try{const t=document.createElement("canvas").getContext("webgl2");if(!t)return s;s.push({label:"Float Color Buffer",value:t.getExtension("EXT_color_buffer_float")?"✅":"❌"}),s.push({label:"Anisotropic Filtering",value:t.getExtension("EXT_texture_filter_anisotropic")?"✅":"❌"}),s.push({label:"Float Texture Linear",value:t.getExtension("OES_texture_float_linear")?"✅":"❌"}),s.push({label:"S3TC Compression",value:t.getExtension("WEBGL_compressed_texture_s3tc")?"✅":"❌"}),s.push({label:"ETC Compression",value:t.getExtension("WEBGL_compressed_texture_etc")?"✅":"❌"}),s.push({label:"PVRTC Compression",value:t.getExtension("WEBGL_compressed_texture_pvrtc")?"✅":"❌"}),s.push({label:"ASTC Compression",value:t.getExtension("WEBGL_compressed_texture_astc")?"✅":"❌"})}catch{}return s}function A1(){const s=[];try{const e=document.createElement("canvas"),t=e.getContext("webgl2")||e.getContext("webgl");if(!t)return s;const i=t instanceof WebGL2RenderingContext;s.push({label:"📏 Max Texture Size",value:t.getParameter(t.MAX_TEXTURE_SIZE).toString()}),s.push({label:"🎨 Max Renderbuffer Size",value:t.getParameter(t.MAX_RENDERBUFFER_SIZE).toString()}),s.push({label:"🔗 Max Vertex Attribs",value:t.getParameter(t.MAX_VERTEX_ATTRIBS).toString()}),s.push({label:"🎯 Max Texture Units",value:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS).toString()}),i&&(s.push({label:"⚡ Max Samples",value:t.getParameter(t.MAX_SAMPLES).toString()}),s.push({label:"🔄 Max Uniform Buffer Bindings",value:t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS).toString()}),s.push({label:"📐 Max 3D Texture Size",value:t.getParameter(t.MAX_3D_TEXTURE_SIZE).toString()}))}catch{}return s}function D1(){const s=[];try{document.createElement("canvas").getContext("webgl")&&(s.push({label:"WebGL 1 RGBA",value:"✅"}),s.push({label:"WebGL 1 RGB",value:"✅"}));const n=document.createElement("canvas").getContext("webgl2");n&&(s.push({label:"WebGL 2 RGBA32F",value:n.getExtension("EXT_color_buffer_float")?"✅":"❌"}),s.push({label:"WebGL 2 RGB32F",value:n.getExtension("EXT_color_buffer_float")?"✅":"❌"}),s.push({label:"WebGL 2 R11F_G11F_B10F",value:"✅"}),s.push({label:"WebGL 2 RGB565",value:"✅"}),s.push({label:"WebGL 2 RGB5_A1",value:"✅"}),s.push({label:"WebGL 2 RGBA4444",value:"✅"}))}catch{}return s}async function I1(){const s=[];if(!("gpu"in navigator))return s.push({label:"🚀 WebGPU Support",value:"❌ Not supported"}),s;s.push({label:"🚀 WebGPU Support",value:"✅ Supported"});try{const e=await navigator.gpu.requestAdapter();if(!e)return s.push({label:"🎯 Adapter",value:"No adapter available"}),s;s.push({label:"🎯 Adapter",value:e.name||"Unknown Adapter"});const t=await e.requestDevice();s.push({label:"🔧 Device",value:t.label||"WebGPU Device"}),s.push({label:"📏 Max Texture 2D",value:t.limits.maxTextureDimension2D.toString()}),s.push({label:"📐 Max Texture 3D",value:t.limits.maxTextureDimension3D.toString()}),s.push({label:"📊 Max Texture Array Layers",value:t.limits.maxTextureArrayLayers.toString()}),s.push({label:"💾 Max Buffer Size",value:`${(t.limits.maxBufferSize/1024/1024).toFixed(1)}MB`}),s.push({label:"🔗 Max Bind Groups",value:t.limits.maxBindGroups.toString()})}catch(e){s.push({label:"❌ Error",value:e.message})}return s}function j0(){try{const s=document.createElement("canvas"),e=s.getContext("webgl2")||s.getContext("webgl");if(!e)return null;const t=e.getExtension("WEBGL_debug_renderer_info"),i=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),n=t?e.getParameter(t.UNMASKED_VENDOR_WEBGL):e.getParameter(e.VENDOR),o=e.getParameter(e.VERSION);let r;if(i&&i.includes("ANGLE")){const a=i.match(/ANGLE \(([^)]+)\)/);a&&(r=a[1])}return{renderer:i,vendor:n,version:o,angle:r}}catch{return null}}function L1(){const s=[];try{const t=document.createElement("canvas").getContext("webgl");if(t){const i=t.getExtension("WEBGL_debug_renderer_info");if(i){const n=t.getParameter(i.UNMASKED_RENDERER_WEBGL);n&&n.includes("Apple")&&s.push({label:"🍎 Apple GPU",value:n})}}}catch{}try{const t=document.createElement("canvas").getContext("webgl");t&&(t.getSupportedExtensions()||[]).includes("WEBGL_compressed_texture_pvrtc")&&s.push({label:"🗜️ PVRTC Support",value:"✅"})}catch{}return s}function j1(){return exports.DeviceUtilities.isQuest()?"Meta Quest":exports.DeviceUtilities.isVisionOS()?"Vision Pro":exports.DeviceUtilities.isiOS()?exports.DeviceUtilities.isiPad()?"iPad":"iPhone/iPod":exports.DeviceUtilities.isAndroidDevice()?"Android Device":exports.DeviceUtilities.isMozillaXR()?"Mozilla XR Browser":exports.DeviceUtilities.isNeedleAppClip()?"Needle App Clip":exports.DeviceUtilities.isMacOS()?"Mac":exports.DeviceUtilities.isDesktop()?"Desktop PC":"Unknown Device"}function B1(){const s=document.querySelector("#__vconsole .vc-switch");return s||null}function F1(){const s=document.querySelector("#__vconsole");return s||null}const Gh=x("debugtypes");class U1{_types=new Map;_reverseTypes=new Map;_lazyLoaders=new Map;constructor(){Gh&&console.warn("TypeStore: Created",this)}add(e,t){Gh&&console.warn("ADD TYPE",e);const i=this._types.get(e);i?Gh&&i!==t&&console.warn("Type name exists multiple times in your project and may lead to runtime errors:",e):(this._types.set(e,t),this._reverseTypes.set(t,e))}addLazy(e,t){this._types.has(e)||this._lazyLoaders.set(e,t)}get(e){return this._types.get(e)||null}async getAsync(e){const t=this._types.get(e);if(t)return t;const i=this._lazyLoaders.get(e);if(i){Gh&&console.warn("LAZY LOAD TYPE",e);const n=await i();return this.add(e,n),this._lazyLoaders.delete(e),n}return null}getKey(e){return this._reverseTypes.get(e)||null}}const z1=Symbol("BuiltInType"),P=new U1,Rg=function(s){P.get(s.name)||P.add(s.name,s)};class N1{context;mixers=[];constructor(e){this.context=e}onDestroy(){this.mixers.forEach(e=>e.stopAllAction()),this.mixers.length=0}registerAnimationMixer(e){if(!e){console.warn("AnimationsRegistry.registerAnimationMixer called with null or undefined mixer");return}this.mixers.includes(e)||this.mixers.push(e)}unregisterAnimationMixer(e){if(!e){console.warn("AnimationsRegistry.unregisterAnimationMixer called with null or undefined mixer");return}const t=this.mixers.indexOf(e);t!==-1&&this.mixers.splice(t,1)}}exports.AnimationUtils=void 0;(s=>{function e(d,u){const f=d.getRoot();return f&&(f.userData.static||f.matrixAutoUpdate===!1||f.matrixWorldAutoUpdate===!1)?((u===!0||u===void 0&&T())&&console.warn(`AnimationUtils: The root object (${f.name||f.type}) of this AnimationAction has matrixAutoUpdate or matrixWorldAutoUpdate set to false. This may prevent the animation from working correctly. If the object is marked as static, try to change it to dynamic.`,{static:f.userData.static,name:f.userData.name,tag:f.userData.tag,matrixAutoUpdate:f.matrixAutoUpdate,matrixWorldAutoUpdate:f.matrixWorldAutoUpdate}),!1):!0}s.testIfRootCanAnimate=e;function t(d){const u=d._actions;return u||null}s.tryGetActionsFromMixer=t;function i(d,u){if(u||(u=new Array),d)d.animations&&u.push(...d.animations);else return u;if(d.children)for(const f of d.children)i(f,u);return u}s.tryGetAnimationClipsFromObjectHierarchy=i;const n=Symbol("objectIsAnimatedData");function o(d,u,f){if(!d)return;if(d[n]===void 0){if(!f)return;d[n]=new Set}const m=d[n];f?m.add(u):m.has(u)&&m.delete(u)}s.setObjectAnimated=o;function r(d){if(!d)return!1;const u=d[n];return u!==void 0&&u.size>0}s.getObjectAnimated=r;function a(d){if(!d||!d.animations)return console.debug("No animations found in file"),null;const u="scene"in d?d.scene:d,f=new Array;for(let g=0;g<d.animations.length;g++){const b=d.animations[g];if(!b.tracks||b.tracks.length<=0){console.warn("Animation has no tracks");continue}for(const y in b.tracks){const _=b.tracks[y],v=c.PropertyBinding.parseTrackName(_.name);let w=c.PropertyBinding.findNode(u,v.nodeName);if(!w){const k=_.__objectName??_.name.substring(0,_.name.indexOf("."));if(w=u.getObjectByProperty("uuid",k),!w)continue}let O=m(w)||m(u);if(!O){const k=P.get("Animation");if(O=u.addComponent(k),!O){console.error("Failed creating Animation component: No 'Animation' component found in TypeStore");break}}f.push(O),O.addClip&&O.addClip(b)}}return f;function m(g){if(!g)return null;const b=g.userData?.components;if(b&&b.length>0)for(let y=0;y<b.length;y++){const _=b[y];if(_.isAnimationComponent===!0)return _}return m(g.parent)}}s.autoplayAnimations=a;function l(){return new c.AnimationClip("empty",0,[])}s.emptyClip=l;function h(d){const u=d?.duration??.3;let f={x:1,y:1,z:1};d?.scale!==void 0&&(typeof d.scale=="number"?f={x:d.scale,y:d.scale,z:d.scale}:f=d.scale);const m=d?.type??"linear",g=d?.scaleFactor??1.2,b=new Array,y=new Array;switch(m){case"linear":b.push(0,u),y.push(f.x,f.y,f.z,f.x*g,f.y*g,f.z*g);break;case"spring":b.push(0,u*.3,u*.5,u*.7,u*.9,u),y.push(f.x,f.y,f.z,f.x*g,f.y*g,f.z*g,f.x*.9,f.y*.9,f.z*.9,f.x*1.05,f.y*1.05,f.z*1.05,f.x*.98,f.y*.98,f.z*.98,f.x,f.y,f.z);break}const _=new c.KeyframeTrack(".scale",b,y);return new c.AnimationClip("scale",b[b.length-1],[_])}s.createScaleClip=h})(exports.AnimationUtils||(exports.AnimationUtils={}));const Ue=function(s){return p(s)},p=function(s){if(s===void 0&&(s=null),!Array.isArray(s))s=Y_(s);else for(let e=0;e<s.length;e++){const t=s[e];s[e]=Y_(t)}return function(e,t){if(!e){const n=typeof t=="string"?t:t.name;console.warn(`@serializable without a target at '${n}'.`);return}typeof t!="string"&&(t=t.name),Object.getOwnPropertyDescriptor(e,"$serializedTypes")||(e.$serializedTypes={});const i=e.$serializedTypes=e.$serializedTypes||{};i[t]=s}};function Y_(s){switch(s?.prototype?.constructor?.name){case"Number":case"String":case"Boolean":return null}return s}const K_=x("debugcomponentevents");class Uu{static eventListeners=new Map;static addComponentLifecylceEventListener(e,t){this.eventListeners.has(e)&&this.eventListeners.set(e,[]);let i=this.eventListeners.get(e);i||(i=[]),i.push(t),this.eventListeners.set(e,i),K_&&console.log("Added event listener for "+e,this.eventListeners)}static removeComponentLifecylceEventListener(e,t){const i=this.eventListeners.get(e);if(!i)return;const n=i.indexOf(t);n<0||i.splice(n,1)}static dispatchComponentLifecycleEvent(e,t){const i=this.eventListeners.get(e);if(K_&&console.log("Dispatching event "+e,i),!!i)for(const n of i)n(t)}}const B0=x("debugdefines");vo('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";');vo('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');vo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');vo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');vo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "5.1.0-beta.1";');vo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');vo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Tue Jun 09 2026 16:30:29 GMT+0000 (Coordinated Universal Time)";');vo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const ci="5.1.0-beta.1",Ba="undefined",Mc="Tue Jun 09 2026 16:30:29 GMT+0000 (Coordinated Universal Time)";B0&&console.log(`Engine version: ${ci} (generator: ${Ba})
144
144
  Project built at ${Mc}`);const ro=NEEDLE_PUBLIC_KEY,zn="needle_isActiveInHierarchy",Qo="builtin_components",hc="needle_editor_guid";function vo(s){try{(0,eval)(s)}catch(e){B0&&console.error(e)}}globalThis.NEEDLE_USE_RAPIER=globalThis.NEEDLE_USE_RAPIER!==void 0?globalThis.NEEDLE_USE_RAPIER:!0;globalThis.NEEDLE_USE_POSTPROCESSING=globalThis.NEEDLE_USE_POSTPROCESSING!==void 0?globalThis.NEEDLE_USE_POSTPROCESSING:!0;const Ag={experimentalSmartHierarchyUpdate:!1},_i=Symbol("shadowDomOwner"),$1=x("debugpatch");function zu(s,e,t,i){const n=$1===e;if(!t&&!i)return;const o=e+"___needle";W1(s,e,t,i);const r=Object.getOwnPropertyDescriptor(s,e),a=s[e];n&&console.log("Patch",s.constructor.name,e,r,a),r?(n&&console.log("Apply patch with existing descriptor",s.constructor.name,e,r),typeof r.value=="function"&&(s[e]=J_(r.value,s,e))):(n&&console.log("Create patch with new property",s.constructor.name,e,r),Object.defineProperty(s,e,{set:function(l){if(typeof l=="function")this[o]=J_(l,s,e);else{const h=this[o];F0(s,e,this,h,l),this[o]=l,U0(s,e,this,h,l)}},get:function(){const l=this[o];return typeof l=="function"&&l[o]?l[o]:l}}))}function V1(s,e,t){const i=Dg(s,e);if(i)for(let n=i.length-1;n>=0;n--){const o=i[n];o.prefix===t&&(o.prefix=null),o.postfix===t&&(o.postfix=null),!o.prefix&&!o.postfix&&i.splice(n,1)}}const Z_=Symbol("Needle:Patches:WrappedFunction");function J_(s,e,t){if(s[Z_])return s;const i=function(...n){F0(e,t,this,...n);const o=s.apply(this,n);return U0(e,t,this,o,...n),o};return i[Z_]=!0,i}const Id="Needle:Patches";function ym(){return globalThis[Id]||(globalThis[Id]=new WeakMap),globalThis[Id]}function Dg(s,e){const t=ym().get(s);return t?t.get(e):null}function W1(s,e,t,i){let n=ym().get(s);n||(n=new Map,ym().set(s,n));let o=n.get(e);o||(o=[],n.set(e,o)),o.push({prefix:t,postfix:i})}function F0(s,e,t,...i){if(!t)return;const n=Dg(s,e);if(n)for(const o of n)o.prefix?.call(t,...i)}function U0(s,e,t,i,...n){if(!t)return;const o=Dg(s,e);if(o)for(const r of o)r.postfix?.call(t,i,...n)}function G1(s,e){if(typeof window!==void 0&&window.SPECTOR){console.log(window.SPECTOR);const t=new URLSearchParams(window.location.search);if(t.has("spector")){let i=function(){if(n>s.time.frame)return window.requestAnimationFrame(()=>i());const r=o.captureCanvas(e);r&&r instanceof Promise?r.then(()=>o.displayUI()):o.displayUI()};const n=Number.parseInt(t.get("spector")||"0")||0;console.log("Scheduled Spector capture at frame #"+n);const o=new window.SPECTOR.Spector;o.spyCanvases=!0,i();return}else T()&&console.debug("Spector available: Add '?spector=<frame>' to the URL to enable it and capture a frame.")}}function z0(s){const e=s;return!!(e.parser&&e.parser.json)}var Nu=(s=>(s[s.None=0]="None",s[s.DontExport=1]="DontExport",s))(Nu||{});const lu=Symbol("component-name");function $u(s){return s&&typeof s=="object"&&s.isComponent}const H1=Symbol("object"),op=new xi(()=>new c.Vector3,20);class N0{_point;_normal;_tangentVelocity;distance;impulse;friction;get point(){return op.get().set(this._point.x,this._point.y,this._point.z)}get normal(){return op.get().set(this._normal.x,this._normal.y,this._normal.z)}get tangentVelocity(){return op.get().set(this._tangentVelocity.x,this._tangentVelocity.y,this._tangentVelocity.z)}constructor(e,t,i,n,o,r){this._point=e,this.distance=t,this._normal=i,this.impulse=n,this.friction=o,this._tangentVelocity=r}}class $0{contacts;constructor(e,t,i){this.me=e,this._collider=t,this._gameObject=t.gameObject,this.contacts=i}me;_collider;get collider(){return this._collider}_gameObject;get gameObject(){return this._gameObject}get rigidBody(){return this.collider?.attachedRigidbody}}class V0{object;collider;constructor(e,t){this.object=e,this.collider=t}}class cu{constructor(e){this.context=e,this.root.style.cssText=`
145
145
  position: absolute;
146
146
  width: 1px; height: 1px;
@@ -880,7 +880,7 @@ Possible solutions:
880
880
  Render:`,{shaders:this.renderer.info.programs?.length,...this.renderer.info.render},`
881
881
  Memory:`,{usedMemory:t,...this.renderer.info.memory},`
882
882
  Renderer:`,{dpr:this.renderer.getPixelRatio(),windowDpr:window.devicePixelRatio,antialias:i.getContextAttributes()?.antialias,samples:i.getParameter(i.SAMPLES),resolution:`${this.renderer.domElement.width}x${this.renderer.domElement.height}`},`
883
- Target Framerate: `+this.targetFrameRate)}}this._dispatchReadyAfterFrame&&(this._dispatchReadyAfterFrame=!1,this.domElement.dispatchEvent(new CustomEvent("ready")),ae.dispatchCallback(le.ContextFirstFrameRendered,this))}_tempClearColor=new c.Color;_tempClearColor2=new c.Color;renderNow(e){if(!e&&(e=this.mainCamera,!e))return!1;if(this.handleRendererContextLost(),this._isRendering=!0,this.renderRequiredTextures(),this.renderer.toneMapping!==c.NoToneMapping&&Tw(),this.postprocessing.update(),this.composer&&!this.isInXR){e&&"setMainCamera"in this.composer&&this.composer.passes[0]?.mainCamera!=e&&this.composer.setMainCamera(e);const t=this.renderer.getClearColor(this._tempClearColor),i=this.renderer.getClearAlpha();this._tempClearColor2.copy(t),this.renderer.setClearColor(t.convertSRGBToLinear(),this.renderer.getClearAlpha()),this.composer.render(this.time.deltaTime),this.renderer.setClearColor(this._tempClearColor2,i)}else e&&(this.isInXR&&exports.DeviceUtilities.isMacOS()&&this.renderer.clearDepth(),this.renderer.render(this.scene,e));return this._isRendering=!1,!0}_contextRestoreTries=0;handleRendererContextLost(){this.time.frame%10&&this.renderer.getContext().isContextLost()&&this._contextRestoreTries++<100&&(console.warn("Attempting to recover WebGL context..."),this.renderer.forceContextRestore())}_wasPaused=!1;onHandlePaused(){const e=this.evaluatePaused();if(this._wasPaused!==e){Tk&&console.log("Paused?",e,"context:"+this.alias);for(let t=0;t<this.scripts_pausedChanged.length;t++){const i=this.scripts_pausedChanged[t];i.activeAndEnabled&&i.onPausedChanged!==void 0&&(U.Current=this,i.onPausedChanged(e,this._wasPaused))}}return this._wasPaused=e,e}evaluatePaused(){return this.isInXR?!1:this.isPaused?!0:this.runInBackground?!1:!this.isVisibleToUser}renderRequiredTextures(){if(!this.mainCamera||!this._requireDepthTexture&&!this._requireColorTexture)return;if(!this._renderTarget){if(this._renderTarget=new c.WebGLRenderTarget(this.domWidth,this.domHeight),this._requireDepthTexture){const i=new c.DepthTexture(this.domWidth,this.domHeight);this._renderTarget.depthTexture=i}this._requireColorTexture&&(this._renderTarget.texture=new c.Texture,this._renderTarget.texture.generateMipmaps=!1,this._renderTarget.texture.minFilter=c.NearestFilter,this._renderTarget.texture.magFilter=c.NearestFilter,this._renderTarget.texture.format=c.RGBAFormat)}const e=this._renderTarget;e.texture&&(e.texture.colorSpace=this.renderer.outputColorSpace);const t=this.renderer.getRenderTarget();this.renderer.setRenderTarget(e),this.renderer.render(this.scene,this.mainCamera),this.renderer.setRenderTarget(t)}executeCoroutines(e){if(this.coroutines[e]){const i=this.coroutines[e];for(let n=0;n<i.length;n++)try{const o=i[n];if(!o.comp||o.comp.destroyed||!o.main||o.comp.enabled===!1){Ak&&console.log("Removing coroutine",o.comp,o.comp.enabled),i.splice(n,1),--n;continue}const a=o.chained;if(a&&a.length>0){const u=a[a.length-1].next();if(u.done&&a.pop(),t(u)&&(o.chained||(o.chained=[]),o.chained.push(u.value)),!u.done)continue}const l=o.main.next();if(l.done===!0){i.splice(n,1),--n;continue}const h=l.value;if(t(h)){if(h.next().done)continue;o.chained||(o.chained=[]),o.chained.push(h)}else if(h instanceof Promise){const d=h;o.chained||(o.chained=[]);const u=fw(d);o.chained?.push(u);continue}}catch(o){console.error(o)}}function t(i){return!!(i&&i.next&&i.return)}}}const _p=x("debugwebxr");class Ww{static tryFindAvatarObjects(e,t,i){if(i.head&&i.leftHand&&i.rightHand)return;const n=e.name.toLocaleLowerCase();!i.head&&n.includes("head")&&(_p&&console.log("FOUND AVATAR HEAD",e.name),i.head=new Y("",t,e)),n.includes("hand")&&(!i.leftHand&&n.includes("left")&&(_p&&console.log("FOUND AVATAR LEFT HAND",e.name),i.leftHand=new Y("",t,e)),!i.rightHand&&n.includes("right")&&(_p&&console.log("FOUND AVATAR RIGHT HAND",e.name),i.rightHand=new Y("",t,e)));for(let o=0;o<e.children.length;o++){if(i.head&&i.leftHand&&i.rightHand)return;const r=e.children[o];this.tryFindAvatarObjects(r,t,i)}}}class ie extends c.Color{alpha=1;get isRGBAColor(){return!0}set a(e){this.alpha=e}get a(){return this.alpha}constructor(e,t,i,n){super(),typeof e=="number"&&typeof t=="number"&&typeof i=="number"?(this.set(e,t,i),this.alpha=typeof n=="number"?n:1):e!==void 0&&(this.set(e),this.alpha=1)}clone(){const e=super.clone();return e.alpha=this.alpha,e}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,"alpha"in e&&typeof e.alpha=="number"?this.alpha=e.alpha:typeof e.a=="number"&&(this.alpha=e.a),this}lerp(e,t){const i=e;return i.alpha!=null&&(this.alpha=L.lerp(this.alpha,i.alpha,t)),super.lerp(e,t)}lerpColors(e,t,i){const n=e,o=t;return n.alpha!=null&&o.alpha!=null&&(this.alpha=L.lerp(n.alpha,o.alpha,i)),super.lerpColors(e,t,i)}multiply(e){const t=e;return t.alpha!=null&&(this.alpha=this.alpha*t.alpha),super.multiply(e)}fromArray(e,t=0){return this.alpha=e[t+3],super.fromArray(e,t)}static fromColorRepresentation(e){if(typeof e=="string"){if(e.trim()==="transparent")return new ie(0,0,0,0);if(e.startsWith("#")&&e.length===9){const t=parseInt(e.slice(1,9),16),i=t>>24&255,n=t>>16&255,o=t>>8&255,r=t>>0&255;return new ie(i/255,n/255,o/255,r/255)}else if(e.startsWith("#")){const t=parseInt(e.slice(1),16),i=t>>16&255,n=t>>8&255,o=t>>0&255;return new ie(i/255,n/255,o/255,1)}else if(e.startsWith("rgba")){const t=e.slice(5,-1).split(",").map(Number);return new ie(t[0]/255,t[1]/255,t[2]/255,t[3])}else if(e.startsWith("rgb")){const t=e.slice(4,-1).split(",").map(Number);return new ie(t[0]/255,t[1]/255,t[2]/255,1)}}else if(Array.isArray(e)){if(e.length===4)return new ie(e[0],e[1],e[2],e[3]);if(e.length===3)return new ie(e[0],e[1],e[2],1);console.error("Invalid color array length. Expected 3 or 4, got "+e.length)}return new ie(e)}}const Tt=new c.Vector3,Mb=new c.Vector3,Eb=new c.Quaternion,Lk=x("debuggizmos"),an=8947848,bp=32;class B{constructor(){}static enabled=!0;static isGizmo(e){return e[Am]!==void 0}static setVisible(e){for(const t of ji.timedObjectsBuffer)t.visible=e}static DrawLabel(e,t,i=.05,n=0,o,r,a){if(!B.enabled)return null;o||(o=an);const l=H.active?.rigScale??1,h=ji.getTextLabel(n,t,i*l,o,r);return a instanceof c.Object3D&&a.add(h),h.position.x=e.x,h.position.y=e.y,h.position.z=e.z,h}static DrawRay(e,t,i=an,n=0,o=!0){if(!B.enabled)return;const r=ji.getLine(n),a=r.geometry.getAttribute("position");a.setXYZ(0,e.x,e.y,e.z),Tt.set(t.x,t.y,t.z).multiplyScalar(999999999),a.setXYZ(1,e.x+Tt.x,e.y+Tt.y,e.z+Tt.z),a.needsUpdate=!0,r.material.depthTest=o,r.material.depthWrite=!1,r.material.fog=!1,cn(r.material,i)}static DrawDirection(e,t,i=an,n=0,o=!0,r=1){if(!B.enabled)return;const a=ji.getLine(n),l=a.geometry.getAttribute("position");l.setXYZ(0,e.x,e.y,e.z),t.w!==void 0?(Tt.set(0,0,-r),Eb.set(t.x,t.y,t.z,t.w),Tt.applyQuaternion(Eb)):(Tt.set(t.x,t.y,t.z),Tt.multiplyScalar(r)),l.setXYZ(1,e.x+Tt.x,e.y+Tt.y,e.z+Tt.z),l.needsUpdate=!0,a.material.depthTest=o,a.material.depthWrite=!1,cn(a.material,i)}static DrawLine(e,t,i=an,n=0,o=!0){if(!B.enabled)return;const r=ji.getLine(n),a=r.geometry.getAttribute("position");a.setXYZ(0,e.x,e.y,e.z),a.setXYZ(1,t.x,t.y,t.z),a.needsUpdate=!0,r.material.depthTest=o,r.material.depthWrite=!1,r.material.fog=!1,cn(r.material,i)}static DrawCircle(e,t,i,n=an,o=0,r=!0){if(!B.enabled)return;const a=ji.getCircle(o);a.position.set(e.x,e.y,e.z),a.scale.set(i,i,i),a.quaternion.setFromUnitVectors(this._up,Tt.set(t.x,t.y,t.z).normalize()),a.material.depthTest=r,a.material.depthWrite=!1,a.material.fog=!1,cn(a.material,n)}static DrawWireSphere(e,t,i=an,n=0,o=!0){if(!B.enabled)return;const r=ji.getSphere(t,n,!0);fr(r,e.x,e.y,e.z),r.material.depthTest=o,r.material.depthWrite=!1,r.material.fog=!1,cn(r.material,i)}static DrawSphere(e,t,i=an,n=0,o=!0){if(!B.enabled)return;const r=ji.getSphere(t,n,!1);fr(r,e.x,e.y,e.z),r.material.depthTest=o,r.material.depthWrite=!1,cn(r.material,i)}static DrawWireBox(e,t,i=an,n=0,o=!0,r=void 0){if(!B.enabled)return;const a=ji.getBox(n);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.depthTest=o,a.material.wireframe=!0,a.material.depthWrite=!1,a.material.fog=!1,cn(a.material,i)}static DrawWireBox3(e,t=an,i=0,n=!0){if(!B.enabled)return;const o=ji.getBox(i);o.position.copy(e.getCenter(Tt)),o.scale.copy(e.getSize(Tt)),o.material.depthTest=n,o.material.wireframe=!0,o.material.depthWrite=!1,o.material.fog=!1,cn(o.material,t)}static _up=new c.Vector3(0,1,0);static DrawArrow(e,t,i=an,n=0,o=!0,r=!1){if(!B.enabled)return;const a=ji.getArrowHead(n);a.position.set(t.x,t.y,t.z),a.quaternion.setFromUnitVectors(this._up.set(0,1,0),Tt.set(t.x,t.y,t.z).sub(Mb.set(e.x,e.y,e.z)).normalize());const h=Tt.set(t.x,t.y,t.z).sub(Mb.set(e.x,e.y,e.z)).length()*.1;a.scale.set(h,h,h),a.material.depthTest=o,a.material.wireframe=r,cn(a.material,i),this.DrawLine(e,t,i,n,o)}static DrawWireMesh(e){const t=ji.getMesh(e.duration??0);"mesh"in e?(t.geometry=e.mesh.geometry,t.matrixWorld.copy(e.mesh.matrixWorld)):(t.geometry=e.geometry,t.matrixWorld.copy(e.matrix)),t.matrixAutoUpdate=!1,t.matrixWorldAutoUpdate=!1,t.material.depthTest=e.depthTest??!0,t.material.wireframe=!0,cn(t.material,e.color??an)}}const jk=new c.BoxGeometry(1,1,1);function Kg(s=null){const e=new c.Color(s??14540253),t=new c.EdgesGeometry(jk);return new c.LineSegments(t,new c.LineBasicMaterial({color:e}))}function cn(s,e){if(Array.isArray(s)){for(const i of s)cn(i,e);return}const t=e instanceof ie?e.a:1;s.color.set(e),s.opacity=t,s.transparent=t<1}const Am=Symbol("GizmoCache");class ji{static familyName="needle-gizmos";static ensureFont(){let e=se.__webpack_exports__default.FontLibrary.getFontFamily(this.familyName);e||(e=se.__webpack_exports__default.FontLibrary.addFontFamily(this.familyName),e.addVariant("normal","normal","https://cdn.needle.tools/static/fonts/msdf/arial/arial-msdf.json","https://cdn.needle.tools/static/fonts/msdf/arial/arial.png")?.addEventListener("ready",()=>{se.__webpack_exports__default.update()}))}static getTextLabel(e,t,i,n,o){this.ensureFont();let r=this.textLabelCache.pop(),a=1;o&&typeof o=="string"&&o?.length>=8&&o.startsWith("#")?(a=parseInt(o.substring(7),16)/255,o=o.substring(0,7),Lk&&console.log(o,a)):typeof o=="object"&&o.a!==void 0&&(a=o.a);const l={boxSizing:"border-box",fontFamily:this.familyName,width:"auto",fontSize:i,color:n,lineHeight:1,backgroundColor:o??void 0,backgroundOpacity:a,textContent:t,borderRadius:.5*i,padding:.8*i,whiteSpace:"pre",offset:.05*i};if(r)r.set(l);else{r=new se.__webpack_exports__Text(l);const h=this,d=r;d.setText=function(u){this.set({textContent:u}),h.tmuiNeedsUpdate=!0}}return this.tmuiNeedsUpdate=!0,this.registerTimedObject(U.Current,r,e,this.textLabelCache),r}static getBox(e){let t=this.boxesCache.pop();if(!t){const i=new c.BoxGeometry(1,1,1);t=new c.Mesh(i)}return this.registerTimedObject(U.Current,t,e,this.boxesCache),t}static getLine(e){let t=this.linesCache.pop();if(!t){t=new c.Line;let i=t.geometry.getAttribute("position");i||(i=new c.BufferAttribute(new Float32Array(6),3),t.geometry.setAttribute("position",i))}return t.frustumCulled=!1,this.registerTimedObject(U.Current,t,e,this.linesCache),t}static getCircle(e){let t=this.circlesCache.pop();if(!t){t=new c.Line;let i=t.geometry.getAttribute("position");if(!i){i=new c.BufferAttribute(new Float32Array(bp*3),3),t.geometry.setAttribute("position",i);const n=j(0,1,0),o=j(0,0,1),r=j(o);r.cross(n).normalize();const a=j(r),l=Math.PI*2/(bp-1);for(let h=0;h<bp+1;h++){const d=l*h;n.copy(a).multiplyScalar(Math.cos(d)*1),r.copy(o).multiplyScalar(Math.sin(d)*1);const u=n.add(r);i.setXYZ(h,u.x,u.y,u.z)}}}return t.frustumCulled=!1,this.registerTimedObject(U.Current,t,e,this.circlesCache),t}static getSphere(e,t,i){let n=this.spheresCache.pop();return n||(n=new c.Mesh(new c.SphereGeometry(1,8,8))),n.scale.set(e,e,e),n.material.wireframe=i,this.registerTimedObject(U.Current,n,t,this.spheresCache),n}static getArrowHead(e){let t=this.arrowHeadsCache.pop();return t||(t=new c.Mesh(new c.CylinderGeometry(0,.5,1,8))),this.registerTimedObject(U.Current,t,e,this.arrowHeadsCache),t}static getMesh(e){let t=this.mesh.pop();return t||(t=new c.Mesh,t.material=new c.MeshBasicMaterial),this.registerTimedObject(U.Current,t,e,this.mesh),t}static linesCache=[];static circlesCache=[];static spheresCache=[];static boxesCache=[];static arrowHeadsCache=[];static mesh=[];static textLabelCache=[];static registerTimedObject(e,t,i,n){if(!e){console.error("No Needle Engine context available. Did you call a Gizmos function in global scope?");return}const o=this.contextBeforeRenderCallbacks.get(e),r=this.contextPostRenderCallbacks.get(e);if(o){if(e.pre_render_callbacks[e.pre_render_callbacks.length-1]!==o){const a=e.pre_render_callbacks.indexOf(o);a>=0&&e.pre_render_callbacks.splice(a,1),e.pre_render_callbacks.push(o)}}else{const a=()=>{this.onBeforeRender(e,this.timedObjectsBuffer)};this.contextBeforeRenderCallbacks.set(e,a),e.pre_render_callbacks.push(a)}if(r){if(e.post_render_callbacks[e.post_render_callbacks.length-1]!==r){const a=e.post_render_callbacks.indexOf(r);a>=0&&e.post_render_callbacks.splice(a,1),e.post_render_callbacks.push(r)}}else{const a=()=>{this.onPostRender(e,this.timedObjectsBuffer,this.timesBuffer)};this.contextPostRenderCallbacks.set(e,a),e.post_render_callbacks.push(a)}t.traverse(a=>{a.layers.disableAll(),a.layers.enable(2)}),t.renderOrder=999999,t[Am]=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)}static timedObjectsBuffer=new Array;static timesBuffer=new Array;static contextPostRenderCallbacks=new Map;static contextBeforeRenderCallbacks=new Map;static tmuiNeedsUpdate=!1;static onBeforeRender(e,t){this.tmuiNeedsUpdate&&(this.tmuiNeedsUpdate=!1,se.__webpack_exports__default.update());for(let i=0;i<t.length;i++){const n=t[i];if(e.mainCamera&&n instanceof se.__webpack_exports__default.MeshUIBaseElement){if(mr(n))continue;const o=e.isInVR,r=!1,a=!o;Zc(n,e.mainCamera,r,a)}}}static onPostRender(e,t,i){const n=e.time.realtimeSinceStartup;for(let o=t.length-1;o>=0;o--){const r=t[o];n>=i[o]-1e-6&&(t.splice(o,1),i.splice(o,1),r.removeFromParent(),mr(r)!=!0&&r[Am].push(r))}}}const Gt=x("debugphysics"),Bk=x("debugworker"),Tb=new c.Layers;class Sr{static AllLayers=4294967295;ray;cam;screenPoint;raycaster;results;targets;recursive=!0;minDistance;maxDistance;lineThreshold;layerMask;ignore;testObject;useAcceleratedRaycast;allowSlowRaycastFallback=!0;screenPointFromOffset(e,t){this.screenPoint===void 0&&(this.screenPoint=new c.Vector2),this.screenPoint.x=e/window.innerWidth*2-1,this.screenPoint.y=-(t/window.innerHeight)*2+1}setLayer(e){Tb.set(e),this.layerMask=Tb}setMask(e){this.layerMask||(this.layerMask=new c.Layers);const t=this.layerMask;t?t.mask=e:this.layerMask=e}}class Zg{distance;point;object;constructor(e,t,i){this.object=e,this.distance=t,this.point=i}}class Wa{static _raycasting=0;static get raycasting(){return this._raycasting>0}raycastPhysicsFast(e,t=void 0,i=1/0,n=!0){return this.context.physics.engine?.raycast(e,t,{maxDistance:i,solid:n})??null}raycastPhysicsFastAndGetNormal(e,t=void 0,i=1/0,n=!0){return this.context.physics.engine?.raycastAndGetNormal(e,t,{maxDistance:i,solid:n})??null}sphereOverlapPhysics(e,t){return this.context.physics.engine?.sphereOverlap(e,t)??null}context;engine;constructor(e){this.context=e}raycaster=new c.Raycaster;defaultRaycastOptions=new Sr;targetBuffer=new Array(1);defaultThresholds={Mesh:{},Line:{threshold:-1},LOD:{},Points:{threshold:0},Sprite:{}};sphereResults=new Array;sphereMask=new c.Layers;sphere=new c.Sphere;sphereOverlap(e,t,i=!0,n=!1,o=null){if(this.sphereResults.length=0,!this.context.scene)return this.sphereResults;const r=this.sphereMask;r.enableAll(),r.disable(2);for(const a of this.context.scene.children)this.intersectSphere(a,e,t,r,this.sphereResults,i,n,o);return this.sphereResults.sort((a,l)=>a.distance-l.distance)}raycastFromRay(e,t=null){const i=t??this.defaultRaycastOptions;i.ray=e;const n=this.raycast(i);return i===this.defaultRaycastOptions&&(i.ray=void 0),n}raycast(e=null){Gt&&performance.mark("raycast.start"),e||(e=this.defaultRaycastOptions);const t=e.screenPoint??this.context.input.mousePositionRC,i=e.raycaster??this.raycaster;if(i.near=e.minDistance??0,i.far=e.maxDistance??1/0,i.params=this.defaultThresholds,e.lineThreshold===void 0&&(e.lineThreshold=-1),i.params.Line={threshold:e.lineThreshold},e.ray)i.ray.copy(e.ray);else{const a=e.cam??this.context.mainCamera;if(!a)return Gt&&console.error("Can not perform raycast - no main camera found"),this.defaultRaycastOptions.results&&(this.defaultRaycastOptions.results.length=0),this.defaultRaycastOptions.results??[];const l=this.context.xrCamera;this.context.isInXR&&l instanceof c.ArrayCamera&&l.cameras.length>0?i.setFromCamera(t,l.cameras[0]):i.setFromCamera(t,a)}let n=e.targets;n||(n=this.targetBuffer,n.length=1,n[0]=this.context.scene);let o=e.results;this.defaultRaycastOptions.results&&(this.defaultRaycastOptions.results.length=0),o||(this.defaultRaycastOptions.results||(this.defaultRaycastOptions.results=new Array),o=this.defaultRaycastOptions.results),e.layerMask!==void 0?e.layerMask instanceof c.Layers?i.layers.mask=e.layerMask.mask:i.layers.mask=e.layerMask:(i.layers.enableAll(),i.layers.disable(2)),Gt&&console.time("raycast"),o.length=0,Wa._raycasting++,this.intersect(this.raycaster,n,o,e),o.sort((a,l)=>a.distance-l.distance);const r=e.ignore;return r!==void 0&&r.length>0&&(o=o.filter(a=>!r.includes(a.object))),Wa._raycasting--,Gt&&(console.timeEnd("raycast"),console.warn("#"+this.context.time.frame+", hits:",o?.length?[...o]:"nothing"),performance.mark("raycast.end"),performance.measure("raycast","raycast.start","raycast.end")),o}intersect(e,t,i,n){for(const o of t){if(!o||o.visible===!1||B.isGizmo(o)||n.lineThreshold!==void 0&&n.lineThreshold<0&&o instanceof c.Line)continue;let r=!0;const a=o,l=a.geometry;if(o.raycastAllowed===!1&&(r=!1),r&&n.testObject){const h=n.testObject?.(o);if(h===!1)continue;h==="continue in children"&&(r=!1)}else r&&(l&&Rb(l)||(r=!1));if(r){const h=i.length,d=o.raycastPreference||"lod";let u=d!=="bounds";if(n.precise===!1&&(u=!1),l&&(u||=l.getAttribute("position")?.array?.length<64),a instanceof X.GroundedSkybox&&(u=!1),d==="lod"){const f=ne.getRaycastMesh(o);f&&(a.geometry=f)}if(!u&&Uk(a,e,i)||(n.useAcceleratedRaycast!==!1?yu.runMeshBVHRaycast(e,a,i,this.context,n):e.intersectObject(a,!1,i)),a.geometry=l,Gt&&i.length!=h){const f=i[i.length-1];B.DrawWireSphere(f.point,.1,7798784,1,!1),B.DrawWireMesh({mesh:o,depthTest:!1,duration:.2,color:7798784})}}n.recursive!==!1&&this.intersect(e,o.children,i,n)}return i}tempBoundingBox=new c.Box3;intersectSphere(e,t,i,n,o,r,a,l){let h=e&&e.isMesh&&e.layers.test(n)&&!B.isGizmo(e);h&&=e.visible,h&&=!(e instanceof c.Line),h&&=!(e instanceof X.GroundedSkybox);const d=e,u=d.geometry;if(h&&l){const f=l(e);if(f===!1)return;f==="continue in children"&&(h=!1)}if(u&&Rb(u)||(h=!1),h){if(a){const f=this.sphere;f.center.copy(t),f.radius=i;const m=o.length;if(yu.runMeshBVHRaycast(this.sphere,d,o,this.context,{}),m!=o.length&&!r)return}else if(u.boundingBox||u.computeBoundingBox(),u.boundingBox){d.matrixWorldNeedsUpdate&&d.updateWorldMatrix(!1,!1);const f=this.tempBoundingBox.copy(u.boundingBox).applyMatrix4(d.matrixWorld),m=this.sphere;if(m.center.copy(t),m.radius=i,m.intersectsBox(f)){const g=ee(e),b=g.distanceTo(m.center),y=new Zg(e,b,g);if(o.push(y),!r)return}}}if(e.children)for(const f of e.children){const m=o.length;if(this.intersectSphere(f,t,i,n,o,r,a,l),m!=o.length&&!r)return}}}function Rb(s){return!(s.index&&s.index.array.length<3)}const Uo=new c.Sphere,id=new c.Plane,Fk=new c.Matrix3;function Uk(s,e,t){const i=s._computeIntersections;if(!i)return!1;let n=s["_computeIntersections:Needle"];return n||(n=s["_computeIntersections:Needle"]=function(o,r,a){const l=this,h=l.geometry.boundingSphere;if(h){if(l instanceof X.GroundedSkybox){id.setFromNormalAndCoplanarPoint(j(0,1,0),j(0,-l.position.y,0)),id.applyMatrix4(l.matrixWorld,Fk);const u=o.ray.intersectPlane(id,j());if(u){Uo.copy(h),Uo.applyMatrix4(l.matrixWorld);const m=j(u).sub(o.ray.origin).length(),g=Uo.radius*.5;m<g&&r.push({distance:m,point:u,object:l,normal:id.normal.clone()})}return}Uo.copy(h),Uo.applyMatrix4(l.matrixWorld);const d=o.ray.intersectSphere(Uo,j());if(d){const u=j(d).sub(o.ray.origin),f=u.length();if(f>Uo.radius){const m=u.clone().normalize();r.push({distance:f,point:d,object:l,normal:m})}}}}),s._computeIntersections=n,e.intersectObject(s,!1,t),s._computeIntersections=i,!0}var yu;(s=>{let e=0;function t(v,w,O,k,M){if(!w.geometry||!w.geometry.hasAttribute("position"))return!1;const D=w.geometry;if(w?.isSkinnedMesh){const I=w,F=I.bvhNeedsUpdate;if(!I.staticGenerator)l(),r&&(I.staticGenerator=new r(w),I.staticGenerator.applyWorldTransforms=!1,I.staticGeometry=I.staticGenerator.generate(),D.boundsTree=a?.call(I.staticGeometry),I.staticGeometryLastUpdate=performance.now()+Math.random()*200,I.bvhNeedsUpdate=!0);else if(D.boundsTree&&(I.autoUpdateMeshBvhInterval!==void 0&&I.autoUpdateMeshBvhInterval>=0||F===!0)){const V=performance.now(),G=V-I.staticGeometryLastUpdate,E=I.autoUpdateMeshBvhInterval??100;(F||G>E)&&(Gt&&console.warn(`Physics: updating skinned mesh bvh for ${w.name} after ${G.toFixed(2)}ms`),I.bvhNeedsUpdate=!1,I.staticGeometryLastUpdate=V,I.staticGenerator?.generate(I.staticGeometry),D.boundsTree.refit())}}else if(!D.boundsTree){d||_();let I=!0;if((k.xr||D[g]===!1||D.getAttribute("position")?.isInterleavedBufferAttribute||D.index&&D.index?.isInterleavedBufferAttribute||e>10)&&(I=!1),I&&f){if(D[m]===void 0){let F=null;if(y.length>0){const V=y.shift();V&&!V.running&&(F=V)}if(!F&&b.length<3)try{Bk&&console.warn("[GenerateMeshBVHWorker] Creating worker with import.meta.url:",typeof document>"u"?require("url").pathToFileURL(__filename).href:Pa&&Pa.tagName.toUpperCase()==="SCRIPT"&&Pa.src||new URL("needle-engine.bundle-CdVr_iIe.umd.cjs",document.baseURI).href),F=new f,b.push(F)}catch(V){V instanceof DOMException&&V.name==="SecurityError"?(console.warn("Failed to create MeshBVH worker, falling back to main thread generation. This can happen when running from file://, if the browser does not support workers or if the browser is blocking workers for other reasons."),console.debug(V),e+=10):(console.error("Failed to create MeshBVH worker. Please see below for more details:"),console.log(V)),e++}if(F!=null&&!F.running){const V=w.name;Gt&&console.log("<<<< worker start",V,F),D[m]="queued",performance.mark("bvh.create.start");const G=D.clone();try{F.generate(G).then(E=>{D[m]="done",D.boundsTree=E}).catch(E=>{D[m]="failed - "+E?.message,D[g]=!1,Gt&&console.error("Failed to generate mesh bvh on worker",E)}).finally(()=>{Gt&&console.log(">>>>> worker done",V,{hasBoundsTre:D.boundsTree!=null}),y.push(F),G.dispose(),performance.mark("bvh.create.end"),performance.measure("bvh.create (worker)","bvh.create.start","bvh.create.end")})}catch(E){console.error("Failed to generate mesh bvh on worker",E)}}else Gt&&console.warn("No worker available")}}else(!u||!I)&&(l(),o&&(performance.mark("bvh.create.start"),D.boundsTree=new o(D),performance.mark("bvh.create.end"),performance.measure("bvh.create","bvh.create.start","bvh.create.end")))}if(v instanceof c.Raycaster){const I=v,F=w.raycast;if(D.boundsTree)l(),n&&(w.acceleratedRaycast||(w.acceleratedRaycast=n.bind(w),Gt&&console.debug(`Physics: bind acceleratedRaycast fn to "${w.name}"`)),w.raycast=w.acceleratedRaycast);else if(Gt&&console.warn("No bounds tree found for mesh",w.name,{workerTask:D[m],hasAcceleratedRaycast:n!=null}),M.allowSlowRaycastFallback===!1&&(D.getAttribute("position")?.array?.length??0)>2e3)return Gt&&console.warn("Skipping raycast because no bounds tree is available and allowSlowRaycastFallback is false"),!1;const V=I.firstHitOnly;return I.firstHitOnly=!1,I.intersectObject(w,!1,O),I.firstHitOnly=V,w.raycast=F,!0}else if(v instanceof c.Sphere){const I=D.boundsTree;if(I){const F=v;if(h.copy(w.matrixWorld).invert(),F.applyMatrix4(h),I.intersectsSphere(F)){const G=ee(w),E=G.distanceTo(F.center),N=new Zg(w,E,G);O.push(N)}}return!0}return!1}s.runMeshBVHRaycast=t;let i=!1,n=null,o=null,r=null,a=null;function l(){i||(i=!0,Promise.resolve().then(()=>require("./vendor-1UvpPPSB.umd.cjs")).then(v=>v.index$1).then(v=>{n=v.acceleratedRaycast,o=v.MeshBVH,r=v.StaticGeometryGenerator,a=v.computeBoundsTree}).catch(v=>{(Gt||T())&&console.error("Failed to load BVH library...",v.message)}))}const h=new c.Matrix4;let d=!1,u=!1,f=null;const m=Symbol("Needle:MeshBVH-Worker"),g=Symbol("Needle:MeshBVH-CanUseWorker"),b=[],y=[];function _(){d=!0,u=!0,Promise.resolve().then(()=>BI).then(v=>{f=v.GenerateMeshBVHWorker}).catch(v=>{Gt||T()?console.warn("Failed to setup mesh bvh worker"):console.debug("Failed to setup mesh bvh worker",v)}).finally(()=>{u=!1})}})(yu||(yu={}));const Ab=Symbol("gltf-loader-internal-usage-tracker"),zk=x("debugusers");class Ra{get name(){return"NEEDLE_internal_usage_tracker"}static isLoading(e){return Ra._loadingProcesses>0}static _loadingProcesses=0;parser;_getDependency;_loadingId;_loadedObjects=new Set;constructor(e){this.parser=e,this._getDependency=this.parser.getDependency,this._loadingId=Date.now().toString()}beforeRoot(){Ra._loadingProcesses++;const e=this,t=this._getDependency;return this.parser.getDependency=function(i,n){const o=t.call(this,i,n);return o.then(r=>(r&&(e._loadedObjects.add(r),r[Ab]=e._loadingId),r)),o},null}afterRoot(e){Ra._loadingProcesses--,this.parser.getDependency=this._getDependency;for(const t of this._loadedObjects)delete t[Ab],t instanceof c.Object3D&&(t.parent||t instanceof c.Mesh&&setTimeout(()=>{zk&&console.warn("> GLTF LOADER: Mesh not used in scene!",t),t.material=null,t.geometry=null},1e3));return null}}class Gw{constructor(){window.addEventListener("unhandledrejection",e=>{if(e.defaultPrevented)return;const t=e?.reason?.path;if(t){const i=t[0];i&&i.tagName==="IMG"&&(console.warn(`Could not load image:
883
+ Target Framerate: `+this.targetFrameRate)}}this._dispatchReadyAfterFrame&&(this._dispatchReadyAfterFrame=!1,this.domElement.dispatchEvent(new CustomEvent("ready")),ae.dispatchCallback(le.ContextFirstFrameRendered,this))}_tempClearColor=new c.Color;_tempClearColor2=new c.Color;renderNow(e){if(!e&&(e=this.mainCamera,!e))return!1;if(this.handleRendererContextLost(),this._isRendering=!0,this.renderRequiredTextures(),this.renderer.toneMapping!==c.NoToneMapping&&Tw(),this.postprocessing.update(),this.composer&&!this.isInXR){e&&"setMainCamera"in this.composer&&this.composer.passes[0]?.mainCamera!=e&&this.composer.setMainCamera(e);const t=this.renderer.getClearColor(this._tempClearColor),i=this.renderer.getClearAlpha();this._tempClearColor2.copy(t),this.renderer.setClearColor(t.convertSRGBToLinear(),this.renderer.getClearAlpha()),this.composer.render(this.time.deltaTime),this.renderer.setClearColor(this._tempClearColor2,i)}else e&&(this.isInXR&&exports.DeviceUtilities.isMacOS()&&this.renderer.clearDepth(),this.renderer.render(this.scene,e));return this._isRendering=!1,!0}_contextRestoreTries=0;handleRendererContextLost(){this.time.frame%10&&this.renderer.getContext().isContextLost()&&this._contextRestoreTries++<100&&(console.warn("Attempting to recover WebGL context..."),this.renderer.forceContextRestore())}_wasPaused=!1;onHandlePaused(){const e=this.evaluatePaused();if(this._wasPaused!==e){Tk&&console.log("Paused?",e,"context:"+this.alias);for(let t=0;t<this.scripts_pausedChanged.length;t++){const i=this.scripts_pausedChanged[t];i.activeAndEnabled&&i.onPausedChanged!==void 0&&(U.Current=this,i.onPausedChanged(e,this._wasPaused))}}return this._wasPaused=e,e}evaluatePaused(){return this.isInXR?!1:this.isPaused?!0:this.runInBackground?!1:!this.isVisibleToUser}renderRequiredTextures(){if(!this.mainCamera||!this._requireDepthTexture&&!this._requireColorTexture)return;if(!this._renderTarget){if(this._renderTarget=new c.WebGLRenderTarget(this.domWidth,this.domHeight),this._requireDepthTexture){const i=new c.DepthTexture(this.domWidth,this.domHeight);this._renderTarget.depthTexture=i}this._requireColorTexture&&(this._renderTarget.texture=new c.Texture,this._renderTarget.texture.generateMipmaps=!1,this._renderTarget.texture.minFilter=c.NearestFilter,this._renderTarget.texture.magFilter=c.NearestFilter,this._renderTarget.texture.format=c.RGBAFormat)}const e=this._renderTarget;e.texture&&(e.texture.colorSpace=this.renderer.outputColorSpace);const t=this.renderer.getRenderTarget();this.renderer.setRenderTarget(e),this.renderer.render(this.scene,this.mainCamera),this.renderer.setRenderTarget(t)}executeCoroutines(e){if(this.coroutines[e]){const i=this.coroutines[e];for(let n=0;n<i.length;n++)try{const o=i[n];if(!o.comp||o.comp.destroyed||!o.main||o.comp.enabled===!1){Ak&&console.log("Removing coroutine",o.comp,o.comp.enabled),i.splice(n,1),--n;continue}const a=o.chained;if(a&&a.length>0){const u=a[a.length-1].next();if(u.done&&a.pop(),t(u)&&(o.chained||(o.chained=[]),o.chained.push(u.value)),!u.done)continue}const l=o.main.next();if(l.done===!0){i.splice(n,1),--n;continue}const h=l.value;if(t(h)){if(h.next().done)continue;o.chained||(o.chained=[]),o.chained.push(h)}else if(h instanceof Promise){const d=h;o.chained||(o.chained=[]);const u=fw(d);o.chained?.push(u);continue}}catch(o){console.error(o)}}function t(i){return!!(i&&i.next&&i.return)}}}const _p=x("debugwebxr");class Ww{static tryFindAvatarObjects(e,t,i){if(i.head&&i.leftHand&&i.rightHand)return;const n=e.name.toLocaleLowerCase();!i.head&&n.includes("head")&&(_p&&console.log("FOUND AVATAR HEAD",e.name),i.head=new Y("",t,e)),n.includes("hand")&&(!i.leftHand&&n.includes("left")&&(_p&&console.log("FOUND AVATAR LEFT HAND",e.name),i.leftHand=new Y("",t,e)),!i.rightHand&&n.includes("right")&&(_p&&console.log("FOUND AVATAR RIGHT HAND",e.name),i.rightHand=new Y("",t,e)));for(let o=0;o<e.children.length;o++){if(i.head&&i.leftHand&&i.rightHand)return;const r=e.children[o];this.tryFindAvatarObjects(r,t,i)}}}class ie extends c.Color{alpha=1;get isRGBAColor(){return!0}set a(e){this.alpha=e}get a(){return this.alpha}constructor(e,t,i,n){super(),typeof e=="number"&&typeof t=="number"&&typeof i=="number"?(this.set(e,t,i),this.alpha=typeof n=="number"?n:1):e!==void 0&&(this.set(e),this.alpha=1)}clone(){const e=super.clone();return e.alpha=this.alpha,e}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,"alpha"in e&&typeof e.alpha=="number"?this.alpha=e.alpha:typeof e.a=="number"&&(this.alpha=e.a),this}lerp(e,t){const i=e;return i.alpha!=null&&(this.alpha=L.lerp(this.alpha,i.alpha,t)),super.lerp(e,t)}lerpColors(e,t,i){const n=e,o=t;return n.alpha!=null&&o.alpha!=null&&(this.alpha=L.lerp(n.alpha,o.alpha,i)),super.lerpColors(e,t,i)}multiply(e){const t=e;return t.alpha!=null&&(this.alpha=this.alpha*t.alpha),super.multiply(e)}fromArray(e,t=0){return this.alpha=e[t+3],super.fromArray(e,t)}static fromColorRepresentation(e){if(typeof e=="string"){if(e.trim()==="transparent")return new ie(0,0,0,0);if(e.startsWith("#")&&e.length===9){const t=parseInt(e.slice(1,9),16),i=t>>24&255,n=t>>16&255,o=t>>8&255,r=t>>0&255;return new ie(i/255,n/255,o/255,r/255)}else if(e.startsWith("#")){const t=parseInt(e.slice(1),16),i=t>>16&255,n=t>>8&255,o=t>>0&255;return new ie(i/255,n/255,o/255,1)}else if(e.startsWith("rgba")){const t=e.slice(5,-1).split(",").map(Number);return new ie(t[0]/255,t[1]/255,t[2]/255,t[3])}else if(e.startsWith("rgb")){const t=e.slice(4,-1).split(",").map(Number);return new ie(t[0]/255,t[1]/255,t[2]/255,1)}}else if(Array.isArray(e)){if(e.length===4)return new ie(e[0],e[1],e[2],e[3]);if(e.length===3)return new ie(e[0],e[1],e[2],1);console.error("Invalid color array length. Expected 3 or 4, got "+e.length)}return new ie(e)}}const Tt=new c.Vector3,Mb=new c.Vector3,Eb=new c.Quaternion,Lk=x("debuggizmos"),an=8947848,bp=32;class B{constructor(){}static enabled=!0;static isGizmo(e){return e[Am]!==void 0}static setVisible(e){for(const t of ji.timedObjectsBuffer)t.visible=e}static DrawLabel(e,t,i=.05,n=0,o,r,a){if(!B.enabled)return null;o||(o=an);const l=H.active?.rigScale??1,h=ji.getTextLabel(n,t,i*l,o,r);return a instanceof c.Object3D&&a.add(h),h.position.x=e.x,h.position.y=e.y,h.position.z=e.z,h}static DrawRay(e,t,i=an,n=0,o=!0){if(!B.enabled)return;const r=ji.getLine(n),a=r.geometry.getAttribute("position");a.setXYZ(0,e.x,e.y,e.z),Tt.set(t.x,t.y,t.z).multiplyScalar(999999999),a.setXYZ(1,e.x+Tt.x,e.y+Tt.y,e.z+Tt.z),a.needsUpdate=!0,r.material.depthTest=o,r.material.depthWrite=!1,r.material.fog=!1,cn(r.material,i)}static DrawDirection(e,t,i=an,n=0,o=!0,r=1){if(!B.enabled)return;const a=ji.getLine(n),l=a.geometry.getAttribute("position");l.setXYZ(0,e.x,e.y,e.z),t.w!==void 0?(Tt.set(0,0,-r),Eb.set(t.x,t.y,t.z,t.w),Tt.applyQuaternion(Eb)):(Tt.set(t.x,t.y,t.z),Tt.multiplyScalar(r)),l.setXYZ(1,e.x+Tt.x,e.y+Tt.y,e.z+Tt.z),l.needsUpdate=!0,a.material.depthTest=o,a.material.depthWrite=!1,cn(a.material,i)}static DrawLine(e,t,i=an,n=0,o=!0){if(!B.enabled)return;const r=ji.getLine(n),a=r.geometry.getAttribute("position");a.setXYZ(0,e.x,e.y,e.z),a.setXYZ(1,t.x,t.y,t.z),a.needsUpdate=!0,r.material.depthTest=o,r.material.depthWrite=!1,r.material.fog=!1,cn(r.material,i)}static DrawCircle(e,t,i,n=an,o=0,r=!0){if(!B.enabled)return;const a=ji.getCircle(o);a.position.set(e.x,e.y,e.z),a.scale.set(i,i,i),a.quaternion.setFromUnitVectors(this._up,Tt.set(t.x,t.y,t.z).normalize()),a.material.depthTest=r,a.material.depthWrite=!1,a.material.fog=!1,cn(a.material,n)}static DrawWireSphere(e,t,i=an,n=0,o=!0){if(!B.enabled)return;const r=ji.getSphere(t,n,!0);fr(r,e.x,e.y,e.z),r.material.depthTest=o,r.material.depthWrite=!1,r.material.fog=!1,cn(r.material,i)}static DrawSphere(e,t,i=an,n=0,o=!0){if(!B.enabled)return;const r=ji.getSphere(t,n,!1);fr(r,e.x,e.y,e.z),r.material.depthTest=o,r.material.depthWrite=!1,cn(r.material,i)}static DrawWireBox(e,t,i=an,n=0,o=!0,r=void 0){if(!B.enabled)return;const a=ji.getBox(n);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.depthTest=o,a.material.wireframe=!0,a.material.depthWrite=!1,a.material.fog=!1,cn(a.material,i)}static DrawWireBox3(e,t=an,i=0,n=!0){if(!B.enabled)return;const o=ji.getBox(i);o.position.copy(e.getCenter(Tt)),o.scale.copy(e.getSize(Tt)),o.material.depthTest=n,o.material.wireframe=!0,o.material.depthWrite=!1,o.material.fog=!1,cn(o.material,t)}static _up=new c.Vector3(0,1,0);static DrawArrow(e,t,i=an,n=0,o=!0,r=!1){if(!B.enabled)return;const a=ji.getArrowHead(n);a.position.set(t.x,t.y,t.z),a.quaternion.setFromUnitVectors(this._up.set(0,1,0),Tt.set(t.x,t.y,t.z).sub(Mb.set(e.x,e.y,e.z)).normalize());const h=Tt.set(t.x,t.y,t.z).sub(Mb.set(e.x,e.y,e.z)).length()*.1;a.scale.set(h,h,h),a.material.depthTest=o,a.material.wireframe=r,cn(a.material,i),this.DrawLine(e,t,i,n,o)}static DrawWireMesh(e){const t=ji.getMesh(e.duration??0);"mesh"in e?(t.geometry=e.mesh.geometry,t.matrixWorld.copy(e.mesh.matrixWorld)):(t.geometry=e.geometry,t.matrixWorld.copy(e.matrix)),t.matrixAutoUpdate=!1,t.matrixWorldAutoUpdate=!1,t.material.depthTest=e.depthTest??!0,t.material.wireframe=!0,cn(t.material,e.color??an)}}const jk=new c.BoxGeometry(1,1,1);function Kg(s=null){const e=new c.Color(s??14540253),t=new c.EdgesGeometry(jk);return new c.LineSegments(t,new c.LineBasicMaterial({color:e}))}function cn(s,e){if(Array.isArray(s)){for(const i of s)cn(i,e);return}const t=e instanceof ie?e.a:1;s.color.set(e),s.opacity=t,s.transparent=t<1}const Am=Symbol("GizmoCache");class ji{static familyName="needle-gizmos";static ensureFont(){let e=se.__webpack_exports__default.FontLibrary.getFontFamily(this.familyName);e||(e=se.__webpack_exports__default.FontLibrary.addFontFamily(this.familyName),e.addVariant("normal","normal","https://cdn.needle.tools/static/fonts/msdf/arial/arial-msdf.json","https://cdn.needle.tools/static/fonts/msdf/arial/arial.png")?.addEventListener("ready",()=>{se.__webpack_exports__default.update()}))}static getTextLabel(e,t,i,n,o){this.ensureFont();let r=this.textLabelCache.pop(),a=1;o&&typeof o=="string"&&o?.length>=8&&o.startsWith("#")?(a=parseInt(o.substring(7),16)/255,o=o.substring(0,7),Lk&&console.log(o,a)):typeof o=="object"&&o.a!==void 0&&(a=o.a);const l={boxSizing:"border-box",fontFamily:this.familyName,width:"auto",fontSize:i,color:n,lineHeight:1,backgroundColor:o??void 0,backgroundOpacity:a,textContent:t,borderRadius:.5*i,padding:.8*i,whiteSpace:"pre",offset:.05*i};if(r)r.set(l);else{r=new se.__webpack_exports__Text(l);const h=this,d=r;d.setText=function(u){this.set({textContent:u}),h.tmuiNeedsUpdate=!0}}return this.tmuiNeedsUpdate=!0,this.registerTimedObject(U.Current,r,e,this.textLabelCache),r}static getBox(e){let t=this.boxesCache.pop();if(!t){const i=new c.BoxGeometry(1,1,1);t=new c.Mesh(i)}return this.registerTimedObject(U.Current,t,e,this.boxesCache),t}static getLine(e){let t=this.linesCache.pop();if(!t){t=new c.Line;let i=t.geometry.getAttribute("position");i||(i=new c.BufferAttribute(new Float32Array(6),3),t.geometry.setAttribute("position",i))}return t.frustumCulled=!1,this.registerTimedObject(U.Current,t,e,this.linesCache),t}static getCircle(e){let t=this.circlesCache.pop();if(!t){t=new c.Line;let i=t.geometry.getAttribute("position");if(!i){i=new c.BufferAttribute(new Float32Array(bp*3),3),t.geometry.setAttribute("position",i);const n=j(0,1,0),o=j(0,0,1),r=j(o);r.cross(n).normalize();const a=j(r),l=Math.PI*2/(bp-1);for(let h=0;h<bp+1;h++){const d=l*h;n.copy(a).multiplyScalar(Math.cos(d)*1),r.copy(o).multiplyScalar(Math.sin(d)*1);const u=n.add(r);i.setXYZ(h,u.x,u.y,u.z)}}}return t.frustumCulled=!1,this.registerTimedObject(U.Current,t,e,this.circlesCache),t}static getSphere(e,t,i){let n=this.spheresCache.pop();return n||(n=new c.Mesh(new c.SphereGeometry(1,8,8))),n.scale.set(e,e,e),n.material.wireframe=i,this.registerTimedObject(U.Current,n,t,this.spheresCache),n}static getArrowHead(e){let t=this.arrowHeadsCache.pop();return t||(t=new c.Mesh(new c.CylinderGeometry(0,.5,1,8))),this.registerTimedObject(U.Current,t,e,this.arrowHeadsCache),t}static getMesh(e){let t=this.mesh.pop();return t||(t=new c.Mesh,t.material=new c.MeshBasicMaterial),this.registerTimedObject(U.Current,t,e,this.mesh),t}static linesCache=[];static circlesCache=[];static spheresCache=[];static boxesCache=[];static arrowHeadsCache=[];static mesh=[];static textLabelCache=[];static registerTimedObject(e,t,i,n){if(!e){console.error("No Needle Engine context available. Did you call a Gizmos function in global scope?");return}const o=this.contextBeforeRenderCallbacks.get(e),r=this.contextPostRenderCallbacks.get(e);if(o){if(e.pre_render_callbacks[e.pre_render_callbacks.length-1]!==o){const a=e.pre_render_callbacks.indexOf(o);a>=0&&e.pre_render_callbacks.splice(a,1),e.pre_render_callbacks.push(o)}}else{const a=()=>{this.onBeforeRender(e,this.timedObjectsBuffer)};this.contextBeforeRenderCallbacks.set(e,a),e.pre_render_callbacks.push(a)}if(r){if(e.post_render_callbacks[e.post_render_callbacks.length-1]!==r){const a=e.post_render_callbacks.indexOf(r);a>=0&&e.post_render_callbacks.splice(a,1),e.post_render_callbacks.push(r)}}else{const a=()=>{this.onPostRender(e,this.timedObjectsBuffer,this.timesBuffer)};this.contextPostRenderCallbacks.set(e,a),e.post_render_callbacks.push(a)}t.traverse(a=>{a.layers.disableAll(),a.layers.enable(2)}),t.renderOrder=999999,t[Am]=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)}static timedObjectsBuffer=new Array;static timesBuffer=new Array;static contextPostRenderCallbacks=new Map;static contextBeforeRenderCallbacks=new Map;static tmuiNeedsUpdate=!1;static onBeforeRender(e,t){this.tmuiNeedsUpdate&&(this.tmuiNeedsUpdate=!1,se.__webpack_exports__default.update());for(let i=0;i<t.length;i++){const n=t[i];if(e.mainCamera&&n instanceof se.__webpack_exports__default.MeshUIBaseElement){if(mr(n))continue;const o=e.isInVR,r=!1,a=!o;Zc(n,e.mainCamera,r,a)}}}static onPostRender(e,t,i){const n=e.time.realtimeSinceStartup;for(let o=t.length-1;o>=0;o--){const r=t[o];n>=i[o]-1e-6&&(t.splice(o,1),i.splice(o,1),r.removeFromParent(),mr(r)!=!0&&r[Am].push(r))}}}const Gt=x("debugphysics"),Bk=x("debugworker"),Tb=new c.Layers;class Sr{static AllLayers=4294967295;ray;cam;screenPoint;raycaster;results;targets;recursive=!0;minDistance;maxDistance;lineThreshold;layerMask;ignore;testObject;useAcceleratedRaycast;allowSlowRaycastFallback=!0;screenPointFromOffset(e,t){this.screenPoint===void 0&&(this.screenPoint=new c.Vector2),this.screenPoint.x=e/window.innerWidth*2-1,this.screenPoint.y=-(t/window.innerHeight)*2+1}setLayer(e){Tb.set(e),this.layerMask=Tb}setMask(e){this.layerMask||(this.layerMask=new c.Layers);const t=this.layerMask;t?t.mask=e:this.layerMask=e}}class Zg{distance;point;object;constructor(e,t,i){this.object=e,this.distance=t,this.point=i}}class Wa{static _raycasting=0;static get raycasting(){return this._raycasting>0}raycastPhysicsFast(e,t=void 0,i=1/0,n=!0){return this.context.physics.engine?.raycast(e,t,{maxDistance:i,solid:n})??null}raycastPhysicsFastAndGetNormal(e,t=void 0,i=1/0,n=!0){return this.context.physics.engine?.raycastAndGetNormal(e,t,{maxDistance:i,solid:n})??null}sphereOverlapPhysics(e,t){return this.context.physics.engine?.sphereOverlap(e,t)??null}context;engine;constructor(e){this.context=e}raycaster=new c.Raycaster;defaultRaycastOptions=new Sr;targetBuffer=new Array(1);defaultThresholds={Mesh:{},Line:{threshold:-1},LOD:{},Points:{threshold:0},Sprite:{}};sphereResults=new Array;sphereMask=new c.Layers;sphere=new c.Sphere;sphereOverlap(e,t,i=!0,n=!1,o=null){if(this.sphereResults.length=0,!this.context.scene)return this.sphereResults;const r=this.sphereMask;r.enableAll(),r.disable(2);for(const a of this.context.scene.children)this.intersectSphere(a,e,t,r,this.sphereResults,i,n,o);return this.sphereResults.sort((a,l)=>a.distance-l.distance)}raycastFromRay(e,t=null){const i=t??this.defaultRaycastOptions;i.ray=e;const n=this.raycast(i);return i===this.defaultRaycastOptions&&(i.ray=void 0),n}raycast(e=null){Gt&&performance.mark("raycast.start"),e||(e=this.defaultRaycastOptions);const t=e.screenPoint??this.context.input.mousePositionRC,i=e.raycaster??this.raycaster;if(i.near=e.minDistance??0,i.far=e.maxDistance??1/0,i.params=this.defaultThresholds,e.lineThreshold===void 0&&(e.lineThreshold=-1),i.params.Line={threshold:e.lineThreshold},e.ray)i.ray.copy(e.ray);else{const a=e.cam??this.context.mainCamera;if(!a)return Gt&&console.error("Can not perform raycast - no main camera found"),this.defaultRaycastOptions.results&&(this.defaultRaycastOptions.results.length=0),this.defaultRaycastOptions.results??[];const l=this.context.xrCamera;this.context.isInXR&&l instanceof c.ArrayCamera&&l.cameras.length>0?i.setFromCamera(t,l.cameras[0]):i.setFromCamera(t,a)}let n=e.targets;n||(n=this.targetBuffer,n.length=1,n[0]=this.context.scene);let o=e.results;this.defaultRaycastOptions.results&&(this.defaultRaycastOptions.results.length=0),o||(this.defaultRaycastOptions.results||(this.defaultRaycastOptions.results=new Array),o=this.defaultRaycastOptions.results),e.layerMask!==void 0?e.layerMask instanceof c.Layers?i.layers.mask=e.layerMask.mask:i.layers.mask=e.layerMask:(i.layers.enableAll(),i.layers.disable(2)),Gt&&console.time("raycast"),o.length=0,Wa._raycasting++,this.intersect(this.raycaster,n,o,e),o.sort((a,l)=>a.distance-l.distance);const r=e.ignore;return r!==void 0&&r.length>0&&(o=o.filter(a=>!r.includes(a.object))),Wa._raycasting--,Gt&&(console.timeEnd("raycast"),console.warn("#"+this.context.time.frame+", hits:",o?.length?[...o]:"nothing"),performance.mark("raycast.end"),performance.measure("raycast","raycast.start","raycast.end")),o}intersect(e,t,i,n){for(const o of t){if(!o||o.visible===!1||B.isGizmo(o)||n.lineThreshold!==void 0&&n.lineThreshold<0&&o instanceof c.Line)continue;let r=!0;const a=o,l=a.geometry;if(o.raycastAllowed===!1&&(r=!1),r&&n.testObject){const h=n.testObject?.(o);if(h===!1)continue;h==="continue in children"&&(r=!1)}else r&&(l&&Rb(l)||(r=!1));if(r){const h=i.length,d=o.raycastPreference||"lod";let u=d!=="bounds";if(n.precise===!1&&(u=!1),l&&(u||=l.getAttribute("position")?.array?.length<64),a instanceof X.GroundedSkybox&&(u=!1),d==="lod"){const f=ne.getRaycastMesh(o);f&&(a.geometry=f)}if(!u&&Uk(a,e,i)||(n.useAcceleratedRaycast!==!1?yu.runMeshBVHRaycast(e,a,i,this.context,n):e.intersectObject(a,!1,i)),a.geometry=l,Gt&&i.length!=h){const f=i[i.length-1];B.DrawWireSphere(f.point,.1,7798784,1,!1),B.DrawWireMesh({mesh:o,depthTest:!1,duration:.2,color:7798784})}}n.recursive!==!1&&this.intersect(e,o.children,i,n)}return i}tempBoundingBox=new c.Box3;intersectSphere(e,t,i,n,o,r,a,l){let h=e&&e.isMesh&&e.layers.test(n)&&!B.isGizmo(e);h&&=e.visible,h&&=!(e instanceof c.Line),h&&=!(e instanceof X.GroundedSkybox);const d=e,u=d.geometry;if(h&&l){const f=l(e);if(f===!1)return;f==="continue in children"&&(h=!1)}if(u&&Rb(u)||(h=!1),h){if(a){const f=this.sphere;f.center.copy(t),f.radius=i;const m=o.length;if(yu.runMeshBVHRaycast(this.sphere,d,o,this.context,{}),m!=o.length&&!r)return}else if(u.boundingBox||u.computeBoundingBox(),u.boundingBox){d.matrixWorldNeedsUpdate&&d.updateWorldMatrix(!1,!1);const f=this.tempBoundingBox.copy(u.boundingBox).applyMatrix4(d.matrixWorld),m=this.sphere;if(m.center.copy(t),m.radius=i,m.intersectsBox(f)){const g=ee(e),b=g.distanceTo(m.center),y=new Zg(e,b,g);if(o.push(y),!r)return}}}if(e.children)for(const f of e.children){const m=o.length;if(this.intersectSphere(f,t,i,n,o,r,a,l),m!=o.length&&!r)return}}}function Rb(s){return!(s.index&&s.index.array.length<3)}const Uo=new c.Sphere,id=new c.Plane,Fk=new c.Matrix3;function Uk(s,e,t){const i=s._computeIntersections;if(!i)return!1;let n=s["_computeIntersections:Needle"];return n||(n=s["_computeIntersections:Needle"]=function(o,r,a){const l=this,h=l.geometry.boundingSphere;if(h){if(l instanceof X.GroundedSkybox){id.setFromNormalAndCoplanarPoint(j(0,1,0),j(0,-l.position.y,0)),id.applyMatrix4(l.matrixWorld,Fk);const u=o.ray.intersectPlane(id,j());if(u){Uo.copy(h),Uo.applyMatrix4(l.matrixWorld);const m=j(u).sub(o.ray.origin).length(),g=Uo.radius*.5;m<g&&r.push({distance:m,point:u,object:l,normal:id.normal.clone()})}return}Uo.copy(h),Uo.applyMatrix4(l.matrixWorld);const d=o.ray.intersectSphere(Uo,j());if(d){const u=j(d).sub(o.ray.origin),f=u.length();if(f>Uo.radius){const m=u.clone().normalize();r.push({distance:f,point:d,object:l,normal:m})}}}}),s._computeIntersections=n,e.intersectObject(s,!1,t),s._computeIntersections=i,!0}var yu;(s=>{let e=0;function t(v,w,O,k,M){if(!w.geometry||!w.geometry.hasAttribute("position"))return!1;const D=w.geometry;if(w?.isSkinnedMesh){const I=w,F=I.bvhNeedsUpdate;if(!I.staticGenerator)l(),r&&(I.staticGenerator=new r(w),I.staticGenerator.applyWorldTransforms=!1,I.staticGeometry=I.staticGenerator.generate(),D.boundsTree=a?.call(I.staticGeometry),I.staticGeometryLastUpdate=performance.now()+Math.random()*200,I.bvhNeedsUpdate=!0);else if(D.boundsTree&&(I.autoUpdateMeshBvhInterval!==void 0&&I.autoUpdateMeshBvhInterval>=0||F===!0)){const V=performance.now(),G=V-I.staticGeometryLastUpdate,E=I.autoUpdateMeshBvhInterval??100;(F||G>E)&&(Gt&&console.warn(`Physics: updating skinned mesh bvh for ${w.name} after ${G.toFixed(2)}ms`),I.bvhNeedsUpdate=!1,I.staticGeometryLastUpdate=V,I.staticGenerator?.generate(I.staticGeometry),D.boundsTree.refit())}}else if(!D.boundsTree){d||_();let I=!0;if((k.xr||D[g]===!1||D.getAttribute("position")?.isInterleavedBufferAttribute||D.index&&D.index?.isInterleavedBufferAttribute||e>10)&&(I=!1),I&&f){if(D[m]===void 0){let F=null;if(y.length>0){const V=y.shift();V&&!V.running&&(F=V)}if(!F&&b.length<3)try{Bk&&console.warn("[GenerateMeshBVHWorker] Creating worker with import.meta.url:",typeof document>"u"?require("url").pathToFileURL(__filename).href:Pa&&Pa.tagName.toUpperCase()==="SCRIPT"&&Pa.src||new URL("needle-engine.bundle-CWiO9cA8.umd.cjs",document.baseURI).href),F=new f,b.push(F)}catch(V){V instanceof DOMException&&V.name==="SecurityError"?(console.warn("Failed to create MeshBVH worker, falling back to main thread generation. This can happen when running from file://, if the browser does not support workers or if the browser is blocking workers for other reasons."),console.debug(V),e+=10):(console.error("Failed to create MeshBVH worker. Please see below for more details:"),console.log(V)),e++}if(F!=null&&!F.running){const V=w.name;Gt&&console.log("<<<< worker start",V,F),D[m]="queued",performance.mark("bvh.create.start");const G=D.clone();try{F.generate(G).then(E=>{D[m]="done",D.boundsTree=E}).catch(E=>{D[m]="failed - "+E?.message,D[g]=!1,Gt&&console.error("Failed to generate mesh bvh on worker",E)}).finally(()=>{Gt&&console.log(">>>>> worker done",V,{hasBoundsTre:D.boundsTree!=null}),y.push(F),G.dispose(),performance.mark("bvh.create.end"),performance.measure("bvh.create (worker)","bvh.create.start","bvh.create.end")})}catch(E){console.error("Failed to generate mesh bvh on worker",E)}}else Gt&&console.warn("No worker available")}}else(!u||!I)&&(l(),o&&(performance.mark("bvh.create.start"),D.boundsTree=new o(D),performance.mark("bvh.create.end"),performance.measure("bvh.create","bvh.create.start","bvh.create.end")))}if(v instanceof c.Raycaster){const I=v,F=w.raycast;if(D.boundsTree)l(),n&&(w.acceleratedRaycast||(w.acceleratedRaycast=n.bind(w),Gt&&console.debug(`Physics: bind acceleratedRaycast fn to "${w.name}"`)),w.raycast=w.acceleratedRaycast);else if(Gt&&console.warn("No bounds tree found for mesh",w.name,{workerTask:D[m],hasAcceleratedRaycast:n!=null}),M.allowSlowRaycastFallback===!1&&(D.getAttribute("position")?.array?.length??0)>2e3)return Gt&&console.warn("Skipping raycast because no bounds tree is available and allowSlowRaycastFallback is false"),!1;const V=I.firstHitOnly;return I.firstHitOnly=!1,I.intersectObject(w,!1,O),I.firstHitOnly=V,w.raycast=F,!0}else if(v instanceof c.Sphere){const I=D.boundsTree;if(I){const F=v;if(h.copy(w.matrixWorld).invert(),F.applyMatrix4(h),I.intersectsSphere(F)){const G=ee(w),E=G.distanceTo(F.center),N=new Zg(w,E,G);O.push(N)}}return!0}return!1}s.runMeshBVHRaycast=t;let i=!1,n=null,o=null,r=null,a=null;function l(){i||(i=!0,Promise.resolve().then(()=>require("./vendor-1UvpPPSB.umd.cjs")).then(v=>v.index$1).then(v=>{n=v.acceleratedRaycast,o=v.MeshBVH,r=v.StaticGeometryGenerator,a=v.computeBoundsTree}).catch(v=>{(Gt||T())&&console.error("Failed to load BVH library...",v.message)}))}const h=new c.Matrix4;let d=!1,u=!1,f=null;const m=Symbol("Needle:MeshBVH-Worker"),g=Symbol("Needle:MeshBVH-CanUseWorker"),b=[],y=[];function _(){d=!0,u=!0,Promise.resolve().then(()=>BI).then(v=>{f=v.GenerateMeshBVHWorker}).catch(v=>{Gt||T()?console.warn("Failed to setup mesh bvh worker"):console.debug("Failed to setup mesh bvh worker",v)}).finally(()=>{u=!1})}})(yu||(yu={}));const Ab=Symbol("gltf-loader-internal-usage-tracker"),zk=x("debugusers");class Ra{get name(){return"NEEDLE_internal_usage_tracker"}static isLoading(e){return Ra._loadingProcesses>0}static _loadingProcesses=0;parser;_getDependency;_loadingId;_loadedObjects=new Set;constructor(e){this.parser=e,this._getDependency=this.parser.getDependency,this._loadingId=Date.now().toString()}beforeRoot(){Ra._loadingProcesses++;const e=this,t=this._getDependency;return this.parser.getDependency=function(i,n){const o=t.call(this,i,n);return o.then(r=>(r&&(e._loadedObjects.add(r),r[Ab]=e._loadingId),r)),o},null}afterRoot(e){Ra._loadingProcesses--,this.parser.getDependency=this._getDependency;for(const t of this._loadedObjects)delete t[Ab],t instanceof c.Object3D&&(t.parent||t instanceof c.Mesh&&setTimeout(()=>{zk&&console.warn("> GLTF LOADER: Mesh not used in scene!",t),t.material=null,t.geometry=null},1e3));return null}}class Gw{constructor(){window.addEventListener("unhandledrejection",e=>{if(e.defaultPrevented)return;const t=e?.reason?.path;if(t){const i=t[0];i&&i.tagName==="IMG"&&(console.warn(`Could not load image:
884
884
  `+i.src),e.preventDefault())}})}}const Yu=x("trackresources");function Hw(){return Yu==="dispose"}let Cr=!0;Yu===0&&(Cr=!1);function Nk(s){Cr=s}function qw(){return Cr}const Xw=Symbol("disposable");function Qw(s,e){s&&(s[Xw]=e,ar&&console.warn("Set disposable",e,s))}const Yw=Symbol("disposed");function $k(s){return s[Yw]===!0}function Se(s){if(s){if(s[Xw]===!1){ar&&console.warn("Object is marked as not disposable",s);return}if(typeof s=="object"&&(s[Yw]=!0),s instanceof c.Scene)Se(s.environment),Se(s.background),Se(s.customDepthMaterial),Se(s.customDistanceMaterial);else if(s instanceof c.SkinnedMesh)Se(s.geometry),Se(s.material),Se(s.skeleton),Se(s.bindMatrix),Se(s.bindMatrixInverse),Se(s.customDepthMaterial),Se(s.customDistanceMaterial),s.visible=!1;else if(s instanceof c.Mesh)Se(s.geometry),Se(s.material),Se(s.customDepthMaterial),Se(s.customDistanceMaterial),s.visible=!1;else if(s instanceof c.Object3D)s.visible=!1;else if(s instanceof c.BufferGeometry){Zr(s);for(const e of Object.keys(s.attributes)){const t=s.attributes[e];Se(t)}}else if(s instanceof c.BufferAttribute||s instanceof c.InterleavedBufferAttribute)ar&&console.warn("BufferAttribute dispose not supported",s.count);else if(s instanceof Array)for(const e of s)e instanceof c.Material&&Se(e);else if(s instanceof c.Material){Zr(s);for(const t of Object.keys(s)){const i=s[t];i instanceof c.Texture&&Se(i)}const e=s.uniforms;if(e)for(const t of Object.keys(e)){const i=e[t];i instanceof c.Texture?Se(i):i instanceof c.Uniform$1&&Se(i.value)}}else s instanceof c.Texture?(Zr(s),Zr(s.source),s.source?.data instanceof ImageBitmap&&Zr(s.source.data)):s instanceof c.Skeleton?(Zr(s.boneTexture),s.boneTexture=null):s instanceof c.Bone||!(s instanceof c.Object3D)&&ar&&console.warn("Unknown object type",s)}}function Zr(s){s&&((ar||Hw()||Yu)&&console.warn("🧨 FREE",s),s instanceof ImageBitmap||"dispose"in s&&typeof s.dispose=="function"&&s.dispose())}function Vk(s){}const Wk=new Set;function Jg(s,e,t=null,i){if(i||(i=Wk,i.clear()),!s)return i;const n=s[Ic];if(n)for(const o of n)i.has(o)||t?.call(null,o)!==!1&&(i.add(o),e&&Jg(o,!0,t,i));return i}function Gk(s){return s[Kl]}const ar=x("debugresourceusers")||x("debugmemory"),Ic=Symbol("needle-resource-users"),Kl=Symbol("needle-resource-users-count");function Ut(s,e){zu(s,e,function(t,i){Cr&&!Wa.raycasting&&(_u(Ic,this,t,!1),_u(Ic,this,i,!0))})}Cr&&(Ut(c.Mesh.prototype,"material"),Ut(c.Mesh.prototype,"geometry"),Ut(c.Material.prototype,"map"),Ut(c.Material.prototype,"bumpMap"),Ut(c.Material.prototype,"alphaMap"),Ut(c.Material.prototype,"normalMap"),Ut(c.Material.prototype,"displacementMap"),Ut(c.Material.prototype,"roughnessMap"),Ut(c.Material.prototype,"metalnessMap"),Ut(c.Material.prototype,"emissiveMap"),Ut(c.Material.prototype,"specularMap"),Ut(c.Material.prototype,"envMap"),Ut(c.Material.prototype,"lightMap"),Ut(c.Material.prototype,"aoMap"),Ut(c.Material.prototype,"gradientMap"));function Hk(s){if(Cr===!1)return;const e=s[Ic];if(e)for(const t of e)_u(Ic,t,s,!1)}Cr&&zu(c.Material.prototype,"dispose",function(){Hk(this)});let Dm=0;function _u(s,e,t,i){if(Dm>0)return;if(Array.isArray(t)){for(const o of t)_u(s,e,o,i);return}if(!t)return;let n=t[s];if(n||(n=new Set),i){if(e&&!n.has(e)){n.add(e);let o=t[Kl]||0;o+=1,t[Kl]=o,ar&&console.warn(`🟢 Added user of "${t.type}"`,e,t,o,"users:",n)}}else if(e&&n.has(e)){n.delete(e);let o=t[Kl]||0;o>0&&(o-=1,t[Kl]=o),ar&&console.warn(`🔴 Removed user of "${t.type}"`,e,t,o,"users:",n),o<=0&&(Ra.isLoading(t)||(Yu&&console.warn(`🔴 Removed all user of "${t.type}"`,t),Hw()&&Se(t)))}t[s]=n}try{zu(c.WebGLRenderer.prototype,"render",function(){Dm++},function(){Dm--})}catch(s){console.warn("Could not wrap WebGLRenderer.render",s)}const Lc=Symbol("NEEDLE_NEED_UPDATE_INSTANCE"),Kw=Symbol("isUsingInstancing"),Zw=Symbol("instancingRenderer"),Zl=Symbol("instancingAutoUpdateBounds");class qi{static isUsingInstancing(e){return e[Kw]===!0}static getRenderer(e){return e[Zw]||null}setAutoUpdateBounds(e,t){const i=qi.getRenderer(e);i&&(i[Zl]=t)}static markDirty(e,t=!0){if(e&&(this.isUsingInstancing(e)&&(e[Lc]=!0,e.matrixWorldNeedsUpdate=!0),t))for(const i of e.children)qi.markDirty(i,!0)}}const co=x("debuginstantiate"),Jr=new Map,Im=Symbol("original-component-name");function Lm(s,e,t){if(e===null||!s)return;const i=s.guid,n=s.guid;n?.length&&(Jr.has(n)||(co&&console.log('Creating InstanceIdProvider with key "'+n+'" for object '+s.name),Jr.set(n,new rt(n))));const o=n&&Jr.get(n)||e;if(s.guid=o.generateUUID(),i&&i!=="invalid"&&(t[i]=s.guid),s&&s.userData&&s.userData.components)for(const r of s.userData.components){if(r===null)continue;const a=r.guid;a?Jr.has(a)||(co&&console.log('Creating InstanceIdProvider with key "'+a+'" for component '+r[Im]),Jr.set(a,new rt(a))):co&&console.warn("Can not create IdProvider: component "+r[Im]+" has no guid",r.guid);const l=Jr.get(a)||e,h=r.guid;r.guid=l.generateUUID(),h&&h!=="invalid"&&(t[h]=r.guid)}if(s.children)for(const r of s.children)Lm(r,e,t)}function qk(s){for(const e in s){const i=s[e].clone;if(!(!i?.isObject3D||!i?.userData?.components))for(let n=0;n<i.userData.components.length;n++){const o=i.userData.components[n],r=Object.entries(o);for(const[a,l]of r){if(l==null||typeof l!="object"&&typeof l!="string")continue;const h=pr(a,l,s);h!==void 0&&(o[a]=h)}}}}let yi=null;function Db(s,e){if(!co){jm(s,e);return}yi={objects:0,components:0,props:0,remapped:0};const t=typeof performance<"u"?performance.now():Date.now();jm(s,e);const i=(typeof performance<"u"?performance.now():Date.now())-t,n=yi;yi=null,console.log(`[resolveStringGuids] root="${s.name}" objects=${n.objects} components=${n.components} propsVisited=${n.props} remapped=${n.remapped} mapSize=${Object.keys(e).length} in ${i.toFixed(2)}ms`)}function jm(s,e){if(yi&&yi.objects++,s.userData?.components)for(const t of s.userData.components)t!==null&&(yi&&yi.components++,Bm(t,e));if(s.children)for(const t of s.children)jm(t,e)}function Bm(s,e,t){if(t||(t=new WeakSet),!t.has(s)){t.add(s);for(const i of Object.keys(s)){yi&&yi.props++;const n=s[i];if(n!=null)if(typeof n=="string"){const o=e[n];o&&(s[i]=o,yi&&yi.remapped++)}else if(Array.isArray(n))for(let o=0;o<n.length;o++){const r=n[o];if(typeof r=="string"){const a=e[r];a&&(n[o]=a,yi&&yi.remapped++)}else(Array.isArray(r)||Fm(r))&&Bm(r,e,t)}else Fm(n)&&Bm(n,e,t)}}}function pr(s,e,t){if(e!==void 0){if(e===null)return null;if(typeof e=="string"){const i=t[e];return i?i.clone:void 0}if(typeof e=="object"){if($u(e))return Xk(e,t);if(e.isObject3D===!0){if(s==="gameObject")return;const i=e.uuid,n=t[i]?.clone;return n?(co&&console.log(s,"old",e,"new",n),n):void 0}if(eO(e))return e.clone();if(Array.isArray(e))return Qk(s,e,t);if(e instanceof Map)return Yk(e,t);if(e instanceof Set)return Kk(e,t);if(!(e instanceof WeakMap||e instanceof WeakSet)){if(PP(e)&&e.$serializedTypes)return Zk(e,t);if(Fm(e))return Jk(s,e,t)}}}}function Xk(s,e){const t=s.gameObject;if(!t)return;const i=t.uuid,n=e[i]?.clone;if(!n){co&&console.log("Component reference did not change (external)",s);return}const o=t.userData.components.indexOf(s);if(o>=0&&n.isObject3D)return co&&console.log("Resolved component",i,"at index",o),n.userData.components[o];console.warn("Could not find component at expected index",s)}function Qk(s,e,t){const i=[];for(let n=0;n<e.length;n++){const o=e[n];if(o==null){i.push(o);continue}if(typeof o!="object"&&typeof o!="string"){i.push(o);continue}const r=pr(s,o,t);i.push(r!==void 0?r:o)}return i}function Yk(s,e){const t=new Map;let i=!1;for(const[n,o]of s){let r=n,a=o;if(typeof n=="object"&&n!==null){const l=pr("",n,e);l!==void 0&&(r=l,i=!0)}if(typeof o=="object"&&o!==null){const l=pr("",o,e);l!==void 0&&(a=l,i=!0)}t.set(r,a)}return t}function Kk(s,e){const t=new Set;for(const i of s)if(typeof i=="object"&&i!==null){const n=pr("",i,e);t.add(n!==void 0?n:i)}else t.add(i);return t}function Zk(s,e){const t=Object.assign(Object.create(Object.getPrototypeOf(s)),s);let i=!1;for(const n in t.$serializedTypes){const o=t[n];if(o!=null&&typeof o=="object"){co&&console.log("Recursively resolve references for",n,o);const r=pr(n,o,e);r!==void 0&&(t[n]=r,i=!0)}}return i?t:void 0}function Jk(s,e,t){let i=!1;const n={...e};for(const o of Object.keys(n)){const r=n[o];if(r==null||typeof r!="object"&&typeof r!="string")continue;const a=pr(o,r,t);a!==void 0&&(n[o]=a,i=!0)}return i?n:void 0}function Fm(s){if(typeof s!="object"||s===null)return!1;const e=Object.getPrototypeOf(s);return e===Object.prototype||e===null}function eO(s){return s.isVector2===!0||s.isVector3===!0||s.isVector4===!0||s.isQuaternion===!0||s.isEuler===!0||s.isColor===!0||s.isMatrix2===!0||s.isMatrix3===!0||s.isMatrix4===!0}const Jw=new Map;function ex(s,e){if(!s)return;if(!e){console.warn("No prototype found",s,s.prototype,s.constructor);return}const t=Jw.get(e);t&&t.apply(s)}function ey(s){const e=tO(s.prototype);Jw.set(s,e)}function tO(s){return new iO(s)}class iO{$symbol;extensions;descriptors;constructor(e){this.$symbol=Symbol("prototype-extension"),this.extensions=Object.keys(e),this.descriptors=new Array;for(let t=0;t<this.extensions.length;t++){const i=this.extensions[t],n=Object.getOwnPropertyDescriptor(e,i);n&&this.descriptors.push(n)}}apply(e){if(!e[this.$symbol]){e[this.$symbol]=!0;for(let t=0;t<this.extensions.length;t++){const i=this.extensions[t],n=this.descriptors[t];n&&Object.defineProperty(e,i,n)}}}}function Ku(s){s&&s.isObject3D===!0&&ex(s,c.Object3D)}let Ib=!1;function nO(){if(Ib)return;if(Ib=!0,Ag.experimentalSmartHierarchyUpdate){const i=c.Object3D.prototype.add;c.Object3D.prototype.add=function(...r){return wp(),i.apply(this,r)};const n=c.Object3D.prototype.attach;c.Object3D.prototype.attach=function(...r){return wp(),n.apply(this,r)};const o=c.Object3D.prototype.remove;c.Object3D.prototype.remove=function(...r){return wp(),o.apply(this,r)}}c.Object3D.prototype.SetActive=function(i){this.visible=i},c.Object3D.prototype.setActive=function(i){this.visible=i},c.Object3D.prototype.destroy=function(){Ci(this)},c.Object3D.prototype.addComponent=function(i,n){return Hn(this,i,n)},c.Object3D.prototype.addNewComponent=function(i,n){return Hn(this,i,n)},c.Object3D.prototype.removeComponent=function(i){return sy(this,i)},c.Object3D.prototype.getOrAddComponent=function(i,n){return oh(this,i,n)},c.Object3D.prototype.getComponent=function(i){return So(this,i)},c.Object3D.prototype.getComponents=function(i,n){return el(this,i,n)},c.Object3D.prototype.getComponentInChildren=function(i,n=!1){return rh(this,i,n)},c.Object3D.prototype.getComponentsInChildren=function(i,n){return tl(this,i,n)},c.Object3D.prototype.getComponentInParent=function(i,n=!1){return jc(this,i,n)},c.Object3D.prototype.getComponentsInParent=function(i,n){return Ju(this,i,n)},Object.getOwnPropertyDescriptor(c.Object3D.prototype,"activeSelf")||Object.defineProperty(c.Object3D.prototype,"activeSelf",{get:function(){return Ja(this)},set:function(i){mc(this,i)}}),Object.getOwnPropertyDescriptor(c.Object3D.prototype,"raycastAllowed")||Object.defineProperty(c.Object3D.prototype,"raycastAllowed",{get:function(){return this.userData&&this.userData.raycastAllowed!==!1},set:function(i){const n=this;n.userData||(n.userData={}),n.userData.raycastAllowed=i}}),Object.getOwnPropertyDescriptor(c.Object3D.prototype,"worldPosition")||Object.defineProperty(c.Object3D.prototype,"worldPosition",{get:function(){return this instanceof X.TransformControlsGizmo?ee(this.object):ee(this)},set:function(i){Si(this,i)}}),Object.getOwnPropertyDescriptor(c.Object3D.prototype,"worldQuaternion")||Object.defineProperty(c.Object3D.prototype,"worldQuaternion",{get:function(){return this instanceof X.TransformControlsGizmo?ge(this.object):ge(this)},set:function(i){mn(this,i)}}),Object.getOwnPropertyDescriptor(c.Object3D.prototype,"worldRotation")||Object.defineProperty(c.Object3D.prototype,"worldRotation",{get:function(){return Fu(this)},set:function(i){P0(this,i)}}),Object.getOwnPropertyDescriptor(c.Object3D.prototype,"worldScale")||Object.defineProperty(c.Object3D.prototype,"worldScale",{get:function(){return Fe(this)},set:function(i){ja(this,i)}});const s=new c.Matrix4,e=new c.Vector3(0,0,0),t=new c.Vector3(0,1,0);Object.getOwnPropertyDescriptor(c.Object3D.prototype,"worldForward")||Object.defineProperty(c.Object3D.prototype,"worldForward",{get:function(){return j().set(0,0,1).applyQuaternion(ge(this))},set:function(i){const n=oi().setFromRotationMatrix(s.lookAt(e.set(0,0,0),i,t.set(0,1,0)));this.worldQuaternion=n}}),Object.getOwnPropertyDescriptor(c.Object3D.prototype,"worldRight")||Object.defineProperty(c.Object3D.prototype,"worldRight",{get:function(){return j().set(1,0,0).applyQuaternion(ge(this))}}),Object.getOwnPropertyDescriptor(c.Object3D.prototype,"worldUp")||Object.defineProperty(c.Object3D.prototype,"worldUp",{get:function(){return j().set(0,1,0).applyQuaternion(ge(this))}}),Object.getOwnPropertyDescriptor(c.Object3D.prototype,"contains")||Object.defineProperty(c.Object3D.prototype,"contains",{value:function(i){if(!i)return!1;if(this===i)return!0;for(const n of this.children)if(n.contains(i))return!0;return!1}}),ey(c.Object3D)}const Ud=x("debuggetcomponent"),sO=x("debuginstantiate");class Kn{idProvider;parent;keepWorldPosition;position;rotation;scale;visible;context;components;clone(){const e=new Kn;return e.idProvider=this.idProvider,e.parent=this.parent,e.keepWorldPosition=this.keepWorldPosition,e.position=Array.isArray(this.position)?[...this.position]:this.position?.clone(),e.rotation=Array.isArray(this.rotation)?[...this.rotation]:this.rotation?.clone(),e.scale=Array.isArray(this.scale)?[...this.scale]:this.scale?.clone(),e.visible=this.visible,e.context=this.context,e.components=this.components,e}cloneAssign(e){this.idProvider=e.idProvider,this.parent=e.parent,this.keepWorldPosition=e.keepWorldPosition,this.position=Array.isArray(e.position)?[...e.position]:e.position?.clone(),this.rotation=Array.isArray(e.rotation)?[...e.rotation]:e.rotation?.clone(),this.scale=Array.isArray(e.scale)?[...e.scale]:e.scale?.clone(),this.visible=e.visible,this.context=e.context,this.components=e.components}}function Ja(s){return s.visible}function mc(s,e){return typeof e=="number"&&(e=e>.5),s.visible=e,s.visible}function tx(s){return s[zn]||Zu(s)}function ix(s,e){s[Kw]=e}function Zu(s){return qi.isUsingInstancing(s)}function ty(s,e){return Oc(s,e,!0,!0)}const nx=Symbol("isDestroyed");function mr(s){return s[nx]}function sx(s,e){s[nx]=e}const Um=Symbol("isDontDestroy");function ca(s,e=!0){s[Um]=e}const zd=[],Nd=[];function Ci(s,e=!0,t=!1){zd.length=0,Nd.length=0,zm(s,e,!0);for(const i of zd)i.gameObject=null,i.context=null;for(const i of Nd)sx(i,!0),t&&Se(i);Nd.length=0,zd.length=0}function zm(s,e=!0,t=!0){if(s==null)return;const i=s;if(i.isComponent){if(i[Um])return;zd.push(i);const r=i.gameObject;i.__internalDisable?.(),i.__internalDestroy?.(),i.gameObject=r;return}if(s[Um])return;const n=s;Ud&&console.log(n),Nd.push(n);const o=n.userData?.components;if(o!=null&&Array.isArray(o)){let r=o.length;for(let a=0;a<o.length;a++){const l=o[a];zm(l,e,!1),o.length<r&&(r=o.length,a--)}}if(e&&n.children)for(const r of n.children)zm(r,e,!1);t&&n.removeFromParent()}function gr(s,e,t=!0){return ox(s,e,t)}function*iy(s,e,t=!1,i=999,n=0){if(s?.userData.components&&!(n>i)){for(const o of s.userData.components)e&&o?.isComponent===!0&&o instanceof e?yield o:yield o;if(t===!0)for(const o of s.children)yield*iy(o,e,!0,i,n+1)}}function ox(s,e,t,i=0){if(s){if(s.isObject3D,i>1e3){console.warn("Failed to iterate components: too many levels");return}if(s.userData?.components)for(let n=0;n<s.userData.components.length;n++){const o=s.userData.components[n];if(o?.isComponent===!0){const r=e(o);if(r!==void 0)return r}}if(t&&s.children){const n=i+1;for(let o=0;o<s.children.length;o++){const r=s.children[o];if(!r)continue;const a=ox(r,e,t,n);if(a!==void 0)return a}}}}function go(s,e){if("isAssetReference"in s)return s.instantiate(e??void 0);let t=null;e!=null&&(e.x!==void 0?(t=new Kn,t.position=e):t=e);let i=U.Current;t?.context&&(i=t.context),Ud&&i.alias&&console.log("context",i.alias),t&&!t.idProvider&&(t.idProvider=new rt(Date.now()));const n=[],o={},r={},a=rx(i,s,t,n,o,r);a&&(qk(o),rO(r,o)),Ud&&(ru(s,!0),ru(a,!0));const l={};for(const h in o){const d=o[h],u=d.original,f=d.clone;u instanceof c.Object3D&&f instanceof c.Object3D&&(l[u.guid||u.uuid]=f.guid||f.uuid)}if(t?.components!==!1){for(const h in n){const d=n[h],u=d.guid;t&&t.idProvider&&(d.guid=t.idProvider.generateUUID(),l[u]=d.guid,Ud&&console.log(d.name,d.guid)),Qu(d,i),d.__internalNewInstanceCreated&&d.__internalNewInstanceCreated()}for(const h in n){const d=n[h];d.enabled!==!1&&(d.enabled=!0)}bu(i)}return a}function rx(s,e,t,i,n,o){if(!e||e[_i])return null;const r=e.userData;e.userData={};const a=e.children;e.children=[];const l=e.clone(!1);Ku(l),e.userData=r,e.children=a;const h={original:e,clone:l};if(n[e.uuid]=h,e.guid&&e.guid!==e.uuid&&(n[e.guid]=h),sO&&console.log("ADD",e,l),e.type==="SkinnedMesh"&&(o[e.uuid]={original:e,clone:l}),t?.visible!==void 0&&(l.visible=t.visible),t?.idProvider){l.uuid=t.idProvider.generateUUID();const u=l;u&&(u.guid=l.uuid)}e.animations&&e.animations.length>0&&(l.animations=[...e.animations]);const d=e.parent;if(d&&d.add(l),t?.position)if(Array.isArray(t.position)){const u=new c.Vector3;u.fromArray(t.position),l.worldPosition=u}else l.worldPosition=t.position;else l.position.copy(e.position);if(t?.rotation){if(t.rotation instanceof c.Quaternion)l.worldQuaternion=t.rotation;else if(t.rotation instanceof c.Euler)l.worldQuaternion=oi().setFromEuler(t.rotation);else if(Array.isArray(t.rotation)){const u=new c.Euler;u.fromArray(t.rotation),l.worldQuaternion=oi().setFromEuler(u)}}else l.quaternion.copy(e.quaternion);if(t?.scale)if(Array.isArray(t.scale)){const u=new c.Vector3;u.fromArray(t.scale),t.scale=u}else l.scale.copy(t.scale);else l.scale.copy(e.scale);if(t?.parent&&t.parent!=="scene"){let u=null;if(typeof t.parent=="string"?u=Oc(t.parent,s.scene,!0):u=t.parent,u){const f=t.keepWorldPosition===!0?u.attach:u.add;f?f.call(u,l):console.error("Invalid parent object",u,"received when instantiating:",e)}else console.warn("could not find parent:",t.parent)}for(const[u,f]of Object.entries(e.userData))u!=="components"&&(l.userData[u]=f);if(e.userData?.components){const u=e.userData.components,f=[];l.userData.components=f;for(let m=0;m<u.length;m++){const g=u[m],b=new g.constructor;oO(g,b),g[hc]!==void 0&&(b[hc]=g[hc]),f.push(b),b.gameObject=l,i.push(b),n[g.guid]={original:g,clone:b},Uu.dispatchComponentLifecycleEvent("component-added",b)}}t&&(t.position=void 0,t.rotation=void 0,t.scale=void 0,t.parent=void 0,t.visible=void 0);for(const u in e.children){const f=e.children[u],m=rx(s,f,t,i,n,o);m&&(n[m.uuid]={original:f,clone:m},l.add(m))}return l}function oO(s,e,t){Ua(e,s,void 0,{})}function rO(s,e){for(const t in s){const i=s[t],n=i.original,o=n.skeleton,r=i.clone;if(!o){console.warn("Skinned mesh has no skeleton?",i);continue}const a=o.bones,l=r.skeleton.clone();r.skeleton=l,r.bindMatrix.clone().copy(n.bindMatrix),r.bindMatrixInverse.copy(n.bindMatrixInverse);const h=[];l.bones=h;for(let d=0;d<a.length;d++){const u=a[d],m=e[u.uuid].clone;h.push(m)}}for(const t in s){const i=s[t].clone;i.skeleton.update(),i.bind(i.skeleton,i.bindMatrix),i.updateMatrixWorld(!0)}}function gc(s,e){try{e||s()}catch(t){return console.error(t),!1}return!0}const Nm=x("debugnewscripts"),aO=x("debughierarchy"),Oe=[];function lO(){return Oe.length>0}function bu(s){if(Nm&&console.log("Register new components",s.new_scripts.length,[...s.new_scripts],s.alias?"element: "+s.alias:s.hash,s),s.new_scripts_pre_setup_callbacks.length>0){for(const e of s.new_scripts_pre_setup_callbacks)e&&e();s.new_scripts_pre_setup_callbacks.length=0}if(!(s.new_scripts.length<=0)){Oe.length=0,s.new_scripts.length>0&&Oe.push(...s.new_scripts),s.new_scripts.length=0;for(let e=0;e<Oe.length;e++)try{const t=Oe[e];if(t.isComponent!==!0){(T()||Nm)&&console.error(`Registered script is not a Needle Engine component.
885
885
  The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
886
886
  `,t),Oe.splice(e,1),e--;continue}if(t.destroyed)continue;if(!t.gameObject){console.warn(`Component can not be initialized: no GameObject assigned.
@@ -1731,4 +1731,4 @@ Needle Engine: finished loading `+i+`
1731
1731
  ---------------------------------
1732
1732
  • `+r.passes.map(u=>u.name||u.constructor.name+"*").join(`
1733
1733
  • `)+`
1734
- `),ti&&this._onCreateEffectsDebug(this._composer,o)}createPassForMergeableEffects(e,t,i,n){if(e.length>0){const o=new A.POSTPROCESSING.MODULE.EffectPass(i,...e);o.name=e.map(r=>r.name).join(", "),o.mainScene=n,o.enabled=!0,o.renderToScreen=!1,t.addPass(o),e.length=0}}handleDevicePixelRatio(){typeof this.context.devicePixelRatio=="number"&&this.context.requestSizeUpdate()}_menuEntry=null;_passIndices=null;_onCreateEffectsDebug(e,t){if(ti==="passes"){const i=new A.POSTPROCESSING.MODULE.DepthEffect({blendFunction:A.POSTPROCESSING.MODULE.BlendFunction.NORMAL,inverted:!0});i.name="Depth Effect";const n=new A.POSTPROCESSING.MODULE.EffectPass(t,i);if(n.name="Depth Effect Pass",n.enabled=!1,e.passes.push(n),this._passIndices!==null){const r=[e.passes[0]];this._passIndices.length>0&&r.push(...this._passIndices.filter(a=>a!==0).map(a=>e.passes[a]).filter(a=>a)),r.length>0&&console.log("[PostProcessing] Passes (selected) →",r),e.passes.length=0;for(const a of r)a.enabled=!0,a.renderToScreen=!1,e.addPass(a)}const o=this.context.menu;if(o&&this._passIndices===null){this._menuEntry&&this._menuEntry.remove();const r=document.createElement("select");r.multiple=!0;const a=document.createElement("option");a.innerText="Final Output",a.value="-1",r.appendChild(a);for(const l of e.passes){const h=document.createElement("option");h.innerText=l.name,h.value=`${e.passes.indexOf(l)}`,h.title=l.name,r.appendChild(h)}o.appendChild(r),this._menuEntry=r,r.addEventListener("change",()=>{const l=Array.from(r.selectedOptions).map(h=>parseInt(h.value));l.length===1&&l[0]===-1?this._passIndices=null:this._passIndices=l,this.applyEffects(this.context)})}}}}const II=Object.freeze(Object.defineProperty({__proto__:null,PostProcessingHandler:Ka},Symbol.toStringTag,{value:"Module"}));class Kf{_name;_tracks=[];_currentTrack=null;_pendingSignals=[];_idProvider;constructor(e,t){this._name=e,this._idProvider=new rt(t??Date.now())}static create(e,t){return new Kf(e??"Timeline",t)}animationTrack(e,t){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Animation,t??null),this}audioTrack(e,t,i){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Audio,t??null),this._currentTrack.volume=i,this}activationTrack(e,t){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Activation,t??null),this}controlTrack(e){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Control,null),this}signalTrack(e,t){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Signal,t??null),this}markerTrack(e){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Marker,null),this}clip(e,t){if(!this._currentTrack)throw new Error("TimelineBuilder: .clip() must be called after a track method (e.g. .animationTrack())");this.commitInlineTracks();const i=this._currentTrack;switch(i.type){case me.Animation:{let n;if(e instanceof c.AnimationClip)n=e;else{const d=Array.isArray(e)?e:[e],u=i.outputs[0],f=u instanceof c.Object3D?u:u!=null&&"gameObject"in u?u.gameObject:void 0;n=Fc(d,f)}const o=t??{},r=o.duration??n.duration,a=o.start??i.cursor,l=a+r,h={start:a,end:l,duration:r,timeScale:o.speed??1,clipIn:o.clipIn??0,easeInDuration:o.easeIn??0,easeOutDuration:o.easeOut??0,preExtrapolationMode:o.preExtrapolation??Ye.None,postExtrapolationMode:o.postExtrapolation??Ye.None,reversed:o.reversed,asset:{clip:n,loop:o.loop??!1,duration:n.duration,removeStartOffset:o.removeStartOffset??!1}};i.clips.push(h),i.cursor=l;break}case me.Audio:{const n=e,o=t??{},r=o.duration,a=o.start??i.cursor,l=a+r,h={start:a,end:l,duration:r,timeScale:o.speed??1,clipIn:0,easeInDuration:o.easeIn??0,easeOutDuration:o.easeOut??0,preExtrapolationMode:Ye.None,postExtrapolationMode:Ye.None,asset:{clip:n,loop:o.loop??!1,volume:o.volume??1}};i.clips.push(h),i.cursor=l;break}case me.Activation:{const n=e,o=n.start??i.cursor,r=o+n.duration,a={start:o,end:r,duration:n.duration,timeScale:1,clipIn:0,easeInDuration:n.easeIn??0,easeOutDuration:n.easeOut??0,preExtrapolationMode:Ye.None,postExtrapolationMode:Ye.None,asset:{}};i.clips.push(a),i.cursor=r;break}case me.Control:{const n=e,o=t??{},r=o.start??i.cursor,a=o.duration,l=r+a,h={start:r,end:l,duration:a,timeScale:1,clipIn:0,easeInDuration:0,easeOutDuration:0,preExtrapolationMode:Ye.None,postExtrapolationMode:Ye.None,asset:{sourceObject:n,controlActivation:o.controlActivation??!0,updateDirector:o.updateDirector??!0}};i.clips.push(h),i.cursor=l;break}default:throw new Error(`TimelineBuilder: .clip() is not supported on track type "${i.type}"`)}return this}marker(e,t,i){if(!this._currentTrack)throw new Error("TimelineBuilder: .marker() must be called after a track method");if(this._currentTrack.type!==me.Signal&&this._currentTrack.type!==me.Marker)throw new Error(`TimelineBuilder: .marker() is only supported on signal and marker tracks, not "${this._currentTrack.type}"`);const n={type:$c.Signal,time:e,retroActive:i?.retroActive??!1,emitOnce:i?.emitOnce??!1,asset:t};return this._currentTrack.markers.push(n),e>this._currentTrack.cursor&&(this._currentTrack.cursor=e),this}signal(e,t,i){if(!this._currentTrack)throw new Error("TimelineBuilder: .signal() must be called after a track method");if(this._currentTrack.type!==me.Signal&&this._currentTrack.type!==me.Marker)throw new Error(`TimelineBuilder: .signal() is only supported on signal and marker tracks, not "${this._currentTrack.type}"`);const n=this._idProvider.generateUUID(),o=this._tracks.indexOf(this._currentTrack),r={type:$c.Signal,time:e,retroActive:i?.retroActive??!1,emitOnce:i?.emitOnce??!1,asset:n};return this._currentTrack.markers.push(r),this._pendingSignals.push({trackIndex:o,guid:n,callback:t}),e>this._currentTrack.cursor&&(this._currentTrack.cursor=e),this}muted(e=!0){if(!this._currentTrack)throw new Error("TimelineBuilder: .muted() must be called after a track method");return this._currentTrack.muted=e,this}track(e,t,i,n){if(!this._currentTrack)throw new Error("TimelineBuilder: .track() must be called after .animationTrack()");if(this._currentTrack.type!==me.Animation)throw new Error("TimelineBuilder: .track() is only supported on animation tracks");return this._currentTrack.inlineTracks.push(oy(e,t,i,n)),this}build(){this.commitInlineTracks();const e=this._tracks.map(t=>{const i={name:t.name,type:t.type,muted:t.muted,outputs:t.outputs};return t.clips.length>0&&(i.clips=t.clips),t.markers.length>0&&(i.markers=t.markers),t.volume!==void 0&&(i.volume=t.volume),t.trackOffset!==void 0&&(i.trackOffset=t.trackOffset),i});return{name:this._name,tracks:e}}install(e){const t=this.build();if(this._pendingSignals.length>0){const i=e.gameObject;let n=C.getComponent(i,_r);n||(n=C.addComponent(i,_r)),n.events||(n.events=[]);for(const o of this._pendingSignals){const r=new ch;r.guid=o.guid;const a=new nl;a.signal=r,a.reaction=new K([o.callback]),n.events.push(a);const l=t.tracks[o.trackIndex];l&&!l.outputs.includes(n)&&l.outputs.push(n)}}return e.playableAsset=t,t}pushTrack(e,t,i){const n={name:e,type:t,muted:!1,outputs:i?[i]:[],clips:[],markers:[],cursor:0,inlineTracks:[]};return this._tracks.push(n),n}commitInlineTracks(){if(!this._currentTrack||this._currentTrack.inlineTracks.length===0)return;const e=this._currentTrack,t=e.outputs[0],i=t instanceof c.Object3D?t:t!=null&&"gameObject"in t?t.gameObject:void 0,n=Fc(e.inlineTracks,i),o=e.cursor,r=n.duration,a={start:o,end:o+r,duration:r,timeScale:1,clipIn:0,easeInDuration:0,easeOutDuration:0,preExtrapolationMode:Ye.None,postExtrapolationMode:Ye.None,asset:{clip:n,loop:!1,duration:n.duration,removeStartOffset:!1}};e.clips.push(a),e.cursor=o+r,e.inlineTracks=[]}}class hC{}const LI=Object.freeze(Object.defineProperty({__proto__:null,ActionBuilder:ue,ActionCollection:fS,ActionModel:si,AlignmentConstraint:dh,Animation:Dt,AnimationBuilder:ef,AnimationCurve:Ph,AnimationExtension:wf,Animator:mt,AnimatorController:Nn,Antialiasing:Oh,Attractor:_l,AudioExtension:Tr,AudioListener:ys,AudioSource:Pi,Avatar:_o,AvatarMarker:Ke,AxesHelper:sl,AxisRotationConstraint:wy,BaseUIComponent:Qi,BasicIKConstraint:my,BehaviorExtension:qy,BehaviorModel:Ot,BloomEffect:jf,BoxCollider:ff,BoxGizmo:Ir,BoxHelperComponent:kt,Button:Us,CallInfo:$n,Camera:Xt,CameraTargetReachedEvent:Nc,Canvas:Xa,CanvasGroup:bo,CapsuleCollider:ks,ChangeMaterialOnClick:zy,ChangeTransformOnClick:Rr,CharacterController:Mr,CharacterControllerInput:Ts,ChromaticAberration:Mh,ClickThrough:qf,ColorAdjustments:To,ColorBySpeedModule:yl,ColorOverLifetimeModule:Df,ContactShadows:uh,CursorFollow:Hr,CustomBranding:Dr,Deletable:by,DeleteBox:uo,DepthOfField:wn,DeviceFlag:pf,DocumentExtension:cC,DragControls:tr,DragProfile:Su,DropListener:As,Duplicatable:Ry,EffectWrapper:Xc,EmissionModule:js,EmphasizeOnClick:ll,EnvironmentScene:df,EventList:K,EventListEvent:ry,EventSystem:Yt,EventTrigger:bf,FieldWithDefault:Xx,FixedJoint:a_,FixedRotationAxesConstraint:Bx,Fog:fl,GltfExport:jy,GltfExportBox:Iy,GrabPointPlaneConstraint:ph,Gradient:jr,Graphic:xh,GraphicRaycaster:of,GridHelper:pl,GridLayoutGroup:Jy,GridSnapConstraint:mf,GroundProjectedEnv:Zn,GroupActionModel:ir,HideOnStart:$i,HingeJoint:Ch,HorizontalLayoutGroup:Zy,get HoverAnimation(){return exports.HoverAnimation},Image:Cl,InheritVelocityModule:u_,InputField:P_,InstanceHandle:dr,InstancingHandler:wr,Interactable:_y,KeepRotationConstraint:gf,KeepScaleConstraint:jx,Keyframe:hi,LODGroup:Tf,LODModel:ml,Light:Et,LimitVelocityOverLifetimeModule:ct,LogStats:yy,LookAt:k_,LookAtConstraint:kr,MainModule:jt,MaskableGraphic:Sh,MeshCollider:Co,MeshRenderer:gh,MinMaxCurve:q,MinMaxGradient:Br,NeedleMenu:es,NestedGltf:gl,Networking:h_,NoiseModule:pe,ObjectRaycaster:Xi,OffsetConstraint:Lr,OpenURL:Pl,OrbitControls:ce,Outline:ul,Padding:Ar,ParticleBurst:Au,ParticleSubEmitter:f_,ParticleSystem:qc,ParticleSystemRenderer:en,PhysicsExtension:Xy,PixelationEffect:Eh,PlaneHeightLockConstraint:xy,PlayAnimationOnClick:Gc,PlayAudioOnClick:yo,PlayableDirector:Ga,PlayerColor:Qa,PointerEventData:lh,PostProcessingHandler:Ka,PreliminaryAction:cl,PreliminaryTrigger:_h,RawImage:Wf,Rect:xS,RectTransform:_n,ReflectionProbe:us,RegisteredAnimationInfo:lo,RemoteSkybox:fy,Renderer:Kt,RendererLightmap:My,Rigidbody:Ge,RotationBySpeedModule:Ji,RotationOverLifetimeModule:vn,ScaleLimitConstraint:vy,SceneSwitcher:He,ScreenCapture:Ro,ScreenSpaceAmbientOcclusion:Bs,ScreenSpaceAmbientOcclusionN8:xn,ScrollFollow:ns,SeeThrough:v_,SetActiveOnClick:Ny,ShadowCatcher:Ih,ShapeModule:d_,SharpeningEffect:Rh,SignalAsset:ch,SignalReceiver:_r,SignalReceiverEvent:nl,SignalTrackHandler:Wc,Size:wS,SizeBySpeedModule:mi,SizeOverLifetimeModule:Fr,SkinnedMeshRenderer:Ey,SmoothFollow:Uf,SnapToSurfaceConstraint:Sy,SpatialGrabRaycaster:yr,SpatialHtml:Fh,SpatialTrigger:zf,SpatialTriggerReceiver:Xn,SpectatorCamera:Nf,SphereCollider:ol,SplineContainer:Wr,SplineData:Qn,SplineWalker:nn,Sprite:Ds,SpriteData:Ia,SpriteRenderer:fi,SpriteSheet:qa,SubEmitterSystem:Du,SyncedCamera:w_,SyncedRoom:Sn,SyncedTransform:yn,TapGestureTrigger:Vy,TeleportTarget:kf,TestRunner:x_,TestSimulateUserData:S_,Text:Lt,TextBuilder:Yy,TextExtension:Mf,TextureSheetAnimationModule:Bt,TiltShiftEffect:is,TimelineActivationTrack:lf,TimelineAnimationTrack:Vc,TimelineAudioTrack:_s,TimelineBuilder:Kf,TimelineControlTrack:cf,TimelineMarkerTrack:af,ToneMappingEffect:Ur,TrailModule:je,TransformData:De,TransformGizmo:Gr,TriggerBuilder:At,TriggerModel:fo,UIRaycastUtils:ly,UIRootComponent:vh,USDZExporter:qn,USDZText:Sa,USDZUIExtension:t_,UsageMarker:fh,VariantAction:Uy,VelocityOverLifetimeModule:ze,VerticalLayoutGroup:Ky,VideoPlayer:at,get ViewBox(){return exports.ViewBox},Vignette:$r,VisibilityAction:bh,Voip:Fs,Volume:vl,VolumeParameter:z,VolumeProfile:If,WebARCameraBackground:zh,WebARSessionRoot:Hi,WebXR:Of,WebXRImageTracking:Nh,WebXRImageTrackingModel:Ns,WebXRPlaneTracking:$s,WebXRTrackedImage:Ya,XRControllerFollow:zs,XRControllerModel:Os,XRControllerMovement:Oi,XRFlag:un,XRRig:Yf,XRState:Ht,__Ignore:hC},Symbol.toStringTag,{value:"Module"}));exports.SplineUtils=void 0;(s=>{function e(t,i=!1,n=.75){const o=new Wr,r=1-L.clamp(n,0,1);return t.forEach((a,l)=>{const h=new c.Vector3;l<t.length-1?h.subVectors(t[l+1],a).normalize().multiplyScalar(r):i&&t.length>1&&h.subVectors(t[0],a).normalize().multiplyScalar(r);const d=new Qn;d.position.copy(a),d.tangentIn.copy(h),d.tangentOut.copy(h),o.addKnot(d)}),o.closed=i,o}s.createFromPoints=e})(exports.SplineUtils||(exports.SplineUtils={}));class jI extends de.WorkerBase{constructor(){super(new Worker(new URL("/generateMeshBVH.worker-DiCnZlf3.js",typeof document>"u"?require("url").pathToFileURL(__filename).href:Pa&&Pa.tagName.toUpperCase()==="SCRIPT"&&Pa.src||new URL("needle-engine.bundle-CdVr_iIe.umd.cjs",document.baseURI).href),{type:"module"})),this.name="GenerateMeshBVHWorker"}runTask(e,t,i={}){return new Promise((n,o)=>{if(t.getAttribute("position").isInterleavedBufferAttribute||t.index&&t.index.isInterleavedBufferAttribute)throw new Error("GenerateMeshBVHWorker: InterleavedBufferAttribute are not supported for the geometry attributes.");e.onerror=h=>{o(new Error(`[GenerateMeshBVHWorker] ${h.message||"Could not load worker."}`))},e.onmessage=h=>{const{data:d}=h;if(d.error)o(new Error(d.error)),e.onmessage=null;else if(d.serialized){const{serialized:u,position:f}=d,m=de.MeshBVH.deserialize(u,t,{setIndex:!1}),g=Object.assign({setBoundingBox:!0},i);if(t.attributes.position.array=f,u.index)if(t.index)t.index.array=u.index;else{const b=new c.BufferAttribute(u.index,1,!1);t.setIndex(b)}g.setBoundingBox&&(t.boundingBox=m.getBoundingBox(new c.Box3)),i.onProgress&&i.onProgress(d.progress),n(m),e.onmessage=null}else i.onProgress&&i.onProgress(d.progress)};const r=t.index?t.index.array:null,a=t.attributes.position.array,l=[a];r&&l.push(r),e.postMessage({index:r,position:a,options:{...i,onProgress:null,includedProgressCallback:!!i.onProgress,groups:[...t.groups]}},l.map(h=>h.buffer).filter(h=>typeof SharedArrayBuffer>"u"||!(h instanceof SharedArrayBuffer)))})}}const BI=Object.freeze(Object.defineProperty({__proto__:null,GenerateMeshBVHWorker:jI},Symbol.toStringTag,{value:"Module"}));exports.$componentName=lu;exports.$fwGZrGe=pn;exports.$physicsKey=H1;exports.ActionBuilder=ue;exports.ActionCollection=fS;exports.ActionModel=si;exports.Addressables=cw;exports.AlignmentConstraint=dh;exports.AmbientMode=Ea;exports.Animation=Dt;exports.AnimationBuilder=ef;exports.AnimationCurve=Ph;exports.AnimationExtension=wf;exports.Animator=mt;exports.AnimatorConditionMode=ai;exports.AnimatorController=Nn;exports.AnimatorControllerBuilder=tf;exports.AnimatorControllerParameterType=er;exports.AnimatorStateInfo=Jl;exports.Antialiasing=Oh;exports.Application=gn;exports.AssetDatabase=Gw;exports.AssetReference=Y;exports.Attractor=_l;exports.AudioClip=Xm;exports.AudioExtension=Tr;exports.AudioListener=ys;exports.AudioRolloffMode=Ox;exports.AudioSource=Pi;exports.Avatar=_o;exports.AvatarMarker=Ke;exports.Axes=va;exports.AxesHelper=sl;exports.AxisRotationConstraint=wy;exports.BUILD_TIME=Mc;exports.BaseUIComponent=Qi;exports.BasicIKConstraint=my;exports.BehaviorExtension=qy;exports.BehaviorModel=Ot;exports.BloomEffect=jf;exports.BoxCollider=ff;exports.BoxGizmo=Ir;exports.BoxHelperComponent=kt;exports.Button=Us;exports.ButtonsFactory=Gi;exports.CallDirection=BS;exports.CallInfo=$n;exports.Camera=Xt;exports.CameraTargetReachedEvent=Nc;exports.Canvas=Xa;exports.CanvasGroup=bo;exports.CapsuleCollider=ks;exports.ChangeMaterialOnClick=zy;exports.ChangeTransformOnClick=Rr;exports.CharacterController=Mr;exports.CharacterControllerInput=Ts;exports.ChromaticAberration=Mh;exports.CircularBuffer=xi;exports.ClearFlags=hr;exports.ClickThrough=qf;exports.ClipExtrapolation=Ye;exports.Collider=Ti;exports.Collision=$0;exports.CollisionDetectionMode=sf;exports.ColorAdjustments=To;exports.ColorBySpeedModule=yl;exports.ColorOverLifetimeModule=Df;exports.Component=xO;exports.Component$1=R;exports.ComponentLifecycleEvents=Uu;exports.Components=LI;exports.ConnectionEvents=vw;exports.ContactPoint=N0;exports.ContactShadows=uh;exports.Context=U;exports.ContextArgs=Ik;exports.ContextEvent=le;exports.ContextRegistry=ae;exports.CursorFollow=Hr;exports.CustomBranding=Dr;exports.CustomShader=xe;exports.DefaultReflectionMode=mu;exports.Deletable=by;exports.DeleteBox=uo;exports.DepthOfField=wn;exports.DeviceFlag=pf;exports.DirectorWrapMode=Ex;exports.DisposableStore=Wd;exports.DocumentExtension=cC;exports.DragControls=tr;exports.DragMode=Cy;exports.DragProfile=Su;exports.DropListener=As;exports.Duplicatable=Ry;exports.EffectWrapper=Xc;exports.EmissionModule=js;exports.EmphasizeOnClick=ll;exports.EngineLoadingView=Qc;exports.EnvironmentScene=df;exports.EventBus=Om;exports.EventList=K;exports.EventListEvent=ry;exports.EventSystem=Yt;exports.EventTrigger=bf;exports.FieldWithDefault=Xx;exports.FileReference=rr;exports.FileReferenceSerializer=dw;exports.FileSpawnModel=kE;exports.File_Event=Ux;exports.FixedJoint=a_;exports.FixedRotationAxesConstraint=Bx;exports.Fog=fl;exports.FontStyle=Tu;exports.FrameEvent=_e;exports.GENERATOR=Ba;exports.GameObject=C;exports.Gizmos=B;exports.GltfExport=jy;exports.GltfExportBox=Iy;exports.GrabPointPlaneConstraint=ph;exports.Gradient=jr;exports.Graphic=xh;exports.GraphicRaycaster=of;exports.Graphics=mo;exports.GridHelper=pl;exports.GridLayoutGroup=Jy;exports.GridSnapConstraint=mf;exports.GroundProjectedEnv=Zn;exports.GroupActionModel=ir;exports.HideFlags=Nu;exports.HideOnStart=$i;exports.HingeJoint=Ch;exports.HorizontalLayoutGroup=Zy;exports.HorizontalWrapMode=OS;exports.HostData=pP;exports.Image=Cl;exports.ImageReference=or;exports.ImageReferenceSerializer=hw;exports.InheritVelocityModule=u_;exports.Input=pw;exports.InputEventQueue=ri;exports.InputEvents=ye;exports.InputField=P_;exports.InstanceHandle=dr;exports.InstancingHandler=wr;exports.InstancingUtil=qi;exports.InstantiateEvent=K0;exports.InstantiateIdProvider=rt;exports.InstantiateOptions=Kn;exports.Interactable=_y;exports.JoinedRoomResponse=HP;exports.KeepRotationConstraint=gf;exports.KeepScaleConstraint=jx;exports.KeyEventArgs=FP;exports.Keyframe=hi;exports.LODGroup=Tf;exports.LODModel=ml;exports.LODsManager=mw;exports.LeftRoomResponse=qP;exports.Light=Et;exports.LightData=Mw;exports.LimitVelocityOverLifetimeModule=ct;exports.LoadingElementOptions=vI;exports.LogStats=yy;exports.LogType=vi;exports.LookAt=k_;exports.LookAtConstraint=kr;exports.MODULES=A;exports.MainModule=jt;exports.MarkerType=$c;exports.MaskableGraphic=Sh;exports.MaterialPropertyBlock=Ss;exports.Mathf=L;exports.MeshCollider=Co;exports.MeshRenderer=gh;exports.MinMaxCurve=q;exports.MinMaxGradient=Br;exports.NEEDLE_ENGINE_FEATURE_FLAGS=Ag;exports.NEKeyboardEvent=Yl;exports.NEPointerEvent=ds;exports.NeedleButtonElement=oC;exports.NeedleEngineWebComponent=A_;exports.NeedleMenu=es;exports.NeedlePatchesKey=Id;exports.NeedleXRController=qg;exports.NeedleXRSession=H;exports.NeedleXRSync=Dw;exports.NeedleXRUtils=Ww;exports.NestedGltf=gl;exports.NetworkConnection=Tc;exports.NetworkedStreamEvents=Wn;exports.NetworkedStreams=Ah;exports.Networking=h_;exports.NewInstanceModel=J0;exports.NoiseModule=pe;exports.ObjectRaycaster=Xi;exports.ObjectUtils=xo;exports.OffsetConstraint=Lr;exports.OneEuroFilter=Ad;exports.OneEuroFilterXYZ=Sg;exports.OpenURL=Pl;exports.OrbitControls=ce;exports.Outline=ul;exports.OwnershipEvent=ww;exports.OwnershipModel=xw;exports.PUBLIC_KEY=ro;exports.Padding=Ar;exports.ParticleBurst=Au;exports.ParticleSubEmitter=f_;exports.ParticleSystem=qc;exports.ParticleSystemBaseBehaviour=Eo;exports.ParticleSystemRenderer=en;exports.ParticleSystemShapeType=Ru;exports.PeerHandle=vs;exports.PeerNetworking=bw;exports.Physics=Wa;exports.PhysicsExtension=Xy;exports.PhysicsMaterialCombine=ht;exports.PixelationEffect=Eh;exports.PlaneHeightLockConstraint=xy;exports.PlayAnimationOnClick=Gc;exports.PlayAudioOnClick=yo;exports.PlayableDirector=Ga;exports.PlayerColor=Qa;exports.PlayerState=li;exports.PlayerStateEvent=gS;exports.PlayerSync=Gy;exports.PlayerView=Sw;exports.PlayerViewManager=Cw;exports.PointerEventData=lh;exports.PointerType=Gu;exports.PostProcessing=Aw;exports.PostProcessingEffect=Je;exports.PostProcessingEffectOrder=st;exports.PostProcessingHandler=Ka;exports.Prefabs=Fa;exports.PreliminaryAction=cl;exports.PreliminaryTrigger=_h;exports.PrimitiveType=Za;exports.Progress=re;exports.PromiseAllWithErrors=wg;exports.PromiseErrorResult=dm;exports.RGBAColor=ie;exports.RapierPhysics=La;exports.RawImage=Wf;exports.RaycastOptions=Sr;exports.Rect=xS;exports.RectTransform=_n;exports.ReflectionProbe=us;exports.ReflectionProbeUsage=qx;exports.RegisteredAnimationInfo=lo;exports.RemoteSkybox=fy;exports.RenderTexture=Vn;exports.RenderTextureSerializer=bx;exports.Renderer=Kt;exports.RendererData=Ow;exports.RendererLightmap=My;exports.Rigidbody=Ge;exports.RigidbodyConstraints=We;exports.RoomEvents=Z;exports.RotationBySpeedModule=Ji;exports.RotationOverLifetimeModule=vn;exports.ScaleLimitConstraint=vy;exports.SceneLightSettings=Cu;exports.SceneSwitcher=He;exports.ScreenCapture=Ro;exports.ScreenSpaceAmbientOcclusion=Bs;exports.ScreenSpaceAmbientOcclusionN8=xn;exports.ScrollFollow=ns;exports.SeeThrough=v_;exports.SendQueue=dn;exports.SerializationContext=Ng;exports.SetActiveOnClick=Ny;exports.ShadowCastingMode=Ou;exports.ShadowCatcher=Ih;exports.ShapeModule=d_;exports.ShapeOverlapResult=V0;exports.SharpeningEffect=Rh;exports.SignalAsset=ch;exports.SignalReceiver=_r;exports.SignalReceiverEvent=nl;exports.SignalTrackHandler=Wc;exports.Size=wS;exports.SizeBySpeedModule=mi;exports.SizeOverLifetimeModule=Fr;exports.SkinnedMeshRenderer=Ey;exports.SmoothFollow=Uf;exports.SnapToSurfaceConstraint=Sy;exports.SpatialGrabRaycaster=yr;exports.SpatialHtml=Fh;exports.SpatialTrigger=zf;exports.SpatialTriggerReceiver=Xn;exports.SpectatorCamera=Nf;exports.SphereCollider=ol;exports.SphereIntersection=Zg;exports.SplineContainer=Wr;exports.SplineData=Qn;exports.SplineWalker=nn;exports.Sprite=Ds;exports.SpriteData=Ia;exports.SpriteRenderer=fi;exports.SpriteSheet=qa;exports.StateMachineBehaviour=OO;exports.StreamEndedEvent=b_;exports.StreamReceivedEvent=jS;exports.SubEmitterSystem=Du;exports.SyncedCamera=w_;exports.SyncedRoom=Sn;exports.SyncedTransform=yn;exports.TapGestureTrigger=Vy;exports.TeleportTarget=kf;exports.TestRunner=x_;exports.TestSimulateUserData=S_;exports.Text=Lt;exports.TextAnchor=Qe;exports.TextBuilder=Yy;exports.TextExtension=Mf;exports.TextureSheetAnimationModule=Bt;exports.TiltShiftEffect=is;exports.Time=Ew;exports.TimelineActivationTrack=lf;exports.TimelineAnimationTrack=Vc;exports.TimelineAudioTrack=_s;exports.TimelineBuilder=Kf;exports.TimelineControlTrack=cf;exports.TimelineMarkerTrack=af;exports.TimelineTrackHandler=Or;exports.ToneMappingEffect=Ur;exports.TrackType=me;exports.TrailModule=je;exports.TransformData=De;exports.TransformGizmo=Gr;exports.TriggerBuilder=At;exports.TriggerModel=fo;exports.TypeStore=P;exports.UIRaycastUtils=ly;exports.UIRootComponent=vh;exports.USDDocument=By;exports.USDObject=Ze;exports.USDWriter=sS;exports.USDZExporter=oS;exports.USDZExporter$1=qn;exports.USDZText=Sa;exports.USDZUIExtension=t_;exports.UriSerializer=vx;exports.UsageMarker=fh;exports.UserJoinedOrLeftRoomModel=XP;exports.VERSION=ci;exports.VariantAction=Uy;exports.VelocityOverLifetimeModule=ze;exports.VerticalLayoutGroup=Ky;exports.VerticalWrapMode=kS;exports.VideoPlayer=at;exports.ViewDevice=xs;exports.Vignette=$r;exports.VisibilityAction=bh;exports.Voip=Fs;exports.Volume=vl;exports.VolumeParameter=z;exports.VolumeProfile=If;exports.WaitForFrames=IP;exports.WaitForPromise=fw;exports.WaitForSeconds=$g;exports.Watch=ws;exports.WebARCameraBackground=zh;exports.WebARSessionRoot=Hi;exports.WebXR=Of;exports.WebXRButtonFactory=po;exports.WebXRImageTracking=Nh;exports.WebXRImageTrackingModel=Ns;exports.WebXRPlaneTracking=$s;exports.WebXRTrackedImage=Ya;exports.XRControllerFollow=zs;exports.XRControllerModel=Os;exports.XRControllerMovement=Oi;exports.XRFlag=un;exports.XRRig=Yf;exports.XRState=Ht;exports.XRStateFlag=Fn;exports._$qWUhYZU=th;exports._XtEQ=Gn;exports.__Ignore=hC;exports.__internalNotifyObjectDestroyed=Vk;exports.activeInHierarchyFieldName=zn;exports.addAttributeChangeCallback=iu;exports.addComponent=Hn;exports.addCustomExtensionPlugin=YE;exports.addNewComponent=lr;exports.addPatch=zu;exports.apply=Ku;exports.applyHMRChanges=bO;exports.applyPrototypeExtensions=ex;exports.beginListenDestroy=Z0;exports.beginListenInstantiate=iw;exports.binaryIdentifierCasts=Vg;exports.build_scene_functions=Dk;exports.builtinComponentKeyName=Qo;exports.calculateProgress01=R_;exports.clearMessages=UC;exports.compareAssociation=ow;exports.copyTexture=O0;exports.createMotion=gx;exports.debugNet=ii;exports.debugOwner=la;exports.decompressGpuTexture=cS;exports.deepClone=Kc;exports.delay=Cs;exports.delayForFrames=ju;exports.deserializeObject=fu;exports.destroy=Ci;exports.destroyComponentInstance=hx;exports.determineMimeTypeFromExtension=zx;exports.disposeObjectResources=Se;exports.disposeStream=Vi;exports.editorGuidKeyName=hc;exports.enableSpatialConsole=ka;exports.exportAsGLTF=RI;exports.findByGuid=ty;exports.findObjectOfType=il;exports.findObjectsOfType=ux;exports.findResourceUsers=Jg;exports.fitCamera=Cx;exports.fitObjectIntoVolume=E0;exports.foreachComponent=gr;exports.foreachComponentEnumerator=iy;exports.forward=s1;exports.generateQRCode=zw;exports.generateSeed=tw;exports.getBoundingBox=di;exports.getCameraController=b0;exports.getComponent=So;exports.getComponentInChildren=rh;exports.getComponentInParent=jc;exports.getComponents=el;exports.getComponentsInChildren=tl;exports.getComponentsInParent=Ju;exports.getFormattedDate=eS;exports.getIconElement=pt;exports.getIconTexture=Tm;exports.getLoader=Ps;exports.getOrAddComponent=oh;exports.getParam=x;exports.getParentHierarchyPath=a1;exports.getPath=yC;exports.getPeerOptions=NP;exports.getPeerjsInstance=_w;exports.getResourceUserCount=Gk;exports.getSceneData=kw;exports.getTempColor=S0;exports.getTempQuaternion=oi;exports.getTempVector=j;exports.getUrlParams=Yc;exports.getVisibleInCustomShadowRendering=M0;exports.getWorldDirection=C0;exports.getWorldEuler=kg;exports.getWorldPosition=ee;exports.getWorldQuaternion=ge;exports.getWorldRotation=Fu;exports.getWorldScale=Fe;exports.hasPointerEventComponent=wu;exports.hideDebugConsole=D0;exports.imageToCanvas=hS;exports.initAddressableSerializers=uw;exports.initBuiltinSerializers=wx;exports.initEngine=MI;exports.initPhysics=sC;exports.initVolumeParameterSerializer=Rx;exports.instantiate=go;exports.invokeLoadedImportPluginHooks=Hx;exports.invokeXRSessionEnd=Uw;exports.invokeXRSessionStart=Fw;exports.isActiveInHierarchy=tx;exports.isActiveSelf=Ja;exports.isAndroidDevice=SC;exports.isAnimationAction=k0;exports.isComponent=$u;exports.isDebugMode=uC;exports.isDesktop=bC;exports.isDestroyed=mr;exports.isDevEnvironment=T;exports.isDisposable=vO;exports.isDisposed=$k;exports.isExporting=EI;exports.isGLTFModel=z0;exports.isHostedOnGlitch=r0;exports.isHotReloadEnabled=Hm;exports.isHotReloading=yO;exports.isIPad=wC;exports.isIconElement=Nw;exports.isLocalNetwork=wi;exports.isMacOS=PC;exports.isMobileDevice=vC;exports.isMozillaXR=CC;exports.isQuest=MC;exports.isResourceTrackingEnabled=qw;exports.isSafari=OC;exports.isTrackModel=AM;exports.isUsingInstancing=Zu;exports.isiOS=kC;exports.isiPad=xC;exports.loadAsset=hI;exports.loadPMREM=uf;exports.loadSync=T_;exports.logHierarchy=ru;exports.lookAtInverse=YC;exports.lookAtObject=Zc;exports.lookAtScreenPoint=KC;exports.makeId=pC;exports.makeIdFromRandomWords=c0;exports.makeNameSafe=ki;exports.markAsInstancedRendered=ix;exports.microphonePermissionsGranted=EC;exports.nameof=dC;exports.nameofFactory=a0;exports.needle=YP;exports.offBeforeXRSession=Bw;exports.offXRSessionEnd=jw;exports.offXRSessionStart=Lw;exports.on=wO;exports.onAfterRender=Z1;exports.onBeforeRender=K1;exports.onBeforeXRSession=Ck;exports.onClear=Q1;exports.onDestroy=Y1;exports.onInitialized=Lg;exports.onStart=Wu;exports.onSyncDestroy=fP;exports.onSyncInstantiate=ew;exports.onUpdate=q0;exports.onXRSessionEnd=Qg;exports.onXRSessionStart=qu;exports.parseSync=iC;exports.placeOnSurface=T0;exports.postprocessFBXMaterials=Eg;exports.prefix=uM;exports.pushState=l0;exports.randomNumber=mC;exports.registerBinaryType=Wg;exports.registerComponent=Qu;exports.registerComponentExtension=ky;exports.registerCustomEffectType=tn;exports.registerExportExtensions=Oy;exports.registerExtensions=ku;exports.registerHotReloadType=fx;exports.registerLoader=G0;exports.registerPrefabProvider=nw;exports.registerPrototypeExtensions=ey;exports.registerType=Rg;exports.relativePathPrefix=d0;exports.removeAttributeChangeCallback=f0;exports.removeComponent=sy;exports.removeCustomImportExtensionType=KE;exports.removePatch=V1;exports.resolveUrl=Yn;exports.sanitizeString=h0;exports.saveImage=ZS;exports.screenshot=WD;exports.screenshot2=E_;exports.sendDestroyed=Bg;exports.serializable=p;exports.serializeObject=aw;exports.serializeable=Ue;exports.setActive=mc;exports.setAllowBalloonMessages=g0;exports.setAllowOverlayMessages=LC;exports.setAutoFitEnabled=su;exports.setCameraController=pm;exports.setDestroyed=sx;exports.setDevEnvironment=WC;exports.setDisposable=Qw;exports.setDontDestroy=ca;exports.setOrAddParamsToUrl=hm;exports.setParam=fC;exports.setParamWithoutReload=kc;exports.setPeerOptions=$P;exports.setResourceTrackingEnabled=Nk;exports.setState=bg;exports.setVisibleInCustomShadowRendering=Mg;exports.setWorldEuler=Og;exports.setWorldPosition=Si;exports.setWorldPositionXYZ=fr;exports.setWorldQuaternion=mn;exports.setWorldQuaternionXYZW=Pg;exports.setWorldRotation=P0;exports.setWorldRotationXYZ=Jc;exports.setWorldScale=ja;exports.showBalloonError=eh;exports.showBalloonMessage=ke;exports.showBalloonWarning=fe;exports.showDebugConsole=Tg;exports.slerp=w0;exports.syncDestroy=ih;exports.syncField=uy;exports.syncInstantiate=Fg;exports.textureToCanvas=l1;exports.toSourceId=u0;exports.tryCastBinary=gw;exports.tryDetermineMimetypeFromBinary=$x;exports.tryDetermineMimetypeFromURL=Nx;exports.tryFindObject=Oc;exports.tryGetGuid=yw;exports.unregisterHotReloadType=px;exports.unregisterPrefabProvider=gP;exports.unwatchWrite=vg;exports.useForAutoFit=v0;exports.validate=Ie;exports.watchWrite=Bu;
1734
+ `),ti&&this._onCreateEffectsDebug(this._composer,o)}createPassForMergeableEffects(e,t,i,n){if(e.length>0){const o=new A.POSTPROCESSING.MODULE.EffectPass(i,...e);o.name=e.map(r=>r.name).join(", "),o.mainScene=n,o.enabled=!0,o.renderToScreen=!1,t.addPass(o),e.length=0}}handleDevicePixelRatio(){typeof this.context.devicePixelRatio=="number"&&this.context.requestSizeUpdate()}_menuEntry=null;_passIndices=null;_onCreateEffectsDebug(e,t){if(ti==="passes"){const i=new A.POSTPROCESSING.MODULE.DepthEffect({blendFunction:A.POSTPROCESSING.MODULE.BlendFunction.NORMAL,inverted:!0});i.name="Depth Effect";const n=new A.POSTPROCESSING.MODULE.EffectPass(t,i);if(n.name="Depth Effect Pass",n.enabled=!1,e.passes.push(n),this._passIndices!==null){const r=[e.passes[0]];this._passIndices.length>0&&r.push(...this._passIndices.filter(a=>a!==0).map(a=>e.passes[a]).filter(a=>a)),r.length>0&&console.log("[PostProcessing] Passes (selected) →",r),e.passes.length=0;for(const a of r)a.enabled=!0,a.renderToScreen=!1,e.addPass(a)}const o=this.context.menu;if(o&&this._passIndices===null){this._menuEntry&&this._menuEntry.remove();const r=document.createElement("select");r.multiple=!0;const a=document.createElement("option");a.innerText="Final Output",a.value="-1",r.appendChild(a);for(const l of e.passes){const h=document.createElement("option");h.innerText=l.name,h.value=`${e.passes.indexOf(l)}`,h.title=l.name,r.appendChild(h)}o.appendChild(r),this._menuEntry=r,r.addEventListener("change",()=>{const l=Array.from(r.selectedOptions).map(h=>parseInt(h.value));l.length===1&&l[0]===-1?this._passIndices=null:this._passIndices=l,this.applyEffects(this.context)})}}}}const II=Object.freeze(Object.defineProperty({__proto__:null,PostProcessingHandler:Ka},Symbol.toStringTag,{value:"Module"}));class Kf{_name;_tracks=[];_currentTrack=null;_pendingSignals=[];_idProvider;constructor(e,t){this._name=e,this._idProvider=new rt(t??Date.now())}static create(e,t){return new Kf(e??"Timeline",t)}animationTrack(e,t){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Animation,t??null),this}audioTrack(e,t,i){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Audio,t??null),this._currentTrack.volume=i,this}activationTrack(e,t){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Activation,t??null),this}controlTrack(e){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Control,null),this}signalTrack(e,t){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Signal,t??null),this}markerTrack(e){return this.commitInlineTracks(),this._currentTrack=this.pushTrack(e,me.Marker,null),this}clip(e,t){if(!this._currentTrack)throw new Error("TimelineBuilder: .clip() must be called after a track method (e.g. .animationTrack())");this.commitInlineTracks();const i=this._currentTrack;switch(i.type){case me.Animation:{let n;if(e instanceof c.AnimationClip)n=e;else{const d=Array.isArray(e)?e:[e],u=i.outputs[0],f=u instanceof c.Object3D?u:u!=null&&"gameObject"in u?u.gameObject:void 0;n=Fc(d,f)}const o=t??{},r=o.duration??n.duration,a=o.start??i.cursor,l=a+r,h={start:a,end:l,duration:r,timeScale:o.speed??1,clipIn:o.clipIn??0,easeInDuration:o.easeIn??0,easeOutDuration:o.easeOut??0,preExtrapolationMode:o.preExtrapolation??Ye.None,postExtrapolationMode:o.postExtrapolation??Ye.None,reversed:o.reversed,asset:{clip:n,loop:o.loop??!1,duration:n.duration,removeStartOffset:o.removeStartOffset??!1}};i.clips.push(h),i.cursor=l;break}case me.Audio:{const n=e,o=t??{},r=o.duration,a=o.start??i.cursor,l=a+r,h={start:a,end:l,duration:r,timeScale:o.speed??1,clipIn:0,easeInDuration:o.easeIn??0,easeOutDuration:o.easeOut??0,preExtrapolationMode:Ye.None,postExtrapolationMode:Ye.None,asset:{clip:n,loop:o.loop??!1,volume:o.volume??1}};i.clips.push(h),i.cursor=l;break}case me.Activation:{const n=e,o=n.start??i.cursor,r=o+n.duration,a={start:o,end:r,duration:n.duration,timeScale:1,clipIn:0,easeInDuration:n.easeIn??0,easeOutDuration:n.easeOut??0,preExtrapolationMode:Ye.None,postExtrapolationMode:Ye.None,asset:{}};i.clips.push(a),i.cursor=r;break}case me.Control:{const n=e,o=t??{},r=o.start??i.cursor,a=o.duration,l=r+a,h={start:r,end:l,duration:a,timeScale:1,clipIn:0,easeInDuration:0,easeOutDuration:0,preExtrapolationMode:Ye.None,postExtrapolationMode:Ye.None,asset:{sourceObject:n,controlActivation:o.controlActivation??!0,updateDirector:o.updateDirector??!0}};i.clips.push(h),i.cursor=l;break}default:throw new Error(`TimelineBuilder: .clip() is not supported on track type "${i.type}"`)}return this}marker(e,t,i){if(!this._currentTrack)throw new Error("TimelineBuilder: .marker() must be called after a track method");if(this._currentTrack.type!==me.Signal&&this._currentTrack.type!==me.Marker)throw new Error(`TimelineBuilder: .marker() is only supported on signal and marker tracks, not "${this._currentTrack.type}"`);const n={type:$c.Signal,time:e,retroActive:i?.retroActive??!1,emitOnce:i?.emitOnce??!1,asset:t};return this._currentTrack.markers.push(n),e>this._currentTrack.cursor&&(this._currentTrack.cursor=e),this}signal(e,t,i){if(!this._currentTrack)throw new Error("TimelineBuilder: .signal() must be called after a track method");if(this._currentTrack.type!==me.Signal&&this._currentTrack.type!==me.Marker)throw new Error(`TimelineBuilder: .signal() is only supported on signal and marker tracks, not "${this._currentTrack.type}"`);const n=this._idProvider.generateUUID(),o=this._tracks.indexOf(this._currentTrack),r={type:$c.Signal,time:e,retroActive:i?.retroActive??!1,emitOnce:i?.emitOnce??!1,asset:n};return this._currentTrack.markers.push(r),this._pendingSignals.push({trackIndex:o,guid:n,callback:t}),e>this._currentTrack.cursor&&(this._currentTrack.cursor=e),this}muted(e=!0){if(!this._currentTrack)throw new Error("TimelineBuilder: .muted() must be called after a track method");return this._currentTrack.muted=e,this}track(e,t,i,n){if(!this._currentTrack)throw new Error("TimelineBuilder: .track() must be called after .animationTrack()");if(this._currentTrack.type!==me.Animation)throw new Error("TimelineBuilder: .track() is only supported on animation tracks");return this._currentTrack.inlineTracks.push(oy(e,t,i,n)),this}build(){this.commitInlineTracks();const e=this._tracks.map(t=>{const i={name:t.name,type:t.type,muted:t.muted,outputs:t.outputs};return t.clips.length>0&&(i.clips=t.clips),t.markers.length>0&&(i.markers=t.markers),t.volume!==void 0&&(i.volume=t.volume),t.trackOffset!==void 0&&(i.trackOffset=t.trackOffset),i});return{name:this._name,tracks:e}}install(e){const t=this.build();if(this._pendingSignals.length>0){const i=e.gameObject;let n=C.getComponent(i,_r);n||(n=C.addComponent(i,_r)),n.events||(n.events=[]);for(const o of this._pendingSignals){const r=new ch;r.guid=o.guid;const a=new nl;a.signal=r,a.reaction=new K([o.callback]),n.events.push(a);const l=t.tracks[o.trackIndex];l&&!l.outputs.includes(n)&&l.outputs.push(n)}}return e.playableAsset=t,t}pushTrack(e,t,i){const n={name:e,type:t,muted:!1,outputs:i?[i]:[],clips:[],markers:[],cursor:0,inlineTracks:[]};return this._tracks.push(n),n}commitInlineTracks(){if(!this._currentTrack||this._currentTrack.inlineTracks.length===0)return;const e=this._currentTrack,t=e.outputs[0],i=t instanceof c.Object3D?t:t!=null&&"gameObject"in t?t.gameObject:void 0,n=Fc(e.inlineTracks,i),o=e.cursor,r=n.duration,a={start:o,end:o+r,duration:r,timeScale:1,clipIn:0,easeInDuration:0,easeOutDuration:0,preExtrapolationMode:Ye.None,postExtrapolationMode:Ye.None,asset:{clip:n,loop:!1,duration:n.duration,removeStartOffset:!1}};e.clips.push(a),e.cursor=o+r,e.inlineTracks=[]}}class hC{}const LI=Object.freeze(Object.defineProperty({__proto__:null,ActionBuilder:ue,ActionCollection:fS,ActionModel:si,AlignmentConstraint:dh,Animation:Dt,AnimationBuilder:ef,AnimationCurve:Ph,AnimationExtension:wf,Animator:mt,AnimatorController:Nn,Antialiasing:Oh,Attractor:_l,AudioExtension:Tr,AudioListener:ys,AudioSource:Pi,Avatar:_o,AvatarMarker:Ke,AxesHelper:sl,AxisRotationConstraint:wy,BaseUIComponent:Qi,BasicIKConstraint:my,BehaviorExtension:qy,BehaviorModel:Ot,BloomEffect:jf,BoxCollider:ff,BoxGizmo:Ir,BoxHelperComponent:kt,Button:Us,CallInfo:$n,Camera:Xt,CameraTargetReachedEvent:Nc,Canvas:Xa,CanvasGroup:bo,CapsuleCollider:ks,ChangeMaterialOnClick:zy,ChangeTransformOnClick:Rr,CharacterController:Mr,CharacterControllerInput:Ts,ChromaticAberration:Mh,ClickThrough:qf,ColorAdjustments:To,ColorBySpeedModule:yl,ColorOverLifetimeModule:Df,ContactShadows:uh,CursorFollow:Hr,CustomBranding:Dr,Deletable:by,DeleteBox:uo,DepthOfField:wn,DeviceFlag:pf,DocumentExtension:cC,DragControls:tr,DragProfile:Su,DropListener:As,Duplicatable:Ry,EffectWrapper:Xc,EmissionModule:js,EmphasizeOnClick:ll,EnvironmentScene:df,EventList:K,EventListEvent:ry,EventSystem:Yt,EventTrigger:bf,FieldWithDefault:Xx,FixedJoint:a_,FixedRotationAxesConstraint:Bx,Fog:fl,GltfExport:jy,GltfExportBox:Iy,GrabPointPlaneConstraint:ph,Gradient:jr,Graphic:xh,GraphicRaycaster:of,GridHelper:pl,GridLayoutGroup:Jy,GridSnapConstraint:mf,GroundProjectedEnv:Zn,GroupActionModel:ir,HideOnStart:$i,HingeJoint:Ch,HorizontalLayoutGroup:Zy,get HoverAnimation(){return exports.HoverAnimation},Image:Cl,InheritVelocityModule:u_,InputField:P_,InstanceHandle:dr,InstancingHandler:wr,Interactable:_y,KeepRotationConstraint:gf,KeepScaleConstraint:jx,Keyframe:hi,LODGroup:Tf,LODModel:ml,Light:Et,LimitVelocityOverLifetimeModule:ct,LogStats:yy,LookAt:k_,LookAtConstraint:kr,MainModule:jt,MaskableGraphic:Sh,MeshCollider:Co,MeshRenderer:gh,MinMaxCurve:q,MinMaxGradient:Br,NeedleMenu:es,NestedGltf:gl,Networking:h_,NoiseModule:pe,ObjectRaycaster:Xi,OffsetConstraint:Lr,OpenURL:Pl,OrbitControls:ce,Outline:ul,Padding:Ar,ParticleBurst:Au,ParticleSubEmitter:f_,ParticleSystem:qc,ParticleSystemRenderer:en,PhysicsExtension:Xy,PixelationEffect:Eh,PlaneHeightLockConstraint:xy,PlayAnimationOnClick:Gc,PlayAudioOnClick:yo,PlayableDirector:Ga,PlayerColor:Qa,PointerEventData:lh,PostProcessingHandler:Ka,PreliminaryAction:cl,PreliminaryTrigger:_h,RawImage:Wf,Rect:xS,RectTransform:_n,ReflectionProbe:us,RegisteredAnimationInfo:lo,RemoteSkybox:fy,Renderer:Kt,RendererLightmap:My,Rigidbody:Ge,RotationBySpeedModule:Ji,RotationOverLifetimeModule:vn,ScaleLimitConstraint:vy,SceneSwitcher:He,ScreenCapture:Ro,ScreenSpaceAmbientOcclusion:Bs,ScreenSpaceAmbientOcclusionN8:xn,ScrollFollow:ns,SeeThrough:v_,SetActiveOnClick:Ny,ShadowCatcher:Ih,ShapeModule:d_,SharpeningEffect:Rh,SignalAsset:ch,SignalReceiver:_r,SignalReceiverEvent:nl,SignalTrackHandler:Wc,Size:wS,SizeBySpeedModule:mi,SizeOverLifetimeModule:Fr,SkinnedMeshRenderer:Ey,SmoothFollow:Uf,SnapToSurfaceConstraint:Sy,SpatialGrabRaycaster:yr,SpatialHtml:Fh,SpatialTrigger:zf,SpatialTriggerReceiver:Xn,SpectatorCamera:Nf,SphereCollider:ol,SplineContainer:Wr,SplineData:Qn,SplineWalker:nn,Sprite:Ds,SpriteData:Ia,SpriteRenderer:fi,SpriteSheet:qa,SubEmitterSystem:Du,SyncedCamera:w_,SyncedRoom:Sn,SyncedTransform:yn,TapGestureTrigger:Vy,TeleportTarget:kf,TestRunner:x_,TestSimulateUserData:S_,Text:Lt,TextBuilder:Yy,TextExtension:Mf,TextureSheetAnimationModule:Bt,TiltShiftEffect:is,TimelineActivationTrack:lf,TimelineAnimationTrack:Vc,TimelineAudioTrack:_s,TimelineBuilder:Kf,TimelineControlTrack:cf,TimelineMarkerTrack:af,ToneMappingEffect:Ur,TrailModule:je,TransformData:De,TransformGizmo:Gr,TriggerBuilder:At,TriggerModel:fo,UIRaycastUtils:ly,UIRootComponent:vh,USDZExporter:qn,USDZText:Sa,USDZUIExtension:t_,UsageMarker:fh,VariantAction:Uy,VelocityOverLifetimeModule:ze,VerticalLayoutGroup:Ky,VideoPlayer:at,get ViewBox(){return exports.ViewBox},Vignette:$r,VisibilityAction:bh,Voip:Fs,Volume:vl,VolumeParameter:z,VolumeProfile:If,WebARCameraBackground:zh,WebARSessionRoot:Hi,WebXR:Of,WebXRImageTracking:Nh,WebXRImageTrackingModel:Ns,WebXRPlaneTracking:$s,WebXRTrackedImage:Ya,XRControllerFollow:zs,XRControllerModel:Os,XRControllerMovement:Oi,XRFlag:un,XRRig:Yf,XRState:Ht,__Ignore:hC},Symbol.toStringTag,{value:"Module"}));exports.SplineUtils=void 0;(s=>{function e(t,i=!1,n=.75){const o=new Wr,r=1-L.clamp(n,0,1);return t.forEach((a,l)=>{const h=new c.Vector3;l<t.length-1?h.subVectors(t[l+1],a).normalize().multiplyScalar(r):i&&t.length>1&&h.subVectors(t[0],a).normalize().multiplyScalar(r);const d=new Qn;d.position.copy(a),d.tangentIn.copy(h),d.tangentOut.copy(h),o.addKnot(d)}),o.closed=i,o}s.createFromPoints=e})(exports.SplineUtils||(exports.SplineUtils={}));class jI extends de.WorkerBase{constructor(){super(new Worker(new URL("/generateMeshBVH.worker-DiCnZlf3.js",typeof document>"u"?require("url").pathToFileURL(__filename).href:Pa&&Pa.tagName.toUpperCase()==="SCRIPT"&&Pa.src||new URL("needle-engine.bundle-CWiO9cA8.umd.cjs",document.baseURI).href),{type:"module"})),this.name="GenerateMeshBVHWorker"}runTask(e,t,i={}){return new Promise((n,o)=>{if(t.getAttribute("position").isInterleavedBufferAttribute||t.index&&t.index.isInterleavedBufferAttribute)throw new Error("GenerateMeshBVHWorker: InterleavedBufferAttribute are not supported for the geometry attributes.");e.onerror=h=>{o(new Error(`[GenerateMeshBVHWorker] ${h.message||"Could not load worker."}`))},e.onmessage=h=>{const{data:d}=h;if(d.error)o(new Error(d.error)),e.onmessage=null;else if(d.serialized){const{serialized:u,position:f}=d,m=de.MeshBVH.deserialize(u,t,{setIndex:!1}),g=Object.assign({setBoundingBox:!0},i);if(t.attributes.position.array=f,u.index)if(t.index)t.index.array=u.index;else{const b=new c.BufferAttribute(u.index,1,!1);t.setIndex(b)}g.setBoundingBox&&(t.boundingBox=m.getBoundingBox(new c.Box3)),i.onProgress&&i.onProgress(d.progress),n(m),e.onmessage=null}else i.onProgress&&i.onProgress(d.progress)};const r=t.index?t.index.array:null,a=t.attributes.position.array,l=[a];r&&l.push(r),e.postMessage({index:r,position:a,options:{...i,onProgress:null,includedProgressCallback:!!i.onProgress,groups:[...t.groups]}},l.map(h=>h.buffer).filter(h=>typeof SharedArrayBuffer>"u"||!(h instanceof SharedArrayBuffer)))})}}const BI=Object.freeze(Object.defineProperty({__proto__:null,GenerateMeshBVHWorker:jI},Symbol.toStringTag,{value:"Module"}));exports.$KhjWEFh=Gn;exports.$componentName=lu;exports.$physicsKey=H1;exports.ActionBuilder=ue;exports.ActionCollection=fS;exports.ActionModel=si;exports.Addressables=cw;exports.AlignmentConstraint=dh;exports.AmbientMode=Ea;exports.Animation=Dt;exports.AnimationBuilder=ef;exports.AnimationCurve=Ph;exports.AnimationExtension=wf;exports.Animator=mt;exports.AnimatorConditionMode=ai;exports.AnimatorController=Nn;exports.AnimatorControllerBuilder=tf;exports.AnimatorControllerParameterType=er;exports.AnimatorStateInfo=Jl;exports.Antialiasing=Oh;exports.Application=gn;exports.AssetDatabase=Gw;exports.AssetReference=Y;exports.Attractor=_l;exports.AudioClip=Xm;exports.AudioExtension=Tr;exports.AudioListener=ys;exports.AudioRolloffMode=Ox;exports.AudioSource=Pi;exports.Avatar=_o;exports.AvatarMarker=Ke;exports.Axes=va;exports.AxesHelper=sl;exports.AxisRotationConstraint=wy;exports.BUILD_TIME=Mc;exports.BaseUIComponent=Qi;exports.BasicIKConstraint=my;exports.BehaviorExtension=qy;exports.BehaviorModel=Ot;exports.BloomEffect=jf;exports.BoxCollider=ff;exports.BoxGizmo=Ir;exports.BoxHelperComponent=kt;exports.Button=Us;exports.ButtonsFactory=Gi;exports.CallDirection=BS;exports.CallInfo=$n;exports.Camera=Xt;exports.CameraTargetReachedEvent=Nc;exports.Canvas=Xa;exports.CanvasGroup=bo;exports.CapsuleCollider=ks;exports.ChangeMaterialOnClick=zy;exports.ChangeTransformOnClick=Rr;exports.CharacterController=Mr;exports.CharacterControllerInput=Ts;exports.ChromaticAberration=Mh;exports.CircularBuffer=xi;exports.ClearFlags=hr;exports.ClickThrough=qf;exports.ClipExtrapolation=Ye;exports.Collider=Ti;exports.Collision=$0;exports.CollisionDetectionMode=sf;exports.ColorAdjustments=To;exports.ColorBySpeedModule=yl;exports.ColorOverLifetimeModule=Df;exports.Component=xO;exports.Component$1=R;exports.ComponentLifecycleEvents=Uu;exports.Components=LI;exports.ConnectionEvents=vw;exports.ContactPoint=N0;exports.ContactShadows=uh;exports.Context=U;exports.ContextArgs=Ik;exports.ContextEvent=le;exports.ContextRegistry=ae;exports.CursorFollow=Hr;exports.CustomBranding=Dr;exports.CustomShader=xe;exports.DefaultReflectionMode=mu;exports.Deletable=by;exports.DeleteBox=uo;exports.DepthOfField=wn;exports.DeviceFlag=pf;exports.DirectorWrapMode=Ex;exports.DisposableStore=Wd;exports.DocumentExtension=cC;exports.DragControls=tr;exports.DragMode=Cy;exports.DragProfile=Su;exports.DropListener=As;exports.Duplicatable=Ry;exports.EffectWrapper=Xc;exports.EmissionModule=js;exports.EmphasizeOnClick=ll;exports.EngineLoadingView=Qc;exports.EnvironmentScene=df;exports.EventBus=Om;exports.EventList=K;exports.EventListEvent=ry;exports.EventSystem=Yt;exports.EventTrigger=bf;exports.FieldWithDefault=Xx;exports.FileReference=rr;exports.FileReferenceSerializer=dw;exports.FileSpawnModel=kE;exports.File_Event=Ux;exports.FixedJoint=a_;exports.FixedRotationAxesConstraint=Bx;exports.Fog=fl;exports.FontStyle=Tu;exports.FrameEvent=_e;exports.GENERATOR=Ba;exports.GameObject=C;exports.Gizmos=B;exports.GltfExport=jy;exports.GltfExportBox=Iy;exports.GrabPointPlaneConstraint=ph;exports.Gradient=jr;exports.Graphic=xh;exports.GraphicRaycaster=of;exports.Graphics=mo;exports.GridHelper=pl;exports.GridLayoutGroup=Jy;exports.GridSnapConstraint=mf;exports.GroundProjectedEnv=Zn;exports.GroupActionModel=ir;exports.HideFlags=Nu;exports.HideOnStart=$i;exports.HingeJoint=Ch;exports.HorizontalLayoutGroup=Zy;exports.HorizontalWrapMode=OS;exports.HostData=pP;exports.Image=Cl;exports.ImageReference=or;exports.ImageReferenceSerializer=hw;exports.InheritVelocityModule=u_;exports.Input=pw;exports.InputEventQueue=ri;exports.InputEvents=ye;exports.InputField=P_;exports.InstanceHandle=dr;exports.InstancingHandler=wr;exports.InstancingUtil=qi;exports.InstantiateEvent=K0;exports.InstantiateIdProvider=rt;exports.InstantiateOptions=Kn;exports.Interactable=_y;exports.JoinedRoomResponse=HP;exports.KeepRotationConstraint=gf;exports.KeepScaleConstraint=jx;exports.KeyEventArgs=FP;exports.Keyframe=hi;exports.LODGroup=Tf;exports.LODModel=ml;exports.LODsManager=mw;exports.LeftRoomResponse=qP;exports.Light=Et;exports.LightData=Mw;exports.LimitVelocityOverLifetimeModule=ct;exports.LoadingElementOptions=vI;exports.LogStats=yy;exports.LogType=vi;exports.LookAt=k_;exports.LookAtConstraint=kr;exports.MODULES=A;exports.MainModule=jt;exports.MarkerType=$c;exports.MaskableGraphic=Sh;exports.MaterialPropertyBlock=Ss;exports.Mathf=L;exports.MeshCollider=Co;exports.MeshRenderer=gh;exports.MinMaxCurve=q;exports.MinMaxGradient=Br;exports.NEEDLE_ENGINE_FEATURE_FLAGS=Ag;exports.NEKeyboardEvent=Yl;exports.NEPointerEvent=ds;exports.NeedleButtonElement=oC;exports.NeedleEngineWebComponent=A_;exports.NeedleMenu=es;exports.NeedlePatchesKey=Id;exports.NeedleXRController=qg;exports.NeedleXRSession=H;exports.NeedleXRSync=Dw;exports.NeedleXRUtils=Ww;exports.NestedGltf=gl;exports.NetworkConnection=Tc;exports.NetworkedStreamEvents=Wn;exports.NetworkedStreams=Ah;exports.Networking=h_;exports.NewInstanceModel=J0;exports.NoiseModule=pe;exports.ObjectRaycaster=Xi;exports.ObjectUtils=xo;exports.OffsetConstraint=Lr;exports.OneEuroFilter=Ad;exports.OneEuroFilterXYZ=Sg;exports.OpenURL=Pl;exports.OrbitControls=ce;exports.Outline=ul;exports.OwnershipEvent=ww;exports.OwnershipModel=xw;exports.PUBLIC_KEY=ro;exports.Padding=Ar;exports.ParticleBurst=Au;exports.ParticleSubEmitter=f_;exports.ParticleSystem=qc;exports.ParticleSystemBaseBehaviour=Eo;exports.ParticleSystemRenderer=en;exports.ParticleSystemShapeType=Ru;exports.PeerHandle=vs;exports.PeerNetworking=bw;exports.Physics=Wa;exports.PhysicsExtension=Xy;exports.PhysicsMaterialCombine=ht;exports.PixelationEffect=Eh;exports.PlaneHeightLockConstraint=xy;exports.PlayAnimationOnClick=Gc;exports.PlayAudioOnClick=yo;exports.PlayableDirector=Ga;exports.PlayerColor=Qa;exports.PlayerState=li;exports.PlayerStateEvent=gS;exports.PlayerSync=Gy;exports.PlayerView=Sw;exports.PlayerViewManager=Cw;exports.PointerEventData=lh;exports.PointerType=Gu;exports.PostProcessing=Aw;exports.PostProcessingEffect=Je;exports.PostProcessingEffectOrder=st;exports.PostProcessingHandler=Ka;exports.Prefabs=Fa;exports.PreliminaryAction=cl;exports.PreliminaryTrigger=_h;exports.PrimitiveType=Za;exports.Progress=re;exports.PromiseAllWithErrors=wg;exports.PromiseErrorResult=dm;exports.RGBAColor=ie;exports.RapierPhysics=La;exports.RawImage=Wf;exports.RaycastOptions=Sr;exports.Rect=xS;exports.RectTransform=_n;exports.ReflectionProbe=us;exports.ReflectionProbeUsage=qx;exports.RegisteredAnimationInfo=lo;exports.RemoteSkybox=fy;exports.RenderTexture=Vn;exports.RenderTextureSerializer=bx;exports.Renderer=Kt;exports.RendererData=Ow;exports.RendererLightmap=My;exports.Rigidbody=Ge;exports.RigidbodyConstraints=We;exports.RoomEvents=Z;exports.RotationBySpeedModule=Ji;exports.RotationOverLifetimeModule=vn;exports.ScaleLimitConstraint=vy;exports.SceneLightSettings=Cu;exports.SceneSwitcher=He;exports.ScreenCapture=Ro;exports.ScreenSpaceAmbientOcclusion=Bs;exports.ScreenSpaceAmbientOcclusionN8=xn;exports.ScrollFollow=ns;exports.SeeThrough=v_;exports.SendQueue=dn;exports.SerializationContext=Ng;exports.SetActiveOnClick=Ny;exports.ShadowCastingMode=Ou;exports.ShadowCatcher=Ih;exports.ShapeModule=d_;exports.ShapeOverlapResult=V0;exports.SharpeningEffect=Rh;exports.SignalAsset=ch;exports.SignalReceiver=_r;exports.SignalReceiverEvent=nl;exports.SignalTrackHandler=Wc;exports.Size=wS;exports.SizeBySpeedModule=mi;exports.SizeOverLifetimeModule=Fr;exports.SkinnedMeshRenderer=Ey;exports.SmoothFollow=Uf;exports.SnapToSurfaceConstraint=Sy;exports.SpatialGrabRaycaster=yr;exports.SpatialHtml=Fh;exports.SpatialTrigger=zf;exports.SpatialTriggerReceiver=Xn;exports.SpectatorCamera=Nf;exports.SphereCollider=ol;exports.SphereIntersection=Zg;exports.SplineContainer=Wr;exports.SplineData=Qn;exports.SplineWalker=nn;exports.Sprite=Ds;exports.SpriteData=Ia;exports.SpriteRenderer=fi;exports.SpriteSheet=qa;exports.StateMachineBehaviour=OO;exports.StreamEndedEvent=b_;exports.StreamReceivedEvent=jS;exports.SubEmitterSystem=Du;exports.SyncedCamera=w_;exports.SyncedRoom=Sn;exports.SyncedTransform=yn;exports.TapGestureTrigger=Vy;exports.TeleportTarget=kf;exports.TestRunner=x_;exports.TestSimulateUserData=S_;exports.Text=Lt;exports.TextAnchor=Qe;exports.TextBuilder=Yy;exports.TextExtension=Mf;exports.TextureSheetAnimationModule=Bt;exports.TiltShiftEffect=is;exports.Time=Ew;exports.TimelineActivationTrack=lf;exports.TimelineAnimationTrack=Vc;exports.TimelineAudioTrack=_s;exports.TimelineBuilder=Kf;exports.TimelineControlTrack=cf;exports.TimelineMarkerTrack=af;exports.TimelineTrackHandler=Or;exports.ToneMappingEffect=Ur;exports.TrackType=me;exports.TrailModule=je;exports.TransformData=De;exports.TransformGizmo=Gr;exports.TriggerBuilder=At;exports.TriggerModel=fo;exports.TypeStore=P;exports.UIRaycastUtils=ly;exports.UIRootComponent=vh;exports.USDDocument=By;exports.USDObject=Ze;exports.USDWriter=sS;exports.USDZExporter=oS;exports.USDZExporter$1=qn;exports.USDZText=Sa;exports.USDZUIExtension=t_;exports.UriSerializer=vx;exports.UsageMarker=fh;exports.UserJoinedOrLeftRoomModel=XP;exports.VERSION=ci;exports.VariantAction=Uy;exports.VelocityOverLifetimeModule=ze;exports.VerticalLayoutGroup=Ky;exports.VerticalWrapMode=kS;exports.VideoPlayer=at;exports.ViewDevice=xs;exports.Vignette=$r;exports.VisibilityAction=bh;exports.Voip=Fs;exports.Volume=vl;exports.VolumeParameter=z;exports.VolumeProfile=If;exports.WaitForFrames=IP;exports.WaitForPromise=fw;exports.WaitForSeconds=$g;exports.Watch=ws;exports.WebARCameraBackground=zh;exports.WebARSessionRoot=Hi;exports.WebXR=Of;exports.WebXRButtonFactory=po;exports.WebXRImageTracking=Nh;exports.WebXRImageTrackingModel=Ns;exports.WebXRPlaneTracking=$s;exports.WebXRTrackedImage=Ya;exports.XRControllerFollow=zs;exports.XRControllerModel=Os;exports.XRControllerMovement=Oi;exports.XRFlag=un;exports.XRRig=Yf;exports.XRState=Ht;exports.XRStateFlag=Fn;exports._$WfJljBK=th;exports.__Aale=pn;exports.__Ignore=hC;exports.__internalNotifyObjectDestroyed=Vk;exports.activeInHierarchyFieldName=zn;exports.addAttributeChangeCallback=iu;exports.addComponent=Hn;exports.addCustomExtensionPlugin=YE;exports.addNewComponent=lr;exports.addPatch=zu;exports.apply=Ku;exports.applyHMRChanges=bO;exports.applyPrototypeExtensions=ex;exports.beginListenDestroy=Z0;exports.beginListenInstantiate=iw;exports.binaryIdentifierCasts=Vg;exports.build_scene_functions=Dk;exports.builtinComponentKeyName=Qo;exports.calculateProgress01=R_;exports.clearMessages=UC;exports.compareAssociation=ow;exports.copyTexture=O0;exports.createMotion=gx;exports.debugNet=ii;exports.debugOwner=la;exports.decompressGpuTexture=cS;exports.deepClone=Kc;exports.delay=Cs;exports.delayForFrames=ju;exports.deserializeObject=fu;exports.destroy=Ci;exports.destroyComponentInstance=hx;exports.determineMimeTypeFromExtension=zx;exports.disposeObjectResources=Se;exports.disposeStream=Vi;exports.editorGuidKeyName=hc;exports.enableSpatialConsole=ka;exports.exportAsGLTF=RI;exports.findByGuid=ty;exports.findObjectOfType=il;exports.findObjectsOfType=ux;exports.findResourceUsers=Jg;exports.fitCamera=Cx;exports.fitObjectIntoVolume=E0;exports.foreachComponent=gr;exports.foreachComponentEnumerator=iy;exports.forward=s1;exports.generateQRCode=zw;exports.generateSeed=tw;exports.getBoundingBox=di;exports.getCameraController=b0;exports.getComponent=So;exports.getComponentInChildren=rh;exports.getComponentInParent=jc;exports.getComponents=el;exports.getComponentsInChildren=tl;exports.getComponentsInParent=Ju;exports.getFormattedDate=eS;exports.getIconElement=pt;exports.getIconTexture=Tm;exports.getLoader=Ps;exports.getOrAddComponent=oh;exports.getParam=x;exports.getParentHierarchyPath=a1;exports.getPath=yC;exports.getPeerOptions=NP;exports.getPeerjsInstance=_w;exports.getResourceUserCount=Gk;exports.getSceneData=kw;exports.getTempColor=S0;exports.getTempQuaternion=oi;exports.getTempVector=j;exports.getUrlParams=Yc;exports.getVisibleInCustomShadowRendering=M0;exports.getWorldDirection=C0;exports.getWorldEuler=kg;exports.getWorldPosition=ee;exports.getWorldQuaternion=ge;exports.getWorldRotation=Fu;exports.getWorldScale=Fe;exports.hasPointerEventComponent=wu;exports.hideDebugConsole=D0;exports.imageToCanvas=hS;exports.initAddressableSerializers=uw;exports.initBuiltinSerializers=wx;exports.initEngine=MI;exports.initPhysics=sC;exports.initVolumeParameterSerializer=Rx;exports.instantiate=go;exports.invokeLoadedImportPluginHooks=Hx;exports.invokeXRSessionEnd=Uw;exports.invokeXRSessionStart=Fw;exports.isActiveInHierarchy=tx;exports.isActiveSelf=Ja;exports.isAndroidDevice=SC;exports.isAnimationAction=k0;exports.isComponent=$u;exports.isDebugMode=uC;exports.isDesktop=bC;exports.isDestroyed=mr;exports.isDevEnvironment=T;exports.isDisposable=vO;exports.isDisposed=$k;exports.isExporting=EI;exports.isGLTFModel=z0;exports.isHostedOnGlitch=r0;exports.isHotReloadEnabled=Hm;exports.isHotReloading=yO;exports.isIPad=wC;exports.isIconElement=Nw;exports.isLocalNetwork=wi;exports.isMacOS=PC;exports.isMobileDevice=vC;exports.isMozillaXR=CC;exports.isQuest=MC;exports.isResourceTrackingEnabled=qw;exports.isSafari=OC;exports.isTrackModel=AM;exports.isUsingInstancing=Zu;exports.isiOS=kC;exports.isiPad=xC;exports.loadAsset=hI;exports.loadPMREM=uf;exports.loadSync=T_;exports.logHierarchy=ru;exports.lookAtInverse=YC;exports.lookAtObject=Zc;exports.lookAtScreenPoint=KC;exports.makeId=pC;exports.makeIdFromRandomWords=c0;exports.makeNameSafe=ki;exports.markAsInstancedRendered=ix;exports.microphonePermissionsGranted=EC;exports.nameof=dC;exports.nameofFactory=a0;exports.needle=YP;exports.offBeforeXRSession=Bw;exports.offXRSessionEnd=jw;exports.offXRSessionStart=Lw;exports.on=wO;exports.onAfterRender=Z1;exports.onBeforeRender=K1;exports.onBeforeXRSession=Ck;exports.onClear=Q1;exports.onDestroy=Y1;exports.onInitialized=Lg;exports.onStart=Wu;exports.onSyncDestroy=fP;exports.onSyncInstantiate=ew;exports.onUpdate=q0;exports.onXRSessionEnd=Qg;exports.onXRSessionStart=qu;exports.parseSync=iC;exports.placeOnSurface=T0;exports.postprocessFBXMaterials=Eg;exports.prefix=uM;exports.pushState=l0;exports.randomNumber=mC;exports.registerBinaryType=Wg;exports.registerComponent=Qu;exports.registerComponentExtension=ky;exports.registerCustomEffectType=tn;exports.registerExportExtensions=Oy;exports.registerExtensions=ku;exports.registerHotReloadType=fx;exports.registerLoader=G0;exports.registerPrefabProvider=nw;exports.registerPrototypeExtensions=ey;exports.registerType=Rg;exports.relativePathPrefix=d0;exports.removeAttributeChangeCallback=f0;exports.removeComponent=sy;exports.removeCustomImportExtensionType=KE;exports.removePatch=V1;exports.resolveUrl=Yn;exports.sanitizeString=h0;exports.saveImage=ZS;exports.screenshot=WD;exports.screenshot2=E_;exports.sendDestroyed=Bg;exports.serializable=p;exports.serializeObject=aw;exports.serializeable=Ue;exports.setActive=mc;exports.setAllowBalloonMessages=g0;exports.setAllowOverlayMessages=LC;exports.setAutoFitEnabled=su;exports.setCameraController=pm;exports.setDestroyed=sx;exports.setDevEnvironment=WC;exports.setDisposable=Qw;exports.setDontDestroy=ca;exports.setOrAddParamsToUrl=hm;exports.setParam=fC;exports.setParamWithoutReload=kc;exports.setPeerOptions=$P;exports.setResourceTrackingEnabled=Nk;exports.setState=bg;exports.setVisibleInCustomShadowRendering=Mg;exports.setWorldEuler=Og;exports.setWorldPosition=Si;exports.setWorldPositionXYZ=fr;exports.setWorldQuaternion=mn;exports.setWorldQuaternionXYZW=Pg;exports.setWorldRotation=P0;exports.setWorldRotationXYZ=Jc;exports.setWorldScale=ja;exports.showBalloonError=eh;exports.showBalloonMessage=ke;exports.showBalloonWarning=fe;exports.showDebugConsole=Tg;exports.slerp=w0;exports.syncDestroy=ih;exports.syncField=uy;exports.syncInstantiate=Fg;exports.textureToCanvas=l1;exports.toSourceId=u0;exports.tryCastBinary=gw;exports.tryDetermineMimetypeFromBinary=$x;exports.tryDetermineMimetypeFromURL=Nx;exports.tryFindObject=Oc;exports.tryGetGuid=yw;exports.unregisterHotReloadType=px;exports.unregisterPrefabProvider=gP;exports.unwatchWrite=vg;exports.useForAutoFit=v0;exports.validate=Ie;exports.watchWrite=Bu;