import{b as p,g as t}from"./KHR_interactivity-BtMudStn.js";import{R as o,b as h,i as u,F as r}from"./declarationMapper-Lanf6XPr.js";import{R as d}from"./index-CDrXokXW.js";import"./index-DWyDLubb.js";import"./objectModelMapping-CGWnurZP.js";class s extends p{constructor(e){super(e),this.startIndex=this.registerDataInput("startIndex",o,0),this.endIndex=this.registerDataInput("endIndex",o),this.step=this.registerDataInput("step",h,1),this.index=this.registerDataOutput("index",u,new r(t(e?.initialIndex??0))),this.executionFlow=this._registerSignalOutput("executionFlow"),this.completed=this._registerSignalOutput("completed"),this._unregisterSignalOutput("out")}_execute(e){const l=t(this.startIndex.getValue(e)),a=this.step.getValue(e);let n=t(this.endIndex.getValue(e));for(let i=l;i<n&&(this.index.setValue(new r(i),e),this.executionFlow._activateSignal(e),n=t(this.endIndex.getValue(e)),!(i>s.MaxLoopIterations*a));i+=a);this.config?.incrementIndexWhenLoopDone&&this.index.setValue(new r(t(this.index.getValue(e))+a),e),this.completed._activateSignal(e)}getClassName(){return"FlowGraphForLoopBlock"}}s.MaxLoopIterations=1e3;d("FlowGraphForLoopBlock",s);export{s as FlowGraphForLoopBlock};
