UNPKG

@fntio/infra-client

Version:

Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.

3 lines • 126 kB
import{a as Kt,b as Yt,c as Qt,d as Zt,e as Dn,f as On}from"./chunk-Y6FHN4DA.js";import{a as Pn,b as ot,c as Nn,d as Mn,e as Be}from"./chunk-46TTV6O7.js";import{a as fn}from"./chunk-JZCV6CMZ.js";import{c as Xt}from"./chunk-TOO3FEYQ.js";import{c as en,i as Ve}from"./chunk-YMS43IBH.js";import{a as Jt}from"./chunk-6CP7VLN2.js";import{a as yn,b as wn,c as Sn,d as kn,e as En,g as Tn}from"./chunk-HG4PBSMW.js";import{a as Gt}from"./chunk-64ITJKG6.js";import{b as nn,c as an,d as rn,e as sn,f as ln,g as dn,h as cn,i as pn,j as mn,k as un,l as oe}from"./chunk-K4OFWFQE.js";import{a as _n}from"./chunk-IKK5DQ3Z.js";import{a as $t,b as Wt}from"./chunk-LEEL6MDA.js";import{a as ie}from"./chunk-HUXCPIDO.js";import{a as tn}from"./chunk-XPF5YBGU.js";import"./chunk-XUEIITMC.js";import{a as Rt,b as me,c as te,d as Bt,e as tt,f as Lt,g as Ft,h as ye,i as qt,j as zt,s as ue,t as nt,u as it,v as T,w as Ut}from"./chunk-Z2HQA5DO.js";import{a as bn}from"./chunk-7DUEGRIY.js";import"./chunk-QAZJZDEE.js";import"./chunk-2DD7CZB4.js";import"./chunk-J7PZFXOE.js";import"./chunk-BG475WXG.js";import{a as hn}from"./chunk-V32HQ2F2.js";import"./chunk-BADG46IJ.js";import"./chunk-Q736XS6E.js";import"./chunk-TVCLJWZS.js";import{a as we}from"./chunk-YMC4QOLO.js";import{a as xn,b as _e,c as Cn,d as Re}from"./chunk-6NTXC6VK.js";import"./chunk-6HVGPPAG.js";import"./chunk-XOFD5DNL.js";import{a as ne}from"./chunk-PU4UT4HF.js";import{a as vn}from"./chunk-Y2PHG5VS.js";import"./chunk-SYLZLLGS.js";import{a as Ie}from"./chunk-IVXFG5AJ.js";import{d as Ae,e as on}from"./chunk-2SO4BVIT.js";import{a as Ht}from"./chunk-2BNLISUN.js";import{a as ke,b as Ee,c as Te,d as Pe,e as Ne,f as Me,n as De,o as Oe,p as gn}from"./chunk-T5HLFYHP.js";import{a as V,c as L}from"./chunk-KCJ5HNXP.js";import{a as Se}from"./chunk-3SC2PPSK.js";import"./chunk-B67EMZ2H.js";import{a as jt,b as F}from"./chunk-MID2IYAR.js";import"./chunk-6GDWMGWO.js";import{a as R}from"./chunk-7A4HO4AV.js";import{c as H}from"./chunk-ZRDXKVPG.js";import{Aa as i,Ba as a,Ca as v,Eb as Pt,F as Z,Fa as Je,Fb as Nt,Hb as Mt,I as f,Ia as ht,Ja as h,Jb as et,K as p,Ka as vt,L as m,La as c,Lb as Dt,M as j,Mb as Ot,N as gt,Na as d,Ob as ve,Pb as It,Q as xe,Qb as be,R as x,Ra as z,Rb as M,Sa as X,U as ft,Ua as U,Ub as Vt,Va as O,Vb as At,Wa as D,X as J,Xa as l,Y as xt,Ya as y,Z as ce,Za as b,_ as r,_a as ee,bb as bt,cb as yt,db as wt,f as ct,ga as E,h as Qe,i as pt,jb as St,ka as Ce,la as G,lb as kt,mb as Et,na as Ze,nb as pe,ob as Tt,pa as K,q as mt,qa as Y,qb as w,rb as $,s as ut,sa as I,sb as he,ta as u,tb as Xe,ua as _,ub as W,wa as Ct,xa as S,ya as k,z as _t,za as C}from"./chunk-FYA6QUPZ.js";import{a as de,b as Ye,e as P}from"./chunk-WFIHWVQO.js";var Q=()=>{let t=f(T),n=f(M);return t.isAdmin()?!0:n.createUrlTree(["/accounts"])};var at=()=>f(V).config.network!==!1||f(M).createUrlTree(["/accounts"]);var In=()=>!!f(V).config.plugins?.enabled||f(M).createUrlTree(["/accounts"]);var Vn=(t,n)=>P(null,null,function*(){let e=f(T),o=f(M);return yield e.whenReady(),e.isAuthenticated()?!0:(n.url&&n.url!=="/"&&sessionStorage.setItem(ue,n.url),o.parseUrl("/login"))});var rt="accessPortal.setupHidden",st=5,ae=class t{api=f(Ht);config=f(V);router=f(M);status=x(null);hidden=x(Kn());requests=x(0);openRequests=this.requests.asReadonly();brandingDone=this.config.themeSaved;brandingSkipped=w(()=>this.config.overlayWritten()&&!this.config.themeSaved());vended=w(()=>this.status()?.vended??!1);registered=w(()=>(this.status()?.accounts??0)>0);connectDone=w(()=>this.registered()&&this.vended());invitedDone=w(()=>this.status()?.invitedActive??!1);emailDone=w(()=>this.status()?.emailConfigured??!1);unregistered=w(()=>this.status()?.configAccounts.filter(n=>!n.registered)??[]);doneCount=w(()=>1+[this.brandingDone(),this.connectDone(),this.invitedDone(),this.emailDone()].filter(Boolean).length);todoCount=w(()=>st-this.doneCount());requiredDone=w(()=>this.brandingDone()&&this.connectDone()&&this.invitedDone());nextTitle=w(()=>this.brandingDone()?this.connectDone()?this.invitedDone()?"Send email from your own domain":"Invite your team":"Connect a workload account":"Choose your branding");started=!1;inflight=!1;navSub;lastPath="";start(){this.started||(this.started=!0,this.lastPath=An(this.router.url),this.load(),this.navSub=this.router.events.pipe(mt(n=>n instanceof ve)).subscribe(n=>{let e=An(n.urlAfterRedirects);e!==this.lastPath&&(this.lastPath=e,!this.hidden()&&!this.requiredDone()&&this.load())}))}stop(){this.navSub?.unsubscribe(),this.navSub=void 0,this.started=!1,this.inflight=!1,this.status.set(null),this.requests.set(0)}open(){this.hidden.set(!1);try{localStorage.removeItem(rt)}catch{}this.requests.update(n=>n+1),this.load()}dismiss(){this.hidden.set(!0);try{localStorage.setItem(rt,"1")}catch{}}load(){this.inflight||(this.inflight=!0,this.api.getSetup().subscribe({next:n=>{this.inflight=!1,this.started&&this.status.set(n)},error:()=>{this.inflight=!1}}))}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Z({token:t,factory:t.\u0275fac,providedIn:"root"})};function An(t){return t.split(/[?#]/)[0]}function Kn(){try{return localStorage.getItem(rt)==="1"}catch{return!1}}var re=class t{requests=x(0);openRequests=this.requests.asReadonly();open(){this.requests.update(n=>n+1)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Z({token:t,factory:t.\u0275fac,providedIn:"root"})};function Yn(t,n){t&1&&(i(0,"span",16),l(1,"\u2713"),a(),i(2,"span",17),l(3,"Setup complete"),a(),i(4,"span",18),l(5,"find these steps in your user menu any time"),a())}function Qn(t,n){if(t&1){let e=h();i(0,"app-button",21),c("click",function(){let s=p(e);return m(s.click())}),l(1),a()}t&2&&(r(),y(n.label))}function Zn(t,n){if(t&1&&u(0,Qn,2,1,"app-button",20),t&2){let e,o=d(3);_((e=o.nextAction())?0:-1,e)}}function Jn(t,n){if(t&1&&(v(0,"span",19),i(1,"span",17),l(2),a(),u(3,Zn,1,1)),t&2){let e=d(2);r(2),b("Next: ",e.nextTitle()),r(),_(e.expanded()?-1:3)}}function Xn(t,n){t&1&&l(0," \u2713 ")}function ei(t,n){t&1&&(l(0," Skipped for now \u2014 set the name, logo, and colors any time from your user menu (bottom left) \u2192 "),i(1,"b"),l(2,"Customize theme"),a(),l(3,". Everyone gets them on their next load. "))}function ti(t,n){t&1&&l(0," Name, logo, and colors \u2014 everyone gets them on their next load. ")}function ni(t,n){t&1&&l(0," \u2713 ")}function ii(t,n){if(t&1&&(j(),i(0,"svg",30),v(1,"circle",35)(2,"circle",36),a()),t&2){let e=d(3);r(2),I("stroke-dasharray",e.connectSubDone()/3*100+" 100")}}function oi(t,n){t&1&&l(0," \u2713 ")}function ai(t,n){t&1&&l(0," \u2713 ")}function ri(t,n){if(t&1&&(l(0," In your deploy config, not yet registered: "),i(1,"b"),l(2),a(),l(3)),t&2){let e=d(4);r(2),y(e.unregistered()[0].accountNumber),r(),b(" (",e.unregistered()[0].roles.join(", "),") ")}}function si(t,n){t&1&&l(0," Give the account a friendly name and list its roles. ")}function li(t,n){t&1&&l(0," \u2713 ")}function di(t,n){if(t&1){let e=h();i(0,"ul",33)(1,"li")(2,"span",26),u(3,oi,1,0),a(),i(4,"div",23)(5,"div",24),l(6,"Deploy the trust stack into the account"),a(),i(7,"div",25),l(8," Add this to your CDK app \u2014 your issuer URL is already filled in \u2014 and deploy it with that account's credentials: "),a(),i(9,"div",37)(10,"pre",38),l(11),a(),i(12,"div",39),v(13,"app-copy-button",40),a()(),i(14,"div",41),l(15," Prefer your own roles? Any iam.Role trusting webIdentityPrincipal() vends the same. "),a()()(),i(16,"li")(17,"span",26),u(18,ai,1,0),a(),i(19,"div",23)(20,"div",24),l(21,"Register it here"),a(),i(22,"div",25),u(23,ri,4,2)(24,si,1,0),a()(),i(25,"app-button",27),c("click",function(){p(e);let s=d(3);return m(s.go("/admin/accounts"))}),l(26," Add account "),a()(),i(27,"li")(28,"span",26),u(29,li,1,0),a(),i(30,"div",23)(31,"div",24),l(32,"Test the connection"),a(),i(33,"div",25),l(34," Open the role under Administration \u2192 Accounts and hit Test \u2014 or just Get credentials on your own role card under Your access. "),a()()()()}if(t&2){let e=d(3);r(2),O("done",e.vended())("todo",!e.vended()),r(),_(e.vended()?3:-1),r(8),y(e.snippet()),r(2),C("text",e.snippet()),r(4),O("done",e.registered())("todo",!e.registered()),r(),_(e.registered()?18:-1),r(5),_(e.unregistered().length>0?23:24),r(2),C("variant",e.registered()?"outline":"primary"),r(3),O("done",e.vended())("todo",!e.vended()),r(),_(e.vended()?29:-1)}}function ci(t,n){t&1&&l(0," \u2713 ")}function pi(t,n){t&1&&l(0," \u2713 ")}function mi(t,n){if(t&1){let e=h();i(0,"ul",15)(1,"li",22)(2,"span",16),l(3,"\u2713"),a(),i(4,"div",23)(5,"div",24),l(6,"Admin account created"),a(),i(7,"div",25),l(8,"Done by the deploy \u2014 firstAdmin in your config."),a()()(),i(9,"li")(10,"span",26),u(11,Xn,1,0),a(),i(12,"div",23)(13,"div",24),l(14,"Choose your branding"),a(),i(15,"div",25),u(16,ei,4,0)(17,ti,1,0),a()(),i(18,"app-button",27),c("click",function(){p(e);let s=d(2);return m(s.wizard.open())}),l(19," Customize "),a()(),i(20,"li",28)(21,"button",29),c("click",function(){p(e);let s=d(2);return m(s.connectOpen.set(!s.connectOpen()))}),i(22,"span",26),u(23,ni,1,0)(24,ii,3,1,":svg:svg",30),a(),i(25,"span",23)(26,"span",31)(27,"span",24),l(28,"Connect a workload account"),a(),i(29,"app-badge",32)(30,"b"),l(31),a(),l(32," / 3 done"),a()(),i(33,"span",25),l(34," Link an AWS account the portal can hand out credentials for: deploy its trust stack, register it here, then test the connection \u2014 three parts, each tracked separately. "),a()(),v(35,"app-icon",12),a(),u(36,di,35,19,"ul",33),a(),i(37,"li")(38,"span",26),u(39,ci,1,0),a(),i(40,"div",23)(41,"div",24),l(42,"Invite your team"),a(),i(43,"div",25),l(44," Invites are set-your-password emails. Under Users \u2192 Invite, add people one at a time, paste a list (one per line), or upload a .txt/.csv of addresses \u2014 each gets its own invite. Turns green when the first invited person signs in. "),a()(),i(45,"app-button",27),c("click",function(){p(e);let s=d(2);return m(s.go("/users"))}),l(46," Invite users "),a()(),i(47,"li")(48,"span",26),u(49,pi,1,0),a(),i(50,"div",23)(51,"div",24),l(52," Send email from your own domain "),i(53,"app-badge",34),l(54,"optional"),a()(),i(55,"div",25),l(56," Done by the deploy config, not here \u2014 add an "),i(57,"code"),l(58,"email"),a(),l(59," block (your sending domain and address) and redeploy; the DNS records are created for you. Until then, mail comes from AWS's built-in sender (fine for a pilot, ~50/day). "),a()()()()}if(t&2){let e=d(2);r(9),O("is-done",e.brandingDone()),r(),O("done",e.brandingDone())("todo",!e.brandingDone()),r(),_(e.brandingDone()?11:-1),r(5),_(e.brandingSkipped()?16:17),r(2),C("variant",e.brandingDone()?"outline":"primary"),r(2),O("is-done",e.connectDone()),r(),I("aria-expanded",e.connectOpen()),r(),O("done",e.connectDone())("todo",e.connectSubDone()===0)("partial",e.connectSubDone()>0&&!e.connectDone()),r(),_(e.connectDone()?23:e.connectSubDone()>0?24:-1),r(6),C("tone",e.connectBadgeTone()),r(2),y(e.connectSubDone()),r(4),O("open",e.connectOpen()),r(),_(e.connectOpen()?36:-1),r(),O("is-done",e.invitedDone()),r(),O("done",e.invitedDone())("todo",!e.invitedDone()),r(),_(e.invitedDone()?39:-1),r(6),C("variant",e.invitedDone()?"outline":"primary"),r(2),O("is-done",e.emailDone()),r(),O("done",e.emailDone())("todo",!e.emailDone()),r(),_(e.emailDone()?49:-1)}}function ui(t,n){if(t&1){let e=h();i(0,"div",0)(1,"div",1),j(),i(2,"svg",2),v(3,"circle",3)(4,"circle",4),a(),gt(),i(5,"span",5)(6,"b"),l(7),a(),i(8,"span",6),l(9,"/5"),a()()(),i(10,"div",7)(11,"span",8),l(12),a(),i(13,"div",9),u(14,Yn,6,0)(15,Jn,4,2),a()(),i(16,"div",10)(17,"app-button",11),c("click",function(){p(e);let s=d();return m(s.expanded.set(!s.expanded()))}),l(18),v(19,"app-icon",12),a(),i(20,"app-button",13),c("click",function(){p(e);let s=d();return m(s.dismiss())}),v(21,"app-icon",14),a()()(),u(22,mi,60,39,"ul",15)}if(t&2){let e=d();r(),I("aria-label",e.doneCount()+" of 5 steps done"),r(3),I("stroke-dasharray",e.doneCount()/5*100+" 100"),r(3),y(e.doneCount()),r(5),b("Set up ",e.projectName()),r(2),_(e.requiredDone()?14:15),r(4),b(" ",e.expanded()?"Hide steps":"Show steps"," "),r(),O("open",e.expanded()),r(3),_(e.expanded()?22:-1)}}var Le=class t{onboarding=f(ae);config=f(V);toast=f(L);router=f(M);wizard=f(re);expanded=x(!1);connectOpen=x(!1);projectName=w(()=>this.config.branding().projectName??this.config.config.branding?.projectName??"your portal");brandingDone=this.onboarding.brandingDone;brandingSkipped=this.onboarding.brandingSkipped;vended=this.onboarding.vended;registered=this.onboarding.registered;connectDone=this.onboarding.connectDone;connectSubDone=w(()=>[this.vended(),this.registered(),this.vended()].filter(Boolean).length);connectBadgeTone=w(()=>this.connectSubDone()===0?"gray":this.connectSubDone()===3?"green":"amber");invitedDone=this.onboarding.invitedDone;emailDone=this.onboarding.emailDone;unregistered=this.onboarding.unregistered;doneCount=this.onboarding.doneCount;requiredDone=this.onboarding.requiredDone;nextTitle=this.onboarding.nextTitle;nextAction=w(()=>this.brandingDone()?this.connectDone()?this.invitedDone()?null:{label:"Invite users",click:()=>this.go("/users")}:null:{label:"Customize",click:()=>this.wizard.open()});visible=w(()=>this.onboarding.status()!==null&&!this.onboarding.hidden());snippet=w(()=>{let n=this.onboarding.status();return n?["new TargetAccountStack(app, 'Target-<name>', {",`  env: { account: '<account id>', region: '${n.region}' },`,`  issuerUrl: '${n.issuerUrl}',`,"  roles: [InfraClientRoles.READ_ONLY],","});"].join(`
`):""});constructor(){$(()=>{this.onboarding.openRequests()>0&&this.expanded.set(!0)})}go(n){this.router.navigateByUrl(n)}dismiss(){this.onboarding.dismiss(),this.toast.success("Onboarding steps live in your user menu (bottom left) whenever you need them.")}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-setup-checklist"]],hostVars:2,hostBindings:function(e,o){e&2&&U("display",o.visible()?null:"none")},decls:1,vars:1,consts:[[1,"head"],["role","img",1,"progress-ring"],["viewBox","0 0 52 52","aria-hidden","true"],["cx","26","cy","26","r","23","pathLength","100",1,"track"],["cx","26","cy","26","r","23","pathLength","100",1,"fill"],[1,"ringlabel"],[1,"sep"],[1,"titlewrap"],[1,"title","ui-microlabel"],[1,"next-row"],[1,"actions"],["size","sm","variant","outline",3,"click"],["name","chevron-right",1,"chev"],["size","icon","variant","ghost","ariaLabel","Dismiss the onboarding steps",3,"click"],["name","x",1,"h-3.5","w-3.5"],[1,"check"],[1,"tick","done"],[1,"lbl"],[1,"rest"],[1,"tick","todo"],["size","sm"],["size","sm",3,"click"],[1,"is-done"],[1,"grow"],[1,"t"],[1,"d"],[1,"tick"],["size","sm",1,"act",3,"click","variant"],[1,"connect"],["type","button",1,"row-head",3,"click"],["viewBox","0 0 16 16","aria-hidden","true"],[1,"tline"],[1,"substepcount",3,"tone"],[1,"sub-steps"],["tone","gray",1,"ml-1.5","align-middle"],["cx","8","cy","8","r","7","pathLength","100",1,"track"],["cx","8","cy","8","r","7","pathLength","100",1,"fill"],[1,"relative","mt-2"],[1,"overflow-auto","rounded-lg","bg-gray-900","p-3","pr-14","text-xs","leading-relaxed","text-gray-100","ring-1","ring-brand/20"],[1,"absolute","right-2","top-2"],["variant","icon",3,"text"],[1,"fine"]],template:function(e,o){e&1&&u(0,ui,23,9),e&2&&_(o.visible()?0:-1)},dependencies:[we,R,Gt,F],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;max-height:50vh;padding:14px 20px 12px}ul.check[_ngcontent-%COMP%]{min-height:0;overflow:auto}.head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:14px}.progress-ring[_ngcontent-%COMP%]{position:relative;flex:none;width:52px;height:52px}.progress-ring[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:100%;height:100%;transform:rotate(-90deg)}.progress-ring[_ngcontent-%COMP%]   circle[_ngcontent-%COMP%]{fill:none;stroke-width:4}.progress-ring[_ngcontent-%COMP%]   .track[_ngcontent-%COMP%]{stroke:var(--brand-muted)}.progress-ring[_ngcontent-%COMP%]   .fill[_ngcontent-%COMP%]{stroke:var(--brand);stroke-linecap:round;transition:stroke-dasharray .3s ease}.ringlabel[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:.875rem;color:var(--muted-foreground);font-variant-numeric:tabular-nums}.ringlabel[_ngcontent-%COMP%]   .sep[_ngcontent-%COMP%]{margin-left:1.5px;color:var(--text-secondary)}.ringlabel[_ngcontent-%COMP%]   b[_ngcontent-%COMP%]{font-weight:600;color:var(--brand-text)}.titlewrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3px;min-width:0;margin-right:auto}.title[_ngcontent-%COMP%]{color:var(--text-secondary)}.next-row[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;min-height:24px;font-size:.875rem}.next-row[_ngcontent-%COMP%]   .lbl[_ngcontent-%COMP%]{font-weight:600}.next-row[_ngcontent-%COMP%]   .rest[_ngcontent-%COMP%]{color:var(--muted-foreground);font-size:.75rem}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex:none}ul.check[_ngcontent-%COMP%]{list-style:none;margin:8px 0 0;padding:0}ul.check[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:flex-start;padding:11px 0;border-top:1px solid var(--border-strong)}ul.check[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:first-child{border-top:0}.grow[_ngcontent-%COMP%]{min-width:0;flex:1}.act[_ngcontent-%COMP%]{margin-left:auto;flex:none;align-self:center}.tick[_ngcontent-%COMP%]{flex:none;width:16px;height:16px;border-radius:50%;display:grid;place-items:center;font-size:.56rem;font-weight:700;margin-top:1px}.tick.done[_ngcontent-%COMP%]{background:var(--dot-active);color:var(--success-foreground)}.tick.todo[_ngcontent-%COMP%]{border:1.5px solid var(--checkbox-border)}.tick.partial[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:100%;height:100%;transform:rotate(-90deg)}.tick.partial[_ngcontent-%COMP%]   circle[_ngcontent-%COMP%]{fill:none;stroke-width:2}.tick.partial[_ngcontent-%COMP%]   .track[_ngcontent-%COMP%]{stroke:var(--checkbox-border)}.tick.partial[_ngcontent-%COMP%]   .fill[_ngcontent-%COMP%]{stroke:var(--dot-active);stroke-linecap:round}ul.check[_ngcontent-%COMP%] > li.connect[_ngcontent-%COMP%]{display:block}.row-head[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:12px;box-sizing:border-box;width:calc(100% + 12px);margin:-4px -6px;padding:4px 6px;border-radius:8px;background:none;border:0;cursor:pointer;text-align:left;font-family:inherit;color:inherit}.row-head[_ngcontent-%COMP%]:hover{background:var(--state-hover)}.row-head[_ngcontent-%COMP%]   .grow[_ngcontent-%COMP%], .row-head[_ngcontent-%COMP%]   .t[_ngcontent-%COMP%], .row-head[_ngcontent-%COMP%]   .d[_ngcontent-%COMP%]{display:block}.tline[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.substepcount[_ngcontent-%COMP%]{flex:none;font-variant-numeric:tabular-nums}.substepcount[_ngcontent-%COMP%]   b[_ngcontent-%COMP%]{font-weight:600}.chev[_ngcontent-%COMP%]{width:16px;height:16px;margin-top:2px;color:var(--muted-foreground);transform:rotate(90deg);transition:transform .22s ease;flex-shrink:0}.chev.open[_ngcontent-%COMP%]{transform:rotate(-90deg)}.t[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:var(--surface-foreground)}li.is-done[_ngcontent-%COMP%]   .t[_ngcontent-%COMP%]{color:var(--text-secondary);font-weight:500}.d[_ngcontent-%COMP%]{font-size:.75rem;color:var(--muted-foreground);margin-top:1px;line-height:1.5}li.is-done[_ngcontent-%COMP%]   .d[_ngcontent-%COMP%]{color:var(--placeholder)}.sub-steps[_ngcontent-%COMP%]{list-style:none;margin:12px 0 2px 28px;padding:0;display:flex;flex-direction:column;gap:10px}.sub-steps[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:flex-start;padding:14px 16px;border-radius:12px;background:var(--state-hover)}.sub-steps[_ngcontent-%COMP%]   .tick[_ngcontent-%COMP%]{width:14px;height:14px;font-size:.5rem}.sub-steps[_ngcontent-%COMP%]   .t[_ngcontent-%COMP%]{font-size:.8125rem}.fine[_ngcontent-%COMP%]{font-size:.75rem;color:var(--muted-foreground);margin-top:7px}code[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.95em}"]})};var _i=(t,n)=>n.CredentialId;function gi(t,n){t&1&&(i(0,"div",2),v(1,"app-spinner"),a())}function fi(t,n){if(t&1&&(i(0,"p",13),l(1),kt(2,"date"),a()),t&2){let e=d().$implicit;r(),b(" Added ",Et(2,1,e.CreatedAt*1e3,"mediumDate")," ")}}function xi(t,n){if(t&1){let e=h();i(0,"span",14)(1,"button",16),c("click",function(){p(e);let s=d().$implicit,g=d(3);return m(g.remove(s))}),l(2," Remove this passkey? "),a(),i(3,"button",17),c("click",function(){p(e);let s=d(4);return m(s.confirmingId.set(null))}),l(4," Keep "),a()()}if(t&2){let e=d(4);r(),C("disabled",e.busy())}}function Ci(t,n){if(t&1){let e=h();i(0,"button",18),c("click",function(){p(e);let s=d().$implicit,g=d(3);return m(g.confirmingId.set(s.CredentialId))}),l(1," Remove "),a()}if(t&2){let e=d(4);C("disabled",e.busy())}}function hi(t,n){if(t&1&&(i(0,"div",10)(1,"div",11)(2,"p",12),l(3),a(),u(4,fi,3,4,"p",13),a(),u(5,xi,5,1,"span",14)(6,Ci,2,1,"button",15),a()),t&2){let e=n.$implicit,o=d(3);r(3),b(" ",e.FriendlyCredentialName||"Passkey"," "),r(),_(e.CreatedAt?4:-1),r(),_(o.confirmingId()===e.CredentialId?5:6)}}function vi(t,n){if(t&1&&(i(0,"div",8),S(1,hi,7,3,"div",10,_i),a()),t&2){let e=d(2);r(),k(e.passkeys())}}function bi(t,n){t&1&&(i(0,"div",9)(1,"p",1),l(2," No passkeys yet \u2014 add one and it becomes a choice on the sign-in screen. "),a()())}function yi(t,n){if(t&1&&u(0,vi,3,0,"div",8)(1,bi,3,0,"div",9),t&2){let e=d();_(e.passkeys().length>0?0:1)}}function wi(t,n){if(t&1&&(i(0,"p",3),l(1),a()),t&2){let e=d();r(),y(e.error())}}function Si(t,n){t&1&&(i(0,"p",4),l(1," On a Mac, adding and using passkeys happens in your web browser \u2014 open this site there to add one. This app signs in with your password or an emailed code. "),a())}function ki(t,n){if(t&1){let e=h();i(0,"app-button",19),c("click",function(){p(e);let s=d();return m(s.add())}),l(1," Add passkey "),a()}if(t&2){let e=d();C("loading",e.busy())("disabled",e.loading())}}var Fe=class t{auth=f(T);api=f(te);toast=f(L);passkeyCapable=f(H).passkeyCapable;closed=he();passkeys=x([]);loading=x(!0);busy=x(!1);error=x("");confirmingId=x(null);ngOnInit(){this.reload()}token(){return P(this,null,function*(){let n=yield this.auth.freshAccessToken();if(!n)throw new Error("Not signed in");return n})}reload(){this.loading.set(!0),this.token().then(n=>this.api.listPasskeys(n)).then(n=>this.passkeys.set(n)).catch(()=>this.error.set("Couldn\u2019t load your passkeys \u2014 try again.")).finally(()=>this.loading.set(!1))}add(){this.busy()||(this.busy.set(!0),this.error.set(""),this.token().then(n=>P(this,null,function*(){let e=yield this.api.startPasskeyRegistration(n),o=yield Yt(e.CredentialCreationOptions);yield this.api.completePasskeyRegistration(n,o),ye(o.id),this.toast.success("Passkey added"),this.reload()})).catch(n=>this.error.set(Ei(n))).finally(()=>this.busy.set(!1)))}remove(n){this.busy()||(this.confirmingId.set(null),this.busy.set(!0),this.error.set(""),this.token().then(e=>this.api.deletePasskey(e,n.CredentialId)).then(()=>{qt(n.CredentialId),this.toast.success("Passkey removed"),this.reload()}).catch(()=>this.error.set("Couldn\u2019t remove that passkey \u2014 try again.")).finally(()=>this.busy.set(!1)))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-passkeys-dialog"]],outputs:{closed:"closed"},decls:11,vars:4,consts:[["title","Passkeys",3,"closed"],[1,"text-sm","text-muted-foreground"],[1,"mt-4","flex","justify-center","py-4"],[1,"mt-3","text-sm","text-danger"],[1,"mt-3","text-sm","text-muted-foreground"],[1,"mt-5","flex","items-center","justify-end","gap-2"],["variant","outline",3,"click"],[3,"loading","disabled"],[1,"mt-4","divide-y","divide-border","rounded-lg","border","border-border"],[1,"mt-4","rounded-xl","border-2","border-dashed","border-border","p-5","text-center"],[1,"flex","items-center","justify-between","gap-3","px-4","py-3"],[1,"min-w-0"],[1,"truncate","text-sm","font-medium","text-surface-foreground"],[1,"text-xs","text-muted-foreground"],[1,"flex","shrink-0","items-center","gap-1.5"],[1,"shrink-0","rounded-lg","px-2.5","py-1","text-xs","font-medium","text-danger","transition-colors","hover:bg-danger/10",3,"disabled"],[1,"rounded-lg","bg-danger","px-2.5","py-1","text-xs","font-medium","text-white","transition-colors","hover:bg-danger-hover",3,"click","disabled"],[1,"rounded-lg","px-2","py-1","text-xs","font-medium","text-muted-foreground","hover:bg-muted",3,"click"],[1,"shrink-0","rounded-lg","px-2.5","py-1","text-xs","font-medium","text-danger","transition-colors","hover:bg-danger/10",3,"click","disabled"],[3,"click","loading","disabled"]],template:function(e,o){e&1&&(i(0,"app-dialog",0),c("closed",function(){return o.closed.emit()}),i(1,"p",1),l(2," Sign in with Touch ID, Face ID, Windows Hello, or a security key instead of a password or emailed code. A passkey stays with the browser or app it was added in \u2014 add one from each place you sign in. While an authenticator app (MFA) is on for your account, passkey sign-in isn't offered \u2014 it's password + code only until you turn the authenticator off. "),a(),u(3,gi,2,0,"div",2)(4,yi,2,1),u(5,wi,2,1,"p",3),u(6,Si,2,0,"p",4),i(7,"div",5)(8,"app-button",6),c("click",function(){return o.closed.emit()}),l(9,"Close"),a(),u(10,ki,2,2,"app-button",7),a()()),e&2&&(r(3),_(o.loading()?3:4),r(2),_(o.error()?5:-1),r(),_(o.passkeyCapable?-1:6),r(4),_(o.passkeyCapable?10:-1))},dependencies:[R,Se,ne,Nt],encapsulation:2})};function Ei(t){if(t instanceof DOMException){if(t.name==="NotAllowedError")return"The passkey prompt was closed \u2014 try again.";if(t.name==="SecurityError")return"Passkeys only work on the deployed site, not this address.";if(t.name==="InvalidStateError")return"This device already has a passkey for this account."}return"Couldn\u2019t add a passkey \u2014 try again."}function Ti(t,n){if(t&1&&Je(0,"img",0),t&2){let e=d();vt("src",e.url(),J),I("width",e.size())("height",e.size())}}function Pi(t,n){if(t&1&&Je(0,"div",2),t&2){let e=d();U("width",e.size(),"px")("height",e.size(),"px")}}var se=class t{data=Xe.required();size=Xe(168);url=x("");constructor(){$(()=>{let n=this.data();if(!n){this.url.set("");return}import("./chunk-X4SX4VRB.js").then(e=>(e.default??e).toDataURL(n,{margin:0,width:this.size()*2})).then(e=>this.url.set(e)).catch(()=>this.url.set(""))})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-qr-code"]],inputs:{data:[1,"data"],size:[1,"size"]},decls:2,vars:1,consts:[["alt","QR code",1,"qr",3,"src"],[1,"qr",3,"width","height"],[1,"qr"]],template:function(e,o){e&1&&u(0,Ti,1,3,"img",0)(1,Pi,1,4,"div",1),e&2&&_(o.url()?0:1)},styles:[".qr[_ngcontent-%COMP%]{display:block;border-radius:10px;background:#fff;padding:6px;border:1px solid var(--border)}"]})};function Mi(t,n){t&1&&(i(0,"div",2),v(1,"app-spinner"),a())}function Di(t,n){if(t&1){let e=h();i(0,"div",8),v(1,"app-qr-code",9),a(),i(2,"p",10),l(3," Scan with any authenticator app (Google Authenticator, 1Password, Authy\u2026) \u2014 or enter this key manually: "),a(),i(4,"p",11),l(5),a(),i(6,"form",12),c("ngSubmit",function(){p(e);let s=d();return m(s.verify())}),i(7,"app-field",13)(8,"input",14),c("ngModelChange",function(s){p(e);let g=d();return m(g.verifyCode.set(s))}),a()()()}if(t&2){let e=d();r(),C("data",e.totpUri()),r(4),y(e.secret()),r(2),C("error",e.error()),r(),C("ngModel",e.verifyCode())}}function Oi(t,n){if(t&1&&(i(0,"p",18),l(1),a()),t&2){let e=d(2);r(),y(e.error())}}function Ii(t,n){if(t&1&&(i(0,"div",15)(1,"p",16),l(2,"Authenticator is on"),a(),i(3,"p",17),l(4," Sign-in is your password plus a code; other sign-in methods stay off while this is on. Lost the device? An admin can reset it from your user page. "),a()(),u(5,Oi,2,1,"p",18)),t&2){let e=d();r(5),_(e.error()?5:-1)}}function Vi(t,n){if(t&1&&(i(0,"p",18),l(1),a()),t&2){let e=d(2);r(),y(e.error())}}function Ai(t,n){if(t&1&&(i(0,"div",19)(1,"p",1),l(2," Not set up yet \u2014 your password alone signs you in. "),a()(),u(3,Vi,2,1,"p",18)),t&2){let e=d();r(3),_(e.error()?3:-1)}}function Ri(t,n){if(t&1){let e=h();i(0,"app-button",20),c("click",function(){p(e);let s=d();return m(s.verify())}),l(1," Verify and turn on "),a()}if(t&2){let e=d();C("loading",e.busy())("disabled",e.verifyCode().trim().length<6)}}function Bi(t,n){if(t&1){let e=h();i(0,"app-button",21),c("click",function(){p(e);let s=d();return m(s.disable())}),l(1,"Turn off"),a()}if(t&2){let e=d();C("loading",e.busy())}}function Li(t,n){if(t&1){let e=h();i(0,"app-button",22),c("click",function(){p(e);let s=d();return m(s.start())}),l(1,"Set up authenticator"),a()}if(t&2){let e=d();C("loading",e.busy())}}var qe=class t{auth=f(T);api=f(te);toast=f(L);configService=f(V);closed=he();loading=x(!0);enabled=x(!1);busy=x(!1);error=x("");secret=x("");verifyCode=x("");productName=w(()=>this.configService.branding().projectName||"Access Portal");ngOnInit(){this.token().then(n=>this.api.totpEnabled(n)).then(n=>this.enabled.set(n)).catch(()=>this.error.set("Couldn\u2019t load your MFA status \u2014 try again.")).finally(()=>this.loading.set(!1))}token(){return P(this,null,function*(){let n=yield this.auth.freshAccessToken();if(!n)throw new Error("Not signed in");return n})}totpUri(){let n=encodeURIComponent(this.productName());return`otpauth://totp/${encodeURIComponent(`${this.productName()}:${this.auth.userEmail()}`)}?secret=${this.secret()}&issuer=${n}`}start(){this.busy()||(this.busy.set(!0),this.error.set(""),this.token().then(n=>this.api.associateSoftwareToken({accessToken:n})).then(n=>{this.secret.set(n.SecretCode),this.verifyCode.set("")}).catch(()=>this.error.set("Couldn\u2019t start setup \u2014 try again.")).finally(()=>this.busy.set(!1)))}verify(){this.busy()||this.verifyCode().trim().length<6||(this.busy.set(!0),this.error.set(""),this.token().then(n=>P(this,null,function*(){yield this.api.verifySoftwareToken({accessToken:n},this.verifyCode().trim()),yield this.api.setTotpEnabled(n,!0),Lt(this.auth.userEmail(),"password"),this.secret.set(""),this.enabled.set(!0),this.toast.success("Authenticator on \u2014 sign-in is now your password + a code")})).catch(()=>this.error.set("That code isn\u2019t right \u2014 enter the current code from your app.")).finally(()=>this.busy.set(!1)))}disable(){this.busy()||(this.busy.set(!0),this.error.set(""),this.token().then(n=>this.api.setTotpEnabled(n,!1)).then(()=>{this.enabled.set(!1),this.toast.success("Authenticator off")}).catch(()=>this.error.set("Couldn\u2019t turn it off \u2014 try again.")).finally(()=>this.busy.set(!1)))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-authenticator-dialog"]],outputs:{closed:"closed"},decls:13,vars:2,consts:[["title","Authenticator (MFA)",3,"closed"],[1,"text-sm","text-muted-foreground"],[1,"mt-4","flex","justify-center","py-4"],[1,"mt-5","flex","items-center","justify-end","gap-2"],["variant","outline",3,"click"],[3,"loading","disabled"],["variant","outline",3,"loading"],[3,"loading"],[1,"mt-4","flex","justify-center"],[3,"data"],[1,"mt-3","text-center","text-xs","text-muted-foreground"],[1,"secret"],[3,"ngSubmit"],["label","6-digit code from the app",3,"error"],["type","text","name","totpCode","inputmode","numeric","autocomplete","one-time-code","maxlength","6","autofocus","",1,"ui-input","code",3,"ngModelChange","ngModel"],[1,"mt-4","rounded-lg","border","border-border","px-4","py-3"],[1,"text-sm","font-medium","text-surface-foreground"],[1,"mt-0.5","text-xs","text-muted-foreground"],[1,"mt-3","text-sm","text-danger"],[1,"mt-4","rounded-xl","border-2","border-dashed","border-border","p-5","text-center"],[3,"click","loading","disabled"],["variant","outline",3,"click","loading"],[3,"click","loading"]],template:function(e,o){e&1&&(i(0,"app-dialog",0),c("closed",function(){return o.closed.emit()}),i(1,"p",1),l(2," A 6-digit code from an authenticator app, asked for after your password. While it's on, password + code is your only way to sign in \u2014 other methods like passkey and email code aren't offered. "),a(),u(3,Mi,2,0,"div",2)(4,Di,9,4)(5,Ii,6,1)(6,Ai,4,1),i(7,"div",3)(8,"app-button",4),c("click",function(){return o.closed.emit()}),l(9,"Close"),a(),u(10,Ri,2,2,"app-button",5)(11,Bi,2,1,"app-button",6)(12,Li,2,1,"app-button",7),a()()),e&2&&(r(3),_(o.loading()?3:o.secret()?4:o.enabled()?5:6),r(7),_(o.secret()?10:o.enabled()?11:12))},dependencies:[Oe,Me,ke,Ee,Te,De,Ne,Pe,R,Se,Ie,se,ne],styles:[".secret[_ngcontent-%COMP%]{font-family:ui-monospace,monospace;font-size:12px;text-align:center;word-break:break-all;-webkit-user-select:all;user-select:all;color:var(--surface-foreground);background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:8px 10px;margin:8px 0 12px}input.code[_ngcontent-%COMP%]{text-align:center;font-size:18px;letter-spacing:.35em;font-variant-numeric:tabular-nums}"]})};var Fi=["extendPanelTpl"],qi=["resourceExtendPanelTpl"],zi=()=>[fn],Ui=()=>[import("./chunk-26IVZOGE.js").then(t=>t.RequestResourceFormComponent)],$i=t=>({expired:t}),qn=(t,n)=>n.requestId,Wi=(t,n)=>n.su.clientId,Hi=(t,n)=>n.noticeId,Rn=(t,n)=>n.accountNumber+n.roleName,Bn=(t,n)=>n.resourceId;function Ln(t,n){return this.pluginKey(n)}var Fn=(t,n)=>n.tokenId;function ji(t,n){t&1&&v(0,"span",5)}function Gi(t,n){t&1&&(i(0,"span",9),l(1,"Refreshing\u2026"),a())}function Ki(t,n){if(t&1){let e=h();i(0,"div",10)(1,"span",13),l(2,"Pop-ups are off in this browser."),a(),i(3,"button",14),c("click",function(){p(e);let s=d(2);return m(s.allowPopups())}),l(4,"Turn on"),a(),i(5,"button",15),c("click",function(){p(e);let s=d(2);return m(s.dismissNudge())}),l(6,"\u2715"),a()()}}function Yi(t,n){if(t&1){let e=h();i(0,"app-tabs",16),wt("selectedChange",function(s){p(e);let g=d(2);return yt(g.tab,s)||(g.tab=s),m(s)}),a()}if(t&2){let e=d(2);C("tabs",e.TABS),bt("selected",e.tab),C("dotted",e.dottedTabs())}}function Qi(t,n){if(t&1){let e=h();i(0,"button",23),c("click",function(){p(e);let s=d(4);return m(s.goToRequests())}),v(1,"span",24),i(2,"span",25)(3,"span",26)(4,"span",27),l(5),a(),l(6),i(7,"span",27),l(8),a()(),i(9,"span",28),l(10),a()()()}if(t&2){let e=n.$implicit,o=d(4);r(5),y(e.group||e.serviceUser||e.email||"A user"),r(),b(" ",e.type==="REAPPROVAL"?"\xB7 review of":"requested"," "),r(2),y(o.subjectOf(e)),r(2),ee(" ",o.metaOf(e)," \xB7 ",o.ago(e.createdAt)," ")}}function Zi(t,n){if(t&1){let e=h();i(0,"section",17)(1,"p",19),l(2," Awaiting your decision "),a(),S(3,Qi,11,5,"button",20,qn),i(5,"div",21)(6,"button",22),c("click",function(){p(e);let s=d(3);return m(s.goToRequests())}),l(7," Review all requests \u2192 "),a()()()}if(t&2){let e=d(3);r(3),k(e.store.pending())}}function Ji(t,n){if(t&1){let e=h();i(0,"div",29),v(1,"span",30),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),i(6,"app-badge",33),l(7),a()(),i(8,"p",34),l(9),a(),i(10,"button",35),c("click",function(){p(e);let s=d(4);return m(s.goToServiceUsers())}),l(11),a()()()}if(t&2){let e=n.$implicit;r(),D(e.tone==="amber"?"bg-amber-500":"bg-gray-400"),r(4),y(e.su.name),r(),C("tone",e.tone),r(),y(e.badge),r(2),y(e.blurb),r(2),b(" ",e.cta," ")}}function Xi(t,n){if(t&1&&(i(0,"section",17)(1,"p",19),l(2," Service users "),a(),S(3,Ji,12,7,"div",29,Wi),a()),t&2){let e=d(3);r(3),k(e.store.serviceUserNags())}}function eo(t,n){t&1&&(i(0,"p",18),l(1," Nothing needs your attention. "),a())}function to(t,n){if(t&1&&(u(0,Zi,8,0,"section",17),u(1,Xi,5,0,"section",17),u(2,eo,2,0,"p",18)),t&2){let e,o=d(2);_((e=o.store.pending())!=null&&e.length?0:-1),r(),_(o.store.serviceUserNags().length?1:-1),r(),_(o.store.adminAttention()===0?2:-1)}}function no(t,n){t&1&&(i(0,"app-badge",39),l(1,"Granted"),a())}function io(t,n){t&1&&(i(0,"app-badge",40),l(1,"Revoked"),a())}function oo(t,n){if(t&1){let e=h();i(0,"button",35),c("click",function(){p(e);let s=d().$implicit,g=d(4);return m(g.requestRevoked(s))}),l(1," Request again \u2192 "),a()}}function ao(t,n){if(t&1&&(i(0,"div",29),v(1,"span",30),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),u(6,no,2,0,"app-badge",39)(7,io,2,0,"app-badge",40),a(),i(8,"p",34),l(9),a(),i(10,"p",41),l(11),a(),u(12,oo,2,0,"button",42),a()()),t&2){let e=n.$implicit,o=d(4);D(o.isNewChange(e)?"bg-brand/5":""),r(),D(e.change==="GRANTED"?"bg-green-500":"bg-red-500"),r(4),b(" ",o.noticeSubject(e)," "),r(),_(e.change==="GRANTED"?6:7),r(3),ee(" ",o.noticeContext(e,o.labelOf)," \xB7 ",o.ago(e.revokedAt)," "),r(2),y(o.blurbFor(e)),r(),_(e.change==="REVOKED"&&e.via!=="CASCADE"&&e.kind!=="SHARE"&&e.kind!=="PLUGIN"&&e.kind!=="BUNDLE"?12:-1)}}function ro(t,n){if(t&1&&(i(0,"section",17)(1,"p",19),l(2," Access changes "),a(),S(3,ao,13,10,"div",38,Hi),a()),t&2){let e=d(3);r(3),k(e.recentChanges())}}function so(t,n){if(t&1){let e=h();i(0,"div",29),v(1,"span",24),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),i(6,"app-badge",43),l(7),a()(),i(8,"p",34),l(9),a(),i(10,"button",35),c("click",function(){let s=p(e).$implicit,g=d(4);return m(g.requestMore(s,!1))}),l(11," Request more time \u2192 "),a()()()}if(t&2){let e=n.$implicit,o=d(4);D(o.isNewExpiry(e)?"bg-brand/5":""),r(5),b(" ",e.roleName," "),r(2),b("expires ",o.until(e.expiresAt)),r(2),y(o.names.label(e.accountNumber))}}function lo(t,n){if(t&1){let e=h();i(0,"div",29),v(1,"span",44),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),i(6,"app-badge",40),l(7),a()(),i(8,"p",34),l(9),a(),i(10,"button",35),c("click",function(){let s=p(e).$implicit,g=d(4);return m(g.requestMore(s,!0))}),l(11," Request again \u2192 "),a()()()}if(t&2){let e=n.$implicit,o=d(4);D(o.isNewExpiry(e)?"bg-brand/5":""),r(5),b(" ",e.roleName," "),r(2),b("expired ",o.until(e.expiresAt)),r(2),y(o.names.label(e.accountNumber))}}function co(t,n){if(t&1){let e=h();i(0,"div",29),v(1,"span",24),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),i(6,"app-badge",43),l(7),a()(),i(8,"p",34),l(9,"network resource"),a(),i(10,"button",35),c("click",function(){let s=p(e).$implicit,g=d(4);return m(g.requestMoreResource(s,!1))}),l(11," Request more time \u2192 "),a()()()}if(t&2){let e=n.$implicit,o=d(4);r(5),b(" ",e.name," "),r(2),b("expires ",o.until(e.expiresAt))}}function po(t,n){if(t&1){let e=h();i(0,"div",29),v(1,"span",44),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),i(6,"app-badge",40),l(7),a()(),i(8,"p",34),l(9,"network resource"),a(),i(10,"button",35),c("click",function(){let s=p(e).$implicit,g=d(4);return m(g.requestMoreResource(s,!0))}),l(11," Request again \u2192 "),a()()()}if(t&2){let e=n.$implicit,o=d(4);r(5),b(" ",e.name," "),r(2),b("expired ",o.until(e.expiresAt))}}function mo(t,n){if(t&1){let e=h();i(0,"div",29),v(1,"span",24),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),i(6,"app-badge",43),l(7),a()(),i(8,"p",34),l(9),a(),i(10,"button",35),c("click",function(){let s=p(e).$implicit,g=d(4);return m(g.openPlugin(s))}),l(11," Open plugin \u2192 "),a()()()}if(t&2){let e=n.$implicit,o=d(4);r(5),b(" ",e.pluginName," "),r(2),b("expires ",o.until(e.expiresAt)),r(2),y(o.pluginSubject(e))}}function uo(t,n){if(t&1&&(i(0,"div",29),v(1,"span",44),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),i(6,"app-badge",40),l(7),a()(),i(8,"p",34),l(9),a()()()),t&2){let e=n.$implicit,o=d(4);r(5),b(" ",e.pluginName," "),r(2),b("expired ",o.until(e.expiresAt)),r(2),y(o.pluginSubject(e))}}function _o(t,n){if(t&1){let e=h();i(0,"div",29),v(1,"span",24),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),i(6,"app-badge",43),l(7),a()(),i(8,"p",34),l(9,"access token"),a(),i(10,"button",35),c("click",function(){p(e);let s=d(4);return m(s.openTokens())}),l(11," Manage tokens \u2192 "),a()()()}if(t&2){let e=n.$implicit,o=d(4);r(5),y(e.name),r(2),b("expires ",o.until(e.expiresAt))}}function go(t,n){if(t&1){let e=h();i(0,"div",29),v(1,"span",44),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),i(6,"app-badge",40),l(7),a()(),i(8,"p",34),l(9,"access token"),a(),i(10,"button",35),c("click",function(){p(e);let s=d(4);return m(s.openTokens())}),l(11," Manage tokens \u2192 "),a()()()}if(t&2){let e=n.$implicit,o=d(4);r(5),y(e.name),r(2),b("expired ",o.until(e.expiresAt))}}function fo(t,n){if(t&1&&(i(0,"section",17)(1,"p",19),l(2," Temporary access "),a(),S(3,so,12,5,"div",38,Rn),S(5,lo,12,5,"div",38,Rn),S(7,co,12,2,"div",29,Bn),S(9,po,12,2,"div",29,Bn),S(11,mo,12,3,"div",29,Ln,!0),S(13,uo,10,3,"div",29,Ln,!0),S(15,_o,12,2,"div",29,Fn),S(17,go,12,2,"div",29,Fn),a()),t&2){let e=d(3);r(3),k(e.store.expiry().expiring),r(2),k(e.store.expiry().expired),r(2),k(e.store.resourceExpiry().expiring),r(2),k(e.store.resourceExpiry().expired),r(2),k(e.store.pluginExpiry().expiring),r(2),k(e.store.pluginExpiry().expired),r(2),k(e.store.tokenExpiry().expiring),r(2),k(e.store.tokenExpiry().expired)}}function xo(t,n){t&1&&(i(0,"p",36),l(1,"Loading\u2026"),a())}function Co(t,n){t&1&&(i(0,"p",37),l(1," You haven't requested any roles yet. "),a())}function ho(t,n){if(t&1&&(i(0,"p",46),l(1),a()),t&2){let e=d().$implicit;r(),b(' "',e.decisionNote,'" ')}}function vo(t,n){if(t&1&&(i(0,"div",29),v(1,"span",30),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),i(6,"app-badge",33),l(7),a()(),i(8,"p",34),l(9),a(),i(10,"p",45),l(11),a(),u(12,ho,2,1,"p",46),a()()),t&2){let e=n.$implicit,o=d(4);D(o.isNew(e)?"bg-brand/5":""),r(),D(o.dot(e.status)),r(4),b(" ",o.subjectOf(e)," "),r(),C("tone",o.tone(e.status)),r(),y(o.label(e.status)),r(2),ee(" ",o.metaOf(e)," \xB7 ",o.ago(e.decidedAt??e.createdAt)," "),r(),D(o.blurbClass(e.status)),r(),b(" ",o.blurb(e)," "),r(),_(e.decisionNote?12:-1)}}function bo(t,n){if(t&1&&S(0,vo,13,13,"div",38,qn),t&2){let e=d(3);k(e.store.myRequests())}}function yo(t,n){if(t&1&&(u(0,ro,5,0,"section",17),u(1,fo,19,0,"section",17),i(2,"section")(3,"p",19),l(4," Your requests "),a(),u(5,xo,2,0,"p",36)(6,Co,2,0,"p",37)(7,bo,2,0),a()),t&2){let e=d(2);_(e.recentChanges().length?0:-1),r(),_(e.store.expiry().expiring.length||e.store.expiry().expired.length||e.store.resourceExpiry().expiring.length||e.store.resourceExpiry().expired.length||e.store.pluginExpiry().expiring.length||e.store.pluginExpiry().expired.length||e.store.tokenExpiry().expiring.length||e.store.tokenExpiry().expired.length?1:-1),r(4),_(e.store.myRequests()===null?5:e.store.myRequests().length===0?6:7)}}function wo(t,n){if(t&1&&(i(0,"div",6)(1,"header",7)(2,"h2",8),l(3,"Activity"),a(),u(4,Gi,2,0,"span",9),a(),u(5,Ki,7,0,"div",10),u(6,Yi,1,3,"app-tabs",11),i(7,"div",12),u(8,to,3,3)(9,yo,8,3),a()()),t&2){let e=d();r(4),_(e.store.loading()?4:-1),r(),_(e.nudge()?5:-1),r(),_(e.auth.isAdmin()?6:-1),r(2),_(e.tab()==="Admin"?8:9)}}function So(t,n){if(t&1){let e=h();i(0,"app-request-role-form",49),c("created",function(){p(e);let s=d(3);return m(s.onExtendCreated())})("closed",function(){p(e);let s=d(3);return m(s.extendTarget.set(null))}),a()}t&2&&C("preset",n)}function ko(t,n){if(t&1&&u(0,So,1,1,"app-request-role-form",48),t&2){let e,o=d(2);_((e=o.extendTarget())?0:-1,e)}}function Eo(t,n){if(t&1){let e=h();i(0,"app-panel",47),c("closed",function(){p(e);let s=d();return m(s.extendTarget.set(null))}),G(1,ko,1,1),K(2,1,zi),a()}if(t&2){let e=d();C("title",e.extendTitle())("contentKey",e.extendTarget()?e.extendTarget().accountNumber+":"+e.extendTarget().roleName:null),r(2),Y(e.extendTarget()!==null)}}function To(t,n){if(t&1){let e=h();i(0,"app-request-resource-form",52),c("created",function(){p(e);let s=d(3);return m(s.onResourceExtendCreated())})("closed",function(){p(e);let s=d(3);return m(s.resourceExtendTarget.set(null))}),a()}if(t&2){let e=n;C("resource",e.resource)("extension",St(2,$i,e.expired))}}function Po(t,n){if(t&1&&u(0,To,1,4,"app-request-resource-form",51),t&2){let e,o=d(2);_((e=o.resourceExtendTarget())?0:-1,e)}}function No(t,n){if(t&1){let e=h();i(0,"app-panel",50),c("closed",function(){p(e);let s=d();return m(s.resourceExtendTarget.set(null))}),G(1,Po,1,1),K(2,1,Ui),a()}if(t&2){let e=d();C("title",e.resourceExtendTitle())("contentKey",e.resourceExtendTarget()?e.resourceExtendTarget().resource.resourceId:null),r(2),Y(e.resourceExtendTarget()!==null)}}var ze=class t{store=f(oe);names=f(tn);constructor(){this.names.ensure(),_e(this.extendTarget,this.extendPanelTpl,()=>this.extendTarget.set(null)),_e(this.resourceExtendTarget,this.resourceExtendPanelTpl,()=>this.resourceExtendTarget.set(null)),this.route.queryParamMap.pipe(Jt()).subscribe(n=>{n.get("bell")&&(this.open()||this.toggle(),this.router.navigate([],{queryParams:{bell:null},queryParamsHandling:"merge",replaceUrl:!0}))})}auth=f(T);router=f(M);route=f(It);host=f(ft);bridge=f(H);open=x(!1);permission=x(typeof Notification>"u"?"unsupported":Notification.permission);nudgeDismissed=x(!1);nudgeKey(){return`notifications:nudge-dismissed:${this.auth.userSub()}`}nudge=w(()=>{if(this.bridge.isDesktop||this.permission()!=="default"||this.nudgeDismissed()||this.store.prefs()?.enabled===!1)return!1;try{return localStorage.getItem(this.nudgeKey())===null}catch{return!1}});allowPopups(){typeof Notification>"u"||Notification.requestPermission().then(n=>{this.permission.set(n),n!=="default"&&this.dismissNudge()}).catch(()=>{})}dismissNudge(){this.nudgeDismissed.set(!0);try{localStorage.setItem(this.nudgeKey(),"1")}catch{}}TABS=["For you","Admin"];tab=x("For you");dottedTabs=w(()=>this.store.adminAttention()>0?["Admin"]:[]);extendTarget=x(null);extendSent=x(!1);extendPanelTpl=W("extendPanelTpl");extendTitle=w(()=>this.extendSent()?"Request sent":this.extendTarget()?.expired?"Request access again":"Request more time");onExtendCreated(){this.extendSent.set(!0),this.store.load()}resourceExtendTarget=x(null);resourceExtendSent=x(!1);resourceExtendPanelTpl=W("resourceExtendPanelTpl");resourceExtendTitle=w(()=>this.resourceExtendSent()?"Request sent":this.resourceExtendTarget()?.expired?"Request access again":"Request more time");onResourceExtendCreated(){this.resourceExtendSent.set(!0),this.store.load()}newIds=x(new Set);newExpiryKeys=x(new Set);newChangeIds=x(new Set);recentChanges=w(()=>this.store.accessChanges().slice(0,5));ariaLabel=w(()=>{let n=this.store.count();return n?`Activity \u2014 ${n} new`:"Activity"});toggle(){typeof Notification<"u"&&this.permission.set(Notification.permission);let n=!this.open();if(this.open.set(n),!n)return;let e=this.store.unseenDecisions().length+this.store.unseenExpiry().length+this.store.unseenResourceExpiry().length+this.store.unseenPluginExpiry().length+this.store.unseenTokenExpiry().length+this.store.unseenAccessChanges().length;this.tab.set(this.auth.isAdmin()&&e===0&&this.store.adminAttention()>0?"Admin":"For you"),this.newIds.set(new Set(this.store.unseenDecisions().map(o=>o.requestId))),this.newExpiryKeys.set(new Set(this.store.unseenExpiry().map(o=>`${o.accountNumber}#${o.roleName}`))),this.newChangeIds.set(new Set(this.store.unseenAccessChanges().map(o=>o.noticeId))),this.store.load(),this.store.markSeen()}isNewChange(n){return this.newChangeIds().has(n.noticeId)}blurbFor(n){let e=n.change==="GRANTED"?pn(n):cn(n);return e.charAt(0).toUpperCase()+e.slice(1)}requestRevoked(n){if(this.open.set(!1),n.kind==="RESOURCE"){if(!n.resourceId)return;this.resourceExtendSent.set(!1),this.resourceExtendTarget.set({resource:{resourceId:n.resourceId,name:n.resourceName??"resource"},expired:!0})}else this.extendSent.set(!1),this.extendTarget.set({accountNumber:n.accountNumber??"",roleName:n.roleName??"",expired:!0})}isNew(n){return this.newIds().has(n.requestId)}isNewExpiry(n){return this.newExpiryKeys().has(`${n.accountNumber}#${n.roleName}`)}until(n){return Ae(n)}requestMore(n,e){this.open.set(!1),this.extendSent.set(!1),this.extendTarget.set({accountNumber:n.accountNumber,roleName:n.roleName,expired:e})}requestMoreResource(n,e){this.open.set(!1),this.resourceExtendSent.set(!1),this.resourceExtendTarget.set({resource:{resourceId:n.resourceId,name:n.name},expired:e})}pluginKey(n){return`${n.pluginId}#${n.accountNumber}#${n.permission}`}pluginSubject(n){return`${n.permission} \xB7 ${n.accountName||n.accountNumber}`}openPlugin(n){this.open.set(!1),this.router.navigateByUrl(sn(n))}openTokens(){this.open.set(!1),this.router.navigateByUrl(rn)}goToRequests(){this.open.set(!1),this.router.navigate(["/admin/requests"])}goToServiceUsers(){this.open.set(!1),this.router.navigate(["/users"],{queryParams:{tab:"service-users"}})}subjectOf=mn;labelOf=n=>this.names.label(n);metaOf(n){return un(n,e=>this.names.label(e))}noticeSubject=ln;noticeContext=dn;onDocumentClick(n){this.open()&&(this.host.nativeElement.contains(n.target)||this.open.set(!1))}onEscape(){this.open.set(!1)}label(n){return{PENDING:"Pending",APPROVED:"Approved",DENIED:"Denied"}[n]}tone(n){return{PENDING:"amber",APPROVED:"green",DENIED:"red"}[n]}dot(n){return{PENDING:"bg-amber-500",APPROVED:"bg-green-500",DENIED:"bg-red-500"}[n]}blurbClass(n){return n==="APPROVED"?"text-success":"text-muted-foreground"}blurb(n){switch(n.status){case"PENDING":return"Waiting for an admin to review.";case"APPROVED":return n.kind==="RESOURCE"?"Approved \u2014 see it on your Network page.":n.kind==="PLUGIN"?"Approved \u2014 your plugin access continues.":"Approved \u2014 the role is in your access list.";case"DENIED":return"Denied. You can request it again if you still need it."}}ago=_n;static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-notification-bell"]],viewQuery:function(e,o){e&1&&(z(o.extendPanelTpl,Fi,5),z(o.resourceExtendPanelTpl,qi,5)),e&2&&X(2)},hostBindings:function(e,o){e&1&&c("click",function(g){return o.onDocumentClick(g)},ce)("keydown.escape",function(){return o.onEscape()},ce)},decls:9,vars:4,consts:[["extendPanelTpl",""],["resourceExtendPanelTpl",""],[1,"relative"],[1,"relative","grid","h-[30px]","w-[30px]","place-items-center","rounded-lg","text-muted-foreground","transition-colors","hover:bg-muted",3,"click"],["name","bell",1,"h-4","w-4"],[1,"absolute","right-[3px]","top-[3px]","h-1.5","w-1.5","rounded-full","bg-notif","shadow-[0_0_0_2px_var(--surface)]"],["role","dialog","aria-label","Activity",1,"absolute","left-0","z-50","mt-2","w-96","overflow-hidden","rounded-xl","border","border-border","bg-popover","shadow-toast","backdrop-blur-2xl"],[1,"flex","items-center","justify-between","border-b","border-border","px-4","py-2.5"],[1,"text-sm","font-semibold","text-surface-foreground"],[1,"text-xs","text-placeholder"],["data-testid","popup-nudge",1,"flex","items-center","gap-2","border-b","border-border","bg-brand/5","px-4","py-2.5","text-xs"],[1,"block","px-2",3,"tabs","selected","dotted"],[1,"max-h-96","overflow-y-auto"],[1,"min-w-0","flex-1","text-surface-foreground"],["type","button",1,"font-medium","text-brand-text","hover:underline",3,"click"],["type","button","aria-label","Dismiss",1,"text-muted-foreground","hover:text-surface-foreground",3,"click"],[1,"block","px-2",3,"selectedChange","tabs","selected","dotted"],[1,"border-b","border-border"],[1,"px-4","py-4","text-sm","text-muted-foreground"],[1,"px-4","pb-1","pt-3","ui-microlabel","text-muted-foreground"],[1,"flex","w-full","items-start","gap-2.5","px-4","py-2.5","text-left","transition-colors","hover:bg-muted"],[1,"px-4","pb-3","pt-1"],[1,"text-xs","font-medium","text-brand-text","hover:underline",3,"click"],[1,"flex","w-full","items-start","gap-2.5","px-4","py-2.5","text-left","transition-colors","hover:bg-muted",3,"click"],[1,"mt-1.5","h-2","w-2","shrink-0","rounded-full","bg-amber-500"],[1,"min-w-0","flex-1"],[1,"block","text-sm","text-surface-foreground"],[1,"font-medium"],[1,"mt-0.5","block","text-xs","text-muted-foreground"],[1,"flex","items-start","gap-2.5","px-4","py-2.5"],[1,"mt-1.5","h-2","w-2","shrink-0","rounded-full"],[1,"flex","items-center","justify-between","gap-2"],[1,"truncate","text-sm","font-medium","text-surface-foreground"],[3,"tone"],[1,"mt-0.5","text-xs","text-muted-foreground"],[1,"mt-1","text-xs","font-medium","text-brand-text","hover:underline",3,"click"],[1,"px-4","py-3","text-sm","text-muted-foreground"],[1,"px-4","pb-4","pt-1","text-sm","text-muted-foreground"],[1,"flex","items-start","gap-2.5","px-4","py-2.5",3,"class"],["tone","green"],["tone","red"],[1,"mt-1","text-xs","text-muted-foreground"],[1,"mt-1","text-xs","font-medium","text-brand-text","hover:underline"],["tone","amber"],[1,"mt-1.5","h-2","w-2","shrink-0","rounded-full","bg-red-500"],[1,"mt-1","text-xs"],[1,"mt-1","rounded-md","bg-muted","px-2","py-1","text-xs","italic","text-muted-foreground"],[3,"closed","title","contentKey"],[3,"preset"],[3,"created","closed","preset"],["size","lg",3,"closed","title","contentKey"],[3,"resource","extension"],[3,"created","closed","resource","extension"]],template:function(e,o){if(e&1){let s=h();i(0,"div",2)(1,"button",3),c("click",function(){return p(s),m(o.toggle())}),v(2,"app-icon",4),u(3,ji,1,0,"span",5),a(),u(4,wo,10,4,"div",6),Ce(5,Eo,4,3,"ng-template",null,0,pe)(7,No,4,3,"ng-template",null,1,pe),a()}e&2&&(r(),I("aria-label",o.ariaLabel())("aria-expanded",o.open()),r(2),_(o.store.count()?3:-1),r(),_(o.open()?4:-1))},dependencies:[we,F,Re,hn],encapsulation:2})};var Mo=(t,n)=>n.kind;function Do(t,n){t&1&&l(0," They appear as system notifications from the desktop app \u2014 also while it sits in the tray. ")}function Oo(t,n){t&1&&l(0," In a browser they appear only while a tab of this app is open; the browser asks for permission when the switch is turned on. ")}function Io(t,n){}function Vo(t,n){t&1&&(i(0,"p",7),l(1," Blocked in this browser \u2014 allow notifications for this site in the browser's settings. "),a())}function Ao(t,n){t&1&&(i(0,"p",3),l(1,"This browser doesn't support notifications."),a())}function Ro(t,n){if(t&1){let e=h();i(0,"app-button",9),c("click",function(){p(e);let s=d(2);return m(s.allow())}),l(1," Allow in this browser "),a()}}function Bo(t,n){if(t&1&&u(0,Io,0,0)(1,Vo,2,0,"p",7)(2,Ao,2,0,"p",3)(3,Ro,2,0,"app-button",8),t&2){let e,o=d();_((e=o.permission())==="granted"?0:e==="denied"?1:e==="unsupported"?2:3)}}function Lo(t,n){if(t&1){let e=h();i(0,"label",6)(1,"input",10),c("change",function(s){let g=p(e).$implicit,N=d();return m(N.setKind(g.kind,s))}),a(),i(2,"span",11)(3,"span",12),l(4),a(),i(5,"span",13),l(6),a()()()}if(t&2){let e=n.$implicit,o=d();r(),C("checked",o.prefs().kinds[e.kind])("disabled",!o.prefs().enabled),I("aria-label",e.label),r(3),y(e.label),r(2),y(e.hint)}}var Fo=[{kind:"granted",label:"Access granted",hint:"access you did not ask for: a direct grant, a group, a share",adminOnly:!1},{kind:"revoked",label:"Access revoked",hint:"a role, resource, share or plugin permission taken away",adminOnly:!1},{kind:"decided",label:"Request decisions",hint:"your requests approved or denied",adminOnly:!1},{kind:"expiring",label:"Access expiring",hint:"temporary access about to end, or ended",adminOnly:!1},{kind:"session",label:"Session ending",hint:"your sign-in is about to reach its limit",adminOnly:!1},{kind:"requests",label:"New requests",hint:"someone asked for access",adminOnly:!0},{kind:"reviews",label:"Yearly reviews",hint:"a review is waiting for a decision",adminOnly:!0}],Ue=class t{bridge=f(H);store=f(oe);auth=f(T);toast=f(L);prefs=w(()=>this.store.prefs()??nn);rows=w(()=>Fo.filter(n=>!n.adminOnly||this.auth.isAdmin()));permission=x(typeof Notification>"u"?"unsupported":Notification.permission);constructor(){this.store.ensurePrefs()}allow(){typeof Notification>"u"||Notification.requestPermission().then(n=>this.permission.set(n)).catch(()=>{})}setEnabled(n){n&&!this.bridge.isDesktop&&this.permission()==="default"&&this.allow(),this.save({enabled:n})}setKind(n,e){this.save({kinds:{[n]:e.target.checked}})}save(n){this.store.savePrefs(n).subscribe({error:e=>this.toast.error(gn(e,"Couldn't save notification settings."))})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-notification-settings"]],decls:13,vars:5,consts:[[1,"flex","items-center","justify-between","gap-3"],[1,"text-sm","font-medium","text-surface-foreground"],["ariaLabel","Pop-up notifications",3,"checkedChange","checked"],[1,"mt-2","text-xs","text-text-secondary"],[1,"ui-microlabel","mb-1","mt-6","px-1","text-muted-foreground"],[1,"rounded-lg","border","border-border"],[1,"ui-check-row","border-b","border-border","text-sm","last:border-b-0"],[1,"mt-2","text-xs","text-danger"],["variant","outline","size","sm",1,"mt-3"],["variant","outline","size","sm",1,"mt-3",3,"click"],["type","checkbox",1,"ui-checkbox",3,"change","checked","disabled"],[1,"min-w-0","flex-1"],[1,"block","font-medium","tracking-[0.015em]","text-surface-foreground"],[1,"block","text-xs","text-text-secondary"]],template:function(e,o){e&1&&(i(0,"div",0)(1,"span",1),l(2,"Pop-up notifications"),a(),i(3,"app-toggle",2),c("checkedChange",function(g){return o.setEnabled(g)}),a()(),i(4,"p",3),u(5,Do,1,0)(6,Oo,1,0),a(),u(7,Bo,4,1),i(8,"p",4),l(9,"Tell me about"),a(),i(10,"div",5),S(11,Lo,7,5,"label",6,Mo),a()),e&2&&(r(3),C("checked",o.prefs().enabled),r(2),_(o.bridge.isDesktop?5:6),r(2),_(o.bridge.isDesktop?-1:7),r(3),O("opacity-60",!o.prefs().enabled),r(),k(o.rows()))},dependencies:[R,vn],encapsulation:2})};var qo=3e4,le=class t{now=x(Date.now());constructor(){let n=()=>this.now.set(Date.now()),e=setInterval(n,qo),o=()=>{document.hidden||n()};document.addEventListener("visibilitychange",o),f(xe).onDestroy(()=>{clearInterval(e),document.removeEventListener("visibilitychange",o)})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Z({token:t,factory:t.\u0275fac,providedIn:"root"})};var zn="auth.sessionBannerDismissed",$e=class t{auth=f(T);now=f(le).now;dismissedFor=x(zo());visible=w(()=>{let n=this.auth.sessionEndsAt();return an(n,this.now())&&this.dismissedFor()!==n});endsAtLabel=w(()=>{let n=this.auth.sessionEndsAt();return n===null?"":ie(new Date(n).toISOString(),{sameDayTimeOnly:!0})});remaining=w(()=>{let n=this.auth.sessionEndsAt();return n===null?"":Ae(new Date(n).toISOString(),this.now())});dismiss(){let n=this.auth.sessionEndsAt();this.dismissedFor.set(n);try{n!==null&&sessionStorage.setItem(zn,String(n))}catch{}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-session-banner"]],hostAttrs:["role","status","data-testid","session-banner"],hostVars:2,hostBindings:function(e,o){e&2&&U("display",o.visible()?null:"none")},decls:9,vars:2,consts:[["name","clock",1,"ic"],[1,"text"],["size","sm",3,"click"],["type","button","aria-label","Dismiss",1,"dismiss",3,"click"]],template:function(e,o){e&1&&(v(0,"app-icon",0),i(1,"p",1)(2,"strong"),l(3),a(),l(4),a(),i(5,"app-button",2),c("click",function(){return o.auth.reauthenticate()}),l(6,"Sign in again"),a(),i(7,"button",3),c("click",function(){return o.dismiss()}),l(8,"\u2715"),a()),e&2&&(r(3),b("Your session ends at ",o.endsAtLabel()),r(),b(" (",o.remaining(),"). Sign in again now to keep your credentials and network connection. "))},dependencies:[R,F],styles:["[_nghost-%COMP%]{display:flex;align-items:center;gap:12px;padding:10px 16px;font-size:13px;color:var(--surface-foreground)}.ic[_ngcontent-%COMP%]{width:18px;height:18px;flex-shrink:0;color:var(--warning)}.text[_ngcontent-%COMP%]{flex:1;min-width:0;margin:0}.dismiss[_ngcontent-%COMP%]{border:none;background:none;cursor:pointer;padding:4px 6px;border-radius:6px;color:var(--muted-foreground)}.dismiss[_ngcontent-%COMP%]:hover{background:var(--state-hover);color:var(--surface-foreground)}"]})};function zo(){try{let t=Number(sessionStorage.getItem(zn));return t>0?t:null}catch{return null}}var Uo=()=>[import("./chunk-XC7NIEIA.js").then(t=>t.NetworkSetupDialogComponent)],$o=(t,n)=>n.id,lt=(t,n)=>n.accountNumber;function Wo(t,n){t&1&&(i(0,"span",4),l(1,"\u23FB"),a(),l(2," Connect network "),i(3,"span",5),l(4,"\u25BE"),a())}function Ho(t,n){t&1&&(i(0,"span",4),l(1,"\u23FB"),a(),l(2," Connect network "))}function jo(t,n){if(t&1&&u(0,Wo,5,0)(1,Ho,3,0),t&2){let e=d(2);_(e.store.sites().length>1?0:1)}}function Go(t,n){t&1&&(v(0,"span",6),l(1," Connecting\u2026 "))}function Ko(t,n){t&1&&(v(0,"span",7),l(1," Disconnecting\u2026 "))}function Yo(t,n){t&1&&(v(0,"span",8),l(1," Connected \xB7 nothing granted "),i(2,"span",5),l(3,"\u25BE"),a())}function Qo(t,n){t&1&&(v(0,"span",9),l(1," Network \xB7 connected "),i(2,"span",5),l(3,"\u25BE"),a())}function Zo(t,n){if(t&1&&u(0,Yo,4,0)(1,Qo,4,0),t&2){let e=d(2);_(e.nothingGranted()?0:1)}}function Jo(t,n){t&1&&(v(0,"span",8),l(1," Set up network "),i(2,"span",5),l(3,"\u25BE"),a())}function Xo(t,n){if(t&1&&(i(0,"span",14),l(1),a()),t&2){let e=d(4);r(),b("\xB7 ",e.store.siteName(n))}}function ea(t,n){t&1&&(i(0,"p",16),l(1," Nothing on this network is granted to you, so every address is blocked. Staying connected changes nothing. "),a())}function ta(t,n){if(t&1&&(i(0,"p",10),v(1,"span",9),l(2," Connected"),u(3,Xo,2,1,"span",14),a(),i(4,"p",15),l(5),a(),u(6,ea,2,0,"p",16)),t&2){let e,o=d(3);r(3),_((e=o.store.sites().length>1&&o.store.activeSiteId())?3:-1,e),r(),C("title",o.store.controlHost()?"via "+o.store.controlHost():""),r(),b(" ",o.store.tailnetIp()??"\u2014"," "),r(),_(o.nothingGranted()?6:-1)}}function na(t,n){t&1&&(i(0,"p",10),v(1,"span",6),l(2," Connecting\u2026 "),a())}function ia(t,n){t&1&&(i(0,"p",10),v(1,"span",7),l(2," Disconnecting\u2026 "),a())}function oa(t,n){t&1&&(i(0,"p",18),l(1," Pick which network to connect below \u2014 one at a time. "),a())}function aa(t,n){if(t&1&&(i(0,"p",10),v(1,"span",17),l(2," Not connected "),a(),u(3,oa,2,0,"p",18)),t&2){let e=d(3);r(3),_(e.store.sites().length>1?3:-1)}}function ra(t,n){t&1&&(i(0,"p",11),l(1),a()),t&2&&(r(),b(" ",n," "))}function sa(t,n){t&1&&(i(0,"p",12),l(1,"Loading\u2026"),a())}function la(t,n){t&1&&(i(0,"p",12),l(1,"Couldn't load your VPCs \u2014 leave and hover again to retry."),a())}function da(t,n){t&1&&(i(0,"span",25),l(1,"Connected"),a())}function ca(t,n){if(t&1){let e=h();i(0,"button",30),c("click",function(){p(e);let s=d().$implicit,g=d(4);return m(g.store.switchTo(s.id))}),l(1," Switch "),a()}if(t&2){let e=d(5);D(e.rowBtn)}}function pa(t,n){if(t&1){let e=h();i(0,"button",31),c("click",function(){p(e);let s=d().$implicit,g=d(4);return m(g.store.connect({siteId:s.id}))}),l(1,"Connect"),a()}if(t&2){let e=d(5);D(e.rowBtn)}}function ma(t,n){t&1&&(i(0,"span",28),l(1,"Connecting\u2026"),a())}function ua(t,n){if(t&1&&(i(0,"span",37),l(1),a()),t&2){let e=d().$implicit,o=d(6);D(o.rowStateClass(e)),r(),y(o.rowStateText(e))}}function _a(t,n){if(t&1&&(i(0,"li",32)(1,"span",33)(2,"span",34),l(3),a(),i(4,"span",35),l(5),a()(),u(6,ua,2,3,"span",36),a()),t&2){let e=n.$implicit,o=d(2).$implicit,s=d(4);r(3),y(e.vpc.domain??"Private network"),r(2),b(" \xB7 ",s.accountLabel(e)),r(),_(s.siteStatus(o.id)==="connected"&&s.rowNeedsAttention(e)?6:-1)}}function ga(t,n){t&1&&(i(0,"ul",29),S(1,_a,7,3,"li",32,lt),a()),t&2&&(r(),k(n))}function fa(t,n){if(t&1&&(i(0,"li",21)(1,"div",22),v(2,"span",23),i(3,"span",24),l(4),a(),u(5,da,2,0,"span",25)(6,ca,2,2,"button",26)(7,pa,2,2,"button",27)(8,ma,2,0,"span",28),a(),u(9,ga,3,0,"ul",29),a()),t&2){let e,o,s=n.$implicit,g=d(4);r(2),D(g.siteDotClass(s.id)),r(2),b(" ",s.displayName||s.id," "),r(),_((e=g.siteStatus(s.id))==="connected"?5:e==="off-site"?6:e==="off"?7:e==="connecting"?8:-1),r(4),_((o=g.siteBuckets().bySite.get(s.id))?9:-1,o)}}function xa(t,n){if(t&1&&(i(0,"li",40)(1,"span",34),l(2),a(),i(3,"span",35),l(4),a()()),t&2){let e=n.$implicit,o=d(5);r(2),y(e.vpc.domain??"Private network"),r(2),b(" \xB7 ",o.accountLabel(e))}}function Ca(t,n){if(t&1&&(i(0,"p",38),l(1,"Other VPCs"),a(),i(2,"ul",39),S(3,xa,5,2,"li",40,lt),a()),t&2){let e=d(4);r(3),k(e.siteBuckets().unmapped)}}function ha(t,n){if(t&1&&(i(0,"p",19),l(1,"Networks"),a(),i(2,"ul",20),S(3,fa,10,5,"li",21,$o),a(),u(5,Ca,5,0)),t&2){let e=d(3);r(3),k(e.store.sites()),r(2),_(e.siteBuckets().unmapped.length?5:-1)}}function va(t,n){t&1&&(i(0,"p",41),l(1,"No VPC access granted yet \u2014 request a resource on the Network page."),a())}function ba(t,n){if(t&1&&(i(0,"span",49),l(1),a()),t&2){let e=d().$implicit,o=d(5);D(o.rowStateClass(e)),r(),y(o.rowStateText(e))}}function ya(t,n){if(t&1){let e=h();i(0,"button",50),c("click",function(){p(e);let s=d(6);return m(s.store.connect())}),l(1," Connect "),a()}if(t&2){let e=d(6);D(e.rowBtn)}}function wa(t,n){if(t&1&&(i(0,"li",43),v(1,"span",23),i(2,"span",44)(3,"span",45),l(4),a(),i(5,"span",46),l(6),a()(),u(7,ba,2,3,"span",47)(8,ya,2,2,"button",48),a()),t&2){let e=n.$implicit,o=d(5);r(),D(o.rowDotClass(e)),r(3),b(" ",e.vpc.domain??"Private network"," "),r(2),y(o.accountLabel(e)),r(),_(o.store.state()==="connected"?7:o.store.state()==="off"?8:-1)}}function Sa(t,n){if(t&1&&(i(0,"ul",42),S(1,wa,9,5,"li",43,lt),a()),t&2){let e=d(4);r(),k(e.groups())}}function ka(t,n){if(t&1&&(i(0,"p",19),l(1,"Your VPCs"),a(),u(2,va,2,0,"p",41)(3,Sa,3,0,"ul",42)),t&2){let e=d(3);r(2),_(e.groups().length===0?2:3)}}function Ea(t,n){if(t&1){let e=h();i(0,"label",51)(1,"input",52),c("change",function(s){p(e);let g=d(3);return m(g.onAutoChange(s))}),a(),i(2,"span"),l(3,"Reconnect automatically when the app starts"),a()(),i(4,"button",53),c("click",function(){p(e);let s=d(3);return s.store.disconnect(),m(s.open.set(!1))}),l(5," Disconnect "),a()}if(t&2){let e=d(3);r(),C("checked",e.store.autoReconnect())}}function Ta(t,n){if(t&1){let e=h();i(0,"div",2),u(1,ta,7,4)(2,na,3,0,"p",10)(3,ia,3,0,"p",10)(4,aa,4,1),u(5,ra,2,1,"p",11),u(6,sa,2,0,"p",12)(7,la,2,0,"p",12)(8,ha,6,1)(9,ka,4,1),u(10,Ea,6,1),i(11,"button",13),c("click",function(){p(e);let s=d(2);return m(s.openSetup())}),l(12," Setup guide "),a()()}if(t&2){let e,o,s=d(2);r(),_((e=s.store.state())==="connected"?1:e==="connecting"?2:e==="disconnecting"?3:4),r(4),_((o=s.store.lastError())?5:-1,o),r(),_(s.resources.reachable()===null?6:s.groups().length===0&&s.resources.error()?7:s.store.sites().length>1?8:9),r(4),_(s.store.state()==="connected"?10:-1)}}function Pa(t,n){t&1&&(i(0,"p",3),l(1),a()),t&2&&(r(),b(" ",n," "))}function Na(t,n){t&1&&v(0,"app-network-setup-dialog")}function Ma(t,n){if(t&1&&u(0,Na,1,0,"app-network-setup-dialog"),t&2){let e=d(2);_(e.store.setupOpen()?0:-1)}}function Da(t,n){if(t&1){let e=h();i(0,"div",0),c("mouseenter",function(){p(e);let s=d();return m(s.onHoverEnter())})("mouseleave",function(){p(e);let s=d();return m(s.onHoverLeave())}),i(1,"button",1),c("click",function(){p(e);let s=d();return m(s.onPillClick())}),u(2,jo,2,1)(3,Go,2,0)(4,Ko,2,0)(5,Zo,2,1)(6,Jo,4,0),a(),u(7,Ta,13,4,"div",2),u(8,Pa,2,1,"p",3),a(),G(9,Ma,1,1),K(10,9,Uo)}if(t&2){let e,o,s=d();r(),D(s.pillClass()),I("aria-expanded",s.open()),r(),_((e=s.store.state())==="off"?2:e==="connecting"?3:e==="disconnecting"?4:e==="connected"?5:e==="setup"?6:-1),r(5),_(s.open()&&s.store.state()!=="setup"?7:-1),r(),_((o=!s.open()&&!s.store.setupOpen()&&s.store.lastError())?8:-1,o),r(2),Y(s.store.setupOpen())}}var We=class t{store=f(bn);resources=f(wn);shares=f(Sn);vpcStatus=f(yn);open=x(!1);groups=w(()=>kn(this.resources.reachable()??[]));closeTimer=null;loadKicked=!1;constructor(){this.store.init()}pillClass(){let n="inline-flex w-full items-center justify-center gap-2 rounded-full border px-3 py-1 text-xs font-medium transition select-none";switch(this.store.state()){case"off":return`${n} border-brand/50 text-brand-text hover:bg-brand-muted hover:border-brand`;case"connected":return this.nothingGranted()?`${n} border-warning/30 bg-warning-muted text-warning hover:border-warning/50`:`${n} border-success/30 bg-success-muted text-success hover:border-success/50`;default:return`${n} border-border-strong text-muted-foreground hover:bg-muted`}}onPillClick(){let n=this.store.state();n==="off"?this.store.sites().length>1?this.open.set(!0):this.store.connect():n==="connected"?this.open.set(!0):n==="setup"&&this.store.setupOpen.set(!0)}onHoverEnter(){this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=null);let n=this.store.state();if(n==="setup"||this.store.setupOpen())return;this.open.set(!0);let e=this.resources.reachable();e===null?this.loadKicked||(this.loadKicked=!0,this.resources.load()):e.length===0&&this.resources.error()&&this.resources.load(),n==="connected"&&this.vpcStatus.refresh(this.groups())}onHoverLeave(){this.closeTimer&&clearTimeout(this.closeTimer),this.closeTimer=setTimeout(()=>this.open.set(!1),250)}rowBtn="flex-shrink-0 rounded-full border border-brand/50 px-2.5 py-0.5 text-[11px] font-semibold text-brand-text transition-colors hover:bg-brand-muted";nothingGranted=w(()=>{if(this.store.state()!=="connected"||this.resources.reachable()===null)return!1;let n=this.store.activeSiteId(),e=this.store.sites().length>1&&n?this.siteBuckets().bySite.get(n)??[]:this.groups(),o=(this.shares.sharedWithMe()??[]).filter(s=>!n||s.siteId===n);return e.length===0&&o.length===0});siteBuckets=w(()=>En(this.groups(),n=>this.store.siteOfAccount().get(n.accountNumber)));siteStatus(n){return Tn(this.store.state(),this.store.activeSiteId(),this.store.pendingSiteId(),n)}siteDotClass(n){switch(this.siteStatus(n)){case"connected":return"bg-[var(--dot-active,#10b981)]";case"connecting":return"animate-pulse bg-[var(--dot-expiring,#f59e0b)]";default:return"bg-placeholder"}}rowDotClass(n){switch(this.store.state()){case"connected":switch(this.vpcStatus.byAccount().get(n.accountNumber)){case"no-response":return"bg-[var(--dot-expiring,#f59e0b)]";case"checking":return"animate-pulse bg-[var(--dot-active,#10b981)]";default:return"bg-[var(--dot-active,#10b981)]"}case"connecting":return"animate-pulse bg-[var(--dot-expiring,#f59e0b)]";default:return"bg-placeholder"}}rowStateText(n){switch(this.vpcStatus.byAccount().get(n.accountNumber)){case"no-response":return"No answer";case"checking":return"Checking\u2026";default:return"Connected"}}rowNeedsAttention(n){let e=this.vpcStatus.byAccount().get(n.accountNumber);return e==="no-response"||e==="checking"}rowStateClass(n){switch(this.vpcStatus.byAccount().get(n.accountNumber)){case"no-response":return"text-warning";case"checking":return"text-muted-foreground";default:return"text-success"}}accountLabel(n){return n.accountName??n.accountNumber.replace(/(\d{4})(?=\d)/g,"$1 ")}openSetup(){this.store.setupOpen.set(!0),this.open.set(!1)}onAutoChange(n){this.store.setAutoReconnect(n.target.checked)}onDocClick(n){n.target.closest("app-network-pill")||this.open.set(!1)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-network-pill"]],hostBindings:function(e,o){e&1&&c("click",function(g){return o.onDocClick(g)},ce)},decls:1,vars:1,consts:[[1,"relative",3,"mouseenter","mouseleave"],["aria-live","polite",3,"click"],[1,"absolute","bottom-full","left-0","z-20","mb-2","w-64","rounded-xl","border","border-border","bg-popover","p-4","text-[13px]","text-muted-foreground","shadow-toast","backdrop-blur-2xl"],[1,"absolute","bottom-full","left-0","z-10","mb-2","w-64","rounded-lg","bg-danger-muted","p-2","text-xs","text-danger","ring-1","ring-danger/20"],["aria-hidden","true"],[1,"text-[9px]","opacity-70"],[1,"h-2","w-2","animate-pulse","rounded-full","bg-[var(--dot-expiring,#f59e0b)]"],[1,"h-2","w-2","animate-pulse","rounded-full","bg-placeholder"],[1,"h-2","w-2","rounded-full","bg-[var(--dot-expiring,#f59e0b)]"],[1,"h-2","w-2","rounded-full","bg-[var(--dot-active,#10b981)]"],[1,"flex","items-center","gap-2","font-semibold","text-surface-foreground"],[1,"mt-2","rounded-lg","bg-danger-muted","p-2","text-xs","text-danger","ring-1","ring-danger/20"],[1,"mt-3","text-xs"],[1,"mt-1","w-full","rounded-lg","py-1","text-xs","text-muted-foreground","transition-colors","hover:bg-muted","hover:text-surface-foreground",3,"click"],[1,"font-normal","text-muted-foreground"],[1,"mt-1.5","break-words","text-xs","text-text-secondary",3,"title"],[1,"mt-1.5","text-xs","text-warning"],[1,"h-2","w-2","rounded-full","bg-placeholder"],[1,"mt-1","text-xs"],[1,"mt-3","text-[10px]","font-bold","opacity-80"],[1,"-mx-2","mt-1.5","flex","flex-col","gap-1"],[1,"rounded-lg","px-2","py-1.5"],[1,"flex","items-center","gap-2"],[1,"h-2","w-2","flex-shrink-0","rounded-full"],[1,"min-w-0","flex-1","truncate","text-xs","font-semibold","text-surface-foreground"],[1,"flex-shrink-0","text-[11px]","font-semibold","text-success"],["title","Switches the VPN to this network \u2014 the current one disconnects.",3,"class"],[3,"class"],[1,"flex-shrink-0","text-[11px]","font-semibold","text-muted-foreground"],[1,"ml-4","mt-1","flex","flex-col","gap-0.5"],["title","Switches the VPN to this network \u2014 the current one disconnects.",3,"click"],[3,"click"],[1,"flex","items-center","gap-2","text-[11px]"],[1,"min-w-0","flex-1","truncate"],[1,"text-surface-foreground"],[1,"opacity-70"],[1,"flex-shrink-0","font-semibold",3,"class"],[1,"flex-shrink-0","font-semibold"],[1,"mt-2","text-[10px]","font-bold","opacity-80"],[1,"mt-1","flex","flex-col","gap-0.5"],[1,"truncate","text-[11px]"],[1,"mt-1.5","text-xs"],[1,"-mx-2","mt-1.5","flex","flex-col","gap-0.5"],[1,"flex","items-center","gap-2","rounded-lg","px-2","py-1.5"],[1,"min-w-0","flex-1"],[1,"block","truncate","text-xs","font-semibold","text-surface-foreground"],[1,"block","truncate","text-[11px]"],[1,"flex-shrink-0","text-[11px]","font-semibold",3,"class"],["title","Connects the VPN \u2014 every VPC you have access to comes up together.",3,"class"],[1,"flex-shrink-0","text-[11px]","font-semibold"],["title","Connects the VPN \u2014 every VPC you have access to comes up together.",3,"click"],[1,"mt-3","flex","cursor-pointer","items-start","gap-2"],["type","checkbox",1,"mt-0.5","ui-checkbox",3,"change","checked"],[1,"mt-3","w-full","rounded-lg","bg-surface","py-1.5","font-medium","text-surface-foreground","ring-1","ring-border-strong","transition-colors","hover:bg-muted",3,"click"]],template:function(e,o){e&1&&u(0,Da,12,7),e&2&&_(o.store.state()!=="hidden"?0:-1)},encapsulation:2})};var Oa=(t,n)=>n.id;function Ia(t,n){if(t&1){let e=h();i(0,"button",8),c("click",function(){p(e);let s=d().$implicit,g=d();return m(g.act(s))}),l(1),a()}t&2&&(r(),b(" ",n.label," \u2192 "))}function Va(t,n){if(t&1){let e=h();i(0,"div",2),c("mouseenter",function(){let s=p(e).$implicit,g=d();return m(g.pause(s))})("mouseleave",function(){let s=p(e).$implicit,g=d();return m(g.resume(s))}),i(1,"span",3),v(2,"app-icon",4),a(),i(3,"span",5)(4,"span"),l(5),a(),u(6,Ia,2,1,"button",6),a(),i(7,"button",7),c("click",function(){let s=p(e).$implicit,g=d();return m(g.toastService.dismiss(s.id))}),l(8," \u2715 "),a()()}if(t&2){let e,o=n.$implicit;r(),D(o.kind==="success"?"bg-success-muted text-success":"bg-danger-muted text-danger"),r(),C("name",o.kind==="success"?"check":"x")("strokeWidth",2.4),r(3),y(o.message),r(),_((e=o.action)?6:-1,e)}}var He=class t{toastService=f(L);router=f(M);timers=new Map;paused=new Set;constructor(){$(()=>{let n=new Set(this.toastService.toasts().map(e=>e.id));for(let e of this.paused)n.has(e)||this.paused.delete(e);for(let e of this.toastService.toasts())e.kind==="success"&&!this.timers.has(e.id)&&!this.paused.has(e.id)&&this.arm(e.id,Math.max(4e3,e.message.length*55))})}pause(n){this.paused.add(n.id);let e=this.timers.get(n.id);e!==void 0&&(clearTimeout(e),this.timers.delete(n.id))}resume(n){this.paused.delete(n.id),n.kind==="success"&&!this.timers.has(n.id)&&this.arm(n.id,2500)}act(n){this.toastService.dismiss(n.id),n.action&&this.router.navigateByUrl(n.action.path)}arm(n,e){this.timers.set(n,setTimeout(()=>{this.timers.delete(n),this.toastService.dismiss(n)},e))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-toast-container"]],decls:3,vars:0,consts:[[1,"fixed","right-4","top-4","z-[60]","flex","w-80","flex-col","gap-2"],[1,"toast-in","flex","items-start","gap-2.5","rounded-lg","border","border-border","bg-popover","px-[13px]","py-[11px]","text-[13px]","shadow-[0_10px_30px_-14px_rgba(0,0,0,.35)]","backdrop-blur-2xl"],[1,"toast-in","flex","items-start","gap-2.5","rounded-lg","border","border-border","bg-popover","px-[13px]","py-[11px]","text-[13px]","shadow-[0_10px_30px_-14px_rgba(0,0,0,.35)]","backdrop-blur-2xl",3,"mouseenter","mouseleave"],[1,"mt-px","flex","h-5","w-5","shrink-0","items-center","justify-center","rounded-full"],[1,"h-3","w-3",3,"name","strokeWidth"],[1,"flex","min-w-0","flex-1","flex-col","gap-1"],["type","button",1,"self-start","text-[12.5px]","font-semibold","text-brand","hover:underline"],["aria-label","Dismiss",1,"text-muted-foreground","hover:text-surface-foreground",3,"click"],["type","button",1,"self-start","text-[12.5px]","font-semibold","text-brand","hover:underline",3,"click"]],template:function(e,o){e&1&&(i(0,"div",0),S(1,Va,9,6,"div",1,Oa),a()),e&2&&(r(),k(o.toastService.toasts()))},dependencies:[F],styles:[".toast-in[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_toast-slide-in .28s cubic-bezier(.16,1,.3,1)}@keyframes _ngcontent-%COMP%_toast-slide-in{0%{transform:translate(24px);opacity:0}to{transform:translate(0);opacity:1}}@media(prefers-reduced-motion:reduce){.toast-in[_ngcontent-%COMP%]{animation:none}}"]})};var Aa=["notificationSettingsTpl"],Ra=()=>[import("./chunk-B5YHOJGQ.js").then(t=>t.ThemeWizardComponent)];function Ba(t,n){if(t&1){let e=h();i(0,"button",9),c("click",function(){p(e);let s=d();return m(s.openThemeWizard(!1))}),v(1,"app-icon",17),l(2," Customize theme "),a()}}function La(t,n){if(t&1&&(i(0,"span",19),l(1),a()),t&2){let e=d(2);r(),ee("",e.onboarding.doneCount()," of ",e.stepCount," done")}}function Fa(t,n){if(t&1){let e=h();i(0,"button",9),c("click",function(){p(e);let s=d();return m(s.onboarding.open())}),v(1,"app-icon",18),l(2," Onboarding "),u(3,La,2,2,"span",19),a()}if(t&2){let e=d();r(3),_(e.onboarding.status()?3:-1)}}function qa(t,n){if(t&1){let e=h();i(0,"button",9),c("click",function(){p(e);let s=d();return m(s.passkeysOpen.set(!0))}),v(1,"app-icon",20),l(2," Passkeys "),a()}}function za(t,n){if(t&1){let e=h();i(0,"button",9),c("click",function(){p(e);let s=d();return m(s.authenticatorOpen.set(!0))}),v(1,"app-icon",21),l(2," Authenticator (MFA) "),a()}}function Ua(t,n){if(t&1){let e=h();i(0,"button",22),c("click",function(){p(e);let s=d();return m(s.openTokens())}),v(1,"app-icon",23),l(2," Access tokens "),a()}}function $a(t,n){if(t&1){let e=h();i(0,"button",24),c("click",function(){p(e);let s=d();return m(s.auth.reauthenticate())}),v(1,"app-icon",25),l(2," Renew sign-in "),i(3,"span",19),l(4),a()()}if(t&2){let e=d();C("title","Session ends at "+n),r(4),b("",e.sessionRemainingLabel()," left")}}function Wa(t,n){if(t&1){let e=h();i(0,"app-passkeys-dialog",26),c("closed",function(){p(e);let s=d();return m(s.passkeysOpen.set(!1))}),a()}}function Ha(t,n){if(t&1){let e=h();i(0,"app-authenticator-dialog",26),c("closed",function(){p(e);let s=d();return m(s.authenticatorOpen.set(!1))}),a()}}function ja(t,n){if(t&1){let e=h();i(0,"app-panel",27),c("closed",function(){p(e);let s=d();return m(s.notificationSettingsOpen.set(!1))}),v(1,"app-notification-settings"),a()}}function Ga(t,n){if(t&1){let e=h();i(0,"app-theme-wizard",29),c("closed",function(){p(e);let s=d(2);return m(s.themeWizardOpen.set(!1))}),a()}if(t&2){let e=d(2);C("firstRun",e.themeWizardFirstRun())}}function Ka(t,n){if(t&1&&u(0,Ga,1,1,"app-theme-wizard",28),t&2){let e=d();_(e.themeWizardOpen()?0:-1)}}function Ya(t,n){t&1&&ht(0,16),t&2&&C("ngTemplateOutlet",n)}var Qa={accounts:"/accounts",network:"/resources"},Za={accounts:"/admin/accounts",network:"/admin/resources",users:"/users",groups:"/admin/groups",requests:"/admin/requests",activity:"/admin/activity"},Ja="Plugin list may be out of date \u2014 retrying",je=class t{auth=f(T);theme=f(Ve);plugins=f(Xt);panel=f(xn);contentWidth=f(Cn);router=f(M);onboarding=f(ae);stepCount=st;passkeysOpen=x(!1);authenticatorOpen=x(!1);notificationSettingsOpen=x(!1);notificationSettingsTpl=W("notificationSettingsTpl");windowWidth=x(window.innerWidth);collapsedOverride=x(null);static SIDEBAR_EXPANDED=240;static SHELL_GAP=12;static SHELL_PADDING=24;static SAFETY_BUFFER=48;sidebarCollapsed=w(()=>{let n=this.collapsedOverride();if(n!==null)return n;let e=this.panel.width(),o=t.SHELL_PADDING+t.SIDEBAR_EXPANDED+t.SHELL_GAP+this.contentWidth.minWidth()+(e>0?t.SHELL_GAP+e:0)+t.SAFETY_BUFFER;return this.windowWidth()<o});onWindowResize(){this.windowWidth.set(window.innerWidth)}configService=f(V);branding=this.configService.branding;mfaEnabled=!!this.configService.config.mfa&&!f(T).isFederatedSession();passkeyEnabled=!!this.configService.config.passkey&&!f(T).isFederatedSession();tokensEnabled=!!$t(this.configService);sidebar=W(Be);openTokens(){this.sidebar()?.closeUserMenu(),this.router.navigate(["/tokens"])}themeWizardOpen=x(!1);themeWizardFirstRun=x(!1);openThemeWizard(n){this.themeWizardFirstRun.set(n),this.themeWizardOpen.set(!0)}projectName=w(()=>this.branding().projectName||"Access Portal");logoUrl=w(()=>this.branding().logoUrl||"");brandShow=w(()=>this.branding().brandShow??"logo-and-project");showLogo=w(()=>this.brandShow().startsWith("logo"));brandText=w(()=>this.brandShow().includes("company")?this.branding().companyName||this.projectName():this.brandShow()==="logo"?"":this.projectName());logoLetter=w(()=>this.logoUrl()?"":(this.brandText()||this.projectName()).charAt(0).toUpperCase());notifications=f(oe);clock=f(le);sessionEndsLabel=w(()=>{let n=this.auth.sessionEndsAt();return n===null?"":ie(new Date(n).toISOString(),{sameDayTimeOnly:!0})});sessionRemainingLabel=w(()=>{let n=this.auth.sessionEndsAt();return n===null?"":on(n-this.clock.now())});navSections=w(()=>{let n=this.configService.config.network!==!1,e=this.plugins.stale(),o=N=>(N==="user"?this.plugins.userEntries():this.plugins.adminEntries()).map(q=>de({label:q.label,icon:jt.includes(q.icon)?q.icon:"bolt",route:q.route},e?{hint:Ja}:{})),s=[{label:"Your access",items:[...Nn.filter(N=>N!=="network"||n).map(N=>Ye(de({},ot[N]),{route:Qa[N]})),...o("user")]}],g=o("admin");return(this.auth.isAdmin()||g.length)&&s.push({label:"Administration",accent:!0,items:[...this.auth.isAdmin()?Mn.filter(N=>N!=="network"||n).map(N=>de(Ye(de({},ot[N]),{route:Za[N]}),N==="requests"?{badge:this.notifications.pending()?.length||0}:{})):[],...g]}),s});constructor(){this.notifications.startPolling(),f(xe).onDestroy(()=>{this.notifications.stopPolling(),this.onboarding.stop()}),_e(this.notificationSettingsOpen,this.notificationSettingsTpl,()=>this.notificationSettingsOpen.set(!1));let n=f(re);$(()=>{n.openRequests()>0&&this.openThemeWizard(!1)}),this.auth.whenReady().then(()=>{this.auth.isAdmin()&&(this.onboarding.start(),this.configService.brandingOverlayAbsent&&this.openThemeWizard(!0))})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-shell"]],viewQuery:function(e,o){e&1&&(z(o.notificationSettingsTpl,Aa,5),z(o.sidebar,Be,5)),e&2&&X(2)},hostBindings:function(e,o){e&1&&c("resize",function(){return o.onWindowResize()},xt)},decls:31,vars:22,consts:[["notificationSettingsTpl",""],[1,"shell"],["variant","glass",3,"darkModeToggle","collapseToggle","collapsed","brandName","showLogo","logoText","logoUrl","staticBell","userName","userRole","nav","darkMode"],["sidebar-bell",""],["sidebar-network",""],["sidebar-user-menu-item","","type","button",1,"menu-item"],["sidebar-user-menu-item","","type","button","data-testid","access-tokens",1,"menu-item"],["sidebar-user-menu-item","","type","button","data-testid","session-renew",1,"menu-item",3,"title"],["sidebar-user-menu-item","",1,"menu-divider"],["sidebar-user-menu-item","","type","button",1,"menu-item",3,"click"],["name","bell",1,"ic"],["sidebar-user-menu-item","","type","button",1,"menu-item","danger",3,"click"],["name","logout",1,"ic"],[1,"column"],[1,"band"],[1,"main"],[3,"ngTemplateOutlet"],["name","swatch",1,"ic"],["name","rocket",1,"ic"],[1,"progress"],["name","key",1,"ic"],["name","shield-check",1,"ic"],["sidebar-user-menu-item","","type","button","data-testid","access-tokens",1,"menu-item",3,"click"],["name","connection-details",1,"ic"],["sidebar-user-menu-item","","type","button","data-testid","session-renew",1,"menu-item",3,"click","title"],["name","refresh",1,"ic"],[3,"closed"],["title","Notifications",3,"closed"],[3,"firstRun"],[3,"closed","firstRun"]],template:function(e,o){if(e&1){let s=h();i(0,"div",1)(1,"app-sidebar",2),c("darkModeToggle",function(){return p(s),m(o.theme.toggle())})("collapseToggle",function(){return p(s),m(o.collapsedOverride.set(!o.sidebarCollapsed()))}),v(2,"app-notification-bell",3)(3,"app-network-pill",4),u(4,Ba,3,0,"button",5),u(5,Fa,4,1,"button",5),u(6,qa,3,0,"button",5),u(7,za,3,0,"button",5),u(8,Ua,3,0,"button",6),u(9,$a,5,2,"button",7),v(10,"div",8),i(11,"button",9),c("click",function(){return p(s),m(o.notificationSettingsOpen.set(!0))}),v(12,"app-icon",10),l(13," Notifications "),a(),i(14,"button",11),c("click",function(){return p(s),m(o.auth.logout())}),v(15,"app-icon",12),l(16," Sign out "),a()(),u(17,Wa,1,0,"app-passkeys-dialog"),u(18,Ha,1,0,"app-authenticator-dialog"),Ce(19,ja,2,0,"ng-template",null,0,pe),G(21,Ka,1,1),K(22,21,Ra),i(24,"div",13),v(25,"app-session-banner",14)(26,"app-setup-checklist",14),i(27,"main",15),v(28,"router-outlet"),a()(),u(29,Ya,1,1,"ng-container",16),a(),v(30,"app-toast-container")}if(e&2){let s,g;r(),C("collapsed",o.sidebarCollapsed())("brandName",o.brandText())("showLogo",o.showLogo())("logoText",o.logoLetter())("logoUrl",o.logoUrl())("staticBell",!1)("userName",o.auth.userEmail()||" ")("userRole",o.auth.isAdmin()?"admin":"")("nav",o.navSections())("darkMode",o.theme.theme()==="dark"),r(3),_(o.auth.isAdmin()?4:-1),r(),_(o.auth.isAdmin()?5:-1),r(),_(o.passkeyEnabled?6:-1),r(),_(o.mfaEnabled?7:-1),r(),_(o.tokensEnabled?8:-1),r(),_((s=o.sessionEndsLabel())?9:-1,s),r(8),_(o.passkeysOpen()?17:-1),r(),_(o.authenticatorOpen()?18:-1),r(4),Y(o.themeWizardOpen()),r(2),U("min-width",o.contentWidth.minWidth(),"px"),r(5),_((g=o.panel.content())?29:-1,g)}},dependencies:[Pt,be,Be,ze,Ue,$e,We,Re,F,He,Fe,qe,Le],styles:['[_nghost-%COMP%]{display:block;height:100vh}.shell[_ngcontent-%COMP%]{display:flex;height:100%;padding:12px;gap:12px;overflow-x:auto;overflow-y:hidden;background:var(--glass-plate);isolation:isolate}.shell[_ngcontent-%COMP%]:after{content:"";position:fixed;inset:-18%;z-index:-1;pointer-events:none;background:radial-gradient(54% 44% at 72% 16%,var(--glass-panel-glow-a),transparent 72%),radial-gradient(46% 40% at 14% 84%,var(--glass-panel-glow-b),transparent 72%)}.column[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:12px;transition:width .24s var(--ease-emphasized)}.band[_ngcontent-%COMP%], .main[_ngcontent-%COMP%]{border-radius:calc(var(--radius) * 2);-webkit-backdrop-filter:blur(42px) saturate(1.5);backdrop-filter:blur(42px) saturate(1.5);background:var(--glass-panel-bg);box-shadow:var(--shadow-card);position:relative;z-index:1}.main[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}@media(prefers-reduced-motion:reduce){.column[_ngcontent-%COMP%]{transition:none}}.menu-item[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;gap:8px;padding:8px 10px;border:none;border-radius:8px;background:none;color:var(--surface-foreground);font-size:13px;cursor:pointer;transition:background-color .14s}.menu-item[_ngcontent-%COMP%]:hover{background:var(--state-hover)}.menu-item[_ngcontent-%COMP%]   .ic[_ngcontent-%COMP%]{width:16px;height:16px;flex-shrink:0;color:var(--muted-foreground)}.menu-item[_ngcontent-%COMP%]   .progress[_ngcontent-%COMP%]{margin-left:auto;font-size:11px;color:var(--muted-foreground);font-variant-numeric:tabular-nums}.menu-item.danger[_ngcontent-%COMP%], .menu-item.danger[_ngcontent-%COMP%]   .ic[_ngcontent-%COMP%]{color:var(--danger)}.menu-item.danger[_ngcontent-%COMP%]:hover{background:var(--danger-muted)}.menu-divider[_ngcontent-%COMP%]{height:1px;margin:6px 4px;background:var(--border-strong)}']})};var Xa=["emailInput"],er=(t,n)=>n.name,$n=(t,n)=>n.label;function tr(t,n){if(t&1){let e=h();i(0,"img",12),c("error",function(){p(e);let s=d();return m(s.logoBroken.set(!0))}),a()}if(t&2){let e=d();C("src",e.branding().logoUrl,J)}}function nr(t,n){t&1&&(i(0,"div",4),v(1,"app-default-logo",13),a()),t&2&&(r(),C("animated",!0))}function ir(t,n){if(t&1){let e=h();i(0,"img",14),c("error",function(){p(e);let s=d();return m(s.logoBroken.set(!0))}),a()}if(t&2){let e=d();C("src",e.branding().logoUrl,J)}}function or(t,n){t&1&&(i(0,"div",10),v(1,"app-default-logo",15),a()),t&2&&(r(),C("animated",!0))}function ar(t,n){if(t&1&&(i(0,"p",17),l(1),a()),t&2){let e=d(2);r(),b(" Your current session ends at ",e.endsAtLabel(),". Signing in again starts a fresh one \u2014 your credentials and network connection stay as they are. ")}}function rr(t,n){if(t&1&&(i(0,"p",17),l(1),a()),t&2){let e=d(2);r(),b("to ",e.productName())}}function sr(t,n){t&1&&(i(0,"p",18),l(1),a()),t&2&&(r(),y(n))}function lr(t,n){if(t&1){let e=h();i(0,"app-button",22),c("click",function(){let s=p(e).$implicit,g=d(2);return m(g.startSso(s.name))}),l(1),a()}if(t&2){let e=n.$implicit,o=n.$index,s=d(2);C("variant",o===0?"primary":"outline")("loading",s.ssoBusy()===e.name)("disabled",s.busy()||!!s.ssoBusy()&&s.ssoBusy()!==e.name),r(),b(" Sign in with ",e.label," ")}}function dr(t,n){if(t&1&&(i(0,"p",20),l(1),a()),t&2){let e=d(2);r(),y(e.ssoError())}}function cr(t,n){if(t&1){let e=h();i(0,"button",23),c("click",function(){p(e);let s=d(2);return m(s.revealLocal())}),l(1," Sign in another way "),a()}if(t&2){let e=d(2);C("disabled",e.busy()||!!e.ssoBusy())}}function pr(t,n){t&1&&(i(0,"div",24)(1,"span"),l(2,"or"),a()())}function mr(t,n){if(t&1){let e=h();u(0,pr,3,0,"div",24),i(1,"form",25),c("ngSubmit",function(){p(e);let s=d(2);return m(s.submitEmail())}),i(2,"app-field",26)(3,"input",27,0),c("ngModelChange",function(s){p(e);let g=d(2);return m(g.email.set(s))}),a()(),i(5,"app-button",28),l(6," Continue "),a()()}if(t&2){let e=d(2);_(e.providers().length?0:-1),r(2),C("error",e.error()),r(),C("ngModel",e.email()),r(2),C("loading",e.busy())("disabled",!e.email().trim())}}function ur(t,n){if(t&1){let e=h();i(0,"button",23),c("click",function(){p(e);let s=d(2);return m(s.backToApp())}),l(1," Not now \u2014 back to the app "),a()}if(t&2){let e=d(2);C("disabled",e.busy())}}function _r(t,n){if(t&1&&(i(0,"h1",16),l(1),a(),u(2,ar,2,1,"p",17)(3,rr,2,1,"p",17),u(4,sr,2,1,"p",18),S(5,lr,2,4,"app-button",19,er),u(7,dr,2,1,"p",20),u(8,cr,2,1,"button",21)(9,mr,7,5),u(10,ur,2,1,"button",21)),t&2){let e,o=d();r(),y(o.reauthLive()?"Sign in again":"Sign in"),r(),_(o.reauthLive()?2:3),r(2),_((e=o.endedNotice())?4:-1,e),r(),k(o.providers()),r(2),_(o.ssoError()?7:-1),r(),_(o.providers().length&&!o.showLocal()?8:9),r(2),_(o.reauthLive()?10:-1)}}function gr(t,n){if(t&1){let e=h();i(0,"h1",16),l(1,"Couldn't sign you in"),a(),i(2,"p",17),l(3),a(),i(4,"button",30),c("click",function(){p(e);let s=d(2);return m(s.backToStart())}),l(5,"Back to sign in"),a()}t&2&&(r(3),y(n))}function fr(t,n){t&1&&(i(0,"div",29),v(1,"app-spinner",31),i(2,"p",17),l(3,"Signing you in\u2026"),a()())}function xr(t,n){if(t&1&&u(0,gr,6,1)(1,fr,4,0,"div",29),t&2){let e,o=d();_((e=o.ssoError())?0:1,e)}}function Cr(t,n){if(t&1&&(i(0,"p",20),l(1),a()),t&2){let e=d(3);r(),y(e.error())}}function hr(t,n){if(t&1){let e=h();i(0,"h1",16),l(1,"Sign in with your passkey"),a(),i(2,"p",17),l(3),a(),u(4,Cr,2,1,"p",20),i(5,"app-button",33),c("click",function(){p(e);let s=d(2);return m(s.pick("passkey"))}),l(6," Use passkey "),a()}if(t&2){let e=d(2);r(3),b("",e.email()," \xB7 your usual way"),r(),_(e.error()?4:-1),r(),C("loading",e.busy())}}function vr(t,n){if(t&1&&(i(0,"p",20),l(1),a()),t&2){let e=d(3);r(),y(e.error())}}function br(t,n){if(t&1){let e=h();i(0,"h1",16),l(1,"Email me a code"),a(),i(2,"p",17),l(3),a(),u(4,vr,2,1,"p",20),i(5,"app-button",33),c("click",function(){p(e);let s=d(2);return m(s.pick("email-code"))}),l(6," Send code "),a()}if(t&2){let e=d(2);r(3),b("",e.email()," \xB7 your usual way"),r(),_(e.error()?4:-1),r(),C("loading",e.busy())}}function yr(t,n){if(t&1){let e=h();u(0,hr,7,3)(1,br,7,3),i(2,"button",30),c("click",function(){p(e);let s=d();return m(s.chooseDifferent())}),l(3," Choose a different way to sign in "),a(),i(4,"button",32),c("click",function(){p(e);let s=d();return m(s.changeEmail())}),l(5," Not you? Use another email "),a()}if(t&2){let e=d();_(e.fastMethod()==="passkey"?0:1)}}function wr(t,n){if(t&1&&(i(0,"p",34),l(1),a()),t&2){let e=d(2);r(),y(e.limitedText)}}function Sr(t,n){if(t&1&&(i(0,"p",20),l(1),a()),t&2){let e=d(2);r(),y(e.error())}}function kr(t,n){t&1&&(j(),i(0,"svg",39),v(1,"path",43),a())}function Er(t,n){t&1&&(j(),i(0,"svg",39),v(1,"path",44),a())}function Tr(t,n){t&1&&(j(),i(0,"svg",39),v(1,"path",45),a())}function Pr(t,n){t&1&&(i(0,"span",42),l(1),a()),t&2&&(r(),y(n))}function Nr(t,n){if(t&1){let e=h();i(0,"button",37),c("click",function(){let s=p(e).$implicit,g=d(2);return m(g.pick(s))}),i(1,"span",38),u(2,kr,2,0,":svg:svg",39)(3,Er,2,0,":svg:svg",39)(4,Tr,2,0,":svg:svg",39),a(),i(5,"span",40)(6,"span",41),l(7),a(),u(8,Pr,2,1,"span",42),a()()}if(t&2){let e,o,s=n.$implicit,g=d(2);C("disabled",g.busy()),r(2),_((e=s)==="passkey"?2:e==="password"?3:e==="email-code"?4:-1),r(5),y(g.methodTitle(s)),r(),_((o=g.methodDesc(s))?8:-1,o)}}function Mr(t,n){t&1&&(i(0,"p",20),l(1," No sign-in method for this account works in this browser \u2014 contact your admin. "),a())}function Dr(t,n){if(t&1){let e=h();i(0,"h1",16),l(1,"How do you want to sign in?"),a(),i(2,"p",17),l(3),a(),u(4,wr,2,1,"p",34),u(5,Sr,2,1,"p",20),S(6,Nr,9,4,"button",35,Ct,!1,Mr,2,0,"p",20),i(9,"p",36),l(10,"We'll remember your choice next time."),a(),i(11,"button",32),c("click",function(){p(e);let s=d();return m(s.changeEmail())}),l(12," Use another email "),a()}if(t&2){let e=d();r(3),y(e.email()),r(),_(e.limitedNotice()?4:-1),r(),_(e.error()?5:-1),r(),k(e.methods())}}function Or(t,n){if(t&1&&(i(0,"p",34),l(1),a()),t&2){let e=d(2);r(),y(e.limitedText)}}function Ir(t,n){if(t&1){let e=h();i(0,"h1",16),l(1,"Enter your password"),a(),i(2,"p",17),l(3),a(),u(4,Or,2,1,"p",34),i(5,"form",25),c("ngSubmit",function(){p(e);let s=d();return m(s.submitPassword())}),i(6,"app-field",46)(7,"div",47)(8,"input",48),c("ngModelChange",function(s){p(e);let g=d();return m(g.password.set(s))}),a(),i(9,"button",49),c("click",function(){p(e);let s=d();return m(s.showPw.set(!s.showPw()))}),l(10),a()()(),i(11,"app-button",28),l(12," Sign in "),a()(),i(13,"button",30),c("click",function(){p(e);let s=d();return m(s.chooseDifferent())}),l(14," Choose a different way to sign in "),a(),i(15,"button",50),c("click",function(){p(e);let s=d();return m(s.forgotPassword())}),l(16," Forgot password? "),a()}if(t&2){let e=d();r(3),y(e.email()),r(),_(e.limitedNotice()?4:-1),r(2),C("error",e.error()),r(2),C("type",e.showPw()?"text":"password")("ngModel",e.password()),r(),I("aria-label",e.showPw()?"Hide password":"Show password")("aria-pressed",e.showPw()),r(),y(e.showPw()?"Hide":"Show"),r(),C("loading",e.busy())("disabled",!e.password()),r(4),C("disabled",e.busy())}}function Vr(t,n){if(t&1&&(i(0,"li")(1,"span",57),l(2),a(),l(3),a()),t&2){let e=n.$implicit,o=d(2);O("met",e.test(o.resetPassword())),r(2),y(e.test(o.resetPassword())?"\u2713":"\u25CB"),r(),b(" ",e.label," ")}}function Ar(t,n){if(t&1){let e=h();i(0,"h1",16),l(1,"Reset your password"),a(),i(2,"p",17),l(3),a(),i(4,"form",25),c("ngSubmit",function(){p(e);let s=d();return m(s.submitReset())}),i(5,"app-field",51)(6,"input",52),c("ngModelChange",function(s){p(e);let g=d();return m(g.resetCode.set(s))}),a()(),i(7,"app-field",53)(8,"div",47)(9,"input",54),c("ngModelChange",function(s){p(e);let g=d();return m(g.resetPassword.set(s))}),a(),i(10,"button",49),c("click",function(){p(e);let s=d();return m(s.showPw.set(!s.showPw()))}),l(11),a()()(),i(12,"ul",55),S(13,Vr,4,4,"li",56,$n),a(),i(15,"app-button",28),l(16," Reset password and sign in "),a()(),i(17,"button",23),c("click",function(){p(e);let s=d();return m(s.forgotPassword())}),l(18," Send a new code "),a(),i(19,"button",32),c("click",function(){p(e);let s=d();return m(s.screen.set("password"))}),l(20," Back to password "),a()}if(t&2){let e=d();r(3),b("Code sent to ",e.resetDestination()||e.email()),r(3),C("ngModel",e.resetCode()),r(),C("error",e.error()),r(2),C("type",e.showPw()?"text":"password")("ngModel",e.resetPassword()),r(),I("aria-label",e.showPw()?"Hide password":"Show password")("aria-pressed",e.showPw()),r(),y(e.showPw()?"Hide":"Show"),r(2),k(e.pwRules),r(2),C("loading",e.busy())("disabled",e.resetCode().trim().length<6||!e.pwOk(e.resetPassword())),r(2),C("disabled",e.busy())}}function Rr(t,n){if(t&1){let e=h();i(0,"h1",16),l(1,"Enter the code we emailed"),a(),i(2,"p",17),l(3),a(),i(4,"form",25),c("ngSubmit",function(){p(e);let s=d();return m(s.submitCode())}),i(5,"app-field",58)(6,"input",59),c("ngModelChange",function(s){p(e);let g=d();return m(g.code.set(s))}),a()(),i(7,"app-button",28),l(8," Sign in "),a()(),i(9,"button",23),c("click",function(){p(e);let s=d();return m(s.resendCode())}),l(10," Send a new code "),a(),i(11,"button",32),c("click",function(){p(e);let s=d();return m(s.chooseDifferent())}),l(12," Choose a different way to sign in "),a()}if(t&2){let e=d();r(3),b("Sent to ",e.otpDestination()||e.email()),r(2),C("error",e.error()),r(),C("ngModel",e.code()),r(),C("loading",e.busy())("disabled",e.code().trim().length<6),r(2),C("disabled",e.busy())}}function Br(t,n){if(t&1){let e=h();i(0,"h1",16),l(1,"Enter your authenticator code"),a(),i(2,"p",17),l(3),a(),i(4,"form",25),c("ngSubmit",function(){p(e);let s=d();return m(s.submitTotp())}),i(5,"app-field",60)(6,"input",61),c("ngModelChange",function(s){p(e);let g=d();return m(g.totpCode.set(s))}),a()(),i(7,"app-button",28),l(8," Sign in "),a()(),i(9,"button",30),c("click",function(){p(e);let s=d();return m(s.chooseDifferent())}),l(10," Choose a different way to sign in "),a()}if(t&2){let e=d();r(3),b("",e.email()," \xB7 from your authenticator app"),r(2),C("error",e.error()),r(),C("ngModel",e.totpCode()),r(),C("loading",e.busy())("disabled",e.totpCode().trim().length<6)}}function Lr(t,n){if(t&1){let e=h();i(0,"h1",16),l(1,"Set up your authenticator"),a(),i(2,"p",17),l(3),a(),i(4,"div",62),v(5,"app-qr-code",63),a(),i(6,"p",36),l(7," Scan with any authenticator app (Google Authenticator, 1Password, Authy\u2026) \u2014 or enter this key manually: "),a(),i(8,"p",64),l(9),a(),i(10,"form",25),c("ngSubmit",function(){p(e);let s=d();return m(s.submitTotpSetup())}),i(11,"app-field",65)(12,"input",66),c("ngModelChange",function(s){p(e);let g=d();return m(g.totpSetupCode.set(s))}),a()(),i(13,"app-button",28),l(14," Verify and sign in "),a()()}if(t&2){let e=d();r(3),b("",e.email()," \xB7 required for password sign-in"),r(2),C("data",e.totpUri()),r(4),y(e.totpSecret()),r(2),C("error",e.error()),r(),C("ngModel",e.totpSetupCode()),r(),C("loading",e.busy())("disabled",e.totpSetupCode().trim().length<6)}}function Fr(t,n){if(t&1&&(i(0,"li")(1,"span",57),l(2),a(),l(3),a()),t&2){let e=n.$implicit,o=d(2);O("met",e.test(o.newPassword())),r(2),y(e.test(o.newPassword())?"\u2713":"\u25CB"),r(),b(" ",e.label," ")}}function qr(t,n){if(t&1){let e=h();i(0,"h1",16),l(1,"Set your password"),a(),i(2,"p",17),l(3),a(),i(4,"form",25),c("ngSubmit",function(){p(e);let s=d();return m(s.submitNewPassword())}),i(5,"app-field",53)(6,"div",47)(7,"input",67),c("ngModelChange",function(s){p(e);let g=d();return m(g.newPassword.set(s))}),a(),i(8,"button",49),c("click",function(){p(e);let s=d();return m(s.showPw.set(!s.showPw()))}),l(9),a()()(),i(10,"ul",55),S(11,Fr,4,4,"li",56,$n),a(),i(13,"app-button",28),l(14," Set password and sign in "),a()()}if(t&2){let e=d();r(3),b("First sign-in for ",e.email()," \u2014 choose the password you'll use from now on."),r(2),C("error",e.error()),r(2),C("type",e.showPw()?"text":"password")("ngModel",e.newPassword()),r(),I("aria-label",e.showPw()?"Hide password":"Show password")("aria-pressed",e.showPw()),r(),y(e.showPw()?"Hide":"Show"),r(2),k(e.pwRules),r(2),C("loading",e.busy())("disabled",!e.pwOk(e.newPassword()))}}function zr(t,n){if(t&1&&(i(0,"a",11),l(1,"Open in the desktop app"),a()),t&2){let e=d();C("href",e.desktopHref(),J)}}var Un=[{label:"At least 8 characters",test:t=>t.length>=8},{label:"An uppercase letter",test:t=>/[A-Z]/.test(t)},{label:"A lowercase letter",test:t=>/[a-z]/.test(t)},{label:"A number",test:t=>/[0-9]/.test(t)},{label:"A symbol (like ! $ % or *)",test:t=>/[^A-Za-z0-9\s]/.test(t)}],ge=class t{auth=f(T);api=f(te);router=f(M);configService=f(V);theme=f(Ve);bridge=f(H);federation=f(On);lastEmail=Bt();providers=this.federation.providers;showLocal=x(!!this.lastEmail&&tt(this.lastEmail)!=="sso");ssoBusy=x(null);ssoError=x("");emailInput=W("emailInput");ssoTimer=null;inviteHash=x("");desktopHref=w(()=>this.bridge.isDesktop?null:`infraclient://${location.host}${location.pathname}${location.search}${this.inviteHash()}`);screen=x("email");email=x(this.lastEmail);password=x("");code=x("");newPassword=x("");resetCode=x("");resetPassword=x("");resetDestination=x("");showPw=x(!1);busy=x(!1);error=x("");otpDestination=x("");fastMethod=x(null);limitedNotice=x(!1);limitedText="Only your password is offered this time. Either this sign-in looks unusual (a new network or device) and your usual way comes back once it is recognized, or an authenticator app is on for this account, which makes password + code the only way in.";totpCode=x("");totpSetupCode=x("");totpSecret=x("");session="";method="password";pwRules=Un;pwOk(n){return Un.every(e=>e.test(n))}inviteUsername=null;endedReason=x(null);endedNotice=w(()=>{switch(this.endedReason()){case"expired":return`Your session reached its ${this.auth.sessionHours()}-hour limit. Sign in again to pick up where you left off.`;case"invalid":return"Your session ended. Sign in again to continue.";case"elsewhere":return"You were signed out in another window.";default:return""}});reauth=x(!1);reauthLive=w(()=>this.reauth()&&this.auth.isAuthenticated());endsAtLabel=w(()=>{let n=this.auth.sessionEndsAt();return n===null?"":ie(new Date(n).toISOString(),{sameDayTimeOnly:!0})});branding=this.configService.branding;productName=w(()=>this.branding().projectName||"Access Portal");logoBroken=x(!1);methods=w(()=>{let n=[];return this.availableSig().includes("WEB_AUTHN")&&Kt()&&this.bridge.passkeyCapable&&n.push("passkey"),this.availableSig().some(e=>e==="PASSWORD"||e==="PASSWORD_SRP")&&n.push("password"),this.availableSig().includes("EMAIL_OTP")&&n.push("email-code"),n});availableSig=x([]);constructor(){Rt(),new URLSearchParams(location.search).get("reauth")==="1"&&(sessionStorage.setItem(it,"1"),history.replaceState(null,"",location.pathname)),this.reauth.set(this.auth.reauthPending());let n=sessionStorage.getItem(nt);sessionStorage.removeItem(nt),(n==="expired"||n==="invalid"||n==="elsewhere")&&this.endedReason.set(n),this.auth.whenReady().then(()=>{this.auth.isAuthenticated()&&!this.busy()&&this.screen()==="email"&&!this.reauth()&&this.router.navigateByUrl("/")}),location.pathname.startsWith("/auth/callback")?this.consumeSsoCallback():this.consumeInviteLink()}backToApp(){sessionStorage.removeItem(it),this.reauth.set(!1);let n=sessionStorage.getItem(ue);sessionStorage.removeItem(ue);let e=n&&n.startsWith("/")&&!n.startsWith("//")?n:"/";this.router.navigateByUrl(e)}consumeSsoCallback(){let n=location.search;if(!n){this.router.navigateByUrl("/");return}history.replaceState(null,"",location.pathname),this.screen.set("sso"),this.federation.complete(n).then(e=>{if(!e)return;let o=Ut(e.tokens.IdToken).email??"";this.auth.completeSignIn(e.tokens,o,"sso",{federationClientId:e.clientId})}).catch(e=>this.ssoError.set(Dn(e)))}backToStart(){this.ssoError.set(""),this.screen.set("email"),location.pathname.startsWith("/login")||history.replaceState(null,"","/login")}revealLocal(){this.showLocal.set(!0),setTimeout(()=>this.emailInput()?.nativeElement.focus())}consumeInviteLink(){let n=location.href.indexOf("#"),e=n<0?"":location.href.slice(n);if(!e.startsWith("#inv="))return;this.showLocal.set(!0),this.inviteHash.set(e),history.replaceState(null,"",location.pathname+location.search);let o=e.slice(5),s=o.indexOf(":");if(s<=0)return;let g=o.slice(0,s),N=o.slice(s+1);this.busy.set(!0),this.error.set(""),P(this,null,function*(){let q;try{q=yield this.api.signInWithPassword(g,N)}catch(fe){let Ke=N;try{Ke=decodeURIComponent(N)}catch{}if(Ke===N)throw fe;q=yield this.api.signInWithPassword(g,Ke)}try{let fe=JSON.parse(q.ChallengeParameters?.userAttributes??"{}");fe.email&&this.email.set(fe.email)}catch{}this.inviteUsername=g,this.method="password",yield this.handleStep(q)}).catch(()=>{this.inviteHash.set(""),this.error.set("That set-password link isn\u2019t valid anymore \u2014 ask your admin to resend the invite, or sign in another way.")}).finally(()=>this.busy.set(!1))}methodTitle(n){return n==="passkey"?"Passkey":n==="password"?"Password":"Email me a code"}methodDesc(n){return n==="passkey"?"Touch ID, Face ID, or security key":n==="email-code"?"Sent only if you choose this":""}startSso(n){this.busy()||this.ssoBusy()||(this.ssoBusy.set(n),this.ssoError.set(""),this.ssoTimer&&clearTimeout(this.ssoTimer),this.ssoTimer=setTimeout(()=>{this.ssoBusy.set(null),this.ssoError.set("The sign-in page did not open here. If it opened in another window, finish there and come back.")},8e3),this.federation.start(n).catch(()=>{this.ssoTimer&&clearTimeout(this.ssoTimer),this.ssoBusy.set(null),this.ssoError.set("Federated sign-in is not available right now.")}))}submitEmail(){let n=this.email().trim();!n||this.busy()||(this.inviteUsername=null,this.run(()=>P(this,null,function*(){let e=yield this.api.startSignIn(n);if(yield this.applySelect(e))return;let o=tt(n);this.limitedNotice.set(o!==null&&o!=="password"&&o!=="sso"&&!this.methods().includes(o)&&this.methods().includes("password")),o&&this.methods().includes(o)?o==="password"?(this.method="password",this.screen.set("password")):(this.fastMethod.set(o),this.screen.set("fast")):this.screen.set("choose")})))}pick(n){if(!this.busy()){if(this.method=n,n==="password"){this.error.set(""),this.screen.set("password");return}this.run(()=>P(this,null,function*(){let e=n==="email-code"?yield this.api.requestEmailCode(this.email().trim()):yield this.api.startPasskeySignIn(this.email().trim());if(e.ChallengeName==="SELECT_CHALLENGE"){this.availableSig.set(e.AvailableChallenges??[]),this.session=e.Session??"",this.screen.set("choose"),this.error.set("No passkey on this account yet \u2014 pick another way.");return}yield this.handleStep(e)}))}}submitPassword(){this.busy()||this.run(()=>P(this,null,function*(){this.method="password";let n=yield this.api.signInWithPassword(this.email().trim(),this.password());yield this.handleStep(n)}))}submitCode(){this.busy()||this.run(()=>P(this,null,function*(){let n=yield this.api.respondToChallenge("EMAIL_OTP",this.session,{USERNAME:this.email().trim(),EMAIL_OTP_CODE:this.code().trim()});yield this.handleStep(n)}))}submitTotp(){this.busy()||this.run(()=>P(this,null,function*(){let n=yield this.api.respondToChallenge("SOFTWARE_TOKEN_MFA",this.session,{USERNAME:this.inviteUsername??this.email().trim(),SOFTWARE_TOKEN_MFA_CODE:this.totpCode().trim()});yield this.handleStep(n)}))}submitTotpSetup(){this.busy()||this.run(()=>P(this,null,function*(){let n=yield this.api.verifySoftwareToken({session:this.session},this.totpSetupCode().trim());this.session=n.Session??this.session;let e=yield this.api.respondToChallenge("MFA_SETUP",this.session,{USERNAME:this.inviteUsername??this.email().trim()});yield this.handleStep(e)}))}totpUri(){let n=encodeURIComponent(this.productName());return`otpauth://totp/${encodeURIComponent(`${this.productName()}:${this.email().trim()}`)}?secret=${this.totpSecret()}&issuer=${n}`}submitNewPassword(){this.busy()||this.run(()=>P(this,null,function*(){let n=yield this.api.respondToChallenge("NEW_PASSWORD_REQUIRED",this.session,{USERNAME:this.inviteUsername??this.email().trim(),NEW_PASSWORD:this.newPassword()});yield this.handleStep(n)}))}resendCode(){this.busy()||(this.method="email-code",this.code.set(""),this.run(()=>P(this,null,function*(){yield this.handleStep(yield this.api.requestEmailCode(this.email().trim()))})))}chooseDifferent(){if(!this.busy()){if(this.password.set(""),this.code.set(""),this.error.set(""),this.methods().length){this.screen.set("choose");return}this.run(()=>P(this,null,function*(){(yield this.applySelect(yield this.api.startSignIn(this.email().trim())))||this.screen.set("choose")}))}}forgotPassword(){this.busy()||this.run(()=>P(this,null,function*(){let n=yield this.api.forgotPassword(this.email().trim());this.resetDestination.set(n.CodeDeliveryDetails?.Destination??""),this.resetCode.set(""),this.resetPassword.set(""),this.screen.set("reset")}))}submitReset(){this.busy()||this.run(()=>P(this,null,function*(){let n=this.email().trim();yield this.api.confirmForgotPassword(n,this.resetCode().trim(),this.resetPassword()),this.method="password",yield this.handleStep(yield this.api.signInWithPassword(n,this.resetPassword()))}))}changeEmail(){this.busy()||(Ft(),this.inviteUsername=null,this.email.set(""),this.password.set(""),this.code.set(""),this.error.set(""),this.limitedNotice.set(!1),this.screen.set("email"))}applySelect(n){return P(this,null,function*(){return this.session=n.Session??"",this.availableSig.set(n.AvailableChallenges??[]),n.ChallengeName&&n.ChallengeName!=="SELECT_CHALLENGE"?(yield this.handleStep(n),!0):!1})}handleStep(n){return P(this,null,function*(){if(this.session=n.Session??this.session,n.AuthenticationResult){this.auth.completeSignIn(n.AuthenticationResult,this.email().trim(),this.method);return}switch(n.ChallengeName){case"SELECT_CHALLENGE":this.availableSig.set(n.AvailableChallenges??[]),this.screen.set("choose");return;case"EMAIL_OTP":this.method="email-code",this.otpDestination.set(n.ChallengeParameters?.CODE_DELIVERY_DESTINATION??""),this.code.set(""),this.screen.set("otp");return;case"WEB_AUTHN":{this.method="passkey";let e=n.ChallengeParameters?.CREDENTIAL_REQUEST_OPTIONS;if(!e)throw new me("MissingOptions","Passkey sign-in unavailable.");let{credentialId:o,credential:s}=yield Zt(e).catch(N=>{throw Wn(N)&&!zt(Qt(e))?new me("PasskeyNotHere",Ur(this.bridge.isDesktop)):N});ye(o);let g=yield this.api.respondToChallenge("WEB_AUTHN",this.session,{USERNAME:this.email().trim(),CREDENTIAL:s});yield this.handleStep(g);return}case"NEW_PASSWORD_REQUIRED":this.screen.set("new-password");return;case"SOFTWARE_TOKEN_MFA":this.totpCode.set(""),this.screen.set("totp");return;case"MFA_SETUP":{let e=yield this.api.associateSoftwareToken({session:this.session});this.session=e.Session??this.session,this.totpSecret.set(e.SecretCode),this.totpSetupCode.set(""),this.screen.set("totp-setup");return}default:throw new me("UnsupportedChallenge",`This account needs a sign-in step the app doesn't support yet (${n.ChallengeName}).`)}})}run(n){this.busy.set(!0),this.error.set(""),n().catch(e=>this.error.set($r(e,this.screen()))).finally(()=>this.busy.set(!1))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-login-page"]],viewQuery:function(e,o){e&1&&z(o.emailInput,Xa,5),e&2&&X()},hostAttrs:[1,"login-ground"],decls:25,vars:4,consts:[["emailInput",""],[1,"loginwrap"],[1,"hero"],["alt","",1,"hero-logo",3,"src"],[1,"hero-logo","hero-lettermark"],[1,"hero-title"],[1,"hero-sub"],[1,"formside"],[1,"card"],["alt","",1,"logo",3,"src"],[1,"logo","lettermark"],[1,"fine-link","desktop-link",3,"href"],["alt","",1,"hero-logo",3,"error","src"],[1,"h-full","w-full","p-3",3,"animated"],["alt","",1,"logo",3,"error","src"],[1,"h-full","w-full","p-2",3,"animated"],[1,"card-title"],[1,"who"],["role","status","data-testid","session-ended",1,"notice"],[1,"block-btn","sso-btn",3,"variant","loading","disabled"],[1,"err"],["type","button",1,"alt",3,"disabled"],[1,"block-btn","sso-btn",3,"click","variant","loading","disabled"],["type","button",1,"alt",3,"click","disabled"],[1,"divider"],[3,"ngSubmit"],["label","Email",3,"error"],["type","email","name","email","autocomplete","email","autofocus","",1,"ui-input",3,"ngModelChange","ngModel"],["type","submit",1,"block-btn",3,"loading","disabled"],["role","status","aria-live","polite",1,"sso-wait"],["type","button",1,"alt",3,"click"],["sizeClass","h-7 w-7"],["type","button",1,"fine-link",3,"click"],[1,"block-btn",3,"click","loading"],["role","status","data-testid","limited-methods",1,"notice"],["type","button",1,"method",3,"disabled"],[1,"fine"],["type","button",1,"method",3,"click","disabled"],[1,"ic"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.7"],[1,"mtext"],[1,"t"],[1,"d"],["stroke-linecap","round","stroke-linejoin","round","d","M7.9 8.2a4.5 4.5 0 018.9 1v2.1m-9.7 1.9a13 13 0 01-.3-2.9 4.5 4.5 0 01.9-2.7m3.6 9.9c-.4-1.3-.6-2.7-.6-4.2a2.25 2.25 0 014.5 0c0 .8.05 1.6.16 2.4m-1.4 4.3a19 19 0 01-.9-2.5m4.6 1.3c.3-1.6.44-3.3.44-5A6.75 6.75 0 008.6 5.6"],["stroke-linecap","round","stroke-linejoin","round","d","M15.75 5.25a3 3 0 013 3m2.25 0a5.25 5.25 0 01-10.7 1.6l-6.55 6.55v3.35h3.35l.9-.9v-1.85h1.85l1.35-1.35a5.25 5.25 0 019.8-7.4z"],["stroke-linecap","round","stroke-linejoin","round","d","M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.24a2.25 2.25 0 01-1.07 1.92l-7.5 4.62a2.25 2.25 0 01-2.36 0l-7.5-4.62a2.25 2.25 0 01-1.07-1.92v-.24"],["label","Password",3,"error"],[1,"pw-wrap"],["name","password","autocomplete","current-password","autofocus","",1,"ui-input",3,"ngModelChange","type","ngModel"],["type","button",1,"pw-eye",3,"click"],["type","button",1,"fine-link",3,"click","disabled"],["label","Code"],["type","text","name","resetCode","inputmode","numeric","autocomplete","one-time-code","maxlength","8","autofocus","",1,"ui-input","code",3,"ngModelChange","ngModel"],["label","New password",3,"error"],["name","resetPassword","autocomplete","new-password",1,"ui-input",3,"ngModelChange","type","ngModel"],["aria-live","polite",1,"pw-rules"],[3,"met"],["aria-hidden","true"],["label","Code",3,"error"],["type","text","name","code","inputmode","numeric","autocomplete","one-time-code","maxlength","8","autofocus","",1,"ui-input","code",3,"ngModelChange","ngModel"],["label","6-digit code",3,"error"],["type","text","name","totp","inputmode","numeric","autocomplete","one-time-code","maxlength","6","autofocus","",1,"ui-input","code",3,"ngModelChange","ngModel"],[1,"qr-wrap"],[3,"data"],[1,"secret"],["label","6-digit code from the app",3,"error"],["type","text","name","totpSetup","inputmode","numeric","autocomplete","one-time-code","maxlength","6",1,"ui-input","code",3,"ngModelChange","ngModel"],["name","newPassword","autocomplete","new-password","autofocus","",1,"ui-input",3,"ngModelChange","type","ngModel"]],template:function(e,o){if(e&1&&(i(0,"div",1)(1,"div",2),u(2,tr,1,1,"img",3)(3,nr,2,1,"div",4),i(4,"h2",5),l(5,"One place for all"),v(6,"br"),l(7,"your AWS access"),a(),i(8,"p",6),l(9," Short-lived credentials, approvals and audit \u2014 under your own brand. "),a()(),i(10,"div",7)(11,"div",8),u(12,ir,1,1,"img",9)(13,or,2,1,"div",10),u(14,_r,11,6)(15,xr,2,1)(16,yr,6,1)(17,Dr,13,4)(18,Ir,17,11)(19,Ar,21,11)(20,Rr,13,6)(21,Br,11,5)(22,Lr,15,7)(23,qr,15,9),u(24,zr,2,1,"a",11),a()()()),e&2){let s;r(2),_(o.branding().logoUrl&&!o.logoBroken()?2:3),r(10),_(o.branding().logoUrl&&!o.logoBroken()?12:13),r(2),_((s=o.screen())==="email"?14:s==="sso"?15:s==="fast"?16:s==="choose"?17:s==="password"?18:s==="reset"?19:s==="otp"?20:s==="totp"?21:s==="totp-setup"?22:s==="new-password"?23:-1),r(10),_(o.desktopHref()?24:-1)}},dependencies:[Oe,Me,ke,Ee,Te,De,Ne,Pe,R,Pn,Ie,se,ne],styles:['[_nghost-%COMP%]{display:block;min-height:100vh;background:var(--glass-plate)}.pw-wrap[_ngcontent-%COMP%]{position:relative}.pw-wrap[_ngcontent-%COMP%]   .ui-input[_ngcontent-%COMP%]{width:100%;padding-right:58px}.pw-eye[_ngcontent-%COMP%]{position:absolute;top:0;right:0;height:100%;padding:0 12px;background:none;border:0;cursor:pointer;font-size:.78rem;font-weight:600;color:var(--text-secondary)}.pw-eye[_ngcontent-%COMP%]:hover{color:var(--muted-foreground)}.pw-rules[_ngcontent-%COMP%]{margin:10px 0 14px;padding:0;list-style:none;display:grid;gap:4px;font-size:12.5px;color:var(--muted-foreground)}.pw-rules[_ngcontent-%COMP%]   .met[_ngcontent-%COMP%]{color:var(--success)}.loginwrap[_ngcontent-%COMP%]{display:flex;min-height:100vh;overflow:hidden;position:relative;isolation:isolate}.loginwrap[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:-18%;z-index:-1;pointer-events:none;background:radial-gradient(54% 44% at 72% 16%,var(--glass-panel-glow-a),transparent 72%),radial-gradient(46% 40% at 14% 84%,var(--glass-panel-glow-b),transparent 72%)}.hero[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:48px;text-align:center;color:#12141ceb}[data-theme="dark"][_nghost-%COMP%]   .hero[_ngcontent-%COMP%], [data-theme="dark"]   [_nghost-%COMP%]   .hero[_ngcontent-%COMP%]{color:#e8eaef}.hero-logo[_ngcontent-%COMP%]{width:88px;height:88px;border-radius:calc(var(--radius) * 2);object-fit:contain;box-shadow:0 12px 34px -12px #0009}.hero-lettermark[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;color:var(--brand);box-shadow:none}.hero-title[_ngcontent-%COMP%]{font-size:26px;font-weight:600;letter-spacing:-.02em;line-height:1.3;margin:0}.hero-sub[_ngcontent-%COMP%]{font-size:14px;line-height:1.55;max-width:360px;margin:0;color:#12141c8f}[data-theme="dark"][_nghost-%COMP%]   .hero-sub[_ngcontent-%COMP%], [data-theme="dark"]   [_nghost-%COMP%]   .hero-sub[_ngcontent-%COMP%]{color:#e8eaef9e}.formside[_ngcontent-%COMP%]{flex:1.15;display:grid;place-items:center;padding:40px}.card[_ngcontent-%COMP%]{width:100%;max-width:360px;border-radius:calc(var(--radius) * 2.5);-webkit-backdrop-filter:blur(44px) saturate(1.5);backdrop-filter:blur(44px) saturate(1.5);background:var(--glass-panel-bg);box-shadow:0 30px 80px -30px #14162847;padding:36px 32px}[data-theme="dark"][_nghost-%COMP%]   .card[_ngcontent-%COMP%], [data-theme="dark"]   [_nghost-%COMP%]   .card[_ngcontent-%COMP%]{box-shadow:0 30px 80px -30px #000000b3}.logo[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:10px;margin:0 auto 12px;display:none;object-fit:contain}.lettermark[_ngcontent-%COMP%]{align-items:center;justify-content:center;color:var(--brand)}@media(max-width:880px){.hero[_ngcontent-%COMP%]{display:none}.formside[_ngcontent-%COMP%]{flex:1;padding:24px}.card[_ngcontent-%COMP%] > img.logo[_ngcontent-%COMP%]{display:block}.card[_ngcontent-%COMP%] > .lettermark[_ngcontent-%COMP%]{display:flex}}.card-title[_ngcontent-%COMP%]{font-size:20px;font-weight:600;letter-spacing:-.01em;margin:0;text-align:center;text-wrap:balance}.who[_ngcontent-%COMP%]{font-size:13.5px;color:var(--muted-foreground);margin:6px 0 24px;text-align:center}.block-btn[_ngcontent-%COMP%]{display:block;margin-top:16px}.block-btn[_ngcontent-%COMP%]     button{width:100%}.sso-btn[_ngcontent-%COMP%] + .sso-btn[_ngcontent-%COMP%]{margin-top:10px}.sso-wait[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:12px;padding:12px 0 4px}.divider[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin:18px 0 2px;font-size:12px;color:var(--muted-foreground)}.divider[_ngcontent-%COMP%]:before, .divider[_ngcontent-%COMP%]:after{content:"";flex:1;height:1px;background:var(--border-strong)}.method[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:11px 14px;border:1px solid var(--border-strong);border-radius:calc(var(--radius) * 1.25);background:var(--surface);margin-bottom:10px;cursor:pointer;transition:border-color .15s var(--ease-standard)}.method[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--brand);box-shadow:0 0 0 1px var(--brand)}.method[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:default}.ic[_ngcontent-%COMP%]{width:22px;height:22px;flex-shrink:0;color:var(--brand-text)}.ic[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:100%;height:100%}.mtext[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.t[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:var(--surface-foreground)}.d[_ngcontent-%COMP%]{font-size:12px;color:var(--muted-foreground)}.alt[_ngcontent-%COMP%]{display:block;width:100%;margin-top:16px;font-size:13px;font-weight:500;color:var(--brand-text);text-align:center}.alt[_ngcontent-%COMP%]:hover{text-decoration:underline}.fine[_ngcontent-%COMP%]{font-size:12px;color:var(--muted-foreground);text-align:center;margin:14px 0 0}.fine-link[_ngcontent-%COMP%]{display:block;width:100%;margin-top:12px;font-size:12px;color:var(--muted-foreground);text-align:center}.fine-link[_ngcontent-%COMP%]:hover{text-decoration:underline;color:var(--surface-foreground)}a.fine-link[_ngcontent-%COMP%]{text-decoration:none}.err[_ngcontent-%COMP%]{font-size:13px;color:var(--danger);margin:0 0 12px}.notice[_ngcontent-%COMP%]{font-size:13px;color:var(--warning);background:var(--warning-muted);border-radius:8px;padding:8px 12px;margin:-12px 0 18px;text-align:center}input.code[_ngcontent-%COMP%]{text-align:center;font-size:18px;letter-spacing:.35em;font-variant-numeric:tabular-nums}.qr-wrap[_ngcontent-%COMP%]{display:flex;justify-content:center;margin:2px 0 10px}.secret[_ngcontent-%COMP%]{font-family:ui-monospace,monospace;font-size:12px;text-align:center;word-break:break-all;-webkit-user-select:all;user-select:all;color:var(--surface-foreground);background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:8px 10px;margin:8px 0 12px}']})},Wn=t=>t instanceof DOMException&&t.name==="NotAllowedError";function Ur(t){return`No passkey is set up for this account in ${t?"this app":"this browser"} yet \u2014 passkeys stay with the browser or app they were added in. Sign in another way, then add one under Passkeys in your profile menu.`}function $r(t,n){if(Wn(t))return"The passkey prompt was closed \u2014 try again, or choose a different way.";if(t instanceof me)switch(t.code){case"NotAuthorizedException":return n==="password"?"That password isn\u2019t right.":n==="otp"?"That sign-in attempt expired \u2014 send a new code.":n==="totp"||n==="totp-setup"?"That sign-in attempt expired \u2014 start over from your password.":"We couldn\u2019t sign you in \u2014 try again.";case"UserNotFoundException":return"We couldn\u2019t sign you in \u2014 try again.";case"CodeMismatchException":return n==="totp"||n==="totp-setup"?"That code isn\u2019t right \u2014 enter the current code from your app.":"That code isn\u2019t right \u2014 check the newest email.";case"EnableSoftwareTokenMFAException":return"That code isn\u2019t right \u2014 enter the current code from your app.";case"ExpiredCodeException":return"That code expired \u2014 send a new one.";case"CodeDeliveryFailureException":case"InvalidEmailRoleAccessPolicyException":return"The email couldn\u2019t be sent \u2014 a problem on this deployment\u2019s side, not your connection. Ask your admin.";case"PasswordResetRequiredException":return"Your password needs a reset \u2014 ask your admin to re-invite you.";case"InvalidPasswordException":return t.message.replace(/^Password did not conform with policy: /,"");case"LimitExceededException":case"TooManyRequestsException":return"Too many attempts \u2014 wait a minute and try again.";case"UnsupportedChallenge":case"PasskeyNotHere":return t.message}return"Something went wrong \u2014 check your connection and try again."}var Hn=[{path:"login",component:ge},{path:"auth/callback",component:ge},{path:"",canActivate:[Vn],component:je,children:[{path:"",pathMatch:"full",redirectTo:"accounts"},{path:"accounts",loadComponent:()=>import("./chunk-CRA4BXRG.js").then(t=>t.AccountsPageComponent)},{path:"plugins/:pluginId/:section",canActivate:[In],loadComponent:()=>import("./chunk-QPJMXXVU.js").then(t=>t.PluginPageComponent)},{path:"resources",canActivate:[at],loadComponent:()=>import("./chunk-AGIEKAIC.js").then(t=>t.ResourcesPageComponent)},{path:"tokens",canActivate:[Wt],loadComponent:()=>import("./chunk-RT3Z3BAE.js").then(t=>t.TokensPageComponent)},{path:"users",canActivate:[Q],loadComponent:()=>import("./chunk-XYMRYK4W.js").then(t=>t.UsersPageComponent)},{path:"admin/accounts",canActivate:[Q],loadComponent:()=>import("./chunk-BU5KGVV6.js").then(t=>t.AdminAccountsPageComponent)},{path:"admin/resources",canActivate:[Q,at],loadComponent:()=>import("./chunk-2N3QJQ54.js").then(t=>t.AdminResourcesPageComponent)},{path:"admin/requests",canActivate:[Q],loadComponent:()=>import("./chunk-WTTH75JL.js").then(t=>t.AdminRequestsPageComponent)},{path:"admin/groups",canActivate:[Q],loadComponent:()=>import("./chunk-C7PXYYAE.js").then(t=>t.GroupsPageComponent)},{path:"admin/service-users",redirectTo:"/users?tab=service-users"},{path:"admin/activity",canActivate:[Q],loadComponent:()=>import("./chunk-SPUUYPZQ.js").then(t=>t.ActivityPageComponent)}]},{path:"**",redirectTo:""}];function Wr(t,n){let e=t.isAuthenticated()?"Couldn\u2019t renew your session. Check your connection and try again.":"Your session has ended. Sign in again.";return new et({status:401,statusText:n.statusText,url:n.url??void 0,headers:n.headers,error:{message:e}})}var jn=(t,n)=>{if(!t.url.startsWith("/api/"))return n(t);let e=f(T),o=s=>{let g=e.idToken();return g?s.clone({setHeaders:{Authorization:`Bearer ${g}`}}):s};return n(o(t)).pipe(ut(s=>s instanceof et&&s.status===401?ct(e.refreshNow()).pipe(_t(g=>g?n(o(t)):Qe(()=>Wr(e,s)))):Qe(()=>s)))};var Hr=t=>{let n=t;return n?.name==="ChunkLoadError"||/Failed to fetch dynamically imported module|Importing a module script failed|error loading dynamically imported module/i.test(n?.message??"")},dt="auth.chunkReload",jr=t=>{if(!Hr(t.error))return;let n=!1;try{n=sessionStorage.getItem(dt)===t.url,n||sessionStorage.setItem(dt,t.url)}catch{}n||window.location.assign(t.url)},Gr=()=>{f(M).events.subscribe(t=>{if(t instanceof ve)try{sessionStorage.removeItem(dt)}catch{}})},Gn={providers:[Tt({eventCoalescing:!0}),Vt(Hn,At(jr)),Dt(Ot([jn])),Ze(()=>pt(f(V).config$).then(en)),Ze(Gr)]};var Ge=class t{constructor(){f(T).init()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(e,o){e&1&&v(0,"router-outlet")},dependencies:[be],encapsulation:2})};Mt(Ge,Gn).catch(t=>console.error(t));