@shopware-ag/dive 1.19.1-beta.9 → 2.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/chunks/FileTypes-BjZ0rrIV.cjs +1 -0
- package/build/chunks/FileTypes-qgYnI0Jg.mjs +30 -0
- package/build/chunks/ModuleRegistry-NyNtjHb2.cjs +1 -0
- package/build/chunks/ModuleRegistry-RSub8W0G.mjs +13 -0
- package/build/chunks/PerspectiveCamera-BByyG5R4.cjs +1 -0
- package/build/chunks/PerspectiveCamera-sm4_81KJ.mjs +34 -0
- package/build/chunks/SelectTool-BAXTVyWs.cjs +1 -0
- package/build/chunks/SelectTool-Bd8cC9nb.mjs +712 -0
- package/build/chunks/{SystemInfo-DYq9x4Ch.mjs → SystemInfo-DPAQG-S5.mjs} +37 -40
- package/build/chunks/SystemInfo-oX-NNneO.cjs +1 -0
- package/build/chunks/VisibilityLayerMask-BI7jPKdx.cjs +1 -0
- package/build/chunks/VisibilityLayerMask-CXgt1fJc.mjs +8 -0
- package/build/chunks/findInterface-BEdL2iUQ.cjs +1 -0
- package/build/chunks/findInterface-OrXgmwxj.mjs +18 -0
- package/build/chunks/index-C_uFFwT2.mjs +5 -0
- package/build/chunks/index-DAwIH9xh.cjs +1 -0
- package/build/chunks/package-BHjZWYD6.mjs +39 -0
- package/build/chunks/package-JHvTSNgQ.cjs +1 -0
- package/build/chunks/{fflate.module-Chbb_O8w.cjs → parse-error-2f5qpXP5.cjs} +2 -3
- package/build/chunks/{fflate.module-BQhIETD7.mjs → parse-error-DRBVHL9E.mjs} +16 -17
- package/build/dive.cjs +30 -0
- package/build/dive.mjs +1663 -0
- package/build/src/components/floor/Floor.d.ts +2 -2
- package/build/src/components/gizmo/Gizmo.d.ts +4 -4
- package/build/src/components/gizmo/handles/AxisHandle.d.ts +4 -4
- package/build/src/components/gizmo/handles/RadialHandle.d.ts +4 -4
- package/build/src/components/gizmo/handles/ScaleHandle.d.ts +4 -4
- package/build/src/components/gizmo/plane/GizmoPlane.d.ts +1 -1
- package/build/src/components/gizmo/rotate/RotateGizmo.d.ts +4 -4
- package/build/src/components/gizmo/scale/ScaleGizmo.d.ts +5 -5
- package/build/src/components/gizmo/translate/TranslateGizmo.d.ts +4 -4
- package/build/src/components/grid/Grid.d.ts +1 -1
- package/build/src/components/light/AmbientLight.d.ts +3 -3
- package/build/src/components/light/PointLight.d.ts +6 -6
- package/build/src/components/light/SceneLight.d.ts +3 -3
- package/build/src/components/model/Model.d.ts +9 -6
- package/build/src/components/node/Node.d.ts +4 -4
- package/build/src/components/primitive/Primitive.d.ts +4 -4
- package/build/src/components/root/Root.d.ts +20 -29
- package/build/src/core/Dive.d.ts +26 -14
- package/build/src/engine/Engine.d.ts +7 -11
- package/build/src/engine/clock/Clock.d.ts +4 -0
- package/build/src/engine/renderer/Renderer.d.ts +12 -8
- package/build/src/engine/resize/ResizeManager.d.ts +4 -2
- package/build/src/engine/scene/Scene.d.ts +6 -24
- package/build/src/engine/scene/xrroot/XRRoot.d.ts +5 -5
- package/build/src/engine/scene/xrroot/xrlightroot/XRLightRoot.d.ts +3 -3
- package/build/src/helpers/findSceneRecursive/findSceneRecursive.d.ts +1 -1
- package/build/src/helpers/isFileTypeSupported/isFileTypeSupported.d.ts +1 -1
- package/build/src/index.d.ts +6 -9
- package/build/src/interfaces/Draggable.d.ts +1 -1
- package/build/src/modules/ModuleRegistry.d.ts +19 -0
- package/build/src/modules/animation/AnimationSystem.cjs +1 -0
- package/build/src/modules/animation/AnimationSystem.d.ts +28 -4
- package/build/src/modules/animation/AnimationSystem.mjs +95 -0
- package/build/src/modules/animation/animator/Animator.d.ts +26 -0
- package/build/src/modules/animation/types/AnimatorParameters.d.ts +7 -0
- package/build/src/modules/ar/ARSystem.cjs +1 -2
- package/build/src/modules/ar/ARSystem.mjs +5 -5
- package/build/src/modules/ar/arquicklook/ARQuickLook.d.ts +1 -1
- package/build/src/modules/ar/sceneviewer/SceneViewer.d.ts +1 -1
- package/build/src/modules/ar/webxr/WebXR.d.ts +3 -3
- package/build/src/modules/ar/webxr/controller/WebXRController.d.ts +3 -3
- package/build/src/modules/ar/webxr/origin/WebXROrigin.d.ts +2 -2
- package/build/src/modules/ar/webxr/raycaster/WebXRRaycaster.d.ts +4 -4
- package/build/src/modules/ar/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +3 -3
- package/build/src/modules/ar/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +4 -4
- package/build/src/modules/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +1 -1
- package/build/src/modules/asset/converter/AssetConverter.cjs +0 -1
- package/build/src/modules/asset/converter/AssetConverter.d.ts +3 -3
- package/build/src/modules/asset/converter/AssetConverter.mjs +0 -1
- package/build/src/modules/asset/draco/README.md +32 -0
- package/build/src/modules/asset/draco/draco_decoder.js +33 -0
- package/build/src/modules/asset/draco/draco_decoder.wasm +0 -0
- package/build/src/modules/asset/draco/draco_encoder.js +33 -0
- package/build/src/modules/asset/draco/draco_wasm_wrapper.js +116 -0
- package/build/src/modules/asset/draco/gltf/draco_decoder.js +33 -0
- package/build/src/modules/asset/draco/gltf/draco_decoder.wasm +0 -0
- package/build/src/modules/asset/draco/gltf/draco_encoder.js +33 -0
- package/build/src/modules/asset/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/build/src/modules/asset/exporter/AssetExporter.cjs +1 -2
- package/build/src/modules/asset/exporter/AssetExporter.d.ts +3 -3
- package/build/src/modules/asset/exporter/AssetExporter.mjs +1 -2
- package/build/src/modules/asset/loader/AssetLoader.cjs +3 -2
- package/build/src/modules/asset/loader/AssetLoader.mjs +2152 -5
- package/build/src/modules/axiscamera/AxisCamera.d.ts +8 -9
- package/build/src/modules/controller/orbit/OrbitController.d.ts +13 -24
- package/build/src/modules/mediacreator/MediaCreator.cjs +1 -2
- package/build/src/modules/mediacreator/MediaCreator.d.ts +4 -4
- package/build/src/modules/mediacreator/MediaCreator.mjs +28 -3
- package/build/src/modules/state/ActionRegistry.d.ts +26 -0
- package/build/src/modules/state/State.cjs +27 -0
- package/build/src/modules/state/State.d.ts +58 -0
- package/build/src/modules/state/State.mjs +4296 -0
- package/build/src/modules/state/actions/action.d.ts +36 -0
- package/build/src/modules/state/actions/ar/index.d.ts +1 -0
- package/build/src/modules/state/actions/ar/launchar.d.ts +15 -0
- package/build/src/modules/state/actions/camera/computeencompassingview.d.ts +12 -0
- package/build/src/modules/state/actions/camera/getcameratransform.d.ts +12 -0
- package/build/src/modules/state/actions/camera/index.d.ts +6 -0
- package/build/src/modules/state/actions/camera/lockcamera.d.ts +8 -0
- package/build/src/modules/state/actions/camera/movecamera.d.ts +29 -0
- package/build/src/modules/state/actions/camera/setcameralayer.d.ts +12 -0
- package/build/src/modules/state/actions/camera/setcameratransform.d.ts +15 -0
- package/build/src/modules/state/actions/camera/zoomcamera.d.ts +14 -0
- package/build/src/modules/state/actions/index.d.ts +7 -0
- package/build/src/modules/state/actions/media/generatemedia.d.ts +25 -0
- package/build/src/modules/state/actions/media/index.d.ts +1 -0
- package/build/src/modules/state/actions/object/addobject.d.ts +8 -0
- package/build/src/modules/state/actions/object/deleteobject.d.ts +12 -0
- package/build/src/modules/state/actions/object/deselectobject.d.ts +12 -0
- package/build/src/modules/state/actions/object/dropit.d.ts +12 -0
- package/build/src/modules/state/actions/object/getallobjects.d.ts +8 -0
- package/build/src/modules/state/actions/object/getobjects.d.ts +12 -0
- package/build/src/modules/state/actions/object/index.d.ts +11 -0
- package/build/src/modules/state/actions/object/modelloaded.d.ts +12 -0
- package/build/src/modules/state/actions/object/placeonfloor.d.ts +12 -0
- package/build/src/modules/state/actions/object/selectobject.d.ts +12 -0
- package/build/src/modules/state/actions/object/setparent.d.ts +22 -0
- package/build/src/modules/state/actions/object/updateobject.d.ts +12 -0
- package/build/src/modules/state/actions/renderer/index.d.ts +1 -0
- package/build/src/modules/state/actions/renderer/startrender.d.ts +8 -0
- package/build/src/modules/state/actions/scene/exportscene.d.ts +13 -0
- package/build/src/modules/state/actions/scene/getallscenedata.d.ts +9 -0
- package/build/src/modules/state/actions/scene/index.d.ts +4 -0
- package/build/src/modules/state/actions/scene/setbackground.d.ts +12 -0
- package/build/src/modules/state/actions/scene/updatescene.d.ts +20 -0
- package/build/src/modules/state/actions/toolbox/index.d.ts +4 -0
- package/build/src/modules/state/actions/toolbox/setgizmomode.d.ts +12 -0
- package/build/src/modules/state/actions/toolbox/setgizmoscalelinked.d.ts +8 -0
- package/build/src/modules/state/actions/toolbox/setgizmovisible.d.ts +8 -0
- package/build/src/modules/state/actions/toolbox/usetool.d.ts +13 -0
- package/build/src/modules/state/types/ActionTypes.d.ts +18 -0
- package/build/src/modules/{com → state}/types/COMBaseEntity.d.ts +1 -1
- package/build/src/modules/state/types/COMEntity.d.ts +11 -0
- package/build/src/modules/{com → state}/types/COMGeometry.d.ts +1 -1
- package/build/src/modules/state/types/COMGroup.d.ts +11 -0
- package/build/src/modules/state/types/COMLight.d.ts +28 -0
- package/build/src/modules/state/types/COMModel.d.ts +14 -0
- package/build/src/modules/state/types/COMPov.d.ts +10 -0
- package/build/src/modules/state/types/COMPrimitive.d.ts +14 -0
- package/build/src/modules/state/types/index.d.ts +11 -0
- package/build/src/modules/systeminfo/SystemInfo.cjs +1 -2
- package/build/src/modules/systeminfo/SystemInfo.d.ts +1 -1
- package/build/src/modules/systeminfo/SystemInfo.mjs +3 -3
- package/build/src/modules/toolbox/BaseTool.d.ts +6 -6
- package/build/src/modules/toolbox/Toolbox.cjs +1 -0
- package/build/src/modules/toolbox/Toolbox.d.ts +12 -8
- package/build/src/modules/toolbox/Toolbox.mjs +99 -0
- package/build/src/modules/toolbox/select/SelectTool.d.ts +6 -6
- package/build/src/modules/toolbox/transform/TransformTool.d.ts +6 -6
- package/build/src/types/SceneData.d.ts +1 -1
- package/build/src/types/SceneObjects.d.ts +9 -7
- package/build/src/types/SceneType.d.ts +1 -1
- package/build/src/types/UUID.d.ts +1 -0
- package/build/src/types/file/index.d.ts +1 -1
- package/build/src/types/index.d.ts +6 -6
- package/package.json +34 -23
- package/build/chunks/AssetLoader-BYhwzCxs.cjs +0 -3
- package/build/chunks/AssetLoader-BYhwzCxs.cjs.map +0 -1
- package/build/chunks/AssetLoader-Bmcx40wo.mjs +0 -1948
- package/build/chunks/AssetLoader-Bmcx40wo.mjs.map +0 -1
- package/build/chunks/MediaCreator-CAXBbn15.mjs +0 -59
- package/build/chunks/MediaCreator-CAXBbn15.mjs.map +0 -1
- package/build/chunks/MediaCreator-DDXQIlRv.cjs +0 -2
- package/build/chunks/MediaCreator-DDXQIlRv.cjs.map +0 -1
- package/build/chunks/SystemInfo--669uW1p.cjs +0 -2
- package/build/chunks/SystemInfo--669uW1p.cjs.map +0 -1
- package/build/chunks/SystemInfo-DYq9x4Ch.mjs.map +0 -1
- package/build/chunks/fflate.module-BQhIETD7.mjs.map +0 -1
- package/build/chunks/fflate.module-Chbb_O8w.cjs.map +0 -1
- package/build/index.cjs +0 -57
- package/build/index.cjs.map +0 -1
- package/build/index.mjs +0 -6793
- package/build/index.mjs.map +0 -1
- package/build/src/engine/index.d.ts +0 -1
- package/build/src/engine/pipeline/RenderPipeline.d.ts +0 -26
- package/build/src/error/index.d.ts +0 -4
- package/build/src/modules/_system/ModuleImporter.d.ts +0 -43
- package/build/src/modules/ar/ARSystem.cjs.map +0 -1
- package/build/src/modules/ar/ARSystem.mjs.map +0 -1
- package/build/src/modules/asset/converter/AssetConverter.cjs.map +0 -1
- package/build/src/modules/asset/converter/AssetConverter.mjs.map +0 -1
- package/build/src/modules/asset/exporter/AssetExporter.cjs.map +0 -1
- package/build/src/modules/asset/exporter/AssetExporter.mjs.map +0 -1
- package/build/src/modules/asset/loader/AssetLoader.cjs.map +0 -1
- package/build/src/modules/asset/loader/AssetLoader.mjs.map +0 -1
- package/build/src/modules/com/Communication.d.ts +0 -72
- package/build/src/modules/com/actions/camera/computeencompassingview.d.ts +0 -9
- package/build/src/modules/com/actions/camera/getcameratransform.d.ts +0 -9
- package/build/src/modules/com/actions/camera/movecamera.d.ts +0 -15
- package/build/src/modules/com/actions/camera/resetcamera.d.ts +0 -7
- package/build/src/modules/com/actions/camera/setcameralayer.d.ts +0 -7
- package/build/src/modules/com/actions/camera/setcameratransform.d.ts +0 -9
- package/build/src/modules/com/actions/camera/zoomcamera.d.ts +0 -8
- package/build/src/modules/com/actions/index.d.ts +0 -60
- package/build/src/modules/com/actions/media/generatemedia.d.ts +0 -14
- package/build/src/modules/com/actions/object/addobject.d.ts +0 -6
- package/build/src/modules/com/actions/object/deleteobject.d.ts +0 -8
- package/build/src/modules/com/actions/object/deselectobject.d.ts +0 -8
- package/build/src/modules/com/actions/object/getallobjects.d.ts +0 -6
- package/build/src/modules/com/actions/object/getobjects.d.ts +0 -8
- package/build/src/modules/com/actions/object/model/dropit.d.ts +0 -7
- package/build/src/modules/com/actions/object/model/modelloaded.d.ts +0 -7
- package/build/src/modules/com/actions/object/model/placeonfloor.d.ts +0 -7
- package/build/src/modules/com/actions/object/selectobject.d.ts +0 -8
- package/build/src/modules/com/actions/object/setparent.d.ts +0 -13
- package/build/src/modules/com/actions/object/updateobject.d.ts +0 -8
- package/build/src/modules/com/actions/renderer/startrender.d.ts +0 -5
- package/build/src/modules/com/actions/scene/exportscene.d.ts +0 -8
- package/build/src/modules/com/actions/scene/getallscenedata.d.ts +0 -6
- package/build/src/modules/com/actions/scene/launchar.d.ts +0 -9
- package/build/src/modules/com/actions/scene/setbackground.d.ts +0 -7
- package/build/src/modules/com/actions/scene/updatescene.d.ts +0 -11
- package/build/src/modules/com/actions/toolbox/select/setgizmomode.d.ts +0 -7
- package/build/src/modules/com/actions/toolbox/transform/setgizmoscalelinked.d.ts +0 -5
- package/build/src/modules/com/actions/toolbox/transform/setgizmovisible.d.ts +0 -5
- package/build/src/modules/com/actions/toolbox/usetool.d.ts +0 -8
- package/build/src/modules/com/types/COMEntity.d.ts +0 -6
- package/build/src/modules/com/types/COMGroup.d.ts +0 -8
- package/build/src/modules/com/types/COMLight.d.ts +0 -10
- package/build/src/modules/com/types/COMModel.d.ts +0 -11
- package/build/src/modules/com/types/COMPov.d.ts +0 -7
- package/build/src/modules/com/types/COMPrimitive.d.ts +0 -11
- package/build/src/modules/com/types/index.d.ts +0 -11
- package/build/src/modules/index.d.ts +0 -2
- package/build/src/modules/mediacreator/MediaCreator.cjs.map +0 -1
- package/build/src/modules/mediacreator/MediaCreator.mjs.map +0 -1
- package/build/src/modules/systeminfo/SystemInfo.cjs.map +0 -1
- package/build/src/modules/systeminfo/SystemInfo.mjs.map +0 -1
- /package/build/{index.d.ts → dive.d.ts} +0 -0
- /package/build/src/modules/{com → state}/types/COMEntityType.d.ts +0 -0
- /package/build/src/modules/{com → state}/types/COMGeometryType.d.ts +0 -0
- /package/build/src/modules/{com → state}/types/COMMaterial.d.ts +0 -0
package/build/index.cjs
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";var dg=Object.defineProperty;var pg=(x,a,i)=>a in x?dg(x,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):x[a]=i;var v=(x,a,i)=>pg(x,typeof a!="symbol"?a+"":a,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("three"),Wn=require("@tweenjs/tween.js"),pe=require("./chunks/MediaCreator-DDXQIlRv.cjs"),Fs=require("three-spritetext"),Yn=require("./chunks/AssetLoader-BYhwzCxs.cjs"),Bc=require("./chunks/fflate.module-Chbb_O8w.cjs"),Ar=require("./chunks/SystemInfo--669uW1p.cjs"),gg=require("./src/modules/ar/ARSystem.cjs"),_g=require("./src/modules/asset/converter/AssetConverter.cjs"),mg=require("./src/modules/asset/exporter/AssetExporter.cjs"),xc={type:"change"},ks={type:"start"},Ac={type:"end"},mr=new u.Ray,Mc=new u.Plane,wg=Math.cos(70*u.MathUtils.DEG2RAD);class bg extends u.EventDispatcher{constructor(a,i){super(),this.object=a,this.domElement=i,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new u.Vector3,this.cursor=new u.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.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:u.MOUSE.ROTATE,MIDDLE:u.MOUSE.DOLLY,RIGHT:u.MOUSE.PAN},this.touches={ONE:u.TOUCH.ROTATE,TWO:u.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return T.phi},this.getAzimuthalAngle=function(){return T.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(p){p.addEventListener("keydown",wt),this._domElementKeyEvents=p},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",wt),this._domElementKeyEvents=null},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(xc),r.update(),S=f.NONE},this.update=function(){const p=new u.Vector3,O=new u.Quaternion().setFromUnitVectors(a.up,new u.Vector3(0,1,0)),k=O.clone().invert(),Q=new u.Vector3,ye=new u.Quaternion,vt=new u.Vector3,ke=2*Math.PI;return function(Or=null){const qn=r.object.position;p.copy(qn).sub(r.target),p.applyQuaternion(O),T.setFromVector3(p),r.autoRotate&&S===f.NONE&&Tt(Hn(Or)),r.enableDamping?(T.theta+=I.theta*r.dampingFactor,T.phi+=I.phi*r.dampingFactor):(T.theta+=I.theta,T.phi+=I.phi);let ft=r.minAzimuthAngle,dt=r.maxAzimuthAngle;isFinite(ft)&&isFinite(dt)&&(ft<-Math.PI?ft+=ke:ft>Math.PI&&(ft-=ke),dt<-Math.PI?dt+=ke:dt>Math.PI&&(dt-=ke),ft<=dt?T.theta=Math.max(ft,Math.min(dt,T.theta)):T.theta=T.theta>(ft+dt)/2?Math.max(ft,T.theta):Math.min(dt,T.theta)),T.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,T.phi)),T.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(ce,r.dampingFactor):r.target.add(ce),r.target.sub(r.cursor),r.target.clampLength(r.minTargetRadius,r.maxTargetRadius),r.target.add(r.cursor);let an=!1;if(r.zoomToCursor&&nt||r.object.isOrthographicCamera)T.radius=Ze(T.radius);else{const Xe=T.radius;T.radius=Ze(T.radius*Y),an=Xe!=T.radius}if(p.setFromSpherical(T),p.applyQuaternion(k),qn.copy(r.target).add(p),r.object.lookAt(r.target),r.enableDamping===!0?(I.theta*=1-r.dampingFactor,I.phi*=1-r.dampingFactor,ce.multiplyScalar(1-r.dampingFactor)):(I.set(0,0,0),ce.set(0,0,0)),r.zoomToCursor&&nt){let Xe=null;if(r.object.isPerspectiveCamera){const cn=p.length();Xe=Ze(cn*Y);const Ht=cn-Xe;r.object.position.addScaledVector(Le,Ht),r.object.updateMatrixWorld(),an=!!Ht}else if(r.object.isOrthographicCamera){const cn=new u.Vector3(ee.x,ee.y,0);cn.unproject(r.object);const Ht=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/Y)),r.object.updateProjectionMatrix(),an=Ht!==r.object.zoom;const Oi=new u.Vector3(ee.x,ee.y,0);Oi.unproject(r.object),r.object.position.sub(Oi).add(cn),r.object.updateMatrixWorld(),Xe=p.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;Xe!==null&&(this.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(Xe).add(r.object.position):(mr.origin.copy(r.object.position),mr.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(mr.direction))<wg?a.lookAt(r.target):(Mc.setFromNormalAndCoplanarPoint(r.object.up,r.target),mr.intersectPlane(Mc,r.target))))}else if(r.object.isOrthographicCamera){const Xe=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/Y)),Xe!==r.object.zoom&&(r.object.updateProjectionMatrix(),an=!0)}return Y=1,nt=!1,an||Q.distanceToSquared(r.object.position)>g||8*(1-ye.dot(r.object.quaternion))>g||vt.distanceToSquared(r.target)>g?(r.dispatchEvent(xc),Q.copy(r.object.position),ye.copy(r.object.quaternion),vt.copy(r.target),!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",Mn),r.domElement.removeEventListener("pointerdown",xi),r.domElement.removeEventListener("pointercancel",xe),r.domElement.removeEventListener("wheel",Ai),r.domElement.removeEventListener("pointermove",Ot),r.domElement.removeEventListener("pointerup",xe),r.domElement.getRootNode().removeEventListener("keydown",Mi,{capture:!0}),r._domElementKeyEvents!==null&&(r._domElementKeyEvents.removeEventListener("keydown",wt),r._domElementKeyEvents=null)};const r=this,f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let S=f.NONE;const g=1e-6,T=new u.Spherical,I=new u.Spherical;let Y=1;const ce=new u.Vector3,le=new u.Vector2,Te=new u.Vector2,Oe=new u.Vector2,me=new u.Vector2,ue=new u.Vector2,K=new u.Vector2,re=new u.Vector2,ne=new u.Vector2,Z=new u.Vector2,Le=new u.Vector3,ee=new u.Vector2;let nt=!1;const X=[],He={};let Mt=!1;function Hn(p){return p!==null?2*Math.PI/60*r.autoRotateSpeed*p:2*Math.PI/60/60*r.autoRotateSpeed}function zt(p){const O=Math.abs(p*.01);return Math.pow(.95,r.zoomSpeed*O)}function Tt(p){I.theta-=p}function Ft(p){I.phi-=p}const Ge=function(){const p=new u.Vector3;return function(k,Q){p.setFromMatrixColumn(Q,0),p.multiplyScalar(-k),ce.add(p)}}(),Se=function(){const p=new u.Vector3;return function(k,Q){r.screenSpacePanning===!0?p.setFromMatrixColumn(Q,1):(p.setFromMatrixColumn(Q,0),p.crossVectors(r.object.up,p)),p.multiplyScalar(k),ce.add(p)}}(),je=function(){const p=new u.Vector3;return function(k,Q){const ye=r.domElement;if(r.object.isPerspectiveCamera){const vt=r.object.position;p.copy(vt).sub(r.target);let ke=p.length();ke*=Math.tan(r.object.fov/2*Math.PI/180),Ge(2*k*ke/ye.clientHeight,r.object.matrix),Se(2*Q*ke/ye.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(Ge(k*(r.object.right-r.object.left)/r.object.zoom/ye.clientWidth,r.object.matrix),Se(Q*(r.object.top-r.object.bottom)/r.object.zoom/ye.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function ge(p){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?Y/=p:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function Pe(p){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?Y*=p:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function _e(p,O){if(!r.zoomToCursor)return;nt=!0;const k=r.domElement.getBoundingClientRect(),Q=p-k.left,ye=O-k.top,vt=k.width,ke=k.height;ee.x=Q/vt*2-1,ee.y=-(ye/ke)*2+1,Le.set(ee.x,ee.y,1).unproject(r.object).sub(r.object.position).normalize()}function Ze(p){return Math.max(r.minDistance,Math.min(r.maxDistance,p))}function ve(p){le.set(p.clientX,p.clientY)}function kt(p){_e(p.clientX,p.clientX),re.set(p.clientX,p.clientY)}function vn(p){me.set(p.clientX,p.clientY)}function yn(p){Te.set(p.clientX,p.clientY),Oe.subVectors(Te,le).multiplyScalar(r.rotateSpeed);const O=r.domElement;Tt(2*Math.PI*Oe.x/O.clientHeight),Ft(2*Math.PI*Oe.y/O.clientHeight),le.copy(Te),r.update()}function Vt(p){ne.set(p.clientX,p.clientY),Z.subVectors(ne,re),Z.y>0?ge(zt(Z.y)):Z.y<0&&Pe(zt(Z.y)),re.copy(ne),r.update()}function En(p){ue.set(p.clientX,p.clientY),K.subVectors(ue,me).multiplyScalar(r.panSpeed),je(K.x,K.y),me.copy(ue),r.update()}function Tr(p){_e(p.clientX,p.clientY),p.deltaY<0?Pe(zt(p.deltaY)):p.deltaY>0&&ge(zt(p.deltaY)),r.update()}function nn(p){let O=!1;switch(p.code){case r.keys.UP:p.ctrlKey||p.metaKey||p.shiftKey?Ft(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):je(0,r.keyPanSpeed),O=!0;break;case r.keys.BOTTOM:p.ctrlKey||p.metaKey||p.shiftKey?Ft(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):je(0,-r.keyPanSpeed),O=!0;break;case r.keys.LEFT:p.ctrlKey||p.metaKey||p.shiftKey?Tt(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):je(r.keyPanSpeed,0),O=!0;break;case r.keys.RIGHT:p.ctrlKey||p.metaKey||p.shiftKey?Tt(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):je(-r.keyPanSpeed,0),O=!0;break}O&&(p.preventDefault(),r.update())}function Wt(p){if(X.length===1)le.set(p.pageX,p.pageY);else{const O=bt(p),k=.5*(p.pageX+O.x),Q=.5*(p.pageY+O.y);le.set(k,Q)}}function vi(p){if(X.length===1)me.set(p.pageX,p.pageY);else{const O=bt(p),k=.5*(p.pageX+O.x),Q=.5*(p.pageY+O.y);me.set(k,Q)}}function rn(p){const O=bt(p),k=p.pageX-O.x,Q=p.pageY-O.y,ye=Math.sqrt(k*k+Q*Q);re.set(0,ye)}function Sn(p){r.enableZoom&&rn(p),r.enablePan&&vi(p)}function yi(p){r.enableZoom&&rn(p),r.enableRotate&&Wt(p)}function Fe(p){if(X.length==1)Te.set(p.pageX,p.pageY);else{const k=bt(p),Q=.5*(p.pageX+k.x),ye=.5*(p.pageY+k.y);Te.set(Q,ye)}Oe.subVectors(Te,le).multiplyScalar(r.rotateSpeed);const O=r.domElement;Tt(2*Math.PI*Oe.x/O.clientHeight),Ft(2*Math.PI*Oe.y/O.clientHeight),le.copy(Te)}function Nt(p){if(X.length===1)ue.set(p.pageX,p.pageY);else{const O=bt(p),k=.5*(p.pageX+O.x),Q=.5*(p.pageY+O.y);ue.set(k,Q)}K.subVectors(ue,me).multiplyScalar(r.panSpeed),je(K.x,K.y),me.copy(ue)}function Ei(p){const O=bt(p),k=p.pageX-O.x,Q=p.pageY-O.y,ye=Math.sqrt(k*k+Q*Q);ne.set(0,ye),Z.set(0,Math.pow(ne.y/re.y,r.zoomSpeed)),ge(Z.y),re.copy(ne);const vt=(p.pageX+O.x)*.5,ke=(p.pageY+O.y)*.5;_e(vt,ke)}function ht(p){r.enableZoom&&Ei(p),r.enablePan&&Nt(p)}function Si(p){r.enableZoom&&Ei(p),r.enableRotate&&Fe(p)}function xi(p){r.enabled!==!1&&(X.length===0&&(r.domElement.setPointerCapture(p.pointerId),r.domElement.addEventListener("pointermove",Ot),r.domElement.addEventListener("pointerup",xe)),!Qn(p)&&(Zn(p),p.pointerType==="touch"?An(p):sn(p)))}function Ot(p){r.enabled!==!1&&(p.pointerType==="touch"?jn(p):xn(p))}function xe(p){switch(Xn(p),X.length){case 0:r.domElement.releasePointerCapture(p.pointerId),r.domElement.removeEventListener("pointermove",Ot),r.domElement.removeEventListener("pointerup",xe),r.dispatchEvent(Ac),S=f.NONE;break;case 1:const O=X[0],k=He[O];An({pointerId:O,pageX:k.x,pageY:k.y});break}}function sn(p){let O;switch(p.button){case 0:O=r.mouseButtons.LEFT;break;case 1:O=r.mouseButtons.MIDDLE;break;case 2:O=r.mouseButtons.RIGHT;break;default:O=-1}switch(O){case u.MOUSE.DOLLY:if(r.enableZoom===!1)return;kt(p),S=f.DOLLY;break;case u.MOUSE.ROTATE:if(p.ctrlKey||p.metaKey||p.shiftKey){if(r.enablePan===!1)return;vn(p),S=f.PAN}else{if(r.enableRotate===!1)return;ve(p),S=f.ROTATE}break;case u.MOUSE.PAN:if(p.ctrlKey||p.metaKey||p.shiftKey){if(r.enableRotate===!1)return;ve(p),S=f.ROTATE}else{if(r.enablePan===!1)return;vn(p),S=f.PAN}break;default:S=f.NONE}S!==f.NONE&&r.dispatchEvent(ks)}function xn(p){switch(S){case f.ROTATE:if(r.enableRotate===!1)return;yn(p);break;case f.DOLLY:if(r.enableZoom===!1)return;Vt(p);break;case f.PAN:if(r.enablePan===!1)return;En(p);break}}function Ai(p){r.enabled===!1||r.enableZoom===!1||S!==f.NONE||(p.preventDefault(),r.dispatchEvent(ks),Tr(on(p)),r.dispatchEvent(Ac))}function on(p){const O=p.deltaMode,k={clientX:p.clientX,clientY:p.clientY,deltaY:p.deltaY};switch(O){case 1:k.deltaY*=16;break;case 2:k.deltaY*=100;break}return p.ctrlKey&&!Mt&&(k.deltaY*=10),k}function Mi(p){p.key==="Control"&&(Mt=!0,r.domElement.getRootNode().addEventListener("keyup",Yt,{passive:!0,capture:!0}))}function Yt(p){p.key==="Control"&&(Mt=!1,r.domElement.getRootNode().removeEventListener("keyup",Yt,{passive:!0,capture:!0}))}function wt(p){r.enabled===!1||r.enablePan===!1||nn(p)}function An(p){switch(Tn(p),X.length){case 1:switch(r.touches.ONE){case u.TOUCH.ROTATE:if(r.enableRotate===!1)return;Wt(p),S=f.TOUCH_ROTATE;break;case u.TOUCH.PAN:if(r.enablePan===!1)return;vi(p),S=f.TOUCH_PAN;break;default:S=f.NONE}break;case 2:switch(r.touches.TWO){case u.TOUCH.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Sn(p),S=f.TOUCH_DOLLY_PAN;break;case u.TOUCH.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;yi(p),S=f.TOUCH_DOLLY_ROTATE;break;default:S=f.NONE}break;default:S=f.NONE}S!==f.NONE&&r.dispatchEvent(ks)}function jn(p){switch(Tn(p),S){case f.TOUCH_ROTATE:if(r.enableRotate===!1)return;Fe(p),r.update();break;case f.TOUCH_PAN:if(r.enablePan===!1)return;Nt(p),r.update();break;case f.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ht(p),r.update();break;case f.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Si(p),r.update();break;default:S=f.NONE}}function Mn(p){r.enabled!==!1&&p.preventDefault()}function Zn(p){X.push(p.pointerId)}function Xn(p){delete He[p.pointerId];for(let O=0;O<X.length;O++)if(X[O]==p.pointerId){X.splice(O,1);return}}function Qn(p){for(let O=0;O<X.length;O++)if(X[O]==p.pointerId)return!0;return!1}function Tn(p){let O=He[p.pointerId];O===void 0&&(O=new u.Vector2,He[p.pointerId]=O),O.set(p.pageX,p.pageY)}function bt(p){const O=p.pointerId===X[0]?X[1]:X[0];return He[O]}r.domElement.addEventListener("contextmenu",Mn),r.domElement.addEventListener("pointerdown",xi),r.domElement.addEventListener("pointercancel",xe),r.domElement.addEventListener("wheel",Ai,{passive:!1}),r.domElement.getRootNode().addEventListener("keydown",Mi,{passive:!0,capture:!0}),this.update()}}const Er={enableDamping:!0,dampingFactor:.05},wi=class wi extends bg{constructor(i,r,f,S,g=Er){super(i,r.domElement);v(this,"_animationSystem");v(this,"_pipeline");v(this,"last",null);v(this,"animating",!1);v(this,"locked",!1);v(this,"stopMoveTo",()=>{});v(this,"stopRevertLast",()=>{});v(this,"object");v(this,"domElement");v(this,"preRenderCallback",()=>{this.locked||this.update()});this._animationSystem=S,this._pipeline=f,this.domElement=r.domElement,this.object=i,this._pipeline.addPreRenderStep(this.preRenderCallback),this.enableDamping=g.enableDamping||Er.enableDamping,this.dampingFactor=g.dampingFactor||Er.dampingFactor,this.object.position.set(0,2,2),this.target.copy({x:0,y:.5,z:0}),this.update()}Dispose(){this._pipeline.removePreRenderStep(this.preRenderCallback),this.dispose()}ComputeEncompassingView(i){const r=i.getCenter(new u.Vector3),f=i.getSize(new u.Vector3),S=Math.max(f.x,f.y,f.z)*1.25;return{position:this.object.position.clone().normalize().multiplyScalar(S),target:r}}ZoomIn(i){const r=i||wi.DEFAULT_ZOOM_FACTOR,{minDistance:f,maxDistance:S}=this;this.minDistance=this.maxDistance=u.MathUtils.clamp(this.getDistance()-r,f+r,S-r),this.update(),this.minDistance=f,this.maxDistance=S}ZoomOut(i){const r=i||wi.DEFAULT_ZOOM_FACTOR,{minDistance:f,maxDistance:S}=this;this.minDistance=this.maxDistance=u.MathUtils.clamp(this.getDistance()+r,f+r,S-r),this.update(),this.minDistance=f,this.maxDistance=S}MoveTo(i,r,f,S){if(this.animating)return;const g=i||this.object.position.clone(),T=r||this.target.clone();this.stopRevertLast(),this.locked||(this.last={pos:this.object.position.clone(),target:this.target.clone()}),this.animating=f>0,this.locked=S,this.enabled=!1;const I=this._animationSystem.Animate(this.object.position).to(g,f).easing(Wn.Easing.Quadratic.Out).start(),Y=this._animationSystem.Animate(this.target).to(T,f).easing(Wn.Easing.Quadratic.Out).onUpdate(()=>{this.object.lookAt(this.target)}).onComplete(()=>{this.animating=!1,this.enabled=!S}).start();this.stopMoveTo=()=>{I.stop(),Y.stop()}}RevertLast(i){if(this.animating||!this.locked)return;this.stopMoveTo(),this.animating=i>0,this.enabled=!1;const{pos:r,target:f}=this.last,S=this._animationSystem.Animate(this.object.position).to(r,i).easing(Wn.Easing.Quadratic.Out).start(),g=this._animationSystem.Animate(this.target).to(f,i).easing(Wn.Easing.Quadratic.Out).onUpdate(()=>{this.object.lookAt(this.target)}).onComplete(()=>{this.animating=!1,this.locked=!1,this.enabled=!0}).start();this.stopRevertLast=()=>{S.stop(),g.stop()}}};v(wi,"DEFAULT_ZOOM_FACTOR",1);let Ns=wi;function mi(x,a){return x?a in x:!1}function bi(x,a){if(x)return mi(x,a)?x:bi(x.parent,a)}class vg{constructor(a,i){v(this,"POINTER_DRAG_THRESHOLD",.001);v(this,"name");v(this,"_canvas");v(this,"_scene");v(this,"_controller");v(this,"_pointer");v(this,"_pointerPrimaryDown");v(this,"_pointerMiddleDown");v(this,"_pointerSecondaryDown");v(this,"_lastPointerDown");v(this,"_lastPointerUp");v(this,"_raycaster");v(this,"_intersects");v(this,"_hovered");v(this,"_dragging");v(this,"_dragStart");v(this,"_dragCurrent");v(this,"_dragEnd");v(this,"_dragDelta");v(this,"_draggable");v(this,"_dragRaycastOnObjects");this.name="BaseTool",this._canvas=i.domElement,this._scene=a,this._controller=i,this._pointer=new u.Vector2,this._pointerPrimaryDown=!1,this._pointerMiddleDown=!1,this._pointerSecondaryDown=!1,this._lastPointerDown=new u.Vector2,this._lastPointerUp=new u.Vector2,this._raycaster=new u.Raycaster,this._raycaster.layers.mask=pe.PRODUCT_LAYER_MASK|pe.UI_LAYER_MASK,this._intersects=[],this._hovered=null,this._dragging=!1,this._dragStart=new u.Vector3,this._dragCurrent=new u.Vector3,this._dragEnd=new u.Vector3,this._dragDelta=new u.Vector3,this._draggable=null,this._dragRaycastOnObjects=null}get _pointerAnyDown(){return this._pointerPrimaryDown||this._pointerMiddleDown||this._pointerSecondaryDown}Activate(){}Deactivate(){}onPointerDown(a){var i;switch(a.button){case 0:{this._pointerPrimaryDown=!0;break}case 1:{this._pointerMiddleDown=!0;break}case 2:{this._pointerSecondaryDown=!0;break}default:console.warn("DIVEBaseTool.onPointerDown: Unknown button: "+a.button)}this._lastPointerDown.copy(this._pointer),this._draggable=bi((i=this._intersects[0])==null?void 0:i.object,"isDraggable")||null}onDragStart(a){this._draggable&&(this._dragRaycastOnObjects!==null&&(this._intersects=this._raycaster.intersectObjects(this._dragRaycastOnObjects,!0)),this._intersects.length!==0&&(this._dragStart.copy(this._intersects[0].point.clone()),this._dragCurrent.copy(this._intersects[0].point.clone()),this._dragEnd.copy(this._dragStart.clone()),this._dragDelta.set(0,0,0),this._draggable&&this._draggable.onDragStart&&(this._draggable.onDragStart({dragStart:this._dragStart,dragCurrent:this._dragCurrent,dragEnd:this._dragEnd,dragDelta:this._dragDelta}),this._dragging=!0,this._controller.enabled=!1)))}onPointerMove(a){var r;this._pointer.x=a.offsetX/this._canvas.clientWidth*2-1,this._pointer.y=-(a.offsetY/this._canvas.clientHeight)*2+1,this._raycaster.setFromCamera(this._pointer,this._controller.object),this._intersects=this.raycast(this._scene.children);const i=bi((r=this._intersects[0])==null?void 0:r.object,"isHoverable");if(this._intersects[0]&&i){if(!this._hovered){i.onPointerEnter&&i.onPointerEnter(this._intersects[0]),this._hovered=i;return}if(this._hovered.uuid!==i.uuid){this._hovered.onPointerLeave&&this._hovered.onPointerLeave(),i.onPointerEnter&&i.onPointerEnter(this._intersects[0]),this._hovered=i;return}i.onPointerOver&&i.onPointerOver(this._intersects[0]),this._hovered=i}else this._hovered&&this._hovered.onPointerLeave&&this._hovered.onPointerLeave(),this._hovered=null;this._pointerAnyDown&&(this._dragging||this.onDragStart(a),this.onDrag(a))}onDrag(a){this._dragRaycastOnObjects!==null&&(this._intersects=this._raycaster.intersectObjects(this._dragRaycastOnObjects,!0));const i=this._intersects[0];i&&(this._dragCurrent.copy(i.point.clone()),this._dragEnd.copy(i.point.clone()),this._dragDelta.subVectors(this._dragCurrent.clone(),this._dragStart.clone()),this._draggable&&this._draggable.onDrag&&this._draggable.onDrag({dragStart:this._dragStart,dragCurrent:this._dragCurrent,dragEnd:this._dragEnd,dragDelta:this._dragDelta}))}onPointerUp(a){switch(this.pointerWasDragged()||this._dragging?this._draggable&&this.onDragEnd(a):this.onClick(a),a.button){case 0:this._pointerPrimaryDown=!1;break;case 1:this._pointerMiddleDown=!1;break;case 2:this._pointerSecondaryDown=!1;break}this._lastPointerUp.copy(this._pointer)}onClick(a){}onDragEnd(a){const i=this._intersects[0];i&&(this._dragEnd.copy(i.point.clone()),this._dragCurrent.copy(i.point.clone()),this._dragDelta.subVectors(this._dragCurrent.clone(),this._dragStart.clone())),this._draggable&&this._draggable.onDragEnd&&this._draggable.onDragEnd({dragStart:this._dragStart,dragCurrent:this._dragCurrent,dragEnd:this._dragEnd,dragDelta:this._dragDelta}),this._draggable=null,this._dragging=!1,this._dragStart.set(0,0,0),this._dragCurrent.set(0,0,0),this._dragEnd.set(0,0,0),this._dragDelta.set(0,0,0),this._controller.enabled=!0}onWheel(a){}raycast(a){return a!==void 0?this._raycaster.intersectObjects(a,!0).filter(i=>i.object.visible):this._raycaster.intersectObjects(this._scene.children,!0).filter(i=>i.object.visible)}pointerWasDragged(){return this._lastPointerDown.distanceTo(this._pointer)>this.POINTER_DRAG_THRESHOLD}}const wn=new u.Raycaster,Ce=new u.Vector3,tn=new u.Vector3,oe=new u.Quaternion,Tc={X:new u.Vector3(1,0,0),Y:new u.Vector3(0,1,0),Z:new u.Vector3(0,0,1)},Vs={type:"change"},Oc={type:"mouseDown"},Pc={type:"mouseUp",mode:null},Dc={type:"objectChange"};class yg extends u.Object3D{constructor(a,i){super(),i===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),i=document),this.isTransformControls=!0,this.visible=!1,this.domElement=i,this.domElement.style.touchAction="none";const r=new Tg;this._gizmo=r,this.add(r);const f=new Og;this._plane=f,this.add(f);const S=this;function g(ne,Z){let Le=Z;Object.defineProperty(S,ne,{get:function(){return Le!==void 0?Le:Z},set:function(ee){Le!==ee&&(Le=ee,f[ne]=ee,r[ne]=ee,S.dispatchEvent({type:ne+"-changed",value:ee}),S.dispatchEvent(Vs))}}),S[ne]=Z,f[ne]=Z,r[ne]=Z}g("camera",a),g("object",void 0),g("enabled",!0),g("axis",null),g("mode","translate"),g("translationSnap",null),g("rotationSnap",null),g("scaleSnap",null),g("space","world"),g("size",1),g("dragging",!1),g("showX",!0),g("showY",!0),g("showZ",!0);const T=new u.Vector3,I=new u.Vector3,Y=new u.Quaternion,ce=new u.Quaternion,le=new u.Vector3,Te=new u.Quaternion,Oe=new u.Vector3,me=new u.Vector3,ue=new u.Vector3,K=0,re=new u.Vector3;g("worldPosition",T),g("worldPositionStart",I),g("worldQuaternion",Y),g("worldQuaternionStart",ce),g("cameraPosition",le),g("cameraQuaternion",Te),g("pointStart",Oe),g("pointEnd",me),g("rotationAxis",ue),g("rotationAngle",K),g("eye",re),this._offset=new u.Vector3,this._startNorm=new u.Vector3,this._endNorm=new u.Vector3,this._cameraScale=new u.Vector3,this._parentPosition=new u.Vector3,this._parentQuaternion=new u.Quaternion,this._parentQuaternionInv=new u.Quaternion,this._parentScale=new u.Vector3,this._worldScaleStart=new u.Vector3,this._worldQuaternionInv=new u.Quaternion,this._worldScale=new u.Vector3,this._positionStart=new u.Vector3,this._quaternionStart=new u.Quaternion,this._scaleStart=new u.Vector3,this._getPointer=Eg.bind(this),this._onPointerDown=xg.bind(this),this._onPointerHover=Sg.bind(this),this._onPointerMove=Ag.bind(this),this._onPointerUp=Mg.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(a){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(a)}pointerHover(a){if(this.object===void 0||this.dragging===!0)return;a!==null&&wn.setFromCamera(a,this.camera);const i=Ws(this._gizmo.picker[this.mode],wn);i?this.axis=i.object.name:this.axis=null}pointerDown(a){if(!(this.object===void 0||this.dragging===!0||a!=null&&a.button!==0)&&this.axis!==null){a!==null&&wn.setFromCamera(a,this.camera);const i=Ws(this._plane,wn,!0);i&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(i.point).sub(this.worldPositionStart)),this.dragging=!0,Oc.mode=this.mode,this.dispatchEvent(Oc)}}pointerMove(a){const i=this.axis,r=this.mode,f=this.object;let S=this.space;if(r==="scale"?S="local":(i==="E"||i==="XYZE"||i==="XYZ")&&(S="world"),f===void 0||i===null||this.dragging===!1||a!==null&&a.button!==-1)return;a!==null&&wn.setFromCamera(a,this.camera);const g=Ws(this._plane,wn,!0);if(g){if(this.pointEnd.copy(g.point).sub(this.worldPositionStart),r==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),S==="local"&&i!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),i.indexOf("X")===-1&&(this._offset.x=0),i.indexOf("Y")===-1&&(this._offset.y=0),i.indexOf("Z")===-1&&(this._offset.z=0),S==="local"&&i!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),f.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(S==="local"&&(f.position.applyQuaternion(oe.copy(this._quaternionStart).invert()),i.search("X")!==-1&&(f.position.x=Math.round(f.position.x/this.translationSnap)*this.translationSnap),i.search("Y")!==-1&&(f.position.y=Math.round(f.position.y/this.translationSnap)*this.translationSnap),i.search("Z")!==-1&&(f.position.z=Math.round(f.position.z/this.translationSnap)*this.translationSnap),f.position.applyQuaternion(this._quaternionStart)),S==="world"&&(f.parent&&f.position.add(Ce.setFromMatrixPosition(f.parent.matrixWorld)),i.search("X")!==-1&&(f.position.x=Math.round(f.position.x/this.translationSnap)*this.translationSnap),i.search("Y")!==-1&&(f.position.y=Math.round(f.position.y/this.translationSnap)*this.translationSnap),i.search("Z")!==-1&&(f.position.z=Math.round(f.position.z/this.translationSnap)*this.translationSnap),f.parent&&f.position.sub(Ce.setFromMatrixPosition(f.parent.matrixWorld))));else if(r==="scale"){if(i.search("XYZ")!==-1){let T=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(T*=-1),tn.set(T,T,T)}else Ce.copy(this.pointStart),tn.copy(this.pointEnd),Ce.applyQuaternion(this._worldQuaternionInv),tn.applyQuaternion(this._worldQuaternionInv),tn.divide(Ce),i.search("X")===-1&&(tn.x=1),i.search("Y")===-1&&(tn.y=1),i.search("Z")===-1&&(tn.z=1);f.scale.copy(this._scaleStart).multiply(tn),this.scaleSnap&&(i.search("X")!==-1&&(f.scale.x=Math.round(f.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),i.search("Y")!==-1&&(f.scale.y=Math.round(f.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),i.search("Z")!==-1&&(f.scale.z=Math.round(f.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(r==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const T=20/this.worldPosition.distanceTo(Ce.setFromMatrixPosition(this.camera.matrixWorld));let I=!1;i==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Ce.copy(this.rotationAxis).cross(this.eye))*T):(i==="X"||i==="Y"||i==="Z")&&(this.rotationAxis.copy(Tc[i]),Ce.copy(Tc[i]),S==="local"&&Ce.applyQuaternion(this.worldQuaternion),Ce.cross(this.eye),Ce.length()===0?I=!0:this.rotationAngle=this._offset.dot(Ce.normalize())*T),(i==="E"||I)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),S==="local"&&i!=="E"&&i!=="XYZE"?(f.quaternion.copy(this._quaternionStart),f.quaternion.multiply(oe.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),f.quaternion.copy(oe.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),f.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Vs),this.dispatchEvent(Dc)}}pointerUp(a){a!==null&&a.button!==0||(this.dragging&&this.axis!==null&&(Pc.mode=this.mode,this.dispatchEvent(Pc)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(a){a.geometry&&a.geometry.dispose(),a.material&&a.material.dispose()})}attach(a){return this.object=a,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Vs),this.dispatchEvent(Dc),this.pointStart.copy(this.pointEnd))}getRaycaster(){return wn}getMode(){return this.mode}setMode(a){this.mode=a}setTranslationSnap(a){this.translationSnap=a}setRotationSnap(a){this.rotationSnap=a}setScaleSnap(a){this.scaleSnap=a}setSize(a){this.size=a}setSpace(a){this.space=a}}function Eg(x){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:x.button};{const a=this.domElement.getBoundingClientRect();return{x:(x.clientX-a.left)/a.width*2-1,y:-(x.clientY-a.top)/a.height*2+1,button:x.button}}}function Sg(x){if(this.enabled)switch(x.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(x));break}}function xg(x){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(x.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(x)),this.pointerDown(this._getPointer(x)))}function Ag(x){this.enabled&&this.pointerMove(this._getPointer(x))}function Mg(x){this.enabled&&(this.domElement.releasePointerCapture(x.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(x)))}function Ws(x,a,i){const r=a.intersectObject(x,!0);for(let f=0;f<r.length;f++)if(r[f].object.visible||i)return r[f];return!1}const wr=new u.Euler,J=new u.Vector3(0,1,0),Ic=new u.Vector3(0,0,0),Rc=new u.Matrix4,br=new u.Quaternion,Sr=new u.Quaternion,xt=new u.Vector3,Cc=new u.Matrix4,pi=new u.Vector3(1,0,0),bn=new u.Vector3(0,1,0),gi=new u.Vector3(0,0,1),vr=new u.Vector3,fi=new u.Vector3,di=new u.Vector3;class Tg extends u.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const a=new u.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=new u.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),r=a.clone();r.opacity=.15;const f=i.clone();f.opacity=.5;const S=a.clone();S.color.setHex(16711680);const g=a.clone();g.color.setHex(65280);const T=a.clone();T.color.setHex(255);const I=a.clone();I.color.setHex(16711680),I.opacity=.5;const Y=a.clone();Y.color.setHex(65280),Y.opacity=.5;const ce=a.clone();ce.color.setHex(255),ce.opacity=.5;const le=a.clone();le.opacity=.25;const Te=a.clone();Te.color.setHex(16776960),Te.opacity=.25,a.clone().color.setHex(16776960);const me=a.clone();me.color.setHex(7895160);const ue=new u.CylinderGeometry(0,.04,.1,12);ue.translate(0,.05,0);const K=new u.BoxGeometry(.08,.08,.08);K.translate(0,.04,0);const re=new u.BufferGeometry;re.setAttribute("position",new u.Float32BufferAttribute([0,0,0,1,0,0],3));const ne=new u.CylinderGeometry(.0075,.0075,.5,3);ne.translate(0,.25,0);function Z(Se,je){const ge=new u.TorusGeometry(Se,.0075,3,64,je*Math.PI*2);return ge.rotateY(Math.PI/2),ge.rotateX(Math.PI/2),ge}function Le(){const Se=new u.BufferGeometry;return Se.setAttribute("position",new u.Float32BufferAttribute([0,0,0,1,1,1],3)),Se}const ee={X:[[new u.Mesh(ue,S),[.5,0,0],[0,0,-Math.PI/2]],[new u.Mesh(ue,S),[-.5,0,0],[0,0,Math.PI/2]],[new u.Mesh(ne,S),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new u.Mesh(ue,g),[0,.5,0]],[new u.Mesh(ue,g),[0,-.5,0],[Math.PI,0,0]],[new u.Mesh(ne,g)]],Z:[[new u.Mesh(ue,T),[0,0,.5],[Math.PI/2,0,0]],[new u.Mesh(ue,T),[0,0,-.5],[-Math.PI/2,0,0]],[new u.Mesh(ne,T),null,[Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.OctahedronGeometry(.1,0),le.clone()),[0,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),ce.clone()),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),I.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),Y.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},nt={X:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[.3,0,0],[0,0,-Math.PI/2]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,.3,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,-.3,0],[0,0,Math.PI]]],Z:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,0,.3],[Math.PI/2,0,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.OctahedronGeometry(.2,0),r)]],XY:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[.15,0,.15],[-Math.PI/2,0,0]]]},X={START:[[new u.Mesh(new u.OctahedronGeometry(.01,2),f),null,null,null,"helper"]],END:[[new u.Mesh(new u.OctahedronGeometry(.01,2),f),null,null,null,"helper"]],DELTA:[[new u.Line(Le(),f),null,null,null,"helper"]],X:[[new u.Line(re,f.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new u.Line(re,f.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new u.Line(re,f.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},He={XYZE:[[new u.Mesh(Z(.5,1),me),null,[0,Math.PI/2,0]]],X:[[new u.Mesh(Z(.5,.5),S)]],Y:[[new u.Mesh(Z(.5,.5),g),null,[0,0,-Math.PI/2]]],Z:[[new u.Mesh(Z(.5,.5),T),null,[0,Math.PI/2,0]]],E:[[new u.Mesh(Z(.75,1),Te),null,[0,Math.PI/2,0]]]},Mt={AXIS:[[new u.Line(re,f.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},Hn={XYZE:[[new u.Mesh(new u.SphereGeometry(.25,10,8),r)]],X:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new u.Mesh(new u.TorusGeometry(.5,.1,4,24),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new u.Mesh(new u.TorusGeometry(.75,.1,2,24),r)]]},zt={X:[[new u.Mesh(K,S),[.5,0,0],[0,0,-Math.PI/2]],[new u.Mesh(ne,S),[0,0,0],[0,0,-Math.PI/2]],[new u.Mesh(K,S),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(K,g),[0,.5,0]],[new u.Mesh(ne,g)],[new u.Mesh(K,g),[0,-.5,0],[0,0,Math.PI]]],Z:[[new u.Mesh(K,T),[0,0,.5],[Math.PI/2,0,0]],[new u.Mesh(ne,T),[0,0,0],[Math.PI/2,0,0]],[new u.Mesh(K,T),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),ce),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),I),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.15,.15,.01),Y),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.BoxGeometry(.1,.1,.1),le.clone())]]},Tt={X:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[.3,0,0],[0,0,-Math.PI/2]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,.3,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,-.3,0],[0,0,Math.PI]]],Z:[[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,0,.3],[Math.PI/2,0,0]],[new u.Mesh(new u.CylinderGeometry(.2,0,.6,4),r),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[.15,.15,0]]],YZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.01),r),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new u.Mesh(new u.BoxGeometry(.2,.2,.2),r),[0,0,0]]]},Ft={X:[[new u.Line(re,f.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new u.Line(re,f.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new u.Line(re,f.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function Ge(Se){const je=new u.Object3D;for(const ge in Se)for(let Pe=Se[ge].length;Pe--;){const _e=Se[ge][Pe][0].clone(),Ze=Se[ge][Pe][1],ve=Se[ge][Pe][2],kt=Se[ge][Pe][3],vn=Se[ge][Pe][4];_e.name=ge,_e.tag=vn,Ze&&_e.position.set(Ze[0],Ze[1],Ze[2]),ve&&_e.rotation.set(ve[0],ve[1],ve[2]),kt&&_e.scale.set(kt[0],kt[1],kt[2]),_e.updateMatrix();const yn=_e.geometry.clone();yn.applyMatrix4(_e.matrix),_e.geometry=yn,_e.renderOrder=1/0,_e.position.set(0,0,0),_e.rotation.set(0,0,0),_e.scale.set(1,1,1),je.add(_e)}return je}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=Ge(ee)),this.add(this.gizmo.rotate=Ge(He)),this.add(this.gizmo.scale=Ge(zt)),this.add(this.picker.translate=Ge(nt)),this.add(this.picker.rotate=Ge(Hn)),this.add(this.picker.scale=Ge(Tt)),this.add(this.helper.translate=Ge(X)),this.add(this.helper.rotate=Ge(Mt)),this.add(this.helper.scale=Ge(Ft)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(a){const r=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Sr;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let f=[];f=f.concat(this.picker[this.mode].children),f=f.concat(this.gizmo[this.mode].children),f=f.concat(this.helper[this.mode].children);for(let S=0;S<f.length;S++){const g=f[S];g.visible=!0,g.rotation.set(0,0,0),g.position.copy(this.worldPosition);let T;if(this.camera.isOrthographicCamera?T=(this.camera.top-this.camera.bottom)/this.camera.zoom:T=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),g.scale.set(1,1,1).multiplyScalar(T*this.size/4),g.tag==="helper"){g.visible=!1,g.name==="AXIS"?(g.visible=!!this.axis,this.axis==="X"&&(oe.setFromEuler(wr.set(0,0,0)),g.quaternion.copy(r).multiply(oe),Math.abs(J.copy(pi).applyQuaternion(r).dot(this.eye))>.9&&(g.visible=!1)),this.axis==="Y"&&(oe.setFromEuler(wr.set(0,0,Math.PI/2)),g.quaternion.copy(r).multiply(oe),Math.abs(J.copy(bn).applyQuaternion(r).dot(this.eye))>.9&&(g.visible=!1)),this.axis==="Z"&&(oe.setFromEuler(wr.set(0,Math.PI/2,0)),g.quaternion.copy(r).multiply(oe),Math.abs(J.copy(gi).applyQuaternion(r).dot(this.eye))>.9&&(g.visible=!1)),this.axis==="XYZE"&&(oe.setFromEuler(wr.set(0,Math.PI/2,0)),J.copy(this.rotationAxis),g.quaternion.setFromRotationMatrix(Rc.lookAt(Ic,J,bn)),g.quaternion.multiply(oe),g.visible=this.dragging),this.axis==="E"&&(g.visible=!1)):g.name==="START"?(g.position.copy(this.worldPositionStart),g.visible=this.dragging):g.name==="END"?(g.position.copy(this.worldPosition),g.visible=this.dragging):g.name==="DELTA"?(g.position.copy(this.worldPositionStart),g.quaternion.copy(this.worldQuaternionStart),Ce.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Ce.applyQuaternion(this.worldQuaternionStart.clone().invert()),g.scale.copy(Ce),g.visible=this.dragging):(g.quaternion.copy(r),this.dragging?g.position.copy(this.worldPositionStart):g.position.copy(this.worldPosition),this.axis&&(g.visible=this.axis.search(g.name)!==-1));continue}g.quaternion.copy(r),this.mode==="translate"||this.mode==="scale"?(g.name==="X"&&Math.abs(J.copy(pi).applyQuaternion(r).dot(this.eye))>.99&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1),g.name==="Y"&&Math.abs(J.copy(bn).applyQuaternion(r).dot(this.eye))>.99&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1),g.name==="Z"&&Math.abs(J.copy(gi).applyQuaternion(r).dot(this.eye))>.99&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1),g.name==="XY"&&Math.abs(J.copy(gi).applyQuaternion(r).dot(this.eye))<.2&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1),g.name==="YZ"&&Math.abs(J.copy(pi).applyQuaternion(r).dot(this.eye))<.2&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1),g.name==="XZ"&&Math.abs(J.copy(bn).applyQuaternion(r).dot(this.eye))<.2&&(g.scale.set(1e-10,1e-10,1e-10),g.visible=!1)):this.mode==="rotate"&&(br.copy(r),J.copy(this.eye).applyQuaternion(oe.copy(r).invert()),g.name.search("E")!==-1&&g.quaternion.setFromRotationMatrix(Rc.lookAt(this.eye,Ic,bn)),g.name==="X"&&(oe.setFromAxisAngle(pi,Math.atan2(-J.y,J.z)),oe.multiplyQuaternions(br,oe),g.quaternion.copy(oe)),g.name==="Y"&&(oe.setFromAxisAngle(bn,Math.atan2(J.x,J.z)),oe.multiplyQuaternions(br,oe),g.quaternion.copy(oe)),g.name==="Z"&&(oe.setFromAxisAngle(gi,Math.atan2(J.y,J.x)),oe.multiplyQuaternions(br,oe),g.quaternion.copy(oe))),g.visible=g.visible&&(g.name.indexOf("X")===-1||this.showX),g.visible=g.visible&&(g.name.indexOf("Y")===-1||this.showY),g.visible=g.visible&&(g.name.indexOf("Z")===-1||this.showZ),g.visible=g.visible&&(g.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),g.material._color=g.material._color||g.material.color.clone(),g.material._opacity=g.material._opacity||g.material.opacity,g.material.color.copy(g.material._color),g.material.opacity=g.material._opacity,this.enabled&&this.axis&&(g.name===this.axis||this.axis.split("").some(function(I){return g.name===I}))&&(g.material.color.setHex(16776960),g.material.opacity=1)}super.updateMatrixWorld(a)}}class Og extends u.Mesh{constructor(){super(new u.PlaneGeometry(1e5,1e5,2,2),new u.MeshBasicMaterial({visible:!1,wireframe:!0,side:u.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(a){let i=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(i="local"),vr.copy(pi).applyQuaternion(i==="local"?this.worldQuaternion:Sr),fi.copy(bn).applyQuaternion(i==="local"?this.worldQuaternion:Sr),di.copy(gi).applyQuaternion(i==="local"?this.worldQuaternion:Sr),J.copy(fi),this.mode){case"translate":case"scale":switch(this.axis){case"X":J.copy(this.eye).cross(vr),xt.copy(vr).cross(J);break;case"Y":J.copy(this.eye).cross(fi),xt.copy(fi).cross(J);break;case"Z":J.copy(this.eye).cross(di),xt.copy(di).cross(J);break;case"XY":xt.copy(di);break;case"YZ":xt.copy(vr);break;case"XZ":J.copy(di),xt.copy(fi);break;case"XYZ":case"E":xt.set(0,0,0);break}break;case"rotate":default:xt.set(0,0,0)}xt.length()===0?this.quaternion.copy(this.cameraQuaternion):(Cc.lookAt(Ce.set(0,0,0),xt,J),this.quaternion.setFromRotationMatrix(Cc)),super.updateMatrixWorld(a)}}const Uc="#c20017",zc="#00ab26",Fc="#0081d4",Ys=Uc,Hs=zc,js=Fc;class Pg extends vg{constructor(i,r){super(i,r);v(this,"isTransformTool",!0);v(this,"_scaleLinked");v(this,"_gizmo");this.name="DIVETransformTool",this._scaleLinked=!1,this._gizmo=this.initGizmo(),this._scene.add(this._gizmo)}Activate(){}SetGizmoMode(i){this._gizmo.mode=i}SetGizmoVisibility(i){const r=this._scene.children.includes(this._gizmo);i&&!r?(this._scene.add(this._gizmo),"isTransformControls"in this._gizmo&&this._gizmo.getRaycaster().layers.enableAll()):!i&&r&&(this._scene.remove(this._gizmo),"isTransformControls"in this._gizmo&&this._gizmo.getRaycaster().layers.disableAll())}SetGizmoScaleLinked(i){this._scaleLinked=i}initGizmo(){const i=new yg(this._controller.object,this._controller.domElement);return i.mode="translate",i.traverse(r=>{if(!("isMesh"in r))return;const f=r.material;r.name==="X"&&f.color.set(Ys),r.name==="Y"&&f.color.set(Hs),r.name==="Z"&&f.color.set(js),r.name==="XY"&&f.color.set(js),r.name==="YZ"&&f.color.set(Ys),r.name==="XZ"&&f.color.set(Hs)}),i.addEventListener("mouseDown",()=>{this._controller.enabled=!1,mi(i.object,"isMovable")&&i.object.onMoveStart&&i.object.onMoveStart()}),i.addEventListener("objectChange",()=>{if(mi(i.object,"isMovable")&&i.object.onMove&&(i.object.onMove(),this._scaleLinked)){const r=i.object.scale,f=(r.x+r.y+r.z)/3;i.object.scale.set(f,f,f)}}),i.addEventListener("mouseUp",()=>{this._controller.enabled=!0,mi(i.object,"isMovable")&&i.object.onMoveEnd&&i.object.onMoveEnd()}),i}}const Lc=x=>x.isSelectTool!==void 0;class Dg extends Pg{constructor(i,r){super(i,r);v(this,"isSelectTool",!0);this.name="SelectTool"}Activate(){}Select(i){this.AttachGizmo(i),i.onSelect&&i.onSelect()}Deselect(i){this.DetachGizmo(),i.onDeselect&&i.onDeselect()}AttachGizmo(i){if("isMovable"in i){const r=i;this._gizmo.attach(r),this.SetGizmoVisibility(r.visible)}}DetachGizmo(){this._gizmo.detach()}onClick(i){super.onClick(i);const r=this._raycaster.intersectObjects(this._scene.Root.children,!0).filter(S=>S.object.visible)[0],f=bi(r==null?void 0:r.object,"isSelectable");if(!r||!f){this._gizmo.object&&this.Deselect(this._gizmo.object);return}if(this._gizmo.object){if(this._gizmo.object.uuid===f.uuid)return;this.Deselect(this._gizmo.object)}this.Select(f)}}class kc{constructor(a,i){v(this,"_scene");v(this,"_controller");v(this,"_activeTool");v(this,"_selectTool");this._scene=a,this._controller=i,this._selectTool=null,this._activeTool=null}get selectTool(){return this._selectTool||(this._selectTool=new Dg(this._scene,this._controller)),this._selectTool}Dispose(){this.removeEventListeners()}GetActiveTool(){return this._activeTool}UseTool(a){var i;switch((i=this._activeTool)==null||i.Deactivate(),a){case"select":{this.addEventListeners(),this.selectTool.Activate(),this._activeTool=this.selectTool;break}case"none":{this.removeEventListeners(),this._activeTool=null;break}default:console.warn(`DIVEToolBox.UseTool: Unknown tool: ${a}`)}}SetGizmoMode(a){this.selectTool.SetGizmoMode(a)}SetGizmoVisibility(a){this.selectTool.SetGizmoVisibility(a)}SetGizmoScaleLinked(a){this.selectTool.SetGizmoScaleLinked(a)}onPointerMove(a){var i;(i=this._activeTool)==null||i.onPointerMove(a)}onPointerDown(a){var i;(i=this._activeTool)==null||i.onPointerDown(a)}onPointerUp(a){var i;(i=this._activeTool)==null||i.onPointerUp(a)}onWheel(a){var i;(i=this._activeTool)==null||i.onWheel(a)}addEventListeners(){this._controller.domElement.addEventListener("pointermove",a=>this.onPointerMove(a)),this._controller.domElement.addEventListener("pointerdown",a=>this.onPointerDown(a)),this._controller.domElement.addEventListener("pointerup",a=>this.onPointerUp(a)),this._controller.domElement.addEventListener("wheel",a=>this.onWheel(a))}removeEventListeners(){this._controller.domElement.removeEventListener("pointermove",a=>this.onPointerMove(a)),this._controller.domElement.removeEventListener("pointerdown",a=>this.onPointerDown(a)),this._controller.domElement.removeEventListener("pointerup",a=>this.onPointerUp(a)),this._controller.domElement.removeEventListener("wheel",a=>this.onWheel(a))}}v(kc,"DefaultTool","select");const Re=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function Ig(){const x=Math.random()*4294967295|0,a=Math.random()*4294967295|0,i=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Re[x&255]+Re[x>>8&255]+Re[x>>16&255]+Re[x>>24&255]+"-"+Re[a&255]+Re[a>>8&255]+"-"+Re[a>>16&15|64]+Re[a>>24&255]+"-"+Re[i&63|128]+Re[i>>8&255]+"-"+Re[i>>16&255]+Re[i>>24&255]+Re[r&255]+Re[r>>8&255]+Re[r>>16&255]+Re[r>>24&255]).toLowerCase()}var yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},_i={exports:{}};/**
|
|
2
|
-
* @license
|
|
3
|
-
* Lodash <https://lodash.com/>
|
|
4
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
5
|
-
* Released under MIT license <https://lodash.com/license>
|
|
6
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
7
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
8
|
-
*/var Rg=_i.exports,Gc;function Cg(){return Gc||(Gc=1,function(x,a){(function(){var i,r="4.17.21",f=200,S="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",T="Invalid `variable` option passed into `_.template`",I="__lodash_hash_undefined__",Y=500,ce="__lodash_placeholder__",le=1,Te=2,Oe=4,me=1,ue=2,K=1,re=2,ne=4,Z=8,Le=16,ee=32,nt=64,X=128,He=256,Mt=512,Hn=30,zt="...",Tt=800,Ft=16,Ge=1,Se=2,je=3,ge=1/0,Pe=9007199254740991,_e=17976931348623157e292,Ze=NaN,ve=4294967295,kt=ve-1,vn=ve>>>1,yn=[["ary",X],["bind",K],["bindKey",re],["curry",Z],["curryRight",Le],["flip",Mt],["partial",ee],["partialRight",nt],["rearg",He]],Vt="[object Arguments]",En="[object Array]",Tr="[object AsyncFunction]",nn="[object Boolean]",Wt="[object Date]",vi="[object DOMException]",rn="[object Error]",Sn="[object Function]",yi="[object GeneratorFunction]",Fe="[object Map]",Nt="[object Number]",Ei="[object Null]",ht="[object Object]",Si="[object Promise]",xi="[object Proxy]",Ot="[object RegExp]",xe="[object Set]",sn="[object String]",xn="[object Symbol]",Ai="[object Undefined]",on="[object WeakMap]",Mi="[object WeakSet]",Yt="[object ArrayBuffer]",wt="[object DataView]",An="[object Float32Array]",jn="[object Float64Array]",Mn="[object Int8Array]",Zn="[object Int16Array]",Xn="[object Int32Array]",Qn="[object Uint8Array]",Tn="[object Uint8ClampedArray]",bt="[object Uint16Array]",Ti="[object Uint32Array]",p=/\b__p \+= '';/g,O=/\b(__p \+=) '' \+/g,k=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Q=/&(?:amp|lt|gt|quot|#39);/g,ye=/[&<>"']/g,vt=RegExp(Q.source),ke=RegExp(ye.source),qs=/<%-([\s\S]+?)%>/g,Or=/<%([\s\S]+?)%>/g,qn=/<%=([\s\S]+?)%>/g,ft=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dt=/^\w*$/,an=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/[\\^$.*+?()[\]{}|]/g,cn=RegExp(Xe.source),Ht=/^\s+/,Oi=/\s/,Hc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,jc=/\{\n\/\* \[wrapped with (.+)\] \*/,Zc=/,? & /,Xc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Qc=/[()=,{}\[\]\/\s]/,qc=/\\(\\)?/g,Kc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ks=/\w*$/,$c=/^[-+]0x[0-9a-f]+$/i,Jc=/^0b[01]+$/i,el=/^\[object .+?Constructor\]$/,tl=/^0o[0-7]+$/i,nl=/^(?:0|[1-9]\d*)$/,il=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Pi=/($^)/,rl=/['\n\r\u2028\u2029\\]/g,Di="\\ud800-\\udfff",sl="\\u0300-\\u036f",ol="\\ufe20-\\ufe2f",al="\\u20d0-\\u20ff",$s=sl+ol+al,Js="\\u2700-\\u27bf",eo="a-z\\xdf-\\xf6\\xf8-\\xff",cl="\\xac\\xb1\\xd7\\xf7",ll="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ul="\\u2000-\\u206f",hl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",to="A-Z\\xc0-\\xd6\\xd8-\\xde",no="\\ufe0e\\ufe0f",io=cl+ll+ul+hl,Pr="['’]",fl="["+Di+"]",ro="["+io+"]",Ii="["+$s+"]",so="\\d+",dl="["+Js+"]",oo="["+eo+"]",ao="[^"+Di+io+so+Js+eo+to+"]",Dr="\\ud83c[\\udffb-\\udfff]",pl="(?:"+Ii+"|"+Dr+")",co="[^"+Di+"]",Ir="(?:\\ud83c[\\udde6-\\uddff]){2}",Rr="[\\ud800-\\udbff][\\udc00-\\udfff]",On="["+to+"]",lo="\\u200d",uo="(?:"+oo+"|"+ao+")",gl="(?:"+On+"|"+ao+")",ho="(?:"+Pr+"(?:d|ll|m|re|s|t|ve))?",fo="(?:"+Pr+"(?:D|LL|M|RE|S|T|VE))?",po=pl+"?",go="["+no+"]?",_l="(?:"+lo+"(?:"+[co,Ir,Rr].join("|")+")"+go+po+")*",ml="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",_o=go+po+_l,bl="(?:"+[dl,Ir,Rr].join("|")+")"+_o,vl="(?:"+[co+Ii+"?",Ii,Ir,Rr,fl].join("|")+")",yl=RegExp(Pr,"g"),El=RegExp(Ii,"g"),Cr=RegExp(Dr+"(?="+Dr+")|"+vl+_o,"g"),Sl=RegExp([On+"?"+oo+"+"+ho+"(?="+[ro,On,"$"].join("|")+")",gl+"+"+fo+"(?="+[ro,On+uo,"$"].join("|")+")",On+"?"+uo+"+"+ho,On+"+"+fo,wl,ml,so,bl].join("|"),"g"),xl=RegExp("["+lo+Di+$s+no+"]"),Al=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ml=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tl=-1,ie={};ie[An]=ie[jn]=ie[Mn]=ie[Zn]=ie[Xn]=ie[Qn]=ie[Tn]=ie[bt]=ie[Ti]=!0,ie[Vt]=ie[En]=ie[Yt]=ie[nn]=ie[wt]=ie[Wt]=ie[rn]=ie[Sn]=ie[Fe]=ie[Nt]=ie[ht]=ie[Ot]=ie[xe]=ie[sn]=ie[on]=!1;var te={};te[Vt]=te[En]=te[Yt]=te[wt]=te[nn]=te[Wt]=te[An]=te[jn]=te[Mn]=te[Zn]=te[Xn]=te[Fe]=te[Nt]=te[ht]=te[Ot]=te[xe]=te[sn]=te[xn]=te[Qn]=te[Tn]=te[bt]=te[Ti]=!0,te[rn]=te[Sn]=te[on]=!1;var Ol={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Pl={"&":"&","<":"<",">":">",'"':""","'":"'"},Dl={"&":"&","<":"<",">":">",""":'"',"'":"'"},Il={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Rl=parseFloat,Cl=parseInt,mo=typeof yr=="object"&&yr&&yr.Object===Object&&yr,Ll=typeof self=="object"&&self&&self.Object===Object&&self,Ae=mo||Ll||Function("return this")(),Lr=a&&!a.nodeType&&a,ln=Lr&&!0&&x&&!x.nodeType&&x,wo=ln&&ln.exports===Lr,Gr=wo&&mo.process,it=function(){try{var _=ln&&ln.require&&ln.require("util").types;return _||Gr&&Gr.binding&&Gr.binding("util")}catch{}}(),bo=it&&it.isArrayBuffer,vo=it&&it.isDate,yo=it&&it.isMap,Eo=it&&it.isRegExp,So=it&&it.isSet,xo=it&&it.isTypedArray;function Qe(_,b,w){switch(w.length){case 0:return _.call(b);case 1:return _.call(b,w[0]);case 2:return _.call(b,w[0],w[1]);case 3:return _.call(b,w[0],w[1],w[2])}return _.apply(b,w)}function Gl(_,b,w,P){for(var G=-1,H=_==null?0:_.length;++G<H;){var we=_[G];b(P,we,w(we),_)}return P}function rt(_,b){for(var w=-1,P=_==null?0:_.length;++w<P&&b(_[w],w,_)!==!1;);return _}function Bl(_,b){for(var w=_==null?0:_.length;w--&&b(_[w],w,_)!==!1;);return _}function Ao(_,b){for(var w=-1,P=_==null?0:_.length;++w<P;)if(!b(_[w],w,_))return!1;return!0}function jt(_,b){for(var w=-1,P=_==null?0:_.length,G=0,H=[];++w<P;){var we=_[w];b(we,w,_)&&(H[G++]=we)}return H}function Ri(_,b){var w=_==null?0:_.length;return!!w&&Pn(_,b,0)>-1}function Br(_,b,w){for(var P=-1,G=_==null?0:_.length;++P<G;)if(w(b,_[P]))return!0;return!1}function se(_,b){for(var w=-1,P=_==null?0:_.length,G=Array(P);++w<P;)G[w]=b(_[w],w,_);return G}function Zt(_,b){for(var w=-1,P=b.length,G=_.length;++w<P;)_[G+w]=b[w];return _}function Ur(_,b,w,P){var G=-1,H=_==null?0:_.length;for(P&&H&&(w=_[++G]);++G<H;)w=b(w,_[G],G,_);return w}function Ul(_,b,w,P){var G=_==null?0:_.length;for(P&&G&&(w=_[--G]);G--;)w=b(w,_[G],G,_);return w}function zr(_,b){for(var w=-1,P=_==null?0:_.length;++w<P;)if(b(_[w],w,_))return!0;return!1}var zl=Fr("length");function Fl(_){return _.split("")}function kl(_){return _.match(Xc)||[]}function Mo(_,b,w){var P;return w(_,function(G,H,we){if(b(G,H,we))return P=H,!1}),P}function Ci(_,b,w,P){for(var G=_.length,H=w+(P?1:-1);P?H--:++H<G;)if(b(_[H],H,_))return H;return-1}function Pn(_,b,w){return b===b?$l(_,b,w):Ci(_,To,w)}function Vl(_,b,w,P){for(var G=w-1,H=_.length;++G<H;)if(P(_[G],b))return G;return-1}function To(_){return _!==_}function Oo(_,b){var w=_==null?0:_.length;return w?Vr(_,b)/w:Ze}function Fr(_){return function(b){return b==null?i:b[_]}}function kr(_){return function(b){return _==null?i:_[b]}}function Po(_,b,w,P,G){return G(_,function(H,we,$){w=P?(P=!1,H):b(w,H,we,$)}),w}function Wl(_,b){var w=_.length;for(_.sort(b);w--;)_[w]=_[w].value;return _}function Vr(_,b){for(var w,P=-1,G=_.length;++P<G;){var H=b(_[P]);H!==i&&(w=w===i?H:w+H)}return w}function Wr(_,b){for(var w=-1,P=Array(_);++w<_;)P[w]=b(w);return P}function Nl(_,b){return se(b,function(w){return[w,_[w]]})}function Do(_){return _&&_.slice(0,Lo(_)+1).replace(Ht,"")}function qe(_){return function(b){return _(b)}}function Nr(_,b){return se(b,function(w){return _[w]})}function Kn(_,b){return _.has(b)}function Io(_,b){for(var w=-1,P=_.length;++w<P&&Pn(b,_[w],0)>-1;);return w}function Ro(_,b){for(var w=_.length;w--&&Pn(b,_[w],0)>-1;);return w}function Yl(_,b){for(var w=_.length,P=0;w--;)_[w]===b&&++P;return P}var Hl=kr(Ol),jl=kr(Pl);function Zl(_){return"\\"+Il[_]}function Xl(_,b){return _==null?i:_[b]}function Dn(_){return xl.test(_)}function Ql(_){return Al.test(_)}function ql(_){for(var b,w=[];!(b=_.next()).done;)w.push(b.value);return w}function Yr(_){var b=-1,w=Array(_.size);return _.forEach(function(P,G){w[++b]=[G,P]}),w}function Co(_,b){return function(w){return _(b(w))}}function Xt(_,b){for(var w=-1,P=_.length,G=0,H=[];++w<P;){var we=_[w];(we===b||we===ce)&&(_[w]=ce,H[G++]=w)}return H}function Li(_){var b=-1,w=Array(_.size);return _.forEach(function(P){w[++b]=P}),w}function Kl(_){var b=-1,w=Array(_.size);return _.forEach(function(P){w[++b]=[P,P]}),w}function $l(_,b,w){for(var P=w-1,G=_.length;++P<G;)if(_[P]===b)return P;return-1}function Jl(_,b,w){for(var P=w+1;P--;)if(_[P]===b)return P;return P}function In(_){return Dn(_)?tu(_):zl(_)}function pt(_){return Dn(_)?nu(_):Fl(_)}function Lo(_){for(var b=_.length;b--&&Oi.test(_.charAt(b)););return b}var eu=kr(Dl);function tu(_){for(var b=Cr.lastIndex=0;Cr.test(_);)++b;return b}function nu(_){return _.match(Cr)||[]}function iu(_){return _.match(Sl)||[]}var ru=function _(b){b=b==null?Ae:Rn.defaults(Ae.Object(),b,Rn.pick(Ae,Ml));var w=b.Array,P=b.Date,G=b.Error,H=b.Function,we=b.Math,$=b.Object,Hr=b.RegExp,su=b.String,st=b.TypeError,Gi=w.prototype,ou=H.prototype,Cn=$.prototype,Bi=b["__core-js_shared__"],Ui=ou.toString,q=Cn.hasOwnProperty,au=0,Go=function(){var e=/[^.]+$/.exec(Bi&&Bi.keys&&Bi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),zi=Cn.toString,cu=Ui.call($),lu=Ae._,uu=Hr("^"+Ui.call(q).replace(Xe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fi=wo?b.Buffer:i,Qt=b.Symbol,ki=b.Uint8Array,Bo=Fi?Fi.allocUnsafe:i,Vi=Co($.getPrototypeOf,$),Uo=$.create,zo=Cn.propertyIsEnumerable,Wi=Gi.splice,Fo=Qt?Qt.isConcatSpreadable:i,$n=Qt?Qt.iterator:i,un=Qt?Qt.toStringTag:i,Ni=function(){try{var e=gn($,"defineProperty");return e({},"",{}),e}catch{}}(),hu=b.clearTimeout!==Ae.clearTimeout&&b.clearTimeout,fu=P&&P.now!==Ae.Date.now&&P.now,du=b.setTimeout!==Ae.setTimeout&&b.setTimeout,Yi=we.ceil,Hi=we.floor,jr=$.getOwnPropertySymbols,pu=Fi?Fi.isBuffer:i,ko=b.isFinite,gu=Gi.join,_u=Co($.keys,$),be=we.max,De=we.min,mu=P.now,wu=b.parseInt,Vo=we.random,bu=Gi.reverse,Zr=gn(b,"DataView"),Jn=gn(b,"Map"),Xr=gn(b,"Promise"),Ln=gn(b,"Set"),ei=gn(b,"WeakMap"),ti=gn($,"create"),ji=ei&&new ei,Gn={},vu=_n(Zr),yu=_n(Jn),Eu=_n(Xr),Su=_n(Ln),xu=_n(ei),Zi=Qt?Qt.prototype:i,ni=Zi?Zi.valueOf:i,Wo=Zi?Zi.toString:i;function c(e){if(he(e)&&!B(e)&&!(e instanceof W)){if(e instanceof ot)return e;if(q.call(e,"__wrapped__"))return Na(e)}return new ot(e)}var Bn=function(){function e(){}return function(t){if(!ae(t))return{};if(Uo)return Uo(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Xi(){}function ot(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}c.templateSettings={escape:qs,evaluate:Or,interpolate:qn,variable:"",imports:{_:c}},c.prototype=Xi.prototype,c.prototype.constructor=c,ot.prototype=Bn(Xi.prototype),ot.prototype.constructor=ot;function W(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ve,this.__views__=[]}function Au(){var e=new W(this.__wrapped__);return e.__actions__=Ve(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ve(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ve(this.__views__),e}function Mu(){if(this.__filtered__){var e=new W(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Tu(){var e=this.__wrapped__.value(),t=this.__dir__,n=B(e),s=t<0,o=n?e.length:0,l=Fh(0,o,this.__views__),h=l.start,d=l.end,m=d-h,y=s?d:h-1,E=this.__iteratees__,A=E.length,M=0,D=De(m,this.__takeCount__);if(!n||!s&&o==m&&D==m)return fa(e,this.__actions__);var C=[];e:for(;m--&&M<D;){y+=t;for(var z=-1,L=e[y];++z<A;){var V=E[z],N=V.iteratee,Je=V.type,ze=N(L);if(Je==Se)L=ze;else if(!ze){if(Je==Ge)continue e;break e}}C[M++]=L}return C}W.prototype=Bn(Xi.prototype),W.prototype.constructor=W;function hn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}function Ou(){this.__data__=ti?ti(null):{},this.size=0}function Pu(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Du(e){var t=this.__data__;if(ti){var n=t[e];return n===I?i:n}return q.call(t,e)?t[e]:i}function Iu(e){var t=this.__data__;return ti?t[e]!==i:q.call(t,e)}function Ru(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ti&&t===i?I:t,this}hn.prototype.clear=Ou,hn.prototype.delete=Pu,hn.prototype.get=Du,hn.prototype.has=Iu,hn.prototype.set=Ru;function Pt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}function Cu(){this.__data__=[],this.size=0}function Lu(e){var t=this.__data__,n=Qi(t,e);if(n<0)return!1;var s=t.length-1;return n==s?t.pop():Wi.call(t,n,1),--this.size,!0}function Gu(e){var t=this.__data__,n=Qi(t,e);return n<0?i:t[n][1]}function Bu(e){return Qi(this.__data__,e)>-1}function Uu(e,t){var n=this.__data__,s=Qi(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this}Pt.prototype.clear=Cu,Pt.prototype.delete=Lu,Pt.prototype.get=Gu,Pt.prototype.has=Bu,Pt.prototype.set=Uu;function Dt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}function zu(){this.size=0,this.__data__={hash:new hn,map:new(Jn||Pt),string:new hn}}function Fu(e){var t=ar(this,e).delete(e);return this.size-=t?1:0,t}function ku(e){return ar(this,e).get(e)}function Vu(e){return ar(this,e).has(e)}function Wu(e,t){var n=ar(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this}Dt.prototype.clear=zu,Dt.prototype.delete=Fu,Dt.prototype.get=ku,Dt.prototype.has=Vu,Dt.prototype.set=Wu;function fn(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Dt;++t<n;)this.add(e[t])}function Nu(e){return this.__data__.set(e,I),this}function Yu(e){return this.__data__.has(e)}fn.prototype.add=fn.prototype.push=Nu,fn.prototype.has=Yu;function gt(e){var t=this.__data__=new Pt(e);this.size=t.size}function Hu(){this.__data__=new Pt,this.size=0}function ju(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Zu(e){return this.__data__.get(e)}function Xu(e){return this.__data__.has(e)}function Qu(e,t){var n=this.__data__;if(n instanceof Pt){var s=n.__data__;if(!Jn||s.length<f-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new Dt(s)}return n.set(e,t),this.size=n.size,this}gt.prototype.clear=Hu,gt.prototype.delete=ju,gt.prototype.get=Zu,gt.prototype.has=Xu,gt.prototype.set=Qu;function No(e,t){var n=B(e),s=!n&&mn(e),o=!n&&!s&&en(e),l=!n&&!s&&!o&&kn(e),h=n||s||o||l,d=h?Wr(e.length,su):[],m=d.length;for(var y in e)(t||q.call(e,y))&&!(h&&(y=="length"||o&&(y=="offset"||y=="parent")||l&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||Lt(y,m)))&&d.push(y);return d}function Yo(e){var t=e.length;return t?e[ss(0,t-1)]:i}function qu(e,t){return cr(Ve(e),dn(t,0,e.length))}function Ku(e){return cr(Ve(e))}function Qr(e,t,n){(n!==i&&!_t(e[t],n)||n===i&&!(t in e))&&It(e,t,n)}function ii(e,t,n){var s=e[t];(!(q.call(e,t)&&_t(s,n))||n===i&&!(t in e))&&It(e,t,n)}function Qi(e,t){for(var n=e.length;n--;)if(_t(e[n][0],t))return n;return-1}function $u(e,t,n,s){return qt(e,function(o,l,h){t(s,o,n(o),h)}),s}function Ho(e,t){return e&&Et(t,Ee(t),e)}function Ju(e,t){return e&&Et(t,Ne(t),e)}function It(e,t,n){t=="__proto__"&&Ni?Ni(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qr(e,t){for(var n=-1,s=t.length,o=w(s),l=e==null;++n<s;)o[n]=l?i:Ds(e,t[n]);return o}function dn(e,t,n){return e===e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function at(e,t,n,s,o,l){var h,d=t&le,m=t&Te,y=t&Oe;if(n&&(h=o?n(e,s,o,l):n(e)),h!==i)return h;if(!ae(e))return e;var E=B(e);if(E){if(h=Vh(e),!d)return Ve(e,h)}else{var A=Ie(e),M=A==Sn||A==yi;if(en(e))return ga(e,d);if(A==ht||A==Vt||M&&!o){if(h=m||M?{}:La(e),!d)return m?Dh(e,Ju(h,e)):Ph(e,Ho(h,e))}else{if(!te[A])return o?e:{};h=Wh(e,A,d)}}l||(l=new gt);var D=l.get(e);if(D)return D;l.set(e,h),lc(e)?e.forEach(function(L){h.add(at(L,t,n,L,e,l))}):ac(e)&&e.forEach(function(L,V){h.set(V,at(L,t,n,V,e,l))});var C=y?m?_s:gs:m?Ne:Ee,z=E?i:C(e);return rt(z||e,function(L,V){z&&(V=L,L=e[V]),ii(h,V,at(L,t,n,V,e,l))}),h}function eh(e){var t=Ee(e);return function(n){return jo(n,e,t)}}function jo(e,t,n){var s=n.length;if(e==null)return!s;for(e=$(e);s--;){var o=n[s],l=t[o],h=e[o];if(h===i&&!(o in e)||!l(h))return!1}return!0}function Zo(e,t,n){if(typeof e!="function")throw new st(g);return ui(function(){e.apply(i,n)},t)}function ri(e,t,n,s){var o=-1,l=Ri,h=!0,d=e.length,m=[],y=t.length;if(!d)return m;n&&(t=se(t,qe(n))),s?(l=Br,h=!1):t.length>=f&&(l=Kn,h=!1,t=new fn(t));e:for(;++o<d;){var E=e[o],A=n==null?E:n(E);if(E=s||E!==0?E:0,h&&A===A){for(var M=y;M--;)if(t[M]===A)continue e;m.push(E)}else l(t,A,s)||m.push(E)}return m}var qt=va(yt),Xo=va($r,!0);function th(e,t){var n=!0;return qt(e,function(s,o,l){return n=!!t(s,o,l),n}),n}function qi(e,t,n){for(var s=-1,o=e.length;++s<o;){var l=e[s],h=t(l);if(h!=null&&(d===i?h===h&&!$e(h):n(h,d)))var d=h,m=l}return m}function nh(e,t,n,s){var o=e.length;for(n=U(n),n<0&&(n=-n>o?0:o+n),s=s===i||s>o?o:U(s),s<0&&(s+=o),s=n>s?0:hc(s);n<s;)e[n++]=t;return e}function Qo(e,t){var n=[];return qt(e,function(s,o,l){t(s,o,l)&&n.push(s)}),n}function Me(e,t,n,s,o){var l=-1,h=e.length;for(n||(n=Yh),o||(o=[]);++l<h;){var d=e[l];t>0&&n(d)?t>1?Me(d,t-1,n,s,o):Zt(o,d):s||(o[o.length]=d)}return o}var Kr=ya(),qo=ya(!0);function yt(e,t){return e&&Kr(e,t,Ee)}function $r(e,t){return e&&qo(e,t,Ee)}function Ki(e,t){return jt(t,function(n){return Gt(e[n])})}function pn(e,t){t=$t(t,e);for(var n=0,s=t.length;e!=null&&n<s;)e=e[St(t[n++])];return n&&n==s?e:i}function Ko(e,t,n){var s=t(e);return B(e)?s:Zt(s,n(e))}function Be(e){return e==null?e===i?Ai:Ei:un&&un in $(e)?zh(e):Kh(e)}function Jr(e,t){return e>t}function ih(e,t){return e!=null&&q.call(e,t)}function rh(e,t){return e!=null&&t in $(e)}function sh(e,t,n){return e>=De(t,n)&&e<be(t,n)}function es(e,t,n){for(var s=n?Br:Ri,o=e[0].length,l=e.length,h=l,d=w(l),m=1/0,y=[];h--;){var E=e[h];h&&t&&(E=se(E,qe(t))),m=De(E.length,m),d[h]=!n&&(t||o>=120&&E.length>=120)?new fn(h&&E):i}E=e[0];var A=-1,M=d[0];e:for(;++A<o&&y.length<m;){var D=E[A],C=t?t(D):D;if(D=n||D!==0?D:0,!(M?Kn(M,C):s(y,C,n))){for(h=l;--h;){var z=d[h];if(!(z?Kn(z,C):s(e[h],C,n)))continue e}M&&M.push(C),y.push(D)}}return y}function oh(e,t,n,s){return yt(e,function(o,l,h){t(s,n(o),l,h)}),s}function si(e,t,n){t=$t(t,e),e=za(e,t);var s=e==null?e:e[St(lt(t))];return s==null?i:Qe(s,e,n)}function $o(e){return he(e)&&Be(e)==Vt}function ah(e){return he(e)&&Be(e)==Yt}function ch(e){return he(e)&&Be(e)==Wt}function oi(e,t,n,s,o){return e===t?!0:e==null||t==null||!he(e)&&!he(t)?e!==e&&t!==t:lh(e,t,n,s,oi,o)}function lh(e,t,n,s,o,l){var h=B(e),d=B(t),m=h?En:Ie(e),y=d?En:Ie(t);m=m==Vt?ht:m,y=y==Vt?ht:y;var E=m==ht,A=y==ht,M=m==y;if(M&&en(e)){if(!en(t))return!1;h=!0,E=!1}if(M&&!E)return l||(l=new gt),h||kn(e)?Ia(e,t,n,s,o,l):Bh(e,t,m,n,s,o,l);if(!(n&me)){var D=E&&q.call(e,"__wrapped__"),C=A&&q.call(t,"__wrapped__");if(D||C){var z=D?e.value():e,L=C?t.value():t;return l||(l=new gt),o(z,L,n,s,l)}}return M?(l||(l=new gt),Uh(e,t,n,s,o,l)):!1}function uh(e){return he(e)&&Ie(e)==Fe}function ts(e,t,n,s){var o=n.length,l=o,h=!s;if(e==null)return!l;for(e=$(e);o--;){var d=n[o];if(h&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++o<l;){d=n[o];var m=d[0],y=e[m],E=d[1];if(h&&d[2]){if(y===i&&!(m in e))return!1}else{var A=new gt;if(s)var M=s(y,E,m,e,t,A);if(!(M===i?oi(E,y,me|ue,s,A):M))return!1}}return!0}function Jo(e){if(!ae(e)||jh(e))return!1;var t=Gt(e)?uu:el;return t.test(_n(e))}function hh(e){return he(e)&&Be(e)==Ot}function fh(e){return he(e)&&Ie(e)==xe}function dh(e){return he(e)&&pr(e.length)&&!!ie[Be(e)]}function ea(e){return typeof e=="function"?e:e==null?Ye:typeof e=="object"?B(e)?ia(e[0],e[1]):na(e):Ec(e)}function ns(e){if(!li(e))return _u(e);var t=[];for(var n in $(e))q.call(e,n)&&n!="constructor"&&t.push(n);return t}function ph(e){if(!ae(e))return qh(e);var t=li(e),n=[];for(var s in e)s=="constructor"&&(t||!q.call(e,s))||n.push(s);return n}function is(e,t){return e<t}function ta(e,t){var n=-1,s=We(e)?w(e.length):[];return qt(e,function(o,l,h){s[++n]=t(o,l,h)}),s}function na(e){var t=ws(e);return t.length==1&&t[0][2]?Ba(t[0][0],t[0][1]):function(n){return n===e||ts(n,e,t)}}function ia(e,t){return vs(e)&&Ga(t)?Ba(St(e),t):function(n){var s=Ds(n,e);return s===i&&s===t?Is(n,e):oi(t,s,me|ue)}}function $i(e,t,n,s,o){e!==t&&Kr(t,function(l,h){if(o||(o=new gt),ae(l))gh(e,t,h,n,$i,s,o);else{var d=s?s(Es(e,h),l,h+"",e,t,o):i;d===i&&(d=l),Qr(e,h,d)}},Ne)}function gh(e,t,n,s,o,l,h){var d=Es(e,n),m=Es(t,n),y=h.get(m);if(y){Qr(e,n,y);return}var E=l?l(d,m,n+"",e,t,h):i,A=E===i;if(A){var M=B(m),D=!M&&en(m),C=!M&&!D&&kn(m);E=m,M||D||C?B(d)?E=d:fe(d)?E=Ve(d):D?(A=!1,E=ga(m,!0)):C?(A=!1,E=_a(m,!0)):E=[]:hi(m)||mn(m)?(E=d,mn(d)?E=fc(d):(!ae(d)||Gt(d))&&(E=La(m))):A=!1}A&&(h.set(m,E),o(E,m,s,l,h),h.delete(m)),Qr(e,n,E)}function ra(e,t){var n=e.length;if(n)return t+=t<0?n:0,Lt(t,n)?e[t]:i}function sa(e,t,n){t.length?t=se(t,function(l){return B(l)?function(h){return pn(h,l.length===1?l[0]:l)}:l}):t=[Ye];var s=-1;t=se(t,qe(R()));var o=ta(e,function(l,h,d){var m=se(t,function(y){return y(l)});return{criteria:m,index:++s,value:l}});return Wl(o,function(l,h){return Oh(l,h,n)})}function _h(e,t){return oa(e,t,function(n,s){return Is(e,s)})}function oa(e,t,n){for(var s=-1,o=t.length,l={};++s<o;){var h=t[s],d=pn(e,h);n(d,h)&&ai(l,$t(h,e),d)}return l}function mh(e){return function(t){return pn(t,e)}}function rs(e,t,n,s){var o=s?Vl:Pn,l=-1,h=t.length,d=e;for(e===t&&(t=Ve(t)),n&&(d=se(e,qe(n)));++l<h;)for(var m=0,y=t[l],E=n?n(y):y;(m=o(d,E,m,s))>-1;)d!==e&&Wi.call(d,m,1),Wi.call(e,m,1);return e}function aa(e,t){for(var n=e?t.length:0,s=n-1;n--;){var o=t[n];if(n==s||o!==l){var l=o;Lt(o)?Wi.call(e,o,1):cs(e,o)}}return e}function ss(e,t){return e+Hi(Vo()*(t-e+1))}function wh(e,t,n,s){for(var o=-1,l=be(Yi((t-e)/(n||1)),0),h=w(l);l--;)h[s?l:++o]=e,e+=n;return h}function os(e,t){var n="";if(!e||t<1||t>Pe)return n;do t%2&&(n+=e),t=Hi(t/2),t&&(e+=e);while(t);return n}function F(e,t){return Ss(Ua(e,t,Ye),e+"")}function bh(e){return Yo(Vn(e))}function vh(e,t){var n=Vn(e);return cr(n,dn(t,0,n.length))}function ai(e,t,n,s){if(!ae(e))return e;t=$t(t,e);for(var o=-1,l=t.length,h=l-1,d=e;d!=null&&++o<l;){var m=St(t[o]),y=n;if(m==="__proto__"||m==="constructor"||m==="prototype")return e;if(o!=h){var E=d[m];y=s?s(E,m,d):i,y===i&&(y=ae(E)?E:Lt(t[o+1])?[]:{})}ii(d,m,y),d=d[m]}return e}var ca=ji?function(e,t){return ji.set(e,t),e}:Ye,yh=Ni?function(e,t){return Ni(e,"toString",{configurable:!0,enumerable:!1,value:Cs(t),writable:!0})}:Ye;function Eh(e){return cr(Vn(e))}function ct(e,t,n){var s=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var l=w(o);++s<o;)l[s]=e[s+t];return l}function Sh(e,t){var n;return qt(e,function(s,o,l){return n=t(s,o,l),!n}),!!n}function Ji(e,t,n){var s=0,o=e==null?s:e.length;if(typeof t=="number"&&t===t&&o<=vn){for(;s<o;){var l=s+o>>>1,h=e[l];h!==null&&!$e(h)&&(n?h<=t:h<t)?s=l+1:o=l}return o}return as(e,t,Ye,n)}function as(e,t,n,s){var o=0,l=e==null?0:e.length;if(l===0)return 0;t=n(t);for(var h=t!==t,d=t===null,m=$e(t),y=t===i;o<l;){var E=Hi((o+l)/2),A=n(e[E]),M=A!==i,D=A===null,C=A===A,z=$e(A);if(h)var L=s||C;else y?L=C&&(s||M):d?L=C&&M&&(s||!D):m?L=C&&M&&!D&&(s||!z):D||z?L=!1:L=s?A<=t:A<t;L?o=E+1:l=E}return De(l,kt)}function la(e,t){for(var n=-1,s=e.length,o=0,l=[];++n<s;){var h=e[n],d=t?t(h):h;if(!n||!_t(d,m)){var m=d;l[o++]=h===0?0:h}}return l}function ua(e){return typeof e=="number"?e:$e(e)?Ze:+e}function Ke(e){if(typeof e=="string")return e;if(B(e))return se(e,Ke)+"";if($e(e))return Wo?Wo.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Kt(e,t,n){var s=-1,o=Ri,l=e.length,h=!0,d=[],m=d;if(n)h=!1,o=Br;else if(l>=f){var y=t?null:Lh(e);if(y)return Li(y);h=!1,o=Kn,m=new fn}else m=t?[]:d;e:for(;++s<l;){var E=e[s],A=t?t(E):E;if(E=n||E!==0?E:0,h&&A===A){for(var M=m.length;M--;)if(m[M]===A)continue e;t&&m.push(A),d.push(E)}else o(m,A,n)||(m!==d&&m.push(A),d.push(E))}return d}function cs(e,t){return t=$t(t,e),e=za(e,t),e==null||delete e[St(lt(t))]}function ha(e,t,n,s){return ai(e,t,n(pn(e,t)),s)}function er(e,t,n,s){for(var o=e.length,l=s?o:-1;(s?l--:++l<o)&&t(e[l],l,e););return n?ct(e,s?0:l,s?l+1:o):ct(e,s?l+1:0,s?o:l)}function fa(e,t){var n=e;return n instanceof W&&(n=n.value()),Ur(t,function(s,o){return o.func.apply(o.thisArg,Zt([s],o.args))},n)}function ls(e,t,n){var s=e.length;if(s<2)return s?Kt(e[0]):[];for(var o=-1,l=w(s);++o<s;)for(var h=e[o],d=-1;++d<s;)d!=o&&(l[o]=ri(l[o]||h,e[d],t,n));return Kt(Me(l,1),t,n)}function da(e,t,n){for(var s=-1,o=e.length,l=t.length,h={};++s<o;){var d=s<l?t[s]:i;n(h,e[s],d)}return h}function us(e){return fe(e)?e:[]}function hs(e){return typeof e=="function"?e:Ye}function $t(e,t){return B(e)?e:vs(e,t)?[e]:Wa(j(e))}var xh=F;function Jt(e,t,n){var s=e.length;return n=n===i?s:n,!t&&n>=s?e:ct(e,t,n)}var pa=hu||function(e){return Ae.clearTimeout(e)};function ga(e,t){if(t)return e.slice();var n=e.length,s=Bo?Bo(n):new e.constructor(n);return e.copy(s),s}function fs(e){var t=new e.constructor(e.byteLength);return new ki(t).set(new ki(e)),t}function Ah(e,t){var n=t?fs(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Mh(e){var t=new e.constructor(e.source,Ks.exec(e));return t.lastIndex=e.lastIndex,t}function Th(e){return ni?$(ni.call(e)):{}}function _a(e,t){var n=t?fs(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ma(e,t){if(e!==t){var n=e!==i,s=e===null,o=e===e,l=$e(e),h=t!==i,d=t===null,m=t===t,y=$e(t);if(!d&&!y&&!l&&e>t||l&&h&&m&&!d&&!y||s&&h&&m||!n&&m||!o)return 1;if(!s&&!l&&!y&&e<t||y&&n&&o&&!s&&!l||d&&n&&o||!h&&o||!m)return-1}return 0}function Oh(e,t,n){for(var s=-1,o=e.criteria,l=t.criteria,h=o.length,d=n.length;++s<h;){var m=ma(o[s],l[s]);if(m){if(s>=d)return m;var y=n[s];return m*(y=="desc"?-1:1)}}return e.index-t.index}function wa(e,t,n,s){for(var o=-1,l=e.length,h=n.length,d=-1,m=t.length,y=be(l-h,0),E=w(m+y),A=!s;++d<m;)E[d]=t[d];for(;++o<h;)(A||o<l)&&(E[n[o]]=e[o]);for(;y--;)E[d++]=e[o++];return E}function ba(e,t,n,s){for(var o=-1,l=e.length,h=-1,d=n.length,m=-1,y=t.length,E=be(l-d,0),A=w(E+y),M=!s;++o<E;)A[o]=e[o];for(var D=o;++m<y;)A[D+m]=t[m];for(;++h<d;)(M||o<l)&&(A[D+n[h]]=e[o++]);return A}function Ve(e,t){var n=-1,s=e.length;for(t||(t=w(s));++n<s;)t[n]=e[n];return t}function Et(e,t,n,s){var o=!n;n||(n={});for(var l=-1,h=t.length;++l<h;){var d=t[l],m=s?s(n[d],e[d],d,n,e):i;m===i&&(m=e[d]),o?It(n,d,m):ii(n,d,m)}return n}function Ph(e,t){return Et(e,bs(e),t)}function Dh(e,t){return Et(e,Ra(e),t)}function tr(e,t){return function(n,s){var o=B(n)?Gl:$u,l=t?t():{};return o(n,e,R(s,2),l)}}function Un(e){return F(function(t,n){var s=-1,o=n.length,l=o>1?n[o-1]:i,h=o>2?n[2]:i;for(l=e.length>3&&typeof l=="function"?(o--,l):i,h&&Ue(n[0],n[1],h)&&(l=o<3?i:l,o=1),t=$(t);++s<o;){var d=n[s];d&&e(t,d,s,l)}return t})}function va(e,t){return function(n,s){if(n==null)return n;if(!We(n))return e(n,s);for(var o=n.length,l=t?o:-1,h=$(n);(t?l--:++l<o)&&s(h[l],l,h)!==!1;);return n}}function ya(e){return function(t,n,s){for(var o=-1,l=$(t),h=s(t),d=h.length;d--;){var m=h[e?d:++o];if(n(l[m],m,l)===!1)break}return t}}function Ih(e,t,n){var s=t&K,o=ci(e);function l(){var h=this&&this!==Ae&&this instanceof l?o:e;return h.apply(s?n:this,arguments)}return l}function Ea(e){return function(t){t=j(t);var n=Dn(t)?pt(t):i,s=n?n[0]:t.charAt(0),o=n?Jt(n,1).join(""):t.slice(1);return s[e]()+o}}function zn(e){return function(t){return Ur(vc(bc(t).replace(yl,"")),e,"")}}function ci(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Bn(e.prototype),s=e.apply(n,t);return ae(s)?s:n}}function Rh(e,t,n){var s=ci(e);function o(){for(var l=arguments.length,h=w(l),d=l,m=Fn(o);d--;)h[d]=arguments[d];var y=l<3&&h[0]!==m&&h[l-1]!==m?[]:Xt(h,m);if(l-=y.length,l<n)return Ta(e,t,nr,o.placeholder,i,h,y,i,i,n-l);var E=this&&this!==Ae&&this instanceof o?s:e;return Qe(E,this,h)}return o}function Sa(e){return function(t,n,s){var o=$(t);if(!We(t)){var l=R(n,3);t=Ee(t),n=function(d){return l(o[d],d,o)}}var h=e(t,n,s);return h>-1?o[l?t[h]:h]:i}}function xa(e){return Ct(function(t){var n=t.length,s=n,o=ot.prototype.thru;for(e&&t.reverse();s--;){var l=t[s];if(typeof l!="function")throw new st(g);if(o&&!h&&or(l)=="wrapper")var h=new ot([],!0)}for(s=h?s:n;++s<n;){l=t[s];var d=or(l),m=d=="wrapper"?ms(l):i;m&&ys(m[0])&&m[1]==(X|Z|ee|He)&&!m[4].length&&m[9]==1?h=h[or(m[0])].apply(h,m[3]):h=l.length==1&&ys(l)?h[d]():h.thru(l)}return function(){var y=arguments,E=y[0];if(h&&y.length==1&&B(E))return h.plant(E).value();for(var A=0,M=n?t[A].apply(this,y):E;++A<n;)M=t[A].call(this,M);return M}})}function nr(e,t,n,s,o,l,h,d,m,y){var E=t&X,A=t&K,M=t&re,D=t&(Z|Le),C=t&Mt,z=M?i:ci(e);function L(){for(var V=arguments.length,N=w(V),Je=V;Je--;)N[Je]=arguments[Je];if(D)var ze=Fn(L),et=Yl(N,ze);if(s&&(N=wa(N,s,o,D)),l&&(N=ba(N,l,h,D)),V-=et,D&&V<y){var de=Xt(N,ze);return Ta(e,t,nr,L.placeholder,n,N,de,d,m,y-V)}var mt=A?n:this,Ut=M?mt[e]:e;return V=N.length,d?N=$h(N,d):C&&V>1&&N.reverse(),E&&m<V&&(N.length=m),this&&this!==Ae&&this instanceof L&&(Ut=z||ci(Ut)),Ut.apply(mt,N)}return L}function Aa(e,t){return function(n,s){return oh(n,e,t(s),{})}}function ir(e,t){return function(n,s){var o;if(n===i&&s===i)return t;if(n!==i&&(o=n),s!==i){if(o===i)return s;typeof n=="string"||typeof s=="string"?(n=Ke(n),s=Ke(s)):(n=ua(n),s=ua(s)),o=e(n,s)}return o}}function ds(e){return Ct(function(t){return t=se(t,qe(R())),F(function(n){var s=this;return e(t,function(o){return Qe(o,s,n)})})})}function rr(e,t){t=t===i?" ":Ke(t);var n=t.length;if(n<2)return n?os(t,e):t;var s=os(t,Yi(e/In(t)));return Dn(t)?Jt(pt(s),0,e).join(""):s.slice(0,e)}function Ch(e,t,n,s){var o=t&K,l=ci(e);function h(){for(var d=-1,m=arguments.length,y=-1,E=s.length,A=w(E+m),M=this&&this!==Ae&&this instanceof h?l:e;++y<E;)A[y]=s[y];for(;m--;)A[y++]=arguments[++d];return Qe(M,o?n:this,A)}return h}function Ma(e){return function(t,n,s){return s&&typeof s!="number"&&Ue(t,n,s)&&(n=s=i),t=Bt(t),n===i?(n=t,t=0):n=Bt(n),s=s===i?t<n?1:-1:Bt(s),wh(t,n,s,e)}}function sr(e){return function(t,n){return typeof t=="string"&&typeof n=="string"||(t=ut(t),n=ut(n)),e(t,n)}}function Ta(e,t,n,s,o,l,h,d,m,y){var E=t&Z,A=E?h:i,M=E?i:h,D=E?l:i,C=E?i:l;t|=E?ee:nt,t&=~(E?nt:ee),t&ne||(t&=-4);var z=[e,t,o,D,A,C,M,d,m,y],L=n.apply(i,z);return ys(e)&&Fa(L,z),L.placeholder=s,ka(L,e,t)}function ps(e){var t=we[e];return function(n,s){if(n=ut(n),s=s==null?0:De(U(s),292),s&&ko(n)){var o=(j(n)+"e").split("e"),l=t(o[0]+"e"+(+o[1]+s));return o=(j(l)+"e").split("e"),+(o[0]+"e"+(+o[1]-s))}return t(n)}}var Lh=Ln&&1/Li(new Ln([,-0]))[1]==ge?function(e){return new Ln(e)}:Bs;function Oa(e){return function(t){var n=Ie(t);return n==Fe?Yr(t):n==xe?Kl(t):Nl(t,e(t))}}function Rt(e,t,n,s,o,l,h,d){var m=t&re;if(!m&&typeof e!="function")throw new st(g);var y=s?s.length:0;if(y||(t&=-97,s=o=i),h=h===i?h:be(U(h),0),d=d===i?d:U(d),y-=o?o.length:0,t&nt){var E=s,A=o;s=o=i}var M=m?i:ms(e),D=[e,t,n,s,o,E,A,l,h,d];if(M&&Qh(D,M),e=D[0],t=D[1],n=D[2],s=D[3],o=D[4],d=D[9]=D[9]===i?m?0:e.length:be(D[9]-y,0),!d&&t&(Z|Le)&&(t&=-25),!t||t==K)var C=Ih(e,t,n);else t==Z||t==Le?C=Rh(e,t,d):(t==ee||t==(K|ee))&&!o.length?C=Ch(e,t,n,s):C=nr.apply(i,D);var z=M?ca:Fa;return ka(z(C,D),e,t)}function Pa(e,t,n,s){return e===i||_t(e,Cn[n])&&!q.call(s,n)?t:e}function Da(e,t,n,s,o,l){return ae(e)&&ae(t)&&(l.set(t,e),$i(e,t,i,Da,l),l.delete(t)),e}function Gh(e){return hi(e)?i:e}function Ia(e,t,n,s,o,l){var h=n&me,d=e.length,m=t.length;if(d!=m&&!(h&&m>d))return!1;var y=l.get(e),E=l.get(t);if(y&&E)return y==t&&E==e;var A=-1,M=!0,D=n&ue?new fn:i;for(l.set(e,t),l.set(t,e);++A<d;){var C=e[A],z=t[A];if(s)var L=h?s(z,C,A,t,e,l):s(C,z,A,e,t,l);if(L!==i){if(L)continue;M=!1;break}if(D){if(!zr(t,function(V,N){if(!Kn(D,N)&&(C===V||o(C,V,n,s,l)))return D.push(N)})){M=!1;break}}else if(!(C===z||o(C,z,n,s,l))){M=!1;break}}return l.delete(e),l.delete(t),M}function Bh(e,t,n,s,o,l,h){switch(n){case wt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Yt:return!(e.byteLength!=t.byteLength||!l(new ki(e),new ki(t)));case nn:case Wt:case Nt:return _t(+e,+t);case rn:return e.name==t.name&&e.message==t.message;case Ot:case sn:return e==t+"";case Fe:var d=Yr;case xe:var m=s&me;if(d||(d=Li),e.size!=t.size&&!m)return!1;var y=h.get(e);if(y)return y==t;s|=ue,h.set(e,t);var E=Ia(d(e),d(t),s,o,l,h);return h.delete(e),E;case xn:if(ni)return ni.call(e)==ni.call(t)}return!1}function Uh(e,t,n,s,o,l){var h=n&me,d=gs(e),m=d.length,y=gs(t),E=y.length;if(m!=E&&!h)return!1;for(var A=m;A--;){var M=d[A];if(!(h?M in t:q.call(t,M)))return!1}var D=l.get(e),C=l.get(t);if(D&&C)return D==t&&C==e;var z=!0;l.set(e,t),l.set(t,e);for(var L=h;++A<m;){M=d[A];var V=e[M],N=t[M];if(s)var Je=h?s(N,V,M,t,e,l):s(V,N,M,e,t,l);if(!(Je===i?V===N||o(V,N,n,s,l):Je)){z=!1;break}L||(L=M=="constructor")}if(z&&!L){var ze=e.constructor,et=t.constructor;ze!=et&&"constructor"in e&&"constructor"in t&&!(typeof ze=="function"&&ze instanceof ze&&typeof et=="function"&&et instanceof et)&&(z=!1)}return l.delete(e),l.delete(t),z}function Ct(e){return Ss(Ua(e,i,ja),e+"")}function gs(e){return Ko(e,Ee,bs)}function _s(e){return Ko(e,Ne,Ra)}var ms=ji?function(e){return ji.get(e)}:Bs;function or(e){for(var t=e.name+"",n=Gn[t],s=q.call(Gn,t)?n.length:0;s--;){var o=n[s],l=o.func;if(l==null||l==e)return o.name}return t}function Fn(e){var t=q.call(c,"placeholder")?c:e;return t.placeholder}function R(){var e=c.iteratee||Ls;return e=e===Ls?ea:e,arguments.length?e(arguments[0],arguments[1]):e}function ar(e,t){var n=e.__data__;return Hh(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ws(e){for(var t=Ee(e),n=t.length;n--;){var s=t[n],o=e[s];t[n]=[s,o,Ga(o)]}return t}function gn(e,t){var n=Xl(e,t);return Jo(n)?n:i}function zh(e){var t=q.call(e,un),n=e[un];try{e[un]=i;var s=!0}catch{}var o=zi.call(e);return s&&(t?e[un]=n:delete e[un]),o}var bs=jr?function(e){return e==null?[]:(e=$(e),jt(jr(e),function(t){return zo.call(e,t)}))}:Us,Ra=jr?function(e){for(var t=[];e;)Zt(t,bs(e)),e=Vi(e);return t}:Us,Ie=Be;(Zr&&Ie(new Zr(new ArrayBuffer(1)))!=wt||Jn&&Ie(new Jn)!=Fe||Xr&&Ie(Xr.resolve())!=Si||Ln&&Ie(new Ln)!=xe||ei&&Ie(new ei)!=on)&&(Ie=function(e){var t=Be(e),n=t==ht?e.constructor:i,s=n?_n(n):"";if(s)switch(s){case vu:return wt;case yu:return Fe;case Eu:return Si;case Su:return xe;case xu:return on}return t});function Fh(e,t,n){for(var s=-1,o=n.length;++s<o;){var l=n[s],h=l.size;switch(l.type){case"drop":e+=h;break;case"dropRight":t-=h;break;case"take":t=De(t,e+h);break;case"takeRight":e=be(e,t-h);break}}return{start:e,end:t}}function kh(e){var t=e.match(jc);return t?t[1].split(Zc):[]}function Ca(e,t,n){t=$t(t,e);for(var s=-1,o=t.length,l=!1;++s<o;){var h=St(t[s]);if(!(l=e!=null&&n(e,h)))break;e=e[h]}return l||++s!=o?l:(o=e==null?0:e.length,!!o&&pr(o)&&Lt(h,o)&&(B(e)||mn(e)))}function Vh(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&q.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function La(e){return typeof e.constructor=="function"&&!li(e)?Bn(Vi(e)):{}}function Wh(e,t,n){var s=e.constructor;switch(t){case Yt:return fs(e);case nn:case Wt:return new s(+e);case wt:return Ah(e,n);case An:case jn:case Mn:case Zn:case Xn:case Qn:case Tn:case bt:case Ti:return _a(e,n);case Fe:return new s;case Nt:case sn:return new s(e);case Ot:return Mh(e);case xe:return new s;case xn:return Th(e)}}function Nh(e,t){var n=t.length;if(!n)return e;var s=n-1;return t[s]=(n>1?"& ":"")+t[s],t=t.join(n>2?", ":" "),e.replace(Hc,`{
|
|
9
|
-
/* [wrapped with `+t+`] */
|
|
10
|
-
`)}function Yh(e){return B(e)||mn(e)||!!(Fo&&e&&e[Fo])}function Lt(e,t){var n=typeof e;return t=t??Pe,!!t&&(n=="number"||n!="symbol"&&nl.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e,t,n){if(!ae(n))return!1;var s=typeof t;return(s=="number"?We(n)&&Lt(t,n.length):s=="string"&&t in n)?_t(n[t],e):!1}function vs(e,t){if(B(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||$e(e)?!0:dt.test(e)||!ft.test(e)||t!=null&&e in $(t)}function Hh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ys(e){var t=or(e),n=c[t];if(typeof n!="function"||!(t in W.prototype))return!1;if(e===n)return!0;var s=ms(n);return!!s&&e===s[0]}function jh(e){return!!Go&&Go in e}var Zh=Bi?Gt:zs;function li(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Cn;return e===n}function Ga(e){return e===e&&!ae(e)}function Ba(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==i||e in $(n))}}function Xh(e){var t=fr(e,function(s){return n.size===Y&&n.clear(),s}),n=t.cache;return t}function Qh(e,t){var n=e[1],s=t[1],o=n|s,l=o<(K|re|X),h=s==X&&n==Z||s==X&&n==He&&e[7].length<=t[8]||s==(X|He)&&t[7].length<=t[8]&&n==Z;if(!(l||h))return e;s&K&&(e[2]=t[2],o|=n&K?0:ne);var d=t[3];if(d){var m=e[3];e[3]=m?wa(m,d,t[4]):d,e[4]=m?Xt(e[3],ce):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?ba(m,d,t[6]):d,e[6]=m?Xt(e[5],ce):t[6]),d=t[7],d&&(e[7]=d),s&X&&(e[8]=e[8]==null?t[8]:De(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=o,e}function qh(e){var t=[];if(e!=null)for(var n in $(e))t.push(n);return t}function Kh(e){return zi.call(e)}function Ua(e,t,n){return t=be(t===i?e.length-1:t,0),function(){for(var s=arguments,o=-1,l=be(s.length-t,0),h=w(l);++o<l;)h[o]=s[t+o];o=-1;for(var d=w(t+1);++o<t;)d[o]=s[o];return d[t]=n(h),Qe(e,this,d)}}function za(e,t){return t.length<2?e:pn(e,ct(t,0,-1))}function $h(e,t){for(var n=e.length,s=De(t.length,n),o=Ve(e);s--;){var l=t[s];e[s]=Lt(l,n)?o[l]:i}return e}function Es(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Fa=Va(ca),ui=du||function(e,t){return Ae.setTimeout(e,t)},Ss=Va(yh);function ka(e,t,n){var s=t+"";return Ss(e,Nh(s,Jh(kh(s),n)))}function Va(e){var t=0,n=0;return function(){var s=mu(),o=Ft-(s-n);if(n=s,o>0){if(++t>=Tt)return arguments[0]}else t=0;return e.apply(i,arguments)}}function cr(e,t){var n=-1,s=e.length,o=s-1;for(t=t===i?s:t;++n<t;){var l=ss(n,o),h=e[l];e[l]=e[n],e[n]=h}return e.length=t,e}var Wa=Xh(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(an,function(n,s,o,l){t.push(o?l.replace(qc,"$1"):s||n)}),t});function St(e){if(typeof e=="string"||$e(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function _n(e){if(e!=null){try{return Ui.call(e)}catch{}try{return e+""}catch{}}return""}function Jh(e,t){return rt(yn,function(n){var s="_."+n[0];t&n[1]&&!Ri(e,s)&&e.push(s)}),e.sort()}function Na(e){if(e instanceof W)return e.clone();var t=new ot(e.__wrapped__,e.__chain__);return t.__actions__=Ve(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function ef(e,t,n){(n?Ue(e,t,n):t===i)?t=1:t=be(U(t),0);var s=e==null?0:e.length;if(!s||t<1)return[];for(var o=0,l=0,h=w(Yi(s/t));o<s;)h[l++]=ct(e,o,o+=t);return h}function tf(e){for(var t=-1,n=e==null?0:e.length,s=0,o=[];++t<n;){var l=e[t];l&&(o[s++]=l)}return o}function nf(){var e=arguments.length;if(!e)return[];for(var t=w(e-1),n=arguments[0],s=e;s--;)t[s-1]=arguments[s];return Zt(B(n)?Ve(n):[n],Me(t,1))}var rf=F(function(e,t){return fe(e)?ri(e,Me(t,1,fe,!0)):[]}),sf=F(function(e,t){var n=lt(t);return fe(n)&&(n=i),fe(e)?ri(e,Me(t,1,fe,!0),R(n,2)):[]}),of=F(function(e,t){var n=lt(t);return fe(n)&&(n=i),fe(e)?ri(e,Me(t,1,fe,!0),i,n):[]});function af(e,t,n){var s=e==null?0:e.length;return s?(t=n||t===i?1:U(t),ct(e,t<0?0:t,s)):[]}function cf(e,t,n){var s=e==null?0:e.length;return s?(t=n||t===i?1:U(t),t=s-t,ct(e,0,t<0?0:t)):[]}function lf(e,t){return e&&e.length?er(e,R(t,3),!0,!0):[]}function uf(e,t){return e&&e.length?er(e,R(t,3),!0):[]}function hf(e,t,n,s){var o=e==null?0:e.length;return o?(n&&typeof n!="number"&&Ue(e,t,n)&&(n=0,s=o),nh(e,t,n,s)):[]}function Ya(e,t,n){var s=e==null?0:e.length;if(!s)return-1;var o=n==null?0:U(n);return o<0&&(o=be(s+o,0)),Ci(e,R(t,3),o)}function Ha(e,t,n){var s=e==null?0:e.length;if(!s)return-1;var o=s-1;return n!==i&&(o=U(n),o=n<0?be(s+o,0):De(o,s-1)),Ci(e,R(t,3),o,!0)}function ja(e){var t=e==null?0:e.length;return t?Me(e,1):[]}function ff(e){var t=e==null?0:e.length;return t?Me(e,ge):[]}function df(e,t){var n=e==null?0:e.length;return n?(t=t===i?1:U(t),Me(e,t)):[]}function pf(e){for(var t=-1,n=e==null?0:e.length,s={};++t<n;){var o=e[t];s[o[0]]=o[1]}return s}function Za(e){return e&&e.length?e[0]:i}function gf(e,t,n){var s=e==null?0:e.length;if(!s)return-1;var o=n==null?0:U(n);return o<0&&(o=be(s+o,0)),Pn(e,t,o)}function _f(e){var t=e==null?0:e.length;return t?ct(e,0,-1):[]}var mf=F(function(e){var t=se(e,us);return t.length&&t[0]===e[0]?es(t):[]}),wf=F(function(e){var t=lt(e),n=se(e,us);return t===lt(n)?t=i:n.pop(),n.length&&n[0]===e[0]?es(n,R(t,2)):[]}),bf=F(function(e){var t=lt(e),n=se(e,us);return t=typeof t=="function"?t:i,t&&n.pop(),n.length&&n[0]===e[0]?es(n,i,t):[]});function vf(e,t){return e==null?"":gu.call(e,t)}function lt(e){var t=e==null?0:e.length;return t?e[t-1]:i}function yf(e,t,n){var s=e==null?0:e.length;if(!s)return-1;var o=s;return n!==i&&(o=U(n),o=o<0?be(s+o,0):De(o,s-1)),t===t?Jl(e,t,o):Ci(e,To,o,!0)}function Ef(e,t){return e&&e.length?ra(e,U(t)):i}var Sf=F(Xa);function Xa(e,t){return e&&e.length&&t&&t.length?rs(e,t):e}function xf(e,t,n){return e&&e.length&&t&&t.length?rs(e,t,R(n,2)):e}function Af(e,t,n){return e&&e.length&&t&&t.length?rs(e,t,i,n):e}var Mf=Ct(function(e,t){var n=e==null?0:e.length,s=qr(e,t);return aa(e,se(t,function(o){return Lt(o,n)?+o:o}).sort(ma)),s});function Tf(e,t){var n=[];if(!(e&&e.length))return n;var s=-1,o=[],l=e.length;for(t=R(t,3);++s<l;){var h=e[s];t(h,s,e)&&(n.push(h),o.push(s))}return aa(e,o),n}function xs(e){return e==null?e:bu.call(e)}function Of(e,t,n){var s=e==null?0:e.length;return s?(n&&typeof n!="number"&&Ue(e,t,n)?(t=0,n=s):(t=t==null?0:U(t),n=n===i?s:U(n)),ct(e,t,n)):[]}function Pf(e,t){return Ji(e,t)}function Df(e,t,n){return as(e,t,R(n,2))}function If(e,t){var n=e==null?0:e.length;if(n){var s=Ji(e,t);if(s<n&&_t(e[s],t))return s}return-1}function Rf(e,t){return Ji(e,t,!0)}function Cf(e,t,n){return as(e,t,R(n,2),!0)}function Lf(e,t){var n=e==null?0:e.length;if(n){var s=Ji(e,t,!0)-1;if(_t(e[s],t))return s}return-1}function Gf(e){return e&&e.length?la(e):[]}function Bf(e,t){return e&&e.length?la(e,R(t,2)):[]}function Uf(e){var t=e==null?0:e.length;return t?ct(e,1,t):[]}function zf(e,t,n){return e&&e.length?(t=n||t===i?1:U(t),ct(e,0,t<0?0:t)):[]}function Ff(e,t,n){var s=e==null?0:e.length;return s?(t=n||t===i?1:U(t),t=s-t,ct(e,t<0?0:t,s)):[]}function kf(e,t){return e&&e.length?er(e,R(t,3),!1,!0):[]}function Vf(e,t){return e&&e.length?er(e,R(t,3)):[]}var Wf=F(function(e){return Kt(Me(e,1,fe,!0))}),Nf=F(function(e){var t=lt(e);return fe(t)&&(t=i),Kt(Me(e,1,fe,!0),R(t,2))}),Yf=F(function(e){var t=lt(e);return t=typeof t=="function"?t:i,Kt(Me(e,1,fe,!0),i,t)});function Hf(e){return e&&e.length?Kt(e):[]}function jf(e,t){return e&&e.length?Kt(e,R(t,2)):[]}function Zf(e,t){return t=typeof t=="function"?t:i,e&&e.length?Kt(e,i,t):[]}function As(e){if(!(e&&e.length))return[];var t=0;return e=jt(e,function(n){if(fe(n))return t=be(n.length,t),!0}),Wr(t,function(n){return se(e,Fr(n))})}function Qa(e,t){if(!(e&&e.length))return[];var n=As(e);return t==null?n:se(n,function(s){return Qe(t,i,s)})}var Xf=F(function(e,t){return fe(e)?ri(e,t):[]}),Qf=F(function(e){return ls(jt(e,fe))}),qf=F(function(e){var t=lt(e);return fe(t)&&(t=i),ls(jt(e,fe),R(t,2))}),Kf=F(function(e){var t=lt(e);return t=typeof t=="function"?t:i,ls(jt(e,fe),i,t)}),$f=F(As);function Jf(e,t){return da(e||[],t||[],ii)}function ed(e,t){return da(e||[],t||[],ai)}var td=F(function(e){var t=e.length,n=t>1?e[t-1]:i;return n=typeof n=="function"?(e.pop(),n):i,Qa(e,n)});function qa(e){var t=c(e);return t.__chain__=!0,t}function nd(e,t){return t(e),e}function lr(e,t){return t(e)}var id=Ct(function(e){var t=e.length,n=t?e[0]:0,s=this.__wrapped__,o=function(l){return qr(l,e)};return t>1||this.__actions__.length||!(s instanceof W)||!Lt(n)?this.thru(o):(s=s.slice(n,+n+(t?1:0)),s.__actions__.push({func:lr,args:[o],thisArg:i}),new ot(s,this.__chain__).thru(function(l){return t&&!l.length&&l.push(i),l}))});function rd(){return qa(this)}function sd(){return new ot(this.value(),this.__chain__)}function od(){this.__values__===i&&(this.__values__=uc(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function ad(){return this}function cd(e){for(var t,n=this;n instanceof Xi;){var s=Na(n);s.__index__=0,s.__values__=i,t?o.__wrapped__=s:t=s;var o=s;n=n.__wrapped__}return o.__wrapped__=e,t}function ld(){var e=this.__wrapped__;if(e instanceof W){var t=e;return this.__actions__.length&&(t=new W(this)),t=t.reverse(),t.__actions__.push({func:lr,args:[xs],thisArg:i}),new ot(t,this.__chain__)}return this.thru(xs)}function ud(){return fa(this.__wrapped__,this.__actions__)}var hd=tr(function(e,t,n){q.call(e,n)?++e[n]:It(e,n,1)});function fd(e,t,n){var s=B(e)?Ao:th;return n&&Ue(e,t,n)&&(t=i),s(e,R(t,3))}function dd(e,t){var n=B(e)?jt:Qo;return n(e,R(t,3))}var pd=Sa(Ya),gd=Sa(Ha);function _d(e,t){return Me(ur(e,t),1)}function md(e,t){return Me(ur(e,t),ge)}function wd(e,t,n){return n=n===i?1:U(n),Me(ur(e,t),n)}function Ka(e,t){var n=B(e)?rt:qt;return n(e,R(t,3))}function $a(e,t){var n=B(e)?Bl:Xo;return n(e,R(t,3))}var bd=tr(function(e,t,n){q.call(e,n)?e[n].push(t):It(e,n,[t])});function vd(e,t,n,s){e=We(e)?e:Vn(e),n=n&&!s?U(n):0;var o=e.length;return n<0&&(n=be(o+n,0)),gr(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Pn(e,t,n)>-1}var yd=F(function(e,t,n){var s=-1,o=typeof t=="function",l=We(e)?w(e.length):[];return qt(e,function(h){l[++s]=o?Qe(t,h,n):si(h,t,n)}),l}),Ed=tr(function(e,t,n){It(e,n,t)});function ur(e,t){var n=B(e)?se:ta;return n(e,R(t,3))}function Sd(e,t,n,s){return e==null?[]:(B(t)||(t=t==null?[]:[t]),n=s?i:n,B(n)||(n=n==null?[]:[n]),sa(e,t,n))}var xd=tr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function Ad(e,t,n){var s=B(e)?Ur:Po,o=arguments.length<3;return s(e,R(t,4),n,o,qt)}function Md(e,t,n){var s=B(e)?Ul:Po,o=arguments.length<3;return s(e,R(t,4),n,o,Xo)}function Td(e,t){var n=B(e)?jt:Qo;return n(e,dr(R(t,3)))}function Od(e){var t=B(e)?Yo:bh;return t(e)}function Pd(e,t,n){(n?Ue(e,t,n):t===i)?t=1:t=U(t);var s=B(e)?qu:vh;return s(e,t)}function Dd(e){var t=B(e)?Ku:Eh;return t(e)}function Id(e){if(e==null)return 0;if(We(e))return gr(e)?In(e):e.length;var t=Ie(e);return t==Fe||t==xe?e.size:ns(e).length}function Rd(e,t,n){var s=B(e)?zr:Sh;return n&&Ue(e,t,n)&&(t=i),s(e,R(t,3))}var Cd=F(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Ue(e,t[0],t[1])?t=[]:n>2&&Ue(t[0],t[1],t[2])&&(t=[t[0]]),sa(e,Me(t,1),[])}),hr=fu||function(){return Ae.Date.now()};function Ld(e,t){if(typeof t!="function")throw new st(g);return e=U(e),function(){if(--e<1)return t.apply(this,arguments)}}function Ja(e,t,n){return t=n?i:t,t=e&&t==null?e.length:t,Rt(e,X,i,i,i,i,t)}function ec(e,t){var n;if(typeof t!="function")throw new st(g);return e=U(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ms=F(function(e,t,n){var s=K;if(n.length){var o=Xt(n,Fn(Ms));s|=ee}return Rt(e,s,t,n,o)}),tc=F(function(e,t,n){var s=K|re;if(n.length){var o=Xt(n,Fn(tc));s|=ee}return Rt(t,s,e,n,o)});function nc(e,t,n){t=n?i:t;var s=Rt(e,Z,i,i,i,i,i,t);return s.placeholder=nc.placeholder,s}function ic(e,t,n){t=n?i:t;var s=Rt(e,Le,i,i,i,i,i,t);return s.placeholder=ic.placeholder,s}function rc(e,t,n){var s,o,l,h,d,m,y=0,E=!1,A=!1,M=!0;if(typeof e!="function")throw new st(g);t=ut(t)||0,ae(n)&&(E=!!n.leading,A="maxWait"in n,l=A?be(ut(n.maxWait)||0,t):l,M="trailing"in n?!!n.trailing:M);function D(de){var mt=s,Ut=o;return s=o=i,y=de,h=e.apply(Ut,mt),h}function C(de){return y=de,d=ui(V,t),E?D(de):h}function z(de){var mt=de-m,Ut=de-y,Sc=t-mt;return A?De(Sc,l-Ut):Sc}function L(de){var mt=de-m,Ut=de-y;return m===i||mt>=t||mt<0||A&&Ut>=l}function V(){var de=hr();if(L(de))return N(de);d=ui(V,z(de))}function N(de){return d=i,M&&s?D(de):(s=o=i,h)}function Je(){d!==i&&pa(d),y=0,s=m=o=d=i}function ze(){return d===i?h:N(hr())}function et(){var de=hr(),mt=L(de);if(s=arguments,o=this,m=de,mt){if(d===i)return C(m);if(A)return pa(d),d=ui(V,t),D(m)}return d===i&&(d=ui(V,t)),h}return et.cancel=Je,et.flush=ze,et}var Gd=F(function(e,t){return Zo(e,1,t)}),Bd=F(function(e,t,n){return Zo(e,ut(t)||0,n)});function Ud(e){return Rt(e,Mt)}function fr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new st(g);var n=function(){var s=arguments,o=t?t.apply(this,s):s[0],l=n.cache;if(l.has(o))return l.get(o);var h=e.apply(this,s);return n.cache=l.set(o,h)||l,h};return n.cache=new(fr.Cache||Dt),n}fr.Cache=Dt;function dr(e){if(typeof e!="function")throw new st(g);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function zd(e){return ec(2,e)}var Fd=xh(function(e,t){t=t.length==1&&B(t[0])?se(t[0],qe(R())):se(Me(t,1),qe(R()));var n=t.length;return F(function(s){for(var o=-1,l=De(s.length,n);++o<l;)s[o]=t[o].call(this,s[o]);return Qe(e,this,s)})}),Ts=F(function(e,t){var n=Xt(t,Fn(Ts));return Rt(e,ee,i,t,n)}),sc=F(function(e,t){var n=Xt(t,Fn(sc));return Rt(e,nt,i,t,n)}),kd=Ct(function(e,t){return Rt(e,He,i,i,i,t)});function Vd(e,t){if(typeof e!="function")throw new st(g);return t=t===i?t:U(t),F(e,t)}function Wd(e,t){if(typeof e!="function")throw new st(g);return t=t==null?0:be(U(t),0),F(function(n){var s=n[t],o=Jt(n,0,t);return s&&Zt(o,s),Qe(e,this,o)})}function Nd(e,t,n){var s=!0,o=!0;if(typeof e!="function")throw new st(g);return ae(n)&&(s="leading"in n?!!n.leading:s,o="trailing"in n?!!n.trailing:o),rc(e,t,{leading:s,maxWait:t,trailing:o})}function Yd(e){return Ja(e,1)}function Hd(e,t){return Ts(hs(t),e)}function jd(){if(!arguments.length)return[];var e=arguments[0];return B(e)?e:[e]}function Zd(e){return at(e,Oe)}function Xd(e,t){return t=typeof t=="function"?t:i,at(e,Oe,t)}function Qd(e){return at(e,le|Oe)}function qd(e,t){return t=typeof t=="function"?t:i,at(e,le|Oe,t)}function Kd(e,t){return t==null||jo(e,t,Ee(t))}function _t(e,t){return e===t||e!==e&&t!==t}var $d=sr(Jr),Jd=sr(function(e,t){return e>=t}),mn=$o(function(){return arguments}())?$o:function(e){return he(e)&&q.call(e,"callee")&&!zo.call(e,"callee")},B=w.isArray,ep=bo?qe(bo):ah;function We(e){return e!=null&&pr(e.length)&&!Gt(e)}function fe(e){return he(e)&&We(e)}function tp(e){return e===!0||e===!1||he(e)&&Be(e)==nn}var en=pu||zs,np=vo?qe(vo):ch;function ip(e){return he(e)&&e.nodeType===1&&!hi(e)}function rp(e){if(e==null)return!0;if(We(e)&&(B(e)||typeof e=="string"||typeof e.splice=="function"||en(e)||kn(e)||mn(e)))return!e.length;var t=Ie(e);if(t==Fe||t==xe)return!e.size;if(li(e))return!ns(e).length;for(var n in e)if(q.call(e,n))return!1;return!0}function sp(e,t){return oi(e,t)}function op(e,t,n){n=typeof n=="function"?n:i;var s=n?n(e,t):i;return s===i?oi(e,t,i,n):!!s}function Os(e){if(!he(e))return!1;var t=Be(e);return t==rn||t==vi||typeof e.message=="string"&&typeof e.name=="string"&&!hi(e)}function ap(e){return typeof e=="number"&&ko(e)}function Gt(e){if(!ae(e))return!1;var t=Be(e);return t==Sn||t==yi||t==Tr||t==xi}function oc(e){return typeof e=="number"&&e==U(e)}function pr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Pe}function ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function he(e){return e!=null&&typeof e=="object"}var ac=yo?qe(yo):uh;function cp(e,t){return e===t||ts(e,t,ws(t))}function lp(e,t,n){return n=typeof n=="function"?n:i,ts(e,t,ws(t),n)}function up(e){return cc(e)&&e!=+e}function hp(e){if(Zh(e))throw new G(S);return Jo(e)}function fp(e){return e===null}function dp(e){return e==null}function cc(e){return typeof e=="number"||he(e)&&Be(e)==Nt}function hi(e){if(!he(e)||Be(e)!=ht)return!1;var t=Vi(e);if(t===null)return!0;var n=q.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ui.call(n)==cu}var Ps=Eo?qe(Eo):hh;function pp(e){return oc(e)&&e>=-9007199254740991&&e<=Pe}var lc=So?qe(So):fh;function gr(e){return typeof e=="string"||!B(e)&&he(e)&&Be(e)==sn}function $e(e){return typeof e=="symbol"||he(e)&&Be(e)==xn}var kn=xo?qe(xo):dh;function gp(e){return e===i}function _p(e){return he(e)&&Ie(e)==on}function mp(e){return he(e)&&Be(e)==Mi}var wp=sr(is),bp=sr(function(e,t){return e<=t});function uc(e){if(!e)return[];if(We(e))return gr(e)?pt(e):Ve(e);if($n&&e[$n])return ql(e[$n]());var t=Ie(e),n=t==Fe?Yr:t==xe?Li:Vn;return n(e)}function Bt(e){if(!e)return e===0?e:0;if(e=ut(e),e===ge||e===-1/0){var t=e<0?-1:1;return t*_e}return e===e?e:0}function U(e){var t=Bt(e),n=t%1;return t===t?n?t-n:t:0}function hc(e){return e?dn(U(e),0,ve):0}function ut(e){if(typeof e=="number")return e;if($e(e))return Ze;if(ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Do(e);var n=Jc.test(e);return n||tl.test(e)?Cl(e.slice(2),n?2:8):$c.test(e)?Ze:+e}function fc(e){return Et(e,Ne(e))}function vp(e){return e?dn(U(e),-9007199254740991,Pe):e===0?e:0}function j(e){return e==null?"":Ke(e)}var yp=Un(function(e,t){if(li(t)||We(t)){Et(t,Ee(t),e);return}for(var n in t)q.call(t,n)&&ii(e,n,t[n])}),dc=Un(function(e,t){Et(t,Ne(t),e)}),_r=Un(function(e,t,n,s){Et(t,Ne(t),e,s)}),Ep=Un(function(e,t,n,s){Et(t,Ee(t),e,s)}),Sp=Ct(qr);function xp(e,t){var n=Bn(e);return t==null?n:Ho(n,t)}var Ap=F(function(e,t){e=$(e);var n=-1,s=t.length,o=s>2?t[2]:i;for(o&&Ue(t[0],t[1],o)&&(s=1);++n<s;)for(var l=t[n],h=Ne(l),d=-1,m=h.length;++d<m;){var y=h[d],E=e[y];(E===i||_t(E,Cn[y])&&!q.call(e,y))&&(e[y]=l[y])}return e}),Mp=F(function(e){return e.push(i,Da),Qe(pc,i,e)});function Tp(e,t){return Mo(e,R(t,3),yt)}function Op(e,t){return Mo(e,R(t,3),$r)}function Pp(e,t){return e==null?e:Kr(e,R(t,3),Ne)}function Dp(e,t){return e==null?e:qo(e,R(t,3),Ne)}function Ip(e,t){return e&&yt(e,R(t,3))}function Rp(e,t){return e&&$r(e,R(t,3))}function Cp(e){return e==null?[]:Ki(e,Ee(e))}function Lp(e){return e==null?[]:Ki(e,Ne(e))}function Ds(e,t,n){var s=e==null?i:pn(e,t);return s===i?n:s}function Gp(e,t){return e!=null&&Ca(e,t,ih)}function Is(e,t){return e!=null&&Ca(e,t,rh)}var Bp=Aa(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=zi.call(t)),e[t]=n},Cs(Ye)),Up=Aa(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=zi.call(t)),q.call(e,t)?e[t].push(n):e[t]=[n]},R),zp=F(si);function Ee(e){return We(e)?No(e):ns(e)}function Ne(e){return We(e)?No(e,!0):ph(e)}function Fp(e,t){var n={};return t=R(t,3),yt(e,function(s,o,l){It(n,t(s,o,l),s)}),n}function kp(e,t){var n={};return t=R(t,3),yt(e,function(s,o,l){It(n,o,t(s,o,l))}),n}var Vp=Un(function(e,t,n){$i(e,t,n)}),pc=Un(function(e,t,n,s){$i(e,t,n,s)}),Wp=Ct(function(e,t){var n={};if(e==null)return n;var s=!1;t=se(t,function(l){return l=$t(l,e),s||(s=l.length>1),l}),Et(e,_s(e),n),s&&(n=at(n,le|Te|Oe,Gh));for(var o=t.length;o--;)cs(n,t[o]);return n});function Np(e,t){return gc(e,dr(R(t)))}var Yp=Ct(function(e,t){return e==null?{}:_h(e,t)});function gc(e,t){if(e==null)return{};var n=se(_s(e),function(s){return[s]});return t=R(t),oa(e,n,function(s,o){return t(s,o[0])})}function Hp(e,t,n){t=$t(t,e);var s=-1,o=t.length;for(o||(o=1,e=i);++s<o;){var l=e==null?i:e[St(t[s])];l===i&&(s=o,l=n),e=Gt(l)?l.call(e):l}return e}function jp(e,t,n){return e==null?e:ai(e,t,n)}function Zp(e,t,n,s){return s=typeof s=="function"?s:i,e==null?e:ai(e,t,n,s)}var _c=Oa(Ee),mc=Oa(Ne);function Xp(e,t,n){var s=B(e),o=s||en(e)||kn(e);if(t=R(t,4),n==null){var l=e&&e.constructor;o?n=s?new l:[]:ae(e)?n=Gt(l)?Bn(Vi(e)):{}:n={}}return(o?rt:yt)(e,function(h,d,m){return t(n,h,d,m)}),n}function Qp(e,t){return e==null?!0:cs(e,t)}function qp(e,t,n){return e==null?e:ha(e,t,hs(n))}function Kp(e,t,n,s){return s=typeof s=="function"?s:i,e==null?e:ha(e,t,hs(n),s)}function Vn(e){return e==null?[]:Nr(e,Ee(e))}function $p(e){return e==null?[]:Nr(e,Ne(e))}function Jp(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=ut(n),n=n===n?n:0),t!==i&&(t=ut(t),t=t===t?t:0),dn(ut(e),t,n)}function e0(e,t,n){return t=Bt(t),n===i?(n=t,t=0):n=Bt(n),e=ut(e),sh(e,t,n)}function t0(e,t,n){if(n&&typeof n!="boolean"&&Ue(e,t,n)&&(t=n=i),n===i&&(typeof t=="boolean"?(n=t,t=i):typeof e=="boolean"&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=Bt(e),t===i?(t=e,e=0):t=Bt(t)),e>t){var s=e;e=t,t=s}if(n||e%1||t%1){var o=Vo();return De(e+o*(t-e+Rl("1e-"+((o+"").length-1))),t)}return ss(e,t)}var n0=zn(function(e,t,n){return t=t.toLowerCase(),e+(n?wc(t):t)});function wc(e){return Rs(j(e).toLowerCase())}function bc(e){return e=j(e),e&&e.replace(il,Hl).replace(El,"")}function i0(e,t,n){e=j(e),t=Ke(t);var s=e.length;n=n===i?s:dn(U(n),0,s);var o=n;return n-=t.length,n>=0&&e.slice(n,o)==t}function r0(e){return e=j(e),e&&ke.test(e)?e.replace(ye,jl):e}function s0(e){return e=j(e),e&&cn.test(e)?e.replace(Xe,"\\$&"):e}var o0=zn(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),a0=zn(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),c0=Ea("toLowerCase");function l0(e,t,n){e=j(e),t=U(t);var s=t?In(e):0;if(!t||s>=t)return e;var o=(t-s)/2;return rr(Hi(o),n)+e+rr(Yi(o),n)}function u0(e,t,n){e=j(e),t=U(t);var s=t?In(e):0;return t&&s<t?e+rr(t-s,n):e}function h0(e,t,n){e=j(e),t=U(t);var s=t?In(e):0;return t&&s<t?rr(t-s,n)+e:e}function f0(e,t,n){return n||t==null?t=0:t&&(t=+t),wu(j(e).replace(Ht,""),t||0)}function d0(e,t,n){return(n?Ue(e,t,n):t===i)?t=1:t=U(t),os(j(e),t)}function p0(){var e=arguments,t=j(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var g0=zn(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});function _0(e,t,n){return n&&typeof n!="number"&&Ue(e,t,n)&&(t=n=i),n=n===i?ve:n>>>0,n?(e=j(e),e&&(typeof t=="string"||t!=null&&!Ps(t))&&(t=Ke(t),!t&&Dn(e))?Jt(pt(e),0,n):e.split(t,n)):[]}var m0=zn(function(e,t,n){return e+(n?" ":"")+Rs(t)});function w0(e,t,n){return e=j(e),n=n==null?0:dn(U(n),0,e.length),t=Ke(t),e.slice(n,n+t.length)==t}function b0(e,t,n){var s=c.templateSettings;n&&Ue(e,t,n)&&(t=i),e=j(e),t=_r({},t,s,Pa);var o=_r({},t.imports,s.imports,Pa),l=Ee(o),h=Nr(o,l),d,m,y=0,E=t.interpolate||Pi,A="__p += '",M=Hr((t.escape||Pi).source+"|"+E.source+"|"+(E===qn?Kc:Pi).source+"|"+(t.evaluate||Pi).source+"|$","g"),D="//# sourceURL="+(q.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tl+"]")+`
|
|
11
|
-
`;e.replace(M,function(L,V,N,Je,ze,et){return N||(N=Je),A+=e.slice(y,et).replace(rl,Zl),V&&(d=!0,A+=`' +
|
|
12
|
-
__e(`+V+`) +
|
|
13
|
-
'`),ze&&(m=!0,A+=`';
|
|
14
|
-
`+ze+`;
|
|
15
|
-
__p += '`),N&&(A+=`' +
|
|
16
|
-
((__t = (`+N+`)) == null ? '' : __t) +
|
|
17
|
-
'`),y=et+L.length,L}),A+=`';
|
|
18
|
-
`;var C=q.call(t,"variable")&&t.variable;if(!C)A=`with (obj) {
|
|
19
|
-
`+A+`
|
|
20
|
-
}
|
|
21
|
-
`;else if(Qc.test(C))throw new G(T);A=(m?A.replace(p,""):A).replace(O,"$1").replace(k,"$1;"),A="function("+(C||"obj")+`) {
|
|
22
|
-
`+(C?"":`obj || (obj = {});
|
|
23
|
-
`)+"var __t, __p = ''"+(d?", __e = _.escape":"")+(m?`, __j = Array.prototype.join;
|
|
24
|
-
function print() { __p += __j.call(arguments, '') }
|
|
25
|
-
`:`;
|
|
26
|
-
`)+A+`return __p
|
|
27
|
-
}`;var z=yc(function(){return H(l,D+"return "+A).apply(i,h)});if(z.source=A,Os(z))throw z;return z}function v0(e){return j(e).toLowerCase()}function y0(e){return j(e).toUpperCase()}function E0(e,t,n){if(e=j(e),e&&(n||t===i))return Do(e);if(!e||!(t=Ke(t)))return e;var s=pt(e),o=pt(t),l=Io(s,o),h=Ro(s,o)+1;return Jt(s,l,h).join("")}function S0(e,t,n){if(e=j(e),e&&(n||t===i))return e.slice(0,Lo(e)+1);if(!e||!(t=Ke(t)))return e;var s=pt(e),o=Ro(s,pt(t))+1;return Jt(s,0,o).join("")}function x0(e,t,n){if(e=j(e),e&&(n||t===i))return e.replace(Ht,"");if(!e||!(t=Ke(t)))return e;var s=pt(e),o=Io(s,pt(t));return Jt(s,o).join("")}function A0(e,t){var n=Hn,s=zt;if(ae(t)){var o="separator"in t?t.separator:o;n="length"in t?U(t.length):n,s="omission"in t?Ke(t.omission):s}e=j(e);var l=e.length;if(Dn(e)){var h=pt(e);l=h.length}if(n>=l)return e;var d=n-In(s);if(d<1)return s;var m=h?Jt(h,0,d).join(""):e.slice(0,d);if(o===i)return m+s;if(h&&(d+=m.length-d),Ps(o)){if(e.slice(d).search(o)){var y,E=m;for(o.global||(o=Hr(o.source,j(Ks.exec(o))+"g")),o.lastIndex=0;y=o.exec(E);)var A=y.index;m=m.slice(0,A===i?d:A)}}else if(e.indexOf(Ke(o),d)!=d){var M=m.lastIndexOf(o);M>-1&&(m=m.slice(0,M))}return m+s}function M0(e){return e=j(e),e&&vt.test(e)?e.replace(Q,eu):e}var T0=zn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Rs=Ea("toUpperCase");function vc(e,t,n){return e=j(e),t=n?i:t,t===i?Ql(e)?iu(e):kl(e):e.match(t)||[]}var yc=F(function(e,t){try{return Qe(e,i,t)}catch(n){return Os(n)?n:new G(n)}}),O0=Ct(function(e,t){return rt(t,function(n){n=St(n),It(e,n,Ms(e[n],e))}),e});function P0(e){var t=e==null?0:e.length,n=R();return e=t?se(e,function(s){if(typeof s[1]!="function")throw new st(g);return[n(s[0]),s[1]]}):[],F(function(s){for(var o=-1;++o<t;){var l=e[o];if(Qe(l[0],this,s))return Qe(l[1],this,s)}})}function D0(e){return eh(at(e,le))}function Cs(e){return function(){return e}}function I0(e,t){return e==null||e!==e?t:e}var R0=xa(),C0=xa(!0);function Ye(e){return e}function Ls(e){return ea(typeof e=="function"?e:at(e,le))}function L0(e){return na(at(e,le))}function G0(e,t){return ia(e,at(t,le))}var B0=F(function(e,t){return function(n){return si(n,e,t)}}),U0=F(function(e,t){return function(n){return si(e,n,t)}});function Gs(e,t,n){var s=Ee(t),o=Ki(t,s);n==null&&!(ae(t)&&(o.length||!s.length))&&(n=t,t=e,e=this,o=Ki(t,Ee(t)));var l=!(ae(n)&&"chain"in n)||!!n.chain,h=Gt(e);return rt(o,function(d){var m=t[d];e[d]=m,h&&(e.prototype[d]=function(){var y=this.__chain__;if(l||y){var E=e(this.__wrapped__),A=E.__actions__=Ve(this.__actions__);return A.push({func:m,args:arguments,thisArg:e}),E.__chain__=y,E}return m.apply(e,Zt([this.value()],arguments))})}),e}function z0(){return Ae._===this&&(Ae._=lu),this}function Bs(){}function F0(e){return e=U(e),F(function(t){return ra(t,e)})}var k0=ds(se),V0=ds(Ao),W0=ds(zr);function Ec(e){return vs(e)?Fr(St(e)):mh(e)}function N0(e){return function(t){return e==null?i:pn(e,t)}}var Y0=Ma(),H0=Ma(!0);function Us(){return[]}function zs(){return!1}function j0(){return{}}function Z0(){return""}function X0(){return!0}function Q0(e,t){if(e=U(e),e<1||e>Pe)return[];var n=ve,s=De(e,ve);t=R(t),e-=ve;for(var o=Wr(s,t);++n<e;)t(n);return o}function q0(e){return B(e)?se(e,St):$e(e)?[e]:Ve(Wa(j(e)))}function K0(e){var t=++au;return j(e)+t}var $0=ir(function(e,t){return e+t},0),J0=ps("ceil"),eg=ir(function(e,t){return e/t},1),tg=ps("floor");function ng(e){return e&&e.length?qi(e,Ye,Jr):i}function ig(e,t){return e&&e.length?qi(e,R(t,2),Jr):i}function rg(e){return Oo(e,Ye)}function sg(e,t){return Oo(e,R(t,2))}function og(e){return e&&e.length?qi(e,Ye,is):i}function ag(e,t){return e&&e.length?qi(e,R(t,2),is):i}var cg=ir(function(e,t){return e*t},1),lg=ps("round"),ug=ir(function(e,t){return e-t},0);function hg(e){return e&&e.length?Vr(e,Ye):0}function fg(e,t){return e&&e.length?Vr(e,R(t,2)):0}return c.after=Ld,c.ary=Ja,c.assign=yp,c.assignIn=dc,c.assignInWith=_r,c.assignWith=Ep,c.at=Sp,c.before=ec,c.bind=Ms,c.bindAll=O0,c.bindKey=tc,c.castArray=jd,c.chain=qa,c.chunk=ef,c.compact=tf,c.concat=nf,c.cond=P0,c.conforms=D0,c.constant=Cs,c.countBy=hd,c.create=xp,c.curry=nc,c.curryRight=ic,c.debounce=rc,c.defaults=Ap,c.defaultsDeep=Mp,c.defer=Gd,c.delay=Bd,c.difference=rf,c.differenceBy=sf,c.differenceWith=of,c.drop=af,c.dropRight=cf,c.dropRightWhile=lf,c.dropWhile=uf,c.fill=hf,c.filter=dd,c.flatMap=_d,c.flatMapDeep=md,c.flatMapDepth=wd,c.flatten=ja,c.flattenDeep=ff,c.flattenDepth=df,c.flip=Ud,c.flow=R0,c.flowRight=C0,c.fromPairs=pf,c.functions=Cp,c.functionsIn=Lp,c.groupBy=bd,c.initial=_f,c.intersection=mf,c.intersectionBy=wf,c.intersectionWith=bf,c.invert=Bp,c.invertBy=Up,c.invokeMap=yd,c.iteratee=Ls,c.keyBy=Ed,c.keys=Ee,c.keysIn=Ne,c.map=ur,c.mapKeys=Fp,c.mapValues=kp,c.matches=L0,c.matchesProperty=G0,c.memoize=fr,c.merge=Vp,c.mergeWith=pc,c.method=B0,c.methodOf=U0,c.mixin=Gs,c.negate=dr,c.nthArg=F0,c.omit=Wp,c.omitBy=Np,c.once=zd,c.orderBy=Sd,c.over=k0,c.overArgs=Fd,c.overEvery=V0,c.overSome=W0,c.partial=Ts,c.partialRight=sc,c.partition=xd,c.pick=Yp,c.pickBy=gc,c.property=Ec,c.propertyOf=N0,c.pull=Sf,c.pullAll=Xa,c.pullAllBy=xf,c.pullAllWith=Af,c.pullAt=Mf,c.range=Y0,c.rangeRight=H0,c.rearg=kd,c.reject=Td,c.remove=Tf,c.rest=Vd,c.reverse=xs,c.sampleSize=Pd,c.set=jp,c.setWith=Zp,c.shuffle=Dd,c.slice=Of,c.sortBy=Cd,c.sortedUniq=Gf,c.sortedUniqBy=Bf,c.split=_0,c.spread=Wd,c.tail=Uf,c.take=zf,c.takeRight=Ff,c.takeRightWhile=kf,c.takeWhile=Vf,c.tap=nd,c.throttle=Nd,c.thru=lr,c.toArray=uc,c.toPairs=_c,c.toPairsIn=mc,c.toPath=q0,c.toPlainObject=fc,c.transform=Xp,c.unary=Yd,c.union=Wf,c.unionBy=Nf,c.unionWith=Yf,c.uniq=Hf,c.uniqBy=jf,c.uniqWith=Zf,c.unset=Qp,c.unzip=As,c.unzipWith=Qa,c.update=qp,c.updateWith=Kp,c.values=Vn,c.valuesIn=$p,c.without=Xf,c.words=vc,c.wrap=Hd,c.xor=Qf,c.xorBy=qf,c.xorWith=Kf,c.zip=$f,c.zipObject=Jf,c.zipObjectDeep=ed,c.zipWith=td,c.entries=_c,c.entriesIn=mc,c.extend=dc,c.extendWith=_r,Gs(c,c),c.add=$0,c.attempt=yc,c.camelCase=n0,c.capitalize=wc,c.ceil=J0,c.clamp=Jp,c.clone=Zd,c.cloneDeep=Qd,c.cloneDeepWith=qd,c.cloneWith=Xd,c.conformsTo=Kd,c.deburr=bc,c.defaultTo=I0,c.divide=eg,c.endsWith=i0,c.eq=_t,c.escape=r0,c.escapeRegExp=s0,c.every=fd,c.find=pd,c.findIndex=Ya,c.findKey=Tp,c.findLast=gd,c.findLastIndex=Ha,c.findLastKey=Op,c.floor=tg,c.forEach=Ka,c.forEachRight=$a,c.forIn=Pp,c.forInRight=Dp,c.forOwn=Ip,c.forOwnRight=Rp,c.get=Ds,c.gt=$d,c.gte=Jd,c.has=Gp,c.hasIn=Is,c.head=Za,c.identity=Ye,c.includes=vd,c.indexOf=gf,c.inRange=e0,c.invoke=zp,c.isArguments=mn,c.isArray=B,c.isArrayBuffer=ep,c.isArrayLike=We,c.isArrayLikeObject=fe,c.isBoolean=tp,c.isBuffer=en,c.isDate=np,c.isElement=ip,c.isEmpty=rp,c.isEqual=sp,c.isEqualWith=op,c.isError=Os,c.isFinite=ap,c.isFunction=Gt,c.isInteger=oc,c.isLength=pr,c.isMap=ac,c.isMatch=cp,c.isMatchWith=lp,c.isNaN=up,c.isNative=hp,c.isNil=dp,c.isNull=fp,c.isNumber=cc,c.isObject=ae,c.isObjectLike=he,c.isPlainObject=hi,c.isRegExp=Ps,c.isSafeInteger=pp,c.isSet=lc,c.isString=gr,c.isSymbol=$e,c.isTypedArray=kn,c.isUndefined=gp,c.isWeakMap=_p,c.isWeakSet=mp,c.join=vf,c.kebabCase=o0,c.last=lt,c.lastIndexOf=yf,c.lowerCase=a0,c.lowerFirst=c0,c.lt=wp,c.lte=bp,c.max=ng,c.maxBy=ig,c.mean=rg,c.meanBy=sg,c.min=og,c.minBy=ag,c.stubArray=Us,c.stubFalse=zs,c.stubObject=j0,c.stubString=Z0,c.stubTrue=X0,c.multiply=cg,c.nth=Ef,c.noConflict=z0,c.noop=Bs,c.now=hr,c.pad=l0,c.padEnd=u0,c.padStart=h0,c.parseInt=f0,c.random=t0,c.reduce=Ad,c.reduceRight=Md,c.repeat=d0,c.replace=p0,c.result=Hp,c.round=lg,c.runInContext=_,c.sample=Od,c.size=Id,c.snakeCase=g0,c.some=Rd,c.sortedIndex=Pf,c.sortedIndexBy=Df,c.sortedIndexOf=If,c.sortedLastIndex=Rf,c.sortedLastIndexBy=Cf,c.sortedLastIndexOf=Lf,c.startCase=m0,c.startsWith=w0,c.subtract=ug,c.sum=hg,c.sumBy=fg,c.template=b0,c.times=Q0,c.toFinite=Bt,c.toInteger=U,c.toLength=hc,c.toLower=v0,c.toNumber=ut,c.toSafeInteger=vp,c.toString=j,c.toUpper=y0,c.trim=E0,c.trimEnd=S0,c.trimStart=x0,c.truncate=A0,c.unescape=M0,c.uniqueId=K0,c.upperCase=T0,c.upperFirst=Rs,c.each=Ka,c.eachRight=$a,c.first=Za,Gs(c,function(){var e={};return yt(c,function(t,n){q.call(c.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),c.VERSION=r,rt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){c[e].placeholder=c}),rt(["drop","take"],function(e,t){W.prototype[e]=function(n){n=n===i?1:be(U(n),0);var s=this.__filtered__&&!t?new W(this):this.clone();return s.__filtered__?s.__takeCount__=De(n,s.__takeCount__):s.__views__.push({size:De(n,ve),type:e+(s.__dir__<0?"Right":"")}),s},W.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),rt(["filter","map","takeWhile"],function(e,t){var n=t+1,s=n==Ge||n==je;W.prototype[e]=function(o){var l=this.clone();return l.__iteratees__.push({iteratee:R(o,3),type:n}),l.__filtered__=l.__filtered__||s,l}}),rt(["head","last"],function(e,t){var n="take"+(t?"Right":"");W.prototype[e]=function(){return this[n](1).value()[0]}}),rt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");W.prototype[e]=function(){return this.__filtered__?new W(this):this[n](1)}}),W.prototype.compact=function(){return this.filter(Ye)},W.prototype.find=function(e){return this.filter(e).head()},W.prototype.findLast=function(e){return this.reverse().find(e)},W.prototype.invokeMap=F(function(e,t){return typeof e=="function"?new W(this):this.map(function(n){return si(n,e,t)})}),W.prototype.reject=function(e){return this.filter(dr(R(e)))},W.prototype.slice=function(e,t){e=U(e);var n=this;return n.__filtered__&&(e>0||t<0)?new W(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=U(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},W.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},W.prototype.toArray=function(){return this.take(ve)},yt(W.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),s=/^(?:head|last)$/.test(t),o=c[s?"take"+(t=="last"?"Right":""):t],l=s||/^find/.test(t);o&&(c.prototype[t]=function(){var h=this.__wrapped__,d=s?[1]:arguments,m=h instanceof W,y=d[0],E=m||B(h),A=function(V){var N=o.apply(c,Zt([V],d));return s&&M?N[0]:N};E&&n&&typeof y=="function"&&y.length!=1&&(m=E=!1);var M=this.__chain__,D=!!this.__actions__.length,C=l&&!M,z=m&&!D;if(!l&&E){h=z?h:new W(this);var L=e.apply(h,d);return L.__actions__.push({func:lr,args:[A],thisArg:i}),new ot(L,M)}return C&&z?e.apply(this,d):(L=this.thru(A),C?s?L.value()[0]:L.value():L)})}),rt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Gi[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",s=/^(?:pop|shift)$/.test(e);c.prototype[e]=function(){var o=arguments;if(s&&!this.__chain__){var l=this.value();return t.apply(B(l)?l:[],o)}return this[n](function(h){return t.apply(B(h)?h:[],o)})}}),yt(W.prototype,function(e,t){var n=c[t];if(n){var s=n.name+"";q.call(Gn,s)||(Gn[s]=[]),Gn[s].push({name:t,func:n})}}),Gn[nr(i,re).name]=[{name:"wrapper",func:i}],W.prototype.clone=Au,W.prototype.reverse=Mu,W.prototype.value=Tu,c.prototype.at=id,c.prototype.chain=rd,c.prototype.commit=sd,c.prototype.next=od,c.prototype.plant=cd,c.prototype.reverse=ld,c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=ud,c.prototype.first=c.prototype.head,$n&&(c.prototype[$n]=ad),c},Rn=ru();ln?((ln.exports=Rn)._=Rn,Lr._=Rn):Ae._=Rn}).call(Rg)}(_i,_i.exports)),_i.exports}var Lg=Cg();class xr{constructor(a){v(this,"_promise",null);v(this,"_instance",null);v(this,"_importFn");this._path=a,this._importFn=async()=>{try{const i=await this._dynamicImport(this._path),r=Object.keys(i)[0];if(!r||!i[r])throw new Error(`Module class not found in dynamically imported module: ${this._path}`);return i[r]}catch(i){throw new Error(`Failed to dynamically import module from path ${this._path}: ${i instanceof Error?i.message:String(i)}`)}}}async import(){return this._promise||(this._promise=this._importFn()),this._promise}async instantiate(...a){if(this._instance!==null)return Promise.resolve(this._instance);const i=await this.import();return this._instance=new i(...a),this._instance}_dynamicImport(a){return import(a)}}const Nn=class Nn{constructor(a,i,r){v(this,"_id");v(this,"engine");v(this,"controller");v(this,"toolbox");v(this,"_mediaCreator");v(this,"_arSystem");v(this,"_assetExporter");v(this,"registered",new Map);v(this,"listeners",new Map);this._id=Ig(),this.engine=a,this.controller=i,this.toolbox=r,this._mediaCreator=new xr("./src/modules/mediacreator/MediaCreator.cjs"),this._arSystem=new xr("./src/modules/ar/ARSystem.cjs"),this._assetExporter=new xr("./src/modules/asset/exporter/AssetExporter.cjs"),Nn.__instances.push(this)}static get(a){const i=this.__instances.find(r=>r.id===a);return i||this.__instances.find(r=>Array.from(r.registered.values()).find(f=>f.id===a))}get id(){return this._id}DestroyInstance(){const a=Nn.__instances.findIndex(i=>i.id===this.id);return a===-1?!1:(Nn.__instances.splice(a,1),!0)}PerformAction(a,i){let r=!1;switch(a){case"START_RENDER":{this.engine.start(),r=!0;break}case"GET_ALL_SCENE_DATA":{r=this.getAllSceneData(i);break}case"GET_ALL_OBJECTS":{r=this.getAllObjects(i);break}case"GET_OBJECTS":{r=this.getObjects(i);break}case"ADD_OBJECT":{r=this.addObject(i);break}case"UPDATE_OBJECT":{r=this.updateObject(i);break}case"DELETE_OBJECT":{r=this.deleteObject(i);break}case"SELECT_OBJECT":{r=this.selectObject(i);break}case"DESELECT_OBJECT":{r=this.deselectObject(i);break}case"SET_BACKGROUND":{r=this.setBackground(i);break}case"DROP_IT":{r=this.dropIt(i);break}case"PLACE_ON_FLOOR":{r=this.placeOnFloor(i);break}case"SET_CAMERA_TRANSFORM":{r=this.setCameraTransform(i);break}case"GET_CAMERA_TRANSFORM":{r=this.getCameraTransform(i);break}case"MOVE_CAMERA":{r=this.moveCamera(i);break}case"RESET_CAMERA":{r=this.resetCamera(i);break}case"COMPUTE_ENCOMPASSING_VIEW":{r=this.computeEncompassingView(i);break}case"SET_CAMERA_LAYER":{r=this.setCameraLayer(i);break}case"ZOOM_CAMERA":{r=this.zoomCamera(i);break}case"SET_GIZMO_MODE":{r=this.setGizmoMode(i);break}case"SET_GIZMO_VISIBILITY":{r=this.setGizmoVisibility(i);break}case"SET_GIZMO_SCALE_LINKED":{r=this.setGizmoScaleLinked(i);break}case"USE_TOOL":{r=this.useTool(i);break}case"MODEL_LOADED":{r=this.modelLoaded(i);break}case"UPDATE_SCENE":{r=this.updateScene(i);break}case"GENERATE_MEDIA":{r=this.generateMedia(i);break}case"SET_PARENT":{r=this.setParent(i);break}case"EXPORT_SCENE":{r=this.exportScene(i);break}case"LAUNCH_AR":{const{uri:f,options:S}=i;r=new Promise((g,T)=>{this._arSystem.instantiate().then(I=>{g(I.launch(f,S))}).catch(T)});break}default:console.warn(`DIVECommunication.PerformAction: has been executed with unknown Action type ${a}`)}return this.dispatch(a,i),r}Subscribe(a,i){return this.listeners.get(a)||this.listeners.set(a,[]),this.listeners.get(a).push(i),()=>{const r=this.listeners.get(a);if(!r)return!1;const f=r.findIndex(S=>S===i);return f===-1?!1:(r.splice(f,1),!0)}}dispatch(a,i){const r=this.listeners.get(a);r&&r.forEach(f=>f(i))}getAllSceneData(a){const i={name:this.engine.scene.name,mediaItem:null,backgroundColor:"#"+this.engine.scene.background.getHexString(),floorEnabled:this.engine.scene.Root.floor.visible,floorColor:"#"+this.engine.scene.Root.floor.material.color.getHexString(),userCamera:{position:this.controller.object.position.clone(),target:this.controller.target.clone()},spotmarks:[],lights:Array.from(this.registered.values()).filter(r=>r.entityType==="light"),objects:Array.from(this.registered.values()).filter(r=>r.entityType==="model"),cameras:Array.from(this.registered.values()).filter(r=>r.entityType==="pov"),primitives:Array.from(this.registered.values()).filter(r=>r.entityType==="primitive"),groups:Array.from(this.registered.values()).filter(r=>r.entityType==="group")};return Object.assign(a,i),i}getAllObjects(a){return Object.assign(a,this.registered),this.registered}getObjects(a){if(a.ids.length===0)return[];const i=[];return this.registered.forEach(r=>{a.ids.includes(r.id)&&i.push(r)}),i}addObject(a){return this.registered.get(a.id)?!1:(a.parentId===void 0&&(a.parentId=null),this.registered.set(a.id,a),this.engine.scene.AddSceneObject(a),!0)}updateObject(a){const i=this.registered.get(a.id);if(!i)return!1;this.registered.set(a.id,Lg.merge(i,a));const r=this.registered.get(a.id);return this.engine.scene.UpdateSceneObject({...a,id:r.id,entityType:r.entityType}),Object.assign(a,r),!0}deleteObject(a){const i=this.registered.get(a.id);return i?(i.parentId&&this.setParent({object:{id:i.id},parent:null}),i.entityType==="group"&&this.registered.forEach(r=>{r.parentId===i.id&&this.updateObject({id:r.id,parentId:null})}),Object.assign(a,i),this.registered.delete(a.id),this.engine.scene.DeleteSceneObject(i),!0):!1}selectObject(a){const i=this.registered.get(a.id);if(!i)return!1;const r=this.engine.scene.GetSceneObject(i);if(!r||!("isSelectable"in r))return!1;const f=this.toolbox.GetActiveTool();return f&&Lc(f)&&f.AttachGizmo(r),Object.assign(a,i),!0}deselectObject(a){const i=this.registered.get(a.id);if(!i)return!1;const r=this.engine.scene.GetSceneObject(i);if(!r||!("isSelectable"in r))return!1;const f=this.toolbox.GetActiveTool();return f&&Lc(f)&&f.DetachGizmo(),Object.assign(a,i),!0}setBackground(a){return this.engine.scene.SetBackground(a.color),!0}dropIt(a){const i=this.registered.get(a.id);return i?(this.engine.scene.GetSceneObject(i).DropIt(),!0):!1}placeOnFloor(a){const i=this.registered.get(a.id);return i?(this.engine.scene.PlaceOnFloor(i),!0):!1}setCameraTransform(a){return this.controller.object.position.copy(a.position),this.controller.target.copy(a.target),this.controller.update(),!0}getCameraTransform(a){const i={position:this.controller.object.position.clone(),target:this.controller.target.clone()};return Object.assign(a,i),i}moveCamera(a){let i={x:0,y:0,z:0},r={x:0,y:0,z:0};return"id"in a?(i=this.registered.get(a.id).position,r=this.registered.get(a.id).target):(i=a.position,r=a.target),this.controller.MoveTo(i,r,a.duration,a.locked),!0}setCameraLayer(a){return this.controller.object.setCameraLayer(a.layer),!0}resetCamera(a){return this.controller.RevertLast(a.duration),!0}computeEncompassingView(a){const i=this.engine.scene.ComputeSceneBB(),r=this.controller.ComputeEncompassingView(i);return Object.assign(a,r),r}zoomCamera(a){return a.direction==="IN"&&this.controller.ZoomIn(a.by),a.direction==="OUT"&&this.controller.ZoomOut(a.by),!0}setGizmoMode(a){return this.toolbox.SetGizmoMode(a.mode),!0}setGizmoVisibility(a){return this.toolbox.SetGizmoVisibility(a),a}setGizmoScaleLinked(a){return this.toolbox.SetGizmoScaleLinked(a),a}useTool(a){return this.toolbox.UseTool(a.tool),!0}modelLoaded(a){return this.registered.get(a.id).loaded=!0,!0}updateScene(a){return a.name!==void 0&&(this.engine.scene.name=a.name),a.backgroundColor!==void 0&&this.engine.scene.SetBackground(a.backgroundColor),a.gridEnabled!==void 0&&this.engine.scene.Grid.SetVisibility(a.gridEnabled),a.floorEnabled!==void 0&&this.engine.scene.Root.floor.SetVisibility(a.floorEnabled),a.floorColor!==void 0&&this.engine.scene.Root.floor.SetColor(a.floorColor),a.name=this.engine.scene.name,a.backgroundColor="#"+this.engine.scene.background.getHexString(),a.gridEnabled=this.engine.scene.Grid.visible,a.floorEnabled=this.engine.scene.Root.floor.visible,a.floorColor="#"+this.engine.scene.Root.floor.material.color.getHexString(),!0}generateMedia(a){let i={x:0,y:0,z:0},r={x:0,y:0,z:0};return"id"in a?(i=this.registered.get(a.id).position,r=this.registered.get(a.id).target):(i=a.position,r=a.target),this._mediaCreator.instantiate(this.engine.renderer,this.engine.scene,this.controller).then(f=>f.GenerateMedia(i,r,a.width,a.height))}setParent(a){const i=this.registered.get(a.object.id);if(!i)return!1;const r=this.engine.scene.GetSceneObject(i);if(!r)return!1;if(a.parent===null)return this.engine.scene.Root.attach(r),this.updateObject({id:i.id,parentId:null}),!0;if(a.object.id===a.parent.id)return!1;const f=this.registered.get(a.parent.id);if(!f)return this.engine.scene.Root.attach(r),this.updateObject({id:i.id,parentId:null}),!0;const S=this.engine.scene.GetSceneObject(f);return S?(S.attach(r),this.updateObject({id:i.id,parentId:f.id}),!0):(this.engine.scene.Root.attach(r),this.updateObject({id:i.id,parentId:null}),!0)}exportScene(a){return this._assetExporter.instantiate().then(i=>i.export(this.engine.scene.Root,a.type,{}))}};v(Nn,"__instances",[]);let tt=Nn;class Gg{Dispose(){}Update(){Wn.update()}Animate(a){return new Wn.Tween(a)}}class Bg extends u.OrthographicCamera{constructor(i,r,f,S){super(-1,1,1,-1,.1,100);v(this,"axesHelper");v(this,"_renderer");v(this,"_pipeline");v(this,"_scene");v(this,"_controller");v(this,"_restoreViewport",new u.Vector4);v(this,"_postRenderCallback",()=>{const i=this._scene.background;this._scene.background=null,this._renderer.webglrenderer.getViewport(this._restoreViewport),this._renderer.webglrenderer.setViewport(0,0,150,150),this._renderer.webglrenderer.autoClear=!1,this.SetFromCameraMatrix(this._controller.object.matrix),this._renderer.render(this._scene,this),this._renderer.webglrenderer.setViewport(this._restoreViewport),this._renderer.webglrenderer.autoClear=!0,this._scene.background=i});this.layers.mask=pe.COORDINATE_LAYER_MASK,this.axesHelper=new u.AxesHelper(.5),this.axesHelper.layers.mask=pe.COORDINATE_LAYER_MASK,this.axesHelper.material.depthTest=!1,this.axesHelper.position.set(0,0,-1),this.axesHelper.setColors(new u.Color(Ys),new u.Color(Hs),new u.Color(js));const g=new Fs("X",.2,Uc),T=new Fs("Y",.2,zc),I=new Fs("Z",.2,Fc);g.layers.mask=pe.COORDINATE_LAYER_MASK,T.layers.mask=pe.COORDINATE_LAYER_MASK,I.layers.mask=pe.COORDINATE_LAYER_MASK,g.position.set(.7,0,0),T.position.set(0,.7,0),I.position.set(0,0,.7),this.axesHelper.add(g),this.axesHelper.add(T),this.axesHelper.add(I),this.add(this.axesHelper),this._renderer=i,this._pipeline=r,this._scene=f,this._controller=S,this._scene.add(this),this._pipeline.addPostRenderStep(this._postRenderCallback)}Dispose(){this._pipeline.removePostRenderStep(this._postRenderCallback),this._scene.remove(this)}SetFromCameraMatrix(i){this.axesHelper.rotation.setFromRotationMatrix(new u.Matrix4().extractRotation(i).invert())}}const Ug="1.19.1-beta.9",zg={version:Ug};class Fg extends u.Object3D{constructor(){super();v(this,"isDIVELight",!0);v(this,"isDIVEAmbientLight",!0);v(this,"_light");this.name="DIVEAmbientLight",this._light=new u.AmbientLight(16777215,1),this._light.layers.mask=pe.PRODUCT_LAYER_MASK,this.add(this._light)}SetColor(i){this._light.color=i}SetIntensity(i){this._light.intensity=i}SetEnabled(i){this._light.visible=i}}class kg extends u.Object3D{constructor(){super();v(this,"isDIVELight",!0);v(this,"isDIVEPointLight",!0);v(this,"isMovable",!0);v(this,"isSelectable",!0);v(this,"gizmo",null);v(this,"light");v(this,"mesh");this.name="DIVEPointLight",this.light=new u.PointLight(16777215,1),this.light.layers.mask=pe.PRODUCT_LAYER_MASK,this.light.castShadow=!0,this.light.shadow.mapSize.width=512,this.light.shadow.mapSize.height=512,this.add(this.light);const i=.1,r=new u.SphereGeometry(i,i*320,i*320),f=new u.MeshBasicMaterial({color:this.light.color,transparent:!0,opacity:.8,side:u.FrontSide});this.mesh=new u.Mesh(r,f),this.mesh.layers.mask=pe.UI_LAYER_MASK,this.add(this.mesh)}SetColor(i){this.light.color=i,this.mesh.material.color=i}SetIntensity(i){this.light.intensity=i,this.mesh.material.opacity=i>.8?.8:i*.8}SetEnabled(i){this.light.visible=i}onMove(){var i;(i=tt.get(this.userData.id))==null||i.PerformAction("UPDATE_OBJECT",{id:this.userData.id,position:this.position})}onSelect(){var i;(i=tt.get(this.userData.id))==null||i.PerformAction("SELECT_OBJECT",{id:this.userData.id})}onDeselect(){var i;(i=tt.get(this.userData.id))==null||i.PerformAction("DESELECT_OBJECT",{id:this.userData.id})}}class Vg extends u.Object3D{constructor(){super();v(this,"isDIVELight",!0);v(this,"isDIVESceneLight",!0);v(this,"_hemiLight");v(this,"_dirLight");this.name="DIVESceneLight",this._hemiLight=new u.HemisphereLight(16777215,16777215,2),this._hemiLight.layers.mask=pe.PRODUCT_LAYER_MASK,this._hemiLight.position.set(0,50,0),this.add(this._hemiLight),this._dirLight=new u.DirectionalLight(16777215,3),this._dirLight.layers.mask=pe.PRODUCT_LAYER_MASK,this._dirLight.position.set(1,1.75,1),this._dirLight.position.multiplyScalar(30),this._dirLight.castShadow=!0,this._dirLight.shadow.mapSize.width=2048,this._dirLight.shadow.mapSize.height=2048;const i=5;this._dirLight.shadow.camera.left=-5,this._dirLight.shadow.camera.right=i,this._dirLight.shadow.camera.top=i,this._dirLight.shadow.camera.bottom=-5,this._dirLight.shadow.camera.far=3500,this.add(this._dirLight)}SetColor(i){this._hemiLight.color=i,this._dirLight.color=i}SetIntensity(i){this._hemiLight.intensity=i*2,this._dirLight.intensity=i*3}SetEnabled(i){this._hemiLight.visible=i,this._dirLight.visible=i}}const Mr=x=>x.parent?Mr(x.parent):x;class Wg{constructor(){v(this,"isMovable",!0)}}class Ng{constructor(){v(this,"isSelectable",!0)}}function Vc(x,a){return a.forEach(i=>{Object.getOwnPropertyNames(i.prototype).forEach(r=>{Object.defineProperty(x.prototype,r,Object.getOwnPropertyDescriptor(i.prototype,r))})}),x}class Xs extends Vc(u.Object3D,[Ng,Wg]){constructor(){super();v(this,"isDIVENode",!0);v(this,"gizmo",null);v(this,"_positionWorldBuffer");v(this,"_boundingBox");this.layers.mask=pe.PRODUCT_LAYER_MASK,this._positionWorldBuffer=new u.Vector3,this._boundingBox=new u.Box3}SetPosition(i){if(!this.parent){this.position.set(i.x,i.y,i.z);return}const r=new u.Vector3(i.x,i.y,i.z);this.position.copy(this.parent.worldToLocal(r)),"isDIVEGroup"in this.parent&&this.parent.UpdateLineTo(this)}SetRotation(i){this.rotation.set(i.x,i.y,i.z)}SetScale(i){this.scale.set(i.x,i.y,i.z)}SetVisibility(i){this.visible=i}SetToWorldOrigin(){var i;this.position.set(0,0,0),(i=tt.get(this.userData.id))==null||i.PerformAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})}onMove(){var i;(i=tt.get(this.userData.id))==null||i.PerformAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})}onSelect(){var i;(i=tt.get(this.userData.id))==null||i.PerformAction("SELECT_OBJECT",{id:this.userData.id})}onDeselect(){var i;(i=tt.get(this.userData.id))==null||i.PerformAction("DESELECT_OBJECT",{id:this.userData.id})}}class Yg extends Xs{constructor(){super(...arguments);v(this,"isDIVEModel",!0);v(this,"_mesh",null);v(this,"_material",null)}SetModel(i){this.clear(),this._boundingBox.makeEmpty(),i.traverse(r=>{r.castShadow=!0,r.receiveShadow=!0,r.layers.mask=this.layers.mask,this._boundingBox.expandByObject(r),!this._mesh&&"isMesh"in r&&(this._mesh=r,this._material?this._mesh.material=this._material:this._material=r.material)}),this.add(i)}SetMaterial(i){this._material||(this._material=new u.MeshStandardMaterial),i.vertexColors!==void 0&&(this._material.vertexColors=i.vertexColors),i.color!==void 0&&this._material.color.set(i.color),i.map!==void 0&&(this._material.map=i.map),i.normalMap!==void 0&&(this._material.normalMap=i.normalMap),i.roughness!==void 0&&(this._material.roughness=i.roughness),i.roughnessMap!==void 0&&(this._material.roughnessMap=i.roughnessMap,this._material.roughnessMap&&(this._material.roughness=1)),i.metalness!==void 0&&(this._material.metalness=i.metalness),i.metalnessMap!==void 0&&(this._material.metalnessMap=i.metalnessMap,this._material.metalnessMap&&(this._material.metalness=1)),this._mesh&&(this._mesh.material=this._material)}PlaceOnFloor(){var S,g,T,I,Y;const i=this.getWorldPosition(this._positionWorldBuffer),r=i.clone();(g=(S=this._mesh)==null?void 0:S.geometry)==null||g.computeBoundingBox();const f=(I=(T=this._mesh)==null?void 0:T.geometry)==null?void 0:I.boundingBox;!f||!this._mesh||(i.y=i.y-this._mesh.localToWorld(f.min.clone()).y,i.y!==r.y&&((Y=tt.get(this.userData.id))==null||Y.PerformAction("UPDATE_OBJECT",{id:this.userData.id,position:i,rotation:this.rotation,scale:this.scale})))}DropIt(){if(!this.parent){console.warn("DIVEModel: DropIt() called on a model that is not in the scene.",this);return}const i=this._boundingBox.min.y*this.scale.y,r=this.localToWorld(this._boundingBox.getCenter(new u.Vector3).multiply(this.scale));r.y=i+this.position.y;const f=new u.Raycaster(r,new u.Vector3(0,-1,0));f.layers.mask=pe.PRODUCT_LAYER_MASK;const S=f.intersectObjects(Mr(this).Root.children,!0);if(S.length>0){const g=S[0].object;g.geometry.computeBoundingBox();const T=g.geometry.boundingBox,I=g.localToWorld(T.max.clone()),Y=this.position.clone(),ce=this.position.clone().setY(I.y).sub(new u.Vector3(0,i,0));if(this.position.copy(ce),this.position.y===Y.y)return;this.onMove()}}}class Hg extends Xs{constructor(){super();v(this,"isDIVEPrimitive",!0);v(this,"_mesh");this._mesh=new u.Mesh,this._mesh.layers.mask=pe.PRODUCT_LAYER_MASK,this._mesh.castShadow=!0,this._mesh.receiveShadow=!0,this._mesh.material=new u.MeshStandardMaterial,this.add(this._mesh)}SetGeometry(i){const r=this.assembleGeometry(i);r&&(this._mesh.geometry=r,this._boundingBox.setFromObject(this._mesh))}SetMaterial(i){const r=this._mesh.material;i.vertexColors!==void 0&&(r.vertexColors=i.vertexColors),i.color!==void 0&&(r.color=new u.Color(i.color)),i.map!==void 0&&(r.map=i.map),i.normalMap!==void 0&&(r.normalMap=i.normalMap),i.roughness!==void 0&&(r.roughness=i.roughness),i.roughnessMap!==void 0&&(r.roughnessMap=i.roughnessMap,r.roughnessMap&&(r.roughness=1)),i.metalness!==void 0&&(r.metalness=i.metalness),i.metalnessMap!==void 0&&(r.metalnessMap=i.metalnessMap,r.metalnessMap&&(r.metalness=0)),this._mesh&&(this._mesh.material=r)}PlaceOnFloor(){var S,g,T,I,Y;const i=this.getWorldPosition(this._positionWorldBuffer),r=i.clone();(g=(S=this._mesh)==null?void 0:S.geometry)==null||g.computeBoundingBox();const f=(I=(T=this._mesh)==null?void 0:T.geometry)==null?void 0:I.boundingBox;!f||!this._mesh||(i.y=i.y-this._mesh.localToWorld(f.min.clone()).y,i.y!==r.y&&((Y=tt.get(this.userData.id))==null||Y.PerformAction("UPDATE_OBJECT",{id:this.userData.id,position:i,rotation:this.rotation,scale:this.scale})))}DropIt(){if(!this.parent){console.warn("DIVEPrimitive: DropIt() called on a model that is not in the scene.",this);return}const i=this._boundingBox.min.y*this.scale.y,r=this.localToWorld(this._boundingBox.getCenter(new u.Vector3).multiply(this.scale));r.y=i+this.position.y;const f=new u.Raycaster(r,new u.Vector3(0,-1,0));f.layers.mask=pe.PRODUCT_LAYER_MASK;const S=f.intersectObjects(Mr(this).Root.children,!0);if(S.length>0){const g=S[0].object;g.geometry.computeBoundingBox();const T=g.geometry.boundingBox,I=g.localToWorld(T.max.clone()),Y=this.position.clone(),ce=this.position.clone().setY(I.y).sub(new u.Vector3(0,i,0));if(this.position.copy(ce),this.position.y===Y.y)return;this.onMove()}}assembleGeometry(i){switch(this._mesh.material.flatShading=!1,i.name.toLowerCase()){case"cylinder":return this.createCylinderGeometry(i);case"sphere":return this.createSphereGeometry(i);case"pyramid":return this._mesh.material.flatShading=!0,this.createPyramidGeometry(i);case"cube":case"box":return this.createBoxGeometry(i);case"cone":return this.createConeGeometry(i);case"wall":return this.createWallGeometry(i);case"plane":return this.createPlaneGeometry(i);default:return console.warn("DIVEPrimitive.assembleGeometry: Invalid geometry type:",i.name.toLowerCase()),null}}createCylinderGeometry(i){const r=new u.CylinderGeometry(i.width/2,i.width/2,i.height,64);return r.translate(0,i.height/2,0),r}createSphereGeometry(i){return new u.SphereGeometry(i.width/2,256,256)}createPyramidGeometry(i){const r=new Float32Array([-i.width/2,0,-i.depth/2,i.width/2,0,-i.depth/2,i.width/2,0,i.depth/2,-i.width/2,0,i.depth/2,0,i.height,0]),f=new Uint16Array([0,1,2,0,2,3,0,4,1,1,4,2,2,4,3,3,4,0]),S=new u.BufferGeometry;return S.setAttribute("position",new u.BufferAttribute(r,3)),S.setIndex(new u.BufferAttribute(f,1)),S.computeVertexNormals(),S.computeBoundingBox(),S.computeBoundingSphere(),S}createBoxGeometry(i){const r=new u.BoxGeometry(i.width,i.height,i.depth);return r.translate(0,i.height/2,0),r}createConeGeometry(i){const r=new u.ConeGeometry(i.width/2,i.height,256);return r.translate(0,i.height/2,0),r}createWallGeometry(i){const r=new u.BoxGeometry(i.width,i.height,i.depth||.05,16);return r.translate(0,i.height/2,0),r}createPlaneGeometry(i){const r=new u.BoxGeometry(i.width,i.height,i.depth);return r.translate(0,i.height/2,0),r}}class jg extends Xs{constructor(){super();v(this,"isDIVEGroup",!0);v(this,"_members");v(this,"_lines");this.name="DIVEGroup",this._members=[],this._lines=[]}get members(){return this._members}SetPosition(i){super.SetPosition(i),this._members.forEach(r=>{"isDIVENode"in r&&r.onMove()})}SetLinesVisibility(i,r){if(!r){this._lines.forEach(S=>{S.visible=i});return}const f=this._members.indexOf(r);f!==-1&&(this._lines[f].visible=i)}attach(i){if(this._members.includes(i))return this;const r=this.createLine();return this.add(r),this._lines.push(r),super.attach(i),this._members.push(i),this.updateLineTo(r,i),this.SetLinesVisibility(!0,i),this}remove(i){const r=this._members.indexOf(i);if(r===-1)return this;const f=this._lines[r];return super.remove(f),this._lines.splice(r,1),super.remove(i),this._members.splice(r,1),this}UpdateLineTo(i){const r=this._members.indexOf(i);r!==-1&&this.updateLineTo(this._lines[r],i)}createLine(){const i=new u.BufferGeometry,r=new u.LineDashedMaterial({color:6710886,dashSize:.05,gapSize:.025}),f=new u.Line(i,r);return f.visible=!1,f}updateLineTo(i,r){const f=[new u.Vector3(0,0,0),r.position.clone()];i.geometry.setFromPoints(f),i.computeLineDistances()}}class Zg extends u.Mesh{constructor(){super(new u.PlaneGeometry(1e4,1e4),new u.MeshStandardMaterial({color:new u.Color(150/255,150/255,150/255)}));v(this,"isDIVEFloor",!0);this.name="Floor",this.layers.mask=pe.PRODUCT_LAYER_MASK,this.receiveShadow=!0,this.rotateX(-Math.PI/2)}SetVisibility(i){this.visible=i}SetColor(i){this.material.color=new u.Color(i)}}class Xg extends u.Object3D{constructor(){super();v(this,"isDIVERoot",!0);v(this,"_floor");v(this,"_assetLoader");this.name="Root",this._floor=new Zg,this.add(this._floor),this._assetLoader=new xr("./src/modules/asset/loader/AssetLoader.cjs")}get floor(){return this._floor}ComputeSceneBB(){const i=new u.Box3;return this.traverse(r=>{"isObject3D"in r&&i.expandByObject(r)}),i}GetSceneObject(i){let r;return this.traverse(f=>{r||f.userData.id===i.id&&(r=f)}),r}AddSceneObject(i){switch(i.entityType){case"pov":break;case"light":{this.updateLight(i);break}case"model":{this.updateModel(i);break}case"primitive":{this.updatePrimitive(i);break}case"group":{this.updateGroup(i);break}default:console.warn(`DIVERoot.AddSceneObject: Unknown entity type: ${i.entityType}`)}}UpdateSceneObject(i){switch(i.entityType){case"pov":break;case"light":{this.updateLight(i);break}case"model":{this.updateModel(i);break}case"primitive":{this.updatePrimitive(i);break}case"group":{this.updateGroup(i);break}default:console.warn(`DIVERoot.UpdateSceneObject: Unknown entity type: ${i.entityType}`)}}DeleteSceneObject(i){switch(i.entityType){case"pov":break;case"light":{this.deleteLight(i);break}case"model":{this.deleteModel(i);break}case"primitive":{this.deletePrimitive(i);break}case"group":{this.deleteGroup(i);break}default:console.warn(`DIVERoot.DeleteSceneObject: Unknown entity type: ${i.entityType}`)}}PlaceOnFloor(i){switch(i.entityType){case"pov":case"light":break;case"model":case"primitive":{this.placeOnFloor(i);break}default:console.warn(`DIVERoot.PlaceOnFloor: Unknown entity type: ${i.entityType}`)}}updateLight(i){let r=this.GetSceneObject(i);if(!r){switch(i.type){case"scene":{r=new Vg;break}case"ambient":{r=new Fg;break}case"point":{r=new kg;break}default:{console.warn(`DIVERoot.updateLight: Unknown light type: ${i.type}`);return}}r.userData.id=i.id,this.add(r)}i.name!==void 0&&i.name!==null&&(r.name=i.name),i.position!==void 0&&i.position!==null&&r.position.set(i.position.x,i.position.y,i.position.z),i.intensity!==void 0&&i.intensity!==null&&r.SetIntensity(i.intensity),i.enabled!==void 0&&i.enabled!==null&&r.SetEnabled(i.enabled),i.color!==void 0&&i.color!==null&&r.SetColor(new u.Color(i.color)),i.visible!==void 0&&i.visible!==null&&(r.visible=i.visible),i.parentId!==void 0&&this.setParent({...i,parentId:i.parentId})}updateModel(i){let r=this.GetSceneObject(i);r||(r=new Yg,r.userData.id=i.id,r.userData.uri=i.uri,this.add(r)),i.uri!==void 0&&this._assetLoader.instantiate().then(f=>f.load(i.uri)).then(f=>{var S;r.SetModel(f),(S=tt.get(i.id))==null||S.PerformAction("MODEL_LOADED",{id:i.id})}),i.name!==void 0&&(r.name=i.name),i.position!==void 0&&r.SetPosition(i.position),i.rotation!==void 0&&r.SetRotation(i.rotation),i.scale!==void 0&&r.SetScale(i.scale),i.visible!==void 0&&r.SetVisibility(i.visible),i.material!==void 0&&r.SetMaterial(i.material),i.parentId!==void 0&&this.setParent({...i,parentId:i.parentId})}updatePrimitive(i){let r=this.GetSceneObject(i);r||(r=new Hg,r.userData.id=i.id,this.add(r)),i.name!==void 0&&(r.name=i.name),i.geometry!==void 0&&r.SetGeometry(i.geometry),i.position!==void 0&&r.SetPosition(i.position),i.rotation!==void 0&&r.SetRotation(i.rotation),i.scale!==void 0&&r.SetScale(i.scale),i.visible!==void 0&&r.SetVisibility(i.visible),i.material!==void 0&&r.SetMaterial(i.material),i.parentId!==void 0&&this.setParent({...i,parentId:i.parentId})}updateGroup(i){let r=this.GetSceneObject(i);r||(r=new jg,r.userData.id=i.id,this.add(r)),i.name!==void 0&&(r.name=i.name),i.position!==void 0&&r.SetPosition(i.position),i.rotation!==void 0&&r.SetRotation(i.rotation),i.scale!==void 0&&r.SetScale(i.scale),i.visible!==void 0&&r.SetVisibility(i.visible),i.bbVisible!==void 0&&r.SetLinesVisibility(i.bbVisible),i.parentId!==void 0&&this.setParent({...i,parentId:i.parentId})}deleteLight(i){const r=this.GetSceneObject(i);if(!r){console.warn(`DIVERoot.deleteLight: Light with id ${i.id} not found`);return}this.detachTransformControls(r),r.parent.remove(r)}deleteModel(i){const r=this.GetSceneObject(i);if(!r){console.warn(`DIVERoot.deleteModel: Model with id ${i.id} not found`);return}this.detachTransformControls(r),r.parent.remove(r)}deletePrimitive(i){const r=this.GetSceneObject(i);if(!r){console.warn(`DIVERoot.deletePrimitive: Primitive with id ${i.id} not found`);return}this.detachTransformControls(r),r.parent.remove(r)}deleteGroup(i){const r=this.GetSceneObject(i);if(!r){console.warn(`DIVERoot.deleteGroup: Group with id ${i.id} not found`);return}this.detachTransformControls(r);for(let f=r.members.length-1;f>=0;f--)this.attach(r.members[f]);r.parent.remove(r)}placeOnFloor(i){const r=this.GetSceneObject(i);r&&r.PlaceOnFloor()}setParent(i){const r=this.GetSceneObject(i);if(i.parentId!==null){const f=this.GetSceneObject({id:i.parentId});if(!f)return;f.attach(r)}else this.attach(r)}detachTransformControls(i){this.findScene(i).children.find(r=>{"isTransformControls"in r&&r.detach()})}findScene(i){return i.parent!==null?this.findScene(i.parent):i}}const Qg="#888888",qg="#dddddd";class Kg extends u.Object3D{constructor(){super(),this.name="Grid";const a=new u.GridHelper(100,100,Qg,qg);a.material.depthTest=!1,a.layers.mask=pe.HELPER_LAYER_MASK,this.add(a)}SetVisibility(a){this.visible=a}}class $g extends u.Scene{constructor(){super();v(this,"_root");v(this,"_grid");this.background=new u.Color(16777215),this._root=new Xg,this.add(this._root),this._grid=new Kg,this.add(this._grid)}get Root(){return this._root}get Grid(){return this._grid}SetBackground(i){this.background=new u.Color(i)}ComputeSceneBB(){return this.Root.ComputeSceneBB()}GetSceneObject(i){return this.Root.GetSceneObject(i)}AddSceneObject(i){this.Root.AddSceneObject(i)}UpdateSceneObject(i){this.Root.UpdateSceneObject(i)}DeleteSceneObject(i){this.Root.DeleteSceneObject(i)}PlaceOnFloor(i){this.Root.PlaceOnFloor(i)}}const Jg={antialias:!0,alpha:!0,powerPreference:"high-performance",precision:"highp",stencil:!1,depth:!0,logarithmicDepthBuffer:!1};class e_{constructor(a){v(this,"_webglrenderer");v(this,"_settings");this._settings={...Jg,...a??{}},this._webglrenderer=new u.WebGLRenderer({antialias:this._settings.antialias,alpha:this._settings.alpha,powerPreference:this._settings.powerPreference,precision:this._settings.precision,stencil:this._settings.stencil,depth:this._settings.depth,logarithmicDepthBuffer:this._settings.logarithmicDepthBuffer})}get webglrenderer(){return this._webglrenderer}get domElement(){return this._webglrenderer.domElement}set domElement(a){this._webglrenderer.domElement=a}render(a,i){this._webglrenderer.render(a,i)}onResize(a,i){this._webglrenderer.setSize(a,i,!1)}dispose(){this._webglrenderer.dispose()}}class t_{constructor(){v(this,"_lastTime",0);v(this,"_isRunning",!1);v(this,"_tickers",[])}start(){this._isRunning||(this._isRunning=!0,this._lastTime=performance.now(),requestAnimationFrame(this._tick.bind(this)))}stop(){this._isRunning=!1}addTicker(a){this._tickers.push(a)}removeTicker(a){const i=this._tickers.indexOf(a);i!==-1&&this._tickers.splice(i,1)}dispose(){this.stop(),this._tickers.forEach(a=>{var i;return(i=a.dispose)==null?void 0:i.call(a)}),this._tickers=[],this._isRunning=!1,this._lastTime=0}_tick(a){if(!this._isRunning)return;const i=(a-this._lastTime)/1e3;this._lastTime=a,this._tickers.forEach(r=>r.tick(i)),requestAnimationFrame(this._tick.bind(this))}}class n_{constructor(a,i,r){v(this,"_preRenderSteps",[]);v(this,"_postRenderSteps",[]);this._renderer=a,this._scene=i,this._camera=r}get renderer(){return this._renderer}get scene(){return this._scene}get camera(){return this._camera}addPreRenderStep(a){this._preRenderSteps.push(a)}removePreRenderStep(a){const i=this._preRenderSteps.findIndex(r=>r===a);i!==-1&&this._preRenderSteps.splice(i,1)}addPostRenderStep(a){this._postRenderSteps.push(a)}removePostRenderStep(a){const i=this._postRenderSteps.findIndex(r=>r===a);i!==-1&&this._postRenderSteps.splice(i,1)}tick(a){this._preRenderSteps.forEach(i=>i(a)),this._renderer.render(this._scene,this._camera),this._postRenderSteps.forEach(i=>i(a))}dispose(){this._postRenderSteps=[],this._preRenderSteps=[]}}class i_{constructor(a,i){v(this,"_resizeObserver");v(this,"_width",0);v(this,"_height",0);this._resizeObserver=new ResizeObserver(f=>{for(const S of f){const{width:g,height:T}=S.contentRect;g===this._width&&T===this._height||(a.onResize(g,T),i.onResize(g,T),this._width=g,this._height=T)}});const r=a.domElement.parentElement;r&&this._resizeObserver.observe(r)}dispose(){this._resizeObserver.disconnect()}}const Wc={autoStart:!0,displayAxes:!1,perspectiveCamera:pe.DIVEPerspectiveCameraDefaultSettings,renderPipeline:{}};class r_{constructor(a){v(this,"_renderer");v(this,"_scene");v(this,"_camera");v(this,"_pipeline");v(this,"_resizeManager");v(this,"_clock");v(this,"_settings");this._settings={...Wc,...a??{}},this._renderer=new e_,this._scene=new $g,this._camera=new pe.DIVEPerspectiveCamera(this._settings.perspectiveCamera),this._pipeline=new n_(this._renderer,this._scene,this._camera),this._resizeManager=new i_(this._renderer,this._camera),this._clock=new t_,this._clock.addTicker(this._pipeline),this._settings.autoStart&&this.start()}get scene(){return this._scene}get camera(){return this._camera}get renderer(){return this._renderer}get pipeline(){return this._pipeline}start(){this._clock.start()}stop(){this._clock.stop()}dispose(){this._clock.dispose(),this._resizeManager.dispose(),this._pipeline.dispose(),this._renderer.dispose()}}const Nc={...Wc,orbitController:Er};class Qs{constructor(a){v(this,"_settings");v(this,"_engine");v(this,"orbitControls");v(this,"toolbox");v(this,"_communication");v(this,"animationSystem");v(this,"axisCamera");this._settings={...Nc,...a??{}},this._engine=new r_(a),this.animationSystem=new Gg,this._engine.pipeline.addPreRenderStep(()=>{this.animationSystem.Update()}),this.orbitControls=new Ns(this._engine.camera,this._engine.renderer,this._engine.pipeline,this.animationSystem,this._settings.orbitController),this.toolbox=new kc(this._engine.scene,this.orbitControls),this._communication=new tt(this._engine,this.orbitControls,this.toolbox),this._settings.displayAxes?this.axisCamera=new Bg(this._engine.renderer,this._engine.pipeline,this._engine.scene,this.orbitControls):this.axisCamera=null,window.DIVE={instances:[],PrintScene:()=>this._engine.scene},console.log(`DIVE ${zg.version} initialized successfully!`),console.log(`
|
|
28
|
-
@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
|
|
29
|
-
@@@@+-:::::::---------------------==------------------------------=#@@@@
|
|
30
|
-
@@%=::::.......::---------------------------------------------------------+@@
|
|
31
|
-
@@+:::...........::-----------------------------------------------------------#@@
|
|
32
|
-
@@=:::.........::::::-------------------------------------------------------------%@
|
|
33
|
-
@%:::.......:::::::-----------------------------------------------------------------#@
|
|
34
|
-
@*:::.....:::::-----------------------------------------------------------------------*@
|
|
35
|
-
@%::::::.::::---------------------------------------------------------------------------@@
|
|
36
|
-
@@-:::::::::-----------------------------------------------------------------------------=@
|
|
37
|
-
@%::::::::--------------------------------------------------------------------------------%@
|
|
38
|
-
@+::::::::--------------------------------=@@@@@%-----------------------------------------%@
|
|
39
|
-
@=:::::::--------------------------------*@@ @@+---------------------------------------#@
|
|
40
|
-
@+:::::::-------------------------------*@ @*--------------------------------------%@
|
|
41
|
-
@#::::::::-----------------------------=@@ @@=-------------------------------------%@
|
|
42
|
-
@@-::::::::----------------------------@@ @@------------------------------------=@
|
|
43
|
-
@%:::::::::--------------------------*@ @*-----------------------------------@@
|
|
44
|
-
@*:::::::::-------------------------@@ @@----------------------------------%@
|
|
45
|
-
@#::::::::::----------------------%@ @%--------------------------------%@
|
|
46
|
-
@#:::::::::::-------------------=@@ @@=------------------------------%@
|
|
47
|
-
@@-::::::::::::----------------%@ @%----------------------------=@@
|
|
48
|
-
@@#::::::::::::::------------*@ @*--------------------------#@@
|
|
49
|
-
@@+::::::::::::::::--------@@ @@------------------------+@@
|
|
50
|
-
@@*:::::::::::::::::----@@ @@---------------------+@@
|
|
51
|
-
@@@-:::::::::::::::--#@ @#-----------------=%@@
|
|
52
|
-
@@%-::::::::::::-%@ @%-------------=%@@
|
|
53
|
-
@@@@+:::::::#@@ @@*-------*@@@@
|
|
54
|
-
@@@@@@@ @@@@@@
|
|
55
|
-
|
|
56
|
-
`)}static async QuickView(a,i){return new Promise(r=>{const f=new Qs(i);f._communication.PerformAction("UPDATE_SCENE",{backgroundColor:16777215,gridEnabled:!1,floorColor:16777215}),f._communication.PerformAction("SET_CAMERA_TRANSFORM",{position:{x:0,y:2,z:2},target:{x:0,y:.5,z:0}});const S=u.MathUtils.generateUUID();f._communication.PerformAction("ADD_OBJECT",{entityType:"light",type:"scene",name:"light",id:S,enabled:!0,visible:!0,intensity:1,color:16777215});const g=u.MathUtils.generateUUID();f._communication.Subscribe("MODEL_LOADED",T=>{if(T.id!==g)return;const I=f._communication.PerformAction("COMPUTE_ENCOMPASSING_VIEW",{});f._communication.PerformAction("SET_CAMERA_TRANSFORM",{position:I.position,target:I.target}),window.DIVE.instances.push(f),r(f)}),f._communication.PerformAction("ADD_OBJECT",{entityType:"model",name:"object",id:g,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1},uri:a,visible:!0,loaded:!1})})}get engine(){return this._engine}get communication(){return this._communication}get canvas(){return this._engine.renderer.domElement}Dispose(){var a;this.orbitControls.Dispose(),(a=this.axisCamera)==null||a.Dispose(),this._engine.pipeline.removePreRenderStep(()=>{this.animationSystem.Update()}),this.animationSystem.Dispose(),this.toolbox.Dispose(),this._communication.DestroyInstance()}}const Zs=(x,a)=>{if(Object.keys(x).length===0&&Object.keys(a).length===0)return{};if(typeof x!="object"||typeof a!="object")return a;let i={};return Object.keys(a).forEach(r=>{if(!Object.keys(x).includes(r)){i={...i,[r]:a[r]};return}if(Array.isArray(a[r])){if(!Array.isArray(x[r])){i={...i,[r]:a[r]};return}const f=x[r],S=a[r];if(f.length===0&&S.length===0){i={...i};return}if(f.length!==S.length){i={...i,[r]:a[r]};return}const g=[];if(S.forEach((T,I)=>{const Y=Zs(f[I],S[I]);Object.keys(Y).length&&g.push(S[I])}),Object.keys(g).length){i={...i,[r]:g};return}return}if(typeof a[r]=="object"){if(typeof x[r]!="object"){i={...i,[r]:a[r]};return}const f=Zs(x[r],a[r]);if(Object.keys(f).length){i={...i,[r]:f};return}}x[r]!==a[r]&&(i={...i,[r]:a[r]})}),i};function At(x,a){const i=(x+"e").split("e");return+(i[0]+"e"+(+i[1]+(a||0)))}function s_(x,a=0){const i=At(x,+a);return At(Math.ceil(i),-a)}function o_(x,a=0){const i=At(x,+a);return At(Math.floor(i),-a)}function Yc(x,a=0){if(x<0)return-Yc(-x,a);const i=At(x,+a);return At(Math.round(i),-a)}function a_(x,a,i){return Math.atan2(x.clone().cross(a).dot(i),a.clone().dot(x))}function c_(x,a=0){const i=At(x,+a);return At(Math.round(i),-a).toFixed(a)}function l_(x,a=0){const i=At(x,+a);return At(Math.trunc(i),-a)}function u_(x){return(u.MathUtils.radToDeg(x)+360)%360}function h_(x){return u.MathUtils.degToRad(x)}const f_={ceilExp:s_,floorExp:o_,roundExp:Yc,toFixedExp:c_,truncateExp:l_,signedAngleTo:a_,radToDeg:u_,degToRad:h_};exports.MediaCreator=pe.MediaCreator;exports.AssetLoader=Yn.AssetLoader;exports.FILE_TYPES=Yn.FILE_TYPES;exports.NetworkError=Yn.NetworkError;exports.SUPPORTED_FILE_TYPES=Yn.SUPPORTED_FILE_TYPES;exports.getFileTypeFromUri=Yn.getFileTypeFromUri;exports.isFileTypeSupported=Yn.isFileTypeSupported;exports.FileTypeError=Bc.FileTypeError;exports.ParseError=Bc.ParseError;exports.ARCompatibilityError=Ar.ARCompatibilityError;exports.ESystem=Ar.ESystem;exports.EWebXRUnsupportedReason=Ar.EWebXRUnsupportedReason;exports.SystemInfo=Ar.SystemInfo;exports.ARSystem=gg.ARSystem;exports.AssetConverter=_g.AssetConverter;exports.AssetExporter=mg.AssetExporter;exports.DIVE=Qs;exports.DIVEDefaultSettings=Nc;exports.DIVEMath=f_;exports.applyMixins=Vc;exports.findInterface=bi;exports.findSceneRecursive=Mr;exports.getObjectDelta=Zs;exports.implementsInterface=mi;
|
|
57
|
-
//# sourceMappingURL=index.cjs.map
|