/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{convertToSpatialReferenceUnit as e}from"../../../core/units.js";import{execute as t,executeMany as r}from"../gx/operatorGeneralize.js";import{getSpatialReference as n,fromGeometry as o,toGeometry as s,fromGeometries as a}from"../support/jsonConverter.js";function u(r,a,u={}){const{removeDegenerateParts:c=!1,unit:i}=u,m=n(r);i&&m&&(a=e(a,i,m));const p=o(r),f=t(p.getGeometry(),a,c);return null==f?null:s(f,p.getSpatialReference())}function c(t,o,u={}){const{removeDegenerateParts:c=!1,unit:i}=u,m=n(t);i&&m&&(o=e(o,i,m));const[p,f]=a(t);return r(p,o,c).map(e=>s(e,f))}export{u as execute,c as executeMany};
