/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{deprecatedModule as e}from"../core/deprecate.js";import n from"../core/Logger.js";import{ensureClass as r}from"../core/accessorSupport/ensureType.js";import{assertNotMesh as t}from"./asserts.js";import{g as o}from"../chunks/geometryEngineBase.js";import i from"./SpatialReference.js";import{hydratedAdapter as u}from"./geometryAdapters/hydrated.js";function c(e){const n=Array.isArray(e)?e[0].spatialReference:e.spatialReference;return n?r(i,n):i.WGS84}function f(e){return o.extendedSpatialReferenceInfo(e)}function s(e,n){return t(e),o.clip(u,c(e),e,n)}function a(e,n){return t(e),o.cut(u,c(e),e,n)}function l(e,n){return t(e),t(n),o.contains(u,c(e),e,n)}function p(e,n){return t(e),t(n),o.crosses(u,c(e),e,n)}function m(e,n,r){return t(e),t(n),o.distance(u,c(e),e,n,r)}function g(e,n){return t(e),t(n),o.equals(u,c(e),e,n)}function d(e,n){return t(e),t(n),o.intersects(u,c(e),e,n)}function h(e,n){return t(e),t(n),o.touches(u,c(e),e,n)}function w(e,n){return t(e),t(n),o.within(u,c(e),e,n)}function y(e,n){return t(e),t(n),o.disjoint(u,c(e),e,n)}function R(e,n){return t(e),t(n),o.overlaps(u,c(e),e,n)}function x(e,n,r){return t(e),t(n),o.relate(u,c(e),e,n,r)}function S(e){return t(e),o.isSimple(u,c(e),e)}function j(e){return t(e),o.simplify(u,c(e),e)}function A(e,n=!1){return o.convexHull(u,c(e),e,n)}function E(e,n){return t(n),o.difference(u,c(e),e,n)}function L(e,n){return t(n),o.symmetricDifference(u,c(e),e,n)}function T(e,n){return t(n),o.intersect(u,c(e),e,n)}function D(e){return o.union(u,c(e),e)}function O(e,n,r,t,i,f){return o.offset(u,c(e),e,n,r,t,i,f)}function v(e,n,r,t=!1){return o.buffer(u,c(e),e,n,r,t)}function J(e,n,r,t,i,f){return o.geodesicBuffer(u,c(e),e,n,r,t,i,f)}function N(e,n,r=!0){return t(e),o.nearestCoordinate(u,c(e),e,n,r)}function V(e,n){return t(e),o.nearestVertex(u,c(e),e,n)}function z(e,n,r,i){return t(e),o.nearestVertices(u,c(e),e,n,r,i)}function B(e){return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?e.extent?.center??null:null}function G(e,n,r){if(null==e)throw new U;const t=e.spatialReference;if(null==(r=r??B(e)))throw new U;const i=e.constructor.fromJSON(o.rotate(e,n,r));return i.spatialReference=t,i}function H(e,n){if(null==e)throw new U;const r=e.spatialReference;if(null==(n=n??B(e)))throw new U;const t=e.constructor.fromJSON(o.flipHorizontal(e,n));return t.spatialReference=r,t}function I(e,n){if(null==e)throw new U;const r=e.spatialReference;if(null==(n=n??B(e)))throw new U;const t=e.constructor.fromJSON(o.flipVertical(e,n));return t.spatialReference=r,t}function P(e,n,r,i){return t(e),o.generalize(u,c(e),e,n,r,i)}function b(e,n,r){return t(e),o.densify(u,c(e),e,n,r)}function k(e,n,r,i=0){return t(e),o.geodesicDensify(u,c(e),e,n,r,i)}function q(e,n){return t(e),o.planarArea(u,c(e),e,n)}function C(e,n){return t(e),o.planarLength(u,c(e),e,n)}function W(e,n,r){return t(e),o.geodesicArea(u,c(e),e,n,r)}function F(e,n,r){return t(e),o.geodesicLength(u,c(e),e,n,r)}function K(e,n){return o.intersectLinesToPoints(u,c(e),e,n)}function M(e,n){o.changeDefaultSpatialReferenceTolerance(e,n)}function Q(e){o.clearDefaultSpatialReferenceTolerance(e)}e(n.getLogger("esri.geometry.geometryEngine"),"esri.geometry.geometryEngine",{see:"https://arcg.is/1PiGTm1",version:"4.32",warnOnce:!0});class U extends Error{constructor(){super("Illegal Argument Exception")}}export{v as buffer,M as changeDefaultSpatialReferenceTolerance,Q as clearDefaultSpatialReferenceTolerance,s as clip,l as contains,A as convexHull,p as crosses,a as cut,b as densify,E as difference,y as disjoint,m as distance,g as equals,f as extendedSpatialReferenceInfo,H as flipHorizontal,I as flipVertical,P as generalize,W as geodesicArea,J as geodesicBuffer,k as geodesicDensify,F as geodesicLength,T as intersect,K as intersectLinesToPoints,d as intersects,S as isSimple,N as nearestCoordinate,V as nearestVertex,z as nearestVertices,O as offset,R as overlaps,q as planarArea,C as planarLength,x as relate,G as rotate,j as simplify,L as symmetricDifference,h as touches,D as union,w as within};
