import SpatialReference from"@arcgis/core/geometry/SpatialReference";import{validation}from"../../Validation.js";import{inline,isAbortable,schedulePromiseCancellation}from"./tools.js";import GeometryService from"@arcgis/core/tasks/GeometryService";class FromGeoCoordinateStringServiceTask{execute(e,o){var i=validation.string("url",e.url,validation.never),r=validation.array("strings",e.strings,validation.never),n=validation.exists("spatialReference",e.spatialReference),t=validation.string("conversionType",e.conversionType,validation.never);let a="object"==typeof n?n:void 0;"number"==typeof n&&(a=new SpatialReference({wkid:n})),"string"==typeof n&&(a=new SpatialReference({wkt:n}));const s={strings:r,sr:a,conversionType:t};null!==e.conversionMode&&void 0!==e.conversionMode&&(s.conversionMode=e.conversionMode);const c=new GeometryService(i);i=isAbortable(o.cancellationToken)?{signal:o.cancellationToken.signal}:void 0,i=c.fromGeoCoordinateString(s,i);return schedulePromiseCancellation(o,i),inline(i,function(e){return{coordinates:e}})}}FromGeoCoordinateStringServiceTask.action="gcx:wf:arcgis::FromGeoCoordinateStringServiceTask",FromGeoCoordinateStringServiceTask.suite="gcx:wf:builtin";export{FromGeoCoordinateStringServiceTask};