import{__decorate as e}from"tslib";import{serializable as r}from"../support/Serializable.js";import{ArcGISSublayerExtension as s}from"./ArcGISSublayerExtension.js";import{SublayerExtension as a}from"./_SublayerExtension.js";let t=class extends s{get layerExtension(){return super.layerExtension}get sublayerExtensions(){return super.sublayerExtensions}get canChangeOpacity(){const e=this.layerExtension.layer.capabilities;return!(this.sublayerExtensions.length>0)&&e?.exportMap.supportsDynamicLayers}get canChangeRenderer(){const e=this.layerExtension.layer.capabilities;return e?.exportMap.supportsDynamicLayers}get canChangeLabels(){const e=this.layerExtension.layer?.capabilities,r=!!e?.exportMap.supportsDynamicLayers,s=this.sublayer?.sourceJSON?.drawingInfo?.labelingInfo?.length>0;return r&&!s}get canChangeDefinitionExpression(){return!0}async _switchSublayer(e){e.layer?.capabilities?.exportMap?.supportsDynamicLayers&&(e.labelsVisible=this.sublayer.labelsVisible),await super._switchSublayer(e)}async _onInitialize(){await super._onInitialize(),this.sublayer?.renderer&&"tile"!==this.sublayer?.layer?.type&&this.sublayer?.layer?.capabilities?.exportMap?.supportsDynamicLayers&&(this.sublayer.renderer=this.sublayer.renderer.clone())}_createSublayerExtension(e){return a.factory.create(e,"ArcGISMapServiceSublayer")}};t=e([r],t);export{t as MapImageSublayerExtension};