@kimuson/claude-code-viewer 0.5.9 → 0.6.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -1
- package/dist/main.js +1859 -811
- package/dist/main.js.map +4 -4
- package/dist/static/assets/ProtectedRoute-kldRjzy3.js +1 -0
- package/dist/static/assets/{eye-BGsXRq_8.js → eye-BEkfdnRO.js} +1 -1
- package/dist/static/assets/index-C9P7O98i.js +1 -0
- package/dist/static/assets/{index-sXgy7Ajd.js → index-CHZixXYx.js} +1 -1
- package/dist/static/assets/index-CTq99aOX.css +1 -0
- package/dist/static/assets/index-nTFAt0o5.js +101 -0
- package/dist/static/assets/{label-gygRdIVO.js → label-DigNu3m4.js} +1 -1
- package/dist/static/assets/{login-DRDs0jaq.js → login-CotBrr4P.js} +1 -1
- package/dist/static/assets/messages-D_2afeYc.js +1 -0
- package/dist/static/assets/messages-lrmcxVGh.js +1 -0
- package/dist/static/assets/messages-m0e3n_U5.js +1 -0
- package/dist/static/assets/session-B4VFb0DB.js +51 -0
- package/dist/static/assets/{session-B5BSJDkJ.js → session-BfEVLScy.js} +1 -1
- package/dist/static/assets/session-DFuMZ0ql.css +1 -0
- package/dist/static/index.html +2 -2
- package/package.json +14 -4
- package/dist/static/assets/ProtectedRoute-BZvfrfXZ.js +0 -1
- package/dist/static/assets/index-D9d-SW2q.js +0 -1
- package/dist/static/assets/index-hJ5yiXvq.js +0 -101
- package/dist/static/assets/index-kl3XSvPM.css +0 -1
- package/dist/static/assets/messages-5zx59L1k.js +0 -1
- package/dist/static/assets/messages-Diwakl7a.js +0 -1
- package/dist/static/assets/messages-Pr7vABlX.js +0 -1
- package/dist/static/assets/session-D2lB0w81.js +0 -40
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,N as n,T as s}from"./index-
|
|
1
|
+
import{j as o,N as n,T as s}from"./index-nTFAt0o5.js";const i=()=>o.jsx(n,{message:o.jsx(s,{id:"notfound.session.title"}),description:o.jsx(s,{id:"notfound.session.description"})});export{i as notFoundComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;inset:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;inset:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}
|
package/dist/static/index.html
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
content="Web Viewer for Claude Code history"
|
|
9
9
|
/>
|
|
10
10
|
<title>Claude Code Viewer</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-nTFAt0o5.js"></script>
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CTq99aOX.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kimuson/claude-code-viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0-beta.2",
|
|
4
4
|
"description": "A full-featured web-based Claude Code client that provides complete interactive functionality for managing Claude Code projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@anthropic-ai/claude-agent-sdk": "0.2.20",
|
|
23
|
-
"@anthropic-ai/claude-code": "2.
|
|
23
|
+
"@anthropic-ai/claude-code": "2.1.29",
|
|
24
24
|
"@anthropic-ai/sdk": "0.71.2",
|
|
25
25
|
"@effect/cluster": "0.56.1",
|
|
26
26
|
"@effect/experimental": "0.58.0",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"@effect/workflow": "0.16.0",
|
|
32
32
|
"@hono/node-server": "1.19.9",
|
|
33
33
|
"@hono/zod-validator": "0.7.6",
|
|
34
|
+
"@hookform/resolvers": "^5.2.2",
|
|
34
35
|
"@lingui/core": "5.9.0",
|
|
35
36
|
"@lingui/react": "5.9.0",
|
|
36
37
|
"@radix-ui/react-avatar": "1.1.11",
|
|
@@ -43,13 +44,17 @@
|
|
|
43
44
|
"@radix-ui/react-slot": "1.2.4",
|
|
44
45
|
"@radix-ui/react-tabs": "1.1.13",
|
|
45
46
|
"@radix-ui/react-tooltip": "1.2.8",
|
|
47
|
+
"@replit/ruspty": "^3.6.0",
|
|
46
48
|
"@tailwindcss/vite": "4.1.18",
|
|
47
49
|
"@tanstack/react-devtools": "0.9.2",
|
|
48
50
|
"@tanstack/react-query": "5.90.20",
|
|
49
51
|
"@tanstack/react-router": "1.156.0",
|
|
50
52
|
"@tanstack/react-router-devtools": "1.156.0",
|
|
53
|
+
"@xterm/addon-fit": "0.10.0",
|
|
54
|
+
"@xterm/xterm": "5.5.0",
|
|
51
55
|
"class-variance-authority": "0.7.1",
|
|
52
56
|
"clsx": "2.1.1",
|
|
57
|
+
"cmdk": "^1.1.1",
|
|
53
58
|
"commander": "^14.0.2",
|
|
54
59
|
"date-fns": "4.1.0",
|
|
55
60
|
"effect": "3.19.15",
|
|
@@ -60,15 +65,18 @@
|
|
|
60
65
|
"minisearch": "7.2.0",
|
|
61
66
|
"parse-git-diff": "0.0.19",
|
|
62
67
|
"prexit": "2.3.0",
|
|
68
|
+
"radix-ui": "^1.4.3",
|
|
63
69
|
"react": "19.2.3",
|
|
64
70
|
"react-dom": "19.2.3",
|
|
65
71
|
"react-error-boundary": "6.1.0",
|
|
72
|
+
"react-hook-form": "^7.71.1",
|
|
66
73
|
"react-markdown": "10.1.0",
|
|
67
74
|
"react-syntax-highlighter": "16.1.0",
|
|
68
75
|
"remark-gfm": "4.0.1",
|
|
69
76
|
"sonner": "2.0.7",
|
|
70
77
|
"tailwind-merge": "3.4.0",
|
|
71
78
|
"ulid": "3.0.2",
|
|
79
|
+
"ws": "8.18.3",
|
|
72
80
|
"zod": "4.3.6"
|
|
73
81
|
},
|
|
74
82
|
"devDependencies": {
|
|
@@ -86,6 +94,8 @@
|
|
|
86
94
|
"@types/react": "19.2.9",
|
|
87
95
|
"@types/react-dom": "19.2.3",
|
|
88
96
|
"@types/react-syntax-highlighter": "15.5.13",
|
|
97
|
+
"@types/ws": "8.18.0",
|
|
98
|
+
"@typescript/native-preview": "7.0.0-dev.20260207.1",
|
|
89
99
|
"@vitejs/plugin-react-swc": "4.2.2",
|
|
90
100
|
"dotenv": "17.2.3",
|
|
91
101
|
"esbuild": "0.27.2",
|
|
@@ -104,7 +114,7 @@
|
|
|
104
114
|
"scripts": {
|
|
105
115
|
"dev": "run-p 'dev:*'",
|
|
106
116
|
"dev:frontend": "vite",
|
|
107
|
-
"dev:backend": "
|
|
117
|
+
"dev:backend": "CCV_ENV=development tsx watch --env-file-if-exists=.env.local src/server/main.ts",
|
|
108
118
|
"start": "node dist/main.js",
|
|
109
119
|
"build": "./scripts/build.sh",
|
|
110
120
|
"build:frontend": "vite build",
|
|
@@ -115,7 +125,7 @@
|
|
|
115
125
|
"fix": "run-s 'fix:*'",
|
|
116
126
|
"fix:biome-format": "biome format --write .",
|
|
117
127
|
"fix:biome-lint": "biome check --write --unsafe .",
|
|
118
|
-
"typecheck": "
|
|
128
|
+
"typecheck": "tsgo --noEmit",
|
|
119
129
|
"test": "vitest --run",
|
|
120
130
|
"test:watch": "vitest",
|
|
121
131
|
"e2e": "./scripts/e2e/exec_e2e.sh",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as re,r as f,hv as Ot,j as o,gZ as V,hx as ee,gY as q,h3 as ke,hy as mn,gX as We,gW as He,g_ as L,g$ as nt,h0 as xn,h7 as gn,hz as Ko,h8 as G,L as Go,he as we,h4 as bt,h1 as Yo,h5 as Xo,h2 as Qo,h6 as Zo,hA as Ct,T as S,hB as Jo,B as er,g as St,hC as Jt,h as tr,ha as nr,hh as or,hl as rr,p as sr,gU as ir,hD as ar,hE as cr,hF as lr,hG as dr,hH as ur,u as vn,a as yn,hI as fr}from"./index-hJ5yiXvq.js";const pr=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],wn=re("check",pr);const hr=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Mt=re("chevron-down",hr);const mr=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xr=re("chevron-right",mr);const gr=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],vr=re("chevron-up",gr);const yr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],wr=re("circle-check",yr);const br=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Cr=re("circle-x",br);const Sr=[["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"}]],Ma=re("folder",Sr);const jr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Nr=re("info",jr);const _r=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Tr=re("log-out",_r);const Rr=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],La=re("plus",Rr);const Pr=[["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"}]],Ar=re("settings",Pr),Er=["top","right","bottom","left"],pe=Math.min,Q=Math.max,Qe=Math.round,qe=Math.floor,ie=e=>({x:e,y:e}),kr={left:"right",right:"left",bottom:"top",top:"bottom"},Ir={start:"end",end:"start"};function jt(e,t,n){return Q(e,pe(t,n))}function le(e,t){return typeof e=="function"?e(t):e}function de(e){return e.split("-")[0]}function Ie(e){return e.split("-")[1]}function Lt(e){return e==="x"?"y":"x"}function Dt(e){return e==="y"?"height":"width"}const Or=new Set(["top","bottom"]);function se(e){return Or.has(de(e))?"y":"x"}function $t(e){return Lt(se(e))}function Mr(e,t,n){n===void 0&&(n=!1);const r=Ie(e),s=$t(e),a=Dt(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Ze(i)),[i,Ze(i)]}function Lr(e){const t=Ze(e);return[Nt(e),t,Nt(t)]}function Nt(e){return e.replace(/start|end/g,t=>Ir[t])}const en=["left","right"],tn=["right","left"],Dr=["top","bottom"],$r=["bottom","top"];function Hr(e,t,n){switch(e){case"top":case"bottom":return n?t?tn:en:t?en:tn;case"left":case"right":return t?Dr:$r;default:return[]}}function Fr(e,t,n,r){const s=Ie(e);let a=Hr(de(e),n==="start",r);return s&&(a=a.map(i=>i+"-"+s),t&&(a=a.concat(a.map(Nt)))),a}function Ze(e){return e.replace(/left|right|bottom|top/g,t=>kr[t])}function Br(e){return{top:0,right:0,bottom:0,left:0,...e}}function bn(e){return typeof e!="number"?Br(e):{top:e,right:e,bottom:e,left:e}}function Je(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function nn(e,t,n){let{reference:r,floating:s}=e;const a=se(t),i=$t(t),l=Dt(i),c=de(t),d=a==="y",u=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,v=r[l]/2-s[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-s.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:p};break;case"left":m={x:r.x-s.width,y:p};break;default:m={x:r.x,y:r.y}}switch(Ie(t)){case"start":m[i]-=v*(n&&d?-1:1);break;case"end":m[i]+=v*(n&&d?-1:1);break}return m}const Vr=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:i}=n,l=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:p}=nn(d,r,c),v=r,m={},g=0;for(let h=0;h<l.length;h++){const{name:y,fn:w}=l[h],{x,y:b,data:C,reset:j}=await w({x:u,y:p,initialPlacement:r,placement:v,strategy:s,middlewareData:m,rects:d,platform:i,elements:{reference:e,floating:t}});u=x??u,p=b??p,m={...m,[y]:{...m[y],...C}},j&&g<=50&&(g++,typeof j=="object"&&(j.placement&&(v=j.placement),j.rects&&(d=j.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):j.rects),{x:u,y:p}=nn(d,v,c)),h=-1)}return{x:u,y:p,placement:v,strategy:s,middlewareData:m}};async function Fe(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:v=!1,padding:m=0}=le(t,e),g=bn(m),y=l[v?p==="floating"?"reference":"floating":p],w=Je(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),x=p==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),C=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},j=Je(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:b,strategy:c}):x);return{top:(w.top-j.top+g.top)/C.y,bottom:(j.bottom-w.bottom+g.bottom)/C.y,left:(w.left-j.left+g.left)/C.x,right:(j.right-w.right+g.right)/C.x}}const Wr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:i,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=le(e,t)||{};if(d==null)return{};const p=bn(u),v={x:n,y:r},m=$t(s),g=Dt(m),h=await i.getDimensions(d),y=m==="y",w=y?"top":"left",x=y?"bottom":"right",b=y?"clientHeight":"clientWidth",C=a.reference[g]+a.reference[m]-v[m]-a.floating[g],j=v[m]-a.reference[m],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let N=P?P[b]:0;(!N||!await(i.isElement==null?void 0:i.isElement(P)))&&(N=l.floating[b]||a.floating[g]);const I=C/2-j/2,D=N/2-h[g]/2-1,R=pe(p[w],D),A=pe(p[x],D),$=R,M=N-h[g]-A,k=N/2-h[g]/2+I,W=jt($,k,M),E=!c.arrow&&Ie(s)!=null&&k!==W&&a.reference[g]/2-(k<$?R:A)-h[g]/2<0,O=E?k<$?k-$:k-M:0;return{[m]:v[m]+O,data:{[m]:W,centerOffset:k-W-O,...E&&{alignmentOffset:O}},reset:E}}}),zr=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...y}=le(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const w=de(s),x=se(l),b=de(l)===l,C=await(c.isRTL==null?void 0:c.isRTL(d.floating)),j=v||(b||!h?[Ze(l)]:Lr(l)),P=g!=="none";!v&&P&&j.push(...Fr(l,h,g,C));const N=[l,...j],I=await Fe(t,y),D=[];let R=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&D.push(I[w]),p){const k=Mr(s,i,C);D.push(I[k[0]],I[k[1]])}if(R=[...R,{placement:s,overflows:D}],!D.every(k=>k<=0)){var A,$;const k=(((A=a.flip)==null?void 0:A.index)||0)+1,W=N[k];if(W&&(!(p==="alignment"?x!==se(W):!1)||R.every(T=>se(T.placement)===x?T.overflows[0]>0:!0)))return{data:{index:k,overflows:R},reset:{placement:W}};let E=($=R.filter(O=>O.overflows[0]<=0).sort((O,T)=>O.overflows[1]-T.overflows[1])[0])==null?void 0:$.placement;if(!E)switch(m){case"bestFit":{var M;const O=(M=R.filter(T=>{if(P){const H=se(T.placement);return H===x||H==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(H=>H>0).reduce((H,X)=>H+X,0)]).sort((T,H)=>T[1]-H[1])[0])==null?void 0:M[0];O&&(E=O);break}case"initialPlacement":E=l;break}if(s!==E)return{reset:{placement:E}}}return{}}}};function on(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rn(e){return Er.some(t=>e[t]>=0)}const Ur=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=le(e,t);switch(r){case"referenceHidden":{const a=await Fe(t,{...s,elementContext:"reference"}),i=on(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:rn(i)}}}case"escaped":{const a=await Fe(t,{...s,altBoundary:!0}),i=on(a,n.floating);return{data:{escapedOffsets:i,escaped:rn(i)}}}default:return{}}}}},Cn=new Set(["left","top"]);async function qr(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=de(n),l=Ie(n),c=se(n)==="y",d=Cn.has(i)?-1:1,u=a&&c?-1:1,p=le(t,e);let{mainAxis:v,crossAxis:m,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*u,y:v*d}:{x:v*d,y:m*u}}const Kr=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:i,middlewareData:l}=t,c=await qr(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:i}}}}},Gr=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:y=>{let{x:w,y:x}=y;return{x:w,y:x}}},...c}=le(e,t),d={x:n,y:r},u=await Fe(t,c),p=se(de(s)),v=Lt(p);let m=d[v],g=d[p];if(a){const y=v==="y"?"top":"left",w=v==="y"?"bottom":"right",x=m+u[y],b=m-u[w];m=jt(x,m,b)}if(i){const y=p==="y"?"top":"left",w=p==="y"?"bottom":"right",x=g+u[y],b=g-u[w];g=jt(x,g,b)}const h=l.fn({...t,[v]:m,[p]:g});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[v]:a,[p]:i}}}}}},Yr=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=le(e,t),u={x:n,y:r},p=se(s),v=Lt(p);let m=u[v],g=u[p];const h=le(l,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const b=v==="y"?"height":"width",C=a.reference[v]-a.floating[b]+y.mainAxis,j=a.reference[v]+a.reference[b]-y.mainAxis;m<C?m=C:m>j&&(m=j)}if(d){var w,x;const b=v==="y"?"width":"height",C=Cn.has(de(s)),j=a.reference[p]-a.floating[b]+(C&&((w=i.offset)==null?void 0:w[p])||0)+(C?0:y.crossAxis),P=a.reference[p]+a.reference[b]+(C?0:((x=i.offset)==null?void 0:x[p])||0)-(C?y.crossAxis:0);g<j?g=j:g>P&&(g=P)}return{[v]:m,[p]:g}}}},Xr=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:i,elements:l}=t,{apply:c=()=>{},...d}=le(e,t),u=await Fe(t,d),p=de(s),v=Ie(s),m=se(s)==="y",{width:g,height:h}=a.floating;let y,w;p==="top"||p==="bottom"?(y=p,w=v===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(w=p,y=v==="end"?"top":"bottom");const x=h-u.top-u.bottom,b=g-u.left-u.right,C=pe(h-u[y],x),j=pe(g-u[w],b),P=!t.middlewareData.shift;let N=C,I=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=x),P&&!v){const R=Q(u.left,0),A=Q(u.right,0),$=Q(u.top,0),M=Q(u.bottom,0);m?I=g-2*(R!==0||A!==0?R+A:Q(u.left,u.right)):N=h-2*($!==0||M!==0?$+M:Q(u.top,u.bottom))}await c({...t,availableWidth:I,availableHeight:N});const D=await i.getDimensions(l.floating);return g!==D.width||h!==D.height?{reset:{rects:!0}}:{}}}};function ot(){return typeof window<"u"}function Oe(e){return Sn(e)?(e.nodeName||"").toLowerCase():"#document"}function Z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ce(e){var t;return(t=(Sn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sn(e){return ot()?e instanceof Node||e instanceof Z(e).Node:!1}function ne(e){return ot()?e instanceof Element||e instanceof Z(e).Element:!1}function ae(e){return ot()?e instanceof HTMLElement||e instanceof Z(e).HTMLElement:!1}function sn(e){return!ot()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Z(e).ShadowRoot}const Qr=new Set(["inline","contents"]);function ze(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Qr.has(s)}const Zr=new Set(["table","td","th"]);function Jr(e){return Zr.has(Oe(e))}const es=[":popover-open",":modal"];function rt(e){return es.some(t=>{try{return e.matches(t)}catch{return!1}})}const ts=["transform","translate","scale","rotate","perspective"],ns=["transform","translate","scale","rotate","perspective","filter"],os=["paint","layout","strict","content"];function Ht(e){const t=Ft(),n=ne(e)?oe(e):e;return ts.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ns.some(r=>(n.willChange||"").includes(r))||os.some(r=>(n.contain||"").includes(r))}function rs(e){let t=he(e);for(;ae(t)&&!Ae(t);){if(Ht(t))return t;if(rt(t))return null;t=he(t)}return null}function Ft(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ss=new Set(["html","body","#document"]);function Ae(e){return ss.has(Oe(e))}function oe(e){return Z(e).getComputedStyle(e)}function st(e){return ne(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function he(e){if(Oe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sn(e)&&e.host||ce(e);return sn(t)?t.host:t}function jn(e){const t=he(e);return Ae(t)?e.ownerDocument?e.ownerDocument.body:e.body:ae(t)&&ze(t)?t:jn(t)}function Be(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=jn(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),i=Z(s);if(a){const l=_t(i);return t.concat(i,i.visualViewport||[],ze(s)?s:[],l&&n?Be(l):[])}return t.concat(s,Be(s,[],n))}function _t(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nn(e){const t=oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=ae(e),a=s?e.offsetWidth:n,i=s?e.offsetHeight:r,l=Qe(n)!==a||Qe(r)!==i;return l&&(n=a,r=i),{width:n,height:r,$:l}}function Bt(e){return ne(e)?e:e.contextElement}function Pe(e){const t=Bt(e);if(!ae(t))return ie(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=Nn(t);let i=(a?Qe(n.width):n.width)/r,l=(a?Qe(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const is=ie(0);function _n(e){const t=Z(e);return!Ft()||!t.visualViewport?is:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function as(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Z(e)?!1:t}function be(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Bt(e);let i=ie(1);t&&(r?ne(r)&&(i=Pe(r)):i=Pe(e));const l=as(a,n,r)?_n(a):ie(0);let c=(s.left+l.x)/i.x,d=(s.top+l.y)/i.y,u=s.width/i.x,p=s.height/i.y;if(a){const v=Z(a),m=r&&ne(r)?Z(r):r;let g=v,h=_t(g);for(;h&&r&&m!==g;){const y=Pe(h),w=h.getBoundingClientRect(),x=oe(h),b=w.left+(h.clientLeft+parseFloat(x.paddingLeft))*y.x,C=w.top+(h.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,p*=y.y,c+=b,d+=C,g=Z(h),h=_t(g)}}return Je({width:u,height:p,x:c,y:d})}function it(e,t){const n=st(e).scrollLeft;return t?t.left+n:be(ce(e)).left+n}function Tn(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-it(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function cs(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",i=ce(r),l=t?rt(t.floating):!1;if(r===i||l&&a)return n;let c={scrollLeft:0,scrollTop:0},d=ie(1);const u=ie(0),p=ae(r);if((p||!p&&!a)&&((Oe(r)!=="body"||ze(i))&&(c=st(r)),ae(r))){const m=be(r);d=Pe(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const v=i&&!p&&!a?Tn(i,c):ie(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x+v.x,y:n.y*d.y-c.scrollTop*d.y+u.y+v.y}}function ls(e){return Array.from(e.getClientRects())}function ds(e){const t=ce(e),n=st(e),r=e.ownerDocument.body,s=Q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+it(e);const l=-n.scrollTop;return oe(r).direction==="rtl"&&(i+=Q(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:i,y:l}}const an=25;function us(e,t){const n=Z(e),r=ce(e),s=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,l=0,c=0;if(s){a=s.width,i=s.height;const u=Ft();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}const d=it(r);if(d<=0){const u=r.ownerDocument,p=u.body,v=getComputedStyle(p),m=u.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,g=Math.abs(r.clientWidth-p.clientWidth-m);g<=an&&(a-=g)}else d<=an&&(a+=d);return{width:a,height:i,x:l,y:c}}const fs=new Set(["absolute","fixed"]);function ps(e,t){const n=be(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=ae(e)?Pe(e):ie(1),i=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,d=r*a.y;return{width:i,height:l,x:c,y:d}}function cn(e,t,n){let r;if(t==="viewport")r=us(e,n);else if(t==="document")r=ds(ce(e));else if(ne(t))r=ps(t,n);else{const s=_n(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Je(r)}function Rn(e,t){const n=he(e);return n===t||!ne(n)||Ae(n)?!1:oe(n).position==="fixed"||Rn(n,t)}function hs(e,t){const n=t.get(e);if(n)return n;let r=Be(e,[],!1).filter(l=>ne(l)&&Oe(l)!=="body"),s=null;const a=oe(e).position==="fixed";let i=a?he(e):e;for(;ne(i)&&!Ae(i);){const l=oe(i),c=Ht(i);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&fs.has(s.position)||ze(i)&&!c&&Rn(e,i))?r=r.filter(u=>u!==i):s=l,i=he(i)}return t.set(e,r),r}function ms(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?rt(t)?[]:hs(t,this._c):[].concat(n),r],l=i[0],c=i.reduce((d,u)=>{const p=cn(t,u,s);return d.top=Q(p.top,d.top),d.right=pe(p.right,d.right),d.bottom=pe(p.bottom,d.bottom),d.left=Q(p.left,d.left),d},cn(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function xs(e){const{width:t,height:n}=Nn(e);return{width:t,height:n}}function gs(e,t,n){const r=ae(t),s=ce(t),a=n==="fixed",i=be(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=ie(0);function d(){c.x=it(s)}if(r||!r&&!a)if((Oe(t)!=="body"||ze(s))&&(l=st(t)),r){const m=be(t,!0,a,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&d();a&&!r&&s&&d();const u=s&&!r&&!a?Tn(s,l):ie(0),p=i.left+l.scrollLeft-c.x-u.x,v=i.top+l.scrollTop-c.y-u.y;return{x:p,y:v,width:i.width,height:i.height}}function vt(e){return oe(e).position==="static"}function ln(e,t){if(!ae(e)||oe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ce(e)===n&&(n=n.ownerDocument.body),n}function Pn(e,t){const n=Z(e);if(rt(e))return n;if(!ae(e)){let s=he(e);for(;s&&!Ae(s);){if(ne(s)&&!vt(s))return s;s=he(s)}return n}let r=ln(e,t);for(;r&&Jr(r)&&vt(r);)r=ln(r,t);return r&&Ae(r)&&vt(r)&&!Ht(r)?n:r||rs(e)||n}const vs=async function(e){const t=this.getOffsetParent||Pn,n=this.getDimensions,r=await n(e.floating);return{reference:gs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ys(e){return oe(e).direction==="rtl"}const ws={convertOffsetParentRelativeRectToViewportRelativeRect:cs,getDocumentElement:ce,getClippingRect:ms,getOffsetParent:Pn,getElementRects:vs,getClientRects:ls,getDimensions:xs,getScale:Pe,isElement:ne,isRTL:ys};function An(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bs(e,t){let n=null,r;const s=ce(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const d=e.getBoundingClientRect(),{left:u,top:p,width:v,height:m}=d;if(l||t(),!v||!m)return;const g=qe(p),h=qe(s.clientWidth-(u+v)),y=qe(s.clientHeight-(p+m)),w=qe(u),b={rootMargin:-g+"px "+-h+"px "+-y+"px "+-w+"px",threshold:Q(0,pe(1,c))||1};let C=!0;function j(P){const N=P[0].intersectionRatio;if(N!==c){if(!C)return i();N?i(!1,N):r=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!An(d,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(j,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(j,b)}n.observe(e)}return i(!0),a}function Cs(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Bt(e),u=s||a?[...d?Be(d):[],...Be(t)]:[];u.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),a&&w.addEventListener("resize",n)});const p=d&&l?bs(d,n):null;let v=-1,m=null;i&&(m=new ResizeObserver(w=>{let[x]=w;x&&x.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),d&&!c&&m.observe(d),m.observe(t));let g,h=c?be(e):null;c&&y();function y(){const w=be(e);h&&!An(h,w)&&n(),h=w,g=requestAnimationFrame(y)}return n(),()=>{var w;u.forEach(x=>{s&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),p?.(),(w=m)==null||w.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Ss=Kr,js=Gr,Ns=zr,_s=Xr,Ts=Ur,dn=Wr,Rs=Yr,Ps=(e,t,n)=>{const r=new Map,s={platform:ws,...n},a={...s.platform,_c:r};return Vr(e,t,{...s,platform:a})};var As=typeof document<"u",Es=function(){},Ke=As?f.useLayoutEffect:Es;function et(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!et(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!et(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function En(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function un(e,t){const n=En(e);return Math.round(t*n)/n}function yt(e){const t=f.useRef(e);return Ke(()=>{t.current=e}),t}function ks(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,m]=f.useState(r);et(v,r)||m(r);const[g,h]=f.useState(null),[y,w]=f.useState(null),x=f.useCallback(T=>{T!==P.current&&(P.current=T,h(T))},[]),b=f.useCallback(T=>{T!==N.current&&(N.current=T,w(T))},[]),C=a||g,j=i||y,P=f.useRef(null),N=f.useRef(null),I=f.useRef(u),D=c!=null,R=yt(c),A=yt(s),$=yt(d),M=f.useCallback(()=>{if(!P.current||!N.current)return;const T={placement:t,strategy:n,middleware:v};A.current&&(T.platform=A.current),Ps(P.current,N.current,T).then(H=>{const X={...H,isPositioned:$.current!==!1};k.current&&!et(I.current,X)&&(I.current=X,Ot.flushSync(()=>{p(X)}))})},[v,t,n,A,$]);Ke(()=>{d===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,p(T=>({...T,isPositioned:!1})))},[d]);const k=f.useRef(!1);Ke(()=>(k.current=!0,()=>{k.current=!1}),[]),Ke(()=>{if(C&&(P.current=C),j&&(N.current=j),C&&j){if(R.current)return R.current(C,j,M);M()}},[C,j,M,R,D]);const W=f.useMemo(()=>({reference:P,floating:N,setReference:x,setFloating:b}),[x,b]),E=f.useMemo(()=>({reference:C,floating:j}),[C,j]),O=f.useMemo(()=>{const T={position:n,left:0,top:0};if(!E.floating)return T;const H=un(E.floating,u.x),X=un(E.floating,u.y);return l?{...T,transform:"translate("+H+"px, "+X+"px)",...En(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:X}},[n,l,E.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:M,refs:W,elements:E,floatingStyles:O}),[u,M,W,E,O])}const Is=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dn({element:r.current,padding:s}).fn(n):{}:r?dn({element:r,padding:s}).fn(n):{}}}},Os=(e,t)=>({...Ss(e),options:[e,t]}),Ms=(e,t)=>({...js(e),options:[e,t]}),Ls=(e,t)=>({...Rs(e),options:[e,t]}),Ds=(e,t)=>({...Ns(e),options:[e,t]}),$s=(e,t)=>({..._s(e),options:[e,t]}),Hs=(e,t)=>({...Ts(e),options:[e,t]}),Fs=(e,t)=>({...Is(e),options:[e,t]});var Bs="Arrow",kn=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return o.jsx(V.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});kn.displayName=Bs;var Vs=kn;function In(e){const[t,n]=f.useState(void 0);return ee(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let i,l;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,l=d.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Vt="Popper",[On,at]=ke(Vt),[Ws,Mn]=On(Vt),Ln=e=>{const{__scopePopper:t,children:n}=e,[r,s]=f.useState(null);return o.jsx(Ws,{scope:t,anchor:r,onAnchorChange:s,children:n})};Ln.displayName=Vt;var Dn="PopperAnchor",$n=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=Mn(Dn,n),i=f.useRef(null),l=q(t,i),c=f.useRef(null);return f.useEffect(()=>{const d=c.current;c.current=r?.current||i.current,d!==c.current&&a.onAnchorChange(c.current)}),r?null:o.jsx(V.div,{...s,ref:l})});$n.displayName=Dn;var Wt="PopperContent",[zs,Us]=On(Wt),Hn=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:m="optimized",onPlaced:g,...h}=e,y=Mn(Wt,n),[w,x]=f.useState(null),b=q(t,_=>x(_)),[C,j]=f.useState(null),P=In(C),N=P?.width??0,I=P?.height??0,D=r+(a!=="center"?"-"+a:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(d)?d:[d],$=A.length>0,M={padding:R,boundary:A.filter(Ks),altBoundary:$},{refs:k,floatingStyles:W,placement:E,isPositioned:O,middlewareData:T}=ks({strategy:"fixed",placement:D,whileElementsMounted:(..._)=>Cs(..._,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[Os({mainAxis:s+I,alignmentAxis:i}),c&&Ms({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Ls():void 0,...M}),c&&Ds({...M}),$s({...M,apply:({elements:_,rects:z,availableWidth:Y,availableHeight:F})=>{const{width:B,height:U}=z.reference,J=_.floating.style;J.setProperty("--radix-popper-available-width",`${Y}px`),J.setProperty("--radix-popper-available-height",`${F}px`),J.setProperty("--radix-popper-anchor-width",`${B}px`),J.setProperty("--radix-popper-anchor-height",`${U}px`)}}),C&&Fs({element:C,padding:l}),Gs({arrowWidth:N,arrowHeight:I}),v&&Hs({strategy:"referenceHidden",...M})]}),[H,X]=Vn(E),ge=mn(g);ee(()=>{O&&ge?.()},[O,ge]);const Le=T.arrow?.x,De=T.arrow?.y,ue=T.arrow?.centerOffset!==0,[je,ve]=f.useState();return ee(()=>{w&&ve(window.getComputedStyle(w).zIndex)},[w]),o.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:O?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:je,"--radix-popper-transform-origin":[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(zs,{scope:n,placedSide:H,onArrowChange:j,arrowX:Le,arrowY:De,shouldHideArrow:ue,children:o.jsx(V.div,{"data-side":H,"data-align":X,...h,ref:b,style:{...h.style,animation:O?void 0:"none"}})})})});Hn.displayName=Wt;var Fn="PopperArrow",qs={top:"bottom",right:"left",bottom:"top",left:"right"},Bn=f.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=Us(Fn,r),i=qs[a.placedSide];return o.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:o.jsx(Vs,{...s,ref:n,style:{...s.style,display:"block"}})})});Bn.displayName=Fn;function Ks(e){return e!==null}var Gs=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,i=s.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,u]=Vn(n),p={start:"0%",center:"50%",end:"100%"}[u],v=(s.arrow?.x??0)+l/2,m=(s.arrow?.y??0)+c/2;let g="",h="";return d==="bottom"?(g=i?p:`${v}px`,h=`${-c}px`):d==="top"?(g=i?p:`${v}px`,h=`${r.floating.height+c}px`):d==="right"?(g=`${-c}px`,h=i?p:`${m}px`):d==="left"&&(g=`${r.floating.width+c}px`,h=i?p:`${m}px`),{data:{x:g,y:h}}}});function Vn(e){const[t,n="center"]=e.split("-");return[t,n]}var Wn=Ln,zn=$n,Un=Hn,qn=Bn,Kn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Ys="VisuallyHidden",Gn=f.forwardRef((e,t)=>o.jsx(V.span,{...e,ref:t,style:{...Kn,...e.style}}));Gn.displayName=Ys;var Xs=Gn,[ct]=ke("Tooltip",[at]),lt=at(),Yn="TooltipProvider",Qs=700,Tt="tooltip.open",[Zs,zt]=ct(Yn),Xn=e=>{const{__scopeTooltip:t,delayDuration:n=Qs,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,i=f.useRef(!0),l=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),o.jsx(Zs,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:a})};Xn.displayName=Yn;var Ve="Tooltip",[Js,Ue]=ct(Ve),Qn=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:i,delayDuration:l}=e,c=zt(Ve,e.__scopeTooltip),d=lt(t),[u,p]=f.useState(null),v=We(),m=f.useRef(0),g=i??c.disableHoverableContent,h=l??c.delayDuration,y=f.useRef(!1),[w,x]=He({prop:r,defaultProp:s??!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(Tt))):c.onClose(),a?.(N)},caller:Ve}),b=f.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),C=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)},[x]),j=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),P=f.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,x(!0),m.current=0},h)},[h,x]);return f.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),o.jsx(Wn,{...d,children:o.jsx(Js,{scope:t,contentId:v,open:w,stateAttribute:b,trigger:u,onTriggerChange:p,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?P():C()},[c.isOpenDelayedRef,P,C]),onTriggerLeave:f.useCallback(()=>{g?j():(window.clearTimeout(m.current),m.current=0)},[j,g]),onOpen:C,onClose:j,disableHoverableContent:g,children:n})})};Qn.displayName=Ve;var Rt="TooltipTrigger",Zn=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Ue(Rt,n),a=zt(Rt,n),i=lt(n),l=f.useRef(null),c=q(t,l,s.onTriggerChange),d=f.useRef(!1),u=f.useRef(!1),p=f.useCallback(()=>d.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),o.jsx(zn,{asChild:!0,...i,children:o.jsx(V.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:L(e.onPointerMove,v=>{v.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:L(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:L(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:L(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:L(e.onBlur,s.onClose),onClick:L(e.onClick,s.onClose)})})});Zn.displayName=Rt;var Ut="TooltipPortal",[ei,ti]=ct(Ut,{forceMount:void 0}),Jn=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,a=Ue(Ut,t);return o.jsx(ei,{scope:t,forceMount:n,children:o.jsx(nt,{present:n||a.open,children:o.jsx(xn,{asChild:!0,container:s,children:r})})})};Jn.displayName=Ut;var Ee="TooltipContent",eo=f.forwardRef((e,t)=>{const n=ti(Ee,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,i=Ue(Ee,e.__scopeTooltip);return o.jsx(nt,{present:r||i.open,children:i.disableHoverableContent?o.jsx(to,{side:s,...a,ref:t}):o.jsx(ni,{side:s,...a,ref:t})})}),ni=f.forwardRef((e,t)=>{const n=Ue(Ee,e.__scopeTooltip),r=zt(Ee,e.__scopeTooltip),s=f.useRef(null),a=q(t,s),[i,l]=f.useState(null),{trigger:c,onClose:d}=n,u=s.current,{onPointerInTransitChange:p}=r,v=f.useCallback(()=>{l(null),p(!1)},[p]),m=f.useCallback((g,h)=>{const y=g.currentTarget,w={x:g.clientX,y:g.clientY},x=ii(w,y.getBoundingClientRect()),b=ai(w,x),C=ci(h.getBoundingClientRect()),j=di([...b,...C]);l(j),p(!0)},[p]);return f.useEffect(()=>()=>v(),[v]),f.useEffect(()=>{if(c&&u){const g=y=>m(y,u),h=y=>m(y,c);return c.addEventListener("pointerleave",g),u.addEventListener("pointerleave",h),()=>{c.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",h)}}},[c,u,m,v]),f.useEffect(()=>{if(i){const g=h=>{const y=h.target,w={x:h.clientX,y:h.clientY},x=c?.contains(y)||u?.contains(y),b=!li(w,i);x?v():b&&(v(),d())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,u,i,d,v]),o.jsx(to,{...e,ref:a})}),[oi,ri]=ct(Ve,{isInside:!1}),si=Ko("TooltipContent"),to=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:i,...l}=e,c=Ue(Ee,n),d=lt(n),{onClose:u}=c;return f.useEffect(()=>(document.addEventListener(Tt,u),()=>document.removeEventListener(Tt,u)),[u]),f.useEffect(()=>{if(c.trigger){const p=v=>{v.target?.contains(c.trigger)&&u()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,u]),o.jsx(gn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:u,children:o.jsxs(Un,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(si,{children:r}),o.jsx(oi,{scope:n,isInside:!0,children:o.jsx(Xs,{id:c.contentId,role:"tooltip",children:s||r})})]})})});eo.displayName=Ee;var no="TooltipArrow",oo=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=lt(n);return ri(no,n).isInside?null:o.jsx(qn,{...s,...r,ref:t})});oo.displayName=no;function ii(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ai(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ci(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function li(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const l=t[a],c=t[i],d=l.x,u=l.y,p=c.x,v=c.y;u>r!=v>r&&n<(p-d)*(r-u)/(v-u)+d&&(s=!s)}return s}function di(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ui(t)}function ui(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(s.y-i.y)>=(a.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(s.y-i.y)>=(a.y-i.y)*(s.x-i.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var fi=Xn,pi=Qn,hi=Zn,mi=Jn,xi=eo,gi=oo;function qt({delayDuration:e=0,...t}){return o.jsx(fi,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Ge({...e}){return o.jsx(qt,{children:o.jsx(pi,{"data-slot":"tooltip",...e})})}function Ye({...e}){return o.jsx(hi,{"data-slot":"tooltip-trigger",...e})}function Xe({className:e,sideOffset:t=0,children:n,...r}){return o.jsx(mi,{children:o.jsxs(xi,{"data-slot":"tooltip-content",sideOffset:t,className:G("bg-foreground text-background 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,o.jsx(gi,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const vi={sm:"w-4 h-4",default:"w-8 h-8",lg:"w-12 h-12"},yi={sm:"text-sm",default:"text-base",lg:"text-lg"},fn=({message:e,size:t="default",fullScreen:n=!0,className:r})=>{const s=o.jsxs("div",{className:G("flex flex-col items-center justify-center gap-3",r),children:[o.jsx(Go,{className:G(vi[t],"animate-spin text-primary")}),e&&o.jsx("p",{className:G(yi[t],"text-muted-foreground font-medium"),children:e})]});return n?o.jsx("div",{className:"flex items-center justify-center w-full h-full min-h-[400px]",children:s}):s};function pn(e,[t,n]){return Math.min(n,Math.max(t,e))}function wi(e){const t=e+"CollectionProvider",[n,r]=ke(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:y,children:w}=h,x=we.useRef(null),b=we.useRef(new Map).current;return o.jsx(s,{scope:y,itemMap:b,collectionRef:x,children:w})};i.displayName=t;const l=e+"CollectionSlot",c=bt(l),d=we.forwardRef((h,y)=>{const{scope:w,children:x}=h,b=a(l,w),C=q(y,b.collectionRef);return o.jsx(c,{ref:C,children:x})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",v=bt(u),m=we.forwardRef((h,y)=>{const{scope:w,children:x,...b}=h,C=we.useRef(null),j=q(y,C),P=a(u,w);return we.useEffect(()=>(P.itemMap.set(C,{ref:C,...b}),()=>{P.itemMap.delete(C)})),o.jsx(v,{[p]:"",ref:j,children:x})});m.displayName=u;function g(h){const y=a(e+"CollectionConsumer",h);return we.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((P,N)=>b.indexOf(P.ref.current)-b.indexOf(N.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:m},g,r]}var bi=f.createContext(void 0);function Ci(e){const t=f.useContext(bi);return e||t||"ltr"}function ro(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Si=[" ","Enter","ArrowUp","ArrowDown"],ji=[" ","Enter"],Ce="Select",[dt,ut,Ni]=wi(Ce),[Me]=ke(Ce,[Ni,at]),ft=at(),[_i,me]=Me(Ce),[Ti,Ri]=Me(Ce),so=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:i,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:v,required:m,form:g}=e,h=ft(t),[y,w]=f.useState(null),[x,b]=f.useState(null),[C,j]=f.useState(!1),P=Ci(d),[N,I]=He({prop:r,defaultProp:s??!1,onChange:a,caller:Ce}),[D,R]=He({prop:i,defaultProp:l,onChange:c,caller:Ce}),A=f.useRef(null),$=y?g||!!y.closest("form"):!0,[M,k]=f.useState(new Set),W=Array.from(M).map(E=>E.props.value).join(";");return o.jsx(Wn,{...h,children:o.jsxs(_i,{required:m,scope:t,trigger:y,onTriggerChange:w,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:j,contentId:We(),value:D,onValueChange:R,open:N,onOpenChange:I,dir:P,triggerPointerDownPosRef:A,disabled:v,children:[o.jsx(dt.Provider,{scope:t,children:o.jsx(Ti,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(E=>{k(O=>new Set(O).add(E))},[]),onNativeOptionRemove:f.useCallback(E=>{k(O=>{const T=new Set(O);return T.delete(E),T})},[]),children:n})}),$?o.jsxs(Ro,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:p,value:D,onChange:E=>R(E.target.value),disabled:v,form:g,children:[D===void 0?o.jsx("option",{value:""}):null,Array.from(M)]},W):null]})})};so.displayName=Ce;var io="SelectTrigger",ao=f.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=ft(n),i=me(io,n),l=i.disabled||r,c=q(t,i.onTriggerChange),d=ut(n),u=f.useRef("touch"),[p,v,m]=Ao(h=>{const y=d().filter(b=>!b.disabled),w=y.find(b=>b.value===i.value),x=Eo(y,h,w);x!==void 0&&i.onValueChange(x.value)}),g=h=>{l||(i.onOpenChange(!0),m()),h&&(i.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return o.jsx(zn,{asChild:!0,...a,children:o.jsx(V.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Po(i.value)?"":void 0,...s,ref:c,onClick:L(s.onClick,h=>{h.currentTarget.focus(),u.current!=="mouse"&&g(h)}),onPointerDown:L(s.onPointerDown,h=>{u.current=h.pointerType;const y=h.target;y.hasPointerCapture(h.pointerId)&&y.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(g(h),h.preventDefault())}),onKeyDown:L(s.onKeyDown,h=>{const y=p.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&v(h.key),!(y&&h.key===" ")&&Si.includes(h.key)&&(g(),h.preventDefault())})})})});ao.displayName=io;var co="SelectValue",lo=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:i="",...l}=e,c=me(co,n),{onValueNodeHasChildrenChange:d}=c,u=a!==void 0,p=q(t,c.onValueNodeChange);return ee(()=>{d(u)},[d,u]),o.jsx(V.span,{...l,ref:p,style:{pointerEvents:"none"},children:Po(c.value)?o.jsx(o.Fragment,{children:i}):a})});lo.displayName=co;var Pi="SelectIcon",uo=f.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(V.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});uo.displayName=Pi;var Ai="SelectPortal",fo=e=>o.jsx(xn,{asChild:!0,...e});fo.displayName=Ai;var Se="SelectContent",po=f.forwardRef((e,t)=>{const n=me(Se,e.__scopeSelect),[r,s]=f.useState();if(ee(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?Ot.createPortal(o.jsx(ho,{scope:e.__scopeSelect,children:o.jsx(dt.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),a):null}return o.jsx(mo,{...e,ref:t})});po.displayName=Se;var te=10,[ho,xe]=Me(Se),Ei="SelectContentImpl",ki=bt("SelectContent.RemoveScroll"),mo=f.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:i,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:v,collisionPadding:m,sticky:g,hideWhenDetached:h,avoidCollisions:y,...w}=e,x=me(Se,n),[b,C]=f.useState(null),[j,P]=f.useState(null),N=q(t,_=>C(_)),[I,D]=f.useState(null),[R,A]=f.useState(null),$=ut(n),[M,k]=f.useState(!1),W=f.useRef(!1);f.useEffect(()=>{if(b)return Yo(b)},[b]),Xo();const E=f.useCallback(_=>{const[z,...Y]=$().map(U=>U.ref.current),[F]=Y.slice(-1),B=document.activeElement;for(const U of _)if(U===B||(U?.scrollIntoView({block:"nearest"}),U===z&&j&&(j.scrollTop=0),U===F&&j&&(j.scrollTop=j.scrollHeight),U?.focus(),document.activeElement!==B))return},[$,j]),O=f.useCallback(()=>E([I,b]),[E,I,b]);f.useEffect(()=>{M&&O()},[M,O]);const{onOpenChange:T,triggerPointerDownPosRef:H}=x;f.useEffect(()=>{if(b){let _={x:0,y:0};const z=F=>{_={x:Math.abs(Math.round(F.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(F.pageY)-(H.current?.y??0))}},Y=F=>{_.x<=10&&_.y<=10?F.preventDefault():b.contains(F.target)||T(!1),document.removeEventListener("pointermove",z),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",z),document.addEventListener("pointerup",Y,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",z),document.removeEventListener("pointerup",Y,{capture:!0})}}},[b,T,H]),f.useEffect(()=>{const _=()=>T(!1);return window.addEventListener("blur",_),window.addEventListener("resize",_),()=>{window.removeEventListener("blur",_),window.removeEventListener("resize",_)}},[T]);const[X,ge]=Ao(_=>{const z=$().filter(B=>!B.disabled),Y=z.find(B=>B.ref.current===document.activeElement),F=Eo(z,_,Y);F&&setTimeout(()=>F.ref.current.focus())}),Le=f.useCallback((_,z,Y)=>{const F=!W.current&&!Y;(x.value!==void 0&&x.value===z||F)&&(D(_),F&&(W.current=!0))},[x.value]),De=f.useCallback(()=>b?.focus(),[b]),ue=f.useCallback((_,z,Y)=>{const F=!W.current&&!Y;(x.value!==void 0&&x.value===z||F)&&A(_)},[x.value]),je=r==="popper"?Pt:xo,ve=je===Pt?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:v,collisionPadding:m,sticky:g,hideWhenDetached:h,avoidCollisions:y}:{};return o.jsx(ho,{scope:n,content:b,viewport:j,onViewportChange:P,itemRefCallback:Le,selectedItem:I,onItemLeave:De,itemTextRefCallback:ue,focusSelectedItem:O,selectedItemText:R,position:r,isPositioned:M,searchRef:X,children:o.jsx(Qo,{as:ki,allowPinchZoom:!0,children:o.jsx(Zo,{asChild:!0,trapped:x.open,onMountAutoFocus:_=>{_.preventDefault()},onUnmountAutoFocus:L(s,_=>{x.trigger?.focus({preventScroll:!0}),_.preventDefault()}),children:o.jsx(gn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:_=>_.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:o.jsx(je,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:_=>_.preventDefault(),...w,...ve,onPlaced:()=>k(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:L(w.onKeyDown,_=>{const z=_.ctrlKey||_.altKey||_.metaKey;if(_.key==="Tab"&&_.preventDefault(),!z&&_.key.length===1&&ge(_.key),["ArrowUp","ArrowDown","Home","End"].includes(_.key)){let F=$().filter(B=>!B.disabled).map(B=>B.ref.current);if(["ArrowUp","End"].includes(_.key)&&(F=F.slice().reverse()),["ArrowUp","ArrowDown"].includes(_.key)){const B=_.target,U=F.indexOf(B);F=F.slice(U+1)}setTimeout(()=>E(F)),_.preventDefault()}})})})})})})});mo.displayName=Ei;var Ii="SelectItemAlignedPosition",xo=f.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=me(Se,n),i=xe(Se,n),[l,c]=f.useState(null),[d,u]=f.useState(null),p=q(t,N=>u(N)),v=ut(n),m=f.useRef(!1),g=f.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:w,focusSelectedItem:x}=i,b=f.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&d&&h&&y&&w){const N=a.trigger.getBoundingClientRect(),I=d.getBoundingClientRect(),D=a.valueNode.getBoundingClientRect(),R=w.getBoundingClientRect();if(a.dir!=="rtl"){const B=R.left-I.left,U=D.left-B,J=N.left-U,ye=N.width+J,mt=Math.max(ye,I.width),xt=window.innerWidth-te,gt=pn(U,[te,Math.max(te,xt-mt)]);l.style.minWidth=ye+"px",l.style.left=gt+"px"}else{const B=I.right-R.right,U=window.innerWidth-D.right-B,J=window.innerWidth-N.right-U,ye=N.width+J,mt=Math.max(ye,I.width),xt=window.innerWidth-te,gt=pn(U,[te,Math.max(te,xt-mt)]);l.style.minWidth=ye+"px",l.style.right=gt+"px"}const A=v(),$=window.innerHeight-te*2,M=h.scrollHeight,k=window.getComputedStyle(d),W=parseInt(k.borderTopWidth,10),E=parseInt(k.paddingTop,10),O=parseInt(k.borderBottomWidth,10),T=parseInt(k.paddingBottom,10),H=W+E+M+T+O,X=Math.min(y.offsetHeight*5,H),ge=window.getComputedStyle(h),Le=parseInt(ge.paddingTop,10),De=parseInt(ge.paddingBottom,10),ue=N.top+N.height/2-te,je=$-ue,ve=y.offsetHeight/2,_=y.offsetTop+ve,z=W+E+_,Y=H-z;if(z<=ue){const B=A.length>0&&y===A[A.length-1].ref.current;l.style.bottom="0px";const U=d.clientHeight-h.offsetTop-h.offsetHeight,J=Math.max(je,ve+(B?De:0)+U+O),ye=z+J;l.style.height=ye+"px"}else{const B=A.length>0&&y===A[0].ref.current;l.style.top="0px";const J=Math.max(ue,W+h.offsetTop+(B?Le:0)+ve)+Y;l.style.height=J+"px",h.scrollTop=z-ue+h.offsetTop}l.style.margin=`${te}px 0`,l.style.minHeight=X+"px",l.style.maxHeight=$+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[v,a.trigger,a.valueNode,l,d,h,y,w,a.dir,r]);ee(()=>b(),[b]);const[C,j]=f.useState();ee(()=>{d&&j(window.getComputedStyle(d).zIndex)},[d]);const P=f.useCallback(N=>{N&&g.current===!0&&(b(),x?.(),g.current=!1)},[b,x]);return o.jsx(Mi,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:P,children:o.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:o.jsx(V.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});xo.displayName=Ii;var Oi="SelectPopperPosition",Pt=f.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=te,...a}=e,i=ft(n);return o.jsx(Un,{...i,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Pt.displayName=Oi;var[Mi,Kt]=Me(Se,{}),At="SelectViewport",go=f.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=xe(At,n),i=Kt(At,n),l=q(t,a.onViewportChange),c=f.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(dt.Slot,{scope:n,children:o.jsx(V.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:L(s.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:v}=i;if(v?.current&&p){const m=Math.abs(c.current-u.scrollTop);if(m>0){const g=window.innerHeight-te*2,h=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),w=Math.max(h,y);if(w<g){const x=w+m,b=Math.min(g,x),C=x-b;p.style.height=b+"px",p.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});go.displayName=At;var vo="SelectGroup",[Li,Di]=Me(vo),$i=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=We();return o.jsx(Li,{scope:n,id:s,children:o.jsx(V.div,{role:"group","aria-labelledby":s,...r,ref:t})})});$i.displayName=vo;var yo="SelectLabel",Hi=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Di(yo,n);return o.jsx(V.div,{id:s.id,...r,ref:t})});Hi.displayName=yo;var tt="SelectItem",[Fi,wo]=Me(tt),bo=f.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...i}=e,l=me(tt,n),c=xe(tt,n),d=l.value===r,[u,p]=f.useState(a??""),[v,m]=f.useState(!1),g=q(t,x=>c.itemRefCallback?.(x,r,s)),h=We(),y=f.useRef("touch"),w=()=>{s||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(Fi,{scope:n,value:r,disabled:s,textId:h,isSelected:d,onItemTextChange:f.useCallback(x=>{p(b=>b||(x?.textContent??"").trim())},[]),children:o.jsx(dt.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:o.jsx(V.div,{role:"option","aria-labelledby":h,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:g,onFocus:L(i.onFocus,()=>m(!0)),onBlur:L(i.onBlur,()=>m(!1)),onClick:L(i.onClick,()=>{y.current!=="mouse"&&w()}),onPointerUp:L(i.onPointerUp,()=>{y.current==="mouse"&&w()}),onPointerDown:L(i.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:L(i.onPointerMove,x=>{y.current=x.pointerType,s?c.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:L(i.onPointerLeave,x=>{x.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:L(i.onKeyDown,x=>{c.searchRef?.current!==""&&x.key===" "||(ji.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})})})})});bo.displayName=tt;var $e="SelectItemText",Co=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,i=me($e,n),l=xe($e,n),c=wo($e,n),d=Ri($e,n),[u,p]=f.useState(null),v=q(t,w=>p(w),c.onItemTextChange,w=>l.itemTextRefCallback?.(w,c.value,c.disabled)),m=u?.textContent,g=f.useMemo(()=>o.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=d;return ee(()=>(h(g),()=>y(g)),[h,y,g]),o.jsxs(o.Fragment,{children:[o.jsx(V.span,{id:c.textId,...a,ref:v}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ot.createPortal(a.children,i.valueNode):null]})});Co.displayName=$e;var So="SelectItemIndicator",jo=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return wo(So,n).isSelected?o.jsx(V.span,{"aria-hidden":!0,...r,ref:t}):null});jo.displayName=So;var Et="SelectScrollUpButton",No=f.forwardRef((e,t)=>{const n=xe(Et,e.__scopeSelect),r=Kt(Et,e.__scopeSelect),[s,a]=f.useState(!1),i=q(t,r.onScrollButtonChange);return ee(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;a(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?o.jsx(To,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});No.displayName=Et;var kt="SelectScrollDownButton",_o=f.forwardRef((e,t)=>{const n=xe(kt,e.__scopeSelect),r=Kt(kt,e.__scopeSelect),[s,a]=f.useState(!1),i=q(t,r.onScrollButtonChange);return ee(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;a(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?o.jsx(To,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});_o.displayName=kt;var To=f.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=xe("SelectScrollButton",n),i=f.useRef(null),l=ut(n),c=f.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),ee(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),o.jsx(V.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:L(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:L(s.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:L(s.onPointerLeave,()=>{c()})})}),Bi="SelectSeparator",Vi=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(V.div,{"aria-hidden":!0,...r,ref:t})});Vi.displayName=Bi;var It="SelectArrow",Wi=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ft(n),a=me(It,n),i=xe(It,n);return a.open&&i.position==="popper"?o.jsx(qn,{...s,...r,ref:t}):null});Wi.displayName=It;var zi="SelectBubbleInput",Ro=f.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=f.useRef(null),a=q(r,s),i=ro(t);return f.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[i,t]),o.jsx(V.select,{...n,style:{...Kn,...n.style},ref:a,defaultValue:t})});Ro.displayName=zi;function Po(e){return e===""||e===void 0}function Ao(e){const t=mn(e),n=f.useRef(""),r=f.useRef(0),s=f.useCallback(i=>{const l=n.current+i;t(l),(function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),a=f.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function Eo(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=Ui(e,Math.max(a,0));s.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function Ui(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qi=so,Ki=ao,Gi=lo,Yi=uo,Xi=fo,Qi=po,Zi=go,Ji=bo,ea=Co,ta=jo,na=No,oa=_o;function Ne({...e}){return o.jsx(qi,{...e})}function _e({...e}){return o.jsx(Gi,{...e})}function Te({className:e,children:t,...n}){return o.jsxs(Ki,{className:G("flex h-10 w-full items-center justify-between rounded-md border bg-background px-3 py-2 text-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",e),...n,children:[t,o.jsx(Yi,{asChild:!0,children:o.jsx(Mt,{className:"h-4 w-4 opacity-50"})})]})}function ra({className:e,...t}){return o.jsx(na,{className:G("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(vr,{className:"h-4 w-4"})})}function sa({className:e,...t}){return o.jsx(oa,{className:G("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Mt,{className:"h-4 w-4"})})}function Re({className:e,children:t,position:n="popper",...r}){return o.jsx(Xi,{children:o.jsxs(Qi,{className:G("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",e),position:n,...r,children:[o.jsx(ra,{}),o.jsx(Zi,{className:G("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(sa,{})]})})}function K({className:e,children:t,...n}){return o.jsxs(Ji,{className:G("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(ta,{children:o.jsx(wn,{className:"h-4 w-4"})})}),o.jsx(ea,{children:t})]})}const Gt={},ia=Symbol((Gt?"production":void 0)!=="production"?"RESET":""),ko=e=>typeof e?.then=="function";function aa(e=()=>{try{return window.localStorage}catch(n){(Gt?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(n);return}},t){var n;let r,s;const a={getItem:(c,d)=>{var u,p;const v=g=>{if(g=g||"",r!==g){try{s=JSON.parse(g,t?.reviver)}catch{return d}r=g}return s},m=(p=(u=e())==null?void 0:u.getItem(c))!=null?p:null;return ko(m)?m.then(v):v(m)},setItem:(c,d)=>{var u;return(u=e())==null?void 0:u.setItem(c,JSON.stringify(d,void 0))},removeItem:c=>{var d;return(d=e())==null?void 0:d.removeItem(c)}},i=c=>(d,u,p)=>c(d,v=>{let m;try{m=JSON.parse(v||"")}catch{m=p}u(m)});let l;try{l=(n=e())==null?void 0:n.subscribe}catch{}return!l&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(l=(c,d)=>{if(!(e()instanceof window.Storage))return()=>{};const u=p=>{p.storageArea===e()&&p.key===c&&d(p.newValue)};return window.addEventListener("storage",u),()=>{window.removeEventListener("storage",u)}}),l&&(a.subscribe=i(l)),a}const ca=aa();function la(e,t,n=ca,r){const s=Ct(t);return(Gt?"production":void 0)!=="production"&&(s.debugPrivate=!0),s.onMount=i=>{i(n.getItem(e,t));let l;return n.subscribe&&(l=n.subscribe(e,i,t)),l},Ct(i=>i(s),(i,l,c)=>{const d=typeof c=="function"?c(i(s)):c;return d===ia?(l(s,t),n.removeItem(e)):ko(d)?d.then(u=>(l(s,u),n.setItem(e,u))):(l(s,d),n.setItem(e,d))})}const da={soundType:"none"},Io=la("claude-code-viewer-notification-settings",da),Da=Ct(e=>e(Io).soundType!=="none"),ua={beep:{frequency:[800],duration:.15,type:"sine",volume:.3},chime:{frequency:[523,659,784],duration:.4,type:"sine",volume:.2},ping:{frequency:[1e3],duration:.1,type:"triangle",volume:.4},pop:{frequency:[400,600],duration:.08,type:"square",volume:.2}};function fa(e){if(e!=="none")try{const t=ua[e];if(!t){console.warn(`Unknown sound type: ${e}`);return}const n=new(window.AudioContext||window.webkitAudioContext);t.frequency.forEach((r,s)=>{const a=n.createOscillator(),i=n.createGain();a.connect(i),i.connect(n.destination),a.frequency.setValueAtTime(r,n.currentTime),a.type=t.type;const l=n.currentTime+s*.05;i.gain.setValueAtTime(t.volume,l),i.gain.exponentialRampToValueAtTime(.01,l+t.duration),a.start(l),a.stop(l+t.duration)})}catch(t){console.warn("Failed to play notification sound:",t)}}function pa(e){return{none:o.jsx(S,{id:"notification.none"}),beep:o.jsx(S,{id:"notification.beep"}),chime:o.jsx(S,{id:"notification.chime"}),ping:o.jsx(S,{id:"notification.ping"}),pop:o.jsx(S,{id:"notification.pop"})}[e]}function ha(){return["none","beep","chime","ping","pop"]}const ma=({showLabels:e=!0,showDescriptions:t=!0,className:n=""})=>{const r=f.useId(),[s,a]=Jo(Io),i=f.useCallback(d=>{a(u=>({...u,soundType:d}))},[a]),l=f.useCallback(()=>{s.soundType!=="none"&&fa(s.soundType)},[s.soundType]),c=ha();return o.jsx("div",{className:`space-y-4 ${n}`,children:o.jsxs("div",{className:"space-y-2",children:[e&&o.jsx("label",{htmlFor:r,className:"text-sm font-medium leading-none",children:"Task completion sound"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(Ne,{value:s.soundType,onValueChange:i,children:[o.jsx(Te,{id:r,className:"w-[180px]",children:o.jsx(_e,{placeholder:"音を選択"})}),o.jsx(Re,{children:c.map(d=>o.jsx(K,{value:d,children:pa(d)},d))})]}),s.soundType!=="none"&&o.jsx(er,{variant:"outline",size:"sm",onClick:l,className:"px-3",children:o.jsx(S,{id:"notification.test"})})]}),t&&o.jsx("p",{className:"text-xs text-muted-foreground",children:o.jsx(S,{id:"notification.description"})})]})})};var pt="Checkbox",[xa]=ke(pt),[ga,Yt]=xa(pt);function va(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:a,form:i,name:l,onCheckedChange:c,required:d,value:u="on",internal_do_not_use_render:p}=e,[v,m]=He({prop:n,defaultProp:s??!1,onChange:c,caller:pt}),[g,h]=f.useState(null),[y,w]=f.useState(null),x=f.useRef(!1),b=g?!!i||!!g.closest("form"):!0,C={checked:v,disabled:a,setChecked:m,control:g,setControl:h,name:l,form:i,value:u,hasConsumerStoppedPropagationRef:x,required:d,defaultChecked:fe(s)?!1:s,isFormControl:b,bubbleInput:y,setBubbleInput:w};return o.jsx(ga,{scope:t,...C,children:ya(p)?p(C):r})}var Oo="CheckboxTrigger",Mo=f.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:a,value:i,disabled:l,checked:c,required:d,setControl:u,setChecked:p,hasConsumerStoppedPropagationRef:v,isFormControl:m,bubbleInput:g}=Yt(Oo,e),h=q(s,u),y=f.useRef(c);return f.useEffect(()=>{const w=a?.form;if(w){const x=()=>p(y.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[a,p]),o.jsx(V.button,{type:"button",role:"checkbox","aria-checked":fe(c)?"mixed":c,"aria-required":d,"data-state":Bo(c),"data-disabled":l?"":void 0,disabled:l,value:i,...r,ref:h,onKeyDown:L(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:L(n,w=>{p(x=>fe(x)?!0:!x),g&&m&&(v.current=w.isPropagationStopped(),v.current||w.stopPropagation())})})});Mo.displayName=Oo;var Lo=f.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:a,required:i,disabled:l,value:c,onCheckedChange:d,form:u,...p}=e;return o.jsx(va,{__scopeCheckbox:n,checked:s,defaultChecked:a,disabled:l,required:i,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:v})=>o.jsxs(o.Fragment,{children:[o.jsx(Mo,{...p,ref:t,__scopeCheckbox:n}),v&&o.jsx(Fo,{__scopeCheckbox:n})]})})});Lo.displayName=pt;var Do="CheckboxIndicator",$o=f.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,a=Yt(Do,n);return o.jsx(nt,{present:r||fe(a.checked)||a.checked===!0,children:o.jsx(V.span,{"data-state":Bo(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});$o.displayName=Do;var Ho="CheckboxBubbleInput",Fo=f.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:a,defaultChecked:i,required:l,disabled:c,name:d,value:u,form:p,bubbleInput:v,setBubbleInput:m}=Yt(Ho,e),g=q(n,m),h=ro(a),y=In(r);f.useEffect(()=>{const x=v;if(!x)return;const b=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(b,"checked").set,P=!s.current;if(h!==a&&j){const N=new Event("click",{bubbles:P});x.indeterminate=fe(a),j.call(x,fe(a)?!1:a),x.dispatchEvent(N)}},[v,h,a,s]);const w=f.useRef(fe(a)?!1:a);return o.jsx(V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??w.current,required:l,disabled:c,name:d,value:u,form:p,...t,tabIndex:-1,ref:g,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Fo.displayName=Ho;function ya(e){return typeof e=="function"}function fe(e){return e==="indeterminate"}function Bo(e){return fe(e)?"indeterminate":e?"checked":"unchecked"}function wt({className:e,...t}){return o.jsx(Lo,{"data-slot":"checkbox",className:G("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx($o,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:o.jsx(wn,{className:"size-3.5"})})})}const Vo=()=>{const{data:e}=St({queryKey:Jt.queryKey,queryFn:Jt.queryFn}),t=f.useMemo(()=>new Set(e.flags.filter(r=>r.enabled).map(r=>r.name)),[e.flags]),n=f.useCallback(r=>t.has(r),[t]);return{flags:e.flags,isFlagEnabled:n}},wa="en",ba=e=>{};function Ca(e){return e==="ctrl-k"||e==="command-k"}const Sa=({openingProjectId:e,showLabels:t=!0,showDescriptions:n=!0,className:r=""})=>{const s=f.useId(),a=f.useId(),i=f.useId(),l=f.useId(),c=f.useId(),d=f.useId(),{config:u,updateConfig:p}=tr(),v=nr(),{theme:m}=or(),{i18n:g}=rr(),{isFlagEnabled:h}=Vo(),y=h("tool-approval"),w=f.useMemo(()=>ba()??wa,[]),x=async()=>{const R={...u,hideNoUserMessageSession:!u?.hideNoUserMessageSession};p(R,{onSuccess:async()=>{await v.refetchQueries({queryKey:sr.queryKey})}})},b=async()=>{const R={...u,unifySameTitleSession:!u?.unifySameTitleSession};p(R,{onSuccess:async()=>{await v.refetchQueries({queryKey:ir(e).queryKey})}})},C=async()=>{const R={...u,autoScheduleContinueOnRateLimit:!u?.autoScheduleContinueOnRateLimit};p(R)},j=async R=>{const A={...u,enterKeyBehavior:R};p(A)},P=async R=>{if(!Ca(R))return;const A={...u,searchHotkey:R};p(A)},N=async R=>{const A={...u,permissionMode:R};p(A)},I=async R=>{const A={...u,locale:R};p(A)},D=async R=>{const A={...u,theme:R};p(A)};return o.jsxs("div",{className:`space-y-4 ${r}`,children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(wt,{id:s,checked:u?.hideNoUserMessageSession,onCheckedChange:x}),t&&o.jsx("label",{htmlFor:s,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:o.jsx(S,{id:"settings.session.hide_no_user_message"})})]}),n&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:o.jsx(S,{id:"settings.session.hide_no_user_message.description"})}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(wt,{id:`${s}-unify`,checked:u?.unifySameTitleSession,onCheckedChange:b}),t&&o.jsx("label",{htmlFor:`${s}-unify`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:o.jsx(S,{id:"settings.session.unify_same_title"})})]}),n&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:o.jsx(S,{id:"settings.session.unify_same_title.description"})}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(wt,{id:`${s}-auto-schedule-continue`,checked:u?.autoScheduleContinueOnRateLimit,onCheckedChange:C}),t&&o.jsx("label",{htmlFor:`${s}-auto-schedule-continue`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:o.jsx(S,{id:"settings.session.auto_schedule_continue_on_rate_limit"})})]}),n&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1 ml-6",children:o.jsx(S,{id:"settings.session.auto_schedule_continue_on_rate_limit.description"})}),o.jsxs("div",{className:"space-y-2",children:[t&&o.jsx("label",{htmlFor:a,className:"text-sm font-medium leading-none",children:o.jsx(S,{id:"settings.input.enter_key_behavior"})}),o.jsxs(Ne,{value:u?.enterKeyBehavior||"shift-enter-send",onValueChange:j,children:[o.jsx(Te,{id:a,className:"w-full",children:o.jsx(_e,{placeholder:g._("Select enter key behavior")})}),o.jsxs(Re,{children:[o.jsx(K,{value:"shift-enter-send",children:o.jsx(S,{id:"settings.input.enter_key_behavior.shift_enter"})}),o.jsx(K,{value:"enter-send",children:o.jsx(S,{id:"settings.input.enter_key_behavior.enter"})}),o.jsx(K,{value:"command-enter-send",children:o.jsx(S,{id:"settings.input.enter_key_behavior.command_enter"})})]})]}),n&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:o.jsx(S,{id:"settings.input.enter_key_behavior.description"})})]}),o.jsxs("div",{className:"space-y-2",children:[t&&o.jsx("label",{htmlFor:i,className:"text-sm font-medium leading-none",children:o.jsx(S,{id:"settings.input.search_hotkey"})}),o.jsxs(Ne,{value:u?.searchHotkey||"command-k",onValueChange:P,children:[o.jsx(Te,{id:i,className:"w-full",children:o.jsx(_e,{placeholder:g._("Select search hotkey")})}),o.jsxs(Re,{children:[o.jsx(K,{value:"ctrl-k",children:o.jsx(S,{id:"settings.input.search_hotkey.ctrl_k"})}),o.jsx(K,{value:"command-k",children:o.jsx(S,{id:"settings.input.search_hotkey.command_k"})})]})]}),n&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:o.jsx(S,{id:"settings.input.search_hotkey.description"})})]}),o.jsxs("div",{className:"space-y-2",children:[t&&o.jsx("label",{htmlFor:l,className:"text-sm font-medium leading-none",children:o.jsx(S,{id:"settings.permission.mode"})}),o.jsxs(Ne,{value:u?.permissionMode||"default",onValueChange:N,disabled:!y,children:[o.jsx(Te,{id:l,className:"w-full",children:o.jsx(_e,{placeholder:g._("Select permission mode")})}),o.jsxs(Re,{children:[o.jsx(K,{value:"default",children:o.jsx(S,{id:"settings.permission.mode.default"})}),o.jsx(K,{value:"acceptEdits",children:o.jsx(S,{id:"settings.permission.mode.accept_edits"})}),o.jsx(K,{value:"bypassPermissions",children:o.jsx(S,{id:"settings.permission.mode.bypass_permissions"})}),o.jsx(K,{value:"plan",children:o.jsx(S,{id:"settings.permission.mode.plan"})})]})]}),n&&y&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:o.jsx(S,{id:"settings.permission.mode.description"})}),n&&!y&&o.jsx("p",{className:"text-xs text-destructive mt-1",children:o.jsx(S,{id:"settings.permission.mode.unavailable"})})]}),o.jsxs("div",{className:"space-y-2",children:[t&&o.jsx("label",{htmlFor:c,className:"text-sm font-medium leading-none",children:o.jsx(S,{id:"settings.locale"})}),o.jsxs(Ne,{value:u?.locale||w,onValueChange:I,children:[o.jsx(Te,{id:c,className:"w-full",children:o.jsx(_e,{placeholder:g._("Select language")})}),o.jsxs(Re,{children:[o.jsx(K,{value:"ja",children:o.jsx(S,{id:"settings.locale.ja"})}),o.jsx(K,{value:"en",children:o.jsx(S,{id:"settings.locale.en"})}),o.jsx(K,{value:"zh_CN",children:o.jsx(S,{id:"settings.locale.zh_CN"})})]})]}),n&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:o.jsx(S,{id:"settings.locale.description"})})]}),o.jsxs("div",{className:"space-y-2",children:[t&&o.jsx("label",{htmlFor:d,className:"text-sm font-medium leading-none",children:o.jsx(S,{id:"settings.theme"})}),o.jsxs(Ne,{value:m??"system",onValueChange:D,children:[o.jsx(Te,{id:d,className:"w-full",children:o.jsx(_e,{placeholder:g._("Select theme")})}),o.jsxs(Re,{children:[o.jsx(K,{value:"light",children:o.jsx(S,{id:"settings.theme.light"})}),o.jsx(K,{value:"dark",children:o.jsx(S,{id:"settings.theme.dark"})}),o.jsx(K,{value:"system",children:o.jsx(S,{id:"settings.theme.system"})})]})]}),n&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:o.jsx(S,{id:"settings.theme.description"})})]})]})},ja=cr("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function hn({className:e,variant:t,asChild:n=!1,...r}){const s=n?ar:"span";return o.jsx(s,{"data-slot":"badge",className:G(ja({variant:t}),e),...r})}var ht="Collapsible",[Na]=ke(ht),[_a,Xt]=Na(ht),Wo=f.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:a,onOpenChange:i,...l}=e,[c,d]=He({prop:r,defaultProp:s??!1,onChange:i,caller:ht});return o.jsx(_a,{scope:n,disabled:a,contentId:We(),open:c,onOpenToggle:f.useCallback(()=>d(u=>!u),[d]),children:o.jsx(V.div,{"data-state":Zt(c),"data-disabled":a?"":void 0,...l,ref:t})})});Wo.displayName=ht;var zo="CollapsibleTrigger",Uo=f.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=Xt(zo,n);return o.jsx(V.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Zt(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:L(e.onClick,s.onOpenToggle)})});Uo.displayName=zo;var Qt="CollapsibleContent",qo=f.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Xt(Qt,e.__scopeCollapsible);return o.jsx(nt,{present:n||s.open,children:({present:a})=>o.jsx(Ta,{...r,ref:t,present:a})})});qo.displayName=Qt;var Ta=f.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...a}=e,i=Xt(Qt,n),[l,c]=f.useState(r),d=f.useRef(null),u=q(t,d),p=f.useRef(0),v=p.current,m=f.useRef(0),g=m.current,h=i.open||l,y=f.useRef(h),w=f.useRef(void 0);return f.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),ee(()=>{const x=d.current;if(x){w.current=w.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();p.current=b.height,m.current=b.width,y.current||(x.style.transitionDuration=w.current.transitionDuration,x.style.animationName=w.current.animationName),c(r)}},[i.open,r]),o.jsx(V.div,{"data-state":Zt(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:h&&s})});function Zt(e){return e?"open":"closed"}var Ra=Wo;function Pa({...e}){return o.jsx(Ra,{"data-slot":"collapsible",...e})}function Aa({...e}){return o.jsx(Uo,{"data-slot":"collapsible-trigger",...e})}function Ea({...e}){return o.jsx(qo,{"data-slot":"collapsible-content",...e})}const ka=e=>{switch(e){case"tool-approval":return{title:o.jsx(S,{id:"system_info.feature.tool_approval.title"}),description:o.jsx(S,{id:"system_info.feature.tool_approval.description"})};case"agent-sdk":return{title:o.jsx(S,{id:"system_info.feature.agent_sdk.title"}),description:o.jsx(S,{id:"system_info.feature.agent_sdk.description"})};case"sidechain-separation":return{title:o.jsx(S,{id:"system_info.feature.sidechain_separation.title"}),description:o.jsx(S,{id:"system_info.feature.sidechain_separation.description"})};case"uuid-on-sdk-message":return{title:o.jsx(S,{id:"system_info.feature.uuid_on_sdk_message.title"}),description:o.jsx(S,{id:"system_info.feature.uuid_on_sdk_message.description"})};case"run-skills-directly":return{title:o.jsx(S,{id:"system_info.feature.run_skills_directly.title"}),description:o.jsx(S,{id:"system_info.feature.run_skills_directly.description"})};default:return{title:e,description:o.jsx(S,{id:"system_info.feature.unknown.description"})}}},Ia=()=>{const[e,t]=f.useState(!1),{data:n}=St({...lr}),{data:r}=St({...dr}),{flags:s}=Vo();return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"border-b border-sidebar-border p-4",children:[o.jsx("h2",{className:"font-semibold text-lg",children:o.jsx(S,{id:"system_info.title"})}),o.jsx("p",{className:"text-xs text-sidebar-foreground/70",children:o.jsx(S,{id:"system_info.description"})})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:o.jsx(S,{id:"system_info.viewer_version"})}),o.jsxs("div",{className:"flex justify-between items-center pl-2",children:[o.jsx("span",{className:"text-xs text-sidebar-foreground/70",children:o.jsx(S,{id:"system_info.version_label"})}),o.jsxs(hn,{variant:"secondary",className:"text-xs font-mono",children:["v",n?.version||"Unknown"]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:o.jsx(S,{id:"system_info.claude_code"})}),o.jsxs("div",{className:"space-y-2 pl-2",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"text-xs text-sidebar-foreground/70",children:o.jsx(S,{id:"system_info.executable_path"})}),o.jsx("div",{className:"text-xs text-sidebar-foreground font-mono break-all",children:r?.executablePath||o.jsx("span",{className:"text-sidebar-foreground/50",children:o.jsx(S,{id:"system_info.unknown"})})})]}),o.jsxs("div",{className:"flex justify-between items-center pt-1",children:[o.jsx("span",{className:"text-xs text-sidebar-foreground/70",children:o.jsx(S,{id:"system_info.version_label"})}),o.jsx(hn,{variant:"secondary",className:"text-xs font-mono",children:r?.version||o.jsx(S,{id:"system_info.unknown"})})]})]})]}),o.jsx("div",{className:"space-y-3",children:o.jsxs(Pa,{open:e,onOpenChange:t,children:[o.jsxs(Aa,{className:"flex w-full items-center justify-between group",children:[o.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:o.jsx(S,{id:"system_info.available_features"})}),e?o.jsx(Mt,{className:"h-4 w-4 text-sidebar-foreground/70 group-hover:text-sidebar-foreground transition-colors"}):o.jsx(xr,{className:"h-4 w-4 text-sidebar-foreground/70 group-hover:text-sidebar-foreground transition-colors"})]}),o.jsx(Ea,{className:"pt-3",children:o.jsx(qt,{children:o.jsx("ul",{className:"space-y-2 pl-2",children:s.map(({name:a,enabled:i})=>{const l=ka(a);return o.jsxs("li",{className:"flex items-start gap-2",children:[i?o.jsx(wr,{className:"h-3.5 w-3.5 text-green-500 dark:text-green-400 mt-0.5 flex-shrink-0"}):o.jsx(Cr,{className:"h-3.5 w-3.5 text-sidebar-foreground/30 mt-0.5 flex-shrink-0"}),o.jsxs(Ge,{children:[o.jsx(Ye,{asChild:!0,children:o.jsx("span",{className:i?"text-xs text-sidebar-foreground cursor-help":"text-xs text-sidebar-foreground/50 line-through cursor-help",children:l.title})}),o.jsx(Xe,{side:"right",className:"max-w-xs text-xs",children:l.description})]})]},a)})})})})]})})]})]})},$a=({projectId:e,className:t,additionalTabs:n=[],defaultActiveTab:r,headerButton:s})=>{const{openSearch:a}=ur(),{authEnabled:i,logout:l}=vn(),c=yn(),d=async()=>{await l(),c({to:"/login"})},u={id:"settings",icon:Ar,title:o.jsx(S,{id:"settings.tab.title"}),content:o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"border-b border-sidebar-border p-4",children:[o.jsx("h2",{className:"font-semibold text-lg",children:o.jsx(S,{id:"settings.title"})}),o.jsx("p",{className:"text-xs text-sidebar-foreground/70",children:o.jsx(S,{id:"settings.description"})})]}),o.jsx(f.Suspense,{fallback:o.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:o.jsx("div",{className:"text-sm text-sidebar-foreground/70",children:o.jsx(S,{id:"settings.loading"})})}),children:o.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:o.jsx(S,{id:"settings.section.session_display"})}),o.jsx(Sa,{openingProjectId:e??""})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"font-medium text-sm text-sidebar-foreground",children:o.jsx(S,{id:"settings.section.notifications"})}),o.jsx(ma,{})]})]})})]})},p={id:"system-info",icon:Nr,title:o.jsx(S,{id:"settings.section.system_info"}),content:o.jsx(f.Suspense,{fallback:o.jsx(fn,{}),children:o.jsx(Ia,{})})},v=[...n,u,p],[m,g]=f.useState(r??v[v.length-1]?.id??"settings"),[h,y]=f.useState(!!r),w=b=>{m===b&&h?y(!1):(g(b),y(!0))},x=v.find(b=>b.id===m)?.content;return o.jsxs("div",{className:G("h-full border-r border-sidebar-border transition-all duration-300 ease-in-out flex bg-sidebar text-sidebar-foreground",h?"w-80 lg:w-80":"w-12",t),children:[o.jsx("div",{className:"w-12 flex flex-col border-r border-sidebar-border bg-sidebar/50",children:o.jsxs(qt,{children:[s&&o.jsx("div",{className:"border-b border-sidebar-border",children:s}),o.jsx("div",{className:"p-2 border-b border-sidebar-border",children:o.jsxs(Ge,{children:[o.jsx(Ye,{asChild:!0,children:o.jsx("button",{type:"button",onClick:a,className:G("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","text-sidebar-foreground/70"),"data-testid":"search-button",children:o.jsx(fr,{className:"w-4 h-4"})})}),o.jsx(Xe,{side:"right",children:o.jsxs("p",{children:["Search ",o.jsx("kbd",{className:"ml-1 text-xs opacity-60",children:"⌘K"})]})})]})}),o.jsx("div",{className:"flex-1 flex flex-col p-2 space-y-1",children:v.map(b=>{const C=b.icon;return o.jsxs(Ge,{children:[o.jsx(Ye,{asChild:!0,children:o.jsx("button",{type:"button",onClick:()=>w(b.id),className:G("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",m===b.id&&h?"bg-sidebar-accent text-sidebar-accent-foreground shadow-sm":"text-sidebar-foreground/70"),"data-testid":`${b.id}-tab-button`,children:o.jsx(C,{className:"w-4 h-4"})})}),o.jsx(Xe,{side:"right",children:o.jsx("p",{children:b.title})})]},b.id)})}),i&&o.jsx("div",{className:"p-2 border-t border-sidebar-border",children:o.jsxs(Ge,{children:[o.jsx(Ye,{asChild:!0,children:o.jsx("button",{type:"button",onClick:d,className:G("w-8 h-8 flex items-center justify-center rounded-md transition-colors","hover:bg-destructive/10 hover:text-destructive","text-sidebar-foreground/70"),"data-testid":"logout-button",children:o.jsx(Tr,{className:"w-4 h-4"})})}),o.jsx(Xe,{side:"right",children:o.jsx("p",{children:"Logout"})})]})})]})}),h&&o.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:o.jsx(f.Suspense,{fallback:o.jsx(fn,{}),children:x})})]})};function Ha({children:e}){const{isAuthenticated:t}=vn(),n=yn();return f.useEffect(()=>{t||n({to:"/login"})},[t,n]),t?o.jsx(o.Fragment,{children:e}):null}export{zn as A,hn as B,wt as C,Ma as F,$a as G,Nr as I,fn as L,ma as N,La as P,Wn as R,Ne as S,Ge as T,xr as a,Ha as b,Pa as c,Aa as d,Mt as e,Ea as f,at as g,Un as h,qn as i,Cr as j,vr as k,Te as l,_e as m,Io as n,Re as o,fa as p,K as q,wn as r,Da as s,Ye as t,Xe as u,wr as v,qt as w,Ar as x,Ia as y,Sa as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as g,g as N,p as h,h as v,j as e,C as y,b as w,d as C,e as b,f as j,T as s,i as P,B as l,k,r as o,l as _,m as D,a as L,n as S,t as p,o as F,D as I,q as M,s as q,v as E,w as H,x as T,y as Q,L as R}from"./index-hJ5yiXvq.js";import{F as u,C as $,a as A,P as B,G,b as K}from"./ProtectedRoute-BZvfrfXZ.js";import{L as O}from"./label-gygRdIVO.js";const V=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],W=g("history",V),z=()=>N({queryKey:h.queryKey,queryFn:h.queryFn}),J=()=>{const{data:{projects:n}}=z(),{config:c}=v();return n.length,e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(t=>e.jsxs(y,{className:"hover:shadow-md transition-shadow",children:[e.jsxs(w,{children:[e.jsxs(C,{className:"flex items-center gap-2 justify-start items-start",children:[e.jsx(u,{className:"w-5 h-5 flex-shrink-0"}),e.jsx("span",{className:"text-wrap flex-1",children:t.meta.projectName??t.claudeProjectPath})]}),t.meta.projectPath?e.jsx(b,{children:t.meta.projectPath}):null]}),e.jsxs(j,{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx(s,{id:"project_list.last_modified"})," ",t.lastModifiedAt?P(t.lastModifiedAt,{locale:c.locale,target:"time"}):""]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx(s,{id:"project_list.messages"})," ",t.meta.sessionCount]})]}),e.jsx(j,{className:"pt-0",children:e.jsx(l,{asChild:!0,className:"w-full",children:e.jsx(k,{to:"/projects/$projectId/session",params:{projectId:t.id},children:e.jsx(s,{id:"project_list.view_conversations"})})})})]},t.id))})},U=({onPathChange:n})=>{const[c,t]=o.useState(void 0),[d,x]=o.useState(!1),{data:r,isLoading:i}=_(D(c,d));o.useEffect(()=>{r?.currentPath&&n(r.currentPath)},[r?.currentPath,n]);const m=a=>{if(a===""){t(void 0);return}const f=`/${a}`;t(f)};return e.jsxs("div",{className:"border rounded-md",children:[e.jsx("div",{className:"p-3 border-b bg-muted/50",children:e.jsxs("p",{className:"text-sm font-medium",children:[e.jsx(s,{id:"directory_picker.current"})," ",e.jsx("span",{className:"font-mono",children:r?.currentPath||"~"})]})}),e.jsxs("div",{className:"p-3 border-b flex items-center gap-2",children:[e.jsx($,{id:"show-hidden",checked:d,onCheckedChange:a=>x(a===!0)}),e.jsx(O,{htmlFor:"show-hidden",className:"text-sm cursor-pointer",children:e.jsx(s,{id:"directory_picker.show_hidden"})})]}),e.jsx("div",{className:"max-h-96 overflow-auto",children:i?e.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:e.jsx(s,{id:"directory_picker.loading"})}):r?.entries&&r.entries.length>0?e.jsx("div",{className:"divide-y",children:r.entries.filter(a=>a.type==="directory").filter(a=>d||a.name===".."||!a.name.startsWith(".")).map(a=>e.jsxs("button",{type:"button",onClick:()=>m(a.path),className:"w-full px-3 py-2 flex items-center gap-2 hover:bg-muted/50 transition-colors text-left",children:[a.name===".."?e.jsx(A,{className:"w-4 h-4 rotate-180"}):e.jsx(u,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm",children:a.name})]},a.path))}):e.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:e.jsx(s,{id:"directory_picker.no_directories"})})})]})},X=()=>{const[n,c]=o.useState(!1),[t,d]=o.useState(""),x=L(),r=S({mutationFn:async()=>{const i=await F.api.projects.$post({json:{projectPath:t}});if(!i.ok)throw new Error("Failed to set up project");return await i.json()},onSuccess:i=>{p.success("Project set up successfully"),c(!1),x({to:"/projects/$projectId/session",params:{projectId:i.projectId},search:m=>({...m,sessionId:i.sessionId})})},onError:i=>{p.error(i instanceof Error?i.message:"Failed to set up project")}});return e.jsxs(I,{open:n,onOpenChange:c,children:[e.jsx(M,{asChild:!0,children:e.jsxs(l,{"data-testid":"new-project-button",children:[e.jsx(B,{className:"w-4 h-4 mr-2"}),e.jsx(s,{id:"project.new"})]})}),e.jsxs(q,{className:"max-w-2xl","data-testid":"new-project-modal",children:[e.jsxs(E,{children:[e.jsx(H,{children:e.jsx(s,{id:"project.setup.title"})}),e.jsx(T,{children:e.jsx(s,{id:"project.setup.description",components:{0:e.jsx("code",{className:"text-sm bg-muted px-1 py-0.5 rounded"})}})})]}),e.jsx("div",{className:"py-4",children:e.jsx(U,{onPathChange:d})}),e.jsxs(Q,{children:[e.jsx(l,{variant:"outline",onClick:()=>c(!1),children:e.jsx(s,{id:"common.action.cancel"})}),e.jsx(l,{onClick:async()=>await r.mutateAsync(),disabled:!t||r.isPending,children:r.isPending?e.jsxs(e.Fragment,{children:[e.jsx(R,{className:"w-4 h-4 mr-2 animate-spin"}),e.jsx(s,{id:"project.setup.action.setting_up"})]}):e.jsx(s,{id:"project.setup.action.setup"})})]})]})]})},Y=()=>e.jsxs("div",{className:"flex h-screen max-h-screen overflow-hidden",children:[e.jsx(G,{}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"container mx-auto px-4 py-8",children:[e.jsxs("header",{className:"mb-8",children:[e.jsxs("h1",{className:"text-3xl font-bold mb-2 flex items-center gap-2",children:[e.jsx(W,{className:"w-8 h-8"}),"Claude Code Viewer"]}),e.jsx("p",{className:"text-muted-foreground",children:e.jsx(s,{id:"projects.page.description"})})]}),e.jsx("main",{children:e.jsxs("section",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"text-xl font-semibold",children:e.jsx(s,{id:"projects.page.title"})}),e.jsx(X,{})]}),e.jsx(o.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"text-muted-foreground",children:e.jsx(s,{id:"projects.page.loading"})})}),children:e.jsx(J,{})})]})})]})})]});function te(){return e.jsx(K,{children:e.jsx(Y,{})})}export{te as component};
|