/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{ignoreAbortErrors as t}from"../../core/promiseUtils.js";import{WorkerHandle as e}from"../../core/workers/WorkerHandle.js";import o from"../../geometry/Point.js";class n extends e{constructor(){super("MeasurementWorker","geodeticArea",{},void 0,{strategy:"distributed"})}async geodeticArea(t,e,n){const i=t.toJSON(),{area:r,centroid:a,length:s}=await this.invokeMethod("geodeticArea",{geometryJSON:i,options:{...e,stagedPoint:e?.stagedPoint?.toJSON()}},n);return{area:r,centroid:a?o.fromJSON(a):void 0,length:s}}geodeticLength(t,e,o){const n=t.toJSON();return this.invokeMethod("geodeticLength",{geometryJSON:n,options:{...e,stagedPoint:e?.stagedPoint?.toJSON()}},o)}geodeticDistanceBetweenPoints(t,e,o,n){const i=t.toJSON(),r=e.toJSON();return this.invokeMethod("geodeticDistanceBetweenPoints",{geometry1JSON:i,geometry2JSON:r,options:o},n)}preloadGeodetic(){t(this.broadcast(void 0,"preloadGeodetic"))}async area2D(t,e,n){const i=t.toJSON(),{area:r,centroid:a,length:s}=await this.invokeMethod("area2D",{geometryJSON:i,options:{...e,stagedPoint:e?.stagedPoint?.toJSON()}},n);return{area:r,centroid:a?o.fromJSON(a):void 0,length:s}}length2D(t,e,o){const n=t.toJSON();return this.invokeMethod("length2D",{geometryJSON:n,options:{...e,stagedPoint:e?.stagedPoint?.toJSON()}},o)}distance2DBetweenPoints(t,e,o,n){const i=t.toJSON(),r=e.toJSON();return this.invokeMethod("distance2DBetweenPoints",{geometry1JSON:i,geometry2JSON:r,options:o},n)}async areaHorizontal(t,e,n){const i=t.toJSON(),{area:r,centroid:a,length:s}=await this.invokeMethod("areaHorizontal",{geometryJSON:i,options:{...e,stagedPoint:e?.stagedPoint?.toJSON()}},n);return{area:r,centroid:a?o.fromJSON(a):void 0,length:s}}async autoArea2D(t,e,n){const i=t.toJSON(),{area:r,centroid:a,length:s}=await this.invokeMethod("autoArea2D",{geometryJSON:i,options:{...e,stagedPoint:e?.stagedPoint?.toJSON()}},n);return{area:r,centroid:a?o.fromJSON(a):void 0,length:s}}async autoLength2D(t,e,o){const n=t.toJSON();return this.invokeMethod("autoLength2D",{geometryJSON:n,options:{...e,stagedPoint:e?.stagedPoint?.toJSON()}},o)}autoDistance2DBetweenPoints(t,e,o,n){const i=t.toJSON(),r=e.toJSON();return this.invokeMethod("autoDistance2DBetweenPoints",{geometry1JSON:i,geometry2JSON:r,options:o},n)}autoSize2D(t,e,o,n,i,r){const a=t.toJSON(),s=e.toJSON(),d=o.toJSON(),g=n.toJSON();return this.invokeMethod("autoSize2D",{topLeftJSON:a,topRightJSON:s,bottomRightJSON:d,bottomLeftJSON:g,options:i},r)}}export{n as MeasurementWorkerHandle};
