/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{property as a,subclass as c}from"../../core/accessorSupport/decorators.js";const l=l=>{const n=l;let i=class extends n{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},a=this.parent;void 0!==a?.effectiveScaleRange&&t(e,a.effectiveScaleRange);const c=this._get("effectiveScaleRange");return c&&c.minScale===e.minScale&&c.maxScale===e.maxScale?c:e}};return e([a({type:Number,nonNullable:!0,json:{write:!0}})],i.prototype,"minScale",void 0),e([a({type:Number,nonNullable:!0,json:{write:!0}})],i.prototype,"maxScale",void 0),e([a({readOnly:!0})],i.prototype,"effectiveScaleRange",null),i=e([c("esri.layers.mixins.ScaleRangeLayer")],i),i};function t(e,a){return e.minScale=e.minScale>0?a.minScale>0?Math.min(e.minScale,a.minScale):e.minScale:a.minScale,e.maxScale=e.maxScale>0?a.maxScale>0?Math.max(e.maxScale,a.maxScale):e.maxScale:a.maxScale,e}export{l as ScaleRangeLayer};
