var p=Object.defineProperty;var h=(r,t,n)=>t in r?p(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var m=(r,t,n)=>(h(r,typeof t!="symbol"?t+"":t,n),n);import{aC as l,e as s}from"./index-03b6134d.js";import"./index-0a53aaef.js";import{c as u}from"./Component-3cb422ab.js";import"./postmen-9e6354af.js";import{T}from"./TransformBaseComponent-ca2fa45d.js";var d=Object.defineProperty,g=Object.getOwnPropertyDescriptor,f=(r,t,n,o)=>{for(var e=o>1?void 0:o?g(t,n):t,i=r.length-1,a;i>=0;i--)(a=r[i])&&(e=(o?a(t,n,e):a(e))||e);return o&&e&&d(t,n,e),e};let c=class extends T{constructor(t,n){super(t,n);m(this,"syncEngineToEditor",l(()=>{const{position:t,rotation:n,scale:o}=this.engineObject;this._syncTransformToEditor("position",t),this._syncTransformToEditor("rotation",n),this._syncTransformToEditor("scale",o)}))}syncRotation(){this._syncTransformToEditor("rotation",this.engineObject.rotation)}checkCanDisable(){return{code:1,msg:s("transform.error.cant-disable")}}checkCanDeletable(){return{code:1,msg:s("transform.error.cant-delete")}}get ignoreToJSON(){return!0}onAddToEntity(t){for(let n=0;n<t.components.length;n++){const o=t.components[n];(o.type==="Transform"||o.type==="UITransform")&&o!==this&&t.removeComponent(o)}t.setComponentIndex(this,0)}getAnimatableProperties(){let t=[];const n=o=>{if(!(o!=null&&o.length))return t;o.filter(e=>!e.when||e.when(this)).forEach(e=>{e.type==="Group"?n(e.children):t.push({property:e.property,label:s(e.label),type:e.type})})};return n(this.formSchema.items),t=t.concat(this._additionAnimatableProperties),t}};f([l],c.prototype,"syncRotation",1);c=f([u({type:"Transform",componentsMenu:{hide:!0,label:s("component.transform.title")}})],c);export{c as TransformComponent};
