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