import{__decorate}from"tslib";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";import{activate}from"../../Hooks.js";import{inline}from"./tools.js";let SetLayerVisibility=class{execute(i,e,t){const a=validation.id("layerId",i.layerId,validation.never),o=validation.id("sublayerId",i.sublayerId,void 0),r=validation.boolean("visibility",i.visible),l=t.create();return inline(l.load(),function(){const e=l.findLayer(a);return void 0!==e&&null!==e?inline(e.load(),function(){if(void 0===o)return{wasVisible:e.getVisible(),nowVisible:e.setVisible(r)?r:void 0};const i=l.findLayer(o,e.layer);return void 0===i||null===i?{}:{wasVisible:i.getVisible(),nowVisible:i.setVisible(r)?r:void 0}}):{}})}};SetLayerVisibility.action="gcx:wf:arcgis::SetLayerVisibility",SetLayerVisibility.suite="gcx:wf:builtin",SetLayerVisibility=__decorate([activate(MapProvider)],SetLayerVisibility);export{SetLayerVisibility};