@tomorrowevening/hermes 0.0.75 → 0.0.77
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/dist/hermes.cjs.js +14 -14
- package/dist/hermes.es.js +1607 -1525
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/types/editor/multiView/CameraWindow.d.ts +3 -1
package/dist/hermes.cjs.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("three"),vn=require("tweakpane"),bn=require("@tweakpane/plugin-essentials"),E=require("react"),en=require("framer-motion");function yn(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const t=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,t.get?t:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const En=yn(bn),Ct=()=>{},Sn=()=>{};function lt(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function He(e,n,a){return Math.min(n,Math.max(e,a))}function Pt(e,n,a){return(a-e)/(n-e)}function jt(e,n,a){return e*(1-a)+n*a}function xn(e,n){const a=e-n;return Math.sqrt(a*a)}function tn(){return Math.round(Math.random()*1e6).toString()}function nn(e){return e.r!==void 0&&e.g!==void 0&&e.b!==void 0}function an(e){const n=Math.round(e.r*255),a=Math.round(e.g*255),t=Math.round(e.b*255),i=h=>{const d=h.toString(16);return d.length===1?"0"+d:d},c=i(n),u=i(a),r=i(t);return"#"+c+u+r}function It(e,n=1){return Number(e.toFixed(n))}exports.totalThreeObjects=0;const Nt=()=>{exports.totalThreeObjects=0},xt=e=>{if(!e)return;let n=e.name.replaceAll(" ","").replaceAll("/",".");if(n.length===0&&(n=`obj_${exports.totalThreeObjects}`,exports.totalThreeObjects++),e.parent!==null&&e.parent.uuid.length>0&&(n=`${e.parent.uuid}.${n}`),e.uuid=n,e.isMesh!==void 0){const a=e;if(Array.isArray(a.material))a.material.forEach((t,i)=>{t.uuid=`${n}.material.${i}`});else{const t=a.material;t.uuid=`${n}.material`}}e.children.forEach(a=>xt(a))},Cn=e=>{e?.dispose()},rn=e=>{e&&(Array.isArray(e)?e.forEach(n=>n.dispose()):e.dispose())},ut=e=>{if(e){for(;e.children.length>0;){const n=e.children[0];n.type==="Audio"?(n.pause(),n.parent&&n.parent.remove(n)):ut(n)}if(e.parent&&e.parent.remove(e),e.isMesh){const n=e;n.geometry?.dispose(),rn(n.material)}e.dispose!==void 0&&e.dispose()}};class wn{components=new Map;listen;_appID="";_debugEnabled;_broadcastChannel=void 0;_webSocket=void 0;_mode="app";_connected=!1;_useBC=!1;constructor(n,a,t=!0){this._appID=n,this._debugEnabled=a,a&&(this._useBC=t,t?(this._broadcastChannel=new BroadcastChannel(n),this._broadcastChannel.addEventListener("message",this.messageHandler)):(this._webSocket=new WebSocket(n),this._webSocket.addEventListener("open",this.openHandler),this._webSocket.addEventListener("close",this.closeHandler),this._webSocket.addEventListener("message",this.messageHandler)))}addComponent(n,a){this.components.set(n,a)}dispose(){this._broadcastChannel!==void 0&&this._broadcastChannel.removeEventListener("message",this.messageHandler),this._webSocket!==void 0&&(this._webSocket.removeEventListener("open",this.openHandler),this._webSocket.removeEventListener("close",this.closeHandler),this._webSocket.removeEventListener("message",this.messageHandler)),this.components.forEach(n=>{n.dispose()}),this.components.clear()}send(n){this._mode!==n.target&&(this._useBC?this._broadcastChannel?.postMessage(n):this._connected&&this._webSocket?.send(JSON.stringify(n)))}messageHandler=n=>{this.listen!==void 0&&(this._useBC?this.listen(n.data):this.listen(JSON.parse(n.data)))};openHandler=()=>{this._connected=!0};closeHandler=()=>{this._connected=!1};get appID(){return this._appID}get connected(){return this._connected}get debugEnabled(){return this._debugEnabled}get mode(){return this._mode}get isApp(){return this._mode==="app"}get editor(){return this._mode==="editor"}set editor(n){n&&(this._mode="editor")}}const j=new f.EventDispatcher,I={CUSTOM:"ToolEvents::custom",SELECT_DROPDOWN:"ToolEvents::selectDropdown",DRAG_UPDATE:"ToolEvents::dragUpdate",ADD_SCENE:"ToolEvents::addScene",REMOVE_SCENE:"ToolEvents::removeScene",SET_SCENE:"ToolEvents::setScene",GET_OBJECT:"ToolEvents::getObject",SET_OBJECT:"ToolEvents::setObject",UPDATE_OBJECT:"ToolEvents::updateObject",CREATE_TEXTURE:"ToolEvents::createTexture",REQUEST_METHOD:"ToolEvents::requestMethod",ADD_CAMERA:"ToolEvents::addCamera",REMOVE_CAMERA:"ToolEvents::removeCamera"};class dt{app;constructor(n){this.app=n}dispose(){}handleApp(n,a,t){}handleEditor(n,a,t){}}class Mn extends dt{selectDropdown(n,a){this.app.send({event:"selectComponent",target:"app",data:{dropdown:n,value:a}})}updateDropdown(n,a){this.app.send({event:"draggableListUpdate",target:"app",data:{dropdown:n,value:a}})}handleApp(n,a,t){switch(t.event){case"selectComponent":j.dispatchEvent({type:I.SELECT_DROPDOWN,value:t.data});break;case"draggableListUpdate":j.dispatchEvent({type:I.DRAG_UPDATE,value:t.data});break}}}class wt extends dt{project;sheets=new Map;sheetObjects=new Map;sheetObjectCBs=new Map;sheetObjectUnsubscribe=new Map;activeSheet;studio=void 0;static rafDriver=void 0;dispose(){this.project=void 0,this.sheets=new Map,this.sheetObjects=new Map,this.sheetObjectCBs=new Map,this.sheetObjectUnsubscribe=new Map}getSheetInstance(n,a){return a!==void 0?`${n}-${a}`:n}sheet(n,a){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const t=this.getSheetInstance(n,a);let i=this.sheets.get(t);return i!==void 0||(i=this.project?.sheet(n,a),this.sheets.set(t,i)),i}playSheet(n,a,t){this.sheet(n,t)?.sequence.play(a),this.app.send({event:"playSheet",target:"editor",data:{sheet:n,instance:t,value:a}})}pauseSheet(n,a){this.sheet(n)?.sequence.pause(),this.app.send({event:"pauseSheet",target:"editor",data:{sheet:n,instance:a}})}clearSheetObjects(n){this.sheetObjects.forEach((a,t)=>{t.search(`${n}_`)>-1&&this.unsubscribe(a)})}sheetObject(n,a,t,i,c){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const u=this.sheet(n,c);if(u===void 0)return;const h=`${this.getSheetInstance(n,c)}_${a}`;let d=this.sheetObjects.get(h);d!==void 0?d=u.object(a,{...t,...d.value},{reconfigure:!0}):d=u.object(a,t),this.sheetObjects.set(h,d),this.sheetObjectCBs.set(h,i!==void 0?i:Ct);const m=d.onValuesChange(p=>{if(this.app.editor){for(const C in p){const D=p[C];typeof D=="object"&&nn(D)&&(p[C]={r:D.r,g:D.g,b:D.b,a:D.a})}this.app.send({event:"updateSheetObject",target:"app",data:{sheet:n,sheetObject:h,values:p}})}const b=this.sheetObjectCBs.get(h);b!==void 0&&b(p)});return this.sheetObjectUnsubscribe.set(h,m),d}unsubscribe(n){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const a=n.address.sheetId,t=n.address.objectKey;this.sheets.get(a)?.detachObject(t);const c=`${a}_${t}`,u=this.sheetObjectUnsubscribe.get(c);u!==void 0&&(this.sheetObjects.delete(c),this.sheetObjectCBs.delete(c),this.sheetObjectUnsubscribe.delete(c),u())}handleApp(n,a,t){const i=a;let c;switch(t.event){case"setSheet":c=i.sheets.get(t.data.sheet),c!==void 0&&(i.activeSheet=c,this.studio?.setSelection([c]));break;case"setSheetObject":c=i.sheetObjects.get(`${t.data.sheet}_${t.data.key}`),c!==void 0&&this.studio?.setSelection([c]);break;case"updateSheetObject":c=i.sheets.get(t.data.sheet),c!==void 0&&c.sequence.pause(),c=i.sheetObjectCBs.get(t.data.sheetObject),c!==void 0&&c(t.data.values);break;case"updateTimeline":c=i.sheets.get(t.data.sheet),i.activeSheet!==void 0&&(i.activeSheet.sequence.position=t.data.position);break}}handleEditor(n,a,t){if(n.editor){const i=a;switch(t.event){case"playSheet":i.sheet(t.data.sheet,t.data.instance)?.sequence.play(t.data.value);break;case"pauseSheet":i.sheet(t.data.sheet,t.data.instance)?.sequence.pause();break}}}handleEditorApp(n,a){if(n.editor){this.studio?.ui.restore(),this.studio?.onSelectionChange(u=>{u.length<1||u.forEach(r=>{let h=r.address.sheetId,d="setSheet",m={};switch(r.type){case"Theatre_Sheet_PublicAPI":d="setSheet",m={sheet:r.address.sheetId},a.activeSheet=a.sheets.get(r.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":d="setSheetObject",h+=`_${r.address.objectKey}`,m={id:h,sheet:r.address.sheetId,key:r.address.objectKey},a.activeSheet=a.sheets.get(r.address.sheetId);break}n.send({event:d,target:"app",data:m})})});let t=-1;const i=()=>{if(wt.rafDriver?.tick(performance.now()),a.activeSheet!==void 0&&t!==a.activeSheet.sequence.position){t=a.activeSheet.sequence.position;const u=a.activeSheet;n.send({event:"updateTimeline",target:"app",data:{position:t,sheet:u.address.sheetId}})}},c=()=>{i(),requestAnimationFrame(c)};i(),c()}else this.studio?.ui.hide()}}function On(e,n,a){if(e.editor){a.ui.restore(),a.onSelectionChange(u=>{u.length<1||u.forEach(r=>{let h=r.address.sheetId,d="setSheet",m={};switch(r.type){case"Theatre_Sheet_PublicAPI":d="setSheet",m={sheet:r.address.sheetId},n.activeSheet=n.sheets.get(r.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":d="setSheetObject",h+=`_${r.address.objectKey}`,m={id:h,sheet:r.address.sheetId,key:r.address.objectKey},n.activeSheet=n.sheets.get(r.address.sheetId);break}e.send({event:d,target:"app",data:m})})});let t=-1;const i=()=>{if(wt.rafDriver?.tick(performance.now()),n.activeSheet!==void 0&&t!==n.activeSheet.sequence.position){t=n.activeSheet.sequence.position;const u=n.activeSheet;e.send({event:"updateTimeline",target:"app",data:{position:t,sheet:u.address.sheetId}})}},c=()=>{i(),requestAnimationFrame(c)};i(),c()}else a.ui.hide()}function Rn(e){if(e.name==="cameras")return"camera";if(e.name==="interactive")return"interactive";if(e.name==="lights")return"light";if(e.name==="ui")return"ui";if(e.name==="utils")return"utils";const n=e.type;return n.search("Helper")>-1?"icon_utils":n.search("Camera")>-1?"camera":n.search("Light")>-1?"light":"obj3D"}function yt(e){const n={name:e.name,type:e.type,uuid:e.uuid,children:[]};return e.children.forEach(a=>{n.children.push(yt(a))}),n}function Tn(e){const n={};for(const a in e){const t=e[a].value;n[a]={value:t},t===null?n[a].value={src:"",offset:[0,0],repeat:[1,1]}:t.isTexture&&(n[a].value={src:t.image.src,offset:[t.offset.x,t.offset.y],repeat:[t.repeat.x,t.repeat.y]})}return n}function _n(e){switch(e){case"blendSrcAlpha":case"blendDstAlpha":case"blendEquationAlpha":case"clippingPlanes":case"shadowSide":case"precision":return!0}return!1}function et(e){const n={};for(const a in e){if(a.substring(0,1)==="_"||a.substring(0,2)==="is"||_n(a))continue;const t=typeof e[a],i=e[a];switch(t){case"boolean":case"number":case"string":n[a]=i;break;case"object":if(i!==null)if(n[a]=i,i.isTexture)if(i instanceof f.Texture){const u=i.source.toJSON().url;n[a]={src:u,offset:[i.offset.x,i.offset.y],repeat:[i.repeat.x,i.repeat.y]}}else i instanceof f.CubeTexture&&(console.log("env map"),console.log(i.source.data),console.log(i.source.toJSON()),n[a]={src:"",offset:[i.offset.x,i.offset.y],repeat:[i.repeat.x,i.repeat.y]});else a==="uniforms"&&(n[a]=Tn(n[a]));else n[a]={src:"",offset:[0,0],repeat:[1,1]};break}}return n}function kt(e){e.updateMatrix();const n={name:e.name,type:e.type,uuid:e.uuid,visible:e.visible,matrix:e.matrix.elements,animations:[],material:void 0,perspectiveCameraInfo:void 0,orthographicCameraInfo:void 0,lightInfo:void 0,children:[]};e.animations.forEach(t=>{n.animations.push({name:t.name,duration:t.duration,blendMode:t.blendMode})});const a=e.type.toLowerCase();if(a.search("mesh")>-1){const t=e;if(Array.isArray(t.material)){const i=[];t.material.forEach(c=>{i.push(et(c))}),n.material=i}else n.material=et(t.material)}else if(a.search("points")>-1){const t=e;if(Array.isArray(t.material)){const i=[];t.material.forEach(c=>{i.push(et(c))}),n.material=i}else n.material=et(t.material)}else if(a.search("line")>-1){const t=e;if(Array.isArray(t.material)){const i=[];t.material.forEach(c=>{i.push(et(c))}),n.material=i}else n.material=et(t.material)}else a.search("camera")>-1?e.type==="PerspectiveCamera"?n.perspectiveCameraInfo={fov:e.fov,zoom:e.zoom,near:e.near,far:e.far,focus:e.focus,aspect:e.aspect,filmGauge:e.filmGauge,filmOffset:e.filmOffset}:e.type==="OrthographicCamera"&&(n.orthographicCameraInfo={zoom:e.zoom,near:e.near,far:e.far,left:e.left,right:e.right,top:e.top,bottom:e.bottom}):a.search("light")>-1&&(n.lightInfo={color:e.color,intensity:e.intensity,decay:e.decay,distance:e.distance,angle:e.angle,penumbra:e.penumbra,groundColor:e.groundColor,width:e.width,height:e.height});return n}function kn(e,n){const a=n.split(".");switch(a.length){case 1:return e[a[0]];case 2:return e[a[0]][a[1]];case 3:return e[a[0]][a[1]][a[2]];case 4:return e[a[0]][a[1]][a[2]][a[3]];case 5:return e[a[0]][a[1]][a[2]][a[3]][a[4]];case 6:return e[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]]}}function Dn(e,n){for(const a in n)e[a]=n[a]}function te(e,n,a){if(e===void 0){console.log(`Hermes - Can't set props: ${n}`,a);return}const t=n.split("."),i=t.length;if(typeof a!="object")switch(i){case 1:e[t[0]]=a;break;case 2:e[t[0]][t[1]]=a;break;case 3:e[t[0]][t[1]][t[2]]=a;break;case 4:e[t[0]][t[1]][t[2]][t[3]]=a;break;case 5:e[t[0]][t[1]][t[2]][t[3]][t[4]]=a;break}else{let u;switch(i){case 1:u=e[t[0]];break;case 2:u=e[t[0]][t[1]];break;case 3:u=e[t[0]][t[1]][t[2]];break;case 4:u=e[t[0]][t[1]][t[2]][t[3]];break;case 5:u=e[t[0]][t[1]][t[2]][t[3]][t[4]];break}u!=null&&Dn(u,a)}}function sn(e){return new Promise((n,a)=>{const t=new Image;t.onload=()=>{const i=new f.Texture(t);i.wrapS=f.RepeatWrapping,i.wrapT=f.RepeatWrapping,i.needsUpdate=!0,n(i)},t.onerror=a,t.src=e})}class An extends dt{scene=void 0;scenes=new Map;renderer=void 0;renderTargets=new Map;dispose(){this.scenes.forEach(n=>{ut(n)}),this.scenes.clear(),this.scene&&ut(this.scene),this.renderTargets.forEach(n=>{n.dispose()}),this.renderTargets.clear(),this.renderer?.dispose()}getObject(n){this.app.debugEnabled&&this.app.send({event:"getObject",target:"app",data:n})}setObject(n){const a=kt(n);this.app.send({event:"setObject",target:"editor",data:a})}requestMethod(n,a,t,i){this.app.send({event:"requestMethod",target:"app",data:{uuid:n,key:a,value:t,subitem:i}})}updateObject(n,a,t){this.app.send({event:"updateObject",target:"app",data:{uuid:n,key:a,value:t}})}createTexture(n,a,t){this.app.send({event:"createTexture",target:"app",data:{uuid:n,key:a,value:t}})}addScene(n){if(n===void 0||(this.scenes.set(n.name,n),!this.app.debugEnabled))return;Nt(),xt(n);const a=yt(n);this.app.send({event:"addScene",target:"editor",data:a})}removeScene(n){if(n===void 0||(this.scenes.delete(n.name),!this.app.debugEnabled))return;const a=yt(n);this.app.send({event:"removeScene",target:"editor",data:a})}removeAllScenes(){this.scenes.forEach(n=>this.removeScene(n))}getScene(n){let a=null;return this.scenes.forEach((t,i)=>{n.search(i)>-1&&(a=t)}),a}setScene(n){if(n===void 0||(this.scene=n,!this.app.debugEnabled))return;Nt(),xt(n);const a=yt(n);this.app.send({event:"setScene",target:"editor",data:a})}addCamera(n){if(!this.app.debugEnabled)return;const a=kt(n);this.app.send({event:"addCamera",target:"editor",data:a})}removeCamera(n){if(!this.app.debugEnabled)return;const a=kt(n);this.app.send({event:"removeCamera",target:"editor",data:a})}handleApp(n,a,t){switch(t.event){case"getObject":j.dispatchEvent({type:I.GET_OBJECT,value:t.data});break;case"updateObject":j.dispatchEvent({type:I.UPDATE_OBJECT,value:t.data});break;case"createTexture":j.dispatchEvent({type:I.CREATE_TEXTURE,value:t.data});break;case"requestMethod":j.dispatchEvent({type:I.REQUEST_METHOD,value:t.data});break}}handleEditor(n,a,t){switch(t.event){case"setObject":j.dispatchEvent({type:I.SET_OBJECT,value:t.data});break;case"addScene":j.dispatchEvent({type:I.ADD_SCENE,value:t.data});break;case"removeScene":j.dispatchEvent({type:I.REMOVE_SCENE,value:t.data});break;case"setScene":j.dispatchEvent({type:I.SET_SCENE,value:t.data});break;case"addCamera":j.dispatchEvent({type:I.ADD_CAMERA,value:t.data});break;case"removeCamera":j.dispatchEvent({type:I.REMOVE_CAMERA,value:t.data});break}}rendererWidth=300;rendererHeight=150;addRT(n,a){const t=new f.WebGLRenderTarget(32,32,a);t.texture.name=n,this.renderTargets.set(n,t)}resize(n,a){const t=this.dpr;this.rendererWidth=n,this.rendererHeight=a,this.renderTargets.forEach(i=>{i.setSize(n*t,a*t)}),this.renderer?.setSize(n,a)}set dpr(n){this.renderer?.setPixelRatio(He(1,2,n))}get dpr(){return this.renderer!==void 0?this.renderer?.getPixelRatio():1}get width(){return this.rendererWidth}get height(){return this.rendererHeight}get canvas(){return this.renderer!==void 0?this.renderer?.domElement:null}}class Pn extends dt{bindCBs;buttonCBs;pane=void 0;appCallbacks=0;editorCallbacks=0;inspectorFolder=void 0;constructor(n){super(n),this.bindCBs=new Map,this.buttonCBs=new Map,n.editor&&this.createGUI()}createGUI(){this.pane=new vn.Pane({title:"GUI"}),this.pane.registerPlugin(En)}dispose(){this.bindCBs.clear(),this.buttonCBs.clear(),this.appCallbacks=0,this.editorCallbacks=0,this.app.editor&&(this.pane?.dispose(),this.pane=void 0)}addFolder(n,a=void 0,t=void 0){if(this.app.editor)return this.pane===void 0&&this.createGUI(),(t!==void 0?t:this.pane).addFolder({title:n,...a});this.app.send({event:"addFolder",target:"app",data:{name:n,params:a,parent:t}})}get bindID(){return`debug_${Math.max(this.appCallbacks,this.editorCallbacks)}`}bind(n,a,t,i=void 0){const c=this.bindID,u=t.onChange!==void 0?t.onChange:Ct;this.bindCBs.set(c,u),this.app.editor?(this.pane===void 0&&this.createGUI(),(i!==void 0?i:this.pane).addBinding(n,a,t).on("change",h=>{this.app.send({event:"updateBind",target:"app",data:{id:c,value:h.value}})}),this.editorCallbacks++):(this.app.send({event:"bindObject",target:"app",data:{id:c,name:a,params:t,parent:i}}),this.appCallbacks++)}triggerBind(n,a){const t=this.bindCBs.get(n);t!==void 0?t(a):console.warn(`No callback for: ${n}`,a)}button(n,a,t=void 0){const i=this.bindID;this.buttonCBs.set(i,a),this.app.editor?(this.pane===void 0&&this.createGUI(),(t!==void 0?t:this.pane).addButton({title:n}).on("click",()=>{this.app.send({event:"clickButton",target:"app",data:{id:i}})}),this.editorCallbacks++):(this.app.send({event:"addButton",target:"app",data:{id:i,name:n,callback:a,parent:t}}),this.appCallbacks++)}triggerButton(n){const a=this.buttonCBs.get(n);a!==void 0&&a()}createInspector(){this.inspectorFolder=this.addFolder("Inspector",this.pane)}clearInspector(){const n=this.inspectorFolder.children.length-1;for(let a=n;a>-1;--a)this.inspectorFolder.remove(this.inspectorFolder.children[a])}handleApp(n,a,t){const i=a;switch(t.event){case"addFolder":i.addFolder(t.data.name,t.data.params,t.data.parent);break;case"bindObject":i.bind(t.data.name,t.data.params,t.data.parent);break;case"updateBind":i.triggerBind(t.data.id,t.data.value);break;case"addButton":i.button(t.data.name,t.data.callback,t.data.parent);break;case"clickButton":i.triggerButton(t.data.id);break}}}var Lt={exports:{}},rt={};/**
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("three"),En=require("tweakpane"),Sn=require("@tweakpane/plugin-essentials"),b=require("react"),an=require("framer-motion");function xn(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const t=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,t.get?t:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const Cn=xn(Sn),wt=()=>{},wn=()=>{};function lt(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function Ve(e,n,a){return Math.min(n,Math.max(e,a))}function It(e,n,a){return(a-e)/(n-e)}function jt(e,n,a){return e*(1-a)+n*a}function Mn(e,n){const a=e-n;return Math.sqrt(a*a)}function rn(){return Math.round(Math.random()*1e6).toString()}function sn(e){return e.r!==void 0&&e.g!==void 0&&e.b!==void 0}function on(e){const n=Math.round(e.r*255),a=Math.round(e.g*255),t=Math.round(e.b*255),i=h=>{const d=h.toString(16);return d.length===1?"0"+d:d},o=i(n),l=i(a),r=i(t);return"#"+o+l+r}function Nt(e,n=1){return Number(e.toFixed(n))}exports.totalThreeObjects=0;const Lt=()=>{exports.totalThreeObjects=0},xt=e=>{if(!e)return;let n=e.name.replaceAll(" ","").replaceAll("/",".");if(n.length===0&&(n=`obj_${exports.totalThreeObjects}`,exports.totalThreeObjects++),e.parent!==null&&e.parent.uuid.length>0&&(n=`${e.parent.uuid}.${n}`),e.uuid=n,e.isMesh!==void 0){const a=e;if(Array.isArray(a.material))a.material.forEach((t,i)=>{t.uuid=`${n}.material.${i}`});else{const t=a.material;t.uuid=`${n}.material`}}e.children.forEach(a=>xt(a))},On=e=>{e?.dispose()},cn=e=>{e&&(Array.isArray(e)?e.forEach(n=>n.dispose()):e.dispose())},ut=e=>{if(e){for(;e.children.length>0;){const n=e.children[0];n.type==="Audio"?(n.pause(),n.parent&&n.parent.remove(n)):ut(n)}if(e.parent&&e.parent.remove(e),e.isMesh){const n=e;n.geometry?.dispose(),cn(n.material)}e.dispose!==void 0&&e.dispose()}};class Rn{components=new Map;listen;_appID="";_debugEnabled;_broadcastChannel=void 0;_webSocket=void 0;_mode="app";_connected=!1;_useBC=!1;constructor(n,a,t=!0){this._appID=n,this._debugEnabled=a,a&&(this._useBC=t,t?(this._broadcastChannel=new BroadcastChannel(n),this._broadcastChannel.addEventListener("message",this.messageHandler)):(this._webSocket=new WebSocket(n),this._webSocket.addEventListener("open",this.openHandler),this._webSocket.addEventListener("close",this.closeHandler),this._webSocket.addEventListener("message",this.messageHandler)))}addComponent(n,a){this.components.set(n,a)}dispose(){this._broadcastChannel!==void 0&&this._broadcastChannel.removeEventListener("message",this.messageHandler),this._webSocket!==void 0&&(this._webSocket.removeEventListener("open",this.openHandler),this._webSocket.removeEventListener("close",this.closeHandler),this._webSocket.removeEventListener("message",this.messageHandler)),this.components.forEach(n=>{n.dispose()}),this.components.clear()}send(n){this._mode!==n.target&&(this._useBC?this._broadcastChannel?.postMessage(n):this._connected&&this._webSocket?.send(JSON.stringify(n)))}messageHandler=n=>{this.listen!==void 0&&(this._useBC?this.listen(n.data):this.listen(JSON.parse(n.data)))};openHandler=()=>{this._connected=!0};closeHandler=()=>{this._connected=!1};get appID(){return this._appID}get connected(){return this._connected}get debugEnabled(){return this._debugEnabled}get mode(){return this._mode}get isApp(){return this._mode==="app"}get editor(){return this._mode==="editor"}set editor(n){n&&(this._mode="editor")}}const I=new f.EventDispatcher,j={CUSTOM:"ToolEvents::custom",SELECT_DROPDOWN:"ToolEvents::selectDropdown",DRAG_UPDATE:"ToolEvents::dragUpdate",ADD_SCENE:"ToolEvents::addScene",REMOVE_SCENE:"ToolEvents::removeScene",SET_SCENE:"ToolEvents::setScene",GET_OBJECT:"ToolEvents::getObject",SET_OBJECT:"ToolEvents::setObject",UPDATE_OBJECT:"ToolEvents::updateObject",CREATE_TEXTURE:"ToolEvents::createTexture",REQUEST_METHOD:"ToolEvents::requestMethod",ADD_CAMERA:"ToolEvents::addCamera",REMOVE_CAMERA:"ToolEvents::removeCamera"};class dt{app;constructor(n){this.app=n}dispose(){}handleApp(n,a,t){}handleEditor(n,a,t){}}class Tn extends dt{selectDropdown(n,a){this.app.send({event:"selectComponent",target:"app",data:{dropdown:n,value:a}})}updateDropdown(n,a){this.app.send({event:"draggableListUpdate",target:"app",data:{dropdown:n,value:a}})}handleApp(n,a,t){switch(t.event){case"selectComponent":I.dispatchEvent({type:j.SELECT_DROPDOWN,value:t.data});break;case"draggableListUpdate":I.dispatchEvent({type:j.DRAG_UPDATE,value:t.data});break}}}class Mt extends dt{project;sheets=new Map;sheetObjects=new Map;sheetObjectCBs=new Map;sheetObjectUnsubscribe=new Map;activeSheet;studio=void 0;static rafDriver=void 0;dispose(){this.project=void 0,this.sheets=new Map,this.sheetObjects=new Map,this.sheetObjectCBs=new Map,this.sheetObjectUnsubscribe=new Map}getSheetInstance(n,a){return a!==void 0?`${n}-${a}`:n}sheet(n,a){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const t=this.getSheetInstance(n,a);let i=this.sheets.get(t);return i!==void 0||(i=this.project?.sheet(n,a),this.sheets.set(t,i)),i}playSheet(n,a,t){this.sheet(n,t)?.sequence.play(a),this.app.send({event:"playSheet",target:"editor",data:{sheet:n,instance:t,value:a}})}pauseSheet(n,a){this.sheet(n)?.sequence.pause(),this.app.send({event:"pauseSheet",target:"editor",data:{sheet:n,instance:a}})}clearSheetObjects(n){this.sheetObjects.forEach((a,t)=>{t.search(`${n}_`)>-1&&this.unsubscribe(a)})}sheetObject(n,a,t,i,o){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const l=this.sheet(n,o);if(l===void 0)return;const h=`${this.getSheetInstance(n,o)}_${a}`;let d=this.sheetObjects.get(h);d!==void 0?d=l.object(a,{...t,...d.value},{reconfigure:!0}):d=l.object(a,t),this.sheetObjects.set(h,d),this.sheetObjectCBs.set(h,i!==void 0?i:wt);const m=d.onValuesChange(y=>{if(this.app.editor){for(const C in y){const A=y[C];typeof A=="object"&&sn(A)&&(y[C]={r:A.r,g:A.g,b:A.b,a:A.a})}this.app.send({event:"updateSheetObject",target:"app",data:{sheet:n,sheetObject:h,values:y}})}const E=this.sheetObjectCBs.get(h);E!==void 0&&E(y)});return this.sheetObjectUnsubscribe.set(h,m),d}unsubscribe(n){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const a=n.address.sheetId,t=n.address.objectKey;this.sheets.get(a)?.detachObject(t);const o=`${a}_${t}`,l=this.sheetObjectUnsubscribe.get(o);l!==void 0&&(this.sheetObjects.delete(o),this.sheetObjectCBs.delete(o),this.sheetObjectUnsubscribe.delete(o),l())}handleApp(n,a,t){const i=a;let o;switch(t.event){case"setSheet":o=i.sheets.get(t.data.sheet),o!==void 0&&(i.activeSheet=o,this.studio?.setSelection([o]));break;case"setSheetObject":o=i.sheetObjects.get(`${t.data.sheet}_${t.data.key}`),o!==void 0&&this.studio?.setSelection([o]);break;case"updateSheetObject":o=i.sheets.get(t.data.sheet),o!==void 0&&o.sequence.pause(),o=i.sheetObjectCBs.get(t.data.sheetObject),o!==void 0&&o(t.data.values);break;case"updateTimeline":o=i.sheets.get(t.data.sheet),i.activeSheet!==void 0&&(i.activeSheet.sequence.position=t.data.position);break}}handleEditor(n,a,t){if(n.editor){const i=a;switch(t.event){case"playSheet":i.sheet(t.data.sheet,t.data.instance)?.sequence.play(t.data.value);break;case"pauseSheet":i.sheet(t.data.sheet,t.data.instance)?.sequence.pause();break}}}handleEditorApp(n,a){if(n.editor){this.studio?.ui.restore(),this.studio?.onSelectionChange(l=>{l.length<1||l.forEach(r=>{let h=r.address.sheetId,d="setSheet",m={};switch(r.type){case"Theatre_Sheet_PublicAPI":d="setSheet",m={sheet:r.address.sheetId},a.activeSheet=a.sheets.get(r.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":d="setSheetObject",h+=`_${r.address.objectKey}`,m={id:h,sheet:r.address.sheetId,key:r.address.objectKey},a.activeSheet=a.sheets.get(r.address.sheetId);break}n.send({event:d,target:"app",data:m})})});let t=-1;const i=()=>{if(Mt.rafDriver?.tick(performance.now()),a.activeSheet!==void 0&&t!==a.activeSheet.sequence.position){t=a.activeSheet.sequence.position;const l=a.activeSheet;n.send({event:"updateTimeline",target:"app",data:{position:t,sheet:l.address.sheetId}})}},o=()=>{i(),requestAnimationFrame(o)};i(),o()}else this.studio?.ui.hide()}}function _n(e,n,a){if(e.editor){a.ui.restore(),a.onSelectionChange(l=>{l.length<1||l.forEach(r=>{let h=r.address.sheetId,d="setSheet",m={};switch(r.type){case"Theatre_Sheet_PublicAPI":d="setSheet",m={sheet:r.address.sheetId},n.activeSheet=n.sheets.get(r.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":d="setSheetObject",h+=`_${r.address.objectKey}`,m={id:h,sheet:r.address.sheetId,key:r.address.objectKey},n.activeSheet=n.sheets.get(r.address.sheetId);break}e.send({event:d,target:"app",data:m})})});let t=-1;const i=()=>{if(Mt.rafDriver?.tick(performance.now()),n.activeSheet!==void 0&&t!==n.activeSheet.sequence.position){t=n.activeSheet.sequence.position;const l=n.activeSheet;e.send({event:"updateTimeline",target:"app",data:{position:t,sheet:l.address.sheetId}})}},o=()=>{i(),requestAnimationFrame(o)};i(),o()}else a.ui.hide()}function kn(e){if(e.name==="cameras")return"camera";if(e.name==="interactive")return"interactive";if(e.name==="lights")return"light";if(e.name==="ui")return"ui";if(e.name==="utils")return"utils";const n=e.type;return n.search("Helper")>-1?"icon_utils":n.search("Camera")>-1?"camera":n.search("Light")>-1?"light":"obj3D"}function Et(e){const n={name:e.name,type:e.type,uuid:e.uuid,children:[]};return e.children.forEach(a=>{n.children.push(Et(a))}),n}function Dn(e){const n={};for(const a in e){const t=e[a].value;n[a]={value:t},t===null?n[a].value={src:"",offset:[0,0],repeat:[1,1]}:t.isTexture&&(n[a].value={src:t.image.src,offset:[t.offset.x,t.offset.y],repeat:[t.repeat.x,t.repeat.y]})}return n}function An(e){switch(e){case"blendSrcAlpha":case"blendDstAlpha":case"blendEquationAlpha":case"clippingPlanes":case"shadowSide":case"precision":return!0}return!1}function Ze(e){const n={};for(const a in e){if(a.substring(0,1)==="_"||a.substring(0,2)==="is"||An(a))continue;const t=typeof e[a],i=e[a];switch(t){case"boolean":case"number":case"string":n[a]=i;break;case"object":if(i!==null)if(n[a]=i,i.isTexture)if(i instanceof f.Texture){const l=i.source.toJSON().url;n[a]={src:l,offset:[i.offset.x,i.offset.y],repeat:[i.repeat.x,i.repeat.y]}}else i instanceof f.CubeTexture&&(console.log("env map"),console.log(i.source.data),console.log(i.source.toJSON()),n[a]={src:"",offset:[i.offset.x,i.offset.y],repeat:[i.repeat.x,i.repeat.y]});else a==="uniforms"&&(n[a]=Dn(n[a]));else n[a]={src:"",offset:[0,0],repeat:[1,1]};break}}return n}function Dt(e){e.updateMatrix();const n={name:e.name,type:e.type,uuid:e.uuid,visible:e.visible,matrix:e.matrix.elements,animations:[],material:void 0,perspectiveCameraInfo:void 0,orthographicCameraInfo:void 0,lightInfo:void 0,children:[]};e.animations.forEach(t=>{n.animations.push({name:t.name,duration:t.duration,blendMode:t.blendMode})});const a=e.type.toLowerCase();if(a.search("mesh")>-1){const t=e;if(Array.isArray(t.material)){const i=[];t.material.forEach(o=>{i.push(Ze(o))}),n.material=i}else n.material=Ze(t.material)}else if(a.search("points")>-1){const t=e;if(Array.isArray(t.material)){const i=[];t.material.forEach(o=>{i.push(Ze(o))}),n.material=i}else n.material=Ze(t.material)}else if(a.search("line")>-1){const t=e;if(Array.isArray(t.material)){const i=[];t.material.forEach(o=>{i.push(Ze(o))}),n.material=i}else n.material=Ze(t.material)}else a.search("camera")>-1?e.type==="PerspectiveCamera"?n.perspectiveCameraInfo={fov:e.fov,zoom:e.zoom,near:e.near,far:e.far,focus:e.focus,aspect:e.aspect,filmGauge:e.filmGauge,filmOffset:e.filmOffset}:e.type==="OrthographicCamera"&&(n.orthographicCameraInfo={zoom:e.zoom,near:e.near,far:e.far,left:e.left,right:e.right,top:e.top,bottom:e.bottom}):a.search("light")>-1&&(n.lightInfo={color:e.color,intensity:e.intensity,decay:e.decay,distance:e.distance,angle:e.angle,penumbra:e.penumbra,groundColor:e.groundColor,width:e.width,height:e.height});return n}function Pn(e,n){const a=n.split(".");switch(a.length){case 1:return e[a[0]];case 2:return e[a[0]][a[1]];case 3:return e[a[0]][a[1]][a[2]];case 4:return e[a[0]][a[1]][a[2]][a[3]];case 5:return e[a[0]][a[1]][a[2]][a[3]][a[4]];case 6:return e[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]]}}function In(e,n){for(const a in n)e[a]=n[a]}function Q(e,n,a){if(e===void 0){console.log(`Hermes - Can't set props: ${n}`,a);return}const t=n.split("."),i=t.length;if(typeof a!="object")switch(i){case 1:e[t[0]]=a;break;case 2:e[t[0]][t[1]]=a;break;case 3:e[t[0]][t[1]][t[2]]=a;break;case 4:e[t[0]][t[1]][t[2]][t[3]]=a;break;case 5:e[t[0]][t[1]][t[2]][t[3]][t[4]]=a;break}else{let l;switch(i){case 1:l=e[t[0]];break;case 2:l=e[t[0]][t[1]];break;case 3:l=e[t[0]][t[1]][t[2]];break;case 4:l=e[t[0]][t[1]][t[2]][t[3]];break;case 5:l=e[t[0]][t[1]][t[2]][t[3]][t[4]];break}l!=null&&In(l,a)}}function ln(e){return new Promise((n,a)=>{const t=new Image;t.onload=()=>{const i=new f.Texture(t);i.wrapS=f.RepeatWrapping,i.wrapT=f.RepeatWrapping,i.needsUpdate=!0,n(i)},t.onerror=a,t.src=e})}class jn extends dt{scene=void 0;scenes=new Map;renderer=void 0;renderTargets=new Map;dispose(){this.scenes.forEach(n=>{ut(n)}),this.scenes.clear(),this.scene&&ut(this.scene),this.renderTargets.forEach(n=>{n.dispose()}),this.renderTargets.clear(),this.renderer?.dispose()}getObject(n){this.app.debugEnabled&&this.app.send({event:"getObject",target:"app",data:n})}setObject(n){const a=Dt(n);this.app.send({event:"setObject",target:"editor",data:a})}requestMethod(n,a,t,i){this.app.send({event:"requestMethod",target:"app",data:{uuid:n,key:a,value:t,subitem:i}})}updateObject(n,a,t){this.app.send({event:"updateObject",target:"app",data:{uuid:n,key:a,value:t}})}createTexture(n,a,t){this.app.send({event:"createTexture",target:"app",data:{uuid:n,key:a,value:t}})}addScene(n){if(n===void 0||(this.scenes.set(n.name,n),!this.app.debugEnabled))return;Lt(),xt(n);const a=Et(n);this.app.send({event:"addScene",target:"editor",data:a})}removeScene(n){if(n===void 0||(this.scenes.delete(n.name),!this.app.debugEnabled))return;const a=Et(n);this.app.send({event:"removeScene",target:"editor",data:a})}removeAllScenes(){this.scenes.forEach(n=>this.removeScene(n))}getScene(n){let a=null;return this.scenes.forEach((t,i)=>{n.search(i)>-1&&(a=t)}),a}setScene(n){if(n===void 0||(this.scene=n,!this.app.debugEnabled))return;Lt(),xt(n);const a=Et(n);this.app.send({event:"setScene",target:"editor",data:a})}addCamera(n){if(!this.app.debugEnabled)return;const a=Dt(n);this.app.send({event:"addCamera",target:"editor",data:a})}removeCamera(n){if(!this.app.debugEnabled)return;const a=Dt(n);this.app.send({event:"removeCamera",target:"editor",data:a})}handleApp(n,a,t){switch(t.event){case"getObject":I.dispatchEvent({type:j.GET_OBJECT,value:t.data});break;case"updateObject":I.dispatchEvent({type:j.UPDATE_OBJECT,value:t.data});break;case"createTexture":I.dispatchEvent({type:j.CREATE_TEXTURE,value:t.data});break;case"requestMethod":I.dispatchEvent({type:j.REQUEST_METHOD,value:t.data});break}}handleEditor(n,a,t){switch(t.event){case"setObject":I.dispatchEvent({type:j.SET_OBJECT,value:t.data});break;case"addScene":I.dispatchEvent({type:j.ADD_SCENE,value:t.data});break;case"removeScene":I.dispatchEvent({type:j.REMOVE_SCENE,value:t.data});break;case"setScene":I.dispatchEvent({type:j.SET_SCENE,value:t.data});break;case"addCamera":I.dispatchEvent({type:j.ADD_CAMERA,value:t.data});break;case"removeCamera":I.dispatchEvent({type:j.REMOVE_CAMERA,value:t.data});break}}rendererWidth=300;rendererHeight=150;addRT(n,a){const t=new f.WebGLRenderTarget(32,32,a);t.texture.name=n,this.renderTargets.set(n,t)}resize(n,a){const t=this.dpr;this.rendererWidth=n,this.rendererHeight=a,this.renderTargets.forEach(i=>{i.setSize(n*t,a*t)}),this.renderer?.setSize(n,a)}set dpr(n){this.renderer?.setPixelRatio(Ve(1,2,n))}get dpr(){return this.renderer!==void 0?this.renderer?.getPixelRatio():1}get width(){return this.rendererWidth}get height(){return this.rendererHeight}get canvas(){return this.renderer!==void 0?this.renderer?.domElement:null}}class Nn extends dt{bindCBs;buttonCBs;pane=void 0;appCallbacks=0;editorCallbacks=0;inspectorFolder=void 0;constructor(n){super(n),this.bindCBs=new Map,this.buttonCBs=new Map,n.editor&&this.createGUI()}createGUI(){this.pane=new En.Pane({title:"GUI"}),this.pane.registerPlugin(Cn)}dispose(){this.bindCBs.clear(),this.buttonCBs.clear(),this.appCallbacks=0,this.editorCallbacks=0,this.app.editor&&(this.pane?.dispose(),this.pane=void 0)}addFolder(n,a=void 0,t=void 0){if(this.app.editor)return this.pane===void 0&&this.createGUI(),(t!==void 0?t:this.pane).addFolder({title:n,...a});this.app.send({event:"addFolder",target:"app",data:{name:n,params:a,parent:t}})}get bindID(){return`debug_${Math.max(this.appCallbacks,this.editorCallbacks)}`}bind(n,a,t,i=void 0){const o=this.bindID,l=t.onChange!==void 0?t.onChange:wt;this.bindCBs.set(o,l),this.app.editor?(this.pane===void 0&&this.createGUI(),(i!==void 0?i:this.pane).addBinding(n,a,t).on("change",h=>{this.app.send({event:"updateBind",target:"app",data:{id:o,value:h.value}})}),this.editorCallbacks++):(this.app.send({event:"bindObject",target:"app",data:{id:o,name:a,params:t,parent:i}}),this.appCallbacks++)}triggerBind(n,a){const t=this.bindCBs.get(n);t!==void 0?t(a):console.warn(`No callback for: ${n}`,a)}button(n,a,t=void 0){const i=this.bindID;this.buttonCBs.set(i,a),this.app.editor?(this.pane===void 0&&this.createGUI(),(t!==void 0?t:this.pane).addButton({title:n}).on("click",()=>{this.app.send({event:"clickButton",target:"app",data:{id:i}})}),this.editorCallbacks++):(this.app.send({event:"addButton",target:"app",data:{id:i,name:n,callback:a,parent:t}}),this.appCallbacks++)}triggerButton(n){const a=this.buttonCBs.get(n);a!==void 0&&a()}createInspector(){this.inspectorFolder=this.addFolder("Inspector",this.pane)}clearInspector(){const n=this.inspectorFolder.children.length-1;for(let a=n;a>-1;--a)this.inspectorFolder.remove(this.inspectorFolder.children[a])}handleApp(n,a,t){const i=a;switch(t.event){case"addFolder":i.addFolder(t.data.name,t.data.params,t.data.parent);break;case"bindObject":i.bind(t.data.name,t.data.params,t.data.parent);break;case"updateBind":i.triggerBind(t.data.id,t.data.value);break;case"addButton":i.button(t.data.name,t.data.callback,t.data.parent);break;case"clickButton":i.triggerButton(t.data.id);break}}}var Ft={exports:{}},rt={};/**
|
2
2
|
* @license React
|
3
3
|
* react-jsx-runtime.production.min.js
|
4
4
|
*
|
@@ -6,7 +6,7 @@
|
|
6
6
|
*
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
|
-
*/var Ht;function
|
9
|
+
*/var Ht;function Ln(){if(Ht)return rt;Ht=1;var e=b,n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(r,h,d){var m,y={},E=null,C=null;d!==void 0&&(E=""+d),h.key!==void 0&&(E=""+h.key),h.ref!==void 0&&(C=h.ref);for(m in h)t.call(h,m)&&!o.hasOwnProperty(m)&&(y[m]=h[m]);if(r&&r.defaultProps)for(m in h=r.defaultProps,h)y[m]===void 0&&(y[m]=h[m]);return{$$typeof:n,type:r,key:E,ref:C,props:y,_owner:i.current}}return rt.Fragment=a,rt.jsx=l,rt.jsxs=l,rt}var st={};/**
|
10
10
|
* @license React
|
11
11
|
* react-jsx-runtime.development.js
|
12
12
|
*
|
@@ -14,20 +14,20 @@
|
|
14
14
|
*
|
15
15
|
* This source code is licensed under the MIT license found in the
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
17
|
-
*/var
|
18
|
-
`+
|
19
|
-
`),
|
20
|
-
`),
|
21
|
-
`+
|
17
|
+
*/var Wt;function Fn(){return Wt||(Wt=1,process.env.NODE_ENV!=="production"&&function(){var e=b,n=Symbol.for("react.element"),a=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),r=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),A=Symbol.iterator,K="@@iterator";function $(s){if(s===null||typeof s!="object")return null;var g=A&&s[A]||s[K];return typeof g=="function"?g:null}var H=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(s){{for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];V("error",s,S)}}function V(s,g,S){{var _=H.ReactDebugCurrentFrame,G=_.getStackAddendum();G!==""&&(g+="%s",S=S.concat([G]));var q=S.map(function(U){return String(U)});q.unshift("Warning: "+g),Function.prototype.apply.call(console[s],console,q)}}var k=!1,X=!1,re=!1,w=!1,ge=!1,Y;Y=Symbol.for("react.module.reference");function et(s){return!!(typeof s=="string"||typeof s=="function"||s===t||s===o||ge||s===i||s===d||s===m||w||s===C||k||X||re||typeof s=="object"&&s!==null&&(s.$$typeof===E||s.$$typeof===y||s.$$typeof===l||s.$$typeof===r||s.$$typeof===h||s.$$typeof===Y||s.getModuleId!==void 0))}function D(s,g,S){var _=s.displayName;if(_)return _;var G=g.displayName||g.name||"";return G!==""?S+"("+G+")":S}function _e(s){return s.displayName||"Context"}function se(s){if(s==null)return null;if(typeof s.tag=="number"&&O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case t:return"Fragment";case a:return"Portal";case o:return"Profiler";case i:return"StrictMode";case d:return"Suspense";case m:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case r:var g=s;return _e(g)+".Consumer";case l:var S=s;return _e(S._context)+".Provider";case h:return D(s,s.render,"ForwardRef");case y:var _=s.displayName||null;return _!==null?_:se(s.type)||"Memo";case E:{var G=s,q=G._payload,U=G._init;try{return se(U(q))}catch{return null}}}return null}var ve=Object.assign,we=0,be,Me,Ie,De,Ae,$e,je;function ee(){}ee.__reactDisabledLog=!0;function Oe(){{if(we===0){be=console.log,Me=console.info,Ie=console.warn,De=console.error,Ae=console.group,$e=console.groupCollapsed,je=console.groupEnd;var s={configurable:!0,enumerable:!0,value:ee,writable:!0};Object.defineProperties(console,{info:s,log:s,warn:s,error:s,group:s,groupCollapsed:s,groupEnd:s})}we++}}function tt(){{if(we--,we===0){var s={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ve({},s,{value:be}),info:ve({},s,{value:Me}),warn:ve({},s,{value:Ie}),error:ve({},s,{value:De}),group:ve({},s,{value:Ae}),groupCollapsed:ve({},s,{value:$e}),groupEnd:ve({},s,{value:je})})}we<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ze=H.ReactCurrentDispatcher,fe;function p(s,g,S){{if(fe===void 0)try{throw Error()}catch(G){var _=G.stack.trim().match(/\n( *(at )?)/);fe=_&&_[1]||""}return`
|
18
|
+
`+fe+s}}var v=!1,T;{var L=typeof WeakMap=="function"?WeakMap:Map;T=new L}function me(s,g){if(!s||v)return"";{var S=T.get(s);if(S!==void 0)return S}var _;v=!0;var G=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var q;q=ze.current,ze.current=null,Oe();try{if(g){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(Pe){_=Pe}Reflect.construct(s,[],U)}else{try{U.call()}catch(Pe){_=Pe}s.call(U.prototype)}}else{try{throw Error()}catch(Pe){_=Pe}s()}}catch(Pe){if(Pe&&_&&typeof Pe.stack=="string"){for(var N=Pe.stack.split(`
|
19
|
+
`),he=_.stack.split(`
|
20
|
+
`),J=N.length-1,ne=he.length-1;J>=1&&ne>=0&&N[J]!==he[ne];)ne--;for(;J>=1&&ne>=0;J--,ne--)if(N[J]!==he[ne]){if(J!==1||ne!==1)do if(J--,ne--,ne<0||N[J]!==he[ne]){var Ce=`
|
21
|
+
`+N[J].replace(" at new "," at ");return s.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",s.displayName)),typeof s=="function"&&T.set(s,Ce),Ce}while(J>=1&&ne>=0);break}}}finally{v=!1,ze.current=q,tt(),Error.prepareStackTrace=G}var Xe=s?s.displayName||s.name:"",Gt=Xe?p(Xe):"";return typeof s=="function"&&T.set(s,Gt),Gt}function le(s,g,S){return me(s,!1)}function R(s){var g=s.prototype;return!!(g&&g.isReactComponent)}function M(s,g,S){if(s==null)return"";if(typeof s=="function")return me(s,R(s));if(typeof s=="string")return p(s);switch(s){case d:return p("Suspense");case m:return p("SuspenseList")}if(typeof s=="object")switch(s.$$typeof){case h:return le(s.render);case y:return M(s.type,g,S);case E:{var _=s,G=_._payload,q=_._init;try{return M(q(G),g,S)}catch{}}}return""}var W=Object.prototype.hasOwnProperty,ae={},ye=H.ReactDebugCurrentFrame;function F(s){if(s){var g=s._owner,S=M(s.type,s._source,g?g.type:null);ye.setExtraStackFrame(S)}else ye.setExtraStackFrame(null)}function te(s,g,S,_,G){{var q=Function.call.bind(W);for(var U in s)if(q(s,U)){var N=void 0;try{if(typeof s[U]!="function"){var he=Error((_||"React class")+": "+S+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw he.name="Invariant Violation",he}N=s[U](g,U,_,S,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(J){N=J}N&&!(N instanceof Error)&&(F(G),O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",_||"React class",S,U,typeof N),F(null)),N instanceof Error&&!(N.message in ae)&&(ae[N.message]=!0,F(G),O("Failed %s type: %s",S,N.message),F(null))}}}var z=Array.isArray;function ke(s){return z(s)}function ce(s){{var g=typeof Symbol=="function"&&Symbol.toStringTag,S=g&&s[Symbol.toStringTag]||s.constructor.name||"Object";return S}}function ue(s){try{return ht(s),!1}catch{return!0}}function ht(s){return""+s}function nt(s){if(ue(s))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ce(s)),ht(s)}var Ne=H.ReactCurrentOwner,at={key:!0,ref:!0,__self:!0,__source:!0},it,ft,qe;qe={};function Tt(s){if(W.call(s,"ref")){var g=Object.getOwnPropertyDescriptor(s,"ref").get;if(g&&g.isReactWarning)return!1}return s.ref!==void 0}function _t(s){if(W.call(s,"key")){var g=Object.getOwnPropertyDescriptor(s,"key").get;if(g&&g.isReactWarning)return!1}return s.key!==void 0}function kt(s,g){if(typeof s.ref=="string"&&Ne.current&&g&&Ne.current.stateNode!==g){var S=se(Ne.current.type);qe[S]||(O('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',se(Ne.current.type),s.ref),qe[S]=!0)}}function mt(s,g){{var S=function(){it||(it=!0,O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",g))};S.isReactWarning=!0,Object.defineProperty(s,"key",{get:S,configurable:!0})}}function Le(s,g){{var S=function(){ft||(ft=!0,O("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",g))};S.isReactWarning=!0,Object.defineProperty(s,"ref",{get:S,configurable:!0})}}var $t=function(s,g,S,_,G,q,U){var N={$$typeof:n,type:s,key:g,ref:S,props:U,_owner:q};return N._store={},Object.defineProperty(N._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(N,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty(N,"_source",{configurable:!1,enumerable:!1,writable:!1,value:G}),Object.freeze&&(Object.freeze(N.props),Object.freeze(N)),N};function c(s,g,S,_,G){{var q,U={},N=null,he=null;S!==void 0&&(nt(S),N=""+S),_t(g)&&(nt(g.key),N=""+g.key),Tt(g)&&(he=g.ref,kt(g,G));for(q in g)W.call(g,q)&&!at.hasOwnProperty(q)&&(U[q]=g[q]);if(s&&s.defaultProps){var J=s.defaultProps;for(q in J)U[q]===void 0&&(U[q]=J[q])}if(N||he){var ne=typeof s=="function"?s.displayName||s.name||"Unknown":s;N&&mt(U,ne),he&&Le(U,ne)}return $t(s,N,he,G,_,Ne.current,U)}}var x=H.ReactCurrentOwner,P=H.ReactDebugCurrentFrame;function B(s){if(s){var g=s._owner,S=M(s.type,s._source,g?g.type:null);P.setExtraStackFrame(S)}else P.setExtraStackFrame(null)}var ie;ie=!1;function Ee(s){return typeof s=="object"&&s!==null&&s.$$typeof===n}function de(){{if(x.current){var s=se(x.current.type);if(s)return`
|
22
22
|
|
23
23
|
Check the render method of \``+s+"`."}return""}}function zt(s){{if(s!==void 0){var g=s.fileName.replace(/^.*[\\\/]/,""),S=s.lineNumber;return`
|
24
24
|
|
25
|
-
Check your code at `+g+":"+S+"."}return""}}var
|
25
|
+
Check your code at `+g+":"+S+"."}return""}}var pt={};function gt(s){{var g=de();if(!g){var S=typeof s=="string"?s:s.displayName||s.name;S&&(g=`
|
26
26
|
|
27
|
-
Check the top-level render call using <`+S+">.")}return g}}function
|
27
|
+
Check the top-level render call using <`+S+">.")}return g}}function Se(s,g){{if(!s._store||s._store.validated||s.key!=null)return;s._store.validated=!0;var S=gt(g);if(pt[S])return;pt[S]=!0;var _="";s&&s._owner&&s._owner!==x.current&&(_=" It was passed a child from "+se(s._owner.type)+"."),B(s),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',S,_),B(null)}}function xe(s,g){{if(typeof s!="object")return;if(ke(s))for(var S=0;S<s.length;S++){var _=s[S];Ee(_)&&Se(_,g)}else if(Ee(s))s._store&&(s._store.validated=!0);else if(s){var G=$(s);if(typeof G=="function"&&G!==s.entries)for(var q=G.call(s),U;!(U=q.next()).done;)Ee(U.value)&&Se(U.value,g)}}}function Ge(s){{var g=s.type;if(g==null||typeof g=="string")return;var S;if(typeof g=="function")S=g.propTypes;else if(typeof g=="object"&&(g.$$typeof===h||g.$$typeof===y))S=g.propTypes;else return;if(S){var _=se(g);te(S,s.props,"prop",_,s)}else if(g.PropTypes!==void 0&&!ie){ie=!0;var G=se(g);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",G||"Unknown")}typeof g.getDefaultProps=="function"&&!g.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Re(s){{for(var g=Object.keys(s.props),S=0;S<g.length;S++){var _=g[S];if(_!=="children"&&_!=="key"){B(s),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),B(null);break}}s.ref!==null&&(B(s),O("Invalid attribute `ref` supplied to `React.Fragment`."),B(null))}}function Fe(s,g,S,_,G,q){{var U=et(s);if(!U){var N="";(s===void 0||typeof s=="object"&&s!==null&&Object.keys(s).length===0)&&(N+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var he=zt(G);he?N+=he:N+=de();var J;s===null?J="null":ke(s)?J="array":s!==void 0&&s.$$typeof===n?(J="<"+(se(s.type)||"Unknown")+" />",N=" Did you accidentally export a JSX literal instead of a component?"):J=typeof s,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",J,N)}var ne=c(s,g,S,G,q);if(ne==null)return ne;if(U){var Ce=g.children;if(Ce!==void 0)if(_)if(ke(Ce)){for(var Xe=0;Xe<Ce.length;Xe++)xe(Ce[Xe],s);Object.freeze&&Object.freeze(Ce)}else O("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xe(Ce,s)}return s===t?Re(ne):Ge(ne),ne}}function Ke(s,g,S){return Fe(s,g,S,!0)}function vt(s,g,S){return Fe(s,g,S,!1)}var bn=vt,yn=Ke;st.Fragment=t,st.jsx=bn,st.jsxs=yn}()),st}process.env.NODE_ENV==="production"?Ft.exports=Ln():Ft.exports=Fn();var u=Ft.exports;function Bt(e){return e.title.search("<")>-1?u.jsx("button",{className:"svg",dangerouslySetInnerHTML:{__html:e.title}}):u.jsx("button",{children:e.title})}const Un=u.jsxs("svg",{className:"closeIcon",width:"14",height:"14",fill:"none",stroke:"#666666",strokeMiterlimit:"10",children:[u.jsx("circle",{cx:"7",cy:"7",r:"6"}),u.jsx("line",{x1:"4",y1:"4",x2:"10",y2:"10"}),u.jsx("line",{x1:"4",y1:"10",x2:"10",y2:"4"})]}),Bn=u.jsx("svg",{className:"dragIcon",width:"14",height:"14",fill:"#666666",stroke:"none",children:u.jsx("path",{d:`M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1
|
28
28
|
C11,4.22,10.74,4,10.43,4z M10.43,8H3.57C3.26,8,3,8.22,3,8.5v1C3,9.78,3.26,10,3.57,10h6.86C10.74,10,11,9.78,11,9.5v-1
|
29
|
-
C11,8.22,10.74,8,10.43,8z`})});function on(e){return l.jsx(en.Reorder.Item,{value:e.title,children:l.jsxs("div",{children:[Ln,l.jsx("span",{children:e.title}),l.jsx("button",{className:"closeIcon",onClick:()=>{e.onDelete(e.index)},children:Nn})]})},e.title)}function cn(e){const[n,a]=E.useState(!1),[t,i]=E.useState(e.options),c=d=>{e.onDragComplete(d),i(d)},u=d=>{const m=[...t];m.splice(d,1),c(m)},r=[];t.forEach((d,m)=>{r.push(l.jsx(on,{index:m,title:d,onDelete:u},d))});let h="dropdown draggable";return e.subdropdown&&(h+=" subdropdown"),l.jsxs("div",{className:h,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[l.jsx(Ut,{title:e.title}),l.jsx(en.Reorder.Group,{axis:"y",values:t,onReorder:c,style:{visibility:n?"visible":"hidden"},children:r})]})}function ln(e){const[n,a]=E.useState(!1),t=[];e.options.map((c,u)=>{e.onSelect!==void 0&&(c.onSelect=e.onSelect),t.push(l.jsx(un,{option:c},u))});let i="dropdown";return e.subdropdown&&(i+=" subdropdown"),l.jsxs("div",{className:i,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[l.jsx(Ut,{title:e.title}),l.jsx("ul",{style:{visibility:n?"visible":"hidden"},children:t})]})}function un(e){const{option:n}=e,[a,t]=E.useState("");let i;switch(n.type){case"draggable":i=l.jsx(cn,{title:n.title,options:n.value,onDragComplete:c=>{n.onDragComplete!==void 0&&n.onDragComplete(c)},subdropdown:!0});break;case"dropdown":i=l.jsx(ln,{title:n.title,options:n.value,onSelect:n.onSelect,subdropdown:!0});break;case"option":i=l.jsx("button",{onClick:()=>{n.onSelect!==void 0&&n.onSelect(n.value),n.selectable&&(a!==n.title?t(n.title):t(""))},children:n.title});break}return l.jsx("li",{className:a===n.title?"selected":"",children:i},tn())}function Fn(e,n,a){function t(c){switch(n.forEach(u=>{u.callback(e,u.remote,c)}),c.event){case"custom":j.dispatchEvent({type:I.CUSTOM,value:c.data});break}}function i(c){switch(a.forEach(u=>{u.callback(e,u.remote,c)}),c.event){case"custom":j.dispatchEvent({type:I.CUSTOM,value:c.data});break}}e.listen=c=>{c.target==="editor"?i(c):t(c)}}function Mt(e){const[n,a]=E.useState(e.open!==void 0?e.open:!0),t=!n||e.children===void 0;return l.jsxs("div",{className:`accordion ${t?"hide":""}`,children:[l.jsxs("button",{className:"toggle",onClick:()=>{const i=!n;e.onToggle!==void 0&&e.onToggle(i),a(i)},children:[l.jsx("p",{className:`status ${n?"open":""}`,children:"Toggle"}),l.jsx("p",{className:"label",children:lt(e.label)})]}),e.button,l.jsx("div",{className:n?"open":"",children:l.jsx("div",{children:e.children})})]})}function Bt(e){const n=E.useRef(null),[a,t]=E.useState(!1),i=e.child!==void 0&&e.child.children.length>0,c=[];return e.child!==void 0&&e.child.children.length>0&&e.child.children.map((u,r)=>{c.push(l.jsx(Bt,{child:u,three:e.three},r))}),E.useEffect(()=>{const u=e.child.uuid,r=e.three.getScene(u);if(r!==null){const h=r.getObjectByProperty("uuid",u);h!==void 0&&(n.current.style.opacity=h.visible?"1":"0.25")}},[]),l.jsx(l.Fragment,{children:e.child!==void 0&&l.jsxs("div",{className:"childObject",children:[l.jsxs("div",{className:"child",children:[i?l.jsx("button",{className:"status",style:{backgroundPositionX:a?"-14px":"2px"},onClick:()=>{t(!a)}}):null,l.jsx("button",{className:"name",style:{left:i?"20px":"5px"},onClick:()=>{e.child!==void 0&&(e.three.getObject(e.child.uuid),a||t(!0))},children:e.child.name.length>0?`${e.child.name} (${e.child.type})`:`${e.child.type}::${e.child.uuid}`}),l.jsx("button",{className:"visibility",ref:n,onClick:()=>{if(e.child){const u=e.three.getScene(e.child.uuid);if(u!==null){const r=u.getObjectByProperty("uuid",e.child.uuid);if(r!==void 0){const h="visible",d=!r.visible;n.current.style.opacity=d?"1":"0.25",e.three.updateObject(e.child.uuid,h,d),te(r,h,d)}else console.log(`Hermes - Couldn't find object: ${e.child.uuid}`,u)}else console.log(`Hermes - Couldn't find object in scene: ${e.child.uuid}, ${e.child.name}`)}}}),l.jsx("div",{className:`icon ${Rn(e.child)}`})]}),l.jsx("div",{className:a?"open":"",children:l.jsx("div",{className:"container",children:c})})]},Math.random())})}function dn(e){const n=[];return e.child?.children.map((a,t)=>{n.push(l.jsx(Bt,{child:a,scene:e.scene,three:e.three},t))}),l.jsx("div",{className:`scene ${e.class!==void 0?e.class:""}`,children:n})}function Un(e){const[n,a]=E.useState(e.defaultValue);return E.useEffect(()=>{let t=!1,i=-1,c=0,u=e.defaultValue;const r=b=>{t=!0,c=Number(e.input.current?.value),i=b.clientX,document.addEventListener("mouseup",d,!1),document.addEventListener("mousemove",h,!1),document.addEventListener("contextmenu",d,!1)},h=b=>{if(!t)return;const C=e.step!==void 0?e.step:1,D=(b.clientX-i)*C;u=Number((c+D).toFixed(4)),e.min!==void 0&&(u=Math.max(u,e.min)),e.max!==void 0&&(u=Math.min(u,e.max)),e.onChange!==void 0&&e.onChange(u),a(u)},d=()=>{t=!1,document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",h),document.removeEventListener("contextmenu",d)},m=b=>{const C=Number(b.target.value);a(C)},p=b=>{const C=Number(b.target.value);e.onChange!==void 0&&e.onChange(C),a(C)};return e.input.current?.addEventListener("input",m),e.label.current?.addEventListener("mousedown",r,!1),e.sliderRef!==void 0&&e.sliderRef.current?.addEventListener("input",p),()=>{e.input.current?.removeEventListener("input",m),e.label.current?.removeEventListener("mousedown",r),e.sliderRef!==void 0&&e.sliderRef.current?.removeEventListener("input",p),document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",h),document.removeEventListener("contextmenu",d)}},[]),n}function Ke(e){const n=E.useRef(null),a=E.useRef(null),t=Un({label:e.labelRef,input:n,sliderRef:a,defaultValue:e.value,min:e.min,max:e.max,step:e.step,onChange:i=>{e.onChange!==void 0&&e.onChange(e.prop,i)}});return l.jsxs(l.Fragment,{children:[e.type==="number"&&l.jsx("input",{alt:e.alt,className:e.className,ref:n,type:"number",value:t,min:e.min,max:e.max,step:e.step,disabled:e.disabled,onChange:i=>{const c=Number(i.target.value);e.onChange!==void 0&&e.onChange(e.prop,c)}}),e.type==="range"&&l.jsxs(l.Fragment,{children:[l.jsx("input",{type:"text",value:t.toString(),disabled:e.disabled,ref:n,className:"min",onChange:i=>{const c=Number(i.target.value);e.onChange!==void 0&&e.onChange(e.prop,c)}}),l.jsx("input",{disabled:e.disabled,type:"range",value:t,min:e.min,max:e.max,step:e.step,ref:a,onChange:Ct})]})]})}function Bn(e){const n=E.useRef(null),a=E.useRef(null),t=E.useRef(null),i=E.useRef(null),c=E.useRef(null),u=E.useRef(null),[r,h]=E.useState(e.value),[d,m]=E.useState({min:Math.min(e.min,Math.min(e.value.x,e.value.y)),max:Math.max(e.max,Math.max(e.value.x,e.value.y))}),[p,b]=E.useState(!1);function C(){p||(window.addEventListener("mousemove",q),window.addEventListener("mouseup",D),window.addEventListener("mouseup",D),b(!0))}function D(){window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",D),b(!1)}function q(R){const Z=c.current.getBoundingClientRect(),ce=He(0,99,R.clientX-Z.left)/99,W=He(0,99,R.clientY-Z.top)/99,me=It(jt(d.min,d.max,ce),3),ie=It(jt(d.min,d.max,W),3);e.onChange({target:{value:{x:me,y:ie}}}),h({x:me,y:ie})}function z(R){let Z=r.x,ce=r.y;R.target===n.current?Z=Number(R.target.value):ce=Number(R.target.value),h({x:Z,y:ce})}function G(){const R=Number(t.current.value);m({min:R,max:d.max}),(r.x<R||r.y<R)&&h({x:He(R,d.max,r.x),y:He(R,d.max,r.y)})}function M(){const R=Number(i.current.value);m({min:d.min,max:R}),(r.x>R||r.y>R)&&h({x:He(d.min,R,r.x),y:He(d.min,R,r.y)})}E.useEffect(()=>{const R=Pt(d.min,d.max,r.x),Z=Pt(d.min,d.max,r.y);u.current.style.left=`${R*100}%`,u.current.style.top=`${Z*100}%`},[d,r]);const K=e.step!==void 0?e.step:.01;return l.jsxs("div",{className:"vector2",children:[l.jsxs("div",{className:"fields",children:[l.jsxs("div",{children:[l.jsx("label",{children:"X:"}),l.jsx("input",{ref:n,type:"number",value:r.x,min:d.min,max:d.max,step:K,onChange:z})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Y:"}),l.jsx("input",{ref:a,type:"number",value:r.y,min:d.min,max:d.max,step:K,onChange:z})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Min:"}),l.jsx("input",{ref:t,type:"number",value:d.min,step:K,onChange:G})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Max:"}),l.jsx("input",{ref:i,type:"number",value:d.max,step:K,onChange:M})]})]}),l.jsxs("div",{className:"input",ref:c,onMouseDown:C,onMouseUp:D,children:[l.jsx("div",{className:"x"}),l.jsx("div",{className:"y"}),l.jsx("div",{className:"pt",ref:u})]})]})}function Wt(e){const n=e.value.isVector3!==void 0,a=e.value.isEuler!==void 0,t=e.value.elements!==void 0,i=e.step!==void 0?e.step:.01,c=[];if(n){const u=E.useMemo(()=>e.value,[]),r=(d,m)=>{u[d]=m,e.onChange({target:{value:u}})};["x","y","z"].forEach(d=>{const m=E.useRef(null);c.push(l.jsxs("div",{children:[l.jsx("label",{ref:m,children:d.toUpperCase()}),l.jsx(Ke,{value:u[d],type:"number",prop:d,step:i,labelRef:m,onChange:r})]},d))})}else if(a){const u=E.useMemo(()=>e.value,[]),r=(d,m)=>{u[d]=m,e.onChange({target:{value:u}})};["_x","_y","_z"].forEach(d=>{const m=E.useRef(null);c.push(l.jsxs("div",{children:[l.jsx("label",{ref:m,children:d.substring(1).toUpperCase()}),l.jsx(Ke,{value:u[d],type:"number",prop:d,step:i,labelRef:m,onChange:r})]},d))})}else if(t){const u=E.useMemo(()=>e.value,[]),r=(h,d)=>{const m=Number(h);u.elements[m]=d,e.onChange({target:{value:u}})};for(let h=0;h<9;h++){const d=E.useRef(null);c.push(l.jsxs("div",{children:[l.jsx("label",{ref:d,children:h+1}),l.jsx(Ke,{value:u.elements[h],type:"number",prop:h.toString(),step:i,labelRef:d,onChange:r})]},h.toString()))}}return l.jsx("div",{className:"grid3",children:c},Math.random().toString())}function Vn(e){const n=e.value.x!==void 0,a=e.step!==void 0?e.step:.01,t=[];if(n){const i=E.useMemo(()=>e.value,[]),c=(r,h)=>{i[r]=h,e.onChange({target:{value:i}})};["x","y","z","w"].forEach(r=>{const h=E.useRef(null);t.push(l.jsxs("div",{children:[l.jsx("label",{ref:h,children:r.toUpperCase()}),l.jsx(Ke,{value:i.x,type:"number",prop:r,step:a,labelRef:h,onChange:c})]},r))})}else{const i=E.useMemo(()=>e.value,[]),c=(u,r)=>{const h=Number(u);i.elements[h]=r,e.onChange({target:{value:i}})};for(let u=0;u<16;u++){const r=E.useRef(null);t.push(l.jsxs("div",{children:[l.jsx("label",{ref:r,children:u+1}),l.jsx(Ke,{value:i.elements[u],type:"number",prop:u.toString(),step:a,labelRef:r,onChange:c})]},u.toString()))}}return l.jsx("div",{className:"grid4",children:t})}function zn(e){return"items"in e}function Xe(e){const n=[];return e.items.forEach(a=>{zn(a)?n.push(l.jsx(Xe,{title:lt(a.title),items:a.items},Math.random())):n.push(l.jsx(Et,{title:a.title,prop:a.prop,value:a.value,type:a.type,min:a.min,max:a.max,step:a.step,disabled:a.disabled,options:a.options,onChange:(t,i)=>{a.onChange!==void 0&&a.onChange(t,i)},onKeyDown:t=>{a.onKeyDown!==void 0&&a.onKeyDown(t)}},Math.random()))}),l.jsx(Mt,{label:e.title,open:e.expanded===!0,children:n})}function Gn(e){return!(e==="alphaHash"||e==="alphaToCoverage"||e==="attenuationDistance"||e==="blendAlpha"||e==="blendColor"||e==="blendDstAlpha"||e==="colorWrite"||e==="combine"||e==="defaultAttributeValues"||e==="depthFunc"||e==="forceSinglePass"||e==="glslVersion"||e==="linecap"||e==="linejoin"||e==="linewidth"||e==="normalMapType"||e==="precision"||e==="premultipliedAlpha"||e==="shadowSide"||e==="toneMapped"||e==="uniformsGroups"||e==="uniformsNeedUpdate"||e==="userData"||e==="vertexColors"||e==="version"||e==="wireframeLinecap"||e==="wireframeLinejoin"||e==="wireframeLinewidth"||e.slice(0,4)==="clip"||e.slice(0,7)==="polygon"||e.slice(0,7)==="stencil"||e.slice(0,2)==="is")}function Hn(e){switch(e){case"Alpha Map":return"alphaMap";case"Anisotropy Map":return"anisotropyMap";case"AO Map":return"aoMap";case"Bump Map":return"bumpMap";case"Clearcoat Map":return"clearcoatMap";case"Clearcoat Normal Map":return"clearcoatNormalMap";case"Clearcoat Roughness Map":return"clearcoatRoughnessMap";case"Displacement Map":return"displacementMap";case"Emissive Map":return"emissiveMap";case"Iridescence Map":return"iridescenceMap";case"Iridescence Thickness Map":return"iridescenceThicknessMap";case"Map":return"map";case"Matcap":return"matcap";case"Normal Map":return"normalMap";case"Roughness Map":return"roughnessMap";case"Sheen Color Map":return"sheenColorMap";case"Sheen Roughness Map":return"sheenRoughnessMap";case"Specular Color Map":return"specularColorMap";case"Specular Map Intensity":return"specularIntensityMap";case"Thickness Map":return"thicknessMap";case"Transmission Map":return"transmissionMap"}return e}function Ot(e){switch(e){case"alphaMap":return"Alpha Map";case"anisotropyMap":return"Anisotropy Map";case"anisotropyRotation":return"Anisotropy Rotation";case"aoMap":return"AO Map";case"aoMapIntensity":return"AO Map Intensity";case"attenuationColor":return"Attenuation Color";case"blendAlpha":return"Blend Alpha";case"blendColor":return"Blend Color";case"blendDst":return"Blend Dst";case"blendDstAlpha":return"Blend Dst Alha";case"blendEquation":return"Blend Equation";case"blendEquationAlpha":return"Blend Equation Alpha";case"blending":return"Blending";case"blendSrc":return"Blend Src";case"blendSrcAlpha":return"Blend Src Alpha";case"bumpMap":return"Bump Map";case"bumpScale":return"Bump Scale";case"clearcoatMap":return"Clearcoat Map";case"clearcoatNormalMap":return"Clearcoat Normal Map";case"clearcoatNormalScale":return"Clearcoat Normal Scale";case"clearcoatRoughness":return"Clearcoat Roughness";case"clearcoatRoughnessMap":return"Clearcoat Roughness Map";case"color":return"Color";case"defines":return"Defines";case"depthTest":return"Depth Test";case"depthWrite":return"Depth Write";case"displacementBias":return"Displacement Bias";case"displacementMap":return"Displacement Map";case"displacementScale":return"Displacement Scale";case"dithering":return"Dithering";case"emissive":return"Emissive";case"emissiveMap":return"Emissive Map";case"emissiveIntensity":return"Emissive Intensity";case"envMap":return"Environment Map";case"envMapIntensity":return"Environment Map Intensity";case"extensions":return"Extensions";case"flatShading":return"Flat Shading";case"fragmentShader":return"Fragment Shader";case"fog":return"Fog";case"gradientMap":return"Gradient Map";case"ior":return"IOR";case"iridescenceIOR":return"Iridescence IOR";case"iridescenceMap":return"Iridescence Map";case"iridescenceThicknessMap":return"Iridescence Thickness Map";case"iridescenceThicknessRange":return"Iridescence Thickness Range";case"lights":return"Lights";case"lightMap":return"Light Map";case"lightMapIntensity":return"Light Map Intensity";case"map":return"Map";case"matcap":return"Matcap";case"metalness":return"Metalness";case"metalnessMap":return"Metalness Map";case"name":return"Name";case"normalMap":return"Normal Map";case"normalScale":return"Normal Scale";case"opacity":return"Opacity";case"reflectivity":return"Reflectivity";case"refractionRatio":return"Refraction Ratio";case"roughness":return"Roughness";case"roughnessMap":return"Roughness Map";case"sheenColor":return"Sheen Color";case"sheenColorMap":return"Sheen Color Map";case"sheenRoughness":return"Sheen Roughness";case"sheenRoughnessMap":return"Sheen Roughness Map";case"shininess":return"Shininess";case"side":return"Side";case"size":return"Size";case"sizeAttenuation":return"Size Attenuation";case"specular":return"Specular";case"specularColor":return"Specular Color";case"specularColorMap":return"Specular Color Map";case"specularIntensity":return"Specular Intensity";case"specularIntensityMap":return"Specular Map Intensity";case"thickness":return"Thickness";case"thicknessMap":return"Thickness Map";case"transmission":return"Transmission";case"transmissionMap":return"Transmission Map";case"transparent":return"Transparent";case"type":return"Type";case"uuid":return"UUID";case"uniforms":return"Uniforms";case"vertexShader":return"Vertex Shader";case"visible":return"Visible";case"wireframe":return"Wireframe"}return e}function hn(e){const n=e.toLowerCase();return n.search("intensity")>-1||n==="anisotropyrotation"||n==="blendalpha"||n==="bumpscale"||n==="clearcoatroughness"||n==="displacementbias"||n==="displacementscale"||n==="metalness"||n==="opacity"||n==="reflectivity"||n==="refractionratio"||n==="roughness"||n==="sheenroughness"||n==="thickness"}function $n(){const e=document.createElement("input");return e.type="file",new Promise((n,a)=>{e.addEventListener("change",function(){if(e.files===null)a();else{const t=e.files[0],i=new FileReader;i.onload=function(c){n(c.target.result)},i.readAsDataURL(t)}}),e.click()})}const Wn=[{title:"Front",value:f.FrontSide},{title:"Back",value:f.BackSide},{title:"Double",value:f.DoubleSide}],Yn=[{title:"No Blending",value:f.NoBlending},{title:"Normal",value:f.NormalBlending},{title:"Additive",value:f.AdditiveBlending},{title:"Subtractive",value:f.SubtractiveBlending},{title:"Multiply",value:f.MultiplyBlending},{title:"Custom",value:f.CustomBlending}],qn=[{title:"Add",value:f.AddEquation},{title:"Subtract",value:f.SubtractEquation},{title:"Reverse Subtract",value:f.ReverseSubtractEquation},{title:"Min",value:f.MinEquation},{title:"Max",value:f.MaxEquation}],Kn=[{title:"Zero",valye:f.ZeroFactor},{title:"One",valye:f.OneFactor},{title:"Src Color",valye:f.SrcColorFactor},{title:"One Minus Src Color",valye:f.OneMinusSrcColorFactor},{title:"Src Alpha",valye:f.SrcAlphaFactor},{title:"One Minus Src Alpha",valye:f.OneMinusSrcAlphaFactor},{title:"Dst Alpha",valye:f.DstAlphaFactor},{title:"One Minus Dst Alpha",valye:f.OneMinusDstAlphaFactor},{title:"Dst Color",valye:f.DstColorFactor},{title:"One Minus Dst Color",valye:f.OneMinusDstColorFactor},{title:"Src Alpha Saturate",valye:f.SrcAlphaSaturateFactor},{title:"Constant Color",valye:f.ConstantColorFactor},{title:"One Minus Constant Color",valye:f.OneMinusConstantColorFactor},{title:"Constant Alpha",valye:f.ConstantAlphaFactor},{title:"One Minus Constant Alpha",valye:f.OneMinusConstantAlphaFactor}],Xn=[{title:"Zero",valye:f.ZeroFactor},{title:"One",valye:f.OneFactor},{title:"Src Color",valye:f.SrcColorFactor},{title:"One Minus Src Color",valye:f.OneMinusSrcColorFactor},{title:"Src Alpha",valye:f.SrcAlphaFactor},{title:"One Minus Src Alpha",valye:f.OneMinusSrcAlphaFactor},{title:"Dst Alpha",valye:f.DstAlphaFactor},{title:"One Minus Dst Alpha",valye:f.OneMinusDstAlphaFactor},{title:"Dst Color",valye:f.DstColorFactor},{title:"One Minus Dst Color",valye:f.OneMinusDstColorFactor},{title:"Constant Color",valye:f.ConstantColorFactor},{title:"One Minus Constant Color",valye:f.OneMinusConstantColorFactor},{title:"Constant Alpha",valye:f.ConstantAlphaFactor},{title:"One Minus Constant Alpha",valye:f.OneMinusConstantAlphaFactor}];function ot(e,n){e.needsUpdate=!0,e.type="option",e.options=n}function Zn(e,n,a,t){return{type:"boolean",title:Ot(e),prop:e,value:n,needsUpdate:!0,onChange:(i,c)=>{t.updateObject(a.uuid,`material.${e}`,c),t.updateObject(a.uuid,"material.needsUpdate",!0);const u=t.getScene(a.uuid);if(u!==null){const r=u.getObjectByProperty("uuid",a.uuid);te(r,`material.${e}`,c)}}}}function Jn(e,n,a,t){const i={type:"number",title:Ot(e),prop:e,value:n,min:void 0,max:void 0,step:.01,needsUpdate:!0,onChange:(c,u)=>{t.updateObject(a.uuid,`material.${e}`,u),t.updateObject(a.uuid,"material.needsUpdate",!0);const r=t.getScene(a.uuid);if(r!==null){const h=r.getObjectByProperty("uuid",a.uuid);te(h,`material.${e}`,u)}}};switch(e){case"blending":ot(i,Yn);break;case"blendDst":ot(i,Xn);break;case"blendEquation":ot(i,qn);break;case"blendSrc":ot(i,Kn);break;case"side":ot(i,Wn);break}return hn(e)&&(i.value=Number(n),i.type="range",i.min=Math.min(0,i.value),i.max=Math.max(1,i.value),i.step=.01),i}function Qn(e,n,a,t){const i={type:"string",title:Ot(e),prop:e,value:n,needsUpdate:!0,onChange:(u,r)=>{t.updateObject(a.uuid,`material.${e}`,r),t.updateObject(a.uuid,"material.needsUpdate",!0);const h=t.getScene(a.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",a.uuid);te(d,`material.${e}`,r)}},onKeyDown:u=>{}};return(e==="vertexShader"||e==="fragmentShader")&&(i.disabled=!1,i.latest=i.value,i.onChange=(u,r)=>{i.latest=r,t.updateObject(a.uuid,`material.${e}`,r);const h=t.getScene(a.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",a.uuid);te(d,`material.${e}`,r)}},i.onKeyDown=u=>{if(u.key==="Enter"&&(u.altKey||u.metaKey)){t.updateObject(a.uuid,"material.needsUpdate",!0);const r=t.getScene(a.uuid);if(r!==null){const h=r.getObjectByProperty("uuid",a.uuid);te(h,"material.needsUpdate",!0)}}}),i}function ea(e){return e.x!==void 0&&e.y!==void 0&&e.z===void 0}function ta(e){return e.x!==void 0&&e.y!==void 0&&e.z!==void 0&&e.w===void 0}function na(e){return e.x!==void 0&&e.y!==void 0&&e.z!==void 0&&e.w!==void 0}function Ft(e){e.sort((n,a)=>n.title<a.title?-1:n.title>a.title?1:0)}function ct(e,n,a,t,i="",c=!1){const u=Ot(e).split(".")[0].replaceAll("[","").replaceAll("]",""),r=i.length>0?`${i}.${e}`:e,h=typeof n;if(h==="boolean"||h==="string")return{title:u,prop:r,type:h,value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};if(h==="number"){const d={title:u,prop:r,type:"number",value:n,step:.01,disabled:c,onChange:(m,p)=>{t.updateObject(a.uuid,`material.${r}`,p);const b=t.getScene(a.uuid);if(b!==null){const C=b.getObjectByProperty("uuid",a.uuid);te(C,`material.${r}`,p)}}};return hn(u)&&(d.type="range",d.min=0,d.max=1),d}else{if(n.isColor)return{title:u,prop:r,type:"color",value:n,disabled:c,onChange:(d,m)=>{const p=new f.Color(m);t.updateObject(a.uuid,`material.${r}`,p);const b=t.getScene(a.uuid);if(b!==null){const C=b.getObjectByProperty("uuid",a.uuid);te(C,`material.${r}`,p)}}};if(Array.isArray(n)){const d=[];for(const m in n){const p=n[m],b=`[${m.toString()}]`;if(p.value!==void 0){const C=ct(`${b}.value`,p.value,a,t,r,c);C!==void 0&&d.push(C)}else{const C=ct(b,p,a,t,r,c);C!==void 0&&d.push(C)}}if(d.length>0)return Ft(d),{title:u,items:d}}else{if(ea(n))return{title:u,prop:r,type:"vector2",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};if(ta(n))return{title:u,prop:r,type:"grid3",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};if(na(n))return{title:u,prop:r,type:"grid4",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};if(n.isEuler)return{title:u,prop:r,type:"euler",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};if(n.src!==void 0)return{title:u,type:"image",value:n,disabled:c,onChange:(d,m)=>{const p=Hn(e),b=i.length>0?`${i}.${p}`:p;t.createTexture(a.uuid,`material.${b}`,m);const C=t.getScene(a.uuid);if(C!==null){const D=C.getObjectByProperty("uuid",a.uuid);if(D!==void 0){const q=z=>{const G=D.material,M=b.split(".");switch(M.length){case 1:G[M[0]]=z;break;case 2:G[M[0]][M[1]]=z;break;case 3:G[M[0]][M[1]][M[2]]=z;break;case 4:G[M[0]][M[1]][M[2]][M[3]]=z;break;case 5:G[M[0]][M[1]][M[2]][M[3]][M[4]]=z;break}G.needsUpdate=!0};m.src.length>0?sn(m.src).then(z=>{z.offset.set(m.offset[0],m.offset[1]),z.repeat.set(m.repeat[0],m.repeat[1]),q(z)}):q(null)}}}};if(n.elements!==void 0)return{title:u,prop:r,type:n.elements.length>9?"grid4":"grid3",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};{const d=[],m=e==="defines"||e==="extensions";try{for(const p in n){const b=n[p];if(b!==void 0)if(b.value!==void 0){const C=ct(`${p}.value`,b.value,a,t,r,m);C!==void 0&&d.push(C)}else{const C=ct(p,b,a,t,r,m);C!==void 0&&d.push(C)}}}catch{console.log("Issue cycling through material object:",e,n)}if(d.length>0)return Ft(d),{title:u,items:d}}}}}function Yt(e,n,a){const t=[];for(const i in e){if(!Gn(i))continue;const c=typeof e[i],u=e[i];if(c==="boolean")t.push(Zn(i,u,n,a));else if(c==="number")t.push(Jn(i,u,n,a));else if(c==="string")t.push(Qn(i,u,n,a));else if(c==="object"){const r=ct(i,u,n,a);r!==void 0&&t.push(r)}else u!==void 0&&console.log("other:",i,c,u)}return Ft(t),t.push({title:"Update Material",type:"button",onChange:()=>{a.updateObject(n.uuid,"material.needsUpdate",!0);const i=a.getScene(n.uuid);if(i!==null){const c=i.getObjectByProperty("uuid",n.uuid);te(c,"material.needsUpdate",!0)}}}),t}function aa(e,n){const a=e.material;if(Array.isArray(a)){const t=[],i=a.length;for(let c=0;c<i;c++)t.push(l.jsx(Xe,{title:`Material ${c}`,items:Yt(a[c],e,n)},`Material ${c}`));return l.jsx(l.Fragment,{children:t})}else return l.jsx(Xe,{title:"Material",items:Yt(a,e,n)})}const qt="data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDIgNzkuZGJhM2RhM2I1LCAyMDIzLzEyLzE1LTEwOjQyOjM3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMDk3M0NEODAxQjQxMUVGODVGNENDMkUyMUExNDk1NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDk3M0NEOTAxQjQxMUVGODVGNENDMkUyMUExNDk1NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE4ODc3Qzg5MDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkE4ODc3QzhBMDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAA4BZAAAAv+Mj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqTkJAGDQ+dnpuekmGgAKejpKuiZqmprKqoZKGyrbOlqrejub6xvLGyw8TFzcprurGuvqybxq7ETbrItsCz0l7Zpc+6p9/cS967w9/S2FTF0u/mzehK4Oqz3eTl9vf4+fr7/P3+//DzCgwIEECxo8iDChwoUMGzp8CDGixIkUK1q8iDGjxo0XHDt6/AgypMiRJEuaPIkypcqVLFt+KwAAOw==";function ia(e){const n=e.step!==void 0?e.step:.01,a=E.useRef(null),t=E.useRef(null),i=E.useRef(null),c=E.useRef(null),u=E.useRef(null),[r]=E.useState(e.value),[h,d]=E.useState(e.value.offset[0]),[m,p]=E.useState(e.value.offset[1]),[b,C]=E.useState(e.value.repeat[0]),[D,q]=E.useState(e.value.repeat[1]);function z(M,K,R,Z,ce){if(e.onChange!==void 0){const W=e.prop!==void 0?e.prop:e.title;e.onChange(W,{src:M,offset:[K,R],repeat:[Z,ce]})}}function G(M){const K=a.current.src,R=M.target.value;switch(M.target){case t.current:d(R),z(K,R,m,b,D);break;case i.current:p(R),z(K,h,R,b,D);break;case c.current:C(R),z(K,h,m,R,D);break;case u.current:q(R),z(K,h,m,b,R);break}}return l.jsxs("div",{className:"imageField",children:[l.jsx("img",{alt:e.title,ref:a,onClick:()=>{$n().then(M=>{a.current.src=M,z(M,h,m,b,D)})},src:r.src.length>0?r.src:qt}),l.jsxs("div",{className:"fields",children:[l.jsxs("div",{children:[l.jsx("label",{children:"Offset:"}),l.jsx("input",{ref:t,type:"number",value:h,step:n,onChange:G}),l.jsx("input",{ref:i,type:"number",value:m,step:n,onChange:G})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Repeat:"}),l.jsx("input",{ref:c,type:"number",value:b,step:n,onChange:G}),l.jsx("input",{ref:u,type:"number",value:D,step:n,onChange:G})]}),l.jsx("button",{onClick:()=>{z("",h,m,b,D),a.current.src=qt},children:"Clear"})]})]})}function Et(e){let n=e.value;n!==void 0&&n.isColor!==void 0&&(n=an(e.value));const[a,t]=E.useState(n),i=E.useRef(null),c=d=>{let m=d.target.value;e.type==="boolean"?m=d.target.checked:e.type==="option"&&(m=e.options[m].value),t(m),e.onChange!==void 0&&e.onChange(e.prop!==void 0?e.prop:e.title,m)},u={};e.disabled&&(u.opacity=.8);const r=e.type==="string"&&(a.length>100||a.search(`
|
30
|
-
`)>-1),h=r||e.type==="image"||e.type==="vector2";return l.jsxs("div",{className:`field ${h?"block":""}`,style:u,children:[e.type!=="button"&&l.jsx("label",{ref:i,children:lt(e.title)},"fieldLabel"),e.type==="string"&&!r&&l.jsx("input",{type:"text",disabled:e.disabled,onChange:c,value:a}),e.type==="string"&&r&&l.jsx("textarea",{cols:50,rows:10,disabled:e.disabled!==void 0?e.disabled:!0,onChange:c,onKeyDown:d=>{e.onKeyDown!==void 0&&e.onKeyDown(d)},value:a}),e.type==="boolean"&&l.jsx("input",{type:"checkbox",disabled:e.disabled,onChange:c,checked:a}),e.type==="number"&&l.jsx(Ke,{value:a,type:e.type,prop:e.prop!==void 0?e.prop:e.title,min:e.min,max:e.max,step:e.step,disabled:e.disabled,labelRef:i,onChange:e.onChange}),e.type==="range"&&l.jsx(Ke,{value:a,type:e.type,prop:e.prop!==void 0?e.prop:e.title,min:e.min,max:e.max,step:e.step,disabled:e.disabled,labelRef:i,onChange:e.onChange}),e.type==="color"&&l.jsxs(l.Fragment,{children:[l.jsx("input",{type:"text",value:a.toString(),onChange:c,disabled:e.disabled,className:"color"}),l.jsx("input",{type:"color",value:a,onChange:c,disabled:e.disabled})]}),e.type==="button"&&l.jsx("button",{disabled:e.disabled,onClick:()=>{e.onChange!==void 0&&e.onChange(e.prop!==void 0?e.prop:e.title,!0)},children:e.title}),e.type==="image"&&l.jsx(ia,{title:e.title,prop:e.prop,value:e.value,onChange:e.onChange}),e.type==="option"&&l.jsx(l.Fragment,{children:l.jsx("select",{onChange:c,disabled:e.disabled,defaultValue:e.value,children:e.options?.map((d,m)=>l.jsx("option",{value:d.value,children:lt(d.title)},m))})}),e.type==="vector2"&&l.jsx(Bn,{step:e.step,value:a,min:0,max:1,onChange:c}),e.type==="grid3"&&l.jsx(Wt,{step:e.step,value:a,onChange:c}),e.type==="grid4"&&l.jsx(Vn,{step:e.step,value:a,onChange:c}),e.type==="euler"&&l.jsx(Wt,{step:e.step,value:a,onChange:c})]})}function Kt(e){switch(e){case"fov":return"FOV";case"zoom":return"Zoom";case"near":return"Near";case"far":return"Far";case"focus":return"Focus";case"aspect":return"Aspect";case"filmGauge":return"Film Gauge";case"filmOffset":return"Film Offset";case"left":return"Left";case"right":return"Right";case"top":return"Top";case"bottom":return"Bottom"}return e}function ra(e,n){const a=[];if(e.perspectiveCameraInfo!==void 0)for(const t in e.perspectiveCameraInfo)a.push({title:Kt(t),prop:t,type:"number",step:.01,value:e.perspectiveCameraInfo[t],onChange:(i,c)=>{n.updateObject(e.uuid,i,c),n.requestMethod(e.uuid,"updateProjectionMatrix");const u=n.getScene(e.uuid);if(u!==null){const r=u.getObjectByProperty("uuid",e.uuid);r!==void 0&&(te(r,i,c),r.updateProjectionMatrix())}}});else if(e.orthographicCameraInfo!==void 0)for(const t in e.orthographicCameraInfo)a.push({title:Kt(t),prop:t,type:"number",step:.01,value:e.perspectiveCameraInfo[t],onChange:(i,c)=>{n.updateObject(e.uuid,i,c),n.requestMethod(e.uuid,"updateProjectionMatrix");const u=n.getScene(e.uuid);if(u!==null){const r=u.getObjectByProperty("uuid",e.uuid);r!==void 0&&(te(r,i,c),r.updateProjectionMatrix())}}});return l.jsx(Xe,{title:"Camera",items:a})}function sa(e,n){const a=new f.Matrix4;a.elements=e.matrix;const t=new f.Vector3,i=new f.Euler,c=new f.Vector3;e.uuid.length>0&&(t.setFromMatrixPosition(a),i.setFromRotationMatrix(a),c.setFromMatrixScale(a));const u=(r,h)=>{const d=r==="rotation"?{x:h._x,y:h._y,z:h._z}:h;n.updateObject(e.uuid,r,d);const m=n.getScene(e.uuid);if(m!==null){const p=m.getObjectByProperty("uuid",e.uuid);te(p,r,d)}};return l.jsx(Xe,{title:"Transform",items:[{title:"Position",prop:"position",type:"grid3",step:.1,value:t,onChange:u},{title:"Rotation",prop:"rotation",type:"grid3",value:i,onChange:u},{title:"Scale",prop:"scale",type:"grid3",value:c,onChange:u}]})}function Xt(e){switch(e){case"color":return"Color";case"intensity":return"Intensity";case"decay":return"Decay";case"distance":return"Distance";case"angle":return"Angle";case"penumbra":return"Penumbra";case"groundColor":return"Ground Color";case"width":return"Width";case"height":return"Height"}return e}function oa(e,n){const a=[];if(e.lightInfo!==void 0)for(const t in e.lightInfo){const i=e.lightInfo[t];i!==void 0&&(i.isColor!==void 0?a.push({title:Xt(t),prop:t,type:"color",value:i,onChange:(c,u)=>{const r=new f.Color(u);n.updateObject(e.uuid,c,r);const h=n.getScene(e.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",e.uuid);te(d,c,r)}}}):a.push({title:Xt(t),prop:t,type:typeof i,value:i,step:typeof i=="number"?.01:void 0,onChange:(c,u)=>{n.updateObject(e.uuid,c,u);const r=n.getScene(e.uuid);if(r!==null){const h=r.getObjectByProperty("uuid",e.uuid);te(h,c,u)}}}))}return l.jsx(Xe,{title:"Light",items:a})}function ca(e,n){const a=[],t=[];let i=0;e.animations.forEach(u=>{i=Math.max(i,u.duration),u.duration>0&&t.push({title:u.name,items:[{title:"Duration",type:"number",value:u.duration,disabled:!0},{title:"Blend Mode",type:"option",disabled:!0,options:[{title:"Normal",value:2500},{title:"Additive",value:2501}]}]})}),a.push({title:"Animations",items:t});const c=n.getScene(e.uuid);if(c!==null){const u=c.getObjectByProperty("uuid",e.uuid);let r=!1;if(u!==void 0){const h=u.mixer;if(r=h!==void 0,r){const d=[{title:"Time Scale",type:"range",value:h.timeScale,step:.01,min:-1,max:2,onChange:(m,p)=>{h.timeScale=p,n.updateObject(e.uuid,"mixer.timeScale",p)}}];d.push({title:"Stop All",type:"button",onChange:()=>{h.stopAllAction(),n.requestMethod(e.uuid,"stopAllAction",void 0,"mixer")}}),a.push({title:"Mixer",items:d})}}}return l.jsx(Xe,{title:"Animation",items:a})}const fn={name:"",uuid:"",type:"",visible:!1,matrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],animations:[],material:void 0,perspectiveCameraInfo:void 0,orthographicCameraInfo:void 0,lightInfo:void 0,children:[]};let fe={...fn};function mn(e){const[n,a]=E.useState(-1);E.useEffect(()=>{function u(h){fe={...h.value},a(Date.now())}function r(){fe={...fn},a(Date.now())}return j.addEventListener(I.SET_SCENE,r),j.addEventListener(I.SET_OBJECT,u),()=>{j.removeEventListener(I.SET_SCENE,r),j.removeEventListener(I.SET_OBJECT,u)}},[]);const t=fe.type.toLowerCase(),i=fe.animations.length>0||fe.mixer!==void 0,c=t.search("mesh")>-1||t.search("line")>-1||t.search("points")>-1;return l.jsx(Mt,{label:"Inspector",children:l.jsx("div",{id:"Inspector",className:e.class,children:fe.uuid.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs(l.Fragment,{children:[l.jsx(Et,{type:"string",title:"Name",prop:"name",value:fe.name,disabled:!0}),l.jsx(Et,{type:"string",title:"Type",prop:"type",value:fe.type,disabled:!0}),l.jsx(Et,{type:"string",title:"UUID",prop:"uuid",value:fe.uuid,disabled:!0})]}),l.jsxs(l.Fragment,{children:[sa(fe,e.three),i?ca(fe,e.three):null,t.search("camera")>-1?ra(fe,e.three):null,t.search("light")>-1?oa(fe,e.three):null,c?aa(fe,e.three):null]})]})},n)},"Inspector")}function la(e){const[n]=E.useState([]),[a,t]=E.useState(0),i=r=>{n.push(r.value),t(Date.now())},c=r=>{const h=r.value;for(let d=0;d<n.length;d++)if(h.uuid===n[d].uuid){n.splice(d,1),t(Date.now());return}};E.useEffect(()=>(j.addEventListener(I.ADD_SCENE,i),j.addEventListener(I.REMOVE_SCENE,c),()=>{j.removeEventListener(I.ADD_SCENE,i),j.removeEventListener(I.REMOVE_SCENE,c)}),[]);const u=[];return n.forEach((r,h)=>{u.push(l.jsx(Mt,{label:`Scene: ${r.name}`,open:!0,children:l.jsx(dn,{child:r,scene:r,three:e.three})},`scene_${h}`))}),l.jsxs("div",{id:"SidePanel",children:[u,l.jsx(mn,{three:e.three})]},`SidePanel ${a}`)}function ua(e){return E.useEffect(()=>{function n(r){let h=null;return e.three.scenes.forEach(d=>{r.search(d.uuid)>-1&&(h=d)}),h}const a=r=>{const h=r.value,d=n(h),m=d?.getObjectByProperty("uuid",h);m!==void 0?e.three.setObject(m):console.log(`Hermes - can't find object: ${h}`,d)},t=(r,h,d)=>{const m=n(r),p=m?.getObjectByProperty("uuid",r);p!==void 0?te(p,h,d):console.log(`Hermes - can't set object: ${r}`,m)},i=r=>{const h=r.value,{key:d,value:m,uuid:p}=h;t(p,d,m)},c=r=>{const h=r.value,m=n(h.uuid)?.getObjectByProperty("uuid",h.uuid);if(m!==void 0){const p=b=>{const C=h.key.split(".");switch(C.length){case 1:m[C[0]]=b;break;case 2:m[C[0]][C[1]]=b;break;case 3:m[C[0]][C[1]][C[2]]=b;break;case 4:m[C[0]][C[1]][C[2]][C[3]]=b;break;case 5:m[C[0]][C[1]][C[2]][C[3]][C[4]]=b;break}m.material.needsUpdate=!0};h.value.src.length>0?sn(h.value.src).then(b=>{b.offset.set(h.value.offset[0],h.value.offset[1]),b.repeat.set(h.value.repeat[0],h.value.repeat[1]),p(b)}):p(null)}},u=r=>{const{key:h,uuid:d,value:m,subitem:p}=r.value,C=n(d)?.getObjectByProperty("uuid",d);if(C!==void 0)try{p!==void 0?kn(C,p)[h](m):C[h](m)}catch(D){console.log("Error requesting method:"),console.log(D),console.log(h),console.log(m)}};return j.addEventListener(I.GET_OBJECT,a),j.addEventListener(I.UPDATE_OBJECT,i),j.addEventListener(I.CREATE_TEXTURE,c),j.addEventListener(I.REQUEST_METHOD,u),()=>{j.removeEventListener(I.GET_OBJECT,a),j.removeEventListener(I.UPDATE_OBJECT,i),j.removeEventListener(I.CREATE_TEXTURE,c),j.removeEventListener(I.REQUEST_METHOD,u)}},[]),null}class da extends f.Line{constructor(n,a){const t=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],i=new f.BufferGeometry;i.setAttribute("position",new f.Float32BufferAttribute(t,3)),i.computeBoundingSphere();const c=new f.LineBasicMaterial({fog:!1});super(i,c),this.light=n,this.color=a,this.type="RectAreaLightHelper";const u=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],r=new f.BufferGeometry;r.setAttribute("position",new f.Float32BufferAttribute(u,3)),r.computeBoundingSphere(),this.add(new f.Mesh(r,new f.MeshBasicMaterial({side:f.BackSide,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const n=this.material.color,a=Math.max(n.r,n.g,n.b);a>1&&n.multiplyScalar(1/a),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const Zt={type:"change"},Dt={type:"start"},Jt={type:"end"},vt=new f.Ray,Qt=new f.Plane,ha=Math.cos(70*f.MathUtils.DEG2RAD);class fa extends f.EventDispatcher{constructor(n,a){super(),this.object=n,this.domElement=a,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new f.Vector3,this.cursor=new f.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:f.MOUSE.ROTATE,MIDDLE:f.MOUSE.DOLLY,RIGHT:f.MOUSE.PAN},this.touches={ONE:f.TOUCH.ROTATE,TWO:f.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 r.phi},this.getAzimuthalAngle=function(){return r.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(o){o.addEventListener("keydown",at),this._domElementKeyEvents=o},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",at),this._domElementKeyEvents=null},this.saveState=function(){t.target0.copy(t.target),t.position0.copy(t.object.position),t.zoom0=t.object.zoom},this.reset=function(){t.target.copy(t.target0),t.object.position.copy(t.position0),t.object.zoom=t.zoom0,t.object.updateProjectionMatrix(),t.dispatchEvent(Zt),t.update(),c=i.NONE},this.update=function(){const o=new f.Vector3,x=new f.Quaternion().setFromUnitVectors(n.up,new f.Vector3(0,1,0)),P=x.clone().invert(),U=new f.Vector3,re=new f.Quaternion,be=new f.Vector3,ue=2*Math.PI;return function(mt=null){const pt=t.object.position;o.copy(pt).sub(t.target),o.applyQuaternion(x),r.setFromVector3(o),t.autoRotate&&c===i.NONE&&ge(Me(mt)),t.enableDamping?(r.theta+=h.theta*t.dampingFactor,r.phi+=h.phi*t.dampingFactor):(r.theta+=h.theta,r.phi+=h.phi);let ye=t.minAzimuthAngle,Ee=t.maxAzimuthAngle;isFinite(ye)&&isFinite(Ee)&&(ye<-Math.PI?ye+=ue:ye>Math.PI&&(ye-=ue),Ee<-Math.PI?Ee+=ue:Ee>Math.PI&&(Ee-=ue),ye<=Ee?r.theta=Math.max(ye,Math.min(Ee,r.theta)):r.theta=r.theta>(ye+Ee)/2?Math.max(ye,r.theta):Math.min(Ee,r.theta)),r.phi=Math.max(t.minPolarAngle,Math.min(t.maxPolarAngle,r.phi)),r.makeSafe(),t.enableDamping===!0?t.target.addScaledVector(m,t.dampingFactor):t.target.add(m),t.target.sub(t.cursor),t.target.clampLength(t.minTargetRadius,t.maxTargetRadius),t.target.add(t.cursor);let Ye=!1;if(t.zoomToCursor&&ce||t.object.isOrthographicCamera)r.radius=_e(r.radius);else{const Ce=r.radius;r.radius=_e(r.radius*d),Ye=Ce!=r.radius}if(o.setFromSpherical(r),o.applyQuaternion(P),pt.copy(t.target).add(o),t.object.lookAt(t.target),t.enableDamping===!0?(h.theta*=1-t.dampingFactor,h.phi*=1-t.dampingFactor,m.multiplyScalar(1-t.dampingFactor)):(h.set(0,0,0),m.set(0,0,0)),t.zoomToCursor&&ce){let Ce=null;if(t.object.isPerspectiveCamera){const Ve=o.length();Ce=_e(Ve*d);const Je=Ve-Ce;t.object.position.addScaledVector(R,Je),t.object.updateMatrixWorld(),Ye=!!Je}else if(t.object.isOrthographicCamera){const Ve=new f.Vector3(Z.x,Z.y,0);Ve.unproject(t.object);const Je=t.object.zoom;t.object.zoom=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/d)),t.object.updateProjectionMatrix(),Ye=Je!==t.object.zoom;const gt=new f.Vector3(Z.x,Z.y,0);gt.unproject(t.object),t.object.position.sub(gt).add(Ve),t.object.updateMatrixWorld(),Ce=o.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),t.zoomToCursor=!1;Ce!==null&&(this.screenSpacePanning?t.target.set(0,0,-1).transformDirection(t.object.matrix).multiplyScalar(Ce).add(t.object.position):(vt.origin.copy(t.object.position),vt.direction.set(0,0,-1).transformDirection(t.object.matrix),Math.abs(t.object.up.dot(vt.direction))<ha?n.lookAt(t.target):(Qt.setFromNormalAndCoplanarPoint(t.object.up,t.target),vt.intersectPlane(Qt,t.target))))}else if(t.object.isOrthographicCamera){const Ce=t.object.zoom;t.object.zoom=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/d)),Ce!==t.object.zoom&&(t.object.updateProjectionMatrix(),Ye=!0)}return d=1,ce=!1,Ye||U.distanceToSquared(t.object.position)>u||8*(1-re.dot(t.object.quaternion))>u||be.distanceToSquared(t.target)>u?(t.dispatchEvent(Zt),U.copy(t.object.position),re.copy(t.object.quaternion),be.copy(t.target),!0):!1}}(),this.dispose=function(){t.domElement.removeEventListener("contextmenu",Ze),t.domElement.removeEventListener("pointerdown",w),t.domElement.removeEventListener("pointercancel",J),t.domElement.removeEventListener("wheel",Q),t.domElement.removeEventListener("pointermove",H),t.domElement.removeEventListener("pointerup",J),t.domElement.getRootNode().removeEventListener("keydown",Fe,{capture:!0}),t._domElementKeyEvents!==null&&(t._domElementKeyEvents.removeEventListener("keydown",at),t._domElementKeyEvents=null)};const t=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=i.NONE;const u=1e-6,r=new f.Spherical,h=new f.Spherical;let d=1;const m=new f.Vector3,p=new f.Vector2,b=new f.Vector2,C=new f.Vector2,D=new f.Vector2,q=new f.Vector2,z=new f.Vector2,G=new f.Vector2,M=new f.Vector2,K=new f.Vector2,R=new f.Vector3,Z=new f.Vector2;let ce=!1;const W=[],me={};let ie=!1;function Me(o){return o!==null?2*Math.PI/60*t.autoRotateSpeed*o:2*Math.PI/60/60*t.autoRotateSpeed}function Oe(o){const x=Math.abs(o*.01);return Math.pow(.95,t.zoomSpeed*x)}function ge(o){h.theta-=o}function B(o){h.phi-=o}const ve=function(){const o=new f.Vector3;return function(P,U){o.setFromMatrixColumn(U,0),o.multiplyScalar(-P),m.add(o)}}(),k=function(){const o=new f.Vector3;return function(P,U){t.screenSpacePanning===!0?o.setFromMatrixColumn(U,1):(o.setFromMatrixColumn(U,0),o.crossVectors(t.object.up,o)),o.multiplyScalar(P),m.add(o)}}(),xe=function(){const o=new f.Vector3;return function(P,U){const re=t.domElement;if(t.object.isPerspectiveCamera){const be=t.object.position;o.copy(be).sub(t.target);let ue=o.length();ue*=Math.tan(t.object.fov/2*Math.PI/180),ve(2*P*ue/re.clientHeight,t.object.matrix),k(2*U*ue/re.clientHeight,t.object.matrix)}else t.object.isOrthographicCamera?(ve(P*(t.object.right-t.object.left)/t.object.zoom/re.clientWidth,t.object.matrix),k(U*(t.object.top-t.object.bottom)/t.object.zoom/re.clientHeight,t.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),t.enablePan=!1)}}();function Re(o){t.object.isPerspectiveCamera||t.object.isOrthographicCamera?d/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1)}function De(o){t.object.isPerspectiveCamera||t.object.isOrthographicCamera?d*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1)}function Te(o,x){if(!t.zoomToCursor)return;ce=!0;const P=t.domElement.getBoundingClientRect(),U=o-P.left,re=x-P.top,be=P.width,ue=P.height;Z.x=U/be*2-1,Z.y=-(re/ue)*2+1,R.set(Z.x,Z.y,1).unproject(t.object).sub(t.object.position).normalize()}function _e(o){return Math.max(t.minDistance,Math.min(t.maxDistance,o))}function ke(o){p.set(o.clientX,o.clientY)}function $e(o){Te(o.clientX,o.clientX),G.set(o.clientX,o.clientY)}function Ae(o){D.set(o.clientX,o.clientY)}function We(o){b.set(o.clientX,o.clientY),C.subVectors(b,p).multiplyScalar(t.rotateSpeed);const x=t.domElement;ge(2*Math.PI*C.x/x.clientHeight),B(2*Math.PI*C.y/x.clientHeight),p.copy(b),t.update()}function nt(o){M.set(o.clientX,o.clientY),K.subVectors(M,G),K.y>0?Re(Oe(K.y)):K.y<0&&De(Oe(K.y)),G.copy(M),t.update()}function Pe(o){q.set(o.clientX,o.clientY),z.subVectors(q,D).multiplyScalar(t.panSpeed),xe(z.x,z.y),D.copy(q),t.update()}function ne(o){Te(o.clientX,o.clientY),o.deltaY<0?De(Oe(o.deltaY)):o.deltaY>0&&Re(Oe(o.deltaY)),t.update()}function he(o){let x=!1;switch(o.code){case t.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?B(2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):xe(0,t.keyPanSpeed),x=!0;break;case t.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?B(-2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):xe(0,-t.keyPanSpeed),x=!0;break;case t.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?ge(2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):xe(t.keyPanSpeed,0),x=!0;break;case t.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?ge(-2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):xe(-t.keyPanSpeed,0),x=!0;break}x&&(o.preventDefault(),t.update())}function Ne(o){if(W.length===1)p.set(o.pageX,o.pageY);else{const x=Be(o),P=.5*(o.pageX+x.x),U=.5*(o.pageY+x.y);p.set(P,U)}}function je(o){if(W.length===1)D.set(o.pageX,o.pageY);else{const x=Be(o),P=.5*(o.pageX+x.x),U=.5*(o.pageY+x.y);D.set(P,U)}}function pe(o){const x=Be(o),P=o.pageX-x.x,U=o.pageY-x.y,re=Math.sqrt(P*P+U*U);G.set(0,re)}function v(o){t.enableZoom&&pe(o),t.enablePan&&je(o)}function y(o){t.enableZoom&&pe(o),t.enableRotate&&Ne(o)}function T(o){if(W.length==1)b.set(o.pageX,o.pageY);else{const P=Be(o),U=.5*(o.pageX+P.x),re=.5*(o.pageY+P.y);b.set(U,re)}C.subVectors(b,p).multiplyScalar(t.rotateSpeed);const x=t.domElement;ge(2*Math.PI*C.x/x.clientHeight),B(2*Math.PI*C.y/x.clientHeight),p.copy(b)}function N(o){if(W.length===1)q.set(o.pageX,o.pageY);else{const x=Be(o),P=.5*(o.pageX+x.x),U=.5*(o.pageY+x.y);q.set(P,U)}z.subVectors(q,D).multiplyScalar(t.panSpeed),xe(z.x,z.y),D.copy(q)}function se(o){const x=Be(o),P=o.pageX-x.x,U=o.pageY-x.y,re=Math.sqrt(P*P+U*U);M.set(0,re),K.set(0,Math.pow(M.y/G.y,t.zoomSpeed)),Re(K.y),G.copy(M);const be=(o.pageX+x.x)*.5,ue=(o.pageY+x.y)*.5;Te(be,ue)}function le(o){t.enableZoom&&se(o),t.enablePan&&N(o)}function _(o){t.enableZoom&&se(o),t.enableRotate&&T(o)}function w(o){t.enabled!==!1&&(W.length===0&&(t.domElement.setPointerCapture(o.pointerId),t.domElement.addEventListener("pointermove",H),t.domElement.addEventListener("pointerup",J)),!_t(o)&&(Rt(o),o.pointerType==="touch"?it(o):A(o)))}function H(o){t.enabled!==!1&&(o.pointerType==="touch"?ht(o):Y(o))}function J(o){switch(Tt(o),W.length){case 0:t.domElement.releasePointerCapture(o.pointerId),t.domElement.removeEventListener("pointermove",H),t.domElement.removeEventListener("pointerup",J),t.dispatchEvent(Jt),c=i.NONE;break;case 1:const x=W[0],P=me[x];it({pointerId:x,pageX:P.x,pageY:P.y});break}}function A(o){let x;switch(o.button){case 0:x=t.mouseButtons.LEFT;break;case 1:x=t.mouseButtons.MIDDLE;break;case 2:x=t.mouseButtons.RIGHT;break;default:x=-1}switch(x){case f.MOUSE.DOLLY:if(t.enableZoom===!1)return;$e(o),c=i.DOLLY;break;case f.MOUSE.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(t.enablePan===!1)return;Ae(o),c=i.PAN}else{if(t.enableRotate===!1)return;ke(o),c=i.ROTATE}break;case f.MOUSE.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(t.enableRotate===!1)return;ke(o),c=i.ROTATE}else{if(t.enablePan===!1)return;Ae(o),c=i.PAN}break;default:c=i.NONE}c!==i.NONE&&t.dispatchEvent(Dt)}function Y(o){switch(c){case i.ROTATE:if(t.enableRotate===!1)return;We(o);break;case i.DOLLY:if(t.enableZoom===!1)return;nt(o);break;case i.PAN:if(t.enablePan===!1)return;Pe(o);break}}function Q(o){t.enabled===!1||t.enableZoom===!1||c!==i.NONE||(o.preventDefault(),t.dispatchEvent(Dt),ne(Le(o)),t.dispatchEvent(Jt))}function Le(o){const x=o.deltaMode,P={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(x){case 1:P.deltaY*=16;break;case 2:P.deltaY*=100;break}return o.ctrlKey&&!ie&&(P.deltaY*=10),P}function Fe(o){o.key==="Control"&&(ie=!0,t.domElement.getRootNode().addEventListener("keyup",Ue,{passive:!0,capture:!0}))}function Ue(o){o.key==="Control"&&(ie=!1,t.domElement.getRootNode().removeEventListener("keyup",Ue,{passive:!0,capture:!0}))}function at(o){t.enabled===!1||t.enablePan===!1||he(o)}function it(o){switch(ft(o),W.length){case 1:switch(t.touches.ONE){case f.TOUCH.ROTATE:if(t.enableRotate===!1)return;Ne(o),c=i.TOUCH_ROTATE;break;case f.TOUCH.PAN:if(t.enablePan===!1)return;je(o),c=i.TOUCH_PAN;break;default:c=i.NONE}break;case 2:switch(t.touches.TWO){case f.TOUCH.DOLLY_PAN:if(t.enableZoom===!1&&t.enablePan===!1)return;v(o),c=i.TOUCH_DOLLY_PAN;break;case f.TOUCH.DOLLY_ROTATE:if(t.enableZoom===!1&&t.enableRotate===!1)return;y(o),c=i.TOUCH_DOLLY_ROTATE;break;default:c=i.NONE}break;default:c=i.NONE}c!==i.NONE&&t.dispatchEvent(Dt)}function ht(o){switch(ft(o),c){case i.TOUCH_ROTATE:if(t.enableRotate===!1)return;T(o),t.update();break;case i.TOUCH_PAN:if(t.enablePan===!1)return;N(o),t.update();break;case i.TOUCH_DOLLY_PAN:if(t.enableZoom===!1&&t.enablePan===!1)return;le(o),t.update();break;case i.TOUCH_DOLLY_ROTATE:if(t.enableZoom===!1&&t.enableRotate===!1)return;_(o),t.update();break;default:c=i.NONE}}function Ze(o){t.enabled!==!1&&o.preventDefault()}function Rt(o){W.push(o.pointerId)}function Tt(o){delete me[o.pointerId];for(let x=0;x<W.length;x++)if(W[x]==o.pointerId){W.splice(x,1);return}}function _t(o){for(let x=0;x<W.length;x++)if(W[x]==o.pointerId)return!0;return!1}function ft(o){let x=me[o.pointerId];x===void 0&&(x=new f.Vector2,me[o.pointerId]=x),x.set(o.pageX,o.pageY)}function Be(o){const x=o.pointerId===W[0]?W[1]:W[0];return me[x]}t.domElement.addEventListener("contextmenu",Ze),t.domElement.addEventListener("pointerdown",w),t.domElement.addEventListener("pointercancel",J),t.domElement.addEventListener("wheel",Q,{passive:!1}),t.domElement.getRootNode().addEventListener("keydown",Fe,{passive:!0,capture:!0}),this.update()}}function tt(e,n,a,t,i){return t+(e-n)*(i-t)/(a-n)}const St=e=>{const[n,a]=E.useState(e.options[e.index]),t=()=>{e.onToggle(!e.open)},i=c=>{c!==n&&(e.onSelect(c),a(c)),e.onToggle(!1)};return l.jsxs("div",{className:`dropdown ${e.up===!0?"up":""}`,children:[l.jsx("div",{className:"dropdown-toggle",onClick:t,children:n}),e.open&&l.jsx("ul",{className:"dropdown-menu",children:e.options.map(c=>l.jsx("li",{onClick:()=>i(c),children:c},c))})]})},qe=E.forwardRef(function(n,a){const[t,i]=E.useState(!1),c=n.options.indexOf(n.camera.name);return l.jsxs("div",{className:"CameraWindow",children:[l.jsx("div",{ref:a,className:"clickable",onClick:()=>{t&&i(!1)}}),l.jsx(St,{index:c,open:t,options:n.options,onSelect:n.onSelect,onToggle:u=>{i(u)},up:!0})]})});class ma extends f.ShaderMaterial{constructor(n){super({extensions:{derivatives:!0},glslVersion:f.GLSL3,side:f.DoubleSide,transparent:!0,uniforms:{uScale:{value:n?.scale!==void 0?n?.scale:.1},uDivisions:{value:n?.divisions!==void 0?n?.divisions:10},uColor:{value:n?.color!==void 0?n?.color:new f.Color(16777215)},uDistance:{value:n?.distance!==void 0?n?.distance:1e4},uSubgridOpacity:{value:n?.subgridOpacity!==void 0?n?.subgridOpacity:.15},uGridOpacity:{value:n?.gridOpacity!==void 0?n?.gridOpacity:.25}},vertexShader:`out vec3 worldPosition;
|
29
|
+
C11,8.22,10.74,8,10.43,8z`})});function un(e){return u.jsx(an.Reorder.Item,{value:e.title,children:u.jsxs("div",{children:[Bn,u.jsx("span",{children:e.title}),u.jsx("button",{className:"closeIcon",onClick:()=>{e.onDelete(e.index)},children:Un})]})},e.title)}function dn(e){const[n,a]=b.useState(!1),[t,i]=b.useState(e.options),o=d=>{e.onDragComplete(d),i(d)},l=d=>{const m=[...t];m.splice(d,1),o(m)},r=[];t.forEach((d,m)=>{r.push(u.jsx(un,{index:m,title:d,onDelete:l},d))});let h="dropdown draggable";return e.subdropdown&&(h+=" subdropdown"),u.jsxs("div",{className:h,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[u.jsx(Bt,{title:e.title}),u.jsx(an.Reorder.Group,{axis:"y",values:t,onReorder:o,style:{visibility:n?"visible":"hidden"},children:r})]})}function hn(e){const[n,a]=b.useState(!1),t=[];e.options.map((o,l)=>{e.onSelect!==void 0&&(o.onSelect=e.onSelect),t.push(u.jsx(fn,{option:o},l))});let i="dropdown";return e.subdropdown&&(i+=" subdropdown"),u.jsxs("div",{className:i,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[u.jsx(Bt,{title:e.title}),u.jsx("ul",{style:{visibility:n?"visible":"hidden"},children:t})]})}function fn(e){const{option:n}=e,[a,t]=b.useState("");let i;switch(n.type){case"draggable":i=u.jsx(dn,{title:n.title,options:n.value,onDragComplete:o=>{n.onDragComplete!==void 0&&n.onDragComplete(o)},subdropdown:!0});break;case"dropdown":i=u.jsx(hn,{title:n.title,options:n.value,onSelect:n.onSelect,subdropdown:!0});break;case"option":i=u.jsx("button",{onClick:()=>{n.onSelect!==void 0&&n.onSelect(n.value),n.selectable&&(a!==n.title?t(n.title):t(""))},children:n.title});break}return u.jsx("li",{className:a===n.title?"selected":"",children:i},rn())}function Vn(e,n,a){function t(o){switch(n.forEach(l=>{l.callback(e,l.remote,o)}),o.event){case"custom":I.dispatchEvent({type:j.CUSTOM,value:o.data});break}}function i(o){switch(a.forEach(l=>{l.callback(e,l.remote,o)}),o.event){case"custom":I.dispatchEvent({type:j.CUSTOM,value:o.data});break}}e.listen=o=>{o.target==="editor"?i(o):t(o)}}function Ot(e){const[n,a]=b.useState(e.open!==void 0?e.open:!0),t=!n||e.children===void 0;return u.jsxs("div",{className:`accordion ${t?"hide":""}`,children:[u.jsxs("button",{className:"toggle",onClick:()=>{const i=!n;e.onToggle!==void 0&&e.onToggle(i),a(i)},children:[u.jsx("p",{className:`status ${n?"open":""}`,children:"Toggle"}),u.jsx("p",{className:"label",children:lt(e.label)})]}),e.button,u.jsx("div",{className:n?"open":"",children:u.jsx("div",{children:e.children})})]})}function Vt(e){const n=b.useRef(null),[a,t]=b.useState(!1),i=e.child!==void 0&&e.child.children.length>0,o=[];return e.child!==void 0&&e.child.children.length>0&&e.child.children.map((l,r)=>{o.push(u.jsx(Vt,{child:l,three:e.three},r))}),b.useEffect(()=>{const l=e.child.uuid,r=e.three.getScene(l);if(r!==null){const h=r.getObjectByProperty("uuid",l);h!==void 0&&(n.current.style.opacity=h.visible?"1":"0.25")}},[]),u.jsx(u.Fragment,{children:e.child!==void 0&&u.jsxs("div",{className:"childObject",children:[u.jsxs("div",{className:"child",children:[i?u.jsx("button",{className:"status",style:{backgroundPositionX:a?"-14px":"2px"},onClick:()=>{t(!a)}}):null,u.jsx("button",{className:"name",style:{left:i?"20px":"5px"},onClick:()=>{e.child!==void 0&&(e.three.getObject(e.child.uuid),a||t(!0))},children:e.child.name.length>0?`${e.child.name} (${e.child.type})`:`${e.child.type}::${e.child.uuid}`}),u.jsx("button",{className:"visibility",ref:n,onClick:()=>{if(e.child){const l=e.three.getScene(e.child.uuid);if(l!==null){const r=l.getObjectByProperty("uuid",e.child.uuid);if(r!==void 0){const h="visible",d=!r.visible;n.current.style.opacity=d?"1":"0.25",e.three.updateObject(e.child.uuid,h,d),Q(r,h,d)}else console.log(`Hermes - Couldn't find object: ${e.child.uuid}`,l)}else console.log(`Hermes - Couldn't find object in scene: ${e.child.uuid}, ${e.child.name}`)}}}),u.jsx("div",{className:`icon ${kn(e.child)}`})]}),u.jsx("div",{className:a?"open":"",children:u.jsx("div",{className:"container",children:o})})]},Math.random())})}function mn(e){const n=[];return e.child?.children.map((a,t)=>{n.push(u.jsx(Vt,{child:a,scene:e.scene,three:e.three},t))}),u.jsx("div",{className:`scene ${e.class!==void 0?e.class:""}`,children:n})}function $n(e){const[n,a]=b.useState(e.defaultValue);return b.useEffect(()=>{let t=!1,i=-1,o=0,l=e.defaultValue;const r=E=>{t=!0,o=Number(e.input.current?.value),i=E.clientX,document.addEventListener("mouseup",d,!1),document.addEventListener("mousemove",h,!1),document.addEventListener("contextmenu",d,!1)},h=E=>{if(!t)return;const C=e.step!==void 0?e.step:1,A=(E.clientX-i)*C;l=Number((o+A).toFixed(4)),e.min!==void 0&&(l=Math.max(l,e.min)),e.max!==void 0&&(l=Math.min(l,e.max)),e.onChange!==void 0&&e.onChange(l),a(l)},d=()=>{t=!1,document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",h),document.removeEventListener("contextmenu",d)},m=E=>{const C=Number(E.target.value);a(C)},y=E=>{const C=Number(E.target.value);e.onChange!==void 0&&e.onChange(C),a(C)};return e.input.current?.addEventListener("input",m),e.label.current?.addEventListener("mousedown",r,!1),e.sliderRef!==void 0&&e.sliderRef.current?.addEventListener("input",y),()=>{e.input.current?.removeEventListener("input",m),e.label.current?.removeEventListener("mousedown",r),e.sliderRef!==void 0&&e.sliderRef.current?.removeEventListener("input",y),document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",h),document.removeEventListener("contextmenu",d)}},[]),n}function We(e){const n=b.useRef(null),a=b.useRef(null),t=$n({label:e.labelRef,input:n,sliderRef:a,defaultValue:e.value,min:e.min,max:e.max,step:e.step,onChange:i=>{e.onChange!==void 0&&e.onChange(e.prop,i)}});return u.jsxs(u.Fragment,{children:[e.type==="number"&&u.jsx("input",{alt:e.alt,className:e.className,ref:n,type:"number",value:t,min:e.min,max:e.max,step:e.step,disabled:e.disabled,onChange:i=>{const o=Number(i.target.value);e.onChange!==void 0&&e.onChange(e.prop,o)}}),e.type==="range"&&u.jsxs(u.Fragment,{children:[u.jsx("input",{type:"text",value:t.toString(),disabled:e.disabled,ref:n,className:"min",onChange:i=>{const o=Number(i.target.value);e.onChange!==void 0&&e.onChange(e.prop,o)}}),u.jsx("input",{disabled:e.disabled,type:"range",value:t,min:e.min,max:e.max,step:e.step,ref:a,onChange:wt})]})]})}function zn(e){const n=b.useRef(null),a=b.useRef(null),t=b.useRef(null),i=b.useRef(null),o=b.useRef(null),l=b.useRef(null),[r,h]=b.useState(e.value),[d,m]=b.useState({min:Math.min(e.min,Math.min(e.value.x,e.value.y)),max:Math.max(e.max,Math.max(e.value.x,e.value.y))}),[y,E]=b.useState(!1);function C(){y||(window.addEventListener("mousemove",K),window.addEventListener("mouseup",A),window.addEventListener("mouseup",A),E(!0))}function A(){window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",A),E(!1)}function K(k){const X=o.current.getBoundingClientRect(),re=Ve(0,99,k.clientX-X.left)/99,w=Ve(0,99,k.clientY-X.top)/99,ge=Nt(jt(d.min,d.max,re),3),Y=Nt(jt(d.min,d.max,w),3);e.onChange({target:{value:{x:ge,y:Y}}}),h({x:ge,y:Y})}function $(k){let X=r.x,re=r.y;k.target===n.current?X=Number(k.target.value):re=Number(k.target.value),h({x:X,y:re})}function H(){const k=Number(t.current.value);m({min:k,max:d.max}),(r.x<k||r.y<k)&&h({x:Ve(k,d.max,r.x),y:Ve(k,d.max,r.y)})}function O(){const k=Number(i.current.value);m({min:d.min,max:k}),(r.x>k||r.y>k)&&h({x:Ve(d.min,k,r.x),y:Ve(d.min,k,r.y)})}b.useEffect(()=>{const k=It(d.min,d.max,r.x),X=It(d.min,d.max,r.y);l.current.style.left=`${k*100}%`,l.current.style.top=`${X*100}%`},[d,r]);const V=e.step!==void 0?e.step:.01;return u.jsxs("div",{className:"vector2",children:[u.jsxs("div",{className:"fields",children:[u.jsxs("div",{children:[u.jsx("label",{children:"X:"}),u.jsx("input",{ref:n,type:"number",value:r.x,min:d.min,max:d.max,step:V,onChange:$})]}),u.jsxs("div",{children:[u.jsx("label",{children:"Y:"}),u.jsx("input",{ref:a,type:"number",value:r.y,min:d.min,max:d.max,step:V,onChange:$})]}),u.jsxs("div",{children:[u.jsx("label",{children:"Min:"}),u.jsx("input",{ref:t,type:"number",value:d.min,step:V,onChange:H})]}),u.jsxs("div",{children:[u.jsx("label",{children:"Max:"}),u.jsx("input",{ref:i,type:"number",value:d.max,step:V,onChange:O})]})]}),u.jsxs("div",{className:"input",ref:o,onMouseDown:C,onMouseUp:A,children:[u.jsx("div",{className:"x"}),u.jsx("div",{className:"y"}),u.jsx("div",{className:"pt",ref:l})]})]})}function Yt(e){const n=e.value.isVector3!==void 0,a=e.value.isEuler!==void 0,t=e.value.elements!==void 0,i=e.step!==void 0?e.step:.01,o=[];if(n){const l=b.useMemo(()=>e.value,[]),r=(d,m)=>{l[d]=m,e.onChange({target:{value:l}})};["x","y","z"].forEach(d=>{const m=b.useRef(null);o.push(u.jsxs("div",{children:[u.jsx("label",{ref:m,children:d.toUpperCase()}),u.jsx(We,{value:l[d],type:"number",prop:d,step:i,labelRef:m,onChange:r})]},d))})}else if(a){const l=b.useMemo(()=>e.value,[]),r=(d,m)=>{l[d]=m,e.onChange({target:{value:l}})};["_x","_y","_z"].forEach(d=>{const m=b.useRef(null);o.push(u.jsxs("div",{children:[u.jsx("label",{ref:m,children:d.substring(1).toUpperCase()}),u.jsx(We,{value:l[d],type:"number",prop:d,step:i,labelRef:m,onChange:r})]},d))})}else if(t){const l=b.useMemo(()=>e.value,[]),r=(h,d)=>{const m=Number(h);l.elements[m]=d,e.onChange({target:{value:l}})};for(let h=0;h<9;h++){const d=b.useRef(null);o.push(u.jsxs("div",{children:[u.jsx("label",{ref:d,children:h+1}),u.jsx(We,{value:l.elements[h],type:"number",prop:h.toString(),step:i,labelRef:d,onChange:r})]},h.toString()))}}return u.jsx("div",{className:"grid3",children:o},Math.random().toString())}function Gn(e){const n=e.value.x!==void 0,a=e.step!==void 0?e.step:.01,t=[];if(n){const i=b.useMemo(()=>e.value,[]),o=(r,h)=>{i[r]=h,e.onChange({target:{value:i}})};["x","y","z","w"].forEach(r=>{const h=b.useRef(null);t.push(u.jsxs("div",{children:[u.jsx("label",{ref:h,children:r.toUpperCase()}),u.jsx(We,{value:i.x,type:"number",prop:r,step:a,labelRef:h,onChange:o})]},r))})}else{const i=b.useMemo(()=>e.value,[]),o=(l,r)=>{const h=Number(l);i.elements[h]=r,e.onChange({target:{value:i}})};for(let l=0;l<16;l++){const r=b.useRef(null);t.push(u.jsxs("div",{children:[u.jsx("label",{ref:r,children:l+1}),u.jsx(We,{value:i.elements[l],type:"number",prop:l.toString(),step:a,labelRef:r,onChange:o})]},l.toString()))}}return u.jsx("div",{className:"grid4",children:t})}function Hn(e){return"items"in e}function Ye(e){const n=[];return e.items.forEach(a=>{Hn(a)?n.push(u.jsx(Ye,{title:lt(a.title),items:a.items},Math.random())):n.push(u.jsx(St,{title:a.title,prop:a.prop,value:a.value,type:a.type,min:a.min,max:a.max,step:a.step,disabled:a.disabled,options:a.options,onChange:(t,i)=>{a.onChange!==void 0&&a.onChange(t,i)},onKeyDown:t=>{a.onKeyDown!==void 0&&a.onKeyDown(t)}},Math.random()))}),u.jsx(Ot,{label:e.title,open:e.expanded===!0,children:n})}function Wn(e){return!(e==="alphaHash"||e==="alphaToCoverage"||e==="attenuationDistance"||e==="blendAlpha"||e==="blendColor"||e==="blendDstAlpha"||e==="colorWrite"||e==="combine"||e==="defaultAttributeValues"||e==="depthFunc"||e==="forceSinglePass"||e==="glslVersion"||e==="linecap"||e==="linejoin"||e==="linewidth"||e==="normalMapType"||e==="precision"||e==="premultipliedAlpha"||e==="shadowSide"||e==="toneMapped"||e==="uniformsGroups"||e==="uniformsNeedUpdate"||e==="userData"||e==="vertexColors"||e==="version"||e==="wireframeLinecap"||e==="wireframeLinejoin"||e==="wireframeLinewidth"||e.slice(0,4)==="clip"||e.slice(0,7)==="polygon"||e.slice(0,7)==="stencil"||e.slice(0,2)==="is")}function Yn(e){switch(e){case"Alpha Map":return"alphaMap";case"Anisotropy Map":return"anisotropyMap";case"AO Map":return"aoMap";case"Bump Map":return"bumpMap";case"Clearcoat Map":return"clearcoatMap";case"Clearcoat Normal Map":return"clearcoatNormalMap";case"Clearcoat Roughness Map":return"clearcoatRoughnessMap";case"Displacement Map":return"displacementMap";case"Emissive Map":return"emissiveMap";case"Iridescence Map":return"iridescenceMap";case"Iridescence Thickness Map":return"iridescenceThicknessMap";case"Map":return"map";case"Matcap":return"matcap";case"Normal Map":return"normalMap";case"Roughness Map":return"roughnessMap";case"Sheen Color Map":return"sheenColorMap";case"Sheen Roughness Map":return"sheenRoughnessMap";case"Specular Color Map":return"specularColorMap";case"Specular Map Intensity":return"specularIntensityMap";case"Thickness Map":return"thicknessMap";case"Transmission Map":return"transmissionMap"}return e}function Rt(e){switch(e){case"alphaMap":return"Alpha Map";case"anisotropyMap":return"Anisotropy Map";case"anisotropyRotation":return"Anisotropy Rotation";case"aoMap":return"AO Map";case"aoMapIntensity":return"AO Map Intensity";case"attenuationColor":return"Attenuation Color";case"blendAlpha":return"Blend Alpha";case"blendColor":return"Blend Color";case"blendDst":return"Blend Dst";case"blendDstAlpha":return"Blend Dst Alha";case"blendEquation":return"Blend Equation";case"blendEquationAlpha":return"Blend Equation Alpha";case"blending":return"Blending";case"blendSrc":return"Blend Src";case"blendSrcAlpha":return"Blend Src Alpha";case"bumpMap":return"Bump Map";case"bumpScale":return"Bump Scale";case"clearcoatMap":return"Clearcoat Map";case"clearcoatNormalMap":return"Clearcoat Normal Map";case"clearcoatNormalScale":return"Clearcoat Normal Scale";case"clearcoatRoughness":return"Clearcoat Roughness";case"clearcoatRoughnessMap":return"Clearcoat Roughness Map";case"color":return"Color";case"defines":return"Defines";case"depthTest":return"Depth Test";case"depthWrite":return"Depth Write";case"displacementBias":return"Displacement Bias";case"displacementMap":return"Displacement Map";case"displacementScale":return"Displacement Scale";case"dithering":return"Dithering";case"emissive":return"Emissive";case"emissiveMap":return"Emissive Map";case"emissiveIntensity":return"Emissive Intensity";case"envMap":return"Environment Map";case"envMapIntensity":return"Environment Map Intensity";case"extensions":return"Extensions";case"flatShading":return"Flat Shading";case"fragmentShader":return"Fragment Shader";case"fog":return"Fog";case"gradientMap":return"Gradient Map";case"ior":return"IOR";case"iridescenceIOR":return"Iridescence IOR";case"iridescenceMap":return"Iridescence Map";case"iridescenceThicknessMap":return"Iridescence Thickness Map";case"iridescenceThicknessRange":return"Iridescence Thickness Range";case"lights":return"Lights";case"lightMap":return"Light Map";case"lightMapIntensity":return"Light Map Intensity";case"map":return"Map";case"matcap":return"Matcap";case"metalness":return"Metalness";case"metalnessMap":return"Metalness Map";case"name":return"Name";case"normalMap":return"Normal Map";case"normalScale":return"Normal Scale";case"opacity":return"Opacity";case"reflectivity":return"Reflectivity";case"refractionRatio":return"Refraction Ratio";case"roughness":return"Roughness";case"roughnessMap":return"Roughness Map";case"sheenColor":return"Sheen Color";case"sheenColorMap":return"Sheen Color Map";case"sheenRoughness":return"Sheen Roughness";case"sheenRoughnessMap":return"Sheen Roughness Map";case"shininess":return"Shininess";case"side":return"Side";case"size":return"Size";case"sizeAttenuation":return"Size Attenuation";case"specular":return"Specular";case"specularColor":return"Specular Color";case"specularColorMap":return"Specular Color Map";case"specularIntensity":return"Specular Intensity";case"specularIntensityMap":return"Specular Map Intensity";case"thickness":return"Thickness";case"thicknessMap":return"Thickness Map";case"transmission":return"Transmission";case"transmissionMap":return"Transmission Map";case"transparent":return"Transparent";case"type":return"Type";case"uuid":return"UUID";case"uniforms":return"Uniforms";case"vertexShader":return"Vertex Shader";case"visible":return"Visible";case"wireframe":return"Wireframe"}return e}function pn(e){const n=e.toLowerCase();return n.search("intensity")>-1||n==="anisotropyrotation"||n==="blendalpha"||n==="bumpscale"||n==="clearcoatroughness"||n==="displacementbias"||n==="displacementscale"||n==="metalness"||n==="opacity"||n==="reflectivity"||n==="refractionratio"||n==="roughness"||n==="sheenroughness"||n==="thickness"}function qn(){const e=document.createElement("input");return e.type="file",new Promise((n,a)=>{e.addEventListener("change",function(){if(e.files===null)a();else{const t=e.files[0],i=new FileReader;i.onload=function(o){n(o.target.result)},i.readAsDataURL(t)}}),e.click()})}const Kn=[{title:"Front",value:f.FrontSide},{title:"Back",value:f.BackSide},{title:"Double",value:f.DoubleSide}],Xn=[{title:"No Blending",value:f.NoBlending},{title:"Normal",value:f.NormalBlending},{title:"Additive",value:f.AdditiveBlending},{title:"Subtractive",value:f.SubtractiveBlending},{title:"Multiply",value:f.MultiplyBlending},{title:"Custom",value:f.CustomBlending}],Zn=[{title:"Add",value:f.AddEquation},{title:"Subtract",value:f.SubtractEquation},{title:"Reverse Subtract",value:f.ReverseSubtractEquation},{title:"Min",value:f.MinEquation},{title:"Max",value:f.MaxEquation}],Jn=[{title:"Zero",valye:f.ZeroFactor},{title:"One",valye:f.OneFactor},{title:"Src Color",valye:f.SrcColorFactor},{title:"One Minus Src Color",valye:f.OneMinusSrcColorFactor},{title:"Src Alpha",valye:f.SrcAlphaFactor},{title:"One Minus Src Alpha",valye:f.OneMinusSrcAlphaFactor},{title:"Dst Alpha",valye:f.DstAlphaFactor},{title:"One Minus Dst Alpha",valye:f.OneMinusDstAlphaFactor},{title:"Dst Color",valye:f.DstColorFactor},{title:"One Minus Dst Color",valye:f.OneMinusDstColorFactor},{title:"Src Alpha Saturate",valye:f.SrcAlphaSaturateFactor},{title:"Constant Color",valye:f.ConstantColorFactor},{title:"One Minus Constant Color",valye:f.OneMinusConstantColorFactor},{title:"Constant Alpha",valye:f.ConstantAlphaFactor},{title:"One Minus Constant Alpha",valye:f.OneMinusConstantAlphaFactor}],Qn=[{title:"Zero",valye:f.ZeroFactor},{title:"One",valye:f.OneFactor},{title:"Src Color",valye:f.SrcColorFactor},{title:"One Minus Src Color",valye:f.OneMinusSrcColorFactor},{title:"Src Alpha",valye:f.SrcAlphaFactor},{title:"One Minus Src Alpha",valye:f.OneMinusSrcAlphaFactor},{title:"Dst Alpha",valye:f.DstAlphaFactor},{title:"One Minus Dst Alpha",valye:f.OneMinusDstAlphaFactor},{title:"Dst Color",valye:f.DstColorFactor},{title:"One Minus Dst Color",valye:f.OneMinusDstColorFactor},{title:"Constant Color",valye:f.ConstantColorFactor},{title:"One Minus Constant Color",valye:f.OneMinusConstantColorFactor},{title:"Constant Alpha",valye:f.ConstantAlphaFactor},{title:"One Minus Constant Alpha",valye:f.OneMinusConstantAlphaFactor}];function ot(e,n){e.needsUpdate=!0,e.type="option",e.options=n}function ea(e,n,a,t){return{type:"boolean",title:Rt(e),prop:e,value:n,needsUpdate:!0,onChange:(i,o)=>{t.updateObject(a.uuid,`material.${e}`,o),t.updateObject(a.uuid,"material.needsUpdate",!0);const l=t.getScene(a.uuid);if(l!==null){const r=l.getObjectByProperty("uuid",a.uuid);Q(r,`material.${e}`,o)}}}}function ta(e,n,a,t){const i={type:"number",title:Rt(e),prop:e,value:n,min:void 0,max:void 0,step:.01,needsUpdate:!0,onChange:(o,l)=>{t.updateObject(a.uuid,`material.${e}`,l),t.updateObject(a.uuid,"material.needsUpdate",!0);const r=t.getScene(a.uuid);if(r!==null){const h=r.getObjectByProperty("uuid",a.uuid);Q(h,`material.${e}`,l)}}};switch(e){case"blending":ot(i,Xn);break;case"blendDst":ot(i,Qn);break;case"blendEquation":ot(i,Zn);break;case"blendSrc":ot(i,Jn);break;case"side":ot(i,Kn);break}return pn(e)&&(i.value=Number(n),i.type="range",i.min=Math.min(0,i.value),i.max=Math.max(1,i.value),i.step=.01),i}function na(e,n,a,t){const i={type:"string",title:Rt(e),prop:e,value:n,needsUpdate:!0,onChange:(l,r)=>{t.updateObject(a.uuid,`material.${e}`,r),t.updateObject(a.uuid,"material.needsUpdate",!0);const h=t.getScene(a.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",a.uuid);Q(d,`material.${e}`,r)}},onKeyDown:l=>{}};return(e==="vertexShader"||e==="fragmentShader")&&(i.disabled=!1,i.latest=i.value,i.onChange=(l,r)=>{i.latest=r,t.updateObject(a.uuid,`material.${e}`,r);const h=t.getScene(a.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",a.uuid);Q(d,`material.${e}`,r)}},i.onKeyDown=l=>{if(l.key==="Enter"&&(l.altKey||l.metaKey)){t.updateObject(a.uuid,"material.needsUpdate",!0);const r=t.getScene(a.uuid);if(r!==null){const h=r.getObjectByProperty("uuid",a.uuid);Q(h,"material.needsUpdate",!0)}}}),i}function aa(e){return e.x!==void 0&&e.y!==void 0&&e.z===void 0}function ia(e){return e.x!==void 0&&e.y!==void 0&&e.z!==void 0&&e.w===void 0}function ra(e){return e.x!==void 0&&e.y!==void 0&&e.z!==void 0&&e.w!==void 0}function Ut(e){e.sort((n,a)=>n.title<a.title?-1:n.title>a.title?1:0)}function ct(e,n,a,t,i="",o=!1){const l=Rt(e).split(".")[0].replaceAll("[","").replaceAll("]",""),r=i.length>0?`${i}.${e}`:e,h=typeof n;if(h==="boolean"||h==="string")return{title:l,prop:r,type:h,value:n,disabled:o,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const y=t.getScene(a.uuid);if(y!==null){const E=y.getObjectByProperty("uuid",a.uuid);Q(E,`material.${r}`,m)}}};if(h==="number"){const d={title:l,prop:r,type:"number",value:n,step:.01,disabled:o,onChange:(m,y)=>{t.updateObject(a.uuid,`material.${r}`,y);const E=t.getScene(a.uuid);if(E!==null){const C=E.getObjectByProperty("uuid",a.uuid);Q(C,`material.${r}`,y)}}};return pn(l)&&(d.type="range",d.min=0,d.max=1),d}else{if(n.isColor)return{title:l,prop:r,type:"color",value:n,disabled:o,onChange:(d,m)=>{const y=new f.Color(m);t.updateObject(a.uuid,`material.${r}`,y);const E=t.getScene(a.uuid);if(E!==null){const C=E.getObjectByProperty("uuid",a.uuid);Q(C,`material.${r}`,y)}}};if(Array.isArray(n)){const d=[];for(const m in n){const y=n[m],E=`[${m.toString()}]`;if(y.value!==void 0){const C=ct(`${E}.value`,y.value,a,t,r,o);C!==void 0&&d.push(C)}else{const C=ct(E,y,a,t,r,o);C!==void 0&&d.push(C)}}if(d.length>0)return Ut(d),{title:l,items:d}}else{if(aa(n))return{title:l,prop:r,type:"vector2",value:n,disabled:o,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const y=t.getScene(a.uuid);if(y!==null){const E=y.getObjectByProperty("uuid",a.uuid);Q(E,`material.${r}`,m)}}};if(ia(n))return{title:l,prop:r,type:"grid3",value:n,disabled:o,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const y=t.getScene(a.uuid);if(y!==null){const E=y.getObjectByProperty("uuid",a.uuid);Q(E,`material.${r}`,m)}}};if(ra(n))return{title:l,prop:r,type:"grid4",value:n,disabled:o,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const y=t.getScene(a.uuid);if(y!==null){const E=y.getObjectByProperty("uuid",a.uuid);Q(E,`material.${r}`,m)}}};if(n.isEuler)return{title:l,prop:r,type:"euler",value:n,disabled:o,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const y=t.getScene(a.uuid);if(y!==null){const E=y.getObjectByProperty("uuid",a.uuid);Q(E,`material.${r}`,m)}}};if(n.src!==void 0)return{title:l,type:"image",value:n,disabled:o,onChange:(d,m)=>{const y=Yn(e),E=i.length>0?`${i}.${y}`:y;t.createTexture(a.uuid,`material.${E}`,m);const C=t.getScene(a.uuid);if(C!==null){const A=C.getObjectByProperty("uuid",a.uuid);if(A!==void 0){const K=$=>{const H=A.material,O=E.split(".");switch(O.length){case 1:H[O[0]]=$;break;case 2:H[O[0]][O[1]]=$;break;case 3:H[O[0]][O[1]][O[2]]=$;break;case 4:H[O[0]][O[1]][O[2]][O[3]]=$;break;case 5:H[O[0]][O[1]][O[2]][O[3]][O[4]]=$;break}H.needsUpdate=!0};m.src.length>0?ln(m.src).then($=>{$.offset.set(m.offset[0],m.offset[1]),$.repeat.set(m.repeat[0],m.repeat[1]),K($)}):K(null)}}}};if(n.elements!==void 0)return{title:l,prop:r,type:n.elements.length>9?"grid4":"grid3",value:n,disabled:o,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const y=t.getScene(a.uuid);if(y!==null){const E=y.getObjectByProperty("uuid",a.uuid);Q(E,`material.${r}`,m)}}};{const d=[],m=e==="defines"||e==="extensions";try{for(const y in n){const E=n[y];if(E!==void 0)if(E.value!==void 0){const C=ct(`${y}.value`,E.value,a,t,r,m);C!==void 0&&d.push(C)}else{const C=ct(y,E,a,t,r,m);C!==void 0&&d.push(C)}}}catch{console.log("Issue cycling through material object:",e,n)}if(d.length>0)return Ut(d),{title:l,items:d}}}}}function qt(e,n,a){const t=[];for(const i in e){if(!Wn(i))continue;const o=typeof e[i],l=e[i];if(o==="boolean")t.push(ea(i,l,n,a));else if(o==="number")t.push(ta(i,l,n,a));else if(o==="string")t.push(na(i,l,n,a));else if(o==="object"){const r=ct(i,l,n,a);r!==void 0&&t.push(r)}else l!==void 0&&console.log("other:",i,o,l)}return Ut(t),t.push({title:"Update Material",type:"button",onChange:()=>{a.updateObject(n.uuid,"material.needsUpdate",!0);const i=a.getScene(n.uuid);if(i!==null){const o=i.getObjectByProperty("uuid",n.uuid);Q(o,"material.needsUpdate",!0)}}}),t}function sa(e,n){const a=e.material;if(Array.isArray(a)){const t=[],i=a.length;for(let o=0;o<i;o++)t.push(u.jsx(Ye,{title:`Material ${o}`,items:qt(a[o],e,n)},`Material ${o}`));return u.jsx(u.Fragment,{children:t})}else return u.jsx(Ye,{title:"Material",items:qt(a,e,n)})}const Kt="data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDIgNzkuZGJhM2RhM2I1LCAyMDIzLzEyLzE1LTEwOjQyOjM3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMDk3M0NEODAxQjQxMUVGODVGNENDMkUyMUExNDk1NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDk3M0NEOTAxQjQxMUVGODVGNENDMkUyMUExNDk1NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE4ODc3Qzg5MDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkE4ODc3QzhBMDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAA4BZAAAAv+Mj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqTkJAGDQ+dnpuekmGgAKejpKuiZqmprKqoZKGyrbOlqrejub6xvLGyw8TFzcprurGuvqybxq7ETbrItsCz0l7Zpc+6p9/cS967w9/S2FTF0u/mzehK4Oqz3eTl9vf4+fr7/P3+//DzCgwIEECxo8iDChwoUMGzp8CDGixIkUK1q8iDGjxo0XHDt6/AgypMiRJEuaPIkypcqVLFt+KwAAOw==";function oa(e){const n=e.step!==void 0?e.step:.01,a=b.useRef(null),t=b.useRef(null),i=b.useRef(null),o=b.useRef(null),l=b.useRef(null),[r]=b.useState(e.value),[h,d]=b.useState(e.value.offset[0]),[m,y]=b.useState(e.value.offset[1]),[E,C]=b.useState(e.value.repeat[0]),[A,K]=b.useState(e.value.repeat[1]);function $(O,V,k,X,re){if(e.onChange!==void 0){const w=e.prop!==void 0?e.prop:e.title;e.onChange(w,{src:O,offset:[V,k],repeat:[X,re]})}}function H(O){const V=a.current.src,k=O.target.value;switch(O.target){case t.current:d(k),$(V,k,m,E,A);break;case i.current:y(k),$(V,h,k,E,A);break;case o.current:C(k),$(V,h,m,k,A);break;case l.current:K(k),$(V,h,m,E,k);break}}return u.jsxs("div",{className:"imageField",children:[u.jsx("img",{alt:e.title,ref:a,onClick:()=>{qn().then(O=>{a.current.src=O,$(O,h,m,E,A)})},src:r.src.length>0?r.src:Kt}),u.jsxs("div",{className:"fields",children:[u.jsxs("div",{children:[u.jsx("label",{children:"Offset:"}),u.jsx("input",{ref:t,type:"number",value:h,step:n,onChange:H}),u.jsx("input",{ref:i,type:"number",value:m,step:n,onChange:H})]}),u.jsxs("div",{children:[u.jsx("label",{children:"Repeat:"}),u.jsx("input",{ref:o,type:"number",value:E,step:n,onChange:H}),u.jsx("input",{ref:l,type:"number",value:A,step:n,onChange:H})]}),u.jsx("button",{onClick:()=>{$("",h,m,E,A),a.current.src=Kt},children:"Clear"})]})]})}function St(e){let n=e.value;n!==void 0&&n.isColor!==void 0&&(n=on(e.value));const[a,t]=b.useState(n),i=b.useRef(null),o=d=>{let m=d.target.value;e.type==="boolean"?m=d.target.checked:e.type==="option"&&(m=e.options[m].value),t(m),e.onChange!==void 0&&e.onChange(e.prop!==void 0?e.prop:e.title,m)},l={};e.disabled&&(l.opacity=.8);const r=e.type==="string"&&(a.length>100||a.search(`
|
30
|
+
`)>-1),h=r||e.type==="image"||e.type==="vector2";return u.jsxs("div",{className:`field ${h?"block":""}`,style:l,children:[e.type!=="button"&&u.jsx("label",{ref:i,children:lt(e.title)},"fieldLabel"),e.type==="string"&&!r&&u.jsx("input",{type:"text",disabled:e.disabled,onChange:o,value:a}),e.type==="string"&&r&&u.jsx("textarea",{cols:50,rows:10,disabled:e.disabled!==void 0?e.disabled:!0,onChange:o,onKeyDown:d=>{e.onKeyDown!==void 0&&e.onKeyDown(d)},value:a}),e.type==="boolean"&&u.jsx("input",{type:"checkbox",disabled:e.disabled,onChange:o,checked:a}),e.type==="number"&&u.jsx(We,{value:a,type:e.type,prop:e.prop!==void 0?e.prop:e.title,min:e.min,max:e.max,step:e.step,disabled:e.disabled,labelRef:i,onChange:e.onChange}),e.type==="range"&&u.jsx(We,{value:a,type:e.type,prop:e.prop!==void 0?e.prop:e.title,min:e.min,max:e.max,step:e.step,disabled:e.disabled,labelRef:i,onChange:e.onChange}),e.type==="color"&&u.jsxs(u.Fragment,{children:[u.jsx("input",{type:"text",value:a.toString(),onChange:o,disabled:e.disabled,className:"color"}),u.jsx("input",{type:"color",value:a,onChange:o,disabled:e.disabled})]}),e.type==="button"&&u.jsx("button",{disabled:e.disabled,onClick:()=>{e.onChange!==void 0&&e.onChange(e.prop!==void 0?e.prop:e.title,!0)},children:e.title}),e.type==="image"&&u.jsx(oa,{title:e.title,prop:e.prop,value:e.value,onChange:e.onChange}),e.type==="option"&&u.jsx(u.Fragment,{children:u.jsx("select",{onChange:o,disabled:e.disabled,defaultValue:e.value,children:e.options?.map((d,m)=>u.jsx("option",{value:d.value,children:lt(d.title)},m))})}),e.type==="vector2"&&u.jsx(zn,{step:e.step,value:a,min:0,max:1,onChange:o}),e.type==="grid3"&&u.jsx(Yt,{step:e.step,value:a,onChange:o}),e.type==="grid4"&&u.jsx(Gn,{step:e.step,value:a,onChange:o}),e.type==="euler"&&u.jsx(Yt,{step:e.step,value:a,onChange:o})]})}function Xt(e){switch(e){case"fov":return"FOV";case"zoom":return"Zoom";case"near":return"Near";case"far":return"Far";case"focus":return"Focus";case"aspect":return"Aspect";case"filmGauge":return"Film Gauge";case"filmOffset":return"Film Offset";case"left":return"Left";case"right":return"Right";case"top":return"Top";case"bottom":return"Bottom"}return e}function ca(e,n){const a=[];if(e.perspectiveCameraInfo!==void 0)for(const t in e.perspectiveCameraInfo)a.push({title:Xt(t),prop:t,type:"number",step:.01,value:e.perspectiveCameraInfo[t],onChange:(i,o)=>{n.updateObject(e.uuid,i,o),n.requestMethod(e.uuid,"updateProjectionMatrix");const l=n.getScene(e.uuid);if(l!==null){const r=l.getObjectByProperty("uuid",e.uuid);r!==void 0&&(Q(r,i,o),r.updateProjectionMatrix())}}});else if(e.orthographicCameraInfo!==void 0)for(const t in e.orthographicCameraInfo)a.push({title:Xt(t),prop:t,type:"number",step:.01,value:e.perspectiveCameraInfo[t],onChange:(i,o)=>{n.updateObject(e.uuid,i,o),n.requestMethod(e.uuid,"updateProjectionMatrix");const l=n.getScene(e.uuid);if(l!==null){const r=l.getObjectByProperty("uuid",e.uuid);r!==void 0&&(Q(r,i,o),r.updateProjectionMatrix())}}});return u.jsx(Ye,{title:"Camera",items:a})}function la(e,n){const a=new f.Matrix4;a.elements=e.matrix;const t=new f.Vector3,i=new f.Euler,o=new f.Vector3;e.uuid.length>0&&(t.setFromMatrixPosition(a),i.setFromRotationMatrix(a),o.setFromMatrixScale(a));const l=(r,h)=>{const d=r==="rotation"?{x:h._x,y:h._y,z:h._z}:h;n.updateObject(e.uuid,r,d);const m=n.getScene(e.uuid);if(m!==null){const y=m.getObjectByProperty("uuid",e.uuid);Q(y,r,d)}};return u.jsx(Ye,{title:"Transform",items:[{title:"Position",prop:"position",type:"grid3",step:.1,value:t,onChange:l},{title:"Rotation",prop:"rotation",type:"grid3",value:i,onChange:l},{title:"Scale",prop:"scale",type:"grid3",value:o,onChange:l}]})}function Zt(e){switch(e){case"color":return"Color";case"intensity":return"Intensity";case"decay":return"Decay";case"distance":return"Distance";case"angle":return"Angle";case"penumbra":return"Penumbra";case"groundColor":return"Ground Color";case"width":return"Width";case"height":return"Height"}return e}function ua(e,n){const a=[];if(e.lightInfo!==void 0)for(const t in e.lightInfo){const i=e.lightInfo[t];i!==void 0&&(i.isColor!==void 0?a.push({title:Zt(t),prop:t,type:"color",value:i,onChange:(o,l)=>{const r=new f.Color(l);n.updateObject(e.uuid,o,r);const h=n.getScene(e.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",e.uuid);Q(d,o,r)}}}):a.push({title:Zt(t),prop:t,type:typeof i,value:i,step:typeof i=="number"?.01:void 0,onChange:(o,l)=>{n.updateObject(e.uuid,o,l);const r=n.getScene(e.uuid);if(r!==null){const h=r.getObjectByProperty("uuid",e.uuid);Q(h,o,l)}}}))}return u.jsx(Ye,{title:"Light",items:a})}function da(e,n){const a=[],t=[];let i=0;e.animations.forEach(l=>{i=Math.max(i,l.duration),l.duration>0&&t.push({title:l.name,items:[{title:"Duration",type:"number",value:l.duration,disabled:!0},{title:"Blend Mode",type:"option",disabled:!0,options:[{title:"Normal",value:2500},{title:"Additive",value:2501}]}]})}),a.push({title:"Animations",items:t});const o=n.getScene(e.uuid);if(o!==null){const l=o.getObjectByProperty("uuid",e.uuid);let r=!1;if(l!==void 0){const h=l.mixer;if(r=h!==void 0,r){const d=[{title:"Time Scale",type:"range",value:h.timeScale,step:.01,min:-1,max:2,onChange:(m,y)=>{h.timeScale=y,n.updateObject(e.uuid,"mixer.timeScale",y)}}];d.push({title:"Stop All",type:"button",onChange:()=>{h.stopAllAction(),n.requestMethod(e.uuid,"stopAllAction",void 0,"mixer")}}),a.push({title:"Mixer",items:d})}}}return u.jsx(Ye,{title:"Animation",items:a})}const gn={name:"",uuid:"",type:"",visible:!1,matrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],animations:[],material:void 0,perspectiveCameraInfo:void 0,orthographicCameraInfo:void 0,lightInfo:void 0,children:[]};let pe={...gn};function vn(e){const[n,a]=b.useState(-1);b.useEffect(()=>{function l(h){pe={...h.value},a(Date.now())}function r(){pe={...gn},a(Date.now())}return I.addEventListener(j.SET_SCENE,r),I.addEventListener(j.SET_OBJECT,l),()=>{I.removeEventListener(j.SET_SCENE,r),I.removeEventListener(j.SET_OBJECT,l)}},[]);const t=pe.type.toLowerCase(),i=pe.animations.length>0||pe.mixer!==void 0,o=t.search("mesh")>-1||t.search("line")>-1||t.search("points")>-1;return u.jsx(Ot,{label:"Inspector",children:u.jsx("div",{id:"Inspector",className:e.class,children:pe.uuid.length>0&&u.jsxs(u.Fragment,{children:[u.jsxs(u.Fragment,{children:[u.jsx(St,{type:"string",title:"Name",prop:"name",value:pe.name,disabled:!0}),u.jsx(St,{type:"string",title:"Type",prop:"type",value:pe.type,disabled:!0}),u.jsx(St,{type:"string",title:"UUID",prop:"uuid",value:pe.uuid,disabled:!0})]}),u.jsxs(u.Fragment,{children:[la(pe,e.three),i?da(pe,e.three):null,t.search("camera")>-1?ca(pe,e.three):null,t.search("light")>-1?ua(pe,e.three):null,o?sa(pe,e.three):null]})]})},n)},"Inspector")}function ha(e){const[n]=b.useState([]),[a,t]=b.useState(0),i=r=>{n.push(r.value),t(Date.now())},o=r=>{const h=r.value;for(let d=0;d<n.length;d++)if(h.uuid===n[d].uuid){n.splice(d,1),t(Date.now());return}};b.useEffect(()=>(I.addEventListener(j.ADD_SCENE,i),I.addEventListener(j.REMOVE_SCENE,o),()=>{I.removeEventListener(j.ADD_SCENE,i),I.removeEventListener(j.REMOVE_SCENE,o)}),[]);const l=[];return n.forEach((r,h)=>{l.push(u.jsx(Ot,{label:`Scene: ${r.name}`,open:!0,children:u.jsx(mn,{child:r,scene:r,three:e.three})},`scene_${h}`))}),u.jsxs("div",{id:"SidePanel",children:[l,u.jsx(vn,{three:e.three})]},`SidePanel ${a}`)}function fa(e){return b.useEffect(()=>{function n(r){let h=null;return e.three.scenes.forEach(d=>{r.search(d.uuid)>-1&&(h=d)}),h}const a=r=>{const h=r.value,d=n(h),m=d?.getObjectByProperty("uuid",h);m!==void 0?e.three.setObject(m):console.log(`Hermes - can't find object: ${h}`,d)},t=(r,h,d)=>{const m=n(r),y=m?.getObjectByProperty("uuid",r);y!==void 0?Q(y,h,d):console.log(`Hermes - can't set object: ${r}`,m)},i=r=>{const h=r.value,{key:d,value:m,uuid:y}=h;t(y,d,m)},o=r=>{const h=r.value,m=n(h.uuid)?.getObjectByProperty("uuid",h.uuid);if(m!==void 0){const y=E=>{const C=h.key.split(".");switch(C.length){case 1:m[C[0]]=E;break;case 2:m[C[0]][C[1]]=E;break;case 3:m[C[0]][C[1]][C[2]]=E;break;case 4:m[C[0]][C[1]][C[2]][C[3]]=E;break;case 5:m[C[0]][C[1]][C[2]][C[3]][C[4]]=E;break}m.material.needsUpdate=!0};h.value.src.length>0?ln(h.value.src).then(E=>{E.offset.set(h.value.offset[0],h.value.offset[1]),E.repeat.set(h.value.repeat[0],h.value.repeat[1]),y(E)}):y(null)}},l=r=>{const{key:h,uuid:d,value:m,subitem:y}=r.value,C=n(d)?.getObjectByProperty("uuid",d);if(C!==void 0)try{y!==void 0?Pn(C,y)[h](m):C[h](m)}catch(A){console.log("Error requesting method:"),console.log(A),console.log(h),console.log(m)}};return I.addEventListener(j.GET_OBJECT,a),I.addEventListener(j.UPDATE_OBJECT,i),I.addEventListener(j.CREATE_TEXTURE,o),I.addEventListener(j.REQUEST_METHOD,l),()=>{I.removeEventListener(j.GET_OBJECT,a),I.removeEventListener(j.UPDATE_OBJECT,i),I.removeEventListener(j.CREATE_TEXTURE,o),I.removeEventListener(j.REQUEST_METHOD,l)}},[]),null}class ma extends f.Line{constructor(n,a){const t=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],i=new f.BufferGeometry;i.setAttribute("position",new f.Float32BufferAttribute(t,3)),i.computeBoundingSphere();const o=new f.LineBasicMaterial({fog:!1});super(i,o),this.light=n,this.color=a,this.type="RectAreaLightHelper";const l=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],r=new f.BufferGeometry;r.setAttribute("position",new f.Float32BufferAttribute(l,3)),r.computeBoundingSphere(),this.add(new f.Mesh(r,new f.MeshBasicMaterial({side:f.BackSide,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const n=this.material.color,a=Math.max(n.r,n.g,n.b);a>1&&n.multiplyScalar(1/a),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const Jt={type:"change"},At={type:"start"},Qt={type:"end"},bt=new f.Ray,en=new f.Plane,pa=Math.cos(70*f.MathUtils.DEG2RAD);class ga extends f.EventDispatcher{constructor(n,a){super(),this.object=n,this.domElement=a,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new f.Vector3,this.cursor=new f.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:f.MOUSE.ROTATE,MIDDLE:f.MOUSE.DOLLY,RIGHT:f.MOUSE.PAN},this.touches={ONE:f.TOUCH.ROTATE,TWO:f.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 r.phi},this.getAzimuthalAngle=function(){return r.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(c){c.addEventListener("keydown",at),this._domElementKeyEvents=c},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",at),this._domElementKeyEvents=null},this.saveState=function(){t.target0.copy(t.target),t.position0.copy(t.object.position),t.zoom0=t.object.zoom},this.reset=function(){t.target.copy(t.target0),t.object.position.copy(t.position0),t.object.zoom=t.zoom0,t.object.updateProjectionMatrix(),t.dispatchEvent(Jt),t.update(),o=i.NONE},this.update=function(){const c=new f.Vector3,x=new f.Quaternion().setFromUnitVectors(n.up,new f.Vector3(0,1,0)),P=x.clone().invert(),B=new f.Vector3,ie=new f.Quaternion,Ee=new f.Vector3,de=2*Math.PI;return function(pt=null){const gt=t.object.position;c.copy(gt).sub(t.target),c.applyQuaternion(x),r.setFromVector3(c),t.autoRotate&&o===i.NONE&&_e(et(pt)),t.enableDamping?(r.theta+=h.theta*t.dampingFactor,r.phi+=h.phi*t.dampingFactor):(r.theta+=h.theta,r.phi+=h.phi);let Se=t.minAzimuthAngle,xe=t.maxAzimuthAngle;isFinite(Se)&&isFinite(xe)&&(Se<-Math.PI?Se+=de:Se>Math.PI&&(Se-=de),xe<-Math.PI?xe+=de:xe>Math.PI&&(xe-=de),Se<=xe?r.theta=Math.max(Se,Math.min(xe,r.theta)):r.theta=r.theta>(Se+xe)/2?Math.max(Se,r.theta):Math.min(xe,r.theta)),r.phi=Math.max(t.minPolarAngle,Math.min(t.maxPolarAngle,r.phi)),r.makeSafe(),t.enableDamping===!0?t.target.addScaledVector(m,t.dampingFactor):t.target.add(m),t.target.sub(t.cursor),t.target.clampLength(t.minTargetRadius,t.maxTargetRadius),t.target.add(t.cursor);let Ge=!1;if(t.zoomToCursor&&re||t.object.isOrthographicCamera)r.radius=Ae(r.radius);else{const Re=r.radius;r.radius=Ae(r.radius*d),Ge=Re!=r.radius}if(c.setFromSpherical(r),c.applyQuaternion(P),gt.copy(t.target).add(c),t.object.lookAt(t.target),t.enableDamping===!0?(h.theta*=1-t.dampingFactor,h.phi*=1-t.dampingFactor,m.multiplyScalar(1-t.dampingFactor)):(h.set(0,0,0),m.set(0,0,0)),t.zoomToCursor&&re){let Re=null;if(t.object.isPerspectiveCamera){const Fe=c.length();Re=Ae(Fe*d);const Ke=Fe-Re;t.object.position.addScaledVector(k,Ke),t.object.updateMatrixWorld(),Ge=!!Ke}else if(t.object.isOrthographicCamera){const Fe=new f.Vector3(X.x,X.y,0);Fe.unproject(t.object);const Ke=t.object.zoom;t.object.zoom=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/d)),t.object.updateProjectionMatrix(),Ge=Ke!==t.object.zoom;const vt=new f.Vector3(X.x,X.y,0);vt.unproject(t.object),t.object.position.sub(vt).add(Fe),t.object.updateMatrixWorld(),Re=c.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),t.zoomToCursor=!1;Re!==null&&(this.screenSpacePanning?t.target.set(0,0,-1).transformDirection(t.object.matrix).multiplyScalar(Re).add(t.object.position):(bt.origin.copy(t.object.position),bt.direction.set(0,0,-1).transformDirection(t.object.matrix),Math.abs(t.object.up.dot(bt.direction))<pa?n.lookAt(t.target):(en.setFromNormalAndCoplanarPoint(t.object.up,t.target),bt.intersectPlane(en,t.target))))}else if(t.object.isOrthographicCamera){const Re=t.object.zoom;t.object.zoom=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/d)),Re!==t.object.zoom&&(t.object.updateProjectionMatrix(),Ge=!0)}return d=1,re=!1,Ge||B.distanceToSquared(t.object.position)>l||8*(1-ie.dot(t.object.quaternion))>l||Ee.distanceToSquared(t.target)>l?(t.dispatchEvent(Jt),B.copy(t.object.position),ie.copy(t.object.quaternion),Ee.copy(t.target),!0):!1}}(),this.dispose=function(){t.domElement.removeEventListener("contextmenu",qe),t.domElement.removeEventListener("pointerdown",F),t.domElement.removeEventListener("pointercancel",z),t.domElement.removeEventListener("wheel",ue),t.domElement.removeEventListener("pointermove",te),t.domElement.removeEventListener("pointerup",z),t.domElement.getRootNode().removeEventListener("keydown",nt,{capture:!0}),t._domElementKeyEvents!==null&&(t._domElementKeyEvents.removeEventListener("keydown",at),t._domElementKeyEvents=null)};const t=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=i.NONE;const l=1e-6,r=new f.Spherical,h=new f.Spherical;let d=1;const m=new f.Vector3,y=new f.Vector2,E=new f.Vector2,C=new f.Vector2,A=new f.Vector2,K=new f.Vector2,$=new f.Vector2,H=new f.Vector2,O=new f.Vector2,V=new f.Vector2,k=new f.Vector3,X=new f.Vector2;let re=!1;const w=[],ge={};let Y=!1;function et(c){return c!==null?2*Math.PI/60*t.autoRotateSpeed*c:2*Math.PI/60/60*t.autoRotateSpeed}function D(c){const x=Math.abs(c*.01);return Math.pow(.95,t.zoomSpeed*x)}function _e(c){h.theta-=c}function se(c){h.phi-=c}const ve=function(){const c=new f.Vector3;return function(P,B){c.setFromMatrixColumn(B,0),c.multiplyScalar(-P),m.add(c)}}(),we=function(){const c=new f.Vector3;return function(P,B){t.screenSpacePanning===!0?c.setFromMatrixColumn(B,1):(c.setFromMatrixColumn(B,0),c.crossVectors(t.object.up,c)),c.multiplyScalar(P),m.add(c)}}(),be=function(){const c=new f.Vector3;return function(P,B){const ie=t.domElement;if(t.object.isPerspectiveCamera){const Ee=t.object.position;c.copy(Ee).sub(t.target);let de=c.length();de*=Math.tan(t.object.fov/2*Math.PI/180),ve(2*P*de/ie.clientHeight,t.object.matrix),we(2*B*de/ie.clientHeight,t.object.matrix)}else t.object.isOrthographicCamera?(ve(P*(t.object.right-t.object.left)/t.object.zoom/ie.clientWidth,t.object.matrix),we(B*(t.object.top-t.object.bottom)/t.object.zoom/ie.clientHeight,t.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),t.enablePan=!1)}}();function Me(c){t.object.isPerspectiveCamera||t.object.isOrthographicCamera?d/=c:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1)}function Ie(c){t.object.isPerspectiveCamera||t.object.isOrthographicCamera?d*=c:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1)}function De(c,x){if(!t.zoomToCursor)return;re=!0;const P=t.domElement.getBoundingClientRect(),B=c-P.left,ie=x-P.top,Ee=P.width,de=P.height;X.x=B/Ee*2-1,X.y=-(ie/de)*2+1,k.set(X.x,X.y,1).unproject(t.object).sub(t.object.position).normalize()}function Ae(c){return Math.max(t.minDistance,Math.min(t.maxDistance,c))}function $e(c){y.set(c.clientX,c.clientY)}function je(c){De(c.clientX,c.clientX),H.set(c.clientX,c.clientY)}function ee(c){A.set(c.clientX,c.clientY)}function Oe(c){E.set(c.clientX,c.clientY),C.subVectors(E,y).multiplyScalar(t.rotateSpeed);const x=t.domElement;_e(2*Math.PI*C.x/x.clientHeight),se(2*Math.PI*C.y/x.clientHeight),y.copy(E),t.update()}function tt(c){O.set(c.clientX,c.clientY),V.subVectors(O,H),V.y>0?Me(D(V.y)):V.y<0&&Ie(D(V.y)),H.copy(O),t.update()}function ze(c){K.set(c.clientX,c.clientY),$.subVectors(K,A).multiplyScalar(t.panSpeed),be($.x,$.y),A.copy(K),t.update()}function fe(c){De(c.clientX,c.clientY),c.deltaY<0?Ie(D(c.deltaY)):c.deltaY>0&&Me(D(c.deltaY)),t.update()}function p(c){let x=!1;switch(c.code){case t.keys.UP:c.ctrlKey||c.metaKey||c.shiftKey?se(2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):be(0,t.keyPanSpeed),x=!0;break;case t.keys.BOTTOM:c.ctrlKey||c.metaKey||c.shiftKey?se(-2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):be(0,-t.keyPanSpeed),x=!0;break;case t.keys.LEFT:c.ctrlKey||c.metaKey||c.shiftKey?_e(2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):be(t.keyPanSpeed,0),x=!0;break;case t.keys.RIGHT:c.ctrlKey||c.metaKey||c.shiftKey?_e(-2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):be(-t.keyPanSpeed,0),x=!0;break}x&&(c.preventDefault(),t.update())}function v(c){if(w.length===1)y.set(c.pageX,c.pageY);else{const x=Le(c),P=.5*(c.pageX+x.x),B=.5*(c.pageY+x.y);y.set(P,B)}}function T(c){if(w.length===1)A.set(c.pageX,c.pageY);else{const x=Le(c),P=.5*(c.pageX+x.x),B=.5*(c.pageY+x.y);A.set(P,B)}}function L(c){const x=Le(c),P=c.pageX-x.x,B=c.pageY-x.y,ie=Math.sqrt(P*P+B*B);H.set(0,ie)}function me(c){t.enableZoom&&L(c),t.enablePan&&T(c)}function le(c){t.enableZoom&&L(c),t.enableRotate&&v(c)}function R(c){if(w.length==1)E.set(c.pageX,c.pageY);else{const P=Le(c),B=.5*(c.pageX+P.x),ie=.5*(c.pageY+P.y);E.set(B,ie)}C.subVectors(E,y).multiplyScalar(t.rotateSpeed);const x=t.domElement;_e(2*Math.PI*C.x/x.clientHeight),se(2*Math.PI*C.y/x.clientHeight),y.copy(E)}function M(c){if(w.length===1)K.set(c.pageX,c.pageY);else{const x=Le(c),P=.5*(c.pageX+x.x),B=.5*(c.pageY+x.y);K.set(P,B)}$.subVectors(K,A).multiplyScalar(t.panSpeed),be($.x,$.y),A.copy(K)}function W(c){const x=Le(c),P=c.pageX-x.x,B=c.pageY-x.y,ie=Math.sqrt(P*P+B*B);O.set(0,ie),V.set(0,Math.pow(O.y/H.y,t.zoomSpeed)),Me(V.y),H.copy(O);const Ee=(c.pageX+x.x)*.5,de=(c.pageY+x.y)*.5;De(Ee,de)}function ae(c){t.enableZoom&&W(c),t.enablePan&&M(c)}function ye(c){t.enableZoom&&W(c),t.enableRotate&&R(c)}function F(c){t.enabled!==!1&&(w.length===0&&(t.domElement.setPointerCapture(c.pointerId),t.domElement.addEventListener("pointermove",te),t.domElement.addEventListener("pointerup",z)),!kt(c)&&(Tt(c),c.pointerType==="touch"?it(c):ke(c)))}function te(c){t.enabled!==!1&&(c.pointerType==="touch"?ft(c):ce(c))}function z(c){switch(_t(c),w.length){case 0:t.domElement.releasePointerCapture(c.pointerId),t.domElement.removeEventListener("pointermove",te),t.domElement.removeEventListener("pointerup",z),t.dispatchEvent(Qt),o=i.NONE;break;case 1:const x=w[0],P=ge[x];it({pointerId:x,pageX:P.x,pageY:P.y});break}}function ke(c){let x;switch(c.button){case 0:x=t.mouseButtons.LEFT;break;case 1:x=t.mouseButtons.MIDDLE;break;case 2:x=t.mouseButtons.RIGHT;break;default:x=-1}switch(x){case f.MOUSE.DOLLY:if(t.enableZoom===!1)return;je(c),o=i.DOLLY;break;case f.MOUSE.ROTATE:if(c.ctrlKey||c.metaKey||c.shiftKey){if(t.enablePan===!1)return;ee(c),o=i.PAN}else{if(t.enableRotate===!1)return;$e(c),o=i.ROTATE}break;case f.MOUSE.PAN:if(c.ctrlKey||c.metaKey||c.shiftKey){if(t.enableRotate===!1)return;$e(c),o=i.ROTATE}else{if(t.enablePan===!1)return;ee(c),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&t.dispatchEvent(At)}function ce(c){switch(o){case i.ROTATE:if(t.enableRotate===!1)return;Oe(c);break;case i.DOLLY:if(t.enableZoom===!1)return;tt(c);break;case i.PAN:if(t.enablePan===!1)return;ze(c);break}}function ue(c){t.enabled===!1||t.enableZoom===!1||o!==i.NONE||(c.preventDefault(),t.dispatchEvent(At),fe(ht(c)),t.dispatchEvent(Qt))}function ht(c){const x=c.deltaMode,P={clientX:c.clientX,clientY:c.clientY,deltaY:c.deltaY};switch(x){case 1:P.deltaY*=16;break;case 2:P.deltaY*=100;break}return c.ctrlKey&&!Y&&(P.deltaY*=10),P}function nt(c){c.key==="Control"&&(Y=!0,t.domElement.getRootNode().addEventListener("keyup",Ne,{passive:!0,capture:!0}))}function Ne(c){c.key==="Control"&&(Y=!1,t.domElement.getRootNode().removeEventListener("keyup",Ne,{passive:!0,capture:!0}))}function at(c){t.enabled===!1||t.enablePan===!1||p(c)}function it(c){switch(mt(c),w.length){case 1:switch(t.touches.ONE){case f.TOUCH.ROTATE:if(t.enableRotate===!1)return;v(c),o=i.TOUCH_ROTATE;break;case f.TOUCH.PAN:if(t.enablePan===!1)return;T(c),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(t.touches.TWO){case f.TOUCH.DOLLY_PAN:if(t.enableZoom===!1&&t.enablePan===!1)return;me(c),o=i.TOUCH_DOLLY_PAN;break;case f.TOUCH.DOLLY_ROTATE:if(t.enableZoom===!1&&t.enableRotate===!1)return;le(c),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&t.dispatchEvent(At)}function ft(c){switch(mt(c),o){case i.TOUCH_ROTATE:if(t.enableRotate===!1)return;R(c),t.update();break;case i.TOUCH_PAN:if(t.enablePan===!1)return;M(c),t.update();break;case i.TOUCH_DOLLY_PAN:if(t.enableZoom===!1&&t.enablePan===!1)return;ae(c),t.update();break;case i.TOUCH_DOLLY_ROTATE:if(t.enableZoom===!1&&t.enableRotate===!1)return;ye(c),t.update();break;default:o=i.NONE}}function qe(c){t.enabled!==!1&&c.preventDefault()}function Tt(c){w.push(c.pointerId)}function _t(c){delete ge[c.pointerId];for(let x=0;x<w.length;x++)if(w[x]==c.pointerId){w.splice(x,1);return}}function kt(c){for(let x=0;x<w.length;x++)if(w[x]==c.pointerId)return!0;return!1}function mt(c){let x=ge[c.pointerId];x===void 0&&(x=new f.Vector2,ge[c.pointerId]=x),x.set(c.pageX,c.pageY)}function Le(c){const x=c.pointerId===w[0]?w[1]:w[0];return ge[x]}t.domElement.addEventListener("contextmenu",qe),t.domElement.addEventListener("pointerdown",F),t.domElement.addEventListener("pointercancel",z),t.domElement.addEventListener("wheel",ue,{passive:!1}),t.domElement.getRootNode().addEventListener("keydown",nt,{passive:!0,capture:!0}),this.update()}}function Je(e,n,a,t,i){return t+(e-n)*(i-t)/(a-n)}const Ct=e=>{const[n,a]=b.useState(e.options[e.index]),t=()=>{e.onToggle(!e.open)},i=o=>{o!==n&&(e.onSelect(o),a(o)),e.onToggle(!1)};return u.jsxs("div",{className:`dropdown ${e.up===!0?"up":""}`,children:[u.jsx("div",{className:"dropdown-toggle",onClick:t,children:n}),e.open&&u.jsx("ul",{className:"dropdown-menu",children:e.options.map(o=>u.jsx("li",{onClick:()=>i(o),children:o},o))})]})},He=b.forwardRef(function(n,a){const t=["Renderer","Depth","Normals","UVs","Wireframe"],[i,o]=b.useState("Renderer"),[l,r]=b.useState(!1),[h,d]=b.useState(!1),[m,y]=b.useState(!1);return u.jsxs("div",{className:"CameraWindow",children:[u.jsx("div",{ref:a,className:"clickable",onClick:()=>{m&&y(!1)}}),u.jsx(Ct,{index:t.indexOf(i),open:h,options:t,onSelect:E=>{if(E===i)return;const C=E;n.onSelectRenderMode(C),o(C)},onToggle:E=>{l&&r(!1),d(E)},up:!0}),u.jsx(Ct,{index:n.options.indexOf(n.camera.name),open:m,options:n.options,onSelect:n.onSelectCamera,onToggle:E=>{y(E)},up:!0})]})});class va extends f.ShaderMaterial{constructor(n){super({extensions:{derivatives:!0},glslVersion:f.GLSL3,side:f.DoubleSide,transparent:!0,uniforms:{uScale:{value:n?.scale!==void 0?n?.scale:.1},uDivisions:{value:n?.divisions!==void 0?n?.divisions:10},uColor:{value:n?.color!==void 0?n?.color:new f.Color(16777215)},uDistance:{value:n?.distance!==void 0?n?.distance:1e4},uSubgridOpacity:{value:n?.subgridOpacity!==void 0?n?.subgridOpacity:.15},uGridOpacity:{value:n?.gridOpacity!==void 0?n?.gridOpacity:.25}},vertexShader:`out vec3 worldPosition;
|
31
31
|
uniform float uDistance;
|
32
32
|
|
33
33
|
void main() {
|
@@ -103,7 +103,7 @@ C11,8.22,10.74,8,10.43,8z`})});function on(e){return l.jsx(en.Reorder.Item,{valu
|
|
103
103
|
fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity, nextGrid);
|
104
104
|
|
105
105
|
if (fragColor.a <= 0.0) discard;
|
106
|
-
}`,name:"InfiniteGrid",depthWrite:!1})}}class
|
106
|
+
}`,name:"InfiniteGrid",depthWrite:!1})}}class ba extends f.Mesh{gridMaterial;constructor(){const n=new va;super(new f.PlaneGeometry(2,2),n),this.gridMaterial=n,this.frustumCulled=!1,this.name="InfiniteGridHelper",this.position.y=.1}update(){this.gridMaterial.needsUpdate=!0}}const ya=`#include <common>
|
107
107
|
#include <batching_pars_vertex>
|
108
108
|
#include <uv_pars_vertex>
|
109
109
|
#include <color_pars_vertex>
|
@@ -133,7 +133,7 @@ void main() {
|
|
133
133
|
#include <logdepthbuf_vertex>
|
134
134
|
#include <clipping_planes_vertex>
|
135
135
|
#include <worldpos_vertex>
|
136
|
-
}`,
|
136
|
+
}`,Ea=`
|
137
137
|
#include <common>
|
138
138
|
#include <uv_pars_fragment>
|
139
139
|
#include <clipping_planes_pars_fragment>
|
@@ -141,4 +141,4 @@ void main() {
|
|
141
141
|
void main() {
|
142
142
|
#include <clipping_planes_fragment>
|
143
143
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
144
|
-
}`;class ba extends f.ShaderMaterial{constructor(){super({defines:{USE_UV:""},vertexShader:ga,fragmentShader:va})}}let bt="Renderer",we,At=!1,X=null,oe=null,ze=null,Ge=null;function ya(e){const n=e.three.app.appID,a=localStorage.getItem(`${n}_mode`),t=localStorage.getItem(`${n}_tlCam`)!==null?localStorage.getItem(`${n}_tlCam`):"Debug",i=localStorage.getItem(`${n}_trCam`)!==null?localStorage.getItem(`${n}_trCam`):"Orthographic",c=localStorage.getItem(`${n}_blCam`)!==null?localStorage.getItem(`${n}_blCam`):"Front",u=localStorage.getItem(`${n}_brCam`)!==null?localStorage.getItem(`${n}_brCam`):"Top",r=E.useMemo(()=>new Map,[]),h=E.useMemo(()=>new Map,[]),d=E.useMemo(()=>new Map,[]),m=E.useMemo(()=>new Map,[]),p=E.useMemo(()=>new f.Scene,[]),b=E.useMemo(()=>new f.Group,[]),C=E.useMemo(()=>new pa,[]),D=E.useMemo(()=>new f.AxesHelper(500),[]),q=E.useMemo(()=>new f.AxesHelper(100),[]),z=E.useMemo(()=>new f.MeshDepthMaterial,[]),G=E.useMemo(()=>new f.MeshNormalMaterial,[]),M=E.useMemo(()=>new ba,[]),K=E.useMemo(()=>new f.MeshBasicMaterial({opacity:.33,transparent:!0,wireframe:!0}),[]);function R(v,y){const T=new f.OrthographicCamera(-100,100,100,-100,50,5e3);return T.name=v,T.position.copy(y),T.lookAt(0,0,0),r.set(v,T),T}const Z=["Renderer","Depth","Normals","UVs","Wireframe"],ce=["Single","Side by Side","Stacked","Quad"],W=E.useRef(null),me=E.useRef(null),ie=E.useRef(null),Me=E.useRef(null),Oe=E.useRef(null),ge=E.useRef(null),[B,ve]=E.useState(a!==null?a:"Single"),[k,xe]=E.useState(null),[Re,De]=E.useState(!1),[Te,_e]=E.useState(!1),[ke,$e]=E.useState("Orbit"),[Ae,We]=E.useState(!1),[nt,Pe]=E.useState(Date.now());localStorage.setItem(`${n}_mode`,B),localStorage.setItem(`${n}_tlCam`,t),localStorage.setItem(`${n}_trCam`,i),localStorage.setItem(`${n}_blCam`,c),localStorage.setItem(`${n}_brCam`,u);const ne=(v,y)=>{const T=h.get(v.name);if(T!==void 0&&T.dispose(),h.delete(v.name),v.name==="UI")return;const N=new fa(v,y);switch(N.enableDamping=!0,N.dampingFactor=.05,v.name){case"Top":case"Bottom":case"Left":case"Right":case"Front":case"Back":N.enableRotate=!1;break}h.set(v.name,N)},he=v=>{const y=d.get(v.name);y!==void 0&&(p.remove(y),y.dispose(),d.delete(v.name));const T=h.get(v.name);T!==void 0&&(T.dispose(),h.delete(v.name))},Ne=()=>{h.forEach((v,y)=>{v.dispose();const T=d.get(y);T!==void 0&&(p.remove(T),T.dispose()),d.delete(y),h.delete(y)}),h.clear(),d.clear()},je=()=>{switch(B){case"Single":ne(X,ie.current);break;case"Side by Side":case"Stacked":ne(X,ie.current),ne(oe,Me.current);break;case"Quad":ne(X,ie.current),ne(oe,Me.current),ne(ze,Oe.current),ne(Ge,ge.current);break}};E.useEffect(()=>{const v=new f.WebGLRenderer({canvas:W.current,stencil:!1});v.autoClear=!1,v.shadowMap.enabled=!0,v.setPixelRatio(devicePixelRatio),v.setClearColor(0),e.three.renderer=v,xe(v)},[]),E.useEffect(()=>{p.name="Debug Scene",p.uuid="",b.name="helpers",p.add(b),b.add(C),D.name="axisHelper",b.add(D),q.name="interactionHelper",b.add(q),q.visible=!1,R("Top",new f.Vector3(0,1e3,0)),R("Bottom",new f.Vector3(0,-1e3,0)),R("Left",new f.Vector3(-1e3,0,0)),R("Right",new f.Vector3(1e3,0,0)),R("Front",new f.Vector3(0,0,1e3)),R("Back",new f.Vector3(0,0,-1e3)),R("Orthographic",new f.Vector3(1e3,1e3,1e3)),R("UI",new f.Vector3);const v=new f.PerspectiveCamera(60,1,50,5e3);v.name="Debug",v.position.set(500,500,500),v.lookAt(0,0,0),r.set("Debug",v),X=r.get(localStorage.getItem(`${n}_tlCam`)),oe=r.get(localStorage.getItem(`${n}_trCam`)),ze=r.get(localStorage.getItem(`${n}_blCam`)),Ge=r.get(localStorage.getItem(`${n}_brCam`))},[]),E.useEffect(()=>{const v=()=>{m.forEach(_=>{b.remove(_),_.dispose()}),m.clear()},y=()=>{we.traverse(_=>{if(_.type.search("Light")>-1){let w;switch(_.type){case"DirectionalLight":w=new f.DirectionalLightHelper(_,100),w.name=`${_.name}Helper`,m.set(_.name,w),b.add(w);break;case"HemisphereLight":w=new f.HemisphereLightHelper(_,250),w.name=`${_.name}Helper`,m.set(_.name,w),b.add(w);break;case"RectAreaLight":w=new da(_),w.name=`${_.name}Helper`,m.set(_.name,w),b.add(w);break;case"PointLight":w=new f.PointLightHelper(_,100),w.name=`${_.name}Helper`,m.set(_.name,w),b.add(w);break;case"SpotLight":w=new f.SpotLightHelper(_),w.name=`${_.name}Helper`,m.set(_.name,w),b.add(w);break}}})},T=_=>{b.add(D),v(),ut(we),p.remove(we);const w=e.scenes.get(_.value.name);if(w!==void 0){const H=new w;e.onSceneSet!==void 0&&e.onSceneSet(H),we=H,e.three.scene=we,p.add(we),At=!0,y()}},N=_=>{const w=_.value,H=e.three.scene?.getObjectByProperty("uuid",w.uuid);if(H!==void 0&&r.set(w.name,H),H instanceof f.PerspectiveCamera){const J=new f.CameraHelper(H);d.set(H.name,J),p.add(J)}Pe(Date.now())},se=_=>{const w=d.get(_.value.name);w!==void 0&&(p.remove(w),w.dispose()),r.delete(_.value.name),Pe(Date.now())},le=_=>{const w=we.getObjectByProperty("uuid",_.value.uuid);w&&w.add(D)};return j.addEventListener(I.SET_SCENE,T),j.addEventListener(I.ADD_CAMERA,N),j.addEventListener(I.REMOVE_CAMERA,se),j.addEventListener(I.SET_OBJECT,le),()=>{j.removeEventListener(I.SET_SCENE,T),j.removeEventListener(I.ADD_CAMERA,N),j.removeEventListener(I.REMOVE_CAMERA,se),j.removeEventListener(I.SET_OBJECT,le)}},[]),E.useEffect(()=>{if(k===null)return;let v=window.innerWidth,y=window.innerHeight,T=Math.floor(v/2),N=Math.floor(y/2),se=-1;const le=()=>{v=window.innerWidth-300,y=window.innerHeight,T=Math.floor(v/2),N=Math.floor(y/2),e.three.resize(v,y),e.onSceneResize!==void 0&&At&&e.onSceneResize(we,v,y);let A=v,Y=y;switch(B){case"Side by Side":A=T,Y=y;break;case"Stacked":A=v,Y=N;break;case"Quad":A=T,Y=N;break}r.forEach(Q=>{Q instanceof f.OrthographicCamera?(Q.left=A/-2,Q.right=A/2,Q.top=Y/2,Q.bottom=Y/-2,Q.name==="UI"&&(Q.position.x=v/2,Q.position.y=y/-2,Q.position.z=100),Q.updateProjectionMatrix()):Q instanceof f.PerspectiveCamera&&(Q.aspect=A/Y,Q.updateProjectionMatrix(),d.get(Q.name)?.update())})},_=()=>{k.setViewport(0,0,v,y),k.setScissor(0,0,v,y),k.render(p,X)},w=()=>{if(B==="Side by Side")k.setViewport(0,0,T,y),k.setScissor(0,0,T,y),k.render(p,X),k.setViewport(T,0,T,y),k.setScissor(T,0,T,y),k.render(p,oe);else{const A=y-N;k.setViewport(0,A,v,N),k.setScissor(0,A,v,N),k.render(p,X),k.setViewport(0,0,v,N),k.setScissor(0,0,v,N),k.render(p,oe)}},H=()=>{let A=0,Y=0;Y=y-N,A=0,k.setViewport(A,Y,T,N),k.setScissor(A,Y,T,N),k.render(p,X),A=T,k.setViewport(A,Y,T,N),k.setScissor(A,Y,T,N),k.render(p,oe),Y=0,A=0,k.setViewport(A,Y,T,N),k.setScissor(A,Y,T,N),k.render(p,ze),A=T,k.setViewport(A,Y,T,N),k.setScissor(A,Y,T,N),k.render(p,Ge)},J=()=>{switch(h.forEach(A=>{A.update()}),d.forEach(A=>{A.update()}),m.forEach(A=>{A.update!==void 0&&A.update()}),e.onSceneUpdate!==void 0&&At&&e.onSceneUpdate(we),k.clear(),B){case"Single":_();break;case"Side by Side":case"Stacked":w();break;case"Quad":H();break}se=requestAnimationFrame(J)};return je(),window.addEventListener("resize",le),le(),J(),()=>{window.removeEventListener("resize",le),cancelAnimationFrame(se),se=-1}},[B,k]),E.useEffect(()=>{if(k!==null){const v=new f.Raycaster,y=new f.Vector2,T=(_,w,H,J)=>{switch(B){case"Quad":_<H?w<J?v.setFromCamera(y,X):v.setFromCamera(y,ze):w<J?v.setFromCamera(y,oe):v.setFromCamera(y,Ge);break;case"Side by Side":_<H?v.setFromCamera(y,X):v.setFromCamera(y,oe);break;case"Single":v.setFromCamera(y,X);break;case"Stacked":w<J?v.setFromCamera(y,X):v.setFromCamera(y,oe);break}},N=_=>{if(ke==="Orbit")return;const w=new f.Vector2;k.getSize(w);const H=Math.min(_.clientX,w.x),J=Math.min(_.clientY,w.y);y.x=tt(H,0,w.x,-1,1),y.y=tt(J,0,w.y,1,-1);const A=w.x/2,Y=w.y/2,Q=()=>{H<A?y.x=tt(H,0,A,-1,1):y.x=tt(H,A,w.x,-1,1)},Le=()=>{J<Y?y.y=tt(J,0,Y,1,-1):y.y=tt(J,Y,w.y,1,-1)};switch(B){case"Quad":Q(),Le();break;case"Side by Side":Q();break;case"Stacked":Le(),Le();break}T(H,J,A,Y);const Fe=v.intersectObjects(we.children);Fe.length>0&&q.position.copy(Fe[0].point)},se=_=>{if(ke==="Orbit")return;const w=new f.Vector2;if(k.getSize(w),_.clientX>=w.x)return;N(_);const H=v.intersectObjects(we.children);H.length>0&&(e.three.getObject(H[0].object.uuid),q.visible=!1,$e("Orbit"),Pe(Date.now()))},le=me.current;return le.addEventListener("mousemove",N,!1),le.addEventListener("click",se,!1),()=>{le.removeEventListener("mousemove",N),le.removeEventListener("click",se)}}},[B,k,ke]);const pe=[];return r.forEach((v,y)=>{pe.push(y)}),l.jsxs("div",{className:"multiview",children:[l.jsx("canvas",{ref:W}),k!==null&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`cameras ${B==="Single"||B==="Stacked"?"single":""}`,ref:me,children:[B==="Single"&&l.jsx(l.Fragment,{children:l.jsx(qe,{camera:X,options:pe,ref:ie,onSelect:v=>{h.get(X.name)?.dispose();const y=r.get(v);y!==void 0&&(he(X),X=y,localStorage.setItem(`${n}_tlCam`,y.name),ne(y,ie.current))}})}),(B==="Side by Side"||B==="Stacked")&&l.jsxs(l.Fragment,{children:[l.jsx(qe,{camera:X,options:pe,ref:ie,onSelect:v=>{h.get(X.name)?.dispose();const y=r.get(v);y!==void 0&&(he(X),X=y,localStorage.setItem(`${n}_tlCam`,y.name),ne(y,ie.current))}}),l.jsx(qe,{camera:oe,options:pe,ref:Me,onSelect:v=>{h.get(oe.name)?.dispose();const y=r.get(v);y!==void 0&&(he(oe),oe=y,localStorage.setItem(`${n}_trCam`,y.name),ne(y,Me.current))}})]}),B==="Quad"&&l.jsxs(l.Fragment,{children:[l.jsx(qe,{camera:X,options:pe,ref:ie,onSelect:v=>{h.get(X.name)?.dispose();const y=r.get(v);y!==void 0&&(he(X),X=y,localStorage.setItem(`${n}_tlCam`,y.name),ne(y,ie.current))}}),l.jsx(qe,{camera:oe,options:pe,ref:Me,onSelect:v=>{h.get(oe.name)?.dispose();const y=r.get(v);y!==void 0&&(he(oe),oe=y,localStorage.setItem(`${n}_trCam`,y.name),ne(y,Me.current))}}),l.jsx(qe,{camera:ze,options:pe,ref:Oe,onSelect:v=>{h.get(ze.name)?.dispose();const y=r.get(v);y!==void 0&&(he(ze),ze=y,localStorage.setItem(`${n}_blCam`,y.name),ne(y,Oe.current))}}),l.jsx(qe,{camera:Ge,options:pe,ref:ge,onSelect:v=>{h.get(Ge.name)?.dispose();const y=r.get(v);y!==void 0&&(he(Ge),Ge=y,localStorage.setItem(`${n}_brCam`,y.name),ne(y,ge.current))}})]})]}),l.jsxs("div",{className:"settings",children:[l.jsx(St,{index:ce.indexOf(B),options:ce,onSelect:v=>{v!==B&&(Ne(),ve(v))},open:Re,onToggle:v=>{De(v),Te&&_e(!1),Ae&&We(!1)}}),l.jsx(St,{index:Z.indexOf(bt),options:Z,onSelect:v=>{if(v!==bt)switch(bt=v,bt){case"Depth":p.overrideMaterial=z;break;case"Normals":p.overrideMaterial=G;break;default:case"Renderer":p.overrideMaterial=null;break;case"Wireframe":p.overrideMaterial=K;break;case"UVs":p.overrideMaterial=M;break}},open:Te,onToggle:v=>{Re&&De(!1),_e(v),Ae&&We(!1)}}),l.jsx(St,{index:ke==="Orbit"?0:1,options:["Orbit Mode","Selection Mode"],onSelect:v=>{q.visible=v==="Selection Mode",$e(q.visible?"Selection":"Orbit")},open:Ae,onToggle:v=>{Re&&De(!1),Te&&_e(!1),We(v)}})]},nt)]})]})}function Ea(e){return l.jsxs("div",{className:"editor",ref:e.ref,style:e.style,children:[l.jsx("div",{className:"header",children:e.header}),e.children,l.jsx("div",{className:"footer",children:e.footer})]})}exports.Accordion=Mt;exports.Application=wn;exports.BaseRemote=dt;exports.ChildObject=Bt;exports.ContainerObject=dn;exports.Draggable=cn;exports.DraggableItem=on;exports.Dropdown=ln;exports.DropdownItem=un;exports.Editor=Ea;exports.Inspector=mn;exports.MultiView=ya;exports.NavButton=Ut;exports.RemoteComponents=Mn;exports.RemoteController=Fn;exports.RemoteTheatre=wt;exports.RemoteThree=An;exports.RemoteTweakpane=Pn;exports.SceneInspector=ua;exports.SidePanel=la;exports.ToolEvents=I;exports.capitalize=lt;exports.clamp=He;exports.colorToHex=an;exports.debugDispatcher=j;exports.defaultTheatreCallback=Sn;exports.dispose=ut;exports.disposeMaterial=rn;exports.disposeTexture=Cn;exports.distance=xn;exports.hierarchyUUID=xt;exports.isColor=nn;exports.mix=jt;exports.noop=Ct;exports.normalize=Pt;exports.randomID=tn;exports.resetThreeObjects=Nt;exports.round=It;exports.theatreEditorApp=On;
|
144
|
+
}`;class Sa extends f.ShaderMaterial{constructor(){super({defines:{USE_UV:""},vertexShader:ya,fragmentShader:Ea})}}let Te,Pt=!1,Z=null,oe=null,Ue=null,Be=null,Qe="Renderer",yt="Renderer",tn="Renderer",nn="Renderer";function xa(e){const n=e.three.app.appID,a=b.useMemo(()=>new Map,[]),t=b.useMemo(()=>new Map,[]),i=b.useMemo(()=>new Map,[]),o=b.useMemo(()=>new Map,[]),l=b.useMemo(()=>new f.Scene,[]),r=b.useMemo(()=>new f.Group,[]),h=b.useMemo(()=>new ba,[]),d=b.useMemo(()=>new f.AxesHelper(500),[]),m=b.useMemo(()=>new f.AxesHelper(100),[]),y=b.useMemo(()=>new f.MeshDepthMaterial,[]),E=b.useMemo(()=>new f.MeshNormalMaterial,[]),C=b.useMemo(()=>new Sa,[]),A=b.useMemo(()=>new f.MeshBasicMaterial({opacity:.33,transparent:!0,wireframe:!0}),[]);function K(p,v){const T=new f.OrthographicCamera(-100,100,100,-100,50,5e3);return T.name=p,T.position.copy(v),T.lookAt(0,0,0),a.set(p,T),T}const $=["Single","Side by Side","Stacked","Quad"],H=b.useRef(null),O=b.useRef(null),V=b.useRef(null),k=b.useRef(null),X=b.useRef(null),re=b.useRef(null),w=localStorage,ge=w.getItem(`${n}_mode`),[Y,et]=b.useState(ge!==null?ge:"Single"),[D,_e]=b.useState(null),[se,ve]=b.useState(!1),[we,be]=b.useState(!1),[Me,Ie]=b.useState("Orbit"),[De,Ae]=b.useState(!1),[$e,je]=b.useState(Date.now());w.setItem(`${n}_mode`,Y),w.setItem(`${n}_tlCam`,w.getItem(`${n}_tlCam`)!==null?w.getItem(`${n}_tlCam`):"Debug"),w.setItem(`${n}_trCam`,w.getItem(`${n}_trCam`)!==null?w.getItem(`${n}_trCam`):"Orthographic"),w.setItem(`${n}_blCam`,w.getItem(`${n}_blCam`)!==null?w.getItem(`${n}_blCam`):"Front"),w.setItem(`${n}_brCam`,w.getItem(`${n}_brCam`)!==null?w.getItem(`${n}_brCam`):"Top"),w.setItem(`${n}_tlRender`,w.getItem(`${n}_tlRender`)!==null?w.getItem(`${n}_tlRender`):"Renderer"),w.setItem(`${n}_trRender`,w.getItem(`${n}_trRender`)!==null?w.getItem(`${n}_trRender`):"Renderer"),w.setItem(`${n}_blRender`,w.getItem(`${n}_blRender`)!==null?w.getItem(`${n}_blRender`):"Renderer"),w.setItem(`${n}_brRender`,w.getItem(`${n}_brRender`)!==null?w.getItem(`${n}_brRender`):"Renderer");const ee=(p,v)=>{const T=t.get(p.name);if(T!==void 0&&T.dispose(),t.delete(p.name),p.name==="UI")return;const L=new ga(p,v);switch(L.enableDamping=!0,L.dampingFactor=.05,p.name){case"Top":case"Bottom":case"Left":case"Right":case"Front":case"Back":L.enableRotate=!1;break}t.set(p.name,L)},Oe=p=>{const v=i.get(p.name);v!==void 0&&(l.remove(v),v.dispose(),i.delete(p.name));const T=t.get(p.name);T!==void 0&&(T.dispose(),t.delete(p.name))},tt=()=>{t.forEach((p,v)=>{p.dispose();const T=i.get(v);T!==void 0&&(l.remove(T),T.dispose()),i.delete(v),t.delete(v)}),t.clear(),i.clear()},ze=()=>{switch(Y){case"Single":ee(Z,V.current);break;case"Side by Side":case"Stacked":ee(Z,V.current),ee(oe,k.current);break;case"Quad":ee(Z,V.current),ee(oe,k.current),ee(Ue,X.current),ee(Be,re.current);break}};b.useEffect(()=>{const p=new f.WebGLRenderer({canvas:H.current,stencil:!1});p.autoClear=!1,p.shadowMap.enabled=!0,p.setPixelRatio(devicePixelRatio),p.setClearColor(0),e.three.renderer=p,_e(p)},[]),b.useEffect(()=>{l.name="Debug Scene",l.uuid="",r.name="helpers",l.add(r),r.add(h),d.name="axisHelper",r.add(d),m.name="interactionHelper",r.add(m),m.visible=!1,K("Top",new f.Vector3(0,1e3,0)),K("Bottom",new f.Vector3(0,-1e3,0)),K("Left",new f.Vector3(-1e3,0,0)),K("Right",new f.Vector3(1e3,0,0)),K("Front",new f.Vector3(0,0,1e3)),K("Back",new f.Vector3(0,0,-1e3)),K("Orthographic",new f.Vector3(1e3,1e3,1e3)),K("UI",new f.Vector3);const p=new f.PerspectiveCamera(60,1,50,5e3);p.name="Debug",p.position.set(500,500,500),p.lookAt(0,0,0),a.set("Debug",p),Z=a.get(w.getItem(`${n}_tlCam`)),oe=a.get(w.getItem(`${n}_trCam`)),Ue=a.get(w.getItem(`${n}_blCam`)),Be=a.get(w.getItem(`${n}_brCam`))},[]),b.useEffect(()=>{const p=()=>{o.forEach(R=>{r.remove(R),R.dispose()}),o.clear()},v=()=>{Te.traverse(R=>{if(R.type.search("Light")>-1){let M;switch(R.type){case"DirectionalLight":M=new f.DirectionalLightHelper(R,100),M.name=`${R.name}Helper`,o.set(R.name,M),r.add(M);break;case"HemisphereLight":M=new f.HemisphereLightHelper(R,250),M.name=`${R.name}Helper`,o.set(R.name,M),r.add(M);break;case"RectAreaLight":M=new ma(R),M.name=`${R.name}Helper`,o.set(R.name,M),r.add(M);break;case"PointLight":M=new f.PointLightHelper(R,100),M.name=`${R.name}Helper`,o.set(R.name,M),r.add(M);break;case"SpotLight":M=new f.SpotLightHelper(R),M.name=`${R.name}Helper`,o.set(R.name,M),r.add(M);break}}})},T=R=>{r.add(d),p(),ut(Te),l.remove(Te);const M=e.scenes.get(R.value.name);if(M!==void 0){const W=new M;e.onSceneSet!==void 0&&e.onSceneSet(W),Te=W,e.three.scene=Te,l.add(Te),Pt=!0,v()}},L=R=>{const M=R.value,W=e.three.scene?.getObjectByProperty("uuid",M.uuid);if(W!==void 0&&a.set(M.name,W),W instanceof f.PerspectiveCamera){const ae=new f.CameraHelper(W);i.set(W.name,ae),l.add(ae)}je(Date.now())},me=R=>{const M=i.get(R.value.name);M!==void 0&&(l.remove(M),M.dispose()),a.delete(R.value.name),je(Date.now())},le=R=>{const M=Te.getObjectByProperty("uuid",R.value.uuid);M&&M.add(d)};return I.addEventListener(j.SET_SCENE,T),I.addEventListener(j.ADD_CAMERA,L),I.addEventListener(j.REMOVE_CAMERA,me),I.addEventListener(j.SET_OBJECT,le),()=>{I.removeEventListener(j.SET_SCENE,T),I.removeEventListener(j.ADD_CAMERA,L),I.removeEventListener(j.REMOVE_CAMERA,me),I.removeEventListener(j.SET_OBJECT,le)}},[]),b.useEffect(()=>{if(D===null)return;let p=window.innerWidth,v=window.innerHeight,T=Math.floor(p/2),L=Math.floor(v/2),me=-1;const le=()=>{p=window.innerWidth-300,v=window.innerHeight,T=Math.floor(p/2),L=Math.floor(v/2),e.three.resize(p,v),e.onSceneResize!==void 0&&Pt&&e.onSceneResize(Te,p,v);let F=p,te=v;switch(Y){case"Side by Side":F=T,te=v;break;case"Stacked":F=p,te=L;break;case"Quad":F=T,te=L;break}a.forEach(z=>{z instanceof f.OrthographicCamera?(z.left=F/-2,z.right=F/2,z.top=te/2,z.bottom=te/-2,z.name==="UI"&&(z.position.x=p/2,z.position.y=v/-2,z.position.z=100),z.updateProjectionMatrix()):z instanceof f.PerspectiveCamera&&(z.aspect=F/te,z.updateProjectionMatrix(),i.get(z.name)?.update())})};function R(F){switch(F){case"Depth":return y;case"Normals":return E;case"Renderer":return null;case"UVs":return C;case"Wireframe":return A}return null}const M=()=>{const F=R(Qe);l.overrideMaterial=F,D.setViewport(0,0,p,v),D.setScissor(0,0,p,v),D.render(l,Z)},W=()=>{const F=R(Qe),te=R(yt);if(l.overrideMaterial=F,Y==="Side by Side")D.setViewport(0,0,T,v),D.setScissor(0,0,T,v),D.render(l,Z),l.overrideMaterial=te,D.setViewport(T,0,T,v),D.setScissor(T,0,T,v),D.render(l,oe);else{const z=v-L;D.setViewport(0,z,p,L),D.setScissor(0,z,p,L),D.render(l,Z),l.overrideMaterial=te,D.setViewport(0,0,p,L),D.setScissor(0,0,p,L),D.render(l,oe)}},ae=()=>{const F=R(Qe),te=R(yt),z=R(tn),ke=R(nn);let ce=0,ue=0;ue=v-L,ce=0,l.overrideMaterial=F,D.setViewport(ce,ue,T,L),D.setScissor(ce,ue,T,L),D.render(l,Z),ce=T,l.overrideMaterial=te,D.setViewport(ce,ue,T,L),D.setScissor(ce,ue,T,L),D.render(l,oe),ue=0,ce=0,l.overrideMaterial=z,D.setViewport(ce,ue,T,L),D.setScissor(ce,ue,T,L),D.render(l,Ue),ce=T,l.overrideMaterial=ke,D.setViewport(ce,ue,T,L),D.setScissor(ce,ue,T,L),D.render(l,Be)},ye=()=>{switch(t.forEach(F=>{F.update()}),i.forEach(F=>{F.update()}),o.forEach(F=>{F.update!==void 0&&F.update()}),e.onSceneUpdate!==void 0&&Pt&&e.onSceneUpdate(Te),D.clear(),Y){case"Single":M();break;case"Side by Side":case"Stacked":W();break;case"Quad":ae();break}me=requestAnimationFrame(ye)};return ze(),window.addEventListener("resize",le),le(),ye(),()=>{window.removeEventListener("resize",le),cancelAnimationFrame(me),me=-1}},[Y,D]),b.useEffect(()=>{if(D!==null){const p=new f.Raycaster,v=new f.Vector2,T=(R,M,W,ae)=>{switch(Y){case"Quad":R<W?M<ae?p.setFromCamera(v,Z):p.setFromCamera(v,Ue):M<ae?p.setFromCamera(v,oe):p.setFromCamera(v,Be);break;case"Side by Side":R<W?p.setFromCamera(v,Z):p.setFromCamera(v,oe);break;case"Single":p.setFromCamera(v,Z);break;case"Stacked":M<ae?p.setFromCamera(v,Z):p.setFromCamera(v,oe);break}},L=R=>{if(Me==="Orbit")return;const M=new f.Vector2;D.getSize(M);const W=Math.min(R.clientX,M.x),ae=Math.min(R.clientY,M.y);v.x=Je(W,0,M.x,-1,1),v.y=Je(ae,0,M.y,1,-1);const ye=M.x/2,F=M.y/2,te=()=>{W<ye?v.x=Je(W,0,ye,-1,1):v.x=Je(W,ye,M.x,-1,1)},z=()=>{ae<F?v.y=Je(ae,0,F,1,-1):v.y=Je(ae,F,M.y,1,-1)};switch(Y){case"Quad":te(),z();break;case"Side by Side":te();break;case"Stacked":z(),z();break}T(W,ae,ye,F);const ke=p.intersectObjects(Te.children);ke.length>0&&m.position.copy(ke[0].point)},me=R=>{if(Me==="Orbit")return;const M=new f.Vector2;if(D.getSize(M),R.clientX>=M.x)return;L(R);const W=p.intersectObjects(Te.children);W.length>0&&(e.three.getObject(W[0].object.uuid),m.visible=!1,Ie("Orbit"),je(Date.now()))},le=O.current;return le.addEventListener("mousemove",L,!1),le.addEventListener("click",me,!1),()=>{le.removeEventListener("mousemove",L),le.removeEventListener("click",me)}}},[Y,D,Me]);const fe=[];return a.forEach((p,v)=>{fe.push(v)}),u.jsxs("div",{className:"multiview",children:[u.jsx("canvas",{ref:H}),D!==null&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:`cameras ${Y==="Single"||Y==="Stacked"?"single":""}`,ref:O,children:[Y==="Single"&&u.jsx(u.Fragment,{children:u.jsx(He,{camera:Z,options:fe,ref:V,onSelectCamera:p=>{t.get(Z.name)?.dispose();const v=a.get(p);v!==void 0&&(Oe(Z),Z=v,w.setItem(`${n}_tlCam`,v.name),ee(v,V.current))},onSelectRenderMode:p=>{Qe=p,w.setItem(`${n}_tlRender`,p)}})}),(Y==="Side by Side"||Y==="Stacked")&&u.jsxs(u.Fragment,{children:[u.jsx(He,{camera:Z,options:fe,ref:V,onSelectCamera:p=>{t.get(Z.name)?.dispose();const v=a.get(p);v!==void 0&&(Oe(Z),Z=v,w.setItem(`${n}_tlCam`,v.name),ee(v,V.current))},onSelectRenderMode:p=>{Qe=p,w.setItem(`${n}_tlRender`,p)}}),u.jsx(He,{camera:oe,options:fe,ref:k,onSelectCamera:p=>{t.get(oe.name)?.dispose();const v=a.get(p);v!==void 0&&(Oe(oe),oe=v,w.setItem(`${n}_trCam`,v.name),ee(v,k.current))},onSelectRenderMode:p=>{yt=p,w.setItem(`${n}_trRender`,p)}})]}),Y==="Quad"&&u.jsxs(u.Fragment,{children:[u.jsx(He,{camera:Z,options:fe,ref:V,onSelectCamera:p=>{t.get(Z.name)?.dispose();const v=a.get(p);v!==void 0&&(Oe(Z),Z=v,w.setItem(`${n}_tlCam`,v.name),ee(v,V.current))},onSelectRenderMode:p=>{Qe=p,w.setItem(`${n}_tlRender`,p)}}),u.jsx(He,{camera:oe,options:fe,ref:k,onSelectCamera:p=>{t.get(oe.name)?.dispose();const v=a.get(p);v!==void 0&&(Oe(oe),oe=v,w.setItem(`${n}_trCam`,v.name),ee(v,k.current))},onSelectRenderMode:p=>{yt=p,w.setItem(`${n}_trRender`,p)}}),u.jsx(He,{camera:Ue,options:fe,ref:X,onSelectCamera:p=>{t.get(Ue.name)?.dispose();const v=a.get(p);v!==void 0&&(Oe(Ue),Ue=v,w.setItem(`${n}_blCam`,v.name),ee(v,X.current))},onSelectRenderMode:p=>{tn=p,w.setItem(`${n}_blRender`,p)}}),u.jsx(He,{camera:Be,options:fe,ref:re,onSelectCamera:p=>{t.get(Be.name)?.dispose();const v=a.get(p);v!==void 0&&(Oe(Be),Be=v,w.setItem(`${n}_brCam`,v.name),ee(v,re.current))},onSelectRenderMode:p=>{nn=p,w.setItem(`${n}_brRender`,p)}})]})]}),u.jsxs("div",{className:"settings",children:[u.jsx(Ct,{index:$.indexOf(Y),options:$,onSelect:p=>{p!==Y&&(tt(),et(p))},open:se,onToggle:p=>{ve(p),we&&be(!1),De&&Ae(!1)}}),u.jsx(Ct,{index:Me==="Orbit"?0:1,options:["Orbit Mode","Selection Mode"],onSelect:p=>{m.visible=p==="Selection Mode",Ie(m.visible?"Selection":"Orbit")},open:De,onToggle:p=>{se&&ve(!1),we&&be(!1),Ae(p)}})]},$e)]})]})}function Ca(e){return u.jsxs("div",{className:"editor",ref:e.ref,style:e.style,children:[u.jsx("div",{className:"header",children:e.header}),e.children,u.jsx("div",{className:"footer",children:e.footer})]})}exports.Accordion=Ot;exports.Application=Rn;exports.BaseRemote=dt;exports.ChildObject=Vt;exports.ContainerObject=mn;exports.Draggable=dn;exports.DraggableItem=un;exports.Dropdown=hn;exports.DropdownItem=fn;exports.Editor=Ca;exports.Inspector=vn;exports.MultiView=xa;exports.NavButton=Bt;exports.RemoteComponents=Tn;exports.RemoteController=Vn;exports.RemoteTheatre=Mt;exports.RemoteThree=jn;exports.RemoteTweakpane=Nn;exports.SceneInspector=fa;exports.SidePanel=ha;exports.ToolEvents=j;exports.capitalize=lt;exports.clamp=Ve;exports.colorToHex=on;exports.debugDispatcher=I;exports.defaultTheatreCallback=wn;exports.dispose=ut;exports.disposeMaterial=cn;exports.disposeTexture=On;exports.distance=Mn;exports.hierarchyUUID=xt;exports.isColor=sn;exports.mix=jt;exports.noop=wt;exports.normalize=It;exports.randomID=rn;exports.resetThreeObjects=Lt;exports.round=Nt;exports.theatreEditorApp=_n;
|