/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{makeFeatureFromGroupPart as e}from"./support/builderUtils.js";import{sameStartEndPoint as t,convertToTwoPoint as s}from"./support/shapeUtils.js";import{isPolygon as o,maxDigitizingDisplayEdits as r}from"../support/executorUtils.js";import i from"../../../../geometry/Polyline.js";import{getPaths as a,cloneCurve as p,pathHasCurves as n}from"../../../../geometry/support/curves/curveUtils.js";function l({templatePart:l,shape:m,edits:c,relationships:f,mode:h,xyTolerance:u,associationFeaturesByTemplate:d}){if(!o(m))return;const g=[];let y=!1;for(const e of a(m)){const s=e.slice();t(e)||s.push(p(s[0])),y||=n(s),g.push(s)}if(g.length>0){const t=new i({...y?{curvePaths:g}:{paths:g},spatialReference:m.spatialReference,hasZ:m.hasZ,hasM:m.hasM}),o=s(t);for(const s of o){if("digitizing"===h&&c.length>r)break;e({templatePart:l,shape:s,edits:c,relationships:f,mode:h,associationFeaturesByTemplate:d})}}}const m=!1;export{l as execute,m as isAsync};
