@digital-realty/app-shell 11.0.11 → 11.0.13-dependabot.526658

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 S}from"tslib";import{LitElement as I,html as c}from"lit";import{property as C}from"lit/decorators.js";import{ApplicationInsights as Q,DistributedTracingModes as Z}from"@microsoft/applicationinsights-web";import{authedUser as T}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 ae,toJS as oe}from"mobx";const R="planbglobalportalui",re="openid service_management_profile offline_access user_management_profile resource.notifications resource.usermanagementapi resource.servicemanagementapi resource.inventory resource.cookieconsents",O="https://login-a1.digitalrealty.com",ne="https://inxn-a1-gpappshell.azureedge.net/?logout=true",P="https://api-a1.interxion.com",ie="",ce="local",le="GTM-KXBK8CQP",pe=24,ue="https://api-a1.interxion.com",_e="ui-ticket-updates-accessAt,ix-grid-,-grid,app-state,releaseNotesViewed",de="https://gp-dev.digitalrealty.com/standalone/knowledge-base",Ee="https://portal.interxion.com",me="https://inxn-a1-gpappshell.azureedge.net",ge="https://demo.servicefabric.digitalrealty.com/",he="https://marketplaceportal.com/group/telx-new-portal",Ae="gp-uat.digitalrealty.com",Se=!1,Ie="/cookie-policy",Ce="1.0",Te="*digitalrealty.com,gpportaltests-b@yahoo.com",Re={strict:"strictly_necessary",performance:"performance",targeting:"targeting"},Oe={accept:"accept_all",reject:"reject_all",custom:"customize",no:"no_sell"},N="globalportalappshell",l="user-authentication",_="redirect-url",Pe="ui-cookie-policy",Ne="date-format",f="Global Portal",L="Service Fabric",w="Marketplace Portal",b="EMEA Customer Portal",v="x-auth",[p,fe,Le,we]=["CREATE","UPDATE","READ","APPROVE"],[y,d,be,ve,U,ye,vt,Ue,k,yt,ke,xe,x,M,D,Ut,Me,kt,De,V,G,B,Ve,H,Ge,Be,j,He]=["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"],je=[De,ye,Ge,Ve,Be,Me,ve],Ke=[d,y,U,x,M,D,V,G,B,H],Fe=[d,y,U,x,M,D,V,G,B,H],$e={LocationChanged:"location-changed",VaadinRouterLocationChanged:"vaadin-router-location-changed",CreateUserClicked:"create-user-clicked"},K={SessionStorage:{HasOutstandingChanges:"hasOutstandingChanges",ShowLastLoginPopup:"showLastLoginPopup"}},[Ye,ze,Xe]=["Security","DCIM","Planned Site Maintenance"],Je=[Ye,ze,Xe],We=[{label:f,href:me,selected:!0},{label:w,href:he},{label:b,href:Ee},{label:L,href:ge,target:"_blank"}],F={appInsights:"_appInsights"},qe=()=>{const e=new Q({config:{instrumentationKey:ie,enableCorsCorrelation:!0,enableRequestHeaderTracking:!0,enableResponseHeaderTracking:!0,enableAutoRouteTracking:!0,autoTrackPageVisitTime:!0,enableAjaxErrorStatusText:!0,enableAjaxPerfTracking:!0,enableUnhandledPromiseRejectionTracking:!0,isCookieUseDisabled:!0,distributedTracingMode:Z.AI_AND_W3C,correlationHeaderExcludedDomains:Ae.split(",").map(t=>t.trim())}});return e.loadAppInsights(),e.trackPageView(),e.addTelemetryInitializer(t=>{t.tags["ai.cloud.role"]=N}),e},u=(e,t,a)=>(...s)=>{const[o,...r]=s;typeof o=="string"&&o.startsWith("[mobx]")&&t===4?a.trackException({exception:{message:r[0].message,stack:r[0].stack,name:o},severityLevel:4}):a.trackTrace({severityLevel:t,message:o},r),e.apply(console,[o,...r])},Qe=e=>{console.log=u(console.log,2,e),console.info=u(console.info,2,e),console.warn=u(console.warn,3,e),console.error=u(console.error,4,e),window.console=console},Ze=()=>{const e=qe();window[F.appInsights]=e,window.dispatchEvent(new Event("appInsightsInitialized")),Qe(e)},$=async e=>{const t=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(a)).map(s=>s.toString(16).padStart(2,"0")).join("")};function et(){const{location:e}=window,t=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`;return{authority:O,client_id:R,redirect_uri:`${t}/auth-callback`,response_type:"code",scope:re,post_logout_redirect_uri:ne,monitorSession:!1}}const E=new ee(et()),tt=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(window.atob(t).split("").map(s=>`%${`00${s.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(a)},st=()=>{localStorage.removeItem(l)},n=()=>{const e=localStorage.getItem(l);return e?JSON.parse(e):null},at=()=>{var e;const t=localStorage.getItem(v);return t?(e=JSON.parse(t))==null?void 0:e.email:null},ot=async()=>{const e=n();if(!e)return null;const t=(e.profile.given_name||"")+(e.profile.family_name||"")+e.profile.sub;return await $(t)},Y=()=>{const e=n();return e?e.id_token:null},z=(e,t)=>{const a={...t,...e},s=tt(e.access_token);return a.profile.sub=s.sub,a.profile.account_number=s.account_number,a.expires_at=s.exp,a.is_federated=s.is_federated,s.previous_login_date&&(a.profile.previous_login_date=s.previous_login_date),T.setAccount({accountNumber:s.account_number,email:s.email,name:s.name,givenName:s.given_name,familyName:s.family_name,authTime:s.exp,accessToken:e.access_token,idToken:e.id_token}),localStorage.setItem(l,JSON.stringify(a)),a},rt=e=>{z(e,null)},nt=()=>{const e=n();return e?e.access_token:null},it=()=>{const e=n();return e&&e.is_federated!==null&&e.is_federated!==void 0?String(e.is_federated).toLowerCase()==="true":!1},ct=()=>{const e=n();return e!=null&&e.expires_at?e.expires_at>Date.now()/1e3:!1},lt=()=>{var e;const t=n();return((e=t==null?void 0:t.profile)==null?void 0:e.previous_login_date)||null},pt=["authenticate","auth-callback","logout"],ut=e=>e.expires_at&&new Date(e.expires_at*1e3),_t=e=>e.expires_at&&new Date(e.expires_at*1e3+pe*60*60*1e3),X=()=>{const e=n();if(!Y())return!0;if(!e.expires_at)return!1;const t=new Date;return navigator.onLine?t>ut(e):t>_t(e)},dt=()=>{const e=window.location.pathname.split("/");return pt.includes(e[e.length-1])},Et=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="authenticate"?(E.signinRedirect(),!0):!1},mt=()=>{let e="/";const t=localStorage.getItem(_);t&&(localStorage.removeItem(_),e=t),sessionStorage.setItem(K.SessionStorage.ShowLastLoginPopup,"true"),window.location.href=e},gt=e=>{if(!e.id_token)throw new Error("Missing property:id_token");return e},m=e=>{const t=dt();(!t||e)&&(t||localStorage.setItem(_,window.location.href),window.location.href="/authenticate")},ht=async e=>{const t=`${e.profile.sub}-${e.profile.customer_id}`,a=await $(t);return{...e,profile:{...e.profile,hashed_identifier:a}}},At=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="auth-callback"?(E.signinRedirectCallback().then(gt).then(ht).then(rt).then(mt).catch(m),!0):!1};class St extends I{render(){return c` <ix-splash-screen></ix-splash-screen> `}}window.customElements.define("splash-screen",St);var It=Object.defineProperty,Ct=(e,t,a)=>t in e?It(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,g=(e,t,a)=>Ct(e,typeof t!="symbol"?t+"":t,a);class Tt{constructor(){g(this,"permissions",[]),g(this,"loading",!1),g(this,"getPermissions",async()=>{var t;const a=(t=T)==null?void 0:t.access_token;if(!a)return[];const s=await fetch(`${P}/usermanagement/my-permissions?exclude_parents=false&exclude_siblings=true`,{headers:{Authorization:`Bearer ${a}`}});return s.ok?s.json():[]}),te(this,{permissions:ae,setPermissions:se})}setPermissions(t){this.permissions=t.reduce((a,s)=>(a[s.permission_name]=s.privilege,a),{})}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(k,p)||this.hasPermission(j,p)}hasConnectivityCreate(){return this.hasPermission(d,p)}hasPrivilegeLevel(t,a){const s=[we,p,fe,Le],o=s.findIndex(i=>i===t),r=s.findIndex(i=>i===a);return o>=r}hasPermission(t,a){let s=!1;const o=oe(this.permissions),r=Object.keys(o).find(i=>i===t);return r&&(s=this.hasPrivilegeLevel(a,o[r])),s}}const h=new Tt;class A extends I{constructor(){super(),this._currentView="splash",this.appLoaded=!1,this._onPopState=()=>{X()&&m()};try{Ze()}catch(a){console.error("Telemetry initialization failed:",a)}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(Et()||At()){this._currentView="splash";return}if(X()){this._currentView="splash",m();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-DwQJmwiJ.js")}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._onPopState)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._onPopState)}_getAccountNumber(){var t,a,s;return(s=new URLSearchParams(window.location.search).get("selected_account_number"))!=null?s:(a=(t=n())==null?void 0:t.profile)==null?void 0:a.account_number}_isESGAccessOnly(t,a){const s=t.filter(o=>o.account_number===a);return s.length===1&&s[0].permission_name==="ESG Reporting"}_applyMfeOverrides(t,a){const s={};for(const o of Object.keys(t))s[o]={...t[o],enabled:a.includes(o)};return s}async _loadApp(){var t;const{authedUser:a}=await import("@digital-realty/ix-account-switcher");await a.hydrateStore();const[s,o]=await Promise.allSettled([fetch("./registered-apps.json").then(q=>q.json()),h.getPermissions()]);if(s.status==="rejected"){console.error("Failed to load registered apps:",s.reason);return}if(o.status==="rejected"){console.error("Failed to load permissions:",o.reason);return}const{registeredApps:r}=s.value,i=o.value,J=(t=this._getAccountNumber())!=null?t:"",W=this._isESGAccessOnly(i,J)?this._applyMfeOverrides(r,["ui-esg"]):r;window.registeredApps=Object.freeze(W),h.setPermissions(i),await import("./app-BDxFz3m9.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([C({type:String})],A.prototype,"_currentView",void 0),S([C({type:Boolean})],A.prototype,"appLoaded",void 0),window.customElements.define("gp-bootstrap",A);export{Te as A,N as B,be as C,Ne as D,ce as E,ct as F,le as G,l as H,Ke as I,v as J,Re as K,O as L,w as M,Pe as N,Fe as O,_e as P,de as Q,Je as R,je as S,ue as T,j as U,Ie as V,Oe as W,Ce as X,Se as a,ot as b,st as c,at as d,nt as e,n as f,Y as g,z as h,R as i,P as j,$e as k,lt as l,it as m,K as n,He as o,h as p,xe as q,k as r,Ue as s,ke as t,E as u,b as v,We as w,f as x,L as y,F as z};
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 W,DistributedTracingModes as X}from"@microsoft/applicationinsights-web";import{authedUser as P}from"@digital-realty/ix-account-switcher";import{UserManager as Q}from"oidc-client-ts";import"@digital-realty/ix-app-logic/views/splash-screen.js";import{makeObservable as Z,action as ee,observable as te,toJS as se}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:oe,PortalGlobalPortal:re,PortalServiceFabric:ne,PortalMarketplacePortal:ae}=a(),ie={strict:"strictly_necessary",performance:"performance",targeting:"targeting"},le={accept:"accept_all",reject:"reject_all",custom:"customize",no:"no_sell"},I="globalportalappshell",p="user-authentication",h="redirect-url",ce="ui-cookie-policy",pe="date-format",R="Global Portal",T="Service Fabric",b="Marketplace Portal",N="EMEA Customer Portal",v="x-auth",[u,ue,de,he]=["CREATE","UPDATE","READ","APPROVE"],[O,g,ge,me,y,_e,mt,Ee,k,_t,Se,fe,L,x,U,Et,Ce,St,Ae,D,M,V,we,G,Pe,Ie,j,Re]=["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"],Te=[Ae,_e,Pe,we,Ie,Ce,me],be=[g,O,y,L,x,U,D,M,V,G],Ne=[g,O,y,L,x,U,D,M,V,G],ve={LocationChanged:"location-changed",VaadinRouterLocationChanged:"vaadin-router-location-changed",CreateUserClicked:"create-user-clicked"},H={SessionStorage:{HasOutstandingChanges:"hasOutstandingChanges",ShowLastLoginPopup:"showLastLoginPopup"}},[Oe,ye,ke]=["Security","DCIM","Planned Site Maintenance"],Le=[Oe,ye,ke],xe=[{label:R,href:re,selected:!0},{label:b,href:ae},{label:N,href:oe},{label:T,href:ne,target:"_blank"}],$={appInsights:"_appInsights"},Ue=()=>{const{ApplicationInsightsInstrumentationKey:e,ApplicationInsightsCorrelationHeaderExcludedDomains:t}=a(),s=new W({config:{instrumentationKey:e,enableCorsCorrelation:!0,enableRequestHeaderTracking:!0,enableResponseHeaderTracking:!0,enableAutoRouteTracking:!0,autoTrackPageVisitTime:!0,enableAjaxErrorStatusText:!0,enableAjaxPerfTracking:!0,enableUnhandledPromiseRejectionTracking:!0,isCookieUseDisabled:!0,distributedTracingMode:X.AI_AND_W3C,correlationHeaderExcludedDomains:t.split(",").map(o=>o.trim())}});return s.loadAppInsights(),s.trackPageView(),s.addTelemetryInitializer(o=>{o.tags["ai.cloud.role"]=I}),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])},De=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},Me=()=>{const e=Ue();window[$.appInsights]=e,window.dispatchEvent(new Event("appInsightsInitialized")),De(e)},B=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 Ve(){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 Q(Ve()),Ge=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)},je=()=>{localStorage.removeItem(p)},i=()=>{const e=localStorage.getItem(p);return e?JSON.parse(e):null},He=()=>{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 B(t)},F=()=>{const e=i();return e?e.id_token:null},K=(e,t)=>{const s={...t,...e},o=Ge(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),P.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},Be=e=>{K(e,null)},Fe=()=>{const e=i();return e?e.access_token:null},Ke=()=>{const e=i();return e&&e.is_federated!==null&&e.is_federated!==void 0?String(e.is_federated).toLowerCase()==="true":!1},ze=()=>{const e=i();return e!=null&&e.expires_at?e.expires_at>Date.now()/1e3:!1},Je=()=>{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),We=e=>e.expires_at&&new Date(e.expires_at*1e3+a().TokenValidForOfflineUsePostExpiryInHours*60*60*1e3),z=()=>{if(!a().IsLoginEnabled)return!1;const e=i();if(!F())return!0;if(!e.expires_at)return!1;const t=new Date;return navigator.onLine?t>qe(e):t>We(e)},Xe=()=>{const e=window.location.pathname.split("/");return Ye.includes(e[e.length-1])},Qe=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="authenticate"?(a().IsLoginEnabled?m.signinRedirect():window.location.href="/",!0):!1},Ze=()=>{let e="/";const t=localStorage.getItem(h);t&&(localStorage.removeItem(h),e=t),sessionStorage.setItem(H.SessionStorage.ShowLastLoginPopup,"true"),window.location.href=e},et=e=>{if(!e.id_token)throw new Error("Missing property:id_token");return e},_=e=>{const t=Xe();(!t||e)&&(t||localStorage.setItem(h,window.location.href),window.location.href="/authenticate")},tt=async e=>{const t=`${e.profile.sub}-${e.profile.customer_id}`,s=await B(t);return{...e,profile:{...e.profile,hashed_identifier:s}}},st=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="auth-callback"?(m.signinRedirectCallback().then(et).then(tt).then(Be).then(Ze).catch(_),!0):!1};class ot extends A{render(){return c` <ix-splash-screen></ix-splash-screen> `}}window.customElements.define("splash-screen",ot);var rt=Object.defineProperty,nt=(e,t,s)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,E=(e,t,s)=>nt(e,typeof t!="symbol"?t+"":t,s);class at{constructor(){E(this,"permissions",[]),E(this,"loading",!1),E(this,"getPermissions",async()=>{var t;const s=(t=P)==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():[]}),Z(this,{permissions:te,setPermissions:ee})}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(k,u)||this.hasPermission(j,u)}hasConnectivityCreate(){return this.hasPermission(g,u)}hasPrivilegeLevel(t,s){const o=[he,u,ue,de],r=o.findIndex(l=>l===t),n=o.findIndex(l=>l===s);return r>=n}hasPermission(t,s){let o=!1;const r=se(this.permissions),n=Object.keys(r).find(l=>l===t);return n&&(o=this.hasPrivilegeLevel(s,r[n])),o}}const S=new at;class f extends A{constructor(){super(),this._currentView="splash",this.appLoaded=!1,this._onPopState=()=>{a().IsLoginEnabled&&z()&&_()};try{Me()}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(Qe()||st()){this._currentView="splash";return}if(z()){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-CEMELcLl.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"}_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(q=>q.json()),S.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,J=(t=this._getAccountNumber())!=null?t:"",Y=this._isESGAccessOnly(l,J)?this._applyMfeOverrides(n,["ui-esg"]):n;window.registeredApps=Object.freeze(Y),S.setPermissions(l),await import("./app-DOZ88gJn.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})],f.prototype,"_currentView",void 0),C([w({type:Boolean})],f.prototype,"appLoaded",void 0),window.customElements.define("gp-bootstrap",f);export{ve as A,ce as B,ge as C,pe as D,Re as E,le as F,R as G,be as I,b as M,Ne as O,Le as R,Te as S,j as U,F as a,$e as b,je as c,He as d,Fe as e,i as f,a as g,K as h,Je as i,Ke as j,H as k,fe as l,k as m,Ee as n,Se as o,S as p,N as q,xe as r,T as s,$ as t,m as u,I as v,ze as w,p as x,v as y,ie as z};
@@ -0,0 +1 @@
1
+ import{LitElement as g,html as m}from"lit";import{appState as i}from"@digital-realty/ix-app-logic/state/app-state.js";import{g as u,a as h,u as n,c as d}from"./bootstrap.js";import"tslib";import"lit/decorators.js";import"@microsoft/applicationinsights-web";import"@digital-realty/ix-account-switcher";import"oidc-client-ts";import"@digital-realty/ix-app-logic/views/splash-screen.js";import"mobx";var p=Object.defineProperty,S=(o,e,t)=>e in o?p(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,a=(o,e,t)=>S(o,typeof e!="symbol"?e+"":e,t);class c extends g{constructor(){super(...arguments),a(this,"isIdle",!1),a(this,"clearLocalStorageExcept",e=>{const t=new Set((typeof e=="string"?e.split(","):[]).map(r=>r.trim().toLowerCase())),s=[];Object.keys(window.localStorage).forEach(r=>{Array.from(t).some(l=>r.toLowerCase().includes(l))||s.push(r)}),s.forEach(r=>window.localStorage.removeItem(r))}),a(this,"clearGridSessionStorage",()=>{Object.keys(sessionStorage).filter(e=>e.startsWith("grid-")).forEach(e=>sessionStorage.removeItem(e))}),a(this,"logout",async()=>{const{PreserveLocalStorageItems:e,PreventLogoutOnTimeout:t}=u();i.lastActive=-1,await i.hydrateStore(),await i.getStoredData();const s=h();this.clearState(),this.clearLocalStorageExcept(e),this.clearGridSessionStorage(),sessionStorage.removeItem("accountSelection:lastAll"),sessionStorage.removeItem("accountSelection:lastFiltered"),this.unregisterServiceWorkers().then(async()=>{if(this.isIdle)try{t||await n.signoutSilent(s),window.location.href="/session-expired"}catch(r){window.location.href="/session-expired"}else{if(!s){await n.clearStaleState(),window.location.href="/authenticate";return}n.signoutRedirect(s)}})}),a(this,"unregisterServiceWorkers",async()=>{const e=await navigator.serviceWorker.getRegistrations();for(const t of e)t.unregister()}),a(this,"clearState",()=>{d()})}firstUpdated(){const{searchParams:e}=new URL(document.location.toString());this.isIdle=e.has("isIdle"),this.logout()}render(){return m` <splash-screen></splash-screen> `}}window.customElements.define("ixp-logout",c);export{c as Logout};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-realty/app-shell",
3
- "version": "11.0.11",
3
+ "version": "11.0.13-dependabot.526658",
4
4
  "license": "UNLICENSED",
5
5
  "contributors": [
6
6
  "DLR"
@@ -19,17 +19,7 @@
19
19
  "dist"
20
20
  ],
21
21
  "workspaces": [
22
- "../lib-components/packages/*",
23
- "../ui-service-management",
24
- "../ui-user-management",
25
- "../ui-cross-connect-order",
26
- "../ui-mfe-dcim",
27
- "../ui-mfe-reports",
28
- "../ui-inventory",
29
- "../ui-launchpad",
30
- "../ui-my-account",
31
- "../ui-gom",
32
- "../ui-esg"
22
+ "../lib-components/packages/*"
33
23
  ],
34
24
  "scripts": {
35
25
  "build:local": "npm run build --env=local",
@@ -116,7 +106,7 @@
116
106
  "redux-persist": "^6.0.0",
117
107
  "toastify-js": "^1.12.0",
118
108
  "tslib": "^2.8.1",
119
- "uuid": "^10.0.0",
109
+ "uuid": "^14.0.0",
120
110
  "validator": "^13.12.0",
121
111
  "workbox-window": "^7.3.0"
122
112
  },