From 1ff57fff153a4924d657acdf10d9276b4275e704 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Wed, 13 May 2026 13:32:29 +0100 Subject: [PATCH] fix(router): redirect authenticated users away from login page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When init() restores session from cookie and user's current URL is /login, the guard was calling next() without checking isAuthenticated — leaving the user on the login page despite having a valid session. Now redirects to dashboard if already authenticated. Co-Authored-By: Claude Sonnet 4.6 --- .../{AdminView-C7wez57z.js => AdminView-Dp6LfsVH.js} | 2 +- .../{AppLayout-jL4SBUkd.js => AppLayout-Dm7xvIFg.js} | 2 +- ... Badge.vue_vue_type_script_setup_true_lang-DAgGdGY2.js} | 2 +- ...Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js} | 2 +- .../{CalendarView-ylCKpGKw.js => CalendarView-CaW5n3jj.js} | 4 ++-- ...ontent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js} | 2 +- ...dTitle.vue_vue_type_script_setup_true_lang-BMHIwlxU.js} | 2 +- ...Dialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js} | 2 +- ...DashboardView-CmARPWJW.js => DashboardView-BXyr7l4W.js} | 2 +- ...aTable.vue_vue_type_script_setup_true_lang-8gHvRwtL.js} | 2 +- ...ctForm.vue_vue_type_script_setup_true_lang-Bv-vOrXl.js} | 2 +- .../{DevopsView-TX3WlewI.js => DevopsView-CyGHofcw.js} | 2 +- ...Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js} | 2 +- ...yState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js} | 2 +- ... Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js} | 2 +- .../assets/{KeysView-DFI2tF0F.js => KeysView-BbrvrPgK.js} | 2 +- .../assets/{LiveView-DDM8h9ml.js => LiveView-CtRvAfQD.js} | 2 +- .../{LoginView-D4TcGUK9.js => LoginView-8WQzarqw.js} | 2 +- .../assets/{OmgView-DRcTYRif.js => OmgView-BhU31iOQ.js} | 2 +- ...etailView-CdtUGv8p.js => ProjectDetailView-4KJdgDVR.js} | 2 +- .../{ProjectsView-DYSEwPaV.js => ProjectsView-BFbSEcZ2.js} | 2 +- .../{ReportsView-CpecHUOd.js => ReportsView-Br61zuWE.js} | 2 +- ...ontrol.vue_vue_type_script_setup_true_lang-t9SJyic6.js} | 2 +- .../{SettingsView-CuZ9KN7E.js => SettingsView-BQsCH9JJ.js} | 2 +- ...eleton.vue_vue_type_script_setup_true_lang-DhWXp9By.js} | 2 +- ...pinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js} | 2 +- ...skForm.vue_vue_type_script_setup_true_lang-cQ4nGVcO.js} | 2 +- .../{TasksView-DihMnVxc.js => TasksView-CS-ndHtq.js} | 2 +- ...xtarea.vue_vue_type_script_setup_true_lang-BYTYmReP.js} | 2 +- ...ooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js} | 2 +- src/static/assets/{admin-Bt3HG9mf.js => admin-DXsqWfhz.js} | 2 +- .../assets/{calendar-GhZPhKWb.js => calendar-BJMyS7_H.js} | 2 +- ...calendar-days-OJQzkSiF.js => calendar-days-B6LXSX5z.js} | 2 +- ...LucideIcon-BQqEiwZb.js => createLucideIcon-CglWgwD8.js} | 2 +- .../{dashboard-DAarnFBr.js => dashboard-9KozuccB.js} | 2 +- .../assets/{devops-DzkXDmpg.js => devops-CgM36Koe.js} | 2 +- .../{file-text-DKL7lELr.js => file-text-DJt8VL3c.js} | 2 +- .../{folder-open-Dm6Er06z.js => folder-open-Cenu-_Fx.js} | 2 +- .../assets/{format-gWy7j8JO.js => format-DscROiV-.js} | 2 +- src/static/assets/{index-rN5A-UTe.js => index-Dj4QxrF8.js} | 4 ++-- src/static/assets/{plus-8OWFLnn5.js => plus-C-ov7K0l.js} | 2 +- src/static/assets/projects-Bt6sxsgH.js | 1 + src/static/assets/projects-COzvhtq2.js | 1 - src/static/assets/{tasks-PDTqLr3E.js => tasks-Dt_weT6j.js} | 2 +- src/static/assets/{zap-B0jfADxc.js => zap-Bmdr3aWk.js} | 2 +- src/static/index.html | 2 +- web/src/router/index.ts | 7 ++++++- 47 files changed, 53 insertions(+), 48 deletions(-) rename src/static/assets/{AdminView-C7wez57z.js => AdminView-Dp6LfsVH.js} (89%) rename src/static/assets/{AppLayout-jL4SBUkd.js => AppLayout-Dm7xvIFg.js} (99%) rename src/static/assets/{Badge.vue_vue_type_script_setup_true_lang-igExkyOK.js => Badge.vue_vue_type_script_setup_true_lang-DAgGdGY2.js} (91%) rename src/static/assets/{Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js => Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js} (91%) rename src/static/assets/{CalendarView-ylCKpGKw.js => CalendarView-CaW5n3jj.js} (95%) rename src/static/assets/{CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js => CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js} (86%) rename src/static/assets/{CardTitle.vue_vue_type_script_setup_true_lang-CugNHrdd.js => CardTitle.vue_vue_type_script_setup_true_lang-BMHIwlxU.js} (87%) rename src/static/assets/{ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js => ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js} (92%) rename src/static/assets/{DashboardView-CmARPWJW.js => DashboardView-BXyr7l4W.js} (97%) rename src/static/assets/{DataTable.vue_vue_type_script_setup_true_lang-CHKsc19V.js => DataTable.vue_vue_type_script_setup_true_lang-8gHvRwtL.js} (95%) rename src/static/assets/{DevopsConnectForm.vue_vue_type_script_setup_true_lang-BzwbMDjx.js => DevopsConnectForm.vue_vue_type_script_setup_true_lang-Bv-vOrXl.js} (90%) rename src/static/assets/{DevopsView-TX3WlewI.js => DevopsView-CyGHofcw.js} (89%) rename src/static/assets/{Dialog.vue_vue_type_script_setup_true_lang-5tIAaGh4.js => Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js} (95%) rename src/static/assets/{EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js => EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js} (94%) rename src/static/assets/{Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js => Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js} (94%) rename src/static/assets/{KeysView-DFI2tF0F.js => KeysView-BbrvrPgK.js} (87%) rename src/static/assets/{LiveView-DDM8h9ml.js => LiveView-CtRvAfQD.js} (90%) rename src/static/assets/{LoginView-D4TcGUK9.js => LoginView-8WQzarqw.js} (94%) rename src/static/assets/{OmgView-DRcTYRif.js => OmgView-BhU31iOQ.js} (92%) rename src/static/assets/{ProjectDetailView-CdtUGv8p.js => ProjectDetailView-4KJdgDVR.js} (92%) rename src/static/assets/{ProjectsView-DYSEwPaV.js => ProjectsView-BFbSEcZ2.js} (91%) rename src/static/assets/{ReportsView-CpecHUOd.js => ReportsView-Br61zuWE.js} (98%) rename src/static/assets/{SegmentedControl.vue_vue_type_script_setup_true_lang-CAqylCqr.js => SegmentedControl.vue_vue_type_script_setup_true_lang-t9SJyic6.js} (95%) rename src/static/assets/{SettingsView-CuZ9KN7E.js => SettingsView-BQsCH9JJ.js} (94%) rename src/static/assets/{Skeleton.vue_vue_type_script_setup_true_lang-DvqtZljC.js => Skeleton.vue_vue_type_script_setup_true_lang-DhWXp9By.js} (77%) rename src/static/assets/{Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js => Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js} (90%) rename src/static/assets/{TaskForm.vue_vue_type_script_setup_true_lang-gqrw8v69.js => TaskForm.vue_vue_type_script_setup_true_lang-cQ4nGVcO.js} (93%) rename src/static/assets/{TasksView-DihMnVxc.js => TasksView-CS-ndHtq.js} (90%) rename src/static/assets/{Textarea.vue_vue_type_script_setup_true_lang-MCF8JR3D.js => Textarea.vue_vue_type_script_setup_true_lang-BYTYmReP.js} (92%) rename src/static/assets/{Tooltip.vue_vue_type_script_setup_true_lang-CcvjvjWJ.js => Tooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js} (93%) rename src/static/assets/{admin-Bt3HG9mf.js => admin-DXsqWfhz.js} (68%) rename src/static/assets/{calendar-GhZPhKWb.js => calendar-BJMyS7_H.js} (87%) rename src/static/assets/{calendar-days-OJQzkSiF.js => calendar-days-B6LXSX5z.js} (91%) rename src/static/assets/{createLucideIcon-BQqEiwZb.js => createLucideIcon-CglWgwD8.js} (96%) rename src/static/assets/{dashboard-DAarnFBr.js => dashboard-9KozuccB.js} (88%) rename src/static/assets/{devops-DzkXDmpg.js => devops-CgM36Koe.js} (94%) rename src/static/assets/{file-text-DKL7lELr.js => file-text-DJt8VL3c.js} (89%) rename src/static/assets/{folder-open-Dm6Er06z.js => folder-open-Cenu-_Fx.js} (88%) rename src/static/assets/{format-gWy7j8JO.js => format-DscROiV-.js} (99%) rename src/static/assets/{index-rN5A-UTe.js => index-Dj4QxrF8.js} (99%) rename src/static/assets/{plus-8OWFLnn5.js => plus-C-ov7K0l.js} (83%) create mode 100644 src/static/assets/projects-Bt6sxsgH.js delete mode 100644 src/static/assets/projects-COzvhtq2.js rename src/static/assets/{tasks-PDTqLr3E.js => tasks-Dt_weT6j.js} (96%) rename src/static/assets/{zap-B0jfADxc.js => zap-Bmdr3aWk.js} (87%) diff --git a/src/static/assets/AdminView-C7wez57z.js b/src/static/assets/AdminView-Dp6LfsVH.js similarity index 89% rename from src/static/assets/AdminView-C7wez57z.js rename to src/static/assets/AdminView-Dp6LfsVH.js index 024d4b5..7af58fe 100644 --- a/src/static/assets/AdminView-C7wez57z.js +++ b/src/static/assets/AdminView-Dp6LfsVH.js @@ -1 +1 @@ -import{d as _,u as y,A as h,c as r,a as t,e as n,k as v,w as d,f as g,s as m,o as s,F as b,r as k,t as a,q as u,h as A}from"./index-rN5A-UTe.js";import{a as w}from"./admin-Bt3HG9mf.js";import{_ as B,a as S}from"./CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js";import{_ as f}from"./Badge.vue_vue_type_script_setup_true_lang-igExkyOK.js";import{_ as V}from"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";import{a as $}from"./utils-7WVCegLb.js";const N={class:"p-6 space-y-8"},C={key:0,class:"flex items-center justify-center h-20"},D={class:"w-full"},E={class:"px-4 py-3"},F={class:"text-sm font-medium text-foreground"},R={class:"px-4 py-3 text-sm text-muted-foreground"},U={class:"px-4 py-3"},j={class:"px-4 py-3"},q={class:"px-4 py-3 text-xs text-muted-foreground"},H=_({__name:"AdminView",setup(I){const x=y(),p=g(),i=m([]),l=m(!1);return h(async()=>{if(!x.isAdmin){p.push("/");return}l.value=!0;try{const c=await w.users();i.value=c.data}finally{l.value=!1}}),(c,o)=>(s(),r("div",N,[o[1]||(o[1]=t("h2",{class:"text-lg font-semibold text-foreground"},"Admin — Users",-1)),l.value?(s(),r("div",C,[n(V,{class:"text-primary"})])):(s(),v(B,{key:1},{default:d(()=>[n(S,{class:"p-0"},{default:d(()=>[t("table",D,[o[0]||(o[0]=t("thead",null,[t("tr",{class:"border-b border-border"},[t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"User"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Email"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Role"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Status"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Joined")])],-1)),t("tbody",null,[(s(!0),r(b,null,k(i.value,e=>(s(),r("tr",{key:e.id,class:"border-b border-border last:border-0 hover:bg-muted/30"},[t("td",E,[t("p",F,a(e.username),1)]),t("td",R,a(e.email),1),t("td",U,[n(f,{variant:e.role==="admin"?"default":"secondary",class:"text-xs"},{default:d(()=>[u(a(e.role),1)]),_:2},1032,["variant"])]),t("td",j,[n(f,{variant:e.is_active?"success":"outline",class:"text-xs"},{default:d(()=>[u(a(e.is_active?"Active":"Inactive"),1)]),_:2},1032,["variant"])]),t("td",q,a(A($)(e.created_at)),1)]))),128))])])]),_:1})]),_:1}))]))}});export{H as default}; +import{d as _,u as y,A as h,c as r,a as t,e as n,k as v,w as d,f as g,s as m,o as s,F as b,r as k,t as a,q as u,h as A}from"./index-Dj4QxrF8.js";import{a as w}from"./admin-DXsqWfhz.js";import{_ as B,a as S}from"./CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js";import{_ as f}from"./Badge.vue_vue_type_script_setup_true_lang-DAgGdGY2.js";import{_ as V}from"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";import{a as $}from"./utils-7WVCegLb.js";const N={class:"p-6 space-y-8"},C={key:0,class:"flex items-center justify-center h-20"},D={class:"w-full"},E={class:"px-4 py-3"},F={class:"text-sm font-medium text-foreground"},R={class:"px-4 py-3 text-sm text-muted-foreground"},U={class:"px-4 py-3"},j={class:"px-4 py-3"},q={class:"px-4 py-3 text-xs text-muted-foreground"},H=_({__name:"AdminView",setup(I){const x=y(),p=g(),i=m([]),l=m(!1);return h(async()=>{if(!x.isAdmin){p.push("/");return}l.value=!0;try{const c=await w.users();i.value=c.data}finally{l.value=!1}}),(c,o)=>(s(),r("div",N,[o[1]||(o[1]=t("h2",{class:"text-lg font-semibold text-foreground"},"Admin — Users",-1)),l.value?(s(),r("div",C,[n(V,{class:"text-primary"})])):(s(),v(B,{key:1},{default:d(()=>[n(S,{class:"p-0"},{default:d(()=>[t("table",D,[o[0]||(o[0]=t("thead",null,[t("tr",{class:"border-b border-border"},[t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"User"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Email"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Role"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Status"),t("th",{class:"text-left text-xs font-medium text-muted-foreground px-4 py-3"},"Joined")])],-1)),t("tbody",null,[(s(!0),r(b,null,k(i.value,e=>(s(),r("tr",{key:e.id,class:"border-b border-border last:border-0 hover:bg-muted/30"},[t("td",E,[t("p",F,a(e.username),1)]),t("td",R,a(e.email),1),t("td",U,[n(f,{variant:e.role==="admin"?"default":"secondary",class:"text-xs"},{default:d(()=>[u(a(e.role),1)]),_:2},1032,["variant"])]),t("td",j,[n(f,{variant:e.is_active?"success":"outline",class:"text-xs"},{default:d(()=>[u(a(e.is_active?"Active":"Inactive"),1)]),_:2},1032,["variant"])]),t("td",q,a(A($)(e.created_at)),1)]))),128))])])]),_:1})]),_:1}))]))}});export{H as default}; diff --git a/src/static/assets/AppLayout-jL4SBUkd.js b/src/static/assets/AppLayout-Dm7xvIFg.js similarity index 99% rename from src/static/assets/AppLayout-jL4SBUkd.js rename to src/static/assets/AppLayout-Dm7xvIFg.js index dd98a0e..7b752b6 100644 --- a/src/static/assets/AppLayout-jL4SBUkd.js +++ b/src/static/assets/AppLayout-Dm7xvIFg.js @@ -1 +1 @@ -import{d as C,u as M,c as n,b as B,a as e,F as V,r as _,t as g,h as p,j as b,o as r,k as $,w as j,i as y,n as d,m as A,l as H,R as D,g as z,p as S,q as T,K as L,f as O,e as m,T as R,s as I,v as N}from"./index-rN5A-UTe.js";const P={class:"flex flex-col h-full bg-white border-r border-slate-200/80"},F={class:"flex-1 px-3 py-4 space-y-0.5 overflow-y-auto"},K={key:0,class:"absolute left-0 top-1/2 -translate-y-1/2 w-1 h-6 bg-orange-500 rounded-r-full"},q={class:"text-sm"},E={class:"p-4 border-t border-slate-100 shrink-0"},G={class:"flex items-center gap-3 px-2 py-2 rounded-xl bg-slate-50"},U={class:"h-8 w-8 rounded-full bg-gradient-to-br from-orange-400 to-orange-600 flex items-center justify-center text-[11px] font-bold text-white shrink-0 shadow-sm shadow-orange-200"},W={class:"flex-1 min-w-0"},J={class:"text-xs font-semibold text-slate-700 truncate"},Q=C({__name:"Sidebar",emits:["close"],setup(w,{emit:v}){const a=z(),l=M(),k=v,u=[{name:"Dashboard",path:"/",icon:"grid"},{name:"Calendar",path:"/calendar",icon:"calendar"},{name:"Tasks",path:"/tasks",icon:"check-square"},{name:"OMG",path:"/omg",icon:"omg"},{name:"Projects",path:"/projects",icon:"folder"},{name:"Live Feed",path:"/live",icon:"activity"},{name:"Reports",path:"/reports",icon:"file-text"},{name:"Keys",path:"/keys",icon:"key"},{name:"DevOps",path:"/devops",icon:"devops"},{name:"Settings",path:"/settings",icon:"settings"},{name:"Admin",path:"/admin",icon:"shield",adminOnly:!0}],x=b(()=>u.filter(h=>!h.adminOnly||l.isAdmin));function s(h){return h==="/"?a.path==="/":a.path.startsWith(h)}const i=b(()=>{var t,c;return(((t=l.user)==null?void 0:t.username)??((c=l.user)==null?void 0:c.email)??"?").slice(0,2).toUpperCase()});return(h,t)=>{var c,f;return r(),n("aside",P,[t[13]||(t[13]=B('

CC Dashboard

Oliver Agency

',1)),e("nav",F,[(r(!0),n(V,null,_(x.value,o=>(r(),$(H(o.external?"a":p(D)),A({key:o.path},{ref_for:!0},o.external?{href:o.path,target:"_blank",rel:"noopener"}:{to:o.path},{class:["relative flex items-center gap-3 px-3 h-10 rounded-xl text-sm font-medium transition-all duration-200 group",s(o.path)?"bg-orange-50 text-orange-600":"text-slate-500 hover:bg-slate-50 hover:text-slate-800"],onClick:t[0]||(t[0]=le=>k("close"))}),{default:j(()=>[s(o.path)?(r(),n("span",K)):y("",!0),o.icon==="grid"?(r(),n("svg",{key:1,class:d(["h-4 w-4 shrink-0 transition-colors",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[1]||(t[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"},null,-1)])],2)):o.icon==="calendar"?(r(),n("svg",{key:2,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[2]||(t[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2)):o.icon==="check-square"?(r(),n("svg",{key:3,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[3]||(t[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},null,-1)])],2)):o.icon==="omg"?(r(),n("svg",{key:4,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[4]||(t[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)])],2)):o.icon==="folder"?(r(),n("svg",{key:5,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[5]||(t[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7a2 2 0 012-2h3.586a1 1 0 01.707.293l1.414 1.414A1 1 0 0011.414 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"},null,-1)])],2)):o.icon==="activity"?(r(),n("svg",{key:6,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[6]||(t[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"},null,-1)])],2)):o.icon==="file-text"?(r(),n("svg",{key:7,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[7]||(t[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},null,-1)])],2)):o.icon==="key"?(r(),n("svg",{key:8,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[8]||(t[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])],2)):o.icon==="devops"?(r(),n("svg",{key:9,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[9]||(t[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"},null,-1)])],2)):o.icon==="settings"?(r(),n("svg",{key:10,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[10]||(t[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)])],2)):o.icon==="shield"?(r(),n("svg",{key:11,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[11]||(t[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)])],2)):y("",!0),e("span",q,g(o.name),1)]),_:2},1040,["class"]))),128))]),e("div",E,[e("div",G,[e("div",U,g(i.value),1),e("div",W,[e("p",J,g(((c=p(l).user)==null?void 0:c.username)??((f=p(l).user)==null?void 0:f.email)),1),t[12]||(t[12]=e("div",{class:"flex items-center gap-1 mt-0.5"},[e("div",{class:"h-1.5 w-1.5 rounded-full bg-emerald-400"}),e("span",{class:"text-[10px] text-slate-400 font-medium"},"Online")],-1))])])])])}}}),X={class:"h-14 border-b border-slate-200/80 bg-white/80 backdrop-blur-xl flex items-center px-4 gap-3 shrink-0 sticky top-0 z-10 shadow-sm shadow-slate-100/60"},Y={class:"flex-1"},Z={class:"text-sm font-semibold text-foreground"},ee={class:"flex items-center gap-2.5"},te={class:"h-7 w-7 rounded-full bg-gradient-to-br from-orange-400 to-orange-600 flex items-center justify-center text-[10px] font-bold text-white shrink-0 shadow-sm shadow-orange-200"},oe={class:"hidden sm:block text-xs font-medium text-foreground max-w-[120px] truncate"},se=C({__name:"TopBar",props:{title:{},sidebarOpen:{type:Boolean}},emits:["toggleSidebar","toggleDark"],setup(w,{emit:v}){const a=v,l=M(),k=O();async function u(){await l.logout(),L.success("Logged out"),k.push({name:"login"})}function x(){const s=document.documentElement.classList.toggle("dark");localStorage.setItem("theme",s?"dark":"light"),a("toggleDark")}return(s,i)=>{var h,t,c,f;return r(),n("header",X,[e("button",{class:"lg:hidden flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground transition-colors","aria-label":"Toggle sidebar",onClick:i[0]||(i[0]=o=>a("toggleSidebar"))},[...i[1]||(i[1]=[e("svg",{class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),e("div",Y,[e("h1",Z,g(w.title??"CC Dashboard"),1)]),S(s.$slots,"actions"),e("button",{class:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground transition-colors","aria-label":"Toggle dark mode",onClick:x},[...i[2]||(i[2]=[e("svg",{class:"h-4 w-4 hidden dark:block",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})],-1),e("svg",{class:"h-4 w-4 dark:hidden",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})],-1)])]),i[4]||(i[4]=e("div",{class:"h-6 w-px bg-border"},null,-1)),e("div",ee,[e("div",te,g((((h=p(l).user)==null?void 0:h.username)??((t=p(l).user)==null?void 0:t.email)??"?").slice(0,2).toUpperCase()),1),e("span",oe,g(((c=p(l).user)==null?void 0:c.username)??((f=p(l).user)==null?void 0:f.email)),1),e("button",{class:"flex h-7 items-center gap-1 rounded-md px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",onClick:u},[...i[3]||(i[3]=[e("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})],-1),T(" Sign out ",-1)])])])])}}}),re={class:"h-screen flex overflow-hidden",style:{background:"linear-gradient(135deg, #f0f4fa 0%, #f8f9fd 50%, #fef9f5 100%)"}},ne={class:"flex-1 flex flex-col overflow-hidden min-w-0"},ae={class:"flex-1 overflow-y-auto"},de=C({__name:"AppLayout",setup(w){const v=z(),a=I(!1),l=b(()=>({dashboard:"Dashboard",calendar:"Calendar",projects:"Projects","project-detail":"Project Details",live:"Live Feed",reports:"AI Reports",keys:"API Keys",tasks:"Tasks",omg:"OMG",devops:"Azure DevOps",settings:"Settings",admin:"Admin"})[v.name]??"CC Dashboard");return(k,u)=>{const x=N("RouterView");return r(),n("div",re,[m(R,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:j(()=>[a.value?(r(),n("div",{key:0,class:"fixed inset-0 z-20 bg-black/60 lg:hidden",onClick:u[0]||(u[0]=s=>a.value=!1)})):y("",!0)]),_:1}),e("div",{class:d(["fixed inset-y-0 left-0 z-30 w-60 transform transition-transform duration-300 lg:relative lg:translate-x-0",a.value?"translate-x-0":"-translate-x-full"])},[m(Q,{onClose:u[1]||(u[1]=s=>a.value=!1)})],2),e("div",ne,[m(se,{title:l.value,"sidebar-open":a.value,onToggleSidebar:u[2]||(u[2]=s=>a.value=!a.value)},null,8,["title","sidebar-open"]),e("main",ae,[m(x)])])])}}});export{de as default}; +import{d as C,u as M,c as n,b as B,a as e,F as V,r as _,t as g,h as p,j as b,o as r,k as $,w as j,i as y,n as d,m as A,l as H,R as D,g as z,p as S,q as T,K as L,f as O,e as m,T as R,s as I,v as N}from"./index-Dj4QxrF8.js";const P={class:"flex flex-col h-full bg-white border-r border-slate-200/80"},F={class:"flex-1 px-3 py-4 space-y-0.5 overflow-y-auto"},K={key:0,class:"absolute left-0 top-1/2 -translate-y-1/2 w-1 h-6 bg-orange-500 rounded-r-full"},q={class:"text-sm"},E={class:"p-4 border-t border-slate-100 shrink-0"},G={class:"flex items-center gap-3 px-2 py-2 rounded-xl bg-slate-50"},U={class:"h-8 w-8 rounded-full bg-gradient-to-br from-orange-400 to-orange-600 flex items-center justify-center text-[11px] font-bold text-white shrink-0 shadow-sm shadow-orange-200"},W={class:"flex-1 min-w-0"},J={class:"text-xs font-semibold text-slate-700 truncate"},Q=C({__name:"Sidebar",emits:["close"],setup(w,{emit:v}){const a=z(),l=M(),k=v,u=[{name:"Dashboard",path:"/",icon:"grid"},{name:"Calendar",path:"/calendar",icon:"calendar"},{name:"Tasks",path:"/tasks",icon:"check-square"},{name:"OMG",path:"/omg",icon:"omg"},{name:"Projects",path:"/projects",icon:"folder"},{name:"Live Feed",path:"/live",icon:"activity"},{name:"Reports",path:"/reports",icon:"file-text"},{name:"Keys",path:"/keys",icon:"key"},{name:"DevOps",path:"/devops",icon:"devops"},{name:"Settings",path:"/settings",icon:"settings"},{name:"Admin",path:"/admin",icon:"shield",adminOnly:!0}],x=b(()=>u.filter(h=>!h.adminOnly||l.isAdmin));function s(h){return h==="/"?a.path==="/":a.path.startsWith(h)}const i=b(()=>{var t,c;return(((t=l.user)==null?void 0:t.username)??((c=l.user)==null?void 0:c.email)??"?").slice(0,2).toUpperCase()});return(h,t)=>{var c,f;return r(),n("aside",P,[t[13]||(t[13]=B('

CC Dashboard

Oliver Agency

',1)),e("nav",F,[(r(!0),n(V,null,_(x.value,o=>(r(),$(H(o.external?"a":p(D)),A({key:o.path},{ref_for:!0},o.external?{href:o.path,target:"_blank",rel:"noopener"}:{to:o.path},{class:["relative flex items-center gap-3 px-3 h-10 rounded-xl text-sm font-medium transition-all duration-200 group",s(o.path)?"bg-orange-50 text-orange-600":"text-slate-500 hover:bg-slate-50 hover:text-slate-800"],onClick:t[0]||(t[0]=le=>k("close"))}),{default:j(()=>[s(o.path)?(r(),n("span",K)):y("",!0),o.icon==="grid"?(r(),n("svg",{key:1,class:d(["h-4 w-4 shrink-0 transition-colors",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[1]||(t[1]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"},null,-1)])],2)):o.icon==="calendar"?(r(),n("svg",{key:2,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[2]||(t[2]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])],2)):o.icon==="check-square"?(r(),n("svg",{key:3,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[3]||(t[3]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},null,-1)])],2)):o.icon==="omg"?(r(),n("svg",{key:4,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[4]||(t[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)])],2)):o.icon==="folder"?(r(),n("svg",{key:5,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[5]||(t[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 7a2 2 0 012-2h3.586a1 1 0 01.707.293l1.414 1.414A1 1 0 0011.414 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"},null,-1)])],2)):o.icon==="activity"?(r(),n("svg",{key:6,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[6]||(t[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"},null,-1)])],2)):o.icon==="file-text"?(r(),n("svg",{key:7,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[7]||(t[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},null,-1)])],2)):o.icon==="key"?(r(),n("svg",{key:8,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[8]||(t[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])],2)):o.icon==="devops"?(r(),n("svg",{key:9,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[9]||(t[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"},null,-1)])],2)):o.icon==="settings"?(r(),n("svg",{key:10,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[10]||(t[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"},null,-1),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1)])],2)):o.icon==="shield"?(r(),n("svg",{key:11,class:d(["h-4 w-4 shrink-0",s(o.path)?"text-orange-500":"text-slate-400 group-hover:text-slate-600"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...t[11]||(t[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)])],2)):y("",!0),e("span",q,g(o.name),1)]),_:2},1040,["class"]))),128))]),e("div",E,[e("div",G,[e("div",U,g(i.value),1),e("div",W,[e("p",J,g(((c=p(l).user)==null?void 0:c.username)??((f=p(l).user)==null?void 0:f.email)),1),t[12]||(t[12]=e("div",{class:"flex items-center gap-1 mt-0.5"},[e("div",{class:"h-1.5 w-1.5 rounded-full bg-emerald-400"}),e("span",{class:"text-[10px] text-slate-400 font-medium"},"Online")],-1))])])])])}}}),X={class:"h-14 border-b border-slate-200/80 bg-white/80 backdrop-blur-xl flex items-center px-4 gap-3 shrink-0 sticky top-0 z-10 shadow-sm shadow-slate-100/60"},Y={class:"flex-1"},Z={class:"text-sm font-semibold text-foreground"},ee={class:"flex items-center gap-2.5"},te={class:"h-7 w-7 rounded-full bg-gradient-to-br from-orange-400 to-orange-600 flex items-center justify-center text-[10px] font-bold text-white shrink-0 shadow-sm shadow-orange-200"},oe={class:"hidden sm:block text-xs font-medium text-foreground max-w-[120px] truncate"},se=C({__name:"TopBar",props:{title:{},sidebarOpen:{type:Boolean}},emits:["toggleSidebar","toggleDark"],setup(w,{emit:v}){const a=v,l=M(),k=O();async function u(){await l.logout(),L.success("Logged out"),k.push({name:"login"})}function x(){const s=document.documentElement.classList.toggle("dark");localStorage.setItem("theme",s?"dark":"light"),a("toggleDark")}return(s,i)=>{var h,t,c,f;return r(),n("header",X,[e("button",{class:"lg:hidden flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground transition-colors","aria-label":"Toggle sidebar",onClick:i[0]||(i[0]=o=>a("toggleSidebar"))},[...i[1]||(i[1]=[e("svg",{class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),e("div",Y,[e("h1",Z,g(w.title??"CC Dashboard"),1)]),S(s.$slots,"actions"),e("button",{class:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground transition-colors","aria-label":"Toggle dark mode",onClick:x},[...i[2]||(i[2]=[e("svg",{class:"h-4 w-4 hidden dark:block",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})],-1),e("svg",{class:"h-4 w-4 dark:hidden",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})],-1)])]),i[4]||(i[4]=e("div",{class:"h-6 w-px bg-border"},null,-1)),e("div",ee,[e("div",te,g((((h=p(l).user)==null?void 0:h.username)??((t=p(l).user)==null?void 0:t.email)??"?").slice(0,2).toUpperCase()),1),e("span",oe,g(((c=p(l).user)==null?void 0:c.username)??((f=p(l).user)==null?void 0:f.email)),1),e("button",{class:"flex h-7 items-center gap-1 rounded-md px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",onClick:u},[...i[3]||(i[3]=[e("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})],-1),T(" Sign out ",-1)])])])])}}}),re={class:"h-screen flex overflow-hidden",style:{background:"linear-gradient(135deg, #f0f4fa 0%, #f8f9fd 50%, #fef9f5 100%)"}},ne={class:"flex-1 flex flex-col overflow-hidden min-w-0"},ae={class:"flex-1 overflow-y-auto"},de=C({__name:"AppLayout",setup(w){const v=z(),a=I(!1),l=b(()=>({dashboard:"Dashboard",calendar:"Calendar",projects:"Projects","project-detail":"Project Details",live:"Live Feed",reports:"AI Reports",keys:"API Keys",tasks:"Tasks",omg:"OMG",devops:"Azure DevOps",settings:"Settings",admin:"Admin"})[v.name]??"CC Dashboard");return(k,u)=>{const x=N("RouterView");return r(),n("div",re,[m(R,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:j(()=>[a.value?(r(),n("div",{key:0,class:"fixed inset-0 z-20 bg-black/60 lg:hidden",onClick:u[0]||(u[0]=s=>a.value=!1)})):y("",!0)]),_:1}),e("div",{class:d(["fixed inset-y-0 left-0 z-30 w-60 transform transition-transform duration-300 lg:relative lg:translate-x-0",a.value?"translate-x-0":"-translate-x-full"])},[m(Q,{onClose:u[1]||(u[1]=s=>a.value=!1)})],2),e("div",ne,[m(se,{title:l.value,"sidebar-open":a.value,onToggleSidebar:u[2]||(u[2]=s=>a.value=!a.value)},null,8,["title","sidebar-open"]),e("main",ae,[m(x)])])])}}});export{de as default}; diff --git a/src/static/assets/Badge.vue_vue_type_script_setup_true_lang-igExkyOK.js b/src/static/assets/Badge.vue_vue_type_script_setup_true_lang-DAgGdGY2.js similarity index 91% rename from src/static/assets/Badge.vue_vue_type_script_setup_true_lang-igExkyOK.js rename to src/static/assets/Badge.vue_vue_type_script_setup_true_lang-DAgGdGY2.js index e2ed018..6f36000 100644 --- a/src/static/assets/Badge.vue_vue_type_script_setup_true_lang-igExkyOK.js +++ b/src/static/assets/Badge.vue_vue_type_script_setup_true_lang-DAgGdGY2.js @@ -1 +1 @@ -import{c as a}from"./utils-7WVCegLb.js";import{d as n,o,c as s,n as d,h as i,p as c}from"./index-rN5A-UTe.js";const f=n({__name:"Badge",props:{variant:{default:"default"},class:{}},setup(r){const e=r;return(t,l)=>(o(),s("span",{class:d(i(a)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",{"bg-primary text-primary-foreground":e.variant==="default","bg-secondary text-secondary-foreground":e.variant==="secondary","bg-destructive text-destructive-foreground":e.variant==="destructive","border border-border text-foreground":e.variant==="outline","bg-emerald-500/20 text-emerald-400":e.variant==="success","bg-amber-500/20 text-amber-400":e.variant==="warning"},e.class))},[c(t.$slots,"default")],2))}});export{f as _}; +import{c as a}from"./utils-7WVCegLb.js";import{d as n,o,c as s,n as d,h as i,p as c}from"./index-Dj4QxrF8.js";const f=n({__name:"Badge",props:{variant:{default:"default"},class:{}},setup(r){const e=r;return(t,l)=>(o(),s("span",{class:d(i(a)("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",{"bg-primary text-primary-foreground":e.variant==="default","bg-secondary text-secondary-foreground":e.variant==="secondary","bg-destructive text-destructive-foreground":e.variant==="destructive","border border-border text-foreground":e.variant==="outline","bg-emerald-500/20 text-emerald-400":e.variant==="success","bg-amber-500/20 text-amber-400":e.variant==="warning"},e.class))},[c(t.$slots,"default")],2))}});export{f as _}; diff --git a/src/static/assets/Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js b/src/static/assets/Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js similarity index 91% rename from src/static/assets/Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js rename to src/static/assets/Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js index 51e9e23..6a7989f 100644 --- a/src/static/assets/Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js +++ b/src/static/assets/Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js @@ -1 +1 @@ -import{_ as c}from"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";import{c as l}from"./utils-7WVCegLb.js";import{d as u,c as f,n as m,k as b,i as v,p as g,j as p,o as n}from"./index-rN5A-UTe.js";const y=["type","disabled"],z=u({__name:"Button",props:{variant:{default:"default"},size:{default:"md"},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},type:{default:"button"},class:{}},emits:["click"],setup(t,{emit:s}){const e=t,a=s,r=p(()=>l("inline-flex items-center justify-center rounded-md font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",{"bg-primary text-primary-foreground hover:bg-primary/90":e.variant==="default","border border-input bg-background hover:bg-accent hover:text-accent-foreground":e.variant==="outline","hover:bg-accent hover:text-accent-foreground":e.variant==="ghost","bg-destructive text-destructive-foreground hover:bg-destructive/90":e.variant==="destructive","bg-secondary text-secondary-foreground hover:bg-secondary/80":e.variant==="secondary","underline-offset-4 hover:underline text-primary":e.variant==="link","h-8 px-3 text-xs":e.size==="sm","h-10 px-4 py-2 text-sm":e.size==="md","h-11 px-8 text-base":e.size==="lg","h-10 w-10 p-0":e.size==="icon"},e.class));return(i,o)=>(n(),f("button",{class:m(r.value),type:t.type,disabled:t.disabled||t.loading,onClick:o[0]||(o[0]=d=>a("click",d))},[t.loading?(n(),b(c,{key:0,size:"sm",class:"mr-2"})):v("",!0),g(i.$slots,"default")],10,y))}});export{z as _}; +import{_ as c}from"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";import{c as l}from"./utils-7WVCegLb.js";import{d as u,c as f,n as m,k as b,i as v,p as g,j as p,o as n}from"./index-Dj4QxrF8.js";const y=["type","disabled"],z=u({__name:"Button",props:{variant:{default:"default"},size:{default:"md"},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},type:{default:"button"},class:{}},emits:["click"],setup(t,{emit:s}){const e=t,a=s,r=p(()=>l("inline-flex items-center justify-center rounded-md font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",{"bg-primary text-primary-foreground hover:bg-primary/90":e.variant==="default","border border-input bg-background hover:bg-accent hover:text-accent-foreground":e.variant==="outline","hover:bg-accent hover:text-accent-foreground":e.variant==="ghost","bg-destructive text-destructive-foreground hover:bg-destructive/90":e.variant==="destructive","bg-secondary text-secondary-foreground hover:bg-secondary/80":e.variant==="secondary","underline-offset-4 hover:underline text-primary":e.variant==="link","h-8 px-3 text-xs":e.size==="sm","h-10 px-4 py-2 text-sm":e.size==="md","h-11 px-8 text-base":e.size==="lg","h-10 w-10 p-0":e.size==="icon"},e.class));return(i,o)=>(n(),f("button",{class:m(r.value),type:t.type,disabled:t.disabled||t.loading,onClick:o[0]||(o[0]=d=>a("click",d))},[t.loading?(n(),b(c,{key:0,size:"sm",class:"mr-2"})):v("",!0),g(i.$slots,"default")],10,y))}});export{z as _}; diff --git a/src/static/assets/CalendarView-ylCKpGKw.js b/src/static/assets/CalendarView-CaW5n3jj.js similarity index 95% rename from src/static/assets/CalendarView-ylCKpGKw.js rename to src/static/assets/CalendarView-CaW5n3jj.js index 8532bc7..99a6d48 100644 --- a/src/static/assets/CalendarView-ylCKpGKw.js +++ b/src/static/assets/CalendarView-CaW5n3jj.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/tasks-PDTqLr3E.js","assets/index-rN5A-UTe.js","assets/index-BxXZv7ay.css"])))=>i.map(i=>d[i]); -import{B as be,s as T,j as E,d as A,o as f,c as k,a as l,e as C,w as O,h as p,q as de,t as D,i as M,k as ce,z as j,n as I,C as fe,F as L,r as V,A as ve,g as xe,_ as he,K as R,f as we}from"./index-rN5A-UTe.js";import{d as ye}from"./dashboard-DAarnFBr.js";import{i as S,f as W}from"./utils-7WVCegLb.js";import{_ as U}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_ as le}from"./SegmentedControl.vue_vue_type_script_setup_true_lang-CAqylCqr.js";import{C as De,a as $e,f as P}from"./format-gWy7j8JO.js";import{u as Z}from"./tasks-PDTqLr3E.js";import{_ as Te}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as Se}from"./Badge.vue_vue_type_script_setup_true_lang-igExkyOK.js";import{_ as Ce}from"./TaskForm.vue_vue_type_script_setup_true_lang-gqrw8v69.js";import{_ as Me}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js";import"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";import"./createLucideIcon-BQqEiwZb.js";import"./Dialog.vue_vue_type_script_setup_true_lang-5tIAaGh4.js";import"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import"./Textarea.vue_vue_type_script_setup_true_lang-MCF8JR3D.js";import"./devops-DzkXDmpg.js";import"./projects-COzvhtq2.js";const G=40/30;function Be(a){if(a.length===0)return[];const t=[...a].sort((d,w)=>new Date(d.start_at).getTime()-new Date(w.start_at).getTime()),o=[],m=[];for(const d of t){const w=new Date(d.start_at).getTime(),y=new Date(d.end_at).getTime();let i=-1;for(let u=0;u{const y=new Date(d.start_at).getTime(),i=new Date(d.end_at).getTime();let u=w;for(const n of m){const r=new Date(n.block.start_at).getTime(),_=new Date(n.block.end_at).getTime();ry&&n.lane>u&&(u=n.lane)}return{block:d,lane:w,totalLanes:u+1}})}function Ee(a,t=7){return((a.getHours()-t)*60+a.getMinutes())*G}function ze(a,t){const o=(t.getTime()-a.getTime())/6e4;return Math.max(o*G,20)}function ie(a,t=7){const o=a.getDay(),m=new Date(a);return m.setDate(a.getDate()-(o+6)%7),m.setHours(0,0,0,0),Array.from({length:t},(h,d)=>{const w=new Date(m);return w.setDate(m.getDate()+d),w})}function ue(a,t=15){return Math.round(a/t)*t}const N=be("calendar",()=>{const a=T([]),t=T(new Date),o=T("week"),m=T(7),h=T(!1),d=T(null),w=E(()=>ie(t.value,m.value));async function y(e,x,g){h.value=!0,d.value=null;try{const B=await ye.calendar({from:e,to:x,view:g});a.value=B.data}catch(B){const Y=B;d.value=Y.message??"Failed to fetch calendar"}finally{h.value=!1}}function i(e){m.value=e}async function u(){if(o.value==="week"){const e=ie(t.value,m.value),x=S(e[0]),g=S(e[m.value-1]);await y(x,g,"week")}else{const e=S(t.value);await y(e,e,"day")}}function n(){const e=new Date(t.value);o.value==="week"?e.setDate(e.getDate()-7):e.setDate(e.getDate()-1),t.value=e}function r(){const e=new Date(t.value);o.value==="week"?e.setDate(e.getDate()+7):e.setDate(e.getDate()+1),t.value=e}function _(){t.value=new Date}function b(e){o.value=e}function $(e){a.value.push(e)}function v(e){const x=a.value.findIndex(g=>g.id===e.id);x!==-1&&(a.value[x]=e)}function s(e){a.value=a.value.filter(x=>x.id!==e)}function c(e){const x=S(e);return a.value.filter(g=>S(new Date(g.start_at))===x)}return{blocks:a,currentDate:t,view:o,weekLength:m,loading:h,error:d,weekDays:w,fetch:y,fetchCurrentView:u,navigatePrev:n,navigateNext:r,goToToday:_,setView:b,setWeekLength:i,addBlock:$,updateBlock:v,removeBlock:s,getBlocksForDay:c}}),Le={class:"flex items-center gap-2 flex-wrap"},Ve={class:"flex items-center gap-1"},je={class:"text-sm font-medium text-foreground flex-1 min-w-0 truncate"},Pe={key:0,class:"text-xs text-muted-foreground"},Fe=A({__name:"CalendarToolbar",setup(a){const t=N(),o=E(()=>{if(t.view==="week"){const u=t.weekDays;if(!u.length)return"";const n=u[0],r=u[u.length-1];return n.getMonth()===r.getMonth()?`${P(n,"MMM d")} – ${P(r,"d, yyyy")}`:`${P(n,"MMM d")} – ${P(r,"MMM d, yyyy")}`}else return P(t.currentDate,"EEEE, MMMM d, yyyy")}),m=[{value:"day",label:"Day"},{value:"week",label:"Week"}],h=[{value:"5",label:"5d"},{value:"7",label:"7d"}],d=E({get:()=>t.view,set:async u=>{t.setView(u),await t.fetchCurrentView()}}),w=E({get:()=>String(t.weekLength),set:async u=>{t.setWeekLength(Number(u)),await t.fetchCurrentView()}});async function y(u){u==="prev"?t.navigatePrev():t.navigateNext(),await t.fetchCurrentView()}async function i(){t.goToToday(),await t.fetchCurrentView()}return(u,n)=>(f(),k("div",Le,[l("div",Ve,[C(U,{variant:"ghost",size:"icon","aria-label":"Previous",onClick:n[0]||(n[0]=r=>y("prev"))},{default:O(()=>[C(p(De),{class:"h-4 w-4"})]),_:1}),C(U,{variant:"outline",size:"sm",onClick:i},{default:O(()=>[...n[4]||(n[4]=[de("Today",-1)])]),_:1}),C(U,{variant:"ghost",size:"icon","aria-label":"Next",onClick:n[1]||(n[1]=r=>y("next"))},{default:O(()=>[C(p($e),{class:"h-4 w-4"})]),_:1})]),l("span",je,D(o.value),1),p(t).loading?(f(),k("div",Pe,"Loading...")):M("",!0),C(le,{modelValue:d.value,"onUpdate:modelValue":n[2]||(n[2]=r=>d.value=r),options:m,"aria-label":"Calendar view"},null,8,["modelValue"]),p(t).view==="week"?(f(),ce(le,{key:1,modelValue:w.value,"onUpdate:modelValue":n[3]||(n[3]=r=>w.value=r),options:h,"aria-label":"Week length"},null,8,["modelValue"])):M("",!0)]))}}),Re=7;function me(){const a=Z(),t=N(),o=T(null),m=T(null),h=T(null),d=T(null);function w(v,s){var c,e;o.value=v.id,(c=s.dataTransfer)==null||c.setData("task_id",v.id),(e=s.dataTransfer)==null||e.setData("estimate_hours",String(v.estimate_hours??1))}function y(v,s){var e,x,g,B;const c=new Date(v.end_at).getTime()-new Date(v.start_at).getTime();(e=s.dataTransfer)==null||e.setData("block_id",v.id),(x=s.dataTransfer)==null||x.setData("block_duration_ms",String(c)),(g=s.dataTransfer)==null||g.setData("task_id",v.task_id??""),(B=s.dataTransfer)==null||B.setData("estimate_hours",String(c/36e5))}function i(v,s){s.preventDefault(),m.value=S(v)}function u(){m.value=null}async function n(v,s){var ne,ae,oe,se;s.preventDefault(),m.value=null,o.value=null;const c=(ne=s.dataTransfer)==null?void 0:ne.getData("block_id"),e=(ae=s.dataTransfer)==null?void 0:ae.getData("task_id"),x=parseFloat(((oe=s.dataTransfer)==null?void 0:oe.getData("estimate_hours"))??"1")||1,g=parseFloat(((se=s.dataTransfer)==null?void 0:se.getData("block_duration_ms"))??"0"),Y=s.currentTarget.getBoundingClientRect(),q=s.clientY-Y.top,K=ue(q/G,15),ge=Math.max(0,Math.min(K,12*60)),F=new Date(v);F.setHours(Re,0,0,0),F.setMinutes(F.getMinutes()+ge);const X=F.toISOString();if(c&&g>0){const pe=new Date(F.getTime()+g).toISOString();try{await a.updateBlock(c,{start_at:X,end_at:pe}),await t.fetchCurrentView()}catch(_e){console.error("Failed to move block:",_e)}return}if(!e)return;const J=new Date(F);J.setMinutes(J.getMinutes()+Math.round(x*60));const ee=J.toISOString(),te=`temp_${Date.now()}`,ke={kind:"planned",id:te,project_id:null,job_number:"",display_name:"Loading...",start_at:X,end_at:ee,title:"",color_hue:260,tags:[],task_id:e,session_id:null,manual_entry_id:null};t.addBlock(ke);try{await a.createBlock(e,{start_at:X,end_at:ee}),await t.fetchCurrentView()}catch(re){t.removeBlock(te),console.error("Failed to create task block:",re)}}let r=0,_="",b=null;function $(v,s){s.preventDefault(),s.stopPropagation(),h.value=v,b=v,r=s.clientY,_=v.end_at,d.value=v.end_at;const c=x=>{if(!b)return;const g=x.clientY-r,B=ue(g/G,15),q=new Date(_).getTime()+B*6e4,K=new Date(b.start_at).getTime()+15*6e4;d.value=new Date(Math.max(q,K)).toISOString()},e=async()=>{if(document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",e),!b||!d.value){h.value=null;return}const x=b.id,g=d.value;if(g===_){h.value=null,d.value=null;return}try{b.task_id&&await a.updateBlock(x,{start_at:b.start_at,end_at:g}),t.updateBlock({...b,end_at:g})}catch(B){console.error("Failed to resize block:",B),t.updateBlock({...b,end_at:_})}h.value=null,d.value=null,b=null};document.addEventListener("mousemove",c),document.addEventListener("mouseup",e)}return{draggingTaskId:o,dragOverDay:m,resizingBlock:h,resizePreviewEnd:d,onDragStart:w,onBlockDragStart:y,onDragOver:i,onDragLeave:u,onDrop:n,onResizeStart:$}}function He(a){return`hsla(${a}, 65%, 45%, 0.85)`}function Oe(a){return`hsla(${a}, 65%, 55%, 1)`}const Ie=["draggable"],Ae={class:"px-1.5 py-1 h-full flex flex-col text-white overflow-hidden"},Ne={class:"text-xs font-semibold leading-tight truncate"},Ye={key:0,class:"text-xs opacity-75 truncate"},We={key:1,class:"text-xs opacity-75 mt-auto"},Ue=A({__name:"CalendarBlock",props:{block:{},lane:{},totalLanes:{},top:{},height:{},resizeEnd:{}},emits:["resizeStart","click","blockDragStart"],setup(a,{emit:t}){const o=a,m=t,h=E(()=>o.resizeEnd?new Date(o.resizeEnd):new Date(o.block.end_at)),d=E(()=>{if(!o.resizeEnd)return o.height;const n=(h.value.getTime()-new Date(o.block.start_at).getTime())/6e4;return Math.max(n*(40/30),20)}),w=E(()=>{const u=h.value.getTime()-new Date(o.block.start_at).getTime();return W(u/36e5)}),y=E(()=>{const u=`calc(${100/o.totalLanes}% - 2px)`,n=`calc(${o.lane/o.totalLanes*100}% + 1px)`;return{top:`${o.top}px`,height:`${d.value}px`,width:u,left:n,backgroundColor:He(o.block.color_hue),borderColor:Oe(o.block.color_hue)}}),i=E(()=>d.value<40);return(u,n)=>(f(),k("div",{class:I(["absolute rounded overflow-hidden cursor-pointer select-none group",{"border-2":a.block.kind==="session","border-2 border-dashed opacity-80":a.block.kind==="planned","border-2 calendar-block--manual":a.block.kind==="manual"}]),draggable:a.block.kind==="planned"&&!!a.block.task_id,style:j(y.value),onClick:n[1]||(n[1]=r=>m("click",a.block)),onDragstart:n[2]||(n[2]=r=>a.block.kind==="planned"&&a.block.task_id?m("blockDragStart",a.block,r):void 0)},[l("div",Ae,[l("p",Ne,D(a.block.kind==="planned"&&a.block.title?a.block.title:a.block.display_name),1),!i.value&&a.block.job_number?(f(),k("p",Ye,D(a.block.job_number),1)):M("",!0),i.value?M("",!0):(f(),k("p",We,D(w.value),1))]),l("div",{class:"absolute bottom-0 left-0 right-0 h-2 cursor-s-resize opacity-0 group-hover:opacity-100 flex items-center justify-center",onMousedown:n[0]||(n[0]=fe(r=>m("resizeStart",r),["stop"]))},[...n[3]||(n[3]=[l("div",{class:"w-8 h-0.5 bg-white/60 rounded"},null,-1)])],32)],46,Ie))}}),Ge=Te(Ue,[["__scopeId","data-v-7d0575a8"]]),qe={class:"flex overflow-auto h-full"},Ke={class:"flex flex-1 gap-px min-w-0"},Xe=["onDragover","onDrop"],Je={key:1,class:"absolute inset-0 bg-primary/10 pointer-events-none z-0"},z=7,Q=19,H=40,Qe=A({__name:"CalendarGrid",emits:["blockClick"],setup(a,{emit:t}){const o=Array.from({length:Q-z+1},(b,$)=>z+$),m=N(),h=me(),d=t,w=E(()=>m.view==="week"?m.weekDays:[m.currentDate]),y=S(new Date);function i(b){const $=m.getBlocksForDay(b);return Be($)}function u(b){return Ee(new Date(b.start_at),z)}function n(b){return ze(new Date(b.start_at),new Date(b.end_at))}function r(b){var $;return(($=h.resizingBlock.value)==null?void 0:$.id)===b.id}function _(b){return b===12?"12 PM":b>12?`${b-12} PM`:`${b} AM`}return(b,$)=>(f(),k("div",qe,[l("div",{class:"w-12 shrink-0 relative",style:j({height:`${(Q-z+1)*H*2}px`})},[(f(!0),k(L,null,V(p(o),v=>(f(),k("div",{key:v,class:"absolute right-2 text-xs text-muted-foreground",style:j({top:`${(v-z)*H*2-6}px`})},D(_(v)),5))),128))],4),l("div",Ke,[(f(!0),k(L,null,V(w.value,v=>(f(),k("div",{key:p(S)(v),class:I(["flex-1 relative border-l border-border",{"bg-primary/5":p(S)(v)===p(y)}]),style:j({height:`${(Q-z)*H*2}px`}),onDragover:s=>p(h).onDragOver(v,s),onDragleave:$[1]||($[1]=s=>p(h).onDragLeave()),onDrop:s=>p(h).onDrop(v,s)},[p(m).view==="week"?(f(),k("div",{key:0,class:I(["sticky top-0 z-10 text-center py-1 text-xs font-medium border-b border-border bg-background",p(S)(v)===p(y)?"text-primary":"text-muted-foreground"])},[l("div",null,D(p(P)(v,"EEE")),1),l("div",{class:I(["inline-flex h-6 w-6 mx-auto items-center justify-center rounded-full text-sm",p(S)(v)===p(y)?"bg-primary text-primary-foreground":""])},D(p(P)(v,"d")),3)],2)):M("",!0),(f(!0),k(L,null,V(p(o),s=>(f(),k("div",{key:s,class:"absolute left-0 right-0 border-t border-border/40",style:j({top:`${(s-z)*H*2}px`})},null,4))),128)),(f(!0),k(L,null,V(p(o).slice(0,-1),s=>(f(),k("div",{key:`half-${s}`,class:"absolute left-0 right-0 border-t border-border/20",style:j({top:`${(s-z)*H*2+H}px`})},null,4))),128)),p(h).dragOverDay.value===p(S)(v)?(f(),k("div",Je)):M("",!0),(f(!0),k(L,null,V(i(v),({block:s,lane:c,totalLanes:e})=>(f(),ce(Ge,{key:s.id,block:s,lane:c,"total-lanes":e,top:u(s),height:n(s),"resize-end":r(s)?p(h).resizePreviewEnd.value:null,onClick:x=>d("blockClick",s),onResizeStart:x=>p(h).onResizeStart(s,x),onBlockDragStart:$[0]||($[0]=(x,g)=>p(h).onBlockDragStart(x,g))},null,8,["block","lane","total-lanes","top","height","resize-end","onClick","onResizeStart"]))),128))],46,Xe))),128))])]))}}),Ze={class:"flex flex-col h-full bg-card border-l border-border"},et={class:"p-3 border-b border-border flex items-center justify-between shrink-0"},tt={class:"flex-1 overflow-y-auto p-2 space-y-1.5"},nt={key:0,class:"text-xs text-muted-foreground p-2"},at={key:1,class:"text-xs text-muted-foreground p-2 text-center"},ot=["onDragstart"],st={class:"flex items-start gap-2"},rt={class:"flex-1 min-w-0"},lt={class:"text-xs font-medium text-foreground leading-tight truncate"},it={class:"flex items-center gap-1.5 mt-1 flex-wrap"},ut={key:0,class:"text-xs text-muted-foreground"},dt={key:0,class:"p-3 border-t border-border shrink-0"},ct={class:"space-y-1"},ft={class:"text-muted-foreground truncate max-w-[100px]"},vt={class:"text-foreground"},mt=A({__name:"PlannerSidebar",emits:["createTask"],setup(a,{emit:t}){const o=Z(),m=N(),h=me(),d=t,w=E(()=>S(m.currentDate));ve(()=>{o.fetchForDate(w.value)});const y=n=>({todo:"outline",doing:"default",testing:"warning",done:"success",cancelled:"secondary"})[n],i=n=>n>=4?"bg-red-500":n===3?"bg-amber-500":"bg-emerald-500",u=E(()=>{const n={};for(const r of o.tasks){const _=r.project_id??"_none";n[_]||(n[_]={name:r.project_id?_:"No Project",planned:0,actual:0}),n[_].planned+=r.estimate_hours??0,n[_].actual+=r.actual_hours??0}return Object.values(n)});return(n,r)=>(f(),k("div",Ze,[l("div",et,[r[2]||(r[2]=l("h3",{class:"text-sm font-semibold text-foreground"},"Planner",-1)),C(U,{size:"sm",variant:"ghost",onClick:r[0]||(r[0]=_=>d("createTask"))},{default:O(()=>[...r[1]||(r[1]=[l("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])]),_:1})]),l("div",tt,[p(o).loading?(f(),k("div",nt,"Loading...")):p(o).tasks.length===0?(f(),k("div",at," No tasks for today ")):M("",!0),(f(!0),k(L,null,V(p(o).tasks,_=>(f(),k("div",{key:_.id,class:"rounded-md border border-border bg-background p-2 cursor-grab active:cursor-grabbing hover:border-primary/50 transition-colors",draggable:"true",onDragstart:b=>p(h).onDragStart(_,b)},[l("div",st,[l("div",{class:I(["h-2 w-2 rounded-full mt-1.5 shrink-0",i(_.priority)])},null,2),l("div",rt,[l("p",lt,D(_.title),1),l("div",it,[C(Se,{variant:y(_.status),class:"text-xs py-0"},{default:O(()=>[de(D(_.status),1)]),_:2},1032,["variant"]),_.estimate_hours?(f(),k("span",ut,D(p(W)(_.estimate_hours)),1)):M("",!0)])])])],40,ot))),128))]),u.value.length?(f(),k("div",dt,[r[3]||(r[3]=l("p",{class:"text-xs font-medium text-muted-foreground mb-2"},"Plan vs Actual",-1)),l("div",ct,[(f(!0),k(L,null,V(u.value,_=>(f(),k("div",{key:_.name,class:"flex items-center justify-between text-xs"},[l("span",ft,D(_.name),1),l("span",vt,D(p(W)(_.planned))+" / "+D(p(W)(_.actual)),1)]))),128))])])):M("",!0)]))}}),gt={class:"h-full flex flex-col"},kt={class:"p-4 border-b border-border flex items-center gap-3 flex-wrap"},pt={class:"flex items-center gap-2 ml-auto"},_t={class:"flex-1 flex overflow-hidden"},bt={class:"flex-1 overflow-auto"},xt={key:0,class:"w-56 shrink-0 overflow-hidden"},ht={class:"bg-card border border-border rounded-lg shadow-xl p-4 w-72"},wt={class:"flex items-start justify-between gap-2 mb-3"},yt={class:"font-semibold text-sm text-foreground"},Dt={key:0,class:"text-xs text-muted-foreground"},$t={class:"space-y-1 text-xs text-muted-foreground"},Tt={key:0,class:"mt-2 flex flex-wrap gap-1"},St={key:1,class:"mt-3 pt-3 border-t border-border flex items-center gap-2"},Ct=["disabled"],Mt={key:2,class:"mt-3 pt-3 border-t border-border text-xs text-muted-foreground"},qt=A({__name:"CalendarView",setup(a){const t=N(),o=Z(),m=we(),h=xe(),d=T(!0),w=T(!1),y=T(null),i=T(null),u=T(!1),n=T(!1),r=T(null);ve(async()=>{const c=h.query.date;c&&(t.currentDate=new Date(c+"T12:00:00"),t.setView("day")),await t.fetchCurrentView()});function _(c){if(c.project_id&&c.kind==="session"){const e=c.start_at.substring(0,10);m.push({name:"project-detail",params:{id:c.project_id,date:e}})}else i.value=c}async function b(c){try{y.value?(await o.update(y.value.id,c),R.success("Task updated")):(await o.create(c),R.success("Task created")),w.value=!1,y.value=null,o.fetchForDate(S(t.currentDate))}catch{R.error("Failed to save task")}}async function $(c){if(c.task_id)try{const e=await he(()=>import("./tasks-PDTqLr3E.js").then(x=>x.t),__vite__mapDeps([0,1,2])).then(x=>x.tasksApi.get(c.task_id));y.value=e.data,i.value=null,w.value=!0}catch{R.error("Failed to load task")}}function v(c){r.value=c,n.value=!0}async function s(){const c=r.value;if(c){u.value=!0;try{await o.deleteBlock(c.id),t.removeBlock(c.id),i.value=null,R.success("Block deleted")}catch{R.error("Failed to delete block")}finally{u.value=!1,r.value=null}}}return(c,e)=>{var x;return f(),k("div",gt,[l("div",kt,[C(Fe),l("div",pt,[l("button",{class:"text-xs text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",onClick:e[0]||(e[0]=g=>d.value=!d.value)},D(d.value?"Hide Planner":"Show Planner"),1)])]),l("div",_t,[l("div",bt,[C(Qe,{onBlockClick:_})]),d.value?(f(),k("div",xt,[C(mt,{onCreateTask:e[1]||(e[1]=g=>w.value=!0)})])):M("",!0)]),i.value?(f(),k("div",{key:0,class:"fixed inset-0 z-40 flex items-center justify-center p-4",onClick:e[5]||(e[5]=fe(g=>i.value=null,["self"]))},[l("div",ht,[l("div",wt,[l("div",null,[l("p",yt,D(i.value.display_name),1),i.value.job_number?(f(),k("p",Dt,D(i.value.job_number),1)):M("",!0)]),l("button",{class:"text-muted-foreground hover:text-foreground",onClick:e[2]||(e[2]=g=>i.value=null)},[...e[8]||(e[8]=[l("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),l("div",$t,[l("p",null,"Start: "+D(new Date(i.value.start_at).toLocaleString()),1),l("p",null,"End: "+D(new Date(i.value.end_at).toLocaleString()),1),l("p",null,"Type: "+D(i.value.kind),1)]),i.value.tags.length?(f(),k("div",Tt,[(f(!0),k(L,null,V(i.value.tags,g=>(f(),k("span",{key:g.id,class:"px-1.5 py-0.5 rounded text-xs",style:j({background:`${g.color_hex}22`,color:g.color_hex})},D(g.name),5))),128))])):M("",!0),i.value.kind==="planned"?(f(),k("div",St,[l("button",{class:"flex-1 text-xs px-2 py-1.5 rounded bg-muted hover:bg-muted/80 text-foreground transition-colors",onClick:e[3]||(e[3]=g=>$(i.value))},"Edit task"),l("button",{class:"flex-1 text-xs px-2 py-1.5 rounded bg-destructive/10 hover:bg-destructive/20 text-destructive transition-colors",disabled:u.value,onClick:e[4]||(e[4]=g=>v(i.value))},"Delete block",8,Ct)])):(f(),k("p",Mt,D(i.value.kind==="session"?"Session from Claude Code — read-only":"Read-only entry"),1))])])):M("",!0),C(Ce,{open:w.value,task:y.value,"default-date":p(S)(p(t).currentDate),onClose:e[6]||(e[6]=g=>{w.value=!1,y.value=null}),onSave:b},null,8,["open","task","default-date"]),C(Me,{open:n.value,"onUpdate:open":e[7]||(e[7]=g=>n.value=g),title:"Delete block",description:`Delete '${(x=r.value)==null?void 0:x.display_name}'? This action cannot be undone.`,"confirm-label":"Delete",variant:"destructive",onConfirm:s},null,8,["open","description"])])}}});export{qt as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/tasks-Dt_weT6j.js","assets/index-Dj4QxrF8.js","assets/index-BxXZv7ay.css"])))=>i.map(i=>d[i]); +import{B as be,s as T,j as E,d as A,o as f,c as k,a as l,e as C,w as O,h as p,q as de,t as D,i as M,k as ce,z as j,n as I,C as fe,F as L,r as V,A as ve,g as xe,_ as he,K as R,f as we}from"./index-Dj4QxrF8.js";import{d as ye}from"./dashboard-9KozuccB.js";import{i as S,f as W}from"./utils-7WVCegLb.js";import{_ as U}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_ as le}from"./SegmentedControl.vue_vue_type_script_setup_true_lang-t9SJyic6.js";import{C as De,a as $e,f as P}from"./format-DscROiV-.js";import{u as Z}from"./tasks-Dt_weT6j.js";import{_ as Te}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as Se}from"./Badge.vue_vue_type_script_setup_true_lang-DAgGdGY2.js";import{_ as Ce}from"./TaskForm.vue_vue_type_script_setup_true_lang-cQ4nGVcO.js";import{_ as Me}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js";import"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";import"./createLucideIcon-CglWgwD8.js";import"./Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js";import"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import"./Textarea.vue_vue_type_script_setup_true_lang-BYTYmReP.js";import"./devops-CgM36Koe.js";import"./projects-Bt6sxsgH.js";const G=40/30;function Be(a){if(a.length===0)return[];const t=[...a].sort((d,w)=>new Date(d.start_at).getTime()-new Date(w.start_at).getTime()),o=[],m=[];for(const d of t){const w=new Date(d.start_at).getTime(),y=new Date(d.end_at).getTime();let i=-1;for(let u=0;u{const y=new Date(d.start_at).getTime(),i=new Date(d.end_at).getTime();let u=w;for(const n of m){const r=new Date(n.block.start_at).getTime(),_=new Date(n.block.end_at).getTime();ry&&n.lane>u&&(u=n.lane)}return{block:d,lane:w,totalLanes:u+1}})}function Ee(a,t=7){return((a.getHours()-t)*60+a.getMinutes())*G}function ze(a,t){const o=(t.getTime()-a.getTime())/6e4;return Math.max(o*G,20)}function ie(a,t=7){const o=a.getDay(),m=new Date(a);return m.setDate(a.getDate()-(o+6)%7),m.setHours(0,0,0,0),Array.from({length:t},(h,d)=>{const w=new Date(m);return w.setDate(m.getDate()+d),w})}function ue(a,t=15){return Math.round(a/t)*t}const N=be("calendar",()=>{const a=T([]),t=T(new Date),o=T("week"),m=T(7),h=T(!1),d=T(null),w=E(()=>ie(t.value,m.value));async function y(e,x,g){h.value=!0,d.value=null;try{const B=await ye.calendar({from:e,to:x,view:g});a.value=B.data}catch(B){const Y=B;d.value=Y.message??"Failed to fetch calendar"}finally{h.value=!1}}function i(e){m.value=e}async function u(){if(o.value==="week"){const e=ie(t.value,m.value),x=S(e[0]),g=S(e[m.value-1]);await y(x,g,"week")}else{const e=S(t.value);await y(e,e,"day")}}function n(){const e=new Date(t.value);o.value==="week"?e.setDate(e.getDate()-7):e.setDate(e.getDate()-1),t.value=e}function r(){const e=new Date(t.value);o.value==="week"?e.setDate(e.getDate()+7):e.setDate(e.getDate()+1),t.value=e}function _(){t.value=new Date}function b(e){o.value=e}function $(e){a.value.push(e)}function v(e){const x=a.value.findIndex(g=>g.id===e.id);x!==-1&&(a.value[x]=e)}function s(e){a.value=a.value.filter(x=>x.id!==e)}function c(e){const x=S(e);return a.value.filter(g=>S(new Date(g.start_at))===x)}return{blocks:a,currentDate:t,view:o,weekLength:m,loading:h,error:d,weekDays:w,fetch:y,fetchCurrentView:u,navigatePrev:n,navigateNext:r,goToToday:_,setView:b,setWeekLength:i,addBlock:$,updateBlock:v,removeBlock:s,getBlocksForDay:c}}),Le={class:"flex items-center gap-2 flex-wrap"},Ve={class:"flex items-center gap-1"},je={class:"text-sm font-medium text-foreground flex-1 min-w-0 truncate"},Pe={key:0,class:"text-xs text-muted-foreground"},Fe=A({__name:"CalendarToolbar",setup(a){const t=N(),o=E(()=>{if(t.view==="week"){const u=t.weekDays;if(!u.length)return"";const n=u[0],r=u[u.length-1];return n.getMonth()===r.getMonth()?`${P(n,"MMM d")} – ${P(r,"d, yyyy")}`:`${P(n,"MMM d")} – ${P(r,"MMM d, yyyy")}`}else return P(t.currentDate,"EEEE, MMMM d, yyyy")}),m=[{value:"day",label:"Day"},{value:"week",label:"Week"}],h=[{value:"5",label:"5d"},{value:"7",label:"7d"}],d=E({get:()=>t.view,set:async u=>{t.setView(u),await t.fetchCurrentView()}}),w=E({get:()=>String(t.weekLength),set:async u=>{t.setWeekLength(Number(u)),await t.fetchCurrentView()}});async function y(u){u==="prev"?t.navigatePrev():t.navigateNext(),await t.fetchCurrentView()}async function i(){t.goToToday(),await t.fetchCurrentView()}return(u,n)=>(f(),k("div",Le,[l("div",Ve,[C(U,{variant:"ghost",size:"icon","aria-label":"Previous",onClick:n[0]||(n[0]=r=>y("prev"))},{default:O(()=>[C(p(De),{class:"h-4 w-4"})]),_:1}),C(U,{variant:"outline",size:"sm",onClick:i},{default:O(()=>[...n[4]||(n[4]=[de("Today",-1)])]),_:1}),C(U,{variant:"ghost",size:"icon","aria-label":"Next",onClick:n[1]||(n[1]=r=>y("next"))},{default:O(()=>[C(p($e),{class:"h-4 w-4"})]),_:1})]),l("span",je,D(o.value),1),p(t).loading?(f(),k("div",Pe,"Loading...")):M("",!0),C(le,{modelValue:d.value,"onUpdate:modelValue":n[2]||(n[2]=r=>d.value=r),options:m,"aria-label":"Calendar view"},null,8,["modelValue"]),p(t).view==="week"?(f(),ce(le,{key:1,modelValue:w.value,"onUpdate:modelValue":n[3]||(n[3]=r=>w.value=r),options:h,"aria-label":"Week length"},null,8,["modelValue"])):M("",!0)]))}}),Re=7;function me(){const a=Z(),t=N(),o=T(null),m=T(null),h=T(null),d=T(null);function w(v,s){var c,e;o.value=v.id,(c=s.dataTransfer)==null||c.setData("task_id",v.id),(e=s.dataTransfer)==null||e.setData("estimate_hours",String(v.estimate_hours??1))}function y(v,s){var e,x,g,B;const c=new Date(v.end_at).getTime()-new Date(v.start_at).getTime();(e=s.dataTransfer)==null||e.setData("block_id",v.id),(x=s.dataTransfer)==null||x.setData("block_duration_ms",String(c)),(g=s.dataTransfer)==null||g.setData("task_id",v.task_id??""),(B=s.dataTransfer)==null||B.setData("estimate_hours",String(c/36e5))}function i(v,s){s.preventDefault(),m.value=S(v)}function u(){m.value=null}async function n(v,s){var ne,ae,oe,se;s.preventDefault(),m.value=null,o.value=null;const c=(ne=s.dataTransfer)==null?void 0:ne.getData("block_id"),e=(ae=s.dataTransfer)==null?void 0:ae.getData("task_id"),x=parseFloat(((oe=s.dataTransfer)==null?void 0:oe.getData("estimate_hours"))??"1")||1,g=parseFloat(((se=s.dataTransfer)==null?void 0:se.getData("block_duration_ms"))??"0"),Y=s.currentTarget.getBoundingClientRect(),q=s.clientY-Y.top,K=ue(q/G,15),ge=Math.max(0,Math.min(K,12*60)),F=new Date(v);F.setHours(Re,0,0,0),F.setMinutes(F.getMinutes()+ge);const X=F.toISOString();if(c&&g>0){const pe=new Date(F.getTime()+g).toISOString();try{await a.updateBlock(c,{start_at:X,end_at:pe}),await t.fetchCurrentView()}catch(_e){console.error("Failed to move block:",_e)}return}if(!e)return;const J=new Date(F);J.setMinutes(J.getMinutes()+Math.round(x*60));const ee=J.toISOString(),te=`temp_${Date.now()}`,ke={kind:"planned",id:te,project_id:null,job_number:"",display_name:"Loading...",start_at:X,end_at:ee,title:"",color_hue:260,tags:[],task_id:e,session_id:null,manual_entry_id:null};t.addBlock(ke);try{await a.createBlock(e,{start_at:X,end_at:ee}),await t.fetchCurrentView()}catch(re){t.removeBlock(te),console.error("Failed to create task block:",re)}}let r=0,_="",b=null;function $(v,s){s.preventDefault(),s.stopPropagation(),h.value=v,b=v,r=s.clientY,_=v.end_at,d.value=v.end_at;const c=x=>{if(!b)return;const g=x.clientY-r,B=ue(g/G,15),q=new Date(_).getTime()+B*6e4,K=new Date(b.start_at).getTime()+15*6e4;d.value=new Date(Math.max(q,K)).toISOString()},e=async()=>{if(document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",e),!b||!d.value){h.value=null;return}const x=b.id,g=d.value;if(g===_){h.value=null,d.value=null;return}try{b.task_id&&await a.updateBlock(x,{start_at:b.start_at,end_at:g}),t.updateBlock({...b,end_at:g})}catch(B){console.error("Failed to resize block:",B),t.updateBlock({...b,end_at:_})}h.value=null,d.value=null,b=null};document.addEventListener("mousemove",c),document.addEventListener("mouseup",e)}return{draggingTaskId:o,dragOverDay:m,resizingBlock:h,resizePreviewEnd:d,onDragStart:w,onBlockDragStart:y,onDragOver:i,onDragLeave:u,onDrop:n,onResizeStart:$}}function He(a){return`hsla(${a}, 65%, 45%, 0.85)`}function Oe(a){return`hsla(${a}, 65%, 55%, 1)`}const Ie=["draggable"],Ae={class:"px-1.5 py-1 h-full flex flex-col text-white overflow-hidden"},Ne={class:"text-xs font-semibold leading-tight truncate"},Ye={key:0,class:"text-xs opacity-75 truncate"},We={key:1,class:"text-xs opacity-75 mt-auto"},Ue=A({__name:"CalendarBlock",props:{block:{},lane:{},totalLanes:{},top:{},height:{},resizeEnd:{}},emits:["resizeStart","click","blockDragStart"],setup(a,{emit:t}){const o=a,m=t,h=E(()=>o.resizeEnd?new Date(o.resizeEnd):new Date(o.block.end_at)),d=E(()=>{if(!o.resizeEnd)return o.height;const n=(h.value.getTime()-new Date(o.block.start_at).getTime())/6e4;return Math.max(n*(40/30),20)}),w=E(()=>{const u=h.value.getTime()-new Date(o.block.start_at).getTime();return W(u/36e5)}),y=E(()=>{const u=`calc(${100/o.totalLanes}% - 2px)`,n=`calc(${o.lane/o.totalLanes*100}% + 1px)`;return{top:`${o.top}px`,height:`${d.value}px`,width:u,left:n,backgroundColor:He(o.block.color_hue),borderColor:Oe(o.block.color_hue)}}),i=E(()=>d.value<40);return(u,n)=>(f(),k("div",{class:I(["absolute rounded overflow-hidden cursor-pointer select-none group",{"border-2":a.block.kind==="session","border-2 border-dashed opacity-80":a.block.kind==="planned","border-2 calendar-block--manual":a.block.kind==="manual"}]),draggable:a.block.kind==="planned"&&!!a.block.task_id,style:j(y.value),onClick:n[1]||(n[1]=r=>m("click",a.block)),onDragstart:n[2]||(n[2]=r=>a.block.kind==="planned"&&a.block.task_id?m("blockDragStart",a.block,r):void 0)},[l("div",Ae,[l("p",Ne,D(a.block.kind==="planned"&&a.block.title?a.block.title:a.block.display_name),1),!i.value&&a.block.job_number?(f(),k("p",Ye,D(a.block.job_number),1)):M("",!0),i.value?M("",!0):(f(),k("p",We,D(w.value),1))]),l("div",{class:"absolute bottom-0 left-0 right-0 h-2 cursor-s-resize opacity-0 group-hover:opacity-100 flex items-center justify-center",onMousedown:n[0]||(n[0]=fe(r=>m("resizeStart",r),["stop"]))},[...n[3]||(n[3]=[l("div",{class:"w-8 h-0.5 bg-white/60 rounded"},null,-1)])],32)],46,Ie))}}),Ge=Te(Ue,[["__scopeId","data-v-7d0575a8"]]),qe={class:"flex overflow-auto h-full"},Ke={class:"flex flex-1 gap-px min-w-0"},Xe=["onDragover","onDrop"],Je={key:1,class:"absolute inset-0 bg-primary/10 pointer-events-none z-0"},z=7,Q=19,H=40,Qe=A({__name:"CalendarGrid",emits:["blockClick"],setup(a,{emit:t}){const o=Array.from({length:Q-z+1},(b,$)=>z+$),m=N(),h=me(),d=t,w=E(()=>m.view==="week"?m.weekDays:[m.currentDate]),y=S(new Date);function i(b){const $=m.getBlocksForDay(b);return Be($)}function u(b){return Ee(new Date(b.start_at),z)}function n(b){return ze(new Date(b.start_at),new Date(b.end_at))}function r(b){var $;return(($=h.resizingBlock.value)==null?void 0:$.id)===b.id}function _(b){return b===12?"12 PM":b>12?`${b-12} PM`:`${b} AM`}return(b,$)=>(f(),k("div",qe,[l("div",{class:"w-12 shrink-0 relative",style:j({height:`${(Q-z+1)*H*2}px`})},[(f(!0),k(L,null,V(p(o),v=>(f(),k("div",{key:v,class:"absolute right-2 text-xs text-muted-foreground",style:j({top:`${(v-z)*H*2-6}px`})},D(_(v)),5))),128))],4),l("div",Ke,[(f(!0),k(L,null,V(w.value,v=>(f(),k("div",{key:p(S)(v),class:I(["flex-1 relative border-l border-border",{"bg-primary/5":p(S)(v)===p(y)}]),style:j({height:`${(Q-z)*H*2}px`}),onDragover:s=>p(h).onDragOver(v,s),onDragleave:$[1]||($[1]=s=>p(h).onDragLeave()),onDrop:s=>p(h).onDrop(v,s)},[p(m).view==="week"?(f(),k("div",{key:0,class:I(["sticky top-0 z-10 text-center py-1 text-xs font-medium border-b border-border bg-background",p(S)(v)===p(y)?"text-primary":"text-muted-foreground"])},[l("div",null,D(p(P)(v,"EEE")),1),l("div",{class:I(["inline-flex h-6 w-6 mx-auto items-center justify-center rounded-full text-sm",p(S)(v)===p(y)?"bg-primary text-primary-foreground":""])},D(p(P)(v,"d")),3)],2)):M("",!0),(f(!0),k(L,null,V(p(o),s=>(f(),k("div",{key:s,class:"absolute left-0 right-0 border-t border-border/40",style:j({top:`${(s-z)*H*2}px`})},null,4))),128)),(f(!0),k(L,null,V(p(o).slice(0,-1),s=>(f(),k("div",{key:`half-${s}`,class:"absolute left-0 right-0 border-t border-border/20",style:j({top:`${(s-z)*H*2+H}px`})},null,4))),128)),p(h).dragOverDay.value===p(S)(v)?(f(),k("div",Je)):M("",!0),(f(!0),k(L,null,V(i(v),({block:s,lane:c,totalLanes:e})=>(f(),ce(Ge,{key:s.id,block:s,lane:c,"total-lanes":e,top:u(s),height:n(s),"resize-end":r(s)?p(h).resizePreviewEnd.value:null,onClick:x=>d("blockClick",s),onResizeStart:x=>p(h).onResizeStart(s,x),onBlockDragStart:$[0]||($[0]=(x,g)=>p(h).onBlockDragStart(x,g))},null,8,["block","lane","total-lanes","top","height","resize-end","onClick","onResizeStart"]))),128))],46,Xe))),128))])]))}}),Ze={class:"flex flex-col h-full bg-card border-l border-border"},et={class:"p-3 border-b border-border flex items-center justify-between shrink-0"},tt={class:"flex-1 overflow-y-auto p-2 space-y-1.5"},nt={key:0,class:"text-xs text-muted-foreground p-2"},at={key:1,class:"text-xs text-muted-foreground p-2 text-center"},ot=["onDragstart"],st={class:"flex items-start gap-2"},rt={class:"flex-1 min-w-0"},lt={class:"text-xs font-medium text-foreground leading-tight truncate"},it={class:"flex items-center gap-1.5 mt-1 flex-wrap"},ut={key:0,class:"text-xs text-muted-foreground"},dt={key:0,class:"p-3 border-t border-border shrink-0"},ct={class:"space-y-1"},ft={class:"text-muted-foreground truncate max-w-[100px]"},vt={class:"text-foreground"},mt=A({__name:"PlannerSidebar",emits:["createTask"],setup(a,{emit:t}){const o=Z(),m=N(),h=me(),d=t,w=E(()=>S(m.currentDate));ve(()=>{o.fetchForDate(w.value)});const y=n=>({todo:"outline",doing:"default",testing:"warning",done:"success",cancelled:"secondary"})[n],i=n=>n>=4?"bg-red-500":n===3?"bg-amber-500":"bg-emerald-500",u=E(()=>{const n={};for(const r of o.tasks){const _=r.project_id??"_none";n[_]||(n[_]={name:r.project_id?_:"No Project",planned:0,actual:0}),n[_].planned+=r.estimate_hours??0,n[_].actual+=r.actual_hours??0}return Object.values(n)});return(n,r)=>(f(),k("div",Ze,[l("div",et,[r[2]||(r[2]=l("h3",{class:"text-sm font-semibold text-foreground"},"Planner",-1)),C(U,{size:"sm",variant:"ghost",onClick:r[0]||(r[0]=_=>d("createTask"))},{default:O(()=>[...r[1]||(r[1]=[l("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1)])]),_:1})]),l("div",tt,[p(o).loading?(f(),k("div",nt,"Loading...")):p(o).tasks.length===0?(f(),k("div",at," No tasks for today ")):M("",!0),(f(!0),k(L,null,V(p(o).tasks,_=>(f(),k("div",{key:_.id,class:"rounded-md border border-border bg-background p-2 cursor-grab active:cursor-grabbing hover:border-primary/50 transition-colors",draggable:"true",onDragstart:b=>p(h).onDragStart(_,b)},[l("div",st,[l("div",{class:I(["h-2 w-2 rounded-full mt-1.5 shrink-0",i(_.priority)])},null,2),l("div",rt,[l("p",lt,D(_.title),1),l("div",it,[C(Se,{variant:y(_.status),class:"text-xs py-0"},{default:O(()=>[de(D(_.status),1)]),_:2},1032,["variant"]),_.estimate_hours?(f(),k("span",ut,D(p(W)(_.estimate_hours)),1)):M("",!0)])])])],40,ot))),128))]),u.value.length?(f(),k("div",dt,[r[3]||(r[3]=l("p",{class:"text-xs font-medium text-muted-foreground mb-2"},"Plan vs Actual",-1)),l("div",ct,[(f(!0),k(L,null,V(u.value,_=>(f(),k("div",{key:_.name,class:"flex items-center justify-between text-xs"},[l("span",ft,D(_.name),1),l("span",vt,D(p(W)(_.planned))+" / "+D(p(W)(_.actual)),1)]))),128))])])):M("",!0)]))}}),gt={class:"h-full flex flex-col"},kt={class:"p-4 border-b border-border flex items-center gap-3 flex-wrap"},pt={class:"flex items-center gap-2 ml-auto"},_t={class:"flex-1 flex overflow-hidden"},bt={class:"flex-1 overflow-auto"},xt={key:0,class:"w-56 shrink-0 overflow-hidden"},ht={class:"bg-card border border-border rounded-lg shadow-xl p-4 w-72"},wt={class:"flex items-start justify-between gap-2 mb-3"},yt={class:"font-semibold text-sm text-foreground"},Dt={key:0,class:"text-xs text-muted-foreground"},$t={class:"space-y-1 text-xs text-muted-foreground"},Tt={key:0,class:"mt-2 flex flex-wrap gap-1"},St={key:1,class:"mt-3 pt-3 border-t border-border flex items-center gap-2"},Ct=["disabled"],Mt={key:2,class:"mt-3 pt-3 border-t border-border text-xs text-muted-foreground"},qt=A({__name:"CalendarView",setup(a){const t=N(),o=Z(),m=we(),h=xe(),d=T(!0),w=T(!1),y=T(null),i=T(null),u=T(!1),n=T(!1),r=T(null);ve(async()=>{const c=h.query.date;c&&(t.currentDate=new Date(c+"T12:00:00"),t.setView("day")),await t.fetchCurrentView()});function _(c){if(c.project_id&&c.kind==="session"){const e=c.start_at.substring(0,10);m.push({name:"project-detail",params:{id:c.project_id,date:e}})}else i.value=c}async function b(c){try{y.value?(await o.update(y.value.id,c),R.success("Task updated")):(await o.create(c),R.success("Task created")),w.value=!1,y.value=null,o.fetchForDate(S(t.currentDate))}catch{R.error("Failed to save task")}}async function $(c){if(c.task_id)try{const e=await he(()=>import("./tasks-Dt_weT6j.js").then(x=>x.t),__vite__mapDeps([0,1,2])).then(x=>x.tasksApi.get(c.task_id));y.value=e.data,i.value=null,w.value=!0}catch{R.error("Failed to load task")}}function v(c){r.value=c,n.value=!0}async function s(){const c=r.value;if(c){u.value=!0;try{await o.deleteBlock(c.id),t.removeBlock(c.id),i.value=null,R.success("Block deleted")}catch{R.error("Failed to delete block")}finally{u.value=!1,r.value=null}}}return(c,e)=>{var x;return f(),k("div",gt,[l("div",kt,[C(Fe),l("div",pt,[l("button",{class:"text-xs text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",onClick:e[0]||(e[0]=g=>d.value=!d.value)},D(d.value?"Hide Planner":"Show Planner"),1)])]),l("div",_t,[l("div",bt,[C(Qe,{onBlockClick:_})]),d.value?(f(),k("div",xt,[C(mt,{onCreateTask:e[1]||(e[1]=g=>w.value=!0)})])):M("",!0)]),i.value?(f(),k("div",{key:0,class:"fixed inset-0 z-40 flex items-center justify-center p-4",onClick:e[5]||(e[5]=fe(g=>i.value=null,["self"]))},[l("div",ht,[l("div",wt,[l("div",null,[l("p",yt,D(i.value.display_name),1),i.value.job_number?(f(),k("p",Dt,D(i.value.job_number),1)):M("",!0)]),l("button",{class:"text-muted-foreground hover:text-foreground",onClick:e[2]||(e[2]=g=>i.value=null)},[...e[8]||(e[8]=[l("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),l("div",$t,[l("p",null,"Start: "+D(new Date(i.value.start_at).toLocaleString()),1),l("p",null,"End: "+D(new Date(i.value.end_at).toLocaleString()),1),l("p",null,"Type: "+D(i.value.kind),1)]),i.value.tags.length?(f(),k("div",Tt,[(f(!0),k(L,null,V(i.value.tags,g=>(f(),k("span",{key:g.id,class:"px-1.5 py-0.5 rounded text-xs",style:j({background:`${g.color_hex}22`,color:g.color_hex})},D(g.name),5))),128))])):M("",!0),i.value.kind==="planned"?(f(),k("div",St,[l("button",{class:"flex-1 text-xs px-2 py-1.5 rounded bg-muted hover:bg-muted/80 text-foreground transition-colors",onClick:e[3]||(e[3]=g=>$(i.value))},"Edit task"),l("button",{class:"flex-1 text-xs px-2 py-1.5 rounded bg-destructive/10 hover:bg-destructive/20 text-destructive transition-colors",disabled:u.value,onClick:e[4]||(e[4]=g=>v(i.value))},"Delete block",8,Ct)])):(f(),k("p",Mt,D(i.value.kind==="session"?"Session from Claude Code — read-only":"Read-only entry"),1))])])):M("",!0),C(Ce,{open:w.value,task:y.value,"default-date":p(S)(p(t).currentDate),onClose:e[6]||(e[6]=g=>{w.value=!1,y.value=null}),onSave:b},null,8,["open","task","default-date"]),C(Me,{open:n.value,"onUpdate:open":e[7]||(e[7]=g=>n.value=g),title:"Delete block",description:`Delete '${(x=r.value)==null?void 0:x.display_name}'? This action cannot be undone.`,"confirm-label":"Delete",variant:"destructive",onConfirm:s},null,8,["open","description"])])}}});export{qt as default}; diff --git a/src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js b/src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js similarity index 86% rename from src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js rename to src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js index 75c9892..7c24d0e 100644 --- a/src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js +++ b/src/static/assets/CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js @@ -1 +1 @@ -import{c as e}from"./utils-7WVCegLb.js";import{d as o,c as n,n as t,h as c,p,o as l}from"./index-rN5A-UTe.js";const _=o({__name:"Card",props:{class:{}},setup(s){const a=s;return(r,d)=>(l(),n("div",{class:t(c(e)("rounded-lg border bg-card text-card-foreground shadow-sm",a.class))},[p(r.$slots,"default")],2))}}),f=o({__name:"CardContent",props:{class:{}},setup(s){const a=s;return(r,d)=>(l(),n("div",{class:t(c(e)("p-6 pt-0",a.class))},[p(r.$slots,"default")],2))}});export{_,f as a}; +import{c as e}from"./utils-7WVCegLb.js";import{d as o,c as n,n as t,h as c,p,o as l}from"./index-Dj4QxrF8.js";const _=o({__name:"Card",props:{class:{}},setup(s){const a=s;return(r,d)=>(l(),n("div",{class:t(c(e)("rounded-lg border bg-card text-card-foreground shadow-sm",a.class))},[p(r.$slots,"default")],2))}}),f=o({__name:"CardContent",props:{class:{}},setup(s){const a=s;return(r,d)=>(l(),n("div",{class:t(c(e)("p-6 pt-0",a.class))},[p(r.$slots,"default")],2))}});export{_,f as a}; diff --git a/src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-CugNHrdd.js b/src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-BMHIwlxU.js similarity index 87% rename from src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-CugNHrdd.js rename to src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-BMHIwlxU.js index 4b57396..7121eb0 100644 --- a/src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-CugNHrdd.js +++ b/src/static/assets/CardTitle.vue_vue_type_script_setup_true_lang-BMHIwlxU.js @@ -1 +1 @@ -import{c as t}from"./utils-7WVCegLb.js";import{d as n,o,c as r,n as c,h as l,p}from"./index-rN5A-UTe.js";const f=n({__name:"CardHeader",props:{class:{}},setup(s){const e=s;return(a,i)=>(o(),r("div",{class:c(l(t)("flex flex-col space-y-1.5 p-6",e.class))},[p(a.$slots,"default")],2))}}),_=n({__name:"CardTitle",props:{class:{}},setup(s){const e=s;return(a,i)=>(o(),r("h3",{class:c(l(t)("text-lg font-semibold leading-none tracking-tight",e.class))},[p(a.$slots,"default")],2))}});export{f as _,_ as a}; +import{c as t}from"./utils-7WVCegLb.js";import{d as n,o,c as r,n as c,h as l,p}from"./index-Dj4QxrF8.js";const f=n({__name:"CardHeader",props:{class:{}},setup(s){const e=s;return(a,i)=>(o(),r("div",{class:c(l(t)("flex flex-col space-y-1.5 p-6",e.class))},[p(a.$slots,"default")],2))}}),_=n({__name:"CardTitle",props:{class:{}},setup(s){const e=s;return(a,i)=>(o(),r("h3",{class:c(l(t)("text-lg font-semibold leading-none tracking-tight",e.class))},[p(a.$slots,"default")],2))}});export{f as _,_ as a}; diff --git a/src/static/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js b/src/static/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js similarity index 92% rename from src/static/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js rename to src/static/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js index 984dbf7..5379f60 100644 --- a/src/static/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js +++ b/src/static/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js @@ -1,4 +1,4 @@ -import{d as b,k,w as a,h as o,X as y,o as u,e as t,Y as g,Z as h,a as i,$ as C,q as s,t as c,a0 as T,c as w,i as V,a1 as B,a2 as L,a3 as N,s as z}from"./index-rN5A-UTe.js";import{_ as m}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_}from"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import{c as A}from"./createLucideIcon-BQqEiwZb.js";/** +import{d as b,k,w as a,h as o,X as y,o as u,e as t,Y as g,Z as h,a as i,$ as C,q as s,t as c,a0 as T,c as w,i as V,a1 as B,a2 as L,a3 as N,s as z}from"./index-Dj4QxrF8.js";import{_ as m}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_}from"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import{c as A}from"./createLucideIcon-CglWgwD8.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/DashboardView-CmARPWJW.js b/src/static/assets/DashboardView-BXyr7l4W.js similarity index 97% rename from src/static/assets/DashboardView-CmARPWJW.js rename to src/static/assets/DashboardView-BXyr7l4W.js index f8aadb5..367ad1c 100644 --- a/src/static/assets/DashboardView-CmARPWJW.js +++ b/src/static/assets/DashboardView-BXyr7l4W.js @@ -1,4 +1,4 @@ -import{d as T,c as a,a as e,F as h,r as w,e as l,w as u,i as B,o,q as k,n as D,t as y,s as b,x as E,y as ee,k as v,h as g,l as K,R,j as C,z as M,f as te,A as oe}from"./index-rN5A-UTe.js";import{d as S}from"./dashboard-DAarnFBr.js";import{_ as V,a as z}from"./CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js";import{_ as A,a as I}from"./CardTitle.vue_vue_type_script_setup_true_lang-CugNHrdd.js";import{_ as se}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{c as P,f as L,i as H}from"./utils-7WVCegLb.js";import{_ as ae}from"./Skeleton.vue_vue_type_script_setup_true_lang-DvqtZljC.js";import{c as U}from"./createLucideIcon-BQqEiwZb.js";import{C as le}from"./calendar-days-OJQzkSiF.js";import{F as re}from"./folder-open-Dm6Er06z.js";import{_ as ne}from"./Tooltip.vue_vue_type_script_setup_true_lang-CcvjvjWJ.js";import{u as de}from"./tasks-PDTqLr3E.js";import{u as ie}from"./devops-DzkXDmpg.js";import"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";const ue={class:"flex flex-wrap items-center gap-3"},ce={class:"flex items-center rounded-lg border border-border overflow-hidden bg-muted/30"},me=["onClick"],ge=["value"],fe=["value"],xe=T({__name:"DateRangeFilter",props:{preset:{},customFrom:{},customTo:{},loading:{type:Boolean}},emits:["update:preset","update:customFrom","update:customTo","apply"],setup(t,{emit:m}){const c=m;return(d,s)=>(o(),a("div",ue,[s[5]||(s[5]=e("h2",{class:"text-base font-semibold text-foreground flex-1 tracking-tight"},"Overview",-1)),e("div",ce,[(o(),a(h,null,w(["today","7d","30d","custom"],r=>e("button",{key:r,class:D(["px-3 py-1.5 text-xs font-medium transition-colors",t.preset===r?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"]),onClick:x=>c("update:preset",r)},y(r==="today"?"Today":r==="7d"?"7 days":r==="30d"?"30 days":"Custom"),11,me)),64))]),t.preset==="custom"?(o(),a(h,{key:0},[e("input",{value:t.customFrom,type:"date",class:"h-8 rounded-lg border border-input bg-muted/30 px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",onInput:s[0]||(s[0]=r=>c("update:customFrom",r.target.value))},null,40,ge),s[4]||(s[4]=e("span",{class:"text-xs text-muted-foreground"},"to",-1)),e("input",{value:t.customTo,type:"date",class:"h-8 rounded-lg border border-input bg-muted/30 px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",onInput:s[1]||(s[1]=r=>c("update:customTo",r.target.value))},null,40,fe),l(se,{size:"sm",loading:t.loading,onClick:s[2]||(s[2]=r=>c("apply"))},{default:u(()=>[...s[3]||(s[3]=[k("Apply",-1)])]),_:1},8,["loading"])],64)):B("",!0)]))}});/** +import{d as T,c as a,a as e,F as h,r as w,e as l,w as u,i as B,o,q as k,n as D,t as y,s as b,x as E,y as ee,k as v,h as g,l as K,R,j as C,z as M,f as te,A as oe}from"./index-Dj4QxrF8.js";import{d as S}from"./dashboard-9KozuccB.js";import{_ as V,a as z}from"./CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js";import{_ as A,a as I}from"./CardTitle.vue_vue_type_script_setup_true_lang-BMHIwlxU.js";import{_ as se}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{c as P,f as L,i as H}from"./utils-7WVCegLb.js";import{_ as ae}from"./Skeleton.vue_vue_type_script_setup_true_lang-DhWXp9By.js";import{c as U}from"./createLucideIcon-CglWgwD8.js";import{C as le}from"./calendar-days-B6LXSX5z.js";import{F as re}from"./folder-open-Cenu-_Fx.js";import{_ as ne}from"./Tooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js";import{u as de}from"./tasks-Dt_weT6j.js";import{u as ie}from"./devops-CgM36Koe.js";import"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";const ue={class:"flex flex-wrap items-center gap-3"},ce={class:"flex items-center rounded-lg border border-border overflow-hidden bg-muted/30"},me=["onClick"],ge=["value"],fe=["value"],xe=T({__name:"DateRangeFilter",props:{preset:{},customFrom:{},customTo:{},loading:{type:Boolean}},emits:["update:preset","update:customFrom","update:customTo","apply"],setup(t,{emit:m}){const c=m;return(d,s)=>(o(),a("div",ue,[s[5]||(s[5]=e("h2",{class:"text-base font-semibold text-foreground flex-1 tracking-tight"},"Overview",-1)),e("div",ce,[(o(),a(h,null,w(["today","7d","30d","custom"],r=>e("button",{key:r,class:D(["px-3 py-1.5 text-xs font-medium transition-colors",t.preset===r?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"]),onClick:x=>c("update:preset",r)},y(r==="today"?"Today":r==="7d"?"7 days":r==="30d"?"30 days":"Custom"),11,me)),64))]),t.preset==="custom"?(o(),a(h,{key:0},[e("input",{value:t.customFrom,type:"date",class:"h-8 rounded-lg border border-input bg-muted/30 px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",onInput:s[0]||(s[0]=r=>c("update:customFrom",r.target.value))},null,40,ge),s[4]||(s[4]=e("span",{class:"text-xs text-muted-foreground"},"to",-1)),e("input",{value:t.customTo,type:"date",class:"h-8 rounded-lg border border-input bg-muted/30 px-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",onInput:s[1]||(s[1]=r=>c("update:customTo",r.target.value))},null,40,fe),l(se,{size:"sm",loading:t.loading,onClick:s[2]||(s[2]=r=>c("apply"))},{default:u(()=>[...s[3]||(s[3]=[k("Apply",-1)])]),_:1},8,["loading"])],64)):B("",!0)]))}});/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/DataTable.vue_vue_type_script_setup_true_lang-CHKsc19V.js b/src/static/assets/DataTable.vue_vue_type_script_setup_true_lang-8gHvRwtL.js similarity index 95% rename from src/static/assets/DataTable.vue_vue_type_script_setup_true_lang-CHKsc19V.js rename to src/static/assets/DataTable.vue_vue_type_script_setup_true_lang-8gHvRwtL.js index 82e39a3..46903f3 100644 --- a/src/static/assets/DataTable.vue_vue_type_script_setup_true_lang-CHKsc19V.js +++ b/src/static/assets/DataTable.vue_vue_type_script_setup_true_lang-8gHvRwtL.js @@ -1 +1 @@ -import{s as h,x as K,d as U,c as o,a,t as S,k as $,w as j,n as p,i as u,F as y,r as k,e as O,J as R,j as L,o as n,q as B,z as q,C as F,p as J}from"./index-rN5A-UTe.js";import{_ as P}from"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import{_ as M}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_ as G}from"./EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js";function H(i,_){const c=h(i.value);let g;return K(i,d=>{clearTimeout(g),g=setTimeout(()=>{c.value=d},_)},{deep:!0}),c}const I={class:"w-full"},Q={key:0,class:"flex items-center gap-2 mb-2"},Y={class:"text-xs text-muted-foreground"},Z={key:0,class:"h-1.5 w-1.5 rounded-full bg-primary"},ee={class:"overflow-x-auto rounded-xl border border-border"},te={class:"w-full table-fixed border-collapse",style:{"min-width":"600px"}},se={class:"bg-muted/30"},ne=["onClick"],re={class:"text-xs font-semibold text-muted-foreground tracking-wide uppercase"},oe=["d"],le=["onMousedown"],ae={key:0},ie=["onClick"],ue={class:"text-sm text-foreground truncate block"},de={key:0},ce=["colspan"],ye=U({__name:"DataTable",props:{columns:{},rows:{},rowKey:{default:"id"},showToolbar:{type:Boolean,default:!0}},emits:["rowClick"],setup(i,{emit:_}){const c=i,g=_,d=h(null),v=h("asc"),f=h({}),w=R({}),b=h(!1);c.columns.forEach(t=>{t.width&&(w[t.key]=t.width)});const V=H(f,250);function D(t){const s=w[t.key]??t.width;return s?`${s}px`:"auto"}function E(t){t.sortable&&(d.value===t.key?v.value=v.value==="asc"?"desc":"asc":(d.value=t.key,v.value="asc"))}function W(t,s,e="auto"){if(t==null&&s==null)return 0;if(t==null)return-1;if(s==null)return 1;if(e==="number")return Number(t)-Number(s);if(e==="date")return new Date(String(t)).getTime()-new Date(String(s)).getTime();if(e==="auto"){const l=Number(t),r=Number(s);if(!isNaN(l)&&!isNaN(r))return l-r}return String(t).localeCompare(String(s))}const T=L(()=>{let t=[...c.rows];for(const[s,e]of Object.entries(V.value))e&&(t=t.filter(l=>String(l[s]??"").toLowerCase().includes(e.toLowerCase())));return t}),C=L(()=>{if(!d.value)return T.value;const t=d.value,s=c.columns.find(e=>e.key===t);return[...T.value].sort((e,l)=>{const r=e[t],z=l[t],x=W(r,z,s==null?void 0:s.type);return v.value==="asc"?x:-x})}),N=L(()=>Object.values(f.value).some(Boolean));let m=null;function X(t,s){if(!t.resizable)return;s.preventDefault(),s.stopPropagation();const e=w[t.key]??t.width??100;m={key:t.key,startX:s.clientX,startW:e};function l(z){if(!m)return;const x=z.clientX-m.startX;w[m.key]=Math.max(t.minWidth??60,m.startW+x)}function r(){m=null,window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",r)}window.addEventListener("mousemove",l),window.addEventListener("mouseup",r)}function A(){f.value={}}return(t,s)=>(n(),o("div",I,[i.showToolbar?(n(),o("div",Q,[a("span",Y,S(C.value.length)+" items",1),s[5]||(s[5]=a("div",{class:"flex-1"},null,-1)),i.columns.some(e=>e.filterable)?(n(),$(M,{key:0,variant:"ghost",size:"sm",class:p(b.value||N.value?"flex items-center gap-1.5 text-primary":"flex items-center gap-1.5"),onClick:s[0]||(s[0]=e=>b.value=!b.value)},{default:j(()=>[s[2]||(s[2]=a("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2a1 1 0 01-.293.707L13 13.414V19a1 1 0 01-.553.894l-4 2A1 1 0 017 21v-7.586L3.293 6.707A1 1 0 013 6V4z"})],-1)),s[3]||(s[3]=B(" Filter ",-1)),N.value?(n(),o("span",Z)):u("",!0)]),_:1},8,["class"])):u("",!0),N.value?(n(),$(M,{key:1,variant:"ghost",size:"sm",onClick:A},{default:j(()=>[...s[4]||(s[4]=[B(" Clear ",-1)])]),_:1})):u("",!0)])):u("",!0),a("div",ee,[a("table",te,[a("colgroup",null,[(n(!0),o(y,null,k(i.columns,e=>(n(),o("col",{key:e.key,style:q({width:D(e)})},null,4))),128))]),a("thead",se,[a("tr",null,[(n(!0),o(y,null,k(i.columns,e=>(n(),o("th",{key:e.key,class:p(["relative px-3 py-2 text-left group select-none",[e.sortable?"cursor-pointer hover:bg-muted/50":""]]),onClick:l=>E(e)},[a("div",{class:p(["flex items-center gap-1",{"justify-center":e.align==="center","justify-end":e.align==="right"}])},[a("span",re,S(e.title),1),e.sortable?(n(),o("svg",{key:0,class:p(["h-3 w-3 shrink-0 transition-opacity",d.value===e.key?"opacity-100 text-primary":"opacity-0 group-hover:opacity-40"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:d.value===e.key&&v.value==="desc"?"M19 9l-7 7-7-7":"M5 15l7-7 7 7"},null,8,oe)],2)):u("",!0)],2),e.resizable?(n(),o("div",{key:0,class:"absolute right-0 top-0 bottom-0 w-1 cursor-col-resize opacity-0 group-hover:opacity-100 hover:opacity-100 hover:bg-primary/30 transition-opacity",onMousedown:F(l=>X(e,l),["stop"])},null,40,le)):u("",!0)],10,ne))),128))]),b.value?(n(),o("tr",ae,[(n(!0),o(y,null,k(i.columns,e=>(n(),o("th",{key:`filter-${e.key}`,class:"px-2 pb-2 pt-0"},[e.filterable?(n(),$(P,{key:0,"model-value":f.value[e.key]??"",type:"text",class:"h-7 text-xs py-1",placeholder:"Filter…","onUpdate:modelValue":l=>{f.value[e.key]=l},onClick:s[1]||(s[1]=F(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])):u("",!0)]))),128))])):u("",!0)]),a("tbody",null,[(n(!0),o(y,null,k(C.value,(e,l)=>(n(),o("tr",{key:String(e[i.rowKey]??l),class:"border-t border-border/50 hover:bg-muted/20 transition-colors cursor-pointer",onClick:r=>g("rowClick",e)},[(n(!0),o(y,null,k(i.columns,r=>(n(),o("td",{key:r.key,class:p(["px-3 py-2",[r.className,r.align==="center"?"text-center":r.align==="right"?"text-right":"text-left"]])},[J(t.$slots,`cell-${r.key}`,{row:e,value:e[r.key]},()=>[a("span",ue,S(e[r.key]??"—"),1)])],2))),128))],8,ie))),128)),C.value.length===0?(n(),o("tr",de,[a("td",{colspan:i.columns.length,class:"py-12"},[O(G,{title:"No items found",description:"Try adjusting your filter.",size:"sm"})],8,ce)])):u("",!0)])])])]))}});export{ye as _}; +import{s as h,x as K,d as U,c as o,a,t as S,k as $,w as j,n as p,i as u,F as y,r as k,e as O,J as R,j as L,o as n,q as B,z as q,C as F,p as J}from"./index-Dj4QxrF8.js";import{_ as P}from"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import{_ as M}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_ as G}from"./EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js";function H(i,_){const c=h(i.value);let g;return K(i,d=>{clearTimeout(g),g=setTimeout(()=>{c.value=d},_)},{deep:!0}),c}const I={class:"w-full"},Q={key:0,class:"flex items-center gap-2 mb-2"},Y={class:"text-xs text-muted-foreground"},Z={key:0,class:"h-1.5 w-1.5 rounded-full bg-primary"},ee={class:"overflow-x-auto rounded-xl border border-border"},te={class:"w-full table-fixed border-collapse",style:{"min-width":"600px"}},se={class:"bg-muted/30"},ne=["onClick"],re={class:"text-xs font-semibold text-muted-foreground tracking-wide uppercase"},oe=["d"],le=["onMousedown"],ae={key:0},ie=["onClick"],ue={class:"text-sm text-foreground truncate block"},de={key:0},ce=["colspan"],ye=U({__name:"DataTable",props:{columns:{},rows:{},rowKey:{default:"id"},showToolbar:{type:Boolean,default:!0}},emits:["rowClick"],setup(i,{emit:_}){const c=i,g=_,d=h(null),v=h("asc"),f=h({}),w=R({}),b=h(!1);c.columns.forEach(t=>{t.width&&(w[t.key]=t.width)});const V=H(f,250);function D(t){const s=w[t.key]??t.width;return s?`${s}px`:"auto"}function E(t){t.sortable&&(d.value===t.key?v.value=v.value==="asc"?"desc":"asc":(d.value=t.key,v.value="asc"))}function W(t,s,e="auto"){if(t==null&&s==null)return 0;if(t==null)return-1;if(s==null)return 1;if(e==="number")return Number(t)-Number(s);if(e==="date")return new Date(String(t)).getTime()-new Date(String(s)).getTime();if(e==="auto"){const l=Number(t),r=Number(s);if(!isNaN(l)&&!isNaN(r))return l-r}return String(t).localeCompare(String(s))}const T=L(()=>{let t=[...c.rows];for(const[s,e]of Object.entries(V.value))e&&(t=t.filter(l=>String(l[s]??"").toLowerCase().includes(e.toLowerCase())));return t}),C=L(()=>{if(!d.value)return T.value;const t=d.value,s=c.columns.find(e=>e.key===t);return[...T.value].sort((e,l)=>{const r=e[t],z=l[t],x=W(r,z,s==null?void 0:s.type);return v.value==="asc"?x:-x})}),N=L(()=>Object.values(f.value).some(Boolean));let m=null;function X(t,s){if(!t.resizable)return;s.preventDefault(),s.stopPropagation();const e=w[t.key]??t.width??100;m={key:t.key,startX:s.clientX,startW:e};function l(z){if(!m)return;const x=z.clientX-m.startX;w[m.key]=Math.max(t.minWidth??60,m.startW+x)}function r(){m=null,window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",r)}window.addEventListener("mousemove",l),window.addEventListener("mouseup",r)}function A(){f.value={}}return(t,s)=>(n(),o("div",I,[i.showToolbar?(n(),o("div",Q,[a("span",Y,S(C.value.length)+" items",1),s[5]||(s[5]=a("div",{class:"flex-1"},null,-1)),i.columns.some(e=>e.filterable)?(n(),$(M,{key:0,variant:"ghost",size:"sm",class:p(b.value||N.value?"flex items-center gap-1.5 text-primary":"flex items-center gap-1.5"),onClick:s[0]||(s[0]=e=>b.value=!b.value)},{default:j(()=>[s[2]||(s[2]=a("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2a1 1 0 01-.293.707L13 13.414V19a1 1 0 01-.553.894l-4 2A1 1 0 017 21v-7.586L3.293 6.707A1 1 0 013 6V4z"})],-1)),s[3]||(s[3]=B(" Filter ",-1)),N.value?(n(),o("span",Z)):u("",!0)]),_:1},8,["class"])):u("",!0),N.value?(n(),$(M,{key:1,variant:"ghost",size:"sm",onClick:A},{default:j(()=>[...s[4]||(s[4]=[B(" Clear ",-1)])]),_:1})):u("",!0)])):u("",!0),a("div",ee,[a("table",te,[a("colgroup",null,[(n(!0),o(y,null,k(i.columns,e=>(n(),o("col",{key:e.key,style:q({width:D(e)})},null,4))),128))]),a("thead",se,[a("tr",null,[(n(!0),o(y,null,k(i.columns,e=>(n(),o("th",{key:e.key,class:p(["relative px-3 py-2 text-left group select-none",[e.sortable?"cursor-pointer hover:bg-muted/50":""]]),onClick:l=>E(e)},[a("div",{class:p(["flex items-center gap-1",{"justify-center":e.align==="center","justify-end":e.align==="right"}])},[a("span",re,S(e.title),1),e.sortable?(n(),o("svg",{key:0,class:p(["h-3 w-3 shrink-0 transition-opacity",d.value===e.key?"opacity-100 text-primary":"opacity-0 group-hover:opacity-40"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:d.value===e.key&&v.value==="desc"?"M19 9l-7 7-7-7":"M5 15l7-7 7 7"},null,8,oe)],2)):u("",!0)],2),e.resizable?(n(),o("div",{key:0,class:"absolute right-0 top-0 bottom-0 w-1 cursor-col-resize opacity-0 group-hover:opacity-100 hover:opacity-100 hover:bg-primary/30 transition-opacity",onMousedown:F(l=>X(e,l),["stop"])},null,40,le)):u("",!0)],10,ne))),128))]),b.value?(n(),o("tr",ae,[(n(!0),o(y,null,k(i.columns,e=>(n(),o("th",{key:`filter-${e.key}`,class:"px-2 pb-2 pt-0"},[e.filterable?(n(),$(P,{key:0,"model-value":f.value[e.key]??"",type:"text",class:"h-7 text-xs py-1",placeholder:"Filter…","onUpdate:modelValue":l=>{f.value[e.key]=l},onClick:s[1]||(s[1]=F(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])):u("",!0)]))),128))])):u("",!0)]),a("tbody",null,[(n(!0),o(y,null,k(C.value,(e,l)=>(n(),o("tr",{key:String(e[i.rowKey]??l),class:"border-t border-border/50 hover:bg-muted/20 transition-colors cursor-pointer",onClick:r=>g("rowClick",e)},[(n(!0),o(y,null,k(i.columns,r=>(n(),o("td",{key:r.key,class:p(["px-3 py-2",[r.className,r.align==="center"?"text-center":r.align==="right"?"text-right":"text-left"]])},[J(t.$slots,`cell-${r.key}`,{row:e,value:e[r.key]},()=>[a("span",ue,S(e[r.key]??"—"),1)])],2))),128))],8,ie))),128)),C.value.length===0?(n(),o("tr",de,[a("td",{colspan:i.columns.length,class:"py-12"},[O(G,{title:"No items found",description:"Try adjusting your filter.",size:"sm"})],8,ce)])):u("",!0)])])])]))}});export{ye as _}; diff --git a/src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-BzwbMDjx.js b/src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-Bv-vOrXl.js similarity index 90% rename from src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-BzwbMDjx.js rename to src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-Bv-vOrXl.js index 4162ecb..35c051f 100644 --- a/src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-BzwbMDjx.js +++ b/src/static/assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-Bv-vOrXl.js @@ -1 +1 @@ -import{u as b}from"./devops-DzkXDmpg.js";import{_ as y}from"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import{_ as k}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_ as j}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js";import{d as z,s as i,o as d,c as p,F,a as o,h as n,q as v,t as u,i as g,e as c,w,k as U,K as m}from"./index-rN5A-UTe.js";const A={class:"space-y-4"},B={key:0,class:"text-xs text-muted-foreground space-y-1"},I={class:"text-foreground"},N={class:"text-foreground"},O={key:0},P={key:1,class:"text-red-400"},S={class:"grid grid-cols-2 gap-3"},T={class:"space-y-1.5"},$={class:"space-y-1.5"},q={class:"space-y-1.5"},E={class:"flex items-center gap-2"},Q=z({__name:"DevopsConnectForm",setup(K){var x,V;const t=b(),r=i(((x=t.integration)==null?void 0:x.organization)??""),l=i(((V=t.integration)==null?void 0:V.project)??""),s=i(""),f=i(!1),_=i(!1);async function C(){if(!r.value||!l.value||!s.value){m.error("All fields are required");return}f.value=!0;try{await t.saveIntegration({organization:r.value,project:l.value,pat:s.value}),s.value="",m.success("Integration saved")}catch{m.error("Failed to save integration")}finally{f.value=!1}}async function D(){try{await t.deleteIntegration(),r.value="",l.value="",s.value="",m.success("Integration deleted")}catch{m.error("Failed to delete integration")}}return(L,e)=>(d(),p(F,null,[o("div",A,[n(t).integration?(d(),p("div",B,[o("p",null,[e[5]||(e[5]=v(" Connected to ",-1)),o("strong",I,u(n(t).integration.organization),1),e[6]||(e[6]=v(" / ",-1)),o("strong",N,u(n(t).integration.project),1)]),n(t).integration.last_synced_at?(d(),p("p",O," Last synced: "+u(new Date(n(t).integration.last_synced_at).toLocaleString()),1)):g("",!0),n(t).integration.last_sync_error?(d(),p("p",P," Error: "+u(n(t).integration.last_sync_error),1)):g("",!0)])):g("",!0),o("div",S,[o("div",T,[e[7]||(e[7]=o("label",{class:"text-sm font-medium text-foreground"},"Organization",-1)),c(y,{modelValue:r.value,"onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),placeholder:"myorg"},null,8,["modelValue"])]),o("div",$,[e[8]||(e[8]=o("label",{class:"text-sm font-medium text-foreground"},"Project",-1)),c(y,{modelValue:l.value,"onUpdate:modelValue":e[1]||(e[1]=a=>l.value=a),placeholder:"myproject"},null,8,["modelValue"])])]),o("div",q,[e[9]||(e[9]=o("label",{class:"text-sm font-medium text-foreground"}," Personal Access Token ",-1)),c(y,{modelValue:s.value,"onUpdate:modelValue":e[2]||(e[2]=a=>s.value=a),type:"password",placeholder:"••••••••",autocomplete:"new-password"},null,8,["modelValue"])]),o("div",E,[c(k,{loading:f.value,onClick:C},{default:w(()=>[v(u(n(t).integration?"Update":"Connect"),1)]),_:1},8,["loading"]),n(t).integration?(d(),U(k,{key:0,variant:"destructive",size:"sm",onClick:e[3]||(e[3]=a=>_.value=!0)},{default:w(()=>[...e[10]||(e[10]=[v(" Disconnect ",-1)])]),_:1})):g("",!0)])]),c(j,{open:_.value,"onUpdate:open":e[4]||(e[4]=a=>_.value=a),title:"Disconnect Azure DevOps",description:"This will remove the ADO integration and all synced work items. This action cannot be undone.","confirm-label":"Disconnect","cancel-label":"Cancel",variant:"destructive",onConfirm:D},null,8,["open"])],64))}});export{Q as _}; +import{u as b}from"./devops-CgM36Koe.js";import{_ as y}from"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import{_ as k}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_ as j}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js";import{d as z,s as i,o as d,c as p,F,a as o,h as n,q as v,t as u,i as g,e as c,w,k as U,K as m}from"./index-Dj4QxrF8.js";const A={class:"space-y-4"},B={key:0,class:"text-xs text-muted-foreground space-y-1"},I={class:"text-foreground"},N={class:"text-foreground"},O={key:0},P={key:1,class:"text-red-400"},S={class:"grid grid-cols-2 gap-3"},T={class:"space-y-1.5"},$={class:"space-y-1.5"},q={class:"space-y-1.5"},E={class:"flex items-center gap-2"},Q=z({__name:"DevopsConnectForm",setup(K){var x,V;const t=b(),r=i(((x=t.integration)==null?void 0:x.organization)??""),l=i(((V=t.integration)==null?void 0:V.project)??""),s=i(""),f=i(!1),_=i(!1);async function C(){if(!r.value||!l.value||!s.value){m.error("All fields are required");return}f.value=!0;try{await t.saveIntegration({organization:r.value,project:l.value,pat:s.value}),s.value="",m.success("Integration saved")}catch{m.error("Failed to save integration")}finally{f.value=!1}}async function D(){try{await t.deleteIntegration(),r.value="",l.value="",s.value="",m.success("Integration deleted")}catch{m.error("Failed to delete integration")}}return(L,e)=>(d(),p(F,null,[o("div",A,[n(t).integration?(d(),p("div",B,[o("p",null,[e[5]||(e[5]=v(" Connected to ",-1)),o("strong",I,u(n(t).integration.organization),1),e[6]||(e[6]=v(" / ",-1)),o("strong",N,u(n(t).integration.project),1)]),n(t).integration.last_synced_at?(d(),p("p",O," Last synced: "+u(new Date(n(t).integration.last_synced_at).toLocaleString()),1)):g("",!0),n(t).integration.last_sync_error?(d(),p("p",P," Error: "+u(n(t).integration.last_sync_error),1)):g("",!0)])):g("",!0),o("div",S,[o("div",T,[e[7]||(e[7]=o("label",{class:"text-sm font-medium text-foreground"},"Organization",-1)),c(y,{modelValue:r.value,"onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),placeholder:"myorg"},null,8,["modelValue"])]),o("div",$,[e[8]||(e[8]=o("label",{class:"text-sm font-medium text-foreground"},"Project",-1)),c(y,{modelValue:l.value,"onUpdate:modelValue":e[1]||(e[1]=a=>l.value=a),placeholder:"myproject"},null,8,["modelValue"])])]),o("div",q,[e[9]||(e[9]=o("label",{class:"text-sm font-medium text-foreground"}," Personal Access Token ",-1)),c(y,{modelValue:s.value,"onUpdate:modelValue":e[2]||(e[2]=a=>s.value=a),type:"password",placeholder:"••••••••",autocomplete:"new-password"},null,8,["modelValue"])]),o("div",E,[c(k,{loading:f.value,onClick:C},{default:w(()=>[v(u(n(t).integration?"Update":"Connect"),1)]),_:1},8,["loading"]),n(t).integration?(d(),U(k,{key:0,variant:"destructive",size:"sm",onClick:e[3]||(e[3]=a=>_.value=!0)},{default:w(()=>[...e[10]||(e[10]=[v(" Disconnect ",-1)])]),_:1})):g("",!0)])]),c(j,{open:_.value,"onUpdate:open":e[4]||(e[4]=a=>_.value=a),title:"Disconnect Azure DevOps",description:"This will remove the ADO integration and all synced work items. This action cannot be undone.","confirm-label":"Disconnect","cancel-label":"Cancel",variant:"destructive",onConfirm:D},null,8,["open"])],64))}});export{Q as _}; diff --git a/src/static/assets/DevopsView-TX3WlewI.js b/src/static/assets/DevopsView-CyGHofcw.js similarity index 89% rename from src/static/assets/DevopsView-TX3WlewI.js rename to src/static/assets/DevopsView-CyGHofcw.js index 693e4c7..f1bc4e6 100644 --- a/src/static/assets/DevopsView-TX3WlewI.js +++ b/src/static/assets/DevopsView-CyGHofcw.js @@ -1 +1 @@ -import{d as V,A as B,c as l,a as s,h as a,k as p,w as i,i as c,F as g,e as u,q as x,t as d,s as y,j as v,o as n,n as k,C as z,R as L,K as _}from"./index-rN5A-UTe.js";import{u as P,d as T}from"./devops-DzkXDmpg.js";import{p as F}from"./projects-COzvhtq2.js";import{_ as G,a as R}from"./CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js";import{a as E,_ as H}from"./CardTitle.vue_vue_type_script_setup_true_lang-CugNHrdd.js";import{_ as K}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_ as A}from"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";import{_ as q}from"./DataTable.vue_vue_type_script_setup_true_lang-CHKsc19V.js";import{_ as J}from"./SegmentedControl.vue_vue_type_script_setup_true_lang-CAqylCqr.js";import{_ as h}from"./Tooltip.vue_vue_type_script_setup_true_lang-CcvjvjWJ.js";import{_ as U}from"./DevopsConnectForm.vue_vue_type_script_setup_true_lang-BzwbMDjx.js";import"./utils-7WVCegLb.js";import"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import"./EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js";import"./ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js";import"./createLucideIcon-BQqEiwZb.js";const Q={class:"p-6 space-y-8"},X={class:"flex items-center justify-between gap-4 flex-wrap"},Y={class:"glass-card rounded-xl px-4 py-3 flex items-center gap-3 flex-wrap"},Z={class:"text-sm text-foreground"},tt={class:"text-foreground"},et={key:0,class:"text-xs text-muted-foreground ml-auto"},st={key:3,class:"w-full text-xs text-destructive"},ot={key:1,class:"space-y-4"},rt={class:"flex items-center justify-between gap-3 flex-wrap"},nt={class:"flex items-center gap-2"},it={class:"text-xs text-muted-foreground tabular-nums"},lt=["title"],at={key:0,class:"flex items-center justify-center py-12"},dt={key:1,class:"bg-background rounded-xl shadow-sm border border-border overflow-hidden"},ut={class:"text-xs font-mono text-muted-foreground"},ct={class:"min-w-0"},mt={class:"text-sm text-foreground truncate font-medium"},ft={class:"text-xs text-muted-foreground truncate"},pt=["title"],gt={class:"text-xs tabular-nums text-muted-foreground"},xt={key:1,class:"text-xs text-amber-500/70 italic"},_t={class:"text-xs text-muted-foreground"},bt={class:"flex items-center gap-1 justify-end"},yt=["onClick"],vt={key:0,class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},kt={key:1,class:"h-3.5 w-3.5 animate-spin",fill:"none",viewBox:"0 0 24 24"},ht=["href"],Tt=V({__name:"DevopsView",setup(wt){const o=P(),w=y([]),f=y("All"),m=y(null),C=v(()=>{const r={};for(const t of w.value)t.job_number&&(r[t.job_number.trim()]=t);return r}),b=v(()=>o.workItems.filter(r=>!r.omg_number).length),W=[{value:"All",label:"All"},{value:"Active",label:"Active"},{value:"Resolved",label:"Resolved"},{value:"Closed",label:"Closed"}];B(async()=>{await o.fetchIntegration(),o.integration&&await o.fetchWorkItems();try{const r=await F.list();w.value=r.data}catch{}});const S=v(()=>f.value==="All"?o.workItems:o.workItems.filter(t=>t.state===f.value)),$=[{key:"ado_id",title:"#",width:70,minWidth:50,sortable:!0,resizable:!0},{key:"title",title:"Title",minWidth:120,sortable:!0,filterable:!0,resizable:!0},{key:"team_project",title:"Project",width:140,minWidth:80,sortable:!0,filterable:!0,resizable:!0},{key:"omg_number",title:"OMG #",width:110,minWidth:80,sortable:!0,resizable:!0},{key:"priority",title:"P",width:60,minWidth:50,sortable:!0,align:"center",resizable:!0},{key:"created_date",title:"Created",width:110,minWidth:80,sortable:!0,resizable:!0},{key:"state",title:"State",width:110,minWidth:80,sortable:!0,filterable:!0,resizable:!0},{key:"id",title:"Actions",width:90,minWidth:80,align:"right"}];async function D(){try{await o.sync(),_.success("Sync complete"),await o.fetchWorkItems()}catch{_.error(o.error??"Sync failed")}}async function M(r,t){if(t.stopPropagation(),!m.value){m.value=r;try{await T.cloneWorkItem(r),_.success("Cloned to Tasks")}catch{_.error("Failed to clone")}finally{m.value=null}}}function O(r){const t=r??3;return t<=1?"text-red-500 font-bold":t<=2?"text-amber-500 font-semibold":"text-muted-foreground"}function I(r){return r==="Active"||r==="Doing"||r==="In Progress"?"bg-blue-50 text-blue-600 border border-blue-100":r==="Resolved"||r==="Done"||r==="Closed"?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-muted text-muted-foreground border border-border"}return(r,t)=>{var j;return n(),l("div",Q,[s("div",X,[t[4]||(t[4]=s("h2",{class:"text-lg font-semibold text-foreground"},"Azure DevOps",-1)),a(o).integration?(n(),p(K,{key:0,variant:"outline",size:"sm",loading:a(o).syncing,onClick:D},{default:i(()=>[...t[3]||(t[3]=[x(" Sync Now ",-1)])]),_:1},8,["loading"])):c("",!0)]),s("div",Y,[a(o).loading&&!a(o).integration?(n(),l(g,{key:0},[u(A,{size:"sm"}),t[5]||(t[5]=s("span",{class:"text-sm text-muted-foreground"},"Loading…",-1))],64)):a(o).integration?(n(),l(g,{key:1},[t[9]||(t[9]=s("div",{class:"h-2 w-2 rounded-full bg-emerald-400 shadow-sm shadow-emerald-200"},null,-1)),s("span",Z,[t[6]||(t[6]=x(" Connected to ",-1)),s("strong",tt,d(a(o).integration.organization),1),t[7]||(t[7]=s("span",{class:"text-muted-foreground mx-1"},"·",-1)),t[8]||(t[8]=s("span",{class:"text-muted-foreground text-xs"},"all assigned work items",-1))]),a(o).integration.last_synced_at?(n(),l("span",et," Last synced: "+d(new Date(a(o).integration.last_synced_at).toLocaleString()),1)):c("",!0)],64)):(n(),l(g,{key:2},[t[10]||(t[10]=s("div",{class:"h-2 w-2 rounded-full bg-muted-foreground/30"},null,-1)),t[11]||(t[11]=s("span",{class:"text-sm text-muted-foreground"},"Not connected",-1))],64)),(j=a(o).integration)!=null&&j.last_sync_error?(n(),l("p",st," Error: "+d(a(o).integration.last_sync_error),1)):c("",!0)]),!a(o).integration&&!a(o).loading?(n(),p(G,{key:0},{default:i(()=>[u(H,null,{default:i(()=>[u(E,{class:"text-sm"},{default:i(()=>[...t[12]||(t[12]=[x("Connect Azure DevOps",-1)])]),_:1})]),_:1}),u(R,{class:"space-y-4"},{default:i(()=>[u(U)]),_:1})]),_:1})):c("",!0),a(o).integration?(n(),l("div",ot,[s("div",rt,[s("div",nt,[t[13]||(t[13]=s("h3",{class:"text-sm font-semibold text-foreground"},"Work Items",-1)),s("span",it,d(S.value.length),1),b.value>0?(n(),l("span",{key:0,class:"text-xs text-amber-500 tabular-nums",title:`${b.value} work items have no OMG Deliverable Number`},"· "+d(b.value)+" без OMG #",9,lt)):c("",!0)]),u(J,{modelValue:f.value,"onUpdate:modelValue":t[0]||(t[0]=e=>f.value=e),options:W,"aria-label":"Filter by state"},null,8,["modelValue"])]),a(o).loading?(n(),l("div",at,[u(A,{size:"md",class:"text-primary"})])):(n(),l("div",dt,[u(q,{columns:$,rows:S.value,"row-key":"id","show-toolbar":!1},{"cell-ado_id":i(({value:e})=>[s("span",ut,"#"+d(e),1)]),"cell-title":i(({row:e})=>[s("div",ct,[s("p",mt,d(e.title),1),s("p",ft,d(e.type),1)])]),"cell-team_project":i(({value:e})=>[s("span",{class:"text-xs text-muted-foreground truncate block",title:String(e??"")},d(e||"—"),9,pt)]),"cell-omg_number":i(({value:e})=>[e?(n(),l(g,{key:0},[C.value[String(e)]?(n(),p(a(L),{key:0,to:`/projects/${C.value[String(e)].id}`,class:"text-xs tabular-nums text-primary hover:underline",onClick:t[1]||(t[1]=z(()=>{},["stop"]))},{default:i(()=>[x(d(e),1)]),_:2},1032,["to"])):(n(),p(h,{key:1,content:`OMG # ${e} — no matching CC project`},{default:i(()=>[s("span",gt,d(e),1)]),_:2},1032,["content"]))],64)):(n(),l("span",xt,"no OMG #"))]),"cell-priority":i(({value:e})=>[s("span",{class:k(["text-xs font-semibold",O(e)])}," P"+d(e??3),3)]),"cell-created_date":i(({value:e})=>[s("span",_t,d(e?new Date(String(e)).toLocaleDateString():"—"),1)]),"cell-state":i(({value:e})=>[s("span",{class:k(["text-xs px-2 py-0.5 rounded-full font-medium",I(String(e??""))])},d(e),3)]),"cell-id":i(({row:e})=>[s("div",bt,[u(h,{content:"Clone to Tasks"},{default:i(()=>[s("button",{class:k(["p-1.5 rounded-lg text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",{"opacity-50":m.value===String(e.id)}]),onClick:N=>M(String(e.id),N)},[m.value!==String(e.id)?(n(),l("svg",vt,[...t[14]||(t[14]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"},null,-1)])])):(n(),l("svg",kt,[...t[15]||(t[15]=[s("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),s("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])]))],10,yt)]),_:2},1024),u(h,{content:"Open in Azure DevOps"},{default:i(()=>[e.url?(n(),l("a",{key:0,href:String(e.url),target:"_blank",rel:"noopener",class:"p-1.5 rounded-lg text-muted-foreground hover:text-blue-500 hover:bg-blue-50 transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",onClick:t[2]||(t[2]=z(()=>{},["stop"]))},[...t[16]||(t[16]=[s("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],8,ht)):c("",!0)]),_:2},1024)])]),_:1},8,["rows"])]))])):c("",!0)])}}});export{Tt as default}; +import{d as V,A as B,c as l,a as s,h as a,k as p,w as i,i as c,F as g,e as u,q as x,t as d,s as y,j as v,o as n,n as k,C as z,R as L,K as _}from"./index-Dj4QxrF8.js";import{u as P,d as T}from"./devops-CgM36Koe.js";import{p as F}from"./projects-Bt6sxsgH.js";import{_ as G,a as R}from"./CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js";import{a as E,_ as H}from"./CardTitle.vue_vue_type_script_setup_true_lang-BMHIwlxU.js";import{_ as K}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_ as A}from"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";import{_ as q}from"./DataTable.vue_vue_type_script_setup_true_lang-8gHvRwtL.js";import{_ as J}from"./SegmentedControl.vue_vue_type_script_setup_true_lang-t9SJyic6.js";import{_ as h}from"./Tooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js";import{_ as U}from"./DevopsConnectForm.vue_vue_type_script_setup_true_lang-Bv-vOrXl.js";import"./utils-7WVCegLb.js";import"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import"./EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js";import"./ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js";import"./createLucideIcon-CglWgwD8.js";const Q={class:"p-6 space-y-8"},X={class:"flex items-center justify-between gap-4 flex-wrap"},Y={class:"glass-card rounded-xl px-4 py-3 flex items-center gap-3 flex-wrap"},Z={class:"text-sm text-foreground"},tt={class:"text-foreground"},et={key:0,class:"text-xs text-muted-foreground ml-auto"},st={key:3,class:"w-full text-xs text-destructive"},ot={key:1,class:"space-y-4"},rt={class:"flex items-center justify-between gap-3 flex-wrap"},nt={class:"flex items-center gap-2"},it={class:"text-xs text-muted-foreground tabular-nums"},lt=["title"],at={key:0,class:"flex items-center justify-center py-12"},dt={key:1,class:"bg-background rounded-xl shadow-sm border border-border overflow-hidden"},ut={class:"text-xs font-mono text-muted-foreground"},ct={class:"min-w-0"},mt={class:"text-sm text-foreground truncate font-medium"},ft={class:"text-xs text-muted-foreground truncate"},pt=["title"],gt={class:"text-xs tabular-nums text-muted-foreground"},xt={key:1,class:"text-xs text-amber-500/70 italic"},_t={class:"text-xs text-muted-foreground"},bt={class:"flex items-center gap-1 justify-end"},yt=["onClick"],vt={key:0,class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},kt={key:1,class:"h-3.5 w-3.5 animate-spin",fill:"none",viewBox:"0 0 24 24"},ht=["href"],Tt=V({__name:"DevopsView",setup(wt){const o=P(),w=y([]),f=y("All"),m=y(null),C=v(()=>{const r={};for(const t of w.value)t.job_number&&(r[t.job_number.trim()]=t);return r}),b=v(()=>o.workItems.filter(r=>!r.omg_number).length),W=[{value:"All",label:"All"},{value:"Active",label:"Active"},{value:"Resolved",label:"Resolved"},{value:"Closed",label:"Closed"}];B(async()=>{await o.fetchIntegration(),o.integration&&await o.fetchWorkItems();try{const r=await F.list();w.value=r.data}catch{}});const S=v(()=>f.value==="All"?o.workItems:o.workItems.filter(t=>t.state===f.value)),$=[{key:"ado_id",title:"#",width:70,minWidth:50,sortable:!0,resizable:!0},{key:"title",title:"Title",minWidth:120,sortable:!0,filterable:!0,resizable:!0},{key:"team_project",title:"Project",width:140,minWidth:80,sortable:!0,filterable:!0,resizable:!0},{key:"omg_number",title:"OMG #",width:110,minWidth:80,sortable:!0,resizable:!0},{key:"priority",title:"P",width:60,minWidth:50,sortable:!0,align:"center",resizable:!0},{key:"created_date",title:"Created",width:110,minWidth:80,sortable:!0,resizable:!0},{key:"state",title:"State",width:110,minWidth:80,sortable:!0,filterable:!0,resizable:!0},{key:"id",title:"Actions",width:90,minWidth:80,align:"right"}];async function D(){try{await o.sync(),_.success("Sync complete"),await o.fetchWorkItems()}catch{_.error(o.error??"Sync failed")}}async function M(r,t){if(t.stopPropagation(),!m.value){m.value=r;try{await T.cloneWorkItem(r),_.success("Cloned to Tasks")}catch{_.error("Failed to clone")}finally{m.value=null}}}function O(r){const t=r??3;return t<=1?"text-red-500 font-bold":t<=2?"text-amber-500 font-semibold":"text-muted-foreground"}function I(r){return r==="Active"||r==="Doing"||r==="In Progress"?"bg-blue-50 text-blue-600 border border-blue-100":r==="Resolved"||r==="Done"||r==="Closed"?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-muted text-muted-foreground border border-border"}return(r,t)=>{var j;return n(),l("div",Q,[s("div",X,[t[4]||(t[4]=s("h2",{class:"text-lg font-semibold text-foreground"},"Azure DevOps",-1)),a(o).integration?(n(),p(K,{key:0,variant:"outline",size:"sm",loading:a(o).syncing,onClick:D},{default:i(()=>[...t[3]||(t[3]=[x(" Sync Now ",-1)])]),_:1},8,["loading"])):c("",!0)]),s("div",Y,[a(o).loading&&!a(o).integration?(n(),l(g,{key:0},[u(A,{size:"sm"}),t[5]||(t[5]=s("span",{class:"text-sm text-muted-foreground"},"Loading…",-1))],64)):a(o).integration?(n(),l(g,{key:1},[t[9]||(t[9]=s("div",{class:"h-2 w-2 rounded-full bg-emerald-400 shadow-sm shadow-emerald-200"},null,-1)),s("span",Z,[t[6]||(t[6]=x(" Connected to ",-1)),s("strong",tt,d(a(o).integration.organization),1),t[7]||(t[7]=s("span",{class:"text-muted-foreground mx-1"},"·",-1)),t[8]||(t[8]=s("span",{class:"text-muted-foreground text-xs"},"all assigned work items",-1))]),a(o).integration.last_synced_at?(n(),l("span",et," Last synced: "+d(new Date(a(o).integration.last_synced_at).toLocaleString()),1)):c("",!0)],64)):(n(),l(g,{key:2},[t[10]||(t[10]=s("div",{class:"h-2 w-2 rounded-full bg-muted-foreground/30"},null,-1)),t[11]||(t[11]=s("span",{class:"text-sm text-muted-foreground"},"Not connected",-1))],64)),(j=a(o).integration)!=null&&j.last_sync_error?(n(),l("p",st," Error: "+d(a(o).integration.last_sync_error),1)):c("",!0)]),!a(o).integration&&!a(o).loading?(n(),p(G,{key:0},{default:i(()=>[u(H,null,{default:i(()=>[u(E,{class:"text-sm"},{default:i(()=>[...t[12]||(t[12]=[x("Connect Azure DevOps",-1)])]),_:1})]),_:1}),u(R,{class:"space-y-4"},{default:i(()=>[u(U)]),_:1})]),_:1})):c("",!0),a(o).integration?(n(),l("div",ot,[s("div",rt,[s("div",nt,[t[13]||(t[13]=s("h3",{class:"text-sm font-semibold text-foreground"},"Work Items",-1)),s("span",it,d(S.value.length),1),b.value>0?(n(),l("span",{key:0,class:"text-xs text-amber-500 tabular-nums",title:`${b.value} work items have no OMG Deliverable Number`},"· "+d(b.value)+" без OMG #",9,lt)):c("",!0)]),u(J,{modelValue:f.value,"onUpdate:modelValue":t[0]||(t[0]=e=>f.value=e),options:W,"aria-label":"Filter by state"},null,8,["modelValue"])]),a(o).loading?(n(),l("div",at,[u(A,{size:"md",class:"text-primary"})])):(n(),l("div",dt,[u(q,{columns:$,rows:S.value,"row-key":"id","show-toolbar":!1},{"cell-ado_id":i(({value:e})=>[s("span",ut,"#"+d(e),1)]),"cell-title":i(({row:e})=>[s("div",ct,[s("p",mt,d(e.title),1),s("p",ft,d(e.type),1)])]),"cell-team_project":i(({value:e})=>[s("span",{class:"text-xs text-muted-foreground truncate block",title:String(e??"")},d(e||"—"),9,pt)]),"cell-omg_number":i(({value:e})=>[e?(n(),l(g,{key:0},[C.value[String(e)]?(n(),p(a(L),{key:0,to:`/projects/${C.value[String(e)].id}`,class:"text-xs tabular-nums text-primary hover:underline",onClick:t[1]||(t[1]=z(()=>{},["stop"]))},{default:i(()=>[x(d(e),1)]),_:2},1032,["to"])):(n(),p(h,{key:1,content:`OMG # ${e} — no matching CC project`},{default:i(()=>[s("span",gt,d(e),1)]),_:2},1032,["content"]))],64)):(n(),l("span",xt,"no OMG #"))]),"cell-priority":i(({value:e})=>[s("span",{class:k(["text-xs font-semibold",O(e)])}," P"+d(e??3),3)]),"cell-created_date":i(({value:e})=>[s("span",_t,d(e?new Date(String(e)).toLocaleDateString():"—"),1)]),"cell-state":i(({value:e})=>[s("span",{class:k(["text-xs px-2 py-0.5 rounded-full font-medium",I(String(e??""))])},d(e),3)]),"cell-id":i(({row:e})=>[s("div",bt,[u(h,{content:"Clone to Tasks"},{default:i(()=>[s("button",{class:k(["p-1.5 rounded-lg text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",{"opacity-50":m.value===String(e.id)}]),onClick:N=>M(String(e.id),N)},[m.value!==String(e.id)?(n(),l("svg",vt,[...t[14]||(t[14]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"},null,-1)])])):(n(),l("svg",kt,[...t[15]||(t[15]=[s("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),s("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])]))],10,yt)]),_:2},1024),u(h,{content:"Open in Azure DevOps"},{default:i(()=>[e.url?(n(),l("a",{key:0,href:String(e.url),target:"_blank",rel:"noopener",class:"p-1.5 rounded-lg text-muted-foreground hover:text-blue-500 hover:bg-blue-50 transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",onClick:t[2]||(t[2]=z(()=>{},["stop"]))},[...t[16]||(t[16]=[s("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],8,ht)):c("",!0)]),_:2},1024)])]),_:1},8,["rows"])]))])):c("",!0)])}}});export{Tt as default}; diff --git a/src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-5tIAaGh4.js b/src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js similarity index 95% rename from src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-5tIAaGh4.js rename to src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js index e5b0db1..087c895 100644 --- a/src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-5tIAaGh4.js +++ b/src/static/assets/Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js @@ -1 +1 @@ -import{x as h,y as b,d as w,A as x,k as g,L as E,e as v,T as C,w as p,o as c,c as u,a,p as m,i as f,n as L,s as $,t as y,M as B}from"./index-rN5A-UTe.js";import{_ as T}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";const j=["[autofocus]","button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function D(t,d){let r=null;function i(){return t.value?Array.from(t.value.querySelectorAll(j)):[]}function l(s){if(!d.value||!t.value||s.key!=="Tab")return;const e=i();if(!e.length){s.preventDefault();return}const o=e[0],n=e[e.length-1];s.shiftKey?document.activeElement===o&&(s.preventDefault(),n.focus()):document.activeElement===n&&(s.preventDefault(),o.focus())}h(d,s=>{if(s)r=document.activeElement,document.addEventListener("keydown",l),setTimeout(()=>{const e=i();e.length&&e[0].focus()},50);else{document.removeEventListener("keydown",l);const e=r;setTimeout(()=>{e&&"focus"in e&&e.focus()},150)}}),b(()=>{document.removeEventListener("keydown",l)})}const z={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},A=["aria-label"],F={key:0,class:"flex items-center justify-between p-6 pb-4"},M={class:"text-lg font-semibold text-foreground"},S={key:0,class:"text-sm text-muted-foreground mt-1"},K={class:"px-6 pb-4 max-h-[85vh] overflow-y-auto"},N={key:1,class:"flex justify-end gap-2 px-6 pb-6"},W=w({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},maxWidth:{default:"max-w-lg"}},emits:["close"],setup(t,{emit:d}){const r=t,i=d,l=$(null),s=B(r,"open");D(l,s);function e(o){o.key==="Escape"&&r.open&&i("close")}return x(()=>document.addEventListener("keydown",e)),b(()=>document.removeEventListener("keydown",e)),(o,n)=>(c(),g(E,{to:"body"},[v(C,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:p(()=>[t.open?(c(),u("div",z,[a("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:n[0]||(n[0]=k=>i("close"))}),a("div",{ref_key:"contentRef",ref:l,class:L(["relative w-full bg-card border border-border rounded-lg shadow-xl z-10",t.maxWidth]),role:"dialog","aria-modal":"true","aria-label":t.title},[t.title||o.$slots.header?(c(),u("div",F,[a("div",null,[m(o.$slots,"header",{},()=>[a("h2",M,y(t.title),1),t.description?(c(),u("p",S,y(t.description),1)):f("",!0)])]),v(T,{variant:"ghost",size:"icon",class:"shrink-0",onClick:n[1]||(n[1]=k=>i("close"))},{default:p(()=>[...n[2]||(n[2]=[a("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])]),_:1})])):f("",!0),a("div",K,[m(o.$slots,"default")]),o.$slots.footer?(c(),u("div",N,[m(o.$slots,"footer")])):f("",!0)],10,A)])):f("",!0)]),_:3})]))}});export{W as _}; +import{x as h,y as b,d as w,A as x,k as g,L as E,e as v,T as C,w as p,o as c,c as u,a,p as m,i as f,n as L,s as $,t as y,M as B}from"./index-Dj4QxrF8.js";import{_ as T}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";const j=["[autofocus]","button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function D(t,d){let r=null;function i(){return t.value?Array.from(t.value.querySelectorAll(j)):[]}function l(s){if(!d.value||!t.value||s.key!=="Tab")return;const e=i();if(!e.length){s.preventDefault();return}const o=e[0],n=e[e.length-1];s.shiftKey?document.activeElement===o&&(s.preventDefault(),n.focus()):document.activeElement===n&&(s.preventDefault(),o.focus())}h(d,s=>{if(s)r=document.activeElement,document.addEventListener("keydown",l),setTimeout(()=>{const e=i();e.length&&e[0].focus()},50);else{document.removeEventListener("keydown",l);const e=r;setTimeout(()=>{e&&"focus"in e&&e.focus()},150)}}),b(()=>{document.removeEventListener("keydown",l)})}const z={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},A=["aria-label"],F={key:0,class:"flex items-center justify-between p-6 pb-4"},M={class:"text-lg font-semibold text-foreground"},S={key:0,class:"text-sm text-muted-foreground mt-1"},K={class:"px-6 pb-4 max-h-[85vh] overflow-y-auto"},N={key:1,class:"flex justify-end gap-2 px-6 pb-6"},W=w({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},maxWidth:{default:"max-w-lg"}},emits:["close"],setup(t,{emit:d}){const r=t,i=d,l=$(null),s=B(r,"open");D(l,s);function e(o){o.key==="Escape"&&r.open&&i("close")}return x(()=>document.addEventListener("keydown",e)),b(()=>document.removeEventListener("keydown",e)),(o,n)=>(c(),g(E,{to:"body"},[v(C,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:p(()=>[t.open?(c(),u("div",z,[a("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:n[0]||(n[0]=k=>i("close"))}),a("div",{ref_key:"contentRef",ref:l,class:L(["relative w-full bg-card border border-border rounded-lg shadow-xl z-10",t.maxWidth]),role:"dialog","aria-modal":"true","aria-label":t.title},[t.title||o.$slots.header?(c(),u("div",F,[a("div",null,[m(o.$slots,"header",{},()=>[a("h2",M,y(t.title),1),t.description?(c(),u("p",S,y(t.description),1)):f("",!0)])]),v(T,{variant:"ghost",size:"icon",class:"shrink-0",onClick:n[1]||(n[1]=k=>i("close"))},{default:p(()=>[...n[2]||(n[2]=[a("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])]),_:1})])):f("",!0),a("div",K,[m(o.$slots,"default")]),o.$slots.footer?(c(),u("div",N,[m(o.$slots,"footer")])):f("",!0)],10,A)])):f("",!0)]),_:3})]))}});export{W as _}; diff --git a/src/static/assets/EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js b/src/static/assets/EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js similarity index 94% rename from src/static/assets/EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js rename to src/static/assets/EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js index 0f8fa70..4839828 100644 --- a/src/static/assets/EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js +++ b/src/static/assets/EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js @@ -1 +1 @@ -import{c as s}from"./utils-7WVCegLb.js";import{_ as k}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{d as w,c as a,n as o,h as r,F as S,r as B,i as n,a as m,t as i,k as l,w as L,o as t,l as f,q as j}from"./index-rN5A-UTe.js";const I=["aria-label"],N={key:0,class:"relative mb-6 flex items-end justify-center gap-2"},V={class:"space-y-2"},$=w({__name:"EmptyState",props:{title:{},description:{},icons:{},actionLabel:{},actionIcon:{},size:{default:"default"}},emits:["action"],setup(e,{emit:x}){const g=x,h={sm:"p-6",default:"p-8",lg:"p-12"},b={sm:"h-9 w-9",default:"h-11 w-11",lg:"h-14 w-14"},v=["z-10 translate-y-1 -rotate-6 group-hover:-translate-x-3 group-hover:-translate-y-1 group-hover:-rotate-12","z-20 group-hover:-translate-y-3","z-10 translate-y-1 rotate-6 group-hover:translate-x-3 group-hover:-translate-y-1 group-hover:rotate-12"],y={sm:"text-sm",default:"text-base",lg:"text-lg"},z={sm:"text-xs",default:"text-sm",lg:"text-base"},C={sm:"h-7 text-xs px-3",default:"",lg:"h-11 text-base px-6"};return(p,c)=>(t(),a("div",{class:o(r(s)("group flex flex-col items-center justify-center text-center","rounded-xl border-2 border-dashed border-border bg-card","transition-all duration-300 hover:border-foreground/30",h[e.size])),role:"status","aria-label":e.title},[e.icons&&e.icons.length?(t(),a("div",N,[(t(!0),a(S,null,B(e.icons.slice(0,3),(d,u)=>(t(),a("div",{key:u,class:o(r(s)("flex items-center justify-center rounded-xl border border-border bg-background shadow-sm","text-muted-foreground transition-all duration-300",b[e.size],v[u]??"z-20"))},[(t(),l(f(d),{class:"h-5 w-5"}))],2))),128))])):n("",!0),m("div",V,[m("h3",{class:o(r(s)("font-semibold text-foreground",y[e.size]))},i(e.title),3),e.description?(t(),a("p",{key:0,class:o(r(s)("text-muted-foreground",z[e.size]))},i(e.description),3)):n("",!0)]),e.actionLabel?(t(),l(k,{key:1,variant:"outline",class:o(r(s)("mt-6",C[e.size])),onClick:c[0]||(c[0]=d=>g("action"))},{default:L(()=>[e.actionIcon?(t(),l(f(e.actionIcon),{key:0,class:"mr-2 h-4 w-4 transition-transform duration-200 group-hover/btn:rotate-90"})):n("",!0),j(" "+i(e.actionLabel),1)]),_:1},8,["class"])):n("",!0)],10,I))}});export{$ as _}; +import{c as s}from"./utils-7WVCegLb.js";import{_ as k}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{d as w,c as a,n as o,h as r,F as S,r as B,i as n,a as m,t as i,k as l,w as L,o as t,l as f,q as j}from"./index-Dj4QxrF8.js";const I=["aria-label"],N={key:0,class:"relative mb-6 flex items-end justify-center gap-2"},V={class:"space-y-2"},$=w({__name:"EmptyState",props:{title:{},description:{},icons:{},actionLabel:{},actionIcon:{},size:{default:"default"}},emits:["action"],setup(e,{emit:x}){const g=x,h={sm:"p-6",default:"p-8",lg:"p-12"},b={sm:"h-9 w-9",default:"h-11 w-11",lg:"h-14 w-14"},v=["z-10 translate-y-1 -rotate-6 group-hover:-translate-x-3 group-hover:-translate-y-1 group-hover:-rotate-12","z-20 group-hover:-translate-y-3","z-10 translate-y-1 rotate-6 group-hover:translate-x-3 group-hover:-translate-y-1 group-hover:rotate-12"],y={sm:"text-sm",default:"text-base",lg:"text-lg"},z={sm:"text-xs",default:"text-sm",lg:"text-base"},C={sm:"h-7 text-xs px-3",default:"",lg:"h-11 text-base px-6"};return(p,c)=>(t(),a("div",{class:o(r(s)("group flex flex-col items-center justify-center text-center","rounded-xl border-2 border-dashed border-border bg-card","transition-all duration-300 hover:border-foreground/30",h[e.size])),role:"status","aria-label":e.title},[e.icons&&e.icons.length?(t(),a("div",N,[(t(!0),a(S,null,B(e.icons.slice(0,3),(d,u)=>(t(),a("div",{key:u,class:o(r(s)("flex items-center justify-center rounded-xl border border-border bg-background shadow-sm","text-muted-foreground transition-all duration-300",b[e.size],v[u]??"z-20"))},[(t(),l(f(d),{class:"h-5 w-5"}))],2))),128))])):n("",!0),m("div",V,[m("h3",{class:o(r(s)("font-semibold text-foreground",y[e.size]))},i(e.title),3),e.description?(t(),a("p",{key:0,class:o(r(s)("text-muted-foreground",z[e.size]))},i(e.description),3)):n("",!0)]),e.actionLabel?(t(),l(k,{key:1,variant:"outline",class:o(r(s)("mt-6",C[e.size])),onClick:c[0]||(c[0]=d=>g("action"))},{default:L(()=>[e.actionIcon?(t(),l(f(e.actionIcon),{key:0,class:"mr-2 h-4 w-4 transition-transform duration-200 group-hover/btn:rotate-90"})):n("",!0),j(" "+i(e.actionLabel),1)]),_:1},8,["class"])):n("",!0)],10,I))}});export{$ as _}; diff --git a/src/static/assets/Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js b/src/static/assets/Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js similarity index 94% rename from src/static/assets/Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js rename to src/static/assets/Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js index 35f5f00..611b80d 100644 --- a/src/static/assets/Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js +++ b/src/static/assets/Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js @@ -1 +1 @@ -import{c as i}from"./utils-7WVCegLb.js";import{d,c as s,n as u,h as m,o as r}from"./index-rN5A-UTe.js";const c=["id","name","type","value","placeholder","disabled","autocomplete","min","max","step"],g=d({__name:"Input",props:{modelValue:{},type:{},placeholder:{},disabled:{type:Boolean},class:{},id:{},name:{},autocomplete:{},min:{},max:{},step:{}},emits:["update:modelValue","change","blur","focus"],setup(e,{emit:n}){const a=e,o=n;return(f,t)=>(r(),s("input",{id:e.id,name:e.name,type:e.type??"text",value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,autocomplete:e.autocomplete,min:e.min,max:e.max,step:e.step,class:u(m(i)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a.class)),onInput:t[0]||(t[0]=l=>o("update:modelValue",l.target.value)),onChange:t[1]||(t[1]=l=>o("change",l.target.value)),onBlur:t[2]||(t[2]=l=>o("blur",l)),onFocus:t[3]||(t[3]=l=>o("focus",l))},null,42,c))}});export{g as _}; +import{c as i}from"./utils-7WVCegLb.js";import{d,c as s,n as u,h as m,o as r}from"./index-Dj4QxrF8.js";const c=["id","name","type","value","placeholder","disabled","autocomplete","min","max","step"],g=d({__name:"Input",props:{modelValue:{},type:{},placeholder:{},disabled:{type:Boolean},class:{},id:{},name:{},autocomplete:{},min:{},max:{},step:{}},emits:["update:modelValue","change","blur","focus"],setup(e,{emit:n}){const a=e,o=n;return(f,t)=>(r(),s("input",{id:e.id,name:e.name,type:e.type??"text",value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,autocomplete:e.autocomplete,min:e.min,max:e.max,step:e.step,class:u(m(i)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a.class)),onInput:t[0]||(t[0]=l=>o("update:modelValue",l.target.value)),onChange:t[1]||(t[1]=l=>o("change",l.target.value)),onBlur:t[2]||(t[2]=l=>o("blur",l)),onFocus:t[3]||(t[3]=l=>o("focus",l))},null,42,c))}});export{g as _}; diff --git a/src/static/assets/KeysView-DFI2tF0F.js b/src/static/assets/KeysView-BbrvrPgK.js similarity index 87% rename from src/static/assets/KeysView-DFI2tF0F.js rename to src/static/assets/KeysView-BbrvrPgK.js index e4d45f5..534e710 100644 --- a/src/static/assets/KeysView-DFI2tF0F.js +++ b/src/static/assets/KeysView-BbrvrPgK.js @@ -1,4 +1,4 @@ -import{a as h}from"./admin-Bt3HG9mf.js";import{_ as N,a as R}from"./CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js";import{_ as y}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_ as B}from"./Dialog.vue_vue_type_script_setup_true_lang-5tIAaGh4.js";import{_ as j}from"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import{_ as D}from"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";import{_ as F}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js";import{_ as S}from"./EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js";import{d as q,A as z,c as n,a as t,e as o,w as r,s as i,o as l,q as _,h as p,F as M,r as U,t as c,k as T,i as E,K as k}from"./index-rN5A-UTe.js";import{a as V}from"./utils-7WVCegLb.js";import{c as A}from"./createLucideIcon-BQqEiwZb.js";import{P as G}from"./plus-8OWFLnn5.js";/** +import{a as h}from"./admin-DXsqWfhz.js";import{_ as N,a as R}from"./CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js";import{_ as y}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_ as B}from"./Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js";import{_ as j}from"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import{_ as D}from"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";import{_ as F}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js";import{_ as S}from"./EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js";import{d as q,A as z,c as n,a as t,e as o,w as r,s as i,o as l,q as _,h as p,F as M,r as U,t as c,k as T,i as E,K as k}from"./index-Dj4QxrF8.js";import{a as V}from"./utils-7WVCegLb.js";import{c as A}from"./createLucideIcon-CglWgwD8.js";import{P as G}from"./plus-C-ov7K0l.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/LiveView-DDM8h9ml.js b/src/static/assets/LiveView-CtRvAfQD.js similarity index 90% rename from src/static/assets/LiveView-DDM8h9ml.js rename to src/static/assets/LiveView-CtRvAfQD.js index bc0b8db..f911f44 100644 --- a/src/static/assets/LiveView-DDM8h9ml.js +++ b/src/static/assets/LiveView-CtRvAfQD.js @@ -1,4 +1,4 @@ -import{y as J,s as b,d as M,u as O,A as V,c as f,a as i,n as k,h as o,t as v,k as N,w as g,i as C,e as _,o as l,q as j,F as B,r as F,j as I}from"./index-rN5A-UTe.js";import{_ as R,a as z}from"./CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js";import{_ as L}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_ as S}from"./Skeleton.vue_vue_type_script_setup_true_lang-DvqtZljC.js";import{_ as A}from"./EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js";import{c as D}from"./createLucideIcon-BQqEiwZb.js";import{Z as U}from"./zap-B0jfADxc.js";import"./utils-7WVCegLb.js";import"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";/** +import{y as J,s as b,d as M,u as O,A as V,c as f,a as i,n as k,h as o,t as v,k as N,w as g,i as C,e as _,o as l,q as j,F as B,r as F,j as I}from"./index-Dj4QxrF8.js";import{_ as R,a as z}from"./CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js";import{_ as L}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_ as S}from"./Skeleton.vue_vue_type_script_setup_true_lang-DhWXp9By.js";import{_ as A}from"./EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js";import{c as D}from"./createLucideIcon-CglWgwD8.js";import{Z as U}from"./zap-Bmdr3aWk.js";import"./utils-7WVCegLb.js";import"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/LoginView-D4TcGUK9.js b/src/static/assets/LoginView-8WQzarqw.js similarity index 94% rename from src/static/assets/LoginView-D4TcGUK9.js rename to src/static/assets/LoginView-8WQzarqw.js index f9337f3..71dd6ad 100644 --- a/src/static/assets/LoginView-D4TcGUK9.js +++ b/src/static/assets/LoginView-8WQzarqw.js @@ -1 +1 @@ -import{d as h,u as f,c as o,a as e,b as g,e as a,w as d,o as i,f as m,g as p,h as r,t as x,i as b}from"./index-rN5A-UTe.js";import{_ as v,a as w}from"./CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js";import"./utils-7WVCegLb.js";const y={class:"min-h-screen flex items-center justify-center bg-background p-4"},_={class:"w-full max-w-sm"},k={class:"space-y-4"},C={key:0,class:"rounded-md bg-destructive/10 border border-destructive/30 px-3 py-2 text-sm text-destructive"},B=["disabled"],V={key:0},S={key:1},M=h({__name:"LoginView",setup(F){const l=m(),c=p(),s=f();async function u(){try{await s.loginWithMicrosoft();const n=c.query.redirect;l.push(n??"/")}catch{}}return(n,t)=>(i(),o("div",y,[e("div",_,[t[2]||(t[2]=g('

CC Dashboard

Corporate Planning Hub

',1)),a(v,null,{default:d(()=>[a(w,{class:"pt-6"},{default:d(()=>[e("div",k,[r(s).error?(i(),o("div",C,x(r(s).error),1)):b("",!0),e("button",{type:"button",disabled:r(s).loading,class:"w-full flex items-center justify-center gap-3 rounded-md border border-border bg-white px-4 py-2.5 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onClick:u},[t[0]||(t[0]=e("svg",{class:"h-5 w-5 shrink-0",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("rect",{x:"1",y:"1",width:"9",height:"9",fill:"#F25022"}),e("rect",{x:"11",y:"1",width:"9",height:"9",fill:"#7FBA00"}),e("rect",{x:"1",y:"11",width:"9",height:"9",fill:"#00A4EF"}),e("rect",{x:"11",y:"11",width:"9",height:"9",fill:"#FFB900"})],-1)),r(s).loading?(i(),o("span",V,"Signing in…")):(i(),o("span",S,"Sign in with Microsoft"))],8,B),t[1]||(t[1]=e("p",{class:"text-center text-xs text-muted-foreground"}," Use your @oliver.agency account ",-1))])]),_:1})]),_:1})])]))}});export{M as default}; +import{d as h,u as f,c as o,a as e,b as g,e as a,w as d,o as i,f as m,g as p,h as r,t as x,i as b}from"./index-Dj4QxrF8.js";import{_ as v,a as w}from"./CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js";import"./utils-7WVCegLb.js";const y={class:"min-h-screen flex items-center justify-center bg-background p-4"},_={class:"w-full max-w-sm"},k={class:"space-y-4"},C={key:0,class:"rounded-md bg-destructive/10 border border-destructive/30 px-3 py-2 text-sm text-destructive"},B=["disabled"],V={key:0},S={key:1},M=h({__name:"LoginView",setup(F){const l=m(),c=p(),s=f();async function u(){try{await s.loginWithMicrosoft();const n=c.query.redirect;l.push(n??"/")}catch{}}return(n,t)=>(i(),o("div",y,[e("div",_,[t[2]||(t[2]=g('

CC Dashboard

Corporate Planning Hub

',1)),a(v,null,{default:d(()=>[a(w,{class:"pt-6"},{default:d(()=>[e("div",k,[r(s).error?(i(),o("div",C,x(r(s).error),1)):b("",!0),e("button",{type:"button",disabled:r(s).loading,class:"w-full flex items-center justify-center gap-3 rounded-md border border-border bg-white px-4 py-2.5 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onClick:u},[t[0]||(t[0]=e("svg",{class:"h-5 w-5 shrink-0",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("rect",{x:"1",y:"1",width:"9",height:"9",fill:"#F25022"}),e("rect",{x:"11",y:"1",width:"9",height:"9",fill:"#7FBA00"}),e("rect",{x:"1",y:"11",width:"9",height:"9",fill:"#00A4EF"}),e("rect",{x:"11",y:"11",width:"9",height:"9",fill:"#FFB900"})],-1)),r(s).loading?(i(),o("span",V,"Signing in…")):(i(),o("span",S,"Sign in with Microsoft"))],8,B),t[1]||(t[1]=e("p",{class:"text-center text-xs text-muted-foreground"}," Use your @oliver.agency account ",-1))])]),_:1})]),_:1})])]))}});export{M as default}; diff --git a/src/static/assets/OmgView-DRcTYRif.js b/src/static/assets/OmgView-BhU31iOQ.js similarity index 92% rename from src/static/assets/OmgView-DRcTYRif.js rename to src/static/assets/OmgView-BhU31iOQ.js index 82c2a00..bc65ab5 100644 --- a/src/static/assets/OmgView-DRcTYRif.js +++ b/src/static/assets/OmgView-BhU31iOQ.js @@ -1,4 +1,4 @@ -import{D as U,d as oe,A as le,E as ne,K as _,c as v,a as l,e as i,w as r,k as g,h as $,F as R,r as G,g as ae,s as u,o as a,q as A,n as q,G as h,t as x,R as se,H as ie,I as re,i as ue,C as de,j as ce}from"./index-rN5A-UTe.js";import{p as me}from"./projects-COzvhtq2.js";import{_ as ve}from"./Dialog.vue_vue_type_script_setup_true_lang-5tIAaGh4.js";import{_ as j}from"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import{_ as fe}from"./Textarea.vue_vue_type_script_setup_true_lang-MCF8JR3D.js";import{_ as V}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_ as pe}from"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";import{_ as be}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js";import{_ as D}from"./Tooltip.vue_vue_type_script_setup_true_lang-CcvjvjWJ.js";import{_ as ge}from"./EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js";import{F as xe}from"./file-text-DKL7lELr.js";import{P as _e}from"./plus-8OWFLnn5.js";import{c as Q}from"./createLucideIcon-BQqEiwZb.js";import"./utils-7WVCegLb.js";/** +import{D as U,d as oe,A as le,E as ne,K as _,c as v,a as l,e as i,w as r,k as g,h as $,F as R,r as G,g as ae,s as u,o as a,q as A,n as q,G as h,t as x,R as se,H as ie,I as re,i as ue,C as de,j as ce}from"./index-Dj4QxrF8.js";import{p as me}from"./projects-Bt6sxsgH.js";import{_ as ve}from"./Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js";import{_ as j}from"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import{_ as fe}from"./Textarea.vue_vue_type_script_setup_true_lang-BYTYmReP.js";import{_ as V}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_ as pe}from"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";import{_ as be}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js";import{_ as D}from"./Tooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js";import{_ as ge}from"./EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js";import{F as xe}from"./file-text-DJt8VL3c.js";import{P as _e}from"./plus-C-ov7K0l.js";import{c as Q}from"./createLucideIcon-CglWgwD8.js";import"./utils-7WVCegLb.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/ProjectDetailView-CdtUGv8p.js b/src/static/assets/ProjectDetailView-4KJdgDVR.js similarity index 92% rename from src/static/assets/ProjectDetailView-CdtUGv8p.js rename to src/static/assets/ProjectDetailView-4KJdgDVR.js index 0c4f674..94d7a1a 100644 --- a/src/static/assets/ProjectDetailView-CdtUGv8p.js +++ b/src/static/assets/ProjectDetailView-4KJdgDVR.js @@ -1,4 +1,4 @@ -import{d as W,u as q,A as G,c as r,e as a,a as s,F as f,t as d,h as n,i as x,w as i,k as V,g as Q,f as X,s as h,J as Y,o as l,q as _,r as g,z as F,n as T,j as Z,K as E}from"./index-rN5A-UTe.js";import{d as ee}from"./dashboard-DAarnFBr.js";import{_ as y,a as b}from"./CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js";import{_ as k,a as w}from"./CardTitle.vue_vue_type_script_setup_true_lang-CugNHrdd.js";import{_ as z}from"./Skeleton.vue_vue_type_script_setup_true_lang-DvqtZljC.js";import{_ as S}from"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import{_ as H}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_ as D}from"./EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js";import{_ as J}from"./Tooltip.vue_vue_type_script_setup_true_lang-CcvjvjWJ.js";import{f as B,b as I}from"./utils-7WVCegLb.js";import{F as te}from"./file-text-DKL7lELr.js";import{c as se}from"./createLucideIcon-BQqEiwZb.js";import{C as oe}from"./calendar-days-OJQzkSiF.js";import"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";/** +import{d as W,u as q,A as G,c as r,e as a,a as s,F as f,t as d,h as n,i as x,w as i,k as V,g as Q,f as X,s as h,J as Y,o as l,q as _,r as g,z as F,n as T,j as Z,K as E}from"./index-Dj4QxrF8.js";import{d as ee}from"./dashboard-9KozuccB.js";import{_ as y,a as b}from"./CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js";import{_ as k,a as w}from"./CardTitle.vue_vue_type_script_setup_true_lang-BMHIwlxU.js";import{_ as z}from"./Skeleton.vue_vue_type_script_setup_true_lang-DhWXp9By.js";import{_ as S}from"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import{_ as H}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_ as D}from"./EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js";import{_ as J}from"./Tooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js";import{f as B,b as I}from"./utils-7WVCegLb.js";import{F as te}from"./file-text-DJt8VL3c.js";import{c as se}from"./createLucideIcon-CglWgwD8.js";import{C as oe}from"./calendar-days-B6LXSX5z.js";import"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/ProjectsView-DYSEwPaV.js b/src/static/assets/ProjectsView-BFbSEcZ2.js similarity index 91% rename from src/static/assets/ProjectsView-DYSEwPaV.js rename to src/static/assets/ProjectsView-BFbSEcZ2.js index 4fb00bb..9e77555 100644 --- a/src/static/assets/ProjectsView-DYSEwPaV.js +++ b/src/static/assets/ProjectsView-BFbSEcZ2.js @@ -1,4 +1,4 @@ -import{d as S,x as z,A as q,c as r,a as s,e as d,h as a,F as I,r as W,w as n,f as F,s as _,j as N,o,k as h,t as i,i as x,R as b,C as k,q as v}from"./index-rN5A-UTe.js";import{d as R}from"./dashboard-DAarnFBr.js";import{a as B,_ as G}from"./CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js";import{_ as M}from"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";import{_ as A}from"./SegmentedControl.vue_vue_type_script_setup_true_lang-CAqylCqr.js";import{_ as D}from"./EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js";import{_ as O}from"./DataTable.vue_vue_type_script_setup_true_lang-CHKsc19V.js";import{_ as P}from"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import{f as w,a as j}from"./utils-7WVCegLb.js";import{F as T}from"./folder-open-Dm6Er06z.js";import{c as y}from"./createLucideIcon-BQqEiwZb.js";import{Z as U}from"./zap-B0jfADxc.js";import"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";/** +import{d as S,x as z,A as q,c as r,a as s,e as d,h as a,F as I,r as W,w as n,f as F,s as _,j as N,o,k as h,t as i,i as x,R as b,C as k,q as v}from"./index-Dj4QxrF8.js";import{d as R}from"./dashboard-9KozuccB.js";import{a as B,_ as G}from"./CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js";import{_ as M}from"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";import{_ as A}from"./SegmentedControl.vue_vue_type_script_setup_true_lang-t9SJyic6.js";import{_ as D}from"./EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js";import{_ as O}from"./DataTable.vue_vue_type_script_setup_true_lang-8gHvRwtL.js";import{_ as P}from"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import{f as w,a as j}from"./utils-7WVCegLb.js";import{F as T}from"./folder-open-Cenu-_Fx.js";import{c as y}from"./createLucideIcon-CglWgwD8.js";import{Z as U}from"./zap-Bmdr3aWk.js";import"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/ReportsView-CpecHUOd.js b/src/static/assets/ReportsView-Br61zuWE.js similarity index 98% rename from src/static/assets/ReportsView-CpecHUOd.js rename to src/static/assets/ReportsView-Br61zuWE.js index 21ea626..9f952df 100644 --- a/src/static/assets/ReportsView-CpecHUOd.js +++ b/src/static/assets/ReportsView-Br61zuWE.js @@ -1,4 +1,4 @@ -var Ee=Object.defineProperty;var pe=a=>{throw TypeError(a)};var Le=(a,t,e)=>t in a?Ee(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var x=(a,t,e)=>Le(a,typeof t!="symbol"?t+"":t,e),Be=(a,t,e)=>t.has(a)||pe("Cannot "+e);var he=(a,t,e)=>t.has(a)?pe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,e);var D=(a,t,e)=>(Be(a,t,"access private method"),e);import{D as G,d as qe,u as Ze,A as Pe,c as v,a as w,e as z,w as S,h as W,F as Me,r as De,s as E,o as T,q as L,k as ue,t as X,i as fe,n as Qe,K as Q}from"./index-rN5A-UTe.js";import{a as je,_ as Oe}from"./CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js";import{_ as de}from"./Badge.vue_vue_type_script_setup_true_lang-igExkyOK.js";import{_ as K}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_ as Ne}from"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";import{_ as Fe}from"./SegmentedControl.vue_vue_type_script_setup_true_lang-CAqylCqr.js";import{_ as He}from"./EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js";import{a as Ue,i as Ve}from"./utils-7WVCegLb.js";import{F as Ge}from"./file-text-DKL7lELr.js";import{C as We}from"./calendar-GhZPhKWb.js";import{_ as Xe}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./createLucideIcon-BQqEiwZb.js";const ge={list:()=>G.get("/api/reports"),get:a=>G.get(`/api/reports/${a}`),generate:a=>G.post("/api/reports/generate",a)};function ee(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let C=ee();function ye(a){C=a}const $e=/[&<>"']/,Ke=new RegExp($e.source,"g"),_e=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Je=new RegExp(_e.source,"g"),Ye={"&":"&","<":"<",">":">",'"':""","'":"'"},ke=a=>Ye[a];function b(a,t){if(t){if($e.test(a))return a.replace(Ke,ke)}else if(_e.test(a))return a.replace(Je,ke);return a}const et=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function tt(a){return a.replace(et,(t,e)=>(e=e.toLowerCase(),e==="colon"?":":e.charAt(0)==="#"?e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}const nt=/(^|[^\[])\^/g;function g(a,t){let e=typeof a=="string"?a:a.source;t=t||"";const n={replace:(i,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(nt,"$1"),e=e.replace(i,s),n},getRegex:()=>new RegExp(e,t)};return n}function xe(a){try{a=encodeURI(a).replace(/%25/g,"%")}catch{return null}return a}const q={exec:()=>null};function me(a,t){const e=a.replace(/\|/g,(r,s,l)=>{let o=!1,u=s;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),n=e.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length{throw TypeError(a)};var Le=(a,t,e)=>t in a?Ee(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var x=(a,t,e)=>Le(a,typeof t!="symbol"?t+"":t,e),Be=(a,t,e)=>t.has(a)||pe("Cannot "+e);var he=(a,t,e)=>t.has(a)?pe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,e);var D=(a,t,e)=>(Be(a,t,"access private method"),e);import{D as G,d as qe,u as Ze,A as Pe,c as v,a as w,e as z,w as S,h as W,F as Me,r as De,s as E,o as T,q as L,k as ue,t as X,i as fe,n as Qe,K as Q}from"./index-Dj4QxrF8.js";import{a as je,_ as Oe}from"./CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js";import{_ as de}from"./Badge.vue_vue_type_script_setup_true_lang-DAgGdGY2.js";import{_ as K}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_ as Ne}from"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";import{_ as Fe}from"./SegmentedControl.vue_vue_type_script_setup_true_lang-t9SJyic6.js";import{_ as He}from"./EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js";import{a as Ue,i as Ve}from"./utils-7WVCegLb.js";import{F as Ge}from"./file-text-DJt8VL3c.js";import{C as We}from"./calendar-BJMyS7_H.js";import{_ as Xe}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./createLucideIcon-CglWgwD8.js";const ge={list:()=>G.get("/api/reports"),get:a=>G.get(`/api/reports/${a}`),generate:a=>G.post("/api/reports/generate",a)};function ee(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let C=ee();function ye(a){C=a}const $e=/[&<>"']/,Ke=new RegExp($e.source,"g"),_e=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Je=new RegExp(_e.source,"g"),Ye={"&":"&","<":"<",">":">",'"':""","'":"'"},ke=a=>Ye[a];function b(a,t){if(t){if($e.test(a))return a.replace(Ke,ke)}else if(_e.test(a))return a.replace(Je,ke);return a}const et=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function tt(a){return a.replace(et,(t,e)=>(e=e.toLowerCase(),e==="colon"?":":e.charAt(0)==="#"?e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}const nt=/(^|[^\[])\^/g;function g(a,t){let e=typeof a=="string"?a:a.source;t=t||"";const n={replace:(i,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(nt,"$1"),e=e.replace(i,s),n},getRegex:()=>new RegExp(e,t)};return n}function xe(a){try{a=encodeURI(a).replace(/%25/g,"%")}catch{return null}return a}const q={exec:()=>null};function me(a,t){const e=a.replace(/\|/g,(r,s,l)=>{let o=!1,u=s;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),n=e.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length{const r=i.match(/^\s+/);if(r===null)return i;const[s]=r;return s.length>=n.length?i.slice(n.length):i}).join(` `)}class N{constructor(t){x(this,"options");x(this,"rules");x(this,"lexer");this.options=t||C}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:j(n,` `)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],i=it(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(/#$/.test(n)){const i=j(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=e[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` diff --git a/src/static/assets/SegmentedControl.vue_vue_type_script_setup_true_lang-CAqylCqr.js b/src/static/assets/SegmentedControl.vue_vue_type_script_setup_true_lang-t9SJyic6.js similarity index 95% rename from src/static/assets/SegmentedControl.vue_vue_type_script_setup_true_lang-CAqylCqr.js rename to src/static/assets/SegmentedControl.vue_vue_type_script_setup_true_lang-t9SJyic6.js index 7815fa3..faa3531 100644 --- a/src/static/assets/SegmentedControl.vue_vue_type_script_setup_true_lang-CAqylCqr.js +++ b/src/static/assets/SegmentedControl.vue_vue_type_script_setup_true_lang-t9SJyic6.js @@ -1 +1 @@ -import{c as d}from"./utils-7WVCegLb.js";import{d as c,c as s,F as m,r as f,o as a,n as p,h as g,k as v,l as b,i as x,q as h,t as k}from"./index-rN5A-UTe.js";const y=["aria-label"],V=["aria-pressed","onClick"],A=c({__name:"SegmentedControl",props:{modelValue:{},options:{},ariaLabel:{}},emits:["update:modelValue"],setup(t,{emit:i}){const o=t,l=i;function u(n){const r=o.options.findIndex(e=>e.value===o.modelValue);if(n.key==="ArrowRight"||n.key==="ArrowDown"){n.preventDefault();const e=o.options[(r+1)%o.options.length];l("update:modelValue",e.value)}else if(n.key==="ArrowLeft"||n.key==="ArrowUp"){n.preventDefault();const e=o.options[(r-1+o.options.length)%o.options.length];l("update:modelValue",e.value)}}return(n,r)=>(a(),s("div",{class:"inline-flex items-center rounded-lg border border-border bg-muted/40 p-1",role:"group","aria-label":t.ariaLabel,onKeydown:u},[(a(!0),s(m,null,f(t.options,e=>(a(),s("button",{key:e.value,type:"button","aria-pressed":t.modelValue===e.value,class:p(g(d)("inline-flex items-center gap-1.5 rounded-md px-3 h-8 text-xs font-medium transition-all","focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",t.modelValue===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground")),onClick:w=>l("update:modelValue",e.value)},[e.icon?(a(),v(b(e.icon),{key:0,class:"h-3.5 w-3.5"})):x("",!0),h(" "+k(e.label),1)],10,V))),128))],40,y))}});export{A as _}; +import{c as d}from"./utils-7WVCegLb.js";import{d as c,c as s,F as m,r as f,o as a,n as p,h as g,k as v,l as b,i as x,q as h,t as k}from"./index-Dj4QxrF8.js";const y=["aria-label"],V=["aria-pressed","onClick"],A=c({__name:"SegmentedControl",props:{modelValue:{},options:{},ariaLabel:{}},emits:["update:modelValue"],setup(t,{emit:i}){const o=t,l=i;function u(n){const r=o.options.findIndex(e=>e.value===o.modelValue);if(n.key==="ArrowRight"||n.key==="ArrowDown"){n.preventDefault();const e=o.options[(r+1)%o.options.length];l("update:modelValue",e.value)}else if(n.key==="ArrowLeft"||n.key==="ArrowUp"){n.preventDefault();const e=o.options[(r-1+o.options.length)%o.options.length];l("update:modelValue",e.value)}}return(n,r)=>(a(),s("div",{class:"inline-flex items-center rounded-lg border border-border bg-muted/40 p-1",role:"group","aria-label":t.ariaLabel,onKeydown:u},[(a(!0),s(m,null,f(t.options,e=>(a(),s("button",{key:e.value,type:"button","aria-pressed":t.modelValue===e.value,class:p(g(d)("inline-flex items-center gap-1.5 rounded-md px-3 h-8 text-xs font-medium transition-all","focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",t.modelValue===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground")),onClick:w=>l("update:modelValue",e.value)},[e.icon?(a(),v(b(e.icon),{key:0,class:"h-3.5 w-3.5"})):x("",!0),h(" "+k(e.label),1)],10,V))),128))],40,y))}});export{A as _}; diff --git a/src/static/assets/SettingsView-CuZ9KN7E.js b/src/static/assets/SettingsView-BQsCH9JJ.js similarity index 94% rename from src/static/assets/SettingsView-CuZ9KN7E.js rename to src/static/assets/SettingsView-BQsCH9JJ.js index 1ed7be6..3f769d2 100644 --- a/src/static/assets/SettingsView-CuZ9KN7E.js +++ b/src/static/assets/SettingsView-BQsCH9JJ.js @@ -1 +1 @@ -import{d as Q,s as x,o as h,c as _,a as f,e as d,h as v,t as S,F as j,r as L,n as W,j as V,x as re,k as se,w as c,P as ue,Q as ie,S as de,i as le,q as w,V as fe,u as ce,A as me,D as ve,K as R}from"./index-rN5A-UTe.js";import{u as pe}from"./devops-DzkXDmpg.js";import{_ as B,a as H}from"./CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js";import{_ as Y,a as K}from"./CardTitle.vue_vue_type_script_setup_true_lang-CugNHrdd.js";import{_ as J}from"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import{_ as k}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{c as q,i as X}from"./utils-7WVCegLb.js";import{t as b,c as U,s as Z,C as ge,a as be,f as $}from"./format-gWy7j8JO.js";import{C as ye}from"./calendar-GhZPhKWb.js";import{_ as he}from"./DevopsConnectForm.vue_vue_type_script_setup_true_lang-BzwbMDjx.js";import"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";import"./createLucideIcon-BQqEiwZb.js";import"./ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js";function _e(l,s){const o=b(l);return isNaN(s)?U(l,NaN):(s&&o.setDate(o.getDate()+s),o)}function ae(l,s){const o=b(l);if(isNaN(s))return U(l,NaN);if(!s)return o;const r=o.getDate(),u=U(l,o.getTime());u.setMonth(o.getMonth()+s+1,0);const i=u.getDate();return r>=i?u:(o.setFullYear(u.getFullYear(),u.getMonth(),r),o)}function xe(l){return U(l,Date.now())}function I(l,s){const o=Z(l),r=Z(s);return+o==+r}function Me(l){const s=b(l),o=s.getMonth();return s.setFullYear(s.getFullYear(),o+1,0),s.setHours(23,59,59,999),s}function we(l,s){const o=b(l.start),r=b(l.end);let u=+o>+r;const i=u?+o:+r,m=u?r:o;m.setHours(0,0,0,0);let g=1;const M=[];for(;+m<=i;)M.push(b(m)),m.setDate(m.getDate()+g),m.setHours(0,0,0,0);return u?M.reverse():M}function A(l){const s=b(l);return s.setDate(1),s.setHours(0,0,0,0),s}function De(l){return b(l).getDay()}function ee(l,s){const o=b(l),r=b(s);return+o<+r}function Ve(l){return I(l,xe(l))}function te(l,s){const o=+b(l),[r,u]=[+b(s.start),+b(s.end)].sort((i,m)=>i-m);return o>=r&&o<=u}function oe(l,s){return _e(l,-s)}function $e(l,s){return ae(l,-1)}const Ce={class:"p-3 select-none"},ke={class:"mb-3 flex items-center justify-between"},Se={class:"text-sm font-medium"},Ne={class:"mb-1 grid grid-cols-7 gap-1"},Te={class:"grid grid-cols-7 gap-1"},Ee=["onClick","onMouseenter","aria-label","aria-pressed"],ne=Q({__name:"Calendar",props:{modelValue:{default:()=>({from:null,to:null})},mode:{default:"range"},initialMonth:{}},emits:["update:modelValue"],setup(l,{emit:s}){const o=l,r=s,u=x(o.initialMonth??new Date),i=x(null),m=["Mo","Tu","We","Th","Fr","Sa","Su"],g=V(()=>$(u.value,"MMMM yyyy")),M=V(()=>{const e=A(u.value),n=Me(u.value);return we({start:e,end:n})}),z=V(()=>{const e=De(A(u.value));return e===0?6:e-1});function D(){u.value=$e(u.value)}function a(){u.value=ae(u.value,1)}function p(e){return e.getMonth()!==u.value.getMonth()}function N(e){return Ve(e)}function C(e){return T(e)||E(e)}function T(e){var n;return(n=o.modelValue)!=null&&n.from?I(e,o.modelValue.from):!1}function E(e){var n;return(n=o.modelValue)!=null&&n.to?I(e,o.modelValue.to):!1}function P(e){const{from:n,to:t}=o.modelValue??{};return!n||!t?!1:te(e,{start:n,end:t})&&!I(e,n)&&!I(e,t)}function O(e){var y,G;const n=(y=o.modelValue)==null?void 0:y.from;if(!n||(G=o.modelValue)!=null&&G.to||!i.value)return!1;const t=i.value;return ee(t,n)?!1:te(e,{start:n,end:t})}function F(e){if(o.mode==="single"){r("update:modelValue",{from:e,to:e});return}const{from:n,to:t}=o.modelValue??{};!n||n&&t?r("update:modelValue",{from:e,to:null}):ee(e,n)?r("update:modelValue",{from:e,to:n}):r("update:modelValue",{from:n,to:e})}return(e,n)=>(h(),_("div",Ce,[f("div",ke,[f("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",onClick:D,"aria-label":"Previous month"},[d(v(ge),{class:"h-4 w-4"})]),f("span",Se,S(g.value),1),f("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",onClick:a,"aria-label":"Next month"},[d(v(be),{class:"h-4 w-4"})])]),f("div",Ne,[(h(),_(j,null,L(m,t=>f("div",{key:t,class:"flex h-8 items-center justify-center text-[11px] font-medium uppercase tracking-wide text-muted-foreground"},S(t),1)),64))]),f("div",Te,[(h(!0),_(j,null,L(z.value,t=>(h(),_("div",{key:"blank-"+t}))),128)),(h(!0),_(j,null,L(M.value,t=>(h(),_("button",{key:t.toISOString(),type:"button",class:W(v(q)("flex h-9 w-9 items-center justify-center rounded-md text-sm transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",p(t)&&"text-muted-foreground/40",N(t)&&!C(t)&&"ring-1 ring-primary",T(t)&&"rounded-l-md bg-primary text-primary-foreground",E(t)&&"rounded-r-md bg-primary text-primary-foreground",P(t)&&!T(t)&&!E(t)&&"bg-primary/15 rounded-none",O(t)&&!P(t)&&!C(t)&&"bg-primary/10",!C(t)&&!P(t)&&!O(t)&&"hover:bg-accent")),onClick:y=>F(t),onMouseenter:y=>i.value=t,onMouseleave:n[0]||(n[0]=y=>i.value=null),"aria-label":v($)(t,"EEEE, MMMM d, yyyy"),"aria-pressed":C(t)},S(v($)(t,"d")),43,Ee))),128))])]))}}),Pe={class:"flex"},Oe={class:"flex w-36 flex-col border-r border-border p-2 gap-1"},Ie=["onClick"],ze={class:"flex flex-col"},Fe={class:"flex"},Re={class:"border-l border-border"},je={key:0,class:"px-4 pb-2 text-xs text-destructive"},Le={class:"flex items-center justify-end gap-2 border-t border-border px-4 py-3"},Ue=Q({__name:"DateRangePicker",props:{modelValue:{default:()=>({from:null,to:null})}},emits:["update:modelValue"],setup(l,{emit:s}){var O,F;const o=l,r=s,u=x(!1),i=x({from:((O=o.modelValue)==null?void 0:O.from)??null,to:((F=o.modelValue)==null?void 0:F.to)??null}),m=new Date,g=V(()=>A(i.value.from??m)),M=V(()=>{const e=new Date(g.value);return e.setMonth(e.getMonth()+1),e}),D=[{value:"today",label:"Today"},{value:"last7",label:"Last 7 days"},{value:"last30",label:"Last 30 days"},{value:"thisMonth",label:"This month"},{value:"custom",label:"Custom"}],a=x("custom");function p(e){if(a.value=e,e==="custom")return;const n=new Date;let t,y;if(e==="today")t=n,y=n;else if(e==="last7")t=oe(n,6),y=n;else if(e==="last30")t=oe(n,29),y=n;else if(e==="thisMonth")t=A(n),y=n;else return;i.value={from:t,to:y}}const N=V(()=>i.value.from&&i.value.to&&i.value.from>i.value.to?"End date must be after start date":null),C=V(()=>i.value.from!==null&&i.value.to!==null&&!N.value),T=V(()=>{const{from:e,to:n}=o.modelValue??{};return e?!n||e.getTime()===n.getTime()?$(e,"MMM d, yyyy"):`${$(e,"MMM d")} – ${$(n,"MMM d, yyyy")}`:"Pick a date range"});function E(){C.value&&(r("update:modelValue",{from:i.value.from,to:i.value.to}),u.value=!1)}function P(){var e,n;i.value={from:((e=o.modelValue)==null?void 0:e.from)??null,to:((n=o.modelValue)==null?void 0:n.to)??null},u.value=!1}return re(()=>o.modelValue,e=>{i.value={from:(e==null?void 0:e.from)??null,to:(e==null?void 0:e.to)??null}},{deep:!0}),(e,n)=>(h(),se(v(fe),{open:u.value,"onUpdate:open":n[2]||(n[2]=t=>u.value=t)},{default:c(()=>[d(v(ue),{"as-child":""},{default:c(()=>{var t;return[d(k,{variant:"outline",class:W(v(q)("w-full justify-start gap-2 text-left font-normal",!((t=l.modelValue)!=null&&t.from)&&"text-muted-foreground"))},{default:c(()=>[d(v(ye),{class:"h-4 w-4 shrink-0"}),f("span",null,S(T.value),1)]),_:1},8,["class"])]}),_:1}),d(v(ie),null,{default:c(()=>[d(v(de),{"side-offset":8,class:"z-50 w-auto rounded-xl border border-border bg-popover p-0 shadow-xl animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"},{default:c(()=>[f("div",Pe,[f("div",Oe,[(h(!0),_(j,null,L(v(D),t=>(h(),_("button",{key:t.value,type:"button",class:W(v(q)("rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",a.value===t.value&&"bg-primary/10 font-medium text-primary")),onClick:y=>p(t.value)},S(t.label),11,Ie))),128))]),f("div",ze,[f("div",Fe,[d(ne,{modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=t=>i.value=t),"initial-month":g.value,mode:"range"},null,8,["modelValue","initial-month"]),f("div",Re,[d(ne,{modelValue:i.value,"onUpdate:modelValue":n[1]||(n[1]=t=>i.value=t),"initial-month":M.value,mode:"range"},null,8,["modelValue","initial-month"])])]),N.value?(h(),_("p",je,S(N.value),1)):le("",!0),f("div",Le,[d(k,{variant:"ghost",size:"sm",onClick:P},{default:c(()=>[...n[3]||(n[3]=[w("Cancel",-1)])]),_:1}),d(k,{size:"sm",disabled:!C.value,onClick:E},{default:c(()=>[...n[4]||(n[4]=[w("Apply",-1)])]),_:1},8,["disabled"])])])])]),_:1})]),_:1})]),_:1},8,["open"]))}});function Ae(l,s){const o=`/cc-dashboard/api/export/timesheet.csv?from=${l}&to=${s}`,r=document.createElement("a");r.href=o,r.download=`timesheet-${l}-${s}.csv`,r.click()}function Be(l,s){const o=`/cc-dashboard/api/export/timesheet.ics?from=${l}&to=${s}`,r=document.createElement("a");r.href=o,r.download=`timesheet-${l}-${s}.ics`,r.click()}const He={class:"p-6 space-y-8 max-w-2xl"},Ye={class:"space-y-2"},Ke={class:"space-y-2"},We={class:"flex items-center justify-between"},qe={class:"space-y-2"},Qe={class:"flex items-center gap-2"},it=Q({__name:"SettingsView",setup(l){const s=ce(),o=pe(),r=x(""),u=x(0),i=x(!1),m=x(""),g=x("");me(()=>{s.user&&(r.value=s.user.username,u.value=s.user.daily_overhead_hours??0),o.fetchIntegration();const D=new Date;g.value=X(D);const a=new Date(D);a.setDate(D.getDate()-30),m.value=X(a)});async function M(){i.value=!0;try{await ve.patch("/api/auth/me",{username:r.value,daily_overhead_hours:u.value}),await s.fetchMe(),R.success("Profile saved")}catch{R.error("Failed to save profile")}finally{i.value=!1}}async function z(){try{await o.sync(),R.success("Sync complete")}catch{R.error(o.error??"Sync failed")}}return(D,a)=>(h(),_("div",He,[a[16]||(a[16]=f("h2",{class:"text-lg font-semibold text-foreground"},"Settings",-1)),d(B,null,{default:c(()=>[d(Y,null,{default:c(()=>[d(K,{class:"text-sm"},{default:c(()=>[...a[5]||(a[5]=[w("Profile",-1)])]),_:1})]),_:1}),d(H,{class:"space-y-6"},{default:c(()=>[f("div",Ye,[a[6]||(a[6]=f("label",{class:"text-sm font-medium text-foreground"},"Username",-1)),d(J,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=p=>r.value=p),placeholder:"username"},null,8,["modelValue"])]),f("div",Ke,[a[7]||(a[7]=f("label",{class:"text-sm font-medium text-foreground"},"Daily Overhead Hours",-1)),d(J,{modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=p=>u.value=p),type:"number",min:"0",max:"8",step:"0.25",class:"w-32"},null,8,["modelValue"]),a[8]||(a[8]=f("p",{class:"text-xs text-muted-foreground"}," Hours per day to add for overhead / meetings ",-1))]),d(k,{loading:i.value,class:"focus-visible:ring-2 focus-visible:ring-ring",onClick:M},{default:c(()=>[...a[9]||(a[9]=[w("Save Profile",-1)])]),_:1},8,["loading"])]),_:1})]),_:1}),d(B,null,{default:c(()=>[d(Y,null,{default:c(()=>[f("div",We,[d(K,{class:"text-sm"},{default:c(()=>[...a[10]||(a[10]=[w("Azure DevOps Integration",-1)])]),_:1}),v(o).integration?(h(),se(k,{key:0,variant:"outline",size:"sm",loading:v(o).syncing,class:"focus-visible:ring-2 focus-visible:ring-ring",onClick:z},{default:c(()=>[...a[11]||(a[11]=[w(" Sync Now ",-1)])]),_:1},8,["loading"])):le("",!0)])]),_:1}),d(H,null,{default:c(()=>[d(he)]),_:1})]),_:1}),d(B,null,{default:c(()=>[d(Y,null,{default:c(()=>[d(K,{class:"text-sm"},{default:c(()=>[...a[12]||(a[12]=[w("Export",-1)])]),_:1})]),_:1}),d(H,{class:"space-y-6"},{default:c(()=>[f("div",qe,[a[13]||(a[13]=f("label",{class:"text-sm font-medium text-foreground"},"Date range",-1)),d(Ue,{"model-value":{from:m.value?new Date(m.value):null,to:g.value?new Date(g.value):null},"onUpdate:modelValue":a[2]||(a[2]=p=>{m.value=p.from?v($)(p.from,"yyyy-MM-dd"):"",g.value=p.to?v($)(p.to,"yyyy-MM-dd"):""})},null,8,["model-value"])]),f("div",Qe,[d(k,{variant:"outline",size:"sm",class:"focus-visible:ring-2 focus-visible:ring-ring",onClick:a[3]||(a[3]=p=>v(Ae)(m.value,g.value))},{default:c(()=>[...a[14]||(a[14]=[w(" Download CSV ",-1)])]),_:1}),d(k,{variant:"outline",size:"sm",class:"focus-visible:ring-2 focus-visible:ring-ring",onClick:a[4]||(a[4]=p=>v(Be)(m.value,g.value))},{default:c(()=>[...a[15]||(a[15]=[w(" Download ICS ",-1)])]),_:1})])]),_:1})]),_:1})]))}});export{it as default}; +import{d as Q,s as x,o as h,c as _,a as f,e as d,h as v,t as S,F as j,r as L,n as W,j as V,x as re,k as se,w as c,P as ue,Q as ie,S as de,i as le,q as w,V as fe,u as ce,A as me,D as ve,K as R}from"./index-Dj4QxrF8.js";import{u as pe}from"./devops-CgM36Koe.js";import{_ as B,a as H}from"./CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js";import{_ as Y,a as K}from"./CardTitle.vue_vue_type_script_setup_true_lang-BMHIwlxU.js";import{_ as J}from"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import{_ as k}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{c as q,i as X}from"./utils-7WVCegLb.js";import{t as b,c as U,s as Z,C as ge,a as be,f as $}from"./format-DscROiV-.js";import{C as ye}from"./calendar-BJMyS7_H.js";import{_ as he}from"./DevopsConnectForm.vue_vue_type_script_setup_true_lang-Bv-vOrXl.js";import"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";import"./createLucideIcon-CglWgwD8.js";import"./ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js";function _e(l,s){const o=b(l);return isNaN(s)?U(l,NaN):(s&&o.setDate(o.getDate()+s),o)}function ae(l,s){const o=b(l);if(isNaN(s))return U(l,NaN);if(!s)return o;const r=o.getDate(),u=U(l,o.getTime());u.setMonth(o.getMonth()+s+1,0);const i=u.getDate();return r>=i?u:(o.setFullYear(u.getFullYear(),u.getMonth(),r),o)}function xe(l){return U(l,Date.now())}function I(l,s){const o=Z(l),r=Z(s);return+o==+r}function Me(l){const s=b(l),o=s.getMonth();return s.setFullYear(s.getFullYear(),o+1,0),s.setHours(23,59,59,999),s}function we(l,s){const o=b(l.start),r=b(l.end);let u=+o>+r;const i=u?+o:+r,m=u?r:o;m.setHours(0,0,0,0);let g=1;const M=[];for(;+m<=i;)M.push(b(m)),m.setDate(m.getDate()+g),m.setHours(0,0,0,0);return u?M.reverse():M}function A(l){const s=b(l);return s.setDate(1),s.setHours(0,0,0,0),s}function De(l){return b(l).getDay()}function ee(l,s){const o=b(l),r=b(s);return+o<+r}function Ve(l){return I(l,xe(l))}function te(l,s){const o=+b(l),[r,u]=[+b(s.start),+b(s.end)].sort((i,m)=>i-m);return o>=r&&o<=u}function oe(l,s){return _e(l,-s)}function $e(l,s){return ae(l,-1)}const Ce={class:"p-3 select-none"},ke={class:"mb-3 flex items-center justify-between"},Se={class:"text-sm font-medium"},Ne={class:"mb-1 grid grid-cols-7 gap-1"},Te={class:"grid grid-cols-7 gap-1"},Ee=["onClick","onMouseenter","aria-label","aria-pressed"],ne=Q({__name:"Calendar",props:{modelValue:{default:()=>({from:null,to:null})},mode:{default:"range"},initialMonth:{}},emits:["update:modelValue"],setup(l,{emit:s}){const o=l,r=s,u=x(o.initialMonth??new Date),i=x(null),m=["Mo","Tu","We","Th","Fr","Sa","Su"],g=V(()=>$(u.value,"MMMM yyyy")),M=V(()=>{const e=A(u.value),n=Me(u.value);return we({start:e,end:n})}),z=V(()=>{const e=De(A(u.value));return e===0?6:e-1});function D(){u.value=$e(u.value)}function a(){u.value=ae(u.value,1)}function p(e){return e.getMonth()!==u.value.getMonth()}function N(e){return Ve(e)}function C(e){return T(e)||E(e)}function T(e){var n;return(n=o.modelValue)!=null&&n.from?I(e,o.modelValue.from):!1}function E(e){var n;return(n=o.modelValue)!=null&&n.to?I(e,o.modelValue.to):!1}function P(e){const{from:n,to:t}=o.modelValue??{};return!n||!t?!1:te(e,{start:n,end:t})&&!I(e,n)&&!I(e,t)}function O(e){var y,G;const n=(y=o.modelValue)==null?void 0:y.from;if(!n||(G=o.modelValue)!=null&&G.to||!i.value)return!1;const t=i.value;return ee(t,n)?!1:te(e,{start:n,end:t})}function F(e){if(o.mode==="single"){r("update:modelValue",{from:e,to:e});return}const{from:n,to:t}=o.modelValue??{};!n||n&&t?r("update:modelValue",{from:e,to:null}):ee(e,n)?r("update:modelValue",{from:e,to:n}):r("update:modelValue",{from:n,to:e})}return(e,n)=>(h(),_("div",Ce,[f("div",ke,[f("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",onClick:D,"aria-label":"Previous month"},[d(v(ge),{class:"h-4 w-4"})]),f("span",Se,S(g.value),1),f("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",onClick:a,"aria-label":"Next month"},[d(v(be),{class:"h-4 w-4"})])]),f("div",Ne,[(h(),_(j,null,L(m,t=>f("div",{key:t,class:"flex h-8 items-center justify-center text-[11px] font-medium uppercase tracking-wide text-muted-foreground"},S(t),1)),64))]),f("div",Te,[(h(!0),_(j,null,L(z.value,t=>(h(),_("div",{key:"blank-"+t}))),128)),(h(!0),_(j,null,L(M.value,t=>(h(),_("button",{key:t.toISOString(),type:"button",class:W(v(q)("flex h-9 w-9 items-center justify-center rounded-md text-sm transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",p(t)&&"text-muted-foreground/40",N(t)&&!C(t)&&"ring-1 ring-primary",T(t)&&"rounded-l-md bg-primary text-primary-foreground",E(t)&&"rounded-r-md bg-primary text-primary-foreground",P(t)&&!T(t)&&!E(t)&&"bg-primary/15 rounded-none",O(t)&&!P(t)&&!C(t)&&"bg-primary/10",!C(t)&&!P(t)&&!O(t)&&"hover:bg-accent")),onClick:y=>F(t),onMouseenter:y=>i.value=t,onMouseleave:n[0]||(n[0]=y=>i.value=null),"aria-label":v($)(t,"EEEE, MMMM d, yyyy"),"aria-pressed":C(t)},S(v($)(t,"d")),43,Ee))),128))])]))}}),Pe={class:"flex"},Oe={class:"flex w-36 flex-col border-r border-border p-2 gap-1"},Ie=["onClick"],ze={class:"flex flex-col"},Fe={class:"flex"},Re={class:"border-l border-border"},je={key:0,class:"px-4 pb-2 text-xs text-destructive"},Le={class:"flex items-center justify-end gap-2 border-t border-border px-4 py-3"},Ue=Q({__name:"DateRangePicker",props:{modelValue:{default:()=>({from:null,to:null})}},emits:["update:modelValue"],setup(l,{emit:s}){var O,F;const o=l,r=s,u=x(!1),i=x({from:((O=o.modelValue)==null?void 0:O.from)??null,to:((F=o.modelValue)==null?void 0:F.to)??null}),m=new Date,g=V(()=>A(i.value.from??m)),M=V(()=>{const e=new Date(g.value);return e.setMonth(e.getMonth()+1),e}),D=[{value:"today",label:"Today"},{value:"last7",label:"Last 7 days"},{value:"last30",label:"Last 30 days"},{value:"thisMonth",label:"This month"},{value:"custom",label:"Custom"}],a=x("custom");function p(e){if(a.value=e,e==="custom")return;const n=new Date;let t,y;if(e==="today")t=n,y=n;else if(e==="last7")t=oe(n,6),y=n;else if(e==="last30")t=oe(n,29),y=n;else if(e==="thisMonth")t=A(n),y=n;else return;i.value={from:t,to:y}}const N=V(()=>i.value.from&&i.value.to&&i.value.from>i.value.to?"End date must be after start date":null),C=V(()=>i.value.from!==null&&i.value.to!==null&&!N.value),T=V(()=>{const{from:e,to:n}=o.modelValue??{};return e?!n||e.getTime()===n.getTime()?$(e,"MMM d, yyyy"):`${$(e,"MMM d")} – ${$(n,"MMM d, yyyy")}`:"Pick a date range"});function E(){C.value&&(r("update:modelValue",{from:i.value.from,to:i.value.to}),u.value=!1)}function P(){var e,n;i.value={from:((e=o.modelValue)==null?void 0:e.from)??null,to:((n=o.modelValue)==null?void 0:n.to)??null},u.value=!1}return re(()=>o.modelValue,e=>{i.value={from:(e==null?void 0:e.from)??null,to:(e==null?void 0:e.to)??null}},{deep:!0}),(e,n)=>(h(),se(v(fe),{open:u.value,"onUpdate:open":n[2]||(n[2]=t=>u.value=t)},{default:c(()=>[d(v(ue),{"as-child":""},{default:c(()=>{var t;return[d(k,{variant:"outline",class:W(v(q)("w-full justify-start gap-2 text-left font-normal",!((t=l.modelValue)!=null&&t.from)&&"text-muted-foreground"))},{default:c(()=>[d(v(ye),{class:"h-4 w-4 shrink-0"}),f("span",null,S(T.value),1)]),_:1},8,["class"])]}),_:1}),d(v(ie),null,{default:c(()=>[d(v(de),{"side-offset":8,class:"z-50 w-auto rounded-xl border border-border bg-popover p-0 shadow-xl animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"},{default:c(()=>[f("div",Pe,[f("div",Oe,[(h(!0),_(j,null,L(v(D),t=>(h(),_("button",{key:t.value,type:"button",class:W(v(q)("rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",a.value===t.value&&"bg-primary/10 font-medium text-primary")),onClick:y=>p(t.value)},S(t.label),11,Ie))),128))]),f("div",ze,[f("div",Fe,[d(ne,{modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=t=>i.value=t),"initial-month":g.value,mode:"range"},null,8,["modelValue","initial-month"]),f("div",Re,[d(ne,{modelValue:i.value,"onUpdate:modelValue":n[1]||(n[1]=t=>i.value=t),"initial-month":M.value,mode:"range"},null,8,["modelValue","initial-month"])])]),N.value?(h(),_("p",je,S(N.value),1)):le("",!0),f("div",Le,[d(k,{variant:"ghost",size:"sm",onClick:P},{default:c(()=>[...n[3]||(n[3]=[w("Cancel",-1)])]),_:1}),d(k,{size:"sm",disabled:!C.value,onClick:E},{default:c(()=>[...n[4]||(n[4]=[w("Apply",-1)])]),_:1},8,["disabled"])])])])]),_:1})]),_:1})]),_:1},8,["open"]))}});function Ae(l,s){const o=`/cc-dashboard/api/export/timesheet.csv?from=${l}&to=${s}`,r=document.createElement("a");r.href=o,r.download=`timesheet-${l}-${s}.csv`,r.click()}function Be(l,s){const o=`/cc-dashboard/api/export/timesheet.ics?from=${l}&to=${s}`,r=document.createElement("a");r.href=o,r.download=`timesheet-${l}-${s}.ics`,r.click()}const He={class:"p-6 space-y-8 max-w-2xl"},Ye={class:"space-y-2"},Ke={class:"space-y-2"},We={class:"flex items-center justify-between"},qe={class:"space-y-2"},Qe={class:"flex items-center gap-2"},it=Q({__name:"SettingsView",setup(l){const s=ce(),o=pe(),r=x(""),u=x(0),i=x(!1),m=x(""),g=x("");me(()=>{s.user&&(r.value=s.user.username,u.value=s.user.daily_overhead_hours??0),o.fetchIntegration();const D=new Date;g.value=X(D);const a=new Date(D);a.setDate(D.getDate()-30),m.value=X(a)});async function M(){i.value=!0;try{await ve.patch("/api/auth/me",{username:r.value,daily_overhead_hours:u.value}),await s.fetchMe(),R.success("Profile saved")}catch{R.error("Failed to save profile")}finally{i.value=!1}}async function z(){try{await o.sync(),R.success("Sync complete")}catch{R.error(o.error??"Sync failed")}}return(D,a)=>(h(),_("div",He,[a[16]||(a[16]=f("h2",{class:"text-lg font-semibold text-foreground"},"Settings",-1)),d(B,null,{default:c(()=>[d(Y,null,{default:c(()=>[d(K,{class:"text-sm"},{default:c(()=>[...a[5]||(a[5]=[w("Profile",-1)])]),_:1})]),_:1}),d(H,{class:"space-y-6"},{default:c(()=>[f("div",Ye,[a[6]||(a[6]=f("label",{class:"text-sm font-medium text-foreground"},"Username",-1)),d(J,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=p=>r.value=p),placeholder:"username"},null,8,["modelValue"])]),f("div",Ke,[a[7]||(a[7]=f("label",{class:"text-sm font-medium text-foreground"},"Daily Overhead Hours",-1)),d(J,{modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=p=>u.value=p),type:"number",min:"0",max:"8",step:"0.25",class:"w-32"},null,8,["modelValue"]),a[8]||(a[8]=f("p",{class:"text-xs text-muted-foreground"}," Hours per day to add for overhead / meetings ",-1))]),d(k,{loading:i.value,class:"focus-visible:ring-2 focus-visible:ring-ring",onClick:M},{default:c(()=>[...a[9]||(a[9]=[w("Save Profile",-1)])]),_:1},8,["loading"])]),_:1})]),_:1}),d(B,null,{default:c(()=>[d(Y,null,{default:c(()=>[f("div",We,[d(K,{class:"text-sm"},{default:c(()=>[...a[10]||(a[10]=[w("Azure DevOps Integration",-1)])]),_:1}),v(o).integration?(h(),se(k,{key:0,variant:"outline",size:"sm",loading:v(o).syncing,class:"focus-visible:ring-2 focus-visible:ring-ring",onClick:z},{default:c(()=>[...a[11]||(a[11]=[w(" Sync Now ",-1)])]),_:1},8,["loading"])):le("",!0)])]),_:1}),d(H,null,{default:c(()=>[d(he)]),_:1})]),_:1}),d(B,null,{default:c(()=>[d(Y,null,{default:c(()=>[d(K,{class:"text-sm"},{default:c(()=>[...a[12]||(a[12]=[w("Export",-1)])]),_:1})]),_:1}),d(H,{class:"space-y-6"},{default:c(()=>[f("div",qe,[a[13]||(a[13]=f("label",{class:"text-sm font-medium text-foreground"},"Date range",-1)),d(Ue,{"model-value":{from:m.value?new Date(m.value):null,to:g.value?new Date(g.value):null},"onUpdate:modelValue":a[2]||(a[2]=p=>{m.value=p.from?v($)(p.from,"yyyy-MM-dd"):"",g.value=p.to?v($)(p.to,"yyyy-MM-dd"):""})},null,8,["model-value"])]),f("div",Qe,[d(k,{variant:"outline",size:"sm",class:"focus-visible:ring-2 focus-visible:ring-ring",onClick:a[3]||(a[3]=p=>v(Ae)(m.value,g.value))},{default:c(()=>[...a[14]||(a[14]=[w(" Download CSV ",-1)])]),_:1}),d(k,{variant:"outline",size:"sm",class:"focus-visible:ring-2 focus-visible:ring-ring",onClick:a[4]||(a[4]=p=>v(Be)(m.value,g.value))},{default:c(()=>[...a[15]||(a[15]=[w(" Download ICS ",-1)])]),_:1})])]),_:1})]),_:1})]))}});export{it as default}; diff --git a/src/static/assets/Skeleton.vue_vue_type_script_setup_true_lang-DvqtZljC.js b/src/static/assets/Skeleton.vue_vue_type_script_setup_true_lang-DhWXp9By.js similarity index 77% rename from src/static/assets/Skeleton.vue_vue_type_script_setup_true_lang-DvqtZljC.js rename to src/static/assets/Skeleton.vue_vue_type_script_setup_true_lang-DhWXp9By.js index 3348f78..ec17a7a 100644 --- a/src/static/assets/Skeleton.vue_vue_type_script_setup_true_lang-DvqtZljC.js +++ b/src/static/assets/Skeleton.vue_vue_type_script_setup_true_lang-DhWXp9By.js @@ -1 +1 @@ -import{c as s}from"./utils-7WVCegLb.js";import{d as r,o as t,c as n,m as o,h as a}from"./index-rN5A-UTe.js";const i=r({inheritAttrs:!1,__name:"Skeleton",setup(m){return(e,c)=>(t(),n("div",o(e.$attrs,{class:a(s)("skeleton-shimmer rounded-md",e.$attrs.class)}),null,16))}});export{i as _}; +import{c as s}from"./utils-7WVCegLb.js";import{d as r,o as t,c as n,m as o,h as a}from"./index-Dj4QxrF8.js";const i=r({inheritAttrs:!1,__name:"Skeleton",setup(m){return(e,c)=>(t(),n("div",o(e.$attrs,{class:a(s)("skeleton-shimmer rounded-md",e.$attrs.class)}),null,16))}});export{i as _}; diff --git a/src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js b/src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js similarity index 90% rename from src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js rename to src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js index f1421d8..357d886 100644 --- a/src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js +++ b/src/static/assets/Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js @@ -1 +1 @@ -import{d as l,o as n,c as o,n as t,a as r}from"./index-rN5A-UTe.js";const i=l({__name:"Spinner",props:{size:{},class:{}},setup(s){return(a,e)=>(n(),o("svg",{class:t(["animate-spin text-current",s.size==="sm"?"h-3 w-3":s.size==="lg"?"h-6 w-6":"h-4 w-4",a.$props.class]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...e[0]||(e[0]=[r("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),r("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])],2))}});export{i as _}; +import{d as l,o as n,c as o,n as t,a as r}from"./index-Dj4QxrF8.js";const i=l({__name:"Spinner",props:{size:{},class:{}},setup(s){return(a,e)=>(n(),o("svg",{class:t(["animate-spin text-current",s.size==="sm"?"h-3 w-3":s.size==="lg"?"h-6 w-6":"h-4 w-4",a.$props.class]),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[...e[0]||(e[0]=[r("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),r("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])],2))}});export{i as _}; diff --git a/src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-gqrw8v69.js b/src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-cQ4nGVcO.js similarity index 93% rename from src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-gqrw8v69.js rename to src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-cQ4nGVcO.js index 0b0311e..c9f259d 100644 --- a/src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-gqrw8v69.js +++ b/src/static/assets/TaskForm.vue_vue_type_script_setup_true_lang-cQ4nGVcO.js @@ -1 +1 @@ -import{d as C,c as r,n as U,h as c,t as _,i as x,p as z,o as n,B as D,s as y,A as T,x as N,k as B,w as u,a as l,e as i,q as V,F as j,r as S,C as I}from"./index-rN5A-UTe.js";import{_ as P}from"./Dialog.vue_vue_type_script_setup_true_lang-5tIAaGh4.js";import{_ as b}from"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import{_ as A}from"./Textarea.vue_vue_type_script_setup_true_lang-MCF8JR3D.js";import{c as E}from"./utils-7WVCegLb.js";import{_ as $}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{u as F}from"./devops-DzkXDmpg.js";import{p as L}from"./projects-COzvhtq2.js";const M=["id","value","disabled"],O=["selected"],k=C({__name:"Select",props:{modelValue:{},disabled:{type:Boolean},class:{},id:{},placeholder:{}},emits:["update:modelValue","change"],setup(o,{emit:m}){const s=o,v=m;return(p,f)=>(n(),r("select",{id:o.id,value:o.modelValue,disabled:o.disabled,class:U(c(E)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",s.class)),onChange:f[0]||(f[0]=t=>v("update:modelValue",t.target.value))},[o.placeholder?(n(),r("option",{key:0,value:"",disabled:"",selected:!o.modelValue},_(o.placeholder),9,O)):x("",!0),z(p.$slots,"default")],42,M))}}),W=D("projects",()=>{const o=y([]),m=y(!1);async function s(){if(!(o.value.length>0)){m.value=!0;try{const v=await L.list();o.value=v.data}catch{o.value=[]}finally{m.value=!1}}}return{projects:o,loading:m,fetchProjects:s}}),q={class:"space-y-1.5"},H={class:"space-y-1.5"},G={class:"grid grid-cols-2 gap-3"},J={class:"space-y-1.5"},K={class:"space-y-1.5"},Q={class:"grid grid-cols-2 gap-3"},R={class:"space-y-1.5"},X={class:"space-y-1.5"},Y={class:"grid grid-cols-2 gap-3"},Z={class:"space-y-1.5"},h={class:"space-y-1.5"},ee={key:0,class:"space-y-1.5"},te=["value"],le={key:1,class:"space-y-1.5"},ae=["value"],ve=C({__name:"TaskForm",props:{open:{type:Boolean},task:{default:null},defaultDate:{}},emits:["close","save"],setup(o,{emit:m}){const s=o,v=m,p=F(),f=W();T(()=>{f.fetchProjects()});const t=y({title:"",notes:"",planned_date:"",start_time:"",end_time:"",estimate_hours:1,status:"todo",priority:3,project_id:void 0,azure_work_item_id:void 0});N(()=>s.open,g=>{g&&(s.task?t.value={title:s.task.title,notes:s.task.notes??"",planned_date:s.task.planned_date??"",start_time:"",end_time:"",estimate_hours:s.task.estimate_hours??1,status:s.task.status,priority:s.task.priority,project_id:s.task.project_id??void 0,azure_work_item_id:s.task.azure_work_item_id??void 0}:t.value={title:"",notes:"",planned_date:s.defaultDate??"",start_time:"",end_time:"",estimate_hours:1,status:"todo",priority:3,project_id:void 0,azure_work_item_id:void 0},p.integration&&!p.workItems.length&&p.fetchWorkItems("open"))},{immediate:!0});const d=y(!1);async function w(){if(t.value.title.trim()){d.value=!0;try{const g={title:t.value.title,notes:t.value.notes||void 0,planned_date:t.value.planned_date,estimate_hours:t.value.estimate_hours,status:t.value.status,priority:t.value.priority,project_id:t.value.project_id||null,azure_work_item_id:t.value.azure_work_item_id||null};let e;t.value.planned_date&&t.value.start_time&&t.value.end_time&&(e={start_at:new Date(`${t.value.planned_date}T${t.value.start_time}:00`).toISOString(),end_at:new Date(`${t.value.planned_date}T${t.value.end_time}:00`).toISOString()}),v("save",g,e)}finally{d.value=!1}}}return(g,e)=>(n(),B(P,{open:o.open,title:o.task?"Edit Task":"New Task","max-width":"max-w-md",onClose:e[11]||(e[11]=a=>v("close"))},{footer:u(()=>[i($,{variant:"outline",disabled:d.value,onClick:e[10]||(e[10]=a=>v("close"))},{default:u(()=>[...e[25]||(e[25]=[V("Cancel",-1)])]),_:1},8,["disabled"]),i($,{loading:d.value,onClick:w},{default:u(()=>[V(_(o.task?"Update":"Create"),1)]),_:1},8,["loading"])]),default:u(()=>[l("form",{class:"space-y-4",onSubmit:I(w,["prevent"])},[l("div",q,[e[12]||(e[12]=l("label",{class:"text-sm font-medium text-foreground"},"Title *",-1)),i(b,{modelValue:t.value.title,"onUpdate:modelValue":e[0]||(e[0]=a=>t.value.title=a),placeholder:"Task title...",disabled:d.value},null,8,["modelValue","disabled"])]),l("div",H,[e[13]||(e[13]=l("label",{class:"text-sm font-medium text-foreground"},"Notes",-1)),i(A,{modelValue:t.value.notes,"onUpdate:modelValue":e[1]||(e[1]=a=>t.value.notes=a),placeholder:"Additional notes...",disabled:d.value},null,8,["modelValue","disabled"])]),l("div",G,[l("div",J,[e[14]||(e[14]=l("label",{class:"text-sm font-medium text-foreground"},"Planned Date",-1)),i(b,{modelValue:t.value.planned_date,"onUpdate:modelValue":e[2]||(e[2]=a=>t.value.planned_date=a),type:"date",disabled:d.value},null,8,["modelValue","disabled"])]),l("div",K,[e[15]||(e[15]=l("label",{class:"text-sm font-medium text-foreground"},"Estimate (h)",-1)),i(b,{modelValue:t.value.estimate_hours,"onUpdate:modelValue":e[3]||(e[3]=a=>t.value.estimate_hours=a),type:"number",min:"0.25",max:"24",step:"0.25",disabled:d.value},null,8,["modelValue","disabled"])])]),l("div",Q,[l("div",R,[e[16]||(e[16]=l("label",{class:"text-sm font-medium text-foreground"},[V("Start time "),l("span",{class:"text-muted-foreground font-normal"},"(optional)")],-1)),i(b,{modelValue:t.value.start_time,"onUpdate:modelValue":e[4]||(e[4]=a=>t.value.start_time=a),type:"time",disabled:d.value},null,8,["modelValue","disabled"])]),l("div",X,[e[17]||(e[17]=l("label",{class:"text-sm font-medium text-foreground"},"End time",-1)),i(b,{modelValue:t.value.end_time,"onUpdate:modelValue":e[5]||(e[5]=a=>t.value.end_time=a),type:"time",disabled:d.value},null,8,["modelValue","disabled"])])]),l("div",Y,[l("div",Z,[e[19]||(e[19]=l("label",{class:"text-sm font-medium text-foreground"},"Status",-1)),i(k,{modelValue:t.value.status,"onUpdate:modelValue":e[6]||(e[6]=a=>t.value.status=a),disabled:d.value},{default:u(()=>[...e[18]||(e[18]=[l("option",{value:"todo"},"Todo",-1),l("option",{value:"doing"},"Doing",-1),l("option",{value:"testing"},"Testing",-1),l("option",{value:"done"},"Done",-1),l("option",{value:"cancelled"},"Cancelled",-1)])]),_:1},8,["modelValue","disabled"])]),l("div",h,[e[21]||(e[21]=l("label",{class:"text-sm font-medium text-foreground"},"Priority",-1)),i(k,{modelValue:t.value.priority,"onUpdate:modelValue":e[7]||(e[7]=a=>t.value.priority=a),disabled:d.value},{default:u(()=>[...e[20]||(e[20]=[l("option",{value:"1"},"1 - Low",-1),l("option",{value:"2"},"2 - Normal",-1),l("option",{value:"3"},"3 - Medium",-1),l("option",{value:"4"},"4 - High",-1),l("option",{value:"5"},"5 - Critical",-1)])]),_:1},8,["modelValue","disabled"])])]),c(f).projects.length?(n(),r("div",ee,[e[23]||(e[23]=l("label",{class:"text-sm font-medium text-foreground"},"Project",-1)),i(k,{modelValue:t.value.project_id,"onUpdate:modelValue":e[8]||(e[8]=a=>t.value.project_id=a),disabled:d.value,placeholder:"Select project..."},{default:u(()=>[e[22]||(e[22]=l("option",{value:""},"None",-1)),(n(!0),r(j,null,S(c(f).projects,a=>(n(),r("option",{key:a.id,value:a.id},_(a.display_name)+_(a.job_number?` (${a.job_number})`:""),9,te))),128))]),_:1},8,["modelValue","disabled"])])):x("",!0),c(p).workItems.length?(n(),r("div",le,[e[24]||(e[24]=l("label",{class:"text-sm font-medium text-foreground"},"Azure DevOps Work Item",-1)),i(k,{modelValue:t.value.azure_work_item_id,"onUpdate:modelValue":e[9]||(e[9]=a=>t.value.azure_work_item_id=a),disabled:d.value,placeholder:"Link work item..."},{default:u(()=>[(n(!0),r(j,null,S(c(p).workItems,a=>(n(),r("option",{key:a.id,value:a.id}," #"+_(a.ado_id)+" – "+_(a.title),9,ae))),128))]),_:1},8,["modelValue","disabled"])])):x("",!0)],32)]),_:1},8,["open","title"]))}});export{ve as _,k as a,W as u}; +import{d as C,c as r,n as U,h as c,t as _,i as x,p as z,o as n,B as D,s as y,A as T,x as N,k as B,w as u,a as l,e as i,q as V,F as j,r as S,C as I}from"./index-Dj4QxrF8.js";import{_ as P}from"./Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js";import{_ as b}from"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import{_ as A}from"./Textarea.vue_vue_type_script_setup_true_lang-BYTYmReP.js";import{c as E}from"./utils-7WVCegLb.js";import{_ as $}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{u as F}from"./devops-CgM36Koe.js";import{p as L}from"./projects-Bt6sxsgH.js";const M=["id","value","disabled"],O=["selected"],k=C({__name:"Select",props:{modelValue:{},disabled:{type:Boolean},class:{},id:{},placeholder:{}},emits:["update:modelValue","change"],setup(o,{emit:m}){const s=o,v=m;return(p,f)=>(n(),r("select",{id:o.id,value:o.modelValue,disabled:o.disabled,class:U(c(E)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",s.class)),onChange:f[0]||(f[0]=t=>v("update:modelValue",t.target.value))},[o.placeholder?(n(),r("option",{key:0,value:"",disabled:"",selected:!o.modelValue},_(o.placeholder),9,O)):x("",!0),z(p.$slots,"default")],42,M))}}),W=D("projects",()=>{const o=y([]),m=y(!1);async function s(){if(!(o.value.length>0)){m.value=!0;try{const v=await L.list();o.value=v.data}catch{o.value=[]}finally{m.value=!1}}}return{projects:o,loading:m,fetchProjects:s}}),q={class:"space-y-1.5"},H={class:"space-y-1.5"},G={class:"grid grid-cols-2 gap-3"},J={class:"space-y-1.5"},K={class:"space-y-1.5"},Q={class:"grid grid-cols-2 gap-3"},R={class:"space-y-1.5"},X={class:"space-y-1.5"},Y={class:"grid grid-cols-2 gap-3"},Z={class:"space-y-1.5"},h={class:"space-y-1.5"},ee={key:0,class:"space-y-1.5"},te=["value"],le={key:1,class:"space-y-1.5"},ae=["value"],ve=C({__name:"TaskForm",props:{open:{type:Boolean},task:{default:null},defaultDate:{}},emits:["close","save"],setup(o,{emit:m}){const s=o,v=m,p=F(),f=W();T(()=>{f.fetchProjects()});const t=y({title:"",notes:"",planned_date:"",start_time:"",end_time:"",estimate_hours:1,status:"todo",priority:3,project_id:void 0,azure_work_item_id:void 0});N(()=>s.open,g=>{g&&(s.task?t.value={title:s.task.title,notes:s.task.notes??"",planned_date:s.task.planned_date??"",start_time:"",end_time:"",estimate_hours:s.task.estimate_hours??1,status:s.task.status,priority:s.task.priority,project_id:s.task.project_id??void 0,azure_work_item_id:s.task.azure_work_item_id??void 0}:t.value={title:"",notes:"",planned_date:s.defaultDate??"",start_time:"",end_time:"",estimate_hours:1,status:"todo",priority:3,project_id:void 0,azure_work_item_id:void 0},p.integration&&!p.workItems.length&&p.fetchWorkItems("open"))},{immediate:!0});const d=y(!1);async function w(){if(t.value.title.trim()){d.value=!0;try{const g={title:t.value.title,notes:t.value.notes||void 0,planned_date:t.value.planned_date,estimate_hours:t.value.estimate_hours,status:t.value.status,priority:t.value.priority,project_id:t.value.project_id||null,azure_work_item_id:t.value.azure_work_item_id||null};let e;t.value.planned_date&&t.value.start_time&&t.value.end_time&&(e={start_at:new Date(`${t.value.planned_date}T${t.value.start_time}:00`).toISOString(),end_at:new Date(`${t.value.planned_date}T${t.value.end_time}:00`).toISOString()}),v("save",g,e)}finally{d.value=!1}}}return(g,e)=>(n(),B(P,{open:o.open,title:o.task?"Edit Task":"New Task","max-width":"max-w-md",onClose:e[11]||(e[11]=a=>v("close"))},{footer:u(()=>[i($,{variant:"outline",disabled:d.value,onClick:e[10]||(e[10]=a=>v("close"))},{default:u(()=>[...e[25]||(e[25]=[V("Cancel",-1)])]),_:1},8,["disabled"]),i($,{loading:d.value,onClick:w},{default:u(()=>[V(_(o.task?"Update":"Create"),1)]),_:1},8,["loading"])]),default:u(()=>[l("form",{class:"space-y-4",onSubmit:I(w,["prevent"])},[l("div",q,[e[12]||(e[12]=l("label",{class:"text-sm font-medium text-foreground"},"Title *",-1)),i(b,{modelValue:t.value.title,"onUpdate:modelValue":e[0]||(e[0]=a=>t.value.title=a),placeholder:"Task title...",disabled:d.value},null,8,["modelValue","disabled"])]),l("div",H,[e[13]||(e[13]=l("label",{class:"text-sm font-medium text-foreground"},"Notes",-1)),i(A,{modelValue:t.value.notes,"onUpdate:modelValue":e[1]||(e[1]=a=>t.value.notes=a),placeholder:"Additional notes...",disabled:d.value},null,8,["modelValue","disabled"])]),l("div",G,[l("div",J,[e[14]||(e[14]=l("label",{class:"text-sm font-medium text-foreground"},"Planned Date",-1)),i(b,{modelValue:t.value.planned_date,"onUpdate:modelValue":e[2]||(e[2]=a=>t.value.planned_date=a),type:"date",disabled:d.value},null,8,["modelValue","disabled"])]),l("div",K,[e[15]||(e[15]=l("label",{class:"text-sm font-medium text-foreground"},"Estimate (h)",-1)),i(b,{modelValue:t.value.estimate_hours,"onUpdate:modelValue":e[3]||(e[3]=a=>t.value.estimate_hours=a),type:"number",min:"0.25",max:"24",step:"0.25",disabled:d.value},null,8,["modelValue","disabled"])])]),l("div",Q,[l("div",R,[e[16]||(e[16]=l("label",{class:"text-sm font-medium text-foreground"},[V("Start time "),l("span",{class:"text-muted-foreground font-normal"},"(optional)")],-1)),i(b,{modelValue:t.value.start_time,"onUpdate:modelValue":e[4]||(e[4]=a=>t.value.start_time=a),type:"time",disabled:d.value},null,8,["modelValue","disabled"])]),l("div",X,[e[17]||(e[17]=l("label",{class:"text-sm font-medium text-foreground"},"End time",-1)),i(b,{modelValue:t.value.end_time,"onUpdate:modelValue":e[5]||(e[5]=a=>t.value.end_time=a),type:"time",disabled:d.value},null,8,["modelValue","disabled"])])]),l("div",Y,[l("div",Z,[e[19]||(e[19]=l("label",{class:"text-sm font-medium text-foreground"},"Status",-1)),i(k,{modelValue:t.value.status,"onUpdate:modelValue":e[6]||(e[6]=a=>t.value.status=a),disabled:d.value},{default:u(()=>[...e[18]||(e[18]=[l("option",{value:"todo"},"Todo",-1),l("option",{value:"doing"},"Doing",-1),l("option",{value:"testing"},"Testing",-1),l("option",{value:"done"},"Done",-1),l("option",{value:"cancelled"},"Cancelled",-1)])]),_:1},8,["modelValue","disabled"])]),l("div",h,[e[21]||(e[21]=l("label",{class:"text-sm font-medium text-foreground"},"Priority",-1)),i(k,{modelValue:t.value.priority,"onUpdate:modelValue":e[7]||(e[7]=a=>t.value.priority=a),disabled:d.value},{default:u(()=>[...e[20]||(e[20]=[l("option",{value:"1"},"1 - Low",-1),l("option",{value:"2"},"2 - Normal",-1),l("option",{value:"3"},"3 - Medium",-1),l("option",{value:"4"},"4 - High",-1),l("option",{value:"5"},"5 - Critical",-1)])]),_:1},8,["modelValue","disabled"])])]),c(f).projects.length?(n(),r("div",ee,[e[23]||(e[23]=l("label",{class:"text-sm font-medium text-foreground"},"Project",-1)),i(k,{modelValue:t.value.project_id,"onUpdate:modelValue":e[8]||(e[8]=a=>t.value.project_id=a),disabled:d.value,placeholder:"Select project..."},{default:u(()=>[e[22]||(e[22]=l("option",{value:""},"None",-1)),(n(!0),r(j,null,S(c(f).projects,a=>(n(),r("option",{key:a.id,value:a.id},_(a.display_name)+_(a.job_number?` (${a.job_number})`:""),9,te))),128))]),_:1},8,["modelValue","disabled"])])):x("",!0),c(p).workItems.length?(n(),r("div",le,[e[24]||(e[24]=l("label",{class:"text-sm font-medium text-foreground"},"Azure DevOps Work Item",-1)),i(k,{modelValue:t.value.azure_work_item_id,"onUpdate:modelValue":e[9]||(e[9]=a=>t.value.azure_work_item_id=a),disabled:d.value,placeholder:"Link work item..."},{default:u(()=>[(n(!0),r(j,null,S(c(p).workItems,a=>(n(),r("option",{key:a.id,value:a.id}," #"+_(a.ado_id)+" – "+_(a.title),9,ae))),128))]),_:1},8,["modelValue","disabled"])])):x("",!0)],32)]),_:1},8,["open","title"]))}});export{ve as _,k as a,W as u}; diff --git a/src/static/assets/TasksView-DihMnVxc.js b/src/static/assets/TasksView-CS-ndHtq.js similarity index 90% rename from src/static/assets/TasksView-DihMnVxc.js rename to src/static/assets/TasksView-CS-ndHtq.js index b9917ae..2325c9c 100644 --- a/src/static/assets/TasksView-DihMnVxc.js +++ b/src/static/assets/TasksView-CS-ndHtq.js @@ -1 +1 @@ -import{u as L}from"./tasks-PDTqLr3E.js";import{u as A,a as K,_ as P}from"./TaskForm.vue_vue_type_script_setup_true_lang-gqrw8v69.js";import{s as b,d as j,o as d,c,n as T,a as n,e as p,w as S,t as D,i as $,F as C,r as O,k as B,A as z,h as f,q as I,j as F,K as _}from"./index-rN5A-UTe.js";import{_ as M}from"./Tooltip.vue_vue_type_script_setup_true_lang-CcvjvjWJ.js";import{_ as H}from"./EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js";import{_ as U}from"./Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js";import{_ as q}from"./Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js";import"./Dialog.vue_vue_type_script_setup_true_lang-5tIAaGh4.js";import"./Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js";import"./utils-7WVCegLb.js";import"./Textarea.vue_vue_type_script_setup_true_lang-MCF8JR3D.js";import"./devops-DzkXDmpg.js";import"./projects-COzvhtq2.js";function G(){const t=L(),l=b(null),o=b(null);function u(k,g){var x;l.value=k.id,(x=g.dataTransfer)==null||x.setData("task_id",k.id),g.dataTransfer&&(g.dataTransfer.effectAllowed="move")}function m(){l.value=null,o.value=null}function a(k,g){g.preventDefault(),o.value=k,g.dataTransfer&&(g.dataTransfer.dropEffect="move")}function s(){o.value=null}async function v(k,g,x){var h;x.preventDefault(),o.value=null;const w=(h=x.dataTransfer)==null?void 0:h.getData("task_id");w&&(l.value=null,await t.update(w,{status:k,sort_index:g}))}return{draggingId:l,dragOverColumn:o,onDragStart:u,onDragEnd:m,onDragOver:a,onDragLeave:s,onDrop:v}}const J={class:"flex items-start gap-2"},Q={class:"flex-1 min-w-0"},R={class:"text-sm font-medium text-slate-800 leading-snug line-clamp-2"},W={class:"flex flex-wrap items-center gap-1.5 mt-1.5"},X=["title"],Y={key:1,class:"text-[10px] px-1.5 py-0.5 rounded-md bg-blue-50 text-blue-500 font-medium shrink-0"},Z={key:2,class:"text-[10px] text-slate-400 shrink-0"},tt=j({__name:"KanbanCard",props:{task:{},dragging:{type:Boolean}},emits:["edit"],setup(t,{emit:l}){const o=l,u={1:"bg-red-500",2:"bg-orange-400",3:"bg-slate-300",4:"bg-slate-300",5:"bg-slate-300"};return(m,a)=>(d(),c("div",{class:T(["group relative bg-white rounded-xl border border-slate-200/80 px-3 py-2.5 cursor-grab active:cursor-grabbing shadow-sm hover:shadow-md hover:border-orange-200 transition-all duration-150 select-none",t.dragging?"opacity-40 scale-95":"opacity-100"]),draggable:"true",onClick:a[0]||(a[0]=s=>o("edit",t.task))},[n("div",J,[p(M,{content:`Priority ${t.task.priority}`},{default:S(()=>[n("span",{class:T(["mt-1.5 h-2 w-2 rounded-full shrink-0",u[t.task.priority]??"bg-slate-300"])},null,2)]),_:1},8,["content"]),n("div",Q,[n("p",R,D(t.task.title),1),n("div",W,[t.task.project_name?(d(),c("span",{key:0,class:"text-[10px] px-1.5 py-0.5 rounded-md bg-slate-100 text-slate-500 font-medium truncate max-w-[100px]",title:t.task.project_name},D(t.task.project_name),9,X)):$("",!0),t.task.azure_work_item_id?(d(),c("span",Y," ADO ")):$("",!0),t.task.planned_date?(d(),c("span",Z,D(t.task.planned_date),1)):$("",!0)])])])],2))}}),et={class:"flex flex-col min-h-0 w-full"},at={class:"flex items-center justify-between px-1 mb-2"},st={class:"flex items-center gap-2"},nt={class:"text-xs font-semibold uppercase tracking-wider text-slate-500"},rt={class:"text-[10px] font-semibold bg-slate-100 text-slate-400 px-1.5 py-0.5 rounded-full leading-none"},ot=j({__name:"KanbanColumn",props:{status:{},title:{},tasks:{},draggingId:{},isDragOver:{type:Boolean}},emits:["dragStart","dragEnd","dragOver","dragLeave","drop","editTask","addTask"],setup(t,{emit:l}){const o=l,u={todo:"border-t-slate-300",doing:"border-t-orange-400",testing:"border-t-blue-400",done:"border-t-emerald-400"};return(m,a)=>(d(),c("div",et,[n("div",at,[n("div",st,[n("h3",nt,D(t.title),1),n("span",rt,D(t.tasks.length),1)]),n("button",{class:"h-5 w-5 rounded flex items-center justify-center text-slate-400 hover:text-orange-500 hover:bg-orange-50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Add task",onClick:a[0]||(a[0]=s=>o("addTask",t.status))},[...a[5]||(a[5]=[n("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1)])])]),n("div",{class:T(["flex-1 rounded-xl border-2 border-dashed transition-all duration-150 p-2 space-y-2 min-h-[120px]",`border-t-4 ${u[t.status]??"border-t-slate-300"}`,t.isDragOver?"border-orange-300 bg-orange-50/60":"border-transparent bg-slate-50/60"]),onDragover:a[2]||(a[2]=s=>o("dragOver",t.status,s)),onDragleave:a[3]||(a[3]=s=>o("dragLeave")),onDrop:a[4]||(a[4]=s=>o("drop",t.status,t.tasks.length,s))},[(d(!0),c(C,null,O(t.tasks,s=>(d(),B(tt,{key:s.id,task:s,dragging:t.draggingId===s.id,onDragstart:v=>o("dragStart",s,v),onDragend:a[1]||(a[1]=v=>o("dragEnd")),onEdit:v=>o("editTask",s)},null,8,["task","dragging","onDragstart","onEdit"]))),128)),t.tasks.length===0&&!t.isDragOver?(d(),B(H,{key:0,size:"sm",title:"No tasks here",description:"Drag a card here or click + to add"})):$("",!0)],34)]))}}),lt={class:"flex flex-col h-full overflow-hidden"},it={class:"flex items-center gap-3 px-6 py-4 border-b border-slate-100 bg-white/60 shrink-0"},dt=["value"],ut={key:0,class:"flex items-center justify-center flex-1"},ct={key:1,class:"flex-1 overflow-x-auto overflow-y-hidden"},gt={class:"grid grid-cols-4 gap-4 p-6 h-full min-w-[700px]"},Tt=j({__name:"TasksView",setup(t){const l=L(),o=A(),u=G(),m=b(""),a=b(!1),s=b(null),v=b("todo"),k=[{status:"todo",title:"To Do"},{status:"doing",title:"Doing"},{status:"testing",title:"Testing"},{status:"done",title:"Done"}];z(async()=>{await Promise.all([l.fetchAll(),o.fetchProjects()])});const g=F(()=>{const i=l.tasks.filter(e=>e.status!=="cancelled");return m.value?i.filter(e=>e.project_id===m.value):i});function x(i){let e=g.value.filter(r=>r.status===i);return e=[...e].sort((r,y)=>r.sort_index-y.sort_index||r.created_at.localeCompare(y.created_at)),i==="done"&&(e=e.slice(-30)),e}function w(i){v.value=i,s.value=null,a.value=!0}function h(i){s.value=i,a.value=!0}function E(){a.value=!1,s.value=null}async function N(i,e){try{if(s.value)await l.update(s.value.id,i),e&&await l.createBlock(s.value.id,e),_.success("Task updated");else{const r={...i,status:i.status||v.value},y=await l.create(r);e&&await l.createBlock(y.id,e),_.success("Task created")}}catch{_.error("Failed to save task")}E()}const V=new Date().toISOString().split("T")[0];return(i,e)=>(d(),c("div",lt,[n("div",it,[e[4]||(e[4]=n("h2",{class:"text-sm font-semibold text-slate-800 mr-2"},"Kanban",-1)),p(K,{modelValue:m.value,"onUpdate:modelValue":e[0]||(e[0]=r=>m.value=r),class:"w-44 text-xs"},{default:S(()=>[e[2]||(e[2]=n("option",{value:""},"All projects",-1)),(d(!0),c(C,null,O(f(o).projects,r=>(d(),c("option",{key:r.id,value:r.id},D(r.display_name),9,dt))),128))]),_:1},8,["modelValue"]),e[5]||(e[5]=n("div",{class:"flex-1"},null,-1)),p(U,{size:"sm",onClick:e[1]||(e[1]=r=>w("todo"))},{default:S(()=>[...e[3]||(e[3]=[n("svg",{class:"h-3.5 w-3.5 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1),I(" New task ",-1)])]),_:1})]),f(l).loading?(d(),c("div",ut,[p(q,{size:"lg",class:"text-primary"})])):(d(),c("div",ct,[n("div",gt,[(d(),c(C,null,O(k,r=>n("div",{key:r.status,class:"flex flex-col min-h-0 overflow-y-auto"},[p(ot,{status:r.status,title:r.title,tasks:x(r.status),"dragging-id":f(u).draggingId.value,"is-drag-over":f(u).dragOverColumn.value===r.status,onDragStart:f(u).onDragStart,onDragEnd:f(u).onDragEnd,onDragOver:f(u).onDragOver,onDragLeave:f(u).onDragLeave,onDrop:f(u).onDrop,onEditTask:h,onAddTask:w},null,8,["status","title","tasks","dragging-id","is-drag-over","onDragStart","onDragEnd","onDragOver","onDragLeave","onDrop"])])),64))])])),p(P,{open:a.value,task:s.value,"default-date":f(V),onClose:E,onSave:N},null,8,["open","task","default-date"])]))}});export{Tt as default}; +import{u as L}from"./tasks-Dt_weT6j.js";import{u as A,a as K,_ as P}from"./TaskForm.vue_vue_type_script_setup_true_lang-cQ4nGVcO.js";import{s as b,d as j,o as d,c,n as T,a as n,e as p,w as S,t as D,i as $,F as C,r as O,k as B,A as z,h as f,q as I,j as F,K as _}from"./index-Dj4QxrF8.js";import{_ as M}from"./Tooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js";import{_ as H}from"./EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js";import{_ as U}from"./Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js";import{_ as q}from"./Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js";import"./Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js";import"./Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js";import"./utils-7WVCegLb.js";import"./Textarea.vue_vue_type_script_setup_true_lang-BYTYmReP.js";import"./devops-CgM36Koe.js";import"./projects-Bt6sxsgH.js";function G(){const t=L(),l=b(null),o=b(null);function u(k,g){var x;l.value=k.id,(x=g.dataTransfer)==null||x.setData("task_id",k.id),g.dataTransfer&&(g.dataTransfer.effectAllowed="move")}function m(){l.value=null,o.value=null}function a(k,g){g.preventDefault(),o.value=k,g.dataTransfer&&(g.dataTransfer.dropEffect="move")}function s(){o.value=null}async function v(k,g,x){var h;x.preventDefault(),o.value=null;const w=(h=x.dataTransfer)==null?void 0:h.getData("task_id");w&&(l.value=null,await t.update(w,{status:k,sort_index:g}))}return{draggingId:l,dragOverColumn:o,onDragStart:u,onDragEnd:m,onDragOver:a,onDragLeave:s,onDrop:v}}const J={class:"flex items-start gap-2"},Q={class:"flex-1 min-w-0"},R={class:"text-sm font-medium text-slate-800 leading-snug line-clamp-2"},W={class:"flex flex-wrap items-center gap-1.5 mt-1.5"},X=["title"],Y={key:1,class:"text-[10px] px-1.5 py-0.5 rounded-md bg-blue-50 text-blue-500 font-medium shrink-0"},Z={key:2,class:"text-[10px] text-slate-400 shrink-0"},tt=j({__name:"KanbanCard",props:{task:{},dragging:{type:Boolean}},emits:["edit"],setup(t,{emit:l}){const o=l,u={1:"bg-red-500",2:"bg-orange-400",3:"bg-slate-300",4:"bg-slate-300",5:"bg-slate-300"};return(m,a)=>(d(),c("div",{class:T(["group relative bg-white rounded-xl border border-slate-200/80 px-3 py-2.5 cursor-grab active:cursor-grabbing shadow-sm hover:shadow-md hover:border-orange-200 transition-all duration-150 select-none",t.dragging?"opacity-40 scale-95":"opacity-100"]),draggable:"true",onClick:a[0]||(a[0]=s=>o("edit",t.task))},[n("div",J,[p(M,{content:`Priority ${t.task.priority}`},{default:S(()=>[n("span",{class:T(["mt-1.5 h-2 w-2 rounded-full shrink-0",u[t.task.priority]??"bg-slate-300"])},null,2)]),_:1},8,["content"]),n("div",Q,[n("p",R,D(t.task.title),1),n("div",W,[t.task.project_name?(d(),c("span",{key:0,class:"text-[10px] px-1.5 py-0.5 rounded-md bg-slate-100 text-slate-500 font-medium truncate max-w-[100px]",title:t.task.project_name},D(t.task.project_name),9,X)):$("",!0),t.task.azure_work_item_id?(d(),c("span",Y," ADO ")):$("",!0),t.task.planned_date?(d(),c("span",Z,D(t.task.planned_date),1)):$("",!0)])])])],2))}}),et={class:"flex flex-col min-h-0 w-full"},at={class:"flex items-center justify-between px-1 mb-2"},st={class:"flex items-center gap-2"},nt={class:"text-xs font-semibold uppercase tracking-wider text-slate-500"},rt={class:"text-[10px] font-semibold bg-slate-100 text-slate-400 px-1.5 py-0.5 rounded-full leading-none"},ot=j({__name:"KanbanColumn",props:{status:{},title:{},tasks:{},draggingId:{},isDragOver:{type:Boolean}},emits:["dragStart","dragEnd","dragOver","dragLeave","drop","editTask","addTask"],setup(t,{emit:l}){const o=l,u={todo:"border-t-slate-300",doing:"border-t-orange-400",testing:"border-t-blue-400",done:"border-t-emerald-400"};return(m,a)=>(d(),c("div",et,[n("div",at,[n("div",st,[n("h3",nt,D(t.title),1),n("span",rt,D(t.tasks.length),1)]),n("button",{class:"h-5 w-5 rounded flex items-center justify-center text-slate-400 hover:text-orange-500 hover:bg-orange-50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Add task",onClick:a[0]||(a[0]=s=>o("addTask",t.status))},[...a[5]||(a[5]=[n("svg",{class:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1)])])]),n("div",{class:T(["flex-1 rounded-xl border-2 border-dashed transition-all duration-150 p-2 space-y-2 min-h-[120px]",`border-t-4 ${u[t.status]??"border-t-slate-300"}`,t.isDragOver?"border-orange-300 bg-orange-50/60":"border-transparent bg-slate-50/60"]),onDragover:a[2]||(a[2]=s=>o("dragOver",t.status,s)),onDragleave:a[3]||(a[3]=s=>o("dragLeave")),onDrop:a[4]||(a[4]=s=>o("drop",t.status,t.tasks.length,s))},[(d(!0),c(C,null,O(t.tasks,s=>(d(),B(tt,{key:s.id,task:s,dragging:t.draggingId===s.id,onDragstart:v=>o("dragStart",s,v),onDragend:a[1]||(a[1]=v=>o("dragEnd")),onEdit:v=>o("editTask",s)},null,8,["task","dragging","onDragstart","onEdit"]))),128)),t.tasks.length===0&&!t.isDragOver?(d(),B(H,{key:0,size:"sm",title:"No tasks here",description:"Drag a card here or click + to add"})):$("",!0)],34)]))}}),lt={class:"flex flex-col h-full overflow-hidden"},it={class:"flex items-center gap-3 px-6 py-4 border-b border-slate-100 bg-white/60 shrink-0"},dt=["value"],ut={key:0,class:"flex items-center justify-center flex-1"},ct={key:1,class:"flex-1 overflow-x-auto overflow-y-hidden"},gt={class:"grid grid-cols-4 gap-4 p-6 h-full min-w-[700px]"},Tt=j({__name:"TasksView",setup(t){const l=L(),o=A(),u=G(),m=b(""),a=b(!1),s=b(null),v=b("todo"),k=[{status:"todo",title:"To Do"},{status:"doing",title:"Doing"},{status:"testing",title:"Testing"},{status:"done",title:"Done"}];z(async()=>{await Promise.all([l.fetchAll(),o.fetchProjects()])});const g=F(()=>{const i=l.tasks.filter(e=>e.status!=="cancelled");return m.value?i.filter(e=>e.project_id===m.value):i});function x(i){let e=g.value.filter(r=>r.status===i);return e=[...e].sort((r,y)=>r.sort_index-y.sort_index||r.created_at.localeCompare(y.created_at)),i==="done"&&(e=e.slice(-30)),e}function w(i){v.value=i,s.value=null,a.value=!0}function h(i){s.value=i,a.value=!0}function E(){a.value=!1,s.value=null}async function N(i,e){try{if(s.value)await l.update(s.value.id,i),e&&await l.createBlock(s.value.id,e),_.success("Task updated");else{const r={...i,status:i.status||v.value},y=await l.create(r);e&&await l.createBlock(y.id,e),_.success("Task created")}}catch{_.error("Failed to save task")}E()}const V=new Date().toISOString().split("T")[0];return(i,e)=>(d(),c("div",lt,[n("div",it,[e[4]||(e[4]=n("h2",{class:"text-sm font-semibold text-slate-800 mr-2"},"Kanban",-1)),p(K,{modelValue:m.value,"onUpdate:modelValue":e[0]||(e[0]=r=>m.value=r),class:"w-44 text-xs"},{default:S(()=>[e[2]||(e[2]=n("option",{value:""},"All projects",-1)),(d(!0),c(C,null,O(f(o).projects,r=>(d(),c("option",{key:r.id,value:r.id},D(r.display_name),9,dt))),128))]),_:1},8,["modelValue"]),e[5]||(e[5]=n("div",{class:"flex-1"},null,-1)),p(U,{size:"sm",onClick:e[1]||(e[1]=r=>w("todo"))},{default:S(()=>[...e[3]||(e[3]=[n("svg",{class:"h-3.5 w-3.5 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M12 4v16m8-8H4"})],-1),I(" New task ",-1)])]),_:1})]),f(l).loading?(d(),c("div",ut,[p(q,{size:"lg",class:"text-primary"})])):(d(),c("div",ct,[n("div",gt,[(d(),c(C,null,O(k,r=>n("div",{key:r.status,class:"flex flex-col min-h-0 overflow-y-auto"},[p(ot,{status:r.status,title:r.title,tasks:x(r.status),"dragging-id":f(u).draggingId.value,"is-drag-over":f(u).dragOverColumn.value===r.status,onDragStart:f(u).onDragStart,onDragEnd:f(u).onDragEnd,onDragOver:f(u).onDragOver,onDragLeave:f(u).onDragLeave,onDrop:f(u).onDrop,onEditTask:h,onAddTask:w},null,8,["status","title","tasks","dragging-id","is-drag-over","onDragStart","onDragEnd","onDragOver","onDragLeave","onDrop"])])),64))])])),p(P,{open:a.value,task:s.value,"default-date":f(V),onClose:E,onSave:N},null,8,["open","task","default-date"])]))}});export{Tt as default}; diff --git a/src/static/assets/Textarea.vue_vue_type_script_setup_true_lang-MCF8JR3D.js b/src/static/assets/Textarea.vue_vue_type_script_setup_true_lang-BYTYmReP.js similarity index 92% rename from src/static/assets/Textarea.vue_vue_type_script_setup_true_lang-MCF8JR3D.js rename to src/static/assets/Textarea.vue_vue_type_script_setup_true_lang-BYTYmReP.js index c6f3a5a..b745421 100644 --- a/src/static/assets/Textarea.vue_vue_type_script_setup_true_lang-MCF8JR3D.js +++ b/src/static/assets/Textarea.vue_vue_type_script_setup_true_lang-BYTYmReP.js @@ -1 +1 @@ -import{c as r}from"./utils-7WVCegLb.js";import{d as t,o as n,c as i,n as u,h as c}from"./index-rN5A-UTe.js";const m=["id","value","placeholder","disabled","rows"],g=t({__name:"Textarea",props:{modelValue:{},placeholder:{},disabled:{type:Boolean},rows:{},class:{},id:{}},emits:["update:modelValue"],setup(e,{emit:l}){const a=e,s=l;return(f,o)=>(n(),i("textarea",{id:e.id,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,rows:e.rows??3,class:u(c(r)("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50 resize-none",a.class)),onInput:o[0]||(o[0]=d=>s("update:modelValue",d.target.value))},null,42,m))}});export{g as _}; +import{c as r}from"./utils-7WVCegLb.js";import{d as t,o as n,c as i,n as u,h as c}from"./index-Dj4QxrF8.js";const m=["id","value","placeholder","disabled","rows"],g=t({__name:"Textarea",props:{modelValue:{},placeholder:{},disabled:{type:Boolean},rows:{},class:{},id:{}},emits:["update:modelValue"],setup(e,{emit:l}){const a=e,s=l;return(f,o)=>(n(),i("textarea",{id:e.id,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,rows:e.rows??3,class:u(c(r)("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50 resize-none",a.class)),onInput:o[0]||(o[0]=d=>s("update:modelValue",d.target.value))},null,42,m))}});export{g as _}; diff --git a/src/static/assets/Tooltip.vue_vue_type_script_setup_true_lang-CcvjvjWJ.js b/src/static/assets/Tooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js similarity index 93% rename from src/static/assets/Tooltip.vue_vue_type_script_setup_true_lang-CcvjvjWJ.js rename to src/static/assets/Tooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js index 3a1ef8d..bf1171e 100644 --- a/src/static/assets/Tooltip.vue_vue_type_script_setup_true_lang-CcvjvjWJ.js +++ b/src/static/assets/Tooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js @@ -1 +1 @@ -import{d,k as i,w as t,h as e,W as r,o as l,e as s,p as n,N as f,U as m,n as c,q as u,t as p,O as g}from"./index-rN5A-UTe.js";import{c as x}from"./utils-7WVCegLb.js";const w=d({__name:"Tooltip",props:{content:{},side:{default:"top"},sideOffset:{default:6}},setup(a){return(o,h)=>(l(),i(e(r),null,{default:t(()=>[s(e(f),{"as-child":""},{default:t(()=>[n(o.$slots,"default")]),_:3}),s(e(g),null,{default:t(()=>[s(e(m),{side:a.side,"side-offset":a.sideOffset,class:c(e(x)("z-50 max-w-[280px] rounded-lg border border-border bg-popover px-3 py-1.5","text-xs text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"))},{default:t(()=>[u(p(a.content),1)]),_:1},8,["side","side-offset","class"])]),_:1})]),_:3}))}});export{w as _}; +import{d,k as i,w as t,h as e,W as r,o as l,e as s,p as n,N as f,U as m,n as c,q as u,t as p,O as g}from"./index-Dj4QxrF8.js";import{c as x}from"./utils-7WVCegLb.js";const w=d({__name:"Tooltip",props:{content:{},side:{default:"top"},sideOffset:{default:6}},setup(a){return(o,h)=>(l(),i(e(r),null,{default:t(()=>[s(e(f),{"as-child":""},{default:t(()=>[n(o.$slots,"default")]),_:3}),s(e(g),null,{default:t(()=>[s(e(m),{side:a.side,"side-offset":a.sideOffset,class:c(e(x)("z-50 max-w-[280px] rounded-lg border border-border bg-popover px-3 py-1.5","text-xs text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"))},{default:t(()=>[u(p(a.content),1)]),_:1},8,["side","side-offset","class"])]),_:1})]),_:3}))}});export{w as _}; diff --git a/src/static/assets/admin-Bt3HG9mf.js b/src/static/assets/admin-DXsqWfhz.js similarity index 68% rename from src/static/assets/admin-Bt3HG9mf.js rename to src/static/assets/admin-DXsqWfhz.js index a20bc00..e33faed 100644 --- a/src/static/assets/admin-Bt3HG9mf.js +++ b/src/static/assets/admin-DXsqWfhz.js @@ -1 +1 @@ -import{D as e}from"./index-rN5A-UTe.js";const i={users:()=>e.get("/api/admin/users"),keys:()=>e.get("/api/keys"),createKey:s=>e.post("/api/keys",s),revokeKey:s=>e.delete(`/api/keys/${s}`)};export{i as a}; +import{D as e}from"./index-Dj4QxrF8.js";const i={users:()=>e.get("/api/admin/users"),keys:()=>e.get("/api/keys"),createKey:s=>e.post("/api/keys",s),revokeKey:s=>e.delete(`/api/keys/${s}`)};export{i as a}; diff --git a/src/static/assets/calendar-GhZPhKWb.js b/src/static/assets/calendar-BJMyS7_H.js similarity index 87% rename from src/static/assets/calendar-GhZPhKWb.js rename to src/static/assets/calendar-BJMyS7_H.js index e089705..3e3576e 100644 --- a/src/static/assets/calendar-GhZPhKWb.js +++ b/src/static/assets/calendar-BJMyS7_H.js @@ -1,4 +1,4 @@ -import{c as e}from"./createLucideIcon-BQqEiwZb.js";/** +import{c as e}from"./createLucideIcon-CglWgwD8.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/calendar-days-OJQzkSiF.js b/src/static/assets/calendar-days-B6LXSX5z.js similarity index 91% rename from src/static/assets/calendar-days-OJQzkSiF.js rename to src/static/assets/calendar-days-B6LXSX5z.js index 45b226a..7b19864 100644 --- a/src/static/assets/calendar-days-OJQzkSiF.js +++ b/src/static/assets/calendar-days-B6LXSX5z.js @@ -1,4 +1,4 @@ -import{c as h}from"./createLucideIcon-BQqEiwZb.js";/** +import{c as h}from"./createLucideIcon-CglWgwD8.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/createLucideIcon-BQqEiwZb.js b/src/static/assets/createLucideIcon-CglWgwD8.js similarity index 96% rename from src/static/assets/createLucideIcon-BQqEiwZb.js rename to src/static/assets/createLucideIcon-CglWgwD8.js index e68ffb6..a5985ae 100644 --- a/src/static/assets/createLucideIcon-BQqEiwZb.js +++ b/src/static/assets/createLucideIcon-CglWgwD8.js @@ -1,4 +1,4 @@ -import{a4 as a}from"./index-rN5A-UTe.js";/** +import{a4 as a}from"./index-Dj4QxrF8.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/dashboard-DAarnFBr.js b/src/static/assets/dashboard-9KozuccB.js similarity index 88% rename from src/static/assets/dashboard-DAarnFBr.js rename to src/static/assets/dashboard-9KozuccB.js index ae271ae..7f0efa2 100644 --- a/src/static/assets/dashboard-DAarnFBr.js +++ b/src/static/assets/dashboard-9KozuccB.js @@ -1 +1 @@ -import{D as t}from"./index-rN5A-UTe.js";const e={summary:a=>t.get("/api/dashboard/summary",{params:a}),projects:a=>t.get("/api/dashboard/projects",{params:a}),timeline:a=>t.get("/api/dashboard/timeline",{params:a}),monthly:a=>t.get("/api/dashboard/monthly",{params:a}),dow:a=>t.get("/api/dashboard/dow",{params:a}),tools:a=>t.get("/api/dashboard/tools",{params:a}),activity:a=>t.get("/api/dashboard/activity",{params:a}),calendar:a=>t.get("/api/dashboard/calendar",{params:a}),project:(a,o)=>t.get("/api/dashboard/project/"+a,{params:o})};export{e as d}; +import{D as t}from"./index-Dj4QxrF8.js";const e={summary:a=>t.get("/api/dashboard/summary",{params:a}),projects:a=>t.get("/api/dashboard/projects",{params:a}),timeline:a=>t.get("/api/dashboard/timeline",{params:a}),monthly:a=>t.get("/api/dashboard/monthly",{params:a}),dow:a=>t.get("/api/dashboard/dow",{params:a}),tools:a=>t.get("/api/dashboard/tools",{params:a}),activity:a=>t.get("/api/dashboard/activity",{params:a}),calendar:a=>t.get("/api/dashboard/calendar",{params:a}),project:(a,o)=>t.get("/api/dashboard/project/"+a,{params:o})};export{e as d}; diff --git a/src/static/assets/devops-DzkXDmpg.js b/src/static/assets/devops-CgM36Koe.js similarity index 94% rename from src/static/assets/devops-DzkXDmpg.js rename to src/static/assets/devops-CgM36Koe.js index d4006ac..6dd758a 100644 --- a/src/static/assets/devops-DzkXDmpg.js +++ b/src/static/assets/devops-CgM36Koe.js @@ -1 +1 @@ -import{D as n,B as I,s as o}from"./index-rN5A-UTe.js";const i={getIntegration:()=>n.get("/api/devops/integration"),saveIntegration:e=>n.put("/api/devops/integration",e),deleteIntegration:()=>n.delete("/api/devops/integration"),sync:()=>n.post("/api/devops/sync"),workItems:e=>n.get("/api/devops/work-items",{params:e?{state:e}:void 0}),cloneWorkItem:e=>n.post(`/api/devops/work-items/${e}/clone`)},m=I("devops",()=>{const e=o(null),l=o([]),r=o(!1),s=o(!1),c=o(null);async function u(){s.value=!0;try{const t=await i.getIntegration();e.value=t.data}catch{e.value=null}finally{s.value=!1}}async function d(t){const a=await i.saveIntegration(t);e.value=a.data}async function g(){await i.deleteIntegration(),e.value=null}async function f(){var t,a;r.value=!0,c.value=null;try{await i.sync(),await u()}catch(v){const p=v;throw c.value=((a=(t=p.response)==null?void 0:t.data)==null?void 0:a.detail)??p.message??"Sync failed",v}finally{r.value=!1}}async function y(t){s.value=!0;try{const a=await i.workItems(t);l.value=a.data}catch{l.value=[]}finally{s.value=!1}}return{integration:e,workItems:l,syncing:r,loading:s,error:c,fetchIntegration:u,saveIntegration:d,deleteIntegration:g,sync:f,fetchWorkItems:y}});export{i as d,m as u}; +import{D as n,B as I,s as o}from"./index-Dj4QxrF8.js";const i={getIntegration:()=>n.get("/api/devops/integration"),saveIntegration:e=>n.put("/api/devops/integration",e),deleteIntegration:()=>n.delete("/api/devops/integration"),sync:()=>n.post("/api/devops/sync"),workItems:e=>n.get("/api/devops/work-items",{params:e?{state:e}:void 0}),cloneWorkItem:e=>n.post(`/api/devops/work-items/${e}/clone`)},m=I("devops",()=>{const e=o(null),l=o([]),r=o(!1),s=o(!1),c=o(null);async function u(){s.value=!0;try{const t=await i.getIntegration();e.value=t.data}catch{e.value=null}finally{s.value=!1}}async function d(t){const a=await i.saveIntegration(t);e.value=a.data}async function g(){await i.deleteIntegration(),e.value=null}async function f(){var t,a;r.value=!0,c.value=null;try{await i.sync(),await u()}catch(v){const p=v;throw c.value=((a=(t=p.response)==null?void 0:t.data)==null?void 0:a.detail)??p.message??"Sync failed",v}finally{r.value=!1}}async function y(t){s.value=!0;try{const a=await i.workItems(t);l.value=a.data}catch{l.value=[]}finally{s.value=!1}}return{integration:e,workItems:l,syncing:r,loading:s,error:c,fetchIntegration:u,saveIntegration:d,deleteIntegration:g,sync:f,fetchWorkItems:y}});export{i as d,m as u}; diff --git a/src/static/assets/file-text-DKL7lELr.js b/src/static/assets/file-text-DJt8VL3c.js similarity index 89% rename from src/static/assets/file-text-DKL7lELr.js rename to src/static/assets/file-text-DJt8VL3c.js index 43f186d..60ea611 100644 --- a/src/static/assets/file-text-DKL7lELr.js +++ b/src/static/assets/file-text-DJt8VL3c.js @@ -1,4 +1,4 @@ -import{c as e}from"./createLucideIcon-BQqEiwZb.js";/** +import{c as e}from"./createLucideIcon-CglWgwD8.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/folder-open-Dm6Er06z.js b/src/static/assets/folder-open-Cenu-_Fx.js similarity index 88% rename from src/static/assets/folder-open-Dm6Er06z.js rename to src/static/assets/folder-open-Cenu-_Fx.js index ca83650..7465d7a 100644 --- a/src/static/assets/folder-open-Dm6Er06z.js +++ b/src/static/assets/folder-open-Cenu-_Fx.js @@ -1,4 +1,4 @@ -import{c as a}from"./createLucideIcon-BQqEiwZb.js";/** +import{c as a}from"./createLucideIcon-CglWgwD8.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/format-gWy7j8JO.js b/src/static/assets/format-DscROiV-.js similarity index 99% rename from src/static/assets/format-gWy7j8JO.js rename to src/static/assets/format-DscROiV-.js index d6eb7a4..9ebfa33 100644 --- a/src/static/assets/format-gWy7j8JO.js +++ b/src/static/assets/format-DscROiV-.js @@ -1,4 +1,4 @@ -import{c as X}from"./createLucideIcon-BQqEiwZb.js";/** +import{c as X}from"./createLucideIcon-CglWgwD8.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/index-rN5A-UTe.js b/src/static/assets/index-Dj4QxrF8.js similarity index 99% rename from src/static/assets/index-rN5A-UTe.js rename to src/static/assets/index-Dj4QxrF8.js index ef01dbc..45a4988 100644 --- a/src/static/assets/index-rN5A-UTe.js +++ b/src/static/assets/index-Dj4QxrF8.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-D4TcGUK9.js","assets/CardContent.vue_vue_type_script_setup_true_lang-BnzU0LF2.js","assets/utils-7WVCegLb.js","assets/DashboardView-CmARPWJW.js","assets/dashboard-DAarnFBr.js","assets/CardTitle.vue_vue_type_script_setup_true_lang-CugNHrdd.js","assets/Button.vue_vue_type_script_setup_true_lang-66r0PpW6.js","assets/Spinner.vue_vue_type_script_setup_true_lang-DTeJRqO4.js","assets/Skeleton.vue_vue_type_script_setup_true_lang-DvqtZljC.js","assets/createLucideIcon-BQqEiwZb.js","assets/calendar-days-OJQzkSiF.js","assets/folder-open-Dm6Er06z.js","assets/Tooltip.vue_vue_type_script_setup_true_lang-CcvjvjWJ.js","assets/tasks-PDTqLr3E.js","assets/devops-DzkXDmpg.js","assets/CalendarView-ylCKpGKw.js","assets/SegmentedControl.vue_vue_type_script_setup_true_lang-CAqylCqr.js","assets/format-gWy7j8JO.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/Badge.vue_vue_type_script_setup_true_lang-igExkyOK.js","assets/TaskForm.vue_vue_type_script_setup_true_lang-gqrw8v69.js","assets/Dialog.vue_vue_type_script_setup_true_lang-5tIAaGh4.js","assets/Input.vue_vue_type_script_setup_true_lang-D00Gss2e.js","assets/Textarea.vue_vue_type_script_setup_true_lang-MCF8JR3D.js","assets/projects-COzvhtq2.js","assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-NFERUoaY.js","assets/CalendarView-DMz1YKbt.css","assets/TasksView-DihMnVxc.js","assets/EmptyState.vue_vue_type_script_setup_true_lang-Q76FMbX_.js","assets/OmgView-DRcTYRif.js","assets/file-text-DKL7lELr.js","assets/plus-8OWFLnn5.js","assets/ProjectsView-DYSEwPaV.js","assets/DataTable.vue_vue_type_script_setup_true_lang-CHKsc19V.js","assets/zap-B0jfADxc.js","assets/ProjectDetailView-CdtUGv8p.js","assets/LiveView-DDM8h9ml.js","assets/ReportsView-CpecHUOd.js","assets/calendar-GhZPhKWb.js","assets/ReportsView-CEPiE5pW.css","assets/KeysView-DFI2tF0F.js","assets/admin-Bt3HG9mf.js","assets/DevopsView-TX3WlewI.js","assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-BzwbMDjx.js","assets/SettingsView-CuZ9KN7E.js","assets/AdminView-C7wez57z.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-8WQzarqw.js","assets/CardContent.vue_vue_type_script_setup_true_lang-C1i0U6Ll.js","assets/utils-7WVCegLb.js","assets/DashboardView-BXyr7l4W.js","assets/dashboard-9KozuccB.js","assets/CardTitle.vue_vue_type_script_setup_true_lang-BMHIwlxU.js","assets/Button.vue_vue_type_script_setup_true_lang-mB1IXvmR.js","assets/Spinner.vue_vue_type_script_setup_true_lang-wq-KSsd4.js","assets/Skeleton.vue_vue_type_script_setup_true_lang-DhWXp9By.js","assets/createLucideIcon-CglWgwD8.js","assets/calendar-days-B6LXSX5z.js","assets/folder-open-Cenu-_Fx.js","assets/Tooltip.vue_vue_type_script_setup_true_lang-CIrk8MRN.js","assets/tasks-Dt_weT6j.js","assets/devops-CgM36Koe.js","assets/CalendarView-CaW5n3jj.js","assets/SegmentedControl.vue_vue_type_script_setup_true_lang-t9SJyic6.js","assets/format-DscROiV-.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/Badge.vue_vue_type_script_setup_true_lang-DAgGdGY2.js","assets/TaskForm.vue_vue_type_script_setup_true_lang-cQ4nGVcO.js","assets/Dialog.vue_vue_type_script_setup_true_lang-CF0ccfWZ.js","assets/Input.vue_vue_type_script_setup_true_lang-CRPNYgQk.js","assets/Textarea.vue_vue_type_script_setup_true_lang-BYTYmReP.js","assets/projects-Bt6sxsgH.js","assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-D-t0Bdmh.js","assets/CalendarView-DMz1YKbt.css","assets/TasksView-CS-ndHtq.js","assets/EmptyState.vue_vue_type_script_setup_true_lang-CjzfCYzX.js","assets/OmgView-BhU31iOQ.js","assets/file-text-DJt8VL3c.js","assets/plus-C-ov7K0l.js","assets/ProjectsView-BFbSEcZ2.js","assets/DataTable.vue_vue_type_script_setup_true_lang-8gHvRwtL.js","assets/zap-Bmdr3aWk.js","assets/ProjectDetailView-4KJdgDVR.js","assets/LiveView-CtRvAfQD.js","assets/ReportsView-Br61zuWE.js","assets/calendar-BJMyS7_H.js","assets/ReportsView-CEPiE5pW.css","assets/KeysView-BbrvrPgK.js","assets/admin-DXsqWfhz.js","assets/DevopsView-CyGHofcw.js","assets/DevopsConnectForm.vue_vue_type_script_setup_true_lang-Bv-vOrXl.js","assets/SettingsView-BQsCH9JJ.js","assets/AdminView-Dp6LfsVH.js"])))=>i.map(i=>d[i]); var kd=t=>{throw TypeError(t)};var Tc=(t,e,n)=>e.has(t)||kd("Cannot "+n);var x=(t,e,n)=>(Tc(t,e,"read from private field"),n?n.call(t):e.get(t)),Se=(t,e,n)=>e.has(t)?kd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ve=(t,e,n,r)=>(Tc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Ct=(t,e,n)=>(Tc(t,e,"access private method"),n);var _s=(t,e,n,r)=>({set _(o){ve(t,e,o,n)},get _(){return x(t,e,r)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/** * @vue/shared v3.5.34 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -43,4 +43,4 @@ Error Description: ${i.errorMessage}`);else{const s=i;this.logger.error(`A non-M Error: ${s.name} Error Description: ${s.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=_t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&Oe.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let r;if(n&&n.azureCloudInstance!==Qu.None){const o=n.tenant?n.tenant:P.DEFAULT_COMMON_TENANT;r=`${n.azureCloudInstance}/${o}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return P.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw j(Zn)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Uy.has(e)}static isPublicCloudAuthority(e){return P.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,r){const o=new Oe(e);o.validateAsUri();const i=o.getUrlComponents();let s=`${n}.${i.HostNameAndPort}`;this.isPublicCloudAuthority(i.HostNameAndPort)&&(s=`${n}.${P.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const a=Oe.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:s}).urlString;return r?`${a}?${r}`:a}static replaceWithRegionalInformation(e,n){const r={...e};return r.authorization_endpoint=_t.buildRegionalAuthorityString(r.authorization_endpoint,n),r.token_endpoint=_t.buildRegionalAuthorityString(r.token_endpoint,n),r.end_session_endpoint&&(r.end_session_endpoint=_t.buildRegionalAuthorityString(r.end_session_endpoint,n)),r}static transformCIAMAuthority(e){let n=e;const o=new Oe(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(P.CIAM_AUTH_URL)){const i=o.HostNameAndPort.split(".")[0];n=`${n}${i}${P.AAD_TENANT_DOMAIN_SUFFIX}`}return n}}_t.reservedTenantDomains=new Set(["{tenant}","{tenantid}",Br.COMMON,Br.CONSUMERS,Br.ORGANIZATIONS]);function JO(t){var o;const r=(o=new Oe(t).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:o.toLowerCase();switch(r){case Br.COMMON:case Br.ORGANIZATIONS:case Br.CONSUMERS:return;default:return r}}function Ky(t){return t.endsWith(P.FORWARD_SLASH)?t:`${t}${P.FORWARD_SLASH}`}function XO(t){const e=t.cloudDiscoveryMetadata;let n;if(e)try{n=JSON.parse(e)}catch{throw qe(Zu)}return{canonicalAuthority:t.authority?Ky(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}/*! @azure/msal-common v14.16.1 2025-08-05 */async function $y(t,e,n,r,o,i,s){s==null||s.addQueueMeasurement(_.AuthorityFactoryCreateDiscoveredInstance,i);const a=_t.transformCIAMAuthority(Ky(t)),c=new _t(a,e,n,r,o,i,s);try{return await G(c.resolveEndpointsAsync.bind(c),_.AuthorityResolveEndpointsAsync,o,s,i)(),c}catch{throw j(Zn)}}/*! @azure/msal-common v14.16.1 2025-08-05 */class qr extends We{constructor(e,n,r,o,i){super(e,n,r),this.name="ServerError",this.errorNo=o,this.status=i,Object.setPrototypeOf(this,qr.prototype)}}/*! @azure/msal-common v14.16.1 2025-08-05 */class Dn{static generateThrottlingStorageKey(e){return`${Bi.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,n,r){var s;const o=Dn.generateThrottlingStorageKey(n),i=e.getThrottlingCache(o);if(i){if(i.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Mt.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const n=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(n||Bi.DEFAULT_THROTTLE_TIME_SECONDS),r+Bi.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,n,r,o){const i={clientId:n,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:o,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},s=this.generateThrottlingStorageKey(i);e.removeItem(s,r.correlationId)}}/*! @azure/msal-common v14.16.1 2025-08-05 */class gc extends We{constructor(e,n,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,gc.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=r}}function Ff(t,e,n){return new gc(t,e,n)}/*! @azure/msal-common v14.16.1 2025-08-05 */class ad{constructor(e,n){this.config=cO(e),this.logger=new $r(this.config.loggerOptions,yy,Wu),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n}createTokenRequestHeaders(e){const n={};if(n[Mt.CONTENT_TYPE]=P.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Jt.HOME_ACCOUNT_ID:try{const r=Ko(e.credential);n[Mt.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case Jt.UPN:n[Mt.CCS_HEADER]=`UPN: ${e.credential}`;break}return n}async executePostToTokenEndpoint(e,n,r,o,i,s){var c;s&&((c=this.performanceClient)==null||c.addQueueMeasurement(s,i));const a=await this.sendPostRequest(o,e,{body:n,headers:r},i);return this.config.serverTelemetryManager&&a.status<500&&a.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async sendPostRequest(e,n,r,o){var s,a,c;Dn.preProcess(this.cacheManager,e,o);let i;try{i=await G(this.networkClient.sendPostRequestAsync.bind(this.networkClient),_.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,o)(n,r);const l=i.headers||{};(a=this.performanceClient)==null||a.addFields({refreshTokenSize:((s=i.body.refresh_token)==null?void 0:s.length)||0,httpVerToken:l[Mt.X_MS_HTTP_VERSION]||"",requestId:l[Mt.X_MS_REQUEST_ID]||""},o)}catch(l){if(l instanceof gc){const u=l.responseHeaders;throw u&&((c=this.performanceClient)==null||c.addFields({httpVerToken:u[Mt.X_MS_HTTP_VERSION]||"",requestId:u[Mt.X_MS_REQUEST_ID]||"",contentTypeHeader:u[Mt.CONTENT_TYPE]||void 0,contentLengthHeader:u[Mt.CONTENT_LENGTH]||void 0,httpStatus:l.httpStatus},o)),l.error}throw l instanceof We?l:j(ry)}return Dn.postProcess(this.cacheManager,e,i,o),i}async updateAuthority(e,n){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(_.UpdateTokenEndpointAuthority,n);const r=`https://${e}/${this.authority.tenant}/`,o=await $y(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=o}createTokenQueryParameters(e){const n=new Fi(e.correlationId,this.performanceClient);return e.embeddedClientId&&n.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenQueryParameters&&n.addExtraQueryParameters(e.tokenQueryParameters),n.addCorrelationId(e.correlationId),n.createQueryString()}}/*! @azure/msal-common v14.16.1 2025-08-05 */const Aa="no_tokens_found",qy="native_account_unavailable",cd="refresh_token_expired",ZO="interaction_required",ek="consent_required",tk="login_required",mc="bad_token";/*! @azure/msal-common v14.16.1 2025-08-05 */const Kf=[ZO,ek,tk,mc],nk=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],rk={[Aa]:"No refresh token found in the cache. Please sign-in.",[qy]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[cd]:"Refresh token has expired.",[mc]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class En extends We{constructor(e,n,r,o,i,s,a,c){super(e,n,r),Object.setPrototypeOf(this,En.prototype),this.timestamp=o||P.EMPTY_STRING,this.traceId=i||P.EMPTY_STRING,this.correlationId=s||P.EMPTY_STRING,this.claims=a||P.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=c}}function $f(t,e,n){const r=!!t&&Kf.indexOf(t)>-1,o=!!n&&nk.indexOf(n)>-1,i=!!e&&Kf.some(s=>e.indexOf(s)>-1);return r||i||o}function zl(t){return new En(t,rk[t])}/*! @azure/msal-common v14.16.1 2025-08-05 */class gn{static setRequestState(e,n,r){const o=gn.generateLibraryState(e,r);return n?`${o}${P.RESOURCE_DELIM}${n}`:o}static generateLibraryState(e,n){if(!e)throw j($l);const r={id:e.createNewGuid()};n&&(r.meta=n);const o=JSON.stringify(r);return e.base64Encode(o)}static parseRequestState(e,n){if(!e)throw j($l);if(!n)throw j(ui);try{const r=n.split(P.RESOURCE_DELIM),o=r[0],i=r.length>1?r.slice(1).join(P.RESOURCE_DELIM):P.EMPTY_STRING,s=e.base64Decode(o),a=JSON.parse(s);return{userRequestState:i||P.EMPTY_STRING,libraryState:a}}catch{throw j(ui)}}}/*! @azure/msal-common v14.16.1 2025-08-05 */const ok={SW:"sw"};class hi{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(_.PopTokenGenerateCnf,e.correlationId);const r=await G(this.generateKid.bind(this),_.PopTokenGenerateCnf,n,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:o}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(_.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:ok.SW}}async signPopToken(e,n,r){return this.signPayload(e,n,r)}async signPayload(e,n,r,o){const{resourceRequestMethod:i,resourceRequestUri:s,shrClaims:a,shrNonce:c,shrOptions:l}=r,u=s?new Oe(s):void 0,d=u==null?void 0:u.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:qn(),m:i==null?void 0:i.toUpperCase(),u:d==null?void 0:d.HostNameAndPort,nonce:c||this.cryptoUtils.createNewGuid(),p:d==null?void 0:d.AbsolutePath,q:d!=null&&d.QueryString?[[],d.QueryString]:void 0,client_claims:a||void 0,...o},n,l,r.correlationId)}}/*! @azure/msal-common v14.16.1 2025-08-05 */class ik{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v14.16.1 2025-08-05 */function sk(t){var r,o;const e="code=",n=(r=t.error_uri)==null?void 0:r.lastIndexOf(e);return n&&n>=0?(o=t.error_uri)==null?void 0:o.substring(n+e.length):void 0}class wo{constructor(e,n,r,o,i,s,a){this.clientId=e,this.cacheStorage=n,this.cryptoObj=r,this.logger=o,this.serializableCache=i,this.persistencePlugin=s,this.performanceClient=a}validateServerAuthorizationCodeResponse(e,n){if(!e.state||!n)throw e.state?j(ga,"Cached State"):j(ga,"Server State");let r,o;try{r=decodeURIComponent(e.state)}catch{throw j(ui,e.state)}try{o=decodeURIComponent(n)}catch{throw j(ui,e.state)}if(r!==o)throw j(sy);if(e.error||e.error_description||e.suberror){const i=sk(e);throw $f(e.error,e.error_description,e.suberror)?new En(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",i):new qr(e.error||"",e.error_description,e.suberror,i)}}validateTokenResponse(e,n){var r;if(e.error||e.error_description||e.suberror){const o=`Error(s): ${e.error_codes||P.NOT_AVAILABLE} - Timestamp: ${e.timestamp||P.NOT_AVAILABLE} - Description: ${e.error_description||P.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||P.NOT_AVAILABLE} - Trace ID: ${e.trace_id||P.NOT_AVAILABLE}`,i=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,s=new qr(e.error,o,e.suberror,i,e.status);if(n&&e.status&&e.status>=Us.SERVER_ERROR_RANGE_START&&e.status<=Us.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. ${s}`);return}else if(n&&e.status&&e.status>=Us.CLIENT_ERROR_RANGE_START&&e.status<=Us.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${s}`);return}throw $f(e.error,e.error_description,e.suberror)?new En(e.error,e.error_description,e.suberror,e.timestamp||P.EMPTY_STRING,e.trace_id||P.EMPTY_STRING,e.correlation_id||P.EMPTY_STRING,e.claims||P.EMPTY_STRING,i):s}}async handleServerTokenResponse(e,n,r,o,i,s,a,c,l){var p;(p=this.performanceClient)==null||p.addQueueMeasurement(_.HandleServerTokenResponse,e.correlation_id);let u;if(e.id_token){if(u=_o(e.id_token||P.EMPTY_STRING,this.cryptoObj.base64Decode),i&&i.nonce&&u.nonce!==i.nonce)throw j(ay);if(o.maxAge||o.maxAge===0){const g=u.auth_time;if(!g)throw j(ju);vy(g,o.maxAge)}}this.homeAccountIdentifier=dt.generateHomeAccountId(e.client_info||P.EMPTY_STRING,n.authorityType,this.logger,this.cryptoObj,u);let d;i&&i.state&&(d=gn.parseRequestState(this.cryptoObj,i.state)),e.key_id=e.key_id||o.sshKid||void 0;const h=this.generateCacheRecord(e,n,r,o,u,s,i);let f;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),f=new ik(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(f)),a&&!c&&h.account){const g=h.account.generateAccountKey();if(!this.cacheStorage.getAccount(g,o.correlationId,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await wo.generateAuthenticationResult(this.cryptoObj,n,h,!1,o,u,d,void 0,l)}await this.cacheStorage.saveCacheRecord(h,o.correlationId,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&f&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(f))}return wo.generateAuthenticationResult(this.cryptoObj,n,h,!1,o,u,d,e,l)}generateCacheRecord(e,n,r,o,i,s,a){const c=n.getPreferredCache();if(!c)throw j(Gu);const l=My(i);let u,d;e.id_token&&i&&(u=dc(this.homeAccountIdentifier,c,e.id_token,this.clientId,l||""),d=ld(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,i,e.client_info,c,l,a,void 0,this.logger));let h=null;if(e.access_token){const g=e.scope?rt.fromString(e.scope):new rt(o.scopes||[]),m=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,C=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,T=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,y=r+m,w=y+C,S=T&&T>0?r+T:void 0;h=hc(this.homeAccountIdentifier,c,e.access_token,this.clientId,l||n.tenant||"",g.printScopes(),y,w,this.cryptoObj.base64Decode,S,e.token_type,s,e.key_id,o.claims,o.requestedClaimsHash)}let f=null;if(e.refresh_token){let g;if(e.refresh_token_expires_in){const m=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;g=r+m}f=Cy(this.homeAccountIdentifier,c,e.refresh_token,this.clientId,e.foci,s,g)}let p=null;return e.foci&&(p={clientId:this.clientId,environment:c,familyId:e.foci}),{account:d,idToken:u,accessToken:h,refreshToken:f,appMetadata:p}}static async generateAuthenticationResult(e,n,r,o,i,s,a,c,l){var y,w,S,B,N;let u=P.EMPTY_STRING,d=[],h=null,f,p,g=P.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===Fe.POP&&!i.popKid){const L=new hi(e),{secret:k,keyId:F}=r.accessToken;if(!F)throw j(zu);u=await L.signPopToken(k,F,i)}else u=r.accessToken.secret;d=rt.fromString(r.accessToken.target).asArray(),h=new Date(Number(r.accessToken.expiresOn)*1e3),f=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),r.accessToken.refreshOn&&(p=new Date(Number(r.accessToken.refreshOn)*1e3))}r.appMetadata&&(g=r.appMetadata.familyId===Hi?Hi:"");const m=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",C=(s==null?void 0:s.tid)||"";c!=null&&c.spa_accountid&&r.account&&(r.account.nativeAccountId=c==null?void 0:c.spa_accountid);const T=r.account?nd(r.account.getAccountInfo(),void 0,s,(y=r.idToken)==null?void 0:y.secret):null;return{authority:n.canonicalAuthority,uniqueId:m,tenantId:C,scopes:d,account:T,idToken:((w=r==null?void 0:r.idToken)==null?void 0:w.secret)||"",idTokenClaims:s||{},accessToken:u,fromCache:o,expiresOn:h,extExpiresOn:f,refreshOn:p,correlationId:i.correlationId,requestId:l||P.EMPTY_STRING,familyId:g,tokenType:((S=r.accessToken)==null?void 0:S.tokenType)||P.EMPTY_STRING,state:a?a.userRequestState:P.EMPTY_STRING,cloudGraphHostName:((B=r.account)==null?void 0:B.cloudGraphHostName)||P.EMPTY_STRING,msGraphHost:((N=r.account)==null?void 0:N.msGraphHost)||P.EMPTY_STRING,code:c==null?void 0:c.spa_code,fromNativeBroker:!1}}}function ld(t,e,n,r,o,i,s,a,c,l,u,d){d==null||d.verbose("setCachedAccount called");const f=t.getAccountKeys().find(T=>T.startsWith(n));let p=null;f&&(p=t.getAccount(f,o,d));const g=p||dt.createAccount({homeAccountId:n,idTokenClaims:i,clientInfo:s,environment:a,cloudGraphHostName:l==null?void 0:l.cloud_graph_host_name,msGraphHost:l==null?void 0:l.msgraph_host,nativeAccountId:u},e,r),m=g.tenantProfiles||[],C=c||g.realm;if(C&&!m.find(T=>T.tenantId===C)){const T=td(n,g.localAccountId,C,i);m.push(T)}return g.tenantProfiles=m,g}/*! @azure/msal-common v14.16.1 2025-08-05 */async function jy(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}/*! @azure/msal-common v14.16.1 2025-08-05 */class Vy extends ad{constructor(e,n){var r;super(e,n),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async getAuthCodeUrl(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(_.GetAuthCodeUrl,e.correlationId);const n=await G(this.createAuthCodeUrlQueryString.bind(this),_.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return Oe.appendQueryString(this.authority.authorizationEndpoint,n)}async acquireToken(e,n){var a,c;if((a=this.performanceClient)==null||a.addQueueMeasurement(_.AuthClientAcquireToken,e.correlationId),!e.code)throw j(uy);const r=qn(),o=await G(this.executeTokenRequest.bind(this),_.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),i=(c=o.headers)==null?void 0:c[Mt.X_MS_REQUEST_ID],s=new wo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(o.body),G(s.handleServerTokenResponse.bind(s),_.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,n,void 0,void 0,void 0,i)}handleFragmentResponse(e,n){if(new wo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,n),!e.code)throw j(gy);return e}getLogoutUri(e){if(!e)throw qe(Sy);const n=this.createLogoutUrlQueryString(e);return Oe.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n){var l,u;(l=this.performanceClient)==null||l.addQueueMeasurement(_.AuthClientExecuteTokenRequest,n.correlationId);const r=this.createTokenQueryParameters(n),o=Oe.appendQueryString(e.tokenEndpoint,r),i=await G(this.createTokenRequestBody.bind(this),_.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,n.correlationId)(n);let s;if(n.clientInfo)try{const d=ya(n.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${d.uid}${It.CLIENT_INFO_SEPARATOR}${d.utid}`,type:Jt.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const a=this.createTokenRequestHeaders(s||n.ccsCredential),c={clientId:((u=n.tokenBodyParameters)==null?void 0:u.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:n.scopes,claims:n.claims,authenticationScheme:n.authenticationScheme,resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,sshKid:n.sshKid};return G(this.executePostToTokenEndpoint.bind(this),_.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,n.correlationId)(o,i,a,c,n.correlationId,_.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i;(o=this.performanceClient)==null||o.addQueueMeasurement(_.AuthClientCreateTokenRequestBody,e.correlationId);const n=new Fi(e.correlationId,this.performanceClient);if(n.addClientId(e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[Co])||this.config.authOptions.clientId),this.includeRedirectUri?n.addRedirectUri(e.redirectUri):Lo.validateRedirectUri(e.redirectUri),n.addScopes(e.scopes,!0,this.oidcDefaultScopes),n.addAuthorizationCode(e.code),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addThrottling(),this.serverTelemetryManager&&!Vl(this.config)&&n.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&n.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&n.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;n.addClientAssertion(await jy(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),n.addClientAssertionType(s.assertionType)}if(n.addGrantType(Zm.AUTHORIZATION_CODE_GRANT),n.addClientInfo(),e.authenticationScheme===Fe.POP){const s=new hi(this.cryptoUtils,this.performanceClient);let a;e.popKid?a=this.cryptoUtils.encodeKid(e.popKid):a=(await G(s.generateCnf.bind(s),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,n.addPopToken(a)}else if(e.authenticationScheme===Fe.SSH)if(e.sshJwk)n.addSshJwk(e.sshJwk);else throw qe(fc);(!pn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const s=ya(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${s.uid}${It.CLIENT_INFO_SEPARATOR}${s.utid}`,type:Jt.HOME_ACCOUNT_ID}}catch(s){this.logger.verbose("Could not parse client info for CCS Header: "+s)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Jt.HOME_ACCOUNT_ID:try{const s=Ko(r.credential);n.addCcsOid(s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case Jt.UPN:n.addCcsUpn(r.credential);break}return e.embeddedClientId&&n.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&n.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Bf])&&n.addExtraQueryParameters({[Bf]:"1"}),n.createQueryString()}async createAuthCodeUrlQueryString(e){var i,s;const n=e.correlationId||this.config.cryptoInterface.createNewGuid();(i=this.performanceClient)==null||i.addQueueMeasurement(_.AuthClientCreateQueryString,n);const r=new Fi(n,this.performanceClient);r.addClientId(e.embeddedClientId||((s=e.extraQueryParameters)==null?void 0:s[Co])||this.config.authOptions.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(r.addScopes(o,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri),r.addCorrelationId(n),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),Vl(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==gt.SELECT_ACCOUNT)if(e.sid&&e.prompt===gt.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){const a=this.extractAccountSid(e.account);let c=this.extractLoginHint(e.account);if(c&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),c=null),c){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(c);try{const l=Ko(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&e.prompt===gt.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(a);try{const l=Ko(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{const l=Ko(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,r),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===Fe.POP)){const a=new hi(this.cryptoUtils);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await G(a.generateCnf.bind(a),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(c)}return r.createQueryString()}createLogoutUrlQueryString(e){const n=new Fi(e.correlationId,this.performanceClient);return e.postLogoutRedirectUri&&n.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&n.addCorrelationId(e.correlationId),e.idTokenHint&&n.addIdTokenHint(e.idTokenHint),e.state&&n.addState(e.state),e.logoutHint&&n.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,n),n.createQueryString()}addExtraQueryParams(e,n){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&n.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){var n;return((n=e.idTokenClaims)==null?void 0:n.sid)||null}extractLoginHint(e){var n;return((n=e.idTokenClaims)==null?void 0:n.login_hint)||null}}/*! @azure/msal-common v14.16.1 2025-08-05 */const ak=300;class Wl extends ad{constructor(e,n){super(e,n)}async acquireToken(e){var s,a;(s=this.performanceClient)==null||s.addQueueMeasurement(_.RefreshTokenClientAcquireToken,e.correlationId);const n=qn(),r=await G(this.executeTokenRequest.bind(this),_.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(a=r.headers)==null?void 0:a[Mt.X_MS_REQUEST_ID],i=new wo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return i.validateTokenResponse(r.body),G(i.handleServerTokenResponse.bind(i),_.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,n,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw qe(_y);if((r=this.performanceClient)==null||r.addQueueMeasurement(_.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw j(Vu);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await G(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const i=o instanceof En&&o.errorCode===Aa,s=o instanceof qr&&o.errorCode===_f.INVALID_GRANT_ERROR&&o.subError===_f.CLIENT_MISMATCH_ERROR;if(i||s)return G(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return G(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,n){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=So(this.cacheManager.getRefreshToken.bind(this.cacheManager),_.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0,this.performanceClient);if(!r)throw zl(Aa);if(r.expiresOn&&jl(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||ak))throw zl(cd);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||Fe.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Jt.HOME_ACCOUNT_ID}};try{return await G(this.acquireToken.bind(this),_.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(s){if(s instanceof En&&s.subError===mc){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const a=Fo(r);this.cacheManager.removeRefreshToken(a,e.correlationId)}throw s}}async executeTokenRequest(e,n){var c,l;(c=this.performanceClient)==null||c.addQueueMeasurement(_.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=Oe.appendQueryString(n.tokenEndpoint,r),i=await G(this.createTokenRequestBody.bind(this),_.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),a={clientId:((l=e.tokenBodyParameters)==null?void 0:l.clientId)||this.config.authOptions.clientId,authority:n.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return G(this.executePostToTokenEndpoint.bind(this),_.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,i,s,a,e.correlationId,_.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i,s;(o=this.performanceClient)==null||o.addQueueMeasurement(_.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const n=e.correlationId,r=new Fi(n,this.performanceClient);if(r.addClientId(e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[Co])||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,(s=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:s.defaultScopes),r.addGrantType(Zm.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!Vl(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const a=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await jy(a.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(a.assertionType)}if(e.authenticationScheme===Fe.POP){const a=new hi(this.cryptoUtils,this.performanceClient);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await G(a.generateCnf.bind(a),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(c)}else if(e.authenticationScheme===Fe.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw qe(fc);if((!pn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Jt.HOME_ACCOUNT_ID:try{const a=Ko(e.ccsCredential.credential);r.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case Jt.UPN:r.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}/*! @azure/msal-common v14.16.1 2025-08-05 */class ck extends ad{constructor(e,n){super(e,n)}async acquireToken(e){var n;try{const[r,o]=await this.acquireCachedToken({...e,scopes:(n=e.scopes)!=null&&n.length?e.scopes:[...yi]});return o===Or.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new Wl(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof uc&&r.errorCode===sr)return new Wl(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){var c;(c=this.performanceClient)==null||c.addQueueMeasurement(_.SilentFlowClientAcquireCachedToken,e.correlationId);let n=Or.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!pn.isEmptyObj(e.claims))throw this.setCacheOutcome(Or.FORCE_REFRESH_OR_CLAIMS,e.correlationId),j(sr);if(!e.account)throw j(Vu);const r=e.account.tenantId||JO(e.authority),o=this.cacheManager.getTokenKeys(),i=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient);if(i){if(UR(i.cachedAt)||jl(i.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Or.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),j(sr);i.refreshOn&&jl(i.refreshOn,0)&&(n=Or.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Or.NO_CACHED_ACCESS_TOKEN,e.correlationId),j(sr);const s=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.readAccountFromCache(e.account,e.correlationId),accessToken:i,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,r,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await G(this.generateResultFromCacheRecord.bind(this),_.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(a,e),n]}setCacheOutcome(e,n){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},n),e!==Or.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,n){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(_.SilentFlowClientGenerateResultFromCacheRecord,n.correlationId);let r;if(e.idToken&&(r=_o(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){const i=r==null?void 0:r.auth_time;if(!i)throw j(ju);vy(i,n.maxAge)}return wo.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,r)}}/*! @azure/msal-common v14.16.1 2025-08-05 */const lk={sendGetRequestAsync:()=>Promise.reject(j(Ee)),sendPostRequestAsync:()=>Promise.reject(j(Ee))};/*! @azure/msal-common v14.16.1 2025-08-05 */const qf=",",Gy="|";function uk(t){const{skus:e,libraryName:n,libraryVersion:r,extensionName:o,extensionVersion:i}=t,s=new Map([[0,[n,r]],[2,[o,i]]]);let a=[];if(e!=null&&e.length){if(a=e.split(qf),a.length<4)return e}else a=Array.from({length:4},()=>Gy);return s.forEach((c,l)=>{var u,d;c.length===2&&((u=c[0])!=null&&u.length)&&((d=c[1])!=null&&d.length)&&dk({skuArr:a,index:l,skuName:c[0],skuVersion:c[1]})}),a.join(qf)}function dk(t){const{skuArr:e,index:n,skuName:r,skuVersion:o}=t;n>=e.length||(e[n]=[r,o].join(Gy))}class ts{constructor(e,n){this.cacheOutcome=Or.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||P.EMPTY_STRING,this.wrapperVer=e.wrapperVer||P.EMPTY_STRING,this.telemetryCacheKey=wt.CACHE_KEY+It.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${wt.VALUE_SEPARATOR}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&n.push(`broker_error=${r}`);const o=n.join(wt.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),s=[e,i].join(wt.VALUE_SEPARATOR);return[wt.SCHEMA_VERSION,s,o].join(wt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),n=ts.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*n).join(wt.VALUE_SEPARATOR),o=e.errors.slice(0,n).join(wt.VALUE_SEPARATOR),i=e.errors.length,s=n=wt.MAX_CACHED_ERRORS&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof We?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(wt.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),n=ts.maxErrorsToSend(e),r=e.errors.length;if(n===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const o={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let n,r=0,o=0;const i=e.errors.length;for(n=0;nnull,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:YO.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""},measurement:new Vf}}startPerformanceMeasurement(){return new Vf}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const hd="pkce_not_created",Ql="crypto_nonexistent",yc="empty_navigate_uri",Qy="hash_empty_error",fd="no_state_in_hash",Yy="hash_does_not_contain_known_properties",Jy="unable_to_parse_state",Xy="state_interaction_type_mismatch",Zy="interaction_in_progress",ev="popup_window_error",tv="empty_window_error",Ao="user_cancelled",pk="monitor_popup_timeout",nv="monitor_window_timeout",rv="redirect_in_iframe",ov="block_iframe_reload",iv="block_nested_popups",gk="iframe_closed_prematurely",vc="silent_logout_unsupported",sv="no_account_error",mk="silent_prompt_value_error",av="no_token_request_cache_error",cv="unable_to_parse_token_request_cache_error",pd="no_cached_authority_error",yk="auth_request_not_set_error",vk="invalid_cache_type",Cc="non_browser_environment",Uo="database_not_open",Ta="no_network_connectivity",lv="post_request_failed",uv="get_request_failed",Yl="failed_to_parse_response",dv="unable_to_load_token",gd="crypto_key_not_found",hv="auth_code_required",fv="auth_code_or_nativeAccountId_required",pv="spa_code_and_nativeAccountId_present",md="database_unavailable",gv="unable_to_acquire_token_from_native_platform",mv="native_handshake_timeout",yv="native_extension_not_installed",Es="native_connection_not_established",vv="uninitialized_public_client_application",Cv="native_prompt_not_supported",wv="invalid_base64_string",Av="invalid_pop_token_request",Tv="failed_to_build_headers",Ev="failed_to_parse_headers";/*! @azure/msal-browser v3.30.0 2025-08-05 */const Yn="For more visit: aka.ms/msaljs/browser-errors",Ck={[hd]:"The PKCE code challenge and verifier could not be generated.",[Ql]:"The crypto object or function is not available.",[yc]:"Navigation URI is empty. Please check stack trace for more info.",[Qy]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${Yn}`,[fd]:"Hash does not contain state. Please verify that the request originated from msal.",[Yy]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${Yn}`,[Jy]:"Unable to parse state. Please verify that the request originated from msal.",[Xy]:"Hash contains state but the interaction type does not match the caller.",[Zy]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${Yn}`,[ev]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[tv]:"window.open returned null or undefined window object.",[Ao]:"User cancelled the flow.",[pk]:`Token acquisition in popup failed due to timeout. ${Yn}`,[nv]:`Token acquisition in iframe failed due to timeout. ${Yn}`,[rv]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[ov]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${Yn}`,[iv]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[gk]:"The iframe being monitored was closed prematurely.",[vc]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[sv]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[mk]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[av]:"No token request found in cache.",[cv]:"The cached token request could not be parsed.",[pd]:"No cached authority found.",[yk]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[vk]:"Invalid cache type",[Cc]:"Login and token requests are not supported in non-browser environments.",[Uo]:"Database is not open!",[Ta]:"No network connectivity. Check your internet connection.",[lv]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[uv]:"Network request failed. Please check the network trace to determine root cause.",[Yl]:"Failed to parse network response. Check network trace.",[dv]:"Error loading token to cache.",[gd]:"Cryptographic Key or Keypair not found in browser storage.",[hv]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[fv]:"An authorization code or nativeAccountId must be provided to this flow.",[pv]:"Request cannot contain both spa code and native account id.",[md]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[gv]:`Unable to acquire token from native platform. ${Yn}`,[mv]:"Timed out while attempting to establish connection to browser extension",[yv]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Es]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${Yn}`,[vv]:`You must call and await the initialize function before attempting to call any other MSAL API. ${Yn}`,[Cv]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[wv]:"Invalid base64 encoded string.",[Av]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[Tv]:"Failed to build request headers object.",[Ev]:"Failed to parse response headers"};class bs extends We{constructor(e,n){super(e,Ck[e],n),Object.setPrototypeOf(this,bs.prototype),this.name="BrowserAuthError"}}function te(t,e){return new bs(t,e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Qt={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},$o={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},oo={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Bt={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},Gf={GET:"GET",POST:"POST"},Be={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},sn={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys",VERSION:"msal.version"},$s={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},ze={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var ce;(function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"})(ce||(ce={}));const zf={scopes:yi},bv="jwk",Jl="msal.db",wk=1,Ak=`${Jl}.keys`,jt={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},Tk=[jt.Default,jt.Skip,jt.RefreshTokenAndNetwork],Ek="msal.browser.log.level",bk="msal.browser.log.pii";/*! @azure/msal-browser v3.30.0 2025-08-05 */function qs(t){return encodeURIComponent(yd(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function wc(t){return _v(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function yd(t){return _v(new TextEncoder().encode(t))}function _v(t){const e=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const _k="RSASSA-PKCS1-v1_5",Sv="SHA-256",Sk=2048,Ik=new Uint8Array([1,0,1]),Wf="0123456789abcdef",Qf=new Uint32Array(1),Rk="crypto_subtle_undefined",vd={name:_k,hash:Sv,modulusLength:Sk,publicExponent:Ik};function Ok(t){if(!window)throw te(Cc);if(!window.crypto)throw te(Ql);if(!t&&!window.crypto.subtle)throw te(Ql,Rk)}async function Iv(t,e,n){e==null||e.addQueueMeasurement(_.Sha256Digest,n);const o=new TextEncoder().encode(t);return window.crypto.subtle.digest(Sv,o)}function kk(t){return window.crypto.getRandomValues(t)}function el(){return window.crypto.getRandomValues(Qf),Qf[0]}function jn(){const t=Date.now(),e=el()*1024+(el()&1023),n=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,i=el();n[0]=t/2**40,n[1]=t/2**32,n[2]=t/2**24,n[3]=t/2**16,n[4]=t/2**8,n[5]=t,n[6]=112|r>>>8,n[7]=r,n[8]=128|o>>>24,n[9]=o>>>16,n[10]=o>>>8,n[11]=o,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i;let s="";for(let a=0;a>>4),s+=Wf.charAt(n[a]&15),(a===3||a===5||a===7||a===9)&&(s+="-");return s}async function Pk(t,e){return window.crypto.subtle.generateKey(vd,t,e)}async function tl(t){return window.crypto.subtle.exportKey(bv,t)}async function Nk(t,e,n){return window.crypto.subtle.importKey(bv,t,vd,e,n)}async function xk(t,e){return window.crypto.subtle.sign(vd,t,e)}async function Rv(t){const e=await Iv(t),n=new Uint8Array(e);return wc(n)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Cd="storage_not_supported",Mk="stubbed_public_client_application_called",Ov="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.30.0 2025-08-05 */const Dk={[Cd]:"Given storage configuration option was not supported.",[Mk]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[Ov]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};class wd extends We{constructor(e,n){super(e,n),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,wd.prototype)}}function Ad(t){return new wd(t,Dk[t])}/*! @azure/msal-browser v3.30.0 2025-08-05 */function Lk(t){t.location.hash="",typeof t.history.replaceState=="function"&&t.history.replaceState(null,"",`${t.location.origin}${t.location.pathname}${t.location.search}`)}function Uk(t){const e=t.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Td(){return window.parent!==window}function Hk(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Qt.POPUP_NAME_PREFIX}.`)===0}function ar(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function Bk(){const e=new Oe(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function Fk(){if(Oe.hashContainsKnownProperties(window.location.hash)&&Td())throw te(ov)}function Kk(t){if(Td()&&!t)throw te(rv)}function $k(){if(Hk())throw te(iv)}function kv(){if(typeof window>"u")throw te(Cc)}function Pv(t){if(!t)throw te(vv)}function Ed(t){kv(),Fk(),$k(),Pv(t)}function Yf(t,e){if(Ed(t),Kk(e.system.allowRedirectInIframe),e.cache.cacheLocation===Bt.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw Ad(Ov)}function Nv(t){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(t).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function qk(){return jn()}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Ea{navigateInternal(e,n){return Ea.defaultNavigateWindow(e,n)}navigateExternal(e,n){return Ea.defaultNavigateWindow(e,n)}static defaultNavigateWindow(e,n){return n.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},n.timeout)})}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class jk{async sendGetRequestAsync(e,n){let r,o={},i=0;const s=Jf(n);try{r=await fetch(e,{method:Gf.GET,headers:s})}catch{throw te(window.navigator.onLine?uv:Ta)}o=Xf(r.headers);try{return i=r.status,{headers:o,body:await r.json(),status:i}}catch{throw Ff(te(Yl),i,o)}}async sendPostRequestAsync(e,n){const r=n&&n.body||"",o=Jf(n);let i,s=0,a={};try{i=await fetch(e,{method:Gf.POST,headers:o,body:r})}catch{throw te(window.navigator.onLine?lv:Ta)}a=Xf(i.headers);try{return s=i.status,{headers:a,body:await i.json(),status:s}}catch{throw Ff(te(Yl),s,a)}}}function Jf(t){try{const e=new Headers;if(!(t&&t.headers))return e;const n=t.headers;return Object.entries(n).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw te(Tv)}}function Xf(t){try{const e={};return t.forEach((n,r)=>{e[r]=n}),e}catch{throw te(Ev)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Vk=6e4,Xl=1e4,Gk=3e4,zk=2e3;function Wk({auth:t,cache:e,system:n,telemetry:r},o){const i={clientId:P.EMPTY_STRING,authority:`${P.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:P.EMPTY_STRING,authorityMetadata:P.EMPTY_STRING,redirectUri:typeof window<"u"?ar():"",postLogoutRedirectUri:P.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:lr.AAD,OIDCOptions:{serverResponseType:Ts.FRAGMENT,defaultScopes:[P.OPENID_SCOPE,P.PROFILE_SCOPE,P.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:Qu.None,tenant:P.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},s={cacheLocation:Bt.SessionStorage,temporaryCacheLocation:Bt.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Bt.LocalStorage),claimsBasedCachingEnabled:!1},a={loggerCallback:()=>{},logLevel:Ye.Info,piiLoggingEnabled:!1},l={...{...By,loggerOptions:a,networkClient:o?new jk:lk,navigationClient:new Ea,loadFrameTimeout:0,windowHashTimeout:(n==null?void 0:n.loadFrameTimeout)||Vk,iframeHashTimeout:(n==null?void 0:n.loadFrameTimeout)||Xl,navigateFrameWait:0,redirectNavigationTimeout:Gk,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(n==null?void 0:n.nativeBrokerHandshakeTimeout)||zk,pollIntervalMilliseconds:Qt.DEFAULT_POLL_INTERVAL_MS},...n,loggerOptions:(n==null?void 0:n.loggerOptions)||a},u={application:{appName:P.EMPTY_STRING,appVersion:P.EMPTY_STRING},client:new fk};if((t==null?void 0:t.protocolMode)!==lr.OIDC&&(t!=null&&t.OIDCOptions)&&new $r(l.loggerOptions).warning(JSON.stringify(qe(Py))),t!=null&&t.protocolMode&&t.protocolMode!==lr.AAD&&(l!=null&&l.allowNativeBroker))throw qe(Ny);return{auth:{...i,...t,OIDCOptions:{...i.OIDCOptions,...t==null?void 0:t.OIDCOptions}},cache:{...s,...e},system:l,telemetry:{...u,...r}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Qk="@azure/msal-browser",fi="3.30.0";/*! @azure/msal-browser v3.30.0 2025-08-05 */class bd{static loggerCallback(e,n){switch(e){case Ye.Error:console.error(n);return;case Ye.Info:console.info(n);return;case Ye.Verbose:console.debug(n);return;case Ye.Warning:console.warn(n);return;default:console.log(n);return}}constructor(e){var c;this.browserEnvironment=typeof window<"u",this.config=Wk(e,this.browserEnvironment);let n;try{n=window[Bt.SessionStorage]}catch{}const r=n==null?void 0:n.getItem(Ek),o=(c=n==null?void 0:n.getItem(bk))==null?void 0:c.toLowerCase(),i=o==="true"?!0:o==="false"?!1:void 0,s={...this.config.system.loggerOptions},a=r&&Object.keys(Ye).includes(r)?Ye[r]:void 0;a&&(s.loggerCallback=bd.loggerCallback,s.logLevel=a),i!==void 0&&(s.piiLoggingEnabled=i),this.logger=new $r(s,Qk,fi),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class To extends bd{getModuleName(){return To.MODULE_NAME}getId(){return To.ID}async initialize(){return this.available=typeof window<"u",this.available}}To.MODULE_NAME="";To.ID="StandardOperatingContext";/*! @azure/msal-browser v3.30.0 2025-08-05 */function $n(t){return new TextDecoder().decode(Yk(t))}function Yk(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw te(wv)}const n=atob(e);return Uint8Array.from(n,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Jk{constructor(){this.dbName=Jl,this.version=wk,this.tableName=Ak,this.dbOpen=!1}async open(){return new Promise((e,n)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const i=o;this.db=i.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>n(te(md)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(te(Uo));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),n(c.target.result)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async setItem(e,n){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(te(Uo));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(n,e);a.addEventListener("success",()=>{this.closeConnection(),r()}),a.addEventListener("error",c=>{this.closeConnection(),o(c)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(te(Uo));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),n()}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,n)=>{if(!this.db)return n(te(Uo));const i=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();i.addEventListener("success",s=>{const a=s;this.closeConnection(),e(a.target.result)}),i.addEventListener("error",s=>{this.closeConnection(),n(s)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(te(Uo));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),n(c.target.result===1)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,n)=>{const r=window.indexedDB.deleteDatabase(Jl),o=setTimeout(()=>n(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),n(!1)))})}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Zl{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,n){this.cache.set(e,n)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((n,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Xk{constructor(e){this.inMemoryCache=new Zl,this.indexedDBCache=new Jk,this.logger=e}handleDatabaseAccessError(e){if(e instanceof bs&&e.errorCode===md)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const n=this.inMemoryCache.getItem(e);if(!n)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return n}async setItem(e,n){this.inMemoryCache.setItem(e,n);try{await this.indexedDBCache.setItem(e,n)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(n){this.handleDatabaseAccessError(n)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(n){this.handleDatabaseAccessError(n)}return e}async containsKey(e){const n=this.inMemoryCache.containsKey(e);if(!n)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return n}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class pi{constructor(e,n,r){this.logger=e,Ok(r??!1),this.cache=new Xk(this.logger),this.performanceClient=n}createNewGuid(){return jn()}base64Encode(e){return yd(e)}base64Decode(e){return $n(e)}base64UrlEncode(e){return qs(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var u;const n=(u=this.performanceClient)==null?void 0:u.startMeasurement(_.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await Pk(pi.EXTRACTABLE,pi.POP_KEY_USAGES),o=await tl(r.publicKey),i={e:o.e,kty:o.kty,n:o.n},s=Zf(i),a=await this.hashString(s),c=await tl(r.privateKey),l=await Nk(c,!1,["sign"]);return await this.cache.setItem(a,{privateKey:l,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),n&&n.end({success:!0}),a}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,n,r,o){var y;const i=(y=this.performanceClient)==null?void 0:y.startMeasurement(_.CryptoOptsSignJwt,o),s=await this.cache.getItem(n);if(!s)throw te(gd);const a=await tl(s.publicKey),c=Zf(a),l=qs(JSON.stringify({kid:n})),u=dd.getShrHeaderString({...r==null?void 0:r.header,alg:a.alg,kid:l}),d=qs(u);e.cnf={jwk:JSON.parse(c)};const h=qs(JSON.stringify(e)),f=`${d}.${h}`,g=new TextEncoder().encode(f),m=await xk(s.privateKey,g),C=wc(new Uint8Array(m)),T=`${f}.${C}`;return i&&i.end({success:!0}),T}async hashString(e){return Rv(e)}}pi.POP_KEY_USAGES=["sign","verify"];pi.EXTRACTABLE=!0;function Zf(t){return JSON.stringify(t,Object.keys(t).sort())}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Zk{constructor(){if(!window.localStorage)throw Ad(Cd)}getItem(e){return window.localStorage.getItem(e)}setItem(e,n){window.localStorage.setItem(e,n)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class eP{constructor(){if(!window.sessionStorage)throw Ad(Cd)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,n){window.sessionStorage.setItem(e,n)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function xv(t,e){if(!e)return null;try{return gn.parseRequestState(t,e).libraryState.meta}catch{throw j(ui)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const tP=24*60*60*1e3;class nP{getItem(e){const n=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o{const o=decodeURIComponent(r).trim().split("=");n.push(o[0])}),n}containsKey(e){return this.getKeys().includes(e)}}function rP(t){const e=new Date;return new Date(e.getTime()+t*tP).toUTCString()}/*! @azure/msal-browser v3.30.0 2025-08-05 */class eu extends di{constructor(e,n,r,o,i,s){super(e,r,o,i),this.cacheConfig=n,this.logger=o,this.internalStorage=new Zl,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new nP,n.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=s}setupBrowserStorage(e){try{switch(e){case Bt.LocalStorage:return new Zk;case Bt.SessionStorage:return new eP;case Bt.MemoryStorage:default:break}}catch(n){this.logger.error(n)}return this.cacheConfig.cacheLocation=Bt.MemoryStorage,new Zl}migrateCacheEntries(){const e=this.browserStorage.getItem(sn.VERSION);e&&this.logger.info(`MSAL.js was last initialized with version ${e}`),e!==fi&&this.browserStorage.setItem(sn.VERSION,fi);const n=`${P.CACHE_PREFIX}.${ft.ID_TOKEN}`,r=`${P.CACHE_PREFIX}.${ft.CLIENT_INFO}`,o=`${P.CACHE_PREFIX}.${ft.ERROR}`,i=`${P.CACHE_PREFIX}.${ft.ERROR_DESC}`,s=this.browserStorage.getItem(n),a=this.browserStorage.getItem(r),c=this.browserStorage.getItem(o),l=this.browserStorage.getItem(i),u=[s,a,c,l];[ft.ID_TOKEN,ft.CLIENT_INFO,ft.ERROR,ft.ERROR_DESC].forEach((h,f)=>{const p=u[f];p&&this.setTemporaryCache(h,p,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.cryptoImpl.createNewGuid(),n=this.getItem(sn.ACCOUNT_KEYS),r=this.getItem(`${sn.TOKEN_KEYS}.${this.clientId}`);if(n&&r){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(i=>{if(this.isCredentialKey(i)){const s=this.getItem(i);if(s){const a=this.validateAndParseJson(s);if(a&&a.hasOwnProperty("credentialType"))switch(a.credentialType){case we.ID_TOKEN:if(kf(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,we.ID_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${i}`);break;case we.ACCESS_TOKEN:case we.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Of(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,we.ACCESS_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${i}`);break;case we.REFRESH_TOKEN:if(Pf(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,we.REFRESH_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${i}`);break}}}if(this.isAccountKey(i)){const s=this.getItem(i);if(s){const a=this.validateAndParseJson(s);a&&dt.isAccountEntity(a)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${i} found, saving key to account key map`),this.addAccountKeyToMap(i,e))}}})}validateAndParseJson(e){try{const n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,n,r){let o=[];for(let s=0;s<=20;s++)try{this.browserStorage.setItem(e,n),s>0&&this.removeAccessTokenKeys(o.slice(0,s),r);break}catch(a){const c=Hy(a);if(c.errorCode===od&&s<20){if(o.length||(e===`${sn.TOKEN_KEYS}.${this.clientId}`?o=JSON.parse(n).accessToken:o=this.getTokenKeys().accessToken),o.length<=s)throw c;this.removeAccessToken(o[s],r,!1)}else throw c}}getAccount(e,n,r){this.logger.trace("BrowserCacheManager.getAccount called");const o=this.getCachedAccountEntity(e,n);return this.updateOutdatedCachedAccount(e,o,n,r)}getCachedAccountEntity(e,n){const r=this.getItem(e);if(!r)return this.removeAccountKeyFromMap(e,n),null;const o=this.validateAndParseJson(r);return!o||!dt.isAccountEntity(o)?null:di.toObject(new dt,o)}setAccount(e,n){this.logger.trace("BrowserCacheManager.setAccount called");const r=e.generateAccountKey();e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),n),this.addAccountKeyToMap(r,n)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(sn.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e,n){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const r=this.getAccountKeys();r.indexOf(e)===-1?(r.push(e),this.setItem(sn.ACCOUNT_KEYS,JSON.stringify(r),n),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e,n){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const r=this.getAccountKeys(),o=r.indexOf(e);if(o>-1){if(r.splice(o,1),r.length===0){this.removeItem(sn.ACCOUNT_KEYS);return}else this.setItem(sn.ACCOUNT_KEYS,JSON.stringify(r),n);this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")}else this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e,n){super.removeAccount(e,n),this.removeAccountKeyFromMap(e,n)}removeOutdatedAccount(e,n){this.removeItem(e),this.removeAccountKeyFromMap(e,n)}removeIdToken(e,n){super.removeIdToken(e,n),this.removeTokenKey(e,we.ID_TOKEN,n)}removeAccessToken(e,n,r=!0){var o;super.removeAccessToken(e,n),(o=this.performanceClient)==null||o.incrementFields({accessTokensRemoved:1},n),r&&this.removeTokenKey(e,we.ACCESS_TOKEN,n)}removeAccessTokenKeys(e,n){this.logger.trace("removeAccessTokenKey called");const r=this.getTokenKeys();let o=0;if(e.forEach(i=>{const s=r.accessToken.indexOf(i);s>-1&&(r.accessToken.splice(s,1),o++)}),o>0){this.logger.info(`removed ${o} accessToken keys from tokenKeys map`),this.setTokenKeys(r,n);return}}removeRefreshToken(e,n){super.removeRefreshToken(e,n),this.removeTokenKey(e,we.REFRESH_TOKEN,n)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${sn.TOKEN_KEYS}.${this.clientId}`);if(e){const n=this.validateAndParseJson(e);if(n&&n.hasOwnProperty("idToken")&&n.hasOwnProperty("accessToken")&&n.hasOwnProperty("refreshToken"))return n;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}setTokenKeys(e,n){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(`${sn.TOKEN_KEYS}.${this.clientId}`);return}else this.setItem(`${sn.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(e),n)}addTokenKey(e,n,r){this.logger.trace("BrowserCacheManager addTokenKey called");const o=this.getTokenKeys();switch(n){case we.ID_TOKEN:o.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),o.idToken.push(e));break;case we.ACCESS_TOKEN:const i=o.accessToken.indexOf(e);i!==-1&&o.accessToken.splice(i,1),this.logger.trace(`access token ${i===-1?"added to":"updated in"} map`),o.accessToken.push(e);break;case we.REFRESH_TOKEN:o.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),o.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${n}`),j(ql)}this.setTokenKeys(o,r)}removeTokenKey(e,n,r,o=this.getTokenKeys()){switch(this.logger.trace("BrowserCacheManager removeTokenKey called"),n){case we.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const i=o.idToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),o.idToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case we.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const s=o.accessToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),o.accessToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case we.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const a=o.refreshToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),o.refreshToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${n}`),j(ql)}this.setTokenKeys(o,r)}getIdTokenCredential(e,n){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeIdToken(e,n),null;const o=this.validateAndParseJson(r);return!o||!kf(o)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),o)}setIdTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const r=Fo(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),n),this.addTokenKey(r,we.ID_TOKEN,n)}getAccessTokenCredential(e,n){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,we.ACCESS_TOKEN,n),null;const o=this.validateAndParseJson(r);return!o||!Of(o)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),o)}setAccessTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const r=Fo(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),n),this.addTokenKey(r,we.ACCESS_TOKEN,n)}getRefreshTokenCredential(e,n){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,we.REFRESH_TOKEN,n),null;const o=this.validateAndParseJson(r);return!o||!Pf(o)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),o)}setRefreshTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const r=Fo(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),n),this.addTokenKey(r,we.REFRESH_TOKEN,n)}getAppMetadata(e){const n=this.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!GR(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e,n){this.logger.trace("BrowserCacheManager.setAppMetadata called");const r=VR(e);this.setItem(r,JSON.stringify(e),n)}getServerTelemetry(e){const n=this.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!qR(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,n,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(n),r)}getAuthorityMetadata(e){const n=this.internalStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return r&&zR(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(n=>this.isAuthorityMetadata(n))}setWrapperMetadata(e,n){this.internalStorage.setItem($s.WRAPPER_SKU,e),this.internalStorage.setItem($s.WRAPPER_VER,n)}getWrapperMetadata(){const e=this.internalStorage.getItem($s.WRAPPER_SKU)||P.EMPTY_STRING,n=this.internalStorage.getItem($s.WRAPPER_VER)||P.EMPTY_STRING;return[e,n]}setAuthorityMetadata(e,n){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(n))}getActiveAccount(e){const n=this.generateCacheKey(ft.ACTIVE_ACCOUNT_FILTERS),r=this.getItem(n);if(!r){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const i=this.generateCacheKey(ft.ACTIVE_ACCOUNT),s=this.getItem(i);if(!s)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const a=this.getAccountInfoFilteredBy({localAccountId:s},e);return a?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(a,e),a):null}const o=this.validateAndParseJson(r);return o?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:o.homeAccountId,localAccountId:o.localAccountId,tenantId:o.tenantId},e)):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e,n){const r=this.generateCacheKey(ft.ACTIVE_ACCOUNT_FILTERS),o=this.generateCacheKey(ft.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const i={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId,lastUpdatedAt:Date.now().toString()};this.setItem(r,JSON.stringify(i),n),this.setItem(o,e.localAccountId,n)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r),this.browserStorage.removeItem(o)}getThrottlingCache(e){const n=this.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!jR(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,n,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(n),r)}getTemporaryCache(e,n){const r=n?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const i=this.cookieStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),i}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===Bt.LocalStorage){const i=this.browserStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),i}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,n,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,n),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,n,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(e){await this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(n=>{(n.indexOf(P.CACHE_PREFIX)!==-1||n.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(n)}),this.browserStorage.getKeys().forEach(n=>{(n.indexOf(P.CACHE_PREFIX)!==-1||n.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(n)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,n){e.addQueueMeasurement(_.ClearTokensAndKeysWithClaims,n);const r=this.getTokenKeys();let o=0;r.accessToken.forEach(i=>{const s=this.getAccessTokenCredential(i,n);s!=null&&s.requestedClaimsHash&&i.includes(s.requestedClaimsHash.toLowerCase())&&(this.removeAccessToken(i,n),o++)}),o>0&&this.logger.warning(`${o} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):pn.startsWith(e,P.CACHE_PREFIX)||pn.startsWith(e,ft.ADAL_ID_TOKEN)?e:`${P.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:n}}=gn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Be.AUTHORITY}.${n}`)}generateNonceKey(e){const{libraryState:{id:n}}=gn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Be.NONCE_IDTOKEN}.${n}`)}generateStateKey(e){const{libraryState:{id:n}}=gn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Be.REQUEST_STATE}.${n}`)}getCachedAuthority(e){const n=this.generateStateKey(e),r=this.getTemporaryCache(n);if(!r)return null;const o=this.generateAuthorityKey(r);return this.getTemporaryCache(o)}updateCacheEntries(e,n,r,o,i){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const s=this.generateStateKey(e);this.setTemporaryCache(s,e,!1);const a=this.generateNonceKey(e);this.setTemporaryCache(a,n,!1);const c=this.generateAuthorityKey(e);if(this.setTemporaryCache(c,r,!1),i){const l={credential:i.homeAccountId,type:Jt.HOME_ACCOUNT_ID};this.setTemporaryCache(Be.CCS_CREDENTIAL,JSON.stringify(l),!0)}else if(o){const l={credential:o,type:Jt.UPN};this.setTemporaryCache(Be.CCS_CREDENTIAL,JSON.stringify(l),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(n=>{n.indexOf(e)!==-1&&this.removeTemporaryItem(n)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(Be.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Be.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Be.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Be.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(Be.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(Be.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const n=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(n);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||P.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(n=>{if(n.indexOf(Be.REQUEST_STATE)===-1)return;const r=this.temporaryCacheStorage.getItem(n);if(!r)return;const o=xv(this.cryptoImpl,r);o&&o.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const n=yd(JSON.stringify(e));this.setTemporaryCache(Be.REQUEST_PARAMS,n,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const n=this.getTemporaryCache(Be.REQUEST_PARAMS,!0);if(!n)throw te(av);let r;try{r=JSON.parse($n(n))}catch(o){throw this.logger.errorPii(`Attempted to parse: ${n}`),this.logger.error(`Parsing cached token request threw with error: ${o}`),te(cv)}if(this.removeTemporaryItem(this.generateCacheKey(Be.REQUEST_PARAMS)),!r.authority){const o=this.generateAuthorityKey(e),i=this.getTemporaryCache(o);if(!i)throw te(pd);r.authority=i}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Be.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const n=this.validateAndParseJson(e);return n||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const n=this.getInteractionInProgress();return e?n===this.clientId:!!n}getInteractionInProgress(){const e=`${P.CACHE_PREFIX}.${Be.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const n=`${P.CACHE_PREFIX}.${Be.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw te(Zy);this.setTemporaryCache(n,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(n)}getLegacyLoginHint(){const e=this.getTemporaryCache(ft.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(ft.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const n=this.getTemporaryCache(ft.ID_TOKEN,!0);n&&(this.browserStorage.removeItem(this.generateCacheKey(ft.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=n||e;if(r){const o=_o(r,$n);if(o.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.preferred_username;if(o.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,n,r){const o=Fo(n);if(e!==o){const i=this.getItem(e);if(i)return this.browserStorage.removeItem(e),this.setItem(o,i,r),this.logger.verbose(`Updated an outdated ${n.credentialType} cache key`),o;this.logger.error(`Attempted to update an outdated ${n.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,n){var a,c,l;const r=dc((a=e.account)==null?void 0:a.homeAccountId,(c=e.account)==null?void 0:c.environment,e.idToken,this.clientId,e.tenantId);let o;n.claims&&(o=await this.cryptoImpl.hashString(n.claims));const i=hc((l=e.account)==null?void 0:l.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,$n,void 0,e.tokenType,void 0,n.sshKid,n.claims,o),s={idToken:r,accessToken:i};return this.saveCacheRecord(s,e.correlationId)}async saveCacheRecord(e,n,r){try{await super.saveCacheRecord(e,n,r)}catch(o){if(o instanceof Wo&&this.performanceClient&&n)try{const i=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:i.refreshToken.length,cacheIdCount:i.idToken.length,cacheAtCount:i.accessToken.length},n)}catch{}throw o}}}const oP=(t,e)=>{const n={cacheLocation:Bt.MemoryStorage,temporaryCacheLocation:Bt.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new eu(t,n,ma,e)};/*! @azure/msal-browser v3.30.0 2025-08-05 */function iP(t,e,n,r,o){return t.verbose("getAllAccounts called"),n?e.getAllAccounts(r,o):[]}function sP(t,e,n,r){if(e.trace("getAccount called"),Object.keys(t).length===0)return e.warning("getAccount: No accountFilter provided"),null;const o=n.getAccountInfoFilteredBy(t,r);return o?(e.verbose("getAccount: Account matching provided filter found, returning"),o):(e.verbose("getAccount: No matching account found, returning null"),null)}function aP(t,e,n,r){if(e.trace("getAccountByUsername called"),!t)return e.warning("getAccountByUsername: No username provided"),null;const o=n.getAccountInfoFilteredBy({username:t},r);return o?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${t}`),o):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function cP(t,e,n,r){if(e.trace("getAccountByHomeId called"),!t)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const o=n.getAccountInfoFilteredBy({homeAccountId:t},r);return o?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${t}`),o):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function lP(t,e,n,r){if(e.trace("getAccountByLocalId called"),!t)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const o=n.getAccountInfoFilteredBy({localAccountId:t},r);return o?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${t}`),o):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function uP(t,e,n){e.setActiveAccount(t,n)}function dP(t,e){return t.getActiveAccount(e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const me={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.30.0 2025-08-05 */class hP{constructor(e){this.eventCallbacks=new Map,this.logger=e||new $r({})}addEventCallback(e,n,r){if(typeof window<"u"){const o=r||qk();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,n||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,n,r,o){if(typeof window<"u"){const i={eventType:e,interactionType:n||null,payload:r||null,error:o||null,timestamp:Date.now()};this.eventCallbacks.forEach(([s,a],c)=>{(a.length===0||a.includes(e))&&(this.logger.verbose(`Emitting event to callback ${c}: ${e}`),s.apply(null,[i]))})}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Mv{constructor(e,n,r,o,i,s,a,c,l){this.config=e,this.browserStorage=n,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=i,this.navigationClient=s,this.nativeMessageHandler=c,this.correlationId=l||jn(),this.logger=o.clone(Qt.MSAL_SKU,fi,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){dt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(this.correlationId),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null,this.correlationId));try{await this.browserStorage.removeAccount(dt.generateAccountCacheKey(e),this.correlationId),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(this.correlationId),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const n=e||this.config.auth.redirectUri;return Oe.getAbsoluteUrl(n,ar())}initializeServerTelemetryManager(e,n){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:n||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new ts(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:n}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(_.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},i=e.requestAuthority||this.config.auth.authority,s=r!=null&&r.length?r==="true":this.config.auth.instanceAware,a=n&&s?this.config.auth.authority.replace(Oe.getDomainFromUrl(i),n.environment):i,c=_t.generateAuthority(a,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),l=await G($y,_.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(c,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(n&&!l.isAlias(n.environment))throw qe(xy);return l}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const fP=32;async function pP(t,e,n){t.addQueueMeasurement(_.GeneratePkceCodes,n);const r=So(gP,_.GenerateCodeVerifier,e,t,n)(t,e,n),o=await G(mP,_.GenerateCodeChallengeFromVerifier,e,t,n)(r,t,e,n);return{verifier:r,challenge:o}}function gP(t,e,n){try{const r=new Uint8Array(fP);return So(kk,_.GetRandomValues,e,t,n)(r),wc(r)}catch{throw te(hd)}}async function mP(t,e,n,r){e.addQueueMeasurement(_.GenerateCodeChallengeFromVerifier,r);try{const o=await G(Iv,_.Sha256Digest,n,e,r)(t,e,r);return wc(new Uint8Array(o))}catch{throw te(hd)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function _d(t,e,n,r){n.addQueueMeasurement(_.InitializeBaseRequest,t.correlationId);const o=t.authority||e.auth.authority,i=[...t&&t.scopes||[]],s={...t,correlationId:t.correlationId,authority:o,scopes:i};if(!s.authenticationScheme)s.authenticationScheme=Fe.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(s.authenticationScheme===Fe.SSH){if(!t.sshJwk)throw qe(fc);if(!t.sshKid)throw qe(ky)}r.verbose(`Authentication Scheme set to "${s.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&t.claims&&!pn.isEmptyObj(t.claims)&&(s.requestedClaimsHash=await Rv(t.claims)),s}async function yP(t,e,n,r,o){r.addQueueMeasurement(_.InitializeSilentRequest,t.correlationId);const i=await G(_d,_.InitializeBaseRequest,o,r,t.correlationId)(t,n,r,o);return{...t,...i,account:e,forceRefresh:t.forceRefresh||!1}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class vi extends Mv{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const n=await G(pP,_.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:P.EMPTY_STRING,codeVerifier:n.verifier};return e.codeChallenge=n.challenge,e.codeChallengeMethod=P.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const n={correlationId:this.correlationId||jn(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),n.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",n.correlationId),n.postLogoutRedirectUri=Oe.getAbsoluteUrl(e.postLogoutRedirectUri,ar())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",n.correlationId),n.postLogoutRedirectUri=Oe.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,ar())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",n.correlationId),n.postLogoutRedirectUri=Oe.getAbsoluteUrl(ar(),ar())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",n.correlationId),n}getLogoutHintFromIdTokenClaims(e){const n=e.idTokenClaims;if(n){if(n.login_hint)return n.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const n=await G(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Vy(n,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:n,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}=e;this.performanceClient.addQueueMeasurement(_.StandardInteractionClientGetClientConfiguration,this.correlationId);const a=await G(this.getDiscoveredAuthority.bind(this),_.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}),c=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:c.loggerCallback,piiLoggingEnabled:c.piiLoggingEnabled,logLevel:c.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:n,libraryInfo:{sku:Qt.MSAL_SKU,version:fi,cpu:P.EMPTY_STRING,os:P.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,n){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:n},i=gn.setRequestState(this.browserCrypto,e&&e.state||P.EMPTY_STRING,o),a={...await G(_d,_.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:i,nonce:e.nonce||jn(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return a;const c=e.account||this.browserStorage.getActiveAccount(this.correlationId);if(c&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${c.homeAccountId}`,this.correlationId),a.account=c),!a.loginHint&&!c){const l=this.browserStorage.getLegacyLoginHint();l&&(a.loginHint=l)}return a}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const vP="ContentError",Dv="user_switch";/*! @azure/msal-browser v3.30.0 2025-08-05 */const CP="USER_INTERACTION_REQUIRED",wP="USER_CANCEL",AP="NO_NETWORK",TP="PERSISTENT_ERROR",EP="DISABLED",bP="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.30.0 2025-08-05 */const _P=-2147186943,SP={[Dv]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Ln extends We{constructor(e,n,r){super(e,n),Object.setPrototypeOf(this,Ln.prototype),this.name="NativeAuthError",this.ext=r}}function Ho(t){if(t.ext&&t.ext.status&&(t.ext.status===TP||t.ext.status===EP)||t.ext&&t.ext.error&&t.ext.error===_P)return!0;switch(t.errorCode){case vP:return!0;default:return!1}}function tu(t,e,n){if(n&&n.status)switch(n.status){case bP:return zl(qy);case CP:return new En(t,e);case wP:return te(Ao);case AP:return te(Ta)}return new Ln(t,SP[t]||e,n)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Lv extends vi{async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentCacheClientAcquireToken,e.correlationId);const n=this.initializeServerTelemetryManager(ze.acquireTokenSilent_silentFlow),r=await G(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new ck(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const s=(await G(o.acquireCachedToken.bind(o),_.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),s}catch(i){throw i instanceof bs&&i.errorCode===gd&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),i}}logout(e){this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(n==null?void 0:n.account)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Qo extends Mv{constructor(e,n,r,o,i,s,a,c,l,u,d,h){var p;super(e,n,r,o,i,s,c,l,h),this.apiId=a,this.accountId=u,this.nativeMessageHandler=l,this.nativeStorageManager=d,this.silentCacheClient=new Lv(e,this.nativeStorageManager,r,o,i,s,c,l,h),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const f=this.nativeMessageHandler.getExtensionId()===$o.PREFERRED_EXTENSION_ID?"chrome":(p=this.nativeMessageHandler.getExtensionId())!=null&&p.length?"unknown":void 0;this.skus=ts.makeExtraSkuString({libraryName:Qt.MSAL_SKU,libraryVersion:fi,extensionName:f,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[VO]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(_.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const n=this.performanceClient.startMeasurement(_.NativeInteractionClientAcquireToken,e.correlationId),r=qn();try{const o=await this.initializeNativeRequest(e);try{const l=await this.acquireTokensFromCache(this.accountId,o);return n.end({success:!0,isNativeBroker:!1,fromCache:!0}),l}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...i}=o,s={method:oo.GetToken,request:i},a=await this.nativeMessageHandler.sendMessage(s),c=this.validateNativeResponse(a);return await this.handleNativeResponse(c,o,r).then(l=>(n.end({success:!0,isNativeBroker:!0,requestId:l.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),l)).catch(l=>{throw n.end({success:!1,errorCode:l.errorCode,subErrorCode:l.subError,isNativeBroker:!0}),l})}catch(o){throw o instanceof Ln&&this.serverTelemetryManager.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,n){return{authority:e.authority,correlationId:this.correlationId,scopes:rt.fromString(e.scope).asArray(),account:n,forceRefresh:!1}}async acquireTokensFromCache(e,n){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),j(Kl);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},n.correlationId);if(!r)throw j(Kl);try{const o=this.createSilentCacheRequest(n,r),i=await this.silentCacheClient.acquireToken(o),s={...r,idTokenClaims:i==null?void 0:i.idTokenClaims,idToken:i==null?void 0:i.idToken};return{...i,account:s}}catch(o){throw o}}async acquireTokenRedirect(e,n){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),i={method:oo.GetToken,request:o};try{const c=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(c)}catch(c){if(c instanceof Ln&&(this.serverTelemetryManager.setNativeBrokerErrorCode(c.errorCode),Ho(c)))throw c}this.browserStorage.setTemporaryCache(Be.NATIVE_REQUEST,JSON.stringify(o),!0);const s={apiId:ze.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);n.end({success:!0}),await this.navigationClient.navigateExternal(a,s)}async handleRedirectPromise(e,n){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&n&&(e==null||e.addFields({errorCode:"no_cached_request"},n)),null;const{prompt:o,...i}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Be.NATIVE_REQUEST));const s={method:oo.GetToken,request:i},a=qn();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const c=await this.nativeMessageHandler.sendMessage(s);this.validateNativeResponse(c);const l=this.handleNativeResponse(c,i,a);this.browserStorage.setInteractionInProgress(!1);const u=await l;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),u}catch(c){throw this.browserStorage.setInteractionInProgress(!1),c}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,n,r){var u;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=_o(e.id_token,$n),i=this.createHomeAccountIdentifier(e,o),s=(u=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:n.accountId},this.correlationId))==null?void 0:u.homeAccountId;if(i!==s&&e.account.id!==n.accountId)throw tu(Dv);const a=await this.getDiscoveredAuthority({requestAuthority:n.authority}),c=ld(this.browserStorage,a,i,$n,this.correlationId,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger),l=await this.generateAuthenticationResult(e,n,o,c,a.canonicalAuthority,r);return this.cacheAccount(c),this.cacheNativeTokens(e,n,i,o,e.access_token,l.tenantId,r),l}createHomeAccountIdentifier(e,n){return dt.generateHomeAccountId(e.client_info||P.EMPTY_STRING,hn.Default,this.logger,this.browserCrypto,n)}generateScopes(e,n){return e.scope?rt.fromString(e.scope):rt.fromString(n.scope)}async generatePopAccessToken(e,n){if(n.tokenType===Fe.POP&&n.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new hi(this.browserCrypto),o={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce};if(!n.keyId)throw j(zu);return r.signPopToken(e.access_token,n.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,n,r,o,i,s){const a=this.addTelemetryFromNativeResponse(e),c=e.scope?rt.fromString(e.scope):rt.fromString(n.scope),l=e.account.properties||{},u=l.UID||r.oid||r.sub||P.EMPTY_STRING,d=l.TenantId||r.tid||P.EMPTY_STRING,h=nd(o.getAccountInfo(),void 0,r,e.id_token);h.nativeAccountId!==e.account.id&&(h.nativeAccountId=e.account.id);const f=await this.generatePopAccessToken(e,n),p=n.tokenType===Fe.POP?Fe.POP:Fe.BEARER;return{authority:i,uniqueId:u,tenantId:d,scopes:c.asArray(),account:h,idToken:e.id_token,idTokenClaims:r,accessToken:f,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:new Date(Number(s+e.expires_in)*1e3),tokenType:p,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(e,this.correlationId).catch(n=>{this.logger.error(`Error occurred while removing account context from browser storage. ${n}`)})}cacheNativeTokens(e,n,r,o,i,s,a){const c=dc(r,n.authority,e.id_token||"",n.clientId,o.tid||""),l=n.tokenType===Fe.POP?P.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,u=a+l,d=this.generateScopes(e,n),h=hc(r,n.authority,i,n.clientId,o.tid||s,d.printScopes(),u,0,$n,void 0,n.tokenType,void 0,n.keyId),f={idToken:c,accessToken:h};this.nativeStorageManager.saveCacheRecord(f,n.correlationId,n.storeInCache)}addTelemetryFromNativeResponse(e){const n=this.getMATSFromResponse(e);return n?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:n.broker_version,matsAccountJoinOnStart:n.account_join_on_start,matsAccountJoinOnEnd:n.account_join_on_end,matsDeviceJoin:n.device_join,matsPromptBehavior:n.prompt_behavior,matsApiErrorCode:n.api_error_code,matsUiVisible:n.ui_visible,matsSilentCode:n.silent_code,matsSilentBiSubCode:n.silent_bi_sub_code,matsSilentMessage:n.silent_message,matsSilentStatus:n.silent_status,matsHttpStatus:n.http_status,matsHttpEventCount:n.http_event_count},this.correlationId),n):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw ey(Ku,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const n=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:n,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new Oe(n);r.validateAsUri();const{scopes:o,...i}=e,s=new rt(o||[]);s.appendScopes(yi);const a=()=>{switch(this.apiId){case ze.ssoSilent:case ze.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),gt.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case gt.NONE:case gt.CONSENT:case gt.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),te(Cv)}},c={...i,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:a(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(c.signPopToken&&e.popKid)throw te(Av);if(this.handleExtraBrokerParams(c),c.extraParameters=c.extraParameters||{},c.extraParameters.telemetry=$o.MATS_TELEMETRY,e.authenticationScheme===Fe.POP){const l={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},u=new hi(this.browserCrypto);let d;if(c.keyId)d=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:c.keyId})),c.signPopToken=!1;else{const h=await G(u.generateCnf.bind(u),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(l,this.logger);d=h.reqCnfString,c.keyId=h.kid,c.signPopToken=!0}c.reqCnf=d}return this.addRequestSKUs(c),c}handleExtraBrokerParams(e){var i;const n=e.extraParameters&&e.extraParameters.hasOwnProperty(sd)&&e.extraParameters.hasOwnProperty(Gl)&&e.extraParameters.hasOwnProperty(Co);if(!e.embeddedClientId&&!n)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[Gl],r=e.extraParameters[Co]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(i=this.performanceClient)==null||i.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Hn{constructor(e,n,r,o){this.logger=e,this.handshakeTimeoutMs=n,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(_.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const n={channel:$o.CHANNEL_ID,extensionId:this.extensionId,responseId:jn(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(n)}`),this.messageChannel.port1.postMessage(n),new Promise((r,o)=>{this.resolvers.set(n.responseId,{resolve:r,reject:o})})}static async createProvider(e,n,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new Hn(e,n,r,$o.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const i=new Hn(e,n,r);return await i.sendHandshakeRequest(),i}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:$o.CHANNEL_ID,extensionId:this.extensionId,responseId:jn(),body:{method:oo.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=n=>{this.onChannelMessage(n)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((n,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:n,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(te(mv)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const n=e.data;if(!(!n.channel||n.channel!==$o.CHANNEL_ID)&&!(n.extensionId&&n.extensionId!==this.extensionId)&&n.body.method===oo.HandshakeRequest){const r=this.handshakeResolvers.get(n.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${n.responseId}`);return}this.logger.verbose(n.extensionId?`Extension with id: ${n.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(te(yv))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const n=e.data,r=this.resolvers.get(n.responseId),o=this.handshakeResolvers.get(n.responseId);try{const i=n.body.method;if(i===oo.Response){if(!r)return;const s=n.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(s)}`),s.status!=="Success")r.reject(tu(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?r.reject(tu(s.result.code,s.result.description,s.result.ext)):r.resolve(s.result);else throw ey(Ku,"Event does not contain result.");this.resolvers.delete(n.responseId)}else if(i===oo.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${n.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=n.extensionId,this.extensionVersion=n.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(n.responseId)}}catch(i){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${i}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(i):o&&o.reject(i)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,n,r,o){if(n.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return n.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return n.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case Fe.BEARER:case Fe.POP:return n.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return n.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Sd{constructor(e,n,r,o,i){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async handleCodeResponse(e,n){this.performanceClient.addQueueMeasurement(_.HandleCodeResponse,n.correlationId);let r;try{r=this.authModule.handleFragmentResponse(e,n.state)}catch(o){throw o instanceof qr&&o.subError===Ao?te(Ao):o}return G(this.handleCodeResponseFromServer.bind(this),_.HandleCodeResponseFromServer,this.logger,this.performanceClient,n.correlationId)(r,n)}async handleCodeResponseFromServer(e,n,r=!0){if(this.performanceClient.addQueueMeasurement(_.HandleCodeResponseFromServer,n.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await G(this.authModule.updateAuthority.bind(this.authModule),_.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,n.correlationId)(e.cloud_instance_host_name,n.correlationId),r&&(e.nonce=n.nonce||void 0),e.state=n.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const i=this.createCcsCredentials(n);i&&(this.authCodeRequest.ccsCredential=i)}return await G(this.authModule.acquireToken.bind(this.authModule),_.AuthClientAcquireToken,this.logger,this.performanceClient,n.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Jt.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Jt.UPN}:null}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function Uv(t,e,n){const r=Ca(t);if(!r)throw Dy(t)?(n.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),n.errorPii(`The ${e} detected is: ${t}`),te(Yy)):(n.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),te(Qy));return r}function IP(t,e,n){if(!t.state)throw te(fd);const r=xv(e,t.state);if(!r)throw te(Jy);if(r.interactionType!==n)throw te(Xy)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class RP extends vi{constructor(e,n,r,o,i,s,a,c,l,u){super(e,n,r,o,i,s,a,l,u),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=c}acquireToken(e){try{const r={popupName:this.generatePopupName(e.scopes||yi,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r))}catch(n){return Promise.reject(n)}}logout(e){try{this.logger.verbose("logoutPopup called");const n=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(n),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,i=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(n,r,o,i)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(n,r,o,i))}catch(n){return Promise.reject(n)}}async acquireTokenPopupAsync(e,n){var i;this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(ze.acquireTokenPopup),o=await G(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ce.Popup);Nv(o.authority);try{const s=await G(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),a=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),c=Hn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let l;c&&(l=this.performanceClient.startMeasurement(_.FetchAccountIdWithNativeBroker,e.correlationId));const u=await a.getAuthCodeUrl({...o,nativeBroker:c}),d=new Sd(a,this.browserStorage,s,this.logger,this.performanceClient),h=this.initiateAuthRequest(u,n);this.eventHandler.emitEvent(me.POPUP_OPENED,ce.Popup,{popupWindow:h},null);const f=await this.monitorPopupForHash(h,n.popupWindowParent),p=So(Uv,_.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(f,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Dn.removeThrottle(this.browserStorage,this.config.auth.clientId,s),p.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),l&&l.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw te(Es);const m=new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,p.accountId,this.nativeStorage,o.correlationId),{userRequestState:C}=gn.parseRequestState(this.browserCrypto,o.state);return await m.acquireToken({...o,state:C,prompt:void 0})}return await d.handleCodeResponse(p,o)}catch(s){throw(i=n.popup)==null||i.close(),s instanceof We&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),s}}async logoutPopupAsync(e,n,r,o){var s,a,c,l;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(me.LOGOUT_START,ce.Popup,e);const i=this.initializeServerTelemetryManager(ze.logoutPopup);try{await this.clearCacheOnLogout(e.account);const u=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:r,account:e.account||void 0});try{u.authority.endSessionEndpoint}catch{if((s=e.account)!=null&&s.homeAccountId&&e.postLogoutRedirectUri&&u.authority.protocolMode===lr.OIDC){if(this.browserStorage.removeAccount((a=e.account)==null?void 0:a.homeAccountId,this.correlationId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,ce.Popup,e),o){const f={apiId:ze.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},p=Oe.getAbsoluteUrl(o,ar());await this.navigationClient.navigateInternal(p,f)}(c=n.popup)==null||c.close();return}}const d=u.getLogoutUri(e);this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,ce.Popup,e);const h=this.openPopup(d,n);if(this.eventHandler.emitEvent(me.POPUP_OPENED,ce.Popup,{popupWindow:h},null),await this.monitorPopupForHash(h,n.popupWindowParent).catch(()=>{}),o){const f={apiId:ze.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},p=Oe.getAbsoluteUrl(o,ar());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${p}`),await this.navigationClient.navigateInternal(p,f)}else this.logger.verbose("No main window navigation requested")}catch(u){throw(l=n.popup)==null||l.close(),u instanceof We&&(u.setCorrelationId(this.correlationId),i.cacheFailedRequest(u)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,ce.Popup,null,u),this.eventHandler.emitEvent(me.LOGOUT_END,ce.Popup),u}this.eventHandler.emitEvent(me.LOGOUT_END,ce.Popup)}initiateAuthRequest(e,n){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,n);throw this.logger.error("Navigate url is empty"),te(yc)}monitorPopupForHash(e,n){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const i=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(i),o(te(Ao));return}let s="";try{s=e.location.href}catch{}if(!s||s==="about:blank")return;clearInterval(i);let a="";const c=this.config.auth.OIDCOptions.serverResponseType;e&&(c===Ts.QUERY?a=e.location.search:a=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(a)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,n)})}openPopup(e,n){try{let r;if(n.popup?(r=n.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof n.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,n)),!r)throw te(tv);return r.focus&&r.focus(),this.currentWindow=r,n.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),this.browserStorage.setInteractionInProgress(!1),te(ev)}}openSizedPopup(e,{popupName:n,popupWindowAttributes:r,popupWindowParent:o}){var f,p,g,m;const i=o.screenLeft?o.screenLeft:o.screenX,s=o.screenTop?o.screenTop:o.screenY,a=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let l=(f=r.popupSize)==null?void 0:f.width,u=(p=r.popupSize)==null?void 0:p.height,d=(g=r.popupPosition)==null?void 0:g.top,h=(m=r.popupPosition)==null?void 0:m.left;return(!l||l<0||l>a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),l=Qt.POPUP_WIDTH),(!u||u<0||u>c)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),u=Qt.POPUP_HEIGHT),(!d||d<0||d>c)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),d=Math.max(0,c/2-Qt.POPUP_HEIGHT/2+s)),(!h||h<0||h>a)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),h=Math.max(0,a/2-Qt.POPUP_WIDTH/2+i)),o.open(e,n,`width=${l}, height=${u}, top=${d}, left=${h}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(ce.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,n){e.close(),n.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,n){return`${Qt.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${n}.${this.correlationId}`}generateLogoutPopupName(e){const n=e.account&&e.account.homeAccountId;return`${Qt.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${n}.${this.correlationId}`}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class ep{constructor(e,n,r,o,i){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async initiateAuthRequest(e,n){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){n.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Be.ORIGIN_URI,n.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Be.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:ze.acquireTokenRedirect,timeout:n.redirectTimeout,noHistory:!1};if(typeof n.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),n.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await n.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await n.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),te(yc)}async handleCodeResponse(e,n){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(n),o=this.browserStorage.getTemporaryCache(r);if(!o)throw j(ga,"Cached State");let i;try{i=this.authModule.handleFragmentResponse(e,o)}catch(l){throw l instanceof qr&&l.subError===Ao?te(Ao):l}const s=this.browserStorage.generateNonceKey(o),a=this.browserStorage.getTemporaryCache(s);if(this.authCodeRequest.code=i.code,i.cloud_instance_host_name&&await G(this.authModule.updateAuthority.bind(this.authModule),_.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(i.cloud_instance_host_name,this.authCodeRequest.correlationId),i.nonce=a||void 0,i.state=o,i.client_info)this.authCodeRequest.clientInfo=i.client_info;else{const l=this.checkCcsCredentials();l&&(this.authCodeRequest.ccsCredential=l)}const c=await this.authModule.acquireToken(this.authCodeRequest,i);return this.browserStorage.cleanRequestByState(n),c}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(Be.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function OP(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const t=window.performance.getEntriesByType("navigation"),e=t.length?t[0]:void 0;return e==null?void 0:e.type}class kP extends vi{constructor(e,n,r,o,i,s,a,c,l,u){super(e,n,r,o,i,s,a,l,u),this.nativeStorage=c}async acquireToken(e){const n=await G(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ce.Redirect);this.browserStorage.updateCacheEntries(n.state,n.nonce,n.authority,n.loginHint||"",n.account||null);const r=this.initializeServerTelemetryManager(ze.acquireTokenRedirect),o=i=>{i.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(n.state),this.eventHandler.emitEvent(me.RESTORE_FROM_BFCACHE,ce.Redirect))};try{const i=await G(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(n),s=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),a=new ep(s,this.browserStorage,i,this.logger,this.performanceClient),c=await s.getAuthCodeUrl({...n,nativeBroker:Hn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),l=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${l}`),window.addEventListener("pageshow",o),await a.initiateAuthRequest(c,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:l,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(i){throw i instanceof We&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(n.state),i}}async handleRedirectPromise(e="",n){const r=this.initializeServerTelemetryManager(ze.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[o,i]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(ce.Redirect),OP()!=="back_forward"?n.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const s=this.browserStorage.getTemporaryCache(Be.ORIGIN_URI,!0)||P.EMPTY_STRING,a=Oe.removeHashFromUrl(s),c=Oe.removeHashFromUrl(window.location.href);if(a===c&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),s.indexOf("#")>-1&&Uk(s),await this.handleResponse(o,r);if(this.config.auth.navigateToLoginRequestUrl){if(!Td()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Be.URL_HASH,i,!0);const l={apiId:ze.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let u=!0;if(!s||s==="null"){const d=Bk();this.browserStorage.setTemporaryCache(Be.ORIGIN_URI,d,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),u=await this.navigationClient.navigateInternal(d,l)}else this.logger.verbose(`Navigating to loginRequestUrl: ${s}`),u=await this.navigationClient.navigateInternal(s,l);if(!u)return await this.handleResponse(o,r)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,r);return null}catch(o){throw o instanceof We&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.browserStorage.cleanRequestByInteractionType(ce.Redirect),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let n=e;n||(this.config.auth.OIDCOptions.serverResponseType===Ts.QUERY?n=window.location.search:n=window.location.hash);let r=Ca(n);if(r){try{IP(r,this.browserCrypto,ce.Redirect)}catch(i){return i instanceof We&&this.logger.error(`Interaction type validation failed due to ${i.errorCode}: ${i.errorMessage}`),[null,""]}return Lk(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,n]}const o=this.browserStorage.getTemporaryCache(Be.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Be.URL_HASH)),o&&(r=Ca(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,n){const r=e.state;if(!r)throw te(fd);const o=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw te(Es);const c=new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,o.correlationId),{userRequestState:l}=gn.parseRequestState(this.browserCrypto,r);return c.acquireToken({...o,state:l,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(r)})}const i=this.browserStorage.getCachedAuthority(r);if(!i)throw te(pd);const s=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:i});return Dn.removeThrottle(this.browserStorage,this.config.auth.clientId,o),new ep(s,this.browserStorage,o,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){var o,i;this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(ze.logout);try{this.eventHandler.emitEvent(me.LOGOUT_START,ce.Redirect,e),await this.clearCacheOnLogout(n.account);const s={apiId:ze.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(a.authority.protocolMode===lr.OIDC)try{a.authority.endSessionEndpoint}catch{if((o=n.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((i=n.account)==null?void 0:i.homeAccountId,this.correlationId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,ce.Redirect,n);return}}const c=a.getLogoutUri(n);if(this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,ce.Redirect,n),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(c)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}}catch(s){throw s instanceof We&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,ce.Redirect,null,s),this.eventHandler.emitEvent(me.LOGOUT_END,ce.Redirect),s}this.eventHandler.emitEvent(me.LOGOUT_END,ce.Redirect)}getRedirectStartPage(e){const n=e||window.location.href;return Oe.getAbsoluteUrl(n,ar())}}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function PP(t,e,n,r,o){if(e.addQueueMeasurement(_.SilentHandlerInitiateAuthRequest,r),!t)throw n.info("Navigate url is empty"),te(yc);return o?G(xP,_.SilentHandlerLoadFrame,n,e,r)(t,o,e,r):So(MP,_.SilentHandlerLoadFrameSync,n,e,r)(t)}async function NP(t,e,n,r,o,i,s){return r.addQueueMeasurement(_.SilentHandlerMonitorIframeForHash,i),new Promise((a,c)=>{e{window.clearInterval(u),c(te(nv))},e),u=window.setInterval(()=>{let d="";const h=t.contentWindow;try{d=h?h.location.href:""}catch{}if(!d||d==="about:blank")return;let f="";h&&(s===Ts.QUERY?f=h.location.search:f=h.location.hash),window.clearTimeout(l),window.clearInterval(u),a(f)},n)}).finally(()=>{So(DP,_.RemoveHiddenIframe,o,r,i)(t)})}function xP(t,e,n,r){return n.addQueueMeasurement(_.SilentHandlerLoadFrame,r),new Promise((o,i)=>{const s=Hv();window.setTimeout(()=>{if(!s){i("Unable to load iframe");return}s.src=t,o(s)},e)})}function MP(t){const e=Hv();return e.src=t,e}function Hv(){const t=document.createElement("iframe");return t.className="msalSilentIframe",t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(t),t}function DP(t){document.body===t.parentNode&&document.body.removeChild(t)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class LP extends vi{constructor(e,n,r,o,i,s,a,c,l,u,d){super(e,n,r,o,i,s,c,u,d),this.apiId=a,this.nativeStorage=l}async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const n={...e};n.prompt?n.prompt!==gt.NONE&&n.prompt!==gt.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${n.prompt} with ${gt.NONE}`),n.prompt=gt.NONE):n.prompt=gt.NONE;const r=await G(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(n,ce.Silent);Nv(r.authority);const o=this.initializeServerTelemetryManager(this.apiId);let i;try{return i=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await G(this.silentTokenHelper.bind(this),_.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(i,r)}catch(s){if(s instanceof We&&(s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s)),!i||!(s instanceof We)||s.errorCode!==Qt.INVALID_GRANT_ERROR)throw s;this.performanceClient.addFields({retryError:s.errorCode},this.correlationId);const a=await G(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(n,ce.Silent);return await G(this.silentTokenHelper.bind(this),_.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(i,a)}}logout(){return Promise.reject(te(vc))}async silentTokenHelper(e,n){const r=n.correlationId;this.performanceClient.addQueueMeasurement(_.SilentIframeClientTokenHelper,r);const o=await G(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(n),i=await G(e.getAuthCodeUrl.bind(e),_.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...n,nativeBroker:Hn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,n.authenticationScheme)}),s=new Sd(e,this.browserStorage,o,this.logger,this.performanceClient),a=await G(PP,_.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(i,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),c=this.config.auth.OIDCOptions.serverResponseType,l=await G(NP,_.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,c),u=So(Uv,_.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(l,c,this.logger);if(u.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw te(Es);const d=new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,u.accountId,this.browserStorage,r),{userRequestState:h}=gn.parseRequestState(this.browserCrypto,n.state);return G(d.acquireToken.bind(d),_.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...n,state:h,prompt:n.prompt||gt.NONE})}return G(s.handleCodeResponse.bind(s),_.HandleCodeResponse,this.logger,this.performanceClient,r)(u,n)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class UP extends vi{async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentRefreshClientAcquireToken,e.correlationId);const n=await G(_d,_.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...n};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(ze.acquireTokenSilent_silentFlow),i=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return G(i.acquireTokenByRefreshToken.bind(i),_.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(s=>{throw s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s),s})}logout(){return Promise.reject(te(vc))}async createRefreshTokenClient(e){const n=await G(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Wl(n,this.performanceClient)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class HP{constructor(e,n,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=n,this.logger=r,this.cryptoObj=o}loadExternalTokens(e,n,r){if(!this.isBrowserEnvironment)throw te(Cc);const o=e.correlationId||jn(),i=n.id_token?_o(n.id_token,$n):void 0,s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.authority?new _t(_t.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||jn()):void 0,c=this.loadAccount(e,r.clientInfo||n.client_info||"",o,i,a),l=this.loadIdToken(n,c.homeAccountId,c.environment,c.realm,o),u=this.loadAccessToken(e,n,c.homeAccountId,c.environment,c.realm,r,o),d=this.loadRefreshToken(n,c.homeAccountId,c.environment,o);return this.generateAuthenticationResult(e,{account:c,idToken:l,accessToken:u,refreshToken:d},i,a)}loadAccount(e,n,r,o,i){if(this.logger.verbose("TokenCache - loading account"),e.account){const l=dt.createFromAccountInfo(e.account);return this.storage.setAccount(l,r),l}else if(!i||!n&&!o)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),te(dv);const s=dt.generateHomeAccountId(n,i.authorityType,this.logger,this.cryptoObj,o),a=o==null?void 0:o.tid,c=ld(this.storage,i,s,$n,r,o,n,i.hostnameAndPort,a,void 0,void 0,this.logger);return this.storage.setAccount(c,r),c}loadIdToken(e,n,r,o,i){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=dc(n,r,e.id_token,this.config.auth.clientId,o);return this.storage.setIdTokenCredential(s,i),s}loadAccessToken(e,n,r,o,i,s,a){if(n.access_token)if(n.expires_in){if(!n.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const c=n.scope?rt.fromString(n.scope):new rt(e.scopes),l=s.expiresOn||n.expires_in+new Date().getTime()/1e3,u=s.extendedExpiresOn||(n.ext_expires_in||n.expires_in)+new Date().getTime()/1e3,d=hc(r,o,n.access_token,this.config.auth.clientId,i,c.printScopes(),l,u,$n);return this.storage.setAccessTokenCredential(d,a),d}loadRefreshToken(e,n,r,o){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const i=Cy(n,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(i,o),i}generateAuthenticationResult(e,n,r,o){var u,d,h;let i="",s=[],a=null,c;n!=null&&n.accessToken&&(i=n.accessToken.secret,s=rt.fromString(n.accessToken.target).asArray(),a=new Date(Number(n.accessToken.expiresOn)*1e3),c=new Date(Number(n.accessToken.extendedExpiresOn)*1e3));const l=n.account;return{authority:o?o.canonicalAuthority:"",uniqueId:n.account.localAccountId,tenantId:n.account.realm,scopes:s,account:l.getAccountInfo(),idToken:((u=n.idToken)==null?void 0:u.secret)||"",idTokenClaims:r||{},accessToken:i,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:c,familyId:((d=n.refreshToken)==null?void 0:d.familyId)||"",tokenType:((h=n==null?void 0:n.accessToken)==null?void 0:h.tokenType)||"",state:e.state||"",cloudGraphHostName:l.cloudGraphHostName||"",msGraphHost:l.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class BP extends Vy{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class FP extends vi{constructor(e,n,r,o,i,s,a,c,l,u){super(e,n,r,o,i,s,c,l,u),this.apiId=a}async acquireToken(e){if(!e.code)throw te(hv);const n=await G(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,ce.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...n,code:e.code},i=await G(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),s=new BP(i);this.logger.verbose("Auth code client created");const a=new Sd(s,this.browserStorage,o,this.logger,this.performanceClient);return await G(a.handleCodeResponseFromServer.bind(a),_.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},n,!1)}catch(o){throw o instanceof We&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(te(vc))}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function Sn(t){const e=t==null?void 0:t.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function js(t,e){try{Ed(t)}catch(n){throw e.end({success:!1},n),n}}class Ac{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new pi(this.logger,this.performanceClient):ma,this.eventHandler=new hP(this.logger),this.browserStorage=this.isBrowserEnvironment?new eu(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,XO(this.config.auth),this.performanceClient):oP(this.config.auth.clientId,this.logger);const n={cacheLocation:Bt.MemoryStorage,temporaryCacheLocation:Bt.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new eu(this.config.auth.clientId,n,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new HP(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,n){const r=new Ac(e);return await r.initialize(n),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END);return}const n=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,o=this.performanceClient.startMeasurement(_.InitializeClientApplication,n);if(this.eventHandler.emitEvent(me.INITIALIZE_START),r)try{this.nativeExtensionProvider=await Hn.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(i){this.logger.verbose(i)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await G(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),_.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,n)(this.performanceClient,n)),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END),o.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),Pv(this.initialized),this.isBrowserEnvironment){const n=e||"";let r=this.redirectResponse.get(n);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(n,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const n=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&Hn.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,i=o?r==null?void 0:r.correlationId:this.browserStorage.getTemporaryCache(Be.CORRELATION_ID,!0)||"",s=this.performanceClient.startMeasurement(_.AcquireTokenRedirect,i);this.eventHandler.emitEvent(me.HANDLE_REDIRECT_START,ce.Redirect);let a;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const c=new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);a=G(c.handleRedirectPromise.bind(c),_.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(this.performanceClient,s.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const c=this.createRedirectClient(i);a=G(c.handleRedirectPromise.bind(c),_.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(e,s)}return a.then(c=>(c?(n.length{const l=c;throw n.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,ce.Redirect,null,l):this.eventHandler.emitEvent(me.LOGIN_FAILURE,ce.Redirect,null,l),this.eventHandler.emitEvent(me.HANDLE_REDIRECT_END,ce.Redirect),s.end({success:!1},l),c})}async acquireTokenRedirect(e){const n=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",n);const r=this.performanceClient.startMeasurement(_.AcquireTokenPreRedirect,n);r.add({accountType:Sn(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=s=>{const a=typeof o=="function"?o(s):void 0;return a!==!1?r.end({success:!0}):r.discard(),a};else{const s=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=a=>{const c=typeof s=="function"?s(a):void 0;return c!==!1?r.end({success:!0}):r.discard(),c}}const i=this.getAllAccounts().length>0;try{Yf(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),i?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,ce.Redirect,e):this.eventHandler.emitEvent(me.LOGIN_START,ce.Redirect,e);let s;return this.nativeExtensionProvider&&this.canUseNative(e)?s=new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,n).acquireTokenRedirect(e,r).catch(c=>{if(c instanceof Ln&&Ho(c))return this.nativeExtensionProvider=void 0,this.createRedirectClient(n).acquireToken(e);if(c instanceof En)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(n).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),c}):s=this.createRedirectClient(n).acquireToken(e),await s}catch(s){throw r.end({success:!1},s),i?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,ce.Redirect,null,s):this.eventHandler.emitEvent(me.LOGIN_FAILURE,ce.Redirect,null,s),s}}acquireTokenPopup(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(_.AcquireTokenPopup,n);r.add({scenarioId:e.scenarioId,accountType:Sn(e.account)});try{this.logger.verbose("acquireTokenPopup called",n),js(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(s){return Promise.reject(s)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,ce.Popup,e):this.eventHandler.emitEvent(me.LOGIN_START,ce.Popup,e);let i;return this.canUseNative(e)?i=this.acquireTokenNative({...e,correlationId:n},ze.acquireTokenPopup).then(s=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,accountType:Sn(s.account)}),s)).catch(s=>{if(s instanceof Ln&&Ho(s))return this.nativeExtensionProvider=void 0,this.createPopupClient(n).acquireToken(e);if(s instanceof En)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(n).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),s}):i=this.createPopupClient(n).acquireToken(e),i.then(s=>(o.length(o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,ce.Popup,null,s):this.eventHandler.emitEvent(me.LOGIN_FAILURE,ce.Popup,null,s),r.end({success:!1},s),Promise.reject(s)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var i,s;const n=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:n};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(_.SsoSilent,n),(i=this.ssoSilentMeasurement)==null||i.add({scenarioId:e.scenarioId,accountType:Sn(e.account)}),js(this.initialized,this.ssoSilentMeasurement),(s=this.ssoSilentMeasurement)==null||s.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",n),this.eventHandler.emitEvent(me.SSO_SILENT_START,ce.Silent,r);let o;return this.canUseNative(r)?o=this.acquireTokenNative(r,ze.ssoSilent).catch(a=>{if(a instanceof Ln&&Ho(a))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw a}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(a=>{var c;return this.eventHandler.emitEvent(me.SSO_SILENT_SUCCESS,ce.Silent,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!0,isNativeBroker:a.fromNativeBroker,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length,accountType:Sn(a.account)}),a}).catch(a=>{var c;throw this.eventHandler.emitEvent(me.SSO_SILENT_FAILURE,ce.Silent,null,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const n=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",n);const r=this.performanceClient.startMeasurement(_.AcquireTokenByCode,n);js(this.initialized,r),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_START,ce.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw te(pv);if(e.code){const o=e.code;let i=this.hybridAuthCodeResponses.get(o);return i?(this.logger.verbose("Existing acquireTokenByCode request found",n),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",n),i=this.acquireTokenByCodeAsync({...e,correlationId:n}).then(s=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_SUCCESS,ce.Silent,s),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:s.fromNativeBroker,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length,accountType:Sn(s.account)}),s)).catch(s=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,ce.Silent,null,s),r.end({success:!1},s),s}),this.hybridAuthCodeResponses.set(o,i)),await i}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:n},ze.acquireTokenByCode,e.nativeAccountId).catch(i=>{throw i instanceof Ln&&Ho(i)&&(this.nativeExtensionProvider=void 0),i});return r.end({accountType:Sn(o.account),success:!0}),o}else throw te(gv);else throw te(fv)}catch(o){throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,ce.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(_.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(i=>{var s;return(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!0,fromCache:i.fromCache,isNativeBroker:i.fromNativeBroker}),i}).catch(i=>{var s;throw(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!1},i),i}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,n){switch(this.performanceClient.addQueueMeasurement(_.AcquireTokenFromCache,e.correlationId),n){case jt.Default:case jt.AccessToken:case jt.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return G(r.acquireToken.bind(r),_.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw j(sr)}}async acquireTokenByRefreshToken(e,n){switch(this.performanceClient.addQueueMeasurement(_.AcquireTokenByRefreshToken,e.correlationId),n){case jt.Default:case jt.AccessTokenAndRefreshToken:case jt.RefreshToken:case jt.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return G(r.acquireToken.bind(r),_.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw j(sr)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(_.AcquireTokenBySilentIframe,e.correlationId);const n=this.createSilentIframeClient(e.correlationId);return G(n.acquireToken.bind(n),_.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const n=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",n),this.logoutRedirect({correlationId:n,...e})}async logoutRedirect(e){const n=this.getRequestCorrelationId(e);return Yf(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(n).logout(e)}logoutPopup(e){try{const n=this.getRequestCorrelationId(e);return Ed(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(n).logout(e)}catch(n){return Promise.reject(n)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const n=this.getRequestCorrelationId(e);return this.createSilentCacheClient(n).logout(e)}getAllAccounts(e){const n=this.getRequestCorrelationId();return iP(this.logger,this.browserStorage,this.isBrowserEnvironment,n,e)}getAccount(e){const n=this.getRequestCorrelationId();return sP(e,this.logger,this.browserStorage,n)}getAccountByUsername(e){const n=this.getRequestCorrelationId();return aP(e,this.logger,this.browserStorage,n)}getAccountByHomeId(e){const n=this.getRequestCorrelationId();return cP(e,this.logger,this.browserStorage,n)}getAccountByLocalId(e){const n=this.getRequestCorrelationId();return lP(e,this.logger,this.browserStorage,n)}setActiveAccount(e){const n=this.getRequestCorrelationId();uP(e,this.browserStorage,n)}getActiveAccount(){const e=this.getRequestCorrelationId();return dP(this.browserStorage,e)}async hydrateCache(e,n){this.logger.verbose("hydrateCache called");const r=dt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r,e.correlationId),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,n)):this.browserStorage.hydrateCache(e,n)}async acquireTokenNative(e,n,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw te(Es);return new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,n,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,n){if(this.logger.trace("canUseNative called"),!Hn.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case gt.NONE:case gt.CONSENT:case gt.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!n&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const n=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return n&&n.nativeAccountId||""}createPopupClient(e){return new RP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new kP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new LP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new Lv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new UP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new FP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,n){return this.eventHandler.addEventCallback(e,n)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return kv(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){var n;try{(n=e.key)!=null&&n.includes(ft.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(me.ACTIVE_ACCOUNT_CHANGED);const r=e.newValue||e.oldValue;if(!r)return;const o=JSON.parse(r);if(typeof o!="object"||!dt.isAccountEntity(o))return;const s=di.toObject(new dt,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_ADDED,void 0,s)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_REMOVED,void 0,s))}catch{return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,n){this.browserStorage.setWrapperMetadata(e,n)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?jn():P.EMPTY_STRING}async loginRedirect(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",n),this.acquireTokenRedirect({correlationId:n,...e||zf})}loginPopup(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",n),this.acquireTokenPopup({correlationId:n,...e||zf})}async acquireTokenSilent(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(_.AcquireTokenSilent,n);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),js(this.initialized,r),this.logger.verbose("acquireTokenSilent called",n);const o=e.account||this.getActiveAccount();if(!o)throw te(sv);r.add({accountType:Sn(o)});const i={clientId:this.config.auth.clientId,authority:e.authority||P.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},s=JSON.stringify(i),a=this.activeSilentTokenRequests.get(s);if(typeof a>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",n);const c=G(this.acquireTokenSilentAsync.bind(this),_.AcquireTokenSilentAsync,this.logger,this.performanceClient,n)({...e,correlationId:n},o).then(l=>(this.activeSilentTokenRequests.delete(s),r.end({success:!0,fromCache:l.fromCache,isNativeBroker:l.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length}),l)).catch(l=>{throw this.activeSilentTokenRequests.delete(s),r.end({success:!1},l),l});return this.activeSilentTokenRequests.set(s,c),{...await c,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",n),r.discard(),{...await a,state:e.state}}async acquireTokenSilentAsync(e,n){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(_.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,ce.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await G(yP,_.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,n,this.config,this.performanceClient,this.logger),i=e.cacheLookupPolicy||jt.Default;return this.acquireTokenSilentNoIframe(o,i).catch(async a=>{if(KP(a,i))if(this.activeIframeRequest)if(i!==jt.Skip){const[l,u]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${u}`,o.correlationId);const d=this.performanceClient.startMeasurement(_.AwaitConcurrentIframe,o.correlationId);d.add({awaitIframeCorrelationId:u});const h=await l;if(d.end({success:h}),h)return this.logger.verbose(`Parallel iframe request with correlationId: ${u} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,i);throw this.logger.info(`Iframe request with correlationId: ${u} failed. Interaction is required.`),a}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),G(this.acquireTokenBySilentIframe.bind(this),_.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let l;return this.activeIframeRequest=[new Promise(u=>{l=u}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),G(this.acquireTokenBySilentIframe.bind(this),_.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(u=>(l(!0),u)).catch(u=>{throw l(!1),u}).finally(()=>{this.activeIframeRequest=void 0})}else throw a}).then(a=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,ce.Silent,a),e.correlationId&&this.performanceClient.addFields({fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker},e.correlationId),a)).catch(a=>{throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,ce.Silent,null,a),a}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,n){return Hn.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,ze.acquireTokenSilent_silentFlow).catch(async r=>{throw r instanceof Ln&&Ho(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,j(sr)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),G(this.acquireTokenFromCache.bind(this),_.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,n).catch(r=>{if(n===jt.AccessToken)throw r;return this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_NETWORK_START,ce.Silent,e),G(this.acquireTokenByRefreshToken.bind(this),_.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,n)}))}}function KP(t,e){const n=!(t instanceof En&&t.subError!==mc),r=t.errorCode===Qt.INVALID_GRANT_ERROR||t.errorCode===sr,o=n&&r||t.errorCode===Aa||t.errorCode===cd,i=Tk.includes(e);return o&&i}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function $P(t,e){const n=new To(t);return await n.initialize(),Ac.createController(n,e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Id{static async createPublicClientApplication(e){const n=await $P(e);return new Id(e,n)}constructor(e,n){this.controller=n||new Ac(new To(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,n){return this.controller.addEventCallback(e,n)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,n){return this.controller.initializeWrapperLibrary(e,n)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,n){return this.controller.hydrateCache(e,n)}clearCache(e){return this.controller.clearCache(e)}}const ba=new Id({auth:{clientId:"9079054c-9620-4757-a256-23413042f1ef",authority:"https://login.microsoftonline.com/e519c2e6-bc6d-4fdf-8d9c-923c2f002385",redirectUri:"https://optical-dev.oliver.solutions/cc-dashboard/"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1}}),qP=["openid","profile","email"];async function jP(){await ba.initialize(),await ba.handleRedirectPromise()}const Bv=RA("auth",()=>{const t=J(null),e=J(null),n=J(!1),r=J(null),o=Q(()=>t.value!==null),i=Q(()=>{var h;return((h=e.value)==null?void 0:h.role)==="admin"});async function s(){try{const h=await ir.post("/api/auth/refresh");t.value=h.data.access_token,await u()}catch{}}function a(h){t.value=h}async function c(){var h,f;n.value=!0,r.value=null;try{const g=(await ba.loginPopup({scopes:qP})).idToken,m=await ir.post("/api/auth/microsoft",{id_token:g});t.value=m.data.access_token,await u()}catch(p){const g=p;throw r.value=((f=(h=g.response)==null?void 0:h.data)==null?void 0:f.detail)??g.message??"Login failed",p}finally{n.value=!1}}async function l(){try{await ir.post("/api/auth/logout")}catch{}t.value=null,e.value=null;try{await ba.clearCache()}catch{}}async function u(){const h=await ir.get("/api/auth/me");e.value=h.data}function d(){return t.value}return{token:t,user:e,loading:n,error:r,isAuthenticated:o,isAdmin:i,init:s,setToken:a,loginWithMicrosoft:c,logout:l,fetchMe:u,getToken:d}}),VP=[{path:"/login",name:"login",component:()=>Ht(()=>import("./LoginView-D4TcGUK9.js"),__vite__mapDeps([0,1,2])),meta:{public:!0}},{path:"/",component:()=>Ht(()=>import("./AppLayout-jL4SBUkd.js"),[]),children:[{path:"",name:"dashboard",component:()=>Ht(()=>import("./DashboardView-CmARPWJW.js"),__vite__mapDeps([3,4,1,2,5,6,7,8,9,10,11,12,13,14]))},{path:"calendar",name:"calendar",component:()=>Ht(()=>import("./CalendarView-ylCKpGKw.js"),__vite__mapDeps([15,4,2,6,7,16,17,9,13,18,19,20,21,22,23,14,24,25,26]))},{path:"tasks",name:"tasks",component:()=>Ht(()=>import("./TasksView-DihMnVxc.js"),__vite__mapDeps([27,13,20,21,6,7,2,22,23,14,24,12,28]))},{path:"omg",name:"omg",component:()=>Ht(()=>import("./OmgView-DRcTYRif.js"),__vite__mapDeps([29,24,21,6,7,2,22,23,25,9,12,28,30,31]))},{path:"projects",name:"projects",component:()=>Ht(()=>import("./ProjectsView-DYSEwPaV.js"),__vite__mapDeps([32,4,1,2,7,16,28,6,33,22,11,9,34]))},{path:"projects/:id/:date?",name:"project-detail",component:()=>Ht(()=>import("./ProjectDetailView-CdtUGv8p.js"),__vite__mapDeps([35,4,1,2,5,8,22,6,7,28,12,30,9,10]))},{path:"live",name:"live",component:()=>Ht(()=>import("./LiveView-DDM8h9ml.js"),__vite__mapDeps([36,1,2,6,7,8,28,9,34]))},{path:"reports",name:"reports",component:()=>Ht(()=>import("./ReportsView-CpecHUOd.js"),__vite__mapDeps([37,1,2,19,6,7,16,28,30,9,38,18,39]))},{path:"keys",name:"keys",component:()=>Ht(()=>import("./KeysView-DFI2tF0F.js"),__vite__mapDeps([40,41,1,2,6,7,21,22,25,9,28,31]))},{path:"devops",name:"devops",component:()=>Ht(()=>import("./DevopsView-TX3WlewI.js"),__vite__mapDeps([42,14,24,1,2,5,6,7,33,22,28,16,12,43,25,9]))},{path:"settings",name:"settings",component:()=>Ht(()=>import("./SettingsView-CuZ9KN7E.js"),__vite__mapDeps([44,14,1,2,5,22,6,7,17,9,38,43,25]))},{path:"admin",name:"admin",component:()=>Ht(()=>import("./AdminView-C7wez57z.js"),__vite__mapDeps([45,41,1,2,19,7])),meta:{adminOnly:!0}}]},{path:"/:pathMatch(.*)*",redirect:"/"}],nu=OS({history:aS("/cc-dashboard/"),routes:VP});nu.beforeEach((t,e,n)=>{const r=Bv();if(t.meta.public){n();return}if(!r.isAuthenticated){n({name:"login",query:{redirect:t.fullPath}});return}if(t.meta.adminOnly&&!r.isAdmin){n({name:"dashboard"});return}n()});jP().then(async()=>{const t=CA(A_),e=TA();t.use(e),t.use(nu),t.use(lT);const n=Bv();yR(()=>n.getToken(),()=>{n.logout(),nu.push({name:"login"})},r=>n.setToken(r)),await n.init(),t.mount("#app")});export{a0 as $,vn as A,RA as B,Yi as C,ir as D,nn as E,nt as F,JP as G,zP as H,YP as I,Eo as J,t0 as K,FC as L,bC as M,m0 as N,v0 as O,h0 as P,f0 as Q,bS as R,p0 as S,QP as T,y0 as U,d0 as V,g0 as W,n0 as X,i0 as Y,o0 as Z,Ht as _,Cn as a,c0 as a0,s0 as a1,l0 as a2,r0 as a3,po as a4,WP as b,Xe as c,ye as d,Pe as e,C0 as f,w0 as g,I as h,er as i,Q as j,pe as k,eo as l,Ke as m,Gt as n,Y as o,le as p,oa as q,cl as r,J as s,Bo as t,Bv as u,ew as v,se as w,ut as x,ja as y,Fn as z}; +${s}`);return}throw $f(e.error,e.error_description,e.suberror)?new En(e.error,e.error_description,e.suberror,e.timestamp||P.EMPTY_STRING,e.trace_id||P.EMPTY_STRING,e.correlation_id||P.EMPTY_STRING,e.claims||P.EMPTY_STRING,i):s}}async handleServerTokenResponse(e,n,r,o,i,s,a,c,l){var p;(p=this.performanceClient)==null||p.addQueueMeasurement(_.HandleServerTokenResponse,e.correlation_id);let u;if(e.id_token){if(u=_o(e.id_token||P.EMPTY_STRING,this.cryptoObj.base64Decode),i&&i.nonce&&u.nonce!==i.nonce)throw j(ay);if(o.maxAge||o.maxAge===0){const g=u.auth_time;if(!g)throw j(ju);vy(g,o.maxAge)}}this.homeAccountIdentifier=dt.generateHomeAccountId(e.client_info||P.EMPTY_STRING,n.authorityType,this.logger,this.cryptoObj,u);let d;i&&i.state&&(d=gn.parseRequestState(this.cryptoObj,i.state)),e.key_id=e.key_id||o.sshKid||void 0;const h=this.generateCacheRecord(e,n,r,o,u,s,i);let f;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),f=new ik(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(f)),a&&!c&&h.account){const g=h.account.generateAccountKey();if(!this.cacheStorage.getAccount(g,o.correlationId,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await wo.generateAuthenticationResult(this.cryptoObj,n,h,!1,o,u,d,void 0,l)}await this.cacheStorage.saveCacheRecord(h,o.correlationId,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&f&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(f))}return wo.generateAuthenticationResult(this.cryptoObj,n,h,!1,o,u,d,e,l)}generateCacheRecord(e,n,r,o,i,s,a){const c=n.getPreferredCache();if(!c)throw j(Gu);const l=My(i);let u,d;e.id_token&&i&&(u=dc(this.homeAccountIdentifier,c,e.id_token,this.clientId,l||""),d=ld(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,i,e.client_info,c,l,a,void 0,this.logger));let h=null;if(e.access_token){const g=e.scope?rt.fromString(e.scope):new rt(o.scopes||[]),m=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,C=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,T=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,y=r+m,w=y+C,S=T&&T>0?r+T:void 0;h=hc(this.homeAccountIdentifier,c,e.access_token,this.clientId,l||n.tenant||"",g.printScopes(),y,w,this.cryptoObj.base64Decode,S,e.token_type,s,e.key_id,o.claims,o.requestedClaimsHash)}let f=null;if(e.refresh_token){let g;if(e.refresh_token_expires_in){const m=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;g=r+m}f=Cy(this.homeAccountIdentifier,c,e.refresh_token,this.clientId,e.foci,s,g)}let p=null;return e.foci&&(p={clientId:this.clientId,environment:c,familyId:e.foci}),{account:d,idToken:u,accessToken:h,refreshToken:f,appMetadata:p}}static async generateAuthenticationResult(e,n,r,o,i,s,a,c,l){var y,w,S,B,N;let u=P.EMPTY_STRING,d=[],h=null,f,p,g=P.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===Fe.POP&&!i.popKid){const L=new hi(e),{secret:k,keyId:F}=r.accessToken;if(!F)throw j(zu);u=await L.signPopToken(k,F,i)}else u=r.accessToken.secret;d=rt.fromString(r.accessToken.target).asArray(),h=new Date(Number(r.accessToken.expiresOn)*1e3),f=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),r.accessToken.refreshOn&&(p=new Date(Number(r.accessToken.refreshOn)*1e3))}r.appMetadata&&(g=r.appMetadata.familyId===Hi?Hi:"");const m=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",C=(s==null?void 0:s.tid)||"";c!=null&&c.spa_accountid&&r.account&&(r.account.nativeAccountId=c==null?void 0:c.spa_accountid);const T=r.account?nd(r.account.getAccountInfo(),void 0,s,(y=r.idToken)==null?void 0:y.secret):null;return{authority:n.canonicalAuthority,uniqueId:m,tenantId:C,scopes:d,account:T,idToken:((w=r==null?void 0:r.idToken)==null?void 0:w.secret)||"",idTokenClaims:s||{},accessToken:u,fromCache:o,expiresOn:h,extExpiresOn:f,refreshOn:p,correlationId:i.correlationId,requestId:l||P.EMPTY_STRING,familyId:g,tokenType:((S=r.accessToken)==null?void 0:S.tokenType)||P.EMPTY_STRING,state:a?a.userRequestState:P.EMPTY_STRING,cloudGraphHostName:((B=r.account)==null?void 0:B.cloudGraphHostName)||P.EMPTY_STRING,msGraphHost:((N=r.account)==null?void 0:N.msGraphHost)||P.EMPTY_STRING,code:c==null?void 0:c.spa_code,fromNativeBroker:!1}}}function ld(t,e,n,r,o,i,s,a,c,l,u,d){d==null||d.verbose("setCachedAccount called");const f=t.getAccountKeys().find(T=>T.startsWith(n));let p=null;f&&(p=t.getAccount(f,o,d));const g=p||dt.createAccount({homeAccountId:n,idTokenClaims:i,clientInfo:s,environment:a,cloudGraphHostName:l==null?void 0:l.cloud_graph_host_name,msGraphHost:l==null?void 0:l.msgraph_host,nativeAccountId:u},e,r),m=g.tenantProfiles||[],C=c||g.realm;if(C&&!m.find(T=>T.tenantId===C)){const T=td(n,g.localAccountId,C,i);m.push(T)}return g.tenantProfiles=m,g}/*! @azure/msal-common v14.16.1 2025-08-05 */async function jy(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}/*! @azure/msal-common v14.16.1 2025-08-05 */class Vy extends ad{constructor(e,n){var r;super(e,n),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async getAuthCodeUrl(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(_.GetAuthCodeUrl,e.correlationId);const n=await G(this.createAuthCodeUrlQueryString.bind(this),_.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return Oe.appendQueryString(this.authority.authorizationEndpoint,n)}async acquireToken(e,n){var a,c;if((a=this.performanceClient)==null||a.addQueueMeasurement(_.AuthClientAcquireToken,e.correlationId),!e.code)throw j(uy);const r=qn(),o=await G(this.executeTokenRequest.bind(this),_.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),i=(c=o.headers)==null?void 0:c[Mt.X_MS_REQUEST_ID],s=new wo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(o.body),G(s.handleServerTokenResponse.bind(s),_.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,n,void 0,void 0,void 0,i)}handleFragmentResponse(e,n){if(new wo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,n),!e.code)throw j(gy);return e}getLogoutUri(e){if(!e)throw qe(Sy);const n=this.createLogoutUrlQueryString(e);return Oe.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n){var l,u;(l=this.performanceClient)==null||l.addQueueMeasurement(_.AuthClientExecuteTokenRequest,n.correlationId);const r=this.createTokenQueryParameters(n),o=Oe.appendQueryString(e.tokenEndpoint,r),i=await G(this.createTokenRequestBody.bind(this),_.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,n.correlationId)(n);let s;if(n.clientInfo)try{const d=ya(n.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${d.uid}${It.CLIENT_INFO_SEPARATOR}${d.utid}`,type:Jt.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const a=this.createTokenRequestHeaders(s||n.ccsCredential),c={clientId:((u=n.tokenBodyParameters)==null?void 0:u.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:n.scopes,claims:n.claims,authenticationScheme:n.authenticationScheme,resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,sshKid:n.sshKid};return G(this.executePostToTokenEndpoint.bind(this),_.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,n.correlationId)(o,i,a,c,n.correlationId,_.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i;(o=this.performanceClient)==null||o.addQueueMeasurement(_.AuthClientCreateTokenRequestBody,e.correlationId);const n=new Fi(e.correlationId,this.performanceClient);if(n.addClientId(e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[Co])||this.config.authOptions.clientId),this.includeRedirectUri?n.addRedirectUri(e.redirectUri):Lo.validateRedirectUri(e.redirectUri),n.addScopes(e.scopes,!0,this.oidcDefaultScopes),n.addAuthorizationCode(e.code),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addThrottling(),this.serverTelemetryManager&&!Vl(this.config)&&n.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&n.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&n.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;n.addClientAssertion(await jy(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),n.addClientAssertionType(s.assertionType)}if(n.addGrantType(Zm.AUTHORIZATION_CODE_GRANT),n.addClientInfo(),e.authenticationScheme===Fe.POP){const s=new hi(this.cryptoUtils,this.performanceClient);let a;e.popKid?a=this.cryptoUtils.encodeKid(e.popKid):a=(await G(s.generateCnf.bind(s),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,n.addPopToken(a)}else if(e.authenticationScheme===Fe.SSH)if(e.sshJwk)n.addSshJwk(e.sshJwk);else throw qe(fc);(!pn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const s=ya(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${s.uid}${It.CLIENT_INFO_SEPARATOR}${s.utid}`,type:Jt.HOME_ACCOUNT_ID}}catch(s){this.logger.verbose("Could not parse client info for CCS Header: "+s)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Jt.HOME_ACCOUNT_ID:try{const s=Ko(r.credential);n.addCcsOid(s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case Jt.UPN:n.addCcsUpn(r.credential);break}return e.embeddedClientId&&n.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&n.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Bf])&&n.addExtraQueryParameters({[Bf]:"1"}),n.createQueryString()}async createAuthCodeUrlQueryString(e){var i,s;const n=e.correlationId||this.config.cryptoInterface.createNewGuid();(i=this.performanceClient)==null||i.addQueueMeasurement(_.AuthClientCreateQueryString,n);const r=new Fi(n,this.performanceClient);r.addClientId(e.embeddedClientId||((s=e.extraQueryParameters)==null?void 0:s[Co])||this.config.authOptions.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(r.addScopes(o,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri),r.addCorrelationId(n),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),Vl(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==gt.SELECT_ACCOUNT)if(e.sid&&e.prompt===gt.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){const a=this.extractAccountSid(e.account);let c=this.extractLoginHint(e.account);if(c&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),c=null),c){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(c);try{const l=Ko(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&e.prompt===gt.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(a);try{const l=Ko(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{const l=Ko(e.account.homeAccountId);r.addCcsOid(l)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,r),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===Fe.POP)){const a=new hi(this.cryptoUtils);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await G(a.generateCnf.bind(a),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(c)}return r.createQueryString()}createLogoutUrlQueryString(e){const n=new Fi(e.correlationId,this.performanceClient);return e.postLogoutRedirectUri&&n.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&n.addCorrelationId(e.correlationId),e.idTokenHint&&n.addIdTokenHint(e.idTokenHint),e.state&&n.addState(e.state),e.logoutHint&&n.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,n),n.createQueryString()}addExtraQueryParams(e,n){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&n.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){var n;return((n=e.idTokenClaims)==null?void 0:n.sid)||null}extractLoginHint(e){var n;return((n=e.idTokenClaims)==null?void 0:n.login_hint)||null}}/*! @azure/msal-common v14.16.1 2025-08-05 */const ak=300;class Wl extends ad{constructor(e,n){super(e,n)}async acquireToken(e){var s,a;(s=this.performanceClient)==null||s.addQueueMeasurement(_.RefreshTokenClientAcquireToken,e.correlationId);const n=qn(),r=await G(this.executeTokenRequest.bind(this),_.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(a=r.headers)==null?void 0:a[Mt.X_MS_REQUEST_ID],i=new wo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return i.validateTokenResponse(r.body),G(i.handleServerTokenResponse.bind(i),_.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,n,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw qe(_y);if((r=this.performanceClient)==null||r.addQueueMeasurement(_.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw j(Vu);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await G(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const i=o instanceof En&&o.errorCode===Aa,s=o instanceof qr&&o.errorCode===_f.INVALID_GRANT_ERROR&&o.subError===_f.CLIENT_MISMATCH_ERROR;if(i||s)return G(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return G(this.acquireTokenWithCachedRefreshToken.bind(this),_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,n){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(_.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=So(this.cacheManager.getRefreshToken.bind(this.cacheManager),_.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0,this.performanceClient);if(!r)throw zl(Aa);if(r.expiresOn&&jl(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||ak))throw zl(cd);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||Fe.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Jt.HOME_ACCOUNT_ID}};try{return await G(this.acquireToken.bind(this),_.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(s){if(s instanceof En&&s.subError===mc){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const a=Fo(r);this.cacheManager.removeRefreshToken(a,e.correlationId)}throw s}}async executeTokenRequest(e,n){var c,l;(c=this.performanceClient)==null||c.addQueueMeasurement(_.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=Oe.appendQueryString(n.tokenEndpoint,r),i=await G(this.createTokenRequestBody.bind(this),_.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),a={clientId:((l=e.tokenBodyParameters)==null?void 0:l.clientId)||this.config.authOptions.clientId,authority:n.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return G(this.executePostToTokenEndpoint.bind(this),_.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,i,s,a,e.correlationId,_.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i,s;(o=this.performanceClient)==null||o.addQueueMeasurement(_.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const n=e.correlationId,r=new Fi(n,this.performanceClient);if(r.addClientId(e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[Co])||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,(s=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:s.defaultScopes),r.addGrantType(Zm.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!Vl(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const a=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await jy(a.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(a.assertionType)}if(e.authenticationScheme===Fe.POP){const a=new hi(this.cryptoUtils,this.performanceClient);let c;e.popKid?c=this.cryptoUtils.encodeKid(e.popKid):c=(await G(a.generateCnf.bind(a),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(c)}else if(e.authenticationScheme===Fe.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw qe(fc);if((!pn.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Jt.HOME_ACCOUNT_ID:try{const a=Ko(e.ccsCredential.credential);r.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case Jt.UPN:r.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}/*! @azure/msal-common v14.16.1 2025-08-05 */class ck extends ad{constructor(e,n){super(e,n)}async acquireToken(e){var n;try{const[r,o]=await this.acquireCachedToken({...e,scopes:(n=e.scopes)!=null&&n.length?e.scopes:[...yi]});return o===Or.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new Wl(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof uc&&r.errorCode===sr)return new Wl(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){var c;(c=this.performanceClient)==null||c.addQueueMeasurement(_.SilentFlowClientAcquireCachedToken,e.correlationId);let n=Or.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!pn.isEmptyObj(e.claims))throw this.setCacheOutcome(Or.FORCE_REFRESH_OR_CLAIMS,e.correlationId),j(sr);if(!e.account)throw j(Vu);const r=e.account.tenantId||JO(e.authority),o=this.cacheManager.getTokenKeys(),i=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient);if(i){if(UR(i.cachedAt)||jl(i.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Or.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),j(sr);i.refreshOn&&jl(i.refreshOn,0)&&(n=Or.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Or.NO_CACHED_ACCESS_TOKEN,e.correlationId),j(sr);const s=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.readAccountFromCache(e.account,e.correlationId),accessToken:i,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,r,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await G(this.generateResultFromCacheRecord.bind(this),_.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(a,e),n]}setCacheOutcome(e,n){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},n),e!==Or.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,n){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(_.SilentFlowClientGenerateResultFromCacheRecord,n.correlationId);let r;if(e.idToken&&(r=_o(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){const i=r==null?void 0:r.auth_time;if(!i)throw j(ju);vy(i,n.maxAge)}return wo.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,r)}}/*! @azure/msal-common v14.16.1 2025-08-05 */const lk={sendGetRequestAsync:()=>Promise.reject(j(Ee)),sendPostRequestAsync:()=>Promise.reject(j(Ee))};/*! @azure/msal-common v14.16.1 2025-08-05 */const qf=",",Gy="|";function uk(t){const{skus:e,libraryName:n,libraryVersion:r,extensionName:o,extensionVersion:i}=t,s=new Map([[0,[n,r]],[2,[o,i]]]);let a=[];if(e!=null&&e.length){if(a=e.split(qf),a.length<4)return e}else a=Array.from({length:4},()=>Gy);return s.forEach((c,l)=>{var u,d;c.length===2&&((u=c[0])!=null&&u.length)&&((d=c[1])!=null&&d.length)&&dk({skuArr:a,index:l,skuName:c[0],skuVersion:c[1]})}),a.join(qf)}function dk(t){const{skuArr:e,index:n,skuName:r,skuVersion:o}=t;n>=e.length||(e[n]=[r,o].join(Gy))}class ts{constructor(e,n){this.cacheOutcome=Or.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||P.EMPTY_STRING,this.wrapperVer=e.wrapperVer||P.EMPTY_STRING,this.telemetryCacheKey=wt.CACHE_KEY+It.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${wt.VALUE_SEPARATOR}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&n.push(`broker_error=${r}`);const o=n.join(wt.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),s=[e,i].join(wt.VALUE_SEPARATOR);return[wt.SCHEMA_VERSION,s,o].join(wt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),n=ts.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*n).join(wt.VALUE_SEPARATOR),o=e.errors.slice(0,n).join(wt.VALUE_SEPARATOR),i=e.errors.length,s=n=wt.MAX_CACHED_ERRORS&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof We?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(wt.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),n=ts.maxErrorsToSend(e),r=e.errors.length;if(n===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const o={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let n,r=0,o=0;const i=e.errors.length;for(n=0;nnull,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:YO.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""},measurement:new Vf}}startPerformanceMeasurement(){return new Vf}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const hd="pkce_not_created",Ql="crypto_nonexistent",yc="empty_navigate_uri",Qy="hash_empty_error",fd="no_state_in_hash",Yy="hash_does_not_contain_known_properties",Jy="unable_to_parse_state",Xy="state_interaction_type_mismatch",Zy="interaction_in_progress",ev="popup_window_error",tv="empty_window_error",Ao="user_cancelled",pk="monitor_popup_timeout",nv="monitor_window_timeout",rv="redirect_in_iframe",ov="block_iframe_reload",iv="block_nested_popups",gk="iframe_closed_prematurely",vc="silent_logout_unsupported",sv="no_account_error",mk="silent_prompt_value_error",av="no_token_request_cache_error",cv="unable_to_parse_token_request_cache_error",pd="no_cached_authority_error",yk="auth_request_not_set_error",vk="invalid_cache_type",Cc="non_browser_environment",Uo="database_not_open",Ta="no_network_connectivity",lv="post_request_failed",uv="get_request_failed",Yl="failed_to_parse_response",dv="unable_to_load_token",gd="crypto_key_not_found",hv="auth_code_required",fv="auth_code_or_nativeAccountId_required",pv="spa_code_and_nativeAccountId_present",md="database_unavailable",gv="unable_to_acquire_token_from_native_platform",mv="native_handshake_timeout",yv="native_extension_not_installed",Es="native_connection_not_established",vv="uninitialized_public_client_application",Cv="native_prompt_not_supported",wv="invalid_base64_string",Av="invalid_pop_token_request",Tv="failed_to_build_headers",Ev="failed_to_parse_headers";/*! @azure/msal-browser v3.30.0 2025-08-05 */const Yn="For more visit: aka.ms/msaljs/browser-errors",Ck={[hd]:"The PKCE code challenge and verifier could not be generated.",[Ql]:"The crypto object or function is not available.",[yc]:"Navigation URI is empty. Please check stack trace for more info.",[Qy]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${Yn}`,[fd]:"Hash does not contain state. Please verify that the request originated from msal.",[Yy]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${Yn}`,[Jy]:"Unable to parse state. Please verify that the request originated from msal.",[Xy]:"Hash contains state but the interaction type does not match the caller.",[Zy]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${Yn}`,[ev]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[tv]:"window.open returned null or undefined window object.",[Ao]:"User cancelled the flow.",[pk]:`Token acquisition in popup failed due to timeout. ${Yn}`,[nv]:`Token acquisition in iframe failed due to timeout. ${Yn}`,[rv]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[ov]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${Yn}`,[iv]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[gk]:"The iframe being monitored was closed prematurely.",[vc]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[sv]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[mk]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[av]:"No token request found in cache.",[cv]:"The cached token request could not be parsed.",[pd]:"No cached authority found.",[yk]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[vk]:"Invalid cache type",[Cc]:"Login and token requests are not supported in non-browser environments.",[Uo]:"Database is not open!",[Ta]:"No network connectivity. Check your internet connection.",[lv]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[uv]:"Network request failed. Please check the network trace to determine root cause.",[Yl]:"Failed to parse network response. Check network trace.",[dv]:"Error loading token to cache.",[gd]:"Cryptographic Key or Keypair not found in browser storage.",[hv]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[fv]:"An authorization code or nativeAccountId must be provided to this flow.",[pv]:"Request cannot contain both spa code and native account id.",[md]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[gv]:`Unable to acquire token from native platform. ${Yn}`,[mv]:"Timed out while attempting to establish connection to browser extension",[yv]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Es]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${Yn}`,[vv]:`You must call and await the initialize function before attempting to call any other MSAL API. ${Yn}`,[Cv]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[wv]:"Invalid base64 encoded string.",[Av]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[Tv]:"Failed to build request headers object.",[Ev]:"Failed to parse response headers"};class bs extends We{constructor(e,n){super(e,Ck[e],n),Object.setPrototypeOf(this,bs.prototype),this.name="BrowserAuthError"}}function te(t,e){return new bs(t,e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Qt={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},$o={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},oo={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Bt={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},Gf={GET:"GET",POST:"POST"},Be={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},sn={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys",VERSION:"msal.version"},$s={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},ze={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var ce;(function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"})(ce||(ce={}));const zf={scopes:yi},bv="jwk",Jl="msal.db",wk=1,Ak=`${Jl}.keys`,jt={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},Tk=[jt.Default,jt.Skip,jt.RefreshTokenAndNetwork],Ek="msal.browser.log.level",bk="msal.browser.log.pii";/*! @azure/msal-browser v3.30.0 2025-08-05 */function qs(t){return encodeURIComponent(yd(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function wc(t){return _v(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function yd(t){return _v(new TextEncoder().encode(t))}function _v(t){const e=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const _k="RSASSA-PKCS1-v1_5",Sv="SHA-256",Sk=2048,Ik=new Uint8Array([1,0,1]),Wf="0123456789abcdef",Qf=new Uint32Array(1),Rk="crypto_subtle_undefined",vd={name:_k,hash:Sv,modulusLength:Sk,publicExponent:Ik};function Ok(t){if(!window)throw te(Cc);if(!window.crypto)throw te(Ql);if(!t&&!window.crypto.subtle)throw te(Ql,Rk)}async function Iv(t,e,n){e==null||e.addQueueMeasurement(_.Sha256Digest,n);const o=new TextEncoder().encode(t);return window.crypto.subtle.digest(Sv,o)}function kk(t){return window.crypto.getRandomValues(t)}function el(){return window.crypto.getRandomValues(Qf),Qf[0]}function jn(){const t=Date.now(),e=el()*1024+(el()&1023),n=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,i=el();n[0]=t/2**40,n[1]=t/2**32,n[2]=t/2**24,n[3]=t/2**16,n[4]=t/2**8,n[5]=t,n[6]=112|r>>>8,n[7]=r,n[8]=128|o>>>24,n[9]=o>>>16,n[10]=o>>>8,n[11]=o,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i;let s="";for(let a=0;a>>4),s+=Wf.charAt(n[a]&15),(a===3||a===5||a===7||a===9)&&(s+="-");return s}async function Pk(t,e){return window.crypto.subtle.generateKey(vd,t,e)}async function tl(t){return window.crypto.subtle.exportKey(bv,t)}async function Nk(t,e,n){return window.crypto.subtle.importKey(bv,t,vd,e,n)}async function xk(t,e){return window.crypto.subtle.sign(vd,t,e)}async function Rv(t){const e=await Iv(t),n=new Uint8Array(e);return wc(n)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Cd="storage_not_supported",Mk="stubbed_public_client_application_called",Ov="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.30.0 2025-08-05 */const Dk={[Cd]:"Given storage configuration option was not supported.",[Mk]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[Ov]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};class wd extends We{constructor(e,n){super(e,n),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,wd.prototype)}}function Ad(t){return new wd(t,Dk[t])}/*! @azure/msal-browser v3.30.0 2025-08-05 */function Lk(t){t.location.hash="",typeof t.history.replaceState=="function"&&t.history.replaceState(null,"",`${t.location.origin}${t.location.pathname}${t.location.search}`)}function Uk(t){const e=t.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Td(){return window.parent!==window}function Hk(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Qt.POPUP_NAME_PREFIX}.`)===0}function ar(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function Bk(){const e=new Oe(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function Fk(){if(Oe.hashContainsKnownProperties(window.location.hash)&&Td())throw te(ov)}function Kk(t){if(Td()&&!t)throw te(rv)}function $k(){if(Hk())throw te(iv)}function kv(){if(typeof window>"u")throw te(Cc)}function Pv(t){if(!t)throw te(vv)}function Ed(t){kv(),Fk(),$k(),Pv(t)}function Yf(t,e){if(Ed(t),Kk(e.system.allowRedirectInIframe),e.cache.cacheLocation===Bt.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw Ad(Ov)}function Nv(t){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(t).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function qk(){return jn()}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Ea{navigateInternal(e,n){return Ea.defaultNavigateWindow(e,n)}navigateExternal(e,n){return Ea.defaultNavigateWindow(e,n)}static defaultNavigateWindow(e,n){return n.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},n.timeout)})}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class jk{async sendGetRequestAsync(e,n){let r,o={},i=0;const s=Jf(n);try{r=await fetch(e,{method:Gf.GET,headers:s})}catch{throw te(window.navigator.onLine?uv:Ta)}o=Xf(r.headers);try{return i=r.status,{headers:o,body:await r.json(),status:i}}catch{throw Ff(te(Yl),i,o)}}async sendPostRequestAsync(e,n){const r=n&&n.body||"",o=Jf(n);let i,s=0,a={};try{i=await fetch(e,{method:Gf.POST,headers:o,body:r})}catch{throw te(window.navigator.onLine?lv:Ta)}a=Xf(i.headers);try{return s=i.status,{headers:a,body:await i.json(),status:s}}catch{throw Ff(te(Yl),s,a)}}}function Jf(t){try{const e=new Headers;if(!(t&&t.headers))return e;const n=t.headers;return Object.entries(n).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw te(Tv)}}function Xf(t){try{const e={};return t.forEach((n,r)=>{e[r]=n}),e}catch{throw te(Ev)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Vk=6e4,Xl=1e4,Gk=3e4,zk=2e3;function Wk({auth:t,cache:e,system:n,telemetry:r},o){const i={clientId:P.EMPTY_STRING,authority:`${P.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:P.EMPTY_STRING,authorityMetadata:P.EMPTY_STRING,redirectUri:typeof window<"u"?ar():"",postLogoutRedirectUri:P.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:lr.AAD,OIDCOptions:{serverResponseType:Ts.FRAGMENT,defaultScopes:[P.OPENID_SCOPE,P.PROFILE_SCOPE,P.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:Qu.None,tenant:P.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},s={cacheLocation:Bt.SessionStorage,temporaryCacheLocation:Bt.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Bt.LocalStorage),claimsBasedCachingEnabled:!1},a={loggerCallback:()=>{},logLevel:Ye.Info,piiLoggingEnabled:!1},l={...{...By,loggerOptions:a,networkClient:o?new jk:lk,navigationClient:new Ea,loadFrameTimeout:0,windowHashTimeout:(n==null?void 0:n.loadFrameTimeout)||Vk,iframeHashTimeout:(n==null?void 0:n.loadFrameTimeout)||Xl,navigateFrameWait:0,redirectNavigationTimeout:Gk,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(n==null?void 0:n.nativeBrokerHandshakeTimeout)||zk,pollIntervalMilliseconds:Qt.DEFAULT_POLL_INTERVAL_MS},...n,loggerOptions:(n==null?void 0:n.loggerOptions)||a},u={application:{appName:P.EMPTY_STRING,appVersion:P.EMPTY_STRING},client:new fk};if((t==null?void 0:t.protocolMode)!==lr.OIDC&&(t!=null&&t.OIDCOptions)&&new $r(l.loggerOptions).warning(JSON.stringify(qe(Py))),t!=null&&t.protocolMode&&t.protocolMode!==lr.AAD&&(l!=null&&l.allowNativeBroker))throw qe(Ny);return{auth:{...i,...t,OIDCOptions:{...i.OIDCOptions,...t==null?void 0:t.OIDCOptions}},cache:{...s,...e},system:l,telemetry:{...u,...r}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const Qk="@azure/msal-browser",fi="3.30.0";/*! @azure/msal-browser v3.30.0 2025-08-05 */class bd{static loggerCallback(e,n){switch(e){case Ye.Error:console.error(n);return;case Ye.Info:console.info(n);return;case Ye.Verbose:console.debug(n);return;case Ye.Warning:console.warn(n);return;default:console.log(n);return}}constructor(e){var c;this.browserEnvironment=typeof window<"u",this.config=Wk(e,this.browserEnvironment);let n;try{n=window[Bt.SessionStorage]}catch{}const r=n==null?void 0:n.getItem(Ek),o=(c=n==null?void 0:n.getItem(bk))==null?void 0:c.toLowerCase(),i=o==="true"?!0:o==="false"?!1:void 0,s={...this.config.system.loggerOptions},a=r&&Object.keys(Ye).includes(r)?Ye[r]:void 0;a&&(s.loggerCallback=bd.loggerCallback,s.logLevel=a),i!==void 0&&(s.piiLoggingEnabled=i),this.logger=new $r(s,Qk,fi),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class To extends bd{getModuleName(){return To.MODULE_NAME}getId(){return To.ID}async initialize(){return this.available=typeof window<"u",this.available}}To.MODULE_NAME="";To.ID="StandardOperatingContext";/*! @azure/msal-browser v3.30.0 2025-08-05 */function $n(t){return new TextDecoder().decode(Yk(t))}function Yk(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw te(wv)}const n=atob(e);return Uint8Array.from(n,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Jk{constructor(){this.dbName=Jl,this.version=wk,this.tableName=Ak,this.dbOpen=!1}async open(){return new Promise((e,n)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const i=o;this.db=i.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>n(te(md)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(te(Uo));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),n(c.target.result)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async setItem(e,n){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(te(Uo));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(n,e);a.addEventListener("success",()=>{this.closeConnection(),r()}),a.addEventListener("error",c=>{this.closeConnection(),o(c)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(te(Uo));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),n()}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,n)=>{if(!this.db)return n(te(Uo));const i=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();i.addEventListener("success",s=>{const a=s;this.closeConnection(),e(a.target.result)}),i.addEventListener("error",s=>{this.closeConnection(),n(s)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(te(Uo));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),n(c.target.result===1)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,n)=>{const r=window.indexedDB.deleteDatabase(Jl),o=setTimeout(()=>n(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),n(!1)))})}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Zl{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,n){this.cache.set(e,n)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((n,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Xk{constructor(e){this.inMemoryCache=new Zl,this.indexedDBCache=new Jk,this.logger=e}handleDatabaseAccessError(e){if(e instanceof bs&&e.errorCode===md)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const n=this.inMemoryCache.getItem(e);if(!n)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return n}async setItem(e,n){this.inMemoryCache.setItem(e,n);try{await this.indexedDBCache.setItem(e,n)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(n){this.handleDatabaseAccessError(n)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(n){this.handleDatabaseAccessError(n)}return e}async containsKey(e){const n=this.inMemoryCache.containsKey(e);if(!n)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return n}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class pi{constructor(e,n,r){this.logger=e,Ok(r??!1),this.cache=new Xk(this.logger),this.performanceClient=n}createNewGuid(){return jn()}base64Encode(e){return yd(e)}base64Decode(e){return $n(e)}base64UrlEncode(e){return qs(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var u;const n=(u=this.performanceClient)==null?void 0:u.startMeasurement(_.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await Pk(pi.EXTRACTABLE,pi.POP_KEY_USAGES),o=await tl(r.publicKey),i={e:o.e,kty:o.kty,n:o.n},s=Zf(i),a=await this.hashString(s),c=await tl(r.privateKey),l=await Nk(c,!1,["sign"]);return await this.cache.setItem(a,{privateKey:l,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),n&&n.end({success:!0}),a}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,n,r,o){var y;const i=(y=this.performanceClient)==null?void 0:y.startMeasurement(_.CryptoOptsSignJwt,o),s=await this.cache.getItem(n);if(!s)throw te(gd);const a=await tl(s.publicKey),c=Zf(a),l=qs(JSON.stringify({kid:n})),u=dd.getShrHeaderString({...r==null?void 0:r.header,alg:a.alg,kid:l}),d=qs(u);e.cnf={jwk:JSON.parse(c)};const h=qs(JSON.stringify(e)),f=`${d}.${h}`,g=new TextEncoder().encode(f),m=await xk(s.privateKey,g),C=wc(new Uint8Array(m)),T=`${f}.${C}`;return i&&i.end({success:!0}),T}async hashString(e){return Rv(e)}}pi.POP_KEY_USAGES=["sign","verify"];pi.EXTRACTABLE=!0;function Zf(t){return JSON.stringify(t,Object.keys(t).sort())}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Zk{constructor(){if(!window.localStorage)throw Ad(Cd)}getItem(e){return window.localStorage.getItem(e)}setItem(e,n){window.localStorage.setItem(e,n)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class eP{constructor(){if(!window.sessionStorage)throw Ad(Cd)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,n){window.sessionStorage.setItem(e,n)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function xv(t,e){if(!e)return null;try{return gn.parseRequestState(t,e).libraryState.meta}catch{throw j(ui)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const tP=24*60*60*1e3;class nP{getItem(e){const n=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o{const o=decodeURIComponent(r).trim().split("=");n.push(o[0])}),n}containsKey(e){return this.getKeys().includes(e)}}function rP(t){const e=new Date;return new Date(e.getTime()+t*tP).toUTCString()}/*! @azure/msal-browser v3.30.0 2025-08-05 */class eu extends di{constructor(e,n,r,o,i,s){super(e,r,o,i),this.cacheConfig=n,this.logger=o,this.internalStorage=new Zl,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new nP,n.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=s}setupBrowserStorage(e){try{switch(e){case Bt.LocalStorage:return new Zk;case Bt.SessionStorage:return new eP;case Bt.MemoryStorage:default:break}}catch(n){this.logger.error(n)}return this.cacheConfig.cacheLocation=Bt.MemoryStorage,new Zl}migrateCacheEntries(){const e=this.browserStorage.getItem(sn.VERSION);e&&this.logger.info(`MSAL.js was last initialized with version ${e}`),e!==fi&&this.browserStorage.setItem(sn.VERSION,fi);const n=`${P.CACHE_PREFIX}.${ft.ID_TOKEN}`,r=`${P.CACHE_PREFIX}.${ft.CLIENT_INFO}`,o=`${P.CACHE_PREFIX}.${ft.ERROR}`,i=`${P.CACHE_PREFIX}.${ft.ERROR_DESC}`,s=this.browserStorage.getItem(n),a=this.browserStorage.getItem(r),c=this.browserStorage.getItem(o),l=this.browserStorage.getItem(i),u=[s,a,c,l];[ft.ID_TOKEN,ft.CLIENT_INFO,ft.ERROR,ft.ERROR_DESC].forEach((h,f)=>{const p=u[f];p&&this.setTemporaryCache(h,p,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.cryptoImpl.createNewGuid(),n=this.getItem(sn.ACCOUNT_KEYS),r=this.getItem(`${sn.TOKEN_KEYS}.${this.clientId}`);if(n&&r){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(i=>{if(this.isCredentialKey(i)){const s=this.getItem(i);if(s){const a=this.validateAndParseJson(s);if(a&&a.hasOwnProperty("credentialType"))switch(a.credentialType){case we.ID_TOKEN:if(kf(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,we.ID_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${i}`);break;case we.ACCESS_TOKEN:case we.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Of(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,we.ACCESS_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${i}`);break;case we.REFRESH_TOKEN:if(Pf(a)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${i} found, saving key to token key map`);const c=a,l=this.updateCredentialCacheKey(i,c,e);this.addTokenKey(l,we.REFRESH_TOKEN,e);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${i}`);break}}}if(this.isAccountKey(i)){const s=this.getItem(i);if(s){const a=this.validateAndParseJson(s);a&&dt.isAccountEntity(a)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${i} found, saving key to account key map`),this.addAccountKeyToMap(i,e))}}})}validateAndParseJson(e){try{const n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,n,r){let o=[];for(let s=0;s<=20;s++)try{this.browserStorage.setItem(e,n),s>0&&this.removeAccessTokenKeys(o.slice(0,s),r);break}catch(a){const c=Hy(a);if(c.errorCode===od&&s<20){if(o.length||(e===`${sn.TOKEN_KEYS}.${this.clientId}`?o=JSON.parse(n).accessToken:o=this.getTokenKeys().accessToken),o.length<=s)throw c;this.removeAccessToken(o[s],r,!1)}else throw c}}getAccount(e,n,r){this.logger.trace("BrowserCacheManager.getAccount called");const o=this.getCachedAccountEntity(e,n);return this.updateOutdatedCachedAccount(e,o,n,r)}getCachedAccountEntity(e,n){const r=this.getItem(e);if(!r)return this.removeAccountKeyFromMap(e,n),null;const o=this.validateAndParseJson(r);return!o||!dt.isAccountEntity(o)?null:di.toObject(new dt,o)}setAccount(e,n){this.logger.trace("BrowserCacheManager.setAccount called");const r=e.generateAccountKey();e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),n),this.addAccountKeyToMap(r,n)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(sn.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e,n){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const r=this.getAccountKeys();r.indexOf(e)===-1?(r.push(e),this.setItem(sn.ACCOUNT_KEYS,JSON.stringify(r),n),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e,n){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const r=this.getAccountKeys(),o=r.indexOf(e);if(o>-1){if(r.splice(o,1),r.length===0){this.removeItem(sn.ACCOUNT_KEYS);return}else this.setItem(sn.ACCOUNT_KEYS,JSON.stringify(r),n);this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")}else this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e,n){super.removeAccount(e,n),this.removeAccountKeyFromMap(e,n)}removeOutdatedAccount(e,n){this.removeItem(e),this.removeAccountKeyFromMap(e,n)}removeIdToken(e,n){super.removeIdToken(e,n),this.removeTokenKey(e,we.ID_TOKEN,n)}removeAccessToken(e,n,r=!0){var o;super.removeAccessToken(e,n),(o=this.performanceClient)==null||o.incrementFields({accessTokensRemoved:1},n),r&&this.removeTokenKey(e,we.ACCESS_TOKEN,n)}removeAccessTokenKeys(e,n){this.logger.trace("removeAccessTokenKey called");const r=this.getTokenKeys();let o=0;if(e.forEach(i=>{const s=r.accessToken.indexOf(i);s>-1&&(r.accessToken.splice(s,1),o++)}),o>0){this.logger.info(`removed ${o} accessToken keys from tokenKeys map`),this.setTokenKeys(r,n);return}}removeRefreshToken(e,n){super.removeRefreshToken(e,n),this.removeTokenKey(e,we.REFRESH_TOKEN,n)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${sn.TOKEN_KEYS}.${this.clientId}`);if(e){const n=this.validateAndParseJson(e);if(n&&n.hasOwnProperty("idToken")&&n.hasOwnProperty("accessToken")&&n.hasOwnProperty("refreshToken"))return n;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}setTokenKeys(e,n){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(`${sn.TOKEN_KEYS}.${this.clientId}`);return}else this.setItem(`${sn.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(e),n)}addTokenKey(e,n,r){this.logger.trace("BrowserCacheManager addTokenKey called");const o=this.getTokenKeys();switch(n){case we.ID_TOKEN:o.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),o.idToken.push(e));break;case we.ACCESS_TOKEN:const i=o.accessToken.indexOf(e);i!==-1&&o.accessToken.splice(i,1),this.logger.trace(`access token ${i===-1?"added to":"updated in"} map`),o.accessToken.push(e);break;case we.REFRESH_TOKEN:o.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),o.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${n}`),j(ql)}this.setTokenKeys(o,r)}removeTokenKey(e,n,r,o=this.getTokenKeys()){switch(this.logger.trace("BrowserCacheManager removeTokenKey called"),n){case we.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const i=o.idToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),o.idToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case we.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const s=o.accessToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),o.accessToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case we.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const a=o.refreshToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),o.refreshToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${n}`),j(ql)}this.setTokenKeys(o,r)}getIdTokenCredential(e,n){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeIdToken(e,n),null;const o=this.validateAndParseJson(r);return!o||!kf(o)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),o)}setIdTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const r=Fo(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),n),this.addTokenKey(r,we.ID_TOKEN,n)}getAccessTokenCredential(e,n){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,we.ACCESS_TOKEN,n),null;const o=this.validateAndParseJson(r);return!o||!Of(o)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),o)}setAccessTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const r=Fo(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),n),this.addTokenKey(r,we.ACCESS_TOKEN,n)}getRefreshTokenCredential(e,n){const r=this.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,we.REFRESH_TOKEN,n),null;const o=this.validateAndParseJson(r);return!o||!Pf(o)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),o)}setRefreshTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const r=Fo(e);e.lastUpdatedAt=Date.now().toString(),this.setItem(r,JSON.stringify(e),n),this.addTokenKey(r,we.REFRESH_TOKEN,n)}getAppMetadata(e){const n=this.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!GR(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e,n){this.logger.trace("BrowserCacheManager.setAppMetadata called");const r=VR(e);this.setItem(r,JSON.stringify(e),n)}getServerTelemetry(e){const n=this.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!qR(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,n,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(n),r)}getAuthorityMetadata(e){const n=this.internalStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return r&&zR(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(n=>this.isAuthorityMetadata(n))}setWrapperMetadata(e,n){this.internalStorage.setItem($s.WRAPPER_SKU,e),this.internalStorage.setItem($s.WRAPPER_VER,n)}getWrapperMetadata(){const e=this.internalStorage.getItem($s.WRAPPER_SKU)||P.EMPTY_STRING,n=this.internalStorage.getItem($s.WRAPPER_VER)||P.EMPTY_STRING;return[e,n]}setAuthorityMetadata(e,n){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(n))}getActiveAccount(e){const n=this.generateCacheKey(ft.ACTIVE_ACCOUNT_FILTERS),r=this.getItem(n);if(!r){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const i=this.generateCacheKey(ft.ACTIVE_ACCOUNT),s=this.getItem(i);if(!s)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const a=this.getAccountInfoFilteredBy({localAccountId:s},e);return a?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(a,e),a):null}const o=this.validateAndParseJson(r);return o?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:o.homeAccountId,localAccountId:o.localAccountId,tenantId:o.tenantId},e)):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e,n){const r=this.generateCacheKey(ft.ACTIVE_ACCOUNT_FILTERS),o=this.generateCacheKey(ft.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const i={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId,lastUpdatedAt:Date.now().toString()};this.setItem(r,JSON.stringify(i),n),this.setItem(o,e.localAccountId,n)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r),this.browserStorage.removeItem(o)}getThrottlingCache(e){const n=this.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!jR(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,n,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(n),r)}getTemporaryCache(e,n){const r=n?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const i=this.cookieStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),i}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===Bt.LocalStorage){const i=this.browserStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),i}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,n,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,n),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,n,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(e){await this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(n=>{(n.indexOf(P.CACHE_PREFIX)!==-1||n.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(n)}),this.browserStorage.getKeys().forEach(n=>{(n.indexOf(P.CACHE_PREFIX)!==-1||n.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(n)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,n){e.addQueueMeasurement(_.ClearTokensAndKeysWithClaims,n);const r=this.getTokenKeys();let o=0;r.accessToken.forEach(i=>{const s=this.getAccessTokenCredential(i,n);s!=null&&s.requestedClaimsHash&&i.includes(s.requestedClaimsHash.toLowerCase())&&(this.removeAccessToken(i,n),o++)}),o>0&&this.logger.warning(`${o} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):pn.startsWith(e,P.CACHE_PREFIX)||pn.startsWith(e,ft.ADAL_ID_TOKEN)?e:`${P.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:n}}=gn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Be.AUTHORITY}.${n}`)}generateNonceKey(e){const{libraryState:{id:n}}=gn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Be.NONCE_IDTOKEN}.${n}`)}generateStateKey(e){const{libraryState:{id:n}}=gn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Be.REQUEST_STATE}.${n}`)}getCachedAuthority(e){const n=this.generateStateKey(e),r=this.getTemporaryCache(n);if(!r)return null;const o=this.generateAuthorityKey(r);return this.getTemporaryCache(o)}updateCacheEntries(e,n,r,o,i){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const s=this.generateStateKey(e);this.setTemporaryCache(s,e,!1);const a=this.generateNonceKey(e);this.setTemporaryCache(a,n,!1);const c=this.generateAuthorityKey(e);if(this.setTemporaryCache(c,r,!1),i){const l={credential:i.homeAccountId,type:Jt.HOME_ACCOUNT_ID};this.setTemporaryCache(Be.CCS_CREDENTIAL,JSON.stringify(l),!0)}else if(o){const l={credential:o,type:Jt.UPN};this.setTemporaryCache(Be.CCS_CREDENTIAL,JSON.stringify(l),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(n=>{n.indexOf(e)!==-1&&this.removeTemporaryItem(n)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(Be.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Be.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Be.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Be.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(Be.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(Be.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const n=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(n);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||P.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(n=>{if(n.indexOf(Be.REQUEST_STATE)===-1)return;const r=this.temporaryCacheStorage.getItem(n);if(!r)return;const o=xv(this.cryptoImpl,r);o&&o.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const n=yd(JSON.stringify(e));this.setTemporaryCache(Be.REQUEST_PARAMS,n,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const n=this.getTemporaryCache(Be.REQUEST_PARAMS,!0);if(!n)throw te(av);let r;try{r=JSON.parse($n(n))}catch(o){throw this.logger.errorPii(`Attempted to parse: ${n}`),this.logger.error(`Parsing cached token request threw with error: ${o}`),te(cv)}if(this.removeTemporaryItem(this.generateCacheKey(Be.REQUEST_PARAMS)),!r.authority){const o=this.generateAuthorityKey(e),i=this.getTemporaryCache(o);if(!i)throw te(pd);r.authority=i}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Be.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const n=this.validateAndParseJson(e);return n||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const n=this.getInteractionInProgress();return e?n===this.clientId:!!n}getInteractionInProgress(){const e=`${P.CACHE_PREFIX}.${Be.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const n=`${P.CACHE_PREFIX}.${Be.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw te(Zy);this.setTemporaryCache(n,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(n)}getLegacyLoginHint(){const e=this.getTemporaryCache(ft.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(ft.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const n=this.getTemporaryCache(ft.ID_TOKEN,!0);n&&(this.browserStorage.removeItem(this.generateCacheKey(ft.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=n||e;if(r){const o=_o(r,$n);if(o.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.preferred_username;if(o.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,n,r){const o=Fo(n);if(e!==o){const i=this.getItem(e);if(i)return this.browserStorage.removeItem(e),this.setItem(o,i,r),this.logger.verbose(`Updated an outdated ${n.credentialType} cache key`),o;this.logger.error(`Attempted to update an outdated ${n.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,n){var a,c,l;const r=dc((a=e.account)==null?void 0:a.homeAccountId,(c=e.account)==null?void 0:c.environment,e.idToken,this.clientId,e.tenantId);let o;n.claims&&(o=await this.cryptoImpl.hashString(n.claims));const i=hc((l=e.account)==null?void 0:l.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,$n,void 0,e.tokenType,void 0,n.sshKid,n.claims,o),s={idToken:r,accessToken:i};return this.saveCacheRecord(s,e.correlationId)}async saveCacheRecord(e,n,r){try{await super.saveCacheRecord(e,n,r)}catch(o){if(o instanceof Wo&&this.performanceClient&&n)try{const i=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:i.refreshToken.length,cacheIdCount:i.idToken.length,cacheAtCount:i.accessToken.length},n)}catch{}throw o}}}const oP=(t,e)=>{const n={cacheLocation:Bt.MemoryStorage,temporaryCacheLocation:Bt.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new eu(t,n,ma,e)};/*! @azure/msal-browser v3.30.0 2025-08-05 */function iP(t,e,n,r,o){return t.verbose("getAllAccounts called"),n?e.getAllAccounts(r,o):[]}function sP(t,e,n,r){if(e.trace("getAccount called"),Object.keys(t).length===0)return e.warning("getAccount: No accountFilter provided"),null;const o=n.getAccountInfoFilteredBy(t,r);return o?(e.verbose("getAccount: Account matching provided filter found, returning"),o):(e.verbose("getAccount: No matching account found, returning null"),null)}function aP(t,e,n,r){if(e.trace("getAccountByUsername called"),!t)return e.warning("getAccountByUsername: No username provided"),null;const o=n.getAccountInfoFilteredBy({username:t},r);return o?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${t}`),o):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function cP(t,e,n,r){if(e.trace("getAccountByHomeId called"),!t)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const o=n.getAccountInfoFilteredBy({homeAccountId:t},r);return o?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${t}`),o):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function lP(t,e,n,r){if(e.trace("getAccountByLocalId called"),!t)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const o=n.getAccountInfoFilteredBy({localAccountId:t},r);return o?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${t}`),o):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function uP(t,e,n){e.setActiveAccount(t,n)}function dP(t,e){return t.getActiveAccount(e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */const me={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.30.0 2025-08-05 */class hP{constructor(e){this.eventCallbacks=new Map,this.logger=e||new $r({})}addEventCallback(e,n,r){if(typeof window<"u"){const o=r||qk();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,n||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,n,r,o){if(typeof window<"u"){const i={eventType:e,interactionType:n||null,payload:r||null,error:o||null,timestamp:Date.now()};this.eventCallbacks.forEach(([s,a],c)=>{(a.length===0||a.includes(e))&&(this.logger.verbose(`Emitting event to callback ${c}: ${e}`),s.apply(null,[i]))})}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Mv{constructor(e,n,r,o,i,s,a,c,l){this.config=e,this.browserStorage=n,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=i,this.navigationClient=s,this.nativeMessageHandler=c,this.correlationId=l||jn(),this.logger=o.clone(Qt.MSAL_SKU,fi,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){dt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(this.correlationId),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null,this.correlationId));try{await this.browserStorage.removeAccount(dt.generateAccountCacheKey(e),this.correlationId),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(this.correlationId),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const n=e||this.config.auth.redirectUri;return Oe.getAbsoluteUrl(n,ar())}initializeServerTelemetryManager(e,n){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:n||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new ts(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:n}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(_.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},i=e.requestAuthority||this.config.auth.authority,s=r!=null&&r.length?r==="true":this.config.auth.instanceAware,a=n&&s?this.config.auth.authority.replace(Oe.getDomainFromUrl(i),n.environment):i,c=_t.generateAuthority(a,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),l=await G($y,_.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(c,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(n&&!l.isAlias(n.environment))throw qe(xy);return l}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const fP=32;async function pP(t,e,n){t.addQueueMeasurement(_.GeneratePkceCodes,n);const r=So(gP,_.GenerateCodeVerifier,e,t,n)(t,e,n),o=await G(mP,_.GenerateCodeChallengeFromVerifier,e,t,n)(r,t,e,n);return{verifier:r,challenge:o}}function gP(t,e,n){try{const r=new Uint8Array(fP);return So(kk,_.GetRandomValues,e,t,n)(r),wc(r)}catch{throw te(hd)}}async function mP(t,e,n,r){e.addQueueMeasurement(_.GenerateCodeChallengeFromVerifier,r);try{const o=await G(Iv,_.Sha256Digest,n,e,r)(t,e,r);return wc(new Uint8Array(o))}catch{throw te(hd)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function _d(t,e,n,r){n.addQueueMeasurement(_.InitializeBaseRequest,t.correlationId);const o=t.authority||e.auth.authority,i=[...t&&t.scopes||[]],s={...t,correlationId:t.correlationId,authority:o,scopes:i};if(!s.authenticationScheme)s.authenticationScheme=Fe.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(s.authenticationScheme===Fe.SSH){if(!t.sshJwk)throw qe(fc);if(!t.sshKid)throw qe(ky)}r.verbose(`Authentication Scheme set to "${s.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&t.claims&&!pn.isEmptyObj(t.claims)&&(s.requestedClaimsHash=await Rv(t.claims)),s}async function yP(t,e,n,r,o){r.addQueueMeasurement(_.InitializeSilentRequest,t.correlationId);const i=await G(_d,_.InitializeBaseRequest,o,r,t.correlationId)(t,n,r,o);return{...t,...i,account:e,forceRefresh:t.forceRefresh||!1}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class vi extends Mv{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const n=await G(pP,_.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:P.EMPTY_STRING,codeVerifier:n.verifier};return e.codeChallenge=n.challenge,e.codeChallengeMethod=P.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const n={correlationId:this.correlationId||jn(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),n.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",n.correlationId),n.postLogoutRedirectUri=Oe.getAbsoluteUrl(e.postLogoutRedirectUri,ar())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",n.correlationId),n.postLogoutRedirectUri=Oe.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,ar())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",n.correlationId),n.postLogoutRedirectUri=Oe.getAbsoluteUrl(ar(),ar())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",n.correlationId),n}getLogoutHintFromIdTokenClaims(e){const n=e.idTokenClaims;if(n){if(n.login_hint)return n.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const n=await G(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Vy(n,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:n,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}=e;this.performanceClient.addQueueMeasurement(_.StandardInteractionClientGetClientConfiguration,this.correlationId);const a=await G(this.getDiscoveredAuthority.bind(this),_.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}),c=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:c.loggerCallback,piiLoggingEnabled:c.piiLoggingEnabled,logLevel:c.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:n,libraryInfo:{sku:Qt.MSAL_SKU,version:fi,cpu:P.EMPTY_STRING,os:P.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,n){this.performanceClient.addQueueMeasurement(_.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:n},i=gn.setRequestState(this.browserCrypto,e&&e.state||P.EMPTY_STRING,o),a={...await G(_d,_.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:i,nonce:e.nonce||jn(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return a;const c=e.account||this.browserStorage.getActiveAccount(this.correlationId);if(c&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${c.homeAccountId}`,this.correlationId),a.account=c),!a.loginHint&&!c){const l=this.browserStorage.getLegacyLoginHint();l&&(a.loginHint=l)}return a}}/*! @azure/msal-browser v3.30.0 2025-08-05 */const vP="ContentError",Dv="user_switch";/*! @azure/msal-browser v3.30.0 2025-08-05 */const CP="USER_INTERACTION_REQUIRED",wP="USER_CANCEL",AP="NO_NETWORK",TP="PERSISTENT_ERROR",EP="DISABLED",bP="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.30.0 2025-08-05 */const _P=-2147186943,SP={[Dv]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Ln extends We{constructor(e,n,r){super(e,n),Object.setPrototypeOf(this,Ln.prototype),this.name="NativeAuthError",this.ext=r}}function Ho(t){if(t.ext&&t.ext.status&&(t.ext.status===TP||t.ext.status===EP)||t.ext&&t.ext.error&&t.ext.error===_P)return!0;switch(t.errorCode){case vP:return!0;default:return!1}}function tu(t,e,n){if(n&&n.status)switch(n.status){case bP:return zl(qy);case CP:return new En(t,e);case wP:return te(Ao);case AP:return te(Ta)}return new Ln(t,SP[t]||e,n)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Lv extends vi{async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentCacheClientAcquireToken,e.correlationId);const n=this.initializeServerTelemetryManager(ze.acquireTokenSilent_silentFlow),r=await G(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new ck(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const s=(await G(o.acquireCachedToken.bind(o),_.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),s}catch(i){throw i instanceof bs&&i.errorCode===gd&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),i}}logout(e){this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(n==null?void 0:n.account)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Qo extends Mv{constructor(e,n,r,o,i,s,a,c,l,u,d,h){var p;super(e,n,r,o,i,s,c,l,h),this.apiId=a,this.accountId=u,this.nativeMessageHandler=l,this.nativeStorageManager=d,this.silentCacheClient=new Lv(e,this.nativeStorageManager,r,o,i,s,c,l,h),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const f=this.nativeMessageHandler.getExtensionId()===$o.PREFERRED_EXTENSION_ID?"chrome":(p=this.nativeMessageHandler.getExtensionId())!=null&&p.length?"unknown":void 0;this.skus=ts.makeExtraSkuString({libraryName:Qt.MSAL_SKU,libraryVersion:fi,extensionName:f,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[VO]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(_.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const n=this.performanceClient.startMeasurement(_.NativeInteractionClientAcquireToken,e.correlationId),r=qn();try{const o=await this.initializeNativeRequest(e);try{const l=await this.acquireTokensFromCache(this.accountId,o);return n.end({success:!0,isNativeBroker:!1,fromCache:!0}),l}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...i}=o,s={method:oo.GetToken,request:i},a=await this.nativeMessageHandler.sendMessage(s),c=this.validateNativeResponse(a);return await this.handleNativeResponse(c,o,r).then(l=>(n.end({success:!0,isNativeBroker:!0,requestId:l.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),l)).catch(l=>{throw n.end({success:!1,errorCode:l.errorCode,subErrorCode:l.subError,isNativeBroker:!0}),l})}catch(o){throw o instanceof Ln&&this.serverTelemetryManager.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,n){return{authority:e.authority,correlationId:this.correlationId,scopes:rt.fromString(e.scope).asArray(),account:n,forceRefresh:!1}}async acquireTokensFromCache(e,n){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),j(Kl);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},n.correlationId);if(!r)throw j(Kl);try{const o=this.createSilentCacheRequest(n,r),i=await this.silentCacheClient.acquireToken(o),s={...r,idTokenClaims:i==null?void 0:i.idTokenClaims,idToken:i==null?void 0:i.idToken};return{...i,account:s}}catch(o){throw o}}async acquireTokenRedirect(e,n){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),i={method:oo.GetToken,request:o};try{const c=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(c)}catch(c){if(c instanceof Ln&&(this.serverTelemetryManager.setNativeBrokerErrorCode(c.errorCode),Ho(c)))throw c}this.browserStorage.setTemporaryCache(Be.NATIVE_REQUEST,JSON.stringify(o),!0);const s={apiId:ze.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);n.end({success:!0}),await this.navigationClient.navigateExternal(a,s)}async handleRedirectPromise(e,n){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&n&&(e==null||e.addFields({errorCode:"no_cached_request"},n)),null;const{prompt:o,...i}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Be.NATIVE_REQUEST));const s={method:oo.GetToken,request:i},a=qn();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const c=await this.nativeMessageHandler.sendMessage(s);this.validateNativeResponse(c);const l=this.handleNativeResponse(c,i,a);this.browserStorage.setInteractionInProgress(!1);const u=await l;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),u}catch(c){throw this.browserStorage.setInteractionInProgress(!1),c}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,n,r){var u;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=_o(e.id_token,$n),i=this.createHomeAccountIdentifier(e,o),s=(u=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:n.accountId},this.correlationId))==null?void 0:u.homeAccountId;if(i!==s&&e.account.id!==n.accountId)throw tu(Dv);const a=await this.getDiscoveredAuthority({requestAuthority:n.authority}),c=ld(this.browserStorage,a,i,$n,this.correlationId,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger),l=await this.generateAuthenticationResult(e,n,o,c,a.canonicalAuthority,r);return this.cacheAccount(c),this.cacheNativeTokens(e,n,i,o,e.access_token,l.tenantId,r),l}createHomeAccountIdentifier(e,n){return dt.generateHomeAccountId(e.client_info||P.EMPTY_STRING,hn.Default,this.logger,this.browserCrypto,n)}generateScopes(e,n){return e.scope?rt.fromString(e.scope):rt.fromString(n.scope)}async generatePopAccessToken(e,n){if(n.tokenType===Fe.POP&&n.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new hi(this.browserCrypto),o={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce};if(!n.keyId)throw j(zu);return r.signPopToken(e.access_token,n.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,n,r,o,i,s){const a=this.addTelemetryFromNativeResponse(e),c=e.scope?rt.fromString(e.scope):rt.fromString(n.scope),l=e.account.properties||{},u=l.UID||r.oid||r.sub||P.EMPTY_STRING,d=l.TenantId||r.tid||P.EMPTY_STRING,h=nd(o.getAccountInfo(),void 0,r,e.id_token);h.nativeAccountId!==e.account.id&&(h.nativeAccountId=e.account.id);const f=await this.generatePopAccessToken(e,n),p=n.tokenType===Fe.POP?Fe.POP:Fe.BEARER;return{authority:i,uniqueId:u,tenantId:d,scopes:c.asArray(),account:h,idToken:e.id_token,idTokenClaims:r,accessToken:f,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:new Date(Number(s+e.expires_in)*1e3),tokenType:p,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(e,this.correlationId).catch(n=>{this.logger.error(`Error occurred while removing account context from browser storage. ${n}`)})}cacheNativeTokens(e,n,r,o,i,s,a){const c=dc(r,n.authority,e.id_token||"",n.clientId,o.tid||""),l=n.tokenType===Fe.POP?P.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,u=a+l,d=this.generateScopes(e,n),h=hc(r,n.authority,i,n.clientId,o.tid||s,d.printScopes(),u,0,$n,void 0,n.tokenType,void 0,n.keyId),f={idToken:c,accessToken:h};this.nativeStorageManager.saveCacheRecord(f,n.correlationId,n.storeInCache)}addTelemetryFromNativeResponse(e){const n=this.getMATSFromResponse(e);return n?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:n.broker_version,matsAccountJoinOnStart:n.account_join_on_start,matsAccountJoinOnEnd:n.account_join_on_end,matsDeviceJoin:n.device_join,matsPromptBehavior:n.prompt_behavior,matsApiErrorCode:n.api_error_code,matsUiVisible:n.ui_visible,matsSilentCode:n.silent_code,matsSilentBiSubCode:n.silent_bi_sub_code,matsSilentMessage:n.silent_message,matsSilentStatus:n.silent_status,matsHttpStatus:n.http_status,matsHttpEventCount:n.http_event_count},this.correlationId),n):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw ey(Ku,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const n=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:n,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new Oe(n);r.validateAsUri();const{scopes:o,...i}=e,s=new rt(o||[]);s.appendScopes(yi);const a=()=>{switch(this.apiId){case ze.ssoSilent:case ze.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),gt.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case gt.NONE:case gt.CONSENT:case gt.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),te(Cv)}},c={...i,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:a(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(c.signPopToken&&e.popKid)throw te(Av);if(this.handleExtraBrokerParams(c),c.extraParameters=c.extraParameters||{},c.extraParameters.telemetry=$o.MATS_TELEMETRY,e.authenticationScheme===Fe.POP){const l={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},u=new hi(this.browserCrypto);let d;if(c.keyId)d=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:c.keyId})),c.signPopToken=!1;else{const h=await G(u.generateCnf.bind(u),_.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(l,this.logger);d=h.reqCnfString,c.keyId=h.kid,c.signPopToken=!0}c.reqCnf=d}return this.addRequestSKUs(c),c}handleExtraBrokerParams(e){var i;const n=e.extraParameters&&e.extraParameters.hasOwnProperty(sd)&&e.extraParameters.hasOwnProperty(Gl)&&e.extraParameters.hasOwnProperty(Co);if(!e.embeddedClientId&&!n)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[Gl],r=e.extraParameters[Co]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(i=this.performanceClient)==null||i.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Hn{constructor(e,n,r,o){this.logger=e,this.handshakeTimeoutMs=n,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(_.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const n={channel:$o.CHANNEL_ID,extensionId:this.extensionId,responseId:jn(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(n)}`),this.messageChannel.port1.postMessage(n),new Promise((r,o)=>{this.resolvers.set(n.responseId,{resolve:r,reject:o})})}static async createProvider(e,n,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new Hn(e,n,r,$o.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const i=new Hn(e,n,r);return await i.sendHandshakeRequest(),i}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:$o.CHANNEL_ID,extensionId:this.extensionId,responseId:jn(),body:{method:oo.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=n=>{this.onChannelMessage(n)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((n,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:n,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(te(mv)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const n=e.data;if(!(!n.channel||n.channel!==$o.CHANNEL_ID)&&!(n.extensionId&&n.extensionId!==this.extensionId)&&n.body.method===oo.HandshakeRequest){const r=this.handshakeResolvers.get(n.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${n.responseId}`);return}this.logger.verbose(n.extensionId?`Extension with id: ${n.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(te(yv))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const n=e.data,r=this.resolvers.get(n.responseId),o=this.handshakeResolvers.get(n.responseId);try{const i=n.body.method;if(i===oo.Response){if(!r)return;const s=n.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(s)}`),s.status!=="Success")r.reject(tu(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?r.reject(tu(s.result.code,s.result.description,s.result.ext)):r.resolve(s.result);else throw ey(Ku,"Event does not contain result.");this.resolvers.delete(n.responseId)}else if(i===oo.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${n.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=n.extensionId,this.extensionVersion=n.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(n.responseId)}}catch(i){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${i}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(i):o&&o.reject(i)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,n,r,o){if(n.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return n.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return n.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case Fe.BEARER:case Fe.POP:return n.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return n.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Sd{constructor(e,n,r,o,i){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async handleCodeResponse(e,n){this.performanceClient.addQueueMeasurement(_.HandleCodeResponse,n.correlationId);let r;try{r=this.authModule.handleFragmentResponse(e,n.state)}catch(o){throw o instanceof qr&&o.subError===Ao?te(Ao):o}return G(this.handleCodeResponseFromServer.bind(this),_.HandleCodeResponseFromServer,this.logger,this.performanceClient,n.correlationId)(r,n)}async handleCodeResponseFromServer(e,n,r=!0){if(this.performanceClient.addQueueMeasurement(_.HandleCodeResponseFromServer,n.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await G(this.authModule.updateAuthority.bind(this.authModule),_.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,n.correlationId)(e.cloud_instance_host_name,n.correlationId),r&&(e.nonce=n.nonce||void 0),e.state=n.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const i=this.createCcsCredentials(n);i&&(this.authCodeRequest.ccsCredential=i)}return await G(this.authModule.acquireToken.bind(this.authModule),_.AuthClientAcquireToken,this.logger,this.performanceClient,n.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Jt.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Jt.UPN}:null}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function Uv(t,e,n){const r=Ca(t);if(!r)throw Dy(t)?(n.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),n.errorPii(`The ${e} detected is: ${t}`),te(Yy)):(n.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),te(Qy));return r}function IP(t,e,n){if(!t.state)throw te(fd);const r=xv(e,t.state);if(!r)throw te(Jy);if(r.interactionType!==n)throw te(Xy)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class RP extends vi{constructor(e,n,r,o,i,s,a,c,l,u){super(e,n,r,o,i,s,a,l,u),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=c}acquireToken(e){try{const r={popupName:this.generatePopupName(e.scopes||yi,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r))}catch(n){return Promise.reject(n)}}logout(e){try{this.logger.verbose("logoutPopup called");const n=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(n),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,i=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(n,r,o,i)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(n,r,o,i))}catch(n){return Promise.reject(n)}}async acquireTokenPopupAsync(e,n){var i;this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(ze.acquireTokenPopup),o=await G(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ce.Popup);Nv(o.authority);try{const s=await G(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),a=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),c=Hn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let l;c&&(l=this.performanceClient.startMeasurement(_.FetchAccountIdWithNativeBroker,e.correlationId));const u=await a.getAuthCodeUrl({...o,nativeBroker:c}),d=new Sd(a,this.browserStorage,s,this.logger,this.performanceClient),h=this.initiateAuthRequest(u,n);this.eventHandler.emitEvent(me.POPUP_OPENED,ce.Popup,{popupWindow:h},null);const f=await this.monitorPopupForHash(h,n.popupWindowParent),p=So(Uv,_.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(f,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Dn.removeThrottle(this.browserStorage,this.config.auth.clientId,s),p.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),l&&l.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw te(Es);const m=new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,p.accountId,this.nativeStorage,o.correlationId),{userRequestState:C}=gn.parseRequestState(this.browserCrypto,o.state);return await m.acquireToken({...o,state:C,prompt:void 0})}return await d.handleCodeResponse(p,o)}catch(s){throw(i=n.popup)==null||i.close(),s instanceof We&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),s}}async logoutPopupAsync(e,n,r,o){var s,a,c,l;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(me.LOGOUT_START,ce.Popup,e);const i=this.initializeServerTelemetryManager(ze.logoutPopup);try{await this.clearCacheOnLogout(e.account);const u=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:r,account:e.account||void 0});try{u.authority.endSessionEndpoint}catch{if((s=e.account)!=null&&s.homeAccountId&&e.postLogoutRedirectUri&&u.authority.protocolMode===lr.OIDC){if(this.browserStorage.removeAccount((a=e.account)==null?void 0:a.homeAccountId,this.correlationId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,ce.Popup,e),o){const f={apiId:ze.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},p=Oe.getAbsoluteUrl(o,ar());await this.navigationClient.navigateInternal(p,f)}(c=n.popup)==null||c.close();return}}const d=u.getLogoutUri(e);this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,ce.Popup,e);const h=this.openPopup(d,n);if(this.eventHandler.emitEvent(me.POPUP_OPENED,ce.Popup,{popupWindow:h},null),await this.monitorPopupForHash(h,n.popupWindowParent).catch(()=>{}),o){const f={apiId:ze.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},p=Oe.getAbsoluteUrl(o,ar());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${p}`),await this.navigationClient.navigateInternal(p,f)}else this.logger.verbose("No main window navigation requested")}catch(u){throw(l=n.popup)==null||l.close(),u instanceof We&&(u.setCorrelationId(this.correlationId),i.cacheFailedRequest(u)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,ce.Popup,null,u),this.eventHandler.emitEvent(me.LOGOUT_END,ce.Popup),u}this.eventHandler.emitEvent(me.LOGOUT_END,ce.Popup)}initiateAuthRequest(e,n){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,n);throw this.logger.error("Navigate url is empty"),te(yc)}monitorPopupForHash(e,n){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const i=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(i),o(te(Ao));return}let s="";try{s=e.location.href}catch{}if(!s||s==="about:blank")return;clearInterval(i);let a="";const c=this.config.auth.OIDCOptions.serverResponseType;e&&(c===Ts.QUERY?a=e.location.search:a=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(a)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,n)})}openPopup(e,n){try{let r;if(n.popup?(r=n.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof n.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,n)),!r)throw te(tv);return r.focus&&r.focus(),this.currentWindow=r,n.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),this.browserStorage.setInteractionInProgress(!1),te(ev)}}openSizedPopup(e,{popupName:n,popupWindowAttributes:r,popupWindowParent:o}){var f,p,g,m;const i=o.screenLeft?o.screenLeft:o.screenX,s=o.screenTop?o.screenTop:o.screenY,a=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let l=(f=r.popupSize)==null?void 0:f.width,u=(p=r.popupSize)==null?void 0:p.height,d=(g=r.popupPosition)==null?void 0:g.top,h=(m=r.popupPosition)==null?void 0:m.left;return(!l||l<0||l>a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),l=Qt.POPUP_WIDTH),(!u||u<0||u>c)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),u=Qt.POPUP_HEIGHT),(!d||d<0||d>c)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),d=Math.max(0,c/2-Qt.POPUP_HEIGHT/2+s)),(!h||h<0||h>a)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),h=Math.max(0,a/2-Qt.POPUP_WIDTH/2+i)),o.open(e,n,`width=${l}, height=${u}, top=${d}, left=${h}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(ce.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,n){e.close(),n.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,n){return`${Qt.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${n}.${this.correlationId}`}generateLogoutPopupName(e){const n=e.account&&e.account.homeAccountId;return`${Qt.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${n}.${this.correlationId}`}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class ep{constructor(e,n,r,o,i){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async initiateAuthRequest(e,n){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){n.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Be.ORIGIN_URI,n.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Be.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:ze.acquireTokenRedirect,timeout:n.redirectTimeout,noHistory:!1};if(typeof n.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),n.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await n.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await n.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),te(yc)}async handleCodeResponse(e,n){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(n),o=this.browserStorage.getTemporaryCache(r);if(!o)throw j(ga,"Cached State");let i;try{i=this.authModule.handleFragmentResponse(e,o)}catch(l){throw l instanceof qr&&l.subError===Ao?te(Ao):l}const s=this.browserStorage.generateNonceKey(o),a=this.browserStorage.getTemporaryCache(s);if(this.authCodeRequest.code=i.code,i.cloud_instance_host_name&&await G(this.authModule.updateAuthority.bind(this.authModule),_.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(i.cloud_instance_host_name,this.authCodeRequest.correlationId),i.nonce=a||void 0,i.state=o,i.client_info)this.authCodeRequest.clientInfo=i.client_info;else{const l=this.checkCcsCredentials();l&&(this.authCodeRequest.ccsCredential=l)}const c=await this.authModule.acquireToken(this.authCodeRequest,i);return this.browserStorage.cleanRequestByState(n),c}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(Be.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function OP(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const t=window.performance.getEntriesByType("navigation"),e=t.length?t[0]:void 0;return e==null?void 0:e.type}class kP extends vi{constructor(e,n,r,o,i,s,a,c,l,u){super(e,n,r,o,i,s,a,l,u),this.nativeStorage=c}async acquireToken(e){const n=await G(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,ce.Redirect);this.browserStorage.updateCacheEntries(n.state,n.nonce,n.authority,n.loginHint||"",n.account||null);const r=this.initializeServerTelemetryManager(ze.acquireTokenRedirect),o=i=>{i.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(n.state),this.eventHandler.emitEvent(me.RESTORE_FROM_BFCACHE,ce.Redirect))};try{const i=await G(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(n),s=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),a=new ep(s,this.browserStorage,i,this.logger,this.performanceClient),c=await s.getAuthCodeUrl({...n,nativeBroker:Hn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),l=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${l}`),window.addEventListener("pageshow",o),await a.initiateAuthRequest(c,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:l,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(i){throw i instanceof We&&(i.setCorrelationId(this.correlationId),r.cacheFailedRequest(i)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(n.state),i}}async handleRedirectPromise(e="",n){const r=this.initializeServerTelemetryManager(ze.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[o,i]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(ce.Redirect),OP()!=="back_forward"?n.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const s=this.browserStorage.getTemporaryCache(Be.ORIGIN_URI,!0)||P.EMPTY_STRING,a=Oe.removeHashFromUrl(s),c=Oe.removeHashFromUrl(window.location.href);if(a===c&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),s.indexOf("#")>-1&&Uk(s),await this.handleResponse(o,r);if(this.config.auth.navigateToLoginRequestUrl){if(!Td()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Be.URL_HASH,i,!0);const l={apiId:ze.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let u=!0;if(!s||s==="null"){const d=Bk();this.browserStorage.setTemporaryCache(Be.ORIGIN_URI,d,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),u=await this.navigationClient.navigateInternal(d,l)}else this.logger.verbose(`Navigating to loginRequestUrl: ${s}`),u=await this.navigationClient.navigateInternal(s,l);if(!u)return await this.handleResponse(o,r)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,r);return null}catch(o){throw o instanceof We&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.browserStorage.cleanRequestByInteractionType(ce.Redirect),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let n=e;n||(this.config.auth.OIDCOptions.serverResponseType===Ts.QUERY?n=window.location.search:n=window.location.hash);let r=Ca(n);if(r){try{IP(r,this.browserCrypto,ce.Redirect)}catch(i){return i instanceof We&&this.logger.error(`Interaction type validation failed due to ${i.errorCode}: ${i.errorMessage}`),[null,""]}return Lk(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,n]}const o=this.browserStorage.getTemporaryCache(Be.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Be.URL_HASH)),o&&(r=Ca(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,n){const r=e.state;if(!r)throw te(fd);const o=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw te(Es);const c=new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,o.correlationId),{userRequestState:l}=gn.parseRequestState(this.browserCrypto,r);return c.acquireToken({...o,state:l,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(r)})}const i=this.browserStorage.getCachedAuthority(r);if(!i)throw te(pd);const s=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:i});return Dn.removeThrottle(this.browserStorage,this.config.auth.clientId,o),new ep(s,this.browserStorage,o,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){var o,i;this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(ze.logout);try{this.eventHandler.emitEvent(me.LOGOUT_START,ce.Redirect,e),await this.clearCacheOnLogout(n.account);const s={apiId:ze.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(a.authority.protocolMode===lr.OIDC)try{a.authority.endSessionEndpoint}catch{if((o=n.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((i=n.account)==null?void 0:i.homeAccountId,this.correlationId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,ce.Redirect,n);return}}const c=a.getLogoutUri(n);if(this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,ce.Redirect,n),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(c)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}}catch(s){throw s instanceof We&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,ce.Redirect,null,s),this.eventHandler.emitEvent(me.LOGOUT_END,ce.Redirect),s}this.eventHandler.emitEvent(me.LOGOUT_END,ce.Redirect)}getRedirectStartPage(e){const n=e||window.location.href;return Oe.getAbsoluteUrl(n,ar())}}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function PP(t,e,n,r,o){if(e.addQueueMeasurement(_.SilentHandlerInitiateAuthRequest,r),!t)throw n.info("Navigate url is empty"),te(yc);return o?G(xP,_.SilentHandlerLoadFrame,n,e,r)(t,o,e,r):So(MP,_.SilentHandlerLoadFrameSync,n,e,r)(t)}async function NP(t,e,n,r,o,i,s){return r.addQueueMeasurement(_.SilentHandlerMonitorIframeForHash,i),new Promise((a,c)=>{e{window.clearInterval(u),c(te(nv))},e),u=window.setInterval(()=>{let d="";const h=t.contentWindow;try{d=h?h.location.href:""}catch{}if(!d||d==="about:blank")return;let f="";h&&(s===Ts.QUERY?f=h.location.search:f=h.location.hash),window.clearTimeout(l),window.clearInterval(u),a(f)},n)}).finally(()=>{So(DP,_.RemoveHiddenIframe,o,r,i)(t)})}function xP(t,e,n,r){return n.addQueueMeasurement(_.SilentHandlerLoadFrame,r),new Promise((o,i)=>{const s=Hv();window.setTimeout(()=>{if(!s){i("Unable to load iframe");return}s.src=t,o(s)},e)})}function MP(t){const e=Hv();return e.src=t,e}function Hv(){const t=document.createElement("iframe");return t.className="msalSilentIframe",t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(t),t}function DP(t){document.body===t.parentNode&&document.body.removeChild(t)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class LP extends vi{constructor(e,n,r,o,i,s,a,c,l,u,d){super(e,n,r,o,i,s,c,u,d),this.apiId=a,this.nativeStorage=l}async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const n={...e};n.prompt?n.prompt!==gt.NONE&&n.prompt!==gt.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${n.prompt} with ${gt.NONE}`),n.prompt=gt.NONE):n.prompt=gt.NONE;const r=await G(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(n,ce.Silent);Nv(r.authority);const o=this.initializeServerTelemetryManager(this.apiId);let i;try{return i=await G(this.createAuthCodeClient.bind(this),_.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await G(this.silentTokenHelper.bind(this),_.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(i,r)}catch(s){if(s instanceof We&&(s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s)),!i||!(s instanceof We)||s.errorCode!==Qt.INVALID_GRANT_ERROR)throw s;this.performanceClient.addFields({retryError:s.errorCode},this.correlationId);const a=await G(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(n,ce.Silent);return await G(this.silentTokenHelper.bind(this),_.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(i,a)}}logout(){return Promise.reject(te(vc))}async silentTokenHelper(e,n){const r=n.correlationId;this.performanceClient.addQueueMeasurement(_.SilentIframeClientTokenHelper,r);const o=await G(this.initializeAuthorizationCodeRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(n),i=await G(e.getAuthCodeUrl.bind(e),_.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...n,nativeBroker:Hn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,n.authenticationScheme)}),s=new Sd(e,this.browserStorage,o,this.logger,this.performanceClient),a=await G(PP,_.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(i,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),c=this.config.auth.OIDCOptions.serverResponseType,l=await G(NP,_.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,c),u=So(Uv,_.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(l,c,this.logger);if(u.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw te(Es);const d=new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,u.accountId,this.browserStorage,r),{userRequestState:h}=gn.parseRequestState(this.browserCrypto,n.state);return G(d.acquireToken.bind(d),_.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...n,state:h,prompt:n.prompt||gt.NONE})}return G(s.handleCodeResponse.bind(s),_.HandleCodeResponse,this.logger,this.performanceClient,r)(u,n)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class UP extends vi{async acquireToken(e){this.performanceClient.addQueueMeasurement(_.SilentRefreshClientAcquireToken,e.correlationId);const n=await G(_d,_.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...n};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(ze.acquireTokenSilent_silentFlow),i=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return G(i.acquireTokenByRefreshToken.bind(i),_.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(s=>{throw s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s),s})}logout(){return Promise.reject(te(vc))}async createRefreshTokenClient(e){const n=await G(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Wl(n,this.performanceClient)}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class HP{constructor(e,n,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=n,this.logger=r,this.cryptoObj=o}loadExternalTokens(e,n,r){if(!this.isBrowserEnvironment)throw te(Cc);const o=e.correlationId||jn(),i=n.id_token?_o(n.id_token,$n):void 0,s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.authority?new _t(_t.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||jn()):void 0,c=this.loadAccount(e,r.clientInfo||n.client_info||"",o,i,a),l=this.loadIdToken(n,c.homeAccountId,c.environment,c.realm,o),u=this.loadAccessToken(e,n,c.homeAccountId,c.environment,c.realm,r,o),d=this.loadRefreshToken(n,c.homeAccountId,c.environment,o);return this.generateAuthenticationResult(e,{account:c,idToken:l,accessToken:u,refreshToken:d},i,a)}loadAccount(e,n,r,o,i){if(this.logger.verbose("TokenCache - loading account"),e.account){const l=dt.createFromAccountInfo(e.account);return this.storage.setAccount(l,r),l}else if(!i||!n&&!o)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),te(dv);const s=dt.generateHomeAccountId(n,i.authorityType,this.logger,this.cryptoObj,o),a=o==null?void 0:o.tid,c=ld(this.storage,i,s,$n,r,o,n,i.hostnameAndPort,a,void 0,void 0,this.logger);return this.storage.setAccount(c,r),c}loadIdToken(e,n,r,o,i){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=dc(n,r,e.id_token,this.config.auth.clientId,o);return this.storage.setIdTokenCredential(s,i),s}loadAccessToken(e,n,r,o,i,s,a){if(n.access_token)if(n.expires_in){if(!n.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const c=n.scope?rt.fromString(n.scope):new rt(e.scopes),l=s.expiresOn||n.expires_in+new Date().getTime()/1e3,u=s.extendedExpiresOn||(n.ext_expires_in||n.expires_in)+new Date().getTime()/1e3,d=hc(r,o,n.access_token,this.config.auth.clientId,i,c.printScopes(),l,u,$n);return this.storage.setAccessTokenCredential(d,a),d}loadRefreshToken(e,n,r,o){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const i=Cy(n,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(i,o),i}generateAuthenticationResult(e,n,r,o){var u,d,h;let i="",s=[],a=null,c;n!=null&&n.accessToken&&(i=n.accessToken.secret,s=rt.fromString(n.accessToken.target).asArray(),a=new Date(Number(n.accessToken.expiresOn)*1e3),c=new Date(Number(n.accessToken.extendedExpiresOn)*1e3));const l=n.account;return{authority:o?o.canonicalAuthority:"",uniqueId:n.account.localAccountId,tenantId:n.account.realm,scopes:s,account:l.getAccountInfo(),idToken:((u=n.idToken)==null?void 0:u.secret)||"",idTokenClaims:r||{},accessToken:i,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:c,familyId:((d=n.refreshToken)==null?void 0:d.familyId)||"",tokenType:((h=n==null?void 0:n.accessToken)==null?void 0:h.tokenType)||"",state:e.state||"",cloudGraphHostName:l.cloudGraphHostName||"",msGraphHost:l.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class BP extends Vy{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.30.0 2025-08-05 */class FP extends vi{constructor(e,n,r,o,i,s,a,c,l,u){super(e,n,r,o,i,s,c,l,u),this.apiId=a}async acquireToken(e){if(!e.code)throw te(hv);const n=await G(this.initializeAuthorizationRequest.bind(this),_.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,ce.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...n,code:e.code},i=await G(this.getClientConfiguration.bind(this),_.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),s=new BP(i);this.logger.verbose("Auth code client created");const a=new Sd(s,this.browserStorage,o,this.logger,this.performanceClient);return await G(a.handleCodeResponseFromServer.bind(a),_.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},n,!1)}catch(o){throw o instanceof We&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(te(vc))}}/*! @azure/msal-browser v3.30.0 2025-08-05 */function Sn(t){const e=t==null?void 0:t.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function js(t,e){try{Ed(t)}catch(n){throw e.end({success:!1},n),n}}class Ac{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new pi(this.logger,this.performanceClient):ma,this.eventHandler=new hP(this.logger),this.browserStorage=this.isBrowserEnvironment?new eu(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,XO(this.config.auth),this.performanceClient):oP(this.config.auth.clientId,this.logger);const n={cacheLocation:Bt.MemoryStorage,temporaryCacheLocation:Bt.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new eu(this.config.auth.clientId,n,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new HP(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,n){const r=new Ac(e);return await r.initialize(n),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END);return}const n=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,o=this.performanceClient.startMeasurement(_.InitializeClientApplication,n);if(this.eventHandler.emitEvent(me.INITIALIZE_START),r)try{this.nativeExtensionProvider=await Hn.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(i){this.logger.verbose(i)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await G(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),_.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,n)(this.performanceClient,n)),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END),o.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),Pv(this.initialized),this.isBrowserEnvironment){const n=e||"";let r=this.redirectResponse.get(n);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(n,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const n=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&Hn.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,i=o?r==null?void 0:r.correlationId:this.browserStorage.getTemporaryCache(Be.CORRELATION_ID,!0)||"",s=this.performanceClient.startMeasurement(_.AcquireTokenRedirect,i);this.eventHandler.emitEvent(me.HANDLE_REDIRECT_START,ce.Redirect);let a;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const c=new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);a=G(c.handleRedirectPromise.bind(c),_.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(this.performanceClient,s.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const c=this.createRedirectClient(i);a=G(c.handleRedirectPromise.bind(c),_.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(e,s)}return a.then(c=>(c?(n.length{const l=c;throw n.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,ce.Redirect,null,l):this.eventHandler.emitEvent(me.LOGIN_FAILURE,ce.Redirect,null,l),this.eventHandler.emitEvent(me.HANDLE_REDIRECT_END,ce.Redirect),s.end({success:!1},l),c})}async acquireTokenRedirect(e){const n=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",n);const r=this.performanceClient.startMeasurement(_.AcquireTokenPreRedirect,n);r.add({accountType:Sn(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=s=>{const a=typeof o=="function"?o(s):void 0;return a!==!1?r.end({success:!0}):r.discard(),a};else{const s=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=a=>{const c=typeof s=="function"?s(a):void 0;return c!==!1?r.end({success:!0}):r.discard(),c}}const i=this.getAllAccounts().length>0;try{Yf(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),i?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,ce.Redirect,e):this.eventHandler.emitEvent(me.LOGIN_START,ce.Redirect,e);let s;return this.nativeExtensionProvider&&this.canUseNative(e)?s=new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,n).acquireTokenRedirect(e,r).catch(c=>{if(c instanceof Ln&&Ho(c))return this.nativeExtensionProvider=void 0,this.createRedirectClient(n).acquireToken(e);if(c instanceof En)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(n).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),c}):s=this.createRedirectClient(n).acquireToken(e),await s}catch(s){throw r.end({success:!1},s),i?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,ce.Redirect,null,s):this.eventHandler.emitEvent(me.LOGIN_FAILURE,ce.Redirect,null,s),s}}acquireTokenPopup(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(_.AcquireTokenPopup,n);r.add({scenarioId:e.scenarioId,accountType:Sn(e.account)});try{this.logger.verbose("acquireTokenPopup called",n),js(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(s){return Promise.reject(s)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,ce.Popup,e):this.eventHandler.emitEvent(me.LOGIN_START,ce.Popup,e);let i;return this.canUseNative(e)?i=this.acquireTokenNative({...e,correlationId:n},ze.acquireTokenPopup).then(s=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,accountType:Sn(s.account)}),s)).catch(s=>{if(s instanceof Ln&&Ho(s))return this.nativeExtensionProvider=void 0,this.createPopupClient(n).acquireToken(e);if(s instanceof En)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(n).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),s}):i=this.createPopupClient(n).acquireToken(e),i.then(s=>(o.length(o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,ce.Popup,null,s):this.eventHandler.emitEvent(me.LOGIN_FAILURE,ce.Popup,null,s),r.end({success:!1},s),Promise.reject(s)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var i,s;const n=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:n};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(_.SsoSilent,n),(i=this.ssoSilentMeasurement)==null||i.add({scenarioId:e.scenarioId,accountType:Sn(e.account)}),js(this.initialized,this.ssoSilentMeasurement),(s=this.ssoSilentMeasurement)==null||s.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",n),this.eventHandler.emitEvent(me.SSO_SILENT_START,ce.Silent,r);let o;return this.canUseNative(r)?o=this.acquireTokenNative(r,ze.ssoSilent).catch(a=>{if(a instanceof Ln&&Ho(a))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw a}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(a=>{var c;return this.eventHandler.emitEvent(me.SSO_SILENT_SUCCESS,ce.Silent,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!0,isNativeBroker:a.fromNativeBroker,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length,accountType:Sn(a.account)}),a}).catch(a=>{var c;throw this.eventHandler.emitEvent(me.SSO_SILENT_FAILURE,ce.Silent,null,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const n=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",n);const r=this.performanceClient.startMeasurement(_.AcquireTokenByCode,n);js(this.initialized,r),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_START,ce.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw te(pv);if(e.code){const o=e.code;let i=this.hybridAuthCodeResponses.get(o);return i?(this.logger.verbose("Existing acquireTokenByCode request found",n),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",n),i=this.acquireTokenByCodeAsync({...e,correlationId:n}).then(s=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_SUCCESS,ce.Silent,s),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:s.fromNativeBroker,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length,accountType:Sn(s.account)}),s)).catch(s=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,ce.Silent,null,s),r.end({success:!1},s),s}),this.hybridAuthCodeResponses.set(o,i)),await i}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:n},ze.acquireTokenByCode,e.nativeAccountId).catch(i=>{throw i instanceof Ln&&Ho(i)&&(this.nativeExtensionProvider=void 0),i});return r.end({accountType:Sn(o.account),success:!0}),o}else throw te(gv);else throw te(fv)}catch(o){throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,ce.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(_.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(i=>{var s;return(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!0,fromCache:i.fromCache,isNativeBroker:i.fromNativeBroker}),i}).catch(i=>{var s;throw(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!1},i),i}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,n){switch(this.performanceClient.addQueueMeasurement(_.AcquireTokenFromCache,e.correlationId),n){case jt.Default:case jt.AccessToken:case jt.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return G(r.acquireToken.bind(r),_.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw j(sr)}}async acquireTokenByRefreshToken(e,n){switch(this.performanceClient.addQueueMeasurement(_.AcquireTokenByRefreshToken,e.correlationId),n){case jt.Default:case jt.AccessTokenAndRefreshToken:case jt.RefreshToken:case jt.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return G(r.acquireToken.bind(r),_.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw j(sr)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(_.AcquireTokenBySilentIframe,e.correlationId);const n=this.createSilentIframeClient(e.correlationId);return G(n.acquireToken.bind(n),_.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const n=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",n),this.logoutRedirect({correlationId:n,...e})}async logoutRedirect(e){const n=this.getRequestCorrelationId(e);return Yf(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(n).logout(e)}logoutPopup(e){try{const n=this.getRequestCorrelationId(e);return Ed(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(n).logout(e)}catch(n){return Promise.reject(n)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const n=this.getRequestCorrelationId(e);return this.createSilentCacheClient(n).logout(e)}getAllAccounts(e){const n=this.getRequestCorrelationId();return iP(this.logger,this.browserStorage,this.isBrowserEnvironment,n,e)}getAccount(e){const n=this.getRequestCorrelationId();return sP(e,this.logger,this.browserStorage,n)}getAccountByUsername(e){const n=this.getRequestCorrelationId();return aP(e,this.logger,this.browserStorage,n)}getAccountByHomeId(e){const n=this.getRequestCorrelationId();return cP(e,this.logger,this.browserStorage,n)}getAccountByLocalId(e){const n=this.getRequestCorrelationId();return lP(e,this.logger,this.browserStorage,n)}setActiveAccount(e){const n=this.getRequestCorrelationId();uP(e,this.browserStorage,n)}getActiveAccount(){const e=this.getRequestCorrelationId();return dP(this.browserStorage,e)}async hydrateCache(e,n){this.logger.verbose("hydrateCache called");const r=dt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r,e.correlationId),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,n)):this.browserStorage.hydrateCache(e,n)}async acquireTokenNative(e,n,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw te(Es);return new Qo(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,n,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,n){if(this.logger.trace("canUseNative called"),!Hn.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case gt.NONE:case gt.CONSENT:case gt.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!n&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const n=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return n&&n.nativeAccountId||""}createPopupClient(e){return new RP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new kP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new LP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new Lv(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new UP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new FP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ze.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,n){return this.eventHandler.addEventCallback(e,n)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return kv(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){var n;try{(n=e.key)!=null&&n.includes(ft.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(me.ACTIVE_ACCOUNT_CHANGED);const r=e.newValue||e.oldValue;if(!r)return;const o=JSON.parse(r);if(typeof o!="object"||!dt.isAccountEntity(o))return;const s=di.toObject(new dt,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_ADDED,void 0,s)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_REMOVED,void 0,s))}catch{return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,n){this.browserStorage.setWrapperMetadata(e,n)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?jn():P.EMPTY_STRING}async loginRedirect(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",n),this.acquireTokenRedirect({correlationId:n,...e||zf})}loginPopup(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",n),this.acquireTokenPopup({correlationId:n,...e||zf})}async acquireTokenSilent(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(_.AcquireTokenSilent,n);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),js(this.initialized,r),this.logger.verbose("acquireTokenSilent called",n);const o=e.account||this.getActiveAccount();if(!o)throw te(sv);r.add({accountType:Sn(o)});const i={clientId:this.config.auth.clientId,authority:e.authority||P.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},s=JSON.stringify(i),a=this.activeSilentTokenRequests.get(s);if(typeof a>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",n);const c=G(this.acquireTokenSilentAsync.bind(this),_.AcquireTokenSilentAsync,this.logger,this.performanceClient,n)({...e,correlationId:n},o).then(l=>(this.activeSilentTokenRequests.delete(s),r.end({success:!0,fromCache:l.fromCache,isNativeBroker:l.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length}),l)).catch(l=>{throw this.activeSilentTokenRequests.delete(s),r.end({success:!1},l),l});return this.activeSilentTokenRequests.set(s,c),{...await c,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",n),r.discard(),{...await a,state:e.state}}async acquireTokenSilentAsync(e,n){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(_.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,ce.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await G(yP,_.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,n,this.config,this.performanceClient,this.logger),i=e.cacheLookupPolicy||jt.Default;return this.acquireTokenSilentNoIframe(o,i).catch(async a=>{if(KP(a,i))if(this.activeIframeRequest)if(i!==jt.Skip){const[l,u]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${u}`,o.correlationId);const d=this.performanceClient.startMeasurement(_.AwaitConcurrentIframe,o.correlationId);d.add({awaitIframeCorrelationId:u});const h=await l;if(d.end({success:h}),h)return this.logger.verbose(`Parallel iframe request with correlationId: ${u} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,i);throw this.logger.info(`Iframe request with correlationId: ${u} failed. Interaction is required.`),a}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),G(this.acquireTokenBySilentIframe.bind(this),_.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let l;return this.activeIframeRequest=[new Promise(u=>{l=u}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),G(this.acquireTokenBySilentIframe.bind(this),_.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(u=>(l(!0),u)).catch(u=>{throw l(!1),u}).finally(()=>{this.activeIframeRequest=void 0})}else throw a}).then(a=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,ce.Silent,a),e.correlationId&&this.performanceClient.addFields({fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker},e.correlationId),a)).catch(a=>{throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,ce.Silent,null,a),a}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,n){return Hn.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,ze.acquireTokenSilent_silentFlow).catch(async r=>{throw r instanceof Ln&&Ho(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,j(sr)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),G(this.acquireTokenFromCache.bind(this),_.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,n).catch(r=>{if(n===jt.AccessToken)throw r;return this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_NETWORK_START,ce.Silent,e),G(this.acquireTokenByRefreshToken.bind(this),_.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,n)}))}}function KP(t,e){const n=!(t instanceof En&&t.subError!==mc),r=t.errorCode===Qt.INVALID_GRANT_ERROR||t.errorCode===sr,o=n&&r||t.errorCode===Aa||t.errorCode===cd,i=Tk.includes(e);return o&&i}/*! @azure/msal-browser v3.30.0 2025-08-05 */async function $P(t,e){const n=new To(t);return await n.initialize(),Ac.createController(n,e)}/*! @azure/msal-browser v3.30.0 2025-08-05 */class Id{static async createPublicClientApplication(e){const n=await $P(e);return new Id(e,n)}constructor(e,n){this.controller=n||new Ac(new To(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,n){return this.controller.addEventCallback(e,n)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,n){return this.controller.initializeWrapperLibrary(e,n)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,n){return this.controller.hydrateCache(e,n)}clearCache(e){return this.controller.clearCache(e)}}const ba=new Id({auth:{clientId:"9079054c-9620-4757-a256-23413042f1ef",authority:"https://login.microsoftonline.com/e519c2e6-bc6d-4fdf-8d9c-923c2f002385",redirectUri:"https://optical-dev.oliver.solutions/cc-dashboard/"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1}}),qP=["openid","profile","email"];async function jP(){await ba.initialize(),await ba.handleRedirectPromise()}const Bv=RA("auth",()=>{const t=J(null),e=J(null),n=J(!1),r=J(null),o=Q(()=>t.value!==null),i=Q(()=>{var h;return((h=e.value)==null?void 0:h.role)==="admin"});async function s(){try{const h=await ir.post("/api/auth/refresh");t.value=h.data.access_token,await u()}catch{}}function a(h){t.value=h}async function c(){var h,f;n.value=!0,r.value=null;try{const g=(await ba.loginPopup({scopes:qP})).idToken,m=await ir.post("/api/auth/microsoft",{id_token:g});t.value=m.data.access_token,await u()}catch(p){const g=p;throw r.value=((f=(h=g.response)==null?void 0:h.data)==null?void 0:f.detail)??g.message??"Login failed",p}finally{n.value=!1}}async function l(){try{await ir.post("/api/auth/logout")}catch{}t.value=null,e.value=null;try{await ba.clearCache()}catch{}}async function u(){const h=await ir.get("/api/auth/me");e.value=h.data}function d(){return t.value}return{token:t,user:e,loading:n,error:r,isAuthenticated:o,isAdmin:i,init:s,setToken:a,loginWithMicrosoft:c,logout:l,fetchMe:u,getToken:d}}),VP=[{path:"/login",name:"login",component:()=>Ht(()=>import("./LoginView-8WQzarqw.js"),__vite__mapDeps([0,1,2])),meta:{public:!0}},{path:"/",component:()=>Ht(()=>import("./AppLayout-Dm7xvIFg.js"),[]),children:[{path:"",name:"dashboard",component:()=>Ht(()=>import("./DashboardView-BXyr7l4W.js"),__vite__mapDeps([3,4,1,2,5,6,7,8,9,10,11,12,13,14]))},{path:"calendar",name:"calendar",component:()=>Ht(()=>import("./CalendarView-CaW5n3jj.js"),__vite__mapDeps([15,4,2,6,7,16,17,9,13,18,19,20,21,22,23,14,24,25,26]))},{path:"tasks",name:"tasks",component:()=>Ht(()=>import("./TasksView-CS-ndHtq.js"),__vite__mapDeps([27,13,20,21,6,7,2,22,23,14,24,12,28]))},{path:"omg",name:"omg",component:()=>Ht(()=>import("./OmgView-BhU31iOQ.js"),__vite__mapDeps([29,24,21,6,7,2,22,23,25,9,12,28,30,31]))},{path:"projects",name:"projects",component:()=>Ht(()=>import("./ProjectsView-BFbSEcZ2.js"),__vite__mapDeps([32,4,1,2,7,16,28,6,33,22,11,9,34]))},{path:"projects/:id/:date?",name:"project-detail",component:()=>Ht(()=>import("./ProjectDetailView-4KJdgDVR.js"),__vite__mapDeps([35,4,1,2,5,8,22,6,7,28,12,30,9,10]))},{path:"live",name:"live",component:()=>Ht(()=>import("./LiveView-CtRvAfQD.js"),__vite__mapDeps([36,1,2,6,7,8,28,9,34]))},{path:"reports",name:"reports",component:()=>Ht(()=>import("./ReportsView-Br61zuWE.js"),__vite__mapDeps([37,1,2,19,6,7,16,28,30,9,38,18,39]))},{path:"keys",name:"keys",component:()=>Ht(()=>import("./KeysView-BbrvrPgK.js"),__vite__mapDeps([40,41,1,2,6,7,21,22,25,9,28,31]))},{path:"devops",name:"devops",component:()=>Ht(()=>import("./DevopsView-CyGHofcw.js"),__vite__mapDeps([42,14,24,1,2,5,6,7,33,22,28,16,12,43,25,9]))},{path:"settings",name:"settings",component:()=>Ht(()=>import("./SettingsView-BQsCH9JJ.js"),__vite__mapDeps([44,14,1,2,5,22,6,7,17,9,38,43,25]))},{path:"admin",name:"admin",component:()=>Ht(()=>import("./AdminView-Dp6LfsVH.js"),__vite__mapDeps([45,41,1,2,19,7])),meta:{adminOnly:!0}}]},{path:"/:pathMatch(.*)*",redirect:"/"}],nu=OS({history:aS("/cc-dashboard/"),routes:VP});nu.beforeEach((t,e,n)=>{const r=Bv();if(t.meta.public){r.isAuthenticated?n({name:"dashboard"}):n();return}if(!r.isAuthenticated){n({name:"login",query:{redirect:t.fullPath}});return}if(t.meta.adminOnly&&!r.isAdmin){n({name:"dashboard"});return}n()});jP().then(async()=>{const t=CA(A_),e=TA();t.use(e),t.use(nu),t.use(lT);const n=Bv();yR(()=>n.getToken(),()=>{n.logout(),nu.push({name:"login"})},r=>n.setToken(r)),await n.init(),t.mount("#app")});export{a0 as $,vn as A,RA as B,Yi as C,ir as D,nn as E,nt as F,JP as G,zP as H,YP as I,Eo as J,t0 as K,FC as L,bC as M,m0 as N,v0 as O,h0 as P,f0 as Q,bS as R,p0 as S,QP as T,y0 as U,d0 as V,g0 as W,n0 as X,i0 as Y,o0 as Z,Ht as _,Cn as a,c0 as a0,s0 as a1,l0 as a2,r0 as a3,po as a4,WP as b,Xe as c,ye as d,Pe as e,C0 as f,w0 as g,I as h,er as i,Q as j,pe as k,eo as l,Ke as m,Gt as n,Y as o,le as p,oa as q,cl as r,J as s,Bo as t,Bv as u,ew as v,se as w,ut as x,ja as y,Fn as z}; diff --git a/src/static/assets/plus-8OWFLnn5.js b/src/static/assets/plus-C-ov7K0l.js similarity index 83% rename from src/static/assets/plus-8OWFLnn5.js rename to src/static/assets/plus-C-ov7K0l.js index 100d572..817f66d 100644 --- a/src/static/assets/plus-8OWFLnn5.js +++ b/src/static/assets/plus-C-ov7K0l.js @@ -1,4 +1,4 @@ -import{c as e}from"./createLucideIcon-BQqEiwZb.js";/** +import{c as e}from"./createLucideIcon-CglWgwD8.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/assets/projects-Bt6sxsgH.js b/src/static/assets/projects-Bt6sxsgH.js new file mode 100644 index 0000000..64eee85 --- /dev/null +++ b/src/static/assets/projects-Bt6sxsgH.js @@ -0,0 +1 @@ +import{D as p}from"./index-Dj4QxrF8.js";const i={list:()=>p.get("/api/projects")};export{i as p}; diff --git a/src/static/assets/projects-COzvhtq2.js b/src/static/assets/projects-COzvhtq2.js deleted file mode 100644 index 9bf8354..0000000 --- a/src/static/assets/projects-COzvhtq2.js +++ /dev/null @@ -1 +0,0 @@ -import{D as p}from"./index-rN5A-UTe.js";const i={list:()=>p.get("/api/projects")};export{i as p}; diff --git a/src/static/assets/tasks-PDTqLr3E.js b/src/static/assets/tasks-Dt_weT6j.js similarity index 96% rename from src/static/assets/tasks-PDTqLr3E.js rename to src/static/assets/tasks-Dt_weT6j.js index beb9d81..84240e9 100644 --- a/src/static/assets/tasks-PDTqLr3E.js +++ b/src/static/assets/tasks-Dt_weT6j.js @@ -1 +1 @@ -import{D as l,B as h,s as i}from"./index-rN5A-UTe.js";const o={list:a=>l.get("/api/tasks",{params:a}),get:a=>l.get(`/api/tasks/${a}`),create:a=>l.post("/api/tasks",a),update:(a,s)=>l.patch(`/api/tasks/${a}`,s),remove:a=>l.delete(`/api/tasks/${a}`),complete:a=>l.post(`/api/tasks/${a}/complete`),blocks:a=>l.get(`/api/tasks/${a}/blocks`),createBlock:(a,s)=>l.post(`/api/tasks/${a}/blocks`,s),updateBlock:(a,s)=>l.patch(`/api/tasks/blocks/${a}`,s),deleteBlock:a=>l.delete(`/api/tasks/blocks/${a}`)},b=Object.freeze(Object.defineProperty({__proto__:null,tasksApi:o},Symbol.toStringTag,{value:"Module"})),$=h("tasks",()=>{const a=i([]),s=i(!1),n=i(null);async function u(t){s.value=!0,n.value=null;try{const e=await o.list({date:t});a.value=e.data}catch(e){const c=e;n.value=c.message??"Failed to fetch tasks"}finally{s.value=!1}}async function d(t){s.value=!0,n.value=null;try{const e=await o.list(t?{project_id:t}:void 0);a.value=e.data}catch(e){const c=e;n.value=c.message??"Failed to fetch tasks"}finally{s.value=!1}}async function p(t){const e=await o.create(t);return a.value.push(e.data),e.data}async function k(t,e){const c=await o.update(t,e),r=a.value.findIndex(g=>g.id===t);return r!==-1&&(a.value[r]=c.data),c.data}async function f(t){await o.remove(t),a.value=a.value.filter(e=>e.id!==t)}async function v(t){const e=await o.complete(t),c=a.value.findIndex(r=>r.id===t);return c!==-1&&(a.value[c]=e.data),e.data}async function y(t,e){return(await o.createBlock(t,e)).data}async function m(t,e){return(await o.updateBlock(t,e)).data}async function B(t){await o.deleteBlock(t)}return{tasks:a,loading:s,error:n,fetchForDate:u,fetchAll:d,create:p,update:k,remove:f,complete:v,createBlock:y,updateBlock:m,deleteBlock:B}});export{b as t,$ as u}; +import{D as l,B as h,s as i}from"./index-Dj4QxrF8.js";const o={list:a=>l.get("/api/tasks",{params:a}),get:a=>l.get(`/api/tasks/${a}`),create:a=>l.post("/api/tasks",a),update:(a,s)=>l.patch(`/api/tasks/${a}`,s),remove:a=>l.delete(`/api/tasks/${a}`),complete:a=>l.post(`/api/tasks/${a}/complete`),blocks:a=>l.get(`/api/tasks/${a}/blocks`),createBlock:(a,s)=>l.post(`/api/tasks/${a}/blocks`,s),updateBlock:(a,s)=>l.patch(`/api/tasks/blocks/${a}`,s),deleteBlock:a=>l.delete(`/api/tasks/blocks/${a}`)},b=Object.freeze(Object.defineProperty({__proto__:null,tasksApi:o},Symbol.toStringTag,{value:"Module"})),$=h("tasks",()=>{const a=i([]),s=i(!1),n=i(null);async function u(t){s.value=!0,n.value=null;try{const e=await o.list({date:t});a.value=e.data}catch(e){const c=e;n.value=c.message??"Failed to fetch tasks"}finally{s.value=!1}}async function d(t){s.value=!0,n.value=null;try{const e=await o.list(t?{project_id:t}:void 0);a.value=e.data}catch(e){const c=e;n.value=c.message??"Failed to fetch tasks"}finally{s.value=!1}}async function p(t){const e=await o.create(t);return a.value.push(e.data),e.data}async function k(t,e){const c=await o.update(t,e),r=a.value.findIndex(g=>g.id===t);return r!==-1&&(a.value[r]=c.data),c.data}async function f(t){await o.remove(t),a.value=a.value.filter(e=>e.id!==t)}async function v(t){const e=await o.complete(t),c=a.value.findIndex(r=>r.id===t);return c!==-1&&(a.value[c]=e.data),e.data}async function y(t,e){return(await o.createBlock(t,e)).data}async function m(t,e){return(await o.updateBlock(t,e)).data}async function B(t){await o.deleteBlock(t)}return{tasks:a,loading:s,error:n,fetchForDate:u,fetchAll:d,create:p,update:k,remove:f,complete:v,createBlock:y,updateBlock:m,deleteBlock:B}});export{b as t,$ as u}; diff --git a/src/static/assets/zap-B0jfADxc.js b/src/static/assets/zap-Bmdr3aWk.js similarity index 87% rename from src/static/assets/zap-B0jfADxc.js rename to src/static/assets/zap-Bmdr3aWk.js index 81e8bb5..5bfa7c0 100644 --- a/src/static/assets/zap-B0jfADxc.js +++ b/src/static/assets/zap-Bmdr3aWk.js @@ -1,4 +1,4 @@ -import{c as a}from"./createLucideIcon-BQqEiwZb.js";/** +import{c as a}from"./createLucideIcon-CglWgwD8.js";/** * @license lucide-vue-next v0.427.0 - ISC * * This source code is licensed under the ISC license. diff --git a/src/static/index.html b/src/static/index.html index f4cb641..3a4ca8e 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -14,7 +14,7 @@ else { document.documentElement.classList.remove('dark'); } })(); - + diff --git a/web/src/router/index.ts b/web/src/router/index.ts index cf201c5..6c0e331 100644 --- a/web/src/router/index.ts +++ b/web/src/router/index.ts @@ -90,7 +90,12 @@ router.beforeEach((to, _from, next) => { const authStore = useAuthStore() if (to.meta.public) { - next() + // Already authenticated → skip login page, go to dashboard + if (authStore.isAuthenticated) { + next({ name: 'dashboard' }) + } else { + next() + } return }