ss-component-new 1.1.310 → 1.1.320

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 (75) hide show
  1. package/dist/{array-CFIAOkpU.js → array-CBNCxJvD.js} +2 -2
  2. package/dist/{array-Dp3mG6qP.cjs → array-CoicHQVK.cjs} +1 -1
  3. package/dist/{cloneDeep-BC6hApUL.js → cloneDeep-Bx_iHhpy.js} +1 -1
  4. package/dist/{cloneDeep-Dqfzct8G.cjs → cloneDeep-CiETtPGk.cjs} +1 -1
  5. package/dist/{index-Tu-PtE4a.cjs → index-5LLyaRck.cjs} +1 -1
  6. package/dist/{index-C098N8un.cjs → index-5aqWel4g.cjs} +1 -1
  7. package/dist/{index-DX-ZG8i5.cjs → index-B1KjkSI_.cjs} +1 -1
  8. package/dist/{index-CSMb6JUa.js → index-BA6kqwmr.js} +9 -9
  9. package/dist/{index-CxHjQMe7.js → index-BDfBvjpU.js} +5 -5
  10. package/dist/{index-B1nJ-Z39.js → index-BHMrXYKx.js} +3 -3
  11. package/dist/{index-DA3Sh1Tz.cjs → index-BIxcpWxq.cjs} +1 -1
  12. package/dist/{index-i0BszWbX.cjs → index-BKrqlgh2.cjs} +1 -1
  13. package/dist/{index-Cb4nldBH.cjs → index-BOBZILuT.cjs} +1 -1
  14. package/dist/{index-CG7LSylY.cjs → index-BQQ3XVM2.cjs} +1 -1
  15. package/dist/{index-DzHb-2qg.cjs → index-BSMS5hD1.cjs} +1 -1
  16. package/dist/{index-B2-tbMJV.js → index-BTqgHyYp.js} +4 -4
  17. package/dist/{index-D25w_LCd.js → index-BbbJyBM3.js} +4 -4
  18. package/dist/{index-C4Sp8WeM.js → index-Bf-rZ5Ny.js} +4 -4
  19. package/dist/{index-DjAg2mhq.js → index-Bh0t_Ii2.js} +3 -3
  20. package/dist/{index-BRebILsV.cjs → index-BkH7ovSP.cjs} +1 -1
  21. package/dist/{index-Ci-roF0f.cjs → index-BmO1tbJj.cjs} +1 -1
  22. package/dist/{index-D4-10GVB.js → index-Bn9ZyTuM.js} +5 -5
  23. package/dist/{index-B0WB2KTa.cjs → index-BvU4v6sB.cjs} +1 -1
  24. package/dist/index-C92KCmBd.cjs +9 -0
  25. package/dist/{index-KxCRKhYW.js → index-C9wGY4VD.js} +7 -7
  26. package/dist/{index-DpgIfvxQ.cjs → index-CEQLrcwA.cjs} +1 -1
  27. package/dist/{index-Cehda098.cjs → index-CLYioS2i.cjs} +1 -1
  28. package/dist/{index-BqyjHr9C.js → index-CMF_TuV8.js} +4 -4
  29. package/dist/{index-Dj4GAvUp.js → index-CNui_VwO.js} +3 -3
  30. package/dist/{index-5W3FYly6.cjs → index-CVNRviEe.cjs} +1 -1
  31. package/dist/{index-BUzuQGku.cjs → index-CZMb0qn1.cjs} +1 -1
  32. package/dist/{index-CND4bAN1.js → index-CakKXgzx.js} +6 -6
  33. package/dist/{index-ukJ-kt4p.cjs → index-CakzIGY8.cjs} +1 -1
  34. package/dist/{index-563TMWMC.cjs → index-Cho88zM1.cjs} +1 -1
  35. package/dist/{index-BPoaubFA.cjs → index-Ck1OHkON.cjs} +1 -1
  36. package/dist/{index-COWtJfBt.js → index-CmtqjWVW.js} +5 -5
  37. package/dist/{index-DE3uvzqv.js → index-CoOqtD57.js} +1 -1
  38. package/dist/{index-ts5b_rKm.js → index-Cw9PmPnS.js} +1443 -1441
  39. package/dist/{index-BTnKTcJy.cjs → index-CxWSc3r7.cjs} +1 -1
  40. package/dist/{index-epYwDqWZ.js → index-CxoV2d-P.js} +5 -5
  41. package/dist/{index-Cd3MpYaF.js → index-D1FGu2x5.js} +8 -8
  42. package/dist/{index-Dv0cT1Jj.cjs → index-DBQSCG7i.cjs} +1 -1
  43. package/dist/{index-CqoO4f6W.cjs → index-DCfoQMQH.cjs} +1 -1
  44. package/dist/{index-BsoflaB1.js → index-DEXNzFlt.js} +3 -3
  45. package/dist/{index-BlnkYO02.cjs → index-DLoncX8L.cjs} +1 -1
  46. package/dist/{index-CKbCejX8.cjs → index-DXSHpVw8.cjs} +1 -1
  47. package/dist/{index-CMhrZyHq.cjs → index-DbIN4IAJ.cjs} +1 -1
  48. package/dist/{index-DhNtgRPf.js → index-DmCUVpMx.js} +1 -1
  49. package/dist/{index-BiA96Te2.js → index-DpN79Xw9.js} +4 -4
  50. package/dist/{index-CfUQUcR0.js → index-DqM9LXi_.js} +1 -1
  51. package/dist/{index-DCCRnjTu.cjs → index-NWrbKJFO.cjs} +1 -1
  52. package/dist/{index-CeIsvjm_.js → index-QX-B8qJV.js} +8 -8
  53. package/dist/{index-Dk4rHBYA.js → index-VShOpW-d.js} +1 -1
  54. package/dist/{index-6DprAE2h.js → index-XIFPSbz7.js} +6 -6
  55. package/dist/{index-DJUjFOtq.js → index-_aOa1cxU.js} +3 -3
  56. package/dist/{index-Cykuj77e.js → index-azxkeTgy.js} +7 -7
  57. package/dist/{index.vue_vue_type_script_setup_true_lang-C1lQOWLE.cjs → index.vue_vue_type_script_setup_true_lang-DxkVyC8t.cjs} +1 -1
  58. package/dist/{index.vue_vue_type_script_setup_true_lang-CApK0j7g.js → index.vue_vue_type_script_setup_true_lang-Tp9-3enR.js} +1 -1
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-PEeio78T.js → index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-BRPnWu-r.js} +13 -13
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-CmoZt9g1.cjs → index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-RGMeytl0.cjs} +1 -1
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-r-NO8sGY.cjs → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-Bg499-ti.cjs} +1 -1
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-DOzj8ZRs.js → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-CcfAJ4oR.js} +8 -8
  63. package/dist/{login-BPkLsYkz.cjs → login-B44OtS2e.cjs} +1 -1
  64. package/dist/{login-UhUPZuPH.js → login-BOXFFts0.js} +2 -2
  65. package/dist/{main-BTYMrU5V.cjs → main-CJG5WIAz.cjs} +1 -1
  66. package/dist/{main-dSK-267_.js → main-Dy-UNEJP.js} +7 -7
  67. package/dist/{menu-D1SsYDhc.cjs → menu-6iBXxopx.cjs} +1 -1
  68. package/dist/{menu-dd51TtC8.js → menu-9xaTSah9.js} +1 -1
  69. package/dist/ss-component.cjs +1 -1
  70. package/dist/ss-component.css +1 -1
  71. package/dist/ss-component.js +7 -7
  72. package/dist/ss-component3.cjs +1 -1
  73. package/dist/ss-component3.js +1 -1
  74. package/package.json +1 -1
  75. package/dist/index-Dl7Iwabv.cjs +0 -9
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),We=require("./index-BQQ3XVM2.cjs"),Bt=require("./index-BOBZILuT.cjs"),Ue=require("./index-BIxcpWxq.cjs"),r=require("./index-BvU4v6sB.cjs"),be=require("./menu-6iBXxopx.cjs"),Un=require("./index-CakzIGY8.cjs"),de=require("./index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-RGMeytl0.cjs"),it=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ot=require("./array-CoicHQVK.cjs"),rn=require("./login-B44OtS2e.cjs"),Qe=require("./index-BpPyaNFa.cjs"),ln=require("./index-DLoncX8L.cjs"),st=require("./cloneDeep-CiETtPGk.cjs"),Rt=require("./index-5aqWel4g.cjs"),zn=require("./index-CEQLrcwA.cjs"),Jt={type:"change"},Dt={type:"start"},cn={type:"end"},vt=new r.Ray,Xt=new r.Plane,Gn=Math.cos(70*r.MathUtils.DEG2RAD),Te=new r.Vector3,Ve=2*Math.PI,we={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Mt=1e-6;class qn extends r.Controls{constructor(o,l=null){super(o,l),this.state=we.NONE,this.target=new r.Vector3,this.cursor=new r.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:r.MOUSE.ROTATE,MIDDLE:r.MOUSE.DOLLY,RIGHT:r.MOUSE.PAN},this.touches={ONE:r.TOUCH.ROTATE,TWO:r.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new r.Vector3,this._lastQuaternion=new r.Quaternion,this._lastTargetPosition=new r.Vector3,this._quat=new r.Quaternion().setFromUnitVectors(o.up,new r.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new r.Spherical,this._sphericalDelta=new r.Spherical,this._scale=1,this._panOffset=new r.Vector3,this._rotateStart=new r.Vector2,this._rotateEnd=new r.Vector2,this._rotateDelta=new r.Vector2,this._panStart=new r.Vector2,this._panEnd=new r.Vector2,this._panDelta=new r.Vector2,this._dollyStart=new r.Vector2,this._dollyEnd=new r.Vector2,this._dollyDelta=new r.Vector2,this._dollyDirection=new r.Vector3,this._mouse=new r.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=$n.bind(this),this._onPointerDown=Hn.bind(this),this._onPointerUp=Yn.bind(this),this._onContextMenu=eo.bind(this),this._onMouseWheel=Zn.bind(this),this._onKeyDown=Jn.bind(this),this._onTouchStart=Xn.bind(this),this._onTouchMove=Qn.bind(this),this._onMouseDown=Kn.bind(this),this._onMouseMove=Wn.bind(this),this._interceptControlDown=to.bind(this),this._interceptControlUp=no.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(o){super.connect(o),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(o){o.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=o}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Jt),this.update(),this.state=we.NONE}update(o=null){const l=this.object.position;Te.copy(l).sub(this.target),Te.applyQuaternion(this._quat),this._spherical.setFromVector3(Te),this.autoRotate&&this.state===we.NONE&&this._rotateLeft(this._getAutoRotationAngle(o)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let c=this.minAzimuthAngle,u=this.maxAzimuthAngle;isFinite(c)&&isFinite(u)&&(c<-Math.PI?c+=Ve:c>Math.PI&&(c-=Ve),u<-Math.PI?u+=Ve:u>Math.PI&&(u-=Ve),c<=u?this._spherical.theta=Math.max(c,Math.min(u,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(c+u)/2?Math.max(c,this._spherical.theta):Math.min(u,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let d=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const _=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),d=_!=this._spherical.radius}if(Te.setFromSpherical(this._spherical),Te.applyQuaternion(this._quatInverse),l.copy(this.target).add(Te),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let _=null;if(this.object.isPerspectiveCamera){const p=Te.length();_=this._clampDistance(p*this._scale);const w=p-_;this.object.position.addScaledVector(this._dollyDirection,w),this.object.updateMatrixWorld(),d=!!w}else if(this.object.isOrthographicCamera){const p=new r.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object);const w=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),d=w!==this.object.zoom;const b=new r.Vector3(this._mouse.x,this._mouse.y,0);b.unproject(this.object),this.object.position.sub(b).add(p),this.object.updateMatrixWorld(),_=Te.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;_!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(_).add(this.object.position):(vt.origin.copy(this.object.position),vt.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(vt.direction))<Gn?this.object.lookAt(this.target):(Xt.setFromNormalAndCoplanarPoint(this.object.up,this.target),vt.intersectPlane(Xt,this.target))))}else if(this.object.isOrthographicCamera){const _=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),_!==this.object.zoom&&(this.object.updateProjectionMatrix(),d=!0)}return this._scale=1,this._performCursorZoom=!1,d||this._lastPosition.distanceToSquared(this.object.position)>Mt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Mt||this._lastTargetPosition.distanceToSquared(this.target)>Mt?(this.dispatchEvent(Jt),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(o){return o!==null?Ve/60*this.autoRotateSpeed*o:Ve/60/60*this.autoRotateSpeed}_getZoomScale(o){const l=Math.abs(o*.01);return Math.pow(.95,this.zoomSpeed*l)}_rotateLeft(o){this._sphericalDelta.theta-=o}_rotateUp(o){this._sphericalDelta.phi-=o}_panLeft(o,l){Te.setFromMatrixColumn(l,0),Te.multiplyScalar(-o),this._panOffset.add(Te)}_panUp(o,l){this.screenSpacePanning===!0?Te.setFromMatrixColumn(l,1):(Te.setFromMatrixColumn(l,0),Te.crossVectors(this.object.up,Te)),Te.multiplyScalar(o),this._panOffset.add(Te)}_pan(o,l){const c=this.domElement;if(this.object.isPerspectiveCamera){const u=this.object.position;Te.copy(u).sub(this.target);let d=Te.length();d*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*d/c.clientHeight,this.object.matrix),this._panUp(2*l*d/c.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/c.clientWidth,this.object.matrix),this._panUp(l*(this.object.top-this.object.bottom)/this.object.zoom/c.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(o,l){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const c=this.domElement.getBoundingClientRect(),u=o-c.left,d=l-c.top,_=c.width,p=c.height;this._mouse.x=u/_*2-1,this._mouse.y=-(d/p)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(o){return Math.max(this.minDistance,Math.min(this.maxDistance,o))}_handleMouseDownRotate(o){this._rotateStart.set(o.clientX,o.clientY)}_handleMouseDownDolly(o){this._updateZoomParameters(o.clientX,o.clientX),this._dollyStart.set(o.clientX,o.clientY)}_handleMouseDownPan(o){this._panStart.set(o.clientX,o.clientY)}_handleMouseMoveRotate(o){this._rotateEnd.set(o.clientX,o.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const l=this.domElement;this._rotateLeft(Ve*this._rotateDelta.x/l.clientHeight),this._rotateUp(Ve*this._rotateDelta.y/l.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(o){this._dollyEnd.set(o.clientX,o.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(o){this._panEnd.set(o.clientX,o.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(o){this._updateZoomParameters(o.clientX,o.clientY),o.deltaY<0?this._dollyIn(this._getZoomScale(o.deltaY)):o.deltaY>0&&this._dollyOut(this._getZoomScale(o.deltaY)),this.update()}_handleKeyDown(o){let l=!1;switch(o.code){case this.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(Ve*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),l=!0;break;case this.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(-Ve*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),l=!0;break;case this.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(Ve*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),l=!0;break;case this.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(-Ve*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),l=!0;break}l&&(o.preventDefault(),this.update())}_handleTouchStartRotate(o){if(this._pointers.length===1)this._rotateStart.set(o.pageX,o.pageY);else{const l=this._getSecondPointerPosition(o),c=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._rotateStart.set(c,u)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const l=this._getSecondPointerPosition(o),c=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._panStart.set(c,u)}}_handleTouchStartDolly(o){const l=this._getSecondPointerPosition(o),c=o.pageX-l.x,u=o.pageY-l.y,d=Math.sqrt(c*c+u*u);this._dollyStart.set(0,d)}_handleTouchStartDollyPan(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enablePan&&this._handleTouchStartPan(o)}_handleTouchStartDollyRotate(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enableRotate&&this._handleTouchStartRotate(o)}_handleTouchMoveRotate(o){if(this._pointers.length==1)this._rotateEnd.set(o.pageX,o.pageY);else{const c=this._getSecondPointerPosition(o),u=.5*(o.pageX+c.x),d=.5*(o.pageY+c.y);this._rotateEnd.set(u,d)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const l=this.domElement;this._rotateLeft(Ve*this._rotateDelta.x/l.clientHeight),this._rotateUp(Ve*this._rotateDelta.y/l.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(o){if(this._pointers.length===1)this._panEnd.set(o.pageX,o.pageY);else{const l=this._getSecondPointerPosition(o),c=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._panEnd.set(c,u)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(o){const l=this._getSecondPointerPosition(o),c=o.pageX-l.x,u=o.pageY-l.y,d=Math.sqrt(c*c+u*u);this._dollyEnd.set(0,d),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const _=(o.pageX+l.x)*.5,p=(o.pageY+l.y)*.5;this._updateZoomParameters(_,p)}_handleTouchMoveDollyPan(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enablePan&&this._handleTouchMovePan(o)}_handleTouchMoveDollyRotate(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enableRotate&&this._handleTouchMoveRotate(o)}_addPointer(o){this._pointers.push(o.pointerId)}_removePointer(o){delete this._pointerPositions[o.pointerId];for(let l=0;l<this._pointers.length;l++)if(this._pointers[l]==o.pointerId){this._pointers.splice(l,1);return}}_isTrackingPointer(o){for(let l=0;l<this._pointers.length;l++)if(this._pointers[l]==o.pointerId)return!0;return!1}_trackPointer(o){let l=this._pointerPositions[o.pointerId];l===void 0&&(l=new r.Vector2,this._pointerPositions[o.pointerId]=l),l.set(o.pageX,o.pageY)}_getSecondPointerPosition(o){const l=o.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[l]}_customWheelEvent(o){const l=o.deltaMode,c={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(l){case 1:c.deltaY*=16;break;case 2:c.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(c.deltaY*=10),c}}function Hn(M){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(M.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(M)&&(this._addPointer(M),M.pointerType==="touch"?this._onTouchStart(M):this._onMouseDown(M)))}function $n(M){this.enabled!==!1&&(M.pointerType==="touch"?this._onTouchMove(M):this._onMouseMove(M))}function Yn(M){switch(this._removePointer(M),this._pointers.length){case 0:this.domElement.releasePointerCapture(M.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(cn),this.state=we.NONE;break;case 1:const o=this._pointers[0],l=this._pointerPositions[o];this._onTouchStart({pointerId:o,pageX:l.x,pageY:l.y});break}}function Kn(M){let o;switch(M.button){case 0:o=this.mouseButtons.LEFT;break;case 1:o=this.mouseButtons.MIDDLE;break;case 2:o=this.mouseButtons.RIGHT;break;default:o=-1}switch(o){case r.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(M),this.state=we.DOLLY;break;case r.MOUSE.ROTATE:if(M.ctrlKey||M.metaKey||M.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(M),this.state=we.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(M),this.state=we.ROTATE}break;case r.MOUSE.PAN:if(M.ctrlKey||M.metaKey||M.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(M),this.state=we.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(M),this.state=we.PAN}break;default:this.state=we.NONE}this.state!==we.NONE&&this.dispatchEvent(Dt)}function Wn(M){switch(this.state){case we.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(M);break;case we.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(M);break;case we.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(M);break}}function Zn(M){this.enabled===!1||this.enableZoom===!1||this.state!==we.NONE||(M.preventDefault(),this.dispatchEvent(Dt),this._handleMouseWheel(this._customWheelEvent(M)),this.dispatchEvent(cn))}function Jn(M){this.enabled!==!1&&this._handleKeyDown(M)}function Xn(M){switch(this._trackPointer(M),this._pointers.length){case 1:switch(this.touches.ONE){case r.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(M),this.state=we.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(M),this.state=we.TOUCH_PAN;break;default:this.state=we.NONE}break;case 2:switch(this.touches.TWO){case r.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(M),this.state=we.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(M),this.state=we.TOUCH_DOLLY_ROTATE;break;default:this.state=we.NONE}break;default:this.state=we.NONE}this.state!==we.NONE&&this.dispatchEvent(Dt)}function Qn(M){switch(this._trackPointer(M),this.state){case we.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(M),this.update();break;case we.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(M),this.update();break;case we.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(M),this.update();break;case we.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(M),this.update();break;default:this.state=we.NONE}}function eo(M){this.enabled!==!1&&M.preventDefault()}function to(M){M.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function no(M){M.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function oo(M){let o=null,l=null,c=null,u=null,d=null,_=null;const p=e.ref([]),w=e.ref(new r.Vector3),b=e.ref(new r.Vector3),L=()=>{if(!M.value)return;o=new r.Scene,o.background=new r.Color(16777215);const N=M.value;l=new r.PerspectiveCamera(75,N.clientWidth/N.clientHeight,.1,1e4),c=new r.WebGLRenderer({antialias:!0,alpha:!0}),c.setSize(N.clientWidth,N.clientHeight),c.localClippingEnabled=!0,c.shadowMap.enabled=!0,c.shadowMap.type=r.PCFSoftShadowMap,c.toneMapping=r.ACESFilmicToneMapping,c.toneMappingExposure=1,c.outputColorSpace=r.SRGBColorSpace,N.appendChild(c.domElement),u=new qn(l,c.domElement),u.enableDamping=!0,u.dampingFactor=.05,d=new r.Xe(l,c,{container:N,type:"cube",placement:"bottom-left",offset:{left:350,bottom:22},background:{color:"#D1D1D1"}}),d.attachControls(u),R(),V()},R=()=>{const N=new r.AmbientLight(4210752,.6);o.add(N);const k=new r.DirectionalLight(16777215,2);k.position.set(10,10,8),k.castShadow=!0,k.shadow.mapSize.width=2048,k.shadow.mapSize.height=2048,k.shadow.camera.near=.5,k.shadow.camera.far=50,o.add(k);const g=new r.DirectionalLight(16777215,.8);g.position.set(-8,-8,6),o.add(g);const F=new r.DirectionalLight(16777215,.6);F.position.set(0,-15,2),o.add(F);const A=new r.HemisphereLight(16777215,4473924,.8);o.add(A);const x=new r.PointLight(16777215,1,50);x.position.set(15,15,15),o.add(x);const q=new r.PointLight(16777215,.5,50);q.position.set(-15,-15,15),o.add(q)},V=()=>{_=requestAnimationFrame(V),u&&u.update(),c&&o&&l&&c.render(o,l),d&&d.render()},T=N=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(g=>{N[g]&&N[g].dispose&&N[g].dispose()}),N.dispose&&N.dispose()},B=N=>{N.traverse(k=>{k.geometry&&k.geometry.dispose(),k.material&&(Array.isArray(k.material)?k.material.forEach(g=>{T(g)}):T(k.material))})};return{currentModels:p,initialCameraPosition:w,initialTargetPosition:b,initThreeJS:L,handleResize:()=>{if(!M.value||!l||!c||!d)return;const N=M.value,k=N.clientWidth,g=N.clientHeight;l.aspect=k/g,l.updateProjectionMatrix(),c.setSize(k,g),d.update()},fitCameraToAllModels:()=>{if(!l||!u||p.value.length===0)return;const N=new r.Box3;p.value.forEach(D=>{N.expandByObject(D)});const k=N.getSize(new r.Vector3),g=N.getCenter(new r.Vector3),A=Math.max(k.x,k.y,k.z)*.8,x=new r.Vector3(g.x+A,g.y+A,g.z+A),q=g.clone();l.position.copy(x),l.lookAt(q),u.target.copy(q),u.update(),w.value.copy(x),b.value.copy(q)},getThreeJSObjects:()=>({scene:o,camera:l,renderer:c,controls:u,gizmo:d}),clearAllModels:()=>{if(!o)return;p.value.forEach(k=>{o.remove(k),B(k)});const N=[];o.children.forEach(k=>{!k.isLight&&!k.isCamera&&N.push(k)}),N.forEach(k=>{o.remove(k),B(k)}),p.value=[]},cleanup:()=>{_&&cancelAnimationFrame(_),c&&c.dispose(),u&&u.dispose(),d&&d.dispose()}}}function so(M,o){const l=e.ref(!1);let c=null,u=12700,d=new r.Vector3,_=new r.Vector3,p=new r.Vector3,w=0,b=null;const L=m=>m<.5?4*m*m*m:1-Math.pow(-2*m+2,3)/2,R=m=>{const S=new r.Vector3,E=w*1.2,j=new r.Vector3(p.x+E,p.y,p.z),N=new r.Vector3(p.x,p.y+E,p.z),k=new r.Vector3(p.x,p.y-E,p.z);if(m<=.567){const F=m/.567*Math.PI*2;S.x=p.x+Math.cos(F)*E,S.z=p.z+Math.sin(F)*E,S.y=p.y}else if(m<=.724){const g=(m-.567)/.157,F=L(g);S.lerpVectors(j,N,F)}else if(m<=.881){const g=(m-.724)/.157,A=L(g)*Math.PI;S.x=p.x+Math.sin(A)*E,S.y=p.y+Math.cos(A)*E,S.z=p.z}else{const g=(m-.881)/.119,F=L(g);S.lerpVectors(k,d,F)}return S},V=()=>{const{camera:m,controls:S}=M();if(!m||!S)return;c||(c=Date.now());const E=Date.now()-c,j=Math.min(E/u,1);if(j>=1){B();return}const N=R(j);m.position.copy(N),m.lookAt(p),S.target.copy(p),b=requestAnimationFrame(V)},T=()=>{if(o.value.length===0)return;const{camera:m,controls:S}=M();if(!m||!S)return;d.copy(m.position),_.copy(S.target);const E=new r.Box3;o.value.forEach(x=>{E.expandByObject(x)});const j=E.getSize(new r.Vector3);p=E.getCenter(new r.Vector3),w=Math.max(j.x,j.y,j.z)*1.2;const N=new r.Vector3(p.x+w*1.2,p.y,p.z);S.enabled=!1;const k=m.position.clone(),g=1e3,F=Date.now(),A=()=>{const x=Date.now()-F,q=Math.min(x/g,1),D=L(q);m.position.lerpVectors(k,N,D),m.lookAt(p),S.target.copy(p),q<1?requestAnimationFrame(A):(l.value=!0,c=null,V())};A()},B=()=>{l.value=!1,c=null,b&&(cancelAnimationFrame(b),b=null);const{controls:m}=M();m&&(m.enabled=!0,m.target.copy(_))};return{isAnimating:l,toggleAnimation:()=>{if(l.value){l.value=!1,c=null,b&&(cancelAnimationFrame(b),b=null);const{camera:m,controls:S}=M();if(!m||!S)return;S.enabled=!0;const E=m.position.clone(),j=S.target.clone(),N=1500,k=Date.now(),g=()=>{const F=Date.now()-k,A=Math.min(F/N,1),x=L(A);m.position.lerpVectors(E,d,x),S.target.lerpVectors(j,_,x),A<1&&requestAnimationFrame(g)};g()}else T()},startAnimation:T,stopAnimation:B}}function io(M,o){const l=e.ref(!1),c=e.ref("none");let u=[],d=[],_=new r.Box3,p=new r.Vector3;const w=()=>{u=[new r.Plane(new r.Vector3(1,0,0),0),new r.Plane(new r.Vector3(0,1,0),0),new r.Plane(new r.Vector3(0,0,1),0)]},b=()=>{_.makeEmpty(),o.value.forEach(v=>{_.expandByObject(v)}),p=_.getCenter(new r.Vector3)},L=v=>{const m=_.getSize(new r.Vector3);let S,E,j;v==="x"?(S=new r.PlaneGeometry(m.z*1.2,m.y*1.2),E=new r.Vector3(p.x,p.y,p.z),j=new r.Euler(0,Math.PI/2,0)):v==="y"?(S=new r.PlaneGeometry(m.x*1.2,m.z*1.2),E=new r.Vector3(p.x,p.y,p.z),j=new r.Euler(Math.PI/2,0,0)):v==="z"&&(S=new r.PlaneGeometry(m.x*1.2,m.y*1.2),E=new r.Vector3(p.x,p.y,p.z),j=new r.Euler(0,0,0));const N=new r.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:r.DoubleSide,depthWrite:!1}),k=new r.Mesh(S,N);return k.position.copy(E),k.rotation.copy(j),k},R=()=>{if(V(),T(),c.value==="none")return;b();let v=null;if(c.value==="x"?(u[0].constant=-p.x,v=u[0]):c.value==="y"?(u[1].constant=-p.y,v=u[1]):c.value==="z"&&(u[2].constant=-p.z,v=u[2]),v){o.value.forEach(S=>{S.traverse(E=>{E.isMesh&&E.material&&(Array.isArray(E.material)?E.material.forEach(j=>{j.clippingPlanes=[v]}):E.material.clippingPlanes=[v])})});const{scene:m}=M();if(m){const S=L(c.value);m.add(S),d.push(S)}}},V=()=>{o.value.forEach(v=>{v.traverse(m=>{m.isMesh&&m.material&&(Array.isArray(m.material)?m.material.forEach(S=>{S.clippingPlanes=[]}):m.material.clippingPlanes=[])})})},T=()=>{const{scene:v}=M();v&&d.forEach(m=>{v.remove(m),m.geometry.dispose(),m.material.dispose()}),d=[]};return{isClipping:l,activeClippingAxis:c,toggleClipping:()=>{l.value=!l.value,l.value?(w(),o.value.length>0&&b()):(c.value="none",V(),T())},updateClippingPlanes:R,clearClippingPlanes:V,clearClippingMeshes:T}}const ao=/^[og]\s*(.+)?/,ro=/^mtllib /,lo=/^usemtl /,co=/^usemap /,Qt=/\s+/,en=new r.Vector3,St=new r.Vector3,tn=new r.Vector3,nn=new r.Vector3,Ie=new r.Vector3,xt=new r.Color;function uo(){const M={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(o,l){if(this.object&&this.object.fromDeclaration===!1){this.object.name=o,this.object.fromDeclaration=l!==!1;return}const c=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:o||"",fromDeclaration:l!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(u,d){const _=this._finalize(!1);_&&(_.inherited||_.groupCount<=0)&&this.materials.splice(_.index,1);const p={index:this.materials.length,name:u||"",mtllib:Array.isArray(d)&&d.length>0?d[d.length-1]:"",smooth:_!==void 0?_.smooth:this.smooth,groupStart:_!==void 0?_.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(w){const b={index:typeof w=="number"?w:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return b.clone=this.clone.bind(b),b}};return this.materials.push(p),p},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(u){const d=this.currentMaterial();if(d&&d.groupEnd===-1&&(d.groupEnd=this.geometry.vertices.length/3,d.groupCount=d.groupEnd-d.groupStart,d.inherited=!1),u&&this.materials.length>1)for(let _=this.materials.length-1;_>=0;_--)this.materials[_].groupCount<=0&&this.materials.splice(_,1);return u&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),d}},c&&c.name&&typeof c.clone=="function"){const u=c.clone(0);u.inherited=!0,this.object.materials.push(u)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(o,l){const c=parseInt(o,10);return(c>=0?c-1:c+l/3)*3},parseNormalIndex:function(o,l){const c=parseInt(o,10);return(c>=0?c-1:c+l/3)*3},parseUVIndex:function(o,l){const c=parseInt(o,10);return(c>=0?c-1:c+l/2)*2},addVertex:function(o,l,c){const u=this.vertices,d=this.object.geometry.vertices;d.push(u[o+0],u[o+1],u[o+2]),d.push(u[l+0],u[l+1],u[l+2]),d.push(u[c+0],u[c+1],u[c+2])},addVertexPoint:function(o){const l=this.vertices;this.object.geometry.vertices.push(l[o+0],l[o+1],l[o+2])},addVertexLine:function(o){const l=this.vertices;this.object.geometry.vertices.push(l[o+0],l[o+1],l[o+2])},addNormal:function(o,l,c){const u=this.normals,d=this.object.geometry.normals;d.push(u[o+0],u[o+1],u[o+2]),d.push(u[l+0],u[l+1],u[l+2]),d.push(u[c+0],u[c+1],u[c+2])},addFaceNormal:function(o,l,c){const u=this.vertices,d=this.object.geometry.normals;en.fromArray(u,o),St.fromArray(u,l),tn.fromArray(u,c),Ie.subVectors(tn,St),nn.subVectors(en,St),Ie.cross(nn),Ie.normalize(),d.push(Ie.x,Ie.y,Ie.z),d.push(Ie.x,Ie.y,Ie.z),d.push(Ie.x,Ie.y,Ie.z)},addColor:function(o,l,c){const u=this.colors,d=this.object.geometry.colors;u[o]!==void 0&&d.push(u[o+0],u[o+1],u[o+2]),u[l]!==void 0&&d.push(u[l+0],u[l+1],u[l+2]),u[c]!==void 0&&d.push(u[c+0],u[c+1],u[c+2])},addUV:function(o,l,c){const u=this.uvs,d=this.object.geometry.uvs;d.push(u[o+0],u[o+1]),d.push(u[l+0],u[l+1]),d.push(u[c+0],u[c+1])},addDefaultUV:function(){const o=this.object.geometry.uvs;o.push(0,0),o.push(0,0),o.push(0,0)},addUVLine:function(o){const l=this.uvs;this.object.geometry.uvs.push(l[o+0],l[o+1])},addFace:function(o,l,c,u,d,_,p,w,b){const L=this.vertices.length;let R=this.parseVertexIndex(o,L),V=this.parseVertexIndex(l,L),T=this.parseVertexIndex(c,L);if(this.addVertex(R,V,T),this.addColor(R,V,T),p!==void 0&&p!==""){const B=this.normals.length;R=this.parseNormalIndex(p,B),V=this.parseNormalIndex(w,B),T=this.parseNormalIndex(b,B),this.addNormal(R,V,T)}else this.addFaceNormal(R,V,T);if(u!==void 0&&u!==""){const B=this.uvs.length;R=this.parseUVIndex(u,B),V=this.parseUVIndex(d,B),T=this.parseUVIndex(_,B),this.addUV(R,V,T),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(o){this.object.geometry.type="Points";const l=this.vertices.length;for(let c=0,u=o.length;c<u;c++){const d=this.parseVertexIndex(o[c],l);this.addVertexPoint(d),this.addColor(d)}},addLineGeometry:function(o,l){this.object.geometry.type="Line";const c=this.vertices.length,u=this.uvs.length;for(let d=0,_=o.length;d<_;d++)this.addVertexLine(this.parseVertexIndex(o[d],c));for(let d=0,_=l.length;d<_;d++)this.addUVLine(this.parseUVIndex(l[d],u))}};return M.startObject("",!1),M}class Pt extends r.Loader{constructor(o){super(o),this.materials=null}load(o,l,c,u){const d=this,_=new r.FileLoader(this.manager);_.setPath(this.path),_.setRequestHeader(this.requestHeader),_.setWithCredentials(this.withCredentials),_.load(o,function(p){try{l(d.parse(p))}catch(w){u?u(w):console.error(w),d.manager.itemError(o)}},c,u)}setMaterials(o){return this.materials=o,this}parse(o){const l=new uo;o.indexOf(`\r
2
+ `)!==-1&&(o=o.replace(/\r\n/g,`
3
+ `)),o.indexOf(`\\
4
+ `)!==-1&&(o=o.replace(/\\\n/g,""));const c=o.split(`
5
+ `);let u=[];for(let p=0,w=c.length;p<w;p++){const b=c[p].trimStart();if(b.length===0)continue;const L=b.charAt(0);if(L!=="#")if(L==="v"){const R=b.split(Qt);switch(R[0]){case"v":l.vertices.push(parseFloat(R[1]),parseFloat(R[2]),parseFloat(R[3])),R.length>=7?(xt.setRGB(parseFloat(R[4]),parseFloat(R[5]),parseFloat(R[6]),r.SRGBColorSpace),l.colors.push(xt.r,xt.g,xt.b)):l.colors.push(void 0,void 0,void 0);break;case"vn":l.normals.push(parseFloat(R[1]),parseFloat(R[2]),parseFloat(R[3]));break;case"vt":l.uvs.push(parseFloat(R[1]),parseFloat(R[2]));break}}else if(L==="f"){const V=b.slice(1).trim().split(Qt),T=[];for(let v=0,m=V.length;v<m;v++){const S=V[v];if(S.length>0){const E=S.split("/");T.push(E)}}const B=T[0];for(let v=1,m=T.length-1;v<m;v++){const S=T[v],E=T[v+1];l.addFace(B[0],S[0],E[0],B[1],S[1],E[1],B[2],S[2],E[2])}}else if(L==="l"){const R=b.substring(1).trim().split(" ");let V=[];const T=[];if(b.indexOf("/")===-1)V=R;else for(let B=0,v=R.length;B<v;B++){const m=R[B].split("/");m[0]!==""&&V.push(m[0]),m[1]!==""&&T.push(m[1])}l.addLineGeometry(V,T)}else if(L==="p"){const V=b.slice(1).trim().split(" ");l.addPointGeometry(V)}else if((u=ao.exec(b))!==null){const R=(" "+u[0].slice(1).trim()).slice(1);l.startObject(R)}else if(lo.test(b))l.object.startMaterial(b.substring(7).trim(),l.materialLibraries);else if(ro.test(b))l.materialLibraries.push(b.substring(7).trim());else if(co.test(b))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(L==="s"){if(u=b.split(" "),u.length>1){const V=u[1].trim().toLowerCase();l.object.smooth=V!=="0"&&V!=="off"}else l.object.smooth=!0;const R=l.object.currentMaterial();R&&(R.smooth=l.object.smooth)}else{if(b==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+b+'"')}}l.finalize();const d=new r.Group;if(d.materialLibraries=[].concat(l.materialLibraries),!(l.objects.length===1&&l.objects[0].geometry.vertices.length===0)===!0)for(let p=0,w=l.objects.length;p<w;p++){const b=l.objects[p],L=b.geometry,R=b.materials,V=L.type==="Line",T=L.type==="Points";let B=!1;if(L.vertices.length===0)continue;const v=new r.BufferGeometry;v.setAttribute("position",new r.Float32BufferAttribute(L.vertices,3)),L.normals.length>0&&v.setAttribute("normal",new r.Float32BufferAttribute(L.normals,3)),L.colors.length>0&&(B=!0,v.setAttribute("color",new r.Float32BufferAttribute(L.colors,3))),L.hasUVIndices===!0&&v.setAttribute("uv",new r.Float32BufferAttribute(L.uvs,2));const m=[];for(let E=0,j=R.length;E<j;E++){const N=R[E],k=N.name+"_"+N.smooth+"_"+B;let g=l.materials[k];if(this.materials!==null){if(g=this.materials.create(N.name),V&&g&&!(g instanceof r.LineBasicMaterial)){const F=new r.LineBasicMaterial;r.Material.prototype.copy.call(F,g),F.color.copy(g.color),g=F}else if(T&&g&&!(g instanceof r.PointsMaterial)){const F=new r.PointsMaterial({size:10,sizeAttenuation:!1});r.Material.prototype.copy.call(F,g),F.color.copy(g.color),F.map=g.map,g=F}}g===void 0&&(V?g=new r.LineBasicMaterial:T?g=new r.PointsMaterial({size:1,sizeAttenuation:!1}):g=new r.MeshPhongMaterial,g.name=N.name,g.flatShading=!N.smooth,g.vertexColors=B,l.materials[k]=g),m.push(g)}let S;if(m.length>1){for(let E=0,j=R.length;E<j;E++){const N=R[E];v.addGroup(N.groupStart,N.groupCount,E)}V?S=new r.LineSegments(v,m):T?S=new r.Points(v,m):S=new r.Mesh(v,m)}else V?S=new r.LineSegments(v,m[0]):T?S=new r.Points(v,m[0]):S=new r.Mesh(v,m[0]);S.name=b.name,d.add(S)}else if(l.vertices.length>0){const p=new r.PointsMaterial({size:1,sizeAttenuation:!1}),w=new r.BufferGeometry;w.setAttribute("position",new r.Float32BufferAttribute(l.vertices,3)),l.colors.length>0&&l.colors[0]!==void 0&&(w.setAttribute("color",new r.Float32BufferAttribute(l.colors,3)),p.vertexColors=!0);const b=new r.Points(w,p);d.add(b)}return d}}class Lt extends r.Loader{constructor(o){super(o)}load(o,l,c,u){const d=this,_=this.path===""?r.LoaderUtils.extractUrlBase(o):this.path,p=new r.FileLoader(this.manager);p.setPath(this.path),p.setRequestHeader(this.requestHeader),p.setWithCredentials(this.withCredentials),p.load(o,function(w){try{l(d.parse(w,_))}catch(b){u?u(b):console.error(b),d.manager.itemError(o)}},c,u)}setMaterialOptions(o){return this.materialOptions=o,this}parse(o,l){const c=o.split(`
6
+ `);let u={};const d=/\s+/,_={};for(let w=0;w<c.length;w++){let b=c[w];if(b=b.trim(),b.length===0||b.charAt(0)==="#")continue;const L=b.indexOf(" ");let R=L>=0?b.substring(0,L):b;R=R.toLowerCase();let V=L>=0?b.substring(L+1):"";if(V=V.trim(),R==="newmtl")u={name:V},_[V]=u;else if(R==="ka"||R==="kd"||R==="ks"||R==="ke"){const T=V.split(d,3);u[R]=[parseFloat(T[0]),parseFloat(T[1]),parseFloat(T[2])]}else u[R]=V}const p=new ho(this.resourcePath||l,this.materialOptions);return p.setCrossOrigin(this.crossOrigin),p.setManager(this.manager),p.setMaterials(_),p}}class ho{constructor(o="",l={}){this.baseUrl=o,this.options=l,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:r.FrontSide,this.wrap=this.options.wrap!==void 0?this.options.wrap:r.RepeatWrapping}setCrossOrigin(o){return this.crossOrigin=o,this}setManager(o){this.manager=o}setMaterials(o){this.materialsInfo=this.convert(o),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(o){if(!this.options)return o;const l={};for(const c in o){const u=o[c],d={};l[c]=d;for(const _ in u){let p=!0,w=u[_];const b=_.toLowerCase();switch(b){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(w=[w[0]/255,w[1]/255,w[2]/255]),this.options&&this.options.ignoreZeroRGBs&&w[0]===0&&w[1]===0&&w[2]===0&&(p=!1);break}p&&(d[b]=w)}}return l}preload(){for(const o in this.materialsInfo)this.create(o)}getIndex(o){return this.nameLookup[o]}getAsArray(){let o=0;for(const l in this.materialsInfo)this.materialsArray[o]=this.create(l),this.nameLookup[l]=o,o++;return this.materialsArray}create(o){return this.materials[o]===void 0&&this.createMaterial_(o),this.materials[o]}createMaterial_(o){const l=this,c=this.materialsInfo[o],u={name:o,side:this.side};function d(p,w){return typeof w!="string"||w===""?"":/^https?:\/\//i.test(w)?w:p+w}function _(p,w){if(u[p])return;const b=l.getTextureParams(w,u),L=l.loadTexture(d(l.baseUrl,b.url));L.repeat.copy(b.scale),L.offset.copy(b.offset),L.wrapS=l.wrap,L.wrapT=l.wrap,(p==="map"||p==="emissiveMap")&&(L.colorSpace=r.SRGBColorSpace),u[p]=L}for(const p in c){const w=c[p];let b;if(w!=="")switch(p.toLowerCase()){case"kd":u.color=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(w),r.SRGBColorSpace);break;case"ks":u.specular=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(w),r.SRGBColorSpace);break;case"ke":u.emissive=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(w),r.SRGBColorSpace);break;case"map_kd":_("map",w);break;case"map_ks":_("specularMap",w);break;case"map_ke":_("emissiveMap",w);break;case"norm":_("normalMap",w);break;case"map_bump":case"bump":_("bumpMap",w);break;case"disp":_("displacementMap",w);break;case"map_d":_("alphaMap",w),u.transparent=!0;break;case"ns":u.shininess=parseFloat(w);break;case"d":b=parseFloat(w),b<1&&(u.opacity=b,u.transparent=!0);break;case"tr":b=parseFloat(w),this.options&&this.options.invertTrProperty&&(b=1-b),b>0&&(u.opacity=1-b,u.transparent=!0);break}}return this.materials[o]=new r.MeshPhongMaterial(u),this.materials[o]}getTextureParams(o,l){const c={scale:new r.Vector2(1,1),offset:new r.Vector2(0,0)},u=o.split(/\s+/);let d;return d=u.indexOf("-bm"),d>=0&&(l.bumpScale=parseFloat(u[d+1]),u.splice(d,2)),d=u.indexOf("-mm"),d>=0&&(l.displacementBias=parseFloat(u[d+1]),l.displacementScale=parseFloat(u[d+2]),u.splice(d,3)),d=u.indexOf("-s"),d>=0&&(c.scale.set(parseFloat(u[d+1]),parseFloat(u[d+2])),u.splice(d,4)),d=u.indexOf("-o"),d>=0&&(c.offset.set(parseFloat(u[d+1]),parseFloat(u[d+2])),u.splice(d,4)),c.url=u.join(" ").trim(),c}loadTexture(o,l,c,u,d){const _=this.manager!==void 0?this.manager:r.DefaultLoadingManager;let p=_.getHandler(o);p===null&&(p=new r.TextureLoader(_)),p.setCrossOrigin&&p.setCrossOrigin(this.crossOrigin);const w=p.load(o,c,u,d);return l!==void 0&&(w.mapping=l),w}}class Et extends r.Loader{constructor(o){super(o)}load(o,l,c,u){const d=this,_=new r.FileLoader(this.manager);_.setPath(this.path),_.setResponseType("arraybuffer"),_.setRequestHeader(this.requestHeader),_.setWithCredentials(this.withCredentials),_.load(o,function(p){try{l(d.parse(p))}catch(w){u?u(w):console.error(w),d.manager.itemError(o)}},c,u)}parse(o){function l(b){const L=new DataView(b),R=32/8*3+32/8*3*3+16/8,V=L.getUint32(80,!0);if(80+32/8+V*R===L.byteLength)return!0;const B=[115,111,108,105,100];for(let v=0;v<5;v++)if(c(B,L,v))return!1;return!0}function c(b,L,R){for(let V=0,T=b.length;V<T;V++)if(b[V]!==L.getUint8(R+V))return!1;return!0}function u(b){const L=new DataView(b),R=L.getUint32(80,!0);let V,T,B,v=!1,m,S,E,j,N;for(let D=0;D<70;D++)L.getUint32(D,!1)==1129270351&&L.getUint8(D+4)==82&&L.getUint8(D+5)==61&&(v=!0,m=new Float32Array(R*3*3),S=L.getUint8(D+6)/255,E=L.getUint8(D+7)/255,j=L.getUint8(D+8)/255,N=L.getUint8(D+9)/255);const k=84,g=12*4+2,F=new r.BufferGeometry,A=new Float32Array(R*3*3),x=new Float32Array(R*3*3),q=new r.Color;for(let D=0;D<R;D++){const U=k+D*g,se=L.getFloat32(U,!0),ce=L.getFloat32(U+4,!0),y=L.getFloat32(U+8,!0);if(v){const h=L.getUint16(U+48,!0);(h&32768)===0?(V=(h&31)/31,T=(h>>5&31)/31,B=(h>>10&31)/31):(V=S,T=E,B=j)}for(let h=1;h<=3;h++){const I=U+h*12,Y=D*3*3+(h-1)*3;A[Y]=L.getFloat32(I,!0),A[Y+1]=L.getFloat32(I+4,!0),A[Y+2]=L.getFloat32(I+8,!0),x[Y]=se,x[Y+1]=ce,x[Y+2]=y,v&&(q.setRGB(V,T,B,r.SRGBColorSpace),m[Y]=q.r,m[Y+1]=q.g,m[Y+2]=q.b)}}return F.setAttribute("position",new r.BufferAttribute(A,3)),F.setAttribute("normal",new r.BufferAttribute(x,3)),v&&(F.setAttribute("color",new r.BufferAttribute(m,3)),F.hasColors=!0,F.alpha=N),F}function d(b){const L=new r.BufferGeometry,R=/solid([\s\S]*?)endsolid/g,V=/facet([\s\S]*?)endfacet/g,T=/solid\s(.+)/;let B=0;const v=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,m=new RegExp("vertex"+v+v+v,"g"),S=new RegExp("normal"+v+v+v,"g"),E=[],j=[],N=[],k=new r.Vector3;let g,F=0,A=0,x=0;for(;(g=R.exec(b))!==null;){A=x;const q=g[0],D=(g=T.exec(q))!==null?g[1]:"";for(N.push(D);(g=V.exec(q))!==null;){let ce=0,y=0;const h=g[0];for(;(g=S.exec(h))!==null;)k.x=parseFloat(g[1]),k.y=parseFloat(g[2]),k.z=parseFloat(g[3]),y++;for(;(g=m.exec(h))!==null;)E.push(parseFloat(g[1]),parseFloat(g[2]),parseFloat(g[3])),j.push(k.x,k.y,k.z),ce++,x++;y!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+B),ce!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+B),B++}const U=A,se=x-A;L.userData.groupNames=N,L.addGroup(U,se,F),F++}return L.setAttribute("position",new r.Float32BufferAttribute(E,3)),L.setAttribute("normal",new r.Float32BufferAttribute(j,3)),L}function _(b){return typeof b!="string"?new TextDecoder().decode(b):b}function p(b){if(typeof b=="string"){const L=new Uint8Array(b.length);for(let R=0;R<b.length;R++)L[R]=b.charCodeAt(R)&255;return L.buffer||L}else return b}const w=p(o);return l(w)?u(w):d(_(o))}}class on extends r.DataTextureLoader{constructor(o){super(o)}parse(o){function l(h){switch(h.image_type){case V:case v:if(h.colormap_length>256||h.colormap_size!==24||h.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case T:case B:case m:case S:if(h.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case R:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+h.image_type)}if(h.width<=0||h.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(h.pixel_size!==8&&h.pixel_size!==16&&h.pixel_size!==24&&h.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+h.pixel_size)}function c(h,I,Y,H,re){let $,ie;const Z=Y.pixel_size>>3,O=Y.width*Y.height*Z;if(I&&(ie=re.subarray(H,H+=Y.colormap_length*(Y.colormap_size>>3))),h){$=new Uint8Array(O);let W,G,X,ue=0;const he=new Uint8Array(Z);for(;ue<O;)if(W=re[H++],G=(W&127)+1,W&128){for(X=0;X<Z;++X)he[X]=re[H++];for(X=0;X<G;++X)$.set(he,ue+X*Z);ue+=Z*G}else{for(G*=Z,X=0;X<G;++X)$[ue+X]=re[H++];ue+=G}}else $=re.subarray(H,H+=I?Y.width*Y.height:O);return{pixel_data:$,palettes:ie}}function u(h,I,Y,H,re,$,ie,Z,O){const W=O;let G,X=0,ue,he;const le=q.width;for(he=I;he!==H;he+=Y)for(ue=re;ue!==ie;ue+=$,X++)G=Z[X],h[(ue+le*he)*4+3]=255,h[(ue+le*he)*4+2]=W[G*3+0],h[(ue+le*he)*4+1]=W[G*3+1],h[(ue+le*he)*4+0]=W[G*3+2];return h}function d(h,I,Y,H,re,$,ie,Z){let O,W=0,G,X;const ue=q.width;for(X=I;X!==H;X+=Y)for(G=re;G!==ie;G+=$,W+=2)O=Z[W+0]+(Z[W+1]<<8),h[(G+ue*X)*4+0]=(O&31744)>>7,h[(G+ue*X)*4+1]=(O&992)>>2,h[(G+ue*X)*4+2]=(O&31)<<3,h[(G+ue*X)*4+3]=O&32768?0:255;return h}function _(h,I,Y,H,re,$,ie,Z){let O=0,W,G;const X=q.width;for(G=I;G!==H;G+=Y)for(W=re;W!==ie;W+=$,O+=3)h[(W+X*G)*4+3]=255,h[(W+X*G)*4+2]=Z[O+0],h[(W+X*G)*4+1]=Z[O+1],h[(W+X*G)*4+0]=Z[O+2];return h}function p(h,I,Y,H,re,$,ie,Z){let O=0,W,G;const X=q.width;for(G=I;G!==H;G+=Y)for(W=re;W!==ie;W+=$,O+=4)h[(W+X*G)*4+2]=Z[O+0],h[(W+X*G)*4+1]=Z[O+1],h[(W+X*G)*4+0]=Z[O+2],h[(W+X*G)*4+3]=Z[O+3];return h}function w(h,I,Y,H,re,$,ie,Z){let O,W=0,G,X;const ue=q.width;for(X=I;X!==H;X+=Y)for(G=re;G!==ie;G+=$,W++)O=Z[W],h[(G+ue*X)*4+0]=O,h[(G+ue*X)*4+1]=O,h[(G+ue*X)*4+2]=O,h[(G+ue*X)*4+3]=255;return h}function b(h,I,Y,H,re,$,ie,Z){let O=0,W,G;const X=q.width;for(G=I;G!==H;G+=Y)for(W=re;W!==ie;W+=$,O+=2)h[(W+X*G)*4+0]=Z[O+0],h[(W+X*G)*4+1]=Z[O+0],h[(W+X*G)*4+2]=Z[O+0],h[(W+X*G)*4+3]=Z[O+1];return h}function L(h,I,Y,H,re){let $,ie,Z,O,W,G;switch((q.flags&E)>>j){default:case g:$=0,Z=1,W=I,ie=0,O=1,G=Y;break;case N:$=0,Z=1,W=I,ie=Y-1,O=-1,G=-1;break;case F:$=I-1,Z=-1,W=-1,ie=0,O=1,G=Y;break;case k:$=I-1,Z=-1,W=-1,ie=Y-1,O=-1,G=-1;break}if(se)switch(q.pixel_size){case 8:w(h,ie,O,G,$,Z,W,H);break;case 16:b(h,ie,O,G,$,Z,W,H);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(q.pixel_size){case 8:u(h,ie,O,G,$,Z,W,H,re);break;case 16:d(h,ie,O,G,$,Z,W,H);break;case 24:_(h,ie,O,G,$,Z,W,H);break;case 32:p(h,ie,O,G,$,Z,W,H);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return h}const R=0,V=1,T=2,B=3,v=9,m=10,S=11,E=48,j=4,N=0,k=1,g=2,F=3;if(o.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let A=0;const x=new Uint8Array(o),q={id_length:x[A++],colormap_type:x[A++],image_type:x[A++],colormap_index:x[A++]|x[A++]<<8,colormap_length:x[A++]|x[A++]<<8,colormap_size:x[A++],origin:[x[A++]|x[A++]<<8,x[A++]|x[A++]<<8],width:x[A++]|x[A++]<<8,height:x[A++]|x[A++]<<8,pixel_size:x[A++],flags:x[A++]};if(l(q),q.id_length+A>o.length)throw new Error("THREE.TGALoader: No data.");A+=q.id_length;let D=!1,U=!1,se=!1;switch(q.image_type){case v:D=!0,U=!0;break;case V:U=!0;break;case m:D=!0;break;case T:break;case S:D=!0,se=!0;break;case B:se=!0;break}const ce=new Uint8Array(q.width*q.height*4),y=c(D,U,q,A,x);return L(ce,q.width,q.height,y.pixel_data,y.palettes),{data:ce,width:q.width,height:q.height,flipY:!0,generateMipmaps:!0,minFilter:r.LinearMipmapLinearFilter}}}class po extends r.Loader{load(o,l,c,u){const d=this,_=d.path===""?r.LoaderUtils.extractUrlBase(o):d.path,p=new r.FileLoader(d.manager);p.setPath(d.path),p.setRequestHeader(d.requestHeader),p.setWithCredentials(d.withCredentials),p.load(o,function(w){try{l(d.parse(w,_))}catch(b){u?u(b):console.error(b),d.manager.itemError(o)}},c,u)}parse(o,l){function c(n,t){const i=[],s=n.childNodes;for(let a=0,f=s.length;a<f;a++){const C=s[a];C.nodeName===t&&i.push(C)}return i}function u(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),i=new Array(t.length);for(let s=0,a=t.length;s<a;s++)i[s]=t[s];return i}function d(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),i=new Array(t.length);for(let s=0,a=t.length;s<a;s++)i[s]=parseFloat(t[s]);return i}function _(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),i=new Array(t.length);for(let s=0,a=t.length;s<a;s++)i[s]=parseInt(t[s]);return i}function p(n){return n.substring(1)}function w(){return"three_default_"+On++}function b(n){return Object.keys(n).length===0}function L(n){return{unit:R(c(n,"unit")[0]),upAxis:V(c(n,"up_axis")[0])}}function R(n){return n!==void 0&&n.hasAttribute("meter")===!0?parseFloat(n.getAttribute("meter")):1}function V(n){return n!==void 0?n.textContent:"Y_UP"}function T(n,t,i,s){const a=c(n,t)[0];if(a!==void 0){const f=c(a,i);for(let C=0;C<f.length;C++)s(f[C])}}function B(n,t){for(const i in n){const s=n[i];s.build=t(n[i])}}function v(n,t){return n.build!==void 0||(n.build=t(n)),n.build}function m(n){const t={sources:{},samplers:{},channels:{}};let i=!1;for(let s=0,a=n.childNodes.length;s<a;s++){const f=n.childNodes[s];if(f.nodeType!==1)continue;let C;switch(f.nodeName){case"source":C=f.getAttribute("id"),t.sources[C]=qe(f);break;case"sampler":C=f.getAttribute("id"),t.samplers[C]=S(f);break;case"channel":C=f.getAttribute("target"),t.channels[C]=E(f);break;case"animation":m(f),i=!0;break;default:console.log(f)}}i===!1&&(ae.animations[n.getAttribute("id")||r.MathUtils.generateUUID()]=t)}function S(n){const t={inputs:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=p(a.getAttribute("source")),C=a.getAttribute("semantic");t.inputs[C]=f;break}}return t}function E(n){const t={};let s=n.getAttribute("target").split("/");const a=s.shift();let f=s.shift();const C=f.indexOf("(")!==-1,J=f.indexOf(".")!==-1;if(J)s=f.split("."),f=s.shift(),t.member=s.shift();else if(C){const z=f.split("(");f=z.shift();for(let K=0;K<z.length;K++)z[K]=parseInt(z[K].replace(/\)/,""));t.indices=z}return t.id=a,t.sid=f,t.arraySyntax=C,t.memberSyntax=J,t.sampler=p(n.getAttribute("source")),t}function j(n){const t=[],i=n.channels,s=n.samplers,a=n.sources;for(const f in i)if(i.hasOwnProperty(f)){const C=i[f],J=s[C.sampler],z=J.inputs.INPUT,K=J.inputs.OUTPUT,te=a[z],P=a[K],ee=k(C,te,P);q(ee,t)}return t}function N(n){return v(ae.animations[n],j)}function k(n,t,i){const s=ae.nodes[n.id],a=ut(s.id),f=s.transforms[n.sid],C=s.matrix.clone().transpose();let J,z,K,te,P,ee;const Q={};switch(f){case"matrix":for(K=0,te=t.array.length;K<te;K++)if(J=t.array[K],z=K*i.stride,Q[J]===void 0&&(Q[J]={}),n.arraySyntax===!0){const xe=i.array[z],ye=n.indices[0]+4*n.indices[1];Q[J][ye]=xe}else for(P=0,ee=i.stride;P<ee;P++)Q[J][P]=i.array[z+P];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',f);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',f);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',f);break}const oe=g(Q,C);return{name:a.uuid,keyframes:oe}}function g(n,t){const i=[];for(const a in n)i.push({time:parseFloat(a),value:n[a]});i.sort(s);for(let a=0;a<16;a++)D(i,a,t.elements[a]);return i;function s(a,f){return a.time-f.time}}const F=new r.Vector3,A=new r.Vector3,x=new r.Quaternion;function q(n,t){const i=n.keyframes,s=n.name,a=[],f=[],C=[],J=[];for(let z=0,K=i.length;z<K;z++){const te=i[z],P=te.time,ee=te.value;De.fromArray(ee).transpose(),De.decompose(F,x,A),a.push(P),f.push(F.x,F.y,F.z),C.push(x.x,x.y,x.z,x.w),J.push(A.x,A.y,A.z)}return f.length>0&&t.push(new r.VectorKeyframeTrack(s+".position",a,f)),C.length>0&&t.push(new r.QuaternionKeyframeTrack(s+".quaternion",a,C)),J.length>0&&t.push(new r.VectorKeyframeTrack(s+".scale",a,J)),t}function D(n,t,i){let s,a=!0,f,C;for(f=0,C=n.length;f<C;f++)s=n[f],s.value[t]===void 0?s.value[t]=null:a=!1;if(a===!0)for(f=0,C=n.length;f<C;f++)s=n[f],s.value[t]=i;else U(n,t)}function U(n,t){let i,s;for(let a=0,f=n.length;a<f;a++){const C=n[a];if(C.value[t]===null){if(i=se(n,a,t),s=ce(n,a,t),i===null){C.value[t]=s.value[t];continue}if(s===null){C.value[t]=i.value[t];continue}y(C,i,s,t)}}}function se(n,t,i){for(;t>=0;){const s=n[t];if(s.value[i]!==null)return s;t--}return null}function ce(n,t,i){for(;t<n.length;){const s=n[t];if(s.value[i]!==null)return s;t++}return null}function y(n,t,i,s){if(i.time-t.time===0){n.value[s]=t.value[s];return}n.value[s]=(n.time-t.time)*(i.value[s]-t.value[s])/(i.time-t.time)+t.value[s]}function h(n){const t={name:n.getAttribute("id")||"default",start:parseFloat(n.getAttribute("start")||0),end:parseFloat(n.getAttribute("end")||0),animations:[]};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"instance_animation":t.animations.push(p(a.getAttribute("url")));break}}ae.clips[n.getAttribute("id")]=t}function I(n){const t=[],i=n.name,s=n.end-n.start||-1,a=n.animations;for(let f=0,C=a.length;f<C;f++){const J=N(a[f]);for(let z=0,K=J.length;z<K;z++)t.push(J[z])}return new r.AnimationClip(i,s,t)}function Y(n){return v(ae.clips[n],I)}function H(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"skin":t.id=p(a.getAttribute("source")),t.skin=re(a);break;case"morph":t.id=p(a.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}ae.controllers[n.getAttribute("id")]=t}function re(n){const t={sources:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"bind_shape_matrix":t.bindShapeMatrix=d(a.textContent);break;case"source":const f=a.getAttribute("id");t.sources[f]=qe(a);break;case"joints":t.joints=$(a);break;case"vertex_weights":t.vertexWeights=ie(a);break}}return t}function $(n){const t={inputs:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=a.getAttribute("semantic"),C=p(a.getAttribute("source"));t.inputs[f]=C;break}}return t}function ie(n){const t={inputs:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=a.getAttribute("semantic"),C=p(a.getAttribute("source")),J=parseInt(a.getAttribute("offset"));t.inputs[f]={id:C,offset:J};break;case"vcount":t.vcount=_(a.textContent);break;case"v":t.v=_(a.textContent);break}}return t}function Z(n){const t={id:n.id},i=ae.geometries[t.id];return n.skin!==void 0&&(t.skin=O(n.skin),i.sources.skinIndices=t.skin.indices,i.sources.skinWeights=t.skin.weights),t}function O(n){const i={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},s=n.sources,a=n.vertexWeights,f=a.vcount,C=a.v,J=a.inputs.JOINT.offset,z=a.inputs.WEIGHT.offset,K=n.sources[n.joints.inputs.JOINT],te=n.sources[n.joints.inputs.INV_BIND_MATRIX],P=s[a.inputs.WEIGHT.id].array;let ee=0,Q,oe,ne;for(Q=0,ne=f.length;Q<ne;Q++){const ye=f[Q],pe=[];for(oe=0;oe<ye;oe++){const fe=C[ee+J],Ke=C[ee+z],Le=P[Ke];pe.push({index:fe,weight:Le}),ee+=2}for(pe.sort(xe),oe=0;oe<4;oe++){const fe=pe[oe];fe!==void 0?(i.indices.array.push(fe.index),i.weights.array.push(fe.weight)):(i.indices.array.push(0),i.weights.array.push(0))}}for(n.bindShapeMatrix?i.bindMatrix=new r.Matrix4().fromArray(n.bindShapeMatrix).transpose():i.bindMatrix=new r.Matrix4().identity(),Q=0,ne=K.array.length;Q<ne;Q++){const ye=K.array[Q],pe=new r.Matrix4().fromArray(te.array,Q*te.stride).transpose();i.joints.push({name:ye,boneInverse:pe})}return i;function xe(ye,pe){return pe.weight-ye.weight}}function W(n){return v(ae.controllers[n],Z)}function G(n){const t={init_from:c(n,"init_from")[0].textContent};ae.images[n.getAttribute("id")]=t}function X(n){return n.build!==void 0?n.build:n.init_from}function ue(n){const t=ae.images[n];return t!==void 0?v(t,X):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",n),null)}function he(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"profile_COMMON":t.profile=le(a);break}}ae.effects[n.getAttribute("id")]=t}function le(n){const t={surfaces:{},samplers:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"newparam":Se(a,t);break;case"technique":t.technique=et(a);break;case"extra":t.extra=at(a);break}}return t}function Se(n,t){const i=n.getAttribute("sid");for(let s=0,a=n.childNodes.length;s<a;s++){const f=n.childNodes[s];if(f.nodeType===1)switch(f.nodeName){case"surface":t.surfaces[i]=Pe(f);break;case"sampler2D":t.samplers[i]=Fe(f);break}}}function Pe(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"init_from":t.init_from=a.textContent;break}}return t}function Fe(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"source":t.source=a.textContent;break}}return t}function et(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"constant":case"lambert":case"blinn":case"phong":t.type=a.nodeName,t.parameters=tt(a);break;case"extra":t.extra=at(a);break}}return t}function tt(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":t[a.nodeName]=Be(a);break;case"transparent":t[a.nodeName]={opaque:a.hasAttribute("opaque")?a.getAttribute("opaque"):"A_ONE",data:Be(a)};break}}return t}function Be(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"color":t[a.nodeName]=d(a.textContent);break;case"float":t[a.nodeName]=parseFloat(a.textContent);break;case"texture":t[a.nodeName]={id:a.getAttribute("texture"),extra:ve(a)};break}}return t}function ve(n){const t={technique:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"extra":ze(a,t);break}}return t}function ze(n,t){for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"technique":_e(a,t);break}}}function _e(n,t){for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":t.technique[a.nodeName]=parseFloat(a.textContent);break;case"wrapU":case"wrapV":a.textContent.toUpperCase()==="TRUE"?t.technique[a.nodeName]=1:a.textContent.toUpperCase()==="FALSE"?t.technique[a.nodeName]=0:t.technique[a.nodeName]=parseInt(a.textContent);break;case"bump":t[a.nodeName]=je(a);break}}}function at(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"technique":t.technique=rt(a);break}}return t}function rt(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"double_sided":t[a.nodeName]=parseInt(a.textContent);break;case"bump":t[a.nodeName]=je(a);break}}return t}function je(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"texture":t[a.nodeName]={id:a.getAttribute("texture"),texcoord:a.getAttribute("texcoord"),extra:ve(a)};break}}return t}function me(n){return n}function lt(n){return v(ae.effects[n],me)}function ft(n){const t={name:n.getAttribute("name")};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"instance_effect":t.url=p(a.getAttribute("url"));break}}ae.materials[n.getAttribute("id")]=t}function Ee(n){let t,i=n.slice((n.lastIndexOf(".")-1>>>0)+2);switch(i=i.toLowerCase(),i){case"tga":t=At;break;default:t=Kt}return t}function Ze(n){const t=lt(n.url),i=t.profile.technique;let s;switch(i.type){case"phong":case"blinn":s=new r.MeshPhongMaterial;break;case"lambert":s=new r.MeshLambertMaterial;break;default:s=new r.MeshBasicMaterial;break}s.name=n.name||"";function a(z,K=null){const te=t.profile.samplers[z.id];let P=null;if(te!==void 0){const ee=t.profile.surfaces[te.source];P=ue(ee.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),P=ue(z.id);if(P!==null){const ee=Ee(P);if(ee!==void 0){const Q=ee.load(P),oe=z.extra;if(oe!==void 0&&oe.technique!==void 0&&b(oe.technique)===!1){const ne=oe.technique;Q.wrapS=ne.wrapU?r.RepeatWrapping:r.ClampToEdgeWrapping,Q.wrapT=ne.wrapV?r.RepeatWrapping:r.ClampToEdgeWrapping,Q.offset.set(ne.offsetU||0,ne.offsetV||0),Q.repeat.set(ne.repeatU||1,ne.repeatV||1)}else Q.wrapS=r.RepeatWrapping,Q.wrapT=r.RepeatWrapping;return K!==null&&(Q.colorSpace=K),Q}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",P),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",z.id),null}const f=i.parameters;for(const z in f){const K=f[z];switch(z){case"diffuse":K.color&&s.color.fromArray(K.color),K.texture&&(s.map=a(K.texture,r.SRGBColorSpace));break;case"specular":K.color&&s.specular&&s.specular.fromArray(K.color),K.texture&&(s.specularMap=a(K.texture));break;case"bump":K.texture&&(s.normalMap=a(K.texture));break;case"ambient":K.texture&&(s.lightMap=a(K.texture,r.SRGBColorSpace));break;case"shininess":K.float&&s.shininess&&(s.shininess=K.float);break;case"emission":K.color&&s.emissive&&s.emissive.fromArray(K.color),K.texture&&(s.emissiveMap=a(K.texture,r.SRGBColorSpace));break}}r.ColorManagement.colorSpaceToWorking(s.color,r.SRGBColorSpace),s.specular&&r.ColorManagement.colorSpaceToWorking(s.specular,r.SRGBColorSpace),s.emissive&&r.ColorManagement.colorSpaceToWorking(s.emissive,r.SRGBColorSpace);let C=f.transparent,J=f.transparency;if(J===void 0&&C&&(J={float:1}),C===void 0&&J&&(C={opaque:"A_ONE",data:{color:[1,1,1,1]}}),C&&J)if(C.data.texture)s.transparent=!0;else{const z=C.data.color;switch(C.opaque){case"A_ONE":s.opacity=z[3]*J.float;break;case"RGB_ZERO":s.opacity=1-z[0]*J.float;break;case"A_ZERO":s.opacity=1-z[3]*J.float;break;case"RGB_ONE":s.opacity=z[0]*J.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',C.opaque)}s.opacity<1&&(s.transparent=!0)}if(i.extra!==void 0&&i.extra.technique!==void 0){const z=i.extra.technique;for(const K in z){const te=z[K];switch(K){case"double_sided":s.side=te===1?r.DoubleSide:r.FrontSide;break;case"bump":s.normalMap=a(te.texture),s.normalScale=new r.Vector2(1,1);break}}}return s}function mt(n){return v(ae.materials[n],Ze)}function gt(n){const t={name:n.getAttribute("name")};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"optics":t.optics=yt(a);break}}ae.cameras[n.getAttribute("id")]=t}function yt(n){for(let t=0;t<n.childNodes.length;t++){const i=n.childNodes[t];switch(i.nodeName){case"technique_common":return bt(i)}}return{}}function bt(n){const t={};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];switch(s.nodeName){case"perspective":case"orthographic":t.technique=s.nodeName,t.parameters=wt(s);break}}return t}function wt(n){const t={};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];switch(s.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":t[s.nodeName]=parseFloat(s.textContent);break}}return t}function ge(n){let t;switch(n.optics.technique){case"perspective":t=new r.PerspectiveCamera(n.optics.parameters.yfov,n.optics.parameters.aspect_ratio,n.optics.parameters.znear,n.optics.parameters.zfar);break;case"orthographic":let i=n.optics.parameters.ymag,s=n.optics.parameters.xmag;const a=n.optics.parameters.aspect_ratio;s=s===void 0?i*a:s,i=i===void 0?s/a:i,s*=.5,i*=.5,t=new r.OrthographicCamera(-s,s,i,-i,n.optics.parameters.znear,n.optics.parameters.zfar);break;default:t=new r.PerspectiveCamera;break}return t.name=n.name||"",t}function Ce(n){const t=ae.cameras[n];return t!==void 0?v(t,ge):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",n),null)}function Oe(n){let t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"technique_common":t=Ae(a);break}}ae.lights[n.getAttribute("id")]=t}function Ae(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"directional":case"point":case"spot":case"ambient":t.technique=a.nodeName,t.parameters=ke(a)}}return t}function ke(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"color":const f=d(a.textContent);t.color=new r.Color().fromArray(f),r.ColorManagement.colorSpaceToWorking(t.color,r.SRGBColorSpace);break;case"falloff_angle":t.falloffAngle=parseFloat(a.textContent);break;case"quadratic_attenuation":const C=parseFloat(a.textContent);t.distance=C?Math.sqrt(1/C):0;break}}return t}function Re(n){let t;switch(n.technique){case"directional":t=new r.DirectionalLight;break;case"point":t=new r.PointLight;break;case"spot":t=new r.SpotLight;break;case"ambient":t=new r.AmbientLight;break}return n.parameters.color&&t.color.copy(n.parameters.color),n.parameters.distance&&(t.distance=n.parameters.distance),t}function He(n){const t=ae.lights[n];return t!==void 0?v(t,Re):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",n),null)}function $e(n){const t={name:n.getAttribute("name"),sources:{},vertices:{},primitives:[]},i=c(n,"mesh")[0];if(i!==void 0){for(let s=0;s<i.childNodes.length;s++){const a=i.childNodes[s];if(a.nodeType!==1)continue;const f=a.getAttribute("id");switch(a.nodeName){case"source":t.sources[f]=qe(a);break;case"vertices":t.vertices=nt(a);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",a.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":t.primitives.push(Je(a));break;default:console.log(a)}}ae.geometries[n.getAttribute("id")]=t}}function qe(n){const t={array:[],stride:3};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"float_array":t.array=d(s.textContent);break;case"Name_array":t.array=u(s.textContent);break;case"technique_common":const a=c(s,"accessor")[0];a!==void 0&&(t.stride=parseInt(a.getAttribute("stride")));break}}return t}function nt(n){const t={};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];s.nodeType===1&&(t[s.getAttribute("semantic")]=p(s.getAttribute("source")))}return t}function Je(n){const t={type:n.nodeName,material:n.getAttribute("material"),count:parseInt(n.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=p(a.getAttribute("source")),C=a.getAttribute("semantic"),J=parseInt(a.getAttribute("offset")),z=parseInt(a.getAttribute("set")),K=z>0?C+z:C;t.inputs[K]={id:f,offset:J},t.stride=Math.max(t.stride,J+1),C==="TEXCOORD"&&(t.hasUV=!0);break;case"vcount":t.vcount=_(a.textContent);break;case"p":t.p=_(a.textContent);break}}return t}function Xe(n){const t={};for(let i=0;i<n.length;i++){const s=n[i];t[s.type]===void 0&&(t[s.type]=[]),t[s.type].push(s)}return t}function Ye(n){let t=0;for(let i=0,s=n.length;i<s;i++)n[i].hasUV===!0&&t++;t>0&&t<n.length&&(n.uvsNeedsFix=!0)}function ct(n){const t={},i=n.sources,s=n.vertices,a=n.primitives;if(a.length===0)return{};const f=Xe(a);for(const C in f){const J=f[C];Ye(J),t[C]=un(J,i,s)}return t}function un(n,t,i){const s={},a={array:[],stride:0},f={array:[],stride:0},C={array:[],stride:0},J={array:[],stride:0},z={array:[],stride:0},K={array:[],stride:4},te={array:[],stride:4},P=new r.BufferGeometry,ee=[];let Q=0;for(let oe=0;oe<n.length;oe++){const ne=n[oe],xe=ne.inputs;let ye=0;switch(ne.type){case"lines":case"linestrips":ye=ne.count*2;break;case"triangles":ye=ne.count*3;break;case"polylist":for(let pe=0;pe<ne.count;pe++){const fe=ne.vcount[pe];switch(fe){case 3:ye+=3;break;case 4:ye+=6;break;default:ye+=(fe-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",ne.type)}P.addGroup(Q,ye,oe),Q+=ye,ne.material&&ee.push(ne.material);for(const pe in xe){const fe=xe[pe];switch(pe){case"VERTEX":for(const Ke in i){const Le=i[Ke];switch(Ke){case"POSITION":const ht=a.array.length;if(Ge(ne,t[Le],fe.offset,a.array),a.stride=t[Le].stride,t.skinWeights&&t.skinIndices&&(Ge(ne,t.skinIndices,fe.offset,K.array),Ge(ne,t.skinWeights,fe.offset,te.array)),ne.hasUV===!1&&n.uvsNeedsFix===!0){const In=(a.array.length-ht)/a.stride;for(let Zt=0;Zt<In;Zt++)C.array.push(0,0)}break;case"NORMAL":Ge(ne,t[Le],fe.offset,f.array),f.stride=t[Le].stride;break;case"COLOR":Ge(ne,t[Le],fe.offset,z.array),z.stride=t[Le].stride;break;case"TEXCOORD":Ge(ne,t[Le],fe.offset,C.array),C.stride=t[Le].stride;break;case"TEXCOORD1":Ge(ne,t[Le],fe.offset,J.array),C.stride=t[Le].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',Ke)}}break;case"NORMAL":Ge(ne,t[fe.id],fe.offset,f.array),f.stride=t[fe.id].stride;break;case"COLOR":Ge(ne,t[fe.id],fe.offset,z.array,!0),z.stride=t[fe.id].stride;break;case"TEXCOORD":Ge(ne,t[fe.id],fe.offset,C.array),C.stride=t[fe.id].stride;break;case"TEXCOORD1":Ge(ne,t[fe.id],fe.offset,J.array),J.stride=t[fe.id].stride;break}}}return a.array.length>0&&P.setAttribute("position",new r.Float32BufferAttribute(a.array,a.stride)),f.array.length>0&&P.setAttribute("normal",new r.Float32BufferAttribute(f.array,f.stride)),z.array.length>0&&P.setAttribute("color",new r.Float32BufferAttribute(z.array,z.stride)),C.array.length>0&&P.setAttribute("uv",new r.Float32BufferAttribute(C.array,C.stride)),J.array.length>0&&P.setAttribute("uv1",new r.Float32BufferAttribute(J.array,J.stride)),K.array.length>0&&P.setAttribute("skinIndex",new r.Float32BufferAttribute(K.array,K.stride)),te.array.length>0&&P.setAttribute("skinWeight",new r.Float32BufferAttribute(te.array,te.stride)),s.data=P,s.type=n[0].type,s.materialKeys=ee,s}function Ge(n,t,i,s,a=!1){const f=n.p,C=n.stride,J=n.vcount;function z(P){let ee=f[P+i]*te;const Q=ee+te;for(;ee<Q;ee++)s.push(K[ee]);if(a){const oe=s.length-te-1;_t.setRGB(s[oe+0],s[oe+1],s[oe+2],r.SRGBColorSpace),s[oe+0]=_t.r,s[oe+1]=_t.g,s[oe+2]=_t.b}}const K=t.array,te=t.stride;if(n.vcount!==void 0){let P=0;for(let ee=0,Q=J.length;ee<Q;ee++){const oe=J[ee];if(oe===4){const ne=P+C*0,xe=P+C*1,ye=P+C*2,pe=P+C*3;z(ne),z(xe),z(pe),z(xe),z(ye),z(pe)}else if(oe===3){const ne=P+C*0,xe=P+C*1,ye=P+C*2;z(ne),z(xe),z(ye)}else if(oe>4)for(let ne=1,xe=oe-2;ne<=xe;ne++){const ye=P+C*0,pe=P+C*ne,fe=P+C*(ne+1);z(ye),z(pe),z(fe)}P+=C*oe}}else for(let P=0,ee=f.length;P<ee;P+=C)z(P)}function Ft(n){return v(ae.geometries[n],ct)}function hn(n){const t={name:n.getAttribute("name")||"",joints:{},links:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique_common":mn(s,t);break}}ae.kinematicsModels[n.getAttribute("id")]=t}function pn(n){return n.build!==void 0?n.build:n}function fn(n){return v(ae.kinematicsModels[n],pn)}function mn(n,t){for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"joint":t.joints[s.getAttribute("sid")]=gn(s);break;case"link":t.links.push(jt(s));break}}}function gn(n){let t;for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"prismatic":case"revolute":t=yn(s);break}}return t}function yn(n){const t={sid:n.getAttribute("sid"),name:n.getAttribute("name")||"",axis:new r.Vector3,limits:{min:0,max:0},type:n.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"axis":const a=d(s.textContent);t.axis.fromArray(a);break;case"limits":const f=s.getElementsByTagName("max")[0],C=s.getElementsByTagName("min")[0];t.limits.max=parseFloat(f.textContent),t.limits.min=parseFloat(C.textContent);break}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function jt(n){const t={sid:n.getAttribute("sid"),name:n.getAttribute("name")||"",attachments:[],transforms:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"attachment_full":t.attachments.push(bn(s));break;case"matrix":case"translate":case"rotate":t.transforms.push(Ot(s));break}}return t}function bn(n){const t={joint:n.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"link":t.links.push(jt(s));break;case"matrix":case"translate":case"rotate":t.transforms.push(Ot(s));break}}return t}function Ot(n){const t={type:n.nodeName},i=d(n.textContent);switch(t.type){case"matrix":t.obj=new r.Matrix4,t.obj.fromArray(i).transpose();break;case"translate":t.obj=new r.Vector3,t.obj.fromArray(i);break;case"rotate":t.obj=new r.Vector3,t.obj.fromArray(i),t.angle=r.MathUtils.degToRad(i[3]);break}return t}function wn(n){const t={name:n.getAttribute("name")||"",rigidBodies:{}};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"rigid_body":t.rigidBodies[s.getAttribute("name")]={},_n(s,t.rigidBodies[s.getAttribute("name")]);break}}ae.physicsModels[n.getAttribute("id")]=t}function _n(n,t){for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique_common":kn(s,t);break}}}function kn(n,t){for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"inertia":t.inertia=d(s.textContent);break;case"mass":t.mass=d(s.textContent)[0];break}}}function Cn(n){const t={bindJointAxis:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"bind_joint_axis":t.bindJointAxis.push(vn(s));break}}ae.kinematicsScenes[p(n.getAttribute("url"))]=t}function vn(n){const t={target:n.getAttribute("target").split("/").pop()};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"axis":const a=s.getElementsByTagName("param")[0];t.axis=a.textContent;const f=t.axis.split("inst_").pop().split("axis")[0];t.jointIndex=f.substring(0,f.length-1);break}}return t}function xn(n){return n.build!==void 0?n.build:n}function En(n){return v(ae.kinematicsScenes[n],xn)}function Nn(){const n=Object.keys(ae.kinematicsModels)[0],t=Object.keys(ae.kinematicsScenes)[0],i=Object.keys(ae.visualScenes)[0];if(n===void 0||t===void 0)return;const s=fn(n),a=En(t),f=Ht(i),C=a.bindJointAxis,J={};for(let te=0,P=C.length;te<P;te++){const ee=C[te],Q=Ne.querySelector('[sid="'+ee.target+'"]');if(Q){const oe=Q.parentElement;z(ee.jointIndex,oe)}}function z(te,P){const ee=P.getAttribute("name"),Q=s.joints[te];f.traverse(function(oe){oe.name===ee&&(J[te]={object:oe,transforms:Tn(P),joint:Q,position:Q.zeroPosition})})}const K=new r.Matrix4;Wt={joints:s&&s.joints,getJointValue:function(te){const P=J[te];if(P)return P.position;console.warn("THREE.ColladaLoader: Joint "+te+" doesn't exist.")},setJointValue:function(te,P){const ee=J[te];if(ee){const Q=ee.joint;if(P>Q.limits.max||P<Q.limits.min)console.warn("THREE.ColladaLoader: Joint "+te+" value "+P+" outside of limits (min: "+Q.limits.min+", max: "+Q.limits.max+").");else if(Q.static)console.warn("THREE.ColladaLoader: Joint "+te+" is static.");else{const oe=ee.object,ne=Q.axis,xe=ee.transforms;De.identity();for(let ye=0;ye<xe.length;ye++){const pe=xe[ye];if(pe.sid&&pe.sid.indexOf(te)!==-1)switch(Q.type){case"revolute":De.multiply(K.makeRotationAxis(ne,r.MathUtils.degToRad(P)));break;case"prismatic":De.multiply(K.makeTranslation(ne.x*P,ne.y*P,ne.z*P));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+Q.type);break}else switch(pe.type){case"matrix":De.multiply(pe.obj);break;case"translate":De.multiply(K.makeTranslation(pe.obj.x,pe.obj.y,pe.obj.z));break;case"scale":De.scale(pe.obj);break;case"rotate":De.multiply(K.makeRotationAxis(pe.obj,pe.angle));break}}oe.matrix.copy(De),oe.matrix.decompose(oe.position,oe.quaternion,oe.scale),J[te].position=P}}else console.log("THREE.ColladaLoader: "+te+" does not exist.")}}}function Tn(n){const t=[],i=Ne.querySelector('[id="'+n.id+'"]');for(let s=0;s<i.childNodes.length;s++){const a=i.childNodes[s];if(a.nodeType!==1)continue;let f,C;switch(a.nodeName){case"matrix":f=d(a.textContent);const J=new r.Matrix4().fromArray(f).transpose();t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:J});break;case"translate":case"scale":f=d(a.textContent),C=new r.Vector3().fromArray(f),t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:C});break;case"rotate":f=d(a.textContent),C=new r.Vector3().fromArray(f);const z=r.MathUtils.degToRad(f[3]);t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:C,angle:z});break}}return t}function An(n){const t=n.getElementsByTagName("node");for(let i=0;i<t.length;i++){const s=t[i];s.hasAttribute("id")===!1&&s.setAttribute("id",w())}}const De=new r.Matrix4,dt=new r.Vector3;function Nt(n){const t={name:n.getAttribute("name")||"",type:n.getAttribute("type"),id:n.getAttribute("id"),sid:n.getAttribute("sid"),matrix:new r.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType!==1)continue;let a;switch(s.nodeName){case"node":t.nodes.push(s.getAttribute("id")),Nt(s);break;case"instance_camera":t.instanceCameras.push(p(s.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(It(s));break;case"instance_light":t.instanceLights.push(p(s.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(It(s));break;case"instance_node":t.instanceNodes.push(p(s.getAttribute("url")));break;case"matrix":a=d(s.textContent),t.matrix.multiply(De.fromArray(a).transpose()),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"translate":a=d(s.textContent),dt.fromArray(a),t.matrix.multiply(De.makeTranslation(dt.x,dt.y,dt.z)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"rotate":a=d(s.textContent);const f=r.MathUtils.degToRad(a[3]);t.matrix.multiply(De.makeRotationAxis(dt.fromArray(a),f)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"scale":a=d(s.textContent),t.matrix.scale(dt.fromArray(a)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"extra":break;default:console.log(s)}}return Gt(t.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",t.id):ae.nodes[t.id]=t,t}function It(n){const t={id:p(n.getAttribute("url")),materials:{},skeletons:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];switch(s.nodeName){case"bind_material":const a=s.getElementsByTagName("instance_material");for(let f=0;f<a.length;f++){const C=a[f],J=C.getAttribute("symbol"),z=C.getAttribute("target");t.materials[J]=p(z)}break;case"skeleton":t.skeletons.push(p(s.textContent));break}}return t}function Mn(n,t){const i=[],s=[];let a,f,C;for(a=0;a<n.length;a++){const K=n[a];let te;if(Gt(K))te=ut(K),Ut(te,t,i);else if(Bn(K)){const ee=ae.visualScenes[K].children;for(let Q=0;Q<ee.length;Q++){const oe=ee[Q];if(oe.type==="JOINT"){const ne=ut(oe.id);Ut(ne,t,i)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",K)}for(a=0;a<t.length;a++)for(f=0;f<i.length;f++)if(C=i[f],C.bone.name===t[a].name){s[a]=C,C.processed=!0;break}for(a=0;a<i.length;a++)C=i[a],C.processed===!1&&(s.push(C),C.processed=!0);const J=[],z=[];for(a=0;a<s.length;a++)C=s[a],J.push(C.bone),z.push(C.boneInverse);return new r.Skeleton(J,z)}function Ut(n,t,i){n.traverse(function(s){if(s.isBone===!0){let a;for(let f=0;f<t.length;f++){const C=t[f];if(C.name===s.name){a=C.boneInverse;break}}a===void 0&&(a=new r.Matrix4),i.push({bone:s,boneInverse:a,processed:!1})}})}function Sn(n){const t=[],i=n.matrix,s=n.nodes,a=n.type,f=n.instanceCameras,C=n.instanceControllers,J=n.instanceLights,z=n.instanceGeometries,K=n.instanceNodes;for(let P=0,ee=s.length;P<ee;P++)t.push(ut(s[P]));for(let P=0,ee=f.length;P<ee;P++){const Q=Ce(f[P]);Q!==null&&t.push(Q.clone())}for(let P=0,ee=C.length;P<ee;P++){const Q=C[P],oe=W(Q.id),ne=Ft(oe.id),xe=zt(ne,Q.materials),ye=Q.skeletons,pe=oe.skin.joints,fe=Mn(ye,pe);for(let Ke=0,Le=xe.length;Ke<Le;Ke++){const ht=xe[Ke];ht.isSkinnedMesh&&(ht.bind(fe,oe.skin.bindMatrix),ht.normalizeSkinWeights()),t.push(ht)}}for(let P=0,ee=J.length;P<ee;P++){const Q=He(J[P]);Q!==null&&t.push(Q.clone())}for(let P=0,ee=z.length;P<ee;P++){const Q=z[P],oe=Ft(Q.id),ne=zt(oe,Q.materials);for(let xe=0,ye=ne.length;xe<ye;xe++)t.push(ne[xe])}for(let P=0,ee=K.length;P<ee;P++)t.push(ut(K[P]).clone());let te;if(s.length===0&&t.length===1)te=t[0];else{te=a==="JOINT"?new r.Bone:new r.Group;for(let P=0;P<t.length;P++)te.add(t[P])}return te.name=a==="JOINT"?n.sid:n.name,te.matrix.copy(i),te.matrix.decompose(te.position,te.quaternion,te.scale),te}const Pn=new r.MeshBasicMaterial({name:r.Loader.DEFAULT_MATERIAL_NAME,color:16711935});function Ln(n,t){const i=[];for(let s=0,a=n.length;s<a;s++){const f=t[n[s]];f===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",n[s]),i.push(Pn)):i.push(mt(f))}return i}function zt(n,t){const i=[];for(const s in n){const a=n[s],f=Ln(a.materialKeys,t);if(f.length===0&&(s==="lines"||s==="linestrips"?f.push(new r.LineBasicMaterial):f.push(new r.MeshPhongMaterial)),s==="lines"||s==="linestrips")for(let K=0,te=f.length;K<te;K++){const P=f[K];if(P.isMeshPhongMaterial===!0||P.isMeshLambertMaterial===!0){const ee=new r.LineBasicMaterial;ee.color.copy(P.color),ee.opacity=P.opacity,ee.transparent=P.transparent,f[K]=ee}}const C=a.data.attributes.skinIndex!==void 0,J=f.length===1?f[0]:f;let z;switch(s){case"lines":z=new r.LineSegments(a.data,J);break;case"linestrips":z=new r.Line(a.data,J);break;case"triangles":case"polylist":C?z=new r.SkinnedMesh(a.data,J):z=new r.Mesh(a.data,J);break}i.push(z)}return i}function Gt(n){return ae.nodes[n]!==void 0}function ut(n){return v(ae.nodes[n],Sn)}function Vn(n){const t={name:n.getAttribute("name"),children:[]};An(n);const i=c(n,"node");for(let s=0;s<i.length;s++)t.children.push(Nt(i[s]));ae.visualScenes[n.getAttribute("id")]=t}function qt(n){const t=new r.Group;t.name=n.name;const i=n.children;for(let s=0;s<i.length;s++){const a=i[s];t.add(ut(a.id))}return t}function Bn(n){return ae.visualScenes[n]!==void 0}function Ht(n){return v(ae.visualScenes[n],qt)}function Rn(n){const t=c(n,"instance_visual_scene")[0];return Ht(p(t.getAttribute("url")))}function Dn(){const n=ae.clips;if(b(n)===!0){if(b(ae.animations)===!1){const t=[];for(const i in ae.animations){const s=N(i);for(let a=0,f=s.length;a<f;a++)t.push(s[a])}kt.push(new r.AnimationClip("default",-1,t))}}else for(const t in n)kt.push(Y(t))}function Fn(n){let t="";const i=[n];for(;i.length;){const s=i.shift();s.nodeType===Node.TEXT_NODE?t+=s.textContent:(t+=`
7
+ `,i.push(...s.childNodes))}return t.trim()}if(o.length===0)return{scene:new r.Scene};const $t=new DOMParser().parseFromString(o,"application/xml"),Ne=c($t,"COLLADA")[0],Tt=$t.getElementsByTagName("parsererror")[0];if(Tt!==void 0){const n=c(Tt,"div")[0];let t;return n?t=n.textContent:t=Fn(Tt),console.error(`THREE.ColladaLoader: Failed to parse collada file.
8
+ `,t),null}const jn=Ne.getAttribute("version");console.debug("THREE.ColladaLoader: File version",jn);const Yt=L(c(Ne,"asset")[0]),Kt=new r.TextureLoader(this.manager);Kt.setPath(this.resourcePath||l).setCrossOrigin(this.crossOrigin);let At;on&&(At=new on(this.manager),At.setPath(this.resourcePath||l));const _t=new r.Color,kt=[];let Wt={},On=0;const ae={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};T(Ne,"library_animations","animation",m),T(Ne,"library_animation_clips","animation_clip",h),T(Ne,"library_controllers","controller",H),T(Ne,"library_images","image",G),T(Ne,"library_effects","effect",he),T(Ne,"library_materials","material",ft),T(Ne,"library_cameras","camera",gt),T(Ne,"library_lights","light",Oe),T(Ne,"library_geometries","geometry",$e),T(Ne,"library_nodes","node",Nt),T(Ne,"library_visual_scenes","visual_scene",Vn),T(Ne,"library_kinematics_models","kinematics_model",hn),T(Ne,"library_physics_models","physics_model",wn),T(Ne,"scene","instance_kinematics_scene",Cn),B(ae.animations,j),B(ae.clips,I),B(ae.controllers,Z),B(ae.images,X),B(ae.effects,me),B(ae.materials,Ze),B(ae.cameras,ge),B(ae.lights,Re),B(ae.geometries,ct),B(ae.visualScenes,qt),Dn(),Nn();const Ct=Rn(c(Ne,"scene")[0]);return Ct.animations=kt,Yt.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),Ct.rotation.set(-Math.PI/2,0,0)),Ct.scale.multiplyScalar(Yt.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),kt},kinematics:Wt,library:ae,scene:Ct}}}const Vt=new r.Quaternion,sn=new r.Euler;function pt(M){return M?M.trim().split(/\s+/g).map(o=>parseFloat(o)):[0,0,0]}function an(M,o,l=!1){l||M.rotation.set(0,0,0),sn.set(o[0],o[1],o[2],"ZYX"),Vt.setFromEuler(sn),Vt.multiply(M.quaternion),M.quaternion.copy(Vt)}class fo{constructor(o){this.manager=o||r.DefaultLoadingManager,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(o){return new Promise((l,c)=>{this.load(o,l,null,c)})}load(o,l,c,u){const d=this.manager,_=r.LoaderUtils.extractUrlBase(o),p=this.manager.resolveURL(o);d.itemStart(p),fetch(p,this.fetchOptions).then(w=>{if(w.ok)return c&&c(null),w.text();throw new Error(`URDFLoader: Failed to load url '${p}' with error code ${w.status} : ${w.statusText}.`)}).then(w=>{const b=this.parse(w,this.workingPath||_);l(b),d.itemEnd(p)}).catch(w=>{u?u(w):console.error("URDFLoader: Error loading file.",w),d.itemError(p),d.itemEnd(p)})}parse(o,l=this.workingPath){const c=this.packages,u=this.loadMeshCb,d=this.parseVisual,_=this.parseCollision,p=this.manager,w={},b={},L={};function R(E){if(!/^package:\/\//.test(E))return l?l+E:E;const[j,N]=E.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof c=="string")return c.endsWith(j)?c+"/"+N:c+"/"+j+"/"+N;if(c instanceof Function)return c(j)+"/"+N;if(typeof c=="object")return j in c?c[j]+"/"+N:(console.error(`URDFLoader : ${j} not found in provided package list.`),null)}function V(E){let j;E instanceof Document?j=[...E.children]:E instanceof Element?j=[E]:j=[...new DOMParser().parseFromString(E,"text/xml").children];const N=j.filter(k=>k.nodeName==="robot").pop();return T(N)}function T(E){const j=[...E.children],N=j.filter(D=>D.nodeName.toLowerCase()==="link"),k=j.filter(D=>D.nodeName.toLowerCase()==="joint"),g=j.filter(D=>D.nodeName.toLowerCase()==="material"),F=new r.URDFRobot;F.robotName=E.getAttribute("name"),F.urdfRobotNode=E,g.forEach(D=>{const U=D.getAttribute("name");L[U]=m(D)});const A={},x={};N.forEach(D=>{const U=D.getAttribute("name"),se=E.querySelector(`child[link="${U}"]`)===null;w[U]=v(D,A,x,se?F:null)}),k.forEach(D=>{const U=D.getAttribute("name");b[U]=B(D)}),F.joints=b,F.links=w,F.colliders=x,F.visual=A;const q=Object.values(b);return q.forEach(D=>{D instanceof r.URDFMimicJoint&&b[D.mimicJoint].mimicJoints.push(D)}),q.forEach(D=>{const U=new Set,se=ce=>{if(U.has(ce))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");U.add(ce),ce.mimicJoints.forEach(y=>{se(y)})};se(D)}),F.frames={...x,...A,...w,...b},F}function B(E){const j=[...E.children],N=E.getAttribute("type");let k;const g=j.find(U=>U.nodeName.toLowerCase()==="mimic");g?(k=new r.URDFMimicJoint,k.mimicJoint=g.getAttribute("joint"),k.multiplier=parseFloat(g.getAttribute("multiplier")||1),k.offset=parseFloat(g.getAttribute("offset")||0)):k=new r.URDFJoint,k.urdfNode=E,k.name=E.getAttribute("name"),k.urdfName=k.name,k.jointType=N;let F=null,A=null,x=[0,0,0],q=[0,0,0];j.forEach(U=>{const se=U.nodeName.toLowerCase();se==="origin"?(x=pt(U.getAttribute("xyz")),q=pt(U.getAttribute("rpy"))):se==="child"?A=w[U.getAttribute("link")]:se==="parent"?F=w[U.getAttribute("link")]:se==="limit"&&(k.limit.lower=parseFloat(U.getAttribute("lower")||k.limit.lower),k.limit.upper=parseFloat(U.getAttribute("upper")||k.limit.upper))}),F.add(k),k.add(A),an(k,q),k.position.set(x[0],x[1],x[2]);const D=j.filter(U=>U.nodeName.toLowerCase()==="axis")[0];if(D){const U=D.getAttribute("xyz").split(/\s+/g).map(se=>parseFloat(se));k.axis=new r.Vector3(U[0],U[1],U[2]),k.axis.normalize()}return k}function v(E,j,N,k=null){k===null&&(k=new r.URDFLink);const g=[...E.children];return k.name=E.getAttribute("name"),k.urdfName=k.name,k.urdfNode=E,d&&g.filter(A=>A.nodeName.toLowerCase()==="visual").forEach(A=>{const x=S(A,L);if(k.add(x),A.hasAttribute("name")){const q=A.getAttribute("name");x.name=q,x.urdfName=q,j[q]=x}}),_&&g.filter(A=>A.nodeName.toLowerCase()==="collision").forEach(A=>{const x=S(A);if(k.add(x),A.hasAttribute("name")){const q=A.getAttribute("name");x.name=q,x.urdfName=q,N[q]=x}}),k}function m(E){const j=[...E.children],N=new r.MeshPhongMaterial;return N.name=E.getAttribute("name")||"",j.forEach(k=>{const g=k.nodeName.toLowerCase();if(g==="color"){const F=k.getAttribute("rgba").split(/\s/g).map(A=>parseFloat(A));N.color.setRGB(F[0],F[1],F[2]),N.opacity=F[3],N.transparent=F[3]<1,N.depthWrite=!N.transparent}else if(g==="texture"){const F=k.getAttribute("filename");if(F){const A=new r.TextureLoader(p),x=R(F);N.map=A.load(x),N.map.colorSpace=r.SRGBColorSpace}}}),N}function S(E,j={}){const N=E.nodeName.toLowerCase()==="collision",k=[...E.children];let g=null;const F=k.filter(x=>x.nodeName.toLowerCase()==="material")[0];if(F){const x=F.getAttribute("name");x&&x in j?g=j[x]:g=m(F)}else g=new r.MeshPhongMaterial;const A=N?new r.URDFCollider:new r.URDFVisual;return A.urdfNode=E,k.forEach(x=>{const q=x.nodeName.toLowerCase();if(q==="geometry"){const D=x.children[0].nodeName.toLowerCase();if(D==="mesh"){const U=x.children[0].getAttribute("filename"),se=R(U);if(se!==null){const ce=x.children[0].getAttribute("scale");if(ce){const y=pt(ce);A.scale.set(y[0],y[1],y[2])}u(se,p,(y,h)=>{h?console.error("URDFLoader: Error loading mesh.",h):y&&(y instanceof r.Mesh&&(y.material=g),y.position.set(0,0,0),y.quaternion.identity(),A.add(y))})}}else if(D==="box"){const U=new r.Mesh;U.geometry=new r.BoxGeometry(1,1,1),U.material=g;const se=pt(x.children[0].getAttribute("size"));U.scale.set(se[0],se[1],se[2]),A.add(U)}else if(D==="sphere"){const U=new r.Mesh;U.geometry=new r.SphereGeometry(1,30,30),U.material=g;const se=parseFloat(x.children[0].getAttribute("radius"))||0;U.scale.set(se,se,se),A.add(U)}else if(D==="cylinder"){const U=new r.Mesh;U.geometry=new r.CylinderGeometry(1,1,1,30),U.material=g;const se=parseFloat(x.children[0].getAttribute("radius"))||0,ce=parseFloat(x.children[0].getAttribute("length"))||0;U.scale.set(se,ce,se),U.rotation.set(Math.PI/2,0,0),A.add(U)}}else if(q==="origin"){const D=pt(x.getAttribute("xyz")),U=pt(x.getAttribute("rpy"));A.position.set(D[0],D[1],D[2]),A.rotation.set(0,0,0),an(A,U)}}),A}return V(o)}defaultMeshLoader(o,l,c){/\.stl$/i.test(o)?new Et(l).load(o,d=>{const _=new r.Mesh(d,new r.MeshPhongMaterial);c(_)}):/\.dae$/i.test(o)?new po(l).load(o,d=>c(d.scene)):console.warn(`URDFLoader: Could not load model at ${o}.
9
+ No loader available`)}}function mo(M,o,l,c,u){const d=async V=>{try{const T=await Rt.downloadAvatarApi({url:V});if(T.status!==200)throw new Error(`下载失败: ${T.status}`);return T.data}catch(T){throw console.error("addModelFromUrl失败:",T),T}},_=V=>new Promise((T,B)=>{const v=new FileReader;v.onload=m=>{try{const S=m.target.result,j=new Lt().parse(S);j.preload(),T(j)}catch(S){B(S)}},v.onerror=()=>{B(new Error("MTL文件读取失败"))},v.readAsText(V)}),p=async V=>{const T={materials:{},create:function(B){return this.materials[B]?this.materials[B]:(console.warn(`Material '${B}' not found, using default material`),new r.MeshPhongMaterial({color:8947848,side:r.DoubleSide}))},getAsArray:function(){const B=[];for(const v in this.materials)B.push(this.materials[v]);return B},preload:function(){for(const B in this.materials)this.materials[B].map&&(this.materials[B].map.needsUpdate=!0)}};for(const B of V){const v=await _(B);Object.assign(T.materials,v.materials)}return T.preload(),T},w=async(V,T=[])=>new Promise((B,v)=>{const m=new FileReader;m.onload=async S=>{try{const E=S.target.result;let j=null;T&&T.length>0&&(T.length===1?j=await _(T[0]):j=await p(T));const N=new Pt;j&&N.setMaterials(j);const k=N.parse(E);j||k.traverse(g=>{g.isMesh&&(g.material=new r.MeshPhongMaterial({color:8947848,side:r.DoubleSide}))}),B(k)}catch(E){v(E)}},m.onerror=()=>{v(new Error("OBJ文件读取失败"))},m.readAsText(V)}),b=async V=>{var T;try{l.value=!0;const{scene:B}=M();if(!B)throw new Error("Scene not initialized");u();const v=[];for(let m=0;m<V.length;m++){const S=V[m];c.value=`正在加载模型 ${m+1}/${V.length}...`;const E=await d(S.objUrl),j=((T=S.objUrl)==null?void 0:T.split("/").pop())||`model_${m}.obj`,N=new File([E],j,{type:E.type});let k=[];if(S.mtlUrls){const F=Array.isArray(S.mtlUrls)?S.mtlUrls:[S.mtlUrls];for(let A=0;A<F.length;A++){const x=F[A],q=await d(x),D=(x==null?void 0:x.split("/").pop())||`material_${m}_${A}.mtl`,U=new File([q],D,{type:q.type});k.push(U)}}const g=await w(N,k);B.add(g),o.value.push(g),v.push(g)}return l.value=!1,v}catch(B){throw console.error("加载模型失败:",B),l.value=!1,B}},L=async(V,T,B=[],v=[])=>{let m;const S=V.toLowerCase();switch(S){case".txt":case".cpt":case".obj":const E=await T.text();if(S===".txt"||S===".cpt"){const ce=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,h=[...E.matchAll(ce)].map(H=>({x:parseFloat(H[1]),y:parseFloat(H[2]),z:parseFloat(H[3])})),I=new r.BufferGeometry,Y=h.flatMap(H=>[H.x,H.y,H.z]);if(I.setAttribute("position",new r.Float32BufferAttribute(Y,3)),S===".txt"){const H=new r.PointsMaterial({color:"#5B5C99",size:1,sizeAttenuation:!1});m=new r.Points(I,H)}else if(S===".cpt"){const H=new r.LineBasicMaterial({color:"#5B5C99",linewidth:100});m=new r.Line(I,H)}}else if(S===".obj"){const ce=new Pt;if(B&&B.length>0){const y=new Lt;for(const h of B){const I=await h.text(),Y=y.parse(I);Y.preload(),ce.setMaterials(Y);break}}m=ce.parse(E),(!B||B.length===0)&&m.traverse(y=>{y.isMesh&&(y.material=new r.MeshPhongMaterial({color:"#B3B3D4"})),y instanceof r.Mesh&&(y.material.side=r.DoubleSide)})}break;case".stl":const j=await T.arrayBuffer(),k=new Et().parse(j),g=new r.MeshPhongMaterial({color:"#B3B3D4",side:r.DoubleSide});m=new r.Mesh(k,g);break;case".urdf":const F=await T.text(),A=new fo,x=new Map;v.forEach(ce=>{x.set(ce.name,ce.blob)}),A.loadMeshCb=async(ce,y,h,I,Y)=>{const H=ce.split("/").pop(),re=x.get(H);if(!re){Y(new Error(`找不到文件: ${H}`));return}const $=H.split(".").pop().toLowerCase();switch($){case"stl":const ie=await re.arrayBuffer(),O=new Et(y).parse(ie),W=new r.Mesh(O,new r.MeshPhongMaterial);h(W);break;case"obj":const G=await re.text(),X=new Pt(y),ue=H.replace(".obj",".mtl"),he=x.get(ue);if(he){const Se=await he.text(),Fe=new Lt(y).parse(Se);Fe.preload(),X.setMaterials(Fe)}const le=X.parse(G);h(le);break;default:Y(new Error(`不支持的文件格式: ${$}`))}},m=A.parse(F);break;case".nc":const q=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],D={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},U=new r.Group,se=q.map(ce=>new Promise((y,h)=>{new Et().load(`/model/${ce}`,Y=>{const H=new r.MeshPhongMaterial({color:D[ce]||"#B3B3D4",side:r.DoubleSide}),re=new r.Mesh(Y,H);y(re)},void 0,h)}));try{(await Promise.all(se)).forEach(y=>U.add(y)),m=U}catch(ce){throw console.error("加载NC文件对应的STL文件失败:",ce),new Error("无法加载.NC文件对应的STL文件")}break;default:throw new Error(`不支持的文件格式: ${V}`)}return m};return{addModelsFromUrls:b,loadModelByDefaultPath:async V=>{console.log(V);try{l.value=!0,c.value="正在加载模型...";const{scene:T}=M();if(!T)throw new Error("Scene not initialized");u(),await new Promise(v=>setTimeout(v,100));const B=[];for(let v=0;v<V.length;v++){const m=V[v],S=await L(m.suffix,m.blob,m.mtlBlobs||[],m.meshFiles||[]);T.add(S),o.value.push(S),B.push(S)}return l.value=!1,c.value="",B}catch(T){throw console.error("加载模型失败:",T),l.value=!1,c.value="",T}}}}const go={class:"obj-viewer-container"},yo={class:"floating-controls"},bo=["disabled"],wo=["disabled","title"],_o={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ko={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Co=["disabled"],vo=["title"],xo={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Eo={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},No={key:0,class:"clipping-panel"},To={class:"panel-content"},Ao={class:"radio-group"},Mo={class:"radio-label"},So={class:"radio-label"},Po={class:"radio-label"},Lo={class:"radio-label"},Vo={key:1,class:"loading-overlay"},Bo={__name:"threeModel",setup(M,{expose:o}){const l=e.ref(null),c=e.ref(!1),u=e.ref(""),d=e.ref(!1),_=e.ref(!1),{currentModels:p,initialCameraPosition:w,initialTargetPosition:b,initThreeJS:L,handleResize:R,fitCameraToAllModels:V,getThreeJSObjects:T,clearAllModels:B,cleanup:v}=oo(l),{isAnimating:m,toggleAnimation:S,stopAnimation:E}=so(T,p),{isClipping:j,activeClippingAxis:N,toggleClipping:k,updateClippingPlanes:g}=io(T,p),{addModelsFromUrls:F,loadModelByDefaultPath:A}=mo(T,p,c,u,B),x=()=>{if(_.value||p.value.length===0)return;_.value=!0,m.value&&E();const{camera:y,controls:h}=T();if(!y||!h)return;h.enabled=!0;const I=Z=>Z<.5?4*Z*Z*Z:1-Math.pow(-2*Z+2,3)/2,Y=y.position.clone(),H=h.target.clone(),re=1500,$=Date.now(),ie=()=>{const Z=Date.now()-$,O=Math.min(Z/re,1),W=I(O);y.position.lerpVectors(Y,w.value,W),h.target.lerpVectors(H,b.value,W),O<1?requestAnimationFrame(ie):_.value=!1};ie()},q=()=>{document.fullscreenElement?document.exitFullscreen().then(()=>{d.value=!1,e.nextTick(()=>{R()})}).catch(y=>{console.error("无法退出全屏:",y)}):l.value.requestFullscreen().then(()=>{d.value=!0,e.nextTick(()=>{R()})}).catch(y=>{console.error("无法进入全屏:",y)})},D=()=>{d.value=!!document.fullscreenElement,d.value||e.nextTick(()=>{R()})},U=async(y,h)=>{try{m.value&&E(),j.value&&k();const I=await h(y);return V(),I}catch(I){throw console.error("加载模型失败:",I),I}},se=async y=>U(y,F),ce=async y=>U(y,A);return e.onMounted(async()=>{await e.nextTick(),L(),window.addEventListener("resize",R),document.addEventListener("fullscreenchange",D)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",R),document.removeEventListener("fullscreenchange",D),m.value&&E(),v()}),o({addModelsFromUrls:se,loadModelByDefaultPath:ce}),(y,h)=>(e.openBlock(),e.createElementBlock("div",go,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:l,class:"threejs-container"},null,512),e.createElementVNode("div",yo,[e.createElementVNode("button",{onClick:x,class:e.normalizeClass(["control-btn","reset-btn"]),disabled:c.value||e.unref(p).length===0||_.value,title:"重置"},h[10]||(h[10]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),e.createElementVNode("polyline",{points:"9,22 9,12 15,12 15,22"})],-1)]),8,bo),e.createElementVNode("button",{onClick:h[0]||(h[0]=(...I)=>e.unref(S)&&e.unref(S)(...I)),class:e.normalizeClass(["control-btn","animation-btn",{active:e.unref(m)}]),disabled:c.value||e.unref(p).length===0,title:e.unref(m)?"停止动画":"动画视图"},[e.unref(m)?(e.openBlock(),e.createElementBlock("svg",ko,h[12]||(h[12]=[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),e.createElementVNode("rect",{x:"9.5",y:"8",width:"2",height:"8",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"12.5",y:"8",width:"2",height:"8",fill:"currentColor"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",_o,h[11]||(h[11]=[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),e.createElementVNode("polygon",{points:"10,8 16,12 10,16",fill:"currentColor"},null,-1)])))],10,wo),e.createElementVNode("button",{onClick:h[1]||(h[1]=(...I)=>e.unref(k)&&e.unref(k)(...I)),class:e.normalizeClass(["control-btn","clipping-btn",{active:e.unref(j)}]),disabled:c.value||e.unref(p).length===0,title:"剖面视图"},h[13]||(h[13]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18"}),e.createElementVNode("line",{x1:"-14",y1:"12",x2:"30",y2:"12","stroke-dasharray":"4,2"})],-1)]),10,Co),e.createElementVNode("button",{onClick:q,class:e.normalizeClass(["control-btn","fullscreen-btn"]),title:d.value?"退出全屏":"全屏"},[d.value?(e.openBlock(),e.createElementBlock("svg",Eo,h[15]||(h[15]=[e.createElementVNode("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",xo,h[14]||(h[14]=[e.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},null,-1)])))],8,vo)]),e.unref(j)?(e.openBlock(),e.createElementBlock("div",No,[e.createElementVNode("div",To,[e.createElementVNode("div",Ao,[e.createElementVNode("label",Mo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":h[2]||(h[2]=I=>e.isRef(N)?N.value=I:null),onChange:h[3]||(h[3]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(N)]]),h[16]||(h[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",So,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":h[4]||(h[4]=I=>e.isRef(N)?N.value=I:null),onChange:h[5]||(h[5]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(N)]]),h[17]||(h[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Po,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":h[6]||(h[6]=I=>e.isRef(N)?N.value=I:null),onChange:h[7]||(h[7]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(N)]]),h[18]||(h[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Lo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":h[8]||(h[8]=I=>e.isRef(N)?N.value=I:null),onChange:h[9]||(h[9]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(N)]]),h[19]||(h[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",Vo,[h[20]||(h[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(u.value),1)])):e.createCommentVNode("",!0)]))}},Ro=it._export_sfc(Bo,[["__scopeId","data-v-4d1111d9"]]),Do={class:"bread-content"},Fo=["onClick"],jo={key:0,class:"split-title"},Oo={__name:"index",props:{breadArray:{type:Array,default:()=>[]}},emits:["click"],setup(M,{emit:o}){const l=M,c=e.ref([]),u=o;e.onMounted(()=>{c.value=l==null?void 0:l.breadArray}),e.watch(()=>l==null?void 0:l.breadArray,()=>{c.value=l==null?void 0:l.breadArray},{deep:!0,immediate:!0});const d=_=>{u("click",_)};return(_,p)=>(e.openBlock(),e.createElementBlock("div",Do,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(w,b)=>{var L;return e.openBlock(),e.createElementBlock("div",{key:b,class:"bread-item"},[e.createElementVNode("div",{class:"bread-title",onClick:R=>d(w),style:e.normalizeStyle({opacity:((L=c.value)==null?void 0:L.length)-1===b?"0.7":"1"})},e.toDisplayString(w.value),13,Fo),b!==c.value.length-1&&Array.isArray(c.value)?(e.openBlock(),e.createElementBlock("div",jo,e.toDisplayString("/"))):e.createCommentVNode("",!0)])}),128))]))}},dn=it._export_sfc(Oo,[["__scopeId","data-v-ded7e2bd"]]),Io={class:"item-menu-content"},Uo={class:"item-left-content"},zo={key:0,class:"page-icon"},Go={class:"avatar"},qo={style:{display:"flex"}},Ho={class:"select-icon"},$o={key:0,class:"model-operate",style:{width:"0px"}},Yo={class:"model-select"},Ko={class:"model-fill"},Wo={key:1,class:"show-main-content"},Zo={class:"show-content"},Jo={class:"item-view-group"},Xo={class:"show-item-content"},Qo={class:"item-view-group"},es={key:2,class:"show-main-content"},ts={__name:"browser",props:{content:String,jsonContents:Array},emits:["change","contentChange"],setup(M,{emit:o}){const l=rn.useLoginState(),{loginUserInfo:c,cryptoInfo:u}=be.storeToRefs(l);e.onMounted(()=>{ln.ElNotification({title:"温馨提示:",type:"success",message:"欢迎使用系统",duration:1e3})});const d=r.useModelComp(Ue.pinia);r.useFormToTableComp(Ue.pinia),e.ref(!0);const _=be.useMenuState();e.ref(!0);const{itemData:p,isEdit:w,isRefreshCurStructure:b,curStructureCompIds:L}=be.storeToRefs(d),R=r.useUnit(Ue.pinia),{activeMenuPath:V,menus:T,importLoading:B}=be.storeToRefs(_),{selectIndex:v,selectTitle:m}=be.storeToRefs(R);return e.ref([]),e.ref(!1),(S,E)=>{const j=e.resolveComponent("el-aside"),N=e.resolveComponent("el-button"),k=e.resolveComponent("el-avatar"),g=e.resolveComponent("el-header"),F=e.resolveComponent("router-view"),A=e.resolveComponent("el-main"),x=e.resolveComponent("el-container"),q=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(x,{"element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.unref(w)==="view"?(e.openBlock(),e.createBlock(j,{key:0,width:"250px"},{default:e.withCtx(()=>[e.createVNode(Bt.default,{mode:"vertical"})]),_:1})):e.createCommentVNode("",!0),e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>{var D;return[e.createElementVNode("div",Io,[e.createElementVNode("div",Uo,[e.unref(w)==="edit"?(e.openBlock(),e.createElementBlock("div",zo,[e.createVNode(N,{text:"",onClick:e.unref(de.onBack)},{default:e.withCtx(()=>E[2]||(E[2]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[2]},8,["onClick"]),e.createVNode(N,{text:"",onClick:E[0]||(E[0]=U=>{var se,ce;return e.unref(de.clickSavePage)((ce=(se=e.unref(m))==null?void 0:se.map(y=>y.value))==null?void 0:ce.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(Qe.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[E[3]||(E[3]=e.createTextVNode(" 保存页面 "))]),_:1,__:[3]})])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(dn,{key:e.unref(m),breadArray:e.unref(m),onClick:e.unref(de.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",Go,[e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:E[1]||(E[1]=(...U)=>e.unref(de.onSelectFixContent)&&e.unref(de.onSelectFixContent)(...U))},[e.createElementVNode("div",qo,[e.createVNode(Qe.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),E[4]||(E[4]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ho,[e.renderSlot(S.$slots,"default",{},void 0,!0)]),e.createVNode(k,{size:35,src:(D=e.unref(c))==null?void 0:D.avatarUrl},{default:e.withCtx(()=>{var U;return[e.createTextVNode(e.toDisplayString(((U=e.unref(c))==null?void 0:U.account)??"未知"),1)]}),_:1},8,["src"])])])]}),_:3}),e.createVNode(A,null,{default:e.withCtx(()=>{var D,U,se,ce;return[e.unref(w)==="edit"?(e.openBlock(),e.createElementBlock("div",$o,[e.createElementVNode("div",Yo,[e.createVNode(We.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:S.innerWidth},[e.createVNode(We.modelShow)])),e.createElementVNode("div",Ko,[e.createVNode(We.modelFill)])])):S.$route.path==="/"&&((D=e.unref(de.showItems))==null?void 0:D.length)>0&&e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Zo,[(U=e.unref(st.cloneDeep)(e.unref(de.showItems)))!=null&&U.find(y=>y.comp==="FormTop")?(e.openBlock(),e.createElementBlock("div",{class:"show-header",key:S.index},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((se=e.unref(st.cloneDeep)(e.unref(de.showItems)))==null?void 0:se.filter(y=>y.comp==="FormTop"),(y,h)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:h},[e.createElementVNode("div",Jo,e.toDisplayString(y.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(de.getComponents)(y.comp)),{itemData:y==null?void 0:y.compData,childItemData:y==null?void 0:y.itemChildData,key:(y==null?void 0:y.id)??h,onChange:e.unref(de.onChange),index:(y==null?void 0:y.id)??h,onContentChange:e.unref(de.onContentChange),onPageChange:e.unref(de.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Xo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ce=e.unref(st.cloneDeep)(e.unref(de.showItems)))==null?void 0:ce.filter(y=>y.comp!=="FormTop"),(y,h)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:h},[e.createElementVNode("div",Qo,e.toDisplayString(y.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(de.getComponents)(y.comp)),{itemData:y==null?void 0:y.compData,childItemData:y==null?void 0:y.itemChildData,key:(y==null?void 0:y.id)??h,onChange:e.unref(de.onChange),index:(y==null?void 0:y.id)??h,onContentChange:e.unref(de.onContentChange),onPageChange:e.unref(de.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])])])):e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",es,[e.createVNode(F)])):e.createCommentVNode("",!0)]}),_:1})]),_:3})]),_:3})),[[q,e.unref(B)]])}}},ns=it._export_sfc(ts,[["__scopeId","data-v-d2611062"]]);function os(M,o,l,c,u,d){const _=e.resolveComponent("svg-icon"),p=e.resolveComponent("ssMenu");return e.openBlock(),e.createBlock(p,{mode:M.mode,menuList:M.renderMenuList,onClickMenu:M.clickMenu,onOpenMenu:M.openMenu,onCloseMenu:M.closeMenu},{title:e.withCtx(({menu:w})=>[e.createVNode(_,{name:w.icon??"Fold",class:"menu-icon"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(w.title??""),1)]),_:1},8,["mode","menuList","onClickMenu","onOpenMenu","onCloseMenu"])}const ss=it._export_sfc(de._sfc_main,[["render",os],["__scopeId","data-v-e003bdbb"]]),Me=[{key:"FitCurve_Eleven",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35326658522693",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35326658522693",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35326658522693/outputResources"},{key:"MakeShape",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018179530309",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018179530309",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018179530309/outputResources"},{key:"FillEmpty",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018289382469",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018289382469",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018289382469/outputResources"},{key:"ToolPathFakeFast",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35484063607109",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35484063607109",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35484063607109/outputResources"},{key:"FiveAxisCalculator",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35237389477957",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35237389477957",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35237389477957/outputResources"},{key:"DetectionAlgorithm",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35459977498949",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35459977498949",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35459977498949/outputResources"},{key:"FeatureSelectionAlgorithm_FFS",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35277984187973",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35277984187973",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35277984187973/outputResources"},{key:"AIParameterOptimization",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35788169784389",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35788169784389"}],is={class:"structure-buttons"},as={class:"structure-paths"},rs={class:"client-header-user"},ls={class:"select-icon"},cs={class:"model-select"},ds={class:"model-show"},us={class:"model-fill"},hs={class:"client-header-logo"},ps={class:"client-header-menu"},fs={class:"client-header-user"},ms={style:{display:"flex"}},gs={class:"select-icon"},ys={class:"client-main-content"},bs={key:0,class:"item-view-group"},ws={key:0,class:"calculator"},_s={class:"router-aside"},ks=e.defineComponent({__name:"client",props:{windowConfig:{type:Object,default:()=>{}}},setup(M){const o=r.useUnit(Ue.pinia),l=e.ref(0),c=e.ref(!1),{selectTitle:u}=be.storeToRefs(o),d=e.ref(!1),_=r.useTableComp(Ue.pinia),{tableShowThree:p}=be.storeToRefs(_),w=rn.useLoginState(),{loginUserInfo:b}=be.storeToRefs(w),L=r.useModelComp(Ue.pinia),{isEdit:R}=be.storeToRefs(L),V=be.useMenuState(Ue.pinia),T=Un.useFormComp(Ue.pinia),{objUrl:B,blobUrls:v}=be.storeToRefs(T),m=e.ref(null),S=e.ref(!0),{importLoading:E,activeMenuPath:j,platName:N}=be.storeToRefs(V),k=e.ref(!1);e.watch(()=>j.value,async y=>{y&&(k.value=!0)},{immediate:!0});const g=async y=>{var Y,H,re,$,ie,Z,O;const h=(Y=y==null?void 0:y.split("/"))==null?void 0:Y[0],I=await be.getInsofDataApi({key:{type:"mainEquip",systemKey:sessionStorage.getItem("systemKey"),pageKey:h}});return((H=I==null?void 0:I.data)==null?void 0:H.type)==="success"?((O=(Z=(ie=($=(re=I==null?void 0:I.data)==null?void 0:re.result)==null?void 0:$[0])==null?void 0:ie.value)==null?void 0:Z.tableData)==null?void 0:O.隐藏三维显示)!==!0:!0};e.watch(()=>de.showItems.value,()=>{var y,h,I;((y=de.showItems.value)==null?void 0:y.length)===2&&((h=de.showItems.value)!=null&&h.find(Y=>(Y==null?void 0:Y.name)==="输入"))&&((I=de.showItems.value)!=null&&I.find(Y=>(Y==null?void 0:Y.name)==="输出"))?d.value=!0:d.value=!1},{deep:!0,immediate:!0}),e.watch(()=>j.value,async()=>{j.value&&(S.value=await g(j.value))},{deep:!0,immediate:!0}),e.watch(()=>[B.value,m.value],()=>{var y;((y=B.value)==null?void 0:y.length)>0&&m.value&&m.value.addModelsFromUrls(B.value)},{immediate:!0,deep:!0}),e.watch(()=>v==null?void 0:v.value,async()=>{var y,h,I,Y;if(v!=null&&v.value&&((y=v==null?void 0:v.value)==null?void 0:y.length)>0&&!((h=de.showItems.value)!=null&&h.find(H=>(H==null?void 0:H.name)==="输入")&&((I=de.showItems.value)!=null&&I.find(H=>(H==null?void 0:H.name)==="输出")))){let H=[];const re=await((Y=st.cloneDeep(v==null?void 0:v.value))==null?void 0:Y.map(async $=>{var G,X,ue,he,le,Se,Pe,Fe,et,tt;let ie,Z;const O=(X=(G=$==null?void 0:$.blob)==null?void 0:G.split("undefined,"))==null?void 0:X[1];let W=O==null?void 0:O.split(",");if((W==null?void 0:W.length)>1){let Be=await(W==null?void 0:W.map(async ve=>{var _e,at,rt,je,me,lt;ie=await be.axios.get(ve,{responseType:"blob",headers:{"Content-Type":"application/json"}});let ze=[];if(((_e=$==null?void 0:$.mtlBlobs)==null?void 0:_e.length)>0){let ft=await((at=$==null?void 0:$.mtlBlobs)==null?void 0:at.map(async Ee=>{let Ze=await be.axios.get(Ee,{responseType:"blob",headers:{"Content-Type":"application/json"}});return ze.push(new Blob([Ze.data],{type:"application/octet-stream;charset=UTF-8"})),Ze}));await Promise.all(ft)}return((je=ve==null?void 0:ve.split("."))==null?void 0:je[((rt=ve==null?void 0:ve.split("."))==null?void 0:rt.length)-1])!=="undefined"&&H.push({suffix:"."+((lt=ve==null?void 0:ve.split("."))==null?void 0:lt[((me=ve==null?void 0:ve.split("."))==null?void 0:me.length)-1]),blob:new Blob([ie.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:ze}),ie}));await Promise.all(Be)}else if(!(O!=null&&O.includes("https://"))&&!(O!=null&&O.includes("http://"))){ie=await Rt.downloadAvatarApi({url:O});let Be=[];if(((ue=$==null?void 0:$.mtlBlobs)==null?void 0:ue.length)>0){let ve=await((he=$==null?void 0:$.mtlBlobs)==null?void 0:he.map(async ze=>{let _e=await Rt.downloadAvatarApi({url:ze});return Be.push(new Blob([_e.data],{type:"application/octet-stream;charset=UTF-8"})),_e}));await Promise.all(ve)}Z={suffix:"."+((Se=O==null?void 0:O.split("."))==null?void 0:Se[((le=O==null?void 0:O.split("."))==null?void 0:le.length)-1]),blob:new Blob([ie.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:Be}}else{ie=await be.axios.get(O,{responseType:"blob",headers:{"Content-Type":"application/json"}});let Be=[];if(((Pe=$==null?void 0:$.mtlBlobs)==null?void 0:Pe.length)>0){let ve=await((Fe=$==null?void 0:$.mtlBlobs)==null?void 0:Fe.map(async ze=>{let _e=await be.axios.get(ze,{responseType:"blob",headers:{"Content-Type":"application/json"}});return Be.push(new Blob([_e.data],{type:"application/octet-stream;charset=UTF-8"})),_e}));await Promise.all(ve)}Z={suffix:"."+((tt=O==null?void 0:O.split("."))==null?void 0:tt[((et=O==null?void 0:O.split("."))==null?void 0:et.length)-1]),blob:new Blob([ie.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:Be}}console.log(2321,Z),Z&&H.push(Z)}));await Promise.all(re),m.value.loadModelByDefaultPath(H)}},{immediate:!0,deep:!0}),e.watch(()=>p.value,async()=>{var h,I,Y,H;if(p.value!==""&&p.value){let re=(h=j.value)==null?void 0:h.split("/"),$=re[(re==null?void 0:re.length)-2];const Z=(((I=Me==null?void 0:Me.find(X=>(X==null?void 0:X.key)===$))==null?void 0:I.download)??"")+"/"+p.value,O=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),W=await be.axios.post(Z,null,{responseType:"blob",headers:{Authorization:O,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var y=new Blob([W.data],{type:"application/octet-stream;charset=UTF-8"});const G=[{suffix:"."+((H=(Y=p.value)==null?void 0:Y.split("."))==null?void 0:H[1]),blob:y,mtlBlobs:[]}];m.value.loadModelByDefaultPath(G)}},{deep:!0,immediate:!0});const F=async()=>{var ie,Z,O,W,G,X,ue,he,le,Se,Pe,Fe,et,tt,Be,ve,ze;c.value=!0;let y=(ie=j.value)==null?void 0:ie.split("/"),h=y[(y==null?void 0:y.length)-2];const I=((Z=Me==null?void 0:Me.find(_e=>(_e==null?void 0:_e.key)===h))==null?void 0:Z.value)??"";let Y="";const H=await be.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});((O=H==null?void 0:H.data)==null?void 0:O.code)===200&&(Y=`Bearer ${(G=(W=H.data)==null?void 0:W.result)==null?void 0:G.accessToken}`,sessionStorage.setItem("magicToken",Y));const re=Y===""?"123456":Y,$=await be.axios.post(I,null,{headers:{Authorization:re,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((X=$==null?void 0:$.data)==null?void 0:X.type)==="success"&&r.IsJson((he=(ue=$==null?void 0:$.data)==null?void 0:ue.result)==null?void 0:he.result)){const _e=(et=(Fe=(Pe=JSON.parse((Se=(le=$==null?void 0:$.data)==null?void 0:le.result)==null?void 0:Se.result))==null?void 0:Pe.lines_file_paths)==null?void 0:Fe[0])==null?void 0:et.split("\\"),rt=(((tt=Me==null?void 0:Me.find(me=>(me==null?void 0:me.key)===h))==null?void 0:tt.resources)??"")+"/"+(((_e==null?void 0:_e[(_e==null?void 0:_e.length)-2])==="inputResources"?"outputResources":_e==null?void 0:_e[(_e==null?void 0:_e.length)-2])??"outputResources"),je=await be.axios.post(rt,null,{headers:{Authorization:re,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((Be=je==null?void 0:je.data)==null?void 0:Be.type)==="success"){const me=(ve=je==null?void 0:je.data)==null?void 0:ve.result,lt=de.showItems.value,ft=await((ze=st.cloneDeep(lt))==null?void 0:ze.map(async Ee=>{var Ze,mt,gt,yt,bt,wt;if((Ee==null?void 0:Ee.name)==="输出"){if((Ee==null?void 0:Ee.comp)==="Table")Ee.compData=(Ze=Ee==null?void 0:Ee.compData)==null?void 0:Ze.map(ge=>{var Ce,Oe;return(ge==null?void 0:ge.key)==="tableContents"&&(ge.contents=(Oe=(Ce=ge==null?void 0:ge.contents)==null?void 0:Ce.map(Ae=>(Ae=Ae==null?void 0:Ae.map((ke,Re)=>{var He,$e,qe;return typeof ke=="string"&&Re>1?((He=ge==null?void 0:ge.contents)==null?void 0:He.length)>1?ke=(($e=me==null?void 0:me[Re-1])!=null&&$e.includes("input")?ke:me==null?void 0:me[Re-1])??ke:ke=me==null?void 0:me[0]:ke=((qe=me==null?void 0:me[Re-1])!=null&&qe.includes("input")?ke:me==null?void 0:me[Re-1])??ke,ke}),Ae)))==null?void 0:Oe.filter((Ae,ke)=>ke<=(me==null?void 0:me.length)-1)),ge});else if((Ee==null?void 0:Ee.comp)==="Form"){let ge="";if(me==null||me.forEach(Ce=>{ge=ge===""?ge+Ce:ge+","+Ce}),Ee.compData=(mt=Ee==null?void 0:Ee.compData)==null?void 0:mt.map(Ce=>{var Oe;return(Ce==null?void 0:Ce.key)==="formContent"&&(Ce.contents=(Oe=Ce.contents)==null?void 0:Oe.map(Ae=>(Ae.value=ge,Ae))),Ce}),(gt=ge==null?void 0:ge.split(","))!=null&&gt.find(Ce=>Ce.includes(".obj"))){let Ce={};Ce.suffix=".obj";const Oe=[];let Ae=await((bt=(yt=ge==null?void 0:ge.split(","))==null?void 0:yt.filter(ke=>ke.includes(".obj")||ke.includes(".mtl")))==null?void 0:bt.map(async ke=>{var He,$e;if(ke.includes(".obj")){const nt=(((He=Me==null?void 0:Me.find(Ye=>(Ye==null?void 0:Ye.key)===h))==null?void 0:He.download)??"")+"/"+ke,Je=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Xe=await be.axios.post(nt,null,{responseType:"blob",headers:{Authorization:Je,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var Re=new Blob([Xe.data],{type:"application/octet-stream;charset=UTF-8"});Ce.blob=Re}else if(ke.includes(".mtl")){const nt=((($e=Me==null?void 0:Me.find(ct=>(ct==null?void 0:ct.key)===h))==null?void 0:$e.download)??"")+"/"+ke,Je=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Xe=await be.axios.post(nt,null,{responseType:"blob",headers:{Authorization:Je,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var Re=new Blob([Xe.data],{type:"application/octet-stream;charset=UTF-8"});Oe.push(Re)}}));await Promise.all(Ae),Ce.mtlBlobs=Oe,m.value.loadModelByDefaultPath([Ce])}else{const Ce=[];let Oe=await((wt=ge==null?void 0:ge.split(","))==null?void 0:wt.map(async Ae=>{var Je,Xe;let ke={};ke.suffix="."+((Je=Ae==null?void 0:Ae.split("."))==null?void 0:Je[1]);const He=(((Xe=Me==null?void 0:Me.find(Ye=>(Ye==null?void 0:Ye.key)===h))==null?void 0:Xe.download)??"")+"/"+Ae,$e=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),qe=await be.axios.post(He,null,{responseType:"blob",headers:{Authorization:$e,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var nt=new Blob([qe.data],{type:"application/octet-stream;charset=UTF-8"});ke.blob=nt,Ce.push(ke)}));await Promise.all(Oe),m.value.loadModelByDefaultPath(Ce)}}}return Ee}));de.showItems.value=await Promise.all(ft)}}l.value++,c.value=!1},A=e.ref(""),x=e.ref("open"),q=e.ref("open"),D=e.ref(!1),U=()=>{const y=document.getElementById("menuCollapse");x.value==="open"?(y.style.width="18.75rem",y.style.height="96%",y.style.overflow="auto"):(y.style.width="50px",y.style.height="50px",y.style.overflow="hidden")},se=()=>{const y=document.getElementById("operateCollapse");q.value==="open"?(y.style.width="25rem",y.style.height="96%",y.style.overflow="auto"):(y.style.width="50px",y.style.height="50px",y.style.overflow="hidden")},ce=()=>{D.value=!D.value;const y=document.getElementById("operateCollapse"),h=document.getElementById("menuCollapse");D.value?(h.style.width="18.75rem",y.style.width="calc(100% - 24rem)"):y.style.width="400px"};return(y,h)=>{const I=e.resolveComponent("el-button"),Y=e.resolveComponent("el-avatar"),H=e.resolveComponent("el-header"),re=e.resolveComponent("el-container"),$=e.resolveComponent("el-icon"),ie=e.resolveComponent("el-input"),Z=e.resolveComponent("el-aside"),O=e.resolveComponent("el-collapse-item"),W=e.resolveComponent("el-collapse"),G=e.resolveComponent("el-main"),X=e.resolveComponent("router-view"),ue=e.resolveDirective("loading");return e.unref(R)==="edit"?(e.openBlock(),e.createBlock(re,{key:0,class:"client-container"},{default:e.withCtx(()=>[e.createVNode(H,{class:"client-structure-header"},{default:e.withCtx(()=>{var he;return[e.createElementVNode("div",is,[e.createVNode(I,{class:"select-icon",onClick:e.unref(de.onBack)},{default:e.withCtx(()=>h[6]||(h[6]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[6]},8,["onClick"]),e.createVNode(I,{class:"select-icon",onClick:h[0]||(h[0]=le=>{var Se,Pe;return e.unref(de.clickSavePage)((Pe=(Se=e.unref(u))==null?void 0:Se.map(Fe=>Fe.value))==null?void 0:Pe.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(Qe.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[h[7]||(h[7]=e.createTextVNode(" 保存页面 "))]),_:1,__:[7]})]),e.createElementVNode("div",as,[(e.openBlock(),e.createBlock(dn,{key:e.unref(u),breadArray:e.unref(u),onClick:e.unref(de.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",rs,[e.createElementVNode("div",ls,[e.renderSlot(y.$slots,"default",{},void 0,!0)]),e.createVNode(Y,{size:35,src:(he=e.unref(b))==null?void 0:he.avatarUrl},{default:e.withCtx(()=>{var le;return[e.createTextVNode(e.toDisplayString(((le=e.unref(b))==null?void 0:le.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.unref(R)==="edit"?(e.openBlock(),e.createBlock(re,{key:0,class:"model-operate",style:{"margin-top":"10px",height:"0px"}},{default:e.withCtx(()=>[e.createElementVNode("div",cs,[e.createVNode(We.modelSelect)]),e.createElementVNode("div",ds,[e.createVNode(We.modelShow)]),e.createElementVNode("div",us,[e.createVNode(We.modelFill)])]),_:1})):e.createCommentVNode("",!0)]),_:3})):e.withDirectives((e.openBlock(),e.createBlock(re,{key:1,class:"client-container","element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.createVNode(H,{class:"client-header"},{default:e.withCtx(()=>{var he;return[e.createElementVNode("div",hs,[e.createVNode(Qe.SvgIcon,{name:"logo",style:{width:"clamp(18px, 1.5rem, 24px)",height:"clamp(18px, 1.5rem, 24px)","margin-right":"8px"}}),e.createTextVNode(" "+e.toDisplayString(e.unref(N)===""?"CPMPIP":e.unref(N)),1)]),e.createElementVNode("div",ps,[e.createVNode(ss,{mode:"horizontal"})]),e.createElementVNode("div",fs,[e.createVNode(ie,{modelValue:A.value,"onUpdate:modelValue":h[1]||(h[1]=le=>A.value=le),clearable:"",placeholder:"搜索",style:{width:"130px"}},{prefix:e.withCtx(()=>[e.createVNode($,{class:"el-input__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(ln.search_default))]),_:1})]),_:1},8,["modelValue"]),e.unref(R)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:h[2]||(h[2]=(...le)=>e.unref(de.onSelectFixContent)&&e.unref(de.onSelectFixContent)(...le))},[e.createElementVNode("div",ms,[e.createVNode(Qe.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),h[8]||(h[8]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",gs,[e.renderSlot(y.$slots,"default",{},void 0,!0)]),e.createVNode(Y,{size:35,src:(he=e.unref(b))==null?void 0:he.avatarUrl},{default:e.withCtx(()=>{var le;return[e.createTextVNode(e.toDisplayString(((le=e.unref(b))==null?void 0:le.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.createVNode(re,{class:"client-body"},{default:e.withCtx(()=>[y.$route.path==="/"?(e.openBlock(),e.createBlock(G,{key:0,class:"client-main"},{default:e.withCtx(()=>[e.createVNode(W,{modelValue:x.value,"onUpdate:modelValue":h[3]||(h[3]=he=>x.value=he),accordion:"",class:"client-aside",id:"menuCollapse",onChange:U},{default:e.withCtx(()=>[e.createVNode(O,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(Qe.SvgIcon,{name:x.value===""?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>[e.createVNode(Z,{style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(Bt.default,{mode:"vertical"})]),_:1})]),_:1})]),_:1},8,["modelValue"]),e.createElementVNode("div",ys,[e.createVNode(Ro,{isShow:k.value,windowConfig:M.windowConfig,ref_key:"threeModelRef",ref:m},null,8,["isShow","windowConfig"])]),e.createVNode(W,{modelValue:q.value,"onUpdate:modelValue":h[5]||(h[5]=he=>q.value=he),accordion:"",class:"client-main-operate",id:"operateCollapse",onChange:se},{default:e.withCtx(()=>[e.createVNode(O,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(Qe.SvgIcon,{name:q.value==="open"?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>{var he;return[e.createElementVNode("div",null,[e.createVNode(Qe.SvgIcon,{class:"fold-icon",name:D.value?"Right":"Left",onClick:ce},null,8,["name"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((he=e.unref(st.cloneDeep)(e.unref(de.showItems)))==null?void 0:he.filter(le=>le.comp!=="FormTop"),(le,Se)=>{var Pe;return e.openBlock(),e.createElementBlock("div",{class:"item-view-content",key:Se},[((Pe=le==null?void 0:le.comp)==null?void 0:Pe.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",bs,e.toDisplayString(le.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(de.getComponents)(le.comp)),{compName:le.name,itemData:le==null?void 0:le.compData,childItemData:le==null?void 0:le.itemChildData,key:(le==null?void 0:le.id)??Se,onChange:e.unref(de.onChange),index:(le==null?void 0:le.id)??Se,onContentChange:e.unref(de.onContentChange),onPageChange:e.unref(de.onPageChange)},null,40,["compName","itemData","childItemData","onChange","index","onContentChange","onPageChange"]))])}),128)),d.value?(e.openBlock(),e.createElementBlock("div",ws,[e.createVNode(zn._sfc_main,{class:"calculator-content",onClickTrigger:h[4]||(h[4]=le=>F()),loading:c.value,modelValue:"调用方法"},null,8,["loading"])])):e.createCommentVNode("",!0)])]}),_:1})]),_:1},8,["modelValue"])]),_:1})):(e.openBlock(),e.createBlock(G,{key:1,class:"client-router"},{default:e.withCtx(()=>[e.createElementVNode("div",_s,[e.createVNode(Z,{width:"300px"},{default:e.withCtx(()=>[e.createVNode(Bt.default,{mode:"vertical"})]),_:1})]),e.createVNode(G,{class:"router-main"},{default:e.withCtx(()=>[e.createVNode(X)]),_:1})]),_:1}))]),_:1})]),_:3})),[[ue,e.unref(E)]])}}}),Cs=it._export_sfc(ks,[["__scopeId","data-v-bcd28ffd"]]),vs={class:"system-wrap"},xs={__name:"index",props:{windowConfig:{type:Object,default:()=>{}},platform:{type:String,default:"browser"},content:String,jsonContents:Array},setup(M){const o=r.useModelComp(Ue.pinia),l=r.useUnit(Ue.pinia),c=be.useMenuState();e.ref(!1);const u=e.ref(!0),d=M;return e.onMounted(()=>{}),e.watch(()=>[d==null?void 0:d.content,d==null?void 0:d.jsonContents],async()=>{var w,b,L,R;if(((w=d==null?void 0:d.jsonContents)==null?void 0:w.length)>0){o.setOriginalData(d==null?void 0:d.jsonContents);return}if(!(d!=null&&d.content)||((b=d==null?void 0:d.content)==null?void 0:b.length)===0)return;u.value=!0,c.setImportLoading(!0);let _=[],p=[];l.setSelectTitle([]),l.setSelectIndex(""),l.setSelectMenu(""),(R=(L=d==null?void 0:d.content)==null?void 0:L.filter(V=>V!==""))==null||R.forEach(V=>{ot.isExpandStringToJson(V)?p.push(ot.expandStringToJson(V)):ot.expandNewStringToJson(V)?p.push(ot.expandNewStringToJson(V)):ot.expandContentStringToJson(V)?p.push(ot.expandContentStringToJson(V)):p.push(de.expandToNewContents(V))}),_=p==null?void 0:p[0],await de.savePageDataAsync(_),await r.loadingSystemType(),o.setOriginalData(_),c.setImportLoading(!1)},{deep:!0,immediate:!0}),(_,p)=>(e.openBlock(),e.createElementBlock("div",vs,[M.platform==="browser"?(e.openBlock(),e.createBlock(ns,{key:0},{default:e.withCtx(()=>[e.renderSlot(_.$slots,"default",{},void 0,!0)]),_:3})):(e.openBlock(),e.createBlock(Cs,{key:1,windowConfig:M.windowConfig},{default:e.withCtx(()=>[e.renderSlot(_.$slots,"default",{},void 0,!0)]),_:3},8,["windowConfig"]))]))}},Es=it._export_sfc(xs,[["__scopeId","data-v-65a44ad9"]]),Ns={class:"add-model-content"},Ts={key:0,class:"model-operate"},As={class:"model-select"},Ms={class:"model-fill"},Ss={key:1,class:"model-view"},Ps={key:0,class:"model-import-data"},Ls={__name:"index",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change","contentChange"],setup(M,{emit:o}){const l=M,c=o,u=e.ref([]),d=e.ref([]),_=e.ref([]),p=e.ref(0),w=r.useModelComp(Ue.pinia),b=be.useMenuState(Ue.pinia),{itemData:L,originalData:R}=be.storeToRefs(w),{activeMenuPath:V,platform:T}=be.storeToRefs(b),B=e.ref(null),v=e.ref(0),m=e.ref([]);e.ref("");const S=e.ref(0),E=g=>{c("contentChange",g)},j=g=>{var A;const F=(A=st.cloneDeep(g==null?void 0:g.wholeValue))==null?void 0:A.map(x=>{var q;return(x==null?void 0:x.comp)==="Form"&&(x.compData=(q=x.compData)==null?void 0:q.map(D=>((D==null?void 0:D.key)==="formContent"&&(D.contents=ot.arrayToNumberArray(D==null?void 0:D.contents)),D))),x});c("change",{originalContents:R.value,currentContents:g==null?void 0:g.wholeValue,editContent:g==null?void 0:g.editValue,arrayToContents:F})};e.watch(()=>d.value,()=>{S.value===d.value.length&&d.value.length!==0&&(u.value=d.value)},{deep:!0,immediate:!0});const N=()=>{B.value.click()},k=async g=>{const F=g.target.files;if(!F)return;new FileReader,u.value=[],d.value=[],S.value=F.length;const A=Array.from(F).map(async x=>await new Promise(q=>{const D=new FileReader;D.onload=U=>{try{d.value.push(U.target.result),v.value++}catch(se){console.error("解析失败:",se);return}},D.onerror=()=>q(`读取 ${x.name} 失败`),D.readAsText(x),g.target.value="",B.value=null}));await Promise.all(A)};return e.watch(()=>[l==null?void 0:l.content,l==null?void 0:l.jsonContents],async()=>{await r.loadingSystemType(),u.value=l.content,_.value=l==null?void 0:l.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>v.value,()=>{var g;((g=m.value)==null?void 0:g.length)!==0&&(w.setOriginalData(m.value),w.setItemData(m.value))},{deep:!0,immediate:!0}),(g,F)=>{const A=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",Ns,[(l==null?void 0:l.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",Ts,[e.createElementVNode("div",As,[e.createVNode(We.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:p.value},[e.createVNode(We.modelShow)])),e.createElementVNode("div",Ms,[e.createVNode(We.modelFill)])])):e.createCommentVNode("",!0),(l==null?void 0:l.mode)==="view"?(e.openBlock(),e.createElementBlock("div",Ss,[(e.openBlock(),e.createBlock(Es,{platform:e.unref(T),content:u.value,onChange:j,jsonContents:_.value,onContentChange:E,key:p.value},{default:e.withCtx(()=>{var x;return[((x=l==null?void 0:l.jsonContents)==null?void 0:x.length)===0&&(l!=null&&l.showButton)?(e.openBlock(),e.createElementBlock("div",Ps,[e.createElementVNode("div",{class:"import-button",onClick:N},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:B,accept:".txt, .inm",onChange:k,style:{display:"none"},multiple:""},null,544),e.createVNode(A,{name:"import",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}}),F[0]||(F[0]=e.createElementVNode("div",{class:"import-trigger"},e.toDisplayString("导入模型"),-1))])])):e.createCommentVNode("",!0)]}),_:1},8,["platform","content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},Vs=it._export_sfc(Ls,[["__scopeId","data-v-4bf164f6"]]);exports.default=Vs;
@@ -1,12 +1,12 @@
1
- import { ag as Cl, ai as tl, u as cl, ap as gl, au as kl, av as _l } from "./index-COWtJfBt.js";
1
+ import { ag as Cl, ai as tl, u as cl, ap as gl, au as kl, av as _l } from "./index-CmtqjWVW.js";
2
2
  import { ref as E, watch as we, createElementBlock as J, openBlock as L, createVNode as M, resolveComponent as be, Fragment as me, renderList as ye, createElementVNode as u, createCommentVNode as Ae, toDisplayString as Z, withCtx as se, createBlock as Ce, defineComponent as ze, reactive as el, createTextVNode as Pe, resolveDynamicComponent as Ge, computed as ll, renderSlot as He, createSlots as wl, mergeProps as xl, unref as Dl, normalizeStyle as Il, withModifiers as Ke } from "vue";
3
- import { p as Se } from "./index-DE3uvzqv.js";
4
- import { F as sl, b as De, s as Ie, g as $l, c as dl, d as _e, f as qe, m as Ye, e as Je, h as Ze, i as Tl, j as El, a as Bl } from "./index-BqyjHr9C.js";
5
- import { f as vl, s as Ue, E as Re, g as il, b as Fl } from "./menu-dd51TtC8.js";
3
+ import { p as Se } from "./index-CoOqtD57.js";
4
+ import { F as sl, b as De, s as Ie, g as $l, c as dl, d as _e, f as qe, m as Ye, e as Je, h as Ze, i as Tl, j as El, a as Bl } from "./index-CMF_TuV8.js";
5
+ import { f as vl, s as Ue, E as Re, g as il, b as Fl } from "./menu-9xaTSah9.js";
6
6
  import { _ as ge } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- import { c as p } from "./cloneDeep-BC6hApUL.js";
8
- import { E as Ne } from "./index-DjAg2mhq.js";
9
- import { s as Al, a as Ll } from "./index-DJUjFOtq.js";
7
+ import { c as p } from "./cloneDeep-Bx_iHhpy.js";
8
+ import { E as Ne } from "./index-Bh0t_Ii2.js";
9
+ import { s as Al, a as Ll } from "./index-_aOa1cxU.js";
10
10
  import Sl from "./index-CZtXRS3l.js";
11
11
  const Vl = (b) => b.match(/\((.*)\)/)[1], Ol = vl("formComp", {
12
12
  state: () => ({