import{b as n}from"./KHR_interactivity-DRPs30Rf.js";import{R as r}from"./index-6jOCfdig.js";import{i as a,F as o}from"./declarationMapper-CGPHX8aB.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 n{constructor(i){super(i),this.config=i,this.inFlows=[],this._cachedActivationState=[],this.reset=this._registerSignalInput("reset"),this.completed=this._registerSignalOutput("completed"),this.remainingInputs=this.registerDataOutput("remainingInputs",a,new o(this.config.inputSignalCount||0));for(let e=0;e<this.config.inputSignalCount;e++)this.inFlows.push(this._registerSignalInput(`in_${e}`));this._unregisterSignalInput("in")}_getCurrentActivationState(i){const e=this._cachedActivationState;if(e.length=0,i._hasExecutionVariable(this,"activationState")){const s=i._getExecutionVariable(this,"activationState",[]);for(let t=0;t<s.length;t++)e.push(s[t])}else for(let s=0;s<this.config.inputSignalCount;s++)e.push(!1);return e}_execute(i,e){const s=this._getCurrentActivationState(i);if(e===this.reset)for(let t=0;t<this.config.inputSignalCount;t++)s[t]=!1;else{const t=this.inFlows.indexOf(e);t>=0&&(s[t]=!0)}if(this.remainingInputs.setValue(new o(s.filter(t=>!t).length),i),i._setExecutionVariable(this,"activationState",s.slice()),s.includes(!1))e!==this.reset&&this.out._activateSignal(i);else{this.completed._activateSignal(i);for(let t=0;t<this.config.inputSignalCount;t++)s[t]=!1}}getClassName(){return"FlowGraphWaitAllBlock"}serialize(i){super.serialize(i),i.config.inputFlows=this.config.inputSignalCount}}r("FlowGraphWaitAllBlock",l);export{l as FlowGraphWaitAllBlock};
