(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{14525:function(t,e,i){"use strict";i.r(e),function(t){i.d(e,"default",(function(){return l}));var s=i(1860),o=i(1662),a=i(2284),d=i(3179),n=i(14524),r=i(5430);class l{constructor(){this.model=null,this.adapter=null}async didCreate(){this.model=new n.default,this.model.setLoading&&this.model.setLoading(!0),this.adapter=new r.default(this.model),await this.adapter.hydrate(),this.model.setLoading&&this.model.setLoading(!1)}async fetchEnvironments(){await Object(o.getStore)("SyncStatusStore").onSyncAvailable();const e=Object(o.getStore)("ActiveWorkspaceStore").id,i=await s.default.request(d.ENVIRONMENT_LIST_AND_SUBSCRIBE`${e}`,{method:"POST"}),n=t.forEach(t.get(i,"body.data",[]),(e=>{const i={model:"environment",modelId:e.id,action:"UPDATE_ENVIRONMENT"},s=a.default.getCompositeKey(i);!Object(o.getStore)("PermissionStore").members.has(s)&&t.set(e,"attributes.permissions.userCanUpdate",!0)}));return this.model.hydrate&&this.model.hydrate(n),this.model.setLoading&&this.model.setLoading(!1),i}beforeDestroy(){this.model.dispose(),this.model=null,this.adapter&&this.adapter.dispose(),this.adapter=null}}}.call(this,i(574))},24775:function(t,e,i){"use strict";i.r(e),function(t){i.d(e,"default",(function(){return c}));var s=i(1656),o=i(6053),a=i(5929),d=i(6406),n=i(6376),r=i(24774),l=i(6767),h=i(6762),m=i(6899);class c{constructor(){this.model=null,this.adapter=null}async didCreate(){this.model=new r.default,this.model.setLoading&&this.model.setLoading(!0);const e=await this.fetchEnvironments();!function(e){if(t.isEmpty(e))return;const i=[],s=[];e.forEach((e=>{const o=t.get(e,"attributes.permissions.anybodyCanView"),a=t.get(e,"attributes.permissions.teamCanView");o&&i.push({id:e.id}),a&&s.push({id:e.id})})),!t.isEmpty(i)&&Object(a.getStore)("PublicEntityStore").add(i),!t.isEmpty(s)&&Object(a.getStore)("SharedEnvironmentsStore").add(s)}(t.get(e,"body.data",[])),this.model.environmentList=await h.default.subscribe();const i=t=>t&&Object(a.getStore)("EnvironmentStore").find(Object(m.decomposeUID)(t).modelId);try{await Object(s.when)((()=>this.model.environmentList.ids.every(i)),{timeout:6e4})}catch(t){pm.logger.warn("EnvironmentSidebarController~didCreate: Timed out while waiting for store to be fully hydrated",t)}this.adapter=new l.default(this.model),await this.adapter.hydrate(),this.model.setLoading&&this.model.setLoading(!1)}async fetchEnvironments(){await Object(a.getStore)("SyncStatusStore").onSyncAvailable();const e=Object(a.getStore)("ActiveWorkspaceStore").id,i=await o.default.request(n.ENVIRONMENT_LIST_AND_SUBSCRIBE`${e}`,{method:"POST"}),s=t.forEach(t.get(i,"body.data",[]),(e=>{const i={model:"environment",modelId:e.id,action:"UPDATE_ENVIRONMENT"},s=d.default.getCompositeKey(i);!Object(a.getStore)("PermissionStore").members.has(s)&&t.set(e,"attributes.permissions.userCanUpdate",!0)}));return this.model.hydrate&&this.model.hydrate(s),this.model.setLoading&&this.model.setLoading(!1),i}beforeDestroy(){this.model.dispose(),this.model=null,this.adapter&&this.adapter.dispose(),this.adapter=null}}}.call(this,i(2753))}}]);