/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as e}from"tslib";import s from"../core/Accessor.js";import r from"../core/Collection.js";import{removeMaybe as t}from"../core/maybe.js";import{watch as o,initial as i}from"../core/reactiveUtils.js";import{property as a,subclass as n}from"../core/accessorSupport/decorators.js";let d=class extends s{constructor(e){super(e),this.view=null,this.baseLayerViews=new r,this.groundLayerViews=new r,this.referenceLayerViews=new r,this._loadingHandle=o(()=>this.view?.map?.basemap,e=>{e&&e.load().catch(()=>{})},i)}destroy(){this._set("view",null),this._loadingHandle=t(this._loadingHandle),this.baseLayerViews.destroyAll(),this.groundLayerViews.destroyAll(),this.referenceLayerViews.destroyAll()}get suspended(){return this.view?.suspended??!0}get updating(){if(this.view?.suspended)return!1;const e=this.view?.map?.basemap;return!!e?.loaded&&(this.baseLayerViews.some(e=>e.updating)||this.groundLayerViews.some(e=>e.updating)||this.referenceLayerViews.some(e=>e.updating))}};e([a({constructOnly:!0})],d.prototype,"view",void 0),e([a({readOnly:!0})],d.prototype,"baseLayerViews",void 0),e([a({readOnly:!0})],d.prototype,"groundLayerViews",void 0),e([a({readOnly:!0})],d.prototype,"referenceLayerViews",void 0),e([a({readOnly:!0})],d.prototype,"suspended",null),e([a({type:Boolean,readOnly:!0})],d.prototype,"updating",null),d=e([n("esri.views.BasemapView")],d);const p=d;export{p as default};
