1import{G as z,E as F,H as D,F as _,r as j,j as e,Q as N,U as b,af as ne,d6 as C,ci as le,I as A,dT as J,d3 as oe,d4 as ie,d5 as ce,aR as Se,q as y,v as R,am as O,ao as E,ap as M,ae as I,B as $,bU as ke,ar as de,aT as Te,aq as w,aW as q,aX as L,aY as G,aZ as K,a_ as P,be as Fe,bY as De,bu as ee,bf as _e,bg as Ae,bh as Pe,bi as Re,bj as Ee,L as Me,ak as Q,e as Ie,ag as me,aH as ue,cR as V,S as xe,bJ as he,g as se,eN as $e}from"./index-Vi894iiS.js";import{d as Oe,K as qe,G as Le}from"./kpi-CKXEwJwk.js";import{T as Y}from"./triangle-alert-B49_VHrA.js";import{D as pe}from"./dollar-sign-PM752SfX.js";import{N as ge}from"./newspaper-DKfztqB2.js";import{I as Ge}from"./info-Dvqg-Ol2.js";import{u as B,w as Ke}from"./xlsx-BZe_PqlR.js";import{R as Qe}from"./refresh-cw-C1MiC9IV.js";import{C as Be}from"./clock-CsFAFQsU.js";import{B as He}from"./briefcase-DxojHCu_.js";import{A as te}from"./arrow-right-C_3FNfjx.js";import{A as fe}from"./activity-CN7aO-Ep.js";import"./trending-up-CnunJaDf.js";import"./trending-down-DdoLS7Xl.js";const Ye=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Ue=z("list-todo",Ye);const ze=[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Je=z("ticket-check",ze);const Ve=[["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m14.305 16.53.923-.382",key:"1itpsq"}],["path",{d:"m15.228 13.852-.923-.383",key:"eplpkm"}],["path",{d:"m16.852 12.228-.383-.923",key:"13v3q0"}],["path",{d:"m16.852 17.772-.383.924",key:"1i8mnm"}],["path",{d:"m19.148 12.228.383-.923",key:"1q8j1v"}],["path",{d:"m19.53 18.696-.382-.924",key:"vk1qj3"}],["path",{d:"m20.772 13.852.924-.383",key:"n880s0"}],["path",{d:"m20.772 16.148.924.383",key:"1g6xey"}],["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],je=z("user-cog",Ve),We=F({method:"GET"}).middleware([D]).handler(_("bcbf405abb63715daaf1487f2958492789217ff1449ff447570bc418404b6901"));function T(s){return s==null?"â":`$${Math.round(s).toLocaleString()}`}function U(s){return s==null?"â":(Math.round(s*10)/10).toLocaleString()}function W({label:s,source:t}){return t?e.jsx(J,{delayDuration:150,children:e.jsxs(oe,{children:[e.jsx(ie,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Data source for ${s}`,onClick:o=>{o.preventDefault(),o.stopPropagation()},className:"shrink-0 text-muted-foreground/70 hover:text-foreground transition-colors",children:e.jsx(Ge,{className:"h-3.5 w-3.5"})})}),e.jsxs(ce,{className:"max-w-xs text-left",children:[e.jsx("p",{className:"font-medium mb-0.5",children:"Sourced from"}),e.jsx("p",{className:"font-normal leading-snug",children:t})]})]})}):null}function Ze({value:s,goal:t,breakdown:o,loading:x,source:m,dataAvailable:u=!0,reviewLinkTo:r}){const[c,n]=j.useState(!1),i=o,p=t&&t>0&&s!=null?Math.round(s/t*100):null;return e.jsx(N,{className:"col-span-2",children:e.jsxs(b,{className:"pt-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1 min-w-0",children:[e.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Jobs Created / Retained"}),e.jsx(W,{label:"Jobs Created / Retained",source:m})]}),e.jsx(ne,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),x?e.jsx(C,{className:"h-8 w-24 mt-2"}):u?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-2xl font-semibold mt-1",children:[U(s)," FTE"]}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"FTE-equivalent · part-time counted as 0.5"}),t!=null&&t>0?e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["Goal ",U(t)," FTE · ",e.jsxs("span",{className:"font-medium text-foreground",children:[p,"%"]})]}):null,i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[e.jsx(k,{label:"Created",value:i.createdFte}),e.jsx(k,{label:"Retained",value:i.retainedFte}),e.jsx(k,{label:"In Oregon",value:i.oregonFte}),e.jsx(k,{label:"Out-of-State",value:i.outsideFte})]}),e.jsxs("button",{type:"button",onClick:()=>n(g=>!g),className:"mt-2 inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[e.jsx(le,{className:A("h-3.5 w-3.5 transition-transform",c&&"rotate-180")}
1),"Full-time vs. part-time"]}),c?e.jsxs("div",{className:"mt-1.5 grid grid-cols-2 gap-2 text-xs",children:[e.jsx(k,{label:"Full-time",value:i.ftFte}),e.jsx(k,{label:"Part-time (0.5Ã)",value:i.ptFte})]}):null,i.needsReviewCount>0?e.jsx(J,{delayDuration:150,children:e.jsxs(oe,{children:[e.jsx(ie,{asChild:!0,children:r?e.jsxs("a",{href:r,className:"mt-2 inline-flex items-center gap-1 text-xs text-amber-600 hover:underline",children:[e.jsx(Y,{className:"h-3.5 w-3.5"}),i.needsReviewCount," FTE location ",i.needsReviewCount===1?"split needs":"splits need"," review"]}):e.jsxs("span",{className:"mt-2 inline-flex items-center gap-1 text-xs text-amber-600",children:[e.jsx(Y,{className:"h-3.5 w-3.5"}),i.needsReviewCount," FTE location ",i.needsReviewCount===1?"split needs":"splits need"," review"]})}),e.jsx(ce,{className:"max-w-xs text-left",children:"These companies reported total FTE but didn't break it down by Oregon vs. out-of-state. Ask them to update this during their next check-in."})]})}):null]}):null]}):e.jsx("div",{className:"mt-2 text-sm text-muted-foreground italic",children:"No data yet â add records to populate"})]})})}function k({label:s,value:t}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-2.5 py-1.5",children:[e.jsx("div",{className:"text-muted-foreground",children:s}),e.jsxs("div",{className:"font-semibold text-sm text-foreground",children:[U(t)," FTE"]})]})}function Xe({value:s,goal:t,breakdown:o,loading:x,source:m,dataAvailable:u=!0}){const r=o,c=t&&t>0&&s!=null?Math.round(s/t*100):null,n=r?r.preTotal+r.postTotal:0,i=n>0?Math.round(r.preTotal/n*100):0,p=n>0?100-i:0;return e.jsx(N,{className:"col-span-2",children:e.jsxs(b,{className:"pt-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1 min-w-0",children:[e.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Capital Raised"}),e.jsx(W,{label:"Capital Raised",source:m})]}),e.jsx(pe,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),x?e.jsx(C,{className:"h-8 w-28 mt-2"}):u?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-2xl font-semibold mt-1",children:T(s)}),t!=null&&t>0?e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["Goal ",T(t)," · ",e.jsxs("span",{className:"font-medium text-foreground",children:[c,"%"]})]}):null,r&&n>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mt-3 flex h-2.5 w-full overflow-hidden rounded-full bg-muted",children:[e.jsx("div",{className:"h-full bg-primary",style:{width:`${i}%`},title:`Pre-Accelerator ${T(r.preTotal)}`}),e.jsx("div",{className:"h-full bg-destructive",style:{width:`${p}%`},title:`Post-Accelerator ${T(r.postTotal)}`})]}),e.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs",children:[e.jsx(ae,{label:"Pre-Accelerator",value:r.preTotal,dot:"bg-primary"}),e.jsx(ae,{label:"Post-Accelerator",value:r.postTotal,dot:"bg-destructive"})]})]}):null,r&&r.needsReviewCount>0?e.jsxs("div",{className:"mt-2 inline-flex items-center gap-1 text-xs text-amber-600",children:[e.jsx(Y,{className:"h-3.5 w-3.5"}),T(r.needsReviewTotal)," across ",r.needsReviewCount," ",r.needsReviewCount===1?"record needs":"records need"," stage review"]}):null]}):e.jsx("div",{className:"mt-2 text-sm text-muted-foreground italic",children:"No data yet â add records to populate"})]})})}function ae({label:s,value:t,dot:o}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-2.5 py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[e.jsx("span",{className:A("h-2 w-2 rounded-full",o)}),s]}),e.jsx("div",{className:"font-semibold text-sm text-foreground",children:T(t)})]})}function es({value:s,goal:t,breakdown:o,loading:x,source:m,dataAvailable:u=!0}){const[r,c]=j.useState(!1),n=o,i=t&&t>0&&s!=null?Math.round(s/t*100):null;return e.jsx(N,{children:e.jsxs(b,{className:"pt-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1 min-w-0",children:[e.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Press / Media Mentions"}),e.jsx(W,{label:"Press / Media Mentions",source:m})]}),e.jsx(ge,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),x?e.jsx(C,{className:"h-8 w-16 mt-2"}):u?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-2xl font-semibold mt-1",children:(s??0).toLocaleStr
1ing()}),t!=null&&t>0?e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["Goal ",t.toLocaleString()," · ",e.jsxs("span",{className:"font-medium text-foreground",children:[i,"%"]})]}):null,n&&n.total>0?e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>c(p=>!p),className:"mt-2 inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[e.jsx(le,{className:A("h-3.5 w-3.5 transition-transform",r&&"rotate-180")}),"Breakdown"]}),r?e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsx(re,{title:"By outlet type",rows:n.byOutlet}),e.jsx(re,{title:"By coverage class",rows:n.byClass})]}):null]}):null]}):e.jsx("div",{className:"mt-2 text-sm text-muted-foreground italic",children:"No data yet â add records to populate"})]})})}function re({title:s,rows:t}){return t.length?e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80 mb-0.5",children:s}),e.jsx("ul",{className:"space-y-0.5",children:t.map(o=>e.jsxs("li",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"truncate text-muted-foreground",children:o.name}),e.jsx("span",{className:"font-medium tabular-nums",children:o.count})]},o.name))})]}):null}const Ne=F({method:"GET"}).middleware([D]).handler(_("f74268eeb2817623cf045af119e6b480fbe51c1a2faebb012a2de6d1b59d81df")),ss=F({method:"POST"}).middleware([D]).handler(_("c15b7bb4cdac2ccc6ecbf7e97234eca874e79fef8409492853c7fa2d01b85e6d")),ts=F({method:"POST"}).middleware([D]).handler(_("d6e225b0498bb336f0b30f1c65d47d21fe40b43f36209afda2e1f38d6adb1f97")),as=F({method:"POST"}).middleware([D]).handler(_("72ac72ab86c161b3c1523f26b5570b3eef134fe7c28df30a82d64547372cb4ac"));function rs(){const s=Se(),t=y(Ne),o=y(ss),x=y(ts),m=y(as),[u,r]=j.useState(""),[c,n]=j.useState(""),{data:i,isPending:p}=R({queryKey:["my-tasks"],queryFn:()=>t(),refetchOnWindowFocus:!1}),g=()=>{s.invalidateQueries({queryKey:["my-tasks"]})},f=O({mutationFn:l=>o({data:l}),onSuccess:()=>{r(""),n(""),g()}}),v=O({mutationFn:l=>x({data:l}),onSuccess:g}),a=O({mutationFn:l=>m({data:l}),onSuccess:g}),h=(i??[]).filter(l=>l.status!=="done"),d=(i??[]).filter(l=>l.status==="done");return e.jsxs(N,{className:"flex flex-col",children:[e.jsx(E,{className:"pb-2",children:e.jsxs(M,{className:"text-base flex items-center gap-2",children:[e.jsx(Ue,{className:"h-4 w-4"})," My Tasks"]})}),e.jsxs(b,{className:"space-y-3",children:[e.jsxs("form",{className:"flex flex-col sm:flex-row gap-2",onSubmit:l=>{l.preventDefault(),u.trim()&&f.mutate({title:u.trim(),due_date:c||null})},children:[e.jsx(I,{value:u,onChange:l=>r(l.target.value),placeholder:"Add a taskâ¦",className:"flex-1"}),e.jsx(I,{type:"date",value:c,onChange:l=>n(l.target.value),className:"sm:w-40"}),e.jsx($,{type:"submit",size:"sm",disabled:f.isPending||!u.trim(),children:e.jsx(ke,{className:"h-4 w-4"})})]}),p?e.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((l,S)=>e.jsx(C,{className:"h-8 w-full"},S))}):h.length===0&&d.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No tasks yet. Add your first above."}):e.jsx("ul",{className:"space-y-1",children:[...h,...d].map(l=>e.jsxs("li",{className:"flex items-center gap-2 py-1.5 group",children:[e.jsx(de,{checked:l.status==="done",onCheckedChange:S=>v.mutate({id:l.id,done:!!S})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:A("text-sm leading-snug truncate",l.status==="done"&&"line-through text-muted-foreground"),children:l.title}),l.due_date?e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Due ",new Date(l.due_date).toLocaleDateString()]}):null]}),e.jsx("button",{onClick:()=>a.mutate({id:l.id}),className:"opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition","aria-label":"Delete task",children:e.jsx(Te,{className:"h-3.5 w-3.5"})})]},l.id))})]})]})}function ns(){const s=y(Ne),{data:t,isPending:o}=R({queryKey:["my-tasks"],queryFn:()=>s(),refetchOnWindowFocus:!1}),x=new Date,m=new Date;m.setDate(x.getDate()+7);const u=(t??[]).filter(r=>r.status!=="done"&&r.due_date).map(r=>{const c=new Date(r.due_date),n=c<x,i=c>=x&&c<=m;return{...r,overdue:n,upcoming:i,d:c}}).filter(r=>r.overdue||r.upcoming).sort((r,c)=>r.d.getTime()-c.d.getTime());return e.jsxs(N,{children:[e.jsx(E,{className:"pb-2",children:e.jsx(M,{className:"text-base flex items-center gap-2",children:"Alerts & Notifications"})}),e.jsx(b,{children:o?e.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((r,c)=>e.jsx(C,{className:"h-8 w-full"},c))}):u.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No deadlines or flags right now."}):e.jsx("ul",{className:"space-y-2",children:u.map(r=>e.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[e.jsx("span",{className:A("mt-1 h-2 w-2 rounded-full shrink-0",r.overdue?"bg-destructive":"bg-amber-500")}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"leading-snug truncate",children:r.title}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[r.overdue?"Overdue · ":"Due soon · ",r.d.toLocaleDateString()]})]})]},r.id))})})]})}const ls=F({method:"GET"}).middleware([D]).handler(_("8b26ce044f35847e00b89188aab63f1edf914b6c12024694e6a55f6c642fc919")),os={1:[6,0],2:[9,0],3:[0,1],4:[3,1]},is={1:"Q1 (JulâSep)",2:"Q2 (OctâDec)",3:"Q3 (JanâMar)",4:"Q4 (AprâJun)"};function be(s=new Date){return s.getMonth()>=6?s.getFullYear():s.getFullYear()-1}function ye(s=new Date){const t=s.getMonth();return t>=6&&t<=8?1:t>=9&&t<=11?2:t>=0&&t<=2?3:4}function ve(s){return`${s}â${String((s+1)%100).padStart(2,"0")}`}function Z(s){if(s.mode==="all")return{startIso:null,endIso:null,label:"All time"};if(s.mode==="quarter"){const m=s.fiscalYear??be(),u=s.quarter??ye(),[r,c]=os[u],n=m+c,i=new Date(Date.UTC(n,r,1)),p=new Date(Date.UTC(n,r+3,0,23,59,59));return{startIso:i.toISOString(),endIso:p.toISOString(),label:`Q${u} FY ${ve(m)}`}}const t=s.start?new Date(`${s.start}T00:00:00.000Z`):null,o=s.end?new Date(`${s.end}T23:59:59.999Z`):null,x=s.start||s.end?`${s.start??"â¦"} â ${s.end??"â¦"}`:"Custom range";return{startIso:t&&!Number.isNaN(t.getTime())?t.toISOString():null,endIso:o&&!Number.isNaN(o.getTime())?o.toISOString():null,label:x}}function cs(s){const t=Z(s);return`${t.startIso??"*"}|${t.endIso??"*"}`}function we({value:s,onChange:t,className:o,layout:x="row"}){const m=be(),u=Array.from({length:6},(n,i)=>m-4+i),r=s.fiscalYear??m,c=s.quarter??ye();return e.jsxs("div",{className:A(x==="row"?"flex flex-wrap items-end gap-2":"grid gap-3",o),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{className:"text-xs",children:"Period"}),e.jsxs(q,{value:s.mode,onValueChange:n=>t({...s,mode:n}),children:[e.jsx(L,{className:"h-9 w-[150px]",children:e.jsx(G,{})}),e.jsxs(K,{children:[e.jsx(P,{value:"all",children:"All time"}),e.jsx(P,{value:"quarter",children:"Quarter"}),e.jsx(P,{value:"custom",children:"Custom range"})]})]})]}),s.mode==="quarter"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{className:"text-xs",children:"Fiscal year"}),e.jsxs(q,{value:String(r),onValueChange:n=>t({...s,fiscalYear:Number(n)}),children:[e.jsx(L,{className:"h-9 w-[140px]",children:e.jsx(G,{})}),e.jsx(K,{children:u.map(n=>e.jsxs(P,{value:String(n),children:["FY ",ve(n)]},n))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{className:"text-xs",children:"Quarter"}),e.jsxs(q,{value:String(c),onValueChange:n=>t({...s,quarter:Number(n)}),children:[e.jsx(L,{className:"h-9 w-[160px]",children:e.jsx(G,{})}),e.jsx(K,{children:[1,2,3,4].map(n=>e.jsx(P,{value:String(n),children:is[n]},n))})]})]})]}),s.mode==="custom"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{className:"text-xs",children:"Start date"}
1),e.jsx(I,{type:"date",className:"h-9 w-[160px]",value:s.start??"",max:s.end||void 0,onChange:n=>t({...s,start:n.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{className:"text-xs",children:"End date"}),e.jsx(I,{type:"date",className:"h-9 w-[160px]",value:s.end??"",min:s.start||void 0,onChange:n=>t({...s,end:n.target.value})})]})]})]})}const H=["Exec Summary","Metrics","Engagement Tracker","Cohort Engagement","Cohort Program Attendance","Press & Media Tracking","Orientation Registration"];function ds({triggerVariant:s="outline",period:t}){const o=y(ls),[x,m]=j.useState(!1),[u,r]=j.useState(!1),[c,n]=j.useState(t??{mode:"all"}),[i,p]=j.useState(Object.fromEntries(H.map(d=>[d,!0]))),g=d=>{d&&t&&n(t),m(d)},f=Z(c),v=H.filter(d=>i[d]),a=d=>p(l=>({...l,[d]:!l[d]})),h=async()=>{if(v.length===0){Q.error("Select at least one tab to export.");return}r(!0);try{const d=await o({data:{startIso:f.startIso,endIso:f.endIso,periodLabel:f.label}}),l=B.book_new();for(const S of v){const X=d.sheets[S]??[],Ce=B.json_to_sheet(X.length?X:[{Note:"No data."}]);B.book_append_sheet(l,Ce,S.slice(0,31))}Ke(l,`UAS-Hub-Report-${d.periodLabel.replace(/\s+/g,"-")}.xlsx`),Q.success(`Exported ${d.periodLabel} report`),m(!1)}catch(d){Q.error(d?.message??"Export failed")}finally{r(!1)}};return e.jsxs(Fe,{open:x,onOpenChange:g,children:[e.jsx(De,{asChild:!0,children:e.jsxs($,{variant:s,size:"sm",children:[e.jsx(ee,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Export Report"})]})}),e.jsxs(_e,{className:"max-w-lg",children:[e.jsxs(Ae,{children:[e.jsx(Pe,{children:"Export Report"}),e.jsx(Re,{children:"Generate a multi-tab .xlsx report from current platform data. Choose the reporting period and the tabs to include."})]}),e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{children:"Reporting period"}),e.jsx(we,{value:c,onChange:n}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Exporting: ",e.jsx("span",{className:"font-medium text-foreground",children:f.label}
1)," â populates the âReporting Periodâ field in the Exec Summary tab."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{children:"Tabs to include"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:H.map(d=>e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer rounded-md border px-3 py-2 hover:bg-muted/40",children:[e.jsx(de,{checked:!!i[d],onCheckedChange:()=>a(d)}),e.jsx("span",{children:d})]},d))})]})]}),e.jsx(Ee,{children:e.jsxs($,{onClick:h,disabled:u||v.length===0,children:[u?e.jsx(Me,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(ee,{className:"h-4 w-4 mr-2"}),"Download .xlsx"]})})]})]})}const ms={companies_engaged:xe,startups_supported:V,active_portfolio:He,capital_raised:pe,jobs_created:ne,mentorship_hours:Be,events:ue,event_attendance:Je,ecosystem_partnerships:me,press_media:ge},us=[{to:"/applications",label:"Applications",icon:he},{to:"/alumni",label:"Alumni",icon:V},{to:"/mentors",label:"Mentors",icon:je},{to:"/partners",label:"Partners",icon:me}];function xs(s,t){if(!t)return null;switch(s){case"application":return{to:"/applications/$id",params:{id:t}};case"organization":return{to:"/organizations/$id",params:{id:t}};case"person":return{to:"/people/$id",params:{id:t}};case"event":return{to:"/events/manage/$id",params:{id:t}};case"enrollment":return{to:"/enrollments/$id",params:{id:t}};default:return null}}function hs(s){switch(s){case"application":return he;case"organization":return xe;case"person":return je;case"event":return ue;case"enrollment":return V;default:return fe}}function ps(s){return s.replace(/[_.]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function gs(){const s=new Date().getHours();return s<12?"Good morning":s<18?"Good afternoon":"Good evening"}function As(){const{user:s}=Ie(),t=gs(),[o,x]=j.useState({mode:"all"}),m=Z(o),u=y(Oe),{data:r,isPending:c}=R({queryKey:["program-home",cs(o)],queryFn:()=>u({data:{startIso:m.startIso,endIso:m.endIso}}),refetchOnWindowFocus:!1}),n=y(We),{data:i,isPending:p,isFetching:g,refetch:f}=R({queryKey:["command-center"],queryFn:()=>n(),refetchOnWindowFocus:!1}),v=new Map((r?.goalProgress??[]).map(a=>[a.metric_key,a]));return e.jsx(J,{delayDuration:150,children:e.jsxs("div",{className:"space-y-6 max-w-[1500px] mx-auto",children:[e.jsxs("header",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:t}),e.jsx("h1",{className:"text-2xl font-semibold",children:"Program Dashboard"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Live, program-wide snapshot of the Oregon UAS Accelerator.",s?.email?` Signed in as ${s.email}.`:""]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx(ds,{period:o}),e.jsxs($,{variant:"outline",size:"sm",onClick:()=>f(),disabled:g,"aria-label":"Refresh dashboard",children:[e.jsx(Qe,{className:`h-4 w-4 sm:mr-2 ${g?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]})]})]}),e.jsx(N,{children:e.jsxs(b,{className:"flex flex-wrap items-end justify-between gap-3 py-4",children:[e.jsx(we,{value:o,onChange:x}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing: ",e.jsx("span",{className:"font-medium text-foreground",children:m.label}),o.mode!=="all"?" â all KPIs and goals below are scoped to this period.":""]})]})}),e.jsx("section",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3",children:(r?.kpis??Array.from({length:10}).map((a,h)=>({key:`s${h}`}))).map(a=>{const h=v.get(a.key);return a.key==="jobs_created"?e.jsx(Ze,{value:a.value,goal:h?.target??null,breakdown:r?.jobsBreakdown??null,loading:c,source:a.source??null,dataAvailable:a.dataAvailable??!0},a.key):a.key==="capital_raised"?e.jsx(Xe,{value:a.value,goal:h?.target??null,breakdown:r?.capital??null,loading:c,source:a.source??null,dataAvailable:a.dataAvailable??!0},a.key):a.key==="press_media"?e.jsx(es,{value:a.value,goal:h?.target??null,breakdown:r?.press??null,loading:c,source:a.source??null,dataAvailable:a.dataAvailable??!0},a.key):e.jsx(qe,{label:a.label??"",value:a.value,unit:a.unit,dataAvailable:a.dataAvailable??!0,goal:h?.target??null,icon:ms[a.key],loading:c,subLabel:a.subLabel??null,source:a.source??null},a.key)})}),e.jsxs(N,{children:[e.jsxs(E,{className:"pb-2",children:[e.jsx(M,{className:"text-base",children:"Goal vs. Actual"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Progress toward biennium targets. Edit targets in Settings â Goals."})]}),e.jsx(b,{className:"grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-4",children:c?Array.from({length:4}).map((a,h)=>e.jsx(C,{className:"h-10 w-full"},h)):(r?.goalProgress??[]).map(a=>e.jsx(Le,{label:a.label,actual:a.actual,target:a.target,unit:a.unit},a.id??a.metric_key))})]}),e.jsx("section",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:us.map(a=>e.jsx(se,{to:a.to,children:e.jsx(N,{className:"transition-colors hover:bg-muted/40",children:e.jsxs(b,{className:"flex items-center gap-3 py-4",children:[e.jsx("span",{className:"rounded-md bg-muted p-2",children:e.jsx(a.icon,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:a.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"View dashboard"})]}),e.jsx(te,{className:"h-4 w-4 text-muted-foreground"})]})})},a.to))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 items-start",children:[e.jsx(rs,{}),e.jsx(ns,{}),e.jsxs(N,{children:[e.jsxs(E,{className:"pb-2",children:[e.jsxs(M,{className:"flex items-center gap-2 text-base",children:[e.jsx(fe,{className:"h-4 w-4"})," Recent Activity"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Latest engagement and record changes across the program."})]}),e.jsx(b,{children:p?e.jsx("div",{className:"space-y-3",children:Array.from({length:6}).map((a,h)=>e.jsx(C,{className:"h-10 w-full"},h))}):(i?.activity?.length??0)===0?e.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"No recent activity."}):e.jsx("ul",{className:"space-y-1",children:i.activity.map(a=>{const h=hs(a.entity_type),d=xs(a.entity_type,a.entity_id),l=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mt-0.5 rounded-md bg-muted p-1.5 shrink-0",children:e.jsx(h,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"text-sm leading-snug",children:[e.jsx("span",{className:"font-medium",children:ps(a.action)}),a.name?e.jsxs("span",{className:"text-muted-foreground",children:[" · ",a.name]}):null]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.created_at?$e(new Date(a.created_at),{addSuffix:!0}):"",a.entity_type?` · ${a.entity_type}`:""]})]}),d?e.jsx(te,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 mt-1"}):null]});return e.jsx("li",{className:"border-b last:border-0",children:d?e.jsx(se,{to:d.to,params:d.params,className:"flex items-start gap-3 py-2 -mx-2 px-2 rounded-md hover:bg-muted/50 transition-colors",children:l}):e.jsx("div",{className:"flex items-start gap-3 py-2",children:l})},a.id)})})})]})]})]})})}export{As as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.