/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{getRingsOrPathsBounds as n,getPointsBounds as i}from"./boundsUtils.js";function t(n){return void 0!==n.xmin&&void 0!==n.ymin&&void 0!==n.xmax&&void 0!==n.ymax}function u(n){return void 0!==n.points}function r(n){return void 0!==n.x&&void 0!==n.y}function m(n){return void 0!==n.paths}function o(n){return void 0!==n.rings}const x=[];function a(n,i,t,u){return{xmin:n,ymin:i,xmax:t,ymax:u}}function c(n,i,t,u,r,m){return{xmin:n,ymin:i,zmin:t,xmax:u,ymax:r,zmax:m}}function s(n,i,t,u,r,m){return{xmin:n,ymin:i,mmin:t,xmax:u,ymax:r,mmax:m}}function e(n,i,t,u,r,m,o,x){return{xmin:n,ymin:i,zmin:t,mmin:u,xmax:r,ymax:m,zmax:o,mmax:x}}function f(n,i=!1,t=!1){return i?t?e(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]):c(n[0],n[1],n[2],n[3],n[4],n[5]):t?s(n[0],n[1],n[2],n[3],n[4],n[5]):a(n[0],n[1],n[2],n[3])}function l(n){return n?t(n)?n:r(n)?v(n):o(n)?d(n):m(n)?h(n):u(n)?y(n):null:null}function y(n){const{hasZ:t,hasM:u,points:r}=n,m=i(x,r,t??!1,u??!1,t??!1,u??!1);return m?f(m,t,u):null}function v(n){const{x:i,y:t,z:u,m:r}=n,m=null!=r;return null!=u?m?e(i,t,u,r,i,t,u,r):c(i,t,u,i,t,u):m?s(i,t,r,i,t,r):a(i,t,i,t)}function d(i){const{hasZ:t,hasM:u,rings:r,curveRings:m}=i,o=n(x,m??r,t??!1,u??!1);return o?f(o,t,u):null}function h(i){const{hasZ:t,hasM:u,paths:r,curvePaths:m}=i,o=n(x,m??r,t??!1,u??!1);return o?f(o,t,u):null}export{l as getGeometryExtent,y as getMultipointExtent,v as getPointExtent,d as getPolygonExtent,h as getPolylineExtent};
