var ea=Object.defineProperty;var ta=(a,e,r)=>e in a?ea(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var P=(a,e,r)=>(ta(a,typeof e!="symbol"?e+"":e,r),r);import{aN as Ve,bB as we,aC as o,aD as ae,bv as Ee,cn as ve,c4 as lt,c5 as je,co as ie,cm as le,ex as me,aU as X,aI as Y,aX as aa,aV as N,b7 as ze,cH as ee,b6 as ct,eL as Ce,eM as de,bx as ra,bj as sa,bW as _,eN as na,bQ as Vt,eO as oa,eP as ia,eQ as la,eR as ca,eS as pa,eT as q,aG as ua,eU as ma,aJ as It,aL as Ot,aK as da,eV as ha,eW as fa,eX as ya,eY as he,cF as ba,ck as Te,cl as Le,bN as ge,cq as wt,B as Et,cr as jt,eJ as va,E as ga,C as A,eZ as W,e_ as F,e$ as be,e as c,x as J,f as R,z as xa,p as C,s as O}from"./index-a76b28be.js";import{u as kt}from"./index-4d966268.js";import{c as Sa}from"./Component-c8533dc0.js";import"./postmen-a4b10828.js";import{c as Pa}from"./createOnModelChange-b57a0da8.js";import{R as Ma}from"./ReferencedMaterial-8754168f.js";import"./TextureAsset-199dfb12.js";import"./GlTFAsset-33f6ae7a.js";import"./MaterialAsset-a562f072.js";import{MeshAsset as za}from"./MeshAsset-876a16c1.js";import"./AnimatorControllerAsset-f7c0ef7b.js";import"./AnimationClipAsset-c562ce9a.js";import"./ShaderChunkAsset-f35271e2.js";import"./AmbientLightAsset-71ac08b2.js";import"./SpineSkeletonDataAsset-df3364ed.js";import"./FontAsset-366d2934.js";import"./SceneAsset-707b4310.js";import"./ShaderAsset-62ee0046.js";import"./PrimitiveMesh-e469ec9c.js";import"./XRReferenceImageAsset-ae1178a2.js";import"./PrefabAsset-67f04dc2.js";import"./PhysicsMaterialAsset-881ae82b.js";import"./RenderTargetAsset-c3a95536.js";import"./AudioAsset-77dc8657.js";import"./index-3610d469.js";import"./MarkdownAsset-c3b198a4.js";import{B as rt}from"./index-8d2137e9.js";import"./MaterialInspector-b9e7c829.js";import"./IconPointFilled-4673caaf.js";import"./enum-58295f88.js";import"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./Tooltip-1d89ba5a.js";import"./AssetViewer-06848056.js";import"./ktx2-encoder-f09e14bc.js";import"./TaskQueue-05c94a4d.js";import"./ktx-parse.modern-6c9f771f.js";import"./glTFIO-45ff9a17.js";import"./ProxyConfigs-ab5351dd.js";import"./index-e599c562.js";import"./MeshThumbnail-5c847b20.js";import"./bundlers-2baa0360.js";import"./module-04c2cdff.js";import"./module-6cc65702.js";import"./ShaderUIScriptAsset-b7befe23.js";import"./FormItemArray-5fd4d94b.js";import"./Accordion-90fa6bfc.js";import"./module-0d03e6f6.js";import"./Menu-77e63435.js";/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Bt=Ve("outline","ease-in","IconEaseIn",[["path",{d:"M3 20c8 0 18 -16 18 -16",key:"svg-0"}]]);/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var pt=Ve("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Dt=Ve("outline","plus-minus","IconPlusMinus",[["path",{d:"M4 7h6",key:"svg-0"}],["path",{d:"M7 4v6",key:"svg-1"}],["path",{d:"M20 18h-6",key:"svg-2"}],["path",{d:"M5 19l14 -14",key:"svg-3"}]]);/**
 * @license @tabler/icons-react v3.24.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var Ft=Ve("outline","vector-bezier-2","IconVectorBezier2",[["path",{d:"M3 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M17 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M7 5l7 0",key:"svg-2"}],["path",{d:"M10 19l7 0",key:"svg-3"}],["path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-5"}],["path",{d:"M7 5.5a5 6.5 0 0 1 5 6.5a5 6.5 0 0 0 5 6.5",key:"svg-6"}]]);const Tt=[{type:"constant",icon:o.jsx(pt,{size:"14px"}),columns:"1fr 32px"},{type:"gradient",icon:o.jsx(Bt,{size:"14px"}),columns:"1fr 32px"},{type:"two-constant",icon:o.jsx(Dt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"},{type:"two-gradient",icon:o.jsx(Ft,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"}];function Ca(a){return a.map(e=>{const{type:r,value:t}=e;return r==="constant"?{type:r,label:e.label,value:ie(t)}:r==="two-constant"?{type:r,label:e.label,value:[ie(t[0]),ie(t[1])]}:r==="gradient"?{type:r,label:e.label,value:{color:t.color.map(s=>({value:ie(s.value),time:s.position})),alpha:t.alpha.map(s=>({value:s.value.a,time:s.position}))}}:r==="two-gradient"?{type:r,label:e.label,value:[{color:t[0].color.map(s=>({value:ie(s.value),time:s.position})),alpha:t[0].alpha.map(s=>({value:s.value.a,time:s.position}))},{color:t[1].color.map(s=>({value:ie(s.value),time:s.position})),alpha:t[1].alpha.map(s=>({value:s.value.a,time:s.position}))}]}:e})}function Oa(a){return a.map(e=>{const{type:r,value:t}=e;return r==="constant"?{type:r,label:e.label,value:le(t)}:r==="two-constant"?{type:r,label:e.label,value:[le(t[0]),le(t[1])]}:r==="gradient"?{type:r,label:e.label,value:{color:t.color.map(s=>({value:le(s.value),position:s.time})),alpha:t.alpha.map(s=>({value:{r:255,g:255,b:255,a:s.value},position:s.time}))}}:r==="two-gradient"?{type:r,label:e.label,value:[{color:t[0].color.map(s=>({value:le(s.value),position:s.time})),alpha:t[0].alpha.map(s=>({value:{r:255,g:255,b:255,a:s.value},position:s.time}))},{color:t[1].color.map(s=>({value:le(s.value),position:s.time})),alpha:t[1].alpha.map(s=>({value:{r:255,g:255,b:255,a:s.value},position:s.time}))}]}:e})}function st({hdr:a,value:e,onValueChange:r,...t}){return a?o.jsx(ve,{...t,mode:"hdr",value:e,onValueChange:r}):o.jsx(ve,{...t,mode:"constant",value:e,onValueChange:r})}function Yt(a){var i;const{label:e,labelFirst:r,info:t,value:s,hdr:l=!1}=a,[d,p]=we({prop:Oa(s),onChange:n=>{a.onValueChange&&a.onValueChange(Ca(n),v)}}),[v,z]=we({prop:a.type,defaultProp:"constant",onChange:n=>{a.onValueChange&&a.onValueChange(s,n)}});function y(n,x){var m;return x==="trigger"?(m=Tt.find(u=>u.type===n))==null?void 0:m.icon:n}const h=n=>{p(x=>x.map(m=>m.type!==v?m:{...m,value:n}))},g=n=>x=>{p(m=>m.map(u=>{if(u.type!==v)return u;const{value:j}=u;if(u.type==="two-constant"){if(n===0)return{...u,value:[x,j[1]]};if(n===1)return{...u,value:[j[0],x]}}return u}))},f=n=>{p(x=>x.map(m=>m.type!==v?m:m.type==="gradient"?{...m,value:n}:m))},b=n=>x=>{p(m=>m.map(u=>{if(u.type!==v)return u;if(u.type==="two-gradient"){const{value:j}=u;if(n===0)return{...u,value:[x,j[1]]};if(n===1)return{...u,value:[j[0],x]}}return u}))};return o.jsxs(ae,{label:e,info:t,fieldCss:{gridTemplateColumns:(i=Tt.find(n=>n.type===v))==null?void 0:i.columns},children:[d.map(n=>{const{type:x,value:m}=n;if(!x||v!==x)return null;switch(x){case"constant":return o.jsx(st,{fullsize:!0,hdr:l,value:m,onValueChange:h},"constant");case"gradient":return o.jsx(ve,{fullsize:!0,mode:"particle",value:m,onValueChange:f},"gradient");case"two-constant":return o.jsxs(Ee.Fragment,{children:[o.jsx(st,{fullsize:!0,hdr:l,value:m[0],onValueChange:g(0)}),o.jsx(st,{fullsize:!0,hdr:l,value:m[1],onValueChange:g(1)})]},"two-constant");case"two-gradient":return o.jsxs(Ee.Fragment,{children:[o.jsx(ve,{fullsize:!0,mode:"particle",value:m[0],onValueChange:b(0)}),o.jsx(ve,{fullsize:!0,mode:"particle",value:m[1],onValueChange:b(1)})]},"two-gradient");default:return null}}),o.jsx(lt,{defaultValue:"constant",position:"item-aligned",cornerArrow:!0,value:v,valueRenderer:y,onValueChange:n=>z(n),children:d.map(n=>o.jsx(je,{value:n.type,children:n.label||n.type},n.type))})]})}const Zt=[{type:"constant",icon:o.jsx(pt,{size:"14px"}),columns:"minmax(0, 12fr) 32px"},{type:"curve",icon:o.jsx(Bt,{size:"14px"}),columns:"minmax(0, 12fr) 32px"},{type:"two-constant",icon:o.jsx(Dt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"},{type:"two-curve",icon:o.jsx(Ft,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"}];function wa(a,e){var r;return e==="trigger"?(r=Zt.find(t=>t.type===a))==null?void 0:r.icon:a}const nt=[{x:0,y:0},{x:.25,y:.25},{x:.75,y:.75},{x:1,y:1}];function _e(a){var T;const{label:e,info:r,value:t,onValueChange:s,algo:l="bezier",yRangeMode:d,yTickScale:p,yTickScaleMin:v,yTickScaleMax:z,onYTickScaleChange:y,onYTickScaleCommit:h,hideTypeSelector:g,...f}=a,[b,i]=we({prop:a.type,defaultProp:"constant",onChange:w=>{s&&s(t,w)}}),[n,x]=we({prop:t,onChange:w=>{s&&s(w,b)},defaultProp:[{value:0,type:"constant"},{value:nt,type:"curve"},{value:[0,0],type:"two-constant"},{value:[nt,nt],type:"two-curve"}]}),m=w=>{x(V=>V.map(L=>L.type!==b?L:{...L,value:w}))},u=w=>V=>{x(L=>L.map(I=>{if(I.type!==b)return I;const{value:$}=I;return w===0?{...I,value:[V,$[1]]}:w===1?{...I,value:[$[0],V]}:I}))},j=w=>{x(V=>V.map(L=>L.type!==b?L:{...L,value:w}))},E=w=>V=>{x(L=>L.map(I=>{if(I.type!==b)return I;const{value:$}=I;return w===0?{...I,value:[V,$[1]]}:w===1?{...I,value:[$[0],V]}:I}))},D={algo:l,yRangeMode:d,yTickScale:p,yTickScaleMin:v,yTickScaleMax:z,onYTickScaleChange:y,onYTickScaleCommit:h};return o.jsxs(ae,{label:e,info:r,fieldCss:{gridTemplateColumns:(T=Zt.find(w=>w.type===b))==null?void 0:T.columns,columnGap:"$1"},...f,children:[n.map(w=>{const{type:V,value:L,min:I,max:$,step:U}=w;if(!V||b!==V)return null;switch(V){case"constant":return o.jsx(me,{min:I,max:$,dragStep:U,step:U,value:L,onValueChange:m},"constant");case"curve":return o.jsx(rt,{...D,value:L,onChange:j},"curve");case"two-constant":return o.jsxs(Ee.Fragment,{children:[o.jsx(me,{size:"sm",startSlot:"min",value:L[0],min:I,max:$,dragStep:U,step:U,onValueChange:u(0)}),o.jsx(me,{size:"sm",startSlot:"max",value:L[1],min:I,max:$,dragStep:U,step:U,onValueChange:u(1)})]},"two-constant");case"two-curve":return o.jsxs(Ee.Fragment,{children:[o.jsx(rt,{...D,value:L[0],onChange:E(0)}),o.jsx(rt,{...D,value:L[1],onChange:E(1)})]},"two-curve");default:return null}}),!g&&o.jsx(lt,{value:b,position:"item-aligned",cornerArrow:!0,valueRenderer:wa,onValueChange:w=>i(w),children:n.map(w=>o.jsx(je,{value:w.type,children:w.label||w.type},w.type))})]})}const Ea=X(function(a){const[e,r]=Y.useState(null),t=a.data,{assetStore:s,inspectorFacade:l}=kt();return Y.useEffect(()=>{s.getAssetByRef(t.material).then(d=>{r(d)})},[t.material]),o.jsxs(o.Fragment,{children:[o.jsx(aa.List,{model:t,configs:t.formSchema.items,onModelChange:Pa("component",t.id,l,t)}),e&&o.jsx(Ma,{materialAsset:e})]})});async function ja(a,e){await a.assetStore.getAssetByRef(e)}var k=(a=>(a.BoxShape="BoxShape",a.CircleShape="CircleShape",a.ConeShape="ConeShape",a.HemisphereShape="HemisphereShape",a.SphereShape="SphereShape",a.MeshShape="MeshShape",a))(k||{});function Z(a,e){return{class:a.class,props:{...a.props,...e}}}const Ta=X(({item:a,onModelChange:e})=>{const{t:r}=N();return o.jsx(o.Fragment,{children:o.jsx(ze,{label:r("effects.shape.size"),value:{x:a.props.size.x,y:a.props.size.y,z:a.props.size.z},onChange:(t,s)=>{const l=Z(a,{size:{...a.props.size,[s]:t[s]}});e==null||e("shape",l)}})})}),La=X(({item:a,onModelChange:e})=>{const{t:r}=N();return o.jsxs(o.Fragment,{children:[o.jsx(ee,{label:r("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:t=>{const s=Z(a,{radius:t});e==null||e("shape",s)}}),o.jsx(ee,{label:r("effects.shape.arc"),min:0,max:360,value:a.props.arc,onChange:t=>{const s=Z(a,{arc:t});e==null||e("shape",s)}}),o.jsx(ct,{label:r("effects.shape.arc-mode.label"),options:[{label:r("effects.shape.loop"),value:Ce.Loop},{label:r("effects.shape.random"),value:Ce.Random}],value:a.props.arcMode,onChange:t=>{const s=Z(a,{arcMode:t});e==null||e("shape",s)}}),a.props.arcMode===Ce.Loop?o.jsx(ee,{label:r("effects.shape.arc-speed.label"),step:.1,dragStep:.1,value:a.props.arcSpeed,onChange:t=>{const s=Z(a,{arcSpeed:t});e==null||e("shape",s)}}):null]})}),_a=X(({item:a,onModelChange:e})=>{const{t:r}=N();return o.jsxs(o.Fragment,{children:[o.jsx(ct,{label:r("effects.shape.emit-type.label"),options:[{label:r("effects.shape.cone-base"),value:de.Base},{label:r("effects.shape.volume"),value:de.Volume}],value:a.props.emitType,onChange:t=>{const s=Z(a,{emitType:t});e==null||e("shape",s)}}),o.jsx(ee,{label:r("effects.shape.angle"),min:1e-4,max:90,step:.05,dragStep:.05,value:a.props.angle,onChange:t=>{const s=Z(a,{angle:t});e==null||e("shape",s)}}),o.jsx(ee,{label:r("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:t=>{const s=Z(a,{radius:t});e==null||e("shape",s)}}),o.jsx(ee,{label:r("effects.shape.length"),min:1e-4,step:.1,dragStep:.1,value:a.props.length,disabled:a.props.emitType===de.Base,onChange:t=>{const s=Z(a,{length:t});e==null||e("shape",s)}})]})}),Aa=X(({item:a,onModelChange:e})=>{const{t:r}=N();return o.jsx(o.Fragment,{children:o.jsx(ee,{label:r("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:t=>{const s=Z(a,{radius:t});e==null||e("shape",s)}})})}),Ra=X(({item:a,onModelChange:e})=>{const{t:r}=N();return o.jsx(o.Fragment,{children:o.jsx(ee,{label:r("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:t=>{const s=Z(a,{radius:t});e==null||e("shape",s)}})})}),Va=X(({item:a,onModelChange:e})=>{const{t:r}=N(),{assetStore:t}=kt(),s=Object.values(t.assets).filter(p=>p instanceof za),[l,d]=Y.useState("");return Y.useEffect(()=>{let p=!1;return(async()=>{if(!a.props.mesh){d("");return}try{const z=await t.getAssetByRef(a.props.mesh);p||d((z==null?void 0:z.name)??"")}catch{p||d("")}})(),()=>{p=!0}},[t,a.props.mesh]),o.jsx(ra,{label:r("effects.renderer.render-mode.options.mesh"),assets:s,dropLayer:0,value:l,onSelect:async p=>{d(p.name);const v=!!p.engineObject;v||sa.error("Mesh asset is not initialized");const z={class:a.class,props:{...a.props,mesh:p.getCurrentRef(),enabled:v}};e==null||e("shape",z)}})}),Ia=X(({item:a,onModelChange:e})=>{const{t:r}=N();return o.jsx(ee,{label:r("effects.shape.random-direction-amount"),info:r("effects.shape.random-direction-amount-tip"),min:0,step:1,dragStep:.05,value:a.props.randomDirectionAmount||0,onChange:t=>{const s=Z(a,{randomDirectionAmount:t});e==null||e("shape",s)}})}),ka=X(({item:a,onModelChange:e})=>{const{t:r}=N(),t=a.props.position??{x:0,y:0,z:0},s=a.props.rotation??{x:0,y:0,z:0},l=a.props.scale??{x:1,y:1,z:1};return o.jsxs(o.Fragment,{children:[o.jsx(ze,{label:r("effects.shape.position"),value:{x:t.x,y:t.y,z:t.z},onChange:(d,p)=>{const v=Z(a,{position:{x:t.x,y:t.y,z:t.z,[p]:d[p]},rotation:{x:s.x,y:s.y,z:s.z},scale:{x:l.x,y:l.y,z:l.z}});e==null||e("shape",v)}}),o.jsx(ze,{label:r("effects.shape.rotation"),value:{x:s.x,y:s.y,z:s.z},onChange:(d,p)=>{const v=Z(a,{position:{x:t.x,y:t.y,z:t.z},rotation:{x:s.x,y:s.y,z:s.z,[p]:d[p]},scale:{x:l.x,y:l.y,z:l.z}});e==null||e("shape",v)}}),o.jsx(ze,{label:r("effects.shape.scale"),value:{x:l.x,y:l.y,z:l.z},onChange:(d,p)=>{const v=Z(a,{position:{x:t.x,y:t.y,z:t.z},rotation:{x:s.x,y:s.y,z:s.z},scale:{x:l.x,y:l.y,z:l.z,[p]:d[p]}});e==null||e("shape",v)}})]})}),it=new Map;function Ba(a,e){let r;switch(e.class){case k.BoxShape:{r=new pa;const t=r.size;t.copyFrom(e.props.size),r.size=t;break}case k.CircleShape:{r=new ca,r.radius=e.props.radius,r.arc=e.props.arc,r.arcMode=e.props.arcMode,r.arcSpeed=e.props.arcSpeed;break}case k.ConeShape:{r=new la,r.angle=e.props.angle,r.radius=e.props.radius,r.length=e.props.length,r.emitType=e.props.emitType;break}case k.HemisphereShape:{r=new ia,r.radius=e.props.radius;break}case k.SphereShape:{r=new oa,r.radius=e.props.radius;break}case k.MeshShape:{r=new na;const t=e.props.mesh;if(t!=null&&t.refId){const s=a.root.assetStore.assets[t.refId];r.mesh=s==null?void 0:s.engineObject}r.mesh||(r.mesh=Vt.createSphere(a.engineObject.engine));break}}if(r){if(e.props.randomDirectionAmount=e.props.randomDirectionAmount??0,r.randomDirectionAmount=e.props.randomDirectionAmount,r.enabled=e.props.enabled,e.props.position){const t=e.props.position;r.position.set(t.x,t.y,t.z)}if(e.props.rotation){const t=e.props.rotation;r.rotation.set(t.x,t.y,t.z)}if(e.props.scale){const t=e.props.scale;r.scale.set(t.x,t.y,t.z)}}return r}const Da=(a,e,r)=>{let t=it.get(`${a.id}-${r.class}`);t&&(t=JSON.parse(t),it.delete(`${a.id}-${r.class}`),Object.assign(r.props,t));const s=Ba(a,r);s&&a.applyEmissionShape(s)},Fa={BoxShape:Ta,CircleShape:La,ConeShape:_a,HemisphereShape:Aa,SphereShape:Ra,MeshShape:Va},Ya={BoxShape:{class:k.BoxShape,props:{size:{x:1,y:1,z:1},randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},CircleShape:{class:k.CircleShape,props:{radius:1,arc:360,arcMode:Ce.Random,arcSpeed:1,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},ConeShape:{class:k.ConeShape,props:{angle:25,radius:1,length:5,emitType:de.Base,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},HemisphereShape:{class:k.HemisphereShape,props:{radius:1,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},SphereShape:{class:k.SphereShape,props:{radius:1,randomDirectionAmount:0,enabled:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}},MeshShape:{class:k.MeshShape,props:{randomDirectionAmount:0,enabled:!0,mesh:void 0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}}},Za=X(({model:a,onModelChange:e})=>{const{t:r}=N(),t=a.shape;if(!t.class)return;const s=Fa[t.class];return o.jsxs(o.Fragment,{children:[o.jsx(ct,{label:r("effects.shape.type.label"),info:r("effects.shape.type.info"),value:t.class,options:[{label:r("effects.shape.options.box"),value:k.BoxShape},{label:r("effects.shape.options.circle"),value:k.CircleShape},{label:r("effects.shape.options.cone"),value:k.ConeShape},{label:r("effects.shape.options.hemisphere"),value:k.HemisphereShape},{label:r("effects.shape.options.sphere"),value:k.SphereShape},{label:r("effects.shape.options.mesh"),value:k.MeshShape}],onChange:l=>{const d=Ya[l];if(a.shape&&a.shape.class!==l&&it.set(`${a.id}-${a.shape.class}`,JSON.stringify(a.shape.props)),d.class!==t.class){const p=_(d);e==null||e("shape",p)}}}),o.jsx(s,{item:t,component:a.engineObject,onModelChange:e}),o.jsx(Ia,{item:t,component:a.engineObject,onModelChange:e}),o.jsx(ka,{item:t,component:a.engineObject,onModelChange:e})]})}),ut=["constant","two-constant","curve","two-curve"],te=[{x:0,y:0},{x:.25,y:.25},{x:.75,y:.75},{x:1,y:1}];function Ae(a){return a.map(e=>({x:e.constructParams[0],y:e.constructParams[1]}))}const Lt={class:"ParticleCurve",constructParams:[{class:"CurveKey",constructParams:[0,0]},{class:"CurveKey",constructParams:[.25,.25]},{class:"CurveKey",constructParams:[.75,.75]},{class:"CurveKey",constructParams:[1,1]}]};function B(a,e=0,r=0,t=q.Constant){return{module:a,mode:t,constantMin:r,constantMax:e,curveMax:_(Lt),curveMin:_(Lt)}}function ce(a,e=0,r=0,t=q.Constant){return{enabled:!1,x:B(a,e,r,t),y:B(a,e,r,t),z:B(a,e,r,t)}}const Xa=a=>a===1/0?1/0:Math.max(1,Math.floor(a));function $a(a){if(!(a!=null&&a.constructParams))return;const e=a.constructParams[2];e===null?a.constructParams[2]=1/0:typeof e=="number"&&e!==1/0&&(a.constructParams[2]=Math.max(1,Math.floor(e)))}const Re=1,mt=.01,qa=ua("div",{height:"$6",display:"flex",alignItems:"center",paddingLeft:"$2",fontSize:"$sm",borderRadius:"$1",backgroundColor:"$softBg",color:"$gray9",userSelect:"none"}),Na=o.jsx(pt,{size:"14px"});function Ka(a,e){return e==="trigger"?Na:a}const Ga={class:"Burst",constructParams:[0,{class:"ParticleCompositeCurve",constructParams:[15],props:{mode:q.Constant,constantMax:15,constantMin:0}},Re,mt]},Ha=X(({model:a,inspectorConfig:e,onModelChange:r})=>{const{t}=N(),{label:s,info:l}=e,d=a.bursts,[p,v]=Y.useState(-1),z=i=>{const n=_(d);i(n),r==null||r("bursts",n)},y=(i,n)=>{z(x=>{const m=x[i];m&&n(m)})},h=i=>{z(n=>{n.splice(i,1)})},g=()=>{z(i=>{i.push(_(Ga))})},f=[{title:t("effects.burst.time.label")},{title:t("effects.burst.count.label")},{title:t("effects.burst.cycles.label")},{title:t("effects.burst.interval.label")}],b=(i,n)=>{const x=Math.max(1,i.constructParams[1].props.constantMax??0,i.constructParams[1].props.constantMin??0);return{data:i,cells:[o.jsx(ae,{children:o.jsx(me,{min:0,max:a.duration,step:.05,dragStep:.05,value:i.constructParams[0],onValueChange:m=>{y(n,u=>{u.constructParams[0]=m})}})},`time-${n}`),o.jsx(_e,{type:ut[i.constructParams[1].props.mode],direction:"column",algo:"bezier",yRangeMode:"positive",yTickScale:x,yTickScaleMin:0,yTickScaleMax:x,onYTickScaleChange:()=>{},onYTickScaleCommit:()=>{},value:[{value:i.constructParams[1].props.constantMax,type:"constant",min:0,step:1},{value:[i.constructParams[1].props.constantMin,i.constructParams[1].props.constantMax],type:"two-constant",min:0,step:1}],onValueChange:(m,u)=>{const j=m.find(E=>E.type===u);j&&y(n,E=>{switch(u){case"constant":{E.constructParams[1].props.mode=q.Constant,E.constructParams[1].props.constantMax=j.value;break}case"two-constant":{E.constructParams[1].props.mode=q.TwoConstants,E.constructParams[1].props.constantMin=j.value[0],E.constructParams[1].props.constantMax=j.value[1];break}}})}},`count-${n}`),o.jsxs(ae,{fieldCss:{gridTemplateColumns:"minmax(0, 1fr) 32px",columnGap:"$1"},children:[i.constructParams[2]===1/0?o.jsx(qa,{children:"∞"}):o.jsx(me,{min:1,step:1,dragStep:1,value:i.constructParams[2]??Re,onValueChange:m=>{y(n,u=>{u.constructParams[2]=Xa(m)})}}),o.jsxs(lt,{value:i.constructParams[2]===1/0?"infinity":"number",position:"item-aligned",cornerArrow:!0,valueRenderer:Ka,onValueChange:m=>{y(n,u=>{u.constructParams[2]=m==="infinity"?1/0:Re})},children:[o.jsx(je,{value:"number",children:t("effects.burst.cycles.number")}),o.jsx(je,{value:"infinity",children:t("effects.burst.cycles.infinity")})]})]},`cycles-${n}`),o.jsx(ae,{children:o.jsx(me,{disabled:!i.constructParams[2]||i.constructParams[2]===1,min:.01,step:.01,dragStep:.01,value:i.constructParams[3]??mt,onValueChange:m=>{y(n,u=>{u.constructParams[3]=m})}})},`interval-${n}`)]}};return o.jsx(ma,{columns:f,items:d.map((i,n)=>b(i,n)),label:t(s),info:t(l),addable:!1,emptyText:t("effects.burst.empty","No bursts"),selectedIndex:p,onRowClick:v,sideSlot:o.jsxs(It,{direction:"column",gap:"xs",children:[o.jsx(Ot,{variant:"soft",onClick:g,css:{flex:1},children:o.jsx(da,{size:"14px"})}),o.jsx(Ot,{variant:"soft",css:{flex:1},onClick:()=>{const i=p>=0&&p<d.length?p:d.length-1;i>=0&&(h(i),v(Math.min(i,d.length-2)))},children:o.jsx(ha,{size:"14px"})})]})})}),Wa=(a,e,r)=>{const t=a.engineObject.generator.emission,s=t.bursts;for(let l=s.length-1;l>=0;l--)t.removeBurst(s[l]);for(let l=0;l<r.length;l++){const d=r[l];if(!d||!Array.isArray(d.constructParams)||d.constructParams.length<2){console.warn(`Invalid burst item at index ${l}:`,d);continue}const p=d.constructParams[0],v=d.constructParams[1],z=d.constructParams[2]??Re,y=d.constructParams[3]??mt;if(!v||!v.props){console.warn(`Invalid burst count data at index ${l}:`,v);continue}const h=v.props,g=new fa(h.constantMax);g.mode=h.mode,g.constantMin=h.constantMin,g.constantMax=h.constantMax,g.constant=h.constantMax;const f=new ya(p,g);f.cycles=z,f.repeatInterval=y,t.addBurst(f)}};function _t(a="colorOverLifetime"){return{module:a,mode:he.Gradient,gradientMax:{class:"ParticleGradient",constructParams:[[{color:{r:1,g:1,b:1,a:1},time:0},{color:{r:1,g:1,b:1,a:1},time:.3},{color:{r:1,g:1,b:1,a:1},time:.6},{color:{r:1,g:1,b:1,a:1},time:1}],[{time:0,alpha:0},{time:.25,alpha:.25},{time:.5,alpha:.5},{time:1,alpha:1}]]},gradientMin:{class:"ParticleGradient",constructParams:[[{time:0,color:{r:1,g:1,b:1,a:1}},{time:.3,color:{r:1,g:1,b:1,a:1}},{time:.6,color:{r:1,g:1,b:1,a:1}},{time:1,color:{r:1,g:1,b:1,a:1}}],[{time:0,alpha:0},{time:.25,alpha:.25},{time:.5,alpha:.5},{time:1,alpha:1}]]}}}const Me=["x","y","z"],Ua={constant:q.Constant,"two-constant":q.TwoConstants,curve:q.Curve,"two-curve":q.TwoCurves},fe=X(({model:a,inspectorConfig:e,onModelChange:r})=>{const{t}=N(),s=e.property,{mainAxis:l}=e,d=a[s],[p,v]=Y.useState({x:{max:te,min:te},y:{max:te,min:te},z:{max:te,min:te}}),[z,y]=Y.useState(e.yTickScale??1),h=ut[d.x.mode];function g(n){return(x,m)=>{const u=x.find(T=>T.type===m);if(!u)return;const j=_(d),E=j[n],D=Ua[m];for(const T of Me)j[T].mode=D;switch(m){case"constant":E.constantMax=u.value;break;case"two-constant":E.constantMin=u.value[0],E.constantMax=u.value[1];break;case"curve":{if(u.value.length>4)return;v(T=>({...T,[n]:{...T[n],max:u.value}})),u.value.forEach((T,w)=>{E.curveMax.constructParams[w].constructParams[0]=T.x,E.curveMax.constructParams[w].constructParams[1]=T.y*z});break}case"two-curve":{if(u.value[0].length>4||u.value[1].length>4)return;v(T=>({...T,[n]:{min:u.value[0],max:u.value[1]}})),u.value[0].forEach((T,w)=>{E.curveMin.constructParams[w].constructParams[0]=T.x,E.curveMin.constructParams[w].constructParams[1]=T.y*z}),u.value[1].forEach((T,w)=>{E.curveMax.constructParams[w].constructParams[0]=T.x,E.curveMax.constructParams[w].constructParams[1]=T.y*z});break}}a[s]=j,r==null||r(s,j)}}function f(n){return[{value:d[n].constantMax,type:"constant",label:t("effects.curve.constant"),min:e.min,max:e.max,step:e.step},{value:[d[n].constantMin,d[n].constantMax],type:"two-constant",label:t("effects.curve.two-constant"),min:e.min,max:e.max,step:e.step},{value:p[n].max,type:"curve",label:t("effects.curve.curve")},{value:[p[n].min,p[n].max],type:"two-curve",label:t("effects.curve.two-curve")}]}const b=n=>{const x=n/z,m=_(d);for(const u of Me){const j=m[u];j.curveMax.constructParams.forEach(E=>{E.constructParams[1]*=x}),j.curveMin.constructParams.forEach(E=>{E.constructParams[1]*=x})}y(n),a[s]=m,r==null||r(s,m)},i={algo:"linear",yRangeMode:e.yRangeMode,yTickScale:z,yTickScaleMin:e.yTickScaleMin,yTickScaleMax:e.yTickScaleMax,onYTickScaleChange:b,onYTickScaleCommit:()=>{}};return Y.useEffect(()=>{const n={};for(const x of Me)n[x]={max:Ae(d[x].curveMax.constructParams).map(m=>({...m,y:m.y/z})),min:Ae(d[x].curveMin.constructParams).map(m=>({...m,y:m.y/z}))};v(n)},[]),o.jsxs(o.Fragment,{children:[o.jsx(ba,{label:e.toggleLabel?t(e.toggleLabel):t("effects.curve.3d-prefix")+" "+t(e.label||s),info:t(e.info),value:d.enabled,onChange:n=>{const x=_(d);x.enabled=n,a[s]=x,r==null||r(s,x)}}),d.enabled?o.jsx(ae,{label:"",children:o.jsx(It,{direction:"column",gap:"xxs",children:Me.map((n,x)=>o.jsx(_e,{label:t(n).toLocaleUpperCase(),type:h,css:{gridTemplateColumns:"$4 repeat(3, minmax(0px, 1fr))"},...i,value:f(n),hideTypeSelector:x!==0,onValueChange:g(n)},n))})}):o.jsx(_e,{label:t(e.label||s),type:h,...i,value:f(l),onValueChange:g(l)})]})}),ye=a=>(e,r,t)=>{var d,p;const s=(p=(d=e.engineObject)==null?void 0:d.generator)==null?void 0:p[t.x.module];if(!s){console.warn(`Module container not found for: ${t.x.module}`);return}s[a]=t.enabled;const l={x:s[r+"X"],y:s[r+"Y"],z:s[r+"Z"]};for(const v in l){const z=t[v],y=l[v];if(!y){console.warn(`Axis module not found for: ${v} in ${r}`);continue}y.mode=z.mode,y.constantMax=z.constantMax,y.constantMin=z.constantMin,y.curveMax=new Te,z.curveMax.constructParams.forEach(h=>{const g=h.constructParams[0],f=h.constructParams[1];y.curveMax.addKey(new Le(g,f))}),y.curveMin=new Te,z.curveMin.constructParams.forEach(h=>{const g=h.constructParams[0],f=h.constructParams[1];y.curveMin.addKey(new Le(g,f))})}},K=X(({model:a,inspectorConfig:e,onModelChange:r})=>{const{t}=N(),s=e.property,l=a[s],[d,p]=Y.useState(te),[v,z]=Y.useState(te),[y,h]=Y.useState(e.yTickScale??1);Y.useEffect(()=>{const f=Ae(l.curveMax.constructParams),b=Ae(l.curveMin.constructParams);p(f),z(b)},[]);const g=(f,b)=>{const i=f.find(x=>x.type===b);if(!i)return;const n=_(l);switch(b){case"constant":n.mode=q.Constant,n.constantMax=i.value;break;case"two-constant":n.mode=q.TwoConstants,n.constantMin=i.value[0],n.constantMax=i.value[1];break;case"curve":{if(i.value.length>4)return;p(i.value),n.mode=q.Curve,i.value.forEach((x,m)=>{n.curveMax.constructParams[m].constructParams[0]=x.x,n.curveMax.constructParams[m].constructParams[1]=x.y});break}case"two-curve":{if(i.value[0].length>4||i.value[1].length>4)return;n.mode=q.TwoCurves,z(i.value[0]),p(i.value[1]),i.value[0].forEach((x,m)=>{n.curveMin.constructParams[m].constructParams[0]=x.x,n.curveMin.constructParams[m].constructParams[1]=x.y}),i.value[1].forEach((x,m)=>{n.curveMax.constructParams[m].constructParams[0]=x.x,n.curveMax.constructParams[m].constructParams[1]=x.y});break}}a[s]=n,r==null||r(s,n)};return o.jsx(o.Fragment,{children:o.jsx(_e,{label:t(e.label||e.property),info:t(e.info),type:ut[l.mode],algo:"linear",yRangeMode:e.yRangeMode,yTickScale:y,yTickScaleMin:e.yTickScaleMin,yTickScaleMax:e.yTickScaleMax,onYTickScaleChange:h,onYTickScaleCommit:()=>{},value:[{value:l.constantMax,type:"constant",label:t("effects.curve.constant"),min:e.min,max:e.max,step:e.step},{value:[l.constantMin,l.constantMax],type:"two-constant",label:t("effects.curve.two-constant"),min:e.min,max:e.max,step:e.step},{value:d,type:"curve",label:t("effects.curve.curve")},{value:[v,d],type:"two-curve",label:t("effects.curve.two-curve")}],onValueChange:g})})}),G=(a,e,r)=>{var l,d;const t=(d=(l=a.engineObject)==null?void 0:l.generator)==null?void 0:d[r.module];if(!t){console.warn(`Module container not found for: ${r.module}`);return}const s=t[e];if(!s){console.warn(`Module not found for property: ${e} in ${r.module}`);return}s.mode=r.mode,s.constantMax=r.constantMax,s.constantMin=r.constantMin,s.curveMax=new Te,r.curveMax.constructParams.forEach(p=>{const v=p.constructParams[0],z=p.constructParams[1];s.curveMax.addKey(new Le(v,z))}),s.curveMin=new Te,r.curveMin.constructParams.forEach(p=>{const v=p.constructParams[0],z=p.constructParams[1];s.curveMin.addKey(new Le(v,z))})},Ja=["constant","two-constant"],Qa=X(({model:a,inspectorConfig:e,onModelChange:r})=>{var z,y;const{t}=N(),s=e.property,l=a[s],d={...ge(l.constantMax),intensity:((z=l.constantMax)==null?void 0:z.intensity)??1},p={...ge(l.constantMin),intensity:((y=l.constantMin)==null?void 0:y.intensity)??1},v=(h,g)=>{const f=h.find(i=>i.type===g);if(!f)return;const b=_(l);switch(g){case"constant":{b.mode=he.Constant,b.constantMax=f.value;break}case"two-constant":{const i=f.value[0],n=f.value[1];b.mode=he.TwoConstants,b.constantMin=i,b.constantMax=n;break}}a[s]=b,r==null||r(s,b)};return o.jsx(Yt,{label:t(e.label||e.property),type:Ja[l.mode],info:t(e.info),hdr:!0,value:[{value:d,type:"constant",label:t("effects.curve.constant")},{value:[p,d],type:"two-constant",label:t("effects.curve.two-constant")}],onValueChange:v})}),er=(a,e,r)=>{const t=a.engineObject.generator.main.startColor;t.mode=r.mode;const{constantMax:s,constantMin:l}=r,d=s.intensity??1,p=l.intensity??1;t.constantMax.set(s.r*d,s.g*d,s.b*d,s.a),t.constantMin.set(l.r*p,l.g*p,l.b*p,l.a)},tr=["gradient","two-gradient"],ar=X(({model:a,inspectorConfig:e,onModelChange:r})=>{const{t}=N(),s=e.property,l=a[s],d=(p,v)=>{var h,g;if(!p.find(f=>f.type===v))return;const y=_(l);switch(v){case"gradient":{const f=p.find(b=>b.type===v);if(!((h=f==null?void 0:f.value)!=null&&h.color)||!((g=f==null?void 0:f.value)!=null&&g.alpha)){console.warn(`Invalid gradient value structure for ${s}`);return}if(f.value.color.length>4||f.value.alpha.length>4)return;y.mode=he.Gradient,y.gradientMax.constructParams=[f.value.color.map(b=>({color:b.value,time:b.time})),f.value.alpha.map(b=>({alpha:b.value,time:b.time}))];break}case"two-gradient":{const f=p.find(b=>b.type===v);if(f.value[0].color.length>4||f.value[0].alpha.length>4||f.value[1].color.length>4||f.value[1].alpha.length>4)return;y.mode=he.TwoGradients,y.gradientMin.constructParams=[f.value[0].color.map(b=>({color:b.value,time:b.time})),f.value[0].alpha.map(b=>({alpha:b.value,time:b.time}))],y.gradientMax.constructParams=[f.value[1].color.map(b=>({color:b.value,time:b.time})),f.value[1].alpha.map(b=>({alpha:b.value,time:b.time}))];break}}a[s]=y,r==null||r(s,y)};return o.jsx(o.Fragment,{children:o.jsx(Yt,{label:t(e.property),type:tr[l.mode-2],info:t(e.info),value:[{value:{color:l.gradientMax.constructParams[0].map(p=>({value:ge(p.color),time:p.time})),alpha:l.gradientMax.constructParams[1].map(p=>({value:p.alpha,time:p.time}))},type:"gradient",label:t("effects.curve.gradient")},{value:[{color:l.gradientMin.constructParams[0].map(p=>({value:ge(p.color),time:p.time})),alpha:l.gradientMin.constructParams[1].map(p=>({value:p.alpha,time:p.time}))},{color:l.gradientMax.constructParams[0].map(p=>({value:ge(p.color),time:p.time})),alpha:l.gradientMax.constructParams[1].map(p=>({value:p.alpha,time:p.time}))}],type:"two-gradient",label:t("effects.curve.two-gradient")}],onValueChange:d})})}),pe=[],ue=[],rr=(a,e,r)=>{var v,z,y;const t=(z=(v=a.engineObject)==null?void 0:v.generator)==null?void 0:z[r.module];if(!t){console.warn(`Module container not found for: ${r.module}`);return}const s=t[e];if(!s){console.warn(`Module not found for property: ${e} in ${r.module}`);return}if(s.mode=r.mode,pe.length=0,ue.length=0,!((y=r.gradientMax)!=null&&y.constructParams)||!Array.isArray(r.gradientMax.constructParams)){console.warn(`Invalid gradientMax.constructParams for ${e}`);return}const l=r.gradientMax.constructParams,d=l[0]||[],p=l[1]||[];Array.isArray(d)&&d.forEach(h=>{if(h&&h.color&&typeof h.time=="number"){const g=h.color;pe.push(new wt(h.time,new Et(g.r??0,g.g??0,g.b??0,g.a??1)))}}),Array.isArray(p)&&p.forEach(h=>{h&&typeof h.time=="number"&&typeof h.alpha=="number"&&ue.push(new jt(h.time,h.alpha))}),s.gradientMax.setKeys(pe,ue),pe.length=0,ue.length=0,r.gradientMin.constructParams[0].forEach(h=>{pe.push(new wt(h.time,new Et(h.color.r,h.color.g,h.color.b,h.color.a)))}),r.gradientMin.constructParams[1].forEach(h=>{ue.push(new jt(h.time,h.alpha))}),s.gradientMin.setKeys(pe,ue)};function Oe(a){return a-Math.floor(a*(1/289))*289}function H(a){return Oe((34*a+1)*a)}function ot(a,e,r){const t=.16666666666666666,s=1/3,l=(a+e+r)*s,d=Math.floor(a+l),p=Math.floor(e+l),v=Math.floor(r+l),z=(d+p+v)*t,y=a-d+z,h=e-p+z,g=r-v+z;let f,b,i,n,x,m;y>=h?h>=g?(f=1,b=0,i=0,n=1,x=1,m=0):y>=g?(f=1,b=0,i=0,n=1,x=0,m=1):(f=0,b=0,i=1,n=1,x=0,m=1):h<g?(f=0,b=0,i=1,n=0,x=1,m=1):y<g?(f=0,b=1,i=0,n=0,x=1,m=1):(f=0,b=1,i=0,n=1,x=1,m=0);const u=y-f+t,j=h-b+t,E=g-i+t,D=y-n+s,T=h-x+s,w=g-m+s,V=y-.5,L=h-.5,I=g-.5,$=Oe(d),U=Oe(p),xe=Oe(v),Xt=H(H(H(xe)+U)+$),$t=H(H(H(xe+i)+U+b)+$+f),qt=H(H(H(xe+m)+U+x)+$+n),Nt=H(H(H(xe+1)+U+1)+$+1),Ie=.142857142857,dt=Ie*2-0,ht=Ie*.5-1,ke=Ie*1-0;function Se(vt){const gt=vt-49*Math.floor(vt*ke*ke),xt=Math.floor(gt*ke),Ut=Math.floor(gt-7*xt),St=xt*dt+ht,Pt=Ut*dt+ht,Pe=1-Math.abs(St)-Math.abs(Pt),Mt=St,zt=Pt,Jt=Math.floor(Mt)*2+1,Qt=Math.floor(zt)*2+1,Ct=-(Pe<0?1:0),et=Mt+Jt*Ct,tt=zt+Qt*Ct,at=1.79284291400159-.85373472095314*(et*et+tt*tt+Pe*Pe);return[et*at,tt*at,Pe*at]}const re=Se(Xt),se=Se($t),ne=Se(qt),oe=Se(Nt),Be=Math.max(.6-(y*y+h*h+g*g),0),De=Math.max(.6-(u*u+j*j+E*E),0),Fe=Math.max(.6-(D*D+T*T+w*w),0),Ye=Math.max(.6-(V*V+L*L+I*I),0),Ze=Be*Be,Xe=De*De,$e=Fe*Fe,qe=Ye*Ye,Ne=Ze*Ze,Ke=Xe*Xe,Ge=$e*$e,He=qe*qe,Kt=re[0]*y+re[1]*h+re[2]*g,Gt=se[0]*u+se[1]*j+se[2]*E,Ht=ne[0]*D+ne[1]*T+ne[2]*w,Wt=oe[0]*V+oe[1]*L+oe[2]*I,We=Ze*Be*Kt,Ue=Xe*De*Gt,Je=$e*Fe*Ht,Qe=qe*Ye*Wt;let ft=-8*(We*y+Ue*u+Je*D+Qe*V),yt=-8*(We*h+Ue*j+Je*T+Qe*L),bt=-8*(We*g+Ue*E+Je*w+Qe*I);return ft+=Ne*re[0]+Ke*se[0]+Ge*ne[0]+He*oe[0],yt+=Ne*re[1]+Ke*se[1]+Ge*ne[1]+He*oe[1],bt+=Ne*re[2]+Ke*se[2]+Ge*ne[2]+He*oe[2],[ft*42,yt*42,bt*42]}function At(a,e,r){ot(r,e,a);const s=ot(a+100,r,e);return ot(e,a+100,r)[1]-s[2]}function sr(a,e,r,t,s,l,d){let p=At(a*t,e*t,r*t),v=1,z=t,y=1;for(let h=1;h<s;h++)y*=d,z*=l,v+=y,p+=y*At(a*z,e*z,r*z);return p/v}const Q=80,Rt=5,nr=({model:a})=>{const e=Y.useRef(null),r=Y.useRef(0);return Y.useEffect(()=>{const t=e.current;if(!t)return;const s=t.getContext("2d");if(!s)return;const l=va(()=>{var b,i;const d=((i=(b=a.noiseStrength)==null?void 0:b.x)==null?void 0:i.constantMax)??1,p=a.noiseFrequency??.5,v=a.noiseScrollSpeed??0,z=a.noiseOctaveCount??1,y=a.noiseOctaveIntensityMultiplier??.5,h=a.noiseOctaveFrequencyMultiplier??2;cancelAnimationFrame(r.current);const g=performance.now(),f=n=>{const x=(n-g)/1e3*v,m=s.createImageData(Q,Q),u=m.data;for(let j=0;j<Q;j++){const E=(1-j/Q)*Rt;for(let D=0;D<Q;D++){const T=D/Q*Rt,w=sr(T,E,x,p,z,h,y),V=Math.max(0,Math.min(255,Math.round((w*d*(.5/7)+.5)*255))),L=(j*Q+D)*4;u[L]=V,u[L+1]=V,u[L+2]=V,u[L+3]=255}}s.putImageData(m,0,0),v>0&&(r.current=requestAnimationFrame(f))};r.current=requestAnimationFrame(f)});return()=>{cancelAnimationFrame(r.current),l()}},[a]),o.jsx(ae,{label:" ",labelCss:{visibility:"hidden"},children:o.jsxs("div",{style:{position:"relative",width:80,height:80},children:[o.jsx("canvas",{ref:e,width:Q,height:Q,style:{width:80,height:80,borderRadius:4,border:"1px solid var(--color-border-default, rgba(255,255,255,0.12))",display:"block"}}),o.jsx("span",{style:{position:"absolute",bottom:2,left:0,right:0,textAlign:"center",fontSize:9,color:"rgba(255,255,255,0.6)",textShadow:"0 1px 2px rgba(0,0,0,0.8)",pointerEvents:"none"},children:"Preview"})]})})};var or=Object.defineProperty,ir=Object.getOwnPropertyDescriptor,M=(a,e,r,t)=>{for(var s=t>1?void 0:t?ir(e,r):e,l=a.length-1,d;l>=0;l--)(d=a[l])&&(s=(t?d(e,r,s):d(s))||s);return t&&s&&or(e,r,s),s};let S=class extends ga{constructor(e,r){super(e,r);P(this,"_emissionModuleEnabled",!0);P(this,"_emissionShapeModuleEnabled",!0);P(this,"_rotationOverLifetimeModuleEnabled",!1);P(this,"_sizeOverLifetimeModuleEnabled",!1);P(this,"_textureSheetAnimationModuleEnabled",!1);P(this,"_velocityOverLifetimeModuleEnabled",!1);P(this,"_forceOverLifetimeModuleEnabled",!1);P(this,"_limitVelocityOverLifetimeModuleEnabled",!1);P(this,"_colorOverLifetimeModuleEnabled",!1);P(this,"_noiseModuleEnabled",!1);P(this,"material",{refId:"0000202"});P(this,"priority",0);P(this,"velocityScale",0);P(this,"lengthScale",2);P(this,"pivot",{x:0,y:0,z:0});P(this,"renderMode",W.Billboard);P(this,"mesh",null);P(this,"duration",5);P(this,"isLoop",!0);P(this,"startDelay",B("main"));P(this,"startLifetime",B("main",5));P(this,"startSpeed",B("main",5));P(this,"startSize",ce("main",1));P(this,"startRotation",ce("main"));P(this,"flipRotation",0);P(this,"startColor",{module:"main",mode:he.Constant,constantMax:{r:1,g:1,b:1,a:1,intensity:1},constantMin:{r:1,g:1,b:1,a:1,intensity:1}});P(this,"gravityModifier",B("main"));P(this,"simulationSpace",F.Local);P(this,"simulationSpeed",1);P(this,"scalingMode",be.Local);P(this,"playOnEnabled",!0);P(this,"maxParticles",1e3);P(this,"rateOverTime",B("emission",10));P(this,"shape",{class:k.ConeShape,props:{angle:25,radius:1,length:5,emitType:de.Base,enabled:!0}});P(this,"bursts",[]);P(this,"size",ce("sizeOverLifetime",1));P(this,"rotation",ce("rotationOverLifetime",45));P(this,"textureSheetAnimationType",0);P(this,"cycleCount",1);P(this,"tiling",{x:1,y:1});P(this,"frameOverTime",B("textureSheetAnimation",1,0,q.Curve));P(this,"spaceMode",F.Local);P(this,"forceSpaceMode",F.Local);P(this,"velocityX",B("velocityOverLifetime"));P(this,"velocityY",B("velocityOverLifetime"));P(this,"velocityZ",B("velocityOverLifetime"));P(this,"speed",ce("limitVelocityOverLifetime",1));P(this,"limitVelocitySpaceMode",F.Local);P(this,"dampen",0);P(this,"drag",B("limitVelocityOverLifetime"));P(this,"multiplyDragByParticleSize",!1);P(this,"multiplyDragByParticleVelocity",!1);P(this,"forceX",B("forceOverLifetime"));P(this,"forceY",B("forceOverLifetime"));P(this,"forceZ",B("forceOverLifetime"));P(this,"color",_t());P(this,"noisePreview",null);P(this,"noiseStrength",ce("noise",1));P(this,"noiseFrequency",.5);P(this,"noiseScrollSpeed",0);P(this,"noiseOctaveCount",1);P(this,"noiseOctaveIntensityMultiplier",.5);P(this,"noiseOctaveFrequencyMultiplier",2);const t=this.formSchema,s=(d,p,v,z,y,h)=>{const g=c(d);t.addGroup(g,p,{controlOpenKey:v,defaultOpen:h,sectionTitle:{title:g,onToggle:f=>{y==null||y(f),this.root.inspectorFacade.componentChange(this.id,v,f),this.applyBoundPathChange(z,A.Toggle,f)}}})};s("effects.renderer.sections.emission",["rateOverTime","bursts"],"_emissionModuleEnabled","generator.emission.enabled"),s("effects.renderer.sections.shape",["shape"],"_emissionShapeModuleEnabled","generator.emission.shape.enabled",d=>{this.shape.props.enabled=d}),s("effects.renderer.sections.size-over-lifetime",["size"],"_sizeOverLifetimeModuleEnabled","generator.sizeOverLifetime.enabled"),s("effects.renderer.sections.rotation-over-lifetime",["rotation"],"_rotationOverLifetimeModuleEnabled","generator.rotationOverLifetime.enabled"),s("effects.renderer.sections.force-over-lifetime",["forceSpaceMode","forceX","forceY","forceZ"],"_forceOverLifetimeModuleEnabled","generator.forceOverLifetime.enabled"),s("effects.renderer.sections.velocity-over-lifetime",["spaceMode","velocityX","velocityY","velocityZ"],"_velocityOverLifetimeModuleEnabled","generator.velocityOverLifetime.enabled"),s("effects.renderer.sections.limit-velocity-over-lifetime",["speed","limitVelocitySpaceMode","dampen","drag","multiplyDragByParticleSize","multiplyDragByParticleVelocity"],"_limitVelocityOverLifetimeModuleEnabled","generator.limitVelocityOverLifetime.enabled"),s("effects.renderer.sections.texture-sheet-animation",["textureSheetAnimationType","cycleCount","tiling","frameOverTime"],"_textureSheetAnimationModuleEnabled","generator.textureSheetAnimation.enabled"),s("effects.renderer.sections.color-over-lifetime",["color"],"_colorOverLifetimeModuleEnabled","generator.colorOverLifetime.enabled"),s("effects.renderer.sections.noise",["noisePreview","noiseStrength","noiseFrequency","noiseScrollSpeed","noiseOctaveCount","noiseOctaveIntensityMultiplier","noiseOctaveFrequencyMultiplier"],"_noiseModuleEnabled","generator.noise.enabled");const l=c("effects.renderer.sections.rendering");t.addGroup(l,["renderMode","mesh","material","velocityScale","lengthScale","pivot","priority"],{sectionTitle:{title:l}})}applyEmissionShape(e){this.applyBoundPathChange("generator.emission.shape",A.Input,e)}onInitComplete(){const{_engineObject:{generator:e}}=this;if(this.applyBoundPathChange("enabled",A.Toggle,this._enabled),this.applyBoundPathChange("renderMode",A.Select,this.renderMode),e.emission.enabled=this._emissionModuleEnabled,e.emission.shape.enabled=this._emissionShapeModuleEnabled,this.shape.class===k.MeshShape){const r=e.emission.shape,t=this.shape.props.mesh;t?(r.enabled=!1,ja(this.root,t).then(()=>{this.applyBoundPathChange("generator.emission.shape.mesh",A.AssetPicker,t),r.enabled=this._emissionShapeModuleEnabled})):this.applyBoundPathChange("generator.emission.shape.mesh",A.Input,Vt.createSphere(this.engineObject.engine))}e.rotationOverLifetime.enabled=this._rotationOverLifetimeModuleEnabled,e.sizeOverLifetime.enabled=this._sizeOverLifetimeModuleEnabled,e.textureSheetAnimation.enabled=this._textureSheetAnimationModuleEnabled,e.velocityOverLifetime.enabled=this._velocityOverLifetimeModuleEnabled,e.limitVelocityOverLifetime.enabled=this._limitVelocityOverLifetimeModuleEnabled,e.forceOverLifetime.enabled=this._forceOverLifetimeModuleEnabled,e.main.simulationSpeed=0,e.colorOverLifetime.enabled=this._colorOverLifetimeModuleEnabled,e.noise.enabled=this._noiseModuleEnabled,this.renderMode===W.Mesh&&this._applyRendererMeshFromRef()}_applyRendererMeshFromRef(){this.applyBoundPathChange("mesh",A.AssetPicker,this.mesh??null)}async bindEngineObject(e){e.enabled=!1,await super.bindEngineObject(e)}deserialize(e){var t,s,l,d,p,v;if(this._enabled=((t=e.props)==null?void 0:t.enabled)??!0,(s=e.props)!=null&&s.generator){const{props:z}=e;this.priority=z.priority??this.priority,this.velocityScale=z.velocityScale??this.velocityScale,this.lengthScale=z.lengthScale??this.lengthScale,this.pivot=z.pivot??this.pivot,this.renderMode=z.renderMode??this.renderMode,this.mesh=z.mesh??null;const{main:y,emission:h,sizeOverLifetime:g,rotationOverLifetime:f,velocityOverLifetime:b,limitVelocityOverLifetime:i,colorOverLifetime:n,textureSheetAnimation:x,forceOverLifetime:m,noise:u}=e.props.generator;this.duration=y.duration,this.isLoop=y.isLoop,this.startDelay=y.startDelay,this.startLifetime=y.startLifetime,this.startSpeed=y.startSpeed,this.startSize.enabled=y.startSize3D,this.startSize.x=y.startSizeX,this.startSize.y=y.startSizeY,this.startSize.z=y.startSizeZ,this.startRotation.enabled=y.startRotation3D,this.startRotation.x=y.startRotationX,this.startRotation.y=y.startRotationY,this.startRotation.z=y.startRotationZ,this.flipRotation=y.flipRotation,this.startColor=y.startColor,this.gravityModifier=y.gravityModifier,this.simulationSpace=y.simulationSpace,this.simulationSpeed=y.simulationSpeed,this.scalingMode=y.scalingMode,this.playOnEnabled=y.playOnEnabled,this.maxParticles=y.maxParticles,this._emissionModuleEnabled=h.enabled,this.rateOverTime=h.rateOverTime,this.shape=h.shape,(((l=h.shape)==null?void 0:l.class)==="Null"||h.shape===null)&&(this.shape={class:k.ConeShape,props:{angle:25,radius:1,length:5,emitType:de.Base,enabled:!1}}),this._emissionShapeModuleEnabled=((p=(d=h==null?void 0:h.shape)==null?void 0:d.props)==null?void 0:p.enabled)??!0;const j=[];if((v=h==null?void 0:h.methods)!=null&&v.addBurst&&Array.isArray(h.methods.addBurst)){for(let T=0;T<h.methods.addBurst.length;T++)if(h.methods.addBurst[T]&&h.methods.addBurst[T][0]){const w=h.methods.addBurst[T][0];$a(w),j.push(w)}}this.bursts=j,this._sizeOverLifetimeModuleEnabled=(g==null?void 0:g.enabled)??!1,this.size.enabled=(g==null?void 0:g.separateAxes)??!1,this.size.x=g!=null&&g.sizeX?{...g.sizeX,module:"sizeOverLifetime"}:{..._(this.size.x),module:"sizeOverLifetime"},this.size.y=g!=null&&g.sizeY?{...g.sizeY,module:"sizeOverLifetime"}:{..._(this.size.y),module:"sizeOverLifetime"},this.size.z=g!=null&&g.sizeZ?{...g.sizeZ,module:"sizeOverLifetime"}:{..._(this.size.z),module:"sizeOverLifetime"},this._rotationOverLifetimeModuleEnabled=(f==null?void 0:f.enabled)??!1,this.rotation.enabled=(f==null?void 0:f.separateAxes)??!1,this.rotation.x=f!=null&&f.rotationX?{...f.rotationX,module:"rotationOverLifetime"}:{..._(this.rotation.x),module:"rotationOverLifetime"},this.rotation.y=f!=null&&f.rotationY?{...f.rotationY,module:"rotationOverLifetime"}:{..._(this.rotation.y),module:"rotationOverLifetime"},this.rotation.z=f!=null&&f.rotationZ?{...f.rotationZ,module:"rotationOverLifetime"}:{..._(this.rotation.z),module:"rotationOverLifetime"},this._velocityOverLifetimeModuleEnabled=(b==null?void 0:b.enabled)??!1,this.velocityX=(b==null?void 0:b.velocityX)??_(this.velocityX),this.velocityY=(b==null?void 0:b.velocityY)??_(this.velocityY),this.velocityZ=(b==null?void 0:b.velocityZ)??_(this.velocityZ),this.spaceMode=(b==null?void 0:b.space)??F.Local,this._limitVelocityOverLifetimeModuleEnabled=(i==null?void 0:i.enabled)??!1,this.speed.enabled=(i==null?void 0:i.separateAxes)??!1;const E=(i==null?void 0:i.speedX)??(i==null?void 0:i.speed);this.speed.x=E?{...E,module:"limitVelocityOverLifetime"}:{..._(this.speed.x),module:"limitVelocityOverLifetime"},this.speed.y=i!=null&&i.speedY?{...i.speedY,module:"limitVelocityOverLifetime"}:{..._(this.speed.y),module:"limitVelocityOverLifetime"},this.speed.z=i!=null&&i.speedZ?{...i.speedZ,module:"limitVelocityOverLifetime"}:{..._(this.speed.z),module:"limitVelocityOverLifetime"},this.dampen=(i==null?void 0:i.dampen)??0,this.drag=i!=null&&i.drag?{...i.drag,module:"limitVelocityOverLifetime"}:B("limitVelocityOverLifetime"),this.multiplyDragByParticleSize=(i==null?void 0:i.multiplyDragByParticleSize)??!1,this.multiplyDragByParticleVelocity=(i==null?void 0:i.multiplyDragByParticleVelocity)??!1,this.limitVelocitySpaceMode=(i==null?void 0:i.space)??F.Local,this._forceOverLifetimeModuleEnabled=(m==null?void 0:m.enabled)??!1,this.forceX=(m==null?void 0:m.forceX)??B("forceOverLifetime"),this.forceY=(m==null?void 0:m.forceY)??B("forceOverLifetime"),this.forceZ=(m==null?void 0:m.forceZ)??B("forceOverLifetime"),this.forceSpaceMode=(m==null?void 0:m.space)??F.Local,n?(this._colorOverLifetimeModuleEnabled=n.enabled,this.color=n.color):(this._colorOverLifetimeModuleEnabled=!0,this.color=_t()),this._textureSheetAnimationModuleEnabled=x.enabled,this.textureSheetAnimationType=x.type,this.cycleCount=x.cycleCount,this.tiling=x.tiling,this.frameOverTime=x.frameOverTime,this._noiseModuleEnabled=(u==null?void 0:u.enabled)??!1,this.noiseStrength.enabled=(u==null?void 0:u.separateAxes)??!1;const D=u==null?void 0:u.strengthX;this.noiseStrength.x=D?{...D,module:"noise"}:{..._(this.noiseStrength.x),module:"noise"},this.noiseStrength.y=u!=null&&u.strengthY?{...u.strengthY,module:"noise"}:{..._(this.noiseStrength.y),module:"noise"},this.noiseStrength.z=u!=null&&u.strengthZ?{...u.strengthZ,module:"noise"}:{..._(this.noiseStrength.z),module:"noise"},this.noiseFrequency=(u==null?void 0:u.frequency)??.5,this.noiseScrollSpeed=(u==null?void 0:u.scrollSpeed)??0,this.noiseOctaveCount=(u==null?void 0:u.octaveCount)??1,this.noiseOctaveIntensityMultiplier=(u==null?void 0:u.octaveIntensityMultiplier)??.5,this.noiseOctaveFrequencyMultiplier=(u==null?void 0:u.octaveFrequencyMultiplier)??2}e.methods&&(this.material=e.methods.setMaterial[0][0]);const r=e.methods?e:{...e,methods:{setMaterial:[[this.material]]}};super.deserialize(r)}toJSON(){const e=[];return this.bursts.forEach(t=>{var s;((s=t==null?void 0:t.constructParams)==null?void 0:s[2])===1/0&&(t=_(t),t.constructParams[2]=null),e.push([t])}),{id:this.id,class:this.type,props:{enabled:this.enabled,priority:this.priority,velocityScale:this.velocityScale,lengthScale:this.lengthScale,pivot:this.pivot,renderMode:this.renderMode,mesh:this.mesh,generator:{main:{duration:this.duration,isLoop:this.isLoop,startDelay:this.startDelay,startLifetime:this.startLifetime,startSpeed:this.startSpeed,startSize3D:this.startSize.enabled,startSizeX:this.startSize.x,startSizeY:this.startSize.y,startSizeZ:this.startSize.z,startRotation3D:this.startRotation.enabled,startRotationX:this.startRotation.x,startRotationY:this.startRotation.y,startRotationZ:this.startRotation.z,flipRotation:this.flipRotation,startColor:this.startColor,gravityModifier:this.gravityModifier,simulationSpace:this.simulationSpace,simulationSpeed:this.simulationSpeed,scalingMode:this.scalingMode,playOnEnabled:this.playOnEnabled,maxParticles:this.maxParticles},emission:{enabled:this._emissionModuleEnabled,rateOverTime:this.rateOverTime,shape:this.shape,methods:{addBurst:e}},sizeOverLifetime:{enabled:this._sizeOverLifetimeModuleEnabled,separateAxes:this.size.enabled,sizeX:this.size.x,sizeY:this.size.y,sizeZ:this.size.z},rotationOverLifetime:{enabled:this._rotationOverLifetimeModuleEnabled,separateAxes:this.rotation.enabled,rotationX:this.rotation.x,rotationY:this.rotation.y,rotationZ:this.rotation.z},velocityOverLifetime:{enabled:this._velocityOverLifetimeModuleEnabled,space:this.spaceMode,velocityX:this.velocityX,velocityY:this.velocityY,velocityZ:this.velocityZ},limitVelocityOverLifetime:{enabled:this._limitVelocityOverLifetimeModuleEnabled,separateAxes:this.speed.enabled,speedX:this.speed.x,speedY:this.speed.y,speedZ:this.speed.z,dampen:this.dampen,drag:this.drag,multiplyDragByParticleSize:this.multiplyDragByParticleSize,multiplyDragByParticleVelocity:this.multiplyDragByParticleVelocity,space:this.limitVelocitySpaceMode},forceOverLifetime:{enabled:this._forceOverLifetimeModuleEnabled,space:this.forceSpaceMode,forceX:this.forceX,forceY:this.forceY,forceZ:this.forceZ},colorOverLifetime:{enabled:this._colorOverLifetimeModuleEnabled,color:this.color},textureSheetAnimation:{enabled:this._textureSheetAnimationModuleEnabled,type:this.textureSheetAnimationType,cycleCount:this.cycleCount,tiling:this.tiling,frameOverTime:this.frameOverTime},noise:{enabled:this._noiseModuleEnabled,separateAxes:this.noiseStrength.enabled,strengthX:this.noiseStrength.x,strengthY:this.noiseStrength.y,strengthZ:this.noiseStrength.z,frequency:this.noiseFrequency,scrollSpeed:this.noiseScrollSpeed,octaveCount:this.noiseOctaveCount,octaveIntensityMultiplier:this.noiseOctaveIntensityMultiplier,octaveFrequencyMultiplier:this.noiseOctaveFrequencyMultiplier}}},methods:{setMaterial:[[this.material]]}}}};M([J],S.prototype,"_emissionModuleEnabled",2);M([J],S.prototype,"_emissionShapeModuleEnabled",2);M([J],S.prototype,"_rotationOverLifetimeModuleEnabled",2);M([J],S.prototype,"_sizeOverLifetimeModuleEnabled",2);M([J],S.prototype,"_textureSheetAnimationModuleEnabled",2);M([J],S.prototype,"_velocityOverLifetimeModuleEnabled",2);M([J],S.prototype,"_forceOverLifetimeModuleEnabled",2);M([J],S.prototype,"_limitVelocityOverLifetimeModuleEnabled",2);M([J],S.prototype,"_colorOverLifetimeModuleEnabled",2);M([J],S.prototype,"_noiseModuleEnabled",2);M([R({engineKey:"setMaterial",setPath:"setMaterial()",getPath:"getMaterial()",valueType:xa.ReferResource,getEngineValue:a=>a.getMaterial()}),C({type:A.AssetPicker,assetType:"Material",customFilter:a=>{var e;return((e=a.engineObject.shader)==null?void 0:e.name)==="particle-shader"},priority:-100,label:c("effects.renderer.material.label"),info:c("effects.renderer.material.info")}),O()],S.prototype,"material",2);M([C({bindPath:"priority",min:0,step:1,dragStep:1,priority:-100,label:c("effects.renderer.priority.label"),info:c("effects.renderer.priority.info")}),O()],S.prototype,"priority",2);M([C({bindPath:"velocityScale",priority:-100,label:c("effects.renderer.velocity-scale.label"),info:c("effects.renderer.velocity-scale.info"),when:a=>a.renderMode===W.StretchBillboard}),O()],S.prototype,"velocityScale",2);M([C({bindPath:"lengthScale",priority:-100,label:c("effects.renderer.length-scale.label"),info:c("effects.renderer.length-scale.info"),when:a=>a.renderMode===W.StretchBillboard}),O()],S.prototype,"lengthScale",2);M([C({type:A.Vector3,bindPath:"pivot",label:c("effects.renderer.pivot.label"),priority:-100}),O()],S.prototype,"pivot",2);M([R({getPath:"renderMode",setPath:"renderMode"}),C({type:A.Select,value:W.Billboard,label:c("effects.renderer.render-mode.label"),options:[{label:c("effects.renderer.render-mode.options.billboard"),value:W.Billboard},{label:c("effects.renderer.render-mode.options.stretch-billboard"),value:W.StretchBillboard},{label:c("effects.renderer.render-mode.options.horizontal-billboard"),value:W.HorizontalBillboard},{label:c("effects.renderer.render-mode.options.mesh"),value:W.Mesh},{label:c("effects.renderer.render-mode.options.none"),value:W.None}],onChange(a){a.renderMode===W.Mesh&&a._applyRendererMeshFromRef()},priority:-100}),O()],S.prototype,"renderMode",2);M([C({type:A.AssetPicker,assetType:"Mesh",label:c("effects.renderer.mesh.label"),info:c("effects.renderer.mesh.info"),when:a=>a.renderMode===W.Mesh,onChange:async(a,e,r)=>{a.mesh=r?r.getCurrentRef():null;try{await a.applyBoundPathChange("mesh",A.AssetPicker,a.mesh)}catch(t){console.warn(t)}},priority:-100}),O()],S.prototype,"mesh",2);M([R({getPath:"generator.main.duration",setPath:"generator.main.duration"}),C({bindPath:"generator.main.duration",min:.05,step:.05,dragStep:.05,label:c("effects.renderer.duration.label"),info:c("effects.renderer.duration.info")}),O()],S.prototype,"duration",2);M([R({getPath:"generator.main.isLoop",setPath:"generator.main.isLoop"}),C({bindPath:"generator.main.isLoop",label:c("effects.renderer.loop.label"),info:c("effects.renderer.loop.info")}),O()],S.prototype,"isLoop",2);M([C({customComponent:K,min:0,yRangeMode:"positive",onChange:G,info:c("effects.renderer.start.delay.info"),label:c("effects.renderer.start.delay.label")}),O()],S.prototype,"startDelay",2);M([C({customComponent:K,onChange:G,min:1e-4,yRangeMode:"positive",label:c("effects.renderer.start.lifetime.label"),info:c("effects.renderer.start.lifetime.info")}),O()],S.prototype,"startLifetime",2);M([C({customComponent:K,onChange:G,label:c("effects.renderer.start.speed.label")}),O()],S.prototype,"startSpeed",2);M([C({module:"main",toggleProps:"startSize3D",axisX:"startSizeX",axisY:"startSizeY",axisZ:"startSizeZ",mainAxis:"x",customComponent:fe,onChange:ye("startSize3D"),label:c("effects.renderer.start.size.label"),info:c("effects.renderer.start.size.info"),min:0,yRangeMode:"positive"}),O()],S.prototype,"startSize",2);M([C({module:"main",toggleProps:"startRotation3D",axisX:"startRotationX",axisY:"startRotationY",axisZ:"startRotationZ",mainAxis:"z",customComponent:fe,onChange:ye("startRotation3D"),label:c("effects.renderer.start.rotation.label"),info:c("effects.renderer.start.rotation.info"),step:1}),O()],S.prototype,"startRotation",2);M([R({getPath:"generator.main.flipRotation",setPath:"generator.main.flipRotation"}),C({bindPath:"generator.main.flipRotation",min:0,max:1,step:.05,dragStep:.05,label:c("effects.renderer.flip-rotation.label")}),O()],S.prototype,"flipRotation",2);M([C({customComponent:Qa,onChange:er,label:c("effects.renderer.start.color.label")}),O()],S.prototype,"startColor",2);M([C({customComponent:K,info:c("effects.renderer.gravity-modifier.info"),onChange:G,label:c("effects.renderer.gravity-modifier.label")}),O()],S.prototype,"gravityModifier",2);M([R({getPath:"generator.main.simulationSpace",setPath:"generator.main.simulationSpace"}),C({type:A.Select,bindPath:"generator.main.simulationSpace",value:F.Local,label:c("effects.renderer.simulation.space.label"),info:c("effects.renderer.simulation.space.info"),options:[{label:c("effects.renderer.simulation.space.options.local"),value:F.Local},{label:c("effects.renderer.simulation.space.options.world"),value:F.World}]}),O()],S.prototype,"simulationSpace",2);M([R({getPath:"generator.main.simulationSpeed",setPath:"generator.main.simulationSpeed"}),C({bindPath:"generator.main.simulationSpeed",step:.05,dragStep:.05,label:c("effects.renderer.simulation.speed.label"),info:c("effects.renderer.simulation.speed.info")}),O()],S.prototype,"simulationSpeed",2);M([R({getPath:"generator.main.scalingMode",setPath:"generator.main.scalingMode"}),C({type:A.Select,bindPath:"generator.main.scalingMode",label:c("effects.renderer.scaling-mode.label"),info:c("effects.renderer.scaling-mode.info"),value:be.Local,options:[{label:c("effects.renderer.scaling-mode.options.world"),value:be.Hierarchy},{label:c("effects.renderer.scaling-mode.options.local"),value:be.Local},{label:c("effects.renderer.scaling-mode.options.shape"),value:be.World}]}),O()],S.prototype,"scalingMode",2);M([R({getPath:"generator.main.playOnEnabled",setPath:"generator.main.playOnEnabled"}),C({type:A.Toggle,bindPath:"generator.main.playOnEnabled",label:c("effects.renderer.play-on-enabled.label"),info:c("effects.renderer.play-on-enabled.info")}),O()],S.prototype,"playOnEnabled",2);M([R({getPath:"generator.main.maxParticles",setPath:"generator.main.maxParticles"}),C({type:A.Number,bindPath:"generator.main.maxParticles",min:1,dragStep:1,label:c("effects.renderer.max-particles.label"),info:c("effects.renderer.max-particles.info")}),O()],S.prototype,"maxParticles",2);M([C({customComponent:K,onChange:G,min:0,yRangeMode:"positive",label:c("effects.renderer.rate-over-time.label"),info:c("effects.renderer.rate-over-time.info")}),O()],S.prototype,"rateOverTime",2);M([C({customComponent:Za,onChange:Da}),O()],S.prototype,"shape",2);M([O({type:"methods",key:"addBurst"}),C({label:c("effects.renderer.bursts.label"),info:c("effects.renderer.bursts.info"),customComponent:Ha,onChange:Wa})],S.prototype,"bursts",2);M([C({module:"sizeOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"sizeX",axisY:"sizeY",axisZ:"sizeZ",mainAxis:"x",customComponent:fe,onChange:ye("separateAxes"),min:0,yRangeMode:"positive",label:c("effects.renderer.over-lifetime.size.label")}),O()],S.prototype,"size",2);M([C({module:"rotationOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"rotationX",axisY:"rotationY",axisZ:"rotationZ",mainAxis:"z",customComponent:fe,onChange:ye("separateAxes"),step:1,yTickScale:45,label:c("effects.renderer.over-lifetime.rotation.label")}),O()],S.prototype,"rotation",2);M([R({getPath:"generator.textureSheetAnimation.type",setPath:"generator.textureSheetAnimation.type"}),C({type:A.Select,value:0,label:c("effects.renderer.texture-sheet.type.label"),info:c("effects.renderer.texture-sheet.type.info"),options:[{label:c("effects.renderer.texture-sheet.type.options.whole-sheet"),value:0},{label:c("effects.renderer.texture-sheet.type.options.single-row"),value:1}]}),O()],S.prototype,"textureSheetAnimationType",2);M([R({getPath:"generator.textureSheetAnimation.cycleCount",setPath:"generator.textureSheetAnimation.cycleCount"}),C({bindPath:"generator.textureSheetAnimation.cycleCount",min:1e-4,step:1,dragStep:1,label:c("effects.renderer.texture-sheet.cycle-count.label"),info:c("effects.renderer.texture-sheet.cycle-count.info")}),O()],S.prototype,"cycleCount",2);M([C({type:A.Vector2,min:1,label:c("effects.renderer.texture-sheet.tiling.label"),info:c("effects.renderer.texture-sheet.tiling.info"),onChange(a,e,r){a.applyBoundPathChange("generator.textureSheetAnimation.tiling",A.Vector2,r)}}),O()],S.prototype,"tiling",2);M([C({customComponent:K,onChange:G,min:0,max:1,yRangeMode:"positive",label:c("effects.renderer.over-lifetime.frame.label")}),O()],S.prototype,"frameOverTime",2);M([R({getPath:"generator.velocityOverLifetime.space",setPath:"generator.velocityOverLifetime.space"}),C({type:A.Select,bindPath:"generator.velocityOverLifetime.space",value:0,label:c("effects.renderer.space-mode.label"),info:c("effects.renderer.space-mode.info"),options:[{label:c("effects.renderer.space-mode.options.local"),value:F.Local},{label:c("effects.renderer.space-mode.options.world"),value:F.World}]}),O()],S.prototype,"spaceMode",2);M([R({getPath:"generator.forceOverLifetime.space",setPath:"generator.forceOverLifetime.space"}),C({type:A.Select,bindPath:"generator.forceOverLifetime.space",value:0,label:c("effects.renderer.space-mode.label"),info:c("effects.renderer.space-mode.info-force"),options:[{label:"Local",value:F.Local},{label:"World",value:F.World}]}),O()],S.prototype,"forceSpaceMode",2);M([C({customComponent:K,onChange:G,label:c("effects.renderer.velocity.x.label"),info:c("effects.renderer.velocity.x.info")}),O()],S.prototype,"velocityX",2);M([C({customComponent:K,onChange:G,label:c("effects.renderer.velocity.y.label")}),O()],S.prototype,"velocityY",2);M([C({customComponent:K,onChange:G,label:c("effects.renderer.velocity.z.label")}),O()],S.prototype,"velocityZ",2);M([C({module:"limitVelocityOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"speedX",axisY:"speedY",axisZ:"speedZ",mainAxis:"x",customComponent:fe,onChange:ye("separateAxes"),min:0,yRangeMode:"positive",label:c("effects.renderer.limit-velocity.limit.label")}),O()],S.prototype,"speed",2);M([R({getPath:"generator.limitVelocityOverLifetime.space",setPath:"generator.limitVelocityOverLifetime.space"}),C({type:A.Select,bindPath:"generator.limitVelocityOverLifetime.space",value:0,when:a=>a.speed.enabled,label:c("effects.renderer.space-mode.label"),info:c("effects.renderer.limit-velocity.space.info"),options:[{label:c("effects.renderer.space-mode.options.local"),value:F.Local},{label:c("effects.renderer.space-mode.options.world"),value:F.World}]}),O()],S.prototype,"limitVelocitySpaceMode",2);M([R({getPath:"generator.limitVelocityOverLifetime.dampen",setPath:"generator.limitVelocityOverLifetime.dampen"}),C({bindPath:"generator.limitVelocityOverLifetime.dampen",min:0,max:1,step:.01,dragStep:.01,label:c("effects.renderer.limit-velocity.dampen.label"),info:c("effects.renderer.limit-velocity.dampen.info")}),O()],S.prototype,"dampen",2);M([C({customComponent:K,onChange:G,min:0,yRangeMode:"positive",label:c("effects.renderer.limit-velocity.drag.label"),info:c("effects.renderer.limit-velocity.drag.info")}),O()],S.prototype,"drag",2);M([R({getPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize",setPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize"}),C({type:A.Toggle,bindPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize",label:c("effects.renderer.limit-velocity.multiply-drag-by-size.label"),info:c("effects.renderer.limit-velocity.multiply-drag-by-size.info")}),O()],S.prototype,"multiplyDragByParticleSize",2);M([R({getPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity",setPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity"}),C({type:A.Toggle,bindPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity",label:c("effects.renderer.limit-velocity.multiply-drag-by-velocity.label"),info:c("effects.renderer.limit-velocity.multiply-drag-by-velocity.info")}),O()],S.prototype,"multiplyDragByParticleVelocity",2);M([C({customComponent:K,onChange:G}),O()],S.prototype,"forceX",2);M([C({customComponent:K,onChange:G}),O()],S.prototype,"forceY",2);M([C({customComponent:K,onChange:G}),O()],S.prototype,"forceZ",2);M([C({customComponent:ar,onChange:rr,label:c("effects.renderer.color-over-lifetime.label")}),O()],S.prototype,"color",2);M([C({customComponent:nr,label:c("effects.renderer.noise.preview.label")})],S.prototype,"noisePreview",2);M([C({module:"noise",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"strengthX",axisY:"strengthY",axisZ:"strengthZ",mainAxis:"x",customComponent:fe,onChange:(a,e,r)=>{ye("separateAxes")(a,"strength",r)},label:c("effects.renderer.noise.strength.label")}),O()],S.prototype,"noiseStrength",2);M([R({getPath:"generator.noise.frequency",setPath:"generator.noise.frequency"}),C({bindPath:"generator.noise.frequency",min:1e-6,step:.1,dragStep:.1,label:c("effects.renderer.noise.frequency.label")}),O()],S.prototype,"noiseFrequency",2);M([R({getPath:"generator.noise.scrollSpeed",setPath:"generator.noise.scrollSpeed"}),C({bindPath:"generator.noise.scrollSpeed",min:0,step:.01,dragStep:.01,label:c("effects.renderer.noise.scroll-speed.label")}),O()],S.prototype,"noiseScrollSpeed",2);M([R({getPath:"generator.noise.octaveCount",setPath:"generator.noise.octaveCount"}),C({bindPath:"generator.noise.octaveCount",min:1,max:3,step:1,dragStep:1,label:c("effects.renderer.noise.octave-count.label")}),O()],S.prototype,"noiseOctaveCount",2);M([R({getPath:"generator.noise.octaveIntensityMultiplier",setPath:"generator.noise.octaveIntensityMultiplier"}),C({bindPath:"generator.noise.octaveIntensityMultiplier",min:0,max:1,step:.01,dragStep:.01,when:a=>a.noiseOctaveCount>1,label:c("effects.renderer.noise.octave-intensity-multiplier.label")}),O()],S.prototype,"noiseOctaveIntensityMultiplier",2);M([R({getPath:"generator.noise.octaveFrequencyMultiplier",setPath:"generator.noise.octaveFrequencyMultiplier"}),C({bindPath:"generator.noise.octaveFrequencyMultiplier",min:1,max:4,step:.1,dragStep:.1,when:a=>a.noiseOctaveCount>1,label:c("effects.renderer.noise.octave-frequency-multiplier.label")}),O()],S.prototype,"noiseOctaveFrequencyMultiplier",2);S=M([Sa({type:"ParticleRenderer",customInspector:Ea,componentsMenu:{group:"effects",label:c("component.particle-renderer.title")}})],S);export{S as ParticleRendererComponent};
