import{validation}from"../../Validation.js";function loopExit(){return{looping:!1}}function loopNext(o,i){return o.call("loop"),{looping:!0,pass:o.passes,item:i}}class Loop{execute(o,i){var t=validation.number("count",o.count,0),l=validation.number("limit",o.limit,1e3),n=validation.array("collections",o.collection,void 0),e=i.passes,p=o.exit;if(void 0!==p&&p)return loopExit();o=o.loop;return void 0!==o&&!o||l<=e?loopExit():void 0!==n?e>=n.length?loopExit():loopNext(i,n[e]):e<t||void 0!==p&&!p||void 0!==o&&o?loopNext(i):loopExit()}}Loop.action="gcx:wf:core:loop:Loop",Loop.suite="gcx:wf:builtin";export{Loop};