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