@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 • 127 kB
JavaScript
import{a as Jt,b as Xt,c as en,d as tn,e as Vn,f as Rn}from"./chunk-Y6FHN4DA.js";import{a as On,b as dt,c as An,d as In,e as Fe}from"./chunk-WVUAN6VX.js";import{a as bn}from"./chunk-JZCV6CMZ.js";import{c as on}from"./chunk-TOO3FEYQ.js";import{c as an,i as Re}from"./chunk-YMS43IBH.js";import{a as nn}from"./chunk-6CP7VLN2.js";import{a as En,b as Tn,c as Pn,d as Nn,e as Mn,g as Dn}from"./chunk-HG4PBSMW.js";import{a as Zt}from"./chunk-64ITJKG6.js";import{b as sn,c as dn,d as cn,e as pn,f as mn,g as un,h as _n,i as gn,j as fn,k as xn,l as ie}from"./chunk-K4OFWFQE.js";import{a as Cn}from"./chunk-IKK5DQ3Z.js";import{a as Gt,b as Kt}from"./chunk-LEEL6MDA.js";import{a as ne}from"./chunk-HUXCPIDO.js";import{a as rn}from"./chunk-XPF5YBGU.js";import"./chunk-XUEIITMC.js";import{a as qt,b as pe,c as ee,d as zt,e as rt,f as Ut,g as $t,h as Se,i as Wt,j as Ht,s as me,t as st,u as lt,v as T,w as jt}from"./chunk-Z2HQA5DO.js";import{a as kn}from"./chunk-7DUEGRIY.js";import"./chunk-QAZJZDEE.js";import"./chunk-2DD7CZB4.js";import"./chunk-J7PZFXOE.js";import"./chunk-BG475WXG.js";import{a as wn}from"./chunk-V32HQ2F2.js";import"./chunk-BADG46IJ.js";import"./chunk-Q736XS6E.js";import"./chunk-TVCLJWZS.js";import{a as ke}from"./chunk-YMC4QOLO.js";import{a as vn,b as ue,c as yn,d as Le}from"./chunk-6NTXC6VK.js";import"./chunk-6HVGPPAG.js";import"./chunk-XOFD5DNL.js";import{a as te}from"./chunk-PU4UT4HF.js";import{a as Sn}from"./chunk-Y2PHG5VS.js";import"./chunk-SYLZLLGS.js";import{a as Ve}from"./chunk-IVXFG5AJ.js";import{d as Be,e as ln}from"./chunk-2SO4BVIT.js";import{a as Yt}from"./chunk-2BNLISUN.js";import{a as Te,b as Pe,c as Ne,d as Me,e as De,f as Oe,n as Ae,o as Ie,p as hn}from"./chunk-T5HLFYHP.js";import{a as I,c as F}from"./chunk-KCJ5HNXP.js";import{a as Ee}from"./chunk-3SC2PPSK.js";import"./chunk-B67EMZ2H.js";import{a as Qt,b as R}from"./chunk-MID2IYAR.js";import"./chunk-6GDWMGWO.js";import{a as B}from"./chunk-7A4HO4AV.js";import{c as W}from"./chunk-ZRDXKVPG.js";import{Aa as i,Ba as a,Ca as b,Eb as At,F as Q,Fa as it,Fb as It,Hb as Vt,I as f,Ia as St,Ja as h,Jb as at,K as p,Ka as kt,L as m,La as c,Lb as Rt,M as H,Mb as Bt,N as bt,Na as d,Ob as ve,Pb as ye,Q as fe,Qb as we,R as x,Ra as Z,Rb as M,Sa as he,U as xe,Ua as U,Ub as Lt,Va as O,Vb as Ft,Wa as D,X as z,Xa as l,Y as vt,Ya as y,Z as de,Za as v,_ as r,_a as J,bb as Et,cb as Tt,db as Pt,f as gt,ga as E,h as tt,i as ft,ia as yt,jb as Nt,ka as Ce,la as j,lb as Mt,mb as Dt,na as nt,nb as ce,ob as Ot,pa as G,q as xt,qa as K,qb as w,rb as $,s as Ct,sa as A,sb as be,ta as u,tb as ot,ua as _,ub as X,wa as wt,xa as S,ya as k,z as ht,za as C}from"./chunk-FYA6QUPZ.js";import{a as le,b as et,e as P}from"./chunk-WFIHWVQO.js";var Y=()=>{let t=f(T),n=f(M);return t.isAdmin()?!0:n.createUrlTree(["/accounts"])};var ct=()=>f(I).config.network!==!1||f(M).createUrlTree(["/accounts"]);var Bn=()=>!!f(I).config.plugins?.enabled||f(M).createUrlTree(["/accounts"]);var Ln=(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(me,n.url),o.parseUrl("/login"))});var pt="accessPortal.setupHidden",mt=5,oe=class t{api=f(Yt);config=f(I);router=f(M);status=x(null);hidden=x(ei());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(()=>mt-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=Fn(this.router.url),this.load(),this.navSub=this.router.events.pipe(xt(n=>n instanceof ve)).subscribe(n=>{let e=Fn(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(pt)}catch{}this.requests.update(n=>n+1),this.load()}dismiss(){this.hidden.set(!0);try{localStorage.setItem(pt,"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=Q({token:t,factory:t.\u0275fac,providedIn:"root"})};function Fn(t){return t.split(/[?#]/)[0]}function ei(){try{return localStorage.getItem(pt)==="1"}catch{return!1}}var ae=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=Q({token:t,factory:t.\u0275fac,providedIn:"root"})};function ti(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 ni(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 ii(t,n){if(t&1&&u(0,ni,2,1,"app-button",20),t&2){let e,o=d(3);_((e=o.nextAction())?0:-1,e)}}function oi(t,n){if(t&1&&(b(0,"span",19),i(1,"span",17),l(2),a(),u(3,ii,1,1)),t&2){let e=d(2);r(2),v("Next: ",e.nextTitle()),r(),_(e.expanded()?-1:3)}}function ai(t,n){t&1&&l(0," \u2713 ")}function ri(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 si(t,n){t&1&&l(0," Name, logo, and colors \u2014 everyone gets them on their next load. ")}function li(t,n){t&1&&l(0," \u2713 ")}function di(t,n){if(t&1&&(H(),i(0,"svg",30),b(1,"circle",35)(2,"circle",36),a()),t&2){let e=d(3);r(2),A("stroke-dasharray",e.connectSubDone()/3*100+" 100")}}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&&(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(),v(" (",e.unregistered()[0].roles.join(", "),") ")}}function ui(t,n){t&1&&l(0," Give the account a friendly name and list its roles. ")}function _i(t,n){t&1&&l(0," \u2713 ")}function gi(t,n){if(t&1){let e=h();i(0,"ul",33)(1,"li")(2,"span",26),u(3,ci,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),b(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,pi,1,0),a(),i(19,"div",23)(20,"div",24),l(21,"Register it here"),a(),i(22,"div",25),u(23,mi,4,2)(24,ui,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,_i,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 fi(t,n){t&1&&l(0," \u2713 ")}function xi(t,n){t&1&&l(0," \u2713 ")}function Ci(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,ai,1,0),a(),i(12,"div",23)(13,"div",24),l(14,"Choose your branding"),a(),i(15,"div",25),u(16,ri,4,0)(17,si,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,li,1,0)(24,di,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()(),b(35,"app-icon",12),a(),u(36,gi,35,19,"ul",33),a(),i(37,"li")(38,"span",26),u(39,fi,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,xi,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(),A("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 hi(t,n){if(t&1){let e=h();i(0,"div",0)(1,"div",1),H(),i(2,"svg",2),b(3,"circle",3)(4,"circle",4),a(),bt(),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,ti,6,0)(15,oi,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),b(19,"app-icon",12),a(),i(20,"app-button",13),c("click",function(){p(e);let s=d();return m(s.dismiss())}),b(21,"app-icon",14),a()()(),u(22,Ci,60,39,"ul",15)}if(t&2){let e=d();r(),A("aria-label",e.doneCount()+" of 5 steps done"),r(3),A("stroke-dasharray",e.doneCount()/5*100+" 100"),r(3),y(e.doneCount()),r(5),v("Set up ",e.projectName()),r(2),_(e.requiredDone()?14:15),r(4),v(" ",e.expanded()?"Hide steps":"Show steps"," "),r(),O("open",e.expanded()),r(3),_(e.expanded()?22:-1)}}var qe=class t{onboarding=f(oe);config=f(I);toast=f(F);router=f(M);wizard=f(ae);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,hi,23,9),e&2&&_(o.visible()?0:-1)},dependencies:[ke,B,Zt,R],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 ze="open",Ue="passkeys";function qn(t){return`${t}/accounts?${ze}=${Ue}`}var bi=(t,n)=>n.CredentialId;function vi(t,n){t&1&&(i(0,"div",2),b(1,"app-spinner"),a())}function yi(t,n){if(t&1&&(i(0,"p",14),l(1),Mt(2,"date"),a()),t&2){let e=d().$implicit;r(),v(" Added ",Dt(2,1,e.CreatedAt*1e3,"mediumDate")," ")}}function wi(t,n){if(t&1){let e=h();i(0,"span",15)(1,"button",17),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",18),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 Si(t,n){if(t&1){let e=h();i(0,"button",19),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 ki(t,n){if(t&1&&(i(0,"div",11)(1,"div",12)(2,"p",13),l(3),a(),u(4,yi,3,4,"p",14),a(),u(5,wi,5,1,"span",15)(6,Si,2,1,"button",16),a()),t&2){let e=n.$implicit,o=d(3);r(3),v(" ",e.FriendlyCredentialName||"Passkey"," "),r(),_(e.CreatedAt?4:-1),r(),_(o.confirmingId()===e.CredentialId?5:6)}}function Ei(t,n){if(t&1&&(i(0,"div",9),S(1,ki,7,3,"div",11,bi),a()),t&2){let e=d(2);r(),k(e.passkeys())}}function Ti(t,n){t&1&&(i(0,"div",10)(1,"p",1),l(2," No passkeys yet \u2014 add one and it becomes a choice on the sign-in screen. "),a()())}function Pi(t,n){if(t&1&&u(0,Ei,3,0,"div",9)(1,Ti,3,0,"div",10),t&2){let e=d();_(e.passkeys().length>0?0:1)}}function Ni(t,n){if(t&1&&(i(0,"p",3),l(1),a()),t&2){let e=d();r(),y(e.error())}}function Mi(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 Di(t,n){if(t&1&&(i(0,"a",6),b(1,"app-icon",20),l(2," Open in your browser "),a()),t&2){let e=d();C("href",e.browserUrl,z)}}function Oi(t,n){if(t&1){let e=h();i(0,"app-button",21),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 $e=class t{auth=f(T);api=f(ee);toast=f(F);bridge=f(W);passkeyCapable=this.bridge.passkeyCapable;isDesktop=this.bridge.isDesktop;browserUrl=qn(location.origin);closed=be();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 Xt(e.CredentialCreationOptions);yield this.api.completePasskeyRegistration(n,o),Se(o.id),this.toast.success("Passkey added"),this.reload()})).catch(n=>this.error.set(Ai(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(()=>{Wt(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:12,vars:5,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"],["target","_blank","rel","noopener",1,"mr-auto","inline-flex","items-center","gap-1.5","text-sm","font-medium","text-brand-text","hover:underline",3,"href"],["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"],["name","external-link",1,"h-[15px]","w-[15px]"],[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,vi,2,0,"div",2)(4,Pi,2,1),u(5,Ni,2,1,"p",3),u(6,Mi,2,0,"p",4),i(7,"div",5),u(8,Di,3,1,"a",6),i(9,"app-button",7),c("click",function(){return o.closed.emit()}),l(10,"Close"),a(),u(11,Oi,2,2,"app-button",8),a()()),e&2&&(r(3),_(o.loading()?3:4),r(2),_(o.error()?5:-1),r(),_(o.passkeyCapable?-1:6),r(2),_(o.isDesktop?8:-1),r(3),_(o.passkeyCapable?11:-1))},dependencies:[B,Ee,R,te,It],encapsulation:2})};function Ai(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 Ii(t,n){if(t&1&&it(0,"img",0),t&2){let e=d();kt("src",e.url(),z),A("width",e.size())("height",e.size())}}function Vi(t,n){if(t&1&&it(0,"div",2),t&2){let e=d();U("width",e.size(),"px")("height",e.size(),"px")}}var re=class t{data=ot.required();size=ot(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,Ii,1,3,"img",0)(1,Vi,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 Bi(t,n){t&1&&(i(0,"div",2),b(1,"app-spinner"),a())}function Li(t,n){if(t&1){let e=h();i(0,"div",8),b(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 Fi(t,n){if(t&1&&(i(0,"p",18),l(1),a()),t&2){let e=d(2);r(),y(e.error())}}function qi(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,Fi,2,1,"p",18)),t&2){let e=d();r(5),_(e.error()?5:-1)}}function zi(t,n){if(t&1&&(i(0,"p",18),l(1),a()),t&2){let e=d(2);r(),y(e.error())}}function Ui(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,zi,2,1,"p",18)),t&2){let e=d();r(3),_(e.error()?3:-1)}}function $i(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 Wi(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 Hi(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 We=class t{auth=f(T);api=f(ee);toast=f(F);configService=f(I);closed=be();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),Ut(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,Bi,2,0,"div",2)(4,Li,9,4)(5,qi,6,1)(6,Ui,4,1),i(7,"div",3)(8,"app-button",4),c("click",function(){return o.closed.emit()}),l(9,"Close"),a(),u(10,$i,2,2,"app-button",5)(11,Wi,2,1,"app-button",6)(12,Hi,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:[Ie,Oe,Te,Pe,Ne,Ae,De,Me,B,Ee,Ve,re,te],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 ji=["extendPanelTpl"],Gi=["resourceExtendPanelTpl"],Ki=()=>[bn],Yi=()=>[import("./chunk-26IVZOGE.js").then(t=>t.RequestResourceFormComponent)],Qi=t=>({expired:t}),Hn=(t,n)=>n.requestId,Zi=(t,n)=>n.su.clientId,Ji=(t,n)=>n.noticeId,zn=(t,n)=>n.accountNumber+n.roleName,Un=(t,n)=>n.resourceId;function $n(t,n){return this.pluginKey(n)}var Wn=(t,n)=>n.tokenId;function Xi(t,n){t&1&&b(0,"span",5)}function eo(t,n){t&1&&(i(0,"span",9),l(1,"Refreshing\u2026"),a())}function to(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 no(t,n){if(t&1){let e=h();i(0,"app-tabs",16),Pt("selectedChange",function(s){p(e);let g=d(2);return Tt(g.tab,s)||(g.tab=s),m(s)}),a()}if(t&2){let e=d(2);C("tabs",e.TABS),Et("selected",e.tab),C("dotted",e.dottedTabs())}}function io(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())}),b(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(),v(" ",e.type==="REAPPROVAL"?"\xB7 review of":"requested"," "),r(2),y(o.subjectOf(e)),r(2),J(" ",o.metaOf(e)," \xB7 ",o.ago(e.createdAt)," ")}}function oo(t,n){if(t&1){let e=h();i(0,"section",17)(1,"p",19),l(2," Awaiting your decision "),a(),S(3,io,11,5,"button",20,Hn),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 ao(t,n){if(t&1){let e=h();i(0,"div",29),b(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),v(" ",e.cta," ")}}function ro(t,n){if(t&1&&(i(0,"section",17)(1,"p",19),l(2," Service users "),a(),S(3,ao,12,7,"div",29,Zi),a()),t&2){let e=d(3);r(3),k(e.store.serviceUserNags())}}function so(t,n){t&1&&(i(0,"p",18),l(1," Nothing needs your attention. "),a())}function lo(t,n){if(t&1&&(u(0,oo,8,0,"section",17),u(1,ro,5,0,"section",17),u(2,so,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 co(t,n){t&1&&(i(0,"app-badge",39),l(1,"Granted"),a())}function po(t,n){t&1&&(i(0,"app-badge",40),l(1,"Revoked"),a())}function mo(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 uo(t,n){if(t&1&&(i(0,"div",29),b(1,"span",30),i(2,"div",25)(3,"div",31)(4,"span",32),l(5),a(),u(6,co,2,0,"app-badge",39)(7,po,2,0,"app-badge",40),a(),i(8,"p",34),l(9),a(),i(10,"p",41),l(11),a(),u(12,mo,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),v(" ",o.noticeSubject(e)," "),r(),_(e.change==="GRANTED"?6:7),r(3),J(" ",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 _o(t,n){if(t&1&&(i(0,"section",17)(1,"p",19),l(2," Access changes "),a(),S(3,uo,13,10,"div",38,Ji),a()),t&2){let e=d(3);r(3),k(e.recentChanges())}}function go(t,n){if(t&1){let e=h();i(0,"div",29),b(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),v(" ",e.roleName," "),r(2),v("expires ",o.until(e.expiresAt)),r(2),y(o.names.label(e.accountNumber))}}function fo(t,n){if(t&1){let e=h();i(0,"div",29),b(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),v(" ",e.roleName," "),r(2),v("expired ",o.until(e.expiresAt)),r(2),y(o.names.label(e.accountNumber))}}function xo(t,n){if(t&1){let e=h();i(0,"div",29),b(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),v(" ",e.name," "),r(2),v("expires ",o.until(e.expiresAt))}}function Co(t,n){if(t&1){let e=h();i(0,"div",29),b(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),v(" ",e.name," "),r(2),v("expired ",o.until(e.expiresAt))}}function ho(t,n){if(t&1){let e=h();i(0,"div",29),b(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),v(" ",e.pluginName," "),r(2),v("expires ",o.until(e.expiresAt)),r(2),y(o.pluginSubject(e))}}function bo(t,n){if(t&1&&(i(0,"div",29),b(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),v(" ",e.pluginName," "),r(2),v("expired ",o.until(e.expiresAt)),r(2),y(o.pluginSubject(e))}}function vo(t,n){if(t&1){let e=h();i(0,"div",29),b(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),v("expires ",o.until(e.expiresAt))}}function yo(t,n){if(t&1){let e=h();i(0,"div",29),b(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),v("expired ",o.until(e.expiresAt))}}function wo(t,n){if(t&1&&(i(0,"section",17)(1,"p",19),l(2," Temporary access "),a(),S(3,go,12,5,"div",38,zn),S(5,fo,12,5,"div",38,zn),S(7,xo,12,2,"div",29,Un),S(9,Co,12,2,"div",29,Un),S(11,ho,12,3,"div",29,$n,!0),S(13,bo,10,3,"div",29,$n,!0),S(15,vo,12,2,"div",29,Wn),S(17,yo,12,2,"div",29,Wn),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 So(t,n){t&1&&(i(0,"p",36),l(1,"Loading\u2026"),a())}function ko(t,n){t&1&&(i(0,"p",37),l(1," You haven't requested any roles yet. "),a())}function Eo(t,n){if(t&1&&(i(0,"p",46),l(1),a()),t&2){let e=d().$implicit;r(),v(' "',e.decisionNote,'" ')}}function To(t,n){if(t&1&&(i(0,"div",29),b(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,Eo,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),v(" ",o.subjectOf(e)," "),r(),C("tone",o.tone(e.status)),r(),y(o.label(e.status)),r(2),J(" ",o.metaOf(e)," \xB7 ",o.ago(e.decidedAt??e.createdAt)," "),r(),D(o.blurbClass(e.status)),r(),v(" ",o.blurb(e)," "),r(),_(e.decisionNote?12:-1)}}function Po(t,n){if(t&1&&S(0,To,13,13,"div",38,Hn),t&2){let e=d(3);k(e.store.myRequests())}}function No(t,n){if(t&1&&(u(0,_o,5,0,"section",17),u(1,wo,19,0,"section",17),i(2,"section")(3,"p",19),l(4," Your requests "),a(),u(5,So,2,0,"p",36)(6,ko,2,0,"p",37)(7,Po,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 Mo(t,n){if(t&1&&(i(0,"div",6)(1,"header",7)(2,"h2",8),l(3,"Activity"),a(),u(4,eo,2,0,"span",9),a(),u(5,to,7,0,"div",10),u(6,no,1,3,"app-tabs",11),i(7,"div",12),u(8,lo,3,3)(9,No,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 Do(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 Oo(t,n){if(t&1&&u(0,Do,1,1,"app-request-role-form",48),t&2){let e,o=d(2);_((e=o.extendTarget())?0:-1,e)}}function Ao(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))}),j(1,Oo,1,1),G(2,1,Ki),a()}if(t&2){let e=d();C("title",e.extendTitle())("contentKey",e.extendTarget()?e.extendTarget().accountNumber+":"+e.extendTarget().roleName:null),r(2),K(e.extendTarget()!==null)}}function Io(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",Nt(2,Qi,e.expired))}}function Vo(t,n){if(t&1&&u(0,Io,1,4,"app-request-resource-form",51),t&2){let e,o=d(2);_((e=o.resourceExtendTarget())?0:-1,e)}}function Ro(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))}),j(1,Vo,1,1),G(2,1,Yi),a()}if(t&2){let e=d();C("title",e.resourceExtendTitle())("contentKey",e.resourceExtendTarget()?e.resourceExtendTarget().resource.resourceId:null),r(2),K(e.resourceExtendTarget()!==null)}}var He=class t{store=f(ie);names=f(rn);constructor(){this.names.ensure(),ue(this.extendTarget,this.extendPanelTpl,()=>this.extendTarget.set(null)),ue(this.resourceExtendTarget,this.resourceExtendPanelTpl,()=>this.resourceExtendTarget.set(null)),this.route.queryParamMap.pipe(nn()).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(ye);host=f(xe);bridge=f(W);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=X("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=X("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"?gn(n):_n(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 Be(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(pn(n))}openTokens(){this.open.set(!1),this.router.navigateByUrl(cn)}goToRequests(){this.open.set(!1),this.router.navigate(["/admin/requests"])}goToServiceUsers(){this.open.set(!1),this.router.navigate(["/users"],{queryParams:{tab:"service-users"}})}subjectOf=fn;labelOf=n=>this.names.label(n);metaOf(n){return xn(n,e=>this.names.label(e))}noticeSubject=mn;noticeContext=un;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=Cn;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,ji,5),Z(o.resourceExtendPanelTpl,Gi,5)),e&2&&he(2)},hostBindings:function(e,o){e&1&&c("click",function(g){return o.onDocumentClick(g)},de)("keydown.escape",function(){return o.onEscape()},de)},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())}),b(2,"app-icon",4),u(3,Xi,1,0,"span",5),a(),u(4,Mo,10,4,"div",6),Ce(5,Ao,4,3,"ng-template",null,0,ce)(7,Ro,4,3,"ng-template",null,1,ce),a()}e&2&&(r(),A("aria-label",o.ariaLabel())("aria-expanded",o.open()),r(2),_(o.store.count()?3:-1),r(),_(o.open()?4:-1))},dependencies:[ke,R,Le,wn],encapsulation:2})};var Bo=(t,n)=>n.kind;function Lo(t,n){t&1&&l(0," They appear as system notifications from the desktop app \u2014 also while it sits in the tray. ")}function Fo(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 qo(t,n){}function zo(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 Uo(t,n){t&1&&(i(0,"p",3),l(1,"This browser doesn't support notifications."),a())}function $o(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 Wo(t,n){if(t&1&&u(0,qo,0,0)(1,zo,2,0,"p",7)(2,Uo,2,0,"p",3)(3,$o,2,0,"app-button",8),t&2){let e,o=d();_((e=o.permission())==="granted"?0:e==="denied"?1:e==="unsupported"?2:3)}}function Ho(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),A("aria-label",e.label),r(3),y(e.label),r(2),y(e.hint)}}var jo=[{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}],je=class t{bridge=f(W);store=f(ie);auth=f(T);toast=f(F);prefs=w(()=>this.store.prefs()??sn);rows=w(()=>jo.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(hn(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,Lo,1,0)(6,Fo,1,0),a(),u(7,Wo,4,1),i(8,"p",4),l(9,"Tell me about"),a(),i(10,"div",5),S(11,Ho,7,5,"label",6,Bo),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:[B,Sn],encapsulation:2})};var Go=3e4,se=class t{now=x(Date.now());constructor(){let n=()=>this.now.set(Date.now()),e=setInterval(n,Go),o=()=>{document.hidden||n()};document.addEventListener("visibilitychange",o),f(fe).onDestroy(()=>{clearInterval(e),document.removeEventListener("visibilitychange",o)})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Q({token:t,factory:t.\u0275fac,providedIn:"root"})};var jn="auth.sessionBannerDismissed",Ge=class t{auth=f(T);now=f(se).now;dismissedFor=x(Ko());visible=w(()=>{let n=this.auth.sessionEndsAt();return dn(n,this.now())&&this.dismissedFor()!==n});endsAtLabel=w(()=>{let n=this.auth.sessionEndsAt();return n===null?"":ne(new Date(n).toISOString(),{sameDayTimeOnly:!0})});remaining=w(()=>{let n=this.auth.sessionEndsAt();return n===null?"":Be(new Date(n).toISOString(),this.now())});dismiss(){let n=this.auth.sessionEndsAt();this.dismissedFor.set(n);try{n!==null&&sessionStorage.setItem(jn,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&&(b(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),v("Your session ends at ",o.endsAtLabel()),r(),v(" (",o.remaining(),"). Sign in again now to keep your credentials and network connection. "))},dependencies:[B,R],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 Ko(){try{let t=Number(sessionStorage.getItem(jn));return t>0?t:null}catch{return null}}var Yo=()=>[import("./chunk-XC7NIEIA.js").then(t=>t.NetworkSetupDialogComponent)],Qo=(t,n)=>n.id,ut=(t,n)=>n.accountNumber;function Zo(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 Jo(t,n){t&1&&(i(0,"span",4),l(1,"\u23FB"),a(),l(2," Connect network "))}function Xo(t,n){if(t&1&&u(0,Zo,5,0)(1,Jo,3,0),t&2){let e=d(2);_(e.store.sites().length>1?0:1)}}function ea(t,n){t&1&&(b(0,"span",6),l(1," Connecting\u2026 "))}function ta(t,n){t&1&&(b(0,"span",7),l(1," Disconnecting\u2026 "))}function na(t,n){t&1&&(b(0,"span",8),l(1," Connected \xB7 nothing granted "),i(2,"span",5),l(3,"\u25BE"),a())}function ia(t,n){t&1&&(b(0,"span",9),l(1," Network \xB7 connected "),i(2,"span",5),l(3,"\u25BE"),a())}function oa(t,n){if(t&1&&u(0,na,4,0)(1,ia,4,0),t&2){let e=d(2);_(e.nothingGranted()?0:1)}}function aa(t,n){t&1&&(b(0,"span",8),l(1," Set up network "),i(2,"span",5),l(3,"\u25BE"),a())}function ra(t,n){if(t&1&&(i(0,"span",14),l(1),a()),t&2){let e=d(4);r(),v("\xB7 ",e.store.siteName(n))}}function sa(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 la(t,n){if(t&1&&(i(0,"p",10),b(1,"span",9),l(2," Connected"),u(3,ra,2,1,"span",14),a(),i(4,"p",15),l(5),a(),u(6,sa,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(),v(" ",o.store.tailnetIp()??"\u2014"," "),r(),_(o.nothingGranted()?6:-1)}}function da(t,n){t&1&&(i(0,"p",10),b(1,"span",6),l(2," Connecting\u2026 "),a())}function ca(t,n){t&1&&(i(0,"p",10),b(1,"span",7),l(2," Disconnecting\u2026 "),a())}function pa(t,n){t&1&&(i(0,"p",18),l(1," Pick which network to connect below \u2014 one at a time. "),a())}function ma(t,n){if(t&1&&(i(0,"p",10),b(1,"span",17),l(2," Not connected "),a(),u(3,pa,2,0,"p",18)),t&2){let e=d(3);r(3),_(e.store.sites().length>1?3:-1)}}function ua(t,n){t&1&&(i(0,"p",11),l(1),a()),t&2&&(r(),v(" ",n," "))}function _a(t,n){t&1&&(i(0,"p",12),l(1,"Loading\u2026"),a())}function ga(t,n){t&1&&(i(0,"p",12),l(1,"Couldn't load your VPCs \u2014 leave and hover again to retry."),a())}function fa(t,n){t&1&&(i(0,"span",25),l(1,"Connected"),a())}function xa(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 Ca(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 ha(t,n){t&1&&(i(0,"span",28),l(1,"Connecting\u2026"),a())}function ba(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 va(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,ba,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),v(" \xB7 ",s.accountLabel(e)),r(),_(s.siteStatus(o.id)==="connected"&&s.rowNeedsAttention(e)?6:-1)}}function ya(t,n){t&1&&(i(0,"ul",29),S(1,va,7,3,"li",32,ut),a()),t&2&&(r(),k(n))}function wa(t,n){if(t&1&&(i(0,"li",21)(1,"div",22),b(2,"span",23),i(3,"span",24),l(4),a(),u(5,fa,2,0,"span",25)(6,xa,2,2,"button",26)(7,Ca,2,2,"button",27)(8,ha,2,0,"span",28),a(),u(9,ya,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),v(" ",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 Sa(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),v(" \xB7 ",o.accountLabel(e))}}function ka(t,n){if(t&1&&(i(0,"p",38),l(1,"Other VPCs"),a(),i(2,"ul",39),S(3,Sa,5,2,"li",40,ut),a()),t&2){let e=d(4);r(3),k(e.siteBuckets().unmapped)}}function Ea(t,n){if(t&1&&(i(0,"p",19),l(1,"Networks"),a(),i(2,"ul",20),S(3,wa,10,5,"li",21,Qo),a(),u(5,ka,5,0)),t&2){let e=d(3);r(3),k(e.store.sites()),r(2),_(e.siteBuckets().unmapped.length?5:-1)}}function Ta(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 Pa(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 Na(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 Ma(t,n){if(t&1&&(i(0,"li",43),b(1,"span",23),i(2,"span",44)(3,"span",45),l(4),a(),i(5,"span",46),l(6),a()(),u(7,Pa,2,3,"span",47)(8,Na,2,2,"button",48),a()),t&2){let e=n.$implicit,o=d(5);r(),D(o.rowDotClass(e)),r(3),v(" ",e.vpc.domain??"Private network"," "),r(2),y(o.accountLabel(e)),r(),_(o.store.state()==="connected"?7:o.store.state()==="off"?8:-1)}}function Da(t,n){if(t&1&&(i(0,"ul",42),S(1,Ma,9,5,"li",43,ut),a()),t&2){let e=d(4);r(),k(e.groups())}}function Oa(t,n){if(t&1&&(i(0,"p",19),l(1,"Your VPCs"),a(),u(2,Ta,2,0,"p",41)(3,Da,3,0,"ul",42)),t&2){let e=d(3);r(2),_(e.groups().length===0?2:3)}}function Aa(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 Ia(t,n){if(t&1){let e=h();i(0,"div",2),u(1,la,7,4)(2,da,3,0,"p",10)(3,ca,3,0,"p",10)(4,ma,4,1),u(5,ua,2,1,"p",11),u(6,_a,2,0,"p",12)(7,ga,2,0,"p",12)(8,Ea,6,1)(9,Oa,4,1),u(10,Aa,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 Va(t,n){t&1&&(i(0,"p",3),l(1),a()),t&2&&(r(),v(" ",n," "))}function Ra(t,n){t&1&&b(0,"app-network-setup-dialog")}function Ba(t,n){if(t&1&&u(0,Ra,1,0,"app-network-setup-dialog"),t&2){let e=d(2);_(e.store.setupOpen()?0:-1)}}function La(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,Xo,2,1)(3,ea,2,0)(4,ta,2,0)(5,oa,2,1)(6,aa,4,0),a(),u(7,Ia,13,4,"div",2),u(8,Va,2,1,"p",3),a(),j(9,Ba,1,1),G(10,9,Yo)}if(t&2){let e,o,s=d();r(),D(s.pillClass()),A("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),K(s.store.setupOpen())}}var Ke=class t{store=f(kn);resources=f(Tn);shares=f(Pn);vpcStatus=f(En);open=x(!1);groups=w(()=>Nn(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(()=>Mn(this.groups(),n=>this.store.siteOfAccount().get(n.accountNumber)));siteStatus(n){return Dn(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)},de)},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,La,12,7),e&2&&_(o.store.state()!=="hidden"?0:-1)},encapsulation:2})};var Fa=(t,n)=>n.id;function qa(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(),v(" ",n.label," \u2192 "))}function za(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),b(2,"app-icon",4),a(),i(3,"span",5)(4,"span"),l(5),a(),u(6,qa,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 Ye=class t{toastService=f(F);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,za,9,6,"div",1,Fa),a()),e&2&&(r(),k(o.toastService.toasts()))},dependencies:[R],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 Ua=["notificationSettingsTpl"],$a=()=>[import("./chunk-4ILDUMJR.js").then(t=>t.ThemeWizardComponent)];function Wa(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))}),b(1,"app-icon",17),l(2," Customize theme "),a()}}function Ha(t,n){if(t&1&&(i(0,"span",19),l(1),a()),t&2){let e=d(2);r(),J("",e.onboarding.doneCount()," of ",e.stepCount," done")}}function ja(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())}),b(1,"app-icon",18),l(2," Onboarding "),u(3,Ha,2,2,"span",19),a()}if(t&2){let e=d();r(3),_(e.onboarding.status()?3:-1)}}function Ga(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))}),b(1,"app-icon",20),l(2," Passkeys "),a()}}function Ka(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))}),b(1,"app-icon",21),l(2," Authenticator (MFA) "),a()}}function Ya(t,n){if(t&1){let e=h();i(0,"button",22),c("click",function(){p(e);let s=d();return m(s.openTokens())}),b(1,"app-icon",23),l(2," Access tokens "),a()}}function Qa(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())}),b(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),v("",e.sessionRemainingLabel()," left")}}function Za(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 Ja(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 Xa(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))}),b(1,"app-notification-settings"),a()}}function er(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 tr(t,n){if(t&1&&u(0,er,1,1,"app-theme-wizard",28),t&2){let e=d();_(e.themeWizardOpen()?0:-1)}}function nr(t,n){t&1&&St(0,16),t&2&&C("ngTemplateOutlet",n)}var ir={accounts:"/accounts",network:"/resources"},or={accounts:"/admin/accounts",network:"/admin/resources",users:"/users",groups:"/admin/groups",requests:"/admin/requests",activity:"/admin/activity"},ar="Plugin list may be out of date \u2014 retrying",Qe=class t{auth=f(T);theme=f(Re);plugins=f(on);panel=f(vn);contentWidth=f(yn);router=f(M);onboarding=f(oe);stepCount=mt;passkeysOpen=x(!1);authenticatorOpen=x(!1);notificationSettingsOpen=x(!1);notificationSettingsTpl=X("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(I);branding=this.configService.branding;mfaEnabled=!!this.configService.config.mfa&&!f(T).isFederatedSession();passkeyEnabled=!!this.configService.config.passkey&&!f(T).isFederatedSession();tokensEnabled=!!Gt(this.configService);sidebar=X(Fe);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());notifications=f(ie);clock=f(se);sessionEndsLabel=w(()=>{let n=this.auth.sessionEndsAt();return n===null?"":ne(new Date(n).toISOString(),{sameDayTimeOnly:!0})});sessionRemainingLabel=w(()=>{let n=this.auth.sessionEndsAt();return n===null?"":ln(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=>le({label:q.label,icon:Qt.includes(q.icon)?q.icon:"bolt",route:q.route},e?{hint:ar}:{})),s=[{label:"Your access",items:[...An.filter(N=>N!=="network"||n).map(N=>et(le({},dt[N]),{route:ir[N]})),...o("user")]}],g=o("admin");return(this.auth.isAdmin()||g.length)&&s.push({label:"Administration",accent:!0,items:[...this.auth.isAdmin()?In.filter(N=>N!=="network"||n).map(N=>le(et(le({},dt[N]),{route:or[N]}),N==="requests"?{badge:this.notifications.pending()?.length||0}:{})):[],...g]}),s});constructor(){this.notifications.startPolling(),f(fe).onDestroy(()=>{this.notifications.stopPolling(),this.onboarding.stop()}),ue(this.notificationSettingsOpen,this.notificationSettingsTpl,()=>this.notificationSettingsOpen.set(!1));let n=f(ye);n.queryParamMap.subscribe(o=>{let s=o.get(ze);s!==Ue&&s!=="mfa"||(s===Ue&&this.passkeyEnabled&&this.passkeysOpen.set(!0),s==="mfa"&&this.mfaEnabled&&this.authenticatorOpen.set(!0),this.router.navigate([],{relativeTo:n,queryParams:{[ze]:null},queryParamsHandling:"merge",preserveFragment:!0,replaceUrl:!0}))});let e=f(ae);$(()=>{e.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,Ua,5),Z(o.sidebar,Fe,5)),e&2&&he(2)},hostBindings:function(e,o){e&1&&c("resize",function(){return o.onWindowResize()},vt)},decls:31,vars:21,consts:[["notificationSettingsTpl",""],[1,"shell"],["variant","glass",3,"darkModeToggle","collapseToggle","collapsed","brandName","showLogo","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()))}),b(2,"app-notification-bell",3)(3,"app-network-pill",4),u(4,Wa,3,0,"button",5),u(5,ja,4,1,"button",5),u(6,Ga,3,0,"button",5),u(7,Ka,3,0,"button",5),u(8,Ya,3,0,"button",6),u(9,Qa,5,2,"button",7),b(10,"div",8),i(11,"button",9),c("click",function(){return p(s),m(o.notificationSettingsOpen.set(!0))}),b(12,"app-icon",10),l(13," Notifications "),a(),i(14,"button",11),c("click",function(){return p(s),m(o.auth.logout())}),b(15,"app-icon",12),l(16," Sign out "),a()(),u(17,Za,1,0,"app-passkeys-dialog"),u(18,Ja,1,0,"app-authenticator-dialog"),Ce(19,Xa,2,0,"ng-template",null,0,ce),j(21,tr,1,1),G(22,21,$a),i(24,"div",13),b(25,"app-session-banner",14)(26,"app-setup-checklist",14),i(27,"main",15),b(28,"router-outlet"),a()(),u(29,nr,1,1,"ng-container",16),a(),b(30,"app-toast-container")}if(e&2){let s,g;r(),C("collapsed",o.sidebarCollapsed())("brandName",o.brandText())("showLogo",o.showLogo())("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),K(o.themeWizardOpen()),r(2),U("min-width",o.contentWidth.minWidth(),"px"),r(5),_((g=o.panel.content())?29:-1,g)}},dependencies:[At,we,Fe,He,je,Ge,Ke,Le,R,Ye,$e,We,qe],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 Ze=class t{el=f(xe);ngAfterViewInit(){matchMedia("(pointer: coarse)").matches||this.el.nativeElement.focus()}static \u0275fac=function(e){return new(e||t)};static \u0275dir=yt({type:t,selectors:[["input","appAutofocus",""]]})};var rr=(t,n)=>n.name,Yn=(t,n)=>n.label;function sr(t,n){if(t&1){let e=h();i(0,"img",11),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,z)}}function lr(t,n){t&1&&(i(0,"div",3),b(1,"app-default-logo",12),a()),t&2&&(r(),C("animated",!0))}function dr(t,n){if(t&1){let e=h();i(0,"img",13),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,z)}}function cr(t,n){t&1&&(i(0,"div",9),b(1,"app-default-logo",14),a()),t&2&&(r(),C("animated",!0))}function pr(t,n){if(t&1&&(i(0,"p",16),l(1),a()),t&2){let e=d(2);r(),v(" 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 mr(t,n){if(t&1&&(i(0,"p",16),l(1),a()),t&2){let e=d(2);r(),v("to ",e.productName())}}function ur(t,n){t&1&&(i(0,"p",17),l(1),a()),t&2&&(r(),y(n))}function _r(t,n){if(t&1){let e=h();i(0,"app-button",21),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(),v(" Sign in with ",e.label," ")}}function gr(t,n){if(t&1&&(i(0,"p",19),l(1),a()),t&2){let e=d(2);r(),y(e.ssoError())}}function fr(t,n){if(t&1){let e=h();i(0,"button",22),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 xr(t,n){t&1&&(i(0,"div",23)(1,"span"),l(2,"or"),a()())}function Cr(t,n){if(t&1){let e=h();u(0,xr,3,0,"div",23),i(1,"form",24),c("ngSubmit",function(){p(e);let s=d(2);return m(s.submitEmail())}),i(2,"app-field",25)(3,"input",26),c("ngModelChange",function(s){p(e);let g=d(2);return m(g.email.set(s))}),a()(),i(4,"app-button",27),l(5," 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(),C("loading",e.busy())("disabled",!e.email().trim())}}function hr(t,n){if(t&1){let e=h();i(0,"button",22),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 br(t,n){if(t&1&&(i(0,"h1",15),l(1),a(),u(2,pr,2,1,"p",16)(3,mr,2,1,"p",16),u(4,ur,2,1,"p",17),S(5,_r,2,4,"app-button",18,rr),u(7,gr,2,1,"p",19),u(8,fr,2,1,"button",20)(9,Cr,6,5),u(10,hr,2,1,"button",20)),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 vr(t,n){if(t&1){let e=h();i(0,"h1",15),l(1,"Couldn't sign you in"),a(),i(2,"p",16),l(3),a(),i(4,"button",29),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 yr(t,n){t&1&&(i(0,"div",28),b(1,"app-spinner",30),i(2,"p",16),l(3,"Signing you in\u2026"),a()())}function wr(t,n){if(t&1&&u(0,vr,6,1)(1,yr,4,0,"div",28),t&2){let e,o=d();_((e=o.ssoError())?0:1,e)}}function Sr(t,n){if(t&1&&(i(0,"p",19),l(1),a()),t&2){let e=d(3);r(),y(e.error())}}function kr(t,n){if(t&1){let e=h();i(0,"h1",15),l(1,"Sign in with your passkey"),a(),i(2,"p",16),l(3),a(),u(4,Sr,2,1,"p",19),i(5,"app-button",32),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),v("",e.email()," \xB7 your usual way"),r(),_(e.error()?4:-1),r(),C("loading",e.busy())}}function Er(t,n){if(t&1&&(i(0,"p",19),l(1),a()),t&2){let e=d(3);r(),y(e.error())}}function Tr(t,n){if(t&1){let e=h();i(0,"h1",15),l(1,"Email me a code"),a(),i(2,"p",16),l(3),a(),u(4,Er,2,1,"p",19),i(5,"app-button",32),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),v("",e.email()," \xB7 your usual way"),r(),_(e.error()?4:-1),r(),C("loading",e.busy())}}function Pr(t,n){if(t&1){let e=h();u(0,kr,7,3)(1,Tr,7,3),i(2,"button",29),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",31),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 Nr(t,n){if(t&1&&(i(0,"p",33),l(1),a()),t&2){let e=d(2);r(),y(e.limitedText)}}function Mr(t,n){if(t&1&&(i(0,"p",19),l(1),a()),t&2){let e=d(2);r(),y(e.error())}}function Dr(t,n){t&1&&(H(),i(0,"svg",38),b(1,"path",42),a())}function Or(t,n){t&1&&(H(),i(0,"svg",38),b(1,"path",43),a())}function Ar(t,n){t&1&&(H(),i(0,"svg",38),b(1,"path",44),a())}function Ir(t,n){t&1&&(i(0,"span",41),l(1),a()),t&2&&(r(),y(n))}function Vr(t,n){if(t&1){let e=h();i(0,"button",36),c("click",function(){let s=p(e).$implicit,g=d(2);return m(g.pick(s))}),i(1,"span",37),u(2,Dr,2,0,":svg:svg",38)(3,Or,2,0,":svg:svg",38)(4,Ar,2,0,":svg:svg",38),a(),i(5,"span",39)(6,"span",40),l(7),a(),u(8,Ir,2,1,"span",41),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 Rr(t,n){t&1&&(i(0,"p",19),l(1," No sign-in method for this account works in this browser \u2014 contact your admin. "),a())}function Br(t,n){if(t&1){let e=h();i(0,"h1",15),l(1,"How do you want to sign in?"),a(),i(2,"p",16),l(3),a(),u(4,Nr,2,1,"p",33),u(5,Mr,2,1,"p",19),S(6,Vr,9,4,"button",34,wt,!1,Rr,2,0,"p",19),i(9,"p",35),l(10,"We'll remember your choice next time."),a(),i(11,"button",31),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 Lr(t,n){if(t&1&&(i(0,"p",33),l(1),a()),t&2){let e=d(2);r(),y(e.limitedText)}}function Fr(t,n){if(t&1){let e=h();i(0,"h1",15),l(1,"Enter your password"),a(),i(2,"p",16),l(3),a(),u(4,Lr,2,1,"p",33),i(5,"form",24),c("ngSubmit",function(){p(e);let s=d();return m(s.submitPassword())}),i(6,"app-field",45)(7,"div",46)(8,"input",47),c("ngModelChange",function(s){p(e);let g=d();return m(g.password.set(s))}),a(),i(9,"button",48),c("click",function(){p(e);let s=d();return m(s.showPw.set(!s.showPw()))}),l(10),a()()(),i(11,"app-button",27),l(12," Sign in "),a()(),i(13,"button",29),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",49),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(),A("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 qr(t,n){if(t&1&&(i(0,"li")(1,"span",56),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(),v(" ",e.label," ")}}function zr(t,n){if(t&1){let e=h();i(0,"h1",15),l(1,"Reset your password"),a(),i(2,"p",16),l(3),a(),i(4,"form",24),c("ngSubmit",function(){p(e);let s=d();return m(s.submitReset())}),i(5,"app-field",50)(6,"input",51),c("ngModelChange",function(s){p(e);let g=d();return m(g.resetCode.set(s))}),a()(),i(7,"app-field",52)(8,"div",46)(9,"input",53),c("ngModelChange",function(s){p(e);let g=d();return m(g.resetPassword.set(s))}),a(),i(10,"button",48),c("click",function(){p(e);let s=d();return m(s.showPw.set(!s.showPw()))}),l(11),a()()(),i(12,"ul",54),S(13,qr,4,4,"li",55,Yn),a(),i(15,"app-button",27),l(16," Reset password and sign in "),a()(),i(17,"button",22),c("click",function(){p(e);let s=d();return m(s.forgotPassword())}),l(18," Send a new code "),a(),i(19,"button",31),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),v("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(),A("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 Ur(t,n){if(t&1){let e=h();i(0,"h1",15),l(1,"Enter the code we emailed"),a(),i(2,"p",16),l(3),a(),i(4,"form",24),c("ngSubmit",function(){p(e);let s=d();return m(s.submitCode())}),i(5,"app-field",57)(6,"input",58),c("ngModelChange",function(s){p(e);let g=d();return m(g.code.set(s))}),a()(),i(7,"app-button",27),l(8," Sign in "),a()(),i(9,"button",22),c("click",function(){p(e);let s=d();return m(s.resendCode())}),l(10," Send a new code "),a(),i(11,"button",31),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),v("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 $r(t,n){if(t&1){let e=h();i(0,"h1",15),l(1,"Enter your authenticator code"),a(),i(2,"p",16),l(3),a(),i(4,"form",24),c("ngSubmit",function(){p(e);let s=d();return m(s.submitTotp())}),i(5,"app-field",59)(6,"input",60),c("ngModelChange",function(s){p(e);let g=d();return m(g.totpCode.set(s))}),a()(),i(7,"app-button",27),l(8," Sign in "),a()(),i(9,"button",29),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),v("",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 Wr(t,n){if(t&1){let e=h();i(0,"h1",15),l(1,"Set up your authenticator"),a(),i(2,"p",16),l(3),a(),i(4,"div",61),b(5,"app-qr-code",62),a(),i(6,"p",35),l(7," Scan with any authenticator app (Google Authenticator, 1Password, Authy\u2026) \u2014 or enter this key manually: "),a(),i(8,"p",63),l(9),a(),i(10,"form",24),c("ngSubmit",function(){p(e);let s=d();return m(s.submitTotpSetup())}),i(11,"app-field",64)(12,"input",65),c("ngModelChange",function(s){p(e);let g=d();return m(g.totpSetupCode.set(s))}),a()(),i(13,"app-button",27),l(14," Verify and sign in "),a()()}if(t&2){let e=d();r(3),v("",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 Hr(t,n){if(t&1&&(i(0,"li")(1,"span",56),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(),v(" ",e.label," ")}}function jr(t,n){if(t&1){let e=h();i(0,"h1",15),l(1,"Set your password"),a(),i(2,"p",16),l(3),a(),i(4,"form",24),c("ngSubmit",function(){p(e);let s=d();return m(s.submitNewPassword())}),i(5,"app-field",52)(6,"div",46)(7,"input",66),c("ngModelChange",function(s){p(e);let g=d();return m(g.newPassword.set(s))}),a(),i(8,"button",48),c("click",function(){p(e);let s=d();return m(s.showPw.set(!s.showPw()))}),l(9),a()()(),i(10,"ul",54),S(11,Hr,4,4,"li",55,Yn),a(),i(13,"app-button",27),l(14," Set password and sign in "),a()()}if(t&2){let e=d();r(3),v("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(),A("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 Gr(t,n){if(t&1&&(i(0,"a",10),l(1,"Open in the desktop app"),a()),t&2){let e=d();C("href",e.desktopHref(),z)}}var Kn=[{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)}],_e=class t{auth=f(T);api=f(ee);router=f(M);configService=f(I);theme=f(Re);bridge=f(W);federation=f(Rn);lastEmail=zt();providers=this.federation.providers;showLocal=x(!!this.lastEmail&&rt(this.lastEmail)!=="sso");ssoBusy=x(null);ssoError=x("");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=Kn;pwOk(n){return Kn.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?"":ne(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")&&Jt()&&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(){qt(),new URLSearchParams(location.search).get("reauth")==="1"&&(sessionStorage.setItem(lt,"1"),history.replaceState(null,"",location.pathname)),this.reauth.set(this.auth.reauthPending());let n=sessionStorage.getItem(st);sessionStorage.removeItem(st),(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(lt),this.reauth.set(!1);let n=sessionStorage.getItem(me);sessionStorage.removeItem(me);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=jt(e.tokens.IdToken).email??"";this.auth.completeSignIn(e.tokens,o,"sso",{federationClientId:e.clientId})}).catch(e=>this.ssoError.set(Vn(e)))}backToStart(){this.ssoError.set(""),this.screen.set("email"),location.pathname.startsWith("/login")||history.replaceState(null,"","/login")}revealLocal(){this.showLocal.set(!0)}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(ge){let Xe=N;try{Xe=decodeURIComponent(N)}catch{}if(Xe===N)throw ge;q=yield this.api.signInWithPassword(g,Xe)}try{let ge=JSON.parse(q.ChallengeParameters?.userAttributes??"{}");ge.email&&this.email.set(ge.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=rt(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()||($t(),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 pe("MissingOptions","Passkey sign-in unavailable.");let{credentialId:o,credential:s}=yield tn(e).catch(N=>{throw Qn(N)&&!Ht(en(e))?new pe("PasskeyNotHere",Kr(this.bridge.isDesktop)):N});Se(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 pe("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(Yr(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"]],hostAttrs:[1,"login-ground"],decls:25,vars:4,consts:[[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","","appAutofocus","",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","appAutofocus","",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","appAutofocus","",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","appAutofocus","",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","appAutofocus","",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","appAutofocus","",1,"ui-input","code",3,"ngModelChange","ngModel"],["name","newPassword","autocomplete","new-password","appAutofocus","",1,"ui-input",3,"ngModelChange","type","ngModel"]],template:function(e,o){if(e&1&&(i(0,"div",0)(1,"div",1),u(2,sr,1,1,"img",2)(3,lr,2,1,"div",3),i(4,"h2",4),l(5,"One place for all"),b(6,"br"),l(7,"your AWS access"),a(),i(8,"p",5),l(9," Short-lived credentials, approvals and audit \u2014 under your own brand. "),a()(),i(10,"div",6)(11,"div",7),u(12,dr,1,1,"img",8)(13,cr,2,1,"div",9),u(14,br,11,6)(15,wr,2,1)(16,Pr,6,1)(17,Br,13,4)(18,Fr,17,11)(19,zr,21,11)(20,Ur,13,6)(21,$r,11,5)(22,Wr,15,7)(23,jr,15,9),u(24,Gr,2,1,"a",10),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:[Ie,Oe,Te,Pe,Ne,Ae,De,Me,Ze,B,On,Ve,re,te],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}']})},Qn=t=>t instanceof DOMException&&t.name==="NotAllowedError";function Kr(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 Yr(t,n){if(Qn(t))return"The passkey prompt was closed \u2014 try again, or choose a different way.";if(t instanceof pe)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 Zn=[{path:"login",component:_e},{path:"auth/callback",component:_e},{path:"",canActivate:[Ln],component:Qe,children:[{path:"",pathMatch:"full",redirectTo:"accounts"},{path:"accounts",loadComponent:()=>import("./chunk-CRA4BXRG.js").then(t=>t.AccountsPageComponent)},{path:"plugins/:pluginId/:section",canActivate:[Bn],loadComponent:()=>import("./chunk-QPJMXXVU.js").then(t=>t.PluginPageComponent)},{path:"resources",canActivate:[ct],loadComponent:()=>import("./chunk-AGIEKAIC.js").then(t=>t.ResourcesPageComponent)},{path:"tokens",canActivate:[Kt],loadComponent:()=>import("./chunk-RT3Z3BAE.js").then(t=>t.TokensPageComponent)},{path:"users",canActivate:[Y],loadComponent:()=>import("./chunk-XYMRYK4W.js").then(t=>t.UsersPageComponent)},{path:"admin/accounts",canActivate:[Y],loadComponent:()=>import("./chunk-BU5KGVV6.js").then(t=>t.AdminAccountsPageComponent)},{path:"admin/resources",canActivate:[Y,ct],loadComponent:()=>import("./chunk-2N3QJQ54.js").then(t=>t.AdminResourcesPageComponent)},{path:"admin/requests",canActivate:[Y],loadComponent:()=>import("./chunk-WTTH75JL.js").then(t=>t.AdminRequestsPageComponent)},{path:"admin/groups",canActivate:[Y],loadComponent:()=>import("./chunk-C7PXYYAE.js").then(t=>t.GroupsPageComponent)},{path:"admin/service-users",redirectTo:"/users?tab=service-users"},{path:"admin/activity",canActivate:[Y],loadComponent:()=>import("./chunk-SPUUYPZQ.js").then(t=>t.ActivityPageComponent)}]},{path:"**",redirectTo:""}];function Qr(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 at({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(Ct(s=>s instanceof at&&s.status===401?gt(e.refreshNow()).pipe(ht(g=>g?n(o(t)):tt(()=>Qr(e,s)))):tt(()=>s)))};var Zr=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??"")},_t="auth.chunkReload",Jr=t=>{if(!Zr(t.error))return;let n=!1;try{n=sessionStorage.getItem(_t)===t.url,n||sessionStorage.setItem(_t,t.url)}catch{}n||window.location.assign(t.url)},Xr=()=>{f(M).events.subscribe(t=>{if(t instanceof ve)try{sessionStorage.removeItem(_t)}catch{}})},Xn={providers:[Ot({eventCoalescing:!0}),Lt(Zn,Ft(Jr)),Rt(Bt([Jn])),nt(()=>ft(f(I).config$).then(an)),nt(Xr)]};var Je=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&&b(0,"router-outlet")},dependencies:[we],encapsulation:2})};Vt(Je,Xn).catch(t=>console.error(t));