agent-session-inspector 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/VERSION +1 -1
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/required-server-files.json +1 -1
- package/app/.next/server/app/_global-error.html +1 -1
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/app/.next/server/app/api/logs/route.js.nft.json +1 -1
- package/app/.next/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next/server/app/api/search/route.js.nft.json +1 -1
- package/app/.next/server/app/api/sessions/[provider]/[id]/record/route.js.nft.json +1 -1
- package/app/.next/server/app/api/sessions/[provider]/[id]/reveal/route.js.nft.json +1 -1
- package/app/.next/server/app/api/sessions/[provider]/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +3 -3
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/sessions/[provider]/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/sessions/[provider]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__014br-h._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__0co499t._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__0p_hyq8._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__0yxic1z._.js +1 -1
- package/app/.next/server/chunks/ssr/_0e8jdju._.js +7 -0
- package/app/.next/server/chunks/ssr/_0gr0upx._.js +7 -0
- package/app/.next/server/chunks/ssr/src_app_page_tsx_1chiuah._.js +1 -1
- package/app/.next/server/chunks/ssr/src_app_sessions_[provider]_[id]_page_tsx_0uf635h._.js +2 -6
- package/app/.next/server/middleware-build-manifest.js +3 -3
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +1 -1
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/0hav9to299upa.js +1 -0
- package/app/.next/static/chunks/1-qn722atv1by.css +1 -0
- package/app/.next/static/chunks/{28k1og85stfuo.js → 1bgubb_nxxbrk.js} +2 -6
- package/app/.next/static/chunks/1gwxc9rvk6onv.js +5 -0
- package/app/CONTRIBUTING.md +1 -1
- package/app/Dockerfile +2 -2
- package/app/README.md +1 -1
- package/app/bin/agent-session-inspector.mjs +2 -2
- package/app/package.json +3 -3
- package/app/server.js +1 -1
- package/bin/agent-session-inspector.mjs +2 -2
- package/cli/cli.mjs +42 -10
- package/package.json +1 -1
- package/app/.next/server/chunks/ssr/_0o294sf._.js +0 -3
- package/app/.next/server/chunks/ssr/_0wfo2z0._.js +0 -3
- package/app/.next/static/chunks/0f_9fwik8mxzl.js +0 -1
- package/app/.next/static/chunks/3-49ck9kf466m.css +0 -1
- package/app/.next/static/chunks/3-g9jvt_m-6_4.js +0 -1
- /package/app/.next/static/{7UozMfIH3Lk8P6-UWWQXF → QagODMnr1on0whIZ_GMxV}/_buildManifest.js +0 -0
- /package/app/.next/static/{7UozMfIH3Lk8P6-UWWQXF → QagODMnr1on0whIZ_GMxV}/_clientMiddlewareManifest.js +0 -0
- /package/app/.next/static/{7UozMfIH3Lk8P6-UWWQXF → QagODMnr1on0whIZ_GMxV}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,77224,e=>{"use strict";let t=(0,e.i(13496).default)("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]);e.s(["Bug",0,t],77224)},50267,e=>{"use strict";let t=(0,e.i(13496).default)("calendar-days",[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M12 13h.01",key:"y0uutt"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M8 17h.01",key:"p3bg7i"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M16 17h.01",key:"ql8jdd"}]]);e.s(["CalendarDays",0,t],50267)},93304,98993,e=>{"use strict";let t=(0,e.i(13496).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",0,t],98993),e.s(["ChevronRight",0,t],93304)},26162,e=>{"use strict";let t=(0,e.i(13496).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",0,t],26162)},93125,e=>{"use strict";let t=(0,e.i(13496).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);e.s(["GitBranch",0,t],93125)},50395,e=>{"use strict";let t=(0,e.i(13496).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["Info",0,t],50395)},59920,10976,e=>{"use strict";let t=(0,e.i(13496).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t],10976),e.s(["AlertTriangle",0,t],59920)},32660,e=>{"use strict";let t=(0,e.i(13496).default)("zap",[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]);e.s(["Zap",0,t],32660)},93472,e=>{"use strict";var t=e.i(45650),r=e.i(75157);e.s(["BarList",0,function({items:e,color:a="bg-brand",max:n,emptyLabel:s="None",limit:o,format:i=e=>e.toLocaleString()}){if(0===e.length)return(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s});let l=[...e].sort((e,t)=>t.value-e.value),d=o?l.slice(0,o):l,c=n??l[0].value??1;return(0,t.jsxs)("div",{className:"space-y-1.5",children:[d.map(({name:e,value:n})=>(0,t.jsxs)("div",{className:"flex items-center gap-2.5 text-xs",children:[(0,t.jsx)("div",{className:"w-28 shrink-0 truncate font-mono text-muted-foreground sm:w-36",title:e,children:e}),(0,t.jsx)("div",{className:"h-4 flex-1 overflow-hidden rounded-sm bg-muted",children:(0,t.jsx)("div",{className:(0,r.cn)("h-full rounded-sm",a),style:{width:`${Math.max(n/c*100,2)}%`}})}),(0,t.jsx)("div",{className:"w-12 shrink-0 text-right font-medium tabular-nums text-foreground",children:i(n)})]},e)),o&&l.length>o&&(0,t.jsxs)("p",{className:"pt-1 text-xs text-muted-foreground",children:["+",l.length-o," more"]})]})}])},35334,e=>{"use strict";var t=e.i(45650),r=e.i(75157);e.s(["EmptyState",0,function({icon:e,title:a,description:n,action:s,className:o}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-border px-6 py-14 text-center",o),children:[(0,t.jsx)("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,t.jsx)(e,{className:"size-5","aria-hidden":!0})}),(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:a}),n&&(0,t.jsx)("p",{className:"max-w-sm text-xs leading-relaxed text-muted-foreground",children:n}),s&&(0,t.jsx)("div",{className:"mt-2",children:s})]})}])},82183,9449,e=>{"use strict";var t=e.i(45650);let r={A:{badge:"border-emerald-300 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-300",bar:"bg-emerald-500"},B:{badge:"border-sky-300 bg-sky-50 text-sky-700 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-300",bar:"bg-sky-500"},C:{badge:"border-amber-300 bg-amber-50 text-amber-700 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300",bar:"bg-amber-500"},D:{badge:"border-orange-300 bg-orange-50 text-orange-700 dark:border-orange-900 dark:bg-orange-950/40 dark:text-orange-300",bar:"bg-orange-500"},F:{badge:"border-red-300 bg-red-50 text-red-700 dark:border-red-900 dark:bg-red-950/40 dark:text-red-300",bar:"bg-red-500"}},a={completed:"The agent had the last word.",in_progress:"The agent is still writing to this session.",abandoned:"The session stops mid-work, or on a prompt the agent never answered.",errored:"The transcript ends on an API error."},n=(e,t,r=`${t}s`)=>`${e.toLocaleString()} ${1===e?t:r}`;e.s(["GRADES",0,["A","B","C","D","F"],"GRADE_STYLES",0,r,"OUTCOMES",0,["completed","in_progress","abandoned","errored"],"OUTCOME_BARS",0,{completed:"bg-emerald-500",in_progress:"bg-sky-500",abandoned:"bg-amber-500",errored:"bg-red-500"},"OUTCOME_LABELS",0,{completed:"Completed",in_progress:"In progress",abandoned:"Abandoned",errored:"Errored"},"OUTCOME_NOTES",0,a,"SIGNAL_INFO",0,{outcome:{label:"Unfinished sessions",describe:(e,t)=>a[t.outcome],advice:"Review errored and abandoned sessions first: they spent tokens without reaching an answer."},tool_failures:{label:"Tool failures",describe:(e,t)=>{let r=Math.max(t.toolResults,e.count);return`${e.count.toLocaleString()} of ${n(r,"tool result")} failed (${Math.round(e.count/r*100)}%).`},advice:"Open the failed calls and look for a recurring cause: wrong paths, missing dependencies, commands that need a flag.",focus:{failures:!0}},retry_loops:{label:"Retry loops",describe:e=>`The same tool failed three or more times in a row, ${n(e.count,"time")}.`,advice:"An agent repeating a failing call lacks the context to try something else. Put the working command in AGENTS.md or CLAUDE.md.",focus:{failures:!0}},api_errors:{label:"API errors",describe:e=>`${n(e.count,"API error")} or retried request${1===e.count?"":"s"}.`,advice:"Each retry re-sends the whole context. Frequent errors point at rate limits or an overloaded model.",focus:{categories:["session"],subKeys:["session.error"]}},aborted_turns:{label:"Interrupted turns",describe:e=>`${n(e.count,"turn")} interrupted before the agent finished.`,advice:"Interruptions usually mean the agent set off in the wrong direction. State the constraints and the success criteria up front.",focus:{categories:["session"],subKeys:["session.turn_aborted"]}},compactions:{label:"Context compactions",describe:e=>`Context was compacted ${n(e.count,"time")}.`,advice:"Split long tasks into separate sessions before the context fills up: compacting mid-task loses detail.",focus:{categories:["session"],subKeys:["session.compaction_start"]}}},"healthSummary",0,function(e){return`${e.grade} \xb7 ${e.score}`}],9449);var s=e.i(75157);e.s(["GradeBadge",0,function({grade:e,score:a,className:n,...o}){return(0,t.jsxs)("span",{...o,className:(0,s.cn)("inline-flex h-5 min-w-5 shrink-0 items-center justify-center gap-1 rounded-sm border px-1 font-mono text-xs font-bold leading-none",r[e].badge,n),children:[e,void 0!==a&&(0,t.jsx)("span",{className:"font-medium tabular-nums",children:a})]})}],82183)},4503,22910,e=>{"use strict";var t=e.i(45650),r=e.i(10364);let a=(0,e.i(13496).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var n=e.i(19455),s=e.i(46798),o=e.i(75157);function i({className:e}){return(0,t.jsx)("div",{"aria-hidden":!0,className:(0,o.cn)("animate-pulse rounded-md bg-muted",e)})}e.s(["ScrollToTop",0,function({threshold:e=600}){let[i,l]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let t=()=>l(window.scrollY>e);return t(),window.addEventListener("scroll",t,{passive:!0}),()=>window.removeEventListener("scroll",t)},[e]),(0,t.jsxs)(s.Tooltip,{children:[(0,t.jsx)(s.TooltipTrigger,{render:(0,t.jsx)(n.Button,{variant:"outline",size:"icon-lg",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),"aria-label":"Back to top",tabIndex:i?0:-1,className:(0,o.cn)("fixed bottom-6 right-6 z-30 size-10 rounded-full bg-card text-muted-foreground shadow-lg dark:bg-card",i?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:(0,t.jsx)(a,{"aria-hidden":!0})})}),(0,t.jsx)(s.TooltipContent,{side:"left",children:"Back to top"})]})}],4503),e.s(["SessionCardSkeleton",0,function(){return(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-card px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)(i,{className:"h-4 w-2/3"}),(0,t.jsx)(i,{className:"h-3 w-1/3"})]}),(0,t.jsx)(i,{className:"h-3 w-16"})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)(i,{className:"h-3 w-20"}),(0,t.jsx)(i,{className:"h-3 w-16"}),(0,t.jsx)(i,{className:"h-3 w-24"})]})]})},"Skeleton",0,i],22910)},75858,e=>{"use strict";var t=e.i(45650);let r=(0,e.i(13496).default)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var a=e.i(50395),n=e.i(46798),s=e.i(75157);e.s(["StatCard",0,function({label:e,value:o,sub:i,accent:l=!1,hint:d,onClick:c}){let u=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"flex items-center justify-between gap-2 text-xs uppercase tracking-wider text-muted-foreground",children:[e,d&&!c&&(0,t.jsxs)(n.Tooltip,{children:[(0,t.jsx)(n.TooltipTrigger,{render:(0,t.jsx)("span",{tabIndex:0,"aria-label":d,className:"rounded-sm opacity-60 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-2 focus-visible:outline-ring",children:(0,t.jsx)(r,{className:"size-3.5","aria-hidden":!0})})}),(0,t.jsx)(n.TooltipContent,{className:"normal-case tracking-normal",children:d})]}),c&&(0,t.jsx)(a.Info,{className:"size-3.5 shrink-0 opacity-60 transition-opacity group-hover:opacity-100","aria-hidden":!0})]}),(0,t.jsx)("span",{className:(0,s.cn)("mt-1.5 block text-2xl font-bold leading-none tabular-nums",l?"text-brand":"text-foreground"),children:o}),i&&(0,t.jsx)("span",{className:"mt-1 block truncate text-xs normal-case text-muted-foreground",title:i,children:i})]});return c?(0,t.jsx)("button",{type:"button",onClick:c,"aria-haspopup":"dialog",className:"group block rounded-xl border border-border bg-card p-4 text-left transition-colors hover:border-brand/40 hover:bg-muted/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:u}):(0,t.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:u})},"StatCardGrid",0,function({children:e}){return(0,t.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(150px,1fr))] gap-3",children:e})}],75858)},82574,e=>{"use strict";var t=e.i(13496);let r=(0,t.default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),a=(0,t.default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["InputTokensIcon",0,a,"OutputTokensIcon",0,r],82574)},19007,44581,e=>{"use strict";var t=e.i(45650),r=e.i(10364),a=e.i(51958),n=e.i(77224),s=e.i(50395);let o=(0,e.i(13496).default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var i=e.i(19455),l=e.i(76639),d=e.i(46798),c=e.i(34960);let u="https://github.com/kishanmundha/agent-session-inspector",h={name:"Agent Session Inspector",description:"A local web UI for reading agent CLI transcripts: what the agent did, how long it took, and where the tokens went. It reads the session files on this machine and never sends them anywhere.",version:"0.1.10",author:{name:"Kishan Mundha",url:"https://github.com/kishanmundha"},repoUrl:u,issuesUrl:`${u}/issues`,releasesUrl:`${u}/releases`};e.s(["APP_INFO",0,h],44581);var f=e.i(46816),p=e.i(75157);function m({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:e,"aria-hidden":!0,children:(0,t.jsx)("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}let x={target:"_blank",rel:"noreferrer"};e.s(["AboutDialog",0,function({providers:e,className:u}){let[b,g]=(0,r.useState)(!1),[v,y]=(0,r.useState)(null),j=(0,r.useRef)(!1),w=e??v,k=w?.filter(e=>e.available),N=w?.filter(e=>!e.available)??[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d.Tooltip,{children:[(0,t.jsx)(d.TooltipTrigger,{render:(0,t.jsx)(i.Button,{variant:"outline",size:"icon",onClick:function(){g(!0),e||j.current||(j.current=!0,fetch("/api/providers").then(e=>e.ok?e.json():[]).then(y).catch(()=>y([])))},"aria-label":"About",className:(0,p.cn)("text-muted-foreground",u),children:(0,t.jsx)(s.Info,{className:"size-3.5","aria-hidden":!0})})}),(0,t.jsx)(d.TooltipContent,{children:"About"})]}),(0,t.jsx)(l.Dialog,{open:b,onOpenChange:g,children:(0,t.jsxs)(l.DialogContent,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-brand text-brand-foreground",children:(0,t.jsx)(a.Bot,{className:"size-5","aria-hidden":!0})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(l.DialogTitle,{children:h.name}),(0,t.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-mono",children:["v",h.version]})," · by ",(0,t.jsx)("a",{href:h.author.url,...x,className:"font-medium text-foreground underline-offset-2 hover:underline",children:h.author.name})]})]})]}),(0,t.jsx)(l.DialogDescription,{children:h.description}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",nativeButton:!1,render:(0,t.jsx)("a",{href:h.repoUrl,...x}),children:[(0,t.jsx)(m,{className:"size-3.5"}),"GitHub"]}),(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",nativeButton:!1,render:(0,t.jsx)("a",{href:h.releasesUrl,...x}),children:[(0,t.jsx)(o,{className:"size-3.5","aria-hidden":!0}),"Releases"]}),(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",nativeButton:!1,render:(0,t.jsx)("a",{href:h.issuesUrl,...x}),children:[(0,t.jsx)(n.Bug,{className:"size-3.5","aria-hidden":!0}),"Report an issue"]})]}),(0,t.jsxs)("section",{className:"space-y-2 border-t border-border pt-3",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-foreground",children:"Data sources"}),k?k.length>0?(0,t.jsx)("ul",{className:"overflow-hidden rounded-lg border border-border text-xs",children:k.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2 border-b border-border/60 px-3 py-2 last:border-b-0",children:[(0,t.jsx)("span",{className:(0,p.cn)("size-1.5 shrink-0 rounded-full",(0,f.providerStyle)(e.id).dotCls),"aria-hidden":!0}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate font-medium text-foreground",children:e.label}),(0,t.jsx)("p",{className:"truncate font-mono text-muted-foreground",children:e.rootDir})]}),(0,t.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:`${e.sessionCount??0} ${1===e.sessionCount?"session":"sessions"}`}),(0,t.jsx)(c.CopyButton,{value:e.rootDir,label:"Copy path"})]},e.id))}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"No agent directories found."}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading…"}),N.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[k?.length?"Also supports":"Supports"," ",N.map(e=>e.label).join(", "),"."]})]})]})})]})}],19007)},19390,e=>{"use strict";var t=e.i(45650),r=e.i(10364),a=e.i(75379),n=e.i(75157);let s="\0other";function o(e,t){return"costUSD"===e?(0,a.formatCost)(t):(0,a.formatTokens)(t)??"0"}function i(e){if(e<=0)return 1;let t=10**Math.floor(Math.log10(e));return([1,1.5,2,3,4,5,6,8,10].find(r=>r*t>=e)??10)*t}let l=e=>e.toLocaleDateString([],{month:"short",day:"numeric"});e.s(["OTHER",0,s,"OTHER_COLOR",0,"color-mix(in srgb, var(--muted-foreground) 45%, transparent)","SERIES_COLORS",0,["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"],"StackedBars",0,function({periods:e,breakdownOf:a,series:d,unit:c}){var u;let[h,f]=(0,r.useState)(null),p=i(Math.max(0,...e.map(e=>e[c]))),m=e.map(e=>(function(e,t,r){let a=new Set(t.map(e=>e.name)),n=0;for(let[t,s]of Object.entries(e))a.has(t)||(n+=s[r]);return t.map(t=>t.name===s?n:e[t.name]?.[r]??0)})(a(e),d,c)),x=null!==h&&h<e.length?h:null,b=d.map((e,t)=>m.reduce((e,r)=>e+r[t],0)),g=null===x?b:m[x],v=g.reduce((e,t)=>e+t,0),y=Math.floor((e.length-1)/2);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("div",{className:"flex h-48 flex-col justify-between text-right text-[10px] leading-none tabular-nums text-muted-foreground",children:[(0,t.jsx)("span",{children:o(c,p)}),(0,t.jsx)("span",{children:o(c,p/2)}),(0,t.jsx)("span",{children:o(c,0)})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{role:"img","aria-label":`${"costUSD"===c?"Cost":"Tokens"} per ${e[0]?.days===1?"day":"week"} over ${e.length} bars`,className:"relative flex h-48 items-end gap-[2px] border-b border-border",onMouseLeave:()=>f(null),children:[(0,t.jsx)("span",{className:"pointer-events-none absolute inset-x-0 top-0 border-t border-dashed border-border"}),(0,t.jsx)("span",{className:"pointer-events-none absolute inset-x-0 top-1/2 border-t border-dashed border-border"}),e.map((e,r)=>(0,t.jsx)("div",{onMouseEnter:()=>f(r),className:(0,n.cn)("relative flex h-full min-w-0 max-w-12 flex-1 flex-col-reverse",null!==x&&x!==r&&"opacity-50"),children:d.map((e,a)=>m[r][a]>0?(0,t.jsx)("div",{className:"w-full shrink-0 border-t-2 border-card first:border-t-0 last:rounded-t-[3px]",style:{height:`${m[r][a]/p*100}%`,minHeight:2,background:e.color}},e.name):null)},e.start.getTime()))]}),(0,t.jsxs)("div",{className:"mt-1.5 flex justify-between text-[10px] text-muted-foreground",children:[(0,t.jsx)("span",{children:e.length>0&&l(e[0].start)}),e.length>4&&(0,t.jsx)("span",{children:l(e[y].start)}),(0,t.jsx)("span",{children:e.length>1&&l(e[e.length-1].start)})]})]})]}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs","aria-live":"polite",children:[(0,t.jsxs)("span",{className:"font-medium tabular-nums",children:[null===x?"Whole range":1===(u=e[x]).days?u.start.toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"}):`Week of ${l(u.start)}`," ·"," ",o(c,v)]}),d.map((e,r)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-muted-foreground",children:[(0,t.jsx)("span",{className:"size-2.5 shrink-0 rounded-[3px]",style:{background:e.color},"aria-hidden":!0}),(0,t.jsx)("span",{className:"max-w-40 truncate",title:e.label,children:e.label}),(0,t.jsx)("span",{className:"tabular-nums text-foreground",children:o(c,g[r])})]},e.name))]})]})},"Treemap",0,function({items:e,unit:r}){let a=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value),n=a.reduce((e,t)=>e+t.value,0),s=function(e){let t=e.reduce((e,t)=>e+t,0);if(t<=0)return[];let r=e.map(e=>e/t*5600),a=[],n=0,s=0,o=100,i=56,l=0;for(;l<r.length;){let e=Math.min(o,i),t=(t,r,a)=>Math.max(e*e*a/(t*t),t*t/(e*e*r)),d=r[l],c=l+1;for(;c<r.length;){let e=d+r[c];if(t(e,r[c],r[l])>t(d,r[c-1],r[l]))break;d=e,c++}let u=d/e,h=0;for(let e=l;e<c;e++){let t=r[e]/u;a.push(o>=i?{x:n,y:s+h,w:u,h:t}:{x:n+h,y:s,w:t,h:u}),h+=t}o>=i?(n+=u,o-=u):(s+=u,i-=u),l=c}return a}(a.map(e=>e.value));return(0,t.jsx)("div",{className:"relative w-full",style:{aspectRatio:"100 / 56"},role:"img","aria-label":`Share of ${"costUSD"===r?"cost":"tokens"} across ${a.length} groups`,children:a.map((e,a)=>{let i=s[a],l=e.value/n;return(0,t.jsx)("div",{title:`${e.label}: ${o(r,e.value)} (${(100*l).toFixed(1)}%)`,className:"absolute p-px",style:{left:`${i.x/100*100}%`,top:`${i.y/56*100}%`,width:`${i.w/100*100}%`,height:`${i.h/56*100}%`},children:(0,t.jsx)("div",{className:"size-full overflow-hidden rounded-[4px] border-l-[3px] px-1.5 py-1 hover:ring-1 hover:ring-foreground/50",style:{background:`color-mix(in srgb, ${e.color} 28%, var(--card))`,borderColor:e.color},children:i.w>14&&i.h>11&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"block truncate text-xs font-medium",children:e.label}),(0,t.jsxs)("span",{className:"block truncate text-[11px] tabular-nums text-muted-foreground",children:[o(r,e.value)," · ",(100*l).toFixed(1),"%"]})]})})},e.name)})})},"formatUnit",0,o,"niceCeil",0,i])},36558,52558,71932,e=>{"use strict";var t=e.i(45650),r=e.i(10364),a=e.i(93304);let n=(0,e.i(13496).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,n],52558);var s=e.i(76639),o=e.i(84774),i=e.i(34960),l=e.i(75379);let d=[{label:"Anthropic",url:"https://platform.claude.com/docs/en/about-claude/pricing",match:/^claude/},{label:"OpenAI",url:"https://platform.openai.com/docs/pricing",match:/^(gpt|chatgpt|codex|o\d)/},{label:"Google Gemini",url:"https://ai.google.dev/gemini-api/docs/pricing",match:/^gemini/},{label:"xAI",url:"https://docs.x.ai/docs/models",match:/^grok/},{label:"Mistral",url:"https://mistral.ai/pricing",match:/^(mistral|codestral|devstral|magistral|ministral|pixtral)/},{label:"DeepSeek",url:"https://api-docs.deepseek.com/quick_start/pricing",match:/^deepseek/}],c={label:"OpenRouter",url:"https://openrouter.ai/models"};function u(e){return d.find(t=>t.match.test(e))??{label:c.label,url:`${c.url}?q=${encodeURIComponent(e)}`}}e.s(["CATALOG",0,c,"PRICE_SOURCES",0,d,"sourceOf",0,u],71932);var h=e.i(75157);let f={input:"Uncached input",cacheWrite:"Cache write",cacheWrite1h:"Cache write (1h)",cacheRead:"Cache read",output:"Output"},p=[["Uncached input","new prompt text the model had not seen before."],["Cache write","context stored so later requests can reuse it. A 1-hour cache costs more to write than the default."],["Cache read","stored context reused at a discount. The whole conversation is re-sent on every request, so this grows fastest in long sessions."],["Output","the model's replies, tool calls and reasoning."]],m={target:"_blank",rel:"noreferrer"};function x({model:e,priceKey:r}){if(!r)return(0,t.jsx)(t.Fragment,{children:e});let a=u(r);return(0,t.jsxs)("a",{href:a.url,...m,title:`Check the rates on ${a.label} pricing`,className:"inline-flex items-center gap-1 rounded-sm underline decoration-muted-foreground/50 underline-offset-2 hover:text-brand hover:decoration-current focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:[e,(0,t.jsx)(n,{className:"size-3 text-muted-foreground","aria-hidden":!0}),(0,t.jsxs)("span",{className:"sr-only",children:["(",a.label," pricing, opens in a new tab)"]})]})}function b({path:e}){return(0,t.jsx)("span",{title:`Priced from ${e}, not the bundled table`,className:"ml-2 rounded-sm border border-amber-500/40 bg-amber-500/10 px-1.5 py-px font-sans text-[10px] font-medium uppercase tracking-wider text-amber-700 dark:text-amber-400",children:"Your price"})}function g(e){return`$${e.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4})}`}function v({cost:e,totalLabel:a}){let n=e.byModel.length>1,s=e.unpricedModels.length>0,i=new Set(e.customPriced??[]);return(0,t.jsx)("div",{className:"overflow-hidden rounded-lg border border-border",children:(0,t.jsxs)(o.Table,{className:"text-xs",children:[(0,t.jsx)(o.TableHeader,{children:(0,t.jsxs)(o.TableRow,{className:"bg-muted/60 hover:bg-muted/60",children:[(0,t.jsx)(o.TableHead,{className:"h-8 px-3 text-muted-foreground",children:"Token type"}),(0,t.jsx)(o.TableHead,{className:"h-8 px-3 text-right text-muted-foreground",children:"Tokens"}),(0,t.jsx)(o.TableHead,{className:"h-8 px-3 text-right text-muted-foreground",children:"Rate / 1M"}),(0,t.jsx)(o.TableHead,{className:"h-8 px-3 text-right text-muted-foreground",children:"Cost"})]})}),(0,t.jsx)(o.TableBody,{className:"tabular-nums",children:e.byModel.map(a=>(0,t.jsxs)(r.Fragment,{children:[(0,t.jsxs)(o.TableRow,{className:"bg-muted/30 hover:bg-muted/30",children:[(0,t.jsxs)(o.TableHead,{colSpan:3,scope:"rowgroup",className:"h-auto px-3 py-1.5 font-mono font-semibold",children:[(0,t.jsx)(x,{model:a.model,priceKey:e.priceKeys?.[a.model]}),i.has(a.model)&&(0,t.jsx)(b,{path:e.overridePath})]}),(0,t.jsx)(o.TableCell,{className:"px-3 py-1.5 text-right font-mono font-semibold text-foreground",children:n&&null!==a.costUSD&&(0,l.formatCost)(a.costUSD)})]}),e.lines.filter(e=>e.model===a.model).map(e=>(0,t.jsxs)(o.TableRow,{className:"border-border/60",children:[(0,t.jsx)(o.TableCell,{className:"px-3 py-1.5 text-foreground",children:f[e.kind]}),(0,t.jsx)(o.TableCell,{className:"px-3 py-1.5 text-right font-mono",children:e.tokens.toLocaleString()}),(0,t.jsx)(o.TableCell,{className:"px-3 py-1.5 text-right font-mono",children:null===e.rate?"—":g(e.rate)}),(0,t.jsx)(o.TableCell,{className:"px-3 py-1.5 text-right font-mono text-foreground",children:null===e.usd?(0,t.jsx)("span",{className:"font-sans text-muted-foreground",children:"no price"}):(0,l.formatCost)(e.usd)})]},`${e.kind}-${e.rate}`))]},a.model))}),(0,t.jsx)(o.TableFooter,{className:"bg-muted/60",children:(0,t.jsxs)(o.TableRow,{className:"hover:bg-transparent",children:[(0,t.jsx)(o.TableHead,{colSpan:3,scope:"row",className:"h-auto px-3 py-2 font-semibold",children:a}),(0,t.jsxs)(o.TableCell,{className:"px-3 py-2 text-right font-mono font-bold tabular-nums text-foreground",children:[(0,l.formatCost)(e.totalUSD),s&&"+"]})]})})]})})}e.s(["CLASS_LABEL",0,f,"CostDialog",0,function({cost:e,open:n,onOpenChange:o,scope:l}){let d,c=e.unpricedModels.length>0,u=Object.keys(e.prices).length>0?(d=Object.entries(e.prices).map(([e,t])=>{let r=(t??[{input:0,output:0}]).map(e=>` ${JSON.stringify(e).replace(/([{,:])/g,"$1 ").replace("}"," }")}`).join(",\n");return` ${JSON.stringify(e)}: [
|
|
2
|
+
${r}
|
|
3
|
+
]`}),`{
|
|
4
|
+
${d.join(",\n")}
|
|
5
|
+
}`):null,f=e.customPriced??[],[m,x]=(0,r.useState)(c);return(0,t.jsx)(s.Dialog,{open:n,onOpenChange:o,children:(0,t.jsxs)(s.DialogContent,{className:"gap-0 overflow-hidden p-0 sm:max-w-xl",children:[(0,t.jsxs)("div",{className:"space-y-1.5 border-b border-border px-5 pt-5 pb-3",children:[(0,t.jsx)(s.DialogTitle,{children:"How this cost is estimated"}),(0,t.jsxs)(s.DialogDescription,{children:[l?(0,t.jsxs)(t.Fragment,{children:["This is what the tokens of ",l.sessions.toLocaleString()," session",1===l.sessions?"":"s"," (",l.period,") would cost on the pay-per-token API at list prices."]}):(0,t.jsx)(t.Fragment,{children:"This is what the session’s tokens would cost on the pay-per-token API at list prices."})," ","It is not a bill: on a subscription or a request-based plan you pay your plan price, however many tokens a session uses."]})]}),(0,t.jsxs)("div",{className:"flex min-h-0 shrink! flex-col gap-4 overflow-y-auto px-5 pt-4 pb-5 *:shrink-0",children:[(0,t.jsx)(v,{cost:e,totalLabel:e.inherited?"This session":"Total"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Each row is tokens ÷ 1,000,000 × rate, using the list price on the day of the request. Click a model name to check its rates on the vendor’s price list.",c&&(0,t.jsxs)(t.Fragment,{children:[" ","No price is known for ",e.unpricedModels.join(", "),", so the total leaves ",e.unpricedModels.length>1?"them":"it"," out."]})]}),f.length>0&&(0,t.jsxs)("p",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Custom prices in use."})," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:e.overridePath})," sets the price for ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:f.join(", ")}),", in place of the bundled table."]}),e.inherited&&(0,t.jsxs)("div",{className:"space-y-2 border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:"Inherited from the forked session"}),(0,t.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"This session is a fork, so it opens with a copy of its parent’s history. Those requests were made, and are counted, in the parent session; they are listed here for reference and are not part of this session’s cost or of any usage total."})]}),(0,t.jsx)(v,{cost:e.inherited,totalLabel:"Inherited"})]}),(0,t.jsx)("dl",{className:"space-y-1.5 border-t border-border pt-3 text-xs leading-relaxed text-muted-foreground",children:p.map(([e,r])=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"inline font-medium text-foreground",children:[e,": "]}),(0,t.jsx)("dd",{className:"inline",children:r})]},e))}),(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border bg-card text-xs",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>x(!m),"aria-expanded":m,"aria-controls":"cost-dialog-prices",className:"flex w-full items-center gap-2 px-3 py-2 text-left font-medium text-foreground transition-colors hover:bg-muted/60 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring",children:[(0,t.jsx)(a.ChevronRight,{className:(0,h.cn)("size-3.5 shrink-0 text-muted-foreground transition-transform",m&&"rotate-90"),"aria-hidden":!0}),c?"Add the missing price":"Change these prices"]}),(0,t.jsxs)("div",{id:"cost-dialog-prices",hidden:!m,className:"space-y-2 border-t border-border px-3 py-3 leading-relaxed text-muted-foreground",children:[u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{children:["Save the block below as"," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:e.overridePath})," ","and edit the numbers. It replaces the bundled price for the models it lists and takes effect on the next page load."]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("pre",{className:"overflow-x-auto rounded-lg border border-border bg-muted/50 p-3 pr-10 font-mono text-[11px] leading-relaxed text-foreground",children:u}),(0,t.jsx)(i.CopyButton,{value:u,label:"Copy pricing.json",className:"absolute top-1.5 right-1.5"})]})]}):(0,t.jsx)("p",{children:"Loading the prices these models use now…"}),(0,t.jsxs)("ul",{className:"list-disc space-y-1 pl-4",children:[(0,t.jsx)("li",{children:"All prices are US dollars per million tokens."}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"font-mono text-foreground",children:"input"})," and"," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"output"})," are required. ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"cacheRead"}),","," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"cacheWrite"})," and"," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"cacheWrite1h"})," ","are optional: the first two fall back to the input price, and ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"cacheWrite1h"})," ","to ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"cacheWrite"}),"."," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:"fast"})," multiplies every price for requests made in a faster, premium speed tier."]}),(0,t.jsxs)("li",{children:["To record a price change, add a second entry with"," ",(0,t.jsx)("code",{className:"font-mono text-foreground",children:'"from": "YYYY-MM-DD"'}),". Requests before that day keep the old price."]})]})]})]})]})]})})},"formatRate",0,g],36558)},87486,e=>{"use strict";var t=e.i(29494),r=e.i(50403),a=e.i(94237),n=e.i(75157);let s=(0,a.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:a="default",render:o,...i}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,n.cn)(s({variant:a}),e)},i),render:o,state:{slot:"badge",variant:a}},(0,r.useRenderElement)(l.defaultTagName??"div",l,l)}],87486)},59684,34960,e=>{"use strict";var t=e.i(45650);e.s([],88752),e.i(88752);var r=e.i(10364),a=e.i(19458),n=e.i(2304),s=e.i(82420);let o=r.createContext(void 0);function i(){let e=r.useContext(o);if(void 0===e)throw Error((0,s.default)(53));return e}var l=e.i(50403);function d(e,t,r){if(!e)return 0;let a=getComputedStyle(e),n=`${t}${"x"===r?"Inline":"Block"}`,s=parseFloat(a[`${n}Start`]);return"x"===r&&"margin"===t?2*s:s+parseFloat(a[`${n}End`])}var c=e.i(96100),u=e.i(99281);let h=e=>t=>t?{[e]:""}:null,f={hasOverflowX:h("data-has-overflow-x"),hasOverflowY:h("data-has-overflow-y"),overflowXStart:h("data-overflow-x-start"),overflowXEnd:h("data-overflow-x-end"),overflowYStart:h("data-overflow-y-start"),overflowYEnd:h("data-overflow-y-end"),cornerHidden:()=>null};var p=e.i(29148),m=e.i(63370);let x={x:0,y:0},b={width:0,height:0},g={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},v={x:!0,y:!0,corner:!0},y=r.forwardRef(function(e,s){var i;let h,{render:y,className:j,overflowEdgeThreshold:w,style:k,...N}=e,{xStart:S,xEnd:C,yStart:T,yEnd:R}=(h="number"==typeof(i=w)?{xStart:i,xEnd:i,yStart:i,yEnd:i}:i,{xStart:Math.max(0,h?.xStart||0),xEnd:Math.max(0,h?.xEnd||0),yStart:Math.max(0,h?.yStart||0),yEnd:Math.max(0,h?.yEnd||0)}),E=(0,u.useBaseUiId)(),M=(0,n.useTimeout)(),I=(0,n.useTimeout)(),{nonce:A,disableStyleElements:L}=(0,m.useCSPContext)(),[$,P]=r.useState(!1),[D,O]=r.useState(!1),[z,H]=r.useState(!1),[B,U]=r.useState(!1),[W,_]=r.useState(!1),[q,F]=r.useState(b),[V,Y]=r.useState(b),[K,G]=r.useState(g),[X,J]=r.useState(v),Z=r.useRef(null),Q=r.useRef(null),ee=r.useRef(null),et=r.useRef(null),er=r.useRef(null),ea=r.useRef(null),en=r.useRef(null),es=r.useRef(null),eo=r.useRef(0),ei=r.useRef(0),el=r.useRef(0),ed=r.useRef(0),ec=r.useRef("vertical"),eu=r.useRef(x),eh=r.useRef(null);function ef(e){let t=e?H:O;t(!0),(e?M:I).start(500,()=>{t(!1)})}let ep=(0,a.useStableCallback)(e=>{let t=e.x-eu.current.x,r=e.y-eu.current.y;eu.current=e,0!==r&&ef(!0),0!==t&&ef(!1)}),em=(0,a.useStableCallback)(()=>{let e=Q.current;e&&null===eh.current&&(eh.current=e.style.scrollSnapType,e.style.scrollSnapType="none")}),ex=(0,a.useStableCallback)(e=>{if(0!==e.button)return;if(null!==es.current){let e="vertical"===ec.current?er.current:ea.current;if(e?.hasPointerCapture(es.current))return}es.current=e.pointerId,eo.current=e.clientY,ei.current=e.clientX,ec.current=e.currentTarget.getAttribute("data-orientation");let t=Q.current;t&&(el.current=t.scrollTop,ed.current=t.scrollLeft,em());let r="vertical"===ec.current?er.current:ea.current;r?.setPointerCapture(e.pointerId)}),eb=(0,a.useStableCallback)(e=>{if(e.pointerId!==es.current)return;es.current=null,("vertical"===ec.current?H:O)(!1),null!==eh.current&&(Q.current&&(Q.current.style.scrollSnapType=eh.current),eh.current=null);let t="vertical"===ec.current?er.current:ea.current;t?.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}),eg=(0,a.useStableCallback)(e=>{if(e.pointerId!==es.current)return;if(e.buttons%2==0)return void eb(e);let t=Q.current;if(!t)return;let r="vertical"===ec.current,a=r?er.current:ea.current,n=r?ee.current:et.current;if(!a||!n)return;let s=r?"y":"x",o=d(n,"padding",s),i=d(a,"margin",s),l=r?a.offsetHeight:a.offsetWidth,c=(r?n.offsetHeight:n.offsetWidth)-l-o-i,u=r?e.clientY-eo.current:e.clientX-ei.current,h=r?t.scrollHeight:t.scrollWidth,f=r?t.clientHeight:t.clientWidth,p=(r?el.current:ed.current)+(c<=0?0:u/c)*(h-f);r?t.scrollTop=p:t.scrollLeft=p,e.preventDefault(),ef(r)});function ev(e){U("touch"===e.pointerType)}function ey(e){ev(e),"touch"!==e.pointerType&&P((0,p.contains)(Z.current,e.target))}let ej=r.useMemo(()=>({scrolling:D||z,hasOverflowX:!X.x,hasOverflowY:!X.y,overflowXStart:K.xStart,overflowXEnd:K.xEnd,overflowYStart:K.yStart,overflowYEnd:K.yEnd,cornerHidden:X.corner}),[D,z,X.x,X.y,X.corner,K]),ew={role:"presentation",onPointerEnter:ey,onPointerMove:ey,onPointerDown:ev,onPointerLeave(){P(!1)},style:{position:"relative","--scroll-area-corner-height":`${q.height}px`,"--scroll-area-corner-width":`${q.width}px`}},ek=(0,l.useRenderElement)("div",e,{state:ej,ref:[s,Z],props:[ew,N],stateAttributesMapping:f}),eN=r.useMemo(()=>({handlePointerDown:ex,handlePointerMove:eg,handlePointerUp:eb,handleScroll:ep,disableViewportSnap:em,cornerSize:q,setCornerSize:F,thumbSize:V,setThumbSize:Y,hasMeasuredScrollbar:W,setHasMeasuredScrollbar:_,touchModality:B,cornerRef:en,scrollingX:D,scrollingY:z,hovering:$,setHovering:P,viewportRef:Q,scrollbarYRef:ee,scrollbarXRef:et,thumbYRef:er,thumbXRef:ea,rootId:E,hiddenState:X,setHiddenState:J,overflowEdges:K,setOverflowEdges:G,viewportState:ej,overflowEdgeThreshold:{xStart:S,xEnd:C,yStart:T,yEnd:R}}),[ex,eg,eb,ep,em,q,V,W,B,D,z,$,E,X,K,ej,S,C,T,R]);return(0,t.jsxs)(o.Provider,{value:eN,children:[!L&&c.styleDisableScrollbar.getElement(A),ek]})});var j=e.i(61362),w=e.i(33858);let k=r.createContext(void 0);var N=e.i(21023),S=e.i(91338),C=e.i(98934);let T=["--scroll-area-overflow-x-start","--scroll-area-overflow-x-end","--scroll-area-overflow-y-start","--scroll-area-overflow-y-end"],R=!1,E=r.forwardRef(function(e,s){let{render:o,className:u,style:h,...p}=e,{viewportRef:m,scrollbarYRef:x,scrollbarXRef:b,thumbYRef:g,thumbXRef:v,cornerRef:y,cornerSize:S,setCornerSize:E,setThumbSize:A,rootId:L,setHiddenState:$,hiddenState:P,setHasMeasuredScrollbar:D,handleScroll:O,touchModality:z,setHovering:H,setOverflowEdges:B,overflowEdgeThreshold:U,viewportState:W}=i(),_=(0,N.useDirection)(),q=r.useRef(!0),F=r.useRef([NaN,NaN,NaN,NaN]),V=(0,n.useTimeout)(),Y=(0,n.useTimeout)(),K=(0,a.useStableCallback)(()=>{var e;let t,r,a=m.current,n=x.current,s=b.current,o=g.current,i=v.current,l=y.current;if(!a)return;let c=a.scrollHeight,u=a.scrollWidth,h=a.clientHeight,f=a.clientWidth,p=a.scrollTop,j=a.scrollLeft,w=F.current,k=Number.isNaN(w[0]);if(w[0]=h,w[1]=c,w[2]=f,w[3]=u,k&&D(!0),0===c||0===u)return;let N=(t=(e=a).clientHeight>=e.scrollHeight,{y:t,x:r=e.clientWidth>=e.scrollWidth,corner:t||r}),R=N.y,L=N.x,P=f/u,O=h/c,z=Math.max(0,u-f),H=Math.max(0,c-h),W=0,q=0;L||(W=(0,C.normalizeScrollOffset)("rtl"===_?-j:j,z),q=z-W);let V=R?0:(0,C.normalizeScrollOffset)(p,H),Y=R?0:H-V,K=L?0:f,G=R?0:h,X=0,J=0;L||R||(X=n?.offsetWidth||0,J=s?.offsetHeight||0);let Z=0===S.width&&0===S.height,Q=Z?X:0,ee=Z?J:0,et=d(s,"padding","x"),er=d(n,"padding","y"),ea=d(i,"margin","x"),en=d(o,"margin","y"),es=K-et-ea,eo=G-er-en,ei=s?Math.min(s.offsetWidth-Q,es):es,el=n?Math.min(n.offsetHeight-ee,eo):eo,ed=Math.max(16,ei*P),ec=Math.max(16,el*O);if(A(e=>M(e,{width:ed,height:ec})),n&&o){let e=n.offsetHeight-ec-er-en,t=I(o,"--scroll-area-thumb-height",p,H,c,ec,e);o.style.transform=`translate3d(0,${t}px,0)`}if(s&&i){let e=s.offsetWidth-ed-et-ea,t=I(i,"--scroll-area-thumb-width","rtl"===_?-j:j,z,u,ed,e);i.style.transform=`translate3d(${"rtl"===_?-t:t}px,0,0)`}let eu=[W,q,V,Y];T.forEach((e,t)=>{a.style.setProperty(e,`${eu[t]}px`)}),l&&E(e=>M(e,{width:X,height:J})),$(e=>M(e,N));let eh={xStart:!L&&W>U.xStart,xEnd:!L&&q>U.xEnd,yStart:!R&&V>U.yStart,yEnd:!R&&Y>U.yEnd};B(e=>M(e,eh))});function G(){q.current=!1}(0,j.useIsoLayoutEffect)(()=>{R||w.platform.engine.webkit||("u">typeof CSS&&"registerProperty"in CSS&&T.forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),R=!0)},[]),(0,j.useIsoLayoutEffect)(()=>{queueMicrotask(K)},[K,P,_,U.xStart,U.xEnd,U.yStart,U.yEnd]),(0,j.useIsoLayoutEffect)(()=>{m.current?.matches(":hover")&&H(!0)},[m,H]),(0,j.useIsoLayoutEffect)(()=>{let e=m.current;if("u"<typeof ResizeObserver||!e)return;let t=!1,r=new ResizeObserver(()=>{if(!t){t=!0;let r=F.current;if(r[0]===e.clientHeight&&r[1]===e.scrollHeight&&r[2]===e.clientWidth&&r[3]===e.scrollWidth)return}K()});return r.observe(e),Y.start(0,()=>{let t=e.getAnimations({subtree:!0});0!==t.length&&Promise.allSettled(t.map(e=>e.finished)).then(K).catch(()=>{})}),()=>{r.disconnect(),Y.clear()}},[K,m,Y]);let X={role:"presentation",...L&&{"data-id":`${L}-viewport`},tabIndex:P.x&&P.y?-1:0,className:c.styleDisableScrollbar.className,style:{overflow:"scroll"},onScroll(){m.current&&(K(),(z||!q.current)&&O({x:m.current.scrollLeft,y:m.current.scrollTop}),V.start(100,()=>{q.current=!0}))},onWheel:G,onPointerMove:G,onPointerEnter:G,onKeyDown:G},J=(0,l.useRenderElement)("div",e,{ref:[s,m],state:W,props:[X,p],stateAttributesMapping:f}),Z=r.useMemo(()=>({computeThumbPosition:K}),[K]);return(0,t.jsx)(k.Provider,{value:Z,children:J})});function M(e,t){for(let r in t)if(e[r]!==t[r])return t;return e}function I(e,t,r,a,n,s,o){let i=(0,S.clamp)(r,0,a),l=r-i,d=Math.max(16,s*n/(n+Math.abs(l)));return e.style.setProperty(t,l?`${d}px`:""),(a?i/a*o:0)+(l>0?s-d:0)}var A=e.i(78645);let L=r.createContext(void 0),$=r.forwardRef(function(e,a){let{render:n,className:s,orientation:o="vertical",keepMounted:c=!1,style:u,...h}=e,{hovering:m,scrollingX:x,scrollingY:b,hiddenState:g,scrollbarYRef:v,scrollbarXRef:y,viewportRef:j,thumbYRef:w,thumbXRef:k,handlePointerDown:S,handlePointerUp:C,handleScroll:T,disableViewportSnap:R,rootId:E,thumbSize:M,hasMeasuredScrollbar:I,viewportState:$}=i(),P="vertical"===o,D={...$,hovering:m,scrolling:P?b:x,orientation:o},O=(0,N.useDirection)(),z=!I&&!c,H=P?g.y:g.x,B=c||!H;r.useEffect(()=>{if(!B)return;let e=j.current,t=P?v.current:y.current;if(t)return(0,A.addEventListener)(t,"wheel",function(t){if(!e||t.ctrlKey)return;let r=!P,a=r?"scrollLeft":"scrollTop",n=r?t.deltaX:t.deltaY;if(0===n)return;let s=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,o=r&&"rtl"===O?-s:0,i=r&&"rtl"===O?0:s,l=e[a];l<=o&&n<0||l>=i&&n>0||(t.preventDefault(),e[a]=Math.min(i,Math.max(o,l+n)),T({x:e.scrollLeft,y:e.scrollTop}))},{passive:!1})},[O,T,P,y,v,B,j]);let U={...E&&{"data-id":`${E}-scrollbar`},onPointerDown(e){if(0!==e.button)return;let t=(0,p.getTarget)(e.nativeEvent),r=P?w.current:k.current;if(r&&(0,p.contains)(r,t))return;let a=j.current;if(!a)return;let n=P?v.current:y.current;if(!r||!n)return;let s=P?"y":"x",o=d(r,"margin",s),i=d(n,"padding",s),l=P?r.offsetHeight:r.offsetWidth,c=n.getBoundingClientRect(),u=P?e.clientY-c.top-l/2-i+o/2:e.clientX-c.left-l/2-i+o/2,h=P?a.scrollHeight:a.scrollWidth,f=P?a.clientHeight:a.clientWidth,m=(P?n.offsetHeight:n.offsetWidth)-l-i-o;if(m<=0)return;let x=u/m,b=h-f;R(),P?a.scrollTop=x*b:"rtl"===O?a.scrollLeft=-(1-x)*b:a.scrollLeft=x*b,T({x:a.scrollLeft,y:a.scrollTop}),S(e)},onPointerUp:C,onPointerCancel:C,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",visibility:z?"hidden":void 0,...P?{top:0,bottom:"var(--scroll-area-corner-height)",insetInlineEnd:0,"--scroll-area-thumb-height":`${M.height}px`}:{insetInlineStart:0,insetInlineEnd:"var(--scroll-area-corner-width)",bottom:0,"--scroll-area-thumb-width":`${M.width}px`}}},W=(0,l.useRenderElement)("div",e,{ref:[a,P?v:y],state:D,props:[U,h],stateAttributesMapping:f});return B?(0,t.jsx)(L.Provider,{value:o,children:W}):null}),P=r.forwardRef(function(e,t){let{render:a,className:n,style:o,...d}=e,{computeThumbPosition:c}=function(){let e=r.useContext(k);if(void 0===e)throw Error((0,s.default)(55));return e}(),{hasMeasuredScrollbar:u,viewportState:h}=i(),p=r.useRef(null),m=r.useRef(u);return(0,j.useIsoLayoutEffect)(()=>{if("u"<typeof ResizeObserver)return;let e=!1,t=new ResizeObserver(()=>{(e||(e=!0,m.current))&&c()});return p.current&&t.observe(p.current),()=>{t.disconnect()}},[c]),(0,l.useRenderElement)("div",e,{ref:[t,p],state:h,stateAttributesMapping:f,props:[{role:"presentation",style:{minWidth:"fit-content"}},d]})}),D=r.forwardRef(function(e,t){let{render:a,className:n,style:o,...d}=e,{thumbYRef:c,thumbXRef:u,handlePointerDown:h,handlePointerMove:f,handlePointerUp:p,scrollingX:m,scrollingY:x,hasMeasuredScrollbar:b}=i(),g=function(){let e=r.useContext(L);if(void 0===e)throw Error((0,s.default)(54));return e}(),v="vertical"===g;return(0,l.useRenderElement)("div",e,{ref:[t,v?c:u],state:{scrolling:v?x:m,orientation:g},props:[{onPointerDown:h,onPointerMove:f,onPointerUp:p,onPointerCancel:p,style:{visibility:b?void 0:"hidden",...v?{height:"var(--scroll-area-thumb-height)"}:{width:"var(--scroll-area-thumb-width)"}}},d]})}),O=r.forwardRef(function(e,t){let{render:r,className:a,style:n,...s}=e,{cornerRef:o,cornerSize:d,hiddenState:c}=i(),u=(0,l.useRenderElement)("div",e,{ref:[t,o],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:d.width,height:d.height}},s]});return c.corner?null:u});e.s(["Content",0,P,"Corner",0,O,"Root",0,y,"Scrollbar",0,$,"Thumb",0,D,"Viewport",0,E],55500);var z=e.i(55500),z=z,H=e.i(75157);function B({className:e,orientation:r="vertical",...a}){return(0,t.jsx)(z.Scrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":r,orientation:r,className:(0,H.cn)("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",e),...a,children:(0,t.jsx)(z.Thumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}e.s(["ScrollArea",0,function({className:e,children:r,...a}){return(0,t.jsxs)(z.Root,{"data-slot":"scroll-area",className:(0,H.cn)("relative",e),...a,children:[(0,t.jsx)(z.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:r}),(0,t.jsx)(B,{}),(0,t.jsx)(z.Corner,{})]})}],59684);var U=e.i(250),U=U;let W=(0,e.i(13496).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var _=e.i(98007),q=e.i(19455),F=e.i(46798);e.s(["CopyButton",0,function({value:e,label:a="Copy",size:n="xs",icon:s=W,className:o,children:i}){let[l,d]=(0,r.useState)("idle"),c=(0,r.useRef)(void 0);async function u(){try{await navigator.clipboard.writeText("function"==typeof e?e():e),d("copied")}catch{d("failed")}window.clearTimeout(c.current),c.current=window.setTimeout(()=>d("idle"),1600)}(0,r.useEffect)(()=>()=>window.clearTimeout(c.current),[]);let h="copied"===l?U.default:"failed"===l?_.X:s;return(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{render:(0,t.jsxs)(q.Button,{variant:"ghost",size:i?n:`icon-${n}`,onClick:u,"aria-label":a,className:(0,H.cn)("text-muted-foreground","copied"===l&&"text-emerald-600 dark:text-emerald-400","failed"===l&&"text-destructive",o),children:[(0,t.jsx)(h,{className:"size-3.5","aria-hidden":!0}),i]})}),(0,t.jsx)(F.TooltipContent,{children:"copied"===l?"Copied":"failed"===l?"Copy failed":a})]})}],34960)},84774,e=>{"use strict";var t=e.i(45650),r=e.i(75157);e.s(["Table",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,t.jsx)("table",{"data-slot":"table",className:(0,r.cn)("w-full caption-bottom text-sm",e),...a})})},"TableBody",0,function({className:e,...a}){return(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,r.cn)("[&_tr:last-child]:border-0",e),...a})},"TableCell",0,function({className:e,...a}){return(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,r.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...a})},"TableFooter",0,function({className:e,...a}){return(0,t.jsx)("tfoot",{"data-slot":"table-footer",className:(0,r.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...a})},"TableHead",0,function({className:e,...a}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,r.cn)("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",e),...a})},"TableHeader",0,function({className:e,...a}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,r.cn)("[&_tr]:border-b",e),...a})},"TableRow",0,function({className:e,...a}){return(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,r.cn)("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...a})}])},77572,e=>{"use strict";var t,r=e.i(45650);e.s([],25931),e.i(25931);var a=e.i(10364),n=e.i(25587),s=e.i(61362),o=e.i(19458),i=e.i(50403),l=e.i(6385),d=e.i(82420);let c=a.createContext(void 0);function u(){let e=a.useContext(c);if(void 0===e)throw Error((0,d.default)(64));return e}let h={tabActivationDirection:e=>({"data-activation-direction":e})};var f=e.i(51068),p=e.i(99389);let m=a.forwardRef(function(e,t){let{className:d,defaultValue:u=0,onValueChange:m,orientation:g="horizontal",render:v,value:y,style:j,...w}=e,k=void 0!==e.defaultValue,N=a.useRef([]),[S,C]=a.useState(()=>new Map),[T,R]=(0,n.useControlled)({controlled:y,default:u,name:"Tabs",state:"value"}),E=void 0!==y,[M,I]=a.useState(()=>new Map),A=a.useRef(void 0),L=a.useCallback(e=>x(M,e),[M]),[$,P]=a.useState(()=>({previousValue:T,tabActivationDirection:"none"})),{previousValue:D,tabActivationDirection:O}=$,z=O,H=!1;D!==T&&(z=b(D,T,g,M),H=null!=D&&null!=T&&null==L(T));let B=H?D:T,U=D!==B||O!==z;(0,s.useIsoLayoutEffect)(()=>{U&&P({previousValue:B,tabActivationDirection:z})},[B,U,z]);let W=(0,o.useStableCallback)((e,t)=>{t.activationDirection=b(T,e,g,M),m?.(e,t),t.isCanceled||R(e)}),_=(0,o.useStableCallback)((e,t)=>{m?.(e,(0,f.createChangeEventDetails)(t,void 0,void 0,{activationDirection:"none"}))}),q=(0,o.useStableCallback)((e,t)=>(C(r=>{let a=new Map(r);return a.set(e,t),a}),()=>{C(r=>{if(r.get(e)!==t)return r;let a=new Map(r);return a.delete(e),a})})),F=a.useCallback(e=>S.get(e),[S]),V=a.useCallback(e=>{for(let t of M.values())if(e===t.value)return t.id},[M]),Y=a.useMemo(()=>({getTabElementBySelectedValue:L,getTabIdByPanelValue:V,getTabPanelIdByValue:F,onValueChange:W,orientation:g,registerMountedTabPanel:q,setTabMap:I,tabActivationDirection:z,value:T}),[L,V,F,W,g,q,I,z,T]),K=a.useMemo(()=>{for(let e of M.values())if(e.value===T)return e},[M,T]),G=a.useMemo(()=>{for(let e of M.values())if(!e.disabled)return e.value},[M]),X=a.useRef(!k),J=a.useRef(u),Z=a.useRef(k),Q=a.useRef(!1);(0,s.useIsoLayoutEffect)(()=>{if(E)return;function e(e,t){R(e),P({previousValue:e,tabActivationDirection:"none"}),_(e,t),X.current=!1}if(0===M.size){Q.current&&null!==T&&!A.current?.isConnected&&e(null,p.REASONS.missing);return}Q.current=!0,A.current=M.keys().next().value;let t=K?.disabled,r=null==K&&null!==T;if(t||T!==J.current||(Z.current=!1),Z.current&&t&&T===J.current)return;let a=X.current;if(t||r){let r=G??null;if(T===r){X.current=!1;return}let n=p.REASONS.missing;a?n=p.REASONS.initial:t&&(n=p.REASONS.disabled),e(r,n);return}a&&null!=K&&(_(T,p.REASONS.initial),X.current=!1)},[G,E,_,K,R,M,T]);let ee={orientation:g,tabActivationDirection:z},et=(0,i.useRenderElement)("div",e,{state:ee,ref:t,props:w,stateAttributesMapping:h});return(0,r.jsx)(c.Provider,{value:Y,children:(0,r.jsx)(l.CompositeList,{elementsRef:N,children:et})})});function x(e,t){for(let[r,a]of e.entries())if(t===a.value)return r;return null}function b(e,t,r,a){if(null==e||null==t)return"none";let[n,s,o]="horizontal"===r?["left","left","right"]:["top","up","down"],i=x(a,e),l=x(a,t);if(null==i||null==l)return i!==l&&("number"==typeof e||"string"==typeof e)&&typeof e==typeof t?t>e?o:s:"none";let d=i.getBoundingClientRect()[n],c=l.getBoundingClientRect()[n];return c<d?s:c>d?o:"none"}var g=e.i(52515),v=e.i(99281),y=e.i(45034),j=e.i(93901),w=e.i(1788),k=e.i(60857);let N=a.createContext(void 0);function S(){let e=a.useContext(N);if(void 0===e)throw Error((0,d.default)(65));return e}var C=e.i(29148);let T=a.forwardRef(function(e,t){let{className:r,disabled:n=!1,render:l,value:d,id:c,nativeButton:m=!0,style:x,...b}=e,{value:N,getTabPanelIdByValue:T,onValueChange:R,orientation:E,tabActivationDirection:M}=u(),{activateOnFocus:I,registerTabResizeObserverElement:A,tabsListElement:L}=S(),{highlightedIndex:$,onHighlightedIndexChange:P}=(0,k.useCompositeRootContext)(),D=(0,v.useBaseUiId)(c),O=a.useMemo(()=>({disabled:n,id:D,value:d}),[n,D,d]),{compositeProps:z,compositeRef:H,index:B}=(0,w.useCompositeItem)({metadata:O}),U=d===N,W=a.useRef(!1),_=a.useRef(null),q=(0,o.useStableCallback)(e=>{_.current?.(),_.current=e?A(e):null});(0,s.useIsoLayoutEffect)(()=>{if(W.current){W.current=!1;return}if(U&&B>-1&&$!==B){if(null!=L){let e=(0,C.activeElement)((0,g.ownerDocument)(L));if(e&&(0,C.contains)(L,e))return}n||P(B)}},[U,B,$,P,n,L]);let{getButtonProps:F,buttonRef:V}=(0,y.useButton)({disabled:n,native:m,focusableWhenDisabled:!0}),Y=T(d),K=a.useRef(!1),G=a.useRef(!1);function X(e){R(d,(0,f.createChangeEventDetails)(p.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"}))}return(0,i.useRenderElement)("button",e,{state:{disabled:n,active:U,orientation:E,tabActivationDirection:M},ref:[t,V,H,q],props:[z,{role:"tab","aria-controls":Y,"aria-selected":U,id:D,onClick:function(e){U||n||X(e)},onFocus:function(e){U||n||I&&(!K.current||G.current)&&X(e)},onPointerDown:function(e){if(U||n)return;K.current=!0,G.current=0===e.button;let t=(0,g.ownerDocument)(e.currentTarget);function r(){K.current=!1,G.current=!1,t.removeEventListener("pointerup",r),t.removeEventListener("pointercancel",r)}t.addEventListener("pointerup",r),t.addEventListener("pointercancel",r)},[j.ACTIVE_COMPOSITE_ITEM]:U?"":void 0,onKeyDownCapture(){W.current=!0}},b,F],stateAttributesMapping:h})});var R=e.i(16428),E=e.i(45549),M=e.i(53076);function I(){return M.NOOP}function A(){return!1}function L(){return!0}var $=e.i(63370);function P(e){let{script:t}=e,{nonce:a}=(0,$.useCSPContext)();return(0,E.useSyncExternalStore)(I,A,L)?(0,r.jsx)("script",{nonce:a,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}let D={...h,activeTabPosition:()=>null,activeTabSize:()=>null},O=a.forwardRef(function(e,n){let{className:s,render:o,renderBeforeHydration:l=!1,style:d,...c}=e,{getTabElementBySelectedValue:h,orientation:f,tabActivationDirection:p,value:m}=u(),{tabsListElement:x,registerIndicatorUpdateListener:b}=S(),g=function(){let[,e]=a.useState({});return a.useCallback(()=>{e({})},[])}();a.useEffect(()=>b(g),[b,g]);let v=0,y=0,j=0,w=0,k=0,N=0,C=!1;if(null!=m&&null!=x){let e=h(m);if(null!=e){C=!0;let{width:t,height:r}=(0,R.getCssDimensions)(e),{width:a,height:n}=(0,R.getCssDimensions)(x),s=e.getBoundingClientRect(),o=x.getBoundingClientRect(),i=a>0?o.width/a:1,l=n>0?o.height/n:1;if(i>Number.EPSILON&&l>Number.EPSILON){let e=s.left-o.left,t=s.top-o.top;v=e/i+x.scrollLeft-x.clientLeft,j=t/l+x.scrollTop-x.clientTop}else v=e.offsetLeft,j=e.offsetTop;k=t,N=r,y=x.scrollWidth-v-k,w=x.scrollHeight-j-N}}let T=C?{left:v,right:y,top:j,bottom:w}:null,E=C?{width:k,height:N}:null,M=C?{"--active-tab-left":`${v}px`,"--active-tab-right":`${y}px`,"--active-tab-top":`${j}px`,"--active-tab-bottom":`${w}px`,"--active-tab-width":`${k}px`,"--active-tab-height":`${N}px`}:void 0,I=C&&k>0&&N>0,A=(0,i.useRenderElement)("span",e,{state:{orientation:f,activeTabPosition:T,activeTabSize:E,tabActivationDirection:p},ref:n,props:[{role:"presentation",style:M,hidden:!I},c,{suppressHydrationWarning:!0}],stateAttributesMapping:D});return null==m?null:(0,r.jsxs)(a.Fragment,{children:[A,l&&(t||(t=(0,r.jsx)(P,{script:""})))]})});var z=e.i(33262),H=e.i(53),B=e.i(11296),U=e.i(4678),W=e.i(68285);let _={...h,...H.transitionStatusMapping},q=a.forwardRef(function(e,t){let{className:r,value:n,render:o,keepMounted:l=!1,style:d,...c}=e,{value:h,getTabIdByPanelValue:f,orientation:p,tabActivationDirection:m,registerMountedTabPanel:x}=u(),b=(0,v.useBaseUiId)(),{ref:g,index:y}=(0,W.useCompositeListItem)(),j=n===h,{mounted:w,transitionStatus:k,setMounted:N}=(0,U.useTransitionStatus)(j),S=!w,C=f(n),T=a.useRef(null),R=(0,i.useRenderElement)("div",e,{state:{hidden:S,orientation:p,tabActivationDirection:m,transitionStatus:k},ref:[t,g,T],props:[{"aria-labelledby":C,hidden:S,id:b,role:"tabpanel",tabIndex:j?0:-1,inert:(0,z.inertValue)(!j),"data-index":y},c],stateAttributesMapping:_});return((0,B.useOpenChangeComplete)({open:j,ref:T,onComplete(){j||N(!1)}}),(0,s.useIsoLayoutEffect)(()=>{if(null!=b&&(!S||l))return x(n,b)},[S,l,n,b,x]),l||w)?R:null});var F=e.i(67149);let V=a.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:i,loopFocus:l=!0,render:d,style:c,...f}=e,{orientation:p,setTabMap:m,tabActivationDirection:x}=u(),[b,g]=a.useState(0),[v,y]=a.useState(null),j=a.useRef(new Set),w=a.useRef(new Set),k=a.useRef(null);(0,s.useIsoLayoutEffect)(()=>{if("u"<typeof ResizeObserver)return;let e=new ResizeObserver(()=>{j.current.forEach(e=>{e()})});return k.current=e,v&&e.observe(v),w.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),k.current=null}},[v]);let S=(0,o.useStableCallback)(e=>(j.current.add(e),()=>{j.current.delete(e)})),C=(0,o.useStableCallback)(e=>(w.current.add(e),k.current?.observe(e),()=>{w.current.delete(e),k.current?.unobserve(e)})),T=a.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:S,registerTabResizeObserverElement:C,tabsListElement:v}),[n,S,C,v]);return(0,r.jsx)(N.Provider,{value:T,children:(0,r.jsx)(F.CompositeRoot,{render:d,className:i,style:c,state:{orientation:p,tabActivationDirection:x},refs:[t,y],props:[{"aria-orientation":"vertical"===p?"vertical":void 0,role:"tablist"},f],stateAttributesMapping:h,highlightedIndex:b,enableHomeAndEndKeys:!0,loopFocus:l,orientation:p,onHighlightedIndexChange:g,onMapChange:m,disabledIndices:M.EMPTY_ARRAY})})});e.s(["Indicator",0,O,"List",0,V,"Panel",0,q,"Root",0,m,"Tab",0,T],11037);var Y=e.i(11037),Y=Y,K=e.i(94237),G=e.i(75157);let X=(0,K.cva)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});e.s(["Tabs",0,function({className:e,orientation:t="horizontal",...a}){return(0,r.jsx)(Y.Root,{"data-slot":"tabs","data-orientation":t,className:(0,G.cn)("group/tabs flex gap-2 data-horizontal:flex-col",e),...a})},"TabsContent",0,function({className:e,...t}){return(0,r.jsx)(Y.Panel,{"data-slot":"tabs-content",className:(0,G.cn)("flex-1 text-sm outline-none",e),...t})},"TabsList",0,function({className:e,variant:t="default",...a}){return(0,r.jsx)(Y.List,{"data-slot":"tabs-list","data-variant":t,className:(0,G.cn)(X({variant:t}),e),...a})},"TabsTrigger",0,function({className:e,...t}){return(0,r.jsx)(Y.Tab,{"data-slot":"tabs-trigger",className:(0,G.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}],77572)},42526,e=>{"use strict";var t=e.i(10364),r=e.i(57864);function a(e,a){return[(0,r.useSearchParams)().get(e)??a,(0,t.useCallback)(t=>{let r=new URL(window.location.href);t===a?r.searchParams.delete(e):r.searchParams.set(e,t),window.history.replaceState(null,"",r)},[e,a])]}e.s(["useQueryParam",0,a,"useTabParam",0,function(e,t){let[r,n]=a("tab",t);return[e.includes(r)?r:t,n]}])}]);
|
package/app/CONTRIBUTING.md
CHANGED
package/app/Dockerfile
CHANGED
package/app/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Run it with [Node.js](https://nodejs.org) 22.13 or newer, nothing to install:
|
|
|
32
32
|
npx agent-session-inspector
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
It serves on [http://localhost:
|
|
35
|
+
It serves on [http://localhost:4747](http://localhost:4747) (or the next free
|
|
36
36
|
port), bound to `127.0.0.1` only, and opens your browser. `--port`, `--host` and
|
|
37
37
|
`--no-open` change that; `--help` lists everything.
|
|
38
38
|
|
|
@@ -33,7 +33,7 @@ Commands:
|
|
|
33
33
|
Run a command with --help for its options.
|
|
34
34
|
|
|
35
35
|
Options:
|
|
36
|
-
-p, --port <port> Port to listen on (default:
|
|
36
|
+
-p, --port <port> Port to listen on (default: 4747, or the next free one)
|
|
37
37
|
-H, --host <host> Interface to bind (default: 127.0.0.1)
|
|
38
38
|
--no-open Don't open the browser
|
|
39
39
|
-v, --version Print the version
|
|
@@ -165,7 +165,7 @@ if (!existsSync(SERVER)) {
|
|
|
165
165
|
|
|
166
166
|
let port = opts.port;
|
|
167
167
|
if (port === null) {
|
|
168
|
-
port = await pickPort(Number(process.env.PORT) ||
|
|
168
|
+
port = await pickPort(Number(process.env.PORT) || 4747, opts.host);
|
|
169
169
|
} else if (!(await isFree(port, opts.host))) {
|
|
170
170
|
fail(`port ${port} is already in use`);
|
|
171
171
|
}
|
package/app/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-session-inspector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "See where a coding-agent session's tokens and dollars went: a local inspector for Claude Code, Codex, GitHub Copilot, Cursor, Gemini CLI, OpenCode and Hermes sessions, with a step-by-step timeline, per-step cost and analytics.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"private": true,
|
|
37
37
|
"scripts": {
|
|
38
|
-
"dev": "next dev",
|
|
38
|
+
"dev": "next dev -p 4747",
|
|
39
39
|
"build": "next build",
|
|
40
|
-
"start": "next start",
|
|
40
|
+
"start": "next start -p 4747",
|
|
41
41
|
"lint": "eslint",
|
|
42
42
|
"cli": "node scripts/build-cli.mjs && node bin/agent-session-inspector.mjs",
|
|
43
43
|
"deploy:docker": "./scripts/deploy-docker.sh",
|
package/app/server.js
CHANGED
|
@@ -9,7 +9,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
|
|
|
9
9
|
const hostname = process.env.HOSTNAME || '0.0.0.0'
|
|
10
10
|
|
|
11
11
|
let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
|
|
12
|
-
const nextConfig = {"env":{"APP_VERSION":"0.1.
|
|
12
|
+
const nextConfig = {"env":{"APP_VERSION":"0.1.10"},"webpack":null,"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"instrumentationClientInject":[],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/home/runner/work/agent-session-inspector/agent-session-inspector","enablePrerenderSourceMaps":true,"cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":true,"coldCacheBadge":false,"devValidationWorker":true,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"dynamicOnHover":false,"useOffline":false,"varyParams":true,"optimisticRouting":true,"instrumentationClientRouterTransitionEvents":false,"prefetchInlining":{"maxSize":2048,"maxBundleSize":10240},"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":3,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptOperationCache":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"devMemoryThresholdRestart":true,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"requestInsights":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"useTypeScriptCli":true,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":true,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"serverComponentsHmrCancellation":false,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":true,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","turbopackMemoryEvictionMode":"auto","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"useCacheTimeout":54,"instantInsights":{"validationLevel":"warning"},"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","outputFileTracingExcludes":{"/**":["./.git/**","./.claude/**","./src/**"]},"repoRoot":"/home/runner/work/agent-session-inspector/agent-session-inspector","turbopack":{"root":"/home/runner/work/agent-session-inspector/agent-session-inspector"},"distDirRoot":".next"}
|
|
13
13
|
|
|
14
14
|
process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
|
|
15
15
|
|
|
@@ -33,7 +33,7 @@ Commands:
|
|
|
33
33
|
Run a command with --help for its options.
|
|
34
34
|
|
|
35
35
|
Options:
|
|
36
|
-
-p, --port <port> Port to listen on (default:
|
|
36
|
+
-p, --port <port> Port to listen on (default: 4747, or the next free one)
|
|
37
37
|
-H, --host <host> Interface to bind (default: 127.0.0.1)
|
|
38
38
|
--no-open Don't open the browser
|
|
39
39
|
-v, --version Print the version
|
|
@@ -165,7 +165,7 @@ if (!existsSync(SERVER)) {
|
|
|
165
165
|
|
|
166
166
|
let port = opts.port;
|
|
167
167
|
if (port === null) {
|
|
168
|
-
port = await pickPort(Number(process.env.PORT) ||
|
|
168
|
+
port = await pickPort(Number(process.env.PORT) || 4747, opts.host);
|
|
169
169
|
} else if (!(await isFree(port, opts.host))) {
|
|
170
170
|
fail(`port ${port} is already in use`);
|
|
171
171
|
}
|
package/cli/cli.mjs
CHANGED
|
@@ -3520,23 +3520,33 @@ function normalizeTable(raw) {
|
|
|
3520
3520
|
return table2;
|
|
3521
3521
|
}
|
|
3522
3522
|
var BUNDLED = normalizeTable(prices_default);
|
|
3523
|
-
var
|
|
3523
|
+
var loadPrices = createFileCache((filePath) => {
|
|
3524
3524
|
const content = safeReadFile(filePath);
|
|
3525
|
-
if (!content) return BUNDLED;
|
|
3525
|
+
if (!content) return { table: BUNDLED, custom: /* @__PURE__ */ new Set() };
|
|
3526
3526
|
try {
|
|
3527
|
-
|
|
3527
|
+
const overrides = normalizeTable(JSON.parse(content));
|
|
3528
|
+
return { table: { ...BUNDLED, ...overrides }, custom: new Set(Object.keys(overrides)) };
|
|
3528
3529
|
} catch {
|
|
3529
|
-
return BUNDLED;
|
|
3530
|
+
return { table: BUNDLED, custom: /* @__PURE__ */ new Set() };
|
|
3530
3531
|
}
|
|
3531
3532
|
});
|
|
3533
|
+
var loadTable = (filePath) => loadPrices(filePath).table;
|
|
3532
3534
|
var SNAPSHOT_SUFFIX = /-(\d{8}|\d{4}-\d{2}-\d{2}|latest)$/;
|
|
3533
3535
|
function normalizeModelId(model) {
|
|
3534
3536
|
const id = model.toLowerCase().replace(/\[.*\]$/, "").replace(/^.*\//, "").replace(/^([a-z]{2}\.)?anthropic\./, "");
|
|
3535
3537
|
return id.startsWith("claude") ? id.replace(/\./g, "-") : id;
|
|
3536
3538
|
}
|
|
3539
|
+
function overrideKeyOf(model) {
|
|
3540
|
+
return normalizeModelId(model).replace(SNAPSHOT_SUFFIX, "");
|
|
3541
|
+
}
|
|
3537
3542
|
function overridePathLabel() {
|
|
3538
3543
|
return PRICING_OVERRIDE_PATH.replace(os2.homedir(), "~");
|
|
3539
3544
|
}
|
|
3545
|
+
function priceKeyOf(model) {
|
|
3546
|
+
const { table: table2, custom } = loadPrices(PRICING_OVERRIDE_PATH);
|
|
3547
|
+
const key = resolveModel(model, table2);
|
|
3548
|
+
return { key: key ?? overrideKeyOf(model), custom: key !== null && custom.has(key) };
|
|
3549
|
+
}
|
|
3540
3550
|
function resolveModel(model, table2) {
|
|
3541
3551
|
if (!model) return null;
|
|
3542
3552
|
const id = normalizeModelId(model);
|
|
@@ -3645,12 +3655,16 @@ var CostAccumulator = class {
|
|
|
3645
3655
|
const byModel = [...this.models.values()].sort(
|
|
3646
3656
|
(a, b) => (b.costUSD ?? -1) - (a.costUSD ?? -1)
|
|
3647
3657
|
);
|
|
3648
|
-
const table2 =
|
|
3658
|
+
const { table: table2, custom } = loadPrices(PRICING_OVERRIDE_PATH);
|
|
3649
3659
|
const prices = {};
|
|
3660
|
+
const priceKeys = {};
|
|
3661
|
+
const customPriced = [];
|
|
3650
3662
|
for (const { model } of byModel) {
|
|
3651
3663
|
if (model === UNKNOWN_MODEL) continue;
|
|
3652
3664
|
const key = resolveModel(model, table2);
|
|
3653
3665
|
prices[key ?? normalizeModelId(model)] = key ? table2[key] : null;
|
|
3666
|
+
priceKeys[model] = key ?? overrideKeyOf(model);
|
|
3667
|
+
if (key && custom.has(key)) customPriced.push(model);
|
|
3654
3668
|
}
|
|
3655
3669
|
return {
|
|
3656
3670
|
totalUSD: byModel.reduce((sum, m) => sum + (m.costUSD ?? 0), 0),
|
|
@@ -3662,6 +3676,8 @@ var CostAccumulator = class {
|
|
|
3662
3676
|
)
|
|
3663
3677
|
),
|
|
3664
3678
|
prices,
|
|
3679
|
+
priceKeys,
|
|
3680
|
+
customPriced,
|
|
3665
3681
|
overridePath: overridePathLabel(),
|
|
3666
3682
|
unpricedModels: byModel.filter((m) => m.costUSD === null).map((m) => m.model)
|
|
3667
3683
|
};
|
|
@@ -3702,11 +3718,12 @@ function bucketUsage(events, inherited = false) {
|
|
|
3702
3718
|
return [...buckets.values()];
|
|
3703
3719
|
}
|
|
3704
3720
|
function priceBucket(bucket) {
|
|
3721
|
+
const lines = costOf(bucket, bucket.day || void 0);
|
|
3705
3722
|
let cost = null;
|
|
3706
|
-
for (const line of
|
|
3723
|
+
for (const line of lines) {
|
|
3707
3724
|
if (line.usd !== null) cost = (cost ?? 0) + line.usd;
|
|
3708
3725
|
}
|
|
3709
|
-
return cost;
|
|
3726
|
+
return { cost, lines };
|
|
3710
3727
|
}
|
|
3711
3728
|
function priceBuckets(buckets) {
|
|
3712
3729
|
if (!buckets || buckets.length === 0) return null;
|
|
@@ -6976,9 +6993,16 @@ function pricedActivity(meta) {
|
|
|
6976
6993
|
for (const slot of meta.activity ?? []) slots.set(slot.t, { ...slot });
|
|
6977
6994
|
const slices = /* @__PURE__ */ new Map();
|
|
6978
6995
|
const unpriced = /* @__PURE__ */ new Set();
|
|
6996
|
+
const priceKeys = {};
|
|
6997
|
+
const custom = /* @__PURE__ */ new Set();
|
|
6979
6998
|
for (const bucket of meta.usage ?? []) {
|
|
6980
6999
|
const model = bucket.model ?? "unknown";
|
|
6981
|
-
const cost = priceBucket(bucket);
|
|
7000
|
+
const { cost, lines } = priceBucket(bucket);
|
|
7001
|
+
if (bucket.model && !(model in priceKeys)) {
|
|
7002
|
+
const { key: key2, custom: isCustom } = priceKeyOf(model);
|
|
7003
|
+
priceKeys[model] = key2;
|
|
7004
|
+
if (isCustom) custom.add(model);
|
|
7005
|
+
}
|
|
6982
7006
|
if (cost === null) unpriced.add(model);
|
|
6983
7007
|
const slot = bucket.t === void 0 ? void 0 : slots.get(bucket.t);
|
|
6984
7008
|
if (!slot) continue;
|
|
@@ -6993,10 +7017,16 @@ function pricedActivity(meta) {
|
|
|
6993
7017
|
outputTokens: 0,
|
|
6994
7018
|
cacheReadTokens: 0,
|
|
6995
7019
|
cacheWriteTokens: 0,
|
|
6996
|
-
costUSD: cost === null ? null : 0
|
|
7020
|
+
costUSD: cost === null ? null : 0,
|
|
7021
|
+
lines: []
|
|
6997
7022
|
};
|
|
6998
7023
|
slices.set(key, slice);
|
|
6999
7024
|
}
|
|
7025
|
+
for (const line of lines) {
|
|
7026
|
+
const same = slice.lines.find((l) => l.kind === line.kind && l.rate === line.rate);
|
|
7027
|
+
if (same) same.tokens += line.tokens;
|
|
7028
|
+
else slice.lines.push({ kind: line.kind, tokens: line.tokens, rate: line.rate });
|
|
7029
|
+
}
|
|
7000
7030
|
slice.inputTokens += bucket.inputTokens;
|
|
7001
7031
|
slice.outputTokens += bucket.outputTokens;
|
|
7002
7032
|
slice.cacheReadTokens += bucket.cacheReadTokens ?? 0;
|
|
@@ -7006,7 +7036,9 @@ function pricedActivity(meta) {
|
|
|
7006
7036
|
return {
|
|
7007
7037
|
activity: [...slots.values()],
|
|
7008
7038
|
usage: [...slices.values()],
|
|
7009
|
-
unpricedModels: unpriced.size > 0 ? [...unpriced] : void 0
|
|
7039
|
+
unpricedModels: unpriced.size > 0 ? [...unpriced] : void 0,
|
|
7040
|
+
priceKeys,
|
|
7041
|
+
customPriced: custom.size > 0 ? [...custom] : void 0
|
|
7010
7042
|
};
|
|
7011
7043
|
}
|
|
7012
7044
|
function listAnalyticsSessions() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-session-inspector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "See where a coding-agent session's tokens and dollars went: a local inspector for Claude Code, Codex, GitHub Copilot, Cursor, Gemini CLI, OpenCode and Hermes sessions, with a step-by-step timeline, per-step cost and analytics.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[97428,a=>{"use strict";let b=(0,a.i(70627).default)("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]);a.s(["Bug",0,b],97428)},73946,a=>{"use strict";let b=(0,a.i(70627).default)("calendar-days",[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M12 13h.01",key:"y0uutt"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M8 17h.01",key:"p3bg7i"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M16 17h.01",key:"ql8jdd"}]]);a.s(["CalendarDays",0,b],73946)},80995,94687,a=>{"use strict";let b=(0,a.i(70627).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);a.s(["default",0,b],94687),a.s(["ChevronRight",0,b],80995)},89065,a=>{"use strict";let b=(0,a.i(70627).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);a.s(["CheckCircle2",0,b],89065)},44264,a=>{"use strict";let b=(0,a.i(70627).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);a.s(["GitBranch",0,b],44264)},89560,a=>{"use strict";let b=(0,a.i(70627).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);a.s(["Info",0,b],89560)},37303,66535,a=>{"use strict";let b=(0,a.i(70627).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);a.s(["default",0,b],66535),a.s(["AlertTriangle",0,b],37303)},22598,a=>{"use strict";let b=(0,a.i(70627).default)("zap",[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]);a.s(["Zap",0,b],22598)},4888,a=>{"use strict";var b=a.i(38742),c=a.i(68114);a.s(["BarList",0,function({items:a,color:d="bg-brand",max:e,emptyLabel:f="None",limit:g,format:h=a=>a.toLocaleString()}){if(0===a.length)return(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f});let i=[...a].sort((a,b)=>b.value-a.value),j=g?i.slice(0,g):i,k=e??i[0].value??1;return(0,b.jsxs)("div",{className:"space-y-1.5",children:[j.map(({name:a,value:e})=>(0,b.jsxs)("div",{className:"flex items-center gap-2.5 text-xs",children:[(0,b.jsx)("div",{className:"w-28 shrink-0 truncate font-mono text-muted-foreground sm:w-36",title:a,children:a}),(0,b.jsx)("div",{className:"h-4 flex-1 overflow-hidden rounded-sm bg-muted",children:(0,b.jsx)("div",{className:(0,c.cn)("h-full rounded-sm",d),style:{width:`${Math.max(e/k*100,2)}%`}})}),(0,b.jsx)("div",{className:"w-12 shrink-0 text-right font-medium tabular-nums text-foreground",children:h(e)})]},a)),g&&i.length>g&&(0,b.jsxs)("p",{className:"pt-1 text-xs text-muted-foreground",children:["+",i.length-g," more"]})]})}])},90892,a=>{"use strict";var b=a.i(38742),c=a.i(68114);a.s(["EmptyState",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.cn)("flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-border px-6 py-14 text-center",g),children:[(0,b.jsx)("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,b.jsx)(a,{className:"size-5","aria-hidden":!0})}),(0,b.jsx)("p",{className:"text-sm font-medium text-foreground",children:d}),e&&(0,b.jsx)("p",{className:"max-w-sm text-xs leading-relaxed text-muted-foreground",children:e}),f&&(0,b.jsx)("div",{className:"mt-2",children:f})]})}])},63167,27855,a=>{"use strict";var b=a.i(38742);let c={A:{badge:"border-emerald-300 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-300",bar:"bg-emerald-500"},B:{badge:"border-sky-300 bg-sky-50 text-sky-700 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-300",bar:"bg-sky-500"},C:{badge:"border-amber-300 bg-amber-50 text-amber-700 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300",bar:"bg-amber-500"},D:{badge:"border-orange-300 bg-orange-50 text-orange-700 dark:border-orange-900 dark:bg-orange-950/40 dark:text-orange-300",bar:"bg-orange-500"},F:{badge:"border-red-300 bg-red-50 text-red-700 dark:border-red-900 dark:bg-red-950/40 dark:text-red-300",bar:"bg-red-500"}},d={completed:"The agent had the last word.",in_progress:"The agent is still writing to this session.",abandoned:"The session stops mid-work, or on a prompt the agent never answered.",errored:"The transcript ends on an API error."},e=(a,b,c=`${b}s`)=>`${a.toLocaleString()} ${1===a?b:c}`;a.s(["GRADES",0,["A","B","C","D","F"],"GRADE_STYLES",0,c,"OUTCOMES",0,["completed","in_progress","abandoned","errored"],"OUTCOME_BARS",0,{completed:"bg-emerald-500",in_progress:"bg-sky-500",abandoned:"bg-amber-500",errored:"bg-red-500"},"OUTCOME_LABELS",0,{completed:"Completed",in_progress:"In progress",abandoned:"Abandoned",errored:"Errored"},"OUTCOME_NOTES",0,d,"SIGNAL_INFO",0,{outcome:{label:"Unfinished sessions",describe:(a,b)=>d[b.outcome],advice:"Review errored and abandoned sessions first: they spent tokens without reaching an answer."},tool_failures:{label:"Tool failures",describe:(a,b)=>{let c=Math.max(b.toolResults,a.count);return`${a.count.toLocaleString()} of ${e(c,"tool result")} failed (${Math.round(a.count/c*100)}%).`},advice:"Open the failed calls and look for a recurring cause: wrong paths, missing dependencies, commands that need a flag.",focus:{failures:!0}},retry_loops:{label:"Retry loops",describe:a=>`The same tool failed three or more times in a row, ${e(a.count,"time")}.`,advice:"An agent repeating a failing call lacks the context to try something else. Put the working command in AGENTS.md or CLAUDE.md.",focus:{failures:!0}},api_errors:{label:"API errors",describe:a=>`${e(a.count,"API error")} or retried request${1===a.count?"":"s"}.`,advice:"Each retry re-sends the whole context. Frequent errors point at rate limits or an overloaded model.",focus:{categories:["session"],subKeys:["session.error"]}},aborted_turns:{label:"Interrupted turns",describe:a=>`${e(a.count,"turn")} interrupted before the agent finished.`,advice:"Interruptions usually mean the agent set off in the wrong direction. State the constraints and the success criteria up front.",focus:{categories:["session"],subKeys:["session.turn_aborted"]}},compactions:{label:"Context compactions",describe:a=>`Context was compacted ${e(a.count,"time")}.`,advice:"Split long tasks into separate sessions before the context fills up: compacting mid-task loses detail.",focus:{categories:["session"],subKeys:["session.compaction_start"]}}},"healthSummary",0,function(a){return`${a.grade} \xb7 ${a.score}`}],27855);var f=a.i(68114);a.s(["GradeBadge",0,function({grade:a,score:d,className:e,...g}){return(0,b.jsxs)("span",{...g,className:(0,f.cn)("inline-flex h-5 min-w-5 shrink-0 items-center justify-center gap-1 rounded-sm border px-1 font-mono text-xs font-bold leading-none",c[a].badge,e),children:[a,void 0!==d&&(0,b.jsx)("span",{className:"font-medium tabular-nums",children:d})]})}],63167)},19608,59561,a=>{"use strict";var b=a.i(38742),c=a.i(73895);let d=(0,a.i(70627).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var e=a.i(99570),f=a.i(85259),g=a.i(68114);function h({className:a}){return(0,b.jsx)("div",{"aria-hidden":!0,className:(0,g.cn)("animate-pulse rounded-md bg-muted",a)})}a.s(["ScrollToTop",0,function({threshold:a=600}){let[h,i]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let b=()=>i(window.scrollY>a);return b(),window.addEventListener("scroll",b,{passive:!0}),()=>window.removeEventListener("scroll",b)},[a]),(0,b.jsxs)(f.Tooltip,{children:[(0,b.jsx)(f.TooltipTrigger,{render:(0,b.jsx)(e.Button,{variant:"outline",size:"icon-lg",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),"aria-label":"Back to top",tabIndex:h?0:-1,className:(0,g.cn)("fixed bottom-6 right-6 z-30 size-10 rounded-full bg-card text-muted-foreground shadow-lg dark:bg-card",h?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:(0,b.jsx)(d,{"aria-hidden":!0})})}),(0,b.jsx)(f.TooltipContent,{side:"left",children:"Back to top"})]})}],19608),a.s(["SessionCardSkeleton",0,function(){return(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-card px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,b.jsx)(h,{className:"h-4 w-2/3"}),(0,b.jsx)(h,{className:"h-3 w-1/3"})]}),(0,b.jsx)(h,{className:"h-3 w-16"})]}),(0,b.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,b.jsx)(h,{className:"h-3 w-20"}),(0,b.jsx)(h,{className:"h-3 w-16"}),(0,b.jsx)(h,{className:"h-3 w-24"})]})]})},"Skeleton",0,h],59561)},84213,a=>{"use strict";var b=a.i(38742),c=a.i(89560),d=a.i(68114);a.s(["StatCard",0,function({label:a,value:e,sub:f,accent:g=!1,onClick:h}){let i=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"flex items-center justify-between gap-2 text-xs uppercase tracking-wider text-muted-foreground",children:[a,h&&(0,b.jsx)(c.Info,{className:"size-3.5 shrink-0 opacity-60 transition-opacity group-hover:opacity-100","aria-hidden":!0})]}),(0,b.jsx)("span",{className:(0,d.cn)("mt-1.5 block text-2xl font-bold leading-none tabular-nums",g?"text-brand":"text-foreground"),children:e}),f&&(0,b.jsx)("span",{className:"mt-1 block truncate text-xs normal-case text-muted-foreground",title:f,children:f})]});return h?(0,b.jsx)("button",{type:"button",onClick:h,"aria-haspopup":"dialog",className:"group block rounded-xl border border-border bg-card p-4 text-left transition-colors hover:border-brand/40 hover:bg-muted/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",children:i}):(0,b.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:i})},"StatCardGrid",0,function({children:a}){return(0,b.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(150px,1fr))] gap-3",children:a})}])},96538,a=>{"use strict";var b=a.i(70627);let c=(0,b.default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),d=(0,b.default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);a.s(["InputTokensIcon",0,d,"OutputTokensIcon",0,c],96538)},34597,45128,a=>{"use strict";var b=a.i(38742),c=a.i(73895),d=a.i(40762),e=a.i(97428),f=a.i(89560);let g=(0,a.i(70627).default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var h=a.i(99570),i=a.i(14574),j=a.i(85259),k=a.i(64151);let l="https://github.com/kishanmundha/agent-session-inspector",m={name:"Agent Session Inspector",description:"A local web UI for reading agent CLI transcripts: what the agent did, how long it took, and where the tokens went. It reads the session files on this machine and never sends them anywhere.",version:"0.1.9",author:{name:"Kishan Mundha",url:"https://github.com/kishanmundha"},repoUrl:l,issuesUrl:`${l}/issues`,releasesUrl:`${l}/releases`};a.s(["APP_INFO",0,m],45128);var n=a.i(80153),o=a.i(68114);function p({className:a}){return(0,b.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:a,"aria-hidden":!0,children:(0,b.jsx)("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}let q={target:"_blank",rel:"noreferrer"};a.s(["AboutDialog",0,function({providers:a,className:l}){let[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),v=(0,c.useRef)(!1),w=a??t,x=w?.filter(a=>a.available),y=w?.filter(a=>!a.available)??[];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(j.Tooltip,{children:[(0,b.jsx)(j.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"outline",size:"icon",onClick:function(){s(!0),a||v.current||(v.current=!0,fetch("/api/providers").then(a=>a.ok?a.json():[]).then(u).catch(()=>u([])))},"aria-label":"About",className:(0,o.cn)("text-muted-foreground",l),children:(0,b.jsx)(f.Info,{className:"size-3.5","aria-hidden":!0})})}),(0,b.jsx)(j.TooltipContent,{children:"About"})]}),(0,b.jsx)(i.Dialog,{open:r,onOpenChange:s,children:(0,b.jsxs)(i.DialogContent,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-brand text-brand-foreground",children:(0,b.jsx)(d.Bot,{className:"size-5","aria-hidden":!0})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)(i.DialogTitle,{children:m.name}),(0,b.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[(0,b.jsxs)("span",{className:"font-mono",children:["v",m.version]})," · by ",(0,b.jsx)("a",{href:m.author.url,...q,className:"font-medium text-foreground underline-offset-2 hover:underline",children:m.author.name})]})]})]}),(0,b.jsx)(i.DialogDescription,{children:m.description}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsxs)(h.Button,{variant:"outline",size:"sm",nativeButton:!1,render:(0,b.jsx)("a",{href:m.repoUrl,...q}),children:[(0,b.jsx)(p,{className:"size-3.5"}),"GitHub"]}),(0,b.jsxs)(h.Button,{variant:"outline",size:"sm",nativeButton:!1,render:(0,b.jsx)("a",{href:m.releasesUrl,...q}),children:[(0,b.jsx)(g,{className:"size-3.5","aria-hidden":!0}),"Releases"]}),(0,b.jsxs)(h.Button,{variant:"outline",size:"sm",nativeButton:!1,render:(0,b.jsx)("a",{href:m.issuesUrl,...q}),children:[(0,b.jsx)(e.Bug,{className:"size-3.5","aria-hidden":!0}),"Report an issue"]})]}),(0,b.jsxs)("section",{className:"space-y-2 border-t border-border pt-3",children:[(0,b.jsx)("h3",{className:"text-xs font-medium text-foreground",children:"Data sources"}),x?x.length>0?(0,b.jsx)("ul",{className:"overflow-hidden rounded-lg border border-border text-xs",children:x.map(a=>(0,b.jsxs)("li",{className:"flex items-center gap-2 border-b border-border/60 px-3 py-2 last:border-b-0",children:[(0,b.jsx)("span",{className:(0,o.cn)("size-1.5 shrink-0 rounded-full",(0,n.providerStyle)(a.id).dotCls),"aria-hidden":!0}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"truncate font-medium text-foreground",children:a.label}),(0,b.jsx)("p",{className:"truncate font-mono text-muted-foreground",children:a.rootDir})]}),(0,b.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:`${a.sessionCount??0} ${1===a.sessionCount?"session":"sessions"}`}),(0,b.jsx)(k.CopyButton,{value:a.rootDir,label:"Copy path"})]},a.id))}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"No agent directories found."}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading…"}),y.length>0&&(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[x?.length?"Also supports":"Supports"," ",y.map(a=>a.label).join(", "),"."]})]})]})})]})}],34597)},56979,a=>{"use strict";var b=a.i(38742),c=a.i(73895),d=a.i(90075),e=a.i(68114);let f="\0other";function g(a,b){return"costUSD"===a?(0,d.formatCost)(b):(0,d.formatTokens)(b)??"0"}function h(a){if(a<=0)return 1;let b=10**Math.floor(Math.log10(a));return([1,1.5,2,3,4,5,6,8,10].find(c=>c*b>=a)??10)*b}let i=a=>a.toLocaleDateString([],{month:"short",day:"numeric"});a.s(["OTHER",0,f,"OTHER_COLOR",0,"color-mix(in srgb, var(--muted-foreground) 45%, transparent)","SERIES_COLORS",0,["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"],"StackedBars",0,function({periods:a,breakdownOf:d,series:j,unit:k}){var l;let[m,n]=(0,c.useState)(null),o=h(Math.max(0,...a.map(a=>a[k]))),p=a.map(a=>(function(a,b,c){let d=new Set(b.map(a=>a.name)),e=0;for(let[b,f]of Object.entries(a))d.has(b)||(e+=f[c]);return b.map(b=>b.name===f?e:a[b.name]?.[c]??0)})(d(a),j,k)),q=null!==m&&m<a.length?m:null,r=j.map((a,b)=>p.reduce((a,c)=>a+c[b],0)),s=null===q?r:p[q],t=s.reduce((a,b)=>a+b,0),u=Math.floor((a.length-1)/2);return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)("div",{className:"flex h-48 flex-col justify-between text-right text-[10px] leading-none tabular-nums text-muted-foreground",children:[(0,b.jsx)("span",{children:g(k,o)}),(0,b.jsx)("span",{children:g(k,o/2)}),(0,b.jsx)("span",{children:g(k,0)})]}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{role:"img","aria-label":`${"costUSD"===k?"Cost":"Tokens"} per ${a[0]?.days===1?"day":"week"} over ${a.length} bars`,className:"relative flex h-48 items-end gap-[2px] border-b border-border",onMouseLeave:()=>n(null),children:[(0,b.jsx)("span",{className:"pointer-events-none absolute inset-x-0 top-0 border-t border-dashed border-border"}),(0,b.jsx)("span",{className:"pointer-events-none absolute inset-x-0 top-1/2 border-t border-dashed border-border"}),a.map((a,c)=>(0,b.jsx)("div",{onMouseEnter:()=>n(c),className:(0,e.cn)("relative flex h-full min-w-0 max-w-12 flex-1 flex-col-reverse",null!==q&&q!==c&&"opacity-50"),children:j.map((a,d)=>p[c][d]>0?(0,b.jsx)("div",{className:"w-full shrink-0 border-t-2 border-card first:border-t-0 last:rounded-t-[3px]",style:{height:`${p[c][d]/o*100}%`,minHeight:2,background:a.color}},a.name):null)},a.start.getTime()))]}),(0,b.jsxs)("div",{className:"mt-1.5 flex justify-between text-[10px] text-muted-foreground",children:[(0,b.jsx)("span",{children:a.length>0&&i(a[0].start)}),a.length>4&&(0,b.jsx)("span",{children:i(a[u].start)}),(0,b.jsx)("span",{children:a.length>1&&i(a[a.length-1].start)})]})]})]}),(0,b.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs","aria-live":"polite",children:[(0,b.jsxs)("span",{className:"font-medium tabular-nums",children:[null===q?"Whole range":1===(l=a[q]).days?l.start.toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"}):`Week of ${i(l.start)}`," ·"," ",g(k,t)]}),j.map((a,c)=>(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-muted-foreground",children:[(0,b.jsx)("span",{className:"size-2.5 shrink-0 rounded-[3px]",style:{background:a.color},"aria-hidden":!0}),(0,b.jsx)("span",{className:"max-w-40 truncate",title:a.label,children:a.label}),(0,b.jsx)("span",{className:"tabular-nums text-foreground",children:g(k,s[c])})]},a.name))]})]})},"Treemap",0,function({items:a,unit:c}){let d=a.filter(a=>a.value>0).sort((a,b)=>b.value-a.value),e=d.reduce((a,b)=>a+b.value,0),f=function(a){let b=a.reduce((a,b)=>a+b,0);if(b<=0)return[];let c=a.map(a=>a/b*5600),d=[],e=0,f=0,g=100,h=56,i=0;for(;i<c.length;){let a=Math.min(g,h),b=(b,c,d)=>Math.max(a*a*d/(b*b),b*b/(a*a*c)),j=c[i],k=i+1;for(;k<c.length;){let a=j+c[k];if(b(a,c[k],c[i])>b(j,c[k-1],c[i]))break;j=a,k++}let l=j/a,m=0;for(let a=i;a<k;a++){let b=c[a]/l;d.push(g>=h?{x:e,y:f+m,w:l,h:b}:{x:e+m,y:f,w:b,h:l}),m+=b}g>=h?(e+=l,g-=l):(f+=l,h-=l),i=k}return d}(d.map(a=>a.value));return(0,b.jsx)("div",{className:"relative w-full",style:{aspectRatio:"100 / 56"},role:"img","aria-label":`Share of ${"costUSD"===c?"cost":"tokens"} across ${d.length} groups`,children:d.map((a,d)=>{let h=f[d],i=a.value/e;return(0,b.jsx)("div",{title:`${a.label}: ${g(c,a.value)} (${(100*i).toFixed(1)}%)`,className:"absolute p-px",style:{left:`${h.x/100*100}%`,top:`${h.y/56*100}%`,width:`${h.w/100*100}%`,height:`${h.h/56*100}%`},children:(0,b.jsx)("div",{className:"size-full overflow-hidden rounded-[4px] border-l-[3px] px-1.5 py-1 hover:ring-1 hover:ring-foreground/50",style:{background:`color-mix(in srgb, ${a.color} 28%, var(--card))`,borderColor:a.color},children:h.w>14&&h.h>11&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"block truncate text-xs font-medium",children:a.label}),(0,b.jsxs)("span",{className:"block truncate text-[11px] tabular-nums text-muted-foreground",children:[g(c,a.value)," · ",(100*i).toFixed(1),"%"]})]})})},a.name)})})},"formatUnit",0,g,"niceCeil",0,h])},86304,a=>{"use strict";var b=a.i(83463),c=a.i(16262),d=a.i(42261),e=a.i(68114);let f=(0,d.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});a.s(["Badge",0,function({className:a,variant:d="default",render:g,...h}){var i;return i={defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}},(0,c.useRenderElement)(i.defaultTagName??"div",i,i)}],86304)},69876,64151,a=>{"use strict";var b=a.i(38742);a.s([],89088),a.i(89088);var c=a.i(73895),d=a.i(28050),e=a.i(10764),f=a.i(90874);let g=c.createContext(void 0);function h(){let a=c.useContext(g);if(void 0===a)throw Error((0,f.default)(53));return a}var i=a.i(16262);function j(a,b,c){if(!a)return 0;let d=getComputedStyle(a),e=`${b}${"x"===c?"Inline":"Block"}`,f=parseFloat(d[`${e}Start`]);return"x"===c&&"margin"===b?2*f:f+parseFloat(d[`${e}End`])}var k=a.i(4133),l=a.i(28353);let m=a=>b=>b?{[a]:""}:null,n={hasOverflowX:m("data-has-overflow-x"),hasOverflowY:m("data-has-overflow-y"),overflowXStart:m("data-overflow-x-start"),overflowXEnd:m("data-overflow-x-end"),overflowYStart:m("data-overflow-y-start"),overflowYEnd:m("data-overflow-y-end"),cornerHidden:()=>null};var o=a.i(18727),p=a.i(46621);let q={x:0,y:0},r={width:0,height:0},s={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},t={x:!0,y:!0,corner:!0},u=c.forwardRef(function(a,f){var h;let m,{render:u,className:v,overflowEdgeThreshold:w,style:x,...y}=a,{xStart:z,xEnd:A,yStart:B,yEnd:C}=(m="number"==typeof(h=w)?{xStart:h,xEnd:h,yStart:h,yEnd:h}:h,{xStart:Math.max(0,m?.xStart||0),xEnd:Math.max(0,m?.xEnd||0),yStart:Math.max(0,m?.yStart||0),yEnd:Math.max(0,m?.yEnd||0)}),D=(0,l.useBaseUiId)(),E=(0,e.useTimeout)(),F=(0,e.useTimeout)(),{nonce:G,disableStyleElements:H}=(0,p.useCSPContext)(),[I,J]=c.useState(!1),[K,L]=c.useState(!1),[M,N]=c.useState(!1),[O,P]=c.useState(!1),[Q,R]=c.useState(!1),[S,T]=c.useState(r),[U,V]=c.useState(r),[W,X]=c.useState(s),[Y,Z]=c.useState(t),$=c.useRef(null),_=c.useRef(null),aa=c.useRef(null),ab=c.useRef(null),ac=c.useRef(null),ad=c.useRef(null),ae=c.useRef(null),af=c.useRef(null),ag=c.useRef(0),ah=c.useRef(0),ai=c.useRef(0),aj=c.useRef(0),ak=c.useRef("vertical"),al=c.useRef(q),am=c.useRef(null);function an(a){let b=a?N:L;b(!0),(a?E:F).start(500,()=>{b(!1)})}let ao=(0,d.useStableCallback)(a=>{let b=a.x-al.current.x,c=a.y-al.current.y;al.current=a,0!==c&&an(!0),0!==b&&an(!1)}),ap=(0,d.useStableCallback)(()=>{let a=_.current;a&&null===am.current&&(am.current=a.style.scrollSnapType,a.style.scrollSnapType="none")}),aq=(0,d.useStableCallback)(a=>{if(0!==a.button)return;if(null!==af.current){let a="vertical"===ak.current?ac.current:ad.current;if(a?.hasPointerCapture(af.current))return}af.current=a.pointerId,ag.current=a.clientY,ah.current=a.clientX,ak.current=a.currentTarget.getAttribute("data-orientation");let b=_.current;b&&(ai.current=b.scrollTop,aj.current=b.scrollLeft,ap());let c="vertical"===ak.current?ac.current:ad.current;c?.setPointerCapture(a.pointerId)}),ar=(0,d.useStableCallback)(a=>{if(a.pointerId!==af.current)return;af.current=null,("vertical"===ak.current?N:L)(!1),null!==am.current&&(_.current&&(_.current.style.scrollSnapType=am.current),am.current=null);let b="vertical"===ak.current?ac.current:ad.current;b?.hasPointerCapture(a.pointerId)&&b.releasePointerCapture(a.pointerId)}),as=(0,d.useStableCallback)(a=>{if(a.pointerId!==af.current)return;if(a.buttons%2==0)return void ar(a);let b=_.current;if(!b)return;let c="vertical"===ak.current,d=c?ac.current:ad.current,e=c?aa.current:ab.current;if(!d||!e)return;let f=c?"y":"x",g=j(e,"padding",f),h=j(d,"margin",f),i=c?d.offsetHeight:d.offsetWidth,k=(c?e.offsetHeight:e.offsetWidth)-i-g-h,l=c?a.clientY-ag.current:a.clientX-ah.current,m=c?b.scrollHeight:b.scrollWidth,n=c?b.clientHeight:b.clientWidth,o=(c?ai.current:aj.current)+(k<=0?0:l/k)*(m-n);c?b.scrollTop=o:b.scrollLeft=o,a.preventDefault(),an(c)});function at(a){P("touch"===a.pointerType)}function au(a){at(a),"touch"!==a.pointerType&&J((0,o.contains)($.current,a.target))}let av=c.useMemo(()=>({scrolling:K||M,hasOverflowX:!Y.x,hasOverflowY:!Y.y,overflowXStart:W.xStart,overflowXEnd:W.xEnd,overflowYStart:W.yStart,overflowYEnd:W.yEnd,cornerHidden:Y.corner}),[K,M,Y.x,Y.y,Y.corner,W]),aw={role:"presentation",onPointerEnter:au,onPointerMove:au,onPointerDown:at,onPointerLeave(){J(!1)},style:{position:"relative","--scroll-area-corner-height":`${S.height}px`,"--scroll-area-corner-width":`${S.width}px`}},ax=(0,i.useRenderElement)("div",a,{state:av,ref:[f,$],props:[aw,y],stateAttributesMapping:n}),ay=c.useMemo(()=>({handlePointerDown:aq,handlePointerMove:as,handlePointerUp:ar,handleScroll:ao,disableViewportSnap:ap,cornerSize:S,setCornerSize:T,thumbSize:U,setThumbSize:V,hasMeasuredScrollbar:Q,setHasMeasuredScrollbar:R,touchModality:O,cornerRef:ae,scrollingX:K,scrollingY:M,hovering:I,setHovering:J,viewportRef:_,scrollbarYRef:aa,scrollbarXRef:ab,thumbYRef:ac,thumbXRef:ad,rootId:D,hiddenState:Y,setHiddenState:Z,overflowEdges:W,setOverflowEdges:X,viewportState:av,overflowEdgeThreshold:{xStart:z,xEnd:A,yStart:B,yEnd:C}}),[aq,as,ar,ao,ap,S,U,Q,O,K,M,I,D,Y,W,av,z,A,B,C]);return(0,b.jsxs)(g.Provider,{value:ay,children:[!H&&k.styleDisableScrollbar.getElement(G),ax]})});var v=a.i(45351),w=a.i(447);let x=c.createContext(void 0);var y=a.i(46781),z=a.i(22226),A=a.i(11194);let B=["--scroll-area-overflow-x-start","--scroll-area-overflow-x-end","--scroll-area-overflow-y-start","--scroll-area-overflow-y-end"],C=!1,D=c.forwardRef(function(a,f){let{render:g,className:l,style:m,...o}=a,{viewportRef:p,scrollbarYRef:q,scrollbarXRef:r,thumbYRef:s,thumbXRef:t,cornerRef:u,cornerSize:z,setCornerSize:D,setThumbSize:G,rootId:H,setHiddenState:I,hiddenState:J,setHasMeasuredScrollbar:K,handleScroll:L,touchModality:M,setHovering:N,setOverflowEdges:O,overflowEdgeThreshold:P,viewportState:Q}=h(),R=(0,y.useDirection)(),S=c.useRef(!0),T=c.useRef([NaN,NaN,NaN,NaN]),U=(0,e.useTimeout)(),V=(0,e.useTimeout)(),W=(0,d.useStableCallback)(()=>{var a;let b,c,d=p.current,e=q.current,f=r.current,g=s.current,h=t.current,i=u.current;if(!d)return;let k=d.scrollHeight,l=d.scrollWidth,m=d.clientHeight,n=d.clientWidth,o=d.scrollTop,v=d.scrollLeft,w=T.current,x=Number.isNaN(w[0]);if(w[0]=m,w[1]=k,w[2]=n,w[3]=l,x&&K(!0),0===k||0===l)return;let y=(b=(a=d).clientHeight>=a.scrollHeight,{y:b,x:c=a.clientWidth>=a.scrollWidth,corner:b||c}),C=y.y,H=y.x,J=n/l,L=m/k,M=Math.max(0,l-n),N=Math.max(0,k-m),Q=0,S=0;H||(Q=(0,A.normalizeScrollOffset)("rtl"===R?-v:v,M),S=M-Q);let U=C?0:(0,A.normalizeScrollOffset)(o,N),V=C?0:N-U,W=H?0:n,X=C?0:m,Y=0,Z=0;H||C||(Y=e?.offsetWidth||0,Z=f?.offsetHeight||0);let $=0===z.width&&0===z.height,_=$?Y:0,aa=$?Z:0,ab=j(f,"padding","x"),ac=j(e,"padding","y"),ad=j(h,"margin","x"),ae=j(g,"margin","y"),af=W-ab-ad,ag=X-ac-ae,ah=f?Math.min(f.offsetWidth-_,af):af,ai=e?Math.min(e.offsetHeight-aa,ag):ag,aj=Math.max(16,ah*J),ak=Math.max(16,ai*L);if(G(a=>E(a,{width:aj,height:ak})),e&&g){let a=e.offsetHeight-ak-ac-ae,b=F(g,"--scroll-area-thumb-height",o,N,k,ak,a);g.style.transform=`translate3d(0,${b}px,0)`}if(f&&h){let a=f.offsetWidth-aj-ab-ad,b=F(h,"--scroll-area-thumb-width","rtl"===R?-v:v,M,l,aj,a);h.style.transform=`translate3d(${"rtl"===R?-b:b}px,0,0)`}let al=[Q,S,U,V];B.forEach((a,b)=>{d.style.setProperty(a,`${al[b]}px`)}),i&&D(a=>E(a,{width:Y,height:Z})),I(a=>E(a,y));let am={xStart:!H&&Q>P.xStart,xEnd:!H&&S>P.xEnd,yStart:!C&&U>P.yStart,yEnd:!C&&V>P.yEnd};O(a=>E(a,am))});function X(){S.current=!1}(0,v.useIsoLayoutEffect)(()=>{C||w.platform.engine.webkit||("u">typeof CSS&&"registerProperty"in CSS&&B.forEach(a=>{try{CSS.registerProperty({name:a,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),C=!0)},[]),(0,v.useIsoLayoutEffect)(()=>{queueMicrotask(W)},[W,J,R,P.xStart,P.xEnd,P.yStart,P.yEnd]),(0,v.useIsoLayoutEffect)(()=>{p.current?.matches(":hover")&&N(!0)},[p,N]),(0,v.useIsoLayoutEffect)(()=>{let a=p.current;if("u"<typeof ResizeObserver||!a)return;let b=!1,c=new ResizeObserver(()=>{if(!b){b=!0;let c=T.current;if(c[0]===a.clientHeight&&c[1]===a.scrollHeight&&c[2]===a.clientWidth&&c[3]===a.scrollWidth)return}W()});return c.observe(a),V.start(0,()=>{let b=a.getAnimations({subtree:!0});0!==b.length&&Promise.allSettled(b.map(a=>a.finished)).then(W).catch(()=>{})}),()=>{c.disconnect(),V.clear()}},[W,p,V]);let Y={role:"presentation",...H&&{"data-id":`${H}-viewport`},tabIndex:J.x&&J.y?-1:0,className:k.styleDisableScrollbar.className,style:{overflow:"scroll"},onScroll(){p.current&&(W(),(M||!S.current)&&L({x:p.current.scrollLeft,y:p.current.scrollTop}),U.start(100,()=>{S.current=!0}))},onWheel:X,onPointerMove:X,onPointerEnter:X,onKeyDown:X},Z=(0,i.useRenderElement)("div",a,{ref:[f,p],state:Q,props:[Y,o],stateAttributesMapping:n}),$=c.useMemo(()=>({computeThumbPosition:W}),[W]);return(0,b.jsx)(x.Provider,{value:$,children:Z})});function E(a,b){for(let c in b)if(a[c]!==b[c])return b;return a}function F(a,b,c,d,e,f,g){let h=(0,z.clamp)(c,0,d),i=c-h,j=Math.max(16,f*e/(e+Math.abs(i)));return a.style.setProperty(b,i?`${j}px`:""),(d?h/d*g:0)+(i>0?f-j:0)}var G=a.i(37781);let H=c.createContext(void 0),I=c.forwardRef(function(a,d){let{render:e,className:f,orientation:g="vertical",keepMounted:k=!1,style:l,...m}=a,{hovering:p,scrollingX:q,scrollingY:r,hiddenState:s,scrollbarYRef:t,scrollbarXRef:u,viewportRef:v,thumbYRef:w,thumbXRef:x,handlePointerDown:z,handlePointerUp:A,handleScroll:B,disableViewportSnap:C,rootId:D,thumbSize:E,hasMeasuredScrollbar:F,viewportState:I}=h(),J="vertical"===g,K={...I,hovering:p,scrolling:J?r:q,orientation:g},L=(0,y.useDirection)(),M=!F&&!k,N=J?s.y:s.x,O=k||!N;c.useEffect(()=>{if(!O)return;let a=v.current,b=J?t.current:u.current;if(b)return(0,G.addEventListener)(b,"wheel",function(b){if(!a||b.ctrlKey)return;let c=!J,d=c?"scrollLeft":"scrollTop",e=c?b.deltaX:b.deltaY;if(0===e)return;let f=c?a.scrollWidth-a.clientWidth:a.scrollHeight-a.clientHeight,g=c&&"rtl"===L?-f:0,h=c&&"rtl"===L?0:f,i=a[d];i<=g&&e<0||i>=h&&e>0||(b.preventDefault(),a[d]=Math.min(h,Math.max(g,i+e)),B({x:a.scrollLeft,y:a.scrollTop}))},{passive:!1})},[L,B,J,u,t,O,v]);let P={...D&&{"data-id":`${D}-scrollbar`},onPointerDown(a){if(0!==a.button)return;let b=(0,o.getTarget)(a.nativeEvent),c=J?w.current:x.current;if(c&&(0,o.contains)(c,b))return;let d=v.current;if(!d)return;let e=J?t.current:u.current;if(!c||!e)return;let f=J?"y":"x",g=j(c,"margin",f),h=j(e,"padding",f),i=J?c.offsetHeight:c.offsetWidth,k=e.getBoundingClientRect(),l=J?a.clientY-k.top-i/2-h+g/2:a.clientX-k.left-i/2-h+g/2,m=J?d.scrollHeight:d.scrollWidth,n=J?d.clientHeight:d.clientWidth,p=(J?e.offsetHeight:e.offsetWidth)-i-h-g;if(p<=0)return;let q=l/p,r=m-n;C(),J?d.scrollTop=q*r:"rtl"===L?d.scrollLeft=-(1-q)*r:d.scrollLeft=q*r,B({x:d.scrollLeft,y:d.scrollTop}),z(a)},onPointerUp:A,onPointerCancel:A,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",visibility:M?"hidden":void 0,...J?{top:0,bottom:"var(--scroll-area-corner-height)",insetInlineEnd:0,"--scroll-area-thumb-height":`${E.height}px`}:{insetInlineStart:0,insetInlineEnd:"var(--scroll-area-corner-width)",bottom:0,"--scroll-area-thumb-width":`${E.width}px`}}},Q=(0,i.useRenderElement)("div",a,{ref:[d,J?t:u],state:K,props:[P,m],stateAttributesMapping:n});return O?(0,b.jsx)(H.Provider,{value:g,children:Q}):null}),J=c.forwardRef(function(a,b){let{render:d,className:e,style:g,...j}=a,{computeThumbPosition:k}=function(){let a=c.useContext(x);if(void 0===a)throw Error((0,f.default)(55));return a}(),{hasMeasuredScrollbar:l,viewportState:m}=h(),o=c.useRef(null),p=c.useRef(l);return(0,v.useIsoLayoutEffect)(()=>{if("u"<typeof ResizeObserver)return;let a=!1,b=new ResizeObserver(()=>{(a||(a=!0,p.current))&&k()});return o.current&&b.observe(o.current),()=>{b.disconnect()}},[k]),(0,i.useRenderElement)("div",a,{ref:[b,o],state:m,stateAttributesMapping:n,props:[{role:"presentation",style:{minWidth:"fit-content"}},j]})}),K=c.forwardRef(function(a,b){let{render:d,className:e,style:g,...j}=a,{thumbYRef:k,thumbXRef:l,handlePointerDown:m,handlePointerMove:n,handlePointerUp:o,scrollingX:p,scrollingY:q,hasMeasuredScrollbar:r}=h(),s=function(){let a=c.useContext(H);if(void 0===a)throw Error((0,f.default)(54));return a}(),t="vertical"===s;return(0,i.useRenderElement)("div",a,{ref:[b,t?k:l],state:{scrolling:t?q:p,orientation:s},props:[{onPointerDown:m,onPointerMove:n,onPointerUp:o,onPointerCancel:o,style:{visibility:r?void 0:"hidden",...t?{height:"var(--scroll-area-thumb-height)"}:{width:"var(--scroll-area-thumb-width)"}}},j]})}),L=c.forwardRef(function(a,b){let{render:c,className:d,style:e,...f}=a,{cornerRef:g,cornerSize:j,hiddenState:k}=h(),l=(0,i.useRenderElement)("div",a,{ref:[b,g],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:j.width,height:j.height}},f]});return k.corner?null:l});a.s(["Content",0,J,"Corner",0,L,"Root",0,u,"Scrollbar",0,I,"Thumb",0,K,"Viewport",0,D],73269);var M=a.i(73269),M=M,N=a.i(68114);function O({className:a,orientation:c="vertical",...d}){return(0,b.jsx)(M.Scrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":c,orientation:c,className:(0,N.cn)("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",a),...d,children:(0,b.jsx)(M.Thumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}a.s(["ScrollArea",0,function({className:a,children:c,...d}){return(0,b.jsxs)(M.Root,{"data-slot":"scroll-area",className:(0,N.cn)("relative",a),...d,children:[(0,b.jsx)(M.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:c}),(0,b.jsx)(O,{}),(0,b.jsx)(M.Corner,{})]})}],69876);var P=a.i(33898),P=P;let Q=(0,a.i(70627).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var R=a.i(61055),S=a.i(99570),T=a.i(85259);a.s(["CopyButton",0,function({value:a,label:d="Copy",size:e="xs",icon:f=Q,className:g,children:h}){let[i,j]=(0,c.useState)("idle"),k=(0,c.useRef)(void 0);async function l(){try{await navigator.clipboard.writeText("function"==typeof a?a():a),j("copied")}catch{j("failed")}window.clearTimeout(k.current),k.current=window.setTimeout(()=>j("idle"),1600)}(0,c.useEffect)(()=>()=>window.clearTimeout(k.current),[]);let m="copied"===i?P.default:"failed"===i?R.X:f;return(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsxs)(S.Button,{variant:"ghost",size:h?e:`icon-${e}`,onClick:l,"aria-label":d,className:(0,N.cn)("text-muted-foreground","copied"===i&&"text-emerald-600 dark:text-emerald-400","failed"===i&&"text-destructive",g),children:[(0,b.jsx)(m,{className:"size-3.5","aria-hidden":!0}),h]})}),(0,b.jsx)(T.TooltipContent,{children:"copied"===i?"Copied":"failed"===i?"Copy failed":d})]})}],64151)},6015,a=>{"use strict";var b=a.i(38742),c=a.i(68114);a.s(["Table",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,b.jsx)("table",{"data-slot":"table",className:(0,c.cn)("w-full caption-bottom text-sm",a),...d})})},"TableBody",0,function({className:a,...d}){return(0,b.jsx)("tbody",{"data-slot":"table-body",className:(0,c.cn)("[&_tr:last-child]:border-0",a),...d})},"TableCell",0,function({className:a,...d}){return(0,b.jsx)("td",{"data-slot":"table-cell",className:(0,c.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",a),...d})},"TableFooter",0,function({className:a,...d}){return(0,b.jsx)("tfoot",{"data-slot":"table-footer",className:(0,c.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...d})},"TableHead",0,function({className:a,...d}){return(0,b.jsx)("th",{"data-slot":"table-head",className:(0,c.cn)("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",a),...d})},"TableHeader",0,function({className:a,...d}){return(0,b.jsx)("thead",{"data-slot":"table-header",className:(0,c.cn)("[&_tr]:border-b",a),...d})},"TableRow",0,function({className:a,...d}){return(0,b.jsx)("tr",{"data-slot":"table-row",className:(0,c.cn)("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",a),...d})}])},75083,a=>{"use strict";var b,c=a.i(38742);a.s([],97541),a.i(97541);var d=a.i(73895),e=a.i(45143),f=a.i(45351),g=a.i(28050),h=a.i(16262),i=a.i(86466),j=a.i(90874);let k=d.createContext(void 0);function l(){let a=d.useContext(k);if(void 0===a)throw Error((0,j.default)(64));return a}let m={tabActivationDirection:a=>({"data-activation-direction":a})};var n=a.i(4268),o=a.i(81353);let p=d.forwardRef(function(a,b){let{className:j,defaultValue:l=0,onValueChange:p,orientation:s="horizontal",render:t,value:u,style:v,...w}=a,x=void 0!==a.defaultValue,y=d.useRef([]),[z,A]=d.useState(()=>new Map),[B,C]=(0,e.useControlled)({controlled:u,default:l,name:"Tabs",state:"value"}),D=void 0!==u,[E,F]=d.useState(()=>new Map),G=d.useRef(void 0),H=d.useCallback(a=>q(E,a),[E]),[I,J]=d.useState(()=>({previousValue:B,tabActivationDirection:"none"})),{previousValue:K,tabActivationDirection:L}=I,M=L,N=!1;K!==B&&(M=r(K,B,s,E),N=null!=K&&null!=B&&null==H(B));let O=N?K:B,P=K!==O||L!==M;(0,f.useIsoLayoutEffect)(()=>{P&&J({previousValue:O,tabActivationDirection:M})},[O,P,M]);let Q=(0,g.useStableCallback)((a,b)=>{b.activationDirection=r(B,a,s,E),p?.(a,b),b.isCanceled||C(a)}),R=(0,g.useStableCallback)((a,b)=>{p?.(a,(0,n.createChangeEventDetails)(b,void 0,void 0,{activationDirection:"none"}))}),S=(0,g.useStableCallback)((a,b)=>(A(c=>{let d=new Map(c);return d.set(a,b),d}),()=>{A(c=>{if(c.get(a)!==b)return c;let d=new Map(c);return d.delete(a),d})})),T=d.useCallback(a=>z.get(a),[z]),U=d.useCallback(a=>{for(let b of E.values())if(a===b.value)return b.id},[E]),V=d.useMemo(()=>({getTabElementBySelectedValue:H,getTabIdByPanelValue:U,getTabPanelIdByValue:T,onValueChange:Q,orientation:s,registerMountedTabPanel:S,setTabMap:F,tabActivationDirection:M,value:B}),[H,U,T,Q,s,S,F,M,B]),W=d.useMemo(()=>{for(let a of E.values())if(a.value===B)return a},[E,B]),X=d.useMemo(()=>{for(let a of E.values())if(!a.disabled)return a.value},[E]),Y=d.useRef(!x),Z=d.useRef(l),$=d.useRef(x),_=d.useRef(!1);(0,f.useIsoLayoutEffect)(()=>{if(D)return;function a(a,b){C(a),J({previousValue:a,tabActivationDirection:"none"}),R(a,b),Y.current=!1}if(0===E.size){_.current&&null!==B&&!G.current?.isConnected&&a(null,o.REASONS.missing);return}_.current=!0,G.current=E.keys().next().value;let b=W?.disabled,c=null==W&&null!==B;if(b||B!==Z.current||($.current=!1),$.current&&b&&B===Z.current)return;let d=Y.current;if(b||c){let c=X??null;if(B===c){Y.current=!1;return}let e=o.REASONS.missing;d?e=o.REASONS.initial:b&&(e=o.REASONS.disabled),a(c,e);return}d&&null!=W&&(R(B,o.REASONS.initial),Y.current=!1)},[X,D,R,W,C,E,B]);let aa={orientation:s,tabActivationDirection:M},ab=(0,h.useRenderElement)("div",a,{state:aa,ref:b,props:w,stateAttributesMapping:m});return(0,c.jsx)(k.Provider,{value:V,children:(0,c.jsx)(i.CompositeList,{elementsRef:y,children:ab})})});function q(a,b){for(let[c,d]of a.entries())if(b===d.value)return c;return null}function r(a,b,c,d){if(null==a||null==b)return"none";let[e,f,g]="horizontal"===c?["left","left","right"]:["top","up","down"],h=q(d,a),i=q(d,b);if(null==h||null==i)return h!==i&&("number"==typeof a||"string"==typeof a)&&typeof a==typeof b?b>a?g:f:"none";let j=h.getBoundingClientRect()[e],k=i.getBoundingClientRect()[e];return k<j?f:k>j?g:"none"}var s=a.i(77875),t=a.i(28353),u=a.i(67107),v=a.i(30619),w=a.i(41425),x=a.i(58299);let y=d.createContext(void 0);function z(){let a=d.useContext(y);if(void 0===a)throw Error((0,j.default)(65));return a}var A=a.i(18727);let B=d.forwardRef(function(a,b){let{className:c,disabled:e=!1,render:i,value:j,id:k,nativeButton:p=!0,style:q,...r}=a,{value:y,getTabPanelIdByValue:B,onValueChange:C,orientation:D,tabActivationDirection:E}=l(),{activateOnFocus:F,registerTabResizeObserverElement:G,tabsListElement:H}=z(),{highlightedIndex:I,onHighlightedIndexChange:J}=(0,x.useCompositeRootContext)(),K=(0,t.useBaseUiId)(k),L=d.useMemo(()=>({disabled:e,id:K,value:j}),[e,K,j]),{compositeProps:M,compositeRef:N,index:O}=(0,w.useCompositeItem)({metadata:L}),P=j===y,Q=d.useRef(!1),R=d.useRef(null),S=(0,g.useStableCallback)(a=>{R.current?.(),R.current=a?G(a):null});(0,f.useIsoLayoutEffect)(()=>{if(Q.current){Q.current=!1;return}if(P&&O>-1&&I!==O){if(null!=H){let a=(0,A.activeElement)((0,s.ownerDocument)(H));if(a&&(0,A.contains)(H,a))return}e||J(O)}},[P,O,I,J,e,H]);let{getButtonProps:T,buttonRef:U}=(0,u.useButton)({disabled:e,native:p,focusableWhenDisabled:!0}),V=B(j),W=d.useRef(!1),X=d.useRef(!1);function Y(a){C(j,(0,n.createChangeEventDetails)(o.REASONS.none,a.nativeEvent,void 0,{activationDirection:"none"}))}return(0,h.useRenderElement)("button",a,{state:{disabled:e,active:P,orientation:D,tabActivationDirection:E},ref:[b,U,N,S],props:[M,{role:"tab","aria-controls":V,"aria-selected":P,id:K,onClick:function(a){P||e||Y(a)},onFocus:function(a){P||e||F&&(!W.current||X.current)&&Y(a)},onPointerDown:function(a){if(P||e)return;W.current=!0,X.current=0===a.button;let b=(0,s.ownerDocument)(a.currentTarget);function c(){W.current=!1,X.current=!1,b.removeEventListener("pointerup",c),b.removeEventListener("pointercancel",c)}b.addEventListener("pointerup",c),b.addEventListener("pointercancel",c)},[v.ACTIVE_COMPOSITE_ITEM]:P?"":void 0,onKeyDownCapture(){Q.current=!0}},r,T],stateAttributesMapping:m})});var C=a.i(81322),D=a.i(43979),E=a.i(13461);function F(){return E.NOOP}function G(){return!1}function H(){return!0}var I=a.i(46621);function J(a){let{script:b}=a,{nonce:d}=(0,I.useCSPContext)();return(0,D.useSyncExternalStore)(F,G,H)?(0,c.jsx)("script",{nonce:d,dangerouslySetInnerHTML:{__html:b},suppressHydrationWarning:!0}):null}let K={...m,activeTabPosition:()=>null,activeTabSize:()=>null},L=d.forwardRef(function(a,e){let{className:f,render:g,renderBeforeHydration:i=!1,style:j,...k}=a,{getTabElementBySelectedValue:m,orientation:n,tabActivationDirection:o,value:p}=l(),{tabsListElement:q,registerIndicatorUpdateListener:r}=z(),s=function(){let[,a]=d.useState({});return d.useCallback(()=>{a({})},[])}();d.useEffect(()=>r(s),[r,s]);let t=0,u=0,v=0,w=0,x=0,y=0,A=!1;if(null!=p&&null!=q){let a=m(p);if(null!=a){A=!0;let{width:b,height:c}=(0,C.getCssDimensions)(a),{width:d,height:e}=(0,C.getCssDimensions)(q),f=a.getBoundingClientRect(),g=q.getBoundingClientRect(),h=d>0?g.width/d:1,i=e>0?g.height/e:1;if(h>Number.EPSILON&&i>Number.EPSILON){let a=f.left-g.left,b=f.top-g.top;t=a/h+q.scrollLeft-q.clientLeft,v=b/i+q.scrollTop-q.clientTop}else t=a.offsetLeft,v=a.offsetTop;x=b,y=c,u=q.scrollWidth-t-x,w=q.scrollHeight-v-y}}let B=A?{left:t,right:u,top:v,bottom:w}:null,D=A?{width:x,height:y}:null,E=A?{"--active-tab-left":`${t}px`,"--active-tab-right":`${u}px`,"--active-tab-top":`${v}px`,"--active-tab-bottom":`${w}px`,"--active-tab-width":`${x}px`,"--active-tab-height":`${y}px`}:void 0,F=A&&x>0&&y>0,G=(0,h.useRenderElement)("span",a,{state:{orientation:n,activeTabPosition:B,activeTabSize:D,tabActivationDirection:o},ref:e,props:[{role:"presentation",style:E,hidden:!F},k,{suppressHydrationWarning:!0}],stateAttributesMapping:K});return null==p?null:(0,c.jsxs)(d.Fragment,{children:[G,i&&(b||(b=(0,c.jsx)(J,{script:'!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;function o(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}function n(){let n=0,r=0,s=0,h=0;const{width:c,height:f}=o(i),{width:l,height:u}=o(e),d=i.getBoundingClientRect(),a=e.getBoundingClientRect(),g=l>0?a.width/l:1,b=u>0?a.height/u:1;if(Math.abs(g)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=d.left-a.left,i=d.top-a.top;n=t/g+e.scrollLeft-e.clientLeft,s=i/b+e.scrollTop-e.clientTop}else n=i.offsetLeft,s=i.offsetTop;const p=c,m=f;function v(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}return r=e.scrollWidth-n-p,h=e.scrollHeight-s-m,v("left",n),v("right",r),v("top",s),v("bottom",h),v("width",p),v("height",m),p>0&&m>0&&(t.removeAttribute("hidden"),!0)}if(n()||"undefined"==typeof ResizeObserver)return;let r,s;function h(){s.disconnect(),clearTimeout(r)}s=new ResizeObserver(()=>{t.isConnected&&t.hasAttribute("hidden")&&i.hasAttribute("data-active")?n()&&h():h()}),s.observe(i),r=setTimeout(h,1e4)}();'})))]})});var M=a.i(35571),N=a.i(34469),O=a.i(20580),P=a.i(75302),Q=a.i(55652);let R={...m,...N.transitionStatusMapping},S=d.forwardRef(function(a,b){let{className:c,value:e,render:g,keepMounted:i=!1,style:j,...k}=a,{value:m,getTabIdByPanelValue:n,orientation:o,tabActivationDirection:p,registerMountedTabPanel:q}=l(),r=(0,t.useBaseUiId)(),{ref:s,index:u}=(0,Q.useCompositeListItem)(),v=e===m,{mounted:w,transitionStatus:x,setMounted:y}=(0,P.useTransitionStatus)(v),z=!w,A=n(e),B=d.useRef(null),C=(0,h.useRenderElement)("div",a,{state:{hidden:z,orientation:o,tabActivationDirection:p,transitionStatus:x},ref:[b,s,B],props:[{"aria-labelledby":A,hidden:z,id:r,role:"tabpanel",tabIndex:v?0:-1,inert:(0,M.inertValue)(!v),"data-index":u},k],stateAttributesMapping:R});return((0,O.useOpenChangeComplete)({open:v,ref:B,onComplete(){v||y(!1)}}),(0,f.useIsoLayoutEffect)(()=>{if(null!=r&&(!z||i))return q(e,r)},[z,i,e,r,q]),i||w)?C:null});var T=a.i(50220);let U=d.forwardRef(function(a,b){let{activateOnFocus:e=!1,className:h,loopFocus:i=!0,render:j,style:k,...n}=a,{orientation:o,setTabMap:p,tabActivationDirection:q}=l(),[r,s]=d.useState(0),[t,u]=d.useState(null),v=d.useRef(new Set),w=d.useRef(new Set),x=d.useRef(null);(0,f.useIsoLayoutEffect)(()=>{if("u"<typeof ResizeObserver)return;let a=new ResizeObserver(()=>{v.current.forEach(a=>{a()})});return x.current=a,t&&a.observe(t),w.current.forEach(b=>{a.observe(b)}),()=>{a.disconnect(),x.current=null}},[t]);let z=(0,g.useStableCallback)(a=>(v.current.add(a),()=>{v.current.delete(a)})),A=(0,g.useStableCallback)(a=>(w.current.add(a),x.current?.observe(a),()=>{w.current.delete(a),x.current?.unobserve(a)})),B=d.useMemo(()=>({activateOnFocus:e,registerIndicatorUpdateListener:z,registerTabResizeObserverElement:A,tabsListElement:t}),[e,z,A,t]);return(0,c.jsx)(y.Provider,{value:B,children:(0,c.jsx)(T.CompositeRoot,{render:j,className:h,style:k,state:{orientation:o,tabActivationDirection:q},refs:[b,u],props:[{"aria-orientation":"vertical"===o?"vertical":void 0,role:"tablist"},n],stateAttributesMapping:m,highlightedIndex:r,enableHomeAndEndKeys:!0,loopFocus:i,orientation:o,onHighlightedIndexChange:s,onMapChange:p,disabledIndices:E.EMPTY_ARRAY})})});a.s(["Indicator",0,L,"List",0,U,"Panel",0,S,"Root",0,p,"Tab",0,B],25932);var V=a.i(25932),V=V,W=a.i(42261),X=a.i(68114);let Y=(0,W.cva)("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});a.s(["Tabs",0,function({className:a,orientation:b="horizontal",...d}){return(0,c.jsx)(V.Root,{"data-slot":"tabs","data-orientation":b,className:(0,X.cn)("group/tabs flex gap-2 data-horizontal:flex-col",a),...d})},"TabsContent",0,function({className:a,...b}){return(0,c.jsx)(V.Panel,{"data-slot":"tabs-content",className:(0,X.cn)("flex-1 text-sm outline-none",a),...b})},"TabsList",0,function({className:a,variant:b="default",...d}){return(0,c.jsx)(V.List,{"data-slot":"tabs-list","data-variant":b,className:(0,X.cn)(Y({variant:b}),a),...d})},"TabsTrigger",0,function({className:a,...b}){return(0,c.jsx)(V.Tab,{"data-slot":"tabs-trigger",className:(0,X.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",a),...b})}],75083)},87105,a=>{"use strict";var b=a.i(73895),c=a.i(1442);function d(a,d){return[(0,c.useSearchParams)().get(a)??d,(0,b.useCallback)(b=>{let c=new URL(window.location.href);b===d?c.searchParams.delete(a):c.searchParams.set(a,b),window.history.replaceState(null,"",c)},[a,d])]}a.s(["useQueryParam",0,d,"useTabParam",0,function(a,b){let[c,e]=d("tab",b);return[a.includes(c)?c:b,e]}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0o294sf._.js.map
|