/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import e from"../Extent.js";import{getExtentForScale as n}from"./scaleUtils.js";async function t(e,n){if(e.hasZ||"2d"===n.type)return e;const t=n.map?.ground;return t?.layers.length?(await t.queryElevation(e,{cache:n.basemapTerrain?.elevationQueryCache})).geometry:e}function r(e,n,t){return i(e.center,n,t)}function i(t,r,i){const a=t.hasZ?t.z:void 0;if(r?.map){return(null!=i?n(r,i):r.extent).clone().centerAt(t).set({zmax:a,zmin:a})}const{x:o,y:c,spatialReference:u}=t;return new e({xmin:o-.25,ymin:c-.25,xmax:o+.25,ymax:c+.25,spatialReference:u,zmin:a,zmax:a})}function a(e,n,t,r){switch(e?.type){case"extent":return e;case"polygon":case"polyline":case"multipoint":return e.extent??void 0;case"point":return i(r.execute(e),n??void 0,t??void 0);default:return}}function o(e){return e?u:c}function c(e,n){return e[0]===n[0]&&e[1]===n[1]}function u(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}export{c as coordinate2DEquals,u as coordinate3DEquals,i as createExtentFromPoint,o as getCoordinateEquals,a as getExtentFromGeometry,t as getPointWithElevation,r as scaleExtent};
