/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import e from"../../request.js";import{getJsonType as t}from"../../geometry/support/jsonTypeUtils.js";import{fromJSON as r}from"../../geometry/support/jsonUtils.js";import{srToRESTValue as s}from"../../geometry/support/spatialReferenceUtils.js";import{parseUrl as o}from"../utils.js";async function i(i,p,n,m){const a=o(i),u=p[0].spatialReference,f={...m,responseType:"json",query:{...a.query,f:"json",sr:s(u),target:JSON.stringify({geometryType:t(p[0]),geometries:p}),cutter:JSON.stringify(n)}},y=await e(a.path+"/cut",f),{cutIndexes:c,geometries:g=[]}=y.data;return{cutIndexes:c,geometries:g.map(e=>{const t=r(e);return t.spatialReference=u,t})}}export{i as cut};
