@townco/gui-template 0.1.45 → 0.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.html CHANGED
@@ -4,14 +4,14 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Agent Chat</title>
7
- <script type="module" crossorigin src="/assets/index-BqR3IDEZ.js"></script>
8
- <link rel="modulepreload" crossorigin href="/assets/vendor-CDPxlbZ6.js">
9
- <link rel="modulepreload" crossorigin href="/assets/react-BxIc-aOD.js">
10
- <link rel="modulepreload" crossorigin href="/assets/acp-sdk-CrD5QpoU.js">
11
- <link rel="modulepreload" crossorigin href="/assets/radix-BwF8w229.js">
12
- <link rel="modulepreload" crossorigin href="/assets/icons-DfHRHe9q.js">
13
- <link rel="modulepreload" crossorigin href="/assets/markdown-PIOGdvNw.js">
14
- <link rel="stylesheet" crossorigin href="/assets/index-CDHFf0CG.css">
7
+ <script type="module" crossorigin src="/assets/index-B6fygXSL.js"></script>
8
+ <link rel="modulepreload" crossorigin href="/assets/vendor-CUKdmeyB.js">
9
+ <link rel="modulepreload" crossorigin href="/assets/react-BI2u9DiD.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/acp-sdk-Di8e5Dye.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/radix-KR7-sTVt.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/icons-BUTFY4lS.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/markdown-DIQS9ihV.js">
14
+ <link rel="stylesheet" crossorigin href="/assets/index-Bu11KnLt.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@townco/gui-template",
3
- "version": "0.1.45",
3
+ "version": "0.1.47",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -19,15 +19,15 @@
19
19
  "check": "tsc --noEmit"
20
20
  },
