/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{makeFeatureFromGroupPart as t}from"./support/builderUtils.js";import{sameStartEndPoint as e,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,associationFeaturesByTemplate:u}){if(!o(m))return;const d=[];let g=!1;for(const t of a(m)){const s=t.slice();e(t)||s.push(p(s[0])),g||=n(s),d.push(s)}if(d.length>0){const e=new i({...g?{curvePaths:d}:{paths:d},spatialReference:m.spatialReference,hasZ:m.hasZ,hasM:m.hasM}),o=s(e);for(const s of o){if("digitizing"===h&&c.length>r)break;t({templatePart:l,shape:s,edits:c,relationships:f,mode:h,associationFeaturesByTemplate:u})}}}const m=!1;export{l as execute,m as isAsync};
