PageSourceSearch

https://myaegis.dev/assets/portal.index-BRlnLNaz.js

js myaegis.dev collected 2026-10-02 01:53:27 UTC 11,819 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-VkZOrh42.js","assets/vendor-react-BDbjtqU-.js","assets/vendor-observability-D2DqQGeh.js","assets/vendor-mantine-ISvEViIM.js","assets/vendor-mantine-Ble7_ipu.css","assets/vendor-charts-D39H6cio.js","assets/vendor-charts-DrbgVAe_.css","assets/vendor-dates-DCC2ddes.js","assets/vendor-dates-DAqvOFgL.css","assets/vendor-icons-Bz8lkBXm.js","assets/index-BqsZ5tVy.css"])))=>i.map(i=>d[i]);
2import{_ as V}from"./vendor-observability-D2DqQGeh.js";import{r as p,j as e}from"./vendor-react-BDbjtqU-.js";import{bb as Y,u as q,F as H,bc as J,a7 as Q,bd as X,q as Z,be as ee,E as z,a4 as se,w as i,aT as re}from"./index-VkZOrh42.js";import{P as te,a as ae,g as ie,b as oe}from"./portal-print-button-mdjR9P_d.js";import{u as ne,C as de}from"./collapsible-list-DWBSj4nu.js";import{g as R,b as le,a as ce}from"./portal-daily-projects-CpRJY08a.js";import{b as me}from"./retainer-gauge-Dfe6xmaX.js";import{e as y,G as o,f as xe,a as r,S as he,C as u,ac as pe,ah as ue}from"./vendor-mantine-ISvEViIM.js";import{K as je,p as ge,at as ye,a3 as we}from"./vendor-icons-Bz8lkBXm.js";import{B as fe,D as B}from"./vendor-charts-D39H6cio.js";import"./vendor-dates-DCC2ddes.js";const be={coding:"#3b82f6",browser:"#f59e0b"},ve={coding:"Coding",browser:"Browser"};function ze(m){if(!m)return[];const f=new Map;for(const d of m)for(const x of d.byType)f.set(x.category,(f.get(x.category)??0)+x.durationMs);return Array.from(f.entries()).filter(([,d])=>d>0).sort((d,x)=>x[1]-d[1]).map(([d,x])=>({name:ve[d],value:x,color:be[d]}))}function Ee(){const{portal:m}=Y.useRouteContext(),f=q(),d=H();p.useState(()=>{V(()=>import("./index-VkZOrh42.js").then(s=>s.bx),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(s=>s.trackPortalViewed())});const x=J(),[S,A]=p.useState(x),{from:j,to:g}=Q(S,d),{data:h}=X(j||void 0,g||void 0),c=h?.projects,{data:n}=Z(m.retainerEnabled),{data:k}=ee(j||void 0,g||void 0),w=p.useMemo(()=>[...k??[]].sort((s,t)=>new Date(t.lastActivity).getTime()-new Date(s.lastActivity).getTime()),[k]),{visibleItems:E,expanded:L,printing:N,toggle:_}=ne(w,8),$=n?me(n):[],D=h?.totals.billableMs??0,M=c?.reduce((s,t)=>s+t.totalMs,0)??0,F=c?.length??0,O=c?.reduce((s,t)=>s+t.sessions.length,0)??0,G=c?.reduce((s,t)=>s+(t.totalEstimatedCost??0),0)??0,W=p.useMemo(()=>{const s=new Map;for(const t of h?.dailyBreakdown??[])for(const a of t.byDeveloper){const l=s.get(a.userId);l?l.durationMs+=a.durationMs:s.set(a.userId,{...a})}return Array.from(s.values()).sort((t,a)=>a.durationMs-t.durationMs).map(t=>({...t,workItems:w.filter(a=>a.sessions.some(l=>l.user.id===t.userId))}))},[h?.dailyBreakdown,w]),P=p.useMemo(()=>{const s=new Map;for(const t of h?.dailyBreakdown??[])for(const a of t.bySource){const l=`${a.kind}:${a.label}`,I=s.get(l);I?I.durationMs+=a.durationMs:s.set(l,{...a})}return Array.from(s.values()).sort((t,a)=>a.durationMs-t.durationMs)},[h?.dailyBreakdown]),T=c??[],C=p.useMemo(()=>!c||c.length===0?[]:c.map((s,t)=>({name:s.projectName,value:s.totalMs,color:R(s,t)})),[c]),b=p.useMemo(()=>ze(h?.dailyBreakdown),[h?.dailyBreakdown]),U=b.reduce((s,t)=>s+t.value,0),v=p.useMemo(()=>j&&g?le(c,d,j,g):null,[c,d,j,g]);function K(s){const t=ce(s);t&&f({to:"/portal/days/$date",params:{date:t},search:{projectId:void 0}})}return e.jsxs(y,{gap:"lg","data-print-report":!0,children:[e.jsxs(o,{justify:"space-between",align:"flex-end",children:[e.jsxs("div",{children:[e.jsx(xe,{order:2,children:"Dashboard"}),e.jsx(r,{c:"dimmed",size:"sm",children:m.clientName}),j&&g&&e.jsxs(r,{className:"print-only",size:"sm",children:["Reporting period ·"," ",z.fromISO(j,{zone:d}).toLocaleString(z.DATE_MED),"–",z.fromISO(g,{zone:d}).toLocaleString(z.DATE_MED)]})]}),e.jsxs(o,{gap:"sm","data-print-hide":!0,children:[e.jsx(se,{value:S,onChange:A}),e.jsx(te,{})]})]}),e.jsxs(he,{cols:{base:2,sm:m.portalShowSpend?4:3},children:[e.jsx(u,{shadow:"sm",padding:"lg",radius:"md",withBorder:!0,children:e.jsxs(o,{children:[e.jsx(je,{size:24,color:"var(--mantine-color-blue-6)"}),e.jsxs("div",{children:[e.jsx(r,{size:"xs",c:"dimmed",tt:"uppercase",fw:600,children:"Billable Hours"}),e.jsx(r,{size:"xl",fw:700,children:i(D)})]})]})}
2),e.jsx(u,{shadow:"sm",padding:"lg",radius:"md",withBorder:!0,children:e.jsxs(o,{children:[e.jsx(ge,{size:24,color:"var(--mantine-color-green-6)"}),e.jsxs("div",{children:[e.jsx(r,{size:"xs",c:"dimmed",tt:"uppercase",fw:600,children:"Active Projects"}),e.jsx(r,{size:"xl",fw:700,children:F})]})]})}),e.jsx(u,{shadow:"sm",padding:"lg",radius:"md",withBorder:!0,children:e.jsxs(o,{children:[e.jsx(ye,{size:24,color:"var(--mantine-color-violet-6)"}),e.jsxs("div",{children:[e.jsx(r,{size:"xs",c:"dimmed",tt:"uppercase",fw:600,children:"Sessions"}),e.jsx(r,{size:"xl",fw:700,children:O})]})]})}),m.portalShowSpend&&e.jsx(u,{shadow:"sm",padding:"lg",radius:"md",withBorder:!0,children:e.jsxs(o,{children:[e.jsx(we,{size:24,color:"var(--mantine-color-yellow-6)"}),e.jsxs("div",{children:[e.jsx(r,{size:"xs",c:"dimmed",tt:"uppercase",fw:600,children:"Estimated Cost"}),e.jsxs(r,{size:"xl",fw:700,children:["$",G.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]})]})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-4",children:[e.jsxs(u,{shadow:"sm",padding:"lg",radius:"md",withBorder:!0,className:"lg:col-span-2",children:[e.jsx(r,{fw:600,mb:"md",children:"Daily Activity"}),v&&v.data.length>0?e.jsxs(e.Fragment,{children:[e.jsx(r,{size:"xs",c:"dimmed",mb:4,children:"Select a day to see who w
2orked on what."}),e.jsx(fe,{h:260,data:v.data,dataKey:"date",type:"stacked",series:v.series,withLegend:!0,legendProps:{verticalAlign:"bottom"},tickLine:"y",gridAxis:"y",barProps:{radius:[4,4,0,0],onClick:K,style:{cursor:"pointer"}},valueFormatter:i})]}):e.jsx(r,{size:"sm",c:"dimmed",ta:"center",py:"xl",children:"No activity data for this period"})]}),e.jsxs(u,{shadow:"sm",padding:"lg",radius:"md",withBorder:!0,children:[e.jsx(r,{fw:600,mb:"md",children:"Project Attribution"}),C.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(B,{data:C,size:180,thickness:28,tooltipDataSource:"segment",chartLabel:i(M),valueFormatter:i})}),e.jsx(y,{gap:6,mt:"md",children:C.map(s=>e.jsxs(o,{justify:"space-between",children:[e.jsxs(o,{gap:"xs",children:[e.jsx("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:s.color}}),e.jsx(r,{size:"xs",children:s.name})]}),e.jsx(r,{size:"xs",c:"dimmed",children:i(s.value)})]},s.name))})]}):e.jsx(r,{size:"sm",c:"dimmed",ta:"center",py:"xl",children:"No project data"})]}),e.jsxs(u,{shadow:"sm",padding:"lg",radius:"md",withBorder:!0,children:[e.jsx(r,{fw:600,mb:"md",children:"Time by Category"}),b.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(B,{data:b,size:180,thickness:28,tooltipDataSource:"segment",chartLabel:i(U),valueFormatter:i})}),e.jsx(y,{gap:6,mt:"md",children:b.map(s=>e.jsxs(o,{justify:"space-between",children:[e.jsxs(o,{gap:"xs",children:[e.jsx("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:s.color}}),e.jsx(r,{size:"xs",children:s.name})]}),e.jsx(r,{size:"xs",c:"dimmed",children:i(s.value)})]},s.name))})]}):e.jsx(r,{size:"sm",c:"dimmed",ta:"center",py:"xl",children:"No category data"})]})]}),m.retainerEnabled&&n&&e.jsxs(u,{shadow:"sm",padding:"lg",radius:"md",withBorder:!0,children:[e.jsx(r,{fw:600,mb:"md",children:"Retainer Status"}),e.jsxs(o,{gap:"xl",children:[e.jsx(pe,{size:140,thickness:14,sections:$,label:e.jsxs(r,{ta:"center",size:"sm",fw:600,children:[i(n.usedMs),e.jsx(r,{size:"xs",c:"dimmed",children:"used"})]})}),e.jsxs(y,{gap:"xs",children:[e.jsxs(r,{size:"sm",children:[e.jsx(r,{span:!0,fw:600,children:"Allocated:"})," ",i(n.allocatedMs)]}),n.rolloverMs>0&&e.jsxs(r,{size:"sm",children:[e.jsx(r,{span:!0,fw:600,children:"Rollover:"})," ",i(n.rolloverMs)]}),n.overageCapMs>0&&e.jsxs(r,{size:"sm",children:[e.jsx(r,{span:!0,fw:600,children:"Overage cap:"})," ",i(n.overageCapMs)]}),n.overageCapUsedMs>0&&e.jsxs(r,{size:"sm",children:[e.jsx(r,{span:!0,fw:600,children:"Covered overage:"})," ",i(n.overageCapUsedMs)]}),e.jsxs(r,{size:"sm",children:[e.jsx(r,{span:!0,fw:600,children:"Remaining:"})," ",i(n.remainingMs)]}),n.overageMs>0&&e.jsxs(r,{size:"sm",c:"red",children:[e.jsx(r,{span:!0,fw:600,children:"Overage:"})," ",i(n.overageMs)]}),e.jsxs(r,{size:"xs",c:"dimmed",children:["Cycle: ",new Date(n.cycleStart).toLocaleDateString()," –"," ",new Date(n.cycleEnd).toLocaleDateString()]})]})]})]}),w.length>0&&e.jsxs("div",{className:"grid grid-cols-1 gap-10 lg:grid-cols-[minmax(0,1.45fr)_minmax(280px,0.75fr)]",children:[e.jsxs("section",{"aria-labelledby":"portal-work-items",children:[e.jsxs(o,{justify:"space-between",align:"baseline",mb:"xs",children:[e.jsx(r,{id:"portal-work-items",size:"sm",fw:600,children:"Work items"}),e.jsxs(r,{size:"xs",style:{color:"var(--aegis-text-secondary)"},children:[w.length," total"]})]}),e.jsx("div",{style:{borderTop:"1px solid var(--aegis-border)"},children:E.map(s=>e.jsx(ae,{task:s,totalMs:D,showSpend:m.portalShowSpend},`${s.taskType}:${s.taskId}:${s.projects.join(",")}`))}),e.jsx(o,{justify:"center",mt:"xs",children:e.jsx(de,{expanded:L,totalCount:w.length,collapsedCount:8,onToggle:_})})]}),e.jsxs(y,{gap:"xl",children:[e.jsxs("section",{"aria-labelledby":"portal-contributors",children:[e.jsx(r,{id:"portal-contributors",size:"sm",fw:600,mb:"xs",children:"Who worked"}),e.jsx("div",{style:{borderTop:"1px solid var(--aegis-border)"},children:W.map(s=>{const t=N?s.workItems:s.workItems.slice(0,4),a=s.workItems.length-t.length;return e.jsxs("div",{style:{padding:"12px 0",borderBottom:"1px solid var(--aegis-border)"},children:[e.jsxs(o,{justify:"space-between",align:"center",wrap:"nowrap",children:[e.jsxs(o,{gap:"sm",wrap:"nowrap",style:{minWidth:0},children:[e.jsx(re,{user:s,size:24}),e.jsx(r,{size:"sm",fw:600,truncate:!0,children:s.name})]}),e.jsx(r,{size:"xs",ff:"monospace",fw:600,children:i(s.durationMs)})]}),e.jsxs(y,{gap:2,mt:7,pl:36,children:[t.map(l=>e.jsxs(r,{size:"xs",style:{color:"var(--aegis-text-secondary)"},truncate:!0,children:[ie(l)," · ",oe(l)]},`${l.taskType}:${l.taskId}:${l.projects.join(",")}`)),a>0&&e.jsxs(r,{size:"xs",style:{color:"var(--aegis-text-secondary)"},children:["+",a," more"]})]})]},s.userId)})})]}),T.length>1&&e.jsxs("section",{"aria-labelledby":"portal-project-attribution",children:[e.jsx(r,{id:"portal-project-attribution",size:"sm",fw:600,mb:"xs",children:"Project attribution"}),e.jsx(y,{gap:"sm",style:{borderTop:"1px solid var(--aegis-border)"},pt:"sm",children:T.map((s,t)=>{const a=R(s,t);return e.jsxs("div",{children:[e.jsxs(o,{justify:"space-between",gap:"md",wrap:"nowrap",mb:4,children:[e.jsxs(o,{gap:7,wrap:"nowrap",style:{minWidth:0},children:[e.jsx("div",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:"50%",flexShrink:0,background:a}}),e.jsx(r,{size:"xs",truncate:!0,children:s.projectName})]}),e.jsx(r,{size:"xs",ff:"monospace",children:i(s.totalMs)})]}),e.jsx(ue,{value:M>0?s.totalMs/M*100:0,size:2,color:a})]},s.projectId)})})]}),P.length>0&&e.jsxs("section",{"aria-labelledby":"portal-activity-sources",children:[e.jsx(r,{id:"portal-activity-sources",size:"sm",fw:600,mb:"xs",children:"Activity sources"}),e.jsx("div",{style:{borderTop:"1px solid var(--aegis-border)"},children:P.map(s=>e.jsxs(o,{justify:"space-between",gap:"md",wrap:"nowrap",py:7,style:{borderBottom:"1px solid var(--aegis-border)"},children:[e.jsxs("div",{style:{minWidth:0},children:[e.jsx(r,{size:"xs",truncate:!0,children:s.label}),e.jsx(r,{size:"xs",style:{color:"var(--aegis-text-secondary)"},children:s.kind==="website"?"Website":"Repository"})]}),e.jsx(r,{size:"xs",ff:"monospace",children:i(s.durationMs)})]},`${s.kind}:${s.label}`))})]})]})]})]})}export{Ee 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.