@tomorrowevening/hermes 0.0.50 → 0.0.51

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.
@@ -27,7 +27,7 @@ Check your code at `+p+":"+y+"."}return""}}var at={};function xe(r){{var p=Ct();
27
27
  Check the top-level render call using <`+y+">.")}return p}}function ge(r,p){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var y=xe(p);if(at[y])return;at[y]=!0;var w="";r&&r._owner&&r._owner!==_.current&&(w=" It was passed a child from "+U(r._owner.type)+"."),Z(r),B('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',y,w),Z(null)}}function He(r,p){{if(typeof r!="object")return;if(Pe(r))for(var y=0;y<r.length;y++){var w=r[y];ue(w)&&ge(w,p)}else if(ue(r))r._store&&(r._store.validated=!0);else if(r){var $=q(r);if(typeof $=="function"&&$!==r.entries)for(var Y=$.call(r),I;!(I=Y.next()).done;)ue(I.value)&&ge(I.value,p)}}}function ze(r){{var p=r.type;if(p==null||typeof p=="string")return;var y;if(typeof p=="function")y=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===d||p.$$typeof===g))y=p.propTypes;else return;if(y){var w=U(p);z(y,r.props,"prop",w,r)}else if(p.PropTypes!==void 0&&!ve){ve=!0;var $=U(p);B("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",$||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&B("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ye(r){{for(var p=Object.keys(r.props),y=0;y<p.length;y++){var w=p[y];if(w!=="children"&&w!=="key"){Z(r),B("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",w),Z(null);break}}r.ref!==null&&(Z(r),B("Invalid attribute `ref` supplied to `React.Fragment`."),Z(null))}}function Ge(r,p,y,w,$,Y){{var I=Ce(r);if(!I){var j="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(j+=" 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=wt($);he?j+=he:j+=Ct();var ee;r===null?ee="null":Pe(r)?ee="array":r!==void 0&&r.$$typeof===n?(ee="<"+(U(r.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):ee=typeof r,B("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ee,j)}var ne=E(r,p,y,$,Y);if(ne==null)return ne;if(I){var be=p.children;if(be!==void 0)if(w)if(Pe(be)){for(var Ze=0;Ze<be.length;Ze++)He(be[Ze],r);Object.freeze&&Object.freeze(be)}else B("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 He(be,r)}return r===e?Ye(ne):ze(ne),ne}}function ln(r,p,y){return Ge(r,p,y,!0)}function un(r,p,y){return Ge(r,p,y,!1)}var dn=un,hn=ln;rt.Fragment=e,rt.jsx=dn,rt.jsxs=hn}()),rt}process.env.NODE_ENV==="production"?Pt.exports=_n():Pt.exports=An();var u=Pt.exports;function It(t){return t.title.search("<")>-1?u.jsx("button",{className:"svg",dangerouslySetInnerHTML:{__html:t.title}}):u.jsx("button",{children:t.title})}const Pn=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"})]}),kn=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
