@galacean/cli 2.0.0-alpha.24 → 2.0.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.bundle.cjs +820 -957
- package/dist/preview-client/_static/{Accordion-f938dadf.js → Accordion-2cd014f1.js} +1 -1
- package/dist/preview-client/_static/{AmbientLightAsset-e34de607.js → AmbientLightAsset-be9e872c.js} +1 -1
- package/dist/preview-client/_static/{AnimationClipAsset-b084da2a.js → AnimationClipAsset-d7b37af0.js} +1 -1
- package/dist/preview-client/_static/{AnimatorControllerAsset-6cc04274.js → AnimatorControllerAsset-2716497a.js} +1 -1
- package/dist/preview-client/_static/{AnimatorStore-0bc90c37.js → AnimatorStore-883a28ad.js} +1 -1
- package/dist/preview-client/_static/{AssetViewer-d2c63b00.js → AssetViewer-3847c058.js} +1 -1
- package/dist/preview-client/_static/{AudioAsset-9c715952.js → AudioAsset-c28f33ab.js} +1 -1
- package/dist/preview-client/_static/{AudioComponent-80d06ef4.js → AudioComponent-3d6c73ce.js} +1 -1
- package/dist/preview-client/_static/{Callout-48e71f13.js → Callout-e2a89f6f.js} +1 -1
- package/dist/preview-client/_static/{CameraComponent-9c9db3fb.js → CameraComponent-3dc63451.js} +1 -1
- package/dist/preview-client/_static/{Component-b95aa2af.js → Component-0f881fc1.js} +1 -1
- package/dist/preview-client/_static/{DirectLight-b0490ef7.js → DirectLight-96dbba47.js} +1 -1
- package/dist/preview-client/_static/{FontAsset-6e9c0549.js → FontAsset-d34b5378.js} +1 -1
- package/dist/preview-client/_static/{FormItemArray-b2a3d249.js → FormItemArray-b8cda1d2.js} +1 -1
- package/dist/preview-client/_static/{GlTFAsset-83e8190e.js → GlTFAsset-5970e707.js} +2 -2
- package/dist/preview-client/_static/{IconPlus-172c6c17.js → IconPlus-def01e2b.js} +1 -1
- package/dist/preview-client/_static/{IconPointFilled-bad94cf1.js → IconPointFilled-62d3c3b2.js} +1 -1
- package/dist/preview-client/_static/{LightBaseComponent-b4854e8a.js → LightBaseComponent-d651a276.js} +1 -1
- package/dist/preview-client/_static/{LottieAnimationComponent-efd5da2b.js → LottieAnimationComponent-f10dc558.js} +1 -1
- package/dist/preview-client/_static/{MarkdownAsset-b42846c0.js → MarkdownAsset-b2a3fad5.js} +1 -1
- package/dist/preview-client/_static/{MaterialAsset-0b9d7eba.js → MaterialAsset-5353c4cb.js} +1 -1
- package/dist/preview-client/_static/{MaterialInspector-23ea0240.js → MaterialInspector-8d466d59.js} +1 -1
- package/dist/preview-client/_static/{Menu-05c1f0a4.js → Menu-c8e6194b.js} +1 -1
- package/dist/preview-client/_static/{MeshAsset-85e99837.js → MeshAsset-c2bf60c5.js} +1 -1
- package/dist/preview-client/_static/{MeshRendererBaseComponent-5621d663.js → MeshRendererBaseComponent-fde6b6a5.js} +1 -1
- package/dist/preview-client/_static/{MeshRendererComponent-c3c3c683.js → MeshRendererComponent-430774ef.js} +1 -1
- package/dist/preview-client/_static/{MeshThumbnail-b1283749.js → MeshThumbnail-07ffa076.js} +1 -1
- package/dist/preview-client/_static/ParticleRendererComponent-e106bd8c.js +26 -0
- package/dist/preview-client/_static/{PhysicsMaterialAsset-cb9afb6e.js → PhysicsMaterialAsset-a2f73b5c.js} +1 -1
- package/dist/preview-client/_static/{PhysicsStore-0a751fa0.js → PhysicsStore-818c2f61.js} +1 -1
- package/dist/preview-client/_static/{PointLight-a2bfed75.js → PointLight-add790ea.js} +1 -1
- package/dist/preview-client/_static/{PostProcessComponent-040cf521.js → PostProcessComponent-af270a77.js} +1 -1
- package/dist/preview-client/_static/{PrefabAsset-265f6f48.js → PrefabAsset-59743dbb.js} +1 -1
- package/dist/preview-client/_static/{PrimitiveMesh-70c93e7e.js → PrimitiveMesh-075dda8a.js} +1 -1
- package/dist/preview-client/_static/{ReferencedMaterial-831d0583.js → ReferencedMaterial-d11151b5.js} +1 -1
- package/dist/preview-client/_static/{RenderTargetAsset-b810caf3.js → RenderTargetAsset-b3cd1c49.js} +1 -1
- package/dist/preview-client/_static/{SceneAsset-d05b1a79.js → SceneAsset-08752701.js} +1 -1
- package/dist/preview-client/_static/{ShaderAsset-370b6f1c.js → ShaderAsset-a9d667f5.js} +1 -1
- package/dist/preview-client/_static/{ShaderChunkAsset-e3487bd1.js → ShaderChunkAsset-e43dde8a.js} +1 -1
- package/dist/preview-client/_static/{ShaderUIScriptAsset-ebf57ceb.js → ShaderUIScriptAsset-e1cd0b8b.js} +1 -1
- package/dist/preview-client/_static/{SkinnedMeshRendererComponent-ee33da25.js → SkinnedMeshRendererComponent-9756bd5f.js} +1 -1
- package/dist/preview-client/_static/{SpineAnimationComponent-12e694e8.js → SpineAnimationComponent-f3e0ff44.js} +1 -1
- package/dist/preview-client/_static/{SpineSkeletonDataAsset-0dffbb4d.js → SpineSkeletonDataAsset-43b731f1.js} +1 -1
- package/dist/preview-client/_static/{SpotLight-ada565f2.js → SpotLight-649b0e21.js} +1 -1
- package/dist/preview-client/_static/{SpriteBaseComponent-3156cb3b.js → SpriteBaseComponent-d2a7ab4c.js} +1 -1
- package/dist/preview-client/_static/{SpriteMaskComponent-a32024e1.js → SpriteMaskComponent-2c1cef5e.js} +1 -1
- package/dist/preview-client/_static/{SpriteRendererComponent-489486e0.js → SpriteRendererComponent-33b71997.js} +1 -1
- package/dist/preview-client/_static/{TextBaseComponent-520dea39.js → TextBaseComponent-9310e0c6.js} +1 -1
- package/dist/preview-client/_static/{TextRendererComponent-6be5f80c.js → TextRendererComponent-8dc0d7fb.js} +1 -1
- package/dist/preview-client/_static/{TextureAsset-9cd94531.js → TextureAsset-a7ff39b1.js} +1 -1
- package/dist/preview-client/_static/{Tooltip-71e5a4e7.js → Tooltip-b5be390f.js} +1 -1
- package/dist/preview-client/_static/{TrailRendererComponent-74bf88c0.js → TrailRendererComponent-c4635fab.js} +1 -1
- package/dist/preview-client/_static/{TransformBaseComponent-0d241199.js → TransformBaseComponent-1473deaa.js} +1 -1
- package/dist/preview-client/_static/{TransformComponent-49d279f5.js → TransformComponent-e544f7ac.js} +1 -1
- package/dist/preview-client/_static/{XRReferenceImageAsset-79e78558.js → XRReferenceImageAsset-96f516ba.js} +1 -1
- package/dist/preview-client/_static/{audio-5d0ddf55.js → audio-b5fbde34.js} +1 -1
- package/dist/preview-client/_static/{createOnModelChange-e65da908.js → createOnModelChange-370b83da.js} +1 -1
- package/dist/preview-client/_static/{createReactComponent-cb70ea50.js → createReactComponent-58d9f0dd.js} +1 -1
- package/dist/preview-client/_static/{index-7e414715.js → index-05b76766.js} +1 -1
- package/dist/preview-client/_static/{index-b13216a9.js → index-0dd5bb36.js} +1 -1
- package/dist/preview-client/_static/{index-d00c8bc3.js → index-29c59aff.js} +1 -1
- package/dist/preview-client/_static/index-3680d0e0.js +1 -0
- package/dist/preview-client/_static/index-42aa3a49.js +1 -0
- package/dist/preview-client/_static/index-496f331d.js +1 -0
- package/dist/preview-client/_static/{index-46c87b46.js → index-74bcfad9.js} +1 -1
- package/dist/preview-client/_static/{index-788e8750.js → index-88650db7.js} +1 -1
- package/dist/preview-client/_static/index-9f0122f0.js +1 -0
- package/dist/preview-client/_static/{index-b4bde36a.js → index-ab8556cb.js} +3 -3
- package/dist/preview-client/_static/{index-e44b357e.js → index-c3dec278.js} +11 -11
- package/dist/preview-client/_static/index-c6b7045c.js +1 -0
- package/dist/preview-client/_static/index-cdbb2f4d.js +1 -0
- package/dist/preview-client/_static/{index-ea7fe254.js → index-da16047f.js} +1 -1
- package/dist/preview-client/_static/{index-f7bd6fef.js → index-dd0763bf.js} +1 -1
- package/dist/preview-client/_static/index-dddcae01.js +1 -0
- package/dist/preview-client/_static/{ktx2-encoder-522fc017.js → ktx2-encoder-db93524f.js} +1 -1
- package/dist/preview-client/_static/{module-57b6e417.js → module-ada3dced.js} +1 -1
- package/dist/preview-client/_static/{module-5906e0d4.js → module-de7ee724.js} +1 -1
- package/dist/preview-client/_static/{module-5547be1c.js → module-ec094ef6.js} +1 -1
- package/dist/preview-client/_static/postmen-2853c0e6.js +2 -0
- package/dist/preview-client/_static/{shader-data-utils-000170ae.js → shader-data-utils-f0e4f5a3.js} +1 -1
- package/dist/preview-client/index.html +1 -1
- package/package.json +27 -32
- package/dist/preview-client/_static/ParticleRendererComponent-94656239.js +0 -26
- package/dist/preview-client/_static/index-0fef73f8.js +0 -1
- package/dist/preview-client/_static/index-1e036622.js +0 -1
- package/dist/preview-client/_static/index-1fd4207a.js +0 -1
- package/dist/preview-client/_static/index-6649d404.js +0 -1
- package/dist/preview-client/_static/index-87ef1c72.js +0 -1
- package/dist/preview-client/_static/index-d9ee84ce.js +0 -1
- package/dist/preview-client/_static/index-debbe073.js +0 -1
- package/dist/preview-client/_static/postmen-443b3e5f.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b4 as oe,b5 as te,b6 as T,b7 as c,av as r,b8 as D,b9 as re,ba as ne,bb as ie,bc as O,bd as ae,be as ce,bf as se,bg as de,bh as V,aH as b,bi as le}from"./index-
|
|
1
|
+
import{b4 as oe,b5 as te,b6 as T,b7 as c,av as r,b8 as D,b9 as re,ba as ne,bb as ie,bc as O,bd as ae,be as ce,bf as se,bg as de,bh as V,aH as b,bi as le}from"./index-c3dec278.js";var u="Accordion",pe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[H,ue,fe]=oe(u),[C,Ee]=te(u,[fe,T]),P=T(),M=c.forwardRef((o,i)=>{const{type:e,...n}=o,a=n,t=n;return r.jsx(H.Provider,{scope:o.__scopeAccordion,children:e==="multiple"?r.jsx(me,{...t,ref:i}):r.jsx(be,{...a,ref:i})})});M.displayName=u;var[B,ge]=C(u),[L,he]=C(u,{collapsible:!1}),be=c.forwardRef((o,i)=>{const{value:e,defaultValue:n,onValueChange:a=()=>{},collapsible:t=!1,...s}=o,[d,l]=D({prop:e,defaultProp:n,onChange:a});return r.jsx(B,{scope:o.__scopeAccordion,value:d?[d]:[],onItemOpen:l,onItemClose:c.useCallback(()=>t&&l(""),[t,l]),children:r.jsx(L,{scope:o.__scopeAccordion,collapsible:t,children:r.jsx(K,{...s,ref:i})})})}),me=c.forwardRef((o,i)=>{const{value:e,defaultValue:n,onValueChange:a=()=>{},...t}=o,[s=[],d]=D({prop:e,defaultProp:n,onChange:a}),l=c.useCallback(h=>d((f=[])=>[...f,h]),[d]),g=c.useCallback(h=>d((f=[])=>f.filter($=>$!==h)),[d]);return r.jsx(B,{scope:o.__scopeAccordion,value:s,onItemOpen:l,onItemClose:g,children:r.jsx(L,{scope:o.__scopeAccordion,collapsible:!0,children:r.jsx(K,{...t,ref:i})})})}),[xe,A]=C(u),K=c.forwardRef((o,i)=>{const{__scopeAccordion:e,disabled:n,dir:a,orientation:t="vertical",...s}=o,d=c.useRef(null),l=re(d,i),g=ue(e),f=ne(a)==="ltr",$=ie(o.onKeyDown,m=>{var E;if(!pe.includes(m.key))return;const Z=m.target,S=g().filter(j=>{var N;return!((N=j.ref.current)!=null&&N.disabled)}),x=S.findIndex(j=>j.ref.current===Z),z=S.length;if(x===-1)return;m.preventDefault();let p=x;const I=0,w=z-1,y=()=>{p=x+1,p>w&&(p=I)},R=()=>{p=x-1,p<I&&(p=w)};switch(m.key){case"Home":p=I;break;case"End":p=w;break;case"ArrowRight":t==="horizontal"&&(f?y():R());break;case"ArrowDown":t==="vertical"&&y();break;case"ArrowLeft":t==="horizontal"&&(f?R():y());break;case"ArrowUp":t==="vertical"&&R();break}const ee=p%z;(E=S[ee].ref.current)==null||E.focus()});return r.jsx(xe,{scope:e,disabled:n,direction:a,orientation:t,children:r.jsx(H.Slot,{scope:e,children:r.jsx(O.div,{...s,"data-orientation":t,ref:l,onKeyDown:n?void 0:$})})})}),v="AccordionItem",[ve,k]=C(v),U=c.forwardRef((o,i)=>{const{__scopeAccordion:e,value:n,...a}=o,t=A(v,e),s=ge(v,e),d=P(e),l=ae(),g=n&&s.value.includes(n)||!1,h=t.disabled||o.disabled;return r.jsx(ve,{scope:e,open:g,disabled:h,triggerId:l,children:r.jsx(ce,{"data-orientation":t.orientation,"data-state":J(g),...d,...a,ref:i,disabled:h,open:g,onOpenChange:f=>{f?s.onItemOpen(n):s.onItemClose(n)}})})});U.displayName=v;var G="AccordionHeader",W=c.forwardRef((o,i)=>{const{__scopeAccordion:e,...n}=o,a=A(u,e),t=k(G,e);return r.jsx(O.h3,{"data-orientation":a.orientation,"data-state":J(t.open),"data-disabled":t.disabled?"":void 0,...n,ref:i})});W.displayName=G;var _="AccordionTrigger",Y=c.forwardRef((o,i)=>{const{__scopeAccordion:e,...n}=o,a=A(u,e),t=k(_,e),s=he(_,e),d=P(e);return r.jsx(H.ItemSlot,{scope:e,children:r.jsx(se,{"aria-disabled":t.open&&!s.collapsible||void 0,"data-orientation":a.orientation,id:t.triggerId,...d,...n,ref:i})})});Y.displayName=_;var q="AccordionContent",F=c.forwardRef((o,i)=>{const{__scopeAccordion:e,...n}=o,a=A(u,e),t=k(q,e),s=P(e);return r.jsx(de,{role:"region","aria-labelledby":t.triggerId,"data-orientation":a.orientation,...s,...n,ref:i,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...o.style}})});F.displayName=q;function J(o){return o?"open":"closed"}var Ce=M,Ae=U,$e=W,Se=Y,Ie=F;const we=V({from:{height:0,opacity:0},to:{height:"var(--radix-accordion-content-height)",opacity:1}}),ye=V({from:{height:"var(--radix-accordion-content-height)",opacity:1},to:{height:0,opacity:0}}),Q=c.createContext({size:"sm"}),Re=b(Ce,{width:"100%",display:"flex",flexDirection:"column"}),je=b(Ae,{position:"relative",boxSizing:"border-box",width:"100%",backgroundColor:"$surface",border:"1px solid $border",borderBottom:"none",overflow:"hidden","&:first-child":{borderTopLeftRadius:"$sm",borderTopRightRadius:"$sm"},"&:last-child":{borderBottomLeftRadius:"$sm",borderBottomRightRadius:"$sm",borderBottom:"1px solid $border"},"&[data-state=open]":{borderColor:"$borderStrong","&:not(:first-child)":{borderTopColor:"$borderStrong"},"& + &":{borderTopColor:"$borderStrong"}},"&:has(+ [data-state=open])":{borderBottomColor:"$borderStrong"}}),X=b(le,{width:"$iconSm",height:"$iconSm",color:"currentColor",flexShrink:0,transform:"rotate(0deg)",transition:"transform .2s ease, color .2s ease"}),_e=b($e,{all:"unset",display:"block"}),He=b(Se,{all:"unset",display:"flex",width:"100%",minHeight:"30px",padding:"0 $3",alignItems:"center",justifyContent:"space-between",gap:"$2",fontSize:"$2",lineHeight:"$lineHeights$2",fontWeight:500,color:"$text",overflow:"hidden",boxSizing:"border-box",userSelect:"none",backgroundColor:"$grayA2",transition:"$backgroundColor, $borderColor, $color","& > span":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'&[data-state="open"]':{[`& ${X}`]:{transform:"rotate(90deg)"}},"&:hover":{backgroundColor:"$grayA3",color:"$textStrong"},"&:focus-visible":{outline:"none",boxShadow:"$focus"},variants:{size:{sm:{minHeight:"27px",padding:"0 $2",fontSize:"$1",lineHeight:"$lineHeights$1"},md:{minHeight:"30px",padding:"0 $3",fontSize:"$2",lineHeight:"$lineHeights$2"}}},defaultVariants:{size:"sm"}}),Pe=b(Ie,{overflow:"hidden",fontSize:"$1",color:"$text",backgroundColor:"$grayA2",'&[data-state="open"]':{animation:`${we} 200ms cubic-bezier(0.16, 1, 0.3, 1)`},'&[data-state="closed"]':{animation:`${ye} 180ms cubic-bezier(0.16, 1, 0.3, 1)`},"@media (prefers-reduced-motion: reduce)":{'&[data-state="open"], &[data-state="closed"]':{animation:"none"}}}),ke=b("div",{color:"$text",borderTop:"1px solid $border",variants:{size:{sm:{padding:"$2",fontSize:"$1",lineHeight:"$lineHeights$1"},md:{padding:"$3",fontSize:"$1",lineHeight:"$lineHeights$2"}}},defaultVariants:{size:"sm"}}),Ne=function(i){const{size:e="sm",...n}=i;return r.jsx(Q.Provider,{value:{size:e},children:r.jsx(Re,{...n})})};function Te(o){const{size:i}=c.useContext(Q),{children:e,title:n,arrow:a=!0,...t}=o;return r.jsxs(je,{...t,children:[r.jsx(_e,{children:r.jsxs(He,{size:i,children:[r.jsx("span",{children:n}),a&&r.jsx(X,{"aria-hidden":!0})]})}),r.jsx(Pe,{children:r.jsx(ke,{size:i,children:e})})]})}export{Ne as A,Te as a};
|
package/dist/preview-client/_static/{AmbientLightAsset-e34de607.js → AmbientLightAsset-be9e872c.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var nt=Object.defineProperty;var ot=(r,t,e)=>t in r?nt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var k=(r,t,e)=>(ot(r,typeof t!="symbol"?t+"":t,e),e);import{dv as T,dw as rt,dx as st,dy as at,dz as it,dA as ct,dB as ut,y as lt,bD as ft,z as ht,j as dt,dC as Z,dD as mt,dE as bt,Z as gt,n as yt,e as pt,dF as wt}from"./index-
|
|
1
|
+
var nt=Object.defineProperty;var ot=(r,t,e)=>t in r?nt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var k=(r,t,e)=>(ot(r,typeof t!="symbol"?t+"":t,e),e);import{dv as T,dw as rt,dx as st,dy as at,dz as it,dA as ct,dB as ut,y as lt,bD as ft,z as ht,j as dt,dC as Z,dD as mt,dE as bt,Z as gt,n as yt,e as pt,dF as wt}from"./index-c3dec278.js";import{k as kt,H as Bt}from"./ktx2-encoder-db93524f.js";import"./index-cdbb2f4d.js";import"./TaskQueue-05c94a4d.js";import"./ktx-parse.modern-6c9f771f.js";class D{static getWorker(t){const e=this.getWorkerCodeByFunctionList(t);if(this._workerCache[e])return this._workerCache[e];const n=this.getWorkerURLByCode(e),o=new Worker(n);return this._workerCache[e]=o,this.registerWorkerEvent(o),o}static registerWorkerEvent(t){t.onmessage=e=>{const n=e.data,{type:o,taskID:a}=n;switch(o){case"calculateSHFromTextureCube":const i=this._callbacks[a],s=n.result;i.resolve(s);break}}}static getURLByWorker(t){for(let e in this._workerCache)if(this._workerCache[e]===t)return e}static getWorkerCodeByFunctionList(t){const e=St.toString(),n=e.substring(e.indexOf("{")+1,e.lastIndexOf("}"));return`
|
|
2
2
|
${t.map(a=>a.toString()).join(`
|
|
3
3
|
`)}
|
|
4
4
|
${n}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var ut=Object.defineProperty;var yt=(_,t,n)=>t in _?ut(_,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):_[t]=n;var g=(_,t,n)=>(yt(_,typeof t!="symbol"?t+"":t,n),n);import{aJ as X,av as V,bk as dt,e as j,cl as et,cm as mt,aN as ft,aH as gt,aI as Pt,u as it,S as ot,bS as _t,x as L,aC as E,bo as vt,br as bt,cn as Ct,co as Tt,y as wt,cp as Et,bE as At,cq as St,cr as xt,cs as Mt,N as Vt,O as It,ct as Ot,cu as jt,cv as Ft,cw as Rt,cx as Bt,cy as Lt,cz as Dt,cA as $t,cB as Kt,cC as Nt,cD as kt,cE as zt,cF as Ut,cG as Ht,aE as y,cH as Gt,bL as I,cI as Jt,cJ as Qt,cK as Wt,cL as qt,cM as Yt,cN as Xt,cO as Zt,cP as te,cQ as ee,cR as re,cS as ne,j as ae,cT as O,bX as W,cU as H,c5 as q,cV as x,bV as Y,cW as se,cX as rt,ap as ie,cY as oe,ac as nt,cZ as B,ai as at,c_ as pe,H as ce,c$ as le,at as he,au as ue,V as ye,F as de,b3 as me,d0 as G,bF as fe,m as ge,aT as Pe,c2 as _e,n as ve,o as be,d1 as Ce}from"./index-e44b357e.js";import{a as pt,r as st}from"./index-debbe073.js";import"./postmen-443b3e5f.js";import{A as Te}from"./AssetViewer-d2c63b00.js";import{e as ct}from"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import{L as we}from"./module-5547be1c.js";import{a as Ee}from"./module-57b6e417.js";const Ae=X(()=>{const _=pt("animationClipStore"),{selectedEvent:t}=_,{paramType:n}=t;return V.jsxs("div",{children:[V.jsx(dt,{label:j("animation.clip.param-type.title"),options:[{value:"string",label:String(j("animation.clip.param-type.string"))},{value:"number",label:String(j("animation.clip.param-type.number"))},{value:"null",label:String(j("animation.clip.param-type.null"))}],value:n||"null",onChange:r=>{t.paramType=r,_.updateEvents([t])}}),V.jsx(et,{label:j("animation.clip.function-name"),value:t.functionName,onChange:r=>{t.functionName=r,_.updateEvents([t])}}),n==="number"&&V.jsx(mt,{label:j("animation.clip.number"),value:t.number,onChange:r=>{t.number=r,_.updateEvents([t])}}),n==="string"&&V.jsx(et,{label:j("animation.clip.string"),value:t.string,onChange:r=>{t.string=r,_.updateEvents([t])}})]})}),Se=X(function(){const t=pt("animationClipStore"),{selectedEvent:n}=t;return n?V.jsx(ft,{title:j("animation.clip.event"),defaultOpen:!0,children:V.jsx(V.Fragment,{children:V.jsx(Ae,{})})}):null});var xe=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,N=(_,t,n,r)=>{for(var e=r>1?void 0:r?Me(t,n):t,a=_.length-1,i;a>=0;a--)(i=_[a])&&(e=(r?i(t,n,e):i(e))||e);return r&&e&&xe(t,n,e),e};const Ve=gt(Pt,{position:"absolute",top:0,left:0,margin:"auto",width:"100%",height:228,alignItems:"center",justifyContent:"center"});class $ extends Te{constructor(){super();g(this,"frameTime",0);g(this,"duration",0);g(this,"playing",!1);g(this,"_clip");g(this,"_updateComponent");g(this,"animationNames");g(this,"overridePreviewer",X(({asset:n,viewer:r})=>V.jsx(V.Fragment,{children:n.isSubAsset||n.root.sceneUIStore.lastSelectedId?V.jsx(_t,{asset:n,viewer:r}):V.jsx(Ve,{children:V.jsx(V.Fragment,{children:j("animation.clip.select-entity-preview")})})})));it(this)}selectAnimation(n){}async setViewAsset(n,r){var i,s;let e;if(n.isSubAsset){const o=await n.root.assetStore.getAssetByRef({refId:n.mainId}),{defaultSceneRoot:c}=o.engineObject;e=((i=n.root.sceneStore.lastSelectedEntity)==null?void 0:i.engineObject)||c}else e=(s=n.root.sceneStore.lastSelectedEntity)==null?void 0:s.engineObject;if(!e)return;this._clip=n.engineObject,this.animationNames=[n.name],this._entity=e.clone(),r.addChild(this._entity);const a=this;this._updateComponent=this._entity.addComponent(class extends ot{onUpdate(o){a._onUpdate(100/3)}}),this.frameTime=0,this.duration=this._clip.length}stopViewAsset(){var n;super.stopViewAsset(),this.frameTime=0,this.pauseAnimation(),(n=this._updateComponent)==null||n.destroy()}setFrameTime(n){this.frameTime=n,this._sampleAnimation()}playAnimation(){this._clip&&(this.playing=!0)}pauseAnimation(){this.playing=!1}_onUpdate(n){!this.playing||!this._clip||!this.duration||(this.frameTime+=n/1e3,this.frameTime>this.duration&&(this.frameTime%=this.duration),this._sampleAnimation())}_sampleAnimation(){try{this._clip._sampleAnimation(this._entity,this.frameTime)}catch(n){console.warn(n)}}}N([L],$.prototype,"frameTime",2);N([L],$.prototype,"duration",2);N([L],$.prototype,"playing",2);N([E],$.prototype,"setViewAsset",1);N([E],$.prototype,"setFrameTime",1);N([E],$.prototype,"playAnimation",1);N([E],$.prototype,"pauseAnimation",1);N([E],$.prototype,"_onUpdate",1);const K=new Map([[vt,"Transform"],[bt,"Animator"],[Ct,"DirectLight"],[Tt,"Camera"],[wt,"MeshRenderer"],[Et,"SkinnedMeshRenderer"],[At,"ParticleRenderer"],[St,"PointLight"],[xt,"SpotLight"],[ot,"Script"],[Mt,"SpriteMask"],[Vt,"SpriteRenderer"],[It,"TextRenderer"],[Ot,"UITransform"],[jt,"UICanvas"],[Ft,"UIGroup"],[Rt,"Button"],[Bt,"Image"],[Lt,"Text"],[Dt,"DynamicCollider"],[$t,"StaticCollider"],[Kt,"CharacterController"],[Nt,"SpringJoint"],[kt,"FixedJoint"],[zt,"HingeJoint"],[Ut,"AudioSource"],[Ht,"PostProcess"],[Ee,"SpineAnimationRenderer"],[we,"LottieAnimation"]]);var Ie=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,T=(_,t,n,r)=>{for(var e=r>1?void 0:r?Oe(t,n):t,a=_.length-1,i;a>=0;a--)(i=_[a])&&(e=(r?i(t,n,e):i(e))||e);return r&&e&&Ie(t,n,e),e};const Z=new Map([[y.Float,{curveClass:Gt,name:"AnimationFloatCurve",defaultInterpolation:I.Hermite}],[y.FloatArray,{curveClass:Jt,name:"AnimationFloatArrayCurve",defaultInterpolation:I.Hermite}],[y.Vector2,{curveClass:Qt,name:"AnimationVector2Curve",defaultInterpolation:I.Hermite}],[y.Vector3,{curveClass:Wt,name:"AnimationVector3Curve",defaultInterpolation:I.Hermite}],[y.Vector4,{curveClass:qt,name:"AnimationVector4Curve",defaultInterpolation:I.Hermite}],[y.Quaternion,{curveClass:Yt,name:"AnimationQuaternionCurve",defaultInterpolation:I.Hermite}],[y.Color,{curveClass:Xt,name:"AnimationColorCurve",defaultInterpolation:I.Hermite}],[y.ReferResource,{curveClass:Zt,name:"AnimationRefCurve",defaultInterpolation:I.Step}],[y.Rect,{curveClass:te,name:"AnimationRectCurve",defaultInterpolation:I.Step}],[y.Boolean,{curveClass:ee,name:"AnimationBoolCurve",defaultInterpolation:I.Step}],[y.String,{curveClass:re,name:"AnimationStringCurve",defaultInterpolation:I.Step}],[y.Array,{curveClass:ne,name:"AnimationArrayCurve",defaultInterpolation:I.Hermite}]]),lt=new Map;Z.forEach((_,t)=>{lt.set(_.curveClass,t)});const ht=new Map;Z.forEach(_=>{ht.set(_.curveClass,_.name)});let C=class extends ae{constructor(t){super(t);g(this,"samples",60);g(this,"properties",[]);g(this,"pathPropertyMap",new Map);g(this,"keyframeDataList",[]);g(this,"events",{});g(this,"data");g(this,"selectedEventId");g(this,"rootEntityId");g(this,"showEditor");g(this,"readOnly",!1);g(this,"_propertyCurveMap",{});g(this,"_originValueStore",new Map);g(this,"_initKeyframeDataPromise");g(this,"_parseKeyframeValuePromise");g(this,"_colorList",["#3477FA","#67FEBB","#C201BF","#F6ED17","#FE6C02","#FD86C2","#A2B44B","#68D8F0","#008225","#A56A02"]);g(this,"_colorIndex",0);g(this,"_openIndex",0);g(this,"_componentsChangedListenerDisposer");g(this,"_propertyPathCache",new Map);g(this,"_propertyLabelMap",new Map);g(this,"_editorPathCache",new Map);it(this),this.onDoubleClick=this.onDoubleClick.bind(this)}get rootEntity(){return this.root.sceneStore.getEntityModel(this.rootEntityId)}get addedPropertiesTreeData(){return this.properties.map(t=>this._convertPropertyToTreeItem(t))}persistMainViaFacade(){this.root.assetFacade.persistAssetMain(this.id)}persistMetaViaFacade(){this.root.assetFacade.persistAssetMeta(this.id)}addProperty(t){const{type:n,parentProperty:r}=t,e=B(t),a=this.pathPropertyMap.get(e),i=this.properties;let s;if(a)W.error(j("animation.clip.error.property-existed"));else{if(n===O.Property)s=this._addPropertyToList(i,t,null);else{const o=i.find(c=>c.propertyPath===r.propertyPath&&c.relativePath===r.relativePath&&c.componentType===r.componentType);if(o)o.properties.find(p=>p.path===e)?W.error(j("animation.clip.error.sub-property-existed")):s=this._addPropertyToList(o.properties,t,o);else{const c=this._addPropertyToList(i,r,null,!1);s=this._addPropertyToList(c.properties,t,c)}}return this._sortProperties(),this.properties=i.slice(0),this._updateCurveBindings(),this.persistMetaViaFacade(),this.persistMainViaFacade(),s}}delProperty(t){const n=new Set;t.forEach(r=>{if(n.add(r.path),this.pathPropertyMap.delete(r.path),r.type===O.Property)r.properties.forEach(e=>{n.add(e.path),this.pathPropertyMap.delete(e.path)}),this._delPropertyFromList(this.properties,r);else{const e=this.properties.find(a=>a.path===r.parentPath);e&&(this._delPropertyFromList(e.properties,r),e.hasSubProperty&&!e.properties.length&&this._delPropertyFromList(this.properties,e))}}),this._sortProperties(),this.properties=this.properties.slice(0),this._removeCurveBindings(n),this._updateCurveBindings(),this.updateKeyframes(this.keyframeDataList.filter(r=>!n.has(r.path))),this.persistMetaViaFacade(),this.persistMainViaFacade()}async addKeyframe(t,n){const{rootEntity:r}=this,e=this.pathPropertyMap.get(n),{type:a,path:i,parentPath:s,properties:o,supported:c}=e;if(!c){W.error(j("animation.clip.error.property-not-supported"));return}const p=a===O.SubProperty?this.pathPropertyMap.get(s):null,{editorReference:h,editorPropertyPath:u,propertyPos:d}=await this._getReferenceAndActualPropertyPath(r,e),l=u[d],m=H(h)[l];let f=h[l];m!=null&&m.getActualEditorValue&&(f=m.getActualEditorValue(f));let A=e.valueType;a===O.Property&&(m!=null&&m.valueType)&&(A=m.valueType),a===O.SubProperty&&(f=f[u[d+1]]);const P=q(f);if(o.length)o.forEach(b=>{const{path:v}=b,w=P[b.name],S=this.keyframeDataList.find(M=>M.path===v&&M.frame===t);if(S)S.value=w,S.inTangentMode=x.Linear,S.outTangentMode=x.Linear;else{const M=this._createKeyframeData(t,w,b.valueType,void 0,void 0,b,e);this.keyframeDataList.push(M)}});else{const b=this.keyframeDataList.find(v=>v.path===i&&v.frame===t);if(b)b.value=P,b.inTangent=void 0,b.outTangent=void 0;else{const v=this._createKeyframeData(t,P,A,void 0,void 0,e,a===O.SubProperty?p:null);this.keyframeDataList.push(v)}}this.updateKeyframes(this.keyframeDataList)}addKeyframeByRecording(t,n){const r=this._ensurePropertyExists(n);r&&this.addKeyframe(t,r.path)}deleteKeyframes(t){t.forEach(n=>{const r=this.keyframeDataList.indexOf(n);r>-1&&this.keyframeDataList.splice(r,1)}),this.updateKeyframes(this.keyframeDataList)}updateKeyframes(t,n=!0){const r={};t.length&&t.sort((e,a)=>e.frame-a.frame),t.forEach(e=>{const a=e.path;r[a]??(r[a]=[]),r[a].push(e),r[a].sort((i,s)=>i.frame-s.frame)});for(const e in r)for(let a=0,i=r[e].length;a<i;++a){const s=r[e][a];if(s.interpolationType===I.Step)continue;const o=r[e][a-1],c=r[e][a+1];s.isFirst=a===0,s.isLast=a===i-1,a>0&&(s.frame-o.frame===0?s.linearInTangent=0:s.linearInTangent=(s.value-o.value)/((s.frame-o.frame)/this.samples),s.inTangent=s.inTangentMode===x.Linear?s.linearInTangent:s.inTangent,isNaN(s.inTangent)&&(s.inTangent=-1/0)),a<i-1&&(c.frame-s.frame===0?s.linearOutTangent=0:s.linearOutTangent=(c.value-s.value)/((c.frame-s.frame)/this.samples),s.outTangent=s.outTangentMode===x.Linear?s.linearOutTangent:s.outTangent,isNaN(s.outTangent)&&(s.outTangent=-1/0))}this.keyframeDataList=t.slice(0),this.isSubAsset||(this._generateEngineKeyframes(t),n&&this.persistMainViaFacade())}addEvent(t){const n={id:Y(),time:t/this.samples,functionName:"onEvent"};this.events[n.id]=n,this.updateEvents(this.events)}deleteEvent(t){delete this.events[t.id],this.updateEvents(this.events)}updateEvents(t,n=!0){const r=this.engineObject;if(this.events={...t},r.clearEvents(),Object.values(this.events).map(e=>{const a=e.paramType==="string"?e.string:e.number;r.addEvent(e.functionName,e.time,a)}),this.data.events=Object.values(this.events).map(e=>({time:e.time,functionName:e.functionName,parameter:e.paramType==="string"?e.string:e.number})),n){const{isSubAsset:e}=this;if(e){const a=this.root.assetStore.getAsset(this.mainId);if(a){const i=a.engineObject.animations.indexOf(this._engineObject);a.updateAnimationEvents(i,this.data.events)}}this.persistMainViaFacade()}}updateSamples(t){this.samples=+t.toFixed(0)}updateRootEntity(t){if(!(!t||t.id===this.rootEntityId)){if(this.rootEntityId=t.id,this.engineObject){this._clearPropertyMappings();const n=this._init().then(async()=>{await this._generateKeyframeDataList(),await this._updateCurveBindings(),this.showEditor&&(await this.saveEditorOriginValue(),await this.sampleAnimation(this.root.animationClipStore.currentFrame))}).catch(r=>{console.warn("AnimationClipAsset:updateRootEntity rebuild failed",this.name,r)});this._initKeyframeDataPromise=n}this._listenRootEntityChanged(),this.persistMetaViaFacade()}}setTangentMode(t,n,r){t.forEach(e=>{if(n===se.In)switch(e.inTangentMode=r,r){case x.Linear:e.inTangent=e.linearInTangent;break;case x.Constant:e.inTangent=-1/0;break;case x.Free:break}else switch(e.outTangentMode=r,r){case x.Linear:e.outTangent=e.linearOutTangent;break;case x.Constant:e.outTangent=-1/0;break;case x.Free:break}}),this.persistMetaViaFacade(),this.updateKeyframes(this.keyframeDataList)}async checkPropertiesSupport(t){const{properties:n}=this;let r=!1;const e=n.map(async a=>{const i=!!a.supported,{editorReference:s}=await this._getReferenceAndActualPropertyPath(t,a);s?a.supported=!0:a.supported=!1,!i&&a.supported&&(r=!0)});await Promise.all(e),r&&(this.properties=this.properties.slice(0),await this._generateKeyframeDataList(),this.updateKeyframes(this.keyframeDataList,!1),await this.saveEditorOriginValue(),await this.sampleAnimation(this.root.animationClipStore.currentFrame))}updateSelectedEvent(t){this.selectedEventId=t}async openEditor(t){if(t&&!this.showEditor){this._initKeyframeDataPromise||(this._initKeyframeDataPromise=this._generateKeyframeDataList()),this.showEditor=t,this.root.projectStore.animationEditing=t;const n=++this._openIndex;if(await this._initKeyframeDataPromise,n!==this._openIndex)return;this.saveEditorOriginValue(),this.sampleAnimation(this.root.animationClipStore.currentFrame),rt()}!t&&this.showEditor&&(this.showEditor=t,this.root.projectStore.animationEditing=t,this.revertValue())}async sampleAnimation(t){const n=this.rootEntity;if(n){const r=n.engineObject;try{await this._parseKeyframeValuePromise,this.engineObject._sampleAnimation(r,t/this.samples),this._syncToEditor()}catch(e){console.warn(e)}}}async saveEditorOriginValue(){const{_originValueStore:t}=this,{curveBindings:n}=this.engineObject,r=n.map(async e=>{const{relativePath:a,type:i,property:s}=e,o=K.get(i),{editorReference:c,editorPropertyPath:p,propertyPos:h}=await this._getReferenceAndActualPropertyPath(this.rootEntity,{relativePath:a,componentType:o,propertyPath:s});if(!c)return;const u=p[h];if(!t.has(e)){let d=u;u==="rotationQuaternion"&&(d="rotation"),t.set(e,q(c[d]))}});await Promise.all(r)}async revertValue(){const{_originValueStore:t}=this,n=Array.from(t).map(async([r,e])=>{const{relativePath:a,type:i,property:s}=r,o=K.get(i),{editorReference:c,editorPropertyPath:p,propertyPos:h}=await this._getReferenceAndActualPropertyPath(this.rootEntity,{relativePath:a,componentType:o,propertyPath:s});if(!c)return;const u=p[h];let d=u;u==="rotationQuaternion"&&(d="rotation"),this._setEditorValue(c,d,e)});await Promise.all(n),t.clear()}async initByMain(t){const{engine:n,meta:r}=this;r.rootEntityId&&(this.rootEntityId=r.rootEntityId),this._listenRootEntityChanged();try{const e=JSON.parse(await t.text()),a=ct(e,{type:"AnimationClip",name:e.name}),i=await ie(a,n);this.bindEngineObject(i),await this._init()}catch(e){console.error(`[AnimationClipAsset] Failed to load "${this.name}"`,e)}}async initByEngineObject(t){this.bindEngineObject(t),this._name=t.name,await this._init()}async initByCreation(t,n){this.setNameByIncrease(n||"AnimationClip");const r=new oe(this.name);return this.bindEngineObject(r),this.data={name:this.name,curveBindings:r.curveBindings,events:[]},await this._init(),this.getMainData()}_clearPropertyMappings(){this.pathPropertyMap.clear(),this._propertyCurveMap={},this._propertyPathCache.clear(),this._propertyLabelMap.clear(),this._editorPathCache.clear(),this.properties.length=0,this._colorIndex=0,this._originValueStore.clear()}_sortProperties(){this.properties.sort((t,n)=>(t.level??0)-(n.level??0))}async _init(){const t=this.engineObject;this._clearPropertyMappings();const r=(await this._groupCurveBindingsByParent(t.curveBindings)).map(async a=>{if(await this._generatePropertiesFromBindingGroup(a),this.isSubAsset)return Promise.resolve();const i=a.bindings.flatMap(s=>{const{curve:o}=s;return o.keys.map(c=>this._editorValueToEngineValue(c.value,this._getValueTypeByCurve(o)).then(p=>{c.value=p}))});return Promise.all(i)});if(!this.isSubAsset){const{properties:a,pathPropertyMap:i}=this;a.forEach(s=>{s.properties.length||this._colorIndex++,i.set(s.path,s),s.properties.forEach(o=>{this._colorIndex++,i.set(o.path,o)})})}await Promise.all(r),this._sortProperties();const e={};t.events.forEach(a=>{const i=Y(),s=a.parameter?typeof a.parameter:"null";e[i]={id:i,time:a.time,functionName:a.functionName,paramType:s,string:s==="string"?a.parameter:void 0,number:s==="number"?a.parameter:void 0}}),this.data={name:t.name,curveBindings:t.curveBindings,events:[]},this.updateEvents(e,!1)}async onDoubleClick(){st.layoutStore.toggleTabVisibility("AnimationClip"),st.layoutStore.activeTab("AnimationClip"),rt()}getMainData(){const t=this.data,n={...t,curveBindings:t.curveBindings.map(r=>{const{curve:e}=r,a=ht.get(e.constructor);return{...r,type:K.get(r.type)||r.type,curveType:a,curve:{interpolation:e.interpolation,keys:e.keys.map(i=>{const s=i.value,o=s instanceof nt?this.root.assetStore.engineObjectToAssetMap.get(s).getCurrentRef():s;return{...i,value:q(o)}})}}})};return JSON.stringify(n)}async _syncToEditor(){const t=this.rootEntity,{curveBindings:n}=this.engineObject,r=n.map(async e=>{const{relativePath:a,type:i,property:s,getProperty:o}=e,c=K.get(i);if(!e.curve.keys.length)return;const p=await this._getActualPropertyPath(o??s,a,c),{editorReference:h,engineGetReference:u,editorPropertyPath:d,enginePropertyGetPath:l,propertyPos:m}=await this._getReferenceAndActualPropertyPath(t,{relativePath:a,componentType:c,propertyPath:p});if(!u||!h)return;const f=B({relativePath:a,componentType:c,propertyPath:d.slice(0,m+1).join(".")}),A=this.pathPropertyMap.get(f);let P=d[m],b=this._getEngineValue(u,l[m]),v=A.valueType;P==="rotationQuaternion"&&(P="rotation",b=b.toEuler(new at).scale(180/Math.PI),v=y.Vector3);const w=this._engineValueToEditorValue(b,v,!1);this._setEditorValue(h,P,w)});await Promise.all(r)}async _setEditorValue(t,n,r){var i,s;const e=(i=pe(t))==null?void 0:i[n],a=(s=H(t))==null?void 0:s[n];if(a!=null&&a.getEditorValue&&(r=a.getEditorValue(r)),a!=null&&a.setActualEditorValue?a==null||a.setActualEditorValue(t,n,r):t[n]=r,e!=null&&e.onChange){const o=r!=null&&r.refId?await t.root.assetStore.getAssetByRef(r):r;await e.onChange(t,n,o)}}_removeCurveBindings(t){const n=this.engineObject;if(!n)return;const r=new Set;for(const e of t){const a=this._propertyCurveMap[e];a&&(r.add(a),delete this._propertyCurveMap[e])}if(r.size>0){const e=n.curveBindings;for(let a=e.length-1;a>=0;a--){const i=e[a];r.has(i.curve)&&(e.splice(a,1),this._originValueStore.delete(i))}}}async _updateCurveBindings(){var n;const t=this.rootEntity;if(t)for(const r of this.properties)try{const{relativePath:e,componentType:a,valueType:i,properties:s,interpolationType:o}=r,c=B(r),p=await this._getReferenceAndActualPropertyPath(t,r),{editorReference:h,enginePropertySetPath:u,enginePropertyGetPath:d,editorPropertyPath:l,propertyPos:m}=p||{};if(!h||!u||!d||m===void 0)continue;const f=l[m],A=(n=H(h))==null?void 0:n[f],P=u.join("."),b=d.join(".");if(s.length)for(const v of s){const w=B(v),S=this._createCurve(w,v.valueType,v.interpolationType),M=v.name;await this._addCurveBinding(e,a,`${P}.${M}`,`${b}.${M}`,S),this._propertyCurveMap[w]=S}else{let v=i;A!=null&&A.valueType&&(v=A.valueType);const w=this._createCurve(c,v,o);await this._addCurveBinding(e,a,P,b,w),this._propertyCurveMap[c]=w}}catch(e){console.warn("updateCurveBindings skipped property (unresolved):",r==null?void 0:r.propertyPath,e);continue}}_createCurve(t,n,r){let e=this._propertyCurveMap[t];if(!e){const a=Z.get(n);a?(e=new a.curveClass,e.interpolation=r??a.defaultInterpolation):console.warn(`Unsupported curve value type: ${n}`)}return e}async _addCurveBinding(t,n,r,e,a){const i=ce.getClass(n),s=this.engineObject;let o=!0;for(let c=0,p=s.curveBindings.length;c<p;++c){const h=s.curveBindings[c];h.relativePath===t&&h.type===i&&h.property===r&&h.getProperty===e&&(h.curve=a,o=!1)}o&&(s.addCurveBinding(t,i,r,e,a),await this.saveEditorOriginValue())}_addPropertyToList(t,n,r,e=!0){var o;const a=this._covertToPropertyData(n,r),i=t.push(a),s=t[i-1];return this.pathPropertyMap.set(s.path,s),e&&((o=n.children)!=null&&o.length)&&n.children.forEach(c=>{this._addPropertyToList(s.properties,c,s,e)}),s}_delPropertyFromList(t,n){const r=t.findIndex(e=>e.path===n.path);r>-1&&(t.splice(r,1),this.pathPropertyMap.delete(n.path))}_covertToPropertyData(t,n){const{name:r,label:e,relativePath:a,componentType:i,propertyPath:s,type:o,valueType:c,interpolationType:p,children:h}=t,u=B(t),d=B(n),l=a.split("/").length-1;return{name:e||r,level:l,path:u,type:o,valueType:c,interpolationType:p,propertyPath:s,componentType:i,relativePath:a,hasSubProperty:h.length>0,curveColor:c===y.Float?this._getRandomColor():null,supported:!0,properties:[],parentPath:d}}async _getReferenceAndActualPropertyPath(t,n){if(!t)return{};const{relativePath:r,componentType:e,propertyPath:a}=n,i=t.findByPath(r);if(!i)return{};const s=i.getComponentByTypeName(e);if(!s)return{};const o=[],c=[],p=[],h=a.split("."),u=h.length-1;let d=-1,l=s;for(let P=0,b=u;P<=b;++P){const v=h[P];if(!l)return{};const w=H(l);let S="",M=v,k=v,z=v,R=P;for(let F=P,J=u;F<=J;++F){S+=h[F];const Q=(w==null?void 0:w[S])||{},{getPath:U,setPath:D,editorKey:tt}=Q;D&&(k=D,R=F),(U||D)&&(F===u&&D?k=D:k=U??D,z=U??D,R=F),tt&&(M=tt,R=F),F<u&&(S+=".")}P=R,c.push(k),p.push(z),o.push(M),le(l,M)&&(d=o.length-1),P<u&&(l=l[M],l!=null&&l.refId&&(l=await this.root.assetStore.getAssetByRef(l)))}const m=d>-1?d-1:o.length-1;l=s;for(let P=0,b=m;P<b;++P)l=l[o[P]],l!=null&&l.refId&&(l=await this.root.assetStore.getAssetByRef(l));const f=this._getEngineValue(s.engineObject,c.slice(0,m).join(".")),A=this._getEngineValue(s.engineObject,p.slice(0,m).join("."));return{editorReference:l,engineSetReference:f,engineGetReference:A,enginePropertySetPath:c,enginePropertyGetPath:p,editorPropertyPath:o,propertyPos:m,subPropertyPos:d}}_getEngineValue(t,n){if(!n)return t;let r=t;const e=n.split(".");for(let a=0,i=e.length;a<i;a++){const s=e[a];if(s.indexOf("[")>-1){const o=s.indexOf("[");r=r[s.slice(0,o)],r=r[parseInt(s.slice(o+1,-1))]}else if(s.endsWith(")")){const o=s.slice(0,s.indexOf("(")),c=s.match(/\w+\(([^)]*)\)/)[1].split(",").map(p=>p.trim().replace(/['"]+/g,"")).filter(p=>p!=="");r=r[o](...c)}else r=r[s]}return r}async _generateKeyframeDataList(){const t=this.engineObject,n=[],r=this.pathPropertyMap,e=t.curveBindings.map(async a=>{const{relativePath:i,type:s,getProperty:o,property:c,curve:p}=a,h=K.get(s),u=o??c,d=await this._convertPropertyProxyPath(u,h,i),m=B({relativePath:i,componentType:h,propertyPath:d||u});d||console.warn(`无法转换引擎路径到编辑器路径: ${u},使用原路径`);const f=r.get(m);if(!f){d&&console.warn(`转换后的路径仍未找到属性定义: ${m}, 原引擎路径: ${u}`);return}this._propertyCurveMap[m]=p;const A=f.valueType;p.keys.forEach(P=>{const{time:b,value:v,inTangent:w,outTangent:S}=P,M=Math.floor(b*this.samples),k=this._engineValueToEditorValue(v,A,!0),z=this._getSubProperties(A,p);if(z)z.forEach(R=>{const F=`${m}.${R}`,J=r.get(F),Q=w&&w[R],U=S&&S[R],D=this._createKeyframeData(M,k[R],y.Float,Q,U,J,f);n.push(D)});else{const R=r.get(f.parentPath),F=this._createKeyframeData(M,k,A,w,S,f,R);n.push(F)}})});await Promise.all(e),this.updateKeyframes(n,!1)}_createKeyframeData(t,n,r,e,a,i,s){const{path:o,curveColor:c}=i,{path:p=""}=s||{};return{id:Y(),frame:t,path:o,value:n,isActive:!0,valueType:r??y.Float,curveColor:c,parentPath:p,inTangent:e,outTangent:a,interpolationType:i.interpolationType,inTangentMode:e===void 0?x.Linear:e===-1/0?x.Constant:x.Free,outTangentMode:a===void 0?x.Linear:a===-1/0?x.Constant:x.Free}}_generateEngineKeyframes(t){const{_propertyCurveMap:n,samples:r,engineObject:e}=this,a=this._groupKeyframesByPath(t),s=this._collectPathsToSync(n,a).map(o=>this._syncCurveForPath(o,n[o],a.get(o)||[],r,e));this._parseKeyframeValuePromise=Promise.all(s)}_groupKeyframesByPath(t){return t.reduce((n,r)=>{const e=n.get(r.path)||[];return e.push(r),n.set(r.path,e),n},new Map)}_collectPathsToSync(t,n){const r=new Set;return Object.keys(t).forEach(e=>r.add(e)),n.forEach((e,a)=>r.add(a)),Array.from(r)}async _syncCurveForPath(t,n,r,e,a){if(!n)return;const i=await this._convertToEngineKeyframes(r,e);this._removeObsoleteKeyframes(n,i),this._addOrUpdateKeyframes(n,i,a)}async _convertToEngineKeyframes(t,n){const r=new Map;for(const e of t){const a=e.frame/n,i=await this._editorValueToEngineValue(e.value,e.valueType);i===void 0&&e.valueType===y.ReferResource||r.set(a,{value:i,inTangent:e.inTangent,outTangent:e.outTangent})}return r}_removeObsoleteKeyframes(t,n){const r=new Set(n.keys());for(let e=t.keys.length-1;e>=0;e--){const a=t.keys[e];r.has(a.time)||t.keys.splice(e,1)}}_addOrUpdateKeyframes(t,n,r){const e=new Map;t.keys.forEach(a=>{e.set(a.time,a)});for(const[a,{value:i,inTangent:s,outTangent:o}]of n){const c=e.get(a);if(c)c.value=i,c.inTangent=s,c.outTangent=o;else{const p=new Ce;p.time=a,p.value=i,p.inTangent=s,p.outTangent=o,t.addKey(p)}a>r._length&&(r._length=a)}}async _editorValueToEngineValue(t,n){var r;switch(n){case y.ReferResource:return t!=null&&t.refId?(r=await this.root.assetStore.getAssetByRef(t))==null?void 0:r.engineObject:t;case y.Color:return new me(t.r,t.g,t.b,t.a);case y.Vector2:return new de(t.x,t.y);case y.Vector3:return new at(t.x,t.y,t.z);case y.Vector4:return new ye(t.x,t.y,t.z,t.w);case y.Quaternion:return new ue(t.x,t.y,t.z,t.w);case y.Rect:return new he(t.x,t.y,t.width,t.height);case y.Float:return t;default:return t}}_engineValueToEditorValue(t,n,r){var a,i,s;let e;switch(n){case y.MethodParam:{if(e=[],r)for(let o=0,c=t.length;o<c;o++){const p=t[o];e[o]??(e[o]=[]);for(let h=0,u=p.length;h<u;h++){const d=p[h];e[o][h]=((a=this.root.assetStore.engineObjectToAssetMap.get(d))==null?void 0:a.getCurrentRef())??d}}else t&&t instanceof nt?e=[[((i=this.root.assetStore.engineObjectToAssetMap.get(t))==null?void 0:i.getCurrentRef())??t]]:t instanceof Array?e=t:e=[[t]];break}case y.ReferResource:{e=(s=this.root.assetStore.engineObjectToAssetMap.get(t))==null?void 0:s.getCurrentRef();break}case y.Color:{e={r:t.r,g:t.g,b:t.b,a:t.a},["r","g","b","a"].forEach(o=>{e[o]=Math.round(e[o]*1e3)/1e3});break}case y.Vector2:{e={x:t.x,y:t.y},["x","y"].forEach(o=>{e[o]=Math.round(e[o]*1e3)/1e3});break}case y.Vector3:{e={x:t.x,y:t.y,z:t.z},["x","y","z"].forEach(o=>{e[o]=Math.round(e[o]*1e3)/1e3});break}case y.Vector4:case y.Quaternion:{e={x:t.x,y:t.y,z:t.z,w:t.w},["x","y","z","w"].forEach(o=>{e[o]=Math.round(e[o]*1e3)/1e3});break}case y.Rect:{e={x:t.x,y:t.y,width:t.width,height:t.height},["x","y","width","height"].forEach(o=>{e[o]=Math.round(e[o]*1e3)/1e3});break}case y.Float:{e=Math.round(t*1e3)/1e3;break}default:e=t}return e}_getValueTypeByCurve(t){return lt.get(t.constructor)}_parsePropertyPath(t){const n=this._propertyPathCache.get(t);if(n)return n;const r=t.lastIndexOf("."),e=r===-1?{parentPath:t,subProperty:null}:{parentPath:t.substring(0,r),subProperty:t.substring(r+1)};return this._propertyPathCache.set(t,e),e}_isSubPropertyName(t){return/^([xyzw]|[rgba]|width|height)$/.test(t)}async _convertPropertyProxyPath(t,n,r){try{const e=this._resolveProxyHost(n,r,t);if(!e)return null;const a=`${r}|${n}|${t}`;if(this._editorPathCache.has(a))return this._editorPathCache.get(a);const i=await this._recursiveConvert(t,e,0);return i&&i!==t&&await this._buildLabelMappingsForPath(i,r,n,e),this._editorPathCache.set(a,i??null),i}catch{const a=`${r}|${n}|${t}`;return this._editorPathCache.set(a,null),null}}async _buildLabelMappingsForPath(t,n,r,e){try{const a=await this._getReferenceAndActualPropertyPath(this.rootEntity,{relativePath:n,componentType:r,propertyPath:t}),i=(a==null?void 0:a.editorPropertyPath)||t.split("."),s=typeof(a==null?void 0:a.propertyPos)=="number"?a.propertyPos:i.length-1;for(let o=0;o<=s;o++){const c=i.slice(0,o+1).join("."),p=B({relativePath:n,componentType:r,propertyPath:c});if(!this._propertyLabelMap.has(p)){const h=await this._extractLabelForPartialPath(c,e);h&&this._propertyLabelMap.set(p,h)}}}catch(a){console.warn("建立标签映射失败:",a)}}async _extractLabelForPartialPath(t,n){try{const r=t.split("."),e=r[r.length-1];let a=n,i=null;for(let s=0;s<r.length;s++){const o=r[s],c=a==null?void 0:a[G];if(c&&c[o]){const p=c[o];p.label&&(i=p.label),s<r.length-1&&(a=await this._getNextObject(a,o))}else break}return i||e}catch{return t.split(".").pop()||t}}async _recursiveConvert(t,n,r){if(r>6)return t;const e=n[G];if(!e)return t;for(const[a,i]of Object.entries(e)){if(!this._isPathMatch(t,i))continue;const s=i.getPath||i.setPath;if(s){if(s.endsWith("()")&&t.startsWith(s+".")){const o=t.substring(s.length+1),c=await this._getNextObject(n,a);if(!c)return`${a}.${o}`;const p=await this._recursiveConvert(o,c,r+1);return p?`${a}.${p}`:`${a}.${o}`}return this._buildEditorPath(a,t,i)}}return t}async _getNextObject(t,n){var r;try{let e=t[n];if(!e){const a=`get${n.charAt(0).toUpperCase()+n.slice(1)}`;typeof t[a]=="function"&&(e=t[a]())}if(e!=null&&e.refId&&((r=this.root)!=null&&r.assetStore)){let a=this.root.assetStore.engineObjectToAssetMap.get(e);if(!a)try{a=await this.root.assetStore.getAssetByRef(e)}catch{return e}if(a)return a}return e}catch{return null}}_resolveProxyHost(t,n,r){try{if(!this.rootEntity)return null;const e=n?this.rootEntity.findByPath(n):this.rootEntity;if(!e)return null;const a=e.getComponentByTypeName(t);return a?r?this._resolvePropertyProxyHolder(a,r):a:null}catch(e){return console.warn(`获取代理宿主失败: ${t}, ${n}`,r,e),null}}_resolvePropertyProxyHolder(t,n){try{const r=[t];this._addRelatedObjectCandidates(t,r);for(const e of r)if(this._hasMatchingProxyConfig(e,n))return e;return t}catch(r){return console.warn(`解析 PropertyProxy 持有者失败: ${n}`,r),t}}_addRelatedObjectCandidates(t,n){try{const r=t[G];if(!r)return;const e=new Set;for(const a of Object.values(r)){const i=this._extractObjectPathFromConfig(a);i&&e.add(i)}for(const a of e){const i=this._getEngineValue(t.engineObject,a);if(i){const s=this.root.assetStore.engineObjectToAssetMap.get(i);s&&!n.includes(s)&&n.push(s)}}}catch{}}_extractObjectPathFromConfig(t){const n=t.getPath||t.setPath;if(!n)return null;const r=n.match(/^([^.]+\([^)]*\))/);return r?r[1]:null}_hasMatchingProxyConfig(t,n){const r=t[G];if(!r)return!1;for(const e of Object.values(r))if(this._isPathMatch(n,e))return!0;return!1}_isPathMatch(t,n){return n?n.getPath&&this._isExactPathMatch(t,n.getPath)||n.setPath&&this._isExactPathMatch(t,n.setPath)||n.engineKey&&t.includes(n.engineKey):!1}_isExactPathMatch(t,n){if(!n)return!1;const r=p=>p.replace(/['"`\s]/g,""),e=p=>{let h="";for(let u=0;u<p.length;u++){const d=p[u];if(d==="("){for(;u<p.length&&p[u]!==")";)u++;h+="()"}else h+=d}return h},a=p=>e(r(p).replace(/\$value/g,"value")),i=a(t),s=a(n);if(i===s||((p,h)=>p.startsWith(h+".")||p.startsWith(h+"["))(i,s))return!0;if(!n.includes(".")&&!n.includes("(")&&!n.includes("[")){const p=i.split(".");for(const h of p){const u=h.indexOf("[");if((u>=0?h.slice(0,u):h)===s)return!0}}return!1}_buildEditorPath(t,n,r){if(!r)return t;const e=r.getPath||r.setPath;if(!e)return t;if(e.endsWith("()")&&n.startsWith(e+".")){const s=n.substring(e.length+1);return`${t}.${s}`}const a=n.replace(/['"`]/g,"").replace(/\$value/g,"value"),i=e.replace(/['"`]/g,"").replace(/\$value/g,"value");if(a.includes(i))return a.replace(i,t);if(!e.includes(".")&&!e.includes("(")){const s=n.match(/\.([a-zA-Z_]\w*)$/);if(s){const o=s[1];if(o!==e)return`${t}.${o}`}}return t}_validateCurveBinding(t){const{relativePath:n,type:r,getProperty:e,property:a}=t;return K.get(r)?e??a?!0:(console.warn(`绑定缺少属性路径: ${n}`),!1):(console.warn(`未知组件类型: ${r},跳过绑定`),!1)}async _groupCurveBindingsByParent(t){const n=new Map;return await Promise.all(t.map(async r=>{if(!this._validateCurveBinding(r))return;const{relativePath:e,type:a,getProperty:i,property:s}=r,o=K.get(a),c=i??s,h=await this._convertPropertyProxyPath(c,o,e)||c,u=this._parsePropertyPath(h),d=u.subProperty&&this._isSubPropertyName(u.subProperty);let l,m;d&&u.subProperty?(m=u.parentPath,l=`${e}.${o}.${m}`):(m=h,l=`${e}.${o}.${h}`),n.has(l)||n.set(l,{parentPath:m,relativePath:e,componentType:o,bindings:[]}),n.get(l).bindings.push(r)})),Array.from(n.values())}_validateAndGetParentValueType(t){if(t.length===1){const l=t[0],m=l.getProperty??l.property,{subProperty:f}=this._parsePropertyPath(m);return!f||!this._isSubPropertyName(f)?null:y.Float}if(!t.every(l=>this._getValueTypeByCurve(l.curve)===y.Float)){const l=t.map(m=>this._getValueTypeByCurve(m.curve));return console.warn(`分组中的绑定类型不一致: ${l.join(", ")},无法创建父属性`),null}const r=t.map(l=>l.curve.interpolation),e=r[0];r.every(l=>l===e)||console.warn(`子属性插值类型不一致: ${r.join(", ")}`);const i=t.map(l=>{const m=l.getProperty??l.property,f=m.lastIndexOf(".");return f===-1?null:m.substring(f+1)}).filter(Boolean).sort(),s=i.join(",");switch(s){case"x,y":return y.Vector2;case"x,y,z":return y.Vector3;case"w,x,y,z":return y.Vector4;case"a,b,g,r":return y.Color;case"height,width,x,y":return y.Rect}const o=new Set(["x","y","z","w"]),c=new Set(["r","g","b","a"]),p=new Set(["x","y","width","height"]),h=i.every(l=>o.has(l)),u=i.every(l=>c.has(l)),d=i.every(l=>p.has(l));return h?i.some(l=>l==="w")?y.Vector4:i.some(l=>l==="z")?y.Vector3:y.Vector2:u?y.Color:d?y.Rect:(console.warn(`无法识别的子属性组合: ${s}`),null)}_validateBindingGroup(t){const{bindings:n}=t;return n.every(r=>this._validateCurveBinding(r))&&this._validateAndGetParentValueType(n)!==null}_createParentProperty(t,n){const{parentPath:r,relativePath:e,componentType:a}=t,i=B({relativePath:e,componentType:a,propertyPath:r}),s=I.Linear,o=this._propertyLabelMap.get(i),c=r.split(".").pop()||r;return{name:o||c,level:e.split("/").length-1,path:i,type:O.Property,valueType:n,interpolationType:s,componentType:a,relativePath:e,hasSubProperty:!0,curveColor:null,supported:!0,properties:[],propertyPath:r}}async _createSubPropertiesFromBindings(t,n,r,e){return Promise.all(t.map(async a=>{const{getProperty:i,property:s,curve:o}=a,c=i??s,p=await this._convertPropertyProxyPath(c,e,r)||c,h=p.lastIndexOf("."),u=h===-1?p:p.substring(h+1),d=`${n}.${u}`,l={name:u,level:r.split("/").length,path:d,type:O.SubProperty,valueType:y.Float,interpolationType:o.interpolation,componentType:e,relativePath:r,hasSubProperty:!1,curveColor:this._getRandomColor(),supported:!0,properties:[],propertyPath:p,parentPath:n};return this.pathPropertyMap.set(d,l),l}))}_registerPropertyGroup(t,n){t.properties=n,this.pathPropertyMap.has(t.path)&&console.warn(`覆盖已存在的属性路径: ${t.path}`),this.pathPropertyMap.set(t.path,t),this.properties.push(t)}async _generatePropertiesFromBindingGroup(t){const{parentPath:n,relativePath:r,componentType:e,bindings:a}=t;if(!this.rootEntity){await Promise.all(a.map(p=>this._generatePropertyByEngineObject(p)));return}const i=await this._convertPropertyProxyPath(n,e,r)||n;if(!this._validateBindingGroup(t)){this.rootEntity&&a.length>1&&console.debug("AnimationClipAsset: grouping skipped",this.name,e,r,n),await Promise.all(a.map(p=>this._generatePropertyByEngineObject(p)));return}const s=this._validateAndGetParentValueType(a);if(s===null){console.error("验证通过但获取不到父属性类型"),await Promise.all(a.map(p=>this._generatePropertyByEngineObject(p)));return}const o=this._createParentProperty({...t,parentPath:i},s),c=await this._createSubPropertiesFromBindings(a,o.path,r,e);this._registerPropertyGroup(o,c)}async _generatePropertyByEngineObject(t){const{pathPropertyMap:n}=this,{relativePath:r,type:e,curve:a,getProperty:i,property:s}=t,o=K.get(e),c=i??s,p=await this._convertPropertyProxyPath(c,o,r)??c,h=this._getValueTypeByCurve(a),u=B({relativePath:r,componentType:o,propertyPath:p}),d=this._propertyLabelMap.get(u),l=p.lastIndexOf("."),m=l===-1?p:p.substring(l+1),f={name:d||m,level:r.split("/").length-1,path:u,type:O.Property,valueType:h,interpolationType:a.interpolation,componentType:o,relativePath:r,hasSubProperty:!1,curveColor:this._getRandomColor(),supported:!0,properties:[],propertyPath:p},A=this._getSubProperties(h,a);A&&(f.curveColor=null,f.hasSubProperty=!0,f.properties=A.map(P=>{const b=`${u}.${P}`,v={name:P,level:r.split("/").length,path:b,type:O.SubProperty,valueType:y.Float,interpolationType:a.interpolation,componentType:o,relativePath:r,hasSubProperty:!1,curveColor:this._getRandomColor(),supported:!0,properties:[],propertyPath:`${p}.${P}`};return n.set(b,v),v})),n.set(u,f),this.properties.push(f)}async _getActualPropertyPath(t,n,r){if(!this.isSubAsset){const{editorPropertyPath:e=[]}=await this._getReferenceAndActualPropertyPath(this.rootEntity,{relativePath:n,componentType:r,propertyPath:t});t=e.join(".")}return t}_getRandomColor(){const{_colorList:t}=this,n=(e,a)=>{const i=parseInt(e.slice(1),16),s=parseInt(a.slice(1),16);return`#${parseInt(`${(i+s)/2}`).toString(16).toUpperCase()}`},r=()=>{const e=[];for(let i=0,s=t.length-1;i<s;i++){const o=n(t[i],t[i+1]);e.push(o)}const a=t.slice(0,t.length-1);for(let i=0,s=a.length+e.length;i<s;i++)t[i]=i%2===0?a[i/2]:e[(i-1)/2]};for(;this._colorIndex>=t.length;)r();return t[this._colorIndex++]}_getSubProperties(t,n){let r;switch(t){case y.Vector2:{r=["x","y"];break}case y.Vector3:{r=["x","y","z"];break}case y.Vector4:{r=["x","y","z","w"];break}case y.Quaternion:{r=["x","y","z","w"];break}case y.Color:{r=["r","g","b","a"];break}case y.Array:case y.FloatArray:n.keys[0]&&(r=Array.from(n.keys[0].value).map((e,a)=>a))}return r}_listenRootEntityChanged(){var n;const t=this.rootEntity;t&&(this.showEditor&&(this.openEditor(!1),this.openEditor(!0)),(n=this._componentsChangedListenerDisposer)==null||n.call(this),this._componentsChangedListenerDisposer=fe(()=>t.components.length,()=>{this.checkPropertiesSupport(t),this.engineObject.curveBindings.forEach(r=>{r._tempCurveOwner={}})}))}_convertPropertyToTreeItem(t){var m;const{name:n,label:r,properties:e=[],relativePath:a,componentType:i,path:s,type:o,curveColor:c,supported:p,level:h}=t,u=((m=this.rootEntity.findByPath(a))==null?void 0:m.name)||a.split("/").pop(),d=r||n;return{name:o===O.Property?`${u}:${i}.${d}`:d,id:s,canAddKeyframe:o===O.Property||o===O.SubProperty,curveColor:c,supported:p,level:h,children:e.map(f=>this._convertPropertyToTreeItem(f))}}_ensurePropertyExists(t){const n=B(t);let r=this.pathPropertyMap.get(n);return r||(r=this.addProperty(t)),t.children&&t.children.length&&t.children.forEach(e=>{this._ensurePropertyExists(e)}),r}destroy(){var t;super.destroy(),(t=this._componentsChangedListenerDisposer)==null||t.call(this),this._propertyPathCache.clear(),this.pathPropertyMap.clear(),this._propertyCurveMap={},this._propertyLabelMap.clear(),this._editorPathCache.clear(),this._originValueStore.clear()}};T([L],C.prototype,"samples",2);T([L],C.prototype,"properties",2);T([L],C.prototype,"keyframeDataList",2);T([L],C.prototype,"events",2);T([ge()],C.prototype,"data",2);T([L],C.prototype,"selectedEventId",2);T([L,Pe()],C.prototype,"rootEntityId",2);T([L],C.prototype,"readOnly",2);T([_e],C.prototype,"addedPropertiesTreeData",1);T([E],C.prototype,"addProperty",1);T([E],C.prototype,"delProperty",1);T([E],C.prototype,"addKeyframe",1);T([E],C.prototype,"deleteKeyframes",1);T([E],C.prototype,"updateKeyframes",1);T([E],C.prototype,"addEvent",1);T([E],C.prototype,"deleteEvent",1);T([E],C.prototype,"updateEvents",1);T([E],C.prototype,"updateSamples",1);T([E],C.prototype,"updateRootEntity",1);T([E],C.prototype,"setTangentMode",1);T([E],C.prototype,"checkPropertiesSupport",1);T([E],C.prototype,"updateSelectedEvent",1);T([E],C.prototype,"openEditor",1);C=T([ve({type:"AnimationClip",label:j("asset.animation-clip.title"),icon:"animate-clip",extname:"anim",importMenuConfig:{type:be.Add},customInspector:Se,viewer:$,async bundle({content:_},t,n){var a;const r=JSON.parse(await _.text());for(const i of r.curveBindings)if(i.curveType==="AnimationRefCurve"){for(const s of i.curve.keys)if((a=s.value)!=null&&a.refId){const o=n.resolveRef(s.value.refId);o&&(s.value=o)}}const e=ct(r,{type:"AnimationClip",name:r.name});return{content:new Blob([e])}}})],C);export{C as A,Se as a,$ as b};
|
|
1
|
+
var ut=Object.defineProperty;var yt=(_,t,n)=>t in _?ut(_,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):_[t]=n;var g=(_,t,n)=>(yt(_,typeof t!="symbol"?t+"":t,n),n);import{aJ as X,av as V,bk as dt,e as j,cl as et,cm as mt,aN as ft,aH as gt,aI as Pt,u as it,S as ot,bS as _t,x as L,aC as E,bo as vt,br as bt,cn as Ct,co as Tt,y as wt,cp as Et,bE as At,cq as St,cr as xt,cs as Mt,N as Vt,O as It,ct as Ot,cu as jt,cv as Ft,cw as Rt,cx as Bt,cy as Lt,cz as Dt,cA as $t,cB as Kt,cC as Nt,cD as kt,cE as zt,cF as Ut,cG as Ht,aE as y,cH as Gt,bL as I,cI as Jt,cJ as Qt,cK as Wt,cL as qt,cM as Yt,cN as Xt,cO as Zt,cP as te,cQ as ee,cR as re,cS as ne,j as ae,cT as O,bX as W,cU as H,c5 as q,cV as x,bV as Y,cW as se,cX as rt,ap as ie,cY as oe,ac as nt,cZ as B,ai as at,c_ as pe,H as ce,c$ as le,at as he,au as ue,V as ye,F as de,b3 as me,d0 as G,bF as fe,m as ge,aT as Pe,c2 as _e,n as ve,o as be,d1 as Ce}from"./index-c3dec278.js";import{a as pt,r as st}from"./index-cdbb2f4d.js";import"./postmen-2853c0e6.js";import{A as Te}from"./AssetViewer-3847c058.js";import{e as ct}from"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import{L as we}from"./module-ec094ef6.js";import{a as Ee}from"./module-ada3dced.js";const Ae=X(()=>{const _=pt("animationClipStore"),{selectedEvent:t}=_,{paramType:n}=t;return V.jsxs("div",{children:[V.jsx(dt,{label:j("animation.clip.param-type.title"),options:[{value:"string",label:String(j("animation.clip.param-type.string"))},{value:"number",label:String(j("animation.clip.param-type.number"))},{value:"null",label:String(j("animation.clip.param-type.null"))}],value:n||"null",onChange:r=>{t.paramType=r,_.updateEvents([t])}}),V.jsx(et,{label:j("animation.clip.function-name"),value:t.functionName,onChange:r=>{t.functionName=r,_.updateEvents([t])}}),n==="number"&&V.jsx(mt,{label:j("animation.clip.number"),value:t.number,onChange:r=>{t.number=r,_.updateEvents([t])}}),n==="string"&&V.jsx(et,{label:j("animation.clip.string"),value:t.string,onChange:r=>{t.string=r,_.updateEvents([t])}})]})}),Se=X(function(){const t=pt("animationClipStore"),{selectedEvent:n}=t;return n?V.jsx(ft,{title:j("animation.clip.event"),defaultOpen:!0,children:V.jsx(V.Fragment,{children:V.jsx(Ae,{})})}):null});var xe=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,N=(_,t,n,r)=>{for(var e=r>1?void 0:r?Me(t,n):t,a=_.length-1,i;a>=0;a--)(i=_[a])&&(e=(r?i(t,n,e):i(e))||e);return r&&e&&xe(t,n,e),e};const Ve=gt(Pt,{position:"absolute",top:0,left:0,margin:"auto",width:"100%",height:228,alignItems:"center",justifyContent:"center"});class $ extends Te{constructor(){super();g(this,"frameTime",0);g(this,"duration",0);g(this,"playing",!1);g(this,"_clip");g(this,"_updateComponent");g(this,"animationNames");g(this,"overridePreviewer",X(({asset:n,viewer:r})=>V.jsx(V.Fragment,{children:n.isSubAsset||n.root.sceneUIStore.lastSelectedId?V.jsx(_t,{asset:n,viewer:r}):V.jsx(Ve,{children:V.jsx(V.Fragment,{children:j("animation.clip.select-entity-preview")})})})));it(this)}selectAnimation(n){}async setViewAsset(n,r){var i,s;let e;if(n.isSubAsset){const o=await n.root.assetStore.getAssetByRef({refId:n.mainId}),{defaultSceneRoot:c}=o.engineObject;e=((i=n.root.sceneStore.lastSelectedEntity)==null?void 0:i.engineObject)||c}else e=(s=n.root.sceneStore.lastSelectedEntity)==null?void 0:s.engineObject;if(!e)return;this._clip=n.engineObject,this.animationNames=[n.name],this._entity=e.clone(),r.addChild(this._entity);const a=this;this._updateComponent=this._entity.addComponent(class extends ot{onUpdate(o){a._onUpdate(100/3)}}),this.frameTime=0,this.duration=this._clip.length}stopViewAsset(){var n;super.stopViewAsset(),this.frameTime=0,this.pauseAnimation(),(n=this._updateComponent)==null||n.destroy()}setFrameTime(n){this.frameTime=n,this._sampleAnimation()}playAnimation(){this._clip&&(this.playing=!0)}pauseAnimation(){this.playing=!1}_onUpdate(n){!this.playing||!this._clip||!this.duration||(this.frameTime+=n/1e3,this.frameTime>this.duration&&(this.frameTime%=this.duration),this._sampleAnimation())}_sampleAnimation(){try{this._clip._sampleAnimation(this._entity,this.frameTime)}catch(n){console.warn(n)}}}N([L],$.prototype,"frameTime",2);N([L],$.prototype,"duration",2);N([L],$.prototype,"playing",2);N([E],$.prototype,"setViewAsset",1);N([E],$.prototype,"setFrameTime",1);N([E],$.prototype,"playAnimation",1);N([E],$.prototype,"pauseAnimation",1);N([E],$.prototype,"_onUpdate",1);const K=new Map([[vt,"Transform"],[bt,"Animator"],[Ct,"DirectLight"],[Tt,"Camera"],[wt,"MeshRenderer"],[Et,"SkinnedMeshRenderer"],[At,"ParticleRenderer"],[St,"PointLight"],[xt,"SpotLight"],[ot,"Script"],[Mt,"SpriteMask"],[Vt,"SpriteRenderer"],[It,"TextRenderer"],[Ot,"UITransform"],[jt,"UICanvas"],[Ft,"UIGroup"],[Rt,"Button"],[Bt,"Image"],[Lt,"Text"],[Dt,"DynamicCollider"],[$t,"StaticCollider"],[Kt,"CharacterController"],[Nt,"SpringJoint"],[kt,"FixedJoint"],[zt,"HingeJoint"],[Ut,"AudioSource"],[Ht,"PostProcess"],[Ee,"SpineAnimationRenderer"],[we,"LottieAnimation"]]);var Ie=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,T=(_,t,n,r)=>{for(var e=r>1?void 0:r?Oe(t,n):t,a=_.length-1,i;a>=0;a--)(i=_[a])&&(e=(r?i(t,n,e):i(e))||e);return r&&e&&Ie(t,n,e),e};const Z=new Map([[y.Float,{curveClass:Gt,name:"AnimationFloatCurve",defaultInterpolation:I.Hermite}],[y.FloatArray,{curveClass:Jt,name:"AnimationFloatArrayCurve",defaultInterpolation:I.Hermite}],[y.Vector2,{curveClass:Qt,name:"AnimationVector2Curve",defaultInterpolation:I.Hermite}],[y.Vector3,{curveClass:Wt,name:"AnimationVector3Curve",defaultInterpolation:I.Hermite}],[y.Vector4,{curveClass:qt,name:"AnimationVector4Curve",defaultInterpolation:I.Hermite}],[y.Quaternion,{curveClass:Yt,name:"AnimationQuaternionCurve",defaultInterpolation:I.Hermite}],[y.Color,{curveClass:Xt,name:"AnimationColorCurve",defaultInterpolation:I.Hermite}],[y.ReferResource,{curveClass:Zt,name:"AnimationRefCurve",defaultInterpolation:I.Step}],[y.Rect,{curveClass:te,name:"AnimationRectCurve",defaultInterpolation:I.Step}],[y.Boolean,{curveClass:ee,name:"AnimationBoolCurve",defaultInterpolation:I.Step}],[y.String,{curveClass:re,name:"AnimationStringCurve",defaultInterpolation:I.Step}],[y.Array,{curveClass:ne,name:"AnimationArrayCurve",defaultInterpolation:I.Hermite}]]),lt=new Map;Z.forEach((_,t)=>{lt.set(_.curveClass,t)});const ht=new Map;Z.forEach(_=>{ht.set(_.curveClass,_.name)});let C=class extends ae{constructor(t){super(t);g(this,"samples",60);g(this,"properties",[]);g(this,"pathPropertyMap",new Map);g(this,"keyframeDataList",[]);g(this,"events",{});g(this,"data");g(this,"selectedEventId");g(this,"rootEntityId");g(this,"showEditor");g(this,"readOnly",!1);g(this,"_propertyCurveMap",{});g(this,"_originValueStore",new Map);g(this,"_initKeyframeDataPromise");g(this,"_parseKeyframeValuePromise");g(this,"_colorList",["#3477FA","#67FEBB","#C201BF","#F6ED17","#FE6C02","#FD86C2","#A2B44B","#68D8F0","#008225","#A56A02"]);g(this,"_colorIndex",0);g(this,"_openIndex",0);g(this,"_componentsChangedListenerDisposer");g(this,"_propertyPathCache",new Map);g(this,"_propertyLabelMap",new Map);g(this,"_editorPathCache",new Map);it(this),this.onDoubleClick=this.onDoubleClick.bind(this)}get rootEntity(){return this.root.sceneStore.getEntityModel(this.rootEntityId)}get addedPropertiesTreeData(){return this.properties.map(t=>this._convertPropertyToTreeItem(t))}persistMainViaFacade(){this.root.assetFacade.persistAssetMain(this.id)}persistMetaViaFacade(){this.root.assetFacade.persistAssetMeta(this.id)}addProperty(t){const{type:n,parentProperty:r}=t,e=B(t),a=this.pathPropertyMap.get(e),i=this.properties;let s;if(a)W.error(j("animation.clip.error.property-existed"));else{if(n===O.Property)s=this._addPropertyToList(i,t,null);else{const o=i.find(c=>c.propertyPath===r.propertyPath&&c.relativePath===r.relativePath&&c.componentType===r.componentType);if(o)o.properties.find(p=>p.path===e)?W.error(j("animation.clip.error.sub-property-existed")):s=this._addPropertyToList(o.properties,t,o);else{const c=this._addPropertyToList(i,r,null,!1);s=this._addPropertyToList(c.properties,t,c)}}return this._sortProperties(),this.properties=i.slice(0),this._updateCurveBindings(),this.persistMetaViaFacade(),this.persistMainViaFacade(),s}}delProperty(t){const n=new Set;t.forEach(r=>{if(n.add(r.path),this.pathPropertyMap.delete(r.path),r.type===O.Property)r.properties.forEach(e=>{n.add(e.path),this.pathPropertyMap.delete(e.path)}),this._delPropertyFromList(this.properties,r);else{const e=this.properties.find(a=>a.path===r.parentPath);e&&(this._delPropertyFromList(e.properties,r),e.hasSubProperty&&!e.properties.length&&this._delPropertyFromList(this.properties,e))}}),this._sortProperties(),this.properties=this.properties.slice(0),this._removeCurveBindings(n),this._updateCurveBindings(),this.updateKeyframes(this.keyframeDataList.filter(r=>!n.has(r.path))),this.persistMetaViaFacade(),this.persistMainViaFacade()}async addKeyframe(t,n){const{rootEntity:r}=this,e=this.pathPropertyMap.get(n),{type:a,path:i,parentPath:s,properties:o,supported:c}=e;if(!c){W.error(j("animation.clip.error.property-not-supported"));return}const p=a===O.SubProperty?this.pathPropertyMap.get(s):null,{editorReference:h,editorPropertyPath:u,propertyPos:d}=await this._getReferenceAndActualPropertyPath(r,e),l=u[d],m=H(h)[l];let f=h[l];m!=null&&m.getActualEditorValue&&(f=m.getActualEditorValue(f));let A=e.valueType;a===O.Property&&(m!=null&&m.valueType)&&(A=m.valueType),a===O.SubProperty&&(f=f[u[d+1]]);const P=q(f);if(o.length)o.forEach(b=>{const{path:v}=b,w=P[b.name],S=this.keyframeDataList.find(M=>M.path===v&&M.frame===t);if(S)S.value=w,S.inTangentMode=x.Linear,S.outTangentMode=x.Linear;else{const M=this._createKeyframeData(t,w,b.valueType,void 0,void 0,b,e);this.keyframeDataList.push(M)}});else{const b=this.keyframeDataList.find(v=>v.path===i&&v.frame===t);if(b)b.value=P,b.inTangent=void 0,b.outTangent=void 0;else{const v=this._createKeyframeData(t,P,A,void 0,void 0,e,a===O.SubProperty?p:null);this.keyframeDataList.push(v)}}this.updateKeyframes(this.keyframeDataList)}addKeyframeByRecording(t,n){const r=this._ensurePropertyExists(n);r&&this.addKeyframe(t,r.path)}deleteKeyframes(t){t.forEach(n=>{const r=this.keyframeDataList.indexOf(n);r>-1&&this.keyframeDataList.splice(r,1)}),this.updateKeyframes(this.keyframeDataList)}updateKeyframes(t,n=!0){const r={};t.length&&t.sort((e,a)=>e.frame-a.frame),t.forEach(e=>{const a=e.path;r[a]??(r[a]=[]),r[a].push(e),r[a].sort((i,s)=>i.frame-s.frame)});for(const e in r)for(let a=0,i=r[e].length;a<i;++a){const s=r[e][a];if(s.interpolationType===I.Step)continue;const o=r[e][a-1],c=r[e][a+1];s.isFirst=a===0,s.isLast=a===i-1,a>0&&(s.frame-o.frame===0?s.linearInTangent=0:s.linearInTangent=(s.value-o.value)/((s.frame-o.frame)/this.samples),s.inTangent=s.inTangentMode===x.Linear?s.linearInTangent:s.inTangent,isNaN(s.inTangent)&&(s.inTangent=-1/0)),a<i-1&&(c.frame-s.frame===0?s.linearOutTangent=0:s.linearOutTangent=(c.value-s.value)/((c.frame-s.frame)/this.samples),s.outTangent=s.outTangentMode===x.Linear?s.linearOutTangent:s.outTangent,isNaN(s.outTangent)&&(s.outTangent=-1/0))}this.keyframeDataList=t.slice(0),this.isSubAsset||(this._generateEngineKeyframes(t),n&&this.persistMainViaFacade())}addEvent(t){const n={id:Y(),time:t/this.samples,functionName:"onEvent"};this.events[n.id]=n,this.updateEvents(this.events)}deleteEvent(t){delete this.events[t.id],this.updateEvents(this.events)}updateEvents(t,n=!0){const r=this.engineObject;if(this.events={...t},r.clearEvents(),Object.values(this.events).map(e=>{const a=e.paramType==="string"?e.string:e.number;r.addEvent(e.functionName,e.time,a)}),this.data.events=Object.values(this.events).map(e=>({time:e.time,functionName:e.functionName,parameter:e.paramType==="string"?e.string:e.number})),n){const{isSubAsset:e}=this;if(e){const a=this.root.assetStore.getAsset(this.mainId);if(a){const i=a.engineObject.animations.indexOf(this._engineObject);a.updateAnimationEvents(i,this.data.events)}}this.persistMainViaFacade()}}updateSamples(t){this.samples=+t.toFixed(0)}updateRootEntity(t){if(!(!t||t.id===this.rootEntityId)){if(this.rootEntityId=t.id,this.engineObject){this._clearPropertyMappings();const n=this._init().then(async()=>{await this._generateKeyframeDataList(),await this._updateCurveBindings(),this.showEditor&&(await this.saveEditorOriginValue(),await this.sampleAnimation(this.root.animationClipStore.currentFrame))}).catch(r=>{console.warn("AnimationClipAsset:updateRootEntity rebuild failed",this.name,r)});this._initKeyframeDataPromise=n}this._listenRootEntityChanged(),this.persistMetaViaFacade()}}setTangentMode(t,n,r){t.forEach(e=>{if(n===se.In)switch(e.inTangentMode=r,r){case x.Linear:e.inTangent=e.linearInTangent;break;case x.Constant:e.inTangent=-1/0;break;case x.Free:break}else switch(e.outTangentMode=r,r){case x.Linear:e.outTangent=e.linearOutTangent;break;case x.Constant:e.outTangent=-1/0;break;case x.Free:break}}),this.persistMetaViaFacade(),this.updateKeyframes(this.keyframeDataList)}async checkPropertiesSupport(t){const{properties:n}=this;let r=!1;const e=n.map(async a=>{const i=!!a.supported,{editorReference:s}=await this._getReferenceAndActualPropertyPath(t,a);s?a.supported=!0:a.supported=!1,!i&&a.supported&&(r=!0)});await Promise.all(e),r&&(this.properties=this.properties.slice(0),await this._generateKeyframeDataList(),this.updateKeyframes(this.keyframeDataList,!1),await this.saveEditorOriginValue(),await this.sampleAnimation(this.root.animationClipStore.currentFrame))}updateSelectedEvent(t){this.selectedEventId=t}async openEditor(t){if(t&&!this.showEditor){this._initKeyframeDataPromise||(this._initKeyframeDataPromise=this._generateKeyframeDataList()),this.showEditor=t,this.root.projectStore.animationEditing=t;const n=++this._openIndex;if(await this._initKeyframeDataPromise,n!==this._openIndex)return;this.saveEditorOriginValue(),this.sampleAnimation(this.root.animationClipStore.currentFrame),rt()}!t&&this.showEditor&&(this.showEditor=t,this.root.projectStore.animationEditing=t,this.revertValue())}async sampleAnimation(t){const n=this.rootEntity;if(n){const r=n.engineObject;try{await this._parseKeyframeValuePromise,this.engineObject._sampleAnimation(r,t/this.samples),this._syncToEditor()}catch(e){console.warn(e)}}}async saveEditorOriginValue(){const{_originValueStore:t}=this,{curveBindings:n}=this.engineObject,r=n.map(async e=>{const{relativePath:a,type:i,property:s}=e,o=K.get(i),{editorReference:c,editorPropertyPath:p,propertyPos:h}=await this._getReferenceAndActualPropertyPath(this.rootEntity,{relativePath:a,componentType:o,propertyPath:s});if(!c)return;const u=p[h];if(!t.has(e)){let d=u;u==="rotationQuaternion"&&(d="rotation"),t.set(e,q(c[d]))}});await Promise.all(r)}async revertValue(){const{_originValueStore:t}=this,n=Array.from(t).map(async([r,e])=>{const{relativePath:a,type:i,property:s}=r,o=K.get(i),{editorReference:c,editorPropertyPath:p,propertyPos:h}=await this._getReferenceAndActualPropertyPath(this.rootEntity,{relativePath:a,componentType:o,propertyPath:s});if(!c)return;const u=p[h];let d=u;u==="rotationQuaternion"&&(d="rotation"),this._setEditorValue(c,d,e)});await Promise.all(n),t.clear()}async initByMain(t){const{engine:n,meta:r}=this;r.rootEntityId&&(this.rootEntityId=r.rootEntityId),this._listenRootEntityChanged();try{const e=JSON.parse(await t.text()),a=ct(e,{type:"AnimationClip",name:e.name}),i=await ie(a,n);this.bindEngineObject(i),await this._init()}catch(e){console.error(`[AnimationClipAsset] Failed to load "${this.name}"`,e)}}async initByEngineObject(t){this.bindEngineObject(t),this._name=t.name,await this._init()}async initByCreation(t,n){this.setNameByIncrease(n||"AnimationClip");const r=new oe(this.name);return this.bindEngineObject(r),this.data={name:this.name,curveBindings:r.curveBindings,events:[]},await this._init(),this.getMainData()}_clearPropertyMappings(){this.pathPropertyMap.clear(),this._propertyCurveMap={},this._propertyPathCache.clear(),this._propertyLabelMap.clear(),this._editorPathCache.clear(),this.properties.length=0,this._colorIndex=0,this._originValueStore.clear()}_sortProperties(){this.properties.sort((t,n)=>(t.level??0)-(n.level??0))}async _init(){const t=this.engineObject;this._clearPropertyMappings();const r=(await this._groupCurveBindingsByParent(t.curveBindings)).map(async a=>{if(await this._generatePropertiesFromBindingGroup(a),this.isSubAsset)return Promise.resolve();const i=a.bindings.flatMap(s=>{const{curve:o}=s;return o.keys.map(c=>this._editorValueToEngineValue(c.value,this._getValueTypeByCurve(o)).then(p=>{c.value=p}))});return Promise.all(i)});if(!this.isSubAsset){const{properties:a,pathPropertyMap:i}=this;a.forEach(s=>{s.properties.length||this._colorIndex++,i.set(s.path,s),s.properties.forEach(o=>{this._colorIndex++,i.set(o.path,o)})})}await Promise.all(r),this._sortProperties();const e={};t.events.forEach(a=>{const i=Y(),s=a.parameter?typeof a.parameter:"null";e[i]={id:i,time:a.time,functionName:a.functionName,paramType:s,string:s==="string"?a.parameter:void 0,number:s==="number"?a.parameter:void 0}}),this.data={name:t.name,curveBindings:t.curveBindings,events:[]},this.updateEvents(e,!1)}async onDoubleClick(){st.layoutStore.toggleTabVisibility("AnimationClip"),st.layoutStore.activeTab("AnimationClip"),rt()}getMainData(){const t=this.data,n={...t,curveBindings:t.curveBindings.map(r=>{const{curve:e}=r,a=ht.get(e.constructor);return{...r,type:K.get(r.type)||r.type,curveType:a,curve:{interpolation:e.interpolation,keys:e.keys.map(i=>{const s=i.value,o=s instanceof nt?this.root.assetStore.engineObjectToAssetMap.get(s).getCurrentRef():s;return{...i,value:q(o)}})}}})};return JSON.stringify(n)}async _syncToEditor(){const t=this.rootEntity,{curveBindings:n}=this.engineObject,r=n.map(async e=>{const{relativePath:a,type:i,property:s,getProperty:o}=e,c=K.get(i);if(!e.curve.keys.length)return;const p=await this._getActualPropertyPath(o??s,a,c),{editorReference:h,engineGetReference:u,editorPropertyPath:d,enginePropertyGetPath:l,propertyPos:m}=await this._getReferenceAndActualPropertyPath(t,{relativePath:a,componentType:c,propertyPath:p});if(!u||!h)return;const f=B({relativePath:a,componentType:c,propertyPath:d.slice(0,m+1).join(".")}),A=this.pathPropertyMap.get(f);let P=d[m],b=this._getEngineValue(u,l[m]),v=A.valueType;P==="rotationQuaternion"&&(P="rotation",b=b.toEuler(new at).scale(180/Math.PI),v=y.Vector3);const w=this._engineValueToEditorValue(b,v,!1);this._setEditorValue(h,P,w)});await Promise.all(r)}async _setEditorValue(t,n,r){var i,s;const e=(i=pe(t))==null?void 0:i[n],a=(s=H(t))==null?void 0:s[n];if(a!=null&&a.getEditorValue&&(r=a.getEditorValue(r)),a!=null&&a.setActualEditorValue?a==null||a.setActualEditorValue(t,n,r):t[n]=r,e!=null&&e.onChange){const o=r!=null&&r.refId?await t.root.assetStore.getAssetByRef(r):r;await e.onChange(t,n,o)}}_removeCurveBindings(t){const n=this.engineObject;if(!n)return;const r=new Set;for(const e of t){const a=this._propertyCurveMap[e];a&&(r.add(a),delete this._propertyCurveMap[e])}if(r.size>0){const e=n.curveBindings;for(let a=e.length-1;a>=0;a--){const i=e[a];r.has(i.curve)&&(e.splice(a,1),this._originValueStore.delete(i))}}}async _updateCurveBindings(){var n;const t=this.rootEntity;if(t)for(const r of this.properties)try{const{relativePath:e,componentType:a,valueType:i,properties:s,interpolationType:o}=r,c=B(r),p=await this._getReferenceAndActualPropertyPath(t,r),{editorReference:h,enginePropertySetPath:u,enginePropertyGetPath:d,editorPropertyPath:l,propertyPos:m}=p||{};if(!h||!u||!d||m===void 0)continue;const f=l[m],A=(n=H(h))==null?void 0:n[f],P=u.join("."),b=d.join(".");if(s.length)for(const v of s){const w=B(v),S=this._createCurve(w,v.valueType,v.interpolationType),M=v.name;await this._addCurveBinding(e,a,`${P}.${M}`,`${b}.${M}`,S),this._propertyCurveMap[w]=S}else{let v=i;A!=null&&A.valueType&&(v=A.valueType);const w=this._createCurve(c,v,o);await this._addCurveBinding(e,a,P,b,w),this._propertyCurveMap[c]=w}}catch(e){console.warn("updateCurveBindings skipped property (unresolved):",r==null?void 0:r.propertyPath,e);continue}}_createCurve(t,n,r){let e=this._propertyCurveMap[t];if(!e){const a=Z.get(n);a?(e=new a.curveClass,e.interpolation=r??a.defaultInterpolation):console.warn(`Unsupported curve value type: ${n}`)}return e}async _addCurveBinding(t,n,r,e,a){const i=ce.getClass(n),s=this.engineObject;let o=!0;for(let c=0,p=s.curveBindings.length;c<p;++c){const h=s.curveBindings[c];h.relativePath===t&&h.type===i&&h.property===r&&h.getProperty===e&&(h.curve=a,o=!1)}o&&(s.addCurveBinding(t,i,r,e,a),await this.saveEditorOriginValue())}_addPropertyToList(t,n,r,e=!0){var o;const a=this._covertToPropertyData(n,r),i=t.push(a),s=t[i-1];return this.pathPropertyMap.set(s.path,s),e&&((o=n.children)!=null&&o.length)&&n.children.forEach(c=>{this._addPropertyToList(s.properties,c,s,e)}),s}_delPropertyFromList(t,n){const r=t.findIndex(e=>e.path===n.path);r>-1&&(t.splice(r,1),this.pathPropertyMap.delete(n.path))}_covertToPropertyData(t,n){const{name:r,label:e,relativePath:a,componentType:i,propertyPath:s,type:o,valueType:c,interpolationType:p,children:h}=t,u=B(t),d=B(n),l=a.split("/").length-1;return{name:e||r,level:l,path:u,type:o,valueType:c,interpolationType:p,propertyPath:s,componentType:i,relativePath:a,hasSubProperty:h.length>0,curveColor:c===y.Float?this._getRandomColor():null,supported:!0,properties:[],parentPath:d}}async _getReferenceAndActualPropertyPath(t,n){if(!t)return{};const{relativePath:r,componentType:e,propertyPath:a}=n,i=t.findByPath(r);if(!i)return{};const s=i.getComponentByTypeName(e);if(!s)return{};const o=[],c=[],p=[],h=a.split("."),u=h.length-1;let d=-1,l=s;for(let P=0,b=u;P<=b;++P){const v=h[P];if(!l)return{};const w=H(l);let S="",M=v,k=v,z=v,R=P;for(let F=P,J=u;F<=J;++F){S+=h[F];const Q=(w==null?void 0:w[S])||{},{getPath:U,setPath:D,editorKey:tt}=Q;D&&(k=D,R=F),(U||D)&&(F===u&&D?k=D:k=U??D,z=U??D,R=F),tt&&(M=tt,R=F),F<u&&(S+=".")}P=R,c.push(k),p.push(z),o.push(M),le(l,M)&&(d=o.length-1),P<u&&(l=l[M],l!=null&&l.refId&&(l=await this.root.assetStore.getAssetByRef(l)))}const m=d>-1?d-1:o.length-1;l=s;for(let P=0,b=m;P<b;++P)l=l[o[P]],l!=null&&l.refId&&(l=await this.root.assetStore.getAssetByRef(l));const f=this._getEngineValue(s.engineObject,c.slice(0,m).join(".")),A=this._getEngineValue(s.engineObject,p.slice(0,m).join("."));return{editorReference:l,engineSetReference:f,engineGetReference:A,enginePropertySetPath:c,enginePropertyGetPath:p,editorPropertyPath:o,propertyPos:m,subPropertyPos:d}}_getEngineValue(t,n){if(!n)return t;let r=t;const e=n.split(".");for(let a=0,i=e.length;a<i;a++){const s=e[a];if(s.indexOf("[")>-1){const o=s.indexOf("[");r=r[s.slice(0,o)],r=r[parseInt(s.slice(o+1,-1))]}else if(s.endsWith(")")){const o=s.slice(0,s.indexOf("(")),c=s.match(/\w+\(([^)]*)\)/)[1].split(",").map(p=>p.trim().replace(/['"]+/g,"")).filter(p=>p!=="");r=r[o](...c)}else r=r[s]}return r}async _generateKeyframeDataList(){const t=this.engineObject,n=[],r=this.pathPropertyMap,e=t.curveBindings.map(async a=>{const{relativePath:i,type:s,getProperty:o,property:c,curve:p}=a,h=K.get(s),u=o??c,d=await this._convertPropertyProxyPath(u,h,i),m=B({relativePath:i,componentType:h,propertyPath:d||u});d||console.warn(`无法转换引擎路径到编辑器路径: ${u},使用原路径`);const f=r.get(m);if(!f){d&&console.warn(`转换后的路径仍未找到属性定义: ${m}, 原引擎路径: ${u}`);return}this._propertyCurveMap[m]=p;const A=f.valueType;p.keys.forEach(P=>{const{time:b,value:v,inTangent:w,outTangent:S}=P,M=Math.floor(b*this.samples),k=this._engineValueToEditorValue(v,A,!0),z=this._getSubProperties(A,p);if(z)z.forEach(R=>{const F=`${m}.${R}`,J=r.get(F),Q=w&&w[R],U=S&&S[R],D=this._createKeyframeData(M,k[R],y.Float,Q,U,J,f);n.push(D)});else{const R=r.get(f.parentPath),F=this._createKeyframeData(M,k,A,w,S,f,R);n.push(F)}})});await Promise.all(e),this.updateKeyframes(n,!1)}_createKeyframeData(t,n,r,e,a,i,s){const{path:o,curveColor:c}=i,{path:p=""}=s||{};return{id:Y(),frame:t,path:o,value:n,isActive:!0,valueType:r??y.Float,curveColor:c,parentPath:p,inTangent:e,outTangent:a,interpolationType:i.interpolationType,inTangentMode:e===void 0?x.Linear:e===-1/0?x.Constant:x.Free,outTangentMode:a===void 0?x.Linear:a===-1/0?x.Constant:x.Free}}_generateEngineKeyframes(t){const{_propertyCurveMap:n,samples:r,engineObject:e}=this,a=this._groupKeyframesByPath(t),s=this._collectPathsToSync(n,a).map(o=>this._syncCurveForPath(o,n[o],a.get(o)||[],r,e));this._parseKeyframeValuePromise=Promise.all(s)}_groupKeyframesByPath(t){return t.reduce((n,r)=>{const e=n.get(r.path)||[];return e.push(r),n.set(r.path,e),n},new Map)}_collectPathsToSync(t,n){const r=new Set;return Object.keys(t).forEach(e=>r.add(e)),n.forEach((e,a)=>r.add(a)),Array.from(r)}async _syncCurveForPath(t,n,r,e,a){if(!n)return;const i=await this._convertToEngineKeyframes(r,e);this._removeObsoleteKeyframes(n,i),this._addOrUpdateKeyframes(n,i,a)}async _convertToEngineKeyframes(t,n){const r=new Map;for(const e of t){const a=e.frame/n,i=await this._editorValueToEngineValue(e.value,e.valueType);i===void 0&&e.valueType===y.ReferResource||r.set(a,{value:i,inTangent:e.inTangent,outTangent:e.outTangent})}return r}_removeObsoleteKeyframes(t,n){const r=new Set(n.keys());for(let e=t.keys.length-1;e>=0;e--){const a=t.keys[e];r.has(a.time)||t.keys.splice(e,1)}}_addOrUpdateKeyframes(t,n,r){const e=new Map;t.keys.forEach(a=>{e.set(a.time,a)});for(const[a,{value:i,inTangent:s,outTangent:o}]of n){const c=e.get(a);if(c)c.value=i,c.inTangent=s,c.outTangent=o;else{const p=new Ce;p.time=a,p.value=i,p.inTangent=s,p.outTangent=o,t.addKey(p)}a>r._length&&(r._length=a)}}async _editorValueToEngineValue(t,n){var r;switch(n){case y.ReferResource:return t!=null&&t.refId?(r=await this.root.assetStore.getAssetByRef(t))==null?void 0:r.engineObject:t;case y.Color:return new me(t.r,t.g,t.b,t.a);case y.Vector2:return new de(t.x,t.y);case y.Vector3:return new at(t.x,t.y,t.z);case y.Vector4:return new ye(t.x,t.y,t.z,t.w);case y.Quaternion:return new ue(t.x,t.y,t.z,t.w);case y.Rect:return new he(t.x,t.y,t.width,t.height);case y.Float:return t;default:return t}}_engineValueToEditorValue(t,n,r){var a,i,s;let e;switch(n){case y.MethodParam:{if(e=[],r)for(let o=0,c=t.length;o<c;o++){const p=t[o];e[o]??(e[o]=[]);for(let h=0,u=p.length;h<u;h++){const d=p[h];e[o][h]=((a=this.root.assetStore.engineObjectToAssetMap.get(d))==null?void 0:a.getCurrentRef())??d}}else t&&t instanceof nt?e=[[((i=this.root.assetStore.engineObjectToAssetMap.get(t))==null?void 0:i.getCurrentRef())??t]]:t instanceof Array?e=t:e=[[t]];break}case y.ReferResource:{e=(s=this.root.assetStore.engineObjectToAssetMap.get(t))==null?void 0:s.getCurrentRef();break}case y.Color:{e={r:t.r,g:t.g,b:t.b,a:t.a},["r","g","b","a"].forEach(o=>{e[o]=Math.round(e[o]*1e3)/1e3});break}case y.Vector2:{e={x:t.x,y:t.y},["x","y"].forEach(o=>{e[o]=Math.round(e[o]*1e3)/1e3});break}case y.Vector3:{e={x:t.x,y:t.y,z:t.z},["x","y","z"].forEach(o=>{e[o]=Math.round(e[o]*1e3)/1e3});break}case y.Vector4:case y.Quaternion:{e={x:t.x,y:t.y,z:t.z,w:t.w},["x","y","z","w"].forEach(o=>{e[o]=Math.round(e[o]*1e3)/1e3});break}case y.Rect:{e={x:t.x,y:t.y,width:t.width,height:t.height},["x","y","width","height"].forEach(o=>{e[o]=Math.round(e[o]*1e3)/1e3});break}case y.Float:{e=Math.round(t*1e3)/1e3;break}default:e=t}return e}_getValueTypeByCurve(t){return lt.get(t.constructor)}_parsePropertyPath(t){const n=this._propertyPathCache.get(t);if(n)return n;const r=t.lastIndexOf("."),e=r===-1?{parentPath:t,subProperty:null}:{parentPath:t.substring(0,r),subProperty:t.substring(r+1)};return this._propertyPathCache.set(t,e),e}_isSubPropertyName(t){return/^([xyzw]|[rgba]|width|height)$/.test(t)}async _convertPropertyProxyPath(t,n,r){try{const e=this._resolveProxyHost(n,r,t);if(!e)return null;const a=`${r}|${n}|${t}`;if(this._editorPathCache.has(a))return this._editorPathCache.get(a);const i=await this._recursiveConvert(t,e,0);return i&&i!==t&&await this._buildLabelMappingsForPath(i,r,n,e),this._editorPathCache.set(a,i??null),i}catch{const a=`${r}|${n}|${t}`;return this._editorPathCache.set(a,null),null}}async _buildLabelMappingsForPath(t,n,r,e){try{const a=await this._getReferenceAndActualPropertyPath(this.rootEntity,{relativePath:n,componentType:r,propertyPath:t}),i=(a==null?void 0:a.editorPropertyPath)||t.split("."),s=typeof(a==null?void 0:a.propertyPos)=="number"?a.propertyPos:i.length-1;for(let o=0;o<=s;o++){const c=i.slice(0,o+1).join("."),p=B({relativePath:n,componentType:r,propertyPath:c});if(!this._propertyLabelMap.has(p)){const h=await this._extractLabelForPartialPath(c,e);h&&this._propertyLabelMap.set(p,h)}}}catch(a){console.warn("建立标签映射失败:",a)}}async _extractLabelForPartialPath(t,n){try{const r=t.split("."),e=r[r.length-1];let a=n,i=null;for(let s=0;s<r.length;s++){const o=r[s],c=a==null?void 0:a[G];if(c&&c[o]){const p=c[o];p.label&&(i=p.label),s<r.length-1&&(a=await this._getNextObject(a,o))}else break}return i||e}catch{return t.split(".").pop()||t}}async _recursiveConvert(t,n,r){if(r>6)return t;const e=n[G];if(!e)return t;for(const[a,i]of Object.entries(e)){if(!this._isPathMatch(t,i))continue;const s=i.getPath||i.setPath;if(s){if(s.endsWith("()")&&t.startsWith(s+".")){const o=t.substring(s.length+1),c=await this._getNextObject(n,a);if(!c)return`${a}.${o}`;const p=await this._recursiveConvert(o,c,r+1);return p?`${a}.${p}`:`${a}.${o}`}return this._buildEditorPath(a,t,i)}}return t}async _getNextObject(t,n){var r;try{let e=t[n];if(!e){const a=`get${n.charAt(0).toUpperCase()+n.slice(1)}`;typeof t[a]=="function"&&(e=t[a]())}if(e!=null&&e.refId&&((r=this.root)!=null&&r.assetStore)){let a=this.root.assetStore.engineObjectToAssetMap.get(e);if(!a)try{a=await this.root.assetStore.getAssetByRef(e)}catch{return e}if(a)return a}return e}catch{return null}}_resolveProxyHost(t,n,r){try{if(!this.rootEntity)return null;const e=n?this.rootEntity.findByPath(n):this.rootEntity;if(!e)return null;const a=e.getComponentByTypeName(t);return a?r?this._resolvePropertyProxyHolder(a,r):a:null}catch(e){return console.warn(`获取代理宿主失败: ${t}, ${n}`,r,e),null}}_resolvePropertyProxyHolder(t,n){try{const r=[t];this._addRelatedObjectCandidates(t,r);for(const e of r)if(this._hasMatchingProxyConfig(e,n))return e;return t}catch(r){return console.warn(`解析 PropertyProxy 持有者失败: ${n}`,r),t}}_addRelatedObjectCandidates(t,n){try{const r=t[G];if(!r)return;const e=new Set;for(const a of Object.values(r)){const i=this._extractObjectPathFromConfig(a);i&&e.add(i)}for(const a of e){const i=this._getEngineValue(t.engineObject,a);if(i){const s=this.root.assetStore.engineObjectToAssetMap.get(i);s&&!n.includes(s)&&n.push(s)}}}catch{}}_extractObjectPathFromConfig(t){const n=t.getPath||t.setPath;if(!n)return null;const r=n.match(/^([^.]+\([^)]*\))/);return r?r[1]:null}_hasMatchingProxyConfig(t,n){const r=t[G];if(!r)return!1;for(const e of Object.values(r))if(this._isPathMatch(n,e))return!0;return!1}_isPathMatch(t,n){return n?n.getPath&&this._isExactPathMatch(t,n.getPath)||n.setPath&&this._isExactPathMatch(t,n.setPath)||n.engineKey&&t.includes(n.engineKey):!1}_isExactPathMatch(t,n){if(!n)return!1;const r=p=>p.replace(/['"`\s]/g,""),e=p=>{let h="";for(let u=0;u<p.length;u++){const d=p[u];if(d==="("){for(;u<p.length&&p[u]!==")";)u++;h+="()"}else h+=d}return h},a=p=>e(r(p).replace(/\$value/g,"value")),i=a(t),s=a(n);if(i===s||((p,h)=>p.startsWith(h+".")||p.startsWith(h+"["))(i,s))return!0;if(!n.includes(".")&&!n.includes("(")&&!n.includes("[")){const p=i.split(".");for(const h of p){const u=h.indexOf("[");if((u>=0?h.slice(0,u):h)===s)return!0}}return!1}_buildEditorPath(t,n,r){if(!r)return t;const e=r.getPath||r.setPath;if(!e)return t;if(e.endsWith("()")&&n.startsWith(e+".")){const s=n.substring(e.length+1);return`${t}.${s}`}const a=n.replace(/['"`]/g,"").replace(/\$value/g,"value"),i=e.replace(/['"`]/g,"").replace(/\$value/g,"value");if(a.includes(i))return a.replace(i,t);if(!e.includes(".")&&!e.includes("(")){const s=n.match(/\.([a-zA-Z_]\w*)$/);if(s){const o=s[1];if(o!==e)return`${t}.${o}`}}return t}_validateCurveBinding(t){const{relativePath:n,type:r,getProperty:e,property:a}=t;return K.get(r)?e??a?!0:(console.warn(`绑定缺少属性路径: ${n}`),!1):(console.warn(`未知组件类型: ${r},跳过绑定`),!1)}async _groupCurveBindingsByParent(t){const n=new Map;return await Promise.all(t.map(async r=>{if(!this._validateCurveBinding(r))return;const{relativePath:e,type:a,getProperty:i,property:s}=r,o=K.get(a),c=i??s,h=await this._convertPropertyProxyPath(c,o,e)||c,u=this._parsePropertyPath(h),d=u.subProperty&&this._isSubPropertyName(u.subProperty);let l,m;d&&u.subProperty?(m=u.parentPath,l=`${e}.${o}.${m}`):(m=h,l=`${e}.${o}.${h}`),n.has(l)||n.set(l,{parentPath:m,relativePath:e,componentType:o,bindings:[]}),n.get(l).bindings.push(r)})),Array.from(n.values())}_validateAndGetParentValueType(t){if(t.length===1){const l=t[0],m=l.getProperty??l.property,{subProperty:f}=this._parsePropertyPath(m);return!f||!this._isSubPropertyName(f)?null:y.Float}if(!t.every(l=>this._getValueTypeByCurve(l.curve)===y.Float)){const l=t.map(m=>this._getValueTypeByCurve(m.curve));return console.warn(`分组中的绑定类型不一致: ${l.join(", ")},无法创建父属性`),null}const r=t.map(l=>l.curve.interpolation),e=r[0];r.every(l=>l===e)||console.warn(`子属性插值类型不一致: ${r.join(", ")}`);const i=t.map(l=>{const m=l.getProperty??l.property,f=m.lastIndexOf(".");return f===-1?null:m.substring(f+1)}).filter(Boolean).sort(),s=i.join(",");switch(s){case"x,y":return y.Vector2;case"x,y,z":return y.Vector3;case"w,x,y,z":return y.Vector4;case"a,b,g,r":return y.Color;case"height,width,x,y":return y.Rect}const o=new Set(["x","y","z","w"]),c=new Set(["r","g","b","a"]),p=new Set(["x","y","width","height"]),h=i.every(l=>o.has(l)),u=i.every(l=>c.has(l)),d=i.every(l=>p.has(l));return h?i.some(l=>l==="w")?y.Vector4:i.some(l=>l==="z")?y.Vector3:y.Vector2:u?y.Color:d?y.Rect:(console.warn(`无法识别的子属性组合: ${s}`),null)}_validateBindingGroup(t){const{bindings:n}=t;return n.every(r=>this._validateCurveBinding(r))&&this._validateAndGetParentValueType(n)!==null}_createParentProperty(t,n){const{parentPath:r,relativePath:e,componentType:a}=t,i=B({relativePath:e,componentType:a,propertyPath:r}),s=I.Linear,o=this._propertyLabelMap.get(i),c=r.split(".").pop()||r;return{name:o||c,level:e.split("/").length-1,path:i,type:O.Property,valueType:n,interpolationType:s,componentType:a,relativePath:e,hasSubProperty:!0,curveColor:null,supported:!0,properties:[],propertyPath:r}}async _createSubPropertiesFromBindings(t,n,r,e){return Promise.all(t.map(async a=>{const{getProperty:i,property:s,curve:o}=a,c=i??s,p=await this._convertPropertyProxyPath(c,e,r)||c,h=p.lastIndexOf("."),u=h===-1?p:p.substring(h+1),d=`${n}.${u}`,l={name:u,level:r.split("/").length,path:d,type:O.SubProperty,valueType:y.Float,interpolationType:o.interpolation,componentType:e,relativePath:r,hasSubProperty:!1,curveColor:this._getRandomColor(),supported:!0,properties:[],propertyPath:p,parentPath:n};return this.pathPropertyMap.set(d,l),l}))}_registerPropertyGroup(t,n){t.properties=n,this.pathPropertyMap.has(t.path)&&console.warn(`覆盖已存在的属性路径: ${t.path}`),this.pathPropertyMap.set(t.path,t),this.properties.push(t)}async _generatePropertiesFromBindingGroup(t){const{parentPath:n,relativePath:r,componentType:e,bindings:a}=t;if(!this.rootEntity){await Promise.all(a.map(p=>this._generatePropertyByEngineObject(p)));return}const i=await this._convertPropertyProxyPath(n,e,r)||n;if(!this._validateBindingGroup(t)){this.rootEntity&&a.length>1&&console.debug("AnimationClipAsset: grouping skipped",this.name,e,r,n),await Promise.all(a.map(p=>this._generatePropertyByEngineObject(p)));return}const s=this._validateAndGetParentValueType(a);if(s===null){console.error("验证通过但获取不到父属性类型"),await Promise.all(a.map(p=>this._generatePropertyByEngineObject(p)));return}const o=this._createParentProperty({...t,parentPath:i},s),c=await this._createSubPropertiesFromBindings(a,o.path,r,e);this._registerPropertyGroup(o,c)}async _generatePropertyByEngineObject(t){const{pathPropertyMap:n}=this,{relativePath:r,type:e,curve:a,getProperty:i,property:s}=t,o=K.get(e),c=i??s,p=await this._convertPropertyProxyPath(c,o,r)??c,h=this._getValueTypeByCurve(a),u=B({relativePath:r,componentType:o,propertyPath:p}),d=this._propertyLabelMap.get(u),l=p.lastIndexOf("."),m=l===-1?p:p.substring(l+1),f={name:d||m,level:r.split("/").length-1,path:u,type:O.Property,valueType:h,interpolationType:a.interpolation,componentType:o,relativePath:r,hasSubProperty:!1,curveColor:this._getRandomColor(),supported:!0,properties:[],propertyPath:p},A=this._getSubProperties(h,a);A&&(f.curveColor=null,f.hasSubProperty=!0,f.properties=A.map(P=>{const b=`${u}.${P}`,v={name:P,level:r.split("/").length,path:b,type:O.SubProperty,valueType:y.Float,interpolationType:a.interpolation,componentType:o,relativePath:r,hasSubProperty:!1,curveColor:this._getRandomColor(),supported:!0,properties:[],propertyPath:`${p}.${P}`};return n.set(b,v),v})),n.set(u,f),this.properties.push(f)}async _getActualPropertyPath(t,n,r){if(!this.isSubAsset){const{editorPropertyPath:e=[]}=await this._getReferenceAndActualPropertyPath(this.rootEntity,{relativePath:n,componentType:r,propertyPath:t});t=e.join(".")}return t}_getRandomColor(){const{_colorList:t}=this,n=(e,a)=>{const i=parseInt(e.slice(1),16),s=parseInt(a.slice(1),16);return`#${parseInt(`${(i+s)/2}`).toString(16).toUpperCase()}`},r=()=>{const e=[];for(let i=0,s=t.length-1;i<s;i++){const o=n(t[i],t[i+1]);e.push(o)}const a=t.slice(0,t.length-1);for(let i=0,s=a.length+e.length;i<s;i++)t[i]=i%2===0?a[i/2]:e[(i-1)/2]};for(;this._colorIndex>=t.length;)r();return t[this._colorIndex++]}_getSubProperties(t,n){let r;switch(t){case y.Vector2:{r=["x","y"];break}case y.Vector3:{r=["x","y","z"];break}case y.Vector4:{r=["x","y","z","w"];break}case y.Quaternion:{r=["x","y","z","w"];break}case y.Color:{r=["r","g","b","a"];break}case y.Array:case y.FloatArray:n.keys[0]&&(r=Array.from(n.keys[0].value).map((e,a)=>a))}return r}_listenRootEntityChanged(){var n;const t=this.rootEntity;t&&(this.showEditor&&(this.openEditor(!1),this.openEditor(!0)),(n=this._componentsChangedListenerDisposer)==null||n.call(this),this._componentsChangedListenerDisposer=fe(()=>t.components.length,()=>{this.checkPropertiesSupport(t),this.engineObject.curveBindings.forEach(r=>{r._tempCurveOwner={}})}))}_convertPropertyToTreeItem(t){var m;const{name:n,label:r,properties:e=[],relativePath:a,componentType:i,path:s,type:o,curveColor:c,supported:p,level:h}=t,u=((m=this.rootEntity.findByPath(a))==null?void 0:m.name)||a.split("/").pop(),d=r||n;return{name:o===O.Property?`${u}:${i}.${d}`:d,id:s,canAddKeyframe:o===O.Property||o===O.SubProperty,curveColor:c,supported:p,level:h,children:e.map(f=>this._convertPropertyToTreeItem(f))}}_ensurePropertyExists(t){const n=B(t);let r=this.pathPropertyMap.get(n);return r||(r=this.addProperty(t)),t.children&&t.children.length&&t.children.forEach(e=>{this._ensurePropertyExists(e)}),r}destroy(){var t;super.destroy(),(t=this._componentsChangedListenerDisposer)==null||t.call(this),this._propertyPathCache.clear(),this.pathPropertyMap.clear(),this._propertyCurveMap={},this._propertyLabelMap.clear(),this._editorPathCache.clear(),this._originValueStore.clear()}};T([L],C.prototype,"samples",2);T([L],C.prototype,"properties",2);T([L],C.prototype,"keyframeDataList",2);T([L],C.prototype,"events",2);T([ge()],C.prototype,"data",2);T([L],C.prototype,"selectedEventId",2);T([L,Pe()],C.prototype,"rootEntityId",2);T([L],C.prototype,"readOnly",2);T([_e],C.prototype,"addedPropertiesTreeData",1);T([E],C.prototype,"addProperty",1);T([E],C.prototype,"delProperty",1);T([E],C.prototype,"addKeyframe",1);T([E],C.prototype,"deleteKeyframes",1);T([E],C.prototype,"updateKeyframes",1);T([E],C.prototype,"addEvent",1);T([E],C.prototype,"deleteEvent",1);T([E],C.prototype,"updateEvents",1);T([E],C.prototype,"updateSamples",1);T([E],C.prototype,"updateRootEntity",1);T([E],C.prototype,"setTangentMode",1);T([E],C.prototype,"checkPropertiesSupport",1);T([E],C.prototype,"updateSelectedEvent",1);T([E],C.prototype,"openEditor",1);C=T([ve({type:"AnimationClip",label:j("asset.animation-clip.title"),icon:"animate-clip",extname:"anim",importMenuConfig:{type:be.Add},customInspector:Se,viewer:$,async bundle({content:_},t,n){var a;const r=JSON.parse(await _.text());for(const i of r.curveBindings)if(i.curveType==="AnimationRefCurve"){for(const s of i.curve.keys)if((a=s.value)!=null&&a.refId){const o=n.resolveRef(s.value.refId);o&&(s.value=o)}}const e=ct(r,{type:"AnimationClip",name:r.name});return{content:new Blob([e])}}})],C);export{C as A,Se as a,$ as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var D=Object.defineProperty;var O=(r,t,a)=>t in r?D(r,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[t]=a;var c=(r,t,a)=>(O(r,typeof t!="symbol"?t+"":t,a),a);import{aJ as x,aK as N,aM as B,av as _,aI as I,aP as L,j as U,aQ as z,aR as F,aS as R,x as T,aT as V,m as w,aU as J,n as q,e as K,o as Q,q as W,aV as $}from"./index-
|
|
1
|
+
var D=Object.defineProperty;var O=(r,t,a)=>t in r?D(r,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[t]=a;var c=(r,t,a)=>(O(r,typeof t!="symbol"?t+"":t,a),a);import{aJ as x,aK as N,aM as B,av as _,aI as I,aP as L,j as U,aQ as z,aR as F,aS as R,x as T,aT as V,m as w,aU as J,n as q,e as K,o as Q,q as W,aV as $}from"./index-c3dec278.js";import{u as k,r as M}from"./index-cdbb2f4d.js";import"./postmen-2853c0e6.js";import"./meshopt_simplifier.module-cd99529d.js";import{b as G}from"./bundlers-9b0d37fc.js";const H=x(function(){const{layoutStore:t}=k(),{t:a}=N(),e=B.useCallback(()=>{t.toggleTabVisibility("AnimatorController")},[]);return _.jsx(I,{align:"both",css:{padding:"$1"},fullWidth:!0,children:_.jsx(L,{size:"sm",onClick:e,children:a("animation.animator-controller.editor.open")})})});var X=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,y=(r,t,a,e)=>{for(var s=e>1?void 0:e?Y(t,a):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=(e?n(t,a,s):n(s))||s);return e&&s&&X(t,a,s),s};let d=class extends U{constructor(t){super(t);c(this,"statesNameMap",{});c(this,"internalDataUpdated",!1);c(this,"layers",[]);c(this,"parameters",[]);c(this,"_syncing");c(this,"_syncingPromise");this.onDoubleClick=this.onDoubleClick.bind(this)}applyPropertyFromDomain(t,a){super.applyPropertyFromDomain(t,a),(t==="layers"||t==="parameters")&&this.applyControllerData().catch(e=>{console.error("[AnimatorControllerAsset] applyControllerData failed:",e)})}initByEngineObject(t){return this.setNameByIncrease("AnimatorController"),this.bindEngineObject(t),this.layers=t.layers.map(a=>{const e=a.stateMachine,o={states:e.states.map(n=>({name:n.name,speed:n.speed,wrapMode:n.wrapMode,clipStartNormalizedTime:n.clipStartTime,clipEndNormalizedTime:n.clipEndTime,clip:this.root.assetStore.engineObjectToAssetMap.get(n.clip).getCurrentRef(),transitions:[],scripts:[],isEntryState:n===e.defaultState,isExitState:!1,isAnyState:!1})),transitions:[],entryTransitions:[],anyTransitions:[]};return{name:a.name,blendingMode:a.blendingMode,weight:a.weight,stateMachine:o}}),this.internalDataUpdated=!0,this.getMainData()}async initByMain(t){const{internalDataUpdated:a}=this.meta;a&&(this.internalDataUpdated=!0);const e=JSON.parse(await t.text()),s=new z(this.engine);this.bindEngineObject(s),this.layers=e.layers||[],this.parameters=e.parameters||[],await this.applyControllerData()}async applyControllerData(){this._syncing&&await this._syncingPromise,this._syncing=!0;try{this.statesNameMap={};const t=this.engineObject;t.clearLayers(),t._parameters.length=0,t._parametersMap={};const{layers:a,parameters:e}=this;this._syncingPromise=Promise.all(a.map((s,o)=>{const{name:n,blendingMode:m,weight:u}=s,l=new F(n);return t.addLayer(l),l.blendingMode=m,l.weight=u,this._applyStateMachineData(o)})),e.forEach(s=>{const{isTrigger:o,name:n,defaultValue:m}=s;o?t.addTriggerParameter(n):t.addParameter(n,m)}),await this._syncingPromise}finally{this._syncing=!1}}async initByCreation(){return this.layers=[{name:"Base",weight:1,blendingMode:R.Override,stateMachine:{states:[],transitions:[],entryTransitions:[],anyTransitions:[]}}],this.getMainData()}onDoubleClick(){M.sceneStore.selectEntity(null),M.layoutStore.toggleTabVisibility("AnimatorController"),M.layoutStore.activeTab("AnimatorController")}async _applyStateMachineData(t){const a=this.engineObject.layers[t],{stateMachine:e}=this.layers[t],s=a.stateMachine;if(e){const{states:o=[],transitions:n=[],entryTransitions:m=[],anyTransitions:u=[]}=e,l={},C={},P=o.map(async i=>{var E,A;const{id:h,name:f,speed:b,wrapMode:g,clipStartNormalizedTime:j,clipEndNormalizedTime:v,clip:S}=i;(E=this.statesNameMap)[t]||(E[t]={}),this.statesNameMap[t][i.name]=i;const p=s.addState(f);p.speed=b,p.wrapMode=g,p.clipStartTime=j,p.clipEndTime=v,l[h]=p,S&&(p.clip=(A=await this.root.assetStore.getAssetByRef(S))==null?void 0:A.engineObject)});n.forEach(i=>{const h=this._createTransition(i,l[i.destinationStateId]);C[i.id]=h}),o.forEach(i=>{const{id:h,transitions:f}=i;f.forEach(b=>{const g=C[b];g&&l[h].addTransition(g)})}),m.forEach(i=>{s.addEntryStateTransition(this._createTransition(i,l[i.destinationStateId]))}),u.forEach(i=>{s.addAnyStateTransition(this._createTransition(i,l[i.destinationStateId]))}),await Promise.all(P),this.engineObject._updateFlagManager.dispatch()}}_createTransition(t,a){const e=new $;return e.duration=t.duration,e.offset=t.offset,e.exitTime=t.exitTime,e.solo=t.solo,e.mute=t.mute,e.hasExitTime=t.hasExitTime,e._isExit=t.isExit,e.destinationState=a,t.conditions.forEach(s=>{e.addCondition(s.parameterName,s.mode,s.threshold)}),e}};y([T,V()],d.prototype,"internalDataUpdated",2);y([w(),T],d.prototype,"layers",2);y([w(),T],d.prototype,"parameters",2);y([J],d.prototype,"applyPropertyFromDomain",1);d=y([q({type:"AnimatorController",label:K("asset.animator-controller.title"),icon:"animate-controller",extname:"animCtrl",importMenuConfig:{type:Q.Add},dragLayer:W.AnimationController,customInspector:H,async bundle({content:r}){return{content:new Blob([G(await r.text())])}}})],d);export{d as AnimatorControllerAsset};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var f=Object.defineProperty;var P=(n,t,o)=>t in n?f(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o;var i=(n,t,o)=>(P(n,typeof t!="symbol"?t+"":t,o),o);import{E as y,bp as u,s as c,p as m,C as b,t as h,e as C,bq as _,br as g,u as v,bs as O,bt as S}from"./index-
|
|
1
|
+
var f=Object.defineProperty;var P=(n,t,o)=>t in n?f(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o;var i=(n,t,o)=>(P(n,typeof t!="symbol"?t+"":t,o),o);import{E as y,bp as u,s as c,p as m,C as b,t as h,e as C,bq as _,br as g,u as v,bs as O,bt as S}from"./index-c3dec278.js";import"./index-cdbb2f4d.js";import{c as E}from"./Component-0f881fc1.js";import"./postmen-2853c0e6.js";var A=Object.defineProperty,w=Object.getOwnPropertyDescriptor,p=(n,t,o,r)=>{for(var e=r>1?void 0:r?w(t,o):t,a=n.length-1,l;a>=0;a--)(l=n[a])&&(e=(r?l(t,o,e):l(e))||e);return r&&e&&A(t,o,e),e};let s=class extends y{constructor(t,o){super(t,o);i(this,"animatorController",null);i(this,"cullingMode",u.None);i(this,"speed",1)}async bindEngineObject(t){await super.bindEngineObject(t),t.enabled=!1}rebindEngineObject(t){super.rebindEngineObject(t),t.enabled=!1}};p([c(),m({type:b.AssetPicker,assetType:"AnimatorController",label:"animation.animator-controller.controller.title",info:"animation.animator-controller.controller.info",bindPath:"animatorController"})],s.prototype,"animatorController",2);p([c(),m({type:b.Select,label:"animation.animator-controller.culling-mode.title",info:"animation.animator-controller.culling-mode.info",options:h(u,void 0,n=>C(`animation.animator-controller.culling-mode.${n.toLowerCase()}`)),bindPath:"cullingMode"})],s.prototype,"cullingMode",2);p([c(),m({type:b.Number,label:"animation.animator-controller.speed.title",info:"animation.animator-controller.speed.info",bindPath:"speed"})],s.prototype,"speed",2);s=p([E({type:"Animator",componentsMenu:{label:"component.animator.title"},unique:!0})],s);class j extends _{constructor(){super(...arguments);i(this,"_animatorComponents",[]);i(this,"onScriptPlay")}init(o){this.onScriptPlay=o.onScriptPlay}onPlay(o){this.engine.sceneManager.scenes[0].rootEntities.forEach(e=>{e.getComponentsIncludeChildren(g,this._animatorComponents)}),this._animatorComponents.forEach(e=>{e.enabled=o,o||e._reset()}),this.onScriptPlay&&this.onScriptPlay(o)}}var M=Object.defineProperty,D=Object.getOwnPropertyDescriptor,$=(n,t,o,r)=>{for(var e=r>1?void 0:r?D(t,o):t,a=n.length-1,l;a>=0;a--)(l=n[a])&&(e=(r?l(t,o,e):l(e))||e);return r&&e&&M(t,o,e),e};let d=class{constructor(n){i(this,"script");i(this,"root");v(this),this.root=n}init(){this.script=O.addScript(j),this.script.init({onScriptPlay:n=>{var t;(t=this.root.animatorControllerStore)==null||t.updateGlobalPlayState(n)}})}};d=$([S({type:"animatorStore"})],d);export{s as A,d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var r=Object.defineProperty;var n=(t,e,s)=>e in t?r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var i=(t,e,s)=>(n(t,typeof e!="symbol"?e+"":e,s),s);import{B as o}from"./index-
|
|
1
|
+
var r=Object.defineProperty;var n=(t,e,s)=>e in t?r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var i=(t,e,s)=>(n(t,typeof e!="symbol"?e+"":e,s),s);import{B as o}from"./index-c3dec278.js";class _{constructor(){i(this,"overridePreviewer");i(this,"_entity");i(this,"_requestResetCamera");i(this,"_boundingBox",new o)}stopViewAsset(){this._entity&&(this._entity=null)}getDescription(e){return""}}export{_ as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var d=Object.defineProperty;var v=(e,t,s)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var p=(e,t,s)=>(v(e,typeof t!="symbol"?t+"":t,s),s);import{aH as b,aJ as c,av as n,j as y,Z as A,n as j,e as m,o as w,b0 as l}from"./index-
|
|
1
|
+
var d=Object.defineProperty;var v=(e,t,s)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var p=(e,t,s)=>(v(e,typeof t!="symbol"?t+"":t,s),s);import{aH as b,aJ as c,av as n,j as y,Z as A,n as j,e as m,o as w,b0 as l}from"./index-c3dec278.js";import"./index-cdbb2f4d.js";import"./postmen-2853c0e6.js";import{A as f}from"./AssetViewer-3847c058.js";const x=b("div",{position:"absolute",top:"100px",backgroundColor:"$panelBg",variants:{sticky:{true:{position:"absolute",top:0}}}}),O=c(({asset:e})=>n.jsx(x,{children:n.jsx("audio",{src:e.url,controls:!0,children:"Your browser does not support the audio element."})}));class _ extends f{constructor(){super(...arguments);p(this,"overridePreviewer",c(({asset:s})=>n.jsx(O,{asset:s})))}setViewAsset(s,r){}}var P=Object.defineProperty,U=Object.getOwnPropertyDescriptor,g=(e,t,s,r)=>{for(var o=r>1?void 0:r?U(t,s):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(r?a(t,s,o):a(o))||o);return r&&o&&P(t,s,o),o};let u=class extends y{async initByMain(e){const t=URL.createObjectURL(e);try{const s=await this.engine.resourceManager.load({url:t,type:A.Audio});this.bindEngineObject(s)}finally{URL.revokeObjectURL(t)}}};u=g([j({type:"Audio",label:m("asset.audio.title"),loaderType:"Audio",importMenuConfig:{type:w.Upload,tooltip:`请上传音频文件(支持 ${l.map(e=>e.slice(1).toUpperCase()).join(", ")})`,accept:l.join(",")},viewer:_,bundle({content:e}){return{content:e}}})],u);export{u as AudioAsset};
|
package/dist/preview-client/_static/{AudioComponent-80d06ef4.js → AudioComponent-3d6c73ce.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var b=Object.defineProperty;var d=(p,e,o)=>e in p?b(p,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):p[e]=o;var n=(p,e,o)=>(d(p,typeof e!="symbol"?e+"":e,o),o);import{E as f,p as r,C as a,s as u}from"./index-
|
|
1
|
+
var b=Object.defineProperty;var d=(p,e,o)=>e in p?b(p,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):p[e]=o;var n=(p,e,o)=>(d(p,typeof e!="symbol"?e+"":e,o),o);import{E as f,p as r,C as a,s as u}from"./index-c3dec278.js";import"./index-cdbb2f4d.js";import{c}from"./Component-0f881fc1.js";import"./postmen-2853c0e6.js";var P=Object.defineProperty,v=Object.getOwnPropertyDescriptor,i=(p,e,o,s)=>{for(var t=s>1?void 0:s?v(e,o):e,m=p.length-1,y;m>=0;m--)(y=p[m])&&(t=(s?y(e,o,t):y(t))||t);return s&&t&&P(e,o,t),t};let l=class extends f{constructor(e,o){super(e,o);n(this,"clip",null);n(this,"playOnEnabled",!0);n(this,"loop",!0);n(this,"volume",0);n(this,"mute",!1)}};i([r({label:"Audio resource",info:"Audio resource info",type:a.AssetPicker,assetType:"Audio",bindPath:"clip"}),u()],l.prototype,"clip",2);i([r({label:"playOnEnabled",info:"playOnEnabled info",type:a.Toggle,bindPath:"playOnEnabled"}),u()],l.prototype,"playOnEnabled",2);i([r({label:"IsLooping",info:"IsLooping info",type:a.Toggle,bindPath:"loop"}),u()],l.prototype,"loop",2);i([r({label:"Volume",info:"Volume info",type:a.Slider,min:0,max:1,bindPath:"volume"}),u()],l.prototype,"volume",2);i([r({label:"Mute",info:"Mute info",type:a.Toggle,bindPath:"mute"}),u()],l.prototype,"mute",2);l=i([c({type:"AudioSource",componentsMenu:{label:"component.audio.title"}})],l);export{l as AudioComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aH as o,aI as r}from"./index-
|
|
1
|
+
import{aH as o,aI as r}from"./index-c3dec278.js";const a=o(r,{borderRadius:"$2",fontSize:"$1",padding:"$1 $2",userSelect:"none",fontWeight:500,variants:{type:{info:{backgroundColor:"$blue3",color:"$blueA11"},warning:{backgroundColor:"$amber3",color:"$amber11"},error:{backgroundColor:"$red3",color:"$red11"},success:{backgroundColor:"$green3",color:"$green11"}}}});export{a as S};
|
package/dist/preview-client/_static/{CameraComponent-9c9db3fb.js → CameraComponent-3dc63451.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var v=Object.defineProperty;var q=(e,i,a)=>i in e?v(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var t=(e,i,a)=>(q(e,typeof i!="symbol"?i+"":i,a),a);import{L as g,a as y,E as k,V as L,b as C,d as P,D as w,c as O,A as x,M as A,C as s,s as o,p as l,t as m,e as b,l as E,g as R,f as S,h as M,r as D,S as j}from"./index-
|
|
1
|
+
var v=Object.defineProperty;var q=(e,i,a)=>i in e?v(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var t=(e,i,a)=>(q(e,typeof i!="symbol"?i+"":i,a),a);import{L as g,a as y,E as k,V as L,b as C,d as P,D as w,c as O,A as x,M as A,C as s,s as o,p as l,t as m,e as b,l as E,g as R,f as S,h as M,r as D,S as j}from"./index-c3dec278.js";import"./index-cdbb2f4d.js";import{c as B}from"./Component-0f881fc1.js";import"./postmen-2853c0e6.js";var F=Object.defineProperty,z=Object.getOwnPropertyDescriptor,n=(e,i,a,p)=>{for(var c=p>1?void 0:p?z(i,a):i,h=e.length-1,u;h>=0;h--)(u=e[h])&&(c=(p?u(i,a,c):u(c))||c);return p&&c&&F(i,a,c),c};const d=[...Object.values(g),y.Nothing,y.Everything];class T extends j{constructor(){super(...arguments);t(this,"_originalMask");t(this,"_onEndRenderOnce",null)}onBeginRender(a){this._originalMask=a.cullingMask,a.cullingMask&=~(g.Viewport|g.Outline|g.NavigationGizmo|g.Gizmo)}onEndRender(a){if(a.cullingMask=this._originalMask,this._onEndRenderOnce){const p=this._onEndRenderOnce;this._onEndRenderOnce=null,p(a)}}executeAfterRender(a){this._onEndRenderOnce=a}}let r=class extends k{constructor(){super(...arguments);t(this,"_lastRTAsset",null);t(this,"isOrthographic",!1);t(this,"nearClipPlane",.1);t(this,"farClipPlane",100);t(this,"fieldOfView",45);t(this,"orthographicSize",10);t(this,"viewport",new L(0,0,1,1));t(this,"priority",0);t(this,"enableFrustumCulling",!0);t(this,"clearFlags",C.All);t(this,"cullingMask",P(y.Everything,d));t(this,"postProcessMask",P(y.Everything,d));t(this,"depthTextureMode",w.None);t(this,"opaqueTextureEnabled",!1);t(this,"opaqueTextureDownsampling",O.TwoX);t(this,"antiAliasing",x.None);t(this,"msaaSamples",A.FourX);t(this,"enableHDR",!1);t(this,"enablePostProcess",!0);t(this,"isAlphaOutputRequired",!1);t(this,"renderTarget",null)}onEnabled(){this.applyBoundPathChange("enabled",s.Toggle,!1)}onInitComplete(){this._attachEditorCameraBridge(),this.renderTarget||this.applyBoundPathChange("enabled",s.Toggle,!1)}_attachEditorCameraBridge(){let i=this.engineObject.entity.getComponent(T);if(i||(i=this.engineObject.entity.addComponent(T)),this.renderTarget){const a=this.root.assetStore.getAsset(this.renderTarget.refId);a&&(this._lastRTAsset=a,i&&i.executeAfterRender(()=>{var p;a.updateThumbnail(),(p=a.subAssets)==null||p.forEach(c=>c.updateThumbnail())}))}}rebindEngineObject(i){super.rebindEngineObject(i),this._attachEditorCameraBridge()}};n([o(),l({label:"camera.is-orthographic",bindPath:"isOrthographic"})],r.prototype,"isOrthographic",2);n([o(),l({label:"camera.near-clip-plane",bindPath:"nearClipPlane"})],r.prototype,"nearClipPlane",2);n([o(),l({label:"camera.far-clip-plane",bindPath:"farClipPlane"})],r.prototype,"farClipPlane",2);n([o(),l({label:"camera.field-of-view",bindPath:"fieldOfView",when:e=>!e.isOrthographic})],r.prototype,"fieldOfView",2);n([o(),l({label:"camera.orthographic-size",bindPath:"orthographicSize",when:e=>e.isOrthographic})],r.prototype,"orthographicSize",2);n([o(),l({type:s.Vector4,min:0,max:1,label:"camera.viewport.title",bindPath:"viewport"})],r.prototype,"viewport",2);n([o(),l({label:"camera.priority.title",bindPath:"priority"})],r.prototype,"priority",2);n([o(),l({label:"camera.enable-frustum-culling",bindPath:"enableFrustumCulling"})],r.prototype,"enableFrustumCulling",2);n([o(),l({label:"camera.clear-flags.title",bindPath:"clearFlags",type:s.Select,options:m(C,void 0,e=>b(`camera.clear-flags.${e.toLocaleLowerCase()}`))})],r.prototype,"clearFlags",2);n([o(E(d)),l({label:"camera.culling-mask",bindPath:"cullingMask",type:s.Select,...R(d)}),S(M(d))],r.prototype,"cullingMask",2);n([o(E(d)),l({label:"camera.post-process-mask",bindPath:"postProcessMask",type:s.Select,...R(d)}),S(M(d))],r.prototype,"postProcessMask",2);n([o(),l({label:"camera.depth-texture-mode.title",info:"camera.depth-texture-mode.info",bindPath:"depthTextureMode",type:s.Select,options:m(w,void 0,e=>b(`camera.depth-texture-mode.${e.toLowerCase()}`))})],r.prototype,"depthTextureMode",2);n([o(),l({label:"camera.opaque-texture-enabled.title",info:"camera.opaque-texture-enabled.info",bindPath:"opaqueTextureEnabled",type:s.Toggle})],r.prototype,"opaqueTextureEnabled",2);n([o(),l({label:"camera.opaque-texture-down-sampling.title",info:"camera.opaque-texture-down-sampling.info",bindPath:"opaqueTextureDownsampling",type:s.Select,options:m(O,void 0,e=>b(`camera.opaque-texture-down-sampling.${e.toLowerCase()}`)),when:e=>e.opaqueTextureEnabled})],r.prototype,"opaqueTextureDownsampling",2);n([o(),l({label:"camera.anti-aliasing.title",info:"camera.anti-aliasing.info",bindPath:"antiAliasing",type:s.Select,options:m(x,void 0,e=>b(`camera.anti-aliasing.${e.toLowerCase()}`))})],r.prototype,"antiAliasing",2);n([o(),l({label:"camera.msaa-samples.title",info:"camera.msaa-samples.info",bindPath:"msaaSamples",type:s.Select,options:m(A,void 0,e=>b(`camera.msaa-samples.${e.toLowerCase()}`))})],r.prototype,"msaaSamples",2);n([o(),l({label:"camera.enable-hdr.title",info:"camera.enable-hdr.info",bindPath:"enableHDR",type:s.Toggle})],r.prototype,"enableHDR",2);n([o(),l({label:"camera.enable-post-process.title",info:"camera.enable-post-process.info",bindPath:"enablePostProcess",type:s.Toggle})],r.prototype,"enablePostProcess",2);n([o(),l({label:"camera.is-alpha-output-required.title",info:"camera.is-alpha-output-required.info",bindPath:"isAlphaOutputRequired",type:s.Toggle})],r.prototype,"isAlphaOutputRequired",2);n([l({label:"camera.render-target.title",type:s.AssetPicker,assetType:"RenderTarget",onChange:async(e,i,a)=>{var u;const p=e._lastRTAsset;p&&!a&&D(()=>{var f;p.thumbnailUrl="",(f=p.subAssets)==null||f.forEach(_=>{_.thumbnailUrl=""})}),e._lastRTAsset=a??null,e.renderTarget=a?a.getCurrentRef():null,await e.applyBoundPathChange("renderTarget",s.AssetPicker,e.renderTarget);const c=e.root.projectStore.currentViewport.previewManager;c.hasUserRT=!!a;const h=e.engineObject;a?(h.enabled=!0,a.updateThumbnail(),(u=a.subAssets)==null||u.forEach(f=>f.updateThumbnail())):c.isPreviewOn||(h.enabled=!1)}}),o()],r.prototype,"renderTarget",2);r=n([B({type:"Camera",componentsMenu:{label:"component.camera.title"}})],r);export{r as CameraComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as r}from"./index-
|
|
1
|
+
import{E as r}from"./index-c3dec278.js";function a(e){return function(n){e.class=n,e.componentsMenu={label:e.type,...e.componentsMenu},e.refMap=new Set,e.external=e.external??!1,r.registerComponent(e.type,e)}}export{a as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=Object.defineProperty;var y=(e,a,o)=>a in e?g(e,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[a]=o;var r=(e,a,o)=>(y(e,typeof a!="symbol"?a+"":a,o),o);import{i as f,e as m,p,C as i,t as b,s as l,v as c}from"./index-
|
|
1
|
+
var g=Object.defineProperty;var y=(e,a,o)=>a in e?g(e,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[a]=o;var r=(e,a,o)=>(y(e,typeof a!="symbol"?a+"":a,o),o);import{i as f,e as m,p,C as i,t as b,s as l,v as c}from"./index-c3dec278.js";import"./index-cdbb2f4d.js";import{c as P}from"./Component-0f881fc1.js";import"./postmen-2853c0e6.js";import{L as N}from"./LightBaseComponent-d651a276.js";var u=Object.defineProperty,S=Object.getOwnPropertyDescriptor,h=(e,a,o,n)=>{for(var t=n>1?void 0:n?S(a,o):a,d=e.length-1,w;d>=0;d--)(w=e[d])&&(t=(n?w(a,o,t):w(t))||t);return n&&t&&u(a,o,t),t};let s=class extends N{constructor(a,o){super(a,o);r(this,"shadowType",f.None);r(this,"shadowBias",1);r(this,"shadowNormalBias",1);r(this,"shadowNearPlaneOffset",.1);r(this,"shadowStrength",1);this.formSchema.addGroup(m("light.shadow.title"),["shadowType","shadowBias","shadowNormalBias","shadowNearPlaneOffset","shadowStrength"],{collapsible:!1})}};h([p({type:i.Select,options:b(f,void 0,e=>m(`light.shadow.type.${e.toLowerCase()}`)),bindPath:"shadowType",property:"shadowType",label:"light.shadow.type.label",info:"light.shadow.type.info"}),l(),c()],s.prototype,"shadowType",2);h([p({type:i.Number,bindPath:"shadowBias",property:"shadowBias",dragStep:.01,label:"light.shadow.bias.label",info:"light.shadow.bias.info"}),l()],s.prototype,"shadowBias",2);h([p({type:i.Number,bindPath:"shadowNormalBias",property:"shadowNormalBias",dragStep:.01,label:"light.shadow.normal-bias.label",info:"light.shadow.normal-bias.info"}),l()],s.prototype,"shadowNormalBias",2);h([p({type:i.Number,bindPath:"shadowNearPlaneOffset",property:"shadowNearPlaneOffset",dragStep:.01,label:"light.shadow.near-plane-offset.label",info:"light.shadow.near-plane-offset.info"}),l()],s.prototype,"shadowNearPlaneOffset",2);h([p({type:i.Slider,bindPath:"shadowStrength",property:"shadowStrength",min:0,max:1,dragStep:.01,label:"light.shadow.strength.label",info:"light.shadow.strength.info"}),l()],s.prototype,"shadowStrength",2);s=h([P({type:"DirectLight",componentsMenu:{group:"light",label:"component.light.direct.title"}})],s);export{s as DirectLightComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var d=Object.defineProperty;var u=(s,e,t)=>e in s?d(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var a=(s,e,t)=>(u(s,typeof e!="symbol"?e+"":e,t),t);import{bR as m,bY as b,bZ as y,b_ as h,bX as v,aJ as w,av as x,bS as O,O as f,j,Z as F,n as R,e as U,o as A}from"./index-
|
|
1
|
+
var d=Object.defineProperty;var u=(s,e,t)=>e in s?d(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var a=(s,e,t)=>(u(s,typeof e!="symbol"?e+"":e,t),t);import{bR as m,bY as b,bZ as y,b_ as h,bX as v,aJ as w,av as x,bS as O,O as f,j,Z as F,n as R,e as U,o as A}from"./index-c3dec278.js";import"./index-cdbb2f4d.js";import"./postmen-2853c0e6.js";import{A as g}from"./AssetViewer-3847c058.js";async function _(s){const e={uploadFiles:[],errors:[]};for(const t in s){const n=s[t],r=n.name.toLocaleLowerCase();(r.endsWith(".ttf")||r.endsWith(".otf")||r.endsWith(".woff"))&&e.uploadFiles.push({main:n})}return e}async function C(s){const e=m(s.main,"font.ttf");try{const t=e.name,n=b(t),r=y(t,n),o=await h.uploadBlob(`${t}.json`,e),i={fontName:r,fontUrl:encodeURI(o.url).replace(/\(/g,"%28").replace(/\)/g,"%29")};return new File([JSON.stringify(i)],r)}catch(t){console.error(t),v.error(`parse font file fail ${t}`)}return e}class p extends g{constructor(){super()}setViewAsset(e,t){const n=t.createChild("font_entity"),r=n.addComponent(f);r.font=e.engineObject,r.text=`ABCDEFGHIJKLM
|
|
2
2
|
NOPQRSTUVWXYZ
|
|
3
3
|
abcdefghijklm
|
|
4
4
|
nopqrstuvwxyz
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bB as d,aH as x,aP as v,aM as m,av as e,aw as f,ax as b,aI as l,bC as g,aL as i}from"./index-
|
|
1
|
+
import{bB as d,aH as x,aP as v,aM as m,av as e,aw as f,ax as b,aI as l,bC as g,aL as i}from"./index-c3dec278.js";import{A as j,a as I}from"./Accordion-2cd014f1.js";/**
|
|
2
2
|
* @license @tabler/icons-react v3.24.0 - MIT
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the MIT license.
|