import{e as o,i as r,g as a}from"./KHR_interactivity-DRPs30Rf.js";import{R as u}from"./declarationMapper-CGPHX8aB.js";import{R as p}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 c extends o{constructor(t){super(t),this.config=t,this.default=this._registerSignalOutput("default"),this._caseToOutputFlow=new Map,this.case=this.registerDataInput("case",u);const s=this.config.cases||[];for(const i of s)this._caseToOutputFlow.set(i,this._registerSignalOutput(`out_${i}`))}_execute(t,s){const i=this.case.getValue(t);let e;r(i)?e=this._getOutputFlowForCase(a(i)):e=this._getOutputFlowForCase(i),e?e._activateSignal(t):this.default._activateSignal(t)}addCase(t){this.config.cases.includes(t)||(this.config.cases.push(t),this._caseToOutputFlow.set(t,this._registerSignalOutput(`out_${t}`)))}removeCase(t){if(!this.config.cases.includes(t))return;const s=this.config.cases.indexOf(t);this.config.cases.splice(s,1),this._caseToOutputFlow.delete(t)}_getOutputFlowForCase(t){return this._caseToOutputFlow.get(t)}getClassName(){return"FlowGraphSwitchBlock"}serialize(t){super.serialize(t),t.cases=this.config.cases}}p("FlowGraphSwitchBlock",c);export{c as FlowGraphSwitchBlock};
