class ForEach{execute(o,e){var t=o.exit;let i=e.state;if(!1!==t&&null!=t)return{looping:!1,count:i&&i.length||0};if(void 0===i){e.persist(i=[]);const r=o.items;if(void 0!==r&&null!==r){let o=0;if(Array.isArray(r))for(const s of r)i.push({looping:!0,pass:o++,item:s});else if(isIterable(r)){const l=r[Symbol.iterator]();for(;;){var n=l.next();if(n.done)break;i.push({looping:!0,pass:o++,item:n.value})}}else for(const a in r)i.push({looping:!0,key:a,pass:o++,item:r[a]})}}if(e.passes<i.length){e.call("loop");const c=i[e.passes];return c.count=i.length,c}return{looping:!1,count:i.length}}}function isIterable(o){return!(!o||!Symbol||"function"!=typeof o[Symbol.iterator])}ForEach.action="gcx:wf:core:loop:ForEach",ForEach.suite="gcx:wf:builtin";export{ForEach};