blade-code 0.10.94 → 0.10.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blade.js +2 -2
- package/dist/{chunk-nahy2t67.js → chunk-09ya3a21.js} +1 -1
- package/dist/{chunk-fts2cp88.js → chunk-2f0wn3ne.js} +1 -1
- package/dist/{chunk-v5c34zya.js → chunk-2ge1zqts.js} +1 -1
- package/dist/{chunk-5hh577nr.js → chunk-2zzc7g29.js} +1 -1
- package/dist/{chunk-wxm2zjs9.js → chunk-3aayczyy.js} +1 -1
- package/dist/{chunk-0z3c8p6d.js → chunk-4fmyjf1x.js} +1 -1
- package/dist/chunk-4hb71f98.js +1 -0
- package/dist/{chunk-pkcvxa1z.js → chunk-4p69xraf.js} +1 -1
- package/dist/{chunk-zgd524h0.js → chunk-4smdhn1h.js} +1 -1
- package/dist/{chunk-kfmpnq2r.js → chunk-871g570t.js} +255 -255
- package/dist/{chunk-088bnp26.js → chunk-8pvsw4gw.js} +1 -1
- package/dist/{chunk-0ytp28pf.js → chunk-bd4nqrtm.js} +1 -1
- package/dist/{chunk-b5bwg47r.js → chunk-bxtqcgvs.js} +1 -1
- package/dist/{chunk-vnnxvpnn.js → chunk-cbafxem4.js} +1 -1
- package/dist/{chunk-076txzms.js → chunk-cnnht4m3.js} +1 -1
- package/dist/{chunk-kp6cjt82.js → chunk-cvybf60x.js} +1 -1
- package/dist/{chunk-xdvjwtfc.js → chunk-e5ht9d18.js} +1 -1
- package/dist/{chunk-reb25993.js → chunk-eqbcxa12.js} +1 -1
- package/dist/{chunk-rvpveaf3.js → chunk-es4evt6m.js} +1 -1
- package/dist/{chunk-73hasjfg.js → chunk-esstp9h0.js} +2 -2
- package/dist/{chunk-216xzne9.js → chunk-f66cptes.js} +1 -1
- package/dist/chunk-gnzcz6e1.js +1 -0
- package/dist/{chunk-gzv143jr.js → chunk-h2a3edj4.js} +1 -1
- package/dist/{chunk-8488pkzv.js → chunk-hajer580.js} +1 -1
- package/dist/{chunk-4rw9kt3s.js → chunk-hfd00skc.js} +1 -1
- package/dist/{chunk-bbvw06fr.js → chunk-hqb6qxzj.js} +1 -1
- package/dist/{chunk-939sa81a.js → chunk-hrpqz2jv.js} +1 -1
- package/dist/{chunk-zd410m70.js → chunk-ktt7vmqz.js} +1 -1
- package/dist/{chunk-k40dje0b.js → chunk-qp165b79.js} +1 -1
- package/dist/{chunk-7cx577bv.js → chunk-rjw8pj7t.js} +1 -1
- package/dist/{chunk-0538yd6h.js → chunk-rrav5aea.js} +1 -1
- package/dist/chunk-s2erwc49.js +8 -0
- package/dist/{chunk-5qanqw0d.js → chunk-sckqp0t9.js} +1 -1
- package/dist/{chunk-cd2xwddv.js → chunk-vt99w0vh.js} +1 -1
- package/dist/{chunk-zkxszt12.js → chunk-vxwqsmqg.js} +1 -1
- package/dist/{chunk-k8c48qxn.js → chunk-wwzc3ryj.js} +1 -1
- package/dist/{chunk-11fmyrjt.js → chunk-xm8w4jaa.js} +1 -1
- package/dist/web/assets/{ChatView-DacNycYI.js → ChatView-CpKiglLV.js} +7 -7
- package/dist/web/assets/{CodeBlockHighlighter-CevKBV7g.js → CodeBlockHighlighter-BzmHeWKU.js} +1 -1
- package/dist/web/assets/FilePreview-uShTCL2_.js +59 -0
- package/dist/web/assets/{KanbanBoard-C9620zMQ.js → KanbanBoard-CnZoKZFy.js} +2 -2
- package/dist/web/assets/{MarkdownRenderer-DR0tbtqc.js → MarkdownRenderer-CxcqGo57.js} +3 -3
- package/dist/web/assets/{SettingsModal-C_TpGMs0.js → SettingsModal-Bu5uH8ic.js} +2 -2
- package/dist/web/assets/{TaskSwitcher-CGWELaxg.js → TaskSwitcher-BDwk7i6w.js} +6 -6
- package/dist/web/assets/{TerminalPanel-DPxm68h1.js → TerminalPanel-PiLhnW-8.js} +2 -2
- package/dist/web/assets/{arrow-left-n3ENbaSb.js → arrow-left-B7RwOx8T.js} +1 -1
- package/dist/web/assets/{calendar-clock-C2E8mlWS.js → calendar-clock-BeSXiMFw.js} +1 -1
- package/dist/web/assets/{chevrons-up-down-DgOF3xz6.js → chevrons-up-down-DuC8PppK.js} +1 -1
- package/dist/web/assets/{clock-3-D9h1svFg.js → clock-3-lYrt_Amt.js} +1 -1
- package/dist/web/assets/{external-link-kvylbcSF.js → external-link-BTHyQJWk.js} +1 -1
- package/dist/web/assets/{folder-C_KPQmg6.js → folder-CX6zAF9w.js} +1 -1
- package/dist/web/assets/{index-DI8ZWdWH.js → index-B5mUEr6D.js} +3 -3
- package/dist/web/assets/{index-D11FYWsc.js → index-FdbcPJSj.js} +56 -56
- package/dist/web/assets/index-zY4JU9fd.css +1 -0
- package/dist/web/assets/{pause-hCE9Bvm9.js → pause-qlDcCjBJ.js} +1 -1
- package/dist/web/assets/{play-BpCmIsMH.js → play-BGPTTFWa.js} +1 -1
- package/dist/web/assets/session-events-Ci1823tS.js +22 -0
- package/dist/web/assets/{teamService-7LNlaq8e.js → teamService-Bk8B4hZp.js} +1 -1
- package/dist/web/assets/{vendor-radix-DXRuAJHH.js → vendor-radix-Bc1_Q9tz.js} +1 -1
- package/dist/web/assets/{vendor-react-DG5dkZ_t.js → vendor-react-DofNRwfy.js} +1 -1
- package/dist/web/index.html +5 -5
- package/package.json +1 -1
- package/dist/chunk-fc7dbcad.js +0 -1
- package/dist/chunk-h9ww5k16.js +0 -1
- package/dist/chunk-k3crvmvt.js +0 -8
- package/dist/web/assets/FilePreview-DiS4nCrp.js +0 -54
- package/dist/web/assets/index-C8M-7zAh.css +0 -1
- package/dist/web/assets/session-events-qDVUI3Ca.js +0 -22
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/teamService-
|
|
2
|
-
import{r as y,j as a,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/teamService-Bk8B4hZp.js","assets/vendor-react-DofNRwfy.js","assets/vendor-radix-Bc1_Q9tz.js","assets/session-events-Ci1823tS.js","assets/SettingsModal-Bu5uH8ic.js","assets/external-link-BTHyQJWk.js","assets/calendar-clock-BeSXiMFw.js","assets/play-BGPTTFWa.js","assets/team-QZ9byb3E.js","assets/arrow-left-B7RwOx8T.js","assets/TaskSwitcher-BDwk7i6w.js","assets/folder-CX6zAF9w.js","assets/clock-3-lYrt_Amt.js","assets/FilePreview-uShTCL2_.js","assets/chevrons-up-down-DuC8PppK.js","assets/TerminalPanel-PiLhnW-8.js","assets/vendor-xterm-DuYZoU4T.js","assets/vendor-xterm-9CEnUXvW.css","assets/ChatView-CpKiglLV.js","assets/pause-qlDcCjBJ.js","assets/KanbanBoard-CnZoKZFy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as y,j as a,d as P0,R as N0}from"./vendor-react-DofNRwfy.js";import{S as O0,O as gp,P as R0,C as bp,a as M0,T as kp,D as xp,R as $0,b as yp,V as F0,c as L0,d as wp,e as D0,f as _0,g as vp,h as U0,i as B0}from"./vendor-radix-Bc1_Q9tz.js";import{c as Wn,g as H0,w as au,u as q0,a as z0,b as K0,d as cu,e as Qo,f as wo,h as lu,i as Ka,t as Sp,j as G0,k as V0,l as sn}from"./session-events-Ci1823tS.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const W0="modulepreload",J0=function(e){return"/"+e},du={},es=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),d=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(f=>{if(f=J0(f),f in du)return;du[f]=!0;const u=f.endsWith(".css"),m=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":W0,u||(p.as="script"),p.crossOrigin="",p.href=f,d&&p.setAttribute("nonce",d),document.head.appendChild(p),u)return new Promise((h,b)=>{p.addEventListener("load",h),p.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function i(o){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=o,window.dispatchEvent(d),!d.defaultPrevented)throw o}return s.then(o=>{for(const d of o||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};/**
|
|
3
3
|
* @license lucide-react v0.300.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/var
|
|
7
|
+
*/var Q0={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
8
8
|
* @license lucide-react v0.300.0 - ISC
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/const
|
|
12
|
+
*/const Y0=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),se=(e,t)=>{const n=y.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:d="",children:f,...u},m)=>y.createElement("svg",{ref:m,...Q0,width:s,height:s,stroke:r,strokeWidth:o?Number(i)*24/Number(s):i,className:["lucide",`lucide-${Y0(e)}`,d].join(" "),...u},[...t.map(([p,h])=>y.createElement(p,h)),...Array.isArray(f)?f:[f]]));return n.displayName=`${e}`,n};/**
|
|
13
13
|
* @license lucide-react v0.300.0 - ISC
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|
|
@@ -19,37 +19,37 @@ import{r as y,j as a,c as ai,d as L0}from"./vendor-react-DG5dkZ_t.js";import{S a
|
|
|
19
19
|
*
|
|
20
20
|
* This source code is licensed under the ISC license.
|
|
21
21
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/const
|
|
22
|
+
*/const Z0=se("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
|
|
23
23
|
* @license lucide-react v0.300.0 - ISC
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const
|
|
27
|
+
*/const jp=se("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
28
28
|
* @license lucide-react v0.300.0 - ISC
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the ISC license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const
|
|
32
|
+
*/const X0=se("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
33
33
|
* @license lucide-react v0.300.0 - ISC
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the ISC license.
|
|
36
36
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const
|
|
37
|
+
*/const uu=se("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
38
38
|
* @license lucide-react v0.300.0 - ISC
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the ISC license.
|
|
41
41
|
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const
|
|
42
|
+
*/const ey=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/**
|
|
43
43
|
* @license lucide-react v0.300.0 - ISC
|
|
44
44
|
*
|
|
45
45
|
* This source code is licensed under the ISC license.
|
|
46
46
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const
|
|
47
|
+
*/const pu=se("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
48
48
|
* @license lucide-react v0.300.0 - ISC
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the ISC license.
|
|
51
51
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const
|
|
52
|
+
*/const Ip=se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
53
53
|
* @license lucide-react v0.300.0 - ISC
|
|
54
54
|
*
|
|
55
55
|
* This source code is licensed under the ISC license.
|
|
@@ -59,97 +59,97 @@ import{r as y,j as a,c as ai,d as L0}from"./vendor-react-DG5dkZ_t.js";import{S a
|
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const
|
|
62
|
+
*/const ty=se("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
63
63
|
* @license lucide-react v0.300.0 - ISC
|
|
64
64
|
*
|
|
65
65
|
* This source code is licensed under the ISC license.
|
|
66
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const
|
|
67
|
+
*/const ny=se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
68
68
|
* @license lucide-react v0.300.0 - ISC
|
|
69
69
|
*
|
|
70
70
|
* This source code is licensed under the ISC license.
|
|
71
71
|
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const
|
|
72
|
+
*/const ry=se("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
73
73
|
* @license lucide-react v0.300.0 - ISC
|
|
74
74
|
*
|
|
75
75
|
* This source code is licensed under the ISC license.
|
|
76
76
|
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const
|
|
77
|
+
*/const Cp=se("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
|
|
78
78
|
* @license lucide-react v0.300.0 - ISC
|
|
79
79
|
*
|
|
80
80
|
* This source code is licensed under the ISC license.
|
|
81
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const
|
|
82
|
+
*/const Ep=se("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
83
83
|
* @license lucide-react v0.300.0 - ISC
|
|
84
84
|
*
|
|
85
85
|
* This source code is licensed under the ISC license.
|
|
86
86
|
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const
|
|
87
|
+
*/const sy=se("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4",key:"702lig"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}]]);/**
|
|
88
88
|
* @license lucide-react v0.300.0 - ISC
|
|
89
89
|
*
|
|
90
90
|
* This source code is licensed under the ISC license.
|
|
91
91
|
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const
|
|
92
|
+
*/const fu=se("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
|
|
93
93
|
* @license lucide-react v0.300.0 - ISC
|
|
94
94
|
*
|
|
95
95
|
* This source code is licensed under the ISC license.
|
|
96
96
|
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const
|
|
97
|
+
*/const li=se("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
|
|
98
98
|
* @license lucide-react v0.300.0 - ISC
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the ISC license.
|
|
101
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const
|
|
102
|
+
*/const iy=se("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
103
103
|
* @license lucide-react v0.300.0 - ISC
|
|
104
104
|
*
|
|
105
105
|
* This source code is licensed under the ISC license.
|
|
106
106
|
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const
|
|
107
|
+
*/const Ro=se("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]]);/**
|
|
108
108
|
* @license lucide-react v0.300.0 - ISC
|
|
109
109
|
*
|
|
110
110
|
* This source code is licensed under the ISC license.
|
|
111
111
|
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const
|
|
112
|
+
*/const qc=se("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
113
113
|
* @license lucide-react v0.300.0 - ISC
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const
|
|
117
|
+
*/const oy=se("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
118
118
|
* @license lucide-react v0.300.0 - ISC
|
|
119
119
|
*
|
|
120
120
|
* This source code is licensed under the ISC license.
|
|
121
121
|
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const
|
|
122
|
+
*/const ay=se("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
123
123
|
* @license lucide-react v0.300.0 - ISC
|
|
124
124
|
*
|
|
125
125
|
* This source code is licensed under the ISC license.
|
|
126
126
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const
|
|
127
|
+
*/const cy=se("Hammer",[["path",{d:"m15 12-8.5 8.5c-.83.83-2.17.83-3 0 0 0 0 0 0 0a2.12 2.12 0 0 1 0-3L12 9",key:"1afvon"}],["path",{d:"M17.64 15 22 10.64",key:"zsji6s"}],["path",{d:"m20.91 11.7-1.25-1.25c-.6-.6-.93-1.4-.93-2.25v-.86L16.01 4.6a5.56 5.56 0 0 0-3.94-1.64H9l.92.82A6.18 6.18 0 0 1 12 8.4v1.56l2 2h2.47l2.26 1.91",key:"lehyy1"}]]);/**
|
|
128
128
|
* @license lucide-react v0.300.0 - ISC
|
|
129
129
|
*
|
|
130
130
|
* This source code is licensed under the ISC license.
|
|
131
131
|
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const
|
|
132
|
+
*/const ly=se("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v0",key:"aigmz7"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v2",key:"1n6bmn"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2v0a2 2 0 0 0-2 2v8",key:"a9iiix"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
|
|
133
133
|
* @license lucide-react v0.300.0 - ISC
|
|
134
134
|
*
|
|
135
135
|
* This source code is licensed under the ISC license.
|
|
136
136
|
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const
|
|
137
|
+
*/const dy=se("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
138
138
|
* @license lucide-react v0.300.0 - ISC
|
|
139
139
|
*
|
|
140
140
|
* This source code is licensed under the ISC license.
|
|
141
141
|
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const
|
|
142
|
+
*/const mu=se("History",[["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"}]]);/**
|
|
143
143
|
* @license lucide-react v0.300.0 - ISC
|
|
144
144
|
*
|
|
145
145
|
* This source code is licensed under the ISC license.
|
|
146
146
|
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const
|
|
147
|
+
*/const uy=se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
148
148
|
* @license lucide-react v0.300.0 - ISC
|
|
149
149
|
*
|
|
150
150
|
* This source code is licensed under the ISC license.
|
|
151
151
|
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const
|
|
152
|
+
*/const Tp=se("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
153
153
|
* @license lucide-react v0.300.0 - ISC
|
|
154
154
|
*
|
|
155
155
|
* This source code is licensed under the ISC license.
|
|
@@ -159,113 +159,113 @@ import{r as y,j as a,c as ai,d as L0}from"./vendor-react-DG5dkZ_t.js";import{S a
|
|
|
159
159
|
*
|
|
160
160
|
* This source code is licensed under the ISC license.
|
|
161
161
|
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const
|
|
162
|
+
*/const py=se("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
163
163
|
* @license lucide-react v0.300.0 - ISC
|
|
164
164
|
*
|
|
165
165
|
* This source code is licensed under the ISC license.
|
|
166
166
|
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const
|
|
167
|
+
*/const fy=se("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
168
168
|
* @license lucide-react v0.300.0 - ISC
|
|
169
169
|
*
|
|
170
170
|
* This source code is licensed under the ISC license.
|
|
171
171
|
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const
|
|
172
|
+
*/const my=se("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
173
173
|
* @license lucide-react v0.300.0 - ISC
|
|
174
174
|
*
|
|
175
175
|
* This source code is licensed under the ISC license.
|
|
176
176
|
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const
|
|
177
|
+
*/const hu=se("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
|
|
178
178
|
* @license lucide-react v0.300.0 - ISC
|
|
179
179
|
*
|
|
180
180
|
* This source code is licensed under the ISC license.
|
|
181
181
|
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const
|
|
182
|
+
*/const hy=se("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
183
183
|
* @license lucide-react v0.300.0 - ISC
|
|
184
184
|
*
|
|
185
185
|
* This source code is licensed under the ISC license.
|
|
186
186
|
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const
|
|
187
|
+
*/const zc=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
188
188
|
* @license lucide-react v0.300.0 - ISC
|
|
189
189
|
*
|
|
190
190
|
* This source code is licensed under the ISC license.
|
|
191
191
|
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const
|
|
192
|
+
*/const di=se("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
193
193
|
* @license lucide-react v0.300.0 - ISC
|
|
194
194
|
*
|
|
195
195
|
* This source code is licensed under the ISC license.
|
|
196
196
|
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/const
|
|
197
|
+
*/const Yo=se("RotateCcw",[["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"}]]);/**
|
|
198
198
|
* @license lucide-react v0.300.0 - ISC
|
|
199
199
|
*
|
|
200
200
|
* This source code is licensed under the ISC license.
|
|
201
201
|
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/const
|
|
202
|
+
*/const gy=se("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
|
|
203
203
|
* @license lucide-react v0.300.0 - ISC
|
|
204
204
|
*
|
|
205
205
|
* This source code is licensed under the ISC license.
|
|
206
206
|
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/const
|
|
207
|
+
*/const Kc=se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
208
208
|
* @license lucide-react v0.300.0 - ISC
|
|
209
209
|
*
|
|
210
210
|
* This source code is licensed under the ISC license.
|
|
211
211
|
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/const
|
|
212
|
+
*/const by=se("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
213
213
|
* @license lucide-react v0.300.0 - ISC
|
|
214
214
|
*
|
|
215
215
|
* This source code is licensed under the ISC license.
|
|
216
216
|
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/const
|
|
217
|
+
*/const Ap=se("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
218
218
|
* @license lucide-react v0.300.0 - ISC
|
|
219
219
|
*
|
|
220
220
|
* This source code is licensed under the ISC license.
|
|
221
221
|
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/const
|
|
222
|
+
*/const Pp=se("ShieldAlert",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
223
223
|
* @license lucide-react v0.300.0 - ISC
|
|
224
224
|
*
|
|
225
225
|
* This source code is licensed under the ISC license.
|
|
226
226
|
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/const
|
|
227
|
+
*/const ky=se("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
228
228
|
* @license lucide-react v0.300.0 - ISC
|
|
229
229
|
*
|
|
230
230
|
* This source code is licensed under the ISC license.
|
|
231
231
|
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/const
|
|
232
|
+
*/const Np=se("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
|
233
233
|
* @license lucide-react v0.300.0 - ISC
|
|
234
234
|
*
|
|
235
235
|
* This source code is licensed under the ISC license.
|
|
236
236
|
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/const
|
|
237
|
+
*/const Gc=se("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
238
238
|
* @license lucide-react v0.300.0 - ISC
|
|
239
239
|
*
|
|
240
240
|
* This source code is licensed under the ISC license.
|
|
241
241
|
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const
|
|
242
|
+
*/const Op=se("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
243
243
|
* @license lucide-react v0.300.0 - ISC
|
|
244
244
|
*
|
|
245
245
|
* This source code is licensed under the ISC license.
|
|
246
246
|
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/const
|
|
247
|
+
*/const Rp=se("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
248
248
|
* @license lucide-react v0.300.0 - ISC
|
|
249
249
|
*
|
|
250
250
|
* This source code is licensed under the ISC license.
|
|
251
251
|
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/const
|
|
252
|
+
*/const gu=se("WifiOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 4.17-2.65",key:"11utq1"}],["path",{d:"M10.66 5c4.01-.36 8.14.9 11.34 3.76",key:"hxefdu"}],["path",{d:"M16.85 11.25a10 10 0 0 1 2.22 1.68",key:"q734kn"}],["path",{d:"M5 13a10 10 0 0 1 5.24-2.76",key:"piq4yl"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
|
|
253
253
|
* @license lucide-react v0.300.0 - ISC
|
|
254
254
|
*
|
|
255
255
|
* This source code is licensed under the ISC license.
|
|
256
256
|
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/const
|
|
257
|
+
*/const xy=se("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
258
258
|
* @license lucide-react v0.300.0 - ISC
|
|
259
259
|
*
|
|
260
260
|
* This source code is licensed under the ISC license.
|
|
261
261
|
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/const pi=se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Dp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Dp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _p(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Dp(e))&&(r&&(r+=" "),r+=t);return r}const xu=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yu=_p,Cy=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yu(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(u=>{const m=n==null?void 0:n[u],p=i==null?void 0:i[u];if(m===null)return null;const h=xu(m)||xu(p);return s[u][h]}),d=n&&Object.entries(n).reduce((u,m)=>{let[p,h]=m;return h===void 0||(u[p]=h),u},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,m)=>{let{class:p,className:h,...b}=m;return Object.entries(b).every(k=>{let[S,C]=k;return Array.isArray(C)?C.includes({...i,...d}[S]):{...i,...d}[S]===C})?[...u,p,h]:u},[]);return yu(e,o,f,n==null?void 0:n.class,n==null?void 0:n.className)},Jc="-",Ey=e=>{const t=Ay(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const d=o.split(Jc);return d[0]===""&&d.length!==1&&d.shift(),Up(d,t)||Ty(o)},getConflictingClassGroupIds:(o,d)=>{const f=n[o]||[];return d&&r[o]?[...f,...r[o]]:f}}},Up=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Up(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Jc);return(o=t.validators.find(({validator:d})=>d(i)))==null?void 0:o.classGroupId},wu=/^\[(.+)\]$/,Ty=e=>{if(wu.test(e)){const t=wu.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ay=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Ny(Object.entries(e.classGroups),n).forEach(([i,o])=>{uc(o,r,i,t)}),r},uc=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:vu(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(Py(s)){uc(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{uc(o,vu(t,i),n,r)})})},vu=(e,t)=>{let n=e;return t.split(Jc).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Py=e=>e.isThemeGetter,Ny=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,d])=>[t+o,d])):i);return[n,s]}):e,Oy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},Bp="!",Ry=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=d=>{const f=[];let u=0,m=0,p;for(let C=0;C<d.length;C++){let x=d[C];if(u===0){if(x===s&&(r||d.slice(C,C+i)===t)){f.push(d.slice(m,C)),m=C+i;continue}if(x==="/"){p=C;continue}}x==="["?u++:x==="]"&&u--}const h=f.length===0?d:d.substring(m),b=h.startsWith(Bp),k=b?h.substring(1):h,S=p&&p>m?p-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:S}};return n?d=>n({className:d,parseClassName:o}):o},My=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},$y=e=>({cache:Oy(e.cacheSize),parseClassName:Ry(e),...Ey(e)}),Fy=/\s+/,Ly=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(Fy);let d="";for(let f=o.length-1;f>=0;f-=1){const u=o[f],{modifiers:m,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:b}=n(u);let k=!!b,S=r(k?h.substring(0,b):h);if(!S){if(!k){d=u+(d.length>0?" "+d:d);continue}if(S=r(h),!S){d=u+(d.length>0?" "+d:d);continue}k=!1}const C=My(m).join(":"),x=p?C+Bp:C,N=x+S;if(i.includes(N))continue;i.push(N);const P=s(S,k);for(let L=0;L<P.length;++L){const D=P[L];i.push(x+D)}d=u+(d.length>0?" "+d:d)}return d};function Dy(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Hp(t))&&(r&&(r+=" "),r+=n);return r}const Hp=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Hp(e[r]))&&(n&&(n+=" "),n+=t);return n};function _y(e,...t){let n,r,s,i=o;function o(f){const u=t.reduce((m,p)=>p(m),e());return n=$y(u),r=n.cache.get,s=n.cache.set,i=d,d(f)}function d(f){const u=r(f);if(u)return u;const m=Ly(f,n);return s(f,m),m}return function(){return i(Dy.apply(null,arguments))}}const Ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},qp=/^\[(?:([a-z-]+):)?(.+)\]$/i,Uy=/^\d+\/\d+$/,By=new Set(["px","full","screen"]),Hy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qy=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ky=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jn=e=>As(e)||By.has(e)||Uy.test(e),hr=e=>Os(e,"length",ew),As=e=>!!e&&!Number.isNaN(Number(e)),Va=e=>Os(e,"number",As),ri=e=>!!e&&Number.isInteger(Number(e)),Vy=e=>e.endsWith("%")&&As(e.slice(0,-1)),me=e=>qp.test(e),gr=e=>Hy.test(e),Wy=new Set(["length","size","percentage"]),Jy=e=>Os(e,Wy,zp),Qy=e=>Os(e,"position",zp),Yy=new Set(["image","url"]),Zy=e=>Os(e,Yy,nw),Xy=e=>Os(e,"",tw),si=()=>!0,Os=(e,t,n)=>{const r=qp.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},ew=e=>qy.test(e)&&!zy.test(e),zp=()=>!1,tw=e=>Ky.test(e),nw=e=>Gy.test(e),rw=()=>{const e=Ye("colors"),t=Ye("spacing"),n=Ye("blur"),r=Ye("brightness"),s=Ye("borderColor"),i=Ye("borderRadius"),o=Ye("borderSpacing"),d=Ye("borderWidth"),f=Ye("contrast"),u=Ye("grayscale"),m=Ye("hueRotate"),p=Ye("invert"),h=Ye("gap"),b=Ye("gradientColorStops"),k=Ye("gradientColorStopPositions"),S=Ye("inset"),C=Ye("margin"),x=Ye("opacity"),N=Ye("padding"),P=Ye("saturate"),L=Ye("scale"),D=Ye("sepia"),j=Ye("skew"),I=Ye("space"),T=Ye("translate"),M=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",me,t],O=()=>[me,t],J=()=>["",Jn,hr],ae=()=>["auto",As,me],ce=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],de=()=>["","0",me],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>[As,me];return{cacheSize:500,separator:":",theme:{colors:[si],spacing:[Jn,hr],blur:["none","",gr,me],brightness:ue(),borderColor:[e],borderRadius:["none","","full",gr,me],borderSpacing:O(),borderWidth:J(),contrast:ue(),grayscale:de(),hueRotate:ue(),invert:de(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[Vy,hr],inset:te(),margin:te(),opacity:ue(),padding:O(),saturate:ue(),scale:ue(),sepia:de(),skew:ue(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[gr]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ce(),me]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ri,me]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:de()}],shrink:[{shrink:de()}],order:[{order:["first","last","none",ri,me]}],"grid-cols":[{"grid-cols":[si]}],"col-start-end":[{col:["auto",{span:["full",ri,me]},me]}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":[si]}],"row-start-end":[{row:["auto",{span:[ri,me]},me]}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,t]}],"min-w":[{"min-w":[me,t,"min","max","fit"]}],"max-w":[{"max-w":[me,t,"none","full","min","max","fit","prose",{screen:[gr]},gr]}],h:[{h:[me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",gr,hr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Va]}],"font-family":[{font:[si]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",me]}],"line-clamp":[{"line-clamp":["none",As,Va]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jn,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jn,hr]}],"underline-offset":[{"underline-offset":["auto",Jn,me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ce(),Qy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Zy]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[k]}],"gradient-via-pos":[{via:[k]}],"gradient-to-pos":[{to:[k]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...le(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:le()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[Jn,me]}],"outline-w":[{outline:[Jn,hr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Jn,hr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",gr,Xy]}],"shadow-color":[{shadow:[si]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",gr,me]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[P]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[P]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:ue()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:ue()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[ri,me]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Jn,hr,Va]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},sw=_y(rw);function W(...e){return sw(_p(e))}const iw=Cy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Kr=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?D0:"button";return a.jsx(o,{className:W(iw({variant:t,size:n,className:e})),ref:i,...s})});Kr.displayName="Button";const Qc=B0,ow=_0,Kp=y.forwardRef(({className:e,...t},n)=>a.jsx(yp,{ref:n,className:W("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Kp.displayName=yp.displayName;const Xo=y.forwardRef(({className:e,children:t,hideCloseButton:n,...r},s)=>a.jsxs(ow,{children:[a.jsx(Kp,{}),a.jsxs(wp,{ref:s,"aria-modal":"true",className:W("fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100dvh-24px)] w-[calc(100vw-24px)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,!n&&a.jsxs(U0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(pi,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xo.displayName=wp.displayName;const Yc=({className:e,...t})=>a.jsx("div",{className:W("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Yc.displayName="DialogHeader";const Gp=({className:e,...t})=>a.jsx("div",{className:W("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Gp.displayName="DialogFooter";const ea=y.forwardRef(({className:e,...t},n)=>a.jsx(vp,{ref:n,className:W("text-lg font-semibold leading-none tracking-tight",e),...t}));ea.displayName=vp.displayName;const ta=y.forwardRef(({className:e,...t},n)=>a.jsx(Sp,{ref:n,className:W("text-sm text-muted-foreground",e),...t}));ta.displayName=Sp.displayName;const aw={"app.restoring":"Restoring workspace…","layout.workspace.pathAria":"Workspace path","layout.workspace.empty":"No workspace","layout.action.rewind":"Rewind session","layout.action.openNavigation":"Open navigation","terminal.title":"Terminal","terminal.status.connected":"Terminal connected","terminal.status.disconnected":"Terminal disconnected","terminal.action.minimize":"Minimize terminal","terminal.action.restore":"Restore terminal","terminal.action.close":"Close terminal","sidebar.brand.badge":"WEB","sidebar.action.collapse":"Collapse sidebar","sidebar.action.expand":"Expand sidebar","sidebar.navigationAria":"Task navigation","sidebar.action.newTask":"New Task","sidebar.action.newTaskShort":"New task","sidebar.action.taskBoard":"Task board","sidebar.action.terminal":"Terminal","sidebar.action.terminalToggle":"Toggle terminal","sidebar.action.searchTasks":"Search tasks","sidebar.unreadTasks":"{count} unread tasks","sidebar.section.skills":"Skills","sidebar.section.mcp":"MCP","sidebar.section.settings":"Settings","sidebar.status.user":"User","sidebar.status.feedLive":"Task feed live","sidebar.status.feedOffline":"Task feed offline","sidebar.empty.title":"No tasks yet","sidebar.empty.hint":"Dispatch one from the home view","sidebar.group.running":"RUNNING","sidebar.group.queued":"QUEUED","sidebar.group.interrupted":"INTERRUPTED","sidebar.group.failed":"FAILED","sidebar.group.cancelled":"CANCELLED","sidebar.group.done":"DONE","sidebar.group.showMore":"Show {count} more","sidebar.group.showLess":"Show less","sidebar.view.project":"Projects","sidebar.view.status":"Status","sidebar.view.projectAria":"Group sessions by project","sidebar.view.statusAria":"Group sessions by status","sidebar.project.active":"active","sidebar.project.expand":"Expand {name}","sidebar.project.collapse":"Collapse {name}","sidebar.project.newTask":"New task in {name}","sidebar.project.reorder":"Reorder {name}, position {position} of {count}","sidebar.project.reorderHint":"Drag to reorder, or use Up and Down arrow keys","sidebar.project.reordered":"Moved {name} to position {position}","sidebar.project.projects":"Projects","sidebar.catalog.syncing":"Syncing task history…","sidebar.catalog.loaded":"{count} loaded","sidebar.catalog.incomplete":"Task history is incomplete","sidebar.catalog.retry":"Retry","projects.dialog.title":"Projects","projects.dialog.description":"Bind local folders to switch task context without restarting Blade.","projects.bind.placeholder":"/absolute/path/to/project","projects.bind.pathLabel":"Project path","projects.bind.action":"Bind","projects.bind.failed":"Failed to bind project","projects.pick.action":"Choose project folder","projects.pick.actionShort":"Choose","projects.pick.picking":"Choosing…","projects.pick.failed":"Failed to choose a project folder","projects.unbind.action":"Unbind project","projects.unavailable":"unavailable","sidebar.language.label":"Language","sidebar.language.aria":"Switch language","sidebar.language.en":"EN","sidebar.language.zh":"中","session.env.worktree":"worktree","session.env.local":"local","session.action.select":"Select {title}","session.action.save":"Save {title}","session.action.cancel":"Cancel {title}","session.action.more":"More actions for {title}","session.action.fork":"Fork {title}","session.action.forkShort":"Fork","session.action.rename":"Rename {title}","session.action.renameShort":"Rename","session.action.archive":"Archive {title}","session.action.archiveShort":"Archive","session.action.export":"Export {title} as Markdown","session.action.exportShort":"Export Markdown","session.action.exportingShort":"Exporting…","session.action.delete":"Delete {title}","session.action.deleteShort":"Delete","session.action.stop":"Stop {title}","session.action.stopping":"Stopping {title}","session.action.retry":"Retry {title}","session.action.retrying":"Retrying {title}","session.reason.cancelledByUser":"Cancelled by user","session.title.codeReview":"Code Review","session.forkedFrom":"Forked from","session.retriedFrom":"Retried from","session.retryShort":"retry","session.queued":"#{position}/{depth} queued","archive.title":"Archive","archive.subtitle":"Stored safely outside the active task list","archive.open":"Open session archive","archive.refresh":"Refresh archived sessions","archive.retry":"Retry","archive.loading":"Loading archive…","archive.empty":"No archived sessions","archive.restore":"Restore {title}","archive.restoreShort":"Restore","archive.restoreAncestor":"Restore the archive root first","archive.inherited":"Archived with {id}","taskSwitcher.title":"Task switcher","taskSwitcher.description":"Search and open tasks across every project.","taskSwitcher.searchAria":"Search tasks","taskSwitcher.placeholder":"Search title, project, branch, status, or session ID…","taskSwitcher.results":"{count} results","taskSwitcher.recent":"Recent tasks","taskSwitcher.scope":"{count} tasks indexed","taskSwitcher.indexing":"Indexing tasks…","taskSwitcher.resultsAria":"Task search results","taskSwitcher.current":"Current","taskSwitcher.unread":"{count} unread","taskSwitcher.needsAction":"{count} need action","taskSwitcher.new":"New","taskSwitcher.empty":"No matching tasks","taskSwitcher.emptyHint":"Try a project, branch, status, or shorter phrase.","taskSwitcher.hint.navigate":"navigate","taskSwitcher.hint.open":"open","taskSwitcher.hint.toggle":"toggle","taskSwitcher.action.failed":"Task action failed","commandCenter.title":"Command center","commandCenter.description":"Search tasks or run workspace and application actions.","commandCenter.searchAria":"Search actions","commandCenter.placeholder":"Search actions, settings, or tools…","commandCenter.modeAria":"Command center mode","commandCenter.mode.tasks":"Tasks","commandCenter.mode.commands":"Actions","commandCenter.actions":"{count} actions","commandCenter.resultsAria":"Action search results","commandCenter.empty":"No matching actions","commandCenter.emptyHint":"Try a tool, panel, or setting name.","commandCenter.action.newTask":"New task","commandCenter.action.newTaskDescription":"Open a clean task composer","commandCenter.action.preview":"Toggle preview","commandCenter.action.previewDescription":"Review files, diffs, run logs, and web pages","commandCenter.action.terminal":"Toggle terminal","commandCenter.action.terminalDescription":"Open or close the workspace shell","commandCenter.action.settings":"Open settings","commandCenter.action.settingsDescription":"Configure appearance and behavior","commandCenter.action.models":"Configure models","commandCenter.action.modelsDescription":"Select providers and task models","commandCenter.action.shortcuts":"View keyboard shortcuts","commandCenter.action.shortcutsDescription":"Browse global and contextual keys","commandCenter.action.skills":"Manage skills","commandCenter.action.skillsDescription":"Discover and configure agent capabilities","commandCenter.action.mcp":"Manage MCP servers","commandCenter.action.mcpDescription":"Configure connected tools and servers","commandCenter.action.sidebar":"Toggle sidebar","commandCenter.action.sidebarDescription":"Show or hide project navigation","taskHome.eyebrow":"Task dispatcher · Ready","taskHome.feed.connecting":"Task dispatcher · Connecting","taskHome.feed.reconnecting":"Task dispatcher · Reconnecting","taskHome.feed.offline":"Task dispatcher · Offline","taskHome.feed.offlineDescription":"Live task updates are paused. Running tasks continue on the server.","taskHome.feed.retry":"Reconnect","taskHome.hero.prefix":"What should Blade build in","taskHome.hero.projectFallback":"current workspace","taskHome.hero.subtitle":"Dispatch a task and keep moving. Each task runs in its own worktree, persists state, and returns with a reviewable workspace when it's done.","taskHome.templates.title":"Templates","taskHome.templates.hint":"1–4 to prefill","taskHome.template.explore.title":"Explore","taskHome.template.explore.description":"Trace behavior and explain the system","taskHome.template.explore.hint":"Trace a call · map a module","taskHome.template.build.title":"Build","taskHome.template.build.description":"Implement a production-ready feature","taskHome.template.build.hint":"Ship a feature end-to-end","taskHome.template.review.title":"Review","taskHome.template.review.description":"Find correctness and regression risks","taskHome.template.review.hint":"Audit current changes","taskHome.review.attachmentsUnsupported":"Code review does not accept attachments","taskHome.review.outputSchemaUnsupported":"Code review uses its own structured report schema","taskHome.review.usage":"Usage: /review [uncommitted | base <ref> | commit <sha>]","taskHome.review.running":"Read-only code review in progress","taskHome.review.stale":"Review target changed while the reviewer was running","taskHome.review.aborted":"Code review aborted","taskHome.review.interrupted":"Code review interrupted by process restart","taskHome.review.failed":"Code review failed","taskHome.review.startFailed":"Failed to start code review","taskHome.review.invalidTarget":"The selected review target is invalid or has no changes","taskHome.review.conflict":"This session already has active work","taskHome.template.fix.title":"Fix","taskHome.template.fix.description":"Diagnose and repair a concrete failure","taskHome.template.fix.hint":"Bisect · reproduce · patch","taskHome.context.isolationToggleTitle":"Toggle task isolation","taskHome.context.projectSelect":"Select target project","taskHome.context.isolation.worktree":"Isolated worktree","taskHome.context.isolation.local":"Local workspace","taskHome.context.branchFallback":"no branch","taskHome.context.preparing":"Preparing worktree","taskHome.setup.aria":"Task setup status","taskHome.setup.title":"Finish setup","taskHome.setup.description":"Keep drafting while Blade verifies the workspace and model.","taskHome.setup.workspace.title":"Workspace","taskHome.setup.workspace.loading":"Checking available workspaces…","taskHome.setup.workspace.ready":"{project} selected","taskHome.setup.workspace.required":"Choose an available project","taskHome.setup.workspace.empty":"No project","taskHome.setup.workspace.action":"Choose","taskHome.setup.workspace.retry":"Reload workspaces","taskHome.setup.model.title":"Model","taskHome.setup.model.loading":"Checking configuration…","taskHome.setup.model.ready":"Ready for this task","taskHome.setup.model.required":"Configure or select a model","taskHome.setup.model.action":"Configure","taskHome.setup.model.retry":"Retry","taskHome.composer.placeholder":"Describe the outcome, constraints, and verification you expect...","taskHome.error.dismiss":"Dismiss","taskHome.recent.title":"Recent tasks","taskHome.recent.total":"{count} total","taskHome.recent.partial":"{count} loaded · syncing","taskHome.recent.incomplete":"{count} loaded · history incomplete","taskSwitcher.indexingLoaded":"{count} loaded · syncing history","taskHome.footer.note":"Worktree isolation keeps parallel tasks from touching your active checkout","kanban.title":"Task board","kanban.subtitle":"Dispatch work across bound projects and focus on tasks that need intervention.","kanban.taskCount":"{count} tasks","kanban.searchAria":"Search task board","kanban.searchPlaceholder":"Search tasks...","kanban.projectFilterAria":"Filter task board by project","kanban.projectAll":"All projects","kanban.feed.offline":"Live updates are offline. Running tasks continue.","kanban.autoClaim.running":"Auto-claiming","kanban.autoClaim.paused":"Auto-claim paused","kanban.column.waiting":"Waiting","kanban.column.waitingDescription":"Queued for an execution slot","kanban.column.active":"In progress","kanban.column.activeDescription":"Agents currently working","kanban.column.blocked":"Blocked","kanban.column.blockedDescription":"Needs input, retry, or attention","kanban.column.review":"Ready for review","kanban.column.reviewDescription":"Completed work awaiting acceptance","kanban.column.empty":"No tasks in this stage","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","kanban.kind.feature":"Feature","kanban.kind.bug":"Bug","kanban.kind.maintenance":"Maintenance","kanban.kind.research":"Research","kanban.card.unread":"New task update","kanban.card.queuePosition":"Queue #{position} of {depth}","kanban.card.diff":"{files} files · +{additions} −{deletions}","kanban.action.newTask":"New task","kanban.action.open":"Open task","kanban.action.respond":"Respond to blocker","kanban.action.inspect":"Inspect changes","kanban.action.edit":"Edit task details","kanban.action.cancel":"Cancel task","kanban.action.retry":"Retry task","kanban.action.archive":"Accept and archive","kanban.dialog.createTitle":"Dispatch task","kanban.dialog.createDescription":"The task runs directly in the selected project workspace.","kanban.dialog.editTitle":"Edit task","kanban.dialog.editDescription":"Update planning metadata without interrupting the running agent.","kanban.dialog.localExecution":"Local workspace · no worktree isolation","kanban.dialog.cancel":"Cancel","kanban.dialog.dispatch":"Dispatch","kanban.dialog.save":"Save","kanban.dialog.submitFailed":"Task operation failed","kanban.field.title":"Title","kanban.field.titlePlaceholder":"Optional concise task title","kanban.field.prompt":"Task brief","kanban.field.promptPlaceholder":"Describe the outcome, constraints, and verification expected...","kanban.field.project":"Project","kanban.field.kind":"Type","kanban.field.priority":"Priority","kanban.field.dueAt":"Due","capacity.title":"{inFlight} running · {queued} queued · max {max}","capacity.suffix.running":" running","capacity.queued":"{queued} queued","recent.status.running":"running","recent.status.queued":"queued","recent.status.paused":"paused","recent.status.failed":"failed","recent.status.cancelled":"cancelled","recent.status.done":"done","recent.time.justNow":"just now","recent.time.minutes":"{n}m ago","recent.time.hours":"{n}h ago","recent.time.days":"{n}d ago","recent.session.fallbackShort":"Session {id}","recent.session.fallbackDated":"Session {y}-{m}-{d} {hh}:{mm}","attention.unreadAnnouncement":"{count} unread task updates","attention.notification.completed":"Task completed","attention.notification.failed":"Task failed","attention.notification.interrupted":"Task interrupted","attention.notification.permission":"Approval required","attention.notification.question":"Answer required","attention.notification.elicitation":"MCP input required","interaction.permission.title":"Permission required: {tool}","interaction.permission.once":"Allow once","interaction.permission.session":"Allow for session","interaction.permission.project":"Allow for project","interaction.permission.deny":"Deny","interaction.permission.failed":"Failed to respond to permission","interaction.question.answered":"Questions answered","interaction.question.other":"Other","interaction.question.submit":"Submit answers","interaction.question.failed":"Failed to submit answers","interaction.elicitation.title":"MCP input requested","interaction.elicitation.submit":"Submit to MCP","interaction.elicitation.open":"Open external URL","interaction.elicitation.decline":"Decline","interaction.elicitation.cancel":"Cancel","interaction.elicitation.responded":"MCP request answered","interaction.elicitation.cancelled":"MCP request cancelled","interaction.elicitation.failed":"Failed to respond to MCP request","interaction.elicitation.warning":"Only continue if you trust this MCP server and understand the request.","interaction.bar.permissionTitle":"Agent needs approval","interaction.bar.permissionHint":"Review the pending tool request before this task can continue.","interaction.bar.questionTitle":"Agent needs your answer","interaction.bar.questionHint":"Answer the pending question before this task can continue.","interaction.bar.elicitationTitle":"MCP server needs your input","interaction.bar.elicitationHint":"Review the MCP request before this task can continue.","interaction.bar.review":"Review request","interaction.badge.permission":"Needs approval","interaction.badge.question":"Needs answer","interaction.badge.elicitation":"MCP input","artifact.env.isolated":"isolated","artifact.env.local":"local","artifact.review":"Review changes","artifact.commits":"{count} commits","artifact.apply":"Apply","artifact.retryApply":"Retry apply","artifact.applying":"Applying","artifact.applied":"Applied","artifact.discard":"Discard task changes","artifact.discarded":"Discarded","artifact.conflict":"The task changes could not be applied safely.","artifact.conflictHint":"The isolated changes are preserved. Review them, resolve the source project, then retry or discard.","artifact.discardDialog.title":"Discard isolated changes?","artifact.discardDialog.description":"Remove {count} changed files from the isolated task workspace for {project}.","artifact.discardDialog.warning":"This permanently removes the task worktree and branch. Your source project is not modified.","artifact.discardDialog.cancel":"Keep changes","artifact.discardDialog.confirm":"Discard changes","chat.list.empty.eyebrow":"Blade · Ready","chat.list.empty.title":"Start a conversation to begin","chat.list.empty.hint":"Ask a question, describe a change, or paste a stack trace.","chat.list.loading.eyebrow":"Conversation history","chat.list.loading.title":"Restoring conversation…","chat.list.loading.hint":"Loading messages, task state, and live updates. Larger conversations may take a moment.","chat.list.showEarlier":"Show {count} earlier messages","chat.list.showEarlierWithRemaining":"Show {count} earlier messages, {remaining} hidden","chat.list.jumpLatest":"Jump to latest","chat.turns.aria":"Jump to a previous message","chat.turns.label":"Turn {n}","chat.timeline.thinking":"Thought process","chat.timeline.tools.runningOne":"Running 1 command","chat.timeline.tools.running":"Running {count} commands","chat.timeline.tools.completedOne":"Executed 1 command","chat.timeline.tools.completed":"Executed {count} commands","chat.timeline.tools.completedOneWithError":"Executed 1 command · failed","chat.timeline.tools.completedWithErrors":"Executed {count} commands · {errors} failed","chat.error.dismiss":"Dismiss error","chat.error.queueFull":"The guidance queue is full. Wait for pending instructions to start, then retry.","chat.error.turnChanged":"The active turn changed before this message was accepted. Review and retry it.","chat.error.title.submission":"Message not sent.","chat.error.title.execution":"Run stopped.","chat.error.title.navigation":"Task not opened.","chat.error.title.generic":"Action failed.","chat.error.action.returnDraft":"Return to draft","chat.error.action.editResend":"Edit and resend","chat.error.action.retryTask":"Retry task","chat.error.action.retryingTask":"Retrying…","chat.error.action.checkModels":"Check model settings","task.failure.authentication":"Provider authentication failed. Check model credentials.","task.failure.permission":"Provider rejected this request. Check account and model permissions.","task.failure.rateLimit":"Provider rate limit or quota exceeded.","task.failure.timeout":"Provider request timed out.","task.failure.network":"Provider connection failed.","task.failure.modelUnavailable":"The selected model is unavailable.","task.failure.contextLimit":"The request exceeded the model context limit.","task.failure.unsupportedInput":"The selected model does not support this input.","task.failure.capacity":"Task admission capacity is full. Retry after running tasks complete.","task.failure.runtime":"Agent execution failed.","chat.connection.reconnecting":"Reconnecting live updates. The active run continues in the background.","chat.connection.offline":"Live updates are offline. Progress shown here may be stale.","chat.connection.retry":"Reconnect","chat.side.title":"Side conversation","chat.side.loading":"Answering side question...","chat.side.failed":"Side conversation failed.","chat.side.dismiss":"Dismiss side conversation","chat.footer.disclaimer":"Blade can make mistakes. Please check important information.","chat.input.placeholder.default":"Type @ for files, / for commands...","chat.input.placeholder.steering":"Add guidance to steer the active turn...","chat.input.steering.status":"Active turn is steerable","chat.input.steering.queued":"Guidance accepted · {count} pending","chat.input.steering.enterHint":" · Enter sends guidance","chat.input.followUp.queued":"Follow-up accepted · {count} queued for the next turn","chat.input.steering.recoveredOne":"Recovered {count} queued instruction after restart","chat.input.steering.recoveredMany":"Recovered {count} queued instructions after restart","chat.input.attachment.add":"Attach images","chat.input.attachment.remove":"Remove","chat.input.attachment.countLimit":"You can attach up to {count} images.","chat.input.attachment.sizeLimit":"Images must stay under {size} total. Remove an image or choose smaller files.","chat.input.attachment.readFailed":"Blade could not read one of these images.","chat.input.attachment.usage":"{count}/{limit} images · {used} of {budget}","chat.input.attachment.modelUnsupported":"{model} does not support images. Choose a vision model or remove the images.","chat.input.attachment.modelRequired":"Choose a vision-capable model before attaching images.","chat.input.model.placeholder":"Select Model","chat.input.model.empty":"No models configured","chat.input.model.vision":"Vision","chat.input.model.change":"Change model","chat.input.model.locked":"Wait for the active turn to finish before switching models","chat.input.effort.label":"Effort {effort}","chat.input.effort.heading":"Reasoning effort","chat.input.effort.change":"Change reasoning effort","chat.input.effort.locked":"Wait for the active turn to finish before changing reasoning effort","chat.input.effort.option":"Use {effort} reasoning effort","chat.input.serviceTier.label":"Speed {tier}","chat.input.serviceTier.heading":"Provider service tier","chat.input.serviceTier.change":"Change provider service tier","chat.input.serviceTier.locked":"Wait for the current turn to finish before changing service tier","chat.input.serviceTier.option":"Use {tier} service tier","chat.input.serviceTier.fastHint":"priority","chat.input.serviceTier.flexHint":"lower cost","chat.input.responseVerbosity.label":"Output {verbosity}","chat.input.responseVerbosity.heading":"Response verbosity","chat.input.responseVerbosity.change":"Change response verbosity","chat.input.responseVerbosity.locked":"Wait for the current turn to finish before changing response verbosity","chat.input.responseVerbosity.option":"Use {verbosity} response verbosity","chat.input.responseVerbosity.autoHint":"model default","chat.input.outputSchema.title":"Structured output","chat.input.outputSchema.description":"Require this turn to finish with an object that matches the JSON Schema.","chat.input.outputSchema.change":"Set structured output schema","chat.input.outputSchema.locked":"Wait for the current turn to finish before changing the output schema","chat.input.outputSchema.editor":"JSON Schema editor","chat.input.outputSchema.placeholder":"Paste a JSON Schema object","chat.input.outputSchema.example":"Use example","chat.input.outputSchema.clear":"Clear","chat.input.outputSchema.invalid":"Enter a valid JSON object. The server validates the complete schema.","chat.input.outputSchema.shellUnsupported":"Structured output cannot be combined with a shell command.","chat.structuredOutput.title":"Structured output","chat.structuredOutput.copy":"Copy structured output","chat.input.communicationStyle.label":"Style {style}","chat.input.communicationStyle.heading":"Communication style","chat.input.communicationStyle.change":"Change communication style","chat.input.communicationStyle.locked":"Wait for the current turn to finish before changing communication style","chat.input.communicationStyle.option":"Use {style} communication style","chat.input.communicationStyle.autoHint":"Blade default","chat.input.communicationStyle.pragmaticHint":"direct","chat.input.communicationStyle.friendlyHint":"warm","chat.input.communicationStyle.explanatoryHint":"explain choices","chat.notice.dismiss":"Dismiss notice","chat.input.mode.default":"Manual approval","chat.input.mode.default.desc":"Every important action needs your approval","chat.input.mode.autoEdit":"Auto approval","chat.input.mode.autoEdit.desc":"Let the AI review and approve important actions","chat.input.mode.yolo":"Full access","chat.input.mode.yolo.desc":"Run directly on your machine without asking","chat.input.mode.yolo.confirm.title":"Enable full access mode?","chat.input.mode.yolo.confirm.desc":"In this mode the agent will execute all actions — including file writes, shell commands, and network requests — without asking for permission. Only enable this if you trust the current context.","chat.input.mode.yolo.confirm.cancel":"Cancel","chat.input.mode.yolo.confirm.accept":"Enable","chat.input.mode.plan":"Plan","chat.input.mode.plan.desc":"Draft a plan first without making changes","chat.input.mode.aria":"Agent action approval","chat.input.action.stop":"Stop active turn","chat.input.action.stopping":"Stopping active turn","chat.input.action.steer":"Steer active turn","chat.input.action.send":"Send message","chat.input.action.submitting":"Submitting message","chat.review.title":"Code Review","chat.review.target":"Target","chat.review.target.uncommitted":"Uncommitted changes","chat.review.target.base":"Changes against {ref}","chat.review.target.commit":"Commit {ref}","chat.review.status":"Status","chat.review.status.completed":"Completed","chat.review.status.stale":"Stale","chat.review.status.failed":"Failed","chat.review.status.aborted":"Aborted","chat.review.status.interrupted":"Interrupted","chat.review.findings":"Findings","chat.review.noFindings":"No actionable findings","chat.review.confidence":"confidence {value}","chat.review.error":"Error","chat.subagent.resumedFromTitle":"Resumed from {id}","chat.subagent.resumedDepth":"resumed · depth {depth}","chat.subagent.loadingLogs":"Loading subagent logs...","chat.subagent.resumedAs":"Resumed as {id} · {status} · depth {depth}","chat.subagent.resume":"Resume","chat.subagent.resumeAria":"Resume subagent","chat.subagent.followUpAria":"Subagent follow-up","chat.subagent.followUpPlaceholder":"Describe the follow-up work","chat.subagent.cancel":"Cancel","chat.subagent.resumeAgent":"Resume agent","chat.subagent.resumeFailed":"Failed to resume subagent","chat.markdown.copyCode":"Copy code","chat.rewind.title":"Rewind session","chat.rewind.description":"Return to the point before a user message.","chat.rewind.loading":"Loading checkpoints","chat.rewind.empty":"Nothing to rewind to yet","chat.rewind.checkpointAria":"Rewind checkpoint","chat.rewind.userMessage":"User message","chat.rewind.fileCountOne":"{count} file","chat.rewind.fileCountMany":"{count} files","chat.rewind.restoreCode":"Restore code changes","chat.rewind.restoreCodeHint":"Revert files changed at and after this checkpoint.","chat.rewind.cancel":"Cancel","chat.rewind.confirm":"Rewind","chat.rewind.loadFailed":"Failed to load rewind checkpoints","chat.rewind.failed":"Rewind failed. Review the session error and try again.","status.context":"Context","status.tokenLimitTooltip":"Token limit is estimated. It updates when the model reports its context size.","status.cache":"Cache","status.cacheTooltip":"Cached input divided by total model input for this session.","status.cacheDetails":"Read {read} · Written {write} · Uncached {uncached}","status.cacheUnavailable":"The Provider has not reported prompt-cache usage for this session.","status.cacheBreak":"Last cache break: {reason} · cache read {previous} → {current}","status.cacheBreak.model":"model changed","status.cacheBreak.system":"system prompt changed","status.cacheBreak.tools":"tool definitions changed","status.cacheBreak.policy":"request policy changed","status.cacheBreak.ttl":"cache TTL expired","status.cacheBreak.server":"likely Provider routing or eviction","status.phase.running":"Generating...","status.phase.providerStall":"Provider stream paused","status.phase.actionStationarityRecovering":"Recovering","status.phase.actionStationarityStopped":"Stopped","status.phase.compacting":"Compacting context...","status.phase.recoveringContext":"Recovering context limit...","status.phase.switchingModel":"Switching model...","status.phase.waitingPermission":"Waiting for permission...","status.phase.error":"Run failed","preview.title":"Preview","preview.action.resize":"Resize preview","preview.action.close":"Close preview","preview.action.retry":"Retry","preview.tab.diff":"Diff","preview.tab.files":"Files","preview.tab.logs":"Logs","preview.tab.browser":"Browser","preview.diff.loadingTitle":"Loading task diff…","preview.diff.loadingHint":"Reading the durable worktree artifact.","preview.diff.failedTitle":"Failed to load task diff","preview.diff.discardedTitle":"Changes discarded","preview.diff.discardedHint":"The isolated workspace was removed. The source project was not changed.","preview.diff.emptyTitle":"No patch yet","preview.diff.emptyHint":"Run a tool that changes files to see diffs here.","preview.diff.searchAria":"Search changed files","preview.diff.searchPlaceholder":"Filter changed files…","preview.diff.changedFiles":"{count} changed files","preview.diff.expandAll":"Expand all","preview.diff.collapseAll":"Collapse all","preview.diff.showMoreFiles":"Show {count} more files","preview.diff.showMoreLines":"Show {count} more lines","preview.diff.noMatches":"No matching changed files","preview.diff.patch":"Patch","preview.diff.line":"Line {line}","preview.files.loadingTitle":"Loading files…","preview.files.loadingHint":"Fetching workspace tree.","preview.files.failedTitle":"Failed to load files","preview.files.emptyTitle":"No files yet","preview.files.emptyHint":"Select a project to load its workspace tree.","preview.files.treeFailed":"Failed to load workspace tree","preview.files.searchAria":"Search workspace files","preview.files.searchPlaceholder":"Find a file…","preview.files.searchResultsAria":"File search results","preview.files.searchFailed":"Failed to search workspace files","preview.files.noMatches":"No matching files","preview.files.directoryLoading":"Loading folder…","preview.files.directoryEmpty":"Empty folder","preview.files.selectTitle":"Select a file to preview","preview.files.status.loading":"Loading…","preview.files.status.truncated":"Truncated","preview.files.status.ready":"Ready","preview.files.truncatedNotice":"Preview truncated to 200k characters.","preview.files.pickHint":"Pick a file from the tree to preview.","preview.files.contentFailed":"Failed to load file","preview.files.editorLoading":"Loading editor…","preview.logs.searchAria":"Search tool logs","preview.logs.searchPlaceholder":"Search tool, summary, or output…","preview.logs.filterAria":"Filter logs by status","preview.logs.filter.all":"All","preview.logs.filter.running":"Running","preview.logs.filter.error":"Failed","preview.logs.filter.success":"Success","preview.logs.noMatches":"No matching logs","preview.logs.noMatchesHint":"Try another phrase or status.","preview.logs.emptyTitle":"No logs yet","preview.logs.emptyHint":"Tool runs will appear here.","preview.logs.expand":"Expand","preview.logs.collapse":"Collapse","preview.logs.showMore":"Show {count} more logs","preview.logs.status.running":"Running","preview.logs.status.error":"Failed","preview.logs.status.success":"Success","goal.aria.section":"Goal controls","goal.status.active":"Goal running","goal.status.paused":"Goal paused","goal.status.blocked":"Goal blocked","goal.status.usageLimited":"Usage limited","goal.status.budgetLimited":"Budget reached","goal.status.complete":"Goal complete","goal.field.objective":"Goal objective","goal.action.edit":"Edit goal","goal.action.pause":"Pause goal","goal.action.resume":"Resume goal","goal.action.delete":"Delete goal","goal.action.expand":"Expand goal details","goal.action.collapse":"Collapse goal details","goal.action.cancel":"Cancel","goal.action.save":"Save","goal.metrics.tokens":"tokens","goal.metrics.continuationOne":"{n} continuation","goal.metrics.continuationMany":"{n} continuations","goal.dialog.title":"Delete this goal?","goal.dialog.description":"The goal state will be removed. Session history and workspace files are not affected.","settings.title":"Settings","settings.nav.aria":"Settings sections","settings.action.back":"Back","settings.category.settings":"Settings","settings.category.integrations":"Integrations","settings.tab.general":"General","settings.tab.trust":"Security","settings.tab.models":"Models","settings.tab.shortcuts":"Shortcuts","settings.tab.mcp":"MCP","settings.tab.skills":"Skills","settings.tab.plugins":"Plugins","settings.tab.hooks":"Hooks","settings.tab.schedules":"Scheduled Tasks","settings.common.retry":"Retry","settings.common.dismiss":"Dismiss","settings.common.cancel":"Cancel","settings.common.enable":"Enable","settings.general.loading":"Loading settings...","settings.general.loadError":"Failed to load settings","settings.general.saveError":"Failed to save settings","settings.general.responseLanguage":"Response Language","settings.general.responseLanguageHint":"AI will respond in this language","settings.general.autoSave":"Auto-save sessions","settings.general.communicationStyle":"Communication Style","settings.general.communicationStyleHint":"How the agent phrases its replies across every session","settings.appearance.heading":"Appearance","settings.appearance.theme":"Theme Preference","settings.appearance.theme.dark":"Dark","settings.appearance.theme.light":"Light","settings.appearance.theme.system":"System","settings.appearance.compactSidebar":"Compact sidebar","settings.appearance.codeTheme":"Code theme","settings.appearance.codeThemeHint":"Syntax highlighting colors","settings.notifications.heading":"Notifications","settings.notifications.buildFinished":"Build finished","settings.notifications.errorsOnly":"Errors only","settings.notifications.systemSounds":"System sounds","settings.notifications.blocked":"Browser notifications are blocked","settings.notifications.unavailable":"Browser notifications are unavailable","settings.notifications.enablePrompt":"Enable alerts while this tab is in the background","settings.privacy.heading":"Privacy","settings.privacy.telemetry":"Telemetry","settings.privacy.crash":"Crash reports","settings.models.description":"Configure API keys and model settings for different providers.","settings.models.loading":"Loading models...","settings.models.loadChannelsFailed":"Failed to load provider channels","settings.models.saveFailed":"Failed to save model","settings.models.deleteFailed":"Failed to delete model","settings.models.updateFailed":"Failed to update model","settings.models.updateChannelFailed":"Failed to update provider channel","settings.models.probeFailed":"Provider probe failed","settings.models.deleteChannelFailed":"Failed to delete provider channel","settings.models.empty":"No models configured yet","settings.models.add":"+ Add New Model","settings.models.missingCredential":"Missing credential","settings.models.configured":"Configured","settings.models.deleting":"Deleting...","settings.models.deleteModel":"Delete model","settings.models.deleteChannel":"Delete channel","settings.models.deleteModelAria":"Delete {name}","settings.models.deleteModelPrompt":"Delete {name} and its saved configuration?","settings.models.deleteChannelAria":"Delete channel {name}","settings.models.deleteChannelPrompt":"Delete channel {name}, its credential, and {count} configured model(s)? Fallback references will also be removed.","settings.models.editModelAria":"Edit {name}","settings.models.editChannelAria":"Edit channel {name}","settings.models.testChannelAria":"Test {name}","settings.models.deleteChannelActionAria":"Delete channel {name}","settings.models.modelCountOne":"{count} model","settings.models.modelCountMany":"{count} models","settings.models.defaultEndpoint":"default endpoint","settings.shortcuts.searchPlaceholder":"Search actions...","settings.shortcuts.scope.all":"All scopes","settings.shortcuts.scope.global":"Global","settings.shortcuts.scope.chat":"Chat","settings.shortcuts.scope.layout":"Layout","settings.shortcuts.reset":"Reset","settings.shortcuts.col.action":"Action","settings.shortcuts.col.shortcut":"Shortcut","settings.shortcuts.col.scope":"Scope","settings.shortcuts.empty":"No shortcuts found.","settings.shortcuts.action.searchTasks":"Search tasks","settings.shortcuts.action.openCommands":"Open command center","settings.shortcuts.action.newTask":"New task","settings.shortcuts.action.focusComposer":"Focus composer","settings.shortcuts.action.toggleSidebar":"Toggle sidebar","settings.common.reload":"Reload","settings.trust.state.notRequired":"No trust required","settings.trust.state.trusted":"Workspace trusted","settings.trust.state.review":"Review required","settings.trust.state.error":"Trust store error","settings.trust.selectSession":"Select a project session to review folder trust.","settings.trust.heading":"Workspace trust","settings.trust.inheritedFrom":" · inherited from {source}","settings.trust.reloadAria":"Reload workspace trust","settings.trust.revoke":"Revoke","settings.trust.trustWorkspace":"Trust workspace","settings.trust.restartNotice":"Restart Blade to reload project models, MCP, LSP, permissions, and plugins.","settings.trust.revokeAria":"Revoke workspace trust","settings.trust.confirmTrust":"Allow {count} project source(s) to configure models, MCP, LSP, permissions, environment, instructions, commands, skills, agents, or plugins?","settings.trust.confirmRevoke":"Block project-controlled executable configuration after restart?","settings.trust.saving":"Saving...","settings.trust.trustReviewed":"Trust reviewed workspace","settings.trust.revokeTrust":"Revoke trust","settings.trust.empty":"No project-controlled executable configuration was found.","settings.trust.loadFailed":"Failed to load workspace trust","settings.trust.updateFailed":"Failed to update workspace trust","settings.hooks.state.disabled":"Hooks disabled","settings.hooks.state.notRequired":"No external hooks","settings.hooks.state.review":"Review required","settings.hooks.state.trusted":"Trusted","settings.hooks.state.modified":"Changed since approval","settings.hooks.state.error":"Trust store error","settings.hooks.selectSession":"Select a project session to review its hooks.","settings.hooks.heading":"Hook trust","settings.hooks.reloadAria":"Reload hook trust","settings.hooks.revoke":"Revoke","settings.hooks.trustDigest":"Trust digest","settings.hooks.currentSession":"Current session execution","settings.hooks.session.open":"Open a session to control its hooks.","settings.hooks.session.loading":"Loading session state...","settings.hooks.session.disabled":"Disabled by workspace configuration.","settings.hooks.session.paused":"Paused only for this session.","settings.hooks.session.active":"Hooks may run for this session after trust checks.","settings.hooks.session.unavailable":"Disabled by this session runtime or host policy.","settings.hooks.session.enableAria":"Enable hooks for current session","settings.hooks.session.pauseAria":"Pause hooks for current session","settings.hooks.session.unavailableAria":"Hooks unavailable for current session","settings.hooks.confirmTrustAria":"Trust project hooks","settings.hooks.confirmRevokeAria":"Revoke project hook trust","settings.hooks.confirmTrust":"Run these {count} hooks with your user permissions until their configuration changes?","settings.hooks.confirmRevoke":"Stop all configured hooks for this project until explicitly trusted again?","settings.hooks.saving":"Saving...","settings.hooks.trustReviewed":"Trust reviewed hooks","settings.hooks.revokeTrust":"Revoke trust","settings.hooks.empty":"No configured command, HTTP, or prompt hooks.","settings.hooks.loadFailed":"Failed to load hook trust","settings.hooks.updateFailed":"Failed to update hook trust","settings.hooks.sessionUpdateFailed":"Failed to update session hooks","settings.plugins.selectProject":"Select a project to manage its plugins.","settings.plugins.heading":"Workspace plugins","settings.plugins.changesNote":"Changes apply to future session snapshots and persist in the selected scope.","settings.plugins.reloadAria":"Reload plugins","settings.plugins.sourcePolicy":"Source policy","settings.plugins.savePolicyAria":"Save plugin source policy","settings.plugins.saving":"Saving…","settings.plugins.saveForProject":"Save for project","settings.plugins.restrictAria":"Restrict plugin sources","settings.plugins.restrictAllowlists":"Restrict to allowlists","settings.plugins.requireShaAria":"Require full Git commit SHA","settings.plugins.requireSha":"Require full Git SHA","settings.plugins.environmentLocked":" · environment locked","settings.plugins.gitHostsAria":"Allowed plugin Git hosts","settings.plugins.marketplacesAria":"Allowed plugin Marketplaces","settings.plugins.localRootsAria":"Allowed local plugin roots","settings.plugins.emptyAllowlists":"Empty allowlists deny every plugin source.","settings.plugins.installHeading":"Install trusted plugin","settings.plugins.sourceAria":"Plugin source","settings.plugins.install":"Install","settings.plugins.trustSource":"I trust this source to activate Hooks, MCP servers, skills, and commands.","settings.plugins.activationScope":"Activation write scope","settings.plugins.activationScopeHint":"Higher-priority layers continue to determine the effective state.","settings.plugins.scopeAria":"Plugin activation scope","settings.plugins.scope.local":"Local","settings.plugins.scope.project":"Project","settings.plugins.scope.global":"Global","settings.plugins.scope.localDesc":"Only this checkout","settings.plugins.scope.projectDesc":"Shared project settings","settings.plugins.scope.globalDesc":"All projects","settings.plugins.scope.invocation":"Invocation","settings.plugins.scope.default":"Default","settings.plugins.layer.on":"on","settings.plugins.layer.off":"off","settings.plugins.capability.commands":"{count} commands","settings.plugins.capability.skills":"{count} skills","settings.plugins.capability.agents":"{count} agents","settings.plugins.capability.hooks":"{count} hooks","settings.plugins.capability.mcp":"{count} MCP","settings.plugins.noResources":"No declared resources","settings.plugins.effective":"effective: {scope}","settings.plugins.managed":"managed","settings.plugins.invocationScoped":"Invocation-scoped via --plugin-dir","settings.plugins.enableAria":"Enable {name}","settings.plugins.disableAria":"Disable {name}","settings.plugins.unavailableAria":"Unavailable {name}","settings.plugins.updateAria":"Update {name}","settings.plugins.uninstallAria":"Uninstall {name}","settings.plugins.confirmUpdate":"Confirm update","settings.plugins.update":"Update","settings.plugins.confirmRemove":"Confirm remove","settings.plugins.empty":"No plugins discovered for this project.","settings.plugins.marketplaces":"Marketplaces","settings.plugins.configuredCount":"{count} configured","settings.plugins.marketplaceSourceAria":"Marketplace source","settings.plugins.addMarketplaceAria":"Add marketplace","settings.plugins.add":"Add","settings.plugins.noDescription":"No description","settings.plugins.refreshMarketplaceAria":"Refresh marketplace {name}","settings.plugins.removeMarketplaceAria":"Remove marketplace {name}","settings.plugins.confirm":"Confirm","settings.plugins.installedSuffix":" · installed","settings.plugins.marketplaceEmpty":"Add a Marketplace to discover installable plugins.","settings.plugins.loadFailed":"Failed to load plugins","settings.plugins.actionFailed":"Plugin action failed","settings.plugins.updateFailed":"Failed to update plugin","settings.models.addModal.title":"Add Model","settings.models.addModal.close":"Close add model","settings.models.addModal.loadProvidersError":"Failed to load providers","settings.models.addModal.loadModelsError":"Failed to load models","settings.models.addModal.provider":"Provider","settings.models.addModal.loadingProviders":"Loading providers...","settings.models.addModal.selectProvider":"Select provider","settings.models.addModal.configuredSuffix":" - configured","settings.models.addModal.customOpenAI":"Custom OpenAI Endpoint","settings.models.addModal.customAnthropic":"Custom Anthropic Endpoint","settings.models.addModal.channelId":"Channel ID","settings.models.addModal.channelIdHint":"Stable config and credential identifier.","settings.models.addModal.channelName":"Channel name","settings.models.addModal.baseUrl":"Base URL","settings.models.addModal.anthropicProtocol":"Uses the Anthropic Messages protocol.","settings.models.addModal.openaiProtocol":"Uses the OpenAI Chat Completions protocol.","settings.models.addModal.modelId":"Model ID","settings.models.addModal.model":"Model","settings.models.addModal.loadingModels":"Loading models...","settings.models.addModal.selectModel":"Select model","settings.models.addModal.reasoningSuffix":" - reasoning","settings.models.addModal.visionSuffix":" - vision","settings.models.addModal.displayName":"Display name","settings.models.addModal.displayNamePlaceholder":"Optional alias","settings.models.addModal.apiKey":"API Key","settings.models.addModal.apiKeyAria":"API key","settings.models.addModal.apiKeyPlaceholder":"Stored separately in auth.json","settings.models.addModal.showApiKey":"Show API key","settings.models.addModal.hideApiKey":"Hide API key","settings.models.addModal.oauthNote":"This provider requires OAuth or ambient credentials. Configure it externally before selecting the model.","settings.models.addModal.saveModel":"Save Model","settings.models.addModal.saving":"Saving...","settings.models.addModal.channelIdError":'Channel ID must start with a lowercase letter and contain only lowercase letters, numbers, ".", "_" or "-"',"settings.models.addModal.invalidBaseUrl":"Base URL must be an absolute HTTP(S) URL","settings.models.editModal.srTitle":"Edit Model","settings.models.editModal.title":"Edit Model Overrides","settings.models.editModal.close":"Close edit model","settings.models.editModal.displayName":"Display name","settings.models.editModal.replaceApiKey":"Replace provider API key","settings.models.editModal.replaceApiKeyPlaceholder":"Leave empty to keep current credential","settings.models.editModal.baseUrlOverride":"Base URL override","settings.models.editModal.baseUrlPlaceholder":"Leave empty to use default endpoint","settings.models.editModal.streamIdleTimeout":"Stream idle timeout (ms)","settings.models.editModal.save":"Save","settings.models.editModal.saving":"Saving...","settings.models.editModal.streamIdleTimeoutError":"Stream idle timeout must be at least 1000ms","settings.models.editModal.credentialError":"Failed to update provider credential","settings.models.editProvider.title":"Edit Provider Channel","settings.models.editProvider.close":"Close edit provider","settings.models.editProvider.channelName":"Channel name","settings.models.editProvider.channelNameRequired":"Channel name is required","settings.models.editProvider.wireApi":"Wire API","settings.models.editProvider.baseUrl":"Base URL","settings.models.editProvider.baseUrlAria":"Provider Base URL","settings.models.editProvider.invalidBaseUrl":"Base URL must be an absolute HTTP(S) URL","settings.models.editProvider.apiKeyEnv":"API key environment variable","settings.models.editProvider.apiKeyEnvPlaceholder":"Optional, for example TEAM_GATEWAY_API_KEY","settings.models.editProvider.replaceApiKey":"Replace API key","settings.models.editProvider.apiKeyAria":"Provider API key","settings.models.editProvider.apiKeyPlaceholder":"Leave empty to keep current credential","settings.models.editProvider.save":"Save channel","settings.models.editProvider.saving":"Saving...","settings.style.auto":"Auto","settings.style.pragmatic":"Pragmatic","settings.style.friendly":"Friendly","settings.style.explanatory":"Explanatory","mcp.status.connected":"Connected","mcp.status.connecting":"Connecting...","mcp.status.reconnecting":"Recovering...","mcp.status.offline":"Offline","mcp.status.error":"Error","mcp.status.recoveringAttempt":"Recovering {attempt}/{max}","mcp.oauth.status.disabled":"Not configured","mcp.oauth.status.unavailable":"Unavailable in this runtime","mcp.oauth.status.unauthenticated":"Authorization required","mcp.oauth.status.authorizing":"Waiting for authorization...","mcp.oauth.status.authenticated":"Authorized","mcp.oauth.status.error":"Authorization failed","mcp.catalog.tag.official":"Official","mcp.catalog.tag.popular":"Popular","mcp.catalog.tag.community":"Community","mcp.action.refreshServers":"Refresh MCP servers","mcp.action.addServer":"Add server","mcp.action.close":"Close MCP","mcp.action.dismiss":"Dismiss","mcp.action.retry":"Retry","mcp.action.disconnect":"Disconnect","mcp.action.disconnecting":"Disconnecting...","mcp.action.stopRecovery":"Stop recovery","mcp.action.connect":"Connect","mcp.action.connecting":"Connecting...","mcp.action.authorizeFirst":"Authorize first","mcp.action.delete":"Delete","mcp.action.cancel":"Cancel","mcp.action.deleting":"Deleting...","mcp.action.deleteServer":"Delete server","mcp.tab.installed":"Installed ({count})","mcp.tab.catalog":"Catalog","mcp.servers.title":"Servers","mcp.servers.searchAria":"Search installed MCP servers","mcp.servers.searchPlaceholder":"Search servers...","mcp.servers.loading":"Loading servers...","mcp.servers.noMatch":"No servers match your search","mcp.servers.none":"No MCP servers configured","mcp.server.errorLabel":"Error: {error}","mcp.server.deleteAria":"Delete {name}","mcp.server.selectPrompt":"Select a server to view details","mcp.instructions.title":"Server instructions","mcp.instructions.detailsOmittedByPolicy":"[details omitted by runtime policy]","mcp.instructions.detailsOmitted":"Details omitted","mcp.instructions.truncated":"Truncated to the safe display budget","mcp.tasks.title":"Experimental MCP Tasks","mcp.tasks.summary":"{count} per Session · {interval}ms poll","mcp.tasks.disabledByDefault":"Disabled by default","mcp.tasks.enabled":"Enabled","mcp.tasks.disabled":"Disabled","mcp.oauth.signingOut":"Signing out...","mcp.oauth.signOut":"Sign out","mcp.oauth.continueAuthorization":"Continue authorization","mcp.oauth.resumeAuthorization":"Resume authorization","mcp.oauth.opening":"Opening...","mcp.oauth.authorize":"Authorize","mcp.delete.confirm":"Remove this server and its saved configuration?","mcp.tools.title":"Tools ({count})","mcp.tools.none":"No tools available","mcp.completion.title":"Argument completion","mcp.completion.connectPrompt":"Connect the server to request suggestions","mcp.completion.unsupported":"Server does not advertise MCP completions","mcp.completion.noTargets":"No completable prompt arguments or template variables","mcp.completion.targetAria":"MCP completion target","mcp.completion.partialAria":"MCP completion partial value","mcp.completion.partialPlaceholder":"Partial value","mcp.completion.completing":"Completing...","mcp.completion.complete":"Complete","mcp.completion.suggestionsAria":"MCP completion suggestions","mcp.completion.empty":"[empty]","mcp.completion.noSuggestions":"No suggestions","mcp.meta.truncatedSuffix":" · truncated","mcp.meta.detailsOmittedSuffix":" · details omitted","mcp.diagnostics.title":"Diagnostics","mcp.diagnostics.refreshAria":"Refresh {name} MCP logs","mcp.diagnostics.logsAria":"{name} MCP logs","mcp.log.levelAria":"MCP logging level","mcp.log.setting":"Setting...","mcp.log.loading":"Loading logs...","mcp.log.none":"No logs captured","mcp.catalog.searchAria":"Search MCP server catalog","mcp.catalog.searchPlaceholder":"Search MCP servers on npm (min 3 chars)...","mcp.catalog.retry":"Retry catalog","mcp.catalog.noDescription":"No description","mcp.catalog.byAuthor":"by {author}","mcp.catalog.installed":"Installed","mcp.catalog.installing":"Installing...","mcp.catalog.install":"Install","mcp.catalog.noPackages":"No packages found","mcp.catalog.noMore":"No more packages","mcp.catalog.packagesFound":"{count} packages found","mcp.catalog.browseGlama":"Browse more on Glama","mcp.error.connectFailed":"Failed to connect server","mcp.error.disconnectFailed":"Failed to disconnect server","mcp.error.deleteFailed":"Failed to delete server","mcp.error.loginFailed":"Failed to login MCP OAuth","mcp.error.logoutFailed":"Failed to logout MCP OAuth","mcp.error.loggingLevelFailed":"Failed to set MCP logging level","mcp.error.completionFailed":"MCP completion failed","mcp.add.title":"Add MCP Server","mcp.add.closeAria":"Close add MCP server","mcp.add.modeForm":"Form","mcp.add.jsonConfig":"JSON config","mcp.add.jsonConfigAria":"JSON configuration","mcp.add.serverName":"Server name","mcp.add.command":"Command","mcp.add.commandAria":"Server command","mcp.add.argsLabel":"Arguments (space separated)","mcp.add.argsAria":"Server arguments","mcp.add.invalidJson":"Enter valid JSON with a server name and transport.","mcp.add.nameCommandRequired":"Name and command are required.","mcp.add.adding":"Adding...","mcp.add.submit":"Add Server","mcp.install.title":"Install MCP Server","mcp.install.titleWithName":"Install {name}","mcp.install.closeAria":"Close MCP installation","mcp.install.args":"Arguments","mcp.install.commandPreview":"Command: npx {args}","mcp.install.nameRequired":"Server name is required.","skills.title":"Skills","skills.action.install":"Install skill","skills.action.installShort":"Install","skills.action.refreshAria":"Refresh skills","skills.action.closeAria":"Close skills","skills.action.dismiss":"Dismiss","skills.action.retry":"Retry","skills.action.cancel":"Cancel","skills.action.close":"Close","skills.action.hide":"Hide","skills.action.enable":"Enable","skills.action.disable":"Disable","skills.action.saving":"Saving...","skills.status.enabled":"Enabled","skills.status.disabled":"Disabled","skills.status.installed":"Installed","skills.noDescriptionShort":"No description","skills.noDescription":"No description available","skills.installed.title":"Installed","skills.installed.searchAria":"Search installed skills","skills.installed.searchPlaceholder":"Search skills...","skills.installed.loading":"Loading skills...","skills.installed.noMatch":"No skills match your search","skills.installed.empty":"No skills installed","skills.uninstall.managedHint":"Only Blade user skills can be uninstalled","skills.uninstall.managed":"Managed","skills.uninstall.action":"Uninstall","skills.uninstall.confirmAria":"Uninstall {name}","skills.uninstall.confirmPrompt":"Remove this skill from ~/.blade/skills?","skills.uninstall.inProgress":"Uninstalling...","skills.uninstall.confirm":"Uninstall skill","skills.details.title":"Details","skills.details.provider":"Provider","skills.details.location":"Location","skills.details.capabilities":"Capabilities","skills.details.allowedTools":"Allowed Tools ({count})","skills.detail.emptyState":"Select a skill to view details","skills.install.title":"Install Skill","skills.install.closeAria":"Close skill installation","skills.install.tab.catalog":"Catalog","skills.install.tab.repo":"Repo","skills.install.tab.local":"Local","skills.install.catalog.searchAria":"Search skill catalog","skills.install.catalog.searchPlaceholder":"Search catalog...","skills.install.catalog.loading":"Loading catalog...","skills.install.catalog.empty":"No skills found","skills.install.catalog.byAuthor":"by {author}","skills.install.catalog.tag.official":"Official","skills.install.catalog.tag.popular":"Popular","skills.install.catalog.tag.community":"Community","skills.install.repo.label":"GitHub URL","skills.install.repo.inputAria":"Skill repository URL","skills.install.repo.credentialsHint":"Uses Git credentials available to the Blade process","skills.install.local.label":"Local path","skills.install.local.inputAria":"Local skill path","skills.status.dialogTitle":"Install Status","skills.status.confirm.title":"Confirm Install","skills.status.confirm.prompt":"Install selected skill?","skills.status.installing.title":"Installing","skills.status.installing.description":"Downloading and verifying…","skills.status.failed.title":"Install Failed","skills.status.failed.fallback":"Installation failed.","skills.status.failed.hint":"Check access and try again.","skills.error.deleteFailed":"Failed to delete skill","skills.error.toggleFailed":"Failed to toggle skill","skills.error.installFailed":"Failed to install skill","schedule.title":"Scheduled Tasks","schedule.description":"Run headless task prompts automatically on a cron, interval, or one-time trigger.","schedule.new":"New schedule","schedule.newAria":"Create a new schedule","schedule.refresh":"Refresh","schedule.reloadAria":"Reload schedules","schedule.create":"Create","schedule.save":"Save","schedule.cancel":"Cancel","schedule.confirmDelete":"Confirm?","schedule.empty":"No schedules yet","schedule.enabled":"Enabled","schedule.disabled":"Disabled","schedule.never":"never","schedule.nextRun":"Next run","schedule.lastRun":"Last run","schedule.runCount":"{count} runs","schedule.trigger.kindAria":"Trigger type","schedule.trigger.cron":"Cron","schedule.trigger.interval":"Interval","schedule.trigger.once":"Once","schedule.field.title":"Title (optional)","schedule.field.cron":"Cron expression","schedule.field.interval":"Interval","schedule.field.runAt":"Run at","schedule.field.prompt":"Prompt","schedule.field.project":"Project path","schedule.field.model":"Model (optional)","schedule.field.permissionMode":"Permission mode","schedule.field.isolation":"Isolation","schedule.placeholder.title":"Nightly dependency audit","schedule.placeholder.cron":"0 9 * * 1 (min hour dom mon dow)","schedule.placeholder.interval":"30m / 2h / 1d","schedule.placeholder.prompt":"Describe the task to run…","schedule.placeholder.project":"/path/to/project","schedule.placeholder.model":"e.g. anthropic/claude-sonnet","schedule.model.current":"Use current model","schedule.permission.default":"Default","schedule.permission.autoEdit":"Auto edit","schedule.permission.yolo":"Yolo","schedule.permission.plan":"Plan","schedule.isolation.local":"Local","schedule.isolation.worktree":"Worktree","schedule.cadence.cron":"cron: {expr}","schedule.cadence.interval":"every {interval}","schedule.cadence.once":"once at {time}","schedule.status.queued":"queued","schedule.status.running":"running","schedule.status.completed":"completed","schedule.status.failed":"failed","schedule.status.cancelled":"cancelled","schedule.status.interrupted":"interrupted","schedule.status.error":"error","schedule.status.never":"no runs yet","schedule.runNowAria":'Run "{title}" now',"schedule.editAria":'Edit "{title}"',"schedule.deleteAria":'Delete "{title}"',"schedule.enableAria":'Enable "{title}"',"schedule.disableAria":'Disable "{title}"',"schedule.error.promptRequired":"A prompt is required.","schedule.error.projectRequired":"A project path is required.","schedule.error.cronRequired":"A cron expression is required.","schedule.error.invalidInterval":"Enter an interval like 30m, 2h, or 1d.","schedule.error.runAtRequired":"Pick a valid run time.","schedule.error.loadFailed":"Failed to load scheduled tasks.","schedule.error.createFailed":"Failed to create scheduled task.","schedule.error.updateFailed":"Failed to update scheduled task.","schedule.error.deleteFailed":"Failed to delete scheduled task.","schedule.error.toggleFailed":"Failed to change scheduled task status.","schedule.error.runFailed":"Failed to run scheduled task."},cw={"app.restoring":"正在恢复工作区…","layout.workspace.pathAria":"工作区路径","layout.workspace.empty":"未选择工作区","layout.action.rewind":"回溯会话","layout.action.openNavigation":"打开导航","terminal.title":"终端","terminal.status.connected":"终端已连接","terminal.status.disconnected":"终端未连接","terminal.action.minimize":"最小化终端","terminal.action.restore":"恢复终端","terminal.action.close":"关闭终端","sidebar.brand.badge":"网页版","sidebar.action.collapse":"收起侧边栏","sidebar.action.expand":"展开侧边栏","sidebar.navigationAria":"任务导航","sidebar.action.newTask":"新建任务","sidebar.action.newTaskShort":"新建任务","sidebar.action.taskBoard":"任务看板","sidebar.action.terminal":"终端","sidebar.action.terminalToggle":"切换终端","sidebar.action.searchTasks":"搜索任务","sidebar.unreadTasks":"{count} 个未读任务","sidebar.section.skills":"技能","sidebar.section.mcp":"MCP","sidebar.section.settings":"设置","sidebar.status.user":"用户","sidebar.status.feedLive":"任务通道已连接","sidebar.status.feedOffline":"任务通道未连接","sidebar.empty.title":"暂无任务","sidebar.empty.hint":"在主页派发新任务","sidebar.group.running":"进行中","sidebar.group.queued":"排队中","sidebar.group.interrupted":"已暂停","sidebar.group.failed":"已失败","sidebar.group.cancelled":"已取消","sidebar.group.done":"已完成","sidebar.group.showMore":"再显示 {count} 条","sidebar.group.showLess":"收起","sidebar.view.project":"项目","sidebar.view.status":"状态","sidebar.view.projectAria":"按项目分组会话","sidebar.view.statusAria":"按状态分组会话","sidebar.project.active":"当前","sidebar.project.expand":"展开 {name}","sidebar.project.collapse":"收起 {name}","sidebar.project.newTask":"在 {name} 中新建任务","sidebar.project.reorder":"调整 {name} 的顺序,当前位置 {position}/{count}","sidebar.project.reorderHint":"拖拽调整顺序,或使用上下方向键移动","sidebar.project.reordered":"已将 {name} 移到第 {position} 位","sidebar.project.projects":"项目","sidebar.catalog.syncing":"正在同步任务历史…","sidebar.catalog.loaded":"已载入 {count} 条","sidebar.catalog.incomplete":"任务历史未完整加载","sidebar.catalog.retry":"重试","projects.dialog.title":"项目","projects.dialog.description":"绑定本地目录,无需重启 Blade 即可切换任务上下文。","projects.bind.placeholder":"/项目的绝对路径","projects.bind.pathLabel":"项目路径","projects.bind.action":"绑定","projects.bind.failed":"项目绑定失败","projects.pick.action":"选择项目文件夹","projects.pick.actionShort":"选择","projects.pick.picking":"选择中…","projects.pick.failed":"无法选择项目文件夹","projects.unbind.action":"解除项目绑定","projects.unavailable":"目录不可用","sidebar.language.label":"语言","sidebar.language.aria":"切换语言","sidebar.language.en":"EN","sidebar.language.zh":"中","session.env.worktree":"独立分支","session.env.local":"本地","session.action.select":"选择「{title}」","session.action.save":"保存「{title}」","session.action.cancel":"取消「{title}」","session.action.more":"「{title}」的更多操作","session.action.fork":"派生「{title}」","session.action.forkShort":"派生","session.action.rename":"重命名「{title}」","session.action.renameShort":"重命名","session.action.archive":"归档「{title}」","session.action.archiveShort":"归档","session.action.export":"将「{title}」导出为 Markdown","session.action.exportShort":"导出 Markdown","session.action.exportingShort":"正在导出…","session.action.delete":"删除「{title}」","session.action.deleteShort":"删除","session.action.stop":"停止「{title}」","session.action.stopping":"正在停止「{title}」","session.action.retry":"重试「{title}」","session.action.retrying":"正在重试「{title}」","session.reason.cancelledByUser":"已由用户取消","session.title.codeReview":"代码评审","session.forkedFrom":"派生自","session.retriedFrom":"重试自","session.retryShort":"重试","session.queued":"排队 #{position}/{depth}","archive.title":"归档","archive.subtitle":"安全保留,不占用当前任务列表","archive.open":"打开会话归档","archive.refresh":"刷新归档会话","archive.retry":"重试","archive.loading":"正在载入归档…","archive.empty":"暂无归档会话","archive.restore":"恢复「{title}」","archive.restoreShort":"恢复","archive.restoreAncestor":"请先恢复归档根会话","archive.inherited":"随 {id} 一同归档","taskSwitcher.title":"任务切换器","taskSwitcher.description":"跨项目搜索并打开任务。","taskSwitcher.searchAria":"搜索任务","taskSwitcher.placeholder":"搜索标题、项目、分支、状态或 Session ID…","taskSwitcher.results":"{count} 个结果","taskSwitcher.recent":"最近任务","taskSwitcher.scope":"已索引 {count} 个任务","taskSwitcher.indexing":"正在索引任务…","taskSwitcher.resultsAria":"任务搜索结果","taskSwitcher.current":"当前","taskSwitcher.unread":"{count} 个未读","taskSwitcher.needsAction":"{count} 个需要操作","taskSwitcher.new":"新","taskSwitcher.empty":"没有匹配的任务","taskSwitcher.emptyHint":"尝试项目、分支、状态或更短的关键词。","taskSwitcher.hint.navigate":"选择","taskSwitcher.hint.open":"打开","taskSwitcher.hint.toggle":"切换","taskSwitcher.action.failed":"任务操作失败","commandCenter.title":"命令中心","commandCenter.description":"搜索任务,或执行工作区与应用操作。","commandCenter.searchAria":"搜索操作","commandCenter.placeholder":"搜索操作、设置或工具…","commandCenter.modeAria":"命令中心模式","commandCenter.mode.tasks":"任务","commandCenter.mode.commands":"操作","commandCenter.actions":"{count} 个操作","commandCenter.resultsAria":"操作搜索结果","commandCenter.empty":"没有匹配的操作","commandCenter.emptyHint":"尝试工具、面板或设置名称。","commandCenter.action.newTask":"新建任务","commandCenter.action.newTaskDescription":"打开一个干净的任务编辑器","commandCenter.action.preview":"切换预览区","commandCenter.action.previewDescription":"审查文件、Diff、运行日志与网页","commandCenter.action.terminal":"切换终端","commandCenter.action.terminalDescription":"打开或关闭工作区 Shell","commandCenter.action.settings":"打开设置","commandCenter.action.settingsDescription":"配置外观与行为","commandCenter.action.models":"配置模型","commandCenter.action.modelsDescription":"选择 Provider 与任务模型","commandCenter.action.shortcuts":"查看键盘快捷键","commandCenter.action.shortcutsDescription":"浏览全局与上下文按键","commandCenter.action.skills":"管理 Skills","commandCenter.action.skillsDescription":"发现并配置 Agent 能力","commandCenter.action.mcp":"管理 MCP Server","commandCenter.action.mcpDescription":"配置已连接的工具与服务","commandCenter.action.sidebar":"切换侧边栏","commandCenter.action.sidebarDescription":"显示或隐藏项目导航","taskHome.eyebrow":"任务调度台 · 就绪","taskHome.feed.connecting":"任务调度台 · 正在连接","taskHome.feed.reconnecting":"任务调度台 · 正在重连","taskHome.feed.offline":"任务调度台 · 已离线","taskHome.feed.offlineDescription":"实时任务更新已暂停,服务端正在运行的任务不会停止。","taskHome.feed.retry":"重新连接","taskHome.hero.prefix":"要在这里让 Blade 做点什么:","taskHome.hero.projectFallback":"当前工作区","taskHome.hero.subtitle":"派发一个任务后即可继续手头的工作。每个任务在独立的 worktree 中运行、状态持久保存,完成时会以可复核的工作区形式返回。","taskHome.templates.title":"模板","taskHome.templates.hint":"按 1–4 快速填充","taskHome.template.explore.title":"探索","taskHome.template.explore.description":"追踪行为,梳理系统全貌","taskHome.template.explore.hint":"调用链 · 模块结构","taskHome.template.build.title":"开发","taskHome.template.build.description":"实现一个可上线的功能","taskHome.template.build.hint":"端到端交付特性","taskHome.template.review.title":"评审","taskHome.template.review.description":"找出正确性与回归风险","taskHome.template.review.hint":"审查当前改动","taskHome.review.attachmentsUnsupported":"代码评审不支持附件","taskHome.review.outputSchemaUnsupported":"代码评审使用内置结构化报告 Schema","taskHome.review.usage":"用法:/review [uncommitted | base <ref> | commit <sha>]","taskHome.review.running":"只读代码评审正在进行","taskHome.review.stale":"评审期间目标已发生变化","taskHome.review.aborted":"代码评审已中止","taskHome.review.interrupted":"代码评审因进程重启而中断","taskHome.review.failed":"代码评审失败","taskHome.review.startFailed":"启动代码评审失败","taskHome.review.invalidTarget":"评审目标无效或没有可评审的改动","taskHome.review.conflict":"当前会话已有任务正在运行","taskHome.template.fix.title":"修复","taskHome.template.fix.description":"定位并修好一个具体故障","taskHome.template.fix.hint":"二分 · 复现 · 打补丁","taskHome.context.isolationToggleTitle":"切换任务隔离方式","taskHome.context.projectSelect":"选择目标项目","taskHome.context.isolation.worktree":"独立 worktree","taskHome.context.isolation.local":"本地工作区","taskHome.context.branchFallback":"无分支","taskHome.context.preparing":"正在准备 worktree","taskHome.setup.aria":"任务准备状态","taskHome.setup.title":"完成准备","taskHome.setup.description":"你可以继续编辑草稿,Blade 正在核对工作区和模型。","taskHome.setup.workspace.title":"工作区","taskHome.setup.workspace.loading":"正在检查可用工作区…","taskHome.setup.workspace.ready":"已选择 {project}","taskHome.setup.workspace.required":"选择一个可用项目","taskHome.setup.workspace.empty":"无项目","taskHome.setup.workspace.action":"选择","taskHome.setup.workspace.retry":"重新加载工作区","taskHome.setup.model.title":"模型","taskHome.setup.model.loading":"正在检查配置…","taskHome.setup.model.ready":"可用于当前任务","taskHome.setup.model.required":"配置或选择一个模型","taskHome.setup.model.action":"配置","taskHome.setup.model.retry":"重试","taskHome.composer.placeholder":"描述目标、约束以及你期望的验收方式……","taskHome.error.dismiss":"关闭","taskHome.recent.title":"最近任务","taskHome.recent.total":"共 {count} 条","taskHome.recent.partial":"已载入 {count} 条 · 继续同步","taskHome.recent.incomplete":"已载入 {count} 条 · 历史不完整","taskSwitcher.indexingLoaded":"已载入 {count} 条 · 正在同步历史","taskHome.footer.note":"独立 worktree 让并行任务不会干扰你当前的工作副本","kanban.title":"任务看板","kanban.subtitle":"跨项目派发任务,优先处理需要人工介入的工作。","kanban.taskCount":"{count} 个任务","kanban.searchAria":"搜索任务看板","kanban.searchPlaceholder":"搜索任务…","kanban.projectFilterAria":"按项目筛选任务看板","kanban.projectAll":"全部项目","kanban.feed.offline":"实时更新已离线,服务端运行中的任务不会停止。","kanban.autoClaim.running":"自动认领中","kanban.autoClaim.paused":"自动认领已暂停","kanban.column.waiting":"等待认领","kanban.column.waitingDescription":"等待可用的执行槽位","kanban.column.active":"处理中","kanban.column.activeDescription":"Agent 正在执行任务","kanban.column.blocked":"遇到阻碍","kanban.column.blockedDescription":"需要输入、重试或人工处理","kanban.column.review":"等你确认","kanban.column.reviewDescription":"已完成,等待验收归档","kanban.column.empty":"此阶段暂无任务","kanban.priority.high":"高优先级","kanban.priority.medium":"中优先级","kanban.priority.low":"低优先级","kanban.kind.feature":"新功能","kanban.kind.bug":"缺陷","kanban.kind.maintenance":"维护","kanban.kind.research":"调研","kanban.card.unread":"有新的任务更新","kanban.card.queuePosition":"队列第 {position}/{depth} 位","kanban.card.diff":"{files} 个文件 · +{additions} −{deletions}","kanban.action.newTask":"新建任务","kanban.action.open":"打开任务","kanban.action.respond":"处理阻碍","kanban.action.inspect":"验收变更","kanban.action.edit":"编辑任务信息","kanban.action.cancel":"取消任务","kanban.action.retry":"重试任务","kanban.action.archive":"验收并归档","kanban.dialog.createTitle":"派发任务","kanban.dialog.createDescription":"任务会直接在选定项目的本地工作区中执行。","kanban.dialog.editTitle":"编辑任务","kanban.dialog.editDescription":"更新计划信息,不会中断正在执行的 Agent。","kanban.dialog.localExecution":"本地工作区 · 不使用 worktree 隔离","kanban.dialog.cancel":"取消","kanban.dialog.dispatch":"派发","kanban.dialog.save":"保存","kanban.dialog.submitFailed":"任务操作失败","kanban.field.title":"标题","kanban.field.titlePlaceholder":"可选的简短任务标题","kanban.field.prompt":"任务说明","kanban.field.promptPlaceholder":"描述目标、约束以及预期的验收方式…","kanban.field.project":"项目","kanban.field.kind":"类型","kanban.field.priority":"优先级","kanban.field.dueAt":"截止时间","capacity.title":"{inFlight} 进行中 · {queued} 排队 · 上限 {max}","capacity.suffix.running":" 进行中","capacity.queued":"排队 {queued}","recent.status.running":"进行中","recent.status.queued":"排队中","recent.status.paused":"已暂停","recent.status.failed":"已失败","recent.status.cancelled":"已取消","recent.status.done":"已完成","recent.time.justNow":"刚刚","recent.time.minutes":"{n} 分钟前","recent.time.hours":"{n} 小时前","recent.time.days":"{n} 天前","recent.session.fallbackShort":"会话 {id}","recent.session.fallbackDated":"会话 {y}-{m}-{d} {hh}:{mm}","attention.unreadAnnouncement":"{count} 个未读任务更新","attention.notification.completed":"任务已完成","attention.notification.failed":"任务失败","attention.notification.interrupted":"任务已中断","attention.notification.permission":"需要审批","attention.notification.question":"需要回答","attention.notification.elicitation":"MCP 需要输入","interaction.permission.title":"需要授权:{tool}","interaction.permission.once":"仅本次允许","interaction.permission.session":"本会话允许","interaction.permission.project":"本项目允许","interaction.permission.deny":"拒绝","interaction.permission.failed":"授权响应失败","interaction.question.answered":"问题已回答","interaction.question.other":"其他","interaction.question.submit":"提交回答","interaction.question.failed":"回答提交失败","interaction.elicitation.title":"MCP 请求输入","interaction.elicitation.submit":"提交给 MCP","interaction.elicitation.open":"打开外部链接","interaction.elicitation.decline":"拒绝","interaction.elicitation.cancel":"取消","interaction.elicitation.responded":"已响应 MCP 请求","interaction.elicitation.cancelled":"MCP 请求已取消","interaction.elicitation.failed":"响应 MCP 请求失败","interaction.elicitation.warning":"仅在信任该 MCP 服务器并理解请求用途时继续。","interaction.bar.permissionTitle":"Agent 正在等待审批","interaction.bar.permissionHint":"请检查待处理的工具请求,审批后任务才会继续。","interaction.bar.questionTitle":"Agent 正在等待回答","interaction.bar.questionHint":"请回答待处理的问题,任务才能继续。","interaction.bar.elicitationTitle":"MCP 服务器正在等待输入","interaction.bar.elicitationHint":"请检查 MCP 请求,响应后任务才会继续。","interaction.bar.review":"查看请求","interaction.badge.permission":"需要审批","interaction.badge.question":"需要回答","interaction.badge.elicitation":"MCP 输入","artifact.env.isolated":"独立分支","artifact.env.local":"本地","artifact.review":"查看变更","artifact.commits":"{count} 次提交","artifact.apply":"应用","artifact.retryApply":"重新应用","artifact.applying":"应用中","artifact.applied":"已应用","artifact.discard":"丢弃任务变更","artifact.discarded":"已丢弃","artifact.conflict":"任务变更无法安全应用。","artifact.conflictHint":"隔离变更已保留。请查看变更、处理源项目状态,然后重试或丢弃。","artifact.discardDialog.title":"丢弃隔离变更?","artifact.discardDialog.description":"将删除 {project} 隔离任务工作区中的 {count} 个变更文件。","artifact.discardDialog.warning":"此操作会永久删除任务 worktree 和分支,不会修改源项目。","artifact.discardDialog.cancel":"保留变更","artifact.discardDialog.confirm":"丢弃变更","chat.list.empty.eyebrow":"Blade · 就绪","chat.list.empty.title":"发送一条消息开始对话","chat.list.empty.hint":"提问、描述改动,或者粘贴一段错误堆栈。","chat.list.loading.eyebrow":"历史对话","chat.list.loading.title":"正在恢复对话…","chat.list.loading.hint":"正在加载消息、任务状态和实时更新。对话较长时可能需要一点时间。","chat.list.showEarlier":"显示更早的 {count} 条消息","chat.list.showEarlierWithRemaining":"显示更早的 {count} 条消息,当前隐藏 {remaining} 条","chat.list.jumpLatest":"回到最新消息","chat.turns.aria":"跳转到之前的消息","chat.turns.label":"第 {n} 轮","chat.timeline.thinking":"思考过程","chat.timeline.tools.runningOne":"正在执行 1 条命令","chat.timeline.tools.running":"正在执行 {count} 条命令","chat.timeline.tools.completedOne":"已执行 1 条命令","chat.timeline.tools.completed":"已执行 {count} 条命令","chat.timeline.tools.completedOneWithError":"已执行 1 条命令 · 执行失败","chat.timeline.tools.completedWithErrors":"已执行 {count} 条命令 · {errors} 条失败","chat.error.dismiss":"关闭错误","chat.error.queueFull":"指令队列已满。请等待已有指令开始执行后重试。","chat.error.turnChanged":"当前轮次已发生变化,此消息尚未接收。请确认内容后重试。","chat.error.title.submission":"消息未发送。","chat.error.title.execution":"本轮运行已停止。","chat.error.title.navigation":"未能打开任务。","chat.error.title.generic":"操作失败。","chat.error.action.returnDraft":"返回草稿","chat.error.action.editResend":"编辑后重发","chat.error.action.retryTask":"重试任务","chat.error.action.retryingTask":"正在重试…","chat.error.action.checkModels":"检查模型设置","task.failure.authentication":"模型服务认证失败,请检查模型凭据。","task.failure.permission":"模型服务拒绝了请求,请检查账号和模型权限。","task.failure.rateLimit":"模型服务达到速率或额度限制。","task.failure.timeout":"模型服务请求超时。","task.failure.network":"无法连接模型服务。","task.failure.modelUnavailable":"当前选择的模型不可用。","task.failure.contextLimit":"请求超出模型上下文限制。","task.failure.unsupportedInput":"当前模型不支持此类输入。","task.failure.capacity":"任务准入容量已满,请在运行中的任务完成后重试。","task.failure.runtime":"Agent 运行失败。","chat.connection.reconnecting":"正在恢复实时更新,当前任务仍在后台继续运行。","chat.connection.offline":"实时更新已离线,当前显示的进度可能已经过期。","chat.connection.retry":"重新连接","chat.side.title":"旁路对话","chat.side.loading":"正在回答旁路问题……","chat.side.failed":"旁路对话失败。","chat.side.dismiss":"关闭旁路对话","chat.footer.disclaimer":"Blade 可能会出错,请核对重要信息。","chat.input.placeholder.default":"输入 @ 提及文件,/ 触发命令……","chat.input.placeholder.steering":"添加指令来引导当前轮次……","chat.input.steering.status":"当前轮次可被引导","chat.input.steering.queued":"引导指令已接收 · 待处理 {count} 条","chat.input.steering.enterHint":" · 回车下发指令","chat.input.followUp.queued":"后续指令已接收 · 下一轮排队 {count} 条","chat.input.steering.recoveredOne":"重启后已恢复 {count} 条排队指令","chat.input.steering.recoveredMany":"重启后已恢复 {count} 条排队指令","chat.input.attachment.add":"添加图片","chat.input.attachment.remove":"移除","chat.input.attachment.countLimit":"最多可添加 {count} 张图片。","chat.input.attachment.sizeLimit":"图片编码后总大小不能超过 {size},请移除图片或选择更小的文件。","chat.input.attachment.readFailed":"Blade 无法读取其中一张图片。","chat.input.attachment.usage":"{count}/{limit} 张图片 · 已用 {used} / {budget}","chat.input.attachment.modelUnsupported":"{model} 不支持图片输入,请选择视觉模型或移除图片。","chat.input.attachment.modelRequired":"请先选择支持图片输入的视觉模型。","chat.input.model.placeholder":"选择模型","chat.input.model.empty":"未配置模型","chat.input.model.vision":"视觉","chat.input.model.change":"切换模型","chat.input.model.locked":"请等待当前轮次结束后再切换模型","chat.input.effort.label":"推理 {effort}","chat.input.effort.heading":"推理强度","chat.input.effort.change":"切换推理强度","chat.input.effort.locked":"请等待当前轮次结束后再切换推理强度","chat.input.effort.option":"使用 {effort} 推理强度","chat.input.serviceTier.label":"速度 {tier}","chat.input.serviceTier.heading":"Provider 服务等级","chat.input.serviceTier.change":"切换 Provider 服务等级","chat.input.serviceTier.locked":"请等待当前轮次结束后再切换服务等级","chat.input.serviceTier.option":"使用 {tier} 服务等级","chat.input.serviceTier.fastHint":"优先通道","chat.input.serviceTier.flexHint":"低成本","chat.input.responseVerbosity.label":"输出 {verbosity}","chat.input.responseVerbosity.heading":"响应详略","chat.input.responseVerbosity.change":"切换响应详略","chat.input.responseVerbosity.locked":"请等待当前轮次结束后再切换响应详略","chat.input.responseVerbosity.option":"使用 {verbosity} 响应详略","chat.input.responseVerbosity.autoHint":"模型默认","chat.input.outputSchema.title":"结构化输出","chat.input.outputSchema.description":"要求本轮最终返回符合该 JSON Schema 的对象。","chat.input.outputSchema.change":"设置结构化输出 Schema","chat.input.outputSchema.locked":"请等待当前轮次结束后再修改输出 Schema","chat.input.outputSchema.editor":"JSON Schema 编辑器","chat.input.outputSchema.placeholder":"粘贴 JSON Schema 对象","chat.input.outputSchema.example":"使用示例","chat.input.outputSchema.clear":"清除","chat.input.outputSchema.invalid":"请输入有效的 JSON 对象;完整 Schema 将由服务端校验。","chat.input.outputSchema.shellUnsupported":"结构化输出不能与 Shell 命令同时使用。","chat.structuredOutput.title":"结构化输出","chat.structuredOutput.copy":"复制结构化输出","chat.input.communicationStyle.label":"风格 {style}","chat.input.communicationStyle.heading":"沟通风格","chat.input.communicationStyle.change":"切换沟通风格","chat.input.communicationStyle.locked":"请等待当前轮次结束后再切换沟通风格","chat.input.communicationStyle.option":"使用 {style} 沟通风格","chat.input.communicationStyle.autoHint":"Blade 默认","chat.input.communicationStyle.pragmaticHint":"直接","chat.input.communicationStyle.friendlyHint":"协作","chat.input.communicationStyle.explanatoryHint":"解释取舍","chat.notice.dismiss":"关闭提示","chat.input.mode.default":"手动审批","chat.input.mode.default.desc":"每个重要操作都需要你的批准","chat.input.mode.autoEdit":"自动审批","chat.input.mode.autoEdit.desc":"让 AI 审核并批准重要操作","chat.input.mode.yolo":"完全访问","chat.input.mode.yolo.desc":"无需询问,直接在你的电脑上运行","chat.input.mode.yolo.confirm.title":"启用完全访问模式?","chat.input.mode.yolo.confirm.desc":"在此模式下,Agent 将直接执行所有操作(包括文件写入、Shell 命令和网络请求)而不请求许可。仅在你信任当前上下文时启用。","chat.input.mode.yolo.confirm.cancel":"取消","chat.input.mode.yolo.confirm.accept":"启用","chat.input.mode.plan":"计划","chat.input.mode.plan.desc":"先拟定计划,暂不做任何改动","chat.input.mode.aria":"Agent 操作审批","chat.input.action.stop":"停止当前轮次","chat.input.action.stopping":"正在停止当前轮次","chat.input.action.steer":"引导当前轮次","chat.input.action.send":"发送消息","chat.input.action.submitting":"正在提交消息","chat.review.title":"代码评审","chat.review.target":"目标","chat.review.target.uncommitted":"未提交改动","chat.review.target.base":"相对 {ref} 的改动","chat.review.target.commit":"提交 {ref}","chat.review.status":"状态","chat.review.status.completed":"已完成","chat.review.status.stale":"已过期","chat.review.status.failed":"失败","chat.review.status.aborted":"已中止","chat.review.status.interrupted":"已中断","chat.review.findings":"问题","chat.review.noFindings":"未发现可执行问题","chat.review.confidence":"置信度 {value}","chat.review.error":"错误","chat.subagent.resumedFromTitle":"从 {id} 恢复","chat.subagent.resumedDepth":"已恢复 · 层级 {depth}","chat.subagent.loadingLogs":"正在加载子智能体日志…","chat.subagent.resumedAs":"已恢复为 {id} · {status} · 层级 {depth}","chat.subagent.resume":"恢复","chat.subagent.resumeAria":"恢复子智能体","chat.subagent.followUpAria":"子智能体后续指令","chat.subagent.followUpPlaceholder":"描述需要继续处理的工作","chat.subagent.cancel":"取消","chat.subagent.resumeAgent":"恢复智能体","chat.subagent.resumeFailed":"恢复子智能体失败","chat.markdown.copyCode":"复制代码","chat.rewind.title":"回溯会话","chat.rewind.description":"返回到某条用户消息之前的节点。","chat.rewind.loading":"正在加载检查点","chat.rewind.empty":"暂无可回溯的检查点","chat.rewind.checkpointAria":"回溯检查点","chat.rewind.userMessage":"用户消息","chat.rewind.fileCountOne":"{count} 个文件","chat.rewind.fileCountMany":"{count} 个文件","chat.rewind.restoreCode":"恢复代码变更","chat.rewind.restoreCodeHint":"回滚此检查点及之后更改的文件。","chat.rewind.cancel":"取消","chat.rewind.confirm":"回溯","chat.rewind.loadFailed":"加载回溯检查点失败","chat.rewind.failed":"回溯失败。请检查会话错误后重试。","status.context":"上下文","status.tokenLimitTooltip":"此为估算的 token 上限,模型回报上下文尺寸后会自动更新。","status.cache":"缓存","status.cacheTooltip":"本会话缓存读取输入占模型总输入的比例。","status.cacheDetails":"读取 {read} · 写入 {write} · 未缓存 {uncached}","status.cacheUnavailable":"Provider 尚未回报本会话的提示词缓存用量。","status.cacheBreak":"最近一次缓存中断:{reason} · 缓存读取 {previous} → {current}","status.cacheBreak.model":"模型发生变化","status.cacheBreak.system":"系统提示词发生变化","status.cacheBreak.tools":"工具定义发生变化","status.cacheBreak.policy":"请求策略发生变化","status.cacheBreak.ttl":"缓存 TTL 已过期","status.cacheBreak.server":"可能是 Provider 路由或缓存淘汰","status.phase.running":"生成中…","status.phase.providerStall":"Provider 流暂无数据","status.phase.actionStationarityRecovering":"正在纠正空转","status.phase.actionStationarityStopped":"已停止空转","status.phase.compacting":"正在压缩上下文…","status.phase.recoveringContext":"上下文超限,正在恢复…","status.phase.switchingModel":"正在切换模型…","status.phase.waitingPermission":"等待授权…","status.phase.error":"运行失败","preview.title":"预览","preview.action.resize":"调整预览区宽度","preview.action.close":"关闭预览区","preview.action.retry":"重试","preview.tab.diff":"变更","preview.tab.files":"文件","preview.tab.logs":"日志","preview.tab.browser":"浏览器","preview.diff.loadingTitle":"正在加载任务变更…","preview.diff.loadingHint":"正在读取持久化的 worktree 产物。","preview.diff.failedTitle":"任务变更加载失败","preview.diff.discardedTitle":"变更已丢弃","preview.diff.discardedHint":"隔离工作区已删除,源项目没有被修改。","preview.diff.emptyTitle":"暂无变更","preview.diff.emptyHint":"工具修改文件后,变更会显示在这里。","preview.diff.searchAria":"搜索变更文件","preview.diff.searchPlaceholder":"筛选变更文件…","preview.diff.changedFiles":"{count} 个变更文件","preview.diff.expandAll":"全部展开","preview.diff.collapseAll":"全部收起","preview.diff.showMoreFiles":"再显示 {count} 个文件","preview.diff.showMoreLines":"再显示 {count} 行","preview.diff.noMatches":"没有匹配的变更文件","preview.diff.patch":"补丁","preview.diff.line":"第 {line} 行","preview.files.loadingTitle":"正在加载文件…","preview.files.loadingHint":"正在获取工作区文件树。","preview.files.failedTitle":"文件加载失败","preview.files.emptyTitle":"暂无文件","preview.files.emptyHint":"选择项目后即可加载工作区文件树。","preview.files.treeFailed":"工作区文件树加载失败","preview.files.searchAria":"搜索工作区文件","preview.files.searchPlaceholder":"查找文件…","preview.files.searchResultsAria":"文件搜索结果","preview.files.searchFailed":"工作区文件搜索失败","preview.files.noMatches":"没有匹配的文件","preview.files.directoryLoading":"正在加载目录…","preview.files.directoryEmpty":"空目录","preview.files.selectTitle":"选择要预览的文件","preview.files.status.loading":"加载中…","preview.files.status.truncated":"已截断","preview.files.status.ready":"就绪","preview.files.truncatedNotice":"预览内容已截断至 20 万字符。","preview.files.pickHint":"从文件树中选择一个文件进行预览。","preview.files.contentFailed":"文件加载失败","preview.files.editorLoading":"正在加载编辑器…","preview.logs.searchAria":"搜索工具日志","preview.logs.searchPlaceholder":"搜索工具、摘要或输出…","preview.logs.filterAria":"按状态筛选日志","preview.logs.filter.all":"全部","preview.logs.filter.running":"进行中","preview.logs.filter.error":"失败","preview.logs.filter.success":"成功","preview.logs.noMatches":"没有匹配的日志","preview.logs.noMatchesHint":"尝试其他关键词或状态。","preview.logs.emptyTitle":"暂无日志","preview.logs.emptyHint":"工具运行记录会显示在这里。","preview.logs.expand":"展开","preview.logs.collapse":"收起","preview.logs.showMore":"再显示 {count} 条日志","preview.logs.status.running":"进行中","preview.logs.status.error":"失败","preview.logs.status.success":"成功","goal.aria.section":"目标控制条","goal.status.active":"目标进行中","goal.status.paused":"目标已暂停","goal.status.blocked":"目标已阻塞","goal.status.usageLimited":"用量受限","goal.status.budgetLimited":"预算已达上限","goal.status.complete":"目标已完成","goal.field.objective":"目标描述","goal.action.edit":"编辑目标","goal.action.pause":"暂停目标","goal.action.resume":"恢复目标","goal.action.delete":"删除目标","goal.action.expand":"展开目标详情","goal.action.collapse":"收起目标详情","goal.action.cancel":"取消","goal.action.save":"保存","goal.metrics.tokens":"tokens","goal.metrics.continuationOne":"续跑 {n} 次","goal.metrics.continuationMany":"续跑 {n} 次","goal.dialog.title":"删除此目标?","goal.dialog.description":"仅移除目标状态,会话历史与工作区文件不会受影响。","settings.title":"设置","settings.nav.aria":"设置分区","settings.action.back":"返回","settings.category.settings":"设置","settings.category.integrations":"集成","settings.tab.general":"通用","settings.tab.trust":"安全","settings.tab.models":"模型","settings.tab.shortcuts":"快捷键","settings.tab.mcp":"MCP","settings.tab.skills":"技能","settings.tab.plugins":"插件","settings.tab.hooks":"钩子","settings.tab.schedules":"定时任务","settings.common.retry":"重试","settings.common.dismiss":"忽略","settings.common.cancel":"取消","settings.common.enable":"启用","settings.general.loading":"正在加载设置…","settings.general.loadError":"加载设置失败","settings.general.saveError":"保存设置失败","settings.general.responseLanguage":"回复语言","settings.general.responseLanguageHint":"AI 将使用该语言回复","settings.general.autoSave":"自动保存会话","settings.general.communicationStyle":"沟通风格","settings.general.communicationStyleHint":"决定 Agent 在所有会话中的回复措辞","settings.appearance.heading":"外观","settings.appearance.theme":"主题偏好","settings.appearance.theme.dark":"深色","settings.appearance.theme.light":"浅色","settings.appearance.theme.system":"跟随系统","settings.appearance.compactSidebar":"紧凑侧边栏","settings.appearance.codeTheme":"代码主题","settings.appearance.codeThemeHint":"语法高亮配色","settings.notifications.heading":"通知","settings.notifications.buildFinished":"构建完成","settings.notifications.errorsOnly":"仅错误","settings.notifications.systemSounds":"系统提示音","settings.notifications.blocked":"浏览器通知已被拦截","settings.notifications.unavailable":"当前浏览器不支持通知","settings.notifications.enablePrompt":"在此标签页处于后台时接收提醒","settings.privacy.heading":"隐私","settings.privacy.telemetry":"遥测","settings.privacy.crash":"崩溃报告","settings.models.description":"为不同的服务商配置 API Key 与模型设置。","settings.models.loading":"正在加载模型…","settings.models.loadChannelsFailed":"加载服务商渠道失败","settings.models.saveFailed":"保存模型失败","settings.models.deleteFailed":"删除模型失败","settings.models.updateFailed":"更新模型失败","settings.models.updateChannelFailed":"更新服务商渠道失败","settings.models.probeFailed":"服务商渠道探测失败","settings.models.deleteChannelFailed":"删除服务商渠道失败","settings.models.empty":"尚未配置任何模型","settings.models.add":"+ 添加新模型","settings.models.missingCredential":"缺少凭据","settings.models.configured":"已配置","settings.models.deleting":"正在删除…","settings.models.deleteModel":"删除模型","settings.models.deleteChannel":"删除渠道","settings.models.deleteModelAria":"删除 {name}","settings.models.deleteModelPrompt":"删除 {name} 及其保存的配置?","settings.models.deleteChannelAria":"删除渠道 {name}","settings.models.deleteChannelPrompt":"删除渠道 {name}、其凭据以及 {count} 个已配置模型?相关的兜底引用也会一并移除。","settings.models.editModelAria":"编辑 {name}","settings.models.editChannelAria":"编辑渠道 {name}","settings.models.testChannelAria":"测试 {name}","settings.models.deleteChannelActionAria":"删除渠道 {name}","settings.models.modelCountOne":"{count} 个模型","settings.models.modelCountMany":"{count} 个模型","settings.models.defaultEndpoint":"默认端点","settings.shortcuts.searchPlaceholder":"搜索操作…","settings.shortcuts.scope.all":"全部范围","settings.shortcuts.scope.global":"全局","settings.shortcuts.scope.chat":"聊天","settings.shortcuts.scope.layout":"布局","settings.shortcuts.reset":"重置","settings.shortcuts.col.action":"操作","settings.shortcuts.col.shortcut":"快捷键","settings.shortcuts.col.scope":"范围","settings.shortcuts.empty":"未找到快捷键。","settings.shortcuts.action.searchTasks":"搜索任务","settings.shortcuts.action.openCommands":"打开命令中心","settings.shortcuts.action.newTask":"新建任务","settings.shortcuts.action.focusComposer":"聚焦输入框","settings.shortcuts.action.toggleSidebar":"切换侧边栏","settings.common.reload":"重新加载","settings.trust.state.notRequired":"无需信任","settings.trust.state.trusted":"工作区已信任","settings.trust.state.review":"需要审查","settings.trust.state.error":"信任存储错误","settings.trust.selectSession":"选择一个项目会话以查看文件夹信任。","settings.trust.heading":"工作区信任","settings.trust.inheritedFrom":" · 继承自 {source}","settings.trust.reloadAria":"重新加载工作区信任","settings.trust.revoke":"撤销","settings.trust.trustWorkspace":"信任工作区","settings.trust.restartNotice":"重启 Blade 以重新加载项目模型、MCP、LSP、权限和插件。","settings.trust.revokeAria":"撤销工作区信任","settings.trust.confirmTrust":"允许 {count} 个项目来源配置模型、MCP、LSP、权限、环境、指令、命令、技能、Agent 或插件?","settings.trust.confirmRevoke":"重启后阻止项目控制的可执行配置?","settings.trust.saving":"正在保存…","settings.trust.trustReviewed":"信任已审查的工作区","settings.trust.revokeTrust":"撤销信任","settings.trust.empty":"未找到项目控制的可执行配置。","settings.trust.loadFailed":"加载工作区信任失败","settings.trust.updateFailed":"更新工作区信任失败","settings.hooks.state.disabled":"钩子已禁用","settings.hooks.state.notRequired":"无外部钩子","settings.hooks.state.review":"需要审查","settings.hooks.state.trusted":"已信任","settings.hooks.state.modified":"批准后已变更","settings.hooks.state.error":"信任存储错误","settings.hooks.selectSession":"选择一个项目会话以查看其钩子。","settings.hooks.heading":"钩子信任","settings.hooks.reloadAria":"重新加载钩子信任","settings.hooks.revoke":"撤销","settings.hooks.trustDigest":"信任摘要","settings.hooks.currentSession":"当前会话执行","settings.hooks.session.open":"打开一个会话以控制其钩子。","settings.hooks.session.loading":"正在加载会话状态…","settings.hooks.session.disabled":"已被工作区配置禁用。","settings.hooks.session.paused":"仅在此会话中暂停。","settings.hooks.session.active":"通过信任检查后,钩子可在此会话运行。","settings.hooks.session.unavailable":"已被当前会话 runtime 或宿主策略禁用。","settings.hooks.session.enableAria":"为当前会话启用钩子","settings.hooks.session.pauseAria":"为当前会话暂停钩子","settings.hooks.session.unavailableAria":"当前会话无法使用钩子","settings.hooks.confirmTrustAria":"信任项目钩子","settings.hooks.confirmRevokeAria":"撤销项目钩子信任","settings.hooks.confirmTrust":"以你的用户权限运行这 {count} 个钩子,直到它们的配置发生变更?","settings.hooks.confirmRevoke":"停止此项目所有已配置的钩子,直到再次显式信任?","settings.hooks.saving":"正在保存…","settings.hooks.trustReviewed":"信任已审查的钩子","settings.hooks.revokeTrust":"撤销信任","settings.hooks.empty":"没有已配置的命令、HTTP 或提示词钩子。","settings.hooks.loadFailed":"加载钩子信任失败","settings.hooks.updateFailed":"更新钩子信任失败","settings.hooks.sessionUpdateFailed":"更新会话钩子失败","settings.plugins.selectProject":"选择一个项目以管理其插件。","settings.plugins.heading":"工作区插件","settings.plugins.changesNote":"更改将在后续会话快照生效并持久化到所选层级。","settings.plugins.reloadAria":"重新加载插件","settings.plugins.sourcePolicy":"来源策略","settings.plugins.savePolicyAria":"保存插件来源策略","settings.plugins.saving":"正在保存…","settings.plugins.saveForProject":"保存到项目","settings.plugins.restrictAria":"限制插件来源","settings.plugins.restrictAllowlists":"限制为允许列表","settings.plugins.requireShaAria":"要求完整 Git commit SHA","settings.plugins.requireSha":"要求完整 Git SHA","settings.plugins.environmentLocked":" · 环境已锁定","settings.plugins.gitHostsAria":"允许的插件 Git 主机","settings.plugins.marketplacesAria":"允许的插件市场","settings.plugins.localRootsAria":"允许的本地插件根目录","settings.plugins.emptyAllowlists":"空的允许列表将拒绝所有插件来源。","settings.plugins.installHeading":"安装可信插件","settings.plugins.sourceAria":"插件来源","settings.plugins.install":"安装","settings.plugins.trustSource":"我信任此来源可激活钩子、MCP 服务器、技能和命令。","settings.plugins.activationScope":"激活写入范围","settings.plugins.activationScopeHint":"更高优先级的层级仍将决定最终生效状态。","settings.plugins.scopeAria":"插件激活范围","settings.plugins.scope.local":"本地","settings.plugins.scope.project":"项目","settings.plugins.scope.global":"全局","settings.plugins.scope.localDesc":"仅当前检出","settings.plugins.scope.projectDesc":"共享的项目设置","settings.plugins.scope.globalDesc":"所有项目","settings.plugins.scope.invocation":"本次调用","settings.plugins.scope.default":"默认","settings.plugins.layer.on":"开","settings.plugins.layer.off":"关","settings.plugins.capability.commands":"{count} 个命令","settings.plugins.capability.skills":"{count} 个技能","settings.plugins.capability.agents":"{count} 个 Agent","settings.plugins.capability.hooks":"{count} 个钩子","settings.plugins.capability.mcp":"{count} 个 MCP","settings.plugins.noResources":"未声明任何资源","settings.plugins.effective":"生效范围:{scope}","settings.plugins.managed":"托管","settings.plugins.invocationScoped":"通过 --plugin-dir 限定为调用级","settings.plugins.enableAria":"启用 {name}","settings.plugins.disableAria":"停用 {name}","settings.plugins.unavailableAria":"{name} 不可用","settings.plugins.updateAria":"更新 {name}","settings.plugins.uninstallAria":"卸载 {name}","settings.plugins.confirmUpdate":"确认更新","settings.plugins.update":"更新","settings.plugins.confirmRemove":"确认移除","settings.plugins.empty":"未发现此项目的任何插件。","settings.plugins.marketplaces":"市场","settings.plugins.configuredCount":"{count} 个已配置","settings.plugins.marketplaceSourceAria":"市场来源","settings.plugins.addMarketplaceAria":"添加市场","settings.plugins.add":"添加","settings.plugins.noDescription":"无描述","settings.plugins.refreshMarketplaceAria":"刷新市场 {name}","settings.plugins.removeMarketplaceAria":"移除市场 {name}","settings.plugins.confirm":"确认","settings.plugins.installedSuffix":" · 已安装","settings.plugins.marketplaceEmpty":"添加市场以发现可安装的插件。","settings.plugins.loadFailed":"加载插件失败","settings.plugins.actionFailed":"插件操作失败","settings.plugins.updateFailed":"更新插件失败","settings.models.addModal.title":"添加模型","settings.models.addModal.close":"关闭添加模型","settings.models.addModal.loadProvidersError":"加载服务商失败","settings.models.addModal.loadModelsError":"加载模型失败","settings.models.addModal.provider":"服务商","settings.models.addModal.loadingProviders":"正在加载服务商…","settings.models.addModal.selectProvider":"选择服务商","settings.models.addModal.configuredSuffix":" - 已配置","settings.models.addModal.customOpenAI":"自定义 OpenAI 端点","settings.models.addModal.customAnthropic":"自定义 Anthropic 端点","settings.models.addModal.channelId":"渠道 ID","settings.models.addModal.channelIdHint":"稳定的配置与凭据标识符。","settings.models.addModal.channelName":"渠道名称","settings.models.addModal.baseUrl":"Base URL","settings.models.addModal.anthropicProtocol":"使用 Anthropic Messages 协议。","settings.models.addModal.openaiProtocol":"使用 OpenAI Chat Completions 协议。","settings.models.addModal.modelId":"模型 ID","settings.models.addModal.model":"模型","settings.models.addModal.loadingModels":"正在加载模型…","settings.models.addModal.selectModel":"选择模型","settings.models.addModal.reasoningSuffix":" - 推理","settings.models.addModal.visionSuffix":" - 视觉","settings.models.addModal.displayName":"显示名称","settings.models.addModal.displayNamePlaceholder":"可选别名","settings.models.addModal.apiKey":"API Key","settings.models.addModal.apiKeyAria":"API Key","settings.models.addModal.apiKeyPlaceholder":"单独存储在 auth.json 中","settings.models.addModal.showApiKey":"显示 API Key","settings.models.addModal.hideApiKey":"隐藏 API Key","settings.models.addModal.oauthNote":"该服务商需要 OAuth 或环境凭据,请在选择模型前在外部完成配置。","settings.models.addModal.saveModel":"保存模型","settings.models.addModal.saving":"正在保存…","settings.models.addModal.channelIdError":'渠道 ID 必须以小写字母开头,且只能包含小写字母、数字、"."、"_" 或 "-"。',"settings.models.addModal.invalidBaseUrl":"Base URL 必须是绝对的 HTTP(S) URL。","settings.models.editModal.srTitle":"编辑模型","settings.models.editModal.title":"编辑模型覆盖项","settings.models.editModal.close":"关闭编辑模型","settings.models.editModal.displayName":"显示名称","settings.models.editModal.replaceApiKey":"替换服务商 API Key","settings.models.editModal.replaceApiKeyPlaceholder":"留空则保留当前凭据","settings.models.editModal.baseUrlOverride":"Base URL 覆盖","settings.models.editModal.baseUrlPlaceholder":"留空则使用默认端点","settings.models.editModal.streamIdleTimeout":"流空闲超时(ms)","settings.models.editModal.save":"保存","settings.models.editModal.saving":"正在保存…","settings.models.editModal.streamIdleTimeoutError":"流空闲超时必须至少为 1000ms。","settings.models.editModal.credentialError":"更新服务商凭据失败","settings.models.editProvider.title":"编辑服务商渠道","settings.models.editProvider.close":"关闭编辑服务商","settings.models.editProvider.channelName":"渠道名称","settings.models.editProvider.channelNameRequired":"渠道名称不能为空","settings.models.editProvider.wireApi":"Wire API","settings.models.editProvider.baseUrl":"Base URL","settings.models.editProvider.baseUrlAria":"服务商 Base URL","settings.models.editProvider.invalidBaseUrl":"Base URL 必须是绝对的 HTTP(S) URL。","settings.models.editProvider.apiKeyEnv":"API Key 环境变量","settings.models.editProvider.apiKeyEnvPlaceholder":"可选,例如 TEAM_GATEWAY_API_KEY","settings.models.editProvider.replaceApiKey":"替换 API Key","settings.models.editProvider.apiKeyAria":"服务商 API Key","settings.models.editProvider.apiKeyPlaceholder":"留空则保留当前凭据","settings.models.editProvider.save":"保存渠道","settings.models.editProvider.saving":"正在保存…","settings.style.auto":"自动","settings.style.pragmatic":"务实","settings.style.friendly":"友好","settings.style.explanatory":"解释型","mcp.status.connected":"已连接","mcp.status.connecting":"连接中...","mcp.status.reconnecting":"恢复中...","mcp.status.offline":"离线","mcp.status.error":"错误","mcp.status.recoveringAttempt":"恢复中 {attempt}/{max}","mcp.oauth.status.disabled":"未配置","mcp.oauth.status.unavailable":"当前运行时不可用","mcp.oauth.status.unauthenticated":"需要授权","mcp.oauth.status.authorizing":"等待授权...","mcp.oauth.status.authenticated":"已授权","mcp.oauth.status.error":"授权失败","mcp.catalog.tag.official":"官方","mcp.catalog.tag.popular":"热门","mcp.catalog.tag.community":"社区","mcp.action.refreshServers":"刷新 MCP 服务器","mcp.action.addServer":"添加服务器","mcp.action.close":"关闭 MCP","mcp.action.dismiss":"忽略","mcp.action.retry":"重试","mcp.action.disconnect":"断开连接","mcp.action.disconnecting":"断开中...","mcp.action.stopRecovery":"停止恢复","mcp.action.connect":"连接","mcp.action.connecting":"连接中...","mcp.action.authorizeFirst":"请先授权","mcp.action.delete":"删除","mcp.action.cancel":"取消","mcp.action.deleting":"删除中...","mcp.action.deleteServer":"删除服务器","mcp.tab.installed":"已安装 ({count})","mcp.tab.catalog":"目录","mcp.servers.title":"服务器","mcp.servers.searchAria":"搜索已安装的 MCP 服务器","mcp.servers.searchPlaceholder":"搜索服务器...","mcp.servers.loading":"正在加载服务器...","mcp.servers.noMatch":"没有匹配的服务器","mcp.servers.none":"尚未配置 MCP 服务器","mcp.server.errorLabel":"错误:{error}","mcp.server.deleteAria":"删除 {name}","mcp.server.selectPrompt":"选择一个服务器以查看详情","mcp.instructions.title":"服务器说明","mcp.instructions.detailsOmittedByPolicy":"[详情已根据运行时策略省略]","mcp.instructions.detailsOmitted":"详情已省略","mcp.instructions.truncated":"已截断至安全显示上限","mcp.tasks.title":"实验性 MCP 任务","mcp.tasks.summary":"每会话 {count} 个 · {interval}ms 轮询","mcp.tasks.disabledByDefault":"默认禁用","mcp.tasks.enabled":"已启用","mcp.tasks.disabled":"已禁用","mcp.oauth.signingOut":"登出中...","mcp.oauth.signOut":"登出","mcp.oauth.continueAuthorization":"继续授权","mcp.oauth.resumeAuthorization":"恢复授权","mcp.oauth.opening":"打开中...","mcp.oauth.authorize":"授权","mcp.delete.confirm":"移除此服务器及其已保存的配置?","mcp.tools.title":"工具 ({count})","mcp.tools.none":"暂无可用工具","mcp.completion.title":"参数补全","mcp.completion.connectPrompt":"连接服务器后即可请求补全建议","mcp.completion.unsupported":"该服务器未声明支持 MCP 补全","mcp.completion.noTargets":"没有可补全的提示词参数或模板变量","mcp.completion.targetAria":"MCP 补全目标","mcp.completion.partialAria":"MCP 补全的部分值","mcp.completion.partialPlaceholder":"部分值","mcp.completion.completing":"补全中...","mcp.completion.complete":"补全","mcp.completion.suggestionsAria":"MCP 补全建议","mcp.completion.empty":"[空]","mcp.completion.noSuggestions":"暂无建议","mcp.meta.truncatedSuffix":" · 已截断","mcp.meta.detailsOmittedSuffix":" · 详情已省略","mcp.diagnostics.title":"诊断","mcp.diagnostics.refreshAria":"刷新 {name} 的 MCP 日志","mcp.diagnostics.logsAria":"{name} 的 MCP 日志","mcp.log.levelAria":"MCP 日志级别","mcp.log.setting":"设置中...","mcp.log.loading":"正在加载日志...","mcp.log.none":"未捕获到日志","mcp.catalog.searchAria":"搜索 MCP 服务器目录","mcp.catalog.searchPlaceholder":"在 npm 上搜索 MCP 服务器(至少 3 个字符)...","mcp.catalog.retry":"重试加载目录","mcp.catalog.noDescription":"暂无描述","mcp.catalog.byAuthor":"作者 {author}","mcp.catalog.installed":"已安装","mcp.catalog.installing":"安装中...","mcp.catalog.install":"安装","mcp.catalog.noPackages":"未找到任何包","mcp.catalog.noMore":"没有更多包了","mcp.catalog.packagesFound":"找到 {count} 个包","mcp.catalog.browseGlama":"在 Glama 上浏览更多","mcp.error.connectFailed":"连接服务器失败","mcp.error.disconnectFailed":"断开服务器失败","mcp.error.deleteFailed":"删除服务器失败","mcp.error.loginFailed":"MCP OAuth 登录失败","mcp.error.logoutFailed":"MCP OAuth 登出失败","mcp.error.loggingLevelFailed":"设置 MCP 日志级别失败","mcp.error.completionFailed":"MCP 补全失败","mcp.add.title":"添加 MCP 服务器","mcp.add.closeAria":"关闭添加 MCP 服务器","mcp.add.modeForm":"表单","mcp.add.jsonConfig":"JSON 配置","mcp.add.jsonConfigAria":"JSON 配置","mcp.add.serverName":"服务器名称","mcp.add.command":"命令","mcp.add.commandAria":"服务器命令","mcp.add.argsLabel":"参数(空格分隔)","mcp.add.argsAria":"服务器参数","mcp.add.invalidJson":"请输入包含服务器名称和传输方式的有效 JSON。","mcp.add.nameCommandRequired":"名称和命令为必填项。","mcp.add.adding":"添加中...","mcp.add.submit":"添加服务器","mcp.install.title":"安装 MCP 服务器","mcp.install.titleWithName":"安装 {name}","mcp.install.closeAria":"关闭 MCP 安装","mcp.install.args":"参数","mcp.install.commandPreview":"命令:npx {args}","mcp.install.nameRequired":"服务器名称为必填项。","skills.title":"技能","skills.action.install":"安装技能","skills.action.installShort":"安装","skills.action.refreshAria":"刷新技能","skills.action.closeAria":"关闭技能","skills.action.dismiss":"忽略","skills.action.retry":"重试","skills.action.cancel":"取消","skills.action.close":"关闭","skills.action.hide":"隐藏","skills.action.enable":"启用","skills.action.disable":"禁用","skills.action.saving":"保存中…","skills.status.enabled":"已启用","skills.status.disabled":"已禁用","skills.status.installed":"已安装","skills.noDescriptionShort":"暂无描述","skills.noDescription":"暂无可用描述","skills.installed.title":"已安装","skills.installed.searchAria":"搜索已安装的技能","skills.installed.searchPlaceholder":"搜索技能…","skills.installed.loading":"正在加载技能…","skills.installed.noMatch":"没有匹配的技能","skills.installed.empty":"尚未安装任何技能","skills.uninstall.managedHint":"仅可卸载 Blade 用户技能","skills.uninstall.managed":"受管理","skills.uninstall.action":"卸载","skills.uninstall.confirmAria":"卸载 {name}","skills.uninstall.confirmPrompt":"从 ~/.blade/skills 中移除此技能?","skills.uninstall.inProgress":"正在卸载…","skills.uninstall.confirm":"卸载技能","skills.details.title":"详情","skills.details.provider":"提供方","skills.details.location":"位置","skills.details.capabilities":"能力","skills.details.allowedTools":"允许的工具({count})","skills.detail.emptyState":"选择一个技能以查看详情","skills.install.title":"安装技能","skills.install.closeAria":"关闭技能安装","skills.install.tab.catalog":"目录","skills.install.tab.repo":"仓库","skills.install.tab.local":"本地","skills.install.catalog.searchAria":"搜索技能目录","skills.install.catalog.searchPlaceholder":"搜索目录…","skills.install.catalog.loading":"正在加载目录…","skills.install.catalog.empty":"未找到技能","skills.install.catalog.byAuthor":"作者:{author}","skills.install.catalog.tag.official":"官方","skills.install.catalog.tag.popular":"热门","skills.install.catalog.tag.community":"社区","skills.install.repo.label":"GitHub URL","skills.install.repo.inputAria":"技能仓库地址","skills.install.repo.credentialsHint":"使用 Blade 进程可用的 Git 凭据","skills.install.local.label":"本地路径","skills.install.local.inputAria":"本地技能路径","skills.status.dialogTitle":"安装状态","skills.status.confirm.title":"确认安装","skills.status.confirm.prompt":"安装所选技能?","skills.status.installing.title":"正在安装","skills.status.installing.description":"正在下载并校验…","skills.status.failed.title":"安装失败","skills.status.failed.fallback":"安装失败。","skills.status.failed.hint":"请检查访问权限后重试。","skills.error.deleteFailed":"删除技能失败","skills.error.toggleFailed":"切换技能状态失败","skills.error.installFailed":"安装技能失败","schedule.title":"定时任务","schedule.description":"按 cron、间隔或一次性触发器自动运行无界面任务提示词。","schedule.new":"新建定时任务","schedule.newAria":"创建新的定时任务","schedule.refresh":"刷新","schedule.reloadAria":"重新加载定时任务","schedule.create":"创建","schedule.save":"保存","schedule.cancel":"取消","schedule.confirmDelete":"确认?","schedule.empty":"暂无定时任务","schedule.enabled":"已启用","schedule.disabled":"已禁用","schedule.never":"从未","schedule.nextRun":"下次运行","schedule.lastRun":"上次运行","schedule.runCount":"已运行 {count} 次","schedule.trigger.kindAria":"触发器类型","schedule.trigger.cron":"Cron","schedule.trigger.interval":"间隔","schedule.trigger.once":"一次性","schedule.field.title":"标题(可选)","schedule.field.cron":"Cron 表达式","schedule.field.interval":"间隔","schedule.field.runAt":"运行时间","schedule.field.prompt":"提示词","schedule.field.project":"项目路径","schedule.field.model":"模型(可选)","schedule.field.permissionMode":"权限模式","schedule.field.isolation":"隔离方式","schedule.placeholder.title":"每晚依赖审查","schedule.placeholder.cron":"0 9 * * 1 (分 时 日 月 周)","schedule.placeholder.interval":"30m / 2h / 1d","schedule.placeholder.prompt":"描述要运行的任务…","schedule.placeholder.project":"/path/to/project","schedule.placeholder.model":"例如 anthropic/claude-sonnet","schedule.model.current":"使用当前模型","schedule.permission.default":"默认","schedule.permission.autoEdit":"自动编辑","schedule.permission.yolo":"Yolo","schedule.permission.plan":"规划","schedule.isolation.local":"本地","schedule.isolation.worktree":"工作树","schedule.cadence.cron":"cron:{expr}","schedule.cadence.interval":"每 {interval}","schedule.cadence.once":"于 {time} 运行一次","schedule.status.queued":"排队中","schedule.status.running":"运行中","schedule.status.completed":"已完成","schedule.status.failed":"失败","schedule.status.cancelled":"已取消","schedule.status.interrupted":"已中断","schedule.status.error":"出错","schedule.status.never":"尚未运行","schedule.runNowAria":"立即运行“{title}”","schedule.editAria":"编辑“{title}”","schedule.deleteAria":"删除“{title}”","schedule.enableAria":"启用“{title}”","schedule.disableAria":"禁用“{title}”","schedule.error.promptRequired":"提示词不能为空。","schedule.error.projectRequired":"项目路径不能为空。","schedule.error.cronRequired":"Cron 表达式不能为空。","schedule.error.invalidInterval":"请输入类似 30m、2h 或 1d 的间隔。","schedule.error.runAtRequired":"请选择有效的运行时间。","schedule.error.loadFailed":"加载定时任务失败。","schedule.error.createFailed":"创建定时任务失败。","schedule.error.updateFailed":"更新定时任务失败。","schedule.error.deleteFailed":"删除定时任务失败。","schedule.error.toggleFailed":"切换定时任务状态失败。","schedule.error.runFailed":"运行定时任务失败。"},lw=["en","zh"],Wa={en:aw,zh:cw},Vp="blade-ui-locale",Zc=typeof window<"u"&&typeof document<"u";function dw(){var e,t;if(Zc){try{const r=(e=window.localStorage)==null?void 0:e.getItem(Vp);if(r==="en"||r==="zh")return r}catch{}return(typeof navigator<"u"&&(navigator.language||((t=navigator.languages)==null?void 0:t[0]))||"").toLowerCase().startsWith("zh")?"zh":"en"}return"en"}let Gr=dw();const pc=new Set;function uw(){for(const e of pc)e()}function O3(){return Gr}function pw(e){var t;if(e!==Gr){if(Gr=e,Zc){try{(t=window.localStorage)==null||t.setItem(Vp,e)}catch{}document!=null&&document.documentElement&&(document.documentElement.lang=e==="zh"?"zh-CN":"en")}uw()}}function Wp(e){return pc.add(e),()=>pc.delete(e)}function fw(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>{const s=t[r];return s==null?n:String(s)}):e}function Ke(e,t){const r=(Wa[Gr]??Wa.en)[e]??Wa.en[e];return fw(r,t)}function Ut(){return y.useSyncExternalStore(Wp,()=>Gr,()=>"en"),Ke}function mw(){return{locale:y.useSyncExternalStore(Wp,()=>Gr,()=>"en"),setLocale:pw}}Zc&&(document!=null&&document.documentElement)&&(document.documentElement.lang=Gr==="zh"?"zh-CN":"en");function kt(e,t){return{...e,...t}}function Br(e,t,n){return e>=t&&e<=n}function hw(e){return e===8205}function gw(e){return Br(e,55296,56319)}function Su(e){return Br(e,127462,127487)}function Jp(e){return Br(e,65024,65039)}function Qp(e){return Br(e,768,879)||Br(e,6832,6911)||Br(e,7616,7679)||Br(e,65056,65071)}function To(e){return e>65535?2:1}function ju(e,t){for(;t<e.length;){const n=e.codePointAt(t);if(Qp(n)||Jp(n))t+=To(n);else break}return t}function Xc(e,t){const n=e.codePointAt(t);let r=t+To(n);for(r=ju(e,r);r<e.length-1&&e[r]==="";){const s=e.codePointAt(r+1);r+=1+To(s),r=ju(e,r)}return Su(n)&&r<e.length&&Su(e.codePointAt(r))&&(r+=To(e.codePointAt(r))),r}function Yp(e){return gw(e)||Qp(e)||Jp(e)||hw(e)}function bw(e){let t=0,n=0;for(;n<e.length;)n=Xc(e,n),t++;return t}function kw(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=Xc(e,r),n++,n>=t)return!0;return!1}function xw(e,t){let n=0,r=0;for(;r<e.length;)if(r=Xc(e,r),n++,n>t)return!1;return!0}function yw(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Yp(e.charCodeAt(n)))return kw(e,t);if(n++,n>=t)return!0}return!1}function ww(e,t){let n=0;for(;n<e.length;){if(Yp(e.charCodeAt(n)))return xw(e,t);if(n++,n>t)return!1}return!0}function q(e){return Array.isArray(e)}function st(e){return g(typeof e,"bigint")}function xt(e){return g(typeof e,"boolean")}function na(e){if(Fe(e)||!Tn(e))return!1;const t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Tn(e){return g(typeof e,"function")}function el(e){return Number.isInteger(e)}function Xt(e){return g(e,null)}function Ie(e){return Number.isFinite(e)}function kn(e){return re(e)&&!q(e)}function re(e){return g(typeof e,"object")&&!Xt(e)}function pe(e){return g(typeof e,"string")}function tl(e){return g(typeof e,"symbol")}function Fe(e){return g(e,void 0)}function g(e,t){return e===t}function ts(e,t){return e>t}function ji(e,t){return e<t}function ir(e,t){return e<=t}function Rs(e,t){return e>=t}function Zp(e,t){if(st(e)||st(t))return BigInt(e)%BigInt(t)===0n;const n=1e-10;if(!Ie(e)||el(e)&&1/t%1===0)return!0;const r=e%t;return Math.min(Math.abs(r),Math.abs(r-t),Math.abs(r+t))<n}function Xp(e){if(!re(e))return!1;const t=globalThis.Object.getPrototypeOf(e);return Xt(t)?!1:g(typeof t.constructor,"function")&&!(g(t.constructor,globalThis.Object)||g(t.constructor.name,"Object"))}function Ms(e){return st(e)||xt(e)||Xt(e)||Ie(e)||pe(e)||Fe(e)}function vw(e){return bw(e)}function ef(e,t){return ww(e,t)}function tf(e,t){return yw(e,t)}function ht(e,t,n){for(let r=t;r<e.length;r++)if(!n(e[r],r))return!1;return!0}function Pt(e,t,n){let r=!0;for(let s=t;s<e.length;s++)n(e[s],s)||(r=!1);return r}function $s(e,t){for(let n=0;n<e.length;n++)if(t(e[n],n))return!0;return!1}function nf(e,t){let n=!1;for(let r=0;r<e.length;r++)t(e[r],r)&&(n=!0);return n}function nl(e,t){return e.reduce((n,r,s)=>t(r,s)?++n:n,0)}function Te(e,t,n){return g(e.length,0)?n():t(e[0],e.slice(1))}function er(e){return g(e,"__proto__")||g(e,"constructor")||g(e,"prototype")}function E(e,t){return er(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function rl(e){return U(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function it(e){return Object.entries(e)}function U(e){return Object.getOwnPropertyNames(e)}function sl(e){return Object.getOwnPropertySymbols(e)}function il(e){return Object.values(e)}function Sw(e,t){if(!re(t))return!1;const n=U(e);return g(n.length,U(t).length)&&n.every(r=>ns(e[r],t[r]))}function jw(e,t){return q(t)&&g(e.length,t.length)&&e.every((n,r)=>ns(e[r],t[r]))}function ns(e,t){return q(e)?jw(e,t):re(e)?Sw(e,t):g(e,t)}const Fo=Object.freeze(Object.defineProperty({__proto__:null,Counted:nl,Entries:it,EntriesRegExp:rl,Every:ht,EveryAll:Pt,GraphemeCount:vw,HasPropertyKey:E,IsArray:q,IsBigInt:st,IsBoolean:xt,IsClassInstance:Xp,IsConstructor:na,IsDeepEqual:ns,IsEqual:g,IsFunction:Tn,IsGreaterEqualThan:Rs,IsGreaterThan:ts,IsInteger:el,IsLessEqualThan:ir,IsLessThan:ji,IsMaxLength:ef,IsMinLength:tf,IsMultipleOf:Zp,IsNull:Xt,IsNumber:Ie,IsObject:re,IsObjectNotArray:kn,IsString:pe,IsSymbol:tl,IsUndefined:Fe,IsUnsafePropertyKey:er,IsValueLike:Ms,Keys:U,ShiftLeft:Te,Some:$s,SomeAll:nf,Symbols:sl,Values:il},Symbol.toStringTag,{value:"Module"})),Iw=/^[\p{ID_Start}_$][\p{ID_Continue}_$\u200C\u200D]*$/u;function Cw(e){return Iw.test(e)}function Ct(e,t){return`(${e} && ${t})`}function Ge(e,t){return`(${e} || ${t})`}function $t(e){return`!(${e})`}function Lo(e){return`Array.isArray(${e})`}function rf(e){return`typeof ${e} === "bigint"`}function Ew(e){return`typeof ${e} === "boolean"`}function Tw(e){return`Number.isInteger(${e})`}function Aw(e){return`${e} === null`}function sf(e){return`Number.isFinite(${e})`}function of(e){return Ct(af(e),$t(Lo(e)))}function af(e){return`typeof ${e} === "object" && ${e} !== null`}function cf(e){return`typeof ${e} === "string"`}function Pw(e){return`typeof ${e} === "symbol"`}function fc(e){return`${e} === undefined`}function Nw(e){return`typeof ${e} === "function"`}function Ow(e){return`Guard.IsConstructor(${e})`}function Zt(e,t){return`${e} === ${t}`}function lf(e,t){return`${e} > ${t}`}function ol(e,t){return`${e} < ${t}`}function rs(e,t){return`${e} <= ${t}`}function Ii(e,t){return`${e} >= ${t}`}function Rw(e,t){return`Guard.IsMinLength(${e}, ${t})`}function Mw(e,t){return`Guard.IsMaxLength(${e}, ${t})`}function Hn(e,t,n,r){return g(t,"0")?`${e}.every((${n[0]}, ${n[1]}) => ${r})`:`((value, callback) => { for(let index = ${t}; index < value.length; index++) if (!callback(value[index], index)) return false; return true })(${e}, (${n[0]}, ${n[1]}) => ${r})`}function $w(e,t,n){return`${e}.some((${t[0]}, ${t[1]}) => ${n})`}function Fw(e,t,n){return`((value, callback) => { let result = false; for(let index = 0; index < value.length; index++) if (callback(value[index], index)) result = true; return result })(${e}, (${t[0]}, ${t[1]}) => ${n})`}function ra(e,t,n){return`${e}.reduce((result, ${t[0]}, ${t[1]}) => (${n}) ? ++result : result, 0)`}function df(e){return`Object.entries(${e})`}function ss(e){return`Object.getOwnPropertyNames(${e})`}function Vr(e,t){return g(t,'"__proto__"')||g(t,'"constructor"')?`Object.prototype.hasOwnProperty.call(${e}, ${t})`:`${t} in ${e}`}function uf(e,t){return`Guard.IsDeepEqual(${e}, ${t})`}function Lw(e){return`[${e.join(", ")}]`}function xr(e,t){return`((${e.join(", ")}) => ${t})`}function Ve(e,t){return`${e}(${t.join(", ")})`}function al(e,t){return`new ${e}(${t.join(", ")})`}function ge(e,t){return`${e}${Cw(t)?`.${t}`:`[${G(t)}]`}`}function G(e){if(!Ms(e))throw Error("Unsupported Constant");return pe(e)?JSON.stringify(e):`${e}`}function Dw(e,t,n){return`(${e} ? ${t} : ${n})`}function sa(e){return`{ ${e.join("; ")}; }`}function tr(e,t){return`const ${e} = ${t}`}function pf(e,t){return`if(${e}) { ${t} }`}function ia(e){return`return ${e}`}function Tt(e){return g(e.length,0)?"true":e.reduce((t,n)=>Ct(t,n))}function cl(e){return g(e.length,0)?"false":e.reduce((t,n)=>Ge(t,n))}function _w(e,t){return`Guard.IsMultipleOf(${e}, ${t})`}function Uw(e){return e instanceof Boolean}function Bw(e){return e instanceof Number}function Hw(e){return e instanceof String}function Ci(e){return globalThis.ArrayBuffer.isView(e)}function ff(e){return e instanceof globalThis.RegExp}function mf(e){return e instanceof globalThis.Date}function hf(e){return e instanceof globalThis.Set}function gf(e){return e instanceof globalThis.Map}function qw(e){return E(e,"~kind")||E(e,"~unsafe")}function zw(e){const t={},n=Object.getOwnPropertyDescriptors(e);for(const r of Object.keys(n)){if(er(r))continue;const s=n[r];E(s,"value")&&Object.defineProperty(t,r,{...s,value:Wr(s.value)})}return t}function Kw(e){const t={};for(const n of U(e))er(n)||(t[n]=Wr(e[n]));for(const n of sl(e))t[n]=Wr(e[n]);return t}function Gw(e){return Xp(e)?e:qw(e)?zw(e):Kw(e)}function Vw(e){return e.map(t=>Wr(t))}function Ww(e){return e.slice()}function Jw(e){return new RegExp(e.source,e.flags)}function Qw(e){return new Map(Wr([...e.entries()]))}function Yw(e){return new Set(Wr([...e.values()]))}function Wr(e){return Ci(e)?Ww(e):ff(e)?Jw(e):gf(e)?Qw(e):hf(e)?Yw(e):q(e)?Vw(e):re(e)?Gw(e):e}function ll(e){return Wr(e)}const Zw={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Ei(){return Zw}function Xw(e,t){for(const n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function ev(e,t){return{...e,...t}}function we(e,t,n={}){const r=ev(t,n);return Xw(r,e)}function Mn(e,t){const n={},r=Object.getOwnPropertyDescriptors(ll(e)),s=new Set(t);for(const i of Object.keys(r))s.has(i)||Object.defineProperty(n,i,r[i]);return n}function ke(e,t,n){const r=Ei(),s=ll(e);for(const i of Object.keys(t))Object.defineProperty(s,i,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[i]});for(const i of Object.keys(n))Object.defineProperty(s,i,{configurable:!0,enumerable:!0,writable:!0,value:n[i]});return s}function Ce(e,t){return re(e)&&E(e,"~kind")&&g(e["~kind"],t)}function on(e){return re(e)}function Ne(e,t,n){return we({"~kind":"Deferred"},{type:"deferred",action:e,parameters:t,options:n},{})}function Ps(e){return Ce(e,"Deferred")}function tv(e){return ke(e,{"~readonly":!0},{})}function dl(e,t){return ke(tv(e),{},t)}function nv(e,t,n,r){const s=V(e,t,n);return dl(s,r)}function rv(e){return ke(e,{"~optional":!0},{})}function ul(e,t){return ke(rv(e),{},t)}function sv(e,t,n,r){const s=V(e,t,n);return ul(s,r)}function Ir(e,t){return we({"~kind":"Array"},{type:"array",items:e},t)}function gt(e){return Ce(e,"Array")}function pl(e){return Mn(e,["~kind","type","items"])}function Ti(e,t,n={}){return we({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},n)}function xn(e){return Ce(e,"Constructor")}function iv(e){return Mn(e,["~kind","type","parameters","instanceType"])}function Ai(e,t,n={}){return we({"~kind":"Function"},{type:"function",parameters:e,returnType:t},n)}function yn(e){return Ce(e,"Function")}function ov(e){return Mn(e,["~kind","type","parameters","returnType"])}function gn(e,t){return we({"~kind":"Ref"},{$ref:e},t)}function vt(e){return Ce(e,"Ref")}function Pi(e,t){return we({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function fl(e){return Ce(e,"Generic")}function ml(e){return we({"~kind":"Any"},{},e)}function $n(e){return Ce(e,"Any")}const av="(?!)";function Nt(e){return we({"~kind":"Never"},{not:{}},e)}function Fs(e){return Ce(e,"Never")}function nr(e,t={}){return Ne("AddOptional",[e],t)}function Do(e,t={}){return ul(e,t)}function cv(e){return Do(e)}function an(e){return on(e)&&E(e,"~optional")}function lv(e){return U(e).filter(t=>!an(e[t]))}function bf(e){return U(e)}function kf(e){return il(e)}function Me(e,t={}){const n=lv(e),r=n.length>0?{required:n}:{};return we({"~kind":"Object"},{type:"object",...r,properties:e},t)}function Ue(e){return Ce(e,"Object")}function dv(e){return Mn(e,["~kind","type","properties","required"])}function Kt(e){return we({"~kind":"Unknown"},{},e)}function An(e){return Ce(e,"Unknown")}function Ni(e,t,n){const r=U(e).reduce((s,i)=>({...s,[i]:ke(e[i],{},{$id:i})}),{});return we({"~kind":"Cyclic"},{$defs:r,$ref:t},n)}function Gt(e){return Ce(e,"Cyclic")}function uv(e){return ke(e,{"~unsafe":null},{})}function xf(e){return kn(e)&&E(e,"~unsafe")&&Xt(e["~unsafe"])}function ut(e,t){var n;return((n=t[e.length])==null?void 0:n.call(t,...e))??(()=>{throw Error("Invalid Arguments")})()}function mc(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s,s],1:r=>[r,Kt(),Kt()]});return we({"~kind":"Infer"},{type:"infer",name:t,extends:n},{})}function cn(e){return Ce(e,"Infer")}function _o(e,t,n,r={}){return we({"~kind":"Dependent"},{if:e,then:t,else:n},r)}function wn(e){return Ce(e,"Dependent")}function pv(e){return Mn(e,["~kind","if","then","else"])}function fv(e){return kn(e)}function mv(e){return U(e).filter(n=>isNaN(n)).reduce((n,r)=>[...n,e[r]],[])}function hv(e){return pe(e)||Ie(e)}function gv(e,t){const n=fv(e)?mv(e):e;return we({"~kind":"Enum"},{enum:n},t)}function vn(e){return Ce(e,"Enum")}function Bn(e,t={}){return we({"~kind":"Intersect"},{allOf:e},t)}function Be(e){return Ce(e,"Intersect")}function bv(e){return Mn(e,["~kind","allOf"])}let Ja;function kv(){try{return wf("null")(),!0}catch{return!1}}function yf(){return Fe(Ja)&&(Ja=kv()),Ja&&Ei().useAcceleration}function wf(...e){return new globalThis.Function(...e)}function Ft(){throw new Error("Unreachable")}function xv(e){const t=new Set;let n=e;for(;n&&n!==Object.prototype;){for(const r of Reflect.ownKeys(n))r!=="constructor"&&typeof r!="symbol"&&t.add(r);n=Object.getPrototypeOf(n)}return[...t]}function yv(e){return typeof e=="number"}var Lt;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(Lt||(Lt={}));let Es=BigInt("14695981039346656037");const[wv,vv]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Sv=Array.from({length:256}).map((e,t)=>BigInt(t)),vf=new Float64Array(1),Sf=new DataView(vf.buffer),jf=new Uint8Array(vf.buffer);function St(e){Es=Es^Sv[e],Es=Es*wv%vv}function jv(e){St(Lt.Array);for(const t of e)yr(t)}function Iv(e){St(Lt.BigInt),Sf.setBigInt64(0,e);for(const t of jf)St(t)}function Iu(e){St(Lt.Boolean),St(e?1:0)}function Cv(e){St(Lt.Constructor),yr(e.toString())}function Ev(e){St(Lt.Date),yr(e.getTime())}function Tv(e){St(Lt.Function),yr(e.toString())}function Av(e){St(Lt.Null)}function Cu(e){St(Lt.Number),Sf.setFloat64(0,e,!0);for(const t of jf)St(t)}function Pv(e){St(Lt.Object);for(const t of xv(e).sort())yr(t),yr(e[t])}function Nv(e){St(Lt.RegExp),hc(e.toString())}const Ov=new TextEncoder;function hc(e){St(Lt.String);for(const t of Ov.encode(e))St(t)}function Rv(e){St(Lt.Symbol),yr(e.toString())}function Mv(e){St(Lt.TypeArray);const t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)St(t[n])}function $v(e){return St(Lt.Undefined)}function yr(e){return Ci(e)?Mv(e):mf(e)?Ev(e):ff(e)?Nv(e):Uw(e)?Iu(e.valueOf()):Hw(e)?hc(e.valueOf()):Bw(e)?Cu(e.valueOf()):yv(e)?Cu(e):q(e)?jv(e):xt(e)?Iu(e):st(e)?Iv(e):na(e)?Cv(e):Xt(e)?Av():re(e)?Pv(e):pe(e)?hc(e):tl(e)?Rv(e):Fe(e)?$v():Tn(e)?Tv(e):Ft()}function If(e){return Es=BigInt("14695981039346656037"),yr(e),Es}function oa(e){return If(e).toString(16).padStart(16,"0")}const Fv=Object.freeze(Object.defineProperty({__proto__:null,Hash:oa,HashCode:If},Symbol.toStringTag,{value:"Module"}));function Lv(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}let Dv=Lv;function _v(){return Dv}class Cf{constructor(t,n){this.type=t,this.decode=n}Encode(t){const n=this.type,r=ln(n)?o=>this.decode(n["~codec"].decode(o)):this.decode,s=ln(n)?o=>n["~codec"].encode(t(o)):t,i={decode:r,encode:s};return ke(this.type,{"~codec":i},{})}}class Ef{constructor(t){this.type=t}Decode(t){return new Cf(this.type,t)}}function hl(e){return new Ef(e)}function Uv(e,t){return hl(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function Bv(e,t){return hl(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function ln(e){return on(e)&&E(e,"~codec")&&re(e["~codec"])&&E(e["~codec"],"encode")&&E(e["~codec"],"decode")}function Hv(e){return rd(e)}function Uo(e){return on(e)&&E(e,"~immutable")}function rr(e,t={}){return Ne("AddReadonly",[e],t)}function Bo(e,t={}){return dl(e,t)}function qv(e){return Bo(e)}function Ho(e){return on(e)&&E(e,"~readonly")}function zv(e,t){const n=gl(e)?[...e["~refine"],t]:[t];return ke(e,{"~refine":n},{})}function Kv(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[s,i,()=>"Refine Error"]});return zv(t,{check:n,error:r})}function Gv(e){return kn(e)&&E(e,"check")&&E(e,"error")&&Tn(e.check)&&Tn(e.error)}function gl(e){return on(e)&&E(e,"~refine")&&q(e["~refine"])&&ht(e["~refine"],0,t=>Gv(t))}const Vv="-?(?:0|[1-9][0-9]*)n";function bl(e){return we({"~kind":"BigInt"},{type:"bigint"},e)}function is(e){return Ce(e,"BigInt")}function Tf(e){return we({"~kind":"Boolean"},{type:"boolean"},e)}function Cr(e){return Ce(e,"Boolean")}function gc(e){return we({"~kind":"Identifier"},{name:e})}function Wv(e){return Ce(e,"Identifier")}const Af="-?(?:0|[1-9][0-9]*)";function aa(e){return we({"~kind":"Integer"},{type:"integer"},e)}function qn(e){return Ce(e,"Integer")}class Jv extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}}function Qv(e){return st(e)?"bigint":xt(e)?"boolean":Ie(e)?"number":pe(e)?"string":(()=>{throw new Jv(e)})()}function De(e,t){return we({"~kind":"Literal"},{type:Qv(e),const:e},t)}function Pf(e){return st(e)||xt(e)||Ie(e)||pe(e)}function Yv(e){return Qe(e)&&st(e.const)}function Zv(e){return Qe(e)&&xt(e.const)}function Nf(e){return Qe(e)&&Ie(e.const)}function Of(e){return Qe(e)&&pe(e.const)}function Qe(e){return Ce(e,"Literal")}function kl(e){return we({"~kind":"Null"},{type:"null"},e)}function Oi(e){return Ce(e,"Null")}const Rf="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function wr(e){return we({"~kind":"Number"},{type:"number"},e)}function un(e){return Ce(e,"Number")}function xl(e){return we({"~kind":"Symbol"},{type:"symbol"},e)}function Ri(e){return Ce(e,"Symbol")}function Mi(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[s,i,i],1:s=>[s,Kt(),Kt()]});return we({"~kind":"Parameter"},{name:t,extends:n,equals:r},{})}function Xv(e){return Ce(e,"Parameter")}const Mf=".*";function zn(e){return we({"~kind":"String"},{type:"string"},e)}function Fn(e){return Ce(e,"String")}function Je(e,t={}){return we({"~kind":"Union"},{anyOf:e},t)}function fe(e){return Ce(e,"Union")}function eS(e){return Mn(e,["~kind","anyOf"])}function $f(e){const t=LC(e);return g(t.length,2)?t[0]:[]}function tS(e){return!0}function Ff(e){return Te(e,(t,n)=>nS(t)?Ff(n):!1,()=>!0)}function Lf(e){return g(e.length,0)?!1:Ff(e)}function nS(e){return fe(e)?Lf(e.anyOf):Qe(e)?tS(e.const):!1}function Df(e){return Lf(e)}function _f(e){return we({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function Uf(e,t,n=[]){return Te(e,(r,s)=>Uf(s,t,[...n,`${r}${t}`]),()=>n)}function rS(e,t){return g(e.length,0)?[`${t}`]:Uf(e,t)}function Bf(e,t,n=[]){return Te(t,(r,s)=>Bf(e,s,[...n,...Hf(e,r)]),()=>n)}function Hf(e,t){return fe(t)?Bf(e,t.anyOf):Qe(t)?rS(e,t.const):Ft()}function qf(e,t){return Te(t,(n,r)=>qf(Hf(e,n),r),()=>e)}function sS(e){return e.map(t=>De(t))}function iS(e){const t=qf([],e),n=sS(t);return Je(n)}function oS(e){return g(e.length,0)?Ft():g(e.length,1)&&Qe(e[0])?e[0]:iS(e)}function zf(e){const t=$f(e);return g(t.length,0)?zn():Df(t)?oS(t):_f(e)}function yl(e){const t=zf(e);return Wt(t)?zn():t}function vr(e,t){const n="object",r={[e]:t};return we({"~kind":"Record"},{type:n,patternProperties:r})}function aS(e){return vr(Qr,e)}function cS(e){return Me({true:e,false:e})}function Sn(e,t={}){const[n,r,s]=[e,e.length,!1];return we({"~kind":"Tuple"},{type:"array",additionalItems:s,items:n,minItems:r},t)}function at(e){return Ce(e,"Tuple")}function lS(e){return Mn(e,["~kind","type","items","minItems","additionalItems"])}function dS(e){return Mn(e,["~readonly"])}function Kf(e,t){return ke(dS(e),{},t)}function uS(e,t,n,r){const s=V(e,t,n);return Kf(s,r)}function pS(e,t={}){return Ne("RemoveReadonly",[e],t)}function fS(e,t={}){return Kf(e,t)}function mS(e){return Mn(e,["~optional"])}function Gf(e,t){return ke(mS(e),{},t)}function hS(e,t,n,r){const s=V(e,t,n);return Gf(s,r)}function gS(e,t={}){return Ne("RemoveOptional",[e],t)}function Vf(e,t={}){return Gf(e,t)}function Wf(e){return e.reduceRight((n,r,s)=>({[s]:r,...n}),{})}function bS(e){const t=Wf(e.items);return Me(t)}function kS(e,t){return Ho(e)?!!Ho(t):!1}function xS(e,t){return an(e)?!!an(t):!1}function yS(e,t){const n=kS(e,t),r=xS(e,t),s=pn([e,t]),i=fS(Vf(s));return n&&r?Bo(Do(i)):n&&!r?Bo(i):!n&&r?Do(i):i}function wS(e,t,n){return n in e?n in t?yS(e[n],t[n]):e[n]:n in t?t[n]:Nt()}function vS(e,t){return[...new Set([...U(t),...U(e)])].reduce((r,s)=>({...r,[s]:wS(e,t,s)}),{})}function Eu(e){return Ue(e)?e.properties:at(e)?Wf(e.items):Ft()}function SS(e,t){const n=Eu(e),r=Eu(t),s=vS(n,r);return Me(s)}function jS(e,t){const n=ba(e,t);return g(n,zl)?e:g(n,Kl)||g(n,ql)?t:Nt()}function Tu(e){return Ue(e)||at(e)}function IS(e,t){const n=fe(e),r=fe(t);return n||r}function CS(e,t){const n=Jr(e),r=Jr(t),s=IS(n,r),i=Tu(n),o=Tu(r);return s?pn([n,r]):i&&o?SS(n,r):i&&!o?n:!i&&o?r:jS(n,r)}function Jf(e,t,n=[]){return Te(t,(r,s)=>Jf(e,s,[...n,CS(e,r)]),()=>g(n.length,0)?[e]:n)}function Qf(e,t,n=[]){return Te(e,(r,s)=>Qf(s,t,[...n,...qo([r],t)]),()=>n)}function qo(e,t=[]){return Te(e,(n,r)=>fe(n)?qo(r,Qf(n.anyOf,t)):qo(r,Jf(n,t)),()=>t)}function ES(e,t){const n=sr({},e,t);return Yt(n)?[]:[e]}function TS(e,t){return e.reduce((n,r)=>[...n,...ES(r,t)],[])}function Yf(e,t){const n=Jr(e),r=fe(n)?n.anyOf:[n],s=TS(r,t);return ar(s)}function Ls(e,t,n){const r=Bn([e,t]),s=Yf(n,e);return ar([r,s])}function Er(e){const t=e.map(n=>De(n));return ar(t)}function pn(e){const t=qo(e),n=hh(t);return Ds(n)}function or(e){const t=yl(e);return Jr(t)}function ar(e){const t=hh(e);return Ds(t)}function Jr(e){return wn(e)?Ls(e.if,e.then,e.else):vn(e)?Er(e.enum):Be(e)?pn(e.allOf):Wt(e)?or(e.pattern):fe(e)?ar(e.anyOf):e}function Ds(e){return g(e.length,1)?e[0]:g(e.length,0)?Nt():Je(e)}function AS(e,t){const n=Er(e);return la(n,t)}function PS(e,t){return vr($i,t)}function NS(e,t){const n=pn(e);return la(n,t)}function OS(e,t){return pe(e)||Ie(e)?Me({[e]:t}):g(e,!1)?Me({false:t}):g(e,!0)?Me({true:t}):Me({})}function RS(e,t){return vr(da,t)}function MS(e,t){return E(e,"pattern")&&(pe(e.pattern)||e.pattern instanceof RegExp)?vr(e.pattern.toString(),t):vr(Qr,t)}function $S(e,t){const n=$f(e);return Df(n)?la(or(e),t):vr(e,t)}function FS(e){return fe(e)?ca(e.anyOf):[e]}function ca(e){return e.reduce((t,n)=>[...t,...FS(n)],[])}function LS(e){return e.some(t=>Fn(t)||un(t)||qn(t))}function DS(e,t){return g(LS(e),!0)?vr(Qr,t):void 0}function _S(e,t){return e.reduce((n,r)=>Qe(r)&&(pe(r.const)||Ie(r.const))?{...n,[r.const]:t}:n,{})}function US(e,t){const n=_S(e,t);return Me(n)}function BS(e,t){const n=ca(e),r=DS(n,t);return on(r)?r:US(n,t)}function la(e,t){return $n(e)?aS(t):Cr(e)?cS(t):vn(e)?AS(e.enum,t):qn(e)?PS(e,t):Be(e)?NS(e.allOf,t):Qe(e)?OS(e.const,t):un(e)?RS(e,t):fe(e)?BS(e.anyOf,t):Fn(e)?MS(e,t):Wt(e)?$S(e.pattern,t):Me({})}function Zf(e,t,n){return Xe([e])?ke(la(e,t),{},n):Xf(e,t,n)}function HS(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Zf(i,o,s)}const $i=`^${Af}$`,da=`^${Rf}$`,Qr=`^${Mf}$`;function Xf(e,t,n={}){return Ne("Record",[e,t],n)}function wl(e,t,n={}){return Zf(e,t,n)}function qS(e,t){return vr(e,t)}function bc(e){return g(e,Qr)?zn():g(e,$i)?aa():g(e,da)?wr():zf(e)}function jn(e){return U(e.patternProperties)[0]}function ua(e){const t=jn(e);return bc(t)}function Vt(e){return e.patternProperties[jn(e)]}function Ot(e){return Ce(e,"Record")}function pa(e){return we({"~kind":"Rest"},{type:"rest",items:e},{})}function fa(e){return Ce(e,"Rest")}function em(e){return we({"~kind":"This"},{$ref:"#"},e)}function tm(e){return Ce(e,"This")}function vl(e){return we({"~kind":"Undefined"},{type:"undefined"},e)}function _s(e){return Ce(e,"Undefined")}function nm(e){return we({"~kind":"Void"},{type:"void"},e)}function os(e){return Ce(e,"Void")}function zS(e,t){return g(e,"Array")?Ir(t[0]):g(e,"Capitalize")?yh(t[0]):g(e,"ConstructorParameters")?Ph(t[0]):g(e,"Evaluate")?LP(t[0]):g(e,"Exclude")?Oh(t[0],t[1]):g(e,"Extract")?Rh(t[0],t[1]):g(e,"Index")?Ql(t[0],t[1]):g(e,"InstanceType")?Uh(t[0]):g(e,"Lowercase")?wh(t[0]):g(e,"NonNullable")?Kh(t[0]):g(e,"Omit")?Vh(t[0],t[1]):g(e,"Parameters")?Qh(t[0]):g(e,"Partial")?Zh(t[0]):g(e,"Pick")?eg(t[0],t[1]):g(e,"Readonly")?ng(t[0]):g(e,"KeyOf")?ed(t[0]):g(e,"Record")?Xf(t[0],t[1]):g(e,"Required")?ig(t[0]):g(e,"ReturnType")?ag(t[0]):g(e,"Uncapitalize")?vh(t[0]):g(e,"Uppercase")?Sh(t[0]):Ec(gn(e),t)}function as(){throw Error("Unreachable")}function rm(e,t=[]){return Te(e,(n,r)=>rm(r,[...t,n[1]]),()=>t)}function cr(e){return g(e.length,3)?[e[0],...rm(e[1])]:[]}function KS(e){return Mi(e[0],e[2],e[4])}function GS(e){return Mi(e[0],e[2],e[2])}function VS(e){return Mi(e[0],Kt(),e[2])}function WS(e){return Mi(e,Kt(),Kt())}function JS(e){return cr(e)}function QS(e){return e[1]}function YS(e){return cr(e)}function ZS(e){return e[1]}function XS(e){return zS(e[0],e[1])}function e1(e){return null}function t1(e){return zn()}function n1(e){return wr()}function r1(e){return Tf()}function s1(e){return vl()}function i1(e){return kl()}function o1(e){return aa()}function a1(e){return bl()}function c1(e){return Kt()}function l1(e){return ml()}function d1(e){return Me({})}function u1(e){return Nt()}function p1(e){return xl()}function f1(e){return nm()}function m1(e){return em()}function h1(e){return De(BigInt(e))}function g1(e){return De(g(e,"true"))}function b1(e){return De(parseFloat(e))}function k1(e){return De(e)}function x1(e){return e[1]}function y1(e){return De(e)}function w1(e){return g(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function v1(e){return e[1]}function S1(e){return eh(e)}function j1(e){return g(e.length,6)?_o(e[1],e[3],e[5]):_o(e[1],e[3],Kt())}function I1(e){return e.length>0}function C1(e){return e.reduce((t,n)=>g(n.length,3)?[...t,[n[1]]]:[...t,[]],[])}function E1(e){return g(e.length,6)?[e[1],e[3],e[5]]:[]}function T1(e){return q(e)&&g(e.length,3)?e[1]:e}function A1(e){return g(e.length,2)?e[1]:[]}function Au(e,t){return t.reduce((n,r)=>{const s=r;return g(s.length,1)?Ql(n,s[0]):g(s.length,0)?Ir(n):as()},e)}function Pu(e,t){return g(t.length,3)?Th(e,t[0],t[1],t[2]):e}function P1(e,t){return q(t)&&g(t.length,0)?e:lg(e,t)}function N1(e){const[t,n,r,s,i]=e;return P1(Pu(t?ed(Au(n,r)):Au(n,r),s),i)}function Sl(e,t){return g(t.length,3)?(()=>{const[n,r,s]=t,i=Sl(r,s);if(g(n,"&"))return Be(i)?Bn([e,...i.allOf]):Bn([e,i]);if(g(n,"|"))return fe(i)?Je([e,...i.anyOf]):Je([e,i]);as()})():e}function O1(e){const[t,n]=e;return Sl(t,n)}function R1(e){const[t,n]=e;return Sl(t,n)}function M1(e){return FP(e[1])}function $1(e){return e[1]}function F1(e){return Pi(e[0],e[2])}function L1(e){return g(e.length,4)?mc(e[1],e[3]):g(e.length,2)?mc(e[1],Kt()):as()}function D1(e){return`${e}`}function _1(e){return qn(e[3])?$i:un(e[3])?da:Ri(e[3])||Fn(e[3])?Qr:as()}function U1(e){return e.length>0}function B1(e){return e.length>0}function H1(e){const[t,n,r,s,i]=e;return{[n]:t&&r?rr(nr(i)):t&&!r?rr(i):!t&&r?nr(i):i}}function q1(e){return cr(e)}function sm(e){return e.reduce((t,n)=>E(n,$i)||E(n,da)||E(n,Qr)?[t[0],kt(t[1],n)]:[kt(t[0],n),t[1]],[{},{}])}function z1(e){return sm(e[1])}function K1(e){const[t,n]=e,r=g(U(n).length,0)?{}:{patternProperties:n};return Me(t,r)}function G1(e){return g(e.length,5)?rr(nr(e[4])):g(e.length,3)?e[2]:g(e.length,4)?g(e[2],"readonly")?rr(e[3]):nr(e[3]):as()}function V1(e){if(!q(e)||!g(e.length,3))return e;const[t,n,r]=e;return t&&r?rr(nr(n)):t&&!r?rr(n):!t&&r?nr(n):n}function W1(e){return g(e.length,2)?pa(e[1]):g(e.length,1)?e[0]:as()}function J1(e){return cr(e)}function Q1(e){return Sn(e[1])}function Y1(e){return rr(nr(e[4]))}function Z1(e){return rr(e[3])}function X1(e){return nr(e[3])}function ej(e){return e[2]}function tj(e){return g(e.length,2)?pa(e[1]):g(e.length,1)?e[0]:as()}function nj(e){return cr(e)}function rj(e){return Ai(e[1],e[4])}function sj(e){return Ti(e[2],e[5])}function Nu(e,t){return g(e,"remove")?pS(t):g(e,"add")?rr(t):t}function ij(e){return g(e.length,2)&&g(e[0],"-")?"remove":g(e.length,2)&&g(e[0],"+")||g(e.length,1)?"add":"none"}function Ou(e,t){return g(e,"remove")?gS(t):g(e,"add")?nr(t):t}function oj(e){return g(e.length,2)&&g(e[0],"-")?"remove":g(e.length,2)&&g(e[0],"+")||g(e.length,1)?"add":"none"}function aj(e){return g(e.length,2)?[e[1]]:[]}function cj(e){return q(e[6])&&g(e[6].length,1)?Tc(gc(e[3]),e[5],e[6][0],Nu(e[1],Ou(e[8],e[10]))):Tc(gc(e[3]),e[5],gn(e[3]),Nu(e[1],Ou(e[8],e[10])))}function lj(e){return gn(e)}function dj(e){return BigInt(e)}function uj(e){return parseFloat(e)}function pj(e){return g(e,"true")}function fj(e){return null}function mj(e){return{[e[0]]:e[2]}}function hj(e){return cr(e)}function gj(e){return e.reduce((t,n)=>kt(t,n),{})}function bj(e){return gj(e[1])}function kj(e){return cr(e)}function xj(e){return e[1]}function yj(e){return bl()}function wj(e){return zn()}function vj(e){return wr()}function Sj(e){return aa()}function jj(e){return Nt()}function Ij(e){return De(e)}function Cj(e){return Je(e[1])}function Ej(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Tj(e){return[e[0],...e[1]]}function Aj(e){return e[1]}function Pj(e){return cr(e)}function Nj(e){return g(e.length,2)?e[1]:[]}function Oj(e){const t=e[2],n=e[3],[r,s]=e[4],i=g(U(s).length,0)?{}:{patternProperties:s};return{[e[1]]:Pi(t,Bl(n,r,i))}}function Rj(e){const t=e[2],[n,r]=e[3],s=g(U(r).length,0)?{}:{patternProperties:r};return{[e[1]]:Bl(t,n,s)}}function Mj(e){return{[e[1]]:Pi(e[2],e[4])}}function $j(e){return{[e[1]]:e[3]}}function Fj(e){return null}function Lj(e){return cr(e)}function Dj(e){return e[1]}function _j(e){const[t,n]=[e[0],e[1]];return DP(kt(t,sm(n)[0]))}function jl(e){return g(e.length,2)}function Le(e,t,n){return jl(e)?t(e[0],e[1]):n()}function Uj(e,t){return g(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Dt(e,t){for(let n=0;n<e.length;n++){const r=Uj(e[n],t);if(jl(r))return r}return[]}function kc(e,t){return Array.from({length:t-e+1},(n,r)=>String.fromCharCode(e+r))}const Bj=[...kc(97,122),...kc(65,90)],im="0",om=kc(49,57),Il=[im,...om],Hj=" ",Cl=`
|
|
263
|
-
|
|
262
|
+
*/const ui=se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Mp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Mp(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $p(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Mp(e))&&(r&&(r+=" "),r+=t);return r}const bu=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ku=$p,yy=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ku(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(u=>{const m=n==null?void 0:n[u],p=i==null?void 0:i[u];if(m===null)return null;const h=bu(m)||bu(p);return s[u][h]}),d=n&&Object.entries(n).reduce((u,m)=>{let[p,h]=m;return h===void 0||(u[p]=h),u},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,m)=>{let{class:p,className:h,...b}=m;return Object.entries(b).every(k=>{let[S,C]=k;return Array.isArray(C)?C.includes({...i,...d}[S]):{...i,...d}[S]===C})?[...u,p,h]:u},[]);return ku(e,o,f,n==null?void 0:n.class,n==null?void 0:n.className)},Vc="-",wy=e=>{const t=Sy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const d=o.split(Vc);return d[0]===""&&d.length!==1&&d.shift(),Fp(d,t)||vy(o)},getConflictingClassGroupIds:(o,d)=>{const f=n[o]||[];return d&&r[o]?[...f,...r[o]]:f}}},Fp=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Fp(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Vc);return(o=t.validators.find(({validator:d})=>d(i)))==null?void 0:o.classGroupId},xu=/^\[(.+)\]$/,vy=e=>{if(xu.test(e)){const t=xu.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Sy=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Iy(Object.entries(e.classGroups),n).forEach(([i,o])=>{lc(o,r,i,t)}),r},lc=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:yu(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(jy(s)){lc(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{lc(o,yu(t,i),n,r)})})},yu=(e,t)=>{let n=e;return t.split(Vc).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},jy=e=>e.isThemeGetter,Iy=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,d])=>[t+o,d])):i);return[n,s]}):e,Cy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},Lp="!",Ey=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=d=>{const f=[];let u=0,m=0,p;for(let C=0;C<d.length;C++){let x=d[C];if(u===0){if(x===s&&(r||d.slice(C,C+i)===t)){f.push(d.slice(m,C)),m=C+i;continue}if(x==="/"){p=C;continue}}x==="["?u++:x==="]"&&u--}const h=f.length===0?d:d.substring(m),b=h.startsWith(Lp),k=b?h.substring(1):h,S=p&&p>m?p-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:S}};return n?d=>n({className:d,parseClassName:o}):o},Ty=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Ay=e=>({cache:Cy(e.cacheSize),parseClassName:Ey(e),...wy(e)}),Py=/\s+/,Ny=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(Py);let d="";for(let f=o.length-1;f>=0;f-=1){const u=o[f],{modifiers:m,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:b}=n(u);let k=!!b,S=r(k?h.substring(0,b):h);if(!S){if(!k){d=u+(d.length>0?" "+d:d);continue}if(S=r(h),!S){d=u+(d.length>0?" "+d:d);continue}k=!1}const C=Ty(m).join(":"),x=p?C+Lp:C,N=x+S;if(i.includes(N))continue;i.push(N);const P=s(S,k);for(let L=0;L<P.length;++L){const D=P[L];i.push(x+D)}d=u+(d.length>0?" "+d:d)}return d};function Oy(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Dp(t))&&(r&&(r+=" "),r+=n);return r}const Dp=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Dp(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ry(e,...t){let n,r,s,i=o;function o(f){const u=t.reduce((m,p)=>p(m),e());return n=Ay(u),r=n.cache.get,s=n.cache.set,i=d,d(f)}function d(f){const u=r(f);if(u)return u;const m=Ny(f,n);return s(f,m),m}return function(){return i(Oy.apply(null,arguments))}}const Ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},_p=/^\[(?:([a-z-]+):)?(.+)\]$/i,My=/^\d+\/\d+$/,$y=new Set(["px","full","screen"]),Fy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ly=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Dy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_y=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Uy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jn=e=>As(e)||$y.has(e)||My.test(e),hr=e=>Os(e,"length",Wy),As=e=>!!e&&!Number.isNaN(Number(e)),Ga=e=>Os(e,"number",As),ri=e=>!!e&&Number.isInteger(Number(e)),By=e=>e.endsWith("%")&&As(e.slice(0,-1)),me=e=>_p.test(e),gr=e=>Fy.test(e),Hy=new Set(["length","size","percentage"]),qy=e=>Os(e,Hy,Up),zy=e=>Os(e,"position",Up),Ky=new Set(["image","url"]),Gy=e=>Os(e,Ky,Qy),Vy=e=>Os(e,"",Jy),si=()=>!0,Os=(e,t,n)=>{const r=_p.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Wy=e=>Ly.test(e)&&!Dy.test(e),Up=()=>!1,Jy=e=>_y.test(e),Qy=e=>Uy.test(e),Yy=()=>{const e=Ye("colors"),t=Ye("spacing"),n=Ye("blur"),r=Ye("brightness"),s=Ye("borderColor"),i=Ye("borderRadius"),o=Ye("borderSpacing"),d=Ye("borderWidth"),f=Ye("contrast"),u=Ye("grayscale"),m=Ye("hueRotate"),p=Ye("invert"),h=Ye("gap"),b=Ye("gradientColorStops"),k=Ye("gradientColorStopPositions"),S=Ye("inset"),C=Ye("margin"),x=Ye("opacity"),N=Ye("padding"),P=Ye("saturate"),L=Ye("scale"),D=Ye("sepia"),j=Ye("skew"),I=Ye("space"),T=Ye("translate"),M=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",me,t],O=()=>[me,t],J=()=>["",Jn,hr],ae=()=>["auto",As,me],ce=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],de=()=>["","0",me],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ue=()=>[As,me];return{cacheSize:500,separator:":",theme:{colors:[si],spacing:[Jn,hr],blur:["none","",gr,me],brightness:ue(),borderColor:[e],borderRadius:["none","","full",gr,me],borderSpacing:O(),borderWidth:J(),contrast:ue(),grayscale:de(),hueRotate:ue(),invert:de(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[By,hr],inset:te(),margin:te(),opacity:ue(),padding:O(),saturate:ue(),scale:ue(),sepia:de(),skew:ue(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[gr]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ce(),me]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ri,me]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:de()}],shrink:[{shrink:de()}],order:[{order:["first","last","none",ri,me]}],"grid-cols":[{"grid-cols":[si]}],"col-start-end":[{col:["auto",{span:["full",ri,me]},me]}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":[si]}],"row-start-end":[{row:["auto",{span:[ri,me]},me]}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,t]}],"min-w":[{"min-w":[me,t,"min","max","fit"]}],"max-w":[{"max-w":[me,t,"none","full","min","max","fit","prose",{screen:[gr]},gr]}],h:[{h:[me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",gr,hr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ga]}],"font-family":[{font:[si]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",me]}],"line-clamp":[{"line-clamp":["none",As,Ga]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jn,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jn,hr]}],"underline-offset":[{"underline-offset":["auto",Jn,me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ce(),zy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",qy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Gy]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[k]}],"gradient-via-pos":[{via:[k]}],"gradient-to-pos":[{to:[k]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...le(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:le()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[Jn,me]}],"outline-w":[{outline:[Jn,hr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Jn,hr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",gr,Vy]}],"shadow-color":[{shadow:[si]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",gr,me]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[P]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[P]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:ue()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:ue()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[ri,me]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Jn,hr,Ga]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Zy=Ry(Yy);function W(...e){return Zy($p(e))}const Xy=yy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Kr=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?O0:"button";return a.jsx(o,{className:W(Xy({variant:t,size:n,className:e})),ref:i,...s})});Kr.displayName="Button";const Wc=$0,ew=R0,Bp=y.forwardRef(({className:e,...t},n)=>a.jsx(gp,{ref:n,className:W("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Bp.displayName=gp.displayName;const Zo=y.forwardRef(({className:e,children:t,hideCloseButton:n,...r},s)=>a.jsxs(ew,{children:[a.jsx(Bp,{}),a.jsxs(bp,{ref:s,"aria-modal":"true",className:W("fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100dvh-24px)] w-[calc(100vw-24px)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,!n&&a.jsxs(M0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(ui,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Zo.displayName=bp.displayName;const Jc=({className:e,...t})=>a.jsx("div",{className:W("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Jc.displayName="DialogHeader";const Hp=({className:e,...t})=>a.jsx("div",{className:W("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Hp.displayName="DialogFooter";const Xo=y.forwardRef(({className:e,...t},n)=>a.jsx(kp,{ref:n,className:W("text-lg font-semibold leading-none tracking-tight",e),...t}));Xo.displayName=kp.displayName;const ea=y.forwardRef(({className:e,...t},n)=>a.jsx(xp,{ref:n,className:W("text-sm text-muted-foreground",e),...t}));ea.displayName=xp.displayName;const tw={"app.restoring":"Restoring workspace…","layout.workspace.pathAria":"Workspace path","layout.workspace.empty":"No workspace","layout.action.rewind":"Rewind session","layout.action.openNavigation":"Open navigation","terminal.title":"Terminal","terminal.status.connected":"Terminal connected","terminal.status.disconnected":"Terminal disconnected","terminal.action.minimize":"Minimize terminal","terminal.action.restore":"Restore terminal","terminal.action.close":"Close terminal","sidebar.brand.badge":"WEB","sidebar.action.collapse":"Collapse sidebar","sidebar.action.expand":"Expand sidebar","sidebar.navigationAria":"Task navigation","sidebar.action.newTask":"New Task","sidebar.action.newTaskShort":"New task","sidebar.action.taskBoard":"Task board","sidebar.action.terminal":"Terminal","sidebar.action.terminalToggle":"Toggle terminal","sidebar.action.searchTasks":"Search tasks","sidebar.unreadTasks":"{count} unread tasks","sidebar.section.skills":"Skills","sidebar.section.mcp":"MCP","sidebar.section.settings":"Settings","sidebar.status.user":"User","sidebar.status.feedLive":"Task feed live","sidebar.status.feedOffline":"Task feed offline","sidebar.empty.title":"No tasks yet","sidebar.empty.hint":"Dispatch one from the home view","sidebar.group.running":"RUNNING","sidebar.group.queued":"QUEUED","sidebar.group.interrupted":"INTERRUPTED","sidebar.group.failed":"FAILED","sidebar.group.cancelled":"CANCELLED","sidebar.group.done":"DONE","sidebar.group.showMore":"Show {count} more","sidebar.group.showLess":"Show less","sidebar.view.project":"Projects","sidebar.view.status":"Status","sidebar.view.projectAria":"Group sessions by project","sidebar.view.statusAria":"Group sessions by status","sidebar.project.active":"active","sidebar.project.expand":"Expand {name}","sidebar.project.collapse":"Collapse {name}","sidebar.project.newTask":"New task in {name}","sidebar.project.reorder":"Reorder {name}, position {position} of {count}","sidebar.project.reorderHint":"Drag to reorder, or use Up and Down arrow keys","sidebar.project.reordered":"Moved {name} to position {position}","sidebar.project.projects":"Projects","sidebar.catalog.syncing":"Syncing task history…","sidebar.catalog.loaded":"{count} loaded","sidebar.catalog.incomplete":"Task history is incomplete","sidebar.catalog.retry":"Retry","projects.dialog.title":"Projects","projects.dialog.description":"Bind local folders to switch task context without restarting Blade.","projects.bind.placeholder":"/absolute/path/to/project","projects.bind.pathLabel":"Project path","projects.bind.action":"Bind","projects.bind.failed":"Failed to bind project","projects.pick.action":"Choose project folder","projects.pick.actionShort":"Choose","projects.pick.picking":"Choosing…","projects.pick.failed":"Failed to choose a project folder","projects.unbind.action":"Unbind project","projects.unavailable":"unavailable","sidebar.language.label":"Language","sidebar.language.aria":"Switch language","sidebar.language.en":"EN","sidebar.language.zh":"中","session.env.worktree":"worktree","session.env.local":"local","session.action.select":"Select {title}","session.action.save":"Save {title}","session.action.cancel":"Cancel {title}","session.action.more":"More actions for {title}","session.action.fork":"Fork {title}","session.action.forkShort":"Fork","session.action.rename":"Rename {title}","session.action.renameShort":"Rename","session.action.archive":"Archive {title}","session.action.archiveShort":"Archive","session.action.export":"Export {title} as Markdown","session.action.exportShort":"Export Markdown","session.action.exportingShort":"Exporting…","session.action.delete":"Delete {title}","session.action.deleteShort":"Delete","session.action.stop":"Stop {title}","session.action.stopping":"Stopping {title}","session.action.retry":"Retry {title}","session.action.retrying":"Retrying {title}","session.reason.cancelledByUser":"Cancelled by user","session.title.codeReview":"Code Review","session.forkedFrom":"Forked from","session.retriedFrom":"Retried from","session.retryShort":"retry","session.queued":"#{position}/{depth} queued","archive.title":"Archive","archive.subtitle":"Stored safely outside the active task list","archive.open":"Open session archive","archive.refresh":"Refresh archived sessions","archive.retry":"Retry","archive.loading":"Loading archive…","archive.empty":"No archived sessions","archive.restore":"Restore {title}","archive.restoreShort":"Restore","archive.restoreAncestor":"Restore the archive root first","archive.inherited":"Archived with {id}","taskSwitcher.title":"Task switcher","taskSwitcher.description":"Search and open tasks across every project.","taskSwitcher.searchAria":"Search tasks","taskSwitcher.placeholder":"Search title, project, branch, status, or session ID…","taskSwitcher.results":"{count} results","taskSwitcher.recent":"Recent tasks","taskSwitcher.scope":"{count} tasks indexed","taskSwitcher.indexing":"Indexing tasks…","taskSwitcher.resultsAria":"Task search results","taskSwitcher.current":"Current","taskSwitcher.unread":"{count} unread","taskSwitcher.needsAction":"{count} need action","taskSwitcher.new":"New","taskSwitcher.empty":"No matching tasks","taskSwitcher.emptyHint":"Try a project, branch, status, or shorter phrase.","taskSwitcher.hint.navigate":"navigate","taskSwitcher.hint.open":"open","taskSwitcher.hint.toggle":"toggle","taskSwitcher.action.failed":"Task action failed","commandCenter.title":"Command center","commandCenter.description":"Search tasks or run workspace and application actions.","commandCenter.searchAria":"Search actions","commandCenter.placeholder":"Search actions, settings, or tools…","commandCenter.modeAria":"Command center mode","commandCenter.mode.tasks":"Tasks","commandCenter.mode.commands":"Actions","commandCenter.actions":"{count} actions","commandCenter.resultsAria":"Action search results","commandCenter.empty":"No matching actions","commandCenter.emptyHint":"Try a tool, panel, or setting name.","commandCenter.action.newTask":"New task","commandCenter.action.newTaskDescription":"Open a clean task composer","commandCenter.action.preview":"Toggle preview","commandCenter.action.previewDescription":"Review files, diffs, run logs, and web pages","commandCenter.action.terminal":"Toggle terminal","commandCenter.action.terminalDescription":"Open or close the workspace shell","commandCenter.action.settings":"Open settings","commandCenter.action.settingsDescription":"Configure appearance and behavior","commandCenter.action.models":"Configure models","commandCenter.action.modelsDescription":"Select providers and task models","commandCenter.action.shortcuts":"View keyboard shortcuts","commandCenter.action.shortcutsDescription":"Browse global and contextual keys","commandCenter.action.skills":"Manage skills","commandCenter.action.skillsDescription":"Discover and configure agent capabilities","commandCenter.action.mcp":"Manage MCP servers","commandCenter.action.mcpDescription":"Configure connected tools and servers","commandCenter.action.sidebar":"Toggle sidebar","commandCenter.action.sidebarDescription":"Show or hide project navigation","taskHome.eyebrow":"Task dispatcher · Ready","taskHome.feed.connecting":"Task dispatcher · Connecting","taskHome.feed.reconnecting":"Task dispatcher · Reconnecting","taskHome.feed.offline":"Task dispatcher · Offline","taskHome.feed.offlineDescription":"Live task updates are paused. Running tasks continue on the server.","taskHome.feed.retry":"Reconnect","taskHome.hero.prefix":"What should Blade build in","taskHome.hero.projectFallback":"current workspace","taskHome.hero.subtitle":"Dispatch a task and keep moving. Each task runs in its own worktree, persists state, and returns with a reviewable workspace when it's done.","taskHome.templates.title":"Templates","taskHome.templates.hint":"1–4 to prefill","taskHome.template.explore.title":"Explore","taskHome.template.explore.description":"Trace behavior and explain the system","taskHome.template.explore.hint":"Trace a call · map a module","taskHome.template.build.title":"Build","taskHome.template.build.description":"Implement a production-ready feature","taskHome.template.build.hint":"Ship a feature end-to-end","taskHome.template.review.title":"Review","taskHome.template.review.description":"Find correctness and regression risks","taskHome.template.review.hint":"Audit current changes","taskHome.review.attachmentsUnsupported":"Code review does not accept attachments","taskHome.review.outputSchemaUnsupported":"Code review uses its own structured report schema","taskHome.review.usage":"Usage: /review [uncommitted | base <ref> | commit <sha>]","taskHome.review.running":"Read-only code review in progress","taskHome.review.stale":"Review target changed while the reviewer was running","taskHome.review.aborted":"Code review aborted","taskHome.review.interrupted":"Code review interrupted by process restart","taskHome.review.failed":"Code review failed","taskHome.review.startFailed":"Failed to start code review","taskHome.review.invalidTarget":"The selected review target is invalid or has no changes","taskHome.review.conflict":"This session already has active work","taskHome.template.fix.title":"Fix","taskHome.template.fix.description":"Diagnose and repair a concrete failure","taskHome.template.fix.hint":"Bisect · reproduce · patch","taskHome.context.isolationToggleTitle":"Toggle task isolation","taskHome.context.projectSelect":"Select target project","taskHome.context.isolation.worktree":"Isolated worktree","taskHome.context.isolation.local":"Local workspace","taskHome.context.branchFallback":"no branch","taskHome.context.preparing":"Preparing worktree","taskHome.setup.aria":"Task setup status","taskHome.setup.title":"Finish setup","taskHome.setup.description":"Keep drafting while Blade verifies the workspace and model.","taskHome.setup.workspace.title":"Workspace","taskHome.setup.workspace.loading":"Checking available workspaces…","taskHome.setup.workspace.ready":"{project} selected","taskHome.setup.workspace.required":"Choose an available project","taskHome.setup.workspace.empty":"No project","taskHome.setup.workspace.action":"Choose","taskHome.setup.workspace.retry":"Reload workspaces","taskHome.setup.model.title":"Model","taskHome.setup.model.loading":"Checking configuration…","taskHome.setup.model.ready":"Ready for this task","taskHome.setup.model.required":"Configure or select a model","taskHome.setup.model.action":"Configure","taskHome.setup.model.retry":"Retry","taskHome.composer.placeholder":"Describe the outcome, constraints, and verification you expect...","taskHome.error.dismiss":"Dismiss","taskHome.recent.title":"Recent tasks","taskHome.recent.total":"{count} total","taskHome.recent.partial":"{count} loaded · syncing","taskHome.recent.incomplete":"{count} loaded · history incomplete","taskSwitcher.indexingLoaded":"{count} loaded · syncing history","taskHome.footer.note":"Worktree isolation keeps parallel tasks from touching your active checkout","kanban.title":"Task board","kanban.subtitle":"Dispatch work across bound projects and focus on tasks that need intervention.","kanban.taskCount":"{count} tasks","kanban.searchAria":"Search task board","kanban.searchPlaceholder":"Search tasks...","kanban.projectFilterAria":"Filter task board by project","kanban.projectAll":"All projects","kanban.feed.offline":"Live updates are offline. Running tasks continue.","kanban.autoClaim.running":"Auto-claiming","kanban.autoClaim.paused":"Auto-claim paused","kanban.column.waiting":"Waiting","kanban.column.waitingDescription":"Queued for an execution slot","kanban.column.active":"In progress","kanban.column.activeDescription":"Agents currently working","kanban.column.blocked":"Blocked","kanban.column.blockedDescription":"Needs input, retry, or attention","kanban.column.review":"Ready for review","kanban.column.reviewDescription":"Completed work awaiting acceptance","kanban.column.empty":"No tasks in this stage","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","kanban.kind.feature":"Feature","kanban.kind.bug":"Bug","kanban.kind.maintenance":"Maintenance","kanban.kind.research":"Research","kanban.card.unread":"New task update","kanban.card.queuePosition":"Queue #{position} of {depth}","kanban.card.diff":"{files} files · +{additions} −{deletions}","kanban.action.newTask":"New task","kanban.action.open":"Open task","kanban.action.respond":"Respond to blocker","kanban.action.inspect":"Inspect changes","kanban.action.edit":"Edit task details","kanban.action.cancel":"Cancel task","kanban.action.retry":"Retry task","kanban.action.archive":"Accept and archive","kanban.dialog.createTitle":"Dispatch task","kanban.dialog.createDescription":"The task runs directly in the selected project workspace.","kanban.dialog.editTitle":"Edit task","kanban.dialog.editDescription":"Update planning metadata without interrupting the running agent.","kanban.dialog.localExecution":"Local workspace · no worktree isolation","kanban.dialog.cancel":"Cancel","kanban.dialog.dispatch":"Dispatch","kanban.dialog.save":"Save","kanban.dialog.submitFailed":"Task operation failed","kanban.field.title":"Title","kanban.field.titlePlaceholder":"Optional concise task title","kanban.field.prompt":"Task brief","kanban.field.promptPlaceholder":"Describe the outcome, constraints, and verification expected...","kanban.field.project":"Project","kanban.field.kind":"Type","kanban.field.priority":"Priority","kanban.field.dueAt":"Due","capacity.title":"{inFlight} running · {queued} queued · max {max}","capacity.suffix.running":" running","capacity.queued":"{queued} queued","recent.status.running":"running","recent.status.queued":"queued","recent.status.paused":"paused","recent.status.failed":"failed","recent.status.cancelled":"cancelled","recent.status.done":"done","recent.time.justNow":"just now","recent.time.minutes":"{n}m ago","recent.time.hours":"{n}h ago","recent.time.days":"{n}d ago","recent.session.fallbackShort":"Session {id}","recent.session.fallbackDated":"Session {y}-{m}-{d} {hh}:{mm}","attention.unreadAnnouncement":"{count} unread task updates","attention.notification.completed":"Task completed","attention.notification.failed":"Task failed","attention.notification.interrupted":"Task interrupted","attention.notification.permission":"Approval required","attention.notification.question":"Answer required","attention.notification.elicitation":"MCP input required","interaction.permission.title":"Permission required: {tool}","interaction.permission.once":"Allow once","interaction.permission.session":"Allow for session","interaction.permission.project":"Allow for project","interaction.permission.deny":"Deny","interaction.permission.failed":"Failed to respond to permission","interaction.question.answered":"Questions answered","interaction.question.other":"Other","interaction.question.submit":"Submit answers","interaction.question.failed":"Failed to submit answers","interaction.elicitation.title":"MCP input requested","interaction.elicitation.submit":"Submit to MCP","interaction.elicitation.open":"Open external URL","interaction.elicitation.decline":"Decline","interaction.elicitation.cancel":"Cancel","interaction.elicitation.responded":"MCP request answered","interaction.elicitation.cancelled":"MCP request cancelled","interaction.elicitation.failed":"Failed to respond to MCP request","interaction.elicitation.warning":"Only continue if you trust this MCP server and understand the request.","interaction.bar.permissionTitle":"Agent needs approval","interaction.bar.permissionHint":"Review the pending tool request before this task can continue.","interaction.bar.questionTitle":"Agent needs your answer","interaction.bar.questionHint":"Answer the pending question before this task can continue.","interaction.bar.elicitationTitle":"MCP server needs your input","interaction.bar.elicitationHint":"Review the MCP request before this task can continue.","interaction.bar.review":"Review request","interaction.badge.permission":"Needs approval","interaction.badge.question":"Needs answer","interaction.badge.elicitation":"MCP input","artifact.env.isolated":"isolated","artifact.env.local":"local","artifact.review":"Review changes","artifact.commits":"{count} commits","artifact.apply":"Apply","artifact.retryApply":"Retry apply","artifact.applying":"Applying","artifact.applied":"Applied","artifact.discard":"Discard task changes","artifact.discarded":"Discarded","artifact.conflict":"The task changes could not be applied safely.","artifact.conflictHint":"The isolated changes are preserved. Review them, resolve the source project, then retry or discard.","artifact.discardDialog.title":"Discard isolated changes?","artifact.discardDialog.description":"Remove {count} changed files from the isolated task workspace for {project}.","artifact.discardDialog.warning":"This permanently removes the task worktree and branch. Your source project is not modified.","artifact.discardDialog.cancel":"Keep changes","artifact.discardDialog.confirm":"Discard changes","chat.list.empty.eyebrow":"Blade · Ready","chat.list.empty.title":"Start a conversation to begin","chat.list.empty.hint":"Ask a question, describe a change, or paste a stack trace.","chat.list.loading.eyebrow":"Conversation history","chat.list.loading.title":"Restoring conversation…","chat.list.loading.hint":"Loading messages, task state, and live updates. Larger conversations may take a moment.","chat.list.showEarlier":"Show {count} earlier messages","chat.list.showEarlierWithRemaining":"Show {count} earlier messages, {remaining} hidden","chat.list.jumpLatest":"Jump to latest","chat.turns.aria":"Jump to a previous message","chat.turns.label":"Turn {n}","chat.timeline.thinking":"Thought process","chat.timeline.tools.runningOne":"Running 1 command","chat.timeline.tools.running":"Running {count} commands","chat.timeline.tools.completedOne":"Executed 1 command","chat.timeline.tools.completed":"Executed {count} commands","chat.timeline.tools.completedOneWithError":"Executed 1 command · failed","chat.timeline.tools.completedWithErrors":"Executed {count} commands · {errors} failed","chat.error.dismiss":"Dismiss error","chat.error.queueFull":"The guidance queue is full. Wait for pending instructions to start, then retry.","chat.error.turnChanged":"The active turn changed before this message was accepted. Review and retry it.","chat.error.title.submission":"Message not sent.","chat.error.title.execution":"Run stopped.","chat.error.title.navigation":"Task not opened.","chat.error.title.generic":"Action failed.","chat.error.action.returnDraft":"Return to draft","chat.error.action.editResend":"Edit and resend","chat.error.action.retryTask":"Retry task","chat.error.action.retryingTask":"Retrying…","chat.error.action.checkModels":"Check model settings","task.failure.authentication":"Provider authentication failed. Check model credentials.","task.failure.permission":"Provider rejected this request. Check account and model permissions.","task.failure.rateLimit":"Provider rate limit or quota exceeded.","task.failure.timeout":"Provider request timed out.","task.failure.network":"Provider connection failed.","task.failure.modelUnavailable":"The selected model is unavailable.","task.failure.contextLimit":"The request exceeded the model context limit.","task.failure.unsupportedInput":"The selected model does not support this input.","task.failure.capacity":"Task admission capacity is full. Retry after running tasks complete.","task.failure.runtime":"Agent execution failed.","chat.connection.reconnecting":"Reconnecting live updates. The active run continues in the background.","chat.connection.offline":"Live updates are offline. Progress shown here may be stale.","chat.connection.retry":"Reconnect","chat.side.title":"Side conversation","chat.side.loading":"Answering side question...","chat.side.failed":"Side conversation failed.","chat.side.dismiss":"Dismiss side conversation","chat.footer.disclaimer":"Blade can make mistakes. Please check important information.","chat.input.placeholder.default":"Type @ for files, / for commands...","chat.input.placeholder.steering":"Add guidance to steer the active turn...","chat.input.steering.status":"Active turn is steerable","chat.input.steering.queued":"Guidance accepted · {count} pending","chat.input.steering.enterHint":" · Enter sends guidance","chat.input.followUp.queued":"Follow-up accepted · {count} queued for the next turn","chat.input.steering.recoveredOne":"Recovered {count} queued instruction after restart","chat.input.steering.recoveredMany":"Recovered {count} queued instructions after restart","chat.input.attachment.add":"Attach images","chat.input.attachment.remove":"Remove","chat.input.attachment.countLimit":"You can attach up to {count} images.","chat.input.attachment.sizeLimit":"Images must stay under {size} total. Remove an image or choose smaller files.","chat.input.attachment.readFailed":"Blade could not read one of these images.","chat.input.attachment.usage":"{count}/{limit} images · {used} of {budget}","chat.input.attachment.modelUnsupported":"{model} does not support images. Choose a vision model or remove the images.","chat.input.attachment.modelRequired":"Choose a vision-capable model before attaching images.","chat.input.model.placeholder":"Select Model","chat.input.model.empty":"No models configured","chat.input.model.vision":"Vision","chat.input.model.change":"Change model","chat.input.model.locked":"Wait for the active turn to finish before switching models","chat.input.effort.label":"Effort {effort}","chat.input.effort.heading":"Reasoning effort","chat.input.effort.change":"Change reasoning effort","chat.input.effort.locked":"Wait for the active turn to finish before changing reasoning effort","chat.input.effort.option":"Use {effort} reasoning effort","chat.input.serviceTier.label":"Speed {tier}","chat.input.serviceTier.heading":"Provider service tier","chat.input.serviceTier.change":"Change provider service tier","chat.input.serviceTier.locked":"Wait for the current turn to finish before changing service tier","chat.input.serviceTier.option":"Use {tier} service tier","chat.input.serviceTier.fastHint":"priority","chat.input.serviceTier.flexHint":"lower cost","chat.input.responseVerbosity.label":"Output {verbosity}","chat.input.responseVerbosity.heading":"Response verbosity","chat.input.responseVerbosity.change":"Change response verbosity","chat.input.responseVerbosity.locked":"Wait for the current turn to finish before changing response verbosity","chat.input.responseVerbosity.option":"Use {verbosity} response verbosity","chat.input.responseVerbosity.autoHint":"model default","chat.input.outputSchema.title":"Structured output","chat.input.outputSchema.description":"Require this turn to finish with an object that matches the JSON Schema.","chat.input.outputSchema.change":"Set structured output schema","chat.input.outputSchema.locked":"Wait for the current turn to finish before changing the output schema","chat.input.outputSchema.editor":"JSON Schema editor","chat.input.outputSchema.placeholder":"Paste a JSON Schema object","chat.input.outputSchema.example":"Use example","chat.input.outputSchema.clear":"Clear","chat.input.outputSchema.invalid":"Enter a valid JSON object. The server validates the complete schema.","chat.input.outputSchema.shellUnsupported":"Structured output cannot be combined with a shell command.","chat.structuredOutput.title":"Structured output","chat.structuredOutput.copy":"Copy structured output","chat.input.communicationStyle.label":"Style {style}","chat.input.communicationStyle.heading":"Communication style","chat.input.communicationStyle.change":"Change communication style","chat.input.communicationStyle.locked":"Wait for the current turn to finish before changing communication style","chat.input.communicationStyle.option":"Use {style} communication style","chat.input.communicationStyle.autoHint":"Blade default","chat.input.communicationStyle.pragmaticHint":"direct","chat.input.communicationStyle.friendlyHint":"warm","chat.input.communicationStyle.explanatoryHint":"explain choices","chat.notice.dismiss":"Dismiss notice","chat.input.mode.default":"Manual approval","chat.input.mode.default.desc":"Every important action needs your approval","chat.input.mode.autoEdit":"Auto approval","chat.input.mode.autoEdit.desc":"Let the AI review and approve important actions","chat.input.mode.yolo":"Full access","chat.input.mode.yolo.desc":"Run directly on your machine without asking","chat.input.mode.yolo.confirm.title":"Enable full access mode?","chat.input.mode.yolo.confirm.desc":"In this mode the agent will execute all actions — including file writes, shell commands, and network requests — without asking for permission. Only enable this if you trust the current context.","chat.input.mode.yolo.confirm.cancel":"Cancel","chat.input.mode.yolo.confirm.accept":"Enable","chat.input.mode.plan":"Plan","chat.input.mode.plan.desc":"Draft a plan first without making changes","chat.input.mode.aria":"Agent action approval","chat.input.action.stop":"Stop active turn","chat.input.action.stopping":"Stopping active turn","chat.input.action.steer":"Steer active turn","chat.input.action.send":"Send message","chat.input.action.submitting":"Submitting message","chat.review.title":"Code Review","chat.review.target":"Target","chat.review.target.uncommitted":"Uncommitted changes","chat.review.target.base":"Changes against {ref}","chat.review.target.commit":"Commit {ref}","chat.review.status":"Status","chat.review.status.completed":"Completed","chat.review.status.stale":"Stale","chat.review.status.failed":"Failed","chat.review.status.aborted":"Aborted","chat.review.status.interrupted":"Interrupted","chat.review.findings":"Findings","chat.review.noFindings":"No actionable findings","chat.review.confidence":"confidence {value}","chat.review.error":"Error","chat.subagent.resumedFromTitle":"Resumed from {id}","chat.subagent.resumedDepth":"resumed · depth {depth}","chat.subagent.loadingLogs":"Loading subagent logs...","chat.subagent.resumedAs":"Resumed as {id} · {status} · depth {depth}","chat.subagent.resume":"Resume","chat.subagent.resumeAria":"Resume subagent","chat.subagent.followUpAria":"Subagent follow-up","chat.subagent.followUpPlaceholder":"Describe the follow-up work","chat.subagent.cancel":"Cancel","chat.subagent.resumeAgent":"Resume agent","chat.subagent.resumeFailed":"Failed to resume subagent","chat.markdown.copyCode":"Copy code","chat.rewind.title":"Rewind session","chat.rewind.description":"Return to the point before a user message.","chat.rewind.loading":"Loading checkpoints","chat.rewind.empty":"Nothing to rewind to yet","chat.rewind.checkpointAria":"Rewind checkpoint","chat.rewind.userMessage":"User message","chat.rewind.fileCountOne":"{count} file","chat.rewind.fileCountMany":"{count} files","chat.rewind.restoreCode":"Restore code changes","chat.rewind.restoreCodeHint":"Revert files changed at and after this checkpoint.","chat.rewind.cancel":"Cancel","chat.rewind.confirm":"Rewind","chat.rewind.loadFailed":"Failed to load rewind checkpoints","chat.rewind.failed":"Rewind failed. Review the session error and try again.","status.context":"Context","status.tokenLimitTooltip":"Token limit is estimated. It updates when the model reports its context size.","status.cache":"Cache","status.cacheTooltip":"Cached input divided by total model input for this session.","status.cacheDetails":"Read {read} · Written {write} · Uncached {uncached}","status.cacheUnavailable":"The Provider has not reported prompt-cache usage for this session.","status.cacheBreak":"Last cache break: {reason} · cache read {previous} → {current}","status.cacheBreak.model":"model changed","status.cacheBreak.system":"system prompt changed","status.cacheBreak.tools":"tool definitions changed","status.cacheBreak.policy":"request policy changed","status.cacheBreak.ttl":"cache TTL expired","status.cacheBreak.server":"likely Provider routing or eviction","status.phase.running":"Generating...","status.phase.providerStall":"Provider stream paused","status.phase.actionStationarityRecovering":"Recovering","status.phase.actionStationarityStopped":"Stopped","status.phase.compacting":"Compacting context...","status.phase.recoveringContext":"Recovering context limit...","status.phase.switchingModel":"Switching model...","status.phase.waitingPermission":"Waiting for permission...","status.phase.error":"Run failed","preview.title":"Preview","preview.action.resize":"Resize preview","preview.action.close":"Close preview","preview.action.retry":"Retry","preview.tab.diff":"Diff","preview.tab.files":"Files","preview.tab.logs":"Logs","preview.tab.browser":"Browser","preview.diff.loadingTitle":"Loading task diff…","preview.diff.loadingHint":"Reading the durable worktree artifact.","preview.diff.failedTitle":"Failed to load task diff","preview.diff.discardedTitle":"Changes discarded","preview.diff.discardedHint":"The isolated workspace was removed. The source project was not changed.","preview.diff.emptyTitle":"No patch yet","preview.diff.emptyHint":"Run a tool that changes files to see diffs here.","preview.diff.searchAria":"Search changed files","preview.diff.searchPlaceholder":"Filter changed files…","preview.diff.changedFiles":"{count} changed files","preview.diff.expandAll":"Expand all","preview.diff.collapseAll":"Collapse all","preview.diff.showMoreFiles":"Show {count} more files","preview.diff.showMoreLines":"Show {count} more lines","preview.diff.noMatches":"No matching changed files","preview.diff.patch":"Patch","preview.diff.line":"Line {line}","preview.files.loadingTitle":"Loading files…","preview.files.loadingHint":"Fetching workspace tree.","preview.files.failedTitle":"Failed to load files","preview.files.emptyTitle":"No files yet","preview.files.emptyHint":"Select a project to load its workspace tree.","preview.files.treeFailed":"Failed to load workspace tree","preview.files.searchAria":"Search workspace files","preview.files.searchPlaceholder":"Find a file…","preview.files.searchResultsAria":"File search results","preview.files.searchFailed":"Failed to search workspace files","preview.files.noMatches":"No matching files","preview.files.directoryLoading":"Loading folder…","preview.files.directoryEmpty":"Empty folder","preview.files.selectTitle":"Select a file to preview","preview.files.status.loading":"Loading…","preview.files.status.truncated":"Truncated","preview.files.status.ready":"Ready","preview.files.truncatedNotice":"Preview truncated to 200k characters.","preview.files.pickHint":"Pick a file from the tree to preview.","preview.files.contentFailed":"Failed to load file","preview.files.editorLoading":"Loading editor…","preview.logs.searchAria":"Search tool logs","preview.logs.searchPlaceholder":"Search tool, summary, or output…","preview.logs.filterAria":"Filter logs by status","preview.logs.filter.all":"All","preview.logs.filter.running":"Running","preview.logs.filter.error":"Failed","preview.logs.filter.success":"Success","preview.logs.noMatches":"No matching logs","preview.logs.noMatchesHint":"Try another phrase or status.","preview.logs.emptyTitle":"No logs yet","preview.logs.emptyHint":"Tool runs will appear here.","preview.logs.expand":"Expand","preview.logs.collapse":"Collapse","preview.logs.showMore":"Show {count} more logs","preview.logs.status.running":"Running","preview.logs.status.error":"Failed","preview.logs.status.success":"Success","goal.aria.section":"Goal controls","goal.status.active":"Goal running","goal.status.paused":"Goal paused","goal.status.blocked":"Goal blocked","goal.status.usageLimited":"Usage limited","goal.status.budgetLimited":"Budget reached","goal.status.complete":"Goal complete","goal.field.objective":"Goal objective","goal.action.edit":"Edit goal","goal.action.pause":"Pause goal","goal.action.resume":"Resume goal","goal.action.delete":"Delete goal","goal.action.expand":"Expand goal details","goal.action.collapse":"Collapse goal details","goal.action.cancel":"Cancel","goal.action.save":"Save","goal.metrics.tokens":"tokens","goal.metrics.continuationOne":"{n} continuation","goal.metrics.continuationMany":"{n} continuations","goal.dialog.title":"Delete this goal?","goal.dialog.description":"The goal state will be removed. Session history and workspace files are not affected.","settings.title":"Settings","settings.nav.aria":"Settings sections","settings.action.back":"Back","settings.category.settings":"Settings","settings.category.integrations":"Integrations","settings.tab.general":"General","settings.tab.trust":"Security","settings.tab.models":"Models","settings.tab.shortcuts":"Shortcuts","settings.tab.mcp":"MCP","settings.tab.skills":"Skills","settings.tab.plugins":"Plugins","settings.tab.hooks":"Hooks","settings.tab.schedules":"Scheduled Tasks","settings.common.retry":"Retry","settings.common.dismiss":"Dismiss","settings.common.cancel":"Cancel","settings.common.enable":"Enable","settings.general.loading":"Loading settings...","settings.general.loadError":"Failed to load settings","settings.general.saveError":"Failed to save settings","settings.general.responseLanguage":"Response Language","settings.general.responseLanguageHint":"AI will respond in this language","settings.general.autoSave":"Auto-save sessions","settings.general.communicationStyle":"Communication Style","settings.general.communicationStyleHint":"How the agent phrases its replies across every session","settings.appearance.heading":"Appearance","settings.appearance.theme":"Theme Preference","settings.appearance.theme.dark":"Dark","settings.appearance.theme.light":"Light","settings.appearance.theme.system":"System","settings.appearance.compactSidebar":"Compact sidebar","settings.appearance.codeTheme":"Code theme","settings.appearance.codeThemeHint":"Syntax highlighting colors","settings.notifications.heading":"Notifications","settings.notifications.buildFinished":"Build finished","settings.notifications.errorsOnly":"Errors only","settings.notifications.systemSounds":"System sounds","settings.notifications.blocked":"Browser notifications are blocked","settings.notifications.unavailable":"Browser notifications are unavailable","settings.notifications.enablePrompt":"Enable alerts while this tab is in the background","settings.privacy.heading":"Privacy","settings.privacy.telemetry":"Telemetry","settings.privacy.crash":"Crash reports","settings.models.description":"Configure API keys and model settings for different providers.","settings.models.loading":"Loading models...","settings.models.loadChannelsFailed":"Failed to load provider channels","settings.models.saveFailed":"Failed to save model","settings.models.deleteFailed":"Failed to delete model","settings.models.updateFailed":"Failed to update model","settings.models.updateChannelFailed":"Failed to update provider channel","settings.models.probeFailed":"Provider probe failed","settings.models.deleteChannelFailed":"Failed to delete provider channel","settings.models.empty":"No models configured yet","settings.models.add":"+ Add New Model","settings.models.missingCredential":"Missing credential","settings.models.configured":"Configured","settings.models.deleting":"Deleting...","settings.models.deleteModel":"Delete model","settings.models.deleteChannel":"Delete channel","settings.models.deleteModelAria":"Delete {name}","settings.models.deleteModelPrompt":"Delete {name} and its saved configuration?","settings.models.deleteChannelAria":"Delete channel {name}","settings.models.deleteChannelPrompt":"Delete channel {name}, its credential, and {count} configured model(s)? Fallback references will also be removed.","settings.models.editModelAria":"Edit {name}","settings.models.editChannelAria":"Edit channel {name}","settings.models.testChannelAria":"Test {name}","settings.models.deleteChannelActionAria":"Delete channel {name}","settings.models.modelCountOne":"{count} model","settings.models.modelCountMany":"{count} models","settings.models.defaultEndpoint":"default endpoint","settings.shortcuts.searchPlaceholder":"Search actions...","settings.shortcuts.scope.all":"All scopes","settings.shortcuts.scope.global":"Global","settings.shortcuts.scope.chat":"Chat","settings.shortcuts.scope.layout":"Layout","settings.shortcuts.reset":"Reset","settings.shortcuts.col.action":"Action","settings.shortcuts.col.shortcut":"Shortcut","settings.shortcuts.col.scope":"Scope","settings.shortcuts.empty":"No shortcuts found.","settings.shortcuts.action.searchTasks":"Search tasks","settings.shortcuts.action.openCommands":"Open command center","settings.shortcuts.action.newTask":"New task","settings.shortcuts.action.focusComposer":"Focus composer","settings.shortcuts.action.toggleSidebar":"Toggle sidebar","settings.common.reload":"Reload","settings.trust.state.notRequired":"No trust required","settings.trust.state.trusted":"Workspace trusted","settings.trust.state.review":"Review required","settings.trust.state.error":"Trust store error","settings.trust.selectSession":"Select a project session to review folder trust.","settings.trust.heading":"Workspace trust","settings.trust.inheritedFrom":" · inherited from {source}","settings.trust.reloadAria":"Reload workspace trust","settings.trust.revoke":"Revoke","settings.trust.trustWorkspace":"Trust workspace","settings.trust.restartNotice":"Restart Blade to reload project models, MCP, LSP, permissions, and plugins.","settings.trust.revokeAria":"Revoke workspace trust","settings.trust.confirmTrust":"Allow {count} project source(s) to configure models, MCP, LSP, permissions, environment, instructions, commands, skills, agents, or plugins?","settings.trust.confirmRevoke":"Block project-controlled executable configuration after restart?","settings.trust.saving":"Saving...","settings.trust.trustReviewed":"Trust reviewed workspace","settings.trust.revokeTrust":"Revoke trust","settings.trust.empty":"No project-controlled executable configuration was found.","settings.trust.loadFailed":"Failed to load workspace trust","settings.trust.updateFailed":"Failed to update workspace trust","settings.hooks.state.disabled":"Hooks disabled","settings.hooks.state.notRequired":"No external hooks","settings.hooks.state.review":"Review required","settings.hooks.state.trusted":"Trusted","settings.hooks.state.modified":"Changed since approval","settings.hooks.state.error":"Trust store error","settings.hooks.selectSession":"Select a project session to review its hooks.","settings.hooks.heading":"Hook trust","settings.hooks.reloadAria":"Reload hook trust","settings.hooks.revoke":"Revoke","settings.hooks.trustDigest":"Trust digest","settings.hooks.currentSession":"Current session execution","settings.hooks.session.open":"Open a session to control its hooks.","settings.hooks.session.loading":"Loading session state...","settings.hooks.session.disabled":"Disabled by workspace configuration.","settings.hooks.session.paused":"Paused only for this session.","settings.hooks.session.active":"Hooks may run for this session after trust checks.","settings.hooks.session.unavailable":"Disabled by this session runtime or host policy.","settings.hooks.session.enableAria":"Enable hooks for current session","settings.hooks.session.pauseAria":"Pause hooks for current session","settings.hooks.session.unavailableAria":"Hooks unavailable for current session","settings.hooks.confirmTrustAria":"Trust project hooks","settings.hooks.confirmRevokeAria":"Revoke project hook trust","settings.hooks.confirmTrust":"Run these {count} hooks with your user permissions until their configuration changes?","settings.hooks.confirmRevoke":"Stop all configured hooks for this project until explicitly trusted again?","settings.hooks.saving":"Saving...","settings.hooks.trustReviewed":"Trust reviewed hooks","settings.hooks.revokeTrust":"Revoke trust","settings.hooks.empty":"No configured command, HTTP, or prompt hooks.","settings.hooks.loadFailed":"Failed to load hook trust","settings.hooks.updateFailed":"Failed to update hook trust","settings.hooks.sessionUpdateFailed":"Failed to update session hooks","settings.plugins.selectProject":"Select a project to manage its plugins.","settings.plugins.heading":"Workspace plugins","settings.plugins.changesNote":"Changes apply to future session snapshots and persist in the selected scope.","settings.plugins.reloadAria":"Reload plugins","settings.plugins.sourcePolicy":"Source policy","settings.plugins.savePolicyAria":"Save plugin source policy","settings.plugins.saving":"Saving…","settings.plugins.saveForProject":"Save for project","settings.plugins.restrictAria":"Restrict plugin sources","settings.plugins.restrictAllowlists":"Restrict to allowlists","settings.plugins.requireShaAria":"Require full Git commit SHA","settings.plugins.requireSha":"Require full Git SHA","settings.plugins.environmentLocked":" · environment locked","settings.plugins.gitHostsAria":"Allowed plugin Git hosts","settings.plugins.marketplacesAria":"Allowed plugin Marketplaces","settings.plugins.localRootsAria":"Allowed local plugin roots","settings.plugins.emptyAllowlists":"Empty allowlists deny every plugin source.","settings.plugins.installHeading":"Install trusted plugin","settings.plugins.sourceAria":"Plugin source","settings.plugins.install":"Install","settings.plugins.trustSource":"I trust this source to activate Hooks, MCP servers, skills, and commands.","settings.plugins.activationScope":"Activation write scope","settings.plugins.activationScopeHint":"Higher-priority layers continue to determine the effective state.","settings.plugins.scopeAria":"Plugin activation scope","settings.plugins.scope.local":"Local","settings.plugins.scope.project":"Project","settings.plugins.scope.global":"Global","settings.plugins.scope.localDesc":"Only this checkout","settings.plugins.scope.projectDesc":"Shared project settings","settings.plugins.scope.globalDesc":"All projects","settings.plugins.scope.invocation":"Invocation","settings.plugins.scope.default":"Default","settings.plugins.layer.on":"on","settings.plugins.layer.off":"off","settings.plugins.capability.commands":"{count} commands","settings.plugins.capability.skills":"{count} skills","settings.plugins.capability.agents":"{count} agents","settings.plugins.capability.hooks":"{count} hooks","settings.plugins.capability.mcp":"{count} MCP","settings.plugins.noResources":"No declared resources","settings.plugins.effective":"effective: {scope}","settings.plugins.managed":"managed","settings.plugins.invocationScoped":"Invocation-scoped via --plugin-dir","settings.plugins.enableAria":"Enable {name}","settings.plugins.disableAria":"Disable {name}","settings.plugins.unavailableAria":"Unavailable {name}","settings.plugins.updateAria":"Update {name}","settings.plugins.uninstallAria":"Uninstall {name}","settings.plugins.confirmUpdate":"Confirm update","settings.plugins.update":"Update","settings.plugins.confirmRemove":"Confirm remove","settings.plugins.empty":"No plugins discovered for this project.","settings.plugins.marketplaces":"Marketplaces","settings.plugins.configuredCount":"{count} configured","settings.plugins.marketplaceSourceAria":"Marketplace source","settings.plugins.addMarketplaceAria":"Add marketplace","settings.plugins.add":"Add","settings.plugins.noDescription":"No description","settings.plugins.refreshMarketplaceAria":"Refresh marketplace {name}","settings.plugins.removeMarketplaceAria":"Remove marketplace {name}","settings.plugins.confirm":"Confirm","settings.plugins.installedSuffix":" · installed","settings.plugins.marketplaceEmpty":"Add a Marketplace to discover installable plugins.","settings.plugins.loadFailed":"Failed to load plugins","settings.plugins.actionFailed":"Plugin action failed","settings.plugins.updateFailed":"Failed to update plugin","settings.models.addModal.title":"Add Model","settings.models.addModal.close":"Close add model","settings.models.addModal.loadProvidersError":"Failed to load providers","settings.models.addModal.loadModelsError":"Failed to load models","settings.models.addModal.provider":"Provider","settings.models.addModal.loadingProviders":"Loading providers...","settings.models.addModal.selectProvider":"Select provider","settings.models.addModal.configuredSuffix":" - configured","settings.models.addModal.customOpenAI":"Custom OpenAI Endpoint","settings.models.addModal.customAnthropic":"Custom Anthropic Endpoint","settings.models.addModal.channelId":"Channel ID","settings.models.addModal.channelIdHint":"Stable config and credential identifier.","settings.models.addModal.channelName":"Channel name","settings.models.addModal.baseUrl":"Base URL","settings.models.addModal.anthropicProtocol":"Uses the Anthropic Messages protocol.","settings.models.addModal.openaiProtocol":"Uses the OpenAI Chat Completions protocol.","settings.models.addModal.modelId":"Model ID","settings.models.addModal.model":"Model","settings.models.addModal.loadingModels":"Loading models...","settings.models.addModal.selectModel":"Select model","settings.models.addModal.reasoningSuffix":" - reasoning","settings.models.addModal.visionSuffix":" - vision","settings.models.addModal.displayName":"Display name","settings.models.addModal.displayNamePlaceholder":"Optional alias","settings.models.addModal.apiKey":"API Key","settings.models.addModal.apiKeyAria":"API key","settings.models.addModal.apiKeyPlaceholder":"Stored separately in auth.json","settings.models.addModal.showApiKey":"Show API key","settings.models.addModal.hideApiKey":"Hide API key","settings.models.addModal.oauthNote":"This provider requires OAuth or ambient credentials. Configure it externally before selecting the model.","settings.models.addModal.saveModel":"Save Model","settings.models.addModal.saving":"Saving...","settings.models.addModal.channelIdError":'Channel ID must start with a lowercase letter and contain only lowercase letters, numbers, ".", "_" or "-"',"settings.models.addModal.invalidBaseUrl":"Base URL must be an absolute HTTP(S) URL","settings.models.editModal.srTitle":"Edit Model","settings.models.editModal.title":"Edit Model Overrides","settings.models.editModal.close":"Close edit model","settings.models.editModal.displayName":"Display name","settings.models.editModal.replaceApiKey":"Replace provider API key","settings.models.editModal.replaceApiKeyPlaceholder":"Leave empty to keep current credential","settings.models.editModal.baseUrlOverride":"Base URL override","settings.models.editModal.baseUrlPlaceholder":"Leave empty to use default endpoint","settings.models.editModal.streamIdleTimeout":"Stream idle timeout (ms)","settings.models.editModal.save":"Save","settings.models.editModal.saving":"Saving...","settings.models.editModal.streamIdleTimeoutError":"Stream idle timeout must be at least 1000ms","settings.models.editModal.credentialError":"Failed to update provider credential","settings.models.editProvider.title":"Edit Provider Channel","settings.models.editProvider.close":"Close edit provider","settings.models.editProvider.channelName":"Channel name","settings.models.editProvider.channelNameRequired":"Channel name is required","settings.models.editProvider.wireApi":"Wire API","settings.models.editProvider.baseUrl":"Base URL","settings.models.editProvider.baseUrlAria":"Provider Base URL","settings.models.editProvider.invalidBaseUrl":"Base URL must be an absolute HTTP(S) URL","settings.models.editProvider.apiKeyEnv":"API key environment variable","settings.models.editProvider.apiKeyEnvPlaceholder":"Optional, for example TEAM_GATEWAY_API_KEY","settings.models.editProvider.replaceApiKey":"Replace API key","settings.models.editProvider.apiKeyAria":"Provider API key","settings.models.editProvider.apiKeyPlaceholder":"Leave empty to keep current credential","settings.models.editProvider.save":"Save channel","settings.models.editProvider.saving":"Saving...","settings.style.auto":"Auto","settings.style.pragmatic":"Pragmatic","settings.style.friendly":"Friendly","settings.style.explanatory":"Explanatory","mcp.status.connected":"Connected","mcp.status.connecting":"Connecting...","mcp.status.reconnecting":"Recovering...","mcp.status.offline":"Offline","mcp.status.error":"Error","mcp.status.recoveringAttempt":"Recovering {attempt}/{max}","mcp.oauth.status.disabled":"Not configured","mcp.oauth.status.unavailable":"Unavailable in this runtime","mcp.oauth.status.unauthenticated":"Authorization required","mcp.oauth.status.authorizing":"Waiting for authorization...","mcp.oauth.status.authenticated":"Authorized","mcp.oauth.status.error":"Authorization failed","mcp.catalog.tag.official":"Official","mcp.catalog.tag.popular":"Popular","mcp.catalog.tag.community":"Community","mcp.action.refreshServers":"Refresh MCP servers","mcp.action.addServer":"Add server","mcp.action.close":"Close MCP","mcp.action.dismiss":"Dismiss","mcp.action.retry":"Retry","mcp.action.disconnect":"Disconnect","mcp.action.disconnecting":"Disconnecting...","mcp.action.stopRecovery":"Stop recovery","mcp.action.connect":"Connect","mcp.action.connecting":"Connecting...","mcp.action.authorizeFirst":"Authorize first","mcp.action.delete":"Delete","mcp.action.cancel":"Cancel","mcp.action.deleting":"Deleting...","mcp.action.deleteServer":"Delete server","mcp.tab.installed":"Installed ({count})","mcp.tab.catalog":"Catalog","mcp.servers.title":"Servers","mcp.servers.searchAria":"Search installed MCP servers","mcp.servers.searchPlaceholder":"Search servers...","mcp.servers.loading":"Loading servers...","mcp.servers.noMatch":"No servers match your search","mcp.servers.none":"No MCP servers configured","mcp.server.errorLabel":"Error: {error}","mcp.server.deleteAria":"Delete {name}","mcp.server.selectPrompt":"Select a server to view details","mcp.instructions.title":"Server instructions","mcp.instructions.detailsOmittedByPolicy":"[details omitted by runtime policy]","mcp.instructions.detailsOmitted":"Details omitted","mcp.instructions.truncated":"Truncated to the safe display budget","mcp.tasks.title":"Experimental MCP Tasks","mcp.tasks.summary":"{count} per Session · {interval}ms poll","mcp.tasks.disabledByDefault":"Disabled by default","mcp.tasks.enabled":"Enabled","mcp.tasks.disabled":"Disabled","mcp.oauth.signingOut":"Signing out...","mcp.oauth.signOut":"Sign out","mcp.oauth.continueAuthorization":"Continue authorization","mcp.oauth.resumeAuthorization":"Resume authorization","mcp.oauth.opening":"Opening...","mcp.oauth.authorize":"Authorize","mcp.delete.confirm":"Remove this server and its saved configuration?","mcp.tools.title":"Tools ({count})","mcp.tools.none":"No tools available","mcp.completion.title":"Argument completion","mcp.completion.connectPrompt":"Connect the server to request suggestions","mcp.completion.unsupported":"Server does not advertise MCP completions","mcp.completion.noTargets":"No completable prompt arguments or template variables","mcp.completion.targetAria":"MCP completion target","mcp.completion.partialAria":"MCP completion partial value","mcp.completion.partialPlaceholder":"Partial value","mcp.completion.completing":"Completing...","mcp.completion.complete":"Complete","mcp.completion.suggestionsAria":"MCP completion suggestions","mcp.completion.empty":"[empty]","mcp.completion.noSuggestions":"No suggestions","mcp.meta.truncatedSuffix":" · truncated","mcp.meta.detailsOmittedSuffix":" · details omitted","mcp.diagnostics.title":"Diagnostics","mcp.diagnostics.refreshAria":"Refresh {name} MCP logs","mcp.diagnostics.logsAria":"{name} MCP logs","mcp.log.levelAria":"MCP logging level","mcp.log.setting":"Setting...","mcp.log.loading":"Loading logs...","mcp.log.none":"No logs captured","mcp.catalog.searchAria":"Search MCP server catalog","mcp.catalog.searchPlaceholder":"Search MCP servers on npm (min 3 chars)...","mcp.catalog.retry":"Retry catalog","mcp.catalog.noDescription":"No description","mcp.catalog.byAuthor":"by {author}","mcp.catalog.installed":"Installed","mcp.catalog.installing":"Installing...","mcp.catalog.install":"Install","mcp.catalog.noPackages":"No packages found","mcp.catalog.noMore":"No more packages","mcp.catalog.packagesFound":"{count} packages found","mcp.catalog.browseGlama":"Browse more on Glama","mcp.error.connectFailed":"Failed to connect server","mcp.error.disconnectFailed":"Failed to disconnect server","mcp.error.deleteFailed":"Failed to delete server","mcp.error.loginFailed":"Failed to login MCP OAuth","mcp.error.logoutFailed":"Failed to logout MCP OAuth","mcp.error.loggingLevelFailed":"Failed to set MCP logging level","mcp.error.completionFailed":"MCP completion failed","mcp.add.title":"Add MCP Server","mcp.add.closeAria":"Close add MCP server","mcp.add.modeForm":"Form","mcp.add.jsonConfig":"JSON config","mcp.add.jsonConfigAria":"JSON configuration","mcp.add.serverName":"Server name","mcp.add.command":"Command","mcp.add.commandAria":"Server command","mcp.add.argsLabel":"Arguments (space separated)","mcp.add.argsAria":"Server arguments","mcp.add.invalidJson":"Enter valid JSON with a server name and transport.","mcp.add.nameCommandRequired":"Name and command are required.","mcp.add.adding":"Adding...","mcp.add.submit":"Add Server","mcp.install.title":"Install MCP Server","mcp.install.titleWithName":"Install {name}","mcp.install.closeAria":"Close MCP installation","mcp.install.args":"Arguments","mcp.install.commandPreview":"Command: npx {args}","mcp.install.nameRequired":"Server name is required.","skills.title":"Skills","skills.action.install":"Install skill","skills.action.installShort":"Install","skills.action.refreshAria":"Refresh skills","skills.action.closeAria":"Close skills","skills.action.dismiss":"Dismiss","skills.action.retry":"Retry","skills.action.cancel":"Cancel","skills.action.close":"Close","skills.action.hide":"Hide","skills.action.enable":"Enable","skills.action.disable":"Disable","skills.action.saving":"Saving...","skills.status.enabled":"Enabled","skills.status.disabled":"Disabled","skills.status.installed":"Installed","skills.noDescriptionShort":"No description","skills.noDescription":"No description available","skills.installed.title":"Installed","skills.installed.searchAria":"Search installed skills","skills.installed.searchPlaceholder":"Search skills...","skills.installed.loading":"Loading skills...","skills.installed.noMatch":"No skills match your search","skills.installed.empty":"No skills installed","skills.uninstall.managedHint":"Only Blade user skills can be uninstalled","skills.uninstall.managed":"Managed","skills.uninstall.action":"Uninstall","skills.uninstall.confirmAria":"Uninstall {name}","skills.uninstall.confirmPrompt":"Remove this skill from ~/.blade/skills?","skills.uninstall.inProgress":"Uninstalling...","skills.uninstall.confirm":"Uninstall skill","skills.details.title":"Details","skills.details.provider":"Provider","skills.details.location":"Location","skills.details.capabilities":"Capabilities","skills.details.allowedTools":"Allowed Tools ({count})","skills.detail.emptyState":"Select a skill to view details","skills.install.title":"Install Skill","skills.install.closeAria":"Close skill installation","skills.install.tab.catalog":"Catalog","skills.install.tab.repo":"Repo","skills.install.tab.local":"Local","skills.install.catalog.searchAria":"Search skill catalog","skills.install.catalog.searchPlaceholder":"Search catalog...","skills.install.catalog.loading":"Loading catalog...","skills.install.catalog.empty":"No skills found","skills.install.catalog.byAuthor":"by {author}","skills.install.catalog.tag.official":"Official","skills.install.catalog.tag.popular":"Popular","skills.install.catalog.tag.community":"Community","skills.install.repo.label":"GitHub URL","skills.install.repo.inputAria":"Skill repository URL","skills.install.repo.credentialsHint":"Uses Git credentials available to the Blade process","skills.install.local.label":"Local path","skills.install.local.inputAria":"Local skill path","skills.status.dialogTitle":"Install Status","skills.status.confirm.title":"Confirm Install","skills.status.confirm.prompt":"Install selected skill?","skills.status.installing.title":"Installing","skills.status.installing.description":"Downloading and verifying…","skills.status.failed.title":"Install Failed","skills.status.failed.fallback":"Installation failed.","skills.status.failed.hint":"Check access and try again.","skills.error.deleteFailed":"Failed to delete skill","skills.error.toggleFailed":"Failed to toggle skill","skills.error.installFailed":"Failed to install skill","schedule.title":"Scheduled Tasks","schedule.description":"Run headless task prompts automatically on a cron, interval, or one-time trigger.","schedule.new":"New schedule","schedule.newAria":"Create a new schedule","schedule.refresh":"Refresh","schedule.reloadAria":"Reload schedules","schedule.create":"Create","schedule.save":"Save","schedule.cancel":"Cancel","schedule.confirmDelete":"Confirm?","schedule.empty":"No schedules yet","schedule.enabled":"Enabled","schedule.disabled":"Disabled","schedule.never":"never","schedule.nextRun":"Next run","schedule.lastRun":"Last run","schedule.runCount":"{count} runs","schedule.trigger.kindAria":"Trigger type","schedule.trigger.cron":"Cron","schedule.trigger.interval":"Interval","schedule.trigger.once":"Once","schedule.field.title":"Title (optional)","schedule.field.cron":"Cron expression","schedule.field.interval":"Interval","schedule.field.runAt":"Run at","schedule.field.prompt":"Prompt","schedule.field.project":"Project path","schedule.field.model":"Model (optional)","schedule.field.permissionMode":"Permission mode","schedule.field.isolation":"Isolation","schedule.placeholder.title":"Nightly dependency audit","schedule.placeholder.cron":"0 9 * * 1 (min hour dom mon dow)","schedule.placeholder.interval":"30m / 2h / 1d","schedule.placeholder.prompt":"Describe the task to run…","schedule.placeholder.project":"/path/to/project","schedule.placeholder.model":"e.g. anthropic/claude-sonnet","schedule.model.current":"Use current model","schedule.permission.default":"Default","schedule.permission.autoEdit":"Auto edit","schedule.permission.yolo":"Yolo","schedule.permission.plan":"Plan","schedule.isolation.local":"Local","schedule.isolation.worktree":"Worktree","schedule.cadence.cron":"cron: {expr}","schedule.cadence.interval":"every {interval}","schedule.cadence.once":"once at {time}","schedule.status.queued":"queued","schedule.status.running":"running","schedule.status.completed":"completed","schedule.status.failed":"failed","schedule.status.cancelled":"cancelled","schedule.status.interrupted":"interrupted","schedule.status.error":"error","schedule.status.never":"no runs yet","schedule.runNowAria":'Run "{title}" now',"schedule.editAria":'Edit "{title}"',"schedule.deleteAria":'Delete "{title}"',"schedule.enableAria":'Enable "{title}"',"schedule.disableAria":'Disable "{title}"',"schedule.error.promptRequired":"A prompt is required.","schedule.error.projectRequired":"A project path is required.","schedule.error.cronRequired":"A cron expression is required.","schedule.error.invalidInterval":"Enter an interval like 30m, 2h, or 1d.","schedule.error.runAtRequired":"Pick a valid run time.","schedule.error.loadFailed":"Failed to load scheduled tasks.","schedule.error.createFailed":"Failed to create scheduled task.","schedule.error.updateFailed":"Failed to update scheduled task.","schedule.error.deleteFailed":"Failed to delete scheduled task.","schedule.error.toggleFailed":"Failed to change scheduled task status.","schedule.error.runFailed":"Failed to run scheduled task."},nw={"app.restoring":"正在恢复工作区…","layout.workspace.pathAria":"工作区路径","layout.workspace.empty":"未选择工作区","layout.action.rewind":"回溯会话","layout.action.openNavigation":"打开导航","terminal.title":"终端","terminal.status.connected":"终端已连接","terminal.status.disconnected":"终端未连接","terminal.action.minimize":"最小化终端","terminal.action.restore":"恢复终端","terminal.action.close":"关闭终端","sidebar.brand.badge":"网页版","sidebar.action.collapse":"收起侧边栏","sidebar.action.expand":"展开侧边栏","sidebar.navigationAria":"任务导航","sidebar.action.newTask":"新建任务","sidebar.action.newTaskShort":"新建任务","sidebar.action.taskBoard":"任务看板","sidebar.action.terminal":"终端","sidebar.action.terminalToggle":"切换终端","sidebar.action.searchTasks":"搜索任务","sidebar.unreadTasks":"{count} 个未读任务","sidebar.section.skills":"技能","sidebar.section.mcp":"MCP","sidebar.section.settings":"设置","sidebar.status.user":"用户","sidebar.status.feedLive":"任务通道已连接","sidebar.status.feedOffline":"任务通道未连接","sidebar.empty.title":"暂无任务","sidebar.empty.hint":"在主页派发新任务","sidebar.group.running":"进行中","sidebar.group.queued":"排队中","sidebar.group.interrupted":"已暂停","sidebar.group.failed":"已失败","sidebar.group.cancelled":"已取消","sidebar.group.done":"已完成","sidebar.group.showMore":"再显示 {count} 条","sidebar.group.showLess":"收起","sidebar.view.project":"项目","sidebar.view.status":"状态","sidebar.view.projectAria":"按项目分组会话","sidebar.view.statusAria":"按状态分组会话","sidebar.project.active":"当前","sidebar.project.expand":"展开 {name}","sidebar.project.collapse":"收起 {name}","sidebar.project.newTask":"在 {name} 中新建任务","sidebar.project.reorder":"调整 {name} 的顺序,当前位置 {position}/{count}","sidebar.project.reorderHint":"拖拽调整顺序,或使用上下方向键移动","sidebar.project.reordered":"已将 {name} 移到第 {position} 位","sidebar.project.projects":"项目","sidebar.catalog.syncing":"正在同步任务历史…","sidebar.catalog.loaded":"已载入 {count} 条","sidebar.catalog.incomplete":"任务历史未完整加载","sidebar.catalog.retry":"重试","projects.dialog.title":"项目","projects.dialog.description":"绑定本地目录,无需重启 Blade 即可切换任务上下文。","projects.bind.placeholder":"/项目的绝对路径","projects.bind.pathLabel":"项目路径","projects.bind.action":"绑定","projects.bind.failed":"项目绑定失败","projects.pick.action":"选择项目文件夹","projects.pick.actionShort":"选择","projects.pick.picking":"选择中…","projects.pick.failed":"无法选择项目文件夹","projects.unbind.action":"解除项目绑定","projects.unavailable":"目录不可用","sidebar.language.label":"语言","sidebar.language.aria":"切换语言","sidebar.language.en":"EN","sidebar.language.zh":"中","session.env.worktree":"独立分支","session.env.local":"本地","session.action.select":"选择「{title}」","session.action.save":"保存「{title}」","session.action.cancel":"取消「{title}」","session.action.more":"「{title}」的更多操作","session.action.fork":"派生「{title}」","session.action.forkShort":"派生","session.action.rename":"重命名「{title}」","session.action.renameShort":"重命名","session.action.archive":"归档「{title}」","session.action.archiveShort":"归档","session.action.export":"将「{title}」导出为 Markdown","session.action.exportShort":"导出 Markdown","session.action.exportingShort":"正在导出…","session.action.delete":"删除「{title}」","session.action.deleteShort":"删除","session.action.stop":"停止「{title}」","session.action.stopping":"正在停止「{title}」","session.action.retry":"重试「{title}」","session.action.retrying":"正在重试「{title}」","session.reason.cancelledByUser":"已由用户取消","session.title.codeReview":"代码评审","session.forkedFrom":"派生自","session.retriedFrom":"重试自","session.retryShort":"重试","session.queued":"排队 #{position}/{depth}","archive.title":"归档","archive.subtitle":"安全保留,不占用当前任务列表","archive.open":"打开会话归档","archive.refresh":"刷新归档会话","archive.retry":"重试","archive.loading":"正在载入归档…","archive.empty":"暂无归档会话","archive.restore":"恢复「{title}」","archive.restoreShort":"恢复","archive.restoreAncestor":"请先恢复归档根会话","archive.inherited":"随 {id} 一同归档","taskSwitcher.title":"任务切换器","taskSwitcher.description":"跨项目搜索并打开任务。","taskSwitcher.searchAria":"搜索任务","taskSwitcher.placeholder":"搜索标题、项目、分支、状态或 Session ID…","taskSwitcher.results":"{count} 个结果","taskSwitcher.recent":"最近任务","taskSwitcher.scope":"已索引 {count} 个任务","taskSwitcher.indexing":"正在索引任务…","taskSwitcher.resultsAria":"任务搜索结果","taskSwitcher.current":"当前","taskSwitcher.unread":"{count} 个未读","taskSwitcher.needsAction":"{count} 个需要操作","taskSwitcher.new":"新","taskSwitcher.empty":"没有匹配的任务","taskSwitcher.emptyHint":"尝试项目、分支、状态或更短的关键词。","taskSwitcher.hint.navigate":"选择","taskSwitcher.hint.open":"打开","taskSwitcher.hint.toggle":"切换","taskSwitcher.action.failed":"任务操作失败","commandCenter.title":"命令中心","commandCenter.description":"搜索任务,或执行工作区与应用操作。","commandCenter.searchAria":"搜索操作","commandCenter.placeholder":"搜索操作、设置或工具…","commandCenter.modeAria":"命令中心模式","commandCenter.mode.tasks":"任务","commandCenter.mode.commands":"操作","commandCenter.actions":"{count} 个操作","commandCenter.resultsAria":"操作搜索结果","commandCenter.empty":"没有匹配的操作","commandCenter.emptyHint":"尝试工具、面板或设置名称。","commandCenter.action.newTask":"新建任务","commandCenter.action.newTaskDescription":"打开一个干净的任务编辑器","commandCenter.action.preview":"切换预览区","commandCenter.action.previewDescription":"审查文件、Diff、运行日志与网页","commandCenter.action.terminal":"切换终端","commandCenter.action.terminalDescription":"打开或关闭工作区 Shell","commandCenter.action.settings":"打开设置","commandCenter.action.settingsDescription":"配置外观与行为","commandCenter.action.models":"配置模型","commandCenter.action.modelsDescription":"选择 Provider 与任务模型","commandCenter.action.shortcuts":"查看键盘快捷键","commandCenter.action.shortcutsDescription":"浏览全局与上下文按键","commandCenter.action.skills":"管理 Skills","commandCenter.action.skillsDescription":"发现并配置 Agent 能力","commandCenter.action.mcp":"管理 MCP Server","commandCenter.action.mcpDescription":"配置已连接的工具与服务","commandCenter.action.sidebar":"切换侧边栏","commandCenter.action.sidebarDescription":"显示或隐藏项目导航","taskHome.eyebrow":"任务调度台 · 就绪","taskHome.feed.connecting":"任务调度台 · 正在连接","taskHome.feed.reconnecting":"任务调度台 · 正在重连","taskHome.feed.offline":"任务调度台 · 已离线","taskHome.feed.offlineDescription":"实时任务更新已暂停,服务端正在运行的任务不会停止。","taskHome.feed.retry":"重新连接","taskHome.hero.prefix":"要在这里让 Blade 做点什么:","taskHome.hero.projectFallback":"当前工作区","taskHome.hero.subtitle":"派发一个任务后即可继续手头的工作。每个任务在独立的 worktree 中运行、状态持久保存,完成时会以可复核的工作区形式返回。","taskHome.templates.title":"模板","taskHome.templates.hint":"按 1–4 快速填充","taskHome.template.explore.title":"探索","taskHome.template.explore.description":"追踪行为,梳理系统全貌","taskHome.template.explore.hint":"调用链 · 模块结构","taskHome.template.build.title":"开发","taskHome.template.build.description":"实现一个可上线的功能","taskHome.template.build.hint":"端到端交付特性","taskHome.template.review.title":"评审","taskHome.template.review.description":"找出正确性与回归风险","taskHome.template.review.hint":"审查当前改动","taskHome.review.attachmentsUnsupported":"代码评审不支持附件","taskHome.review.outputSchemaUnsupported":"代码评审使用内置结构化报告 Schema","taskHome.review.usage":"用法:/review [uncommitted | base <ref> | commit <sha>]","taskHome.review.running":"只读代码评审正在进行","taskHome.review.stale":"评审期间目标已发生变化","taskHome.review.aborted":"代码评审已中止","taskHome.review.interrupted":"代码评审因进程重启而中断","taskHome.review.failed":"代码评审失败","taskHome.review.startFailed":"启动代码评审失败","taskHome.review.invalidTarget":"评审目标无效或没有可评审的改动","taskHome.review.conflict":"当前会话已有任务正在运行","taskHome.template.fix.title":"修复","taskHome.template.fix.description":"定位并修好一个具体故障","taskHome.template.fix.hint":"二分 · 复现 · 打补丁","taskHome.context.isolationToggleTitle":"切换任务隔离方式","taskHome.context.projectSelect":"选择目标项目","taskHome.context.isolation.worktree":"独立 worktree","taskHome.context.isolation.local":"本地工作区","taskHome.context.branchFallback":"无分支","taskHome.context.preparing":"正在准备 worktree","taskHome.setup.aria":"任务准备状态","taskHome.setup.title":"完成准备","taskHome.setup.description":"你可以继续编辑草稿,Blade 正在核对工作区和模型。","taskHome.setup.workspace.title":"工作区","taskHome.setup.workspace.loading":"正在检查可用工作区…","taskHome.setup.workspace.ready":"已选择 {project}","taskHome.setup.workspace.required":"选择一个可用项目","taskHome.setup.workspace.empty":"无项目","taskHome.setup.workspace.action":"选择","taskHome.setup.workspace.retry":"重新加载工作区","taskHome.setup.model.title":"模型","taskHome.setup.model.loading":"正在检查配置…","taskHome.setup.model.ready":"可用于当前任务","taskHome.setup.model.required":"配置或选择一个模型","taskHome.setup.model.action":"配置","taskHome.setup.model.retry":"重试","taskHome.composer.placeholder":"描述目标、约束以及你期望的验收方式……","taskHome.error.dismiss":"关闭","taskHome.recent.title":"最近任务","taskHome.recent.total":"共 {count} 条","taskHome.recent.partial":"已载入 {count} 条 · 继续同步","taskHome.recent.incomplete":"已载入 {count} 条 · 历史不完整","taskSwitcher.indexingLoaded":"已载入 {count} 条 · 正在同步历史","taskHome.footer.note":"独立 worktree 让并行任务不会干扰你当前的工作副本","kanban.title":"任务看板","kanban.subtitle":"跨项目派发任务,优先处理需要人工介入的工作。","kanban.taskCount":"{count} 个任务","kanban.searchAria":"搜索任务看板","kanban.searchPlaceholder":"搜索任务…","kanban.projectFilterAria":"按项目筛选任务看板","kanban.projectAll":"全部项目","kanban.feed.offline":"实时更新已离线,服务端运行中的任务不会停止。","kanban.autoClaim.running":"自动认领中","kanban.autoClaim.paused":"自动认领已暂停","kanban.column.waiting":"等待认领","kanban.column.waitingDescription":"等待可用的执行槽位","kanban.column.active":"处理中","kanban.column.activeDescription":"Agent 正在执行任务","kanban.column.blocked":"遇到阻碍","kanban.column.blockedDescription":"需要输入、重试或人工处理","kanban.column.review":"等你确认","kanban.column.reviewDescription":"已完成,等待验收归档","kanban.column.empty":"此阶段暂无任务","kanban.priority.high":"高优先级","kanban.priority.medium":"中优先级","kanban.priority.low":"低优先级","kanban.kind.feature":"新功能","kanban.kind.bug":"缺陷","kanban.kind.maintenance":"维护","kanban.kind.research":"调研","kanban.card.unread":"有新的任务更新","kanban.card.queuePosition":"队列第 {position}/{depth} 位","kanban.card.diff":"{files} 个文件 · +{additions} −{deletions}","kanban.action.newTask":"新建任务","kanban.action.open":"打开任务","kanban.action.respond":"处理阻碍","kanban.action.inspect":"验收变更","kanban.action.edit":"编辑任务信息","kanban.action.cancel":"取消任务","kanban.action.retry":"重试任务","kanban.action.archive":"验收并归档","kanban.dialog.createTitle":"派发任务","kanban.dialog.createDescription":"任务会直接在选定项目的本地工作区中执行。","kanban.dialog.editTitle":"编辑任务","kanban.dialog.editDescription":"更新计划信息,不会中断正在执行的 Agent。","kanban.dialog.localExecution":"本地工作区 · 不使用 worktree 隔离","kanban.dialog.cancel":"取消","kanban.dialog.dispatch":"派发","kanban.dialog.save":"保存","kanban.dialog.submitFailed":"任务操作失败","kanban.field.title":"标题","kanban.field.titlePlaceholder":"可选的简短任务标题","kanban.field.prompt":"任务说明","kanban.field.promptPlaceholder":"描述目标、约束以及预期的验收方式…","kanban.field.project":"项目","kanban.field.kind":"类型","kanban.field.priority":"优先级","kanban.field.dueAt":"截止时间","capacity.title":"{inFlight} 进行中 · {queued} 排队 · 上限 {max}","capacity.suffix.running":" 进行中","capacity.queued":"排队 {queued}","recent.status.running":"进行中","recent.status.queued":"排队中","recent.status.paused":"已暂停","recent.status.failed":"已失败","recent.status.cancelled":"已取消","recent.status.done":"已完成","recent.time.justNow":"刚刚","recent.time.minutes":"{n} 分钟前","recent.time.hours":"{n} 小时前","recent.time.days":"{n} 天前","recent.session.fallbackShort":"会话 {id}","recent.session.fallbackDated":"会话 {y}-{m}-{d} {hh}:{mm}","attention.unreadAnnouncement":"{count} 个未读任务更新","attention.notification.completed":"任务已完成","attention.notification.failed":"任务失败","attention.notification.interrupted":"任务已中断","attention.notification.permission":"需要审批","attention.notification.question":"需要回答","attention.notification.elicitation":"MCP 需要输入","interaction.permission.title":"需要授权:{tool}","interaction.permission.once":"仅本次允许","interaction.permission.session":"本会话允许","interaction.permission.project":"本项目允许","interaction.permission.deny":"拒绝","interaction.permission.failed":"授权响应失败","interaction.question.answered":"问题已回答","interaction.question.other":"其他","interaction.question.submit":"提交回答","interaction.question.failed":"回答提交失败","interaction.elicitation.title":"MCP 请求输入","interaction.elicitation.submit":"提交给 MCP","interaction.elicitation.open":"打开外部链接","interaction.elicitation.decline":"拒绝","interaction.elicitation.cancel":"取消","interaction.elicitation.responded":"已响应 MCP 请求","interaction.elicitation.cancelled":"MCP 请求已取消","interaction.elicitation.failed":"响应 MCP 请求失败","interaction.elicitation.warning":"仅在信任该 MCP 服务器并理解请求用途时继续。","interaction.bar.permissionTitle":"Agent 正在等待审批","interaction.bar.permissionHint":"请检查待处理的工具请求,审批后任务才会继续。","interaction.bar.questionTitle":"Agent 正在等待回答","interaction.bar.questionHint":"请回答待处理的问题,任务才能继续。","interaction.bar.elicitationTitle":"MCP 服务器正在等待输入","interaction.bar.elicitationHint":"请检查 MCP 请求,响应后任务才会继续。","interaction.bar.review":"查看请求","interaction.badge.permission":"需要审批","interaction.badge.question":"需要回答","interaction.badge.elicitation":"MCP 输入","artifact.env.isolated":"独立分支","artifact.env.local":"本地","artifact.review":"查看变更","artifact.commits":"{count} 次提交","artifact.apply":"应用","artifact.retryApply":"重新应用","artifact.applying":"应用中","artifact.applied":"已应用","artifact.discard":"丢弃任务变更","artifact.discarded":"已丢弃","artifact.conflict":"任务变更无法安全应用。","artifact.conflictHint":"隔离变更已保留。请查看变更、处理源项目状态,然后重试或丢弃。","artifact.discardDialog.title":"丢弃隔离变更?","artifact.discardDialog.description":"将删除 {project} 隔离任务工作区中的 {count} 个变更文件。","artifact.discardDialog.warning":"此操作会永久删除任务 worktree 和分支,不会修改源项目。","artifact.discardDialog.cancel":"保留变更","artifact.discardDialog.confirm":"丢弃变更","chat.list.empty.eyebrow":"Blade · 就绪","chat.list.empty.title":"发送一条消息开始对话","chat.list.empty.hint":"提问、描述改动,或者粘贴一段错误堆栈。","chat.list.loading.eyebrow":"历史对话","chat.list.loading.title":"正在恢复对话…","chat.list.loading.hint":"正在加载消息、任务状态和实时更新。对话较长时可能需要一点时间。","chat.list.showEarlier":"显示更早的 {count} 条消息","chat.list.showEarlierWithRemaining":"显示更早的 {count} 条消息,当前隐藏 {remaining} 条","chat.list.jumpLatest":"回到最新消息","chat.turns.aria":"跳转到之前的消息","chat.turns.label":"第 {n} 轮","chat.timeline.thinking":"思考过程","chat.timeline.tools.runningOne":"正在执行 1 条命令","chat.timeline.tools.running":"正在执行 {count} 条命令","chat.timeline.tools.completedOne":"已执行 1 条命令","chat.timeline.tools.completed":"已执行 {count} 条命令","chat.timeline.tools.completedOneWithError":"已执行 1 条命令 · 执行失败","chat.timeline.tools.completedWithErrors":"已执行 {count} 条命令 · {errors} 条失败","chat.error.dismiss":"关闭错误","chat.error.queueFull":"指令队列已满。请等待已有指令开始执行后重试。","chat.error.turnChanged":"当前轮次已发生变化,此消息尚未接收。请确认内容后重试。","chat.error.title.submission":"消息未发送。","chat.error.title.execution":"本轮运行已停止。","chat.error.title.navigation":"未能打开任务。","chat.error.title.generic":"操作失败。","chat.error.action.returnDraft":"返回草稿","chat.error.action.editResend":"编辑后重发","chat.error.action.retryTask":"重试任务","chat.error.action.retryingTask":"正在重试…","chat.error.action.checkModels":"检查模型设置","task.failure.authentication":"模型服务认证失败,请检查模型凭据。","task.failure.permission":"模型服务拒绝了请求,请检查账号和模型权限。","task.failure.rateLimit":"模型服务达到速率或额度限制。","task.failure.timeout":"模型服务请求超时。","task.failure.network":"无法连接模型服务。","task.failure.modelUnavailable":"当前选择的模型不可用。","task.failure.contextLimit":"请求超出模型上下文限制。","task.failure.unsupportedInput":"当前模型不支持此类输入。","task.failure.capacity":"任务准入容量已满,请在运行中的任务完成后重试。","task.failure.runtime":"Agent 运行失败。","chat.connection.reconnecting":"正在恢复实时更新,当前任务仍在后台继续运行。","chat.connection.offline":"实时更新已离线,当前显示的进度可能已经过期。","chat.connection.retry":"重新连接","chat.side.title":"旁路对话","chat.side.loading":"正在回答旁路问题……","chat.side.failed":"旁路对话失败。","chat.side.dismiss":"关闭旁路对话","chat.footer.disclaimer":"Blade 可能会出错,请核对重要信息。","chat.input.placeholder.default":"输入 @ 提及文件,/ 触发命令……","chat.input.placeholder.steering":"添加指令来引导当前轮次……","chat.input.steering.status":"当前轮次可被引导","chat.input.steering.queued":"引导指令已接收 · 待处理 {count} 条","chat.input.steering.enterHint":" · 回车下发指令","chat.input.followUp.queued":"后续指令已接收 · 下一轮排队 {count} 条","chat.input.steering.recoveredOne":"重启后已恢复 {count} 条排队指令","chat.input.steering.recoveredMany":"重启后已恢复 {count} 条排队指令","chat.input.attachment.add":"添加图片","chat.input.attachment.remove":"移除","chat.input.attachment.countLimit":"最多可添加 {count} 张图片。","chat.input.attachment.sizeLimit":"图片编码后总大小不能超过 {size},请移除图片或选择更小的文件。","chat.input.attachment.readFailed":"Blade 无法读取其中一张图片。","chat.input.attachment.usage":"{count}/{limit} 张图片 · 已用 {used} / {budget}","chat.input.attachment.modelUnsupported":"{model} 不支持图片输入,请选择视觉模型或移除图片。","chat.input.attachment.modelRequired":"请先选择支持图片输入的视觉模型。","chat.input.model.placeholder":"选择模型","chat.input.model.empty":"未配置模型","chat.input.model.vision":"视觉","chat.input.model.change":"切换模型","chat.input.model.locked":"请等待当前轮次结束后再切换模型","chat.input.effort.label":"推理 {effort}","chat.input.effort.heading":"推理强度","chat.input.effort.change":"切换推理强度","chat.input.effort.locked":"请等待当前轮次结束后再切换推理强度","chat.input.effort.option":"使用 {effort} 推理强度","chat.input.serviceTier.label":"速度 {tier}","chat.input.serviceTier.heading":"Provider 服务等级","chat.input.serviceTier.change":"切换 Provider 服务等级","chat.input.serviceTier.locked":"请等待当前轮次结束后再切换服务等级","chat.input.serviceTier.option":"使用 {tier} 服务等级","chat.input.serviceTier.fastHint":"优先通道","chat.input.serviceTier.flexHint":"低成本","chat.input.responseVerbosity.label":"输出 {verbosity}","chat.input.responseVerbosity.heading":"响应详略","chat.input.responseVerbosity.change":"切换响应详略","chat.input.responseVerbosity.locked":"请等待当前轮次结束后再切换响应详略","chat.input.responseVerbosity.option":"使用 {verbosity} 响应详略","chat.input.responseVerbosity.autoHint":"模型默认","chat.input.outputSchema.title":"结构化输出","chat.input.outputSchema.description":"要求本轮最终返回符合该 JSON Schema 的对象。","chat.input.outputSchema.change":"设置结构化输出 Schema","chat.input.outputSchema.locked":"请等待当前轮次结束后再修改输出 Schema","chat.input.outputSchema.editor":"JSON Schema 编辑器","chat.input.outputSchema.placeholder":"粘贴 JSON Schema 对象","chat.input.outputSchema.example":"使用示例","chat.input.outputSchema.clear":"清除","chat.input.outputSchema.invalid":"请输入有效的 JSON 对象;完整 Schema 将由服务端校验。","chat.input.outputSchema.shellUnsupported":"结构化输出不能与 Shell 命令同时使用。","chat.structuredOutput.title":"结构化输出","chat.structuredOutput.copy":"复制结构化输出","chat.input.communicationStyle.label":"风格 {style}","chat.input.communicationStyle.heading":"沟通风格","chat.input.communicationStyle.change":"切换沟通风格","chat.input.communicationStyle.locked":"请等待当前轮次结束后再切换沟通风格","chat.input.communicationStyle.option":"使用 {style} 沟通风格","chat.input.communicationStyle.autoHint":"Blade 默认","chat.input.communicationStyle.pragmaticHint":"直接","chat.input.communicationStyle.friendlyHint":"协作","chat.input.communicationStyle.explanatoryHint":"解释取舍","chat.notice.dismiss":"关闭提示","chat.input.mode.default":"手动审批","chat.input.mode.default.desc":"每个重要操作都需要你的批准","chat.input.mode.autoEdit":"自动审批","chat.input.mode.autoEdit.desc":"让 AI 审核并批准重要操作","chat.input.mode.yolo":"完全访问","chat.input.mode.yolo.desc":"无需询问,直接在你的电脑上运行","chat.input.mode.yolo.confirm.title":"启用完全访问模式?","chat.input.mode.yolo.confirm.desc":"在此模式下,Agent 将直接执行所有操作(包括文件写入、Shell 命令和网络请求)而不请求许可。仅在你信任当前上下文时启用。","chat.input.mode.yolo.confirm.cancel":"取消","chat.input.mode.yolo.confirm.accept":"启用","chat.input.mode.plan":"计划","chat.input.mode.plan.desc":"先拟定计划,暂不做任何改动","chat.input.mode.aria":"Agent 操作审批","chat.input.action.stop":"停止当前轮次","chat.input.action.stopping":"正在停止当前轮次","chat.input.action.steer":"引导当前轮次","chat.input.action.send":"发送消息","chat.input.action.submitting":"正在提交消息","chat.review.title":"代码评审","chat.review.target":"目标","chat.review.target.uncommitted":"未提交改动","chat.review.target.base":"相对 {ref} 的改动","chat.review.target.commit":"提交 {ref}","chat.review.status":"状态","chat.review.status.completed":"已完成","chat.review.status.stale":"已过期","chat.review.status.failed":"失败","chat.review.status.aborted":"已中止","chat.review.status.interrupted":"已中断","chat.review.findings":"问题","chat.review.noFindings":"未发现可执行问题","chat.review.confidence":"置信度 {value}","chat.review.error":"错误","chat.subagent.resumedFromTitle":"从 {id} 恢复","chat.subagent.resumedDepth":"已恢复 · 层级 {depth}","chat.subagent.loadingLogs":"正在加载子智能体日志…","chat.subagent.resumedAs":"已恢复为 {id} · {status} · 层级 {depth}","chat.subagent.resume":"恢复","chat.subagent.resumeAria":"恢复子智能体","chat.subagent.followUpAria":"子智能体后续指令","chat.subagent.followUpPlaceholder":"描述需要继续处理的工作","chat.subagent.cancel":"取消","chat.subagent.resumeAgent":"恢复智能体","chat.subagent.resumeFailed":"恢复子智能体失败","chat.markdown.copyCode":"复制代码","chat.rewind.title":"回溯会话","chat.rewind.description":"返回到某条用户消息之前的节点。","chat.rewind.loading":"正在加载检查点","chat.rewind.empty":"暂无可回溯的检查点","chat.rewind.checkpointAria":"回溯检查点","chat.rewind.userMessage":"用户消息","chat.rewind.fileCountOne":"{count} 个文件","chat.rewind.fileCountMany":"{count} 个文件","chat.rewind.restoreCode":"恢复代码变更","chat.rewind.restoreCodeHint":"回滚此检查点及之后更改的文件。","chat.rewind.cancel":"取消","chat.rewind.confirm":"回溯","chat.rewind.loadFailed":"加载回溯检查点失败","chat.rewind.failed":"回溯失败。请检查会话错误后重试。","status.context":"上下文","status.tokenLimitTooltip":"此为估算的 token 上限,模型回报上下文尺寸后会自动更新。","status.cache":"缓存","status.cacheTooltip":"本会话缓存读取输入占模型总输入的比例。","status.cacheDetails":"读取 {read} · 写入 {write} · 未缓存 {uncached}","status.cacheUnavailable":"Provider 尚未回报本会话的提示词缓存用量。","status.cacheBreak":"最近一次缓存中断:{reason} · 缓存读取 {previous} → {current}","status.cacheBreak.model":"模型发生变化","status.cacheBreak.system":"系统提示词发生变化","status.cacheBreak.tools":"工具定义发生变化","status.cacheBreak.policy":"请求策略发生变化","status.cacheBreak.ttl":"缓存 TTL 已过期","status.cacheBreak.server":"可能是 Provider 路由或缓存淘汰","status.phase.running":"生成中…","status.phase.providerStall":"Provider 流暂无数据","status.phase.actionStationarityRecovering":"正在纠正空转","status.phase.actionStationarityStopped":"已停止空转","status.phase.compacting":"正在压缩上下文…","status.phase.recoveringContext":"上下文超限,正在恢复…","status.phase.switchingModel":"正在切换模型…","status.phase.waitingPermission":"等待授权…","status.phase.error":"运行失败","preview.title":"预览","preview.action.resize":"调整预览区宽度","preview.action.close":"关闭预览区","preview.action.retry":"重试","preview.tab.diff":"变更","preview.tab.files":"文件","preview.tab.logs":"日志","preview.tab.browser":"浏览器","preview.diff.loadingTitle":"正在加载任务变更…","preview.diff.loadingHint":"正在读取持久化的 worktree 产物。","preview.diff.failedTitle":"任务变更加载失败","preview.diff.discardedTitle":"变更已丢弃","preview.diff.discardedHint":"隔离工作区已删除,源项目没有被修改。","preview.diff.emptyTitle":"暂无变更","preview.diff.emptyHint":"工具修改文件后,变更会显示在这里。","preview.diff.searchAria":"搜索变更文件","preview.diff.searchPlaceholder":"筛选变更文件…","preview.diff.changedFiles":"{count} 个变更文件","preview.diff.expandAll":"全部展开","preview.diff.collapseAll":"全部收起","preview.diff.showMoreFiles":"再显示 {count} 个文件","preview.diff.showMoreLines":"再显示 {count} 行","preview.diff.noMatches":"没有匹配的变更文件","preview.diff.patch":"补丁","preview.diff.line":"第 {line} 行","preview.files.loadingTitle":"正在加载文件…","preview.files.loadingHint":"正在获取工作区文件树。","preview.files.failedTitle":"文件加载失败","preview.files.emptyTitle":"暂无文件","preview.files.emptyHint":"选择项目后即可加载工作区文件树。","preview.files.treeFailed":"工作区文件树加载失败","preview.files.searchAria":"搜索工作区文件","preview.files.searchPlaceholder":"查找文件…","preview.files.searchResultsAria":"文件搜索结果","preview.files.searchFailed":"工作区文件搜索失败","preview.files.noMatches":"没有匹配的文件","preview.files.directoryLoading":"正在加载目录…","preview.files.directoryEmpty":"空目录","preview.files.selectTitle":"选择要预览的文件","preview.files.status.loading":"加载中…","preview.files.status.truncated":"已截断","preview.files.status.ready":"就绪","preview.files.truncatedNotice":"预览内容已截断至 20 万字符。","preview.files.pickHint":"从文件树中选择一个文件进行预览。","preview.files.contentFailed":"文件加载失败","preview.files.editorLoading":"正在加载编辑器…","preview.logs.searchAria":"搜索工具日志","preview.logs.searchPlaceholder":"搜索工具、摘要或输出…","preview.logs.filterAria":"按状态筛选日志","preview.logs.filter.all":"全部","preview.logs.filter.running":"进行中","preview.logs.filter.error":"失败","preview.logs.filter.success":"成功","preview.logs.noMatches":"没有匹配的日志","preview.logs.noMatchesHint":"尝试其他关键词或状态。","preview.logs.emptyTitle":"暂无日志","preview.logs.emptyHint":"工具运行记录会显示在这里。","preview.logs.expand":"展开","preview.logs.collapse":"收起","preview.logs.showMore":"再显示 {count} 条日志","preview.logs.status.running":"进行中","preview.logs.status.error":"失败","preview.logs.status.success":"成功","goal.aria.section":"目标控制条","goal.status.active":"目标进行中","goal.status.paused":"目标已暂停","goal.status.blocked":"目标已阻塞","goal.status.usageLimited":"用量受限","goal.status.budgetLimited":"预算已达上限","goal.status.complete":"目标已完成","goal.field.objective":"目标描述","goal.action.edit":"编辑目标","goal.action.pause":"暂停目标","goal.action.resume":"恢复目标","goal.action.delete":"删除目标","goal.action.expand":"展开目标详情","goal.action.collapse":"收起目标详情","goal.action.cancel":"取消","goal.action.save":"保存","goal.metrics.tokens":"tokens","goal.metrics.continuationOne":"续跑 {n} 次","goal.metrics.continuationMany":"续跑 {n} 次","goal.dialog.title":"删除此目标?","goal.dialog.description":"仅移除目标状态,会话历史与工作区文件不会受影响。","settings.title":"设置","settings.nav.aria":"设置分区","settings.action.back":"返回","settings.category.settings":"设置","settings.category.integrations":"集成","settings.tab.general":"通用","settings.tab.trust":"安全","settings.tab.models":"模型","settings.tab.shortcuts":"快捷键","settings.tab.mcp":"MCP","settings.tab.skills":"技能","settings.tab.plugins":"插件","settings.tab.hooks":"钩子","settings.tab.schedules":"定时任务","settings.common.retry":"重试","settings.common.dismiss":"忽略","settings.common.cancel":"取消","settings.common.enable":"启用","settings.general.loading":"正在加载设置…","settings.general.loadError":"加载设置失败","settings.general.saveError":"保存设置失败","settings.general.responseLanguage":"回复语言","settings.general.responseLanguageHint":"AI 将使用该语言回复","settings.general.autoSave":"自动保存会话","settings.general.communicationStyle":"沟通风格","settings.general.communicationStyleHint":"决定 Agent 在所有会话中的回复措辞","settings.appearance.heading":"外观","settings.appearance.theme":"主题偏好","settings.appearance.theme.dark":"深色","settings.appearance.theme.light":"浅色","settings.appearance.theme.system":"跟随系统","settings.appearance.compactSidebar":"紧凑侧边栏","settings.appearance.codeTheme":"代码主题","settings.appearance.codeThemeHint":"语法高亮配色","settings.notifications.heading":"通知","settings.notifications.buildFinished":"构建完成","settings.notifications.errorsOnly":"仅错误","settings.notifications.systemSounds":"系统提示音","settings.notifications.blocked":"浏览器通知已被拦截","settings.notifications.unavailable":"当前浏览器不支持通知","settings.notifications.enablePrompt":"在此标签页处于后台时接收提醒","settings.privacy.heading":"隐私","settings.privacy.telemetry":"遥测","settings.privacy.crash":"崩溃报告","settings.models.description":"为不同的服务商配置 API Key 与模型设置。","settings.models.loading":"正在加载模型…","settings.models.loadChannelsFailed":"加载服务商渠道失败","settings.models.saveFailed":"保存模型失败","settings.models.deleteFailed":"删除模型失败","settings.models.updateFailed":"更新模型失败","settings.models.updateChannelFailed":"更新服务商渠道失败","settings.models.probeFailed":"服务商渠道探测失败","settings.models.deleteChannelFailed":"删除服务商渠道失败","settings.models.empty":"尚未配置任何模型","settings.models.add":"+ 添加新模型","settings.models.missingCredential":"缺少凭据","settings.models.configured":"已配置","settings.models.deleting":"正在删除…","settings.models.deleteModel":"删除模型","settings.models.deleteChannel":"删除渠道","settings.models.deleteModelAria":"删除 {name}","settings.models.deleteModelPrompt":"删除 {name} 及其保存的配置?","settings.models.deleteChannelAria":"删除渠道 {name}","settings.models.deleteChannelPrompt":"删除渠道 {name}、其凭据以及 {count} 个已配置模型?相关的兜底引用也会一并移除。","settings.models.editModelAria":"编辑 {name}","settings.models.editChannelAria":"编辑渠道 {name}","settings.models.testChannelAria":"测试 {name}","settings.models.deleteChannelActionAria":"删除渠道 {name}","settings.models.modelCountOne":"{count} 个模型","settings.models.modelCountMany":"{count} 个模型","settings.models.defaultEndpoint":"默认端点","settings.shortcuts.searchPlaceholder":"搜索操作…","settings.shortcuts.scope.all":"全部范围","settings.shortcuts.scope.global":"全局","settings.shortcuts.scope.chat":"聊天","settings.shortcuts.scope.layout":"布局","settings.shortcuts.reset":"重置","settings.shortcuts.col.action":"操作","settings.shortcuts.col.shortcut":"快捷键","settings.shortcuts.col.scope":"范围","settings.shortcuts.empty":"未找到快捷键。","settings.shortcuts.action.searchTasks":"搜索任务","settings.shortcuts.action.openCommands":"打开命令中心","settings.shortcuts.action.newTask":"新建任务","settings.shortcuts.action.focusComposer":"聚焦输入框","settings.shortcuts.action.toggleSidebar":"切换侧边栏","settings.common.reload":"重新加载","settings.trust.state.notRequired":"无需信任","settings.trust.state.trusted":"工作区已信任","settings.trust.state.review":"需要审查","settings.trust.state.error":"信任存储错误","settings.trust.selectSession":"选择一个项目会话以查看文件夹信任。","settings.trust.heading":"工作区信任","settings.trust.inheritedFrom":" · 继承自 {source}","settings.trust.reloadAria":"重新加载工作区信任","settings.trust.revoke":"撤销","settings.trust.trustWorkspace":"信任工作区","settings.trust.restartNotice":"重启 Blade 以重新加载项目模型、MCP、LSP、权限和插件。","settings.trust.revokeAria":"撤销工作区信任","settings.trust.confirmTrust":"允许 {count} 个项目来源配置模型、MCP、LSP、权限、环境、指令、命令、技能、Agent 或插件?","settings.trust.confirmRevoke":"重启后阻止项目控制的可执行配置?","settings.trust.saving":"正在保存…","settings.trust.trustReviewed":"信任已审查的工作区","settings.trust.revokeTrust":"撤销信任","settings.trust.empty":"未找到项目控制的可执行配置。","settings.trust.loadFailed":"加载工作区信任失败","settings.trust.updateFailed":"更新工作区信任失败","settings.hooks.state.disabled":"钩子已禁用","settings.hooks.state.notRequired":"无外部钩子","settings.hooks.state.review":"需要审查","settings.hooks.state.trusted":"已信任","settings.hooks.state.modified":"批准后已变更","settings.hooks.state.error":"信任存储错误","settings.hooks.selectSession":"选择一个项目会话以查看其钩子。","settings.hooks.heading":"钩子信任","settings.hooks.reloadAria":"重新加载钩子信任","settings.hooks.revoke":"撤销","settings.hooks.trustDigest":"信任摘要","settings.hooks.currentSession":"当前会话执行","settings.hooks.session.open":"打开一个会话以控制其钩子。","settings.hooks.session.loading":"正在加载会话状态…","settings.hooks.session.disabled":"已被工作区配置禁用。","settings.hooks.session.paused":"仅在此会话中暂停。","settings.hooks.session.active":"通过信任检查后,钩子可在此会话运行。","settings.hooks.session.unavailable":"已被当前会话 runtime 或宿主策略禁用。","settings.hooks.session.enableAria":"为当前会话启用钩子","settings.hooks.session.pauseAria":"为当前会话暂停钩子","settings.hooks.session.unavailableAria":"当前会话无法使用钩子","settings.hooks.confirmTrustAria":"信任项目钩子","settings.hooks.confirmRevokeAria":"撤销项目钩子信任","settings.hooks.confirmTrust":"以你的用户权限运行这 {count} 个钩子,直到它们的配置发生变更?","settings.hooks.confirmRevoke":"停止此项目所有已配置的钩子,直到再次显式信任?","settings.hooks.saving":"正在保存…","settings.hooks.trustReviewed":"信任已审查的钩子","settings.hooks.revokeTrust":"撤销信任","settings.hooks.empty":"没有已配置的命令、HTTP 或提示词钩子。","settings.hooks.loadFailed":"加载钩子信任失败","settings.hooks.updateFailed":"更新钩子信任失败","settings.hooks.sessionUpdateFailed":"更新会话钩子失败","settings.plugins.selectProject":"选择一个项目以管理其插件。","settings.plugins.heading":"工作区插件","settings.plugins.changesNote":"更改将在后续会话快照生效并持久化到所选层级。","settings.plugins.reloadAria":"重新加载插件","settings.plugins.sourcePolicy":"来源策略","settings.plugins.savePolicyAria":"保存插件来源策略","settings.plugins.saving":"正在保存…","settings.plugins.saveForProject":"保存到项目","settings.plugins.restrictAria":"限制插件来源","settings.plugins.restrictAllowlists":"限制为允许列表","settings.plugins.requireShaAria":"要求完整 Git commit SHA","settings.plugins.requireSha":"要求完整 Git SHA","settings.plugins.environmentLocked":" · 环境已锁定","settings.plugins.gitHostsAria":"允许的插件 Git 主机","settings.plugins.marketplacesAria":"允许的插件市场","settings.plugins.localRootsAria":"允许的本地插件根目录","settings.plugins.emptyAllowlists":"空的允许列表将拒绝所有插件来源。","settings.plugins.installHeading":"安装可信插件","settings.plugins.sourceAria":"插件来源","settings.plugins.install":"安装","settings.plugins.trustSource":"我信任此来源可激活钩子、MCP 服务器、技能和命令。","settings.plugins.activationScope":"激活写入范围","settings.plugins.activationScopeHint":"更高优先级的层级仍将决定最终生效状态。","settings.plugins.scopeAria":"插件激活范围","settings.plugins.scope.local":"本地","settings.plugins.scope.project":"项目","settings.plugins.scope.global":"全局","settings.plugins.scope.localDesc":"仅当前检出","settings.plugins.scope.projectDesc":"共享的项目设置","settings.plugins.scope.globalDesc":"所有项目","settings.plugins.scope.invocation":"本次调用","settings.plugins.scope.default":"默认","settings.plugins.layer.on":"开","settings.plugins.layer.off":"关","settings.plugins.capability.commands":"{count} 个命令","settings.plugins.capability.skills":"{count} 个技能","settings.plugins.capability.agents":"{count} 个 Agent","settings.plugins.capability.hooks":"{count} 个钩子","settings.plugins.capability.mcp":"{count} 个 MCP","settings.plugins.noResources":"未声明任何资源","settings.plugins.effective":"生效范围:{scope}","settings.plugins.managed":"托管","settings.plugins.invocationScoped":"通过 --plugin-dir 限定为调用级","settings.plugins.enableAria":"启用 {name}","settings.plugins.disableAria":"停用 {name}","settings.plugins.unavailableAria":"{name} 不可用","settings.plugins.updateAria":"更新 {name}","settings.plugins.uninstallAria":"卸载 {name}","settings.plugins.confirmUpdate":"确认更新","settings.plugins.update":"更新","settings.plugins.confirmRemove":"确认移除","settings.plugins.empty":"未发现此项目的任何插件。","settings.plugins.marketplaces":"市场","settings.plugins.configuredCount":"{count} 个已配置","settings.plugins.marketplaceSourceAria":"市场来源","settings.plugins.addMarketplaceAria":"添加市场","settings.plugins.add":"添加","settings.plugins.noDescription":"无描述","settings.plugins.refreshMarketplaceAria":"刷新市场 {name}","settings.plugins.removeMarketplaceAria":"移除市场 {name}","settings.plugins.confirm":"确认","settings.plugins.installedSuffix":" · 已安装","settings.plugins.marketplaceEmpty":"添加市场以发现可安装的插件。","settings.plugins.loadFailed":"加载插件失败","settings.plugins.actionFailed":"插件操作失败","settings.plugins.updateFailed":"更新插件失败","settings.models.addModal.title":"添加模型","settings.models.addModal.close":"关闭添加模型","settings.models.addModal.loadProvidersError":"加载服务商失败","settings.models.addModal.loadModelsError":"加载模型失败","settings.models.addModal.provider":"服务商","settings.models.addModal.loadingProviders":"正在加载服务商…","settings.models.addModal.selectProvider":"选择服务商","settings.models.addModal.configuredSuffix":" - 已配置","settings.models.addModal.customOpenAI":"自定义 OpenAI 端点","settings.models.addModal.customAnthropic":"自定义 Anthropic 端点","settings.models.addModal.channelId":"渠道 ID","settings.models.addModal.channelIdHint":"稳定的配置与凭据标识符。","settings.models.addModal.channelName":"渠道名称","settings.models.addModal.baseUrl":"Base URL","settings.models.addModal.anthropicProtocol":"使用 Anthropic Messages 协议。","settings.models.addModal.openaiProtocol":"使用 OpenAI Chat Completions 协议。","settings.models.addModal.modelId":"模型 ID","settings.models.addModal.model":"模型","settings.models.addModal.loadingModels":"正在加载模型…","settings.models.addModal.selectModel":"选择模型","settings.models.addModal.reasoningSuffix":" - 推理","settings.models.addModal.visionSuffix":" - 视觉","settings.models.addModal.displayName":"显示名称","settings.models.addModal.displayNamePlaceholder":"可选别名","settings.models.addModal.apiKey":"API Key","settings.models.addModal.apiKeyAria":"API Key","settings.models.addModal.apiKeyPlaceholder":"单独存储在 auth.json 中","settings.models.addModal.showApiKey":"显示 API Key","settings.models.addModal.hideApiKey":"隐藏 API Key","settings.models.addModal.oauthNote":"该服务商需要 OAuth 或环境凭据,请在选择模型前在外部完成配置。","settings.models.addModal.saveModel":"保存模型","settings.models.addModal.saving":"正在保存…","settings.models.addModal.channelIdError":'渠道 ID 必须以小写字母开头,且只能包含小写字母、数字、"."、"_" 或 "-"。',"settings.models.addModal.invalidBaseUrl":"Base URL 必须是绝对的 HTTP(S) URL。","settings.models.editModal.srTitle":"编辑模型","settings.models.editModal.title":"编辑模型覆盖项","settings.models.editModal.close":"关闭编辑模型","settings.models.editModal.displayName":"显示名称","settings.models.editModal.replaceApiKey":"替换服务商 API Key","settings.models.editModal.replaceApiKeyPlaceholder":"留空则保留当前凭据","settings.models.editModal.baseUrlOverride":"Base URL 覆盖","settings.models.editModal.baseUrlPlaceholder":"留空则使用默认端点","settings.models.editModal.streamIdleTimeout":"流空闲超时(ms)","settings.models.editModal.save":"保存","settings.models.editModal.saving":"正在保存…","settings.models.editModal.streamIdleTimeoutError":"流空闲超时必须至少为 1000ms。","settings.models.editModal.credentialError":"更新服务商凭据失败","settings.models.editProvider.title":"编辑服务商渠道","settings.models.editProvider.close":"关闭编辑服务商","settings.models.editProvider.channelName":"渠道名称","settings.models.editProvider.channelNameRequired":"渠道名称不能为空","settings.models.editProvider.wireApi":"Wire API","settings.models.editProvider.baseUrl":"Base URL","settings.models.editProvider.baseUrlAria":"服务商 Base URL","settings.models.editProvider.invalidBaseUrl":"Base URL 必须是绝对的 HTTP(S) URL。","settings.models.editProvider.apiKeyEnv":"API Key 环境变量","settings.models.editProvider.apiKeyEnvPlaceholder":"可选,例如 TEAM_GATEWAY_API_KEY","settings.models.editProvider.replaceApiKey":"替换 API Key","settings.models.editProvider.apiKeyAria":"服务商 API Key","settings.models.editProvider.apiKeyPlaceholder":"留空则保留当前凭据","settings.models.editProvider.save":"保存渠道","settings.models.editProvider.saving":"正在保存…","settings.style.auto":"自动","settings.style.pragmatic":"务实","settings.style.friendly":"友好","settings.style.explanatory":"解释型","mcp.status.connected":"已连接","mcp.status.connecting":"连接中...","mcp.status.reconnecting":"恢复中...","mcp.status.offline":"离线","mcp.status.error":"错误","mcp.status.recoveringAttempt":"恢复中 {attempt}/{max}","mcp.oauth.status.disabled":"未配置","mcp.oauth.status.unavailable":"当前运行时不可用","mcp.oauth.status.unauthenticated":"需要授权","mcp.oauth.status.authorizing":"等待授权...","mcp.oauth.status.authenticated":"已授权","mcp.oauth.status.error":"授权失败","mcp.catalog.tag.official":"官方","mcp.catalog.tag.popular":"热门","mcp.catalog.tag.community":"社区","mcp.action.refreshServers":"刷新 MCP 服务器","mcp.action.addServer":"添加服务器","mcp.action.close":"关闭 MCP","mcp.action.dismiss":"忽略","mcp.action.retry":"重试","mcp.action.disconnect":"断开连接","mcp.action.disconnecting":"断开中...","mcp.action.stopRecovery":"停止恢复","mcp.action.connect":"连接","mcp.action.connecting":"连接中...","mcp.action.authorizeFirst":"请先授权","mcp.action.delete":"删除","mcp.action.cancel":"取消","mcp.action.deleting":"删除中...","mcp.action.deleteServer":"删除服务器","mcp.tab.installed":"已安装 ({count})","mcp.tab.catalog":"目录","mcp.servers.title":"服务器","mcp.servers.searchAria":"搜索已安装的 MCP 服务器","mcp.servers.searchPlaceholder":"搜索服务器...","mcp.servers.loading":"正在加载服务器...","mcp.servers.noMatch":"没有匹配的服务器","mcp.servers.none":"尚未配置 MCP 服务器","mcp.server.errorLabel":"错误:{error}","mcp.server.deleteAria":"删除 {name}","mcp.server.selectPrompt":"选择一个服务器以查看详情","mcp.instructions.title":"服务器说明","mcp.instructions.detailsOmittedByPolicy":"[详情已根据运行时策略省略]","mcp.instructions.detailsOmitted":"详情已省略","mcp.instructions.truncated":"已截断至安全显示上限","mcp.tasks.title":"实验性 MCP 任务","mcp.tasks.summary":"每会话 {count} 个 · {interval}ms 轮询","mcp.tasks.disabledByDefault":"默认禁用","mcp.tasks.enabled":"已启用","mcp.tasks.disabled":"已禁用","mcp.oauth.signingOut":"登出中...","mcp.oauth.signOut":"登出","mcp.oauth.continueAuthorization":"继续授权","mcp.oauth.resumeAuthorization":"恢复授权","mcp.oauth.opening":"打开中...","mcp.oauth.authorize":"授权","mcp.delete.confirm":"移除此服务器及其已保存的配置?","mcp.tools.title":"工具 ({count})","mcp.tools.none":"暂无可用工具","mcp.completion.title":"参数补全","mcp.completion.connectPrompt":"连接服务器后即可请求补全建议","mcp.completion.unsupported":"该服务器未声明支持 MCP 补全","mcp.completion.noTargets":"没有可补全的提示词参数或模板变量","mcp.completion.targetAria":"MCP 补全目标","mcp.completion.partialAria":"MCP 补全的部分值","mcp.completion.partialPlaceholder":"部分值","mcp.completion.completing":"补全中...","mcp.completion.complete":"补全","mcp.completion.suggestionsAria":"MCP 补全建议","mcp.completion.empty":"[空]","mcp.completion.noSuggestions":"暂无建议","mcp.meta.truncatedSuffix":" · 已截断","mcp.meta.detailsOmittedSuffix":" · 详情已省略","mcp.diagnostics.title":"诊断","mcp.diagnostics.refreshAria":"刷新 {name} 的 MCP 日志","mcp.diagnostics.logsAria":"{name} 的 MCP 日志","mcp.log.levelAria":"MCP 日志级别","mcp.log.setting":"设置中...","mcp.log.loading":"正在加载日志...","mcp.log.none":"未捕获到日志","mcp.catalog.searchAria":"搜索 MCP 服务器目录","mcp.catalog.searchPlaceholder":"在 npm 上搜索 MCP 服务器(至少 3 个字符)...","mcp.catalog.retry":"重试加载目录","mcp.catalog.noDescription":"暂无描述","mcp.catalog.byAuthor":"作者 {author}","mcp.catalog.installed":"已安装","mcp.catalog.installing":"安装中...","mcp.catalog.install":"安装","mcp.catalog.noPackages":"未找到任何包","mcp.catalog.noMore":"没有更多包了","mcp.catalog.packagesFound":"找到 {count} 个包","mcp.catalog.browseGlama":"在 Glama 上浏览更多","mcp.error.connectFailed":"连接服务器失败","mcp.error.disconnectFailed":"断开服务器失败","mcp.error.deleteFailed":"删除服务器失败","mcp.error.loginFailed":"MCP OAuth 登录失败","mcp.error.logoutFailed":"MCP OAuth 登出失败","mcp.error.loggingLevelFailed":"设置 MCP 日志级别失败","mcp.error.completionFailed":"MCP 补全失败","mcp.add.title":"添加 MCP 服务器","mcp.add.closeAria":"关闭添加 MCP 服务器","mcp.add.modeForm":"表单","mcp.add.jsonConfig":"JSON 配置","mcp.add.jsonConfigAria":"JSON 配置","mcp.add.serverName":"服务器名称","mcp.add.command":"命令","mcp.add.commandAria":"服务器命令","mcp.add.argsLabel":"参数(空格分隔)","mcp.add.argsAria":"服务器参数","mcp.add.invalidJson":"请输入包含服务器名称和传输方式的有效 JSON。","mcp.add.nameCommandRequired":"名称和命令为必填项。","mcp.add.adding":"添加中...","mcp.add.submit":"添加服务器","mcp.install.title":"安装 MCP 服务器","mcp.install.titleWithName":"安装 {name}","mcp.install.closeAria":"关闭 MCP 安装","mcp.install.args":"参数","mcp.install.commandPreview":"命令:npx {args}","mcp.install.nameRequired":"服务器名称为必填项。","skills.title":"技能","skills.action.install":"安装技能","skills.action.installShort":"安装","skills.action.refreshAria":"刷新技能","skills.action.closeAria":"关闭技能","skills.action.dismiss":"忽略","skills.action.retry":"重试","skills.action.cancel":"取消","skills.action.close":"关闭","skills.action.hide":"隐藏","skills.action.enable":"启用","skills.action.disable":"禁用","skills.action.saving":"保存中…","skills.status.enabled":"已启用","skills.status.disabled":"已禁用","skills.status.installed":"已安装","skills.noDescriptionShort":"暂无描述","skills.noDescription":"暂无可用描述","skills.installed.title":"已安装","skills.installed.searchAria":"搜索已安装的技能","skills.installed.searchPlaceholder":"搜索技能…","skills.installed.loading":"正在加载技能…","skills.installed.noMatch":"没有匹配的技能","skills.installed.empty":"尚未安装任何技能","skills.uninstall.managedHint":"仅可卸载 Blade 用户技能","skills.uninstall.managed":"受管理","skills.uninstall.action":"卸载","skills.uninstall.confirmAria":"卸载 {name}","skills.uninstall.confirmPrompt":"从 ~/.blade/skills 中移除此技能?","skills.uninstall.inProgress":"正在卸载…","skills.uninstall.confirm":"卸载技能","skills.details.title":"详情","skills.details.provider":"提供方","skills.details.location":"位置","skills.details.capabilities":"能力","skills.details.allowedTools":"允许的工具({count})","skills.detail.emptyState":"选择一个技能以查看详情","skills.install.title":"安装技能","skills.install.closeAria":"关闭技能安装","skills.install.tab.catalog":"目录","skills.install.tab.repo":"仓库","skills.install.tab.local":"本地","skills.install.catalog.searchAria":"搜索技能目录","skills.install.catalog.searchPlaceholder":"搜索目录…","skills.install.catalog.loading":"正在加载目录…","skills.install.catalog.empty":"未找到技能","skills.install.catalog.byAuthor":"作者:{author}","skills.install.catalog.tag.official":"官方","skills.install.catalog.tag.popular":"热门","skills.install.catalog.tag.community":"社区","skills.install.repo.label":"GitHub URL","skills.install.repo.inputAria":"技能仓库地址","skills.install.repo.credentialsHint":"使用 Blade 进程可用的 Git 凭据","skills.install.local.label":"本地路径","skills.install.local.inputAria":"本地技能路径","skills.status.dialogTitle":"安装状态","skills.status.confirm.title":"确认安装","skills.status.confirm.prompt":"安装所选技能?","skills.status.installing.title":"正在安装","skills.status.installing.description":"正在下载并校验…","skills.status.failed.title":"安装失败","skills.status.failed.fallback":"安装失败。","skills.status.failed.hint":"请检查访问权限后重试。","skills.error.deleteFailed":"删除技能失败","skills.error.toggleFailed":"切换技能状态失败","skills.error.installFailed":"安装技能失败","schedule.title":"定时任务","schedule.description":"按 cron、间隔或一次性触发器自动运行无界面任务提示词。","schedule.new":"新建定时任务","schedule.newAria":"创建新的定时任务","schedule.refresh":"刷新","schedule.reloadAria":"重新加载定时任务","schedule.create":"创建","schedule.save":"保存","schedule.cancel":"取消","schedule.confirmDelete":"确认?","schedule.empty":"暂无定时任务","schedule.enabled":"已启用","schedule.disabled":"已禁用","schedule.never":"从未","schedule.nextRun":"下次运行","schedule.lastRun":"上次运行","schedule.runCount":"已运行 {count} 次","schedule.trigger.kindAria":"触发器类型","schedule.trigger.cron":"Cron","schedule.trigger.interval":"间隔","schedule.trigger.once":"一次性","schedule.field.title":"标题(可选)","schedule.field.cron":"Cron 表达式","schedule.field.interval":"间隔","schedule.field.runAt":"运行时间","schedule.field.prompt":"提示词","schedule.field.project":"项目路径","schedule.field.model":"模型(可选)","schedule.field.permissionMode":"权限模式","schedule.field.isolation":"隔离方式","schedule.placeholder.title":"每晚依赖审查","schedule.placeholder.cron":"0 9 * * 1 (分 时 日 月 周)","schedule.placeholder.interval":"30m / 2h / 1d","schedule.placeholder.prompt":"描述要运行的任务…","schedule.placeholder.project":"/path/to/project","schedule.placeholder.model":"例如 anthropic/claude-sonnet","schedule.model.current":"使用当前模型","schedule.permission.default":"默认","schedule.permission.autoEdit":"自动编辑","schedule.permission.yolo":"Yolo","schedule.permission.plan":"规划","schedule.isolation.local":"本地","schedule.isolation.worktree":"工作树","schedule.cadence.cron":"cron:{expr}","schedule.cadence.interval":"每 {interval}","schedule.cadence.once":"于 {time} 运行一次","schedule.status.queued":"排队中","schedule.status.running":"运行中","schedule.status.completed":"已完成","schedule.status.failed":"失败","schedule.status.cancelled":"已取消","schedule.status.interrupted":"已中断","schedule.status.error":"出错","schedule.status.never":"尚未运行","schedule.runNowAria":"立即运行“{title}”","schedule.editAria":"编辑“{title}”","schedule.deleteAria":"删除“{title}”","schedule.enableAria":"启用“{title}”","schedule.disableAria":"禁用“{title}”","schedule.error.promptRequired":"提示词不能为空。","schedule.error.projectRequired":"项目路径不能为空。","schedule.error.cronRequired":"Cron 表达式不能为空。","schedule.error.invalidInterval":"请输入类似 30m、2h 或 1d 的间隔。","schedule.error.runAtRequired":"请选择有效的运行时间。","schedule.error.loadFailed":"加载定时任务失败。","schedule.error.createFailed":"创建定时任务失败。","schedule.error.updateFailed":"更新定时任务失败。","schedule.error.deleteFailed":"删除定时任务失败。","schedule.error.toggleFailed":"切换定时任务状态失败。","schedule.error.runFailed":"运行定时任务失败。"},rw=["en","zh"],Va={en:tw,zh:nw},qp="blade-ui-locale",Qc=typeof window<"u"&&typeof document<"u";function sw(){var e,t;if(Qc){try{const r=(e=window.localStorage)==null?void 0:e.getItem(qp);if(r==="en"||r==="zh")return r}catch{}return(typeof navigator<"u"&&(navigator.language||((t=navigator.languages)==null?void 0:t[0]))||"").toLowerCase().startsWith("zh")?"zh":"en"}return"en"}let Gr=sw();const dc=new Set;function iw(){for(const e of dc)e()}function x3(){return Gr}function ow(e){var t;if(e!==Gr){if(Gr=e,Qc){try{(t=window.localStorage)==null||t.setItem(qp,e)}catch{}document!=null&&document.documentElement&&(document.documentElement.lang=e==="zh"?"zh-CN":"en")}iw()}}function zp(e){return dc.add(e),()=>dc.delete(e)}function aw(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>{const s=t[r];return s==null?n:String(s)}):e}function Ke(e,t){const r=(Va[Gr]??Va.en)[e]??Va.en[e];return aw(r,t)}function Ut(){return y.useSyncExternalStore(zp,()=>Gr,()=>"en"),Ke}function cw(){return{locale:y.useSyncExternalStore(zp,()=>Gr,()=>"en"),setLocale:ow}}Qc&&(document!=null&&document.documentElement)&&(document.documentElement.lang=Gr==="zh"?"zh-CN":"en");function kt(e,t){return{...e,...t}}function Br(e,t,n){return e>=t&&e<=n}function lw(e){return e===8205}function dw(e){return Br(e,55296,56319)}function wu(e){return Br(e,127462,127487)}function Kp(e){return Br(e,65024,65039)}function Gp(e){return Br(e,768,879)||Br(e,6832,6911)||Br(e,7616,7679)||Br(e,65056,65071)}function Co(e){return e>65535?2:1}function vu(e,t){for(;t<e.length;){const n=e.codePointAt(t);if(Gp(n)||Kp(n))t+=Co(n);else break}return t}function Yc(e,t){const n=e.codePointAt(t);let r=t+Co(n);for(r=vu(e,r);r<e.length-1&&e[r]==="";){const s=e.codePointAt(r+1);r+=1+Co(s),r=vu(e,r)}return wu(n)&&r<e.length&&wu(e.codePointAt(r))&&(r+=Co(e.codePointAt(r))),r}function Vp(e){return dw(e)||Gp(e)||Kp(e)||lw(e)}function uw(e){let t=0,n=0;for(;n<e.length;)n=Yc(e,n),t++;return t}function pw(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=Yc(e,r),n++,n>=t)return!0;return!1}function fw(e,t){let n=0,r=0;for(;r<e.length;)if(r=Yc(e,r),n++,n>t)return!1;return!0}function mw(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Vp(e.charCodeAt(n)))return pw(e,t);if(n++,n>=t)return!0}return!1}function hw(e,t){let n=0;for(;n<e.length;){if(Vp(e.charCodeAt(n)))return fw(e,t);if(n++,n>t)return!1}return!0}function q(e){return Array.isArray(e)}function st(e){return g(typeof e,"bigint")}function xt(e){return g(typeof e,"boolean")}function ta(e){if(Fe(e)||!Tn(e))return!1;const t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function Tn(e){return g(typeof e,"function")}function Zc(e){return Number.isInteger(e)}function Xt(e){return g(e,null)}function Ie(e){return Number.isFinite(e)}function kn(e){return re(e)&&!q(e)}function re(e){return g(typeof e,"object")&&!Xt(e)}function pe(e){return g(typeof e,"string")}function Xc(e){return g(typeof e,"symbol")}function Fe(e){return g(e,void 0)}function g(e,t){return e===t}function ts(e,t){return e>t}function Si(e,t){return e<t}function ir(e,t){return e<=t}function Rs(e,t){return e>=t}function Wp(e,t){if(st(e)||st(t))return BigInt(e)%BigInt(t)===0n;const n=1e-10;if(!Ie(e)||Zc(e)&&1/t%1===0)return!0;const r=e%t;return Math.min(Math.abs(r),Math.abs(r-t),Math.abs(r+t))<n}function Jp(e){if(!re(e))return!1;const t=globalThis.Object.getPrototypeOf(e);return Xt(t)?!1:g(typeof t.constructor,"function")&&!(g(t.constructor,globalThis.Object)||g(t.constructor.name,"Object"))}function Ms(e){return st(e)||xt(e)||Xt(e)||Ie(e)||pe(e)||Fe(e)}function gw(e){return uw(e)}function Qp(e,t){return hw(e,t)}function Yp(e,t){return mw(e,t)}function ht(e,t,n){for(let r=t;r<e.length;r++)if(!n(e[r],r))return!1;return!0}function Pt(e,t,n){let r=!0;for(let s=t;s<e.length;s++)n(e[s],s)||(r=!1);return r}function $s(e,t){for(let n=0;n<e.length;n++)if(t(e[n],n))return!0;return!1}function Zp(e,t){let n=!1;for(let r=0;r<e.length;r++)t(e[r],r)&&(n=!0);return n}function el(e,t){return e.reduce((n,r,s)=>t(r,s)?++n:n,0)}function Te(e,t,n){return g(e.length,0)?n():t(e[0],e.slice(1))}function er(e){return g(e,"__proto__")||g(e,"constructor")||g(e,"prototype")}function E(e,t){return er(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function tl(e){return U(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function it(e){return Object.entries(e)}function U(e){return Object.getOwnPropertyNames(e)}function nl(e){return Object.getOwnPropertySymbols(e)}function rl(e){return Object.values(e)}function bw(e,t){if(!re(t))return!1;const n=U(e);return g(n.length,U(t).length)&&n.every(r=>ns(e[r],t[r]))}function kw(e,t){return q(t)&&g(e.length,t.length)&&e.every((n,r)=>ns(e[r],t[r]))}function ns(e,t){return q(e)?kw(e,t):re(e)?bw(e,t):g(e,t)}const Mo=Object.freeze(Object.defineProperty({__proto__:null,Counted:el,Entries:it,EntriesRegExp:tl,Every:ht,EveryAll:Pt,GraphemeCount:gw,HasPropertyKey:E,IsArray:q,IsBigInt:st,IsBoolean:xt,IsClassInstance:Jp,IsConstructor:ta,IsDeepEqual:ns,IsEqual:g,IsFunction:Tn,IsGreaterEqualThan:Rs,IsGreaterThan:ts,IsInteger:Zc,IsLessEqualThan:ir,IsLessThan:Si,IsMaxLength:Qp,IsMinLength:Yp,IsMultipleOf:Wp,IsNull:Xt,IsNumber:Ie,IsObject:re,IsObjectNotArray:kn,IsString:pe,IsSymbol:Xc,IsUndefined:Fe,IsUnsafePropertyKey:er,IsValueLike:Ms,Keys:U,ShiftLeft:Te,Some:$s,SomeAll:Zp,Symbols:nl,Values:rl},Symbol.toStringTag,{value:"Module"})),xw=/^[\p{ID_Start}_$][\p{ID_Continue}_$\u200C\u200D]*$/u;function yw(e){return xw.test(e)}function Ct(e,t){return`(${e} && ${t})`}function Ge(e,t){return`(${e} || ${t})`}function $t(e){return`!(${e})`}function $o(e){return`Array.isArray(${e})`}function Xp(e){return`typeof ${e} === "bigint"`}function ww(e){return`typeof ${e} === "boolean"`}function vw(e){return`Number.isInteger(${e})`}function Sw(e){return`${e} === null`}function ef(e){return`Number.isFinite(${e})`}function tf(e){return Ct(nf(e),$t($o(e)))}function nf(e){return`typeof ${e} === "object" && ${e} !== null`}function rf(e){return`typeof ${e} === "string"`}function jw(e){return`typeof ${e} === "symbol"`}function uc(e){return`${e} === undefined`}function Iw(e){return`typeof ${e} === "function"`}function Cw(e){return`Guard.IsConstructor(${e})`}function Zt(e,t){return`${e} === ${t}`}function sf(e,t){return`${e} > ${t}`}function sl(e,t){return`${e} < ${t}`}function rs(e,t){return`${e} <= ${t}`}function ji(e,t){return`${e} >= ${t}`}function Ew(e,t){return`Guard.IsMinLength(${e}, ${t})`}function Tw(e,t){return`Guard.IsMaxLength(${e}, ${t})`}function Hn(e,t,n,r){return g(t,"0")?`${e}.every((${n[0]}, ${n[1]}) => ${r})`:`((value, callback) => { for(let index = ${t}; index < value.length; index++) if (!callback(value[index], index)) return false; return true })(${e}, (${n[0]}, ${n[1]}) => ${r})`}function Aw(e,t,n){return`${e}.some((${t[0]}, ${t[1]}) => ${n})`}function Pw(e,t,n){return`((value, callback) => { let result = false; for(let index = 0; index < value.length; index++) if (callback(value[index], index)) result = true; return result })(${e}, (${t[0]}, ${t[1]}) => ${n})`}function na(e,t,n){return`${e}.reduce((result, ${t[0]}, ${t[1]}) => (${n}) ? ++result : result, 0)`}function of(e){return`Object.entries(${e})`}function ss(e){return`Object.getOwnPropertyNames(${e})`}function Vr(e,t){return g(t,'"__proto__"')||g(t,'"constructor"')?`Object.prototype.hasOwnProperty.call(${e}, ${t})`:`${t} in ${e}`}function af(e,t){return`Guard.IsDeepEqual(${e}, ${t})`}function Nw(e){return`[${e.join(", ")}]`}function xr(e,t){return`((${e.join(", ")}) => ${t})`}function Ve(e,t){return`${e}(${t.join(", ")})`}function il(e,t){return`new ${e}(${t.join(", ")})`}function ge(e,t){return`${e}${yw(t)?`.${t}`:`[${G(t)}]`}`}function G(e){if(!Ms(e))throw Error("Unsupported Constant");return pe(e)?JSON.stringify(e):`${e}`}function Ow(e,t,n){return`(${e} ? ${t} : ${n})`}function ra(e){return`{ ${e.join("; ")}; }`}function tr(e,t){return`const ${e} = ${t}`}function cf(e,t){return`if(${e}) { ${t} }`}function sa(e){return`return ${e}`}function Tt(e){return g(e.length,0)?"true":e.reduce((t,n)=>Ct(t,n))}function ol(e){return g(e.length,0)?"false":e.reduce((t,n)=>Ge(t,n))}function Rw(e,t){return`Guard.IsMultipleOf(${e}, ${t})`}function Mw(e){return e instanceof Boolean}function $w(e){return e instanceof Number}function Fw(e){return e instanceof String}function Ii(e){return globalThis.ArrayBuffer.isView(e)}function lf(e){return e instanceof globalThis.RegExp}function df(e){return e instanceof globalThis.Date}function uf(e){return e instanceof globalThis.Set}function pf(e){return e instanceof globalThis.Map}function Lw(e){return E(e,"~kind")||E(e,"~unsafe")}function Dw(e){const t={},n=Object.getOwnPropertyDescriptors(e);for(const r of Object.keys(n)){if(er(r))continue;const s=n[r];E(s,"value")&&Object.defineProperty(t,r,{...s,value:Wr(s.value)})}return t}function _w(e){const t={};for(const n of U(e))er(n)||(t[n]=Wr(e[n]));for(const n of nl(e))t[n]=Wr(e[n]);return t}function Uw(e){return Jp(e)?e:Lw(e)?Dw(e):_w(e)}function Bw(e){return e.map(t=>Wr(t))}function Hw(e){return e.slice()}function qw(e){return new RegExp(e.source,e.flags)}function zw(e){return new Map(Wr([...e.entries()]))}function Kw(e){return new Set(Wr([...e.values()]))}function Wr(e){return Ii(e)?Hw(e):lf(e)?qw(e):pf(e)?zw(e):uf(e)?Kw(e):q(e)?Bw(e):re(e)?Uw(e):e}function al(e){return Wr(e)}const Gw={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Ci(){return Gw}function Vw(e,t){for(const n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Ww(e,t){return{...e,...t}}function we(e,t,n={}){const r=Ww(t,n);return Vw(r,e)}function Mn(e,t){const n={},r=Object.getOwnPropertyDescriptors(al(e)),s=new Set(t);for(const i of Object.keys(r))s.has(i)||Object.defineProperty(n,i,r[i]);return n}function ke(e,t,n){const r=Ci(),s=al(e);for(const i of Object.keys(t))Object.defineProperty(s,i,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[i]});for(const i of Object.keys(n))Object.defineProperty(s,i,{configurable:!0,enumerable:!0,writable:!0,value:n[i]});return s}function Ce(e,t){return re(e)&&E(e,"~kind")&&g(e["~kind"],t)}function on(e){return re(e)}function Ne(e,t,n){return we({"~kind":"Deferred"},{type:"deferred",action:e,parameters:t,options:n},{})}function Ps(e){return Ce(e,"Deferred")}function Jw(e){return ke(e,{"~readonly":!0},{})}function cl(e,t){return ke(Jw(e),{},t)}function Qw(e,t,n,r){const s=V(e,t,n);return cl(s,r)}function Yw(e){return ke(e,{"~optional":!0},{})}function ll(e,t){return ke(Yw(e),{},t)}function Zw(e,t,n,r){const s=V(e,t,n);return ll(s,r)}function Ir(e,t){return we({"~kind":"Array"},{type:"array",items:e},t)}function gt(e){return Ce(e,"Array")}function dl(e){return Mn(e,["~kind","type","items"])}function Ei(e,t,n={}){return we({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},n)}function xn(e){return Ce(e,"Constructor")}function Xw(e){return Mn(e,["~kind","type","parameters","instanceType"])}function Ti(e,t,n={}){return we({"~kind":"Function"},{type:"function",parameters:e,returnType:t},n)}function yn(e){return Ce(e,"Function")}function ev(e){return Mn(e,["~kind","type","parameters","returnType"])}function gn(e,t){return we({"~kind":"Ref"},{$ref:e},t)}function vt(e){return Ce(e,"Ref")}function Ai(e,t){return we({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function ul(e){return Ce(e,"Generic")}function pl(e){return we({"~kind":"Any"},{},e)}function $n(e){return Ce(e,"Any")}const tv="(?!)";function Nt(e){return we({"~kind":"Never"},{not:{}},e)}function Fs(e){return Ce(e,"Never")}function nr(e,t={}){return Ne("AddOptional",[e],t)}function Fo(e,t={}){return ll(e,t)}function nv(e){return Fo(e)}function an(e){return on(e)&&E(e,"~optional")}function rv(e){return U(e).filter(t=>!an(e[t]))}function ff(e){return U(e)}function mf(e){return rl(e)}function Me(e,t={}){const n=rv(e),r=n.length>0?{required:n}:{};return we({"~kind":"Object"},{type:"object",...r,properties:e},t)}function Ue(e){return Ce(e,"Object")}function sv(e){return Mn(e,["~kind","type","properties","required"])}function Kt(e){return we({"~kind":"Unknown"},{},e)}function An(e){return Ce(e,"Unknown")}function Pi(e,t,n){const r=U(e).reduce((s,i)=>({...s,[i]:ke(e[i],{},{$id:i})}),{});return we({"~kind":"Cyclic"},{$defs:r,$ref:t},n)}function Gt(e){return Ce(e,"Cyclic")}function iv(e){return ke(e,{"~unsafe":null},{})}function hf(e){return kn(e)&&E(e,"~unsafe")&&Xt(e["~unsafe"])}function ut(e,t){var n;return((n=t[e.length])==null?void 0:n.call(t,...e))??(()=>{throw Error("Invalid Arguments")})()}function pc(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s,s],1:r=>[r,Kt(),Kt()]});return we({"~kind":"Infer"},{type:"infer",name:t,extends:n},{})}function cn(e){return Ce(e,"Infer")}function Lo(e,t,n,r={}){return we({"~kind":"Dependent"},{if:e,then:t,else:n},r)}function wn(e){return Ce(e,"Dependent")}function ov(e){return Mn(e,["~kind","if","then","else"])}function av(e){return kn(e)}function cv(e){return U(e).filter(n=>isNaN(n)).reduce((n,r)=>[...n,e[r]],[])}function lv(e){return pe(e)||Ie(e)}function dv(e,t){const n=av(e)?cv(e):e;return we({"~kind":"Enum"},{enum:n},t)}function vn(e){return Ce(e,"Enum")}function Bn(e,t={}){return we({"~kind":"Intersect"},{allOf:e},t)}function Be(e){return Ce(e,"Intersect")}function uv(e){return Mn(e,["~kind","allOf"])}let Wa;function pv(){try{return bf("null")(),!0}catch{return!1}}function gf(){return Fe(Wa)&&(Wa=pv()),Wa&&Ci().useAcceleration}function bf(...e){return new globalThis.Function(...e)}function Ft(){throw new Error("Unreachable")}function fv(e){const t=new Set;let n=e;for(;n&&n!==Object.prototype;){for(const r of Reflect.ownKeys(n))r!=="constructor"&&typeof r!="symbol"&&t.add(r);n=Object.getPrototypeOf(n)}return[...t]}function mv(e){return typeof e=="number"}var Lt;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(Lt||(Lt={}));let Es=BigInt("14695981039346656037");const[hv,gv]=[BigInt("1099511628211"),BigInt("18446744073709551616")],bv=Array.from({length:256}).map((e,t)=>BigInt(t)),kf=new Float64Array(1),xf=new DataView(kf.buffer),yf=new Uint8Array(kf.buffer);function St(e){Es=Es^bv[e],Es=Es*hv%gv}function kv(e){St(Lt.Array);for(const t of e)yr(t)}function xv(e){St(Lt.BigInt),xf.setBigInt64(0,e);for(const t of yf)St(t)}function Su(e){St(Lt.Boolean),St(e?1:0)}function yv(e){St(Lt.Constructor),yr(e.toString())}function wv(e){St(Lt.Date),yr(e.getTime())}function vv(e){St(Lt.Function),yr(e.toString())}function Sv(e){St(Lt.Null)}function ju(e){St(Lt.Number),xf.setFloat64(0,e,!0);for(const t of yf)St(t)}function jv(e){St(Lt.Object);for(const t of fv(e).sort())yr(t),yr(e[t])}function Iv(e){St(Lt.RegExp),fc(e.toString())}const Cv=new TextEncoder;function fc(e){St(Lt.String);for(const t of Cv.encode(e))St(t)}function Ev(e){St(Lt.Symbol),yr(e.toString())}function Tv(e){St(Lt.TypeArray);const t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)St(t[n])}function Av(e){return St(Lt.Undefined)}function yr(e){return Ii(e)?Tv(e):df(e)?wv(e):lf(e)?Iv(e):Mw(e)?Su(e.valueOf()):Fw(e)?fc(e.valueOf()):$w(e)?ju(e.valueOf()):mv(e)?ju(e):q(e)?kv(e):xt(e)?Su(e):st(e)?xv(e):ta(e)?yv(e):Xt(e)?Sv():re(e)?jv(e):pe(e)?fc(e):Xc(e)?Ev(e):Fe(e)?Av():Tn(e)?vv(e):Ft()}function wf(e){return Es=BigInt("14695981039346656037"),yr(e),Es}function ia(e){return wf(e).toString(16).padStart(16,"0")}const Pv=Object.freeze(Object.defineProperty({__proto__:null,Hash:ia,HashCode:wf},Symbol.toStringTag,{value:"Module"}));function Nv(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}let Ov=Nv;function Rv(){return Ov}class vf{constructor(t,n){this.type=t,this.decode=n}Encode(t){const n=this.type,r=ln(n)?o=>this.decode(n["~codec"].decode(o)):this.decode,s=ln(n)?o=>n["~codec"].encode(t(o)):t,i={decode:r,encode:s};return ke(this.type,{"~codec":i},{})}}class Sf{constructor(t){this.type=t}Decode(t){return new vf(this.type,t)}}function fl(e){return new Sf(e)}function Mv(e,t){return fl(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function $v(e,t){return fl(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function ln(e){return on(e)&&E(e,"~codec")&&re(e["~codec"])&&E(e["~codec"],"encode")&&E(e["~codec"],"decode")}function Fv(e){return td(e)}function Do(e){return on(e)&&E(e,"~immutable")}function rr(e,t={}){return Ne("AddReadonly",[e],t)}function _o(e,t={}){return cl(e,t)}function Lv(e){return _o(e)}function Uo(e){return on(e)&&E(e,"~readonly")}function Dv(e,t){const n=ml(e)?[...e["~refine"],t]:[t];return ke(e,{"~refine":n},{})}function _v(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[s,i,()=>"Refine Error"]});return Dv(t,{check:n,error:r})}function Uv(e){return kn(e)&&E(e,"check")&&E(e,"error")&&Tn(e.check)&&Tn(e.error)}function ml(e){return on(e)&&E(e,"~refine")&&q(e["~refine"])&&ht(e["~refine"],0,t=>Uv(t))}const Bv="-?(?:0|[1-9][0-9]*)n";function hl(e){return we({"~kind":"BigInt"},{type:"bigint"},e)}function is(e){return Ce(e,"BigInt")}function jf(e){return we({"~kind":"Boolean"},{type:"boolean"},e)}function Cr(e){return Ce(e,"Boolean")}function mc(e){return we({"~kind":"Identifier"},{name:e})}function Hv(e){return Ce(e,"Identifier")}const If="-?(?:0|[1-9][0-9]*)";function oa(e){return we({"~kind":"Integer"},{type:"integer"},e)}function qn(e){return Ce(e,"Integer")}class qv extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}}function zv(e){return st(e)?"bigint":xt(e)?"boolean":Ie(e)?"number":pe(e)?"string":(()=>{throw new qv(e)})()}function De(e,t){return we({"~kind":"Literal"},{type:zv(e),const:e},t)}function Cf(e){return st(e)||xt(e)||Ie(e)||pe(e)}function Kv(e){return Qe(e)&&st(e.const)}function Gv(e){return Qe(e)&&xt(e.const)}function Ef(e){return Qe(e)&&Ie(e.const)}function Tf(e){return Qe(e)&&pe(e.const)}function Qe(e){return Ce(e,"Literal")}function gl(e){return we({"~kind":"Null"},{type:"null"},e)}function Ni(e){return Ce(e,"Null")}const Af="-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";function wr(e){return we({"~kind":"Number"},{type:"number"},e)}function un(e){return Ce(e,"Number")}function bl(e){return we({"~kind":"Symbol"},{type:"symbol"},e)}function Oi(e){return Ce(e,"Symbol")}function Ri(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[s,i,i],1:s=>[s,Kt(),Kt()]});return we({"~kind":"Parameter"},{name:t,extends:n,equals:r},{})}function Vv(e){return Ce(e,"Parameter")}const Pf=".*";function zn(e){return we({"~kind":"String"},{type:"string"},e)}function Fn(e){return Ce(e,"String")}function Je(e,t={}){return we({"~kind":"Union"},{anyOf:e},t)}function fe(e){return Ce(e,"Union")}function Wv(e){return Mn(e,["~kind","anyOf"])}function Nf(e){const t=NC(e);return g(t.length,2)?t[0]:[]}function Jv(e){return!0}function Of(e){return Te(e,(t,n)=>Qv(t)?Of(n):!1,()=>!0)}function Rf(e){return g(e.length,0)?!1:Of(e)}function Qv(e){return fe(e)?Rf(e.anyOf):Qe(e)?Jv(e.const):!1}function Mf(e){return Rf(e)}function $f(e){return we({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function Ff(e,t,n=[]){return Te(e,(r,s)=>Ff(s,t,[...n,`${r}${t}`]),()=>n)}function Yv(e,t){return g(e.length,0)?[`${t}`]:Ff(e,t)}function Lf(e,t,n=[]){return Te(t,(r,s)=>Lf(e,s,[...n,...Df(e,r)]),()=>n)}function Df(e,t){return fe(t)?Lf(e,t.anyOf):Qe(t)?Yv(e,t.const):Ft()}function _f(e,t){return Te(t,(n,r)=>_f(Df(e,n),r),()=>e)}function Zv(e){return e.map(t=>De(t))}function Xv(e){const t=_f([],e),n=Zv(t);return Je(n)}function eS(e){return g(e.length,0)?Ft():g(e.length,1)&&Qe(e[0])?e[0]:Xv(e)}function Uf(e){const t=Nf(e);return g(t.length,0)?zn():Mf(t)?eS(t):$f(e)}function kl(e){const t=Uf(e);return Wt(t)?zn():t}function vr(e,t){const n="object",r={[e]:t};return we({"~kind":"Record"},{type:n,patternProperties:r})}function tS(e){return vr(Qr,e)}function nS(e){return Me({true:e,false:e})}function Sn(e,t={}){const[n,r,s]=[e,e.length,!1];return we({"~kind":"Tuple"},{type:"array",additionalItems:s,items:n,minItems:r},t)}function at(e){return Ce(e,"Tuple")}function rS(e){return Mn(e,["~kind","type","items","minItems","additionalItems"])}function sS(e){return Mn(e,["~readonly"])}function Bf(e,t){return ke(sS(e),{},t)}function iS(e,t,n,r){const s=V(e,t,n);return Bf(s,r)}function oS(e,t={}){return Ne("RemoveReadonly",[e],t)}function aS(e,t={}){return Bf(e,t)}function cS(e){return Mn(e,["~optional"])}function Hf(e,t){return ke(cS(e),{},t)}function lS(e,t,n,r){const s=V(e,t,n);return Hf(s,r)}function dS(e,t={}){return Ne("RemoveOptional",[e],t)}function qf(e,t={}){return Hf(e,t)}function zf(e){return e.reduceRight((n,r,s)=>({[s]:r,...n}),{})}function uS(e){const t=zf(e.items);return Me(t)}function pS(e,t){return Uo(e)?!!Uo(t):!1}function fS(e,t){return an(e)?!!an(t):!1}function mS(e,t){const n=pS(e,t),r=fS(e,t),s=pn([e,t]),i=aS(qf(s));return n&&r?_o(Fo(i)):n&&!r?_o(i):!n&&r?Fo(i):i}function hS(e,t,n){return n in e?n in t?mS(e[n],t[n]):e[n]:n in t?t[n]:Nt()}function gS(e,t){return[...new Set([...U(t),...U(e)])].reduce((r,s)=>({...r,[s]:hS(e,t,s)}),{})}function Iu(e){return Ue(e)?e.properties:at(e)?zf(e.items):Ft()}function bS(e,t){const n=Iu(e),r=Iu(t),s=gS(n,r);return Me(s)}function kS(e,t){const n=ga(e,t);return g(n,Hl)?e:g(n,ql)||g(n,Bl)?t:Nt()}function Cu(e){return Ue(e)||at(e)}function xS(e,t){const n=fe(e),r=fe(t);return n||r}function yS(e,t){const n=Jr(e),r=Jr(t),s=xS(n,r),i=Cu(n),o=Cu(r);return s?pn([n,r]):i&&o?bS(n,r):i&&!o?n:!i&&o?r:kS(n,r)}function Kf(e,t,n=[]){return Te(t,(r,s)=>Kf(e,s,[...n,yS(e,r)]),()=>g(n.length,0)?[e]:n)}function Gf(e,t,n=[]){return Te(e,(r,s)=>Gf(s,t,[...n,...Bo([r],t)]),()=>n)}function Bo(e,t=[]){return Te(e,(n,r)=>fe(n)?Bo(r,Gf(n.anyOf,t)):Bo(r,Kf(n,t)),()=>t)}function wS(e,t){const n=sr({},e,t);return Yt(n)?[]:[e]}function vS(e,t){return e.reduce((n,r)=>[...n,...wS(r,t)],[])}function Vf(e,t){const n=Jr(e),r=fe(n)?n.anyOf:[n],s=vS(r,t);return ar(s)}function Ls(e,t,n){const r=Bn([e,t]),s=Vf(n,e);return ar([r,s])}function Er(e){const t=e.map(n=>De(n));return ar(t)}function pn(e){const t=Bo(e),n=uh(t);return Ds(n)}function or(e){const t=kl(e);return Jr(t)}function ar(e){const t=uh(e);return Ds(t)}function Jr(e){return wn(e)?Ls(e.if,e.then,e.else):vn(e)?Er(e.enum):Be(e)?pn(e.allOf):Wt(e)?or(e.pattern):fe(e)?ar(e.anyOf):e}function Ds(e){return g(e.length,1)?e[0]:g(e.length,0)?Nt():Je(e)}function SS(e,t){const n=Er(e);return ca(n,t)}function jS(e,t){return vr(Mi,t)}function IS(e,t){const n=pn(e);return ca(n,t)}function CS(e,t){return pe(e)||Ie(e)?Me({[e]:t}):g(e,!1)?Me({false:t}):g(e,!0)?Me({true:t}):Me({})}function ES(e,t){return vr(la,t)}function TS(e,t){return E(e,"pattern")&&(pe(e.pattern)||e.pattern instanceof RegExp)?vr(e.pattern.toString(),t):vr(Qr,t)}function AS(e,t){const n=Nf(e);return Mf(n)?ca(or(e),t):vr(e,t)}function PS(e){return fe(e)?aa(e.anyOf):[e]}function aa(e){return e.reduce((t,n)=>[...t,...PS(n)],[])}function NS(e){return e.some(t=>Fn(t)||un(t)||qn(t))}function OS(e,t){return g(NS(e),!0)?vr(Qr,t):void 0}function RS(e,t){return e.reduce((n,r)=>Qe(r)&&(pe(r.const)||Ie(r.const))?{...n,[r.const]:t}:n,{})}function MS(e,t){const n=RS(e,t);return Me(n)}function $S(e,t){const n=aa(e),r=OS(n,t);return on(r)?r:MS(n,t)}function ca(e,t){return $n(e)?tS(t):Cr(e)?nS(t):vn(e)?SS(e.enum,t):qn(e)?jS(e,t):Be(e)?IS(e.allOf,t):Qe(e)?CS(e.const,t):un(e)?ES(e,t):fe(e)?$S(e.anyOf,t):Fn(e)?TS(e,t):Wt(e)?AS(e.pattern,t):Me({})}function Wf(e,t,n){return Xe([e])?ke(ca(e,t),{},n):Jf(e,t,n)}function FS(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Wf(i,o,s)}const Mi=`^${If}$`,la=`^${Af}$`,Qr=`^${Pf}$`;function Jf(e,t,n={}){return Ne("Record",[e,t],n)}function xl(e,t,n={}){return Wf(e,t,n)}function LS(e,t){return vr(e,t)}function hc(e){return g(e,Qr)?zn():g(e,Mi)?oa():g(e,la)?wr():Uf(e)}function jn(e){return U(e.patternProperties)[0]}function da(e){const t=jn(e);return hc(t)}function Vt(e){return e.patternProperties[jn(e)]}function Ot(e){return Ce(e,"Record")}function ua(e){return we({"~kind":"Rest"},{type:"rest",items:e},{})}function pa(e){return Ce(e,"Rest")}function Qf(e){return we({"~kind":"This"},{$ref:"#"},e)}function Yf(e){return Ce(e,"This")}function yl(e){return we({"~kind":"Undefined"},{type:"undefined"},e)}function _s(e){return Ce(e,"Undefined")}function Zf(e){return we({"~kind":"Void"},{type:"void"},e)}function os(e){return Ce(e,"Void")}function DS(e,t){return g(e,"Array")?Ir(t[0]):g(e,"Capitalize")?gh(t[0]):g(e,"ConstructorParameters")?Ch(t[0]):g(e,"Evaluate")?NP(t[0]):g(e,"Exclude")?Th(t[0],t[1]):g(e,"Extract")?Ah(t[0],t[1]):g(e,"Index")?Wl(t[0],t[1]):g(e,"InstanceType")?Fh(t[0]):g(e,"Lowercase")?bh(t[0]):g(e,"NonNullable")?Bh(t[0]):g(e,"Omit")?qh(t[0],t[1]):g(e,"Parameters")?Gh(t[0]):g(e,"Partial")?Wh(t[0]):g(e,"Pick")?Qh(t[0],t[1]):g(e,"Readonly")?Zh(t[0]):g(e,"KeyOf")?Zl(t[0]):g(e,"Record")?Jf(t[0],t[1]):g(e,"Required")?tg(t[0]):g(e,"ReturnType")?rg(t[0]):g(e,"Uncapitalize")?kh(t[0]):g(e,"Uppercase")?xh(t[0]):Ic(gn(e),t)}function as(){throw Error("Unreachable")}function Xf(e,t=[]){return Te(e,(n,r)=>Xf(r,[...t,n[1]]),()=>t)}function cr(e){return g(e.length,3)?[e[0],...Xf(e[1])]:[]}function _S(e){return Ri(e[0],e[2],e[4])}function US(e){return Ri(e[0],e[2],e[2])}function BS(e){return Ri(e[0],Kt(),e[2])}function HS(e){return Ri(e,Kt(),Kt())}function qS(e){return cr(e)}function zS(e){return e[1]}function KS(e){return cr(e)}function GS(e){return e[1]}function VS(e){return DS(e[0],e[1])}function WS(e){return null}function JS(e){return zn()}function QS(e){return wr()}function YS(e){return jf()}function ZS(e){return yl()}function XS(e){return gl()}function e1(e){return oa()}function t1(e){return hl()}function n1(e){return Kt()}function r1(e){return pl()}function s1(e){return Me({})}function i1(e){return Nt()}function o1(e){return bl()}function a1(e){return Zf()}function c1(e){return Qf()}function l1(e){return De(BigInt(e))}function d1(e){return De(g(e,"true"))}function u1(e){return De(parseFloat(e))}function p1(e){return De(e)}function f1(e){return e[1]}function m1(e){return De(e)}function h1(e){return g(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function g1(e){return e[1]}function b1(e){return Qm(e)}function k1(e){return g(e.length,6)?Lo(e[1],e[3],e[5]):Lo(e[1],e[3],Kt())}function x1(e){return e.length>0}function y1(e){return e.reduce((t,n)=>g(n.length,3)?[...t,[n[1]]]:[...t,[]],[])}function w1(e){return g(e.length,6)?[e[1],e[3],e[5]]:[]}function v1(e){return q(e)&&g(e.length,3)?e[1]:e}function S1(e){return g(e.length,2)?e[1]:[]}function Eu(e,t){return t.reduce((n,r)=>{const s=r;return g(s.length,1)?Wl(n,s[0]):g(s.length,0)?Ir(n):as()},e)}function Tu(e,t){return g(t.length,3)?jh(e,t[0],t[1],t[2]):e}function j1(e,t){return q(t)&&g(t.length,0)?e:ig(e,t)}function I1(e){const[t,n,r,s,i]=e;return j1(Tu(t?Zl(Eu(n,r)):Eu(n,r),s),i)}function wl(e,t){return g(t.length,3)?(()=>{const[n,r,s]=t,i=wl(r,s);if(g(n,"&"))return Be(i)?Bn([e,...i.allOf]):Bn([e,i]);if(g(n,"|"))return fe(i)?Je([e,...i.anyOf]):Je([e,i]);as()})():e}function C1(e){const[t,n]=e;return wl(t,n)}function E1(e){const[t,n]=e;return wl(t,n)}function T1(e){return PP(e[1])}function A1(e){return e[1]}function P1(e){return Ai(e[0],e[2])}function N1(e){return g(e.length,4)?pc(e[1],e[3]):g(e.length,2)?pc(e[1],Kt()):as()}function O1(e){return`${e}`}function R1(e){return qn(e[3])?Mi:un(e[3])?la:Oi(e[3])||Fn(e[3])?Qr:as()}function M1(e){return e.length>0}function $1(e){return e.length>0}function F1(e){const[t,n,r,s,i]=e;return{[n]:t&&r?rr(nr(i)):t&&!r?rr(i):!t&&r?nr(i):i}}function L1(e){return cr(e)}function em(e){return e.reduce((t,n)=>E(n,Mi)||E(n,la)||E(n,Qr)?[t[0],kt(t[1],n)]:[kt(t[0],n),t[1]],[{},{}])}function D1(e){return em(e[1])}function _1(e){const[t,n]=e,r=g(U(n).length,0)?{}:{patternProperties:n};return Me(t,r)}function U1(e){return g(e.length,5)?rr(nr(e[4])):g(e.length,3)?e[2]:g(e.length,4)?g(e[2],"readonly")?rr(e[3]):nr(e[3]):as()}function B1(e){if(!q(e)||!g(e.length,3))return e;const[t,n,r]=e;return t&&r?rr(nr(n)):t&&!r?rr(n):!t&&r?nr(n):n}function H1(e){return g(e.length,2)?ua(e[1]):g(e.length,1)?e[0]:as()}function q1(e){return cr(e)}function z1(e){return Sn(e[1])}function K1(e){return rr(nr(e[4]))}function G1(e){return rr(e[3])}function V1(e){return nr(e[3])}function W1(e){return e[2]}function J1(e){return g(e.length,2)?ua(e[1]):g(e.length,1)?e[0]:as()}function Q1(e){return cr(e)}function Y1(e){return Ti(e[1],e[4])}function Z1(e){return Ei(e[2],e[5])}function Au(e,t){return g(e,"remove")?oS(t):g(e,"add")?rr(t):t}function X1(e){return g(e.length,2)&&g(e[0],"-")?"remove":g(e.length,2)&&g(e[0],"+")||g(e.length,1)?"add":"none"}function Pu(e,t){return g(e,"remove")?dS(t):g(e,"add")?nr(t):t}function ej(e){return g(e.length,2)&&g(e[0],"-")?"remove":g(e.length,2)&&g(e[0],"+")||g(e.length,1)?"add":"none"}function tj(e){return g(e.length,2)?[e[1]]:[]}function nj(e){return q(e[6])&&g(e[6].length,1)?Cc(mc(e[3]),e[5],e[6][0],Au(e[1],Pu(e[8],e[10]))):Cc(mc(e[3]),e[5],gn(e[3]),Au(e[1],Pu(e[8],e[10])))}function rj(e){return gn(e)}function sj(e){return BigInt(e)}function ij(e){return parseFloat(e)}function oj(e){return g(e,"true")}function aj(e){return null}function cj(e){return{[e[0]]:e[2]}}function lj(e){return cr(e)}function dj(e){return e.reduce((t,n)=>kt(t,n),{})}function uj(e){return dj(e[1])}function pj(e){return cr(e)}function fj(e){return e[1]}function mj(e){return hl()}function hj(e){return zn()}function gj(e){return wr()}function bj(e){return oa()}function kj(e){return Nt()}function xj(e){return De(e)}function yj(e){return Je(e[1])}function wj(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function vj(e){return[e[0],...e[1]]}function Sj(e){return e[1]}function jj(e){return cr(e)}function Ij(e){return g(e.length,2)?e[1]:[]}function Cj(e){const t=e[2],n=e[3],[r,s]=e[4],i=g(U(s).length,0)?{}:{patternProperties:s};return{[e[1]]:Ai(t,_l(n,r,i))}}function Ej(e){const t=e[2],[n,r]=e[3],s=g(U(r).length,0)?{}:{patternProperties:r};return{[e[1]]:_l(t,n,s)}}function Tj(e){return{[e[1]]:Ai(e[2],e[4])}}function Aj(e){return{[e[1]]:e[3]}}function Pj(e){return null}function Nj(e){return cr(e)}function Oj(e){return e[1]}function Rj(e){const[t,n]=[e[0],e[1]];return OP(kt(t,em(n)[0]))}function vl(e){return g(e.length,2)}function Le(e,t,n){return vl(e)?t(e[0],e[1]):n()}function Mj(e,t){return g(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Dt(e,t){for(let n=0;n<e.length;n++){const r=Mj(e[n],t);if(vl(r))return r}return[]}function gc(e,t){return Array.from({length:t-e+1},(n,r)=>String.fromCharCode(e+r))}const $j=[...gc(97,122),...gc(65,90)],tm="0",nm=gc(49,57),Sl=[tm,...nm],Fj=" ",jl=`
|
|
263
|
+
`,$i="_",Il=".",Lj="$",rm="-",sm="//",im="/*",Dj="*/";function om(e){const t=e.indexOf(Dj);return g(t,-1)?"":e.slice(t+2)}function am(e){const t=e.indexOf(jl);return g(t,-1)?"":e.slice(t)}function _j(e){return e.replace(/^[ \t\r\f\v]+/,"")}function bc(e){const t=_j(e);return t.startsWith(im)?bc(om(t.slice(2))):t.startsWith(sm)?bc(am(t.slice(2))):t}function Pn(e){const t=e.trimStart();return t.startsWith(im)?Pn(om(t.slice(2))):t.startsWith(sm)?Pn(am(t.slice(2))):t}function cm(e,t){return Le(Dt([e],t),(n,r)=>[n,r],()=>["",t])}function Uj(e,t){return e.includes(t)}function Ho(e,t,n,r=""){return Le(Dt(e,n),(s,i)=>Uj(t,s)?Ho(e,t,i,r):Ho(e,t,i,`${r}${s}`),()=>[r,n])}function Bj(e){return Dt(nm,e)}const Hj=[...Sl,$i];function qj(e){return Ho(Hj,[$i],e)}function zj(e){return Le(Dt([tm],e),(t,n)=>[t,n],()=>Le(Bj(e),(t,n)=>Le(qj(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[]))}function lm(e){return zj(Pn(e))}function Kj(e){return cm(rm,e)}function Gj(e){return Le(Kj(e),(t,n)=>Le(lm(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[])}function Vj(e){return Gj(Pn(e))}function Wj(e){return Le(Vj(e),(t,n)=>Le(Dt(["n"],n),(r,s)=>[`${t}`,s],()=>[]),()=>[])}function dm(e){return Wj(e)}function Ja(e,t){return Dt([e],t)}function v(e,t){return g(e,"")?["",t]:e.startsWith(jl)?Ja(e,bc(t)):e.startsWith(Fj)?Ja(e,t):Ja(e,Pn(t))}const um=[...$j,$i,Lj];function Jj(e){return Dt(um,e)}const Qj=[...um,...Sl];function pm(e,t=""){return Le(Dt(Qj,e),(n,r)=>pm(r,`${t}${n}`),()=>[t,e])}function Yj(e){return Le(Jj(e),(t,n)=>Le(pm(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[])}function rt(e){return Yj(Pn(e))}const Zj=[...Sl,$i];function Xj(e){return vl(Dt([Il],e))}function fm(e){return Le(Ho(Zj,[$i],e),(t,n)=>g(t,"")?[]:[t,n],()=>[])}function eI(e){return Le(Dt([Il],e),(t,n)=>Le(fm(n),(r,s)=>[`0${t}${r}`,s],()=>[]),()=>[])}function tI(e){return Le(lm(e),(t,n)=>Le(Dt([Il],n),(r,s)=>Le(fm(s),(i,o)=>[`${t}${r}${i}`,o],()=>[`${t}`,s]),()=>[`${t}`,n]),()=>[])}function nI(e){return Xj(e)?eI(e):tI(e)}function rI(e){return nI(Pn(e))}function sI(e){return cm(rm,e)}function iI(e){return Le(sI(e),(t,n)=>Le(rI(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[])}function Cl(e){return iI(Pn(e))}function oI(e){return g(e,"")?[]:[e.slice(0,1),e.slice(1)]}function mm(e,t){return Te(e,(n,r)=>t.startsWith(n)?!0:mm(r,t),()=>!1)}function Fi(e,t,n=""){return Le(oI(t),(r,s)=>mm(e,t)?[n,t]:Fi(e,s,`${n}${r}`),()=>[])}function aI(e,t,n){return Le(Dt([e],n),(r,s)=>Le(Fi([t],s),(i,o)=>Le(Dt([t],o),(d,f)=>[`${i}`,f],()=>[]),()=>[]),()=>[])}function cI(e,t,n){return Le(Dt([e],n),(r,s)=>Le(Fi([jl,t],s),(i,o)=>Le(Dt([t],o),(d,f)=>[`${i}`,f],()=>[]),()=>[]),()=>[])}function lI(e,t,n,r){return n?aI(e,t,Pn(r)):cI(e,t,Pn(r))}function dI(e,t){return Dt(e,t)}function uI(e,t){return lI(e,e,!1,t)}function pI(e,t){return Le(dI(e,t),(n,r)=>uI(n,`${n}${r}`),()=>[])}function El(e,t){return pI(e,Pn(t))}function fI(e,t){return Le(Fi(e,t),(n,r)=>g(n,"")?[]:[n,r],()=>[])}const l=(e,t,n=()=>[])=>e.length===2?t(e):n(),mI=e=>l(l(rt(e),([t,n])=>l(v("extends",n),([r,s])=>l(ye(s),([i,o])=>l(v("=",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[_S(t),n]),hI=e=>l(l(rt(e),([t,n])=>l(v("extends",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[US(t),n]),gI=e=>l(l(rt(e),([t,n])=>l(v("=",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[BS(t),n]),bI=e=>l(rt(e),([t,n])=>[HS(t),n]),hm=e=>l(l(mI(e),([t,n])=>[t,n],()=>l(hI(e),([t,n])=>[t,n],()=>l(gI(e),([t,n])=>[t,n],()=>l(bI(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),gm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(hm(r),([s,i])=>[[n,s],i])),([n,r])=>gm(r,[...t,n]),()=>[t,e]),kI=e=>l(l(l(hm(e),([t,n])=>l(gm(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[qS(t),n]),Tl=e=>l(l(v("<",e),([t,n])=>l(kI(n),([r,s])=>l(v(">",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[zS(t),n]),bm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(ye(r),([s,i])=>[[n,s],i])),([n,r])=>bm(r,[...t,n]),()=>[t,e]),xI=e=>l(l(l(ye(e),([t,n])=>l(bm(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[KS(t),n]),yI=e=>l(l(v("<",e),([t,n])=>l(xI(n),([r,s])=>l(v(">",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[GS(t),n]),wI=e=>l(l(rt(e),([t,n])=>l(yI(n),([r,s])=>[[t,r],s])),([t,n])=>[VS(t),n]),km=e=>l(l(l(v(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[WS(),n]),xm=e=>l(v("string",e),([t,n])=>[JS(),n]),ym=e=>l(v("number",e),([t,n])=>[QS(),n]),vI=e=>l(v("boolean",e),([t,n])=>[YS(),n]),SI=e=>l(v("undefined",e),([t,n])=>[ZS(),n]),jI=e=>l(v("null",e),([t,n])=>[XS(),n]),wm=e=>l(v("integer",e),([t,n])=>[e1(),n]),II=e=>l(v("bigint",e),([t,n])=>[t1(),n]),CI=e=>l(v("unknown",e),([t,n])=>[n1(),n]),EI=e=>l(v("any",e),([t,n])=>[r1(),n]),TI=e=>l(v("object",e),([t,n])=>[s1(),n]),AI=e=>l(v("never",e),([t,n])=>[i1(),n]),vm=e=>l(v("symbol",e),([t,n])=>[o1(),n]),PI=e=>l(v("void",e),([t,n])=>[a1(),n]),NI=e=>l(v("this",e),([t,n])=>[c1(),n]),OI=e=>l(l(v("${",e),([t,n])=>l(ye(n),([r,s])=>l(v("}",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[f1(t),n]),Qa=e=>l(Fi(["${","`"],e),([t,n])=>[m1(t),n]),Sm=e=>l(l(l(Qa(e),([t,n])=>l(OI(n),([r,s])=>l(Sm(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l(l(Qa(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l(l(Qa(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[h1(t),n]),jm=e=>l(l(v("`",e),([t,n])=>l(Sm(n),([r,s])=>l(v("`",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[g1(t),n]),RI=e=>l(jm(e),([t,n])=>[b1(t),n]),MI=e=>l(l(l(v("if",e),([t,n])=>l(ye(n),([r,s])=>l(v("then",s),([i,o])=>l(ye(o),([d,f])=>l(v("else",f),([u,m])=>l(ye(m),([p,h])=>[[t,r,i,d,u,p],h])))))),([t,n])=>[t,n],()=>l(l(v("if",e),([t,n])=>l(ye(n),([r,s])=>l(v("then",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[t,n],()=>[])),([t,n])=>[k1(t),n]),$I=e=>l(dm(e),([t,n])=>[l1(t),n]),FI=e=>l(l(v("true",e),([t,n])=>[t,n],()=>l(v("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[d1(t),n]),LI=e=>l(Cl(e),([t,n])=>[u1(t),n]),DI=e=>l(El(["'",'"'],e),([t,n])=>[p1(t),n]),_I=e=>l(l(l(v("keyof",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[x1(t),n]),Im=(e,t=[])=>l(l(l(v("[",e),([n,r])=>l(ye(r),([s,i])=>l(v("]",i),([o,d])=>[[n,s,o],d]))),([n,r])=>[n,r],()=>l(l(v("[",e),([n,r])=>l(v("]",r),([s,i])=>[[n,s],i])),([n,r])=>[n,r],()=>[])),([n,r])=>Im(r,[...t,n]),()=>[t,e]),UI=e=>l(Im(e),([t,n])=>[y1(t),n]),BI=e=>l(l(l(v("extends",e),([t,n])=>l(ye(n),([r,s])=>l(v("?",s),([i,o])=>l(ye(o),([d,f])=>l(v(":",f),([u,m])=>l(ye(m),([p,h])=>[[t,r,i,d,u,p],h])))))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[w1(t),n]),HI=e=>l(l(l(v("(",e),([t,n])=>l(ye(n),([r,s])=>l(v(")",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l(xm(e),([t,n])=>[t,n],()=>l(ym(e),([t,n])=>[t,n],()=>l(vI(e),([t,n])=>[t,n],()=>l(SI(e),([t,n])=>[t,n],()=>l(jI(e),([t,n])=>[t,n],()=>l(wm(e),([t,n])=>[t,n],()=>l(II(e),([t,n])=>[t,n],()=>l(CI(e),([t,n])=>[t,n],()=>l(EI(e),([t,n])=>[t,n],()=>l(TI(e),([t,n])=>[t,n],()=>l(AI(e),([t,n])=>[t,n],()=>l(vm(e),([t,n])=>[t,n],()=>l(PI(e),([t,n])=>[t,n],()=>l(NI(e),([t,n])=>[t,n],()=>l($I(e),([t,n])=>[t,n],()=>l(FI(e),([t,n])=>[t,n],()=>l(LI(e),([t,n])=>[t,n],()=>l(DI(e),([t,n])=>[t,n],()=>l(RI(e),([t,n])=>[t,n],()=>l(MI(e),([t,n])=>[t,n],()=>l(XI(e),([t,n])=>[t,n],()=>l(nC(e),([t,n])=>[t,n],()=>l(cC(e),([t,n])=>[t,n],()=>l(aC(e),([t,n])=>[t,n],()=>l(pC(e),([t,n])=>[t,n],()=>l(wI(e),([t,n])=>[t,n],()=>l(fC(e),([t,n])=>[t,n],()=>[])))))))))))))))))))))))))))),([t,n])=>[v1(t),n]),qI=e=>l(l(l(v("with",e),([t,n])=>l(Hm(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[S1(t),n]),Cm=e=>l(l(_I(e),([t,n])=>l(HI(n),([r,s])=>l(UI(s),([i,o])=>l(BI(o),([d,f])=>l(qI(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[I1(t),n]),Em=e=>l(l(l(v("&",e),([t,n])=>l(Cm(n),([r,s])=>l(Em(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),Tm=e=>l(l(Cm(e),([t,n])=>l(Em(n),([r,s])=>[[t,r],s])),([t,n])=>[C1(t),n]),Am=e=>l(l(l(v("|",e),([t,n])=>l(Tm(n),([r,s])=>l(Am(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),fa=e=>l(l(Tm(e),([t,n])=>l(Am(n),([r,s])=>[[t,r],s])),([t,n])=>[E1(t),n]),zI=e=>l(l(v("readonly",e),([t,n])=>l(fa(n),([r,s])=>[[t,r],s])),([t,n])=>[T1(t),n]),KI=e=>l(l(v("|",e),([t,n])=>l(fa(n),([r,s])=>[[t,r],s])),([t,n])=>[A1(t),n]),GI=e=>l(l(Tl(e),([t,n])=>l(v("=",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[P1(t),n]),VI=e=>l(l(l(v("infer",e),([t,n])=>l(rt(n),([r,s])=>l(v("extends",s),([i,o])=>l(fa(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[t,n],()=>l(l(v("infer",e),([t,n])=>l(rt(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>[])),([t,n])=>[N1(t),n]),ye=e=>l(l(VI(e),([t,n])=>[t,n],()=>l(KI(e),([t,n])=>[t,n],()=>l(zI(e),([t,n])=>[t,n],()=>l(fa(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),WI=e=>l(Cl(e),([t,n])=>[O1(t),n]),JI=e=>l(rt(e),([t,n])=>[t,n]),QI=e=>l(El(["'",'"'],e),([t,n])=>[t,n]),YI=e=>l(l(v("[",e),([t,n])=>l(rt(n),([r,s])=>l(v(":",s),([i,o])=>l(l(wm(o),([d,f])=>[d,f],()=>l(ym(o),([d,f])=>[d,f],()=>l(xm(o),([d,f])=>[d,f],()=>l(vm(o),([d,f])=>[d,f],()=>[])))),([d,f])=>l(v("]",f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[R1(t),n]),Pm=e=>l(l(WI(e),([t,n])=>[t,n],()=>l(JI(e),([t,n])=>[t,n],()=>l(QI(e),([t,n])=>[t,n],()=>l(YI(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),Nm=e=>l(l(l(v("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[M1(t),n]),Om=e=>l(l(l(v("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[$1(t),n]),Rm=e=>l(l(Nm(e),([t,n])=>l(Pm(n),([r,s])=>l(Om(s),([i,o])=>l(v(":",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[F1(t),n]),ma=e=>l(l(l(v(",",e),([t,n])=>l(v(`
|
|
264
264
|
`,n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v(";",e),([t,n])=>l(v(`
|
|
265
265
|
`,n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v(",",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l(l(v(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l(l(v(`
|
|
266
|
-
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))))),([t,n])=>[t,n]),
|
|
266
|
+
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))))),([t,n])=>[t,n]),Mm=(e,t=[])=>l(l(ma(e),([n,r])=>l(Rm(r),([s,i])=>[[n,s],i])),([n,r])=>Mm(r,[...t,n]),()=>[t,e]),ZI=e=>l(l(l(Rm(e),([t,n])=>l(Mm(n),([r,s])=>l(l(ma(s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[L1(t),n]),Al=e=>l(l(v("{",e),([t,n])=>l(ZI(n),([r,s])=>l(v("}",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[D1(t),n]),XI=e=>l(Al(e),([t,n])=>[_1(t),n]),eC=e=>l(l(l(rt(e),([t,n])=>l(v("?",n),([r,s])=>l(v(":",s),([i,o])=>l(v("readonly",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[t,n],()=>l(l(rt(e),([t,n])=>l(v(":",n),([r,s])=>l(v("readonly",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[t,n],()=>l(l(rt(e),([t,n])=>l(v("?",n),([r,s])=>l(v(":",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[t,n],()=>l(l(rt(e),([t,n])=>l(v(":",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>[])))),([t,n])=>[U1(t),n]),Nu=e=>l(l(eC(e),([t,n])=>[t,n],()=>l(l(Nm(e),([t,n])=>l(ye(n),([r,s])=>l(Om(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>[])),([t,n])=>[B1(t),n]),$m=e=>l(l(l(v("...",e),([t,n])=>l(Nu(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(Nu(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[H1(t),n]),Fm=(e,t=[])=>l(l(v(",",e),([n,r])=>l($m(r),([s,i])=>[[n,s],i])),([n,r])=>Fm(r,[...t,n]),()=>[t,e]),tC=e=>l(l(l($m(e),([t,n])=>l(Fm(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[q1(t),n]),nC=e=>l(l(v("[",e),([t,n])=>l(tC(n),([r,s])=>l(v("]",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[z1(t),n]),rC=e=>l(l(rt(e),([t,n])=>l(v("?",n),([r,s])=>l(v(":",s),([i,o])=>l(v("readonly",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[K1(t),n]),sC=e=>l(l(rt(e),([t,n])=>l(v(":",n),([r,s])=>l(v("readonly",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[G1(t),n]),iC=e=>l(l(rt(e),([t,n])=>l(v("?",n),([r,s])=>l(v(":",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[V1(t),n]),oC=e=>l(l(rt(e),([t,n])=>l(v(":",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[W1(t),n]),Ou=e=>l(l(rC(e),([t,n])=>[t,n],()=>l(sC(e),([t,n])=>[t,n],()=>l(iC(e),([t,n])=>[t,n],()=>l(oC(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),Lm=e=>l(l(l(v("...",e),([t,n])=>l(Ou(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(Ou(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[J1(t),n]),Dm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(Lm(r),([s,i])=>[[n,s],i])),([n,r])=>Dm(r,[...t,n]),()=>[t,e]),_m=e=>l(l(l(Lm(e),([t,n])=>l(Dm(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Q1(t),n]),aC=e=>l(l(v("(",e),([t,n])=>l(_m(n),([r,s])=>l(v(")",s),([i,o])=>l(v("=>",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[Y1(t),n]),cC=e=>l(l(v("new",e),([t,n])=>l(v("(",n),([r,s])=>l(_m(s),([i,o])=>l(v(")",o),([d,f])=>l(v("=>",f),([u,m])=>l(ye(m),([p,h])=>[[t,r,i,d,u,p],h])))))),([t,n])=>[Z1(t),n]),lC=e=>l(l(l(v("+",e),([t,n])=>l(v("readonly",n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v("-",e),([t,n])=>l(v("readonly",n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])))),([t,n])=>[X1(t),n]),dC=e=>l(l(l(v("+",e),([t,n])=>l(v("?",n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v("-",e),([t,n])=>l(v("?",n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])))),([t,n])=>[ej(t),n]),uC=e=>l(l(l(v("as",e),([t,n])=>l(ye(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[tj(t),n]),pC=e=>l(l(v("{",e),([t,n])=>l(lC(n),([r,s])=>l(v("[",s),([i,o])=>l(rt(o),([d,f])=>l(v("in",f),([u,m])=>l(ye(m),([p,h])=>l(uC(h),([b,k])=>l(v("]",k),([S,C])=>l(dC(C),([x,N])=>l(v(":",N),([P,L])=>l(ye(L),([D,j])=>l(km(j),([I,T])=>l(v("}",T),([M,$])=>[[t,r,i,d,u,p,b,S,x,P,D,I,M],$]))))))))))))),([t,n])=>[nj(t),n]),fC=e=>l(rt(e),([t,n])=>[rj(t),n]),mC=e=>l(dm(e),([t,n])=>[sj(t),n]),hC=e=>l(Cl(e),([t,n])=>[ij(t),n]),gC=e=>l(l(v("true",e),([t,n])=>[t,n],()=>l(v("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[oj(t),n]),bC=e=>l(El(['"',"'"],e),([t,n])=>[t,n]),kC=e=>l(v("null",e),([t,n])=>[aj(),n]),xC=e=>l(v("undefined",e),([t,n])=>[void 0,n]),Um=e=>l(l(Pm(e),([t,n])=>l(v(":",n),([r,s])=>l(Pl(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[cj(t),n]),Bm=(e,t=[])=>l(l(ma(e),([n,r])=>l(Um(r),([s,i])=>[[n,s],i])),([n,r])=>Bm(r,[...t,n]),()=>[t,e]),yC=e=>l(l(l(Um(e),([t,n])=>l(Bm(n),([r,s])=>l(l(ma(s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[lj(t),n]),Hm=e=>l(l(v("{",e),([t,n])=>l(yC(n),([r,s])=>l(v("}",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[uj(t),n]),qm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(Pl(r),([s,i])=>[[n,s],i])),([n,r])=>qm(r,[...t,n]),()=>[t,e]),wC=e=>l(l(l(Pl(e),([t,n])=>l(qm(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[pj(t),n]),vC=e=>l(l(v("[",e),([t,n])=>l(wC(n),([r,s])=>l(v("]",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[fj(t),n]),Pl=e=>l(l(mC(e),([t,n])=>[t,n],()=>l(hC(e),([t,n])=>[t,n],()=>l(gC(e),([t,n])=>[t,n],()=>l(bC(e),([t,n])=>[t,n],()=>l(kC(e),([t,n])=>[t,n],()=>l(xC(e),([t,n])=>[t,n],()=>l(Hm(e),([t,n])=>[t,n],()=>l(vC(e),([t,n])=>[t,n],()=>[])))))))),([t,n])=>[t,n]),SC=e=>l(v("-?(?:0|[1-9][0-9]*)n",e),([t,n])=>[mj(),n]),jC=e=>l(v(".*",e),([t,n])=>[hj(),n]),IC=e=>l(v("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",e),([t,n])=>[gj(),n]),CC=e=>l(v("-?(?:0|[1-9][0-9]*)",e),([t,n])=>[bj(),n]),EC=e=>l(v("(?!)",e),([t,n])=>[kj(),n]),TC=e=>l(fI(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,n])=>[xj(t),n]),AC=e=>l(l(SC(e),([t,n])=>[t,n],()=>l(jC(e),([t,n])=>[t,n],()=>l(IC(e),([t,n])=>[t,n],()=>l(CC(e),([t,n])=>[t,n],()=>l(EC(e),([t,n])=>[t,n],()=>l(PC(e),([t,n])=>[t,n],()=>l(TC(e),([t,n])=>[t,n],()=>[]))))))),([t,n])=>[t,n]),PC=e=>l(l(v("(",e),([t,n])=>l(Nl(n),([r,s])=>l(v(")",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[yj(t),n]),zm=e=>l(l(l(kc(e),([t,n])=>l(v("|",n),([r,s])=>l(zm(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l(l(kc(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[]))),([t,n])=>[wj(t),n]),kc=e=>l(l(AC(e),([t,n])=>l(Nl(n),([r,s])=>[[t,r],s])),([t,n])=>[vj(t),n]),Nl=e=>l(l(zm(e),([t,n])=>[t,n],()=>l(kc(e),([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),NC=e=>l(l(v("^",e),([t,n])=>l(Nl(n),([r,s])=>l(v("$",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[Sj(t),n]),Km=(e,t=[])=>l(l(v(",",e),([n,r])=>l(ye(r),([s,i])=>[[n,s],i])),([n,r])=>Km(r,[...t,n]),()=>[t,e]),OC=e=>l(l(l(ye(e),([t,n])=>l(Km(n),([r,s])=>l(l(v(",",s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[jj(t),n]),Gm=e=>l(l(l(v("extends",e),([t,n])=>l(OC(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Ij(t),n]),RC=e=>l(l(v("interface",e),([t,n])=>l(rt(n),([r,s])=>l(Tl(s),([i,o])=>l(Gm(o),([d,f])=>l(Al(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[Cj(t),n]),MC=e=>l(l(v("interface",e),([t,n])=>l(rt(n),([r,s])=>l(Gm(s),([i,o])=>l(Al(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[Ej(t),n]),$C=e=>l(l(v("type",e),([t,n])=>l(rt(n),([r,s])=>l(Tl(s),([i,o])=>l(v("=",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[Tj(t),n]),FC=e=>l(l(v("type",e),([t,n])=>l(rt(n),([r,s])=>l(v("=",s),([i,o])=>l(ye(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[Aj(t),n]),LC=e=>l(l(l(v("export",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Pj(),n]),Vm=e=>l(l(l(v(";",e),([t,n])=>l(v(`
|
|
267
267
|
`,n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l(l(v(`
|
|
268
|
-
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]),Zm=(e,t=[])=>l(l(Ym(e),([n,r])=>l(Ml(r),([s,i])=>[[n,s],i])),([n,r])=>Zm(r,[...t,n]),()=>[t,e]),zC=e=>l(l(l(Ml(e),([t,n])=>l(Zm(n),([r,s])=>l(l(Ym(s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Lj(t),n]),Ml=e=>l(l(qC(e),([t,n])=>l(l(_C(n),([r,s])=>[r,s],()=>l(UC(n),([r,s])=>[r,s],()=>l(BC(n),([r,s])=>[r,s],()=>l(HC(n),([r,s])=>[r,s],()=>[])))),([r,s])=>l(vm(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[Dj(t),n]),KC=e=>l(l(Ml(e),([t,n])=>l(zC(n),([r,s])=>[[t,r],s])),([t,n])=>[_j(t),n]),GC=e=>l(l(KC(e),([t,n])=>[t,n],()=>l(ZI(e),([t,n])=>[t,n],()=>l(ye(e),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]);function VC(e){const t=Tm(`\`${e}\``);return g(t.length,2)?t[0]:Ft()}function WC(e){return e.join("|")}function JC(e){return e.slice(1,e.length-1)}function QC(e,t,n){return Tr(t,`${n}${e}`)}function YC(e,t){return Tr(e,`${t}${Vv}`)}function ZC(e,t){return Tr(e,`${t}${Af}`)}function XC(e,t){return Tr(e,`${t}${Rf}`)}function e2(e,t){return Di(Je([De("false"),De("true")]),e,t)}function t2(e,t){return Tr(e,`${t}${Mf}`)}function n2(e,t,n){return Tr(t,`${n}${JC(e)}`)}function r2(e,t,n){const r=$l(e,{});return Di(r,t,n)}function s2(e,t,n){const r=Er(e);return Di(r,t,n)}function Xm(e,t,n,r=[]){return Te(e,(s,i)=>Xm(i,t,n,[...r,Di(s,[],"")]),()=>Tr(t,`${n}(${WC(r)})`))}function Di(e,t,n){return vn(e)?s2(e.enum,t,n):qn(e)?ZC(t,n):Qe(e)?QC(e.const,t,n):is(e)?YC(t,n):Cr(e)?e2(t,n):un(e)?XC(t,n):Fn(e)?t2(t,n):Wt(e)?n2(e.pattern,t,n):c2(e)?r2(e.parameters[0],t,n):fe(e)?Xm(e.anyOf,t,n):av}function Tr(e,t){return Te(e,(n,r)=>Di(n,r,t),()=>t)}function i2(e){return`^${Tr(e,"")}$`}function o2(e){const t=i2(e);return _f(t)}function $l(e,t){return Xe(e)?ke(o2(e),{},t):eh(e,t)}function a2(e,t,n,r){const s=Xn(e,t,n);return $l(s,r)}function eh(e,t={}){return Ne("TemplateLiteral",[e],t)}function c2(e){return on(e)&&E(e,"action")&&g(e.action,"TemplateLiteral")}function th(e){return $l(e,{})}function l2(e){const t=VC(e);return th(t)}function d2(e,t={}){const n=pe(e)?l2(e):th(e);return ke(n,{},t)}function Wt(e){return Ce(e,"TemplateLiteral")}function nh(e){return we({"~kind":"ExtendsUnion"},{inferred:e})}function Fl(e){return re(e)&&E(e,"~kind")&&E(e,"inferred")&&g(e["~kind"],"ExtendsUnion")&&re(e.inferred)}function ee(e){return we({"~kind":"ExtendsTrue"},{inferred:e})}function Ll(e){return re(e)&&E(e,"~kind")&&E(e,"inferred")&&g(e["~kind"],"ExtendsTrue")&&re(e.inferred)}function je(){return we({"~kind":"ExtendsFalse"},{})}function wc(e){return re(e)&&E(e,"~kind")&&g(e["~kind"],"ExtendsFalse")}function Yt(e){return Fl(e)||Ll(e)}function It(e,t,n){return Yt(e)?t(e.inferred):n()}const u2=Object.freeze(Object.defineProperty({__proto__:null,ExtendsFalse:je,ExtendsTrue:ee,ExtendsUnion:nh,IsExtendsFalse:wc,IsExtendsTrue:Ll,IsExtendsTrueLike:Yt,IsExtendsUnion:Fl,Match:It},Symbol.toStringTag,{value:"Module"}));function p2(e,t,n,r){return It(Ze(e,n,r),s=>ee(kt(kt(e,s),{[t]:n})),()=>je())}function f2(e,t){return ee(e)}function m2(e,t,n,r,s){return It(Ze(e,t,n),i=>It(Ze(i,t,r),o=>ee(o),()=>je()),()=>It(Ze(e,t,s),i=>ee(i),()=>je()))}function h2(e,t,n){const r=Er(n);return Ze(e,t,r)}function rh(e,t,n){return Te(n,(r,s)=>It(Ze(e,t,r),i=>rh(i,t,s),()=>je()),()=>ee(e))}function g2(e,t,n){const r=or(n);return Ze(e,t,r)}function sh(e,t,n){return Te(n,(r,s)=>It(Ze(e,t,r),i=>ee(i),()=>sh(e,t,s)),()=>je())}function jt(e,t,n){return $n(n)?f2(e):wn(n)?m2(e,t,n.if,n.then,n.else):vn(n)?h2(e,t,n.enum):cn(n)?p2(e,n.name,t,n.extends):Be(n)?rh(e,t,n.allOf):Wt(n)?g2(e,t,n.pattern):fe(n)?sh(e,t,n.anyOf):An(n)?ee(e):je()}function b2(e,t,n){return cn(n)?jt(e,t,n):$n(n)||An(n)?ee(e):nh(e)}function k2(e,t){const n=Uo(e),r=Uo(t);return n&&r||!n&&r?!0:!(n&&!r)}function x2(e,t,n,r){return gt(r)?k2(t,r)?Ze(e,n,r.items):je():jt(e,t,r)}function y2(e,t,n){return is(n)?ee(e):jt(e,t,n)}function w2(e,t,n){return Cr(n)?ee(e):jt(e,t,n)}function v2(e,t,n,r,s){const i=cn(r)?t:r,o=cn(r)?r:t,d=an(t),f=an(r);return!d&&f?je():It(Ze(e,i,o),u=>Dl(u,n,s),()=>je())}function S2(e,t,n,r){return Te(r,(s,i)=>v2(e,t,n,s,i),()=>an(t)?ee(e):je())}function j2(e,t,n){return Te(t,(r,s)=>S2(e,r,s,n),()=>ee(e))}function Dl(e,t,n){return j2(e,t,n)}function ih(e,t,n){return os(n)?ee(e):Ze(e,t,n)}function I2(e,t,n,r){return $n(r)||An(r)?ee(e):xn(r)?It(Dl(e,t,r.parameters),s=>ih(s,n,r.instanceType),()=>je()):je()}function C2(e,t,n,r,s){return It(Ze(e,t,s),()=>Ze(e,n,s),()=>Ze(e,r,s))}function E2(e,t,n){const r=Er(t);return Ze(e,r,n)}function T2(e,t,n,r){return $n(r)||An(r)?ee(e):yn(r)?It(Dl(e,t,r.parameters),s=>ih(s,n,r.returnType),()=>je()):je()}function A2(e,t,n){return qn(n)||un(n)?ee(e):jt(e,t,n)}function P2(e,t,n){const r=pn(t);return Ze(e,r,n)}function ga(e,t,n){return t===n?ee(e):je()}function N2(e,t,n){return Qe(n)?ga(e,t,n.const):is(n)?ee(e):jt(e,De(t),n)}function O2(e,t,n){return Qe(n)?ga(e,t,n.const):Cr(n)?ee(e):jt(e,De(t),n)}function R2(e,t,n){return Qe(n)?ga(e,t,n.const):un(n)?ee(e):jt(e,De(t),n)}function M2(e,t,n){return Qe(n)?ga(e,t,n.const):Fn(n)?ee(e):jt(e,De(t),n)}function $2(e,t,n){return st(t.const)?N2(e,t.const,n):xt(t.const)?O2(e,t.const,n):Ie(t.const)?R2(e,t.const,n):pe(t.const)?M2(e,t.const,n):Ft()}function F2(e,t,n){return cn(n)?jt(e,t,n):ee(e)}function L2(e,t,n){return Oi(n)?ee(e):jt(e,t,n)}function D2(e,t,n){return un(n)?ee(e):jt(e,t,n)}function _2(e,t,n){return an(t)?an(n)?ee(e):je():ee(e)}function U2(e,t,n){return cn(n)&&Fs(n.extends)?je():It(Ze(e,t,n),r=>_2(r,t,n),()=>je())}function B2(e,t){return e.reduce((n,r)=>r in t&&Yt(t[r])?{...n,...t[r].inferred}:Ft(),{})}function H2(e,t,n){const r={};for(const o of U(n))r[o]=o in t?U2({},t[o],n[o]):an(n[o])?cn(n[o])?ee(kt(e,{[n[o].name]:n[o].extends})):ee(e):je();const s=il(r).every(o=>Yt(o)),i=s?B2(U(r),r):{};return s?ee(i):je()}function q2(e,t,n){const r=H2(e,t,n);return Yt(r)?ee(kt(e,r.inferred)):je()}function z2(e,t,n){return q2(e,t,n)}function K2(e,t){return U(t).reduce((n,r)=>({...n,[r]:E(e,r)?fe(n[r])?Je([...n[r].anyOf,t[r]]):Je([e[r],t[r]]):t[r]}),e)}function oh(e,t,n,r){return Te(t,(s,i)=>It(Ze({},e[s],n),o=>oh(e,i,n,K2(r,o)),()=>je()),()=>ee(r))}function G2(e,t,n,r){const s=U(t);return oh(t,s,r,e)}function V2(e,t,n){return Ot(n)?G2(e,t,jn(n),Vt(n)):Ue(n)?z2(e,t,n.properties):jt(e,Me(t),n)}function W2(e,t){return g(U(t).length,0)?ee(e):je()}function J2(e,t,n,r,s){return Ze(e,n,s)}function Q2(e,t,n,r){return Ot(r)?J2(e,bc(t),n,bc(jn(r)),Vt(r)):Ue(r)?W2(e,r.properties):$n(r)||An(r)?ee(e):je()}function Y2(e,t,n){return Fn(n)?ee(e):jt(e,t,n)}function Z2(e,t,n){return Ri(n)?ee(e):jt(e,t,n)}function X2(e,t,n){const r=or(t);return Ze(e,r,n)}function vc(e,t){return we({"~kind":"Inferrable"},{name:e,type:t},{})}function _l(e){return re(e)&&E(e,"~kind")&&E(e,"name")&&E(e,"type")&&g(e["~kind"],"Inferrable")&&pe(e.name)&&re(e.type)}function ah(e){return fa(e)?cn(e.items)?gt(e.items.extends)?vc(e.items.name,e.items.extends.items):An(e.items.extends)?vc(e.items.name,e.items.extends):void 0:Ft():void 0}function ch(e){return cn(e)?vc(e.name,e.extends):void 0}function Ul(e,t,n=[]){return Te(e,(r,s)=>It(Ze({},r,t),()=>Ul(s,t,[...n,r]),()=>{}),()=>n)}function eE(e,t,n,r){const s=Ul(n,r);return q(s)?ee(kt(e,{[t]:Sn(s)})):je()}function lh(e,t,n,r){const s=Ul(n,r);return q(s)?ee(kt(e,{[t]:Je(s)})):je()}function tE(e){return[...e].reverse()}function Sc(e,t){return t?tE(e):e}function nE(e){const t=e.length>0?e[0]:void 0,n=on(t)?ah(t):void 0;return on(n)}function rE(e,t,n,r,s,i){return It(Ze(e,n,s),o=>dh(o,t,r,i),()=>je())}function sE(e,t,n,r,s){const i=ah(r);return _l(i)?eE(e,i.name,Sc(n,t),i.type):Te(n,(o,d)=>rE(e,t,o,d,r,s),()=>je())}function iE(e,t,n,r){return Te(r,(s,i)=>sE(e,t,n,s,i),()=>g(n.length,0)?ee(e):je())}function dh(e,t,n,r){return iE(e,t,n,r)}function oE(e,t,n){const r=qi(e,_t([],[]),n),s=nE(r);return dh(e,s,Sc(t,s),Sc(r,s))}function uh(e,t,n){const r=ch(n);return _l(r)?lh(e,r.name,t,r.type):Te(t,(s,i)=>It(Ze(e,s,n),o=>uh(o,i,n),()=>je()),()=>ee(e))}function aE(e,t,n){const r=qi(e,_t([],[]),t);return at(n)?oE(e,r,n.items):gt(n)?uh(e,r,n.items):jt(e,Sn(r),n)}function cE(e,t,n){return os(n)||_s(n)?ee(e):jt(e,t,n)}function ph(e,t,n){return Te(n,(r,s)=>It(Ze(e,t,r),i=>ee(i),()=>ph(e,t,s)),()=>je())}function jc(e,t,n){return Te(t,(r,s)=>It(ph(e,r,n),i=>jc(i,s,n),()=>je()),()=>ee(e))}function lE(e,t,n){const r=ch(n);return _l(r)?lh(e,r.name,t,r.type):fe(n)?jc(e,t,n.anyOf):jc(e,t,[n])}function dE(e,t,n){return cn(n)?jt(e,t,n):$n(n)||An(n)?ee(e):je()}function uE(e,t,n){return os(n)?ee(e):jt(e,t,n)}function Ze(e,t,n){return $n(t)?b2(e,t,n):gt(t)?x2(e,t,t.items,n):is(t)?y2(e,t,n):Cr(t)?w2(e,t,n):xn(t)?I2(e,t.parameters,t.instanceType,n):wn(t)?C2(e,t.if,t.then,t.else,n):vn(t)?E2(e,t.enum,n):yn(t)?T2(e,t.parameters,t.returnType,n):qn(t)?A2(e,t,n):Be(t)?P2(e,t.allOf,n):Qe(t)?$2(e,t,n):Fs(t)?F2(e,t,n):Oi(t)?L2(e,t,n):un(t)?D2(e,t,n):Ue(t)?V2(e,t.properties,n):Ot(t)?Q2(e,jn(t),Vt(t),n):Fn(t)?Y2(e,t,n):Ri(t)?Z2(e,t,n):Wt(t)?X2(e,t.pattern,n):at(t)?aE(e,t.items,n):_s(t)?cE(e,t,n):fe(t)?lE(e,t.anyOf,n):An(t)?dE(e,t,n):os(t)?uE(e,t,n):je()}function pE(e,t){return pn([...e,Me(t)])}function fh(e,t,n){return Xe(e)?ke(pE(e,t),{},n):Bl(e,t,n)}function fE(e,t,n,r,s){const i=Xn(e,t,n),o=td(e,t,r);return fh(i,o,s)}function Bl(e,t,n={}){return Ne("Interface",[e,t],n)}function Hl(e){return on(e)&&E(e,"action")&&g(e.action,"Interface")}function mE(e,t,n={}){return fh(e,t,n)}function hE(e,t,n){return e.includes(n)?!0:xi([...e,n],t,t[n])}function $u(e,t,n){const r=kf(n);return Ur(e,t,r)}function Ur(e,t,n){return Te(n,(r,s)=>xi(e,t,r)?!0:Ur(e,t,s),()=>!1)}function xi(e,t,n){return vt(n)?hE(e,t,n.$ref):gt(n)?xi(e,t,n.items):xn(n)?Ur(e,t,[...n.parameters,n.instanceType]):yn(n)?Ur(e,t,[...n.parameters,n.returnType]):Hl(n)?$u(e,t,n.parameters[1]):Be(n)?Ur(e,t,n.allOf):Ue(n)?$u(e,t,n.properties):fe(n)?Ur(e,t,n.anyOf):at(n)?Ur(e,t,n.items):Ot(n)?xi(e,t,Vt(n)):!1}function gE(e,t,n){return xi(e,t,n)}function bE(e,t){return t.reduce((n,r)=>gE([r],e,e[r])?[...n,r]:n,[])}function kE(e){const t=bf(e);return bE(e,t)}function xE(e,t,n){return n.includes(t)?n:t in e?yi(e,e[t],[...n,t]):Ft()}function Fu(e,t,n){const r=kf(t);return Is(e,r,n)}function Is(e,t,n){return t.reduce((r,s)=>yi(e,s,r),n)}function yi(e,t,n){return vt(t)?xE(e,t.$ref,n):gt(t)?yi(e,t.items,n):xn(t)?Is(e,[...t.parameters,t.instanceType],n):yn(t)?Is(e,[...t.parameters,t.returnType],n):Hl(t)?Fu(e,t.parameters[1],n):Be(t)?Is(e,t.allOf,n):Ue(t)?Fu(e,t.properties,n):fe(t)?Is(e,t.anyOf,n):at(t)?Is(e,t.items,n):Ot(t)?yi(e,Vt(t),n):n}function yE(e,t,n){return yi(e,n,[t])}function wE(e){return ml()}function vE(e){return U(e).reduce((t,n)=>({...t,[n]:Hr(e[n])}),{})}function ii(e){return e.reduce((t,n)=>[...t,Hr(n)],[])}function Hr(e){return vt(e)?wE(e.$ref):gt(e)?Ir(Hr(e.items),pl(e)):xn(e)?Ti(ii(e.parameters),Hr(e.instanceType)):yn(e)?Ai(ii(e.parameters),Hr(e.returnType)):Be(e)?Bn(ii(e.allOf)):Ue(e)?Me(vE(e.properties)):Ot(e)?wl(ua(e),Hr(Vt(e))):fe(e)?Je(ii(e.anyOf)):at(e)?Sn(ii(e.items)):e}function SE(e,t){return t in e?Hr(e[t]):Kt()}function jE(e){return SE(e.$defs,e.$ref)}function IE(e,t,n){const r=Xn(e,_t([],[]),t),s=td({},_t([],[]),n);return pn([...r,Me(s)])}function CE(e,t){return U(e).filter(r=>t.includes(r)).reduce((r,s)=>{const i=e[s],o=Hl(i)?IE(e,i.parameters[0],i.parameters[1]):i;return{...r,[s]:o}},{})}function EE(e,t,n){const r=yE(e,t,n),s=CE(e,r);return Ni(s,t)}function mh(e,t){return t in e?vt(e[t])?mh(e,e[t].$ref):e[t]:Nt()}function _i(e,t){return mh(e,t)}function Lu(e){return Gt(e)?jE(e):xf(e)?Kt():e}function sr(e,t,n){const r=Lu(t),s=Lu(n);return Ze(e,r,s)}const ql="equal",TE="disjoint",zl="left-inside",Kl="right-inside";function ba(e,t){const n=[An(e)?je():sr({},e,t),An(e)?ee({}):sr({},t,e)];return Yt(n[0])&&Yt(n[1])?ql:Yt(n[0])&&wc(n[1])?zl:wc(n[0])&&Yt(n[1])?Kl:TE}function AE(e,t){return t.filter(n=>ba(e,n)!==Kl)}function PE(e,t){const n=t.some(r=>{const s=ba(e,r);return g(s,zl)||g(s,ql)});return g(n,!1)}function NE(e,t){const n=Jr(e);return $n(n)?[n]:PE(n,t)?[...AE(n,t),n]:t}function OE(e){return e.reduce((t,n)=>Ue(n)?[...t,n]:Fs(n)?t:NE(n,t),[])}function hh(e){const t=OE(e);return ca(t)}function gh(e,t){return ke(Jr(e),{},t)}function RE(e,t,n,r){const s=V(e,t,n);return gh(s,r)}function ci(e,t=[]){return Ps(e)&&g(e.action,"Conditional")?vt(e.parameters[0])?ci(e.parameters[2],ci(e.parameters[3],[...t,e.parameters[0].$ref])):ci(e.parameters[2],ci(e.parameters[3],t)):Ps(e)&&g(e.action,"Mapped")&&Ps(e.parameters[1])&&g(e.parameters[1].action,"KeyOf")&&vt(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function ME(e,t){return e.reduce((n,r)=>[...n,t.includes(r.name)],[])}function bh(e,t,n=[]){return Te(e,(r,s)=>Te(t,(i,o)=>bh(s,o,[...n,[i,r]]),()=>n),()=>n)}function $E(e){return Wt(e)?or(e.pattern):vn(e)?Er(e.enum):e}function FE(e){const t=$E(e);return fe(t)?[...t.anyOf]:[t]}function LE(e,t){return e.reduce((n,r)=>[...n,[...r,t]],[])}function Du(e,t){return t.reduce((n,r)=>[...n,...LE(e,r)],[])}function _u(e){return e.reduce((t,n)=>g(n[0],!0)?Du(t,FE(n[1])):Du(t,[n[1]]),[[]])}function DE(e,t,n){const r=ci(n),s=ME(e,r),i=bh(t,s);return Ps(n)&&g(n.action,"Conditional")||Ps(n)&&g(n.action,"Mapped")?_u(i):[t]}function _E(){return["(not-resolvable)",Nt()]}function UE(){return["(not-generic)",Nt()]}function BE(e,t,n){return[e,Pi(t,n)]}function HE(e,t,n){return t in e?kh(e,t,e[t]):_E()}function kh(e,t,n,r){return fl(n)?BE(t,n.parameters,n.expression):vt(n)?HE(e,n.$ref):UE()}function qE(e,t,n){return kh(e,"(anonymous)",t)}function zE(e,t,n){if(cn(t)||Vl(t)||Yt(sr({},t,n)))return;const r={parameter:e,expect:n,actual:t};throw new Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Uu(e,t,n,r,s){const i=V(e,t,s);return zE(n,i,r),kt(e,{[n]:i})}function KE(e,t,n,r,s){const i=V(e,t,n.extends),o=V(e,t,n.equals);return Te(s,(d,f)=>Ic(Uu(e,t,n.name,i,d),t,r,f),()=>Ic(Uu(e,t,n.name,i,o),t,r,[]))}function Ic(e,t,n,r){return Te(n,(s,i)=>KE(e,t,s,i,r),()=>e)}function GE(e,t,n,r){return Ic(e,t,n,r)}let Cc=0,Gl=0;function VE(){if(!ji(Gl,Ei().maxInstantiationCount))throw Error("Type instantiation is excessively deep and possibly infinite")}function WE(){VE(),Gl++,Cc++}function JE(){Cc--,g(Cc,0)&&(Gl=0)}function QE(e){return ts(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function YE(e,t){return g(QE(e),t)}function ZE(e,t,n,r,s,i){WE();try{const o=GE(e,t,r,i),d=V(o,_t([...t.callstack,n.$ref],t.visited),s);return V(o,_t([],[]),d)}finally{JE()}}function XE(e,t,n,r,s,i){return i.reduce((o,d)=>{const f=ZE(e,t,n,r,s,d);return[...o,f]},[])}function eT(e,t,n,r,s,i){const o=DE(r,i,s),d=XE(e,t,n,r,s,o);return g(d.length,1)?d[0]:ar(d)}function xh(e,t,n,r){const s=Xn(e,t,r),i=qE(e,n),o=i[0],d=i[1];return fl(d)?YE(t,o)?Ec(gn(o),s):eT(e,t,gn(o),d.parameters,d.expression,s):Ec(n,s)}function Ec(e,t){return we({"~kind":"Call"},{type:"call",target:e,arguments:t},{})}function tT(e,t){return xh({},_t([],[]),e,t)}function Vl(e){return Ce(e,"Call")}function nT(e){return Mn(e,["~immutable"])}function rT(e,t){return ke(nT(e),{},t)}function sT(e,t,n,r){const s=V(e,t,n);return rT(s,r)}function iT(e,t){return e(t)}function oT(e,t){return pe(t)?De(iT(e,t)):De(t)}function aT(e,t){const n=or(t);return Us(e,n)}function cT(e,t){const n=t.map(r=>Us(e,r));return Je(n)}function Us(e,t){return Qe(t)?oT(e,t.const):Wt(t)?aT(e,t.pattern):fe(t)?cT(e,t.anyOf):t}function yh(e,t={}){return Ne("Capitalize",[e],t)}function lT(e,t={}){return jh(e,t)}function wh(e,t={}){return Ne("Lowercase",[e],t)}function dT(e,t={}){return Ih(e,t)}function vh(e,t={}){return Ne("Uncapitalize",[e],t)}function uT(e,t={}){return Ch(e,t)}function Sh(e,t={}){return Ne("Uppercase",[e],t)}function pT(e,t={}){return Eh(e,t)}const fT=e=>e[0].toUpperCase()+e.slice(1),mT=e=>e.toLowerCase(),hT=e=>e[0].toLowerCase()+e.slice(1),gT=e=>e.toUpperCase();function jh(e,t){return Xe([e])?ke(Us(fT,e),{},t):yh(e,t)}function Ih(e,t){return Xe([e])?ke(Us(mT,e),{},t):wh(e,t)}function Ch(e,t){return Xe([e])?ke(Us(hT,e),{},t):vh(e,t)}function Eh(e,t){return Xe([e])?ke(Us(gT,e),{},t):Sh(e,t)}function bT(e,t,n,r){const s=V(e,t,n);return jh(s,r)}function kT(e,t,n,r){const s=V(e,t,n);return Ih(s,r)}function xT(e,t,n,r){const s=V(e,t,n);return Ch(s,r)}function yT(e,t,n,r){const s=V(e,t,n);return Eh(s,r)}function Th(e,t,n,r,s={}){return Ne("Conditional",[e,t,n,r],s)}function wT(e,t,n,r,s={}){return Ah({},_t([],[]),e,t,n,r,s)}function vT(e,t,n,r,s,i){const o=sr(e,n,r);return Fl(o)?Je([V(o.inferred,t,s),V(e,t,i)]):Ll(o)?V(o.inferred,t,s):V(e,t,i)}function Ah(e,t,n,r,s,i,o){return Xe([n,r])?ke(vT(e,t,n,r,s,i),{},o):Th(n,r,s,i,o)}function ST(e,t,n,r,s,i,o){const d=V(e,t,n),f=V(e,t,r);return Ah(e,t,d,f,s,i,o)}function Ph(e,t={}){return Ne("ConstructorParameters",[e],t)}function jT(e,t={}){return Nh(e,t)}function IT(e){const t=xn(e)?e.parameters:[],n=qi({},_t([],[]),t);return Sn(n)}function Nh(e,t){return Xe([e])?ke(IT(e),{},t):Ph(e,t)}function CT(e,t,n,r){const s=V(e,t,n);return Nh(s,r)}function Oh(e,t,n={}){return Ne("Exclude",[e,t],n)}function ET(e,t,n={}){return Wl(e,t,n)}function Wl(e,t,n){return Xe([e,t])?ke(Yf(e,t),{},n):Oh(e,t,n)}function TT(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Wl(i,o,s)}function Rh(e,t,n={}){return Ne("Extract",[e,t],n)}function AT(e,t,n={}){return Mh(e,t,n)}function PT(e,t){const n=sr({},e,t);return Yt(n)?[e]:[]}function NT(e,t){return e.reduce((n,r)=>[...n,...PT(r,t)],[])}function OT(e,t){const n=Jr(e),r=fe(n)?n.anyOf:[n],s=NT(r,t);return ar(s)}function Mh(e,t,n){return Xe([e,t])?ke(OT(e,t),{},n):Rh(e,t,n)}function RT(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Mh(i,o,s)}function MT(e){return e.reduce((t,n)=>Pf(n)?[...t,De(n)]:t,[])}function Jl(e){const t=MT(e);return Je(t)}function Ql(e,t,n={}){return Ne("Index",[e,t],n)}function $T(e,t,n={}){const r=q(t)?Jl(t):t;return _h(e,r,n)}function FT(e,t){const n=_i(e,t);return cs(n)}function LT(e,t,n){const r=Ls(e,t,n);return cs(r)}function DT(e,t){const n=U(e).filter(m=>!E(t,m)),r=U(t).filter(m=>!E(e,m)),s=U(e).filter(m=>E(t,m)),i=n.reduce((m,p)=>({...m,[p]:e[p]}),{}),o=r.reduce((m,p)=>({...m,[p]:t[p]}),{}),d=s.reduce((m,p)=>({...m,[p]:pn([e[p],t[p]])}),{}),f=kt(i,o);return kt(f,d)}function _T(e){return e.reduce((t,n)=>DT(t,cs(n)),{})}function UT(e){const t=bS(Sn(e));return cs(t)}function BT(e,t){return U(e).filter(s=>s in t).reduce((s,i)=>({...s,[i]:ar([e[i],t[i]])}),{})}function $h(e,t){return Te(e,(n,r)=>$h(r,BT(t,cs(n))),()=>t)}function HT(e){return Te(e,(t,n)=>$h(n,cs(t)),()=>Ft())}function cs(e){return Gt(e)?FT(e.$defs,e.$ref):wn(e)?LT(e.if,e.then,e.else):Be(e)?_T(e.allOf):fe(e)?HT(e.anyOf):at(e)?UT(e.items):Ue(e)?e.properties:{}}function Yl(e){const t=cs(e);return Me(t)}const qT=new RegExp("^(?:0|[1-9][0-9]*)$");function Zl(e){const t=`${e}`;return qT.test(t)?parseInt(t):e}function zT(e){return De(Zl(e))}function Bu(e){return e.map(t=>Fh(t))}function Fh(e){return Be(e)?Bn(Bu(e.allOf)):fe(e)?Je(Bu(e.anyOf)):Qe(e)?zT(e.const):e}function KT(e,t){const n=Fh(t),r=sr({},n,wr());return Yt(r)?e:Qe(t)&&g(t.const,"length")?wr():Nt()}function GT(e,t){const n=_i(e,t);return ls(n)}function VT(e,t,n){const r=Ls(e,t,n);return ls(r)}function WT(e){const t=Er(e);return ls(t)}function JT(e){const t=pn(e);return ls(t)}function QT(e){return[`${e}`]}function YT(e){const t=or(e);return ls(t)}function ZT(e){return e.reduce((t,n)=>[...t,...ls(n)],[])}function ls(e){return Gt(e)?GT(e.$defs,e.$ref):wn(e)?VT(e.if,e.then,e.else):vn(e)?WT(e.enum):Be(e)?JT(e.allOf):Qe(e)?QT(e.const):Wt(e)?YT(e.pattern):fe(e)?ZT(e.anyOf):[]}function Xl(e){return ls(e)}function oi(e,t){return t.map(n=>fi(e,n))}function fi(e,t){return gt(t)?Ir(fi(e,t.items)):xn(t)?Ti(oi(e,t.parameters),fi(e,t.instanceType)):yn(t)?Ai(oi(e,t.parameters),fi(e,t.returnType)):at(t)?Sn(oi(e,t.items)):fe(t)?Je(oi(e,t.anyOf)):Be(t)?Bn(oi(e,t.allOf)):tm(t)?Me(e):t}function XT(e,t){return fi(e,t)}function eA(e,t){const n=t in e?e[t]:Nt();return XT(e,n)}function Lh(e,t){return t.reduce((n,r)=>[...n,eA(e,r)],[])}function tA(e,t){const n=Xl(t),r=Lh(e,n);return ar(r)}const nA=new RegExp($i);function rA(e){return e.filter(n=>nA.test(n))}function sA(e){const t=bf(e),n=rA(t),r=Lh(e,n);return ar(r)}function iA(e,t){return un(t)?sA(e):tA(e,t)}function oA(e){return De(Zl(e))}function Hu(e){return e.map(t=>Dh(t))}function Dh(e){return Be(e)?Bn(Hu(e.allOf)):fe(e)?Je(Hu(e.anyOf)):Qe(e)?oA(e.const):e}function aA(e,t){return e.reduceRight((n,r,s)=>{const i=sr({},De(s),t);return Yt(i)?[r,...n]:n},[])}function cA(e,t){const n=Dh(t),r=aA(e,n);return Ds(r)}function lA(e){return Ds(e)}function dA(e,t){return Qe(t)&&g(t.const,"length")?De(e.length):un(t)||qn(t)?lA(e):cA(e,t)}function uA(e,t){return gt(e)?KT(e.items,t):Ue(e)?iA(e.properties,t):at(e)?dA(e.items,t):Nt()}function pA(e){return Gt(e)||wn(e)||Be(e)||fe(e)?Yl(e):e}function _h(e,t,n){return Xe([e,t])?ke(uA(pA(e),t),{},n):Ql(e,t,n)}function fA(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return _h(i,o,s)}function Uh(e,t={}){return Ne("InstanceType",[e],t)}function mA(e,t={}){return Bh(e,t)}function hA(e){return xn(e)?e.instanceType:Nt()}function Bh(e,t){return Xe([e])?ke(hA(e),{},t):Uh(e,t)}function gA(e,t,n,r={}){const s=V(e,t,n);return Bh(s,r)}function ed(e,t={}){return Ne("KeyOf",[e],t)}function bA(e,t={}){return Hh(e,t)}function kA(){return Je([wr(),zn(),xl()])}function xA(e){return wr()}function yA(e){return e.reduce((n,r)=>Pf(r)?[...n,De(Zl(r))]:Ft(),[])}function wA(e){const t=U(e),n=yA(t);return Ds(n)}function vA(e){return ua(e)}function SA(e){const t=e.map((n,r)=>De(r));return Ds(t)}function jA(e){return $n(e)?kA():gt(e)?xA(e.items):Ue(e)?wA(e.properties):Ot(e)?vA(e):at(e)?SA(e.items):Nt()}function IA(e){return Gt(e)||wn(e)||Be(e)||fe(e)?Yl(e):e}function Hh(e,t){return Xe([e])?ke(jA(IA(e)),{},t):ed(e,t)}function CA(e,t,n,r){const s=V(e,t,n);return Hh(s,r)}function Tc(e,t,n,r,s={}){return Ne("Mapped",[e,t,n,r],s)}function EA(e,t,n,r,s={}){return qh({},_t([],[]),e,t,n,r,s)}function TA(e){const t=or(e);return ka(t)}function AA(e){return e.reduce((t,n)=>[...t,...ka(n)],[])}function PA(e){const t=Er(e);return ka(t)}function NA(e){return Ie(e)?[De(`${e}`)]:[De(e)]}function ka(e){return vn(e)?PA(e.enum):Qe(e)?NA(e.const):Wt(e)?TA(e.pattern):fe(e)?AA(e.anyOf):[e]}function OA(e){return ka(e)}function RA(e){return Wt(e)?or(e.pattern):e}function MA(e,t,n,r,s,i){const o=kt(e,{[n.name]:r}),d=V(o,t,s),f=RA(d),u=V(o,t,i);return Nf(f)||Of(f)?{[f.const]:u}:{}}function $A(e,t,n,r,s,i){return r.reduce((o,d)=>[...o,MA(e,t,n,d,s,i)],[])}function FA(e){return e.reduce((t,n)=>[...t,Me(n)],[])}function LA(e,t,n,r,s,i){const o=OA(r),d=$A(e,t,n,o,s,i),f=FA(d);return pn(f)}function qh(e,t,n,r,s,i,o){return Xe([r])?ke(LA(e,t,n,r,s,i),{},o):Tc(n,r,s,i,o)}function DA(e,t,n,r,s,i,o){const d=V(e,t,r);return qh(e,t,n,d,s,i,o)}function _A(e,t,n){const r=kt(e,t);return U(t).filter(i=>n.includes(i)).reduce((i,o)=>({...i,[o]:EE(r,o,t[o])}),{})}function UA(e,t,n){const r=kt(e,t);return U(t).filter(i=>!n.includes(i)).reduce((i,o)=>({...i,[o]:V(r,_t([],[]),t[o])}),{})}function BA(e,t,n){const r=kE(t),s=_A(e,t,r),i=UA(e,t,r),o={...s,...i};return ke(o,{},n)}function zh(e,t,n,r){return BA(e,n,r)}function Kh(e,t={}){return Ne("NonNullable",[e],t)}function HA(e,t={}){return Gh(e,t)}function qA(e){const t=Je([kl(),vl()]);return Wl(e,t,{})}function Gh(e,t){return Xe([e])?ke(qA(e),{},t):Kh(e,t)}function zA(e,t,n,r){const s=V(e,t,n);return Gh(s,r)}function Vh(e,t,n={}){return Ne("Omit",[e,t],n)}function KA(e,t,n={}){const r=q(t)?Jl(t):t;return Jh(e,r,n)}function Wh(e){const t=Yl(e);return Ue(t)?t.properties:Ft()}function GA(e,t){return U(e).reduce((r,s)=>t.includes(s)?r:{...r,[s]:e[s]},{})}function VA(e,t){const n=Wh(e),r=Xl(t),s=GA(n,r);return Me(s)}function Jh(e,t,n){return Xe([e,t])?ke(VA(e,t),{},n):Vh(e,t,n)}function WA(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Jh(i,o,s)}function Qh(e,t={}){return Ne("Parameters",[e],t)}function JA(e,t={}){return Yh(e,t)}function QA(e){const t=yn(e)?e.parameters:[],n=qi({},_t([],[]),t);return Sn(n)}function Yh(e,t){return Xe([e])?ke(QA(e),{},t):Qh(e,t)}function YA(e,t,n,r){const s=V(e,t,n);return Yh(s,r)}function Zh(e,t={}){return Ne("Partial",[e],t)}function ZA(e,t={}){return Xh(e,t)}function XA(e,t){const n=_i(e,t),r=Ui(n);return Ni(kt(e,{[t]:r}),t)}function eP(e,t,n){const r=Ls(e,t,n);return Ui(r)}function tP(e){const t=pn(e);return Ui(t)}function nP(e){const t=e.map(n=>Ui(n));return Je(t)}function rP(e){const t=U(e).reduce((r,s)=>({...r,[s]:Do(e[s])}),{});return Me(t)}function Ui(e){return Gt(e)?XA(e.$defs,e.$ref):wn(e)?eP(e.if,e.then,e.else):Be(e)?tP(e.allOf):fe(e)?nP(e.anyOf):Ue(e)?rP(e.properties):Me({})}function Xh(e,t){return Xe([e])?ke(Ui(e),{},t):Zh(e,t)}function sP(e,t,n,r){const s=V(e,t,n);return Xh(s,r)}function eg(e,t,n={}){return Ne("Pick",[e,t],n)}function iP(e,t,n={}){const r=q(t)?Jl(t):t;return tg(e,r,n)}function oP(e,t){return U(e).reduce((r,s)=>t.includes(s)?kt(r,{[s]:e[s]}):r,{})}function aP(e,t){const n=Wh(e),r=Xl(t),s=oP(n,r);return Me(s)}function tg(e,t,n){return Xe([e,t])?ke(aP(e,t),{},n):eg(e,t,n)}function cP(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return tg(i,o,s)}function ng(e,t={}){return Ne("ReadonlyObject",[e],t)}function rg(e,t={}){return sg(e,t)}const lP=rg;function dP(e){return rd(Ir(e))}function uP(e,t){const n=_i(e,t),r=Bi(n);return Ni(kt(e,{[t]:r}),t)}function pP(e,t,n){const r=Ls(e,t,n);return Bi(r)}function fP(e){const t=pn(e);return Bi(t)}function mP(e){const t=U(e).reduce((r,s)=>({...r,[s]:Bo(e[s])}),{});return Me(t)}function hP(e){return rd(Sn(e))}function gP(e){const t=e.map(n=>Bi(n));return Je(t)}function Bi(e){return gt(e)?dP(e.items):Gt(e)?uP(e.$defs,e.$ref):wn(e)?pP(e.if,e.then,e.else):Be(e)?fP(e.allOf):Ue(e)?mP(e.properties):at(e)?hP(e.items):fe(e)?gP(e.anyOf):e}function sg(e,t){return Xe([e])?ke(Bi(e),{},t):ng(e)}function bP(e,t,n,r){const s=V(e,t,n);return sg(s,r)}function kP(e,t,n,r){return t.visited.includes(r)?n:r in e?V(e,_t(t.callstack,[...t.visited,r]),e[r]):n}function xP(e,t){const n=_i(e,t),r=Hi(n);return Ni(kt(e,{[t]:r}),t)}function yP(e,t,n){const r=Ls(e,t,n);return Hi(r)}function wP(e){const t=pn(e);return Hi(t)}function vP(e){const t=e.map(n=>Hi(n));return Je(t)}function SP(e){const t=U(e).reduce((r,s)=>({...r,[s]:Vf(e[s])}),{});return Me(t)}function Hi(e){return Gt(e)?xP(e.$defs,e.$ref):wn(e)?yP(e.if,e.then,e.else):Be(e)?wP(e.allOf):fe(e)?vP(e.anyOf):Ue(e)?SP(e.properties):Me({})}function ig(e,t={}){return Ne("Required",[e],t)}function jP(e,t={}){return og(e,t)}function og(e,t){return Xe([e])?ke(Hi(e),{},t):ig(e,t)}function IP(e,t,n,r){const s=V(e,t,n);return og(s,r)}function ag(e,t={}){return Ne("ReturnType",[e],t)}function CP(e,t={}){return cg(e,t)}function EP(e){return yn(e)?e.returnType:Nt()}function cg(e,t){return Xe([e])?ke(EP(e),{},t):ag(e,t)}function TP(e,t,n,r={}){const s=V(e,t,n);return cg(s,r)}function lg(e,t){return Ne("With",[e,t],{})}function dg(e,t){return ug(e,t)}function ug(e,t){return Xe([e])?ke(e,{},t):lg(e,t)}function AP(e,t,n,r){const s=V(e,t,n);return ug(s,r)}function PP(e){return fa(e)?at(e.items)?pg(e.items.items):cn(e.items)?[e]:vt(e.items)?[e]:[Nt()]:[e]}function pg(e){return e.reduce((n,r)=>[...n,...PP(r)],[])}function _t(e,t){return{callstack:e,visited:t}}function Xe(e){return Te(e,(t,n)=>vt(t)?!1:Xe(n),()=>!0)}function td(e,t,n){return U(n).reduce((r,s)=>({...r,[s]:V(e,t,n[s])}),{})}function qi(e,t,n){const r=Xn(e,t,n);return pg(r)}function Xn(e,t,n){return n.map(r=>V(e,t,r))}function NP(e,t){const n=an(e)?ul(t,{}):t,r=Ho(e)?dl(n,{}):n;return Uo(e)?nd(r,{}):r}function OP(e,t,n,r,s){return g(n,"AddImmutable")?$P(e,t,r[0],s):g(n,"RemoveImmutable")?sT(e,t,r[0],s):g(n,"AddReadonly")?nv(e,t,r[0],s):g(n,"RemoveReadonly")?uS(e,t,r[0],s):g(n,"AddOptional")?sv(e,t,r[0],s):g(n,"RemoveOptional")?hS(e,t,r[0],s):g(n,"Capitalize")?bT(e,t,r[0],s):g(n,"Conditional")?ST(e,t,r[0],r[1],r[2],r[3],s):g(n,"ConstructorParameters")?CT(e,t,r[0],s):g(n,"Evaluate")?RE(e,t,r[0],s):g(n,"Exclude")?TT(e,t,r[0],r[1],s):g(n,"Extract")?RT(e,t,r[0],r[1],s):g(n,"Index")?fA(e,t,r[0],r[1],s):g(n,"InstanceType")?gA(e,t,r[0],s):g(n,"Interface")?fE(e,t,r[0],r[1],s):g(n,"KeyOf")?CA(e,t,r[0],s):g(n,"Lowercase")?kT(e,t,r[0],s):g(n,"Mapped")?DA(e,t,r[0],r[1],r[2],r[3],s):g(n,"Module")?zh(e,t,r[0],s):g(n,"NonNullable")?zA(e,t,r[0],s):g(n,"Pick")?cP(e,t,r[0],r[1],s):g(n,"Parameters")?YA(e,t,r[0],s):g(n,"Partial")?sP(e,t,r[0],s):g(n,"Omit")?WA(e,t,r[0],r[1],s):g(n,"ReadonlyObject")?bP(e,t,r[0],s):g(n,"Record")?HS(e,t,r[0],r[1],s):g(n,"Required")?IP(e,t,r[0],s):g(n,"ReturnType")?TP(e,t,r[0],s):g(n,"TemplateLiteral")?a2(e,t,r[0],s):g(n,"Uncapitalize")?xT(e,t,r[0],s):g(n,"Uppercase")?yT(e,t,r[0],s):g(n,"With")?AP(e,t,r[0],r[1]):Ne(n,r,s)}function RP(e,t,n){const r=vt(n)?kP(e,t,n,n.$ref):gt(n)?Ir(V(e,t,n.items),pl(n)):Vl(n)?xh(e,t,n.target,n.arguments):xn(n)?Ti(Xn(e,t,n.parameters),V(e,t,n.instanceType),iv(n)):yn(n)?Ai(Xn(e,t,n.parameters),V(e,t,n.returnType),ov(n)):wn(n)?_o(V(e,t,n.if),V(e,t,n.then),V(e,t,n.else),pv(n)):Be(n)?Bn(Xn(e,t,n.allOf),bv(n)):Ue(n)?Me(td(e,t,n.properties),dv(n)):Ot(n)?qS(jn(n),V(e,t,Vt(n))):fa(n)?pa(V(e,t,n.items)):at(n)?Sn(qi(e,t,n.items),lS(n)):fe(n)?Je(Xn(e,t,n.anyOf),eS(n)):n;return NP(n,r)}function V(e,t,n){return Ps(n)?OP(e,t,n.action,n.parameters,n.options):RP(e,t,n)}function Bs(e,t){return V(e,_t([],[]),t)}function MP(e){return ke(e,{"~immutable":!0},{})}function nd(e,t){return ke(MP(e),{},t)}function $P(e,t,n,r){const s=V(e,t,n);return nd(s,r)}function FP(e,t={}){return Ne("AddImmutable",[e],t)}function rd(e,t={}){return nd(e,t)}function LP(e,t={}){return Ne("Evaluate",[e],t)}function Kn(e,t={}){return gh(e,t)}function DP(e,t={}){return Ne("Module",[e],t)}function _P(e,t={}){return zh({},_t([],[]),e,t)}function UP(e,t){const n=ba(e,t);return g(n,"right-inside")||g(n,"disjoint")?1:0}function fg(e,t,n=[]){return Te(t,(r,s)=>g(UP(e,r),1)?fg(e,s,[...n,r]):[...n,e,...t],()=>[...n,e])}function mg(e,t=[]){return Te(e,(n,r)=>mg(r,fg(n,t)),()=>t)}function BP(e){return mg(e)}function HP(...e){const[t,n,r]=ut(e,{2:(o,d)=>pe(o)?[{},o,d]:[o,d,{}],3:(o,d,f)=>[o,d,f],1:o=>[{},o,{}]}),s=GC(n),i=q(s)&&g(s.length,2)?V(t,_t([],[]),s[0]):Nt();return ke(i,{},r)}const c=Object.freeze(Object.defineProperty({__proto__:null,Any:ml,Array:Ir,BigInt:bl,Boolean:Tf,Call:tT,Capitalize:lT,Codec:hl,Conditional:wT,Constructor:Ti,ConstructorParameters:jT,Cyclic:Ni,Decode:Uv,DecodeBuilder:Ef,Dependent:_o,Encode:Bv,EncodeBuilder:Cf,Enum:gv,Evaluate:Kn,Exclude:ET,Extends:sr,ExtendsResult:u2,Extract:AT,Function:Ai,Generic:Pi,Identifier:gc,Immutable:Hv,Index:$T,Infer:mc,InstanceType:mA,Instantiate:Bs,Integer:aa,Interface:mE,Intersect:Bn,IsAny:$n,IsArray:gt,IsBigInt:is,IsBoolean:Cr,IsCall:Vl,IsCodec:ln,IsConstructor:xn,IsCyclic:Gt,IsDependent:wn,IsEnum:vn,IsEnumValue:hv,IsFunction:yn,IsGeneric:fl,IsIdentifier:Wv,IsImmutable:Uo,IsInfer:cn,IsInteger:qn,IsIntersect:Be,IsKind:Ce,IsLiteral:Qe,IsNever:Fs,IsNull:Oi,IsNumber:un,IsObject:Ue,IsOptional:an,IsParameter:Xv,IsReadonly:Ho,IsRecord:Ot,IsRef:vt,IsRefine:gl,IsRest:fa,IsSchema:on,IsString:Fn,IsSymbol:Ri,IsTemplateLiteral:Wt,IsThis:tm,IsTuple:at,IsUndefined:_s,IsUnion:fe,IsUnknown:An,IsUnsafe:xf,IsVoid:os,KeyOf:bA,Literal:De,Lowercase:dT,Mapped:EA,Module:_P,Never:Nt,NonNullable:HA,Null:kl,Number:wr,Object:Me,Omit:KA,Optional:cv,Parameter:Mi,Parameters:JA,Partial:ZA,Pick:iP,Readonly:qv,ReadonlyObject:rg,ReadonlyType:lP,Record:wl,RecordKey:ua,RecordPattern:jn,RecordValue:Vt,Ref:gn,Refine:Kv,Required:jP,Rest:pa,ReturnType:CP,Script:HP,String:zn,Symbol:xl,TemplateLiteral:d2,This:em,Tuple:Sn,Uncapitalize:uT,Undefined:vl,Union:Je,Unknown:Kt,Unsafe:uv,Uppercase:pT,Void:nm,With:dg},Symbol.toStringTag,{value:"Module"}));function xa(e){return E(e,"~refine")&&q(e["~refine"])&&ht(e["~refine"],0,t=>re(t)&&E(t,"check")&&E(t,"error")&&Tn(t.check)&&Tn(t.error))}function dn(e){return re(e)&&!q(e)}function zi(e){return xt(e)}function _e(e){return dn(e)||zi(e)}function Ki(e){return E(e,"additionalItems")&&_e(e.additionalItems)}function lr(e){return E(e,"additionalProperties")&&_e(e.additionalProperties)}function ya(e){return E(e,"allOf")&&q(e.allOf)&&e.allOf.every(t=>_e(t))}function Ko(e){return E(e,"$anchor")&&pe(e.$anchor)}function wa(e){return E(e,"anyOf")&&q(e.anyOf)&&e.anyOf.every(t=>_e(t))}function va(e){return E(e,"const")}function ds(e){return E(e,"contains")&&_e(e.contains)}function qP(e){return E(e,"contentEncoding")&&pe(e.contentEncoding)}function zP(e){return E(e,"contentMediaType")&&pe(e.contentMediaType)}function Ar(e){return E(e,"default")}function KP(e){return E(e,"$defs")&&re(e.$defs)&&Object.values(e.$defs).every(t=>_e(t))}function Gi(e){return E(e,"dependencies")&&re(e.dependencies)&&Object.values(e.dependencies).every(t=>_e(t)||q(t)&&t.every(n=>pe(n)))}function Vi(e){return E(e,"dependentRequired")&&re(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>q(t)&&t.every(n=>pe(n)))}function Wi(e){return E(e,"dependentSchemas")&&re(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>_e(t))}function Yr(e){return E(e,"$dynamicAnchor")&&pe(e.$dynamicAnchor)}function Sa(e){return E(e,"$dynamicRef")&&pe(e.$dynamicRef)}function ja(e){return E(e,"else")&&_e(e.else)}function Ia(e){return E(e,"enum")&&q(e.enum)}function Ji(e){return E(e,"exclusiveMaximum")&&(Ie(e.exclusiveMaximum)||st(e.exclusiveMaximum))}function Pr(e){return E(e,"exclusiveMinimum")&&(Ie(e.exclusiveMinimum)||st(e.exclusiveMinimum))}function Hs(e){return E(e,"format")&&pe(e.format)}function Sr(e){return E(e,"$id")&&pe(e.$id)}function Ca(e){return E(e,"if")&&_e(e.if)}function Nr(e){return E(e,"items")&&(_e(e.items)||q(e.items)&&e.items.every(t=>_e(t)))}function Ea(e){return Nr(e)&&q(e.items)}function GP(e){return Nr(e)&&!q(e.items)}function Qi(e){return E(e,"maximum")&&(Ie(e.maximum)||st(e.maximum))}function Yi(e){return E(e,"maxContains")&&Ie(e.maxContains)}function qs(e){return E(e,"maxItems")&&Ie(e.maxItems)}function Zi(e){return E(e,"maxLength")&&Ie(e.maxLength)}function Xi(e){return E(e,"maxProperties")&&Ie(e.maxProperties)}function Or(e){return E(e,"minimum")&&(Ie(e.minimum)||st(e.minimum))}function us(e){return E(e,"minContains")&&Ie(e.minContains)}function ps(e){return E(e,"minItems")&&Ie(e.minItems)}function zs(e){return E(e,"minLength")&&Ie(e.minLength)}function Ks(e){return E(e,"minProperties")&&Ie(e.minProperties)}function eo(e){return E(e,"multipleOf")&&(Ie(e.multipleOf)||st(e.multipleOf))}function Ta(e){return E(e,"not")&&_e(e.not)}function Aa(e){return E(e,"oneOf")&&q(e.oneOf)&&e.oneOf.every(t=>_e(t))}function Gs(e){return E(e,"pattern")&&(pe(e.pattern)||e.pattern instanceof RegExp)}function fs(e){return E(e,"patternProperties")&&re(e.patternProperties)&&Object.values(e.patternProperties).every(t=>_e(t))}function dr(e){return E(e,"prefixItems")&&q(e.prefixItems)&&e.prefixItems.every(t=>_e(t))}function ms(e){return E(e,"properties")&&re(e.properties)&&Object.values(e.properties).every(t=>_e(t))}function to(e){return E(e,"propertyNames")&&(re(e.propertyNames)||_e(e.propertyNames))}function hg(e){return E(e,"$recursiveAnchor")&&xt(e.$recursiveAnchor)}function Ao(e){return hg(e)&&g(e.$recursiveAnchor,!0)}function Pa(e){return E(e,"$recursiveRef")&&pe(e.$recursiveRef)}function Na(e){return E(e,"$ref")&&pe(e.$ref)}function ur(e){return E(e,"required")&&q(e.required)&&e.required.every(t=>pe(t))}function Oa(e){return E(e,"then")&&_e(e.then)}function no(e){return E(e,"type")&&(pe(e.type)||q(e.type)&&e.type.every(t=>pe(t)))}function jr(e){return E(e,"uniqueItems")&&xt(e.uniqueItems)}function Vs(e){return E(e,"unevaluatedItems")&&_e(e.unevaluatedItems)}function Ws(e){return E(e,"unevaluatedProperties")&&_e(e.unevaluatedProperties)}function VP(e){return Vs(e)||Ws(e)||$s(U(e),t=>Go(e[t]))}function WP(e){return $s(e,t=>Go(t))}function Go(e){return q(e)?WP(e):re(e)?VP(e):!1}function gg(e,t){return Go(t)||$s(U(e),n=>Go(e[n]))}class bg{constructor(t){this.hasUnevaluated=t}UseUnevaluated(){return this.hasUnevaluated}Push(){return Ve(ge("context","Push"),[])}Pop(){return Ve(ge("context","Pop"),[])}AddIndex(t){return Ve(ge("context","AddIndex"),[t])}AddKey(t){return Ve(ge("context","AddKey"),[t])}Merge(t){return Ve(ge("context","Merge"),[t])}}class Gn{constructor(){const t=new Set,n=new Set;this.stack=[{indices:t,keys:n}]}Push(){const t=new Set,n=new Set;return this.stack.push({indices:t,keys:n}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(const n of t)n.GetIndices().forEach(r=>this.GetIndices().add(r)),n.GetKeys().forEach(r=>this.GetKeys().add(r));return!0}}class sd extends Gn{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}}class Vn extends sd{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}}const Vo={identifier:"External",variables:[]};function hs(e){const t=`External[${Vo.variables.length}]`;return Vo.variables.push(e),t}function kg(){Vo.variables=[]}function xg(){return{...Vo}}function yg(e,t,n,r){const s=hs(n["~refine"].map(i=>i));return Hn(s,G(0),["refinement","_"],Ve(ge("refinement","check"),[r]))}function wg(e,t,n,r){return ht(n["~refine"],0,(s,i)=>s.check(r))}function vg(e,t,n,r,s,i){return Pt(s["~refine"],0,(o,d)=>o.check(i)||t.AddError({keyword:"~refine",schemaPath:n,instancePath:r,params:{index:d,message:o.error(i)}}))}let JP=0;function dt(){return`var_${JP++}`}function id(e){return Nr(e)&&q(e.items)}function QP(e,t,n,r){const[s,i]=[dt(),dt()],o=Ln(e,t,n.additionalItems,s),d=ol(i,G(n.items.length)),f=t.AddIndex(i);return Hn(r,G(0),[s,i],Ge(d,Ct(o,f)))}function YP(e,t,n,r){const[s,i]=[dt(),dt()],o=Ln(e,t,n.additionalItems,s),d=ol(i,G(n.items.length));return Hn(r,G(0),[s,i],Ge(d,o))}function Sg(e,t,n,r){return id(n)?t.UseUnevaluated()?QP(e,t,n,r):YP(e,t,n,r):G(!0)}function jg(e,t,n,r){return id(n)?ht(r,0,(i,o)=>ji(o,n.items.length)||Rr(e,t,n.additionalItems,i)&&t.AddIndex(o)):!0}function Ig(e,t,n,r,s,i){return id(s)?ht(i,0,(d,f)=>{const u=`${n}/additionalItems`,m=`${r}/${f}`;return ji(f,s.items.length)||Mr(e,t,u,m,s.additionalItems,d)&&t.AddIndex(f)}):!0}function ZP(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function od(e){const t=[];return fs(e)&&t.push(...U(e.patternProperties)),ms(e)&&t.push(...U(e.properties).map(ZP)),g(t.length,0)?"(?!)":`(${t.join("|")})`}function Cg(e,t,n){return ur(t)&&ms(t)&&!fs(t)&&g(t.additionalProperties,!1)&&g(U(t.properties).length,t.required.length)}function Eg(e,t,n){return Zt(ge(Ve(ge("Object","getOwnPropertyNames"),[n]),"length"),G(t.required.length))}function Tg(e,t,n,r){const[s,i]=[dt(),dt()],o=hs(new RegExp(od(n))),d=Ln(e,t,n.additionalProperties,`${r}[${s}]`),f=Ve(ge(o,"test"),[s]),u=t.AddKey(s),m=t.UseUnevaluated()?Ge(f,Ct(d,u)):Ge(f,d);return Hn(ss(r),G(0),[s,i],m)}function Ag(e,t,n,r){return Cg(t,n)?Eg(t,n,r):Tg(e,t,n,r)}function Pg(e,t,n,r){const s=new RegExp(od(n));return ht(U(r),0,(o,d)=>s.test(o)||Rr(e,t,n.additionalProperties,r[o])&&t.AddKey(o))}function Ng(e,t,n,r,s,i){const o=new RegExp(od(s)),d=[];return Pt(U(i),0,(u,m)=>{const p=`${n}/additionalProperties`,h=`${r}/${u}`,b=new Vn,k=o.test(u)||Mr(e,b,p,h,s.additionalProperties,i[u])&&t.AddKey(u);return k||d.push(u),k})||t.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:r,params:{additionalProperties:d}})}function ro(e,t,n,r,s){const i=tr("results","[]"),o=n.map((m,p)=>tr(`context_${p}`,al("CheckContext",[]))),d=n.map((m,p)=>tr(`condition_${p}`,Ve(xr(["context"],ct(e,t,m,r)),[`context_${p}`]))),f=n.map((m,p)=>pf(`condition_${p}`,Ve(ge("results","push"),[`context_${p}`]))),u=ia(Ct(s,t.Merge("results")));return Ve(xr([],sa([i,...o,...d,...f,u])),[])}function XP(e,t,n,r){return ro(e,t,n.allOf,r,Zt(ge("results","length"),G(n.allOf.length)))}function eN(e,t,n,r){return Tt(n.allOf.map(s=>ct(e,t,s,r)))}function Og(e,t,n,r){return t.UseUnevaluated()?XP(e,t,n,r):eN(e,t,n,r)}function Rg(e,t,n,r){const s=n.allOf.reduce((i,o)=>{const d=new Gn;return lt(e,d,o,r)?[...i,d]:i},[]);return g(s.length,n.allOf.length)&&t.Merge(s)}function Mg(e,t,n,r,s,i){const o=[],d=s.allOf.reduce((u,m,p)=>{const h=`${n}/allOf/${p}`,b=new Vn,k=At(e,b,h,r,m,i);return k||o.push(b),k?[...u,b]:u},[]),f=g(d.length,s.allOf.length)&&t.Merge(d);return f||o.forEach(u=>u.GetErrors().forEach(m=>t.AddError(m))),f}function tN(e,t,n,r){return ro(e,t,n.anyOf,r,lf(ge("results","length"),G(0)))}function nN(e,t,n,r){return cl(n.anyOf.map(s=>ct(e,t,s,r)))}function $g(e,t,n,r){return t.UseUnevaluated()?tN(e,t,n,r):nN(e,t,n,r)}function Fg(e,t,n,r){const s=n.anyOf.reduce((i,o)=>{const d=new Gn;return lt(e,d,o,r)?[...i,d]:i},[]);return ts(s.length,0)&&t.Merge(s)}function Lg(e,t,n,r,s,i){const o=[],d=s.anyOf.reduce((u,m,p)=>{const h=new Vn,b=`${n}/anyOf/${p}`,k=At(e,h,b,r,m,i);return k||o.push(h),k?[...u,h]:u},[]),f=ts(d.length,0)&&t.Merge(d);return f||o.forEach(u=>u.GetErrors().forEach(m=>t.AddError(m))),f||t.AddError({keyword:"anyOf",schemaPath:n,instancePath:r,params:{}})}function Dg(e,t,n,r){return G(!!n)}function ad(e,t,n,r){return n}function _g(e,t,n,r,s,i){return ad(e,t,s)||t.AddError({keyword:"boolean",schemaPath:n,instancePath:r,params:{}})}function Ug(e,t,n,r){return Ms(n.const)?Zt(r,G(n.const)):uf(r,hs(n.const))}function cd(e,t,n,r){return Ms(n.const)?g(r,n.const):ns(r,n.const)}function Bg(e,t,n,r,s,i){return cd(e,t,s,i)||t.AddError({keyword:"const",schemaPath:n,instancePath:r,params:{allowedValue:s.const}})}function Hg(e){return!(us(e)&&g(e.minContains,0))}function rN(e,t,n,r){const[s,i]=[dt(),dt()],o=$t(Zt(ge(r,"length"),G(0))),d=Fw(r,[s,i],Ct(ct(e,t,n.contains,s),t.AddIndex(i)));return Ct(o,d)}function sN(e,t,n,r){const[s]=[dt()],i=$t(Zt(ge(r,"length"),G(0))),o=$w(r,[s,"_"],ct(e,t,n.contains,s));return Ct(i,o)}function qg(e,t,n,r){return Hg(n)?t.UseUnevaluated()?rN(e,t,n,r):sN(e,t,n,r):G(!0)}function ld(e,t,n,r){return Hg(n)?!g(r.length,0)&&nf(r,(s,i)=>lt(e,t,n.contains,s)&&t.AddIndex(i)):!0}function zg(e,t,n,r,s,i){return ld(e,t,s,i)||t.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:1}})}function Kg(e,t,n,r){const s=Zt(ge(ss(r),"length"),G(0)),i=Tt(it(n.dependencies).map(([o,d])=>{const f=$t(Vr(r,G(o))),u=ct(e,t,d,r),m=p=>Tt(p.map(h=>Vr(r,G(h))));return Ge(f,q(d)?m(d):u)}));return Ge(s,i)}function Gg(e,t,n,r){const s=g(U(r).length,0),i=ht(it(n.dependencies),0,([o,d])=>!E(r,o)||(q(d)?d.every(f=>E(r,f)):lt(e,t,d,r)));return s||i}function Vg(e,t,n,r,s,i){const o=g(U(i).length,0),d=Pt(it(s.dependencies),0,([f,u])=>{const m=`${n}/dependencies/${f}`;return!E(i,f)||(q(u)?u.every(p=>E(i,p)||t.AddError({keyword:"dependencies",schemaPath:n,instancePath:r,params:{property:f,dependencies:u}})):At(e,t,m,r,u,i))});return o||d}function Wg(e,t,n,r){const s=Zt(ge(ss(r),"length"),G(0)),i=Tt(it(n.dependentRequired).map(([o,d])=>{const f=$t(Vr(r,G(o))),u=Tt(d.map(m=>Vr(r,G(m))));return Ge(f,u)}));return Ge(s,i)}function Jg(e,t,n,r){const s=g(U(r).length,0),i=ht(it(n.dependentRequired),0,([o,d])=>!E(r,o)||d.every(f=>E(r,f)));return s||i}function Qg(e,t,n,r,s,i){const o=g(U(i).length,0),d=Pt(it(s.dependentRequired),0,([f,u])=>!E(i,f)||Pt(u,0,m=>E(i,m)||t.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:r,params:{property:f,dependencies:u}})));return o||d}function Yg(e,t,n,r){const s=Zt(ge(ss(r),"length"),G(0)),i=Tt(it(n.dependentSchemas).map(([o,d])=>{const f=$t(Vr(r,G(o))),u=ct(e,t,d,r);return Ge(f,u)}));return Ge(s,i)}function Zg(e,t,n,r){const s=g(U(r).length,0),i=ht(it(n.dependentSchemas),0,([o,d])=>!E(r,o)||lt(e,t,d,r));return s||i}function Xg(e,t,n,r,s,i){const o=g(U(i).length,0),d=Pt(it(s.dependentSchemas),0,([f,u])=>{const m=`${n}/dependentSchemas/${f}`;return!E(i,f)||At(e,t,m,r,u,i)});return o||d}function iN(e,t,n,r){const s=e.DynamicRef(n)??!1;return Js(e,t,s,r)}function oN(e,t,n,r){const s=e.DynamicRef(n)??!1;return _e(s)&<(e,t,s,r)}function aN(e,t,n,r,s,i){const o=e.DynamicRef(s)??!1;return _e(o)&&At(e,t,"#",r,o,i)}function eb(e,t,n,r){return cl(n.enum.map(s=>{if(Ms(s))return Zt(r,G(s));const i=hs(s);return uf(r,i)}))}function dd(e,t,n,r){return $s(n.enum,s=>Ms(s)?g(r,s):ns(r,s))}function tb(e,t,n,r,s,i){return dd(e,t,s,i)||t.AddError({keyword:"enum",schemaPath:n,instancePath:r,params:{allowedValues:s.enum}})}function nb(e,t,n,r){return ol(r,G(n.exclusiveMaximum))}function ud(e,t,n,r){return ji(r,n.exclusiveMaximum)}function rb(e,t,n,r,s,i){return ud(e,t,s,i)||t.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:r,params:{comparison:"<",limit:s.exclusiveMaximum}})}function sb(e,t,n,r){return lf(r,G(n.exclusiveMinimum))}function pd(e,t,n,r){return ts(r,n.exclusiveMinimum)}function ib(e,t,n,r,s,i){return pd(e,t,s,i)||t.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:r,params:{comparison:">",limit:s.exclusiveMinimum}})}const cN=[0,31,28,31,30,31,30,31,31,30,31,30,31],lN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function dN(e){return e%4===0&&(e%100!==0||e%400===0)}function fd(e){const t=lN.exec(e);if(!t)return!1;const n=+t[1],r=+t[2],s=+t[3];return r>=1&&r<=12&&s>=1&&s<=(r===2&&dN(n)?29:cN[r])}const uN=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function md(e,t=!0){const n=uN.exec(e);if(!n)return!1;const r=+n[1],s=+n[2],i=+n[3],o=n[4]==="-"?-1:1,d=+(n[5]||0),f=+(n[6]||0);if(d>23||f>59||t&&!n[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(r<=23&&s<=59&&i<60)return!0;const u=s-f*o,m=r-d*o-(u<0?1:0);return(m===23||m===-1)&&(u===59||u===-1)&&i<61}function ob(e,t=!0){const n=e.split(/T/i);return n.length===2&&fd(n[0])&&md(n[1],t)}const pN=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function ab(e){return pN.test(e)}const fN=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i;function cb(e){return fN.test(e)}const qr=36,Po=1,Ac=26,mN=38,hN=700,gN=72,bN=128;function kN(e,t,n){e=n?Math.floor(e/hN):e>>1,e+=Math.floor(e/t);let r=0;for(;e>(qr-Po)*Ac>>1;)e=Math.floor(e/(qr-Po)),r+=qr;return r+Math.floor((qr-Po+1)*e/(e+mN))}function xN(e){const t=[];let n=bN,r=0,s=gN;const i=e.lastIndexOf("-");if(i>0)for(let d=0;d<i;d++){const f=e.charCodeAt(d);if(f>=128)throw new Error("Invalid punycode: non-basic before delimiter");t.push(f)}let o=i<0?0:i+1;for(;o<e.length;){const d=r;let f=1,u=qr;for(;;){if(o>=e.length)throw new Error("Invalid punycode: unexpected end of input");const p=e.charCodeAt(o++);let h;if(p>=97&&p<=122)h=p-97;else if(p>=48&&p<=57)h=p-48+26;else if(p>=65&&p<=90)Ft();else throw new Error("Invalid punycode: bad digit character");r+=h*f;const b=u<=s?Po:u>=s+Ac?Ac:u-s;if(h<b)break;f*=qr-b,u+=qr}const m=t.length+1;s=kN(r-d,m,d===0),n+=Math.floor(r/m),r%=m,t.splice(r,0,n),r++}return globalThis.String.fromCodePoint(...t)}function yN(e){return new RegExp("\\p{Mn}","u").test(String.fromCodePoint(e))}function wN(e){return new RegExp("\\p{Mc}","u").test(String.fromCodePoint(e))}function vN(e){return new RegExp("\\p{Me}","u").test(String.fromCodePoint(e))}function SN(e){return yN(e)||wN(e)||vN(e)}const jN=new Set([1600,2042,12334,12335,12337,12338,12339,12340,12341,12347]),IN=new Set([2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,6980,7082,7083,43456,69702,69759,69817,69939,69940,70080,70197,70477,70722,70850,71103,71231,71350,72767,73028,73029]);function CN(e){return new RegExp("\\p{Script=Greek}","u").test(String.fromCodePoint(e))}function EN(e){return new RegExp("\\p{Script=Hebrew}","u").test(String.fromCodePoint(e))}function TN(e){return new RegExp("\\p{Script=Hiragana}","u").test(String.fromCodePoint(e))}function AN(e){return new RegExp("\\p{Script=Katakana}","u").test(String.fromCodePoint(e))}function PN(e){return new RegExp("\\p{Script=Han}","u").test(String.fromCodePoint(e))}function NN(e){return e>=1632&&e<=1641}function ON(e){return e>=1776&&e<=1785}function qu(e){return IN.has(e)}function lb(e){if(e.length===0)return Ft();const t=[...e].map(o=>o.codePointAt(0)),n=t.length;if(t[0]===45||t[n-1]===45||n>=4&&t[2]===45&&t[3]===45||SN(t[0]))return!1;let r=!1,s=!1,i=!1;for(let o=0;o<n;o++){const d=t[o];if(jN.has(d))return!1;(TN(d)||AN(d)||PN(d))&&(r=!0),NN(d)&&(s=!0),ON(d)&&(i=!0);const f=t[o-1],u=t[o+1];switch(d){case 183:if(f!==108||u!==108)return!1;break;case 885:if(u===void 0||!CN(u))return!1;break;case 1523:case 1524:if(f===void 0||!EN(f))return!1;break;case 8204:if(f===void 0||f<128&&!qu(f))return!1;break;case 8205:if(f===void 0||!qu(f))return!1;break}}return!(e.includes("・")&&!r||s&&i)}function RN(e){if(e.charCodeAt(0)===45||e.charCodeAt(e.length-1)===45||e.length>=4&&e.charCodeAt(2)===45&&e.charCodeAt(3)===45)return!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||n===45))return!1}return!0}function db(e){return e.toLowerCase().startsWith("xn--")}function ub(e){try{const t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;const r=xN(t);return r?lb(r):!1}catch{return!1}}function MN(e){return e.length===0||e.length>63?!1:db(e)?ub(e):lb(e)}function $N(e){return e.length===0||e.length>63?!1:db(e)?ub(e):RN(e)}function pb(e){if(e.length===0||e.length>253||e.charCodeAt(e.length-1)===46)return!1;for(const t of e.split("."))if(!$N(t))return!1;return!0}const FN=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function fb(e){return FN.test(e)}function mb(e){if(e.length===0||e.includes(" "))return!1;const t=e.normalize("NFC").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".");if(t.length>253)return!1;for(const n of t.split("."))if(!MN(n))return!1;return!0}function hb(e,t,n){let r=0,s=0,i=0,o=0;for(let d=t;d<n;d++){const f=e.charCodeAt(d);if(f===46){if(i===0||s>255||o===48&&i>1)return!1;r++,s=0,i=0,o=0}else if(f>=48&&f<=57)i===0&&(o=f),s=s*10+(f-48),i++;else return!1}return r===3&&i>0&&s<=255&&!(o===48&&i>1)}function gb(e){return hb(e,0,e.length)}function LN(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function bb(e){const t=e.length;if(t===0)return!1;let n=0,r=!1,s=0;if(e.charCodeAt(0)===58&&e.charCodeAt(1)===58){if(t===2)return!0;r=!0,s=2}for(;s<t;){let i=0;const o=s;for(;s<t&&LN(e.charCodeAt(s));)s++,i++;if(i===0)return!1;const d=e.charCodeAt(s);if(d===46){if(!hb(e,o,t))return!1;n+=2,s=t;break}if(i>4)return!1;if(n++,s===t)break;if(d!==58)return!1;if(s++,e.charCodeAt(s)===58){if(r||e.charCodeAt(s+1)===58)return!1;if(r=!0,s++,s===t)break}}return r?n<=7:n===8}function zu(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function kb(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;const t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?zu(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:zu(e)}function xb(e){try{return new URL(e),!0}catch{return!1}}const DN=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function yb(e){return DN.test(e)}const _N=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function wb(e){return _N.test(e)}function vb(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}const UN=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Sb(e){return UN.test(e)}const BN=/^(?!.*[^\x00-\x7F])(?!.*\\)(?:(?:[a-z][a-z0-9+\-.]*:)?(?:\/\/[^\s[\]{}<>^`|]*)?|[^\s[\]{}<>^`|]*)(?:\?[^\s[\]{}<>^`|]*)?(?:#[^\s[\]{}<>^`|]*)?$/i;function jb(e){return BN.test(e)}const HN=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;function Ib(e){return HN.test(e)}function Cb(e){return e>=97&&e<=122||e>=65&&e<=90}function Eb(e){return Cb(e)||e>=48&&e<=57}function jo(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function qN(e){return Eb(e)||e===43||e===45||e===46}function Pc(e){return Eb(e)||e===45||e===46||e===95||e===126}function Nc(e){return e===33||e===36||e===38||e===39||e===40||e===41||e===42||e===43||e===44||e===59||e===61}function zN(e){return Pc(e)||Nc(e)||e===58||e===64}function Tb(e){const t=e.length;if(t===0||!Cb(e.charCodeAt(0)))return!1;let n=1;for(;n<t;){const r=e.charCodeAt(n);if(r===58)break;if(!qN(r))return!1;n++}if(e.charCodeAt(n)!==58)return!1;if(n++,e.charCodeAt(n)===47&&e.charCodeAt(n+1)===47){n+=2;const r=n;let s=-1;for(let i=n;i<t;i++){const o=e.charCodeAt(i);if(o===64){s=i;break}if(o===47||o===63||o===35)break}if(s!==-1){for(let i=r;i<s;i++){const o=e.charCodeAt(i);if(o===91||o===93)return!1;if(o===37){if(i+2>=s||!jo(e.charCodeAt(i+1))||!jo(e.charCodeAt(i+2)))return!1;i+=2}else if(!Pc(o)&&!Nc(o)&&o!==58)return!1}n=s+1}if(e.charCodeAt(n)===91){for(n++;n<t&&e.charCodeAt(n)!==93;)n++;if(e.charCodeAt(n)!==93)return!1;n++}else for(;n<t;){const i=e.charCodeAt(n);if(i===47||i===63||i===35||i===58)break;if(i<128&&!Pc(i)&&!Nc(i))return!1;n++}if(e.charCodeAt(n)===58)for(n++;n<t;){const i=e.charCodeAt(n);if(i===47||i===63||i===35)break;if(i<48||i>57)return!1;n++}}for(;n<t;){const r=e.charCodeAt(n);if(r===37){if(n+2>=t||!jo(e.charCodeAt(n+1))||!jo(e.charCodeAt(n+2)))return!1;n+=2}else{if(r>127)return!1;if(!(zN(r)||r===47||r===63||r===35))return!1}n++}return!0}const KN=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;function Ab(e){return KN.test(e)}const GN=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Pb(e){return GN.test(e)}const ze=new Map;function Nb(){ze.clear()}function VN(){return[...ze.entries()]}function WN(e,t){ze.set(e,t)}function JN(e){return ze.has(e)}function QN(e){return ze.get(e)}function Ob(e,t){var n;return((n=ze.get(e))==null?void 0:n(t))??!0}function Rb(){Nb(),ze.set("date-time",ob),ze.set("date",fd),ze.set("duration",ab),ze.set("email",cb),ze.set("hostname",pb),ze.set("idn-email",fb),ze.set("idn-hostname",mb),ze.set("ipv4",gb),ze.set("ipv6",bb),ze.set("iri-reference",kb),ze.set("iri",xb),ze.set("json-pointer-uri-fragment",yb),ze.set("json-pointer",wb),ze.set("regex",vb),ze.set("relative-json-pointer",Sb),ze.set("time",md),ze.set("uri-reference",jb),ze.set("uri-template",Ib),ze.set("uri",Tb),ze.set("url",Ab),ze.set("uuid",Pb)}Rb();const YN=Object.freeze(Object.defineProperty({__proto__:null,Clear:Nb,Entries:VN,Get:QN,Has:JN,IsDate:fd,IsDateTime:ob,IsDuration:ab,IsEmail:cb,IsHostname:pb,IsIPv4:gb,IsIPv6:bb,IsIdnEmail:fb,IsIdnHostname:mb,IsIri:xb,IsIriReference:kb,IsJsonPointer:wb,IsJsonPointerUriFragment:yb,IsRegex:vb,IsRelativeJsonPointer:Sb,IsTime:md,IsUri:Tb,IsUriReference:jb,IsUriTemplate:Ib,IsUrl:Ab,IsUuid:Pb,Reset:Rb,Set:WN,Test:Ob},Symbol.toStringTag,{value:"Module"}));function Mb(e,t,n,r){return Ve(ge("Format","Test"),[G(n.format),r])}function hd(e,t,n,r){return Ob(n.format,r)}function $b(e,t,n,r,s,i){return hd(e,t,s,i)||t.AddError({keyword:"format",schemaPath:n,instancePath:r,params:{format:s.format}})}function Fb(e,t,n,r){const s=Oa(n)?n.then:!0,i=ja(n)?n.else:!0;return Dw(ct(e,t,n.if,r),ct(e,t,s,r),ct(e,t,i,r))}function Lb(e,t,n,r){const s=Oa(n)?n.then:!0,i=ja(n)?n.else:!0;return lt(e,t,n.if,r)?lt(e,t,s,r):lt(e,t,i,r)}function Db(e,t,n,r,s,i){const o=Oa(s)?s.then:!0,d=ja(s)?s.else:!0,f=new Vn,u=At(e,f,`${n}/if`,r,s.if,i)?At(e,f,`${n}/then`,r,o,i)||t.AddError({keyword:"if",schemaPath:n,instancePath:r,params:{failingKeyword:"then"}}):At(e,t,`${n}/else`,r,d,i)||t.AddError({keyword:"if",schemaPath:n,instancePath:r,params:{failingKeyword:"else"}});return u&&t.Merge([f]),u}function ZN(e,t,n,r){return Tt(n.items.map((s,i)=>{const o=rs(ge(r,"length"),G(i)),d=Ln(e,t,s,`${r}[${i}]`),f=t.AddIndex(G(i));return Ge(o,Ct(d,f))}))}function XN(e,t,n,r){return Tt(n.items.map((s,i)=>{const o=rs(ge(r,"length"),G(i)),d=Ln(e,t,s,`${r}[${i}]`);return Ge(o,d)}))}function eO(e,t,n,r){return t.UseUnevaluated()?ZN(e,t,n,r):XN(e,t,n,r)}function tO(e,t,n,r){return ht(n.items,0,(s,i)=>ir(r.length,i)||Rr(e,t,s,r[i])&&t.AddIndex(i))}function nO(e,t,n,r,s,i){return Pt(s.items,0,(o,d)=>{const f=`${n}/items/${d}`,u=`${r}/${d}`;return ir(i.length,d)||Mr(e,t,f,u,o,i[d])&&t.AddIndex(d)})}function rO(e,t,n,r){const s=dr(n)?n.prefixItems.length:0,i=Ln(e,t,n.items,"element"),o=t.AddIndex("index");return Hn(r,G(s),["element","index"],Ct(i,o))}function sO(e,t,n,r){const s=dr(n)?n.prefixItems.length:0,i=Ln(e,t,n.items,"element");return Hn(r,G(s),["element","index"],i)}function iO(e,t,n,r){return t.UseUnevaluated()?rO(e,t,n,r):sO(e,t,n,r)}function oO(e,t,n,r){const s=dr(n)?n.prefixItems.length:0;return ht(r,s,(i,o)=>Rr(e,t,n.items,i)&&t.AddIndex(o))}function aO(e,t,n,r,s,i){const o=dr(s)?s.prefixItems.length:0;return Pt(i,o,(d,f)=>{const u=`${n}/items`,m=`${r}/${f}`;return Mr(e,t,u,m,s.items,d)&&t.AddIndex(f)})}function _b(e,t,n,r){return Ea(n)?eO(e,t,n,r):iO(e,t,n,r)}function Ub(e,t,n,r){return Ea(n)?tO(e,t,n,r):oO(e,t,n,r)}function Bb(e,t,n,r,s,i){return Ea(s)?nO(e,t,n,r,s,i):aO(e,t,n,r,s,i)}function Hb(e){return ds(e)}function qb(e,t,n,r){if(!Hb(n))return G(!0);const[s]=[dt()],i=ra(r,[s,"_"],ct(e,t,n.contains,s));return rs(i,G(n.maxContains))}function gd(e,t,n,r){if(!Hb(n))return!0;const s=nl(r,i=>lt(e,t,n.contains,i));return ir(s,n.maxContains)}function zb(e,t,n,r,s,i){const o=us(s)?s.minContains:1;return gd(e,t,s,i)||t.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:o,maxContains:s.maxContains}})}function Kb(e,t,n,r){return rs(r,G(n.maximum))}function bd(e,t,n,r){return ir(r,n.maximum)}function Gb(e,t,n,r,s,i){return bd(e,t,s,i)||t.AddError({keyword:"maximum",schemaPath:n,instancePath:r,params:{comparison:"<=",limit:s.maximum}})}function Vb(e,t,n,r){return rs(ge(r,"length"),G(n.maxItems))}function kd(e,t,n,r){return ir(r.length,n.maxItems)}function Wb(e,t,n,r,s,i){return kd(e,t,s,i)||t.AddError({keyword:"maxItems",schemaPath:n,instancePath:r,params:{limit:s.maxItems}})}function Jb(e,t,n,r){return Mw(r,G(n.maxLength))}function xd(e,t,n,r){return ef(r,n.maxLength)}function Qb(e,t,n,r,s,i){return xd(e,t,s,i)||t.AddError({keyword:"maxLength",schemaPath:n,instancePath:r,params:{limit:s.maxLength}})}function Yb(e,t,n,r){return rs(ge(ss(r),"length"),G(n.maxProperties))}function yd(e,t,n,r){return ir(U(r).length,n.maxProperties)}function Zb(e,t,n,r,s,i){return yd(e,t,s,i)||t.AddError({keyword:"maxProperties",schemaPath:n,instancePath:r,params:{limit:s.maxProperties}})}function Xb(e){return ds(e)}function cO(e,t,n,r){const[s,i]=[dt(),dt()],o=ra(r,[s,i],Ct(ct(e,t,n.contains,s),t.AddIndex(i)));return Ii(o,G(n.minContains))}function lO(e,t,n,r){const[s]=[dt()],i=ra(r,[s,"_"],ct(e,t,n.contains,s));return Ii(i,G(n.minContains))}function ek(e,t,n,r){return Xb(n)?t.UseUnevaluated()?cO(e,t,n,r):lO(e,t,n,r):G(!0)}function wd(e,t,n,r){if(!Xb(n))return!0;const s=nl(r,(i,o)=>lt(e,t,n.contains,i)&&t.AddIndex(o));return Rs(s,n.minContains)}function tk(e,t,n,r,s,i){return wd(e,t,s,i)||t.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:s.minContains}})}function nk(e,t,n,r){return Ii(r,G(n.minimum))}function vd(e,t,n,r){return Rs(r,n.minimum)}function rk(e,t,n,r,s,i){return vd(e,t,s,i)||t.AddError({keyword:"minimum",schemaPath:n,instancePath:r,params:{comparison:">=",limit:s.minimum}})}function sk(e,t,n,r){return Ii(ge(r,"length"),G(n.minItems))}function Sd(e,t,n,r){return Rs(r.length,n.minItems)}function ik(e,t,n,r,s,i){return Sd(e,t,s,i)||t.AddError({keyword:"minItems",schemaPath:n,instancePath:r,params:{limit:s.minItems}})}function ok(e,t,n,r){return Rw(r,G(n.minLength))}function jd(e,t,n,r){return tf(r,n.minLength)}function ak(e,t,n,r,s,i){return jd(e,t,s,i)||t.AddError({keyword:"minLength",schemaPath:n,instancePath:r,params:{limit:s.minLength}})}function ck(e,t,n,r){return Ii(ge(ss(r),"length"),G(n.minProperties))}function Id(e,t,n,r){return Rs(U(r).length,n.minProperties)}function lk(e,t,n,r,s,i){return Id(e,t,s,i)||t.AddError({keyword:"minProperties",schemaPath:n,instancePath:r,params:{limit:s.minProperties}})}function dk(e,t,n,r){return _w(r,G(n.multipleOf))}function Cd(e,t,n,r){return Zp(r,n.multipleOf)}function uk(e,t,n,r,s,i){return Cd(e,t,s,i)||t.AddError({keyword:"multipleOf",schemaPath:n,instancePath:r,params:{multipleOf:s.multipleOf}})}function dO(e,t,n,r){return ro(e,t,[n.not],r,$t(Zt(ge("results","length"),G(1))))}function uO(e,t,n,r){return $t(ct(e,t,n.not,r))}function pk(e,t,n,r){return t.UseUnevaluated()?dO(e,t,n,r):uO(e,t,n,r)}function Ed(e,t,n,r){const s=new Gn;return!lt(e,s,n.not,r)&&t.Merge([s])}function fk(e,t,n,r,s,i){return Ed(e,t,s,i)||t.AddError({keyword:"not",schemaPath:n,instancePath:r,params:{}})}function pO(e,t,n,r){return ro(e,t,n.oneOf,r,Zt(ge("results","length"),G(1)))}function fO(e,t,n,r){const[s]=[dt()],i=Lw(n.oneOf.map(d=>ct(e,t,d,r))),o=ra(i,[s,"_"],Zt(s,G(!0)));return Zt(o,G(1))}function mk(e,t,n,r){return t.UseUnevaluated()?pO(e,t,n,r):fO(e,t,n,r)}function hk(e,t,n,r){const s=n.oneOf.reduce((i,o)=>{const d=new Gn;return lt(e,d,o,r)?[...i,d]:i},[]);return g(s.length,1)&&t.Merge(s)}function gk(e,t,n,r,s,i){const o=[],d=[],f=s.oneOf.reduce((m,p,h)=>{const b=new Vn,k=`${n}/oneOf/${h}`,S=At(e,b,k,r,p,i);return S&&d.push(h),S||o.push(b),S?[...m,b]:m},[]),u=g(f.length,1)&&t.Merge(f);return!u&&g(d.length,0)&&o.forEach(m=>m.GetErrors().forEach(p=>t.AddError(p))),u||t.AddError({keyword:"oneOf",schemaPath:n,instancePath:r,params:{passingSchemas:d}})}function bk(e,t,n,r){const s=hs(pe(n.pattern)?new RegExp(n.pattern,"u"):n.pattern);return Ve(ge(s,"test"),[r])}function Td(e,t,n,r){return(pe(n.pattern)?new RegExp(n.pattern,"u"):n.pattern).test(r)}function kk(e,t,n,r,s,i){return Td(e,t,s,i)||t.AddError({keyword:"pattern",schemaPath:n,instancePath:r,params:{pattern:s.pattern}})}function xk(e,t,n,r){return Tt(it(n.patternProperties).map(([s,i])=>{const[o,d]=[dt(),dt()],f=hs(new RegExp(s,"u")),u=$t(Ve(ge(f,"test"),[o])),m=Ln(e,t,i,d),p=t.AddKey(o),h=t.UseUnevaluated()?Ge(u,Ct(m,p)):Ge(u,m);return Hn(df(r),G(0),[`[${o}, ${d}]`,"_"],h)}))}function yk(e,t,n,r){return ht(it(n.patternProperties),0,([s,i])=>{const o=new RegExp(s,"u");return ht(it(r),0,([d,f])=>!o.test(d)||Rr(e,t,i,f)&&t.AddKey(d))})}function wk(e,t,n,r,s,i){return Pt(it(s.patternProperties),0,([o,d])=>{const f=`${n}/patternProperties/${o}`,u=new RegExp(o,"u");return Pt(it(i),0,([m,p])=>{const h=`${r}/${m}`;return!u.test(m)||Mr(e,t,f,h,d,p)&&t.AddKey(m)})})}function vk(e,t,n,r){return Tt(n.prefixItems.map((s,i)=>{const o=rs(ge(r,"length"),G(i)),d=Ln(e,t,s,`${r}[${i}]`),f=t.AddIndex(G(i)),u=t.UseUnevaluated()?Ct(d,f):d;return Ge(o,u)}))}function Sk(e,t,n,r){return g(r.length,0)||ht(n.prefixItems,0,(s,i)=>ir(r.length,i)||Rr(e,t,s,r[i])&&t.AddIndex(i))}function jk(e,t,n,r,s,i){return g(i.length,0)||Pt(s.prefixItems,0,(o,d)=>{const f=`${n}/prefixItems/${d}`,u=`${r}/${d}`;return ir(i.length,d)||Mr(e,t,f,u,o,i[d])&&t.AddIndex(d)})}function Ad(e,t){return e.includes(t)||Ei().exactOptionalPropertyTypes}function mO(e,t){return fc(ge(e,t))}function Ik(e,t){return Fe(e[t])}function Ck(e,t,n,r){const s=ur(n)?n.required:[],i=it(n.properties).map(([o,d])=>{const f=$t(Vr(r,G(o))),u=Ln(e,t,d,ge(r,o)),m=t.AddKey(G(o)),p=t.UseUnevaluated()?Ct(u,m):u,h=s.includes(o)?p:Ge(f,p);return Ad(s,o)?h:Ge(mO(r,o),h)});return Tt(i)}function Ek(e,t,n,r){const s=ur(n)?n.required:[];return ht(it(n.properties),0,([o,d])=>{const f=!E(r,o)||Rr(e,t,d,r[o])&&t.AddKey(o);return Ad(s,o)?f:Ik(r,o)||f})}function Tk(e,t,n,r,s,i){const o=ur(s)?s.required:[];return Pt(it(s.properties),0,([f,u])=>{const m=`${n}/properties/${f}`,p=`${r}/${f}`,h=()=>!E(i,f)||Mr(e,t,m,p,u,i[f])&&t.AddKey(f);return Ad(o,f)?h():Ik(i,f)||h()})}function Ak(e,t,n,r){const[s,i]=[dt(),dt()];return Hn(ss(r),G(0),[s,i],ct(e,t,n.propertyNames,s))}function Pk(e,t,n,r){return ht(U(r),0,(s,i)=>lt(e,t,n.propertyNames,s))}function Nk(e,t,n,r,s,i){const o=[];return Pt(U(i),0,(f,u)=>{const m=`${r}/${f}`,p=`${n}/propertyNames`,h=new Vn,b=At(e,h,p,m,s.propertyNames,f);return b||o.push(f),b})||t.AddError({keyword:"propertyNames",schemaPath:n,instancePath:r,params:{propertyNames:o}})}function Ok(e,t,n,r){const s=e.RecursiveRef(n)??!1;return Js(e,t,s,r)}function Rk(e,t,n,r){const s=e.RecursiveRef(n)??!1;return _e(s)&<(e,t,s,r)}function Mk(e,t,n,r,s,i){const o=e.RecursiveRef(s)??!1;return _e(o)&&At(e,t,"#",r,o,i)}function hO(e,t,n,r){const s=xr(["context","value"],Js(e,t,n,"value")),i=xr(["context","value"],sa([tr("nextContext",al("CheckContext",[])),tr("result",Ve(s,["nextContext","value"])),pf("result",t.Merge("[nextContext]")),ia("result")]));return Ve(i,["context",r])}function gO(e,t,n,r){return Js(e,t,n,r)}function $k(e,t,n,r){const s=e.Ref(n)??!1;return t.UseUnevaluated()?hO(e,t,s,r):gO(e,t,s,r)}function Fk(e,t,n,r){const s=e.Ref(n)??!1,i=new Gn,o=_e(s)&<(e,i,s,r);return o&&t.Merge([i]),o}function Lk(e,t,n,r,s,i){const o=e.Ref(s)??!1,d=new Vn,f=_e(o)&&At(e,d,"#",r,o,i);return f&&t.Merge([d]),f||d.GetErrors().forEach(u=>t.AddError(u)),f}function Dk(e,t,n,r){return Tt(n.required.map(s=>Vr(r,G(s))))}function _k(e,t,n,r){return ht(n.required,0,s=>E(r,s))}function Uk(e,t,n,r,s,i){const o=[];return Pt(s.required,0,f=>{const u=E(i,f);return u||o.push(f),u})||t.AddError({keyword:"required",schemaPath:n,instancePath:r,params:{requiredProperties:o}})}function Bk(e,t,n,r){return g(n,"object")?of(r):g(n,"array")?Lo(r):g(n,"boolean")?Ew(r):g(n,"integer")?Tw(r):g(n,"number")?sf(r):g(n,"null")?Aw(r):g(n,"string")?cf(r):g(n,"bigint")?rf(r):g(n,"constructor")?Ow(r):g(n,"function")?Nw(r):g(n,"symbol")?Pw(r):g(n,"undefined")||g(n,"void")?fc(r):G(!0)}function Pd(e,t,n,r,s){return g(n,"object")?kn(s):g(n,"array")?q(s):g(n,"boolean")?xt(s):g(n,"integer")?el(s):g(n,"number")?Ie(s):g(n,"null")?Xt(s):g(n,"string")?pe(s):g(n,"bigint")?st(s):g(n,"constructor")?na(s):g(n,"function")?Tn(s):g(n,"symbol")?tl(s):g(n,"undefined")||g(n,"void")?Fe(s):!0}function bO(e,t,n,r){return cl(n.map(s=>Bk(e,t,s,r)))}function Hk(e,t,n,r,s){return $s(n,i=>Pd(e,t,i,r,s))}function qk(e,t,n,r){return q(n.type)?bO(e,t,n.type,r):Bk(e,t,n.type,r)}function zk(e,t,n,r){return q(n.type)?Hk(e,t,n.type,n,r):Pd(e,t,n.type,n,r)}function Kk(e,t,n,r,s,i){return(q(s.type)?Hk(e,t,s.type,s,i):Pd(e,t,s.type,s,i))||t.AddError({keyword:"type",schemaPath:n,instancePath:r,params:{type:s.type}})}function Gk(e,t,n,r){const[s,i]=[dt(),dt()],o=Ve(ge("context","GetIndices"),[]),d=Ve(ge("indices","has"),[s]),f=ct(e,t,n.unevaluatedItems,i),u=Ve(ge("context","AddIndex"),[s]),m=Hn(r,G(0),[i,s],Ct(Ge(d,f),u));return Ve(xr(["context"],sa([tr("indices",o),ia(m)])),["context"])}function Vk(e,t,n,r){const s=t.GetIndices();return ht(r,0,(i,o)=>(s.has(o)||lt(e,t,n.unevaluatedItems,i))&&t.AddIndex(o))}function Wk(e,t,n,r,s,i){const o=t.GetIndices(),d=[];return Pt(i,0,(u,m)=>{const p=new Vn,h=(o.has(m)||At(e,p,n,r,s.unevaluatedItems,u))&&t.AddIndex(m);return h||d.push(m),h})||t.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:r,params:{unevaluatedItems:d}})}function Jk(e,t,n,r){const[s,i]=[dt(),dt()],o=Ve(ge("context","GetKeys"),[]),d=Ve(ge("keys","has"),[s]),f=Ve(ge("context","AddKey"),[s]),u=ct(e,t,n.unevaluatedProperties,i),m=Hn(df(r),G(0),[`[${s}, ${i}]`,"_"],Ge(d,Ct(u,f)));return Ve(xr(["context"],sa([tr("keys",o),ia(m)])),["context"])}function Qk(e,t,n,r){const s=t.GetKeys();return ht(it(r),0,([i,o])=>s.has(i)||lt(e,t,n.unevaluatedProperties,o)&&t.AddKey(i))}function Yk(e,t,n,r,s,i){const o=t.GetKeys(),d=[];return Pt(it(i),0,([u,m])=>{const p=new Vn,h=o.has(u)||At(e,p,n,r,s.unevaluatedProperties,m)&&t.AddKey(u);return h||d.push(u),h})||t.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:r,params:{unevaluatedProperties:d}})}function Nd(e){return!g(e.uniqueItems,!1)}function Zk(e,t,n,r){if(!Nd(n))return G(!0);const s=ge(al("Set",[Ve(ge(r,"map"),[ge("Hashing","Hash")])]),"size"),i=ge(r,"length");return Zt(s,i)}function Xk(e,t,n,r){if(!Nd(n))return!0;const s=new Set(r.map(oa)).size,i=r.length;return g(s,i)}function ex(e,t,n,r,s,i){if(!Nd(s))return!0;const o=new Set,d=i.reduce((u,m,p)=>{const h=oa(m);return o.has(h)?[...u,p]:(o.add(h),u)},[]);return g(d.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:r,params:{duplicateItems:d}})}function wi(e,t){return no(e)&&(q(e.type)&&ts(e.type.length,0)&&ht(e.type,0,n=>g(n,t))||g(e.type,t))}function kO(e){return wi(e,"object")}function xO(e){return dn(e)&&(lr(e)||Gi(e)||Vi(e)||Wi(e)||ms(e)||fs(e)||to(e)||Ks(e)||Xi(e)||ur(e)||Ws(e))}function yO(e){return wi(e,"array")}function wO(e){return dn(e)&&(Ki(e)||Nr(e)||ds(e)||Yi(e)||qs(e)||us(e)||ps(e)||dr(e)||Vs(e)||jr(e))}function vO(e){return wi(e,"string")}function SO(e){return dn(e)&&(zs(e)||Zi(e)||Hs(e)||Gs(e))}function jO(e){return wi(e,"number")||wi(e,"bigint")}function IO(e){return dn(e)&&(Or(e)||Qi(e)||Ji(e)||Pr(e)||eo(e))}function Ln(e,t,n,r){return t.UseUnevaluated()?Ct(Ct(t.Push(),ct(e,t,n,r)),t.Pop()):ct(e,t,n,r)}function ct(e,t,n,r){e.Push(n);const s=[];if(zi(n))return Dg(e,t,n);if(no(n)&&s.push(qk(e,t,n,r)),xO(n)){const o=[];ur(n)&&o.push(Dk(e,t,n,r)),lr(n)&&o.push(Ag(e,t,n,r)),Gi(n)&&o.push(Kg(e,t,n,r)),Vi(n)&&o.push(Wg(e,t,n,r)),Wi(n)&&o.push(Yg(e,t,n,r)),fs(n)&&o.push(xk(e,t,n,r)),ms(n)&&o.push(Ck(e,t,n,r)),to(n)&&o.push(Ak(e,t,n,r)),Ks(n)&&o.push(ck(e,t,n,r)),Xi(n)&&o.push(Yb(e,t,n,r));const d=Tt(o),f=Ge($t(of(r)),d);s.push(kO(n)?d:f)}if(wO(n)){const o=[];Ki(n)&&o.push(Sg(e,t,n,r)),ds(n)&&o.push(qg(e,t,n,r)),Nr(n)&&o.push(_b(e,t,n,r)),Yi(n)&&o.push(qb(e,t,n,r)),qs(n)&&o.push(Vb(e,t,n,r)),us(n)&&o.push(ek(e,t,n,r)),ps(n)&&o.push(sk(e,t,n,r)),dr(n)&&o.push(vk(e,t,n,r)),jr(n)&&o.push(Zk(e,t,n,r));const d=Tt(o),f=Ge($t(Lo(r)),d);s.push(yO(n)?d:f)}if(SO(n)){const o=[];Zi(n)&&o.push(Jb(e,t,n,r)),zs(n)&&o.push(ok(e,t,n,r)),Hs(n)&&o.push(Mb(e,t,n,r)),Gs(n)&&o.push(bk(e,t,n,r));const d=Tt(o),f=Ge($t(cf(r)),d);s.push(vO(n)?d:f)}if(IO(n)){const o=[];Ji(n)&&o.push(nb(e,t,n,r)),Pr(n)&&o.push(sb(e,t,n,r)),Qi(n)&&o.push(Kb(e,t,n,r)),Or(n)&&o.push(nk(e,t,n,r)),eo(n)&&o.push(dk(e,t,n,r));const d=Tt(o),f=Ge($t(Ge(sf(r),rf(r))),d);s.push(jO(n)?d:f)}Na(n)&&s.push($k(e,t,n,r)),Pa(n)&&s.push(Ok(e,t,n,r)),Sa(n)&&s.push(iN(e,t,n,r)),va(n)&&s.push(Ug(e,t,n,r)),Ia(n)&&s.push(eb(e,t,n,r)),Ca(n)&&s.push(Fb(e,t,n,r)),Ta(n)&&s.push(pk(e,t,n,r)),ya(n)&&s.push(Og(e,t,n,r)),wa(n)&&s.push($g(e,t,n,r)),Aa(n)&&s.push(mk(e,t,n,r)),Vs(n)&&s.push(Ge($t(Lo(r)),Gk(e,t,n,r))),Ws(n)&&s.push(Ge($t(af(r)),Jk(e,t,n,r))),xa(n)&&s.push(yg(e,t,n,r));const i=Tt(s);return e.Pop(n),i}function Rr(e,t,n,r){return t.Push()&<(e,t,n,r)&&t.Pop()}function lt(e,t,n,r){e.Push(n);const s=zi(n)?ad(e,t,n):(!no(n)||zk(e,t,n,r))&&(!(re(r)&&!q(r))||(!ur(n)||_k(e,t,n,r))&&(!lr(n)||Pg(e,t,n,r))&&(!Gi(n)||Gg(e,t,n,r))&&(!Vi(n)||Jg(e,t,n,r))&&(!Wi(n)||Zg(e,t,n,r))&&(!fs(n)||yk(e,t,n,r))&&(!ms(n)||Ek(e,t,n,r))&&(!to(n)||Pk(e,t,n,r))&&(!Ks(n)||Id(e,t,n,r))&&(!Xi(n)||yd(e,t,n,r)))&&(!q(r)||(!Ki(n)||jg(e,t,n,r))&&(!ds(n)||ld(e,t,n,r))&&(!Nr(n)||Ub(e,t,n,r))&&(!Yi(n)||gd(e,t,n,r))&&(!qs(n)||kd(e,t,n,r))&&(!us(n)||wd(e,t,n,r))&&(!ps(n)||Sd(e,t,n,r))&&(!dr(n)||Sk(e,t,n,r))&&(!jr(n)||Xk(e,t,n,r)))&&(!pe(r)||(!Zi(n)||xd(e,t,n,r))&&(!zs(n)||jd(e,t,n,r))&&(!Hs(n)||hd(e,t,n,r))&&(!Gs(n)||Td(e,t,n,r)))&&(!(Ie(r)||st(r))||(!Ji(n)||ud(e,t,n,r))&&(!Pr(n)||pd(e,t,n,r))&&(!Qi(n)||bd(e,t,n,r))&&(!Or(n)||vd(e,t,n,r))&&(!eo(n)||Cd(e,t,n,r)))&&(!Na(n)||Fk(e,t,n,r))&&(!Pa(n)||Rk(e,t,n,r))&&(!Sa(n)||oN(e,t,n,r))&&(!va(n)||cd(e,t,n,r))&&(!Ia(n)||dd(e,t,n,r))&&(!Ca(n)||Lb(e,t,n,r))&&(!Ta(n)||Ed(e,t,n,r))&&(!ya(n)||Rg(e,t,n,r))&&(!wa(n)||Fg(e,t,n,r))&&(!Aa(n)||hk(e,t,n,r))&&(!Vs(n)||!q(r)||Vk(e,t,n,r))&&(!Ws(n)||!re(r)||Qk(e,t,n,r))&&(!xa(n)||wg(e,t,n,r));return e.Pop(n),s}function Mr(e,t,n,r,s,i){return t.Push()&&At(e,t,n,r,s,i)&&t.Pop()}function At(e,t,n,r,s,i){e.Push(s);const o=zi(s)?_g(e,t,n,r,s):!!(+(!no(s)||Kk(e,t,n,r,s,i))&+(!(re(i)&&!q(i))||!!(+(!ur(s)||Uk(e,t,n,r,s,i))&+(!lr(s)||Ng(e,t,n,r,s,i))&+(!Gi(s)||Vg(e,t,n,r,s,i))&+(!Vi(s)||Qg(e,t,n,r,s,i))&+(!Wi(s)||Xg(e,t,n,r,s,i))&+(!fs(s)||wk(e,t,n,r,s,i))&+(!ms(s)||Tk(e,t,n,r,s,i))&+(!to(s)||Nk(e,t,n,r,s,i))&+(!Ks(s)||lk(e,t,n,r,s,i))&+(!Xi(s)||Zb(e,t,n,r,s,i))))&+(!q(i)||!!(+(!Ki(s)||Ig(e,t,n,r,s,i))&+(!ds(s)||zg(e,t,n,r,s,i))&+(!Nr(s)||Bb(e,t,n,r,s,i))&+(!Yi(s)||zb(e,t,n,r,s,i))&+(!qs(s)||Wb(e,t,n,r,s,i))&+(!us(s)||tk(e,t,n,r,s,i))&+(!ps(s)||ik(e,t,n,r,s,i))&+(!dr(s)||jk(e,t,n,r,s,i))&+(!jr(s)||ex(e,t,n,r,s,i))))&+(!pe(i)||!!(+(!Zi(s)||Qb(e,t,n,r,s,i))&+(!zs(s)||ak(e,t,n,r,s,i))&+(!Hs(s)||$b(e,t,n,r,s,i))&+(!Gs(s)||kk(e,t,n,r,s,i))))&+(!(Ie(i)||st(i))||!!(+(!Ji(s)||rb(e,t,n,r,s,i))&+(!Pr(s)||ib(e,t,n,r,s,i))&+(!Qi(s)||Gb(e,t,n,r,s,i))&+(!Or(s)||rk(e,t,n,r,s,i))&+(!eo(s)||uk(e,t,n,r,s,i))))&+(!Na(s)||Lk(e,t,n,r,s,i))&+(!Pa(s)||Mk(e,t,n,r,s,i))&+(!Sa(s)||aN(e,t,n,r,s,i))&+(!va(s)||Bg(e,t,n,r,s,i))&+(!Ia(s)||tb(e,t,n,r,s,i))&+(!Ca(s)||Db(e,t,n,r,s,i))&+(!Ta(s)||fk(e,t,n,r,s,i))&+(!ya(s)||Mg(e,t,n,r,s,i))&+(!wa(s)||Lg(e,t,n,r,s,i))&+(!Aa(s)||gk(e,t,n,r,s,i))&+(!Vs(s)||!q(i)||Wk(e,t,n,r,s,i))&+(!Ws(s)||!re(i)||Yk(e,t,n,r,s,i)))&&(!xa(s)||vg(e,t,n,r,s,i));return e.Pop(s),o}const tx=[0],No=new Map,mi=new Map;function CO(){return`${tx[0]++}`}function EO(e,t){No.has(e)||No.set(e,new Map);const n=No.get(e);if(n.has(t))return n.get(t);const r=CO();return n.set(t,r),r}function TO(e,t,n,r){return e.UseUnevaluated()?Ve(`check_${n}`,["context",r]):Ve(`check_${n}`,[r])}function AO(e,t,n,r){const s=ct(e,t,n,"value");return t.UseUnevaluated()?tr(`check_${r}`,xr(["context","value"],s)):tr(`check_${r}`,xr(["value"],s))}function nx(){tx[0]=0,No.clear(),mi.clear()}function rx(){return[...mi.values()]}function Js(e,t,n,r){const s=EO(n,e.BaseURL().href),i=TO(t,n,s,r);return mi.has(s)||(mi.set(s,""),mi.set(s,AO(e,t,n,s))),i}function sx(e){if(e.length===0)throw Error("Cannot set root")}function ix(e){if(!re(e))throw Error("Cannot set value")}function PO(e){if(er(e))throw Error("Pointer contains unsafe property key")}function ox(e){for(const t of e)PO(t)}function NO(e){return/^(0|[1-9]\d*)$/.test(e)}function ax(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function OO(e,t){return re(t)&&E(t,e)}function RO(e,t){return re(t)&&!er(e)?t[e]:void 0}function Od(e,t){return e.reduce((n,r)=>RO(r,n),t)}function so(e){if(g(e.length,0))return[];const t=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function MO(e,t){let n=e;return so(t).every(r=>OO(r,n)?(n=n[r],!0):!1)}function cx(e,t){const n=so(t);return Od(n,e)}function Oc(e,t,n){const r=so(t);sx(r),ox(r);const[s,i]=ax(r),o=Od(s,e);return ix(o),o[i]=n,e}function lx(e,t){const n=so(t);sx(n),ox(n);const[r,s]=ax(n),i=Od(r,e);return ix(i),q(i)&&NO(s)?i.splice(+s,1):delete i[s],e}const dx=Object.freeze(Object.defineProperty({__proto__:null,Delete:lx,Get:cx,Has:MO,Indices:so,Set:Oc},Symbol.toStringTag,{value:"Module"}));function $O(e,t,n){if(e.$id===n.hash)return e;const r=new URL(e.$id,t.href),s=new URL(n.href,t.href);if(g(r.pathname,s.pathname))return n.hash.startsWith("#")?ux(e,t,n):e}function FO(e,t,n){const r=new URL(`#${e.$anchor}`,t.href),s=new URL(n.href,t.href);return g(r.href,s.href)?e:void 0}function LO(e,t,n){const r=new URL(`#${e.$dynamicAnchor}`,t.href),s=new URL(n.href,t.href);return g(r.href,s.href)?e:void 0}function ux(e,t,n){if(n.href.endsWith("#"))return e;if(!n.hash.startsWith("#"))return;const r=decodeURIComponent(n.hash.slice(1));if(r.startsWith("/"))return cx(e,r)}function DO(e,t,n){if(Sr(e)){const r=$O(e,t,n);if(!Fe(r))return r}if(Ko(e)){const r=FO(e,t,n);if(!Fe(r))return r}if(Yr(e)){const r=LO(e,t,n);if(!Fe(r))return r}return ux(e,t,n)}function _O(e,t,n){return e.reduce((r,s)=>{const i=Rd(s,t,n);return Fe(i)?r:i},void 0)}function UO(e,t,n){return U(e).reduce((r,s)=>{const i=Rd(e[s],t,n);return Fe(i)?r:i},void 0)}function Rd(e,t,n){const r=dn(e)&&Sr(e)?new URL(e.$id,t.href):t;if(dn(e)){const s=DO(e,r,n);if(!Fe(s))return s}if(q(e))return _O(e,r,n);if(re(e))return UO(e,r,n)}function Zr(e,t){const n=new URL("http://unknown/"),r=Sr(e)?new URL(e.$id,n.href):n,s=new URL(t,r.href);return Rd(e,r,s)}function px(e,t,n,r){const s=n.$dynamicRef.startsWith("#")?Zr(t,n.$dynamicRef):Zr(e,n.$dynamicRef);return Fe(s)?void 0:!dn(s)||!Yr(s)||new URL(n.$dynamicRef,"http://unknown/").hash.startsWith("#/")?s:r.find(d=>d.$dynamicAnchor===s.$dynamicAnchor)??s}const BO=Object.freeze(Object.defineProperty({__proto__:null,DynamicRef:px,Ref:Zr},Symbol.toStringTag,{value:"Module"}));var Ts=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},br,fx,mx,hx,gx;class io{constructor(t,n){br.add(this),this.context=t,this.schema=n,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,n)=>new URL(n.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){dn(t)&&(Sr(t)&&(this.ids.push(t),Ts(this,br,"m",fx).call(this,t)),Ko(t)&&this.anchors.push(t),Ao(t)&&this.recursiveAnchors.push(t),Yr(t)&&this.dynamicAnchors.push(t))}Pop(t){dn(t)&&(Sr(t)&&(this.ids.pop(),Ts(this,br,"m",mx).call(this,t)),Ko(t)&&this.anchors.pop(),Ao(t)&&this.recursiveAnchors.pop(),Yr(t)&&this.dynamicAnchors.pop())}Ref(t){return Ts(this,br,"m",hx).call(this,t)??Ts(this,br,"m",gx).call(this,t)}RecursiveRef(t){return Ao(this.Base())?Zr(this.recursiveAnchors[0],t.$recursiveRef):Zr(this.Base(),t.$recursiveRef)}DynamicRef(t){const n=this.schema;return px(n,this.Base(),t,this.dynamicAnchors)}}br=new WeakSet,fx=function e(t,n=!0){if(!dn(t))return;const r=t;if(!(!n&&Sr(r))){!n&&Yr(r)&&this.dynamicAnchors.push(r);for(const s of U(r))Ts(this,br,"m",e).call(this,r[s],!1)}},mx=function e(t,n=!0){if(!dn(t))return;const r=t;if(!(!n&&Sr(r))){!n&&Yr(r)&&this.dynamicAnchors.pop();for(const s of U(r))Ts(this,br,"m",e).call(this,r[s],!1)}},hx=function(t){return E(this.context,t.$ref)?this.context[t.$ref]:void 0},gx=function(t){const n=this.schema;return t.$ref.startsWith("#")?Zr(this.Base(),t.$ref):Zr(n,t.$ref)};function HO(e){const t=e.Functions().join(`;
|
|
269
|
-
`),n=e.UseUnevaluated()?["const context = new CheckContext({}, {})",`return ${e.Entry()}`]:[`return ${e.Entry()}`];return`${t}; return (value) => { ${n.join("; ")} }`}function qO(e,t){return wf("CheckContext","Guard","Format","Hashing",e.External().identifier,t)(Gn,Fo,YN,Fv,e.External().variables)}function zO(e){const t=new io(e.Context(),e.Schema()),n=new Gn;return r=>lt(t,n,e.Schema(),r)}function KO(e,t){return yf()?qO(e,t):zO(e)}class bx{constructor(t,n,r){this.isAccelerated=t,this.code=n,this.check=r}IsAccelerated(){return this.isAccelerated}Code(){return this.code}Check(t){return this.check(t)}}class kx{constructor(t,n,r,s,i,o){this.context=t,this.schema=n,this.external=r,this.functions=s,this.entry=i,this.useUnevaluated=o}Context(){return this.context}Schema(){return this.schema}UseUnevaluated(){return this.useUnevaluated}External(){return this.external}Functions(){return this.functions}Entry(){return this.entry}Evaluate(){const t=HO(this),n=KO(this,t);return new bx(yf(),t,n)}}function xx(...e){const[t,n]=ut(e,{2:(f,u)=>[f,u],1:f=>[{},f]});kg(),nx();const r=new io(t,n),s=new bg(gg(t,n)),i=Js(r,s,n,"value"),o=rx(),d=xg();return new kx(t,n,d,o,i,s.UseUnevaluated())}function vi(...e){const[t,n,r]=ut(e,{3:(m,p,h)=>[m,p,h],2:(m,p)=>[{},m,p]}),s=Ei(),i=_v(),o=[],d=new io(t,n),f=new sd(m=>{if(!Rs(o.length,s.maxErrors))return o.push({...m,message:i(m)})});return[At(d,f,"#","",n,r),o]}function Md(...e){const[t,n,r]=ut(e,{3:(o,d,f)=>[o,d,f],2:(o,d)=>[{},o,d]}),s=new io(t,n),i=new Gn;return lt(s,i,n,r)}let $d=class{constructor(t,n,r){this.schema=t,this.value=n,this.errors=r}};function GO(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});if(!Md(t,n,r)){const[s,i]=vi(t,n,r);throw new $d(n,r,i)}return r}class yx{constructor(t,n){this.buildResult=xx(t,n),this.evaluateResult=this.buildResult.Evaluate()}IsAccelerated(){return this.evaluateResult.IsAccelerated()}Schema(){return this.buildResult.Schema()}Check(t){return this.evaluateResult.Check(t)}Parse(t){if(this.evaluateResult.Check(t))return t;const[n,r]=vi(this.buildResult.Context(),this.buildResult.Schema(),t);throw new $d(this.buildResult.Schema(),t,r)}Errors(t){return vi(this.buildResult.Context(),this.buildResult.Schema(),t)}}function VO(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s],1:r=>[{},r]});return new yx(t,n)}const WO=Object.freeze(Object.defineProperty({__proto__:null,AccumulatedErrorContext:Vn,Build:xx,BuildAdditionalItems:Sg,BuildAdditionalProperties:Ag,BuildAdditionalPropertiesFast:Eg,BuildAdditionalPropertiesStandard:Tg,BuildAllOf:Og,BuildAnyOf:$g,BuildConst:Ug,BuildContains:qg,BuildContext:bg,BuildDependencies:Kg,BuildDependentRequired:Wg,BuildDependentSchemas:Yg,BuildEnum:eb,BuildExclusiveMaximum:nb,BuildExclusiveMinimum:sb,BuildFormat:Mb,BuildIf:Fb,BuildItems:_b,BuildMaxContains:qb,BuildMaxItems:Vb,BuildMaxLength:Jb,BuildMaxProperties:Yb,BuildMaximum:Kb,BuildMinContains:ek,BuildMinItems:sk,BuildMinLength:ok,BuildMinProperties:ck,BuildMinimum:nk,BuildMultipleOf:dk,BuildNot:pk,BuildOneOf:mk,BuildPattern:bk,BuildPatternProperties:xk,BuildPrefixItems:vk,BuildProperties:Ck,BuildPropertyNames:Ak,BuildRecursiveRef:Ok,BuildRef:$k,BuildRefine:yg,BuildRequired:Dk,BuildResult:kx,BuildSchema:ct,BuildSchemaBoolean:Dg,BuildSchemaPushStack:Ln,BuildType:qk,BuildUnevaluatedItems:Gk,BuildUnevaluatedProperties:Jk,BuildUniqueItems:Zk,CanAdditionalPropertiesFast:Cg,Check:Md,CheckAdditionalItems:jg,CheckAdditionalProperties:Pg,CheckAllOf:Rg,CheckAnyOf:Fg,CheckConst:cd,CheckContains:ld,CheckContext:Gn,CheckDependencies:Gg,CheckDependentRequired:Jg,CheckDependentSchemas:Zg,CheckEnum:dd,CheckExclusiveMaximum:ud,CheckExclusiveMinimum:pd,CheckFormat:hd,CheckIf:Lb,CheckItems:Ub,CheckMaxContains:gd,CheckMaxItems:kd,CheckMaxLength:xd,CheckMaxProperties:yd,CheckMaximum:bd,CheckMinContains:wd,CheckMinItems:Sd,CheckMinLength:jd,CheckMinProperties:Id,CheckMinimum:vd,CheckMultipleOf:Cd,CheckNot:Ed,CheckOneOf:hk,CheckPattern:Td,CheckPatternProperties:yk,CheckPrefixItems:Sk,CheckProperties:Ek,CheckPropertyNames:Pk,CheckRecursiveRef:Rk,CheckRef:Fk,CheckRefine:wg,CheckRequired:_k,CheckSchema:lt,CheckSchemaBoolean:ad,CheckSchemaPushStack:Rr,CheckType:zk,CheckUnevaluatedItems:Vk,CheckUnevaluatedProperties:Qk,CheckUniqueItems:Xk,Compile:VO,CreateFunction:Js,CreateVariable:hs,ErrorAdditionalItems:Ig,ErrorAdditionalProperties:Ng,ErrorAllOf:Mg,ErrorAnyOf:Lg,ErrorConst:Bg,ErrorContains:zg,ErrorContext:sd,ErrorDependencies:Vg,ErrorDependentRequired:Qg,ErrorDependentSchemas:Xg,ErrorEnum:tb,ErrorExclusiveMaximum:rb,ErrorExclusiveMinimum:ib,ErrorFormat:$b,ErrorIf:Db,ErrorItems:Bb,ErrorMaxContains:zb,ErrorMaxItems:Wb,ErrorMaxLength:Qb,ErrorMaxProperties:Zb,ErrorMaximum:Gb,ErrorMinContains:tk,ErrorMinItems:ik,ErrorMinLength:ak,ErrorMinProperties:lk,ErrorMinimum:rk,ErrorMultipleOf:uk,ErrorNot:fk,ErrorOneOf:gk,ErrorPattern:kk,ErrorPatternProperties:wk,ErrorPrefixItems:jk,ErrorProperties:Tk,ErrorPropertyNames:Nk,ErrorRecursiveRef:Mk,ErrorRef:Lk,ErrorRefine:vg,ErrorRequired:Uk,ErrorSchema:At,ErrorSchemaBoolean:_g,ErrorSchemaPushStack:Mr,ErrorType:Kk,ErrorUnevaluatedItems:Wk,ErrorUnevaluatedProperties:Yk,ErrorUniqueItems:ex,Errors:vi,EvaluateResult:bx,GetExternal:xg,GetFunctions:rx,HasUnevaluated:gg,IsAdditionalItems:Ki,IsAdditionalProperties:lr,IsAllOf:ya,IsAnchor:Ko,IsAnyOf:wa,IsConst:va,IsContains:ds,IsContentEncoding:qP,IsContentMediaType:zP,IsDefault:Ar,IsDefs:KP,IsDependencies:Gi,IsDependentRequired:Vi,IsDependentSchemas:Wi,IsDynamicAnchor:Yr,IsDynamicRef:Sa,IsElse:ja,IsEnum:Ia,IsExclusiveMaximum:Ji,IsExclusiveMinimum:Pr,IsFormat:Hs,IsId:Sr,IsIf:Ca,IsItems:Nr,IsItemsSized:Ea,IsItemsUnsized:GP,IsMaxContains:Yi,IsMaxItems:qs,IsMaxLength:Zi,IsMaxProperties:Xi,IsMaximum:Qi,IsMinContains:us,IsMinItems:ps,IsMinLength:zs,IsMinProperties:Ks,IsMinimum:Or,IsMultipleOf:eo,IsNot:Ta,IsOneOf:Aa,IsPattern:Gs,IsPatternProperties:fs,IsPrefixItems:dr,IsProperties:ms,IsPropertyNames:to,IsRecursiveAnchor:hg,IsRecursiveAnchorTrue:Ao,IsRecursiveRef:Pa,IsRef:Na,IsRefine:xa,IsRequired:ur,IsSchema:_e,IsSchemaBoolean:zi,IsSchemaObject:dn,IsThen:Oa,IsType:no,IsUnevaluatedItems:Vs,IsUnevaluatedProperties:Ws,IsUniqueItems:jr,Parse:GO,ParseError:$d,Pointer:dx,Reducer:ro,ResetExternal:kg,ResetFunctions:nx,Resolve:BO,Stack:io,Validator:yx},Symbol.toStringTag,{value:"Module"}));function ot(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return Md(t,n,r)}function oo(...e){const[t,n,r]=ut(e,{3:(o,d,f)=>[o,d,f],2:(o,d)=>[{},o,d]}),[s,i]=vi(t,n,r);return i}class Ra extends Error{constructor(t,n,r){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:r,value:n},writable:!1,configurable:!1,enumerable:!1})}}function wx(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]});if(!ot(t,n,r))throw new Ra("Assert",r,oo(t,n,r))}function JO(e,t,n){return q(n)?n.map(r=>Nn(e,t.items,r)):n}function QO(e,t,n){return Nn({...e,...t.$defs},gn(t.$ref),n)}function YO(e,t){const n=E(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},r=Bs(e,t),s=Kn(r);return Ue(s)?dg(s,n):s}function ZO(e,t,n){const r=YO(e,t);return Nn(e,r,n)}function vx(e){return E(e,"additionalProperties")?e.additionalProperties:void 0}function XO(e,t,n){if(!re(n)||q(n))return n;const r=vx(t);for(const s of U(n)){if(E(t.properties,s)){n[s]=Nn(e,t.properties[s],n[s]);continue}if(xt(r)&&g(r,!0)||on(r)&&ot(e,r,n[s])){n[s]=Nn(e,r,n[s]);continue}delete n[s]}return n}function eR(e,t,n){if(!re(n))return n;const r=vx(t),[s,i]=[new RegExp(jn(t)),Vt(t)];for(const o of U(n)){if(s.test(o)){n[o]=Nn(e,i,n[o]);continue}if(xt(r)&&g(r,!0)||on(r)&&ot(e,r,n[o])){n[o]=Nn(e,r,n[o]);continue}delete n[o]}return n}function tR(e,t,n){return E(e,t.$ref)?Nn(e,e[t.$ref],n):n}function nR(e,t,n){if(!q(n))return n;const r=Math.min(n.length,t.items.length);for(let s=0;s<r;s++)n[s]=Nn(e,t.items[s],n[s]);return ts(n.length,r)?n.slice(0,r):n}function zt(e){return ll(e)}function rR(e,t,n){for(const r of t.anyOf){const s=Nn(e,r,zt(n));if(ot(e,r,s))return s}return n}function Nn(e,t,n){return gt(t)?JO(e,t,n):Gt(t)?QO(e,t,n):Be(t)?ZO(e,t,n):Ue(t)?XO(e,t,n):Ot(t)?eR(e,t,n):vt(t)?tR(e,t,n):at(t)?nR(e,t,n):fe(t)?rR(e,t,n):n}function sR(e,t){for(const n of Fo.Keys(e))Fo.HasPropertyKey(t,n)||(t[n]=e[n]);return t}function iR(e){const t={};for(const n of Fo.Keys(e))t[n]=Si(e[n]);return t}function oR(e){return Rc(BP(e))}function Rc(e){return e.map(t=>Si(t))}function Si(e){const t=gt(e)?Ir(Si(e.items),pl(e)):Be(e)?Bn(Rc(e.allOf)):fe(e)?Je(oR(e.anyOf)):Ue(e)?Me(iR(e.properties)):Ot(e)?wl(ua(e),Si(Vt(e))):at(e)?Sn(Rc(e.items)):e;return sR(e,t)}function Fd(e){return Si(e)}function ao(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]}),s=Fd(n);return Nn(t,s,r)}function fn(e){return re(e)&&E(e,"value")}function ne(e){return{value:e}}function aR(e){return q(e)?ne(e):ne([e])}function cR(e){return g(e,!0)?ne(BigInt(1)):ne(BigInt(0))}const lR=/^-?(0|[1-9]\d*)n$/,dR=/^-?(0|[1-9]\d*)\.\d+$/,uR=/^-?(0|[1-9]\d*)$/;function pR(e){return lR.test(e)}function fR(e){return dR.test(e)}function mR(e){return uR.test(e)}function hR(e){const t=e.toLowerCase();return pR(e)?ne(BigInt(e.slice(0,e.length-1))):fR(e)?ne(BigInt(e.split(".")[0])):mR(e)?ne(BigInt(e)):g(t,"false")?ne(BigInt(0)):g(t,"true")?ne(BigInt(1)):void 0}function Ld(e){return st(e)?ne(e):xt(e)?cR(e):Ie(e)?ne(BigInt(Math.trunc(e))):Xt(e)?ne(BigInt(0)):pe(e)?hR(e):Fe(e)?ne(BigInt(0)):void 0}function gR(e){return g(e,BigInt(0))?ne(!1):g(e,BigInt(1))?ne(!0):void 0}function bR(e){return g(e,0)?ne(!1):g(e,1)?ne(!0):void 0}function kR(e){return g(e.toLowerCase(),"false")?ne(!1):g(e.toLowerCase(),"true")?ne(!0):g(e,"0")?ne(!1):g(e,"1")?ne(!0):void 0}function Sx(e){return st(e)?gR(e):xt(e)?ne(e):Ie(e)?bR(e):Xt(e)?ne(!1):pe(e)?kR(e):Fe(e)?ne(!1):void 0}function xR(e){return g(e,BigInt(0))?ne(null):void 0}function yR(e){return g(e,!1)?ne(null):void 0}function wR(e){return g(e,0)?ne(null):void 0}function vR(e){const t=e.toLowerCase();return g(t,"undefined")||g(t,"null")||g(e,"")||g(e,"0")?ne(null):void 0}function SR(e){return st(e)?xR(e):xt(e)?yR(e):Ie(e)?wR(e):Xt(e)?ne(null):pe(e)?vR(e):Fe(e)?ne(null):void 0}const jx=BigInt(Number.MAX_SAFE_INTEGER),Ix=BigInt(Number.MIN_SAFE_INTEGER);function jR(e){return e<=jx&&e>=Ix?ne(Number(e)):void 0}function IR(e){return ne(e?1:0)}function CR(e){const t=+e;if(Ie(t))return ne(t);const n=e.toLowerCase();if(g(n,"false"))return ne(0);if(g(n,"true"))return ne(1);const r=Ld(e);return fn(r)&&r.value<=jx&&r.value>=Ix?ne(Number(r.value)):void 0}function Dd(e){return st(e)?jR(e):xt(e)?IR(e):Ie(e)?ne(e):Xt(e)?ne(0):pe(e)?CR(e):Fe(e)?ne(0):void 0}function Cx(e){return st(e)||xt(e)||Ie(e)?ne(e.toString()):Xt(e)?ne("null"):pe(e)?ne(e):Fe(e)?ne(""):void 0}function ER(e){return g(e,BigInt(0))?ne(void 0):void 0}function TR(e){return g(e,!1)?ne(void 0):void 0}function AR(e){return g(e,0)?ne(void 0):void 0}function PR(e){const t=e.toLowerCase();return g(t,"undefined")||g(t,"null")||g(e,"")||g(e,"0")?ne(void 0):void 0}function Ex(e){return st(e)?ER(e):xt(e)?TR(e):Ie(e)?AR(e):Xt(e)?ne(void 0):pe(e)?PR(e):Fe(e)?ne(e):void 0}function NR(e,t,n){return aR(n).value.map(s=>In(e,t.items,s))}function OR(e,t,n){const r=Ld(n);return fn(r)?r.value:n}function RR(e,t,n){const r=Sx(n);return fn(r)?r.value:n}function MR(e,t,n){return In({...e,...t.$defs},gn(t.$ref),n)}function $R(e,t,n){return In(e,Kn(t),n)}function FR(e,t,n){const r=Dd(n);return fn(r)?Math.trunc(r.value):n}function LR(e,t,n){const r=Bs(e,t),s=Kn(r);return In(e,s,n)}function DR(e,t,n){const r=Ld(n);return fn(r)&&g(t.const,r.value)?r.value:n}function _R(e,t,n){const r=Sx(n);return fn(r)&&g(t.const,r.value)?r.value:n}function UR(e,t,n){const r=Dd(n);return fn(r)&&g(t.const,r.value)?r.value:n}function BR(e,t,n){const r=Cx(n);return fn(r)&&g(t.const,r.value)?r.value:n}function HR(e,t,n){return g(t.const,n)?n:Yv(t)?DR(e,t,n):Zv(t)?_R(e,t,n):Nf(t)?UR(e,t,n):Of(t)?BR(e,t,n):Ft()}function qR(e,t,n){const r=SR(n);return fn(r)?r.value:n}function zR(e,t,n){const r=Dd(n);return fn(r)?r.value:n}function Tx(e,t,n,r){const s=U(r);for(const[i,o]of t)for(const d of s)i.test(d)||(r[d]=In(e,n,r[d]));return r}function _d(e,t,n){return an(e)&&Fe(n[t])}function KR(e,t,n){const r=rl(t.properties),s=U(n);for(const[i,o]of r)for(const d of s)!i.test(d)||_d(o,d,n)||(n[d]=In(e,o,n[d]));return E(t,"additionalProperties")&&re(t.additionalProperties)?Tx(e,r,t.additionalProperties,n):n}function GR(e,t,n){return kn(n)?KR(e,t,n):n}function VR(e,t,n){const r=rl(t.patternProperties),s=U(n);for(const[i,o]of r)for(const d of s)i.test(d)&&(n[d]=In(e,o,n[d]));return E(t,"additionalProperties")&&re(t.additionalProperties)?Tx(e,r,t.additionalProperties,n):n}function WR(e,t,n){return kn(n)?VR(e,t,n):n}function JR(e,t,n){return E(e,t.$ref)?In(e,e[t.$ref],n):n}function QR(e,t,n){const r=Cx(n);return fn(r)?r.value:n}function YR(e,t,n){return In(e,Kn(t),n)}function ZR(e,t,n){if(!q(n))return n;for(let r=0;r<Math.min(t.items.length,n.length);r++)n[r]=In(e,t.items[r],n[r]);return n}function XR(e,t,n){const r=Ex(n);return fn(r)?r.value:n}function eM(e,t,n){if(t.anyOf.some(o=>ot(e,o,n)))return n;const i=t.anyOf.map(o=>In(e,o,zt(n))).find(o=>ot(e,t,o));return Fe(i)?n:i}function tM(e,t,n){const r=Ex(n);return fn(r)?void 0:n}function In(e,t,n){return gt(t)?NR(e,t,n):is(t)?OR(e,t,n):Cr(t)?RR(e,t,n):Gt(t)?MR(e,t,n):vn(t)?$R(e,t,n):qn(t)?FR(e,t,n):Be(t)?LR(e,t,n):Qe(t)?HR(e,t,n):Oi(t)?qR(e,t,n):un(t)?zR(e,t,n):Ue(t)?GR(e,t,n):Ot(t)?WR(e,t,n):vt(t)?JR(e,t,n):Fn(t)?QR(e,t,n):Wt(t)?YR(e,t,n):at(t)?ZR(e,t,n):_s(t)?XR(e,t,n):fe(t)?eM(e,t,n):os(t)?tM(e,t,n):n}function Ma(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return In(t,n,r)}function nM(e,t,n){if(!q(n))return n;for(let r=0;r<n.length;r++)n[r]=On(e,t.items,n[r]);return n}function rM(e,t,n){return On({...e,...t.$defs},gn(t.$ref),n)}function sM(e,t){return Fe(t)?Tn(e.default)?e.default():zt(e.default):t}function iM(e,t,n){const r=Bs(e,t),s=Kn(r);return On(e,s,n)}function oM(e,t,n){if(!re(n))return n;const r=U(t.properties);for(const s of r){const i=On(e,t.properties[s],n[s]);Fe(i)&&(an(t.properties[s])||!E(t.properties[s],"default"))||(n[s]=i)}if(!lr(t)||xt(t.additionalProperties))return n;for(const s of U(n))r.includes(s)||(n[s]=On(e,t.additionalProperties,n[s]));return n}function aM(e,t,n){if(!re(n))return n;const[r,s]=[new RegExp(jn(t)),Vt(t)];for(const i of U(n))r.test(i)&&Ar(s)&&(n[i]=On(e,s,n[i]));if(!lr(t))return n;for(const i of U(n))r.test(i)||(n[i]=On(e,t.additionalProperties,n[i]));return n}function cM(e,t,n){return E(e,t.$ref)?On(e,e[t.$ref],n):n}function lM(e,t,n){if(!q(n))return n;const[r,s]=[t.items,Math.max(t.items.length,n.length)];for(let i=0;i<s;i++)i<r.length&&(n[i]=On(e,r[i],n[i]));return n}function dM(e,t,n){for(const r of t.anyOf){const s=On(e,r,zt(n));if(ot(e,r,s))return s}return n}function On(e,t,n){const r=Ar(t)?sM(t,n):n;return gt(t)?nM(e,t,r):Gt(t)?rM(e,t,r):Be(t)?iM(e,t,r):Ue(t)?oM(e,t,r):Ot(t)?aM(e,t,r):vt(t)?cM(e,t,r):at(t)?lM(e,t,r):fe(t)?dM(e,t,r):r}function Ud(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return On(t,n,r)}function Ax(e){return(...t)=>{const[n,r,s]=ut(t,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]});return e.reduce((i,o)=>o(n,r,i),s)}}function uM(e,t,n){return t["~codec"].decode(n)}function pM(e,t,n){return t["~codec"].encode(n)}function Et(e,t,n,r){return ln(n)?g(e,"Decode")?uM(t,n,r):pM(t,n,r):r}function fM(e,t,n,r){if(!q(r))return r;for(let s=0;s<r.length;s++)r[s]=Bt(e,t,n.items,r[s]);return Et(e,t,n,r)}function mM(e,t,n,r){const s=Et(e,t,n,r);if(!q(s))return s;for(let i=0;i<s.length;i++)s[i]=Bt(e,t,n.items,s[i]);return s}function hM(e,t,n,r){return g(e,"Decode")?fM(e,t,n,r):mM(e,t,n,r)}function gM(e,t,n,r){return r=Bt(e,{...t,...n.$defs},gn(n.$ref),r),Et(e,t,n,r)}function Px(e){return e.reduce((t,n)=>({...t,...n}),{})}function Nx(e,t){for(const n of t)if(!ns(e,n))return n;return e}function bM(e,t,n,r){if(g(n.allOf.length,0))return Et(e,t,n,r);const s=n.allOf.map(d=>Bt(e,t,d,ao(d,zt(r)))),o=s.every(d=>re(d))?Px(s):Nx(r,s);return Et(e,t,n,o)}function kM(e,t,n,r){if(g(n.allOf.length,0))return Et(e,t,n,r);const s=Et(e,t,n,r),i=n.allOf.map(d=>Bt(e,t,d,ao(d,zt(s))));return i.every(d=>re(d))?Px(i):Nx(s,i)}function xM(e,t,n,r){return g(e,"Decode")?bM(e,t,n,r):kM(e,t,n,r)}function yM(e,t,n,r){if(!kn(r))return r;for(const s of U(n.properties))!E(r,s)||_d(n.properties[s],s,r)||(r[s]=Bt(e,t,n.properties[s],r[s]));return Et(e,t,n,r)}function wM(e,t,n,r){const s=Et(e,t,n,r);if(!kn(s))return s;for(const i of U(n.properties))!E(s,i)||_d(n.properties[i],i,s)||(s[i]=Bt(e,t,n.properties[i],s[i]));return s}function vM(e,t,n,r){return g(e,"Decode")?yM(e,t,n,r):wM(e,t,n,r)}function SM(e,t,n,r){if(!kn(r))return r;const s=new RegExp(jn(n));for(const i of U(r))s.test(i)&&(r[i]=Bt(e,t,Vt(n),r[i]));return Et(e,t,n,r)}function jM(e,t,n,r){const s=Et(e,t,n,r);if(!kn(s))return s;const i=new RegExp(jn(n));for(const o of U(s))i.test(o)&&(s[o]=Bt(e,t,Vt(n),s[o]));return s}function IM(e,t,n,r){return g(e,"Decode")?SM(e,t,n,r):jM(e,t,n,r)}function Ku(e,t,n,r){return E(t,n.$ref)?Bt(e,t,t[n.$ref],r):r}function CM(e,t,n,r){return g(e,"Decode")?Et(e,t,n,Ku(e,t,n,r)):Ku(e,t,n,Et(e,t,n,r))}function EM(e,t,n,r){if(!q(r))return r;for(let s=0;s<Math.min(n.items.length,r.length);s++)r[s]=Bt(e,t,n.items[s],r[s]);return Et(e,t,n,r)}function TM(e,t,n,r){const s=Et(e,t,n,r);if(!q(s))return r;for(let i=0;i<Math.min(n.items.length,s.length);i++)s[i]=Bt(e,t,n.items[i],s[i]);return s}function AM(e,t,n,r){return g(e,"Decode")?EM(e,t,n,r):TM(e,t,n,r)}function PM(e,t,n,r){for(const s of n.anyOf){if(!ot(t,s,r))continue;const i=Bt(e,t,s,r);return Et(e,t,n,i)}return r}function NM(e,t,n,r){const s=Et(e,t,n,r);for(const i of n.anyOf){const o=Bt(e,t,i,zt(s));if(ot(t,i,o))return o}return s}function OM(e,t,n,r){return g(e,"Decode")?PM(e,t,n,r):NM(e,t,n,r)}function Bt(e,t,n,r){return gt(n)?hM(e,t,n,r):Gt(n)?gM(e,t,n,r):Be(n)?xM(e,t,n,r):Ue(n)?vM(e,t,n,r):Ot(n)?IM(e,t,n,r):vt(n)?CM(e,t,n,r):at(n)?AM(e,t,n,r):fe(n)?OM(e,t,n,r):Et(e,t,n,r)}class RM extends Ra{constructor(t,n){super("Decode",t,n)}}function MM(e,t,n){if(!ot(e,t,n))throw new RM(n,oo(e,t,n));return n}function $M(e,t,n){const r=Fd(t);return Bt("Decode",e,r,n)}const FM=Ax([(e,t,n)=>zt(n),(e,t,n)=>Ud(e,t,n),(e,t,n)=>Ma(e,t,n),(e,t,n)=>ao(e,t,n),(e,t,n)=>MM(e,t,n),(e,t,n)=>$M(e,t,n)]);function LM(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return FM(t,n,r)}class DM extends Ra{constructor(t,n){super("Encode",t,n)}}function _M(e,t,n){if(!ot(e,t,n))throw new DM(n,oo(e,t,n));return n}function UM(e,t,n){const r=Fd(t);return Bt("Encode",e,r,n)}const BM=Ax([(e,t,n)=>zt(n),(e,t,n)=>UM(e,t,n),(e,t,n)=>Ud(e,t,n),(e,t,n)=>Ma(e,t,n),(e,t,n)=>ao(e,t,n),(e,t,n)=>_M(e,t,n)]);function HM(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return BM(t,n,r)}function qM(e,t){return ln(t)||$r(e,t.items)}function zM(e,t){return ln(t)||Ox({...e,...t.$defs},gn(t.$ref))}function KM(e,t){return ln(t)||t.allOf.some(n=>$r(e,n))}function GM(e,t){return ln(t)||U(t.properties).some(n=>$r(e,t.properties[n]))}function VM(e,t){return ln(t)||$r(e,Vt(t))}function Ox(e,t){return Mc.has(t.$ref)?!1:(Mc.add(t.$ref),ln(t)||E(e,t.$ref)&&$r(e,e[t.$ref]))}function WM(e,t){return ln(t)||t.items.some(n=>$r(e,n))}function JM(e,t){return ln(t)||t.anyOf.some(n=>$r(e,n))}function $r(e,t){return gt(t)?qM(e,t):Gt(t)?zM(e,t):Be(t)?KM(e,t):Ue(t)?GM(e,t):Ot(t)?VM(e,t):vt(t)?Ox(e,t):at(t)?WM(e,t):fe(t)?JM(e,t):ln(t)}const Mc=new Set;function QM(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s],1:r=>[{},r]});return Mc.clear(),$r(t,n)}class co extends Error{constructor(t,n){super(n),this.type=t}}function YM(e,t){return Tn(t.default)?t.default(t):re(t.default)?zt(t.default):t.default}function ZM(e,t){if(jr(t)&&!Ar(t))throw new co(t,"Arrays with uniqueItems constraints must specify a default annotation");const n=ps(t)?t.minItems:0;return Array.from({length:n},()=>Cn(e,t.items))}function XM(e,t){return Pr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Or(t)?BigInt(t.minimum):BigInt(0)}function e$(e,t){return!1}function t$(e,t){const n=Cn(e,t.instanceType);return class{constructor(){Object.assign(this,n)}}}function n$(e,t){return Cn({...e,...t.$defs},gn(t.$ref))}function r$(e,t){return Cn(e,Kn(t))}function s$(e,t){const n=Cn(e,t.returnType);return()=>n}function i$(e,t){return Pr(t)&&Ie(t.exclusiveMinimum)?t.exclusiveMinimum+1:Or(t)?t.minimum:0}function o$(e,t){const n=Bs(e,t),r=Kn(n);return Cn(e,r)}function a$(e,t){return t.const}function c$(e,t){throw new co(t,"Cannot create TNever types")}function l$(e,t){return null}function d$(e,t){return Pr(t)&&Ie(t.exclusiveMinimum)?t.exclusiveMinimum+1:Or(t)?t.minimum:0}function u$(e,t){return(Fe(t.required)?[]:t.required).reduce((r,s)=>({...r,[s]:Cn(e,t.properties[s])}),{})}function p$(e,t){if(Ks(t)&&!Ar(t))throw new co(t,"Record with the minProperties constraint must have a default annotation");return{}}function f$(e,t){return E(e,t.$ref)?Cn(e,e[t.$ref]):(()=>{throw new co(t,"Unable to deref Ref")})()}function m$(e,t){if((Gs(t)||Hs(t))&&!Ar(t))throw Error("Strings with format or pattern constraints must specify default");const r=zs(t)?t.minLength:0;return"".padEnd(r)}function h$(e,t){return Symbol()}function g$(e,t){const n=yl(t.pattern);if(Fn(n))throw new co(t,"Unable to create TemplateLiteral due to infinite type expansion");return Cn(e,n)}function b$(e,t){return Array.from({length:t.minItems},(n,r)=>Cn(e,t.items[r]))}function k$(e,t){if(g(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return Cn(e,t.anyOf[0])}function Cn(e,t){return Ar(t)?YM(e,t):gt(t)?ZM(e,t):is(t)?XM(e,t):Cr(t)?e$():xn(t)?t$(e,t):Gt(t)?n$(e,t):vn(t)?r$(e,t):yn(t)?s$(e,t):qn(t)?i$(e,t):Be(t)?o$(e,t):Qe(t)?a$(e,t):Fs(t)?c$(e,t):Oi(t)?l$():un(t)?d$(e,t):Ue(t)?u$(e,t):Ot(t)?p$(e,t):vt(t)?f$(e,t):Fn(t)?m$(e,t):Ri(t)?h$():Wt(t)?g$(e,t):at(t)?b$(e,t):_s(t)?void 0:fe(t)?k$(e,t):os(t)?void 0:void 0}function Rn(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s],1:r=>[{},r]});return Cn(t,n)}function Rx(e,t){return ns(e,t)}function Mx(e){return oa(e)}class x$ extends Ra{constructor(t,n){super("Parse",t,n)}}function y$(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]});if(ot(t,n,r))return r;throw new x$(r,oo(t,n,r))}function $a(e,t){return{type:"update",path:e,value:t}}function $x(e,t){return{type:"insert",path:e,value:t}}function Fx(e){return{type:"delete",path:e}}function Gu(e){if(!(re(e)&&g(sl(e).length,0)))throw new Error("Cannot create diffs for objects with symbols keys")}function*w$(e,t,n){if(!re(n)||q(n))return yield $a(e,n);Gu(t),Gu(n);const r=U(t),s=U(n);for(const i of s)E(t,i)||er(i)||(yield $x(`${e}/${i}`,n[i]));for(const i of r)E(n,i)&&(er(i)||Rx(t,n)||(yield*Fa(`${e}/${i}`,t[i],n[i])));for(const i of r)E(n,i)||er(i)||(yield Fx(`${e}/${i}`))}function*v$(e,t,n){if(!q(n))return yield $a(e,n);for(let r=0;r<Math.min(t.length,n.length);r++)yield*Fa(`${e}/${r}`,t[r],n[r]);for(let r=0;r<n.length;r++)r<t.length||(yield $x(`${e}/${r}`,n[r]));for(let r=t.length-1;r>=0;r--)r<n.length||(yield Fx(`${e}/${r}`))}function*S$(e,t,n){const r=globalThis.Object.getPrototypeOf(t).constructor.name,s=globalThis.Object.getPrototypeOf(n).constructor.name;if(Ci(n)&&g(t.length,n.length)&&g(r,s))for(let o=0;o<Math.min(t.length,n.length);o++)yield*Fa(`${e}/${o}`,t[o],n[o]);else return yield $a(e,n)}function*j$(e,t,n){t!==n&&(yield $a(e,n))}function*Fa(e,t,n){return Ci(t)?yield*S$(e,t,n):q(t)?yield*v$(e,t,n):re(t)?yield*w$(e,t,n):yield*j$(e,t,n)}function I$(e,t){return[...Fa("",e,t)]}const C$=Me({type:De("insert"),path:zn(),value:Kt()}),E$=Object({type:De("update"),path:zn(),value:Kt()}),T$=Me({type:De("delete"),path:zn()});Je([C$,E$,T$]);function A$(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function P$(e){return e.length===0}function N$(e,t){if(A$(t))return zt(t[0].value);if(P$(t))return zt(e);const n=zt(e);for(const r of t)switch(r.type){case"insert":{Oc(n,r.path,r.value);break}case"update":{Oc(n,r.path,r.value);break}case"delete":{lx(n,r.path);break}}return n}class La extends Error{constructor(t,n,r,s){super(s),this.context=t,this.type=n,this.value=r}}function O$(e){const[t,n]=[new Set,[]];for(const r of e){const s=Mx(r);t.has(s)||(t.add(s),n.push(r))}return n}function R$(e,t,n){if(ot(e,t,n))return n;const r=q(n)?n:Rn(e,t),s=ps(t)&&r.length<t.minItems?[...r,...Array.from({length:t.minItems-r.length},()=>Rn(e,t))]:r,o=(qs(t)&&s.length>t.maxItems?s.slice(0,t.maxItems):s).map(f=>bn(e,t.items,f));if(!jr(t)||jr(t)&&!g(t.uniqueItems,!0))return o;const d=O$(o);if(!ot(e,t,d))throw new La(e,t,n,"Failed to repair Array due to uniqueItems constraint");return d}function M$(e,t,n){return bn(e,Kn(t),n)}function $$(e,t,n){const r=Bs(e,t),s=Kn(r);return bn(e,s,n)}function F$(e,t,n){if(ot(e,t,n))return n;if(!kn(n))return Rn(e,t);const r=new Set(Fe(t.required)?[]:t.required),s={};for(const[o,d]of it(t.properties))!r.has(o)&&Fe(n[o])||(s[o]=o in n?bn(e,d,n[o]):Rn(e,d));const i=U(t.properties);if(lr(t)&&re(t.additionalProperties))for(const o of U(n))i.includes(o)||(s[o]=bn(e,t.additionalProperties,n[o]));return s}function L$(e,t,n){if(ot(e,t,n))return n;if(Xt(n)||!re(n)||q(n))return Rn(e,t);const r=new RegExp(jn(t)),s=Vt(t),i=new Set,o={};for(const[d,f]of it(n))r.test(d)&&(o[d]=bn(e,s,f),i.add(d));if(lr(t))for(const d of U(n))i.has(d)||(o[d]=bn(e,t.additionalProperties,n[d]));return o}function D$(e,t,n){return E(e,t.$ref)?bn(e,e[t.$ref],n):(()=>{throw new La(e,t,n,"Unable to de-reference target type")})()}function _$(e,t,n){const r=yl(t.pattern);return bn(e,r,n)}function U$(e,t,n){return ot(e,t,n)?n:q(n)?t.items.map((r,s)=>bn(e,r,n[s])):Rn(e,t)}function Lx(e,t,n){return vt(t)?E(e,t.$ref)?Lx(e,e[t.$ref]):(()=>{throw new Error("Unable to Deref target")})():t}function B$(e,t,n){if(!(Ue(t)&&re(n)))return 0;const r=U(n);return it(t.properties).reduce((i,[o,d])=>{const f=Qe(d)&&g(d.const,n[o])?100:0,u=ot(e,d,n[o])?10:0,m=r.includes(o)?1:0;return i+(f+u+m)},0)}function H$(e,t,n){const r=t.anyOf.map(o=>Lx(e,o));let[s,i]=[r[0],0];for(const o of r){const d=B$(e,o,n);d>i&&(s=o,i=d)}return s}function q$(e,t,n){const r=Je(ca(t.anyOf)),s=H$(e,r,n);return bn(e,s,n)}function z$(e,t,n){return ot(e,t,n)?zt(n):Ar(t)?Rn(e,t):q$(e,t,n)}function K$(e,t,n){if(ot(e,t,n))return n;const r=Ma(e,t,n);return ot(e,t,r)?r:Rn(e,t)}function G$(e,t,n){if(mf(n)||gf(n)||hf(n)||Ci(n)||na(n)||Tn(n))throw new La(e,t,n,"Value is not repairable")}function V$(e,t,n){if(xn(t)||yn(t)||Fs(t))throw new La(e,t,n,"Type is not repairable")}function W$(e,t,n){return Fe(n)&&!_s(t)?Rn(e,t):n}function J$(e,t,n){return gl(t)?ot(e,t,n)?n:Rn(e,t):n}function bn(e,t,n){G$(e,t,n),V$(e,t,n);const r=W$(e,t,n),s=gt(t)?R$(e,t,r):vn(t)?M$(e,t,r):Be(t)?$$(e,t,r):Ue(t)?F$(e,t,r):Ot(t)?L$(e,t,r):vt(t)?D$(e,t,r):Wt(t)?_$(e,t,r):at(t)?U$(e,t,r):fe(t)?z$(e,t,r):K$(e,t,r);return J$(e,t,s)}function Q$(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]}),s=bn(t,n,r);return wx(t,n,s),s}const Za=Object.freeze(Object.defineProperty({__proto__:null,Assert:wx,Check:ot,Clean:ao,Clone:zt,Convert:Ma,Create:Rn,Decode:LM,Default:Ud,Diff:I$,Encode:HM,Equal:Rx,Errors:oo,HasCodec:QM,Hash:Mx,Parse:y$,Patch:N$,Pointer:dx,Repair:Q$},Symbol.toStringTag,{value:"Module"}));class Vu extends Error{constructor(t){super(t.map(n=>`${n.path.length>0?n.path.join("."):"root"}: ${n.message}`).join("; ")),this.issues=t,this.name="SchemaValidationError"}}function Y$(e){return e?e.split("/").slice(1).map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~")).map(t=>/^(0|[1-9]\d*)$/.test(t)?Number(t):t):[]}function Z$(e,t){let n=e;for(const r of t){if(n===null||typeof n!="object")return;n=n[r]}return n}function Wu(e,t){const[,n]=WO.Errors(e,t);return n.map(r=>{const s=Y$(r.instancePath);return{code:r.keyword,path:s,message:r.message,value:Z$(t,s)}})}function Dx(e,t){const n=Za.Default(e,Za.Clone(t)),r=Wu(e,n);if(r.length>0)return{success:!1,error:new Vu(r)};const s=Za.Clean(e,n),i=Wu(e,s);return i.length>0?{success:!1,error:new Vu(i)}:{success:!0,data:s}}function Qn(e,t){const n=Dx(e,t);if(!n.success)throw n.error;return n.data}function z(e){return Object.defineProperties(e,{parse:{value:t=>Qn(e,t),enumerable:!1},safeParse:{value:t=>Dx(e,t),enumerable:!1}}),e}function En(e,t){return c.Optional({...e,default:t})}function be(e,t={}){return c.Unsafe({type:"string",enum:[...e],...t})}const zr=20,hi=5*1024*1024,X$=1e6,eF=16*1024;function tF(e){const t=/^\s*\/btw(?:\s+([\s\S]*))?\s*$/iu.exec(e);if(t)return{question:(t[1]??"").trim()}}const gs=z(be(["default","autoEdit","yolo","plan"])),kr={DEFAULT:"default",AUTO_EDIT:"autoEdit",YOLO:"yolo",PLAN:"plan"},Bd=z(be(["user","assistant","system","tool"])),nF=z(c.Union([c.Object({type:c.Literal("text"),text:c.String()}),c.Object({type:c.Literal("image_url"),image_url:c.Object({url:c.String()})})])),_x=c.Union([c.String(),c.Array(nF)]);z(c.Object({id:c.String(),role:Bd,content:_x,timestamp:c.Number(),metadata:c.Optional(c.Record(c.String(),c.Unknown())),thinkingContent:c.Optional(c.String()),tool_call_id:c.Optional(c.String()),name:c.Optional(c.String()),tool_calls:c.Optional(c.Unknown())}));const rF=z(be(["queued","running","completed","failed","cancelled","interrupted"])),lo=z(be(["local","worktree"])),Hd=z(be(["high","medium","low"])),qd=z(be(["feature","bug","maintenance","research"])),sF=z(be(["applied","discarded","conflicted"])),iF=z(c.Object({status:sF,updatedAt:c.String(),sourceCommit:c.Optional(c.String()),changedFiles:c.Optional(c.Integer({minimum:0})),message:c.Optional(c.String())})),oF=z(c.Object({changedFiles:c.Integer({minimum:0}),additions:c.Integer({minimum:0}),deletions:c.Integer({minimum:0}),commits:c.Integer({minimum:0})})),aF=z(c.Object({path:c.String({minLength:1}),patch:c.String({maxLength:2*1024*1024}),additions:c.Integer({minimum:0}),deletions:c.Integer({minimum:0}),binary:c.Boolean(),truncated:c.Boolean()})),cF=z(c.Object({sessionId:c.String(),projectPath:c.String(),baseCommit:c.String(),files:c.Array(aF,{maxItems:100}),truncated:c.Boolean()})),lF=c.Union([c.String(),c.Number(),c.Boolean(),c.Array(c.String())]),dF=z(c.Object({name:c.String(),type:be(["string","number","integer","boolean","select","multi-select"]),title:c.String(),description:c.Optional(c.String()),required:c.Boolean(),defaultValue:c.Optional(lF),options:c.Optional(c.Array(c.Object({value:c.String(),label:c.String()}))),format:c.Optional(be(["date","uri","email","date-time"])),minimum:c.Optional(c.Number()),maximum:c.Optional(c.Number()),minLength:c.Optional(c.Number()),maxLength:c.Optional(c.Number()),minItems:c.Optional(c.Number()),maxItems:c.Optional(c.Number())}));z(c.Object({serverName:c.String(),mode:be(["form","url"]),message:c.String(),fields:c.Optional(c.Array(dF)),requestedSchema:c.Optional(c.Record(c.String(),c.Unknown())),url:c.Optional(c.String()),domain:c.Optional(c.String()),elicitationId:c.Optional(c.String())}));const uF=z(c.Object({type:be(["permission","question","elicitation"]),requestId:c.String()})),pF=z(c.Object({code:be(["authentication","permission","rate_limit","timeout","network","model_unavailable","context_limit","unsupported_input","capacity","runtime"]),message:c.String({minLength:1,maxLength:500}),retryable:c.Boolean(),resource:c.Optional(be(["pending_count","pending_bytes","resident_runtimes"]))})),Qs=z(be(["auto","off","minimal","low","medium","high","xhigh","max"])),Ys=z(be(["auto","standard","fast","flex"])),Zs=z(be(["auto","low","medium","high"])),Fr=z(c.Union([be(["auto","pragmatic","friendly","explanatory"]),c.String({minLength:7,maxLength:300,pattern:"^(?:(?:user|project):[a-z0-9][a-z0-9._-]{0,63}(?::[a-z0-9][a-z0-9._-]{0,63}){0,3}|plugin:[a-z0-9][a-z0-9._-]{0,63}:[a-z0-9][a-z0-9._-]{0,63}(?::[a-z0-9][a-z0-9._-]{0,63}){0,3})$"})])),Un=z(c.Object({sessionId:c.String(),projectPath:c.String(),title:c.Optional(c.String()),gitBranch:c.Optional(c.String()),rootId:c.String(),parentId:c.Optional(c.String()),relationType:c.Optional(be(["subagent","fork"])),resumedFrom:c.Optional(c.String()),rootAgentId:c.Optional(c.String()),resumeDepth:c.Optional(c.Integer({minimum:0})),taskStatus:En(rF,"completed"),taskStatusReason:c.Optional(c.String()),taskFailure:c.Optional(pF),taskStartedAt:c.Optional(c.String()),taskCompletedAt:c.Optional(c.String()),taskPromptSummary:c.Optional(c.String()),taskPriority:c.Optional(Hd),taskKind:c.Optional(qd),taskDueAt:c.Optional(c.String()),taskModelId:c.Optional(c.String()),selectedModelId:c.Optional(c.String()),permissionMode:c.Optional(gs),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),communicationStyleDigest:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"})),projectInstructionsDigest:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"})),taskRetryAvailable:c.Optional(c.Boolean()),taskRetriedFrom:c.Optional(c.Object({sessionId:c.String(),projectPath:c.String()})),taskDelivery:c.Optional(iF),taskIsolation:c.Optional(lo),taskSourceProjectPath:c.Optional(c.String()),taskWorktreePath:c.Optional(c.String()),taskWorktreeBranch:c.Optional(c.String()),taskBaseCommit:c.Optional(c.String()),taskDiffStat:c.Optional(oF),taskQueuePosition:c.Optional(c.Integer({minimum:1})),taskQueueDepth:c.Optional(c.Integer({minimum:0})),taskConcurrencyLimit:c.Optional(c.Integer({minimum:1})),archivedAt:c.Optional(c.String()),archivedBySessionId:c.Optional(c.String()),pendingInteraction:c.Optional(uF),messageCount:c.Number(),firstMessageTime:c.String(),lastMessageTime:c.String(),hasErrors:c.Boolean()})),fF=z(c.Object({sessions:c.Array(Un),nextCursor:c.Optional(c.String())})),mF=z(c.Object({session:Un,archivedSessionIds:c.Array(c.String())})),hF=z(c.Object({session:Un,restoredSessionIds:c.Array(c.String())}));z(c.Object({version:c.Literal(1),sessionId:c.String(),goalId:c.String(),objective:c.String(),status:be(["active","verifying","paused","blocked","usage_limited","budget_limited","complete"]),tokenBudget:c.Optional(c.Number()),tokensUsed:c.Number(),timeUsedSeconds:c.Number(),continuationCount:c.Number(),statusReason:c.Optional(c.String()),completionVerification:c.Optional(c.Object({attempt:c.Integer({minimum:1}),status:be(["pending","pass","fail","partial"]),requestedAt:c.String(),completedAt:c.Optional(c.String()),verifierSessionId:c.Optional(c.String()),summary:c.Optional(c.String()),evidenceSha256:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"}))})),prematureStop:c.Optional(c.Object({pattern:c.Unsafe({type:"string"}),consecutiveCount:c.Integer({minimum:1}),detectedAt:c.String()})),verificationStall:c.Optional(c.Unsafe({type:"object"})),createdAt:c.String(),updatedAt:c.String()}));const zd=z(c.Object({role:Bd,content:_x,metadata:c.Optional(c.Unknown()),reasoningContent:c.Optional(c.String()),thinkingContent:c.Optional(c.String()),tool_call_id:c.Optional(c.String()),name:c.Optional(c.String()),tool_calls:c.Optional(c.Unknown())})),gF=z(c.Object({session:Un,messages:c.Array(zd)})),Ux=z(be(["conversation","code","both"])),Bx=z(c.Object({messageId:c.String(),preview:c.String(),createdAt:c.String(),fileCount:c.Integer({minimum:0})}));z(c.Object({targetMessageId:c.String({minLength:1}),mode:En(Ux,"conversation")}));const bF=z(c.Object({checkpoint:Bx,mode:Ux,removedTurns:c.Integer({minimum:1}),restoredFiles:c.Array(c.String()),messages:c.Array(zd)})),kF=be(["running","completed","failed","cancelled"]),$c=z(c.Object({id:c.String(),subagentType:c.String(),description:c.String(),status:kF,background:c.Boolean(),rootAgentId:c.String(),resumedFrom:c.Optional(c.String()),resumeDepth:c.Integer({minimum:0}),createdAt:c.Number(),lastActiveAt:c.Number(),completedAt:c.Optional(c.Number()),restartRecovery:c.Optional(c.Object({outcome:be(["completed","interrupted","failed"]),recoveredAt:c.Number()})),result:c.Optional(c.Object({success:c.Boolean(),message:c.String(),error:c.Optional(c.String()),verificationCommands:c.Optional(c.Array(c.String())),verificationVerdict:c.Optional(be(["pass","fail","partial"])),modifiedFiles:c.Optional(c.Array(c.String()))})),stats:c.Optional(c.Object({tokens:c.Optional(c.Number()),toolCalls:c.Optional(c.Number()),duration:c.Optional(c.Number())}))}));z(c.Object({prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"})}));const xF=z(c.Object({source:$c,session:$c})),Hx=z(c.Object({sessionId:c.String(),projectPath:c.String()})),qx=z(c.Object({path:c.String(),name:c.String(),gitBranch:c.Optional(c.String()),available:c.Boolean(),isCurrent:c.Boolean(),boundAt:c.String()})),yF=z(c.Union([c.Object({cancelled:c.Literal(!0)}),c.Object({cancelled:c.Literal(!1),path:c.String({minLength:1})})])),Ju=z(c.Object({type:c.String(),seq:c.Optional(c.Number()),properties:c.Record(c.String(),c.Unknown())})),zx=c.Object({type:be(["file","image","url"]),path:c.Optional(c.String()),url:c.Optional(c.String()),content:c.Optional(c.String({maxLength:hi})),mimeType:c.Optional(c.String()),name:c.Optional(c.String())}),Kx=c.Record(c.String(),c.Unknown());z(c.Object({prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"}),title:c.Optional(c.String({minLength:1,maxLength:200})),taskPriority:En(Hd,"medium"),taskKind:En(qd,"feature"),taskDueAt:c.Optional(c.String({minLength:1,maxLength:64})),projectPath:c.Optional(c.String()),modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:En(lo,"worktree"),permissionMode:En(gs,"default"),attachments:c.Optional(c.Array(zx,{maxItems:zr})),outputSchema:c.Optional(Kx)}));z(c.Object({title:c.Optional(c.String({minLength:1,maxLength:200})),taskPriority:c.Optional(Hd),taskKind:c.Optional(qd),taskDueAt:c.Optional(c.Union([c.String({minLength:1,maxLength:64}),c.Null()]))}));const Qu=z(c.Object({session:Un,runId:c.String(),messageId:c.String(),status:be(["queued","running"]),queuePosition:c.Optional(c.Integer({minimum:1})),queueDepth:c.Optional(c.Integer({minimum:0})),maxConcurrentTasks:c.Optional(c.Integer({minimum:1}))}));z(c.Object({action:be(["apply","discard"])}));const Kd=z(c.Object({kind:be(["cron","interval","once"]),cron:c.Optional(c.String({minLength:1,maxLength:120})),intervalMs:c.Optional(c.Integer({minimum:6e4})),runAt:c.Optional(c.String({minLength:1,maxLength:40})),timezone:c.Optional(c.String({minLength:1,maxLength:80}))})),wF=z(c.Object({modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:En(lo,"worktree"),permissionMode:En(gs,"default")})),Cs=z(c.Object({id:c.String(),title:c.Optional(c.String({minLength:1,maxLength:200})),prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"}),projectPath:c.String({minLength:1}),trigger:Kd,dispatch:wF,enabled:c.Boolean(),createdAt:c.String(),updatedAt:c.String(),nextRunAt:c.Union([c.String(),c.Null()]),expiresAt:c.Union([c.String(),c.Null()]),lastRunAt:c.Optional(c.String()),lastRunSessionId:c.Optional(c.String()),lastStatus:c.Optional(be(["queued","running","completed","failed","cancelled","interrupted","error"])),lastError:c.Optional(c.String()),runCount:c.Integer({minimum:0})}));z(c.Object({title:c.Optional(c.String({minLength:1,maxLength:200})),prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"}),projectPath:c.String({minLength:1}),trigger:Kd,modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:En(lo,"worktree"),permissionMode:En(gs,"default"),enabled:En(c.Boolean(),!0)}));z(c.Object({title:c.Optional(c.String({minLength:1,maxLength:200})),prompt:c.Optional(c.String({minLength:1,maxLength:32e3,pattern:"\\S"})),trigger:c.Optional(Kd),modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:c.Optional(lo),permissionMode:c.Optional(gs),enabled:c.Optional(c.Boolean())}));const vF=z(c.Object({schedules:c.Array(Cs)}));z(c.Object({content:c.String({maxLength:X$}),projectPath:c.Optional(c.String()),modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),permissionMode:c.Optional(gs),attachments:c.Optional(c.Array(zx,{maxItems:zr})),outputSchema:c.Optional(Kx)}));const SF=be(["completed","failed","aborted","timed_out","spawn_error"]),jF=z(c.Object({version:c.Literal(1),command:c.String(),status:SF,exitCode:c.Union([c.Integer(),c.Null()]),durationMs:c.Number({minimum:0}),stdout:c.String(),stderr:c.String(),stdoutOmittedBytes:c.Integer({minimum:0}),stderrOmittedBytes:c.Integer({minimum:0}),binaryOutput:c.Boolean(),truncated:c.Boolean()}));z(c.Object({command:c.String({minLength:1,maxLength:32*1024,pattern:"^(?![\\s\\S]*\\u0000)(?=[\\s\\S]*\\S)[\\s\\S]*$"}),projectPath:c.Optional(c.String())}));const IF=z(c.Object({executionId:c.String(),messageId:c.String(),record:jF,auxiliary:c.Boolean(),delivery:c.Optional(be(["current_turn","next_turn"])),queued:c.Optional(c.Integer({minimum:0}))}));z(c.Object({question:c.String({minLength:1,maxLength:eF,pattern:"^(?![\\s\\S]*\\x00)(?=[\\s\\S]*\\S)[\\s\\S]*$"}),projectPath:c.Optional(c.String())}));const CF=z(c.Object({response:c.String({minLength:1}),durationMs:c.Number({minimum:0}),modelId:c.Optional(c.String()),usage:c.Optional(c.Object({promptTokens:c.Number({minimum:0}),completionTokens:c.Number({minimum:0}),totalTokens:c.Number({minimum:0}),reasoningTokens:c.Optional(c.Number({minimum:0})),cacheCreationInputTokens:c.Optional(c.Number({minimum:0})),cacheReadInputTokens:c.Optional(c.Number({minimum:0})),costUsd:c.Optional(c.Number({minimum:0}))}))}));z(c.Object({projectPath:c.String(),kind:be(["uncommitted","base","commit"]),ref:c.Optional(c.String({maxLength:200})),instructions:c.Optional(c.String({maxLength:4e3})),modelId:c.Optional(c.String({minLength:1,maxLength:200}))}));const EF=z(c.Object({reviewId:c.String(),status:c.Literal("running")}));z(c.Object({messageId:c.String(),role:Bd,content:c.String(),timestamp:c.String()}));z(c.Object({approved:c.Boolean(),remember:c.Optional(c.Boolean()),scope:c.Optional(be(["once","session","project"])),targetMode:c.Optional(gs),feedback:c.Optional(c.String()),answers:c.Optional(c.Record(c.String(),c.Union([c.String(),c.Array(c.String())]))),elicitation:c.Optional(c.Object({action:be(["accept","decline","cancel"]),content:c.Optional(c.Record(c.String(),c.Union([c.String({maxLength:4e3}),c.Number(),c.Boolean(),c.Array(c.String({maxLength:1e3}),{maxItems:100})]),{maxProperties:32}))}))}));const TF=z(c.Object({id:Fr,name:c.String({minLength:1,maxLength:80}),description:c.String({minLength:1,maxLength:256}),source:be(["built-in","user","project","plugin"]),contentSha256:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"}))}));z(c.Object({id:c.String(),displayName:c.Optional(c.String()),provider:c.String(),model:c.String(),contextWindow:c.Optional(c.Number()),maxTokens:c.Optional(c.Number()),reasoning:c.Optional(c.Boolean()),supportedReasoningEfforts:c.Optional(c.Array(be(["off","minimal","low","medium","high","xhigh","max"]))),supportedServiceTiers:c.Optional(c.Array(be(["standard","fast","flex"]))),supportedResponseVerbosities:c.Optional(c.Array(be(["low","medium","high"]))),communicationStyles:c.Optional(c.Array(TF,{maxItems:36})),input:c.Optional(c.Array(be(["text","image"]))),overrides:c.Optional(c.Object({baseUrl:c.Optional(c.String()),temperature:c.Optional(c.Number()),maxOutputTokens:c.Optional(c.Number()),timeout:c.Optional(c.Number()),streamIdleTimeout:c.Optional(c.Number({minimum:1e3}))}))}));z(be(["vs-dark","vs-light","hc-black"]));const AF=z(be(["light","dark","system"])),PF=z(c.Object({language:c.String(),codeTheme:c.String(),uiTheme:AF,autoSaveSessions:c.Boolean(),notifyBuild:c.Boolean(),notifyErrors:c.Boolean(),notifySounds:c.Boolean(),privacyTelemetry:c.Boolean(),privacyCrash:c.Boolean(),agentTeamsEnabled:c.Boolean(),communicationStyle:c.Optional(Fr)}));z(c.Partial(PF));async function Dn(e,t){const n=await fetch(e,t),r=await n.json().catch(()=>{});if(!n.ok){const s=r,i=s!=null&&s.error&&typeof s.error=="object"&&!Array.isArray(s.error)?s.error:void 0,o=typeof(s==null?void 0:s.error)=="string"?s.error:typeof(i==null?void 0:i.message)=="string"?i.message:typeof(s==null?void 0:s.message)=="string"?s.message:n.statusText||`Request failed (${n.status})`;throw new Error(o)}return r}const ie="",Yu=1e4,NF=c.Array(Un),OF=c.Array(qx),RF=c.Array(zd),MF=c.Array(Bx),$F=c.Array($c),Zu=c.Object({cwd:c.String(),gitBranch:c.Optional(c.String()),taskAdmission:c.Optional(c.Object({inFlight:c.Integer({minimum:0}),queued:c.Integer({minimum:0}),maxConcurrent:c.Integer({minimum:1}),maxQueued:c.Integer({minimum:1}),paused:c.Optional(c.Boolean())}))}),FF=e=>Array.isArray(e)?e:e==null?"":typeof e=="string"?e:JSON.stringify(e),LF=()=>{const e=new Date,t=String(e.getFullYear()).slice(-2),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0");return`Session ${t}-${n}-${r} ${s}:${i}`};function DF(e){const t=Hx.parse(e);return`projectPath=${encodeURIComponent(t.projectPath)}`}function ft(e,t){const n=DF(t);return`${e}${e.includes("?")?"&":"?"}${n}`}function Xu(e){return{"x-blade-directory":Hx.parse(e).projectPath}}const Xa=(e,t,n)=>({id:`history-${t}-${n}`,role:e.role,content:FF(e.content),timestamp:n,metadata:e.metadata&&typeof e.metadata=="object"?e.metadata:void 0,tool_call_id:e.tool_call_id,name:e.name,tool_calls:e.tool_calls,thinkingContent:e.thinkingContent??e.reasoningContent}),X={listProjects:async()=>{const e=await fetch(`${ie}/projects`);if(!e.ok)throw new Error("Failed to load projects");return Qn(OF,await e.json())},bindProject:async e=>{var n;const t=await fetch(`${ie}/projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to bind project")}return qx.parse(await t.json())},pickProjectDirectory:async()=>Qn(yF,await Dn(`${ie}/projects/pick`,{method:"POST"})),unbindProject:async e=>{if(!(await fetch(`${ie}/projects?path=${encodeURIComponent(e)}`,{method:"DELETE"})).ok)throw new Error("Failed to unbind project")},listSessions:async()=>{const e=await fetch(`${ie}/sessions`);if(!e.ok)throw new Error("Failed to load sessions");return Qn(NF,await e.json())},listSessionPage:async(e,t=50,n=!1)=>{const r=new URLSearchParams({limit:String(t)});e&&r.set("cursor",e),n&&r.set("archived","true");const s=await fetch(`${ie}/sessions/catalog?${r.toString()}`);if(!s.ok)throw new Error("Failed to load session catalog");return fF.parse(await s.json())},getSession:async e=>Un.parse(await Dn(ft(`${ie}/sessions/${e.sessionId}`,e))),createSession:async(e,t)=>{const n=await fetch(`${ie}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e,title:t||LF()})});if(!n.ok)throw new Error("Failed to create session");return Un.parse(await n.json())},startCodeReview:async(e,t)=>{var r,s;const n=await fetch(`${ie}/sessions/${e.sessionId}/review`,{method:"POST",headers:{"Content-Type":"application/json",...Xu(e)},body:JSON.stringify({projectPath:e.projectPath,...t})});if(!n.ok){const i=await n.json().catch(()=>{}),o=((r=i==null?void 0:i.error)==null?void 0:r.code)==="CONFLICT"?Ke("taskHome.review.conflict"):((s=i==null?void 0:i.error)==null?void 0:s.code)==="BAD_REQUEST"?Ke("taskHome.review.invalidTarget"):Ke("taskHome.review.startFailed");throw new Error(o)}return EF.parse(await n.json())},getWorkspaceInfo:async()=>Qn(Zu,await Dn(`${ie}/global/info`)),createTask:async e=>{var n;const t=await fetch(`${ie}/tasks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to dispatch task")}return Qu.parse(await t.json())},updateTask:async(e,t)=>{var r;const n=await fetch(ft(`${ie}/tasks/${e.sessionId}`,e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.json().catch(()=>{});throw new Error(((r=s==null?void 0:s.error)==null?void 0:r.message)||"Failed to update task")}return Un.parse(await n.json())},setTaskAdmissionPaused:async e=>Qn(Zu.properties.taskAdmission,await Dn(`${ie}/global/task-admission`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({paused:e})})),retryTask:async e=>{var n;const t=await fetch(ft(`${ie}/tasks/${e.sessionId}/retry`,e),{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to retry task")}return Qu.parse(await t.json())},deliverTask:async(e,t)=>{var r;const n=await fetch(ft(`${ie}/tasks/${e.sessionId}/delivery`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t})});if(!n.ok){const s=await n.json().catch(()=>{});throw new Error(((r=s==null?void 0:s.error)==null?void 0:r.message)||"Failed to deliver task changes")}return Un.parse(await n.json())},getTaskDiff:async e=>{var n;const t=await fetch(ft(`${ie}/tasks/${e.sessionId}/diff`,e));if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to load task diff")}return cF.parse(await t.json())},deleteSession:async e=>{if(!(await fetch(ft(`${ie}/sessions/${e.sessionId}`,e),{method:"DELETE"})).ok)throw new Error("Failed to delete session")},archiveSession:async e=>mF.parse(await Dn(ft(`${ie}/sessions/${e.sessionId}/archive`,e),{method:"POST"})),unarchiveSession:async e=>hF.parse(await Dn(ft(`${ie}/sessions/${e.sessionId}/unarchive`,e),{method:"POST"})),exportSessionMarkdown:async(e,t=!1)=>{var u,m;const n=ft(`${ie}/sessions/${e.sessionId}/export`,e),r=t?`${n}&includeReasoning=true`:n,s=await fetch(r);if(!s.ok){const p=await s.json().catch(()=>{});throw new Error(((u=p==null?void 0:p.error)==null?void 0:u.message)||"Failed to export session")}const i=s.headers.get("content-disposition")??"",o=((m=/filename="([A-Za-z0-9._-]+)"/.exec(i))==null?void 0:m[1])??`blade-session-${e.sessionId.slice(0,12)}.md`,d=s.headers.get("x-blade-content-sha256")??"";if(!/^[a-f0-9]{64}$/.test(d))throw new Error("Session export is missing its integrity hash");const f=p=>{const h=s.headers.get(p);if(h===null)throw new Error(`Session export is missing its ${p} header`);const b=Number(h);if(!Number.isInteger(b)||b<0)throw new Error(`Session export has an invalid ${p} header`);return b};return{filename:o,markdown:await s.text(),contentSha256:d,messageCount:f("x-blade-export-messages"),activityCount:f("x-blade-export-activities"),redactionCount:f("x-blade-export-redactions")}},updateSession:async(e,t)=>{if(!(await fetch(`${ie}/sessions/${e.sessionId}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:t,projectPath:e.projectPath})})).ok)throw new Error("Failed to update session")},getMessages:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/message`,e));if(!t.ok)throw new Error("Failed to load messages");const n=Qn(RF,await t.json()),r=Date.now();return n.map((s,i)=>Xa(s,i,r))},sendMessage:async(e,t,n)=>{var s;const r=await fetch(`${ie}/sessions/${e.sessionId}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,permissionMode:n,projectPath:e.projectPath})});if(!r.ok){const i=await r.json().catch(()=>{}),o=((s=i==null?void 0:i.error)==null?void 0:s.message)??(i==null?void 0:i.reason);throw new Error(o||"Failed to send message")}return r.json()},askSideQuestion:async(e,t,n)=>CF.parse(await Dn(`${ie}/sessions/${e.sessionId}/side-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:t,projectPath:e.projectPath}),signal:n})),executeUserShellCommand:async(e,t)=>IF.parse(await Dn(`${ie}/sessions/${e.sessionId}/shell`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:t,projectPath:e.projectPath})})),abortSession:async e=>{var n;const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/abort`,e),{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to stop task")}},getGoal:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e));if(!t.ok)throw new Error("Failed to load goal");return(await t.json()).goal},createGoal:async(e,t,n,r)=>{const s=await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({objective:t,tokenBudget:n,permissionMode:r})});if(!s.ok)throw new Error("Failed to create goal");return s.json()},updateGoal:async(e,t)=>{const n=await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error("Failed to update goal");return n.json()},clearGoal:async e=>{if(!(await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e),{method:"DELETE"})).ok)throw new Error("Failed to clear goal")},listRewindCheckpoints:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/rewind`,e));if(!t.ok)throw new Error("Failed to load rewind checkpoints");const n=await t.json();return Qn(MF,n.checkpoints)},rewindSession:async(e,t,n)=>{const r=await fetch(ft(`${ie}/sessions/${e.sessionId}/rewind`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetMessageId:t,mode:n})});if(!r.ok)throw new Error("Failed to rewind session");const s=bF.parse(await r.json()),i=Date.now();return{...s,messages:s.messages.map((o,d)=>Xa(o,d,i))}},listSubagents:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/subagents`,e));if(!t.ok)throw new Error("Failed to load subagents");const n=await t.json();return Qn($F,n.subagents)},resumeSubagent:async(e,t,n)=>{const r=await fetch(ft(`${ie}/sessions/${e.sessionId}/subagents/${encodeURIComponent(t)}/resume`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:n})});if(!r.ok){const s=await r.json().catch(()=>{});throw new Error((s==null?void 0:s.message)||"Failed to resume subagent")}return xF.parse(await r.json())},forkSession:async e=>{const t=await fetch(`${ie}/sessions/${e.sessionId}/fork`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.projectPath})});if(!t.ok)throw new Error("Failed to fork session");const n=gF.parse(await t.json()),r=Date.now();return{session:n.session,messages:n.messages.map((s,i)=>Xa(s,i,r))}},openEventSubscription:async(e,t,n)=>{const r=(n==null?void 0:n.maxRetries)??5,s=n==null?void 0:n.onConnectionChange,i=n==null?void 0:n.onConnectionStateChange;let o=null,d=0,f=null,u=Date.now(),m=null,p=null,h=!1,b=!1,k=0,S,C,x=!1;const N=new Promise((O,J)=>{S=O,C=J}),P=()=>{m&&(clearInterval(m),m=null)},L=()=>{p&&(clearTimeout(p),p=null)},D=()=>{o==null||o.close(),o=null},j=()=>{f&&(clearTimeout(f),f=null),P(),L(),D()},I=()=>{x||(x=!0,L(),S())},T=O=>{x||(x=!0,j(),C(O))},M=()=>{if(h||d>=r){d>=r&&(console.error(`SSE max retries (${r}) reached, giving up`),i==null||i("offline"));return}d++,i==null||i("reconnecting");const O=Math.min(1e3*Math.pow(2,d-1),3e4);console.log(`SSE reconnecting in ${O}ms (attempt ${d}/${r})`),f=setTimeout(()=>{te().catch(J=>{console.error("SSE reconnect failed",J),s==null||s(!1),M()})},O)},$=()=>{d=0,u=Date.now(),s==null||s(!0),i==null||i("connected"),P(),m=setInterval(()=>{Date.now()-u>45e3&&(console.warn("SSE heartbeat timeout, reconnecting..."),P(),D(),s==null||s(!1),i==null||i("reconnecting"),M())},15e3),b||(b=!0,I())},te=async()=>{if(h)return;D();const O=ft(`${ie}/sessions/${e.sessionId}/events`,e),J=k>0?`${O}${O.includes("?")?"&":"?"}lastEventId=${k}`:O;o=new EventSource(J),b||(L(),p=setTimeout(()=>{i==null||i("offline"),T(new Error("Timed out waiting for event subscription readiness"))},Yu)),o.onmessage=ae=>{try{const ce=JSON.parse(ae.data);typeof ce.seq=="number"&&ce.seq>k&&(k=ce.seq);const le=Ju.parse(ce);if(u=Date.now(),le.type==="connected"){le.properties.sessionId===e.sessionId&&le.properties.projectPath===e.projectPath&&(typeof le.properties.status=="string"&&t({type:"session.status",properties:le.properties}),$());return}if(le.type==="heartbeat")return;t(le)}catch(ce){console.error("Failed to parse SSE event:",ae.data,ce)}},o.onerror=()=>{if(h)return;const ae=(o==null?void 0:o.readyState)===EventSource.CLOSED;if(P(),D(),ae){s==null||s(!1),i==null||i("offline"),b||T(new Error("Event subscription closed before it was ready"));return}if(!b){i==null||i("offline"),T(new Error("Failed to open event subscription"));return}s==null||s(!1),M()}};return i==null||i("connecting"),te().catch(O=>{i==null||i("offline"),T(O instanceof Error?O:new Error("Failed to open event subscription"))}),await N,()=>{h=!0,f&&(clearTimeout(f),f=null),j(),s==null||s(!1)}},openTaskEventSubscription:async(e,t)=>{const n=t==null?void 0:t.onConnectionChange,r=t==null?void 0:t.onConnectionStateChange,s=new EventSource(`${ie}/events`);let i=!1,o=!1,d,f,u;const m=new Promise((h,b)=>{f=h,u=b}),p=()=>{i||(i=!0,d!==void 0&&(clearTimeout(d),d=void 0),s.close(),n==null||n(!1),r==null||r("offline"))};return r==null||r("connecting"),d=setTimeout(()=>{o||i||(p(),u(new Error("Timed out waiting for global task events")))},Yu),s.onmessage=h=>{try{const b=Ju.parse(JSON.parse(h.data));if(b.type==="connected"){o||(o=!0,d!==void 0&&(clearTimeout(d),d=void 0),f()),n==null||n(!0),r==null||r("connected");return}if(b.type==="heartbeat")return;e(b)}catch(b){console.error("Failed to parse global task event:",h.data,b)}},s.onerror=()=>{n==null||n(!1),r==null||r(o?"reconnecting":"offline"),!o&&!i&&(p(),u(new Error("Failed to open global task events")))},await m,p},respondPermission:async(e,t,n)=>{var i;const r=new URLSearchParams({sessionId:e.sessionId,projectPath:e.projectPath}),s=await fetch(`${ie}/permissions/${t}?${r.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok){const o=await s.json().catch(()=>{});throw new Error(((i=o==null?void 0:o.error)==null?void 0:i.message)||"Failed to respond to permission")}},respondToConfirmation:async(e,t,n)=>{if(!(await fetch(ft(`${ie}/sessions/${e.sessionId}/confirmation/${t}`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({approved:n})})).ok)throw new Error("Failed to respond to confirmation")},respondToQuestion:async(e,t,n)=>{var i;const r=new URLSearchParams({sessionId:e.sessionId,projectPath:e.projectPath}),s=await fetch(`${ie}/permissions/${t}?${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({approved:!0,answers:n})});if(!s.ok){const o=await s.json().catch(()=>{});throw new Error(((i=o==null?void 0:o.error)==null?void 0:i.message)||"Failed to respond to question")}},respondToElicitation:async(e,t,n)=>{var i;const r=new URLSearchParams({sessionId:e.sessionId,projectPath:e.projectPath}),s=await fetch(`${ie}/permissions/${t}?${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({approved:n.action==="accept",elicitation:n})});if(!s.ok){const o=await s.json().catch(()=>{});throw new Error(((i=o==null?void 0:o.error)==null?void 0:i.message)||"Failed to respond to MCP elicitation")}},getGitInfo:async e=>{const t=await fetch(`${ie}/suggestions/git-info`,{headers:Xu(e)});if(!t.ok)throw new Error("Failed to get git info");return t.json()},listSchedules:async()=>{var n;const e=await fetch(`${ie}/schedules`);if(!e.ok){const r=await e.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.loadFailed"))}return vF.parse(await e.json()).schedules},createSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.createFailed"))}return Cs.parse(await t.json())},updateSchedule:async(e,t)=>{var r;const n=await fetch(`${ie}/schedules/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.json().catch(()=>{});throw new Error(((r=s==null?void 0:s.error)==null?void 0:r.message)||Ke("schedule.error.updateFailed"))}return Cs.parse(await n.json())},deleteSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.deleteFailed"))}},enableSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}/enable`,{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.toggleFailed"))}return Cs.parse(await t.json())},disableSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}/disable`,{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.toggleFailed"))}return Cs.parse(await t.json())},runSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}/run`,{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.runFailed"))}return Cs.parse(await t.json())}},ep=e=>{let t;const n=new Set,r=(u,m)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const h=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(b=>b(t,h))}},s=()=>t,d={setState:r,getState:s,getInitialState:()=>f,subscribe:u=>(n.add(u),()=>n.delete(u))},f=t=e(r,s,d);return d},_F=e=>e?ep(e):ep,UF=e=>e;function BF(e,t=UF){const n=ai.useSyncExternalStore(e.subscribe,ai.useCallback(()=>t(e.getState()),[e,t]),ai.useCallback(()=>t(e.getInitialState()),[e,t]));return ai.useDebugValue(n),n}const tp=e=>{const t=_F(e),n=r=>BF(t,r);return Object.assign(n,t),n},uo=e=>e?tp(e):tp,HF=(e,t)=>({messages:[],setMessages:n=>e({messages:n}),addMessage:n=>e(r=>({messages:[...r.messages,n]})),updateMessage:(n,r)=>e(s=>({messages:s.messages.map(i=>i.id===n?{...i,...r}:i)})),appendDelta:(n,r,s)=>e(i=>({messages:i.messages.map(o=>{if(o.id!==n)return o;const d=o.agentContent||Wn();return s==="before"?{...o,agentContent:{...du(d,r),textBefore:d.textBefore+r}}:{...o,agentContent:{...du(d,r),textAfter:d.textAfter+r}}})})),appendToolCall:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:Y0(o,r)}})})),updateToolCall:(n,r,s)=>e(i=>({messages:i.messages.map(o=>{if(o.id!==n)return o;const d=o.agentContent;return d?{...o,agentContent:{...d,toolCalls:d.toolCalls.map(f=>f.toolCallId===r?{...f,...s}:f)}}:o})})),appendThinking:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:{...Q0(o,r),thinkingContent:o.thinkingContent+r}}})})),setConfirmation:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:{...o,confirmation:r}}})})),setQuestion:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:{...o,question:r}}})})),setElicitation:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:{...o,elicitation:r}}})})),setSubagent:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:r?J0(o,r):lu(o,[])}})})),updateSubagent:(n,r,s)=>e(i=>({messages:i.messages.map(o=>{if(o.id!==n)return o;const d=o.agentContent||Wn(),f=[...W0(d)],u=f.findIndex(h=>h.id===r||h.sessionId===r);if(u===-1)return o;const m=f[u],p=typeof s=="function"?s(m):s;return f[u]={...m,...p,id:m.id},{...o,agentContent:lu(d,f,f[u].id)}})})),setTasks:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:{...o,tasks:r}}})})),replaceTemp:(n,r)=>e(s=>{const i=s.messages.findIndex(d=>d.content===n&&d.role==="user");if(i===-1)return s;const o=[...s.messages];return o[i]=r,{messages:o}})}),ec=60,qF=[/<system-reminder>[\s\S]*?<\/system-reminder>/gi,/<file[^>]*>[\s\S]*?<\/file>/gi,/<hooks_context>[\s\S]*?<\/hooks_context>/gi,/<[^>]+>/g];function zF(e){let t=e;for(const f of qF)t=t.replace(f," ");t=t.replace(/^\s*\/[a-zA-Z][\w-]*\s+/,"");const n=t.replace(/\s+/g," ").trim();if(!n)return"";const r=n.match(/^(.+?)(?:[.!?]\s|[。!?](?=\S|$)|$)/);let s=r&&r[1].length>=6?r[1]:n;if(s=s.trim().replace(/[\s.。!!??,,;;::-]+$/,""),s.length<=ec)return s;const i=s.slice(0,ec),o=i.lastIndexOf(" ");return`${(o>ec*.6?i.slice(0,o):i).trimEnd()}…`}const Oo="/.blade/worktrees/",KF=/-[a-f0-9]{8,}$/i,GF=/^(.+?(?:test|config))-[a-z0-9]{6,}$/i;function VF(e){const t=e.indexOf(Oo);if(t<0)return null;const n=e.slice(t+Oo.length).split("/")[0];return n?`${e.slice(0,t+Oo.length)}${n}`:null}function WF(e){if(!e.includes("/tmp/")&&!e.includes("/T/"))return null;const t=e.split("/"),n=t.at(-1),r=n==null?void 0:n.match(GF);return r!=null&&r[1]?(t[t.length-1]=r[1],t.join("/")):null}function Fc(e){const t=e.split("/").filter(Boolean).at(-1)||e;return e.includes(Oo)?t.replace(KF,""):t}function po(e,t=null){const n=e.taskSourceProjectPath,r=WF(n||e.projectPath);if(r)return r;if(n)return n;const s=VF(e.projectPath);if(!s)return e.projectPath;const i=Fc(s);return t&&i===Fc(t)?t:s}function JF(e,t,n=null){return t?e.filter(r=>po(r,n)===t):e}const Lc=kr.AUTO_EDIT;let tc=0;const Mt=uo((e,t)=>({currentModelId:null,currentMode:Lc,configuredModels:[],availableModels:[],isLoading:!1,hasLoaded:!1,loadedWorkspacePath:null,error:null,loadModels:async n=>{const r=n??null;if(t().isLoading&&t().loadedWorkspacePath===r)return;const s=++tc;e({isLoading:!0,hasLoaded:!1,loadedWorkspacePath:r,error:null});try{const i=await Dn("/models",n?{headers:{"x-blade-directory":n}}:void 0);if(s!==tc||t().loadedWorkspacePath!==r)return;const o=i.current;e({currentModelId:(o==null?void 0:o.id)||null,configuredModels:i.configured||[],availableModels:i.available||[],isLoading:!1,hasLoaded:!0})}catch(i){if(s!==tc||t().loadedWorkspacePath!==r)return;e({error:i instanceof Error?i.message:"Failed to load models",isLoading:!1,hasLoaded:!0})}},setCurrentModel:async(n,r)=>{if(e({error:null}),r){e({currentModelId:n});return}try{await Dn("/configs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:{currentModelId:n},options:{scope:"global"}})}),e({currentModelId:n})}catch(s){throw e({error:s instanceof Error?s.message:"Failed to set model"}),s}},setMode:n=>e({currentMode:n}),resetMode:()=>e({currentMode:Lc})})),QF=e=>e==="system"?typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches:e==="dark",Ro=e=>{if(typeof document>"u")return;const t=document.documentElement;if(t.classList.remove("light","dark"),e==="system"){const r=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";t.classList.add(r)}else t.classList.add(e)},rn={language:"zh-CN",codeTheme:"dracula",uiTheme:"system",autoSaveSessions:!0,notifyBuild:!0,notifyErrors:!1,notifySounds:!1,privacyTelemetry:!1,privacyCrash:!0,agentTeamsEnabled:!1,communicationStyle:"auto"},Xr=uo((e,t)=>({...rn,isLoading:!1,error:null,loadSettings:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/configs");if(!n.ok)throw new Error(Ke("settings.general.loadError"));const r=await n.json(),s=r.uiTheme??rn.uiTheme;e({language:r.language??rn.language,codeTheme:r.codeTheme??rn.codeTheme,uiTheme:s,autoSaveSessions:r.autoSaveSessions??rn.autoSaveSessions,notifyBuild:r.notifyBuild??rn.notifyBuild,notifyErrors:r.notifyErrors??rn.notifyErrors,notifySounds:r.notifySounds??rn.notifySounds,privacyTelemetry:r.privacyTelemetry??rn.privacyTelemetry,privacyCrash:r.privacyCrash??rn.privacyCrash,agentTeamsEnabled:r.agentTeamsEnabled??rn.agentTeamsEnabled,communicationStyle:r.communicationStyle??rn.communicationStyle,isLoading:!1}),Ro(s)}catch(n){e({error:n.message,isLoading:!1})}},updateSettings:async n=>{const r=t();e({...n,error:null}),n.uiTheme&&Ro(n.uiTheme);try{if(!(await fetch("/configs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:n,options:{scope:"global"}})})).ok)throw new Error(Ke("settings.general.saveError"))}catch(s){e({language:r.language,codeTheme:r.codeTheme,uiTheme:r.uiTheme,autoSaveSessions:r.autoSaveSessions,notifyBuild:r.notifyBuild,notifyErrors:r.notifyErrors,notifySounds:r.notifySounds,privacyTelemetry:r.privacyTelemetry,privacyCrash:r.privacyCrash,agentTeamsEnabled:r.agentTeamsEnabled,communicationStyle:r.communicationStyle,error:s.message}),n.uiTheme&&Ro(r.uiTheme)}}}));Ro(rn.uiTheme);const M3=()=>Xr(e=>QF(e.uiTheme)),nc="__temp__",li={inputTokens:0,outputTokens:0,totalTokens:0,maxContextTokens:0,isDefaultMaxTokens:!0,totalInputTokens:0,totalOutputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,estimatedCostUsd:0};function he(e){return{sessionId:e.sessionId,projectPath:e.projectPath}}function Re(e){return JSON.stringify([e.projectPath,e.sessionId])}function oe(e,t){return!e||!t?e===t:e.sessionId===t.sessionId&&e.projectPath===t.projectPath}function Gd(e,t){return e.find(n=>oe(he(n),t))}function hn(e,t){const n=he(t),r=e.findIndex(i=>oe(he(i),n));if(r===-1)return[...e,t];const s=[...e];return s[r]=t,s}function np(e,t){return e.filter(n=>!oe(he(n),t))}const Gx="blade.tasks.unread",Wo="blade:open-session";function Vx(e){return e==="completed"||e==="failed"||e==="interrupted"}function YF(e,t,n){return!Vx(t)||n?!1:e!==t&&!(e==="completed"||e==="failed"||e==="interrupted"||e==="cancelled")}function ZF(e=typeof localStorage>"u"?null:localStorage){if(!e)return[];try{const t=JSON.parse(e.getItem(Gx)??"[]");return Array.isArray(t)?[...new Set(t.filter(n=>typeof n=="string"))]:[]}catch{return[]}}function gi(e,t=typeof localStorage>"u"?null:localStorage){if(t)try{t.setItem(Gx,JSON.stringify([...new Set(e)]))}catch{}}function rp(e,t){const n=new Set(t.map(r=>Re({sessionId:r.sessionId,projectPath:r.projectPath})));return e.filter(r=>n.has(r))}function sp(e){if(typeof document>"u"||document.visibilityState!=="hidden"||typeof Notification>"u"||Notification.permission!=="granted")return!1;const t=new Notification(e.title,{body:e.body,icon:"/favicon.svg",tag:`blade-task-${Re(e.ref)}`});return t.onclick=()=>e.onOpen(e.ref),!0}function XF(e){if(typeof window>"u")return!1;const t=window.AudioContext??window.webkitAudioContext;if(!t)return!1;try{const n=new t,r=n.createOscillator(),s=n.createGain();return r.type="sine",r.frequency.value=e==="completed"?660:330,s.gain.setValueAtTime(1e-4,n.currentTime),s.gain.exponentialRampToValueAtTime(.045,n.currentTime+.015),s.gain.exponentialRampToValueAtTime(1e-4,n.currentTime+.18),r.connect(s),s.connect(n.destination),r.start(),r.stop(n.currentTime+.2),r.onended=()=>void n.close(),!0}catch{return!1}}const e5=e=>{var n;const t=[];e.content.trim()&&t.push({type:"text",text:e.content});for(const r of e.attachments??[])r.type==="image"&&t.push({type:"image_url",image_url:{url:r.content}});return t.length===0?e.content:t.length===1&&((n=t[0])==null?void 0:n.type)==="text"?t[0].text:t},Io=()=>({eventUnsubscribe:null,sessionEventConnectionState:"idle",isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1}),ip=()=>new Promise(e=>{globalThis.setTimeout(()=>{if(typeof window<"u"&&typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>e(),{timeout:750});return}e()},350)}),op=async e=>(await es(async()=>{const{teamService:t}=await import("./teamService-7LNlaq8e.js");return{teamService:t}},__vite__mapDeps([0,1,2,3]))).teamService.list(e),t5=(e,t)=>{let n=0,r=0,s=0;const i=new Map,o=new Map;let d=null;const f=()=>(d==null||d.abort("session-navigation"),d=null,n+=1,n),u=p=>p===n,m=p=>{try{p()}catch(h){console.warn("Failed to clean up stale event subscription",h)}};return{sessions:[],archivedSessions:[],currentSessionId:null,currentSessionRef:null,forkingSessionRef:null,isTemporarySession:!1,isLoading:!1,catalogLoadState:"idle",catalogError:null,archivedCatalogLoadState:"idle",archivedCatalogError:null,error:null,errorContext:null,goal:null,sideConversation:null,teams:[],setSessions:p=>e({sessions:p}),addSession:p=>e(h=>({sessions:hn(h.sessions,p)})),removeSession:p=>{const h=t();h.markTaskRead(p);const b=oe(h.currentSessionRef,p),k=oe(h.forkingSessionRef,p);(b||k)&&f(),b&&h.unsubscribeFromEvents(),e(S=>({sessions:np(S.sessions,p),currentSessionId:b?null:S.currentSessionId,currentSessionRef:b?null:S.currentSessionRef,messages:b?[]:S.messages,goal:b?null:S.goal,sideConversation:b?null:S.sideConversation,teams:b?[]:S.teams,forkingSessionRef:k?null:S.forkingSessionRef,...b?Io():{}}))},setCurrentSession:p=>{f(),e({currentSessionId:(p==null?void 0:p.sessionId)??null,currentSessionRef:p,isTemporarySession:!1,sideConversation:null,teams:[]})},setTemporarySession:p=>e({isTemporarySession:p}),setLoading:p=>e({isLoading:p}),setError:p=>e({error:p,errorContext:null}),getNavigationVersion:()=>n,clearError:()=>e({error:null,errorContext:null}),setGoal:p=>e({goal:p}),startTemporarySession:p=>{f(),t().unsubscribeFromEvents(),Mt.getState().resetMode(),p&&t().selectProject(p),e({currentSessionId:nc,currentSessionRef:null,isTemporarySession:!0,forkingSessionRef:null,isLoading:!1,messages:[],goal:null,sideConversation:null,teams:[],tokenUsage:{...li},error:null,errorContext:null,...Io()})},loadSessions:async()=>{const p=++r,h=new Set(t().sessions.map(k=>Re(he(k)))),b=new Set;e({catalogLoadState:"loading",catalogError:null});try{let k,S=!0;do{const N=await X.listSessionPage(k);if(p!==r)return;for(const P of N.sessions)b.add(Re(he(P)));if(e(P=>{const L=new Set(N.sessions.map(j=>Re(he(j))));return{sessions:S?[...N.sessions,...P.sessions.filter(j=>!L.has(Re(he(j))))]:N.sessions.reduce((j,I)=>hn(j,I),P.sessions),catalogLoadState:N.nextCursor?"hydrating":"ready"}}),S=!1,k=N.nextCursor,k&&(await ip(),p!==r))return}while(k);if(p!==r)return;const C=t().sessions.filter(N=>{const P=Re(he(N));return b.has(P)||!h.has(P)}),x=rp(t().unreadTaskKeys,C);gi(x),e({sessions:C,unreadTaskKeys:x,catalogLoadState:"ready",catalogError:null})}catch(k){if(p!==r)return;e({catalogLoadState:"error",catalogError:k.message})}},loadArchivedSessions:async()=>{const p=++s;e({archivedCatalogLoadState:"loading",archivedCatalogError:null});try{let h;const b=[];do{const k=await X.listSessionPage(h,50,!0);if(p!==s)return;for(const S of k.sessions){const C=b.findIndex(x=>oe(he(x),he(S)));C===-1?b.push(S):b[C]=S}h=k.nextCursor,h&&(e({archivedCatalogLoadState:"hydrating"}),await ip())}while(h);if(p!==s)return;e({archivedSessions:b,archivedCatalogLoadState:"ready",archivedCatalogError:null})}catch(h){if(p!==s)return;e({archivedCatalogLoadState:"error",archivedCatalogError:h.message})}},selectSession:async p=>{var k;const h=f();e({isLoading:!0,error:null,errorContext:null,forkingSessionRef:null});let b=null;try{const S=Gd(t().sessions,p),C=[];let x=!1;if(b=await t().prepareEventSubscription(p,T=>{x?t().handleEvent(T):C.push(T)}),!u(h)){m(b),b=null;return}const[N,P,L,D]=await Promise.all([X.getMessages(p),X.getGoal(p).catch(()=>null),S?Promise.resolve(S):X.getSession(p),Xr.getState().agentTeamsEnabled?op(p).catch(()=>[]):Promise.resolve([])]);if(!u(h)){m(b),b=null;return}const j=So(N),I=po(L,t().selectedProjectPath??((k=t().taskWorkspaceInfo)==null?void 0:k.cwd)??null);t().boundProjects.some(T=>T.available&&T.path===I)&&t().selectProject(I),Mt.getState().setMode(L.permissionMode??Lc),e(T=>{var M;return{currentSessionId:p.sessionId,currentSessionRef:p,isTemporarySession:!1,messages:j,goal:P,teams:D,isLoading:!1,tokenUsage:{...li},isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1,error:L.taskStatus==="failed"?((M=L.taskFailure)==null?void 0:M.message)??null:null,errorContext:L.taskStatus==="failed"&&L.taskFailure?{kind:"execution",sessionRef:p,failureCode:L.taskFailure.code}:null,sessions:hn(T.sessions,L)}}),t().markTaskRead(p),x=!0,t().replaceEventSubscription(b),b=null;for(const T of C)t().handleEvent(T)}catch(S){if(b&&m(b),!u(h))return;e({error:S.message,errorContext:{kind:"navigation",sessionRef:p},isLoading:!1})}},resyncSessionMessages:async p=>{const h=Re(p),b=i.get(h);if(b)return b;const k=n,S=Promise.resolve().then(async()=>{try{const C=await X.getMessages(p);if(!u(k)||!oe(t().currentSessionRef,p))return;const x=So(C);e(N=>({messages:x,sessions:N.sessions.map(P=>oe(he(P),p)?{...P,messageCount:x.length}:P)}))}catch(C){console.warn("Failed to resync terminal session messages",C)}finally{i.get(h)===S&&i.delete(h)}});return i.set(h,S),S},archiveSession:async p=>{var h;try{const b=await X.archiveSession(p),k=new Set(b.archivedSessionIds),S=t(),C=((h=S.currentSessionRef)==null?void 0:h.projectPath)===p.projectPath&&k.has(S.currentSessionRef.sessionId);C&&(f(),S.unsubscribeFromEvents()),e(x=>{const N=x.sessions.filter(L=>L.projectPath!==p.projectPath||!k.has(L.sessionId)),P=rp(x.unreadTaskKeys,N);return gi(P),{sessions:N,archivedSessions:hn(x.archivedSessions,b.session),unreadTaskKeys:P,currentSessionId:C?null:x.currentSessionId,currentSessionRef:C?null:x.currentSessionRef,messages:C?[]:x.messages,goal:C?null:x.goal,...C?Io():{}}}),await t().loadArchivedSessions()}catch(b){e({error:b.message,errorContext:{kind:"task_action",sessionRef:p}})}},unarchiveSession:async p=>{try{const h=await X.unarchiveSession(p),b=new Set(h.restoredSessionIds);e(k=>({archivedSessions:k.archivedSessions.filter(S=>S.projectPath!==p.projectPath||!b.has(S.sessionId)),sessions:hn(k.sessions,h.session)})),await Promise.all([t().loadSessions(),t().loadArchivedSessions()])}catch(h){e({error:h.message,errorContext:{kind:"task_action",sessionRef:p}})}},deleteSession:async p=>{const h=t(),b=oe(h.currentSessionRef,p),k=oe(h.forkingSessionRef,p),S=b||k?f():null,C=b?S:null;k&&e({forkingSessionRef:null});try{await X.deleteSession(p),t().markTaskRead(p);const x=t(),N=oe(x.currentSessionRef,p)&&(C===null||u(C));N&&(f(),x.unsubscribeFromEvents()),e(P=>({sessions:np(P.sessions,p),currentSessionId:N?null:P.currentSessionId,currentSessionRef:N?null:P.currentSessionRef,messages:N?[]:P.messages,goal:N?null:P.goal,...N?Io():{}}))}catch(x){if(C!==null&&(!u(C)||!oe(t().currentSessionRef,p)))return;e({error:x.message})}},updateSession:async(p,h)=>{try{await X.updateSession(p,h),e(b=>({sessions:b.sessions.map(k=>k.sessionId===p.sessionId&&k.projectPath===p.projectPath?{...k,title:h}:k)}))}catch(b){e({error:b.message})}},forkSession:async p=>{const h=f(),b=he(p);e({forkingSessionRef:b,isLoading:!1,error:null});let k=null;try{const S=await X.forkSession(p),C=he(S.session),x=So(S.messages);if(e(N=>({sessions:hn(N.sessions,S.session)})),!u(h))return;if(k=await t().prepareEventSubscription(C),!u(h)){m(k),k=null;return}e({currentSessionId:C.sessionId,currentSessionRef:C,isTemporarySession:!1,messages:x,goal:null,tokenUsage:{...li},error:null,forkingSessionRef:null}),t().replaceEventSubscription(k),k=null}catch(S){if(k&&m(k),!u(h))return;e({error:S.message,forkingSessionRef:null})}},rewindSession:async(p,h)=>{const{currentSessionRef:b,isTemporarySession:k,isStreaming:S}=t();if(!b||k)return e({error:"No persisted session is available for rewind"}),!1;if(S)return e({error:"Stop the active run before rewinding"}),!1;const C=n;try{const x=await X.rewindSession(b,p,h);if(!u(C)||!oe(t().currentSessionRef,b))return!1;const N=So(x.messages);return e(P=>({messages:N,tokenUsage:{...li},error:null,currentRunId:null,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1,sessions:P.sessions.map(L=>L.sessionId===b.sessionId&&L.projectPath===b.projectPath?{...L,messageCount:N.length}:L)})),!0}catch(x){return!u(C)||!oe(t().currentSessionRef,b)||e({error:x.message}),!1}},sendMessage:async p=>{var O,J,ae,ce,le,xe;const{currentSessionId:h,currentSessionRef:b,isTemporarySession:k,isStreaming:S,addSession:C,addMessage:x}=t(),N=n,P=b,L={isStreaming:S,agentPhase:t().agentPhase,currentRunId:t().currentRunId};let D=b,j=h,I=P,T=null,M=null;const $=()=>u(N)&&oe(t().currentSessionRef,I),te=tF(p.content);if(te){if((((O=p.attachments)==null?void 0:O.length)??0)>0)return e({error:"Side conversations do not accept image attachments"}),!1;if(!te.question)return e({error:"Usage: /btw <question>"}),!1;if(k||!D||!j)return e({error:"Start or select a Session before using /btw"}),!1;d==null||d.abort("side-conversation-replaced");const Z=new AbortController;d=Z;const de=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;e({sideConversation:{requestId:de,sessionRef:D,question:te.question,status:"loading"},error:null,errorContext:null});try{const R=await X.askSideQuestion(D,te.question,Z.signal);return Z.signal.aborted||!$()||((J=t().sideConversation)==null?void 0:J.requestId)!==de?!1:(e({sideConversation:{requestId:de,sessionRef:D,question:te.question,status:"completed",response:R.response,durationMs:R.durationMs,modelId:R.modelId}}),R.usage&&t().updateTokenUsage({inputTokens:R.usage.promptTokens,outputTokens:R.usage.completionTokens,totalTokens:R.usage.totalTokens,cacheReadTokens:R.usage.cacheReadInputTokens??0,cacheWriteTokens:R.usage.cacheCreationInputTokens??0,costUsd:R.usage.costUsd}),!0)}catch(R){return Z.signal.aborted||!$()||e({sideConversation:{requestId:de,sessionRef:D,question:te.question,status:"error",error:R instanceof Error?R.message:String(R)}}),!1}finally{d===Z&&(d=null)}}if(d==null||d.abort("main-conversation-submitted"),d=null,t().sideConversation&&e({sideConversation:null}),k||!j||j===nc)try{const Z=zF(p.content),de=await X.createSession(t().selectedProjectPath??((ae=t().taskWorkspaceInfo)==null?void 0:ae.cwd)??void 0,Z||void 0);if(C(de),!$())return!1;D=he(de),j=de.sessionId,e({currentSessionId:de.sessionId,currentSessionRef:D,isTemporarySession:!1}),I=D}catch(Z){return $()&&e({error:Z.message}),!1}if(!D||!j||j===nc)return $()&&e({error:"Failed to create session"}),!1;try{if(!S){if(T=await t().prepareEventSubscription(D),!$())return m(T),T=null,!1;t().replaceEventSubscription(T),T=null}if(!$())return!1;const Z=p.content.trim();if(Z.startsWith("!")){if((((ce=p.attachments)==null?void 0:ce.length)??0)>0)throw new Error("User shell commands do not accept image attachments");const B=Z.slice(1).trim();if(!B)throw new Error("User shell command cannot be empty");S||e({isStreaming:!0,agentPhase:"running",error:null,errorContext:null});const Se=await X.executeUserShellCommand(D,B);return $()?(Se.auxiliary||e({isStreaming:!1,agentPhase:"idle"}),Se.delivery&&e({pendingSteeringCount:Se.queued??0,pendingInputDelivery:Se.delivery==="current_turn"?"current_turn":"next_turn"}),!0):!1}if((((le=p.attachments)==null?void 0:le.length)??0)===0&&(Z==="/goal"||Z.startsWith("/goal "))){M=`goal-command-${Date.now()}`,x({id:M,role:"user",content:Z,timestamp:Date.now()});const B=Z.slice(5).trim().split(/\s+/).filter(Boolean),Se=(xe=B[0])==null?void 0:xe.toLowerCase();if(!Se||Se==="status"){const Ae=await X.getGoal(D);return $()&&e({goal:Ae}),$()}if(Se==="clear")return await X.clearGoal(D),$()&&e({goal:null}),$();let qe;if(Se==="pause")qe=await X.updateGoal(D,{action:"pause"});else if(Se==="resume")qe=await X.updateGoal(D,{action:"resume"});else if(Se==="edit"){const Ae=B.slice(1).join(" ").trim();if(!Ae)throw new Error("Usage: /goal edit <objective>");qe=await X.updateGoal(D,{action:"edit",objective:Ae})}else{const Ae=B.lastIndexOf("--budget");let Jt;if(Ae>=0){const Qt=B[Ae+1];if(!Qt||!/^[1-9]\d*$/.test(Qt))throw new Error("--budget requires a positive integer");Jt=Number(Qt),B.splice(Ae,2)}const et=B.join(" ").trim();if(!et)throw new Error("Usage: /goal <objective>");const{currentMode:Ht}=Mt.getState();qe=await X.createGoal(D,et,Jt,Ht)}return $()?(e({goal:qe.goal,...qe.runId?{currentRunId:qe.runId,isStreaming:!0,agentPhase:"running"}:{}}),!0):!1}M=`temp-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,x({id:M,role:"user",content:e5(p),timestamp:Date.now()}),e({isStreaming:!0,error:null,errorContext:null,recoveredSteeringCount:S?t().recoveredSteeringCount:0});const{currentMode:de,currentModelId:R}=Mt.getState(),{modelId:ue,...ve}=p,He=ue??R??void 0,yt=p.reasoningEffort,We=p.serviceTier,tt=p.responseVerbosity,Y=p.communicationStyle,pt=He&&!S?{...ve,modelId:He}:ve,F=await X.sendMessage(D,pt,de);return $()?(e({currentRunId:F.runId,pendingSteeringCount:F.status==="steering_queued"||F.status==="follow_up_queued"?Math.max(0,F.queued??1):t().pendingSteeringCount,pendingInputDelivery:F.status==="steering_queued"?"current_turn":F.status==="follow_up_queued"?"next_turn":t().pendingInputDelivery,sessions:(He||yt||We||tt||Y)&&!S?t().sessions.map(B=>B.sessionId===D.sessionId&&B.projectPath===D.projectPath?{...B,...He?{selectedModelId:He}:{},...yt?{reasoningEffort:yt}:{},...We?{serviceTier:We}:{},...tt?{responseVerbosity:tt}:{},...Y?{communicationStyle:Y}:{}}:B):t().sessions}),!0):!1}catch(Z){return T&&m(T),$()?M&&!t().messages.some(de=>de.id===M)?!0:(e(de=>({error:Z.message,errorContext:{kind:"submission",sessionRef:D},messages:M?de.messages.filter(R=>R.id!==M):de.messages,...L})),!1):!1}},dismissSideConversation:()=>{d==null||d.abort("side-conversation-dismissed"),d=null,e({sideConversation:null})},loadTeams:async p=>{const h=p??t().currentSessionRef;if(!h||!Xr.getState().agentTeamsEnabled){e({teams:[]});return}const b=Re(h),k=o.get(b);if(k)return k;let S;S=(async()=>{try{const C=await op(h);if(!oe(t().currentSessionRef,h))return;e({teams:C})}catch{oe(t().currentSessionRef,h)&&e({teams:[]})}finally{o.get(b)===S&&o.delete(b)}})(),o.set(b,S),await S},abortSession:async()=>{const{currentSessionRef:p,isStopping:h}=t();if(!p||h)return!1;e({isStopping:!0,error:null,errorContext:null});try{return await X.abortSession(p),!oe(t().currentSessionRef,p)||(await t().resyncSessionMessages(p),!oe(t().currentSessionRef,p))?!1:(t().unsubscribeFromEvents(),e({isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1}),!0)}catch(b){return oe(t().currentSessionRef,p)&&e({isStopping:!1,error:b instanceof Error?b.message:"Failed to stop task",errorContext:{kind:"task_action",sessionRef:p}}),!1}},pauseGoal:async()=>{const{currentSessionRef:p,isTemporarySession:h}=t();if(!p||h){e({error:"No persisted session is available for this goal"});return}try{const b=await X.updateGoal(p,{action:"pause"});if(!oe(t().currentSessionRef,p))return;e({goal:b.goal,error:null})}catch(b){if(!oe(t().currentSessionRef,p))return;e({error:b.message})}},resumeGoal:async()=>{const{currentSessionRef:p,isTemporarySession:h}=t();if(!p||h){e({error:"No persisted session is available for this goal"});return}try{const b=await X.updateGoal(p,{action:"resume"});if(!oe(t().currentSessionRef,p))return;e({goal:b.goal,error:null,...b.runId?{currentRunId:b.runId,isStreaming:!0,agentPhase:"running"}:{}})}catch(b){if(!oe(t().currentSessionRef,p))return;e({error:b.message})}},editGoal:async p=>{const{currentSessionRef:h,isTemporarySession:b}=t();if(!h||b){e({error:"No persisted session is available for this goal"});return}try{const k=await X.updateGoal(h,{action:"edit",objective:p});if(!oe(t().currentSessionRef,h))return;e({goal:k.goal,error:null,...k.runId?{currentRunId:k.runId,isStreaming:!0,agentPhase:"running"}:{}})}catch(k){if(!oe(t().currentSessionRef,h))return;e({error:k.message})}},clearGoal:async()=>{const{currentSessionRef:p,isTemporarySession:h}=t();if(!p||h){e({error:"No persisted session is available for this goal"});return}try{if(await X.clearGoal(p),!oe(t().currentSessionRef,p))return;e({goal:null,error:null})}catch(b){if(!oe(t().currentSessionRef,p))return;e({error:b.message})}}}},n5=(e,t)=>{const n=new WeakMap;let r=null;return{isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,sessionEventConnectionState:"idle",currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},eventUnsubscribe:null,currentAssistantMessageId:null,hasToolCalls:!1,setStreaming:s=>e({isStreaming:s}),setAgentPhase:s=>e({agentPhase:s}),setRunId:s=>e({currentRunId:s}),prepareEventSubscription:async(s,i)=>{const o=i??uu(t,e);let d=null,f="connecting";return d=await X.openEventSubscription(s,o,{onConnectionStateChange:u=>{f=u,d&&r===d&&e({sessionEventConnectionState:u})}}),n.set(d,f),d},replaceEventSubscription:s=>{const i=t().eventUnsubscribe;if(r=s,e({eventUnsubscribe:s,sessionEventConnectionState:s?n.get(s)??"connected":"idle"}),Ga.reset(),i&&i!==s)try{i()}catch(o){console.warn("Failed to clean up previous event subscription",o)}},setCurrentAssistantMessageId:s=>e({currentAssistantMessageId:s}),setHasToolCalls:s=>e({hasToolCalls:s}),startAgentResponse:s=>{e({currentAssistantMessageId:s,hasToolCalls:!1,isStreaming:!0,agentPhase:"running",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null})},endAgentResponse:()=>{Ga.drainAll(),e({currentAssistantMessageId:null,hasToolCalls:!1,isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null})},subscribeToEvents:async s=>{const i=await t().prepareEventSubscription(s);t().replaceEventSubscription(i)},reconnectSessionEvents:async()=>{const s=t().currentSessionRef;if(s){t().unsubscribeFromEvents(),e({sessionEventConnectionState:"connecting"});try{await t().subscribeToEvents(s)}catch(i){throw e({sessionEventConnectionState:"offline"}),i}}},unsubscribeFromEvents:()=>{const{eventUnsubscribe:s}=t();r=null,e({eventUnsubscribe:null,sessionEventConnectionState:"idle"});try{s==null||s()}catch(i){console.warn("Failed to clean up event subscription",i)}finally{Ga.reset()}},handleEvent:s=>{uu(t,e)(s)}}};function r5(e){var t;return((t=e.taskPromptSummary)==null?void 0:t.trimStart().startsWith("/review"))===!0}function Vd(e,t){var r;const n=(r=e.taskStatusReason)==null?void 0:r.trim();if(r5(e)){if(e.taskStatus==="running")return t("taskHome.review.running");if(n!=null&&n.startsWith("Code review stale:"))return t("taskHome.review.stale");if(n==="Code review aborted")return t("taskHome.review.aborted");if(n==="Code review interrupted by process restart")return t("taskHome.review.interrupted");if(e.taskStatus==="failed")return t("taskHome.review.failed")}return e.taskFailure?t(Ep(e.taskFailure.code)):n==="user-cancel"?t("session.reason.cancelledByUser"):n||void 0}let rc=0;function Co(e,t){const n=e.findIndex(s=>s.id===t.id);if(n===-1)return[...e,t];const r=e.slice();return r[n]=t,r}const s5=uo(e=>({schedules:[],isLoading:!1,hasLoaded:!1,error:null,loadSchedules:async()=>{const t=++rc;e({isLoading:!0,error:null});try{const n=await X.listSchedules();if(t!==rc)return;e({schedules:n,isLoading:!1,hasLoaded:!0})}catch(n){if(t!==rc)return;e({error:n instanceof Error?n.message:Ke("schedule.error.loadFailed"),isLoading:!1,hasLoaded:!0})}},createSchedule:async t=>{e({error:null});try{const n=await X.createSchedule(t);return e(r=>({schedules:Co(r.schedules,n)})),n}catch(n){throw e({error:n instanceof Error?n.message:Ke("schedule.error.createFailed")}),n}},updateSchedule:async(t,n)=>{e({error:null});try{const r=await X.updateSchedule(t,n);return e(s=>({schedules:Co(s.schedules,r)})),r}catch(r){throw e({error:r instanceof Error?r.message:Ke("schedule.error.updateFailed")}),r}},deleteSchedule:async t=>{e({error:null});try{await X.deleteSchedule(t),e(n=>({schedules:n.schedules.filter(r=>r.id!==t)}))}catch(n){throw e({error:n instanceof Error?n.message:Ke("schedule.error.deleteFailed")}),n}},toggleSchedule:async(t,n)=>{e({error:null});try{const r=n?await X.enableSchedule(t):await X.disableSchedule(t);return e(s=>({schedules:Co(s.schedules,r)})),r}catch(r){throw e({error:r instanceof Error?r.message:Ke("schedule.error.toggleFailed")}),r}},runSchedule:async t=>{e({error:null});try{const n=await X.runSchedule(t);return e(r=>({schedules:Co(r.schedules,n)})),n}catch(n){throw e({error:n instanceof Error?n.message:Ke("schedule.error.runFailed")}),n}}})),Wx="blade.projects.selected";function ap(){return typeof localStorage>"u"?null:localStorage.getItem(Wx)}function Eo(e){typeof localStorage<"u"&&localStorage.setItem(Wx,e)}const i5=new Set(["queued","running","completed","failed","cancelled","interrupted"]),sc=new Set(["default","autoEdit","yolo","plan"]),cp=new Set(["auto","off","minimal","low","medium","high","xhigh","max"]),lp=new Set(["auto","standard","fast","flex"]),dp=new Set(["auto","low","medium","high"]),up=new Set(["auto","pragmatic","friendly","explanatory"]),pp=new Set(["high","medium","low"]),fp=new Set(["feature","bug","maintenance","research"]);function o5(e){return typeof e=="string"&&i5.has(e)}function a5(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(!["changedFiles","additions","deletions","commits"].some(r=>typeof t[r]!="number"||!Number.isInteger(t[r])||t[r]<0))return{changedFiles:t.changedFiles,additions:t.additions,deletions:t.deletions,commits:t.commits}}function mp(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=Z0(t.code);if(!(!n||typeof t.message!="string"||typeof t.retryable!="boolean"))return{code:n,message:Ke(Ep(n)),retryable:X0(n)}}function c5(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(!(!["applied","discarded","conflicted"].includes(String(t.status))||typeof t.updatedAt!="string"))return{status:t.status,updatedAt:t.updatedAt,...typeof t.sourceCommit=="string"?{sourceCommit:t.sourceCommit}:{},...typeof t.changedFiles=="number"&&Number.isInteger(t.changedFiles)&&t.changedFiles>=0?{changedFiles:t.changedFiles}:{},...typeof t.message=="string"?{message:t.message}:{}}}function vs(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=t?e:void 0}const l5=(e,t)=>{let n=null,r=!1,s=!1,i=0;const o=new Map,d=u=>{const m=Re(u),p=++i;o.set(m,p),X.getSession(u).then(h=>{o.get(m)===p&&e(b=>({sessions:hn(b.sessions,h)}))}).catch(()=>{o.get(m)===p&&t().loadSessions()}).finally(()=>{o.get(m)===p&&o.delete(m)})},f=u=>{const m=Re(u),p=++i;o.set(m,p),queueMicrotask(()=>{o.get(m)===p&&o.delete(m)})};return{taskEventsConnected:!1,taskEventConnectionState:"connecting",taskEventUnsubscribe:null,taskWorkspaceInfo:null,isTaskWorkspaceLoading:!1,taskWorkspaceError:null,boundProjects:[],selectedProjectPath:ap(),isDispatchingTask:!1,isUpdatingTaskAdmission:!1,isBindingProject:!1,cancellingTaskKeys:[],retryingTaskKeys:[],updatingTaskKeys:[],taskDeliveryActions:{},unreadTaskKeys:ZF(),handleTaskEvent:u=>{if(u.type==="session.created"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;d({sessionId:I,projectPath:T});return}if(u.type==="session.deleted"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;const M={sessionId:I,projectPath:T};f(M),t().removeSession(M);return}if(u.type==="session.archived"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;const M={sessionId:I,projectPath:T};f(M),t().removeSession(M),t().loadArchivedSessions();return}if(u.type==="session.unarchived"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;d({sessionId:I,projectPath:T}),t().loadArchivedSessions();return}if(u.type==="session.updated"){const I=u.properties.sessionId,T=u.properties.projectPath,M=u.properties.title,$=u.properties.selectedModelId,te=u.properties.permissionMode,O=u.properties.reasoningEffort,J=u.properties.serviceTier,ae=u.properties.responseVerbosity,ce=u.properties.communicationStyle,le=u.properties.taskPriority,xe=u.properties.taskKind,Z=u.properties.taskDueAt;if(typeof I!="string"||typeof T!="string"||!(typeof M=="string"&&M.trim()||typeof $=="string"&&$.trim()||sc.has(te)||cp.has(O)||lp.has(J)||dp.has(ae)||up.has(ce)||pp.has(le)||fp.has(xe)||Z===null||typeof Z=="string"&&Number.isFinite(Date.parse(Z))))return;const de={sessionId:I,projectPath:T};if(oe(t().currentSessionRef,de)&&sc.has(te)&&Mt.getState().setMode(te),!t().sessions.some(ue=>oe(he(ue),de))){d(de);return}e(ue=>({sessions:ue.sessions.map(ve=>oe({sessionId:ve.sessionId,projectPath:ve.projectPath},de)?{...ve,...typeof M=="string"&&M.trim()?{title:M}:{},...typeof $=="string"&&$.trim()?{selectedModelId:$}:{},...sc.has(te)?{permissionMode:te}:{},...cp.has(O)?{reasoningEffort:O}:{},...lp.has(J)?{serviceTier:J}:{},...dp.has(ae)?{responseVerbosity:ae}:{},...up.has(ce)?{communicationStyle:ce}:{},...pp.has(le)?{taskPriority:le}:{},...fp.has(xe)?{taskKind:xe}:{},...Z===null?{taskDueAt:void 0}:typeof Z=="string"&&Number.isFinite(Date.parse(Z))?{taskDueAt:Z}:{}}:ve)}));return}if(u.type==="task.delivery"){const I=u.properties.sessionId,T=u.properties.projectPath,M=c5(u.properties.taskDelivery);if(typeof I!="string"||typeof T!="string"||!M)return;const $={sessionId:I,projectPath:T},te=u.properties.taskWorktreeRemoved===!0;e(O=>({sessions:O.sessions.map(J=>oe(he(J),$)?{...J,taskDelivery:M,...te?{taskWorktreePath:void 0,taskWorktreeBranch:void 0}:{},lastMessageTime:typeof u.properties.updatedAt=="string"?u.properties.updatedAt:J.lastMessageTime}:J)}));return}if(u.type==="interaction.pending"){const I=u.properties.sessionId,T=u.properties.projectPath,M=u.properties.interactionType,$=u.properties.requestId;if(typeof I!="string"||typeof T!="string"||M!=="permission"&&M!=="question"&&M!=="elicitation"||typeof $!="string"||!$)return;const te={sessionId:I,projectPath:T},O=t().sessions.find(ae=>oe(he(ae),te));if(!O){t().loadSessions();return}if(e(ae=>({sessions:ae.sessions.map(ce=>oe(he(ce),te)?{...ce,pendingInteraction:{type:M,requestId:$}}:ce)})),!(typeof document<"u"&&document.visibilityState==="visible"&&oe(t().currentSessionRef,te))&&Xr.getState().notifyErrors){const ce=O.title??O.sessionId??I;sp({ref:te,title:`Blade · ${Ke(M==="question"?"attention.notification.question":M==="elicitation"?"attention.notification.elicitation":"attention.notification.permission")}`,body:ce,onOpen:le=>{typeof window>"u"||(window.focus(),window.dispatchEvent(new CustomEvent(Wo,{detail:le})))}})}return}if(u.type==="interaction.resolved"){const I=u.properties.sessionId,T=u.properties.projectPath,M=u.properties.requestId;if(typeof I!="string"||typeof T!="string"||typeof M!="string")return;const $={sessionId:I,projectPath:T};e(te=>({sessions:te.sessions.map(O=>{var J;return oe(he(O),$)&&((J=O.pendingInteraction)==null?void 0:J.requestId)===M?{...O,pendingInteraction:void 0}:O})}));return}if(u.type==="schedule.fired"){s5.getState().loadSchedules();return}if(u.type!=="task.status")return;const m=u.properties.sessionId,p=u.properties.projectPath,h=u.properties.taskStatus;if(typeof m!="string"||typeof p!="string"||!o5(h))return;const b={sessionId:m,projectPath:p},k=vs(u.properties.taskInFlight,0),S=vs(u.properties.taskQueueDepth,0),C=vs(u.properties.taskConcurrencyLimit,1),x=typeof u.properties.taskAdmissionPaused=="boolean"?u.properties.taskAdmissionPaused:void 0;k!==void 0&&S!==void 0&&C!==void 0&&e(I=>{var T,M;return{taskWorkspaceInfo:I.taskWorkspaceInfo?{...I.taskWorkspaceInfo,taskAdmission:{inFlight:k,queued:S,maxConcurrent:C,maxQueued:((T=I.taskWorkspaceInfo.taskAdmission)==null?void 0:T.maxQueued)??100,paused:x??((M=I.taskWorkspaceInfo.taskAdmission)==null?void 0:M.paused)??!1}}:null}});const N=t().sessions.find(I=>oe(he(I),b)),P=typeof document<"u"&&document.visibilityState==="visible"&&oe(t().currentSessionRef,b),L=YF(N==null?void 0:N.taskStatus,h,P),D=Re(b),j=!t().unreadTaskKeys.includes(D);if(L&&j){e(M=>{const $=[...M.unreadTaskKeys,D];return gi($),{unreadTaskKeys:$}});const I=Xr.getState();if(I.notifySounds&&Vx(h)&&XF(h),h==="completed"?I.notifyBuild:I.notifyErrors){const M=Ke(h==="completed"?"attention.notification.completed":h==="failed"?"attention.notification.failed":"attention.notification.interrupted"),$=mp(u.properties.taskFailure),te=N?Vd({...N,taskStatus:h,taskFailure:$??N.taskFailure,taskStatusReason:typeof u.properties.taskStatusReason=="string"?u.properties.taskStatusReason:N.taskStatusReason,taskPromptSummary:typeof u.properties.taskPromptSummary=="string"?u.properties.taskPromptSummary:N.taskPromptSummary},Ke):($==null?void 0:$.message)??(typeof u.properties.taskStatusReason=="string"?u.properties.taskStatusReason:void 0),O=(N==null?void 0:N.title)??(N==null?void 0:N.sessionId)??m;sp({ref:b,title:`Blade · ${M}`,body:te?`${O} · ${te}`:O,onOpen:J=>{typeof window>"u"||(window.focus(),window.dispatchEvent(new CustomEvent(Wo,{detail:J})))}})}}if(!N){d(b);return}e(I=>({sessions:I.sessions.map(T=>oe({sessionId:T.sessionId,projectPath:T.projectPath},b)?{...T,taskStatus:h,taskStatusReason:typeof u.properties.taskStatusReason=="string"?u.properties.taskStatusReason:void 0,taskFailure:h==="failed"?mp(u.properties.taskFailure)??T.taskFailure:void 0,taskPromptSummary:typeof u.properties.taskPromptSummary=="string"?u.properties.taskPromptSummary:T.taskPromptSummary,taskStartedAt:typeof u.properties.taskStartedAt=="string"?u.properties.taskStartedAt:h==="queued"?void 0:T.taskStartedAt,taskCompletedAt:typeof u.properties.taskCompletedAt=="string"?u.properties.taskCompletedAt:h==="queued"||h==="running"?void 0:T.taskCompletedAt,taskDiffStat:a5(u.properties.taskDiffStat)??T.taskDiffStat,taskQueuePosition:h==="queued"?vs(u.properties.taskQueuePosition,1)??T.taskQueuePosition:void 0,taskQueueDepth:h==="queued"?vs(u.properties.taskQueueDepth,0)??T.taskQueueDepth:void 0,taskConcurrencyLimit:vs(u.properties.taskConcurrencyLimit,1)??T.taskConcurrencyLimit,lastMessageTime:typeof u.properties.updatedAt=="string"?u.properties.updatedAt:T.lastMessageTime}:T)}))},subscribeToTaskEvents:async()=>{if(r=!0,!t().taskEventUnsubscribe){if(n)return n;e({taskEventsConnected:!1,taskEventConnectionState:"connecting"}),n=(async()=>{try{const u=await X.openTaskEventSubscription(m=>t().handleTaskEvent(m),{onConnectionChange:m=>{e({taskEventsConnected:m})},onConnectionStateChange:m=>{r&&(m==="reconnecting"||m==="offline")&&(s=!0),e({taskEventsConnected:m==="connected",taskEventConnectionState:m}),m==="connected"&&s&&(s=!1,Promise.all([t().loadSessions(),t().loadTaskWorkspaceInfo(),t().loadBoundProjects(),Mt.getState().loadModels()]))}});if(!r||t().taskEventUnsubscribe){u();return}e({taskEventUnsubscribe:u})}catch(u){throw s=!0,e({taskEventsConnected:!1,taskEventConnectionState:"offline"}),u}})();try{await n}finally{n=null}}},reconnectTaskEvents:async()=>{s=!0,t().unsubscribeFromTaskEvents(),await t().subscribeToTaskEvents()},unsubscribeFromTaskEvents:()=>{var u,m;r=!1,(m=(u=t()).taskEventUnsubscribe)==null||m.call(u),e({taskEventUnsubscribe:null,taskEventsConnected:!1,taskEventConnectionState:"offline"})},loadTaskWorkspaceInfo:async()=>{e({isTaskWorkspaceLoading:!0,taskWorkspaceError:null});try{const u=await X.getWorkspaceInfo();e({taskWorkspaceInfo:u,isTaskWorkspaceLoading:!1})}catch(u){e({isTaskWorkspaceLoading:!1,taskWorkspaceError:u instanceof Error?u.message:"Failed to load task workspace"})}},loadBoundProjects:async()=>{try{const u=await X.listProjects(),m=ap(),p=u.find(h=>h.available&&h.path===m)??u.find(h=>h.isCurrent)??u.find(h=>h.available);p&&Eo(p.path),e({boundProjects:u,selectedProjectPath:(p==null?void 0:p.path)??null})}catch(u){e({error:u instanceof Error?u.message:"Failed to load projects"})}},bindProject:async u=>{e({isBindingProject:!0,error:null});try{const m=await X.bindProject(u);Eo(m.path),e(p=>({boundProjects:[...p.boundProjects.filter(h=>h.path!==m.path),m].sort((h,b)=>h.isCurrent!==b.isCurrent?h.isCurrent?-1:1:h.name.localeCompare(b.name)),selectedProjectPath:m.path,isBindingProject:!1}))}catch(m){throw e({isBindingProject:!1,error:m instanceof Error?m.message:"Failed to bind project"}),m}},unbindProject:async u=>{try{await X.unbindProject(u),e(m=>{const p=m.boundProjects.filter(b=>b.path!==u||b.isCurrent),h=m.selectedProjectPath===u?p.find(b=>b.isCurrent)??p.find(b=>b.available):void 0;return h&&Eo(h.path),{boundProjects:p,...h?{selectedProjectPath:h.path}:{}}})}catch(m){throw e({error:m instanceof Error?m.message:"Failed to unbind project"}),m}},selectProject:u=>{Eo(u),e({selectedProjectPath:u})},markTaskRead:u=>{const m=Re(u);e(p=>{const h=p.unreadTaskKeys.filter(b=>b!==m);return gi(h),{unreadTaskKeys:h}})},clearUnreadTasks:()=>{gi([]),e({unreadTaskKeys:[]})},setTaskAdmissionPaused:async u=>{if(!t().isUpdatingTaskAdmission){e({isUpdatingTaskAdmission:!0,error:null,errorContext:null});try{const m=await X.setTaskAdmissionPaused(u);e(p=>({taskWorkspaceInfo:p.taskWorkspaceInfo?{...p.taskWorkspaceInfo,taskAdmission:m}:p.taskWorkspaceInfo}))}catch(m){throw e({error:m instanceof Error?m.message:"Failed to update task admission",errorContext:{kind:"task_action"}}),m}finally{e({isUpdatingTaskAdmission:!1})}}},updateTask:async(u,m)=>{const p=Re(u);if(!t().updatingTaskKeys.includes(p)){e(h=>({updatingTaskKeys:[...h.updatingTaskKeys,p],error:null,errorContext:null}));try{const h=await X.updateTask(u,m);e(b=>({sessions:hn(b.sessions,h)}))}catch(h){throw e({error:h instanceof Error?h.message:"Failed to update task",errorContext:{kind:"task_action",sessionRef:u}}),h}finally{e(h=>({updatingTaskKeys:h.updatingTaskKeys.filter(b=>b!==p)}))}}},cancelTask:async u=>{const m=Re(u);if(!t().cancellingTaskKeys.includes(m)){e(p=>({cancellingTaskKeys:[...p.cancellingTaskKeys,m],error:null,errorContext:null}));try{await X.abortSession(u);const p=oe(t().currentSessionRef,u);p&&(await t().resyncSessionMessages(u),oe(t().currentSessionRef,u)&&t().unsubscribeFromEvents()),e(h=>({sessions:h.sessions.map(b=>oe(he(b),u)?{...b,taskStatus:"cancelled",taskQueuePosition:void 0,taskQueueDepth:void 0,taskCompletedAt:b.taskCompletedAt??new Date().toISOString()}:b),...p?{isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,currentAssistantMessageId:null,hasToolCalls:!1,eventUnsubscribe:null}:{}}))}catch(p){throw e({error:p instanceof Error?p.message:"Failed to stop task",errorContext:{kind:"task_action",sessionRef:u}}),p}finally{e(p=>({cancellingTaskKeys:p.cancellingTaskKeys.filter(h=>h!==m)}))}}},retryTask:async u=>{const m=Re(u);if(t().retryingTaskKeys.includes(m))return;const p=t().getNavigationVersion(),h=t().selectedProjectPath,b=()=>t().getNavigationVersion()===p&&t().selectedProjectPath===h;e(k=>({retryingTaskKeys:[...k.retryingTaskKeys,m],error:null,errorContext:null}));try{const k=await X.retryTask(u);e(S=>({sessions:hn(S.sessions,k.session)})),t().markTaskRead(u),b()&&await t().selectSession(he(k.session))}catch(k){throw b()&&e({error:k instanceof Error?k.message:"Failed to retry task",errorContext:{kind:"task_action",sessionRef:u}}),k}finally{e(k=>({retryingTaskKeys:k.retryingTaskKeys.filter(S=>S!==m)}))}},deliverTask:async(u,m)=>{const p=Re(u);if(!t().taskDeliveryActions[p]){e(h=>({taskDeliveryActions:{...h.taskDeliveryActions,[p]:m},error:null,errorContext:null}));try{const h=await X.deliverTask(u,m);e(b=>({sessions:hn(b.sessions,h)})),t().markTaskRead(u)}catch(h){throw e({error:h instanceof Error?h.message:"Failed to deliver task changes",errorContext:{kind:"task_action",sessionRef:u}}),h}finally{e(h=>{const{[p]:b,...k}=h.taskDeliveryActions;return{taskDeliveryActions:k}})}}},dispatchTask:async(u,m)=>{const p=t().getNavigationVersion(),h=t().selectedProjectPath,b=u.projectPath??h??void 0,k=()=>t().getNavigationVersion()===p&&t().selectedProjectPath===h;e({isDispatchingTask:!0,error:null,errorContext:null});try{const S=await X.createTask({...u,projectPath:b});e(C=>({sessions:hn(C.sessions,S.session),isDispatchingTask:!1})),(m==null?void 0:m.selectSession)!==!1&&k()&&await t().selectSession(he(S.session))}catch(S){throw e({isDispatchingTask:!1,...k()?{error:S instanceof Error?S.message:"Failed to dispatch task"}:{}}),S}},startCodeReview:async u=>{const m=t().getNavigationVersion(),p=t().selectedProjectPath,h=u.projectPath??p??void 0,b=()=>t().getNavigationVersion()===m&&t().selectedProjectPath===p;e({isDispatchingTask:!0,error:null,errorContext:null});let k,S=!1;try{k=await X.createSession(h,"Code Review");const C=he(k);await X.startCodeReview(C,{kind:u.kind,...u.ref?{ref:u.ref}:{},...u.instructions?{instructions:u.instructions}:{},...u.modelId?{modelId:u.modelId}:{}}),S=!0;const x={...k,taskStatus:"running",taskStatusReason:Ke("taskHome.review.running"),taskPromptSummary:`/review ${u.kind}${u.ref?` ${u.ref}`:""}`};e(N=>({sessions:hn(N.sessions,x),isDispatchingTask:!1})),b()&&await t().selectSession(C)}catch(C){throw k&&!S&&await X.deleteSession(he(k)).catch(()=>{}),e({isDispatchingTask:!1,...b()?{error:C instanceof Error?C.message:Ke("taskHome.review.startFailed")}:{}}),C}}}},d5=e=>({tokenUsage:li,updateTokenUsage:t=>e(n=>{const{costUsd:r,...s}=t;return{tokenUsage:{...n.tokenUsage,...s,totalInputTokens:n.tokenUsage.totalInputTokens+Math.max(0,t.inputTokens??0),totalOutputTokens:n.tokenUsage.totalOutputTokens+Math.max(0,t.outputTokens??0),cacheReadTokens:n.tokenUsage.cacheReadTokens+Math.max(0,t.cacheReadTokens??0),cacheWriteTokens:n.tokenUsage.cacheWriteTokens+Math.max(0,t.cacheWriteTokens??0),estimatedCostUsd:n.tokenUsage.estimatedCostUsd+Math.max(0,r??0)}}}),resetContextUsage:()=>e(t=>({tokenUsage:{...t.tokenUsage,inputTokens:0,outputTokens:0,totalTokens:0}})),setMaxContextTokens:(t,n=!1)=>e(r=>({tokenUsage:{...r.tokenUsage,maxContextTokens:t,isDefaultMaxTokens:n}}))}),H=uo()((...e)=>({...t5(...e),...l5(...e),...HF(...e),...n5(...e),...d5(...e)}));function u5(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function p5({open:e,onOpenChange:t}){const n=Ut(),r=H(j=>j.currentSessionRef),s=H(j=>j.isStreaming),i=H(j=>j.isTemporarySession),o=H(j=>j.rewindSession),[d,f]=y.useState([]),[u,m]=y.useState(null),[p,h]=y.useState(!1),[b,k]=y.useState(!1),[S,C]=y.useState(!1),[x,N]=y.useState(null);y.useEffect(()=>{if(!e||!r)return;let j=!1;return k(!0),N(null),f([]),m(null),h(!1),X.listRewindCheckpoints(r).then(I=>{var T;j||(f(I),m(((T=I[0])==null?void 0:T.messageId)??null))}).catch(I=>{j||N(I instanceof Error?I.message:n("chat.rewind.loadFailed"))}).finally(()=>{j||k(!1)}),()=>{j=!0}},[r,e]);const P=y.useMemo(()=>d.find(j=>j.messageId===u)??null,[d,u]),L=!!P&&!b&&!S&&!s&&!i,D=async()=>{if(!P||!L)return;C(!0),N(null);const j=await o(P.messageId,p?"both":"conversation");C(!1),j?t(!1):N(n("chat.rewind.failed"))};return a.jsx(Qc,{open:e,onOpenChange:t,children:a.jsxs(Xo,{className:"max-w-[620px] gap-0 overflow-hidden border-[#E5E7EB] bg-white p-0 dark:border-zinc-800 dark:bg-[#09090b]",children:[a.jsx(Yc,{className:"border-b border-[#E5E7EB] px-6 py-5 dark:border-zinc-800",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-md bg-[#F3F4F6] text-[#4B5563] dark:bg-zinc-800 dark:text-zinc-300",children:a.jsx(gu,{className:"h-4 w-4"})}),a.jsxs("div",{children:[a.jsx(ea,{className:"text-[15px] font-semibold text-[#111827] dark:text-zinc-100",children:n("chat.rewind.title")}),a.jsx(ta,{className:"mt-1 text-[12px] text-[#6B7280] dark:text-zinc-400",children:n("chat.rewind.description")})]})]})}),a.jsxs("div",{className:"min-h-[260px] px-6 py-4",children:[b&&a.jsxs("div",{className:"flex h-[220px] items-center justify-center text-[#6B7280] dark:text-zinc-400",children:[a.jsx(mt,{className:"mr-2 h-4 w-4 animate-spin"}),a.jsx("span",{className:"text-xs font-mono",children:n("chat.rewind.loading")})]}),!b&&x&&a.jsx("div",{role:"alert",className:"rounded-md border border-rose-200 bg-rose-50 px-4 py-3 text-xs text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300",children:x}),!b&&!x&&d.length===0&&a.jsxs("div",{className:"flex h-[220px] flex-col items-center justify-center text-center",children:[a.jsx(gu,{className:"mb-3 h-5 w-5 text-[#9CA3AF] dark:text-zinc-600"}),a.jsx("p",{className:"text-sm text-[#4B5563] dark:text-zinc-300",children:n("chat.rewind.empty")})]}),!b&&d.length>0&&a.jsx("div",{role:"radiogroup","aria-label":n("chat.rewind.checkpointAria"),className:"max-h-[310px] space-y-1 overflow-y-auto",children:d.map(j=>{const I=j.messageId===u;return a.jsxs("button",{type:"button",role:"radio","aria-checked":I,onClick:()=>m(j.messageId),className:W("w-full rounded-md border px-4 py-3 text-left transition-colors",I?"border-[#22C55E] bg-[#F0FDF4] dark:border-[#22C55E] dark:bg-[#052E16]/50":"border-transparent hover:bg-[#F9FAFB] dark:hover:bg-zinc-900"),children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsx("p",{className:"line-clamp-2 text-[13px] leading-5 text-[#111827] dark:text-zinc-100",children:j.preview||n("chat.rewind.userMessage")}),a.jsx("span",{className:"shrink-0 text-[10px] font-mono text-[#9CA3AF] dark:text-zinc-500",children:u5(j.createdAt)})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-3 text-[10px] font-mono text-[#6B7280] dark:text-zinc-500",children:[a.jsx("span",{children:j.messageId.slice(0,10)}),j.fileCount>0&&a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(dy,{className:"h-3 w-3"}),j.fileCount===1?n("chat.rewind.fileCountOne",{count:j.fileCount}):n("chat.rewind.fileCountMany",{count:j.fileCount})]})]})]},j.messageId)})})]}),a.jsx("div",{className:"border-t border-[#E5E7EB] px-6 py-4 dark:border-zinc-800",children:a.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[a.jsx("input",{type:"checkbox",checked:p,disabled:!P||P.fileCount===0,onChange:j=>h(j.target.checked),className:"mt-0.5 h-4 w-4 accent-[#16A34A] disabled:opacity-40"}),a.jsxs("span",{children:[a.jsx("span",{className:"block text-[12px] font-medium text-[#374151] dark:text-zinc-200",children:n("chat.rewind.restoreCode")}),a.jsx("span",{className:"mt-0.5 block text-[11px] text-[#6B7280] dark:text-zinc-500",children:n("chat.rewind.restoreCodeHint")})]})]})}),a.jsxs(Gp,{className:"border-t border-[#E5E7EB] px-6 py-4 dark:border-zinc-800",children:[a.jsx(Kr,{variant:"ghost",onClick:()=>t(!1),disabled:S,children:n("chat.rewind.cancel")}),a.jsxs(Kr,{onClick:()=>void D(),disabled:!L,className:"bg-[#16A34A] text-white hover:bg-[#15803D]",children:[S?a.jsx(mt,{className:"mr-2 h-4 w-4 animate-spin"}):a.jsx(Zo,{className:"mr-2 h-4 w-4"}),n("chat.rewind.confirm")]})]})]})})}function Jx({inFlight:e,queued:t,maxConcurrent:n,compact:r=!1,className:s}){const i=Ut(),o=Math.max(1,n),d=Array.from({length:Math.min(o,12)}),f=Math.min(e,o);return a.jsxs("div",{className:W("inline-flex items-center gap-2 font-mono",r?"text-[10.5px]":"text-[11px]",s),title:i("capacity.title",{inFlight:e,queued:t,max:n}),children:[a.jsx("span",{className:W("inline-flex items-center gap-[3px] rounded-sm",r?"px-0":"px-0.5"),children:d.map((u,m)=>{const p=m<f;return a.jsx("span",{className:W("block",r?"h-2.5 w-[3px] rounded-[1px]":"h-3 w-[3px] rounded-[1px]",p?"bg-[hsl(var(--deck-accent))] shadow-[0_0_4px_hsl(var(--deck-accent)/0.65)]":"bg-[hsl(var(--deck-border-strong))]/60")},m)})}),a.jsxs("span",{className:"tabular-nums text-[hsl(var(--deck-ink-muted))]",children:[a.jsx("span",{className:"text-[hsl(var(--deck-ink))]",children:e}),a.jsx("span",{className:"mx-[2px] opacity-40",children:"/"}),a.jsx("span",{children:n}),a.jsx("span",{className:"opacity-60",children:i("capacity.suffix.running")})]}),t>0&&a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm border border-amber-300/60 bg-amber-50 px-1.5 py-[1px] text-[10px] text-amber-800 dark:border-amber-800/60 dark:bg-amber-950/40 dark:text-amber-300",children:[a.jsx("span",{className:"h-1 w-1 rounded-full bg-amber-500"}),i("capacity.queued",{queued:t})]})]})}function hp(){const e=document.querySelector("textarea[data-blade-composer]:not(:disabled)");if(!e)return!1;e.focus();const t=e.value.length;return e.setSelectionRange(t,t),!0}const Qx=[{id:"searchTasks",key:"k",primaryModifier:!0,scope:"Global"},{id:"openCommands",key:"p",primaryModifier:!0,shiftKey:!0,scope:"Global"},{id:"newTask",key:"n",primaryModifier:!1,scope:"Global"},{id:"focusComposer",key:"/",primaryModifier:!1,scope:"Chat"},{id:"toggleSidebar",key:"b",primaryModifier:!0,scope:"Layout"}];function f5(e){const t=e.key.toLocaleLowerCase();return Qx.find(n=>{if(n.key!==t||e.altKey||e.shiftKey!==!!n.shiftKey)return!1;const r=e.metaKey||e.ctrlKey;return n.primaryModifier?r:!r})??null}function m5(e){return e instanceof Element?!!e.closest('input, textarea, select, [contenteditable="true"], [role="textbox"], [role="combobox"]'):!1}function h5(e){var r;const t=typeof navigator>"u"?null:navigator,n=((r=t==null?void 0:t.userAgentData)==null?void 0:r.platform)??(t==null?void 0:t.platform)??"";return/mac|iphone|ipad|ipod/i.test(n)}function g5(e,t){const n=e.key==="/"?"/":e.key.toLocaleUpperCase(),r=h5();return[...e.primaryModifier?[r?"⌘":"Ctrl"]:[],...e.shiftKey?[r?"⇧":"Shift"]:[],n]}function Dc(e,t){const n=Qx.find(r=>r.id===e);return n?g5(n).join(""):""}const Yx="blade.sidebar.view",Zx="blade.preview.width",ic=640,b5=360,k5=960,x5=()=>{if(typeof localStorage>"u")return"project";const e=localStorage.getItem(Yx);return e==="status"||e==="project"?e:"project"},Xx=e=>Math.min(k5,Math.max(b5,Math.round(e))),y5=()=>{if(typeof localStorage>"u")return ic;const e=localStorage.getItem(Zx);if(!e)return ic;const t=Number(e);return Number.isFinite(t)?Xx(t):ic},sn=uo(e=>({mainView:"workspace",setMainView:t=>e(n=>({mainView:t,isFilePreviewOpen:t==="board"?!1:n.isFilePreviewOpen})),boardProjectPath:null,setBoardProjectPath:t=>e({boardProjectPath:t}),isSidebarOpen:!0,toggleSidebar:()=>e(t=>({isSidebarOpen:!t.isSidebarOpen})),setSidebarOpen:t=>e({isSidebarOpen:t}),sidebarView:x5(),setSidebarView:t=>{typeof localStorage<"u"&&localStorage.setItem(Yx,t),e({sidebarView:t})},isFilePreviewOpen:!1,toggleFilePreview:()=>e(t=>({isFilePreviewOpen:!t.isFilePreviewOpen})),setFilePreviewOpen:t=>e({isFilePreviewOpen:t}),previewWidth:y5(),setPreviewWidth:t=>{const n=Xx(t);typeof localStorage<"u"&&localStorage.setItem(Zx,String(n)),e({previewWidth:n})},previewTab:"diff",setPreviewTab:t=>e({previewTab:t}),previewTargetPath:null,previewRequestId:0,openFilePreview:t=>e(n=>({isFilePreviewOpen:!0,previewTab:(t==null?void 0:t.tab)??n.previewTab,previewTargetPath:(t==null?void 0:t.targetPath)??null,previewRequestId:n.previewRequestId+1})),isSettingsOpen:!1,settingsSection:"general",toggleSettings:()=>e(t=>({isSettingsOpen:!t.isSettingsOpen,...t.isSettingsOpen?{}:{settingsSection:"general"}})),openSettings:(t="general")=>e({isSettingsOpen:!0,settingsSection:t}),isTerminalOpen:!1,toggleTerminal:()=>e(t=>({isTerminalOpen:!t.isTerminalOpen})),isTaskSwitcherOpen:!1,taskSwitcherMode:"tasks",setTaskSwitcherOpen:(t,n)=>e(r=>({isTaskSwitcherOpen:t,taskSwitcherMode:n??r.taskSwitcherMode})),setTaskSwitcherMode:t=>e({taskSwitcherMode:t})}));function w5(){const e=sn(s=>s.setTaskSwitcherOpen),t=sn(s=>s.setMainView),n=sn(s=>s.toggleSidebar),r=H(s=>s.startTemporarySession);y.useEffect(()=>{const s=i=>{if(i.repeat)return;const o=f5(i);if(!o)return;const d=sn.getState(),f=d.isTaskSwitcherOpen,u=m5(i.target),m=!!document.querySelector('[role="dialog"]');if(o.id==="searchTasks"||o.id==="openCommands"){if(m&&!f)return;i.preventDefault();const p=o.id==="searchTasks"?"tasks":"commands",h=f&&d.taskSwitcherMode===p;e(!h,p);return}if(!(u||m)){if(o.id==="newTask"){i.preventDefault(),t("workspace"),r(),requestAnimationFrame(()=>hp());return}if(o.id==="focusComposer"){hp()&&i.preventDefault();return}o.id==="toggleSidebar"&&(i.preventDefault(),n())}};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,e,r,n])}const Wd=y.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(jp,{ref:r,className:W("overflow-hidden relative",e),...n,children:[a.jsx(H0,{className:"h-full w-full rounded-[inherit] [&>div]:!block !overflow-auto",children:t}),a.jsx(e0,{}),a.jsx(q0,{})]}));Wd.displayName=jp.displayName;const e0=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>a.jsx(Ip,{ref:r,orientation:t,className:W("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:a.jsx(z0,{className:"relative flex-1 rounded-full bg-border"})}));e0.displayName=Ip.displayName;function bi(e,t){var s;const n=(s=e.title)==null?void 0:s.trim();if(n==="Code Review")return t("session.title.codeReview");if(n)return n;const r=e.firstMessageTime||e.lastMessageTime;if(r){const i=new Date(r);if(!Number.isNaN(i.getTime()))return t("recent.session.fallbackDated",{y:String(i.getFullYear()).slice(-2),m:String(i.getMonth()+1).padStart(2,"0"),d:String(i.getDate()).padStart(2,"0"),hh:String(i.getHours()).padStart(2,"0"),mm:String(i.getMinutes()).padStart(2,"0")})}return t("recent.session.fallbackShort",{id:e.sessionId.slice(0,6)})}async function t0(e,t=!1){const n=await X.exportSessionMarkdown(e,t),r=new Blob([n.markdown],{type:"text/markdown;charset=utf-8"}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=n.filename,i.hidden=!0,document.body.appendChild(i);try{i.click()}finally{i.remove(),await new Promise(o=>{window.setTimeout(()=>{URL.revokeObjectURL(s),o()},0)})}return n}const Yn=G0,Zn=V0,_n=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(K0,{children:a.jsx(Cp,{ref:s,align:t,sideOffset:n,className:W("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 origin-[--radix-popover-content-transform-origin]",e),...r})}));_n.displayName=Cp.displayName;function v5(){const e=Ut(),t=H(k=>k.archivedSessions),n=H(k=>k.archivedCatalogLoadState),r=H(k=>k.archivedCatalogError),s=H(k=>k.loadArchivedSessions),i=H(k=>k.unarchiveSession),o=H(k=>k.setError),[d,f]=y.useState(!1),[u,m]=y.useState(null),[p,h]=y.useState(null),b=k=>{f(k),k&&s()};return a.jsxs(Yn,{open:d,onOpenChange:b,children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex h-8 w-full items-center justify-between rounded-md px-2.5 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]","aria-label":e("archive.open"),children:[a.jsxs("span",{className:"flex items-center gap-2.5",children:[a.jsx(Tp,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),e("archive.title")]}),t.length>0&&a.jsx("span",{className:"rounded-sm bg-[hsl(var(--deck-surface))] px-1.5 py-0.5 text-[9px] text-[hsl(var(--deck-ink-faint))]",children:t.length})]})}),a.jsxs(_n,{role:"dialog","aria-label":e("archive.title"),side:"right",align:"end",sideOffset:8,className:"w-[340px] overflow-hidden p-0",children:[a.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-[hsl(var(--deck-hairline))] px-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.08em] text-[hsl(var(--deck-ink))]",children:e("archive.title")}),a.jsx("div",{className:"text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:e("archive.subtitle")})]}),a.jsx("button",{type:"button",onClick:()=>void s(),"aria-label":e("archive.refresh"),className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(ui,{className:W("h-3 w-3",(n==="loading"||n==="hydrating")&&"animate-spin")})})]}),r?a.jsxs("div",{className:"px-3 py-4 text-[11px] text-red-600 dark:text-red-400",children:[a.jsx("div",{children:r}),a.jsx("button",{type:"button",onClick:()=>void s(),className:"mt-2 font-mono text-[10px] text-[hsl(var(--deck-accent))] focus-visible:outline-none focus-visible:underline",children:e("archive.retry")})]}):t.length===0&&(n==="loading"||n==="hydrating")?a.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(mt,{className:"h-3 w-3 animate-spin"}),e("archive.loading")]}):t.length===0?a.jsx("div",{className:"flex h-24 items-center justify-center px-6 text-center text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:e("archive.empty")}):a.jsx(Wd,{className:"max-h-[340px]",children:a.jsx("div",{className:"divide-y divide-[hsl(var(--deck-hairline))]",children:t.map(k=>{var P;const S=he(k),C=Re(S),x=u===C,N=k.projectPath.split("/").filter(Boolean).at(-1)??k.projectPath;return a.jsxs("div",{className:"flex min-h-[58px] items-center gap-2 px-3 py-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-[11.5px] text-[hsl(var(--deck-ink))]",children:bi(k,e)}),a.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx("span",{className:"truncate",children:N}),k.archivedAt&&a.jsxs(a.Fragment,{children:[a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsx("span",{children:new Date(k.archivedAt).toLocaleString()})]})]}),k.archivedBySessionId!==k.sessionId&&a.jsx("div",{className:"mt-0.5 truncate text-[9px] text-[hsl(var(--deck-accent))]",children:e("archive.inherited",{id:((P=k.archivedBySessionId)==null?void 0:P.slice(0,8))??""})})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[a.jsx("button",{type:"button",disabled:p!==null,onClick:async()=>{h(C);try{await t0(S)}catch(L){o(L instanceof Error?L.message:"Session export failed")}finally{h(null)}},"aria-label":e("session.action.export",{title:bi(k,e)}),title:e("session.action.exportShort"),className:"flex h-7 w-7 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-35",children:p===C?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Np,{className:"h-3.5 w-3.5"})}),a.jsx("button",{type:"button",disabled:x||k.archivedBySessionId!==k.sessionId,onClick:async()=>{m(C);try{await i(S)}finally{m(null)}},"aria-label":e("archive.restore",{title:bi(k,e)}),title:k.archivedBySessionId!==k.sessionId?e("archive.restoreAncestor"):e("archive.restoreShort"),className:"flex h-7 w-7 items-center justify-center rounded text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-35",children:x?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(sy,{className:"h-3.5 w-3.5"})})]})]},C)})})})]})]})}function Jd({className:e,size:t=28,pulse:n=!0}){return a.jsxs("span",{className:W("inline-flex relative justify-center items-center","text-[hsl(var(--deck-ink))]",e),style:{width:t,height:t},"aria-hidden":"true",children:[a.jsxs("svg",{viewBox:"0 0 32 32",width:t,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M16 3 L28 16 L16 29 L4 16 Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("path",{d:"M16 8 L24 16 L16 24",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round",opacity:"0.55"}),a.jsx("path",{d:"M16 3 L20 7",stroke:"hsl(var(--deck-accent))",strokeWidth:"2",strokeLinecap:"round"})]}),n&&a.jsx("span",{className:"absolute top-[3px] right-[3px] h-1.5 w-1.5 rounded-full",style:{background:"hsl(var(--deck-accent-glow))",boxShadow:"0 0 6px hsl(var(--deck-accent-glow) / 0.9)"}})]})}const gp={en:"sidebar.language.en",zh:"sidebar.language.zh"};function n0({className:e,variant:t="pill"}){const{locale:n,setLocale:r}=mw(),s=Ut();if(t==="compact"){const i=n==="en"?"zh":"en";return a.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":s("sidebar.language.aria"),title:s("sidebar.language.label"),className:W("flex justify-center items-center w-10 h-10 font-mono font-medium rounded-md transition-colors text-[11px] text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",e),children:s(gp[n])})}return a.jsx("div",{role:"group","aria-label":s("sidebar.language.aria"),className:W("inline-flex h-8 items-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-[2px] font-mono text-[11px]",e),children:lw.map(i=>{const o=i===n;return a.jsx("button",{type:"button",onClick:()=>r(i),"aria-pressed":o,className:W("flex justify-center items-center px-2 h-full transition-colors min-w-[28px] rounded-[4px]",o?"bg-[hsl(var(--deck-ink))] text-[hsl(var(--deck-canvas))]":"text-[hsl(var(--deck-ink-muted))] hover:text-[hsl(var(--deck-ink))]"),children:s(gp[i])},i)})})}const S5="[data-mobile-navigation-trigger]";function $3(e){return r0(S5,e)}function r0(e,t){const n=document.querySelector(e);return!n||n.getClientRects().length===0?!1:(t.preventDefault(),n.focus({preventScroll:!0}),!0)}function s0({open:e,onOpenChange:t}){const n=Ut(),{boundProjects:r,selectedProjectPath:s,isBindingProject:i,loadBoundProjects:o,bindProject:d,unbindProject:f,selectProject:u,startTemporarySession:m}=H(),[p,h]=y.useState(""),[b,k]=y.useState(null),[S,C]=y.useState(!1),x=y.useRef(0);y.useEffect(()=>{if(e){o();return}x.current+=1,C(!1)},[o,e]);const N=async j=>{await d(j),h(""),m(),t(!1)},P=async j=>{if(j.preventDefault(),!(!p.trim()||i||S)){k(null);try{await N(p.trim())}catch(I){k(I instanceof Error?I.message:n("projects.bind.failed"))}}},L=async()=>{if(S||i)return;const j=++x.current;k(null),C(!0);try{const I=await X.pickProjectDirectory();if(j!==x.current||I.cancelled)return;h(I.path),await N(I.path)}catch(I){if(j!==x.current)return;k(I instanceof Error?I.message:n("projects.pick.failed"))}finally{j===x.current&&C(!1)}},D=j=>{u(j),m(),t(!1)};return e?a.jsx(Qc,{open:e,onOpenChange:t,children:a.jsxs(Xo,{onCloseAutoFocus:j=>r0("[data-project-setup-trigger]",j),className:"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-ink))] sm:max-w-xl",children:[a.jsxs(Yc,{children:[a.jsxs(ea,{className:"flex items-center gap-2 font-mono text-[16px]",children:[a.jsx($o,{className:"h-4 w-4 text-[hsl(var(--deck-accent))]"}),n("projects.dialog.title")]}),a.jsx(ta,{className:"text-[12px] text-[hsl(var(--deck-ink-muted))]",children:n("projects.dialog.description")})]}),a.jsxs("form",{onSubmit:P,className:"flex gap-2",children:[a.jsx("input",{value:p,onChange:j=>h(j.target.value),disabled:i,placeholder:n("projects.bind.placeholder"),"aria-label":n("projects.bind.pathLabel"),className:"h-9 min-w-0 flex-1 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 font-mono text-[12px] outline-none placeholder:text-[hsl(var(--deck-ink-faint))] focus:border-[hsl(var(--deck-accent)/0.65)]"}),a.jsxs("button",{type:"button",onClick:()=>void L(),disabled:S||i,title:n("projects.pick.action"),"aria-label":n("projects.pick.action"),className:"inline-flex h-9 shrink-0 items-center gap-2 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-2.5 font-mono text-[12px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))] disabled:cursor-wait disabled:opacity-50",children:[S?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(uy,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"hidden sm:inline",children:n(S?"projects.pick.picking":"projects.pick.actionShort")})]}),a.jsxs("button",{type:"submit",disabled:!p.trim()||i||S,className:"inline-flex h-9 items-center gap-2 rounded-md bg-[hsl(var(--deck-ink))] px-3 font-mono text-[12px] text-[hsl(var(--deck-canvas))] transition-opacity disabled:opacity-40",children:[i?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx($o,{className:"h-3.5 w-3.5"}),n("projects.bind.action")]})]}),b&&a.jsx("div",{role:"alert",className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 font-mono text-[11px] text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300",children:b}),a.jsx("div",{className:"max-h-72 space-y-1 overflow-y-auto",children:r.map(j=>{const I=j.path===s;return a.jsxs("div",{className:W("group flex items-center gap-3 rounded-md border px-3 py-2",I?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))]":"border-transparent hover:border-[hsl(var(--deck-border))] hover:bg-[hsl(var(--deck-surface))]"),children:[a.jsx(di,{className:W("h-4 w-4 shrink-0",I?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]")}),a.jsxs("button",{type:"button",disabled:!j.available,onClick:()=>D(j.path),className:"min-w-0 flex-1 text-left disabled:cursor-not-allowed disabled:opacity-50",children:[a.jsx("span",{className:"block truncate font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:j.name}),a.jsxs("span",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[j.gitBranch&&a.jsxs(a.Fragment,{children:[a.jsx(Kc,{className:"h-2.5 w-2.5"}),a.jsx("span",{children:j.gitBranch}),a.jsx("span",{children:"·"})]}),a.jsx("span",{className:"truncate",children:j.path}),!j.available&&a.jsxs("span",{className:"shrink-0 text-red-500",children:["· ",n("projects.unavailable")]})]})]}),!j.isCurrent&&a.jsx("button",{type:"button",onClick:()=>void f(j.path).catch(()=>{}),title:n("projects.unbind.action"),"aria-label":n("projects.unbind.action"),className:"rounded p-1.5 text-[hsl(var(--deck-ink-faint))] opacity-0 transition group-hover:opacity-100 hover:bg-red-50 hover:text-red-600 focus-visible:opacity-100 dark:hover:bg-red-950/30",children:a.jsx(Lp,{className:"h-3.5 w-3.5"})})]},j.path)})})]})}):null}const j5={running:"bg-blue-500 dark:bg-blue-400 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse",queued:"bg-amber-400 dark:bg-amber-300",interrupted:"bg-orange-500 dark:bg-orange-400",failed:"bg-red-500 dark:bg-red-400",cancelled:"bg-zinc-400 dark:bg-zinc-500",completed:"bg-[hsl(var(--deck-accent))]"};function I5({session:e,isActive:t,isForking:n,isUnread:r,anyForking:s,isEditing:i,editingTitle:o,title:d,context:f,isCancelling:u,isRetrying:m,isExporting:p,onSelect:h,onCancelTask:b,onRetryTask:k,onFork:S,onArchive:C,onExport:x,onStartRename:N,onDelete:P,onEditingTitleChange:L,onSaveRename:D,onCancelRename:j}){const I=Ut(),[T,M]=y.useState(!1),$=y.useRef(null),te=y.useRef(null);return i?a.jsxs("div",{className:"flex h-9 w-full items-center gap-2 bg-[hsl(var(--deck-surface))] px-3",children:[a.jsx("input",{type:"text",value:o,onChange:O=>L(O.target.value),onKeyDown:O=>{O.key==="Enter"&&D(),O.key==="Escape"&&j()},autoFocus:!0,className:"flex-1 rounded bg-[hsl(var(--deck-canvas))] px-2 py-1 font-mono text-[13px] text-[hsl(var(--deck-ink))] outline-none focus:ring-1 focus:ring-[hsl(var(--deck-accent))]"}),a.jsx("button",{"aria-label":I("session.action.save",{title:d}),onClick:D,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-accent))] hover:bg-[hsl(var(--deck-canvas))]",children:a.jsx(Ap,{className:"w-3 h-3"})}),a.jsx("button",{"aria-label":I("session.action.cancel",{title:d}),onClick:j,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-canvas))]",children:a.jsx(pi,{className:"w-3 h-3"})})]}):a.jsxs("div",{className:W("flex relative items-center w-full transition-colors group min-h-[54px]",t?"bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:[t&&a.jsx("span",{className:"absolute left-0 top-1/2 h-6 w-[2px] -translate-y-1/2 rounded-r bg-[hsl(var(--deck-accent))]"}),a.jsxs("button",{type:"button","aria-label":I("session.action.select",{title:d}),"aria-current":t?"true":void 0,"aria-busy":n?"true":void 0,onClick:h,className:"flex min-h-[54px] min-w-0 flex-1 cursor-pointer items-center gap-2 py-1.5 pl-4 pr-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx("span",{className:W("h-1.5 w-1.5 shrink-0 rounded-full",e.pendingInteraction?"animate-pulse bg-amber-500 shadow-[0_0_5px_rgba(245,158,11,0.75)]":j5[e.taskStatus]),title:e.pendingInteraction?I(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"):e.taskStatus}),a.jsxs("span",{className:"flex-1 min-w-0 font-mono",children:[a.jsxs("span",{className:W("flex gap-2 items-center text-left truncate text-[12px]",t?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:[a.jsx("span",{className:"truncate",children:d}),r&&a.jsx("span",{title:I("taskSwitcher.new"),className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.75)]"}),e.pendingInteraction&&a.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-amber-100 px-1.5 py-0.5 text-[8.5px] text-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:I(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"),children:[a.jsx(Ns,{className:"h-2.5 w-2.5"}),I(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission")]}),e.relationType==="fork"&&e.parentId&&a.jsxs("span",{title:`${I("session.forkedFrom")} ${e.parentId.slice(0,6)}`,"aria-label":`${I("session.forkedFrom")} ${e.parentId.slice(0,6)}`,className:"shrink-0 text-[9px] text-[hsl(var(--deck-accent))]",children:[I("session.forkedFrom")," ",e.parentId.slice(0,6)]}),e.taskRetriedFrom&&a.jsx("span",{title:`${I("session.retriedFrom")} ${e.taskRetriedFrom.sessionId.slice(0,6)}`,className:"shrink-0 text-[9px] text-[hsl(var(--deck-accent))]",children:I("session.retryShort")})]}),a.jsxs("span",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 truncate text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx("span",{className:"truncate",children:f.project}),a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"truncate",children:f.environment}),f.queue&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"text-amber-700 truncate dark:text-amber-400",children:f.queue})]}),f.diff&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"truncate text-[hsl(var(--deck-accent))]",children:f.diff})]})]}),f.reason&&a.jsx("span",{title:f.reason,className:"mt-0.5 block truncate text-[9.5px] text-red-600 dark:text-red-400",children:f.reason})]}),n&&a.jsx(mt,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"})]}),a.jsxs("div",{className:W("flex items-center gap-0.5 pr-2 transition-opacity group-focus-within:opacity-100",e.taskStatus==="running"||e.taskStatus==="queued"||e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled")?"opacity-100":"opacity-50 group-hover:opacity-100"),children:[(e.taskStatus==="running"||e.taskStatus==="queued")&&a.jsx("button",{type:"button","aria-label":I(u?"session.action.stopping":"session.action.stop",{title:d}),disabled:u,onClick:O=>{O.stopPropagation(),b()},className:"flex h-6 w-6 items-center justify-center rounded text-red-500 transition-colors hover:bg-red-500/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:cursor-wait disabled:opacity-60",children:u?a.jsx(mt,{className:"h-3 w-3 animate-spin"}):a.jsx(Wc,{className:"h-3 w-3"})}),e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled")&&a.jsx("button",{ref:$,type:"button","aria-label":I(m?"session.action.retrying":"session.action.retry",{title:d}),disabled:m,onClick:O=>{O.stopPropagation(),k()},className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-60",children:m?a.jsx(mt,{className:"h-3 w-3 animate-spin"}):a.jsx(Zo,{className:"h-3 w-3"})}),a.jsxs(Yn,{open:T,onOpenChange:M,children:[a.jsx(Zn,{asChild:!0,children:a.jsx("button",{type:"button","aria-label":I("session.action.more",{title:d}),"aria-expanded":T,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-canvas))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(xy,{className:"h-3.5 w-3.5"})})}),a.jsxs(_n,{ref:te,role:"menu","aria-label":I("session.action.more",{title:d}),side:"right",align:"start",sideOffset:6,className:"w-40 p-1",onOpenAutoFocus:O=>{var J,ae;O.preventDefault(),(ae=(J=te.current)==null?void 0:J.querySelector('[role="menuitem"]:not([disabled])'))==null||ae.focus()},onKeyDown:O=>{O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),M(!1),window.setTimeout(()=>{var J;return(J=$.current)==null?void 0:J.focus()},0))},children:[a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.fork",{title:d}),disabled:s,onClick:O=>{O.stopPropagation(),S(),M(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-45",children:[a.jsx(py,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.forkShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.rename",{title:d}),onClick:O=>{N(O),M(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none",children:[a.jsx(wy,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.renameShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.archive",{title:d}),disabled:e.taskStatus==="running"||e.taskStatus==="queued",onClick:O=>{O.stopPropagation(),C(),M(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-35",children:[a.jsx(Tp,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.archiveShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.export",{title:d}),disabled:p,onClick:O=>{O.stopPropagation(),x(),M(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-wait disabled:opacity-45",children:[p?a.jsx(mt,{className:"h-3 w-3 animate-spin","aria-hidden":!0}):a.jsx(Np,{className:"h-3 w-3","aria-hidden":!0}),I(p?"session.action.exportingShort":"session.action.exportShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.delete",{title:d}),onClick:O=>{P(O),M(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-red-600 transition-colors hover:bg-red-500/10 focus-visible:bg-red-500/10 focus-visible:outline-none dark:text-red-400",children:[a.jsx(Lp,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.deleteShort")]})]})]})]})]})}function C5({onExpand:e,onNewChat:t,onOpenBoard:n,onOpenTaskSwitcher:r,onToggleTerminal:s,onToggleSettings:i,isTerminalOpen:o,taskEventsConnected:d,unreadCount:f,boardActive:u,className:m}){const p=Ut(),h=[{icon:Rp,action:i,labelKey:"sidebar.section.settings"}];return a.jsxs("div",{className:W("flex flex-col gap-2 items-center py-5 h-screen border-r w-[64px] border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]",m),children:[a.jsx("button",{onClick:e,className:"rounded-md p-1 transition-colors hover:bg-[hsl(var(--deck-surface))]","aria-label":p("sidebar.action.expand"),children:a.jsx(Jd,{size:28})}),a.jsx("button",{onClick:t,"aria-label":p("sidebar.action.newTaskShort"),title:p("sidebar.action.newTaskShort"),className:"mt-6 flex h-10 w-10 items-center justify-center rounded-md bg-[hsl(var(--deck-ink))] text-[hsl(var(--deck-canvas))] transition-colors hover:bg-[hsl(var(--deck-ink))]/85",children:a.jsx(Gc,{className:"h-4 w-4 stroke-[2.5]"})}),a.jsx("button",{type:"button",onClick:n,"aria-label":p("sidebar.action.taskBoard"),"aria-current":u?"page":void 0,title:p("sidebar.action.taskBoard"),className:W("flex h-10 w-10 items-center justify-center rounded-md border transition-colors",u?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-transparent text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]"),children:a.jsx(Op,{className:"h-4 w-4"})}),a.jsx("button",{onClick:s,"aria-label":p("sidebar.action.terminalToggle"),title:p("sidebar.action.terminal"),className:W("flex h-10 w-10 items-center justify-center rounded-md border transition-colors",o?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-transparent text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]"),children:a.jsx(Fp,{className:"w-4 h-4"})}),a.jsxs("button",{onClick:r,"aria-label":p("sidebar.action.searchTasks"),title:`${p("sidebar.action.searchTasks")} (${Dc("searchTasks")})`,className:"relative flex h-10 w-10 items-center justify-center rounded-md border border-transparent text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:[a.jsx(Vc,{className:"h-4 w-4"}),f>0&&a.jsx("span",{"aria-label":p("sidebar.unreadTasks",{count:f}),className:"absolute right-0.5 top-0.5 flex min-h-4 min-w-4 items-center justify-center rounded-full bg-[hsl(var(--deck-accent))] px-1 font-mono text-[8px] font-semibold text-white",children:f>99?"99+":f})]}),a.jsx("div",{className:"flex-1"}),a.jsx("div",{className:"my-2 h-px w-6 bg-[hsl(var(--deck-hairline))]"}),h.map(({icon:b,action:k,labelKey:S})=>a.jsx("button",{"data-settings-trigger":!0,onClick:k,"aria-label":p(S),title:p(S),className:"flex h-10 w-10 items-center justify-center rounded-md text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:a.jsx(b,{className:"w-4 h-4"})},S)),a.jsx(n0,{variant:"compact"}),a.jsx("div",{className:"mt-1",children:a.jsx("div",{role:"status","aria-label":p(d?"sidebar.status.feedLive":"sidebar.status.feedOffline"),className:W("h-2 w-2 rounded-full",d?"bg-[hsl(var(--deck-accent))] shadow-[0_0_6px_hsl(var(--deck-accent-glow)/0.9)]":"bg-[hsl(var(--deck-ink-faint))]/60"),title:p(d?"sidebar.status.feedLive":"sidebar.status.feedOffline")})})]})}const i0="blade.sidebar.project-order.v1";function fo(e){const t=new Set,n=[];for(const r of e)typeof r!="string"||!r||t.has(r)||(t.add(r),n.push(r));return n}function E5(){if(typeof window>"u")return[];try{const e=JSON.parse(window.localStorage.getItem(i0)??"[]");return Array.isArray(e)?fo(e):[]}catch{return[]}}function T5(e){if(!(typeof window>"u"))try{window.localStorage.setItem(i0,JSON.stringify(fo(e)))}catch{}}function A5(e,t){const n=new Map(fo(t).map((s,i)=>[s,i])),r=n.size;return e.map((s,i)=>({project:s,rank:n.get(s.path)??r+i})).sort((s,i)=>s.rank-i.rank).map(({project:s})=>s)}function P5(e,t,n){const r=fo(e),s=r.indexOf(t),i=r.indexOf(n);if(s<0||i<0||s===i)return r;const[o]=r.splice(s,1);return r.splice(i,0,o),r}function N5(e,t,n){const r=fo(e),s=r.indexOf(t),i=s+n;return s<0||i<0||i>=r.length||([r[s],r[i]]=[r[i],r[s]]),r}function O5({name:e,path:t,count:n,countIsPartial:r=!1,isActive:s,hasRunning:i,unreadCount:o,collapsed:d,onToggle:f,onSelect:u,onCreateTask:m,reorderPosition:p,reorderCount:h,isDragging:b=!1,onDragStart:k,onDragEnd:S,onReorderKeyDown:C}){const x=Ut();return a.jsxs("div",{className:W("group/proj flex w-full items-center gap-2 px-5 pb-1.5 pt-3 text-left transition-colors","hover:bg-[hsl(var(--deck-surface))]/40"),children:[a.jsx("button",{type:"button",draggable:!0,"data-project-drag-handle":t,onDragStart:k,onDragEnd:S,onKeyDown:C,"aria-label":x("sidebar.project.reorder",{name:e,position:p,count:h}),title:x("sidebar.project.reorderHint"),className:W("-ml-2 flex h-6 w-4 shrink-0 cursor-grab items-center justify-center rounded-sm text-[hsl(var(--deck-ink-faint))] opacity-45 transition-[opacity,color,background-color] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-ink-muted))] hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] active:cursor-grabbing group-hover/proj:opacity-100",b&&"cursor-grabbing opacity-100 text-[hsl(var(--deck-accent))]"),children:a.jsx(fy,{className:"h-3.5 w-3.5"})}),a.jsx("button",{type:"button",onClick:f,"aria-expanded":!d,"aria-label":x(d?"sidebar.project.expand":"sidebar.project.collapse",{name:e}),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(cy,{className:W("h-3 w-3 text-[hsl(var(--deck-ink-faint))] transition-transform duration-150",!d&&"rotate-90")})}),a.jsxs("button",{type:"button",onClick:u??f,title:t,"aria-current":s?"true":void 0,className:"flex min-h-6 min-w-0 flex-1 items-center gap-2 rounded-sm text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx(di,{className:W("h-3.5 w-3.5 shrink-0",s?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]")}),a.jsx("span",{className:W("flex-1 truncate font-mono text-[11.5px] font-medium tracking-[-0.01em]",s?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:e}),i&&a.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-blue-500 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse dark:bg-blue-400","aria-hidden":!0}),o>0&&a.jsx("span",{"aria-label":x("sidebar.unreadTasks",{count:o}),className:"shrink-0 rounded-full bg-[hsl(var(--deck-accent))] px-1.5 py-0.5 font-mono text-[8px] font-semibold text-white",children:o}),a.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[n.toString().padStart(2,"0"),r?"+":""]})]}),m&&a.jsx("button",{type:"button",onClick:m,title:x("sidebar.project.newTask",{name:e}),"aria-label":x("sidebar.project.newTask",{name:e}),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm text-[hsl(var(--deck-ink-faint))] opacity-0 transition-[opacity,color,background-color] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-accent))] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] group-hover/proj:opacity-100",children:a.jsx(Gc,{className:"h-3.5 w-3.5"})})]})}function _c(e){const t=e.lastMessageTime||e.firstMessageTime;if(!t)return 0;const n=new Date(t).getTime();return Number.isNaN(n)?0:n}function bp(e){return e.pendingInteraction?0:e.taskStatus==="running"?1:e.taskStatus==="queued"?2:3}function Qd(e,t){return bp(e)-bp(t)||_c(t)-_c(e)}const R5=["running","queued","interrupted","failed","cancelled","completed"],M5={running:"RUNNING",queued:"QUEUED",interrupted:"INTERRUPTED",failed:"FAILED",cancelled:"CANCELLED",completed:"DONE"},Ss=e=>e.length>1?e.replace(/\/+$/,""):e;function o0(e){const t=new Map;for(const n of e){if(!n)continue;const r=Re(he(n));t.has(r)||t.set(r,n)}return Array.from(t.values())}function $5(e){const t=o0(e),n=[];for(const r of R5){const s=t.filter(i=>i.taskStatus===r).sort(Qd);s.length>0&&n.push({code:M5[r],status:r,sessions:s})}return n}function F5(e,t,n=[]){const r=o0(e),s=new Map,i=n.map(Ss),o=new Map(i.map((u,m)=>[u,m]));for(const u of i)s.set(u,[]);for(const u of r){const m=po(u,t),p=s.get(m);p?p.push(u):s.set(m,[u])}const d=t?Ss(t):null,f=Array.from(s.entries()).map(([u,m])=>{const p=[...m].sort(Qd),h=m.reduce((b,k)=>Math.max(b,_c(k)),0);return{path:u,name:Fc(u),isActive:d?Ss(u)===d:!1,isBound:o.has(Ss(u)),hasRunning:m.some(b=>b.taskStatus==="running"),lastActivity:h,sessions:p}});return f.sort((u,m)=>u.isBound!==m.isBound?u.isBound?-1:1:u.isBound&&m.isBound?(o.get(Ss(u.path))??Number.MAX_SAFE_INTEGER)-(o.get(Ss(m.path))??Number.MAX_SAFE_INTEGER):m.lastActivity-u.lastActivity),f}const kp=12,L5={RUNNING:"sidebar.group.running",QUEUED:"sidebar.group.queued",INTERRUPTED:"sidebar.group.interrupted",FAILED:"sidebar.group.failed",CANCELLED:"sidebar.group.cancelled",DONE:"sidebar.group.done"},D5={RUNNING:"text-blue-700 dark:text-blue-400",QUEUED:"text-amber-700 dark:text-amber-400",INTERRUPTED:"text-orange-700 dark:text-orange-400",FAILED:"text-red-700 dark:text-red-400",CANCELLED:"text-[hsl(var(--deck-ink-faint))]",DONE:"text-[hsl(var(--deck-accent))]"};function _5({view:e,sessions:t,activeProjectPath:n,boundProjects:r,currentSessionRef:s,unreadTaskKeys:i,catalogLoadState:o,catalogError:d,onSelectProject:f,onCreateTask:u,onRetryCatalog:m,renderRow:p}){const h=Ut(),[b,k]=y.useState({}),[S,C]=y.useState({}),[x,N]=y.useState(E5),[P,L]=y.useState(null),[D,j]=y.useState(null),[I,T]=y.useState(""),M=o==="loading"||o==="hydrating",$=M||o==="error",te=y.useMemo(()=>e==="status"?$5(t):[],[t,e]),O=y.useMemo(()=>e==="project"?F5(t,n,r.map(R=>R.path)):[],[n,r,t,e]),J=y.useMemo(()=>A5(O,x),[O,x]),ae=(R,ue)=>{const ve=S[R]??!1,He=ve?ue:ue.filter((tt,Y)=>{if(Y<kp)return!0;const pt=he(tt);return!!tt.pendingInteraction||i.includes(Re(pt))||!!(s&&oe(pt,s))}),yt=ue.length-He.length,We=ve?ue.length>kp:yt>0;return a.jsxs(a.Fragment,{children:[He.map(p),We&&a.jsx("button",{type:"button",onClick:()=>C(tt=>({...tt,[R]:!ve})),className:"mx-4 my-1 rounded-md px-3 py-1.5 text-left font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink-muted))]",children:ve?h("sidebar.group.showLess"):h("sidebar.group.showMore",{count:yt})})]})},ce=M?a.jsxs("div",{role:"status","aria-live":"polite",className:"mx-4 mt-2 flex items-center gap-2 rounded-md bg-[hsl(var(--deck-surface))]/55 px-3 py-2 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(mt,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}),a.jsx("span",{className:"flex-1 min-w-0",children:h("sidebar.catalog.syncing")}),a.jsx("span",{className:"tabular-nums shrink-0",children:h("sidebar.catalog.loaded",{count:t.length})})]}):o==="error"?a.jsxs("div",{role:"alert",title:d??void 0,className:"mx-4 mt-2 flex items-center gap-2 rounded-md bg-amber-50/80 px-3 py-2 font-mono text-[9.5px] text-amber-800 dark:bg-amber-950/35 dark:text-amber-300",children:[a.jsx(Ns,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:h("sidebar.catalog.incomplete")}),a.jsxs("button",{type:"button",onClick:m,className:"inline-flex min-h-6 shrink-0 items-center gap-1 rounded px-1.5 font-medium hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-amber-500 dark:hover:bg-amber-900/50",children:[a.jsx(ui,{className:"h-2.5 w-2.5"}),h("sidebar.catalog.retry")]})]}):null;if(e==="status")return a.jsxs("div",{className:"flex flex-col",children:[ce,te.map((R,ue)=>a.jsxs("div",{children:[a.jsxs("div",{className:W("flex items-center justify-between px-5 pb-2 pt-3 font-mono text-[10px] tracking-[0.16em]",D5[R.code]??"text-[hsl(var(--deck-ink-faint))]",ue===0&&"pt-2"),children:[a.jsx("span",{children:h(L5[R.code])}),a.jsxs("span",{className:"text-[hsl(var(--deck-ink-faint))]",children:[R.sessions.length.toString().padStart(2,"0"),$?"+":""]})]}),ae(`status:${R.code}`,R.sessions)]},R.code))]});const le=J.some(R=>R.isActive),xe=R=>!!(s&&R.sessions.some(ue=>oe(he(ue),s))),Z=(R,ue)=>{if(R.join("\0")===J.map(He=>He.path).join("\0"))return;N(R),T5(R);const ve=J.find(He=>He.path===ue);T(h("sidebar.project.reordered",{name:(ve==null?void 0:ve.name)??ue,position:R.indexOf(ue)+1}))},de=(R,ue)=>{const ve=R.sessions.filter(Y=>i.includes(Re(he(Y)))).length,He=xe(R),yt=ve>0,We=R.sessions.some(Y=>!!Y.pendingInteraction),tt=b[R.path]??(le&&!R.isActive&&!(He||R.hasRunning||yt||We));return a.jsxs("div",{"data-project-group":R.path,onDragEnter:Y=>{!P||P===R.path||(Y.preventDefault(),j(R.path))},onDragOver:Y=>{!P||P===R.path||(Y.preventDefault(),Y.dataTransfer.dropEffect="move")},onDrop:Y=>{Y.preventDefault();const pt=P||Y.dataTransfer.getData("text/plain");pt&&pt!==R.path&&Z(P5(J.map(F=>F.path),pt,R.path),pt),L(null),j(null)},className:W("relative transition-colors",D===R.path&&P!==R.path&&"bg-[hsl(var(--deck-accent-soft))]/55 before:absolute before:inset-y-1 before:left-0 before:w-0.5 before:rounded-full before:bg-[hsl(var(--deck-accent))]"),children:[a.jsx(O5,{name:R.name,path:R.path,count:R.sessions.length,countIsPartial:$,isActive:R.isActive,hasRunning:R.hasRunning,unreadCount:ve,collapsed:tt,onSelect:()=>f(R.path),onCreateTask:()=>u(R.path),reorderPosition:ue+1,reorderCount:J.length,isDragging:P===R.path,onDragStart:Y=>{Y.dataTransfer.effectAllowed="move",Y.dataTransfer.setData("text/plain",R.path),L(R.path)},onDragEnd:()=>{L(null),j(null)},onReorderKeyDown:Y=>{if(Y.key!=="ArrowUp"&&Y.key!=="ArrowDown")return;Y.preventDefault();const pt=N5(J.map(F=>F.path),R.path,Y.key==="ArrowUp"?-1:1);Z(pt,R.path)},onToggle:()=>k(Y=>({...Y,[R.path]:!tt}))}),!tt&&ae(`project:${R.path}`,R.sessions)]},R.path)};return a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"sr-only","aria-live":"polite",children:I}),ce,J.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-5 pb-0.5 pt-2 font-mono text-[9px] uppercase tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:h("sidebar.project.projects")}),J.map(de)]})]})}function U5({className:e,onNavigate:t}){const n=Ut(),{toggleSettings:r,toggleSidebar:s,isSidebarOpen:i,isTerminalOpen:o,toggleTerminal:d,sidebarView:f,setSidebarView:u,setTaskSwitcherOpen:m,mainView:p,setMainView:h,setBoardProjectPath:b,setFilePreviewOpen:k}=sn(),S=H(A=>A.sessions),C=H(A=>A.catalogLoadState),x=H(A=>A.catalogError),N=H(A=>A.currentSessionRef),P=H(A=>A.forkingSessionRef),L=H(A=>A.selectSession),D=H(A=>A.startTemporarySession),j=H(A=>A.deleteSession),I=H(A=>A.archiveSession),T=H(A=>A.forkSession),M=H(A=>A.updateSession),$=H(A=>A.loadSessions),te=H(A=>A.setError),O=H(A=>A.taskEventsConnected),J=H(A=>A.taskWorkspaceInfo),ae=H(A=>A.boundProjects),ce=H(A=>A.selectedProjectPath),le=H(A=>A.bindProject),xe=H(A=>A.selectProject),Z=H(A=>A.cancelTask),de=H(A=>A.cancellingTaskKeys),R=H(A=>A.retryTask),ue=H(A=>A.retryingTaskKeys),ve=H(A=>A.unreadTaskKeys),[He,yt]=y.useState(null),[We,tt]=y.useState(""),[Y,pt]=y.useState(null),[F,B]=y.useState(!1),Se=ce??(J==null?void 0:J.cwd)??null,qe=A=>bi(A,n),Ae=A=>{const Ee=A.taskSourceProjectPath||A.projectPath,en=Ee.split("/").filter(Boolean).at(-1)||Ee,pr=A.taskIsolation==="worktree"?A.taskWorktreeBranch||n("session.env.worktree"):n("session.env.local"),fr=A.taskDiffStat?`+${A.taskDiffStat.additions} −${A.taskDiffStat.deletions}`:void 0,bs=A.taskStatus==="queued"&&A.taskQueuePosition?n("session.queued",{position:A.taskQueuePosition,depth:A.taskQueueDepth??A.taskQueuePosition}):void 0,ks=Vd(A,n);return{project:en,environment:pr,diff:fr,queue:bs,reason:ks}},Jt=()=>{h("workspace"),D(Se??void 0),t==null||t()},et=()=>{k(!1),b(Se),h("board"),t==null||t()},Ht=async A=>{ae.some(Ee=>Ee.path===A)?xe(A):await le(A),h("workspace"),D(A),t==null||t()},Qt=async A=>{ae.some(Ee=>Ee.path===A)?xe(A):await le(A),h("workspace"),D(A),t==null||t()},bt=A=>{A(),t==null||t()},_=async(A,Ee)=>{A.stopPropagation(),await j(he(Ee))},$e=async A=>{const Ee=he(A),en=Re(Ee);if(!Y){pt(en);try{await t0(Ee)}catch(pr){te(pr instanceof Error?pr.message:"Session export failed")}finally{pt(null)}}},wt=(A,Ee)=>{A.stopPropagation(),yt(Re(he(Ee))),tt(qe(Ee))},qt=async A=>{if(!We.trim()){yt(null);return}try{await M(he(A),We.trim()),yt(null),await $()}catch(Ee){console.error("Failed to rename session:",Ee)}},Lr=()=>{yt(null),tt("")};return i?a.jsxs("div",{className:W("flex flex-col h-screen border-r w-[260px] border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]",e),children:[a.jsxs("div",{className:"flex flex-col gap-6 px-5 pt-5 pb-5",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(Jd,{size:26}),a.jsx("span",{className:"font-mono text-[15px] font-semibold tracking-[-0.01em] text-[hsl(var(--deck-ink))]",children:"Blade"}),a.jsx("span",{className:"ml-1 rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-1 py-[1px] font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:n("sidebar.brand.badge")})]}),a.jsx("button",{onClick:s,"aria-label":n("sidebar.action.collapse"),className:"flex h-8 w-8 items-center justify-center rounded transition-colors hover:bg-[hsl(var(--deck-surface))]",children:a.jsx(ay,{className:"h-3 w-3 text-[hsl(var(--deck-ink-muted))]"})})]}),a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsxs("button",{onClick:Jt,className:"flex h-9 w-full items-center justify-between rounded-md bg-[hsl(var(--deck-ink))] px-3 font-mono text-[13px] font-medium text-[hsl(var(--deck-canvas))] transition-colors hover:bg-[hsl(var(--deck-ink))]/88",children:[a.jsxs("span",{className:"flex gap-2 items-center",children:[a.jsx(Gc,{className:"h-3.5 w-3.5 stroke-[2.5]"}),n("sidebar.action.newTask")]}),a.jsx("span",{className:"rounded-sm bg-white/10 px-1.5 py-[1px] font-mono text-[10px] text-white/80",children:Dc("newTask")})]}),a.jsxs("button",{type:"button",onClick:et,"aria-current":p==="board"?"page":void 0,className:W("flex h-9 w-full items-center gap-2 rounded-md border px-3 font-mono text-[12.5px] transition-colors",p==="board"?"border-[hsl(var(--deck-accent)/0.45)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-muted))] hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]"),children:[a.jsx(Op,{className:"h-3.5 w-3.5"}),n("sidebar.action.taskBoard")]}),a.jsxs("button",{onClick:()=>bt(d),className:W("flex h-9 w-full items-center gap-2 rounded-md border px-3 font-mono text-[12.5px] transition-colors",o?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-muted))] hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]"),children:[a.jsx(Fp,{className:"h-3.5 w-3.5"}),n("sidebar.action.terminal")]}),a.jsxs("button",{type:"button",onClick:()=>bt(()=>m(!0)),className:"flex h-9 w-full items-center justify-between rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Vc,{className:"h-3.5 w-3.5"}),n("sidebar.action.searchTasks")]}),a.jsx("span",{className:"rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-1.5 py-[1px] font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:ve.length>0?ve.length:Dc("searchTasks")})]})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"flex flex-1 items-center gap-0.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-0.5",children:["project","status"].map(A=>a.jsx("button",{type:"button",onClick:()=>u(A),"aria-pressed":f===A,"aria-label":n(A==="project"?"sidebar.view.projectAria":"sidebar.view.statusAria"),className:W("flex-1 rounded-[5px] py-1 font-mono text-[11px] tracking-[0.02em] transition-colors",f===A?"bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-ink))] shadow-sm":"text-[hsl(var(--deck-ink-faint))] hover:text-[hsl(var(--deck-ink-muted))]"),children:n(A==="project"?"sidebar.view.project":"sidebar.view.status")},A))}),a.jsx("button",{type:"button",onClick:()=>B(!0),title:n("projects.bind.action"),"aria-label":n("projects.bind.action"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-faint))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-accent))]",children:a.jsx($o,{className:"h-3.5 w-3.5"})})]})]}),a.jsx(Wd,{className:"flex-1 px-0",children:a.jsxs("div",{className:"flex flex-col",children:[(S.length>0||ae.length>0||C==="loading"||C==="hydrating"||C==="error")&&a.jsx(_5,{view:f,sessions:S,activeProjectPath:Se,boundProjects:ae,currentSessionRef:N,unreadTaskKeys:ve,catalogLoadState:C,catalogError:x,onRetryCatalog:$,onSelectProject:A=>void Ht(A).catch(()=>{}),onCreateTask:A=>void Qt(A).catch(()=>{}),renderRow:A=>{const Ee=he(A),en=Re(Ee),pr=oe(Ee,N),fr=He===en,bs=oe(Ee,P),ks=!!P;return a.jsx(I5,{session:A,sessionRef:Ee,isActive:pr,isForking:bs,isUnread:ve.includes(Re(Ee)),anyForking:ks,isEditing:fr,editingTitle:We,title:qe(A),context:Ae(A),isCancelling:de.includes(Re(Ee)),isRetrying:ue.includes(Re(Ee)),isExporting:Y===en,onSelect:()=>(t==null||t(),h("workspace"),L(Ee)),onCancelTask:()=>{Z(Ee).catch(()=>{})},onRetryTask:()=>{R(Ee).catch(()=>{})},onFork:()=>void T(A),onArchive:()=>void I(Ee),onExport:()=>void $e(A),onStartRename:Xs=>wt(Xs,A),onDelete:Xs=>_(Xs,A),onEditingTitleChange:tt,onSaveRename:()=>qt(A),onCancelRename:Lr},en)}}),S.length===0&&a.jsx("div",{className:"px-5 mt-6",children:a.jsxs("div",{className:"rounded-md border border-dashed border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]/60 px-4 py-6 text-center",children:[a.jsx("div",{className:"mx-auto mb-2 inline-flex h-8 w-8 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))]",children:a.jsx($p,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"})}),a.jsx("div",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:n("sidebar.empty.title")}),a.jsx("div",{className:"mt-1 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:n("sidebar.empty.hint")})]})})]})}),a.jsxs("div",{className:"flex flex-col gap-3 px-5 pt-3 pb-5",children:[a.jsxs("div",{className:"flex flex-col gap-0.5 border-t border-[hsl(var(--deck-hairline))] pt-3",children:[a.jsx(v5,{}),[{icon:Rp,action:()=>bt(r),labelKey:"sidebar.section.settings"}].map(({icon:A,action:Ee,labelKey:en})=>a.jsxs("button",{"data-settings-trigger":!0,onClick:Ee,className:"flex h-8 w-full items-center gap-2.5 rounded-md px-2.5 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:[a.jsx(A,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),n(en)]},en))]}),a.jsxs("div",{className:"flex gap-2 justify-between items-center",children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.14em] text-[hsl(var(--deck-ink-faint))]",children:n("sidebar.language.label")}),a.jsx(n0,{})]}),a.jsxs("div",{className:"flex items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2",children:[a.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-[hsl(var(--deck-canvas-veil))]",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-[hsl(var(--deck-ink))]"})}),a.jsxs("div",{className:"flex flex-1 flex-col gap-[1px]",children:[a.jsx("span",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:n("sidebar.status.user")}),a.jsxs("span",{className:W("flex gap-1 items-center font-mono text-[10px]",O?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]"),children:[a.jsx("span",{className:W("h-1 w-1 rounded-full",O?"bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.9)]":"bg-[hsl(var(--deck-ink-faint))]/60")}),n(O?"sidebar.status.feedLive":"sidebar.status.feedOffline")]})]})]})]}),a.jsx(s0,{open:F,onOpenChange:B})]}):a.jsx(C5,{className:e,onExpand:s,onNewChat:Jt,onOpenBoard:et,onOpenTaskSwitcher:()=>bt(()=>m(!0)),onToggleTerminal:()=>bt(d),onToggleSettings:()=>bt(r),isTerminalOpen:o,taskEventsConnected:O,unreadCount:ve.length,boardActive:p==="board"})}const B5=y.lazy(()=>es(()=>import("./SettingsModal-C_TpGMs0.js"),__vite__mapDeps([4,1,2,5,6,7,8,9,3])).then(e=>({default:e.SettingsModal}))),a0=()=>es(()=>import("./TaskSwitcher-CGWELaxg.js"),__vite__mapDeps([10,1,11,12,2,3])).then(e=>({default:e.TaskSwitcher})),H5=y.lazy(a0),c0=()=>es(()=>import("./FilePreview-DiS4nCrp.js"),__vite__mapDeps([13,1,14,5,9,11,2,3])),q5=y.lazy(()=>c0().then(e=>({default:e.FilePreview}))),z5=y.lazy(()=>c0().then(e=>({default:e.PreviewControls}))),K5=y.lazy(()=>es(()=>import("./TerminalPanel-DPxm68h1.js"),__vite__mapDeps([15,1,16,17,2,3])).then(e=>({default:e.TerminalPanel}))),oc=e=>{if(e.startsWith("/Users/")){const t=e.split("/");if(t.length>=3)return"~/"+t.slice(3).join("/")}return e},G5=e=>e.replace(/^~\//,"~/§").split("/").filter(Boolean).map((t,n,r)=>{var s;return n===0&&((s=r[0])!=null&&s.startsWith("~"))?"~":t.replace(/^§/,"")});function V5({children:e}){var Y,pt;const t=Ut();w5();const{isSidebarOpen:n,isFilePreviewOpen:r,isSettingsOpen:s,isTerminalOpen:i,isTaskSwitcherOpen:o,toggleFilePreview:d,openFilePreview:f,previewRequestId:u,setSidebarOpen:m,mainView:p}=sn();y.useEffect(()=>{const F=window.setTimeout(()=>{a0()},1500);return()=>window.clearTimeout(F)},[]);const h=H(F=>F.currentSessionId),b=H(F=>F.currentSessionRef),k=H(F=>F.sessions),S=H(F=>F.isStreaming),C=H(F=>F.isTemporarySession),x=H(F=>F.taskWorkspaceInfo),N=H(F=>F.boundProjects),P=H(F=>F.selectedProjectPath),[L,D]=y.useState(null),[j,I]=y.useState(!1),[T,M]=y.useState(),[$,te]=y.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(max-width: 639px)").matches),[O,J]=y.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(max-width: 1023px)").matches),ae=y.useRef(null),ce=y.useRef(null),le=y.useRef(null),xe=y.useMemo(()=>k.find(F=>oe({sessionId:F.sessionId,projectPath:F.projectPath},b)),[b,k]),Z=(xe==null?void 0:xe.taskIsolation)==="worktree"&&xe.taskSourceProjectPath&&(((Y=xe.taskDelivery)==null?void 0:Y.status)==="applied"||((pt=xe.taskDelivery)==null?void 0:pt.status)==="discarded")?xe.taskSourceProjectPath:b==null?void 0:b.projectPath;y.useEffect(()=>{if(typeof window.matchMedia!="function")return;const F=window.matchMedia("(max-width: 900px)"),B=()=>{F.matches&&m(!1)};return B(),F.addEventListener("change",B),()=>F.removeEventListener("change",B)},[m]),y.useEffect(()=>{if(typeof window.matchMedia!="function")return;const F=window.matchMedia("(max-width: 639px)"),B=()=>te(F.matches);return B(),F.addEventListener("change",B),()=>F.removeEventListener("change",B)},[]),y.useEffect(()=>{if(typeof window.matchMedia!="function")return;const F=window.matchMedia("(max-width: 1023px)"),B=()=>J(F.matches);return B(),F.addEventListener("change",B),()=>F.removeEventListener("change",B)},[]),y.useEffect(()=>{if(!$||!n)return;const F=requestAnimationFrame(()=>{var B,Se;(Se=(B=ae.current)==null?void 0:B.querySelector("button"))==null||Se.focus()});return()=>{var B;cancelAnimationFrame(F),(B=ce.current)==null||B.focus({preventScroll:!0})}},[$,n]);const de=F=>{var Ae;if(!$||!n)return;if(F.key==="Escape"){F.preventDefault(),m(!1);return}if(F.key!=="Tab")return;const B=Array.from(((Ae=ae.current)==null?void 0:Ae.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'))??[]);if(B.length===0)return;const Se=B[0],qe=B[B.length-1];F.shiftKey&&document.activeElement===Se?(F.preventDefault(),qe==null||qe.focus()):!F.shiftKey&&document.activeElement===qe&&(F.preventDefault(),Se==null||Se.focus())},R=y.useMemo(()=>p==="board"||!h||C?P?oc(P):null:xe!=null&&xe.projectPath?oc(xe.taskSourceProjectPath||xe.projectPath):null,[h,xe,C,p,P]),ue=y.useMemo(()=>R?G5(R):[],[R]);y.useEffect(()=>{var B;if(!b){D(((B=N.find(Se=>Se.path===P))==null?void 0:B.gitBranch)??null);return}(async()=>{try{const Se=await X.getGitInfo({sessionId:b.sessionId,projectPath:Z??b.projectPath});D(Se.branch)}catch{D(null)}})()},[N,b,Z,P]);const ve=x==null?void 0:x.taskAdmission,He=p==="board"?P??(x==null?void 0:x.cwd)??null:Z??P??(x==null?void 0:x.cwd)??null,yt=b&&p==="workspace"?Re(b):`project:${P??"none"}`,We=r&&O,tt=r&&T;return a.jsxs("div",{className:"flex h-screen overflow-hidden bg-[hsl(var(--deck-canvas))]",children:[$&&n&&!We&&a.jsx("button",{type:"button","aria-label":t("sidebar.action.collapse"),onClick:()=>m(!1),className:"fixed inset-0 z-40 bg-black/25 backdrop-blur-[1px]"}),a.jsx("div",{ref:ae,role:$&&n&&!We?"dialog":void 0,"aria-modal":$&&n&&!We?!0:void 0,"aria-label":$&&n&&!We?t("sidebar.navigationAria"):void 0,inert:We||$&&!n?!0:void 0,onKeyDown:de,className:W("overflow-hidden",n?"w-[260px]":"w-[64px]",$?"fixed inset-y-0 left-0 z-50 shadow-2xl transition-none":"shrink-0 transition-[width] duration-300 ease-in-out",$&&!n&&"-translate-x-full"),children:a.jsx("div",{className:W("transition-all duration-300 ease-in-out",n?"w-[260px]":"w-[64px]"),children:a.jsx(U5,{onNavigate:()=>{$&&m(!1)}})})}),a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("header",{inert:We,className:"relative z-10 flex h-14 items-center gap-2 border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas))]/90 px-3 backdrop-blur-md sm:gap-4 sm:px-6",children:[$&&a.jsx(Kr,{ref:ce,"data-mobile-navigation-trigger":!0,variant:"ghost",size:"icon",onClick:()=>m(!0),"aria-label":t("layout.action.openNavigation"),title:t("layout.action.openNavigation"),className:"h-9 w-9 shrink-0 rounded-md text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:a.jsx(ky,{className:"h-4 w-4"})}),a.jsxs("div",{className:"flex gap-2 items-center min-w-0",children:[ue.length>0?a.jsx("nav",{"aria-label":t("layout.workspace.pathAria"),title:R??void 0,className:"flex min-w-0 items-center font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:ue.map((F,B)=>{const Se=B===ue.length-1,qe=B===0&&F==="~";return a.jsxs("span",{className:"flex items-center min-w-0",children:[B>0&&a.jsx("span",{className:"mx-1 text-[hsl(var(--deck-ink-faint))]/70",children:"/"}),B===0&&!qe&&a.jsx("span",{className:"mr-1 text-[hsl(var(--deck-ink-faint))]/70",children:"/"}),a.jsx("span",{className:W("truncate",Se?"font-medium text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:F})]},B)})}):a.jsx("span",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:x!=null&&x.cwd?oc(x.cwd):t("layout.workspace.empty")}),L&&a.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-2 py-0.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink-muted))]",children:[a.jsx(Kc,{className:"h-3 w-3 text-[hsl(var(--deck-accent))]"}),L]})]}),a.jsxs("div",{className:"flex gap-3 items-center ml-auto",children:[ve&&a.jsx("span",{className:"hidden items-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-2.5 py-1 md:inline-flex",children:a.jsx(Jx,{inFlight:ve.inFlight,queued:ve.queued,maxConcurrent:ve.maxConcurrent,compact:!0})}),a.jsxs("div",{className:"flex items-center gap-0.5",children:[a.jsx(Kr,{variant:"ghost",size:"icon","aria-label":t("layout.action.rewind"),title:t("layout.action.rewind"),disabled:p==="board"||!b||C||S,onClick:()=>I(!0),className:"h-8 w-8 rounded-md text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] disabled:opacity-35",children:a.jsx(Zo,{className:"w-4 h-4"})}),a.jsx(y.Suspense,{fallback:null,children:a.jsx(z5,{ref:le,open:r,maximized:T,disabled:p==="board",onToggleMaximized:()=>M(F=>!F),onTogglePreview:()=>{if(r){M(!1),d();return}f((!b||C)&&u===0?{tab:"files"}:void 0)}})})]})]})]}),a.jsxs("main",{className:"flex-1 overflow-hidden relative flex bg-[hsl(var(--deck-canvas))]",children:[a.jsx("div",{"data-preview-background":"content","data-preview-maximized":tt,inert:We,className:"relative flex min-w-0 flex-1 flex-col",children:s?a.jsx(y.Suspense,{fallback:null,children:a.jsx(B5,{})}):e}),r&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(q5,{returnFocusElement:le.current,maximized:tt},yt)})]})]}),i&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(K5,{workspacePath:He},He??"default-workspace")}),o&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(H5,{})}),a.jsx(p5,{open:j,onOpenChange:I})]})}const ac="BladeCode";function W5(){const e=Ut(),t=H(o=>o.unreadTaskKeys),n=H(o=>o.sessions),r=H(o=>o.selectSession),s=H(o=>o.selectProject),i=y.useMemo(()=>{const o=new Set(t);for(const d of n)d.pendingInteraction&&o.add(Re(he(d)));return o.size},[n,t]);return y.useEffect(()=>(document.title=i>0?`(${i}) ${ac}`:ac,()=>{document.title=ac}),[i]),y.useEffect(()=>{const o=d=>{var h;const f=d.detail;if(!(f!=null&&f.sessionId)||!f.projectPath)return;const u=H.getState(),m=Gd(u.sessions,f),p=m?po(m,u.selectedProjectPath??((h=u.taskWorkspaceInfo)==null?void 0:h.cwd)??null):f.projectPath;u.boundProjects.some(b=>b.available&&b.path===p)&&s(p),r(f)};return window.addEventListener(Wo,o),()=>window.removeEventListener(Wo,o)},[s,r]),a.jsx("div",{className:"sr-only",role:"status","aria-live":"polite",children:i>0?e("attention.unreadAnnouncement",{count:i}):""})}const Uc=y.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:W("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Uc.displayName="Textarea";const J5=(e,t)=>{const n=[...e.matchAll(/(?:^|\s)(@(?:"[^"]*"|(?:[^\\ ]|\\ )*))/g)];for(const r of n){const s=r[1],i=r.index+(r[0].length-s.length),o=i+s.length;if(t>=i&&t<=o){let d=s.slice(1),f=!1;return d.startsWith('"')&&(f=!0,d=d.slice(1),d.endsWith('"')&&(d=d.slice(0,-1))),{hasQuery:!0,query:d,startIndex:i,endIndex:o,quoted:f}}}return{hasQuery:!1,query:"",startIndex:-1,endIndex:-1,quoted:!1}},Q5=(e,t,n={})=>{const{debounceDelay:r=200,maxSuggestions:s=15,workspacePath:i}=n,[o,d]=y.useState([]),[f,u]=y.useState(0),[m,p]=y.useState(!1),h=y.useMemo(()=>t===void 0?{hasQuery:!1,query:"",startIndex:-1,endIndex:-1,quoted:!1}:J5(e,t),[e,t]);y.useEffect(()=>{if(!h.hasQuery){d([]),p(!1);return}let S=!1;p(!0);const x=setTimeout(async()=>{try{const N=await fetch(`/suggestions/files?q=${encodeURIComponent(h.query)}&limit=${s}`,i?{headers:{"x-blade-directory":i}}:void 0);if(!N.ok)throw new Error("Failed to fetch suggestions");const P=await N.json();S||d(P)}catch(N){console.error("Failed to fetch file suggestions:",N),S||d([])}finally{S||p(!1)}},r);return()=>{S=!0,clearTimeout(x)}},[h.hasQuery,h.query,r,s,i]),y.useEffect(()=>{u(0)},[o]);const b=y.useCallback(()=>{u(S=>(S+1)%Math.max(o.length,1))},[o.length]),k=y.useCallback(()=>{u(S=>(S-1+o.length)%Math.max(o.length,1))},[o.length]);return{...h,suggestions:o,selectedIndex:f,loading:m,setSelectedIndex:u,selectNext:b,selectPrevious:k}},Y5=(e,t=!1)=>e.includes(" ")||t?`@"${e}"`:`@${e}`,Z5=(e,t,n)=>{if(!t.hasQuery)return{newInput:e,newCursorPos:e.length};const r=Y5(n,t.quoted),s=e.slice(0,t.startIndex),i=e.slice(t.endIndex),o=s+r+" "+i,d=t.startIndex+r.length+1;return{newInput:o,newCursorPos:d}};function X5(){const[e,t]=y.useState([]),[n,r]=y.useState(-1),s=y.useRef(""),i=y.useCallback(u=>{u.trim()&&(t(m=>m[m.length-1]===u?m:[...m,u]),r(-1),s.current="")},[]),o=y.useCallback(u=>{if(e.length===0)return null;n===-1&&(s.current=u);const m=n===-1?e.length-1:Math.max(0,n-1);return r(m),e[m]??null},[e,n]),d=y.useCallback(()=>{if(n===-1)return null;const u=n+1;return u>=e.length?(r(-1),s.current):(r(u),e[u]??null)},[e,n]),f=y.useCallback(()=>{r(-1),s.current=""},[]);return{addToHistory:i,getPrevious:o,getNext:d,reset:f,historyIndex:n}}const e3=(e,t)=>{if(!e.startsWith("/"))return{hasQuery:!1,query:"",startIndex:-1,endIndex:-1};const n=e.indexOf(" "),r=n===-1?e.length:n;return t<=r?{hasQuery:!0,query:e.slice(1,t),startIndex:0,endIndex:t}:{hasQuery:!1,query:"",startIndex:-1,endIndex:-1}},t3=(e,t,n={})=>{const{debounceDelay:r=150,workspacePath:s}=n,[i,o]=y.useState([]),[d,f]=y.useState(0),[u,m]=y.useState(!1),p=y.useMemo(()=>t===void 0?{hasQuery:!1,query:"",startIndex:-1,endIndex:-1}:e3(e,t),[e,t]);y.useEffect(()=>{if(!p.hasQuery){o([]),m(!1);return}let k=!1;m(!0);const C=setTimeout(async()=>{try{const x=await fetch(`/suggestions/commands?q=${encodeURIComponent(p.query)}`,s?{headers:{"x-blade-directory":s}}:void 0);if(!x.ok)throw new Error("Failed to fetch suggestions");const N=await x.json();k||o(N)}catch(x){console.error("Failed to fetch command suggestions:",x),k||o([])}finally{k||m(!1)}},r);return()=>{k=!0,clearTimeout(C)}},[p.hasQuery,p.query,r,s]),y.useEffect(()=>{f(0)},[i]);const h=y.useCallback(()=>{f(k=>(k+1)%Math.max(i.length,1))},[i.length]),b=y.useCallback(()=>{f(k=>(k-1+i.length)%Math.max(i.length,1))},[i.length]);return{...p,suggestions:i,selectedIndex:d,loading:u,setSelectedIndex:f,selectNext:h,selectPrevious:b}},n3=(e,t,n)=>{if(!t.hasQuery)return{newInput:e,newCursorPos:e.length};const r=e.slice(t.endIndex),s=n.command+" "+r.trimStart(),i=n.command.length+1;return{newInput:s,newCursorPos:i}},r3="blade.composer.draft.",Jo=new Map,l0=1;function Qo(){return typeof sessionStorage>"u"?null:sessionStorage}function Yo(e){return`${r3}${e}`}function s3(e){var n;if(!e)return{content:"",attachments:[],outputSchema:void 0};const t=Jo.get(e);if(t)return{content:t.content,attachments:[...t.attachments],outputSchema:t.outputSchema};try{const r=((n=Qo())==null?void 0:n.getItem(Yo(e)))??"";if(!r)return{content:"",attachments:[],outputSchema:void 0};try{const s=JSON.parse(r);if(s.version===l0&&typeof s.content=="string"&&(s.outputSchema===void 0||typeof s.outputSchema=="string"))return{content:s.content,attachments:[],outputSchema:s.outputSchema}}catch{}return{content:r,attachments:[],outputSchema:void 0}}catch{return{content:"",attachments:[],outputSchema:void 0}}}function mn(e,t){var s,i;if(!e)return;const n=Jo.get(e),r=t.outputSchema??(n==null?void 0:n.outputSchema);if(!t.content&&t.attachments.length===0&&!r){d0(e);return}Jo.set(e,{content:t.content,attachments:[...t.attachments],outputSchema:r});try{t.content||r?(s=Qo())==null||s.setItem(Yo(e),JSON.stringify({version:l0,content:t.content,...r?{outputSchema:r}:{}})):(i=Qo())==null||i.removeItem(Yo(e))}catch{}}function d0(e){var t;if(e){Jo.delete(e);try{(t=Qo())==null||t.removeItem(Yo(e))}catch{}}}function Bc(e){return e.reduce((t,n)=>t+n.dataUrl.length,0)}function i3(e){return`data:${e.type||"application/octet-stream"};base64,`.length+4*Math.ceil(e.size/3)}function o3(e,t){const r=Bc(e)+t.reduce((s,i)=>s+i3(i),0);return e.length+t.length>zr?{accepted:!1,reason:"count",estimatedBytes:r}:r>hi?{accepted:!1,reason:"bytes",estimatedBytes:r}:{accepted:!0,estimatedBytes:r}}const a3=e=>typeof e=="object"&&"command"in e,xp=({type:e,suggestions:t,selectedIndex:n,loading:r,onSelect:s,onHover:i,visible:o})=>{const d=y.useRef(null),f=y.useRef(null);if(y.useEffect(()=>{if(f.current&&d.current){const m=d.current,p=f.current,h=m.getBoundingClientRect(),b=p.getBoundingClientRect();b.bottom>h.bottom?m.scrollTop+=b.bottom-h.bottom+4:b.top<h.top&&(m.scrollTop-=h.top-b.top+4)}},[n]),!o||t.length===0&&!r)return null;const u=e==="command"?Pp:hu;return a.jsx("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50",children:a.jsxs("div",{className:"mx-4 bg-white dark:bg-zinc-900 border border-[#E5E7EB] dark:border-zinc-700 rounded-lg shadow-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[#E5E7EB] dark:border-zinc-800 text-xs text-[#6B7280] dark:text-zinc-400",children:[a.jsx(u,{className:"h-3.5 w-3.5"}),a.jsx("span",{children:e==="command"?"Commands":"Files"}),r&&a.jsx(mt,{className:"h-3 w-3 animate-spin ml-auto"})]}),a.jsx("div",{ref:d,className:"max-h-64 overflow-y-auto py-1",children:t.length===0&&r?a.jsx("div",{className:"px-3 py-4 text-center text-[#6B7280] dark:text-zinc-500 text-sm",children:"Loading..."}):t.length===0?a.jsx("div",{className:"px-3 py-4 text-center text-[#6B7280] dark:text-zinc-500 text-sm",children:"No matches found"}):t.map((m,p)=>{const h=p===n,b=a3(m);return a.jsx("button",{ref:h?f:null,className:W("w-full text-left px-3 py-2 flex items-start gap-3 transition-colors",h?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] hover:bg-[#F3F4F6] hover:text-[#111827] dark:text-zinc-400 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-300"),onClick:()=>s(p),onMouseEnter:()=>i(p),children:b?a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-sm text-blue-600 dark:text-blue-400",children:m.command}),m.argumentHint&&a.jsx("span",{className:"text-xs text-[#9CA3AF] dark:text-zinc-500 font-mono",children:m.argumentHint})]}),a.jsx("p",{className:"text-xs text-[#9CA3AF] dark:text-zinc-500 mt-0.5 truncate",children:m.description})]})}):a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(hu,{className:"h-4 w-4 flex-shrink-0 text-[#9CA3AF] dark:text-zinc-500"}),a.jsx("span",{className:"font-mono text-sm truncate",children:m})]})},b?m.command:m)})}),a.jsxs("div",{className:"px-3 py-1.5 border-t border-[#E5E7EB] dark:border-zinc-800 text-xs text-[#9CA3AF] dark:text-zinc-500 flex items-center gap-4",children:[a.jsxs("span",{children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-[#E5E7EB] dark:bg-zinc-800 rounded text-[#6B7280] dark:text-zinc-400",children:"↑↓"})," ","Navigate"]}),a.jsxs("span",{children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-[#E5E7EB] dark:bg-zinc-800 rounded text-[#6B7280] dark:text-zinc-400",children:"Tab"})," ","Select"]}),a.jsxs("span",{children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-[#E5E7EB] dark:bg-zinc-800 rounded text-[#6B7280] dark:text-zinc-400",children:"Esc"})," ","Close"]})]})]})})},cc=[{value:kr.DEFAULT,labelKey:"chat.input.mode.default",descriptionKey:"chat.input.mode.default.desc",icon:hy},{value:kr.AUTO_EDIT,labelKey:"chat.input.mode.autoEdit",descriptionKey:"chat.input.mode.autoEdit.desc",icon:jy},{value:kr.YOLO,labelKey:"chat.input.mode.yolo",descriptionKey:"chat.input.mode.yolo.desc",icon:Mp,tone:"danger"},{value:kr.PLAN,labelKey:"chat.input.mode.plan",descriptionKey:"chat.input.mode.plan.desc",icon:ly}],c3=["off"],l3=["high","xhigh","medium","max","low","minimal","off"],d3=["standard"],u3=[];function p3(e){return l3.find(t=>e.includes(t))??"off"}function lc(e){return e<1024*1024?`${Math.max(1,Math.ceil(e/1024))} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function f3({onSend:e,onAbort:t,disabled:n,submitDisabled:r=!1,shellSubmitDisabled:s=!1,isStreaming:i,isStopping:o=!1,pendingSteeringCount:d=0,pendingInputDelivery:f=null,recoveredSteeringCount:u=0,variant:m="chat",draft:p,draftAttachments:h,draftRevision:b,draftKey:k,placeholder:S,workspacePath:C}){var au;const x=Ut(),N=y.useRef(s3(k)),[P,L]=y.useState(N.current.content),[D,j]=y.useState(N.current.attachments),I=y.useRef(P),T=y.useRef(D),[M,$]=y.useState(N.current.outputSchema??""),te=y.useRef(M),[O,J]=y.useState(!1),[ae,ce]=y.useState(null),[le,xe]=y.useState(void 0),[Z,de]=y.useState(!1),[R,ue]=y.useState(!1),[ve,He]=y.useState(!1),[yt,We]=y.useState(!1),[tt,Y]=y.useState(!1),[pt,F]=y.useState(!1),[B,Se]=y.useState(!1),[qe,Ae]=y.useState(null),[Jt,et]=y.useState(null),Ht=P.trimStart().startsWith("!"),Qt=Ht?s:r,bt=y.useRef(null),_=y.useRef(!1),$e=y.useRef(null),wt=y.useRef(null),{currentModelId:qt,configuredModels:Lr,hasLoaded:A,loadedWorkspacePath:Ee,loadModels:en,setCurrentModel:pr,currentMode:fr,setMode:bs}=Mt(),ks=sn(w=>w.isSettingsOpen),Xs=Xr(w=>w.communicationStyle),Yd=H(w=>w.setMaxContextTokens),Pe=H(w=>w.currentSessionRef),Zd=H(w=>{var Q;return(Q=w.sessions.find(K=>K.sessionId===(Pe==null?void 0:Pe.sessionId)&&K.projectPath===(Pe==null?void 0:Pe.projectPath)))==null?void 0:Q.selectedModelId}),u0=H(w=>{var Q;return(Q=w.sessions.find(K=>K.sessionId===(Pe==null?void 0:Pe.sessionId)&&K.projectPath===(Pe==null?void 0:Pe.projectPath)))==null?void 0:Q.reasoningEffort}),p0=H(w=>{var Q;return(Q=w.sessions.find(K=>K.sessionId===(Pe==null?void 0:Pe.sessionId)&&K.projectPath===(Pe==null?void 0:Pe.projectPath)))==null?void 0:Q.serviceTier}),f0=H(w=>{var Q;return(Q=w.sessions.find(K=>K.sessionId===(Pe==null?void 0:Pe.sessionId)&&K.projectPath===(Pe==null?void 0:Pe.projectPath)))==null?void 0:Q.responseVerbosity}),[m0,Xd]=y.useState(null),[h0,eu]=y.useState(null),[g0,Da]=y.useState(null),[b0,_a]=y.useState(null),k0=Lr.some(w=>w.id===Zd),xs=Pe?m0??(k0?Zd:qt):qt,nt=Lr.find(w=>w.id===xs),mo=((nt==null?void 0:nt.supportedReasoningEfforts)??c3).filter(w=>w!=="auto"),ho=h0??u0,x0=p3(mo),go=ho!==void 0&&ho!=="auto"&&mo.includes(ho)?ho:x0,bo=(nt==null?void 0:nt.supportedServiceTiers)??d3,y0=["auto",...bo],Dr=g0??p0??"auto",ko=(nt==null?void 0:nt.supportedResponseVerbosities)??u3,w0=["auto",...ko],_r=b0??f0??"auto",tu=Xs??"auto",v0=mo.length>1,S0=bo.some(w=>w!=="standard"),j0=ko.length>0,nu=(nt==null?void 0:nt.displayName)||(nt==null?void 0:nt.model)||xs||x("chat.input.model.placeholder"),mr=((au=nt==null?void 0:nt.input)==null?void 0:au.includes("image"))===!0,ei=nt?x("chat.input.attachment.modelUnsupported",{model:nu}):x("chat.input.attachment.modelRequired"),xo=D.length>0&&!mr,tn=t3(P,le,{workspacePath:C}),nn=Q5(P,le,{workspacePath:C}),ys=X5(),ti=tn.hasQuery&&tn.suggestions.length>0,yo=nn.hasQuery&&nn.suggestions.length>0,I0=ti||yo;y.useEffect(()=>{!ks&&(!A||Ee!==(C??null))&&en(C??void 0)},[ks,en,Ee,A,C]),y.useEffect(()=>{i&&(de(!1),ue(!1),He(!1),We(!1),J(!1))},[i]),y.useEffect(()=>{Xd(null),eu(null),Da(null),_a(null)},[Pe==null?void 0:Pe.projectPath,Pe==null?void 0:Pe.sessionId]),y.useEffect(()=>{Dr!=="auto"&&!bo.includes(Dr)&&Da("auto")},[Dr,bo]),y.useEffect(()=>{_r!=="auto"&&!ko.includes(_r)&&_a("auto")},[_r,ko]),y.useEffect(()=>{et(null)},[xs]),y.useEffect(()=>{if(p!==void 0){const w=h??T.current;I.current=p,T.current=w,L(p),j(w),Ae(null),et(null),xe(p.length),mn(k,{content:p,attachments:w}),requestAnimationFrame(()=>{var Q;return(Q=$e.current)==null?void 0:Q.focus()})}},[p,h,k,b]),y.useEffect(()=>()=>{mn(k,{content:I.current,attachments:T.current,outputSchema:te.current})},[k]),y.useEffect(()=>{if(!nt)return;const w=!!nt.contextWindow;Yd(nt.contextWindow||0,!w)},[nt,Yd]),y.useEffect(()=>{mr&&Ae(w=>w!==bt.current?w:(bt.current=null,null))},[mr]);const Ua=y.useCallback(async()=>{if(!P.trim()&&D.length===0||n||Qt||xo||_.current)return;let w;if(M.trim()){if(Ht){ce(x("chat.input.outputSchema.shellUnsupported")),J(!0);return}try{const K=JSON.parse(M);if(!K||typeof K!="object"||Array.isArray(K))throw new Error("schema root must be an object");w=K}catch{ce(x("chat.input.outputSchema.invalid")),J(!0);return}}P.trim()&&ys.addToHistory(P),_.current=!0,Se(!0);const Q=k;try{if(await e({content:P,modelId:xs??void 0,reasoningEffort:go,serviceTier:Dr,responseVerbosity:_r,communicationStyle:tu,attachments:D,...w?{outputSchema:w}:{}})===!1)return;d0(Q),I.current="",T.current=[],te.current="",L(""),j([]),$(""),ce(null),Ae(null),et(null),bt.current=null,xe(void 0)}catch{}finally{_.current=!1,Se(!1)}},[D,xo,k,P,Ht,n,xs,go,_r,tu,Dr,Qt,e,M,ys,x]),C0=y.useCallback(w=>{Ae(null),et(null),bt.current=null,j(Q=>{const K=Q.filter(Oe=>Oe.id!==w);return T.current=K,mn(k,{content:I.current,attachments:K}),K})},[k]),ru=y.useCallback(w=>new Promise((Q,K)=>{const Oe=new FileReader;Oe.onload=()=>{if(typeof Oe.result!="string"){K(new Error("Failed to read image"));return}Q({id:typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:w.name,mimeType:w.type,dataUrl:Oe.result})},Oe.onerror=()=>K(Oe.error??new Error("Failed to read image")),Oe.readAsDataURL(w)}),[]),wo=y.useCallback(async w=>{if(w.length===0)return;if(!mr){bt.current=ei,et(null),Ae(ei);return}const Q=o3(T.current,w),K=Oe=>Oe==="count"?x("chat.input.attachment.countLimit",{count:zr}):x("chat.input.attachment.sizeLimit",{size:lc(hi)});if(!Q.accepted){bt.current=null,et(null),Ae(K(Q.reason??"bytes"));return}try{const Oe=await Promise.all(w.map(ws=>ru(ws))),Rt=new Set(T.current.map(ws=>ws.dataUrl)),cu=Oe.filter(ws=>Rt.has(ws.dataUrl)?!1:(Rt.add(ws.dataUrl),!0));if(cu.length===0){Ae(null),et(null),bt.current=null;return}const vo=[...T.current,...cu];if(Bc(vo)>hi){bt.current=null,et(null),Ae(K("bytes"));return}T.current=vo,j(vo),Ae(null),et(null),bt.current=null,mn(k,{content:I.current,attachments:vo})}catch{bt.current=null,et(null),Ae(x("chat.input.attachment.readFailed"))}},[k,ei,mr,ru,x]),E0=y.useCallback(async w=>{const Q=Array.from(w.target.files??[]).filter(K=>K.type.startsWith("image/"));await wo(Q),w.target.value=""},[wo]),T0=y.useCallback(async w=>{const Q=Array.from(w.clipboardData.items).filter(K=>K.type.startsWith("image/")).map(K=>K.getAsFile()).filter(K=>K!==null);Q.length!==0&&(w.preventDefault(),await wo(Q))},[wo]),Ba=y.useCallback(w=>{const Q=tn.suggestions[w];if(!Q)return;const{newInput:K,newCursorPos:Oe}=n3(P,tn,Q);I.current=K,L(K),xe(Oe),mn(k,{content:K,attachments:T.current}),requestAnimationFrame(()=>{$e.current&&($e.current.focus(),$e.current.setSelectionRange(Oe,Oe))})},[k,P,tn]),Ha=y.useCallback(w=>{const Q=nn.suggestions[w];if(!Q)return;const{newInput:K,newCursorPos:Oe}=Z5(P,nn,Q);I.current=K,L(K),xe(Oe),mn(k,{content:K,attachments:T.current}),requestAnimationFrame(()=>{$e.current&&($e.current.focus(),$e.current.setSelectionRange(Oe,Oe))})},[nn,k,P]),A0=y.useCallback(w=>{if(ti){if(w.key==="ArrowDown"){w.preventDefault(),tn.selectNext();return}if(w.key==="ArrowUp"){w.preventDefault(),tn.selectPrevious();return}if(w.key==="Tab"||w.key==="Enter"&&!w.shiftKey){w.preventDefault(),Ba(tn.selectedIndex);return}if(w.key==="Escape"){w.preventDefault(),xe(void 0);return}}if(yo){if(w.key==="ArrowDown"){w.preventDefault(),nn.selectNext();return}if(w.key==="ArrowUp"){w.preventDefault(),nn.selectPrevious();return}if(w.key==="Tab"||w.key==="Enter"&&!w.shiftKey){w.preventDefault(),Ha(nn.selectedIndex);return}if(w.key==="Escape"){w.preventDefault(),xe(void 0);return}}if(w.key==="Enter"&&!w.shiftKey){w.preventDefault(),Ua();return}if(w.key==="ArrowUp"&&!w.shiftKey){const Q=w.target,K=Q.selectionStart===0&&Q.selectionEnd===0,Oe=!P.includes(`
|
|
268
|
+
`,e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]),Wm=(e,t=[])=>l(l(Vm(e),([n,r])=>l(Ol(r),([s,i])=>[[n,s],i])),([n,r])=>Wm(r,[...t,n]),()=>[t,e]),DC=e=>l(l(l(Ol(e),([t,n])=>l(Wm(n),([r,s])=>l(l(Vm(s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Nj(t),n]),Ol=e=>l(l(LC(e),([t,n])=>l(l(RC(n),([r,s])=>[r,s],()=>l(MC(n),([r,s])=>[r,s],()=>l($C(n),([r,s])=>[r,s],()=>l(FC(n),([r,s])=>[r,s],()=>[])))),([r,s])=>l(km(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[Oj(t),n]),_C=e=>l(l(Ol(e),([t,n])=>l(DC(n),([r,s])=>[[t,r],s])),([t,n])=>[Rj(t),n]),UC=e=>l(l(_C(e),([t,n])=>[t,n],()=>l(GI(e),([t,n])=>[t,n],()=>l(ye(e),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]);function BC(e){const t=jm(`\`${e}\``);return g(t.length,2)?t[0]:Ft()}function HC(e){return e.join("|")}function qC(e){return e.slice(1,e.length-1)}function zC(e,t,n){return Tr(t,`${n}${e}`)}function KC(e,t){return Tr(e,`${t}${Bv}`)}function GC(e,t){return Tr(e,`${t}${If}`)}function VC(e,t){return Tr(e,`${t}${Af}`)}function WC(e,t){return Li(Je([De("false"),De("true")]),e,t)}function JC(e,t){return Tr(e,`${t}${Pf}`)}function QC(e,t,n){return Tr(t,`${n}${qC(e)}`)}function YC(e,t,n){const r=Rl(e,{});return Li(r,t,n)}function ZC(e,t,n){const r=Er(e);return Li(r,t,n)}function Jm(e,t,n,r=[]){return Te(e,(s,i)=>Jm(i,t,n,[...r,Li(s,[],"")]),()=>Tr(t,`${n}(${HC(r)})`))}function Li(e,t,n){return vn(e)?ZC(e.enum,t,n):qn(e)?GC(t,n):Qe(e)?zC(e.const,t,n):is(e)?KC(t,n):Cr(e)?WC(t,n):un(e)?VC(t,n):Fn(e)?JC(t,n):Wt(e)?QC(e.pattern,t,n):n2(e)?YC(e.parameters[0],t,n):fe(e)?Jm(e.anyOf,t,n):tv}function Tr(e,t){return Te(e,(n,r)=>Li(n,r,t),()=>t)}function XC(e){return`^${Tr(e,"")}$`}function e2(e){const t=XC(e);return $f(t)}function Rl(e,t){return Xe(e)?ke(e2(e),{},t):Qm(e,t)}function t2(e,t,n,r){const s=Xn(e,t,n);return Rl(s,r)}function Qm(e,t={}){return Ne("TemplateLiteral",[e],t)}function n2(e){return on(e)&&E(e,"action")&&g(e.action,"TemplateLiteral")}function Ym(e){return Rl(e,{})}function r2(e){const t=BC(e);return Ym(t)}function s2(e,t={}){const n=pe(e)?r2(e):Ym(e);return ke(n,{},t)}function Wt(e){return Ce(e,"TemplateLiteral")}function Zm(e){return we({"~kind":"ExtendsUnion"},{inferred:e})}function Ml(e){return re(e)&&E(e,"~kind")&&E(e,"inferred")&&g(e["~kind"],"ExtendsUnion")&&re(e.inferred)}function ee(e){return we({"~kind":"ExtendsTrue"},{inferred:e})}function $l(e){return re(e)&&E(e,"~kind")&&E(e,"inferred")&&g(e["~kind"],"ExtendsTrue")&&re(e.inferred)}function je(){return we({"~kind":"ExtendsFalse"},{})}function xc(e){return re(e)&&E(e,"~kind")&&g(e["~kind"],"ExtendsFalse")}function Yt(e){return Ml(e)||$l(e)}function It(e,t,n){return Yt(e)?t(e.inferred):n()}const i2=Object.freeze(Object.defineProperty({__proto__:null,ExtendsFalse:je,ExtendsTrue:ee,ExtendsUnion:Zm,IsExtendsFalse:xc,IsExtendsTrue:$l,IsExtendsTrueLike:Yt,IsExtendsUnion:Ml,Match:It},Symbol.toStringTag,{value:"Module"}));function o2(e,t,n,r){return It(Ze(e,n,r),s=>ee(kt(kt(e,s),{[t]:n})),()=>je())}function a2(e,t){return ee(e)}function c2(e,t,n,r,s){return It(Ze(e,t,n),i=>It(Ze(i,t,r),o=>ee(o),()=>je()),()=>It(Ze(e,t,s),i=>ee(i),()=>je()))}function l2(e,t,n){const r=Er(n);return Ze(e,t,r)}function Xm(e,t,n){return Te(n,(r,s)=>It(Ze(e,t,r),i=>Xm(i,t,s),()=>je()),()=>ee(e))}function d2(e,t,n){const r=or(n);return Ze(e,t,r)}function eh(e,t,n){return Te(n,(r,s)=>It(Ze(e,t,r),i=>ee(i),()=>eh(e,t,s)),()=>je())}function jt(e,t,n){return $n(n)?a2(e):wn(n)?c2(e,t,n.if,n.then,n.else):vn(n)?l2(e,t,n.enum):cn(n)?o2(e,n.name,t,n.extends):Be(n)?Xm(e,t,n.allOf):Wt(n)?d2(e,t,n.pattern):fe(n)?eh(e,t,n.anyOf):An(n)?ee(e):je()}function u2(e,t,n){return cn(n)?jt(e,t,n):$n(n)||An(n)?ee(e):Zm(e)}function p2(e,t){const n=Do(e),r=Do(t);return n&&r||!n&&r?!0:!(n&&!r)}function f2(e,t,n,r){return gt(r)?p2(t,r)?Ze(e,n,r.items):je():jt(e,t,r)}function m2(e,t,n){return is(n)?ee(e):jt(e,t,n)}function h2(e,t,n){return Cr(n)?ee(e):jt(e,t,n)}function g2(e,t,n,r,s){const i=cn(r)?t:r,o=cn(r)?r:t,d=an(t),f=an(r);return!d&&f?je():It(Ze(e,i,o),u=>Fl(u,n,s),()=>je())}function b2(e,t,n,r){return Te(r,(s,i)=>g2(e,t,n,s,i),()=>an(t)?ee(e):je())}function k2(e,t,n){return Te(t,(r,s)=>b2(e,r,s,n),()=>ee(e))}function Fl(e,t,n){return k2(e,t,n)}function th(e,t,n){return os(n)?ee(e):Ze(e,t,n)}function x2(e,t,n,r){return $n(r)||An(r)?ee(e):xn(r)?It(Fl(e,t,r.parameters),s=>th(s,n,r.instanceType),()=>je()):je()}function y2(e,t,n,r,s){return It(Ze(e,t,s),()=>Ze(e,n,s),()=>Ze(e,r,s))}function w2(e,t,n){const r=Er(t);return Ze(e,r,n)}function v2(e,t,n,r){return $n(r)||An(r)?ee(e):yn(r)?It(Fl(e,t,r.parameters),s=>th(s,n,r.returnType),()=>je()):je()}function S2(e,t,n){return qn(n)||un(n)?ee(e):jt(e,t,n)}function j2(e,t,n){const r=pn(t);return Ze(e,r,n)}function ha(e,t,n){return t===n?ee(e):je()}function I2(e,t,n){return Qe(n)?ha(e,t,n.const):is(n)?ee(e):jt(e,De(t),n)}function C2(e,t,n){return Qe(n)?ha(e,t,n.const):Cr(n)?ee(e):jt(e,De(t),n)}function E2(e,t,n){return Qe(n)?ha(e,t,n.const):un(n)?ee(e):jt(e,De(t),n)}function T2(e,t,n){return Qe(n)?ha(e,t,n.const):Fn(n)?ee(e):jt(e,De(t),n)}function A2(e,t,n){return st(t.const)?I2(e,t.const,n):xt(t.const)?C2(e,t.const,n):Ie(t.const)?E2(e,t.const,n):pe(t.const)?T2(e,t.const,n):Ft()}function P2(e,t,n){return cn(n)?jt(e,t,n):ee(e)}function N2(e,t,n){return Ni(n)?ee(e):jt(e,t,n)}function O2(e,t,n){return un(n)?ee(e):jt(e,t,n)}function R2(e,t,n){return an(t)?an(n)?ee(e):je():ee(e)}function M2(e,t,n){return cn(n)&&Fs(n.extends)?je():It(Ze(e,t,n),r=>R2(r,t,n),()=>je())}function $2(e,t){return e.reduce((n,r)=>r in t&&Yt(t[r])?{...n,...t[r].inferred}:Ft(),{})}function F2(e,t,n){const r={};for(const o of U(n))r[o]=o in t?M2({},t[o],n[o]):an(n[o])?cn(n[o])?ee(kt(e,{[n[o].name]:n[o].extends})):ee(e):je();const s=rl(r).every(o=>Yt(o)),i=s?$2(U(r),r):{};return s?ee(i):je()}function L2(e,t,n){const r=F2(e,t,n);return Yt(r)?ee(kt(e,r.inferred)):je()}function D2(e,t,n){return L2(e,t,n)}function _2(e,t){return U(t).reduce((n,r)=>({...n,[r]:E(e,r)?fe(n[r])?Je([...n[r].anyOf,t[r]]):Je([e[r],t[r]]):t[r]}),e)}function nh(e,t,n,r){return Te(t,(s,i)=>It(Ze({},e[s],n),o=>nh(e,i,n,_2(r,o)),()=>je()),()=>ee(r))}function U2(e,t,n,r){const s=U(t);return nh(t,s,r,e)}function B2(e,t,n){return Ot(n)?U2(e,t,jn(n),Vt(n)):Ue(n)?D2(e,t,n.properties):jt(e,Me(t),n)}function H2(e,t){return g(U(t).length,0)?ee(e):je()}function q2(e,t,n,r,s){return Ze(e,n,s)}function z2(e,t,n,r){return Ot(r)?q2(e,hc(t),n,hc(jn(r)),Vt(r)):Ue(r)?H2(e,r.properties):$n(r)||An(r)?ee(e):je()}function K2(e,t,n){return Fn(n)?ee(e):jt(e,t,n)}function G2(e,t,n){return Oi(n)?ee(e):jt(e,t,n)}function V2(e,t,n){const r=or(t);return Ze(e,r,n)}function yc(e,t){return we({"~kind":"Inferrable"},{name:e,type:t},{})}function Ll(e){return re(e)&&E(e,"~kind")&&E(e,"name")&&E(e,"type")&&g(e["~kind"],"Inferrable")&&pe(e.name)&&re(e.type)}function rh(e){return pa(e)?cn(e.items)?gt(e.items.extends)?yc(e.items.name,e.items.extends.items):An(e.items.extends)?yc(e.items.name,e.items.extends):void 0:Ft():void 0}function sh(e){return cn(e)?yc(e.name,e.extends):void 0}function Dl(e,t,n=[]){return Te(e,(r,s)=>It(Ze({},r,t),()=>Dl(s,t,[...n,r]),()=>{}),()=>n)}function W2(e,t,n,r){const s=Dl(n,r);return q(s)?ee(kt(e,{[t]:Sn(s)})):je()}function ih(e,t,n,r){const s=Dl(n,r);return q(s)?ee(kt(e,{[t]:Je(s)})):je()}function J2(e){return[...e].reverse()}function wc(e,t){return t?J2(e):e}function Q2(e){const t=e.length>0?e[0]:void 0,n=on(t)?rh(t):void 0;return on(n)}function Y2(e,t,n,r,s,i){return It(Ze(e,n,s),o=>oh(o,t,r,i),()=>je())}function Z2(e,t,n,r,s){const i=rh(r);return Ll(i)?W2(e,i.name,wc(n,t),i.type):Te(n,(o,d)=>Y2(e,t,o,d,r,s),()=>je())}function X2(e,t,n,r){return Te(r,(s,i)=>Z2(e,t,n,s,i),()=>g(n.length,0)?ee(e):je())}function oh(e,t,n,r){return X2(e,t,n,r)}function eE(e,t,n){const r=Hi(e,_t([],[]),n),s=Q2(r);return oh(e,s,wc(t,s),wc(r,s))}function ah(e,t,n){const r=sh(n);return Ll(r)?ih(e,r.name,t,r.type):Te(t,(s,i)=>It(Ze(e,s,n),o=>ah(o,i,n),()=>je()),()=>ee(e))}function tE(e,t,n){const r=Hi(e,_t([],[]),t);return at(n)?eE(e,r,n.items):gt(n)?ah(e,r,n.items):jt(e,Sn(r),n)}function nE(e,t,n){return os(n)||_s(n)?ee(e):jt(e,t,n)}function ch(e,t,n){return Te(n,(r,s)=>It(Ze(e,t,r),i=>ee(i),()=>ch(e,t,s)),()=>je())}function vc(e,t,n){return Te(t,(r,s)=>It(ch(e,r,n),i=>vc(i,s,n),()=>je()),()=>ee(e))}function rE(e,t,n){const r=sh(n);return Ll(r)?ih(e,r.name,t,r.type):fe(n)?vc(e,t,n.anyOf):vc(e,t,[n])}function sE(e,t,n){return cn(n)?jt(e,t,n):$n(n)||An(n)?ee(e):je()}function iE(e,t,n){return os(n)?ee(e):jt(e,t,n)}function Ze(e,t,n){return $n(t)?u2(e,t,n):gt(t)?f2(e,t,t.items,n):is(t)?m2(e,t,n):Cr(t)?h2(e,t,n):xn(t)?x2(e,t.parameters,t.instanceType,n):wn(t)?y2(e,t.if,t.then,t.else,n):vn(t)?w2(e,t.enum,n):yn(t)?v2(e,t.parameters,t.returnType,n):qn(t)?S2(e,t,n):Be(t)?j2(e,t.allOf,n):Qe(t)?A2(e,t,n):Fs(t)?P2(e,t,n):Ni(t)?N2(e,t,n):un(t)?O2(e,t,n):Ue(t)?B2(e,t.properties,n):Ot(t)?z2(e,jn(t),Vt(t),n):Fn(t)?K2(e,t,n):Oi(t)?G2(e,t,n):Wt(t)?V2(e,t.pattern,n):at(t)?tE(e,t.items,n):_s(t)?nE(e,t,n):fe(t)?rE(e,t.anyOf,n):An(t)?sE(e,t,n):os(t)?iE(e,t,n):je()}function oE(e,t){return pn([...e,Me(t)])}function lh(e,t,n){return Xe(e)?ke(oE(e,t),{},n):_l(e,t,n)}function aE(e,t,n,r,s){const i=Xn(e,t,n),o=Xl(e,t,r);return lh(i,o,s)}function _l(e,t,n={}){return Ne("Interface",[e,t],n)}function Ul(e){return on(e)&&E(e,"action")&&g(e.action,"Interface")}function cE(e,t,n={}){return lh(e,t,n)}function lE(e,t,n){return e.includes(n)?!0:ki([...e,n],t,t[n])}function Ru(e,t,n){const r=mf(n);return Ur(e,t,r)}function Ur(e,t,n){return Te(n,(r,s)=>ki(e,t,r)?!0:Ur(e,t,s),()=>!1)}function ki(e,t,n){return vt(n)?lE(e,t,n.$ref):gt(n)?ki(e,t,n.items):xn(n)?Ur(e,t,[...n.parameters,n.instanceType]):yn(n)?Ur(e,t,[...n.parameters,n.returnType]):Ul(n)?Ru(e,t,n.parameters[1]):Be(n)?Ur(e,t,n.allOf):Ue(n)?Ru(e,t,n.properties):fe(n)?Ur(e,t,n.anyOf):at(n)?Ur(e,t,n.items):Ot(n)?ki(e,t,Vt(n)):!1}function dE(e,t,n){return ki(e,t,n)}function uE(e,t){return t.reduce((n,r)=>dE([r],e,e[r])?[...n,r]:n,[])}function pE(e){const t=ff(e);return uE(e,t)}function fE(e,t,n){return n.includes(t)?n:t in e?xi(e,e[t],[...n,t]):Ft()}function Mu(e,t,n){const r=mf(t);return Is(e,r,n)}function Is(e,t,n){return t.reduce((r,s)=>xi(e,s,r),n)}function xi(e,t,n){return vt(t)?fE(e,t.$ref,n):gt(t)?xi(e,t.items,n):xn(t)?Is(e,[...t.parameters,t.instanceType],n):yn(t)?Is(e,[...t.parameters,t.returnType],n):Ul(t)?Mu(e,t.parameters[1],n):Be(t)?Is(e,t.allOf,n):Ue(t)?Mu(e,t.properties,n):fe(t)?Is(e,t.anyOf,n):at(t)?Is(e,t.items,n):Ot(t)?xi(e,Vt(t),n):n}function mE(e,t,n){return xi(e,n,[t])}function hE(e){return pl()}function gE(e){return U(e).reduce((t,n)=>({...t,[n]:Hr(e[n])}),{})}function ii(e){return e.reduce((t,n)=>[...t,Hr(n)],[])}function Hr(e){return vt(e)?hE(e.$ref):gt(e)?Ir(Hr(e.items),dl(e)):xn(e)?Ei(ii(e.parameters),Hr(e.instanceType)):yn(e)?Ti(ii(e.parameters),Hr(e.returnType)):Be(e)?Bn(ii(e.allOf)):Ue(e)?Me(gE(e.properties)):Ot(e)?xl(da(e),Hr(Vt(e))):fe(e)?Je(ii(e.anyOf)):at(e)?Sn(ii(e.items)):e}function bE(e,t){return t in e?Hr(e[t]):Kt()}function kE(e){return bE(e.$defs,e.$ref)}function xE(e,t,n){const r=Xn(e,_t([],[]),t),s=Xl({},_t([],[]),n);return pn([...r,Me(s)])}function yE(e,t){return U(e).filter(r=>t.includes(r)).reduce((r,s)=>{const i=e[s],o=Ul(i)?xE(e,i.parameters[0],i.parameters[1]):i;return{...r,[s]:o}},{})}function wE(e,t,n){const r=mE(e,t,n),s=yE(e,r);return Pi(s,t)}function dh(e,t){return t in e?vt(e[t])?dh(e,e[t].$ref):e[t]:Nt()}function Di(e,t){return dh(e,t)}function $u(e){return Gt(e)?kE(e):hf(e)?Kt():e}function sr(e,t,n){const r=$u(t),s=$u(n);return Ze(e,r,s)}const Bl="equal",vE="disjoint",Hl="left-inside",ql="right-inside";function ga(e,t){const n=[An(e)?je():sr({},e,t),An(e)?ee({}):sr({},t,e)];return Yt(n[0])&&Yt(n[1])?Bl:Yt(n[0])&&xc(n[1])?Hl:xc(n[0])&&Yt(n[1])?ql:vE}function SE(e,t){return t.filter(n=>ga(e,n)!==ql)}function jE(e,t){const n=t.some(r=>{const s=ga(e,r);return g(s,Hl)||g(s,Bl)});return g(n,!1)}function IE(e,t){const n=Jr(e);return $n(n)?[n]:jE(n,t)?[...SE(n,t),n]:t}function CE(e){return e.reduce((t,n)=>Ue(n)?[...t,n]:Fs(n)?t:IE(n,t),[])}function uh(e){const t=CE(e);return aa(t)}function ph(e,t){return ke(Jr(e),{},t)}function EE(e,t,n,r){const s=V(e,t,n);return ph(s,r)}function ai(e,t=[]){return Ps(e)&&g(e.action,"Conditional")?vt(e.parameters[0])?ai(e.parameters[2],ai(e.parameters[3],[...t,e.parameters[0].$ref])):ai(e.parameters[2],ai(e.parameters[3],t)):Ps(e)&&g(e.action,"Mapped")&&Ps(e.parameters[1])&&g(e.parameters[1].action,"KeyOf")&&vt(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function TE(e,t){return e.reduce((n,r)=>[...n,t.includes(r.name)],[])}function fh(e,t,n=[]){return Te(e,(r,s)=>Te(t,(i,o)=>fh(s,o,[...n,[i,r]]),()=>n),()=>n)}function AE(e){return Wt(e)?or(e.pattern):vn(e)?Er(e.enum):e}function PE(e){const t=AE(e);return fe(t)?[...t.anyOf]:[t]}function NE(e,t){return e.reduce((n,r)=>[...n,[...r,t]],[])}function Fu(e,t){return t.reduce((n,r)=>[...n,...NE(e,r)],[])}function Lu(e){return e.reduce((t,n)=>g(n[0],!0)?Fu(t,PE(n[1])):Fu(t,[n[1]]),[[]])}function OE(e,t,n){const r=ai(n),s=TE(e,r),i=fh(t,s);return Ps(n)&&g(n.action,"Conditional")||Ps(n)&&g(n.action,"Mapped")?Lu(i):[t]}function RE(){return["(not-resolvable)",Nt()]}function ME(){return["(not-generic)",Nt()]}function $E(e,t,n){return[e,Ai(t,n)]}function FE(e,t,n){return t in e?mh(e,t,e[t]):RE()}function mh(e,t,n,r){return ul(n)?$E(t,n.parameters,n.expression):vt(n)?FE(e,n.$ref):ME()}function LE(e,t,n){return mh(e,"(anonymous)",t)}function DE(e,t,n){if(cn(t)||Kl(t)||Yt(sr({},t,n)))return;const r={parameter:e,expect:n,actual:t};throw new Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Du(e,t,n,r,s){const i=V(e,t,s);return DE(n,i,r),kt(e,{[n]:i})}function _E(e,t,n,r,s){const i=V(e,t,n.extends),o=V(e,t,n.equals);return Te(s,(d,f)=>Sc(Du(e,t,n.name,i,d),t,r,f),()=>Sc(Du(e,t,n.name,i,o),t,r,[]))}function Sc(e,t,n,r){return Te(n,(s,i)=>_E(e,t,s,i,r),()=>e)}function UE(e,t,n,r){return Sc(e,t,n,r)}let jc=0,zl=0;function BE(){if(!Si(zl,Ci().maxInstantiationCount))throw Error("Type instantiation is excessively deep and possibly infinite")}function HE(){BE(),zl++,jc++}function qE(){jc--,g(jc,0)&&(zl=0)}function zE(e){return ts(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function KE(e,t){return g(zE(e),t)}function GE(e,t,n,r,s,i){HE();try{const o=UE(e,t,r,i),d=V(o,_t([...t.callstack,n.$ref],t.visited),s);return V(o,_t([],[]),d)}finally{qE()}}function VE(e,t,n,r,s,i){return i.reduce((o,d)=>{const f=GE(e,t,n,r,s,d);return[...o,f]},[])}function WE(e,t,n,r,s,i){const o=OE(r,i,s),d=VE(e,t,n,r,s,o);return g(d.length,1)?d[0]:ar(d)}function hh(e,t,n,r){const s=Xn(e,t,r),i=LE(e,n),o=i[0],d=i[1];return ul(d)?KE(t,o)?Ic(gn(o),s):WE(e,t,gn(o),d.parameters,d.expression,s):Ic(n,s)}function Ic(e,t){return we({"~kind":"Call"},{type:"call",target:e,arguments:t},{})}function JE(e,t){return hh({},_t([],[]),e,t)}function Kl(e){return Ce(e,"Call")}function QE(e){return Mn(e,["~immutable"])}function YE(e,t){return ke(QE(e),{},t)}function ZE(e,t,n,r){const s=V(e,t,n);return YE(s,r)}function XE(e,t){return e(t)}function eT(e,t){return pe(t)?De(XE(e,t)):De(t)}function tT(e,t){const n=or(t);return Us(e,n)}function nT(e,t){const n=t.map(r=>Us(e,r));return Je(n)}function Us(e,t){return Qe(t)?eT(e,t.const):Wt(t)?tT(e,t.pattern):fe(t)?nT(e,t.anyOf):t}function gh(e,t={}){return Ne("Capitalize",[e],t)}function rT(e,t={}){return yh(e,t)}function bh(e,t={}){return Ne("Lowercase",[e],t)}function sT(e,t={}){return wh(e,t)}function kh(e,t={}){return Ne("Uncapitalize",[e],t)}function iT(e,t={}){return vh(e,t)}function xh(e,t={}){return Ne("Uppercase",[e],t)}function oT(e,t={}){return Sh(e,t)}const aT=e=>e[0].toUpperCase()+e.slice(1),cT=e=>e.toLowerCase(),lT=e=>e[0].toLowerCase()+e.slice(1),dT=e=>e.toUpperCase();function yh(e,t){return Xe([e])?ke(Us(aT,e),{},t):gh(e,t)}function wh(e,t){return Xe([e])?ke(Us(cT,e),{},t):bh(e,t)}function vh(e,t){return Xe([e])?ke(Us(lT,e),{},t):kh(e,t)}function Sh(e,t){return Xe([e])?ke(Us(dT,e),{},t):xh(e,t)}function uT(e,t,n,r){const s=V(e,t,n);return yh(s,r)}function pT(e,t,n,r){const s=V(e,t,n);return wh(s,r)}function fT(e,t,n,r){const s=V(e,t,n);return vh(s,r)}function mT(e,t,n,r){const s=V(e,t,n);return Sh(s,r)}function jh(e,t,n,r,s={}){return Ne("Conditional",[e,t,n,r],s)}function hT(e,t,n,r,s={}){return Ih({},_t([],[]),e,t,n,r,s)}function gT(e,t,n,r,s,i){const o=sr(e,n,r);return Ml(o)?Je([V(o.inferred,t,s),V(e,t,i)]):$l(o)?V(o.inferred,t,s):V(e,t,i)}function Ih(e,t,n,r,s,i,o){return Xe([n,r])?ke(gT(e,t,n,r,s,i),{},o):jh(n,r,s,i,o)}function bT(e,t,n,r,s,i,o){const d=V(e,t,n),f=V(e,t,r);return Ih(e,t,d,f,s,i,o)}function Ch(e,t={}){return Ne("ConstructorParameters",[e],t)}function kT(e,t={}){return Eh(e,t)}function xT(e){const t=xn(e)?e.parameters:[],n=Hi({},_t([],[]),t);return Sn(n)}function Eh(e,t){return Xe([e])?ke(xT(e),{},t):Ch(e,t)}function yT(e,t,n,r){const s=V(e,t,n);return Eh(s,r)}function Th(e,t,n={}){return Ne("Exclude",[e,t],n)}function wT(e,t,n={}){return Gl(e,t,n)}function Gl(e,t,n){return Xe([e,t])?ke(Vf(e,t),{},n):Th(e,t,n)}function vT(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Gl(i,o,s)}function Ah(e,t,n={}){return Ne("Extract",[e,t],n)}function ST(e,t,n={}){return Ph(e,t,n)}function jT(e,t){const n=sr({},e,t);return Yt(n)?[e]:[]}function IT(e,t){return e.reduce((n,r)=>[...n,...jT(r,t)],[])}function CT(e,t){const n=Jr(e),r=fe(n)?n.anyOf:[n],s=IT(r,t);return ar(s)}function Ph(e,t,n){return Xe([e,t])?ke(CT(e,t),{},n):Ah(e,t,n)}function ET(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Ph(i,o,s)}function TT(e){return e.reduce((t,n)=>Cf(n)?[...t,De(n)]:t,[])}function Vl(e){const t=TT(e);return Je(t)}function Wl(e,t,n={}){return Ne("Index",[e,t],n)}function AT(e,t,n={}){const r=q(t)?Vl(t):t;return $h(e,r,n)}function PT(e,t){const n=Di(e,t);return cs(n)}function NT(e,t,n){const r=Ls(e,t,n);return cs(r)}function OT(e,t){const n=U(e).filter(m=>!E(t,m)),r=U(t).filter(m=>!E(e,m)),s=U(e).filter(m=>E(t,m)),i=n.reduce((m,p)=>({...m,[p]:e[p]}),{}),o=r.reduce((m,p)=>({...m,[p]:t[p]}),{}),d=s.reduce((m,p)=>({...m,[p]:pn([e[p],t[p]])}),{}),f=kt(i,o);return kt(f,d)}function RT(e){return e.reduce((t,n)=>OT(t,cs(n)),{})}function MT(e){const t=uS(Sn(e));return cs(t)}function $T(e,t){return U(e).filter(s=>s in t).reduce((s,i)=>({...s,[i]:ar([e[i],t[i]])}),{})}function Nh(e,t){return Te(e,(n,r)=>Nh(r,$T(t,cs(n))),()=>t)}function FT(e){return Te(e,(t,n)=>Nh(n,cs(t)),()=>Ft())}function cs(e){return Gt(e)?PT(e.$defs,e.$ref):wn(e)?NT(e.if,e.then,e.else):Be(e)?RT(e.allOf):fe(e)?FT(e.anyOf):at(e)?MT(e.items):Ue(e)?e.properties:{}}function Jl(e){const t=cs(e);return Me(t)}const LT=new RegExp("^(?:0|[1-9][0-9]*)$");function Ql(e){const t=`${e}`;return LT.test(t)?parseInt(t):e}function DT(e){return De(Ql(e))}function _u(e){return e.map(t=>Oh(t))}function Oh(e){return Be(e)?Bn(_u(e.allOf)):fe(e)?Je(_u(e.anyOf)):Qe(e)?DT(e.const):e}function _T(e,t){const n=Oh(t),r=sr({},n,wr());return Yt(r)?e:Qe(t)&&g(t.const,"length")?wr():Nt()}function UT(e,t){const n=Di(e,t);return ls(n)}function BT(e,t,n){const r=Ls(e,t,n);return ls(r)}function HT(e){const t=Er(e);return ls(t)}function qT(e){const t=pn(e);return ls(t)}function zT(e){return[`${e}`]}function KT(e){const t=or(e);return ls(t)}function GT(e){return e.reduce((t,n)=>[...t,...ls(n)],[])}function ls(e){return Gt(e)?UT(e.$defs,e.$ref):wn(e)?BT(e.if,e.then,e.else):vn(e)?HT(e.enum):Be(e)?qT(e.allOf):Qe(e)?zT(e.const):Wt(e)?KT(e.pattern):fe(e)?GT(e.anyOf):[]}function Yl(e){return ls(e)}function oi(e,t){return t.map(n=>pi(e,n))}function pi(e,t){return gt(t)?Ir(pi(e,t.items)):xn(t)?Ei(oi(e,t.parameters),pi(e,t.instanceType)):yn(t)?Ti(oi(e,t.parameters),pi(e,t.returnType)):at(t)?Sn(oi(e,t.items)):fe(t)?Je(oi(e,t.anyOf)):Be(t)?Bn(oi(e,t.allOf)):Yf(t)?Me(e):t}function VT(e,t){return pi(e,t)}function WT(e,t){const n=t in e?e[t]:Nt();return VT(e,n)}function Rh(e,t){return t.reduce((n,r)=>[...n,WT(e,r)],[])}function JT(e,t){const n=Yl(t),r=Rh(e,n);return ar(r)}const QT=new RegExp(Mi);function YT(e){return e.filter(n=>QT.test(n))}function ZT(e){const t=ff(e),n=YT(t),r=Rh(e,n);return ar(r)}function XT(e,t){return un(t)?ZT(e):JT(e,t)}function eA(e){return De(Ql(e))}function Uu(e){return e.map(t=>Mh(t))}function Mh(e){return Be(e)?Bn(Uu(e.allOf)):fe(e)?Je(Uu(e.anyOf)):Qe(e)?eA(e.const):e}function tA(e,t){return e.reduceRight((n,r,s)=>{const i=sr({},De(s),t);return Yt(i)?[r,...n]:n},[])}function nA(e,t){const n=Mh(t),r=tA(e,n);return Ds(r)}function rA(e){return Ds(e)}function sA(e,t){return Qe(t)&&g(t.const,"length")?De(e.length):un(t)||qn(t)?rA(e):nA(e,t)}function iA(e,t){return gt(e)?_T(e.items,t):Ue(e)?XT(e.properties,t):at(e)?sA(e.items,t):Nt()}function oA(e){return Gt(e)||wn(e)||Be(e)||fe(e)?Jl(e):e}function $h(e,t,n){return Xe([e,t])?ke(iA(oA(e),t),{},n):Wl(e,t,n)}function aA(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return $h(i,o,s)}function Fh(e,t={}){return Ne("InstanceType",[e],t)}function cA(e,t={}){return Lh(e,t)}function lA(e){return xn(e)?e.instanceType:Nt()}function Lh(e,t){return Xe([e])?ke(lA(e),{},t):Fh(e,t)}function dA(e,t,n,r={}){const s=V(e,t,n);return Lh(s,r)}function Zl(e,t={}){return Ne("KeyOf",[e],t)}function uA(e,t={}){return Dh(e,t)}function pA(){return Je([wr(),zn(),bl()])}function fA(e){return wr()}function mA(e){return e.reduce((n,r)=>Cf(r)?[...n,De(Ql(r))]:Ft(),[])}function hA(e){const t=U(e),n=mA(t);return Ds(n)}function gA(e){return da(e)}function bA(e){const t=e.map((n,r)=>De(r));return Ds(t)}function kA(e){return $n(e)?pA():gt(e)?fA(e.items):Ue(e)?hA(e.properties):Ot(e)?gA(e):at(e)?bA(e.items):Nt()}function xA(e){return Gt(e)||wn(e)||Be(e)||fe(e)?Jl(e):e}function Dh(e,t){return Xe([e])?ke(kA(xA(e)),{},t):Zl(e,t)}function yA(e,t,n,r){const s=V(e,t,n);return Dh(s,r)}function Cc(e,t,n,r,s={}){return Ne("Mapped",[e,t,n,r],s)}function wA(e,t,n,r,s={}){return _h({},_t([],[]),e,t,n,r,s)}function vA(e){const t=or(e);return ba(t)}function SA(e){return e.reduce((t,n)=>[...t,...ba(n)],[])}function jA(e){const t=Er(e);return ba(t)}function IA(e){return Ie(e)?[De(`${e}`)]:[De(e)]}function ba(e){return vn(e)?jA(e.enum):Qe(e)?IA(e.const):Wt(e)?vA(e.pattern):fe(e)?SA(e.anyOf):[e]}function CA(e){return ba(e)}function EA(e){return Wt(e)?or(e.pattern):e}function TA(e,t,n,r,s,i){const o=kt(e,{[n.name]:r}),d=V(o,t,s),f=EA(d),u=V(o,t,i);return Ef(f)||Tf(f)?{[f.const]:u}:{}}function AA(e,t,n,r,s,i){return r.reduce((o,d)=>[...o,TA(e,t,n,d,s,i)],[])}function PA(e){return e.reduce((t,n)=>[...t,Me(n)],[])}function NA(e,t,n,r,s,i){const o=CA(r),d=AA(e,t,n,o,s,i),f=PA(d);return pn(f)}function _h(e,t,n,r,s,i,o){return Xe([r])?ke(NA(e,t,n,r,s,i),{},o):Cc(n,r,s,i,o)}function OA(e,t,n,r,s,i,o){const d=V(e,t,r);return _h(e,t,n,d,s,i,o)}function RA(e,t,n){const r=kt(e,t);return U(t).filter(i=>n.includes(i)).reduce((i,o)=>({...i,[o]:wE(r,o,t[o])}),{})}function MA(e,t,n){const r=kt(e,t);return U(t).filter(i=>!n.includes(i)).reduce((i,o)=>({...i,[o]:V(r,_t([],[]),t[o])}),{})}function $A(e,t,n){const r=pE(t),s=RA(e,t,r),i=MA(e,t,r),o={...s,...i};return ke(o,{},n)}function Uh(e,t,n,r){return $A(e,n,r)}function Bh(e,t={}){return Ne("NonNullable",[e],t)}function FA(e,t={}){return Hh(e,t)}function LA(e){const t=Je([gl(),yl()]);return Gl(e,t,{})}function Hh(e,t){return Xe([e])?ke(LA(e),{},t):Bh(e,t)}function DA(e,t,n,r){const s=V(e,t,n);return Hh(s,r)}function qh(e,t,n={}){return Ne("Omit",[e,t],n)}function _A(e,t,n={}){const r=q(t)?Vl(t):t;return Kh(e,r,n)}function zh(e){const t=Jl(e);return Ue(t)?t.properties:Ft()}function UA(e,t){return U(e).reduce((r,s)=>t.includes(s)?r:{...r,[s]:e[s]},{})}function BA(e,t){const n=zh(e),r=Yl(t),s=UA(n,r);return Me(s)}function Kh(e,t,n){return Xe([e,t])?ke(BA(e,t),{},n):qh(e,t,n)}function HA(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Kh(i,o,s)}function Gh(e,t={}){return Ne("Parameters",[e],t)}function qA(e,t={}){return Vh(e,t)}function zA(e){const t=yn(e)?e.parameters:[],n=Hi({},_t([],[]),t);return Sn(n)}function Vh(e,t){return Xe([e])?ke(zA(e),{},t):Gh(e,t)}function KA(e,t,n,r){const s=V(e,t,n);return Vh(s,r)}function Wh(e,t={}){return Ne("Partial",[e],t)}function GA(e,t={}){return Jh(e,t)}function VA(e,t){const n=Di(e,t),r=_i(n);return Pi(kt(e,{[t]:r}),t)}function WA(e,t,n){const r=Ls(e,t,n);return _i(r)}function JA(e){const t=pn(e);return _i(t)}function QA(e){const t=e.map(n=>_i(n));return Je(t)}function YA(e){const t=U(e).reduce((r,s)=>({...r,[s]:Fo(e[s])}),{});return Me(t)}function _i(e){return Gt(e)?VA(e.$defs,e.$ref):wn(e)?WA(e.if,e.then,e.else):Be(e)?JA(e.allOf):fe(e)?QA(e.anyOf):Ue(e)?YA(e.properties):Me({})}function Jh(e,t){return Xe([e])?ke(_i(e),{},t):Wh(e,t)}function ZA(e,t,n,r){const s=V(e,t,n);return Jh(s,r)}function Qh(e,t,n={}){return Ne("Pick",[e,t],n)}function XA(e,t,n={}){const r=q(t)?Vl(t):t;return Yh(e,r,n)}function eP(e,t){return U(e).reduce((r,s)=>t.includes(s)?kt(r,{[s]:e[s]}):r,{})}function tP(e,t){const n=zh(e),r=Yl(t),s=eP(n,r);return Me(s)}function Yh(e,t,n){return Xe([e,t])?ke(tP(e,t),{},n):Qh(e,t,n)}function nP(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Yh(i,o,s)}function Zh(e,t={}){return Ne("ReadonlyObject",[e],t)}function Xh(e,t={}){return eg(e,t)}const rP=Xh;function sP(e){return td(Ir(e))}function iP(e,t){const n=Di(e,t),r=Ui(n);return Pi(kt(e,{[t]:r}),t)}function oP(e,t,n){const r=Ls(e,t,n);return Ui(r)}function aP(e){const t=pn(e);return Ui(t)}function cP(e){const t=U(e).reduce((r,s)=>({...r,[s]:_o(e[s])}),{});return Me(t)}function lP(e){return td(Sn(e))}function dP(e){const t=e.map(n=>Ui(n));return Je(t)}function Ui(e){return gt(e)?sP(e.items):Gt(e)?iP(e.$defs,e.$ref):wn(e)?oP(e.if,e.then,e.else):Be(e)?aP(e.allOf):Ue(e)?cP(e.properties):at(e)?lP(e.items):fe(e)?dP(e.anyOf):e}function eg(e,t){return Xe([e])?ke(Ui(e),{},t):Zh(e)}function uP(e,t,n,r){const s=V(e,t,n);return eg(s,r)}function pP(e,t,n,r){return t.visited.includes(r)?n:r in e?V(e,_t(t.callstack,[...t.visited,r]),e[r]):n}function fP(e,t){const n=Di(e,t),r=Bi(n);return Pi(kt(e,{[t]:r}),t)}function mP(e,t,n){const r=Ls(e,t,n);return Bi(r)}function hP(e){const t=pn(e);return Bi(t)}function gP(e){const t=e.map(n=>Bi(n));return Je(t)}function bP(e){const t=U(e).reduce((r,s)=>({...r,[s]:qf(e[s])}),{});return Me(t)}function Bi(e){return Gt(e)?fP(e.$defs,e.$ref):wn(e)?mP(e.if,e.then,e.else):Be(e)?hP(e.allOf):fe(e)?gP(e.anyOf):Ue(e)?bP(e.properties):Me({})}function tg(e,t={}){return Ne("Required",[e],t)}function kP(e,t={}){return ng(e,t)}function ng(e,t){return Xe([e])?ke(Bi(e),{},t):tg(e,t)}function xP(e,t,n,r){const s=V(e,t,n);return ng(s,r)}function rg(e,t={}){return Ne("ReturnType",[e],t)}function yP(e,t={}){return sg(e,t)}function wP(e){return yn(e)?e.returnType:Nt()}function sg(e,t){return Xe([e])?ke(wP(e),{},t):rg(e,t)}function vP(e,t,n,r={}){const s=V(e,t,n);return sg(s,r)}function ig(e,t){return Ne("With",[e,t],{})}function og(e,t){return ag(e,t)}function ag(e,t){return Xe([e])?ke(e,{},t):ig(e,t)}function SP(e,t,n,r){const s=V(e,t,n);return ag(s,r)}function jP(e){return pa(e)?at(e.items)?cg(e.items.items):cn(e.items)?[e]:vt(e.items)?[e]:[Nt()]:[e]}function cg(e){return e.reduce((n,r)=>[...n,...jP(r)],[])}function _t(e,t){return{callstack:e,visited:t}}function Xe(e){return Te(e,(t,n)=>vt(t)?!1:Xe(n),()=>!0)}function Xl(e,t,n){return U(n).reduce((r,s)=>({...r,[s]:V(e,t,n[s])}),{})}function Hi(e,t,n){const r=Xn(e,t,n);return cg(r)}function Xn(e,t,n){return n.map(r=>V(e,t,r))}function IP(e,t){const n=an(e)?ll(t,{}):t,r=Uo(e)?cl(n,{}):n;return Do(e)?ed(r,{}):r}function CP(e,t,n,r,s){return g(n,"AddImmutable")?AP(e,t,r[0],s):g(n,"RemoveImmutable")?ZE(e,t,r[0],s):g(n,"AddReadonly")?Qw(e,t,r[0],s):g(n,"RemoveReadonly")?iS(e,t,r[0],s):g(n,"AddOptional")?Zw(e,t,r[0],s):g(n,"RemoveOptional")?lS(e,t,r[0],s):g(n,"Capitalize")?uT(e,t,r[0],s):g(n,"Conditional")?bT(e,t,r[0],r[1],r[2],r[3],s):g(n,"ConstructorParameters")?yT(e,t,r[0],s):g(n,"Evaluate")?EE(e,t,r[0],s):g(n,"Exclude")?vT(e,t,r[0],r[1],s):g(n,"Extract")?ET(e,t,r[0],r[1],s):g(n,"Index")?aA(e,t,r[0],r[1],s):g(n,"InstanceType")?dA(e,t,r[0],s):g(n,"Interface")?aE(e,t,r[0],r[1],s):g(n,"KeyOf")?yA(e,t,r[0],s):g(n,"Lowercase")?pT(e,t,r[0],s):g(n,"Mapped")?OA(e,t,r[0],r[1],r[2],r[3],s):g(n,"Module")?Uh(e,t,r[0],s):g(n,"NonNullable")?DA(e,t,r[0],s):g(n,"Pick")?nP(e,t,r[0],r[1],s):g(n,"Parameters")?KA(e,t,r[0],s):g(n,"Partial")?ZA(e,t,r[0],s):g(n,"Omit")?HA(e,t,r[0],r[1],s):g(n,"ReadonlyObject")?uP(e,t,r[0],s):g(n,"Record")?FS(e,t,r[0],r[1],s):g(n,"Required")?xP(e,t,r[0],s):g(n,"ReturnType")?vP(e,t,r[0],s):g(n,"TemplateLiteral")?t2(e,t,r[0],s):g(n,"Uncapitalize")?fT(e,t,r[0],s):g(n,"Uppercase")?mT(e,t,r[0],s):g(n,"With")?SP(e,t,r[0],r[1]):Ne(n,r,s)}function EP(e,t,n){const r=vt(n)?pP(e,t,n,n.$ref):gt(n)?Ir(V(e,t,n.items),dl(n)):Kl(n)?hh(e,t,n.target,n.arguments):xn(n)?Ei(Xn(e,t,n.parameters),V(e,t,n.instanceType),Xw(n)):yn(n)?Ti(Xn(e,t,n.parameters),V(e,t,n.returnType),ev(n)):wn(n)?Lo(V(e,t,n.if),V(e,t,n.then),V(e,t,n.else),ov(n)):Be(n)?Bn(Xn(e,t,n.allOf),uv(n)):Ue(n)?Me(Xl(e,t,n.properties),sv(n)):Ot(n)?LS(jn(n),V(e,t,Vt(n))):pa(n)?ua(V(e,t,n.items)):at(n)?Sn(Hi(e,t,n.items),rS(n)):fe(n)?Je(Xn(e,t,n.anyOf),Wv(n)):n;return IP(n,r)}function V(e,t,n){return Ps(n)?CP(e,t,n.action,n.parameters,n.options):EP(e,t,n)}function Bs(e,t){return V(e,_t([],[]),t)}function TP(e){return ke(e,{"~immutable":!0},{})}function ed(e,t){return ke(TP(e),{},t)}function AP(e,t,n,r){const s=V(e,t,n);return ed(s,r)}function PP(e,t={}){return Ne("AddImmutable",[e],t)}function td(e,t={}){return ed(e,t)}function NP(e,t={}){return Ne("Evaluate",[e],t)}function Kn(e,t={}){return ph(e,t)}function OP(e,t={}){return Ne("Module",[e],t)}function RP(e,t={}){return Uh({},_t([],[]),e,t)}function MP(e,t){const n=ga(e,t);return g(n,"right-inside")||g(n,"disjoint")?1:0}function lg(e,t,n=[]){return Te(t,(r,s)=>g(MP(e,r),1)?lg(e,s,[...n,r]):[...n,e,...t],()=>[...n,e])}function dg(e,t=[]){return Te(e,(n,r)=>dg(r,lg(n,t)),()=>t)}function $P(e){return dg(e)}function FP(...e){const[t,n,r]=ut(e,{2:(o,d)=>pe(o)?[{},o,d]:[o,d,{}],3:(o,d,f)=>[o,d,f],1:o=>[{},o,{}]}),s=UC(n),i=q(s)&&g(s.length,2)?V(t,_t([],[]),s[0]):Nt();return ke(i,{},r)}const c=Object.freeze(Object.defineProperty({__proto__:null,Any:pl,Array:Ir,BigInt:hl,Boolean:jf,Call:JE,Capitalize:rT,Codec:fl,Conditional:hT,Constructor:Ei,ConstructorParameters:kT,Cyclic:Pi,Decode:Mv,DecodeBuilder:Sf,Dependent:Lo,Encode:$v,EncodeBuilder:vf,Enum:dv,Evaluate:Kn,Exclude:wT,Extends:sr,ExtendsResult:i2,Extract:ST,Function:Ti,Generic:Ai,Identifier:mc,Immutable:Fv,Index:AT,Infer:pc,InstanceType:cA,Instantiate:Bs,Integer:oa,Interface:cE,Intersect:Bn,IsAny:$n,IsArray:gt,IsBigInt:is,IsBoolean:Cr,IsCall:Kl,IsCodec:ln,IsConstructor:xn,IsCyclic:Gt,IsDependent:wn,IsEnum:vn,IsEnumValue:lv,IsFunction:yn,IsGeneric:ul,IsIdentifier:Hv,IsImmutable:Do,IsInfer:cn,IsInteger:qn,IsIntersect:Be,IsKind:Ce,IsLiteral:Qe,IsNever:Fs,IsNull:Ni,IsNumber:un,IsObject:Ue,IsOptional:an,IsParameter:Vv,IsReadonly:Uo,IsRecord:Ot,IsRef:vt,IsRefine:ml,IsRest:pa,IsSchema:on,IsString:Fn,IsSymbol:Oi,IsTemplateLiteral:Wt,IsThis:Yf,IsTuple:at,IsUndefined:_s,IsUnion:fe,IsUnknown:An,IsUnsafe:hf,IsVoid:os,KeyOf:uA,Literal:De,Lowercase:sT,Mapped:wA,Module:RP,Never:Nt,NonNullable:FA,Null:gl,Number:wr,Object:Me,Omit:_A,Optional:nv,Parameter:Ri,Parameters:qA,Partial:GA,Pick:XA,Readonly:Lv,ReadonlyObject:Xh,ReadonlyType:rP,Record:xl,RecordKey:da,RecordPattern:jn,RecordValue:Vt,Ref:gn,Refine:_v,Required:kP,Rest:ua,ReturnType:yP,Script:FP,String:zn,Symbol:bl,TemplateLiteral:s2,This:Qf,Tuple:Sn,Uncapitalize:iT,Undefined:yl,Union:Je,Unknown:Kt,Unsafe:iv,Uppercase:oT,Void:Zf,With:og},Symbol.toStringTag,{value:"Module"}));function ka(e){return E(e,"~refine")&&q(e["~refine"])&&ht(e["~refine"],0,t=>re(t)&&E(t,"check")&&E(t,"error")&&Tn(t.check)&&Tn(t.error))}function dn(e){return re(e)&&!q(e)}function qi(e){return xt(e)}function _e(e){return dn(e)||qi(e)}function zi(e){return E(e,"additionalItems")&&_e(e.additionalItems)}function lr(e){return E(e,"additionalProperties")&&_e(e.additionalProperties)}function xa(e){return E(e,"allOf")&&q(e.allOf)&&e.allOf.every(t=>_e(t))}function qo(e){return E(e,"$anchor")&&pe(e.$anchor)}function ya(e){return E(e,"anyOf")&&q(e.anyOf)&&e.anyOf.every(t=>_e(t))}function wa(e){return E(e,"const")}function ds(e){return E(e,"contains")&&_e(e.contains)}function LP(e){return E(e,"contentEncoding")&&pe(e.contentEncoding)}function DP(e){return E(e,"contentMediaType")&&pe(e.contentMediaType)}function Ar(e){return E(e,"default")}function _P(e){return E(e,"$defs")&&re(e.$defs)&&Object.values(e.$defs).every(t=>_e(t))}function Ki(e){return E(e,"dependencies")&&re(e.dependencies)&&Object.values(e.dependencies).every(t=>_e(t)||q(t)&&t.every(n=>pe(n)))}function Gi(e){return E(e,"dependentRequired")&&re(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>q(t)&&t.every(n=>pe(n)))}function Vi(e){return E(e,"dependentSchemas")&&re(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>_e(t))}function Yr(e){return E(e,"$dynamicAnchor")&&pe(e.$dynamicAnchor)}function va(e){return E(e,"$dynamicRef")&&pe(e.$dynamicRef)}function Sa(e){return E(e,"else")&&_e(e.else)}function ja(e){return E(e,"enum")&&q(e.enum)}function Wi(e){return E(e,"exclusiveMaximum")&&(Ie(e.exclusiveMaximum)||st(e.exclusiveMaximum))}function Pr(e){return E(e,"exclusiveMinimum")&&(Ie(e.exclusiveMinimum)||st(e.exclusiveMinimum))}function Hs(e){return E(e,"format")&&pe(e.format)}function Sr(e){return E(e,"$id")&&pe(e.$id)}function Ia(e){return E(e,"if")&&_e(e.if)}function Nr(e){return E(e,"items")&&(_e(e.items)||q(e.items)&&e.items.every(t=>_e(t)))}function Ca(e){return Nr(e)&&q(e.items)}function UP(e){return Nr(e)&&!q(e.items)}function Ji(e){return E(e,"maximum")&&(Ie(e.maximum)||st(e.maximum))}function Qi(e){return E(e,"maxContains")&&Ie(e.maxContains)}function qs(e){return E(e,"maxItems")&&Ie(e.maxItems)}function Yi(e){return E(e,"maxLength")&&Ie(e.maxLength)}function Zi(e){return E(e,"maxProperties")&&Ie(e.maxProperties)}function Or(e){return E(e,"minimum")&&(Ie(e.minimum)||st(e.minimum))}function us(e){return E(e,"minContains")&&Ie(e.minContains)}function ps(e){return E(e,"minItems")&&Ie(e.minItems)}function zs(e){return E(e,"minLength")&&Ie(e.minLength)}function Ks(e){return E(e,"minProperties")&&Ie(e.minProperties)}function Xi(e){return E(e,"multipleOf")&&(Ie(e.multipleOf)||st(e.multipleOf))}function Ea(e){return E(e,"not")&&_e(e.not)}function Ta(e){return E(e,"oneOf")&&q(e.oneOf)&&e.oneOf.every(t=>_e(t))}function Gs(e){return E(e,"pattern")&&(pe(e.pattern)||e.pattern instanceof RegExp)}function fs(e){return E(e,"patternProperties")&&re(e.patternProperties)&&Object.values(e.patternProperties).every(t=>_e(t))}function dr(e){return E(e,"prefixItems")&&q(e.prefixItems)&&e.prefixItems.every(t=>_e(t))}function ms(e){return E(e,"properties")&&re(e.properties)&&Object.values(e.properties).every(t=>_e(t))}function eo(e){return E(e,"propertyNames")&&(re(e.propertyNames)||_e(e.propertyNames))}function ug(e){return E(e,"$recursiveAnchor")&&xt(e.$recursiveAnchor)}function Eo(e){return ug(e)&&g(e.$recursiveAnchor,!0)}function Aa(e){return E(e,"$recursiveRef")&&pe(e.$recursiveRef)}function Pa(e){return E(e,"$ref")&&pe(e.$ref)}function ur(e){return E(e,"required")&&q(e.required)&&e.required.every(t=>pe(t))}function Na(e){return E(e,"then")&&_e(e.then)}function to(e){return E(e,"type")&&(pe(e.type)||q(e.type)&&e.type.every(t=>pe(t)))}function jr(e){return E(e,"uniqueItems")&&xt(e.uniqueItems)}function Vs(e){return E(e,"unevaluatedItems")&&_e(e.unevaluatedItems)}function Ws(e){return E(e,"unevaluatedProperties")&&_e(e.unevaluatedProperties)}function BP(e){return Vs(e)||Ws(e)||$s(U(e),t=>zo(e[t]))}function HP(e){return $s(e,t=>zo(t))}function zo(e){return q(e)?HP(e):re(e)?BP(e):!1}function pg(e,t){return zo(t)||$s(U(e),n=>zo(e[n]))}class fg{constructor(t){this.hasUnevaluated=t}UseUnevaluated(){return this.hasUnevaluated}Push(){return Ve(ge("context","Push"),[])}Pop(){return Ve(ge("context","Pop"),[])}AddIndex(t){return Ve(ge("context","AddIndex"),[t])}AddKey(t){return Ve(ge("context","AddKey"),[t])}Merge(t){return Ve(ge("context","Merge"),[t])}}class Gn{constructor(){const t=new Set,n=new Set;this.stack=[{indices:t,keys:n}]}Push(){const t=new Set,n=new Set;return this.stack.push({indices:t,keys:n}),!0}Pop(){return this.stack.pop(),!0}AddIndex(t){return this.GetIndices().add(t),!0}AddKey(t){return this.GetKeys().add(t),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(t){for(const n of t)n.GetIndices().forEach(r=>this.GetIndices().add(r)),n.GetKeys().forEach(r=>this.GetKeys().add(r));return!0}}class nd extends Gn{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}}class Vn extends nd{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}}const Ko={identifier:"External",variables:[]};function hs(e){const t=`External[${Ko.variables.length}]`;return Ko.variables.push(e),t}function mg(){Ko.variables=[]}function hg(){return{...Ko}}function gg(e,t,n,r){const s=hs(n["~refine"].map(i=>i));return Hn(s,G(0),["refinement","_"],Ve(ge("refinement","check"),[r]))}function bg(e,t,n,r){return ht(n["~refine"],0,(s,i)=>s.check(r))}function kg(e,t,n,r,s,i){return Pt(s["~refine"],0,(o,d)=>o.check(i)||t.AddError({keyword:"~refine",schemaPath:n,instancePath:r,params:{index:d,message:o.error(i)}}))}let qP=0;function dt(){return`var_${qP++}`}function rd(e){return Nr(e)&&q(e.items)}function zP(e,t,n,r){const[s,i]=[dt(),dt()],o=Ln(e,t,n.additionalItems,s),d=sl(i,G(n.items.length)),f=t.AddIndex(i);return Hn(r,G(0),[s,i],Ge(d,Ct(o,f)))}function KP(e,t,n,r){const[s,i]=[dt(),dt()],o=Ln(e,t,n.additionalItems,s),d=sl(i,G(n.items.length));return Hn(r,G(0),[s,i],Ge(d,o))}function xg(e,t,n,r){return rd(n)?t.UseUnevaluated()?zP(e,t,n,r):KP(e,t,n,r):G(!0)}function yg(e,t,n,r){return rd(n)?ht(r,0,(i,o)=>Si(o,n.items.length)||Rr(e,t,n.additionalItems,i)&&t.AddIndex(o)):!0}function wg(e,t,n,r,s,i){return rd(s)?ht(i,0,(d,f)=>{const u=`${n}/additionalItems`,m=`${r}/${f}`;return Si(f,s.items.length)||Mr(e,t,u,m,s.additionalItems,d)&&t.AddIndex(f)}):!0}function GP(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function sd(e){const t=[];return fs(e)&&t.push(...U(e.patternProperties)),ms(e)&&t.push(...U(e.properties).map(GP)),g(t.length,0)?"(?!)":`(${t.join("|")})`}function vg(e,t,n){return ur(t)&&ms(t)&&!fs(t)&&g(t.additionalProperties,!1)&&g(U(t.properties).length,t.required.length)}function Sg(e,t,n){return Zt(ge(Ve(ge("Object","getOwnPropertyNames"),[n]),"length"),G(t.required.length))}function jg(e,t,n,r){const[s,i]=[dt(),dt()],o=hs(new RegExp(sd(n))),d=Ln(e,t,n.additionalProperties,`${r}[${s}]`),f=Ve(ge(o,"test"),[s]),u=t.AddKey(s),m=t.UseUnevaluated()?Ge(f,Ct(d,u)):Ge(f,d);return Hn(ss(r),G(0),[s,i],m)}function Ig(e,t,n,r){return vg(t,n)?Sg(t,n,r):jg(e,t,n,r)}function Cg(e,t,n,r){const s=new RegExp(sd(n));return ht(U(r),0,(o,d)=>s.test(o)||Rr(e,t,n.additionalProperties,r[o])&&t.AddKey(o))}function Eg(e,t,n,r,s,i){const o=new RegExp(sd(s)),d=[];return Pt(U(i),0,(u,m)=>{const p=`${n}/additionalProperties`,h=`${r}/${u}`,b=new Vn,k=o.test(u)||Mr(e,b,p,h,s.additionalProperties,i[u])&&t.AddKey(u);return k||d.push(u),k})||t.AddError({keyword:"additionalProperties",schemaPath:n,instancePath:r,params:{additionalProperties:d}})}function no(e,t,n,r,s){const i=tr("results","[]"),o=n.map((m,p)=>tr(`context_${p}`,il("CheckContext",[]))),d=n.map((m,p)=>tr(`condition_${p}`,Ve(xr(["context"],ct(e,t,m,r)),[`context_${p}`]))),f=n.map((m,p)=>cf(`condition_${p}`,Ve(ge("results","push"),[`context_${p}`]))),u=sa(Ct(s,t.Merge("results")));return Ve(xr([],ra([i,...o,...d,...f,u])),[])}function VP(e,t,n,r){return no(e,t,n.allOf,r,Zt(ge("results","length"),G(n.allOf.length)))}function WP(e,t,n,r){return Tt(n.allOf.map(s=>ct(e,t,s,r)))}function Tg(e,t,n,r){return t.UseUnevaluated()?VP(e,t,n,r):WP(e,t,n,r)}function Ag(e,t,n,r){const s=n.allOf.reduce((i,o)=>{const d=new Gn;return lt(e,d,o,r)?[...i,d]:i},[]);return g(s.length,n.allOf.length)&&t.Merge(s)}function Pg(e,t,n,r,s,i){const o=[],d=s.allOf.reduce((u,m,p)=>{const h=`${n}/allOf/${p}`,b=new Vn,k=At(e,b,h,r,m,i);return k||o.push(b),k?[...u,b]:u},[]),f=g(d.length,s.allOf.length)&&t.Merge(d);return f||o.forEach(u=>u.GetErrors().forEach(m=>t.AddError(m))),f}function JP(e,t,n,r){return no(e,t,n.anyOf,r,sf(ge("results","length"),G(0)))}function QP(e,t,n,r){return ol(n.anyOf.map(s=>ct(e,t,s,r)))}function Ng(e,t,n,r){return t.UseUnevaluated()?JP(e,t,n,r):QP(e,t,n,r)}function Og(e,t,n,r){const s=n.anyOf.reduce((i,o)=>{const d=new Gn;return lt(e,d,o,r)?[...i,d]:i},[]);return ts(s.length,0)&&t.Merge(s)}function Rg(e,t,n,r,s,i){const o=[],d=s.anyOf.reduce((u,m,p)=>{const h=new Vn,b=`${n}/anyOf/${p}`,k=At(e,h,b,r,m,i);return k||o.push(h),k?[...u,h]:u},[]),f=ts(d.length,0)&&t.Merge(d);return f||o.forEach(u=>u.GetErrors().forEach(m=>t.AddError(m))),f||t.AddError({keyword:"anyOf",schemaPath:n,instancePath:r,params:{}})}function Mg(e,t,n,r){return G(!!n)}function id(e,t,n,r){return n}function $g(e,t,n,r,s,i){return id(e,t,s)||t.AddError({keyword:"boolean",schemaPath:n,instancePath:r,params:{}})}function Fg(e,t,n,r){return Ms(n.const)?Zt(r,G(n.const)):af(r,hs(n.const))}function od(e,t,n,r){return Ms(n.const)?g(r,n.const):ns(r,n.const)}function Lg(e,t,n,r,s,i){return od(e,t,s,i)||t.AddError({keyword:"const",schemaPath:n,instancePath:r,params:{allowedValue:s.const}})}function Dg(e){return!(us(e)&&g(e.minContains,0))}function YP(e,t,n,r){const[s,i]=[dt(),dt()],o=$t(Zt(ge(r,"length"),G(0))),d=Pw(r,[s,i],Ct(ct(e,t,n.contains,s),t.AddIndex(i)));return Ct(o,d)}function ZP(e,t,n,r){const[s]=[dt()],i=$t(Zt(ge(r,"length"),G(0))),o=Aw(r,[s,"_"],ct(e,t,n.contains,s));return Ct(i,o)}function _g(e,t,n,r){return Dg(n)?t.UseUnevaluated()?YP(e,t,n,r):ZP(e,t,n,r):G(!0)}function ad(e,t,n,r){return Dg(n)?!g(r.length,0)&&Zp(r,(s,i)=>lt(e,t,n.contains,s)&&t.AddIndex(i)):!0}function Ug(e,t,n,r,s,i){return ad(e,t,s,i)||t.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:1}})}function Bg(e,t,n,r){const s=Zt(ge(ss(r),"length"),G(0)),i=Tt(it(n.dependencies).map(([o,d])=>{const f=$t(Vr(r,G(o))),u=ct(e,t,d,r),m=p=>Tt(p.map(h=>Vr(r,G(h))));return Ge(f,q(d)?m(d):u)}));return Ge(s,i)}function Hg(e,t,n,r){const s=g(U(r).length,0),i=ht(it(n.dependencies),0,([o,d])=>!E(r,o)||(q(d)?d.every(f=>E(r,f)):lt(e,t,d,r)));return s||i}function qg(e,t,n,r,s,i){const o=g(U(i).length,0),d=Pt(it(s.dependencies),0,([f,u])=>{const m=`${n}/dependencies/${f}`;return!E(i,f)||(q(u)?u.every(p=>E(i,p)||t.AddError({keyword:"dependencies",schemaPath:n,instancePath:r,params:{property:f,dependencies:u}})):At(e,t,m,r,u,i))});return o||d}function zg(e,t,n,r){const s=Zt(ge(ss(r),"length"),G(0)),i=Tt(it(n.dependentRequired).map(([o,d])=>{const f=$t(Vr(r,G(o))),u=Tt(d.map(m=>Vr(r,G(m))));return Ge(f,u)}));return Ge(s,i)}function Kg(e,t,n,r){const s=g(U(r).length,0),i=ht(it(n.dependentRequired),0,([o,d])=>!E(r,o)||d.every(f=>E(r,f)));return s||i}function Gg(e,t,n,r,s,i){const o=g(U(i).length,0),d=Pt(it(s.dependentRequired),0,([f,u])=>!E(i,f)||Pt(u,0,m=>E(i,m)||t.AddError({keyword:"dependentRequired",schemaPath:n,instancePath:r,params:{property:f,dependencies:u}})));return o||d}function Vg(e,t,n,r){const s=Zt(ge(ss(r),"length"),G(0)),i=Tt(it(n.dependentSchemas).map(([o,d])=>{const f=$t(Vr(r,G(o))),u=ct(e,t,d,r);return Ge(f,u)}));return Ge(s,i)}function Wg(e,t,n,r){const s=g(U(r).length,0),i=ht(it(n.dependentSchemas),0,([o,d])=>!E(r,o)||lt(e,t,d,r));return s||i}function Jg(e,t,n,r,s,i){const o=g(U(i).length,0),d=Pt(it(s.dependentSchemas),0,([f,u])=>{const m=`${n}/dependentSchemas/${f}`;return!E(i,f)||At(e,t,m,r,u,i)});return o||d}function XP(e,t,n,r){const s=e.DynamicRef(n)??!1;return Js(e,t,s,r)}function eN(e,t,n,r){const s=e.DynamicRef(n)??!1;return _e(s)&<(e,t,s,r)}function tN(e,t,n,r,s,i){const o=e.DynamicRef(s)??!1;return _e(o)&&At(e,t,"#",r,o,i)}function Qg(e,t,n,r){return ol(n.enum.map(s=>{if(Ms(s))return Zt(r,G(s));const i=hs(s);return af(r,i)}))}function cd(e,t,n,r){return $s(n.enum,s=>Ms(s)?g(r,s):ns(r,s))}function Yg(e,t,n,r,s,i){return cd(e,t,s,i)||t.AddError({keyword:"enum",schemaPath:n,instancePath:r,params:{allowedValues:s.enum}})}function Zg(e,t,n,r){return sl(r,G(n.exclusiveMaximum))}function ld(e,t,n,r){return Si(r,n.exclusiveMaximum)}function Xg(e,t,n,r,s,i){return ld(e,t,s,i)||t.AddError({keyword:"exclusiveMaximum",schemaPath:n,instancePath:r,params:{comparison:"<",limit:s.exclusiveMaximum}})}function eb(e,t,n,r){return sf(r,G(n.exclusiveMinimum))}function dd(e,t,n,r){return ts(r,n.exclusiveMinimum)}function tb(e,t,n,r,s,i){return dd(e,t,s,i)||t.AddError({keyword:"exclusiveMinimum",schemaPath:n,instancePath:r,params:{comparison:">",limit:s.exclusiveMinimum}})}const nN=[0,31,28,31,30,31,30,31,31,30,31,30,31],rN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function sN(e){return e%4===0&&(e%100!==0||e%400===0)}function ud(e){const t=rN.exec(e);if(!t)return!1;const n=+t[1],r=+t[2],s=+t[3];return r>=1&&r<=12&&s>=1&&s<=(r===2&&sN(n)?29:nN[r])}const iN=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function pd(e,t=!0){const n=iN.exec(e);if(!n)return!1;const r=+n[1],s=+n[2],i=+n[3],o=n[4]==="-"?-1:1,d=+(n[5]||0),f=+(n[6]||0);if(d>23||f>59||t&&!n[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(r<=23&&s<=59&&i<60)return!0;const u=s-f*o,m=r-d*o-(u<0?1:0);return(m===23||m===-1)&&(u===59||u===-1)&&i<61}function nb(e,t=!0){const n=e.split(/T/i);return n.length===2&&ud(n[0])&&pd(n[1],t)}const oN=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function rb(e){return oN.test(e)}const aN=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i;function sb(e){return aN.test(e)}const qr=36,To=1,Ec=26,cN=38,lN=700,dN=72,uN=128;function pN(e,t,n){e=n?Math.floor(e/lN):e>>1,e+=Math.floor(e/t);let r=0;for(;e>(qr-To)*Ec>>1;)e=Math.floor(e/(qr-To)),r+=qr;return r+Math.floor((qr-To+1)*e/(e+cN))}function fN(e){const t=[];let n=uN,r=0,s=dN;const i=e.lastIndexOf("-");if(i>0)for(let d=0;d<i;d++){const f=e.charCodeAt(d);if(f>=128)throw new Error("Invalid punycode: non-basic before delimiter");t.push(f)}let o=i<0?0:i+1;for(;o<e.length;){const d=r;let f=1,u=qr;for(;;){if(o>=e.length)throw new Error("Invalid punycode: unexpected end of input");const p=e.charCodeAt(o++);let h;if(p>=97&&p<=122)h=p-97;else if(p>=48&&p<=57)h=p-48+26;else if(p>=65&&p<=90)Ft();else throw new Error("Invalid punycode: bad digit character");r+=h*f;const b=u<=s?To:u>=s+Ec?Ec:u-s;if(h<b)break;f*=qr-b,u+=qr}const m=t.length+1;s=pN(r-d,m,d===0),n+=Math.floor(r/m),r%=m,t.splice(r,0,n),r++}return globalThis.String.fromCodePoint(...t)}function mN(e){return new RegExp("\\p{Mn}","u").test(String.fromCodePoint(e))}function hN(e){return new RegExp("\\p{Mc}","u").test(String.fromCodePoint(e))}function gN(e){return new RegExp("\\p{Me}","u").test(String.fromCodePoint(e))}function bN(e){return mN(e)||hN(e)||gN(e)}const kN=new Set([1600,2042,12334,12335,12337,12338,12339,12340,12341,12347]),xN=new Set([2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,6980,7082,7083,43456,69702,69759,69817,69939,69940,70080,70197,70477,70722,70850,71103,71231,71350,72767,73028,73029]);function yN(e){return new RegExp("\\p{Script=Greek}","u").test(String.fromCodePoint(e))}function wN(e){return new RegExp("\\p{Script=Hebrew}","u").test(String.fromCodePoint(e))}function vN(e){return new RegExp("\\p{Script=Hiragana}","u").test(String.fromCodePoint(e))}function SN(e){return new RegExp("\\p{Script=Katakana}","u").test(String.fromCodePoint(e))}function jN(e){return new RegExp("\\p{Script=Han}","u").test(String.fromCodePoint(e))}function IN(e){return e>=1632&&e<=1641}function CN(e){return e>=1776&&e<=1785}function Bu(e){return xN.has(e)}function ib(e){if(e.length===0)return Ft();const t=[...e].map(o=>o.codePointAt(0)),n=t.length;if(t[0]===45||t[n-1]===45||n>=4&&t[2]===45&&t[3]===45||bN(t[0]))return!1;let r=!1,s=!1,i=!1;for(let o=0;o<n;o++){const d=t[o];if(kN.has(d))return!1;(vN(d)||SN(d)||jN(d))&&(r=!0),IN(d)&&(s=!0),CN(d)&&(i=!0);const f=t[o-1],u=t[o+1];switch(d){case 183:if(f!==108||u!==108)return!1;break;case 885:if(u===void 0||!yN(u))return!1;break;case 1523:case 1524:if(f===void 0||!wN(f))return!1;break;case 8204:if(f===void 0||f<128&&!Bu(f))return!1;break;case 8205:if(f===void 0||!Bu(f))return!1;break}}return!(e.includes("・")&&!r||s&&i)}function EN(e){if(e.charCodeAt(0)===45||e.charCodeAt(e.length-1)===45||e.length>=4&&e.charCodeAt(2)===45&&e.charCodeAt(3)===45)return!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||n===45))return!1}return!0}function ob(e){return e.toLowerCase().startsWith("xn--")}function ab(e){try{const t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;const r=fN(t);return r?ib(r):!1}catch{return!1}}function TN(e){return e.length===0||e.length>63?!1:ob(e)?ab(e):ib(e)}function AN(e){return e.length===0||e.length>63?!1:ob(e)?ab(e):EN(e)}function cb(e){if(e.length===0||e.length>253||e.charCodeAt(e.length-1)===46)return!1;for(const t of e.split("."))if(!AN(t))return!1;return!0}const PN=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function lb(e){return PN.test(e)}function db(e){if(e.length===0||e.includes(" "))return!1;const t=e.normalize("NFC").replace(/[\u002E\u3002\uFF0E\uFF61]/g,".");if(t.length>253)return!1;for(const n of t.split("."))if(!TN(n))return!1;return!0}function ub(e,t,n){let r=0,s=0,i=0,o=0;for(let d=t;d<n;d++){const f=e.charCodeAt(d);if(f===46){if(i===0||s>255||o===48&&i>1)return!1;r++,s=0,i=0,o=0}else if(f>=48&&f<=57)i===0&&(o=f),s=s*10+(f-48),i++;else return!1}return r===3&&i>0&&s<=255&&!(o===48&&i>1)}function pb(e){return ub(e,0,e.length)}function NN(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function fb(e){const t=e.length;if(t===0)return!1;let n=0,r=!1,s=0;if(e.charCodeAt(0)===58&&e.charCodeAt(1)===58){if(t===2)return!0;r=!0,s=2}for(;s<t;){let i=0;const o=s;for(;s<t&&NN(e.charCodeAt(s));)s++,i++;if(i===0)return!1;const d=e.charCodeAt(s);if(d===46){if(!ub(e,o,t))return!1;n+=2,s=t;break}if(i>4)return!1;if(n++,s===t)break;if(d!==58)return!1;if(s++,e.charCodeAt(s)===58){if(r||e.charCodeAt(s+1)===58)return!1;if(r=!0,s++,s===t)break}}return r?n<=7:n===8}function Hu(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function mb(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;const t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?Hu(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:Hu(e)}function hb(e){try{return new URL(e),!0}catch{return!1}}const ON=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function gb(e){return ON.test(e)}const RN=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function bb(e){return RN.test(e)}function kb(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}const MN=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function xb(e){return MN.test(e)}const $N=/^(?!.*[^\x00-\x7F])(?!.*\\)(?:(?:[a-z][a-z0-9+\-.]*:)?(?:\/\/[^\s[\]{}<>^`|]*)?|[^\s[\]{}<>^`|]*)(?:\?[^\s[\]{}<>^`|]*)?(?:#[^\s[\]{}<>^`|]*)?$/i;function yb(e){return $N.test(e)}const FN=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;function wb(e){return FN.test(e)}function vb(e){return e>=97&&e<=122||e>=65&&e<=90}function Sb(e){return vb(e)||e>=48&&e<=57}function vo(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function LN(e){return Sb(e)||e===43||e===45||e===46}function Tc(e){return Sb(e)||e===45||e===46||e===95||e===126}function Ac(e){return e===33||e===36||e===38||e===39||e===40||e===41||e===42||e===43||e===44||e===59||e===61}function DN(e){return Tc(e)||Ac(e)||e===58||e===64}function jb(e){const t=e.length;if(t===0||!vb(e.charCodeAt(0)))return!1;let n=1;for(;n<t;){const r=e.charCodeAt(n);if(r===58)break;if(!LN(r))return!1;n++}if(e.charCodeAt(n)!==58)return!1;if(n++,e.charCodeAt(n)===47&&e.charCodeAt(n+1)===47){n+=2;const r=n;let s=-1;for(let i=n;i<t;i++){const o=e.charCodeAt(i);if(o===64){s=i;break}if(o===47||o===63||o===35)break}if(s!==-1){for(let i=r;i<s;i++){const o=e.charCodeAt(i);if(o===91||o===93)return!1;if(o===37){if(i+2>=s||!vo(e.charCodeAt(i+1))||!vo(e.charCodeAt(i+2)))return!1;i+=2}else if(!Tc(o)&&!Ac(o)&&o!==58)return!1}n=s+1}if(e.charCodeAt(n)===91){for(n++;n<t&&e.charCodeAt(n)!==93;)n++;if(e.charCodeAt(n)!==93)return!1;n++}else for(;n<t;){const i=e.charCodeAt(n);if(i===47||i===63||i===35||i===58)break;if(i<128&&!Tc(i)&&!Ac(i))return!1;n++}if(e.charCodeAt(n)===58)for(n++;n<t;){const i=e.charCodeAt(n);if(i===47||i===63||i===35)break;if(i<48||i>57)return!1;n++}}for(;n<t;){const r=e.charCodeAt(n);if(r===37){if(n+2>=t||!vo(e.charCodeAt(n+1))||!vo(e.charCodeAt(n+2)))return!1;n+=2}else{if(r>127)return!1;if(!(DN(r)||r===47||r===63||r===35))return!1}n++}return!0}const _N=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;function Ib(e){return _N.test(e)}const UN=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Cb(e){return UN.test(e)}const ze=new Map;function Eb(){ze.clear()}function BN(){return[...ze.entries()]}function HN(e,t){ze.set(e,t)}function qN(e){return ze.has(e)}function zN(e){return ze.get(e)}function Tb(e,t){var n;return((n=ze.get(e))==null?void 0:n(t))??!0}function Ab(){Eb(),ze.set("date-time",nb),ze.set("date",ud),ze.set("duration",rb),ze.set("email",sb),ze.set("hostname",cb),ze.set("idn-email",lb),ze.set("idn-hostname",db),ze.set("ipv4",pb),ze.set("ipv6",fb),ze.set("iri-reference",mb),ze.set("iri",hb),ze.set("json-pointer-uri-fragment",gb),ze.set("json-pointer",bb),ze.set("regex",kb),ze.set("relative-json-pointer",xb),ze.set("time",pd),ze.set("uri-reference",yb),ze.set("uri-template",wb),ze.set("uri",jb),ze.set("url",Ib),ze.set("uuid",Cb)}Ab();const KN=Object.freeze(Object.defineProperty({__proto__:null,Clear:Eb,Entries:BN,Get:zN,Has:qN,IsDate:ud,IsDateTime:nb,IsDuration:rb,IsEmail:sb,IsHostname:cb,IsIPv4:pb,IsIPv6:fb,IsIdnEmail:lb,IsIdnHostname:db,IsIri:hb,IsIriReference:mb,IsJsonPointer:bb,IsJsonPointerUriFragment:gb,IsRegex:kb,IsRelativeJsonPointer:xb,IsTime:pd,IsUri:jb,IsUriReference:yb,IsUriTemplate:wb,IsUrl:Ib,IsUuid:Cb,Reset:Ab,Set:HN,Test:Tb},Symbol.toStringTag,{value:"Module"}));function Pb(e,t,n,r){return Ve(ge("Format","Test"),[G(n.format),r])}function fd(e,t,n,r){return Tb(n.format,r)}function Nb(e,t,n,r,s,i){return fd(e,t,s,i)||t.AddError({keyword:"format",schemaPath:n,instancePath:r,params:{format:s.format}})}function Ob(e,t,n,r){const s=Na(n)?n.then:!0,i=Sa(n)?n.else:!0;return Ow(ct(e,t,n.if,r),ct(e,t,s,r),ct(e,t,i,r))}function Rb(e,t,n,r){const s=Na(n)?n.then:!0,i=Sa(n)?n.else:!0;return lt(e,t,n.if,r)?lt(e,t,s,r):lt(e,t,i,r)}function Mb(e,t,n,r,s,i){const o=Na(s)?s.then:!0,d=Sa(s)?s.else:!0,f=new Vn,u=At(e,f,`${n}/if`,r,s.if,i)?At(e,f,`${n}/then`,r,o,i)||t.AddError({keyword:"if",schemaPath:n,instancePath:r,params:{failingKeyword:"then"}}):At(e,t,`${n}/else`,r,d,i)||t.AddError({keyword:"if",schemaPath:n,instancePath:r,params:{failingKeyword:"else"}});return u&&t.Merge([f]),u}function GN(e,t,n,r){return Tt(n.items.map((s,i)=>{const o=rs(ge(r,"length"),G(i)),d=Ln(e,t,s,`${r}[${i}]`),f=t.AddIndex(G(i));return Ge(o,Ct(d,f))}))}function VN(e,t,n,r){return Tt(n.items.map((s,i)=>{const o=rs(ge(r,"length"),G(i)),d=Ln(e,t,s,`${r}[${i}]`);return Ge(o,d)}))}function WN(e,t,n,r){return t.UseUnevaluated()?GN(e,t,n,r):VN(e,t,n,r)}function JN(e,t,n,r){return ht(n.items,0,(s,i)=>ir(r.length,i)||Rr(e,t,s,r[i])&&t.AddIndex(i))}function QN(e,t,n,r,s,i){return Pt(s.items,0,(o,d)=>{const f=`${n}/items/${d}`,u=`${r}/${d}`;return ir(i.length,d)||Mr(e,t,f,u,o,i[d])&&t.AddIndex(d)})}function YN(e,t,n,r){const s=dr(n)?n.prefixItems.length:0,i=Ln(e,t,n.items,"element"),o=t.AddIndex("index");return Hn(r,G(s),["element","index"],Ct(i,o))}function ZN(e,t,n,r){const s=dr(n)?n.prefixItems.length:0,i=Ln(e,t,n.items,"element");return Hn(r,G(s),["element","index"],i)}function XN(e,t,n,r){return t.UseUnevaluated()?YN(e,t,n,r):ZN(e,t,n,r)}function eO(e,t,n,r){const s=dr(n)?n.prefixItems.length:0;return ht(r,s,(i,o)=>Rr(e,t,n.items,i)&&t.AddIndex(o))}function tO(e,t,n,r,s,i){const o=dr(s)?s.prefixItems.length:0;return Pt(i,o,(d,f)=>{const u=`${n}/items`,m=`${r}/${f}`;return Mr(e,t,u,m,s.items,d)&&t.AddIndex(f)})}function $b(e,t,n,r){return Ca(n)?WN(e,t,n,r):XN(e,t,n,r)}function Fb(e,t,n,r){return Ca(n)?JN(e,t,n,r):eO(e,t,n,r)}function Lb(e,t,n,r,s,i){return Ca(s)?QN(e,t,n,r,s,i):tO(e,t,n,r,s,i)}function Db(e){return ds(e)}function _b(e,t,n,r){if(!Db(n))return G(!0);const[s]=[dt()],i=na(r,[s,"_"],ct(e,t,n.contains,s));return rs(i,G(n.maxContains))}function md(e,t,n,r){if(!Db(n))return!0;const s=el(r,i=>lt(e,t,n.contains,i));return ir(s,n.maxContains)}function Ub(e,t,n,r,s,i){const o=us(s)?s.minContains:1;return md(e,t,s,i)||t.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:o,maxContains:s.maxContains}})}function Bb(e,t,n,r){return rs(r,G(n.maximum))}function hd(e,t,n,r){return ir(r,n.maximum)}function Hb(e,t,n,r,s,i){return hd(e,t,s,i)||t.AddError({keyword:"maximum",schemaPath:n,instancePath:r,params:{comparison:"<=",limit:s.maximum}})}function qb(e,t,n,r){return rs(ge(r,"length"),G(n.maxItems))}function gd(e,t,n,r){return ir(r.length,n.maxItems)}function zb(e,t,n,r,s,i){return gd(e,t,s,i)||t.AddError({keyword:"maxItems",schemaPath:n,instancePath:r,params:{limit:s.maxItems}})}function Kb(e,t,n,r){return Tw(r,G(n.maxLength))}function bd(e,t,n,r){return Qp(r,n.maxLength)}function Gb(e,t,n,r,s,i){return bd(e,t,s,i)||t.AddError({keyword:"maxLength",schemaPath:n,instancePath:r,params:{limit:s.maxLength}})}function Vb(e,t,n,r){return rs(ge(ss(r),"length"),G(n.maxProperties))}function kd(e,t,n,r){return ir(U(r).length,n.maxProperties)}function Wb(e,t,n,r,s,i){return kd(e,t,s,i)||t.AddError({keyword:"maxProperties",schemaPath:n,instancePath:r,params:{limit:s.maxProperties}})}function Jb(e){return ds(e)}function nO(e,t,n,r){const[s,i]=[dt(),dt()],o=na(r,[s,i],Ct(ct(e,t,n.contains,s),t.AddIndex(i)));return ji(o,G(n.minContains))}function rO(e,t,n,r){const[s]=[dt()],i=na(r,[s,"_"],ct(e,t,n.contains,s));return ji(i,G(n.minContains))}function Qb(e,t,n,r){return Jb(n)?t.UseUnevaluated()?nO(e,t,n,r):rO(e,t,n,r):G(!0)}function xd(e,t,n,r){if(!Jb(n))return!0;const s=el(r,(i,o)=>lt(e,t,n.contains,i)&&t.AddIndex(o));return Rs(s,n.minContains)}function Yb(e,t,n,r,s,i){return xd(e,t,s,i)||t.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:s.minContains}})}function Zb(e,t,n,r){return ji(r,G(n.minimum))}function yd(e,t,n,r){return Rs(r,n.minimum)}function Xb(e,t,n,r,s,i){return yd(e,t,s,i)||t.AddError({keyword:"minimum",schemaPath:n,instancePath:r,params:{comparison:">=",limit:s.minimum}})}function ek(e,t,n,r){return ji(ge(r,"length"),G(n.minItems))}function wd(e,t,n,r){return Rs(r.length,n.minItems)}function tk(e,t,n,r,s,i){return wd(e,t,s,i)||t.AddError({keyword:"minItems",schemaPath:n,instancePath:r,params:{limit:s.minItems}})}function nk(e,t,n,r){return Ew(r,G(n.minLength))}function vd(e,t,n,r){return Yp(r,n.minLength)}function rk(e,t,n,r,s,i){return vd(e,t,s,i)||t.AddError({keyword:"minLength",schemaPath:n,instancePath:r,params:{limit:s.minLength}})}function sk(e,t,n,r){return ji(ge(ss(r),"length"),G(n.minProperties))}function Sd(e,t,n,r){return Rs(U(r).length,n.minProperties)}function ik(e,t,n,r,s,i){return Sd(e,t,s,i)||t.AddError({keyword:"minProperties",schemaPath:n,instancePath:r,params:{limit:s.minProperties}})}function ok(e,t,n,r){return Rw(r,G(n.multipleOf))}function jd(e,t,n,r){return Wp(r,n.multipleOf)}function ak(e,t,n,r,s,i){return jd(e,t,s,i)||t.AddError({keyword:"multipleOf",schemaPath:n,instancePath:r,params:{multipleOf:s.multipleOf}})}function sO(e,t,n,r){return no(e,t,[n.not],r,$t(Zt(ge("results","length"),G(1))))}function iO(e,t,n,r){return $t(ct(e,t,n.not,r))}function ck(e,t,n,r){return t.UseUnevaluated()?sO(e,t,n,r):iO(e,t,n,r)}function Id(e,t,n,r){const s=new Gn;return!lt(e,s,n.not,r)&&t.Merge([s])}function lk(e,t,n,r,s,i){return Id(e,t,s,i)||t.AddError({keyword:"not",schemaPath:n,instancePath:r,params:{}})}function oO(e,t,n,r){return no(e,t,n.oneOf,r,Zt(ge("results","length"),G(1)))}function aO(e,t,n,r){const[s]=[dt()],i=Nw(n.oneOf.map(d=>ct(e,t,d,r))),o=na(i,[s,"_"],Zt(s,G(!0)));return Zt(o,G(1))}function dk(e,t,n,r){return t.UseUnevaluated()?oO(e,t,n,r):aO(e,t,n,r)}function uk(e,t,n,r){const s=n.oneOf.reduce((i,o)=>{const d=new Gn;return lt(e,d,o,r)?[...i,d]:i},[]);return g(s.length,1)&&t.Merge(s)}function pk(e,t,n,r,s,i){const o=[],d=[],f=s.oneOf.reduce((m,p,h)=>{const b=new Vn,k=`${n}/oneOf/${h}`,S=At(e,b,k,r,p,i);return S&&d.push(h),S||o.push(b),S?[...m,b]:m},[]),u=g(f.length,1)&&t.Merge(f);return!u&&g(d.length,0)&&o.forEach(m=>m.GetErrors().forEach(p=>t.AddError(p))),u||t.AddError({keyword:"oneOf",schemaPath:n,instancePath:r,params:{passingSchemas:d}})}function fk(e,t,n,r){const s=hs(pe(n.pattern)?new RegExp(n.pattern,"u"):n.pattern);return Ve(ge(s,"test"),[r])}function Cd(e,t,n,r){return(pe(n.pattern)?new RegExp(n.pattern,"u"):n.pattern).test(r)}function mk(e,t,n,r,s,i){return Cd(e,t,s,i)||t.AddError({keyword:"pattern",schemaPath:n,instancePath:r,params:{pattern:s.pattern}})}function hk(e,t,n,r){return Tt(it(n.patternProperties).map(([s,i])=>{const[o,d]=[dt(),dt()],f=hs(new RegExp(s,"u")),u=$t(Ve(ge(f,"test"),[o])),m=Ln(e,t,i,d),p=t.AddKey(o),h=t.UseUnevaluated()?Ge(u,Ct(m,p)):Ge(u,m);return Hn(of(r),G(0),[`[${o}, ${d}]`,"_"],h)}))}function gk(e,t,n,r){return ht(it(n.patternProperties),0,([s,i])=>{const o=new RegExp(s,"u");return ht(it(r),0,([d,f])=>!o.test(d)||Rr(e,t,i,f)&&t.AddKey(d))})}function bk(e,t,n,r,s,i){return Pt(it(s.patternProperties),0,([o,d])=>{const f=`${n}/patternProperties/${o}`,u=new RegExp(o,"u");return Pt(it(i),0,([m,p])=>{const h=`${r}/${m}`;return!u.test(m)||Mr(e,t,f,h,d,p)&&t.AddKey(m)})})}function kk(e,t,n,r){return Tt(n.prefixItems.map((s,i)=>{const o=rs(ge(r,"length"),G(i)),d=Ln(e,t,s,`${r}[${i}]`),f=t.AddIndex(G(i)),u=t.UseUnevaluated()?Ct(d,f):d;return Ge(o,u)}))}function xk(e,t,n,r){return g(r.length,0)||ht(n.prefixItems,0,(s,i)=>ir(r.length,i)||Rr(e,t,s,r[i])&&t.AddIndex(i))}function yk(e,t,n,r,s,i){return g(i.length,0)||Pt(s.prefixItems,0,(o,d)=>{const f=`${n}/prefixItems/${d}`,u=`${r}/${d}`;return ir(i.length,d)||Mr(e,t,f,u,o,i[d])&&t.AddIndex(d)})}function Ed(e,t){return e.includes(t)||Ci().exactOptionalPropertyTypes}function cO(e,t){return uc(ge(e,t))}function wk(e,t){return Fe(e[t])}function vk(e,t,n,r){const s=ur(n)?n.required:[],i=it(n.properties).map(([o,d])=>{const f=$t(Vr(r,G(o))),u=Ln(e,t,d,ge(r,o)),m=t.AddKey(G(o)),p=t.UseUnevaluated()?Ct(u,m):u,h=s.includes(o)?p:Ge(f,p);return Ed(s,o)?h:Ge(cO(r,o),h)});return Tt(i)}function Sk(e,t,n,r){const s=ur(n)?n.required:[];return ht(it(n.properties),0,([o,d])=>{const f=!E(r,o)||Rr(e,t,d,r[o])&&t.AddKey(o);return Ed(s,o)?f:wk(r,o)||f})}function jk(e,t,n,r,s,i){const o=ur(s)?s.required:[];return Pt(it(s.properties),0,([f,u])=>{const m=`${n}/properties/${f}`,p=`${r}/${f}`,h=()=>!E(i,f)||Mr(e,t,m,p,u,i[f])&&t.AddKey(f);return Ed(o,f)?h():wk(i,f)||h()})}function Ik(e,t,n,r){const[s,i]=[dt(),dt()];return Hn(ss(r),G(0),[s,i],ct(e,t,n.propertyNames,s))}function Ck(e,t,n,r){return ht(U(r),0,(s,i)=>lt(e,t,n.propertyNames,s))}function Ek(e,t,n,r,s,i){const o=[];return Pt(U(i),0,(f,u)=>{const m=`${r}/${f}`,p=`${n}/propertyNames`,h=new Vn,b=At(e,h,p,m,s.propertyNames,f);return b||o.push(f),b})||t.AddError({keyword:"propertyNames",schemaPath:n,instancePath:r,params:{propertyNames:o}})}function Tk(e,t,n,r){const s=e.RecursiveRef(n)??!1;return Js(e,t,s,r)}function Ak(e,t,n,r){const s=e.RecursiveRef(n)??!1;return _e(s)&<(e,t,s,r)}function Pk(e,t,n,r,s,i){const o=e.RecursiveRef(s)??!1;return _e(o)&&At(e,t,"#",r,o,i)}function lO(e,t,n,r){const s=xr(["context","value"],Js(e,t,n,"value")),i=xr(["context","value"],ra([tr("nextContext",il("CheckContext",[])),tr("result",Ve(s,["nextContext","value"])),cf("result",t.Merge("[nextContext]")),sa("result")]));return Ve(i,["context",r])}function dO(e,t,n,r){return Js(e,t,n,r)}function Nk(e,t,n,r){const s=e.Ref(n)??!1;return t.UseUnevaluated()?lO(e,t,s,r):dO(e,t,s,r)}function Ok(e,t,n,r){const s=e.Ref(n)??!1,i=new Gn,o=_e(s)&<(e,i,s,r);return o&&t.Merge([i]),o}function Rk(e,t,n,r,s,i){const o=e.Ref(s)??!1,d=new Vn,f=_e(o)&&At(e,d,"#",r,o,i);return f&&t.Merge([d]),f||d.GetErrors().forEach(u=>t.AddError(u)),f}function Mk(e,t,n,r){return Tt(n.required.map(s=>Vr(r,G(s))))}function $k(e,t,n,r){return ht(n.required,0,s=>E(r,s))}function Fk(e,t,n,r,s,i){const o=[];return Pt(s.required,0,f=>{const u=E(i,f);return u||o.push(f),u})||t.AddError({keyword:"required",schemaPath:n,instancePath:r,params:{requiredProperties:o}})}function Lk(e,t,n,r){return g(n,"object")?tf(r):g(n,"array")?$o(r):g(n,"boolean")?ww(r):g(n,"integer")?vw(r):g(n,"number")?ef(r):g(n,"null")?Sw(r):g(n,"string")?rf(r):g(n,"bigint")?Xp(r):g(n,"constructor")?Cw(r):g(n,"function")?Iw(r):g(n,"symbol")?jw(r):g(n,"undefined")||g(n,"void")?uc(r):G(!0)}function Td(e,t,n,r,s){return g(n,"object")?kn(s):g(n,"array")?q(s):g(n,"boolean")?xt(s):g(n,"integer")?Zc(s):g(n,"number")?Ie(s):g(n,"null")?Xt(s):g(n,"string")?pe(s):g(n,"bigint")?st(s):g(n,"constructor")?ta(s):g(n,"function")?Tn(s):g(n,"symbol")?Xc(s):g(n,"undefined")||g(n,"void")?Fe(s):!0}function uO(e,t,n,r){return ol(n.map(s=>Lk(e,t,s,r)))}function Dk(e,t,n,r,s){return $s(n,i=>Td(e,t,i,r,s))}function _k(e,t,n,r){return q(n.type)?uO(e,t,n.type,r):Lk(e,t,n.type,r)}function Uk(e,t,n,r){return q(n.type)?Dk(e,t,n.type,n,r):Td(e,t,n.type,n,r)}function Bk(e,t,n,r,s,i){return(q(s.type)?Dk(e,t,s.type,s,i):Td(e,t,s.type,s,i))||t.AddError({keyword:"type",schemaPath:n,instancePath:r,params:{type:s.type}})}function Hk(e,t,n,r){const[s,i]=[dt(),dt()],o=Ve(ge("context","GetIndices"),[]),d=Ve(ge("indices","has"),[s]),f=ct(e,t,n.unevaluatedItems,i),u=Ve(ge("context","AddIndex"),[s]),m=Hn(r,G(0),[i,s],Ct(Ge(d,f),u));return Ve(xr(["context"],ra([tr("indices",o),sa(m)])),["context"])}function qk(e,t,n,r){const s=t.GetIndices();return ht(r,0,(i,o)=>(s.has(o)||lt(e,t,n.unevaluatedItems,i))&&t.AddIndex(o))}function zk(e,t,n,r,s,i){const o=t.GetIndices(),d=[];return Pt(i,0,(u,m)=>{const p=new Vn,h=(o.has(m)||At(e,p,n,r,s.unevaluatedItems,u))&&t.AddIndex(m);return h||d.push(m),h})||t.AddError({keyword:"unevaluatedItems",schemaPath:n,instancePath:r,params:{unevaluatedItems:d}})}function Kk(e,t,n,r){const[s,i]=[dt(),dt()],o=Ve(ge("context","GetKeys"),[]),d=Ve(ge("keys","has"),[s]),f=Ve(ge("context","AddKey"),[s]),u=ct(e,t,n.unevaluatedProperties,i),m=Hn(of(r),G(0),[`[${s}, ${i}]`,"_"],Ge(d,Ct(u,f)));return Ve(xr(["context"],ra([tr("keys",o),sa(m)])),["context"])}function Gk(e,t,n,r){const s=t.GetKeys();return ht(it(r),0,([i,o])=>s.has(i)||lt(e,t,n.unevaluatedProperties,o)&&t.AddKey(i))}function Vk(e,t,n,r,s,i){const o=t.GetKeys(),d=[];return Pt(it(i),0,([u,m])=>{const p=new Vn,h=o.has(u)||At(e,p,n,r,s.unevaluatedProperties,m)&&t.AddKey(u);return h||d.push(u),h})||t.AddError({keyword:"unevaluatedProperties",schemaPath:n,instancePath:r,params:{unevaluatedProperties:d}})}function Ad(e){return!g(e.uniqueItems,!1)}function Wk(e,t,n,r){if(!Ad(n))return G(!0);const s=ge(il("Set",[Ve(ge(r,"map"),[ge("Hashing","Hash")])]),"size"),i=ge(r,"length");return Zt(s,i)}function Jk(e,t,n,r){if(!Ad(n))return!0;const s=new Set(r.map(ia)).size,i=r.length;return g(s,i)}function Qk(e,t,n,r,s,i){if(!Ad(s))return!0;const o=new Set,d=i.reduce((u,m,p)=>{const h=ia(m);return o.has(h)?[...u,p]:(o.add(h),u)},[]);return g(d.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:n,instancePath:r,params:{duplicateItems:d}})}function yi(e,t){return to(e)&&(q(e.type)&&ts(e.type.length,0)&&ht(e.type,0,n=>g(n,t))||g(e.type,t))}function pO(e){return yi(e,"object")}function fO(e){return dn(e)&&(lr(e)||Ki(e)||Gi(e)||Vi(e)||ms(e)||fs(e)||eo(e)||Ks(e)||Zi(e)||ur(e)||Ws(e))}function mO(e){return yi(e,"array")}function hO(e){return dn(e)&&(zi(e)||Nr(e)||ds(e)||Qi(e)||qs(e)||us(e)||ps(e)||dr(e)||Vs(e)||jr(e))}function gO(e){return yi(e,"string")}function bO(e){return dn(e)&&(zs(e)||Yi(e)||Hs(e)||Gs(e))}function kO(e){return yi(e,"number")||yi(e,"bigint")}function xO(e){return dn(e)&&(Or(e)||Ji(e)||Wi(e)||Pr(e)||Xi(e))}function Ln(e,t,n,r){return t.UseUnevaluated()?Ct(Ct(t.Push(),ct(e,t,n,r)),t.Pop()):ct(e,t,n,r)}function ct(e,t,n,r){e.Push(n);const s=[];if(qi(n))return Mg(e,t,n);if(to(n)&&s.push(_k(e,t,n,r)),fO(n)){const o=[];ur(n)&&o.push(Mk(e,t,n,r)),lr(n)&&o.push(Ig(e,t,n,r)),Ki(n)&&o.push(Bg(e,t,n,r)),Gi(n)&&o.push(zg(e,t,n,r)),Vi(n)&&o.push(Vg(e,t,n,r)),fs(n)&&o.push(hk(e,t,n,r)),ms(n)&&o.push(vk(e,t,n,r)),eo(n)&&o.push(Ik(e,t,n,r)),Ks(n)&&o.push(sk(e,t,n,r)),Zi(n)&&o.push(Vb(e,t,n,r));const d=Tt(o),f=Ge($t(tf(r)),d);s.push(pO(n)?d:f)}if(hO(n)){const o=[];zi(n)&&o.push(xg(e,t,n,r)),ds(n)&&o.push(_g(e,t,n,r)),Nr(n)&&o.push($b(e,t,n,r)),Qi(n)&&o.push(_b(e,t,n,r)),qs(n)&&o.push(qb(e,t,n,r)),us(n)&&o.push(Qb(e,t,n,r)),ps(n)&&o.push(ek(e,t,n,r)),dr(n)&&o.push(kk(e,t,n,r)),jr(n)&&o.push(Wk(e,t,n,r));const d=Tt(o),f=Ge($t($o(r)),d);s.push(mO(n)?d:f)}if(bO(n)){const o=[];Yi(n)&&o.push(Kb(e,t,n,r)),zs(n)&&o.push(nk(e,t,n,r)),Hs(n)&&o.push(Pb(e,t,n,r)),Gs(n)&&o.push(fk(e,t,n,r));const d=Tt(o),f=Ge($t(rf(r)),d);s.push(gO(n)?d:f)}if(xO(n)){const o=[];Wi(n)&&o.push(Zg(e,t,n,r)),Pr(n)&&o.push(eb(e,t,n,r)),Ji(n)&&o.push(Bb(e,t,n,r)),Or(n)&&o.push(Zb(e,t,n,r)),Xi(n)&&o.push(ok(e,t,n,r));const d=Tt(o),f=Ge($t(Ge(ef(r),Xp(r))),d);s.push(kO(n)?d:f)}Pa(n)&&s.push(Nk(e,t,n,r)),Aa(n)&&s.push(Tk(e,t,n,r)),va(n)&&s.push(XP(e,t,n,r)),wa(n)&&s.push(Fg(e,t,n,r)),ja(n)&&s.push(Qg(e,t,n,r)),Ia(n)&&s.push(Ob(e,t,n,r)),Ea(n)&&s.push(ck(e,t,n,r)),xa(n)&&s.push(Tg(e,t,n,r)),ya(n)&&s.push(Ng(e,t,n,r)),Ta(n)&&s.push(dk(e,t,n,r)),Vs(n)&&s.push(Ge($t($o(r)),Hk(e,t,n,r))),Ws(n)&&s.push(Ge($t(nf(r)),Kk(e,t,n,r))),ka(n)&&s.push(gg(e,t,n,r));const i=Tt(s);return e.Pop(n),i}function Rr(e,t,n,r){return t.Push()&<(e,t,n,r)&&t.Pop()}function lt(e,t,n,r){e.Push(n);const s=qi(n)?id(e,t,n):(!to(n)||Uk(e,t,n,r))&&(!(re(r)&&!q(r))||(!ur(n)||$k(e,t,n,r))&&(!lr(n)||Cg(e,t,n,r))&&(!Ki(n)||Hg(e,t,n,r))&&(!Gi(n)||Kg(e,t,n,r))&&(!Vi(n)||Wg(e,t,n,r))&&(!fs(n)||gk(e,t,n,r))&&(!ms(n)||Sk(e,t,n,r))&&(!eo(n)||Ck(e,t,n,r))&&(!Ks(n)||Sd(e,t,n,r))&&(!Zi(n)||kd(e,t,n,r)))&&(!q(r)||(!zi(n)||yg(e,t,n,r))&&(!ds(n)||ad(e,t,n,r))&&(!Nr(n)||Fb(e,t,n,r))&&(!Qi(n)||md(e,t,n,r))&&(!qs(n)||gd(e,t,n,r))&&(!us(n)||xd(e,t,n,r))&&(!ps(n)||wd(e,t,n,r))&&(!dr(n)||xk(e,t,n,r))&&(!jr(n)||Jk(e,t,n,r)))&&(!pe(r)||(!Yi(n)||bd(e,t,n,r))&&(!zs(n)||vd(e,t,n,r))&&(!Hs(n)||fd(e,t,n,r))&&(!Gs(n)||Cd(e,t,n,r)))&&(!(Ie(r)||st(r))||(!Wi(n)||ld(e,t,n,r))&&(!Pr(n)||dd(e,t,n,r))&&(!Ji(n)||hd(e,t,n,r))&&(!Or(n)||yd(e,t,n,r))&&(!Xi(n)||jd(e,t,n,r)))&&(!Pa(n)||Ok(e,t,n,r))&&(!Aa(n)||Ak(e,t,n,r))&&(!va(n)||eN(e,t,n,r))&&(!wa(n)||od(e,t,n,r))&&(!ja(n)||cd(e,t,n,r))&&(!Ia(n)||Rb(e,t,n,r))&&(!Ea(n)||Id(e,t,n,r))&&(!xa(n)||Ag(e,t,n,r))&&(!ya(n)||Og(e,t,n,r))&&(!Ta(n)||uk(e,t,n,r))&&(!Vs(n)||!q(r)||qk(e,t,n,r))&&(!Ws(n)||!re(r)||Gk(e,t,n,r))&&(!ka(n)||bg(e,t,n,r));return e.Pop(n),s}function Mr(e,t,n,r,s,i){return t.Push()&&At(e,t,n,r,s,i)&&t.Pop()}function At(e,t,n,r,s,i){e.Push(s);const o=qi(s)?$g(e,t,n,r,s):!!(+(!to(s)||Bk(e,t,n,r,s,i))&+(!(re(i)&&!q(i))||!!(+(!ur(s)||Fk(e,t,n,r,s,i))&+(!lr(s)||Eg(e,t,n,r,s,i))&+(!Ki(s)||qg(e,t,n,r,s,i))&+(!Gi(s)||Gg(e,t,n,r,s,i))&+(!Vi(s)||Jg(e,t,n,r,s,i))&+(!fs(s)||bk(e,t,n,r,s,i))&+(!ms(s)||jk(e,t,n,r,s,i))&+(!eo(s)||Ek(e,t,n,r,s,i))&+(!Ks(s)||ik(e,t,n,r,s,i))&+(!Zi(s)||Wb(e,t,n,r,s,i))))&+(!q(i)||!!(+(!zi(s)||wg(e,t,n,r,s,i))&+(!ds(s)||Ug(e,t,n,r,s,i))&+(!Nr(s)||Lb(e,t,n,r,s,i))&+(!Qi(s)||Ub(e,t,n,r,s,i))&+(!qs(s)||zb(e,t,n,r,s,i))&+(!us(s)||Yb(e,t,n,r,s,i))&+(!ps(s)||tk(e,t,n,r,s,i))&+(!dr(s)||yk(e,t,n,r,s,i))&+(!jr(s)||Qk(e,t,n,r,s,i))))&+(!pe(i)||!!(+(!Yi(s)||Gb(e,t,n,r,s,i))&+(!zs(s)||rk(e,t,n,r,s,i))&+(!Hs(s)||Nb(e,t,n,r,s,i))&+(!Gs(s)||mk(e,t,n,r,s,i))))&+(!(Ie(i)||st(i))||!!(+(!Wi(s)||Xg(e,t,n,r,s,i))&+(!Pr(s)||tb(e,t,n,r,s,i))&+(!Ji(s)||Hb(e,t,n,r,s,i))&+(!Or(s)||Xb(e,t,n,r,s,i))&+(!Xi(s)||ak(e,t,n,r,s,i))))&+(!Pa(s)||Rk(e,t,n,r,s,i))&+(!Aa(s)||Pk(e,t,n,r,s,i))&+(!va(s)||tN(e,t,n,r,s,i))&+(!wa(s)||Lg(e,t,n,r,s,i))&+(!ja(s)||Yg(e,t,n,r,s,i))&+(!Ia(s)||Mb(e,t,n,r,s,i))&+(!Ea(s)||lk(e,t,n,r,s,i))&+(!xa(s)||Pg(e,t,n,r,s,i))&+(!ya(s)||Rg(e,t,n,r,s,i))&+(!Ta(s)||pk(e,t,n,r,s,i))&+(!Vs(s)||!q(i)||zk(e,t,n,r,s,i))&+(!Ws(s)||!re(i)||Vk(e,t,n,r,s,i)))&&(!ka(s)||kg(e,t,n,r,s,i));return e.Pop(s),o}const Yk=[0],Ao=new Map,fi=new Map;function yO(){return`${Yk[0]++}`}function wO(e,t){Ao.has(e)||Ao.set(e,new Map);const n=Ao.get(e);if(n.has(t))return n.get(t);const r=yO();return n.set(t,r),r}function vO(e,t,n,r){return e.UseUnevaluated()?Ve(`check_${n}`,["context",r]):Ve(`check_${n}`,[r])}function SO(e,t,n,r){const s=ct(e,t,n,"value");return t.UseUnevaluated()?tr(`check_${r}`,xr(["context","value"],s)):tr(`check_${r}`,xr(["value"],s))}function Zk(){Yk[0]=0,Ao.clear(),fi.clear()}function Xk(){return[...fi.values()]}function Js(e,t,n,r){const s=wO(n,e.BaseURL().href),i=vO(t,n,s,r);return fi.has(s)||(fi.set(s,""),fi.set(s,SO(e,t,n,s))),i}function ex(e){if(e.length===0)throw Error("Cannot set root")}function tx(e){if(!re(e))throw Error("Cannot set value")}function jO(e){if(er(e))throw Error("Pointer contains unsafe property key")}function nx(e){for(const t of e)jO(t)}function IO(e){return/^(0|[1-9]\d*)$/.test(e)}function rx(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function CO(e,t){return re(t)&&E(t,e)}function EO(e,t){return re(t)&&!er(e)?t[e]:void 0}function Pd(e,t){return e.reduce((n,r)=>EO(r,n),t)}function ro(e){if(g(e.length,0))return[];const t=e.split("/").map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function TO(e,t){let n=e;return ro(t).every(r=>CO(r,n)?(n=n[r],!0):!1)}function sx(e,t){const n=ro(t);return Pd(n,e)}function Pc(e,t,n){const r=ro(t);ex(r),nx(r);const[s,i]=rx(r),o=Pd(s,e);return tx(o),o[i]=n,e}function ix(e,t){const n=ro(t);ex(n),nx(n);const[r,s]=rx(n),i=Pd(r,e);return tx(i),q(i)&&IO(s)?i.splice(+s,1):delete i[s],e}const ox=Object.freeze(Object.defineProperty({__proto__:null,Delete:ix,Get:sx,Has:TO,Indices:ro,Set:Pc},Symbol.toStringTag,{value:"Module"}));function AO(e,t,n){if(e.$id===n.hash)return e;const r=new URL(e.$id,t.href),s=new URL(n.href,t.href);if(g(r.pathname,s.pathname))return n.hash.startsWith("#")?ax(e,t,n):e}function PO(e,t,n){const r=new URL(`#${e.$anchor}`,t.href),s=new URL(n.href,t.href);return g(r.href,s.href)?e:void 0}function NO(e,t,n){const r=new URL(`#${e.$dynamicAnchor}`,t.href),s=new URL(n.href,t.href);return g(r.href,s.href)?e:void 0}function ax(e,t,n){if(n.href.endsWith("#"))return e;if(!n.hash.startsWith("#"))return;const r=decodeURIComponent(n.hash.slice(1));if(r.startsWith("/"))return sx(e,r)}function OO(e,t,n){if(Sr(e)){const r=AO(e,t,n);if(!Fe(r))return r}if(qo(e)){const r=PO(e,t,n);if(!Fe(r))return r}if(Yr(e)){const r=NO(e,t,n);if(!Fe(r))return r}return ax(e,t,n)}function RO(e,t,n){return e.reduce((r,s)=>{const i=Nd(s,t,n);return Fe(i)?r:i},void 0)}function MO(e,t,n){return U(e).reduce((r,s)=>{const i=Nd(e[s],t,n);return Fe(i)?r:i},void 0)}function Nd(e,t,n){const r=dn(e)&&Sr(e)?new URL(e.$id,t.href):t;if(dn(e)){const s=OO(e,r,n);if(!Fe(s))return s}if(q(e))return RO(e,r,n);if(re(e))return MO(e,r,n)}function Zr(e,t){const n=new URL("http://unknown/"),r=Sr(e)?new URL(e.$id,n.href):n,s=new URL(t,r.href);return Nd(e,r,s)}function cx(e,t,n,r){const s=n.$dynamicRef.startsWith("#")?Zr(t,n.$dynamicRef):Zr(e,n.$dynamicRef);return Fe(s)?void 0:!dn(s)||!Yr(s)||new URL(n.$dynamicRef,"http://unknown/").hash.startsWith("#/")?s:r.find(d=>d.$dynamicAnchor===s.$dynamicAnchor)??s}const $O=Object.freeze(Object.defineProperty({__proto__:null,DynamicRef:cx,Ref:Zr},Symbol.toStringTag,{value:"Module"}));var Ts=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},br,lx,dx,ux,px;class so{constructor(t,n){br.add(this),this.context=t,this.schema=n,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,n)=>new URL(n.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){dn(t)&&(Sr(t)&&(this.ids.push(t),Ts(this,br,"m",lx).call(this,t)),qo(t)&&this.anchors.push(t),Eo(t)&&this.recursiveAnchors.push(t),Yr(t)&&this.dynamicAnchors.push(t))}Pop(t){dn(t)&&(Sr(t)&&(this.ids.pop(),Ts(this,br,"m",dx).call(this,t)),qo(t)&&this.anchors.pop(),Eo(t)&&this.recursiveAnchors.pop(),Yr(t)&&this.dynamicAnchors.pop())}Ref(t){return Ts(this,br,"m",ux).call(this,t)??Ts(this,br,"m",px).call(this,t)}RecursiveRef(t){return Eo(this.Base())?Zr(this.recursiveAnchors[0],t.$recursiveRef):Zr(this.Base(),t.$recursiveRef)}DynamicRef(t){const n=this.schema;return cx(n,this.Base(),t,this.dynamicAnchors)}}br=new WeakSet,lx=function e(t,n=!0){if(!dn(t))return;const r=t;if(!(!n&&Sr(r))){!n&&Yr(r)&&this.dynamicAnchors.push(r);for(const s of U(r))Ts(this,br,"m",e).call(this,r[s],!1)}},dx=function e(t,n=!0){if(!dn(t))return;const r=t;if(!(!n&&Sr(r))){!n&&Yr(r)&&this.dynamicAnchors.pop();for(const s of U(r))Ts(this,br,"m",e).call(this,r[s],!1)}},ux=function(t){return E(this.context,t.$ref)?this.context[t.$ref]:void 0},px=function(t){const n=this.schema;return t.$ref.startsWith("#")?Zr(this.Base(),t.$ref):Zr(n,t.$ref)};function FO(e){const t=e.Functions().join(`;
|
|
269
|
+
`),n=e.UseUnevaluated()?["const context = new CheckContext({}, {})",`return ${e.Entry()}`]:[`return ${e.Entry()}`];return`${t}; return (value) => { ${n.join("; ")} }`}function LO(e,t){return bf("CheckContext","Guard","Format","Hashing",e.External().identifier,t)(Gn,Mo,KN,Pv,e.External().variables)}function DO(e){const t=new so(e.Context(),e.Schema()),n=new Gn;return r=>lt(t,n,e.Schema(),r)}function _O(e,t){return gf()?LO(e,t):DO(e)}class fx{constructor(t,n,r){this.isAccelerated=t,this.code=n,this.check=r}IsAccelerated(){return this.isAccelerated}Code(){return this.code}Check(t){return this.check(t)}}class mx{constructor(t,n,r,s,i,o){this.context=t,this.schema=n,this.external=r,this.functions=s,this.entry=i,this.useUnevaluated=o}Context(){return this.context}Schema(){return this.schema}UseUnevaluated(){return this.useUnevaluated}External(){return this.external}Functions(){return this.functions}Entry(){return this.entry}Evaluate(){const t=FO(this),n=_O(this,t);return new fx(gf(),t,n)}}function hx(...e){const[t,n]=ut(e,{2:(f,u)=>[f,u],1:f=>[{},f]});mg(),Zk();const r=new so(t,n),s=new fg(pg(t,n)),i=Js(r,s,n,"value"),o=Xk(),d=hg();return new mx(t,n,d,o,i,s.UseUnevaluated())}function wi(...e){const[t,n,r]=ut(e,{3:(m,p,h)=>[m,p,h],2:(m,p)=>[{},m,p]}),s=Ci(),i=Rv(),o=[],d=new so(t,n),f=new nd(m=>{if(!Rs(o.length,s.maxErrors))return o.push({...m,message:i(m)})});return[At(d,f,"#","",n,r),o]}function Od(...e){const[t,n,r]=ut(e,{3:(o,d,f)=>[o,d,f],2:(o,d)=>[{},o,d]}),s=new so(t,n),i=new Gn;return lt(s,i,n,r)}let Rd=class{constructor(t,n,r){this.schema=t,this.value=n,this.errors=r}};function UO(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});if(!Od(t,n,r)){const[s,i]=wi(t,n,r);throw new Rd(n,r,i)}return r}class gx{constructor(t,n){this.buildResult=hx(t,n),this.evaluateResult=this.buildResult.Evaluate()}IsAccelerated(){return this.evaluateResult.IsAccelerated()}Schema(){return this.buildResult.Schema()}Check(t){return this.evaluateResult.Check(t)}Parse(t){if(this.evaluateResult.Check(t))return t;const[n,r]=wi(this.buildResult.Context(),this.buildResult.Schema(),t);throw new Rd(this.buildResult.Schema(),t,r)}Errors(t){return wi(this.buildResult.Context(),this.buildResult.Schema(),t)}}function BO(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s],1:r=>[{},r]});return new gx(t,n)}const HO=Object.freeze(Object.defineProperty({__proto__:null,AccumulatedErrorContext:Vn,Build:hx,BuildAdditionalItems:xg,BuildAdditionalProperties:Ig,BuildAdditionalPropertiesFast:Sg,BuildAdditionalPropertiesStandard:jg,BuildAllOf:Tg,BuildAnyOf:Ng,BuildConst:Fg,BuildContains:_g,BuildContext:fg,BuildDependencies:Bg,BuildDependentRequired:zg,BuildDependentSchemas:Vg,BuildEnum:Qg,BuildExclusiveMaximum:Zg,BuildExclusiveMinimum:eb,BuildFormat:Pb,BuildIf:Ob,BuildItems:$b,BuildMaxContains:_b,BuildMaxItems:qb,BuildMaxLength:Kb,BuildMaxProperties:Vb,BuildMaximum:Bb,BuildMinContains:Qb,BuildMinItems:ek,BuildMinLength:nk,BuildMinProperties:sk,BuildMinimum:Zb,BuildMultipleOf:ok,BuildNot:ck,BuildOneOf:dk,BuildPattern:fk,BuildPatternProperties:hk,BuildPrefixItems:kk,BuildProperties:vk,BuildPropertyNames:Ik,BuildRecursiveRef:Tk,BuildRef:Nk,BuildRefine:gg,BuildRequired:Mk,BuildResult:mx,BuildSchema:ct,BuildSchemaBoolean:Mg,BuildSchemaPushStack:Ln,BuildType:_k,BuildUnevaluatedItems:Hk,BuildUnevaluatedProperties:Kk,BuildUniqueItems:Wk,CanAdditionalPropertiesFast:vg,Check:Od,CheckAdditionalItems:yg,CheckAdditionalProperties:Cg,CheckAllOf:Ag,CheckAnyOf:Og,CheckConst:od,CheckContains:ad,CheckContext:Gn,CheckDependencies:Hg,CheckDependentRequired:Kg,CheckDependentSchemas:Wg,CheckEnum:cd,CheckExclusiveMaximum:ld,CheckExclusiveMinimum:dd,CheckFormat:fd,CheckIf:Rb,CheckItems:Fb,CheckMaxContains:md,CheckMaxItems:gd,CheckMaxLength:bd,CheckMaxProperties:kd,CheckMaximum:hd,CheckMinContains:xd,CheckMinItems:wd,CheckMinLength:vd,CheckMinProperties:Sd,CheckMinimum:yd,CheckMultipleOf:jd,CheckNot:Id,CheckOneOf:uk,CheckPattern:Cd,CheckPatternProperties:gk,CheckPrefixItems:xk,CheckProperties:Sk,CheckPropertyNames:Ck,CheckRecursiveRef:Ak,CheckRef:Ok,CheckRefine:bg,CheckRequired:$k,CheckSchema:lt,CheckSchemaBoolean:id,CheckSchemaPushStack:Rr,CheckType:Uk,CheckUnevaluatedItems:qk,CheckUnevaluatedProperties:Gk,CheckUniqueItems:Jk,Compile:BO,CreateFunction:Js,CreateVariable:hs,ErrorAdditionalItems:wg,ErrorAdditionalProperties:Eg,ErrorAllOf:Pg,ErrorAnyOf:Rg,ErrorConst:Lg,ErrorContains:Ug,ErrorContext:nd,ErrorDependencies:qg,ErrorDependentRequired:Gg,ErrorDependentSchemas:Jg,ErrorEnum:Yg,ErrorExclusiveMaximum:Xg,ErrorExclusiveMinimum:tb,ErrorFormat:Nb,ErrorIf:Mb,ErrorItems:Lb,ErrorMaxContains:Ub,ErrorMaxItems:zb,ErrorMaxLength:Gb,ErrorMaxProperties:Wb,ErrorMaximum:Hb,ErrorMinContains:Yb,ErrorMinItems:tk,ErrorMinLength:rk,ErrorMinProperties:ik,ErrorMinimum:Xb,ErrorMultipleOf:ak,ErrorNot:lk,ErrorOneOf:pk,ErrorPattern:mk,ErrorPatternProperties:bk,ErrorPrefixItems:yk,ErrorProperties:jk,ErrorPropertyNames:Ek,ErrorRecursiveRef:Pk,ErrorRef:Rk,ErrorRefine:kg,ErrorRequired:Fk,ErrorSchema:At,ErrorSchemaBoolean:$g,ErrorSchemaPushStack:Mr,ErrorType:Bk,ErrorUnevaluatedItems:zk,ErrorUnevaluatedProperties:Vk,ErrorUniqueItems:Qk,Errors:wi,EvaluateResult:fx,GetExternal:hg,GetFunctions:Xk,HasUnevaluated:pg,IsAdditionalItems:zi,IsAdditionalProperties:lr,IsAllOf:xa,IsAnchor:qo,IsAnyOf:ya,IsConst:wa,IsContains:ds,IsContentEncoding:LP,IsContentMediaType:DP,IsDefault:Ar,IsDefs:_P,IsDependencies:Ki,IsDependentRequired:Gi,IsDependentSchemas:Vi,IsDynamicAnchor:Yr,IsDynamicRef:va,IsElse:Sa,IsEnum:ja,IsExclusiveMaximum:Wi,IsExclusiveMinimum:Pr,IsFormat:Hs,IsId:Sr,IsIf:Ia,IsItems:Nr,IsItemsSized:Ca,IsItemsUnsized:UP,IsMaxContains:Qi,IsMaxItems:qs,IsMaxLength:Yi,IsMaxProperties:Zi,IsMaximum:Ji,IsMinContains:us,IsMinItems:ps,IsMinLength:zs,IsMinProperties:Ks,IsMinimum:Or,IsMultipleOf:Xi,IsNot:Ea,IsOneOf:Ta,IsPattern:Gs,IsPatternProperties:fs,IsPrefixItems:dr,IsProperties:ms,IsPropertyNames:eo,IsRecursiveAnchor:ug,IsRecursiveAnchorTrue:Eo,IsRecursiveRef:Aa,IsRef:Pa,IsRefine:ka,IsRequired:ur,IsSchema:_e,IsSchemaBoolean:qi,IsSchemaObject:dn,IsThen:Na,IsType:to,IsUnevaluatedItems:Vs,IsUnevaluatedProperties:Ws,IsUniqueItems:jr,Parse:UO,ParseError:Rd,Pointer:ox,Reducer:no,ResetExternal:mg,ResetFunctions:Zk,Resolve:$O,Stack:so,Validator:gx},Symbol.toStringTag,{value:"Module"}));function ot(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return Od(t,n,r)}function io(...e){const[t,n,r]=ut(e,{3:(o,d,f)=>[o,d,f],2:(o,d)=>[{},o,d]}),[s,i]=wi(t,n,r);return i}class Oa extends Error{constructor(t,n,r){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:r,value:n},writable:!1,configurable:!1,enumerable:!1})}}function bx(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]});if(!ot(t,n,r))throw new Oa("Assert",r,io(t,n,r))}function qO(e,t,n){return q(n)?n.map(r=>Nn(e,t.items,r)):n}function zO(e,t,n){return Nn({...e,...t.$defs},gn(t.$ref),n)}function KO(e,t){const n=E(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},r=Bs(e,t),s=Kn(r);return Ue(s)?og(s,n):s}function GO(e,t,n){const r=KO(e,t);return Nn(e,r,n)}function kx(e){return E(e,"additionalProperties")?e.additionalProperties:void 0}function VO(e,t,n){if(!re(n)||q(n))return n;const r=kx(t);for(const s of U(n)){if(E(t.properties,s)){n[s]=Nn(e,t.properties[s],n[s]);continue}if(xt(r)&&g(r,!0)||on(r)&&ot(e,r,n[s])){n[s]=Nn(e,r,n[s]);continue}delete n[s]}return n}function WO(e,t,n){if(!re(n))return n;const r=kx(t),[s,i]=[new RegExp(jn(t)),Vt(t)];for(const o of U(n)){if(s.test(o)){n[o]=Nn(e,i,n[o]);continue}if(xt(r)&&g(r,!0)||on(r)&&ot(e,r,n[o])){n[o]=Nn(e,r,n[o]);continue}delete n[o]}return n}function JO(e,t,n){return E(e,t.$ref)?Nn(e,e[t.$ref],n):n}function QO(e,t,n){if(!q(n))return n;const r=Math.min(n.length,t.items.length);for(let s=0;s<r;s++)n[s]=Nn(e,t.items[s],n[s]);return ts(n.length,r)?n.slice(0,r):n}function zt(e){return al(e)}function YO(e,t,n){for(const r of t.anyOf){const s=Nn(e,r,zt(n));if(ot(e,r,s))return s}return n}function Nn(e,t,n){return gt(t)?qO(e,t,n):Gt(t)?zO(e,t,n):Be(t)?GO(e,t,n):Ue(t)?VO(e,t,n):Ot(t)?WO(e,t,n):vt(t)?JO(e,t,n):at(t)?QO(e,t,n):fe(t)?YO(e,t,n):n}function ZO(e,t){for(const n of Mo.Keys(e))Mo.HasPropertyKey(t,n)||(t[n]=e[n]);return t}function XO(e){const t={};for(const n of Mo.Keys(e))t[n]=vi(e[n]);return t}function eR(e){return Nc($P(e))}function Nc(e){return e.map(t=>vi(t))}function vi(e){const t=gt(e)?Ir(vi(e.items),dl(e)):Be(e)?Bn(Nc(e.allOf)):fe(e)?Je(eR(e.anyOf)):Ue(e)?Me(XO(e.properties)):Ot(e)?xl(da(e),vi(Vt(e))):at(e)?Sn(Nc(e.items)):e;return ZO(e,t)}function Md(e){return vi(e)}function oo(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]}),s=Md(n);return Nn(t,s,r)}function fn(e){return re(e)&&E(e,"value")}function ne(e){return{value:e}}function tR(e){return q(e)?ne(e):ne([e])}function nR(e){return g(e,!0)?ne(BigInt(1)):ne(BigInt(0))}const rR=/^-?(0|[1-9]\d*)n$/,sR=/^-?(0|[1-9]\d*)\.\d+$/,iR=/^-?(0|[1-9]\d*)$/;function oR(e){return rR.test(e)}function aR(e){return sR.test(e)}function cR(e){return iR.test(e)}function lR(e){const t=e.toLowerCase();return oR(e)?ne(BigInt(e.slice(0,e.length-1))):aR(e)?ne(BigInt(e.split(".")[0])):cR(e)?ne(BigInt(e)):g(t,"false")?ne(BigInt(0)):g(t,"true")?ne(BigInt(1)):void 0}function $d(e){return st(e)?ne(e):xt(e)?nR(e):Ie(e)?ne(BigInt(Math.trunc(e))):Xt(e)?ne(BigInt(0)):pe(e)?lR(e):Fe(e)?ne(BigInt(0)):void 0}function dR(e){return g(e,BigInt(0))?ne(!1):g(e,BigInt(1))?ne(!0):void 0}function uR(e){return g(e,0)?ne(!1):g(e,1)?ne(!0):void 0}function pR(e){return g(e.toLowerCase(),"false")?ne(!1):g(e.toLowerCase(),"true")?ne(!0):g(e,"0")?ne(!1):g(e,"1")?ne(!0):void 0}function xx(e){return st(e)?dR(e):xt(e)?ne(e):Ie(e)?uR(e):Xt(e)?ne(!1):pe(e)?pR(e):Fe(e)?ne(!1):void 0}function fR(e){return g(e,BigInt(0))?ne(null):void 0}function mR(e){return g(e,!1)?ne(null):void 0}function hR(e){return g(e,0)?ne(null):void 0}function gR(e){const t=e.toLowerCase();return g(t,"undefined")||g(t,"null")||g(e,"")||g(e,"0")?ne(null):void 0}function bR(e){return st(e)?fR(e):xt(e)?mR(e):Ie(e)?hR(e):Xt(e)?ne(null):pe(e)?gR(e):Fe(e)?ne(null):void 0}const yx=BigInt(Number.MAX_SAFE_INTEGER),wx=BigInt(Number.MIN_SAFE_INTEGER);function kR(e){return e<=yx&&e>=wx?ne(Number(e)):void 0}function xR(e){return ne(e?1:0)}function yR(e){const t=+e;if(Ie(t))return ne(t);const n=e.toLowerCase();if(g(n,"false"))return ne(0);if(g(n,"true"))return ne(1);const r=$d(e);return fn(r)&&r.value<=yx&&r.value>=wx?ne(Number(r.value)):void 0}function Fd(e){return st(e)?kR(e):xt(e)?xR(e):Ie(e)?ne(e):Xt(e)?ne(0):pe(e)?yR(e):Fe(e)?ne(0):void 0}function vx(e){return st(e)||xt(e)||Ie(e)?ne(e.toString()):Xt(e)?ne("null"):pe(e)?ne(e):Fe(e)?ne(""):void 0}function wR(e){return g(e,BigInt(0))?ne(void 0):void 0}function vR(e){return g(e,!1)?ne(void 0):void 0}function SR(e){return g(e,0)?ne(void 0):void 0}function jR(e){const t=e.toLowerCase();return g(t,"undefined")||g(t,"null")||g(e,"")||g(e,"0")?ne(void 0):void 0}function Sx(e){return st(e)?wR(e):xt(e)?vR(e):Ie(e)?SR(e):Xt(e)?ne(void 0):pe(e)?jR(e):Fe(e)?ne(e):void 0}function IR(e,t,n){return tR(n).value.map(s=>In(e,t.items,s))}function CR(e,t,n){const r=$d(n);return fn(r)?r.value:n}function ER(e,t,n){const r=xx(n);return fn(r)?r.value:n}function TR(e,t,n){return In({...e,...t.$defs},gn(t.$ref),n)}function AR(e,t,n){return In(e,Kn(t),n)}function PR(e,t,n){const r=Fd(n);return fn(r)?Math.trunc(r.value):n}function NR(e,t,n){const r=Bs(e,t),s=Kn(r);return In(e,s,n)}function OR(e,t,n){const r=$d(n);return fn(r)&&g(t.const,r.value)?r.value:n}function RR(e,t,n){const r=xx(n);return fn(r)&&g(t.const,r.value)?r.value:n}function MR(e,t,n){const r=Fd(n);return fn(r)&&g(t.const,r.value)?r.value:n}function $R(e,t,n){const r=vx(n);return fn(r)&&g(t.const,r.value)?r.value:n}function FR(e,t,n){return g(t.const,n)?n:Kv(t)?OR(e,t,n):Gv(t)?RR(e,t,n):Ef(t)?MR(e,t,n):Tf(t)?$R(e,t,n):Ft()}function LR(e,t,n){const r=bR(n);return fn(r)?r.value:n}function DR(e,t,n){const r=Fd(n);return fn(r)?r.value:n}function jx(e,t,n,r){const s=U(r);for(const[i,o]of t)for(const d of s)i.test(d)||(r[d]=In(e,n,r[d]));return r}function Ld(e,t,n){return an(e)&&Fe(n[t])}function _R(e,t,n){const r=tl(t.properties),s=U(n);for(const[i,o]of r)for(const d of s)!i.test(d)||Ld(o,d,n)||(n[d]=In(e,o,n[d]));return E(t,"additionalProperties")&&re(t.additionalProperties)?jx(e,r,t.additionalProperties,n):n}function UR(e,t,n){return kn(n)?_R(e,t,n):n}function BR(e,t,n){const r=tl(t.patternProperties),s=U(n);for(const[i,o]of r)for(const d of s)i.test(d)&&(n[d]=In(e,o,n[d]));return E(t,"additionalProperties")&&re(t.additionalProperties)?jx(e,r,t.additionalProperties,n):n}function HR(e,t,n){return kn(n)?BR(e,t,n):n}function qR(e,t,n){return E(e,t.$ref)?In(e,e[t.$ref],n):n}function zR(e,t,n){const r=vx(n);return fn(r)?r.value:n}function KR(e,t,n){return In(e,Kn(t),n)}function GR(e,t,n){if(!q(n))return n;for(let r=0;r<Math.min(t.items.length,n.length);r++)n[r]=In(e,t.items[r],n[r]);return n}function VR(e,t,n){const r=Sx(n);return fn(r)?r.value:n}function WR(e,t,n){if(t.anyOf.some(o=>ot(e,o,n)))return n;const i=t.anyOf.map(o=>In(e,o,zt(n))).find(o=>ot(e,t,o));return Fe(i)?n:i}function JR(e,t,n){const r=Sx(n);return fn(r)?void 0:n}function In(e,t,n){return gt(t)?IR(e,t,n):is(t)?CR(e,t,n):Cr(t)?ER(e,t,n):Gt(t)?TR(e,t,n):vn(t)?AR(e,t,n):qn(t)?PR(e,t,n):Be(t)?NR(e,t,n):Qe(t)?FR(e,t,n):Ni(t)?LR(e,t,n):un(t)?DR(e,t,n):Ue(t)?UR(e,t,n):Ot(t)?HR(e,t,n):vt(t)?qR(e,t,n):Fn(t)?zR(e,t,n):Wt(t)?KR(e,t,n):at(t)?GR(e,t,n):_s(t)?VR(e,t,n):fe(t)?WR(e,t,n):os(t)?JR(e,t,n):n}function Ra(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return In(t,n,r)}function QR(e,t,n){if(!q(n))return n;for(let r=0;r<n.length;r++)n[r]=On(e,t.items,n[r]);return n}function YR(e,t,n){return On({...e,...t.$defs},gn(t.$ref),n)}function ZR(e,t){return Fe(t)?Tn(e.default)?e.default():zt(e.default):t}function XR(e,t,n){const r=Bs(e,t),s=Kn(r);return On(e,s,n)}function eM(e,t,n){if(!re(n))return n;const r=U(t.properties);for(const s of r){const i=On(e,t.properties[s],n[s]);Fe(i)&&(an(t.properties[s])||!E(t.properties[s],"default"))||(n[s]=i)}if(!lr(t)||xt(t.additionalProperties))return n;for(const s of U(n))r.includes(s)||(n[s]=On(e,t.additionalProperties,n[s]));return n}function tM(e,t,n){if(!re(n))return n;const[r,s]=[new RegExp(jn(t)),Vt(t)];for(const i of U(n))r.test(i)&&Ar(s)&&(n[i]=On(e,s,n[i]));if(!lr(t))return n;for(const i of U(n))r.test(i)||(n[i]=On(e,t.additionalProperties,n[i]));return n}function nM(e,t,n){return E(e,t.$ref)?On(e,e[t.$ref],n):n}function rM(e,t,n){if(!q(n))return n;const[r,s]=[t.items,Math.max(t.items.length,n.length)];for(let i=0;i<s;i++)i<r.length&&(n[i]=On(e,r[i],n[i]));return n}function sM(e,t,n){for(const r of t.anyOf){const s=On(e,r,zt(n));if(ot(e,r,s))return s}return n}function On(e,t,n){const r=Ar(t)?ZR(t,n):n;return gt(t)?QR(e,t,r):Gt(t)?YR(e,t,r):Be(t)?XR(e,t,r):Ue(t)?eM(e,t,r):Ot(t)?tM(e,t,r):vt(t)?nM(e,t,r):at(t)?rM(e,t,r):fe(t)?sM(e,t,r):r}function Dd(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return On(t,n,r)}function Ix(e){return(...t)=>{const[n,r,s]=ut(t,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]});return e.reduce((i,o)=>o(n,r,i),s)}}function iM(e,t,n){return t["~codec"].decode(n)}function oM(e,t,n){return t["~codec"].encode(n)}function Et(e,t,n,r){return ln(n)?g(e,"Decode")?iM(t,n,r):oM(t,n,r):r}function aM(e,t,n,r){if(!q(r))return r;for(let s=0;s<r.length;s++)r[s]=Bt(e,t,n.items,r[s]);return Et(e,t,n,r)}function cM(e,t,n,r){const s=Et(e,t,n,r);if(!q(s))return s;for(let i=0;i<s.length;i++)s[i]=Bt(e,t,n.items,s[i]);return s}function lM(e,t,n,r){return g(e,"Decode")?aM(e,t,n,r):cM(e,t,n,r)}function dM(e,t,n,r){return r=Bt(e,{...t,...n.$defs},gn(n.$ref),r),Et(e,t,n,r)}function Cx(e){return e.reduce((t,n)=>({...t,...n}),{})}function Ex(e,t){for(const n of t)if(!ns(e,n))return n;return e}function uM(e,t,n,r){if(g(n.allOf.length,0))return Et(e,t,n,r);const s=n.allOf.map(d=>Bt(e,t,d,oo(d,zt(r)))),o=s.every(d=>re(d))?Cx(s):Ex(r,s);return Et(e,t,n,o)}function pM(e,t,n,r){if(g(n.allOf.length,0))return Et(e,t,n,r);const s=Et(e,t,n,r),i=n.allOf.map(d=>Bt(e,t,d,oo(d,zt(s))));return i.every(d=>re(d))?Cx(i):Ex(s,i)}function fM(e,t,n,r){return g(e,"Decode")?uM(e,t,n,r):pM(e,t,n,r)}function mM(e,t,n,r){if(!kn(r))return r;for(const s of U(n.properties))!E(r,s)||Ld(n.properties[s],s,r)||(r[s]=Bt(e,t,n.properties[s],r[s]));return Et(e,t,n,r)}function hM(e,t,n,r){const s=Et(e,t,n,r);if(!kn(s))return s;for(const i of U(n.properties))!E(s,i)||Ld(n.properties[i],i,s)||(s[i]=Bt(e,t,n.properties[i],s[i]));return s}function gM(e,t,n,r){return g(e,"Decode")?mM(e,t,n,r):hM(e,t,n,r)}function bM(e,t,n,r){if(!kn(r))return r;const s=new RegExp(jn(n));for(const i of U(r))s.test(i)&&(r[i]=Bt(e,t,Vt(n),r[i]));return Et(e,t,n,r)}function kM(e,t,n,r){const s=Et(e,t,n,r);if(!kn(s))return s;const i=new RegExp(jn(n));for(const o of U(s))i.test(o)&&(s[o]=Bt(e,t,Vt(n),s[o]));return s}function xM(e,t,n,r){return g(e,"Decode")?bM(e,t,n,r):kM(e,t,n,r)}function qu(e,t,n,r){return E(t,n.$ref)?Bt(e,t,t[n.$ref],r):r}function yM(e,t,n,r){return g(e,"Decode")?Et(e,t,n,qu(e,t,n,r)):qu(e,t,n,Et(e,t,n,r))}function wM(e,t,n,r){if(!q(r))return r;for(let s=0;s<Math.min(n.items.length,r.length);s++)r[s]=Bt(e,t,n.items[s],r[s]);return Et(e,t,n,r)}function vM(e,t,n,r){const s=Et(e,t,n,r);if(!q(s))return r;for(let i=0;i<Math.min(n.items.length,s.length);i++)s[i]=Bt(e,t,n.items[i],s[i]);return s}function SM(e,t,n,r){return g(e,"Decode")?wM(e,t,n,r):vM(e,t,n,r)}function jM(e,t,n,r){for(const s of n.anyOf){if(!ot(t,s,r))continue;const i=Bt(e,t,s,r);return Et(e,t,n,i)}return r}function IM(e,t,n,r){const s=Et(e,t,n,r);for(const i of n.anyOf){const o=Bt(e,t,i,zt(s));if(ot(t,i,o))return o}return s}function CM(e,t,n,r){return g(e,"Decode")?jM(e,t,n,r):IM(e,t,n,r)}function Bt(e,t,n,r){return gt(n)?lM(e,t,n,r):Gt(n)?dM(e,t,n,r):Be(n)?fM(e,t,n,r):Ue(n)?gM(e,t,n,r):Ot(n)?xM(e,t,n,r):vt(n)?yM(e,t,n,r):at(n)?SM(e,t,n,r):fe(n)?CM(e,t,n,r):Et(e,t,n,r)}class EM extends Oa{constructor(t,n){super("Decode",t,n)}}function TM(e,t,n){if(!ot(e,t,n))throw new EM(n,io(e,t,n));return n}function AM(e,t,n){const r=Md(t);return Bt("Decode",e,r,n)}const PM=Ix([(e,t,n)=>zt(n),(e,t,n)=>Dd(e,t,n),(e,t,n)=>Ra(e,t,n),(e,t,n)=>oo(e,t,n),(e,t,n)=>TM(e,t,n),(e,t,n)=>AM(e,t,n)]);function NM(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return PM(t,n,r)}class OM extends Oa{constructor(t,n){super("Encode",t,n)}}function RM(e,t,n){if(!ot(e,t,n))throw new OM(n,io(e,t,n));return n}function MM(e,t,n){const r=Md(t);return Bt("Encode",e,r,n)}const $M=Ix([(e,t,n)=>zt(n),(e,t,n)=>MM(e,t,n),(e,t,n)=>Dd(e,t,n),(e,t,n)=>Ra(e,t,n),(e,t,n)=>oo(e,t,n),(e,t,n)=>RM(e,t,n)]);function FM(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return $M(t,n,r)}function LM(e,t){return ln(t)||$r(e,t.items)}function DM(e,t){return ln(t)||Tx({...e,...t.$defs},gn(t.$ref))}function _M(e,t){return ln(t)||t.allOf.some(n=>$r(e,n))}function UM(e,t){return ln(t)||U(t.properties).some(n=>$r(e,t.properties[n]))}function BM(e,t){return ln(t)||$r(e,Vt(t))}function Tx(e,t){return Oc.has(t.$ref)?!1:(Oc.add(t.$ref),ln(t)||E(e,t.$ref)&&$r(e,e[t.$ref]))}function HM(e,t){return ln(t)||t.items.some(n=>$r(e,n))}function qM(e,t){return ln(t)||t.anyOf.some(n=>$r(e,n))}function $r(e,t){return gt(t)?LM(e,t):Gt(t)?DM(e,t):Be(t)?_M(e,t):Ue(t)?UM(e,t):Ot(t)?BM(e,t):vt(t)?Tx(e,t):at(t)?HM(e,t):fe(t)?qM(e,t):ln(t)}const Oc=new Set;function zM(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s],1:r=>[{},r]});return Oc.clear(),$r(t,n)}class ao extends Error{constructor(t,n){super(n),this.type=t}}function KM(e,t){return Tn(t.default)?t.default(t):re(t.default)?zt(t.default):t.default}function GM(e,t){if(jr(t)&&!Ar(t))throw new ao(t,"Arrays with uniqueItems constraints must specify a default annotation");const n=ps(t)?t.minItems:0;return Array.from({length:n},()=>Cn(e,t.items))}function VM(e,t){return Pr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Or(t)?BigInt(t.minimum):BigInt(0)}function WM(e,t){return!1}function JM(e,t){const n=Cn(e,t.instanceType);return class{constructor(){Object.assign(this,n)}}}function QM(e,t){return Cn({...e,...t.$defs},gn(t.$ref))}function YM(e,t){return Cn(e,Kn(t))}function ZM(e,t){const n=Cn(e,t.returnType);return()=>n}function XM(e,t){return Pr(t)&&Ie(t.exclusiveMinimum)?t.exclusiveMinimum+1:Or(t)?t.minimum:0}function e$(e,t){const n=Bs(e,t),r=Kn(n);return Cn(e,r)}function t$(e,t){return t.const}function n$(e,t){throw new ao(t,"Cannot create TNever types")}function r$(e,t){return null}function s$(e,t){return Pr(t)&&Ie(t.exclusiveMinimum)?t.exclusiveMinimum+1:Or(t)?t.minimum:0}function i$(e,t){return(Fe(t.required)?[]:t.required).reduce((r,s)=>({...r,[s]:Cn(e,t.properties[s])}),{})}function o$(e,t){if(Ks(t)&&!Ar(t))throw new ao(t,"Record with the minProperties constraint must have a default annotation");return{}}function a$(e,t){return E(e,t.$ref)?Cn(e,e[t.$ref]):(()=>{throw new ao(t,"Unable to deref Ref")})()}function c$(e,t){if((Gs(t)||Hs(t))&&!Ar(t))throw Error("Strings with format or pattern constraints must specify default");const r=zs(t)?t.minLength:0;return"".padEnd(r)}function l$(e,t){return Symbol()}function d$(e,t){const n=kl(t.pattern);if(Fn(n))throw new ao(t,"Unable to create TemplateLiteral due to infinite type expansion");return Cn(e,n)}function u$(e,t){return Array.from({length:t.minItems},(n,r)=>Cn(e,t.items[r]))}function p$(e,t){if(g(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return Cn(e,t.anyOf[0])}function Cn(e,t){return Ar(t)?KM(e,t):gt(t)?GM(e,t):is(t)?VM(e,t):Cr(t)?WM():xn(t)?JM(e,t):Gt(t)?QM(e,t):vn(t)?YM(e,t):yn(t)?ZM(e,t):qn(t)?XM(e,t):Be(t)?e$(e,t):Qe(t)?t$(e,t):Fs(t)?n$(e,t):Ni(t)?r$():un(t)?s$(e,t):Ue(t)?i$(e,t):Ot(t)?o$(e,t):vt(t)?a$(e,t):Fn(t)?c$(e,t):Oi(t)?l$():Wt(t)?d$(e,t):at(t)?u$(e,t):_s(t)?void 0:fe(t)?p$(e,t):os(t)?void 0:void 0}function Rn(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s],1:r=>[{},r]});return Cn(t,n)}function Ax(e,t){return ns(e,t)}function Px(e){return ia(e)}class f$ extends Oa{constructor(t,n){super("Parse",t,n)}}function m$(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]});if(ot(t,n,r))return r;throw new f$(r,io(t,n,r))}function Ma(e,t){return{type:"update",path:e,value:t}}function Nx(e,t){return{type:"insert",path:e,value:t}}function Ox(e){return{type:"delete",path:e}}function zu(e){if(!(re(e)&&g(nl(e).length,0)))throw new Error("Cannot create diffs for objects with symbols keys")}function*h$(e,t,n){if(!re(n)||q(n))return yield Ma(e,n);zu(t),zu(n);const r=U(t),s=U(n);for(const i of s)E(t,i)||er(i)||(yield Nx(`${e}/${i}`,n[i]));for(const i of r)E(n,i)&&(er(i)||Ax(t,n)||(yield*$a(`${e}/${i}`,t[i],n[i])));for(const i of r)E(n,i)||er(i)||(yield Ox(`${e}/${i}`))}function*g$(e,t,n){if(!q(n))return yield Ma(e,n);for(let r=0;r<Math.min(t.length,n.length);r++)yield*$a(`${e}/${r}`,t[r],n[r]);for(let r=0;r<n.length;r++)r<t.length||(yield Nx(`${e}/${r}`,n[r]));for(let r=t.length-1;r>=0;r--)r<n.length||(yield Ox(`${e}/${r}`))}function*b$(e,t,n){const r=globalThis.Object.getPrototypeOf(t).constructor.name,s=globalThis.Object.getPrototypeOf(n).constructor.name;if(Ii(n)&&g(t.length,n.length)&&g(r,s))for(let o=0;o<Math.min(t.length,n.length);o++)yield*$a(`${e}/${o}`,t[o],n[o]);else return yield Ma(e,n)}function*k$(e,t,n){t!==n&&(yield Ma(e,n))}function*$a(e,t,n){return Ii(t)?yield*b$(e,t,n):q(t)?yield*g$(e,t,n):re(t)?yield*h$(e,t,n):yield*k$(e,t,n)}function x$(e,t){return[...$a("",e,t)]}const y$=Me({type:De("insert"),path:zn(),value:Kt()}),w$=Object({type:De("update"),path:zn(),value:Kt()}),v$=Me({type:De("delete"),path:zn()});Je([y$,w$,v$]);function S$(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function j$(e){return e.length===0}function I$(e,t){if(S$(t))return zt(t[0].value);if(j$(t))return zt(e);const n=zt(e);for(const r of t)switch(r.type){case"insert":{Pc(n,r.path,r.value);break}case"update":{Pc(n,r.path,r.value);break}case"delete":{ix(n,r.path);break}}return n}class Fa extends Error{constructor(t,n,r,s){super(s),this.context=t,this.type=n,this.value=r}}function C$(e){const[t,n]=[new Set,[]];for(const r of e){const s=Px(r);t.has(s)||(t.add(s),n.push(r))}return n}function E$(e,t,n){if(ot(e,t,n))return n;const r=q(n)?n:Rn(e,t),s=ps(t)&&r.length<t.minItems?[...r,...Array.from({length:t.minItems-r.length},()=>Rn(e,t))]:r,o=(qs(t)&&s.length>t.maxItems?s.slice(0,t.maxItems):s).map(f=>bn(e,t.items,f));if(!jr(t)||jr(t)&&!g(t.uniqueItems,!0))return o;const d=C$(o);if(!ot(e,t,d))throw new Fa(e,t,n,"Failed to repair Array due to uniqueItems constraint");return d}function T$(e,t,n){return bn(e,Kn(t),n)}function A$(e,t,n){const r=Bs(e,t),s=Kn(r);return bn(e,s,n)}function P$(e,t,n){if(ot(e,t,n))return n;if(!kn(n))return Rn(e,t);const r=new Set(Fe(t.required)?[]:t.required),s={};for(const[o,d]of it(t.properties))!r.has(o)&&Fe(n[o])||(s[o]=o in n?bn(e,d,n[o]):Rn(e,d));const i=U(t.properties);if(lr(t)&&re(t.additionalProperties))for(const o of U(n))i.includes(o)||(s[o]=bn(e,t.additionalProperties,n[o]));return s}function N$(e,t,n){if(ot(e,t,n))return n;if(Xt(n)||!re(n)||q(n))return Rn(e,t);const r=new RegExp(jn(t)),s=Vt(t),i=new Set,o={};for(const[d,f]of it(n))r.test(d)&&(o[d]=bn(e,s,f),i.add(d));if(lr(t))for(const d of U(n))i.has(d)||(o[d]=bn(e,t.additionalProperties,n[d]));return o}function O$(e,t,n){return E(e,t.$ref)?bn(e,e[t.$ref],n):(()=>{throw new Fa(e,t,n,"Unable to de-reference target type")})()}function R$(e,t,n){const r=kl(t.pattern);return bn(e,r,n)}function M$(e,t,n){return ot(e,t,n)?n:q(n)?t.items.map((r,s)=>bn(e,r,n[s])):Rn(e,t)}function Rx(e,t,n){return vt(t)?E(e,t.$ref)?Rx(e,e[t.$ref]):(()=>{throw new Error("Unable to Deref target")})():t}function $$(e,t,n){if(!(Ue(t)&&re(n)))return 0;const r=U(n);return it(t.properties).reduce((i,[o,d])=>{const f=Qe(d)&&g(d.const,n[o])?100:0,u=ot(e,d,n[o])?10:0,m=r.includes(o)?1:0;return i+(f+u+m)},0)}function F$(e,t,n){const r=t.anyOf.map(o=>Rx(e,o));let[s,i]=[r[0],0];for(const o of r){const d=$$(e,o,n);d>i&&(s=o,i=d)}return s}function L$(e,t,n){const r=Je(aa(t.anyOf)),s=F$(e,r,n);return bn(e,s,n)}function D$(e,t,n){return ot(e,t,n)?zt(n):Ar(t)?Rn(e,t):L$(e,t,n)}function _$(e,t,n){if(ot(e,t,n))return n;const r=Ra(e,t,n);return ot(e,t,r)?r:Rn(e,t)}function U$(e,t,n){if(df(n)||pf(n)||uf(n)||Ii(n)||ta(n)||Tn(n))throw new Fa(e,t,n,"Value is not repairable")}function B$(e,t,n){if(xn(t)||yn(t)||Fs(t))throw new Fa(e,t,n,"Type is not repairable")}function H$(e,t,n){return Fe(n)&&!_s(t)?Rn(e,t):n}function q$(e,t,n){return ml(t)?ot(e,t,n)?n:Rn(e,t):n}function bn(e,t,n){U$(e,t,n),B$(e,t,n);const r=H$(e,t,n),s=gt(t)?E$(e,t,r):vn(t)?T$(e,t,r):Be(t)?A$(e,t,r):Ue(t)?P$(e,t,r):Ot(t)?N$(e,t,r):vt(t)?O$(e,t,r):Wt(t)?R$(e,t,r):at(t)?M$(e,t,r):fe(t)?D$(e,t,r):_$(e,t,r);return q$(e,t,s)}function z$(...e){const[t,n,r]=ut(e,{3:(i,o,d)=>[i,o,d],2:(i,o)=>[{},i,o]}),s=bn(t,n,r);return bx(t,n,s),s}const Ya=Object.freeze(Object.defineProperty({__proto__:null,Assert:bx,Check:ot,Clean:oo,Clone:zt,Convert:Ra,Create:Rn,Decode:NM,Default:Dd,Diff:x$,Encode:FM,Equal:Ax,Errors:io,HasCodec:zM,Hash:Px,Parse:m$,Patch:I$,Pointer:ox,Repair:z$},Symbol.toStringTag,{value:"Module"}));class Ku extends Error{constructor(t){super(t.map(n=>`${n.path.length>0?n.path.join("."):"root"}: ${n.message}`).join("; ")),this.issues=t,this.name="SchemaValidationError"}}function K$(e){return e?e.split("/").slice(1).map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~")).map(t=>/^(0|[1-9]\d*)$/.test(t)?Number(t):t):[]}function G$(e,t){let n=e;for(const r of t){if(n===null||typeof n!="object")return;n=n[r]}return n}function Gu(e,t){const[,n]=HO.Errors(e,t);return n.map(r=>{const s=K$(r.instancePath);return{code:r.keyword,path:s,message:r.message,value:G$(t,s)}})}function Mx(e,t){const n=Ya.Default(e,Ya.Clone(t)),r=Gu(e,n);if(r.length>0)return{success:!1,error:new Ku(r)};const s=Ya.Clean(e,n),i=Gu(e,s);return i.length>0?{success:!1,error:new Ku(i)}:{success:!0,data:s}}function Qn(e,t){const n=Mx(e,t);if(!n.success)throw n.error;return n.data}function z(e){return Object.defineProperties(e,{parse:{value:t=>Qn(e,t),enumerable:!1},safeParse:{value:t=>Mx(e,t),enumerable:!1}}),e}function En(e,t){return c.Optional({...e,default:t})}function be(e,t={}){return c.Unsafe({type:"string",enum:[...e],...t})}const zr=20,mi=5*1024*1024,V$=1e6,W$=16*1024;function J$(e){const t=/^\s*\/btw(?:\s+([\s\S]*))?\s*$/iu.exec(e);if(t)return{question:(t[1]??"").trim()}}const gs=z(be(["default","autoEdit","yolo","plan"])),kr={DEFAULT:"default",AUTO_EDIT:"autoEdit",YOLO:"yolo",PLAN:"plan"},_d=z(be(["user","assistant","system","tool"])),Q$=z(c.Union([c.Object({type:c.Literal("text"),text:c.String()}),c.Object({type:c.Literal("image_url"),image_url:c.Object({url:c.String()})})])),$x=c.Union([c.String(),c.Array(Q$)]);z(c.Object({id:c.String(),role:_d,content:$x,timestamp:c.Number(),metadata:c.Optional(c.Record(c.String(),c.Unknown())),thinkingContent:c.Optional(c.String()),tool_call_id:c.Optional(c.String()),name:c.Optional(c.String()),tool_calls:c.Optional(c.Unknown())}));const Y$=z(be(["queued","running","completed","failed","cancelled","interrupted"])),co=z(be(["local","worktree"])),Ud=z(be(["high","medium","low"])),Bd=z(be(["feature","bug","maintenance","research"])),Z$=z(be(["applied","discarded","conflicted"])),X$=z(c.Object({status:Z$,updatedAt:c.String(),sourceCommit:c.Optional(c.String()),changedFiles:c.Optional(c.Integer({minimum:0})),message:c.Optional(c.String())})),eF=z(c.Object({changedFiles:c.Integer({minimum:0}),additions:c.Integer({minimum:0}),deletions:c.Integer({minimum:0}),commits:c.Integer({minimum:0})})),tF=z(c.Object({path:c.String({minLength:1}),patch:c.String({maxLength:2*1024*1024}),additions:c.Integer({minimum:0}),deletions:c.Integer({minimum:0}),binary:c.Boolean(),truncated:c.Boolean()})),nF=z(c.Object({sessionId:c.String(),projectPath:c.String(),baseCommit:c.String(),files:c.Array(tF,{maxItems:100}),truncated:c.Boolean()})),rF=c.Union([c.String(),c.Number(),c.Boolean(),c.Array(c.String())]),sF=z(c.Object({name:c.String(),type:be(["string","number","integer","boolean","select","multi-select"]),title:c.String(),description:c.Optional(c.String()),required:c.Boolean(),defaultValue:c.Optional(rF),options:c.Optional(c.Array(c.Object({value:c.String(),label:c.String()}))),format:c.Optional(be(["date","uri","email","date-time"])),minimum:c.Optional(c.Number()),maximum:c.Optional(c.Number()),minLength:c.Optional(c.Number()),maxLength:c.Optional(c.Number()),minItems:c.Optional(c.Number()),maxItems:c.Optional(c.Number())}));z(c.Object({serverName:c.String(),mode:be(["form","url"]),message:c.String(),fields:c.Optional(c.Array(sF)),requestedSchema:c.Optional(c.Record(c.String(),c.Unknown())),url:c.Optional(c.String()),domain:c.Optional(c.String()),elicitationId:c.Optional(c.String())}));const iF=z(c.Object({type:be(["permission","question","elicitation"]),requestId:c.String()})),oF=z(c.Object({code:be(["authentication","permission","rate_limit","timeout","network","model_unavailable","context_limit","unsupported_input","capacity","runtime"]),message:c.String({minLength:1,maxLength:500}),retryable:c.Boolean(),resource:c.Optional(be(["pending_count","pending_bytes","resident_runtimes"]))})),Qs=z(be(["auto","off","minimal","low","medium","high","xhigh","max"])),Ys=z(be(["auto","standard","fast","flex"])),Zs=z(be(["auto","low","medium","high"])),Fr=z(c.Union([be(["auto","pragmatic","friendly","explanatory"]),c.String({minLength:7,maxLength:300,pattern:"^(?:(?:user|project):[a-z0-9][a-z0-9._-]{0,63}(?::[a-z0-9][a-z0-9._-]{0,63}){0,3}|plugin:[a-z0-9][a-z0-9._-]{0,63}:[a-z0-9][a-z0-9._-]{0,63}(?::[a-z0-9][a-z0-9._-]{0,63}){0,3})$"})])),Un=z(c.Object({sessionId:c.String(),projectPath:c.String(),title:c.Optional(c.String()),gitBranch:c.Optional(c.String()),rootId:c.String(),parentId:c.Optional(c.String()),relationType:c.Optional(be(["subagent","fork"])),resumedFrom:c.Optional(c.String()),rootAgentId:c.Optional(c.String()),resumeDepth:c.Optional(c.Integer({minimum:0})),taskStatus:En(Y$,"completed"),taskStatusReason:c.Optional(c.String()),taskFailure:c.Optional(oF),taskStartedAt:c.Optional(c.String()),taskCompletedAt:c.Optional(c.String()),taskPromptSummary:c.Optional(c.String()),taskPriority:c.Optional(Ud),taskKind:c.Optional(Bd),taskDueAt:c.Optional(c.String()),taskModelId:c.Optional(c.String()),selectedModelId:c.Optional(c.String()),permissionMode:c.Optional(gs),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),communicationStyleDigest:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"})),projectInstructionsDigest:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"})),taskRetryAvailable:c.Optional(c.Boolean()),taskRetriedFrom:c.Optional(c.Object({sessionId:c.String(),projectPath:c.String()})),taskDelivery:c.Optional(X$),taskIsolation:c.Optional(co),taskSourceProjectPath:c.Optional(c.String()),taskWorktreePath:c.Optional(c.String()),taskWorktreeBranch:c.Optional(c.String()),taskBaseCommit:c.Optional(c.String()),taskDiffStat:c.Optional(eF),taskQueuePosition:c.Optional(c.Integer({minimum:1})),taskQueueDepth:c.Optional(c.Integer({minimum:0})),taskConcurrencyLimit:c.Optional(c.Integer({minimum:1})),archivedAt:c.Optional(c.String()),archivedBySessionId:c.Optional(c.String()),pendingInteraction:c.Optional(iF),messageCount:c.Number(),firstMessageTime:c.String(),lastMessageTime:c.String(),hasErrors:c.Boolean()})),aF=z(c.Object({sessions:c.Array(Un),nextCursor:c.Optional(c.String())})),cF=z(c.Object({session:Un,archivedSessionIds:c.Array(c.String())})),lF=z(c.Object({session:Un,restoredSessionIds:c.Array(c.String())}));z(c.Object({version:c.Literal(1),sessionId:c.String(),goalId:c.String(),objective:c.String(),status:be(["active","verifying","paused","blocked","usage_limited","budget_limited","complete"]),tokenBudget:c.Optional(c.Number()),tokensUsed:c.Number(),timeUsedSeconds:c.Number(),continuationCount:c.Number(),statusReason:c.Optional(c.String()),completionVerification:c.Optional(c.Object({attempt:c.Integer({minimum:1}),status:be(["pending","pass","fail","partial"]),requestedAt:c.String(),completedAt:c.Optional(c.String()),verifierSessionId:c.Optional(c.String()),summary:c.Optional(c.String()),evidenceSha256:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"}))})),prematureStop:c.Optional(c.Object({pattern:c.Unsafe({type:"string"}),consecutiveCount:c.Integer({minimum:1}),detectedAt:c.String()})),verificationStall:c.Optional(c.Unsafe({type:"object"})),createdAt:c.String(),updatedAt:c.String()}));const Hd=z(c.Object({role:_d,content:$x,metadata:c.Optional(c.Unknown()),reasoningContent:c.Optional(c.String()),thinkingContent:c.Optional(c.String()),tool_call_id:c.Optional(c.String()),name:c.Optional(c.String()),tool_calls:c.Optional(c.Unknown())})),dF=z(c.Object({session:Un,messages:c.Array(Hd)})),Fx=z(be(["conversation","code","both"])),Lx=z(c.Object({messageId:c.String(),preview:c.String(),createdAt:c.String(),fileCount:c.Integer({minimum:0})}));z(c.Object({targetMessageId:c.String({minLength:1}),mode:En(Fx,"conversation")}));const uF=z(c.Object({checkpoint:Lx,mode:Fx,removedTurns:c.Integer({minimum:1}),restoredFiles:c.Array(c.String()),messages:c.Array(Hd)})),pF=be(["running","completed","failed","cancelled"]),Rc=z(c.Object({id:c.String(),subagentType:c.String(),description:c.String(),status:pF,background:c.Boolean(),rootAgentId:c.String(),resumedFrom:c.Optional(c.String()),resumeDepth:c.Integer({minimum:0}),createdAt:c.Number(),lastActiveAt:c.Number(),completedAt:c.Optional(c.Number()),restartRecovery:c.Optional(c.Object({outcome:be(["completed","interrupted","failed"]),recoveredAt:c.Number()})),result:c.Optional(c.Object({success:c.Boolean(),message:c.String(),error:c.Optional(c.String()),verificationCommands:c.Optional(c.Array(c.String())),verificationVerdict:c.Optional(be(["pass","fail","partial"])),modifiedFiles:c.Optional(c.Array(c.String()))})),stats:c.Optional(c.Object({tokens:c.Optional(c.Number()),toolCalls:c.Optional(c.Number()),duration:c.Optional(c.Number())}))}));z(c.Object({prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"})}));const fF=z(c.Object({source:Rc,session:Rc})),Dx=z(c.Object({sessionId:c.String(),projectPath:c.String()})),_x=z(c.Object({path:c.String(),name:c.String(),gitBranch:c.Optional(c.String()),available:c.Boolean(),isCurrent:c.Boolean(),boundAt:c.String()})),mF=z(c.Union([c.Object({cancelled:c.Literal(!0)}),c.Object({cancelled:c.Literal(!1),path:c.String({minLength:1})})])),Vu=z(c.Object({type:c.String(),seq:c.Optional(c.Number()),properties:c.Record(c.String(),c.Unknown())})),Ux=c.Object({type:be(["file","image","url"]),path:c.Optional(c.String()),url:c.Optional(c.String()),content:c.Optional(c.String({maxLength:mi})),mimeType:c.Optional(c.String()),name:c.Optional(c.String())}),Bx=c.Record(c.String(),c.Unknown());z(c.Object({prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"}),title:c.Optional(c.String({minLength:1,maxLength:200})),taskPriority:En(Ud,"medium"),taskKind:En(Bd,"feature"),taskDueAt:c.Optional(c.String({minLength:1,maxLength:64})),projectPath:c.Optional(c.String()),modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:En(co,"worktree"),permissionMode:En(gs,"default"),attachments:c.Optional(c.Array(Ux,{maxItems:zr})),outputSchema:c.Optional(Bx)}));z(c.Object({title:c.Optional(c.String({minLength:1,maxLength:200})),taskPriority:c.Optional(Ud),taskKind:c.Optional(Bd),taskDueAt:c.Optional(c.Union([c.String({minLength:1,maxLength:64}),c.Null()]))}));const Wu=z(c.Object({session:Un,runId:c.String(),messageId:c.String(),status:be(["queued","running"]),queuePosition:c.Optional(c.Integer({minimum:1})),queueDepth:c.Optional(c.Integer({minimum:0})),maxConcurrentTasks:c.Optional(c.Integer({minimum:1}))}));z(c.Object({action:be(["apply","discard"])}));const qd=z(c.Object({kind:be(["cron","interval","once"]),cron:c.Optional(c.String({minLength:1,maxLength:120})),intervalMs:c.Optional(c.Integer({minimum:6e4})),runAt:c.Optional(c.String({minLength:1,maxLength:40})),timezone:c.Optional(c.String({minLength:1,maxLength:80}))})),hF=z(c.Object({modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:En(co,"worktree"),permissionMode:En(gs,"default")})),Cs=z(c.Object({id:c.String(),title:c.Optional(c.String({minLength:1,maxLength:200})),prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"}),projectPath:c.String({minLength:1}),trigger:qd,dispatch:hF,enabled:c.Boolean(),createdAt:c.String(),updatedAt:c.String(),nextRunAt:c.Union([c.String(),c.Null()]),expiresAt:c.Union([c.String(),c.Null()]),lastRunAt:c.Optional(c.String()),lastRunSessionId:c.Optional(c.String()),lastStatus:c.Optional(be(["queued","running","completed","failed","cancelled","interrupted","error"])),lastError:c.Optional(c.String()),runCount:c.Integer({minimum:0})}));z(c.Object({title:c.Optional(c.String({minLength:1,maxLength:200})),prompt:c.String({minLength:1,maxLength:32e3,pattern:"\\S"}),projectPath:c.String({minLength:1}),trigger:qd,modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:En(co,"worktree"),permissionMode:En(gs,"default"),enabled:En(c.Boolean(),!0)}));z(c.Object({title:c.Optional(c.String({minLength:1,maxLength:200})),prompt:c.Optional(c.String({minLength:1,maxLength:32e3,pattern:"\\S"})),trigger:c.Optional(qd),modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),isolation:c.Optional(co),permissionMode:c.Optional(gs),enabled:c.Optional(c.Boolean())}));const gF=z(c.Object({schedules:c.Array(Cs)}));z(c.Object({content:c.String({maxLength:V$}),projectPath:c.Optional(c.String()),modelId:c.Optional(c.String({minLength:1,maxLength:500})),reasoningEffort:c.Optional(Qs),serviceTier:c.Optional(Ys),responseVerbosity:c.Optional(Zs),communicationStyle:c.Optional(Fr),permissionMode:c.Optional(gs),attachments:c.Optional(c.Array(Ux,{maxItems:zr})),outputSchema:c.Optional(Bx)}));const bF=be(["completed","failed","aborted","timed_out","spawn_error"]),kF=z(c.Object({version:c.Literal(1),command:c.String(),status:bF,exitCode:c.Union([c.Integer(),c.Null()]),durationMs:c.Number({minimum:0}),stdout:c.String(),stderr:c.String(),stdoutOmittedBytes:c.Integer({minimum:0}),stderrOmittedBytes:c.Integer({minimum:0}),binaryOutput:c.Boolean(),truncated:c.Boolean()}));z(c.Object({command:c.String({minLength:1,maxLength:32*1024,pattern:"^(?![\\s\\S]*\\u0000)(?=[\\s\\S]*\\S)[\\s\\S]*$"}),projectPath:c.Optional(c.String())}));const xF=z(c.Object({executionId:c.String(),messageId:c.String(),record:kF,auxiliary:c.Boolean(),delivery:c.Optional(be(["current_turn","next_turn"])),queued:c.Optional(c.Integer({minimum:0}))}));z(c.Object({question:c.String({minLength:1,maxLength:W$,pattern:"^(?![\\s\\S]*\\x00)(?=[\\s\\S]*\\S)[\\s\\S]*$"}),projectPath:c.Optional(c.String())}));const yF=z(c.Object({response:c.String({minLength:1}),durationMs:c.Number({minimum:0}),modelId:c.Optional(c.String()),usage:c.Optional(c.Object({promptTokens:c.Number({minimum:0}),completionTokens:c.Number({minimum:0}),totalTokens:c.Number({minimum:0}),reasoningTokens:c.Optional(c.Number({minimum:0})),cacheCreationInputTokens:c.Optional(c.Number({minimum:0})),cacheReadInputTokens:c.Optional(c.Number({minimum:0})),costUsd:c.Optional(c.Number({minimum:0}))}))}));z(c.Object({projectPath:c.String(),kind:be(["uncommitted","base","commit"]),ref:c.Optional(c.String({maxLength:200})),instructions:c.Optional(c.String({maxLength:4e3})),modelId:c.Optional(c.String({minLength:1,maxLength:200}))}));const wF=z(c.Object({reviewId:c.String(),status:c.Literal("running")}));z(c.Object({messageId:c.String(),role:_d,content:c.String(),timestamp:c.String()}));z(c.Object({approved:c.Boolean(),remember:c.Optional(c.Boolean()),scope:c.Optional(be(["once","session","project"])),targetMode:c.Optional(gs),feedback:c.Optional(c.String()),answers:c.Optional(c.Record(c.String(),c.Union([c.String(),c.Array(c.String())]))),elicitation:c.Optional(c.Object({action:be(["accept","decline","cancel"]),content:c.Optional(c.Record(c.String(),c.Union([c.String({maxLength:4e3}),c.Number(),c.Boolean(),c.Array(c.String({maxLength:1e3}),{maxItems:100})]),{maxProperties:32}))}))}));const vF=z(c.Object({id:Fr,name:c.String({minLength:1,maxLength:80}),description:c.String({minLength:1,maxLength:256}),source:be(["built-in","user","project","plugin"]),contentSha256:c.Optional(c.String({pattern:"^[a-f0-9]{64}$"}))}));z(c.Object({id:c.String(),displayName:c.Optional(c.String()),provider:c.String(),model:c.String(),contextWindow:c.Optional(c.Number()),maxTokens:c.Optional(c.Number()),reasoning:c.Optional(c.Boolean()),supportedReasoningEfforts:c.Optional(c.Array(be(["off","minimal","low","medium","high","xhigh","max"]))),supportedServiceTiers:c.Optional(c.Array(be(["standard","fast","flex"]))),supportedResponseVerbosities:c.Optional(c.Array(be(["low","medium","high"]))),communicationStyles:c.Optional(c.Array(vF,{maxItems:36})),input:c.Optional(c.Array(be(["text","image"]))),overrides:c.Optional(c.Object({baseUrl:c.Optional(c.String()),temperature:c.Optional(c.Number()),maxOutputTokens:c.Optional(c.Number()),timeout:c.Optional(c.Number()),streamIdleTimeout:c.Optional(c.Number({minimum:1e3}))}))}));z(be(["vs-dark","vs-light","hc-black"]));const SF=z(be(["light","dark","system"])),jF=z(c.Object({language:c.String(),codeTheme:c.String(),uiTheme:SF,autoSaveSessions:c.Boolean(),notifyBuild:c.Boolean(),notifyErrors:c.Boolean(),notifySounds:c.Boolean(),privacyTelemetry:c.Boolean(),privacyCrash:c.Boolean(),agentTeamsEnabled:c.Boolean(),communicationStyle:c.Optional(Fr)}));z(c.Partial(jF));async function Dn(e,t){const n=await fetch(e,t),r=await n.json().catch(()=>{});if(!n.ok){const s=r,i=s!=null&&s.error&&typeof s.error=="object"&&!Array.isArray(s.error)?s.error:void 0,o=typeof(s==null?void 0:s.error)=="string"?s.error:typeof(i==null?void 0:i.message)=="string"?i.message:typeof(s==null?void 0:s.message)=="string"?s.message:n.statusText||`Request failed (${n.status})`;throw new Error(o)}return r}const ie="",Ju=1e4,IF=c.Array(Un),CF=c.Array(_x),EF=c.Array(Hd),TF=c.Array(Lx),AF=c.Array(Rc),Qu=c.Object({cwd:c.String(),gitBranch:c.Optional(c.String()),taskAdmission:c.Optional(c.Object({inFlight:c.Integer({minimum:0}),queued:c.Integer({minimum:0}),maxConcurrent:c.Integer({minimum:1}),maxQueued:c.Integer({minimum:1}),paused:c.Optional(c.Boolean())}))}),PF=e=>Array.isArray(e)?e:e==null?"":typeof e=="string"?e:JSON.stringify(e),NF=()=>{const e=new Date,t=String(e.getFullYear()).slice(-2),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0");return`Session ${t}-${n}-${r} ${s}:${i}`};function OF(e){const t=Dx.parse(e);return`projectPath=${encodeURIComponent(t.projectPath)}`}function ft(e,t){const n=OF(t);return`${e}${e.includes("?")?"&":"?"}${n}`}function Yu(e){return{"x-blade-directory":Dx.parse(e).projectPath}}const Za=(e,t,n)=>({id:`history-${t}-${n}`,role:e.role,content:PF(e.content),timestamp:n,metadata:e.metadata&&typeof e.metadata=="object"?e.metadata:void 0,tool_call_id:e.tool_call_id,name:e.name,tool_calls:e.tool_calls,thinkingContent:e.thinkingContent??e.reasoningContent}),X={listProjects:async()=>{const e=await fetch(`${ie}/projects`);if(!e.ok)throw new Error("Failed to load projects");return Qn(CF,await e.json())},bindProject:async e=>{var n;const t=await fetch(`${ie}/projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to bind project")}return _x.parse(await t.json())},pickProjectDirectory:async()=>Qn(mF,await Dn(`${ie}/projects/pick`,{method:"POST"})),unbindProject:async e=>{if(!(await fetch(`${ie}/projects?path=${encodeURIComponent(e)}`,{method:"DELETE"})).ok)throw new Error("Failed to unbind project")},listSessions:async()=>{const e=await fetch(`${ie}/sessions`);if(!e.ok)throw new Error("Failed to load sessions");return Qn(IF,await e.json())},listSessionPage:async(e,t=50,n=!1)=>{const r=new URLSearchParams({limit:String(t)});e&&r.set("cursor",e),n&&r.set("archived","true");const s=await fetch(`${ie}/sessions/catalog?${r.toString()}`);if(!s.ok)throw new Error("Failed to load session catalog");return aF.parse(await s.json())},getSession:async e=>Un.parse(await Dn(ft(`${ie}/sessions/${e.sessionId}`,e))),createSession:async(e,t)=>{const n=await fetch(`${ie}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e,title:t||NF()})});if(!n.ok)throw new Error("Failed to create session");return Un.parse(await n.json())},startCodeReview:async(e,t)=>{var r,s;const n=await fetch(`${ie}/sessions/${e.sessionId}/review`,{method:"POST",headers:{"Content-Type":"application/json",...Yu(e)},body:JSON.stringify({projectPath:e.projectPath,...t})});if(!n.ok){const i=await n.json().catch(()=>{}),o=((r=i==null?void 0:i.error)==null?void 0:r.code)==="CONFLICT"?Ke("taskHome.review.conflict"):((s=i==null?void 0:i.error)==null?void 0:s.code)==="BAD_REQUEST"?Ke("taskHome.review.invalidTarget"):Ke("taskHome.review.startFailed");throw new Error(o)}return wF.parse(await n.json())},getWorkspaceInfo:async()=>Qn(Qu,await Dn(`${ie}/global/info`)),createTask:async e=>{var n;const t=await fetch(`${ie}/tasks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to dispatch task")}return Wu.parse(await t.json())},updateTask:async(e,t)=>{var r;const n=await fetch(ft(`${ie}/tasks/${e.sessionId}`,e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.json().catch(()=>{});throw new Error(((r=s==null?void 0:s.error)==null?void 0:r.message)||"Failed to update task")}return Un.parse(await n.json())},setTaskAdmissionPaused:async e=>Qn(Qu.properties.taskAdmission,await Dn(`${ie}/global/task-admission`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({paused:e})})),retryTask:async e=>{var n;const t=await fetch(ft(`${ie}/tasks/${e.sessionId}/retry`,e),{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to retry task")}return Wu.parse(await t.json())},deliverTask:async(e,t)=>{var r;const n=await fetch(ft(`${ie}/tasks/${e.sessionId}/delivery`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t})});if(!n.ok){const s=await n.json().catch(()=>{});throw new Error(((r=s==null?void 0:s.error)==null?void 0:r.message)||"Failed to deliver task changes")}return Un.parse(await n.json())},getTaskDiff:async e=>{var n;const t=await fetch(ft(`${ie}/tasks/${e.sessionId}/diff`,e));if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to load task diff")}return nF.parse(await t.json())},deleteSession:async e=>{if(!(await fetch(ft(`${ie}/sessions/${e.sessionId}`,e),{method:"DELETE"})).ok)throw new Error("Failed to delete session")},archiveSession:async e=>cF.parse(await Dn(ft(`${ie}/sessions/${e.sessionId}/archive`,e),{method:"POST"})),unarchiveSession:async e=>lF.parse(await Dn(ft(`${ie}/sessions/${e.sessionId}/unarchive`,e),{method:"POST"})),exportSessionMarkdown:async(e,t=!1)=>{var u,m;const n=ft(`${ie}/sessions/${e.sessionId}/export`,e),r=t?`${n}&includeReasoning=true`:n,s=await fetch(r);if(!s.ok){const p=await s.json().catch(()=>{});throw new Error(((u=p==null?void 0:p.error)==null?void 0:u.message)||"Failed to export session")}const i=s.headers.get("content-disposition")??"",o=((m=/filename="([A-Za-z0-9._-]+)"/.exec(i))==null?void 0:m[1])??`blade-session-${e.sessionId.slice(0,12)}.md`,d=s.headers.get("x-blade-content-sha256")??"";if(!/^[a-f0-9]{64}$/.test(d))throw new Error("Session export is missing its integrity hash");const f=p=>{const h=s.headers.get(p);if(h===null)throw new Error(`Session export is missing its ${p} header`);const b=Number(h);if(!Number.isInteger(b)||b<0)throw new Error(`Session export has an invalid ${p} header`);return b};return{filename:o,markdown:await s.text(),contentSha256:d,messageCount:f("x-blade-export-messages"),activityCount:f("x-blade-export-activities"),redactionCount:f("x-blade-export-redactions")}},updateSession:async(e,t)=>{if(!(await fetch(`${ie}/sessions/${e.sessionId}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:t,projectPath:e.projectPath})})).ok)throw new Error("Failed to update session")},getMessages:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/message`,e));if(!t.ok)throw new Error("Failed to load messages");const n=Qn(EF,await t.json()),r=Date.now();return n.map((s,i)=>Za(s,i,r))},sendMessage:async(e,t,n)=>{var s;const r=await fetch(`${ie}/sessions/${e.sessionId}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,permissionMode:n,projectPath:e.projectPath})});if(!r.ok){const i=await r.json().catch(()=>{}),o=((s=i==null?void 0:i.error)==null?void 0:s.message)??(i==null?void 0:i.reason);throw new Error(o||"Failed to send message")}return r.json()},askSideQuestion:async(e,t,n)=>yF.parse(await Dn(`${ie}/sessions/${e.sessionId}/side-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:t,projectPath:e.projectPath}),signal:n})),executeUserShellCommand:async(e,t)=>xF.parse(await Dn(`${ie}/sessions/${e.sessionId}/shell`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:t,projectPath:e.projectPath})})),abortSession:async e=>{var n;const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/abort`,e),{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||"Failed to stop task")}},getGoal:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e));if(!t.ok)throw new Error("Failed to load goal");return(await t.json()).goal},createGoal:async(e,t,n,r)=>{const s=await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({objective:t,tokenBudget:n,permissionMode:r})});if(!s.ok)throw new Error("Failed to create goal");return s.json()},updateGoal:async(e,t)=>{const n=await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error("Failed to update goal");return n.json()},clearGoal:async e=>{if(!(await fetch(ft(`${ie}/sessions/${e.sessionId}/goal`,e),{method:"DELETE"})).ok)throw new Error("Failed to clear goal")},listRewindCheckpoints:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/rewind`,e));if(!t.ok)throw new Error("Failed to load rewind checkpoints");const n=await t.json();return Qn(TF,n.checkpoints)},rewindSession:async(e,t,n)=>{const r=await fetch(ft(`${ie}/sessions/${e.sessionId}/rewind`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetMessageId:t,mode:n})});if(!r.ok)throw new Error("Failed to rewind session");const s=uF.parse(await r.json()),i=Date.now();return{...s,messages:s.messages.map((o,d)=>Za(o,d,i))}},listSubagents:async e=>{const t=await fetch(ft(`${ie}/sessions/${e.sessionId}/subagents`,e));if(!t.ok)throw new Error("Failed to load subagents");const n=await t.json();return Qn(AF,n.subagents)},resumeSubagent:async(e,t,n)=>{const r=await fetch(ft(`${ie}/sessions/${e.sessionId}/subagents/${encodeURIComponent(t)}/resume`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:n})});if(!r.ok){const s=await r.json().catch(()=>{});throw new Error((s==null?void 0:s.message)||"Failed to resume subagent")}return fF.parse(await r.json())},forkSession:async e=>{const t=await fetch(`${ie}/sessions/${e.sessionId}/fork`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.projectPath})});if(!t.ok)throw new Error("Failed to fork session");const n=dF.parse(await t.json()),r=Date.now();return{session:n.session,messages:n.messages.map((s,i)=>Za(s,i,r))}},openEventSubscription:async(e,t,n)=>{const r=(n==null?void 0:n.maxRetries)??5,s=n==null?void 0:n.onConnectionChange,i=n==null?void 0:n.onConnectionStateChange;let o=null,d=0,f=null,u=Date.now(),m=null,p=null,h=!1,b=!1,k=0,S,C,x=!1;const N=new Promise((O,J)=>{S=O,C=J}),P=()=>{m&&(clearInterval(m),m=null)},L=()=>{p&&(clearTimeout(p),p=null)},D=()=>{o==null||o.close(),o=null},j=()=>{f&&(clearTimeout(f),f=null),P(),L(),D()},I=()=>{x||(x=!0,L(),S())},T=O=>{x||(x=!0,j(),C(O))},M=()=>{if(h||d>=r){d>=r&&(console.error(`SSE max retries (${r}) reached, giving up`),i==null||i("offline"));return}d++,i==null||i("reconnecting");const O=Math.min(1e3*Math.pow(2,d-1),3e4);console.log(`SSE reconnecting in ${O}ms (attempt ${d}/${r})`),f=setTimeout(()=>{te().catch(J=>{console.error("SSE reconnect failed",J),s==null||s(!1),M()})},O)},$=()=>{d=0,u=Date.now(),s==null||s(!0),i==null||i("connected"),P(),m=setInterval(()=>{Date.now()-u>45e3&&(console.warn("SSE heartbeat timeout, reconnecting..."),P(),D(),s==null||s(!1),i==null||i("reconnecting"),M())},15e3),b||(b=!0,I())},te=async()=>{if(h)return;D();const O=ft(`${ie}/sessions/${e.sessionId}/events`,e),J=k>0?`${O}${O.includes("?")?"&":"?"}lastEventId=${k}`:O;o=new EventSource(J),b||(L(),p=setTimeout(()=>{i==null||i("offline"),T(new Error("Timed out waiting for event subscription readiness"))},Ju)),o.onmessage=ae=>{try{const ce=JSON.parse(ae.data);typeof ce.seq=="number"&&ce.seq>k&&(k=ce.seq);const le=Vu.parse(ce);if(u=Date.now(),le.type==="connected"){le.properties.sessionId===e.sessionId&&le.properties.projectPath===e.projectPath&&(typeof le.properties.status=="string"&&t({type:"session.status",properties:le.properties}),$());return}if(le.type==="heartbeat")return;t(le)}catch(ce){console.error("Failed to parse SSE event:",ae.data,ce)}},o.onerror=()=>{if(h)return;const ae=(o==null?void 0:o.readyState)===EventSource.CLOSED;if(P(),D(),ae){s==null||s(!1),i==null||i("offline"),b||T(new Error("Event subscription closed before it was ready"));return}if(!b){i==null||i("offline"),T(new Error("Failed to open event subscription"));return}s==null||s(!1),M()}};return i==null||i("connecting"),te().catch(O=>{i==null||i("offline"),T(O instanceof Error?O:new Error("Failed to open event subscription"))}),await N,()=>{h=!0,f&&(clearTimeout(f),f=null),j(),s==null||s(!1)}},openTaskEventSubscription:async(e,t)=>{const n=t==null?void 0:t.onConnectionChange,r=t==null?void 0:t.onConnectionStateChange,s=new EventSource(`${ie}/events`);let i=!1,o=!1,d,f,u;const m=new Promise((h,b)=>{f=h,u=b}),p=()=>{i||(i=!0,d!==void 0&&(clearTimeout(d),d=void 0),s.close(),n==null||n(!1),r==null||r("offline"))};return r==null||r("connecting"),d=setTimeout(()=>{o||i||(p(),u(new Error("Timed out waiting for global task events")))},Ju),s.onmessage=h=>{try{const b=Vu.parse(JSON.parse(h.data));if(b.type==="connected"){o||(o=!0,d!==void 0&&(clearTimeout(d),d=void 0),f()),n==null||n(!0),r==null||r("connected");return}if(b.type==="heartbeat")return;e(b)}catch(b){console.error("Failed to parse global task event:",h.data,b)}},s.onerror=()=>{n==null||n(!1),r==null||r(o?"reconnecting":"offline"),!o&&!i&&(p(),u(new Error("Failed to open global task events")))},await m,p},respondPermission:async(e,t,n)=>{var i;const r=new URLSearchParams({sessionId:e.sessionId,projectPath:e.projectPath}),s=await fetch(`${ie}/permissions/${t}?${r.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok){const o=await s.json().catch(()=>{});throw new Error(((i=o==null?void 0:o.error)==null?void 0:i.message)||"Failed to respond to permission")}},respondToConfirmation:async(e,t,n)=>{if(!(await fetch(ft(`${ie}/sessions/${e.sessionId}/confirmation/${t}`,e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({approved:n})})).ok)throw new Error("Failed to respond to confirmation")},respondToQuestion:async(e,t,n)=>{var i;const r=new URLSearchParams({sessionId:e.sessionId,projectPath:e.projectPath}),s=await fetch(`${ie}/permissions/${t}?${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({approved:!0,answers:n})});if(!s.ok){const o=await s.json().catch(()=>{});throw new Error(((i=o==null?void 0:o.error)==null?void 0:i.message)||"Failed to respond to question")}},respondToElicitation:async(e,t,n)=>{var i;const r=new URLSearchParams({sessionId:e.sessionId,projectPath:e.projectPath}),s=await fetch(`${ie}/permissions/${t}?${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({approved:n.action==="accept",elicitation:n})});if(!s.ok){const o=await s.json().catch(()=>{});throw new Error(((i=o==null?void 0:o.error)==null?void 0:i.message)||"Failed to respond to MCP elicitation")}},getGitInfo:async e=>{const t=await fetch(`${ie}/suggestions/git-info`,{headers:Yu(e)});if(!t.ok)throw new Error("Failed to get git info");return t.json()},listSchedules:async()=>{var n;const e=await fetch(`${ie}/schedules`);if(!e.ok){const r=await e.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.loadFailed"))}return gF.parse(await e.json()).schedules},createSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.createFailed"))}return Cs.parse(await t.json())},updateSchedule:async(e,t)=>{var r;const n=await fetch(`${ie}/schedules/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.json().catch(()=>{});throw new Error(((r=s==null?void 0:s.error)==null?void 0:r.message)||Ke("schedule.error.updateFailed"))}return Cs.parse(await n.json())},deleteSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.deleteFailed"))}},enableSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}/enable`,{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.toggleFailed"))}return Cs.parse(await t.json())},disableSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}/disable`,{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.toggleFailed"))}return Cs.parse(await t.json())},runSchedule:async e=>{var n;const t=await fetch(`${ie}/schedules/${encodeURIComponent(e)}/run`,{method:"POST"});if(!t.ok){const r=await t.json().catch(()=>{});throw new Error(((n=r==null?void 0:r.error)==null?void 0:n.message)||Ke("schedule.error.runFailed"))}return Cs.parse(await t.json())}},RF=(e,t)=>({messages:[],setMessages:n=>e({messages:n}),addMessage:n=>e(r=>({messages:[...r.messages,n]})),updateMessage:(n,r)=>e(s=>({messages:s.messages.map(i=>i.id===n?{...i,...r}:i)})),appendDelta:(n,r,s)=>e(i=>({messages:i.messages.map(o=>{if(o.id!==n)return o;const d=o.agentContent||Wn();return s==="before"?{...o,agentContent:{...cu(d,r),textBefore:d.textBefore+r}}:{...o,agentContent:{...cu(d,r),textAfter:d.textAfter+r}}})})),appendToolCall:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:K0(o,r)}})})),updateToolCall:(n,r,s)=>e(i=>({messages:i.messages.map(o=>{if(o.id!==n)return o;const d=o.agentContent;return d?{...o,agentContent:{...d,toolCalls:d.toolCalls.map(f=>f.toolCallId===r?{...f,...s}:f)}}:o})})),appendThinking:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:{...z0(o,r),thinkingContent:o.thinkingContent+r}}})})),setConfirmation:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:{...o,confirmation:r}}})})),setQuestion:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:{...o,question:r}}})})),setElicitation:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:{...o,elicitation:r}}})})),setSubagent:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:r?q0(o,r):au(o,[])}})})),updateSubagent:(n,r,s)=>e(i=>({messages:i.messages.map(o=>{if(o.id!==n)return o;const d=o.agentContent||Wn(),f=[...H0(d)],u=f.findIndex(h=>h.id===r||h.sessionId===r);if(u===-1)return o;const m=f[u],p=typeof s=="function"?s(m):s;return f[u]={...m,...p,id:m.id},{...o,agentContent:au(d,f,f[u].id)}})})),setTasks:(n,r)=>e(s=>({messages:s.messages.map(i=>{if(i.id!==n)return i;const o=i.agentContent||Wn();return{...i,agentContent:{...o,tasks:r}}})})),replaceTemp:(n,r)=>e(s=>{const i=s.messages.findIndex(d=>d.content===n&&d.role==="user");if(i===-1)return s;const o=[...s.messages];return o[i]=r,{messages:o}})}),Xa=60,MF=[/<system-reminder>[\s\S]*?<\/system-reminder>/gi,/<file[^>]*>[\s\S]*?<\/file>/gi,/<hooks_context>[\s\S]*?<\/hooks_context>/gi,/<[^>]+>/g];function $F(e){let t=e;for(const f of MF)t=t.replace(f," ");t=t.replace(/^\s*\/[a-zA-Z][\w-]*\s+/,"");const n=t.replace(/\s+/g," ").trim();if(!n)return"";const r=n.match(/^(.+?)(?:[.!?]\s|[。!?](?=\S|$)|$)/);let s=r&&r[1].length>=6?r[1]:n;if(s=s.trim().replace(/[\s.。!!??,,;;::-]+$/,""),s.length<=Xa)return s;const i=s.slice(0,Xa),o=i.lastIndexOf(" ");return`${(o>Xa*.6?i.slice(0,o):i).trimEnd()}…`}const Po="/.blade/worktrees/",FF=/-[a-f0-9]{8,}$/i,LF=/^(.+?(?:test|config))-[a-z0-9]{6,}$/i;function DF(e){const t=e.indexOf(Po);if(t<0)return null;const n=e.slice(t+Po.length).split("/")[0];return n?`${e.slice(0,t+Po.length)}${n}`:null}function _F(e){if(!e.includes("/tmp/")&&!e.includes("/T/"))return null;const t=e.split("/"),n=t.at(-1),r=n==null?void 0:n.match(LF);return r!=null&&r[1]?(t[t.length-1]=r[1],t.join("/")):null}function Mc(e){const t=e.split("/").filter(Boolean).at(-1)||e;return e.includes(Po)?t.replace(FF,""):t}function lo(e,t=null){const n=e.taskSourceProjectPath,r=_F(n||e.projectPath);if(r)return r;if(n)return n;const s=DF(e.projectPath);if(!s)return e.projectPath;const i=Mc(s);return t&&i===Mc(t)?t:s}function UF(e,t,n=null){return t?e.filter(r=>lo(r,n)===t):e}const $c=kr.AUTO_EDIT;let ec=0;const Mt=Qo((e,t)=>({currentModelId:null,currentMode:$c,configuredModels:[],availableModels:[],isLoading:!1,hasLoaded:!1,loadedWorkspacePath:null,error:null,loadModels:async n=>{const r=n??null;if(t().isLoading&&t().loadedWorkspacePath===r)return;const s=++ec;e({isLoading:!0,hasLoaded:!1,loadedWorkspacePath:r,error:null});try{const i=await Dn("/models",n?{headers:{"x-blade-directory":n}}:void 0);if(s!==ec||t().loadedWorkspacePath!==r)return;const o=i.current;e({currentModelId:(o==null?void 0:o.id)||null,configuredModels:i.configured||[],availableModels:i.available||[],isLoading:!1,hasLoaded:!0})}catch(i){if(s!==ec||t().loadedWorkspacePath!==r)return;e({error:i instanceof Error?i.message:"Failed to load models",isLoading:!1,hasLoaded:!0})}},setCurrentModel:async(n,r)=>{if(e({error:null}),r){e({currentModelId:n});return}try{await Dn("/configs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:{currentModelId:n},options:{scope:"global"}})}),e({currentModelId:n})}catch(s){throw e({error:s instanceof Error?s.message:"Failed to set model"}),s}},setMode:n=>e({currentMode:n}),resetMode:()=>e({currentMode:$c})})),BF=e=>e==="system"?typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches:e==="dark",No=e=>{if(typeof document>"u")return;const t=document.documentElement;if(t.classList.remove("light","dark"),e==="system"){const r=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";t.classList.add(r)}else t.classList.add(e)},rn={language:"zh-CN",codeTheme:"dracula",uiTheme:"system",autoSaveSessions:!0,notifyBuild:!0,notifyErrors:!1,notifySounds:!1,privacyTelemetry:!1,privacyCrash:!0,agentTeamsEnabled:!1,communicationStyle:"auto"},Xr=Qo((e,t)=>({...rn,isLoading:!1,error:null,loadSettings:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/configs");if(!n.ok)throw new Error(Ke("settings.general.loadError"));const r=await n.json(),s=r.uiTheme??rn.uiTheme;e({language:r.language??rn.language,codeTheme:r.codeTheme??rn.codeTheme,uiTheme:s,autoSaveSessions:r.autoSaveSessions??rn.autoSaveSessions,notifyBuild:r.notifyBuild??rn.notifyBuild,notifyErrors:r.notifyErrors??rn.notifyErrors,notifySounds:r.notifySounds??rn.notifySounds,privacyTelemetry:r.privacyTelemetry??rn.privacyTelemetry,privacyCrash:r.privacyCrash??rn.privacyCrash,agentTeamsEnabled:r.agentTeamsEnabled??rn.agentTeamsEnabled,communicationStyle:r.communicationStyle??rn.communicationStyle,isLoading:!1}),No(s)}catch(n){e({error:n.message,isLoading:!1})}},updateSettings:async n=>{const r=t();e({...n,error:null}),n.uiTheme&&No(n.uiTheme);try{if(!(await fetch("/configs",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:n,options:{scope:"global"}})})).ok)throw new Error(Ke("settings.general.saveError"))}catch(s){e({language:r.language,codeTheme:r.codeTheme,uiTheme:r.uiTheme,autoSaveSessions:r.autoSaveSessions,notifyBuild:r.notifyBuild,notifyErrors:r.notifyErrors,notifySounds:r.notifySounds,privacyTelemetry:r.privacyTelemetry,privacyCrash:r.privacyCrash,agentTeamsEnabled:r.agentTeamsEnabled,communicationStyle:r.communicationStyle,error:s.message}),n.uiTheme&&No(r.uiTheme)}}}));No(rn.uiTheme);const w3=()=>Xr(e=>BF(e.uiTheme)),tc="__temp__",ci={inputTokens:0,outputTokens:0,totalTokens:0,maxContextTokens:0,isDefaultMaxTokens:!0,totalInputTokens:0,totalOutputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,estimatedCostUsd:0};function he(e){return{sessionId:e.sessionId,projectPath:e.projectPath}}function Re(e){return JSON.stringify([e.projectPath,e.sessionId])}function oe(e,t){return!e||!t?e===t:e.sessionId===t.sessionId&&e.projectPath===t.projectPath}function zd(e,t){return e.find(n=>oe(he(n),t))}function hn(e,t){const n=he(t),r=e.findIndex(i=>oe(he(i),n));if(r===-1)return[...e,t];const s=[...e];return s[r]=t,s}function Zu(e,t){return e.filter(n=>!oe(he(n),t))}const Hx="blade.tasks.unread",Go="blade:open-session";function qx(e){return e==="completed"||e==="failed"||e==="interrupted"}function HF(e,t,n){return!qx(t)||n?!1:e!==t&&!(e==="completed"||e==="failed"||e==="interrupted"||e==="cancelled")}function qF(e=typeof localStorage>"u"?null:localStorage){if(!e)return[];try{const t=JSON.parse(e.getItem(Hx)??"[]");return Array.isArray(t)?[...new Set(t.filter(n=>typeof n=="string"))]:[]}catch{return[]}}function hi(e,t=typeof localStorage>"u"?null:localStorage){if(t)try{t.setItem(Hx,JSON.stringify([...new Set(e)]))}catch{}}function Xu(e,t){const n=new Set(t.map(r=>Re({sessionId:r.sessionId,projectPath:r.projectPath})));return e.filter(r=>n.has(r))}function ep(e){if(typeof document>"u"||document.visibilityState!=="hidden"||typeof Notification>"u"||Notification.permission!=="granted")return!1;const t=new Notification(e.title,{body:e.body,icon:"/favicon.svg",tag:`blade-task-${Re(e.ref)}`});return t.onclick=()=>e.onOpen(e.ref),!0}function zF(e){if(typeof window>"u")return!1;const t=window.AudioContext??window.webkitAudioContext;if(!t)return!1;try{const n=new t,r=n.createOscillator(),s=n.createGain();return r.type="sine",r.frequency.value=e==="completed"?660:330,s.gain.setValueAtTime(1e-4,n.currentTime),s.gain.exponentialRampToValueAtTime(.045,n.currentTime+.015),s.gain.exponentialRampToValueAtTime(1e-4,n.currentTime+.18),r.connect(s),s.connect(n.destination),r.start(),r.stop(n.currentTime+.2),r.onended=()=>void n.close(),!0}catch{return!1}}const KF=e=>{var n;const t=[];e.content.trim()&&t.push({type:"text",text:e.content});for(const r of e.attachments??[])r.type==="image"&&t.push({type:"image_url",image_url:{url:r.content}});return t.length===0?e.content:t.length===1&&((n=t[0])==null?void 0:n.type)==="text"?t[0].text:t},So=()=>({eventUnsubscribe:null,sessionEventConnectionState:"idle",isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1}),tp=()=>new Promise(e=>{globalThis.setTimeout(()=>{if(typeof window<"u"&&typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>e(),{timeout:750});return}e()},350)}),np=async e=>(await es(async()=>{const{teamService:t}=await import("./teamService-Bk8B4hZp.js");return{teamService:t}},__vite__mapDeps([0,1,2,3]))).teamService.list(e),GF=(e,t)=>{let n=0,r=0,s=0;const i=new Map,o=new Map;let d=null;const f=()=>(d==null||d.abort("session-navigation"),d=null,n+=1,n),u=p=>p===n,m=p=>{try{p()}catch(h){console.warn("Failed to clean up stale event subscription",h)}};return{sessions:[],archivedSessions:[],currentSessionId:null,currentSessionRef:null,forkingSessionRef:null,isTemporarySession:!1,isLoading:!1,catalogLoadState:"idle",catalogError:null,archivedCatalogLoadState:"idle",archivedCatalogError:null,error:null,errorContext:null,goal:null,sideConversation:null,teams:[],setSessions:p=>e({sessions:p}),addSession:p=>e(h=>({sessions:hn(h.sessions,p)})),removeSession:p=>{const h=t();h.markTaskRead(p);const b=oe(h.currentSessionRef,p),k=oe(h.forkingSessionRef,p);(b||k)&&f(),b&&h.unsubscribeFromEvents(),e(S=>({sessions:Zu(S.sessions,p),currentSessionId:b?null:S.currentSessionId,currentSessionRef:b?null:S.currentSessionRef,messages:b?[]:S.messages,goal:b?null:S.goal,sideConversation:b?null:S.sideConversation,teams:b?[]:S.teams,forkingSessionRef:k?null:S.forkingSessionRef,...b?So():{}}))},setCurrentSession:p=>{f(),e({currentSessionId:(p==null?void 0:p.sessionId)??null,currentSessionRef:p,isTemporarySession:!1,sideConversation:null,teams:[]})},setTemporarySession:p=>e({isTemporarySession:p}),setLoading:p=>e({isLoading:p}),setError:p=>e({error:p,errorContext:null}),getNavigationVersion:()=>n,clearError:()=>e({error:null,errorContext:null}),setGoal:p=>e({goal:p}),startTemporarySession:p=>{f(),t().unsubscribeFromEvents(),Mt.getState().resetMode(),p&&t().selectProject(p),e({currentSessionId:tc,currentSessionRef:null,isTemporarySession:!0,forkingSessionRef:null,isLoading:!1,messages:[],goal:null,sideConversation:null,teams:[],tokenUsage:{...ci},error:null,errorContext:null,...So()})},loadSessions:async()=>{const p=++r,h=new Set(t().sessions.map(k=>Re(he(k)))),b=new Set;e({catalogLoadState:"loading",catalogError:null});try{let k,S=!0;do{const N=await X.listSessionPage(k);if(p!==r)return;for(const P of N.sessions)b.add(Re(he(P)));if(e(P=>{const L=new Set(N.sessions.map(j=>Re(he(j))));return{sessions:S?[...N.sessions,...P.sessions.filter(j=>!L.has(Re(he(j))))]:N.sessions.reduce((j,I)=>hn(j,I),P.sessions),catalogLoadState:N.nextCursor?"hydrating":"ready"}}),S=!1,k=N.nextCursor,k&&(await tp(),p!==r))return}while(k);if(p!==r)return;const C=t().sessions.filter(N=>{const P=Re(he(N));return b.has(P)||!h.has(P)}),x=Xu(t().unreadTaskKeys,C);hi(x),e({sessions:C,unreadTaskKeys:x,catalogLoadState:"ready",catalogError:null})}catch(k){if(p!==r)return;e({catalogLoadState:"error",catalogError:k.message})}},loadArchivedSessions:async()=>{const p=++s;e({archivedCatalogLoadState:"loading",archivedCatalogError:null});try{let h;const b=[];do{const k=await X.listSessionPage(h,50,!0);if(p!==s)return;for(const S of k.sessions){const C=b.findIndex(x=>oe(he(x),he(S)));C===-1?b.push(S):b[C]=S}h=k.nextCursor,h&&(e({archivedCatalogLoadState:"hydrating"}),await tp())}while(h);if(p!==s)return;e({archivedSessions:b,archivedCatalogLoadState:"ready",archivedCatalogError:null})}catch(h){if(p!==s)return;e({archivedCatalogLoadState:"error",archivedCatalogError:h.message})}},selectSession:async p=>{var k;const h=f();e({isLoading:!0,error:null,errorContext:null,forkingSessionRef:null});let b=null;try{const S=zd(t().sessions,p),C=[];let x=!1;if(b=await t().prepareEventSubscription(p,T=>{x?t().handleEvent(T):C.push(T)}),!u(h)){m(b),b=null;return}const[N,P,L,D]=await Promise.all([X.getMessages(p),X.getGoal(p).catch(()=>null),S?Promise.resolve(S):X.getSession(p),Xr.getState().agentTeamsEnabled?np(p).catch(()=>[]):Promise.resolve([])]);if(!u(h)){m(b),b=null;return}const j=wo(N),I=lo(L,t().selectedProjectPath??((k=t().taskWorkspaceInfo)==null?void 0:k.cwd)??null);t().boundProjects.some(T=>T.available&&T.path===I)&&t().selectProject(I),Mt.getState().setMode(L.permissionMode??$c),e(T=>{var M;return{currentSessionId:p.sessionId,currentSessionRef:p,isTemporarySession:!1,messages:j,goal:P,teams:D,isLoading:!1,tokenUsage:{...ci},isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1,error:L.taskStatus==="failed"?((M=L.taskFailure)==null?void 0:M.message)??null:null,errorContext:L.taskStatus==="failed"&&L.taskFailure?{kind:"execution",sessionRef:p,failureCode:L.taskFailure.code}:null,sessions:hn(T.sessions,L)}}),t().markTaskRead(p),x=!0,t().replaceEventSubscription(b),b=null;for(const T of C)t().handleEvent(T)}catch(S){if(b&&m(b),!u(h))return;e({error:S.message,errorContext:{kind:"navigation",sessionRef:p},isLoading:!1})}},resyncSessionMessages:async p=>{const h=Re(p),b=i.get(h);if(b)return b;const k=n,S=Promise.resolve().then(async()=>{try{const C=await X.getMessages(p);if(!u(k)||!oe(t().currentSessionRef,p))return;const x=wo(C);e(N=>({messages:x,sessions:N.sessions.map(P=>oe(he(P),p)?{...P,messageCount:x.length}:P)}))}catch(C){console.warn("Failed to resync terminal session messages",C)}finally{i.get(h)===S&&i.delete(h)}});return i.set(h,S),S},archiveSession:async p=>{var h;try{const b=await X.archiveSession(p),k=new Set(b.archivedSessionIds),S=t(),C=((h=S.currentSessionRef)==null?void 0:h.projectPath)===p.projectPath&&k.has(S.currentSessionRef.sessionId);C&&(f(),S.unsubscribeFromEvents()),e(x=>{const N=x.sessions.filter(L=>L.projectPath!==p.projectPath||!k.has(L.sessionId)),P=Xu(x.unreadTaskKeys,N);return hi(P),{sessions:N,archivedSessions:hn(x.archivedSessions,b.session),unreadTaskKeys:P,currentSessionId:C?null:x.currentSessionId,currentSessionRef:C?null:x.currentSessionRef,messages:C?[]:x.messages,goal:C?null:x.goal,...C?So():{}}}),await t().loadArchivedSessions()}catch(b){e({error:b.message,errorContext:{kind:"task_action",sessionRef:p}})}},unarchiveSession:async p=>{try{const h=await X.unarchiveSession(p),b=new Set(h.restoredSessionIds);e(k=>({archivedSessions:k.archivedSessions.filter(S=>S.projectPath!==p.projectPath||!b.has(S.sessionId)),sessions:hn(k.sessions,h.session)})),await Promise.all([t().loadSessions(),t().loadArchivedSessions()])}catch(h){e({error:h.message,errorContext:{kind:"task_action",sessionRef:p}})}},deleteSession:async p=>{const h=t(),b=oe(h.currentSessionRef,p),k=oe(h.forkingSessionRef,p),S=b||k?f():null,C=b?S:null;k&&e({forkingSessionRef:null});try{await X.deleteSession(p),t().markTaskRead(p);const x=t(),N=oe(x.currentSessionRef,p)&&(C===null||u(C));N&&(f(),x.unsubscribeFromEvents()),e(P=>({sessions:Zu(P.sessions,p),currentSessionId:N?null:P.currentSessionId,currentSessionRef:N?null:P.currentSessionRef,messages:N?[]:P.messages,goal:N?null:P.goal,...N?So():{}}))}catch(x){if(C!==null&&(!u(C)||!oe(t().currentSessionRef,p)))return;e({error:x.message})}},updateSession:async(p,h)=>{try{await X.updateSession(p,h),e(b=>({sessions:b.sessions.map(k=>k.sessionId===p.sessionId&&k.projectPath===p.projectPath?{...k,title:h}:k)}))}catch(b){e({error:b.message})}},forkSession:async p=>{const h=f(),b=he(p);e({forkingSessionRef:b,isLoading:!1,error:null});let k=null;try{const S=await X.forkSession(p),C=he(S.session),x=wo(S.messages);if(e(N=>({sessions:hn(N.sessions,S.session)})),!u(h))return;if(k=await t().prepareEventSubscription(C),!u(h)){m(k),k=null;return}e({currentSessionId:C.sessionId,currentSessionRef:C,isTemporarySession:!1,messages:x,goal:null,tokenUsage:{...ci},error:null,forkingSessionRef:null}),t().replaceEventSubscription(k),k=null}catch(S){if(k&&m(k),!u(h))return;e({error:S.message,forkingSessionRef:null})}},rewindSession:async(p,h)=>{const{currentSessionRef:b,isTemporarySession:k,isStreaming:S}=t();if(!b||k)return e({error:"No persisted session is available for rewind"}),!1;if(S)return e({error:"Stop the active run before rewinding"}),!1;const C=n;try{const x=await X.rewindSession(b,p,h);if(!u(C)||!oe(t().currentSessionRef,b))return!1;const N=wo(x.messages);return e(P=>({messages:N,tokenUsage:{...ci},error:null,currentRunId:null,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1,sessions:P.sessions.map(L=>L.sessionId===b.sessionId&&L.projectPath===b.projectPath?{...L,messageCount:N.length}:L)})),!0}catch(x){return!u(C)||!oe(t().currentSessionRef,b)||e({error:x.message}),!1}},sendMessage:async p=>{var O,J,ae,ce,le,xe;const{currentSessionId:h,currentSessionRef:b,isTemporarySession:k,isStreaming:S,addSession:C,addMessage:x}=t(),N=n,P=b,L={isStreaming:S,agentPhase:t().agentPhase,currentRunId:t().currentRunId};let D=b,j=h,I=P,T=null,M=null;const $=()=>u(N)&&oe(t().currentSessionRef,I),te=J$(p.content);if(te){if((((O=p.attachments)==null?void 0:O.length)??0)>0)return e({error:"Side conversations do not accept image attachments"}),!1;if(!te.question)return e({error:"Usage: /btw <question>"}),!1;if(k||!D||!j)return e({error:"Start or select a Session before using /btw"}),!1;d==null||d.abort("side-conversation-replaced");const Z=new AbortController;d=Z;const de=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;e({sideConversation:{requestId:de,sessionRef:D,question:te.question,status:"loading"},error:null,errorContext:null});try{const R=await X.askSideQuestion(D,te.question,Z.signal);return Z.signal.aborted||!$()||((J=t().sideConversation)==null?void 0:J.requestId)!==de?!1:(e({sideConversation:{requestId:de,sessionRef:D,question:te.question,status:"completed",response:R.response,durationMs:R.durationMs,modelId:R.modelId}}),R.usage&&t().updateTokenUsage({inputTokens:R.usage.promptTokens,outputTokens:R.usage.completionTokens,totalTokens:R.usage.totalTokens,cacheReadTokens:R.usage.cacheReadInputTokens??0,cacheWriteTokens:R.usage.cacheCreationInputTokens??0,costUsd:R.usage.costUsd}),!0)}catch(R){return Z.signal.aborted||!$()||e({sideConversation:{requestId:de,sessionRef:D,question:te.question,status:"error",error:R instanceof Error?R.message:String(R)}}),!1}finally{d===Z&&(d=null)}}if(d==null||d.abort("main-conversation-submitted"),d=null,t().sideConversation&&e({sideConversation:null}),k||!j||j===tc)try{const Z=$F(p.content),de=await X.createSession(t().selectedProjectPath??((ae=t().taskWorkspaceInfo)==null?void 0:ae.cwd)??void 0,Z||void 0);if(C(de),!$())return!1;D=he(de),j=de.sessionId,e({currentSessionId:de.sessionId,currentSessionRef:D,isTemporarySession:!1}),I=D}catch(Z){return $()&&e({error:Z.message}),!1}if(!D||!j||j===tc)return $()&&e({error:"Failed to create session"}),!1;try{if(!S){if(T=await t().prepareEventSubscription(D),!$())return m(T),T=null,!1;t().replaceEventSubscription(T),T=null}if(!$())return!1;const Z=p.content.trim();if(Z.startsWith("!")){if((((ce=p.attachments)==null?void 0:ce.length)??0)>0)throw new Error("User shell commands do not accept image attachments");const B=Z.slice(1).trim();if(!B)throw new Error("User shell command cannot be empty");S||e({isStreaming:!0,agentPhase:"running",error:null,errorContext:null});const Se=await X.executeUserShellCommand(D,B);return $()?(Se.auxiliary||e({isStreaming:!1,agentPhase:"idle"}),Se.delivery&&e({pendingSteeringCount:Se.queued??0,pendingInputDelivery:Se.delivery==="current_turn"?"current_turn":"next_turn"}),!0):!1}if((((le=p.attachments)==null?void 0:le.length)??0)===0&&(Z==="/goal"||Z.startsWith("/goal "))){M=`goal-command-${Date.now()}`,x({id:M,role:"user",content:Z,timestamp:Date.now()});const B=Z.slice(5).trim().split(/\s+/).filter(Boolean),Se=(xe=B[0])==null?void 0:xe.toLowerCase();if(!Se||Se==="status"){const Ae=await X.getGoal(D);return $()&&e({goal:Ae}),$()}if(Se==="clear")return await X.clearGoal(D),$()&&e({goal:null}),$();let qe;if(Se==="pause")qe=await X.updateGoal(D,{action:"pause"});else if(Se==="resume")qe=await X.updateGoal(D,{action:"resume"});else if(Se==="edit"){const Ae=B.slice(1).join(" ").trim();if(!Ae)throw new Error("Usage: /goal edit <objective>");qe=await X.updateGoal(D,{action:"edit",objective:Ae})}else{const Ae=B.lastIndexOf("--budget");let Jt;if(Ae>=0){const Qt=B[Ae+1];if(!Qt||!/^[1-9]\d*$/.test(Qt))throw new Error("--budget requires a positive integer");Jt=Number(Qt),B.splice(Ae,2)}const et=B.join(" ").trim();if(!et)throw new Error("Usage: /goal <objective>");const{currentMode:Ht}=Mt.getState();qe=await X.createGoal(D,et,Jt,Ht)}return $()?(e({goal:qe.goal,...qe.runId?{currentRunId:qe.runId,isStreaming:!0,agentPhase:"running"}:{}}),!0):!1}M=`temp-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,x({id:M,role:"user",content:KF(p),timestamp:Date.now()}),e({isStreaming:!0,error:null,errorContext:null,recoveredSteeringCount:S?t().recoveredSteeringCount:0});const{currentMode:de,currentModelId:R}=Mt.getState(),{modelId:ue,...ve}=p,He=ue??R??void 0,yt=p.reasoningEffort,We=p.serviceTier,tt=p.responseVerbosity,Y=p.communicationStyle,pt=He&&!S?{...ve,modelId:He}:ve,F=await X.sendMessage(D,pt,de);return $()?(e({currentRunId:F.runId,pendingSteeringCount:F.status==="steering_queued"||F.status==="follow_up_queued"?Math.max(0,F.queued??1):t().pendingSteeringCount,pendingInputDelivery:F.status==="steering_queued"?"current_turn":F.status==="follow_up_queued"?"next_turn":t().pendingInputDelivery,sessions:(He||yt||We||tt||Y)&&!S?t().sessions.map(B=>B.sessionId===D.sessionId&&B.projectPath===D.projectPath?{...B,...He?{selectedModelId:He}:{},...yt?{reasoningEffort:yt}:{},...We?{serviceTier:We}:{},...tt?{responseVerbosity:tt}:{},...Y?{communicationStyle:Y}:{}}:B):t().sessions}),!0):!1}catch(Z){return T&&m(T),$()?M&&!t().messages.some(de=>de.id===M)?!0:(e(de=>({error:Z.message,errorContext:{kind:"submission",sessionRef:D},messages:M?de.messages.filter(R=>R.id!==M):de.messages,...L})),!1):!1}},dismissSideConversation:()=>{d==null||d.abort("side-conversation-dismissed"),d=null,e({sideConversation:null})},loadTeams:async p=>{const h=p??t().currentSessionRef;if(!h||!Xr.getState().agentTeamsEnabled){e({teams:[]});return}const b=Re(h),k=o.get(b);if(k)return k;let S;S=(async()=>{try{const C=await np(h);if(!oe(t().currentSessionRef,h))return;e({teams:C})}catch{oe(t().currentSessionRef,h)&&e({teams:[]})}finally{o.get(b)===S&&o.delete(b)}})(),o.set(b,S),await S},abortSession:async()=>{const{currentSessionRef:p,isStopping:h}=t();if(!p||h)return!1;e({isStopping:!0,error:null,errorContext:null});try{return await X.abortSession(p),!oe(t().currentSessionRef,p)||(await t().resyncSessionMessages(p),!oe(t().currentSessionRef,p))?!1:(t().unsubscribeFromEvents(),e({isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},currentAssistantMessageId:null,hasToolCalls:!1}),!0)}catch(b){return oe(t().currentSessionRef,p)&&e({isStopping:!1,error:b instanceof Error?b.message:"Failed to stop task",errorContext:{kind:"task_action",sessionRef:p}}),!1}},pauseGoal:async()=>{const{currentSessionRef:p,isTemporarySession:h}=t();if(!p||h){e({error:"No persisted session is available for this goal"});return}try{const b=await X.updateGoal(p,{action:"pause"});if(!oe(t().currentSessionRef,p))return;e({goal:b.goal,error:null})}catch(b){if(!oe(t().currentSessionRef,p))return;e({error:b.message})}},resumeGoal:async()=>{const{currentSessionRef:p,isTemporarySession:h}=t();if(!p||h){e({error:"No persisted session is available for this goal"});return}try{const b=await X.updateGoal(p,{action:"resume"});if(!oe(t().currentSessionRef,p))return;e({goal:b.goal,error:null,...b.runId?{currentRunId:b.runId,isStreaming:!0,agentPhase:"running"}:{}})}catch(b){if(!oe(t().currentSessionRef,p))return;e({error:b.message})}},editGoal:async p=>{const{currentSessionRef:h,isTemporarySession:b}=t();if(!h||b){e({error:"No persisted session is available for this goal"});return}try{const k=await X.updateGoal(h,{action:"edit",objective:p});if(!oe(t().currentSessionRef,h))return;e({goal:k.goal,error:null,...k.runId?{currentRunId:k.runId,isStreaming:!0,agentPhase:"running"}:{}})}catch(k){if(!oe(t().currentSessionRef,h))return;e({error:k.message})}},clearGoal:async()=>{const{currentSessionRef:p,isTemporarySession:h}=t();if(!p||h){e({error:"No persisted session is available for this goal"});return}try{if(await X.clearGoal(p),!oe(t().currentSessionRef,p))return;e({goal:null,error:null})}catch(b){if(!oe(t().currentSessionRef,p))return;e({error:b.message})}}}},VF=(e,t)=>{const n=new WeakMap;let r=null;return{isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,sessionEventConnectionState:"idle",currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,pendingSubagentCompletions:{},eventUnsubscribe:null,currentAssistantMessageId:null,hasToolCalls:!1,setStreaming:s=>e({isStreaming:s}),setAgentPhase:s=>e({agentPhase:s}),setRunId:s=>e({currentRunId:s}),prepareEventSubscription:async(s,i)=>{const o=i??lu(t,e);let d=null,f="connecting";return d=await X.openEventSubscription(s,o,{onConnectionStateChange:u=>{f=u,d&&r===d&&e({sessionEventConnectionState:u})}}),n.set(d,f),d},replaceEventSubscription:s=>{const i=t().eventUnsubscribe;if(r=s,e({eventUnsubscribe:s,sessionEventConnectionState:s?n.get(s)??"connected":"idle"}),Ka.reset(),i&&i!==s)try{i()}catch(o){console.warn("Failed to clean up previous event subscription",o)}},setCurrentAssistantMessageId:s=>e({currentAssistantMessageId:s}),setHasToolCalls:s=>e({hasToolCalls:s}),startAgentResponse:s=>{e({currentAssistantMessageId:s,hasToolCalls:!1,isStreaming:!0,agentPhase:"running",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null})},endAgentResponse:()=>{Ka.drainAll(),e({currentAssistantMessageId:null,hasToolCalls:!1,isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null})},subscribeToEvents:async s=>{const i=await t().prepareEventSubscription(s);t().replaceEventSubscription(i)},reconnectSessionEvents:async()=>{const s=t().currentSessionRef;if(s){t().unsubscribeFromEvents(),e({sessionEventConnectionState:"connecting"});try{await t().subscribeToEvents(s)}catch(i){throw e({sessionEventConnectionState:"offline"}),i}}},unsubscribeFromEvents:()=>{const{eventUnsubscribe:s}=t();r=null,e({eventUnsubscribe:null,sessionEventConnectionState:"idle"});try{s==null||s()}catch(i){console.warn("Failed to clean up event subscription",i)}finally{Ka.reset()}},handleEvent:s=>{lu(t,e)(s)}}};function WF(e){var t;return((t=e.taskPromptSummary)==null?void 0:t.trimStart().startsWith("/review"))===!0}function Kd(e,t){var r;const n=(r=e.taskStatusReason)==null?void 0:r.trim();if(WF(e)){if(e.taskStatus==="running")return t("taskHome.review.running");if(n!=null&&n.startsWith("Code review stale:"))return t("taskHome.review.stale");if(n==="Code review aborted")return t("taskHome.review.aborted");if(n==="Code review interrupted by process restart")return t("taskHome.review.interrupted");if(e.taskStatus==="failed")return t("taskHome.review.failed")}return e.taskFailure?t(Sp(e.taskFailure.code)):n==="user-cancel"?t("session.reason.cancelledByUser"):n||void 0}let nc=0;function jo(e,t){const n=e.findIndex(s=>s.id===t.id);if(n===-1)return[...e,t];const r=e.slice();return r[n]=t,r}const JF=Qo(e=>({schedules:[],isLoading:!1,hasLoaded:!1,error:null,loadSchedules:async()=>{const t=++nc;e({isLoading:!0,error:null});try{const n=await X.listSchedules();if(t!==nc)return;e({schedules:n,isLoading:!1,hasLoaded:!0})}catch(n){if(t!==nc)return;e({error:n instanceof Error?n.message:Ke("schedule.error.loadFailed"),isLoading:!1,hasLoaded:!0})}},createSchedule:async t=>{e({error:null});try{const n=await X.createSchedule(t);return e(r=>({schedules:jo(r.schedules,n)})),n}catch(n){throw e({error:n instanceof Error?n.message:Ke("schedule.error.createFailed")}),n}},updateSchedule:async(t,n)=>{e({error:null});try{const r=await X.updateSchedule(t,n);return e(s=>({schedules:jo(s.schedules,r)})),r}catch(r){throw e({error:r instanceof Error?r.message:Ke("schedule.error.updateFailed")}),r}},deleteSchedule:async t=>{e({error:null});try{await X.deleteSchedule(t),e(n=>({schedules:n.schedules.filter(r=>r.id!==t)}))}catch(n){throw e({error:n instanceof Error?n.message:Ke("schedule.error.deleteFailed")}),n}},toggleSchedule:async(t,n)=>{e({error:null});try{const r=n?await X.enableSchedule(t):await X.disableSchedule(t);return e(s=>({schedules:jo(s.schedules,r)})),r}catch(r){throw e({error:r instanceof Error?r.message:Ke("schedule.error.toggleFailed")}),r}},runSchedule:async t=>{e({error:null});try{const n=await X.runSchedule(t);return e(r=>({schedules:jo(r.schedules,n)})),n}catch(n){throw e({error:n instanceof Error?n.message:Ke("schedule.error.runFailed")}),n}}})),zx="blade.projects.selected";function rp(){return typeof localStorage>"u"?null:localStorage.getItem(zx)}function Io(e){typeof localStorage<"u"&&localStorage.setItem(zx,e)}const QF=new Set(["queued","running","completed","failed","cancelled","interrupted"]),rc=new Set(["default","autoEdit","yolo","plan"]),sp=new Set(["auto","off","minimal","low","medium","high","xhigh","max"]),ip=new Set(["auto","standard","fast","flex"]),op=new Set(["auto","low","medium","high"]),ap=new Set(["auto","pragmatic","friendly","explanatory"]),cp=new Set(["high","medium","low"]),lp=new Set(["feature","bug","maintenance","research"]);function YF(e){return typeof e=="string"&&QF.has(e)}function ZF(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(!["changedFiles","additions","deletions","commits"].some(r=>typeof t[r]!="number"||!Number.isInteger(t[r])||t[r]<0))return{changedFiles:t.changedFiles,additions:t.additions,deletions:t.deletions,commits:t.commits}}function dp(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=G0(t.code);if(!(!n||typeof t.message!="string"||typeof t.retryable!="boolean"))return{code:n,message:Ke(Sp(n)),retryable:V0(n)}}function XF(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(!(!["applied","discarded","conflicted"].includes(String(t.status))||typeof t.updatedAt!="string"))return{status:t.status,updatedAt:t.updatedAt,...typeof t.sourceCommit=="string"?{sourceCommit:t.sourceCommit}:{},...typeof t.changedFiles=="number"&&Number.isInteger(t.changedFiles)&&t.changedFiles>=0?{changedFiles:t.changedFiles}:{},...typeof t.message=="string"?{message:t.message}:{}}}function vs(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=t?e:void 0}const e5=(e,t)=>{let n=null,r=!1,s=!1,i=0;const o=new Map,d=u=>{const m=Re(u),p=++i;o.set(m,p),X.getSession(u).then(h=>{o.get(m)===p&&e(b=>({sessions:hn(b.sessions,h)}))}).catch(()=>{o.get(m)===p&&t().loadSessions()}).finally(()=>{o.get(m)===p&&o.delete(m)})},f=u=>{const m=Re(u),p=++i;o.set(m,p),queueMicrotask(()=>{o.get(m)===p&&o.delete(m)})};return{taskEventsConnected:!1,taskEventConnectionState:"connecting",taskEventUnsubscribe:null,taskWorkspaceInfo:null,isTaskWorkspaceLoading:!1,taskWorkspaceError:null,boundProjects:[],selectedProjectPath:rp(),isDispatchingTask:!1,isUpdatingTaskAdmission:!1,isBindingProject:!1,cancellingTaskKeys:[],retryingTaskKeys:[],updatingTaskKeys:[],taskDeliveryActions:{},unreadTaskKeys:qF(),handleTaskEvent:u=>{if(u.type==="session.created"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;d({sessionId:I,projectPath:T});return}if(u.type==="session.deleted"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;const M={sessionId:I,projectPath:T};f(M),t().removeSession(M);return}if(u.type==="session.archived"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;const M={sessionId:I,projectPath:T};f(M),t().removeSession(M),t().loadArchivedSessions();return}if(u.type==="session.unarchived"){const I=u.properties.sessionId,T=u.properties.projectPath;if(typeof I!="string"||typeof T!="string")return;d({sessionId:I,projectPath:T}),t().loadArchivedSessions();return}if(u.type==="session.updated"){const I=u.properties.sessionId,T=u.properties.projectPath,M=u.properties.title,$=u.properties.selectedModelId,te=u.properties.permissionMode,O=u.properties.reasoningEffort,J=u.properties.serviceTier,ae=u.properties.responseVerbosity,ce=u.properties.communicationStyle,le=u.properties.taskPriority,xe=u.properties.taskKind,Z=u.properties.taskDueAt;if(typeof I!="string"||typeof T!="string"||!(typeof M=="string"&&M.trim()||typeof $=="string"&&$.trim()||rc.has(te)||sp.has(O)||ip.has(J)||op.has(ae)||ap.has(ce)||cp.has(le)||lp.has(xe)||Z===null||typeof Z=="string"&&Number.isFinite(Date.parse(Z))))return;const de={sessionId:I,projectPath:T};if(oe(t().currentSessionRef,de)&&rc.has(te)&&Mt.getState().setMode(te),!t().sessions.some(ue=>oe(he(ue),de))){d(de);return}e(ue=>({sessions:ue.sessions.map(ve=>oe({sessionId:ve.sessionId,projectPath:ve.projectPath},de)?{...ve,...typeof M=="string"&&M.trim()?{title:M}:{},...typeof $=="string"&&$.trim()?{selectedModelId:$}:{},...rc.has(te)?{permissionMode:te}:{},...sp.has(O)?{reasoningEffort:O}:{},...ip.has(J)?{serviceTier:J}:{},...op.has(ae)?{responseVerbosity:ae}:{},...ap.has(ce)?{communicationStyle:ce}:{},...cp.has(le)?{taskPriority:le}:{},...lp.has(xe)?{taskKind:xe}:{},...Z===null?{taskDueAt:void 0}:typeof Z=="string"&&Number.isFinite(Date.parse(Z))?{taskDueAt:Z}:{}}:ve)}));return}if(u.type==="task.delivery"){const I=u.properties.sessionId,T=u.properties.projectPath,M=XF(u.properties.taskDelivery);if(typeof I!="string"||typeof T!="string"||!M)return;const $={sessionId:I,projectPath:T},te=u.properties.taskWorktreeRemoved===!0;e(O=>({sessions:O.sessions.map(J=>oe(he(J),$)?{...J,taskDelivery:M,...te?{taskWorktreePath:void 0,taskWorktreeBranch:void 0}:{},lastMessageTime:typeof u.properties.updatedAt=="string"?u.properties.updatedAt:J.lastMessageTime}:J)}));return}if(u.type==="interaction.pending"){const I=u.properties.sessionId,T=u.properties.projectPath,M=u.properties.interactionType,$=u.properties.requestId;if(typeof I!="string"||typeof T!="string"||M!=="permission"&&M!=="question"&&M!=="elicitation"||typeof $!="string"||!$)return;const te={sessionId:I,projectPath:T},O=t().sessions.find(ae=>oe(he(ae),te));if(!O){t().loadSessions();return}if(e(ae=>({sessions:ae.sessions.map(ce=>oe(he(ce),te)?{...ce,pendingInteraction:{type:M,requestId:$}}:ce)})),!(typeof document<"u"&&document.visibilityState==="visible"&&oe(t().currentSessionRef,te))&&Xr.getState().notifyErrors){const ce=O.title??O.sessionId??I;ep({ref:te,title:`Blade · ${Ke(M==="question"?"attention.notification.question":M==="elicitation"?"attention.notification.elicitation":"attention.notification.permission")}`,body:ce,onOpen:le=>{typeof window>"u"||(window.focus(),window.dispatchEvent(new CustomEvent(Go,{detail:le})))}})}return}if(u.type==="interaction.resolved"){const I=u.properties.sessionId,T=u.properties.projectPath,M=u.properties.requestId;if(typeof I!="string"||typeof T!="string"||typeof M!="string")return;const $={sessionId:I,projectPath:T};e(te=>({sessions:te.sessions.map(O=>{var J;return oe(he(O),$)&&((J=O.pendingInteraction)==null?void 0:J.requestId)===M?{...O,pendingInteraction:void 0}:O})}));return}if(u.type==="schedule.fired"){JF.getState().loadSchedules();return}if(u.type!=="task.status")return;const m=u.properties.sessionId,p=u.properties.projectPath,h=u.properties.taskStatus;if(typeof m!="string"||typeof p!="string"||!YF(h))return;const b={sessionId:m,projectPath:p},k=vs(u.properties.taskInFlight,0),S=vs(u.properties.taskQueueDepth,0),C=vs(u.properties.taskConcurrencyLimit,1),x=typeof u.properties.taskAdmissionPaused=="boolean"?u.properties.taskAdmissionPaused:void 0;k!==void 0&&S!==void 0&&C!==void 0&&e(I=>{var T,M;return{taskWorkspaceInfo:I.taskWorkspaceInfo?{...I.taskWorkspaceInfo,taskAdmission:{inFlight:k,queued:S,maxConcurrent:C,maxQueued:((T=I.taskWorkspaceInfo.taskAdmission)==null?void 0:T.maxQueued)??100,paused:x??((M=I.taskWorkspaceInfo.taskAdmission)==null?void 0:M.paused)??!1}}:null}});const N=t().sessions.find(I=>oe(he(I),b)),P=typeof document<"u"&&document.visibilityState==="visible"&&oe(t().currentSessionRef,b),L=HF(N==null?void 0:N.taskStatus,h,P),D=Re(b),j=!t().unreadTaskKeys.includes(D);if(L&&j){e(M=>{const $=[...M.unreadTaskKeys,D];return hi($),{unreadTaskKeys:$}});const I=Xr.getState();if(I.notifySounds&&qx(h)&&zF(h),h==="completed"?I.notifyBuild:I.notifyErrors){const M=Ke(h==="completed"?"attention.notification.completed":h==="failed"?"attention.notification.failed":"attention.notification.interrupted"),$=dp(u.properties.taskFailure),te=N?Kd({...N,taskStatus:h,taskFailure:$??N.taskFailure,taskStatusReason:typeof u.properties.taskStatusReason=="string"?u.properties.taskStatusReason:N.taskStatusReason,taskPromptSummary:typeof u.properties.taskPromptSummary=="string"?u.properties.taskPromptSummary:N.taskPromptSummary},Ke):($==null?void 0:$.message)??(typeof u.properties.taskStatusReason=="string"?u.properties.taskStatusReason:void 0),O=(N==null?void 0:N.title)??(N==null?void 0:N.sessionId)??m;ep({ref:b,title:`Blade · ${M}`,body:te?`${O} · ${te}`:O,onOpen:J=>{typeof window>"u"||(window.focus(),window.dispatchEvent(new CustomEvent(Go,{detail:J})))}})}}if(!N){d(b);return}e(I=>({sessions:I.sessions.map(T=>oe({sessionId:T.sessionId,projectPath:T.projectPath},b)?{...T,taskStatus:h,taskStatusReason:typeof u.properties.taskStatusReason=="string"?u.properties.taskStatusReason:void 0,taskFailure:h==="failed"?dp(u.properties.taskFailure)??T.taskFailure:void 0,taskPromptSummary:typeof u.properties.taskPromptSummary=="string"?u.properties.taskPromptSummary:T.taskPromptSummary,taskStartedAt:typeof u.properties.taskStartedAt=="string"?u.properties.taskStartedAt:h==="queued"?void 0:T.taskStartedAt,taskCompletedAt:typeof u.properties.taskCompletedAt=="string"?u.properties.taskCompletedAt:h==="queued"||h==="running"?void 0:T.taskCompletedAt,taskDiffStat:ZF(u.properties.taskDiffStat)??T.taskDiffStat,taskQueuePosition:h==="queued"?vs(u.properties.taskQueuePosition,1)??T.taskQueuePosition:void 0,taskQueueDepth:h==="queued"?vs(u.properties.taskQueueDepth,0)??T.taskQueueDepth:void 0,taskConcurrencyLimit:vs(u.properties.taskConcurrencyLimit,1)??T.taskConcurrencyLimit,lastMessageTime:typeof u.properties.updatedAt=="string"?u.properties.updatedAt:T.lastMessageTime}:T)}))},subscribeToTaskEvents:async()=>{if(r=!0,!t().taskEventUnsubscribe){if(n)return n;e({taskEventsConnected:!1,taskEventConnectionState:"connecting"}),n=(async()=>{try{const u=await X.openTaskEventSubscription(m=>t().handleTaskEvent(m),{onConnectionChange:m=>{e({taskEventsConnected:m})},onConnectionStateChange:m=>{r&&(m==="reconnecting"||m==="offline")&&(s=!0),e({taskEventsConnected:m==="connected",taskEventConnectionState:m}),m==="connected"&&s&&(s=!1,Promise.all([t().loadSessions(),t().loadTaskWorkspaceInfo(),t().loadBoundProjects(),Mt.getState().loadModels()]))}});if(!r||t().taskEventUnsubscribe){u();return}e({taskEventUnsubscribe:u})}catch(u){throw s=!0,e({taskEventsConnected:!1,taskEventConnectionState:"offline"}),u}})();try{await n}finally{n=null}}},reconnectTaskEvents:async()=>{s=!0,t().unsubscribeFromTaskEvents(),await t().subscribeToTaskEvents()},unsubscribeFromTaskEvents:()=>{var u,m;r=!1,(m=(u=t()).taskEventUnsubscribe)==null||m.call(u),e({taskEventUnsubscribe:null,taskEventsConnected:!1,taskEventConnectionState:"offline"})},loadTaskWorkspaceInfo:async()=>{e({isTaskWorkspaceLoading:!0,taskWorkspaceError:null});try{const u=await X.getWorkspaceInfo();e({taskWorkspaceInfo:u,isTaskWorkspaceLoading:!1})}catch(u){e({isTaskWorkspaceLoading:!1,taskWorkspaceError:u instanceof Error?u.message:"Failed to load task workspace"})}},loadBoundProjects:async()=>{try{const u=await X.listProjects(),m=rp(),p=u.find(h=>h.available&&h.path===m)??u.find(h=>h.isCurrent)??u.find(h=>h.available);p&&Io(p.path),e({boundProjects:u,selectedProjectPath:(p==null?void 0:p.path)??null})}catch(u){e({error:u instanceof Error?u.message:"Failed to load projects"})}},bindProject:async u=>{e({isBindingProject:!0,error:null});try{const m=await X.bindProject(u);Io(m.path),e(p=>({boundProjects:[...p.boundProjects.filter(h=>h.path!==m.path),m].sort((h,b)=>h.isCurrent!==b.isCurrent?h.isCurrent?-1:1:h.name.localeCompare(b.name)),selectedProjectPath:m.path,isBindingProject:!1}))}catch(m){throw e({isBindingProject:!1,error:m instanceof Error?m.message:"Failed to bind project"}),m}},unbindProject:async u=>{try{await X.unbindProject(u),e(m=>{const p=m.boundProjects.filter(b=>b.path!==u||b.isCurrent),h=m.selectedProjectPath===u?p.find(b=>b.isCurrent)??p.find(b=>b.available):void 0;return h&&Io(h.path),{boundProjects:p,...h?{selectedProjectPath:h.path}:{}}})}catch(m){throw e({error:m instanceof Error?m.message:"Failed to unbind project"}),m}},selectProject:u=>{Io(u),e({selectedProjectPath:u})},markTaskRead:u=>{const m=Re(u);e(p=>{const h=p.unreadTaskKeys.filter(b=>b!==m);return hi(h),{unreadTaskKeys:h}})},clearUnreadTasks:()=>{hi([]),e({unreadTaskKeys:[]})},setTaskAdmissionPaused:async u=>{if(!t().isUpdatingTaskAdmission){e({isUpdatingTaskAdmission:!0,error:null,errorContext:null});try{const m=await X.setTaskAdmissionPaused(u);e(p=>({taskWorkspaceInfo:p.taskWorkspaceInfo?{...p.taskWorkspaceInfo,taskAdmission:m}:p.taskWorkspaceInfo}))}catch(m){throw e({error:m instanceof Error?m.message:"Failed to update task admission",errorContext:{kind:"task_action"}}),m}finally{e({isUpdatingTaskAdmission:!1})}}},updateTask:async(u,m)=>{const p=Re(u);if(!t().updatingTaskKeys.includes(p)){e(h=>({updatingTaskKeys:[...h.updatingTaskKeys,p],error:null,errorContext:null}));try{const h=await X.updateTask(u,m);e(b=>({sessions:hn(b.sessions,h)}))}catch(h){throw e({error:h instanceof Error?h.message:"Failed to update task",errorContext:{kind:"task_action",sessionRef:u}}),h}finally{e(h=>({updatingTaskKeys:h.updatingTaskKeys.filter(b=>b!==p)}))}}},cancelTask:async u=>{const m=Re(u);if(!t().cancellingTaskKeys.includes(m)){e(p=>({cancellingTaskKeys:[...p.cancellingTaskKeys,m],error:null,errorContext:null}));try{await X.abortSession(u);const p=oe(t().currentSessionRef,u);p&&(await t().resyncSessionMessages(u),oe(t().currentSessionRef,u)&&t().unsubscribeFromEvents()),e(h=>({sessions:h.sessions.map(b=>oe(he(b),u)?{...b,taskStatus:"cancelled",taskQueuePosition:void 0,taskQueueDepth:void 0,taskCompletedAt:b.taskCompletedAt??new Date().toISOString()}:b),...p?{isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,currentAssistantMessageId:null,hasToolCalls:!1,eventUnsubscribe:null}:{}}))}catch(p){throw e({error:p instanceof Error?p.message:"Failed to stop task",errorContext:{kind:"task_action",sessionRef:u}}),p}finally{e(p=>({cancellingTaskKeys:p.cancellingTaskKeys.filter(h=>h!==m)}))}}},retryTask:async u=>{const m=Re(u);if(t().retryingTaskKeys.includes(m))return;const p=t().getNavigationVersion(),h=t().selectedProjectPath,b=()=>t().getNavigationVersion()===p&&t().selectedProjectPath===h;e(k=>({retryingTaskKeys:[...k.retryingTaskKeys,m],error:null,errorContext:null}));try{const k=await X.retryTask(u);e(S=>({sessions:hn(S.sessions,k.session)})),t().markTaskRead(u),b()&&await t().selectSession(he(k.session))}catch(k){throw b()&&e({error:k instanceof Error?k.message:"Failed to retry task",errorContext:{kind:"task_action",sessionRef:u}}),k}finally{e(k=>({retryingTaskKeys:k.retryingTaskKeys.filter(S=>S!==m)}))}},deliverTask:async(u,m)=>{const p=Re(u);if(!t().taskDeliveryActions[p]){e(h=>({taskDeliveryActions:{...h.taskDeliveryActions,[p]:m},error:null,errorContext:null}));try{const h=await X.deliverTask(u,m);e(b=>({sessions:hn(b.sessions,h)})),t().markTaskRead(u)}catch(h){throw e({error:h instanceof Error?h.message:"Failed to deliver task changes",errorContext:{kind:"task_action",sessionRef:u}}),h}finally{e(h=>{const{[p]:b,...k}=h.taskDeliveryActions;return{taskDeliveryActions:k}})}}},dispatchTask:async(u,m)=>{const p=t().getNavigationVersion(),h=t().selectedProjectPath,b=u.projectPath??h??void 0,k=()=>t().getNavigationVersion()===p&&t().selectedProjectPath===h;e({isDispatchingTask:!0,error:null,errorContext:null});try{const S=await X.createTask({...u,projectPath:b});e(C=>({sessions:hn(C.sessions,S.session),isDispatchingTask:!1})),(m==null?void 0:m.selectSession)!==!1&&k()&&await t().selectSession(he(S.session))}catch(S){throw e({isDispatchingTask:!1,...k()?{error:S instanceof Error?S.message:"Failed to dispatch task"}:{}}),S}},startCodeReview:async u=>{const m=t().getNavigationVersion(),p=t().selectedProjectPath,h=u.projectPath??p??void 0,b=()=>t().getNavigationVersion()===m&&t().selectedProjectPath===p;e({isDispatchingTask:!0,error:null,errorContext:null});let k,S=!1;try{k=await X.createSession(h,"Code Review");const C=he(k);await X.startCodeReview(C,{kind:u.kind,...u.ref?{ref:u.ref}:{},...u.instructions?{instructions:u.instructions}:{},...u.modelId?{modelId:u.modelId}:{}}),S=!0;const x={...k,taskStatus:"running",taskStatusReason:Ke("taskHome.review.running"),taskPromptSummary:`/review ${u.kind}${u.ref?` ${u.ref}`:""}`};e(N=>({sessions:hn(N.sessions,x),isDispatchingTask:!1})),b()&&await t().selectSession(C)}catch(C){throw k&&!S&&await X.deleteSession(he(k)).catch(()=>{}),e({isDispatchingTask:!1,...b()?{error:C instanceof Error?C.message:Ke("taskHome.review.startFailed")}:{}}),C}}}},t5=e=>({tokenUsage:ci,updateTokenUsage:t=>e(n=>{const{costUsd:r,...s}=t;return{tokenUsage:{...n.tokenUsage,...s,totalInputTokens:n.tokenUsage.totalInputTokens+Math.max(0,t.inputTokens??0),totalOutputTokens:n.tokenUsage.totalOutputTokens+Math.max(0,t.outputTokens??0),cacheReadTokens:n.tokenUsage.cacheReadTokens+Math.max(0,t.cacheReadTokens??0),cacheWriteTokens:n.tokenUsage.cacheWriteTokens+Math.max(0,t.cacheWriteTokens??0),estimatedCostUsd:n.tokenUsage.estimatedCostUsd+Math.max(0,r??0)}}}),resetContextUsage:()=>e(t=>({tokenUsage:{...t.tokenUsage,inputTokens:0,outputTokens:0,totalTokens:0}})),setMaxContextTokens:(t,n=!1)=>e(r=>({tokenUsage:{...r.tokenUsage,maxContextTokens:t,isDefaultMaxTokens:n}}))}),H=Qo()((...e)=>({...GF(...e),...e5(...e),...RF(...e),...VF(...e),...t5(...e)}));function n5(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function r5({open:e,onOpenChange:t}){const n=Ut(),r=H(j=>j.currentSessionRef),s=H(j=>j.isStreaming),i=H(j=>j.isTemporarySession),o=H(j=>j.rewindSession),[d,f]=y.useState([]),[u,m]=y.useState(null),[p,h]=y.useState(!1),[b,k]=y.useState(!1),[S,C]=y.useState(!1),[x,N]=y.useState(null);y.useEffect(()=>{if(!e||!r)return;let j=!1;return k(!0),N(null),f([]),m(null),h(!1),X.listRewindCheckpoints(r).then(I=>{var T;j||(f(I),m(((T=I[0])==null?void 0:T.messageId)??null))}).catch(I=>{j||N(I instanceof Error?I.message:n("chat.rewind.loadFailed"))}).finally(()=>{j||k(!1)}),()=>{j=!0}},[r,e]);const P=y.useMemo(()=>d.find(j=>j.messageId===u)??null,[d,u]),L=!!P&&!b&&!S&&!s&&!i,D=async()=>{if(!P||!L)return;C(!0),N(null);const j=await o(P.messageId,p?"both":"conversation");C(!1),j?t(!1):N(n("chat.rewind.failed"))};return a.jsx(Wc,{open:e,onOpenChange:t,children:a.jsxs(Zo,{className:"max-w-[620px] gap-0 overflow-hidden border-[#E5E7EB] bg-white p-0 dark:border-zinc-800 dark:bg-[#09090b]",children:[a.jsx(Jc,{className:"border-b border-[#E5E7EB] px-6 py-5 dark:border-zinc-800",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-md bg-[#F3F4F6] text-[#4B5563] dark:bg-zinc-800 dark:text-zinc-300",children:a.jsx(mu,{className:"h-4 w-4"})}),a.jsxs("div",{children:[a.jsx(Xo,{className:"text-[15px] font-semibold text-[#111827] dark:text-zinc-100",children:n("chat.rewind.title")}),a.jsx(ea,{className:"mt-1 text-[12px] text-[#6B7280] dark:text-zinc-400",children:n("chat.rewind.description")})]})]})}),a.jsxs("div",{className:"min-h-[260px] px-6 py-4",children:[b&&a.jsxs("div",{className:"flex h-[220px] items-center justify-center text-[#6B7280] dark:text-zinc-400",children:[a.jsx(mt,{className:"mr-2 h-4 w-4 animate-spin"}),a.jsx("span",{className:"text-xs font-mono",children:n("chat.rewind.loading")})]}),!b&&x&&a.jsx("div",{role:"alert",className:"rounded-md border border-rose-200 bg-rose-50 px-4 py-3 text-xs text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300",children:x}),!b&&!x&&d.length===0&&a.jsxs("div",{className:"flex h-[220px] flex-col items-center justify-center text-center",children:[a.jsx(mu,{className:"mb-3 h-5 w-5 text-[#9CA3AF] dark:text-zinc-600"}),a.jsx("p",{className:"text-sm text-[#4B5563] dark:text-zinc-300",children:n("chat.rewind.empty")})]}),!b&&d.length>0&&a.jsx("div",{role:"radiogroup","aria-label":n("chat.rewind.checkpointAria"),className:"max-h-[310px] space-y-1 overflow-y-auto",children:d.map(j=>{const I=j.messageId===u;return a.jsxs("button",{type:"button",role:"radio","aria-checked":I,onClick:()=>m(j.messageId),className:W("w-full rounded-md border px-4 py-3 text-left transition-colors",I?"border-[#22C55E] bg-[#F0FDF4] dark:border-[#22C55E] dark:bg-[#052E16]/50":"border-transparent hover:bg-[#F9FAFB] dark:hover:bg-zinc-900"),children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsx("p",{className:"line-clamp-2 text-[13px] leading-5 text-[#111827] dark:text-zinc-100",children:j.preview||n("chat.rewind.userMessage")}),a.jsx("span",{className:"shrink-0 text-[10px] font-mono text-[#9CA3AF] dark:text-zinc-500",children:n5(j.createdAt)})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-3 text-[10px] font-mono text-[#6B7280] dark:text-zinc-500",children:[a.jsx("span",{children:j.messageId.slice(0,10)}),j.fileCount>0&&a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(sy,{className:"h-3 w-3"}),j.fileCount===1?n("chat.rewind.fileCountOne",{count:j.fileCount}):n("chat.rewind.fileCountMany",{count:j.fileCount})]})]})]},j.messageId)})})]}),a.jsx("div",{className:"border-t border-[#E5E7EB] px-6 py-4 dark:border-zinc-800",children:a.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[a.jsx("input",{type:"checkbox",checked:p,disabled:!P||P.fileCount===0,onChange:j=>h(j.target.checked),className:"mt-0.5 h-4 w-4 accent-[#16A34A] disabled:opacity-40"}),a.jsxs("span",{children:[a.jsx("span",{className:"block text-[12px] font-medium text-[#374151] dark:text-zinc-200",children:n("chat.rewind.restoreCode")}),a.jsx("span",{className:"mt-0.5 block text-[11px] text-[#6B7280] dark:text-zinc-500",children:n("chat.rewind.restoreCodeHint")})]})]})}),a.jsxs(Hp,{className:"border-t border-[#E5E7EB] px-6 py-4 dark:border-zinc-800",children:[a.jsx(Kr,{variant:"ghost",onClick:()=>t(!1),disabled:S,children:n("chat.rewind.cancel")}),a.jsxs(Kr,{onClick:()=>void D(),disabled:!L,className:"bg-[#16A34A] text-white hover:bg-[#15803D]",children:[S?a.jsx(mt,{className:"mr-2 h-4 w-4 animate-spin"}):a.jsx(Yo,{className:"mr-2 h-4 w-4"}),n("chat.rewind.confirm")]})]})]})})}function Kx({inFlight:e,queued:t,maxConcurrent:n,compact:r=!1,className:s}){const i=Ut(),o=Math.max(1,n),d=Array.from({length:Math.min(o,12)}),f=Math.min(e,o);return a.jsxs("div",{className:W("inline-flex items-center gap-2 font-mono",r?"text-[10.5px]":"text-[11px]",s),title:i("capacity.title",{inFlight:e,queued:t,max:n}),children:[a.jsx("span",{className:W("inline-flex items-center gap-[3px] rounded-sm",r?"px-0":"px-0.5"),children:d.map((u,m)=>{const p=m<f;return a.jsx("span",{className:W("block",r?"h-2.5 w-[3px] rounded-[1px]":"h-3 w-[3px] rounded-[1px]",p?"bg-[hsl(var(--deck-accent))] shadow-[0_0_4px_hsl(var(--deck-accent)/0.65)]":"bg-[hsl(var(--deck-border-strong))]/60")},m)})}),a.jsxs("span",{className:"tabular-nums text-[hsl(var(--deck-ink-muted))]",children:[a.jsx("span",{className:"text-[hsl(var(--deck-ink))]",children:e}),a.jsx("span",{className:"mx-[2px] opacity-40",children:"/"}),a.jsx("span",{children:n}),a.jsx("span",{className:"opacity-60",children:i("capacity.suffix.running")})]}),t>0&&a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm border border-amber-300/60 bg-amber-50 px-1.5 py-[1px] text-[10px] text-amber-800 dark:border-amber-800/60 dark:bg-amber-950/40 dark:text-amber-300",children:[a.jsx("span",{className:"h-1 w-1 rounded-full bg-amber-500"}),i("capacity.queued",{queued:t})]})]})}function up(){const e=document.querySelector("textarea[data-blade-composer]:not(:disabled)");if(!e)return!1;e.focus();const t=e.value.length;return e.setSelectionRange(t,t),!0}const Gx=[{id:"searchTasks",key:"k",primaryModifier:!0,scope:"Global"},{id:"openCommands",key:"p",primaryModifier:!0,shiftKey:!0,scope:"Global"},{id:"newTask",key:"n",primaryModifier:!1,scope:"Global"},{id:"focusComposer",key:"/",primaryModifier:!1,scope:"Chat"},{id:"toggleSidebar",key:"b",primaryModifier:!0,scope:"Layout"}];function s5(e){const t=e.key.toLocaleLowerCase();return Gx.find(n=>{if(n.key!==t||e.altKey||e.shiftKey!==!!n.shiftKey)return!1;const r=e.metaKey||e.ctrlKey;return n.primaryModifier?r:!r})??null}function i5(e){return e instanceof Element?!!e.closest('input, textarea, select, [contenteditable="true"], [role="textbox"], [role="combobox"]'):!1}function o5(e){var r;const t=typeof navigator>"u"?null:navigator,n=((r=t==null?void 0:t.userAgentData)==null?void 0:r.platform)??(t==null?void 0:t.platform)??"";return/mac|iphone|ipad|ipod/i.test(n)}function a5(e,t){const n=e.key==="/"?"/":e.key.toLocaleUpperCase(),r=o5();return[...e.primaryModifier?[r?"⌘":"Ctrl"]:[],...e.shiftKey?[r?"⇧":"Shift"]:[],n]}function Fc(e,t){const n=Gx.find(r=>r.id===e);return n?a5(n).join(""):""}function c5(){const e=sn(s=>s.setTaskSwitcherOpen),t=sn(s=>s.setMainView),n=sn(s=>s.toggleSidebar),r=H(s=>s.startTemporarySession);y.useEffect(()=>{const s=i=>{if(i.repeat)return;const o=s5(i);if(!o)return;const d=sn.getState(),f=d.isTaskSwitcherOpen,u=i5(i.target),m=!!document.querySelector('[role="dialog"]');if(o.id==="searchTasks"||o.id==="openCommands"){if(m&&!f)return;i.preventDefault();const p=o.id==="searchTasks"?"tasks":"commands",h=f&&d.taskSwitcherMode===p;e(!h,p);return}if(!(u||m)){if(o.id==="newTask"){i.preventDefault(),t("workspace"),r(),requestAnimationFrame(()=>up());return}if(o.id==="focusComposer"){up()&&i.preventDefault();return}o.id==="toggleSidebar"&&(i.preventDefault(),n())}};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,e,r,n])}const Gd=y.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(yp,{ref:r,className:W("overflow-hidden relative",e),...n,children:[a.jsx(F0,{className:"h-full w-full rounded-[inherit] [&>div]:!block !overflow-auto",children:t}),a.jsx(Vx,{}),a.jsx(L0,{})]}));Gd.displayName=yp.displayName;const Vx=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>a.jsx(wp,{ref:r,orientation:t,className:W("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:a.jsx(D0,{className:"relative flex-1 rounded-full bg-border"})}));Vx.displayName=wp.displayName;function gi(e,t){var s;const n=(s=e.title)==null?void 0:s.trim();if(n==="Code Review")return t("session.title.codeReview");if(n)return n;const r=e.firstMessageTime||e.lastMessageTime;if(r){const i=new Date(r);if(!Number.isNaN(i.getTime()))return t("recent.session.fallbackDated",{y:String(i.getFullYear()).slice(-2),m:String(i.getMonth()+1).padStart(2,"0"),d:String(i.getDate()).padStart(2,"0"),hh:String(i.getHours()).padStart(2,"0"),mm:String(i.getMinutes()).padStart(2,"0")})}return t("recent.session.fallbackShort",{id:e.sessionId.slice(0,6)})}async function Wx(e,t=!1){const n=await X.exportSessionMarkdown(e,t),r=new Blob([n.markdown],{type:"text/markdown;charset=utf-8"}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=n.filename,i.hidden=!0,document.body.appendChild(i);try{i.click()}finally{i.remove(),await new Promise(o=>{window.setTimeout(()=>{URL.revokeObjectURL(s),o()},0)})}return n}const Yn=U0,Zn=B0,_n=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(_0,{children:a.jsx(vp,{ref:s,align:t,sideOffset:n,className:W("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 origin-[--radix-popover-content-transform-origin]",e),...r})}));_n.displayName=vp.displayName;function l5(){const e=Ut(),t=H(k=>k.archivedSessions),n=H(k=>k.archivedCatalogLoadState),r=H(k=>k.archivedCatalogError),s=H(k=>k.loadArchivedSessions),i=H(k=>k.unarchiveSession),o=H(k=>k.setError),[d,f]=y.useState(!1),[u,m]=y.useState(null),[p,h]=y.useState(null),b=k=>{f(k),k&&s()};return a.jsxs(Yn,{open:d,onOpenChange:b,children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex h-8 w-full items-center justify-between rounded-md px-2.5 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]","aria-label":e("archive.open"),children:[a.jsxs("span",{className:"flex items-center gap-2.5",children:[a.jsx(jp,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),e("archive.title")]}),t.length>0&&a.jsx("span",{className:"rounded-sm bg-[hsl(var(--deck-surface))] px-1.5 py-0.5 text-[9px] text-[hsl(var(--deck-ink-faint))]",children:t.length})]})}),a.jsxs(_n,{role:"dialog","aria-label":e("archive.title"),side:"right",align:"end",sideOffset:8,className:"w-[340px] overflow-hidden p-0",children:[a.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-[hsl(var(--deck-hairline))] px-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.08em] text-[hsl(var(--deck-ink))]",children:e("archive.title")}),a.jsx("div",{className:"text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:e("archive.subtitle")})]}),a.jsx("button",{type:"button",onClick:()=>void s(),"aria-label":e("archive.refresh"),className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(di,{className:W("h-3 w-3",(n==="loading"||n==="hydrating")&&"animate-spin")})})]}),r?a.jsxs("div",{className:"px-3 py-4 text-[11px] text-red-600 dark:text-red-400",children:[a.jsx("div",{children:r}),a.jsx("button",{type:"button",onClick:()=>void s(),className:"mt-2 font-mono text-[10px] text-[hsl(var(--deck-accent))] focus-visible:outline-none focus-visible:underline",children:e("archive.retry")})]}):t.length===0&&(n==="loading"||n==="hydrating")?a.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(mt,{className:"h-3 w-3 animate-spin"}),e("archive.loading")]}):t.length===0?a.jsx("div",{className:"flex h-24 items-center justify-center px-6 text-center text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:e("archive.empty")}):a.jsx(Gd,{className:"max-h-[340px]",children:a.jsx("div",{className:"divide-y divide-[hsl(var(--deck-hairline))]",children:t.map(k=>{var P;const S=he(k),C=Re(S),x=u===C,N=k.projectPath.split("/").filter(Boolean).at(-1)??k.projectPath;return a.jsxs("div",{className:"flex min-h-[58px] items-center gap-2 px-3 py-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-[11.5px] text-[hsl(var(--deck-ink))]",children:gi(k,e)}),a.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx("span",{className:"truncate",children:N}),k.archivedAt&&a.jsxs(a.Fragment,{children:[a.jsx("span",{"aria-hidden":!0,children:"·"}),a.jsx("span",{children:new Date(k.archivedAt).toLocaleString()})]})]}),k.archivedBySessionId!==k.sessionId&&a.jsx("div",{className:"mt-0.5 truncate text-[9px] text-[hsl(var(--deck-accent))]",children:e("archive.inherited",{id:((P=k.archivedBySessionId)==null?void 0:P.slice(0,8))??""})})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[a.jsx("button",{type:"button",disabled:p!==null,onClick:async()=>{h(C);try{await Wx(S)}catch(L){o(L instanceof Error?L.message:"Session export failed")}finally{h(null)}},"aria-label":e("session.action.export",{title:gi(k,e)}),title:e("session.action.exportShort"),className:"flex h-7 w-7 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-35",children:p===C?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Ep,{className:"h-3.5 w-3.5"})}),a.jsx("button",{type:"button",disabled:x||k.archivedBySessionId!==k.sessionId,onClick:async()=>{m(C);try{await i(S)}finally{m(null)}},"aria-label":e("archive.restore",{title:gi(k,e)}),title:k.archivedBySessionId!==k.sessionId?e("archive.restoreAncestor"):e("archive.restoreShort"),className:"flex h-7 w-7 items-center justify-center rounded text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-35",children:x?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Z0,{className:"h-3.5 w-3.5"})})]})]},C)})})})]})]})}function Vd({className:e,size:t=28,pulse:n=!0}){return a.jsxs("span",{className:W("inline-flex relative justify-center items-center","text-[hsl(var(--deck-ink))]",e),style:{width:t,height:t},"aria-hidden":"true",children:[a.jsxs("svg",{viewBox:"0 0 32 32",width:t,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M16 3 L28 16 L16 29 L4 16 Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("path",{d:"M16 8 L24 16 L16 24",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round",opacity:"0.55"}),a.jsx("path",{d:"M16 3 L20 7",stroke:"hsl(var(--deck-accent))",strokeWidth:"2",strokeLinecap:"round"})]}),n&&a.jsx("span",{className:"absolute top-[3px] right-[3px] h-1.5 w-1.5 rounded-full",style:{background:"hsl(var(--deck-accent-glow))",boxShadow:"0 0 6px hsl(var(--deck-accent-glow) / 0.9)"}})]})}const pp={en:"sidebar.language.en",zh:"sidebar.language.zh"};function Jx({className:e,variant:t="pill"}){const{locale:n,setLocale:r}=cw(),s=Ut();if(t==="compact"){const i=n==="en"?"zh":"en";return a.jsx("button",{type:"button",onClick:()=>r(i),"aria-label":s("sidebar.language.aria"),title:s("sidebar.language.label"),className:W("flex justify-center items-center w-10 h-10 font-mono font-medium rounded-md transition-colors text-[11px] text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",e),children:s(pp[n])})}return a.jsx("div",{role:"group","aria-label":s("sidebar.language.aria"),className:W("inline-flex h-8 items-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-[2px] font-mono text-[11px]",e),children:rw.map(i=>{const o=i===n;return a.jsx("button",{type:"button",onClick:()=>r(i),"aria-pressed":o,className:W("flex justify-center items-center px-2 h-full transition-colors min-w-[28px] rounded-[4px]",o?"bg-[hsl(var(--deck-ink))] text-[hsl(var(--deck-canvas))]":"text-[hsl(var(--deck-ink-muted))] hover:text-[hsl(var(--deck-ink))]"),children:s(pp[i])},i)})})}const d5="[data-mobile-navigation-trigger]";function v3(e){return Qx(d5,e)}function Qx(e,t){const n=document.querySelector(e);return!n||n.getClientRects().length===0?!1:(t.preventDefault(),n.focus({preventScroll:!0}),!0)}function Yx({open:e,onOpenChange:t}){const n=Ut(),{boundProjects:r,selectedProjectPath:s,isBindingProject:i,loadBoundProjects:o,bindProject:d,unbindProject:f,selectProject:u,startTemporarySession:m}=H(),[p,h]=y.useState(""),[b,k]=y.useState(null),[S,C]=y.useState(!1),x=y.useRef(0);y.useEffect(()=>{if(e){o();return}x.current+=1,C(!1)},[o,e]);const N=async j=>{await d(j),h(""),m(),t(!1)},P=async j=>{if(j.preventDefault(),!(!p.trim()||i||S)){k(null);try{await N(p.trim())}catch(I){k(I instanceof Error?I.message:n("projects.bind.failed"))}}},L=async()=>{if(S||i)return;const j=++x.current;k(null),C(!0);try{const I=await X.pickProjectDirectory();if(j!==x.current||I.cancelled)return;h(I.path),await N(I.path)}catch(I){if(j!==x.current)return;k(I instanceof Error?I.message:n("projects.pick.failed"))}finally{j===x.current&&C(!1)}},D=j=>{u(j),m(),t(!1)};return e?a.jsx(Wc,{open:e,onOpenChange:t,children:a.jsxs(Zo,{onCloseAutoFocus:j=>Qx("[data-project-setup-trigger]",j),className:"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-ink))] sm:max-w-xl",children:[a.jsxs(Jc,{children:[a.jsxs(Xo,{className:"flex items-center gap-2 font-mono text-[16px]",children:[a.jsx(Ro,{className:"h-4 w-4 text-[hsl(var(--deck-accent))]"}),n("projects.dialog.title")]}),a.jsx(ea,{className:"text-[12px] text-[hsl(var(--deck-ink-muted))]",children:n("projects.dialog.description")})]}),a.jsxs("form",{onSubmit:P,className:"flex gap-2",children:[a.jsx("input",{value:p,onChange:j=>h(j.target.value),disabled:i,placeholder:n("projects.bind.placeholder"),"aria-label":n("projects.bind.pathLabel"),className:"h-9 min-w-0 flex-1 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 font-mono text-[12px] outline-none placeholder:text-[hsl(var(--deck-ink-faint))] focus:border-[hsl(var(--deck-accent)/0.65)]"}),a.jsxs("button",{type:"button",onClick:()=>void L(),disabled:S||i,title:n("projects.pick.action"),"aria-label":n("projects.pick.action"),className:"inline-flex h-9 shrink-0 items-center gap-2 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-2.5 font-mono text-[12px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))] disabled:cursor-wait disabled:opacity-50",children:[S?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(iy,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"hidden sm:inline",children:n(S?"projects.pick.picking":"projects.pick.actionShort")})]}),a.jsxs("button",{type:"submit",disabled:!p.trim()||i||S,className:"inline-flex h-9 items-center gap-2 rounded-md bg-[hsl(var(--deck-ink))] px-3 font-mono text-[12px] text-[hsl(var(--deck-canvas))] transition-opacity disabled:opacity-40",children:[i?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Ro,{className:"h-3.5 w-3.5"}),n("projects.bind.action")]})]}),b&&a.jsx("div",{role:"alert",className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 font-mono text-[11px] text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300",children:b}),a.jsx("div",{className:"max-h-72 space-y-1 overflow-y-auto",children:r.map(j=>{const I=j.path===s;return a.jsxs("div",{className:W("group flex items-center gap-3 rounded-md border px-3 py-2",I?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))]":"border-transparent hover:border-[hsl(var(--deck-border))] hover:bg-[hsl(var(--deck-surface))]"),children:[a.jsx(li,{className:W("h-4 w-4 shrink-0",I?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]")}),a.jsxs("button",{type:"button",disabled:!j.available,onClick:()=>D(j.path),className:"min-w-0 flex-1 text-left disabled:cursor-not-allowed disabled:opacity-50",children:[a.jsx("span",{className:"block truncate font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:j.name}),a.jsxs("span",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[j.gitBranch&&a.jsxs(a.Fragment,{children:[a.jsx(qc,{className:"h-2.5 w-2.5"}),a.jsx("span",{children:j.gitBranch}),a.jsx("span",{children:"·"})]}),a.jsx("span",{className:"truncate",children:j.path}),!j.available&&a.jsxs("span",{className:"shrink-0 text-red-500",children:["· ",n("projects.unavailable")]})]})]}),!j.isCurrent&&a.jsx("button",{type:"button",onClick:()=>void f(j.path).catch(()=>{}),title:n("projects.unbind.action"),"aria-label":n("projects.unbind.action"),className:"rounded p-1.5 text-[hsl(var(--deck-ink-faint))] opacity-0 transition group-hover:opacity-100 hover:bg-red-50 hover:text-red-600 focus-visible:opacity-100 dark:hover:bg-red-950/30",children:a.jsx(Rp,{className:"h-3.5 w-3.5"})})]},j.path)})})]})}):null}const u5={running:"bg-blue-500 dark:bg-blue-400 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse",queued:"bg-amber-400 dark:bg-amber-300",interrupted:"bg-orange-500 dark:bg-orange-400",failed:"bg-red-500 dark:bg-red-400",cancelled:"bg-zinc-400 dark:bg-zinc-500",completed:"bg-[hsl(var(--deck-accent))]"};function p5({session:e,isActive:t,isForking:n,isUnread:r,anyForking:s,isEditing:i,editingTitle:o,title:d,context:f,isCancelling:u,isRetrying:m,isExporting:p,onSelect:h,onCancelTask:b,onRetryTask:k,onFork:S,onArchive:C,onExport:x,onStartRename:N,onDelete:P,onEditingTitleChange:L,onSaveRename:D,onCancelRename:j}){const I=Ut(),[T,M]=y.useState(!1),$=y.useRef(null),te=y.useRef(null);return i?a.jsxs("div",{className:"flex h-9 w-full items-center gap-2 bg-[hsl(var(--deck-surface))] px-3",children:[a.jsx("input",{type:"text",value:o,onChange:O=>L(O.target.value),onKeyDown:O=>{O.key==="Enter"&&D(),O.key==="Escape"&&j()},autoFocus:!0,className:"flex-1 rounded bg-[hsl(var(--deck-canvas))] px-2 py-1 font-mono text-[13px] text-[hsl(var(--deck-ink))] outline-none focus:ring-1 focus:ring-[hsl(var(--deck-accent))]"}),a.jsx("button",{"aria-label":I("session.action.save",{title:d}),onClick:D,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-accent))] hover:bg-[hsl(var(--deck-canvas))]",children:a.jsx(Ip,{className:"w-3 h-3"})}),a.jsx("button",{"aria-label":I("session.action.cancel",{title:d}),onClick:j,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-canvas))]",children:a.jsx(ui,{className:"w-3 h-3"})})]}):a.jsxs("div",{className:W("flex relative items-center w-full transition-colors group min-h-[54px]",t?"bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:[t&&a.jsx("span",{className:"absolute left-0 top-1/2 h-6 w-[2px] -translate-y-1/2 rounded-r bg-[hsl(var(--deck-accent))]"}),a.jsxs("button",{type:"button","aria-label":I("session.action.select",{title:d}),"aria-current":t?"true":void 0,"aria-busy":n?"true":void 0,onClick:h,className:"flex min-h-[54px] min-w-0 flex-1 cursor-pointer items-center gap-2 py-1.5 pl-4 pr-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx("span",{className:W("h-1.5 w-1.5 shrink-0 rounded-full",e.pendingInteraction?"animate-pulse bg-amber-500 shadow-[0_0_5px_rgba(245,158,11,0.75)]":u5[e.taskStatus]),title:e.pendingInteraction?I(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"):e.taskStatus}),a.jsxs("span",{className:"flex-1 min-w-0 font-mono",children:[a.jsxs("span",{className:W("flex gap-2 items-center text-left truncate text-[12px]",t?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:[a.jsx("span",{className:"truncate",children:d}),r&&a.jsx("span",{title:I("taskSwitcher.new"),className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.75)]"}),e.pendingInteraction&&a.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-amber-100 px-1.5 py-0.5 text-[8.5px] text-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:I(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"),children:[a.jsx(Ns,{className:"h-2.5 w-2.5"}),I(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission")]}),e.relationType==="fork"&&e.parentId&&a.jsxs("span",{title:`${I("session.forkedFrom")} ${e.parentId.slice(0,6)}`,"aria-label":`${I("session.forkedFrom")} ${e.parentId.slice(0,6)}`,className:"shrink-0 text-[9px] text-[hsl(var(--deck-accent))]",children:[I("session.forkedFrom")," ",e.parentId.slice(0,6)]}),e.taskRetriedFrom&&a.jsx("span",{title:`${I("session.retriedFrom")} ${e.taskRetriedFrom.sessionId.slice(0,6)}`,className:"shrink-0 text-[9px] text-[hsl(var(--deck-accent))]",children:I("session.retryShort")})]}),a.jsxs("span",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 truncate text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx("span",{className:"truncate",children:f.project}),a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"truncate",children:f.environment}),f.queue&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"text-amber-700 truncate dark:text-amber-400",children:f.queue})]}),f.diff&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"truncate text-[hsl(var(--deck-accent))]",children:f.diff})]})]}),f.reason&&a.jsx("span",{title:f.reason,className:"mt-0.5 block truncate text-[9.5px] text-red-600 dark:text-red-400",children:f.reason})]}),n&&a.jsx(mt,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"})]}),a.jsxs("div",{className:W("flex items-center gap-0.5 pr-2 transition-opacity group-focus-within:opacity-100",e.taskStatus==="running"||e.taskStatus==="queued"||e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled")?"opacity-100":"opacity-50 group-hover:opacity-100"),children:[(e.taskStatus==="running"||e.taskStatus==="queued")&&a.jsx("button",{type:"button","aria-label":I(u?"session.action.stopping":"session.action.stop",{title:d}),disabled:u,onClick:O=>{O.stopPropagation(),b()},className:"flex h-6 w-6 items-center justify-center rounded text-red-500 transition-colors hover:bg-red-500/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:cursor-wait disabled:opacity-60",children:u?a.jsx(mt,{className:"h-3 w-3 animate-spin"}):a.jsx(Gc,{className:"h-3 w-3"})}),e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled")&&a.jsx("button",{ref:$,type:"button","aria-label":I(m?"session.action.retrying":"session.action.retry",{title:d}),disabled:m,onClick:O=>{O.stopPropagation(),k()},className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-60",children:m?a.jsx(mt,{className:"h-3 w-3 animate-spin"}):a.jsx(Yo,{className:"h-3 w-3"})}),a.jsxs(Yn,{open:T,onOpenChange:M,children:[a.jsx(Zn,{asChild:!0,children:a.jsx("button",{type:"button","aria-label":I("session.action.more",{title:d}),"aria-expanded":T,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-canvas))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(fy,{className:"h-3.5 w-3.5"})})}),a.jsxs(_n,{ref:te,role:"menu","aria-label":I("session.action.more",{title:d}),side:"right",align:"start",sideOffset:6,className:"w-40 p-1",onOpenAutoFocus:O=>{var J,ae;O.preventDefault(),(ae=(J=te.current)==null?void 0:J.querySelector('[role="menuitem"]:not([disabled])'))==null||ae.focus()},onKeyDown:O=>{O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),M(!1),window.setTimeout(()=>{var J;return(J=$.current)==null?void 0:J.focus()},0))},children:[a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.fork",{title:d}),disabled:s,onClick:O=>{O.stopPropagation(),S(),M(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-45",children:[a.jsx(oy,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.forkShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.rename",{title:d}),onClick:O=>{N(O),M(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none",children:[a.jsx(hy,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.renameShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.archive",{title:d}),disabled:e.taskStatus==="running"||e.taskStatus==="queued",onClick:O=>{O.stopPropagation(),C(),M(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-35",children:[a.jsx(jp,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.archiveShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.export",{title:d}),disabled:p,onClick:O=>{O.stopPropagation(),x(),M(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-wait disabled:opacity-45",children:[p?a.jsx(mt,{className:"h-3 w-3 animate-spin","aria-hidden":!0}):a.jsx(Ep,{className:"h-3 w-3","aria-hidden":!0}),I(p?"session.action.exportingShort":"session.action.exportShort")]}),a.jsxs("button",{type:"button",role:"menuitem","aria-label":I("session.action.delete",{title:d}),onClick:O=>{P(O),M(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-red-600 transition-colors hover:bg-red-500/10 focus-visible:bg-red-500/10 focus-visible:outline-none dark:text-red-400",children:[a.jsx(Rp,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.deleteShort")]})]})]})]})]})}function f5({onExpand:e,onNewChat:t,onOpenBoard:n,onOpenTaskSwitcher:r,onToggleTerminal:s,onToggleSettings:i,isTerminalOpen:o,taskEventsConnected:d,unreadCount:f,boardActive:u,className:m}){const p=Ut(),h=[{icon:Ap,action:i,labelKey:"sidebar.section.settings"}];return a.jsxs("div",{className:W("flex flex-col gap-2 items-center py-5 h-screen border-r w-[64px] border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]",m),children:[a.jsx("button",{onClick:e,className:"rounded-md p-1 transition-colors hover:bg-[hsl(var(--deck-surface))]","aria-label":p("sidebar.action.expand"),children:a.jsx(Vd,{size:28})}),a.jsx("button",{onClick:t,"aria-label":p("sidebar.action.newTaskShort"),title:p("sidebar.action.newTaskShort"),className:"mt-6 flex h-10 w-10 items-center justify-center rounded-md bg-[hsl(var(--deck-ink))] text-[hsl(var(--deck-canvas))] transition-colors hover:bg-[hsl(var(--deck-ink))]/85",children:a.jsx(zc,{className:"h-4 w-4 stroke-[2.5]"})}),a.jsx("button",{type:"button",onClick:n,"aria-label":p("sidebar.action.taskBoard"),"aria-current":u?"page":void 0,title:p("sidebar.action.taskBoard"),className:W("flex h-10 w-10 items-center justify-center rounded-md border transition-colors",u?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-transparent text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]"),children:a.jsx(Tp,{className:"h-4 w-4"})}),a.jsx("button",{onClick:s,"aria-label":p("sidebar.action.terminalToggle"),title:p("sidebar.action.terminal"),className:W("flex h-10 w-10 items-center justify-center rounded-md border transition-colors",o?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-transparent text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]"),children:a.jsx(Op,{className:"w-4 h-4"})}),a.jsxs("button",{onClick:r,"aria-label":p("sidebar.action.searchTasks"),title:`${p("sidebar.action.searchTasks")} (${Fc("searchTasks")})`,className:"relative flex h-10 w-10 items-center justify-center rounded-md border border-transparent text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:[a.jsx(Kc,{className:"h-4 w-4"}),f>0&&a.jsx("span",{"aria-label":p("sidebar.unreadTasks",{count:f}),className:"absolute right-0.5 top-0.5 flex min-h-4 min-w-4 items-center justify-center rounded-full bg-[hsl(var(--deck-accent))] px-1 font-mono text-[8px] font-semibold text-white",children:f>99?"99+":f})]}),a.jsx("div",{className:"flex-1"}),a.jsx("div",{className:"my-2 h-px w-6 bg-[hsl(var(--deck-hairline))]"}),h.map(({icon:b,action:k,labelKey:S})=>a.jsx("button",{"data-settings-trigger":!0,onClick:k,"aria-label":p(S),title:p(S),className:"flex h-10 w-10 items-center justify-center rounded-md text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:a.jsx(b,{className:"w-4 h-4"})},S)),a.jsx(Jx,{variant:"compact"}),a.jsx("div",{className:"mt-1",children:a.jsx("div",{role:"status","aria-label":p(d?"sidebar.status.feedLive":"sidebar.status.feedOffline"),className:W("h-2 w-2 rounded-full",d?"bg-[hsl(var(--deck-accent))] shadow-[0_0_6px_hsl(var(--deck-accent-glow)/0.9)]":"bg-[hsl(var(--deck-ink-faint))]/60"),title:p(d?"sidebar.status.feedLive":"sidebar.status.feedOffline")})})]})}const Zx="blade.sidebar.project-order.v1";function uo(e){const t=new Set,n=[];for(const r of e)typeof r!="string"||!r||t.has(r)||(t.add(r),n.push(r));return n}function m5(){if(typeof window>"u")return[];try{const e=JSON.parse(window.localStorage.getItem(Zx)??"[]");return Array.isArray(e)?uo(e):[]}catch{return[]}}function h5(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Zx,JSON.stringify(uo(e)))}catch{}}function g5(e,t){const n=new Map(uo(t).map((s,i)=>[s,i])),r=n.size;return e.map((s,i)=>({project:s,rank:n.get(s.path)??r+i})).sort((s,i)=>s.rank-i.rank).map(({project:s})=>s)}function b5(e,t,n){const r=uo(e),s=r.indexOf(t),i=r.indexOf(n);if(s<0||i<0||s===i)return r;const[o]=r.splice(s,1);return r.splice(i,0,o),r}function k5(e,t,n){const r=uo(e),s=r.indexOf(t),i=s+n;return s<0||i<0||i>=r.length||([r[s],r[i]]=[r[i],r[s]]),r}function x5({name:e,path:t,count:n,countIsPartial:r=!1,isActive:s,hasRunning:i,unreadCount:o,collapsed:d,onToggle:f,onSelect:u,onCreateTask:m,reorderPosition:p,reorderCount:h,isDragging:b=!1,onDragStart:k,onDragEnd:S,onReorderKeyDown:C}){const x=Ut();return a.jsxs("div",{className:W("group/proj flex w-full items-center gap-2 px-5 pb-1.5 pt-3 text-left transition-colors","hover:bg-[hsl(var(--deck-surface))]/40"),children:[a.jsx("button",{type:"button",draggable:!0,"data-project-drag-handle":t,onDragStart:k,onDragEnd:S,onKeyDown:C,"aria-label":x("sidebar.project.reorder",{name:e,position:p,count:h}),title:x("sidebar.project.reorderHint"),className:W("-ml-2 flex h-6 w-4 shrink-0 cursor-grab items-center justify-center rounded-sm text-[hsl(var(--deck-ink-faint))] opacity-45 transition-[opacity,color,background-color] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-ink-muted))] hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] active:cursor-grabbing group-hover/proj:opacity-100",b&&"cursor-grabbing opacity-100 text-[hsl(var(--deck-accent))]"),children:a.jsx(ay,{className:"h-3.5 w-3.5"})}),a.jsx("button",{type:"button",onClick:f,"aria-expanded":!d,"aria-label":x(d?"sidebar.project.expand":"sidebar.project.collapse",{name:e}),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(ny,{className:W("h-3 w-3 text-[hsl(var(--deck-ink-faint))] transition-transform duration-150",!d&&"rotate-90")})}),a.jsxs("button",{type:"button",onClick:u??f,title:t,"aria-current":s?"true":void 0,className:"flex min-h-6 min-w-0 flex-1 items-center gap-2 rounded-sm text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx(li,{className:W("h-3.5 w-3.5 shrink-0",s?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]")}),a.jsx("span",{className:W("flex-1 truncate font-mono text-[11.5px] font-medium tracking-[-0.01em]",s?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:e}),i&&a.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-blue-500 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse dark:bg-blue-400","aria-hidden":!0}),o>0&&a.jsx("span",{"aria-label":x("sidebar.unreadTasks",{count:o}),className:"shrink-0 rounded-full bg-[hsl(var(--deck-accent))] px-1.5 py-0.5 font-mono text-[8px] font-semibold text-white",children:o}),a.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[n.toString().padStart(2,"0"),r?"+":""]})]}),m&&a.jsx("button",{type:"button",onClick:m,title:x("sidebar.project.newTask",{name:e}),"aria-label":x("sidebar.project.newTask",{name:e}),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm text-[hsl(var(--deck-ink-faint))] opacity-0 transition-[opacity,color,background-color] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-accent))] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] group-hover/proj:opacity-100",children:a.jsx(zc,{className:"h-3.5 w-3.5"})})]})}function Lc(e){const t=e.lastMessageTime||e.firstMessageTime;if(!t)return 0;const n=new Date(t).getTime();return Number.isNaN(n)?0:n}function fp(e){return e.pendingInteraction?0:e.taskStatus==="running"?1:e.taskStatus==="queued"?2:3}function Wd(e,t){return fp(e)-fp(t)||Lc(t)-Lc(e)}const y5=["running","queued","interrupted","failed","cancelled","completed"],w5={running:"RUNNING",queued:"QUEUED",interrupted:"INTERRUPTED",failed:"FAILED",cancelled:"CANCELLED",completed:"DONE"},Ss=e=>e.length>1?e.replace(/\/+$/,""):e;function Xx(e){const t=new Map;for(const n of e){if(!n)continue;const r=Re(he(n));t.has(r)||t.set(r,n)}return Array.from(t.values())}function v5(e){const t=Xx(e),n=[];for(const r of y5){const s=t.filter(i=>i.taskStatus===r).sort(Wd);s.length>0&&n.push({code:w5[r],status:r,sessions:s})}return n}function S5(e,t,n=[]){const r=Xx(e),s=new Map,i=n.map(Ss),o=new Map(i.map((u,m)=>[u,m]));for(const u of i)s.set(u,[]);for(const u of r){const m=lo(u,t),p=s.get(m);p?p.push(u):s.set(m,[u])}const d=t?Ss(t):null,f=Array.from(s.entries()).map(([u,m])=>{const p=[...m].sort(Wd),h=m.reduce((b,k)=>Math.max(b,Lc(k)),0);return{path:u,name:Mc(u),isActive:d?Ss(u)===d:!1,isBound:o.has(Ss(u)),hasRunning:m.some(b=>b.taskStatus==="running"),lastActivity:h,sessions:p}});return f.sort((u,m)=>u.isBound!==m.isBound?u.isBound?-1:1:u.isBound&&m.isBound?(o.get(Ss(u.path))??Number.MAX_SAFE_INTEGER)-(o.get(Ss(m.path))??Number.MAX_SAFE_INTEGER):m.lastActivity-u.lastActivity),f}const mp=12,j5={RUNNING:"sidebar.group.running",QUEUED:"sidebar.group.queued",INTERRUPTED:"sidebar.group.interrupted",FAILED:"sidebar.group.failed",CANCELLED:"sidebar.group.cancelled",DONE:"sidebar.group.done"},I5={RUNNING:"text-blue-700 dark:text-blue-400",QUEUED:"text-amber-700 dark:text-amber-400",INTERRUPTED:"text-orange-700 dark:text-orange-400",FAILED:"text-red-700 dark:text-red-400",CANCELLED:"text-[hsl(var(--deck-ink-faint))]",DONE:"text-[hsl(var(--deck-accent))]"};function C5({view:e,sessions:t,activeProjectPath:n,boundProjects:r,currentSessionRef:s,unreadTaskKeys:i,catalogLoadState:o,catalogError:d,onSelectProject:f,onCreateTask:u,onRetryCatalog:m,renderRow:p}){const h=Ut(),[b,k]=y.useState({}),[S,C]=y.useState({}),[x,N]=y.useState(m5),[P,L]=y.useState(null),[D,j]=y.useState(null),[I,T]=y.useState(""),M=o==="loading"||o==="hydrating",$=M||o==="error",te=y.useMemo(()=>e==="status"?v5(t):[],[t,e]),O=y.useMemo(()=>e==="project"?S5(t,n,r.map(R=>R.path)):[],[n,r,t,e]),J=y.useMemo(()=>g5(O,x),[O,x]),ae=(R,ue)=>{const ve=S[R]??!1,He=ve?ue:ue.filter((tt,Y)=>{if(Y<mp)return!0;const pt=he(tt);return!!tt.pendingInteraction||i.includes(Re(pt))||!!(s&&oe(pt,s))}),yt=ue.length-He.length,We=ve?ue.length>mp:yt>0;return a.jsxs(a.Fragment,{children:[He.map(p),We&&a.jsx("button",{type:"button",onClick:()=>C(tt=>({...tt,[R]:!ve})),className:"mx-4 my-1 rounded-md px-3 py-1.5 text-left font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink-muted))]",children:ve?h("sidebar.group.showLess"):h("sidebar.group.showMore",{count:yt})})]})},ce=M?a.jsxs("div",{role:"status","aria-live":"polite",className:"mx-4 mt-2 flex items-center gap-2 rounded-md bg-[hsl(var(--deck-surface))]/55 px-3 py-2 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(mt,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}),a.jsx("span",{className:"flex-1 min-w-0",children:h("sidebar.catalog.syncing")}),a.jsx("span",{className:"tabular-nums shrink-0",children:h("sidebar.catalog.loaded",{count:t.length})})]}):o==="error"?a.jsxs("div",{role:"alert",title:d??void 0,className:"mx-4 mt-2 flex items-center gap-2 rounded-md bg-amber-50/80 px-3 py-2 font-mono text-[9.5px] text-amber-800 dark:bg-amber-950/35 dark:text-amber-300",children:[a.jsx(Ns,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:h("sidebar.catalog.incomplete")}),a.jsxs("button",{type:"button",onClick:m,className:"inline-flex min-h-6 shrink-0 items-center gap-1 rounded px-1.5 font-medium hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-amber-500 dark:hover:bg-amber-900/50",children:[a.jsx(di,{className:"h-2.5 w-2.5"}),h("sidebar.catalog.retry")]})]}):null;if(e==="status")return a.jsxs("div",{className:"flex flex-col",children:[ce,te.map((R,ue)=>a.jsxs("div",{children:[a.jsxs("div",{className:W("flex items-center justify-between px-5 pb-2 pt-3 font-mono text-[10px] tracking-[0.16em]",I5[R.code]??"text-[hsl(var(--deck-ink-faint))]",ue===0&&"pt-2"),children:[a.jsx("span",{children:h(j5[R.code])}),a.jsxs("span",{className:"text-[hsl(var(--deck-ink-faint))]",children:[R.sessions.length.toString().padStart(2,"0"),$?"+":""]})]}),ae(`status:${R.code}`,R.sessions)]},R.code))]});const le=J.some(R=>R.isActive),xe=R=>!!(s&&R.sessions.some(ue=>oe(he(ue),s))),Z=(R,ue)=>{if(R.join("\0")===J.map(He=>He.path).join("\0"))return;N(R),h5(R);const ve=J.find(He=>He.path===ue);T(h("sidebar.project.reordered",{name:(ve==null?void 0:ve.name)??ue,position:R.indexOf(ue)+1}))},de=(R,ue)=>{const ve=R.sessions.filter(Y=>i.includes(Re(he(Y)))).length,He=xe(R),yt=ve>0,We=R.sessions.some(Y=>!!Y.pendingInteraction),tt=b[R.path]??(le&&!R.isActive&&!(He||R.hasRunning||yt||We));return a.jsxs("div",{"data-project-group":R.path,onDragEnter:Y=>{!P||P===R.path||(Y.preventDefault(),j(R.path))},onDragOver:Y=>{!P||P===R.path||(Y.preventDefault(),Y.dataTransfer.dropEffect="move")},onDrop:Y=>{Y.preventDefault();const pt=P||Y.dataTransfer.getData("text/plain");pt&&pt!==R.path&&Z(b5(J.map(F=>F.path),pt,R.path),pt),L(null),j(null)},className:W("relative transition-colors",D===R.path&&P!==R.path&&"bg-[hsl(var(--deck-accent-soft))]/55 before:absolute before:inset-y-1 before:left-0 before:w-0.5 before:rounded-full before:bg-[hsl(var(--deck-accent))]"),children:[a.jsx(x5,{name:R.name,path:R.path,count:R.sessions.length,countIsPartial:$,isActive:R.isActive,hasRunning:R.hasRunning,unreadCount:ve,collapsed:tt,onSelect:()=>f(R.path),onCreateTask:()=>u(R.path),reorderPosition:ue+1,reorderCount:J.length,isDragging:P===R.path,onDragStart:Y=>{Y.dataTransfer.effectAllowed="move",Y.dataTransfer.setData("text/plain",R.path),L(R.path)},onDragEnd:()=>{L(null),j(null)},onReorderKeyDown:Y=>{if(Y.key!=="ArrowUp"&&Y.key!=="ArrowDown")return;Y.preventDefault();const pt=k5(J.map(F=>F.path),R.path,Y.key==="ArrowUp"?-1:1);Z(pt,R.path)},onToggle:()=>k(Y=>({...Y,[R.path]:!tt}))}),!tt&&ae(`project:${R.path}`,R.sessions)]},R.path)};return a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"sr-only","aria-live":"polite",children:I}),ce,J.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-5 pb-0.5 pt-2 font-mono text-[9px] uppercase tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:h("sidebar.project.projects")}),J.map(de)]})]})}function E5({className:e,onNavigate:t}){const n=Ut(),{toggleSettings:r,toggleSidebar:s,isSidebarOpen:i,isTerminalOpen:o,toggleTerminal:d,sidebarView:f,setSidebarView:u,setTaskSwitcherOpen:m,mainView:p,setMainView:h,setBoardProjectPath:b,setFilePreviewOpen:k}=sn(),S=H(A=>A.sessions),C=H(A=>A.catalogLoadState),x=H(A=>A.catalogError),N=H(A=>A.currentSessionRef),P=H(A=>A.forkingSessionRef),L=H(A=>A.selectSession),D=H(A=>A.startTemporarySession),j=H(A=>A.deleteSession),I=H(A=>A.archiveSession),T=H(A=>A.forkSession),M=H(A=>A.updateSession),$=H(A=>A.loadSessions),te=H(A=>A.setError),O=H(A=>A.taskEventsConnected),J=H(A=>A.taskWorkspaceInfo),ae=H(A=>A.boundProjects),ce=H(A=>A.selectedProjectPath),le=H(A=>A.bindProject),xe=H(A=>A.selectProject),Z=H(A=>A.cancelTask),de=H(A=>A.cancellingTaskKeys),R=H(A=>A.retryTask),ue=H(A=>A.retryingTaskKeys),ve=H(A=>A.unreadTaskKeys),[He,yt]=y.useState(null),[We,tt]=y.useState(""),[Y,pt]=y.useState(null),[F,B]=y.useState(!1),Se=ce??(J==null?void 0:J.cwd)??null,qe=A=>gi(A,n),Ae=A=>{const Ee=A.taskSourceProjectPath||A.projectPath,en=Ee.split("/").filter(Boolean).at(-1)||Ee,pr=A.taskIsolation==="worktree"?A.taskWorktreeBranch||n("session.env.worktree"):n("session.env.local"),fr=A.taskDiffStat?`+${A.taskDiffStat.additions} −${A.taskDiffStat.deletions}`:void 0,bs=A.taskStatus==="queued"&&A.taskQueuePosition?n("session.queued",{position:A.taskQueuePosition,depth:A.taskQueueDepth??A.taskQueuePosition}):void 0,ks=Kd(A,n);return{project:en,environment:pr,diff:fr,queue:bs,reason:ks}},Jt=()=>{h("workspace"),D(Se??void 0),t==null||t()},et=()=>{k(!1),b(Se),h("board"),t==null||t()},Ht=async A=>{ae.some(Ee=>Ee.path===A)?xe(A):await le(A),h("workspace"),D(A),t==null||t()},Qt=async A=>{ae.some(Ee=>Ee.path===A)?xe(A):await le(A),h("workspace"),D(A),t==null||t()},bt=A=>{A(),t==null||t()},_=async(A,Ee)=>{A.stopPropagation(),await j(he(Ee))},$e=async A=>{const Ee=he(A),en=Re(Ee);if(!Y){pt(en);try{await Wx(Ee)}catch(pr){te(pr instanceof Error?pr.message:"Session export failed")}finally{pt(null)}}},wt=(A,Ee)=>{A.stopPropagation(),yt(Re(he(Ee))),tt(qe(Ee))},qt=async A=>{if(!We.trim()){yt(null);return}try{await M(he(A),We.trim()),yt(null),await $()}catch(Ee){console.error("Failed to rename session:",Ee)}},Lr=()=>{yt(null),tt("")};return i?a.jsxs("div",{className:W("flex flex-col h-screen border-r w-[260px] border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]",e),children:[a.jsxs("div",{className:"flex flex-col gap-6 px-5 pt-5 pb-5",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(Vd,{size:26}),a.jsx("span",{className:"font-mono text-[15px] font-semibold tracking-[-0.01em] text-[hsl(var(--deck-ink))]",children:"Blade"}),a.jsx("span",{className:"ml-1 rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-1 py-[1px] font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:n("sidebar.brand.badge")})]}),a.jsx("button",{onClick:s,"aria-label":n("sidebar.action.collapse"),className:"flex h-8 w-8 items-center justify-center rounded transition-colors hover:bg-[hsl(var(--deck-surface))]",children:a.jsx(ty,{className:"h-3 w-3 text-[hsl(var(--deck-ink-muted))]"})})]}),a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsxs("button",{onClick:Jt,className:"flex h-9 w-full items-center justify-between rounded-md bg-[hsl(var(--deck-ink))] px-3 font-mono text-[13px] font-medium text-[hsl(var(--deck-canvas))] transition-colors hover:bg-[hsl(var(--deck-ink))]/88",children:[a.jsxs("span",{className:"flex gap-2 items-center",children:[a.jsx(zc,{className:"h-3.5 w-3.5 stroke-[2.5]"}),n("sidebar.action.newTask")]}),a.jsx("span",{className:"rounded-sm bg-white/10 px-1.5 py-[1px] font-mono text-[10px] text-white/80",children:Fc("newTask")})]}),a.jsxs("button",{type:"button",onClick:et,"aria-current":p==="board"?"page":void 0,className:W("flex h-9 w-full items-center gap-2 rounded-md border px-3 font-mono text-[12.5px] transition-colors",p==="board"?"border-[hsl(var(--deck-accent)/0.45)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-muted))] hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]"),children:[a.jsx(Tp,{className:"h-3.5 w-3.5"}),n("sidebar.action.taskBoard")]}),a.jsxs("button",{onClick:()=>bt(d),className:W("flex h-9 w-full items-center gap-2 rounded-md border px-3 font-mono text-[12.5px] transition-colors",o?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-muted))] hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]"),children:[a.jsx(Op,{className:"h-3.5 w-3.5"}),n("sidebar.action.terminal")]}),a.jsxs("button",{type:"button",onClick:()=>bt(()=>m(!0)),className:"flex h-9 w-full items-center justify-between rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Kc,{className:"h-3.5 w-3.5"}),n("sidebar.action.searchTasks")]}),a.jsx("span",{className:"rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-1.5 py-[1px] font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:ve.length>0?ve.length:Fc("searchTasks")})]})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"flex flex-1 items-center gap-0.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-0.5",children:["project","status"].map(A=>a.jsx("button",{type:"button",onClick:()=>u(A),"aria-pressed":f===A,"aria-label":n(A==="project"?"sidebar.view.projectAria":"sidebar.view.statusAria"),className:W("flex-1 rounded-[5px] py-1 font-mono text-[11px] tracking-[0.02em] transition-colors",f===A?"bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-ink))] shadow-sm":"text-[hsl(var(--deck-ink-faint))] hover:text-[hsl(var(--deck-ink-muted))]"),children:n(A==="project"?"sidebar.view.project":"sidebar.view.status")},A))}),a.jsx("button",{type:"button",onClick:()=>B(!0),title:n("projects.bind.action"),"aria-label":n("projects.bind.action"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-faint))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-accent))]",children:a.jsx(Ro,{className:"h-3.5 w-3.5"})})]})]}),a.jsx(Gd,{className:"flex-1 px-0",children:a.jsxs("div",{className:"flex flex-col",children:[(S.length>0||ae.length>0||C==="loading"||C==="hydrating"||C==="error")&&a.jsx(C5,{view:f,sessions:S,activeProjectPath:Se,boundProjects:ae,currentSessionRef:N,unreadTaskKeys:ve,catalogLoadState:C,catalogError:x,onRetryCatalog:$,onSelectProject:A=>void Ht(A).catch(()=>{}),onCreateTask:A=>void Qt(A).catch(()=>{}),renderRow:A=>{const Ee=he(A),en=Re(Ee),pr=oe(Ee,N),fr=He===en,bs=oe(Ee,P),ks=!!P;return a.jsx(p5,{session:A,sessionRef:Ee,isActive:pr,isForking:bs,isUnread:ve.includes(Re(Ee)),anyForking:ks,isEditing:fr,editingTitle:We,title:qe(A),context:Ae(A),isCancelling:de.includes(Re(Ee)),isRetrying:ue.includes(Re(Ee)),isExporting:Y===en,onSelect:()=>(t==null||t(),h("workspace"),L(Ee)),onCancelTask:()=>{Z(Ee).catch(()=>{})},onRetryTask:()=>{R(Ee).catch(()=>{})},onFork:()=>void T(A),onArchive:()=>void I(Ee),onExport:()=>void $e(A),onStartRename:Xs=>wt(Xs,A),onDelete:Xs=>_(Xs,A),onEditingTitleChange:tt,onSaveRename:()=>qt(A),onCancelRename:Lr},en)}}),S.length===0&&a.jsx("div",{className:"px-5 mt-6",children:a.jsxs("div",{className:"rounded-md border border-dashed border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]/60 px-4 py-6 text-center",children:[a.jsx("div",{className:"mx-auto mb-2 inline-flex h-8 w-8 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))]",children:a.jsx(Np,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"})}),a.jsx("div",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:n("sidebar.empty.title")}),a.jsx("div",{className:"mt-1 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:n("sidebar.empty.hint")})]})})]})}),a.jsxs("div",{className:"flex flex-col gap-3 px-5 pt-3 pb-5",children:[a.jsxs("div",{className:"flex flex-col gap-0.5 border-t border-[hsl(var(--deck-hairline))] pt-3",children:[a.jsx(l5,{}),[{icon:Ap,action:()=>bt(r),labelKey:"sidebar.section.settings"}].map(({icon:A,action:Ee,labelKey:en})=>a.jsxs("button",{"data-settings-trigger":!0,onClick:Ee,className:"flex h-8 w-full items-center gap-2.5 rounded-md px-2.5 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:[a.jsx(A,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),n(en)]},en))]}),a.jsxs("div",{className:"flex gap-2 justify-between items-center",children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.14em] text-[hsl(var(--deck-ink-faint))]",children:n("sidebar.language.label")}),a.jsx(Jx,{})]}),a.jsxs("div",{className:"flex items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2",children:[a.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-[hsl(var(--deck-canvas-veil))]",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-[hsl(var(--deck-ink))]"})}),a.jsxs("div",{className:"flex flex-1 flex-col gap-[1px]",children:[a.jsx("span",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:n("sidebar.status.user")}),a.jsxs("span",{className:W("flex gap-1 items-center font-mono text-[10px]",O?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]"),children:[a.jsx("span",{className:W("h-1 w-1 rounded-full",O?"bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.9)]":"bg-[hsl(var(--deck-ink-faint))]/60")}),n(O?"sidebar.status.feedLive":"sidebar.status.feedOffline")]})]})]})]}),a.jsx(Yx,{open:F,onOpenChange:B})]}):a.jsx(f5,{className:e,onExpand:s,onNewChat:Jt,onOpenBoard:et,onOpenTaskSwitcher:()=>bt(()=>m(!0)),onToggleTerminal:()=>bt(d),onToggleSettings:()=>bt(r),isTerminalOpen:o,taskEventsConnected:O,unreadCount:ve.length,boardActive:p==="board"})}const T5=y.lazy(()=>es(()=>import("./SettingsModal-Bu5uH8ic.js"),__vite__mapDeps([4,1,2,5,6,7,8,3,9])).then(e=>({default:e.SettingsModal}))),e0=()=>es(()=>import("./TaskSwitcher-BDwk7i6w.js"),__vite__mapDeps([10,1,3,11,12,2])).then(e=>({default:e.TaskSwitcher})),A5=y.lazy(e0),t0=()=>es(()=>import("./FilePreview-uShTCL2_.js"),__vite__mapDeps([13,1,3,14,5,9,11,2])),P5=y.lazy(()=>t0().then(e=>({default:e.FilePreview}))),N5=y.lazy(()=>t0().then(e=>({default:e.PreviewControls}))),O5=y.lazy(()=>es(()=>import("./TerminalPanel-PiLhnW-8.js"),__vite__mapDeps([15,1,16,17,3,2])).then(e=>({default:e.TerminalPanel}))),sc=e=>{if(e.startsWith("/Users/")){const t=e.split("/");if(t.length>=3)return"~/"+t.slice(3).join("/")}return e},R5=e=>e.replace(/^~\//,"~/§").split("/").filter(Boolean).map((t,n,r)=>{var s;return n===0&&((s=r[0])!=null&&s.startsWith("~"))?"~":t.replace(/^§/,"")});function M5({children:e}){var Y,pt;const t=Ut();c5();const{isSidebarOpen:n,isFilePreviewOpen:r,isSettingsOpen:s,isTerminalOpen:i,isTaskSwitcherOpen:o,toggleFilePreview:d,openFilePreview:f,previewRequestId:u,setSidebarOpen:m,mainView:p}=sn();y.useEffect(()=>{const F=window.setTimeout(()=>{e0()},1500);return()=>window.clearTimeout(F)},[]);const h=H(F=>F.currentSessionId),b=H(F=>F.currentSessionRef),k=H(F=>F.sessions),S=H(F=>F.isStreaming),C=H(F=>F.isTemporarySession),x=H(F=>F.taskWorkspaceInfo),N=H(F=>F.boundProjects),P=H(F=>F.selectedProjectPath),[L,D]=y.useState(null),[j,I]=y.useState(!1),[T,M]=y.useState(),[$,te]=y.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(max-width: 639px)").matches),[O,J]=y.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(max-width: 1023px)").matches),ae=y.useRef(null),ce=y.useRef(null),le=y.useRef(null),xe=y.useMemo(()=>k.find(F=>oe({sessionId:F.sessionId,projectPath:F.projectPath},b)),[b,k]),Z=(xe==null?void 0:xe.taskIsolation)==="worktree"&&xe.taskSourceProjectPath&&(((Y=xe.taskDelivery)==null?void 0:Y.status)==="applied"||((pt=xe.taskDelivery)==null?void 0:pt.status)==="discarded")?xe.taskSourceProjectPath:b==null?void 0:b.projectPath;y.useEffect(()=>{if(typeof window.matchMedia!="function")return;const F=window.matchMedia("(max-width: 900px)"),B=()=>{F.matches&&m(!1)};return B(),F.addEventListener("change",B),()=>F.removeEventListener("change",B)},[m]),y.useEffect(()=>{if(typeof window.matchMedia!="function")return;const F=window.matchMedia("(max-width: 639px)"),B=()=>te(F.matches);return B(),F.addEventListener("change",B),()=>F.removeEventListener("change",B)},[]),y.useEffect(()=>{if(typeof window.matchMedia!="function")return;const F=window.matchMedia("(max-width: 1023px)"),B=()=>J(F.matches);return B(),F.addEventListener("change",B),()=>F.removeEventListener("change",B)},[]),y.useEffect(()=>{if(!$||!n)return;const F=requestAnimationFrame(()=>{var B,Se;(Se=(B=ae.current)==null?void 0:B.querySelector("button"))==null||Se.focus()});return()=>{var B;cancelAnimationFrame(F),(B=ce.current)==null||B.focus({preventScroll:!0})}},[$,n]);const de=F=>{var Ae;if(!$||!n)return;if(F.key==="Escape"){F.preventDefault(),m(!1);return}if(F.key!=="Tab")return;const B=Array.from(((Ae=ae.current)==null?void 0:Ae.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'))??[]);if(B.length===0)return;const Se=B[0],qe=B[B.length-1];F.shiftKey&&document.activeElement===Se?(F.preventDefault(),qe==null||qe.focus()):!F.shiftKey&&document.activeElement===qe&&(F.preventDefault(),Se==null||Se.focus())},R=y.useMemo(()=>p==="board"||!h||C?P?sc(P):null:xe!=null&&xe.projectPath?sc(xe.taskSourceProjectPath||xe.projectPath):null,[h,xe,C,p,P]),ue=y.useMemo(()=>R?R5(R):[],[R]);y.useEffect(()=>{var B;if(!b){D(((B=N.find(Se=>Se.path===P))==null?void 0:B.gitBranch)??null);return}(async()=>{try{const Se=await X.getGitInfo({sessionId:b.sessionId,projectPath:Z??b.projectPath});D(Se.branch)}catch{D(null)}})()},[N,b,Z,P]);const ve=x==null?void 0:x.taskAdmission,He=p==="board"?P??(x==null?void 0:x.cwd)??null:Z??P??(x==null?void 0:x.cwd)??null,yt=b&&p==="workspace"?Re(b):`project:${P??"none"}`,We=r&&O,tt=r&&T;return a.jsxs("div",{className:"flex h-screen overflow-hidden bg-[hsl(var(--deck-canvas))]",children:[$&&n&&!We&&a.jsx("button",{type:"button","aria-label":t("sidebar.action.collapse"),onClick:()=>m(!1),className:"fixed inset-0 z-40 bg-black/25 backdrop-blur-[1px]"}),a.jsx("div",{ref:ae,role:$&&n&&!We?"dialog":void 0,"aria-modal":$&&n&&!We?!0:void 0,"aria-label":$&&n&&!We?t("sidebar.navigationAria"):void 0,inert:We||$&&!n?!0:void 0,onKeyDown:de,className:W("overflow-hidden",n?"w-[260px]":"w-[64px]",$?"fixed inset-y-0 left-0 z-50 shadow-2xl transition-none":"shrink-0 transition-[width] duration-300 ease-in-out",$&&!n&&"-translate-x-full"),children:a.jsx("div",{className:W("transition-all duration-300 ease-in-out",n?"w-[260px]":"w-[64px]"),children:a.jsx(E5,{onNavigate:()=>{$&&m(!1)}})})}),a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("header",{inert:We,className:"relative z-10 flex h-14 items-center gap-2 border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas))]/90 px-3 backdrop-blur-md sm:gap-4 sm:px-6",children:[$&&a.jsx(Kr,{ref:ce,"data-mobile-navigation-trigger":!0,variant:"ghost",size:"icon",onClick:()=>m(!0),"aria-label":t("layout.action.openNavigation"),title:t("layout.action.openNavigation"),className:"h-9 w-9 shrink-0 rounded-md text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:a.jsx(py,{className:"h-4 w-4"})}),a.jsxs("div",{className:"flex gap-2 items-center min-w-0",children:[ue.length>0?a.jsx("nav",{"aria-label":t("layout.workspace.pathAria"),title:R??void 0,className:"flex min-w-0 items-center font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:ue.map((F,B)=>{const Se=B===ue.length-1,qe=B===0&&F==="~";return a.jsxs("span",{className:"flex items-center min-w-0",children:[B>0&&a.jsx("span",{className:"mx-1 text-[hsl(var(--deck-ink-faint))]/70",children:"/"}),B===0&&!qe&&a.jsx("span",{className:"mr-1 text-[hsl(var(--deck-ink-faint))]/70",children:"/"}),a.jsx("span",{className:W("truncate",Se?"font-medium text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:F})]},B)})}):a.jsx("span",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:x!=null&&x.cwd?sc(x.cwd):t("layout.workspace.empty")}),L&&a.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-2 py-0.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink-muted))]",children:[a.jsx(qc,{className:"h-3 w-3 text-[hsl(var(--deck-accent))]"}),L]})]}),a.jsxs("div",{className:"flex gap-3 items-center ml-auto",children:[ve&&a.jsx("span",{className:"hidden items-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-2.5 py-1 md:inline-flex",children:a.jsx(Kx,{inFlight:ve.inFlight,queued:ve.queued,maxConcurrent:ve.maxConcurrent,compact:!0})}),a.jsxs("div",{className:"flex items-center gap-0.5",children:[a.jsx(Kr,{variant:"ghost",size:"icon","aria-label":t("layout.action.rewind"),title:t("layout.action.rewind"),disabled:p==="board"||!b||C||S,onClick:()=>I(!0),className:"h-8 w-8 rounded-md text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] disabled:opacity-35",children:a.jsx(Yo,{className:"w-4 h-4"})}),a.jsx(y.Suspense,{fallback:null,children:a.jsx(N5,{ref:le,open:r,maximized:T,disabled:p==="board",onToggleMaximized:()=>M(F=>!F),onTogglePreview:()=>{if(r){M(!1),d();return}f((!b||C)&&u===0?{tab:"files"}:void 0)}})})]})]})]}),a.jsxs("main",{className:"flex-1 overflow-hidden relative flex bg-[hsl(var(--deck-canvas))]",children:[a.jsx("div",{"data-preview-background":"content","data-preview-maximized":tt,inert:We,className:"relative flex min-w-0 flex-1 flex-col",children:s?a.jsx(y.Suspense,{fallback:null,children:a.jsx(T5,{})}):e}),r&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(P5,{returnFocusElement:le.current,maximized:tt},yt)})]})]}),i&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(O5,{workspacePath:He},He??"default-workspace")}),o&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(A5,{})}),a.jsx(r5,{open:j,onOpenChange:I})]})}const ic="BladeCode";function $5(){const e=Ut(),t=H(o=>o.unreadTaskKeys),n=H(o=>o.sessions),r=H(o=>o.selectSession),s=H(o=>o.selectProject),i=y.useMemo(()=>{const o=new Set(t);for(const d of n)d.pendingInteraction&&o.add(Re(he(d)));return o.size},[n,t]);return y.useEffect(()=>(document.title=i>0?`(${i}) ${ic}`:ic,()=>{document.title=ic}),[i]),y.useEffect(()=>{const o=d=>{var h;const f=d.detail;if(!(f!=null&&f.sessionId)||!f.projectPath)return;const u=H.getState(),m=zd(u.sessions,f),p=m?lo(m,u.selectedProjectPath??((h=u.taskWorkspaceInfo)==null?void 0:h.cwd)??null):f.projectPath;u.boundProjects.some(b=>b.available&&b.path===p)&&s(p),r(f)};return window.addEventListener(Go,o),()=>window.removeEventListener(Go,o)},[s,r]),a.jsx("div",{className:"sr-only",role:"status","aria-live":"polite",children:i>0?e("attention.unreadAnnouncement",{count:i}):""})}const Dc=y.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:W("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Dc.displayName="Textarea";const F5=(e,t)=>{const n=[...e.matchAll(/(?:^|\s)(@(?:"[^"]*"|(?:[^\\ ]|\\ )*))/g)];for(const r of n){const s=r[1],i=r.index+(r[0].length-s.length),o=i+s.length;if(t>=i&&t<=o){let d=s.slice(1),f=!1;return d.startsWith('"')&&(f=!0,d=d.slice(1),d.endsWith('"')&&(d=d.slice(0,-1))),{hasQuery:!0,query:d,startIndex:i,endIndex:o,quoted:f}}}return{hasQuery:!1,query:"",startIndex:-1,endIndex:-1,quoted:!1}},L5=(e,t,n={})=>{const{debounceDelay:r=200,maxSuggestions:s=15,workspacePath:i}=n,[o,d]=y.useState([]),[f,u]=y.useState(0),[m,p]=y.useState(!1),h=y.useMemo(()=>t===void 0?{hasQuery:!1,query:"",startIndex:-1,endIndex:-1,quoted:!1}:F5(e,t),[e,t]);y.useEffect(()=>{if(!h.hasQuery){d([]),p(!1);return}let S=!1;p(!0);const x=setTimeout(async()=>{try{const N=await fetch(`/suggestions/files?q=${encodeURIComponent(h.query)}&limit=${s}`,i?{headers:{"x-blade-directory":i}}:void 0);if(!N.ok)throw new Error("Failed to fetch suggestions");const P=await N.json();S||d(P)}catch(N){console.error("Failed to fetch file suggestions:",N),S||d([])}finally{S||p(!1)}},r);return()=>{S=!0,clearTimeout(x)}},[h.hasQuery,h.query,r,s,i]),y.useEffect(()=>{u(0)},[o]);const b=y.useCallback(()=>{u(S=>(S+1)%Math.max(o.length,1))},[o.length]),k=y.useCallback(()=>{u(S=>(S-1+o.length)%Math.max(o.length,1))},[o.length]);return{...h,suggestions:o,selectedIndex:f,loading:m,setSelectedIndex:u,selectNext:b,selectPrevious:k}},D5=(e,t=!1)=>e.includes(" ")||t?`@"${e}"`:`@${e}`,_5=(e,t,n)=>{if(!t.hasQuery)return{newInput:e,newCursorPos:e.length};const r=D5(n,t.quoted),s=e.slice(0,t.startIndex),i=e.slice(t.endIndex),o=s+r+" "+i,d=t.startIndex+r.length+1;return{newInput:o,newCursorPos:d}};function U5(){const[e,t]=y.useState([]),[n,r]=y.useState(-1),s=y.useRef(""),i=y.useCallback(u=>{u.trim()&&(t(m=>m[m.length-1]===u?m:[...m,u]),r(-1),s.current="")},[]),o=y.useCallback(u=>{if(e.length===0)return null;n===-1&&(s.current=u);const m=n===-1?e.length-1:Math.max(0,n-1);return r(m),e[m]??null},[e,n]),d=y.useCallback(()=>{if(n===-1)return null;const u=n+1;return u>=e.length?(r(-1),s.current):(r(u),e[u]??null)},[e,n]),f=y.useCallback(()=>{r(-1),s.current=""},[]);return{addToHistory:i,getPrevious:o,getNext:d,reset:f,historyIndex:n}}const B5=(e,t)=>{if(!e.startsWith("/"))return{hasQuery:!1,query:"",startIndex:-1,endIndex:-1};const n=e.indexOf(" "),r=n===-1?e.length:n;return t<=r?{hasQuery:!0,query:e.slice(1,t),startIndex:0,endIndex:t}:{hasQuery:!1,query:"",startIndex:-1,endIndex:-1}},H5=(e,t,n={})=>{const{debounceDelay:r=150,workspacePath:s}=n,[i,o]=y.useState([]),[d,f]=y.useState(0),[u,m]=y.useState(!1),p=y.useMemo(()=>t===void 0?{hasQuery:!1,query:"",startIndex:-1,endIndex:-1}:B5(e,t),[e,t]);y.useEffect(()=>{if(!p.hasQuery){o([]),m(!1);return}let k=!1;m(!0);const C=setTimeout(async()=>{try{const x=await fetch(`/suggestions/commands?q=${encodeURIComponent(p.query)}`,s?{headers:{"x-blade-directory":s}}:void 0);if(!x.ok)throw new Error("Failed to fetch suggestions");const N=await x.json();k||o(N)}catch(x){console.error("Failed to fetch command suggestions:",x),k||o([])}finally{k||m(!1)}},r);return()=>{k=!0,clearTimeout(C)}},[p.hasQuery,p.query,r,s]),y.useEffect(()=>{f(0)},[i]);const h=y.useCallback(()=>{f(k=>(k+1)%Math.max(i.length,1))},[i.length]),b=y.useCallback(()=>{f(k=>(k-1+i.length)%Math.max(i.length,1))},[i.length]);return{...p,suggestions:i,selectedIndex:d,loading:u,setSelectedIndex:f,selectNext:h,selectPrevious:b}},q5=(e,t,n)=>{if(!t.hasQuery)return{newInput:e,newCursorPos:e.length};const r=e.slice(t.endIndex),s=n.command+" "+r.trimStart(),i=n.command.length+1;return{newInput:s,newCursorPos:i}},z5="blade.composer.draft.",Vo=new Map,n0=1;function Wo(){return typeof sessionStorage>"u"?null:sessionStorage}function Jo(e){return`${z5}${e}`}function K5(e){var n;if(!e)return{content:"",attachments:[],outputSchema:void 0};const t=Vo.get(e);if(t)return{content:t.content,attachments:[...t.attachments],outputSchema:t.outputSchema};try{const r=((n=Wo())==null?void 0:n.getItem(Jo(e)))??"";if(!r)return{content:"",attachments:[],outputSchema:void 0};try{const s=JSON.parse(r);if(s.version===n0&&typeof s.content=="string"&&(s.outputSchema===void 0||typeof s.outputSchema=="string"))return{content:s.content,attachments:[],outputSchema:s.outputSchema}}catch{}return{content:r,attachments:[],outputSchema:void 0}}catch{return{content:"",attachments:[],outputSchema:void 0}}}function mn(e,t){var s,i;if(!e)return;const n=Vo.get(e),r=t.outputSchema??(n==null?void 0:n.outputSchema);if(!t.content&&t.attachments.length===0&&!r){r0(e);return}Vo.set(e,{content:t.content,attachments:[...t.attachments],outputSchema:r});try{t.content||r?(s=Wo())==null||s.setItem(Jo(e),JSON.stringify({version:n0,content:t.content,...r?{outputSchema:r}:{}})):(i=Wo())==null||i.removeItem(Jo(e))}catch{}}function r0(e){var t;if(e){Vo.delete(e);try{(t=Wo())==null||t.removeItem(Jo(e))}catch{}}}function _c(e){return e.reduce((t,n)=>t+n.dataUrl.length,0)}function G5(e){return`data:${e.type||"application/octet-stream"};base64,`.length+4*Math.ceil(e.size/3)}function V5(e,t){const r=_c(e)+t.reduce((s,i)=>s+G5(i),0);return e.length+t.length>zr?{accepted:!1,reason:"count",estimatedBytes:r}:r>mi?{accepted:!1,reason:"bytes",estimatedBytes:r}:{accepted:!0,estimatedBytes:r}}const W5=e=>typeof e=="object"&&"command"in e,hp=({type:e,suggestions:t,selectedIndex:n,loading:r,onSelect:s,onHover:i,visible:o})=>{const d=y.useRef(null),f=y.useRef(null);if(y.useEffect(()=>{if(f.current&&d.current){const m=d.current,p=f.current,h=m.getBoundingClientRect(),b=p.getBoundingClientRect();b.bottom>h.bottom?m.scrollTop+=b.bottom-h.bottom+4:b.top<h.top&&(m.scrollTop-=h.top-b.top+4)}},[n]),!o||t.length===0&&!r)return null;const u=e==="command"?Cp:fu;return a.jsx("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50",children:a.jsxs("div",{className:"mx-4 bg-white dark:bg-zinc-900 border border-[#E5E7EB] dark:border-zinc-700 rounded-lg shadow-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[#E5E7EB] dark:border-zinc-800 text-xs text-[#6B7280] dark:text-zinc-400",children:[a.jsx(u,{className:"h-3.5 w-3.5"}),a.jsx("span",{children:e==="command"?"Commands":"Files"}),r&&a.jsx(mt,{className:"h-3 w-3 animate-spin ml-auto"})]}),a.jsx("div",{ref:d,className:"max-h-64 overflow-y-auto py-1",children:t.length===0&&r?a.jsx("div",{className:"px-3 py-4 text-center text-[#6B7280] dark:text-zinc-500 text-sm",children:"Loading..."}):t.length===0?a.jsx("div",{className:"px-3 py-4 text-center text-[#6B7280] dark:text-zinc-500 text-sm",children:"No matches found"}):t.map((m,p)=>{const h=p===n,b=W5(m);return a.jsx("button",{ref:h?f:null,className:W("w-full text-left px-3 py-2 flex items-start gap-3 transition-colors",h?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] hover:bg-[#F3F4F6] hover:text-[#111827] dark:text-zinc-400 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-300"),onClick:()=>s(p),onMouseEnter:()=>i(p),children:b?a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-sm text-blue-600 dark:text-blue-400",children:m.command}),m.argumentHint&&a.jsx("span",{className:"text-xs text-[#9CA3AF] dark:text-zinc-500 font-mono",children:m.argumentHint})]}),a.jsx("p",{className:"text-xs text-[#9CA3AF] dark:text-zinc-500 mt-0.5 truncate",children:m.description})]})}):a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx(fu,{className:"h-4 w-4 flex-shrink-0 text-[#9CA3AF] dark:text-zinc-500"}),a.jsx("span",{className:"font-mono text-sm truncate",children:m})]})},b?m.command:m)})}),a.jsxs("div",{className:"px-3 py-1.5 border-t border-[#E5E7EB] dark:border-zinc-800 text-xs text-[#9CA3AF] dark:text-zinc-500 flex items-center gap-4",children:[a.jsxs("span",{children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-[#E5E7EB] dark:bg-zinc-800 rounded text-[#6B7280] dark:text-zinc-400",children:"↑↓"})," ","Navigate"]}),a.jsxs("span",{children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-[#E5E7EB] dark:bg-zinc-800 rounded text-[#6B7280] dark:text-zinc-400",children:"Tab"})," ","Select"]}),a.jsxs("span",{children:[a.jsx("kbd",{className:"px-1.5 py-0.5 bg-[#E5E7EB] dark:bg-zinc-800 rounded text-[#6B7280] dark:text-zinc-400",children:"Esc"})," ","Close"]})]})]})})},oc=[{value:kr.DEFAULT,labelKey:"chat.input.mode.default",descriptionKey:"chat.input.mode.default.desc",icon:ly},{value:kr.AUTO_EDIT,labelKey:"chat.input.mode.autoEdit",descriptionKey:"chat.input.mode.autoEdit.desc",icon:ky},{value:kr.YOLO,labelKey:"chat.input.mode.yolo",descriptionKey:"chat.input.mode.yolo.desc",icon:Pp,tone:"danger"},{value:kr.PLAN,labelKey:"chat.input.mode.plan",descriptionKey:"chat.input.mode.plan.desc",icon:ry}],J5=["off"],Q5=["high","xhigh","medium","max","low","minimal","off"],Y5=["standard"],Z5=[];function X5(e){return Q5.find(t=>e.includes(t))??"off"}function ac(e){return e<1024*1024?`${Math.max(1,Math.ceil(e/1024))} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function e3({onSend:e,onAbort:t,disabled:n,submitDisabled:r=!1,shellSubmitDisabled:s=!1,isStreaming:i,isStopping:o=!1,pendingSteeringCount:d=0,pendingInputDelivery:f=null,recoveredSteeringCount:u=0,variant:m="chat",draft:p,draftAttachments:h,draftRevision:b,draftKey:k,placeholder:S,workspacePath:C}){var iu;const x=Ut(),N=y.useRef(K5(k)),[P,L]=y.useState(N.current.content),[D,j]=y.useState(N.current.attachments),I=y.useRef(P),T=y.useRef(D),[M,$]=y.useState(N.current.outputSchema??""),te=y.useRef(M),[O,J]=y.useState(!1),[ae,ce]=y.useState(null),[le,xe]=y.useState(void 0),[Z,de]=y.useState(!1),[R,ue]=y.useState(!1),[ve,He]=y.useState(!1),[yt,We]=y.useState(!1),[tt,Y]=y.useState(!1),[pt,F]=y.useState(!1),[B,Se]=y.useState(!1),[qe,Ae]=y.useState(null),[Jt,et]=y.useState(null),Ht=P.trimStart().startsWith("!"),Qt=Ht?s:r,bt=y.useRef(null),_=y.useRef(!1),$e=y.useRef(null),wt=y.useRef(null),{currentModelId:qt,configuredModels:Lr,hasLoaded:A,loadedWorkspacePath:Ee,loadModels:en,setCurrentModel:pr,currentMode:fr,setMode:bs}=Mt(),ks=sn(w=>w.isSettingsOpen),Xs=Xr(w=>w.communicationStyle),Jd=H(w=>w.setMaxContextTokens),Pe=H(w=>w.currentSessionRef),Qd=H(w=>{var Q;return(Q=w.sessions.find(K=>K.sessionId===(Pe==null?void 0:Pe.sessionId)&&K.projectPath===(Pe==null?void 0:Pe.projectPath)))==null?void 0:Q.selectedModelId}),s0=H(w=>{var Q;return(Q=w.sessions.find(K=>K.sessionId===(Pe==null?void 0:Pe.sessionId)&&K.projectPath===(Pe==null?void 0:Pe.projectPath)))==null?void 0:Q.reasoningEffort}),i0=H(w=>{var Q;return(Q=w.sessions.find(K=>K.sessionId===(Pe==null?void 0:Pe.sessionId)&&K.projectPath===(Pe==null?void 0:Pe.projectPath)))==null?void 0:Q.serviceTier}),o0=H(w=>{var Q;return(Q=w.sessions.find(K=>K.sessionId===(Pe==null?void 0:Pe.sessionId)&&K.projectPath===(Pe==null?void 0:Pe.projectPath)))==null?void 0:Q.responseVerbosity}),[a0,Yd]=y.useState(null),[c0,Zd]=y.useState(null),[l0,La]=y.useState(null),[d0,Da]=y.useState(null),u0=Lr.some(w=>w.id===Qd),xs=Pe?a0??(u0?Qd:qt):qt,nt=Lr.find(w=>w.id===xs),po=((nt==null?void 0:nt.supportedReasoningEfforts)??J5).filter(w=>w!=="auto"),fo=c0??s0,p0=X5(po),mo=fo!==void 0&&fo!=="auto"&&po.includes(fo)?fo:p0,ho=(nt==null?void 0:nt.supportedServiceTiers)??Y5,f0=["auto",...ho],Dr=l0??i0??"auto",go=(nt==null?void 0:nt.supportedResponseVerbosities)??Z5,m0=["auto",...go],_r=d0??o0??"auto",Xd=Xs??"auto",h0=po.length>1,g0=ho.some(w=>w!=="standard"),b0=go.length>0,eu=(nt==null?void 0:nt.displayName)||(nt==null?void 0:nt.model)||xs||x("chat.input.model.placeholder"),mr=((iu=nt==null?void 0:nt.input)==null?void 0:iu.includes("image"))===!0,ei=nt?x("chat.input.attachment.modelUnsupported",{model:eu}):x("chat.input.attachment.modelRequired"),bo=D.length>0&&!mr,tn=H5(P,le,{workspacePath:C}),nn=L5(P,le,{workspacePath:C}),ys=U5(),ti=tn.hasQuery&&tn.suggestions.length>0,ko=nn.hasQuery&&nn.suggestions.length>0,k0=ti||ko;y.useEffect(()=>{!ks&&(!A||Ee!==(C??null))&&en(C??void 0)},[ks,en,Ee,A,C]),y.useEffect(()=>{i&&(de(!1),ue(!1),He(!1),We(!1),J(!1))},[i]),y.useEffect(()=>{Yd(null),Zd(null),La(null),Da(null)},[Pe==null?void 0:Pe.projectPath,Pe==null?void 0:Pe.sessionId]),y.useEffect(()=>{Dr!=="auto"&&!ho.includes(Dr)&&La("auto")},[Dr,ho]),y.useEffect(()=>{_r!=="auto"&&!go.includes(_r)&&Da("auto")},[_r,go]),y.useEffect(()=>{et(null)},[xs]),y.useEffect(()=>{if(p!==void 0){const w=h??T.current;I.current=p,T.current=w,L(p),j(w),Ae(null),et(null),xe(p.length),mn(k,{content:p,attachments:w}),requestAnimationFrame(()=>{var Q;return(Q=$e.current)==null?void 0:Q.focus()})}},[p,h,k,b]),y.useEffect(()=>()=>{mn(k,{content:I.current,attachments:T.current,outputSchema:te.current})},[k]),y.useEffect(()=>{if(!nt)return;const w=!!nt.contextWindow;Jd(nt.contextWindow||0,!w)},[nt,Jd]),y.useEffect(()=>{mr&&Ae(w=>w!==bt.current?w:(bt.current=null,null))},[mr]);const _a=y.useCallback(async()=>{if(!P.trim()&&D.length===0||n||Qt||bo||_.current)return;let w;if(M.trim()){if(Ht){ce(x("chat.input.outputSchema.shellUnsupported")),J(!0);return}try{const K=JSON.parse(M);if(!K||typeof K!="object"||Array.isArray(K))throw new Error("schema root must be an object");w=K}catch{ce(x("chat.input.outputSchema.invalid")),J(!0);return}}P.trim()&&ys.addToHistory(P),_.current=!0,Se(!0);const Q=k;try{if(await e({content:P,modelId:xs??void 0,reasoningEffort:mo,serviceTier:Dr,responseVerbosity:_r,communicationStyle:Xd,attachments:D,...w?{outputSchema:w}:{}})===!1)return;r0(Q),I.current="",T.current=[],te.current="",L(""),j([]),$(""),ce(null),Ae(null),et(null),bt.current=null,xe(void 0)}catch{}finally{_.current=!1,Se(!1)}},[D,bo,k,P,Ht,n,xs,mo,_r,Xd,Dr,Qt,e,M,ys,x]),x0=y.useCallback(w=>{Ae(null),et(null),bt.current=null,j(Q=>{const K=Q.filter(Oe=>Oe.id!==w);return T.current=K,mn(k,{content:I.current,attachments:K}),K})},[k]),tu=y.useCallback(w=>new Promise((Q,K)=>{const Oe=new FileReader;Oe.onload=()=>{if(typeof Oe.result!="string"){K(new Error("Failed to read image"));return}Q({id:typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:w.name,mimeType:w.type,dataUrl:Oe.result})},Oe.onerror=()=>K(Oe.error??new Error("Failed to read image")),Oe.readAsDataURL(w)}),[]),xo=y.useCallback(async w=>{if(w.length===0)return;if(!mr){bt.current=ei,et(null),Ae(ei);return}const Q=V5(T.current,w),K=Oe=>Oe==="count"?x("chat.input.attachment.countLimit",{count:zr}):x("chat.input.attachment.sizeLimit",{size:ac(mi)});if(!Q.accepted){bt.current=null,et(null),Ae(K(Q.reason??"bytes"));return}try{const Oe=await Promise.all(w.map(ws=>tu(ws))),Rt=new Set(T.current.map(ws=>ws.dataUrl)),ou=Oe.filter(ws=>Rt.has(ws.dataUrl)?!1:(Rt.add(ws.dataUrl),!0));if(ou.length===0){Ae(null),et(null),bt.current=null;return}const yo=[...T.current,...ou];if(_c(yo)>mi){bt.current=null,et(null),Ae(K("bytes"));return}T.current=yo,j(yo),Ae(null),et(null),bt.current=null,mn(k,{content:I.current,attachments:yo})}catch{bt.current=null,et(null),Ae(x("chat.input.attachment.readFailed"))}},[k,ei,mr,tu,x]),y0=y.useCallback(async w=>{const Q=Array.from(w.target.files??[]).filter(K=>K.type.startsWith("image/"));await xo(Q),w.target.value=""},[xo]),w0=y.useCallback(async w=>{const Q=Array.from(w.clipboardData.items).filter(K=>K.type.startsWith("image/")).map(K=>K.getAsFile()).filter(K=>K!==null);Q.length!==0&&(w.preventDefault(),await xo(Q))},[xo]),Ua=y.useCallback(w=>{const Q=tn.suggestions[w];if(!Q)return;const{newInput:K,newCursorPos:Oe}=q5(P,tn,Q);I.current=K,L(K),xe(Oe),mn(k,{content:K,attachments:T.current}),requestAnimationFrame(()=>{$e.current&&($e.current.focus(),$e.current.setSelectionRange(Oe,Oe))})},[k,P,tn]),Ba=y.useCallback(w=>{const Q=nn.suggestions[w];if(!Q)return;const{newInput:K,newCursorPos:Oe}=_5(P,nn,Q);I.current=K,L(K),xe(Oe),mn(k,{content:K,attachments:T.current}),requestAnimationFrame(()=>{$e.current&&($e.current.focus(),$e.current.setSelectionRange(Oe,Oe))})},[nn,k,P]),v0=y.useCallback(w=>{if(ti){if(w.key==="ArrowDown"){w.preventDefault(),tn.selectNext();return}if(w.key==="ArrowUp"){w.preventDefault(),tn.selectPrevious();return}if(w.key==="Tab"||w.key==="Enter"&&!w.shiftKey){w.preventDefault(),Ua(tn.selectedIndex);return}if(w.key==="Escape"){w.preventDefault(),xe(void 0);return}}if(ko){if(w.key==="ArrowDown"){w.preventDefault(),nn.selectNext();return}if(w.key==="ArrowUp"){w.preventDefault(),nn.selectPrevious();return}if(w.key==="Tab"||w.key==="Enter"&&!w.shiftKey){w.preventDefault(),Ba(nn.selectedIndex);return}if(w.key==="Escape"){w.preventDefault(),xe(void 0);return}}if(w.key==="Enter"&&!w.shiftKey){w.preventDefault(),_a();return}if(w.key==="ArrowUp"&&!w.shiftKey){const Q=w.target,K=Q.selectionStart===0&&Q.selectionEnd===0,Oe=!P.includes(`
|
|
270
270
|
`);if(K||Oe){const Rt=ys.getPrevious(P);Rt!==null&&(w.preventDefault(),I.current=Rt,L(Rt),mn(k,{content:Rt,attachments:T.current}),requestAnimationFrame(()=>{$e.current&&$e.current.setSelectionRange(Rt.length,Rt.length)}))}return}if(w.key==="ArrowDown"&&!w.shiftKey){const Q=w.target,K=Q.selectionStart===P.length&&Q.selectionEnd===P.length,Oe=!P.includes(`
|
|
271
|
-
`);if((K||Oe)&&ys.historyIndex!==-1){const Rt=ys.getNext();Rt!==null&&(w.preventDefault(),I.current=Rt,L(Rt),mn(k,{content:Rt,attachments:T.current}),requestAnimationFrame(()=>{$e.current&&$e.current.setSelectionRange(Rt.length,Rt.length)}))}}},[ti,yo,tn,nn,Ba,Ha,Ua,k,P,ys]),P0=y.useCallback(w=>{const Q=w.target.value;I.current=Q,L(Q),xe(w.target.selectionStart),mn(k,{content:Q,attachments:T.current})},[k]),su=y.useCallback(w=>{const Q=w.target;xe(Q.selectionStart)},[]);y.useEffect(()=>{$e.current&&($e.current.style.height="inherit",$e.current.style.height=`${Math.min($e.current.scrollHeight,200)}px`)},[P]);const qa=cc.find(w=>w.value===fr)??cc[1],N0=x(qa.labelKey),O0=qa.icon,R0=!!P.trim()||D.length>0,iu=D.length>=zr,M0=Bc(D),za=qe||(xo?ei:null),ou=za?null:Jt,Ka=!!n||B,$0=Ka||iu||!mr,ni=mr?iu?x("chat.input.attachment.countLimit",{count:zr}):x("chat.input.attachment.add"):ei,F0=()=>{Ka||(et(ni),!mr&&!i&&Lr.some(w=>{var Q;return(Q=w.input)==null?void 0:Q.includes("image")})&&de(!0))};return a.jsxs("div",{"data-chat-input-shell":!0,className:m==="task"?"bg-transparent":"py-2.5 border-t border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas))]",children:[a.jsxs("div",{"data-chat-input-inner":!0,className:m==="task"?"w-full":"px-4 w-full md:px-6",children:[a.jsxs("div",{className:`relative border rounded-lg bg-[hsl(var(--deck-surface))] transition-all duration-200 flex flex-col ${m==="task"?`min-h-[148px] shadow-[0_18px_60px_-24px_hsl(var(--deck-accent)/0.4)] focus-within:ring-1 ${Ht?"border-amber-400/70 focus-within:border-amber-500 focus-within:ring-amber-400/25":"border-[hsl(var(--deck-border))] focus-within:border-[hsl(var(--deck-accent)/0.6)] focus-within:ring-[hsl(var(--deck-accent)/0.25)]"}`:`min-h-[56px] shadow-sm focus-within:ring-1 ${Ht?"border-amber-400/70 focus-within:border-amber-500 focus-within:ring-amber-400/25":"border-[hsl(var(--deck-border))] focus-within:border-[hsl(var(--deck-border-strong))] focus-within:ring-[hsl(var(--deck-border-strong))]"}`}`,children:[a.jsx(xp,{type:"command",suggestions:tn.suggestions,selectedIndex:tn.selectedIndex,loading:tn.loading,onSelect:Ba,onHover:tn.setSelectedIndex,visible:ti}),a.jsx(xp,{type:"file",suggestions:nn.suggestions,selectedIndex:nn.selectedIndex,loading:nn.loading,onSelect:Ha,onHover:nn.setSelectedIndex,visible:yo&&!ti}),a.jsx(Uc,{ref:$e,"data-blade-composer":!0,value:P,onChange:P0,onKeyDown:A0,onPaste:T0,onSelect:su,onClick:su,placeholder:S??x(i?"chat.input.placeholder.steering":"chat.input.placeholder.default"),className:`flex-1 w-full resize-none border-0 bg-transparent px-4 focus-visible:ring-0 focus-visible:ring-offset-0 focus:outline-none text-[#111827] dark:text-zinc-300 placeholder:text-[#9CA3AF] dark:placeholder:text-zinc-600 ${m==="task"?"min-h-[84px] py-4 text-[15px]":"py-2.5 text-[14px]"}`,disabled:n||B,"aria-busy":B}),Ht&&a.jsx("div",{className:"px-4 pb-2 font-mono text-[11px] text-amber-600 dark:text-amber-400",children:"$ user shell · runs in this Session workspace"}),i&&a.jsx("div",{className:"px-4 pb-2 text-[11px] font-mono text-amber-600 dark:text-amber-400",children:d>0&&f==="next_turn"?x("chat.input.followUp.queued",{count:d}):d>0?x("chat.input.steering.queued",{count:d}):a.jsxs(a.Fragment,{children:[x("chat.input.steering.status"),x("chat.input.steering.enterHint")]})}),u>0&&a.jsx("div",{className:"px-4 pb-2 text-[11px] font-mono text-cyan-600 dark:text-cyan-400",children:u===1?x("chat.input.steering.recoveredOne",{count:u}):x("chat.input.steering.recoveredMany",{count:u})}),za&&a.jsxs("div",{role:"alert",className:"mx-4 mb-2 flex min-h-8 items-center gap-2 rounded-md border border-red-200 bg-red-50 px-2.5 py-1.5 text-[11px] text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300",children:[a.jsx(Ns,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:za}),qe&&a.jsx("button",{type:"button","aria-label":x("chat.error.dismiss"),onClick:()=>{Ae(null),bt.current=null},className:"flex justify-center items-center w-6 h-6 text-red-500 rounded shrink-0 hover:bg-red-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 dark:hover:bg-red-950",children:a.jsx(pi,{className:"w-3 h-3"})})]}),ou&&a.jsxs("div",{role:"status","aria-live":"polite",className:"mx-4 mb-2 flex min-h-8 items-center gap-2 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))] px-2.5 py-1.5 text-[11px] text-[hsl(var(--deck-ink-muted))]",children:[a.jsx(by,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"}),a.jsx("span",{className:"flex-1 min-w-0",children:ou}),a.jsx("button",{type:"button","aria-label":x("chat.notice.dismiss"),onClick:()=>et(null),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(pi,{className:"w-3 h-3"})})]}),D.length>0&&a.jsxs("div",{className:"px-4 pb-2",children:[a.jsx("div",{className:"mb-1.5 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:x("chat.input.attachment.usage",{count:D.length,limit:zr,used:lc(M0),budget:lc(hi)})}),a.jsx("div",{className:"flex flex-wrap gap-2",children:D.map(w=>a.jsxs("div",{title:w.name,className:"relative overflow-hidden rounded-md border border-[#E5E7EB] bg-[#F9FAFB] dark:border-zinc-800 dark:bg-zinc-900",children:[a.jsx("img",{src:w.dataUrl,alt:w.name,className:"object-cover w-20 h-20"}),a.jsx("button",{type:"button","aria-label":`${x("chat.input.attachment.remove")} ${w.name}`,title:`${x("chat.input.attachment.remove")} ${w.name}`,onClick:()=>C0(w.id),className:"flex absolute top-1 right-1 justify-center items-center w-6 h-6 text-white rounded transition-colors bg-black/75 hover:bg-black focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white",children:a.jsx(pi,{className:"w-3 h-3"})})]},w.id))})]}),a.jsxs("div",{className:"flex justify-between items-center px-3 py-2 mt-auto",children:[a.jsxs("div",{className:"flex gap-2 items-center",children:[$0?a.jsx("button",{type:"button",disabled:Ka,"aria-disabled":"true","aria-label":ni,title:ni,onClick:F0,className:"flex h-8 w-8 cursor-help items-center justify-center rounded-md text-[#9CA3AF] opacity-55 transition-colors hover:bg-[hsl(var(--deck-surface-2))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed dark:text-zinc-500",children:a.jsx(bu,{className:"w-4 h-4"})}):a.jsxs("label",{title:ni,className:"relative flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[#9CA3AF] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-within:ring-1 focus-within:ring-[hsl(var(--deck-accent))] dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-300",children:[a.jsx("input",{ref:wt,type:"file",accept:"image/*",multiple:!0,"aria-label":ni,className:"absolute inset-0 z-10 w-full h-full opacity-0 cursor-pointer",onChange:E0}),a.jsx(bu,{className:"w-4 h-4"})]}),a.jsxs(Yn,{open:Z,onOpenChange:w=>{!i&&!B&&de(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,title:x(i?"chat.input.model.locked":"chat.input.model.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 text-xs text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[nu,a.jsx(js,{className:"w-3 h-3"})]})}),a.jsx(_n,{className:"w-64 p-2 bg-white dark:bg-zinc-900 border border-[#E5E7EB] dark:border-zinc-700",align:"start",children:a.jsx("div",{className:"overflow-y-auto max-h-72",children:Lr.length===0?a.jsx("div",{className:"text-xs text-[#6B7280] dark:text-zinc-500 px-2 py-2",children:x("chat.input.model.empty")}):Object.entries(Lr.reduce((w,Q)=>{const K=Q.provider||"unknown";return w[K]||(w[K]=[]),w[K].push(Q),w},{})).map(([w,Q])=>a.jsxs("div",{className:"mb-2",children:[a.jsx("div",{className:"text-xs text-[#6B7280] dark:text-zinc-500 px-2 py-1 capitalize",children:w.replace(/-/g," ")}),Q.map(K=>{var Oe;return a.jsx("button",{className:`w-full text-left px-2 py-1.5 text-sm rounded hover:bg-[#E5E7EB] dark:hover:bg-zinc-800 transition-colors ${K.id===xs?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,onClick:()=>{if(et(null),Pe){Xd(K.id),de(!1);return}pr(K.id,C??void 0).then(()=>de(!1)).catch(()=>{})},children:a.jsxs("span",{className:"flex gap-2 items-center min-w-0",children:[a.jsx("span",{className:"flex-1 min-w-0 truncate",children:K.displayName||K.model}),((Oe=K.input)==null?void 0:Oe.includes("image"))&&a.jsx("span",{className:"shrink-0 rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 font-mono text-[8.5px] uppercase tracking-[0.08em] text-[hsl(var(--deck-accent))]",children:x("chat.input.model.vision")})]})},K.id)})]},w))})})]}),v0&&a.jsxs(Yn,{open:R,onOpenChange:w=>{!i&&!B&&ue(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.effort.change"),title:x(i?"chat.input.effort.locked":"chat.input.effort.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 font-mono text-[11px] text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[x("chat.input.effort.label",{effort:go}),a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(_n,{className:"w-52 border border-[#E5E7EB] bg-white p-1 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsx("div",{className:"px-2 py-1 font-mono text-[9px] uppercase tracking-[0.12em] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.effort.heading")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:mo.map(w=>a.jsx("button",{type:"button","aria-label":x("chat.input.effort.option",{effort:w}),onClick:()=>{eu(w),ue(!1)},className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-[#E5E7EB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] dark:hover:bg-zinc-800 ${go===w?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,children:a.jsx("span",{className:"capitalize",children:w})},w))})]})]}),S0&&a.jsxs(Yn,{open:ve,onOpenChange:w=>{!i&&!B&&He(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.serviceTier.change"),title:x(i?"chat.input.serviceTier.locked":"chat.input.serviceTier.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 font-mono text-[11px] text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[x("chat.input.serviceTier.label",{tier:Dr}),a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(_n,{className:"w-52 border border-[#E5E7EB] bg-white p-1 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsx("div",{className:"px-2 py-1 font-mono text-[9px] uppercase tracking-[0.12em] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.serviceTier.heading")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:y0.map(w=>a.jsxs("button",{type:"button","aria-label":x("chat.input.serviceTier.option",{tier:w}),onClick:()=>{Da(w),He(!1)},className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-[#E5E7EB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] dark:hover:bg-zinc-800 ${Dr===w?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,children:[a.jsx("span",{className:"capitalize",children:w}),w==="fast"&&a.jsx("span",{className:"text-[9px] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.serviceTier.fastHint")}),w==="flex"&&a.jsx("span",{className:"text-[9px] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.serviceTier.flexHint")})]},w))})]})]}),j0&&a.jsxs(Yn,{open:yt,onOpenChange:w=>{!i&&!B&&We(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.responseVerbosity.change"),title:x(i?"chat.input.responseVerbosity.locked":"chat.input.responseVerbosity.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 font-mono text-[11px] text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[x("chat.input.responseVerbosity.label",{verbosity:_r}),a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(_n,{className:"w-52 border border-[#E5E7EB] bg-white p-1 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsx("div",{className:"px-2 py-1 font-mono text-[9px] uppercase tracking-[0.12em] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.responseVerbosity.heading")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:w0.map(w=>a.jsxs("button",{type:"button","aria-label":x("chat.input.responseVerbosity.option",{verbosity:w}),onClick:()=>{_a(w),We(!1)},className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-[#E5E7EB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] dark:hover:bg-zinc-800 ${_r===w?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,children:[a.jsx("span",{className:"capitalize",children:w}),w==="auto"&&a.jsx("span",{className:"text-[9px] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.responseVerbosity.autoHint")})]},w))})]})]}),a.jsxs(Yn,{open:O,onOpenChange:w=>{!i&&!B&&J(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.outputSchema.change"),title:x(i?"chat.input.outputSchema.locked":"chat.input.outputSchema.change"),className:`flex h-7 items-center gap-1 rounded px-1.5 font-mono text-[10.5px] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 ${M.trim()?"bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"text-[#6B7280] hover:bg-[#E5E7EB] hover:text-[#111827] dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200"}`,children:[a.jsx(oy,{className:"h-3.5 w-3.5"}),M.trim()&&"JSON"]})}),a.jsxs(_n,{className:"w-[min(440px,calc(100vw-24px))] border border-[#E5E7EB] bg-white p-0 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsxs("div",{className:"border-b border-[#E5E7EB] px-3 py-2.5 dark:border-zinc-800",children:[a.jsx("div",{className:"font-mono text-[11px] font-semibold text-[#111827] dark:text-zinc-100",children:x("chat.input.outputSchema.title")}),a.jsx("div",{className:"mt-0.5 text-[10.5px] leading-4 text-[#6B7280] dark:text-zinc-500",children:x("chat.input.outputSchema.description")})]}),a.jsxs("div",{className:"p-3",children:[a.jsx(Uc,{value:M,onChange:w=>{const Q=w.target.value;te.current=Q,$(Q),ce(null),mn(k,{content:I.current,attachments:T.current,outputSchema:Q})},spellCheck:!1,"aria-label":x("chat.input.outputSchema.editor"),"aria-invalid":!!ae,placeholder:x("chat.input.outputSchema.placeholder"),className:"min-h-[180px] resize-y border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] font-mono text-[11px] leading-5 focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]"}),ae&&a.jsxs("div",{role:"alert",className:"mt-2 flex items-center gap-1.5 text-[10.5px] text-red-600 dark:text-red-400",children:[a.jsx(Ns,{className:"h-3.5 w-3.5"}),ae]}),a.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[a.jsx("button",{type:"button",onClick:()=>{const w=JSON.stringify({type:"object",properties:{summary:{type:"string"}},required:["summary"],additionalProperties:!1},null,2);te.current=w,$(w),ce(null),mn(k,{content:I.current,attachments:T.current,outputSchema:w})},className:"rounded px-2 py-1 font-mono text-[10.5px] text-[hsl(var(--deck-accent))] hover:bg-[hsl(var(--deck-accent-soft))]",children:x("chat.input.outputSchema.example")}),a.jsx("button",{type:"button",onClick:()=>{te.current="",$(""),ce(null),mn(k,{content:I.current,attachments:T.current,outputSchema:""})},className:"rounded px-2 py-1 font-mono text-[10.5px] text-[#6B7280] hover:bg-[#F3F4F6] dark:text-zinc-400 dark:hover:bg-zinc-800",children:x("chat.input.outputSchema.clear")})]})]})]})]}),a.jsxs(Yn,{open:tt,onOpenChange:Y,children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{"data-blade-permission-mode":fr,className:`flex items-center gap-1.5 rounded px-2 py-1 text-xs transition-colors ${qa.tone==="danger"?"text-amber-600 hover:bg-amber-500/10 dark:text-amber-400":"text-[#6B7280] hover:bg-[#E5E7EB] hover:text-[#111827] dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200"}`,children:[a.jsx(O0,{className:"h-3.5 w-3.5"}),N0,a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(_n,{className:"w-72 p-1.5 bg-white dark:bg-zinc-900 border border-[#E5E7EB] dark:border-zinc-700",align:"start",children:[a.jsx("div",{className:"px-2 pb-1.5 pt-1 text-[11px] font-medium text-[#9CA3AF] dark:text-zinc-500",children:x("chat.input.mode.aria")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:cc.map(w=>{const Q=w.icon,K=fr===w.value,Oe=w.tone==="danger";return a.jsxs("button",{type:"button","data-blade-permission-option":w.value,"aria-pressed":K,className:`flex w-full items-start gap-2.5 rounded-md px-2 py-2 text-left transition-colors ${K?"bg-[#F3F4F6] dark:bg-zinc-800/70":"hover:bg-[#F3F4F6] dark:hover:bg-zinc-800/50"}`,onClick:()=>{w.value===kr.YOLO&&fr!==kr.YOLO?(Y(!1),F(!0)):(bs(w.value),Y(!1))},children:[a.jsx(Q,{className:`mt-0.5 h-4 w-4 shrink-0 ${Oe?"text-amber-500":K?"text-[#111827] dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`}),a.jsxs("span",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:`block text-[13px] font-medium leading-tight ${Oe?"text-amber-600 dark:text-amber-400":"text-[#111827] dark:text-zinc-100"}`,children:x(w.labelKey)}),a.jsx("span",{className:"mt-0.5 block text-[11px] leading-snug text-[#6B7280] dark:text-zinc-500",children:x(w.descriptionKey)})]}),K&&a.jsx(Ap,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"})]},w.value)})})]})]})]}),a.jsxs("div",{className:"flex gap-2 items-center",children:[i&&a.jsx(Kr,{size:"icon",onClick:()=>{t==null||t()},disabled:o,title:x(o?"chat.input.action.stopping":"chat.input.action.stop"),"aria-label":x(o?"chat.input.action.stopping":"chat.input.action.stop"),className:"w-8 h-8 text-white bg-red-500 hover:bg-red-600",children:o?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Wc,{className:"w-3 h-3"})}),a.jsx(Kr,{size:"icon","data-blade-submit":!0,onClick:Ua,disabled:!R0||n||Qt||xo||B||I0,title:x(B?"chat.input.action.submitting":i?"chat.input.action.steer":"chat.input.action.send"),"aria-label":x(B?"chat.input.action.submitting":i?"chat.input.action.steer":"chat.input.action.send"),className:"h-8 w-8 bg-[#111827] text-white hover:bg-[#0F172A] disabled:bg-[#E5E7EB] disabled:text-[#9CA3AF] dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white dark:disabled:bg-zinc-800 dark:disabled:text-zinc-600",children:B?a.jsx(mt,{className:"w-4 h-4 animate-spin"}):a.jsx(Sy,{className:"w-4 h-4"})})]})]})]}),m==="chat"&&a.jsx("div",{className:"text-center text-xs text-[#6B7280] dark:text-zinc-600 mt-3 font-mono",children:x("chat.footer.disclaimer")})]}),a.jsx(Qc,{open:pt,onOpenChange:F,children:a.jsx(Xo,{className:"gap-0 rounded-xl border border-zinc-200 bg-white p-0 dark:border-zinc-800 dark:bg-[#09090b] sm:max-w-[400px]","aria-describedby":"yolo-confirm-desc",hideCloseButton:!0,children:a.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[a.jsxs("div",{className:"flex gap-3 items-center",children:[a.jsx("div",{className:"flex justify-center items-center w-9 h-9 bg-amber-100 rounded-full dark:bg-amber-950/40",children:a.jsx(Mp,{className:"w-5 h-5 text-amber-600 dark:text-amber-400"})}),a.jsx(ea,{className:"font-mono text-sm font-semibold",children:x("chat.input.mode.yolo.confirm.title")})]}),a.jsx(ta,{id:"yolo-confirm-desc",className:"text-[13px] leading-relaxed text-zinc-600 dark:text-zinc-400",children:x("chat.input.mode.yolo.confirm.desc")}),a.jsxs("div",{className:"flex gap-2 justify-end items-center pt-1",children:[a.jsx("button",{type:"button",onClick:()=>F(!1),className:"h-8 rounded-md px-3 font-mono text-[12px] font-medium text-zinc-600 transition-colors hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800",children:x("chat.input.mode.yolo.confirm.cancel")}),a.jsx("button",{type:"button","data-blade-yolo-confirm":!0,onClick:()=>{bs(kr.YOLO),F(!1)},className:"h-8 rounded-md bg-amber-600 px-3 font-mono text-[12px] font-semibold text-white transition-colors hover:bg-amber-700",children:x("chat.input.mode.yolo.confirm.accept")})]})]})})})]})}const m3={running:{dot:"bg-blue-500 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse",labelKey:"recent.status.running",text:"text-blue-700 dark:text-blue-400"},queued:{dot:"bg-amber-400",labelKey:"recent.status.queued",text:"text-amber-700 dark:text-amber-400"},interrupted:{dot:"bg-orange-500",labelKey:"recent.status.paused",text:"text-orange-700 dark:text-orange-400"},failed:{dot:"bg-red-500",labelKey:"recent.status.failed",text:"text-red-700 dark:text-red-400"},cancelled:{dot:"bg-zinc-400",labelKey:"recent.status.cancelled",text:"text-zinc-500"},completed:{dot:"bg-[hsl(var(--deck-accent))]",labelKey:"recent.status.done",text:"text-[hsl(var(--deck-accent))]"}};function h3(e,t){if(!e)return"";const n=new Date(e);if(Number.isNaN(n.getTime()))return"";const r=Date.now()-n.getTime(),s=Math.floor(r/6e4);if(s<1)return t("recent.time.justNow");if(s<60)return t("recent.time.minutes",{n:s});const i=Math.floor(s/60);if(i<24)return t("recent.time.hours",{n:i});const o=Math.floor(i/24);return t("recent.time.days",{n:o})}function g3(e){return e.split("/").filter(Boolean).at(-1)||e}function b3({sessions:e,onSelect:t,cancellingTaskKeys:n,retryingTaskKeys:r,unreadTaskKeys:s,onCancel:i,onRetry:o,catalogLoadState:d="ready",className:f}){const u=Ut(),m=[...e].sort(Qd).slice(0,4),p=d==="loading"||d==="hydrating";return m.length===0?!p&&d!=="error"?null:a.jsxs("div",{role:d==="error"?"alert":"status",className:W("mt-7 flex items-center gap-2 rounded-md border border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-surface))]/50 px-3 py-2 font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",f),children:[p?a.jsx(mt,{className:"h-3 w-3 animate-spin text-[hsl(var(--deck-accent))]"}):a.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500"}),u(p?"sidebar.catalog.syncing":"sidebar.catalog.incomplete")]}):a.jsxs("div",{className:W("mt-7",f),children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsx("span",{className:"deck-eyebrow text-[hsl(var(--deck-ink-faint))]",children:u("taskHome.recent.title")}),a.jsx("span",{className:"font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:u(p?"taskHome.recent.partial":d==="error"?"taskHome.recent.incomplete":"taskHome.recent.total",{count:e.length})})]}),a.jsx("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:m.map(h=>{const b=m3[h.taskStatus],k=h.pendingInteraction?h.pendingInteraction.type==="question"?"interaction.badge.question":h.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission":null,S=g3(h.taskSourceProjectPath||h.projectPath),C=bi(h,u),x=Re(he(h)),N=h.taskStatus==="running"||h.taskStatus==="queued",P=n.includes(x),L=r.includes(x),D=!!h.taskRetryAvailable&&(h.taskStatus==="failed"||h.taskStatus==="interrupted"||h.taskStatus==="cancelled"),j=s.includes(x),I=Vd(h,u);return a.jsxs("div",{className:W("group flex items-center gap-3 rounded-md border border-transparent px-3 py-1.5 text-left transition-colors","hover:border-[hsl(var(--deck-border))] hover:bg-[hsl(var(--deck-surface))]"),children:[a.jsxs("button",{type:"button",onClick:()=>t(h),className:"flex min-w-0 flex-1 items-center gap-3 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx("span",{className:W("h-1.5 w-1.5 shrink-0 rounded-full",k?"animate-pulse bg-amber-500 shadow-[0_0_5px_rgba(245,158,11,0.75)]":b.dot)}),a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-[12.5px] text-[hsl(var(--deck-ink))]",children:[a.jsx("span",{className:"truncate",children:C}),j&&a.jsx("span",{title:u("taskSwitcher.new"),className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.75)]"}),h.taskRetriedFrom&&a.jsx("span",{title:`${u("session.retriedFrom")} ${h.taskRetriedFrom.sessionId.slice(0,6)}`,className:"shrink-0 font-mono text-[8.5px] text-[hsl(var(--deck-accent))]",children:u("session.retryShort")})]}),a.jsxs("span",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx("span",{className:"truncate",children:S}),a.jsx("span",{className:"opacity-40",children:"·"}),a.jsx("span",{className:W("shrink-0",k?"text-amber-700 dark:text-amber-400":b.text),children:u(k??b.labelKey)}),a.jsx("span",{className:"opacity-40",children:"·"}),a.jsx("span",{className:"shrink-0",children:h3(h.lastMessageTime||h.firstMessageTime,u)})]}),I&&a.jsx("span",{title:I,className:"mt-0.5 block truncate font-mono text-[9.5px] text-red-600 dark:text-red-400",children:I})]}),a.jsx(iy,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-ink-faint))] opacity-0 transition-opacity group-hover:opacity-100"})]}),N&&a.jsx("button",{type:"button","aria-label":u(P?"session.action.stopping":"session.action.stop",{title:C}),disabled:P,onClick:()=>i(h),className:"rounded p-1.5 text-red-500 transition-colors hover:bg-red-500/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:cursor-wait disabled:opacity-60",children:P?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Wc,{className:"h-3.5 w-3.5"})}),D&&a.jsx("button",{type:"button","aria-label":u(L?"session.action.retrying":"session.action.retry",{title:C}),disabled:L,onClick:()=>o(h),className:"rounded p-1.5 text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-60",children:L?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Zo,{className:"h-3.5 w-3.5"})})]},x)})})]})}function k3({index:e,title:t,description:n,icon:r,hint:s,onClick:i}){const o=String(e+1).padStart(2,"0"),d=`⌘${e+1}`;return a.jsxs("button",{type:"button",onClick:i,className:W("group relative flex min-h-[100px] flex-col justify-between overflow-hidden rounded-lg border p-3.5 text-left transition","border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]","hover:-translate-y-[1px] hover:border-[hsl(var(--deck-accent)/0.55)] hover:shadow-[0_10px_28px_-14px_hsl(var(--deck-accent)/0.35)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--deck-accent))] focus-visible:ring-offset-2 focus-visible:ring-offset-[hsl(var(--deck-canvas))]","dark:bg-[hsl(var(--deck-surface))] dark:hover:shadow-[0_10px_28px_-14px_hsl(var(--deck-accent)/0.55)]"),children:[a.jsx("span",{"aria-hidden":"true",className:W("pointer-events-none absolute right-3 top-3 h-2 w-2","border-r border-t border-[hsl(var(--deck-border-strong))]","transition-colors group-hover:border-[hsl(var(--deck-accent))]")}),a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx("span",{className:W("inline-flex h-8 w-8 items-center justify-center rounded-md border transition-colors","border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))]","group-hover:border-[hsl(var(--deck-accent)/0.5)] group-hover:bg-[hsl(var(--deck-accent-soft))]"),children:a.jsx(r,{className:"h-4 w-4 text-[hsl(var(--deck-ink-muted))] transition-colors group-hover:text-[hsl(var(--deck-accent))]"})}),a.jsx("span",{className:"font-mono text-[10px] tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:o})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[13px] font-semibold text-[hsl(var(--deck-ink))]",children:t}),a.jsx("div",{className:"mt-1 line-clamp-2 text-[11.5px] leading-[1.45] text-[hsl(var(--deck-ink-muted))]",children:n}),a.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[a.jsx("span",{className:"truncate font-mono text-[10px] text-[hsl(var(--deck-ink-faint))] opacity-0 transition-opacity group-hover:opacity-100",children:s}),a.jsx("span",{className:"deck-kbd shrink-0 opacity-0 transition-opacity group-hover:opacity-100",children:d})]})]})]})}const dc=[{key:"explore",titleKey:"taskHome.template.explore.title",descriptionKey:"taskHome.template.explore.description",icon:Vc,prompt:"Explore this codebase and explain ",hintKey:"taskHome.template.explore.hint"},{key:"build",titleKey:"taskHome.template.build.title",descriptionKey:"taskHome.template.build.description",icon:my,prompt:"Build a production-ready ",hintKey:"taskHome.template.build.hint"},{key:"review",titleKey:"taskHome.template.review.title",descriptionKey:"taskHome.template.review.description",icon:vy,prompt:"/review uncommitted",hintKey:"taskHome.template.review.hint"},{key:"fix",titleKey:"taskHome.template.fix.title",descriptionKey:"taskHome.template.fix.description",icon:Iy,prompt:"Investigate and fix ",hintKey:"taskHome.template.fix.hint"}];function x3(e,t){return t?t.split("/").filter(Boolean).at(-1)||t:e("taskHome.hero.projectFallback")}function y3(){const e=Ut(),{taskWorkspaceInfo:t,isTaskWorkspaceLoading:n,taskWorkspaceError:r,isDispatchingTask:s,sessions:i,boundProjects:o,selectedProjectPath:d,error:f,selectProject:u,dispatchTask:m,startCodeReview:p,sendMessage:h,startTemporarySession:b,selectSession:k,cancelTask:S,cancellingTaskKeys:C,retryTask:x,retryingTaskKeys:N,unreadTaskKeys:P,taskEventConnectionState:L,catalogLoadState:D,reconnectTaskEvents:j,clearError:I,loadTaskWorkspaceInfo:T,loadBoundProjects:M}=H(),$=sn(_=>_.openSettings),te=sn(_=>_.isSettingsOpen),O=Mt(_=>_.currentMode),J=Mt(_=>_.currentModelId),ae=Mt(_=>_.configuredModels),ce=Mt(_=>_.isLoading),le=Mt(_=>_.hasLoaded),xe=Mt(_=>_.loadedWorkspacePath),Z=Mt(_=>_.error),de=Mt(_=>_.loadModels),[R,ue]=y.useState("worktree"),[ve,He]=y.useState(),[yt,We]=y.useState(!1),tt=e(L==="connected"?"taskHome.eyebrow":L==="reconnecting"?"taskHome.feed.reconnecting":L==="offline"?"taskHome.feed.offline":"taskHome.feed.connecting"),Y=y.useMemo(()=>o.find(_=>_.path===d)??o.find(_=>_.isCurrent),[o,d]),pt=y.useMemo(()=>JF(i,d,(t==null?void 0:t.cwd)??null),[d,i,t==null?void 0:t.cwd]),F=(Y!=null&&Y.available?Y.path:void 0)??(t==null?void 0:t.cwd),B=`task:${F??"unavailable"}`;y.useEffect(()=>{!te&&F&&(!le||xe!==F)&&de(F)},[te,de,xe,le,F]);const Se=!(Y!=null&&Y.available)&&n,qe=Y!=null&&Y.available?null:r,Ae=!!(F&&!Se&&!qe),Jt=!!(J&&ae.some(_=>_.id===J)),et=!le||ce,Ht=Ae&&Jt&&!et&&Z===null,Qt=y.useMemo(()=>({project:x3(e,(Y==null?void 0:Y.path)??(t==null?void 0:t.cwd)),branch:(Y==null?void 0:Y.gitBranch)??(t==null?void 0:t.gitBranch)??e("taskHome.context.branchFallback")}),[Y,t,e]),bt=y.useCallback(async _=>{const $e=_.content.trim();if($e==="/review"||$e.startsWith("/review ")){if(_.attachments.length>0)throw new Error(e("taskHome.review.attachmentsUnsupported"));if(_.outputSchema)throw new Error(e("taskHome.review.outputSchemaUnsupported"));const wt=$e.split(/\s+/),qt=wt[1]||"uncommitted";if(qt!=="uncommitted"&&qt!=="base"&&qt!=="commit"||qt==="uncommitted"&&wt.length!==2&&wt.length!==1||(qt==="base"||qt==="commit")&&wt.length!==3)throw new Error(e("taskHome.review.usage"));await p({projectPath:F,kind:qt,...wt[2]?{ref:wt[2]}:{},modelId:_.modelId??J??void 0});return}if(_.content.trimStart().startsWith("!")){b(F),await h({content:_.content,attachments:[]});return}await m({prompt:_.content,projectPath:F,isolation:R,permissionMode:O,modelId:_.modelId??J??void 0,reasoningEffort:_.reasoningEffort,serviceTier:_.serviceTier,responseVerbosity:_.responseVerbosity,communicationStyle:_.communicationStyle,..._.outputSchema?{outputSchema:_.outputSchema}:{},attachments:_.attachments.map(wt=>({type:"image",content:wt.dataUrl,mimeType:wt.mimeType,name:wt.name}))})},[O,J,m,R,h,p,b,F,e]);return y.useEffect(()=>{const _=$e=>{if(!($e.metaKey||$e.ctrlKey))return;const wt=Number.parseInt($e.key,10);if(Number.isNaN(wt)||wt<1||wt>dc.length)return;const qt=dc[wt-1];qt&&($e.preventDefault(),He({key:B,content:qt.prompt}))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[B]),a.jsx("main",{className:"deck-canvas relative flex-1 overflow-y-auto text-[hsl(var(--deck-ink))]",children:a.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-[960px] flex-col px-6 py-8 md:px-8 md:py-10",children:[a.jsxs("div",{className:"flex gap-4 items-start mb-6",children:[a.jsx(Jd,{size:36,className:"hidden mt-1 sm:inline-flex"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:W("deck-eyebrow flex items-center gap-2",L==="offline"?"text-amber-700 dark:text-amber-400":"text-[hsl(var(--deck-accent))]"),children:[L==="offline"?a.jsx(ku,{className:"w-3 h-3"}):a.jsx("span",{className:"deck-pulse-dot"}),tt]}),a.jsxs("h1",{className:"mt-2.5 max-w-3xl text-balance text-[clamp(28px,3vw,34px)] font-medium leading-[1.12] tracking-[-0.028em] text-[hsl(var(--deck-ink))]",children:[e("taskHome.hero.prefix")," ",a.jsx("span",{className:"whitespace-nowrap font-mono text-[0.82em] text-[hsl(var(--deck-accent))]",children:Qt.project}),a.jsx("span",{className:"text-[hsl(var(--deck-ink-muted))]",children:"?"})]}),a.jsx("p",{className:"mt-2 max-w-[46rem] text-[13px] leading-[1.55] text-[hsl(var(--deck-ink-muted))]",children:e("taskHome.hero.subtitle")})]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsx("span",{className:"deck-eyebrow text-[hsl(var(--deck-ink-faint))]",children:e("taskHome.templates.title")}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(Pp,{className:"w-3 h-3"}),a.jsx("span",{children:e("taskHome.templates.hint")})]})]}),a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-4",children:dc.map((_,$e)=>a.jsx(k3,{index:$e,title:e(_.titleKey),description:e(_.descriptionKey),icon:_.icon,hint:e(_.hintKey),onClick:()=>He({key:B,content:_.prompt})},_.key))})]}),a.jsxs("div",{"data-blade-task-dispatch-ready":Ht?"true":"false","data-blade-task-workspace-ready":Ae?"true":"false","data-blade-task-model-ready":Jt?"true":"false","data-blade-task-model-loaded":le?"true":"false","data-blade-task-model-loading":ce?"true":"false",className:"rounded-xl border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] shadow-[0_28px_80px_-32px_hsl(var(--deck-accent)/0.28),0_2px_0_hsl(var(--deck-hairline))]",children:[a.jsxs("div",{className:"flex items-center gap-0 border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-surface-2))]/50",children:[a.jsxs("div",{className:"flex flex-1 items-center min-w-0",children:[a.jsxs(Yn,{children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button","aria-label":e("taskHome.context.projectSelect"),disabled:o.length===0,className:"group flex h-9 min-w-0 items-center gap-2 border-r border-[hsl(var(--deck-hairline))] px-3 font-mono text-[11.5px] text-[hsl(var(--deck-ink))] transition-colors hover:bg-[hsl(var(--deck-surface))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))] disabled:opacity-50",children:[a.jsx(di,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"}),a.jsx("span",{className:"font-medium truncate",children:(Y==null?void 0:Y.name)??Qt.project}),a.jsx(js,{className:"h-3 w-3 shrink-0 text-[hsl(var(--deck-ink-faint))] transition-transform group-data-[state=open]:rotate-180"})]})}),a.jsx(_n,{align:"start",sideOffset:4,className:"w-56 rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-1 shadow-xl",children:a.jsxs("div",{className:"flex flex-col",children:[o.map(_=>a.jsxs("button",{type:"button",disabled:!_.available,onClick:()=>{u(_.path)},className:W("flex items-center gap-2 rounded-md px-2.5 py-1.5 text-left font-mono text-[12px] transition-colors",_.path===d?"bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-ink))]",!_.available&&"opacity-40"),children:[a.jsx(di,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0 truncate",children:_.name}),_.path===d&&a.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))]"})]},_.path)),o.length===0&&a.jsx("span",{className:"px-2.5 py-2 text-center font-mono text-[11px] text-[hsl(var(--deck-ink-faint))]",children:e("taskHome.setup.workspace.empty")})]})})]}),a.jsxs("button",{type:"button","data-blade-task-isolation":R,"aria-pressed":R==="worktree",onClick:()=>ue(_=>_==="worktree"?"local":"worktree"),className:W("flex h-9 shrink-0 items-center gap-1.5 border-r border-[hsl(var(--deck-hairline))] px-3 font-mono text-[11px] transition-colors",R==="worktree"?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-muted))] hover:text-[hsl(var(--deck-ink))]"),title:e("taskHome.context.isolationToggleTitle"),children:[R==="worktree"?a.jsx(yy,{className:"w-3 h-3"}):a.jsx(gy,{className:"w-3 h-3"}),a.jsx("span",{className:"hidden sm:inline",children:e(R==="worktree"?"taskHome.context.isolation.worktree":"taskHome.context.isolation.local")})]}),a.jsxs("span",{className:"flex h-9 shrink-0 items-center gap-1.5 border-r border-[hsl(var(--deck-hairline))] px-3 font-mono text-[11px] text-[hsl(var(--deck-ink-muted))]",children:[a.jsx(Kc,{className:"w-3 h-3"}),a.jsx("span",{className:"hidden sm:inline",children:Qt.branch})]})]}),a.jsxs("div",{className:"flex gap-2 items-center px-3 shrink-0",children:[(t==null?void 0:t.taskAdmission)&&a.jsx(Jx,{inFlight:t.taskAdmission.inFlight,queued:t.taskAdmission.queued,maxConcurrent:t.taskAdmission.maxConcurrent,compact:!0}),s&&a.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[10.5px] text-[hsl(var(--deck-accent))]",children:[a.jsx(mt,{className:"w-3 h-3 animate-spin"}),a.jsx("span",{className:"hidden sm:inline",children:e("taskHome.context.preparing")})]})]})]}),!Ht&&a.jsxs("section",{"aria-label":e("taskHome.setup.aria"),className:"border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))] px-3 py-3",children:[a.jsxs("div",{className:"mb-2.5",children:[a.jsx("h2",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.12em] text-[hsl(var(--deck-ink))]",children:e("taskHome.setup.title")}),a.jsx("p",{className:"mt-0.5 text-[11px] text-[hsl(var(--deck-ink-faint))]",children:e("taskHome.setup.description")})]}),a.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2.5",children:[a.jsx("span",{className:W("flex justify-center items-center w-7 h-7 rounded-md border shrink-0",Ae?"text-emerald-700 bg-emerald-50 border-emerald-300/70 dark:border-emerald-800/70 dark:bg-emerald-950/40 dark:text-emerald-300":qe?"text-red-700 bg-red-50 border-red-300/70 dark:border-red-900/70 dark:bg-red-950/40 dark:text-red-300":"text-amber-700 bg-amber-50 border-amber-300/70 dark:border-amber-800/70 dark:bg-amber-950/40 dark:text-amber-300"),children:Se?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):Ae?a.jsx(mu,{className:"h-3.5 w-3.5"}):qe?a.jsx(Ns,{className:"h-3.5 w-3.5"}):a.jsx(di,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"block font-mono text-[11px] font-medium text-[hsl(var(--deck-ink))]",children:e("taskHome.setup.workspace.title")}),a.jsx("span",{className:"mt-0.5 block truncate text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:Se?e("taskHome.setup.workspace.loading"):qe||(Ae?e("taskHome.setup.workspace.ready",{project:Qt.project}):e("taskHome.setup.workspace.required"))})]}),!Ae&&a.jsxs("div",{className:"flex gap-1 items-center shrink-0",children:[qe&&a.jsx("button",{type:"button",onClick:()=>{Promise.all([T(),M()])},"aria-label":e("taskHome.setup.workspace.retry"),title:e("taskHome.setup.workspace.retry"),className:"flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-canvas))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(ui,{className:"h-3.5 w-3.5"})}),a.jsxs("button",{type:"button","data-project-setup-trigger":!0,onClick:()=>We(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-2.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink))] hover:border-[hsl(var(--deck-accent)/0.55)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx($o,{className:"w-3 h-3"}),e("taskHome.setup.workspace.action")]})]})]}),a.jsxs("div",{className:"flex min-w-0 items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2.5",children:[a.jsx("span",{className:W("flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",Jt&&!Z?"border-emerald-300/70 bg-emerald-50 text-emerald-700 dark:border-emerald-800/70 dark:bg-emerald-950/40 dark:text-emerald-300":Z?"border-red-300/70 bg-red-50 text-red-700 dark:border-red-900/70 dark:bg-red-950/40 dark:text-red-300":"border-amber-300/70 bg-amber-50 text-amber-700 dark:border-amber-800/70 dark:bg-amber-950/40 dark:text-amber-300"),children:et?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):Jt&&!Z?a.jsx(mu,{className:"h-3.5 w-3.5"}):Z?a.jsx(Ns,{className:"h-3.5 w-3.5"}):a.jsx(fu,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"block font-mono text-[11px] font-medium text-[hsl(var(--deck-ink))]",children:e("taskHome.setup.model.title")}),a.jsx("span",{title:Z??void 0,className:W("mt-0.5 block truncate text-[10.5px]",Z?"text-red-600 dark:text-red-400":"text-[hsl(var(--deck-ink-faint))]"),children:et?e("taskHome.setup.model.loading"):Z||e(Jt?"taskHome.setup.model.ready":"taskHome.setup.model.required")})]}),!et&&(!Jt||Z)&&a.jsxs("button",{type:"button","data-model-setup-trigger":!0,onClick:()=>{Z?de(F):$("models")},className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-2.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink))] hover:border-[hsl(var(--deck-accent)/0.55)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[Z?a.jsx(ui,{className:"w-3 h-3"}):a.jsx(fu,{className:"w-3 h-3"}),e(Z?"taskHome.setup.model.retry":"taskHome.setup.model.action")]})]})]})]}),a.jsx("div",{className:"px-3 pt-3 pb-3",children:a.jsx(f3,{variant:"task",draft:(ve==null?void 0:ve.key)===B?ve.content:void 0,draftKey:B,placeholder:e("taskHome.composer.placeholder"),onSend:async _=>{try{return await bt(_),He(void 0),!0}catch{return!1}},disabled:s,submitDisabled:!Ht,shellSubmitDisabled:!Ht,workspacePath:F},B)})]}),L==="offline"&&a.jsxs("div",{role:"alert",className:"flex flex-wrap gap-3 items-center px-3 py-2 mt-4 text-amber-900 rounded-md border border-amber-300/70 bg-amber-50/80 dark:border-amber-800/70 dark:bg-amber-950/35 dark:text-amber-200",children:[a.jsx(ku,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{className:"min-w-0 flex-1 text-[12px]",children:e("taskHome.feed.offlineDescription")}),a.jsxs("button",{type:"button",onClick:()=>void j().catch(()=>{}),className:"inline-flex min-h-8 items-center gap-1.5 rounded-md border border-amber-400/70 bg-white/60 px-2.5 font-mono text-[10.5px] font-medium transition-colors hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 dark:border-amber-700 dark:bg-amber-950/50 dark:hover:bg-amber-900/50",children:[a.jsx(ui,{className:"w-3 h-3"}),e("taskHome.feed.retry")]})]}),f&&a.jsxs("div",{role:"alert","data-blade-task-error":!0,className:"flex justify-between items-center px-3 py-2 mt-4 font-mono text-xs text-red-700 rounded-md border border-red-200 bg-red-50/80 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300",children:[a.jsx("span",{children:f}),a.jsx("button",{type:"button",onClick:I,className:"underline",children:e("taskHome.error.dismiss")})]}),a.jsx(b3,{sessions:pt,catalogLoadState:D,cancellingTaskKeys:C,retryingTaskKeys:N,unreadTaskKeys:P,onSelect:_=>{k(he(_))},onCancel:_=>{S(he(_)).catch(()=>{})},onRetry:_=>{x(he(_)).catch(()=>{})}}),a.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx($p,{className:"w-3 h-3"}),a.jsx("span",{className:"font-mono uppercase tracking-[0.14em]",children:e("taskHome.footer.note")})]}),a.jsx(s0,{open:yt,onOpenChange:We})]})})}const Hc="blade.sessions.last",ki="session",qc="project",Mo="workspace",zc="view";function w3(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return typeof t.sessionId=="string"&&t.sessionId.trim()&&typeof t.projectPath=="string"&&t.projectPath.trim()?{sessionId:t.sessionId,projectPath:t.projectPath}:null}function v3(e){var o,d,f;const t=new URLSearchParams(e),n=((o=t.get(ki))==null?void 0:o.trim())||null,r=((d=t.get(qc))==null?void 0:d.trim())||null,s=((f=t.get(Mo))==null?void 0:f.trim())||null,i=t.get(zc)==="board"?"board":"workspace";return{sessionRef:n&&(s||r)?{sessionId:n,projectPath:s||r}:null,projectPath:r,hasSessionParam:t.has(ki),view:i}}function S3(e=typeof localStorage>"u"?null:localStorage){if(!e)return null;try{const t=e.getItem(Hc);return t?w3(JSON.parse(t)):null}catch{return null}}function j3(e,t,n={}){const r=n.href??(typeof window>"u"?"http://localhost/":window.location.href),s=new URL(r),i=n.view??"workspace",o=n.displayProjectPath??(i==="board"?t:e==null?void 0:e.projectPath)??t,d=(e==null?void 0:e.projectPath)??null;e&&i==="workspace"?s.searchParams.set(ki,e.sessionId):s.searchParams.delete(ki),o?s.searchParams.set(qc,o):s.searchParams.delete(qc),d&&o&&d!==o?s.searchParams.set(Mo,d):s.searchParams.delete(Mo),i==="board"?(s.searchParams.set(zc,"board"),s.searchParams.delete(ki),s.searchParams.delete(Mo)):s.searchParams.delete(zc);const f=n.storage===void 0?typeof localStorage>"u"?null:localStorage:n.storage;try{e&&i==="workspace"?f==null||f.setItem(Hc,JSON.stringify(e)):i==="workspace"&&(f==null||f.removeItem(Hc))}catch{}const u=`${s.pathname}${s.search}${s.hash}`,m=n.replaceState??(typeof window>"u"?void 0:p=>window.history.replaceState(null,"",p));return m==null||m(u),u}const I3=y.lazy(()=>es(()=>import("./ChatView-DacNycYI.js").then(e=>e.a),__vite__mapDeps([18,1,5,3,14,2,19,7,12,8,0])).then(e=>({default:e.ChatView}))),C3=y.lazy(()=>es(()=>import("./KanbanBoard-C9620zMQ.js"),__vite__mapDeps([20,1,6,12,7,19,2,3])).then(e=>({default:e.KanbanBoard})));function E3(){const e=Ut(),[t,n]=y.useState(!1),r=H(j=>j.subscribeToTaskEvents),s=H(j=>j.unsubscribeFromTaskEvents),i=H(j=>j.currentSessionRef),o=H(j=>j.isTemporarySession),d=H(j=>j.loadTaskWorkspaceInfo),f=H(j=>j.loadBoundProjects),u=H(j=>j.loadSessions),m=H(j=>j.selectSession),p=H(j=>j.selectProject),h=H(j=>j.startTemporarySession),b=H(j=>j.setError),k=H(j=>j.sessions),S=H(j=>j.selectedProjectPath),C=Mt(j=>j.loadModels),x=Xr(j=>j.loadSettings),N=sn(j=>j.mainView),P=sn(j=>j.setMainView),L=sn(j=>j.boardProjectPath),D=sn(j=>j.setBoardProjectPath);return y.useEffect(()=>(r().catch(j=>{console.error("Failed to subscribe to task events",j)}),s),[r,s]),y.useEffect(()=>{let j=!1;return(async()=>{var ce;u(),x(),C();const T=v3(window.location.search);P(T.view),D(T.view==="board"?T.projectPath:null);const M=S3(),$=T.view==="board"?null:T.hasSessionParam?T.sessionRef:T.projectPath?null:M,te=Promise.all([d(),f()]),O=!$&&!T.projectPath;if(O&&(h(),n(!0)),await te,j)return;const J=H.getState(),ae=T.projectPath?(ce=J.boundProjects.find(le=>le.path===T.projectPath&&le.available))==null?void 0:ce.path:null;if(ae&&p(ae),!($&&(await m($),j))){if(!$||!oe(H.getState().currentSessionRef,$)){const le=$?H.getState().error:null;h(),le&&b(le)}O||n(!0)}})(),()=>{j=!0}},[f,C,u,x,d,p,m,b,D,P,h]),y.useEffect(()=>{if(!t)return;const j=i?Gd(k,i):void 0;j3(N==="workspace"?i:null,N==="board"?L:S,{displayProjectPath:N==="board"?L:j?po(j,S):S,view:N})},[L,i,t,N,S,k]),a.jsxs(a.Fragment,{children:[a.jsx(W5,{}),a.jsx(V5,{children:t?N==="board"?a.jsx(y.Suspense,{fallback:a.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:e("app.restoring")}),children:a.jsx(C3,{})}):!i||o?a.jsx(y3,{}):a.jsx(y.Suspense,{fallback:a.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:e("app.restoring")}),children:a.jsx(I3,{})}):a.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:e("app.restoring")})})]})}L0.createRoot(document.getElementById("root")).render(a.jsx(ai.StrictMode,{children:a.jsx(E3,{})}));export{Gc as $,Ns as A,oy as B,Ap as C,Qc as D,f3 as E,hu as F,Kc as G,gy as H,hp as I,bi as J,Vd as K,mt as L,Wc as M,Tp as N,iy as O,yy as P,O3 as Q,Zo as R,Sy as S,Lp as T,di as U,Kr as V,ku as W,pi as X,Mt as Y,Jx as Z,es as _,H as a,Vc as a0,$o as a1,s0 as a2,Np as a3,Dn as a4,r0 as a5,Yn as a6,Zn as a7,_n as a8,s5 as a9,jy as aa,Qx as ab,g5 as ac,Qd as ad,po as ae,Fc as af,Ke as ag,Dc as ah,dy as ai,Fp as aj,Rp as ak,$p as al,$3 as am,Hx as an,uy as ao,Xu as ap,M3 as aq,z as ar,c as as,be as at,Qn as au,sn as b,se as c,he as d,Re as e,Xo as f,Yc as g,ea as h,ta as i,Gp as j,W as k,Mp as l,X as m,Jd as n,js as o,cy as p,gu as q,Wd as r,oe as s,mw as t,Ut as u,mu as v,wy as w,Gd as x,Xr as y,ui as z};
|
|
271
|
+
`);if((K||Oe)&&ys.historyIndex!==-1){const Rt=ys.getNext();Rt!==null&&(w.preventDefault(),I.current=Rt,L(Rt),mn(k,{content:Rt,attachments:T.current}),requestAnimationFrame(()=>{$e.current&&$e.current.setSelectionRange(Rt.length,Rt.length)}))}}},[ti,ko,tn,nn,Ua,Ba,_a,k,P,ys]),S0=y.useCallback(w=>{const Q=w.target.value;I.current=Q,L(Q),xe(w.target.selectionStart),mn(k,{content:Q,attachments:T.current})},[k]),nu=y.useCallback(w=>{const Q=w.target;xe(Q.selectionStart)},[]);y.useEffect(()=>{$e.current&&($e.current.style.height="inherit",$e.current.style.height=`${Math.min($e.current.scrollHeight,200)}px`)},[P]);const Ha=oc.find(w=>w.value===fr)??oc[1],j0=x(Ha.labelKey),I0=Ha.icon,C0=!!P.trim()||D.length>0,ru=D.length>=zr,E0=_c(D),qa=qe||(bo?ei:null),su=qa?null:Jt,za=!!n||B,T0=za||ru||!mr,ni=mr?ru?x("chat.input.attachment.countLimit",{count:zr}):x("chat.input.attachment.add"):ei,A0=()=>{za||(et(ni),!mr&&!i&&Lr.some(w=>{var Q;return(Q=w.input)==null?void 0:Q.includes("image")})&&de(!0))};return a.jsxs("div",{"data-chat-input-shell":!0,className:m==="task"?"bg-transparent":"py-2.5 border-t border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas))]",children:[a.jsxs("div",{"data-chat-input-inner":!0,className:m==="task"?"w-full":"px-4 w-full md:px-6",children:[a.jsxs("div",{className:`relative border rounded-lg bg-[hsl(var(--deck-surface))] transition-all duration-200 flex flex-col ${m==="task"?`min-h-[148px] shadow-[0_18px_60px_-24px_hsl(var(--deck-accent)/0.4)] focus-within:ring-1 ${Ht?"border-amber-400/70 focus-within:border-amber-500 focus-within:ring-amber-400/25":"border-[hsl(var(--deck-border))] focus-within:border-[hsl(var(--deck-accent)/0.6)] focus-within:ring-[hsl(var(--deck-accent)/0.25)]"}`:`min-h-[56px] shadow-sm focus-within:ring-1 ${Ht?"border-amber-400/70 focus-within:border-amber-500 focus-within:ring-amber-400/25":"border-[hsl(var(--deck-border))] focus-within:border-[hsl(var(--deck-border-strong))] focus-within:ring-[hsl(var(--deck-border-strong))]"}`}`,children:[a.jsx(hp,{type:"command",suggestions:tn.suggestions,selectedIndex:tn.selectedIndex,loading:tn.loading,onSelect:Ua,onHover:tn.setSelectedIndex,visible:ti}),a.jsx(hp,{type:"file",suggestions:nn.suggestions,selectedIndex:nn.selectedIndex,loading:nn.loading,onSelect:Ba,onHover:nn.setSelectedIndex,visible:ko&&!ti}),a.jsx(Dc,{ref:$e,"data-blade-composer":!0,value:P,onChange:S0,onKeyDown:v0,onPaste:w0,onSelect:nu,onClick:nu,placeholder:S??x(i?"chat.input.placeholder.steering":"chat.input.placeholder.default"),className:`flex-1 w-full resize-none border-0 bg-transparent px-4 focus-visible:ring-0 focus-visible:ring-offset-0 focus:outline-none text-[#111827] dark:text-zinc-300 placeholder:text-[#9CA3AF] dark:placeholder:text-zinc-600 ${m==="task"?"min-h-[84px] py-4 text-[15px]":"py-2.5 text-[14px]"}`,disabled:n||B,"aria-busy":B}),Ht&&a.jsx("div",{className:"px-4 pb-2 font-mono text-[11px] text-amber-600 dark:text-amber-400",children:"$ user shell · runs in this Session workspace"}),i&&a.jsx("div",{className:"px-4 pb-2 text-[11px] font-mono text-amber-600 dark:text-amber-400",children:d>0&&f==="next_turn"?x("chat.input.followUp.queued",{count:d}):d>0?x("chat.input.steering.queued",{count:d}):a.jsxs(a.Fragment,{children:[x("chat.input.steering.status"),x("chat.input.steering.enterHint")]})}),u>0&&a.jsx("div",{className:"px-4 pb-2 text-[11px] font-mono text-cyan-600 dark:text-cyan-400",children:u===1?x("chat.input.steering.recoveredOne",{count:u}):x("chat.input.steering.recoveredMany",{count:u})}),qa&&a.jsxs("div",{role:"alert",className:"mx-4 mb-2 flex min-h-8 items-center gap-2 rounded-md border border-red-200 bg-red-50 px-2.5 py-1.5 text-[11px] text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300",children:[a.jsx(Ns,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:qa}),qe&&a.jsx("button",{type:"button","aria-label":x("chat.error.dismiss"),onClick:()=>{Ae(null),bt.current=null},className:"flex justify-center items-center w-6 h-6 text-red-500 rounded shrink-0 hover:bg-red-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 dark:hover:bg-red-950",children:a.jsx(ui,{className:"w-3 h-3"})})]}),su&&a.jsxs("div",{role:"status","aria-live":"polite",className:"mx-4 mb-2 flex min-h-8 items-center gap-2 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))] px-2.5 py-1.5 text-[11px] text-[hsl(var(--deck-ink-muted))]",children:[a.jsx(uy,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"}),a.jsx("span",{className:"flex-1 min-w-0",children:su}),a.jsx("button",{type:"button","aria-label":x("chat.notice.dismiss"),onClick:()=>et(null),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(ui,{className:"w-3 h-3"})})]}),D.length>0&&a.jsxs("div",{className:"px-4 pb-2",children:[a.jsx("div",{className:"mb-1.5 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:x("chat.input.attachment.usage",{count:D.length,limit:zr,used:ac(E0),budget:ac(mi)})}),a.jsx("div",{className:"flex flex-wrap gap-2",children:D.map(w=>a.jsxs("div",{title:w.name,className:"relative overflow-hidden rounded-md border border-[#E5E7EB] bg-[#F9FAFB] dark:border-zinc-800 dark:bg-zinc-900",children:[a.jsx("img",{src:w.dataUrl,alt:w.name,className:"object-cover w-20 h-20"}),a.jsx("button",{type:"button","aria-label":`${x("chat.input.attachment.remove")} ${w.name}`,title:`${x("chat.input.attachment.remove")} ${w.name}`,onClick:()=>x0(w.id),className:"flex absolute top-1 right-1 justify-center items-center w-6 h-6 text-white rounded transition-colors bg-black/75 hover:bg-black focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white",children:a.jsx(ui,{className:"w-3 h-3"})})]},w.id))})]}),a.jsxs("div",{className:"flex justify-between items-center px-3 py-2 mt-auto",children:[a.jsxs("div",{className:"flex gap-2 items-center",children:[T0?a.jsx("button",{type:"button",disabled:za,"aria-disabled":"true","aria-label":ni,title:ni,onClick:A0,className:"flex h-8 w-8 cursor-help items-center justify-center rounded-md text-[#9CA3AF] opacity-55 transition-colors hover:bg-[hsl(var(--deck-surface-2))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed dark:text-zinc-500",children:a.jsx(hu,{className:"w-4 h-4"})}):a.jsxs("label",{title:ni,className:"relative flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[#9CA3AF] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-within:ring-1 focus-within:ring-[hsl(var(--deck-accent))] dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-300",children:[a.jsx("input",{ref:wt,type:"file",accept:"image/*",multiple:!0,"aria-label":ni,className:"absolute inset-0 z-10 w-full h-full opacity-0 cursor-pointer",onChange:y0}),a.jsx(hu,{className:"w-4 h-4"})]}),a.jsxs(Yn,{open:Z,onOpenChange:w=>{!i&&!B&&de(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,title:x(i?"chat.input.model.locked":"chat.input.model.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 text-xs text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[eu,a.jsx(js,{className:"w-3 h-3"})]})}),a.jsx(_n,{className:"w-64 p-2 bg-white dark:bg-zinc-900 border border-[#E5E7EB] dark:border-zinc-700",align:"start",children:a.jsx("div",{className:"overflow-y-auto max-h-72",children:Lr.length===0?a.jsx("div",{className:"text-xs text-[#6B7280] dark:text-zinc-500 px-2 py-2",children:x("chat.input.model.empty")}):Object.entries(Lr.reduce((w,Q)=>{const K=Q.provider||"unknown";return w[K]||(w[K]=[]),w[K].push(Q),w},{})).map(([w,Q])=>a.jsxs("div",{className:"mb-2",children:[a.jsx("div",{className:"text-xs text-[#6B7280] dark:text-zinc-500 px-2 py-1 capitalize",children:w.replace(/-/g," ")}),Q.map(K=>{var Oe;return a.jsx("button",{className:`w-full text-left px-2 py-1.5 text-sm rounded hover:bg-[#E5E7EB] dark:hover:bg-zinc-800 transition-colors ${K.id===xs?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,onClick:()=>{if(et(null),Pe){Yd(K.id),de(!1);return}pr(K.id,C??void 0).then(()=>de(!1)).catch(()=>{})},children:a.jsxs("span",{className:"flex gap-2 items-center min-w-0",children:[a.jsx("span",{className:"flex-1 min-w-0 truncate",children:K.displayName||K.model}),((Oe=K.input)==null?void 0:Oe.includes("image"))&&a.jsx("span",{className:"shrink-0 rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 font-mono text-[8.5px] uppercase tracking-[0.08em] text-[hsl(var(--deck-accent))]",children:x("chat.input.model.vision")})]})},K.id)})]},w))})})]}),h0&&a.jsxs(Yn,{open:R,onOpenChange:w=>{!i&&!B&&ue(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.effort.change"),title:x(i?"chat.input.effort.locked":"chat.input.effort.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 font-mono text-[11px] text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[x("chat.input.effort.label",{effort:mo}),a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(_n,{className:"w-52 border border-[#E5E7EB] bg-white p-1 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsx("div",{className:"px-2 py-1 font-mono text-[9px] uppercase tracking-[0.12em] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.effort.heading")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:po.map(w=>a.jsx("button",{type:"button","aria-label":x("chat.input.effort.option",{effort:w}),onClick:()=>{Zd(w),ue(!1)},className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-[#E5E7EB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] dark:hover:bg-zinc-800 ${mo===w?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,children:a.jsx("span",{className:"capitalize",children:w})},w))})]})]}),g0&&a.jsxs(Yn,{open:ve,onOpenChange:w=>{!i&&!B&&He(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.serviceTier.change"),title:x(i?"chat.input.serviceTier.locked":"chat.input.serviceTier.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 font-mono text-[11px] text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[x("chat.input.serviceTier.label",{tier:Dr}),a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(_n,{className:"w-52 border border-[#E5E7EB] bg-white p-1 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsx("div",{className:"px-2 py-1 font-mono text-[9px] uppercase tracking-[0.12em] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.serviceTier.heading")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:f0.map(w=>a.jsxs("button",{type:"button","aria-label":x("chat.input.serviceTier.option",{tier:w}),onClick:()=>{La(w),He(!1)},className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-[#E5E7EB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] dark:hover:bg-zinc-800 ${Dr===w?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,children:[a.jsx("span",{className:"capitalize",children:w}),w==="fast"&&a.jsx("span",{className:"text-[9px] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.serviceTier.fastHint")}),w==="flex"&&a.jsx("span",{className:"text-[9px] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.serviceTier.flexHint")})]},w))})]})]}),b0&&a.jsxs(Yn,{open:yt,onOpenChange:w=>{!i&&!B&&We(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.responseVerbosity.change"),title:x(i?"chat.input.responseVerbosity.locked":"chat.input.responseVerbosity.change"),className:"flex cursor-pointer items-center gap-1 rounded px-2 py-1 font-mono text-[11px] text-[#6B7280] transition-colors hover:bg-[#E5E7EB] hover:text-[#111827] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200",children:[x("chat.input.responseVerbosity.label",{verbosity:_r}),a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(_n,{className:"w-52 border border-[#E5E7EB] bg-white p-1 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsx("div",{className:"px-2 py-1 font-mono text-[9px] uppercase tracking-[0.12em] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.responseVerbosity.heading")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:m0.map(w=>a.jsxs("button",{type:"button","aria-label":x("chat.input.responseVerbosity.option",{verbosity:w}),onClick:()=>{Da(w),We(!1)},className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-[#E5E7EB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] dark:hover:bg-zinc-800 ${_r===w?"bg-[#E5E7EB] text-[#111827] dark:bg-zinc-800 dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`,children:[a.jsx("span",{className:"capitalize",children:w}),w==="auto"&&a.jsx("span",{className:"text-[9px] text-[#9CA3AF] dark:text-zinc-600",children:x("chat.input.responseVerbosity.autoHint")})]},w))})]})]}),a.jsxs(Yn,{open:O,onOpenChange:w=>{!i&&!B&&J(w)},children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button",disabled:i||B,"aria-label":x("chat.input.outputSchema.change"),title:x(i?"chat.input.outputSchema.locked":"chat.input.outputSchema.change"),className:`flex h-7 items-center gap-1 rounded px-1.5 font-mono text-[10.5px] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-not-allowed disabled:opacity-55 ${M.trim()?"bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"text-[#6B7280] hover:bg-[#E5E7EB] hover:text-[#111827] dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200"}`,children:[a.jsx(ey,{className:"h-3.5 w-3.5"}),M.trim()&&"JSON"]})}),a.jsxs(_n,{className:"w-[min(440px,calc(100vw-24px))] border border-[#E5E7EB] bg-white p-0 dark:border-zinc-700 dark:bg-zinc-900",align:"start",children:[a.jsxs("div",{className:"border-b border-[#E5E7EB] px-3 py-2.5 dark:border-zinc-800",children:[a.jsx("div",{className:"font-mono text-[11px] font-semibold text-[#111827] dark:text-zinc-100",children:x("chat.input.outputSchema.title")}),a.jsx("div",{className:"mt-0.5 text-[10.5px] leading-4 text-[#6B7280] dark:text-zinc-500",children:x("chat.input.outputSchema.description")})]}),a.jsxs("div",{className:"p-3",children:[a.jsx(Dc,{value:M,onChange:w=>{const Q=w.target.value;te.current=Q,$(Q),ce(null),mn(k,{content:I.current,attachments:T.current,outputSchema:Q})},spellCheck:!1,"aria-label":x("chat.input.outputSchema.editor"),"aria-invalid":!!ae,placeholder:x("chat.input.outputSchema.placeholder"),className:"min-h-[180px] resize-y border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] font-mono text-[11px] leading-5 focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]"}),ae&&a.jsxs("div",{role:"alert",className:"mt-2 flex items-center gap-1.5 text-[10.5px] text-red-600 dark:text-red-400",children:[a.jsx(Ns,{className:"h-3.5 w-3.5"}),ae]}),a.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[a.jsx("button",{type:"button",onClick:()=>{const w=JSON.stringify({type:"object",properties:{summary:{type:"string"}},required:["summary"],additionalProperties:!1},null,2);te.current=w,$(w),ce(null),mn(k,{content:I.current,attachments:T.current,outputSchema:w})},className:"rounded px-2 py-1 font-mono text-[10.5px] text-[hsl(var(--deck-accent))] hover:bg-[hsl(var(--deck-accent-soft))]",children:x("chat.input.outputSchema.example")}),a.jsx("button",{type:"button",onClick:()=>{te.current="",$(""),ce(null),mn(k,{content:I.current,attachments:T.current,outputSchema:""})},className:"rounded px-2 py-1 font-mono text-[10.5px] text-[#6B7280] hover:bg-[#F3F4F6] dark:text-zinc-400 dark:hover:bg-zinc-800",children:x("chat.input.outputSchema.clear")})]})]})]})]}),a.jsxs(Yn,{open:tt,onOpenChange:Y,children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{"data-blade-permission-mode":fr,className:`flex items-center gap-1.5 rounded px-2 py-1 text-xs transition-colors ${Ha.tone==="danger"?"text-amber-600 hover:bg-amber-500/10 dark:text-amber-400":"text-[#6B7280] hover:bg-[#E5E7EB] hover:text-[#111827] dark:text-zinc-500 dark:hover:bg-zinc-800/50 dark:hover:text-zinc-200"}`,children:[a.jsx(I0,{className:"h-3.5 w-3.5"}),j0,a.jsx(js,{className:"w-3 h-3"})]})}),a.jsxs(_n,{className:"w-72 p-1.5 bg-white dark:bg-zinc-900 border border-[#E5E7EB] dark:border-zinc-700",align:"start",children:[a.jsx("div",{className:"px-2 pb-1.5 pt-1 text-[11px] font-medium text-[#9CA3AF] dark:text-zinc-500",children:x("chat.input.mode.aria")}),a.jsx("div",{className:"flex flex-col gap-0.5",children:oc.map(w=>{const Q=w.icon,K=fr===w.value,Oe=w.tone==="danger";return a.jsxs("button",{type:"button","data-blade-permission-option":w.value,"aria-pressed":K,className:`flex w-full items-start gap-2.5 rounded-md px-2 py-2 text-left transition-colors ${K?"bg-[#F3F4F6] dark:bg-zinc-800/70":"hover:bg-[#F3F4F6] dark:hover:bg-zinc-800/50"}`,onClick:()=>{w.value===kr.YOLO&&fr!==kr.YOLO?(Y(!1),F(!0)):(bs(w.value),Y(!1))},children:[a.jsx(Q,{className:`mt-0.5 h-4 w-4 shrink-0 ${Oe?"text-amber-500":K?"text-[#111827] dark:text-zinc-100":"text-[#6B7280] dark:text-zinc-400"}`}),a.jsxs("span",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:`block text-[13px] font-medium leading-tight ${Oe?"text-amber-600 dark:text-amber-400":"text-[#111827] dark:text-zinc-100"}`,children:x(w.labelKey)}),a.jsx("span",{className:"mt-0.5 block text-[11px] leading-snug text-[#6B7280] dark:text-zinc-500",children:x(w.descriptionKey)})]}),K&&a.jsx(Ip,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"})]},w.value)})})]})]})]}),a.jsxs("div",{className:"flex gap-2 items-center",children:[i&&a.jsx(Kr,{size:"icon",onClick:()=>{t==null||t()},disabled:o,title:x(o?"chat.input.action.stopping":"chat.input.action.stop"),"aria-label":x(o?"chat.input.action.stopping":"chat.input.action.stop"),className:"w-8 h-8 text-white bg-red-500 hover:bg-red-600",children:o?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Gc,{className:"w-3 h-3"})}),a.jsx(Kr,{size:"icon","data-blade-submit":!0,onClick:_a,disabled:!C0||n||Qt||bo||B||k0,title:x(B?"chat.input.action.submitting":i?"chat.input.action.steer":"chat.input.action.send"),"aria-label":x(B?"chat.input.action.submitting":i?"chat.input.action.steer":"chat.input.action.send"),className:"h-8 w-8 bg-[#111827] text-white hover:bg-[#0F172A] disabled:bg-[#E5E7EB] disabled:text-[#9CA3AF] dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white dark:disabled:bg-zinc-800 dark:disabled:text-zinc-600",children:B?a.jsx(mt,{className:"w-4 h-4 animate-spin"}):a.jsx(by,{className:"w-4 h-4"})})]})]})]}),m==="chat"&&a.jsx("div",{className:"text-center text-xs text-[#6B7280] dark:text-zinc-600 mt-3 font-mono",children:x("chat.footer.disclaimer")})]}),a.jsx(Wc,{open:pt,onOpenChange:F,children:a.jsx(Zo,{className:"gap-0 rounded-xl border border-zinc-200 bg-white p-0 dark:border-zinc-800 dark:bg-[#09090b] sm:max-w-[400px]","aria-describedby":"yolo-confirm-desc",hideCloseButton:!0,children:a.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[a.jsxs("div",{className:"flex gap-3 items-center",children:[a.jsx("div",{className:"flex justify-center items-center w-9 h-9 bg-amber-100 rounded-full dark:bg-amber-950/40",children:a.jsx(Pp,{className:"w-5 h-5 text-amber-600 dark:text-amber-400"})}),a.jsx(Xo,{className:"font-mono text-sm font-semibold",children:x("chat.input.mode.yolo.confirm.title")})]}),a.jsx(ea,{id:"yolo-confirm-desc",className:"text-[13px] leading-relaxed text-zinc-600 dark:text-zinc-400",children:x("chat.input.mode.yolo.confirm.desc")}),a.jsxs("div",{className:"flex gap-2 justify-end items-center pt-1",children:[a.jsx("button",{type:"button",onClick:()=>F(!1),className:"h-8 rounded-md px-3 font-mono text-[12px] font-medium text-zinc-600 transition-colors hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800",children:x("chat.input.mode.yolo.confirm.cancel")}),a.jsx("button",{type:"button","data-blade-yolo-confirm":!0,onClick:()=>{bs(kr.YOLO),F(!1)},className:"h-8 rounded-md bg-amber-600 px-3 font-mono text-[12px] font-semibold text-white transition-colors hover:bg-amber-700",children:x("chat.input.mode.yolo.confirm.accept")})]})]})})})]})}const t3={running:{dot:"bg-blue-500 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse",labelKey:"recent.status.running",text:"text-blue-700 dark:text-blue-400"},queued:{dot:"bg-amber-400",labelKey:"recent.status.queued",text:"text-amber-700 dark:text-amber-400"},interrupted:{dot:"bg-orange-500",labelKey:"recent.status.paused",text:"text-orange-700 dark:text-orange-400"},failed:{dot:"bg-red-500",labelKey:"recent.status.failed",text:"text-red-700 dark:text-red-400"},cancelled:{dot:"bg-zinc-400",labelKey:"recent.status.cancelled",text:"text-zinc-500"},completed:{dot:"bg-[hsl(var(--deck-accent))]",labelKey:"recent.status.done",text:"text-[hsl(var(--deck-accent))]"}};function n3(e,t){if(!e)return"";const n=new Date(e);if(Number.isNaN(n.getTime()))return"";const r=Date.now()-n.getTime(),s=Math.floor(r/6e4);if(s<1)return t("recent.time.justNow");if(s<60)return t("recent.time.minutes",{n:s});const i=Math.floor(s/60);if(i<24)return t("recent.time.hours",{n:i});const o=Math.floor(i/24);return t("recent.time.days",{n:o})}function r3(e){return e.split("/").filter(Boolean).at(-1)||e}function s3({sessions:e,onSelect:t,cancellingTaskKeys:n,retryingTaskKeys:r,unreadTaskKeys:s,onCancel:i,onRetry:o,catalogLoadState:d="ready",className:f}){const u=Ut(),m=[...e].sort(Wd).slice(0,4),p=d==="loading"||d==="hydrating";return m.length===0?!p&&d!=="error"?null:a.jsxs("div",{role:d==="error"?"alert":"status",className:W("mt-7 flex items-center gap-2 rounded-md border border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-surface))]/50 px-3 py-2 font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",f),children:[p?a.jsx(mt,{className:"h-3 w-3 animate-spin text-[hsl(var(--deck-accent))]"}):a.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500"}),u(p?"sidebar.catalog.syncing":"sidebar.catalog.incomplete")]}):a.jsxs("div",{className:W("mt-7",f),children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsx("span",{className:"deck-eyebrow text-[hsl(var(--deck-ink-faint))]",children:u("taskHome.recent.title")}),a.jsx("span",{className:"font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:u(p?"taskHome.recent.partial":d==="error"?"taskHome.recent.incomplete":"taskHome.recent.total",{count:e.length})})]}),a.jsx("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:m.map(h=>{const b=t3[h.taskStatus],k=h.pendingInteraction?h.pendingInteraction.type==="question"?"interaction.badge.question":h.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission":null,S=r3(h.taskSourceProjectPath||h.projectPath),C=gi(h,u),x=Re(he(h)),N=h.taskStatus==="running"||h.taskStatus==="queued",P=n.includes(x),L=r.includes(x),D=!!h.taskRetryAvailable&&(h.taskStatus==="failed"||h.taskStatus==="interrupted"||h.taskStatus==="cancelled"),j=s.includes(x),I=Kd(h,u);return a.jsxs("div",{className:W("group flex items-center gap-3 rounded-md border border-transparent px-3 py-1.5 text-left transition-colors","hover:border-[hsl(var(--deck-border))] hover:bg-[hsl(var(--deck-surface))]"),children:[a.jsxs("button",{type:"button",onClick:()=>t(h),className:"flex min-w-0 flex-1 items-center gap-3 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx("span",{className:W("h-1.5 w-1.5 shrink-0 rounded-full",k?"animate-pulse bg-amber-500 shadow-[0_0_5px_rgba(245,158,11,0.75)]":b.dot)}),a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-[12.5px] text-[hsl(var(--deck-ink))]",children:[a.jsx("span",{className:"truncate",children:C}),j&&a.jsx("span",{title:u("taskSwitcher.new"),className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.75)]"}),h.taskRetriedFrom&&a.jsx("span",{title:`${u("session.retriedFrom")} ${h.taskRetriedFrom.sessionId.slice(0,6)}`,className:"shrink-0 font-mono text-[8.5px] text-[hsl(var(--deck-accent))]",children:u("session.retryShort")})]}),a.jsxs("span",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx("span",{className:"truncate",children:S}),a.jsx("span",{className:"opacity-40",children:"·"}),a.jsx("span",{className:W("shrink-0",k?"text-amber-700 dark:text-amber-400":b.text),children:u(k??b.labelKey)}),a.jsx("span",{className:"opacity-40",children:"·"}),a.jsx("span",{className:"shrink-0",children:n3(h.lastMessageTime||h.firstMessageTime,u)})]}),I&&a.jsx("span",{title:I,className:"mt-0.5 block truncate font-mono text-[9.5px] text-red-600 dark:text-red-400",children:I})]}),a.jsx(X0,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-ink-faint))] opacity-0 transition-opacity group-hover:opacity-100"})]}),N&&a.jsx("button",{type:"button","aria-label":u(P?"session.action.stopping":"session.action.stop",{title:C}),disabled:P,onClick:()=>i(h),className:"rounded p-1.5 text-red-500 transition-colors hover:bg-red-500/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:cursor-wait disabled:opacity-60",children:P?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Gc,{className:"h-3.5 w-3.5"})}),D&&a.jsx("button",{type:"button","aria-label":u(L?"session.action.retrying":"session.action.retry",{title:C}),disabled:L,onClick:()=>o(h),className:"rounded p-1.5 text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-60",children:L?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Yo,{className:"h-3.5 w-3.5"})})]},x)})})]})}function i3({index:e,title:t,description:n,icon:r,hint:s,onClick:i}){const o=String(e+1).padStart(2,"0"),d=`⌘${e+1}`;return a.jsxs("button",{type:"button",onClick:i,className:W("group relative flex min-h-[100px] flex-col justify-between overflow-hidden rounded-lg border p-3.5 text-left transition","border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]","hover:-translate-y-[1px] hover:border-[hsl(var(--deck-accent)/0.55)] hover:shadow-[0_10px_28px_-14px_hsl(var(--deck-accent)/0.35)]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--deck-accent))] focus-visible:ring-offset-2 focus-visible:ring-offset-[hsl(var(--deck-canvas))]","dark:bg-[hsl(var(--deck-surface))] dark:hover:shadow-[0_10px_28px_-14px_hsl(var(--deck-accent)/0.55)]"),children:[a.jsx("span",{"aria-hidden":"true",className:W("pointer-events-none absolute right-3 top-3 h-2 w-2","border-r border-t border-[hsl(var(--deck-border-strong))]","transition-colors group-hover:border-[hsl(var(--deck-accent))]")}),a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx("span",{className:W("inline-flex h-8 w-8 items-center justify-center rounded-md border transition-colors","border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface-2))]","group-hover:border-[hsl(var(--deck-accent)/0.5)] group-hover:bg-[hsl(var(--deck-accent-soft))]"),children:a.jsx(r,{className:"h-4 w-4 text-[hsl(var(--deck-ink-muted))] transition-colors group-hover:text-[hsl(var(--deck-accent))]"})}),a.jsx("span",{className:"font-mono text-[10px] tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:o})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[13px] font-semibold text-[hsl(var(--deck-ink))]",children:t}),a.jsx("div",{className:"mt-1 line-clamp-2 text-[11.5px] leading-[1.45] text-[hsl(var(--deck-ink-muted))]",children:n}),a.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[a.jsx("span",{className:"truncate font-mono text-[10px] text-[hsl(var(--deck-ink-faint))] opacity-0 transition-opacity group-hover:opacity-100",children:s}),a.jsx("span",{className:"deck-kbd shrink-0 opacity-0 transition-opacity group-hover:opacity-100",children:d})]})]})]})}const cc=[{key:"explore",titleKey:"taskHome.template.explore.title",descriptionKey:"taskHome.template.explore.description",icon:Kc,prompt:"Explore this codebase and explain ",hintKey:"taskHome.template.explore.hint"},{key:"build",titleKey:"taskHome.template.build.title",descriptionKey:"taskHome.template.build.description",icon:cy,prompt:"Build a production-ready ",hintKey:"taskHome.template.build.hint"},{key:"review",titleKey:"taskHome.template.review.title",descriptionKey:"taskHome.template.review.description",icon:gy,prompt:"/review uncommitted",hintKey:"taskHome.template.review.hint"},{key:"fix",titleKey:"taskHome.template.fix.title",descriptionKey:"taskHome.template.fix.description",icon:xy,prompt:"Investigate and fix ",hintKey:"taskHome.template.fix.hint"}];function o3(e,t){return t?t.split("/").filter(Boolean).at(-1)||t:e("taskHome.hero.projectFallback")}function a3(){const e=Ut(),{taskWorkspaceInfo:t,isTaskWorkspaceLoading:n,taskWorkspaceError:r,isDispatchingTask:s,sessions:i,boundProjects:o,selectedProjectPath:d,error:f,selectProject:u,dispatchTask:m,startCodeReview:p,sendMessage:h,startTemporarySession:b,selectSession:k,cancelTask:S,cancellingTaskKeys:C,retryTask:x,retryingTaskKeys:N,unreadTaskKeys:P,taskEventConnectionState:L,catalogLoadState:D,reconnectTaskEvents:j,clearError:I,loadTaskWorkspaceInfo:T,loadBoundProjects:M}=H(),$=sn(_=>_.openSettings),te=sn(_=>_.isSettingsOpen),O=Mt(_=>_.currentMode),J=Mt(_=>_.currentModelId),ae=Mt(_=>_.configuredModels),ce=Mt(_=>_.isLoading),le=Mt(_=>_.hasLoaded),xe=Mt(_=>_.loadedWorkspacePath),Z=Mt(_=>_.error),de=Mt(_=>_.loadModels),[R,ue]=y.useState("worktree"),[ve,He]=y.useState(),[yt,We]=y.useState(!1),tt=e(L==="connected"?"taskHome.eyebrow":L==="reconnecting"?"taskHome.feed.reconnecting":L==="offline"?"taskHome.feed.offline":"taskHome.feed.connecting"),Y=y.useMemo(()=>o.find(_=>_.path===d)??o.find(_=>_.isCurrent),[o,d]),pt=y.useMemo(()=>UF(i,d,(t==null?void 0:t.cwd)??null),[d,i,t==null?void 0:t.cwd]),F=(Y!=null&&Y.available?Y.path:void 0)??(t==null?void 0:t.cwd),B=`task:${F??"unavailable"}`;y.useEffect(()=>{!te&&F&&(!le||xe!==F)&&de(F)},[te,de,xe,le,F]);const Se=!(Y!=null&&Y.available)&&n,qe=Y!=null&&Y.available?null:r,Ae=!!(F&&!Se&&!qe),Jt=!!(J&&ae.some(_=>_.id===J)),et=!le||ce,Ht=Ae&&Jt&&!et&&Z===null,Qt=y.useMemo(()=>({project:o3(e,(Y==null?void 0:Y.path)??(t==null?void 0:t.cwd)),branch:(Y==null?void 0:Y.gitBranch)??(t==null?void 0:t.gitBranch)??e("taskHome.context.branchFallback")}),[Y,t,e]),bt=y.useCallback(async _=>{const $e=_.content.trim();if($e==="/review"||$e.startsWith("/review ")){if(_.attachments.length>0)throw new Error(e("taskHome.review.attachmentsUnsupported"));if(_.outputSchema)throw new Error(e("taskHome.review.outputSchemaUnsupported"));const wt=$e.split(/\s+/),qt=wt[1]||"uncommitted";if(qt!=="uncommitted"&&qt!=="base"&&qt!=="commit"||qt==="uncommitted"&&wt.length!==2&&wt.length!==1||(qt==="base"||qt==="commit")&&wt.length!==3)throw new Error(e("taskHome.review.usage"));await p({projectPath:F,kind:qt,...wt[2]?{ref:wt[2]}:{},modelId:_.modelId??J??void 0});return}if(_.content.trimStart().startsWith("!")){b(F),await h({content:_.content,attachments:[]});return}await m({prompt:_.content,projectPath:F,isolation:R,permissionMode:O,modelId:_.modelId??J??void 0,reasoningEffort:_.reasoningEffort,serviceTier:_.serviceTier,responseVerbosity:_.responseVerbosity,communicationStyle:_.communicationStyle,..._.outputSchema?{outputSchema:_.outputSchema}:{},attachments:_.attachments.map(wt=>({type:"image",content:wt.dataUrl,mimeType:wt.mimeType,name:wt.name}))})},[O,J,m,R,h,p,b,F,e]);return y.useEffect(()=>{const _=$e=>{if(!($e.metaKey||$e.ctrlKey))return;const wt=Number.parseInt($e.key,10);if(Number.isNaN(wt)||wt<1||wt>cc.length)return;const qt=cc[wt-1];qt&&($e.preventDefault(),He({key:B,content:qt.prompt}))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[B]),a.jsx("main",{className:"deck-canvas relative flex-1 overflow-y-auto text-[hsl(var(--deck-ink))]",children:a.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-[960px] flex-col px-6 py-8 md:px-8 md:py-10",children:[a.jsxs("div",{className:"flex gap-4 items-start mb-6",children:[a.jsx(Vd,{size:36,className:"hidden mt-1 sm:inline-flex"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:W("deck-eyebrow flex items-center gap-2",L==="offline"?"text-amber-700 dark:text-amber-400":"text-[hsl(var(--deck-accent))]"),children:[L==="offline"?a.jsx(gu,{className:"w-3 h-3"}):a.jsx("span",{className:"deck-pulse-dot"}),tt]}),a.jsxs("h1",{className:"mt-2.5 max-w-3xl text-balance text-[clamp(28px,3vw,34px)] font-medium leading-[1.12] tracking-[-0.028em] text-[hsl(var(--deck-ink))]",children:[e("taskHome.hero.prefix")," ",a.jsx("span",{className:"whitespace-nowrap font-mono text-[0.82em] text-[hsl(var(--deck-accent))]",children:Qt.project}),a.jsx("span",{className:"text-[hsl(var(--deck-ink-muted))]",children:"?"})]}),a.jsx("p",{className:"mt-2 max-w-[46rem] text-[13px] leading-[1.55] text-[hsl(var(--deck-ink-muted))]",children:e("taskHome.hero.subtitle")})]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsx("span",{className:"deck-eyebrow text-[hsl(var(--deck-ink-faint))]",children:e("taskHome.templates.title")}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(Cp,{className:"w-3 h-3"}),a.jsx("span",{children:e("taskHome.templates.hint")})]})]}),a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-4",children:cc.map((_,$e)=>a.jsx(i3,{index:$e,title:e(_.titleKey),description:e(_.descriptionKey),icon:_.icon,hint:e(_.hintKey),onClick:()=>He({key:B,content:_.prompt})},_.key))})]}),a.jsxs("div",{"data-blade-task-dispatch-ready":Ht?"true":"false","data-blade-task-workspace-ready":Ae?"true":"false","data-blade-task-model-ready":Jt?"true":"false","data-blade-task-model-loaded":le?"true":"false","data-blade-task-model-loading":ce?"true":"false",className:"rounded-xl border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] shadow-[0_28px_80px_-32px_hsl(var(--deck-accent)/0.28),0_2px_0_hsl(var(--deck-hairline))]",children:[a.jsxs("div",{className:"flex items-center gap-0 border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-surface-2))]/50",children:[a.jsxs("div",{className:"flex flex-1 items-center min-w-0",children:[a.jsxs(Yn,{children:[a.jsx(Zn,{asChild:!0,children:a.jsxs("button",{type:"button","aria-label":e("taskHome.context.projectSelect"),disabled:o.length===0,className:"group flex h-9 min-w-0 items-center gap-2 border-r border-[hsl(var(--deck-hairline))] px-3 font-mono text-[11.5px] text-[hsl(var(--deck-ink))] transition-colors hover:bg-[hsl(var(--deck-surface))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))] disabled:opacity-50",children:[a.jsx(li,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"}),a.jsx("span",{className:"font-medium truncate",children:(Y==null?void 0:Y.name)??Qt.project}),a.jsx(js,{className:"h-3 w-3 shrink-0 text-[hsl(var(--deck-ink-faint))] transition-transform group-data-[state=open]:rotate-180"})]})}),a.jsx(_n,{align:"start",sideOffset:4,className:"w-56 rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-1 shadow-xl",children:a.jsxs("div",{className:"flex flex-col",children:[o.map(_=>a.jsxs("button",{type:"button",disabled:!_.available,onClick:()=>{u(_.path)},className:W("flex items-center gap-2 rounded-md px-2.5 py-1.5 text-left font-mono text-[12px] transition-colors",_.path===d?"bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-ink))]",!_.available&&"opacity-40"),children:[a.jsx(li,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0 truncate",children:_.name}),_.path===d&&a.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))]"})]},_.path)),o.length===0&&a.jsx("span",{className:"px-2.5 py-2 text-center font-mono text-[11px] text-[hsl(var(--deck-ink-faint))]",children:e("taskHome.setup.workspace.empty")})]})})]}),a.jsxs("button",{type:"button","data-blade-task-isolation":R,"aria-pressed":R==="worktree",onClick:()=>ue(_=>_==="worktree"?"local":"worktree"),className:W("flex h-9 shrink-0 items-center gap-1.5 border-r border-[hsl(var(--deck-hairline))] px-3 font-mono text-[11px] transition-colors",R==="worktree"?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-muted))] hover:text-[hsl(var(--deck-ink))]"),title:e("taskHome.context.isolationToggleTitle"),children:[R==="worktree"?a.jsx(my,{className:"w-3 h-3"}):a.jsx(dy,{className:"w-3 h-3"}),a.jsx("span",{className:"hidden sm:inline",children:e(R==="worktree"?"taskHome.context.isolation.worktree":"taskHome.context.isolation.local")})]}),a.jsxs("span",{className:"flex h-9 shrink-0 items-center gap-1.5 border-r border-[hsl(var(--deck-hairline))] px-3 font-mono text-[11px] text-[hsl(var(--deck-ink-muted))]",children:[a.jsx(qc,{className:"w-3 h-3"}),a.jsx("span",{className:"hidden sm:inline",children:Qt.branch})]})]}),a.jsxs("div",{className:"flex gap-2 items-center px-3 shrink-0",children:[(t==null?void 0:t.taskAdmission)&&a.jsx(Kx,{inFlight:t.taskAdmission.inFlight,queued:t.taskAdmission.queued,maxConcurrent:t.taskAdmission.maxConcurrent,compact:!0}),s&&a.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[10.5px] text-[hsl(var(--deck-accent))]",children:[a.jsx(mt,{className:"w-3 h-3 animate-spin"}),a.jsx("span",{className:"hidden sm:inline",children:e("taskHome.context.preparing")})]})]})]}),!Ht&&a.jsxs("section",{"aria-label":e("taskHome.setup.aria"),className:"border-b border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))] px-3 py-3",children:[a.jsxs("div",{className:"mb-2.5",children:[a.jsx("h2",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.12em] text-[hsl(var(--deck-ink))]",children:e("taskHome.setup.title")}),a.jsx("p",{className:"mt-0.5 text-[11px] text-[hsl(var(--deck-ink-faint))]",children:e("taskHome.setup.description")})]}),a.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2.5",children:[a.jsx("span",{className:W("flex justify-center items-center w-7 h-7 rounded-md border shrink-0",Ae?"text-emerald-700 bg-emerald-50 border-emerald-300/70 dark:border-emerald-800/70 dark:bg-emerald-950/40 dark:text-emerald-300":qe?"text-red-700 bg-red-50 border-red-300/70 dark:border-red-900/70 dark:bg-red-950/40 dark:text-red-300":"text-amber-700 bg-amber-50 border-amber-300/70 dark:border-amber-800/70 dark:bg-amber-950/40 dark:text-amber-300"),children:Se?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):Ae?a.jsx(pu,{className:"h-3.5 w-3.5"}):qe?a.jsx(Ns,{className:"h-3.5 w-3.5"}):a.jsx(li,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"block font-mono text-[11px] font-medium text-[hsl(var(--deck-ink))]",children:e("taskHome.setup.workspace.title")}),a.jsx("span",{className:"mt-0.5 block truncate text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:Se?e("taskHome.setup.workspace.loading"):qe||(Ae?e("taskHome.setup.workspace.ready",{project:Qt.project}):e("taskHome.setup.workspace.required"))})]}),!Ae&&a.jsxs("div",{className:"flex gap-1 items-center shrink-0",children:[qe&&a.jsx("button",{type:"button",onClick:()=>{Promise.all([T(),M()])},"aria-label":e("taskHome.setup.workspace.retry"),title:e("taskHome.setup.workspace.retry"),className:"flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-canvas))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:a.jsx(di,{className:"h-3.5 w-3.5"})}),a.jsxs("button",{type:"button","data-project-setup-trigger":!0,onClick:()=>We(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-2.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink))] hover:border-[hsl(var(--deck-accent)/0.55)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[a.jsx(Ro,{className:"w-3 h-3"}),e("taskHome.setup.workspace.action")]})]})]}),a.jsxs("div",{className:"flex min-w-0 items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2.5",children:[a.jsx("span",{className:W("flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",Jt&&!Z?"border-emerald-300/70 bg-emerald-50 text-emerald-700 dark:border-emerald-800/70 dark:bg-emerald-950/40 dark:text-emerald-300":Z?"border-red-300/70 bg-red-50 text-red-700 dark:border-red-900/70 dark:bg-red-950/40 dark:text-red-300":"border-amber-300/70 bg-amber-50 text-amber-700 dark:border-amber-800/70 dark:bg-amber-950/40 dark:text-amber-300"),children:et?a.jsx(mt,{className:"h-3.5 w-3.5 animate-spin"}):Jt&&!Z?a.jsx(pu,{className:"h-3.5 w-3.5"}):Z?a.jsx(Ns,{className:"h-3.5 w-3.5"}):a.jsx(uu,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"block font-mono text-[11px] font-medium text-[hsl(var(--deck-ink))]",children:e("taskHome.setup.model.title")}),a.jsx("span",{title:Z??void 0,className:W("mt-0.5 block truncate text-[10.5px]",Z?"text-red-600 dark:text-red-400":"text-[hsl(var(--deck-ink-faint))]"),children:et?e("taskHome.setup.model.loading"):Z||e(Jt?"taskHome.setup.model.ready":"taskHome.setup.model.required")})]}),!et&&(!Jt||Z)&&a.jsxs("button",{type:"button","data-model-setup-trigger":!0,onClick:()=>{Z?de(F):$("models")},className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-2.5 font-mono text-[10.5px] text-[hsl(var(--deck-ink))] hover:border-[hsl(var(--deck-accent)/0.55)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[Z?a.jsx(di,{className:"w-3 h-3"}):a.jsx(uu,{className:"w-3 h-3"}),e(Z?"taskHome.setup.model.retry":"taskHome.setup.model.action")]})]})]})]}),a.jsx("div",{className:"px-3 pt-3 pb-3",children:a.jsx(e3,{variant:"task",draft:(ve==null?void 0:ve.key)===B?ve.content:void 0,draftKey:B,placeholder:e("taskHome.composer.placeholder"),onSend:async _=>{try{return await bt(_),He(void 0),!0}catch{return!1}},disabled:s,submitDisabled:!Ht,shellSubmitDisabled:!Ht,workspacePath:F},B)})]}),L==="offline"&&a.jsxs("div",{role:"alert",className:"flex flex-wrap gap-3 items-center px-3 py-2 mt-4 text-amber-900 rounded-md border border-amber-300/70 bg-amber-50/80 dark:border-amber-800/70 dark:bg-amber-950/35 dark:text-amber-200",children:[a.jsx(gu,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{className:"min-w-0 flex-1 text-[12px]",children:e("taskHome.feed.offlineDescription")}),a.jsxs("button",{type:"button",onClick:()=>void j().catch(()=>{}),className:"inline-flex min-h-8 items-center gap-1.5 rounded-md border border-amber-400/70 bg-white/60 px-2.5 font-mono text-[10.5px] font-medium transition-colors hover:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500 dark:border-amber-700 dark:bg-amber-950/50 dark:hover:bg-amber-900/50",children:[a.jsx(di,{className:"w-3 h-3"}),e("taskHome.feed.retry")]})]}),f&&a.jsxs("div",{role:"alert","data-blade-task-error":!0,className:"flex justify-between items-center px-3 py-2 mt-4 font-mono text-xs text-red-700 rounded-md border border-red-200 bg-red-50/80 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300",children:[a.jsx("span",{children:f}),a.jsx("button",{type:"button",onClick:I,className:"underline",children:e("taskHome.error.dismiss")})]}),a.jsx(s3,{sessions:pt,catalogLoadState:D,cancellingTaskKeys:C,retryingTaskKeys:N,unreadTaskKeys:P,onSelect:_=>{k(he(_))},onCancel:_=>{S(he(_)).catch(()=>{})},onRetry:_=>{x(he(_)).catch(()=>{})}}),a.jsxs("div",{className:"mt-6 flex items-center justify-center gap-2 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:[a.jsx(Np,{className:"w-3 h-3"}),a.jsx("span",{className:"font-mono uppercase tracking-[0.14em]",children:e("taskHome.footer.note")})]}),a.jsx(Yx,{open:yt,onOpenChange:We})]})})}const Uc="blade.sessions.last",bi="session",Bc="project",Oo="workspace",Hc="view";function c3(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return typeof t.sessionId=="string"&&t.sessionId.trim()&&typeof t.projectPath=="string"&&t.projectPath.trim()?{sessionId:t.sessionId,projectPath:t.projectPath}:null}function l3(e){var o,d,f;const t=new URLSearchParams(e),n=((o=t.get(bi))==null?void 0:o.trim())||null,r=((d=t.get(Bc))==null?void 0:d.trim())||null,s=((f=t.get(Oo))==null?void 0:f.trim())||null,i=t.get(Hc)==="board"?"board":"workspace";return{sessionRef:n&&(s||r)?{sessionId:n,projectPath:s||r}:null,projectPath:r,hasSessionParam:t.has(bi),view:i}}function d3(e=typeof localStorage>"u"?null:localStorage){if(!e)return null;try{const t=e.getItem(Uc);return t?c3(JSON.parse(t)):null}catch{return null}}function u3(e,t,n={}){const r=n.href??(typeof window>"u"?"http://localhost/":window.location.href),s=new URL(r),i=n.view??"workspace",o=n.displayProjectPath??(i==="board"?t:e==null?void 0:e.projectPath)??t,d=(e==null?void 0:e.projectPath)??null;e&&i==="workspace"?s.searchParams.set(bi,e.sessionId):s.searchParams.delete(bi),o?s.searchParams.set(Bc,o):s.searchParams.delete(Bc),d&&o&&d!==o?s.searchParams.set(Oo,d):s.searchParams.delete(Oo),i==="board"?(s.searchParams.set(Hc,"board"),s.searchParams.delete(bi),s.searchParams.delete(Oo)):s.searchParams.delete(Hc);const f=n.storage===void 0?typeof localStorage>"u"?null:localStorage:n.storage;try{e&&i==="workspace"?f==null||f.setItem(Uc,JSON.stringify(e)):i==="workspace"&&(f==null||f.removeItem(Uc))}catch{}const u=`${s.pathname}${s.search}${s.hash}`,m=n.replaceState??(typeof window>"u"?void 0:p=>window.history.replaceState(null,"",p));return m==null||m(u),u}const p3=y.lazy(()=>es(()=>import("./ChatView-CpKiglLV.js").then(e=>e.a),__vite__mapDeps([18,1,3,5,14,2,19,7,12,8,0])).then(e=>({default:e.ChatView}))),f3=y.lazy(()=>es(()=>import("./KanbanBoard-CnZoKZFy.js"),__vite__mapDeps([20,1,3,6,12,7,19,2])).then(e=>({default:e.KanbanBoard})));function m3(){const e=Ut(),[t,n]=y.useState(!1),r=H(j=>j.subscribeToTaskEvents),s=H(j=>j.unsubscribeFromTaskEvents),i=H(j=>j.currentSessionRef),o=H(j=>j.isTemporarySession),d=H(j=>j.loadTaskWorkspaceInfo),f=H(j=>j.loadBoundProjects),u=H(j=>j.loadSessions),m=H(j=>j.selectSession),p=H(j=>j.selectProject),h=H(j=>j.startTemporarySession),b=H(j=>j.setError),k=H(j=>j.sessions),S=H(j=>j.selectedProjectPath),C=Mt(j=>j.loadModels),x=Xr(j=>j.loadSettings),N=sn(j=>j.mainView),P=sn(j=>j.setMainView),L=sn(j=>j.boardProjectPath),D=sn(j=>j.setBoardProjectPath);return y.useEffect(()=>(r().catch(j=>{console.error("Failed to subscribe to task events",j)}),s),[r,s]),y.useEffect(()=>{let j=!1;return(async()=>{var ce;u(),x(),C();const T=l3(window.location.search);P(T.view),D(T.view==="board"?T.projectPath:null);const M=d3(),$=T.view==="board"?null:T.hasSessionParam?T.sessionRef:T.projectPath?null:M,te=Promise.all([d(),f()]),O=!$&&!T.projectPath;if(O&&(h(),n(!0)),await te,j)return;const J=H.getState(),ae=T.projectPath?(ce=J.boundProjects.find(le=>le.path===T.projectPath&&le.available))==null?void 0:ce.path:null;if(ae&&p(ae),!($&&(await m($),j))){if(!$||!oe(H.getState().currentSessionRef,$)){const le=$?H.getState().error:null;h(),le&&b(le)}O||n(!0)}})(),()=>{j=!0}},[f,C,u,x,d,p,m,b,D,P,h]),y.useEffect(()=>{if(!t)return;const j=i?zd(k,i):void 0;u3(N==="workspace"?i:null,N==="board"?L:S,{displayProjectPath:N==="board"?L:j?lo(j,S):S,view:N})},[L,i,t,N,S,k]),a.jsxs(a.Fragment,{children:[a.jsx($5,{}),a.jsx(M5,{children:t?N==="board"?a.jsx(y.Suspense,{fallback:a.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:e("app.restoring")}),children:a.jsx(f3,{})}):!i||o?a.jsx(a3,{}):a.jsx(y.Suspense,{fallback:a.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:e("app.restoring")}),children:a.jsx(p3,{})}):a.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[12px] text-[hsl(var(--deck-ink-faint))]",children:e("app.restoring")})})]})}P0.createRoot(document.getElementById("root")).render(a.jsx(N0.StrictMode,{children:a.jsx(m3,{})}));export{Kc as $,Ns as A,ey as B,Ip as C,Wc as D,up as E,fu as F,qc as G,dy as H,gi as I,Kd as J,Gc as K,mt as L,jp as M,X0 as N,x3 as O,my as P,li as Q,Yo as R,by as S,Rp as T,Kr as U,Mt as V,gu as W,ui as X,Kx as Y,zc as Z,es as _,H as a,Ro as a0,Yx as a1,Ep as a2,Dn as a3,Qx as a4,Yn as a5,Zn as a6,_n as a7,JF as a8,ky as a9,Gx as aa,a5 as ab,Wd as ac,lo as ad,Mc as ae,Ke as af,Fc as ag,sy as ah,Op as ai,Ap as aj,Np as ak,v3 as al,Dx as am,uu as an,iy as ao,Yu as ap,w3 as aq,z as ar,c as as,be as at,Qn as au,he as b,se as c,Re as d,Zo as e,Jc as f,Xo as g,ea as h,Hp as i,W as j,Pp as k,X as l,Vd as m,js as n,ny as o,mu as p,Gd as q,cw as r,oe as s,pu as t,Ut as u,hy as v,zd as w,Xr as x,di as y,e3 as z};
|