import Bluebird from"../../deps/bluebird_fork.js";import{validation}from"../../Validation.js";import{inline}from"./tools.js";import{intersect}from"@arcgis/core/geometry/geometryEngineAsync";class IntersectEngineTask{execute(e){var r=validation.array("geometry1",e.geometry1,validation.never);const t=[];for(const i of validation.array("geometry2",e.geometry2,validation.never)){var n=intersect(r,i);t.push(n)}return inline(Bluebird.all(t),function(e){const r=[];for(const t of e)r.push(...t);return{geometry:r[0],results:r}})}}IntersectEngineTask.action="gcx:wf:arcgis::IntersectEngineTask",IntersectEngineTask.suite="gcx:wf:builtin";export{IntersectEngineTask};