@needle-tools/engine 4.1.0-beta → 4.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 (63) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/components.needle.json +1 -1
  3. package/dist/gltf-progressive.js +103 -102
  4. package/dist/gltf-progressive.light.js +103 -102
  5. package/dist/gltf-progressive.light.min.js +6 -6
  6. package/dist/gltf-progressive.light.umd.cjs +6 -6
  7. package/dist/gltf-progressive.min.js +6 -6
  8. package/dist/gltf-progressive.umd.cjs +6 -6
  9. package/dist/needle-engine.bundle.js +7743 -7505
  10. package/dist/needle-engine.bundle.light.js +7696 -7458
  11. package/dist/needle-engine.bundle.light.min.js +131 -131
  12. package/dist/needle-engine.bundle.light.umd.cjs +130 -130
  13. package/dist/needle-engine.bundle.min.js +131 -131
  14. package/dist/needle-engine.bundle.umd.cjs +130 -130
  15. package/dist/needle-engine.js +596 -590
  16. package/dist/needle-engine.light.js +596 -590
  17. package/dist/needle-engine.light.min.js +1 -1
  18. package/dist/needle-engine.light.umd.cjs +1 -1
  19. package/dist/needle-engine.min.js +1 -1
  20. package/dist/needle-engine.umd.cjs +1 -1
  21. package/dist/three-examples.js +26 -26
  22. package/dist/three-examples.light.js +26 -26
  23. package/dist/three-examples.light.min.js +1 -1
  24. package/dist/three-examples.light.umd.cjs +1 -1
  25. package/dist/three-examples.min.js +1 -1
  26. package/dist/three-examples.umd.cjs +1 -1
  27. package/dist/vendor.js +0 -2
  28. package/dist/vendor.light.js +0 -2
  29. package/dist/vendor.light.min.js +2 -2
  30. package/dist/vendor.light.umd.cjs +2 -2
  31. package/dist/vendor.min.js +2 -2
  32. package/dist/vendor.umd.cjs +2 -2
  33. package/lib/engine/engine.d.ts +4 -0
  34. package/lib/engine/engine.js +12 -0
  35. package/lib/engine/engine.js.map +1 -0
  36. package/lib/engine/engine_web_api.d.ts +12 -0
  37. package/lib/engine/engine_web_api.js +113 -0
  38. package/lib/engine/engine_web_api.js.map +1 -0
  39. package/lib/engine-components/FlyControls.d.ts +10 -0
  40. package/lib/engine-components/FlyControls.js +29 -0
  41. package/lib/engine-components/FlyControls.js.map +1 -0
  42. package/lib/engine-components/OrbitControls.js +8 -0
  43. package/lib/engine-components/OrbitControls.js.map +1 -1
  44. package/lib/engine-components/RigidBody.js +10 -4
  45. package/lib/engine-components/RigidBody.js.map +1 -1
  46. package/lib/engine-components/particlesystem/ParticleSystemModules.js +1 -1
  47. package/lib/engine-components/particlesystem/ParticleSystemModules.js.map +1 -1
  48. package/lib/engine-components/postprocessing/Effects/Sharpening.d.ts +2 -0
  49. package/lib/engine-components/postprocessing/Effects/Sharpening.js +15 -6
  50. package/lib/engine-components/postprocessing/Effects/Sharpening.js.map +1 -1
  51. package/lib/engine-components/webxr/WebXRImageTracking.d.ts +4 -0
  52. package/lib/engine-components/webxr/WebXRImageTracking.js +14 -4
  53. package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
  54. package/lib/needle-engine.js +5 -5
  55. package/lib/needle-engine.js.map +1 -1
  56. package/package.json +3 -3
  57. package/src/engine/codegen/register_types.ts +2 -2
  58. package/src/engine-components/OrbitControls.ts +8 -0
  59. package/src/engine-components/RigidBody.ts +11 -5
  60. package/src/engine-components/particlesystem/ParticleSystemModules.ts +1 -1
  61. package/src/engine-components/postprocessing/Effects/Sharpening.ts +16 -7
  62. package/src/engine-components/webxr/WebXRImageTracking.ts +18 -4
  63. package/src/needle-engine.ts +5 -5
@@ -466,4 +466,4 @@ version 0.8.2
466
466
  #include <premultiplied_alpha_fragment>
467
467
 
468
468
  }
