From 796aa14d9b817de85904bf2a51728574b25e0426 Mon Sep 17 00:00:00 2001 From: Yad Konrad Date: Wed, 29 Apr 2026 10:39:55 -0400 Subject: [PATCH] fix(ui): hand-tune cost-tab table column widths The four Cost-tab tables (CommandCostList, OutlierCommandsTable, SessionEfficiencyTable, SessionCompareView) shipped with placeholder Tailwind w-* widths that left short numeric columns cramped against their sort chevrons (notably "Search" + chevron in SessionEfficiency overflowing w-16) and two-word headers like "Idle Total" wrapping. Tuned each column descriptor so: - numeric columns are fixed-width with breathing room for the header text + sort chevron - the description / prompt column keeps the slack as the only flex column - all headers fit on one line at the 1280px breakpoint (whitespace-nowrap on the header row enforces this) Widths use Tailwind's rem-based w-* classes (no px) so they scale with the user's font preference. --- CHANGELOG.md | 15 +++++++++++++++ .../src/components/cost/CommandCostList.tsx | 10 +++++----- .../src/components/cost/OutlierCommandsTable.tsx | 6 +++--- .../src/components/cost/SessionCompareView.tsx | 16 ++++++++-------- .../components/cost/SessionEfficiencyTable.tsx | 16 ++++++++-------- .../static/react/assets/index-5QqSjPeR.css | 1 + .../{index-Dm53Cml-.js => index-Cup01TTP.js} | 6 +++--- .../static/react/assets/index-qtmhGLlT.css | 1 - stackunderflow/static/react/index.html | 4 ++-- 9 files changed, 45 insertions(+), 30 deletions(-) create mode 100644 stackunderflow/static/react/assets/index-5QqSjPeR.css rename stackunderflow/static/react/assets/{index-Dm53Cml-.js => index-Cup01TTP.js} (96%) delete mode 100644 stackunderflow/static/react/assets/index-qtmhGLlT.css diff --git a/CHANGELOG.md b/CHANGELOG.md index f4d82c4..c790662 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +<<<<<<< HEAD ### Added - **Auto-reindex after ingest.** `run_ingest` now refreshes the search, tag, and Q&A indexes for every project that gained new messages, so users no longer have to POST to `/api/search/reindex`, `/api/tags/reindex`, `/api/qa/reindex` after ingest. Each service is invoked in its own try/except — a beta-service failure (tags or Q&A) cannot break ingest, and search itself fails soft. Gated by a new `auto_reindex_on_ingest` setting (default `True`, env `AUTO_REINDEX_ON_INGEST`) for power users who want to disable it. Per-project re-index, not full `reindex_all` — only the touched projects are touched. @@ -26,6 +27,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 and force a fresh build. `is_reindexing` and `config` are overlaid on the cached payload per request so live config edits aren't masked. - **`tool_count_distribution` split off `/api/dashboard-data`** onto its own `GET /api/tool-distribution` endpoint (mirrors the §D1 pattern that previously moved `command_details` to `/api/commands`). On chimera the dashboard payload drops from **846,774 → 846,274 bytes** (`wc -c` on real curls); the bucket map itself is 501 bytes / 66 buckets there. On busier projects with hundreds of distinct tool counts the saving is materially larger. The Overview tab's `CommandToolDistChart` now lazy-fetches the map after mount, so the chart renders an empty state for ~1 RTT instead of blocking initial paint. +- **Cost-tab table column widths hand-tuned** so cells no longer look cramped: + - `CommandCostList`: `When` 8rem → 7rem (timestamps fit cleanly), `%Total` / + `Tools` / `Steps` 4rem → 5rem so headers don't wedge against their sort + chevrons; `Prompt` keeps the slack as the only flex column. + - `OutlierCommandsTable`: `When` 7rem → 8rem to match the sibling commands + table; `Cost` 5rem → 6rem so `$1,234.56` has breathing room. + - `SessionEfficiencyTable`: `Edit` / `Read` / `Search` / `Bash` 4rem → 5rem + (`Search` + chevron previously overflowed `w-16`); `Idle Total` / `Idle Max` + 5rem → 6rem so the two-word headers stay on one line; `Class` 8rem → 9rem + for the `research-heavy` badge. + - `SessionCompareView`: numeric columns (`A`, `B`, `Δ`) get fixed 10rem widths + so the metric-label column gets the slack, and the loading skeleton matches. +- **All four cost-table headers** now wrap with `whitespace-nowrap` to guarantee + single-line headers at the 1280px breakpoint. ## [0.3.5] - 2026-04-25 diff --git a/stackunderflow-ui/src/components/cost/CommandCostList.tsx b/stackunderflow-ui/src/components/cost/CommandCostList.tsx index f2ee60f..855e87a 100644 --- a/stackunderflow-ui/src/components/cost/CommandCostList.tsx +++ b/stackunderflow-ui/src/components/cost/CommandCostList.tsx @@ -300,29 +300,29 @@ export default function CommandCostList({ data, onOpen, initialSort }: CommandCo
- + - + diff --git a/stackunderflow-ui/src/components/cost/OutlierCommandsTable.tsx b/stackunderflow-ui/src/components/cost/OutlierCommandsTable.tsx index a711598..cd78d22 100644 --- a/stackunderflow-ui/src/components/cost/OutlierCommandsTable.tsx +++ b/stackunderflow-ui/src/components/cost/OutlierCommandsTable.tsx @@ -304,7 +304,7 @@ function OutlierSection({
Prompt %Total%Total
- + setSort('timestamp' as SortableKey)} - className="w-28" + className="w-32" /> setSort('cost' as SortableKey)} align="right" - className="w-20" + className="w-24" /> diff --git a/stackunderflow-ui/src/components/cost/SessionCompareView.tsx b/stackunderflow-ui/src/components/cost/SessionCompareView.tsx index 2b4597e..648e657 100644 --- a/stackunderflow-ui/src/components/cost/SessionCompareView.tsx +++ b/stackunderflow-ui/src/components/cost/SessionCompareView.tsx @@ -251,11 +251,11 @@ export default function SessionCompareView({
Prompt
- + - - - + + + @@ -318,15 +318,15 @@ export default function SessionCompareView({
MetricABΔABΔ
- + - - - + diff --git a/stackunderflow-ui/src/components/cost/SessionEfficiencyTable.tsx b/stackunderflow-ui/src/components/cost/SessionEfficiencyTable.tsx index ceb39e1..bb2809c 100644 --- a/stackunderflow-ui/src/components/cost/SessionEfficiencyTable.tsx +++ b/stackunderflow-ui/src/components/cost/SessionEfficiencyTable.tsx @@ -255,7 +255,7 @@ export default function SessionEfficiencyTable({ data }: SessionEfficiencyTableP
Metric + A · {shortSession(data.a.session_id)} + B · {shortSession(data.b.session_id)} Δ (B − A)Δ (B − A)
- + setSort('classification')} - className="px-3 py-2 w-32" + className="px-3 py-2 w-36" /> setSort('edit_ratio')} align="right" - className="px-3 py-2 w-16" + className="px-3 py-2 w-20" /> setSort('read_ratio')} align="right" - className="px-3 py-2 w-16" + className="px-3 py-2 w-20" /> setSort('search_ratio')} align="right" - className="px-3 py-2 w-16" + className="px-3 py-2 w-20" /> setSort('bash_ratio')} align="right" - className="px-3 py-2 w-16" + className="px-3 py-2 w-20" /> setSort('idle_gap_total_s')} align="right" - className="px-3 py-2 w-20" + className="px-3 py-2 w-24" /> setSort('idle_gap_max_s')} align="right" - className="px-3 py-2 w-20" + className="px-3 py-2 w-24" /> diff --git a/stackunderflow/static/react/assets/index-5QqSjPeR.css b/stackunderflow/static/react/assets/index-5QqSjPeR.css new file mode 100644 index 0000000..7d5a7a9 --- /dev/null +++ b/stackunderflow/static/react/assets/index-5QqSjPeR.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(102 126 234 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(102 126 234 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: rgb(17 24 39 / 10%);--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%);--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-invert{--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.right-0{right:0}.top-1\/2{top:50%}.top-5{top:1.25rem}.top-full{top:100%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.-mb-px{margin-bottom:-1px}.-mr-0\.5{margin-right:-.125rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-64{height:16rem}.h-8{height:2rem}.h-80{height:20rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-24{max-height:6rem}.max-h-40{max-height:10rem}.max-h-60{max-height:15rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[70vh\]{max-height:70vh}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-52{width:13rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-80{width:20rem}.w-96{width:24rem}.w-full{width:100%}.w-screen{width:100vw}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.max-w-3xl{max-width:48rem}.max-w-7xl{max-width:80rem}.max-w-\[180px\]{max-width:180px}.max-w-\[240px\]{max-width:240px}.max-w-\[85\%\]{max-width:85%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity, 1))}.divide-indigo-900\/20>:not([hidden])~:not([hidden]){border-color:#312e8133}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-t{border-top-width:1px}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-amber-500\/30{border-color:#f59e0b4d}.border-amber-600\/50{border-color:#d9770680}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(162 173 249 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(102 126 234 / var(--tw-border-opacity, 1))}.border-blue-500\/30{border-color:#667eea4d}.border-cyan-300{--tw-border-opacity: 1;border-color:rgb(103 232 249 / var(--tw-border-opacity, 1))}.border-emerald-300{--tw-border-opacity: 1;border-color:rgb(110 231 183 / var(--tw-border-opacity, 1))}.border-emerald-500\/30{border-color:#10b9814d}.border-gray-100\/30{border-color:#f3f4f64d}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-200\/50{border-color:#e5e7eb80}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.border-green-300{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-800{--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.border-indigo-300{--tw-border-opacity: 1;border-color:rgb(165 180 252 / var(--tw-border-opacity, 1))}.border-indigo-400{--tw-border-opacity: 1;border-color:rgb(129 140 248 / var(--tw-border-opacity, 1))}.border-indigo-500\/30{border-color:#6366f14d}.border-indigo-500\/40{border-color:#6366f166}.border-indigo-500\/50{border-color:#6366f180}.border-indigo-500\/60{border-color:#6366f199}.border-indigo-700{--tw-border-opacity: 1;border-color:rgb(67 56 202 / var(--tw-border-opacity, 1))}.border-indigo-800\/60{border-color:#3730a399}.border-indigo-900\/30{border-color:#312e814d}.border-indigo-900\/40{border-color:#312e8166}.border-indigo-900\/50{border-color:#312e8180}.border-orange-300{--tw-border-opacity: 1;border-color:rgb(253 186 116 / var(--tw-border-opacity, 1))}.border-pink-300{--tw-border-opacity: 1;border-color:rgb(249 168 212 / var(--tw-border-opacity, 1))}.border-purple-300{--tw-border-opacity: 1;border-color:rgb(216 180 254 / var(--tw-border-opacity, 1))}.border-purple-500\/30{border-color:#a855f74d}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.border-red-900\/30{border-color:#7f1d1d4d}.border-red-900\/40{border-color:#7f1d1d66}.border-rose-300{--tw-border-opacity: 1;border-color:rgb(253 164 175 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-300{--tw-border-opacity: 1;border-color:rgb(253 224 71 / var(--tw-border-opacity, 1))}.border-yellow-800{--tw-border-opacity: 1;border-color:rgb(133 77 14 / var(--tw-border-opacity, 1))}.border-zinc-200{--tw-border-opacity: 1;border-color:rgb(228 228 231 / var(--tw-border-opacity, 1))}.border-t-blue-500{--tw-border-opacity: 1;border-top-color:rgb(102 126 234 / var(--tw-border-opacity, 1))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-amber-500\/20{background-color:#f59e0b33}.bg-amber-600\/20{background-color:#d9770633}.bg-black\/60{background-color:#0009}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(224 228 253 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(102 126 234 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#667eea1a}.bg-blue-500\/20{background-color:#667eea33}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(90 111 216 / var(--tw-bg-opacity, 1))}.bg-cyan-100{--tw-bg-opacity: 1;background-color:rgb(207 250 254 / var(--tw-bg-opacity, 1))}.bg-emerald-100{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-emerald-500\/20{background-color:#10b98133}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-gray-100\/40{background-color:#f3f4f666}.bg-gray-100\/50{background-color:#f3f4f680}.bg-gray-100\/60{background-color:#f3f4f699}.bg-gray-100\/70{background-color:#f3f4f6b3}.bg-gray-100\/80{background-color:#f3f4f6cc}.bg-gray-100\/90{background-color:#f3f4f6e6}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-200\/50{background-color:#e5e7eb80}.bg-gray-200\/60{background-color:#e5e7eb99}.bg-gray-200\/80{background-color:#e5e7ebcc}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-50\/30{background-color:#f9fafb4d}.bg-gray-50\/40{background-color:#f9fafb66}.bg-gray-50\/50{background-color:#f9fafb80}.bg-gray-50\/60{background-color:#f9fafb99}.bg-gray-50\/70{background-color:#f9fafbb3}.bg-gray-50\/80{background-color:#f9fafbcc}.bg-gray-50\/95{background-color:#f9fafbf2}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-indigo-500\/20{background-color:#6366f133}.bg-indigo-500\/25{background-color:#6366f140}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-indigo-600\/20{background-color:#4f46e533}.bg-indigo-950\/30{background-color:#1e1b4b4d}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-pink-100{--tw-bg-opacity: 1;background-color:rgb(252 231 243 / var(--tw-bg-opacity, 1))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/15{background-color:#a855f726}.bg-purple-500\/20{background-color:#a855f733}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500\/70{background-color:#ef4444b3}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-rose-100{--tw-bg-opacity: 1;background-color:rgb(255 228 230 / var(--tw-bg-opacity, 1))}.bg-violet-600{--tw-bg-opacity: 1;background-color:rgb(124 58 237 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-zinc-50\/50{background-color:#fafafa80}.bg-zinc-50\/60{background-color:#fafafa99}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-indigo-900\/30{--tw-gradient-from: rgb(49 46 129 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 46 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-900\/40{--tw-gradient-from: rgb(49 46 129 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 46 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-900\/20{--tw-gradient-from: rgb(127 29 29 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(127 29 29 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-900\/30{--tw-gradient-from: rgb(127 29 29 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(127 29 29 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-gray-50\/50{--tw-gradient-to: rgb(249 250 251 / .5) var(--tw-gradient-to-position)}.to-gray-50\/60{--tw-gradient-to: rgb(249 250 251 / .6) var(--tw-gradient-to-position)}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-7{padding-left:1.75rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-3{padding-right:.75rem}.pr-6{padding-right:1.5rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-1\.5{padding-top:.375rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.normal-case{text-transform:none}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-normal{letter-spacing:0em}.tracking-wider{letter-spacing:.05em}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-blue-200{--tw-text-opacity: 1;color:rgb(193 200 251 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(162 173 249 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(132 148 239 / var(--tw-text-opacity, 1))}.text-blue-400\/70{color:#8494efb3}.text-blue-800{--tw-text-opacity: 1;color:rgb(59 71 152 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-cyan-800{--tw-text-opacity: 1;color:rgb(21 94 117 / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-400\/80{color:#34d399cc}.text-emerald-800{--tw-text-opacity: 1;color:rgb(6 95 70 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-indigo-200{--tw-text-opacity: 1;color:rgb(199 210 254 / var(--tw-text-opacity, 1))}.text-indigo-300{--tw-text-opacity: 1;color:rgb(165 180 252 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-indigo-600\/80{color:#4f46e5cc}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-indigo-800{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-pink-400{--tw-text-opacity: 1;color:rgb(244 114 182 / var(--tw-text-opacity, 1))}.text-pink-800{--tw-text-opacity: 1;color:rgb(157 23 77 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-400\/70{color:#c084fcb3}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-700\/80{color:#b91c1ccc}.text-red-700\/90{color:#b91c1ce6}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity, 1))}.text-violet-400{--tw-text-opacity: 1;color:rgb(167 139 250 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.text-zinc-500{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity, 1))}.text-zinc-600{--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity, 1))}.text-zinc-700{--tw-text-opacity: 1;color:rgb(63 63 70 / var(--tw-text-opacity, 1))}.text-zinc-800{--tw-text-opacity: 1;color:rgb(39 39 42 / var(--tw-text-opacity, 1))}.text-zinc-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.placeholder-zinc-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(113 113 122 / var(--tw-placeholder-opacity, 1))}.placeholder-zinc-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(113 113 122 / var(--tw-placeholder-opacity, 1))}.accent-indigo-600{accent-color:#4f46e5}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-indigo-400\/70{--tw-ring-color: rgb(129 140 248 / .7)}.\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\[suf\:beta\]{suf:beta}.\[suf\:tabs\]{suf:tabs}.\[suf\:theme\]{suf:theme}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#f3f4f6}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#9ca3af}html.dark ::-webkit-scrollbar-track{background:#111827}html.dark ::-webkit-scrollbar-thumb{background:#374151}html.dark ::-webkit-scrollbar-thumb:hover{background:#4b5563}pre code{font-family:JetBrains Mono,Fira Code,Monaco,Consolas,monospace}.prose-invert{--tw-prose-body: rgb(55 65 81);--tw-prose-headings: rgb(17 24 39);--tw-prose-links: rgb(67 56 202);--tw-prose-bold: rgb(17 24 39);--tw-prose-counters: rgb(107 114 128);--tw-prose-bullets: rgb(156 163 175);--tw-prose-hr: rgb(229 231 235);--tw-prose-quotes: rgb(17 24 39);--tw-prose-quote-borders: rgb(229 231 235);--tw-prose-captions: rgb(107 114 128);--tw-prose-code: rgb(29 78 216);--tw-prose-pre-code: rgb(55 65 81);--tw-prose-pre-bg: rgb(243 244 246);--tw-prose-th-borders: rgb(229 231 235);--tw-prose-td-borders: rgb(243 244 246)}html.dark .prose-invert{--tw-prose-body: rgb(209 213 219);--tw-prose-headings: rgb(243 244 246);--tw-prose-links: rgb(96 165 250);--tw-prose-bold: rgb(243 244 246);--tw-prose-counters: rgb(156 163 175);--tw-prose-bullets: rgb(107 114 128);--tw-prose-hr: rgb(55 65 81);--tw-prose-quotes: rgb(243 244 246);--tw-prose-quote-borders: rgb(55 65 81);--tw-prose-captions: rgb(156 163 175);--tw-prose-code: rgb(147 197 253);--tw-prose-pre-code: rgb(209 213 219);--tw-prose-pre-bg: rgb(17 24 39);--tw-prose-th-borders: rgb(55 65 81);--tw-prose-td-borders: rgb(31 41 55)}.animate-spin{transition:none}.first\:pt-0:first-child{padding-top:0}.last\:pb-0:last-child{padding-bottom:0}.hover\:border-gray-200:hover{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.hover\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.hover\:border-zinc-200:hover{--tw-border-opacity: 1;border-color:rgb(228 228 231 / var(--tw-border-opacity, 1))}.hover\:bg-amber-500\/25:hover{background-color:#f59e0b40}.hover\:bg-amber-500\/30:hover{background-color:#f59e0b4d}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(102 126 234 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-500\/30:hover{background-color:#667eea4d}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(74 90 184 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-500\/30:hover{background-color:#10b9814d}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100\/50:hover{background-color:#f3f4f680}.hover\:bg-gray-100\/60:hover{background-color:#f3f4f699}.hover\:bg-gray-100\/70:hover{background-color:#f3f4f6b3}.hover\:bg-gray-100\/80:hover{background-color:#f3f4f6cc}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200\/70:hover{background-color:#e5e7ebb3}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50\/70:hover{background-color:#f9fafbb3}.hover\:bg-indigo-500\/30:hover{background-color:#6366f14d}.hover\:bg-purple-500\/25:hover{background-color:#a855f740}.hover\:bg-purple-500\/30:hover{background-color:#a855f74d}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-300:hover{--tw-bg-opacity: 1;background-color:rgb(252 165 165 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-zinc-200:hover{--tw-bg-opacity: 1;background-color:rgb(228 228 231 / var(--tw-bg-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(162 173 249 / var(--tw-text-opacity, 1))}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(132 148 239 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-indigo-300:hover{--tw-text-opacity: 1;color:rgb(165 180 252 / var(--tw-text-opacity, 1))}.hover\:text-indigo-400:hover{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.hover\:text-indigo-800:hover{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-red-800:hover{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-70:hover{opacity:.7}.hover\:brightness-125:hover{--tw-brightness: brightness(1.25);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(102 126 234 / var(--tw-border-opacity, 1))}.focus\:border-blue-600:focus{--tw-border-opacity: 1;border-color:rgb(90 111 216 / var(--tw-border-opacity, 1))}.focus\:border-indigo-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.focus\:border-zinc-500:focus{--tw-border-opacity: 1;border-color:rgb(113 113 122 / var(--tw-border-opacity, 1))}.focus\:bg-gray-100\/60:focus{background-color:#f3f4f699}.focus\:bg-gray-100\/70:focus{background-color:#f3f4f6b3}.focus\:bg-gray-100\/80:focus{background-color:#f3f4f6cc}.focus\:bg-red-100:focus{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.focus\:text-indigo-800:focus{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(90 111 216 / var(--tw-ring-opacity, 1))}.focus\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-indigo-500\/60:focus{--tw-ring-color: rgb(99 102 241 / .6)}.focus\:ring-offset-0:focus{--tw-ring-offset-width: 0px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-blue-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(102 126 234 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-indigo-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(129 140 248 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-300:disabled{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.disabled\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:focus-within .group-focus-within\:opacity-100{opacity:1}.group:hover .group-hover\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:opacity-100{opacity:1}.group:focus .group-focus\:opacity-100{opacity:1}.prose-headings\:font-semibold :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:600}.prose-headings\:text-gray-800 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.prose-p\:leading-relaxed :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){line-height:1.625}.prose-p\:text-gray-700 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.prose-a\:text-blue-400 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(132 148 239 / var(--tw-text-opacity, 1))}.prose-a\:no-underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:none}.hover\:prose-a\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))):hover{text-decoration-line:underline}.prose-blockquote\:border-gray-300 :is(:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.prose-blockquote\:text-gray-600 :is(:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.prose-strong\:text-gray-800 :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.prose-code\:rounded :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:.25rem}.prose-code\:bg-gray-100 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.prose-code\:px-1 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.25rem;padding-right:.25rem}.prose-code\:py-0\.5 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.125rem;padding-bottom:.125rem}.prose-code\:text-xs :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-code\:text-blue-700 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(74 90 184 / var(--tw-text-opacity, 1))}.prose-code\:before\:content-none :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):before{--tw-content: none;content:var(--tw-content)}.prose-code\:after\:content-none :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):after{--tw-content: none;content:var(--tw-content)}.prose-pre\:bg-transparent :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){background-color:transparent}.prose-pre\:p-0 :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){padding:0}.prose-li\:text-gray-700 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.prose-th\:text-gray-700 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.prose-td\:text-gray-600 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.prose-hr\:border-gray-300 :is(:where(hr):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.dark\:divide-gray-800:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(31 41 55 / var(--tw-divide-opacity, 1))}.dark\:border-amber-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(180 83 9 / var(--tw-border-opacity, 1))}.dark\:border-amber-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.dark\:border-amber-800\/60:is(.dark *){border-color:#92400e99}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(74 90 184 / var(--tw-border-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(59 71 152 / var(--tw-border-opacity, 1))}.dark\:border-blue-800\/60:is(.dark *){border-color:#3b479899}.dark\:border-cyan-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(14 116 144 / var(--tw-border-opacity, 1))}.dark\:border-cyan-800\/60:is(.dark *){border-color:#155e7599}.dark\:border-emerald-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(4 120 87 / var(--tw-border-opacity, 1))}.dark\:border-emerald-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(6 95 70 / var(--tw-border-opacity, 1))}.dark\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-gray-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.dark\:border-gray-800\/30:is(.dark *){border-color:#1f29374d}.dark\:border-gray-800\/50:is(.dark *){border-color:#1f293780}.dark\:border-green-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-green-800\/60:is(.dark *){border-color:#16653499}.dark\:border-indigo-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(67 56 202 / var(--tw-border-opacity, 1))}.dark\:border-indigo-800\/60:is(.dark *){border-color:#3730a399}.dark\:border-orange-800\/60:is(.dark *){border-color:#9a341299}.dark\:border-pink-800\/60:is(.dark *){border-color:#9d174d99}.dark\:border-purple-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity, 1))}.dark\:border-purple-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(107 33 168 / var(--tw-border-opacity, 1))}.dark\:border-purple-800\/60:is(.dark *){border-color:#6b21a899}.dark\:border-red-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.dark\:border-red-800\/60:is(.dark *){border-color:#991b1b99}.dark\:border-red-900\/40:is(.dark *){border-color:#7f1d1d66}.dark\:border-red-900\/50:is(.dark *){border-color:#7f1d1d80}.dark\:border-red-900\/60:is(.dark *){border-color:#7f1d1d99}.dark\:border-rose-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(190 18 60 / var(--tw-border-opacity, 1))}.dark\:border-rose-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(159 18 57 / var(--tw-border-opacity, 1))}.dark\:border-yellow-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(133 77 14 / var(--tw-border-opacity, 1))}.dark\:border-yellow-800\/60:is(.dark *){border-color:#854d0e99}.dark\:border-zinc-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(63 63 70 / var(--tw-border-opacity, 1))}.dark\:border-zinc-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity, 1))}.dark\:bg-amber-900\/20:is(.dark *){background-color:#78350f33}.dark\:bg-amber-900\/30:is(.dark *){background-color:#78350f4d}.dark\:bg-amber-900\/40:is(.dark *){background-color:#78350f66}.dark\:bg-amber-900\/50:is(.dark *){background-color:#78350f80}.dark\:bg-blue-900\/40:is(.dark *){background-color:#2c357866}.dark\:bg-blue-900\/50:is(.dark *){background-color:#2c357880}.dark\:bg-blue-900\/60:is(.dark *){background-color:#2c357899}.dark\:bg-cyan-900\/40:is(.dark *){background-color:#164e6366}.dark\:bg-cyan-900\/50:is(.dark *){background-color:#164e6380}.dark\:bg-emerald-900\/40:is(.dark *){background-color:#064e3b66}.dark\:bg-emerald-900\/50:is(.dark *){background-color:#064e3b80}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700\/40:is(.dark *){background-color:#37415166}.dark\:bg-gray-700\/50:is(.dark *){background-color:#37415180}.dark\:bg-gray-700\/60:is(.dark *){background-color:#37415199}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/20:is(.dark *){background-color:#1f293733}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/40:is(.dark *){background-color:#1f293766}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-800\/60:is(.dark *){background-color:#1f293799}.dark\:bg-gray-800\/80:is(.dark *){background-color:#1f2937cc}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900\/30:is(.dark *){background-color:#1118274d}.dark\:bg-gray-900\/40:is(.dark *){background-color:#11182766}.dark\:bg-gray-900\/60:is(.dark *){background-color:#11182799}.dark\:bg-gray-900\/95:is(.dark *){background-color:#111827f2}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950\/50:is(.dark *){background-color:#03071280}.dark\:bg-gray-950\/60:is(.dark *){background-color:#03071299}.dark\:bg-green-900\/40:is(.dark *){background-color:#14532d66}.dark\:bg-green-900\/50:is(.dark *){background-color:#14532d80}.dark\:bg-indigo-900\/40:is(.dark *){background-color:#312e8166}.dark\:bg-indigo-900\/50:is(.dark *){background-color:#312e8180}.dark\:bg-orange-900\/40:is(.dark *){background-color:#7c2d1266}.dark\:bg-pink-900\/40:is(.dark *){background-color:#83184366}.dark\:bg-purple-900\/40:is(.dark *){background-color:#581c8766}.dark\:bg-purple-900\/50:is(.dark *){background-color:#581c8780}.dark\:bg-red-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(153 27 27 / var(--tw-bg-opacity, 1))}.dark\:bg-red-900\/20:is(.dark *){background-color:#7f1d1d33}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-red-900\/50:is(.dark *){background-color:#7f1d1d80}.dark\:bg-red-950\/30:is(.dark *){background-color:#450a0a4d}.dark\:bg-rose-900\/40:is(.dark *){background-color:#88133766}.dark\:bg-rose-900\/50:is(.dark *){background-color:#88133780}.dark\:bg-yellow-500\/30:is(.dark *){background-color:#eab3084d}.dark\:bg-yellow-900\/20:is(.dark *){background-color:#713f1233}.dark\:bg-yellow-900\/40:is(.dark *){background-color:#713f1266}.dark\:bg-yellow-900\/50:is(.dark *){background-color:#713f1280}.dark\:bg-zinc-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity, 1))}.dark\:bg-zinc-900\/50:is(.dark *){background-color:#18181b80}.dark\:bg-zinc-900\/60:is(.dark *){background-color:#18181b99}.dark\:to-gray-900\/30:is(.dark *){--tw-gradient-to: rgb(17 24 39 / .3) var(--tw-gradient-to-position)}.dark\:to-gray-900\/40:is(.dark *){--tw-gradient-to: rgb(17 24 39 / .4) var(--tw-gradient-to-position)}.dark\:text-amber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(193 200 251 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(162 173 249 / var(--tw-text-opacity, 1))}.dark\:text-cyan-300:is(.dark *){--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.dark\:text-emerald-300:is(.dark *){--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-indigo-200:is(.dark *){--tw-text-opacity: 1;color:rgb(199 210 254 / var(--tw-text-opacity, 1))}.dark\:text-indigo-300:is(.dark *){--tw-text-opacity: 1;color:rgb(165 180 252 / var(--tw-text-opacity, 1))}.dark\:text-indigo-400\/80:is(.dark *){color:#818cf8cc}.dark\:text-orange-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.dark\:text-pink-300:is(.dark *){--tw-text-opacity: 1;color:rgb(249 168 212 / var(--tw-text-opacity, 1))}.dark\:text-purple-300:is(.dark *){--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.dark\:text-red-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-300\/70:is(.dark *){color:#fca5a5b3}.dark\:text-red-300\/80:is(.dark *){color:#fca5a5cc}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-400\/80:is(.dark *){color:#f87171cc}.dark\:text-rose-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 164 175 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:text-zinc-100:is(.dark *){--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity, 1))}.dark\:text-zinc-200:is(.dark *){--tw-text-opacity: 1;color:rgb(228 228 231 / var(--tw-text-opacity, 1))}.dark\:text-zinc-300:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity, 1))}.dark\:text-zinc-400:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}.dark\:placeholder-gray-600:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-gray-600:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.dark\:hover\:border-gray-600:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:hover\:border-gray-700:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:hover\:border-zinc-700:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(63 63 70 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700\/50:hover:is(.dark *){background-color:#37415180}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-800\/30:hover:is(.dark *){background-color:#1f29374d}.dark\:hover\:bg-gray-800\/40:hover:is(.dark *){background-color:#1f293766}.dark\:hover\:bg-gray-800\/50:hover:is(.dark *){background-color:#1f293780}.dark\:hover\:bg-gray-800\/60:hover:is(.dark *){background-color:#1f293799}.dark\:hover\:bg-gray-900\/70:hover:is(.dark *){background-color:#111827b3}.dark\:hover\:bg-red-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-900\/20:hover:is(.dark *){background-color:#7f1d1d33}.dark\:hover\:bg-red-900\/30:hover:is(.dark *){background-color:#7f1d1d4d}.dark\:hover\:bg-red-900\/70:hover:is(.dark *){background-color:#7f1d1db3}.dark\:hover\:bg-zinc-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-gray-100:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:hover\:text-indigo-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(199 210 254 / var(--tw-text-opacity, 1))}.dark\:hover\:text-red-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:hover\:text-red-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:bg-gray-800\/40:focus:is(.dark *){background-color:#1f293766}.dark\:focus\:bg-gray-800\/50:focus:is(.dark *){background-color:#1f293780}.dark\:focus\:bg-gray-800\/60:focus:is(.dark *){background-color:#1f293799}.dark\:focus\:bg-red-900\/20:focus:is(.dark *){background-color:#7f1d1d33}.dark\:focus\:text-indigo-200:focus:is(.dark *){--tw-text-opacity: 1;color:rgb(199 210 254 / var(--tw-text-opacity, 1))}.dark\:focus-visible\:ring-gray-600:focus-visible:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity, 1))}.dark\:disabled\:bg-gray-700:disabled:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:prose-headings\:text-gray-200 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:prose-p\:text-gray-300 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:prose-blockquote\:border-gray-700 :is(:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:prose-blockquote\:text-gray-400 :is(:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:prose-strong\:text-gray-200 :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:prose-code\:bg-gray-800 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:prose-code\:text-blue-300 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(162 173 249 / var(--tw-text-opacity, 1))}.dark\:prose-li\:text-gray-300 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:prose-th\:text-gray-300 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:prose-td\:text-gray-400 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:prose-hr\:border-gray-700 :is(:where(hr):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}@media(min-width:640px){.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media(min-width:768px){.md\:flex{display:flex}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(min-width:1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}} diff --git a/stackunderflow/static/react/assets/index-Dm53Cml-.js b/stackunderflow/static/react/assets/index-Cup01TTP.js similarity index 96% rename from stackunderflow/static/react/assets/index-Dm53Cml-.js rename to stackunderflow/static/react/assets/index-Cup01TTP.js index a7b907b..2ed5708 100644 --- a/stackunderflow/static/react/assets/index-Dm53Cml-.js +++ b/stackunderflow/static/react/assets/index-Cup01TTP.js @@ -520,9 +520,9 @@ Click to filter dashboard to current week`;return h.jsxs("button",{type:"button" — — -`)})]})]})}function PNe(e){const t=typeof e=="number"?new Date(e<1e12?e*1e3:e):new Date(e),n=Date.now()-t.getTime();if(n<0)return"just now";const a=Math.floor(n/1e3),i=Math.floor(a/60),o=Math.floor(i/60),l=Math.floor(o/24);return a<60?"just now":i<60?`${i}m ago`:o<24?`${o}h ago`:l<30?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:t.getFullYear()!==new Date().getFullYear()?"numeric":void 0})}function WO({timestamp:e}){const t=PNe(e),r=typeof e=="number"?new Date(e<1e12?e*1e3:e):new Date(e);return h.jsx("time",{dateTime:r.toISOString(),title:r.toLocaleString(),className:"text-gray-500 text-xs",children:t})}const Hq=20;function jNe(e,t){const[r,n]=P.useState(e);return P.useEffect(()=>{const a=setTimeout(()=>n(e),t);return()=>clearTimeout(a)},[e,t]),r}function MNe(e){switch(e){case"user":return"blue";case"assistant":return"green";case"system":return"yellow";case"tool":return"purple";default:return"gray"}}function FNe({html:e}){const r=e.replace(/<\/?(?!mark\b)[a-z][^>]*>/gi,"").split(/(|<\/mark>)/gi),n=[];let a=!1;for(let i=0;i"){a=!0;continue}if(o.toLowerCase()===""){a=!1;continue}o!==""&&(a?n.push(h.jsx("mark",{className:"bg-yellow-200 dark:bg-yellow-500/30 text-yellow-900 dark:text-yellow-200 rounded-sm px-0.5",children:o},i)):n.push(o))}return h.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 leading-relaxed",children:n})}function $Ne({result:e}){return h.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-800 hover:bg-gray-100/70 dark:hover:bg-gray-800/50 transition-colors",children:h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"mb-1.5",children:e.snippet?h.jsx(FNe,{html:e.snippet}):h.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-300 leading-relaxed line-clamp-3",children:e.content.length>300?e.content.slice(0,300)+"...":e.content})}),h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(Qn,{color:MNe(e.role),children:e.role}),e.model&&e.model!=="N/A"&&h.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:e.model}),h.jsx("span",{className:"text-[10px] text-gray-600 dark:text-gray-400 font-mono truncate max-w-[180px]",children:e.session_id}),h.jsx(WO,{timestamp:e.timestamp})]})]}),h.jsx("div",{className:"flex-shrink-0 text-right",children:h.jsx("span",{className:"text-[10px] font-mono text-gray-500",children:e.relevance.toFixed(2)})})]})})}function BNe({projectName:e,initialQuery:t=""}){const[r,n]=P.useState(t),[a,i]=P.useState(1),[o,l]=P.useState(!1),u=P.useRef(null),d=jNe(r,300);P.useEffect(()=>{i(1)},[d]),P.useEffect(()=>{var b;(b=u.current)==null||b.focus()},[]);const{data:p,isLoading:f,isError:m,error:y}=Jr({queryKey:["search",e,d,a],queryFn:()=>qX({q:d,project:e,page:a,per_page:Hq}),enabled:d.length>0}),x=P.useCallback(async()=>{l(!0);try{await XX()}finally{l(!1)}},[]),S=p?Math.ceil(p.total/Hq):0;return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-800",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(ha,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500"}),h.jsx("input",{ref:u,type:"text",value:r,onChange:b=>n(b.target.value),placeholder:"Search messages...",className:"w-full pl-9 pr-3 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-sm text-gray-800 dark:text-gray-200 placeholder-gray-500 focus:outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600 transition-colors"})]}),h.jsxs("button",{onClick:x,disabled:o,className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium text-gray-600 dark:text-gray-400 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-300 dark:hover:border-gray-600 disabled:opacity-50 transition-colors",title:"Reindex search",children:[h.jsx(Xa,{size:14,className:o?"animate-spin":""}),"Reindex"]})]}),p&&d&&h.jsxs("p",{className:"mt-2 text-xs text-gray-500",children:[p.total," result",p.total!==1?"s":""," for “",p.query,"”"]})]}),h.jsxs("div",{className:"flex-1 overflow-auto",children:[!d&&h.jsx(ya,{icon:h.jsx(ha,{size:32}),title:"Search messages",description:"Enter a query to search across all messages in this project."}),d&&f&&h.jsx(Wa,{message:"Searching..."}),m&&h.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[h.jsx(cY,{size:32,className:"text-red-400 mb-2"}),h.jsx("p",{className:"text-sm text-red-400 font-medium",children:"Search failed"}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:y instanceof Error?y.message:"An unexpected error occurred"})]}),p&&p.results.length===0&&h.jsx(ya,{icon:h.jsx(ha,{size:32}),title:"No results found",description:`No messages match "${d}". Try a different search term.`}),p&&p.results.length>0&&h.jsx("div",{children:p.results.map((b,w)=>h.jsx($Ne,{result:b},`${b.session_id}-${w}`))})]}),p&&S>1&&h.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-200 dark:border-gray-800",children:[h.jsxs("button",{onClick:()=>i(b=>Math.max(1,b-1)),disabled:a<=1,className:"flex items-center gap-1 px-2 py-1 text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[h.jsx(nN,{size:14}),"Prev"]}),h.jsxs("span",{className:"text-xs text-gray-500",children:["Page ",a," of ",S]}),h.jsxs("button",{onClick:()=>i(b=>Math.min(S,b+1)),disabled:a>=S,className:"flex items-center gap-1 px-2 py-1 text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:["Next",h.jsx(to,{size:14})]})]})]})}const UNe=20,O1={resolved:{label:"resolved",className:"bg-emerald-100 text-emerald-800 border-emerald-300 dark:bg-emerald-900/40 dark:text-emerald-300 dark:border-emerald-800",title:"Answer appears to have worked — no follow-up frustration detected."},looped:{label:"looped",className:"bg-amber-100 text-amber-800 border-amber-300 dark:bg-amber-900/40 dark:text-amber-300 dark:border-amber-800",title:"User kept asking variants of the same question — agent may have gone in circles."},abandoned:{label:"abandoned",className:"bg-rose-100 text-rose-800 border-rose-300 dark:bg-rose-900/40 dark:text-rose-300 dark:border-rose-800",title:"Question never got a follow-up or resolution signal."},open:{label:"open",className:"bg-white dark:bg-gray-800 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-700",title:"Not enough signal to classify."}};function zNe({qa:e}){const t=e.question_text.length>200?e.question_text.slice(0,200)+"...":e.question_text,r=e.answer_text.length>200?e.answer_text.slice(0,200)+"...":e.answer_text;return h.jsxs("div",{className:"w-full px-4 py-3 border-b border-gray-200 dark:border-gray-800",children:[h.jsx("div",{className:"mb-1.5",children:h.jsx("p",{className:"text-sm text-gray-800 dark:text-gray-200 font-medium line-clamp-2",children:t})}),h.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 line-clamp-2 mb-2",children:r}),h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.resolution_status&&e.resolution_status!=="open"&&h.jsxs("span",{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[10px] font-medium rounded-full border ${O1[e.resolution_status].className}`,title:O1[e.resolution_status].title,children:[O1[e.resolution_status].label,e.loop_count>1&&e.resolution_status==="looped"&&` ×${e.loop_count}`]}),e.code_snippets.length>0&&h.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[10px] font-medium rounded-full border bg-purple-100 text-purple-800 border-purple-300 dark:bg-purple-900/50 dark:text-purple-300 dark:border-purple-800",children:[h.jsx(aN,{size:10}),"code"]}),e.tools_used.length>0&&h.jsxs("span",{className:"text-[10px] text-gray-500 font-mono",children:[e.tools_used.slice(0,3).join(", "),e.tools_used.length>3&&` +${e.tools_used.length-3}`]}),e.model&&h.jsx("span",{className:"text-[10px] text-gray-600 dark:text-gray-400 font-mono",children:e.model}),h.jsx("span",{className:"ml-auto",children:h.jsx(WO,{timestamp:e.timestamp})})]})]})}function qNe(e,t){const r=[...e];switch(t){case"recent":return r.sort((n,a)=>new Date(a.timestamp).getTime()-new Date(n.timestamp).getTime());case"tools":return r.sort((n,a)=>a.tools_used.length-n.tools_used.length);case"has_code":return r.sort((n,a)=>{const i=n.code_snippets.length>0,o=a.code_snippets.length>0;return i===o?new Date(a.timestamp).getTime()-new Date(n.timestamp).getTime():i?-1:1});default:return r}}function GNe({projectName:e}){const[t,r]=P.useState(""),[n,a]=P.useState(1),[i,o]=P.useState("recent"),[l,u]=P.useState("all"),[d,p]=P.useState(!1);P.useEffect(()=>{a(1)},[t,l]);const{data:f,isLoading:m}=Jr({queryKey:["qa-list",e,t,l,n],queryFn:()=>zX({project:e,search:t||void 0,resolution_status:l==="all"?void 0:l,page:n,per_page:UNe})}),y=async()=>{p(!0);try{await ZX()}finally{p(!1)}},x=(f==null?void 0:f.results)??[],S=qNe(x,i),b=(f==null?void 0:f.total_pages)??0;return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-800",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(ha,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500"}),h.jsx("input",{type:"text",value:t,onChange:w=>r(w.target.value),placeholder:"Filter Q&A pairs...",className:"w-full pl-9 pr-3 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-sm text-gray-800 dark:text-gray-200 placeholder-gray-500 focus:outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600 transition-colors"})]}),h.jsxs("select",{value:l,onChange:w=>u(w.target.value),className:"appearance-none px-2 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-xs text-gray-700 dark:text-gray-300 focus:outline-none focus:border-blue-600 cursor-pointer",title:"Filter by resolution status",children:[h.jsx("option",{value:"all",children:"All"}),h.jsx("option",{value:"resolved",children:"Resolved"}),h.jsx("option",{value:"looped",children:"Looped"}),h.jsx("option",{value:"abandoned",children:"Abandoned"}),h.jsx("option",{value:"open",children:"Open"})]}),h.jsxs("div",{className:"relative",children:[h.jsxs("select",{value:i,onChange:w=>o(w.target.value),className:"appearance-none pl-7 pr-6 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-xs text-gray-700 dark:text-gray-300 focus:outline-none focus:border-blue-600 cursor-pointer",children:[h.jsx("option",{value:"recent",children:"Recent"}),h.jsx("option",{value:"tools",children:"Most Tools"}),h.jsx("option",{value:"has_code",children:"Has Code"})]}),h.jsx(V5,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 pointer-events-none"})]}),h.jsxs("button",{onClick:y,disabled:d,className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium text-gray-600 dark:text-gray-400 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-300 dark:hover:border-gray-600 disabled:opacity-50 transition-colors",title:"Reindex Q&A",children:[h.jsx(Xa,{size:14,className:d?"animate-spin":""}),"Reindex"]})]}),f&&h.jsxs("p",{className:"mt-2 text-xs text-gray-500",children:[f.total," Q&A pair",f.total!==1?"s":""]})]}),h.jsxs("div",{className:"flex-1 overflow-auto",children:[m&&h.jsx(Wa,{message:"Loading Q&A pairs..."}),!m&&S.length===0&&h.jsx(ya,{icon:h.jsx(iX,{size:32}),title:"No Q&A pairs found",description:t?`No pairs match "${t}". Try a different filter.`:"No Q&A pairs have been extracted for this project yet."}),S.length>0&&h.jsx("div",{children:S.map(w=>h.jsx(zNe,{qa:w},w.id))})]}),f&&b>1&&h.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-200 dark:border-gray-800",children:[h.jsxs("button",{onClick:()=>a(w=>Math.max(1,w-1)),disabled:n<=1,className:"flex items-center gap-1 px-2 py-1 text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[h.jsx(nN,{size:14}),"Prev"]}),h.jsxs("span",{className:"text-xs text-gray-500",children:["Page ",n," of ",b]}),h.jsxs("button",{onClick:()=>a(w=>Math.min(b,w+1)),disabled:n>=b,className:"flex items-center gap-1 px-2 py-1 text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:["Next",h.jsx(to,{size:14})]})]})]})}const Wq=["bg-blue-100 text-blue-800 border-blue-300 dark:bg-blue-900/40 dark:text-blue-300 dark:border-blue-800/60","bg-green-100 text-green-800 border-green-300 dark:bg-green-900/40 dark:text-green-300 dark:border-green-800/60","bg-purple-100 text-purple-800 border-purple-300 dark:bg-purple-900/40 dark:text-purple-300 dark:border-purple-800/60","bg-yellow-100 text-yellow-800 border-yellow-300 dark:bg-yellow-900/40 dark:text-yellow-300 dark:border-yellow-800/60","bg-pink-100 text-pink-800 border-pink-300 dark:bg-pink-900/40 dark:text-pink-300 dark:border-pink-800/60","bg-cyan-100 text-cyan-800 border-cyan-300 dark:bg-cyan-900/40 dark:text-cyan-300 dark:border-cyan-800/60","bg-orange-100 text-orange-800 border-orange-300 dark:bg-orange-900/40 dark:text-orange-300 dark:border-orange-800/60","bg-indigo-100 text-indigo-800 border-indigo-300 dark:bg-indigo-900/40 dark:text-indigo-300 dark:border-indigo-800/60"];function HNe(e){let t=0;for(let r=0;r{d.stopPropagation(),r()},className:"hover:text-gray-900 dark:hover:text-white transition-colors -mr-0.5","aria-label":`Remove ${e}`,children:h.jsx(Ha,{size:n==="sm"?10:12})})]});return t?h.jsx("button",{onClick:t,className:`${o} ${l}`,children:u}):h.jsx("span",{className:o,children:u})}function KNe({bookmark:e,onDelete:t,onEdit:r}){const[n,a]=P.useState(!1);return h.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-800 hover:bg-gray-100/50 dark:hover:bg-gray-800/30 transition-colors",children:h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-800 dark:text-gray-200 truncate",children:e.title}),h.jsx("p",{className:"text-[10px] text-gray-500 font-mono mt-0.5 truncate",children:e.session_id}),e.notes&&h.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 line-clamp-2",children:e.notes}),h.jsxs("div",{className:"flex items-center gap-2 mt-2 flex-wrap",children:[e.tags.map(i=>h.jsx(VNe,{tag:i,size:"sm"},i)),h.jsx(WO,{timestamp:e.created_at})]})]}),h.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[h.jsx("button",{onClick:r,className:"p-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:"Edit bookmark",children:h.jsx($Y,{size:14})}),n?h.jsxs("div",{className:"flex items-center gap-0.5",children:[h.jsx("button",{onClick:()=>{t(),a(!1)},className:"p-1 text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors",title:"Confirm delete",children:h.jsx(vY,{size:14})}),h.jsx("button",{onClick:()=>a(!1),className:"p-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:"Cancel",children:h.jsx(Ha,{size:14})})]}):h.jsx("button",{onClick:()=>a(!0),className:"p-1 text-gray-500 hover:text-red-400 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:"Delete bookmark",children:h.jsx(Y5,{size:14})})]})]})})}function YNe({bookmark:e,isOpen:t,onClose:r,onSave:n,isSaving:a}){const[i,o]=P.useState(e.title),[l,u]=P.useState(e.notes),[d,p]=P.useState(e.tags.join(", ")),f=m=>{m.preventDefault();const y=d.split(",").map(x=>x.trim()).filter(Boolean);n({title:i,notes:l,tags:y})};return h.jsx(lV,{isOpen:t,onClose:r,title:"Edit Bookmark",children:h.jsxs("form",{onSubmit:f,className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Title"}),h.jsx("input",{type:"text",value:i,onChange:m=>o(m.target.value),className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-md text-sm text-gray-800 dark:text-gray-200 focus:outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600 transition-colors",required:!0})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Notes"}),h.jsx("textarea",{value:l,onChange:m=>u(m.target.value),rows:3,className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-md text-sm text-gray-800 dark:text-gray-200 focus:outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600 transition-colors resize-none"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Tags (comma-separated)"}),h.jsx("input",{type:"text",value:d,onChange:m=>p(m.target.value),placeholder:"tag1, tag2, tag3",className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-md text-sm text-gray-800 dark:text-gray-200 placeholder-gray-600 focus:outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600 transition-colors"})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[h.jsx("button",{type:"button",onClick:r,className:"px-3 py-1.5 text-xs font-medium text-gray-600 dark:text-gray-400 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-300 dark:hover:border-gray-600 transition-colors",children:"Cancel"}),h.jsx("button",{type:"submit",disabled:a||!i.trim(),className:"px-3 py-1.5 text-xs font-medium text-white bg-blue-600 rounded-md hover:bg-blue-500 disabled:opacity-50 transition-colors",children:a?"Saving...":"Save"})]})]})})}function XNe(){const e=Gl(),[t,r]=P.useState("created_at"),[n,a]=P.useState(""),[i,o]=P.useState(null),{data:l,isLoading:u}=Jr({queryKey:["bookmarks",n,t],queryFn:()=>WX(n||void 0,t)}),d=wc({mutationFn:y=>VX(y),onSuccess:()=>{e.invalidateQueries({queryKey:["bookmarks"]})}}),p=wc({mutationFn:({id:y,data:x})=>KX(y,x),onSuccess:()=>{e.invalidateQueries({queryKey:["bookmarks"]}),o(null)}}),f=P.useMemo(()=>{if(!(l!=null&&l.bookmarks))return[];const y=new Set;return l.bookmarks.forEach(x=>x.tags.forEach(S=>y.add(S))),Array.from(y).sort()},[l]),m=(l==null?void 0:l.bookmarks)??[];return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-800",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(q5,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-500 pointer-events-none"}),h.jsxs("select",{value:n,onChange:y=>a(y.target.value),className:"w-full appearance-none pl-8 pr-6 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-xs text-gray-700 dark:text-gray-300 focus:outline-none focus:border-blue-600 cursor-pointer",children:[h.jsx("option",{value:"",children:"All tags"}),f.map(y=>h.jsx("option",{value:y,children:y},y))]})]}),h.jsxs("div",{className:"relative",children:[h.jsxs("select",{value:t,onChange:y=>r(y.target.value),className:"appearance-none pl-7 pr-6 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-xs text-gray-700 dark:text-gray-300 focus:outline-none focus:border-blue-600 cursor-pointer",children:[h.jsx("option",{value:"created_at",children:"Date"}),h.jsx("option",{value:"title",children:"Title"})]}),h.jsx(V5,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 pointer-events-none"})]})]}),l&&h.jsxs("p",{className:"mt-2 text-xs text-gray-500",children:[m.length," bookmark",m.length!==1?"s":""]})]}),h.jsxs("div",{className:"flex-1 overflow-auto",children:[u&&h.jsx(Wa,{message:"Loading bookmarks..."}),!u&&m.length===0&&h.jsx(ya,{icon:h.jsx(B5,{size:32}),title:"No bookmarks yet",description:n?`No bookmarks with tag "${n}".`:"Bookmark sessions to find them quickly later."}),m.length>0&&h.jsx("div",{children:m.map(y=>h.jsx(KNe,{bookmark:y,onDelete:()=>d.mutate(y.id),onEdit:()=>o(y)},y.id))})]}),i&&h.jsx(YNe,{bookmark:i,isOpen:!0,onClose:()=>o(null),onSave:y=>p.mutate({id:i.id,data:y}),isSaving:p.isPending})]})}function ZNe(e,t){if(t===0)return"text-xs";const r=e/t;return r>.8?"text-xl":r>.6?"text-lg":r>.4?"text-base":r>.2?"text-sm":"text-xs"}const QNe={intent:"bg-amber-500/20 text-amber-300 border-amber-500/30 hover:bg-amber-500/30",language:"bg-blue-500/20 text-blue-300 border-blue-500/30 hover:bg-blue-500/30",framework:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30 hover:bg-emerald-500/30",tool:"bg-purple-500/20 text-purple-300 border-purple-500/30 hover:bg-purple-500/30",topic:"bg-indigo-500/20 text-indigo-300 border-indigo-500/30 hover:bg-indigo-500/30"},JNe="bg-indigo-500/20 text-indigo-300 border-indigo-500/30 hover:bg-indigo-500/30";function eOe(e){return QNe[e]??JNe}const tOe=[{category:"intent",label:"Intent",dot:"bg-amber-500"},{category:"language",label:"Language",dot:"bg-blue-500"},{category:"framework",label:"Framework",dot:"bg-emerald-500"},{category:"topic",label:"Topic",dot:"bg-indigo-500"},{category:"tool",label:"Tool",dot:"bg-purple-500"}];function rOe(){const e=Gl(),[t,r]=P.useState({kind:"cloud"}),[n,a]=P.useState(""),i=Jr({queryKey:["tagCloud"],queryFn:GX}),o=t.kind==="browse"?t.tag:null,l=Jr({queryKey:["tagBrowse",o],queryFn:()=>HX(o),enabled:!!o}),u=wc({mutationFn:QX,onSuccess:()=>{e.invalidateQueries({queryKey:["tagCloud"]})}});if(t.kind==="cloud"){if(i.isLoading)return h.jsx(Wa,{message:"Loading tags..."});if(i.isError)return h.jsxs("div",{className:"text-red-400 p-4",children:["Failed to load tags: ",i.error.message]});const d=i.data,p=d.tags.reduce((m,y)=>Math.max(m,y.count),0),f=d.tags.filter(m=>m.name.toLowerCase().includes(n.toLowerCase()));return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[h.jsxs("div",{className:"flex items-center gap-6",children:[h.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-600 dark:text-zinc-400",children:[h.jsx(xd,{size:16}),h.jsxs("span",{children:[h.jsx("span",{className:"text-zinc-900 dark:text-zinc-100 font-medium",children:d.tags.length})," tags"]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-600 dark:text-zinc-400",children:[h.jsx(jX,{size:16}),h.jsxs("span",{children:[h.jsx("span",{className:"text-zinc-900 dark:text-zinc-100 font-medium",children:d.total_sessions})," ","sessions"]})]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"relative",children:[h.jsx(ha,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-500"}),h.jsx("input",{type:"text",placeholder:"Filter tags...",value:n,onChange:m=>a(m.target.value),className:"pl-9 pr-3 py-1.5 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg text-sm text-zinc-800 dark:text-zinc-200 placeholder-zinc-500 focus:outline-none focus:border-zinc-500 w-52"})]}),h.jsxs("button",{onClick:()=>u.mutate(),disabled:u.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-200 dark:hover:bg-zinc-700 disabled:opacity-50 transition-colors",children:[h.jsx(Xa,{size:16,className:u.isPending?"animate-spin":""}),u.isPending?"Reindexing...":"Reindex"]})]})]}),h.jsx("div",{className:"flex items-center gap-4 text-xs text-zinc-500 flex-wrap",children:tOe.map(m=>h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${m.dot}`}),m.label]},m.category))}),f.length===0?h.jsx(ya,{title:"No tags found",description:n?"Try a different filter.":"No tags available yet."}):h.jsx("div",{className:"flex flex-wrap gap-2 p-4 bg-zinc-50/50 dark:bg-zinc-900/50 border border-zinc-200 dark:border-zinc-800 rounded-xl",children:f.map(m=>h.jsxs("button",{onClick:()=>r({kind:"browse",tag:m.name}),className:`inline-flex items-center gap-1 px-2.5 py-1 border rounded-full cursor-pointer transition-colors ${eOe(m.category)} ${ZNe(m.count,p)}`,children:[h.jsx(Q1,{size:12}),m.name,h.jsxs("span",{className:"text-[10px] opacity-70 ml-0.5",children:["(",m.count,")"]})]},m.name))}),u.isSuccess&&h.jsx("div",{className:"text-green-400 text-sm",children:"Reindex completed successfully."}),u.isError&&h.jsxs("div",{className:"text-red-400 text-sm",children:["Reindex failed: ",u.error.message]})]})}return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("button",{onClick:()=>r({kind:"cloud"}),className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:[h.jsx(vd,{size:16}),"Back"]}),h.jsxs("h3",{className:"text-lg font-medium text-zinc-900 dark:text-zinc-100 flex items-center gap-2",children:[h.jsx(Q1,{size:20}),t.tag]})]}),l.isLoading&&h.jsx(Wa,{message:"Loading sessions..."}),l.isError&&h.jsxs("div",{className:"text-red-400 p-4",children:["Failed to load sessions: ",l.error.message]}),l.isSuccess&&h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"text-sm text-zinc-600 dark:text-zinc-400",children:[h.jsx("span",{className:"text-zinc-900 dark:text-zinc-100 font-medium",children:l.data.count})," ","session",l.data.count!==1&&"s"," tagged with"," ",h.jsx("span",{className:"text-indigo-300 font-medium",children:l.data.tag})]}),l.data.sessions.length===0?h.jsx(ya,{title:"No sessions",description:"No sessions have this tag."}):h.jsx("div",{className:"space-y-2",children:l.data.sessions.map(d=>h.jsx("div",{className:"p-4 bg-zinc-50/60 dark:bg-zinc-900/60 border border-zinc-200 dark:border-zinc-800 rounded-lg hover:border-zinc-200 dark:hover:border-zinc-700 transition-colors",children:h.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[h.jsx("span",{className:"text-sm font-mono text-zinc-800 dark:text-zinc-200 truncate",children:d.session_id}),h.jsx("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:d.source.map(p=>h.jsx("span",{className:"px-2 py-0.5 bg-white dark:bg-zinc-800 rounded text-zinc-600 dark:text-zinc-400",children:p},p))})]})},d.session_id))})]})]})}function nOe(e,t){const[r,n]=P.useState(t.key),[a,i]=P.useState(t.dir),o=P.useCallback(u=>{if(u===r){i(p=>p==="asc"?"desc":"asc");return}n(u);let d=!1;for(const p of e){const f=p[u];if(f!=null){d=typeof f=="number"||typeof f=="boolean";break}}i(d?"desc":"asc")},[r,e]);return{sorted:P.useMemo(()=>{const u=e.slice();return u.sort((d,p)=>{const f=d[r],m=p[r],y=f==null||typeof f=="number"&&Number.isNaN(f),x=m==null||typeof m=="number"&&Number.isNaN(m);if(y&&x)return 0;if(y)return 1;if(x)return-1;let S=0;return typeof f=="number"&&typeof m=="number"?S=f-m:S=String(f).localeCompare(String(m),void 0,{numeric:!0,sensitivity:"base"}),a==="asc"?S:-S}),u},[e,r,a]),sortKey:r,sortDir:a,setSort:o}}function Ti({label:e,sortKey:t,activeKey:r,dir:n,onClick:a,className:i,align:o="left"}){const l=t===r,u=o==="right"?"text-right":"text-left",d=l?n==="asc"?Tf:Xo:null;return h.jsx("th",{onClick:a,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a())},className:["cursor-pointer select-none",u,i??""].filter(Boolean).join(" "),"data-sort-key":t,"aria-sort":l?n==="asc"?"ascending":"descending":"none",role:"columnheader",scope:"col",tabIndex:0,children:h.jsxs("span",{className:["inline-flex items-center gap-1",o==="right"?"w-full justify-end":""].filter(Boolean).join(" "),children:[h.jsx("span",{children:e}),d?h.jsx(d,{size:12,stroke:2.5,"aria-hidden":"true"}):null]})})}const aOe={"edit-heavy":"green","research-heavy":"blue",balanced:"gray","idle-heavy":"yellow"},Vq=["edit-heavy","research-heavy","idle-heavy","balanced"],iOe=[{key:"all",label:"All"},{key:"edit-heavy",label:"edit-heavy"},{key:"research-heavy",label:"research-heavy"},{key:"idle-heavy",label:"idle-heavy"},{key:"balanced",label:"balanced"}];function oOe(e){return e.length>12?e.slice(0,8):e}function Kq(e){if(!e||e<1)return"—";if(e<60)return`${e.toFixed(0)}s`;const t=e/60;return t<60?`${t.toFixed(1)}m`:`${(t/60).toFixed(1)}h`}function ff(e){return`${(e*100).toFixed(0)}%`}function sOe(e){const t={};for(const r of e)t[r.classification]=(t[r.classification]??0)+1;return t}function lOe({data:e}){const t=P.useMemo(()=>e??[],[e]),[r,n]=P.useState("all"),a=P.useMemo(()=>r==="all"?t:t.filter(x=>x.classification===r),[t,r]),{sorted:i,sortKey:o,sortDir:l,setSort:u}=nOe(a,{key:"idle_gap_total_s",dir:"desc"}),d=P.useMemo(()=>sOe(t),[t]),p=P.useMemo(()=>{const x=new Set(Vq),S=Object.keys(d).filter(b=>!x.has(b)).sort();return[...Vq.filter(b=>d[b]),...S]},[d]);if(!e||e.length===0)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"session-efficiency-table",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Session Efficiency"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No session efficiency data yet"})]});const f=String(o),m=p.map(x=>`${d[x]??0} ${x}`),y=m.length?m.join(" · "):"";return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"session-efficiency-table",children:[h.jsxs("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:["Session Efficiency",h.jsx("span",{className:"ml-2 text-xs text-gray-500 font-normal",children:a.length===t.length?`${t.length} sessions`:`${a.length} of ${t.length} sessions`})]}),h.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",role:"toolbar","aria-label":"Filter by classification","data-testid":"session-efficiency-filter-chips",children:iOe.map(x=>{const S=r===x.key,b=x.key==="all"?t.length:d[x.key]??0,w=x.key!=="all"&&b===0;return h.jsxs("button",{type:"button",disabled:w,onClick:()=>n(x.key),"data-testid":`session-efficiency-chip-${x.key}`,"aria-pressed":S,className:["inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs border transition-colors",S?"bg-blue-100 text-blue-800 border-blue-300 dark:bg-blue-900/60 dark:text-blue-200 dark:border-blue-700":"bg-gray-100/80 dark:bg-gray-800/60 text-gray-600 dark:text-gray-400 border-gray-300 dark:border-gray-700 hover:bg-white dark:hover:bg-gray-800 hover:text-gray-800 dark:hover:text-gray-200",w?"opacity-40 cursor-not-allowed hover:bg-gray-100/80 dark:hover:bg-gray-800/60 hover:text-gray-600 dark:hover:text-gray-400":""].filter(Boolean).join(" "),children:[h.jsx("span",{children:x.label}),h.jsx("span",{className:"text-[10px] tabular-nums opacity-80",children:b})]},x.key)})}),h.jsx("div",{className:"bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800 overflow-hidden",children:h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400 text-xs uppercase tracking-wider",children:[h.jsx(Ti,{label:"Session",sortKey:"session_id",activeKey:f,dir:l,onClick:()=>u("session_id"),className:"px-3 py-2 w-28"}),h.jsx(Ti,{label:"Class",sortKey:"classification",activeKey:f,dir:l,onClick:()=>u("classification"),className:"px-3 py-2 w-32"}),h.jsx(Ti,{label:"Edit",sortKey:"edit_ratio",activeKey:f,dir:l,onClick:()=>u("edit_ratio"),align:"right",className:"px-3 py-2 w-16"}),h.jsx(Ti,{label:"Read",sortKey:"read_ratio",activeKey:f,dir:l,onClick:()=>u("read_ratio"),align:"right",className:"px-3 py-2 w-16"}),h.jsx(Ti,{label:"Search",sortKey:"search_ratio",activeKey:f,dir:l,onClick:()=>u("search_ratio"),align:"right",className:"px-3 py-2 w-16"}),h.jsx(Ti,{label:"Bash",sortKey:"bash_ratio",activeKey:f,dir:l,onClick:()=>u("bash_ratio"),align:"right",className:"px-3 py-2 w-16"}),h.jsx(Ti,{label:"Idle Total",sortKey:"idle_gap_total_s",activeKey:f,dir:l,onClick:()=>u("idle_gap_total_s"),align:"right",className:"px-3 py-2 w-20"}),h.jsx(Ti,{label:"Idle Max",sortKey:"idle_gap_max_s",activeKey:f,dir:l,onClick:()=>u("idle_gap_max_s"),align:"right",className:"px-3 py-2 w-20"})]})}),h.jsx("tbody",{children:i.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:8,className:"px-3 py-6 text-center text-xs text-gray-500",children:"No sessions match this filter"})}):i.map(x=>{const S=aOe[x.classification]??"gray";return h.jsxs("tr",{className:"border-b border-gray-200/50 dark:border-gray-800/50 cursor-pointer hover:bg-gray-100/60 dark:hover:bg-gray-800/40 focus:bg-gray-100/80 dark:focus:bg-gray-800/60 focus:outline-none",onClick:()=>dd(x.session_id),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),dd(x.session_id))},tabIndex:0,role:"link","aria-label":`Open session ${x.session_id}`,"data-testid":`session-efficiency-row-${x.session_id}`,children:[h.jsx("td",{className:"px-3 py-2 text-gray-700 dark:text-gray-300 font-mono text-xs",children:oOe(x.session_id)}),h.jsx("td",{className:"px-3 py-2",children:h.jsx(Qn,{color:S,children:x.classification})}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:ff(x.edit_ratio)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:ff(x.read_ratio)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:ff(x.search_ratio)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:ff(x.bash_ratio)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-600 dark:text-gray-400 tabular-nums",children:Kq(x.idle_gap_total_s)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-600 dark:text-gray-400 tabular-nums",children:Kq(x.idle_gap_max_s)})]},x.session_id)})})]})})}),h.jsxs("div",{className:"mt-2 text-xs text-gray-500","data-testid":"session-efficiency-footer",children:[t.length," sessions",y?`: ${y}`:""]})]})}const uOe=new Set(["cost","errors","duration_s","input","output","cache_creation","cache_read","commands","messages"]),Yq=[{key:"cost",label:"Cost",kind:"cost"},{key:"input",label:"Input tokens",kind:"tokens"},{key:"output",label:"Output tokens",kind:"tokens"},{key:"cache_read",label:"Cache read",kind:"tokens"},{key:"cache_creation",label:"Cache creation",kind:"tokens"},{key:"commands",label:"Commands",kind:"count"},{key:"messages",label:"Messages",kind:"count"},{key:"errors",label:"Errors",kind:"count"},{key:"duration_s",label:"Duration",kind:"duration"}];function hf(e){return e.length>12?e.slice(0,8):e}function cOe(e){return Math.round(e).toLocaleString()}function dOe(e){if(!e)return"0s";if(Math.abs(e)<60)return`${e.toFixed(0)}s`;const r=e/60;return Math.abs(r)<60?`${r.toFixed(1)}m`:`${(r/60).toFixed(1)}h`}function FT(e,t){switch(e){case"cost":return _t(t);case"duration":return dOe(t);case"tokens":case"count":return cOe(t)}}function pOe(e,t){if(t===0)return"—";const r=t>0?"+":"−",n=FT(e,Math.abs(t));return`${r}${n}`}function fOe(e){return e===null?"":isFinite(e)?e===0?"":` (${e>0?"+":"−"}${Math.abs(e).toFixed(0)}%)`:"∞%"}function Xq(e,t){var r;switch(t){case"cost":return e.cost??0;case"commands":return e.commands??0;case"messages":return e.messages??0;case"errors":return e.errors??0;case"duration_s":return e.duration_s??0;default:return((r=e.tokens)==null?void 0:r[t])??0}}function hOe(e,t){var r;switch(t){case"cost":return e.cost??0;case"commands":return e.commands??0;case"messages":return 0;case"errors":return e.errors??0;case"duration_s":return e.duration_s??0;default:return((r=e.tokens)==null?void 0:r[t])??0}}function gOe(e,t){return t===0?"text-gray-500":uOe.has(e)?t<0?"text-green-400":"text-red-400":t>0?"text-green-400":"text-red-400"}function mOe({logPath:e,sessionAId:t,sessionBId:r,onClose:n}){const[a,i]=P.useState(null),[o,l]=P.useState(!1),[u,d]=P.useState(null),p=!!(t&&r),f=P.useCallback(async()=>{if(!p||!e){i(null);return}l(!0),d(null);try{const y=`/api/sessions/compare?log_path=${encodeURIComponent(e)}&a=${encodeURIComponent(t)}&b=${encodeURIComponent(r)}`,x=await fetch(y);if(!x.ok){const b=await x.text().catch(()=>"");throw new Error(`${x.status} ${x.statusText}${b?`: ${b}`:""}`)}const S=await x.json();i(S)}catch(y){d(y instanceof Error?y.message:String(y)),i(null)}finally{l(!1)}},[e,t,r,p]);if(P.useEffect(()=>{f()},[f]),!p)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-6 border border-gray-200 dark:border-gray-800",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsx(X1,{size:16,className:"text-indigo-400"}),h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Compare sessions"}),n&&h.jsx("button",{type:"button",onClick:n,className:"ml-auto text-gray-500 hover:text-gray-700 dark:hover:text-gray-300","aria-label":"Close compare view",children:h.jsx(Ha,{size:14})})]}),h.jsx("div",{className:"text-xs text-gray-500 py-6 text-center",children:"Pick two sessions to compare them side-by-side."})]});const m=h.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[h.jsx(X1,{size:16,className:"text-indigo-400"}),h.jsxs("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:["Compare sessions",h.jsxs("span",{className:"ml-2 text-xs text-gray-500 font-normal font-mono",children:[hf(t)," ↔ ",hf(r)]})]}),n&&h.jsx("button",{type:"button",onClick:n,className:"ml-auto text-gray-500 hover:text-gray-700 dark:hover:text-gray-300","aria-label":"Close compare view",children:h.jsx(Ha,{size:14})})]});return o?h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[m,h.jsx("div",{className:"bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800 overflow-hidden",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400 text-xs uppercase tracking-wider",children:[h.jsx("th",{className:"px-3 py-2 text-left",children:"Metric"}),h.jsx("th",{className:"px-3 py-2 text-right",children:"A"}),h.jsx("th",{className:"px-3 py-2 text-right",children:"B"}),h.jsx("th",{className:"px-3 py-2 text-right",children:"Δ"})]})}),h.jsx("tbody",{children:Yq.map(y=>h.jsxs("tr",{className:"border-b border-gray-200/50 dark:border-gray-800/50 animate-pulse",children:[h.jsx("td",{className:"px-3 py-2",children:h.jsx("div",{className:"h-3 w-24 bg-gray-200/80 dark:bg-gray-700/60 rounded"})}),h.jsx("td",{className:"px-3 py-2",children:h.jsx("div",{className:"h-3 w-16 bg-gray-200/60 dark:bg-gray-700/40 rounded ml-auto"})}),h.jsx("td",{className:"px-3 py-2",children:h.jsx("div",{className:"h-3 w-16 bg-gray-200/60 dark:bg-gray-700/40 rounded ml-auto"})}),h.jsx("td",{className:"px-3 py-2",children:h.jsx("div",{className:"h-3 w-12 bg-gray-200/60 dark:bg-gray-700/40 rounded ml-auto"})})]},y.key))})]})})]}):u?h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-red-300 dark:border-red-900/60",children:[m,h.jsxs("div",{className:"bg-red-100 dark:bg-red-950/30 border border-red-300 dark:border-red-900/40 rounded p-3 text-xs text-red-800 dark:text-red-200",children:[h.jsx("div",{className:"font-medium mb-1",children:"Failed to load comparison"}),h.jsx("div",{className:"text-red-700/90 dark:text-red-300/80 break-all",children:u}),h.jsxs("button",{type:"button",onClick:f,className:"mt-3 inline-flex items-center gap-1 px-2 py-1 rounded bg-red-200 dark:bg-red-900/50 hover:bg-red-300 dark:hover:bg-red-900/70 border border-red-400 dark:border-red-800 text-red-800 dark:text-red-100 text-[11px] uppercase tracking-wider",children:[h.jsx(Xa,{size:12})," Retry"]})]})]}):a?h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[m,h.jsx("div",{className:"bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800 overflow-hidden",children:h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400 text-xs uppercase tracking-wider",children:[h.jsx("th",{className:"px-3 py-2 text-left",children:"Metric"}),h.jsx("th",{className:"px-3 py-2 text-right",children:h.jsxs("span",{className:"font-mono text-indigo-700 dark:text-indigo-300",children:["A · ",hf(a.a.session_id)]})}),h.jsx("th",{className:"px-3 py-2 text-right",children:h.jsxs("span",{className:"font-mono text-indigo-700 dark:text-indigo-300",children:["B · ",hf(a.b.session_id)]})}),h.jsx("th",{className:"px-3 py-2 text-right",children:"Δ (B − A)"})]})}),h.jsx("tbody",{children:Yq.map(y=>{const x=Xq(a.a,y.key),S=Xq(a.b,y.key),b=hOe(a.diff,y.key),w=b!==0?b:S-x,_=x!==0?w/Math.abs(x)*100:w===0?0:1/0,k=gOe(y.key,w);return h.jsxs("tr",{className:"border-b border-gray-200/50 dark:border-gray-800/50",children:[h.jsx("td",{className:"px-3 py-2 text-gray-700 dark:text-gray-300",children:y.label}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-800 dark:text-gray-200 tabular-nums",children:FT(y.kind,x)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-800 dark:text-gray-200 tabular-nums",children:FT(y.kind,S)}),h.jsxs("td",{className:`px-3 py-2 text-right tabular-nums ${k}`,children:[pOe(y.kind,w),h.jsx("span",{className:"text-[10px] text-gray-500",children:fOe(_)})]})]},y.key)})})]})})})]}):h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[m,h.jsx("div",{className:"text-xs text-gray-500 py-6 text-center",children:"No comparison data."})]})}const rc=30;function yOe(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function zl(e){if(e===null)return"—";try{return(typeof e=="number"?new Date(e*1e3):new Date(e)).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return String(e)}}function $T(e){if(!e)return"—";if(e<1)return"< 1m";if(e<60)return`${Math.round(e)}m`;const t=Math.floor(e/60),r=Math.round(e%60);return r>0?`${t}h ${r}m`:`${t}h`}function bOe(e){if(e===null)return"—";try{return(typeof e=="number"?new Date(e*1e3):new Date(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}catch{return String(e)}}function vOe(e){const t=Date.now()/1e3-e;return t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:t<604800?`${Math.round(t/86400)}d ago`:bOe(e)}const Zq={human:{icon:Ac,color:"text-blue-400",bg:"bg-blue-500/10",label:"You"},user:{icon:Ac,color:"text-blue-400",bg:"bg-blue-500/10",label:"You"},assistant:{icon:sN,color:"text-emerald-400",bg:"bg-emerald-500/10",label:"Claude"},tool_use:{icon:is,color:"text-purple-400",bg:"bg-purple-500/10",label:"Tool Call"},tool_result:{icon:aN,color:"text-amber-400",bg:"bg-amber-500/10",label:"Tool Result"}},xOe=new Set(["progress","file-history-snapshot","pr-link","queue-operation","last-prompt","system"]);function SOe(e){return xOe.has(String(e.type??""))}function EOe(e){if(e.type!=="user"&&e.type!=="human")return!1;const t=e.message,r=t==null?void 0:t.content;return Array.isArray(r)?r.some(n=>typeof n=="object"&&n!==null&&n.type==="tool_result"):!1}function uV(e){return EOe(e)?"tool_result":e.type==="user"||e.type==="human"?"human":e.type==="assistant"?"assistant":String(e.type??"unknown")}function cV(e){const t=e.message,r=(t==null?void 0:t.content)??e.content??e.summary;if(typeof r=="string")return r;if(Array.isArray(r)){const n=[];for(const a of r){if(typeof a=="string"){n.push(a);continue}if(!a||typeof a!="object")continue;const i=a;if(i.type==="text")n.push(String(i.text??""));else if(i.type==="tool_use")n.push(`**Tool: ${i.name}** +`)})]})]})}function PNe(e){const t=typeof e=="number"?new Date(e<1e12?e*1e3:e):new Date(e),n=Date.now()-t.getTime();if(n<0)return"just now";const a=Math.floor(n/1e3),i=Math.floor(a/60),o=Math.floor(i/60),l=Math.floor(o/24);return a<60?"just now":i<60?`${i}m ago`:o<24?`${o}h ago`:l<30?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:t.getFullYear()!==new Date().getFullYear()?"numeric":void 0})}function WO({timestamp:e}){const t=PNe(e),r=typeof e=="number"?new Date(e<1e12?e*1e3:e):new Date(e);return h.jsx("time",{dateTime:r.toISOString(),title:r.toLocaleString(),className:"text-gray-500 text-xs",children:t})}const Hq=20;function jNe(e,t){const[r,n]=P.useState(e);return P.useEffect(()=>{const a=setTimeout(()=>n(e),t);return()=>clearTimeout(a)},[e,t]),r}function MNe(e){switch(e){case"user":return"blue";case"assistant":return"green";case"system":return"yellow";case"tool":return"purple";default:return"gray"}}function FNe({html:e}){const r=e.replace(/<\/?(?!mark\b)[a-z][^>]*>/gi,"").split(/(|<\/mark>)/gi),n=[];let a=!1;for(let i=0;i"){a=!0;continue}if(o.toLowerCase()===""){a=!1;continue}o!==""&&(a?n.push(h.jsx("mark",{className:"bg-yellow-200 dark:bg-yellow-500/30 text-yellow-900 dark:text-yellow-200 rounded-sm px-0.5",children:o},i)):n.push(o))}return h.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 leading-relaxed",children:n})}function $Ne({result:e}){return h.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-800 hover:bg-gray-100/70 dark:hover:bg-gray-800/50 transition-colors",children:h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"mb-1.5",children:e.snippet?h.jsx(FNe,{html:e.snippet}):h.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-300 leading-relaxed line-clamp-3",children:e.content.length>300?e.content.slice(0,300)+"...":e.content})}),h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(Qn,{color:MNe(e.role),children:e.role}),e.model&&e.model!=="N/A"&&h.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:e.model}),h.jsx("span",{className:"text-[10px] text-gray-600 dark:text-gray-400 font-mono truncate max-w-[180px]",children:e.session_id}),h.jsx(WO,{timestamp:e.timestamp})]})]}),h.jsx("div",{className:"flex-shrink-0 text-right",children:h.jsx("span",{className:"text-[10px] font-mono text-gray-500",children:e.relevance.toFixed(2)})})]})})}function BNe({projectName:e,initialQuery:t=""}){const[r,n]=P.useState(t),[a,i]=P.useState(1),[o,l]=P.useState(!1),u=P.useRef(null),d=jNe(r,300);P.useEffect(()=>{i(1)},[d]),P.useEffect(()=>{var b;(b=u.current)==null||b.focus()},[]);const{data:p,isLoading:f,isError:m,error:y}=Jr({queryKey:["search",e,d,a],queryFn:()=>qX({q:d,project:e,page:a,per_page:Hq}),enabled:d.length>0}),x=P.useCallback(async()=>{l(!0);try{await XX()}finally{l(!1)}},[]),S=p?Math.ceil(p.total/Hq):0;return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-800",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(ha,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500"}),h.jsx("input",{ref:u,type:"text",value:r,onChange:b=>n(b.target.value),placeholder:"Search messages...",className:"w-full pl-9 pr-3 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-sm text-gray-800 dark:text-gray-200 placeholder-gray-500 focus:outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600 transition-colors"})]}),h.jsxs("button",{onClick:x,disabled:o,className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium text-gray-600 dark:text-gray-400 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-300 dark:hover:border-gray-600 disabled:opacity-50 transition-colors",title:"Reindex search",children:[h.jsx(Xa,{size:14,className:o?"animate-spin":""}),"Reindex"]})]}),p&&d&&h.jsxs("p",{className:"mt-2 text-xs text-gray-500",children:[p.total," result",p.total!==1?"s":""," for “",p.query,"”"]})]}),h.jsxs("div",{className:"flex-1 overflow-auto",children:[!d&&h.jsx(ya,{icon:h.jsx(ha,{size:32}),title:"Search messages",description:"Enter a query to search across all messages in this project."}),d&&f&&h.jsx(Wa,{message:"Searching..."}),m&&h.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[h.jsx(cY,{size:32,className:"text-red-400 mb-2"}),h.jsx("p",{className:"text-sm text-red-400 font-medium",children:"Search failed"}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:y instanceof Error?y.message:"An unexpected error occurred"})]}),p&&p.results.length===0&&h.jsx(ya,{icon:h.jsx(ha,{size:32}),title:"No results found",description:`No messages match "${d}". Try a different search term.`}),p&&p.results.length>0&&h.jsx("div",{children:p.results.map((b,w)=>h.jsx($Ne,{result:b},`${b.session_id}-${w}`))})]}),p&&S>1&&h.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-200 dark:border-gray-800",children:[h.jsxs("button",{onClick:()=>i(b=>Math.max(1,b-1)),disabled:a<=1,className:"flex items-center gap-1 px-2 py-1 text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[h.jsx(nN,{size:14}),"Prev"]}),h.jsxs("span",{className:"text-xs text-gray-500",children:["Page ",a," of ",S]}),h.jsxs("button",{onClick:()=>i(b=>Math.min(S,b+1)),disabled:a>=S,className:"flex items-center gap-1 px-2 py-1 text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:["Next",h.jsx(to,{size:14})]})]})]})}const UNe=20,O1={resolved:{label:"resolved",className:"bg-emerald-100 text-emerald-800 border-emerald-300 dark:bg-emerald-900/40 dark:text-emerald-300 dark:border-emerald-800",title:"Answer appears to have worked — no follow-up frustration detected."},looped:{label:"looped",className:"bg-amber-100 text-amber-800 border-amber-300 dark:bg-amber-900/40 dark:text-amber-300 dark:border-amber-800",title:"User kept asking variants of the same question — agent may have gone in circles."},abandoned:{label:"abandoned",className:"bg-rose-100 text-rose-800 border-rose-300 dark:bg-rose-900/40 dark:text-rose-300 dark:border-rose-800",title:"Question never got a follow-up or resolution signal."},open:{label:"open",className:"bg-white dark:bg-gray-800 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-700",title:"Not enough signal to classify."}};function zNe({qa:e}){const t=e.question_text.length>200?e.question_text.slice(0,200)+"...":e.question_text,r=e.answer_text.length>200?e.answer_text.slice(0,200)+"...":e.answer_text;return h.jsxs("div",{className:"w-full px-4 py-3 border-b border-gray-200 dark:border-gray-800",children:[h.jsx("div",{className:"mb-1.5",children:h.jsx("p",{className:"text-sm text-gray-800 dark:text-gray-200 font-medium line-clamp-2",children:t})}),h.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 line-clamp-2 mb-2",children:r}),h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.resolution_status&&e.resolution_status!=="open"&&h.jsxs("span",{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[10px] font-medium rounded-full border ${O1[e.resolution_status].className}`,title:O1[e.resolution_status].title,children:[O1[e.resolution_status].label,e.loop_count>1&&e.resolution_status==="looped"&&` ×${e.loop_count}`]}),e.code_snippets.length>0&&h.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[10px] font-medium rounded-full border bg-purple-100 text-purple-800 border-purple-300 dark:bg-purple-900/50 dark:text-purple-300 dark:border-purple-800",children:[h.jsx(aN,{size:10}),"code"]}),e.tools_used.length>0&&h.jsxs("span",{className:"text-[10px] text-gray-500 font-mono",children:[e.tools_used.slice(0,3).join(", "),e.tools_used.length>3&&` +${e.tools_used.length-3}`]}),e.model&&h.jsx("span",{className:"text-[10px] text-gray-600 dark:text-gray-400 font-mono",children:e.model}),h.jsx("span",{className:"ml-auto",children:h.jsx(WO,{timestamp:e.timestamp})})]})]})}function qNe(e,t){const r=[...e];switch(t){case"recent":return r.sort((n,a)=>new Date(a.timestamp).getTime()-new Date(n.timestamp).getTime());case"tools":return r.sort((n,a)=>a.tools_used.length-n.tools_used.length);case"has_code":return r.sort((n,a)=>{const i=n.code_snippets.length>0,o=a.code_snippets.length>0;return i===o?new Date(a.timestamp).getTime()-new Date(n.timestamp).getTime():i?-1:1});default:return r}}function GNe({projectName:e}){const[t,r]=P.useState(""),[n,a]=P.useState(1),[i,o]=P.useState("recent"),[l,u]=P.useState("all"),[d,p]=P.useState(!1);P.useEffect(()=>{a(1)},[t,l]);const{data:f,isLoading:m}=Jr({queryKey:["qa-list",e,t,l,n],queryFn:()=>zX({project:e,search:t||void 0,resolution_status:l==="all"?void 0:l,page:n,per_page:UNe})}),y=async()=>{p(!0);try{await ZX()}finally{p(!1)}},x=(f==null?void 0:f.results)??[],S=qNe(x,i),b=(f==null?void 0:f.total_pages)??0;return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-800",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(ha,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500"}),h.jsx("input",{type:"text",value:t,onChange:w=>r(w.target.value),placeholder:"Filter Q&A pairs...",className:"w-full pl-9 pr-3 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-sm text-gray-800 dark:text-gray-200 placeholder-gray-500 focus:outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600 transition-colors"})]}),h.jsxs("select",{value:l,onChange:w=>u(w.target.value),className:"appearance-none px-2 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-xs text-gray-700 dark:text-gray-300 focus:outline-none focus:border-blue-600 cursor-pointer",title:"Filter by resolution status",children:[h.jsx("option",{value:"all",children:"All"}),h.jsx("option",{value:"resolved",children:"Resolved"}),h.jsx("option",{value:"looped",children:"Looped"}),h.jsx("option",{value:"abandoned",children:"Abandoned"}),h.jsx("option",{value:"open",children:"Open"})]}),h.jsxs("div",{className:"relative",children:[h.jsxs("select",{value:i,onChange:w=>o(w.target.value),className:"appearance-none pl-7 pr-6 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-xs text-gray-700 dark:text-gray-300 focus:outline-none focus:border-blue-600 cursor-pointer",children:[h.jsx("option",{value:"recent",children:"Recent"}),h.jsx("option",{value:"tools",children:"Most Tools"}),h.jsx("option",{value:"has_code",children:"Has Code"})]}),h.jsx(V5,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 pointer-events-none"})]}),h.jsxs("button",{onClick:y,disabled:d,className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium text-gray-600 dark:text-gray-400 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-300 dark:hover:border-gray-600 disabled:opacity-50 transition-colors",title:"Reindex Q&A",children:[h.jsx(Xa,{size:14,className:d?"animate-spin":""}),"Reindex"]})]}),f&&h.jsxs("p",{className:"mt-2 text-xs text-gray-500",children:[f.total," Q&A pair",f.total!==1?"s":""]})]}),h.jsxs("div",{className:"flex-1 overflow-auto",children:[m&&h.jsx(Wa,{message:"Loading Q&A pairs..."}),!m&&S.length===0&&h.jsx(ya,{icon:h.jsx(iX,{size:32}),title:"No Q&A pairs found",description:t?`No pairs match "${t}". Try a different filter.`:"No Q&A pairs have been extracted for this project yet."}),S.length>0&&h.jsx("div",{children:S.map(w=>h.jsx(zNe,{qa:w},w.id))})]}),f&&b>1&&h.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-200 dark:border-gray-800",children:[h.jsxs("button",{onClick:()=>a(w=>Math.max(1,w-1)),disabled:n<=1,className:"flex items-center gap-1 px-2 py-1 text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[h.jsx(nN,{size:14}),"Prev"]}),h.jsxs("span",{className:"text-xs text-gray-500",children:["Page ",n," of ",b]}),h.jsxs("button",{onClick:()=>a(w=>Math.min(b,w+1)),disabled:n>=b,className:"flex items-center gap-1 px-2 py-1 text-xs text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:["Next",h.jsx(to,{size:14})]})]})]})}const Wq=["bg-blue-100 text-blue-800 border-blue-300 dark:bg-blue-900/40 dark:text-blue-300 dark:border-blue-800/60","bg-green-100 text-green-800 border-green-300 dark:bg-green-900/40 dark:text-green-300 dark:border-green-800/60","bg-purple-100 text-purple-800 border-purple-300 dark:bg-purple-900/40 dark:text-purple-300 dark:border-purple-800/60","bg-yellow-100 text-yellow-800 border-yellow-300 dark:bg-yellow-900/40 dark:text-yellow-300 dark:border-yellow-800/60","bg-pink-100 text-pink-800 border-pink-300 dark:bg-pink-900/40 dark:text-pink-300 dark:border-pink-800/60","bg-cyan-100 text-cyan-800 border-cyan-300 dark:bg-cyan-900/40 dark:text-cyan-300 dark:border-cyan-800/60","bg-orange-100 text-orange-800 border-orange-300 dark:bg-orange-900/40 dark:text-orange-300 dark:border-orange-800/60","bg-indigo-100 text-indigo-800 border-indigo-300 dark:bg-indigo-900/40 dark:text-indigo-300 dark:border-indigo-800/60"];function HNe(e){let t=0;for(let r=0;r{d.stopPropagation(),r()},className:"hover:text-gray-900 dark:hover:text-white transition-colors -mr-0.5","aria-label":`Remove ${e}`,children:h.jsx(Ha,{size:n==="sm"?10:12})})]});return t?h.jsx("button",{onClick:t,className:`${o} ${l}`,children:u}):h.jsx("span",{className:o,children:u})}function KNe({bookmark:e,onDelete:t,onEdit:r}){const[n,a]=P.useState(!1);return h.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-800 hover:bg-gray-100/50 dark:hover:bg-gray-800/30 transition-colors",children:h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-800 dark:text-gray-200 truncate",children:e.title}),h.jsx("p",{className:"text-[10px] text-gray-500 font-mono mt-0.5 truncate",children:e.session_id}),e.notes&&h.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 line-clamp-2",children:e.notes}),h.jsxs("div",{className:"flex items-center gap-2 mt-2 flex-wrap",children:[e.tags.map(i=>h.jsx(VNe,{tag:i,size:"sm"},i)),h.jsx(WO,{timestamp:e.created_at})]})]}),h.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[h.jsx("button",{onClick:r,className:"p-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:"Edit bookmark",children:h.jsx($Y,{size:14})}),n?h.jsxs("div",{className:"flex items-center gap-0.5",children:[h.jsx("button",{onClick:()=>{t(),a(!1)},className:"p-1 text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors",title:"Confirm delete",children:h.jsx(vY,{size:14})}),h.jsx("button",{onClick:()=>a(!1),className:"p-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:"Cancel",children:h.jsx(Ha,{size:14})})]}):h.jsx("button",{onClick:()=>a(!0),className:"p-1 text-gray-500 hover:text-red-400 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:"Delete bookmark",children:h.jsx(Y5,{size:14})})]})]})})}function YNe({bookmark:e,isOpen:t,onClose:r,onSave:n,isSaving:a}){const[i,o]=P.useState(e.title),[l,u]=P.useState(e.notes),[d,p]=P.useState(e.tags.join(", ")),f=m=>{m.preventDefault();const y=d.split(",").map(x=>x.trim()).filter(Boolean);n({title:i,notes:l,tags:y})};return h.jsx(lV,{isOpen:t,onClose:r,title:"Edit Bookmark",children:h.jsxs("form",{onSubmit:f,className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Title"}),h.jsx("input",{type:"text",value:i,onChange:m=>o(m.target.value),className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-md text-sm text-gray-800 dark:text-gray-200 focus:outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600 transition-colors",required:!0})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Notes"}),h.jsx("textarea",{value:l,onChange:m=>u(m.target.value),rows:3,className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-md text-sm text-gray-800 dark:text-gray-200 focus:outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600 transition-colors resize-none"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Tags (comma-separated)"}),h.jsx("input",{type:"text",value:d,onChange:m=>p(m.target.value),placeholder:"tag1, tag2, tag3",className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-md text-sm text-gray-800 dark:text-gray-200 placeholder-gray-600 focus:outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600 transition-colors"})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[h.jsx("button",{type:"button",onClick:r,className:"px-3 py-1.5 text-xs font-medium text-gray-600 dark:text-gray-400 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-300 dark:hover:border-gray-600 transition-colors",children:"Cancel"}),h.jsx("button",{type:"submit",disabled:a||!i.trim(),className:"px-3 py-1.5 text-xs font-medium text-white bg-blue-600 rounded-md hover:bg-blue-500 disabled:opacity-50 transition-colors",children:a?"Saving...":"Save"})]})]})})}function XNe(){const e=Gl(),[t,r]=P.useState("created_at"),[n,a]=P.useState(""),[i,o]=P.useState(null),{data:l,isLoading:u}=Jr({queryKey:["bookmarks",n,t],queryFn:()=>WX(n||void 0,t)}),d=wc({mutationFn:y=>VX(y),onSuccess:()=>{e.invalidateQueries({queryKey:["bookmarks"]})}}),p=wc({mutationFn:({id:y,data:x})=>KX(y,x),onSuccess:()=>{e.invalidateQueries({queryKey:["bookmarks"]}),o(null)}}),f=P.useMemo(()=>{if(!(l!=null&&l.bookmarks))return[];const y=new Set;return l.bookmarks.forEach(x=>x.tags.forEach(S=>y.add(S))),Array.from(y).sort()},[l]),m=(l==null?void 0:l.bookmarks)??[];return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-800",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(q5,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-500 pointer-events-none"}),h.jsxs("select",{value:n,onChange:y=>a(y.target.value),className:"w-full appearance-none pl-8 pr-6 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-xs text-gray-700 dark:text-gray-300 focus:outline-none focus:border-blue-600 cursor-pointer",children:[h.jsx("option",{value:"",children:"All tags"}),f.map(y=>h.jsx("option",{value:y,children:y},y))]})]}),h.jsxs("div",{className:"relative",children:[h.jsxs("select",{value:t,onChange:y=>r(y.target.value),className:"appearance-none pl-7 pr-6 py-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md text-xs text-gray-700 dark:text-gray-300 focus:outline-none focus:border-blue-600 cursor-pointer",children:[h.jsx("option",{value:"created_at",children:"Date"}),h.jsx("option",{value:"title",children:"Title"})]}),h.jsx(V5,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-gray-500 pointer-events-none"})]})]}),l&&h.jsxs("p",{className:"mt-2 text-xs text-gray-500",children:[m.length," bookmark",m.length!==1?"s":""]})]}),h.jsxs("div",{className:"flex-1 overflow-auto",children:[u&&h.jsx(Wa,{message:"Loading bookmarks..."}),!u&&m.length===0&&h.jsx(ya,{icon:h.jsx(B5,{size:32}),title:"No bookmarks yet",description:n?`No bookmarks with tag "${n}".`:"Bookmark sessions to find them quickly later."}),m.length>0&&h.jsx("div",{children:m.map(y=>h.jsx(KNe,{bookmark:y,onDelete:()=>d.mutate(y.id),onEdit:()=>o(y)},y.id))})]}),i&&h.jsx(YNe,{bookmark:i,isOpen:!0,onClose:()=>o(null),onSave:y=>p.mutate({id:i.id,data:y}),isSaving:p.isPending})]})}function ZNe(e,t){if(t===0)return"text-xs";const r=e/t;return r>.8?"text-xl":r>.6?"text-lg":r>.4?"text-base":r>.2?"text-sm":"text-xs"}const QNe={intent:"bg-amber-500/20 text-amber-300 border-amber-500/30 hover:bg-amber-500/30",language:"bg-blue-500/20 text-blue-300 border-blue-500/30 hover:bg-blue-500/30",framework:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30 hover:bg-emerald-500/30",tool:"bg-purple-500/20 text-purple-300 border-purple-500/30 hover:bg-purple-500/30",topic:"bg-indigo-500/20 text-indigo-300 border-indigo-500/30 hover:bg-indigo-500/30"},JNe="bg-indigo-500/20 text-indigo-300 border-indigo-500/30 hover:bg-indigo-500/30";function eOe(e){return QNe[e]??JNe}const tOe=[{category:"intent",label:"Intent",dot:"bg-amber-500"},{category:"language",label:"Language",dot:"bg-blue-500"},{category:"framework",label:"Framework",dot:"bg-emerald-500"},{category:"topic",label:"Topic",dot:"bg-indigo-500"},{category:"tool",label:"Tool",dot:"bg-purple-500"}];function rOe(){const e=Gl(),[t,r]=P.useState({kind:"cloud"}),[n,a]=P.useState(""),i=Jr({queryKey:["tagCloud"],queryFn:GX}),o=t.kind==="browse"?t.tag:null,l=Jr({queryKey:["tagBrowse",o],queryFn:()=>HX(o),enabled:!!o}),u=wc({mutationFn:QX,onSuccess:()=>{e.invalidateQueries({queryKey:["tagCloud"]})}});if(t.kind==="cloud"){if(i.isLoading)return h.jsx(Wa,{message:"Loading tags..."});if(i.isError)return h.jsxs("div",{className:"text-red-400 p-4",children:["Failed to load tags: ",i.error.message]});const d=i.data,p=d.tags.reduce((m,y)=>Math.max(m,y.count),0),f=d.tags.filter(m=>m.name.toLowerCase().includes(n.toLowerCase()));return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[h.jsxs("div",{className:"flex items-center gap-6",children:[h.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-600 dark:text-zinc-400",children:[h.jsx(xd,{size:16}),h.jsxs("span",{children:[h.jsx("span",{className:"text-zinc-900 dark:text-zinc-100 font-medium",children:d.tags.length})," tags"]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-sm text-zinc-600 dark:text-zinc-400",children:[h.jsx(jX,{size:16}),h.jsxs("span",{children:[h.jsx("span",{className:"text-zinc-900 dark:text-zinc-100 font-medium",children:d.total_sessions})," ","sessions"]})]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"relative",children:[h.jsx(ha,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-500"}),h.jsx("input",{type:"text",placeholder:"Filter tags...",value:n,onChange:m=>a(m.target.value),className:"pl-9 pr-3 py-1.5 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg text-sm text-zinc-800 dark:text-zinc-200 placeholder-zinc-500 focus:outline-none focus:border-zinc-500 w-52"})]}),h.jsxs("button",{onClick:()=>u.mutate(),disabled:u.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-200 dark:hover:bg-zinc-700 disabled:opacity-50 transition-colors",children:[h.jsx(Xa,{size:16,className:u.isPending?"animate-spin":""}),u.isPending?"Reindexing...":"Reindex"]})]})]}),h.jsx("div",{className:"flex items-center gap-4 text-xs text-zinc-500 flex-wrap",children:tOe.map(m=>h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${m.dot}`}),m.label]},m.category))}),f.length===0?h.jsx(ya,{title:"No tags found",description:n?"Try a different filter.":"No tags available yet."}):h.jsx("div",{className:"flex flex-wrap gap-2 p-4 bg-zinc-50/50 dark:bg-zinc-900/50 border border-zinc-200 dark:border-zinc-800 rounded-xl",children:f.map(m=>h.jsxs("button",{onClick:()=>r({kind:"browse",tag:m.name}),className:`inline-flex items-center gap-1 px-2.5 py-1 border rounded-full cursor-pointer transition-colors ${eOe(m.category)} ${ZNe(m.count,p)}`,children:[h.jsx(Q1,{size:12}),m.name,h.jsxs("span",{className:"text-[10px] opacity-70 ml-0.5",children:["(",m.count,")"]})]},m.name))}),u.isSuccess&&h.jsx("div",{className:"text-green-400 text-sm",children:"Reindex completed successfully."}),u.isError&&h.jsxs("div",{className:"text-red-400 text-sm",children:["Reindex failed: ",u.error.message]})]})}return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("button",{onClick:()=>r({kind:"cloud"}),className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:[h.jsx(vd,{size:16}),"Back"]}),h.jsxs("h3",{className:"text-lg font-medium text-zinc-900 dark:text-zinc-100 flex items-center gap-2",children:[h.jsx(Q1,{size:20}),t.tag]})]}),l.isLoading&&h.jsx(Wa,{message:"Loading sessions..."}),l.isError&&h.jsxs("div",{className:"text-red-400 p-4",children:["Failed to load sessions: ",l.error.message]}),l.isSuccess&&h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"text-sm text-zinc-600 dark:text-zinc-400",children:[h.jsx("span",{className:"text-zinc-900 dark:text-zinc-100 font-medium",children:l.data.count})," ","session",l.data.count!==1&&"s"," tagged with"," ",h.jsx("span",{className:"text-indigo-300 font-medium",children:l.data.tag})]}),l.data.sessions.length===0?h.jsx(ya,{title:"No sessions",description:"No sessions have this tag."}):h.jsx("div",{className:"space-y-2",children:l.data.sessions.map(d=>h.jsx("div",{className:"p-4 bg-zinc-50/60 dark:bg-zinc-900/60 border border-zinc-200 dark:border-zinc-800 rounded-lg hover:border-zinc-200 dark:hover:border-zinc-700 transition-colors",children:h.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[h.jsx("span",{className:"text-sm font-mono text-zinc-800 dark:text-zinc-200 truncate",children:d.session_id}),h.jsx("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:d.source.map(p=>h.jsx("span",{className:"px-2 py-0.5 bg-white dark:bg-zinc-800 rounded text-zinc-600 dark:text-zinc-400",children:p},p))})]})},d.session_id))})]})]})}function nOe(e,t){const[r,n]=P.useState(t.key),[a,i]=P.useState(t.dir),o=P.useCallback(u=>{if(u===r){i(p=>p==="asc"?"desc":"asc");return}n(u);let d=!1;for(const p of e){const f=p[u];if(f!=null){d=typeof f=="number"||typeof f=="boolean";break}}i(d?"desc":"asc")},[r,e]);return{sorted:P.useMemo(()=>{const u=e.slice();return u.sort((d,p)=>{const f=d[r],m=p[r],y=f==null||typeof f=="number"&&Number.isNaN(f),x=m==null||typeof m=="number"&&Number.isNaN(m);if(y&&x)return 0;if(y)return 1;if(x)return-1;let S=0;return typeof f=="number"&&typeof m=="number"?S=f-m:S=String(f).localeCompare(String(m),void 0,{numeric:!0,sensitivity:"base"}),a==="asc"?S:-S}),u},[e,r,a]),sortKey:r,sortDir:a,setSort:o}}function Ti({label:e,sortKey:t,activeKey:r,dir:n,onClick:a,className:i,align:o="left"}){const l=t===r,u=o==="right"?"text-right":"text-left",d=l?n==="asc"?Tf:Xo:null;return h.jsx("th",{onClick:a,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a())},className:["cursor-pointer select-none",u,i??""].filter(Boolean).join(" "),"data-sort-key":t,"aria-sort":l?n==="asc"?"ascending":"descending":"none",role:"columnheader",scope:"col",tabIndex:0,children:h.jsxs("span",{className:["inline-flex items-center gap-1",o==="right"?"w-full justify-end":""].filter(Boolean).join(" "),children:[h.jsx("span",{children:e}),d?h.jsx(d,{size:12,stroke:2.5,"aria-hidden":"true"}):null]})})}const aOe={"edit-heavy":"green","research-heavy":"blue",balanced:"gray","idle-heavy":"yellow"},Vq=["edit-heavy","research-heavy","idle-heavy","balanced"],iOe=[{key:"all",label:"All"},{key:"edit-heavy",label:"edit-heavy"},{key:"research-heavy",label:"research-heavy"},{key:"idle-heavy",label:"idle-heavy"},{key:"balanced",label:"balanced"}];function oOe(e){return e.length>12?e.slice(0,8):e}function Kq(e){if(!e||e<1)return"—";if(e<60)return`${e.toFixed(0)}s`;const t=e/60;return t<60?`${t.toFixed(1)}m`:`${(t/60).toFixed(1)}h`}function ff(e){return`${(e*100).toFixed(0)}%`}function sOe(e){const t={};for(const r of e)t[r.classification]=(t[r.classification]??0)+1;return t}function lOe({data:e}){const t=P.useMemo(()=>e??[],[e]),[r,n]=P.useState("all"),a=P.useMemo(()=>r==="all"?t:t.filter(x=>x.classification===r),[t,r]),{sorted:i,sortKey:o,sortDir:l,setSort:u}=nOe(a,{key:"idle_gap_total_s",dir:"desc"}),d=P.useMemo(()=>sOe(t),[t]),p=P.useMemo(()=>{const x=new Set(Vq),S=Object.keys(d).filter(b=>!x.has(b)).sort();return[...Vq.filter(b=>d[b]),...S]},[d]);if(!e||e.length===0)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"session-efficiency-table",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Session Efficiency"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No session efficiency data yet"})]});const f=String(o),m=p.map(x=>`${d[x]??0} ${x}`),y=m.length?m.join(" · "):"";return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"session-efficiency-table",children:[h.jsxs("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:["Session Efficiency",h.jsx("span",{className:"ml-2 text-xs text-gray-500 font-normal",children:a.length===t.length?`${t.length} sessions`:`${a.length} of ${t.length} sessions`})]}),h.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",role:"toolbar","aria-label":"Filter by classification","data-testid":"session-efficiency-filter-chips",children:iOe.map(x=>{const S=r===x.key,b=x.key==="all"?t.length:d[x.key]??0,w=x.key!=="all"&&b===0;return h.jsxs("button",{type:"button",disabled:w,onClick:()=>n(x.key),"data-testid":`session-efficiency-chip-${x.key}`,"aria-pressed":S,className:["inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs border transition-colors",S?"bg-blue-100 text-blue-800 border-blue-300 dark:bg-blue-900/60 dark:text-blue-200 dark:border-blue-700":"bg-gray-100/80 dark:bg-gray-800/60 text-gray-600 dark:text-gray-400 border-gray-300 dark:border-gray-700 hover:bg-white dark:hover:bg-gray-800 hover:text-gray-800 dark:hover:text-gray-200",w?"opacity-40 cursor-not-allowed hover:bg-gray-100/80 dark:hover:bg-gray-800/60 hover:text-gray-600 dark:hover:text-gray-400":""].filter(Boolean).join(" "),children:[h.jsx("span",{children:x.label}),h.jsx("span",{className:"text-[10px] tabular-nums opacity-80",children:b})]},x.key)})}),h.jsx("div",{className:"bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800 overflow-hidden",children:h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400 text-xs uppercase tracking-wider whitespace-nowrap",children:[h.jsx(Ti,{label:"Session",sortKey:"session_id",activeKey:f,dir:l,onClick:()=>u("session_id"),className:"px-3 py-2 w-28"}),h.jsx(Ti,{label:"Class",sortKey:"classification",activeKey:f,dir:l,onClick:()=>u("classification"),className:"px-3 py-2 w-36"}),h.jsx(Ti,{label:"Edit",sortKey:"edit_ratio",activeKey:f,dir:l,onClick:()=>u("edit_ratio"),align:"right",className:"px-3 py-2 w-20"}),h.jsx(Ti,{label:"Read",sortKey:"read_ratio",activeKey:f,dir:l,onClick:()=>u("read_ratio"),align:"right",className:"px-3 py-2 w-20"}),h.jsx(Ti,{label:"Search",sortKey:"search_ratio",activeKey:f,dir:l,onClick:()=>u("search_ratio"),align:"right",className:"px-3 py-2 w-20"}),h.jsx(Ti,{label:"Bash",sortKey:"bash_ratio",activeKey:f,dir:l,onClick:()=>u("bash_ratio"),align:"right",className:"px-3 py-2 w-20"}),h.jsx(Ti,{label:"Idle Total",sortKey:"idle_gap_total_s",activeKey:f,dir:l,onClick:()=>u("idle_gap_total_s"),align:"right",className:"px-3 py-2 w-24"}),h.jsx(Ti,{label:"Idle Max",sortKey:"idle_gap_max_s",activeKey:f,dir:l,onClick:()=>u("idle_gap_max_s"),align:"right",className:"px-3 py-2 w-24"})]})}),h.jsx("tbody",{children:i.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:8,className:"px-3 py-6 text-center text-xs text-gray-500",children:"No sessions match this filter"})}):i.map(x=>{const S=aOe[x.classification]??"gray";return h.jsxs("tr",{className:"border-b border-gray-200/50 dark:border-gray-800/50 cursor-pointer hover:bg-gray-100/60 dark:hover:bg-gray-800/40 focus:bg-gray-100/80 dark:focus:bg-gray-800/60 focus:outline-none",onClick:()=>dd(x.session_id),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),dd(x.session_id))},tabIndex:0,role:"link","aria-label":`Open session ${x.session_id}`,"data-testid":`session-efficiency-row-${x.session_id}`,children:[h.jsx("td",{className:"px-3 py-2 text-gray-700 dark:text-gray-300 font-mono text-xs",children:oOe(x.session_id)}),h.jsx("td",{className:"px-3 py-2",children:h.jsx(Qn,{color:S,children:x.classification})}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:ff(x.edit_ratio)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:ff(x.read_ratio)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:ff(x.search_ratio)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:ff(x.bash_ratio)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-600 dark:text-gray-400 tabular-nums",children:Kq(x.idle_gap_total_s)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-600 dark:text-gray-400 tabular-nums",children:Kq(x.idle_gap_max_s)})]},x.session_id)})})]})})}),h.jsxs("div",{className:"mt-2 text-xs text-gray-500","data-testid":"session-efficiency-footer",children:[t.length," sessions",y?`: ${y}`:""]})]})}const uOe=new Set(["cost","errors","duration_s","input","output","cache_creation","cache_read","commands","messages"]),Yq=[{key:"cost",label:"Cost",kind:"cost"},{key:"input",label:"Input tokens",kind:"tokens"},{key:"output",label:"Output tokens",kind:"tokens"},{key:"cache_read",label:"Cache read",kind:"tokens"},{key:"cache_creation",label:"Cache creation",kind:"tokens"},{key:"commands",label:"Commands",kind:"count"},{key:"messages",label:"Messages",kind:"count"},{key:"errors",label:"Errors",kind:"count"},{key:"duration_s",label:"Duration",kind:"duration"}];function hf(e){return e.length>12?e.slice(0,8):e}function cOe(e){return Math.round(e).toLocaleString()}function dOe(e){if(!e)return"0s";if(Math.abs(e)<60)return`${e.toFixed(0)}s`;const r=e/60;return Math.abs(r)<60?`${r.toFixed(1)}m`:`${(r/60).toFixed(1)}h`}function FT(e,t){switch(e){case"cost":return _t(t);case"duration":return dOe(t);case"tokens":case"count":return cOe(t)}}function pOe(e,t){if(t===0)return"—";const r=t>0?"+":"−",n=FT(e,Math.abs(t));return`${r}${n}`}function fOe(e){return e===null?"":isFinite(e)?e===0?"":` (${e>0?"+":"−"}${Math.abs(e).toFixed(0)}%)`:"∞%"}function Xq(e,t){var r;switch(t){case"cost":return e.cost??0;case"commands":return e.commands??0;case"messages":return e.messages??0;case"errors":return e.errors??0;case"duration_s":return e.duration_s??0;default:return((r=e.tokens)==null?void 0:r[t])??0}}function hOe(e,t){var r;switch(t){case"cost":return e.cost??0;case"commands":return e.commands??0;case"messages":return 0;case"errors":return e.errors??0;case"duration_s":return e.duration_s??0;default:return((r=e.tokens)==null?void 0:r[t])??0}}function gOe(e,t){return t===0?"text-gray-500":uOe.has(e)?t<0?"text-green-400":"text-red-400":t>0?"text-green-400":"text-red-400"}function mOe({logPath:e,sessionAId:t,sessionBId:r,onClose:n}){const[a,i]=P.useState(null),[o,l]=P.useState(!1),[u,d]=P.useState(null),p=!!(t&&r),f=P.useCallback(async()=>{if(!p||!e){i(null);return}l(!0),d(null);try{const y=`/api/sessions/compare?log_path=${encodeURIComponent(e)}&a=${encodeURIComponent(t)}&b=${encodeURIComponent(r)}`,x=await fetch(y);if(!x.ok){const b=await x.text().catch(()=>"");throw new Error(`${x.status} ${x.statusText}${b?`: ${b}`:""}`)}const S=await x.json();i(S)}catch(y){d(y instanceof Error?y.message:String(y)),i(null)}finally{l(!1)}},[e,t,r,p]);if(P.useEffect(()=>{f()},[f]),!p)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-6 border border-gray-200 dark:border-gray-800",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsx(X1,{size:16,className:"text-indigo-400"}),h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Compare sessions"}),n&&h.jsx("button",{type:"button",onClick:n,className:"ml-auto text-gray-500 hover:text-gray-700 dark:hover:text-gray-300","aria-label":"Close compare view",children:h.jsx(Ha,{size:14})})]}),h.jsx("div",{className:"text-xs text-gray-500 py-6 text-center",children:"Pick two sessions to compare them side-by-side."})]});const m=h.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[h.jsx(X1,{size:16,className:"text-indigo-400"}),h.jsxs("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:["Compare sessions",h.jsxs("span",{className:"ml-2 text-xs text-gray-500 font-normal font-mono",children:[hf(t)," ↔ ",hf(r)]})]}),n&&h.jsx("button",{type:"button",onClick:n,className:"ml-auto text-gray-500 hover:text-gray-700 dark:hover:text-gray-300","aria-label":"Close compare view",children:h.jsx(Ha,{size:14})})]});return o?h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[m,h.jsx("div",{className:"bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800 overflow-hidden",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400 text-xs uppercase tracking-wider whitespace-nowrap",children:[h.jsx("th",{className:"px-3 py-2 text-left",children:"Metric"}),h.jsx("th",{className:"px-3 py-2 text-right w-40",children:"A"}),h.jsx("th",{className:"px-3 py-2 text-right w-40",children:"B"}),h.jsx("th",{className:"px-3 py-2 text-right w-40",children:"Δ"})]})}),h.jsx("tbody",{children:Yq.map(y=>h.jsxs("tr",{className:"border-b border-gray-200/50 dark:border-gray-800/50 animate-pulse",children:[h.jsx("td",{className:"px-3 py-2",children:h.jsx("div",{className:"h-3 w-24 bg-gray-200/80 dark:bg-gray-700/60 rounded"})}),h.jsx("td",{className:"px-3 py-2",children:h.jsx("div",{className:"h-3 w-16 bg-gray-200/60 dark:bg-gray-700/40 rounded ml-auto"})}),h.jsx("td",{className:"px-3 py-2",children:h.jsx("div",{className:"h-3 w-16 bg-gray-200/60 dark:bg-gray-700/40 rounded ml-auto"})}),h.jsx("td",{className:"px-3 py-2",children:h.jsx("div",{className:"h-3 w-12 bg-gray-200/60 dark:bg-gray-700/40 rounded ml-auto"})})]},y.key))})]})})]}):u?h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-red-300 dark:border-red-900/60",children:[m,h.jsxs("div",{className:"bg-red-100 dark:bg-red-950/30 border border-red-300 dark:border-red-900/40 rounded p-3 text-xs text-red-800 dark:text-red-200",children:[h.jsx("div",{className:"font-medium mb-1",children:"Failed to load comparison"}),h.jsx("div",{className:"text-red-700/90 dark:text-red-300/80 break-all",children:u}),h.jsxs("button",{type:"button",onClick:f,className:"mt-3 inline-flex items-center gap-1 px-2 py-1 rounded bg-red-200 dark:bg-red-900/50 hover:bg-red-300 dark:hover:bg-red-900/70 border border-red-400 dark:border-red-800 text-red-800 dark:text-red-100 text-[11px] uppercase tracking-wider",children:[h.jsx(Xa,{size:12})," Retry"]})]})]}):a?h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[m,h.jsx("div",{className:"bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800 overflow-hidden",children:h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400 text-xs uppercase tracking-wider whitespace-nowrap",children:[h.jsx("th",{className:"px-3 py-2 text-left",children:"Metric"}),h.jsx("th",{className:"px-3 py-2 text-right w-40",children:h.jsxs("span",{className:"font-mono text-indigo-700 dark:text-indigo-300",children:["A · ",hf(a.a.session_id)]})}),h.jsx("th",{className:"px-3 py-2 text-right w-40",children:h.jsxs("span",{className:"font-mono text-indigo-700 dark:text-indigo-300",children:["B · ",hf(a.b.session_id)]})}),h.jsx("th",{className:"px-3 py-2 text-right w-40",children:"Δ (B − A)"})]})}),h.jsx("tbody",{children:Yq.map(y=>{const x=Xq(a.a,y.key),S=Xq(a.b,y.key),b=hOe(a.diff,y.key),w=b!==0?b:S-x,_=x!==0?w/Math.abs(x)*100:w===0?0:1/0,k=gOe(y.key,w);return h.jsxs("tr",{className:"border-b border-gray-200/50 dark:border-gray-800/50",children:[h.jsx("td",{className:"px-3 py-2 text-gray-700 dark:text-gray-300",children:y.label}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-800 dark:text-gray-200 tabular-nums",children:FT(y.kind,x)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-800 dark:text-gray-200 tabular-nums",children:FT(y.kind,S)}),h.jsxs("td",{className:`px-3 py-2 text-right tabular-nums ${k}`,children:[pOe(y.kind,w),h.jsx("span",{className:"text-[10px] text-gray-500",children:fOe(_)})]})]},y.key)})})]})})})]}):h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[m,h.jsx("div",{className:"text-xs text-gray-500 py-6 text-center",children:"No comparison data."})]})}const rc=30;function yOe(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function zl(e){if(e===null)return"—";try{return(typeof e=="number"?new Date(e*1e3):new Date(e)).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return String(e)}}function $T(e){if(!e)return"—";if(e<1)return"< 1m";if(e<60)return`${Math.round(e)}m`;const t=Math.floor(e/60),r=Math.round(e%60);return r>0?`${t}h ${r}m`:`${t}h`}function bOe(e){if(e===null)return"—";try{return(typeof e=="number"?new Date(e*1e3):new Date(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}catch{return String(e)}}function vOe(e){const t=Date.now()/1e3-e;return t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:t<604800?`${Math.round(t/86400)}d ago`:bOe(e)}const Zq={human:{icon:Ac,color:"text-blue-400",bg:"bg-blue-500/10",label:"You"},user:{icon:Ac,color:"text-blue-400",bg:"bg-blue-500/10",label:"You"},assistant:{icon:sN,color:"text-emerald-400",bg:"bg-emerald-500/10",label:"Claude"},tool_use:{icon:is,color:"text-purple-400",bg:"bg-purple-500/10",label:"Tool Call"},tool_result:{icon:aN,color:"text-amber-400",bg:"bg-amber-500/10",label:"Tool Result"}},xOe=new Set(["progress","file-history-snapshot","pr-link","queue-operation","last-prompt","system"]);function SOe(e){return xOe.has(String(e.type??""))}function EOe(e){if(e.type!=="user"&&e.type!=="human")return!1;const t=e.message,r=t==null?void 0:t.content;return Array.isArray(r)?r.some(n=>typeof n=="object"&&n!==null&&n.type==="tool_result"):!1}function uV(e){return EOe(e)?"tool_result":e.type==="user"||e.type==="human"?"human":e.type==="assistant"?"assistant":String(e.type??"unknown")}function cV(e){const t=e.message,r=(t==null?void 0:t.content)??e.content??e.summary;if(typeof r=="string")return r;if(Array.isArray(r)){const n=[];for(const a of r){if(typeof a=="string"){n.push(a);continue}if(!a||typeof a!="object")continue;const i=a;if(i.type==="text")n.push(String(i.text??""));else if(i.type==="tool_use")n.push(`**Tool: ${i.name}** \`\`\`json ${JSON.stringify(i.input,null,2)} \`\`\``);else if(i.type==="tool_result"){const o=i.content;if(typeof o=="string")n.push(o);else if(Array.isArray(o))for(const l of o)typeof l=="string"?n.push(l):l&&typeof l=="object"&&l.type==="text"&&n.push(String(l.text??""))}}return n.join(` -`)}return""}function wOe(e){return typeof e.timestamp=="string"?e.timestamp:null}function kOe(e){const t=e.message,r=t==null?void 0:t.model;return r&&r!=="N/A"?r.replace("claude-","").replace(/-\d{8,}$/,""):null}function _Oe(e){const t=e.message,r=t==null?void 0:t.usage;if(!r)return null;const n=r.input_tokens??0,a=r.output_tokens??0;return n||a?{input:n,output:a}:null}function AOe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function TOe(e){return e>=100?`$${e.toFixed(0)}`:e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(2)}`:`$${e.toFixed(4)}`}function NOe(e){return e?e.replace("claude-","").replace(/-\d{8,}$/,""):""}function OOe({file:e,selected:t,onClick:r,compareMode:n=!1,checked:a=!1,checkboxDisabled:i=!1,onCheckToggle:o,highlighted:l=!1,rowRef:u,sessionId:d}){const f=(e.modified-e.created)/60,m=(e.input_tokens??0)+(e.output_tokens??0),y="w-full text-left rounded-lg border transition-colors p-4 flex items-start gap-3",x=t?"bg-white dark:bg-gray-800 border-indigo-500/50":a?"bg-indigo-950/30 border-indigo-500/60":"bg-gray-50/40 dark:bg-gray-900/40 border-gray-200 dark:border-gray-800 hover:border-gray-200 dark:hover:border-gray-700 hover:bg-gray-50/70 dark:hover:bg-gray-900/70",S=l?" ring-2 ring-indigo-400/70 animate-pulse":"",b=()=>{if(n){(!i||a)&&(o==null||o());return}r()},w=h.jsxs(h.Fragment,{children:[n&&h.jsx("div",{className:"pt-0.5 shrink-0",children:h.jsx("input",{type:"checkbox",checked:a,disabled:i&&!a,onChange:_=>{_.stopPropagation(),o==null||o()},onClick:_=>_.stopPropagation(),"aria-label":`Select session ${d} to compare`,"data-testid":`session-compare-checkbox-${d}`,className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-900 text-indigo-500 focus:ring-indigo-500 disabled:opacity-40"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3 mb-1.5",children:[h.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[e.title?h.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 line-clamp-2",children:e.title}):h.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono",children:e.name.split(".")[0]}),e.is_subagent&&h.jsx("span",{className:"shrink-0 text-[10px] font-medium text-purple-400 bg-purple-500/15 border border-purple-500/30 px-1.5 py-0.5 rounded",children:"Sub-agent"})]}),h.jsx("span",{className:"text-xs text-gray-500 shrink-0",children:vOe(e.modified)})]}),h.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-500 flex-wrap",children:[h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(z5,{size:11}),$T(f>.5?f:null)]}),e.messages!=null&&h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(oN,{size:11}),e.messages," msgs"]}),e.user_messages!=null&&h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(Ac,{size:11,className:"text-blue-400/70"}),e.user_messages," prompts"]}),e.tool_calls!=null&&e.tool_calls>0&&h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(is,{size:11,className:"text-purple-400/70"}),e.tool_calls," tools"]}),m>0&&h.jsxs("span",{children:[AOe(m)," tokens"]}),e.estimated_cost!=null&&e.estimated_cost>0&&h.jsx("span",{className:"text-emerald-400/80 font-medium",children:TOe(e.estimated_cost)}),e.model&&h.jsx("span",{className:"text-gray-600 dark:text-gray-400 bg-white dark:bg-gray-800 px-1.5 py-0.5 rounded text-[10px]",children:NOe(e.model)}),h.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:yOe(e.size)})]}),h.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-gray-600 dark:text-gray-400 mt-1.5",children:[h.jsxs("span",{children:["Created ",zl(e.created)]}),h.jsxs("span",{children:["Modified ",zl(e.modified)]})]})]})]});return n?h.jsx("div",{ref:u,role:"button",tabIndex:0,"data-session-id":d,"data-testid":`session-row-${d}`,onClick:b,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),b())},className:`${y} ${x}${S} ${i&&!a?"cursor-not-allowed opacity-60":"cursor-pointer"}`,children:w}):h.jsx("div",{ref:u,"data-session-id":d,"data-testid":`session-row-${d}`,className:S?`rounded-lg${S}`:void 0,children:h.jsx("button",{onClick:b,className:`${y} ${x}`,children:w})})}function COe({line:e,index:t,showRaw:r,isSidechain:n=!1,isFirstInSidechainGroup:a=!1}){const[i,o]=P.useState(!1),[l,u]=P.useState(!1),d=uV(e),p=cV(e),f=wOe(e),m=kOe(e),y=_Oe(e),x=Zq[d]??Zq.assistant,S=x.icon;if(!p&&!r)return null;const b=p.length>500,w=i||!b?p:p.slice(0,500)+"...",_=k=>n?h.jsxs("div",{className:"ml-6 border-l-2 border-purple-500/30 pl-3",children:[a&&h.jsx("div",{className:"text-[10px] font-medium text-purple-400/70 mb-1",children:"Sub-agent"}),k]}):h.jsx(h.Fragment,{children:k});return _(r?h.jsxs("div",{className:"border border-gray-200 dark:border-gray-800 rounded-lg p-3 bg-gray-50/30 dark:bg-gray-900/30",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsxs("span",{className:"text-[10px] text-gray-500 font-mono",children:["#",t+1]}),h.jsx("span",{className:`text-xs font-medium ${x.color}`,children:x.label}),f&&h.jsx("span",{className:"text-[10px] text-gray-500",children:zl(f)})]}),h.jsx("pre",{className:"text-[11px] text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap font-mono bg-gray-50/50 dark:bg-gray-950/50 rounded p-2 max-h-96 overflow-y-auto",children:JSON.stringify(e,null,2)})]}):h.jsxs("div",{className:`rounded-lg border border-gray-200/50 dark:border-gray-800/50 ${x.bg}`,children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-100/30 dark:border-gray-800/30",children:[h.jsx(S,{size:14,className:x.color}),h.jsx("span",{className:`text-xs font-medium ${x.color}`,children:x.label}),m&&h.jsx("span",{className:"text-[10px] text-gray-500 bg-white dark:bg-gray-800 px-1.5 py-0.5 rounded",children:m}),y&&h.jsxs("span",{className:"text-[10px] text-gray-600 dark:text-gray-400",children:[y.input.toLocaleString()," in / ",y.output.toLocaleString()," out"]}),h.jsx("span",{className:"flex-1"}),f&&h.jsx("span",{className:"text-[10px] text-gray-600 dark:text-gray-400",children:zl(f)}),h.jsx("button",{type:"button",onClick:()=>u(k=>!k),"aria-pressed":l,"aria-label":l?"Hide raw JSON":"View raw JSON",title:l?"Hide raw JSON":"View raw JSON",className:`text-[10px] px-1.5 py-0.5 rounded border transition-colors ${l?"bg-amber-100 text-amber-800 border-amber-300 dark:bg-amber-900/40 dark:text-amber-300 dark:border-amber-800":"bg-white dark:bg-gray-800 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-700 hover:text-gray-800 dark:hover:text-gray-200"}`,children:l?"Hide JSON":"JSON"})]}),h.jsxs("div",{className:"px-4 py-3",children:[h.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 whitespace-pre-wrap break-words",children:h.jsx(MN,{content:w})}),b&&!i&&h.jsx("button",{onClick:()=>o(!0),className:"text-xs text-indigo-400 hover:text-indigo-300 mt-2",children:"Show more..."}),b&&i&&h.jsx("button",{onClick:()=>o(!1),className:"text-xs text-indigo-400 hover:text-indigo-300 mt-2",children:"Show less"}),l&&h.jsx("pre",{className:"mt-3 text-[11px] text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap font-mono bg-gray-50/70 dark:bg-gray-950/60 rounded p-2 max-h-96 overflow-y-auto border border-gray-200 dark:border-gray-800",children:JSON.stringify(e,null,2)})]})]}))}function ROe({data:e,onBack:t}){const[r,n]=P.useState(!1),[a,i]=P.useState("all"),[o,l]=P.useState(""),[u,d]=P.useState(0),p=P.useMemo(()=>{let b=e.lines.filter(w=>!SOe(w));if(a==="hide_subagent"?b=b.filter(w=>w.isSidechain!==!0):a!=="all"&&(b=b.filter(w=>uV(w)===a)),o.trim()){const w=o.toLowerCase();b=b.filter(_=>cV(_).toLowerCase().includes(w))}return b},[e.lines,a,o]),f=Math.max(1,Math.ceil(p.length/rc)),m=Math.min(u,f-1),y=p.slice(m*rc,(m+1)*rc),x=P.useMemo(()=>{const b=new Map;return e.lines.forEach((w,_)=>b.set(w,_)),b},[e.lines]),S=e.metadata;return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[h.jsxs("button",{onClick:t,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700",children:[h.jsx(vd,{size:14}),"Sessions"]}),h.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500",children:[h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(oN,{size:12})," ",e.total_lines," messages"]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(Ac,{size:12,className:"text-blue-400"})," ",e.user_count]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(sN,{size:12,className:"text-emerald-400"})," ",e.assistant_count]}),S.duration_minutes&&h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(z5,{size:12})," ",$T(S.duration_minutes)]})]}),h.jsx("span",{className:"flex-1"}),h.jsxs("button",{onClick:()=>n(!r),className:`flex items-center gap-1.5 px-2.5 py-1 text-xs rounded border transition-colors ${r?"bg-amber-600/20 border-amber-600/50 text-amber-400":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"}`,children:[r?h.jsx(aN,{size:13}):h.jsx(qY,{size:13}),r?"Raw JSON":"Formatted"]})]}),h.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 p-3 bg-gray-50/60 dark:bg-gray-900/60 border border-gray-200 dark:border-gray-800 rounded-lg text-xs",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500 block mb-0.5",children:"Started"}),h.jsx("span",{className:"text-gray-800 dark:text-gray-200",children:zl(S.first_timestamp??S.created)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500 block mb-0.5",children:"Ended"}),h.jsx("span",{className:"text-gray-800 dark:text-gray-200",children:zl(S.last_timestamp??S.modified)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500 block mb-0.5",children:"Duration"}),h.jsx("span",{className:"text-gray-800 dark:text-gray-200",children:$T(S.duration_minutes)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500 block mb-0.5",children:"Working Dir"}),h.jsx("span",{className:"text-gray-800 dark:text-gray-200 font-mono text-[10px] truncate block",children:S.cwd})]})]}),h.jsxs("div",{className:"flex gap-2 flex-wrap",children:[h.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[h.jsx(ha,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-500"}),h.jsx("input",{type:"text",value:o,onChange:b=>{l(b.target.value),d(0)},placeholder:"Search in conversation...",className:"w-full pl-8 pr-3 py-1.5 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded text-xs text-gray-800 dark:text-gray-200 placeholder-gray-500 focus:outline-none focus:border-indigo-500"})]}),h.jsxs("select",{value:a,onChange:b=>{i(b.target.value),d(0)},className:"px-3 py-1.5 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded text-xs text-gray-700 dark:text-gray-300 focus:outline-none",children:[h.jsx("option",{value:"all",children:"Conversation"}),h.jsx("option",{value:"human",children:"Your prompts"}),h.jsx("option",{value:"assistant",children:"Claude responses"}),h.jsx("option",{value:"tool_result",children:"Tool results"}),h.jsx("option",{value:"hide_subagent",children:"Hide sub-agents"})]})]}),p.length===0?h.jsx(ya,{title:"No messages",description:"No messages match your filters."}):h.jsx("div",{className:"space-y-2",children:y.map((b,w)=>{const _=b.isSidechain===!0,k=w>0?y[w-1]:void 0,N=_&&(!k||k.isSidechain!==!0);return h.jsx(COe,{line:b,index:x.get(b)??w,showRaw:r,isSidechain:_,isFirstInSidechainGroup:N},x.get(b)??w)})}),f>1&&h.jsxs("div",{className:"flex items-center justify-between pt-1",children:[h.jsxs("span",{className:"text-xs text-gray-500",children:[m*rc+1,"–",Math.min((m+1)*rc,p.length)," of ",p.length]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:()=>d(b=>Math.max(0,b-1)),disabled:m===0,className:"p-1 rounded bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 disabled:opacity-40",children:h.jsx(nN,{size:14})}),h.jsxs("span",{className:"px-2 text-xs text-gray-600 dark:text-gray-400",children:[m+1,"/",f]}),h.jsx("button",{onClick:()=>d(b=>Math.min(f-1,b+1)),disabled:m>=f-1,className:"p-1 rounded bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 disabled:opacity-40",children:h.jsx(to,{size:14})})]})]})]})}function IOe(e){return e.replace(/\.jsonl$/i,"")}function LOe({projectName:e,sessionEfficiency:t}){var D;const[r,n]=P.useState(null),[a,i]=P.useState("modified"),[o,l]=P.useState(!1),[u,d]=P.useState([]),[p,f]=P.useState(null),m=P.useRef(new Map),y=Jr({queryKey:["jsonlFiles",e],queryFn:()=>BX(e)}),x=Jr({queryKey:["jsonlContent",r,e],queryFn:()=>UX(r,e),enabled:!!r}),b=((D=Jr({queryKey:["setProject",e],queryFn:()=>Z5(e),enabled:!!e,staleTime:6e4}).data)==null?void 0:D.log_path)??"",w=P.useCallback(C=>{C&&(f(C),requestAnimationFrame(()=>{const L=m.current.get(C);L&&L.scrollIntoView({behavior:"smooth",block:"center"})}),window.setTimeout(()=>{f(L=>L===C?null:L)},2e3))},[]);P.useEffect(()=>{const C=qa("session");C&&(w(C),Ph("session"))},[w]),P.useEffect(()=>{const C=()=>{const L=qa("session");L&&(w(L),Ph("session"))};return window.addEventListener("popstate",C),()=>window.removeEventListener("popstate",C)},[w]),P.useEffect(()=>{const C=L=>{const F=L.detail;F&&F.tab==="sessions"&&typeof F.session=="string"&&w(F.session)};return window.addEventListener(ns,C),()=>window.removeEventListener(ns,C)},[w]);const _=P.useCallback(C=>{d(L=>L.includes(C)?L.filter(F=>F!==C):L.length>=2?L:[...L,C])},[]),k=P.useCallback(()=>d([]),[]);if(y.isLoading)return h.jsx(Wa,{message:"Loading sessions..."});if(y.isError)return h.jsx("div",{className:"text-red-400 p-4",children:"Failed to load sessions"});const N=y.data;if(r){if(x.isLoading)return h.jsx(Wa,{message:"Loading conversation..."});if(x.isError)return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("button",{onClick:()=>n(null),className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700",children:[h.jsx(vd,{size:14})," Back"]}),h.jsx("div",{className:"text-red-400 p-4",children:"Failed to load conversation"})]});if(x.data)return h.jsx(ROe,{data:x.data,onBack:()=>n(null)})}if(N.length===0)return h.jsx(ya,{title:"No sessions",description:"No session files found."});const T=[...N].sort((C,L)=>a==="size"?L.size-C.size:a==="created"?L.created-C.created:L.modified-C.modified),E=u.length===2,[R,I]=u;return h.jsxs("div",{className:"space-y-4","data-testid":"sessions-tab",children:[h.jsx(lOe,{data:t??[]}),o&&E&&R&&I&&h.jsx(mOe,{logPath:b,sessionAId:R,sessionBId:I,onClose:k}),h.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[h.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[h.jsx(xd,{size:14}),h.jsxs("span",{children:[h.jsx("span",{className:"text-gray-900 dark:text-gray-100 font-medium",children:N.length})," sessions"]}),o&&h.jsxs("span",{className:"text-xs text-indigo-400",children:["· ",u.length,"/2 selected"]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsxs("button",{type:"button",onClick:()=>{l(C=>{const L=!C;return L||d([]),L})},"aria-pressed":o,"data-testid":"sessions-compare-toggle",className:`flex items-center gap-1.5 px-2.5 py-1 rounded border transition-colors ${o?"bg-indigo-600/20 border-indigo-500/60 text-indigo-300":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"}`,children:[h.jsx(X1,{size:13}),"Compare"]}),h.jsx("div",{className:"flex items-center gap-1",children:["modified","created","size"].map(C=>h.jsx("button",{onClick:()=>i(C),className:`px-2 py-1 rounded ${a===C?"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200":"text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"}`,children:C==="modified"?"Recent":C==="created"?"Oldest":"Size"},C))})]})]}),h.jsx("div",{className:"space-y-1.5",children:T.map(C=>{const L=IOe(C.name),F=u.includes(L);return h.jsx(OOe,{file:C,sessionId:L,selected:r===C.name,onClick:()=>n(C.name),compareMode:o,checked:F,checkboxDisabled:u.length>=2,onCheckToggle:()=>_(L),highlighted:p===L,rowRef:z=>{z?m.current.set(L,z):m.current.delete(L)}},C.name)})})]})}const Qq=6;function DOe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function POe(e,t=64){return e?e.length>t?`${e.slice(0,t-1).trimEnd()}…`:e:""}function jOe({rows:e,maxCount:t,scrollable:r=!1}){const n=r?"space-y-1.5 max-h-[300px] overflow-y-auto pr-1":"space-y-1.5";return h.jsx("div",{className:n,children:e.map(([a,i])=>{const o=t>0?i/t*100:0;return h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsx("span",{className:"w-24 text-gray-700 dark:text-gray-300 truncate",title:a,children:a}),h.jsx("div",{className:"flex-1 h-1.5 bg-white dark:bg-gray-800 rounded-full overflow-hidden",children:h.jsx("div",{className:"h-full bg-red-500/70",style:{width:`${o}%`}})}),h.jsx("span",{className:"text-gray-600 dark:text-gray-400 tabular-nums w-10 text-right",children:i})]},a)})})}function MOe({cmd:e}){const t=e.tool_count??0,r=e.cost??0;return h.jsxs("button",{type:"button",onClick:()=>Dd(e.interaction_id),className:"w-full flex items-start gap-2 px-2 py-1.5 rounded hover:bg-red-100 dark:hover:bg-red-900/20 focus:outline-none focus:bg-red-100 dark:focus:bg-red-900/20 text-left transition-colors group",title:"Open in Messages",children:[h.jsx(UY,{size:12,className:"text-gray-500 group-hover:text-red-300 mt-1 flex-shrink-0","aria-hidden":"true"}),h.jsx("span",{className:"flex-1 text-xs text-gray-700 dark:text-gray-300 truncate",title:e.prompt_preview??"",children:POe(e.prompt_preview??"(no prompt)",72)}),h.jsxs("span",{className:"text-[10px] text-red-700 dark:text-red-300 tabular-nums whitespace-nowrap",children:[t," err"]}),h.jsx("span",{className:"text-[10px] text-gray-600 dark:text-gray-400 tabular-nums whitespace-nowrap w-14 text-right",children:_t(r)})]})}function FOe({errorCost:e}){const[t,r]=P.useState(!1),[n,a]=P.useState(!1);if(!e||e.total_errors===0)return h.jsxs("div",{className:"bg-gradient-to-br from-red-900/20 to-gray-50/50 dark:to-gray-900/30 rounded-lg p-6 border border-red-900/30",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[h.jsx(Zi,{size:18,className:"text-red-400"}),h.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400 uppercase tracking-wider",children:"Error Cost"})]}),h.jsx("div",{className:"text-gray-500 text-sm",children:"No errors recorded."})]});const i=e.total_errors??0,o=e.estimated_retry_cost??0,l=e.estimated_retry_tokens??0,u=Object.entries(e.errors_by_tool??{}).filter(([,b])=>b>0).sort((b,w)=>w[1]-b[1]),d=u.slice(0,Qq),p=Math.max(0,u.length-Qq),f=u.length>0?Math.max(...u.map(([,b])=>b)):0,m=u.length,y=e.top_error_commands??[],x=y.slice(0,3),S=Math.max(0,y.length-3);return h.jsxs("div",{className:"bg-gradient-to-br from-red-900/30 to-gray-50/60 dark:to-gray-900/40 rounded-lg p-6 border border-red-900/40",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[h.jsx(Zi,{size:18,className:"text-red-400"}),h.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400 uppercase tracking-wider",children:"Error Cost"})]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-4xl font-bold text-red-700 dark:text-red-300 leading-none tabular-nums",children:_t(o)}),h.jsxs("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-2",children:["wasted on"," ",h.jsx("span",{className:"text-red-700 dark:text-red-200 font-medium",children:i.toLocaleString()})," error",i===1?"":"s"," across"," ",h.jsx("span",{className:"text-red-700 dark:text-red-200 font-medium",children:m})," tool",m===1?"":"s"]}),h.jsxs("div",{className:"text-[10px] text-gray-500 mt-1 tabular-nums",children:["≈ ",DOe(l)," retry tokens"]})]}),u.length>0&&h.jsxs("div",{className:"mt-5 pt-4 border-t border-red-900/30",children:[h.jsx("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-2",children:"Errors by tool"}),h.jsx(jOe,{rows:t?u:d,maxCount:f,scrollable:t}),(p>0||t)&&h.jsx("button",{type:"button",onClick:()=>r(b=>!b),className:"mt-2 inline-flex items-center gap-1 text-[11px] text-red-700/80 dark:text-red-300/80 hover:text-red-800 dark:hover:text-red-200 focus:outline-none","aria-expanded":t,children:t?h.jsxs(h.Fragment,{children:[h.jsx(Tf,{size:12,"aria-hidden":"true"}),"Show fewer"]}):h.jsxs(h.Fragment,{children:[h.jsx(Xo,{size:12,"aria-hidden":"true"}),"Show all ",u.length," tools"]})})]}),y.length>0&&h.jsxs("div",{className:"mt-5 pt-4 border-t border-red-900/30",children:[h.jsx("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-2",children:"Top error commands"}),h.jsx("div",{className:"space-y-0.5",children:(n?y:x).map(b=>h.jsx(MOe,{cmd:b},b.interaction_id))}),(S>0||n)&&h.jsx("button",{type:"button",onClick:()=>a(b=>!b),className:"mt-2 inline-flex items-center gap-1 text-[11px] text-red-700/80 dark:text-red-300/80 hover:text-red-800 dark:hover:text-red-200 focus:outline-none","aria-expanded":n,children:n?h.jsxs(h.Fragment,{children:[h.jsx(Tf,{size:12,"aria-hidden":"true"}),"Show fewer"]}):h.jsxs(h.Fragment,{children:[h.jsx(Xo,{size:12,"aria-hidden":"true"}),"Show all ",y.length," commands"]})})]})]})}const Jq=["#818CF8","#34D399","#F59E0B","#F87171","#A78BFA","#38BDF8","#FB923C","#E879F9","#2DD4BF","#FCD34D"];function $Oe(e){return e.length>8?e.slice(0,8):e}function BOe(e){if(!Number.isFinite(e)||e<0)return"0:00:00";const t=Math.floor(e),r=Math.floor(t/3600),n=Math.floor(t%3600/60),a=t%60;return`${r}:${n.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`}function gf(e){return Number.isFinite(e)?e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString():"0"}function UOe({active:e,payload:t}){var p;if(!e||!t||t.length===0)return null;const r=(p=t[0])==null?void 0:p.payload;if(!r)return null;const n=r.tokens??{},a=Number(n.input??0),i=Number(n.output??0),o=Number(n.cache_read??0),l=Number(n.cache_creation??0),u=r.preview||"",d=u.length>140?u.slice(0,140)+"…":u;return h.jsxs("div",{style:{backgroundColor:"#1F2937",border:"1px solid #374151",borderRadius:"6px",fontSize:"12px",maxWidth:360,padding:"8px 10px",color:"#D1D5DB"},children:[h.jsx("div",{style:{fontFamily:"monospace",color:"#F3F4F6",marginBottom:4},children:r.short_id}),d&&h.jsx("div",{style:{color:"#9CA3AF",marginBottom:6,fontStyle:"italic"},children:d}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[h.jsx("span",{style:{color:"#9CA3AF"},children:"Cost"}),h.jsx("span",{style:{color:"#F3F4F6",fontWeight:600},children:_t(r.cost)})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[h.jsx("span",{style:{color:"#9CA3AF"},children:"Duration"}),h.jsx("span",{style:{color:"#F3F4F6"},children:BOe(r.duration_s)})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[h.jsx("span",{style:{color:"#9CA3AF"},children:"Commands"}),h.jsx("span",{style:{color:"#F3F4F6"},children:r.commands.toLocaleString()})]}),r.errors>0&&h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[h.jsx("span",{style:{color:"#9CA3AF"},children:"Errors"}),h.jsx("span",{style:{color:"#F87171"},children:r.errors.toLocaleString()})]}),h.jsxs("div",{style:{borderTop:"1px solid #374151",marginTop:6,paddingTop:6,color:"#9CA3AF"},children:[h.jsx("div",{style:{fontSize:"11px",marginBottom:2,color:"#6B7280"},children:"Tokens"}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[h.jsx("span",{children:"Input"}),h.jsx("span",{style:{color:"#D1D5DB"},children:gf(a)})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[h.jsx("span",{children:"Output"}),h.jsx("span",{style:{color:"#D1D5DB"},children:gf(i)})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[h.jsx("span",{children:"Cache read"}),h.jsx("span",{style:{color:"#D1D5DB"},children:gf(o)})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[h.jsx("span",{children:"Cache creation"}),h.jsx("span",{style:{color:"#D1D5DB"},children:gf(l)})]})]}),r.models_used&&r.models_used.length>0&&h.jsxs("div",{style:{borderTop:"1px solid #374151",marginTop:6,paddingTop:6,color:"#9CA3AF"},children:[h.jsx("div",{style:{fontSize:"11px",marginBottom:2,color:"#6B7280"},children:"Models"}),h.jsx("div",{style:{color:"#D1D5DB",fontFamily:"monospace",fontSize:"11px",whiteSpace:"normal",wordBreak:"break-word"},children:r.models_used.join(", ")})]})]})}function zOe({data:e,onSelect:t}){if(!e||e.length===0)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Top Sessions by Cost"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No session cost data yet"})]});const r=[...e].sort((o,l)=>l.cost-o.cost).slice(0,10).map(o=>{const l=$Oe(o.session_id),u=(o.first_prompt_preview??"").replace(/\s+/g," ").trim(),d=u.length>36?u.slice(0,36)+"…":u;return{session_id:o.session_id,short_id:l,label:d?`${l} · ${d}`:l,cost:o.cost,commands:o.commands,errors:o.errors,messages:o.messages,duration_s:o.duration_s,models_used:o.models_used??[],tokens:o.tokens??{},preview:o.first_prompt_preview}}),a=r.reduce((o,l)=>l.cost>o?l.cost:o,0)*.1,i=o=>{const l=o==null?void 0:o.session_id;if(l){if(t){t(l);return}dd(l)}};return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[h.jsxs("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:["Top Sessions by Cost",h.jsxs("span",{className:"ml-2 text-xs text-gray-500 font-normal",children:["top ",r.length]})]}),h.jsx(pr,{width:"100%",height:Math.max(260,r.length*32),children:h.jsxs(ni,{data:r,layout:"vertical",margin:{left:10,right:20},children:[h.jsx(Br,{strokeDasharray:"3 3",stroke:"#374151",horizontal:!1}),h.jsx(Vt,{type:"number",tick:{fontSize:10,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"},tickFormatter:_t}),h.jsx(Rt,{type:"category",dataKey:"label",tick:{fontSize:11,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"},width:320,interval:0}),h.jsx(ut,{content:h.jsx(UOe,{}),cursor:{fill:"rgba(75, 85, 99, 0.15)"}}),h.jsxs(At,{dataKey:"cost",radius:[0,4,4,0],cursor:"pointer",onClick:i,children:[r.map((o,l)=>h.jsx(yn,{fill:Jq[l%Jq.length]},l)),h.jsx(mn,{dataKey:"cost",position:"insideRight",fill:"#F9FAFB",fontSize:10,fontWeight:600,formatter:o=>{const l=typeof o=="number"?o:Number(o);return!Number.isFinite(l)||l<=a?"":_t(l)}})]})]})})]})}const qOe={cost:"cost",tokens:"tokens",tools:"tools",steps:"steps",when:"when"};function dV(e){return e?(e.input??0)+(e.output??0)+(e.cache_read??0)+(e.cache_creation??0):0}function GOe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function pV(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function e5(e,t){switch(t){case"cost":return e.cost??0;case"tokens":return dV(e.tokens);case"tools":return e.tools_used??0;case"steps":return e.steps??0;case"when":return e.timestamp??""}}function HOe(e,t,r){const n=e===""||e==null,a=t===""||t==null;if(n&&a)return 0;if(n)return 1;if(a)return-1;if(typeof e=="number"&&typeof t=="number")return r==="asc"?e-t:t-e;const i=String(e),o=String(t);return r==="asc"?i.localeCompare(o):o.localeCompare(i)}function WOe(e){if(e.length===0)return 0;const t=[...e].sort((n,a)=>n-a),r=Math.floor(t.length/2);return t.length%2===0?((t[r-1]??0)+(t[r]??0))/2:t[r]??0}function VOe(e,t){if(e.length===0)return 0;const r=[...e].sort((i,o)=>i-o),n=Math.ceil(t/100*r.length),a=Math.min(Math.max(n-1,0),r.length-1);return r[a]??0}function KOe(e,t,r){const[n,a]=P.useState(t),[i,o]=P.useState(r),l=P.useMemo(()=>{const d=[...e];return d.sort((p,f)=>HOe(e5(p,n),e5(f,n),i)),d},[e,n,i]),u=P.useCallback(d=>{a(p=>p===d?(o(f=>f==="asc"?"desc":"asc"),p):(o("desc"),d))},[]);return{sorted:l,sortKey:n,sortDir:i,setSort:u}}function nc({label:e,sortKey:t,activeKey:r,dir:n,onSort:a,align:i="right",className:o}){const l=t===r;return h.jsx("th",{scope:"col",className:`px-3 py-2 cursor-pointer select-none hover:text-gray-800 dark:hover:text-gray-200 ${i==="right"?"text-right":"text-left"} ${o??""}`,onClick:()=>a(t),"aria-sort":l?n==="asc"?"ascending":"descending":"none","data-testid":`ccl-sort-${t}`,children:h.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[e,l&&(n==="asc"?h.jsx(rN,{size:11,className:"inline"}):h.jsx(tN,{size:11,className:"inline"}))]})})}function YOe({row:e,colSpan:t}){return h.jsx("tr",{className:"border-b border-gray-200/50 dark:border-gray-800/50 bg-gray-50/60 dark:bg-gray-900/40","data-testid":"ccl-expanded",children:h.jsx("td",{colSpan:t,className:"px-3 py-3",children:h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1",children:"Prompt"}),h.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 whitespace-pre-wrap break-words",children:e.prompt_preview||h.jsx("span",{className:"text-gray-500 italic",children:"(empty prompt)"})})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[e.had_error&&h.jsxs(Qn,{color:"red",children:[h.jsx(Zi,{size:10,className:"mr-1"}),"had error"]}),(e.models_used??[]).map(r=>h.jsx(Qn,{color:"purple",children:r},r)),(e.models_used==null||e.models_used.length===0)&&h.jsx("span",{className:"text-[10px] text-gray-500",children:"no model recorded"}),h.jsxs("span",{className:"text-[10px] text-gray-500 ml-auto font-mono",children:["session ",e.session_id.slice(0,8)," · ",pV(e.timestamp)]})]})]})})})}function XOe({data:e,onOpen:t,initialSort:r}){const n=e??[],{sorted:a,sortKey:i,sortDir:o,setSort:l}=KOe(n,(r==null?void 0:r.key)??"cost",(r==null?void 0:r.dir)??"desc"),[u,d]=P.useState(()=>new Set),[p,f]=P.useState(1),[m,y]=P.useState(10),x=Math.max(1,Math.ceil(a.length/m)),S=Math.min(p,x),b=P.useMemo(()=>a.slice((S-1)*m,S*m),[a,S,m]),w=P.useMemo(()=>n.reduce((E,R)=>E+(R.cost??0),0),[n]),_=P.useMemo(()=>{const E=n.map(R=>R.cost??0);return{sum:E.reduce((R,I)=>R+I,0),median:WOe(E),p95:VOe(E,95)}},[n]),k=P.useCallback(E=>{d(R=>{const I=new Set(R);return I.has(E)?I.delete(E):I.add(E),I})},[]),N=P.useCallback(E=>{if(t){t(E);return}Dd(E)},[t]);if(!e||e.length===0)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"ccl-root-empty",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Most Expensive Commands"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No command cost data yet"})]});const T=8;return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"ccl-root",children:[h.jsxs("div",{className:"flex items-baseline justify-between mb-3 gap-3 flex-wrap",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Most Expensive Commands"}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"text-xs text-gray-500","data-testid":"ccl-caption",children:a.length===0?"no rows":`${(S-1)*m+1}–${Math.min(S*m,a.length)} of ${a.length}, sorted by ${qOe[i]} (${o})`}),h.jsx("select",{value:m,onChange:E=>{y(Number(E.target.value)),f(1)},"aria-label":"Rows per page",className:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded px-2 py-1 text-xs text-gray-700 dark:text-gray-300",children:[10,25,50,100].map(E=>h.jsxs("option",{value:E,children:[E,"/page"]},E))})]})]}),h.jsx("div",{className:"bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800 overflow-hidden",children:h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400 text-xs uppercase tracking-wider",children:[h.jsx("th",{scope:"col",className:"w-8","aria-label":"expand"}),h.jsx("th",{scope:"col",className:"px-3 py-2 text-left",children:"Prompt"}),h.jsx(nc,{label:"When",sortKey:"when",activeKey:i,dir:o,onSort:l,align:"left",className:"w-32"}),h.jsx(nc,{label:"Cost",sortKey:"cost",activeKey:i,dir:o,onSort:l,className:"w-20"}),h.jsx("th",{scope:"col",className:"px-3 py-2 text-right w-16",children:"%Total"}),h.jsx(nc,{label:"Tokens",sortKey:"tokens",activeKey:i,dir:o,onSort:l,className:"w-20"}),h.jsx(nc,{label:"Tools",sortKey:"tools",activeKey:i,dir:o,onSort:l,className:"w-16"}),h.jsx(nc,{label:"Steps",sortKey:"steps",activeKey:i,dir:o,onSort:l,className:"w-16"})]})}),h.jsx("tbody",{children:b.map(E=>{const R=dV(E.tokens),I=w>0?E.cost/w*100:0,D=u.has(E.interaction_id);return h.jsxs(P.Fragment,{children:[h.jsxs("tr",{className:"border-b border-gray-200/50 dark:border-gray-800/50 hover:bg-gray-100/70 dark:hover:bg-gray-800/50 cursor-pointer",onClick:()=>N(E.interaction_id),"data-testid":"ccl-row",children:[h.jsx("td",{className:"px-2 py-2 text-gray-500 w-8",children:h.jsx("button",{type:"button",onClick:C=>{C.stopPropagation(),k(E.interaction_id)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.stopPropagation(),k(E.interaction_id))},className:"p-0.5 rounded hover:text-gray-800 dark:hover:text-gray-200 hover:bg-gray-200/70 dark:hover:bg-gray-700/50 focus:outline-none focus:ring-1 focus:ring-indigo-500","aria-expanded":D,"aria-label":D?"Collapse row":"Expand row","data-testid":"ccl-expand-toggle",children:D?h.jsx(Xo,{size:14}):h.jsx(to,{size:14})})}),h.jsx("td",{className:"px-3 py-2 text-gray-800 dark:text-gray-200 max-w-md",children:h.jsxs("div",{className:"flex items-start gap-1.5",children:[E.had_error&&h.jsx(Zi,{size:12,className:"text-red-400 mt-0.5 flex-shrink-0"}),h.jsx("span",{className:"truncate block",title:E.prompt_preview,children:E.prompt_preview||h.jsx("span",{className:"text-gray-500 italic",children:"(empty prompt)"})})]})}),h.jsx("td",{className:"px-3 py-2 text-gray-500 text-xs whitespace-nowrap",children:pV(E.timestamp)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-900 dark:text-gray-100 font-medium tabular-nums",children:_t(E.cost)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-500 tabular-nums text-xs",children:I>=.1?`${I.toFixed(1)}%`:"—"}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:GOe(R)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:E.tools_used}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:E.steps})]}),D&&h.jsx(YOe,{row:E,colSpan:T})]},E.interaction_id)})}),h.jsx("tfoot",{children:h.jsxs("tr",{className:"border-t border-gray-300 dark:border-gray-700 text-gray-700 dark:text-gray-300 text-xs bg-gray-100/60 dark:bg-gray-800/40","data-testid":"ccl-footer",children:[h.jsx("td",{colSpan:3,className:"px-3 py-2 text-left uppercase tracking-wider text-gray-500",children:"Cost aggregates"}),h.jsxs("td",{className:"px-3 py-2 text-right font-medium tabular-nums",title:"Sum",children:["Σ ",_t(_.sum)]}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-500 tabular-nums",children:"100%"}),h.jsxs("td",{colSpan:3,className:"px-3 py-2 text-right text-gray-600 dark:text-gray-400 tabular-nums text-[11px]",children:["median ",_t(_.median)," · p95 ",_t(_.p95)]})]})})]})})}),x>1&&h.jsxs("div",{className:"flex items-center justify-between mt-3 text-xs text-gray-600 dark:text-gray-400","data-testid":"ccl-pagination",children:[h.jsxs("span",{children:["Page ",S," of ",x]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:()=>f(E=>Math.max(1,E-1)),disabled:S<=1,className:"px-2 py-1 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Prev"}),h.jsx("button",{type:"button",onClick:()=>f(E=>Math.min(x,E+1)),disabled:S>=x,className:"px-2 py-1 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}const t5=["#818CF8","#34D399","#F59E0B","#F87171","#A78BFA","#38BDF8","#FB923C","#E879F9","#2DD4BF","#FCD34D"],C1=[{key:"cost",label:"Cost"},{key:"calls",label:"Calls"},{key:"tokens",label:"Tokens"}];function To(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function r5(e){return!isFinite(e)||e<=0?"—":e<.1?"<0.1%":e<10?`${e.toFixed(1)}%`:`${e.toFixed(0)}%`}function ZOe({data:e,onToolClick:t}){var x,S;const[r,n]=P.useState("cost"),a=P.useMemo(()=>{if(!e)return[];const b=Object.entries(e).map(([k,N])=>{const T=N.input_tokens??0,E=N.output_tokens??0,R=N.cache_read_tokens??0,I=N.cache_creation_tokens??0;return{name:k,cost:N.cost??0,calls:N.calls??0,tokens:T+E+R+I,input:T,output:E,cacheRead:R,cacheCreation:I}}).filter(k=>k.cost>0||k.calls>0||k.tokens>0),w=b.reduce((k,N)=>k+(N[r]||0),0);return[...b].sort((k,N)=>(N[r]||0)-(k[r]||0)).slice(0,12).map(k=>{const N=k[r]||0,T=w>0?N/w*100:0,E=r==="cost"?_t(k.cost):To(N);return{...k,pctOfTotal:T,label:`${E} · ${r5(T)}`}})},[e,r]),i=a.length>0,o=`Tools by ${((x=C1.find(b=>b.key===r))==null?void 0:x.label)??"Cost"}`,l=h.jsxs("div",{className:"flex items-center justify-between mb-3 gap-3",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:o}),h.jsx("div",{role:"tablist","aria-label":"Sort tools",className:"inline-flex items-center rounded-md border border-gray-300 dark:border-gray-700 bg-gray-50/80 dark:bg-gray-900/60 p-0.5 text-[11px]",children:C1.map(b=>{const w=b.key===r;return h.jsx("button",{role:"tab","aria-selected":w,type:"button",onClick:()=>n(b.key),className:["px-2.5 py-1 rounded transition-colors",w?"bg-indigo-500/25 text-indigo-200":"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"].join(" "),children:b.label},b.key)})})]});if(!e||Object.keys(e).length===0||!i)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[l,h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No tool cost data yet"})]});const u=r,d=Math.max(...a.map(b=>b.name.length)),p=Math.min(d*6,160),f=b=>{var _;let w;if(b&&typeof b=="object"){const k=b;w=k.name??((_=k.payload)==null?void 0:_.name)}w&&(t&&t(w),typeof window<"u"&&typeof CustomEvent<"u"&&window.dispatchEvent(new CustomEvent("stackunderflow:filter-tool",{detail:{tool:w}})))},m=r==="cost"?b=>_t(b):b=>To(b),y=(((S=C1.find(b=>b.key===r))==null?void 0:S.label)??"cost").toLowerCase();return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[l,h.jsx(pr,{width:"100%",height:Math.max(260,a.length*32),children:h.jsxs(ni,{data:a,layout:"vertical",margin:{left:20,right:88},children:[h.jsx(Br,{strokeDasharray:"3 3",stroke:"#374151",horizontal:!1}),h.jsx(Vt,{type:"number",tick:{fontSize:10,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"},tickFormatter:m}),h.jsx(Rt,{type:"category",dataKey:"name",tick:{fontSize:10,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"},width:p}),h.jsx(ut,{cursor:{fill:"rgba(129, 140, 248, 0.08)"},contentStyle:{backgroundColor:"#1F2937",border:"1px solid #374151",borderRadius:"6px",fontSize:"12px",whiteSpace:"pre-line"},labelStyle:{color:"#D1D5DB"},formatter:(b,w,_)=>{const k=_==null?void 0:_.payload;return k?[[`${_t(k.cost)} · ${r5(k.pctOfTotal)} of ${y}`,`calls: ${To(k.calls)}`,`input: ${To(k.input)} · output: ${To(k.output)}`,`cache read: ${To(k.cacheRead)} · cache creation: ${To(k.cacheCreation)}`].join(` -`),"Details"]:["",""]}}),h.jsxs(At,{dataKey:u,radius:[0,4,4,0],cursor:"pointer",onClick:f,children:[a.map((b,w)=>h.jsx(yn,{fill:t5[w%t5.length]},w)),h.jsx(mn,{dataKey:"label",position:"right",style:{fill:"#D1D5DB",fontSize:10}})]})]})}),h.jsxs("p",{className:"mt-2 text-[10px] text-gray-500",children:["Click a bar to filter by that tool. % is share of total ",y," across all tools."]})]})}const Sf=[{key:"input",color:"#818CF8",label:"Input"},{key:"output",color:"#34D399",label:"Output"},{key:"cache_read",color:"#F59E0B",label:"Cache Read"},{key:"cache_creation",color:"#FB923C",label:"Cache Creation"}],QOe=[{key:"7d",label:"7d"},{key:"30d",label:"30d"},{key:"all",label:"All"}];function JOe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function eCe({active:e,label:t,payload:r}){var i;if(!e||!r||r.length===0)return null;const n=(i=r[0])==null?void 0:i.payload;if(!n)return null;const a=(n.input??0)+(n.output??0)+(n.cache_read??0)+(n.cache_creation??0);return h.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md p-2.5 text-xs shadow-lg","data-testid":"token-stack-tooltip",children:[h.jsx("div",{className:"text-gray-800 dark:text-gray-200 font-medium mb-1.5",children:t}),h.jsx("div",{className:"space-y-1",children:Sf.map(o=>{const l=n[o.key]??0,u=a>0?l/a*100:0;return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),h.jsx("span",{className:"text-gray-600 dark:text-gray-400 flex-1",children:o.label}),h.jsx("span",{className:"text-gray-800 dark:text-gray-200 tabular-nums",children:l.toLocaleString()}),h.jsxs("span",{className:"text-gray-500 tabular-nums w-10 text-right",children:[u.toFixed(1),"%"]})]},o.key)})}),h.jsxs("div",{className:"mt-1.5 pt-1.5 border-t border-gray-300 dark:border-gray-700 flex items-center justify-between",children:[h.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Total"}),h.jsx("span",{className:"text-gray-900 dark:text-gray-100 font-medium tabular-nums",children:a.toLocaleString()})]})]})}function tCe({daily:e}){const[t,r]=P.useState("all"),[n,a]=P.useState(null),i=P.useMemo(()=>e?Object.entries(e).map(([d,p])=>({date:d,input:p.input??0,output:p.output??0,cache_read:p.cache_read??0,cache_creation:p.cache_creation??0})).sort((d,p)=>d.date.localeCompare(p.date)):[],[e]),o=P.useMemo(()=>{if(t==="all")return i;const d=t==="7d"?7:30;return i.slice(-d)},[i,t]);if(!e||Object.keys(e).length===0)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"token-composition-stack",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Daily Token Composition"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No daily token data yet"})]});const l=n?Sf.filter(d=>d.key===n):Sf,u=d=>{a(p=>p===d?null:d)};return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"token-composition-stack",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2 flex-wrap",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Daily Token Composition"}),h.jsx("div",{className:"flex items-center gap-1",role:"group","aria-label":"Date range filter","data-testid":"token-stack-range",children:QOe.map(d=>{const p=t===d.key;return h.jsx("button",{type:"button",onClick:()=>r(d.key),"data-testid":`token-stack-range-${d.key}`,"aria-pressed":p,className:`inline-flex items-center px-2 py-0.5 text-[11px] font-medium rounded-full border transition-colors ${p?"bg-indigo-100 text-indigo-800 border-indigo-300 dark:bg-indigo-900/50 dark:text-indigo-200 dark:border-indigo-700":"bg-gray-100/90 dark:bg-gray-800/80 text-gray-600 dark:text-gray-400 border-gray-300 dark:border-gray-700 hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-400 dark:hover:border-gray-600"}`,children:d.label},d.key)})})]}),o.length===0?h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No data in this range"}):h.jsx(pr,{width:"100%",height:260,children:h.jsxs(ni,{data:o,children:[h.jsx(Br,{strokeDasharray:"3 3",stroke:"#374151"}),h.jsx(Vt,{dataKey:"date",tick:{fontSize:10,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"}}),h.jsx(Rt,{tick:{fontSize:10,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"},tickFormatter:JOe}),h.jsx(ut,{cursor:{fill:"rgba(99, 102, 241, 0.08)"},content:h.jsx(eCe,{})}),l.map((d,p)=>h.jsx(At,{dataKey:d.key,stackId:"tokens",fill:d.color,name:d.key,radius:p===l.length-1?[4,4,0,0]:[0,0,0,0]},d.key))]})}),h.jsxs("div",{className:"mt-3 flex items-center justify-center gap-3 flex-wrap",role:"group","aria-label":"Series legend — click to isolate","data-testid":"token-stack-legend",children:[Sf.map(d=>{const p=n!==null&&n!==d.key;return h.jsxs("button",{type:"button",onClick:()=>u(d.key),"data-testid":`token-stack-legend-${d.key}`,"aria-pressed":n===d.key,title:n===d.key?"Click to show all series":`Click to isolate ${d.label}`,className:`inline-flex items-center gap-1.5 text-[11px] transition-opacity ${p?"opacity-40 hover:opacity-70":"opacity-100"} text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200`,children:[h.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:d.color}}),h.jsx("span",{children:d.label})]},d.key)}),n!==null&&h.jsx("button",{type:"button",onClick:()=>a(null),"data-testid":"token-stack-legend-reset",className:"text-[11px] text-indigo-700 dark:text-indigo-300 hover:text-indigo-800 dark:hover:text-indigo-200 underline underline-offset-2",children:"reset"})]})]})}function BT(e){return e==null||typeof e=="number"&&Number.isNaN(e)}function rCe(e,t,r){const n=BT(e),a=BT(t);if(n&&a)return 0;if(n)return 1;if(a)return-1;let i=0;if(typeof e=="number"&&typeof t=="number")i=e-t;else{const o=String(e),l=String(t);if(/^\d{4}-\d{2}-\d{2}/.test(o)&&/^\d{4}-\d{2}-\d{2}/.test(l)){const u=Date.parse(o),d=Date.parse(l);!Number.isNaN(u)&&!Number.isNaN(d)?i=u-d:i=o.localeCompare(l)}else i=o.localeCompare(l,void 0,{numeric:!0,sensitivity:"base"})}return r==="asc"?i:-i}function nCe(e,t){const[r,n]=P.useState(t.key),[a,i]=P.useState(t.dir),o=P.useCallback(u=>{if(u===r){i(f=>f==="asc"?"desc":"asc");return}n(u);const d=e.find(f=>!BT(f[u])),p=d?d[u]:void 0;i(typeof p=="number"?"desc":"asc")},[r,e]);return{sorted:P.useMemo(()=>{const u=e.slice();return u.sort((d,p)=>rCe(d[r],p[r],a)),u},[e,r,a]),sortKey:r,sortDir:a,setSort:o}}function R1({label:e,sortKey:t,activeKey:r,dir:n,onClick:a,align:i="left",className:o}){const l=t===r,d=["cursor-pointer select-none px-3 py-2",i==="right"?"text-right":"text-left",o??""].filter(Boolean).join(" "),p=["inline-flex items-center gap-1",i==="right"?"w-full justify-end":""].filter(Boolean).join(" "),f=l?n==="asc"?Tf:Xo:null;return P.createElement("th",{onClick:a,className:d,"data-sort-key":t,"aria-sort":l?n==="asc"?"ascending":"descending":"none",role:"columnheader",scope:"col",tabIndex:0,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),a())}},P.createElement("span",{className:p},P.createElement("span",null,e),f?P.createElement(f,{size:12,stroke:2.5,"aria-hidden":!0}):null))}function aCe({expanded:e,onToggle:t,columns:r,children:n,detail:a,rowClassName:i,detailClassName:o,"data-testid":l}){const u=i??"border-b border-gray-200/50 dark:border-gray-800/50 hover:bg-gray-100/70 dark:hover:bg-gray-800/50 cursor-pointer focus:outline-none focus:bg-gray-100/70 dark:focus:bg-gray-800/50",d=o??"bg-gray-50/80 dark:bg-gray-900/60 text-gray-700 dark:text-gray-300 px-6 py-3 border-b border-gray-200 dark:border-gray-800",p=f=>{(f.key==="Enter"||f.key===" "||f.key==="Spacebar")&&(f.preventDefault(),t())};return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{className:u,role:"button",tabIndex:0,"aria-expanded":e,onClick:t,onKeyDown:p,"data-testid":l,children:[h.jsx("td",{className:"w-6 px-2 py-2 text-gray-500 align-middle",children:h.jsx(to,{size:14,className:`transition-transform duration-150 ease-out ${e?"rotate-90":""}`,"aria-hidden":"true"})}),n]}),e&&h.jsx("tr",{"data-testid":l?`${l}-detail`:void 0,children:h.jsx("td",{colSpan:r,className:d,children:a})})]})}function iCe(e){const t=e.filter(a=>typeof a=="number"&&!Number.isNaN(a));if(t.length===0)return 0;const r=[...t].sort((a,i)=>a-i),n=Math.floor(r.length/2);return r.length%2===0?((r[n-1]??0)+(r[n]??0))/2:r[n]??0}function oCe(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}const sCe=10;function n5({title:e,icon:t,rows:r,countKey:n,countLabel:a,empty:i,testIdPrefix:o,onOpenInteraction:l,onOpenSession:u}){const{sorted:d,sortDir:p,sortKey:f,setSort:m}=nCe(r,{key:n,dir:"desc"}),[y,x]=P.useState(1),[S,b]=P.useState(sCe),[w,_]=P.useState(null),k=d.length,N=Math.max(1,Math.ceil(k/S)),T=Math.min(y,N),E=P.useMemo(()=>d.slice((T-1)*S,T*S),[d,T,S]),R=P.useMemo(()=>iCe(r.map(C=>C.cost)),[r]),I=5,D=String(f);return h.jsxs("div",{"data-testid":`${o}-section`,children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-600 dark:text-gray-400 mb-2",children:[h.jsx("span",{className:"text-gray-500",children:t}),h.jsx("span",{className:"font-medium uppercase tracking-wider",children:e}),h.jsxs("span",{className:"text-gray-500",children:["(",r.length,")"]})]}),r.length===0?h.jsx("div",{className:"text-xs text-gray-500 py-4 px-3 bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800",children:i}):h.jsxs("div",{className:"bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800 overflow-hidden",children:[h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-sm","data-testid":`${o}-table`,children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400 text-xs uppercase tracking-wider",children:[h.jsx("th",{className:"w-6 px-2 py-2","aria-hidden":"true"}),h.jsx("th",{className:"px-3 py-2 text-left",children:"Prompt"}),h.jsx(R1,{label:"When",sortKey:"timestamp",activeKey:D,dir:p,onClick:()=>m("timestamp"),className:"w-28"}),h.jsx(R1,{label:a,sortKey:n,activeKey:D,dir:p,onClick:()=>m(n),align:"right",className:"w-20"}),h.jsx(R1,{label:"Cost",sortKey:"cost",activeKey:D,dir:p,onClick:()=>m("cost"),align:"right",className:"w-20"})]})}),h.jsx("tbody",{children:E.map(C=>{const L=w===C.interaction_id;return h.jsxs(aCe,{expanded:L,onToggle:()=>{_(L?null:C.interaction_id),l(C.interaction_id)},columns:I,"data-testid":`${o}-row-${C.interaction_id}`,detail:h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-xs uppercase tracking-wider text-gray-500 mb-1",children:"Prompt"}),h.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 whitespace-pre-wrap break-words",children:C.prompt_preview||h.jsx("span",{className:"text-gray-500 italic",children:"(empty prompt)"})})]}),h.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-1 text-xs text-gray-600 dark:text-gray-400",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500",children:"Tool calls:"})," ",h.jsx("span",{className:"tabular-nums text-gray-800 dark:text-gray-200",children:C.tool_count})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500",children:"Assistant steps:"})," ",h.jsx("span",{className:"tabular-nums text-gray-800 dark:text-gray-200",children:C.step_count})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500",children:"Cost:"})," ",h.jsx("span",{className:"tabular-nums text-gray-800 dark:text-gray-200",children:_t(C.cost)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500",children:"Session:"})," ",h.jsx("button",{type:"button",className:"text-blue-400 hover:text-blue-300 hover:underline font-mono text-xs",onClick:F=>{F.stopPropagation(),u(C.session_id)},children:C.session_id})]})]})]}),children:[h.jsx("td",{className:"px-3 py-2 text-gray-800 dark:text-gray-200 max-w-md",children:h.jsx("span",{className:"truncate block",title:C.prompt_preview,children:C.prompt_preview||h.jsx("span",{className:"text-gray-500 italic",children:"(empty prompt)"})})}),h.jsx("td",{className:"px-3 py-2 text-gray-500 text-xs whitespace-nowrap",children:oCe(C.timestamp)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-900 dark:text-gray-100 font-medium tabular-nums",children:C[n]}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:_t(C.cost)})]},C.interaction_id)})}),h.jsx("tfoot",{className:"border-t border-gray-200 dark:border-gray-800 bg-gray-100/60 dark:bg-gray-800/40 text-xs","data-testid":`${o}-footer`,children:h.jsxs("tr",{children:[h.jsx("td",{className:"w-6 px-2 py-2","aria-hidden":"true"}),h.jsxs("td",{className:"px-3 py-2 font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wider",children:[k," ",k===1?"command":"commands",N>1?h.jsxs("span",{className:"text-gray-500 normal-case ml-2",children:["(page ",T," of ",N,")"]}):null]}),h.jsx("td",{className:"px-3 py-2"}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-500 uppercase tracking-wider",children:"median"}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-800 dark:text-gray-200 tabular-nums",children:_t(R)})]})})]})}),N>1&&h.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-800 px-3 py-2 bg-gray-100/40 dark:bg-gray-800/20 flex items-center justify-between text-xs text-gray-600 dark:text-gray-400","data-testid":`${o}-pagination`,children:[h.jsxs("span",{children:[(T-1)*S+1,"–",Math.min(T*S,k)," of ",k]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("select",{value:S,onChange:C=>{b(Number(C.target.value)),x(1)},"aria-label":"Rows per page",className:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded px-2 py-0.5 text-xs",children:[10,25,50,100].map(C=>h.jsxs("option",{value:C,children:[C,"/page"]},C))}),h.jsx("button",{type:"button",onClick:()=>x(C=>Math.max(1,C-1)),disabled:T<=1,className:"px-2 py-0.5 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Prev"}),h.jsxs("span",{children:[T,"/",N]}),h.jsx("button",{type:"button",onClick:()=>x(C=>Math.min(N,C+1)),disabled:T>=N,className:"px-2 py-0.5 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})]})}function lCe({outliers:e,onOpen:t}){const r=(e==null?void 0:e.high_tool_commands)??[],n=(e==null?void 0:e.high_step_commands)??[],a=P.useCallback(o=>{t?t(o):Dd(o)},[t]),i=P.useCallback(o=>{dd(o)},[]);return!e||r.length===0&&n.length===0?h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"outlier-commands-table",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Outlier Commands"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No outlier commands — nothing exceeded the thresholds."})]}):h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"outlier-commands-table",children:[h.jsxs("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:["Outlier Commands",h.jsx("span",{className:"ml-2 text-xs text-gray-500 font-normal",children:"tool-count > 20 · step-count > 15"})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx(n5,{title:"High tool count",icon:h.jsx(is,{size:12}),rows:r,countKey:"tool_count",countLabel:"Tools",empty:"No commands exceeded 20 tool calls.",testIdPrefix:"outlier-high-tool",onOpenInteraction:a,onOpenSession:i}),h.jsx(n5,{title:"High step count",icon:h.jsx(W5,{size:12}),rows:n,countKey:"step_count",countLabel:"Steps",empty:"No commands exceeded 15 assistant steps.",testIdPrefix:"outlier-high-step",onOpenInteraction:a,onOpenSession:i})]})]})}function uCe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:e.toLocaleString()}function cCe(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function dCe(e){return e.consecutive_failures>=3?"red":"amber"}const pCe={red:{wrapper:"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-800/60",icon:"text-red-600 dark:text-red-400",label:"text-red-700 dark:text-red-300"},amber:{wrapper:"bg-amber-50 dark:bg-amber-900/20 border-amber-300 dark:border-amber-800/60",icon:"text-amber-600 dark:text-amber-400",label:"text-amber-700 dark:text-amber-300"}},a5=[{id:"all",label:"All",predicate:()=>!0},{id:"ge2",label:"≥2 failures",predicate:e=>e.consecutive_failures>=2},{id:"ge3",label:"≥3 failures",predicate:e=>e.consecutive_failures>=3}];function fCe({signals:e}){const[t,r]=P.useState("all"),[n,a]=P.useState(1),[i,o]=P.useState(10),l=P.useMemo(()=>!e||e.length===0?[]:[...e].sort((y,x)=>x.estimated_wasted_cost-y.estimated_wasted_cost||x.consecutive_failures-y.consecutive_failures),[e]),u=P.useMemo(()=>{var x;const y=((x=a5.find(S=>S.id===t))==null?void 0:x.predicate)??(()=>!0);return l.filter(y)},[l,t]),d=P.useMemo(()=>u.reduce((y,x)=>y+(x.estimated_wasted_cost??0),0),[u]),p=Math.max(1,Math.ceil(u.length/i)),f=Math.min(n,p),m=P.useMemo(()=>u.slice((f-1)*i,f*i),[u,f,i]);return!e||e.length===0?h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"retry-alerts-panel",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Retry Alerts"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No retry storms detected — nice."})]}):h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"retry-alerts-panel",children:[h.jsxs("div",{className:"flex items-baseline justify-between mb-3 gap-2 flex-wrap",children:[h.jsxs("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300","data-testid":"retry-alerts-summary",children:[u.length," retr",u.length===1?"y":"ies"," wasted"," ",h.jsx("span",{className:"tabular-nums",children:_t(d)})," total"]}),h.jsx("div",{className:"flex items-center gap-1",role:"group","aria-label":"Severity filter","data-testid":"retry-alerts-filters",children:a5.map(y=>{const x=t===y.id;return h.jsx("button",{type:"button",onClick:()=>{r(y.id),a(1)},"aria-pressed":x,"data-testid":`retry-alerts-filter-${y.id}`,className:"text-[11px] px-2 py-0.5 rounded-full border transition-colors "+(x?"bg-indigo-500/20 border-indigo-500/60 text-indigo-200":"bg-gray-100/90 dark:bg-gray-800/80 border-gray-300 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-400 dark:hover:border-gray-600"),children:y.label},y.id)})})]}),u.length===0?h.jsx("div",{className:"text-xs text-gray-500 py-6 text-center","data-testid":"retry-alerts-empty-filtered",children:"No signals match this severity filter."}):h.jsx("div",{className:"space-y-2","data-testid":"retry-alerts-list",children:m.map((y,x)=>{const S=pCe[dCe(y)];return h.jsxs("button",{type:"button",onClick:()=>Dd(y.interaction_id),"data-testid":"retry-alerts-row",className:`w-full text-left flex items-start gap-3 p-3 rounded border transition-colors ${S.wrapper} hover:brightness-125 focus:outline-none focus:ring-2 focus:ring-indigo-500/60`,children:[h.jsx(Zi,{size:16,className:`${S.icon} mt-0.5 flex-shrink-0`}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx("span",{className:`text-sm font-medium ${S.label}`,children:y.tool}),h.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-gray-600 dark:text-gray-400 bg-gray-100/90 dark:bg-gray-800/80 border border-gray-300 dark:border-gray-700 rounded-full px-2 py-0.5",children:[h.jsx(Xa,{size:10}),y.consecutive_failures,"× failed · ",y.total_invocations," total"]}),h.jsx("span",{className:"text-[10px] text-gray-500",children:cCe(y.timestamp)})]}),h.jsxs("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 tabular-nums",children:["~",uCe(y.estimated_wasted_tokens)," wasted tokens ·"," ",_t(y.estimated_wasted_cost)," wasted cost"]})]})]},`${y.interaction_id}-${y.tool}-${x}`)})}),p>1&&h.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 dark:border-gray-800 flex items-center justify-between text-xs text-gray-600 dark:text-gray-400","data-testid":"retry-alerts-pagination",children:[h.jsxs("span",{children:[(f-1)*i+1,"–",Math.min(f*i,u.length)," of ",u.length]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("select",{value:i,onChange:y=>{o(Number(y.target.value)),a(1)},"aria-label":"Rows per page",className:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded px-2 py-0.5 text-xs",children:[10,25,50,100].map(y=>h.jsxs("option",{value:y,children:[y,"/page"]},y))}),h.jsx("button",{type:"button",onClick:()=>a(y=>Math.max(1,y-1)),disabled:f<=1,className:"px-2 py-0.5 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Prev"}),h.jsxs("span",{children:[f,"/",p]}),h.jsx("button",{type:"button",onClick:()=>a(y=>Math.min(p,y+1)),disabled:f>=p,className:"px-2 py-0.5 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}function Ef(e){if(!e)return null;const t=Date.parse(e);return Number.isNaN(t)?null:t}function hCe(e){return e==="7d"||e==="30d"||e==="all"?e:"all"}function gCe(e,t,r){if(typeof window>"u"||typeof window.history>"u")return;const n=new URL(window.location.href);e==="all"?n.searchParams.delete("range"):n.searchParams.set("range",e),t?n.searchParams.set("session",t):n.searchParams.delete("session"),r?n.searchParams.set("tool",r):n.searchParams.delete("tool");const a=`${n.pathname}${n.search}${n.hash}`,i=`${window.location.pathname}${window.location.search}${window.location.hash}`;a!==i&&window.history.replaceState({},"",a)}function mCe(e,t,r){if(e==="all")return null;const n=[];for(const o of t){const l=Ef(o.ended_at)??Ef(o.started_at);l!==null&&n.push(l)}for(const o of r){const l=Ef(o.timestamp);l!==null&&n.push(l)}return(n.length?Math.max(...n):Date.now())-(e==="7d"?7:30)*24*60*60*1e3}function I1({filter:e,onRangeChange:t,onClearSession:r,onClearTool:n}){const a=[{key:"7d",label:"Last 7 days"},{key:"30d",label:"Last 30 days"},{key:"all",label:"All time"}];return h.jsxs("div",{className:"flex flex-wrap items-center gap-3 bg-gray-100/40 dark:bg-gray-800/40 border border-gray-200 dark:border-gray-800 rounded-lg px-3 py-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-gray-500",children:[h.jsx(q5,{size:13}),h.jsx("span",{className:"text-[11px] uppercase tracking-wider",children:"Filter"})]}),h.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[h.jsx(U5,{size:12,className:"text-gray-500"}),a.map(i=>h.jsx("button",{onClick:()=>t(i.key),className:`px-2 py-0.5 rounded text-[11px] transition-colors ${e.range===i.key?"bg-indigo-500/20 text-indigo-300 border border-indigo-500/40":"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 border border-transparent"}`,children:i.label},i.key))]}),e.sessionFilter&&h.jsxs("button",{onClick:r,className:"flex items-center gap-1 text-[11px] px-2 py-0.5 rounded bg-amber-500/15 text-amber-300 border border-amber-500/30 hover:bg-amber-500/25",title:"Clear session filter",children:["Session: ",h.jsx("span",{className:"font-mono",children:e.sessionFilter.slice(0,8)}),h.jsx(Ha,{size:11})]}),e.toolFilter&&h.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-[11px] px-2 py-0.5 rounded bg-purple-500/15 text-purple-300 border border-purple-500/30 hover:bg-purple-500/25",title:"Clear tool filter",children:[h.jsx(is,{size:11})," ",e.toolFilter,h.jsx(Ha,{size:11})]})]})}function yCe(){const e="bg-gray-100/40 dark:bg-gray-800/40 rounded-lg border border-gray-200 dark:border-gray-800 animate-pulse";return h.jsxs("div",{className:"space-y-6","aria-busy":"true","aria-label":"Loading cost analytics",children:[h.jsx("div",{className:`${e} h-20`}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx("div",{className:`${e} h-40`}),h.jsx("div",{className:`${e} h-40`})]}),h.jsx("div",{className:`${e} h-64`}),h.jsx("div",{className:`${e} h-80`}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx("div",{className:`${e} h-64`}),h.jsx("div",{className:`${e} h-64`})]}),h.jsx("div",{className:`${e} h-48`}),h.jsx("div",{className:`${e} h-40`})]})}function bCe({message:e,onRetry:t}){return h.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-lg p-4 flex items-center justify-between gap-3",children:[h.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[h.jsx(Zi,{size:16,className:"text-red-600 dark:text-red-400 mt-0.5 shrink-0"}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm text-red-700 dark:text-red-300 font-medium",children:"Failed to load cost analytics"}),h.jsx("div",{className:"text-xs text-red-700/80 dark:text-red-400/80 truncate",children:e})]})]}),h.jsxs("button",{onClick:t,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded text-xs text-gray-800 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-700 shrink-0",children:[h.jsx(Xa,{size:12})," Retry"]})]})}function vCe({stats:e}){var E;const[t,r]=P.useState(null),[n,a]=P.useState(!0),[i,o]=P.useState(null),[l,u]=P.useState(()=>({range:hCe(qa("range")),sessionFilter:qa("session"),toolFilter:qa("tool")})),d=P.useCallback(async()=>{a(!0),o(null);try{const R=await fetch("/api/cost-data");if(!R.ok){const D=await R.text().catch(()=>"");throw new Error(`${R.status} ${R.statusText}${D?`: ${D}`:""}`)}const I=await R.json();r(I)}catch(R){o(R instanceof Error?R.message:String(R)),r(null)}finally{a(!1)}},[]);P.useEffect(()=>{d()},[d]),P.useEffect(()=>{gCe(l.range,l.sessionFilter,l.toolFilter)},[l.range,l.sessionFilter,l.toolFilter]),P.useEffect(()=>{const R=D=>{const C=D.detail;(C==null?void 0:C.window)==="current-week"?u(L=>({...L,range:"7d"})):(C==null?void 0:C.window)==="prior-week"&&u(L=>({...L,range:"30d"}))},I=D=>{const C=D.detail;C!=null&&C.tool&&u(L=>({...L,toolFilter:C.tool}))};return window.addEventListener("stackunderflow:filter-window",R),window.addEventListener("stackunderflow:filter-tool",I),()=>{window.removeEventListener("stackunderflow:filter-window",R),window.removeEventListener("stackunderflow:filter-tool",I)}},[]);const p=P.useMemo(()=>{if(!t)return null;const R=t.session_costs??[],I=t.command_costs??[],D=t.retry_signals??[],C=mCe(l.range,R,I),L=J=>{if(C===null)return!0;const K=Ef(J);return K===null?!0:K>=C},F=J=>!l.sessionFilter||J===l.sessionFilter,z=R.filter(J=>L(J.ended_at??J.started_at)&&F(J.session_id)),H=I.filter(J=>L(J.timestamp)&&F(J.session_id)),q=D.filter(J=>L(J.timestamp)&&F(J.session_id)&&(!l.toolFilter||J.tool===l.toolFilter)),X=l.toolFilter?t.tool_costs&&l.toolFilter in t.tool_costs?{[l.toolFilter]:t.tool_costs[l.toolFilter]}:{}:t.tool_costs??{};return{sessions:z,commands:H,retries:q,tools:X}},[t,l]),f=P.useCallback(R=>{Dd(R)},[]),m=P.useCallback(R=>{dd(R)},[]),y=R=>u(I=>({...I,range:R})),x=()=>u(R=>({...R,sessionFilter:null})),S=()=>u(R=>({...R,toolFilter:null}));if(n)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(I1,{filter:l,onRangeChange:y,onClearSession:x,onClearTool:S}),h.jsx(yCe,{})]});if(i||!t)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(I1,{filter:l,onRangeChange:y,onClearSession:x,onClearTool:S}),h.jsx(bCe,{message:i??"No data returned from /api/cost-data",onRetry:d})]});const b=t.token_composition,w=(b==null?void 0:b.totals)??((E=e==null?void 0:e.overview)!=null&&E.total_tokens?{input:e.overview.total_tokens.input??0,output:e.overview.total_tokens.output??0,cache_read:e.overview.total_tokens.cache_read??0,cache_creation:e.overview.total_tokens.cache_creation??0}:{}),_=p,k=t.trends??void 0,N=t.error_cost??void 0,T=t.outliers??void 0;return h.jsxs("div",{className:"space-y-6",children:[h.jsx(I1,{filter:l,onRangeChange:y,onClearSession:x,onClearTool:S}),h.jsx(nV,{trends:k}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx(iV,{cache:t.cache??(e==null?void 0:e.cache)??void 0}),h.jsx(FOe,{errorCost:N})]}),h.jsx(zOe,{data:_.sessions,onSelect:R=>{u(I=>({...I,sessionFilter:R})),m(R)}}),h.jsx(XOe,{data:_.commands,onOpen:f}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx(ZOe,{data:_.tools}),h.jsx(oV,{totals:w})]}),h.jsx(tCe,{daily:(b==null?void 0:b.daily)??{}}),h.jsx(lCe,{outliers:T,onOpen:f}),h.jsx(fCe,{signals:_.retries})]})}const UT="suf:beta",zT="suf:tabs",wf=!0;function xCe(){if(typeof window>"u")return wf;try{const e=window.localStorage.getItem(UT);if(e===null)return wf;const t=JSON.parse(e);if(typeof t=="boolean")return t}catch{}return wf}function SCe(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(zT);if(e===null)return{};const t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t)){const r={};for(const[n,a]of Object.entries(t))(a==="shown"||a==="hidden")&&(r[n]=a);return r}}catch{}return{}}function fV(){const[e,t]=P.useState(()=>xCe()),[r,n]=P.useState(()=>SCe());P.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(UT,JSON.stringify(e))}catch{}},[e]),P.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(zT,JSON.stringify(r))}catch{}},[r]);const a=P.useCallback(u=>{t(u)},[]),i=P.useCallback((u,d)=>{n(p=>{if(d==="default"){if(!(u in p))return p;const f={...p};return delete f[u],f}return p[u]===d?p:{...p,[u]:d}})},[]),o=P.useCallback((u,d)=>{const p=r[u];return p==="shown"?!0:p==="hidden"?!1:d?e:!0},[e,r]),l=P.useCallback(()=>{if(typeof window<"u")try{window.localStorage.removeItem(UT),window.localStorage.removeItem(zT)}catch{}t(wf),n({})},[]);return{betaEnabled:e,tabOverrides:r,setBetaEnabled:a,setTabVisibility:i,isTabVisible:o,reset:l}}const i5="bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300 text-[10px] px-1.5 py-0.5 rounded uppercase tracking-wider font-semibold";function hV({className:e}){const t=e?`${i5} ${e}`:i5;return h.jsx("span",{className:t,children:"BETA"})}const qT=[{id:"overview",label:"Overview",icon:JY},{id:"sessions",label:"Sessions",icon:WY},{id:"cost",label:"Cost",icon:Fh},{id:"commands",label:"Commands",icon:lN},{id:"messages",label:"Messages",icon:iN},{id:"search",label:"Search",icon:ha},{id:"qa",label:"Q&A",icon:ZY,beta:!0},{id:"bookmarks",label:"Bookmarks",icon:B5},{id:"tags",label:"Tags",icon:Q1,beta:!0}],ECe=qT.map(e=>e.id);function gV(e){return!!e&&ECe.includes(e)}function wCe(){const e=rV();return gV(e)?e:"overview"}function kCe(){var R,I;const{name:e}=PK(),t=Gl(),[r,n]=P.useState(wCe),[a,i]=P.useState(0),{isTabVisible:o}=fV(),l=P.useMemo(()=>qT.filter(D=>o(D.id,D.beta??!1)),[o]);P.useEffect(()=>{l.some(D=>D.id===r)||n("overview")},[l,r]);const{isLoading:u,error:d}=Jr({queryKey:["setProject",e],queryFn:()=>Z5(e),enabled:!!e,staleTime:6e4}),{data:p,isLoading:f,error:m}=Jr({queryKey:["dashboardData",e],queryFn:()=>FX(new Date().getTimezoneOffset()),enabled:!!e&&!u}),y=wc({mutationFn:()=>Q5(new Date().getTimezoneOffset()),onSuccess:()=>{t.invalidateQueries({queryKey:["dashboardData",e]})}}),x=P.useCallback(D=>{if(n(D),typeof window>"u")return;const C=new URL(window.location.href);C.searchParams.set("tab",D);const L=`${C.pathname}${C.search}${C.hash}`,F=`${window.location.pathname}${window.location.search}${window.location.hash}`;L!==F&&window.history.replaceState({},"",L)},[]),S=P.useCallback((D,C)=>{n(D),tV(D,C)},[]);P.useEffect(()=>{if(!(typeof window>"u"))return window.__suSwitchTab=S,()=>{delete window.__suSwitchTab}},[S]),P.useEffect(()=>{if(typeof window>"u")return;const D=()=>{const C=rV();gV(C)&&n(L=>L===C?L:C),i(L=>L+1)};return window.addEventListener(ns,D),window.addEventListener("popstate",D),()=>{window.removeEventListener(ns,D),window.removeEventListener("popstate",D)}},[]);const b=e?uc(e,void 0,$h()):"";if(u||f)return h.jsx(Wa,{message:`Loading ${b}...`});if(d||m){const D=d||m;return h.jsx("div",{className:"p-6",children:h.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-lg p-4 text-red-700 dark:text-red-400 text-sm",children:["Failed to load project: ",D instanceof Error?D.message:"Unknown error"]})})}if(!p)return h.jsx(ya,{title:"No data",description:"No dashboard data available"});const w=p.statistics,_=qa("q")??"",k=qa("session"),N=qa("interaction"),T=((R=qT.find(D=>D.id===r))==null?void 0:R.label)??r;let E=null;return k?E=[{label:T,onClick:()=>Ph("session")},{label:`Session · ${k}`}]:N&&(E=[{label:T,onClick:()=>Ph("interaction")},{label:`Interaction · ${N}`}]),h.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-gray-100",children:b}),((I=w==null?void 0:w.overview)==null?void 0:I.date_range)&&h.jsxs("p",{className:"text-xs text-gray-500",children:[w.overview.date_range.start," — ",w.overview.date_range.end]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[p.is_reindexing&&h.jsx("span",{className:"text-xs text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-900/20 px-2 py-1 rounded",children:"Reindexing..."}),h.jsxs("button",{onClick:()=>y.mutate(),disabled:y.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white rounded text-sm border border-gray-300 dark:border-gray-700 hover:border-gray-400 dark:hover:border-gray-600 disabled:opacity-50",children:[h.jsx(Xa,{size:14,className:y.isPending?"animate-spin":""}),"Refresh"]})]})]}),h.jsx("div",{className:"border-b border-gray-200 dark:border-gray-800",children:h.jsx("nav",{className:"flex gap-0 -mb-px overflow-x-auto","data-testid":"dashboard-tabs",children:l.map(D=>{const C=D.icon;return h.jsxs("button",{onClick:()=>x(D.id),"data-tab":D.id,className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium whitespace-nowrap border-b-2 ${r===D.id?"text-indigo-400 border-indigo-400":"text-gray-600 dark:text-gray-400 border-transparent hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-400 dark:hover:border-gray-600"}`,children:[h.jsx(C,{size:14}),D.label,D.beta===!0&&h.jsx(hV,{className:"ml-1.5"})]},D.id)})})}),E&&h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(HTe,{}),h.jsx(GTe,{trail:E})]}),h.jsxs("div",{children:[r==="overview"&&h.jsx(SNe,{stats:w}),r==="cost"&&h.jsx(vCe,{stats:w}),r==="commands"&&h.jsx(ANe,{data:p}),r==="messages"&&h.jsx(RNe,{data:p,projectName:e}),r==="search"&&h.jsx(BNe,{projectName:e,initialQuery:_}),r==="qa"&&h.jsx(GNe,{projectName:e}),r==="bookmarks"&&h.jsx(XNe,{}),r==="tags"&&h.jsx(rOe,{}),r==="sessions"&&h.jsx(LOe,{projectName:e,sessionEfficiency:w.session_efficiency})]})]})}const _Ce=[{id:"overview",label:"Overview",isBeta:!1},{id:"sessions",label:"Sessions",isBeta:!1},{id:"cost",label:"Cost",isBeta:!1},{id:"commands",label:"Commands",isBeta:!1},{id:"messages",label:"Messages",isBeta:!1},{id:"search",label:"Search",isBeta:!1},{id:"qa",label:"Q&A",isBeta:!0},{id:"tags",label:"Tags",isBeta:!0},{id:"bookmarks",label:"Bookmarks",isBeta:!1}];function ACe(){const{theme:e,toggle:t}=t6(),{betaEnabled:r,tabOverrides:n,setBetaEnabled:a,setTabVisibility:i,reset:o}=fV(),l=()=>{o(),typeof window<"u"&&window.location.reload()},u=e==="dark"?K5:H5;return h.jsxs("div",{className:"max-w-3xl mx-auto p-6 space-y-8",children:[h.jsx("div",{children:h.jsxs(ic,{to:"/",className:"inline-flex items-center gap-1.5 text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100",children:[h.jsx(vd,{size:16}),"Back to Overview"]})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Settings"}),h.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Customize appearance and which dashboard tabs are visible."})]}),h.jsxs("section",{className:"bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 p-5",children:[h.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Appearance"}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Switch between dark and light mode. Persists across reloads."}),h.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(u,{size:18,className:"text-gray-600 dark:text-gray-400"}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Theme"}),h.jsxs("div",{className:"text-xs text-gray-500",children:["Current: ",h.jsx("span",{className:"font-mono",children:e})]})]})]}),h.jsxs("button",{onClick:t,className:"px-3 py-1.5 text-sm rounded border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200 hover:border-gray-400 dark:hover:border-gray-600",children:["Switch to ",e==="dark"?"light":"dark"]})]})]}),h.jsxs("section",{className:"bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 p-5",children:[h.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Beta features"}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Heuristic features that may not be fully reliable yet. Turn this off to hide BETA-tagged tabs on project dashboards."}),h.jsxs("label",{className:"mt-4 flex items-center justify-between cursor-pointer",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Show beta features"}),h.jsx("div",{className:"text-xs text-gray-500",children:r?"Beta tabs are visible by default.":"Beta tabs are hidden by default."})]}),h.jsx("input",{type:"checkbox",checked:r,onChange:d=>a(d.target.checked),className:"h-4 w-4 accent-indigo-600","aria-label":"Show beta features"})]})]}),h.jsxs("section",{className:"bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 p-5",children:[h.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Tab visibility"}),h.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[h.jsx("span",{className:"font-medium",children:"Default"})," follows the beta toggle for BETA tabs (shown if the toggle is on) and always shows stable tabs."," ",h.jsx("span",{className:"font-medium",children:"Shown"})," and"," ",h.jsx("span",{className:"font-medium",children:"Hidden"})," override that."]}),h.jsx("div",{className:"mt-4 divide-y divide-gray-200 dark:divide-gray-800",children:_Ce.map(d=>{const p=n[d.id]??"default";return h.jsxs("div",{className:"flex items-center justify-between py-2.5 first:pt-0 last:pb-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm text-gray-900 dark:text-gray-100",children:d.label}),d.isBeta&&h.jsx(hV,{})]}),h.jsxs("select",{value:p,onChange:f=>i(d.id,f.target.value),className:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded px-2 py-1 text-xs text-gray-700 dark:text-gray-300 focus:outline-none focus:border-indigo-500","aria-label":`Visibility for ${d.label} tab`,children:[h.jsx("option",{value:"default",children:"Default"}),h.jsx("option",{value:"shown",children:"Shown"}),h.jsx("option",{value:"hidden",children:"Hidden"})]})]},d.id)})})]}),h.jsxs("section",{className:"bg-white dark:bg-gray-900 rounded-lg border border-red-200 dark:border-red-900/50 p-5",children:[h.jsx("h2",{className:"text-base font-semibold text-red-700 dark:text-red-400",children:"Danger zone"}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Clears beta toggle and tab overrides, then reloads the page. Your theme, bookmarks, and project data are not touched."}),h.jsx("button",{onClick:l,className:"mt-4 px-3 py-1.5 text-sm rounded border border-red-300 dark:border-red-800 text-red-700 dark:text-red-400 bg-white dark:bg-gray-900 hover:bg-red-50 dark:hover:bg-red-900/20",children:"Reset all settings to defaults"})]})]})}function TCe(){const[e,t]=P.useState(!1);return h.jsxs("div",{className:"h-screen w-screen bg-white dark:bg-gray-950 flex flex-col",children:[h.jsx(aZ,{onToggleChat:()=>t(r=>!r),chatOpen:e}),h.jsx("main",{className:"flex-1 overflow-auto",children:h.jsxs(ZK,{children:[h.jsx(yf,{path:"/",element:h.jsx(qTe,{})}),h.jsx(yf,{path:"/project/:name",element:h.jsx(kCe,{})}),h.jsx(yf,{path:"/settings",element:h.jsx(ACe,{})})]})}),h.jsx(Ade,{open:e,onClose:()=>t(!1)})]})}function NCe(){return h.jsx(aY,{children:h.jsx(TCe,{})})}class OCe extends P.Component{constructor(r){super(r);TI(this,"handleReset",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){console.error("ErrorBoundary caught:",r,n)}render(){var r;return this.state.hasError?this.props.fallback?this.props.fallback:h.jsx("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:h.jsxs("div",{className:"rounded-lg border border-red-300 dark:border-red-800 bg-red-100 dark:bg-red-900/30 p-4 max-w-md",children:[h.jsx("h3",{className:"text-red-700 dark:text-red-400 font-semibold text-sm mb-1",children:"Something went wrong"}),h.jsx("p",{className:"text-red-700/80 dark:text-red-300/70 text-xs mb-3",children:((r=this.state.error)==null?void 0:r.message)||"An unexpected error occurred"}),h.jsx("button",{onClick:this.handleReset,className:"px-3 py-1.5 text-xs font-medium rounded bg-red-600 dark:bg-red-800 text-white dark:text-red-200 hover:bg-red-700 dark:hover:bg-red-700 transition-colors",children:"Try again"})]})}):this.props.children}}(function(){try{(window.localStorage.getItem("suf:theme")==="light"?"light":"dark")==="light"?document.documentElement.classList.remove("dark"):document.documentElement.classList.add("dark")}catch{document.documentElement.classList.add("dark")}})();const CCe=new W7({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}}});E7.createRoot(document.getElementById("root")).render(h.jsx(U.StrictMode,{children:h.jsx(V7,{client:CCe,children:h.jsx(OCe,{children:h.jsx(NCe,{})})})})); +`)}return""}function wOe(e){return typeof e.timestamp=="string"?e.timestamp:null}function kOe(e){const t=e.message,r=t==null?void 0:t.model;return r&&r!=="N/A"?r.replace("claude-","").replace(/-\d{8,}$/,""):null}function _Oe(e){const t=e.message,r=t==null?void 0:t.usage;if(!r)return null;const n=r.input_tokens??0,a=r.output_tokens??0;return n||a?{input:n,output:a}:null}function AOe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function TOe(e){return e>=100?`$${e.toFixed(0)}`:e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(2)}`:`$${e.toFixed(4)}`}function NOe(e){return e?e.replace("claude-","").replace(/-\d{8,}$/,""):""}function OOe({file:e,selected:t,onClick:r,compareMode:n=!1,checked:a=!1,checkboxDisabled:i=!1,onCheckToggle:o,highlighted:l=!1,rowRef:u,sessionId:d}){const f=(e.modified-e.created)/60,m=(e.input_tokens??0)+(e.output_tokens??0),y="w-full text-left rounded-lg border transition-colors p-4 flex items-start gap-3",x=t?"bg-white dark:bg-gray-800 border-indigo-500/50":a?"bg-indigo-950/30 border-indigo-500/60":"bg-gray-50/40 dark:bg-gray-900/40 border-gray-200 dark:border-gray-800 hover:border-gray-200 dark:hover:border-gray-700 hover:bg-gray-50/70 dark:hover:bg-gray-900/70",S=l?" ring-2 ring-indigo-400/70 animate-pulse":"",b=()=>{if(n){(!i||a)&&(o==null||o());return}r()},w=h.jsxs(h.Fragment,{children:[n&&h.jsx("div",{className:"pt-0.5 shrink-0",children:h.jsx("input",{type:"checkbox",checked:a,disabled:i&&!a,onChange:_=>{_.stopPropagation(),o==null||o()},onClick:_=>_.stopPropagation(),"aria-label":`Select session ${d} to compare`,"data-testid":`session-compare-checkbox-${d}`,className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-900 text-indigo-500 focus:ring-indigo-500 disabled:opacity-40"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3 mb-1.5",children:[h.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[e.title?h.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 line-clamp-2",children:e.title}):h.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono",children:e.name.split(".")[0]}),e.is_subagent&&h.jsx("span",{className:"shrink-0 text-[10px] font-medium text-purple-400 bg-purple-500/15 border border-purple-500/30 px-1.5 py-0.5 rounded",children:"Sub-agent"})]}),h.jsx("span",{className:"text-xs text-gray-500 shrink-0",children:vOe(e.modified)})]}),h.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-500 flex-wrap",children:[h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(z5,{size:11}),$T(f>.5?f:null)]}),e.messages!=null&&h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(oN,{size:11}),e.messages," msgs"]}),e.user_messages!=null&&h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(Ac,{size:11,className:"text-blue-400/70"}),e.user_messages," prompts"]}),e.tool_calls!=null&&e.tool_calls>0&&h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(is,{size:11,className:"text-purple-400/70"}),e.tool_calls," tools"]}),m>0&&h.jsxs("span",{children:[AOe(m)," tokens"]}),e.estimated_cost!=null&&e.estimated_cost>0&&h.jsx("span",{className:"text-emerald-400/80 font-medium",children:TOe(e.estimated_cost)}),e.model&&h.jsx("span",{className:"text-gray-600 dark:text-gray-400 bg-white dark:bg-gray-800 px-1.5 py-0.5 rounded text-[10px]",children:NOe(e.model)}),h.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:yOe(e.size)})]}),h.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-gray-600 dark:text-gray-400 mt-1.5",children:[h.jsxs("span",{children:["Created ",zl(e.created)]}),h.jsxs("span",{children:["Modified ",zl(e.modified)]})]})]})]});return n?h.jsx("div",{ref:u,role:"button",tabIndex:0,"data-session-id":d,"data-testid":`session-row-${d}`,onClick:b,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),b())},className:`${y} ${x}${S} ${i&&!a?"cursor-not-allowed opacity-60":"cursor-pointer"}`,children:w}):h.jsx("div",{ref:u,"data-session-id":d,"data-testid":`session-row-${d}`,className:S?`rounded-lg${S}`:void 0,children:h.jsx("button",{onClick:b,className:`${y} ${x}`,children:w})})}function COe({line:e,index:t,showRaw:r,isSidechain:n=!1,isFirstInSidechainGroup:a=!1}){const[i,o]=P.useState(!1),[l,u]=P.useState(!1),d=uV(e),p=cV(e),f=wOe(e),m=kOe(e),y=_Oe(e),x=Zq[d]??Zq.assistant,S=x.icon;if(!p&&!r)return null;const b=p.length>500,w=i||!b?p:p.slice(0,500)+"...",_=k=>n?h.jsxs("div",{className:"ml-6 border-l-2 border-purple-500/30 pl-3",children:[a&&h.jsx("div",{className:"text-[10px] font-medium text-purple-400/70 mb-1",children:"Sub-agent"}),k]}):h.jsx(h.Fragment,{children:k});return _(r?h.jsxs("div",{className:"border border-gray-200 dark:border-gray-800 rounded-lg p-3 bg-gray-50/30 dark:bg-gray-900/30",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsxs("span",{className:"text-[10px] text-gray-500 font-mono",children:["#",t+1]}),h.jsx("span",{className:`text-xs font-medium ${x.color}`,children:x.label}),f&&h.jsx("span",{className:"text-[10px] text-gray-500",children:zl(f)})]}),h.jsx("pre",{className:"text-[11px] text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap font-mono bg-gray-50/50 dark:bg-gray-950/50 rounded p-2 max-h-96 overflow-y-auto",children:JSON.stringify(e,null,2)})]}):h.jsxs("div",{className:`rounded-lg border border-gray-200/50 dark:border-gray-800/50 ${x.bg}`,children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-100/30 dark:border-gray-800/30",children:[h.jsx(S,{size:14,className:x.color}),h.jsx("span",{className:`text-xs font-medium ${x.color}`,children:x.label}),m&&h.jsx("span",{className:"text-[10px] text-gray-500 bg-white dark:bg-gray-800 px-1.5 py-0.5 rounded",children:m}),y&&h.jsxs("span",{className:"text-[10px] text-gray-600 dark:text-gray-400",children:[y.input.toLocaleString()," in / ",y.output.toLocaleString()," out"]}),h.jsx("span",{className:"flex-1"}),f&&h.jsx("span",{className:"text-[10px] text-gray-600 dark:text-gray-400",children:zl(f)}),h.jsx("button",{type:"button",onClick:()=>u(k=>!k),"aria-pressed":l,"aria-label":l?"Hide raw JSON":"View raw JSON",title:l?"Hide raw JSON":"View raw JSON",className:`text-[10px] px-1.5 py-0.5 rounded border transition-colors ${l?"bg-amber-100 text-amber-800 border-amber-300 dark:bg-amber-900/40 dark:text-amber-300 dark:border-amber-800":"bg-white dark:bg-gray-800 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-700 hover:text-gray-800 dark:hover:text-gray-200"}`,children:l?"Hide JSON":"JSON"})]}),h.jsxs("div",{className:"px-4 py-3",children:[h.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 whitespace-pre-wrap break-words",children:h.jsx(MN,{content:w})}),b&&!i&&h.jsx("button",{onClick:()=>o(!0),className:"text-xs text-indigo-400 hover:text-indigo-300 mt-2",children:"Show more..."}),b&&i&&h.jsx("button",{onClick:()=>o(!1),className:"text-xs text-indigo-400 hover:text-indigo-300 mt-2",children:"Show less"}),l&&h.jsx("pre",{className:"mt-3 text-[11px] text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap font-mono bg-gray-50/70 dark:bg-gray-950/60 rounded p-2 max-h-96 overflow-y-auto border border-gray-200 dark:border-gray-800",children:JSON.stringify(e,null,2)})]})]}))}function ROe({data:e,onBack:t}){const[r,n]=P.useState(!1),[a,i]=P.useState("all"),[o,l]=P.useState(""),[u,d]=P.useState(0),p=P.useMemo(()=>{let b=e.lines.filter(w=>!SOe(w));if(a==="hide_subagent"?b=b.filter(w=>w.isSidechain!==!0):a!=="all"&&(b=b.filter(w=>uV(w)===a)),o.trim()){const w=o.toLowerCase();b=b.filter(_=>cV(_).toLowerCase().includes(w))}return b},[e.lines,a,o]),f=Math.max(1,Math.ceil(p.length/rc)),m=Math.min(u,f-1),y=p.slice(m*rc,(m+1)*rc),x=P.useMemo(()=>{const b=new Map;return e.lines.forEach((w,_)=>b.set(w,_)),b},[e.lines]),S=e.metadata;return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[h.jsxs("button",{onClick:t,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700",children:[h.jsx(vd,{size:14}),"Sessions"]}),h.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500",children:[h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(oN,{size:12})," ",e.total_lines," messages"]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(Ac,{size:12,className:"text-blue-400"})," ",e.user_count]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(sN,{size:12,className:"text-emerald-400"})," ",e.assistant_count]}),S.duration_minutes&&h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(z5,{size:12})," ",$T(S.duration_minutes)]})]}),h.jsx("span",{className:"flex-1"}),h.jsxs("button",{onClick:()=>n(!r),className:`flex items-center gap-1.5 px-2.5 py-1 text-xs rounded border transition-colors ${r?"bg-amber-600/20 border-amber-600/50 text-amber-400":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"}`,children:[r?h.jsx(aN,{size:13}):h.jsx(qY,{size:13}),r?"Raw JSON":"Formatted"]})]}),h.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 p-3 bg-gray-50/60 dark:bg-gray-900/60 border border-gray-200 dark:border-gray-800 rounded-lg text-xs",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500 block mb-0.5",children:"Started"}),h.jsx("span",{className:"text-gray-800 dark:text-gray-200",children:zl(S.first_timestamp??S.created)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500 block mb-0.5",children:"Ended"}),h.jsx("span",{className:"text-gray-800 dark:text-gray-200",children:zl(S.last_timestamp??S.modified)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500 block mb-0.5",children:"Duration"}),h.jsx("span",{className:"text-gray-800 dark:text-gray-200",children:$T(S.duration_minutes)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500 block mb-0.5",children:"Working Dir"}),h.jsx("span",{className:"text-gray-800 dark:text-gray-200 font-mono text-[10px] truncate block",children:S.cwd})]})]}),h.jsxs("div",{className:"flex gap-2 flex-wrap",children:[h.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[h.jsx(ha,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-500"}),h.jsx("input",{type:"text",value:o,onChange:b=>{l(b.target.value),d(0)},placeholder:"Search in conversation...",className:"w-full pl-8 pr-3 py-1.5 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded text-xs text-gray-800 dark:text-gray-200 placeholder-gray-500 focus:outline-none focus:border-indigo-500"})]}),h.jsxs("select",{value:a,onChange:b=>{i(b.target.value),d(0)},className:"px-3 py-1.5 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded text-xs text-gray-700 dark:text-gray-300 focus:outline-none",children:[h.jsx("option",{value:"all",children:"Conversation"}),h.jsx("option",{value:"human",children:"Your prompts"}),h.jsx("option",{value:"assistant",children:"Claude responses"}),h.jsx("option",{value:"tool_result",children:"Tool results"}),h.jsx("option",{value:"hide_subagent",children:"Hide sub-agents"})]})]}),p.length===0?h.jsx(ya,{title:"No messages",description:"No messages match your filters."}):h.jsx("div",{className:"space-y-2",children:y.map((b,w)=>{const _=b.isSidechain===!0,k=w>0?y[w-1]:void 0,N=_&&(!k||k.isSidechain!==!0);return h.jsx(COe,{line:b,index:x.get(b)??w,showRaw:r,isSidechain:_,isFirstInSidechainGroup:N},x.get(b)??w)})}),f>1&&h.jsxs("div",{className:"flex items-center justify-between pt-1",children:[h.jsxs("span",{className:"text-xs text-gray-500",children:[m*rc+1,"–",Math.min((m+1)*rc,p.length)," of ",p.length]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:()=>d(b=>Math.max(0,b-1)),disabled:m===0,className:"p-1 rounded bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 disabled:opacity-40",children:h.jsx(nN,{size:14})}),h.jsxs("span",{className:"px-2 text-xs text-gray-600 dark:text-gray-400",children:[m+1,"/",f]}),h.jsx("button",{onClick:()=>d(b=>Math.min(f-1,b+1)),disabled:m>=f-1,className:"p-1 rounded bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 disabled:opacity-40",children:h.jsx(to,{size:14})})]})]})]})}function IOe(e){return e.replace(/\.jsonl$/i,"")}function LOe({projectName:e,sessionEfficiency:t}){var D;const[r,n]=P.useState(null),[a,i]=P.useState("modified"),[o,l]=P.useState(!1),[u,d]=P.useState([]),[p,f]=P.useState(null),m=P.useRef(new Map),y=Jr({queryKey:["jsonlFiles",e],queryFn:()=>BX(e)}),x=Jr({queryKey:["jsonlContent",r,e],queryFn:()=>UX(r,e),enabled:!!r}),b=((D=Jr({queryKey:["setProject",e],queryFn:()=>Z5(e),enabled:!!e,staleTime:6e4}).data)==null?void 0:D.log_path)??"",w=P.useCallback(C=>{C&&(f(C),requestAnimationFrame(()=>{const L=m.current.get(C);L&&L.scrollIntoView({behavior:"smooth",block:"center"})}),window.setTimeout(()=>{f(L=>L===C?null:L)},2e3))},[]);P.useEffect(()=>{const C=qa("session");C&&(w(C),Ph("session"))},[w]),P.useEffect(()=>{const C=()=>{const L=qa("session");L&&(w(L),Ph("session"))};return window.addEventListener("popstate",C),()=>window.removeEventListener("popstate",C)},[w]),P.useEffect(()=>{const C=L=>{const F=L.detail;F&&F.tab==="sessions"&&typeof F.session=="string"&&w(F.session)};return window.addEventListener(ns,C),()=>window.removeEventListener(ns,C)},[w]);const _=P.useCallback(C=>{d(L=>L.includes(C)?L.filter(F=>F!==C):L.length>=2?L:[...L,C])},[]),k=P.useCallback(()=>d([]),[]);if(y.isLoading)return h.jsx(Wa,{message:"Loading sessions..."});if(y.isError)return h.jsx("div",{className:"text-red-400 p-4",children:"Failed to load sessions"});const N=y.data;if(r){if(x.isLoading)return h.jsx(Wa,{message:"Loading conversation..."});if(x.isError)return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("button",{onClick:()=>n(null),className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700",children:[h.jsx(vd,{size:14})," Back"]}),h.jsx("div",{className:"text-red-400 p-4",children:"Failed to load conversation"})]});if(x.data)return h.jsx(ROe,{data:x.data,onBack:()=>n(null)})}if(N.length===0)return h.jsx(ya,{title:"No sessions",description:"No session files found."});const T=[...N].sort((C,L)=>a==="size"?L.size-C.size:a==="created"?L.created-C.created:L.modified-C.modified),E=u.length===2,[R,I]=u;return h.jsxs("div",{className:"space-y-4","data-testid":"sessions-tab",children:[h.jsx(lOe,{data:t??[]}),o&&E&&R&&I&&h.jsx(mOe,{logPath:b,sessionAId:R,sessionBId:I,onClose:k}),h.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[h.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[h.jsx(xd,{size:14}),h.jsxs("span",{children:[h.jsx("span",{className:"text-gray-900 dark:text-gray-100 font-medium",children:N.length})," sessions"]}),o&&h.jsxs("span",{className:"text-xs text-indigo-400",children:["· ",u.length,"/2 selected"]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsxs("button",{type:"button",onClick:()=>{l(C=>{const L=!C;return L||d([]),L})},"aria-pressed":o,"data-testid":"sessions-compare-toggle",className:`flex items-center gap-1.5 px-2.5 py-1 rounded border transition-colors ${o?"bg-indigo-600/20 border-indigo-500/60 text-indigo-300":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"}`,children:[h.jsx(X1,{size:13}),"Compare"]}),h.jsx("div",{className:"flex items-center gap-1",children:["modified","created","size"].map(C=>h.jsx("button",{onClick:()=>i(C),className:`px-2 py-1 rounded ${a===C?"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200":"text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"}`,children:C==="modified"?"Recent":C==="created"?"Oldest":"Size"},C))})]})]}),h.jsx("div",{className:"space-y-1.5",children:T.map(C=>{const L=IOe(C.name),F=u.includes(L);return h.jsx(OOe,{file:C,sessionId:L,selected:r===C.name,onClick:()=>n(C.name),compareMode:o,checked:F,checkboxDisabled:u.length>=2,onCheckToggle:()=>_(L),highlighted:p===L,rowRef:z=>{z?m.current.set(L,z):m.current.delete(L)}},C.name)})})]})}const Qq=6;function DOe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function POe(e,t=64){return e?e.length>t?`${e.slice(0,t-1).trimEnd()}…`:e:""}function jOe({rows:e,maxCount:t,scrollable:r=!1}){const n=r?"space-y-1.5 max-h-[300px] overflow-y-auto pr-1":"space-y-1.5";return h.jsx("div",{className:n,children:e.map(([a,i])=>{const o=t>0?i/t*100:0;return h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsx("span",{className:"w-24 text-gray-700 dark:text-gray-300 truncate",title:a,children:a}),h.jsx("div",{className:"flex-1 h-1.5 bg-white dark:bg-gray-800 rounded-full overflow-hidden",children:h.jsx("div",{className:"h-full bg-red-500/70",style:{width:`${o}%`}})}),h.jsx("span",{className:"text-gray-600 dark:text-gray-400 tabular-nums w-10 text-right",children:i})]},a)})})}function MOe({cmd:e}){const t=e.tool_count??0,r=e.cost??0;return h.jsxs("button",{type:"button",onClick:()=>Dd(e.interaction_id),className:"w-full flex items-start gap-2 px-2 py-1.5 rounded hover:bg-red-100 dark:hover:bg-red-900/20 focus:outline-none focus:bg-red-100 dark:focus:bg-red-900/20 text-left transition-colors group",title:"Open in Messages",children:[h.jsx(UY,{size:12,className:"text-gray-500 group-hover:text-red-300 mt-1 flex-shrink-0","aria-hidden":"true"}),h.jsx("span",{className:"flex-1 text-xs text-gray-700 dark:text-gray-300 truncate",title:e.prompt_preview??"",children:POe(e.prompt_preview??"(no prompt)",72)}),h.jsxs("span",{className:"text-[10px] text-red-700 dark:text-red-300 tabular-nums whitespace-nowrap",children:[t," err"]}),h.jsx("span",{className:"text-[10px] text-gray-600 dark:text-gray-400 tabular-nums whitespace-nowrap w-14 text-right",children:_t(r)})]})}function FOe({errorCost:e}){const[t,r]=P.useState(!1),[n,a]=P.useState(!1);if(!e||e.total_errors===0)return h.jsxs("div",{className:"bg-gradient-to-br from-red-900/20 to-gray-50/50 dark:to-gray-900/30 rounded-lg p-6 border border-red-900/30",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[h.jsx(Zi,{size:18,className:"text-red-400"}),h.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400 uppercase tracking-wider",children:"Error Cost"})]}),h.jsx("div",{className:"text-gray-500 text-sm",children:"No errors recorded."})]});const i=e.total_errors??0,o=e.estimated_retry_cost??0,l=e.estimated_retry_tokens??0,u=Object.entries(e.errors_by_tool??{}).filter(([,b])=>b>0).sort((b,w)=>w[1]-b[1]),d=u.slice(0,Qq),p=Math.max(0,u.length-Qq),f=u.length>0?Math.max(...u.map(([,b])=>b)):0,m=u.length,y=e.top_error_commands??[],x=y.slice(0,3),S=Math.max(0,y.length-3);return h.jsxs("div",{className:"bg-gradient-to-br from-red-900/30 to-gray-50/60 dark:to-gray-900/40 rounded-lg p-6 border border-red-900/40",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[h.jsx(Zi,{size:18,className:"text-red-400"}),h.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400 uppercase tracking-wider",children:"Error Cost"})]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-4xl font-bold text-red-700 dark:text-red-300 leading-none tabular-nums",children:_t(o)}),h.jsxs("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-2",children:["wasted on"," ",h.jsx("span",{className:"text-red-700 dark:text-red-200 font-medium",children:i.toLocaleString()})," error",i===1?"":"s"," across"," ",h.jsx("span",{className:"text-red-700 dark:text-red-200 font-medium",children:m})," tool",m===1?"":"s"]}),h.jsxs("div",{className:"text-[10px] text-gray-500 mt-1 tabular-nums",children:["≈ ",DOe(l)," retry tokens"]})]}),u.length>0&&h.jsxs("div",{className:"mt-5 pt-4 border-t border-red-900/30",children:[h.jsx("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-2",children:"Errors by tool"}),h.jsx(jOe,{rows:t?u:d,maxCount:f,scrollable:t}),(p>0||t)&&h.jsx("button",{type:"button",onClick:()=>r(b=>!b),className:"mt-2 inline-flex items-center gap-1 text-[11px] text-red-700/80 dark:text-red-300/80 hover:text-red-800 dark:hover:text-red-200 focus:outline-none","aria-expanded":t,children:t?h.jsxs(h.Fragment,{children:[h.jsx(Tf,{size:12,"aria-hidden":"true"}),"Show fewer"]}):h.jsxs(h.Fragment,{children:[h.jsx(Xo,{size:12,"aria-hidden":"true"}),"Show all ",u.length," tools"]})})]}),y.length>0&&h.jsxs("div",{className:"mt-5 pt-4 border-t border-red-900/30",children:[h.jsx("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-2",children:"Top error commands"}),h.jsx("div",{className:"space-y-0.5",children:(n?y:x).map(b=>h.jsx(MOe,{cmd:b},b.interaction_id))}),(S>0||n)&&h.jsx("button",{type:"button",onClick:()=>a(b=>!b),className:"mt-2 inline-flex items-center gap-1 text-[11px] text-red-700/80 dark:text-red-300/80 hover:text-red-800 dark:hover:text-red-200 focus:outline-none","aria-expanded":n,children:n?h.jsxs(h.Fragment,{children:[h.jsx(Tf,{size:12,"aria-hidden":"true"}),"Show fewer"]}):h.jsxs(h.Fragment,{children:[h.jsx(Xo,{size:12,"aria-hidden":"true"}),"Show all ",y.length," commands"]})})]})]})}const Jq=["#818CF8","#34D399","#F59E0B","#F87171","#A78BFA","#38BDF8","#FB923C","#E879F9","#2DD4BF","#FCD34D"];function $Oe(e){return e.length>8?e.slice(0,8):e}function BOe(e){if(!Number.isFinite(e)||e<0)return"0:00:00";const t=Math.floor(e),r=Math.floor(t/3600),n=Math.floor(t%3600/60),a=t%60;return`${r}:${n.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`}function gf(e){return Number.isFinite(e)?e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString():"0"}function UOe({active:e,payload:t}){var p;if(!e||!t||t.length===0)return null;const r=(p=t[0])==null?void 0:p.payload;if(!r)return null;const n=r.tokens??{},a=Number(n.input??0),i=Number(n.output??0),o=Number(n.cache_read??0),l=Number(n.cache_creation??0),u=r.preview||"",d=u.length>140?u.slice(0,140)+"…":u;return h.jsxs("div",{style:{backgroundColor:"#1F2937",border:"1px solid #374151",borderRadius:"6px",fontSize:"12px",maxWidth:360,padding:"8px 10px",color:"#D1D5DB"},children:[h.jsx("div",{style:{fontFamily:"monospace",color:"#F3F4F6",marginBottom:4},children:r.short_id}),d&&h.jsx("div",{style:{color:"#9CA3AF",marginBottom:6,fontStyle:"italic"},children:d}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[h.jsx("span",{style:{color:"#9CA3AF"},children:"Cost"}),h.jsx("span",{style:{color:"#F3F4F6",fontWeight:600},children:_t(r.cost)})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[h.jsx("span",{style:{color:"#9CA3AF"},children:"Duration"}),h.jsx("span",{style:{color:"#F3F4F6"},children:BOe(r.duration_s)})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[h.jsx("span",{style:{color:"#9CA3AF"},children:"Commands"}),h.jsx("span",{style:{color:"#F3F4F6"},children:r.commands.toLocaleString()})]}),r.errors>0&&h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[h.jsx("span",{style:{color:"#9CA3AF"},children:"Errors"}),h.jsx("span",{style:{color:"#F87171"},children:r.errors.toLocaleString()})]}),h.jsxs("div",{style:{borderTop:"1px solid #374151",marginTop:6,paddingTop:6,color:"#9CA3AF"},children:[h.jsx("div",{style:{fontSize:"11px",marginBottom:2,color:"#6B7280"},children:"Tokens"}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[h.jsx("span",{children:"Input"}),h.jsx("span",{style:{color:"#D1D5DB"},children:gf(a)})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[h.jsx("span",{children:"Output"}),h.jsx("span",{style:{color:"#D1D5DB"},children:gf(i)})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[h.jsx("span",{children:"Cache read"}),h.jsx("span",{style:{color:"#D1D5DB"},children:gf(o)})]}),h.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[h.jsx("span",{children:"Cache creation"}),h.jsx("span",{style:{color:"#D1D5DB"},children:gf(l)})]})]}),r.models_used&&r.models_used.length>0&&h.jsxs("div",{style:{borderTop:"1px solid #374151",marginTop:6,paddingTop:6,color:"#9CA3AF"},children:[h.jsx("div",{style:{fontSize:"11px",marginBottom:2,color:"#6B7280"},children:"Models"}),h.jsx("div",{style:{color:"#D1D5DB",fontFamily:"monospace",fontSize:"11px",whiteSpace:"normal",wordBreak:"break-word"},children:r.models_used.join(", ")})]})]})}function zOe({data:e,onSelect:t}){if(!e||e.length===0)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Top Sessions by Cost"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No session cost data yet"})]});const r=[...e].sort((o,l)=>l.cost-o.cost).slice(0,10).map(o=>{const l=$Oe(o.session_id),u=(o.first_prompt_preview??"").replace(/\s+/g," ").trim(),d=u.length>36?u.slice(0,36)+"…":u;return{session_id:o.session_id,short_id:l,label:d?`${l} · ${d}`:l,cost:o.cost,commands:o.commands,errors:o.errors,messages:o.messages,duration_s:o.duration_s,models_used:o.models_used??[],tokens:o.tokens??{},preview:o.first_prompt_preview}}),a=r.reduce((o,l)=>l.cost>o?l.cost:o,0)*.1,i=o=>{const l=o==null?void 0:o.session_id;if(l){if(t){t(l);return}dd(l)}};return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[h.jsxs("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:["Top Sessions by Cost",h.jsxs("span",{className:"ml-2 text-xs text-gray-500 font-normal",children:["top ",r.length]})]}),h.jsx(pr,{width:"100%",height:Math.max(260,r.length*32),children:h.jsxs(ni,{data:r,layout:"vertical",margin:{left:10,right:20},children:[h.jsx(Br,{strokeDasharray:"3 3",stroke:"#374151",horizontal:!1}),h.jsx(Vt,{type:"number",tick:{fontSize:10,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"},tickFormatter:_t}),h.jsx(Rt,{type:"category",dataKey:"label",tick:{fontSize:11,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"},width:320,interval:0}),h.jsx(ut,{content:h.jsx(UOe,{}),cursor:{fill:"rgba(75, 85, 99, 0.15)"}}),h.jsxs(At,{dataKey:"cost",radius:[0,4,4,0],cursor:"pointer",onClick:i,children:[r.map((o,l)=>h.jsx(yn,{fill:Jq[l%Jq.length]},l)),h.jsx(mn,{dataKey:"cost",position:"insideRight",fill:"#F9FAFB",fontSize:10,fontWeight:600,formatter:o=>{const l=typeof o=="number"?o:Number(o);return!Number.isFinite(l)||l<=a?"":_t(l)}})]})]})})]})}const qOe={cost:"cost",tokens:"tokens",tools:"tools",steps:"steps",when:"when"};function dV(e){return e?(e.input??0)+(e.output??0)+(e.cache_read??0)+(e.cache_creation??0):0}function GOe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function pV(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function e5(e,t){switch(t){case"cost":return e.cost??0;case"tokens":return dV(e.tokens);case"tools":return e.tools_used??0;case"steps":return e.steps??0;case"when":return e.timestamp??""}}function HOe(e,t,r){const n=e===""||e==null,a=t===""||t==null;if(n&&a)return 0;if(n)return 1;if(a)return-1;if(typeof e=="number"&&typeof t=="number")return r==="asc"?e-t:t-e;const i=String(e),o=String(t);return r==="asc"?i.localeCompare(o):o.localeCompare(i)}function WOe(e){if(e.length===0)return 0;const t=[...e].sort((n,a)=>n-a),r=Math.floor(t.length/2);return t.length%2===0?((t[r-1]??0)+(t[r]??0))/2:t[r]??0}function VOe(e,t){if(e.length===0)return 0;const r=[...e].sort((i,o)=>i-o),n=Math.ceil(t/100*r.length),a=Math.min(Math.max(n-1,0),r.length-1);return r[a]??0}function KOe(e,t,r){const[n,a]=P.useState(t),[i,o]=P.useState(r),l=P.useMemo(()=>{const d=[...e];return d.sort((p,f)=>HOe(e5(p,n),e5(f,n),i)),d},[e,n,i]),u=P.useCallback(d=>{a(p=>p===d?(o(f=>f==="asc"?"desc":"asc"),p):(o("desc"),d))},[]);return{sorted:l,sortKey:n,sortDir:i,setSort:u}}function nc({label:e,sortKey:t,activeKey:r,dir:n,onSort:a,align:i="right",className:o}){const l=t===r;return h.jsx("th",{scope:"col",className:`px-3 py-2 cursor-pointer select-none hover:text-gray-800 dark:hover:text-gray-200 ${i==="right"?"text-right":"text-left"} ${o??""}`,onClick:()=>a(t),"aria-sort":l?n==="asc"?"ascending":"descending":"none","data-testid":`ccl-sort-${t}`,children:h.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[e,l&&(n==="asc"?h.jsx(rN,{size:11,className:"inline"}):h.jsx(tN,{size:11,className:"inline"}))]})})}function YOe({row:e,colSpan:t}){return h.jsx("tr",{className:"border-b border-gray-200/50 dark:border-gray-800/50 bg-gray-50/60 dark:bg-gray-900/40","data-testid":"ccl-expanded",children:h.jsx("td",{colSpan:t,className:"px-3 py-3",children:h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1",children:"Prompt"}),h.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 whitespace-pre-wrap break-words",children:e.prompt_preview||h.jsx("span",{className:"text-gray-500 italic",children:"(empty prompt)"})})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[e.had_error&&h.jsxs(Qn,{color:"red",children:[h.jsx(Zi,{size:10,className:"mr-1"}),"had error"]}),(e.models_used??[]).map(r=>h.jsx(Qn,{color:"purple",children:r},r)),(e.models_used==null||e.models_used.length===0)&&h.jsx("span",{className:"text-[10px] text-gray-500",children:"no model recorded"}),h.jsxs("span",{className:"text-[10px] text-gray-500 ml-auto font-mono",children:["session ",e.session_id.slice(0,8)," · ",pV(e.timestamp)]})]})]})})})}function XOe({data:e,onOpen:t,initialSort:r}){const n=e??[],{sorted:a,sortKey:i,sortDir:o,setSort:l}=KOe(n,(r==null?void 0:r.key)??"cost",(r==null?void 0:r.dir)??"desc"),[u,d]=P.useState(()=>new Set),[p,f]=P.useState(1),[m,y]=P.useState(10),x=Math.max(1,Math.ceil(a.length/m)),S=Math.min(p,x),b=P.useMemo(()=>a.slice((S-1)*m,S*m),[a,S,m]),w=P.useMemo(()=>n.reduce((E,R)=>E+(R.cost??0),0),[n]),_=P.useMemo(()=>{const E=n.map(R=>R.cost??0);return{sum:E.reduce((R,I)=>R+I,0),median:WOe(E),p95:VOe(E,95)}},[n]),k=P.useCallback(E=>{d(R=>{const I=new Set(R);return I.has(E)?I.delete(E):I.add(E),I})},[]),N=P.useCallback(E=>{if(t){t(E);return}Dd(E)},[t]);if(!e||e.length===0)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"ccl-root-empty",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Most Expensive Commands"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No command cost data yet"})]});const T=8;return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"ccl-root",children:[h.jsxs("div",{className:"flex items-baseline justify-between mb-3 gap-3 flex-wrap",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Most Expensive Commands"}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"text-xs text-gray-500","data-testid":"ccl-caption",children:a.length===0?"no rows":`${(S-1)*m+1}–${Math.min(S*m,a.length)} of ${a.length}, sorted by ${qOe[i]} (${o})`}),h.jsx("select",{value:m,onChange:E=>{y(Number(E.target.value)),f(1)},"aria-label":"Rows per page",className:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded px-2 py-1 text-xs text-gray-700 dark:text-gray-300",children:[10,25,50,100].map(E=>h.jsxs("option",{value:E,children:[E,"/page"]},E))})]})]}),h.jsx("div",{className:"bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800 overflow-hidden",children:h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400 text-xs uppercase tracking-wider whitespace-nowrap",children:[h.jsx("th",{scope:"col",className:"w-8","aria-label":"expand"}),h.jsx("th",{scope:"col",className:"px-3 py-2 text-left",children:"Prompt"}),h.jsx(nc,{label:"When",sortKey:"when",activeKey:i,dir:o,onSort:l,align:"left",className:"w-28"}),h.jsx(nc,{label:"Cost",sortKey:"cost",activeKey:i,dir:o,onSort:l,className:"w-20"}),h.jsx("th",{scope:"col",className:"px-3 py-2 text-right w-20",children:"%Total"}),h.jsx(nc,{label:"Tokens",sortKey:"tokens",activeKey:i,dir:o,onSort:l,className:"w-20"}),h.jsx(nc,{label:"Tools",sortKey:"tools",activeKey:i,dir:o,onSort:l,className:"w-20"}),h.jsx(nc,{label:"Steps",sortKey:"steps",activeKey:i,dir:o,onSort:l,className:"w-20"})]})}),h.jsx("tbody",{children:b.map(E=>{const R=dV(E.tokens),I=w>0?E.cost/w*100:0,D=u.has(E.interaction_id);return h.jsxs(P.Fragment,{children:[h.jsxs("tr",{className:"border-b border-gray-200/50 dark:border-gray-800/50 hover:bg-gray-100/70 dark:hover:bg-gray-800/50 cursor-pointer",onClick:()=>N(E.interaction_id),"data-testid":"ccl-row",children:[h.jsx("td",{className:"px-2 py-2 text-gray-500 w-8",children:h.jsx("button",{type:"button",onClick:C=>{C.stopPropagation(),k(E.interaction_id)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),C.stopPropagation(),k(E.interaction_id))},className:"p-0.5 rounded hover:text-gray-800 dark:hover:text-gray-200 hover:bg-gray-200/70 dark:hover:bg-gray-700/50 focus:outline-none focus:ring-1 focus:ring-indigo-500","aria-expanded":D,"aria-label":D?"Collapse row":"Expand row","data-testid":"ccl-expand-toggle",children:D?h.jsx(Xo,{size:14}):h.jsx(to,{size:14})})}),h.jsx("td",{className:"px-3 py-2 text-gray-800 dark:text-gray-200 max-w-md",children:h.jsxs("div",{className:"flex items-start gap-1.5",children:[E.had_error&&h.jsx(Zi,{size:12,className:"text-red-400 mt-0.5 flex-shrink-0"}),h.jsx("span",{className:"truncate block",title:E.prompt_preview,children:E.prompt_preview||h.jsx("span",{className:"text-gray-500 italic",children:"(empty prompt)"})})]})}),h.jsx("td",{className:"px-3 py-2 text-gray-500 text-xs whitespace-nowrap",children:pV(E.timestamp)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-900 dark:text-gray-100 font-medium tabular-nums",children:_t(E.cost)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-500 tabular-nums text-xs",children:I>=.1?`${I.toFixed(1)}%`:"—"}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:GOe(R)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:E.tools_used}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:E.steps})]}),D&&h.jsx(YOe,{row:E,colSpan:T})]},E.interaction_id)})}),h.jsx("tfoot",{children:h.jsxs("tr",{className:"border-t border-gray-300 dark:border-gray-700 text-gray-700 dark:text-gray-300 text-xs bg-gray-100/60 dark:bg-gray-800/40","data-testid":"ccl-footer",children:[h.jsx("td",{colSpan:3,className:"px-3 py-2 text-left uppercase tracking-wider text-gray-500",children:"Cost aggregates"}),h.jsxs("td",{className:"px-3 py-2 text-right font-medium tabular-nums",title:"Sum",children:["Σ ",_t(_.sum)]}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-500 tabular-nums",children:"100%"}),h.jsxs("td",{colSpan:3,className:"px-3 py-2 text-right text-gray-600 dark:text-gray-400 tabular-nums text-[11px]",children:["median ",_t(_.median)," · p95 ",_t(_.p95)]})]})})]})})}),x>1&&h.jsxs("div",{className:"flex items-center justify-between mt-3 text-xs text-gray-600 dark:text-gray-400","data-testid":"ccl-pagination",children:[h.jsxs("span",{children:["Page ",S," of ",x]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:()=>f(E=>Math.max(1,E-1)),disabled:S<=1,className:"px-2 py-1 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Prev"}),h.jsx("button",{type:"button",onClick:()=>f(E=>Math.min(x,E+1)),disabled:S>=x,className:"px-2 py-1 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}const t5=["#818CF8","#34D399","#F59E0B","#F87171","#A78BFA","#38BDF8","#FB923C","#E879F9","#2DD4BF","#FCD34D"],C1=[{key:"cost",label:"Cost"},{key:"calls",label:"Calls"},{key:"tokens",label:"Tokens"}];function To(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function r5(e){return!isFinite(e)||e<=0?"—":e<.1?"<0.1%":e<10?`${e.toFixed(1)}%`:`${e.toFixed(0)}%`}function ZOe({data:e,onToolClick:t}){var x,S;const[r,n]=P.useState("cost"),a=P.useMemo(()=>{if(!e)return[];const b=Object.entries(e).map(([k,N])=>{const T=N.input_tokens??0,E=N.output_tokens??0,R=N.cache_read_tokens??0,I=N.cache_creation_tokens??0;return{name:k,cost:N.cost??0,calls:N.calls??0,tokens:T+E+R+I,input:T,output:E,cacheRead:R,cacheCreation:I}}).filter(k=>k.cost>0||k.calls>0||k.tokens>0),w=b.reduce((k,N)=>k+(N[r]||0),0);return[...b].sort((k,N)=>(N[r]||0)-(k[r]||0)).slice(0,12).map(k=>{const N=k[r]||0,T=w>0?N/w*100:0,E=r==="cost"?_t(k.cost):To(N);return{...k,pctOfTotal:T,label:`${E} · ${r5(T)}`}})},[e,r]),i=a.length>0,o=`Tools by ${((x=C1.find(b=>b.key===r))==null?void 0:x.label)??"Cost"}`,l=h.jsxs("div",{className:"flex items-center justify-between mb-3 gap-3",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:o}),h.jsx("div",{role:"tablist","aria-label":"Sort tools",className:"inline-flex items-center rounded-md border border-gray-300 dark:border-gray-700 bg-gray-50/80 dark:bg-gray-900/60 p-0.5 text-[11px]",children:C1.map(b=>{const w=b.key===r;return h.jsx("button",{role:"tab","aria-selected":w,type:"button",onClick:()=>n(b.key),className:["px-2.5 py-1 rounded transition-colors",w?"bg-indigo-500/25 text-indigo-200":"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"].join(" "),children:b.label},b.key)})})]});if(!e||Object.keys(e).length===0||!i)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[l,h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No tool cost data yet"})]});const u=r,d=Math.max(...a.map(b=>b.name.length)),p=Math.min(d*6,160),f=b=>{var _;let w;if(b&&typeof b=="object"){const k=b;w=k.name??((_=k.payload)==null?void 0:_.name)}w&&(t&&t(w),typeof window<"u"&&typeof CustomEvent<"u"&&window.dispatchEvent(new CustomEvent("stackunderflow:filter-tool",{detail:{tool:w}})))},m=r==="cost"?b=>_t(b):b=>To(b),y=(((S=C1.find(b=>b.key===r))==null?void 0:S.label)??"cost").toLowerCase();return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800",children:[l,h.jsx(pr,{width:"100%",height:Math.max(260,a.length*32),children:h.jsxs(ni,{data:a,layout:"vertical",margin:{left:20,right:88},children:[h.jsx(Br,{strokeDasharray:"3 3",stroke:"#374151",horizontal:!1}),h.jsx(Vt,{type:"number",tick:{fontSize:10,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"},tickFormatter:m}),h.jsx(Rt,{type:"category",dataKey:"name",tick:{fontSize:10,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"},width:p}),h.jsx(ut,{cursor:{fill:"rgba(129, 140, 248, 0.08)"},contentStyle:{backgroundColor:"#1F2937",border:"1px solid #374151",borderRadius:"6px",fontSize:"12px",whiteSpace:"pre-line"},labelStyle:{color:"#D1D5DB"},formatter:(b,w,_)=>{const k=_==null?void 0:_.payload;return k?[[`${_t(k.cost)} · ${r5(k.pctOfTotal)} of ${y}`,`calls: ${To(k.calls)}`,`input: ${To(k.input)} · output: ${To(k.output)}`,`cache read: ${To(k.cacheRead)} · cache creation: ${To(k.cacheCreation)}`].join(` +`),"Details"]:["",""]}}),h.jsxs(At,{dataKey:u,radius:[0,4,4,0],cursor:"pointer",onClick:f,children:[a.map((b,w)=>h.jsx(yn,{fill:t5[w%t5.length]},w)),h.jsx(mn,{dataKey:"label",position:"right",style:{fill:"#D1D5DB",fontSize:10}})]})]})}),h.jsxs("p",{className:"mt-2 text-[10px] text-gray-500",children:["Click a bar to filter by that tool. % is share of total ",y," across all tools."]})]})}const Sf=[{key:"input",color:"#818CF8",label:"Input"},{key:"output",color:"#34D399",label:"Output"},{key:"cache_read",color:"#F59E0B",label:"Cache Read"},{key:"cache_creation",color:"#FB923C",label:"Cache Creation"}],QOe=[{key:"7d",label:"7d"},{key:"30d",label:"30d"},{key:"all",label:"All"}];function JOe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function eCe({active:e,label:t,payload:r}){var i;if(!e||!r||r.length===0)return null;const n=(i=r[0])==null?void 0:i.payload;if(!n)return null;const a=(n.input??0)+(n.output??0)+(n.cache_read??0)+(n.cache_creation??0);return h.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md p-2.5 text-xs shadow-lg","data-testid":"token-stack-tooltip",children:[h.jsx("div",{className:"text-gray-800 dark:text-gray-200 font-medium mb-1.5",children:t}),h.jsx("div",{className:"space-y-1",children:Sf.map(o=>{const l=n[o.key]??0,u=a>0?l/a*100:0;return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:o.color}}),h.jsx("span",{className:"text-gray-600 dark:text-gray-400 flex-1",children:o.label}),h.jsx("span",{className:"text-gray-800 dark:text-gray-200 tabular-nums",children:l.toLocaleString()}),h.jsxs("span",{className:"text-gray-500 tabular-nums w-10 text-right",children:[u.toFixed(1),"%"]})]},o.key)})}),h.jsxs("div",{className:"mt-1.5 pt-1.5 border-t border-gray-300 dark:border-gray-700 flex items-center justify-between",children:[h.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Total"}),h.jsx("span",{className:"text-gray-900 dark:text-gray-100 font-medium tabular-nums",children:a.toLocaleString()})]})]})}function tCe({daily:e}){const[t,r]=P.useState("all"),[n,a]=P.useState(null),i=P.useMemo(()=>e?Object.entries(e).map(([d,p])=>({date:d,input:p.input??0,output:p.output??0,cache_read:p.cache_read??0,cache_creation:p.cache_creation??0})).sort((d,p)=>d.date.localeCompare(p.date)):[],[e]),o=P.useMemo(()=>{if(t==="all")return i;const d=t==="7d"?7:30;return i.slice(-d)},[i,t]);if(!e||Object.keys(e).length===0)return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"token-composition-stack",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Daily Token Composition"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No daily token data yet"})]});const l=n?Sf.filter(d=>d.key===n):Sf,u=d=>{a(p=>p===d?null:d)};return h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"token-composition-stack",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2 flex-wrap",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Daily Token Composition"}),h.jsx("div",{className:"flex items-center gap-1",role:"group","aria-label":"Date range filter","data-testid":"token-stack-range",children:QOe.map(d=>{const p=t===d.key;return h.jsx("button",{type:"button",onClick:()=>r(d.key),"data-testid":`token-stack-range-${d.key}`,"aria-pressed":p,className:`inline-flex items-center px-2 py-0.5 text-[11px] font-medium rounded-full border transition-colors ${p?"bg-indigo-100 text-indigo-800 border-indigo-300 dark:bg-indigo-900/50 dark:text-indigo-200 dark:border-indigo-700":"bg-gray-100/90 dark:bg-gray-800/80 text-gray-600 dark:text-gray-400 border-gray-300 dark:border-gray-700 hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-400 dark:hover:border-gray-600"}`,children:d.label},d.key)})})]}),o.length===0?h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No data in this range"}):h.jsx(pr,{width:"100%",height:260,children:h.jsxs(ni,{data:o,children:[h.jsx(Br,{strokeDasharray:"3 3",stroke:"#374151"}),h.jsx(Vt,{dataKey:"date",tick:{fontSize:10,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"}}),h.jsx(Rt,{tick:{fontSize:10,fill:"#9CA3AF"},tickLine:{stroke:"#4B5563"},axisLine:{stroke:"#4B5563"},tickFormatter:JOe}),h.jsx(ut,{cursor:{fill:"rgba(99, 102, 241, 0.08)"},content:h.jsx(eCe,{})}),l.map((d,p)=>h.jsx(At,{dataKey:d.key,stackId:"tokens",fill:d.color,name:d.key,radius:p===l.length-1?[4,4,0,0]:[0,0,0,0]},d.key))]})}),h.jsxs("div",{className:"mt-3 flex items-center justify-center gap-3 flex-wrap",role:"group","aria-label":"Series legend — click to isolate","data-testid":"token-stack-legend",children:[Sf.map(d=>{const p=n!==null&&n!==d.key;return h.jsxs("button",{type:"button",onClick:()=>u(d.key),"data-testid":`token-stack-legend-${d.key}`,"aria-pressed":n===d.key,title:n===d.key?"Click to show all series":`Click to isolate ${d.label}`,className:`inline-flex items-center gap-1.5 text-[11px] transition-opacity ${p?"opacity-40 hover:opacity-70":"opacity-100"} text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200`,children:[h.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:d.color}}),h.jsx("span",{children:d.label})]},d.key)}),n!==null&&h.jsx("button",{type:"button",onClick:()=>a(null),"data-testid":"token-stack-legend-reset",className:"text-[11px] text-indigo-700 dark:text-indigo-300 hover:text-indigo-800 dark:hover:text-indigo-200 underline underline-offset-2",children:"reset"})]})]})}function BT(e){return e==null||typeof e=="number"&&Number.isNaN(e)}function rCe(e,t,r){const n=BT(e),a=BT(t);if(n&&a)return 0;if(n)return 1;if(a)return-1;let i=0;if(typeof e=="number"&&typeof t=="number")i=e-t;else{const o=String(e),l=String(t);if(/^\d{4}-\d{2}-\d{2}/.test(o)&&/^\d{4}-\d{2}-\d{2}/.test(l)){const u=Date.parse(o),d=Date.parse(l);!Number.isNaN(u)&&!Number.isNaN(d)?i=u-d:i=o.localeCompare(l)}else i=o.localeCompare(l,void 0,{numeric:!0,sensitivity:"base"})}return r==="asc"?i:-i}function nCe(e,t){const[r,n]=P.useState(t.key),[a,i]=P.useState(t.dir),o=P.useCallback(u=>{if(u===r){i(f=>f==="asc"?"desc":"asc");return}n(u);const d=e.find(f=>!BT(f[u])),p=d?d[u]:void 0;i(typeof p=="number"?"desc":"asc")},[r,e]);return{sorted:P.useMemo(()=>{const u=e.slice();return u.sort((d,p)=>rCe(d[r],p[r],a)),u},[e,r,a]),sortKey:r,sortDir:a,setSort:o}}function R1({label:e,sortKey:t,activeKey:r,dir:n,onClick:a,align:i="left",className:o}){const l=t===r,d=["cursor-pointer select-none px-3 py-2",i==="right"?"text-right":"text-left",o??""].filter(Boolean).join(" "),p=["inline-flex items-center gap-1",i==="right"?"w-full justify-end":""].filter(Boolean).join(" "),f=l?n==="asc"?Tf:Xo:null;return P.createElement("th",{onClick:a,className:d,"data-sort-key":t,"aria-sort":l?n==="asc"?"ascending":"descending":"none",role:"columnheader",scope:"col",tabIndex:0,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),a())}},P.createElement("span",{className:p},P.createElement("span",null,e),f?P.createElement(f,{size:12,stroke:2.5,"aria-hidden":!0}):null))}function aCe({expanded:e,onToggle:t,columns:r,children:n,detail:a,rowClassName:i,detailClassName:o,"data-testid":l}){const u=i??"border-b border-gray-200/50 dark:border-gray-800/50 hover:bg-gray-100/70 dark:hover:bg-gray-800/50 cursor-pointer focus:outline-none focus:bg-gray-100/70 dark:focus:bg-gray-800/50",d=o??"bg-gray-50/80 dark:bg-gray-900/60 text-gray-700 dark:text-gray-300 px-6 py-3 border-b border-gray-200 dark:border-gray-800",p=f=>{(f.key==="Enter"||f.key===" "||f.key==="Spacebar")&&(f.preventDefault(),t())};return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{className:u,role:"button",tabIndex:0,"aria-expanded":e,onClick:t,onKeyDown:p,"data-testid":l,children:[h.jsx("td",{className:"w-6 px-2 py-2 text-gray-500 align-middle",children:h.jsx(to,{size:14,className:`transition-transform duration-150 ease-out ${e?"rotate-90":""}`,"aria-hidden":"true"})}),n]}),e&&h.jsx("tr",{"data-testid":l?`${l}-detail`:void 0,children:h.jsx("td",{colSpan:r,className:d,children:a})})]})}function iCe(e){const t=e.filter(a=>typeof a=="number"&&!Number.isNaN(a));if(t.length===0)return 0;const r=[...t].sort((a,i)=>a-i),n=Math.floor(r.length/2);return r.length%2===0?((r[n-1]??0)+(r[n]??0))/2:r[n]??0}function oCe(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}const sCe=10;function n5({title:e,icon:t,rows:r,countKey:n,countLabel:a,empty:i,testIdPrefix:o,onOpenInteraction:l,onOpenSession:u}){const{sorted:d,sortDir:p,sortKey:f,setSort:m}=nCe(r,{key:n,dir:"desc"}),[y,x]=P.useState(1),[S,b]=P.useState(sCe),[w,_]=P.useState(null),k=d.length,N=Math.max(1,Math.ceil(k/S)),T=Math.min(y,N),E=P.useMemo(()=>d.slice((T-1)*S,T*S),[d,T,S]),R=P.useMemo(()=>iCe(r.map(C=>C.cost)),[r]),I=5,D=String(f);return h.jsxs("div",{"data-testid":`${o}-section`,children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-600 dark:text-gray-400 mb-2",children:[h.jsx("span",{className:"text-gray-500",children:t}),h.jsx("span",{className:"font-medium uppercase tracking-wider",children:e}),h.jsxs("span",{className:"text-gray-500",children:["(",r.length,")"]})]}),r.length===0?h.jsx("div",{className:"text-xs text-gray-500 py-4 px-3 bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800",children:i}):h.jsxs("div",{className:"bg-gray-100/50 dark:bg-gray-800/30 rounded border border-gray-200 dark:border-gray-800 overflow-hidden",children:[h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-sm","data-testid":`${o}-table`,children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-800 text-gray-600 dark:text-gray-400 text-xs uppercase tracking-wider whitespace-nowrap",children:[h.jsx("th",{className:"w-6 px-2 py-2","aria-hidden":"true"}),h.jsx("th",{className:"px-3 py-2 text-left",children:"Prompt"}),h.jsx(R1,{label:"When",sortKey:"timestamp",activeKey:D,dir:p,onClick:()=>m("timestamp"),className:"w-32"}),h.jsx(R1,{label:a,sortKey:n,activeKey:D,dir:p,onClick:()=>m(n),align:"right",className:"w-20"}),h.jsx(R1,{label:"Cost",sortKey:"cost",activeKey:D,dir:p,onClick:()=>m("cost"),align:"right",className:"w-24"})]})}),h.jsx("tbody",{children:E.map(C=>{const L=w===C.interaction_id;return h.jsxs(aCe,{expanded:L,onToggle:()=>{_(L?null:C.interaction_id),l(C.interaction_id)},columns:I,"data-testid":`${o}-row-${C.interaction_id}`,detail:h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-xs uppercase tracking-wider text-gray-500 mb-1",children:"Prompt"}),h.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 whitespace-pre-wrap break-words",children:C.prompt_preview||h.jsx("span",{className:"text-gray-500 italic",children:"(empty prompt)"})})]}),h.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-1 text-xs text-gray-600 dark:text-gray-400",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500",children:"Tool calls:"})," ",h.jsx("span",{className:"tabular-nums text-gray-800 dark:text-gray-200",children:C.tool_count})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500",children:"Assistant steps:"})," ",h.jsx("span",{className:"tabular-nums text-gray-800 dark:text-gray-200",children:C.step_count})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500",children:"Cost:"})," ",h.jsx("span",{className:"tabular-nums text-gray-800 dark:text-gray-200",children:_t(C.cost)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-500",children:"Session:"})," ",h.jsx("button",{type:"button",className:"text-blue-400 hover:text-blue-300 hover:underline font-mono text-xs",onClick:F=>{F.stopPropagation(),u(C.session_id)},children:C.session_id})]})]})]}),children:[h.jsx("td",{className:"px-3 py-2 text-gray-800 dark:text-gray-200 max-w-md",children:h.jsx("span",{className:"truncate block",title:C.prompt_preview,children:C.prompt_preview||h.jsx("span",{className:"text-gray-500 italic",children:"(empty prompt)"})})}),h.jsx("td",{className:"px-3 py-2 text-gray-500 text-xs whitespace-nowrap",children:oCe(C.timestamp)}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-900 dark:text-gray-100 font-medium tabular-nums",children:C[n]}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-700 dark:text-gray-300 tabular-nums",children:_t(C.cost)})]},C.interaction_id)})}),h.jsx("tfoot",{className:"border-t border-gray-200 dark:border-gray-800 bg-gray-100/60 dark:bg-gray-800/40 text-xs","data-testid":`${o}-footer`,children:h.jsxs("tr",{children:[h.jsx("td",{className:"w-6 px-2 py-2","aria-hidden":"true"}),h.jsxs("td",{className:"px-3 py-2 font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wider",children:[k," ",k===1?"command":"commands",N>1?h.jsxs("span",{className:"text-gray-500 normal-case ml-2",children:["(page ",T," of ",N,")"]}):null]}),h.jsx("td",{className:"px-3 py-2"}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-500 uppercase tracking-wider",children:"median"}),h.jsx("td",{className:"px-3 py-2 text-right text-gray-800 dark:text-gray-200 tabular-nums",children:_t(R)})]})})]})}),N>1&&h.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-800 px-3 py-2 bg-gray-100/40 dark:bg-gray-800/20 flex items-center justify-between text-xs text-gray-600 dark:text-gray-400","data-testid":`${o}-pagination`,children:[h.jsxs("span",{children:[(T-1)*S+1,"–",Math.min(T*S,k)," of ",k]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("select",{value:S,onChange:C=>{b(Number(C.target.value)),x(1)},"aria-label":"Rows per page",className:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded px-2 py-0.5 text-xs",children:[10,25,50,100].map(C=>h.jsxs("option",{value:C,children:[C,"/page"]},C))}),h.jsx("button",{type:"button",onClick:()=>x(C=>Math.max(1,C-1)),disabled:T<=1,className:"px-2 py-0.5 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Prev"}),h.jsxs("span",{children:[T,"/",N]}),h.jsx("button",{type:"button",onClick:()=>x(C=>Math.min(N,C+1)),disabled:T>=N,className:"px-2 py-0.5 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})]})}function lCe({outliers:e,onOpen:t}){const r=(e==null?void 0:e.high_tool_commands)??[],n=(e==null?void 0:e.high_step_commands)??[],a=P.useCallback(o=>{t?t(o):Dd(o)},[t]),i=P.useCallback(o=>{dd(o)},[]);return!e||r.length===0&&n.length===0?h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"outlier-commands-table",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Outlier Commands"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No outlier commands — nothing exceeded the thresholds."})]}):h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"outlier-commands-table",children:[h.jsxs("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:["Outlier Commands",h.jsx("span",{className:"ml-2 text-xs text-gray-500 font-normal",children:"tool-count > 20 · step-count > 15"})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx(n5,{title:"High tool count",icon:h.jsx(is,{size:12}),rows:r,countKey:"tool_count",countLabel:"Tools",empty:"No commands exceeded 20 tool calls.",testIdPrefix:"outlier-high-tool",onOpenInteraction:a,onOpenSession:i}),h.jsx(n5,{title:"High step count",icon:h.jsx(W5,{size:12}),rows:n,countKey:"step_count",countLabel:"Steps",empty:"No commands exceeded 15 assistant steps.",testIdPrefix:"outlier-high-step",onOpenInteraction:a,onOpenSession:i})]})]})}function uCe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:e.toLocaleString()}function cCe(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function dCe(e){return e.consecutive_failures>=3?"red":"amber"}const pCe={red:{wrapper:"bg-red-50 dark:bg-red-900/20 border-red-300 dark:border-red-800/60",icon:"text-red-600 dark:text-red-400",label:"text-red-700 dark:text-red-300"},amber:{wrapper:"bg-amber-50 dark:bg-amber-900/20 border-amber-300 dark:border-amber-800/60",icon:"text-amber-600 dark:text-amber-400",label:"text-amber-700 dark:text-amber-300"}},a5=[{id:"all",label:"All",predicate:()=>!0},{id:"ge2",label:"≥2 failures",predicate:e=>e.consecutive_failures>=2},{id:"ge3",label:"≥3 failures",predicate:e=>e.consecutive_failures>=3}];function fCe({signals:e}){const[t,r]=P.useState("all"),[n,a]=P.useState(1),[i,o]=P.useState(10),l=P.useMemo(()=>!e||e.length===0?[]:[...e].sort((y,x)=>x.estimated_wasted_cost-y.estimated_wasted_cost||x.consecutive_failures-y.consecutive_failures),[e]),u=P.useMemo(()=>{var x;const y=((x=a5.find(S=>S.id===t))==null?void 0:x.predicate)??(()=>!0);return l.filter(y)},[l,t]),d=P.useMemo(()=>u.reduce((y,x)=>y+(x.estimated_wasted_cost??0),0),[u]),p=Math.max(1,Math.ceil(u.length/i)),f=Math.min(n,p),m=P.useMemo(()=>u.slice((f-1)*i,f*i),[u,f,i]);return!e||e.length===0?h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"retry-alerts-panel",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Retry Alerts"}),h.jsx("div",{className:"text-xs text-gray-500 py-8 text-center",children:"No retry storms detected — nice."})]}):h.jsxs("div",{className:"bg-gray-100/70 dark:bg-gray-800/50 rounded-lg p-4 border border-gray-200 dark:border-gray-800","data-testid":"retry-alerts-panel",children:[h.jsxs("div",{className:"flex items-baseline justify-between mb-3 gap-2 flex-wrap",children:[h.jsxs("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300","data-testid":"retry-alerts-summary",children:[u.length," retr",u.length===1?"y":"ies"," wasted"," ",h.jsx("span",{className:"tabular-nums",children:_t(d)})," total"]}),h.jsx("div",{className:"flex items-center gap-1",role:"group","aria-label":"Severity filter","data-testid":"retry-alerts-filters",children:a5.map(y=>{const x=t===y.id;return h.jsx("button",{type:"button",onClick:()=>{r(y.id),a(1)},"aria-pressed":x,"data-testid":`retry-alerts-filter-${y.id}`,className:"text-[11px] px-2 py-0.5 rounded-full border transition-colors "+(x?"bg-indigo-500/20 border-indigo-500/60 text-indigo-200":"bg-gray-100/90 dark:bg-gray-800/80 border-gray-300 dark:border-gray-700 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-400 dark:hover:border-gray-600"),children:y.label},y.id)})})]}),u.length===0?h.jsx("div",{className:"text-xs text-gray-500 py-6 text-center","data-testid":"retry-alerts-empty-filtered",children:"No signals match this severity filter."}):h.jsx("div",{className:"space-y-2","data-testid":"retry-alerts-list",children:m.map((y,x)=>{const S=pCe[dCe(y)];return h.jsxs("button",{type:"button",onClick:()=>Dd(y.interaction_id),"data-testid":"retry-alerts-row",className:`w-full text-left flex items-start gap-3 p-3 rounded border transition-colors ${S.wrapper} hover:brightness-125 focus:outline-none focus:ring-2 focus:ring-indigo-500/60`,children:[h.jsx(Zi,{size:16,className:`${S.icon} mt-0.5 flex-shrink-0`}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx("span",{className:`text-sm font-medium ${S.label}`,children:y.tool}),h.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-gray-600 dark:text-gray-400 bg-gray-100/90 dark:bg-gray-800/80 border border-gray-300 dark:border-gray-700 rounded-full px-2 py-0.5",children:[h.jsx(Xa,{size:10}),y.consecutive_failures,"× failed · ",y.total_invocations," total"]}),h.jsx("span",{className:"text-[10px] text-gray-500",children:cCe(y.timestamp)})]}),h.jsxs("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 tabular-nums",children:["~",uCe(y.estimated_wasted_tokens)," wasted tokens ·"," ",_t(y.estimated_wasted_cost)," wasted cost"]})]})]},`${y.interaction_id}-${y.tool}-${x}`)})}),p>1&&h.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 dark:border-gray-800 flex items-center justify-between text-xs text-gray-600 dark:text-gray-400","data-testid":"retry-alerts-pagination",children:[h.jsxs("span",{children:[(f-1)*i+1,"–",Math.min(f*i,u.length)," of ",u.length]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("select",{value:i,onChange:y=>{o(Number(y.target.value)),a(1)},"aria-label":"Rows per page",className:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded px-2 py-0.5 text-xs",children:[10,25,50,100].map(y=>h.jsxs("option",{value:y,children:[y,"/page"]},y))}),h.jsx("button",{type:"button",onClick:()=>a(y=>Math.max(1,y-1)),disabled:f<=1,className:"px-2 py-0.5 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Prev"}),h.jsxs("span",{children:[f,"/",p]}),h.jsx("button",{type:"button",onClick:()=>a(y=>Math.min(p,y+1)),disabled:f>=p,className:"px-2 py-0.5 bg-white dark:bg-gray-800 rounded border border-gray-300 dark:border-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}function Ef(e){if(!e)return null;const t=Date.parse(e);return Number.isNaN(t)?null:t}function hCe(e){return e==="7d"||e==="30d"||e==="all"?e:"all"}function gCe(e,t,r){if(typeof window>"u"||typeof window.history>"u")return;const n=new URL(window.location.href);e==="all"?n.searchParams.delete("range"):n.searchParams.set("range",e),t?n.searchParams.set("session",t):n.searchParams.delete("session"),r?n.searchParams.set("tool",r):n.searchParams.delete("tool");const a=`${n.pathname}${n.search}${n.hash}`,i=`${window.location.pathname}${window.location.search}${window.location.hash}`;a!==i&&window.history.replaceState({},"",a)}function mCe(e,t,r){if(e==="all")return null;const n=[];for(const o of t){const l=Ef(o.ended_at)??Ef(o.started_at);l!==null&&n.push(l)}for(const o of r){const l=Ef(o.timestamp);l!==null&&n.push(l)}return(n.length?Math.max(...n):Date.now())-(e==="7d"?7:30)*24*60*60*1e3}function I1({filter:e,onRangeChange:t,onClearSession:r,onClearTool:n}){const a=[{key:"7d",label:"Last 7 days"},{key:"30d",label:"Last 30 days"},{key:"all",label:"All time"}];return h.jsxs("div",{className:"flex flex-wrap items-center gap-3 bg-gray-100/40 dark:bg-gray-800/40 border border-gray-200 dark:border-gray-800 rounded-lg px-3 py-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-gray-500",children:[h.jsx(q5,{size:13}),h.jsx("span",{className:"text-[11px] uppercase tracking-wider",children:"Filter"})]}),h.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[h.jsx(U5,{size:12,className:"text-gray-500"}),a.map(i=>h.jsx("button",{onClick:()=>t(i.key),className:`px-2 py-0.5 rounded text-[11px] transition-colors ${e.range===i.key?"bg-indigo-500/20 text-indigo-300 border border-indigo-500/40":"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 border border-transparent"}`,children:i.label},i.key))]}),e.sessionFilter&&h.jsxs("button",{onClick:r,className:"flex items-center gap-1 text-[11px] px-2 py-0.5 rounded bg-amber-500/15 text-amber-300 border border-amber-500/30 hover:bg-amber-500/25",title:"Clear session filter",children:["Session: ",h.jsx("span",{className:"font-mono",children:e.sessionFilter.slice(0,8)}),h.jsx(Ha,{size:11})]}),e.toolFilter&&h.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-[11px] px-2 py-0.5 rounded bg-purple-500/15 text-purple-300 border border-purple-500/30 hover:bg-purple-500/25",title:"Clear tool filter",children:[h.jsx(is,{size:11})," ",e.toolFilter,h.jsx(Ha,{size:11})]})]})}function yCe(){const e="bg-gray-100/40 dark:bg-gray-800/40 rounded-lg border border-gray-200 dark:border-gray-800 animate-pulse";return h.jsxs("div",{className:"space-y-6","aria-busy":"true","aria-label":"Loading cost analytics",children:[h.jsx("div",{className:`${e} h-20`}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx("div",{className:`${e} h-40`}),h.jsx("div",{className:`${e} h-40`})]}),h.jsx("div",{className:`${e} h-64`}),h.jsx("div",{className:`${e} h-80`}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx("div",{className:`${e} h-64`}),h.jsx("div",{className:`${e} h-64`})]}),h.jsx("div",{className:`${e} h-48`}),h.jsx("div",{className:`${e} h-40`})]})}function bCe({message:e,onRetry:t}){return h.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-lg p-4 flex items-center justify-between gap-3",children:[h.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[h.jsx(Zi,{size:16,className:"text-red-600 dark:text-red-400 mt-0.5 shrink-0"}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm text-red-700 dark:text-red-300 font-medium",children:"Failed to load cost analytics"}),h.jsx("div",{className:"text-xs text-red-700/80 dark:text-red-400/80 truncate",children:e})]})]}),h.jsxs("button",{onClick:t,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded text-xs text-gray-800 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-700 shrink-0",children:[h.jsx(Xa,{size:12})," Retry"]})]})}function vCe({stats:e}){var E;const[t,r]=P.useState(null),[n,a]=P.useState(!0),[i,o]=P.useState(null),[l,u]=P.useState(()=>({range:hCe(qa("range")),sessionFilter:qa("session"),toolFilter:qa("tool")})),d=P.useCallback(async()=>{a(!0),o(null);try{const R=await fetch("/api/cost-data");if(!R.ok){const D=await R.text().catch(()=>"");throw new Error(`${R.status} ${R.statusText}${D?`: ${D}`:""}`)}const I=await R.json();r(I)}catch(R){o(R instanceof Error?R.message:String(R)),r(null)}finally{a(!1)}},[]);P.useEffect(()=>{d()},[d]),P.useEffect(()=>{gCe(l.range,l.sessionFilter,l.toolFilter)},[l.range,l.sessionFilter,l.toolFilter]),P.useEffect(()=>{const R=D=>{const C=D.detail;(C==null?void 0:C.window)==="current-week"?u(L=>({...L,range:"7d"})):(C==null?void 0:C.window)==="prior-week"&&u(L=>({...L,range:"30d"}))},I=D=>{const C=D.detail;C!=null&&C.tool&&u(L=>({...L,toolFilter:C.tool}))};return window.addEventListener("stackunderflow:filter-window",R),window.addEventListener("stackunderflow:filter-tool",I),()=>{window.removeEventListener("stackunderflow:filter-window",R),window.removeEventListener("stackunderflow:filter-tool",I)}},[]);const p=P.useMemo(()=>{if(!t)return null;const R=t.session_costs??[],I=t.command_costs??[],D=t.retry_signals??[],C=mCe(l.range,R,I),L=J=>{if(C===null)return!0;const K=Ef(J);return K===null?!0:K>=C},F=J=>!l.sessionFilter||J===l.sessionFilter,z=R.filter(J=>L(J.ended_at??J.started_at)&&F(J.session_id)),H=I.filter(J=>L(J.timestamp)&&F(J.session_id)),q=D.filter(J=>L(J.timestamp)&&F(J.session_id)&&(!l.toolFilter||J.tool===l.toolFilter)),X=l.toolFilter?t.tool_costs&&l.toolFilter in t.tool_costs?{[l.toolFilter]:t.tool_costs[l.toolFilter]}:{}:t.tool_costs??{};return{sessions:z,commands:H,retries:q,tools:X}},[t,l]),f=P.useCallback(R=>{Dd(R)},[]),m=P.useCallback(R=>{dd(R)},[]),y=R=>u(I=>({...I,range:R})),x=()=>u(R=>({...R,sessionFilter:null})),S=()=>u(R=>({...R,toolFilter:null}));if(n)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(I1,{filter:l,onRangeChange:y,onClearSession:x,onClearTool:S}),h.jsx(yCe,{})]});if(i||!t)return h.jsxs("div",{className:"space-y-6",children:[h.jsx(I1,{filter:l,onRangeChange:y,onClearSession:x,onClearTool:S}),h.jsx(bCe,{message:i??"No data returned from /api/cost-data",onRetry:d})]});const b=t.token_composition,w=(b==null?void 0:b.totals)??((E=e==null?void 0:e.overview)!=null&&E.total_tokens?{input:e.overview.total_tokens.input??0,output:e.overview.total_tokens.output??0,cache_read:e.overview.total_tokens.cache_read??0,cache_creation:e.overview.total_tokens.cache_creation??0}:{}),_=p,k=t.trends??void 0,N=t.error_cost??void 0,T=t.outliers??void 0;return h.jsxs("div",{className:"space-y-6",children:[h.jsx(I1,{filter:l,onRangeChange:y,onClearSession:x,onClearTool:S}),h.jsx(nV,{trends:k}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx(iV,{cache:t.cache??(e==null?void 0:e.cache)??void 0}),h.jsx(FOe,{errorCost:N})]}),h.jsx(zOe,{data:_.sessions,onSelect:R=>{u(I=>({...I,sessionFilter:R})),m(R)}}),h.jsx(XOe,{data:_.commands,onOpen:f}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx(ZOe,{data:_.tools}),h.jsx(oV,{totals:w})]}),h.jsx(tCe,{daily:(b==null?void 0:b.daily)??{}}),h.jsx(lCe,{outliers:T,onOpen:f}),h.jsx(fCe,{signals:_.retries})]})}const UT="suf:beta",zT="suf:tabs",wf=!0;function xCe(){if(typeof window>"u")return wf;try{const e=window.localStorage.getItem(UT);if(e===null)return wf;const t=JSON.parse(e);if(typeof t=="boolean")return t}catch{}return wf}function SCe(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(zT);if(e===null)return{};const t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t)){const r={};for(const[n,a]of Object.entries(t))(a==="shown"||a==="hidden")&&(r[n]=a);return r}}catch{}return{}}function fV(){const[e,t]=P.useState(()=>xCe()),[r,n]=P.useState(()=>SCe());P.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(UT,JSON.stringify(e))}catch{}},[e]),P.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(zT,JSON.stringify(r))}catch{}},[r]);const a=P.useCallback(u=>{t(u)},[]),i=P.useCallback((u,d)=>{n(p=>{if(d==="default"){if(!(u in p))return p;const f={...p};return delete f[u],f}return p[u]===d?p:{...p,[u]:d}})},[]),o=P.useCallback((u,d)=>{const p=r[u];return p==="shown"?!0:p==="hidden"?!1:d?e:!0},[e,r]),l=P.useCallback(()=>{if(typeof window<"u")try{window.localStorage.removeItem(UT),window.localStorage.removeItem(zT)}catch{}t(wf),n({})},[]);return{betaEnabled:e,tabOverrides:r,setBetaEnabled:a,setTabVisibility:i,isTabVisible:o,reset:l}}const i5="bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300 text-[10px] px-1.5 py-0.5 rounded uppercase tracking-wider font-semibold";function hV({className:e}){const t=e?`${i5} ${e}`:i5;return h.jsx("span",{className:t,children:"BETA"})}const qT=[{id:"overview",label:"Overview",icon:JY},{id:"sessions",label:"Sessions",icon:WY},{id:"cost",label:"Cost",icon:Fh},{id:"commands",label:"Commands",icon:lN},{id:"messages",label:"Messages",icon:iN},{id:"search",label:"Search",icon:ha},{id:"qa",label:"Q&A",icon:ZY,beta:!0},{id:"bookmarks",label:"Bookmarks",icon:B5},{id:"tags",label:"Tags",icon:Q1,beta:!0}],ECe=qT.map(e=>e.id);function gV(e){return!!e&&ECe.includes(e)}function wCe(){const e=rV();return gV(e)?e:"overview"}function kCe(){var R,I;const{name:e}=PK(),t=Gl(),[r,n]=P.useState(wCe),[a,i]=P.useState(0),{isTabVisible:o}=fV(),l=P.useMemo(()=>qT.filter(D=>o(D.id,D.beta??!1)),[o]);P.useEffect(()=>{l.some(D=>D.id===r)||n("overview")},[l,r]);const{isLoading:u,error:d}=Jr({queryKey:["setProject",e],queryFn:()=>Z5(e),enabled:!!e,staleTime:6e4}),{data:p,isLoading:f,error:m}=Jr({queryKey:["dashboardData",e],queryFn:()=>FX(new Date().getTimezoneOffset()),enabled:!!e&&!u}),y=wc({mutationFn:()=>Q5(new Date().getTimezoneOffset()),onSuccess:()=>{t.invalidateQueries({queryKey:["dashboardData",e]})}}),x=P.useCallback(D=>{if(n(D),typeof window>"u")return;const C=new URL(window.location.href);C.searchParams.set("tab",D);const L=`${C.pathname}${C.search}${C.hash}`,F=`${window.location.pathname}${window.location.search}${window.location.hash}`;L!==F&&window.history.replaceState({},"",L)},[]),S=P.useCallback((D,C)=>{n(D),tV(D,C)},[]);P.useEffect(()=>{if(!(typeof window>"u"))return window.__suSwitchTab=S,()=>{delete window.__suSwitchTab}},[S]),P.useEffect(()=>{if(typeof window>"u")return;const D=()=>{const C=rV();gV(C)&&n(L=>L===C?L:C),i(L=>L+1)};return window.addEventListener(ns,D),window.addEventListener("popstate",D),()=>{window.removeEventListener(ns,D),window.removeEventListener("popstate",D)}},[]);const b=e?uc(e,void 0,$h()):"";if(u||f)return h.jsx(Wa,{message:`Loading ${b}...`});if(d||m){const D=d||m;return h.jsx("div",{className:"p-6",children:h.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-lg p-4 text-red-700 dark:text-red-400 text-sm",children:["Failed to load project: ",D instanceof Error?D.message:"Unknown error"]})})}if(!p)return h.jsx(ya,{title:"No data",description:"No dashboard data available"});const w=p.statistics,_=qa("q")??"",k=qa("session"),N=qa("interaction"),T=((R=qT.find(D=>D.id===r))==null?void 0:R.label)??r;let E=null;return k?E=[{label:T,onClick:()=>Ph("session")},{label:`Session · ${k}`}]:N&&(E=[{label:T,onClick:()=>Ph("interaction")},{label:`Interaction · ${N}`}]),h.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-4 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-gray-100",children:b}),((I=w==null?void 0:w.overview)==null?void 0:I.date_range)&&h.jsxs("p",{className:"text-xs text-gray-500",children:[w.overview.date_range.start," — ",w.overview.date_range.end]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[p.is_reindexing&&h.jsx("span",{className:"text-xs text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-900/20 px-2 py-1 rounded",children:"Reindexing..."}),h.jsxs("button",{onClick:()=>y.mutate(),disabled:y.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white rounded text-sm border border-gray-300 dark:border-gray-700 hover:border-gray-400 dark:hover:border-gray-600 disabled:opacity-50",children:[h.jsx(Xa,{size:14,className:y.isPending?"animate-spin":""}),"Refresh"]})]})]}),h.jsx("div",{className:"border-b border-gray-200 dark:border-gray-800",children:h.jsx("nav",{className:"flex gap-0 -mb-px overflow-x-auto","data-testid":"dashboard-tabs",children:l.map(D=>{const C=D.icon;return h.jsxs("button",{onClick:()=>x(D.id),"data-tab":D.id,className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium whitespace-nowrap border-b-2 ${r===D.id?"text-indigo-400 border-indigo-400":"text-gray-600 dark:text-gray-400 border-transparent hover:text-gray-800 dark:hover:text-gray-200 hover:border-gray-400 dark:hover:border-gray-600"}`,children:[h.jsx(C,{size:14}),D.label,D.beta===!0&&h.jsx(hV,{className:"ml-1.5"})]},D.id)})})}),E&&h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(HTe,{}),h.jsx(GTe,{trail:E})]}),h.jsxs("div",{children:[r==="overview"&&h.jsx(SNe,{stats:w}),r==="cost"&&h.jsx(vCe,{stats:w}),r==="commands"&&h.jsx(ANe,{data:p}),r==="messages"&&h.jsx(RNe,{data:p,projectName:e}),r==="search"&&h.jsx(BNe,{projectName:e,initialQuery:_}),r==="qa"&&h.jsx(GNe,{projectName:e}),r==="bookmarks"&&h.jsx(XNe,{}),r==="tags"&&h.jsx(rOe,{}),r==="sessions"&&h.jsx(LOe,{projectName:e,sessionEfficiency:w.session_efficiency})]})]})}const _Ce=[{id:"overview",label:"Overview",isBeta:!1},{id:"sessions",label:"Sessions",isBeta:!1},{id:"cost",label:"Cost",isBeta:!1},{id:"commands",label:"Commands",isBeta:!1},{id:"messages",label:"Messages",isBeta:!1},{id:"search",label:"Search",isBeta:!1},{id:"qa",label:"Q&A",isBeta:!0},{id:"tags",label:"Tags",isBeta:!0},{id:"bookmarks",label:"Bookmarks",isBeta:!1}];function ACe(){const{theme:e,toggle:t}=t6(),{betaEnabled:r,tabOverrides:n,setBetaEnabled:a,setTabVisibility:i,reset:o}=fV(),l=()=>{o(),typeof window<"u"&&window.location.reload()},u=e==="dark"?K5:H5;return h.jsxs("div",{className:"max-w-3xl mx-auto p-6 space-y-8",children:[h.jsx("div",{children:h.jsxs(ic,{to:"/",className:"inline-flex items-center gap-1.5 text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100",children:[h.jsx(vd,{size:16}),"Back to Overview"]})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Settings"}),h.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Customize appearance and which dashboard tabs are visible."})]}),h.jsxs("section",{className:"bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 p-5",children:[h.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Appearance"}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Switch between dark and light mode. Persists across reloads."}),h.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(u,{size:18,className:"text-gray-600 dark:text-gray-400"}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Theme"}),h.jsxs("div",{className:"text-xs text-gray-500",children:["Current: ",h.jsx("span",{className:"font-mono",children:e})]})]})]}),h.jsxs("button",{onClick:t,className:"px-3 py-1.5 text-sm rounded border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200 hover:border-gray-400 dark:hover:border-gray-600",children:["Switch to ",e==="dark"?"light":"dark"]})]})]}),h.jsxs("section",{className:"bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 p-5",children:[h.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Beta features"}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Heuristic features that may not be fully reliable yet. Turn this off to hide BETA-tagged tabs on project dashboards."}),h.jsxs("label",{className:"mt-4 flex items-center justify-between cursor-pointer",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Show beta features"}),h.jsx("div",{className:"text-xs text-gray-500",children:r?"Beta tabs are visible by default.":"Beta tabs are hidden by default."})]}),h.jsx("input",{type:"checkbox",checked:r,onChange:d=>a(d.target.checked),className:"h-4 w-4 accent-indigo-600","aria-label":"Show beta features"})]})]}),h.jsxs("section",{className:"bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 p-5",children:[h.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Tab visibility"}),h.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[h.jsx("span",{className:"font-medium",children:"Default"})," follows the beta toggle for BETA tabs (shown if the toggle is on) and always shows stable tabs."," ",h.jsx("span",{className:"font-medium",children:"Shown"})," and"," ",h.jsx("span",{className:"font-medium",children:"Hidden"})," override that."]}),h.jsx("div",{className:"mt-4 divide-y divide-gray-200 dark:divide-gray-800",children:_Ce.map(d=>{const p=n[d.id]??"default";return h.jsxs("div",{className:"flex items-center justify-between py-2.5 first:pt-0 last:pb-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm text-gray-900 dark:text-gray-100",children:d.label}),d.isBeta&&h.jsx(hV,{})]}),h.jsxs("select",{value:p,onChange:f=>i(d.id,f.target.value),className:"bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded px-2 py-1 text-xs text-gray-700 dark:text-gray-300 focus:outline-none focus:border-indigo-500","aria-label":`Visibility for ${d.label} tab`,children:[h.jsx("option",{value:"default",children:"Default"}),h.jsx("option",{value:"shown",children:"Shown"}),h.jsx("option",{value:"hidden",children:"Hidden"})]})]},d.id)})})]}),h.jsxs("section",{className:"bg-white dark:bg-gray-900 rounded-lg border border-red-200 dark:border-red-900/50 p-5",children:[h.jsx("h2",{className:"text-base font-semibold text-red-700 dark:text-red-400",children:"Danger zone"}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Clears beta toggle and tab overrides, then reloads the page. Your theme, bookmarks, and project data are not touched."}),h.jsx("button",{onClick:l,className:"mt-4 px-3 py-1.5 text-sm rounded border border-red-300 dark:border-red-800 text-red-700 dark:text-red-400 bg-white dark:bg-gray-900 hover:bg-red-50 dark:hover:bg-red-900/20",children:"Reset all settings to defaults"})]})]})}function TCe(){const[e,t]=P.useState(!1);return h.jsxs("div",{className:"h-screen w-screen bg-white dark:bg-gray-950 flex flex-col",children:[h.jsx(aZ,{onToggleChat:()=>t(r=>!r),chatOpen:e}),h.jsx("main",{className:"flex-1 overflow-auto",children:h.jsxs(ZK,{children:[h.jsx(yf,{path:"/",element:h.jsx(qTe,{})}),h.jsx(yf,{path:"/project/:name",element:h.jsx(kCe,{})}),h.jsx(yf,{path:"/settings",element:h.jsx(ACe,{})})]})}),h.jsx(Ade,{open:e,onClose:()=>t(!1)})]})}function NCe(){return h.jsx(aY,{children:h.jsx(TCe,{})})}class OCe extends P.Component{constructor(r){super(r);TI(this,"handleReset",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){console.error("ErrorBoundary caught:",r,n)}render(){var r;return this.state.hasError?this.props.fallback?this.props.fallback:h.jsx("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:h.jsxs("div",{className:"rounded-lg border border-red-300 dark:border-red-800 bg-red-100 dark:bg-red-900/30 p-4 max-w-md",children:[h.jsx("h3",{className:"text-red-700 dark:text-red-400 font-semibold text-sm mb-1",children:"Something went wrong"}),h.jsx("p",{className:"text-red-700/80 dark:text-red-300/70 text-xs mb-3",children:((r=this.state.error)==null?void 0:r.message)||"An unexpected error occurred"}),h.jsx("button",{onClick:this.handleReset,className:"px-3 py-1.5 text-xs font-medium rounded bg-red-600 dark:bg-red-800 text-white dark:text-red-200 hover:bg-red-700 dark:hover:bg-red-700 transition-colors",children:"Try again"})]})}):this.props.children}}(function(){try{(window.localStorage.getItem("suf:theme")==="light"?"light":"dark")==="light"?document.documentElement.classList.remove("dark"):document.documentElement.classList.add("dark")}catch{document.documentElement.classList.add("dark")}})();const CCe=new W7({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}}});E7.createRoot(document.getElementById("root")).render(h.jsx(U.StrictMode,{children:h.jsx(V7,{client:CCe,children:h.jsx(OCe,{children:h.jsx(NCe,{})})})})); diff --git a/stackunderflow/static/react/assets/index-qtmhGLlT.css b/stackunderflow/static/react/assets/index-qtmhGLlT.css deleted file mode 100644 index 0aef3b4..0000000 --- a/stackunderflow/static/react/assets/index-qtmhGLlT.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(102 126 234 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(102 126 234 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: rgb(17 24 39 / 10%);--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%);--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-invert{--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-3{left:.75rem}.right-0{right:0}.top-1\/2{top:50%}.top-5{top:1.25rem}.top-full{top:100%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.-mb-px{margin-bottom:-1px}.-mr-0\.5{margin-right:-.125rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-2{margin-left:.5rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-64{height:16rem}.h-8{height:2rem}.h-80{height:20rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-24{max-height:6rem}.max-h-40{max-height:10rem}.max-h-60{max-height:15rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[70vh\]{max-height:70vh}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-52{width:13rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-80{width:20rem}.w-96{width:24rem}.w-full{width:100%}.w-screen{width:100vw}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.max-w-3xl{max-width:48rem}.max-w-7xl{max-width:80rem}.max-w-\[180px\]{max-width:180px}.max-w-\[240px\]{max-width:240px}.max-w-\[85\%\]{max-width:85%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity, 1))}.divide-indigo-900\/20>:not([hidden])~:not([hidden]){border-color:#312e8133}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-t{border-top-width:1px}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-amber-500\/30{border-color:#f59e0b4d}.border-amber-600\/50{border-color:#d9770680}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(162 173 249 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(102 126 234 / var(--tw-border-opacity, 1))}.border-blue-500\/30{border-color:#667eea4d}.border-cyan-300{--tw-border-opacity: 1;border-color:rgb(103 232 249 / var(--tw-border-opacity, 1))}.border-emerald-300{--tw-border-opacity: 1;border-color:rgb(110 231 183 / var(--tw-border-opacity, 1))}.border-emerald-500\/30{border-color:#10b9814d}.border-gray-100\/30{border-color:#f3f4f64d}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-200\/50{border-color:#e5e7eb80}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.border-green-300{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-800{--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.border-indigo-300{--tw-border-opacity: 1;border-color:rgb(165 180 252 / var(--tw-border-opacity, 1))}.border-indigo-400{--tw-border-opacity: 1;border-color:rgb(129 140 248 / var(--tw-border-opacity, 1))}.border-indigo-500\/30{border-color:#6366f14d}.border-indigo-500\/40{border-color:#6366f166}.border-indigo-500\/50{border-color:#6366f180}.border-indigo-500\/60{border-color:#6366f199}.border-indigo-700{--tw-border-opacity: 1;border-color:rgb(67 56 202 / var(--tw-border-opacity, 1))}.border-indigo-800\/60{border-color:#3730a399}.border-indigo-900\/30{border-color:#312e814d}.border-indigo-900\/40{border-color:#312e8166}.border-indigo-900\/50{border-color:#312e8180}.border-orange-300{--tw-border-opacity: 1;border-color:rgb(253 186 116 / var(--tw-border-opacity, 1))}.border-pink-300{--tw-border-opacity: 1;border-color:rgb(249 168 212 / var(--tw-border-opacity, 1))}.border-purple-300{--tw-border-opacity: 1;border-color:rgb(216 180 254 / var(--tw-border-opacity, 1))}.border-purple-500\/30{border-color:#a855f74d}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.border-red-900\/30{border-color:#7f1d1d4d}.border-red-900\/40{border-color:#7f1d1d66}.border-rose-300{--tw-border-opacity: 1;border-color:rgb(253 164 175 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-300{--tw-border-opacity: 1;border-color:rgb(253 224 71 / var(--tw-border-opacity, 1))}.border-yellow-800{--tw-border-opacity: 1;border-color:rgb(133 77 14 / var(--tw-border-opacity, 1))}.border-zinc-200{--tw-border-opacity: 1;border-color:rgb(228 228 231 / var(--tw-border-opacity, 1))}.border-t-blue-500{--tw-border-opacity: 1;border-top-color:rgb(102 126 234 / var(--tw-border-opacity, 1))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-amber-500\/20{background-color:#f59e0b33}.bg-amber-600\/20{background-color:#d9770633}.bg-black\/60{background-color:#0009}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(224 228 253 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(102 126 234 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#667eea1a}.bg-blue-500\/20{background-color:#667eea33}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(90 111 216 / var(--tw-bg-opacity, 1))}.bg-cyan-100{--tw-bg-opacity: 1;background-color:rgb(207 250 254 / var(--tw-bg-opacity, 1))}.bg-emerald-100{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-emerald-500\/20{background-color:#10b98133}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-gray-100\/40{background-color:#f3f4f666}.bg-gray-100\/50{background-color:#f3f4f680}.bg-gray-100\/60{background-color:#f3f4f699}.bg-gray-100\/70{background-color:#f3f4f6b3}.bg-gray-100\/80{background-color:#f3f4f6cc}.bg-gray-100\/90{background-color:#f3f4f6e6}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-200\/50{background-color:#e5e7eb80}.bg-gray-200\/60{background-color:#e5e7eb99}.bg-gray-200\/80{background-color:#e5e7ebcc}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-50\/30{background-color:#f9fafb4d}.bg-gray-50\/40{background-color:#f9fafb66}.bg-gray-50\/50{background-color:#f9fafb80}.bg-gray-50\/60{background-color:#f9fafb99}.bg-gray-50\/70{background-color:#f9fafbb3}.bg-gray-50\/80{background-color:#f9fafbcc}.bg-gray-50\/95{background-color:#f9fafbf2}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(99 102 241 / var(--tw-bg-opacity, 1))}.bg-indigo-500\/20{background-color:#6366f133}.bg-indigo-500\/25{background-color:#6366f140}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-indigo-600\/20{background-color:#4f46e533}.bg-indigo-950\/30{background-color:#1e1b4b4d}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-pink-100{--tw-bg-opacity: 1;background-color:rgb(252 231 243 / var(--tw-bg-opacity, 1))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/15{background-color:#a855f726}.bg-purple-500\/20{background-color:#a855f733}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500\/70{background-color:#ef4444b3}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-rose-100{--tw-bg-opacity: 1;background-color:rgb(255 228 230 / var(--tw-bg-opacity, 1))}.bg-violet-600{--tw-bg-opacity: 1;background-color:rgb(124 58 237 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-zinc-50\/50{background-color:#fafafa80}.bg-zinc-50\/60{background-color:#fafafa99}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-indigo-900\/30{--tw-gradient-from: rgb(49 46 129 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 46 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-900\/40{--tw-gradient-from: rgb(49 46 129 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 46 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-900\/20{--tw-gradient-from: rgb(127 29 29 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(127 29 29 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-900\/30{--tw-gradient-from: rgb(127 29 29 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(127 29 29 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-gray-50\/50{--tw-gradient-to: rgb(249 250 251 / .5) var(--tw-gradient-to-position)}.to-gray-50\/60{--tw-gradient-to: rgb(249 250 251 / .6) var(--tw-gradient-to-position)}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-7{padding-left:1.75rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-3{padding-right:.75rem}.pr-6{padding-right:1.5rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-1\.5{padding-top:.375rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.normal-case{text-transform:none}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-normal{letter-spacing:0em}.tracking-wider{letter-spacing:.05em}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-blue-200{--tw-text-opacity: 1;color:rgb(193 200 251 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(162 173 249 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(132 148 239 / var(--tw-text-opacity, 1))}.text-blue-400\/70{color:#8494efb3}.text-blue-800{--tw-text-opacity: 1;color:rgb(59 71 152 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-cyan-800{--tw-text-opacity: 1;color:rgb(21 94 117 / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-400\/80{color:#34d399cc}.text-emerald-800{--tw-text-opacity: 1;color:rgb(6 95 70 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-indigo-200{--tw-text-opacity: 1;color:rgb(199 210 254 / var(--tw-text-opacity, 1))}.text-indigo-300{--tw-text-opacity: 1;color:rgb(165 180 252 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-indigo-600\/80{color:#4f46e5cc}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-indigo-800{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-pink-400{--tw-text-opacity: 1;color:rgb(244 114 182 / var(--tw-text-opacity, 1))}.text-pink-800{--tw-text-opacity: 1;color:rgb(157 23 77 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-400\/70{color:#c084fcb3}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-700\/80{color:#b91c1ccc}.text-red-700\/90{color:#b91c1ce6}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-rose-800{--tw-text-opacity: 1;color:rgb(159 18 57 / var(--tw-text-opacity, 1))}.text-violet-400{--tw-text-opacity: 1;color:rgb(167 139 250 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(113 63 18 / var(--tw-text-opacity, 1))}.text-zinc-500{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity, 1))}.text-zinc-600{--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity, 1))}.text-zinc-700{--tw-text-opacity: 1;color:rgb(63 63 70 / var(--tw-text-opacity, 1))}.text-zinc-800{--tw-text-opacity: 1;color:rgb(39 39 42 / var(--tw-text-opacity, 1))}.text-zinc-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.placeholder-zinc-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(113 113 122 / var(--tw-placeholder-opacity, 1))}.placeholder-zinc-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(113 113 122 / var(--tw-placeholder-opacity, 1))}.accent-indigo-600{accent-color:#4f46e5}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-indigo-400\/70{--tw-ring-color: rgb(129 140 248 / .7)}.\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\[suf\:beta\]{suf:beta}.\[suf\:tabs\]{suf:tabs}.\[suf\:theme\]{suf:theme}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#f3f4f6}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#9ca3af}html.dark ::-webkit-scrollbar-track{background:#111827}html.dark ::-webkit-scrollbar-thumb{background:#374151}html.dark ::-webkit-scrollbar-thumb:hover{background:#4b5563}pre code{font-family:JetBrains Mono,Fira Code,Monaco,Consolas,monospace}.prose-invert{--tw-prose-body: rgb(55 65 81);--tw-prose-headings: rgb(17 24 39);--tw-prose-links: rgb(67 56 202);--tw-prose-bold: rgb(17 24 39);--tw-prose-counters: rgb(107 114 128);--tw-prose-bullets: rgb(156 163 175);--tw-prose-hr: rgb(229 231 235);--tw-prose-quotes: rgb(17 24 39);--tw-prose-quote-borders: rgb(229 231 235);--tw-prose-captions: rgb(107 114 128);--tw-prose-code: rgb(29 78 216);--tw-prose-pre-code: rgb(55 65 81);--tw-prose-pre-bg: rgb(243 244 246);--tw-prose-th-borders: rgb(229 231 235);--tw-prose-td-borders: rgb(243 244 246)}html.dark .prose-invert{--tw-prose-body: rgb(209 213 219);--tw-prose-headings: rgb(243 244 246);--tw-prose-links: rgb(96 165 250);--tw-prose-bold: rgb(243 244 246);--tw-prose-counters: rgb(156 163 175);--tw-prose-bullets: rgb(107 114 128);--tw-prose-hr: rgb(55 65 81);--tw-prose-quotes: rgb(243 244 246);--tw-prose-quote-borders: rgb(55 65 81);--tw-prose-captions: rgb(156 163 175);--tw-prose-code: rgb(147 197 253);--tw-prose-pre-code: rgb(209 213 219);--tw-prose-pre-bg: rgb(17 24 39);--tw-prose-th-borders: rgb(55 65 81);--tw-prose-td-borders: rgb(31 41 55)}.animate-spin{transition:none}.first\:pt-0:first-child{padding-top:0}.last\:pb-0:last-child{padding-bottom:0}.hover\:border-gray-200:hover{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.hover\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.hover\:border-zinc-200:hover{--tw-border-opacity: 1;border-color:rgb(228 228 231 / var(--tw-border-opacity, 1))}.hover\:bg-amber-500\/25:hover{background-color:#f59e0b40}.hover\:bg-amber-500\/30:hover{background-color:#f59e0b4d}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(102 126 234 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-500\/30:hover{background-color:#667eea4d}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(74 90 184 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-500\/30:hover{background-color:#10b9814d}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100\/50:hover{background-color:#f3f4f680}.hover\:bg-gray-100\/60:hover{background-color:#f3f4f699}.hover\:bg-gray-100\/70:hover{background-color:#f3f4f6b3}.hover\:bg-gray-100\/80:hover{background-color:#f3f4f6cc}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200\/70:hover{background-color:#e5e7ebb3}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50\/70:hover{background-color:#f9fafbb3}.hover\:bg-indigo-500\/30:hover{background-color:#6366f14d}.hover\:bg-purple-500\/25:hover{background-color:#a855f740}.hover\:bg-purple-500\/30:hover{background-color:#a855f74d}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-300:hover{--tw-bg-opacity: 1;background-color:rgb(252 165 165 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-zinc-200:hover{--tw-bg-opacity: 1;background-color:rgb(228 228 231 / var(--tw-bg-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(162 173 249 / var(--tw-text-opacity, 1))}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(132 148 239 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-indigo-300:hover{--tw-text-opacity: 1;color:rgb(165 180 252 / var(--tw-text-opacity, 1))}.hover\:text-indigo-400:hover{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.hover\:text-indigo-800:hover{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-red-800:hover{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-70:hover{opacity:.7}.hover\:brightness-125:hover{--tw-brightness: brightness(1.25);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(102 126 234 / var(--tw-border-opacity, 1))}.focus\:border-blue-600:focus{--tw-border-opacity: 1;border-color:rgb(90 111 216 / var(--tw-border-opacity, 1))}.focus\:border-indigo-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.focus\:border-zinc-500:focus{--tw-border-opacity: 1;border-color:rgb(113 113 122 / var(--tw-border-opacity, 1))}.focus\:bg-gray-100\/60:focus{background-color:#f3f4f699}.focus\:bg-gray-100\/70:focus{background-color:#f3f4f6b3}.focus\:bg-gray-100\/80:focus{background-color:#f3f4f6cc}.focus\:bg-red-100:focus{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.focus\:text-indigo-800:focus{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(90 111 216 / var(--tw-ring-opacity, 1))}.focus\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-indigo-500\/60:focus{--tw-ring-color: rgb(99 102 241 / .6)}.focus\:ring-offset-0:focus{--tw-ring-offset-width: 0px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-blue-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(102 126 234 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-indigo-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(129 140 248 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-300:disabled{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.disabled\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:focus-within .group-focus-within\:opacity-100{opacity:1}.group:hover .group-hover\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:opacity-100{opacity:1}.group:focus .group-focus\:opacity-100{opacity:1}.prose-headings\:font-semibold :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){font-weight:600}.prose-headings\:text-gray-800 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.prose-p\:leading-relaxed :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){line-height:1.625}.prose-p\:text-gray-700 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.prose-a\:text-blue-400 :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(132 148 239 / var(--tw-text-opacity, 1))}.prose-a\:no-underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:none}.hover\:prose-a\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))):hover{text-decoration-line:underline}.prose-blockquote\:border-gray-300 :is(:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.prose-blockquote\:text-gray-600 :is(:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.prose-strong\:text-gray-800 :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.prose-code\:rounded :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:.25rem}.prose-code\:bg-gray-100 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.prose-code\:px-1 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){padding-left:.25rem;padding-right:.25rem}.prose-code\:py-0\.5 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){padding-top:.125rem;padding-bottom:.125rem}.prose-code\:text-xs :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:.75rem;line-height:1rem}.prose-code\:text-blue-700 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(74 90 184 / var(--tw-text-opacity, 1))}.prose-code\:before\:content-none :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):before{--tw-content: none;content:var(--tw-content)}.prose-code\:after\:content-none :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):after{--tw-content: none;content:var(--tw-content)}.prose-pre\:bg-transparent :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){background-color:transparent}.prose-pre\:p-0 :is(:where(pre):not(:where([class~=not-prose],[class~=not-prose] *))){padding:0}.prose-li\:text-gray-700 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.prose-th\:text-gray-700 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.prose-td\:text-gray-600 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.prose-hr\:border-gray-300 :is(:where(hr):not(:where([class~=not-prose],[class~=not-prose] *))){--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.dark\:divide-gray-800:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(31 41 55 / var(--tw-divide-opacity, 1))}.dark\:border-amber-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(180 83 9 / var(--tw-border-opacity, 1))}.dark\:border-amber-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.dark\:border-amber-800\/60:is(.dark *){border-color:#92400e99}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(74 90 184 / var(--tw-border-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(59 71 152 / var(--tw-border-opacity, 1))}.dark\:border-blue-800\/60:is(.dark *){border-color:#3b479899}.dark\:border-cyan-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(14 116 144 / var(--tw-border-opacity, 1))}.dark\:border-cyan-800\/60:is(.dark *){border-color:#155e7599}.dark\:border-emerald-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(4 120 87 / var(--tw-border-opacity, 1))}.dark\:border-emerald-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(6 95 70 / var(--tw-border-opacity, 1))}.dark\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-gray-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.dark\:border-gray-800\/30:is(.dark *){border-color:#1f29374d}.dark\:border-gray-800\/50:is(.dark *){border-color:#1f293780}.dark\:border-green-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-green-800\/60:is(.dark *){border-color:#16653499}.dark\:border-indigo-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(67 56 202 / var(--tw-border-opacity, 1))}.dark\:border-indigo-800\/60:is(.dark *){border-color:#3730a399}.dark\:border-orange-800\/60:is(.dark *){border-color:#9a341299}.dark\:border-pink-800\/60:is(.dark *){border-color:#9d174d99}.dark\:border-purple-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity, 1))}.dark\:border-purple-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(107 33 168 / var(--tw-border-opacity, 1))}.dark\:border-purple-800\/60:is(.dark *){border-color:#6b21a899}.dark\:border-red-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.dark\:border-red-800\/60:is(.dark *){border-color:#991b1b99}.dark\:border-red-900\/40:is(.dark *){border-color:#7f1d1d66}.dark\:border-red-900\/50:is(.dark *){border-color:#7f1d1d80}.dark\:border-red-900\/60:is(.dark *){border-color:#7f1d1d99}.dark\:border-rose-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(190 18 60 / var(--tw-border-opacity, 1))}.dark\:border-rose-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(159 18 57 / var(--tw-border-opacity, 1))}.dark\:border-yellow-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(133 77 14 / var(--tw-border-opacity, 1))}.dark\:border-yellow-800\/60:is(.dark *){border-color:#854d0e99}.dark\:border-zinc-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(63 63 70 / var(--tw-border-opacity, 1))}.dark\:border-zinc-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity, 1))}.dark\:bg-amber-900\/20:is(.dark *){background-color:#78350f33}.dark\:bg-amber-900\/30:is(.dark *){background-color:#78350f4d}.dark\:bg-amber-900\/40:is(.dark *){background-color:#78350f66}.dark\:bg-amber-900\/50:is(.dark *){background-color:#78350f80}.dark\:bg-blue-900\/40:is(.dark *){background-color:#2c357866}.dark\:bg-blue-900\/50:is(.dark *){background-color:#2c357880}.dark\:bg-blue-900\/60:is(.dark *){background-color:#2c357899}.dark\:bg-cyan-900\/40:is(.dark *){background-color:#164e6366}.dark\:bg-cyan-900\/50:is(.dark *){background-color:#164e6380}.dark\:bg-emerald-900\/40:is(.dark *){background-color:#064e3b66}.dark\:bg-emerald-900\/50:is(.dark *){background-color:#064e3b80}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700\/40:is(.dark *){background-color:#37415166}.dark\:bg-gray-700\/50:is(.dark *){background-color:#37415180}.dark\:bg-gray-700\/60:is(.dark *){background-color:#37415199}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/20:is(.dark *){background-color:#1f293733}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/40:is(.dark *){background-color:#1f293766}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-800\/60:is(.dark *){background-color:#1f293799}.dark\:bg-gray-800\/80:is(.dark *){background-color:#1f2937cc}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900\/30:is(.dark *){background-color:#1118274d}.dark\:bg-gray-900\/40:is(.dark *){background-color:#11182766}.dark\:bg-gray-900\/60:is(.dark *){background-color:#11182799}.dark\:bg-gray-900\/95:is(.dark *){background-color:#111827f2}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950\/50:is(.dark *){background-color:#03071280}.dark\:bg-gray-950\/60:is(.dark *){background-color:#03071299}.dark\:bg-green-900\/40:is(.dark *){background-color:#14532d66}.dark\:bg-green-900\/50:is(.dark *){background-color:#14532d80}.dark\:bg-indigo-900\/40:is(.dark *){background-color:#312e8166}.dark\:bg-indigo-900\/50:is(.dark *){background-color:#312e8180}.dark\:bg-orange-900\/40:is(.dark *){background-color:#7c2d1266}.dark\:bg-pink-900\/40:is(.dark *){background-color:#83184366}.dark\:bg-purple-900\/40:is(.dark *){background-color:#581c8766}.dark\:bg-purple-900\/50:is(.dark *){background-color:#581c8780}.dark\:bg-red-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(153 27 27 / var(--tw-bg-opacity, 1))}.dark\:bg-red-900\/20:is(.dark *){background-color:#7f1d1d33}.dark\:bg-red-900\/30:is(.dark *){background-color:#7f1d1d4d}.dark\:bg-red-900\/50:is(.dark *){background-color:#7f1d1d80}.dark\:bg-red-950\/30:is(.dark *){background-color:#450a0a4d}.dark\:bg-rose-900\/40:is(.dark *){background-color:#88133766}.dark\:bg-rose-900\/50:is(.dark *){background-color:#88133780}.dark\:bg-yellow-500\/30:is(.dark *){background-color:#eab3084d}.dark\:bg-yellow-900\/20:is(.dark *){background-color:#713f1233}.dark\:bg-yellow-900\/40:is(.dark *){background-color:#713f1266}.dark\:bg-yellow-900\/50:is(.dark *){background-color:#713f1280}.dark\:bg-zinc-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity, 1))}.dark\:bg-zinc-900\/50:is(.dark *){background-color:#18181b80}.dark\:bg-zinc-900\/60:is(.dark *){background-color:#18181b99}.dark\:to-gray-900\/30:is(.dark *){--tw-gradient-to: rgb(17 24 39 / .3) var(--tw-gradient-to-position)}.dark\:to-gray-900\/40:is(.dark *){--tw-gradient-to: rgb(17 24 39 / .4) var(--tw-gradient-to-position)}.dark\:text-amber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(193 200 251 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(162 173 249 / var(--tw-text-opacity, 1))}.dark\:text-cyan-300:is(.dark *){--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.dark\:text-emerald-300:is(.dark *){--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-indigo-200:is(.dark *){--tw-text-opacity: 1;color:rgb(199 210 254 / var(--tw-text-opacity, 1))}.dark\:text-indigo-300:is(.dark *){--tw-text-opacity: 1;color:rgb(165 180 252 / var(--tw-text-opacity, 1))}.dark\:text-indigo-400\/80:is(.dark *){color:#818cf8cc}.dark\:text-orange-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.dark\:text-pink-300:is(.dark *){--tw-text-opacity: 1;color:rgb(249 168 212 / var(--tw-text-opacity, 1))}.dark\:text-purple-300:is(.dark *){--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.dark\:text-red-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-300\/70:is(.dark *){color:#fca5a5b3}.dark\:text-red-300\/80:is(.dark *){color:#fca5a5cc}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-red-400\/80:is(.dark *){color:#f87171cc}.dark\:text-rose-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 164 175 / var(--tw-text-opacity, 1))}.dark\:text-yellow-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:text-zinc-100:is(.dark *){--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity, 1))}.dark\:text-zinc-200:is(.dark *){--tw-text-opacity: 1;color:rgb(228 228 231 / var(--tw-text-opacity, 1))}.dark\:text-zinc-300:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity, 1))}.dark\:text-zinc-400:is(.dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity, 1))}.dark\:placeholder-gray-600:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.dark\:placeholder-gray-600:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity, 1))}.dark\:hover\:border-gray-600:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:hover\:border-gray-700:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:hover\:border-zinc-700:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(63 63 70 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700\/50:hover:is(.dark *){background-color:#37415180}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-800\/30:hover:is(.dark *){background-color:#1f29374d}.dark\:hover\:bg-gray-800\/40:hover:is(.dark *){background-color:#1f293766}.dark\:hover\:bg-gray-800\/50:hover:is(.dark *){background-color:#1f293780}.dark\:hover\:bg-gray-800\/60:hover:is(.dark *){background-color:#1f293799}.dark\:hover\:bg-gray-900\/70:hover:is(.dark *){background-color:#111827b3}.dark\:hover\:bg-red-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-900\/20:hover:is(.dark *){background-color:#7f1d1d33}.dark\:hover\:bg-red-900\/30:hover:is(.dark *){background-color:#7f1d1d4d}.dark\:hover\:bg-red-900\/70:hover:is(.dark *){background-color:#7f1d1db3}.dark\:hover\:bg-zinc-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-gray-100:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:hover\:text-indigo-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(199 210 254 / var(--tw-text-opacity, 1))}.dark\:hover\:text-red-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:hover\:text-red-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:focus\:bg-gray-800\/40:focus:is(.dark *){background-color:#1f293766}.dark\:focus\:bg-gray-800\/50:focus:is(.dark *){background-color:#1f293780}.dark\:focus\:bg-gray-800\/60:focus:is(.dark *){background-color:#1f293799}.dark\:focus\:bg-red-900\/20:focus:is(.dark *){background-color:#7f1d1d33}.dark\:focus\:text-indigo-200:focus:is(.dark *){--tw-text-opacity: 1;color:rgb(199 210 254 / var(--tw-text-opacity, 1))}.dark\:focus-visible\:ring-gray-600:focus-visible:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity, 1))}.dark\:disabled\:bg-gray-700:disabled:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:prose-headings\:text-gray-200 :is(:where(h1,h2,h3,h4,h5,h6,th):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:prose-p\:text-gray-300 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:prose-blockquote\:border-gray-700 :is(:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:prose-blockquote\:text-gray-400 :is(:where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:prose-strong\:text-gray-200 :is(:where(strong):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:prose-code\:bg-gray-800 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:prose-code\:text-blue-300 :is(:where(code):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(162 173 249 / var(--tw-text-opacity, 1))}.dark\:prose-li\:text-gray-300 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:prose-th\:text-gray-300 :is(:where(th):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:prose-td\:text-gray-400 :is(:where(td):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:prose-hr\:border-gray-700 :is(:where(hr):not(:where([class~=not-prose],[class~=not-prose] *))):is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}@media(min-width:640px){.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media(min-width:768px){.md\:flex{display:flex}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(min-width:1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}} diff --git a/stackunderflow/static/react/index.html b/stackunderflow/static/react/index.html index 891385a..8a09af7 100644 --- a/stackunderflow/static/react/index.html +++ b/stackunderflow/static/react/index.html @@ -5,8 +5,8 @@ StackUnderflow - - + +