import{F as M}from"./KHR_interactivity-DRPs30Rf.js";import{e as p,f as g,h as w,c as T,g as e,b as k}from"./declarationMapper-CGPHX8aB.js";import{M as d,V as n,Q as x,R as r}from"./index-6jOCfdig.js";import{F as V}from"./flowGraphUnaryOperationBlock-Mpr5Q1uH.js";import{F as D}from"./flowGraphBinaryOperationBlock-CkEUr9tO.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_svelte.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_client.js";import"./svelte/svelte_internal_flags_async.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_store.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";import"./objectModelMapping-DT0r674A.js";import"./flowGraphCachedOperationBlock-DGfksfbT.js";class b extends V{constructor(t){super(e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),i=>i.transpose?i.transpose():d.Transpose(i),"FlowGraphTransposeBlock",t)}}r("FlowGraphTransposeBlock",b);class E extends V{constructor(t){super(e(t?.matrixType||"Matrix"),k,i=>i.determinant(),"FlowGraphDeterminantBlock",t)}}r("FlowGraphDeterminantBlock",E);class _ extends V{constructor(t){super(e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),i=>i.inverse?i.inverse():d.Invert(i),"FlowGraphInvertMatrixBlock",t)}}r("FlowGraphInvertMatrixBlock",_);class v extends D{constructor(t){super(e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),e(t?.matrixType||"Matrix"),(i,a)=>a.multiply(i),"FlowGraphMatrixMultiplicationBlock",t)}}r("FlowGraphMatrixMultiplicationBlock",v);class Q extends M{constructor(t){super(t),this.input=this.registerDataInput("input",w),this.position=this.registerDataOutput("position",p),this.rotationQuaternion=this.registerDataOutput("rotationQuaternion",g),this.scaling=this.registerDataOutput("scaling",p),this.isValid=this.registerDataOutput("isValid",T,!1)}_updateOutputs(t){const i=t._getExecutionVariable(this,"executionId",-1),a=t._getExecutionVariable(this,"cachedPosition",null),s=t._getExecutionVariable(this,"cachedRotation",null),u=t._getExecutionVariable(this,"cachedScaling",null);if(i===t.executionId&&a&&s&&u)this.position.setValue(a,t),this.rotationQuaternion.setValue(s,t),this.scaling.setValue(u,t);else{const l=this.input.getValue(t),h=a||new n,c=s||new x,m=u||new n,F=Math.round(l.m[3]*1e4)/1e4,G=Math.round(l.m[7]*1e4)/1e4,y=Math.round(l.m[11]*1e4)/1e4,B=Math.round(l.m[15]*1e4)/1e4;if(F!==0||G!==0||y!==0||B!==1){this.isValid.setValue(!1,t),this.position.setValue(n.Zero(),t),this.rotationQuaternion.setValue(x.Identity(),t),this.scaling.setValue(n.One(),t);return}const I=l.decompose(m,c,h);this.isValid.setValue(I,t),this.position.setValue(h,t),this.rotationQuaternion.setValue(c,t),this.scaling.setValue(m,t),t._setExecutionVariable(this,"cachedPosition",h),t._setExecutionVariable(this,"cachedRotation",c),t._setExecutionVariable(this,"cachedScaling",m),t._setExecutionVariable(this,"executionId",t.executionId)}}getClassName(){return"FlowGraphMatrixDecompose"}}r("FlowGraphMatrixDecompose",Q);class R extends M{constructor(t){super(t),this.position=this.registerDataInput("position",p),this.rotationQuaternion=this.registerDataInput("rotationQuaternion",g),this.scaling=this.registerDataInput("scaling",p),this.value=this.registerDataOutput("value",w)}_updateOutputs(t){const i=t._getExecutionVariable(this,"executionId",-1),a=t._getExecutionVariable(this,"cachedMatrix",null);if(i===t.executionId&&a)this.value.setValue(a,t);else{const s=d.Compose(this.scaling.getValue(t),this.rotationQuaternion.getValue(t),this.position.getValue(t));this.value.setValue(s,t),t._setExecutionVariable(this,"cachedMatrix",s),t._setExecutionVariable(this,"executionId",t.executionId)}}getClassName(){return"FlowGraphMatrixCompose"}}r("FlowGraphMatrixCompose",R);export{E as FlowGraphDeterminantBlock,_ as FlowGraphInvertMatrixBlock,R as FlowGraphMatrixComposeBlock,Q as FlowGraphMatrixDecomposeBlock,v as FlowGraphMatrixMultiplicationBlock,b as FlowGraphTransposeBlock};