469
- `};class ci extends Fi{constructor(e){super({type:"LineMaterial",uniforms:Ni.clone(bt.line.uniforms),vertexShader:bt.line.vertexShader,fragmentShader:bt.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const li=new Rt,oo=new N,ro=new N,Ue=new Rt,Ge=new Rt,Qt=new Rt,hi=new N,gi=new oe,Pe=new Cr,Ao=new N,on=new qs,rn=new In,yt=new Rt;let vt,Zt;function co(o,e,t){return yt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),yt.multiplyScalar(1/yt.w),yt.x=Zt/t.width,yt.y=Zt/t.height,yt.applyMatrix4(o.projectionMatrixInverse),yt.multiplyScalar(1/yt.w),Math.abs(Math.max(yt.x,yt.y))}function vl(o,e){const t=o.matrixWorld,n=o.geometry,s=n.attributes.instanceStart,i=n.attributes.instanceEnd,a=Math.min(n.instanceCount,s.count);for(let r=0,A=a;r<A;r++){Pe.start.fromBufferAttribute(s,r),Pe.end.fromBufferAttribute(i,r),Pe.applyMatrix4(t);const c=new N,l=new N;vt.distanceSqToSegment(Pe.start,Pe.end,l,c),l.distanceTo(c)<Zt*.5&&e.push({point:l,pointOnLine:c,distance:vt.origin.distanceTo(l),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function xl(o,e,t){const n=e.projectionMatrix,s=o.material.resolution,i=o.matrixWorld,a=o.geometry,r=a.attributes.instanceStart,A=a.attributes.instanceEnd,c=Math.min(a.instanceCount,r.count),l=-e.near;vt.at(1,Qt),Qt.w=1,Qt.applyMatrix4(e.matrixWorldInverse),Qt.applyMatrix4(n),Qt.multiplyScalar(1/Qt.w),Qt.x*=s.x/2,Qt.y*=s.y/2,Qt.z=0,hi.copy(Qt),gi.multiplyMatrices(e.matrixWorldInverse,i);for(let h=0,p=c;h<p;h++){if(Ue.fromBufferAttribute(r,h),Ge.fromBufferAttribute(A,h),Ue.w=1,Ge.w=1,Ue.applyMatrix4(gi),Ge.applyMatrix4(gi),Ue.z>l&&Ge.z>l)continue;if(Ue.z>l){const I=Ue.z-Ge.z,C=(Ue.z-l)/I;Ue.lerp(Ge,C)}else if(Ge.z>l){const I=Ge.z-Ue.z,C=(Ge.z-l)/I;Ge.lerp(Ue,C)}Ue.applyMatrix4(n),Ge.applyMatrix4(n),Ue.multiplyScalar(1/Ue.w),Ge.multiplyScalar(1/Ge.w),Ue.x*=s.x/2,Ue.y*=s.y/2,Ge.x*=s.x/2,Ge.y*=s.y/2,Pe.start.copy(Ue),Pe.start.z=0,Pe.end.copy(Ge),Pe.end.z=0;const d=Pe.closestPointToPointParameter(hi,!0);Pe.at(d,Ao);const u=Ie.lerp(Ue.z,Ge.z,d),m=u>=-1&&u<=1,b=hi.distanceTo(Ao)<Zt*.5;if(m&&b){Pe.start.fromBufferAttribute(r,h),Pe.end.fromBufferAttribute(A,h),Pe.start.applyMatrix4(i),Pe.end.applyMatrix4(i);const I=new N,C=new N;vt.distanceSqToSegment(Pe.start,Pe.end,C,I),t.push({point:C,pointOnLine:I,distance:vt.origin.distanceTo(C),object:o,face:null,faceIndex:h,uv:null,uv1:null})}}}class Sl extends H{constructor(e=new ao,t=new ci({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,s=new Float32Array(2*t.count);for(let a=0,r=0,A=t.count;a<A;a++,r+=2)oo.fromBufferAttribute(t,a),ro.fromBufferAttribute(n,a),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+oo.distanceTo(ro);const i=new wn(s,2,1);return e.setAttribute("instanceDistanceStart",new Jt(i,1,0)),e.setAttribute("instanceDistanceEnd",new Jt(i,1,1)),this}raycast(e,t){const n=this.material.worldUnits,s=e.camera;s===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;vt=e.ray;const a=this.matrixWorld,r=this.geometry,A=this.material;Zt=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),rn.copy(r.boundingSphere).applyMatrix4(a);let c;if(n)c=Zt*.5;else{const h=Math.max(s.near,rn.distanceToPoint(vt.origin));c=co(s,h,A.resolution)}if(rn.radius+=c,vt.intersectsSphere(rn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),on.copy(r.boundingBox).applyMatrix4(a);let l;if(n)l=Zt*.5;else{const h=Math.max(s.near,on.distanceToPoint(vt.origin));l=co(s,h,A.resolution)}on.expandByScalar(l),vt.intersectsBox(on)!==!1&&(n?vl(this,t):xl(this,s,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(li),this.material.uniforms.resolution.value.set(li.z,li.w))}}class lo extends ao{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let s=0;s<t;s+=3)n[2*s]=e[s],n[2*s+1]=e[s+1],n[2*s+2]=e[s+2],n[2*s+3]=e[s+3],n[2*s+4]=e[s+4],n[2*s+5]=e[s+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let s=0;s<t;s+=3)n[2*s]=e[s],n[2*s+1]=e[s+1],n[2*s+2]=e[s+2],n[2*s+3]=e[s+3],n[2*s+4]=e[s+4],n[2*s+5]=e[s+5];return super.setColors(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Dl extends Sl{constructor(e=new lo,t=new ci({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class kl extends H{constructor(e){const t=new Rl(e),n=new Cn(t.image.width*.001,t.image.height*.001),s=new mt({map:t,toneMapped:!1,transparent:!0});super(n,s);function i(a){s.map.dispatchDOMEvent(a)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){n.dispose(),s.dispose(),s.map.dispose(),pi.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class Rl extends Li{constructor(e){super(ho(e)),this.dom=e,this.anisotropy=16,this.colorSpace=re,this.minFilter=ht,this.magFilter=ht;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),n={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,n),this.observer=t}dispatchDOMEvent(e){e.data&&Tl(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=ho(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const pi=new WeakMap;function ho(o){const e=document.createRange(),t=new Ce;function n(p){const d=[];let u=!1;function m(){if(u&&(u=!1,p.restore()),d.length===0)return;let b=-1/0,I=-1/0,C=1/0,E=1/0;for(let w=0;w<d.length;w++){const Q=d[w];b=Math.max(b,Q.x),I=Math.max(I,Q.y),C=Math.min(C,Q.x+Q.width),E=Math.min(E,Q.y+Q.height)}p.save(),p.beginPath(),p.rect(b,I,C-b,E-I),p.clip(),u=!0}return{add:function(b){d.push(b),m()},remove:function(){d.pop(),m()}}}function s(p,d,u,m){m!==""&&(p.textTransform==="uppercase"&&(m=m.toUpperCase()),l.font=p.fontWeight+" "+p.fontSize+" "+p.fontFamily,l.textBaseline="top",l.fillStyle=p.color,l.fillText(m,d,u+parseFloat(p.fontSize)*.1))}function i(p,d,u,m,b){u<2*b&&(b=u/2),m<2*b&&(b=m/2),l.beginPath(),l.moveTo(p+b,d),l.arcTo(p+u,d,p+u,d+m,b),l.arcTo(p+u,d+m,p,d+m,b),l.arcTo(p,d+m,p,d,b),l.arcTo(p,d,p+u,d,b),l.closePath()}function a(p,d,u,m,b,I){const C=p[d+"Width"],E=p[d+"Style"],w=p[d+"Color"];C!=="0px"&&E!=="none"&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=w,l.lineWidth=parseFloat(C),l.beginPath(),l.moveTo(u,m),l.lineTo(u+b,m+I),l.stroke())}function r(p,d){if(p.nodeType===Node.COMMENT_NODE||p.nodeName==="SCRIPT"||p.style&&p.style.display==="none")return;let u=0,m=0,b=0,I=0;if(p.nodeType===Node.TEXT_NODE){e.selectNode(p);const E=e.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,s(d,u,m,p.nodeValue.trim())}else if(p instanceof HTMLCanvasElement){const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,l.save();const w=window.devicePixelRatio;l.scale(1/w,1/w),l.drawImage(p,u,m),l.restore()}else if(p instanceof HTMLImageElement){const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,l.drawImage(p,u,m,b,I)}else{const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,d=window.getComputedStyle(p),i(u,m,b,I,parseFloat(d.borderRadius));const w=d.backgroundColor;w!=="transparent"&&w!=="rgba(0, 0, 0, 0)"&&(l.fillStyle=w,l.fill());const Q=["borderTop","borderLeft","borderBottom","borderRight"];let S=!0,D=null;for(const x of Q){if(D!==null&&(S=d[x+"Width"]===d[D+"Width"]&&d[x+"Color"]===d[D+"Color"]&&d[x+"Style"]===d[D+"Style"]),S===!1)break;D=x}if(S===!0){const x=parseFloat(d.borderTopWidth);d.borderTopWidth!=="0px"&&d.borderTopStyle!=="none"&&d.borderTopColor!=="transparent"&&d.borderTopColor!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=d.borderTopColor,l.lineWidth=x,l.stroke())}else a(d,"borderTop",u,m,b,0),a(d,"borderLeft",u,m,0,I),a(d,"borderBottom",u,m+I,b,0),a(d,"borderRight",u+b,m,0,I);if(p instanceof HTMLInputElement){let x=d.accentColor;(x===void 0||x==="auto")&&(x=d.color),t.set(x);const R=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(p.type==="radio"&&(i(u,m,b,I,I),l.fillStyle="white",l.strokeStyle=x,l.lineWidth=1,l.fill(),l.stroke(),p.checked&&(i(u+2,m+2,b-4,I-4,I),l.fillStyle=x,l.strokeStyle=R,l.lineWidth=2,l.fill(),l.stroke())),p.type==="checkbox"&&(i(u,m,b,I,2),l.fillStyle=p.checked?x:"white",l.strokeStyle=p.checked?R:x,l.lineWidth=1,l.stroke(),l.fill(),p.checked)){const G=l.textAlign;l.textAlign="center";const W={color:R,fontFamily:d.fontFamily,fontSize:I+"px",fontWeight:"bold"};s(W,u+b/2,m,"\u2714"),l.textAlign=G}if(p.type==="range"){const[G,W,V]=["min","max","value"].map(Z=>parseFloat(p[Z])),J=(V-G)/(W-G)*(b-I);i(u,m+I/4,b,I/2,I/4),l.fillStyle=R,l.strokeStyle=x,l.lineWidth=1,l.fill(),l.stroke(),i(u,m+I/4,J+I/2,I/2,I/4),l.fillStyle=x,l.fill(),i(u+J,m,I,I,I/2),l.fillStyle=x,l.fill()}(p.type==="color"||p.type==="text"||p.type==="number")&&(h.add({x:u,y:m,width:b,height:I}),s(d,u+parseInt(d.paddingLeft),m+parseInt(d.paddingTop),p.value),h.remove())}}const C=d.overflow==="auto"||d.overflow==="hidden";C&&h.add({x:u,y:m,width:b,height:I});for(let E=0;E<p.childNodes.length;E++)r(p.childNodes[E],d);C&&h.remove()}const A=o.getBoundingClientRect();let c=pi.get(o);c===void 0&&(c=document.createElement("canvas"),c.width=A.width,c.height=A.height,pi.set(o,c));const l=c.getContext("2d"),h=new n(l);return l.clearRect(0,0,c.width,c.height),r(o),c}function Tl(o,e,t,n){const s={clientX:t*o.offsetWidth+o.offsetLeft,clientY:n*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,s));const i=o.getBoundingClientRect();t=t*i.width+i.left,n=n*i.height+i.top;function a(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&n>A.top&&n<A.bottom&&(r.dispatchEvent(new MouseEvent(e,s)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[c,l]=["min","max"].map(d=>parseFloat(r[d])),h=A.width,p=(t-A.x)/h;r.value=c+(l-c)*p,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let c=0;c<r.childNodes.length;c++)a(r.childNodes[c])}}a(o)}const An=new _e,cs={type:"",data:An},go=new En;class Ml extends Kt{listenToPointerEvents(e,t){const n=this,s=new En,i=e.domElement;function a(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();An.x=(r.clientX-A.left)/A.width*2-1,An.y=-(r.clientY-A.top)/A.height*2+1,s.setFromCamera(An,t);const c=s.intersectObjects(n.children,!1);if(c.length>0){const l=c[0],h=l.object,p=l.uv;cs.type=r.type,cs.data.set(p.x,1-p.y),h.dispatchEvent(cs)}}i.addEventListener("pointerdown",a),i.addEventListener("pointerup",a),i.addEventListener("pointermove",a),i.addEventListener("mousedown",a),i.addEventListener("mouseup",a),i.addEventListener("mousemove",a),i.addEventListener("click",a)}listenToXRControllerEvents(e){const t=this,n={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function s(i){const a=i.target;go.setFromXRController(a);const r=go.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],c=A.object,l=A.uv;cs.type=n[i.type],cs.data.set(l.x,1-l.y),c.dispatchEvent(cs)}}e.addEventListener("move",s),e.addEventListener("select",s),e.addEventListener("selectstart",s),e.addEventListener("selectend",s)}}const Ms=new N,_s=new N,po=new Mi;class _l extends Us{constructor(e,t=1,n=16711680){const s=new ot,i=e.geometry.attributes.normal.count,a=new Se(i*2*3,3);s.setAttribute("position",a),super(s,new kt({color:n,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),po.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry;if(n){const s=n.attributes.position,i=n.attributes.normal;let a=0;for(let r=0,A=s.count;r<A;r++)Ms.fromBufferAttribute(s,r).applyMatrix4(e),_s.fromBufferAttribute(i,r),_s.applyMatrix3(po).normalize().multiplyScalar(this.size).add(Ms),t.setXYZ(a,Ms.x,Ms.y,Ms.z),a=a+1,t.setXYZ(a,_s.x,_s.y,_s.z),a=a+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}const ct={node:"node",material:"material",camera:"camera",light:"light"},$t="KHR_animation_pointer",Fl={CUBICSPLINE:void 0,LINEAR:ds,STEP:mn},uo=gt.findNode;let fo=!1;class Ll{constructor(e){this.parser=e,this.name=$t,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){fo||(fo=!0,gt.findNode=function(e,t){if(t.startsWith(".materials.")){const n=t.substring(11).substring(t.indexOf(".")),s=n.indexOf("."),i=s<0?n:n.substring(0,s);let a=null;return e.traverse(r=>{a!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(a=r.material,a!==null&&(n.endsWith(".map")?a=a.map:n.endsWith(".emissiveMap")&&(a=a.emissiveMap)))}),a}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const n=t.split(".");let s;for(let i=1;i<n.length;i++){const a=n[i];if(a.length==36)s=e.getObjectByProperty("uuid",a);else if(s&&s[a]){const r=Number.parseInt(a);let A=a;r>=0&&(A=r),s=s[A]}else{const r=e.getObjectByName(a);r&&(s=r)}}if(!s){const i=uo(e,n[2]);return i||console.warn($t+": Property binding not found",t,e,e.name,n),i}return s}return uo(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,n=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",n)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,n=t.extensions&&t.extensions[$t]&&t.path&&t.path==="pointer";if(!n)return null;let s,i=ct.node,a;if(n){const A=t.extensions[$t];let c=A.pointer;if(!c){console.warn("Invalid path",A,t);return}if(c.startsWith("/materials/")?i=ct.material:c.startsWith("/extensions/KHR_lights_punctual/lights/")?i=ct.light:c.startsWith("/cameras/")&&(i=ct.camera),a=this._tryResolveTargetId(c,i),a===null||isNaN(a)){console.warn("Failed resolving animation node id: "+a,c);return}switch(i){case ct.material:const h=("/materials/"+a.toString()+"/").length,p=c.substring(0,h);switch(s=c.substring(h),s){case"pbrMetallicRoughness/baseColorFactor":s="color";break;case"pbrMetallicRoughness/roughnessFactor":s="roughness";break;case"pbrMetallicRoughness/metallicFactor":s="metalness";break;case"emissiveFactor":s="emissive";break;case"alphaCutoff":s="alphaTest";break;case"occlusionTexture/strength":s="aoMapIntensity";break;case"normalTexture/scale":s="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":s="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":s="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":s="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":s="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":s="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":s="transmission";break;case"extensions/KHR_materials_ior/ior":s="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":s="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":s="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":s="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":s="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":s="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":s="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":s="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":s="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":s="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":s="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":s="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":s="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":s="specularColor";break}c=p+s;break;case ct.node:const d=("/nodes/"+a.toString()+"/").length,u=c.substring(0,d);switch(s=c.substring(d),s){case"translation":s="position";break;case"rotation":s="quaternion";break;case"scale":s="scale";break;case"weights":s="morphTargetInfluences";break}c=u+s;break;case ct.light:const m=("/extensions/KHR_lights_punctual/lights/"+a.toString()+"/").length;switch(s=c.substring(m),s){case"color":break;case"intensity":break;case"spot/innerConeAngle":s="penumbra";break;case"spot/outerConeAngle":s="angle";break;case"range":s="distance";break}c="/lights/"+a.toString()+"/"+s;break;case ct.camera:const b=("/cameras/"+a.toString()+"/").length,I=c.substring(0,b);switch(s=c.substring(b),s){case"perspective/yfov":s="fov";break;case"perspective/znear":case"orthographic/znear":s="near";break;case"perspective/zfar":case"orthographic/zfar":s="far";break;case"perspective/aspect":s="aspect";break;case"orthographic/xmag":s="zoom";break;case"orthographic/ymag":s="zoom";break}c=I+s;break}const l=this.animationPointerResolver;l&&l.resolvePath&&(c=l.resolvePath(c)),t.extensions[$t].pointer=c}if(a===null||isNaN(a)){console.warn("Failed resolving animation node id: "+a,t);return}let r;return i===ct.node?r=this.parser.getDependency("node",a):i===ct.material?r=this.parser.getDependency("material",a):i===ct.light?r=this.parser.getDependency("light",a):i===ct.camera?r=this.parser.getDependency("camera",a):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,n,s,i){if(!(i.extensions&&i.extensions[$t]&&i.path&&i.path==="pointer"))return null;let a=i.extensions[$t].pointer;if(!a)return null;const r=[];a=a.replaceAll("/",".");const A=a.split(".");var c=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(A[2]=c,A[3]==="morphTargetInfluences"&&e.type==="Group"){for(const h of e.children)h instanceof dn&&h.morphTargetInfluences&&(A[3]=h.name,A[4]="morphTargetInfluences",l(this.parser));return r}l(this.parser);function l(h){a=A.join(".");let p;switch(n.itemSize){case 1:p=Hs;break;case 2:case 3:p=Os;break;case 4:a.endsWith(".quaternion")?p=js:p=Br;break}const d=s.interpolation!==void 0?Fl[s.interpolation]:ds;let u=h._getArrayFromAccessor(n);a.endsWith(".fov")&&(u=u.map(b=>b/Math.PI*180));const m=new p(a,t.array,u,d);if(d==="CUBICSPLINE"&&h._createCubicSplineTrackInterpolant(m),r.push(m),a&&n.itemSize===4&&a.startsWith(".materials.")&&a.endsWith(".color")){const b=new Float32Array(u.length/4);for(let C=0,E=u.length/4;C<E;C+=1)b[C]=u[C*4+3];const I=new p(a.replace(".color",".opacity"),t.array,b,d);d==="CUBICSPLINE"&&h._createCubicSplineTrackInterpolant(m),r.push(I)}}return r}_tryResolveTargetId(e,t){let n="";return t==="node"?n=e.substring(7):t==="material"?n=e.substring(11):t==="light"?n=e.substring(39):t==="camera"&&(n=e.substring(9)),n=n.substring(0,n.indexOf("/")),Number.parseInt(n)}loadAnimation(e){const t=this,n=this.parser.json,s=this.parser,i=n.animations[e],a=i.name?i.name:"animation_"+e,r=[],A=[],c=[],l=[],h=[];for(let p=0,d=i.channels.length;p<d;p++){const u=i.channels[p],m=i.samplers[u.sampler],b=u.target,I=i.parameters!==void 0?i.parameters[m.input]:m.input,C=i.parameters!==void 0?i.parameters[m.output]:m.output;let E=t.loadAnimationTargetFromChannelWithAnimationPointer(u);E||(E=t.loadAnimationTargetFromChannel(u)),r.push(E),A.push(s.getDependency("accessor",I)),c.push(s.getDependency("accessor",C)),l.push(m),h.push(b)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(p){const d=p[0],u=p[1],m=p[2],b=p[3],I=p[4],C=[];for(let E=0,w=d.length;E<w;E++){const Q=d[E],S=u[E],D=m[E],x=b[E],R=I[E];if(Q===void 0)continue;Q.updateMatrix&&(Q.updateMatrix(),Q.matrixAutoUpdate=!0);let G=t.createAnimationTracksWithAnimationPointer(Q,S,D,x,R);if(G||(G=s._createAnimationTracks(Q,S,D,x,R)),G)for(let W=0;W<G.length;W++)C.push(G[W])}return new un(a,void 0,C)})}}const Nl=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:Ll},Symbol.toStringTag,{value:"Module"}));class Ul{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new Ci(-1,1,1,-1,0,1);class Gl extends ot{constructor(){super(),this.setAttribute("position",new Se([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Se([0,2,0,0,2,0],2))}}new Gl;export{oA as D,_a as E,ga as F,Qn as G,Oc as H,Ml as I,xt as K,Dl as L,aA as M,xc as O,Pc as P,Fa as R,Is as S,EA as T,Hc as V,wl as X,wr as a,CA as b,Ea as c,oi as d,yl as e,lo as f,ci as g,QA as h,kl as i,_l as j,yc as k,oc as l,Qr as m,Ui as n,Ul as o,VA as p,XA as q,Nl as r,Xn as s,WA as z};
469
+ `};class ci extends Fi{constructor(e){super({type:"LineMaterial",uniforms:Ni.clone(bt.line.uniforms),vertexShader:bt.line.vertexShader,fragmentShader:bt.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const li=new Rt,oo=new N,ro=new N,Ue=new Rt,Ge=new Rt,Qt=new Rt,hi=new N,gi=new oe,Pe=new Cr,Ao=new N,on=new qs,rn=new In,yt=new Rt;let vt,Zt;function co(o,e,t){return yt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),yt.multiplyScalar(1/yt.w),yt.x=Zt/t.width,yt.y=Zt/t.height,yt.applyMatrix4(o.projectionMatrixInverse),yt.multiplyScalar(1/yt.w),Math.abs(Math.max(yt.x,yt.y))}function vl(o,e){const t=o.matrixWorld,n=o.geometry,s=n.attributes.instanceStart,i=n.attributes.instanceEnd,a=Math.min(n.instanceCount,s.count);for(let r=0,A=a;r<A;r++){Pe.start.fromBufferAttribute(s,r),Pe.end.fromBufferAttribute(i,r),Pe.applyMatrix4(t);const c=new N,l=new N;vt.distanceSqToSegment(Pe.start,Pe.end,l,c),l.distanceTo(c)<Zt*.5&&e.push({point:l,pointOnLine:c,distance:vt.origin.distanceTo(l),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function xl(o,e,t){const n=e.projectionMatrix,s=o.material.resolution,i=o.matrixWorld,a=o.geometry,r=a.attributes.instanceStart,A=a.attributes.instanceEnd,c=Math.min(a.instanceCount,r.count),l=-e.near;vt.at(1,Qt),Qt.w=1,Qt.applyMatrix4(e.matrixWorldInverse),Qt.applyMatrix4(n),Qt.multiplyScalar(1/Qt.w),Qt.x*=s.x/2,Qt.y*=s.y/2,Qt.z=0,hi.copy(Qt),gi.multiplyMatrices(e.matrixWorldInverse,i);for(let h=0,p=c;h<p;h++){if(Ue.fromBufferAttribute(r,h),Ge.fromBufferAttribute(A,h),Ue.w=1,Ge.w=1,Ue.applyMatrix4(gi),Ge.applyMatrix4(gi),Ue.z>l&&Ge.z>l)continue;if(Ue.z>l){const I=Ue.z-Ge.z,C=(Ue.z-l)/I;Ue.lerp(Ge,C)}else if(Ge.z>l){const I=Ge.z-Ue.z,C=(Ge.z-l)/I;Ge.lerp(Ue,C)}Ue.applyMatrix4(n),Ge.applyMatrix4(n),Ue.multiplyScalar(1/Ue.w),Ge.multiplyScalar(1/Ge.w),Ue.x*=s.x/2,Ue.y*=s.y/2,Ge.x*=s.x/2,Ge.y*=s.y/2,Pe.start.copy(Ue),Pe.start.z=0,Pe.end.copy(Ge),Pe.end.z=0;const d=Pe.closestPointToPointParameter(hi,!0);Pe.at(d,Ao);const u=Ie.lerp(Ue.z,Ge.z,d),m=u>=-1&&u<=1,b=hi.distanceTo(Ao)<Zt*.5;if(m&&b){Pe.start.fromBufferAttribute(r,h),Pe.end.fromBufferAttribute(A,h),Pe.start.applyMatrix4(i),Pe.end.applyMatrix4(i);const I=new N,C=new N;vt.distanceSqToSegment(Pe.start,Pe.end,C,I),t.push({point:C,pointOnLine:I,distance:vt.origin.distanceTo(C),object:o,face:null,faceIndex:h,uv:null,uv1:null})}}}class Sl extends H{constructor(e=new ao,t=new ci({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,s=new Float32Array(2*t.count);for(let a=0,r=0,A=t.count;a<A;a++,r+=2)oo.fromBufferAttribute(t,a),ro.fromBufferAttribute(n,a),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+oo.distanceTo(ro);const i=new wn(s,2,1);return e.setAttribute("instanceDistanceStart",new Jt(i,1,0)),e.setAttribute("instanceDistanceEnd",new Jt(i,1,1)),this}raycast(e,t){const n=this.material.worldUnits,s=e.camera;s===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;vt=e.ray;const a=this.matrixWorld,r=this.geometry,A=this.material;Zt=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),rn.copy(r.boundingSphere).applyMatrix4(a);let c;if(n)c=Zt*.5;else{const h=Math.max(s.near,rn.distanceToPoint(vt.origin));c=co(s,h,A.resolution)}if(rn.radius+=c,vt.intersectsSphere(rn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),on.copy(r.boundingBox).applyMatrix4(a);let l;if(n)l=Zt*.5;else{const h=Math.max(s.near,on.distanceToPoint(vt.origin));l=co(s,h,A.resolution)}on.expandByScalar(l),vt.intersectsBox(on)!==!1&&(n?vl(this,t):xl(this,s,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(li),this.material.uniforms.resolution.value.set(li.z,li.w))}}class lo extends ao{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let s=0;s<t;s+=3)n[2*s]=e[s],n[2*s+1]=e[s+1],n[2*s+2]=e[s+2],n[2*s+3]=e[s+3],n[2*s+4]=e[s+4],n[2*s+5]=e[s+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let s=0;s<t;s+=3)n[2*s]=e[s],n[2*s+1]=e[s+1],n[2*s+2]=e[s+2],n[2*s+3]=e[s+3],n[2*s+4]=e[s+4],n[2*s+5]=e[s+5];return super.setColors(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Dl extends Sl{constructor(e=new lo,t=new ci({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class kl extends H{constructor(e){const t=new Rl(e),n=new Cn(t.image.width*.001,t.image.height*.001),s=new mt({map:t,toneMapped:!1,transparent:!0});super(n,s);function i(a){s.map.dispatchDOMEvent(a)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){n.dispose(),s.dispose(),s.map.dispose(),pi.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class Rl extends Li{constructor(e){super(ho(e)),this.dom=e,this.anisotropy=16,this.colorSpace=re,this.minFilter=ht,this.magFilter=ht;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),n={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,n),this.observer=t}dispatchDOMEvent(e){e.data&&Tl(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=ho(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const pi=new WeakMap;function ho(o){const e=document.createRange(),t=new Ce;function n(p){const d=[];let u=!1;function m(){if(u&&(u=!1,p.restore()),d.length===0)return;let b=-1/0,I=-1/0,C=1/0,E=1/0;for(let w=0;w<d.length;w++){const Q=d[w];b=Math.max(b,Q.x),I=Math.max(I,Q.y),C=Math.min(C,Q.x+Q.width),E=Math.min(E,Q.y+Q.height)}p.save(),p.beginPath(),p.rect(b,I,C-b,E-I),p.clip(),u=!0}return{add:function(b){d.push(b),m()},remove:function(){d.pop(),m()}}}function s(p,d,u,m){m!==""&&(p.textTransform==="uppercase"&&(m=m.toUpperCase()),l.font=p.fontWeight+" "+p.fontSize+" "+p.fontFamily,l.textBaseline="top",l.fillStyle=p.color,l.fillText(m,d,u+parseFloat(p.fontSize)*.1))}function i(p,d,u,m,b){u<2*b&&(b=u/2),m<2*b&&(b=m/2),l.beginPath(),l.moveTo(p+b,d),l.arcTo(p+u,d,p+u,d+m,b),l.arcTo(p+u,d+m,p,d+m,b),l.arcTo(p,d+m,p,d,b),l.arcTo(p,d,p+u,d,b),l.closePath()}function a(p,d,u,m,b,I){const C=p[d+"Width"],E=p[d+"Style"],w=p[d+"Color"];C!=="0px"&&E!=="none"&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=w,l.lineWidth=parseFloat(C),l.beginPath(),l.moveTo(u,m),l.lineTo(u+b,m+I),l.stroke())}function r(p,d){if(p.nodeType===Node.COMMENT_NODE||p.nodeName==="SCRIPT"||p.style&&p.style.display==="none")return;let u=0,m=0,b=0,I=0;if(p.nodeType===Node.TEXT_NODE){e.selectNode(p);const E=e.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,s(d,u,m,p.nodeValue.trim())}else if(p instanceof HTMLCanvasElement){const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,l.save();const w=window.devicePixelRatio;l.scale(1/w,1/w),l.drawImage(p,u,m),l.restore()}else if(p instanceof HTMLImageElement){const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,l.drawImage(p,u,m,b,I)}else{const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,d=window.getComputedStyle(p),i(u,m,b,I,parseFloat(d.borderRadius));const w=d.backgroundColor;w!=="transparent"&&w!=="rgba(0, 0, 0, 0)"&&(l.fillStyle=w,l.fill());const Q=["borderTop","borderLeft","borderBottom","borderRight"];let S=!0,D=null;for(const x of Q){if(D!==null&&(S=d[x+"Width"]===d[D+"Width"]&&d[x+"Color"]===d[D+"Color"]&&d[x+"Style"]===d[D+"Style"]),S===!1)break;D=x}if(S===!0){const x=parseFloat(d.borderTopWidth);d.borderTopWidth!=="0px"&&d.borderTopStyle!=="none"&&d.borderTopColor!=="transparent"&&d.borderTopColor!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=d.borderTopColor,l.lineWidth=x,l.stroke())}else a(d,"borderTop",u,m,b,0),a(d,"borderLeft",u,m,0,I),a(d,"borderBottom",u,m+I,b,0),a(d,"borderRight",u+b,m,0,I);if(p instanceof HTMLInputElement){let x=d.accentColor;(x===void 0||x==="auto")&&(x=d.color),t.set(x);const R=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(p.type==="radio"&&(i(u,m,b,I,I),l.fillStyle="white",l.strokeStyle=x,l.lineWidth=1,l.fill(),l.stroke(),p.checked&&(i(u+2,m+2,b-4,I-4,I),l.fillStyle=x,l.strokeStyle=R,l.lineWidth=2,l.fill(),l.stroke())),p.type==="checkbox"&&(i(u,m,b,I,2),l.fillStyle=p.checked?x:"white",l.strokeStyle=p.checked?R:x,l.lineWidth=1,l.stroke(),l.fill(),p.checked)){const G=l.textAlign;l.textAlign="center";const W={color:R,fontFamily:d.fontFamily,fontSize:I+"px",fontWeight:"bold"};s(W,u+b/2,m,"\u2714"),l.textAlign=G}if(p.type==="range"){const[G,W,V]=["min","max","value"].map(Z=>parseFloat(p[Z])),J=(V-G)/(W-G)*(b-I);i(u,m+I/4,b,I/2,I/4),l.fillStyle=R,l.strokeStyle=x,l.lineWidth=1,l.fill(),l.stroke(),i(u,m+I/4,J+I/2,I/2,I/4),l.fillStyle=x,l.fill(),i(u+J,m,I,I,I/2),l.fillStyle=x,l.fill()}(p.type==="color"||p.type==="text"||p.type==="number")&&(h.add({x:u,y:m,width:b,height:I}),s(d,u+parseInt(d.paddingLeft),m+parseInt(d.paddingTop),p.value),h.remove())}}const C=d.overflow==="auto"||d.overflow==="hidden";C&&h.add({x:u,y:m,width:b,height:I});for(let E=0;E<p.childNodes.length;E++)r(p.childNodes[E],d);C&&h.remove()}const A=o.getBoundingClientRect();let c=pi.get(o);c===void 0&&(c=document.createElement("canvas"),c.width=A.width,c.height=A.height,pi.set(o,c));const l=c.getContext("2d"),h=new n(l);return l.clearRect(0,0,c.width,c.height),r(o),c}function Tl(o,e,t,n){const s={clientX:t*o.offsetWidth+o.offsetLeft,clientY:n*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,s));const i=o.getBoundingClientRect();t=t*i.width+i.left,n=n*i.height+i.top;function a(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&n>A.top&&n<A.bottom&&(r.dispatchEvent(new MouseEvent(e,s)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[c,l]=["min","max"].map(d=>parseFloat(r[d])),h=A.width,p=(t-A.x)/h;r.value=c+(l-c)*p,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let c=0;c<r.childNodes.length;c++)a(r.childNodes[c])}}a(o)}const An=new _e,cs={type:"",data:An},go=new En;class Ml extends Kt{listenToPointerEvents(e,t){const n=this,s=new En,i=e.domElement;function a(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();An.x=(r.clientX-A.left)/A.width*2-1,An.y=-(r.clientY-A.top)/A.height*2+1,s.setFromCamera(An,t);const c=s.intersectObjects(n.children,!1);if(c.length>0){const l=c[0],h=l.object,p=l.uv;cs.type=r.type,cs.data.set(p.x,1-p.y),h.dispatchEvent(cs)}}i.addEventListener("pointerdown",a),i.addEventListener("pointerup",a),i.addEventListener("pointermove",a),i.addEventListener("mousedown",a),i.addEventListener("mouseup",a),i.addEventListener("mousemove",a),i.addEventListener("click",a)}listenToXRControllerEvents(e){const t=this,n={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function s(i){const a=i.target;go.setFromXRController(a);const r=go.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],c=A.object,l=A.uv;cs.type=n[i.type],cs.data.set(l.x,1-l.y),c.dispatchEvent(cs)}}e.addEventListener("move",s),e.addEventListener("select",s),e.addEventListener("selectstart",s),e.addEventListener("selectend",s)}}const Ms=new N,_s=new N,po=new Mi;class _l extends Us{constructor(e,t=1,n=16711680){const s=new ot,i=e.geometry.attributes.normal.count,a=new Se(i*2*3,3);s.setAttribute("position",a),super(s,new kt({color:n,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),po.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry;if(n){const s=n.attributes.position,i=n.attributes.normal;let a=0;for(let r=0,A=s.count;r<A;r++)Ms.fromBufferAttribute(s,r).applyMatrix4(e),_s.fromBufferAttribute(i,r),_s.applyMatrix3(po).normalize().multiplyScalar(this.size).add(Ms),t.setXYZ(a,Ms.x,Ms.y,Ms.z),a=a+1,t.setXYZ(a,_s.x,_s.y,_s.z),a=a+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class Fl{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new Ci(-1,1,1,-1,0,1);class Ll extends ot{constructor(){super(),this.setAttribute("position",new Se([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Se([0,2,0,0,2,0],2))}}new Ll;const ct={node:"node",material:"material",camera:"camera",light:"light"},$t="KHR_animation_pointer",Nl={CUBICSPLINE:void 0,LINEAR:ds,STEP:mn},uo=gt.findNode;let fo=!1;class Ul{constructor(e){this.parser=e,this.name=$t,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){fo||(fo=!0,gt.findNode=function(e,t){if(t.startsWith(".materials.")){const n=t.substring(11).substring(t.indexOf(".")),s=n.indexOf("."),i=s<0?n:n.substring(0,s);let a=null;return e.traverse(r=>{a!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(a=r.material,a!==null&&(n.endsWith(".map")?a=a.map:n.endsWith(".emissiveMap")&&(a=a.emissiveMap)))}),a}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const n=t.split(".");let s;for(let i=1;i<n.length;i++){const a=n[i];if(a.length==36)s=e.getObjectByProperty("uuid",a);else if(s&&s[a]){const r=Number.parseInt(a);let A=a;r>=0&&(A=r),s=s[A]}else{const r=e.getObjectByName(a);r&&(s=r)}}if(!s){const i=uo(e,n[2]);return i||console.warn($t+": Property binding not found",t,e,e.name,n),i}return s}return uo(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,n=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",n)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,n=t.extensions&&t.extensions[$t]&&t.path&&t.path==="pointer";if(!n)return null;let s,i=ct.node,a;if(n){const A=t.extensions[$t];let c=A.pointer;if(!c){console.warn("Invalid path",A,t);return}if(c.startsWith("/materials/")?i=ct.material:c.startsWith("/extensions/KHR_lights_punctual/lights/")?i=ct.light:c.startsWith("/cameras/")&&(i=ct.camera),a=this._tryResolveTargetId(c,i),a===null||isNaN(a)){console.warn("Failed resolving animation node id: "+a,c);return}switch(i){case ct.material:const h=("/materials/"+a.toString()+"/").length,p=c.substring(0,h);switch(s=c.substring(h),s){case"pbrMetallicRoughness/baseColorFactor":s="color";break;case"pbrMetallicRoughness/roughnessFactor":s="roughness";break;case"pbrMetallicRoughness/metallicFactor":s="metalness";break;case"emissiveFactor":s="emissive";break;case"alphaCutoff":s="alphaTest";break;case"occlusionTexture/strength":s="aoMapIntensity";break;case"normalTexture/scale":s="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":s="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":s="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":s="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":s="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":s="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":s="transmission";break;case"extensions/KHR_materials_ior/ior":s="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":s="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":s="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":s="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":s="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":s="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":s="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":s="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":s="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":s="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":s="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":s="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":s="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":s="specularColor";break}c=p+s;break;case ct.node:const d=("/nodes/"+a.toString()+"/").length,u=c.substring(0,d);switch(s=c.substring(d),s){case"translation":s="position";break;case"rotation":s="quaternion";break;case"scale":s="scale";break;case"weights":s="morphTargetInfluences";break}c=u+s;break;case ct.light:const m=("/extensions/KHR_lights_punctual/lights/"+a.toString()+"/").length;switch(s=c.substring(m),s){case"color":break;case"intensity":break;case"spot/innerConeAngle":s="penumbra";break;case"spot/outerConeAngle":s="angle";break;case"range":s="distance";break}c="/lights/"+a.toString()+"/"+s;break;case ct.camera:const b=("/cameras/"+a.toString()+"/").length,I=c.substring(0,b);switch(s=c.substring(b),s){case"perspective/yfov":s="fov";break;case"perspective/znear":case"orthographic/znear":s="near";break;case"perspective/zfar":case"orthographic/zfar":s="far";break;case"perspective/aspect":s="aspect";break;case"orthographic/xmag":s="zoom";break;case"orthographic/ymag":s="zoom";break}c=I+s;break}const l=this.animationPointerResolver;l&&l.resolvePath&&(c=l.resolvePath(c)),t.extensions[$t].pointer=c}if(a===null||isNaN(a)){console.warn("Failed resolving animation node id: "+a,t);return}let r;return i===ct.node?r=this.parser.getDependency("node",a):i===ct.material?r=this.parser.getDependency("material",a):i===ct.light?r=this.parser.getDependency("light",a):i===ct.camera?r=this.parser.getDependency("camera",a):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,n,s,i){if(!(i.extensions&&i.extensions[$t]&&i.path&&i.path==="pointer"))return null;let a=i.extensions[$t].pointer;if(!a)return null;const r=[];a=a.replaceAll("/",".");const A=a.split(".");var c=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(A[2]=c,A[3]==="morphTargetInfluences"&&e.type==="Group"){for(const h of e.children)h instanceof dn&&h.morphTargetInfluences&&(A[3]=h.name,A[4]="morphTargetInfluences",l(this.parser));return r}l(this.parser);function l(h){a=A.join(".");let p;switch(n.itemSize){case 1:p=Hs;break;case 2:case 3:p=Os;break;case 4:a.endsWith(".quaternion")?p=js:p=Br;break}const d=s.interpolation!==void 0?Nl[s.interpolation]:ds;let u=h._getArrayFromAccessor(n);a.endsWith(".fov")&&(u=u.map(b=>b/Math.PI*180));const m=new p(a,t.array,u,d);if(d==="CUBICSPLINE"&&h._createCubicSplineTrackInterpolant(m),r.push(m),a&&n.itemSize===4&&a.startsWith(".materials.")&&a.endsWith(".color")){const b=new Float32Array(u.length/4);for(let C=0,E=u.length/4;C<E;C+=1)b[C]=u[C*4+3];const I=new p(a.replace(".color",".opacity"),t.array,b,d);d==="CUBICSPLINE"&&h._createCubicSplineTrackInterpolant(m),r.push(I)}}return r}_tryResolveTargetId(e,t){let n="";return t==="node"?n=e.substring(7):t==="material"?n=e.substring(11):t==="light"?n=e.substring(39):t==="camera"&&(n=e.substring(9)),n=n.substring(0,n.indexOf("/")),Number.parseInt(n)}loadAnimation(e){const t=this,n=this.parser.json,s=this.parser,i=n.animations[e],a=i.name?i.name:"animation_"+e,r=[],A=[],c=[],l=[],h=[];for(let p=0,d=i.channels.length;p<d;p++){const u=i.channels[p],m=i.samplers[u.sampler],b=u.target,I=i.parameters!==void 0?i.parameters[m.input]:m.input,C=i.parameters!==void 0?i.parameters[m.output]:m.output;let E=t.loadAnimationTargetFromChannelWithAnimationPointer(u);E||(E=t.loadAnimationTargetFromChannel(u)),r.push(E),A.push(s.getDependency("accessor",I)),c.push(s.getDependency("accessor",C)),l.push(m),h.push(b)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(p){const d=p[0],u=p[1],m=p[2],b=p[3],I=p[4],C=[];for(let E=0,w=d.length;E<w;E++){const Q=d[E],S=u[E],D=m[E],x=b[E],R=I[E];if(Q===void 0)continue;Q.updateMatrix&&(Q.updateMatrix(),Q.matrixAutoUpdate=!0);let G=t.createAnimationTracksWithAnimationPointer(Q,S,D,x,R);if(G||(G=s._createAnimationTracks(Q,S,D,x,R)),G)for(let W=0;W<G.length;W++)C.push(G[W])}return new un(a,void 0,C)})}}const Gl=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:Ul},Symbol.toStringTag,{value:"Module"}));export{oA as D,_a as E,ga as F,Qn as G,Oc as H,Ml as I,xt as K,Dl as L,aA as M,xc as O,Pc as P,Fa as R,Is as S,EA as T,Hc as V,wl as X,wr as a,CA as b,Ea as c,oi as d,yl as e,lo as f,ci as g,QA as h,kl as i,_l as j,yc as k,oc as l,Qr as m,Ui as n,Fl as o,VA as p,XA as q,Gl as r,Xn as s,WA as z};
@@ -466,4 +466,4 @@ version 0.8.2
466
466
  #include <premultiplied_alpha_fragment>
467
467
 
468
468
  }
469
- `};class ns extends a.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:a.UniformsUtils.clone(a.ShaderLib.line.uniforms),vertexShader:a.ShaderLib.line.vertexShader,fragmentShader:a.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Gn=new a.Vector4,Ks=new a.Vector3,Ys=new a.Vector3,Te=new a.Vector4,ve=new a.Vector4,$e=new a.Vector4,Un=new a.Vector3,Pn=new a.Matrix4,Re=new a.Line3,Vs=new a.Vector3,on=new a.Box3,rn=new a.Sphere,et=new a.Vector4;let tt,Ct;function Js(c,e,t){return et.set(0,0,-e,1).applyMatrix4(c.projectionMatrix),et.multiplyScalar(1/et.w),et.x=Ct/t.width,et.y=Ct/t.height,et.applyMatrix4(c.projectionMatrixInverse),et.multiplyScalar(1/et.w),Math.abs(Math.max(et.x,et.y))}function wA(c,e){const t=c.matrixWorld,s=c.geometry,n=s.attributes.instanceStart,i=s.attributes.instanceEnd,o=Math.min(s.instanceCount,n.count);for(let r=0,A=o;r<A;r++){Re.start.fromBufferAttribute(n,r),Re.end.fromBufferAttribute(i,r),Re.applyMatrix4(t);const l=new a.Vector3,h=new a.Vector3;tt.distanceSqToSegment(Re.start,Re.end,h,l),h.distanceTo(l)<Ct*.5&&e.push({point:h,pointOnLine:l,distance:tt.origin.distanceTo(h),object:c,face:null,faceIndex:r,uv:null,uv1:null})}}function yA(c,e,t){const s=e.projectionMatrix,i=c.material.resolution,o=c.matrixWorld,r=c.geometry,A=r.attributes.instanceStart,l=r.attributes.instanceEnd,h=Math.min(r.instanceCount,A.count),u=-e.near;tt.at(1,$e),$e.w=1,$e.applyMatrix4(e.matrixWorldInverse),$e.applyMatrix4(s),$e.multiplyScalar(1/$e.w),$e.x*=i.x/2,$e.y*=i.y/2,$e.z=0,Un.copy($e),Pn.multiplyMatrices(e.matrixWorldInverse,o);for(let p=0,f=h;p<f;p++){if(Te.fromBufferAttribute(A,p),ve.fromBufferAttribute(l,p),Te.w=1,ve.w=1,Te.applyMatrix4(Pn),ve.applyMatrix4(Pn),Te.z>u&&ve.z>u)continue;if(Te.z>u){const C=Te.z-ve.z,y=(Te.z-u)/C;Te.lerp(ve,y)}else if(ve.z>u){const C=ve.z-Te.z,y=(ve.z-u)/C;ve.lerp(Te,y)}Te.applyMatrix4(s),ve.applyMatrix4(s),Te.multiplyScalar(1/Te.w),ve.multiplyScalar(1/ve.w),Te.x*=i.x/2,Te.y*=i.y/2,ve.x*=i.x/2,ve.y*=i.y/2,Re.start.copy(Te),Re.start.z=0,Re.end.copy(ve),Re.end.z=0;const I=Re.closestPointToPointParameter(Un,!0);Re.at(I,Vs);const b=a.MathUtils.lerp(Te.z,ve.z,I),E=b>=-1&&b<=1,w=Un.distanceTo(Vs)<Ct*.5;if(E&&w){Re.start.fromBufferAttribute(A,p),Re.end.fromBufferAttribute(l,p),Re.start.applyMatrix4(o),Re.end.applyMatrix4(o);const C=new a.Vector3,y=new a.Vector3;tt.distanceSqToSegment(Re.start,Re.end,y,C),t.push({point:y,pointOnLine:C,distance:tt.origin.distanceTo(y),object:c,face:null,faceIndex:p,uv:null,uv1:null})}}}class QA extends a.Mesh{constructor(e=new Pi,t=new ns({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,s=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let o=0,r=0,A=t.count;o<A;o++,r+=2)Ks.fromBufferAttribute(t,o),Ys.fromBufferAttribute(s,o),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Ks.distanceTo(Ys);const i=new a.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new a.InterleavedBufferAttribute(i,1,0)),e.setAttribute("instanceDistanceEnd",new a.InterleavedBufferAttribute(i,1,1)),this}raycast(e,t){const s=this.material.worldUnits,n=e.camera;n===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;tt=e.ray;const o=this.matrixWorld,r=this.geometry,A=this.material;Ct=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),rn.copy(r.boundingSphere).applyMatrix4(o);let l;if(s)l=Ct*.5;else{const u=Math.max(n.near,rn.distanceToPoint(tt.origin));l=Js(n,u,A.resolution)}if(rn.radius+=l,tt.intersectsSphere(rn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),on.copy(r.boundingBox).applyMatrix4(o);let h;if(s)h=Ct*.5;else{const u=Math.max(n.near,on.distanceToPoint(tt.origin));h=Js(n,u,A.resolution)}on.expandByScalar(h),tt.intersectsBox(on)!==!1&&(s?wA(this,t):yA(this,n,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(Gn),this.material.uniforms.resolution.value.set(Gn.z,Gn.w))}}class Ni extends Pi{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setPositions(s),this}setColors(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setColors(s),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class xA extends QA{constructor(e=new Ni,t=new ns({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class SA extends a.Mesh{constructor(e){const t=new TA(e),s=new a.PlaneGeometry(t.image.width*.001,t.image.height*.001),n=new a.MeshBasicMaterial({map:t,toneMapped:!1,transparent:!0});super(s,n);function i(o){n.map.dispatchDOMEvent(o)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){s.dispose(),n.dispose(),n.map.dispose(),Jn.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class TA extends a.CanvasTexture{constructor(e){super(Ws(e)),this.dom=e,this.anisotropy=16,this.colorSpace=a.SRGBColorSpace,this.minFilter=a.LinearFilter,this.magFilter=a.LinearFilter;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),s={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,s),this.observer=t}dispatchDOMEvent(e){e.data&&vA(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=Ws(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const Jn=new WeakMap;function Ws(c){const e=document.createRange(),t=new a.Color;function s(p){const f=[];let d=!1;function I(){if(d&&(d=!1,p.restore()),f.length===0)return;let b=-1/0,E=-1/0,w=1/0,C=1/0;for(let y=0;y<f.length;y++){const x=f[y];b=Math.max(b,x.x),E=Math.max(E,x.y),w=Math.min(w,x.x+x.width),C=Math.min(C,x.y+x.height)}p.save(),p.beginPath(),p.rect(b,E,w-b,C-E),p.clip(),d=!0}return{add:function(b){f.push(b),I()},remove:function(){f.pop(),I()}}}function n(p,f,d,I){I!==""&&(p.textTransform==="uppercase"&&(I=I.toUpperCase()),h.font=p.fontWeight+" "+p.fontSize+" "+p.fontFamily,h.textBaseline="top",h.fillStyle=p.color,h.fillText(I,f,d+parseFloat(p.fontSize)*.1))}function i(p,f,d,I,b){d<2*b&&(b=d/2),I<2*b&&(b=I/2),h.beginPath(),h.moveTo(p+b,f),h.arcTo(p+d,f,p+d,f+I,b),h.arcTo(p+d,f+I,p,f+I,b),h.arcTo(p,f+I,p,f,b),h.arcTo(p,f,p+d,f,b),h.closePath()}function o(p,f,d,I,b,E){const w=p[f+"Width"],C=p[f+"Style"],y=p[f+"Color"];w!=="0px"&&C!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=y,h.lineWidth=parseFloat(w),h.beginPath(),h.moveTo(d,I),h.lineTo(d+b,I+E),h.stroke())}function r(p,f){if(p.nodeType===Node.COMMENT_NODE||p.nodeName==="SCRIPT"||p.style&&p.style.display==="none")return;let d=0,I=0,b=0,E=0;if(p.nodeType===Node.TEXT_NODE){e.selectNode(p);const C=e.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,n(f,d,I,p.nodeValue.trim())}else if(p instanceof HTMLCanvasElement){const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,h.save();const y=window.devicePixelRatio;h.scale(1/y,1/y),h.drawImage(p,d,I),h.restore()}else if(p instanceof HTMLImageElement){const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,h.drawImage(p,d,I,b,E)}else{const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,f=window.getComputedStyle(p),i(d,I,b,E,parseFloat(f.borderRadius));const y=f.backgroundColor;y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.fillStyle=y,h.fill());const x=["borderTop","borderLeft","borderBottom","borderRight"];let R=!0,D=null;for(const S of x){if(D!==null&&(R=f[S+"Width"]===f[D+"Width"]&&f[S+"Color"]===f[D+"Color"]&&f[S+"Style"]===f[D+"Style"]),R===!1)break;D=S}if(R===!0){const S=parseFloat(f.borderTopWidth);f.borderTopWidth!=="0px"&&f.borderTopStyle!=="none"&&f.borderTopColor!=="transparent"&&f.borderTopColor!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=f.borderTopColor,h.lineWidth=S,h.stroke())}else o(f,"borderTop",d,I,b,0),o(f,"borderLeft",d,I,0,E),o(f,"borderBottom",d,I+E,b,0),o(f,"borderRight",d+b,I,0,E);if(p instanceof HTMLInputElement){let S=f.accentColor;(S===void 0||S==="auto")&&(S=f.color),t.set(S);const G=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(p.type==="radio"&&(i(d,I,b,E,E),h.fillStyle="white",h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),p.checked&&(i(d+2,I+2,b-4,E-4,E),h.fillStyle=S,h.strokeStyle=G,h.lineWidth=2,h.fill(),h.stroke())),p.type==="checkbox"&&(i(d,I,b,E,2),h.fillStyle=p.checked?S:"white",h.strokeStyle=p.checked?G:S,h.lineWidth=1,h.stroke(),h.fill(),p.checked)){const U=h.textAlign;h.textAlign="center";const O={color:G,fontFamily:f.fontFamily,fontSize:E+"px",fontWeight:"bold"};n(O,d+b/2,I,"✔"),h.textAlign=U}if(p.type==="range"){const[U,O,X]=["min","max","value"].map(q=>parseFloat(p[q])),P=(X-U)/(O-U)*(b-E);i(d,I+E/4,b,E/2,E/4),h.fillStyle=G,h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),i(d,I+E/4,P+E/2,E/2,E/4),h.fillStyle=S,h.fill(),i(d+P,I,E,E,E/2),h.fillStyle=S,h.fill()}(p.type==="color"||p.type==="text"||p.type==="number")&&(u.add({x:d,y:I,width:b,height:E}),n(f,d+parseInt(f.paddingLeft),I+parseInt(f.paddingTop),p.value),u.remove())}}const w=f.overflow==="auto"||f.overflow==="hidden";w&&u.add({x:d,y:I,width:b,height:E});for(let C=0;C<p.childNodes.length;C++)r(p.childNodes[C],f);w&&u.remove()}const A=c.getBoundingClientRect();let l=Jn.get(c);l===void 0&&(l=document.createElement("canvas"),l.width=A.width,l.height=A.height,Jn.set(c,l));const h=l.getContext("2d"),u=new s(h);return h.clearRect(0,0,l.width,l.height),r(c),l}function vA(c,e,t,s){const n={clientX:t*c.offsetWidth+c.offsetLeft,clientY:s*c.offsetHeight+c.offsetTop,view:c.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,n));const i=c.getBoundingClientRect();t=t*i.width+i.left,s=s*i.height+i.top;function o(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&s>A.top&&s<A.bottom&&(r.dispatchEvent(new MouseEvent(e,n)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[l,h]=["min","max"].map(d=>parseFloat(r[d])),u=A.width,f=(t-A.x)/u;r.value=l+(h-l)*f,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let l=0;l<r.childNodes.length;l++)o(r.childNodes[l])}}o(c)}const An=new a.Vector2,Tt={type:"",data:An},Xs=new a.Raycaster;class MA extends a.Group{listenToPointerEvents(e,t){const s=this,n=new a.Raycaster,i=e.domElement;function o(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();An.x=(r.clientX-A.left)/A.width*2-1,An.y=-(r.clientY-A.top)/A.height*2+1,n.setFromCamera(An,t);const l=n.intersectObjects(s.children,!1);if(l.length>0){const h=l[0],u=h.object,p=h.uv;Tt.type=r.type,Tt.data.set(p.x,1-p.y),u.dispatchEvent(Tt)}}i.addEventListener("pointerdown",o),i.addEventListener("pointerup",o),i.addEventListener("pointermove",o),i.addEventListener("mousedown",o),i.addEventListener("mouseup",o),i.addEventListener("mousemove",o),i.addEventListener("click",o)}listenToXRControllerEvents(e){const t=this,s={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function n(i){const o=i.target;Xs.setFromXRController(o);const r=Xs.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],l=A.object,h=A.uv;Tt.type=s[i.type],Tt.data.set(h.x,1-h.y),l.dispatchEvent(Tt)}}e.addEventListener("move",n),e.addEventListener("select",n),e.addEventListener("selectstart",n),e.addEventListener("selectend",n)}}const Pt=new a.Vector3,Nt=new a.Vector3,Zs=new a.Matrix3;class RA extends a.LineSegments{constructor(e,t=1,s=16711680){const n=new a.BufferGeometry,i=e.geometry.attributes.normal.count,o=new a.Float32BufferAttribute(i*2*3,3);n.setAttribute("position",o),super(n,new a.LineBasicMaterial({color:s,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),Zs.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,s=this.object.geometry;if(s){const n=s.attributes.position,i=s.attributes.normal;let o=0;for(let r=0,A=n.count;r<A;r++)Pt.fromBufferAttribute(n,r).applyMatrix4(e),Nt.fromBufferAttribute(i,r),Nt.applyMatrix3(Zs).normalize().multiplyScalar(this.size).add(Pt),t.setXYZ(o,Pt.x,Pt.y,Pt.z),o=o+1,t.setXYZ(o,Nt.x,Nt.y,Nt.z),o=o+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}const Ve={node:"node",material:"material",camera:"camera",light:"light"},bt="KHR_animation_pointer",DA={CUBICSPLINE:void 0,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},$s=a.PropertyBinding.findNode;let ei=!1;class _A{constructor(e){this.parser=e,this.name=bt,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){ei||(ei=!0,a.PropertyBinding.findNode=function(e,t){if(t.startsWith(".materials.")){const s=t.substring(11).substring(t.indexOf(".")),n=s.indexOf("."),i=n<0?s:s.substring(0,n);let o=null;return e.traverse(r=>{o!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(o=r.material,o!==null&&(s.endsWith(".map")?o=o.map:s.endsWith(".emissiveMap")&&(o=o.emissiveMap)))}),o}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const s=t.split(".");let n;for(let i=1;i<s.length;i++){const o=s[i];if(o.length==36)n=e.getObjectByProperty("uuid",o);else if(n&&n[o]){const A=Number.parseInt(o);let l=o;A>=0&&(l=A),n=n[l]}else{const A=e.getObjectByName(o);A&&(n=A)}}if(!n){const i=$s(e,s[2]);return i||console.warn(bt+": Property binding not found",t,e,e.name,s),i}return n}return $s(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,s=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",s)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,s=t.extensions&&t.extensions[bt]&&t.path&&t.path==="pointer";if(!s)return null;let n,i=Ve.node,o;if(s){const A=t.extensions[bt];let l=A.pointer;if(!l){console.warn("Invalid path",A,t);return}if(l.startsWith("/materials/")?i=Ve.material:l.startsWith("/extensions/KHR_lights_punctual/lights/")?i=Ve.light:l.startsWith("/cameras/")&&(i=Ve.camera),o=this._tryResolveTargetId(l,i),o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,l);return}switch(i){case Ve.material:const u=("/materials/"+o.toString()+"/").length,p=l.substring(0,u);switch(n=l.substring(u),n){case"pbrMetallicRoughness/baseColorFactor":n="color";break;case"pbrMetallicRoughness/roughnessFactor":n="roughness";break;case"pbrMetallicRoughness/metallicFactor":n="metalness";break;case"emissiveFactor":n="emissive";break;case"alphaCutoff":n="alphaTest";break;case"occlusionTexture/strength":n="aoMapIntensity";break;case"normalTexture/scale":n="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":n="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":n="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":n="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":n="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":n="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":n="transmission";break;case"extensions/KHR_materials_ior/ior":n="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":n="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":n="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":n="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":n="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":n="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":n="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":n="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":n="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":n="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":n="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":n="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":n="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":n="specularColor";break}l=p+n;break;case Ve.node:const f=("/nodes/"+o.toString()+"/").length,d=l.substring(0,f);switch(n=l.substring(f),n){case"translation":n="position";break;case"rotation":n="quaternion";break;case"scale":n="scale";break;case"weights":n="morphTargetInfluences";break}l=d+n;break;case Ve.light:const I=("/extensions/KHR_lights_punctual/lights/"+o.toString()+"/").length;switch(n=l.substring(I),n){case"color":break;case"intensity":break;case"spot/innerConeAngle":n="penumbra";break;case"spot/outerConeAngle":n="angle";break;case"range":n="distance";break}l="/lights/"+o.toString()+"/"+n;break;case Ve.camera:const b=("/cameras/"+o.toString()+"/").length,E=l.substring(0,b);switch(n=l.substring(b),n){case"perspective/yfov":n="fov";break;case"perspective/znear":case"orthographic/znear":n="near";break;case"perspective/zfar":case"orthographic/zfar":n="far";break;case"perspective/aspect":n="aspect";break;case"orthographic/xmag":n="zoom";break;case"orthographic/ymag":n="zoom";break}l=E+n;break}const h=this.animationPointerResolver;h&&h.resolvePath&&(l=h.resolvePath(l)),t.extensions[bt].pointer=l}if(o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,t);return}let r;return i===Ve.node?r=this.parser.getDependency("node",o):i===Ve.material?r=this.parser.getDependency("material",o):i===Ve.light?r=this.parser.getDependency("light",o):i===Ve.camera?r=this.parser.getDependency("camera",o):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,s,n,i){if(!(i.extensions&&i.extensions[bt]&&i.path&&i.path==="pointer"))return null;let r=i.extensions[bt].pointer;if(!r)return null;const A=[];r=r.replaceAll("/",".");const l=r.split(".");var u=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(l[2]=u,l[3]==="morphTargetInfluences"&&e.type==="Group"){for(const f of e.children)f instanceof a.SkinnedMesh&&f.morphTargetInfluences&&(l[3]=f.name,l[4]="morphTargetInfluences",p(this.parser));return A}p(this.parser);function p(f){r=l.join(".");let d;switch(s.itemSize){case 1:d=a.NumberKeyframeTrack;break;case 2:case 3:d=a.VectorKeyframeTrack;break;case 4:r.endsWith(".quaternion")?d=a.QuaternionKeyframeTrack:d=a.ColorKeyframeTrack;break}const I=n.interpolation!==void 0?DA[n.interpolation]:a.InterpolateLinear;let b=f._getArrayFromAccessor(s);r.endsWith(".fov")&&(b=b.map(w=>w/Math.PI*180));const E=new d(r,t.array,b,I);if(I==="CUBICSPLINE"&&f._createCubicSplineTrackInterpolant(E),A.push(E),r&&s.itemSize===4&&r.startsWith(".materials.")&&r.endsWith(".color")){const w=new Float32Array(b.length/4);for(let y=0,x=b.length/4;y<x;y+=1)w[y]=b[y*4+3];const C=new d(r.replace(".color",".opacity"),t.array,w,I);I==="CUBICSPLINE"&&f._createCubicSplineTrackInterpolant(E),A.push(C)}}return A}_tryResolveTargetId(e,t){let s="";return t==="node"?s=e.substring(7):t==="material"?s=e.substring(11):t==="light"?s=e.substring(39):t==="camera"&&(s=e.substring(9)),s=s.substring(0,s.indexOf("/")),Number.parseInt(s)}loadAnimation(e){const t=this,s=this.parser.json,n=this.parser,i=s.animations[e],o=i.name?i.name:"animation_"+e,r=[],A=[],l=[],h=[],u=[];for(let p=0,f=i.channels.length;p<f;p++){const d=i.channels[p],I=i.samplers[d.sampler],b=d.target,E=i.parameters!==void 0?i.parameters[I.input]:I.input,w=i.parameters!==void 0?i.parameters[I.output]:I.output;let C=t.loadAnimationTargetFromChannelWithAnimationPointer(d);C||(C=t.loadAnimationTargetFromChannel(d)),r.push(C),A.push(n.getDependency("accessor",E)),l.push(n.getDependency("accessor",w)),h.push(I),u.push(b)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(l),Promise.all(h),Promise.all(u)]).then(function(p){const f=p[0],d=p[1],I=p[2],b=p[3],E=p[4],w=[];for(let C=0,y=f.length;C<y;C++){const x=f[C],R=d[C],D=I[C],S=b[C],v=E[C];if(x===void 0)continue;x.updateMatrix&&(x.updateMatrix(),x.matrixAutoUpdate=!0);let G=t.createAnimationTracksWithAnimationPointer(x,R,D,S,v);if(G||(G=n._createAnimationTracks(x,R,D,S,v)),G)for(let U=0;U<G.length;U++)w.push(G[U])}return new a.AnimationClip(o,void 0,w)})}}const FA=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:_A},Symbol.toStringTag,{value:"Module"}));class kA{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new a.OrthographicCamera(-1,1,1,-1,0,1);class LA extends a.BufferGeometry{constructor(){super(),this.setAttribute("position",new a.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new a.Float32BufferAttribute([0,2,0,0,2,0],2))}}new LA;exports.DRACOLoader=sr;exports.EXRLoader=Mi;exports.EXRLoader$1=Yr;exports.FBXLoader=sa;exports.Font=Ei;exports.FontLoader=Ir;exports.GLTFExporter=ts;exports.GLTFLoader=Wn;exports.GLTFLoaderAnimationPointer=FA;exports.GroundedSkybox=Eo;exports.HTMLMesh=SA;exports.HorizontalBlurShader=Ua;exports.InteractiveGroup=MA;exports.KTX2Loader=nt;exports.Line2=xA;exports.LineGeometry=Ni;exports.LineMaterial=ns;exports.MeshoptDecoder=nr;exports.OBJLoader=Ba;exports.OrbitControls=ya;exports.Pass=kA;exports.PositionalAudioHelper=Ga;exports.RGBELoader=Ri;exports.RGBELoader$1=Vr;exports.Stats=zt;exports.TextGeometry=mr;exports.TransformControls=Cr;exports.TransformControlsGizmo=Ci;exports.VertexNormalsHelper=RA;exports.VerticalBlurShader=Pa;exports.XRControllerModelFactory=EA;exports.XRHandMeshModel=BA;exports.mergeVertices=Co;exports.nodeFrame=ti;exports.strToU8=Yn;exports.zipSync=Kr;
469
+ `};class ns extends a.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:a.UniformsUtils.clone(a.ShaderLib.line.uniforms),vertexShader:a.ShaderLib.line.vertexShader,fragmentShader:a.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Gn=new a.Vector4,Ks=new a.Vector3,Ys=new a.Vector3,Te=new a.Vector4,ve=new a.Vector4,$e=new a.Vector4,Un=new a.Vector3,Pn=new a.Matrix4,Re=new a.Line3,Vs=new a.Vector3,on=new a.Box3,rn=new a.Sphere,et=new a.Vector4;let tt,Ct;function Js(c,e,t){return et.set(0,0,-e,1).applyMatrix4(c.projectionMatrix),et.multiplyScalar(1/et.w),et.x=Ct/t.width,et.y=Ct/t.height,et.applyMatrix4(c.projectionMatrixInverse),et.multiplyScalar(1/et.w),Math.abs(Math.max(et.x,et.y))}function wA(c,e){const t=c.matrixWorld,s=c.geometry,n=s.attributes.instanceStart,i=s.attributes.instanceEnd,o=Math.min(s.instanceCount,n.count);for(let r=0,A=o;r<A;r++){Re.start.fromBufferAttribute(n,r),Re.end.fromBufferAttribute(i,r),Re.applyMatrix4(t);const l=new a.Vector3,h=new a.Vector3;tt.distanceSqToSegment(Re.start,Re.end,h,l),h.distanceTo(l)<Ct*.5&&e.push({point:h,pointOnLine:l,distance:tt.origin.distanceTo(h),object:c,face:null,faceIndex:r,uv:null,uv1:null})}}function yA(c,e,t){const s=e.projectionMatrix,i=c.material.resolution,o=c.matrixWorld,r=c.geometry,A=r.attributes.instanceStart,l=r.attributes.instanceEnd,h=Math.min(r.instanceCount,A.count),u=-e.near;tt.at(1,$e),$e.w=1,$e.applyMatrix4(e.matrixWorldInverse),$e.applyMatrix4(s),$e.multiplyScalar(1/$e.w),$e.x*=i.x/2,$e.y*=i.y/2,$e.z=0,Un.copy($e),Pn.multiplyMatrices(e.matrixWorldInverse,o);for(let p=0,f=h;p<f;p++){if(Te.fromBufferAttribute(A,p),ve.fromBufferAttribute(l,p),Te.w=1,ve.w=1,Te.applyMatrix4(Pn),ve.applyMatrix4(Pn),Te.z>u&&ve.z>u)continue;if(Te.z>u){const C=Te.z-ve.z,y=(Te.z-u)/C;Te.lerp(ve,y)}else if(ve.z>u){const C=ve.z-Te.z,y=(ve.z-u)/C;ve.lerp(Te,y)}Te.applyMatrix4(s),ve.applyMatrix4(s),Te.multiplyScalar(1/Te.w),ve.multiplyScalar(1/ve.w),Te.x*=i.x/2,Te.y*=i.y/2,ve.x*=i.x/2,ve.y*=i.y/2,Re.start.copy(Te),Re.start.z=0,Re.end.copy(ve),Re.end.z=0;const I=Re.closestPointToPointParameter(Un,!0);Re.at(I,Vs);const b=a.MathUtils.lerp(Te.z,ve.z,I),E=b>=-1&&b<=1,w=Un.distanceTo(Vs)<Ct*.5;if(E&&w){Re.start.fromBufferAttribute(A,p),Re.end.fromBufferAttribute(l,p),Re.start.applyMatrix4(o),Re.end.applyMatrix4(o);const C=new a.Vector3,y=new a.Vector3;tt.distanceSqToSegment(Re.start,Re.end,y,C),t.push({point:y,pointOnLine:C,distance:tt.origin.distanceTo(y),object:c,face:null,faceIndex:p,uv:null,uv1:null})}}}class QA extends a.Mesh{constructor(e=new Pi,t=new ns({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,s=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let o=0,r=0,A=t.count;o<A;o++,r+=2)Ks.fromBufferAttribute(t,o),Ys.fromBufferAttribute(s,o),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Ks.distanceTo(Ys);const i=new a.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new a.InterleavedBufferAttribute(i,1,0)),e.setAttribute("instanceDistanceEnd",new a.InterleavedBufferAttribute(i,1,1)),this}raycast(e,t){const s=this.material.worldUnits,n=e.camera;n===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;tt=e.ray;const o=this.matrixWorld,r=this.geometry,A=this.material;Ct=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),rn.copy(r.boundingSphere).applyMatrix4(o);let l;if(s)l=Ct*.5;else{const u=Math.max(n.near,rn.distanceToPoint(tt.origin));l=Js(n,u,A.resolution)}if(rn.radius+=l,tt.intersectsSphere(rn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),on.copy(r.boundingBox).applyMatrix4(o);let h;if(s)h=Ct*.5;else{const u=Math.max(n.near,on.distanceToPoint(tt.origin));h=Js(n,u,A.resolution)}on.expandByScalar(h),tt.intersectsBox(on)!==!1&&(s?wA(this,t):yA(this,n,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(Gn),this.material.uniforms.resolution.value.set(Gn.z,Gn.w))}}class Ni extends Pi{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setPositions(s),this}setColors(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setColors(s),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class xA extends QA{constructor(e=new Ni,t=new ns({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class SA extends a.Mesh{constructor(e){const t=new TA(e),s=new a.PlaneGeometry(t.image.width*.001,t.image.height*.001),n=new a.MeshBasicMaterial({map:t,toneMapped:!1,transparent:!0});super(s,n);function i(o){n.map.dispatchDOMEvent(o)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){s.dispose(),n.dispose(),n.map.dispose(),Jn.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class TA extends a.CanvasTexture{constructor(e){super(Ws(e)),this.dom=e,this.anisotropy=16,this.colorSpace=a.SRGBColorSpace,this.minFilter=a.LinearFilter,this.magFilter=a.LinearFilter;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),s={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,s),this.observer=t}dispatchDOMEvent(e){e.data&&vA(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=Ws(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const Jn=new WeakMap;function Ws(c){const e=document.createRange(),t=new a.Color;function s(p){const f=[];let d=!1;function I(){if(d&&(d=!1,p.restore()),f.length===0)return;let b=-1/0,E=-1/0,w=1/0,C=1/0;for(let y=0;y<f.length;y++){const x=f[y];b=Math.max(b,x.x),E=Math.max(E,x.y),w=Math.min(w,x.x+x.width),C=Math.min(C,x.y+x.height)}p.save(),p.beginPath(),p.rect(b,E,w-b,C-E),p.clip(),d=!0}return{add:function(b){f.push(b),I()},remove:function(){f.pop(),I()}}}function n(p,f,d,I){I!==""&&(p.textTransform==="uppercase"&&(I=I.toUpperCase()),h.font=p.fontWeight+" "+p.fontSize+" "+p.fontFamily,h.textBaseline="top",h.fillStyle=p.color,h.fillText(I,f,d+parseFloat(p.fontSize)*.1))}function i(p,f,d,I,b){d<2*b&&(b=d/2),I<2*b&&(b=I/2),h.beginPath(),h.moveTo(p+b,f),h.arcTo(p+d,f,p+d,f+I,b),h.arcTo(p+d,f+I,p,f+I,b),h.arcTo(p,f+I,p,f,b),h.arcTo(p,f,p+d,f,b),h.closePath()}function o(p,f,d,I,b,E){const w=p[f+"Width"],C=p[f+"Style"],y=p[f+"Color"];w!=="0px"&&C!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=y,h.lineWidth=parseFloat(w),h.beginPath(),h.moveTo(d,I),h.lineTo(d+b,I+E),h.stroke())}function r(p,f){if(p.nodeType===Node.COMMENT_NODE||p.nodeName==="SCRIPT"||p.style&&p.style.display==="none")return;let d=0,I=0,b=0,E=0;if(p.nodeType===Node.TEXT_NODE){e.selectNode(p);const C=e.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,n(f,d,I,p.nodeValue.trim())}else if(p instanceof HTMLCanvasElement){const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,h.save();const y=window.devicePixelRatio;h.scale(1/y,1/y),h.drawImage(p,d,I),h.restore()}else if(p instanceof HTMLImageElement){const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,h.drawImage(p,d,I,b,E)}else{const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,f=window.getComputedStyle(p),i(d,I,b,E,parseFloat(f.borderRadius));const y=f.backgroundColor;y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.fillStyle=y,h.fill());const x=["borderTop","borderLeft","borderBottom","borderRight"];let R=!0,D=null;for(const S of x){if(D!==null&&(R=f[S+"Width"]===f[D+"Width"]&&f[S+"Color"]===f[D+"Color"]&&f[S+"Style"]===f[D+"Style"]),R===!1)break;D=S}if(R===!0){const S=parseFloat(f.borderTopWidth);f.borderTopWidth!=="0px"&&f.borderTopStyle!=="none"&&f.borderTopColor!=="transparent"&&f.borderTopColor!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=f.borderTopColor,h.lineWidth=S,h.stroke())}else o(f,"borderTop",d,I,b,0),o(f,"borderLeft",d,I,0,E),o(f,"borderBottom",d,I+E,b,0),o(f,"borderRight",d+b,I,0,E);if(p instanceof HTMLInputElement){let S=f.accentColor;(S===void 0||S==="auto")&&(S=f.color),t.set(S);const G=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(p.type==="radio"&&(i(d,I,b,E,E),h.fillStyle="white",h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),p.checked&&(i(d+2,I+2,b-4,E-4,E),h.fillStyle=S,h.strokeStyle=G,h.lineWidth=2,h.fill(),h.stroke())),p.type==="checkbox"&&(i(d,I,b,E,2),h.fillStyle=p.checked?S:"white",h.strokeStyle=p.checked?G:S,h.lineWidth=1,h.stroke(),h.fill(),p.checked)){const U=h.textAlign;h.textAlign="center";const O={color:G,fontFamily:f.fontFamily,fontSize:E+"px",fontWeight:"bold"};n(O,d+b/2,I,"✔"),h.textAlign=U}if(p.type==="range"){const[U,O,X]=["min","max","value"].map(q=>parseFloat(p[q])),P=(X-U)/(O-U)*(b-E);i(d,I+E/4,b,E/2,E/4),h.fillStyle=G,h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),i(d,I+E/4,P+E/2,E/2,E/4),h.fillStyle=S,h.fill(),i(d+P,I,E,E,E/2),h.fillStyle=S,h.fill()}(p.type==="color"||p.type==="text"||p.type==="number")&&(u.add({x:d,y:I,width:b,height:E}),n(f,d+parseInt(f.paddingLeft),I+parseInt(f.paddingTop),p.value),u.remove())}}const w=f.overflow==="auto"||f.overflow==="hidden";w&&u.add({x:d,y:I,width:b,height:E});for(let C=0;C<p.childNodes.length;C++)r(p.childNodes[C],f);w&&u.remove()}const A=c.getBoundingClientRect();let l=Jn.get(c);l===void 0&&(l=document.createElement("canvas"),l.width=A.width,l.height=A.height,Jn.set(c,l));const h=l.getContext("2d"),u=new s(h);return h.clearRect(0,0,l.width,l.height),r(c),l}function vA(c,e,t,s){const n={clientX:t*c.offsetWidth+c.offsetLeft,clientY:s*c.offsetHeight+c.offsetTop,view:c.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,n));const i=c.getBoundingClientRect();t=t*i.width+i.left,s=s*i.height+i.top;function o(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&s>A.top&&s<A.bottom&&(r.dispatchEvent(new MouseEvent(e,n)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[l,h]=["min","max"].map(d=>parseFloat(r[d])),u=A.width,f=(t-A.x)/u;r.value=l+(h-l)*f,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let l=0;l<r.childNodes.length;l++)o(r.childNodes[l])}}o(c)}const An=new a.Vector2,Tt={type:"",data:An},Xs=new a.Raycaster;class MA extends a.Group{listenToPointerEvents(e,t){const s=this,n=new a.Raycaster,i=e.domElement;function o(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();An.x=(r.clientX-A.left)/A.width*2-1,An.y=-(r.clientY-A.top)/A.height*2+1,n.setFromCamera(An,t);const l=n.intersectObjects(s.children,!1);if(l.length>0){const h=l[0],u=h.object,p=h.uv;Tt.type=r.type,Tt.data.set(p.x,1-p.y),u.dispatchEvent(Tt)}}i.addEventListener("pointerdown",o),i.addEventListener("pointerup",o),i.addEventListener("pointermove",o),i.addEventListener("mousedown",o),i.addEventListener("mouseup",o),i.addEventListener("mousemove",o),i.addEventListener("click",o)}listenToXRControllerEvents(e){const t=this,s={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function n(i){const o=i.target;Xs.setFromXRController(o);const r=Xs.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],l=A.object,h=A.uv;Tt.type=s[i.type],Tt.data.set(h.x,1-h.y),l.dispatchEvent(Tt)}}e.addEventListener("move",n),e.addEventListener("select",n),e.addEventListener("selectstart",n),e.addEventListener("selectend",n)}}const Pt=new a.Vector3,Nt=new a.Vector3,Zs=new a.Matrix3;class RA extends a.LineSegments{constructor(e,t=1,s=16711680){const n=new a.BufferGeometry,i=e.geometry.attributes.normal.count,o=new a.Float32BufferAttribute(i*2*3,3);n.setAttribute("position",o),super(n,new a.LineBasicMaterial({color:s,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),Zs.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,s=this.object.geometry;if(s){const n=s.attributes.position,i=s.attributes.normal;let o=0;for(let r=0,A=n.count;r<A;r++)Pt.fromBufferAttribute(n,r).applyMatrix4(e),Nt.fromBufferAttribute(i,r),Nt.applyMatrix3(Zs).normalize().multiplyScalar(this.size).add(Pt),t.setXYZ(o,Pt.x,Pt.y,Pt.z),o=o+1,t.setXYZ(o,Nt.x,Nt.y,Nt.z),o=o+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class DA{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new a.OrthographicCamera(-1,1,1,-1,0,1);class _A extends a.BufferGeometry{constructor(){super(),this.setAttribute("position",new a.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new a.Float32BufferAttribute([0,2,0,0,2,0],2))}}new _A;const Ve={node:"node",material:"material",camera:"camera",light:"light"},bt="KHR_animation_pointer",FA={CUBICSPLINE:void 0,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},$s=a.PropertyBinding.findNode;let ei=!1;class kA{constructor(e){this.parser=e,this.name=bt,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){ei||(ei=!0,a.PropertyBinding.findNode=function(e,t){if(t.startsWith(".materials.")){const s=t.substring(11).substring(t.indexOf(".")),n=s.indexOf("."),i=n<0?s:s.substring(0,n);let o=null;return e.traverse(r=>{o!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(o=r.material,o!==null&&(s.endsWith(".map")?o=o.map:s.endsWith(".emissiveMap")&&(o=o.emissiveMap)))}),o}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const s=t.split(".");let n;for(let i=1;i<s.length;i++){const o=s[i];if(o.length==36)n=e.getObjectByProperty("uuid",o);else if(n&&n[o]){const A=Number.parseInt(o);let l=o;A>=0&&(l=A),n=n[l]}else{const A=e.getObjectByName(o);A&&(n=A)}}if(!n){const i=$s(e,s[2]);return i||console.warn(bt+": Property binding not found",t,e,e.name,s),i}return n}return $s(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,s=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",s)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,s=t.extensions&&t.extensions[bt]&&t.path&&t.path==="pointer";if(!s)return null;let n,i=Ve.node,o;if(s){const A=t.extensions[bt];let l=A.pointer;if(!l){console.warn("Invalid path",A,t);return}if(l.startsWith("/materials/")?i=Ve.material:l.startsWith("/extensions/KHR_lights_punctual/lights/")?i=Ve.light:l.startsWith("/cameras/")&&(i=Ve.camera),o=this._tryResolveTargetId(l,i),o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,l);return}switch(i){case Ve.material:const u=("/materials/"+o.toString()+"/").length,p=l.substring(0,u);switch(n=l.substring(u),n){case"pbrMetallicRoughness/baseColorFactor":n="color";break;case"pbrMetallicRoughness/roughnessFactor":n="roughness";break;case"pbrMetallicRoughness/metallicFactor":n="metalness";break;case"emissiveFactor":n="emissive";break;case"alphaCutoff":n="alphaTest";break;case"occlusionTexture/strength":n="aoMapIntensity";break;case"normalTexture/scale":n="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":n="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":n="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":n="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":n="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":n="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":n="transmission";break;case"extensions/KHR_materials_ior/ior":n="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":n="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":n="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":n="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":n="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":n="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":n="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":n="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":n="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":n="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":n="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":n="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":n="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":n="specularColor";break}l=p+n;break;case Ve.node:const f=("/nodes/"+o.toString()+"/").length,d=l.substring(0,f);switch(n=l.substring(f),n){case"translation":n="position";break;case"rotation":n="quaternion";break;case"scale":n="scale";break;case"weights":n="morphTargetInfluences";break}l=d+n;break;case Ve.light:const I=("/extensions/KHR_lights_punctual/lights/"+o.toString()+"/").length;switch(n=l.substring(I),n){case"color":break;case"intensity":break;case"spot/innerConeAngle":n="penumbra";break;case"spot/outerConeAngle":n="angle";break;case"range":n="distance";break}l="/lights/"+o.toString()+"/"+n;break;case Ve.camera:const b=("/cameras/"+o.toString()+"/").length,E=l.substring(0,b);switch(n=l.substring(b),n){case"perspective/yfov":n="fov";break;case"perspective/znear":case"orthographic/znear":n="near";break;case"perspective/zfar":case"orthographic/zfar":n="far";break;case"perspective/aspect":n="aspect";break;case"orthographic/xmag":n="zoom";break;case"orthographic/ymag":n="zoom";break}l=E+n;break}const h=this.animationPointerResolver;h&&h.resolvePath&&(l=h.resolvePath(l)),t.extensions[bt].pointer=l}if(o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,t);return}let r;return i===Ve.node?r=this.parser.getDependency("node",o):i===Ve.material?r=this.parser.getDependency("material",o):i===Ve.light?r=this.parser.getDependency("light",o):i===Ve.camera?r=this.parser.getDependency("camera",o):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,s,n,i){if(!(i.extensions&&i.extensions[bt]&&i.path&&i.path==="pointer"))return null;let r=i.extensions[bt].pointer;if(!r)return null;const A=[];r=r.replaceAll("/",".");const l=r.split(".");var u=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(l[2]=u,l[3]==="morphTargetInfluences"&&e.type==="Group"){for(const f of e.children)f instanceof a.SkinnedMesh&&f.morphTargetInfluences&&(l[3]=f.name,l[4]="morphTargetInfluences",p(this.parser));return A}p(this.parser);function p(f){r=l.join(".");let d;switch(s.itemSize){case 1:d=a.NumberKeyframeTrack;break;case 2:case 3:d=a.VectorKeyframeTrack;break;case 4:r.endsWith(".quaternion")?d=a.QuaternionKeyframeTrack:d=a.ColorKeyframeTrack;break}const I=n.interpolation!==void 0?FA[n.interpolation]:a.InterpolateLinear;let b=f._getArrayFromAccessor(s);r.endsWith(".fov")&&(b=b.map(w=>w/Math.PI*180));const E=new d(r,t.array,b,I);if(I==="CUBICSPLINE"&&f._createCubicSplineTrackInterpolant(E),A.push(E),r&&s.itemSize===4&&r.startsWith(".materials.")&&r.endsWith(".color")){const w=new Float32Array(b.length/4);for(let y=0,x=b.length/4;y<x;y+=1)w[y]=b[y*4+3];const C=new d(r.replace(".color",".opacity"),t.array,w,I);I==="CUBICSPLINE"&&f._createCubicSplineTrackInterpolant(E),A.push(C)}}return A}_tryResolveTargetId(e,t){let s="";return t==="node"?s=e.substring(7):t==="material"?s=e.substring(11):t==="light"?s=e.substring(39):t==="camera"&&(s=e.substring(9)),s=s.substring(0,s.indexOf("/")),Number.parseInt(s)}loadAnimation(e){const t=this,s=this.parser.json,n=this.parser,i=s.animations[e],o=i.name?i.name:"animation_"+e,r=[],A=[],l=[],h=[],u=[];for(let p=0,f=i.channels.length;p<f;p++){const d=i.channels[p],I=i.samplers[d.sampler],b=d.target,E=i.parameters!==void 0?i.parameters[I.input]:I.input,w=i.parameters!==void 0?i.parameters[I.output]:I.output;let C=t.loadAnimationTargetFromChannelWithAnimationPointer(d);C||(C=t.loadAnimationTargetFromChannel(d)),r.push(C),A.push(n.getDependency("accessor",E)),l.push(n.getDependency("accessor",w)),h.push(I),u.push(b)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(l),Promise.all(h),Promise.all(u)]).then(function(p){const f=p[0],d=p[1],I=p[2],b=p[3],E=p[4],w=[];for(let C=0,y=f.length;C<y;C++){const x=f[C],R=d[C],D=I[C],S=b[C],v=E[C];if(x===void 0)continue;x.updateMatrix&&(x.updateMatrix(),x.matrixAutoUpdate=!0);let G=t.createAnimationTracksWithAnimationPointer(x,R,D,S,v);if(G||(G=n._createAnimationTracks(x,R,D,S,v)),G)for(let U=0;U<G.length;U++)w.push(G[U])}return new a.AnimationClip(o,void 0,w)})}}const LA=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:kA},Symbol.toStringTag,{value:"Module"}));exports.DRACOLoader=sr;exports.EXRLoader=Mi;exports.EXRLoader$1=Yr;exports.FBXLoader=sa;exports.Font=Ei;exports.FontLoader=Ir;exports.GLTFExporter=ts;exports.GLTFLoader=Wn;exports.GLTFLoaderAnimationPointer=LA;exports.GroundedSkybox=Eo;exports.HTMLMesh=SA;exports.HorizontalBlurShader=Ua;exports.InteractiveGroup=MA;exports.KTX2Loader=nt;exports.Line2=xA;exports.LineGeometry=Ni;exports.LineMaterial=ns;exports.MeshoptDecoder=nr;exports.OBJLoader=Ba;exports.OrbitControls=ya;exports.Pass=DA;exports.PositionalAudioHelper=Ga;exports.RGBELoader=Ri;exports.RGBELoader$1=Vr;exports.Stats=zt;exports.TextGeometry=mr;exports.TransformControls=Cr;exports.TransformControlsGizmo=Ci;exports.VertexNormalsHelper=RA;exports.VerticalBlurShader=Pa;exports.XRControllerModelFactory=EA;exports.XRHandMeshModel=BA;exports.mergeVertices=Co;exports.nodeFrame=ti;exports.strToU8=Yn;exports.zipSync=Kr;
@@ -466,4 +466,4 @@ version 0.8.2
466
466
  #include <premultiplied_alpha_fragment>
467
467
 
468
468
  }
469
- `};class ci extends Fi{constructor(e){super({type:"LineMaterial",uniforms:Ni.clone(bt.line.uniforms),vertexShader:bt.line.vertexShader,fragmentShader:bt.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const li=new Rt,oo=new N,ro=new N,Ue=new Rt,Ge=new Rt,Qt=new Rt,hi=new N,gi=new oe,Pe=new Cr,Ao=new N,on=new qs,rn=new In,yt=new Rt;let vt,Zt;function co(o,e,t){return yt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),yt.multiplyScalar(1/yt.w),yt.x=Zt/t.width,yt.y=Zt/t.height,yt.applyMatrix4(o.projectionMatrixInverse),yt.multiplyScalar(1/yt.w),Math.abs(Math.max(yt.x,yt.y))}function vl(o,e){const t=o.matrixWorld,n=o.geometry,s=n.attributes.instanceStart,i=n.attributes.instanceEnd,a=Math.min(n.instanceCount,s.count);for(let r=0,A=a;r<A;r++){Pe.start.fromBufferAttribute(s,r),Pe.end.fromBufferAttribute(i,r),Pe.applyMatrix4(t);const c=new N,l=new N;vt.distanceSqToSegment(Pe.start,Pe.end,l,c),l.distanceTo(c)<Zt*.5&&e.push({point:l,pointOnLine:c,distance:vt.origin.distanceTo(l),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function xl(o,e,t){const n=e.projectionMatrix,s=o.material.resolution,i=o.matrixWorld,a=o.geometry,r=a.attributes.instanceStart,A=a.attributes.instanceEnd,c=Math.min(a.instanceCount,r.count),l=-e.near;vt.at(1,Qt),Qt.w=1,Qt.applyMatrix4(e.matrixWorldInverse),Qt.applyMatrix4(n),Qt.multiplyScalar(1/Qt.w),Qt.x*=s.x/2,Qt.y*=s.y/2,Qt.z=0,hi.copy(Qt),gi.multiplyMatrices(e.matrixWorldInverse,i);for(let h=0,p=c;h<p;h++){if(Ue.fromBufferAttribute(r,h),Ge.fromBufferAttribute(A,h),Ue.w=1,Ge.w=1,Ue.applyMatrix4(gi),Ge.applyMatrix4(gi),Ue.z>l&&Ge.z>l)continue;if(Ue.z>l){const I=Ue.z-Ge.z,C=(Ue.z-l)/I;Ue.lerp(Ge,C)}else if(Ge.z>l){const I=Ge.z-Ue.z,C=(Ge.z-l)/I;Ge.lerp(Ue,C)}Ue.applyMatrix4(n),Ge.applyMatrix4(n),Ue.multiplyScalar(1/Ue.w),Ge.multiplyScalar(1/Ge.w),Ue.x*=s.x/2,Ue.y*=s.y/2,Ge.x*=s.x/2,Ge.y*=s.y/2,Pe.start.copy(Ue),Pe.start.z=0,Pe.end.copy(Ge),Pe.end.z=0;const d=Pe.closestPointToPointParameter(hi,!0);Pe.at(d,Ao);const u=Ie.lerp(Ue.z,Ge.z,d),m=u>=-1&&u<=1,b=hi.distanceTo(Ao)<Zt*.5;if(m&&b){Pe.start.fromBufferAttribute(r,h),Pe.end.fromBufferAttribute(A,h),Pe.start.applyMatrix4(i),Pe.end.applyMatrix4(i);const I=new N,C=new N;vt.distanceSqToSegment(Pe.start,Pe.end,C,I),t.push({point:C,pointOnLine:I,distance:vt.origin.distanceTo(C),object:o,face:null,faceIndex:h,uv:null,uv1:null})}}}class Sl extends H{constructor(e=new ao,t=new ci({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,s=new Float32Array(2*t.count);for(let a=0,r=0,A=t.count;a<A;a++,r+=2)oo.fromBufferAttribute(t,a),ro.fromBufferAttribute(n,a),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+oo.distanceTo(ro);const i=new wn(s,2,1);return e.setAttribute("instanceDistanceStart",new Jt(i,1,0)),e.setAttribute("instanceDistanceEnd",new Jt(i,1,1)),this}raycast(e,t){const n=this.material.worldUnits,s=e.camera;s===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;vt=e.ray;const a=this.matrixWorld,r=this.geometry,A=this.material;Zt=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),rn.copy(r.boundingSphere).applyMatrix4(a);let c;if(n)c=Zt*.5;else{const h=Math.max(s.near,rn.distanceToPoint(vt.origin));c=co(s,h,A.resolution)}if(rn.radius+=c,vt.intersectsSphere(rn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),on.copy(r.boundingBox).applyMatrix4(a);let l;if(n)l=Zt*.5;else{const h=Math.max(s.near,on.distanceToPoint(vt.origin));l=co(s,h,A.resolution)}on.expandByScalar(l),vt.intersectsBox(on)!==!1&&(n?vl(this,t):xl(this,s,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(li),this.material.uniforms.resolution.value.set(li.z,li.w))}}class lo extends ao{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let s=0;s<t;s+=3)n[2*s]=e[s],n[2*s+1]=e[s+1],n[2*s+2]=e[s+2],n[2*s+3]=e[s+3],n[2*s+4]=e[s+4],n[2*s+5]=e[s+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let s=0;s<t;s+=3)n[2*s]=e[s],n[2*s+1]=e[s+1],n[2*s+2]=e[s+2],n[2*s+3]=e[s+3],n[2*s+4]=e[s+4],n[2*s+5]=e[s+5];return super.setColors(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Dl extends Sl{constructor(e=new lo,t=new ci({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class kl extends H{constructor(e){const t=new Rl(e),n=new Cn(t.image.width*.001,t.image.height*.001),s=new mt({map:t,toneMapped:!1,transparent:!0});super(n,s);function i(a){s.map.dispatchDOMEvent(a)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){n.dispose(),s.dispose(),s.map.dispose(),pi.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class Rl extends Li{constructor(e){super(ho(e)),this.dom=e,this.anisotropy=16,this.colorSpace=re,this.minFilter=ht,this.magFilter=ht;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),n={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,n),this.observer=t}dispatchDOMEvent(e){e.data&&Tl(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=ho(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const pi=new WeakMap;function ho(o){const e=document.createRange(),t=new Ce;function n(p){const d=[];let u=!1;function m(){if(u&&(u=!1,p.restore()),d.length===0)return;let b=-1/0,I=-1/0,C=1/0,E=1/0;for(let w=0;w<d.length;w++){const Q=d[w];b=Math.max(b,Q.x),I=Math.max(I,Q.y),C=Math.min(C,Q.x+Q.width),E=Math.min(E,Q.y+Q.height)}p.save(),p.beginPath(),p.rect(b,I,C-b,E-I),p.clip(),u=!0}return{add:function(b){d.push(b),m()},remove:function(){d.pop(),m()}}}function s(p,d,u,m){m!==""&&(p.textTransform==="uppercase"&&(m=m.toUpperCase()),l.font=p.fontWeight+" "+p.fontSize+" "+p.fontFamily,l.textBaseline="top",l.fillStyle=p.color,l.fillText(m,d,u+parseFloat(p.fontSize)*.1))}function i(p,d,u,m,b){u<2*b&&(b=u/2),m<2*b&&(b=m/2),l.beginPath(),l.moveTo(p+b,d),l.arcTo(p+u,d,p+u,d+m,b),l.arcTo(p+u,d+m,p,d+m,b),l.arcTo(p,d+m,p,d,b),l.arcTo(p,d,p+u,d,b),l.closePath()}function a(p,d,u,m,b,I){const C=p[d+"Width"],E=p[d+"Style"],w=p[d+"Color"];C!=="0px"&&E!=="none"&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=w,l.lineWidth=parseFloat(C),l.beginPath(),l.moveTo(u,m),l.lineTo(u+b,m+I),l.stroke())}function r(p,d){if(p.nodeType===Node.COMMENT_NODE||p.nodeName==="SCRIPT"||p.style&&p.style.display==="none")return;let u=0,m=0,b=0,I=0;if(p.nodeType===Node.TEXT_NODE){e.selectNode(p);const E=e.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,s(d,u,m,p.nodeValue.trim())}else if(p instanceof HTMLCanvasElement){const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,l.save();const w=window.devicePixelRatio;l.scale(1/w,1/w),l.drawImage(p,u,m),l.restore()}else if(p instanceof HTMLImageElement){const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,l.drawImage(p,u,m,b,I)}else{const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,d=window.getComputedStyle(p),i(u,m,b,I,parseFloat(d.borderRadius));const w=d.backgroundColor;w!=="transparent"&&w!=="rgba(0, 0, 0, 0)"&&(l.fillStyle=w,l.fill());const Q=["borderTop","borderLeft","borderBottom","borderRight"];let S=!0,D=null;for(const x of Q){if(D!==null&&(S=d[x+"Width"]===d[D+"Width"]&&d[x+"Color"]===d[D+"Color"]&&d[x+"Style"]===d[D+"Style"]),S===!1)break;D=x}if(S===!0){const x=parseFloat(d.borderTopWidth);d.borderTopWidth!=="0px"&&d.borderTopStyle!=="none"&&d.borderTopColor!=="transparent"&&d.borderTopColor!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=d.borderTopColor,l.lineWidth=x,l.stroke())}else a(d,"borderTop",u,m,b,0),a(d,"borderLeft",u,m,0,I),a(d,"borderBottom",u,m+I,b,0),a(d,"borderRight",u+b,m,0,I);if(p instanceof HTMLInputElement){let x=d.accentColor;(x===void 0||x==="auto")&&(x=d.color),t.set(x);const R=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(p.type==="radio"&&(i(u,m,b,I,I),l.fillStyle="white",l.strokeStyle=x,l.lineWidth=1,l.fill(),l.stroke(),p.checked&&(i(u+2,m+2,b-4,I-4,I),l.fillStyle=x,l.strokeStyle=R,l.lineWidth=2,l.fill(),l.stroke())),p.type==="checkbox"&&(i(u,m,b,I,2),l.fillStyle=p.checked?x:"white",l.strokeStyle=p.checked?R:x,l.lineWidth=1,l.stroke(),l.fill(),p.checked)){const G=l.textAlign;l.textAlign="center";const W={color:R,fontFamily:d.fontFamily,fontSize:I+"px",fontWeight:"bold"};s(W,u+b/2,m,"\u2714"),l.textAlign=G}if(p.type==="range"){const[G,W,V]=["min","max","value"].map(Z=>parseFloat(p[Z])),J=(V-G)/(W-G)*(b-I);i(u,m+I/4,b,I/2,I/4),l.fillStyle=R,l.strokeStyle=x,l.lineWidth=1,l.fill(),l.stroke(),i(u,m+I/4,J+I/2,I/2,I/4),l.fillStyle=x,l.fill(),i(u+J,m,I,I,I/2),l.fillStyle=x,l.fill()}(p.type==="color"||p.type==="text"||p.type==="number")&&(h.add({x:u,y:m,width:b,height:I}),s(d,u+parseInt(d.paddingLeft),m+parseInt(d.paddingTop),p.value),h.remove())}}const C=d.overflow==="auto"||d.overflow==="hidden";C&&h.add({x:u,y:m,width:b,height:I});for(let E=0;E<p.childNodes.length;E++)r(p.childNodes[E],d);C&&h.remove()}const A=o.getBoundingClientRect();let c=pi.get(o);c===void 0&&(c=document.createElement("canvas"),c.width=A.width,c.height=A.height,pi.set(o,c));const l=c.getContext("2d"),h=new n(l);return l.clearRect(0,0,c.width,c.height),r(o),c}function Tl(o,e,t,n){const s={clientX:t*o.offsetWidth+o.offsetLeft,clientY:n*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,s));const i=o.getBoundingClientRect();t=t*i.width+i.left,n=n*i.height+i.top;function a(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&n>A.top&&n<A.bottom&&(r.dispatchEvent(new MouseEvent(e,s)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[c,l]=["min","max"].map(d=>parseFloat(r[d])),h=A.width,p=(t-A.x)/h;r.value=c+(l-c)*p,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let c=0;c<r.childNodes.length;c++)a(r.childNodes[c])}}a(o)}const An=new _e,cs={type:"",data:An},go=new En;class Ml extends Kt{listenToPointerEvents(e,t){const n=this,s=new En,i=e.domElement;function a(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();An.x=(r.clientX-A.left)/A.width*2-1,An.y=-(r.clientY-A.top)/A.height*2+1,s.setFromCamera(An,t);const c=s.intersectObjects(n.children,!1);if(c.length>0){const l=c[0],h=l.object,p=l.uv;cs.type=r.type,cs.data.set(p.x,1-p.y),h.dispatchEvent(cs)}}i.addEventListener("pointerdown",a),i.addEventListener("pointerup",a),i.addEventListener("pointermove",a),i.addEventListener("mousedown",a),i.addEventListener("mouseup",a),i.addEventListener("mousemove",a),i.addEventListener("click",a)}listenToXRControllerEvents(e){const t=this,n={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function s(i){const a=i.target;go.setFromXRController(a);const r=go.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],c=A.object,l=A.uv;cs.type=n[i.type],cs.data.set(l.x,1-l.y),c.dispatchEvent(cs)}}e.addEventListener("move",s),e.addEventListener("select",s),e.addEventListener("selectstart",s),e.addEventListener("selectend",s)}}const Ms=new N,_s=new N,po=new Mi;class _l extends Us{constructor(e,t=1,n=16711680){const s=new ot,i=e.geometry.attributes.normal.count,a=new Se(i*2*3,3);s.setAttribute("position",a),super(s,new kt({color:n,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),po.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry;if(n){const s=n.attributes.position,i=n.attributes.normal;let a=0;for(let r=0,A=s.count;r<A;r++)Ms.fromBufferAttribute(s,r).applyMatrix4(e),_s.fromBufferAttribute(i,r),_s.applyMatrix3(po).normalize().multiplyScalar(this.size).add(Ms),t.setXYZ(a,Ms.x,Ms.y,Ms.z),a=a+1,t.setXYZ(a,_s.x,_s.y,_s.z),a=a+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}const ct={node:"node",material:"material",camera:"camera",light:"light"},$t="KHR_animation_pointer",Fl={CUBICSPLINE:void 0,LINEAR:ds,STEP:mn},uo=gt.findNode;let fo=!1;class Ll{constructor(e){this.parser=e,this.name=$t,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){fo||(fo=!0,gt.findNode=function(e,t){if(t.startsWith(".materials.")){const n=t.substring(11).substring(t.indexOf(".")),s=n.indexOf("."),i=s<0?n:n.substring(0,s);let a=null;return e.traverse(r=>{a!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(a=r.material,a!==null&&(n.endsWith(".map")?a=a.map:n.endsWith(".emissiveMap")&&(a=a.emissiveMap)))}),a}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const n=t.split(".");let s;for(let i=1;i<n.length;i++){const a=n[i];if(a.length==36)s=e.getObjectByProperty("uuid",a);else if(s&&s[a]){const r=Number.parseInt(a);let A=a;r>=0&&(A=r),s=s[A]}else{const r=e.getObjectByName(a);r&&(s=r)}}if(!s){const i=uo(e,n[2]);return i||console.warn($t+": Property binding not found",t,e,e.name,n),i}return s}return uo(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,n=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",n)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,n=t.extensions&&t.extensions[$t]&&t.path&&t.path==="pointer";if(!n)return null;let s,i=ct.node,a;if(n){const A=t.extensions[$t];let c=A.pointer;if(!c){console.warn("Invalid path",A,t);return}if(c.startsWith("/materials/")?i=ct.material:c.startsWith("/extensions/KHR_lights_punctual/lights/")?i=ct.light:c.startsWith("/cameras/")&&(i=ct.camera),a=this._tryResolveTargetId(c,i),a===null||isNaN(a)){console.warn("Failed resolving animation node id: "+a,c);return}switch(i){case ct.material:const h=("/materials/"+a.toString()+"/").length,p=c.substring(0,h);switch(s=c.substring(h),s){case"pbrMetallicRoughness/baseColorFactor":s="color";break;case"pbrMetallicRoughness/roughnessFactor":s="roughness";break;case"pbrMetallicRoughness/metallicFactor":s="metalness";break;case"emissiveFactor":s="emissive";break;case"alphaCutoff":s="alphaTest";break;case"occlusionTexture/strength":s="aoMapIntensity";break;case"normalTexture/scale":s="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":s="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":s="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":s="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":s="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":s="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":s="transmission";break;case"extensions/KHR_materials_ior/ior":s="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":s="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":s="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":s="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":s="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":s="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":s="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":s="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":s="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":s="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":s="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":s="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":s="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":s="specularColor";break}c=p+s;break;case ct.node:const d=("/nodes/"+a.toString()+"/").length,u=c.substring(0,d);switch(s=c.substring(d),s){case"translation":s="position";break;case"rotation":s="quaternion";break;case"scale":s="scale";break;case"weights":s="morphTargetInfluences";break}c=u+s;break;case ct.light:const m=("/extensions/KHR_lights_punctual/lights/"+a.toString()+"/").length;switch(s=c.substring(m),s){case"color":break;case"intensity":break;case"spot/innerConeAngle":s="penumbra";break;case"spot/outerConeAngle":s="angle";break;case"range":s="distance";break}c="/lights/"+a.toString()+"/"+s;break;case ct.camera:const b=("/cameras/"+a.toString()+"/").length,I=c.substring(0,b);switch(s=c.substring(b),s){case"perspective/yfov":s="fov";break;case"perspective/znear":case"orthographic/znear":s="near";break;case"perspective/zfar":case"orthographic/zfar":s="far";break;case"perspective/aspect":s="aspect";break;case"orthographic/xmag":s="zoom";break;case"orthographic/ymag":s="zoom";break}c=I+s;break}const l=this.animationPointerResolver;l&&l.resolvePath&&(c=l.resolvePath(c)),t.extensions[$t].pointer=c}if(a===null||isNaN(a)){console.warn("Failed resolving animation node id: "+a,t);return}let r;return i===ct.node?r=this.parser.getDependency("node",a):i===ct.material?r=this.parser.getDependency("material",a):i===ct.light?r=this.parser.getDependency("light",a):i===ct.camera?r=this.parser.getDependency("camera",a):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,n,s,i){if(!(i.extensions&&i.extensions[$t]&&i.path&&i.path==="pointer"))return null;let a=i.extensions[$t].pointer;if(!a)return null;const r=[];a=a.replaceAll("/",".");const A=a.split(".");var c=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(A[2]=c,A[3]==="morphTargetInfluences"&&e.type==="Group"){for(const h of e.children)h instanceof dn&&h.morphTargetInfluences&&(A[3]=h.name,A[4]="morphTargetInfluences",l(this.parser));return r}l(this.parser);function l(h){a=A.join(".");let p;switch(n.itemSize){case 1:p=Hs;break;case 2:case 3:p=Os;break;case 4:a.endsWith(".quaternion")?p=js:p=Br;break}const d=s.interpolation!==void 0?Fl[s.interpolation]:ds;let u=h._getArrayFromAccessor(n);a.endsWith(".fov")&&(u=u.map(b=>b/Math.PI*180));const m=new p(a,t.array,u,d);if(d==="CUBICSPLINE"&&h._createCubicSplineTrackInterpolant(m),r.push(m),a&&n.itemSize===4&&a.startsWith(".materials.")&&a.endsWith(".color")){const b=new Float32Array(u.length/4);for(let C=0,E=u.length/4;C<E;C+=1)b[C]=u[C*4+3];const I=new p(a.replace(".color",".opacity"),t.array,b,d);d==="CUBICSPLINE"&&h._createCubicSplineTrackInterpolant(m),r.push(I)}}return r}_tryResolveTargetId(e,t){let n="";return t==="node"?n=e.substring(7):t==="material"?n=e.substring(11):t==="light"?n=e.substring(39):t==="camera"&&(n=e.substring(9)),n=n.substring(0,n.indexOf("/")),Number.parseInt(n)}loadAnimation(e){const t=this,n=this.parser.json,s=this.parser,i=n.animations[e],a=i.name?i.name:"animation_"+e,r=[],A=[],c=[],l=[],h=[];for(let p=0,d=i.channels.length;p<d;p++){const u=i.channels[p],m=i.samplers[u.sampler],b=u.target,I=i.parameters!==void 0?i.parameters[m.input]:m.input,C=i.parameters!==void 0?i.parameters[m.output]:m.output;let E=t.loadAnimationTargetFromChannelWithAnimationPointer(u);E||(E=t.loadAnimationTargetFromChannel(u)),r.push(E),A.push(s.getDependency("accessor",I)),c.push(s.getDependency("accessor",C)),l.push(m),h.push(b)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(p){const d=p[0],u=p[1],m=p[2],b=p[3],I=p[4],C=[];for(let E=0,w=d.length;E<w;E++){const Q=d[E],S=u[E],D=m[E],x=b[E],R=I[E];if(Q===void 0)continue;Q.updateMatrix&&(Q.updateMatrix(),Q.matrixAutoUpdate=!0);let G=t.createAnimationTracksWithAnimationPointer(Q,S,D,x,R);if(G||(G=s._createAnimationTracks(Q,S,D,x,R)),G)for(let W=0;W<G.length;W++)C.push(G[W])}return new un(a,void 0,C)})}}const Nl=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:Ll},Symbol.toStringTag,{value:"Module"}));class Ul{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new Ci(-1,1,1,-1,0,1);class Gl extends ot{constructor(){super(),this.setAttribute("position",new Se([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Se([0,2,0,0,2,0],2))}}new Gl;export{oA as D,_a as E,ga as F,Qn as G,Oc as H,Ml as I,xt as K,Dl as L,aA as M,xc as O,Pc as P,Fa as R,Is as S,EA as T,Hc as V,wl as X,wr as a,CA as b,Ea as c,oi as d,yl as e,lo as f,ci as g,QA as h,kl as i,_l as j,yc as k,oc as l,Qr as m,Ui as n,Ul as o,VA as p,XA as q,Nl as r,Xn as s,WA as z};
469
+ `};class ci extends Fi{constructor(e){super({type:"LineMaterial",uniforms:Ni.clone(bt.line.uniforms),vertexShader:bt.line.vertexShader,fragmentShader:bt.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const li=new Rt,oo=new N,ro=new N,Ue=new Rt,Ge=new Rt,Qt=new Rt,hi=new N,gi=new oe,Pe=new Cr,Ao=new N,on=new qs,rn=new In,yt=new Rt;let vt,Zt;function co(o,e,t){return yt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),yt.multiplyScalar(1/yt.w),yt.x=Zt/t.width,yt.y=Zt/t.height,yt.applyMatrix4(o.projectionMatrixInverse),yt.multiplyScalar(1/yt.w),Math.abs(Math.max(yt.x,yt.y))}function vl(o,e){const t=o.matrixWorld,n=o.geometry,s=n.attributes.instanceStart,i=n.attributes.instanceEnd,a=Math.min(n.instanceCount,s.count);for(let r=0,A=a;r<A;r++){Pe.start.fromBufferAttribute(s,r),Pe.end.fromBufferAttribute(i,r),Pe.applyMatrix4(t);const c=new N,l=new N;vt.distanceSqToSegment(Pe.start,Pe.end,l,c),l.distanceTo(c)<Zt*.5&&e.push({point:l,pointOnLine:c,distance:vt.origin.distanceTo(l),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function xl(o,e,t){const n=e.projectionMatrix,s=o.material.resolution,i=o.matrixWorld,a=o.geometry,r=a.attributes.instanceStart,A=a.attributes.instanceEnd,c=Math.min(a.instanceCount,r.count),l=-e.near;vt.at(1,Qt),Qt.w=1,Qt.applyMatrix4(e.matrixWorldInverse),Qt.applyMatrix4(n),Qt.multiplyScalar(1/Qt.w),Qt.x*=s.x/2,Qt.y*=s.y/2,Qt.z=0,hi.copy(Qt),gi.multiplyMatrices(e.matrixWorldInverse,i);for(let h=0,p=c;h<p;h++){if(Ue.fromBufferAttribute(r,h),Ge.fromBufferAttribute(A,h),Ue.w=1,Ge.w=1,Ue.applyMatrix4(gi),Ge.applyMatrix4(gi),Ue.z>l&&Ge.z>l)continue;if(Ue.z>l){const I=Ue.z-Ge.z,C=(Ue.z-l)/I;Ue.lerp(Ge,C)}else if(Ge.z>l){const I=Ge.z-Ue.z,C=(Ge.z-l)/I;Ge.lerp(Ue,C)}Ue.applyMatrix4(n),Ge.applyMatrix4(n),Ue.multiplyScalar(1/Ue.w),Ge.multiplyScalar(1/Ge.w),Ue.x*=s.x/2,Ue.y*=s.y/2,Ge.x*=s.x/2,Ge.y*=s.y/2,Pe.start.copy(Ue),Pe.start.z=0,Pe.end.copy(Ge),Pe.end.z=0;const d=Pe.closestPointToPointParameter(hi,!0);Pe.at(d,Ao);const u=Ie.lerp(Ue.z,Ge.z,d),m=u>=-1&&u<=1,b=hi.distanceTo(Ao)<Zt*.5;if(m&&b){Pe.start.fromBufferAttribute(r,h),Pe.end.fromBufferAttribute(A,h),Pe.start.applyMatrix4(i),Pe.end.applyMatrix4(i);const I=new N,C=new N;vt.distanceSqToSegment(Pe.start,Pe.end,C,I),t.push({point:C,pointOnLine:I,distance:vt.origin.distanceTo(C),object:o,face:null,faceIndex:h,uv:null,uv1:null})}}}class Sl extends H{constructor(e=new ao,t=new ci({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,s=new Float32Array(2*t.count);for(let a=0,r=0,A=t.count;a<A;a++,r+=2)oo.fromBufferAttribute(t,a),ro.fromBufferAttribute(n,a),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+oo.distanceTo(ro);const i=new wn(s,2,1);return e.setAttribute("instanceDistanceStart",new Jt(i,1,0)),e.setAttribute("instanceDistanceEnd",new Jt(i,1,1)),this}raycast(e,t){const n=this.material.worldUnits,s=e.camera;s===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;vt=e.ray;const a=this.matrixWorld,r=this.geometry,A=this.material;Zt=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),rn.copy(r.boundingSphere).applyMatrix4(a);let c;if(n)c=Zt*.5;else{const h=Math.max(s.near,rn.distanceToPoint(vt.origin));c=co(s,h,A.resolution)}if(rn.radius+=c,vt.intersectsSphere(rn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),on.copy(r.boundingBox).applyMatrix4(a);let l;if(n)l=Zt*.5;else{const h=Math.max(s.near,on.distanceToPoint(vt.origin));l=co(s,h,A.resolution)}on.expandByScalar(l),vt.intersectsBox(on)!==!1&&(n?vl(this,t):xl(this,s,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(li),this.material.uniforms.resolution.value.set(li.z,li.w))}}class lo extends ao{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let s=0;s<t;s+=3)n[2*s]=e[s],n[2*s+1]=e[s+1],n[2*s+2]=e[s+2],n[2*s+3]=e[s+3],n[2*s+4]=e[s+4],n[2*s+5]=e[s+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let s=0;s<t;s+=3)n[2*s]=e[s],n[2*s+1]=e[s+1],n[2*s+2]=e[s+2],n[2*s+3]=e[s+3],n[2*s+4]=e[s+4],n[2*s+5]=e[s+5];return super.setColors(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Dl extends Sl{constructor(e=new lo,t=new ci({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class kl extends H{constructor(e){const t=new Rl(e),n=new Cn(t.image.width*.001,t.image.height*.001),s=new mt({map:t,toneMapped:!1,transparent:!0});super(n,s);function i(a){s.map.dispatchDOMEvent(a)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){n.dispose(),s.dispose(),s.map.dispose(),pi.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class Rl extends Li{constructor(e){super(ho(e)),this.dom=e,this.anisotropy=16,this.colorSpace=re,this.minFilter=ht,this.magFilter=ht;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),n={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,n),this.observer=t}dispatchDOMEvent(e){e.data&&Tl(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=ho(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const pi=new WeakMap;function ho(o){const e=document.createRange(),t=new Ce;function n(p){const d=[];let u=!1;function m(){if(u&&(u=!1,p.restore()),d.length===0)return;let b=-1/0,I=-1/0,C=1/0,E=1/0;for(let w=0;w<d.length;w++){const Q=d[w];b=Math.max(b,Q.x),I=Math.max(I,Q.y),C=Math.min(C,Q.x+Q.width),E=Math.min(E,Q.y+Q.height)}p.save(),p.beginPath(),p.rect(b,I,C-b,E-I),p.clip(),u=!0}return{add:function(b){d.push(b),m()},remove:function(){d.pop(),m()}}}function s(p,d,u,m){m!==""&&(p.textTransform==="uppercase"&&(m=m.toUpperCase()),l.font=p.fontWeight+" "+p.fontSize+" "+p.fontFamily,l.textBaseline="top",l.fillStyle=p.color,l.fillText(m,d,u+parseFloat(p.fontSize)*.1))}function i(p,d,u,m,b){u<2*b&&(b=u/2),m<2*b&&(b=m/2),l.beginPath(),l.moveTo(p+b,d),l.arcTo(p+u,d,p+u,d+m,b),l.arcTo(p+u,d+m,p,d+m,b),l.arcTo(p,d+m,p,d,b),l.arcTo(p,d,p+u,d,b),l.closePath()}function a(p,d,u,m,b,I){const C=p[d+"Width"],E=p[d+"Style"],w=p[d+"Color"];C!=="0px"&&E!=="none"&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=w,l.lineWidth=parseFloat(C),l.beginPath(),l.moveTo(u,m),l.lineTo(u+b,m+I),l.stroke())}function r(p,d){if(p.nodeType===Node.COMMENT_NODE||p.nodeName==="SCRIPT"||p.style&&p.style.display==="none")return;let u=0,m=0,b=0,I=0;if(p.nodeType===Node.TEXT_NODE){e.selectNode(p);const E=e.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,s(d,u,m,p.nodeValue.trim())}else if(p instanceof HTMLCanvasElement){const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,l.save();const w=window.devicePixelRatio;l.scale(1/w,1/w),l.drawImage(p,u,m),l.restore()}else if(p instanceof HTMLImageElement){const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,l.drawImage(p,u,m,b,I)}else{const E=p.getBoundingClientRect();u=E.left-A.left-.5,m=E.top-A.top-.5,b=E.width,I=E.height,d=window.getComputedStyle(p),i(u,m,b,I,parseFloat(d.borderRadius));const w=d.backgroundColor;w!=="transparent"&&w!=="rgba(0, 0, 0, 0)"&&(l.fillStyle=w,l.fill());const Q=["borderTop","borderLeft","borderBottom","borderRight"];let S=!0,D=null;for(const x of Q){if(D!==null&&(S=d[x+"Width"]===d[D+"Width"]&&d[x+"Color"]===d[D+"Color"]&&d[x+"Style"]===d[D+"Style"]),S===!1)break;D=x}if(S===!0){const x=parseFloat(d.borderTopWidth);d.borderTopWidth!=="0px"&&d.borderTopStyle!=="none"&&d.borderTopColor!=="transparent"&&d.borderTopColor!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=d.borderTopColor,l.lineWidth=x,l.stroke())}else a(d,"borderTop",u,m,b,0),a(d,"borderLeft",u,m,0,I),a(d,"borderBottom",u,m+I,b,0),a(d,"borderRight",u+b,m,0,I);if(p instanceof HTMLInputElement){let x=d.accentColor;(x===void 0||x==="auto")&&(x=d.color),t.set(x);const R=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(p.type==="radio"&&(i(u,m,b,I,I),l.fillStyle="white",l.strokeStyle=x,l.lineWidth=1,l.fill(),l.stroke(),p.checked&&(i(u+2,m+2,b-4,I-4,I),l.fillStyle=x,l.strokeStyle=R,l.lineWidth=2,l.fill(),l.stroke())),p.type==="checkbox"&&(i(u,m,b,I,2),l.fillStyle=p.checked?x:"white",l.strokeStyle=p.checked?R:x,l.lineWidth=1,l.stroke(),l.fill(),p.checked)){const G=l.textAlign;l.textAlign="center";const W={color:R,fontFamily:d.fontFamily,fontSize:I+"px",fontWeight:"bold"};s(W,u+b/2,m,"\u2714"),l.textAlign=G}if(p.type==="range"){const[G,W,V]=["min","max","value"].map(Z=>parseFloat(p[Z])),J=(V-G)/(W-G)*(b-I);i(u,m+I/4,b,I/2,I/4),l.fillStyle=R,l.strokeStyle=x,l.lineWidth=1,l.fill(),l.stroke(),i(u,m+I/4,J+I/2,I/2,I/4),l.fillStyle=x,l.fill(),i(u+J,m,I,I,I/2),l.fillStyle=x,l.fill()}(p.type==="color"||p.type==="text"||p.type==="number")&&(h.add({x:u,y:m,width:b,height:I}),s(d,u+parseInt(d.paddingLeft),m+parseInt(d.paddingTop),p.value),h.remove())}}const C=d.overflow==="auto"||d.overflow==="hidden";C&&h.add({x:u,y:m,width:b,height:I});for(let E=0;E<p.childNodes.length;E++)r(p.childNodes[E],d);C&&h.remove()}const A=o.getBoundingClientRect();let c=pi.get(o);c===void 0&&(c=document.createElement("canvas"),c.width=A.width,c.height=A.height,pi.set(o,c));const l=c.getContext("2d"),h=new n(l);return l.clearRect(0,0,c.width,c.height),r(o),c}function Tl(o,e,t,n){const s={clientX:t*o.offsetWidth+o.offsetLeft,clientY:n*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,s));const i=o.getBoundingClientRect();t=t*i.width+i.left,n=n*i.height+i.top;function a(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&n>A.top&&n<A.bottom&&(r.dispatchEvent(new MouseEvent(e,s)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[c,l]=["min","max"].map(d=>parseFloat(r[d])),h=A.width,p=(t-A.x)/h;r.value=c+(l-c)*p,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let c=0;c<r.childNodes.length;c++)a(r.childNodes[c])}}a(o)}const An=new _e,cs={type:"",data:An},go=new En;class Ml extends Kt{listenToPointerEvents(e,t){const n=this,s=new En,i=e.domElement;function a(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();An.x=(r.clientX-A.left)/A.width*2-1,An.y=-(r.clientY-A.top)/A.height*2+1,s.setFromCamera(An,t);const c=s.intersectObjects(n.children,!1);if(c.length>0){const l=c[0],h=l.object,p=l.uv;cs.type=r.type,cs.data.set(p.x,1-p.y),h.dispatchEvent(cs)}}i.addEventListener("pointerdown",a),i.addEventListener("pointerup",a),i.addEventListener("pointermove",a),i.addEventListener("mousedown",a),i.addEventListener("mouseup",a),i.addEventListener("mousemove",a),i.addEventListener("click",a)}listenToXRControllerEvents(e){const t=this,n={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function s(i){const a=i.target;go.setFromXRController(a);const r=go.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],c=A.object,l=A.uv;cs.type=n[i.type],cs.data.set(l.x,1-l.y),c.dispatchEvent(cs)}}e.addEventListener("move",s),e.addEventListener("select",s),e.addEventListener("selectstart",s),e.addEventListener("selectend",s)}}const Ms=new N,_s=new N,po=new Mi;class _l extends Us{constructor(e,t=1,n=16711680){const s=new ot,i=e.geometry.attributes.normal.count,a=new Se(i*2*3,3);s.setAttribute("position",a),super(s,new kt({color:n,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),po.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry;if(n){const s=n.attributes.position,i=n.attributes.normal;let a=0;for(let r=0,A=s.count;r<A;r++)Ms.fromBufferAttribute(s,r).applyMatrix4(e),_s.fromBufferAttribute(i,r),_s.applyMatrix3(po).normalize().multiplyScalar(this.size).add(Ms),t.setXYZ(a,Ms.x,Ms.y,Ms.z),a=a+1,t.setXYZ(a,_s.x,_s.y,_s.z),a=a+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class Fl{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new Ci(-1,1,1,-1,0,1);class Ll extends ot{constructor(){super(),this.setAttribute("position",new Se([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Se([0,2,0,0,2,0],2))}}new Ll;const ct={node:"node",material:"material",camera:"camera",light:"light"},$t="KHR_animation_pointer",Nl={CUBICSPLINE:void 0,LINEAR:ds,STEP:mn},uo=gt.findNode;let fo=!1;class Ul{constructor(e){this.parser=e,this.name=$t,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){fo||(fo=!0,gt.findNode=function(e,t){if(t.startsWith(".materials.")){const n=t.substring(11).substring(t.indexOf(".")),s=n.indexOf("."),i=s<0?n:n.substring(0,s);let a=null;return e.traverse(r=>{a!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(a=r.material,a!==null&&(n.endsWith(".map")?a=a.map:n.endsWith(".emissiveMap")&&(a=a.emissiveMap)))}),a}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const n=t.split(".");let s;for(let i=1;i<n.length;i++){const a=n[i];if(a.length==36)s=e.getObjectByProperty("uuid",a);else if(s&&s[a]){const r=Number.parseInt(a);let A=a;r>=0&&(A=r),s=s[A]}else{const r=e.getObjectByName(a);r&&(s=r)}}if(!s){const i=uo(e,n[2]);return i||console.warn($t+": Property binding not found",t,e,e.name,n),i}return s}return uo(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,n=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",n)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,n=t.extensions&&t.extensions[$t]&&t.path&&t.path==="pointer";if(!n)return null;let s,i=ct.node,a;if(n){const A=t.extensions[$t];let c=A.pointer;if(!c){console.warn("Invalid path",A,t);return}if(c.startsWith("/materials/")?i=ct.material:c.startsWith("/extensions/KHR_lights_punctual/lights/")?i=ct.light:c.startsWith("/cameras/")&&(i=ct.camera),a=this._tryResolveTargetId(c,i),a===null||isNaN(a)){console.warn("Failed resolving animation node id: "+a,c);return}switch(i){case ct.material:const h=("/materials/"+a.toString()+"/").length,p=c.substring(0,h);switch(s=c.substring(h),s){case"pbrMetallicRoughness/baseColorFactor":s="color";break;case"pbrMetallicRoughness/roughnessFactor":s="roughness";break;case"pbrMetallicRoughness/metallicFactor":s="metalness";break;case"emissiveFactor":s="emissive";break;case"alphaCutoff":s="alphaTest";break;case"occlusionTexture/strength":s="aoMapIntensity";break;case"normalTexture/scale":s="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":s="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":s="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":s="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":s="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":s="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":s="transmission";break;case"extensions/KHR_materials_ior/ior":s="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":s="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":s="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":s="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":s="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":s="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":s="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":s="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":s="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":s="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":s="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":s="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":s="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":s="specularColor";break}c=p+s;break;case ct.node:const d=("/nodes/"+a.toString()+"/").length,u=c.substring(0,d);switch(s=c.substring(d),s){case"translation":s="position";break;case"rotation":s="quaternion";break;case"scale":s="scale";break;case"weights":s="morphTargetInfluences";break}c=u+s;break;case ct.light:const m=("/extensions/KHR_lights_punctual/lights/"+a.toString()+"/").length;switch(s=c.substring(m),s){case"color":break;case"intensity":break;case"spot/innerConeAngle":s="penumbra";break;case"spot/outerConeAngle":s="angle";break;case"range":s="distance";break}c="/lights/"+a.toString()+"/"+s;break;case ct.camera:const b=("/cameras/"+a.toString()+"/").length,I=c.substring(0,b);switch(s=c.substring(b),s){case"perspective/yfov":s="fov";break;case"perspective/znear":case"orthographic/znear":s="near";break;case"perspective/zfar":case"orthographic/zfar":s="far";break;case"perspective/aspect":s="aspect";break;case"orthographic/xmag":s="zoom";break;case"orthographic/ymag":s="zoom";break}c=I+s;break}const l=this.animationPointerResolver;l&&l.resolvePath&&(c=l.resolvePath(c)),t.extensions[$t].pointer=c}if(a===null||isNaN(a)){console.warn("Failed resolving animation node id: "+a,t);return}let r;return i===ct.node?r=this.parser.getDependency("node",a):i===ct.material?r=this.parser.getDependency("material",a):i===ct.light?r=this.parser.getDependency("light",a):i===ct.camera?r=this.parser.getDependency("camera",a):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,n,s,i){if(!(i.extensions&&i.extensions[$t]&&i.path&&i.path==="pointer"))return null;let a=i.extensions[$t].pointer;if(!a)return null;const r=[];a=a.replaceAll("/",".");const A=a.split(".");var c=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(A[2]=c,A[3]==="morphTargetInfluences"&&e.type==="Group"){for(const h of e.children)h instanceof dn&&h.morphTargetInfluences&&(A[3]=h.name,A[4]="morphTargetInfluences",l(this.parser));return r}l(this.parser);function l(h){a=A.join(".");let p;switch(n.itemSize){case 1:p=Hs;break;case 2:case 3:p=Os;break;case 4:a.endsWith(".quaternion")?p=js:p=Br;break}const d=s.interpolation!==void 0?Nl[s.interpolation]:ds;let u=h._getArrayFromAccessor(n);a.endsWith(".fov")&&(u=u.map(b=>b/Math.PI*180));const m=new p(a,t.array,u,d);if(d==="CUBICSPLINE"&&h._createCubicSplineTrackInterpolant(m),r.push(m),a&&n.itemSize===4&&a.startsWith(".materials.")&&a.endsWith(".color")){const b=new Float32Array(u.length/4);for(let C=0,E=u.length/4;C<E;C+=1)b[C]=u[C*4+3];const I=new p(a.replace(".color",".opacity"),t.array,b,d);d==="CUBICSPLINE"&&h._createCubicSplineTrackInterpolant(m),r.push(I)}}return r}_tryResolveTargetId(e,t){let n="";return t==="node"?n=e.substring(7):t==="material"?n=e.substring(11):t==="light"?n=e.substring(39):t==="camera"&&(n=e.substring(9)),n=n.substring(0,n.indexOf("/")),Number.parseInt(n)}loadAnimation(e){const t=this,n=this.parser.json,s=this.parser,i=n.animations[e],a=i.name?i.name:"animation_"+e,r=[],A=[],c=[],l=[],h=[];for(let p=0,d=i.channels.length;p<d;p++){const u=i.channels[p],m=i.samplers[u.sampler],b=u.target,I=i.parameters!==void 0?i.parameters[m.input]:m.input,C=i.parameters!==void 0?i.parameters[m.output]:m.output;let E=t.loadAnimationTargetFromChannelWithAnimationPointer(u);E||(E=t.loadAnimationTargetFromChannel(u)),r.push(E),A.push(s.getDependency("accessor",I)),c.push(s.getDependency("accessor",C)),l.push(m),h.push(b)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(c),Promise.all(l),Promise.all(h)]).then(function(p){const d=p[0],u=p[1],m=p[2],b=p[3],I=p[4],C=[];for(let E=0,w=d.length;E<w;E++){const Q=d[E],S=u[E],D=m[E],x=b[E],R=I[E];if(Q===void 0)continue;Q.updateMatrix&&(Q.updateMatrix(),Q.matrixAutoUpdate=!0);let G=t.createAnimationTracksWithAnimationPointer(Q,S,D,x,R);if(G||(G=s._createAnimationTracks(Q,S,D,x,R)),G)for(let W=0;W<G.length;W++)C.push(G[W])}return new un(a,void 0,C)})}}const Gl=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:Ul},Symbol.toStringTag,{value:"Module"}));export{oA as D,_a as E,ga as F,Qn as G,Oc as H,Ml as I,xt as K,Dl as L,aA as M,xc as O,Pc as P,Fa as R,Is as S,EA as T,Hc as V,wl as X,wr as a,CA as b,Ea as c,oi as d,yl as e,lo as f,ci as g,QA as h,kl as i,_l as j,yc as k,oc as l,Qr as m,Ui as n,Fl as o,VA as p,XA as q,Gl as r,Xn as s,WA as z};
@@ -466,4 +466,4 @@ version 0.8.2
466
466
  #include <premultiplied_alpha_fragment>
467
467
 
468
468
  }
469
- `};class ns extends a.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:a.UniformsUtils.clone(a.ShaderLib.line.uniforms),vertexShader:a.ShaderLib.line.vertexShader,fragmentShader:a.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Gn=new a.Vector4,Ks=new a.Vector3,Ys=new a.Vector3,Te=new a.Vector4,ve=new a.Vector4,$e=new a.Vector4,Un=new a.Vector3,Pn=new a.Matrix4,Re=new a.Line3,Vs=new a.Vector3,on=new a.Box3,rn=new a.Sphere,et=new a.Vector4;let tt,Ct;function Js(c,e,t){return et.set(0,0,-e,1).applyMatrix4(c.projectionMatrix),et.multiplyScalar(1/et.w),et.x=Ct/t.width,et.y=Ct/t.height,et.applyMatrix4(c.projectionMatrixInverse),et.multiplyScalar(1/et.w),Math.abs(Math.max(et.x,et.y))}function wA(c,e){const t=c.matrixWorld,s=c.geometry,n=s.attributes.instanceStart,i=s.attributes.instanceEnd,o=Math.min(s.instanceCount,n.count);for(let r=0,A=o;r<A;r++){Re.start.fromBufferAttribute(n,r),Re.end.fromBufferAttribute(i,r),Re.applyMatrix4(t);const l=new a.Vector3,h=new a.Vector3;tt.distanceSqToSegment(Re.start,Re.end,h,l),h.distanceTo(l)<Ct*.5&&e.push({point:h,pointOnLine:l,distance:tt.origin.distanceTo(h),object:c,face:null,faceIndex:r,uv:null,uv1:null})}}function yA(c,e,t){const s=e.projectionMatrix,i=c.material.resolution,o=c.matrixWorld,r=c.geometry,A=r.attributes.instanceStart,l=r.attributes.instanceEnd,h=Math.min(r.instanceCount,A.count),u=-e.near;tt.at(1,$e),$e.w=1,$e.applyMatrix4(e.matrixWorldInverse),$e.applyMatrix4(s),$e.multiplyScalar(1/$e.w),$e.x*=i.x/2,$e.y*=i.y/2,$e.z=0,Un.copy($e),Pn.multiplyMatrices(e.matrixWorldInverse,o);for(let p=0,f=h;p<f;p++){if(Te.fromBufferAttribute(A,p),ve.fromBufferAttribute(l,p),Te.w=1,ve.w=1,Te.applyMatrix4(Pn),ve.applyMatrix4(Pn),Te.z>u&&ve.z>u)continue;if(Te.z>u){const C=Te.z-ve.z,y=(Te.z-u)/C;Te.lerp(ve,y)}else if(ve.z>u){const C=ve.z-Te.z,y=(ve.z-u)/C;ve.lerp(Te,y)}Te.applyMatrix4(s),ve.applyMatrix4(s),Te.multiplyScalar(1/Te.w),ve.multiplyScalar(1/ve.w),Te.x*=i.x/2,Te.y*=i.y/2,ve.x*=i.x/2,ve.y*=i.y/2,Re.start.copy(Te),Re.start.z=0,Re.end.copy(ve),Re.end.z=0;const I=Re.closestPointToPointParameter(Un,!0);Re.at(I,Vs);const b=a.MathUtils.lerp(Te.z,ve.z,I),E=b>=-1&&b<=1,w=Un.distanceTo(Vs)<Ct*.5;if(E&&w){Re.start.fromBufferAttribute(A,p),Re.end.fromBufferAttribute(l,p),Re.start.applyMatrix4(o),Re.end.applyMatrix4(o);const C=new a.Vector3,y=new a.Vector3;tt.distanceSqToSegment(Re.start,Re.end,y,C),t.push({point:y,pointOnLine:C,distance:tt.origin.distanceTo(y),object:c,face:null,faceIndex:p,uv:null,uv1:null})}}}class QA extends a.Mesh{constructor(e=new Pi,t=new ns({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,s=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let o=0,r=0,A=t.count;o<A;o++,r+=2)Ks.fromBufferAttribute(t,o),Ys.fromBufferAttribute(s,o),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Ks.distanceTo(Ys);const i=new a.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new a.InterleavedBufferAttribute(i,1,0)),e.setAttribute("instanceDistanceEnd",new a.InterleavedBufferAttribute(i,1,1)),this}raycast(e,t){const s=this.material.worldUnits,n=e.camera;n===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;tt=e.ray;const o=this.matrixWorld,r=this.geometry,A=this.material;Ct=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),rn.copy(r.boundingSphere).applyMatrix4(o);let l;if(s)l=Ct*.5;else{const u=Math.max(n.near,rn.distanceToPoint(tt.origin));l=Js(n,u,A.resolution)}if(rn.radius+=l,tt.intersectsSphere(rn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),on.copy(r.boundingBox).applyMatrix4(o);let h;if(s)h=Ct*.5;else{const u=Math.max(n.near,on.distanceToPoint(tt.origin));h=Js(n,u,A.resolution)}on.expandByScalar(h),tt.intersectsBox(on)!==!1&&(s?wA(this,t):yA(this,n,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(Gn),this.material.uniforms.resolution.value.set(Gn.z,Gn.w))}}class Ni extends Pi{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setPositions(s),this}setColors(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setColors(s),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class xA extends QA{constructor(e=new Ni,t=new ns({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class SA extends a.Mesh{constructor(e){const t=new TA(e),s=new a.PlaneGeometry(t.image.width*.001,t.image.height*.001),n=new a.MeshBasicMaterial({map:t,toneMapped:!1,transparent:!0});super(s,n);function i(o){n.map.dispatchDOMEvent(o)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){s.dispose(),n.dispose(),n.map.dispose(),Jn.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class TA extends a.CanvasTexture{constructor(e){super(Ws(e)),this.dom=e,this.anisotropy=16,this.colorSpace=a.SRGBColorSpace,this.minFilter=a.LinearFilter,this.magFilter=a.LinearFilter;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),s={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,s),this.observer=t}dispatchDOMEvent(e){e.data&&vA(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=Ws(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const Jn=new WeakMap;function Ws(c){const e=document.createRange(),t=new a.Color;function s(p){const f=[];let d=!1;function I(){if(d&&(d=!1,p.restore()),f.length===0)return;let b=-1/0,E=-1/0,w=1/0,C=1/0;for(let y=0;y<f.length;y++){const x=f[y];b=Math.max(b,x.x),E=Math.max(E,x.y),w=Math.min(w,x.x+x.width),C=Math.min(C,x.y+x.height)}p.save(),p.beginPath(),p.rect(b,E,w-b,C-E),p.clip(),d=!0}return{add:function(b){f.push(b),I()},remove:function(){f.pop(),I()}}}function n(p,f,d,I){I!==""&&(p.textTransform==="uppercase"&&(I=I.toUpperCase()),h.font=p.fontWeight+" "+p.fontSize+" "+p.fontFamily,h.textBaseline="top",h.fillStyle=p.color,h.fillText(I,f,d+parseFloat(p.fontSize)*.1))}function i(p,f,d,I,b){d<2*b&&(b=d/2),I<2*b&&(b=I/2),h.beginPath(),h.moveTo(p+b,f),h.arcTo(p+d,f,p+d,f+I,b),h.arcTo(p+d,f+I,p,f+I,b),h.arcTo(p,f+I,p,f,b),h.arcTo(p,f,p+d,f,b),h.closePath()}function o(p,f,d,I,b,E){const w=p[f+"Width"],C=p[f+"Style"],y=p[f+"Color"];w!=="0px"&&C!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=y,h.lineWidth=parseFloat(w),h.beginPath(),h.moveTo(d,I),h.lineTo(d+b,I+E),h.stroke())}function r(p,f){if(p.nodeType===Node.COMMENT_NODE||p.nodeName==="SCRIPT"||p.style&&p.style.display==="none")return;let d=0,I=0,b=0,E=0;if(p.nodeType===Node.TEXT_NODE){e.selectNode(p);const C=e.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,n(f,d,I,p.nodeValue.trim())}else if(p instanceof HTMLCanvasElement){const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,h.save();const y=window.devicePixelRatio;h.scale(1/y,1/y),h.drawImage(p,d,I),h.restore()}else if(p instanceof HTMLImageElement){const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,h.drawImage(p,d,I,b,E)}else{const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,f=window.getComputedStyle(p),i(d,I,b,E,parseFloat(f.borderRadius));const y=f.backgroundColor;y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.fillStyle=y,h.fill());const x=["borderTop","borderLeft","borderBottom","borderRight"];let R=!0,D=null;for(const S of x){if(D!==null&&(R=f[S+"Width"]===f[D+"Width"]&&f[S+"Color"]===f[D+"Color"]&&f[S+"Style"]===f[D+"Style"]),R===!1)break;D=S}if(R===!0){const S=parseFloat(f.borderTopWidth);f.borderTopWidth!=="0px"&&f.borderTopStyle!=="none"&&f.borderTopColor!=="transparent"&&f.borderTopColor!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=f.borderTopColor,h.lineWidth=S,h.stroke())}else o(f,"borderTop",d,I,b,0),o(f,"borderLeft",d,I,0,E),o(f,"borderBottom",d,I+E,b,0),o(f,"borderRight",d+b,I,0,E);if(p instanceof HTMLInputElement){let S=f.accentColor;(S===void 0||S==="auto")&&(S=f.color),t.set(S);const G=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(p.type==="radio"&&(i(d,I,b,E,E),h.fillStyle="white",h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),p.checked&&(i(d+2,I+2,b-4,E-4,E),h.fillStyle=S,h.strokeStyle=G,h.lineWidth=2,h.fill(),h.stroke())),p.type==="checkbox"&&(i(d,I,b,E,2),h.fillStyle=p.checked?S:"white",h.strokeStyle=p.checked?G:S,h.lineWidth=1,h.stroke(),h.fill(),p.checked)){const U=h.textAlign;h.textAlign="center";const O={color:G,fontFamily:f.fontFamily,fontSize:E+"px",fontWeight:"bold"};n(O,d+b/2,I,"✔"),h.textAlign=U}if(p.type==="range"){const[U,O,X]=["min","max","value"].map(q=>parseFloat(p[q])),P=(X-U)/(O-U)*(b-E);i(d,I+E/4,b,E/2,E/4),h.fillStyle=G,h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),i(d,I+E/4,P+E/2,E/2,E/4),h.fillStyle=S,h.fill(),i(d+P,I,E,E,E/2),h.fillStyle=S,h.fill()}(p.type==="color"||p.type==="text"||p.type==="number")&&(u.add({x:d,y:I,width:b,height:E}),n(f,d+parseInt(f.paddingLeft),I+parseInt(f.paddingTop),p.value),u.remove())}}const w=f.overflow==="auto"||f.overflow==="hidden";w&&u.add({x:d,y:I,width:b,height:E});for(let C=0;C<p.childNodes.length;C++)r(p.childNodes[C],f);w&&u.remove()}const A=c.getBoundingClientRect();let l=Jn.get(c);l===void 0&&(l=document.createElement("canvas"),l.width=A.width,l.height=A.height,Jn.set(c,l));const h=l.getContext("2d"),u=new s(h);return h.clearRect(0,0,l.width,l.height),r(c),l}function vA(c,e,t,s){const n={clientX:t*c.offsetWidth+c.offsetLeft,clientY:s*c.offsetHeight+c.offsetTop,view:c.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,n));const i=c.getBoundingClientRect();t=t*i.width+i.left,s=s*i.height+i.top;function o(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&s>A.top&&s<A.bottom&&(r.dispatchEvent(new MouseEvent(e,n)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[l,h]=["min","max"].map(d=>parseFloat(r[d])),u=A.width,f=(t-A.x)/u;r.value=l+(h-l)*f,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let l=0;l<r.childNodes.length;l++)o(r.childNodes[l])}}o(c)}const An=new a.Vector2,Tt={type:"",data:An},Xs=new a.Raycaster;class MA extends a.Group{listenToPointerEvents(e,t){const s=this,n=new a.Raycaster,i=e.domElement;function o(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();An.x=(r.clientX-A.left)/A.width*2-1,An.y=-(r.clientY-A.top)/A.height*2+1,n.setFromCamera(An,t);const l=n.intersectObjects(s.children,!1);if(l.length>0){const h=l[0],u=h.object,p=h.uv;Tt.type=r.type,Tt.data.set(p.x,1-p.y),u.dispatchEvent(Tt)}}i.addEventListener("pointerdown",o),i.addEventListener("pointerup",o),i.addEventListener("pointermove",o),i.addEventListener("mousedown",o),i.addEventListener("mouseup",o),i.addEventListener("mousemove",o),i.addEventListener("click",o)}listenToXRControllerEvents(e){const t=this,s={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function n(i){const o=i.target;Xs.setFromXRController(o);const r=Xs.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],l=A.object,h=A.uv;Tt.type=s[i.type],Tt.data.set(h.x,1-h.y),l.dispatchEvent(Tt)}}e.addEventListener("move",n),e.addEventListener("select",n),e.addEventListener("selectstart",n),e.addEventListener("selectend",n)}}const Pt=new a.Vector3,Nt=new a.Vector3,Zs=new a.Matrix3;class RA extends a.LineSegments{constructor(e,t=1,s=16711680){const n=new a.BufferGeometry,i=e.geometry.attributes.normal.count,o=new a.Float32BufferAttribute(i*2*3,3);n.setAttribute("position",o),super(n,new a.LineBasicMaterial({color:s,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),Zs.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,s=this.object.geometry;if(s){const n=s.attributes.position,i=s.attributes.normal;let o=0;for(let r=0,A=n.count;r<A;r++)Pt.fromBufferAttribute(n,r).applyMatrix4(e),Nt.fromBufferAttribute(i,r),Nt.applyMatrix3(Zs).normalize().multiplyScalar(this.size).add(Pt),t.setXYZ(o,Pt.x,Pt.y,Pt.z),o=o+1,t.setXYZ(o,Nt.x,Nt.y,Nt.z),o=o+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}const Ve={node:"node",material:"material",camera:"camera",light:"light"},bt="KHR_animation_pointer",DA={CUBICSPLINE:void 0,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},$s=a.PropertyBinding.findNode;let ei=!1;class _A{constructor(e){this.parser=e,this.name=bt,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){ei||(ei=!0,a.PropertyBinding.findNode=function(e,t){if(t.startsWith(".materials.")){const s=t.substring(11).substring(t.indexOf(".")),n=s.indexOf("."),i=n<0?s:s.substring(0,n);let o=null;return e.traverse(r=>{o!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(o=r.material,o!==null&&(s.endsWith(".map")?o=o.map:s.endsWith(".emissiveMap")&&(o=o.emissiveMap)))}),o}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const s=t.split(".");let n;for(let i=1;i<s.length;i++){const o=s[i];if(o.length==36)n=e.getObjectByProperty("uuid",o);else if(n&&n[o]){const A=Number.parseInt(o);let l=o;A>=0&&(l=A),n=n[l]}else{const A=e.getObjectByName(o);A&&(n=A)}}if(!n){const i=$s(e,s[2]);return i||console.warn(bt+": Property binding not found",t,e,e.name,s),i}return n}return $s(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,s=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",s)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,s=t.extensions&&t.extensions[bt]&&t.path&&t.path==="pointer";if(!s)return null;let n,i=Ve.node,o;if(s){const A=t.extensions[bt];let l=A.pointer;if(!l){console.warn("Invalid path",A,t);return}if(l.startsWith("/materials/")?i=Ve.material:l.startsWith("/extensions/KHR_lights_punctual/lights/")?i=Ve.light:l.startsWith("/cameras/")&&(i=Ve.camera),o=this._tryResolveTargetId(l,i),o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,l);return}switch(i){case Ve.material:const u=("/materials/"+o.toString()+"/").length,p=l.substring(0,u);switch(n=l.substring(u),n){case"pbrMetallicRoughness/baseColorFactor":n="color";break;case"pbrMetallicRoughness/roughnessFactor":n="roughness";break;case"pbrMetallicRoughness/metallicFactor":n="metalness";break;case"emissiveFactor":n="emissive";break;case"alphaCutoff":n="alphaTest";break;case"occlusionTexture/strength":n="aoMapIntensity";break;case"normalTexture/scale":n="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":n="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":n="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":n="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":n="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":n="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":n="transmission";break;case"extensions/KHR_materials_ior/ior":n="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":n="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":n="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":n="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":n="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":n="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":n="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":n="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":n="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":n="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":n="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":n="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":n="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":n="specularColor";break}l=p+n;break;case Ve.node:const f=("/nodes/"+o.toString()+"/").length,d=l.substring(0,f);switch(n=l.substring(f),n){case"translation":n="position";break;case"rotation":n="quaternion";break;case"scale":n="scale";break;case"weights":n="morphTargetInfluences";break}l=d+n;break;case Ve.light:const I=("/extensions/KHR_lights_punctual/lights/"+o.toString()+"/").length;switch(n=l.substring(I),n){case"color":break;case"intensity":break;case"spot/innerConeAngle":n="penumbra";break;case"spot/outerConeAngle":n="angle";break;case"range":n="distance";break}l="/lights/"+o.toString()+"/"+n;break;case Ve.camera:const b=("/cameras/"+o.toString()+"/").length,E=l.substring(0,b);switch(n=l.substring(b),n){case"perspective/yfov":n="fov";break;case"perspective/znear":case"orthographic/znear":n="near";break;case"perspective/zfar":case"orthographic/zfar":n="far";break;case"perspective/aspect":n="aspect";break;case"orthographic/xmag":n="zoom";break;case"orthographic/ymag":n="zoom";break}l=E+n;break}const h=this.animationPointerResolver;h&&h.resolvePath&&(l=h.resolvePath(l)),t.extensions[bt].pointer=l}if(o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,t);return}let r;return i===Ve.node?r=this.parser.getDependency("node",o):i===Ve.material?r=this.parser.getDependency("material",o):i===Ve.light?r=this.parser.getDependency("light",o):i===Ve.camera?r=this.parser.getDependency("camera",o):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,s,n,i){if(!(i.extensions&&i.extensions[bt]&&i.path&&i.path==="pointer"))return null;let r=i.extensions[bt].pointer;if(!r)return null;const A=[];r=r.replaceAll("/",".");const l=r.split(".");var u=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(l[2]=u,l[3]==="morphTargetInfluences"&&e.type==="Group"){for(const f of e.children)f instanceof a.SkinnedMesh&&f.morphTargetInfluences&&(l[3]=f.name,l[4]="morphTargetInfluences",p(this.parser));return A}p(this.parser);function p(f){r=l.join(".");let d;switch(s.itemSize){case 1:d=a.NumberKeyframeTrack;break;case 2:case 3:d=a.VectorKeyframeTrack;break;case 4:r.endsWith(".quaternion")?d=a.QuaternionKeyframeTrack:d=a.ColorKeyframeTrack;break}const I=n.interpolation!==void 0?DA[n.interpolation]:a.InterpolateLinear;let b=f._getArrayFromAccessor(s);r.endsWith(".fov")&&(b=b.map(w=>w/Math.PI*180));const E=new d(r,t.array,b,I);if(I==="CUBICSPLINE"&&f._createCubicSplineTrackInterpolant(E),A.push(E),r&&s.itemSize===4&&r.startsWith(".materials.")&&r.endsWith(".color")){const w=new Float32Array(b.length/4);for(let y=0,x=b.length/4;y<x;y+=1)w[y]=b[y*4+3];const C=new d(r.replace(".color",".opacity"),t.array,w,I);I==="CUBICSPLINE"&&f._createCubicSplineTrackInterpolant(E),A.push(C)}}return A}_tryResolveTargetId(e,t){let s="";return t==="node"?s=e.substring(7):t==="material"?s=e.substring(11):t==="light"?s=e.substring(39):t==="camera"&&(s=e.substring(9)),s=s.substring(0,s.indexOf("/")),Number.parseInt(s)}loadAnimation(e){const t=this,s=this.parser.json,n=this.parser,i=s.animations[e],o=i.name?i.name:"animation_"+e,r=[],A=[],l=[],h=[],u=[];for(let p=0,f=i.channels.length;p<f;p++){const d=i.channels[p],I=i.samplers[d.sampler],b=d.target,E=i.parameters!==void 0?i.parameters[I.input]:I.input,w=i.parameters!==void 0?i.parameters[I.output]:I.output;let C=t.loadAnimationTargetFromChannelWithAnimationPointer(d);C||(C=t.loadAnimationTargetFromChannel(d)),r.push(C),A.push(n.getDependency("accessor",E)),l.push(n.getDependency("accessor",w)),h.push(I),u.push(b)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(l),Promise.all(h),Promise.all(u)]).then(function(p){const f=p[0],d=p[1],I=p[2],b=p[3],E=p[4],w=[];for(let C=0,y=f.length;C<y;C++){const x=f[C],R=d[C],D=I[C],S=b[C],v=E[C];if(x===void 0)continue;x.updateMatrix&&(x.updateMatrix(),x.matrixAutoUpdate=!0);let G=t.createAnimationTracksWithAnimationPointer(x,R,D,S,v);if(G||(G=n._createAnimationTracks(x,R,D,S,v)),G)for(let U=0;U<G.length;U++)w.push(G[U])}return new a.AnimationClip(o,void 0,w)})}}const FA=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:_A},Symbol.toStringTag,{value:"Module"}));class kA{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new a.OrthographicCamera(-1,1,1,-1,0,1);class LA extends a.BufferGeometry{constructor(){super(),this.setAttribute("position",new a.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new a.Float32BufferAttribute([0,2,0,0,2,0],2))}}new LA;exports.DRACOLoader=sr;exports.EXRLoader=Mi;exports.EXRLoader$1=Yr;exports.FBXLoader=sa;exports.Font=Ei;exports.FontLoader=Ir;exports.GLTFExporter=ts;exports.GLTFLoader=Wn;exports.GLTFLoaderAnimationPointer=FA;exports.GroundedSkybox=Eo;exports.HTMLMesh=SA;exports.HorizontalBlurShader=Ua;exports.InteractiveGroup=MA;exports.KTX2Loader=nt;exports.Line2=xA;exports.LineGeometry=Ni;exports.LineMaterial=ns;exports.MeshoptDecoder=nr;exports.OBJLoader=Ba;exports.OrbitControls=ya;exports.Pass=kA;exports.PositionalAudioHelper=Ga;exports.RGBELoader=Ri;exports.RGBELoader$1=Vr;exports.Stats=zt;exports.TextGeometry=mr;exports.TransformControls=Cr;exports.TransformControlsGizmo=Ci;exports.VertexNormalsHelper=RA;exports.VerticalBlurShader=Pa;exports.XRControllerModelFactory=EA;exports.XRHandMeshModel=BA;exports.mergeVertices=Co;exports.nodeFrame=ti;exports.strToU8=Yn;exports.zipSync=Kr;
469
+ `};class ns extends a.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:a.UniformsUtils.clone(a.ShaderLib.line.uniforms),vertexShader:a.ShaderLib.line.vertexShader,fragmentShader:a.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Gn=new a.Vector4,Ks=new a.Vector3,Ys=new a.Vector3,Te=new a.Vector4,ve=new a.Vector4,$e=new a.Vector4,Un=new a.Vector3,Pn=new a.Matrix4,Re=new a.Line3,Vs=new a.Vector3,on=new a.Box3,rn=new a.Sphere,et=new a.Vector4;let tt,Ct;function Js(c,e,t){return et.set(0,0,-e,1).applyMatrix4(c.projectionMatrix),et.multiplyScalar(1/et.w),et.x=Ct/t.width,et.y=Ct/t.height,et.applyMatrix4(c.projectionMatrixInverse),et.multiplyScalar(1/et.w),Math.abs(Math.max(et.x,et.y))}function wA(c,e){const t=c.matrixWorld,s=c.geometry,n=s.attributes.instanceStart,i=s.attributes.instanceEnd,o=Math.min(s.instanceCount,n.count);for(let r=0,A=o;r<A;r++){Re.start.fromBufferAttribute(n,r),Re.end.fromBufferAttribute(i,r),Re.applyMatrix4(t);const l=new a.Vector3,h=new a.Vector3;tt.distanceSqToSegment(Re.start,Re.end,h,l),h.distanceTo(l)<Ct*.5&&e.push({point:h,pointOnLine:l,distance:tt.origin.distanceTo(h),object:c,face:null,faceIndex:r,uv:null,uv1:null})}}function yA(c,e,t){const s=e.projectionMatrix,i=c.material.resolution,o=c.matrixWorld,r=c.geometry,A=r.attributes.instanceStart,l=r.attributes.instanceEnd,h=Math.min(r.instanceCount,A.count),u=-e.near;tt.at(1,$e),$e.w=1,$e.applyMatrix4(e.matrixWorldInverse),$e.applyMatrix4(s),$e.multiplyScalar(1/$e.w),$e.x*=i.x/2,$e.y*=i.y/2,$e.z=0,Un.copy($e),Pn.multiplyMatrices(e.matrixWorldInverse,o);for(let p=0,f=h;p<f;p++){if(Te.fromBufferAttribute(A,p),ve.fromBufferAttribute(l,p),Te.w=1,ve.w=1,Te.applyMatrix4(Pn),ve.applyMatrix4(Pn),Te.z>u&&ve.z>u)continue;if(Te.z>u){const C=Te.z-ve.z,y=(Te.z-u)/C;Te.lerp(ve,y)}else if(ve.z>u){const C=ve.z-Te.z,y=(ve.z-u)/C;ve.lerp(Te,y)}Te.applyMatrix4(s),ve.applyMatrix4(s),Te.multiplyScalar(1/Te.w),ve.multiplyScalar(1/ve.w),Te.x*=i.x/2,Te.y*=i.y/2,ve.x*=i.x/2,ve.y*=i.y/2,Re.start.copy(Te),Re.start.z=0,Re.end.copy(ve),Re.end.z=0;const I=Re.closestPointToPointParameter(Un,!0);Re.at(I,Vs);const b=a.MathUtils.lerp(Te.z,ve.z,I),E=b>=-1&&b<=1,w=Un.distanceTo(Vs)<Ct*.5;if(E&&w){Re.start.fromBufferAttribute(A,p),Re.end.fromBufferAttribute(l,p),Re.start.applyMatrix4(o),Re.end.applyMatrix4(o);const C=new a.Vector3,y=new a.Vector3;tt.distanceSqToSegment(Re.start,Re.end,y,C),t.push({point:y,pointOnLine:C,distance:tt.origin.distanceTo(y),object:c,face:null,faceIndex:p,uv:null,uv1:null})}}}class QA extends a.Mesh{constructor(e=new Pi,t=new ns({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,s=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let o=0,r=0,A=t.count;o<A;o++,r+=2)Ks.fromBufferAttribute(t,o),Ys.fromBufferAttribute(s,o),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Ks.distanceTo(Ys);const i=new a.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new a.InterleavedBufferAttribute(i,1,0)),e.setAttribute("instanceDistanceEnd",new a.InterleavedBufferAttribute(i,1,1)),this}raycast(e,t){const s=this.material.worldUnits,n=e.camera;n===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;tt=e.ray;const o=this.matrixWorld,r=this.geometry,A=this.material;Ct=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),rn.copy(r.boundingSphere).applyMatrix4(o);let l;if(s)l=Ct*.5;else{const u=Math.max(n.near,rn.distanceToPoint(tt.origin));l=Js(n,u,A.resolution)}if(rn.radius+=l,tt.intersectsSphere(rn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),on.copy(r.boundingBox).applyMatrix4(o);let h;if(s)h=Ct*.5;else{const u=Math.max(n.near,on.distanceToPoint(tt.origin));h=Js(n,u,A.resolution)}on.expandByScalar(h),tt.intersectsBox(on)!==!1&&(s?wA(this,t):yA(this,n,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(Gn),this.material.uniforms.resolution.value.set(Gn.z,Gn.w))}}class Ni extends Pi{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setPositions(s),this}setColors(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setColors(s),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class xA extends QA{constructor(e=new Ni,t=new ns({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class SA extends a.Mesh{constructor(e){const t=new TA(e),s=new a.PlaneGeometry(t.image.width*.001,t.image.height*.001),n=new a.MeshBasicMaterial({map:t,toneMapped:!1,transparent:!0});super(s,n);function i(o){n.map.dispatchDOMEvent(o)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){s.dispose(),n.dispose(),n.map.dispose(),Jn.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class TA extends a.CanvasTexture{constructor(e){super(Ws(e)),this.dom=e,this.anisotropy=16,this.colorSpace=a.SRGBColorSpace,this.minFilter=a.LinearFilter,this.magFilter=a.LinearFilter;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),s={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,s),this.observer=t}dispatchDOMEvent(e){e.data&&vA(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=Ws(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const Jn=new WeakMap;function Ws(c){const e=document.createRange(),t=new a.Color;function s(p){const f=[];let d=!1;function I(){if(d&&(d=!1,p.restore()),f.length===0)return;let b=-1/0,E=-1/0,w=1/0,C=1/0;for(let y=0;y<f.length;y++){const x=f[y];b=Math.max(b,x.x),E=Math.max(E,x.y),w=Math.min(w,x.x+x.width),C=Math.min(C,x.y+x.height)}p.save(),p.beginPath(),p.rect(b,E,w-b,C-E),p.clip(),d=!0}return{add:function(b){f.push(b),I()},remove:function(){f.pop(),I()}}}function n(p,f,d,I){I!==""&&(p.textTransform==="uppercase"&&(I=I.toUpperCase()),h.font=p.fontWeight+" "+p.fontSize+" "+p.fontFamily,h.textBaseline="top",h.fillStyle=p.color,h.fillText(I,f,d+parseFloat(p.fontSize)*.1))}function i(p,f,d,I,b){d<2*b&&(b=d/2),I<2*b&&(b=I/2),h.beginPath(),h.moveTo(p+b,f),h.arcTo(p+d,f,p+d,f+I,b),h.arcTo(p+d,f+I,p,f+I,b),h.arcTo(p,f+I,p,f,b),h.arcTo(p,f,p+d,f,b),h.closePath()}function o(p,f,d,I,b,E){const w=p[f+"Width"],C=p[f+"Style"],y=p[f+"Color"];w!=="0px"&&C!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=y,h.lineWidth=parseFloat(w),h.beginPath(),h.moveTo(d,I),h.lineTo(d+b,I+E),h.stroke())}function r(p,f){if(p.nodeType===Node.COMMENT_NODE||p.nodeName==="SCRIPT"||p.style&&p.style.display==="none")return;let d=0,I=0,b=0,E=0;if(p.nodeType===Node.TEXT_NODE){e.selectNode(p);const C=e.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,n(f,d,I,p.nodeValue.trim())}else if(p instanceof HTMLCanvasElement){const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,h.save();const y=window.devicePixelRatio;h.scale(1/y,1/y),h.drawImage(p,d,I),h.restore()}else if(p instanceof HTMLImageElement){const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,h.drawImage(p,d,I,b,E)}else{const C=p.getBoundingClientRect();d=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,f=window.getComputedStyle(p),i(d,I,b,E,parseFloat(f.borderRadius));const y=f.backgroundColor;y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.fillStyle=y,h.fill());const x=["borderTop","borderLeft","borderBottom","borderRight"];let R=!0,D=null;for(const S of x){if(D!==null&&(R=f[S+"Width"]===f[D+"Width"]&&f[S+"Color"]===f[D+"Color"]&&f[S+"Style"]===f[D+"Style"]),R===!1)break;D=S}if(R===!0){const S=parseFloat(f.borderTopWidth);f.borderTopWidth!=="0px"&&f.borderTopStyle!=="none"&&f.borderTopColor!=="transparent"&&f.borderTopColor!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=f.borderTopColor,h.lineWidth=S,h.stroke())}else o(f,"borderTop",d,I,b,0),o(f,"borderLeft",d,I,0,E),o(f,"borderBottom",d,I+E,b,0),o(f,"borderRight",d+b,I,0,E);if(p instanceof HTMLInputElement){let S=f.accentColor;(S===void 0||S==="auto")&&(S=f.color),t.set(S);const G=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(p.type==="radio"&&(i(d,I,b,E,E),h.fillStyle="white",h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),p.checked&&(i(d+2,I+2,b-4,E-4,E),h.fillStyle=S,h.strokeStyle=G,h.lineWidth=2,h.fill(),h.stroke())),p.type==="checkbox"&&(i(d,I,b,E,2),h.fillStyle=p.checked?S:"white",h.strokeStyle=p.checked?G:S,h.lineWidth=1,h.stroke(),h.fill(),p.checked)){const U=h.textAlign;h.textAlign="center";const O={color:G,fontFamily:f.fontFamily,fontSize:E+"px",fontWeight:"bold"};n(O,d+b/2,I,"✔"),h.textAlign=U}if(p.type==="range"){const[U,O,X]=["min","max","value"].map(q=>parseFloat(p[q])),P=(X-U)/(O-U)*(b-E);i(d,I+E/4,b,E/2,E/4),h.fillStyle=G,h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),i(d,I+E/4,P+E/2,E/2,E/4),h.fillStyle=S,h.fill(),i(d+P,I,E,E,E/2),h.fillStyle=S,h.fill()}(p.type==="color"||p.type==="text"||p.type==="number")&&(u.add({x:d,y:I,width:b,height:E}),n(f,d+parseInt(f.paddingLeft),I+parseInt(f.paddingTop),p.value),u.remove())}}const w=f.overflow==="auto"||f.overflow==="hidden";w&&u.add({x:d,y:I,width:b,height:E});for(let C=0;C<p.childNodes.length;C++)r(p.childNodes[C],f);w&&u.remove()}const A=c.getBoundingClientRect();let l=Jn.get(c);l===void 0&&(l=document.createElement("canvas"),l.width=A.width,l.height=A.height,Jn.set(c,l));const h=l.getContext("2d"),u=new s(h);return h.clearRect(0,0,l.width,l.height),r(c),l}function vA(c,e,t,s){const n={clientX:t*c.offsetWidth+c.offsetLeft,clientY:s*c.offsetHeight+c.offsetTop,view:c.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,n));const i=c.getBoundingClientRect();t=t*i.width+i.left,s=s*i.height+i.top;function o(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&s>A.top&&s<A.bottom&&(r.dispatchEvent(new MouseEvent(e,n)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[l,h]=["min","max"].map(d=>parseFloat(r[d])),u=A.width,f=(t-A.x)/u;r.value=l+(h-l)*f,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let l=0;l<r.childNodes.length;l++)o(r.childNodes[l])}}o(c)}const An=new a.Vector2,Tt={type:"",data:An},Xs=new a.Raycaster;class MA extends a.Group{listenToPointerEvents(e,t){const s=this,n=new a.Raycaster,i=e.domElement;function o(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();An.x=(r.clientX-A.left)/A.width*2-1,An.y=-(r.clientY-A.top)/A.height*2+1,n.setFromCamera(An,t);const l=n.intersectObjects(s.children,!1);if(l.length>0){const h=l[0],u=h.object,p=h.uv;Tt.type=r.type,Tt.data.set(p.x,1-p.y),u.dispatchEvent(Tt)}}i.addEventListener("pointerdown",o),i.addEventListener("pointerup",o),i.addEventListener("pointermove",o),i.addEventListener("mousedown",o),i.addEventListener("mouseup",o),i.addEventListener("mousemove",o),i.addEventListener("click",o)}listenToXRControllerEvents(e){const t=this,s={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function n(i){const o=i.target;Xs.setFromXRController(o);const r=Xs.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],l=A.object,h=A.uv;Tt.type=s[i.type],Tt.data.set(h.x,1-h.y),l.dispatchEvent(Tt)}}e.addEventListener("move",n),e.addEventListener("select",n),e.addEventListener("selectstart",n),e.addEventListener("selectend",n)}}const Pt=new a.Vector3,Nt=new a.Vector3,Zs=new a.Matrix3;class RA extends a.LineSegments{constructor(e,t=1,s=16711680){const n=new a.BufferGeometry,i=e.geometry.attributes.normal.count,o=new a.Float32BufferAttribute(i*2*3,3);n.setAttribute("position",o),super(n,new a.LineBasicMaterial({color:s,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),Zs.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,s=this.object.geometry;if(s){const n=s.attributes.position,i=s.attributes.normal;let o=0;for(let r=0,A=n.count;r<A;r++)Pt.fromBufferAttribute(n,r).applyMatrix4(e),Nt.fromBufferAttribute(i,r),Nt.applyMatrix3(Zs).normalize().multiplyScalar(this.size).add(Pt),t.setXYZ(o,Pt.x,Pt.y,Pt.z),o=o+1,t.setXYZ(o,Nt.x,Nt.y,Nt.z),o=o+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class DA{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new a.OrthographicCamera(-1,1,1,-1,0,1);class _A extends a.BufferGeometry{constructor(){super(),this.setAttribute("position",new a.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new a.Float32BufferAttribute([0,2,0,0,2,0],2))}}new _A;const Ve={node:"node",material:"material",camera:"camera",light:"light"},bt="KHR_animation_pointer",FA={CUBICSPLINE:void 0,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},$s=a.PropertyBinding.findNode;let ei=!1;class kA{constructor(e){this.parser=e,this.name=bt,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){ei||(ei=!0,a.PropertyBinding.findNode=function(e,t){if(t.startsWith(".materials.")){const s=t.substring(11).substring(t.indexOf(".")),n=s.indexOf("."),i=n<0?s:s.substring(0,n);let o=null;return e.traverse(r=>{o!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(o=r.material,o!==null&&(s.endsWith(".map")?o=o.map:s.endsWith(".emissiveMap")&&(o=o.emissiveMap)))}),o}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const s=t.split(".");let n;for(let i=1;i<s.length;i++){const o=s[i];if(o.length==36)n=e.getObjectByProperty("uuid",o);else if(n&&n[o]){const A=Number.parseInt(o);let l=o;A>=0&&(l=A),n=n[l]}else{const A=e.getObjectByName(o);A&&(n=A)}}if(!n){const i=$s(e,s[2]);return i||console.warn(bt+": Property binding not found",t,e,e.name,s),i}return n}return $s(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,s=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",s)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,s=t.extensions&&t.extensions[bt]&&t.path&&t.path==="pointer";if(!s)return null;let n,i=Ve.node,o;if(s){const A=t.extensions[bt];let l=A.pointer;if(!l){console.warn("Invalid path",A,t);return}if(l.startsWith("/materials/")?i=Ve.material:l.startsWith("/extensions/KHR_lights_punctual/lights/")?i=Ve.light:l.startsWith("/cameras/")&&(i=Ve.camera),o=this._tryResolveTargetId(l,i),o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,l);return}switch(i){case Ve.material:const u=("/materials/"+o.toString()+"/").length,p=l.substring(0,u);switch(n=l.substring(u),n){case"pbrMetallicRoughness/baseColorFactor":n="color";break;case"pbrMetallicRoughness/roughnessFactor":n="roughness";break;case"pbrMetallicRoughness/metallicFactor":n="metalness";break;case"emissiveFactor":n="emissive";break;case"alphaCutoff":n="alphaTest";break;case"occlusionTexture/strength":n="aoMapIntensity";break;case"normalTexture/scale":n="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":n="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":n="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":n="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":n="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":n="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":n="transmission";break;case"extensions/KHR_materials_ior/ior":n="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":n="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":n="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":n="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":n="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":n="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":n="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":n="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":n="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":n="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":n="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":n="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":n="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":n="specularColor";break}l=p+n;break;case Ve.node:const f=("/nodes/"+o.toString()+"/").length,d=l.substring(0,f);switch(n=l.substring(f),n){case"translation":n="position";break;case"rotation":n="quaternion";break;case"scale":n="scale";break;case"weights":n="morphTargetInfluences";break}l=d+n;break;case Ve.light:const I=("/extensions/KHR_lights_punctual/lights/"+o.toString()+"/").length;switch(n=l.substring(I),n){case"color":break;case"intensity":break;case"spot/innerConeAngle":n="penumbra";break;case"spot/outerConeAngle":n="angle";break;case"range":n="distance";break}l="/lights/"+o.toString()+"/"+n;break;case Ve.camera:const b=("/cameras/"+o.toString()+"/").length,E=l.substring(0,b);switch(n=l.substring(b),n){case"perspective/yfov":n="fov";break;case"perspective/znear":case"orthographic/znear":n="near";break;case"perspective/zfar":case"orthographic/zfar":n="far";break;case"perspective/aspect":n="aspect";break;case"orthographic/xmag":n="zoom";break;case"orthographic/ymag":n="zoom";break}l=E+n;break}const h=this.animationPointerResolver;h&&h.resolvePath&&(l=h.resolvePath(l)),t.extensions[bt].pointer=l}if(o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,t);return}let r;return i===Ve.node?r=this.parser.getDependency("node",o):i===Ve.material?r=this.parser.getDependency("material",o):i===Ve.light?r=this.parser.getDependency("light",o):i===Ve.camera?r=this.parser.getDependency("camera",o):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,s,n,i){if(!(i.extensions&&i.extensions[bt]&&i.path&&i.path==="pointer"))return null;let r=i.extensions[bt].pointer;if(!r)return null;const A=[];r=r.replaceAll("/",".");const l=r.split(".");var u=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(l[2]=u,l[3]==="morphTargetInfluences"&&e.type==="Group"){for(const f of e.children)f instanceof a.SkinnedMesh&&f.morphTargetInfluences&&(l[3]=f.name,l[4]="morphTargetInfluences",p(this.parser));return A}p(this.parser);function p(f){r=l.join(".");let d;switch(s.itemSize){case 1:d=a.NumberKeyframeTrack;break;case 2:case 3:d=a.VectorKeyframeTrack;break;case 4:r.endsWith(".quaternion")?d=a.QuaternionKeyframeTrack:d=a.ColorKeyframeTrack;break}const I=n.interpolation!==void 0?FA[n.interpolation]:a.InterpolateLinear;let b=f._getArrayFromAccessor(s);r.endsWith(".fov")&&(b=b.map(w=>w/Math.PI*180));const E=new d(r,t.array,b,I);if(I==="CUBICSPLINE"&&f._createCubicSplineTrackInterpolant(E),A.push(E),r&&s.itemSize===4&&r.startsWith(".materials.")&&r.endsWith(".color")){const w=new Float32Array(b.length/4);for(let y=0,x=b.length/4;y<x;y+=1)w[y]=b[y*4+3];const C=new d(r.replace(".color",".opacity"),t.array,w,I);I==="CUBICSPLINE"&&f._createCubicSplineTrackInterpolant(E),A.push(C)}}return A}_tryResolveTargetId(e,t){let s="";return t==="node"?s=e.substring(7):t==="material"?s=e.substring(11):t==="light"?s=e.substring(39):t==="camera"&&(s=e.substring(9)),s=s.substring(0,s.indexOf("/")),Number.parseInt(s)}loadAnimation(e){const t=this,s=this.parser.json,n=this.parser,i=s.animations[e],o=i.name?i.name:"animation_"+e,r=[],A=[],l=[],h=[],u=[];for(let p=0,f=i.channels.length;p<f;p++){const d=i.channels[p],I=i.samplers[d.sampler],b=d.target,E=i.parameters!==void 0?i.parameters[I.input]:I.input,w=i.parameters!==void 0?i.parameters[I.output]:I.output;let C=t.loadAnimationTargetFromChannelWithAnimationPointer(d);C||(C=t.loadAnimationTargetFromChannel(d)),r.push(C),A.push(n.getDependency("accessor",E)),l.push(n.getDependency("accessor",w)),h.push(I),u.push(b)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(l),Promise.all(h),Promise.all(u)]).then(function(p){const f=p[0],d=p[1],I=p[2],b=p[3],E=p[4],w=[];for(let C=0,y=f.length;C<y;C++){const x=f[C],R=d[C],D=I[C],S=b[C],v=E[C];if(x===void 0)continue;x.updateMatrix&&(x.updateMatrix(),x.matrixAutoUpdate=!0);let G=t.createAnimationTracksWithAnimationPointer(x,R,D,S,v);if(G||(G=n._createAnimationTracks(x,R,D,S,v)),G)for(let U=0;U<G.length;U++)w.push(G[U])}return new a.AnimationClip(o,void 0,w)})}}const LA=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:kA},Symbol.toStringTag,{value:"Module"}));exports.DRACOLoader=sr;exports.EXRLoader=Mi;exports.EXRLoader$1=Yr;exports.FBXLoader=sa;exports.Font=Ei;exports.FontLoader=Ir;exports.GLTFExporter=ts;exports.GLTFLoader=Wn;exports.GLTFLoaderAnimationPointer=LA;exports.GroundedSkybox=Eo;exports.HTMLMesh=SA;exports.HorizontalBlurShader=Ua;exports.InteractiveGroup=MA;exports.KTX2Loader=nt;exports.Line2=xA;exports.LineGeometry=Ni;exports.LineMaterial=ns;exports.MeshoptDecoder=nr;exports.OBJLoader=Ba;exports.OrbitControls=ya;exports.Pass=DA;exports.PositionalAudioHelper=Ga;exports.RGBELoader=Ri;exports.RGBELoader$1=Vr;exports.Stats=zt;exports.TextGeometry=mr;exports.TransformControls=Cr;exports.TransformControlsGizmo=Ci;exports.VertexNormalsHelper=RA;exports.VerticalBlurShader=Pa;exports.XRControllerModelFactory=EA;exports.XRHandMeshModel=BA;exports.mergeVertices=Co;exports.nodeFrame=ti;exports.strToU8=Yn;exports.zipSync=Kr;
package/dist/vendor.js CHANGED
@@ -10996,7 +10996,6 @@ class Ud extends xc {
10996
10996
  super.onBeforeCompile(t, e), t.vertexShader = To, t.fragmentShader = Ko;
10997
10997
  }
10998
10998
  }
10999
- new Y(0, 0, 1);
11000
10999
  class Pd extends tc {
11001
11000
  constructor(t) {
11002
11001
  super(t), this.vector_ = new Y(), this.vector2_ = new Y(), this.vector3_ = new Y(), this.quaternion_ = new w(), this.quaternion2_ = new w(), this.quaternion3_ = new w(), this.rotationMat_ = new At(), this.rotationMat2_ = new At(), this.maxParticles = 1e3, this.setupBuffers(), this.rebuildMaterial();
@@ -11216,7 +11215,6 @@ void main() {
11216
11215
 
11217
11216
  #include <fog_vertex>
11218
11217
  }`;
11219
- new Y(0, 0, 1);
11220
11218
  class wd extends tc {
11221
11219
  constructor(t) {
11222
11220
  super(t), this.vector_ = new Y(), this.vector2_ = new Y(), this.vector3_ = new Y(), this.quaternion_ = new w(), this.maxParticles = 1e4, this.setupBuffers(), this.rebuildMaterial();
@@ -10996,7 +10996,6 @@ class Ud extends xc {
10996
10996
  super.onBeforeCompile(t, e), t.vertexShader = To, t.fragmentShader = Ko;
10997
10997
  }
10998
10998
  }
10999
- new Y(0, 0, 1);
11000
10999
  class Pd extends tc {
11001
11000
  constructor(t) {
11002
11001
  super(t), this.vector_ = new Y(), this.vector2_ = new Y(), this.vector3_ = new Y(), this.quaternion_ = new w(), this.quaternion2_ = new w(), this.quaternion3_ = new w(), this.rotationMat_ = new At(), this.rotationMat2_ = new At(), this.maxParticles = 1e3, this.setupBuffers(), this.rebuildMaterial();
@@ -11216,7 +11215,6 @@ void main() {
11216
11215
 
11217
11216
  #include <fog_vertex>
11218
11217
  }`;
11219
- new Y(0, 0, 1);
11220
11218
  class wd extends tc {
11221
11219
  constructor(t) {
11222
11220
  super(t), this.vector_ = new Y(), this.vector2_ = new Y(), this.vector3_ = new Y(), this.quaternion_ = new w(), this.maxParticles = 1e4, this.setupBuffers(), this.rebuildMaterial();