29
  C11,8.22,10.74,8,10.43,8z`})});function tn(t){return u.jsx(qt.Reorder.Item,{value:t.title,children:u.jsxs("div",{children:[kn,u.jsx("span",{children:t.title}),u.jsx("button",{className:"closeIcon",onClick:()=>{t.onDelete(t.index)},children:Pn})]})},t.title)}function nn(t){const[n,a]=x.useState(!1),[e,i]=x.useState(t.options),c=h=>{t.onDragComplete(h),i(h)},f=h=>{const b=[...e];b.splice(h,1),c(b)},o=[];e.forEach((h,b)=>{o.push(u.jsx(tn,{index:b,title:h,onDelete:f},h))});let d="dropdown draggable";return t.subdropdown&&(d+=" subdropdown"),u.jsxs("div",{className:d,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[u.jsx(It,{title:t.title}),u.jsx(qt.Reorder.Group,{axis:"y",values:e,onReorder:c,style:{visibility:n?"visible":"hidden"},children:o})]})}function an(t){const[n,a]=x.useState(!1),e=[];t.options.map((c,f)=>{t.onSelect!==void 0&&(c.onSelect=t.onSelect),e.push(u.jsx(rn,{option:c},f))});let i="dropdown";return t.subdropdown&&(i+=" subdropdown"),u.jsxs("div",{className:i,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[u.jsx(It,{title:t.title}),u.jsx("ul",{style:{visibility:n?"visible":"hidden"},children:e})]})}function rn(t){const{option:n}=t,[a,e]=x.useState("");let i;switch(n.type){case"draggable":i=u.jsx(nn,{title:n.title,options:n.value,onDragComplete:c=>{n.onDragComplete!==void 0&&n.onDragComplete(c)},subdropdown:!0});break;case"dropdown":i=u.jsx(an,{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?e(n.title):e(""))},children:n.title});break}return u.jsx("li",{className:a===n.title?"selected":"",children:i},Kt())}function Dn(t,n,a){function e(c){switch(n.forEach(f=>{f.callback(t,f.remote,c)}),c.event){case"custom":N.dispatchEvent({type:F.CUSTOM,value:c.data});break}}function i(c){switch(a.forEach(f=>{f.callback(t,f.remote,c)}),c.event){case"custom":N.dispatchEvent({type:F.CUSTOM,value:c.data});break}}t.listen=c=>{c.target==="editor"?i(c):e(c)}}function Et(t){const[n,a]=x.useState(t.open!==void 0?t.open:!0),e=!n||t.children===void 0;return u.jsxs("div",{className:`accordion ${e?"hide":""}`,children:[u.jsxs("button",{className:"toggle",onClick:()=>{const i=!n;t.onToggle!==void 0&&t.onToggle(i),a(i)},children:[u.jsx("p",{className:`status ${n?"open":""}`,children:"Toggle"}),u.jsx("p",{className:"label",children:ct(t.label)})]}),t.button,u.jsx("div",{className:n?"open":"",children:u.jsx("div",{children:t.children})})]})}function Lt(t){const[n,a]=x.useState(!1),e=t.child!==void 0&&t.child.children.length>0,i=[];return t.child!==void 0&&t.child.children.length>0&&t.child.children.map(c=>{i.push(u.jsx(Lt,{child:c,three:t.three},Math.random()))}),u.jsx(u.Fragment,{children:t.child!==void 0&&u.jsxs("div",{className:"childObject",children:[u.jsxs("div",{className:"child",children:[e?u.jsx("button",{className:"status",style:{backgroundPositionX:n?"-14px":"2px"},onClick:()=>{a(!n)}}):null,u.jsx("button",{className:"name",style:{left:e?"20px":"5px"},onClick:()=>{t.child!==void 0&&(t.three.getObject(t.child.uuid),n||a(!0))},children:t.child.name.length>0?`${t.child.name} (${t.child.type})`:`${t.child.type}::${t.child.uuid}`}),u.jsx("div",{className:`icon ${Cn(t.child)}`})]}),u.jsx("div",{className:n?"open":"",children:u.jsx("div",{className:"container",children:i})})]},Math.random())})}function sn(t){const n=[];return t.child?.children.map(a=>{n.push(u.jsx(Lt,{child:a,three:t.three},Math.random()))}),u.jsx("div",{className:`scene ${t.class!==void 0?t.class:""}`,children:n})}const jn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";function In(t){return"items"in t}function qe(t){const n=[];return t.items.forEach(a=>{In(a)?n.push(u.jsx(qe,{title:ct(a.title),items:a.items},Math.random())):n.push(u.jsx(ot,{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:(e,i)=>{a.onChange!==void 0&&a.onChange(e,i)}},Math.random()))}),u.jsx(Et,{label:t.title,open:t.expanded===!0,children:n})}function Ln(t){return!(t==="alphaHash"||t==="alphaToCoverage"||t==="attenuationDistance"||t==="blendDstAlpha"||t==="colorWrite"||t==="combine"||t==="defaultAttributeValues"||t==="depthFunc"||t==="forceSinglePass"||t==="glslVersion"||t==="linecap"||t==="linejoin"||t==="linewidth"||t==="normalMapType"||t==="precision"||t==="premultipliedAlpha"||t==="shadowSide"||t==="toneMapped"||t==="uniformsGroups"||t==="uniformsNeedUpdate"||t==="userData"||t==="vertexColors"||t==="version"||t==="wireframeLinecap"||t==="wireframeLinejoin"||t==="wireframeLinewidth"||t.slice(0,4)==="clip"||t.slice(0,7)==="polygon"||t.slice(0,7)==="stencil"||t.slice(0,2)==="is")}function Re(t){switch(t){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 t}function Nn(t){return t.toLowerCase().search("intensity")>-1||t==="anisotropyRotation"||t==="blendAlpha"||t==="bumpScale"||t==="clearcoatRoughness"||t==="displacementBias"||t==="displacementScale"||t==="metalness"||t==="opacity"||t==="reflectivity"||t==="refractionRatio"||t==="roughness"||t==="sheenRoughness"||t==="thickness"}function Fn(){const t=document.createElement("input");return t.type="file",new Promise((n,a)=>{t.addEventListener("change",function(){if(t.files===null)a();else{const e=t.files[0],i=new FileReader;i.onload=function(c){n(c.target.result)},i.readAsDataURL(e)}}),t.click()})}const Bn=[{title:"Front",value:l.FrontSide},{title:"Back",value:l.BackSide},{title:"Double",value:l.DoubleSide}],Un=[{title:"No Blending",value:l.NoBlending},{title:"Normal",value:l.NormalBlending},{title:"Additive",value:l.AdditiveBlending},{title:"Subtractive",value:l.SubtractiveBlending},{title:"Multiply",value:l.MultiplyBlending},{title:"Custom",value:l.CustomBlending}],Vn=[{title:"Add",value:l.AddEquation},{title:"Subtract",value:l.SubtractEquation},{title:"Reverse Subtract",value:l.ReverseSubtractEquation},{title:"Min",value:l.MinEquation},{title:"Max",value:l.MaxEquation}],$n=[{title:"Zero",valye:l.ZeroFactor},{title:"One",valye:l.OneFactor},{title:"Src Color",valye:l.SrcColorFactor},{title:"One Minus Src Color",valye:l.OneMinusSrcColorFactor},{title:"Src Alpha",valye:l.SrcAlphaFactor},{title:"One Minus Src Alpha",valye:l.OneMinusSrcAlphaFactor},{title:"Dst Alpha",valye:l.DstAlphaFactor},{title:"One Minus Dst Alpha",valye:l.OneMinusDstAlphaFactor},{title:"Dst Color",valye:l.DstColorFactor},{title:"One Minus Dst Color",valye:l.OneMinusDstColorFactor},{title:"Src Alpha Saturate",valye:l.SrcAlphaSaturateFactor},{title:"Constant Color",valye:l.ConstantColorFactor},{title:"One Minus Constant Color",valye:l.OneMinusConstantColorFactor},{title:"Constant Alpha",valye:l.ConstantAlphaFactor},{title:"One Minus Constant Alpha",valye:l.OneMinusConstantAlphaFactor}],Hn=[{title:"Zero",valye:l.ZeroFactor},{title:"One",valye:l.OneFactor},{title:"Src Color",valye:l.SrcColorFactor},{title:"One Minus Src Color",valye:l.OneMinusSrcColorFactor},{title:"Src Alpha",valye:l.SrcAlphaFactor},{title:"One Minus Src Alpha",valye:l.OneMinusSrcAlphaFactor},{title:"Dst Alpha",valye:l.DstAlphaFactor},{title:"One Minus Dst Alpha",valye:l.OneMinusDstAlphaFactor},{title:"Dst Color",valye:l.DstColorFactor},{title:"One Minus Dst Color",valye:l.OneMinusDstColorFactor},{title:"Constant Color",valye:l.ConstantColorFactor},{title:"One Minus Constant Color",valye:l.OneMinusConstantColorFactor},{title:"Constant Alpha",valye:l.ConstantAlphaFactor},{title:"One Minus Constant Alpha",valye:l.OneMinusConstantAlphaFactor}];function st(t,n){t.needsUpdate=!0,t.type="option",t.options=n}function zn(t,n,a,e){return{type:"boolean",title:Re(t),prop:t,value:n,needsUpdate:!0,onChange:(i,c)=>{e.updateObject(a.uuid,`material.${t}`,c),e.updateObject(a.uuid,"material.needsUpdate",!0);const f=e.scene?.getObjectByProperty("uuid",a.uuid);f!==void 0&&J(f,`material.${t}`,c)}}}function Yn(t,n,a,e){const i={type:"number",title:Re(t),prop:t,value:n,min:void 0,max:void 0,step:.01,needsUpdate:!0,onChange:(c,f)=>{e.updateObject(a.uuid,`material.${t}`,f),e.updateObject(a.uuid,"material.needsUpdate",!0);const o=e.scene?.getObjectByProperty("uuid",a.uuid);o!==void 0&&J(o,`material.${t}`,f)}};switch(t){case"blending":st(i,Un);break;case"blendDst":st(i,Hn);break;case"blendEquation":st(i,Vn);break;case"blendSrc":st(i,$n);break;case"side":st(i,Bn);break}return Nn(t)&&(i.value=Number(n),i.type="range",i.min=0,i.max=1,i.step=.01),i}function Gn(t,n,a,e){const i={type:"string",title:Re(t),prop:t,value:n,needsUpdate:!0,onChange:(f,o)=>{e.updateObject(a.uuid,`material.${t}`,o),e.updateObject(a.uuid,"material.needsUpdate",!0);const d=e.scene?.getObjectByProperty("uuid",a.uuid);d!==void 0&&J(d,`material.${t}`,o)}};return(t==="vertexShader"||t==="fragmentShader")&&(i.disabled=!1,i.latest=i.value,i.onChange=(f,o)=>{i.latest=o}),i}function Vt(t,n,a){const e=[];for(const i in t){if(!Ln(i))continue;const c=typeof t[i],f=t[i];if(c==="boolean")e.push(zn(i,f,n,a));else if(c==="number")e.push(Yn(i,f,n,a));else if(c==="string")e.push(Gn(i,f,n,a));else if(c==="object")if(f.isColor)e.push({title:Re(i),prop:i,type:"color",value:f,onChange:(o,d)=>{const h=new l.Color(d);a.updateObject(n.uuid,`material.${o}`,h);const b=a.scene?.getObjectByProperty("uuid",n.uuid);b!==void 0&&J(b,`material.${o}`,h)}});else if(Array.isArray(f)){const o=[];for(const d in f)o.push({title:`${d}`,type:`${typeof f[d]}`,value:f[d],onChange:(h,b)=>{a.updateObject(n.uuid,`material.${i}`,b);const g=a.scene?.getObjectByProperty("uuid",n.uuid);g!==void 0&&J(g,`material.${i}`,b)}});e.push({title:Re(i),items:o})}else if(f.x!==void 0&&f.y!==void 0&&f.z===void 0)e.push({title:Re(i),prop:i,type:"vector",value:f,onChange:(o,d)=>{a.updateObject(n.uuid,`material.${o}`,d);const h=a.scene?.getObjectByProperty("uuid",n.uuid);h!==void 0&&J(h,`material.${o}`,d)}});else{const o=[];for(const d in f){const h=f[d];switch(typeof h){case"boolean":case"number":case"string":d==="src"?e.push({title:Re(i),type:"image",value:h,onChange:(g,S)=>{a.createTexture(n.uuid,`material.${i}`,S);const C=a.scene?.getObjectByProperty("uuid",n.uuid);C!==void 0&&At(S).then(P=>{J(C,`material.${i}`,P),J(C,"material.needsUpdate",!0)})}}):o.push({title:`${Re(d)}`,prop:`material.${i}.${d}`,type:`${typeof t[i][d]}`,value:f[d],onChange:(g,S)=>{a.updateObject(n.uuid,`material.${i}.${d}`,S);const C=a.scene?.getObjectByProperty("uuid",n.uuid);C!==void 0&&J(C,`material.${i}.${d}`,S)}});break;case"object":if(h.value!==void 0&&h.value.src!==void 0)o.push({title:Re(d),type:"image",value:h.value.src,onChange:(g,S)=>{a.createTexture(n.uuid,`material.${i}.${d}.value`,f);const C=a.scene?.getObjectByProperty("uuid",n.uuid);C!==void 0&&At(S).then(P=>{J(C,`material.${i}.${d}.value`,P)})}});else if(i==="uniforms"){const g=h.value,S=(C,P,k)=>({title:C,type:"number",value:k,step:.01,onChange:(q,G)=>{const B=`material.uniforms.${d}.value.${P}`;a.updateObject(n.uuid,B,G);const A=a.scene?.getObjectByProperty("uuid",n.uuid);A!==void 0&&J(A,B,G)}});if(typeof h.value=="number")o.push({title:d,type:"number",value:h.value,step:.01,onChange:(C,P)=>{const k=`material.${i}.${C}.value`;a.updateObject(n.uuid,k,P);const q=a.scene?.getObjectByProperty("uuid",n.uuid);q!==void 0&&J(q,k,P)}});else if(g.r!==void 0&&g.g!==void 0&&g.b!==void 0)o.push({title:d,type:"color",value:h.value,onChange:(C,P)=>{const k=new l.Color(P),q=`material.${i}.${C}.value`;a.updateObject(n.uuid,q,k);const G=a.scene?.getObjectByProperty("uuid",n.uuid);G!==void 0&&J(G,q,k)}});else if(g.x!==void 0&&g.y!==void 0&&g.z===void 0&&g.w===void 0)o.push({title:d,type:"vector",value:h.value,prop:`material.${i}.${d}.value`,onChange:(C,P)=>{a.updateObject(n.uuid,C,P);const k=a.scene?.getObjectByProperty("uuid",n.uuid);k!==void 0&&J(k,C,P)}});else if(g.x!==void 0&&g.y!==void 0&&g.z!==void 0&&g.w===void 0)o.push({title:d,items:[S("X","x",h.value.x),S("Y","y",h.value.y),S("Z","z",h.value.z)]});else if(g.x!==void 0&&g.y!==void 0&&g.z!==void 0&&g.w!==void 0)o.push({title:d,items:[S("X","x",h.value.x),S("Y","y",h.value.y),S("Z","z",h.value.z),S("W","w",h.value.w)]});else if(g.elements!==void 0){const C=g.elements,P=[];for(let k=0;k<C.length;k++)P.push(S(k.toString(),k.toString(),C[k]));o.push({title:d,items:P})}else console.log(">>> need to add this format:",d,g)}else o.push({title:d,type:`${typeof h.value}`,value:h.value,onChange:(g,S)=>{a.updateObject(n.uuid,`material.${i}.${d}.value`,S);const C=a.scene?.getObjectByProperty("uuid",n.uuid);C!==void 0&&J(C,`material.${i}.${d}.value`,S)}});break}}o.length>0&&e.push({title:Re(i),items:o})}else f!==void 0&&console.log("other:",i,c,f)}return e.sort((i,c)=>i.title<c.title?-1:i.title>c.title?1:0),e.push({title:"Update Material",type:"button",onChange:()=>{a.updateObject(n.uuid,"material.needsUpdate",!0)}}),e}function Wn(t,n){const a=t.material;if(Array.isArray(a)){const e=[],i=a.length;for(let c=0;c<i;c++)e.push(u.jsx(qe,{title:`Material ${c}`,items:Vt(a[c],t,n)},`Material ${c}`));return u.jsx(u.Fragment,{children:e})}else return u.jsx(qe,{title:"Material",items:Vt(a,t,n)})}function qn(t){const n=x.useRef(null),a=x.useRef(null),e=x.useRef(null),i=x.useRef(null),c=x.useRef(null),f=x.useRef(null),[o,d]=x.useState(t.value),[h,b]=x.useState({min:t.min,max:t.max}),[g,S]=x.useState(!1);function C(){g||(window.addEventListener("mousemove",k),window.addEventListener("mouseup",P),window.addEventListener("mouseup",P),S(!0))}function P(){window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",P),S(!1)}function k(A){const X=c.current.getBoundingClientRect(),te=Ue(0,99,A.clientX-X.left)/99,ye=Ue(0,99,A.clientY-X.top)/99,K=et(_t(h.min,h.max,te),3),fe=et(_t(h.min,h.max,ye),3);t.onChange({target:{value:{x:K,y:fe}}}),d({x:K,y:fe})}function q(A){let X=o.x,te=o.y;A.target===n.current?X=Number(A.target.value):te=Number(A.target.value),d({x:X,y:te})}function G(){const A=Number(e.current.value);b({min:A,max:h.max}),(o.x<A||o.y<A)&&d({x:Ue(A,h.max,o.x),y:Ue(A,h.max,o.y)})}function B(){const A=Number(i.current.value);b({min:h.min,max:A}),(o.x>A||o.y>A)&&d({x:Ue(h.min,A,o.x),y:Ue(h.min,A,o.y)})}return x.useEffect(()=>{const A=Rt(h.min,h.max,o.x),X=Rt(h.min,h.max,o.y);f.current.style.left=`${A*100}%`,f.current.style.top=`${X*100}%`},[h,o]),u.jsxs("div",{className:"vector",children:[u.jsxs("div",{className:"fields",children:[u.jsxs("div",{children:[u.jsx("label",{children:"X:"}),u.jsx("input",{ref:n,type:"number",value:o.x,min:h.min,max:h.max,step:.01,onChange:q})]}),u.jsxs("div",{children:[u.jsx("label",{children:"Y:"}),u.jsx("input",{ref:a,type:"number",value:o.y,min:h.min,max:h.max,step:.01,onChange:q})]}),u.jsxs("div",{children:[u.jsx("label",{children:"Min:"}),u.jsx("input",{ref:e,type:"number",value:h.min,step:.01,onChange:G})]}),u.jsxs("div",{children:[u.jsx("label",{children:"Max:"}),u.jsx("input",{ref:i,type:"number",value:h.max,step:.01,onChange:B})]})]}),u.jsxs("div",{className:"input",ref:c,onMouseDown:C,onMouseUp:P,children:[u.jsx("div",{className:"x"}),u.jsx("div",{className:"y"}),u.jsx("div",{className:"pt",ref:f})]})]})}function ot(t){let n=t.value;n!==void 0&&n.isColor!==void 0&&(n=Zt(t.value));const[a,e]=x.useState(n),i=x.useRef(null),c=x.useRef(null),f=x.useRef(null);x.useEffect(()=>{let b=!1,g=-1,S=0,C=Number(a);const P=A=>{b=!0,S=C,g=A.clientX},k=A=>{if(!b)return;const X=t.step!==void 0?t.step:1,te=(A.clientX-g)*X;C=Number((S+te).toFixed(4)),c.current!==null&&(c.current.value=C.toString()),t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,C)},q=()=>{b=!1},G=()=>{b=!1},B=t.type==="number";return B&&(i.current?.addEventListener("mousedown",P,!1),document.addEventListener("mouseup",q,!1),document.addEventListener("mousemove",k,!1),document.addEventListener("contextmenu",G,!1)),()=>{B&&(i.current?.removeEventListener("mousedown",P),document.removeEventListener("mouseup",q),document.removeEventListener("mousemove",k),document.removeEventListener("contextmenu",G))}},[a]);const o=t.type==="string"&&(a.length>100||a.search(`
