var y=Object.defineProperty;var j=(s,e,r)=>e in s?y(s,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[e]=r;var c=(s,e,r)=>(j(s,typeof e!="symbol"?e+"":e,r),r);import{aU as m,b7 as v,aV as b,aC as t,aD as S,aF as d,aG as f,aJ as g,aI as u,aX as k,aW as B,f as F,p as h,C as O,s as R}from"./index-a76b28be.js";import{u as I}from"./index-4d966268.js";import{c as E}from"./Component-c8533dc0.js";import"./postmen-a4b10828.js";import{c as M}from"./createOnModelChange-b57a0da8.js";import{M as _}from"./MaterialInspector-b9e7c829.js";import{M as z}from"./MeshRendererBaseComponent-817d34b7.js";import"./IconPointFilled-4673caaf.js";const x=m(v),C=m(({model:s,inspectorConfig:e,onModelChange:r})=>{const{disabled:n,property:o}=e,{t:l}=b();return t.jsxs(t.Fragment,{children:[t.jsx(S,{label:l(e.label),info:l(e.info),fieldCss:{minHeight:"$5"},children:t.jsx(d,{size:"sm",selectable:!0,code:!0,children:null})}),t.jsx(x,{label:"        ",disabled:n,value:s[o].min,onChange:a=>{r==null||r(o,{...s[o],min:a})},formEndSlot:t.jsx(d,{size:"sm",selectable:!0,code:!0,children:l("skinned-mesh-renderer.local-bounds.min.label")})}),t.jsx(x,{label:"        ",disabled:n,value:s[o].max,onChange:a=>{r==null||r(o,{...s[o],max:a})},formEndSlot:t.jsx(d,{size:"sm",selectable:!0,code:!0,children:l("skinned-mesh-renderer.local-bounds.max.label")})})]})}),P=f("div",{marginLeft:"5px"}),T=f(g,{border:"1px solid $gray6",borderRadius:"$2",padding:"$0_5",color:"$gray11",cursor:"pointer"}),$=m(function(s){const e=s.data,{t:r}=b();return t.jsxs(T,{align:"v",children:[t.jsx("img",{src:e.thumbnailUrl,alt:"Material Thumbnail",width:"20px",height:"20px"}),t.jsxs(P,{children:[r("skinned-mesh-renderer.material.label"),"(",e.name,")"]})]})}),V=m(function(s){const[e,r]=u.useState(null),n=s.data,{assetStore:o,inspectorFacade:l}=I();return u.useEffect(()=>{o.getAssetByRef(n.material).then(a=>{r(a)})},[n.material]),t.jsxs(t.Fragment,{children:[t.jsx(k.List,{model:n,configs:n.formSchema.items,onModelChange:M("component",n.id,l,n)}),e&&t.jsx(B,{nesting:!0,title:t.jsx($,{data:e}),open:n.materialOpen,onOpenChange:a=>{n.setMaterialOpen(a)},children:t.jsx(_,{asset:e})})]})});var w=Object.defineProperty,D=Object.getOwnPropertyDescriptor,p=(s,e,r,n)=>{for(var o=n>1?void 0:n?D(e,r):e,l=s.length-1,a;l>=0;l--)(a=s[l])&&(o=(n?a(e,r,o):a(o))||o);return n&&o&&w(e,r,o),o};let i=class extends z{constructor(e,r){super(e,r);c(this,"rootBone",null);c(this,"localBounds",{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}})}};p([F({getEngineValue:s=>{var e;return(e=s.skin)==null?void 0:e.rootBone}}),h({label:"skinned-mesh-renderer.skin.root-bone.label",info:"skinned-mesh-renderer.skin.root-bone.info",type:O.EntityPicker,disabled:!0})],i.prototype,"rootBone",2);p([h({label:"skinned-mesh-renderer.local-bounds.title",info:"skinned-mesh-renderer.local-bounds.info",customComponent:C,type:"BoundingBox"}),R()],i.prototype,"localBounds",2);i=p([E({type:"SkinnedMeshRenderer",customInspector:V,componentsMenu:{label:"component.renderer.skinned-mesh.title"}})],i);export{i as SkinnedMeshRendererComponent};
