/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{getOrCreateMapValue as e}from"../../../../core/MapUtils.js";import t from"../../../../geometry/Extent.js";const n=100;function o(e){return"point"===e.type}function r(e){return"polygon"===e.type}function i(e){return"polyline"===e.type}function l(e){return!!e&&"radial"===e.type}function a(e){let n=null;for(const r of e)if(r.graphic.geometry){const e=r.graphic.geometry,i=o(e)?new t({spatialReference:e.spatialReference,xmin:e.x,xmax:e.x,ymax:e.y,ymin:e.y}):e.extent;n=null==n?i?.clone():n.union(i.extent)}return n}function c(t){const n=new Map;for(const o of t)e(n,o.id,()=>({addFeatures:[],id:o.id,identifierFields:{globalIdField:o.layer.globalIdField,objectIdField:o.layer.objectIdField}})).addFeatures?.push(o.graphic);return[...n.values()]}export{a as calculateExtent,c as groupEditsByLayer,o as isPoint,r as isPolygon,i as isPolyline,l as isRadial,n as maxDigitizingDisplayEdits};
