import{__decorate}from"tslib";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";import{activate}from"../../Hooks.js";import{inline,featuresToArray}from"./tools.js";let SetViewExtent=class{execute(t,e,o){const r=validation.number("scale",t.scale,void 0);let i=validation.array("geometry",t.geometry,[]);const n=featuresToArray(t.features);i=[...i,...n.map(t=>t.geometry)];const a=o.create();return inline(a.load(),function(){const t=a.getExtent(),e=a.getScale();return a.setExtent(i,r).then(function(){return{oldExtent:t,oldScale:e,newExtent:a.getExtent(),newScale:a.getScale()}})})}};SetViewExtent.action="gcx:wf:arcgis::SetViewExtent",SetViewExtent.suite="gcx:wf:builtin",SetViewExtent=__decorate([activate(MapProvider)],SetViewExtent);export{SetViewExtent};