/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t}from"tslib";import o from"./WebDocument2D.js";import e from"./core/Collection.js";import r from"./core/Error.js";import{loadAll as i}from"./core/loadAll.js";import s from"./core/Version.js";import{property as n,subclass as p}from"./core/accessorSupport/decorators.js";import m from"./networks/UtilityNetwork.js";import l from"./webdoc/GeotriggersInfo.js";import a from"./webdoc/IPSInfo.js";import c from"./webmap/InitialViewProperties.js";import{currentVersion as f}from"./webmap/utils.js";const u={currentVersion:f,createInitialViewProperties:()=>new c,parseVersion:s.parse,itemType:"Web Map",name:"webmap",origin:"web-map"},w=e.ofType(m);let y=class extends o{constructor(t){super(t),this.geotriggersInfo=null,this.ipsInfo=null,this.presentation=null,this.utilityNetworks=null}destroy(){if(this.utilityNetworks){const t=this.utilityNetworks.removeAll();for(const o of t)o.destroy();this.utilityNetworks.destroy()}}get context(){return u}loadAll(){return i(this,t=>{t(this.ground,this.basemap,this.layers,this.tables,this.ipsInfo?.positioningService?.portalItem)})}static fromJSON(t){if(t)return new this({resourceInfo:t});throw new r("webmap:empty-resource","Expected a JSON resource but got nothing")}static{this.VERSION=f}};t([n({type:l,json:{write:!0}})],y.prototype,"geotriggersInfo",void 0),t([n({type:a,json:{write:!0,name:"mapIPSInfo"}})],y.prototype,"ipsInfo",void 0),t([n({json:{write:!0}})],y.prototype,"presentation",void 0),t([n({type:w,json:{read:!0,write:!0}})],y.prototype,"utilityNetworks",void 0),y=t([p("esri.WebMap")],y);const d=y;export{d as default};