21
21
  "dependencies": {
22
- "@townco/core": "0.0.26",
23
- "@townco/ui": "0.1.48",
22
+ "@townco/core": "0.0.28",
23
+ "@townco/ui": "0.1.50",
24
24
  "lucide-react": "^0.552.0",
25
25
  "react": "^19.2.0",
26
26
  "react-dom": "^19.2.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@tailwindcss/postcss": "^4.1.17",
30
- "@townco/tsconfig": "0.1.45",
30
+ "@townco/tsconfig": "0.1.47",
31
31
  "@types/react": "^19.2.2",
32
32
  "@types/react-dom": "^19.2.2",
33
33
  "@vitejs/plugin-react": "^5.1.0",
package/src/App.tsx CHANGED
@@ -9,7 +9,12 @@ function App() {
9
9
 
10
10
  return (
11
11
  <ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
12
- <ChatView client={client} initialSessionId={sessionId} error={error} />
12
+ <ChatView
13
+ client={client}
14
+ initialSessionId={sessionId}
15
+ error={error}
16
+ {...(config.debuggerUrl && { debuggerUrl: config.debuggerUrl })}
17
+ />
13
18
  </ThemeProvider>
14
19
  );
15
20
  }
package/src/config.ts CHANGED
@@ -6,9 +6,18 @@ export function getAgentServerUrl(): string {
6
6
  return import.meta.env.VITE_AGENT_URL || "http://localhost:3000";
7
7
  }
8
8
 
9
+ /**
10
+ * Get the debugger URL from environment variables
11
+ * Injected by `town run --gui`
12
+ */
13
+ export function getDebuggerUrl(): string | undefined {
14
+ return import.meta.env.VITE_DEBUGGER_URL;
15
+ }
16
+
9
17
  /**
10
18
  * Application configuration
11
19
  */
12
20
  export const config = {
13
21
  agentServerUrl: getAgentServerUrl(),
22
+ debuggerUrl: getDebuggerUrl(),
14
23
  } as const;
package/vite.config.ts CHANGED
@@ -49,6 +49,13 @@ export default defineConfig({
49
49
  "@": path.resolve(__dirname, "./src"),
50
50
  },
51
51
  dedupe: ["react", "react-dom"],
52
+ conditions: ["development", "import"],
53
+ },
54
+ server: {
55
+ fs: {
56
+ // Allow serving files from the monorepo root
57
+ allow: ["../.."],
58
+ },
52
59
  },
53
60
  optimizeDeps: {
54
61
  exclude: [],
@@ -1 +0,0 @@
1
- import{r as s}from"./react-BxIc-aOD.js";const _=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,t,c)=>c?c.toUpperCase():t.toLowerCase()),h=o=>{const a=m(o);return a.charAt(0).toUpperCase()+a.slice(1)},i=(...o)=>o.filter((a,t,c)=>!!a&&a.trim()!==""&&c.indexOf(a)===t).join(" ").trim(),u=o=>{for(const a in o)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const M=s.forwardRef(({color:o="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:c,className:r="",children:n,iconNode:l,...d},p)=>s.createElement("svg",{ref:p,...v,width:a,height:a,stroke:o,strokeWidth:c?Number(t)*24/Number(a):t,className:i("lucide",r),...!n&&!u(d)&&{"aria-hidden":"true"},...d},[...l.map(([y,k])=>s.createElement(y,k)),...Array.isArray(n)?n:[n]]));const e=(o,a)=>{const t=s.forwardRef(({className:c,...r},n)=>s.createElement(M,{ref:n,iconNode:a,className:i(`lucide-${_(h(o))}`,`lucide-${o}`,c),...r}));return t.displayName=h(o),t};const g=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],a1=e("arrow-down",g);const w=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],o1=e("arrow-up",w);const x=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t1=e("check",x);const $=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],c1=e("chevron-down",$);const N=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],n1=e("chevron-right",N);const f=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],s1=e("chevron-up",f);const C=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],r1=e("chevrons-up-down",C);const b=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],d1=e("circle-check",b);const j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],h1=e("circle",j);const A=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],i1=e("cloud",A);const q=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],l1=e("code",q);const z=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],p1=e("database",z);const H=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],y1=e("ellipsis-vertical",H);const L=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],k1=e("file-code",L);const V=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],_1=e("file-text",V);const S=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],m1=e("folder-open",S);const E=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],u1=e("folder",E);const P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],v1=e("globe",P);const D=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],M1=e("link-2",D);const F=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],g1=e("link",F);const U=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w1=e("loader-circle",U);const R=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],x1=e("mic",R);const W=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],$1=e("moon",W);const Z=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],N1=e("panel-right",Z);const B=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],f1=e("paperclip",B);const G=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],C1=e("search",G);const I=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],b1=e("settings",I);const O=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],j1=e("sparkles",O);const K=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],A1=e("square-check-big",K);const T=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],q1=e("square-pen",T);const X=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],z1=e("square-slash",X);const J=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],H1=e("sun",J);const Q=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],L1=e("wrench",Q);const Y=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],V1=e("x",Y);export{a1 as A,n1 as C,p1 as D,y1 as E,m1 as F,v1 as G,M1 as L,x1 as M,f1 as P,z1 as S,L1 as W,V1 as X,t1 as a,h1 as b,u1 as c,k1 as d,c1 as e,d1 as f,A1 as g,_1 as h,j1 as i,b1 as j,l1 as k,o1 as l,N1 as m,s1 as n,q1 as o,C1 as p,i1 as q,g1 as r,r1 as s,w1 as t,H1 as u,$1 as v};
@@ -1,6 +0,0 @@
1
- import{r as l,j as e,P as hs,e as xs,f as bs,M as ys,h as ws,b as vs}from"./react-BxIc-aOD.js";import{P as Ee,a as js}from"./acp-sdk-CrD5QpoU.js";import{L as H,M as R,N as E,O as v,P as Le,Q as z,R as U,S as O,T as B,U as Ns,W as oe,X as pe,Y as Ss,Z as Cs,$ as ks,a0 as Ts,a1 as K,a2 as Is,a3 as Ae}from"./vendor-CDPxlbZ6.js";import{S as ae,a as Fe,b as Oe,P as Rs,C as Be,I as $e,c as He,d as Ve,R as We,L as qe,e as Qe,f as Es,T as As,g as Ge,h as Ke,i as Je,j as Ms,k as Ye,l as Ps,m as _s,n as Us,O as Xe,o as Ds,p as Ze,q as zs,r as et,D as tt,s as st,t as nt,u as Ls,v as ot,w as at,x as Fs,y as rt,V as Os,z as it,A as lt,B as Bs,E as $s,F as ct}from"./radix-BwF8w229.js";import{C as we,S as Hs,P as Vs,M as Ws,A as qs,a as dt,b as ve,F as Qs,c as Gs,d as Ks,E as Js,e as re,f as ut,g as je,h as Ne,D as pt,L as mt,i as Me,j as Ys,k as Xs,l as Zs,m as en,n as ft,X as tn,W as gt,o as sn,p as nn,q as on,r as an,G as rn,s as ln,t as cn,u as dn,v as un}from"./icons-DfHRHe9q.js";import{r as pn}from"./markdown-PIOGdvNw.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();var mn={};const de=typeof process<"u"&&process.versions?.node;let fn,gn=0;const hn=new Set;function xn(s){for(const t of hn)t(s)}const Pe={trace:0,debug:1,info:2,warn:3,error:4,fatal:5};class bn{service;minLevel;logFilePath;logsDir;writeQueue=[];isWriting=!1;enableConsoleOutput;constructor(t,n="debug"){this.service=t,this.minLevel=n,typeof process<"u"&&(this.minLevel="info"),this.enableConsoleOutput=typeof process<"u"&&mn?.TOWN_LOG_CONSOLE==="true"||!1}setupFileLogging(){}async writeToFile(t){if(!(!this.logFilePath||!de)&&(this.writeQueue.push(t),!this.isWriting)){for(this.isWriting=!0;this.writeQueue.length>0;){const o=`${this.writeQueue.splice(0,this.writeQueue.length).join(`
2
- `)}
3
- `;try{await require("node:fs").promises.appendFile(this.logFilePath,o,"utf-8")}catch{}}this.isWriting=!1}}shouldLog(t){return Pe[t]>=Pe[this.minLevel]}log(t,n,o){if(!this.shouldLog(t))return;const r={id:`log_${++gn}`,timestamp:new Date().toISOString(),level:t,service:this.service,message:n,...o&&{metadata:o}};if(xn(r),de&&this.logFilePath,de&&this.logFilePath){const i={timestamp:r.timestamp,level:r.level,service:r.service,message:r.message,...r.metadata&&{metadata:r.metadata}};this.writeToFile(JSON.stringify(i)).catch(()=>{})}if(de&&this.enableConsoleOutput){const i=r.timestamp,c=r.level.toUpperCase().padEnd(5),d=`[${this.service}]`,p=r.metadata?` ${JSON.stringify(r.metadata)}`:"";console.log(`${i} ${c} ${d} ${r.message}${p}`)}}trace(t,n){this.log("trace",t,n)}debug(t,n){this.log("debug",t,n)}info(t,n){this.log("info",t,n)}warn(t,n){this.log("warn",t,n)}error(t,n){this.log("error",t,n)}fatal(t,n){this.log("fatal",t,n)}}function q(s,t="debug"){return new bn(s,t)}const T=q("http-transport");class yn{connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;messageQueue=[];currentSessionId=null;chunkResolvers=[];streamComplete=!1;sseAbortController=null;reconnectAttempts=0;maxReconnectAttempts=5;reconnectDelay=1e3;reconnecting=!1;abortController=null;options;isReceivingMessages=!1;isInReplayMode=!1;agentInfo;constructor(t){this.options={...t,baseUrl:t.baseUrl.replace(/\/$/,"")}}async connect(){if(!this.connected)try{this.abortController=new AbortController;const t={protocolVersion:Ee,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},n=await this.sendRpcRequest("initialize",t);if(n.agentInfo){const i=n._meta&&typeof n._meta=="object"&&"agentDescription"in n._meta?String(n._meta.agentDescription):void 0,c=n._meta&&typeof n._meta=="object"&&"suggestedPrompts"in n._meta&&Array.isArray(n._meta.suggestedPrompts)?n._meta.suggestedPrompts:void 0;this.agentInfo={name:n.agentInfo.name,...n.agentInfo.title?{displayName:n.agentInfo.title}:{},version:n.agentInfo.version,...i?{description:i}:{},...c?{suggestedPrompts:c}:{}}}T.info("ACP connection initialized",{initResponse:n});const o={cwd:"/",mcpServers:[]},r=await this.sendRpcRequest("session/new",o);this.currentSessionId=r.sessionId,T.info("Session created",{sessionId:this.currentSessionId}),await this.connectSSE(),this.connected=!0,this.reconnectAttempts=0}catch(t){this.connected=!1;const n=t instanceof Error?t:new Error(String(t));throw this.notifyError(n),n}}async loadSession(t){this.connected&&(T.warn("Transport already connected, disconnecting first",{sessionId:t}),await this.disconnect());try{this.abortController=new AbortController;const n={protocolVersion:Ee,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}};T.info("Loading session - initializing connection",{sessionId:t});const o=await this.sendRpcRequest("initialize",n);if(o.agentInfo){const c=o._meta&&typeof o._meta=="object"&&"agentDescription"in o._meta?String(o._meta.agentDescription):void 0,d=o._meta&&typeof o._meta=="object"&&"suggestedPrompts"in o._meta&&Array.isArray(o._meta.suggestedPrompts)?o._meta.suggestedPrompts:void 0;this.agentInfo={name:o.agentInfo.name,...o.agentInfo.title?{displayName:o.agentInfo.title}:{},version:o.agentInfo.version,...c?{description:c}:{},...d?{suggestedPrompts:d}:{}}}if(!o.agentCapabilities?.loadSession)throw T.error("Agent does not support loading sessions",{capabilities:o.agentCapabilities}),new Error("Agent does not support loading sessions");T.info("ACP connection initialized, loading session",{sessionId:t,capabilities:o.agentCapabilities}),this.isInReplayMode=!0,this.currentSessionId=t,await this.connectSSE();const r={sessionId:t,cwd:"/",mcpServers:[]};T.info("Sending session/load request",{loadRequest:r});const i=await this.sendRpcRequest("session/load",r);T.info("Session loaded successfully",{sessionId:this.currentSessionId,loadResponse:i}),this.connected=!0,this.reconnectAttempts=0}catch(n){this.connected=!1;const o=n instanceof Error?n:new Error(String(n));throw T.error("Failed to load session",{sessionId:t,error:o.message,stack:o.stack}),this.notifyError(o),o}}async disconnect(){if(this.connected)try{this.abortController&&(this.abortController.abort(),this.abortController=null),this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.connected=!1,this.currentSessionId=null,this.messageQueue=[],this.chunkResolvers=[],this.streamComplete=!1,this.reconnecting=!1,this.reconnectAttempts=0}catch(t){const n=t instanceof Error?t:new Error(String(t));throw this.notifyError(n),n}}async send(t){if(!this.connected||!this.currentSessionId)throw new Error("Transport not connected");this.isInReplayMode&&(T.info("Exiting replay mode - user sent a message"),this.isInReplayMode=!1);try{this.streamComplete=!1,this.messageQueue=[];const n=t.content.filter(c=>c.type==="text").map(c=>c.text).join(`
4
- `),o={sessionId:this.currentSessionId,prompt:[{type:"text",text:n}]},r=await this.sendRpcRequest("session/prompt",o);T.debug("Prompt sent",{promptResponse:r}),this.streamComplete=!0;const i=this.chunkResolvers.shift();i?i({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}):this.messageQueue.push({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0})}catch(n){this.streamComplete=!0;const o=n instanceof Error?n:new Error(String(n));throw this.notifyError(o),o}}async*receive(){this.isReceivingMessages=!0;try{for(;!this.streamComplete;)if(this.messageQueue.length>0){const t=this.messageQueue.shift();if(t&&(yield t,t.isComplete))return}else{const t=await new Promise(n=>{this.chunkResolvers.push(n)});if(t.isComplete){yield t;return}else yield t}for(;this.messageQueue.length>0;){const t=this.messageQueue.shift();t&&(yield t)}yield{id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}}finally{this.isReceivingMessages=!1}}isConnected(){return this.connected}onSessionUpdate(t){return this.sessionUpdateCallbacks.add(t),()=>{this.sessionUpdateCallbacks.delete(t)}}onError(t){return this.errorCallbacks.add(t),()=>{this.errorCallbacks.delete(t)}}getAgentInfo(){return this.agentInfo||{}}async sendRpcRequest(t,n){const r={jsonrpc:"2.0",id:this.generateRequestId(),method:t,params:n};T.debug("Sending RPC request",{method:t,params:n,request:r});const i={"Content-Type":"application/json",...this.options.headers},c=this.options.timeout??600*1e3,d=new AbortController,p=setTimeout(()=>d.abort(),c);try{const a=await fetch(`${this.options.baseUrl}/rpc`,{method:"POST",headers:i,body:JSON.stringify(r),signal:d.signal});if(clearTimeout(p),!a.ok){const f=await a.text();throw new Error(`HTTP ${a.status}: ${f}`)}const u=await a.json();if(u.error)throw new Error(`ACP error: ${u.error.message||JSON.stringify(u.error)}`);return u.result||u}catch(a){throw clearTimeout(p),a instanceof Error&&a.name==="AbortError"?new Error(`Request timeout after ${c}ms`):a}}async connectSSE(){if(!this.currentSessionId)throw new Error("Cannot connect SSE without a session ID");const t=`${this.options.baseUrl}/events`,n={"X-Session-ID":this.currentSessionId,...this.options.headers};this.sseAbortController=new AbortController;try{const o=await fetch(t,{method:"GET",headers:n,signal:this.sseAbortController.signal});if(!o.ok)throw new Error(`SSE connection failed: HTTP ${o.status}`);if(!o.body)throw new Error("Response body is null");T.debug("SSE connection opened"),this.reconnectAttempts=0,this.reconnectDelay=1e3;const r=o.body.getReader(),i=new TextDecoder;let c="";(async()=>{try{for(;;){const{done:d,value:p}=await r.read();if(d){T.debug("SSE stream closed by server"),this.connected&&await this.handleSSEDisconnect();break}c+=i.decode(p,{stream:!0});const a=c.split(`
5
- `);c=a.pop()||"";let u={event:"message",data:""};for(const f of a)f.startsWith("event:")?u.event=f.substring(6).trim():f.startsWith("data:")?u.data=f.substring(5).trim():f===""&&(u.event==="message"&&u.data&&this.handleSSEMessage(u.data),u={event:"message",data:""})}}catch(d){if(d instanceof Error&&d.name==="AbortError"){T.debug("SSE stream aborted");return}T.error("Error reading SSE stream",{error:d}),this.connected&&!this.reconnecting&&await this.handleSSEDisconnect()}})()}catch(o){throw T.error("SSE connection error",{error:o}),o}}async handleSSEDisconnect(){if(this.reconnecting||!this.connected)return;if(this.reconnecting=!0,this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.reconnectAttempts>=this.maxReconnectAttempts){const n=new Error(`SSE reconnection failed after ${this.maxReconnectAttempts} attempts`);this.notifyError(n),this.connected=!1,this.reconnecting=!1;return}this.reconnectAttempts++;const t=Math.min(this.reconnectDelay*2**(this.reconnectAttempts-1),32e3);T.debug("SSE reconnecting",{delay:t,attempt:this.reconnectAttempts,maxAttempts:this.maxReconnectAttempts}),await new Promise(n=>setTimeout(n,t));try{await this.connectSSE(),T.info("SSE reconnected successfully"),this.reconnecting=!1}catch(n){T.error("SSE reconnection failed",{error:n}),this.reconnecting=!1}}handleSSEMessage(t){try{const n=JSON.parse(t);T.debug("Received SSE message",{message:n});const o=js.safeParse(n);if(!o.success){T.error("Invalid ACP message from SSE",{issues:o.error.issues});return}const r=o.data;T.debug("Parsed ACP message",{method:"method"in r?r.method:"(no method)"}),"method"in r&&r.method==="session/update"&&(T.debug("Received session/update notification"),"params"in r&&r.params&&(T.debug("Calling handleSessionNotification",{params:r.params}),this.handleSessionNotification(r.params)))}catch(n){T.error("Error parsing SSE message",{error:n}),this.notifyError(n instanceof Error?n:new Error(String(n)))}}handleSessionNotification(t){T.debug("handleSessionNotification called",{params:t});const o=t.update,r=this.currentSessionId||t.sessionId;if(T.debug("Update session type",{sessionUpdate:o?.sessionUpdate}),o?.sessionUpdate==="tool_call"){T.debug("Tool call notification",{tokenUsage:o.tokenUsage});const i=o._meta&&typeof o._meta=="object"&&"messageId"in o._meta?String(o._meta.messageId):void 0,c=o._meta&&typeof o._meta=="object"&&"prettyName"in o._meta?String(o._meta.prettyName):void 0,d=o._meta&&typeof o._meta=="object"&&"icon"in o._meta?String(o._meta.icon):void 0,p={id:o.toolCallId??"",title:o.title??"",prettyName:c,icon:d,kind:o.kind||"other",status:o.status||"pending",locations:o.locations,rawInput:o.rawInput,tokenUsage:o.tokenUsage,content:o.content?.map(u=>{if(typeof u!="object"||u===null)return{type:"text",text:""};const f=u;if(f.type==="content"&&typeof f.content=="object"&&f.content!==null){const m=f.content;if(m.type==="text")return{type:"content",content:{type:"text",text:typeof m.text=="string"?m.text:""}}}return f.type==="text"?{type:"text",text:typeof f.text=="string"?f.text:""}:f.type==="diff"?{type:"diff",path:typeof f.path=="string"?f.path:"",oldText:typeof f.oldText=="string"?f.oldText:"",newText:typeof f.newText=="string"?f.newText:"",line:typeof f.line=="number"?f.line:null}:f.type==="terminal"?{type:"terminal",terminalId:typeof f.terminalId=="string"?f.terminalId:""}:{type:"text",text:""}}),startedAt:Date.now()},a={type:"tool_call",sessionId:r,status:"active",toolCall:p,messageId:i};this.notifySessionUpdate(a)}else if(o?.sessionUpdate==="tool_call_update"){const i=o._meta&&typeof o._meta=="object"&&"messageId"in o._meta?String(o._meta.messageId):void 0,c={id:o.toolCallId??"",status:o.status,locations:o.locations,rawOutput:o.rawOutput,tokenUsage:o.tokenUsage,content:o.content?.map(p=>{if(typeof p!="object"||p===null)return{type:"text",text:""};const a=p;if(a.type==="content"&&typeof a.content=="object"&&a.content!==null){const u=a.content;if(u.type==="text")return{type:"content",content:{type:"text",text:typeof u.text=="string"?u.text:""}}}return a.type==="text"?{type:"text",text:typeof a.text=="string"?a.text:""}:a.type==="diff"?{type:"diff",path:typeof a.path=="string"?a.path:"",oldText:typeof a.oldText=="string"?a.oldText:"",newText:typeof a.newText=="string"?a.newText:"",line:typeof a.line=="number"?a.line:null}:a.type==="terminal"?{type:"terminal",terminalId:typeof a.terminalId=="string"?a.terminalId:""}:{type:"text",text:""}}),error:o.error,completedAt:o.status==="completed"||o.status==="failed"?Date.now():void 0},d={type:"tool_call_update",sessionId:r,status:"active",toolCallUpdate:c,messageId:i};T.debug("Notifying tool_call_update session update",{sessionUpdate:d}),this.notifySessionUpdate(d)}else if(o&&"sessionUpdate"in o&&o.sessionUpdate==="tool_output"){const i=o,c=i._meta&&typeof i._meta=="object"&&"messageId"in i._meta?String(i._meta.messageId):void 0,d={id:i.toolCallId??"",rawOutput:i.rawOutput,content:i.content?.map(a=>{if(typeof a!="object"||a===null)return{type:"text",text:""};const u=a;if(u.type==="content"&&typeof u.content=="object"&&u.content!==null){const f=u.content;if(f.type==="text")return{type:"content",content:{type:"text",text:typeof f.text=="string"?f.text:""}}}return u.type==="text"?{type:"text",text:typeof u.text=="string"?u.text:""}:u.type==="diff"?{type:"diff",path:typeof u.path=="string"?u.path:"",oldText:typeof u.oldText=="string"?u.oldText:"",newText:typeof u.newText=="string"?u.newText:"",line:typeof u.line=="number"?u.line:null}:u.type==="terminal"?{type:"terminal",terminalId:typeof u.terminalId=="string"?u.terminalId:""}:{type:"text",text:""}})},p={type:"tool_call_update",sessionId:r,status:"active",toolCallUpdate:d,messageId:c};T.debug("Notifying tool_output as tool_call_update",{sessionUpdate:p}),this.notifySessionUpdate(p)}else if(o?.sessionUpdate==="agent_message_chunk"){const i=o._meta&&typeof o._meta=="object"&&"isReplay"in o._meta&&o._meta.isReplay===!0;if(this.isInReplayMode&&!i)return;const c=o._meta&&typeof o._meta=="object"&&"tokenUsage"in o._meta?o._meta.tokenUsage:void 0,d=o._meta&&typeof o._meta=="object"&&"contextInputTokens"in o._meta&&typeof o._meta.contextInputTokens=="number"?o._meta.contextInputTokens:void 0,p=o._meta&&typeof o._meta=="object"&&"context_size"in o._meta?o._meta.context_size:void 0,a={type:"generic",sessionId:r,status:"active",_meta:o._meta},u=o.content;if(u&&typeof u=="object"){const m=u;let b=null;if(m.type==="text"&&typeof m.text=="string"&&(b={id:t.sessionId,role:"assistant",contentDelta:{type:"text",text:m.text},tokenUsage:c,contextInputTokens:d,_meta:p?{context_size:p}:void 0,isComplete:!1}),b&&!i){const w=this.chunkResolvers.shift();w?w(b):this.messageQueue.push(b)}if(b&&typeof m.text=="string"&&(i||!this.isReceivingMessages)){const w={type:"generic",sessionId:r,status:"active",message:{id:`msg_${Date.now()}_assistant`,role:"assistant",content:[{type:"text",text:m.text}],timestamp:new Date().toISOString()}};this.notifySessionUpdate(w)}}const f=a._meta&&"context_size"in a._meta;(!i||f)&&this.notifySessionUpdate(a)}else if(o?.sessionUpdate==="user_message_chunk"){T.debug("Received user_message_chunk",{update:o});const i=o.content;if(i&&typeof i=="object"){const c=i;if(c.type==="text"&&typeof c.text=="string"){const d={type:"generic",sessionId:r,status:"active",message:{id:`msg_${Date.now()}_user`,role:"user",content:[{type:"text",text:c.text}],timestamp:new Date().toISOString()}};T.debug("Notifying session update for user message"),this.notifySessionUpdate(d)}}}else{const i={type:"generic",sessionId:r,status:"active"};this.notifySessionUpdate(i)}}generateRequestId(){return`req-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}notifySessionUpdate(t){for(const n of this.sessionUpdateCallbacks)try{n(t)}catch(o){T.error("Error in session update callback",{error:o})}}notifyError(t){for(const n of this.errorCallbacks)try{n(t)}catch(o){T.error("Error in error callback",{error:o})}}}class wn{constructor(){throw new Error("StdioTransport is not available in the browser. Use HttpTransport or WebSocketTransport instead.")}async connect(){throw new Error("StdioTransport not available in browser")}async disconnect(){}async send(){throw new Error("StdioTransport not available in browser")}async*receive(){throw new Error("StdioTransport not available in browser")}isConnected(){return!1}onSessionUpdate(){return()=>{}}onError(){return()=>{}}}class vn{ws=null;connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;constructor(t){}async connect(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async disconnect(){this.ws&&(this.ws.close(),this.ws=null),this.connected=!1}async send(t){throw!this.connected||!this.ws?new Error("Transport not connected"):new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async*receive(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}isConnected(){return this.connected}onSessionUpdate(t){return this.sessionUpdateCallbacks.add(t),()=>{this.sessionUpdateCallbacks.delete(t)}}onError(t){return this.errorCallbacks.add(t),()=>{this.errorCallbacks.delete(t)}}}const ye=q("acp-client","debug");class jn{config;transport;sessions=new Map;currentSessionId=null;sessionUpdateHandlers=new Set;errorHandlers=new Set;constructor(t){this.config=t,this.transport=this.createTransport(),this.setupTransportListeners(),t.autoConnect&&this.connect().catch(n=>{ye.error("Failed to auto-connect",{error:n instanceof Error?n.message:String(n)})})}async connect(){await this.transport.connect()}async disconnect(){await this.transport.disconnect(),this.currentSessionId=null}isConnected(){return this.transport.isConnected()}async startSession(t){const n="currentSessionId"in this.transport?this.transport.currentSessionId:void 0;if(n){const d=new Date().toISOString(),p=this.transport.getAgentInfo?.()?.name,a={id:n,status:"connected",config:t?{...t,agentPath:t.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:d,agentName:p}};return this.sessions.set(n,a),this.currentSessionId=n,n}const o=this.generateSessionId(),r=new Date().toISOString(),i=this.transport.getAgentInfo?.()?.name,c={id:o,status:"connecting",config:t?{...t,agentPath:t.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:r,agentName:i}};return this.sessions.set(o,c),this.currentSessionId=o,this.updateSessionStatus(o,"connected"),o}async loadSession(t,n){if(!this.transport.loadSession)throw new Error("Transport does not support loading sessions");const o=new Date().toISOString(),r={id:t,status:"connecting",config:n?{...n,agentPath:n.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:o}};if(this.sessions.set(t,r),this.currentSessionId=t,await this.transport.loadSession(t),this.transport.getAgentInfo){const i=this.transport.getAgentInfo();i.name&&r.metadata&&(r.metadata.agentName=i.name)}return this.updateSessionStatus(t,"connected"),t}async sendMessage(t,n){const o=n||this.currentSessionId;if(!o)throw new Error("No active session. Start a session first.");if(!this.transport.isConnected())throw new Error("Transport not connected");const r=this.sessions.get(o);if(!r)throw new Error(`Session ${o} not found`);const i={id:this.generateMessageId(),role:"user",content:[{type:"text",text:t}],timestamp:new Date().toISOString()};r.messages.push(i),this.updateSessionStatus(o,"active"),await this.transport.send(i)}async*receiveMessages(){if(!this.transport.isConnected())throw new Error("Transport not connected");yield*this.transport.receive()}getSession(t){return this.sessions.get(t)}getCurrentSession(){return this.currentSessionId?this.sessions.get(this.currentSessionId):void 0}getAllSessions(){return Array.from(this.sessions.values())}onSessionUpdate(t){return this.sessionUpdateHandlers.add(t),()=>{this.sessionUpdateHandlers.delete(t)}}onError(t){return this.errorHandlers.add(t),()=>{this.errorHandlers.delete(t)}}getAgentInfo(){return this.transport.getAgentInfo?.()||{}}createTransport(){switch(this.config.type){case"stdio":return new wn(this.config.options);case"http":return new yn(this.config.options);case"websocket":return new vn(this.config.options);default:throw new Error(`Unknown transport type: ${this.config.type}`)}}setupTransportListeners(){this.transport.onSessionUpdate(t=>{this.handleSessionUpdate(t)}),this.transport.onError(t=>{this.handleError(t)})}handleSessionUpdate(t){if(t.sessionId){const n=this.sessions.get(t.sessionId);n&&(t.status&&(n.status=t.status),t.message&&n.messages.push(t.message),t.error&&(n.error=t.error))}for(const n of this.sessionUpdateHandlers)try{n(t)}catch(o){ye.error("Error in session update handler",{error:o instanceof Error?o.message:String(o)})}}handleError(t){for(const n of this.errorHandlers)try{n(t)}catch(o){ye.error("Error in error handler",{error:o instanceof Error?o.message:String(o)})}}updateSessionStatus(t,n){const o=this.sessions.get(t);o&&(o.status=n,this.handleSessionUpdate({sessionId:t,status:n}))}generateSessionId(){return`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}generateMessageId(){return`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}}const Z=q("acp-client-hook");function Nn(s){const[t,n]=l.useState(null),[o,r]=l.useState(null),[i,c]=l.useState(null);return l.useEffect(()=>{const p=new URLSearchParams(window.location.search).get("session");p&&(Z.info("Session ID found in URL",{sessionId:p}),c(p));try{Z.info("Initializing ACP client",{serverUrl:s.serverUrl});const a=new jn({type:"http",options:{baseUrl:s.serverUrl}});return n(a),Z.info("ACP client initialized successfully"),()=>{Z.debug("Disconnecting ACP client"),a.disconnect().catch(u=>{Z.error("Failed to disconnect ACP client",{error:u instanceof Error?u.message:String(u)})})}}catch(a){const u=a instanceof Error?a.message:"Failed to initialize ACP client";r(u),Z.error("Failed to initialize ACP client",{error:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0});return}},[s.serverUrl]),{client:t,error:o,sessionId:i}}const ht=H(["pending","in_progress","completed","failed"]),Sn=H(["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"]),xt=R({path:v(),line:E().nullable().optional()}),Se=R({inputTokens:E().optional(),outputTokens:E().optional(),totalTokens:E().optional()}),bt=Le("type",[R({type:z("content"),content:R({type:z("text"),text:v()})}),R({type:z("text"),text:v()}),R({type:z("diff"),path:v(),oldText:v(),newText:v(),line:E().nullable().optional()}),R({type:z("terminal"),terminalId:v()})]),yt=R({id:v(),title:v(),prettyName:v().optional(),icon:v().optional(),kind:Sn,status:ht,contentPosition:E().optional(),locations:U(xt).optional(),rawInput:O(v(),B()).optional(),rawOutput:O(v(),B()).optional(),content:U(bt).optional(),error:v().optional(),startedAt:E().optional(),completedAt:E().optional(),tokenUsage:Se.optional(),_meta:R({truncationWarning:v().optional(),compactionAction:H(["compacted","truncated"]).optional(),originalTokens:E().optional(),finalTokens:E().optional()}).optional()}),Cn=R({id:v(),status:ht.optional(),locations:U(xt).optional(),rawOutput:O(v(),B()).optional(),content:U(bt).optional(),error:v().optional(),completedAt:E().optional(),tokenUsage:Se.optional()});function _e(s,t){return{...s,status:t.status??s.status,locations:t.locations??s.locations,rawOutput:t.rawOutput??s.rawOutput,content:t.content?[...s.content??[],...t.content]:s.content,error:t.error??s.error,completedAt:t.completedAt??s.completedAt,tokenUsage:t.tokenUsage??s.tokenUsage}}const ee=q("chat-store","debug"),k=Ns(s=>({connectionStatus:"disconnected",sessionId:null,error:null,messages:[],isStreaming:!1,streamingStartTime:null,toolCalls:{},totalBilled:{inputTokens:0,outputTokens:0,totalTokens:0},currentContext:{inputTokens:0,outputTokens:0,totalTokens:0},latestContextSize:null,currentModel:"claude-sonnet-4-5-20250929",tokenDisplayMode:"context",logs:[],activeTab:"chat",input:{value:"",isSubmitting:!1,attachedFiles:[]},setConnectionStatus:t=>s({connectionStatus:t}),setSessionId:t=>s({sessionId:t}),setError:t=>s({error:t}),addMessage:t=>s(n=>({messages:[...n.messages,t]})),updateMessage:(t,n)=>s(o=>{const r=o.messages.find(a=>a.id===t);let i=o.totalBilled,c=o.currentContext,d=n;if(n.tokenUsage){const a=r?.tokenUsage;ee.debug("updateMessage: incoming tokenUsage",{incoming:n.tokenUsage,existing:a});const u={inputTokens:Math.max(n.tokenUsage.inputTokens??0,a?.inputTokens??0),outputTokens:Math.max(n.tokenUsage.outputTokens??0,a?.outputTokens??0),totalTokens:Math.max(n.tokenUsage.inputTokens??0,a?.inputTokens??0)+Math.max(n.tokenUsage.outputTokens??0,a?.outputTokens??0)};ee.debug("updateMessage: merged tokenUsage",{merged:u}),d={...n,tokenUsage:u};const f=u.inputTokens-(a?.inputTokens??0),m=u.outputTokens-(a?.outputTokens??0),b=u.totalTokens-(a?.totalTokens??0);i={inputTokens:o.totalBilled.inputTokens+f,outputTokens:o.totalBilled.outputTokens+m,totalTokens:o.totalBilled.totalTokens+b},c={inputTokens:u.inputTokens,outputTokens:o.currentContext.outputTokens+m,totalTokens:u.totalTokens}}const p=o.messages.map(a=>a.id===t?{...a,...d}:a);if(n.tokenUsage&&d.tokenUsage){const a=r?.tokenUsage,u=d.tokenUsage,f=(u.inputTokens??0)-(a?.inputTokens??0),m=(u.outputTokens??0)-(a?.outputTokens??0),b=(u.totalTokens??0)-(a?.totalTokens??0),w=p.filter(y=>y.tokenUsage).map(y=>({id:y.id,role:y.role,tokens:y.tokenUsage})),g=p.reduce((y,j)=>({inputTokens:y.inputTokens+(j.tokenUsage?.inputTokens??0),outputTokens:y.outputTokens+(j.tokenUsage?.outputTokens??0),totalTokens:y.totalTokens+(j.tokenUsage?.totalTokens??0)}),{inputTokens:0,outputTokens:0,totalTokens:0}),x=g.inputTokens===i.inputTokens&&g.outputTokens===i.outputTokens&&g.totalTokens===i.totalTokens;ee.debug("updateMessage: tokenUsage update",{messageId:t,updates:n.tokenUsage,existing:a,messageMax:u,delta:{inputDelta:f,outputDelta:m,totalDelta:b},totalBilled:i,currentContext:c,actualSum:g,billedCorrect:x?"✅":"❌",messageCount:p.length,messagesWithTokens:w.length,breakdown:w})}return{messages:p,totalBilled:i,currentContext:c}}),clearMessages:()=>s({messages:[]}),setIsStreaming:t=>s({isStreaming:t}),setStreamingStartTime:t=>s({streamingStartTime:t}),addToolCall:(t,n)=>s(o=>({toolCalls:{...o.toolCalls,[t]:[...o.toolCalls[t]||[],n]}})),addToolCallToCurrentMessage:t=>s(n=>{const o=n.messages.findLastIndex(p=>p.role==="assistant");if(o===-1){ee.debug("No assistant message found, creating one for tool call at position 0");const p={id:`msg_${Date.now()}_assistant`,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!1,toolCalls:[{...t,contentPosition:0}]};return{messages:[...n.messages,p]}}const r=[...n.messages],i=r[o];if(!i)return n;const c=i.content.length,d={...t,contentPosition:c};return r[o]={...i,toolCalls:[...i.toolCalls||[],d]},{messages:r}}),updateToolCallInCurrentMessage:t=>s(n=>{const o=n.messages.findLastIndex(u=>u.role==="assistant");if(o===-1)return ee.warn("No assistant message found to update tool call in"),n;const r=[...n.messages],i=r[o];if(!i)return n;const c=i.toolCalls||[],d=c.findIndex(u=>u.id===t.id);if(d===-1)return ee.warn(`Tool call ${t.id} not found in message`),n;const p=c[d];if(!p)return n;const a=[...c];return a[d]=_e(p,t),r[o]={...i,toolCalls:a},{messages:r}}),updateToolCall:(t,n)=>s(o=>{const r=o.toolCalls[t]||[],i=r.findIndex(p=>p.id===n.id);if(i===-1)return o;const c=r[i];if(!c)return o;const d=[...r];return d[i]=_e(c,n),{toolCalls:{...o.toolCalls,[t]:d}}}),setInputValue:t=>s(n=>({input:{...n.input,value:t}})),setInputSubmitting:t=>s(n=>({input:{...n.input,isSubmitting:t}})),addFileAttachment:t=>s(n=>({input:{...n.input,attachedFiles:[...n.input.attachedFiles,t]}})),removeFileAttachment:t=>s(n=>({input:{...n.input,attachedFiles:n.input.attachedFiles.filter((o,r)=>r!==t)}})),clearInput:()=>s(t=>({input:{value:"",isSubmitting:!1,attachedFiles:[]}})),addTokenUsage:t=>s(n=>({totalBilled:{inputTokens:n.totalBilled.inputTokens+(t.inputTokens??0),outputTokens:n.totalBilled.outputTokens+(t.outputTokens??0),totalTokens:n.totalBilled.totalTokens+(t.totalTokens??0)},currentContext:{inputTokens:t.inputTokens??n.currentContext.inputTokens,outputTokens:n.currentContext.outputTokens+(t.outputTokens??0),totalTokens:(t.inputTokens??n.currentContext.inputTokens)+(n.currentContext.outputTokens+(t.outputTokens??0))}})),setLatestContextSize:t=>s({latestContextSize:t}),setCurrentModel:t=>s({currentModel:t}),resetTokens:()=>s({totalBilled:{inputTokens:0,outputTokens:0,totalTokens:0},currentContext:{inputTokens:0,outputTokens:0,totalTokens:0},latestContextSize:null}),cycleTokenDisplayMode:()=>s(t=>{const n=["context","input","output"],r=(n.indexOf(t.tokenDisplayMode)+1)%n.length,i=n[r];return i?{tokenDisplayMode:i}:t}),addLog:t=>s(n=>({logs:[...n.logs,t]})),clearLogs:()=>s({logs:[]}),setActiveTab:t=>s({activeTab:t})})),V=q("use-chat-messages","debug");function wt(s,t){const n=k(m=>m.messages),o=k(m=>m.isStreaming),r=k(m=>m.sessionId),i=k(m=>m.setIsStreaming),c=k(m=>m.setStreamingStartTime),d=k(m=>m.addMessage),p=k(m=>m.updateMessage),a=k(m=>m.setError),u=k(m=>m.setLatestContextSize),f=l.useCallback(async m=>{if(!s){V.error("No client available"),a("No client available");return}let b=r;if(!b){V.info("Creating new session before sending first message");const g=await t();if(!g){V.error("Failed to create session"),a("Failed to create session");return}b=g,V.info("Session created successfully",{sessionId:g})}const w=`msg_${Date.now()}_assistant`;try{const g=Date.now();i(!0),c(g);const x={id:`msg_${Date.now()}_user`,role:"user",content:m,timestamp:new Date().toISOString(),isStreaming:!1};d(x);const y={id:w,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!0,streamingStartTime:g};d(y);const j=s.receiveMessages();s.sendMessage(m,b).catch(S=>{const A=S instanceof Error?S.message:String(S);a(A),i(!1),c(null)});let N="",C=!1;for await(const S of j){const A=S._meta,I=A?.context_size||S.context_size;if(I!=null){const _=I;V.info("✅ Received context_size from backend",{context_size:_,totalEstimated:_.totalEstimated,source:A?.context_size?"_meta":"direct"}),u(_)}else V.debug("Chunk does not have context_size",{hasContextSize:"context_size"in S,hasMeta:"_meta"in S,metaKeys:A?Object.keys(A):null});if(S.tokenUsage&&V.debug("Received tokenUsage from backend",{tokenUsage:S.tokenUsage}),S.isComplete){p(w,{content:N,isStreaming:!1,streamingStartTime:void 0,...S.tokenUsage?{tokenUsage:S.tokenUsage}:{}}),i(!1),c(null),C=!0;break}else S.contentDelta.type==="text"&&(N+=S.contentDelta.text,p(w,{content:N,...S.tokenUsage?{tokenUsage:S.tokenUsage}:{}}),await new Promise(_=>setTimeout(_,16)))}C||(V.warn("Stream ended without isComplete flag"),p(w,{isStreaming:!1,streamingStartTime:void 0}),i(!1),c(null))}catch(g){const x=g instanceof Error?g.message:String(g);a(x),i(!1),c(null),p(w,{isStreaming:!1,streamingStartTime:void 0})}},[s,r,t,d,p,i,c,a,u]);return{messages:n,isStreaming:o,sendMessage:f}}const kn=q("use-chat-input","debug");function Tn(s,t){const n=k(m=>m.input),o=k(m=>m.setInputValue),r=k(m=>m.setInputSubmitting),i=k(m=>m.addFileAttachment),c=k(m=>m.removeFileAttachment),{sendMessage:d}=wt(s,t),p=l.useCallback(m=>{o(m)},[o]),a=l.useCallback(async()=>{if(!n.value.trim()||n.isSubmitting)return;const m=n.value;o(""),r(!0);try{await d(m)}catch(b){kn.error("Failed to send message",{error:b instanceof Error?b.message:String(b)})}finally{r(!1)}},[n,o,r,d]),u=l.useCallback(m=>{i(m)},[i]),f=l.useCallback(m=>{c(m)},[c]);return{value:n.value,isSubmitting:n.isSubmitting,attachedFiles:n.attachedFiles,onChange:p,onSubmit:a,onAttachFile:u,onRemoveFile:f}}const W=q("use-chat-session","debug");function In(s,t){const n=k(g=>g.connectionStatus),o=k(g=>g.sessionId),r=k(g=>g.setConnectionStatus),i=k(g=>g.setSessionId),c=k(g=>g.setError),d=k(g=>g.clearMessages),p=k(g=>g.resetTokens),a=k(g=>g.addMessage),u=k(g=>g.setLatestContextSize);l.useEffect(()=>s?s.onSessionUpdate(x=>{const y=x._meta,j=y?.context_size||x.context_size;if(j!=null){const N=j;W.info("✅ Received context_size from session update",{context_size:N,totalEstimated:N.totalEstimated,isReplay:y?.isReplay}),u(N)}if(x.message&&(W.debug("Session update with message",{message:x.message}),x.message.role!=="tool")){const N=x.message.content.map(A=>A.type==="text"?A.text:"").join(""),C=k.getState().messages,S=C[C.length-1];if(x.message.role==="assistant"&&S?.role==="assistant"&&S.content===""&&N)W.debug("Appending text to existing assistant message"),k.getState().updateMessage(S.id,{content:S.content+N});else{const A={id:x.message.id,role:x.message.role,content:N,timestamp:x.message.timestamp,isStreaming:!1};a(A)}}}):void 0,[s,a,u]);const f=l.useCallback(async()=>{if(!s){c("No client available");return}try{r("connecting"),c(null),await s.connect(),r("connected")}catch(g){W.error("Failed to connect",{error:g instanceof Error?g.message:String(g)});const x=g instanceof Error?g.message:String(g);c(x),r("error")}},[s,r,c]),m=l.useCallback(async g=>{if(!s){c("No client available");return}try{r("connecting"),c(null),d(),p();const x=await s.loadSession(g);i(x),r("connected"),W.info("Session loaded successfully",{sessionId:x})}catch(x){W.warn("Failed to load session, creating new one instead",{sessionId:g,error:x instanceof Error?x.message:String(x)});try{await f();const y=await s.startSession();if(i(y),d(),p(),typeof window<"u"){const j=new URL(window.location.href);j.searchParams.set("session",y),window.history.replaceState({},"",j.toString())}W.info("Created new session after failed load",{sessionId:y})}catch(y){const j=y instanceof Error?y.message:String(y);c(`Failed to load or create session: ${j}`),r("error")}}},[s,r,i,c,d,p,f]),b=l.useCallback(async()=>{if(!s)return c("No client available"),null;try{const g=await s.startSession();if(i(g),d(),p(),typeof window<"u"){const x=new URL(window.location.href);x.searchParams.set("session",g),window.history.pushState({},"",x.toString())}return g}catch(g){const x=g instanceof Error?g.message:String(g);return c(x),null}},[s,i,c,d,p]),w=l.useCallback(async()=>{if(s)try{await s.disconnect(),r("disconnected"),i(null)}catch(g){const x=g instanceof Error?g.message:String(g);c(x)}},[s,r,i,c]);return l.useEffect(()=>{!s||n!=="disconnected"||(t?(W.info("Loading initial session from URL",{sessionId:t}),m(t)):f())},[s,n,t,f,m]),{connectionStatus:n,sessionId:o,connect:f,loadSession:m,startSession:b,disconnect:w}}function Rn(s){const t=k(c=>c.toolCalls),n=k(c=>c.addToolCall),o=k(c=>c.updateToolCall),r=k(c=>c.addToolCallToCurrentMessage),i=k(c=>c.updateToolCallInCurrentMessage);return l.useEffect(()=>{if(!s)return;const c=s.onSessionUpdate(d=>{d.type==="tool_call"?(n(d.sessionId,d.toolCall),r(d.toolCall)):d.type==="tool_call_update"&&(o(d.sessionId,d.toolCallUpdate),i(d.toolCallUpdate))});return()=>{c()}},[s,n,o,r,i]),{toolCalls:t,getToolCallsForSession:c=>{const d=t[c];return d&&d.length>0?d:Object.values(t).flat()}}}const En=R({id:v(),role:H(["user","assistant","system"]),content:v(),timestamp:pe(),isStreaming:oe().default(!1),streamingStartTime:E().optional(),metadata:O(v(),B()).optional(),toolCalls:U(yt).optional(),tokenUsage:Se.optional()}),An=R({value:v(),isSubmitting:oe(),attachedFiles:U(R({name:v(),path:v(),size:E(),mimeType:v()}))});R({sessionId:v().nullable(),isConnected:oe(),isStreaming:oe(),messages:U(En),input:An,error:v().nullable()});H(["disconnected","connecting","connected","error"]);const Mn=R({name:v(),description:v().optional(),parameters:O(v(),B()).optional()}),Pn=R({name:v(),description:v(),parameters:O(v(),B()),required:U(v()).optional()}),_n=R({name:v(),version:v().optional(),description:v().optional(),author:v().optional(),capabilities:U(Mn).optional(),tools:U(Pn).optional(),supportedFormats:U(v()).optional()}),Un=H(["initializing","ready","busy","error","terminated"]);R({status:Un,info:_n.optional(),pid:E().optional(),error:v().optional(),uptime:E().optional()});const vt=H(["user","assistant","system","tool"]),Dn=H(["text","image","file","tool_call","tool_result"]),ie=R({type:Dn}),zn=ie.extend({type:z("text"),text:v()}),Ln=ie.extend({type:z("image"),url:v().url().optional(),data:v().optional(),mimeType:v().optional()}),Fn=ie.extend({type:z("file"),name:v(),path:v().optional(),url:v().url().optional(),mimeType:v(),size:E().optional()}),On=ie.extend({type:z("tool_call"),id:v(),name:v(),arguments:O(v(),B())}),Bn=ie.extend({type:z("tool_result"),callId:v(),result:B(),error:v().optional()}),jt=Le("type",[zn,Ln,Fn,On,Bn]),Nt=R({id:v(),role:vt,content:U(jt),timestamp:pe(),metadata:O(v(),B()).optional()});R({id:v(),role:vt,contentDelta:jt,isComplete:oe(),tokenUsage:R({inputTokens:E().optional(),outputTokens:E().optional(),totalTokens:E().optional()}).optional(),contextInputTokens:E().optional(),_meta:R({context_size:R({systemPromptTokens:E(),userMessagesTokens:E(),assistantMessagesTokens:E(),toolInputTokens:E(),toolResultsTokens:E(),totalEstimated:E(),llmReportedInputTokens:E().optional()}).optional()}).optional()});const St=H(["idle","connecting","connected","active","streaming","error","disconnected"]),$n=R({agentPath:v(),agentArgs:U(v()).optional(),environment:O(v(),v()).optional(),workingDirectory:v().optional(),timeout:E().optional()}),Hn=R({agentName:v().optional(),agentVersion:v().optional(),capabilities:U(v()).optional(),startedAt:pe(),lastActivityAt:pe().optional()});R({id:v(),status:St,config:$n,metadata:Hn.optional(),messages:U(Nt),error:v().optional()});const me=R({sessionId:v(),status:St.optional(),message:Nt.optional(),error:v().optional(),_meta:O(v(),B()).optional()}),Vn=me.extend({type:z("tool_call"),toolCall:yt,messageId:v().optional()}),Wn=me.extend({type:z("tool_call_update"),toolCallUpdate:Cn,messageId:v().optional()}),qn=me.extend({type:z("tool_output"),toolOutput:R({id:v(),content:U(Ss()).optional(),rawOutput:O(v(),B()).optional()}),messageId:v().optional()}),Qn=me.extend({type:z("generic").optional()});Cs([Vn,Wn,qn,Qn]);const Gn=[{id:"folder-1",name:"Item 1",type:"folder",children:[{id:"file-1-1",name:"Item 2",type:"file",extension:"tsx"},{id:"file-1-2",name:"Item 3",type:"file",extension:"ts"},{id:"file-1-3",name:"Item 4",type:"file",extension:"json"},{id:"file-1-4",name:"Item 5",type:"file",extension:"md"}]},{id:"folder-2",name:"Description 1",type:"folder",children:[{id:"file-2-1",name:"Description 2",type:"file",extension:"tsx"},{id:"file-2-2",name:"Description 3",type:"file",extension:"ts"},{id:"file-2-3",name:"Description 4",type:"file",extension:"json"},{id:"file-2-4",name:"Description 5",type:"file",extension:"md"}]},{id:"folder-3",name:"financial-docs",type:"folder",children:[]}];class Kn{data;constructor(t=Gn){this.data=t}async getRootItems(){return Promise.resolve(this.data)}async getItemChildren(t){const n=r=>{for(const i of r){if(i.id===t)return i;if(i.children){const c=n(i.children);if(c)return c}}},o=n(this.data);return Promise.resolve(o?.children||[])}async getItemDetails(t){const n=r=>{for(const i of r){if(i.id===t)return i;if(i.children){const c=n(i.children);if(c)return c}}},o=n(this.data);if(!o)throw new Error(`Item with id ${t} not found`);return Promise.resolve(o)}}const Jn=[{id:"1",title:"Boeing Scores Early Wins at Dubai Airshow",url:"https://www.reuters.com/business/aerospace-defense/boeing-scores-early-wins-dubai-airshow-2024-11-17",snippet:"DUBAI, Nov 17 (Reuters) - Boeing (BA.N), opens new tab took centre stage at day one of the Dubai Airshow on Monday, booking a $38 billion order from host carrier Emirates and clinching more deals with African carriers, while China displayed its C919 in the Middle East for the first time.",sourceName:"Reuters",favicon:"https://www.reuters.com/favicon.ico"},{id:"2",title:"Boeing's Sustainable Aviation Goals Take Flight",url:"https://www.forbes.com/boeing-sustainability",snippet:"SEATTLE, Nov 18 (Reuters) - Boeing is making headway towards its sustainability targets, unveiling plans for a new eco-friendly aircraft design aimed at reducing emissions by 50% by 2030.",sourceName:"Forbes"},{id:"3",title:"Boeing Faces Increased Competition in Global Aviation Market",url:"https://www.reuters.com/business/aerospace-defense/boeing-competition-2024-11-19",snippet:"CHICAGO, Nov 19 (Reuters) - As the global aviation industry rebounds post-pandemic, Boeing is grappling with intensified competition from rival manufacturers, particularly in the Asian market.",sourceName:"Reuters",favicon:"https://www.reuters.com/favicon.ico"},{id:"4",title:"Boeing's Starliner Successfully Completes Orbital Test Flight",url:"https://www.theverge.com/boeing-starliner",snippet:"NASA, Nov 20 (Reuters) - Boeing's CST-100 Starliner spacecraft achieves a significant milestone, successfully completing its orbital test flight, paving the way for future crewed missions to the International Space Station.",sourceName:"The Verge"}],Yn=[{id:"todo-1",text:"Review filesystem implementation",status:"completed"},{id:"todo-2",text:"Add overflow menu actions",status:"in_progress"},{id:"todo-3",text:"Connect to real filesystem API",status:"pending"},{id:"todo-4",text:"Implement drag and drop support",status:"pending"},{id:"todo-5",text:"Add file preview functionality",status:"pending"}];function h(...s){return ks(Ts(s))}const Xn=K("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-paragraph-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-hover",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive-hover",outline:"border border-input bg-background hover:bg-accent-hover hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary-hover",ghost:"hover:bg-accent-hover hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),J=l.forwardRef(({className:s,variant:t,size:n,asChild:o=!1,...r},i)=>{const c=o?ae:"button";return e.jsx(c,{className:h(Xn({variant:t,size:n,className:s})),ref:i,...r})});J.displayName="Button";const Zn=l.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:h("rounded-lg border bg-card text-card-foreground shadow-sm",s),...t}));Zn.displayName="Card";const eo=l.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:h("flex flex-col space-y-1.5 p-6",s),...t}));eo.displayName="CardHeader";const to=l.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:h("text-2xl font-semibold leading-none tracking-tight",s),...t}));to.displayName="CardTitle";const so=l.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:h("text-sm text-muted-foreground",s),...t}));so.displayName="CardDescription";const no=l.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:h("p-6 pt-0",s),...t}));no.displayName="CardContent";const oo=l.forwardRef(({className:s,...t},n)=>e.jsx("div",{ref:n,className:h("flex items-center p-6 pt-0",s),...t}));oo.displayName="CardFooter";const Ct=l.forwardRef(({title:s,description:t,guideUrl:n,guideText:o="Guide",suggestedPrompts:r=[],onPromptClick:i,onGuideClick:c,onOpenFiles:d,onPromptHover:p,onPromptLeave:a,className:u,...f},m)=>{const b=x=>{i?.(x)},w=()=>{n&&window.open(n,"_blank","noopener,noreferrer"),c?.()},g=[];for(let x=0;x<r.length;x+=2)g.push(r.slice(x,x+2));return e.jsxs("div",{ref:m,className:h("flex flex-col items-start",u),...f,children:[e.jsx("h3",{className:"text-heading-4 text-text-primary mb-6",children:s}),e.jsx("p",{className:"text-subheading text-text-secondary max-w-prose mb-6",children:t}),d&&e.jsxs("button",{type:"button",onClick:d,className:"inline-flex items-center gap-1 py-1.5 pr-3 -ml-3 pl-3 rounded-lg hover:bg-accent transition-colors mb-6",children:[e.jsx("span",{className:"text-paragraph-sm-medium text-foreground tracking-wide leading-none",children:"View Files"}),e.jsx(we,{className:"size-4 text-foreground shrink-0"})]}),(n||c)&&e.jsxs("button",{type:"button",onClick:w,className:"inline-flex items-center gap-1 py-1.5 pr-3 -ml-3 pl-3 rounded-lg hover:bg-accent transition-colors",children:[e.jsx("span",{className:"text-paragraph-sm-medium text-foreground tracking-wide leading-none",children:o}),e.jsx(we,{className:"size-4 text-foreground shrink-0"})]}),r.length>0&&e.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-prompt-container",children:[e.jsx("p",{className:"text-label text-text-tertiary",children:"Suggested Prompts"}),e.jsx("div",{className:"flex flex-col gap-2.5",children:g.map(x=>e.jsx("div",{className:"flex gap-2.5 items-center",children:x.map(y=>e.jsx("button",{type:"button",onClick:()=>b(y),onMouseEnter:()=>p?.(y),onMouseLeave:()=>a?.(),className:"flex-1 flex items-start gap-2 p-3 bg-secondary hover:bg-secondary/80 rounded-2xl transition-colors min-w-0",children:e.jsx("span",{className:"text-paragraph font-normal leading-normal text-text-tertiary truncate",children:y})},y))},x.join("-")))})]})]})});Ct.displayName="ChatEmptyState";const kt=l.createContext(void 0),Ce=()=>{const s=l.useContext(kt);if(!s)throw new Error("ChatHeader components must be used within ChatHeader.Root");return s},Tt=l.forwardRef(({defaultExpanded:s=!1,expanded:t,onExpandedChange:n,className:o,children:r,...i},c)=>{const[d,p]=l.useState(s),a=t??d,u=l.useCallback(w=>{p(w),n?.(w)},[n]),f=l.Children.toArray(r),m=f.find(w=>l.isValidElement(w)&&typeof w.type=="function"&&w.type.displayName==="ChatHeader.ExpandablePanel"),b=f.filter(w=>w!==m);return e.jsxs(kt.Provider,{value:{isExpanded:a,setIsExpanded:u},children:[e.jsx("div",{ref:c,className:h("flex items-center justify-between px-6 py-4",o),...i,children:b}),m]})});Tt.displayName="ChatHeader.Root";const ao=l.forwardRef(({className:s,children:t,...n},o)=>e.jsx("h1",{ref:o,className:h("m-0 text-subheading font-semibold",s),...n,children:t}));ao.displayName="ChatHeader.Title";const ro=l.forwardRef(({className:s,children:t,...n},o)=>e.jsx("div",{ref:o,className:h("flex items-center gap-3",s),...n,children:t}));ro.displayName="ChatHeader.Actions";const io=s=>{switch(s){case"connected":return"bg-green-500";case"connecting":return"bg-yellow-500";case"error":return"bg-red-500";default:return"bg-gray-500"}},lo=s=>{switch(s){case"connected":return"Connected";case"connecting":return"Connecting...";case"error":return"Connection Error";default:return"No Server"}},co=l.forwardRef(({status:s,statusText:t,className:n,...o},r)=>{const i=t??lo(s),c=io(s);return e.jsxs("div",{ref:r,className:h("flex items-center gap-2",n),...o,children:[e.jsx("div",{className:h("h-2 w-2 rounded-full",c)}),e.jsx("span",{className:"text-paragraph-sm text-muted-foreground",children:i})]})});co.displayName="ChatHeader.StatusIndicator";const uo=l.forwardRef(({icon:s,className:t,children:n,onClick:o,...r},i)=>{const{isExpanded:c,setIsExpanded:d}=Ce(),p=a=>{d(!c),o?.(a)};return e.jsxs("button",{ref:i,type:"button",onClick:p,className:h("rounded p-1 transition-colors hover:bg-background lg:hidden",t),"aria-label":c?"Collapse header":"Expand header",...r,children:[s&&e.jsx("div",{className:h("transition-transform duration-200",c&&"rotate-180"),children:s}),n]})});uo.displayName="ChatHeader.Toggle";const It=l.forwardRef(({className:s,children:t,...n},o)=>{const{isExpanded:r}=Ce();return r?e.jsx("div",{ref:o,className:h("absolute top-full left-0 right-0 z-50 border-b border-border bg-card px-6 py-4 shadow-lg lg:hidden",s),...n,children:t}):null});It.displayName="ChatHeader.ExpandablePanel";const Rt=l.forwardRef(({commands:s=[],showCommandMenu:t,commandMenuQuery:n,selectedMenuIndex:o,setSelectedMenuIndex:r,setMenuItemCount:i,triggerCounter:c,onChange:d,className:p,...a},u)=>{const f=l.useCallback((b,w)=>{const g=b.toLowerCase(),x=w.toLowerCase();if(!w)return 1;if(g.includes(x))return 1-x.length/g.length;let y=0;for(let j=0;j<g.length&&y<x.length;j++)g[j]===x[y]&&y++;return y===x.length?.5-y/g.length:0},[]),m=l.useMemo(()=>s.map(b=>({...b,score:Math.max(f(b.label,n),b.description?f(b.description,n):0)})).filter(b=>b.score>0).sort((b,w)=>w.score-b.score),[s,n,f]);return l.useEffect(()=>{i(m.length)},[m.length,i]),l.useEffect(()=>{r(0)},[r]),l.useEffect(()=>{c>0&&m[o]&&(m[o].onSelect(),d(""))},[c,m,o,d]),!t||m.length===0?null:e.jsxs("div",{ref:u,className:h("absolute bottom-full left-0 z-50 mb-2 w-full max-w-md","rounded-md border border-border bg-card p-2 shadow-lg",p),...a,children:[e.jsx("div",{className:"text-caption font-semibold text-muted-foreground px-2 py-1",children:"Commands"}),e.jsx("div",{className:"max-h-64 overflow-y-auto",children:m.map((b,w)=>e.jsxs("button",{type:"button",onClick:()=>b.onSelect(),className:h("w-full rounded-sm px-2 py-2 text-left text-paragraph-sm transition-colors","flex items-start gap-2","hover:bg-muted",w===o&&"bg-muted"),children:[b.icon&&e.jsx("span",{className:"shrink-0 mt-0.5",children:b.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium",children:b.label}),b.description&&e.jsx("div",{className:"text-caption text-muted-foreground truncate",children:b.description})]})]},b.id))})]})});Rt.displayName="ChatInputCommandMenu";const Et=l.createContext(void 0),fe=()=>{const s=l.useContext(Et);if(!s)throw new Error("ChatInput components must be used within ChatInput.Root");return s},At=l.forwardRef(({client:s,startSession:t,value:n,onChange:o,onSubmit:r,disabled:i=!1,isSubmitting:c,submitOnEnter:d=!0,className:p,children:a,...u},f)=>{const m=l.useRef(null),b=l.useCallback(async()=>Promise.resolve(null),[]),w=Tn(s??null,t??b),g=k(D=>D.isStreaming),x=s&&t,y=x?w.value:n||"",j=x?w.onChange:o||(()=>{}),N=x?w.onSubmit:r||(async()=>{}),C=x?w.isSubmitting||g:c||!1,[S,A]=l.useState(!1),[I,_]=l.useState(""),[L,te]=l.useState(0),[M,P]=l.useState(0),[Y,ce]=l.useState(0),X=l.useCallback(()=>{ce(D=>D+1)},[]),ps=async D=>{D.preventDefault(),y.trim()&&!C&&!i&&(await N(),setTimeout(()=>{m.current?.focus()},0))},ms=D=>{const $=D.target;!($.tagName==="BUTTON"||$.tagName==="INPUT"||$.tagName==="TEXTAREA"||$.closest("button"))&&m.current&&m.current.focus()},fs=D=>{const $=D.target;!($.tagName==="BUTTON"||$.tagName==="INPUT"||$.tagName==="TEXTAREA"||$.closest("button"))&&D.key===" "&&(D.preventDefault(),m.current&&m.current.focus())};return l.useEffect(()=>{const D=document.querySelector('textarea[name="chat-input"]');D&&m.current!==D&&(m.current=D)},[]),l.useEffect(()=>{!y&&m.current&&(m.current.style.height="auto",m.current.style.overflowY="hidden")},[y]),e.jsx(Et.Provider,{value:{value:y,onChange:j,onSubmit:N,disabled:i,isSubmitting:C,submitOnEnter:d,showCommandMenu:S,setShowCommandMenu:A,commandMenuQuery:I,setCommandMenuQuery:_,selectedMenuIndex:L,setSelectedMenuIndex:te,menuItemCount:M,setMenuItemCount:P,triggerMenuSelect:X,triggerCounter:Y},children:e.jsx("form",{ref:f,onSubmit:ps,onClick:ms,onKeyDown:fs,className:h("relative w-full divide-y rounded-xl border bg-background shadow-md",p),...u,children:a})})});At.displayName="ChatInput.Root";const Mt=l.forwardRef(({asChild:s=!1,className:t,onKeyDown:n,children:o,...r},i)=>{const{value:c,onChange:d,onSubmit:p,disabled:a,isSubmitting:u,submitOnEnter:f,showCommandMenu:m,setShowCommandMenu:b,setCommandMenuQuery:w,setSelectedMenuIndex:g,menuItemCount:x,triggerMenuSelect:y}=fe(),j=l.useRef(null),A={ref:l.useCallback(I=>{j.current=I,typeof i=="function"?i(I):i&&(i.current=I)},[i]),name:"chat-input",value:c,onChange:I=>{const _=I.target.value;if(d(_),_.startsWith("/")&&!_.includes(`
6
- `)){b(!0);const M=_.slice(1);w(M)}else b(!1),w("");const L=j.current;if(!L)return;L.style.height="auto";const te=Math.min(L.scrollHeight,164);L.style.height=`${te}px`,L.scrollHeight>164?L.style.overflowY="auto":L.style.overflowY="hidden"},onKeyDown:I=>{if(m&&x>0){if(I.key==="ArrowDown"){I.preventDefault(),g(_=>(_+1)%x);return}else if(I.key==="ArrowUp"){I.preventDefault(),g(_=>(_-1+x)%x);return}else if(I.key==="Enter"&&!I.shiftKey){I.preventDefault(),y();return}else if(I.key==="Escape"){I.preventDefault(),b(!1),w("");return}}f&&I.key==="Enter"&&!I.shiftKey&&(c.trim()&&!u&&!a?(I.preventDefault(),p()):(u||a)&&I.preventDefault()),n?.(I)},disabled:a,...r};return s&&l.isValidElement(o)?l.cloneElement(o,A):e.jsx("textarea",{...A,rows:1,className:h("w-full resize-none rounded-none border-none p-4 shadow-none","outline-none ring-0 max-h-[6lh] min-h-[44px]","bg-transparent dark:bg-transparent focus-visible:ring-0","text-paragraph-sm placeholder:text-muted-foreground","disabled:cursor-not-allowed disabled:opacity-50",t)})});Mt.displayName="ChatInput.Field";const Pt=l.forwardRef(({asChild:s=!1,className:t,disabled:n,children:o,...r},i)=>{const{value:c,disabled:d,isSubmitting:p}=fe(),a=n||d||p||!c.trim(),u=s?ae:J;return e.jsx(u,{ref:i,type:"submit",disabled:a,variant:s?void 0:"default",size:"icon",className:h(!s&&"gap-1.5 rounded-full",t),...r,children:o})});Pt.displayName="ChatInput.Submit";const _t=l.forwardRef(({className:s,children:t,...n},o)=>e.jsx("div",{ref:o,className:h("flex items-center justify-between p-2",s),...n,children:t}));_t.displayName="ChatInput.Toolbar";const Ut=l.forwardRef(({asChild:s=!1,className:t,children:n,onClick:o,...r},i)=>{const{value:c,onChange:d,setShowCommandMenu:p,setCommandMenuQuery:a}=fe(),u=m=>{c.startsWith("/")||(d("/"),p(!0),a("")),o?.(m)},f=s?ae:J;return e.jsx(f,{ref:i,type:"button",variant:"ghost",size:"icon",className:h("rounded-full",t),onClick:u,...r,children:n||e.jsx(Hs,{className:"size-4"})})});Ut.displayName="ChatInput.Actions";const Dt=l.forwardRef(({asChild:s=!1,className:t,children:n,...o},r)=>{const i=s?ae:J;return e.jsx(i,{ref:r,type:"button",variant:"ghost",size:"icon",className:h("rounded-full",t),...o,children:n||e.jsx(Vs,{className:"size-4"})})});Dt.displayName="ChatInput.Attachment";const zt=l.forwardRef(({asChild:s=!1,className:t,children:n,...o},r)=>{const i=s?ae:J;return e.jsx(i,{ref:r,type:"button",variant:"ghost",size:"icon",className:h("rounded-full",t),...o,children:n||e.jsx(Ws,{className:"size-4"})})});zt.displayName="ChatInput.VoiceInput";const Lt=l.forwardRef(({commands:s=[],className:t,onChange:n,...o},r)=>{const{showCommandMenu:i,commandMenuQuery:c,selectedMenuIndex:d,setSelectedMenuIndex:p,setMenuItemCount:a,triggerCounter:u,onChange:f}=fe();return e.jsx(Rt,{ref:r,commands:s,showCommandMenu:i,commandMenuQuery:c,selectedMenuIndex:d,setSelectedMenuIndex:p,setMenuItemCount:a,triggerCounter:u,onChange:f,className:t,...o})});Lt.displayName="ChatInput.CommandMenu";const po=({className:s,...t})=>e.jsx(hs,{className:h("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",s),...t}),Ft=({className:s,...t})=>e.jsx(xs,{className:h(s),...t}),mo=({withHandle:s,className:t,...n})=>e.jsx(bs,{className:h("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:s&&e.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-2.5 w-2.5",children:[e.jsx("title",{children:"Resize Handle"}),e.jsx("circle",{cx:"9",cy:"12",r:"1"}),e.jsx("circle",{cx:"9",cy:"5",r:"1"}),e.jsx("circle",{cx:"9",cy:"19",r:"1"}),e.jsx("circle",{cx:"15",cy:"12",r:"1"}),e.jsx("circle",{cx:"15",cy:"5",r:"1"}),e.jsx("circle",{cx:"15",cy:"19",r:"1"})]})})}),fo=({...s})=>e.jsx(Is,{position:"top-center",className:"toaster group",style:{"--top-offset":"16px","--width:":"calc(100% - 2 * var(--top-offset))",position:"absolute",zIndex:5,top:"var(--top-offset)",left:"50%",transform:"translateX(-50%)",width:"calc(100% - 2 * var(--top-offset))",maxWidth:"480px"},offset:0,toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...s}),Ot=l.createContext(void 0),le=()=>{const s=l.useContext(Ot);if(!s)throw new Error("ChatLayout components must be used within ChatLayout.Root");return s},Bt=l.forwardRef(({defaultSidebarOpen:s=!1,defaultPanelSize:t="hidden",defaultActiveTab:n="todo",className:o,children:r,...i},c)=>{const[d,p]=l.useState(s),[a,u]=l.useState(t),[f,m]=l.useState(n);return e.jsx(Ot.Provider,{value:{sidebarOpen:d,setSidebarOpen:p,panelSize:a,setPanelSize:u,activeTab:f,setActiveTab:m},children:e.jsx("div",{ref:c,className:h("flex h-screen flex-row bg-background text-foreground",o),...i,children:e.jsx(po,{direction:"horizontal",className:"flex-1",children:r})})})});Bt.displayName="ChatLayout.Root";const go=l.forwardRef(({className:s,children:t,...n},o)=>e.jsx("div",{ref:o,className:h("relative z-10 border-b border-border bg-card shrink-0",s),...n,children:t}));go.displayName="ChatLayout.Header";const $t=l.forwardRef(({className:s,children:t,...n},o)=>e.jsx(Ft,{defaultSize:75,minSize:50,children:e.jsx("div",{ref:o,className:h("flex flex-1 flex-col overflow-hidden h-full",s),...n,children:t})}));$t.displayName="ChatLayout.Main";const Ht=l.forwardRef(({showToaster:s=!0,className:t,children:n,...o},r)=>e.jsxs("div",{ref:r,className:h("relative flex flex-1 flex-col overflow-hidden",t),...o,children:[n,s&&e.jsx(fo,{})]}));Ht.displayName="ChatLayout.Body";const Vt=l.forwardRef(({className:s,children:t,onScrollChange:n,showScrollToBottom:o=!0,...r},i)=>{const[c,d]=l.useState(!1),p=l.useRef(null),a=l.useRef(!0),u=l.useRef(!1);l.useImperativeHandle(i,()=>p.current);const f=l.useCallback(()=>{const x=p.current;if(!x)return!1;const{scrollTop:y,scrollHeight:j,clientHeight:N}=x,S=j-y-N<100;return d(!S&&o),n?.(S),S},[n,o]),m=l.useCallback(()=>{if(u.current)return;const x=f();a.current=x},[f]),b=l.useCallback((x=!0)=>{const y=p.current;y&&(u.current=!0,a.current=!0,y.scrollTo({top:y.scrollHeight,behavior:x?"smooth":"auto"}),setTimeout(()=>{u.current=!1},x?300:0))},[]);l.useEffect(()=>{p.current&&(a.current&&!u.current&&requestAnimationFrame(()=>{b(!1)}),u.current||f())},[t,b,f]),l.useEffect(()=>{if(!u.current){const x=f();a.current=x}},[f]);const w=l.useCallback(()=>{u.current=!1;const x=p.current;if(!x)return;const{scrollTop:y,scrollHeight:j,clientHeight:N}=x;j-y-N>=100&&(a.current=!1)},[]),g=l.useCallback(x=>{["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(x.key)&&(u.current=!1,requestAnimationFrame(()=>{const j=p.current;if(!j)return;const{scrollTop:N,scrollHeight:C,clientHeight:S}=j,A=C-N-S;a.current=A<100}))},[]);return e.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[e.jsx("div",{ref:p,className:h("h-full overflow-y-auto flex flex-col",s),onScroll:m,onWheel:w,onTouchStart:w,onKeyDown:g,tabIndex:0,...r,children:e.jsx("div",{className:"mx-auto max-w-chat flex-1 w-full flex flex-col",children:t})}),c&&e.jsx("button",{type:"button",onClick:()=>b(!0),className:h("absolute bottom-4 left-1/2 -translate-x-1/2 z-10","flex items-center justify-center p-2 rounded-full","bg-card border border-border shadow-lg","text-foreground","hover:bg-accent hover:text-accent-foreground","transition-all duration-200 ease-in-out","animate-in fade-in slide-in-from-bottom-2"),"aria-label":"Scroll to bottom",children:e.jsx(qs,{className:"size-4"})})]})});Vt.displayName="ChatLayout.Messages";const Wt=l.forwardRef(({className:s,children:t,...n},o)=>e.jsx("div",{ref:o,className:h("bg-linear-to-t from-background to-transparent px-4 pb-4",s),...n,children:e.jsx("div",{className:"mx-auto max-w-chat",children:t})}));Wt.displayName="ChatLayout.Footer";const ho=l.forwardRef(({className:s,children:t,...n},o)=>{const{sidebarOpen:r}=le();return r?e.jsx("div",{ref:o,className:h("border-r border-border bg-card w-64 overflow-y-auto",s),...n,children:t}):null});ho.displayName="ChatLayout.Sidebar";const qt=l.forwardRef(({breakpoint:s="lg",className:t,children:n,...o},r)=>{const{panelSize:i}=le(),[c,d]=l.useState(25);return l.useEffect(()=>{const p=()=>{const u=400/window.innerWidth*100;d(Math.max(u,25))};return p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}},[]),i==="hidden"?null:e.jsxs(e.Fragment,{children:[e.jsx(mo,{withHandle:!0,className:"group-hover:opacity-100 opacity-0 transition-opacity"}),e.jsx(Ft,{defaultSize:25,minSize:c,maxSize:35,className:"group",children:e.jsx("div",{ref:r,className:h("hidden h-full border-l border-border bg-card overflow-y-auto transition-all duration-300",s==="md"&&"md:block",s==="lg"&&"lg:block",s==="xl"&&"xl:block",s==="2xl"&&"2xl:block",t),...o,children:n})})]})});qt.displayName="ChatLayout.Aside";const Qt=Es,Gt=As,xo=l.forwardRef(({className:s,inset:t,children:n,...o},r)=>e.jsxs(Fe,{ref:r,className:h("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-paragraph-sm outline-none","focus:bg-muted data-[state=open]:bg-muted",t&&"pl-8",s),...o,children:[n,e.jsx(we,{className:"ml-auto h-4 w-4"})]}));xo.displayName=Fe.displayName;const bo=l.forwardRef(({className:s,...t},n)=>e.jsx(Oe,{ref:n,className:h("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",s),...t}));bo.displayName=Oe.displayName;const ke=l.forwardRef(({className:s,sideOffset:t=4,...n},o)=>e.jsx(Rs,{children:e.jsx(Be,{ref:o,sideOffset:t,className:h("z-50 min-w-[8rem] overflow-hidden rounded-lg border border-border bg-popover p-0.5 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",s),...n})}));ke.displayName=Be.displayName;const G=l.forwardRef(({className:s,inset:t,...n},o)=>e.jsx($e,{ref:o,className:h("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-paragraph-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",s),...n}));G.displayName=$e.displayName;const yo=l.forwardRef(({className:s,children:t,...n},o)=>e.jsxs(He,{ref:o,className:h("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Ve,{children:e.jsx(dt,{className:"h-4 w-4"})})}),t]}));yo.displayName=He.displayName;const wo=l.forwardRef(({className:s,children:t,...n},o)=>e.jsxs(We,{ref:o,className:h("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Ve,{children:e.jsx(ve,{className:"h-2 w-2 fill-current"})})}),t]}));wo.displayName=We.displayName;const vo=l.forwardRef(({className:s,inset:t,...n},o)=>e.jsx(qe,{ref:o,className:h("px-2 py-1.5 text-paragraph-sm font-semibold",t&&"pl-8",s),...n}));vo.displayName=qe.displayName;const Kt=l.forwardRef(({className:s,...t},n)=>e.jsx(Qe,{ref:n,className:h("-mx-1 my-1 h-px bg-border",s),...t}));Kt.displayName=Qe.displayName;function Jt({item:s,level:t=0,onSelect:n,selectedId:o,isDropTarget:r=!1,onDownload:i,onRename:c,onDelete:d}){const[p,a]=l.useState(!0),u=o===s.id,f=()=>{s.type==="folder"&&a(!p)},m=()=>{n?.(s),s.type==="folder"&&f()},b=g=>{g.key==="Enter"||g.key===" "?(g.preventDefault(),m()):g.key==="ArrowRight"&&s.type==="folder"&&!p?(g.preventDefault(),a(!0)):g.key==="ArrowLeft"&&s.type==="folder"&&p&&(g.preventDefault(),a(!1))},w=()=>t===0?"p-2":t===1?"pl-8 pr-2 py-2":"pl-16 pr-2 py-2";return e.jsxs("div",{className:"flex flex-col w-full",children:[e.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":s.type==="folder"?p:void 0,className:h("group/item flex items-center gap-2 rounded-md cursor-pointer transition-colors text-paragraph-sm",w(),"hover:bg-accent-hover","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",u&&"bg-accent",r&&["bg-accent","border border-dashed border-border-dark"]),onClick:m,onKeyDown:b,children:[e.jsx("div",{className:"shrink-0 size-4 flex items-center justify-center text-foreground",children:s.type==="folder"?p?e.jsx(Qs,{className:"size-4"}):e.jsx(Gs,{className:"size-4"}):e.jsx(Ks,{className:"size-4"})}),e.jsx("p",{className:"flex-1 text-foreground whitespace-nowrap overflow-hidden text-ellipsis",children:s.name}),e.jsxs(Qt,{children:[e.jsx(Gt,{asChild:!0,children:e.jsx("button",{className:h("shrink-0 size-4 transition-opacity text-muted-foreground hover:text-foreground","opacity-0 group-hover/item:opacity-100","data-[state=open]:opacity-100"),onClick:g=>{g.stopPropagation()},"aria-label":"More options",type:"button",tabIndex:-1,children:e.jsx(Js,{className:"size-4"})})}),e.jsxs(ke,{align:"end",side:"bottom",sideOffset:5,alignOffset:0,collisionPadding:8,className:"w-40 z-[100]",onClick:g=>g.stopPropagation(),children:[i&&e.jsx(G,{onClick:g=>{g.stopPropagation(),i(s)},children:"Download"}),c&&e.jsx(G,{onClick:g=>{g.stopPropagation(),c(s)},children:"Rename"}),(i||c)&&d&&e.jsx(Kt,{}),d&&e.jsx(G,{className:"text-destructive focus:text-destructive focus:bg-muted",onClick:g=>{g.stopPropagation(),d(s)},children:e.jsx("span",{className:"text-paragraph-sm",children:"Delete"})})]})]}),s.type==="folder"&&e.jsx("div",{className:"shrink-0 size-4 flex items-center justify-center text-muted-foreground",children:e.jsx(re,{className:h("size-4 transition-transform",!p&&"-rotate-90")})})]}),s.type==="folder"&&p&&s.children&&e.jsx("div",{className:"flex flex-col",children:s.children.map(g=>e.jsx(Jt,{item:g,level:t+1,...n&&{onSelect:n},...o&&{selectedId:o},...i&&{onDownload:i},...c&&{onRename:c},...d&&{onDelete:d}},g.id))})]})}const jo=new Kn;function No({className:s,provider:t=jo,onItemSelect:n,onDownload:o,onRename:r,onDelete:i}){const[c,d]=l.useState([]),[p,a]=l.useState(),[u,f]=l.useState(!0),[m,b]=l.useState();l.useEffect(()=>{(async()=>{try{f(!0);const x=await t.getRootItems();d(x),b(void 0)}catch(x){b(x instanceof Error?x.message:"Failed to load items")}finally{f(!1)}})()},[t]);const w=g=>{a(g.id),n?.(g)};return u?e.jsx("div",{className:h("",s),children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):m?e.jsx("div",{className:h("",s),children:e.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",m]})}):e.jsx("div",{className:h("flex flex-col",s),children:c.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No items found"}):c.map(g=>e.jsx(Jt,{item:g,onSelect:w,...p&&{selectedId:p},...o&&{onDownload:o},...r&&{onRename:r},...i&&{onDelete:i}},g.id))})}const Yt=l.forwardRef(({source:s,isSelected:t,className:n,...o},r)=>e.jsxs("button",{ref:r,type:"button",className:h("group flex w-full text-left gap-2 items-start p-2 rounded-md cursor-pointer transition-colors text-paragraph-sm","hover:bg-accent-hover","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",t&&"bg-accent",n),onClick:()=>window.open(s.url,"_blank"),...o,children:[e.jsx("div",{className:"shrink-0 flex items-center h-5",children:e.jsx("div",{className:"relative rounded-[3px] size-4 overflow-hidden bg-muted",children:s.favicon?e.jsx("img",{alt:s.sourceName,className:"size-full object-cover",src:s.favicon}):e.jsx("div",{className:"size-full bg-muted"})})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[e.jsxs("div",{className:"text-paragraph-sm text-foreground",children:[e.jsx("span",{className:"font-medium",children:s.sourceName}),e.jsxs("span",{className:"text-muted-foreground",children:[" · ",s.title]})]}),e.jsx("p",{className:"text-paragraph-sm text-muted-foreground line-clamp-3",children:s.snippet})]})]}));Yt.displayName="SourceListItem";const Xt=l.forwardRef(({todo:s,className:t,...n},o)=>{const r=s.status==="completed";return e.jsxs("div",{ref:o,className:h("group flex items-center gap-2 p-2 rounded-md cursor-pointer transition-colors text-paragraph-sm","hover:bg-accent-hover","focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",!1,t),role:"button",tabIndex:0,...n,children:[e.jsx("div",{className:"shrink-0 size-4 flex items-center justify-center text-foreground",children:r?e.jsx(ut,{className:"size-4 text-muted-foreground"}):e.jsx(ve,{className:"size-4 text-foreground"})}),e.jsx("p",{className:h("flex-1 text-foreground",r&&"line-through text-muted-foreground",s.status==="in_progress"&&"font-medium"),children:s.text})]})});Xt.displayName="TodoListItem";const Te=l.forwardRef(({client:s,todos:t,className:n,...o},r)=>{const i=t||[];return e.jsx("div",{ref:r,className:h("space-y-2 max-h-64 overflow-y-auto",n),...o,children:i.length===0?e.jsx("p",{className:"text-paragraph-sm text-foreground opacity-60 italic",children:"No tasks yet."}):i.map(c=>e.jsx(Xt,{todo:c},c.id))})});Te.displayName="TodoList";const ge=l.forwardRef(({todos:s,className:t,...n},o)=>{const r=s&&s.length>0?s:Yn;return e.jsx("div",{ref:o,className:h("space-y-2",t),...n,children:e.jsx(Te,{todos:r})})});ge.displayName="TodoTabContent";const he=l.forwardRef(({files:s=[],provider:t,onFileSelect:n,className:o,...r},i)=>{const c=l.useCallback(a=>{console.log("Download:",a.name)},[]),d=l.useCallback(a=>{console.log("Rename:",a.name)},[]),p=l.useCallback(a=>{console.log("Delete:",a.name)},[]);return e.jsx("div",{ref:i,className:h("h-full",o),...r,children:e.jsx(No,{...t&&{provider:t},onItemSelect:a=>{a.type==="file"&&n&&n(a.path||a.name)},onDownload:c,onRename:d,onDelete:p,className:"h-full"})})});he.displayName="FilesTabContent";const xe=l.forwardRef(({sources:s,className:t,...n},o)=>{const r=s&&s.length>0?s:Jn;return e.jsx("div",{ref:o,className:h("space-y-2",t),...n,children:r.map(i=>e.jsx(Yt,{source:i},i.id))})});xe.displayName="SourcesTabContent";const So=l.forwardRef(({data:s,className:t,...n},o)=>e.jsxs("div",{ref:o,className:h("space-y-4",t),...n,children:[e.jsx("h3",{className:"font-semibold text-subheading",children:"Database"}),e.jsxs("div",{className:"text-paragraph-sm text-muted-foreground",children:[e.jsx("p",{children:"Database viewer - panel automatically expanded to large size"}),e.jsxs("div",{className:"mt-4 p-4 border border-border rounded",children:[e.jsx("p",{children:"Your large data table would go here"}),s&&typeof s=="object"?e.jsx("pre",{className:"mt-2 text-caption overflow-auto",children:JSON.stringify(s,null,2)}):null]})]})]}));So.displayName="DatabaseTabContent";const Ie=Ms,se=l.forwardRef(({className:s,...t},n)=>e.jsx(Ge,{ref:n,className:h("inline-flex h-10 items-center rounded-md bg-muted p-1 text-muted-foreground gap-1",s),...t}));se.displayName=Ge.displayName;const ne=l.forwardRef(({className:s,...t},n)=>e.jsx(Ke,{ref:n,className:h("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-paragraph-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...t}));ne.displayName=Ke.displayName;const F=l.forwardRef(({className:s,...t},n)=>e.jsx(Je,{ref:n,className:h("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...t}));F.displayName=Je.displayName;const Co=l.forwardRef(({client:s,todos:t,variant:n="animated",showIcons:o=!1,visibleTabs:r=["todo","files","database"],className:i,...c},d)=>{const p=t||[],[a,u]=l.useState(r[0]||"todo"),f=l.useRef(null),m=l.useRef(null);l.useEffect(()=>{const x=setTimeout(()=>{const y=f.current;if(a&&y){const j=m.current;if(j){const N=y.getBoundingClientRect(),C=j.getBoundingClientRect(),S=C.left-N.left,A=C.width,I=S/N.width*100,_=100-(S+A)/N.width*100;y.style.clipPath=`inset(0 ${_.toFixed(2)}% 0 ${I.toFixed(2)}% round 999px)`}}},0);return()=>clearTimeout(x)},[a]);const w=[{id:"todo",label:n==="pills"?"To-do":"To-Do List",icon:je},{id:"files",label:"Files",icon:Ne},{id:"database",label:"Database",icon:pt},{id:"sources",label:"Sources",icon:mt}].filter(g=>r.includes(g.id));return e.jsx("div",{ref:d,className:h("select-none",i),...c,children:e.jsxs(Ie,{value:a,onValueChange:u,className:"w-full",children:[n==="pills"?e.jsx(se,{className:h("w-full justify-start bg-transparent p-0 h-auto","gap-1"),children:w.map(g=>{const x=g.icon;return e.jsxs(ne,{value:g.id,className:h("gap-2 px-3 py-1.5 rounded-lg text-paragraph-sm font-medium","data-[state=active]:bg-zinc-100 data-[state=active]:text-foreground","data-[state=inactive]:text-muted-foreground"),children:[o&&x&&e.jsx(x,{className:"size-4"}),g.label]},g.id)})}):e.jsxs("div",{className:"relative mb-4 border-border",children:[e.jsx(se,{className:"bg-transparent p-0 h-auto rounded-none w-full border-none",children:w.map(g=>e.jsx(ne,{value:g.id,className:"px-3 py-1 text-paragraph-sm font-medium rounded-none text-foreground opacity-60 data-[state=active]:opacity-100 data-[state=active]:bg-transparent data-[state=active]:shadow-none",children:g.label},g.id))}),e.jsx("div",{ref:f,className:"absolute top-0 left-0 w-full overflow-hidden z-10 pointer-events-none",style:{clipPath:"inset(0 100% 0 0% round 999px)",transition:"clip-path 0.25s ease-out"},children:e.jsx(se,{className:"bg-secondary p-0 h-auto rounded-none w-full border-none",children:w.map(g=>e.jsx(ne,{value:g.id,ref:a===g.id?m:null,className:"px-3 py-1 text-paragraph-sm font-medium rounded-none text-primary bg-transparent data-[state=active]:shadow-none shadow-none",tabIndex:-1,children:g.label},g.id))})})]}),e.jsx(F,{value:"todo",className:n==="pills"?"mt-0":"",children:n==="pills"?e.jsx(ge,{todos:p}):e.jsx(Te,{todos:p})}),e.jsx(F,{value:"files",className:n==="pills"?"mt-0":"",children:e.jsx(he,{})}),e.jsx(F,{value:"database",className:n==="pills"?"mt-0":"",children:e.jsx("div",{className:"text-paragraph-sm text-foreground opacity-60 italic",children:"Database tab coming soon..."})}),e.jsx(F,{value:"sources",className:n==="pills"?"mt-0":"",children:e.jsx(xe,{})})]})})});Co.displayName="ChatSecondaryPanel";const ko=l.forwardRef(({className:s,children:t,...n},o)=>e.jsx("div",{ref:o,className:h("flex h-full flex-col",s),...n,children:t}));ko.displayName="ChatSidebar.Root";const To=l.forwardRef(({className:s,children:t,...n},o)=>e.jsx("div",{ref:o,className:h("border-b border-border px-4 py-3",s),...n,children:t}));To.displayName="ChatSidebar.Header";const Io=l.forwardRef(({className:s,children:t,...n},o)=>e.jsx("div",{ref:o,className:h("flex-1 overflow-y-auto p-4",s),...n,children:t}));Io.displayName="ChatSidebar.Content";const Ro=l.forwardRef(({className:s,children:t,...n},o)=>e.jsx("div",{ref:o,className:h("border-t border-border px-4 py-3",s),...n,children:t}));Ro.displayName="ChatSidebar.Footer";const Eo=l.forwardRef(({children:s,className:t,...n},o)=>{const[r,i]=l.useState(s),[c,d]=l.useState(!1),p=l.useRef(s),a=l.useRef(!0);return l.useEffect(()=>{if(a.current){a.current=!1,p.current=s;return}if(p.current===s)return;d(!0);const u=setTimeout(()=>{i(s),p.current=s,requestAnimationFrame(()=>{d(!1)})},150);return()=>{clearTimeout(u)}},[s]),e.jsx("span",{ref:o,className:h("text-sm text-foreground opacity-60 transition-opacity duration-300",c?"opacity-0":"opacity-60",t),...n,children:r})});Eo.displayName="ChatStatus";const Q=q("gui");function Ao({children:s}){const{setPanelSize:t,setActiveTab:n}=le(),o=()=>{t("small"),n("files")};return e.jsx(e.Fragment,{children:s({openFiles:o})})}function Mo(){const{activeTab:s,setActiveTab:t}=le();return e.jsxs(Ie,{value:s,onValueChange:n=>t(n),className:"flex flex-col h-full",children:[e.jsx("div",{className:h("border-b border-border bg-card","px-6 py-2 h-16","flex items-center","[border-bottom-width:0.5px]"),children:e.jsx(Re,{showIcons:!0,visibleTabs:["todo","files","sources"],variant:"compact"})}),e.jsx(F,{value:"todo",className:"flex-1 p-4 mt-0",children:e.jsx(ge,{})}),e.jsx(F,{value:"files",className:"flex-1 p-4 mt-0",children:e.jsx(he,{})}),e.jsx(F,{value:"sources",className:"flex-1 p-4 mt-0",children:e.jsx(xe,{})})]})}function Po({agentName:s,showHeader:t}){const{isExpanded:n,setIsExpanded:o}=Ce();return e.jsxs("div",{className:"flex lg:hidden items-center flex-1",children:[t&&e.jsx("div",{className:"flex items-center gap-2 flex-1",children:e.jsx("h1",{className:"text-heading-4 text-foreground",children:s})}),!t&&e.jsx("div",{className:"flex-1"}),e.jsx(ds,{}),e.jsx(be,{"aria-label":"Toggle menu",onClick:()=>o(!n),children:e.jsx(ft,{className:h("size-4 text-muted-foreground transition-transform duration-200",n?"":"rotate-180")})})]})}function _o({agentName:s,todos:t,sources:n,showHeader:o}){const{panelSize:r,setPanelSize:i}=le();return e.jsxs(Tt,{className:h("border-b border-border bg-card relative lg:p-0","[border-bottom-width:0.5px]"),children:[e.jsxs("div",{className:"hidden lg:flex items-center w-full h-16 py-5 pl-6 pr-4",children:[o&&e.jsx("div",{className:"flex items-center gap-2 flex-1",children:e.jsx("h1",{className:"text-heading-4 text-foreground",children:s})}),!o&&e.jsx("div",{className:"flex-1"}),e.jsx(ds,{}),e.jsx(be,{"aria-label":"Toggle sidebar",onClick:()=>{i(r==="hidden"?"small":"hidden")},children:e.jsx(en,{className:"size-4 text-muted-foreground"})})]}),e.jsx(Po,{agentName:s,showHeader:o}),e.jsx(It,{className:h("pt-6 pb-8 px-6","border-b border-border bg-card","shadow-[0_4px_16px_0_rgba(0,0,0,0.04)]","[border-bottom-width:0.5px]"),children:e.jsxs(Ie,{defaultValue:"todo",className:"w-full",children:[e.jsx(Re,{showIcons:!0,visibleTabs:["todo","files","sources"],variant:"default"}),e.jsx(F,{value:"todo",className:"mt-4",children:e.jsx(ge,{todos:t})}),e.jsx(F,{value:"files",className:"mt-4",children:e.jsx(he,{})}),e.jsx(F,{value:"sources",className:"mt-4",children:e.jsx(xe,{sources:n})})]})})]})}function Uo({client:s,initialSessionId:t,error:n}){const{connectionStatus:o,connect:r,sessionId:i,startSession:c}=In(s,t),{messages:d,sendMessage:p}=wt(s,c);Rn(s);const a=k(M=>M.error),u=k(M=>M.currentModel),[f,m]=l.useState("Agent"),[b,w]=l.useState("This agent can help you with your tasks. Start a conversation by typing a message below."),[g,x]=l.useState(["Search the web for the latest news on top tech company earnings, produce a summary for each company, and then a macro trend analysis of the tech industry. Use your todo list","What can you help me with?"]),[y,j]=l.useState(typeof window<"u"?window.innerWidth>=1024:!0),[N,C]=l.useState("Type a message or / for commands...");l.useEffect(()=>{Q.debug("Connection status changed",{status:o}),o==="error"&&a&&Q.error("Connection error occurred",{error:a})},[o,a]),l.useEffect(()=>{if(s){const M=s.getCurrentSession();M?.metadata?.agentName&&m(M.metadata.agentName);const P=s.getAgentInfo();P.displayName?m(P.displayName):P.name&&m(P.name),P.description&&w(P.description),P.suggestedPrompts&&P.suggestedPrompts.length>0&&x(P.suggestedPrompts)}},[s,i,o]),l.useEffect(()=>{const M=window.matchMedia("(min-width: 1024px)"),P=Y=>{j(Y.matches)};return j(M.matches),M.addEventListener("change",P),()=>{M.removeEventListener("change",P)}},[]);const S=M=>{C(M)},A=()=>{C("Type a message or / for commands...")};if(n)return e.jsx("div",{className:"flex items-center justify-center h-screen bg-background",children:e.jsxs("div",{className:"text-center p-8 max-w-md",children:[e.jsx("h1",{className:"text-2xl font-bold text-destructive mb-4",children:"Initialization Error"}),e.jsx("p",{className:"text-foreground mb-4",children:n}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to initialize the ACP client. Check the console for details."})]})});const I=[],_=[{id:"1",title:"Boeing Scores Early Wins at Dubai Airshow",sourceName:"Reuters",url:"https://www.reuters.com/markets/companies/BA.N",snippet:"DUBAI, Nov 17 (Reuters) - Boeing (BA.N), opens new tab took centre stage at day one of the Dubai Airshow on Monday, booking a $38 billion order from host carrier Emirates and clinching more deals with African carriers, while China displayed its C919 in the Middle East for the first time.",favicon:"https://www.google.com/s2/favicons?domain=reuters.com&sz=32"},{id:"2",title:"Boeing's Sustainable Aviation Goals Take Flight",sourceName:"Forbes",url:"https://www.forbes.com",snippet:"SEATTLE, Nov 18 (Reuters) - Boeing is making headway towards its sustainability targets, unveiling plans for a new eco-friendly aircraft design aimed at reducing emissions by 50% by 2030.",favicon:"https://www.google.com/s2/favicons?domain=forbes.com&sz=32"},{id:"3",title:"Boeing Faces Increased Competition in Global Aviation Market",sourceName:"Reuters",url:"https://www.reuters.com",snippet:"CHICAGO, Nov 19 (Reuters) - As the global aviation industry rebounds post-pandemic, Boeing is grappling with intensified competition from rival manufacturers, particularly in the Asian market.",favicon:"https://www.google.com/s2/favicons?domain=reuters.com&sz=32"},{id:"4",title:"Boeing's Starliner Successfully Completes Orbital Test Flight",sourceName:"The Verge",url:"https://www.theverge.com",snippet:"NASA, Nov 20 (Reuters) - Boeing's CST-100 Starliner spacecraft achieves a significant milestone, successfully completing its orbital test flight, paving the way for future crewed missions to the International Space Station.",favicon:"https://www.google.com/s2/favicons?domain=theverge.com&sz=32"}],L=k(M=>M.latestContextSize),te=[{id:"model-sonnet",label:"Use Sonnet 4.5",description:"Switch to Claude Sonnet 4.5 model",icon:e.jsx(Me,{className:"h-4 w-4"}),category:"model",onSelect:()=>{Q.info("User selected Sonnet 4.5 model")}},{id:"model-opus",label:"Use Opus",description:"Switch to Claude Opus model",icon:e.jsx(Me,{className:"h-4 w-4"}),category:"model",onSelect:()=>{Q.info("User selected Opus model")}},{id:"settings",label:"Open Settings",description:"Configure chat preferences",icon:e.jsx(Ys,{className:"h-4 w-4"}),category:"action",onSelect:()=>{Q.info("User opened settings")}},{id:"code-mode",label:"Code Mode",description:"Enable code-focused responses",icon:e.jsx(Xs,{className:"h-4 w-4"}),category:"mode",onSelect:()=>{Q.info("User enabled code mode")}}];return e.jsxs(Bt,{defaultPanelSize:"hidden",defaultActiveTab:"todo",children:[e.jsxs($t,{children:[e.jsx(_o,{agentName:f,todos:I,sources:_,showHeader:d.length>0}),o==="error"&&a&&e.jsx("div",{className:"border-b border-destructive/20 bg-destructive/10 px-6 py-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"mb-1 text-paragraph-sm font-semibold text-destructive",children:"Connection Error"}),e.jsx("p",{className:"whitespace-pre-line text-paragraph-sm text-foreground",children:a})]}),e.jsx("button",{type:"button",onClick:r,className:"rounded-lg bg-destructive px-4 py-2 text-paragraph-sm font-medium text-destructive-foreground transition-colors hover:bg-destructive-hover",children:"Retry"})]})}),e.jsxs(Ht,{children:[e.jsx(Vt,{children:d.length===0?e.jsx(Ao,{children:({openFiles:M})=>e.jsx("div",{className:"flex flex-1 items-center px-4",children:e.jsx(Ct,{title:f,description:b,suggestedPrompts:g,onPromptClick:P=>{p(P),C("Type a message or / for commands..."),Q.info("Prompt clicked",{prompt:P})},onPromptHover:S,onPromptLeave:A,onOpenFiles:M})})}):e.jsx("div",{className:"flex flex-col px-4",children:d.map((M,P)=>{const Y=P===0,ce=Y?null:d[P-1];let X="mt-2";return Y?X="mt-2":M.role==="user"?X=(ce?.role==="user","mt-4"):M.role==="assistant"&&(X=ce?.role==="assistant"?"mt-2":"mt-6"),e.jsx(ss,{message:M,className:X,isLastMessage:P===d.length-1,children:e.jsx(rs,{message:M,thinkingDisplayStyle:"collapsible"})},M.id)})})}),e.jsx(Wt,{children:e.jsxs(At,{client:s,startSession:c,children:[e.jsx(Lt,{commands:te}),e.jsx(Mt,{placeholder:N,autoFocus:!0}),e.jsxs(_t,{children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx(Ut,{}),e.jsx(Dt,{}),L!=null&&e.jsx(es,{contextSize:L,modelContextWindow:u?.includes("claude")?2e5:128e3})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(zt,{}),e.jsx(Pt,{children:e.jsx(Zs,{className:"size-4"})})]})]})]})})]})]}),y&&e.jsx(qt,{breakpoint:"lg",children:e.jsx(Mo,{})})]})}const Do=Ps,zo=_s,Lo=Us,Zt=l.forwardRef(({className:s,sideOffset:t=4,...n},o)=>e.jsx(Ye,{ref:o,sideOffset:t,className:h("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...n}));Zt.displayName=Ye.displayName;const es=l.forwardRef(({contextSize:s,modelContextWindow:t,className:n,...o},r)=>{const i=Math.max(s.totalEstimated,s.llmReportedInputTokens??0),c=i/t*100,d=`${c.toFixed(1)}%`,p=Math.min(100,Math.max(0,c)),u=(j=>j<50?"text-foreground":j<75?"text-yellow-500":"text-red-500")(c),f=j=>i===0?"0.0%":`${(j/i*100).toFixed(1)}%`,m=16,b=2,w=(m-b)/2,g=m/2,x=2*Math.PI*w,y=x-p/100*x;return e.jsx(Do,{children:e.jsxs(zo,{children:[e.jsx(Lo,{asChild:!0,children:e.jsx(J,{ref:r,type:"button",variant:"ghost",size:"icon",className:h("rounded-full cursor-default",u,n),...o,children:e.jsxs("svg",{width:m,height:m,viewBox:`0 0 ${m} ${m}`,className:"transform -rotate-90",children:[e.jsx("circle",{cx:g,cy:g,r:w,stroke:"currentColor",strokeWidth:b,fill:"transparent",className:"opacity-20"}),e.jsx("circle",{cx:g,cy:g,r:w,stroke:"currentColor",strokeWidth:b,fill:"transparent",strokeDasharray:x,strokeDashoffset:y,strokeLinecap:"round",className:"transition-all duration-300 ease-in-out"})]})})}),e.jsx(Zt,{side:"top",align:"center",className:"p-3",children:e.jsxs("div",{className:"space-y-2 font-mono text-xs",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between gap-6",children:[e.jsx("span",{className:"text-muted-foreground",children:"System Prompt:"}),e.jsxs("div",{className:"flex gap-1 items-baseline",children:[e.jsx("span",{children:s.systemPromptTokens.toLocaleString()}),e.jsxs("span",{className:"text-muted-foreground text-[10px]",children:["(",f(s.systemPromptTokens),")"]})]})]}),s.toolOverheadTokens!==void 0&&s.toolOverheadTokens>0&&e.jsxs("div",{className:"flex justify-between gap-6",children:[e.jsx("span",{className:"text-muted-foreground",children:"Tools Definition:"}),e.jsxs("div",{className:"flex gap-1 items-baseline",children:[e.jsx("span",{children:s.toolOverheadTokens.toLocaleString()}),e.jsxs("span",{className:"text-muted-foreground text-[10px]",children:["(",f(s.toolOverheadTokens),")"]})]})]}),s.mcpOverheadTokens!==void 0&&s.mcpOverheadTokens>0&&e.jsxs("div",{className:"flex justify-between gap-6",children:[e.jsx("span",{className:"text-muted-foreground",children:"MCPs Definition:"}),e.jsxs("div",{className:"flex gap-1 items-baseline",children:[e.jsx("span",{children:s.mcpOverheadTokens.toLocaleString()}),e.jsxs("span",{className:"text-muted-foreground text-[10px]",children:["(",f(s.mcpOverheadTokens),")"]})]})]}),e.jsxs("div",{className:"flex justify-between gap-6",children:[e.jsx("span",{className:"text-muted-foreground",children:"User Messages:"}),e.jsxs("div",{className:"flex gap-1 items-baseline",children:[e.jsx("span",{children:s.userMessagesTokens.toLocaleString()}),e.jsxs("span",{className:"text-muted-foreground text-[10px]",children:["(",f(s.userMessagesTokens),")"]})]})]}),e.jsxs("div",{className:"flex justify-between gap-6",children:[e.jsx("span",{className:"text-muted-foreground",children:"Assistant Messages:"}),e.jsxs("div",{className:"flex gap-1 items-baseline",children:[e.jsx("span",{children:s.assistantMessagesTokens.toLocaleString()}),e.jsxs("span",{className:"text-muted-foreground text-[10px]",children:["(",f(s.assistantMessagesTokens),")"]})]})]}),e.jsxs("div",{className:"flex justify-between gap-6",children:[e.jsx("span",{className:"text-muted-foreground",children:"Tool Inputs:"}),e.jsxs("div",{className:"flex gap-1 items-baseline",children:[e.jsx("span",{children:s.toolInputTokens.toLocaleString()}),e.jsxs("span",{className:"text-muted-foreground text-[10px]",children:["(",f(s.toolInputTokens),")"]})]})]}),e.jsxs("div",{className:"flex justify-between gap-6",children:[e.jsx("span",{className:"text-muted-foreground",children:"Tool Results:"}),e.jsxs("div",{className:"flex gap-1 items-baseline",children:[e.jsx("span",{children:s.toolResultsTokens.toLocaleString()}),e.jsxs("span",{className:"text-muted-foreground text-[10px]",children:["(",f(s.toolResultsTokens),")"]})]})]})]}),e.jsx("div",{className:"border-t border-border pt-2",children:e.jsxs("div",{className:h("flex justify-end gap-2 font-semibold",u),children:[e.jsx("span",{children:i.toLocaleString()}),e.jsxs("span",{children:["(",d,")"]})]})})]})})]})})});es.displayName="ContextUsageButton";const Fo=l.forwardRef(({autoScroll:s=!0,isStreaming:t=!1,scrollBehavior:n="smooth",scrollThreshold:o=100,showScrollButton:r=!0,scrollButton:i,className:c,children:d,...p},a)=>{const u=l.useRef(null),[f,m]=l.useState(!0),[b,w]=l.useState(!1),g=l.useRef(0);l.useImperativeHandle(a,()=>{if(!u.current)throw new Error("Container ref not initialized");return u.current});const x=l.useCallback(()=>{const j=u.current;if(!j)return;const{scrollTop:N,scrollHeight:C,clientHeight:S}=j,I=C-N-S<o;m(I),w(!I&&r),g.current=N},[o,r]),y=l.useCallback((j=n)=>{const N=u.current;N&&N.scrollTo({top:N.scrollHeight,behavior:j})},[n]);return l.useEffect(()=>{!s||!u.current||(t&&f?y("auto"):!t&&f&&y())},[s,t,f,y]),l.useEffect(()=>{const j=u.current;if(!j)return;const N=()=>{x()};return j.addEventListener("scroll",N,{passive:!0}),x(),()=>{j.removeEventListener("scroll",N)}},[x]),l.useEffect(()=>{const j=u.current;if(!j)return;const N=new ResizeObserver(()=>{f&&s&&y("auto")});return N.observe(j),()=>{N.disconnect()}},[f,s,y]),e.jsxs("div",{className:"relative flex-1",children:[e.jsx("div",{ref:u,className:h("h-full overflow-y-auto overflow-x-hidden","scrollbar-thin scrollbar-thumb-[border] scrollbar-track-transparent",c),...p,children:e.jsx("div",{className:"flex flex-col gap-4 px-4 py-4",children:d})}),b&&e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10",children:i||e.jsxs("button",{type:"button",onClick:()=>y(),className:"px-4 py-2 rounded-full bg-card border border-border shadow-lg hover:shadow-xl hover:bg-card/90 transition-all text-sm font-medium text-foreground flex items-center gap-2","aria-label":"Scroll to bottom",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Down arrow",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})}),"Scroll to bottom"]})})]})});Fo.displayName="Conversation";const Oo=Ds,ts=l.forwardRef(({className:s,...t},n)=>e.jsx(Xe,{ref:n,className:h("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t}));ts.displayName=Xe.displayName;const Bo=l.forwardRef(({className:s,children:t,...n},o)=>e.jsxs(Oo,{children:[e.jsx(ts,{}),e.jsxs(Ze,{ref:o,className:h("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...n,children:[t,e.jsxs(zs,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(tn,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bo.displayName=Ze.displayName;const $o=l.forwardRef(({className:s,...t},n)=>e.jsx(et,{ref:n,className:h("text-subheading font-semibold leading-none tracking-tight",s),...t}));$o.displayName=et.displayName;const Ho=l.forwardRef(({className:s,...t},n)=>e.jsx(tt,{ref:n,className:h("text-paragraph-sm text-muted-foreground",s),...t}));Ho.displayName=tt.displayName;const be=l.forwardRef(({className:s,...t},n)=>e.jsx(J,{ref:n,variant:"ghost",size:"icon",className:h("rounded-full",s),...t}));be.displayName="IconButton";const Vo=K("flex h-10 w-full rounded-md border bg-input-background px-3 py-2 text-paragraph-sm ring-offset-background file:border-0 file:bg-transparent file:text-paragraph-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),Wo=l.forwardRef(({className:s,type:t,variant:n,...o},r)=>e.jsx("input",{type:t,className:h(Vo({variant:n,className:s})),ref:r,...o}));Wo.displayName="Input";const qo=l.forwardRef(({className:s,...t},n)=>e.jsx(st,{ref:n,className:h("text-label font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...t}));qo.displayName=st.displayName;const Qo=K("flex animate-fadeIn",{variants:{role:{user:"max-w-[80%] self-end ml-auto mr-2",assistant:"self-start mr-auto",system:"self-start mr-auto max-w-full"},layout:{default:"",full:"max-w-full",compact:"max-w-[90%]"}},defaultVariants:{role:"assistant",layout:"default"}}),ss=l.forwardRef(({message:s,role:t,layout:n,className:o,children:r,messageId:i,autoScroll:c,isLastMessage:d=!1,...p},a)=>{const u=s?s.role:t||"assistant",f=s?s.id:i,m=l.useRef(null),[b,w]=l.useState(void 0);return l.useImperativeHandle(a,()=>m.current),l.useEffect(()=>{if(!d||u!=="assistant"){w(void 0);return}const g=()=>{const y=m.current;if(!y)return;let j=y.parentElement;for(;j&&!j.classList.contains("overflow-y-auto");)j=j.parentElement;if(!j)return;const N=y.previousElementSibling;if(!N||N.getAttribute("aria-label")!=="user message"){w(void 0);return}const C=j.clientHeight,S=N.offsetHeight,I=Math.max(0,C-S-32);w(I)};g();const x=new ResizeObserver(g);if(m.current){x.observe(m.current);let y=m.current.parentElement;for(;y&&!y.classList.contains("overflow-y-auto");)y=y.parentElement;y&&x.observe(y)}return()=>x.disconnect()},[d,u]),l.useEffect(()=>{if((c!==void 0?c:u==="user")&&m.current){const x=setTimeout(()=>{m.current?.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},50);return()=>clearTimeout(x)}},[u,c]),e.jsx("article",{ref:m,"aria-label":`${u} message`,"data-message-id":f,className:h(Qo({role:u,layout:n}),o),style:{minHeight:b!==void 0?`${b}px`:void 0},...p,children:r})});ss.displayName="Message";const Ue=K("mb-3 rounded-lg bg-card border border-border transition-all",{variants:{variant:{default:"opacity-70",subtle:"opacity-50",prominent:"opacity-90 shadow-sm"}},defaultVariants:{variant:"default"}}),Go=K("w-4 h-4 text-foreground opacity-60 transition-transform duration-200",{variants:{expanded:{true:"rotate-180",false:""}},defaultVariants:{expanded:!1}}),ns=l.forwardRef(({content:s,isStreaming:t=!1,mode:n="collapsible",defaultExpanded:o=!1,autoExpand:r=!1,autoCollapse:i=!0,autoCollapseDelay:c=2e3,label:d="Thinking",variant:p,className:a},u)=>{const[f,m]=l.useState(n==="inline"?!0:o),[b,w]=l.useState(!1);return l.useEffect(()=>{if(i&&!t&&s&&n==="collapsible"){const g=setTimeout(()=>{w(!0),m(!1)},c);return()=>clearTimeout(g)}},[t,s,i,c,n]),l.useEffect(()=>{r&&t&&n==="collapsible"&&!b&&m(!0)},[r,t,n,b]),!s&&!t?null:n==="inline"?e.jsxs("div",{ref:u,className:h(Ue({variant:p}),"p-3",a),children:[e.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[e.jsx("span",{className:"text-caption font-medium text-foreground opacity-60 uppercase tracking-wide",children:d}),t&&e.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse"})]}),e.jsxs("div",{className:"text-paragraph-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,t&&s&&e.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})]}):e.jsxs("div",{ref:u,className:h("mb-3",a),children:[e.jsxs("button",{type:"button",onClick:()=>{m(!f),w(!1)},className:"w-full flex items-center justify-between p-2.5 rounded-lg bg-card border border-border hover:bg-card/80 hover:shadow-sm transition-all text-left","aria-expanded":f,"aria-label":`${f?"Collapse":"Expand"} reasoning`,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx("span",{className:"text-caption font-medium text-foreground opacity-60 uppercase tracking-wide shrink-0",children:d}),t&&e.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse shrink-0"}),!f&&s&&e.jsxs("span",{className:"text-caption text-foreground opacity-50 truncate",children:[s.substring(0,60),s.length>60&&"..."]})]}),e.jsx(re,{className:Go({expanded:f}),"aria-hidden":"true"})]}),f&&e.jsx("div",{className:h(Ue({variant:p}),"mt-2 p-3 animate-fadeIn"),children:e.jsxs("div",{className:"text-paragraph-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,t&&s&&e.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})})]})});ns.displayName="Reasoning";const ue=l.forwardRef(({content:s,isStreaming:t=!1,showEmpty:n=!0,emptyMessage:o="",className:r,...i},c)=>{if(!s&&t&&n)return e.jsx("div",{ref:c,className:h("opacity-70 italic text-paragraph-sm",r),...i,children:o});if(!s)return null;const d={table:({node:p,...a})=>e.jsx("div",{className:"overflow-x-auto my-4",children:e.jsx("table",{className:"min-w-full border-collapse border border-border rounded-md",...a})}),thead:({node:p,...a})=>e.jsx("thead",{className:"bg-card border-b border-border",...a}),tbody:({node:p,...a})=>e.jsx("tbody",{...a}),tr:({node:p,...a})=>e.jsx("tr",{className:"border-b border-border hover:bg-card transition-colors",...a}),th:({node:p,...a})=>e.jsx("th",{className:"px-4 py-2 text-left font-semibold text-foreground border-r border-border last:border-r-0",...a}),td:({node:p,...a})=>e.jsx("td",{className:"px-4 py-2 text-foreground border-r border-border last:border-r-0",...a}),input:({node:p,checked:a,...u})=>u.type==="checkbox"?e.jsx("input",{type:"checkbox",checked:a||!1,disabled:!0,readOnly:!0,className:"mr-2 w-4 h-4 accent-[primary] cursor-not-allowed",...u}):e.jsx("input",{...u}),code:({node:p,...a})=>a.className?.includes("language-")?e.jsx("code",{className:"block p-4 bg-card border border-border rounded-md overflow-x-auto text-code text-foreground shadow-sm",...a}):e.jsx("code",{className:"px-1.5 py-0.5 bg-card border border-border rounded text-code text-foreground",...a}),pre:({node:p,...a})=>e.jsx("pre",{className:"my-4 rounded-lg",...a}),h1:({node:p,...a})=>e.jsx("h1",{className:"text-heading-3 mt-6 mb-4 text-foreground border-b border-border pb-2",...a}),h2:({node:p,...a})=>e.jsx("h2",{className:"text-subheading mt-5 mb-3 text-foreground border-b border-border/50 pb-1.5",...a}),h3:({node:p,...a})=>e.jsx("h3",{className:"text-subheading mt-4 mb-2 text-foreground",...a}),h4:({node:p,...a})=>e.jsx("h4",{className:"text-paragraph-sm font-semibold mt-3 mb-2 text-foreground",...a}),ul:({node:p,...a})=>{const u=p?.children?.some(f=>typeof f=="object"&&f!==null&&"type"in f&&f.type==="element"&&"tagName"in f&&f.tagName==="li"&&"children"in f&&Array.isArray(f.children)&&f.children.some(m=>typeof m=="object"&&m!==null&&"type"in m&&m.type==="element"&&"tagName"in m&&m.tagName==="input"&&"properties"in m&&typeof m.properties=="object"&&m.properties!==null&&"type"in m.properties&&m.properties.type==="checkbox"));return e.jsx("ul",{className:h("my-2 space-y-1 text-foreground",u?"list-none space-y-2":"list-disc list-outside pl-4"),...a})},ol:({node:p,...a})=>e.jsx("ol",{className:"list-decimal list-outside pl-4 my-2 space-y-1 text-foreground",...a}),li:({node:p,...a})=>{const u=p?.children?.some(f=>typeof f=="object"&&f!==null&&"type"in f&&f.type==="element"&&"tagName"in f&&f.tagName==="input"&&"properties"in f&&typeof f.properties=="object"&&f.properties!==null&&"type"in f.properties&&f.properties.type==="checkbox");return e.jsx("li",{className:h(u?"flex items-start gap-2":""),...a})},a:({node:p,...a})=>e.jsx("a",{className:"text-primary hover:underline decoration-2 underline-offset-2 transition-all",target:"_blank",rel:"noopener noreferrer",...a}),p:({node:p,...a})=>e.jsx("p",{className:"mb-2 text-foreground leading-relaxed",...a}),blockquote:({node:p,...a})=>e.jsx("blockquote",{className:"border-l-4 border-[primary] pl-4 italic my-4 text-foreground bg-card py-2 rounded-r-md shadow-sm",...a}),hr:({node:p,...a})=>e.jsx("hr",{className:"my-6 border-t border-border opacity-50",...a})};return e.jsx("div",{ref:c,className:h("markdown-content prose prose-sm max-w-none dark:prose-invert",r),...i,children:e.jsx(ys,{remarkPlugins:[pn],components:d,children:s})})});ue.displayName="Response";const Ko={theme:"system",setTheme:()=>null,resolvedTheme:"light"},os=l.createContext(Ko);function Jo({children:s,defaultTheme:t="system",storageKey:n="vite-ui-theme"}){const[o,r]=l.useState(()=>localStorage.getItem(n)||t),[i,c]=l.useState("light");l.useEffect(()=>{const p=window.document.documentElement;if(p.classList.remove("light","dark"),o==="system"){const a=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";p.classList.add(a),c(a);return}p.classList.add(o),c(o)},[o]);const d={theme:o,setTheme:p=>{localStorage.setItem(n,p),r(p)},resolvedTheme:i};return e.jsx(os.Provider,{value:d,children:s})}const as=()=>{const s=l.useContext(os);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},De={Globe:rn,Link:an,Cloud:on,CheckSquare:je,Search:nn,FileText:Ne,Edit:sn,Wrench:gt};function ze({toolCall:s}){const[t,n]=l.useState(!1),{resolvedTheme:o}=as(),r=s.icon&&De[s.icon]?De[s.icon]:gt,i=s.prettyName||s.title,c={fontSize:"11px",backgroundColor:"transparent",fontFamily:"inherit","--w-rjv-color":o==="dark"?"#fafafa":"#09090b","--w-rjv-key-string":o==="dark"?"#fafafa":"#09090b","--w-rjv-background-color":"transparent","--w-rjv-line-color":o==="dark"?"#27272a":"#e4e4e7","--w-rjv-arrow-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-edit-color":o==="dark"?"#fafafa":"#09090b","--w-rjv-info-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-update-color":o==="dark"?"#fafafa":"#09090b","--w-rjv-copied-color":o==="dark"?"#fafafa":"#09090b","--w-rjv-copied-success-color":o==="dark"?"#22c55e":"#16a34a","--w-rjv-curlybraces-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-colon-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-brackets-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-quotes-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-quotes-string-color":o==="dark"?"#a1a1aa":"#71717a","--w-rjv-type-string-color":o==="dark"?"#22c55e":"#16a34a","--w-rjv-type-int-color":o==="dark"?"#f59e0b":"#d97706","--w-rjv-type-float-color":o==="dark"?"#f59e0b":"#d97706","--w-rjv-type-bigint-color":o==="dark"?"#f59e0b":"#d97706","--w-rjv-type-boolean-color":o==="dark"?"#3b82f6":"#2563eb","--w-rjv-type-date-color":o==="dark"?"#ec4899":"#db2777","--w-rjv-type-url-color":o==="dark"?"#3b82f6":"#2563eb","--w-rjv-type-null-color":o==="dark"?"#ef4444":"#dc2626","--w-rjv-type-nan-color":o==="dark"?"#ef4444":"#dc2626","--w-rjv-type-undefined-color":o==="dark"?"#ef4444":"#dc2626"};return e.jsxs("div",{className:"flex flex-col my-4",children:[e.jsx("button",{type:"button",className:"flex items-center gap-2 cursor-pointer bg-transparent border-none p-0 text-left group w-fit",onClick:()=>n(!t),"aria-expanded":t,children:e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[e.jsx("div",{className:"text-muted-foreground",children:e.jsx(r,{className:"h-3 w-3"})}),e.jsx("span",{className:"text-paragraph-sm text-muted-foreground",children:i}),e.jsx(re,{className:`h-3 w-3 text-muted-foreground/70 transition-transform duration-200 ${t?"rotate-180":""}`})]})}),t&&e.jsxs("div",{className:"mt-2 text-sm border border-border rounded-lg bg-card overflow-hidden w-full",children:[s.locations&&s.locations.length>0&&e.jsxs("div",{className:"p-3 border-b border-border",children:[e.jsx("div",{className:"text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans",children:"Files"}),e.jsx("ul",{className:"space-y-1",children:s.locations.map(d=>e.jsxs("li",{className:"font-mono text-[11px] text-foreground bg-muted px-1.5 py-0.5 rounded w-fit",children:[d.path,d.line!==null&&d.line!==void 0&&`:${d.line}`]},`${d.path}:${d.line??""}`))})]}),s.rawInput&&Object.keys(s.rawInput).length>0&&e.jsxs("div",{className:"p-3 border-b border-border",children:[e.jsx("div",{className:"text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans",children:"Input"}),e.jsx("div",{className:"text-[11px] font-mono text-foreground",children:e.jsx(Ae,{value:s.rawInput,collapsed:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:c})})]}),s.content&&s.content.length>0||s.error?e.jsxs("div",{className:"p-3 border-b border-border last:border-0",children:[e.jsx("div",{className:"text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans",children:"Output"}),e.jsxs("div",{className:"space-y-2 text-[11px] text-foreground",children:[s.content?.map((d,p)=>{const a=()=>d.type==="diff"&&"path"in d?`diff-${d.path}-${p}`:d.type==="terminal"&&"terminalId"in d?`terminal-${d.terminalId}`:d.type==="text"&&"text"in d?`text-${d.text.substring(0,20)}-${p}`:d.type==="content"&&"content"in d?`content-${d.content.text?.substring(0,20)}-${p}`:`block-${p}`,u=(f,m)=>{try{const b=JSON.parse(f);if(typeof b=="object"&&b!==null)return e.jsx("div",{className:"text-[11px]",children:e.jsx(Ae,{value:b,collapsed:!1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:c})},m)}catch{}return e.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-foreground overflow-x-auto",children:f},m)};if(d.type==="content"&&"content"in d){const f=d.content;if(f.type==="text"&&f.text)return u(f.text,a())}return d.type==="text"&&"text"in d?u(d.text,a()):d.type==="diff"&&"path"in d&&"oldText"in d&&"newText"in d?e.jsxs("div",{className:"border border-border rounded bg-card",children:[e.jsxs("div",{className:"bg-muted px-2 py-1 text-[10px] font-mono text-muted-foreground border-b border-border",children:[d.path,"line"in d&&d.line!==null&&d.line!==void 0&&`:${d.line}`]}),e.jsxs("div",{className:"p-2 font-mono text-[11px]",children:[e.jsxs("div",{className:"text-red-500 dark:text-red-400",children:["- ",d.oldText]}),e.jsxs("div",{className:"text-green-500 dark:text-green-400",children:["+ ",d.newText]})]})]},a()):d.type==="terminal"&&"terminalId"in d?e.jsxs("div",{className:"bg-neutral-900 text-neutral-100 p-2 rounded text-[11px] font-mono",children:["Terminal: ",d.terminalId]},a()):null}),s.error&&e.jsxs("div",{className:"text-destructive font-mono text-[11px] mt-2",children:["Error: ",s.error]})]})]}):null,s._meta?.truncationWarning&&e.jsxs("div",{className:"mx-3 mt-3 mb-0 flex items-center gap-2 rounded-md bg-yellow-50 dark:bg-yellow-950/20 px-3 py-2 text-[11px] text-yellow-800 dark:text-yellow-200 border border-yellow-200 dark:border-yellow-900",children:[e.jsx("span",{className:"text-yellow-600 dark:text-yellow-500",children:"⚠️"}),e.jsx("span",{children:s._meta.truncationWarning})]}),(s.tokenUsage||s.startedAt)&&e.jsxs("div",{className:"p-2 bg-muted/50 border-t border-border flex flex-wrap gap-4 text-[10px] text-muted-foreground font-sans",children:[s.tokenUsage&&e.jsxs("div",{className:"flex gap-3",children:[s.tokenUsage.inputTokens!==void 0&&e.jsxs("div",{children:[e.jsx("span",{className:"uppercase tracking-wide font-semibold mr-1",children:"Input:"}),s.tokenUsage.inputTokens.toLocaleString()]}),s.tokenUsage.outputTokens!==void 0&&e.jsxs("div",{children:[e.jsx("span",{className:"uppercase tracking-wide font-semibold mr-1",children:"Output:"}),s.tokenUsage.outputTokens.toLocaleString()]}),s.tokenUsage.totalTokens!==void 0&&e.jsxs("div",{children:[e.jsx("span",{className:"uppercase tracking-wide font-semibold mr-1",children:"Total:"}),s.tokenUsage.totalTokens.toLocaleString()]})]}),s.startedAt&&e.jsxs("div",{className:"flex gap-3 ml-auto",children:[e.jsxs("span",{children:["Started: ",new Date(s.startedAt).toLocaleTimeString()]}),s.completedAt&&e.jsxs("span",{children:["Completed:"," ",new Date(s.completedAt).toLocaleTimeString()," (",Math.round((s.completedAt-s.startedAt)/1e3),"s)"]})]})]})]})]})}const Yo=K("w-full rounded-2xl text-[var(--font-size)] font-[var(--font-family)] leading-relaxed break-words transition-colors",{variants:{role:{user:"bg-secondary text-foreground px-4 py-4 text-paragraph",assistant:"text-foreground text-paragraph-sm",system:"bg-card border border-border text-foreground opacity-80 text-caption px-4 py-3"},variant:{default:"",outline:"border border-border",ghost:"bg-transparent"}},defaultVariants:{role:"assistant",variant:"default"}}),rs=l.forwardRef(({role:s,variant:t,isStreaming:n,message:o,thinkingDisplayStyle:r="collapsible",className:i,children:c,...d},p)=>{const a=k(w=>w.streamingStartTime);k(w=>w.currentModel);const u=o&&!c,f=u?o.role:s||"assistant",m=u?o.isStreaming:n;let b=c;if(u){const w=o.metadata?.thinking,g=!!w,x=o.isStreaming&&!o.content&&o.role==="assistant";b=e.jsxs(e.Fragment,{children:[o.role==="assistant"&&g&&e.jsx(ns,{content:w,isStreaming:o.isStreaming,mode:r,autoCollapse:!0}),x&&a&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"size-2.5 rounded-full bg-foreground animate-pulse-scale"})}),o.role==="assistant"?(()=>{const y=(o.toolCalls||[]).slice().sort((C,S)=>(C.contentPosition??1/0)-(S.contentPosition??1/0));if(y.length===0||!y.some(C=>C.contentPosition!==void 0))return e.jsxs(e.Fragment,{children:[y.length>0&&e.jsx("div",{className:"flex flex-col gap-2 mb-1",children:y.map(C=>e.jsx(ze,{toolCall:C},C.id))}),e.jsx(ue,{content:o.content,isStreaming:o.isStreaming,showEmpty:!1})]});const j=[];let N=0;if(y.forEach(C=>{const S=C.contentPosition??o.content.length;if(S>N){const A=o.content.slice(N,S);A&&j.push(e.jsx(ue,{content:A,isStreaming:!1,showEmpty:!1},`text-before-${C.id}`))}j.push(e.jsx("div",{children:e.jsx(ze,{toolCall:C})},`tool-${C.id}`)),N=S}),N<o.content.length){const C=o.content.slice(N);C&&j.push(e.jsx(ue,{content:C,isStreaming:o.isStreaming,showEmpty:!1},"text-end"))}return e.jsx(e.Fragment,{children:j})})():e.jsx("div",{className:"whitespace-pre-wrap",children:o.content})]})}return e.jsx("div",{ref:p,className:h(Yo({role:f,variant:t}),m&&"animate-pulse-subtle",i),...d,children:b})});rs.displayName="MessageContent";const Re=l.forwardRef(({showIcons:s=!0,visibleTabs:t=["todo","files"],variant:n="default",className:o,...r},i)=>{const d=[{id:"todo",label:"To-do",icon:je},{id:"files",label:"Files",icon:Ne},{id:"database",label:"Database",icon:pt},{id:"sources",label:"Sources",icon:mt}].filter(a=>t.includes(a.id)),p=n==="compact"?"gap-[4px]":"gap-3";return e.jsx(se,{ref:i,className:h("w-full justify-start bg-transparent p-0 h-auto",p,o),...r,children:d.map(a=>{const u=a.icon;return e.jsxs(ne,{value:a.id,className:h("gap-2 px-3 py-1.5 rounded-lg text-paragraph-sm font-medium","data-[state=active]:bg-muted data-[state=active]:text-foreground","data-[state=inactive]:text-muted-foreground hover:text-foreground transition-colors"),children:[s&&u&&e.jsx(u,{className:"size-4"}),a.label]},a.id)})})});Re.displayName="PanelTabsHeader";const Xo=l.forwardRef(({className:s,children:t,...n},o)=>e.jsxs(nt,{ref:o,className:h("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-paragraph-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...n,children:[t,e.jsx(Ls,{asChild:!0,children:e.jsx(ln,{className:"h-4 w-4 opacity-50"})})]}));Xo.displayName=nt.displayName;const is=l.forwardRef(({className:s,...t},n)=>e.jsx(ot,{ref:n,className:h("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(ft,{className:"h-4 w-4"})}));is.displayName=ot.displayName;const ls=l.forwardRef(({className:s,...t},n)=>e.jsx(at,{ref:n,className:h("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(re,{className:"h-4 w-4"})}));ls.displayName=at.displayName;const Zo=l.forwardRef(({className:s,children:t,position:n="popper",...o},r)=>e.jsx(Fs,{children:e.jsxs(rt,{ref:r,className:h("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...o,children:[e.jsx(is,{}),e.jsx(Os,{className:h("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),e.jsx(ls,{})]})}));Zo.displayName=rt.displayName;const ea=l.forwardRef(({className:s,...t},n)=>e.jsx(it,{ref:n,className:h("py-1.5 pl-8 pr-2 text-paragraph-sm font-semibold",s),...t}));ea.displayName=it.displayName;const ta=l.forwardRef(({className:s,children:t,...n},o)=>e.jsxs(lt,{ref:o,className:h("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Bs,{children:e.jsx(dt,{className:"h-4 w-4"})})}),e.jsx($s,{children:t})]}));ta.displayName=lt.displayName;const sa=l.forwardRef(({className:s,...t},n)=>e.jsx(ct,{ref:n,className:h("-mx-1 my-1 h-px bg-muted",s),...t}));sa.displayName=ct.displayName;const cs=l.forwardRef(({task:s,collapsible:t=!0,defaultExpanded:n=!1,onTaskClick:o,className:r,...i},c)=>{const[d,p]=l.useState(n),a=!!(s.details||s.files&&s.files.length>0),u={pending:ve,in_progress:cn,completed:ut}[s.status],f=()=>{switch(s.status){case"completed":return"text-green-500";case"in_progress":return"text-primary";default:return"text-foreground opacity-40"}},m=()=>{a&&t&&p(!d),o?.(s)};return e.jsxs("div",{ref:c,className:h("rounded-lg border border-border bg-card transition-all","hover:shadow-sm hover:border-border/80",r),...i,children:[e.jsxs("button",{type:"button",onClick:m,className:h("w-full flex items-center gap-3 px-3 py-2.5 text-left",a&&t&&"cursor-pointer"),disabled:!a&&!t,children:[e.jsx(u,{className:h("w-4 h-4 shrink-0",f(),s.status==="in_progress"&&"animate-spin")}),e.jsx("span",{className:h("flex-1 text-paragraph-sm font-[var(--font-family)]",s.status==="completed"&&"line-through opacity-60",s.status==="in_progress"&&"font-medium"),children:s.text}),a&&t&&e.jsx(re,{className:h("w-4 h-4 text-foreground opacity-50 transition-transform duration-200 shrink-0",d&&"rotate-180"),"aria-hidden":"true"})]}),a&&d&&e.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-border/50 animate-fadeIn",children:[s.details&&e.jsx("p",{className:"text-paragraph-sm text-foreground opacity-80 leading-relaxed mb-2",children:s.details}),s.files&&s.files.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-caption font-medium text-foreground opacity-60 uppercase tracking-wide",children:"Files:"}),e.jsx("div",{className:"space-y-1",children:s.files.map(b=>e.jsx("div",{className:"text-caption font-mono text-foreground opacity-70 bg-background px-2 py-1 rounded border border-border/50",children:b},b))})]})]})]})});cs.displayName="Task";const na=l.forwardRef(({tasks:s,collapsible:t=!0,onTaskClick:n,emptyMessage:o="No tasks yet.",className:r,...i},c)=>e.jsx("div",{ref:c,className:h("space-y-2 max-h-96 overflow-y-auto",r),...i,children:s.length===0?e.jsx("p",{className:"text-paragraph-sm text-foreground opacity-60 italic py-4 text-center",children:o}):s.map(d=>e.jsx(cs,{task:d,collapsible:t,...n?{onTaskClick:n}:{}},d.id))}));na.displayName="TaskList";const oa=K("flex min-h-[80px] w-full rounded-md border bg-background px-3 py-2 text-paragraph-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),aa=l.forwardRef(({className:s,autoResize:t=!1,maxHeight:n=200,variant:o,...r},i)=>{const c=l.useRef(null),d=l.useCallback(a=>{c.current=a,typeof i=="function"?i(a):i&&(i.current=a)},[i]),p=l.useCallback(()=>{const a=c.current;if(!a||!t)return;a.style.height="auto";const u=Math.min(a.scrollHeight,n);a.style.height=`${u}px`,a.scrollHeight>n?a.style.overflowY="auto":a.style.overflowY="hidden"},[t,n]);return l.useEffect(()=>{p()},[p]),e.jsx("textarea",{className:h(oa({variant:o}),t&&"overflow-y-hidden",s),ref:d,...r})});aa.displayName="Textarea";function ds(){const{setTheme:s}=as();return e.jsxs(Qt,{children:[e.jsx(Gt,{asChild:!0,children:e.jsxs(be,{children:[e.jsx(dn,{className:"size-4 text-muted-foreground rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),e.jsx(un,{className:"absolute size-4 text-muted-foreground rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),e.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),e.jsxs(ke,{align:"end",children:[e.jsx(G,{onClick:()=>s("light"),children:"Light"}),e.jsx(G,{onClick:()=>s("dark"),children:"Dark"}),e.jsx(G,{onClick:()=>s("system"),children:"System"})]})]})}function ra(){return"http://localhost:3100"}const ia={agentServerUrl:ra()};function la(){const{client:s,error:t,sessionId:n}=Nn({serverUrl:ia.agentServerUrl});return e.jsx(Jo,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:e.jsx(Uo,{client:s,initialSessionId:n,error:t})})}const us=document.getElementById("root");if(!us)throw new Error("Root element not found");ws.createRoot(us).render(e.jsx(vs.StrictMode,{children:e.jsx(la,{})}));
@@ -1 +0,0 @@
1
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-yellow-950:oklch(28.6% .066 53.813);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-gray-500:oklch(55.1% .027 264.364);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-400:oklch(70.5% .015 286.067);--color-neutral-50:oklch(98.5% 0 0);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--radius:.5rem;--max-width-prose:477px;--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-primary-hover:var(--primary-hover);--color-secondary:var(--secondary);--color-secondary-foreground:var(--secondary-foreground);--color-secondary-hover:var(--secondary-hover);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-accent-hover:var(--accent-hover);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-destructive-hover:var(--destructive-hover);--color-border:var(--border);--color-border-dark:var(--border-dark);--color-input:var(--input);--color-input-background:var(--input-background);--color-ring:var(--ring);--color-text-primary:var(--text-primary);--color-text-secondary:var(--text-secondary);--color-text-tertiary:var(--text-tertiary);--max-width-chat:720px;--max-width-prompt-container:393px;--letter-spacing-tight:-.48px;--letter-spacing-heading:-.4px;--letter-spacing-uppercase:1.12px;--font-size-heading-1:3rem;--line-height-heading-1:1;--font-size-heading-2:1.875rem;--line-height-heading-2:1;--font-size-heading-3:1.5rem;--line-height-heading-3:1.2;--font-size-heading-4:1.25rem;--line-height-heading-4:1.2;--font-size-heading-5:1rem;--line-height-heading-5:1.2;--font-size-subheading:1.25rem;--line-height-subheading:1.5;--font-size-label:.875rem;--line-height-label:1.5;--font-size-paragraph:1rem;--line-height-paragraph:1.5;--font-size-paragraph-sm:.875rem;--line-height-paragraph-sm:1.5;--font-size-paragraph-mini:.75rem;--line-height-paragraph-mini:1.5;--font-size-caption:.75rem;--line-height-caption:1.5;--font-size-code:.875rem;--line-height-code:1.5;--letter-spacing-wide:.07em}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground)}button{cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing)*0)}.right-4{right:calc(var(--spacing)*4)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-50{z-index:50}.z-\[100\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-3{margin-inline:calc(var(--spacing)*3)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.my-2{margin-block:calc(var(--spacing)*2)}.my-4{margin-block:calc(var(--spacing)*4)}.my-6{margin-block:calc(var(--spacing)*6)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-auto{margin-right:auto}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.-ml-3{margin-left:calc(var(--spacing)*-3)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-2\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-full{width:100%;height:100%}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-16{height:calc(var(--spacing)*16)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[6lh\]{max-height:6lh}.min-h-\[44px\]{min-height:44px}.min-h-\[80px\]{min-height:80px}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-10{width:calc(var(--spacing)*10)}.w-40{width:calc(var(--spacing)*40)}.w-64{width:calc(var(--spacing)*64)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\[80\%\]{max-width:80%}.max-w-\[90\%\]{max-width:90%}.max-w-\[200px\]{max-width:200px}.max-w-chat{max-width:var(--max-width-chat)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.max-w-prompt-container{max-width:var(--max-width-prompt-container)}.max-w-prose{max-width:var(--max-width-prose)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-0{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-outside{list-style-position:outside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-\[4px\]{gap:4px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:var(--radius)}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[3px\]{border-radius:3px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[border-bottom-width\:0\.5px\]{border-bottom-width:.5px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-\[primary\]{border-color:primary}.border-border{border-color:var(--color-border)}.border-border-dark{border-color:var(--color-border-dark)}.border-border\/50{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.border-destructive,.border-destructive\/20{border-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/20{border-color:color-mix(in oklab,var(--color-destructive)20%,transparent)}}.border-green-500{border-color:var(--color-green-500)}.border-input{border-color:var(--color-input)}.border-yellow-200{border-color:var(--color-yellow-200)}.bg-accent{background-color:var(--color-accent)}.bg-background{background-color:var(--color-background)}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-destructive,.bg-destructive\/10{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--color-destructive)10%,transparent)}}.bg-foreground{background-color:var(--color-foreground)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-green-500{background-color:var(--color-green-500)}.bg-input-background{background-color:var(--color-input-background)}.bg-muted,.bg-muted\/50{background-color:var(--color-muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--color-muted)50%,transparent)}}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-red-500{background-color:var(--color-red-500)}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-linear-to-t{--tw-gradient-position:to top}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-t{--tw-gradient-position:to top in oklab}}.bg-linear-to-t{background-image:linear-gradient(var(--tw-gradient-stops))}.from-background{--tw-gradient-from:var(--color-background);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-3{padding-right:calc(var(--spacing)*3)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1\.5{padding-bottom:calc(var(--spacing)*1.5)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-8{padding-bottom:calc(var(--spacing)*8)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-6{padding-left:calc(var(--spacing)*6)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-16{padding-left:calc(var(--spacing)*16)}.text-center{text-align:center}.text-end{text-align:end}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-\[var\(--font-family\)\]{--tw-font-weight:var(--font-family);font-weight:var(--font-family)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--font-size\)\]{color:var(--font-size)}.text-card-foreground{color:var(--color-card-foreground)}.text-destructive{color:var(--color-destructive)}.text-destructive-foreground{color:var(--color-destructive-foreground)}.text-foreground{color:var(--color-foreground)}.text-green-500{color:var(--color-green-500)}.text-muted-foreground,.text-muted-foreground\/70{color:var(--color-muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/70{color:color-mix(in oklab,var(--color-muted-foreground)70%,transparent)}}.text-neutral-100{color:var(--color-neutral-100)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.text-text-tertiary{color:var(--color-text-tertiary)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-600{color:var(--color-yellow-600)}.text-yellow-800{color:var(--color-yellow-800)}.text-zinc-400{color:var(--color-zinc-400)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.decoration-2{text-decoration-thickness:2px}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.accent-\[primary\]{accent-color:primary}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow-\[0_4px_16px_0_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow:0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/item\:opacity-100:is(:where(.group\/item):hover *){opacity:1}}.group-\[\.toast\]\:bg-muted:is(:where(.group).toast *){background-color:var(--color-muted)}.group-\[\.toast\]\:bg-primary:is(:where(.group).toast *){background-color:var(--color-primary)}.group-\[\.toast\]\:text-muted-foreground:is(:where(.group).toast *){color:var(--color-muted-foreground)}.group-\[\.toast\]\:text-primary-foreground:is(:where(.group).toast *){color:var(--color-primary-foreground)}.group-\[\.toaster\]\:border-border:is(:where(.group).toaster *){border-color:var(--color-border)}.group-\[\.toaster\]\:bg-background:is(:where(.group).toaster *){background-color:var(--color-background)}.group-\[\.toaster\]\:text-foreground:is(:where(.group).toaster *){color:var(--color-foreground)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing)*1)}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}@media(hover:hover){.hover\:border-border\/80:hover{border-color:var(--color-border)}@supports (color:color-mix(in lab,red,red)){.hover\:border-border\/80:hover{border-color:color-mix(in oklab,var(--color-border)80%,transparent)}}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-accent-hover:hover{background-color:var(--color-accent-hover)}.hover\:bg-background:hover{background-color:var(--color-background)}.hover\:bg-card:hover,.hover\:bg-card\/80:hover{background-color:var(--color-card)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/80:hover{background-color:color-mix(in oklab,var(--color-card)80%,transparent)}}.hover\:bg-card\/90:hover{background-color:var(--color-card)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/90:hover{background-color:color-mix(in oklab,var(--color-card)90%,transparent)}}.hover\:bg-destructive-hover:hover{background-color:var(--color-destructive-hover)}.hover\:bg-muted:hover{background-color:var(--color-muted)}.hover\:bg-primary-hover:hover{background-color:var(--color-primary-hover)}.hover\:bg-secondary-hover:hover{background-color:var(--color-secondary-hover)}.hover\:bg-secondary\/80:hover{background-color:var(--color-secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary)80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:text-foreground:hover{color:var(--color-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-sm:hover{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:bg-muted:focus{background-color:var(--color-muted)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.focus\:text-destructive:focus{color:var(--color-destructive)}.focus\:text-foreground:focus{color:var(--color-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-border-dark:focus-visible{--tw-ring-color:var(--color-border-dark)}.focus-visible\:ring-destructive:focus-visible{--tw-ring-color:var(--color-destructive)}.focus-visible\:ring-green-500:focus-visible{--tw-ring-color:var(--color-green-500)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing)*1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--color-background)}.data-\[state\=active\]\:bg-muted[data-state=active]{background-color:var(--color-muted)}.data-\[state\=active\]\:bg-transparent[data-state=active]{background-color:#0000}.data-\[state\=active\]\:bg-zinc-100[data-state=active]{background-color:var(--color-zinc-100)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--color-foreground)}.data-\[state\=active\]\:opacity-100[data-state=active]{opacity:1}.data-\[state\=active\]\:shadow-none[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=inactive\]\:text-muted-foreground[data-state=inactive]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:bg-muted[data-state=open]{background-color:var(--color-muted)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}@media(min-width:40rem){.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:block{display:block}}@media(min-width:64rem){.lg\:block{display:block}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:p-0{padding:calc(var(--spacing)*0)}}@media(min-width:80rem){.xl\:block{display:block}}@media(min-width:96rem){.\32xl\:block{display:block}}@media(prefers-color-scheme:dark){.dark\:scale-0{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x)var(--tw-scale-y)}.dark\:scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.dark\:-rotate-90{rotate:-90deg}.dark\:rotate-0{rotate:none}.dark\:border-yellow-900{border-color:var(--color-yellow-900)}.dark\:bg-transparent{background-color:#0000}.dark\:bg-yellow-950\/20{background-color:#43200433}@supports (color:color-mix(in lab,red,red)){.dark\:bg-yellow-950\/20{background-color:color-mix(in oklab,var(--color-yellow-950)20%,transparent)}}.dark\:text-green-400{color:var(--color-green-400)}.dark\:text-red-400{color:var(--color-red-400)}.dark\:text-yellow-200{color:var(--color-yellow-200)}.dark\:text-yellow-500{color:var(--color-yellow-500)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.text-heading-1{font-size:var(--font-size-heading-1);line-height:var(--line-height-heading-1);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-heading-2{font-size:var(--font-size-heading-2);line-height:var(--line-height-heading-2);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-heading-3{font-size:var(--font-size-heading-3);line-height:var(--line-height-heading-3);letter-spacing:var(--letter-spacing-tight);font-weight:600}.text-heading-4{font-size:var(--font-size-heading-4);line-height:var(--line-height-heading-4);letter-spacing:var(--letter-spacing-heading);font-weight:600}.text-heading-5{font-size:var(--font-size-heading-5);line-height:var(--line-height-heading-5);letter-spacing:var(--letter-spacing-heading);font-weight:600}.text-subheading{font-size:var(--font-size-subheading);line-height:var(--line-height-subheading);font-weight:400}.text-label{font-size:var(--font-size-label);line-height:var(--line-height-label);letter-spacing:var(--letter-spacing-uppercase);text-transform:uppercase;font-weight:500}.text-paragraph{font-size:var(--font-size-paragraph);line-height:var(--line-height-paragraph);font-weight:400}.text-paragraph-medium{font-size:var(--font-size-paragraph);line-height:var(--line-height-paragraph);font-weight:500}.text-paragraph-sm{font-size:var(--font-size-paragraph-sm);line-height:var(--line-height-paragraph-sm);font-weight:400}.text-paragraph-sm-medium{font-size:var(--font-size-paragraph-sm);line-height:var(--line-height-paragraph-sm);letter-spacing:var(--letter-spacing-wide);font-weight:500}.text-paragraph-mini{font-size:var(--font-size-paragraph-mini);line-height:var(--line-height-paragraph-mini);font-weight:400}.text-paragraph-mini-medium{font-size:var(--font-size-paragraph-mini);line-height:var(--line-height-paragraph-mini);font-weight:500}.text-caption{font-size:var(--font-size-caption);line-height:var(--line-height-caption);font-weight:400}.text-code{font-size:var(--font-size-code);line-height:var(--line-height-code);font-family:monospace}}:root{--background:var(--color-white);--foreground:var(--color-neutral-950);--card:var(--color-white);--card-foreground:var(--color-neutral-950);--popover:var(--color-white);--popover-foreground:var(--color-neutral-950);--primary:var(--color-neutral-900);--primary-foreground:var(--color-neutral-50);--primary-hover:var(--color-neutral-700);--secondary:var(--color-neutral-100);--secondary-foreground:var(--color-neutral-900);--secondary-hover:var(--color-neutral-50);--muted:var(--color-neutral-50);--muted-foreground:var(--color-neutral-500);--accent:var(--color-neutral-100);--accent-foreground:var(--color-neutral-900);--accent-hover:var(--color-neutral-50);--destructive:var(--color-red-500);--destructive-foreground:var(--color-neutral-50);--destructive-hover:var(--color-red-600);--border:var(--color-neutral-200);--border-dark:var(--color-neutral-300);--border-focus:var(--color-neutral-400);--border-error:var(--color-red-500);--input:var(--color-neutral-200);--input-background:var(--color-white);--ring:var(--color-neutral-900);--text-primary:var(--color-neutral-900);--text-secondary:var(--color-neutral-600);--text-tertiary:var(--color-neutral-500)}.dark{--background:var(--color-neutral-950);--foreground:var(--color-neutral-50);--card:var(--color-neutral-950);--card-foreground:var(--color-neutral-50);--popover:var(--color-neutral-950);--popover-foreground:var(--color-neutral-50);--primary:var(--color-neutral-50);--primary-foreground:var(--color-neutral-900);--primary-hover:var(--color-neutral-200);--secondary:var(--color-neutral-800);--secondary-foreground:var(--color-neutral-50);--secondary-hover:var(--color-neutral-700);--muted:var(--color-neutral-800);--muted-foreground:var(--color-neutral-400);--accent:var(--color-neutral-800);--accent-foreground:var(--color-neutral-50);--accent-hover:var(--color-neutral-700);--destructive:var(--color-red-900);--destructive-foreground:var(--color-neutral-50);--destructive-hover:var(--color-red-800);--border:var(--color-neutral-800);--border-dark:var(--color-neutral-700);--border-focus:var(--color-neutral-600);--border-error:var(--color-red-500);--input:var(--color-neutral-800);--input-background:var(--color-neutral-950);--ring:var(--color-neutral-300);--text-primary:var(--color-neutral-50);--text-secondary:var(--color-neutral-400);--text-tertiary:var(--color-neutral-500)}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes exit{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes slideDownAndFade{0%{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideLeftAndFade{0%{opacity:0;transform:translate(2px)}to{opacity:1;transform:translate(0)}}@keyframes slideUpAndFade{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideRightAndFade{0%{opacity:0;transform:translate(-2px)}to{opacity:1;transform:translate(0)}}@keyframes pulse-scale{0%,to{background-color:var(--color-neutral-500);transform:scale(1)}50%{background-color:var(--color-neutral-500);transform:scale(.9)}}.animate-pulse-scale{animation:1s ease-in-out infinite pulse-scale}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes pulse{50%{opacity:.5}}