30
- `)>-1),d=o||t.type==="image"||t.type==="vector",h=b=>{let g=b.target.value;t.type==="boolean"?g=b.target.checked:t.type==="option"&&(g=t.options[g].value),e(g),t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,g)};return u.jsxs("div",{className:`field ${d?"block":""}`,children:[t.type!=="button"&&u.jsx("label",{ref:i,children:ct(t.title)},"fieldLabel"),t.type==="string"&&!o&&u.jsx("input",{type:"text",disabled:t.disabled,onChange:h,value:a}),t.type==="string"&&o&&u.jsx("textarea",{cols:50,rows:10,disabled:t.disabled!==void 0?t.disabled:!0,onChange:h,value:a}),t.type==="boolean"&&u.jsx("input",{type:"checkbox",disabled:t.disabled,onChange:h,checked:a}),t.type==="number"&&u.jsx("input",{ref:c,type:"number",value:a,min:t.min,max:t.max,step:t.step,disabled:t.disabled,onChange:h}),t.type==="range"&&u.jsxs(u.Fragment,{children:[u.jsx("input",{type:"text",value:a.toString(),onChange:h,disabled:t.disabled,className:"min"}),u.jsx("input",{disabled:t.disabled,type:"range",value:a,min:t.min,max:t.max,step:t.step,onChange:h})]}),t.type==="color"&&u.jsxs(u.Fragment,{children:[u.jsx("input",{type:"text",value:a.toString(),onChange:h,disabled:t.disabled,className:"color"}),u.jsx("input",{type:"color",value:a,onChange:h,disabled:t.disabled})]}),t.type==="button"&&u.jsx("button",{disabled:t.disabled,onClick:()=>{t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,!0)},children:t.title}),t.type==="image"&&u.jsx("img",{ref:f,onClick:()=>{Fn().then(b=>{f.current.src=b,t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,b)})},src:a.length>0?a:jn}),t.type==="option"&&u.jsx(u.Fragment,{children:u.jsx("select",{onChange:h,disabled:t.disabled,defaultValue:t.value,children:t.options?.map((b,g)=>u.jsx("option",{value:b.value,children:ct(b.title)},g))})}),t.type==="vector"&&u.jsx(qn,{value:a,min:-1,max:1,onChange:h})]})}function $t(t){switch(t){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 t}function Kn(t,n){const a=[];if(t.perspectiveCameraInfo!==void 0)for(const e in t.perspectiveCameraInfo)a.push({title:$t(e),prop:e,type:"number",step:.01,value:t.perspectiveCameraInfo[e],onChange:(i,c)=>{n.updateObject(t.uuid,i,c),n.requestMethod(t.uuid,"updateProjectionMatrix");const f=n.scene?.getObjectByProperty("uuid",t.uuid);f!==void 0&&(J(f,i,c),f.updateProjectionMatrix())}});else if(t.orthographicCameraInfo!==void 0)for(const e in t.orthographicCameraInfo)a.push({title:$t(e),prop:e,type:"number",step:.01,value:t.perspectiveCameraInfo[e],onChange:(i,c)=>{n.updateObject(t.uuid,i,c),n.requestMethod(t.uuid,"updateProjectionMatrix");const f=n.scene?.getObjectByProperty("uuid",t.uuid);f!==void 0&&(J(f,i,c),f.updateProjectionMatrix())}});return u.jsx(qe,{title:"Camera",items:a})}const Xn=Math.PI/180,Zn=180/Math.PI;function Qe(t,n,a,e,i){return e+(t-n)*(i-e)/(a-n)}function Jn(t){return t*Xn}function Mt(t){return t*Zn}function Qn(t,n){const a=new l.Matrix4;a.elements=t.matrix;const e=new l.Vector3,i=new l.Euler,c=new l.Vector3;t.uuid.length>0&&(e.setFromMatrixPosition(a),i.setFromRotationMatrix(a),c.setFromMatrixScale(a));const f=(d,h)=>{n.updateObject(t.uuid,d,h);const b=n.scene?.getObjectByProperty("uuid",t.uuid);b!==void 0&&J(b,d,h)},o=(d,h)=>{f(d,Jn(h))};return u.jsx(qe,{title:"Transform",items:[{title:"Position X",prop:"position.x",type:"number",value:e.x,onChange:f},{title:"Position Y",prop:"position.y",type:"number",value:e.y,onChange:f},{title:"Position Z",prop:"position.z",type:"number",value:e.z,onChange:f},{title:"Rotation X",prop:"rotation.x",type:"number",value:et(Mt(i.x)),min:-360,max:360,step:.1,onChange:o},{title:"Rotation Y",prop:"rotation.y",type:"number",value:et(Mt(i.y)),min:-360,max:360,step:.1,onChange:o},{title:"Rotation Z",prop:"rotation.z",type:"number",value:et(Mt(i.z)),min:-360,max:360,step:.1,onChange:o},{title:"Scale X",prop:"scale.x",type:"number",value:c.x,step:.01,onChange:f},{title:"Scale Y",prop:"scale.y",type:"number",value:c.y,step:.01,onChange:f},{title:"Scale Z",prop:"scale.z",type:"number",value:c.z,step:.01,onChange:f}]})}function Ht(t){switch(t){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"}return t}function ea(t,n){const a=[];if(t.lightInfo!==void 0)for(const e in t.lightInfo){const i=t.lightInfo[e];i!==void 0&&(i.isColor!==void 0?a.push({title:Ht(e),prop:e,type:"color",value:i,onChange:(c,f)=>{const o=new l.Color(f);n.updateObject(t.uuid,c,o);const d=n.scene?.getObjectByProperty("uuid",t.uuid);d!==void 0&&J(d,c,o)}}):a.push({title:Ht(e),prop:e,type:typeof i,value:i,step:typeof i=="number"?.01:void 0,onChange:(c,f)=>{n.updateObject(t.uuid,c,f);const o=n.scene?.getObjectByProperty("uuid",t.uuid);o!==void 0&&J(o,c,f)}}))}return u.jsx(qe,{title:"Light",items:a})}function ta(t,n){const a=[],e=[];let i=0;t.animations.forEach(o=>{i=Math.max(i,o.duration),o.duration>0&&e.push({title:o.name,items:[{title:"Duration",type:"number",value:o.duration,disabled:!0},{title:"Blend Mode",type:"option",disabled:!0,options:[{title:"Normal",value:2500},{title:"Additive",value:2501}]}]})}),a.push({title:"Animations",items:e});const c=n.scene?.getObjectByProperty("uuid",t.uuid);let f=!1;if(c!==void 0){const o=c.mixer;if(f=o!==void 0,f){const d=[{title:"Time Scale",type:"range",value:o.timeScale,step:.01,min:-1,max:2,onChange:(h,b)=>{o.timeScale=b,n.updateObject(t.uuid,"mixer.timeScale",b)}}];d.push({title:"Stop All",type:"button",onChange:()=>{o.stopAllAction(),n.requestMethod(t.uuid,"stopAllAction",void 0,"mixer")}}),a.push({title:"Mixer",items:d})}}return u.jsx(qe,{title:"Animation",items:a})}const on={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};let oe={...on};function cn(t){const[n,a]=x.useState(-1);x.useEffect(()=>{function f(d){oe={...d.value},a(Date.now())}function o(){oe={...on},a(Date.now())}return N.addEventListener(F.SET_SCENE,o),N.addEventListener(F.SET_OBJECT,f),()=>{N.removeEventListener(F.SET_SCENE,o),N.removeEventListener(F.SET_OBJECT,f)}},[]);const e=oe.type.toLowerCase(),i=oe.animations.length>0||oe.mixer!==void 0,c=e.search("mesh")>-1||e.search("line")>-1||e.search("points")>-1;return u.jsx(Et,{label:"Inspector",children:u.jsx("div",{id:"Inspector",className:t.class,children:oe.uuid.length>0&&u.jsxs(u.Fragment,{children:[u.jsxs(u.Fragment,{children:[u.jsx(ot,{type:"string",title:"Name",prop:"name",value:oe.name,disabled:!0}),u.jsx(ot,{type:"string",title:"Type",prop:"type",value:oe.type,disabled:!0}),u.jsx(ot,{type:"string",title:"UUID",prop:"uuid",value:oe.uuid,disabled:!0}),u.jsx(ot,{type:"boolean",title:"Visible",prop:"visible",value:oe.visible,onChange:(f,o)=>{t.three.updateObject(oe.uuid,f,o);const d=t.three.scene?.getObjectByProperty("uuid",oe.uuid);d!==void 0&&J(d,f,o)}})]}),u.jsxs(u.Fragment,{children:[Qn(oe,t.three),i?ta(oe,t.three):null,e.search("camera")>-1?Kn(oe,t.three):null,e.search("light")>-1?ea(oe,t.three):null,c?Wn(oe,t.three):null]})]})},n)},"Inspector")}function na(t){const[n,a]=x.useState(t.scene);x.useEffect(()=>{const c=f=>{a(f.value)};return N.addEventListener(F.SET_SCENE,c),()=>{N.removeEventListener(F.SET_SCENE,c)}},[]);const e=n!==null,i="Hierarchy - "+(e?`${n?.name}`:"No Scene");return u.jsxs("div",{id:"SidePanel",children:[u.jsx(Et,{label:i,open:!0,children:u.jsx(u.Fragment,{children:e&&u.jsx(sn,{child:n,three:t.three})})}),u.jsx(cn,{three:t.three})]},"SidePanel")}function aa(t){function n(){return t.three.scene===void 0?(console.log("No scene:",t.three),!1):!0}const a=o=>{if(!n())return;const d=t.three.scene?.getObjectByProperty("uuid",o.value);d!==void 0&&t.three.setObject(d)},e=(o,d,h)=>{if(!n())return;const b=t.three.scene?.getObjectByProperty("uuid",o);b!==void 0&&J(b,d,h)},i=o=>{if(!n())return;const d=o.value,{key:h,value:b,uuid:g}=d;e(g,h,b)},c=o=>{if(!n())return;const d=o.value;At(d.value).then(h=>{e(d.uuid,d.key,h),e(d.uuid,"material.needsUpdate",!0)})},f=o=>{if(!n())return;const{key:d,uuid:h,value:b,subitem:g}=o.value,S=t.three.scene?.getObjectByProperty("uuid",h);if(S!==void 0)try{g!==void 0?Mn(S,g)[d](b):S[d](b)}catch(C){console.log("Error requesting method:"),console.log(C),console.log(d),console.log(b)}};return x.useEffect(()=>(N.addEventListener(F.GET_OBJECT,a),N.addEventListener(F.UPDATE_OBJECT,i),N.addEventListener(F.CREATE_TEXTURE,c),N.addEventListener(F.REQUEST_METHOD,f),()=>{N.removeEventListener(F.GET_OBJECT,a),N.removeEventListener(F.UPDATE_OBJECT,i),N.removeEventListener(F.CREATE_TEXTURE,c),N.removeEventListener(F.REQUEST_METHOD,f)}),[]),null}class ia extends l.Line{constructor(n,a){const e=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],i=new l.BufferGeometry;i.setAttribute("position",new l.Float32BufferAttribute(e,3)),i.computeBoundingSphere();const c=new l.LineBasicMaterial({fog:!1});super(i,c),this.light=n,this.color=a,this.type="RectAreaLightHelper";const f=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],o=new l.BufferGeometry;o.setAttribute("position",new l.Float32BufferAttribute(f,3)),o.computeBoundingSphere(),this.add(new l.Mesh(o,new l.MeshBasicMaterial({side:l.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"},Tt={type:"start"},Yt={type:"end"},mt=new l.Ray,Gt=new l.Plane,ra=Math.cos(70*l.MathUtils.DEG2RAD);class sa extends l.EventDispatcher{constructor(n,a){super(),this.object=n,this.domElement=a,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new l.Vector3,this.cursor=new l.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:l.MOUSE.ROTATE,MIDDLE:l.MOUSE.DOLLY,RIGHT:l.MOUSE.PAN},this.touches={ONE:l.TOUCH.ROTATE,TWO:l.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 o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(s){s.addEventListener("keydown",tt),this._domElementKeyEvents=s},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",tt),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(zt),e.update(),c=i.NONE},this.update=function(){const s=new l.Vector3,E=new l.Quaternion().setFromUnitVectors(n.up,new l.Vector3(0,1,0)),_=E.clone().invert(),H=new l.Vector3,Z=new l.Quaternion,ve=new l.Vector3,ue=2*Math.PI;return function(wt=null){const at=e.object.position;s.copy(at).sub(e.target),s.applyQuaternion(E),o.setFromVector3(s),e.autoRotate&&c===i.NONE&&pe(Ce(wt)),e.enableDamping?(o.theta+=d.theta*e.dampingFactor,o.phi+=d.phi*e.dampingFactor):(o.theta+=d.theta,o.phi+=d.phi);let xe=e.minAzimuthAngle,ge=e.maxAzimuthAngle;isFinite(xe)&&isFinite(ge)&&(xe<-Math.PI?xe+=ue:xe>Math.PI&&(xe-=ue),ge<-Math.PI?ge+=ue:ge>Math.PI&&(ge-=ue),xe<=ge?o.theta=Math.max(xe,Math.min(ge,o.theta)):o.theta=o.theta>(xe+ge)/2?Math.max(xe,o.theta):Math.min(ge,o.theta)),o.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,o.phi)),o.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(b,e.dampingFactor):e.target.add(b),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor),e.zoomToCursor&&ye||e.object.isOrthographicCamera?o.radius=Te(o.radius):o.radius=Te(o.radius*h),s.setFromSpherical(o),s.applyQuaternion(_),at.copy(e.target).add(s),e.object.lookAt(e.target),e.enableDamping===!0?(d.theta*=1-e.dampingFactor,d.phi*=1-e.dampingFactor,b.multiplyScalar(1-e.dampingFactor)):(d.set(0,0,0),b.set(0,0,0));let He=!1;if(e.zoomToCursor&&ye){let ze=null;if(e.object.isPerspectiveCamera){const Ye=s.length();ze=Te(Ye*h);const Ge=Ye-ze;e.object.position.addScaledVector(X,Ge),e.object.updateMatrixWorld()}else if(e.object.isOrthographicCamera){const Ye=new l.Vector3(te.x,te.y,0);Ye.unproject(e.object),e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/h)),e.object.updateProjectionMatrix(),He=!0;const Ge=new l.Vector3(te.x,te.y,0);Ge.unproject(e.object),e.object.position.sub(Ge).add(Ye),e.object.updateMatrixWorld(),ze=s.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;ze!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(ze).add(e.object.position):(mt.origin.copy(e.object.position),mt.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(mt.direction))<ra?n.lookAt(e.target):(Gt.setFromNormalAndCoplanarPoint(e.object.up,e.target),mt.intersectPlane(Gt,e.target))))}else e.object.isOrthographicCamera&&(He=h!==1,He&&(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/h)),e.object.updateProjectionMatrix()));return h=1,ye=!1,He||H.distanceToSquared(e.object.position)>f||8*(1-Z.dot(e.object.quaternion))>f||ve.distanceToSquared(e.target)>0?(e.dispatchEvent(zt),H.copy(e.object.position),Z.copy(e.object.quaternion),ve.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Xe),e.domElement.removeEventListener("pointerdown",D),e.domElement.removeEventListener("pointercancel",Q),e.domElement.removeEventListener("wheel",ut),e.domElement.removeEventListener("pointermove",z),e.domElement.removeEventListener("pointerup",Q),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",tt),e._domElementKeyEvents=null)};const e=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 f=1e-6,o=new l.Spherical,d=new l.Spherical;let h=1;const b=new l.Vector3,g=new l.Vector2,S=new l.Vector2,C=new l.Vector2,P=new l.Vector2,k=new l.Vector2,q=new l.Vector2,G=new l.Vector2,B=new l.Vector2,A=new l.Vector2,X=new l.Vector3,te=new l.Vector2;let ye=!1;const K=[],fe={};let le=!1;function Ce(s){return s!==null?2*Math.PI/60*e.autoRotateSpeed*s:2*Math.PI/60/60*e.autoRotateSpeed}function we(s){const E=Math.abs(s*.01);return Math.pow(.95,e.zoomSpeed*E)}function pe(s){d.theta-=s}function U(s){d.phi-=s}const me=function(){const s=new l.Vector3;return function(_,H){s.setFromMatrixColumn(H,0),s.multiplyScalar(-_),b.add(s)}}(),O=function(){const s=new l.Vector3;return function(_,H){e.screenSpacePanning===!0?s.setFromMatrixColumn(H,1):(s.setFromMatrixColumn(H,0),s.crossVectors(e.object.up,s)),s.multiplyScalar(_),b.add(s)}}(),Ee=function(){const s=new l.Vector3;return function(_,H){const Z=e.domElement;if(e.object.isPerspectiveCamera){const ve=e.object.position;s.copy(ve).sub(e.target);let ue=s.length();ue*=Math.tan(e.object.fov/2*Math.PI/180),me(2*_*ue/Z.clientHeight,e.object.matrix),O(2*H*ue/Z.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(me(_*(e.object.right-e.object.left)/e.object.zoom/Z.clientWidth,e.object.matrix),O(H*(e.object.top-e.object.bottom)/e.object.zoom/Z.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function Oe(s){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?h/=s:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function _e(s){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?h*=s:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function Me(s,E){if(!e.zoomToCursor)return;ye=!0;const _=e.domElement.getBoundingClientRect(),H=s-_.left,Z=E-_.top,ve=_.width,ue=_.height;te.x=H/ve*2-1,te.y=-(Z/ue)*2+1,X.set(te.x,te.y,1).unproject(e.object).sub(e.object.position).normalize()}function Te(s){return Math.max(e.minDistance,Math.min(e.maxDistance,s))}function Ae(s){g.set(s.clientX,s.clientY)}function je(s){Me(s.clientX,s.clientX),G.set(s.clientX,s.clientY)}function Ie(s){P.set(s.clientX,s.clientY)}function ae(s){S.set(s.clientX,s.clientY),C.subVectors(S,g).multiplyScalar(e.rotateSpeed);const E=e.domElement;pe(2*Math.PI*C.x/E.clientHeight),U(2*Math.PI*C.y/E.clientHeight),g.copy(S),e.update()}function Se(s){B.set(s.clientX,s.clientY),A.subVectors(B,G),A.y>0?Oe(we(A.y)):A.y<0&&_e(we(A.y)),G.copy(B),e.update()}function Ve(s){k.set(s.clientX,s.clientY),q.subVectors(k,P).multiplyScalar(e.panSpeed),Ee(q.x,q.y),P.copy(k),e.update()}function $e(s){Me(s.clientX,s.clientY),s.deltaY<0?_e(we(s.deltaY)):s.deltaY>0&&Oe(we(s.deltaY)),e.update()}function de(s){let E=!1;switch(s.code){case e.keys.UP:s.ctrlKey||s.metaKey||s.shiftKey?U(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Ee(0,e.keyPanSpeed),E=!0;break;case e.keys.BOTTOM:s.ctrlKey||s.metaKey||s.shiftKey?U(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Ee(0,-e.keyPanSpeed),E=!0;break;case e.keys.LEFT:s.ctrlKey||s.metaKey||s.shiftKey?pe(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Ee(e.keyPanSpeed,0),E=!0;break;case e.keys.RIGHT:s.ctrlKey||s.metaKey||s.shiftKey?pe(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Ee(-e.keyPanSpeed,0),E=!0;break}E&&(s.preventDefault(),e.update())}function m(s){if(K.length===1)g.set(s.pageX,s.pageY);else{const E=Ne(s),_=.5*(s.pageX+E.x),H=.5*(s.pageY+E.y);g.set(_,H)}}function v(s){if(K.length===1)P.set(s.pageX,s.pageY);else{const E=Ne(s),_=.5*(s.pageX+E.x),H=.5*(s.pageY+E.y);P.set(_,H)}}function M(s){const E=Ne(s),_=s.pageX-E.x,H=s.pageY-E.y,Z=Math.sqrt(_*_+H*H);G.set(0,Z)}function L(s){e.enableZoom&&M(s),e.enablePan&&v(s)}function ie(s){e.enableZoom&&M(s),e.enableRotate&&m(s)}function R(s){if(K.length==1)S.set(s.pageX,s.pageY);else{const _=Ne(s),H=.5*(s.pageX+_.x),Z=.5*(s.pageY+_.y);S.set(H,Z)}C.subVectors(S,g).multiplyScalar(e.rotateSpeed);const E=e.domElement;pe(2*Math.PI*C.x/E.clientHeight),U(2*Math.PI*C.y/E.clientHeight),g.copy(S)}function T(s){if(K.length===1)k.set(s.pageX,s.pageY);else{const E=Ne(s),_=.5*(s.pageX+E.x),H=.5*(s.pageY+E.y);k.set(_,H)}q.subVectors(k,P).multiplyScalar(e.panSpeed),Ee(q.x,q.y),P.copy(k)}function V(s){const E=Ne(s),_=s.pageX-E.x,H=s.pageY-E.y,Z=Math.sqrt(_*_+H*H);B.set(0,Z),A.set(0,Math.pow(B.y/G.y,e.zoomSpeed)),Oe(A.y),G.copy(B);const ve=(s.pageX+E.x)*.5,ue=(s.pageY+E.y)*.5;Me(ve,ue)}function re(s){e.enableZoom&&V(s),e.enablePan&&T(s)}function se(s){e.enableZoom&&V(s),e.enableRotate&&R(s)}function D(s){e.enabled!==!1&&(K.length===0&&(e.domElement.setPointerCapture(s.pointerId),e.domElement.addEventListener("pointermove",z),e.domElement.addEventListener("pointerup",Q)),St(s),s.pointerType==="touch"?nt(s):Pe(s))}function z(s){e.enabled!==!1&&(s.pointerType==="touch"?ft(s):Ke(s))}function Q(s){switch(xt(s),K.length){case 0:e.domElement.releasePointerCapture(s.pointerId),e.domElement.removeEventListener("pointermove",z),e.domElement.removeEventListener("pointerup",Q),e.dispatchEvent(Yt),c=i.NONE;break;case 1:const E=K[0],_=fe[E];nt({pointerId:E,pageX:_.x,pageY:_.y});break}}function Pe(s){let E;switch(s.button){case 0:E=e.mouseButtons.LEFT;break;case 1:E=e.mouseButtons.MIDDLE;break;case 2:E=e.mouseButtons.RIGHT;break;default:E=-1}switch(E){case l.MOUSE.DOLLY:if(e.enableZoom===!1)return;je(s),c=i.DOLLY;break;case l.MOUSE.ROTATE:if(s.ctrlKey||s.metaKey||s.shiftKey){if(e.enablePan===!1)return;Ie(s),c=i.PAN}else{if(e.enableRotate===!1)return;Ae(s),c=i.ROTATE}break;case l.MOUSE.PAN:if(s.ctrlKey||s.metaKey||s.shiftKey){if(e.enableRotate===!1)return;Ae(s),c=i.ROTATE}else{if(e.enablePan===!1)return;Ie(s),c=i.PAN}break;default:c=i.NONE}c!==i.NONE&&e.dispatchEvent(Tt)}function Ke(s){switch(c){case i.ROTATE:if(e.enableRotate===!1)return;ae(s);break;case i.DOLLY:if(e.enableZoom===!1)return;Se(s);break;case i.PAN:if(e.enablePan===!1)return;Ve(s);break}}function ut(s){e.enabled===!1||e.enableZoom===!1||c!==i.NONE||(s.preventDefault(),e.dispatchEvent(Tt),$e(dt(s)),e.dispatchEvent(Yt))}function dt(s){const E=s.deltaMode,_={clientX:s.clientX,clientY:s.clientY,deltaY:s.deltaY};switch(E){case 1:_.deltaY*=16;break;case 2:_.deltaY*=100;break}return s.ctrlKey&&!le&&(_.deltaY*=10),_}function ht(s){s.key==="Control"&&(le=!0,e.domElement.getRootNode().addEventListener("keyup",Le,{passive:!0,capture:!0}))}function Le(s){s.key==="Control"&&(le=!1,e.domElement.getRootNode().removeEventListener("keyup",Le,{passive:!0,capture:!0}))}function tt(s){e.enabled===!1||e.enablePan===!1||de(s)}function nt(s){switch(pt(s),K.length){case 1:switch(e.touches.ONE){case l.TOUCH.ROTATE:if(e.enableRotate===!1)return;m(s),c=i.TOUCH_ROTATE;break;case l.TOUCH.PAN:if(e.enablePan===!1)return;v(s),c=i.TOUCH_PAN;break;default:c=i.NONE}break;case 2:switch(e.touches.TWO){case l.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;L(s),c=i.TOUCH_DOLLY_PAN;break;case l.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;ie(s),c=i.TOUCH_DOLLY_ROTATE;break;default:c=i.NONE}break;default:c=i.NONE}c!==i.NONE&&e.dispatchEvent(Tt)}function ft(s){switch(pt(s),c){case i.TOUCH_ROTATE:if(e.enableRotate===!1)return;R(s),e.update();break;case i.TOUCH_PAN:if(e.enablePan===!1)return;T(s),e.update();break;case i.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;re(s),e.update();break;case i.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;se(s),e.update();break;default:c=i.NONE}}function Xe(s){e.enabled!==!1&&s.preventDefault()}function St(s){K.push(s.pointerId)}function xt(s){delete fe[s.pointerId];for(let E=0;E<K.length;E++)if(K[E]==s.pointerId){K.splice(E,1);return}}function pt(s){let E=fe[s.pointerId];E===void 0&&(E=new l.Vector2,fe[s.pointerId]=E),E.set(s.pageX,s.pageY)}function Ne(s){const E=s.pointerId===K[0]?K[1]:K[0];return fe[E]}e.domElement.addEventListener("contextmenu",Xe),e.domElement.addEventListener("pointerdown",D),e.domElement.addEventListener("pointercancel",Q),e.domElement.addEventListener("wheel",ut,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",ht,{passive:!0,capture:!0}),this.update()}}const bt=t=>{const[n,a]=x.useState(t.options[t.index]),e=()=>{t.onToggle(!t.open)},i=c=>{c!==n&&(t.onSelect(c),a(c)),t.onToggle(!1)};return u.jsxs("div",{className:`dropdown ${t.up===!0?"up":""}`,children:[u.jsx("div",{className:"dropdown-toggle",onClick:e,children:n}),t.open&&u.jsx("ul",{className:"dropdown-menu",children:t.options.map(c=>u.jsx("li",{onClick:()=>i(c),children:c},c))})]})},We=x.forwardRef(function(n,a){const[e,i]=x.useState(!1),c=n.options.indexOf(n.camera.name);return u.jsxs("div",{className:"CameraWindow",children:[u.jsx("div",{ref:a,className:"clickable",onClick:()=>{e&&i(!1)}}),u.jsx(bt,{index:c,open:e,options:n.options,onSelect:n.onSelect,onToggle:f=>{i(f)},up:!0})]})});class oa extends l.ShaderMaterial{constructor(n){super({extensions:{derivatives:!0},glslVersion:l.GLSL3,side:l.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 l.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;
30
+ `)>-1),d=o||t.type==="image"||t.type==="vector",h=b=>{let g=b.target.value;t.type==="boolean"?g=b.target.checked:t.type==="option"&&(g=t.options[g].value),e(g),t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,g)};return u.jsxs("div",{className:`field ${d?"block":""}`,children:[t.type!=="button"&&u.jsx("label",{ref:i,children:ct(t.title)},"fieldLabel"),t.type==="string"&&!o&&u.jsx("input",{type:"text",disabled:t.disabled,onChange:h,value:a}),t.type==="string"&&o&&u.jsx("textarea",{cols:50,rows:10,disabled:t.disabled!==void 0?t.disabled:!0,onChange:h,value:a}),t.type==="boolean"&&u.jsx("input",{type:"checkbox",disabled:t.disabled,onChange:h,checked:a}),t.type==="number"&&u.jsx("input",{ref:c,type:"number",value:a,min:t.min,max:t.max,step:t.step,disabled:t.disabled,onChange:h}),t.type==="range"&&u.jsxs(u.Fragment,{children:[u.jsx("input",{type:"text",value:a.toString(),onChange:h,disabled:t.disabled,className:"min"}),u.jsx("input",{disabled:t.disabled,type:"range",value:a,min:t.min,max:t.max,step:t.step,onChange:h})]}),t.type==="color"&&u.jsxs(u.Fragment,{children:[u.jsx("input",{type:"text",value:a.toString(),onChange:h,disabled:t.disabled,className:"color"}),u.jsx("input",{type:"color",value:a,onChange:h,disabled:t.disabled})]}),t.type==="button"&&u.jsx("button",{disabled:t.disabled,onClick:()=>{t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,!0)},children:t.title}),t.type==="image"&&u.jsx("img",{ref:f,onClick:()=>{Fn().then(b=>{f.current.src=b,t.onChange!==void 0&&t.onChange(t.prop!==void 0?t.prop:t.title,b)})},src:a.length>0?a:jn}),t.type==="option"&&u.jsx(u.Fragment,{children:u.jsx("select",{onChange:h,disabled:t.disabled,defaultValue:t.value,children:t.options?.map((b,g)=>u.jsx("option",{value:b.value,children:ct(b.title)},g))})}),t.type==="vector"&&u.jsx(qn,{value:a,min:-1,max:1,onChange:h})]})}function $t(t){switch(t){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 t}function Kn(t,n){const a=[];if(t.perspectiveCameraInfo!==void 0)for(const e in t.perspectiveCameraInfo)a.push({title:$t(e),prop:e,type:"number",step:.01,value:t.perspectiveCameraInfo[e],onChange:(i,c)=>{n.updateObject(t.uuid,i,c),n.requestMethod(t.uuid,"updateProjectionMatrix");const f=n.scene?.getObjectByProperty("uuid",t.uuid);f!==void 0&&(J(f,i,c),f.updateProjectionMatrix())}});else if(t.orthographicCameraInfo!==void 0)for(const e in t.orthographicCameraInfo)a.push({title:$t(e),prop:e,type:"number",step:.01,value:t.perspectiveCameraInfo[e],onChange:(i,c)=>{n.updateObject(t.uuid,i,c),n.requestMethod(t.uuid,"updateProjectionMatrix");const f=n.scene?.getObjectByProperty("uuid",t.uuid);f!==void 0&&(J(f,i,c),f.updateProjectionMatrix())}});return u.jsx(qe,{title:"Camera",items:a})}const Xn=Math.PI/180,Zn=180/Math.PI;function Qe(t,n,a,e,i){return e+(t-n)*(i-e)/(a-n)}function Jn(t){return t*Xn}function Mt(t){return t*Zn}function Qn(t,n){const a=new l.Matrix4;a.elements=t.matrix;const e=new l.Vector3,i=new l.Euler,c=new l.Vector3;t.uuid.length>0&&(e.setFromMatrixPosition(a),i.setFromRotationMatrix(a),c.setFromMatrixScale(a));const f=(d,h)=>{n.updateObject(t.uuid,d,h);const b=n.scene?.getObjectByProperty("uuid",t.uuid);b!==void 0&&J(b,d,h)},o=(d,h)=>{f(d,Jn(h))};return u.jsx(qe,{title:"Transform",items:[{title:"Position X",prop:"position.x",type:"number",value:e.x,onChange:f},{title:"Position Y",prop:"position.y",type:"number",value:e.y,onChange:f},{title:"Position Z",prop:"position.z",type:"number",value:e.z,onChange:f},{title:"Rotation X",prop:"rotation.x",type:"number",value:et(Mt(i.x)),min:-360,max:360,step:.1,onChange:o},{title:"Rotation Y",prop:"rotation.y",type:"number",value:et(Mt(i.y)),min:-360,max:360,step:.1,onChange:o},{title:"Rotation Z",prop:"rotation.z",type:"number",value:et(Mt(i.z)),min:-360,max:360,step:.1,onChange:o},{title:"Scale X",prop:"scale.x",type:"number",value:c.x,step:.01,onChange:f},{title:"Scale Y",prop:"scale.y",type:"number",value:c.y,step:.01,onChange:f},{title:"Scale Z",prop:"scale.z",type:"number",value:c.z,step:.01,onChange:f}]})}function Ht(t){switch(t){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 t}function ea(t,n){const a=[];if(t.lightInfo!==void 0)for(const e in t.lightInfo){const i=t.lightInfo[e];i!==void 0&&(i.isColor!==void 0?a.push({title:Ht(e),prop:e,type:"color",value:i,onChange:(c,f)=>{const o=new l.Color(f);n.updateObject(t.uuid,c,o);const d=n.scene?.getObjectByProperty("uuid",t.uuid);d!==void 0&&J(d,c,o)}}):a.push({title:Ht(e),prop:e,type:typeof i,value:i,step:typeof i=="number"?.01:void 0,onChange:(c,f)=>{n.updateObject(t.uuid,c,f);const o=n.scene?.getObjectByProperty("uuid",t.uuid);o!==void 0&&J(o,c,f)}}))}return u.jsx(qe,{title:"Light",items:a})}function ta(t,n){const a=[],e=[];let i=0;t.animations.forEach(o=>{i=Math.max(i,o.duration),o.duration>0&&e.push({title:o.name,items:[{title:"Duration",type:"number",value:o.duration,disabled:!0},{title:"Blend Mode",type:"option",disabled:!0,options:[{title:"Normal",value:2500},{title:"Additive",value:2501}]}]})}),a.push({title:"Animations",items:e});const c=n.scene?.getObjectByProperty("uuid",t.uuid);let f=!1;if(c!==void 0){const o=c.mixer;if(f=o!==void 0,f){const d=[{title:"Time Scale",type:"range",value:o.timeScale,step:.01,min:-1,max:2,onChange:(h,b)=>{o.timeScale=b,n.updateObject(t.uuid,"mixer.timeScale",b)}}];d.push({title:"Stop All",type:"button",onChange:()=>{o.stopAllAction(),n.requestMethod(t.uuid,"stopAllAction",void 0,"mixer")}}),a.push({title:"Mixer",items:d})}}return u.jsx(qe,{title:"Animation",items:a})}const on={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};let oe={...on};function cn(t){const[n,a]=x.useState(-1);x.useEffect(()=>{function f(d){oe={...d.value},a(Date.now())}function o(){oe={...on},a(Date.now())}return N.addEventListener(F.SET_SCENE,o),N.addEventListener(F.SET_OBJECT,f),()=>{N.removeEventListener(F.SET_SCENE,o),N.removeEventListener(F.SET_OBJECT,f)}},[]);const e=oe.type.toLowerCase(),i=oe.animations.length>0||oe.mixer!==void 0,c=e.search("mesh")>-1||e.search("line")>-1||e.search("points")>-1;return u.jsx(Et,{label:"Inspector",children:u.jsx("div",{id:"Inspector",className:t.class,children:oe.uuid.length>0&&u.jsxs(u.Fragment,{children:[u.jsxs(u.Fragment,{children:[u.jsx(ot,{type:"string",title:"Name",prop:"name",value:oe.name,disabled:!0}),u.jsx(ot,{type:"string",title:"Type",prop:"type",value:oe.type,disabled:!0}),u.jsx(ot,{type:"string",title:"UUID",prop:"uuid",value:oe.uuid,disabled:!0}),u.jsx(ot,{type:"boolean",title:"Visible",prop:"visible",value:oe.visible,onChange:(f,o)=>{t.three.updateObject(oe.uuid,f,o);const d=t.three.scene?.getObjectByProperty("uuid",oe.uuid);d!==void 0&&J(d,f,o)}})]}),u.jsxs(u.Fragment,{children:[Qn(oe,t.three),i?ta(oe,t.three):null,e.search("camera")>-1?Kn(oe,t.three):null,e.search("light")>-1?ea(oe,t.three):null,c?Wn(oe,t.three):null]})]})},n)},"Inspector")}function na(t){const[n,a]=x.useState(t.scene);x.useEffect(()=>{const c=f=>{a(f.value)};return N.addEventListener(F.SET_SCENE,c),()=>{N.removeEventListener(F.SET_SCENE,c)}},[]);const e=n!==null,i="Hierarchy - "+(e?`${n?.name}`:"No Scene");return u.jsxs("div",{id:"SidePanel",children:[u.jsx(Et,{label:i,open:!0,children:u.jsx(u.Fragment,{children:e&&u.jsx(sn,{child:n,three:t.three})})}),u.jsx(cn,{three:t.three})]},"SidePanel")}function aa(t){function n(){return t.three.scene===void 0?(console.log("No scene:",t.three),!1):!0}const a=o=>{if(!n())return;const d=t.three.scene?.getObjectByProperty("uuid",o.value);d!==void 0&&t.three.setObject(d)},e=(o,d,h)=>{if(!n())return;const b=t.three.scene?.getObjectByProperty("uuid",o);b!==void 0&&J(b,d,h)},i=o=>{if(!n())return;const d=o.value,{key:h,value:b,uuid:g}=d;e(g,h,b)},c=o=>{if(!n())return;const d=o.value;At(d.value).then(h=>{e(d.uuid,d.key,h),e(d.uuid,"material.needsUpdate",!0)})},f=o=>{if(!n())return;const{key:d,uuid:h,value:b,subitem:g}=o.value,S=t.three.scene?.getObjectByProperty("uuid",h);if(S!==void 0)try{g!==void 0?Mn(S,g)[d](b):S[d](b)}catch(C){console.log("Error requesting method:"),console.log(C),console.log(d),console.log(b)}};return x.useEffect(()=>(N.addEventListener(F.GET_OBJECT,a),N.addEventListener(F.UPDATE_OBJECT,i),N.addEventListener(F.CREATE_TEXTURE,c),N.addEventListener(F.REQUEST_METHOD,f),()=>{N.removeEventListener(F.GET_OBJECT,a),N.removeEventListener(F.UPDATE_OBJECT,i),N.removeEventListener(F.CREATE_TEXTURE,c),N.removeEventListener(F.REQUEST_METHOD,f)}),[]),null}class ia extends l.Line{constructor(n,a){const e=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],i=new l.BufferGeometry;i.setAttribute("position",new l.Float32BufferAttribute(e,3)),i.computeBoundingSphere();const c=new l.LineBasicMaterial({fog:!1});super(i,c),this.light=n,this.color=a,this.type="RectAreaLightHelper";const f=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],o=new l.BufferGeometry;o.setAttribute("position",new l.Float32BufferAttribute(f,3)),o.computeBoundingSphere(),this.add(new l.Mesh(o,new l.MeshBasicMaterial({side:l.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"},Tt={type:"start"},Yt={type:"end"},mt=new l.Ray,Gt=new l.Plane,ra=Math.cos(70*l.MathUtils.DEG2RAD);class sa extends l.EventDispatcher{constructor(n,a){super(),this.object=n,this.domElement=a,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new l.Vector3,this.cursor=new l.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:l.MOUSE.ROTATE,MIDDLE:l.MOUSE.DOLLY,RIGHT:l.MOUSE.PAN},this.touches={ONE:l.TOUCH.ROTATE,TWO:l.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 o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(s){s.addEventListener("keydown",tt),this._domElementKeyEvents=s},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",tt),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(zt),e.update(),c=i.NONE},this.update=function(){const s=new l.Vector3,E=new l.Quaternion().setFromUnitVectors(n.up,new l.Vector3(0,1,0)),_=E.clone().invert(),H=new l.Vector3,Z=new l.Quaternion,ve=new l.Vector3,ue=2*Math.PI;return function(wt=null){const at=e.object.position;s.copy(at).sub(e.target),s.applyQuaternion(E),o.setFromVector3(s),e.autoRotate&&c===i.NONE&&pe(Ce(wt)),e.enableDamping?(o.theta+=d.theta*e.dampingFactor,o.phi+=d.phi*e.dampingFactor):(o.theta+=d.theta,o.phi+=d.phi);let xe=e.minAzimuthAngle,ge=e.maxAzimuthAngle;isFinite(xe)&&isFinite(ge)&&(xe<-Math.PI?xe+=ue:xe>Math.PI&&(xe-=ue),ge<-Math.PI?ge+=ue:ge>Math.PI&&(ge-=ue),xe<=ge?o.theta=Math.max(xe,Math.min(ge,o.theta)):o.theta=o.theta>(xe+ge)/2?Math.max(xe,o.theta):Math.min(ge,o.theta)),o.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,o.phi)),o.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(b,e.dampingFactor):e.target.add(b),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor),e.zoomToCursor&&ye||e.object.isOrthographicCamera?o.radius=Te(o.radius):o.radius=Te(o.radius*h),s.setFromSpherical(o),s.applyQuaternion(_),at.copy(e.target).add(s),e.object.lookAt(e.target),e.enableDamping===!0?(d.theta*=1-e.dampingFactor,d.phi*=1-e.dampingFactor,b.multiplyScalar(1-e.dampingFactor)):(d.set(0,0,0),b.set(0,0,0));let He=!1;if(e.zoomToCursor&&ye){let ze=null;if(e.object.isPerspectiveCamera){const Ye=s.length();ze=Te(Ye*h);const Ge=Ye-ze;e.object.position.addScaledVector(X,Ge),e.object.updateMatrixWorld()}else if(e.object.isOrthographicCamera){const Ye=new l.Vector3(te.x,te.y,0);Ye.unproject(e.object),e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/h)),e.object.updateProjectionMatrix(),He=!0;const Ge=new l.Vector3(te.x,te.y,0);Ge.unproject(e.object),e.object.position.sub(Ge).add(Ye),e.object.updateMatrixWorld(),ze=s.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;ze!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(ze).add(e.object.position):(mt.origin.copy(e.object.position),mt.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(mt.direction))<ra?n.lookAt(e.target):(Gt.setFromNormalAndCoplanarPoint(e.object.up,e.target),mt.intersectPlane(Gt,e.target))))}else e.object.isOrthographicCamera&&(He=h!==1,He&&(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/h)),e.object.updateProjectionMatrix()));return h=1,ye=!1,He||H.distanceToSquared(e.object.position)>f||8*(1-Z.dot(e.object.quaternion))>f||ve.distanceToSquared(e.target)>0?(e.dispatchEvent(zt),H.copy(e.object.position),Z.copy(e.object.quaternion),ve.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Xe),e.domElement.removeEventListener("pointerdown",D),e.domElement.removeEventListener("pointercancel",Q),e.domElement.removeEventListener("wheel",ut),e.domElement.removeEventListener("pointermove",z),e.domElement.removeEventListener("pointerup",Q),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",tt),e._domElementKeyEvents=null)};const e=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 f=1e-6,o=new l.Spherical,d=new l.Spherical;let h=1;const b=new l.Vector3,g=new l.Vector2,S=new l.Vector2,C=new l.Vector2,P=new l.Vector2,k=new l.Vector2,q=new l.Vector2,G=new l.Vector2,B=new l.Vector2,A=new l.Vector2,X=new l.Vector3,te=new l.Vector2;let ye=!1;const K=[],fe={};let le=!1;function Ce(s){return s!==null?2*Math.PI/60*e.autoRotateSpeed*s:2*Math.PI/60/60*e.autoRotateSpeed}function we(s){const E=Math.abs(s*.01);return Math.pow(.95,e.zoomSpeed*E)}function pe(s){d.theta-=s}function U(s){d.phi-=s}const me=function(){const s=new l.Vector3;return function(_,H){s.setFromMatrixColumn(H,0),s.multiplyScalar(-_),b.add(s)}}(),O=function(){const s=new l.Vector3;return function(_,H){e.screenSpacePanning===!0?s.setFromMatrixColumn(H,1):(s.setFromMatrixColumn(H,0),s.crossVectors(e.object.up,s)),s.multiplyScalar(_),b.add(s)}}(),Ee=function(){const s=new l.Vector3;return function(_,H){const Z=e.domElement;if(e.object.isPerspectiveCamera){const ve=e.object.position;s.copy(ve).sub(e.target);let ue=s.length();ue*=Math.tan(e.object.fov/2*Math.PI/180),me(2*_*ue/Z.clientHeight,e.object.matrix),O(2*H*ue/Z.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(me(_*(e.object.right-e.object.left)/e.object.zoom/Z.clientWidth,e.object.matrix),O(H*(e.object.top-e.object.bottom)/e.object.zoom/Z.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function Oe(s){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?h/=s:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function _e(s){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?h*=s:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function Me(s,E){if(!e.zoomToCursor)return;ye=!0;const _=e.domElement.getBoundingClientRect(),H=s-_.left,Z=E-_.top,ve=_.width,ue=_.height;te.x=H/ve*2-1,te.y=-(Z/ue)*2+1,X.set(te.x,te.y,1).unproject(e.object).sub(e.object.position).normalize()}function Te(s){return Math.max(e.minDistance,Math.min(e.maxDistance,s))}function Ae(s){g.set(s.clientX,s.clientY)}function je(s){Me(s.clientX,s.clientX),G.set(s.clientX,s.clientY)}function Ie(s){P.set(s.clientX,s.clientY)}function ae(s){S.set(s.clientX,s.clientY),C.subVectors(S,g).multiplyScalar(e.rotateSpeed);const E=e.domElement;pe(2*Math.PI*C.x/E.clientHeight),U(2*Math.PI*C.y/E.clientHeight),g.copy(S),e.update()}function Se(s){B.set(s.clientX,s.clientY),A.subVectors(B,G),A.y>0?Oe(we(A.y)):A.y<0&&_e(we(A.y)),G.copy(B),e.update()}function Ve(s){k.set(s.clientX,s.clientY),q.subVectors(k,P).multiplyScalar(e.panSpeed),Ee(q.x,q.y),P.copy(k),e.update()}function $e(s){Me(s.clientX,s.clientY),s.deltaY<0?_e(we(s.deltaY)):s.deltaY>0&&Oe(we(s.deltaY)),e.update()}function de(s){let E=!1;switch(s.code){case e.keys.UP:s.ctrlKey||s.metaKey||s.shiftKey?U(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Ee(0,e.keyPanSpeed),E=!0;break;case e.keys.BOTTOM:s.ctrlKey||s.metaKey||s.shiftKey?U(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Ee(0,-e.keyPanSpeed),E=!0;break;case e.keys.LEFT:s.ctrlKey||s.metaKey||s.shiftKey?pe(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Ee(e.keyPanSpeed,0),E=!0;break;case e.keys.RIGHT:s.ctrlKey||s.metaKey||s.shiftKey?pe(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):Ee(-e.keyPanSpeed,0),E=!0;break}E&&(s.preventDefault(),e.update())}function m(s){if(K.length===1)g.set(s.pageX,s.pageY);else{const E=Ne(s),_=.5*(s.pageX+E.x),H=.5*(s.pageY+E.y);g.set(_,H)}}function v(s){if(K.length===1)P.set(s.pageX,s.pageY);else{const E=Ne(s),_=.5*(s.pageX+E.x),H=.5*(s.pageY+E.y);P.set(_,H)}}function M(s){const E=Ne(s),_=s.pageX-E.x,H=s.pageY-E.y,Z=Math.sqrt(_*_+H*H);G.set(0,Z)}function L(s){e.enableZoom&&M(s),e.enablePan&&v(s)}function ie(s){e.enableZoom&&M(s),e.enableRotate&&m(s)}function R(s){if(K.length==1)S.set(s.pageX,s.pageY);else{const _=Ne(s),H=.5*(s.pageX+_.x),Z=.5*(s.pageY+_.y);S.set(H,Z)}C.subVectors(S,g).multiplyScalar(e.rotateSpeed);const E=e.domElement;pe(2*Math.PI*C.x/E.clientHeight),U(2*Math.PI*C.y/E.clientHeight),g.copy(S)}function T(s){if(K.length===1)k.set(s.pageX,s.pageY);else{const E=Ne(s),_=.5*(s.pageX+E.x),H=.5*(s.pageY+E.y);k.set(_,H)}q.subVectors(k,P).multiplyScalar(e.panSpeed),Ee(q.x,q.y),P.copy(k)}function V(s){const E=Ne(s),_=s.pageX-E.x,H=s.pageY-E.y,Z=Math.sqrt(_*_+H*H);B.set(0,Z),A.set(0,Math.pow(B.y/G.y,e.zoomSpeed)),Oe(A.y),G.copy(B);const ve=(s.pageX+E.x)*.5,ue=(s.pageY+E.y)*.5;Me(ve,ue)}function re(s){e.enableZoom&&V(s),e.enablePan&&T(s)}function se(s){e.enableZoom&&V(s),e.enableRotate&&R(s)}function D(s){e.enabled!==!1&&(K.length===0&&(e.domElement.setPointerCapture(s.pointerId),e.domElement.addEventListener("pointermove",z),e.domElement.addEventListener("pointerup",Q)),St(s),s.pointerType==="touch"?nt(s):Pe(s))}function z(s){e.enabled!==!1&&(s.pointerType==="touch"?ft(s):Ke(s))}function Q(s){switch(xt(s),K.length){case 0:e.domElement.releasePointerCapture(s.pointerId),e.domElement.removeEventListener("pointermove",z),e.domElement.removeEventListener("pointerup",Q),e.dispatchEvent(Yt),c=i.NONE;break;case 1:const E=K[0],_=fe[E];nt({pointerId:E,pageX:_.x,pageY:_.y});break}}function Pe(s){let E;switch(s.button){case 0:E=e.mouseButtons.LEFT;break;case 1:E=e.mouseButtons.MIDDLE;break;case 2:E=e.mouseButtons.RIGHT;break;default:E=-1}switch(E){case l.MOUSE.DOLLY:if(e.enableZoom===!1)return;je(s),c=i.DOLLY;break;case l.MOUSE.ROTATE:if(s.ctrlKey||s.metaKey||s.shiftKey){if(e.enablePan===!1)return;Ie(s),c=i.PAN}else{if(e.enableRotate===!1)return;Ae(s),c=i.ROTATE}break;case l.MOUSE.PAN:if(s.ctrlKey||s.metaKey||s.shiftKey){if(e.enableRotate===!1)return;Ae(s),c=i.ROTATE}else{if(e.enablePan===!1)return;Ie(s),c=i.PAN}break;default:c=i.NONE}c!==i.NONE&&e.dispatchEvent(Tt)}function Ke(s){switch(c){case i.ROTATE:if(e.enableRotate===!1)return;ae(s);break;case i.DOLLY:if(e.enableZoom===!1)return;Se(s);break;case i.PAN:if(e.enablePan===!1)return;Ve(s);break}}function ut(s){e.enabled===!1||e.enableZoom===!1||c!==i.NONE||(s.preventDefault(),e.dispatchEvent(Tt),$e(dt(s)),e.dispatchEvent(Yt))}function dt(s){const E=s.deltaMode,_={clientX:s.clientX,clientY:s.clientY,deltaY:s.deltaY};switch(E){case 1:_.deltaY*=16;break;case 2:_.deltaY*=100;break}return s.ctrlKey&&!le&&(_.deltaY*=10),_}function ht(s){s.key==="Control"&&(le=!0,e.domElement.getRootNode().addEventListener("keyup",Le,{passive:!0,capture:!0}))}function Le(s){s.key==="Control"&&(le=!1,e.domElement.getRootNode().removeEventListener("keyup",Le,{passive:!0,capture:!0}))}function tt(s){e.enabled===!1||e.enablePan===!1||de(s)}function nt(s){switch(pt(s),K.length){case 1:switch(e.touches.ONE){case l.TOUCH.ROTATE:if(e.enableRotate===!1)return;m(s),c=i.TOUCH_ROTATE;break;case l.TOUCH.PAN:if(e.enablePan===!1)return;v(s),c=i.TOUCH_PAN;break;default:c=i.NONE}break;case 2:switch(e.touches.TWO){case l.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;L(s),c=i.TOUCH_DOLLY_PAN;break;case l.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;ie(s),c=i.TOUCH_DOLLY_ROTATE;break;default:c=i.NONE}break;default:c=i.NONE}c!==i.NONE&&e.dispatchEvent(Tt)}function ft(s){switch(pt(s),c){case i.TOUCH_ROTATE:if(e.enableRotate===!1)return;R(s),e.update();break;case i.TOUCH_PAN:if(e.enablePan===!1)return;T(s),e.update();break;case i.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;re(s),e.update();break;case i.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;se(s),e.update();break;default:c=i.NONE}}function Xe(s){e.enabled!==!1&&s.preventDefault()}function St(s){K.push(s.pointerId)}function xt(s){delete fe[s.pointerId];for(let E=0;E<K.length;E++)if(K[E]==s.pointerId){K.splice(E,1);return}}function pt(s){let E=fe[s.pointerId];E===void 0&&(E=new l.Vector2,fe[s.pointerId]=E),E.set(s.pageX,s.pageY)}function Ne(s){const E=s.pointerId===K[0]?K[1]:K[0];return fe[E]}e.domElement.addEventListener("contextmenu",Xe),e.domElement.addEventListener("pointerdown",D),e.domElement.addEventListener("pointercancel",Q),e.domElement.addEventListener("wheel",ut,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",ht,{passive:!0,capture:!0}),this.update()}}const bt=t=>{const[n,a]=x.useState(t.options[t.index]),e=()=>{t.onToggle(!t.open)},i=c=>{c!==n&&(t.onSelect(c),a(c)),t.onToggle(!1)};return u.jsxs("div",{className:`dropdown ${t.up===!0?"up":""}`,children:[u.jsx("div",{className:"dropdown-toggle",onClick:e,children:n}),t.open&&u.jsx("ul",{className:"dropdown-menu",children:t.options.map(c=>u.jsx("li",{onClick:()=>i(c),children:c},c))})]})},We=x.forwardRef(function(n,a){const[e,i]=x.useState(!1),c=n.options.indexOf(n.camera.name);return u.jsxs("div",{className:"CameraWindow",children:[u.jsx("div",{ref:a,className:"clickable",onClick:()=>{e&&i(!1)}}),u.jsx(bt,{index:c,open:e,options:n.options,onSelect:n.onSelect,onToggle:f=>{i(f)},up:!0})]})});class oa extends l.ShaderMaterial{constructor(n){super({extensions:{derivatives:!0},glslVersion:l.GLSL3,side:l.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 l.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() {
package/dist/hermes.es.js CHANGED
@@ -2771,6 +2771,10 @@ function en(t) {
2771
2771
  return "Penumbra";
2772
2772
  case "groundColor":
2773
2773
  return "Ground Color";
2774
+ case "width":
2775
+ return "Width";
2776
+ case "height":
2777
+ return "Height";
2774
2778
  }
2775
2779
  return t;
2776
2780
  }
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "module": "./dist/hermes.esm.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "type": "module",
10
- "version": "0.0.50",
10
+ "version": "0.0.51",
11
11
  "homepage": "https://github.com/tomorrowevening/hermes#readme",
12
12
  "bugs": {
13
13
  "url": "https://github.com/tomorrowevening/hermes/issues"
@@ -87,6 +87,8 @@ export interface LightInfo {
87
87
  intensity: number;
88
88
  decay?: number;
89
89
  distance?: number;
90
+ width?: number;
91
+ height?: number;
90
92
  angle?: number;
91
93
  penumbra?: number;
92
94
  groundColor?: Color;