@digital-realty/app-shell 11.0.22-IXUAT-10963.531609 → 11.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bootstrap.js CHANGED
@@ -1 +1 @@
1
- import{__decorate as C}from"tslib";import{LitElement as A,html as c}from"lit";import{property as w}from"lit/decorators.js";import{ApplicationInsights as Q,DistributedTracingModes as Z}from"@microsoft/applicationinsights-web";import{authedUser as I}from"@digital-realty/ix-account-switcher";import{UserManager as ee}from"oidc-client-ts";import"@digital-realty/ix-app-logic/views/splash-screen.js";import{makeObservable as te,action as se,observable as oe,toJS as re}from"mobx";function a(){var e;const t=(e=window.gpConfig)==null?void 0:e["app-shell"];if(!t)throw new Error("App-shell config not loaded. Ensure config.json is fetched before app bootstrap.");return t}const{PortalInterxion:ne,PortalGlobalPortal:ae,PortalServiceFabric:ie,PortalMarketplacePortal:le}=a(),ce={strict:"strictly_necessary",performance:"performance",targeting:"targeting"},pe={accept:"accept_all",reject:"reject_all",custom:"customize",no:"no_sell"},P="globalportalappshell",p="user-authentication",h="redirect-url",ue="ui-cookie-policy",de="date-format",R="Global Portal",b="Service Fabric",T="Marketplace Portal",N="EMEA Customer Portal",v="x-auth",[u,he,ge,me]=["CREATE","UPDATE","READ","APPROVE"],[y,g,_e,Ee,O,fe,_t,Se,L,Et,Ce,Ae,k,x,U,ft,we,St,Ie,M,D,V,Pe,G,Re,be,j,Te]=["Cloud Connect","Cross Connect","Custom Roles","Customer Care","Customer Equipment Connection (CEC)","Customer Support","DCIM-enabled location data","Default System Roles","External User","Facility Access","Internal Roles","Internal User","Internet Exchange","Intra-Customer Connectivity (ICC)","IP Bandwidth","OSP Access","Permanent Badge","PoP/POE Room Access","Remote Hands","Remote Hands Package","Service Exchange Cloud Router","Service Exchange Port","Shipping & Receiving","Space & Power","Trouble Ticket","Visitor Access","User","ESG Reporting"],Ne=[Ie,fe,Re,Pe,be,we,Ee],ve=[g,y,O,k,x,U,M,D,V,G],ye=[g,y,O,k,x,U,M,D,V,G],Oe={LocationChanged:"location-changed",VaadinRouterLocationChanged:"vaadin-router-location-changed",CreateUserClicked:"create-user-clicked"},H={SessionStorage:{HasOutstandingChanges:"hasOutstandingChanges",ShowLastLoginPopup:"showLastLoginPopup"}},[Le,ke,xe]=["Security","DCIM","Planned Site Maintenance"],Ue=[Le,ke,xe],Me=[{label:R,href:ae,selected:!0},{label:T,href:le},{label:N,href:ne},{label:b,href:ie,target:"_blank"}],B={appInsights:"_appInsights"},De=()=>{const{ApplicationInsightsInstrumentationKey:e,ApplicationInsightsCorrelationHeaderExcludedDomains:t}=a(),s=new Q({config:{instrumentationKey:e,enableCorsCorrelation:!0,enableRequestHeaderTracking:!0,enableResponseHeaderTracking:!0,enableAutoRouteTracking:!0,autoTrackPageVisitTime:!0,enableAjaxErrorStatusText:!0,enableAjaxPerfTracking:!0,enableUnhandledPromiseRejectionTracking:!0,isCookieUseDisabled:!0,distributedTracingMode:Z.AI_AND_W3C,correlationHeaderExcludedDomains:t.split(",").map(o=>o.trim())}});return s.loadAppInsights(),s.trackPageView(),s.addTelemetryInitializer(o=>{o.tags["ai.cloud.role"]=P}),s},d=(e,t,s)=>(...o)=>{const[r,...n]=o;typeof r=="string"&&r.startsWith("[mobx]")&&t===4?s.trackException({exception:{message:n[0].message,stack:n[0].stack,name:r},severityLevel:4}):s.trackTrace({severityLevel:t,message:r},n),e.apply(console,[r,...n])},Ve=e=>{console.log=d(console.log,2,e),console.info=d(console.info,2,e),console.warn=d(console.warn,3,e),console.error=d(console.error,4,e),window.console=console},Ge=()=>{const e=De();window[B.appInsights]=e,window.dispatchEvent(new Event("appInsightsInitialized")),Ve(e)},$=async e=>{const t=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(s)).map(o=>o.toString(16).padStart(2,"0")).join("")};function je(){const{location:e}=window,t=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`,{LoginAuthority:s,GlobalPortalClientId:o,GlobalPortalUIScopes:r,GlobalPlanBShellPostLogoutRedirectUrl:n}=a();return{authority:s,client_id:o,redirect_uri:`${t}/auth-callback`,response_type:"code",scope:r,post_logout_redirect_uri:n,monitorSession:!1}}const m=new ee(je()),He=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(window.atob(t).split("").map(o=>`%${`00${o.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(s)},Be=()=>{localStorage.removeItem(p)},i=()=>{const e=localStorage.getItem(p);return e?JSON.parse(e):null},F=()=>{var e;const t=localStorage.getItem(v);return t?(e=JSON.parse(t))==null?void 0:e.email:null},$e=async()=>{const e=i();if(!e)return null;const t=(e.profile.given_name||"")+(e.profile.family_name||"")+e.profile.sub;return await $(t)},K=()=>{const e=i();return e?e.id_token:null},z=(e,t)=>{const s={...t,...e},o=He(e.access_token);return s.profile.sub=o.sub,s.profile.account_number=o.account_number,s.expires_at=o.exp,s.is_federated=o.is_federated,o.previous_login_date&&(s.profile.previous_login_date=o.previous_login_date),I.setAccount({accountNumber:o.account_number,email:o.email,name:o.name,givenName:o.given_name,familyName:o.family_name,authTime:o.exp,accessToken:e.access_token,idToken:e.id_token}),localStorage.setItem(p,JSON.stringify(s)),s},Fe=e=>{z(e,null)},Ke=()=>{const e=i();return e?e.access_token:null},ze=()=>{const e=i();return e&&e.is_federated!==null&&e.is_federated!==void 0?String(e.is_federated).toLowerCase()==="true":!1},Je=()=>{const e=i();return e!=null&&e.expires_at?e.expires_at>Date.now()/1e3:!1},We=()=>{var e;const t=i();return((e=t==null?void 0:t.profile)==null?void 0:e.previous_login_date)||null},Ye=["authenticate","auth-callback","logout"],qe=e=>e.expires_at&&new Date(e.expires_at*1e3),Xe=e=>e.expires_at&&new Date(e.expires_at*1e3+a().TokenValidForOfflineUsePostExpiryInHours*60*60*1e3),J=()=>{if(!a().IsLoginEnabled)return!1;const e=i();if(!K())return!0;if(!e.expires_at)return!1;const t=new Date;return navigator.onLine?t>qe(e):t>Xe(e)},Qe=()=>{const e=window.location.pathname.split("/");return Ye.includes(e[e.length-1])},Ze=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="authenticate"?(a().IsLoginEnabled?m.signinRedirect():window.location.href="/",!0):!1},et=()=>{let e="/";const t=localStorage.getItem(h);t&&(localStorage.removeItem(h),e=t),sessionStorage.setItem(H.SessionStorage.ShowLastLoginPopup,"true"),window.location.href=e},tt=e=>{if(!e.id_token)throw new Error("Missing property:id_token");return e},_=e=>{const t=Qe();(!t||e)&&(t||localStorage.setItem(h,window.location.href),window.location.href="/authenticate")},st=async e=>{const t=`${e.profile.sub}-${e.profile.customer_id}`,s=await $(t);return{...e,profile:{...e.profile,hashed_identifier:s}}},ot=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="auth-callback"?(m.signinRedirectCallback().then(tt).then(st).then(Fe).then(et).catch(_),!0):!1};class rt extends A{render(){return c` <ix-splash-screen></ix-splash-screen> `}}window.customElements.define("splash-screen",rt);var nt=Object.defineProperty,at=(e,t,s)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,E=(e,t,s)=>at(e,typeof t!="symbol"?t+"":t,s);class it{constructor(){E(this,"permissions",[]),E(this,"loading",!1),E(this,"getPermissions",async()=>{var t;const s=(t=I)==null?void 0:t.access_token;if(!s)return[];const{ApiBaseUrl:o}=a(),r=await fetch(`${o}/usermanagement/my-permissions?exclude_parents=false&exclude_siblings=true`,{headers:{Authorization:`Bearer ${s}`}});return r.ok?r.json():[]}),te(this,{permissions:oe,setPermissions:se})}setPermissions(t){this.permissions=t.reduce((s,o)=>(s[o.permission_name]=o.privilege,s),{})}tryLoadPermissions(){try{this.loading||(this.loading=!0,this.getPermissions().then(t=>{this.setPermissions(t),this.loading=!1}).catch(()=>{this.loading=!1}))}catch(t){this.loading=!1}}clearPermissions(){this.setPermissions([])}hasExternalUserCreate(){return this.hasPermission(L,u)||this.hasPermission(j,u)}hasConnectivityCreate(){return this.hasPermission(g,u)}hasPrivilegeLevel(t,s){const o=[me,u,he,ge],r=o.findIndex(l=>l===t),n=o.findIndex(l=>l===s);return r>=n}hasPermission(t,s){let o=!1;const r=re(this.permissions),n=Object.keys(r).find(l=>l===t);return n&&(o=this.hasPrivilegeLevel(s,r[n])),o}}const f=new it;class S extends A{constructor(){super(),this._currentView="splash",this.appLoaded=!1,this._onPopState=()=>{a().IsLoginEnabled&&J()&&_()};try{Ge()}catch(s){console.error("Telemetry initialization failed:",s)}const t=window.location.pathname;if(t==="/session-expired"){this._currentView="session-expired",this._loadView("session-expired");return}if(t==="/logout"){this._currentView="logout",this._loadView("logout");return}if(Ze()||ot()){this._currentView="splash";return}if(J()){this._currentView="splash",_();return}this._currentView="app",this._loadApp()}async _loadView(t){t==="session-expired"?await import("@digital-realty/ix-app-logic/views/session-expiry.js"):t==="logout"&&await import("./logout-CjljBIWK.js")}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._onPopState)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._onPopState)}_getAccountNumber(){var t,s,o;return(o=new URLSearchParams(window.location.search).get("selected_account_number"))!=null?o:(s=(t=i())==null?void 0:t.profile)==null?void 0:s.account_number}_isESGAccessOnly(t,s){const o=t.filter(r=>r.account_number===s);return o.length===1&&o[0].permission_name==="ESG Reporting"}_applyGomFfBypass(t){var s;const o=F();if(!o||!((s=a().SuperusersWhitelist)!=null?s:"").split(",").map(n=>n.trim().toLowerCase()).includes(o.toLowerCase()))return t;const r=window.gpConfig;return r!=null&&r["app-shell"]&&(r["app-shell"]={...r["app-shell"],IsInventoryManagementEnabled:!0}),r!=null&&r["ui-launchpad"]&&(r["ui-launchpad"]={...r["ui-launchpad"],IsInventoryManagementEnabled:!0}),t["ui-gom"]?{...t,"ui-gom":{...t["ui-gom"],enabled:!0}}:t}_applyMfeOverrides(t,s){const o={};for(const r of Object.keys(t))o[r]={...t[r],enabled:s.includes(r)};return o}async _loadApp(){var t;const{authedUser:s}=await import("@digital-realty/ix-account-switcher");await s.hydrateStore();const[o,r]=await Promise.allSettled([fetch("./registered-apps.json").then(X=>X.json()),f.getPermissions()]);if(o.status==="rejected"){console.error("Failed to load registered apps:",o.reason);return}if(r.status==="rejected"){console.error("Failed to load permissions:",r.reason);return}const{registeredApps:n}=o.value,l=r.value,W=(t=this._getAccountNumber())!=null?t:"",Y=this._isESGAccessOnly(l,W)?this._applyMfeOverrides(n,["ui-esg"]):n,q=this._applyGomFfBypass(Y);window.registeredApps=Object.freeze(q),f.setPermissions(l),await import("./app-B-J_5-V-.js"),this.appLoaded=!0}render(){switch(this._currentView){case"session-expired":return c`<ix-session-expiry></ix-session-expiry>`;case"logout":return c`<ixp-logout></ixp-logout>`;case"app":return this.appLoaded?c`<global-portal-app appTitle="DLR" showDrawer></global-portal-app>`:c`<splash-screen></splash-screen>`;default:return c`<splash-screen></splash-screen>`}}}C([w({type:String})],S.prototype,"_currentView",void 0),C([w({type:Boolean})],S.prototype,"appLoaded",void 0),window.customElements.define("gp-bootstrap",S);export{Oe as A,m as B,ue as C,Se as D,N as E,v as F,R as G,Ce as I,T as M,ye as O,Ue as R,b as S,j as U,P as a,H as b,_e as c,ce as d,pe as e,de as f,Te as g,L as h,Ae as i,ve as j,Me as k,p as l,Ne as m,Be as n,Ke as o,a as p,$e as q,K as r,We as s,i as t,F as u,B as v,Je as w,ze as x,f as y,z};
1
+ import{__decorate as S}from"tslib";import{LitElement as A,html as c}from"lit";import{property as w}from"lit/decorators.js";import{ApplicationInsights as Q,DistributedTracingModes as Z}from"@microsoft/applicationinsights-web";import{authedUser as I}from"@digital-realty/ix-account-switcher";import{UserManager as ee}from"oidc-client-ts";import"@digital-realty/ix-app-logic/views/splash-screen.js";import{makeObservable as te,action as se,observable as oe,toJS as re}from"mobx";function a(){var e;const t=(e=window.gpConfig)==null?void 0:e["app-shell"];if(!t)throw new Error("App-shell config not loaded. Ensure config.json is fetched before app bootstrap.");return t}const{PortalInterxion:ne,PortalGlobalPortal:ae,PortalServiceFabric:ie,PortalMarketplacePortal:le}=a(),ce={strict:"strictly_necessary",performance:"performance",targeting:"targeting"},pe={accept:"accept_all",reject:"reject_all",custom:"customize",no:"no_sell"},P="globalportalappshell",p="user-authentication",h="redirect-url",ue="ui-cookie-policy",de="date-format",R="Global Portal",b="Service Fabric",T="Marketplace Portal",N="EMEA Customer Portal",v="x-auth",[u,he,ge,me]=["CREATE","UPDATE","READ","APPROVE"],[y,g,_e,Ee,O,fe,_t,Ce,L,Et,Se,Ae,k,x,U,ft,we,Ct,Ie,M,D,V,Pe,G,Re,be,j,Te]=["Cloud Connect","Cross Connect","Custom Roles","Customer Care","Customer Equipment Connection (CEC)","Customer Support","DCIM-enabled location data","Default System Roles","External User","Facility Access","Internal Roles","Internal User","Internet Exchange","Intra-Customer Connectivity (ICC)","IP Bandwidth","OSP Access","Permanent Badge","PoP/POE Room Access","Remote Hands","Remote Hands Package","Service Exchange Cloud Router","Service Exchange Port","Shipping & Receiving","Space & Power","Trouble Ticket","Visitor Access","User","ESG Reporting"],Ne=[Ie,fe,Re,Pe,be,we,Ee],ve=[g,y,O,k,x,U,M,D,V,G],ye=[g,y,O,k,x,U,M,D,V,G],Oe={LocationChanged:"location-changed",VaadinRouterLocationChanged:"vaadin-router-location-changed",CreateUserClicked:"create-user-clicked"},H={SessionStorage:{HasOutstandingChanges:"hasOutstandingChanges",ShowLastLoginPopup:"showLastLoginPopup"}},[Le,ke,xe]=["Security","DCIM","Planned Site Maintenance"],Ue=[Le,ke,xe],Me=[{label:R,href:ae,selected:!0},{label:T,href:le},{label:N,href:ne},{label:b,href:ie,target:"_blank"}],B={appInsights:"_appInsights"},De=()=>{const{ApplicationInsightsInstrumentationKey:e,ApplicationInsightsCorrelationHeaderExcludedDomains:t}=a(),s=new Q({config:{instrumentationKey:e,enableCorsCorrelation:!0,enableRequestHeaderTracking:!0,enableResponseHeaderTracking:!0,enableAutoRouteTracking:!0,autoTrackPageVisitTime:!0,enableAjaxErrorStatusText:!0,enableAjaxPerfTracking:!0,enableUnhandledPromiseRejectionTracking:!0,isCookieUseDisabled:!0,distributedTracingMode:Z.AI_AND_W3C,correlationHeaderExcludedDomains:t.split(",").map(o=>o.trim())}});return s.loadAppInsights(),s.trackPageView(),s.addTelemetryInitializer(o=>{o.tags["ai.cloud.role"]=P}),s},d=(e,t,s)=>(...o)=>{const[r,...n]=o;typeof r=="string"&&r.startsWith("[mobx]")&&t===4?s.trackException({exception:{message:n[0].message,stack:n[0].stack,name:r},severityLevel:4}):s.trackTrace({severityLevel:t,message:r},n),e.apply(console,[r,...n])},Ve=e=>{console.log=d(console.log,2,e),console.info=d(console.info,2,e),console.warn=d(console.warn,3,e),console.error=d(console.error,4,e),window.console=console},Ge=()=>{const e=De();window[B.appInsights]=e,window.dispatchEvent(new Event("appInsightsInitialized")),Ve(e)},$=async e=>{const t=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(s)).map(o=>o.toString(16).padStart(2,"0")).join("")};function je(){const{location:e}=window,t=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`,{LoginAuthority:s,GlobalPortalClientId:o,GlobalPortalUIScopes:r,GlobalPlanBShellPostLogoutRedirectUrl:n}=a();return{authority:s,client_id:o,redirect_uri:`${t}/auth-callback`,response_type:"code",scope:r,post_logout_redirect_uri:n,monitorSession:!1}}const m=new ee(je()),He=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(window.atob(t).split("").map(o=>`%${`00${o.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(s)},Be=()=>{localStorage.removeItem(p)},i=()=>{const e=localStorage.getItem(p);return e?JSON.parse(e):null},F=()=>{var e;const t=localStorage.getItem(v);return t?(e=JSON.parse(t))==null?void 0:e.email:null},$e=async()=>{const e=i();if(!e)return null;const t=(e.profile.given_name||"")+(e.profile.family_name||"")+e.profile.sub;return await $(t)},K=()=>{const e=i();return e?e.id_token:null},z=(e,t)=>{const s={...t,...e},o=He(e.access_token);return s.profile.sub=o.sub,s.profile.account_number=o.account_number,s.expires_at=o.exp,s.is_federated=o.is_federated,o.previous_login_date&&(s.profile.previous_login_date=o.previous_login_date),I.setAccount({accountNumber:o.account_number,email:o.email,name:o.name,givenName:o.given_name,familyName:o.family_name,authTime:o.exp,accessToken:e.access_token,idToken:e.id_token}),localStorage.setItem(p,JSON.stringify(s)),s},Fe=e=>{z(e,null)},Ke=()=>{const e=i();return e?e.access_token:null},ze=()=>{const e=i();return e&&e.is_federated!==null&&e.is_federated!==void 0?String(e.is_federated).toLowerCase()==="true":!1},Je=()=>{const e=i();return e!=null&&e.expires_at?e.expires_at>Date.now()/1e3:!1},We=()=>{var e;const t=i();return((e=t==null?void 0:t.profile)==null?void 0:e.previous_login_date)||null},Ye=["authenticate","auth-callback","logout"],qe=e=>e.expires_at&&new Date(e.expires_at*1e3),Xe=e=>e.expires_at&&new Date(e.expires_at*1e3+a().TokenValidForOfflineUsePostExpiryInHours*60*60*1e3),J=()=>{if(!a().IsLoginEnabled)return!1;const e=i();if(!K())return!0;if(!e.expires_at)return!1;const t=new Date;return navigator.onLine?t>qe(e):t>Xe(e)},Qe=()=>{const e=window.location.pathname.split("/");return Ye.includes(e[e.length-1])},Ze=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="authenticate"?(a().IsLoginEnabled?m.signinRedirect():window.location.href="/",!0):!1},et=()=>{let e="/";const t=localStorage.getItem(h);t&&(localStorage.removeItem(h),e=t),sessionStorage.setItem(H.SessionStorage.ShowLastLoginPopup,"true"),window.location.href=e},tt=e=>{if(!e.id_token)throw new Error("Missing property:id_token");return e},_=e=>{const t=Qe();(!t||e)&&(t||localStorage.setItem(h,window.location.href),window.location.href="/authenticate")},st=async e=>{const t=`${e.profile.sub}-${e.profile.customer_id}`,s=await $(t);return{...e,profile:{...e.profile,hashed_identifier:s}}},ot=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="auth-callback"?(m.signinRedirectCallback().then(tt).then(st).then(Fe).then(et).catch(_),!0):!1};class rt extends A{render(){return c` <ix-splash-screen></ix-splash-screen> `}}window.customElements.define("splash-screen",rt);var nt=Object.defineProperty,at=(e,t,s)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,E=(e,t,s)=>at(e,typeof t!="symbol"?t+"":t,s);class it{constructor(){E(this,"permissions",[]),E(this,"loading",!1),E(this,"getPermissions",async()=>{var t;const s=(t=I)==null?void 0:t.access_token;if(!s)return[];const{ApiBaseUrl:o}=a(),r=await fetch(`${o}/usermanagement/my-permissions?exclude_parents=false&exclude_siblings=true`,{headers:{Authorization:`Bearer ${s}`}});return r.ok?r.json():[]}),te(this,{permissions:oe,setPermissions:se})}setPermissions(t){this.permissions=t.reduce((s,o)=>(s[o.permission_name]=o.privilege,s),{})}tryLoadPermissions(){try{this.loading||(this.loading=!0,this.getPermissions().then(t=>{this.setPermissions(t),this.loading=!1}).catch(()=>{this.loading=!1}))}catch(t){this.loading=!1}}clearPermissions(){this.setPermissions([])}hasExternalUserCreate(){return this.hasPermission(L,u)||this.hasPermission(j,u)}hasConnectivityCreate(){return this.hasPermission(g,u)}hasPrivilegeLevel(t,s){const o=[me,u,he,ge],r=o.findIndex(l=>l===t),n=o.findIndex(l=>l===s);return r>=n}hasPermission(t,s){let o=!1;const r=re(this.permissions),n=Object.keys(r).find(l=>l===t);return n&&(o=this.hasPrivilegeLevel(s,r[n])),o}}const f=new it;class C extends A{constructor(){super(),this._currentView="splash",this.appLoaded=!1,this._onPopState=()=>{a().IsLoginEnabled&&J()&&_()};try{Ge()}catch(s){console.error("Telemetry initialization failed:",s)}const t=window.location.pathname;if(t==="/session-expired"){this._currentView="session-expired",this._loadView("session-expired");return}if(t==="/logout"){this._currentView="logout",this._loadView("logout");return}if(Ze()||ot()){this._currentView="splash";return}if(J()){this._currentView="splash",_();return}this._currentView="app",this._loadApp()}async _loadView(t){t==="session-expired"?await import("@digital-realty/ix-app-logic/views/session-expiry.js"):t==="logout"&&await import("./logout-CjljBIWK.js")}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._onPopState)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._onPopState)}_getAccountNumber(){var t,s,o;return(o=new URLSearchParams(window.location.search).get("selected_account_number"))!=null?o:(s=(t=i())==null?void 0:t.profile)==null?void 0:s.account_number}_isESGAccessOnly(t,s){const o=t.filter(r=>r.account_number===s);return o.length===1&&o[0].permission_name==="ESG Reporting"}_applyGomFfBypass(t){var s;const o=F();if(!o||!((s=a().SuperusersWhitelist)!=null?s:"").split(",").map(n=>n.trim().toLowerCase()).includes(o.toLowerCase()))return t;const r=window.gpConfig;return r&&(window.gpConfig={...r,"app-shell":r["app-shell"]?{...r["app-shell"],IsInventoryManagementEnabled:!0}:r["app-shell"],"ui-launchpad":r["ui-launchpad"]?{...r["ui-launchpad"],IsInventoryManagementEnabled:!0}:r["ui-launchpad"]}),t["ui-gom"]?{...t,"ui-gom":{...t["ui-gom"],enabled:!0}}:t}_applyMfeOverrides(t,s){const o={};for(const r of Object.keys(t))o[r]={...t[r],enabled:s.includes(r)};return o}async _loadApp(){var t;const{authedUser:s}=await import("@digital-realty/ix-account-switcher");await s.hydrateStore();const[o,r]=await Promise.allSettled([fetch("./registered-apps.json").then(X=>X.json()),f.getPermissions()]);if(o.status==="rejected"){console.error("Failed to load registered apps:",o.reason);return}if(r.status==="rejected"){console.error("Failed to load permissions:",r.reason);return}const{registeredApps:n}=o.value,l=r.value,W=(t=this._getAccountNumber())!=null?t:"",Y=this._isESGAccessOnly(l,W)?this._applyMfeOverrides(n,["ui-esg"]):n,q=this._applyGomFfBypass(Y);window.registeredApps=Object.freeze(q),f.setPermissions(l),await import("./app-B-J_5-V-.js"),this.appLoaded=!0}render(){switch(this._currentView){case"session-expired":return c`<ix-session-expiry></ix-session-expiry>`;case"logout":return c`<ixp-logout></ixp-logout>`;case"app":return this.appLoaded?c`<global-portal-app appTitle="DLR" showDrawer></global-portal-app>`:c`<splash-screen></splash-screen>`;default:return c`<splash-screen></splash-screen>`}}}S([w({type:String})],C.prototype,"_currentView",void 0),S([w({type:Boolean})],C.prototype,"appLoaded",void 0),window.customElements.define("gp-bootstrap",C);export{Oe as A,m as B,ue as C,Ce as D,N as E,v as F,R as G,Se as I,T as M,ye as O,Ue as R,b as S,j as U,P as a,H as b,_e as c,ce as d,pe as e,de as f,Te as g,L as h,Ae as i,ve as j,Me as k,p as l,Ne as m,Be as n,Ke as o,a as p,$e as q,K as r,We as s,i as t,F as u,B as v,Je as w,ze as x,f as y,z};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-realty/app-shell",
3
- "version": "11.0.22-IXUAT-10963.531609",
3
+ "version": "11.0.22",
4
4
  "license": "UNLICENSED",
5
5
  "contributors": [
6
6
  "DLR"