/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{O as t}from"./OperatorProximity.js";import{convertFromSpatialReferenceUnit as e,convertToSpatialReferenceUnit as r}from"../core/units.js";import{fromGeometry as s,fromPoint as o,getSpatialReference as n}from"../geometry/operators/support/apiConverter.js";import{toProximityResult as i}from"../geometry/operators/support/proximityResult.js";const a=new t;function c(t,r,c={}){const{calculateLeftRightSide:m=!1,testPolygonInterior:p=!0,unit:u}=c,g=a.getNearestCoordinate(s(t),o(r).getXY(),p,m);if(u&&g.m_distance){const r=n(t);g.m_distance=e(g.m_distance,r,u)}return i(g,t,m)}function m(t,r,c={}){const{unit:m}=c,p=a.getNearestVertex(s(t),o(r).getXY());if(m&&p.m_distance){const r=n(t);p.m_distance=e(p.m_distance,r,m)}return i(p,t)}function p(t,c,m,p,u={}){const{unit:g}=u,d=n(t);return g&&m&&(m=r(m,g,d)),a.getNearestVertices(s(t),o(c).getXY(),m,p).map(r=>(g&&r.m_distance&&(r.m_distance=e(r.m_distance,d,g)),i(r,t)))}const u=a.supportsCurves(),g=Object.freeze(Object.defineProperty({__proto__:null,getNearestCoordinate:c,getNearestVertex:m,getNearestVertices:p,supportsCurves:u},Symbol.toStringTag,{value:"Module"}));export{m as a,p as b,c as g,g as p,u as s};
