1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/groupLayerUtils-ByF0h3Jw.js","assets/utils-6HRMlqnm.js","assets/index-CyVzZKgG.js","assets/index-DT-_TUjA.css","assets/originUtils-DbX4u-us.js","assets/saveUtils-9qGPHRhF.js","assets/resourceUtils-CcsAsy1y.js","assets/resourceUtils-De71dHJh.js"])))=>i.map(i=>d[i]); 2import{gS as u,gD as b,gB as c,gC as v,k7 as m,k8 as f,gE as g,fb as _,k9 as w,hs as L,f9 as p,fc as I,e0 as O,g$ as y,ka as $,cw as P,c$ as M,kb as S,kc as V,gH as C,q as T,at as k,_ as r,m as l,h6 as h,gU as x,e as E}from"./index-CyVzZKgG.js";import{populateGroupLayer as G}from"./layersCreator-4Y-1pEL7.js";import{a as A}from"./lazyLayerLoader-hchRSNb1.js";import{o as H}from"./saveUtils-9qGPHRhF.js";import"./loadUtils-D7bIZ07e.js";import"./fetchService-C71nsxL7.js";import"./associatedFeatureServiceUtils-DMFmBjL_.js";import"./portalLayers-CaR5u3qo.js";const j=Symbol("WebScene");let s=class extends u(b(c(v(m(f(g(C))))))){constructor(e){super(e),this.allLayers=new _({getCollections:()=>[this.layers],getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=w(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=L(async(t,i,a)=>{const{save:o,saveAs:n}=await T(()=>import("./groupLayerUtils-ByF0h3Jw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]));switch(t){case 0:return o(this,i);case 1:return n(this,a,i)}})}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([p(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&j in e},e=>{const t="prevent-adding-tables";this.removeHandles(t),e&&(this.tables.removeAll(),this.addHandles(O(()=>this.tables,"before-add",i=>{i.preventDefault(),k.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")}),t))},I),p(()=>this.visible,this._onVisibilityChange.bind(this),y)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===7}_writeLayers(e,t,i,a){const o=[];if(!e)return o;e.forEach(n=>{const d=$(n,a.webmap?a.webmap.getLayerJSONFromResourceInfo(n):null,a);d!=null&&d.layerType&&o.push(d)}),t.layers=o}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,t,i){const{itemId:a,layerType:o}=t;if(o==="GroupLayer"&&a)return new P({id:a,portal:i==null?void 0:i.portal})}writePortalItem(e,t){e!=null&&e.id&&(t.itemId=e.id)}set visibilityMode(e){const t=this._get("visibilityMode")!==e;this._set("visibilityMode",e),t&&this._enforceVisibility(e,this.visible)}async beforeSave(){return H(this)}load(e){const t=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service","Video Service"],layerModuleTypeMap:A,populateGroupLayer:G},e).catch(i=>{if(M(i),this.sourceIsPortalItem)throw i});return this.addResolvingPromise(t),Promise.resolve(this)}async loadAll(){return S(this,e=>{e(this.layers,this.tables)})}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer read to Grouplayer: uid=${e.uid}`):this.addHandles(p(()=>e.visible,t=>this._onChildVisibilityChange(e,t),y),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(t=>{t!==e&&(t.visible=!1)})}_enforceVisibility(e,t){if(!V(this).initialized)return;const i=this.layers;let a=i.find(o=>o.visible);switch(e){case"exclusive":i.length&&!a&&(a=i.at(0),a.visible=!0),this._turnOffOtherLayers(a);break;case"inherited":i.forEach(o=>{o.visible=t})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(t=>{t.visible=e})}_onChildVisibilityChange(e,t){switch(this.visibilityMode){case"exclusive":t?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};r([l({readOnly:!0,dependsOn:[]})],s.prototype,"allLayers",void 0),r([l({readOnly:!0})],s.prototype,"allTables",void 0),r([l({json:{read:!0,write:!0}})],s.prototype,"blendMode",void 0),r([l()],s.prototype,"fullExtent",void 0),r([l({readOnly:!0})],s.prototype,"sourceIsPortalItem",null),r([l({json:{read:!1,write:{ignoreOrigin:!0}}})],s.prototype,"layers",void 0),r([h("layers")],s.prototype,"_writeLayers",null),r([l({type:["GroupLayer"]})],s.prototype,"operationalLayerType",void 0),r([l({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,t,i){return{enabled:(e==null?void 0:e.type)==="Group Layer"&&(i==null?void 0:i.initiator)!==this}}}},"web-scene":{read:!1,write:!1}}}})],s.prototype,"portalItem",null),r([x("web-map","portalItem",["itemId"])],s.prototype,"readPortalItem",null),r([h("web-map","portalItem",{itemId:{type:String}})],s.prototype,"writePortalItem",null),r([l()],s.prototype,"spatialReference",void 0),r([l({json:{read:!1},readOnly:!0,value:"group"}
2)],s.prototype,"type",void 0),r([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,t,i)=>{e!=="inherited"&&(t[i]=e)}}}}})],s.prototype,"visibilityMode",null),s=r([E("esri.layers.GroupLayer")],s);const N=s;export{N as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.