/* 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 p,cloneCurve as a,pathHasCurves as n}from"../../../../geometry/support/curves/curveUtils.js";function l({templatePart:l,shape:m,edits:f,relationships:h,mode:c}){if(!o(m))return;const u=[];let d=!1;for(const t of p(m)){const s=t.slice();e(t)||s.push(a(s[0])),d||=n(s),u.push(s)}if(u.length>0){const e=new i({...d?{curvePaths:u}:{paths:u},spatialReference:m.spatialReference,hasZ:m.hasZ,hasM:m.hasM}),o=s(e);for(const s of o){if("digitizing"===c&&f.length>r)break;t({templatePart:l,shape:s,edits:f,relationships:h,mode:c})}}}const m=!1;export{l as execute,m as isAsync};
