define(["require","exports","tslib","../../Validation","./tools","./MapProvider","../../Hooks"],function(e,t,i,x,g,a,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});o.prototype.execute=function(e,t,i){var a=x.validation.string("url",e.url,x.validation.never),a=g.addToPath(a,"findAddressCandidates"),n=x.validation.number("timeout",e.timeout,void 0),o=x.validation.number("maxLocations",e.maxLocations,void 0),r=x.validation.exists("outFields",e.outFields,"*"),s=x.validation.exists("searchExtent",e.searchExtent,void 0),d=x.validation.exists("location",e.location,void 0),c=x.validation.number("distance",e.distance,void 0),l=e.address,u={maxLocations:o,singleLine:"string"==typeof l?l:void 0,outSR:i.getOutSR(e.outSpatialReference),outFields:r instanceof Array?r.toString():r,searchExtent:s instanceof Array?s.toString():s,location:d instanceof Array?d.toString():d,distance:c};if("object"==typeof l&&null!==l)for(var v in l){var f=l[v];"string"==typeof f&&(u[v]=f)}n=g.fetch(a,u,n,t.cancellationToken.signal);return g.schedulePromiseCancellation(t,n),g.inline(n,function(e){var t=e.candidates;return{candidate:t[0],candidates:t,spatialReference:e.spatialReference}})},o.action="gcx:wf:arcgis::Geocode",o.suite="gcx:wf:builtin",a=i.__decorate([n.activate(a.MapProvider)],o);function o(){}t.Geocode=a});