define(["require","exports","tslib","../../Errors","./MapProvider","../../Hooks","../../Validation"],function(e,t,p,l,r,n,m){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=((i=a).prototype.execute=function(c,s,u){return p.__awaiter(this,void 0,void 0,function(){var t,r,n,i,a,o;return p.__generator(this,function(e){switch(e.label){case 0:if(t=m.validation.string("mapName",c.mapName,m.validation.never),(r=m.validation.number("scale",c.scale,void 0))<=0)throw new l.ActivityInputError("scale","Scale must be greater than zero.");return[4,(n=u.create()).load()];case 1:if(e.sent(),!n.map)throw new l.GenericActivityError("No map available. Unable to generate webmap parameters.");return i=r||n.getScale(),a=c.extent||n.getExtent(),[4,this.getWebmap(n,i,s.ambient.trivia)];case 2:return o=e.sent(),[4,this.getWgs84Extent(a)];case 3:return[2,{result:{extent:e.sent(),mapName:t,scale:r||0,webmap:o}}]}})})},a.prototype.getWebmap=function(e,t,r){return p.__awaiter(this,void 0,void 0,function(){return p.__generator(this,function(e){throw console.warn("getWebmap needs to be overridden by a client implementation."),new l.ActivityNotImplementedError(i.action)})})},a.prototype.getWgs84Extent=function(e){return p.__awaiter(this,void 0,void 0,function(){return p.__generator(this,function(e){throw console.warn("getWgs84Extent needs to be overridden by a client implementation."),new l.ActivityNotImplementedError(i.action)})})},a.action="gcx:wf:geocortex::GenerateWebmapForReport",a.suite="gcx:wf:builtin",i=p.__decorate([n.activate(r.MapProvider)],a));function a(){}t.GenerateWebmapForReport=r});