import{F as u,g as i,i as r}from"./KHR_interactivity-BtMudStn.js";import{R as a}from"./declarationMapper-Lanf6XPr.js";import{R as l}from"./index-CDrXokXW.js";import"./index-DWyDLubb.js";import"./objectModelMapping-CGWnurZP.js";class h extends u{constructor(e){super(e),this.config=e,this._inputCases=new Map,this.case=this.registerDataInput("case",a,NaN),this.default=this.registerDataInput("default",a),this.value=this.registerDataOutput("value",a);const s=this.config.cases||[];for(let t of s){if(t=i(t),this.config.treatCasesAsIntegers&&(t=t|0,this._inputCases.has(t)))return;this._inputCases.set(t,this.registerDataInput(`in_${t}`,a))}}_updateOutputs(e){const s=this.case.getValue(e);let t;r(s)&&(t=this._getOutputValueForCase(i(s),e)),t||(t=this.default.getValue(e)),this.value.setValue(t,e)}_getOutputValueForCase(e,s){return this._inputCases.get(e)?.getValue(s)}getClassName(){return"FlowGraphDataSwitchBlock"}}l("FlowGraphDataSwitchBlock",h);export{h as FlowGraphDataSwitchBlock};
