/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import r from"../../../../core/ReactiveMap.js";import{property as i}from"../../../../core/accessorSupport/decorators.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";let o=class extends t{constructor(e){super(e),this._drawAtFixedElevationOverrides=new r,this.preserveAspectRatio=!1,this.centered=!1}get drawAtFixedElevation(){return this._getDrawAtFixedElevation()}getGlobalState(){return{preserveAspectRatio:this.preserveAspectRatio,centered:this.centered,drawAtFixedElevation:this._getDrawAtFixedElevation()}}setCentered(e){this.centered=e}setPreserveAspectRatio(e){this.preserveAspectRatio=e}setGlobalState(e,t,r){"drawAtFixedElevation"===t&&this._setDrawAtFixedElevation(e,r)}clearPluginOverrides(e){this._drawAtFixedElevationOverrides.delete(e)}_setDrawAtFixedElevation(e,t){null==t?this._drawAtFixedElevationOverrides.delete(e):this._drawAtFixedElevationOverrides.set(e,t)}_getDrawAtFixedElevation(){const e=this.getPluginStack?.();if(!e)return!1;for(let t=e.length-1;t>=0;t--){const r=e.at(t),i=this._drawAtFixedElevationOverrides.get(r);if(null!=i)return i}return!1}};e([i({constructOnly:!0})],o.prototype,"getPluginStack",void 0),e([i()],o.prototype,"preserveAspectRatio",void 0),e([i()],o.prototype,"centered",void 0),e([i()],o.prototype,"drawAtFixedElevation",null),o=e([s("esri.views.draw.support.managers.GlobalStateManager")],o);export{o as GlobalStateManager};
