import{b as u}from"./KHR_interactivity-DRPs30Rf.js";import{R as a}from"./declarationMapper-CGPHX8aB.js";import{R as m}from"./index-6jOCfdig.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";class l extends u{constructor(t){super(t),this.config=t,this.object=this.registerDataInput("object",a,t.target),this.value=this.registerDataInput("value",a),this.propertyName=this.registerDataInput("propertyName",a,t.propertyName),this.customSetFunction=this.registerDataInput("customSetFunction",a)}_execute(t,s){try{const o=this.object.getValue(t),i=this.value.getValue(t),r=this.propertyName.getValue(t);this._stopRunningAnimations(t,o,r);const e=this.customSetFunction.getValue(t);e?e(o,r,i,t):this._setPropertyValue(o,r,i)}catch(o){this._reportError(t,o)}this.out._activateSignal(t)}_stopRunningAnimations(t,s,o){const i=t._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);for(const r of i){const e=t.assetsContext.animationGroups.find(n=>n.uniqueId===r);if(e){for(const n of e.targetedAnimations)if(n.target===s&&n.animation.targetProperty===o){e.stop(!0),e.dispose();const p=i.indexOf(r);p!==-1&&(i.splice(p,1),t._setGlobalContextVariable("currentlyRunningAnimationGroups",i))}}}}_setPropertyValue(t,s,o){const i=s.split(".");let r=t;for(let e=0;e<i.length-1;e++){const n=i[e];r[n]===void 0&&(r[n]={}),r=r[n]}r[i[i.length-1]]=o}getClassName(){return"FlowGraphSetPropertyBlock"}}m("FlowGraphSetPropertyBlock",l);export{l as FlowGraphSetPropertyBlock};
