blade-code 0.10.96 → 0.10.97

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.
Files changed (116) hide show
  1. package/dist/blade.js +2 -2
  2. package/dist/chunk-0p6qkcft.js +1 -0
  3. package/dist/chunk-0pdkfzgc.js +1 -0
  4. package/dist/{chunk-t48zm299.js → chunk-0v74fhhc.js} +1 -1
  5. package/dist/{chunk-9318pj5k.js → chunk-21ycnzsv.js} +1 -1
  6. package/dist/{chunk-50em9ww2.js → chunk-23qhbq46.js} +1 -1
  7. package/dist/{chunk-hrfh7wck.js → chunk-2c2cxrc0.js} +1 -1
  8. package/dist/{chunk-ax8tta9d.js → chunk-2mwgykjs.js} +1 -1
  9. package/dist/chunk-2vt67deg.js +1 -0
  10. package/dist/{chunk-0eqk29xr.js → chunk-31g86axj.js} +2 -2
  11. package/dist/{chunk-bss2kc28.js → chunk-3229684w.js} +1 -1
  12. package/dist/{chunk-zj4kfyer.js → chunk-3saxqsn7.js} +1 -1
  13. package/dist/{chunk-5vg1dwh1.js → chunk-630jj776.js} +1 -1
  14. package/dist/chunk-64kpbdpc.js +1 -0
  15. package/dist/chunk-6qxzcx0a.js +118 -0
  16. package/dist/chunk-6tzphr1p.js +10 -0
  17. package/dist/{chunk-4jbpvete.js → chunk-7bhk8qk5.js} +2 -2
  18. package/dist/chunk-7t2nf0rz.js +1 -0
  19. package/dist/{chunk-gbsxnvgg.js → chunk-7wtbhnfr.js} +1 -1
  20. package/dist/{chunk-1t097t5f.js → chunk-825r9sfe.js} +248 -248
  21. package/dist/{chunk-z6xfknxe.js → chunk-88mf53ak.js} +1 -1
  22. package/dist/{chunk-xzzrtwjx.js → chunk-88ykfsbv.js} +2 -2
  23. package/dist/{chunk-ya5p7mx7.js → chunk-8hprmrd5.js} +1 -1
  24. package/dist/{chunk-c9zd429t.js → chunk-8htbttg5.js} +1 -1
  25. package/dist/{chunk-rsh4rw9k.js → chunk-9mnspb2d.js} +1 -1
  26. package/dist/{chunk-rxbxvq67.js → chunk-a1vhp8sa.js} +2 -2
  27. package/dist/chunk-ah15z613.js +1 -0
  28. package/dist/chunk-b9thsjxh.js +2 -0
  29. package/dist/{chunk-wbfa6xce.js → chunk-bztsz28c.js} +2 -2
  30. package/dist/{chunk-rzja9zza.js → chunk-c6p5mj1k.js} +2 -2
  31. package/dist/chunk-cp9mj5he.js +1 -0
  32. package/dist/{chunk-kpxz0hbg.js → chunk-csr9d8yx.js} +2 -2
  33. package/dist/{chunk-wj403wry.js → chunk-cvpvncza.js} +2 -2
  34. package/dist/{chunk-4cvmfne8.js → chunk-dretwm9j.js} +1 -1
  35. package/dist/{chunk-va1exak5.js → chunk-dsnz4a1d.js} +1 -1
  36. package/dist/{chunk-bfxj0w4r.js → chunk-fbs90qgx.js} +1 -1
  37. package/dist/{chunk-w63dfcx5.js → chunk-fm93hym6.js} +2 -2
  38. package/dist/{chunk-b12wtvac.js → chunk-g2hxj68b.js} +3 -3
  39. package/dist/{chunk-nh45xp7r.js → chunk-g2yaghbk.js} +1 -1
  40. package/dist/chunk-g7yfjy30.js +1 -0
  41. package/dist/{chunk-na1cney5.js → chunk-h5xw792m.js} +2 -2
  42. package/dist/{chunk-z5rtzcm4.js → chunk-j1t2qedg.js} +2 -2
  43. package/dist/{chunk-ztp2ff01.js → chunk-jy4s51bt.js} +2 -2
  44. package/dist/{chunk-0r4bnnr4.js → chunk-krym2q8y.js} +1 -1
  45. package/dist/{chunk-dwttn5xg.js → chunk-m67hdwk8.js} +1 -1
  46. package/dist/{chunk-qa4efys0.js → chunk-mybhqpc7.js} +1 -1
  47. package/dist/chunk-n407vvwt.js +2 -0
  48. package/dist/{chunk-qstdm5xh.js → chunk-n7p994w1.js} +1 -1
  49. package/dist/{chunk-36tgee8v.js → chunk-nxmn37zx.js} +1 -1
  50. package/dist/{chunk-721g4w9f.js → chunk-p5ewrebt.js} +1 -1
  51. package/dist/{chunk-epmxrw4f.js → chunk-p87j2g40.js} +1 -1
  52. package/dist/chunk-perp57h6.js +1 -0
  53. package/dist/{chunk-7k5v52ct.js → chunk-ps2rv1gg.js} +1 -1
  54. package/dist/chunk-pxmfnkf3.js +1 -0
  55. package/dist/{chunk-yjh47zv6.js → chunk-q5t2rnx0.js} +1 -1
  56. package/dist/{chunk-srqfz4rw.js → chunk-qeznbnd1.js} +2 -2
  57. package/dist/{chunk-gnffwz1c.js → chunk-qhsmhx0y.js} +2 -2
  58. package/dist/chunk-qkmsw3km.js +1 -0
  59. package/dist/{chunk-am66822r.js → chunk-qm83ezt6.js} +1 -1
  60. package/dist/{chunk-7dqh8bqm.js → chunk-s36efnxd.js} +1 -1
  61. package/dist/{chunk-q74xmdkf.js → chunk-s47ypj8n.js} +3 -3
  62. package/dist/chunk-s91r4emx.js +1 -0
  63. package/dist/{chunk-4n4a3vm2.js → chunk-sdvfyzv0.js} +2 -2
  64. package/dist/{chunk-n4gtzx4x.js → chunk-t5es94zk.js} +1 -1
  65. package/dist/chunk-t5y1ebdn.js +8 -0
  66. package/dist/{chunk-5j0b62sr.js → chunk-v2bvrk83.js} +2 -2
  67. package/dist/{chunk-ggf76jxn.js → chunk-vchv2x9y.js} +2 -2
  68. package/dist/chunk-wgg7ysqn.js +1 -0
  69. package/dist/{chunk-9vp2qgt2.js → chunk-xjyr40bn.js} +2 -2
  70. package/dist/{chunk-74yge4ka.js → chunk-xtm0sp0k.js} +1 -1
  71. package/dist/{chunk-g9m309s9.js → chunk-ycr6tsfs.js} +2 -2
  72. package/dist/{chunk-0vkk338p.js → chunk-z6we2tr8.js} +1 -1
  73. package/dist/chunk-zr27h1p0.js +1 -0
  74. package/dist/{chunk-h4j0nve8.js → chunk-zvms9ap7.js} +2 -2
  75. package/dist/{chunk-dd99sgf8.js → chunk-zyfacwgn.js} +1 -1
  76. package/dist/web/assets/{ChatView-EtPiVi9S.js → ChatView-DRfyX8iK.js} +5 -5
  77. package/dist/web/assets/{CodeBlockHighlighter-CJJQKiYA.js → CodeBlockHighlighter-DAFduwex.js} +1 -1
  78. package/dist/web/assets/{FilePreview-p9GkBrrr.js → FilePreview-DP5FG_5E.js} +1 -1
  79. package/dist/web/assets/{KanbanBoard-B3HgXU0l.js → KanbanBoard-CWMPGJNx.js} +1 -1
  80. package/dist/web/assets/{MarkdownRenderer-DQd1r_NH.js → MarkdownRenderer-Dp8ahj7G.js} +3 -3
  81. package/dist/web/assets/{SettingsModal-CJ8604CG.js → SettingsModal-BR_98FMD.js} +1 -1
  82. package/dist/web/assets/{TaskSwitcher-zfuhsPf1.js → TaskSwitcher-D5WijUhR.js} +1 -1
  83. package/dist/web/assets/{TerminalPanel-BF6GORqQ.js → TerminalPanel-CE33pxwb.js} +1 -1
  84. package/dist/web/assets/{arrow-left-BSNY0aTj.js → arrow-left-Cv-KDeEq.js} +1 -1
  85. package/dist/web/assets/{calendar-clock-BizCOffP.js → calendar-clock-Cv_w0wjo.js} +1 -1
  86. package/dist/web/assets/{chevrons-up-down-CN8I3dkY.js → chevrons-up-down-BAdiQ6sx.js} +1 -1
  87. package/dist/web/assets/{clock-3-D5q6Flxt.js → clock-3-wrrODhWr.js} +1 -1
  88. package/dist/web/assets/{external-link-Dw5epjDt.js → external-link-CBEu1rS8.js} +1 -1
  89. package/dist/web/assets/{folder-Dcq3CYVD.js → folder-aphP4iXp.js} +1 -1
  90. package/dist/web/assets/index-rQ1P5u3I.js +271 -0
  91. package/dist/web/assets/{pause-DhspNLAg.js → pause-Bp8TFDGG.js} +1 -1
  92. package/dist/web/assets/{play-B4wnlOAa.js → play-CuOkQMyB.js} +1 -1
  93. package/dist/web/assets/{session-events-Ci1823tS.js → session-events-C95VE6d2.js} +10 -10
  94. package/dist/web/assets/{teamService-DelV4FvL.js → teamService-BXTinwSE.js} +1 -1
  95. package/dist/web/index.html +2 -2
  96. package/package.json +1 -1
  97. package/dist/chunk-46shzdny.js +0 -1
  98. package/dist/chunk-4p6q87bp.js +0 -1
  99. package/dist/chunk-4pamygxp.js +0 -1
  100. package/dist/chunk-54qgtz5s.js +0 -1
  101. package/dist/chunk-729bsa9b.js +0 -1
  102. package/dist/chunk-7jg5d0bz.js +0 -1
  103. package/dist/chunk-8eh0vp98.js +0 -2
  104. package/dist/chunk-brs43rma.js +0 -10
  105. package/dist/chunk-d45gd36e.js +0 -1
  106. package/dist/chunk-d83bfr0b.js +0 -2
  107. package/dist/chunk-gf2vdsx3.js +0 -1
  108. package/dist/chunk-jrjaente.js +0 -1
  109. package/dist/chunk-jzc7ez35.js +0 -1
  110. package/dist/chunk-p3nqvg65.js +0 -1
  111. package/dist/chunk-qrj0d6a5.js +0 -8
  112. package/dist/chunk-tw63vfgh.js +0 -118
  113. package/dist/chunk-vdfwj5fy.js +0 -1
  114. package/dist/chunk-vy4dz3yz.js +0 -1
  115. package/dist/chunk-x9t8340h.js +0 -1
  116. package/dist/web/assets/index-CpHES-wJ.js +0 -271
@@ -1,271 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/teamService-DelV4FvL.js","assets/vendor-react-DofNRwfy.js","assets/vendor-radix-Bc1_Q9tz.js","assets/session-events-Ci1823tS.js","assets/SettingsModal-CJ8604CG.js","assets/external-link-Dw5epjDt.js","assets/calendar-clock-BizCOffP.js","assets/play-B4wnlOAa.js","assets/team-QZ9byb3E.js","assets/arrow-left-BSNY0aTj.js","assets/TaskSwitcher-zfuhsPf1.js","assets/folder-Dcq3CYVD.js","assets/clock-3-D5q6Flxt.js","assets/FilePreview-p9GkBrrr.js","assets/chevrons-up-down-CN8I3dkY.js","assets/TerminalPanel-BF6GORqQ.js","assets/vendor-xterm-DuYZoU4T.js","assets/vendor-xterm-9CEnUXvW.css","assets/ChatView-EtPiVi9S.js","assets/pause-DhspNLAg.js","assets/KanbanBoard-B3HgXU0l.js"])))=>i.map(i=>d[i]);
2
- import{r as y,j as a,d as N0,R as O0}from"./vendor-react-DofNRwfy.js";import{S as R0,O as bp,P as M0,C as kp,a as $0,T as xp,D as yp,R as F0,b as wp,V as L0,c as D0,d as vp,e as _0,f as U0,g as Sp,h as B0,i as H0}from"./vendor-radix-Bc1_Q9tz.js";import{c as Wn,g as q0,w as cu,u as z0,a as K0,b as G0,d as lu,e as Qo,f as wo,h as du,i as Ka,t as jp,j as V0,k as W0,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 J0="modulepreload",Q0=function(e){return"/"+e},uu={},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=Q0(f),f in uu)return;uu[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":J0,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
- * @license lucide-react v0.300.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */var Y0={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
- * @license lucide-react v0.300.0 - ISC
9
- *
10
- * This source code is licensed under the ISC license.
11
- * See the LICENSE file in the root directory of this source tree.
12
- */const Z0=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,...Y0,width:s,height:s,stroke:r,strokeWidth:o?Number(i)*24/Number(s):i,className:["lucide",`lucide-${Z0(e)}`,d].join(" "),...u},[...t.map(([p,h])=>y.createElement(p,h)),...Array.isArray(f)?f:[f]]));return n.displayName=`${e}`,n};/**
13
- * @license lucide-react v0.300.0 - ISC
14
- *
15
- * This source code is licensed under the ISC license.
16
- * See the LICENSE file in the root directory of this source tree.
17
- */const Ns=se("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
18
- * @license lucide-react v0.300.0 - ISC
19
- *
20
- * This source code is licensed under the ISC license.
21
- * See the LICENSE file in the root directory of this source tree.
22
- */const X0=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
- * @license lucide-react v0.300.0 - ISC
24
- *
25
- * This source code is licensed under the ISC license.
26
- * See the LICENSE file in the root directory of this source tree.
27
- */const Ip=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
- * @license lucide-react v0.300.0 - ISC
29
- *
30
- * This source code is licensed under the ISC license.
31
- * See the LICENSE file in the root directory of this source tree.
32
- */const ey=se("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
33
- * @license lucide-react v0.300.0 - ISC
34
- *
35
- * This source code is licensed under the ISC license.
36
- * See the LICENSE file in the root directory of this source tree.
37
- */const pu=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
- * @license lucide-react v0.300.0 - ISC
39
- *
40
- * This source code is licensed under the ISC license.
41
- * See the LICENSE file in the root directory of this source tree.
42
- */const ty=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
- * @license lucide-react v0.300.0 - ISC
44
- *
45
- * This source code is licensed under the ISC license.
46
- * See the LICENSE file in the root directory of this source tree.
47
- */const fu=se("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
48
- * @license lucide-react v0.300.0 - ISC
49
- *
50
- * This source code is licensed under the ISC license.
51
- * See the LICENSE file in the root directory of this source tree.
52
- */const Cp=se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
53
- * @license lucide-react v0.300.0 - ISC
54
- *
55
- * This source code is licensed under the ISC license.
56
- * See the LICENSE file in the root directory of this source tree.
57
- */const js=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
58
- * @license lucide-react v0.300.0 - ISC
59
- *
60
- * This source code is licensed under the ISC license.
61
- * See the LICENSE file in the root directory of this source tree.
62
- */const ny=se("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
63
- * @license lucide-react v0.300.0 - ISC
64
- *
65
- * This source code is licensed under the ISC license.
66
- * See the LICENSE file in the root directory of this source tree.
67
- */const ry=se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
68
- * @license lucide-react v0.300.0 - ISC
69
- *
70
- * This source code is licensed under the ISC license.
71
- * See the LICENSE file in the root directory of this source tree.
72
- */const sy=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
- * @license lucide-react v0.300.0 - ISC
74
- *
75
- * This source code is licensed under the ISC license.
76
- * See the LICENSE file in the root directory of this source tree.
77
- */const Ep=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
- * @license lucide-react v0.300.0 - ISC
79
- *
80
- * This source code is licensed under the ISC license.
81
- * See the LICENSE file in the root directory of this source tree.
82
- */const Tp=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
- * @license lucide-react v0.300.0 - ISC
84
- *
85
- * This source code is licensed under the ISC license.
86
- * See the LICENSE file in the root directory of this source tree.
87
- */const iy=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
- * @license lucide-react v0.300.0 - ISC
89
- *
90
- * This source code is licensed under the ISC license.
91
- * See the LICENSE file in the root directory of this source tree.
92
- */const mu=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
- * @license lucide-react v0.300.0 - ISC
94
- *
95
- * This source code is licensed under the ISC license.
96
- * See the LICENSE file in the root directory of this source tree.
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
- * @license lucide-react v0.300.0 - ISC
99
- *
100
- * This source code is licensed under the ISC license.
101
- * See the LICENSE file in the root directory of this source tree.
102
- */const oy=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
- * @license lucide-react v0.300.0 - ISC
104
- *
105
- * This source code is licensed under the ISC license.
106
- * See the LICENSE file in the root directory of this source tree.
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
- * @license lucide-react v0.300.0 - ISC
109
- *
110
- * This source code is licensed under the ISC license.
111
- * See the LICENSE file in the root directory of this source tree.
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
- * @license lucide-react v0.300.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */const ay=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
- * @license lucide-react v0.300.0 - ISC
119
- *
120
- * This source code is licensed under the ISC license.
121
- * See the LICENSE file in the root directory of this source tree.
122
- */const cy=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
- * @license lucide-react v0.300.0 - ISC
124
- *
125
- * This source code is licensed under the ISC license.
126
- * See the LICENSE file in the root directory of this source tree.
127
- */const ly=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
- * @license lucide-react v0.300.0 - ISC
129
- *
130
- * This source code is licensed under the ISC license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */const dy=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
- * @license lucide-react v0.300.0 - ISC
134
- *
135
- * This source code is licensed under the ISC license.
136
- * See the LICENSE file in the root directory of this source tree.
137
- */const uy=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
- * @license lucide-react v0.300.0 - ISC
139
- *
140
- * This source code is licensed under the ISC license.
141
- * See the LICENSE file in the root directory of this source tree.
142
- */const hu=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
- * @license lucide-react v0.300.0 - ISC
144
- *
145
- * This source code is licensed under the ISC license.
146
- * See the LICENSE file in the root directory of this source tree.
147
- */const py=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
- * @license lucide-react v0.300.0 - ISC
149
- *
150
- * This source code is licensed under the ISC license.
151
- * See the LICENSE file in the root directory of this source tree.
152
- */const Ap=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
- * @license lucide-react v0.300.0 - ISC
154
- *
155
- * This source code is licensed under the ISC license.
156
- * See the LICENSE file in the root directory of this source tree.
157
- */const mt=se("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
158
- * @license lucide-react v0.300.0 - ISC
159
- *
160
- * This source code is licensed under the ISC license.
161
- * See the LICENSE file in the root directory of this source tree.
162
- */const fy=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
- * @license lucide-react v0.300.0 - ISC
164
- *
165
- * This source code is licensed under the ISC license.
166
- * See the LICENSE file in the root directory of this source tree.
167
- */const my=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
- * @license lucide-react v0.300.0 - ISC
169
- *
170
- * This source code is licensed under the ISC license.
171
- * See the LICENSE file in the root directory of this source tree.
172
- */const hy=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
- * @license lucide-react v0.300.0 - ISC
174
- *
175
- * This source code is licensed under the ISC license.
176
- * See the LICENSE file in the root directory of this source tree.
177
- */const gu=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
- * @license lucide-react v0.300.0 - ISC
179
- *
180
- * This source code is licensed under the ISC license.
181
- * See the LICENSE file in the root directory of this source tree.
182
- */const gy=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
- * @license lucide-react v0.300.0 - ISC
184
- *
185
- * This source code is licensed under the ISC license.
186
- * See the LICENSE file in the root directory of this source tree.
187
- */const zc=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
188
- * @license lucide-react v0.300.0 - ISC
189
- *
190
- * This source code is licensed under the ISC license.
191
- * See the LICENSE file in the root directory of this source tree.
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
- * @license lucide-react v0.300.0 - ISC
194
- *
195
- * This source code is licensed under the ISC license.
196
- * See the LICENSE file in the root directory of this source tree.
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
- * @license lucide-react v0.300.0 - ISC
199
- *
200
- * This source code is licensed under the ISC license.
201
- * See the LICENSE file in the root directory of this source tree.
202
- */const by=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
- * @license lucide-react v0.300.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
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
- * @license lucide-react v0.300.0 - ISC
209
- *
210
- * This source code is licensed under the ISC license.
211
- * See the LICENSE file in the root directory of this source tree.
212
- */const ky=se("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
213
- * @license lucide-react v0.300.0 - ISC
214
- *
215
- * This source code is licensed under the ISC license.
216
- * See the LICENSE file in the root directory of this source tree.
217
- */const Pp=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
- * @license lucide-react v0.300.0 - ISC
219
- *
220
- * This source code is licensed under the ISC license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */const Np=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
- * @license lucide-react v0.300.0 - ISC
224
- *
225
- * This source code is licensed under the ISC license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */const xy=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
- * @license lucide-react v0.300.0 - ISC
229
- *
230
- * This source code is licensed under the ISC license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */const Op=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
- * @license lucide-react v0.300.0 - ISC
234
- *
235
- * This source code is licensed under the ISC license.
236
- * See the LICENSE file in the root directory of this source tree.
237
- */const Gc=se("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
238
- * @license lucide-react v0.300.0 - ISC
239
- *
240
- * This source code is licensed under the ISC license.
241
- * See the LICENSE file in the root directory of this source tree.
242
- */const Rp=se("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
243
- * @license lucide-react v0.300.0 - ISC
244
- *
245
- * This source code is licensed under the ISC license.
246
- * See the LICENSE file in the root directory of this source tree.
247
- */const Mp=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
- * @license lucide-react v0.300.0 - ISC
249
- *
250
- * This source code is licensed under the ISC license.
251
- * See the LICENSE file in the root directory of this source tree.
252
- */const bu=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
- * @license lucide-react v0.300.0 - ISC
254
- *
255
- * This source code is licensed under the ISC license.
256
- * See the LICENSE file in the root directory of this source tree.
257
- */const yy=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
- * @license lucide-react v0.300.0 - ISC
259
- *
260
- * This source code is licensed under the ISC license.
261
- * See the LICENSE file in the root directory of this source tree.
262
- */const ui=se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function $p(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=$p(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Fp(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=$p(e))&&(r&&(r+=" "),r+=t);return r}const ku=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xu=Fp,wy=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return xu(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=ku(m)||ku(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 xu(e,o,f,n==null?void 0:n.class,n==null?void 0:n.className)},Vc="-",vy=e=>{const t=jy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const d=o.split(Vc);return d[0]===""&&d.length!==1&&d.shift(),Lp(d,t)||Sy(o)},getConflictingClassGroupIds:(o,d)=>{const f=n[o]||[];return d&&r[o]?[...f,...r[o]]:f}}},Lp=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Lp(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},yu=/^\[(.+)\]$/,Sy=e=>{if(yu.test(e)){const t=yu.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},jy=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Cy(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:wu(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(Iy(s)){lc(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{lc(o,wu(t,i),n,r)})})},wu=(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},Iy=e=>e.isThemeGetter,Cy=(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,Ey=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)}}},Dp="!",Ty=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(Dp),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},Ay=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},Py=e=>({cache:Ey(e.cacheSize),parseClassName:Ty(e),...vy(e)}),Ny=/\s+/,Oy=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(Ny);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=Ay(m).join(":"),x=p?C+Dp: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 Ry(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=_p(t))&&(r&&(r+=" "),r+=n);return r}const _p=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_p(e[r]))&&(n&&(n+=" "),n+=t);return n};function My(e,...t){let n,r,s,i=o;function o(f){const u=t.reduce((m,p)=>p(m),e());return n=Py(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=Oy(f,n);return s(f,m),m}return function(){return i(Ry.apply(null,arguments))}}const Ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Up=/^\[(?:([a-z-]+):)?(.+)\]$/i,$y=/^\d+\/\d+$/,Fy=new Set(["px","full","screen"]),Ly=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dy=/\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$/,_y=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Uy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,By=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jn=e=>As(e)||Fy.has(e)||$y.test(e),hr=e=>Os(e,"length",Jy),As=e=>!!e&&!Number.isNaN(Number(e)),Ga=e=>Os(e,"number",As),ri=e=>!!e&&Number.isInteger(Number(e)),Hy=e=>e.endsWith("%")&&As(e.slice(0,-1)),me=e=>Up.test(e),gr=e=>Ly.test(e),qy=new Set(["length","size","percentage"]),zy=e=>Os(e,qy,Bp),Ky=e=>Os(e,"position",Bp),Gy=new Set(["image","url"]),Vy=e=>Os(e,Gy,Yy),Wy=e=>Os(e,"",Qy),si=()=>!0,Os=(e,t,n)=>{const r=Up.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Jy=e=>Dy.test(e)&&!_y.test(e),Bp=()=>!1,Qy=e=>Uy.test(e),Yy=e=>By.test(e),Zy=()=>{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:[Hy,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(),Ky]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",zy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Vy]}],"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,Wy]}],"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"]}}},Xy=My(Zy);function W(...e){return Xy(Fp(e))}const ew=wy("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?R0:"button";return a.jsx(o,{className:W(ew({variant:t,size:n,className:e})),ref:i,...s})});Kr.displayName="Button";const Wc=F0,tw=M0,Hp=y.forwardRef(({className:e,...t},n)=>a.jsx(bp,{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}));Hp.displayName=bp.displayName;const Zo=y.forwardRef(({className:e,children:t,hideCloseButton:n,...r},s)=>a.jsxs(tw,{children:[a.jsx(Hp,{}),a.jsxs(kp,{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($0,{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=kp.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 qp=({className:e,...t})=>a.jsx("div",{className:W("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qp.displayName="DialogFooter";const Xo=y.forwardRef(({className:e,...t},n)=>a.jsx(xp,{ref:n,className:W("text-lg font-semibold leading-none tracking-tight",e),...t}));Xo.displayName=xp.displayName;const ea=y.forwardRef(({className:e,...t},n)=>a.jsx(yp,{ref:n,className:W("text-sm text-muted-foreground",e),...t}));ea.displayName=yp.displayName;const nw={"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."},rw={"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":"运行定时任务失败。"},sw=["en","zh"],Va={en:nw,zh:rw},zp="blade-ui-locale",Qc=typeof window<"u"&&typeof document<"u";function iw(){var e,t;if(Qc){try{const r=(e=window.localStorage)==null?void 0:e.getItem(zp);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=iw();const dc=new Set;function ow(){for(const e of dc)e()}function w3(){return Gr}function aw(e){var t;if(e!==Gr){if(Gr=e,Qc){try{(t=window.localStorage)==null||t.setItem(zp,e)}catch{}document!=null&&document.documentElement&&(document.documentElement.lang=e==="zh"?"zh-CN":"en")}ow()}}function Kp(e){return dc.add(e),()=>dc.delete(e)}function cw(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 cw(r,t)}function Ut(){return y.useSyncExternalStore(Kp,()=>Gr,()=>"en"),Ke}function lw(){return{locale:y.useSyncExternalStore(Kp,()=>Gr,()=>"en"),setLocale:aw}}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 dw(e){return e===8205}function uw(e){return Br(e,55296,56319)}function vu(e){return Br(e,127462,127487)}function Gp(e){return Br(e,65024,65039)}function Vp(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 Su(e,t){for(;t<e.length;){const n=e.codePointAt(t);if(Vp(n)||Gp(n))t+=Co(n);else break}return t}function Yc(e,t){const n=e.codePointAt(t);let r=t+Co(n);for(r=Su(e,r);r<e.length-1&&e[r]==="‍";){const s=e.codePointAt(r+1);r+=1+Co(s),r=Su(e,r)}return vu(n)&&r<e.length&&vu(e.codePointAt(r))&&(r+=Co(e.codePointAt(r))),r}function Wp(e){return uw(e)||Vp(e)||Gp(e)||dw(e)}function pw(e){let t=0,n=0;for(;n<e.length;)n=Yc(e,n),t++;return t}function fw(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 mw(e,t){let n=0,r=0;for(;r<e.length;)if(r=Yc(e,r),n++,n>t)return!1;return!0}function hw(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Wp(e.charCodeAt(n)))return fw(e,t);if(n++,n>=t)return!0}return!1}function gw(e,t){let n=0;for(;n<e.length;){if(Wp(e.charCodeAt(n)))return mw(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 Jp(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 Qp(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 bw(e){return pw(e)}function Yp(e,t){return gw(e,t)}function Zp(e,t){return hw(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 Xp(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 kw(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 xw(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)?xw(e,t):re(e)?kw(e,t):g(e,t)}const Mo=Object.freeze(Object.defineProperty({__proto__:null,Counted:el,Entries:it,EntriesRegExp:tl,Every:ht,EveryAll:Pt,GraphemeCount:bw,HasPropertyKey:E,IsArray:q,IsBigInt:st,IsBoolean:xt,IsClassInstance:Qp,IsConstructor:ta,IsDeepEqual:ns,IsEqual:g,IsFunction:Tn,IsGreaterEqualThan:Rs,IsGreaterThan:ts,IsInteger:Zc,IsLessEqualThan:ir,IsLessThan:Si,IsMaxLength:Yp,IsMinLength:Zp,IsMultipleOf:Jp,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:Xp,Symbols:nl,Values:rl},Symbol.toStringTag,{value:"Module"})),yw=/^[\p{ID_Start}_$][\p{ID_Continue}_$\u200C\u200D]*$/u;function ww(e){return yw.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 ef(e){return`typeof ${e} === "bigint"`}function vw(e){return`typeof ${e} === "boolean"`}function Sw(e){return`Number.isInteger(${e})`}function jw(e){return`${e} === null`}function tf(e){return`Number.isFinite(${e})`}function nf(e){return Ct(rf(e),$t($o(e)))}function rf(e){return`typeof ${e} === "object" && ${e} !== null`}function sf(e){return`typeof ${e} === "string"`}function Iw(e){return`typeof ${e} === "symbol"`}function uc(e){return`${e} === undefined`}function Cw(e){return`typeof ${e} === "function"`}function Ew(e){return`Guard.IsConstructor(${e})`}function Zt(e,t){return`${e} === ${t}`}function of(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 Tw(e,t){return`Guard.IsMinLength(${e}, ${t})`}function Aw(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 Pw(e,t,n){return`${e}.some((${t[0]}, ${t[1]}) => ${n})`}function Nw(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 af(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 cf(e,t){return`Guard.IsDeepEqual(${e}, ${t})`}function Ow(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}${ww(t)?`.${t}`:`[${G(t)}]`}`}function G(e){if(!Ms(e))throw Error("Unsupported Constant");return pe(e)?JSON.stringify(e):`${e}`}function Rw(e,t,n){return`(${e} ? ${t} : ${n})`}function ra(e){return`{ ${e.join("; ")}; }`}function tr(e,t){return`const ${e} = ${t}`}function lf(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 Mw(e,t){return`Guard.IsMultipleOf(${e}, ${t})`}function $w(e){return e instanceof Boolean}function Fw(e){return e instanceof Number}function Lw(e){return e instanceof String}function Ii(e){return globalThis.ArrayBuffer.isView(e)}function df(e){return e instanceof globalThis.RegExp}function uf(e){return e instanceof globalThis.Date}function pf(e){return e instanceof globalThis.Set}function ff(e){return e instanceof globalThis.Map}function Dw(e){return E(e,"~kind")||E(e,"~unsafe")}function _w(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 Uw(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 Bw(e){return Qp(e)?e:Dw(e)?_w(e):Uw(e)}function Hw(e){return e.map(t=>Wr(t))}function qw(e){return e.slice()}function zw(e){return new RegExp(e.source,e.flags)}function Kw(e){return new Map(Wr([...e.entries()]))}function Gw(e){return new Set(Wr([...e.values()]))}function Wr(e){return Ii(e)?qw(e):df(e)?zw(e):ff(e)?Kw(e):pf(e)?Gw(e):q(e)?Hw(e):re(e)?Bw(e):e}function al(e){return Wr(e)}const Vw={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Ci(){return Vw}function Ww(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 Jw(e,t){return{...e,...t}}function we(e,t,n={}){const r=Jw(t,n);return Ww(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 Qw(e){return ke(e,{"~readonly":!0},{})}function cl(e,t){return ke(Qw(e),{},t)}function Yw(e,t,n,r){const s=V(e,t,n);return cl(s,r)}function Zw(e){return ke(e,{"~optional":!0},{})}function ll(e,t){return ke(Zw(e),{},t)}function Xw(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 ev(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 tv(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 nv="(?!)";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 rv(e){return Fo(e)}function an(e){return on(e)&&E(e,"~optional")}function sv(e){return U(e).filter(t=>!an(e[t]))}function mf(e){return U(e)}function hf(e){return rl(e)}function Me(e,t={}){const n=sv(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 iv(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 ov(e){return ke(e,{"~unsafe":null},{})}function gf(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 av(e){return Mn(e,["~kind","if","then","else"])}function cv(e){return kn(e)}function lv(e){return U(e).filter(n=>isNaN(n)).reduce((n,r)=>[...n,e[r]],[])}function dv(e){return pe(e)||Ie(e)}function uv(e,t){const n=cv(e)?lv(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 pv(e){return Mn(e,["~kind","allOf"])}let Wa;function fv(){try{return kf("null")(),!0}catch{return!1}}function bf(){return Fe(Wa)&&(Wa=fv()),Wa&&Ci().useAcceleration}function kf(...e){return new globalThis.Function(...e)}function Ft(){throw new Error("Unreachable")}function mv(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 hv(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[gv,bv]=[BigInt("1099511628211"),BigInt("18446744073709551616")],kv=Array.from({length:256}).map((e,t)=>BigInt(t)),xf=new Float64Array(1),yf=new DataView(xf.buffer),wf=new Uint8Array(xf.buffer);function St(e){Es=Es^kv[e],Es=Es*gv%bv}function xv(e){St(Lt.Array);for(const t of e)yr(t)}function yv(e){St(Lt.BigInt),yf.setBigInt64(0,e);for(const t of wf)St(t)}function ju(e){St(Lt.Boolean),St(e?1:0)}function wv(e){St(Lt.Constructor),yr(e.toString())}function vv(e){St(Lt.Date),yr(e.getTime())}function Sv(e){St(Lt.Function),yr(e.toString())}function jv(e){St(Lt.Null)}function Iu(e){St(Lt.Number),yf.setFloat64(0,e,!0);for(const t of wf)St(t)}function Iv(e){St(Lt.Object);for(const t of mv(e).sort())yr(t),yr(e[t])}function Cv(e){St(Lt.RegExp),fc(e.toString())}const Ev=new TextEncoder;function fc(e){St(Lt.String);for(const t of Ev.encode(e))St(t)}function Tv(e){St(Lt.Symbol),yr(e.toString())}function Av(e){St(Lt.TypeArray);const t=new Uint8Array(e.buffer);for(let n=0;n<t.length;n++)St(t[n])}function Pv(e){return St(Lt.Undefined)}function yr(e){return Ii(e)?Av(e):uf(e)?vv(e):df(e)?Cv(e):$w(e)?ju(e.valueOf()):Lw(e)?fc(e.valueOf()):Fw(e)?Iu(e.valueOf()):hv(e)?Iu(e):q(e)?xv(e):xt(e)?ju(e):st(e)?yv(e):ta(e)?wv(e):Xt(e)?jv():re(e)?Iv(e):pe(e)?fc(e):Xc(e)?Tv(e):Fe(e)?Pv():Tn(e)?Sv(e):Ft()}function vf(e){return Es=BigInt("14695981039346656037"),yr(e),Es}function ia(e){return vf(e).toString(16).padStart(16,"0")}const Nv=Object.freeze(Object.defineProperty({__proto__:null,Hash:ia,HashCode:vf},Symbol.toStringTag,{value:"Module"}));function Ov(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 Rv=Ov;function Mv(){return Rv}class Sf{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 jf{constructor(t){this.type=t}Decode(t){return new Sf(this.type,t)}}function fl(e){return new jf(e)}function $v(e,t){return fl(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function Fv(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 Lv(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 Dv(e){return _o(e)}function Uo(e){return on(e)&&E(e,"~readonly")}function _v(e,t){const n=ml(e)?[...e["~refine"],t]:[t];return ke(e,{"~refine":n},{})}function Uv(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[s,i,()=>"Refine Error"]});return _v(t,{check:n,error:r})}function Bv(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=>Bv(t))}const Hv="-?(?:0|[1-9][0-9]*)n";function hl(e){return we({"~kind":"BigInt"},{type:"bigint"},e)}function is(e){return Ce(e,"BigInt")}function If(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 qv(e){return Ce(e,"Identifier")}const Cf="-?(?:0|[1-9][0-9]*)";function oa(e){return we({"~kind":"Integer"},{type:"integer"},e)}function qn(e){return Ce(e,"Integer")}class zv extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}}function Kv(e){return st(e)?"bigint":xt(e)?"boolean":Ie(e)?"number":pe(e)?"string":(()=>{throw new zv(e)})()}function De(e,t){return we({"~kind":"Literal"},{type:Kv(e),const:e},t)}function Ef(e){return st(e)||xt(e)||Ie(e)||pe(e)}function Gv(e){return Qe(e)&&st(e.const)}function Vv(e){return Qe(e)&&xt(e.const)}function Tf(e){return Qe(e)&&Ie(e.const)}function Af(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 Pf="-?(?: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 Wv(e){return Ce(e,"Parameter")}const Nf=".*";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 Jv(e){return Mn(e,["~kind","anyOf"])}function Of(e){const t=OC(e);return g(t.length,2)?t[0]:[]}function Qv(e){return!0}function Rf(e){return Te(e,(t,n)=>Yv(t)?Rf(n):!1,()=>!0)}function Mf(e){return g(e.length,0)?!1:Rf(e)}function Yv(e){return fe(e)?Mf(e.anyOf):Qe(e)?Qv(e.const):!1}function $f(e){return Mf(e)}function Ff(e){return we({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function Lf(e,t,n=[]){return Te(e,(r,s)=>Lf(s,t,[...n,`${r}${t}`]),()=>n)}function Zv(e,t){return g(e.length,0)?[`${t}`]:Lf(e,t)}function Df(e,t,n=[]){return Te(t,(r,s)=>Df(e,s,[...n,..._f(e,r)]),()=>n)}function _f(e,t){return fe(t)?Df(e,t.anyOf):Qe(t)?Zv(e,t.const):Ft()}function Uf(e,t){return Te(t,(n,r)=>Uf(_f(e,n),r),()=>e)}function Xv(e){return e.map(t=>De(t))}function eS(e){const t=Uf([],e),n=Xv(t);return Je(n)}function tS(e){return g(e.length,0)?Ft():g(e.length,1)&&Qe(e[0])?e[0]:eS(e)}function Bf(e){const t=Of(e);return g(t.length,0)?zn():$f(t)?tS(t):Ff(e)}function kl(e){const t=Bf(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 nS(e){return vr(Qr,e)}function rS(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 sS(e){return Mn(e,["~kind","type","items","minItems","additionalItems"])}function iS(e){return Mn(e,["~readonly"])}function Hf(e,t){return ke(iS(e),{},t)}function oS(e,t,n,r){const s=V(e,t,n);return Hf(s,r)}function aS(e,t={}){return Ne("RemoveReadonly",[e],t)}function cS(e,t={}){return Hf(e,t)}function lS(e){return Mn(e,["~optional"])}function qf(e,t){return ke(lS(e),{},t)}function dS(e,t,n,r){const s=V(e,t,n);return qf(s,r)}function uS(e,t={}){return Ne("RemoveOptional",[e],t)}function zf(e,t={}){return qf(e,t)}function Kf(e){return e.reduceRight((n,r,s)=>({[s]:r,...n}),{})}function pS(e){const t=Kf(e.items);return Me(t)}function fS(e,t){return Uo(e)?!!Uo(t):!1}function mS(e,t){return an(e)?!!an(t):!1}function hS(e,t){const n=fS(e,t),r=mS(e,t),s=pn([e,t]),i=cS(zf(s));return n&&r?_o(Fo(i)):n&&!r?_o(i):!n&&r?Fo(i):i}function gS(e,t,n){return n in e?n in t?hS(e[n],t[n]):e[n]:n in t?t[n]:Nt()}function bS(e,t){return[...new Set([...U(t),...U(e)])].reduce((r,s)=>({...r,[s]:gS(e,t,s)}),{})}function Cu(e){return Ue(e)?e.properties:at(e)?Kf(e.items):Ft()}function kS(e,t){const n=Cu(e),r=Cu(t),s=bS(n,r);return Me(s)}function xS(e,t){const n=ga(e,t);return g(n,Hl)?e:g(n,ql)||g(n,Bl)?t:Nt()}function Eu(e){return Ue(e)||at(e)}function yS(e,t){const n=fe(e),r=fe(t);return n||r}function wS(e,t){const n=Jr(e),r=Jr(t),s=yS(n,r),i=Eu(n),o=Eu(r);return s?pn([n,r]):i&&o?kS(n,r):i&&!o?n:!i&&o?r:xS(n,r)}function Gf(e,t,n=[]){return Te(t,(r,s)=>Gf(e,s,[...n,wS(e,r)]),()=>g(n.length,0)?[e]:n)}function Vf(e,t,n=[]){return Te(e,(r,s)=>Vf(s,t,[...n,...Bo([r],t)]),()=>n)}function Bo(e,t=[]){return Te(e,(n,r)=>fe(n)?Bo(r,Vf(n.anyOf,t)):Bo(r,Gf(n,t)),()=>t)}function vS(e,t){const n=sr({},e,t);return Yt(n)?[]:[e]}function SS(e,t){return e.reduce((n,r)=>[...n,...vS(r,t)],[])}function Wf(e,t){const n=Jr(e),r=fe(n)?n.anyOf:[n],s=SS(r,t);return ar(s)}function Ls(e,t,n){const r=Bn([e,t]),s=Wf(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=ph(t);return Ds(n)}function or(e){const t=kl(e);return Jr(t)}function ar(e){const t=ph(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 jS(e,t){const n=Er(e);return ca(n,t)}function IS(e,t){return vr(Mi,t)}function CS(e,t){const n=pn(e);return ca(n,t)}function ES(e,t){return pe(e)||Ie(e)?Me({[e]:t}):g(e,!1)?Me({false:t}):g(e,!0)?Me({true:t}):Me({})}function TS(e,t){return vr(la,t)}function AS(e,t){return E(e,"pattern")&&(pe(e.pattern)||e.pattern instanceof RegExp)?vr(e.pattern.toString(),t):vr(Qr,t)}function PS(e,t){const n=Of(e);return $f(n)?ca(or(e),t):vr(e,t)}function NS(e){return fe(e)?aa(e.anyOf):[e]}function aa(e){return e.reduce((t,n)=>[...t,...NS(n)],[])}function OS(e){return e.some(t=>Fn(t)||un(t)||qn(t))}function RS(e,t){return g(OS(e),!0)?vr(Qr,t):void 0}function MS(e,t){return e.reduce((n,r)=>Qe(r)&&(pe(r.const)||Ie(r.const))?{...n,[r.const]:t}:n,{})}function $S(e,t){const n=MS(e,t);return Me(n)}function FS(e,t){const n=aa(e),r=RS(n,t);return on(r)?r:$S(n,t)}function ca(e,t){return $n(e)?nS(t):Cr(e)?rS(t):vn(e)?jS(e.enum,t):qn(e)?IS(e,t):Be(e)?CS(e.allOf,t):Qe(e)?ES(e.const,t):un(e)?TS(e,t):fe(e)?FS(e.anyOf,t):Fn(e)?AS(e,t):Wt(e)?PS(e.pattern,t):Me({})}function Jf(e,t,n){return Xe([e])?ke(ca(e,t),{},n):Qf(e,t,n)}function LS(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Jf(i,o,s)}const Mi=`^${Cf}$`,la=`^${Pf}$`,Qr=`^${Nf}$`;function Qf(e,t,n={}){return Ne("Record",[e,t],n)}function xl(e,t,n={}){return Jf(e,t,n)}function DS(e,t){return vr(e,t)}function hc(e){return g(e,Qr)?zn():g(e,Mi)?oa():g(e,la)?wr():Bf(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 Yf(e){return we({"~kind":"This"},{$ref:"#"},e)}function Zf(e){return Ce(e,"This")}function yl(e){return we({"~kind":"Undefined"},{type:"undefined"},e)}function _s(e){return Ce(e,"Undefined")}function Xf(e){return we({"~kind":"Void"},{type:"void"},e)}function os(e){return Ce(e,"Void")}function _S(e,t){return g(e,"Array")?Ir(t[0]):g(e,"Capitalize")?bh(t[0]):g(e,"ConstructorParameters")?Eh(t[0]):g(e,"Evaluate")?OP(t[0]):g(e,"Exclude")?Ah(t[0],t[1]):g(e,"Extract")?Ph(t[0],t[1]):g(e,"Index")?Wl(t[0],t[1]):g(e,"InstanceType")?Lh(t[0]):g(e,"Lowercase")?kh(t[0]):g(e,"NonNullable")?Hh(t[0]):g(e,"Omit")?zh(t[0],t[1]):g(e,"Parameters")?Vh(t[0]):g(e,"Partial")?Jh(t[0]):g(e,"Pick")?Yh(t[0],t[1]):g(e,"Readonly")?Xh(t[0]):g(e,"KeyOf")?Zl(t[0]):g(e,"Record")?Qf(t[0],t[1]):g(e,"Required")?ng(t[0]):g(e,"ReturnType")?sg(t[0]):g(e,"Uncapitalize")?xh(t[0]):g(e,"Uppercase")?yh(t[0]):Ic(gn(e),t)}function as(){throw Error("Unreachable")}function em(e,t=[]){return Te(e,(n,r)=>em(r,[...t,n[1]]),()=>t)}function cr(e){return g(e.length,3)?[e[0],...em(e[1])]:[]}function US(e){return Ri(e[0],e[2],e[4])}function BS(e){return Ri(e[0],e[2],e[2])}function HS(e){return Ri(e[0],Kt(),e[2])}function qS(e){return Ri(e,Kt(),Kt())}function zS(e){return cr(e)}function KS(e){return e[1]}function GS(e){return cr(e)}function VS(e){return e[1]}function WS(e){return _S(e[0],e[1])}function JS(e){return null}function QS(e){return zn()}function YS(e){return wr()}function ZS(e){return If()}function XS(e){return yl()}function e1(e){return gl()}function t1(e){return oa()}function n1(e){return hl()}function r1(e){return Kt()}function s1(e){return pl()}function i1(e){return Me({})}function o1(e){return Nt()}function a1(e){return bl()}function c1(e){return Xf()}function l1(e){return Yf()}function d1(e){return De(BigInt(e))}function u1(e){return De(g(e,"true"))}function p1(e){return De(parseFloat(e))}function f1(e){return De(e)}function m1(e){return e[1]}function h1(e){return De(e)}function g1(e){return g(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function b1(e){return e[1]}function k1(e){return Ym(e)}function x1(e){return g(e.length,6)?Lo(e[1],e[3],e[5]):Lo(e[1],e[3],Kt())}function y1(e){return e.length>0}function w1(e){return e.reduce((t,n)=>g(n.length,3)?[...t,[n[1]]]:[...t,[]],[])}function v1(e){return g(e.length,6)?[e[1],e[3],e[5]]:[]}function S1(e){return q(e)&&g(e.length,3)?e[1]:e}function j1(e){return g(e.length,2)?e[1]:[]}function Tu(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 Au(e,t){return g(t.length,3)?Ih(e,t[0],t[1],t[2]):e}function I1(e,t){return q(t)&&g(t.length,0)?e:og(e,t)}function C1(e){const[t,n,r,s,i]=e;return I1(Au(t?Zl(Tu(n,r)):Tu(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 E1(e){const[t,n]=e;return wl(t,n)}function T1(e){const[t,n]=e;return wl(t,n)}function A1(e){return NP(e[1])}function P1(e){return e[1]}function N1(e){return Ai(e[0],e[2])}function O1(e){return g(e.length,4)?pc(e[1],e[3]):g(e.length,2)?pc(e[1],Kt()):as()}function R1(e){return`${e}`}function M1(e){return qn(e[3])?Mi:un(e[3])?la:Oi(e[3])||Fn(e[3])?Qr:as()}function $1(e){return e.length>0}function F1(e){return e.length>0}function L1(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 D1(e){return cr(e)}function tm(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 _1(e){return tm(e[1])}function U1(e){const[t,n]=e,r=g(U(n).length,0)?{}:{patternProperties:n};return Me(t,r)}function B1(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 H1(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 q1(e){return g(e.length,2)?ua(e[1]):g(e.length,1)?e[0]:as()}function z1(e){return cr(e)}function K1(e){return Sn(e[1])}function G1(e){return rr(nr(e[4]))}function V1(e){return rr(e[3])}function W1(e){return nr(e[3])}function J1(e){return e[2]}function Q1(e){return g(e.length,2)?ua(e[1]):g(e.length,1)?e[0]:as()}function Y1(e){return cr(e)}function Z1(e){return Ti(e[1],e[4])}function X1(e){return Ei(e[2],e[5])}function Pu(e,t){return g(e,"remove")?aS(t):g(e,"add")?rr(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 Nu(e,t){return g(e,"remove")?uS(t):g(e,"add")?nr(t):t}function tj(e){return g(e.length,2)&&g(e[0],"-")?"remove":g(e.length,2)&&g(e[0],"+")||g(e.length,1)?"add":"none"}function nj(e){return g(e.length,2)?[e[1]]:[]}function rj(e){return q(e[6])&&g(e[6].length,1)?Cc(mc(e[3]),e[5],e[6][0],Pu(e[1],Nu(e[8],e[10]))):Cc(mc(e[3]),e[5],gn(e[3]),Pu(e[1],Nu(e[8],e[10])))}function sj(e){return gn(e)}function ij(e){return BigInt(e)}function oj(e){return parseFloat(e)}function aj(e){return g(e,"true")}function cj(e){return null}function lj(e){return{[e[0]]:e[2]}}function dj(e){return cr(e)}function uj(e){return e.reduce((t,n)=>kt(t,n),{})}function pj(e){return uj(e[1])}function fj(e){return cr(e)}function mj(e){return e[1]}function hj(e){return hl()}function gj(e){return zn()}function bj(e){return wr()}function kj(e){return oa()}function xj(e){return Nt()}function yj(e){return De(e)}function wj(e){return Je(e[1])}function vj(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Sj(e){return[e[0],...e[1]]}function jj(e){return e[1]}function Ij(e){return cr(e)}function Cj(e){return g(e.length,2)?e[1]:[]}function Ej(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 Tj(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 Aj(e){return{[e[1]]:Ai(e[2],e[4])}}function Pj(e){return{[e[1]]:e[3]}}function Nj(e){return null}function Oj(e){return cr(e)}function Rj(e){return e[1]}function Mj(e){const[t,n]=[e[0],e[1]];return RP(kt(t,tm(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 $j(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=$j(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 Fj=[...gc(97,122),...gc(65,90)],nm="0",rm=gc(49,57),Sl=[nm,...rm],Lj=" ",jl=`
263
- `,$i="_",Il=".",Dj="$",sm="-",im="//",om="/*",_j="*/";function am(e){const t=e.indexOf(_j);return g(t,-1)?"":e.slice(t+2)}function cm(e){const t=e.indexOf(jl);return g(t,-1)?"":e.slice(t)}function Uj(e){return e.replace(/^[ \t\r\f\v]+/,"")}function bc(e){const t=Uj(e);return t.startsWith(om)?bc(am(t.slice(2))):t.startsWith(im)?bc(cm(t.slice(2))):t}function Pn(e){const t=e.trimStart();return t.startsWith(om)?Pn(am(t.slice(2))):t.startsWith(im)?Pn(cm(t.slice(2))):t}function lm(e,t){return Le(Dt([e],t),(n,r)=>[n,r],()=>["",t])}function Bj(e,t){return e.includes(t)}function Ho(e,t,n,r=""){return Le(Dt(e,n),(s,i)=>Bj(t,s)?Ho(e,t,i,r):Ho(e,t,i,`${r}${s}`),()=>[r,n])}function Hj(e){return Dt(rm,e)}const qj=[...Sl,$i];function zj(e){return Ho(qj,[$i],e)}function Kj(e){return Le(Dt([nm],e),(t,n)=>[t,n],()=>Le(Hj(e),(t,n)=>Le(zj(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[]))}function dm(e){return Kj(Pn(e))}function Gj(e){return lm(sm,e)}function Vj(e){return Le(Gj(e),(t,n)=>Le(dm(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[])}function Wj(e){return Vj(Pn(e))}function Jj(e){return Le(Wj(e),(t,n)=>Le(Dt(["n"],n),(r,s)=>[`${t}`,s],()=>[]),()=>[])}function um(e){return Jj(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(Lj)?Ja(e,t):Ja(e,Pn(t))}const pm=[...Fj,$i,Dj];function Qj(e){return Dt(pm,e)}const Yj=[...pm,...Sl];function fm(e,t=""){return Le(Dt(Yj,e),(n,r)=>fm(r,`${t}${n}`),()=>[t,e])}function Zj(e){return Le(Qj(e),(t,n)=>Le(fm(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[])}function rt(e){return Zj(Pn(e))}const Xj=[...Sl,$i];function eI(e){return vl(Dt([Il],e))}function mm(e){return Le(Ho(Xj,[$i],e),(t,n)=>g(t,"")?[]:[t,n],()=>[])}function tI(e){return Le(Dt([Il],e),(t,n)=>Le(mm(n),(r,s)=>[`0${t}${r}`,s],()=>[]),()=>[])}function nI(e){return Le(dm(e),(t,n)=>Le(Dt([Il],n),(r,s)=>Le(mm(s),(i,o)=>[`${t}${r}${i}`,o],()=>[`${t}`,s]),()=>[`${t}`,n]),()=>[])}function rI(e){return eI(e)?tI(e):nI(e)}function sI(e){return rI(Pn(e))}function iI(e){return lm(sm,e)}function oI(e){return Le(iI(e),(t,n)=>Le(sI(n),(r,s)=>[`${t}${r}`,s],()=>[]),()=>[])}function Cl(e){return oI(Pn(e))}function aI(e){return g(e,"")?[]:[e.slice(0,1),e.slice(1)]}function hm(e,t){return Te(e,(n,r)=>t.startsWith(n)?!0:hm(r,t),()=>!1)}function Fi(e,t,n=""){return Le(aI(t),(r,s)=>hm(e,t)?[n,t]:Fi(e,s,`${n}${r}`),()=>[])}function cI(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 lI(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 dI(e,t,n,r){return n?cI(e,t,Pn(r)):lI(e,t,Pn(r))}function uI(e,t){return Dt(e,t)}function pI(e,t){return dI(e,e,!1,t)}function fI(e,t){return Le(uI(e,t),(n,r)=>pI(n,`${n}${r}`),()=>[])}function El(e,t){return fI(e,Pn(t))}function mI(e,t){return Le(Fi(e,t),(n,r)=>g(n,"")?[]:[n,r],()=>[])}const l=(e,t,n=()=>[])=>e.length===2?t(e):n(),hI=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])=>[US(t),n]),gI=e=>l(l(rt(e),([t,n])=>l(v("extends",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[BS(t),n]),bI=e=>l(l(rt(e),([t,n])=>l(v("=",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[HS(t),n]),kI=e=>l(rt(e),([t,n])=>[qS(t),n]),gm=e=>l(l(hI(e),([t,n])=>[t,n],()=>l(gI(e),([t,n])=>[t,n],()=>l(bI(e),([t,n])=>[t,n],()=>l(kI(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),bm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(gm(r),([s,i])=>[[n,s],i])),([n,r])=>bm(r,[...t,n]),()=>[t,e]),xI=e=>l(l(l(gm(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])=>[zS(t),n]),Tl=e=>l(l(v("<",e),([t,n])=>l(xI(n),([r,s])=>l(v(">",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[KS(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]),yI=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])=>[GS(t),n]),wI=e=>l(l(v("<",e),([t,n])=>l(yI(n),([r,s])=>l(v(">",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[VS(t),n]),vI=e=>l(l(rt(e),([t,n])=>l(wI(n),([r,s])=>[[t,r],s])),([t,n])=>[WS(t),n]),xm=e=>l(l(l(v(";",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[JS(),n]),ym=e=>l(v("string",e),([t,n])=>[QS(),n]),wm=e=>l(v("number",e),([t,n])=>[YS(),n]),SI=e=>l(v("boolean",e),([t,n])=>[ZS(),n]),jI=e=>l(v("undefined",e),([t,n])=>[XS(),n]),II=e=>l(v("null",e),([t,n])=>[e1(),n]),vm=e=>l(v("integer",e),([t,n])=>[t1(),n]),CI=e=>l(v("bigint",e),([t,n])=>[n1(),n]),EI=e=>l(v("unknown",e),([t,n])=>[r1(),n]),TI=e=>l(v("any",e),([t,n])=>[s1(),n]),AI=e=>l(v("object",e),([t,n])=>[i1(),n]),PI=e=>l(v("never",e),([t,n])=>[o1(),n]),Sm=e=>l(v("symbol",e),([t,n])=>[a1(),n]),NI=e=>l(v("void",e),([t,n])=>[c1(),n]),OI=e=>l(v("this",e),([t,n])=>[l1(),n]),RI=e=>l(l(v("${",e),([t,n])=>l(ye(n),([r,s])=>l(v("}",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[m1(t),n]),Qa=e=>l(Fi(["${","`"],e),([t,n])=>[h1(t),n]),jm=e=>l(l(l(Qa(e),([t,n])=>l(RI(n),([r,s])=>l(jm(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])=>[g1(t),n]),Im=e=>l(l(v("`",e),([t,n])=>l(jm(n),([r,s])=>l(v("`",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[b1(t),n]),MI=e=>l(Im(e),([t,n])=>[k1(t),n]),$I=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])=>[x1(t),n]),FI=e=>l(um(e),([t,n])=>[d1(t),n]),LI=e=>l(l(v("true",e),([t,n])=>[t,n],()=>l(v("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[u1(t),n]),DI=e=>l(Cl(e),([t,n])=>[p1(t),n]),_I=e=>l(El(["'",'"'],e),([t,n])=>[f1(t),n]),UI=e=>l(l(l(v("keyof",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[y1(t),n]),Cm=(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])=>Cm(r,[...t,n]),()=>[t,e]),BI=e=>l(Cm(e),([t,n])=>[w1(t),n]),HI=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])=>[v1(t),n]),qI=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(ym(e),([t,n])=>[t,n],()=>l(wm(e),([t,n])=>[t,n],()=>l(SI(e),([t,n])=>[t,n],()=>l(jI(e),([t,n])=>[t,n],()=>l(II(e),([t,n])=>[t,n],()=>l(vm(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(PI(e),([t,n])=>[t,n],()=>l(Sm(e),([t,n])=>[t,n],()=>l(NI(e),([t,n])=>[t,n],()=>l(OI(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(_I(e),([t,n])=>[t,n],()=>l(MI(e),([t,n])=>[t,n],()=>l($I(e),([t,n])=>[t,n],()=>l(eC(e),([t,n])=>[t,n],()=>l(rC(e),([t,n])=>[t,n],()=>l(lC(e),([t,n])=>[t,n],()=>l(cC(e),([t,n])=>[t,n],()=>l(fC(e),([t,n])=>[t,n],()=>l(vI(e),([t,n])=>[t,n],()=>l(mC(e),([t,n])=>[t,n],()=>[])))))))))))))))))))))))))))),([t,n])=>[S1(t),n]),zI=e=>l(l(l(v("with",e),([t,n])=>l(qm(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[j1(t),n]),Em=e=>l(l(UI(e),([t,n])=>l(qI(n),([r,s])=>l(BI(s),([i,o])=>l(HI(o),([d,f])=>l(zI(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[C1(t),n]),Tm=e=>l(l(l(v("&",e),([t,n])=>l(Em(n),([r,s])=>l(Tm(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),Am=e=>l(l(Em(e),([t,n])=>l(Tm(n),([r,s])=>[[t,r],s])),([t,n])=>[E1(t),n]),Pm=e=>l(l(l(v("|",e),([t,n])=>l(Am(n),([r,s])=>l(Pm(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(Am(e),([t,n])=>l(Pm(n),([r,s])=>[[t,r],s])),([t,n])=>[T1(t),n]),KI=e=>l(l(v("readonly",e),([t,n])=>l(fa(n),([r,s])=>[[t,r],s])),([t,n])=>[A1(t),n]),GI=e=>l(l(v("|",e),([t,n])=>l(fa(n),([r,s])=>[[t,r],s])),([t,n])=>[P1(t),n]),VI=e=>l(l(Tl(e),([t,n])=>l(v("=",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[N1(t),n]),WI=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])=>[O1(t),n]),ye=e=>l(l(WI(e),([t,n])=>[t,n],()=>l(GI(e),([t,n])=>[t,n],()=>l(KI(e),([t,n])=>[t,n],()=>l(fa(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),JI=e=>l(Cl(e),([t,n])=>[R1(t),n]),QI=e=>l(rt(e),([t,n])=>[t,n]),YI=e=>l(El(["'",'"'],e),([t,n])=>[t,n]),ZI=e=>l(l(v("[",e),([t,n])=>l(rt(n),([r,s])=>l(v(":",s),([i,o])=>l(l(vm(o),([d,f])=>[d,f],()=>l(wm(o),([d,f])=>[d,f],()=>l(ym(o),([d,f])=>[d,f],()=>l(Sm(o),([d,f])=>[d,f],()=>[])))),([d,f])=>l(v("]",f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[M1(t),n]),Nm=e=>l(l(JI(e),([t,n])=>[t,n],()=>l(QI(e),([t,n])=>[t,n],()=>l(YI(e),([t,n])=>[t,n],()=>l(ZI(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),Om=e=>l(l(l(v("readonly",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[$1(t),n]),Rm=e=>l(l(l(v("?",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[F1(t),n]),Mm=e=>l(l(Om(e),([t,n])=>l(Nm(n),([r,s])=>l(Rm(s),([i,o])=>l(v(":",o),([d,f])=>l(ye(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[L1(t),n]),ma=e=>l(l(l(v(",",e),([t,n])=>l(v(`
264
- `,n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(v(";",e),([t,n])=>l(v(`
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]),$m=(e,t=[])=>l(l(ma(e),([n,r])=>l(Mm(r),([s,i])=>[[n,s],i])),([n,r])=>$m(r,[...t,n]),()=>[t,e]),XI=e=>l(l(l(Mm(e),([t,n])=>l($m(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])=>[D1(t),n]),Al=e=>l(l(v("{",e),([t,n])=>l(XI(n),([r,s])=>l(v("}",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[_1(t),n]),eC=e=>l(Al(e),([t,n])=>[U1(t),n]),tC=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])=>[B1(t),n]),Ou=e=>l(l(tC(e),([t,n])=>[t,n],()=>l(l(Om(e),([t,n])=>l(ye(n),([r,s])=>l(Rm(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>[])),([t,n])=>[H1(t),n]),Fm=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])=>[q1(t),n]),Lm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(Fm(r),([s,i])=>[[n,s],i])),([n,r])=>Lm(r,[...t,n]),()=>[t,e]),nC=e=>l(l(l(Fm(e),([t,n])=>l(Lm(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])=>[z1(t),n]),rC=e=>l(l(v("[",e),([t,n])=>l(nC(n),([r,s])=>l(v("]",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[K1(t),n]),sC=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])=>[G1(t),n]),iC=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])=>[V1(t),n]),oC=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])=>[W1(t),n]),aC=e=>l(l(rt(e),([t,n])=>l(v(":",n),([r,s])=>l(ye(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[J1(t),n]),Ru=e=>l(l(sC(e),([t,n])=>[t,n],()=>l(iC(e),([t,n])=>[t,n],()=>l(oC(e),([t,n])=>[t,n],()=>l(aC(e),([t,n])=>[t,n],()=>[])))),([t,n])=>[t,n]),Dm=e=>l(l(l(v("...",e),([t,n])=>l(Ru(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l(l(Ru(e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>[])),([t,n])=>[Q1(t),n]),_m=(e,t=[])=>l(l(v(",",e),([n,r])=>l(Dm(r),([s,i])=>[[n,s],i])),([n,r])=>_m(r,[...t,n]),()=>[t,e]),Um=e=>l(l(l(Dm(e),([t,n])=>l(_m(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])=>[Y1(t),n]),cC=e=>l(l(v("(",e),([t,n])=>l(Um(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])=>[Z1(t),n]),lC=e=>l(l(v("new",e),([t,n])=>l(v("(",n),([r,s])=>l(Um(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])=>[X1(t),n]),dC=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])=>[ej(t),n]),uC=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])=>[tj(t),n]),pC=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])=>[nj(t),n]),fC=e=>l(l(v("{",e),([t,n])=>l(dC(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(pC(h),([b,k])=>l(v("]",k),([S,C])=>l(uC(C),([x,N])=>l(v(":",N),([P,L])=>l(ye(L),([D,j])=>l(xm(j),([I,T])=>l(v("}",T),([M,$])=>[[t,r,i,d,u,p,b,S,x,P,D,I,M],$]))))))))))))),([t,n])=>[rj(t),n]),mC=e=>l(rt(e),([t,n])=>[sj(t),n]),hC=e=>l(um(e),([t,n])=>[ij(t),n]),gC=e=>l(Cl(e),([t,n])=>[oj(t),n]),bC=e=>l(l(v("true",e),([t,n])=>[t,n],()=>l(v("false",e),([t,n])=>[t,n],()=>[])),([t,n])=>[aj(t),n]),kC=e=>l(El(['"',"'"],e),([t,n])=>[t,n]),xC=e=>l(v("null",e),([t,n])=>[cj(),n]),yC=e=>l(v("undefined",e),([t,n])=>[void 0,n]),Bm=e=>l(l(Nm(e),([t,n])=>l(v(":",n),([r,s])=>l(Pl(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[lj(t),n]),Hm=(e,t=[])=>l(l(ma(e),([n,r])=>l(Bm(r),([s,i])=>[[n,s],i])),([n,r])=>Hm(r,[...t,n]),()=>[t,e]),wC=e=>l(l(l(Bm(e),([t,n])=>l(Hm(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])=>[dj(t),n]),qm=e=>l(l(v("{",e),([t,n])=>l(wC(n),([r,s])=>l(v("}",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[pj(t),n]),zm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(Pl(r),([s,i])=>[[n,s],i])),([n,r])=>zm(r,[...t,n]),()=>[t,e]),vC=e=>l(l(l(Pl(e),([t,n])=>l(zm(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])=>[fj(t),n]),SC=e=>l(l(v("[",e),([t,n])=>l(vC(n),([r,s])=>l(v("]",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[mj(t),n]),Pl=e=>l(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(yC(e),([t,n])=>[t,n],()=>l(qm(e),([t,n])=>[t,n],()=>l(SC(e),([t,n])=>[t,n],()=>[])))))))),([t,n])=>[t,n]),jC=e=>l(v("-?(?:0|[1-9][0-9]*)n",e),([t,n])=>[hj(),n]),IC=e=>l(v(".*",e),([t,n])=>[gj(),n]),CC=e=>l(v("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",e),([t,n])=>[bj(),n]),EC=e=>l(v("-?(?:0|[1-9][0-9]*)",e),([t,n])=>[kj(),n]),TC=e=>l(v("(?!)",e),([t,n])=>[xj(),n]),AC=e=>l(mI(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,n])=>[yj(t),n]),PC=e=>l(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(TC(e),([t,n])=>[t,n],()=>l(NC(e),([t,n])=>[t,n],()=>l(AC(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])=>[wj(t),n]),Km=e=>l(l(l(kc(e),([t,n])=>l(v("|",n),([r,s])=>l(Km(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])=>[vj(t),n]),kc=e=>l(l(PC(e),([t,n])=>l(Nl(n),([r,s])=>[[t,r],s])),([t,n])=>[Sj(t),n]),Nl=e=>l(l(Km(e),([t,n])=>[t,n],()=>l(kc(e),([t,n])=>[t,n],()=>[])),([t,n])=>[t,n]),OC=e=>l(l(v("^",e),([t,n])=>l(Nl(n),([r,s])=>l(v("$",s),([i,o])=>[[t,r,i],o]))),([t,n])=>[jj(t),n]),Gm=(e,t=[])=>l(l(v(",",e),([n,r])=>l(ye(r),([s,i])=>[[n,s],i])),([n,r])=>Gm(r,[...t,n]),()=>[t,e]),RC=e=>l(l(l(ye(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])=>[Ij(t),n]),Vm=e=>l(l(l(v("extends",e),([t,n])=>l(RC(n),([r,s])=>[[t,r],s])),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Cj(t),n]),MC=e=>l(l(v("interface",e),([t,n])=>l(rt(n),([r,s])=>l(Tl(s),([i,o])=>l(Vm(o),([d,f])=>l(Al(f),([u,m])=>[[t,r,i,d,u],m]))))),([t,n])=>[Ej(t),n]),$C=e=>l(l(v("interface",e),([t,n])=>l(rt(n),([r,s])=>l(Vm(s),([i,o])=>l(Al(o),([d,f])=>[[t,r,i,d],f])))),([t,n])=>[Tj(t),n]),FC=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])=>[Aj(t),n]),LC=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])=>[Pj(t),n]),DC=e=>l(l(l(v("export",e),([t,n])=>[[t],n]),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Nj(),n]),Wm=e=>l(l(l(v(";",e),([t,n])=>l(v(`
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]),Jm=(e,t=[])=>l(l(Wm(e),([n,r])=>l(Ol(r),([s,i])=>[[n,s],i])),([n,r])=>Jm(r,[...t,n]),()=>[t,e]),_C=e=>l(l(l(Ol(e),([t,n])=>l(Jm(n),([r,s])=>l(l(Wm(s),([i,o])=>[[i],o],()=>[[],s]),([i,o])=>[[t,r,i],o]))),([t,n])=>[t,n],()=>l([[],e],([t,n])=>[t,n],()=>[])),([t,n])=>[Oj(t),n]),Ol=e=>l(l(DC(e),([t,n])=>l(l(MC(n),([r,s])=>[r,s],()=>l($C(n),([r,s])=>[r,s],()=>l(FC(n),([r,s])=>[r,s],()=>l(LC(n),([r,s])=>[r,s],()=>[])))),([r,s])=>l(xm(s),([i,o])=>[[t,r,i],o]))),([t,n])=>[Rj(t),n]),UC=e=>l(l(Ol(e),([t,n])=>l(_C(n),([r,s])=>[[t,r],s])),([t,n])=>[Mj(t),n]),BC=e=>l(l(UC(e),([t,n])=>[t,n],()=>l(VI(e),([t,n])=>[t,n],()=>l(ye(e),([t,n])=>[t,n],()=>[]))),([t,n])=>[t,n]);function HC(e){const t=Im(`\`${e}\``);return g(t.length,2)?t[0]:Ft()}function qC(e){return e.join("|")}function zC(e){return e.slice(1,e.length-1)}function KC(e,t,n){return Tr(t,`${n}${e}`)}function GC(e,t){return Tr(e,`${t}${Hv}`)}function VC(e,t){return Tr(e,`${t}${Cf}`)}function WC(e,t){return Tr(e,`${t}${Pf}`)}function JC(e,t){return Li(Je([De("false"),De("true")]),e,t)}function QC(e,t){return Tr(e,`${t}${Nf}`)}function YC(e,t,n){return Tr(t,`${n}${zC(e)}`)}function ZC(e,t,n){const r=Rl(e,{});return Li(r,t,n)}function XC(e,t,n){const r=Er(e);return Li(r,t,n)}function Qm(e,t,n,r=[]){return Te(e,(s,i)=>Qm(i,t,n,[...r,Li(s,[],"")]),()=>Tr(t,`${n}(${qC(r)})`))}function Li(e,t,n){return vn(e)?XC(e.enum,t,n):qn(e)?VC(t,n):Qe(e)?KC(e.const,t,n):is(e)?GC(t,n):Cr(e)?JC(t,n):un(e)?WC(t,n):Fn(e)?QC(t,n):Wt(e)?YC(e.pattern,t,n):r2(e)?ZC(e.parameters[0],t,n):fe(e)?Qm(e.anyOf,t,n):nv}function Tr(e,t){return Te(e,(n,r)=>Li(n,r,t),()=>t)}function e2(e){return`^${Tr(e,"")}$`}function t2(e){const t=e2(e);return Ff(t)}function Rl(e,t){return Xe(e)?ke(t2(e),{},t):Ym(e,t)}function n2(e,t,n,r){const s=Xn(e,t,n);return Rl(s,r)}function Ym(e,t={}){return Ne("TemplateLiteral",[e],t)}function r2(e){return on(e)&&E(e,"action")&&g(e.action,"TemplateLiteral")}function Zm(e){return Rl(e,{})}function s2(e){const t=HC(e);return Zm(t)}function i2(e,t={}){const n=pe(e)?s2(e):Zm(e);return ke(n,{},t)}function Wt(e){return Ce(e,"TemplateLiteral")}function Xm(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 o2=Object.freeze(Object.defineProperty({__proto__:null,ExtendsFalse:je,ExtendsTrue:ee,ExtendsUnion:Xm,IsExtendsFalse:xc,IsExtendsTrue:$l,IsExtendsTrueLike:Yt,IsExtendsUnion:Ml,Match:It},Symbol.toStringTag,{value:"Module"}));function a2(e,t,n,r){return It(Ze(e,n,r),s=>ee(kt(kt(e,s),{[t]:n})),()=>je())}function c2(e,t){return ee(e)}function l2(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 d2(e,t,n){const r=Er(n);return Ze(e,t,r)}function eh(e,t,n){return Te(n,(r,s)=>It(Ze(e,t,r),i=>eh(i,t,s),()=>je()),()=>ee(e))}function u2(e,t,n){const r=or(n);return Ze(e,t,r)}function th(e,t,n){return Te(n,(r,s)=>It(Ze(e,t,r),i=>ee(i),()=>th(e,t,s)),()=>je())}function jt(e,t,n){return $n(n)?c2(e):wn(n)?l2(e,t,n.if,n.then,n.else):vn(n)?d2(e,t,n.enum):cn(n)?a2(e,n.name,t,n.extends):Be(n)?eh(e,t,n.allOf):Wt(n)?u2(e,t,n.pattern):fe(n)?th(e,t,n.anyOf):An(n)?ee(e):je()}function p2(e,t,n){return cn(n)?jt(e,t,n):$n(n)||An(n)?ee(e):Xm(e)}function f2(e,t){const n=Do(e),r=Do(t);return n&&r||!n&&r?!0:!(n&&!r)}function m2(e,t,n,r){return gt(r)?f2(t,r)?Ze(e,n,r.items):je():jt(e,t,r)}function h2(e,t,n){return is(n)?ee(e):jt(e,t,n)}function g2(e,t,n){return Cr(n)?ee(e):jt(e,t,n)}function b2(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 k2(e,t,n,r){return Te(r,(s,i)=>b2(e,t,n,s,i),()=>an(t)?ee(e):je())}function x2(e,t,n){return Te(t,(r,s)=>k2(e,r,s,n),()=>ee(e))}function Fl(e,t,n){return x2(e,t,n)}function nh(e,t,n){return os(n)?ee(e):Ze(e,t,n)}function y2(e,t,n,r){return $n(r)||An(r)?ee(e):xn(r)?It(Fl(e,t,r.parameters),s=>nh(s,n,r.instanceType),()=>je()):je()}function w2(e,t,n,r,s){return It(Ze(e,t,s),()=>Ze(e,n,s),()=>Ze(e,r,s))}function v2(e,t,n){const r=Er(t);return Ze(e,r,n)}function S2(e,t,n,r){return $n(r)||An(r)?ee(e):yn(r)?It(Fl(e,t,r.parameters),s=>nh(s,n,r.returnType),()=>je()):je()}function j2(e,t,n){return qn(n)||un(n)?ee(e):jt(e,t,n)}function I2(e,t,n){const r=pn(t);return Ze(e,r,n)}function ha(e,t,n){return t===n?ee(e):je()}function C2(e,t,n){return Qe(n)?ha(e,t,n.const):is(n)?ee(e):jt(e,De(t),n)}function E2(e,t,n){return Qe(n)?ha(e,t,n.const):Cr(n)?ee(e):jt(e,De(t),n)}function T2(e,t,n){return Qe(n)?ha(e,t,n.const):un(n)?ee(e):jt(e,De(t),n)}function A2(e,t,n){return Qe(n)?ha(e,t,n.const):Fn(n)?ee(e):jt(e,De(t),n)}function P2(e,t,n){return st(t.const)?C2(e,t.const,n):xt(t.const)?E2(e,t.const,n):Ie(t.const)?T2(e,t.const,n):pe(t.const)?A2(e,t.const,n):Ft()}function N2(e,t,n){return cn(n)?jt(e,t,n):ee(e)}function O2(e,t,n){return Ni(n)?ee(e):jt(e,t,n)}function R2(e,t,n){return un(n)?ee(e):jt(e,t,n)}function M2(e,t,n){return an(t)?an(n)?ee(e):je():ee(e)}function $2(e,t,n){return cn(n)&&Fs(n.extends)?je():It(Ze(e,t,n),r=>M2(r,t,n),()=>je())}function F2(e,t){return e.reduce((n,r)=>r in t&&Yt(t[r])?{...n,...t[r].inferred}:Ft(),{})}function L2(e,t,n){const r={};for(const o of U(n))r[o]=o in t?$2({},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?F2(U(r),r):{};return s?ee(i):je()}function D2(e,t,n){const r=L2(e,t,n);return Yt(r)?ee(kt(e,r.inferred)):je()}function _2(e,t,n){return D2(e,t,n)}function U2(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 rh(e,t,n,r){return Te(t,(s,i)=>It(Ze({},e[s],n),o=>rh(e,i,n,U2(r,o)),()=>je()),()=>ee(r))}function B2(e,t,n,r){const s=U(t);return rh(t,s,r,e)}function H2(e,t,n){return Ot(n)?B2(e,t,jn(n),Vt(n)):Ue(n)?_2(e,t,n.properties):jt(e,Me(t),n)}function q2(e,t){return g(U(t).length,0)?ee(e):je()}function z2(e,t,n,r,s){return Ze(e,n,s)}function K2(e,t,n,r){return Ot(r)?z2(e,hc(t),n,hc(jn(r)),Vt(r)):Ue(r)?q2(e,r.properties):$n(r)||An(r)?ee(e):je()}function G2(e,t,n){return Fn(n)?ee(e):jt(e,t,n)}function V2(e,t,n){return Oi(n)?ee(e):jt(e,t,n)}function W2(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 sh(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 ih(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 J2(e,t,n,r){const s=Dl(n,r);return q(s)?ee(kt(e,{[t]:Sn(s)})):je()}function oh(e,t,n,r){const s=Dl(n,r);return q(s)?ee(kt(e,{[t]:Je(s)})):je()}function Q2(e){return[...e].reverse()}function wc(e,t){return t?Q2(e):e}function Y2(e){const t=e.length>0?e[0]:void 0,n=on(t)?sh(t):void 0;return on(n)}function Z2(e,t,n,r,s,i){return It(Ze(e,n,s),o=>ah(o,t,r,i),()=>je())}function X2(e,t,n,r,s){const i=sh(r);return Ll(i)?J2(e,i.name,wc(n,t),i.type):Te(n,(o,d)=>Z2(e,t,o,d,r,s),()=>je())}function eE(e,t,n,r){return Te(r,(s,i)=>X2(e,t,n,s,i),()=>g(n.length,0)?ee(e):je())}function ah(e,t,n,r){return eE(e,t,n,r)}function tE(e,t,n){const r=Hi(e,_t([],[]),n),s=Y2(r);return ah(e,s,wc(t,s),wc(r,s))}function ch(e,t,n){const r=ih(n);return Ll(r)?oh(e,r.name,t,r.type):Te(t,(s,i)=>It(Ze(e,s,n),o=>ch(o,i,n),()=>je()),()=>ee(e))}function nE(e,t,n){const r=Hi(e,_t([],[]),t);return at(n)?tE(e,r,n.items):gt(n)?ch(e,r,n.items):jt(e,Sn(r),n)}function rE(e,t,n){return os(n)||_s(n)?ee(e):jt(e,t,n)}function lh(e,t,n){return Te(n,(r,s)=>It(Ze(e,t,r),i=>ee(i),()=>lh(e,t,s)),()=>je())}function vc(e,t,n){return Te(t,(r,s)=>It(lh(e,r,n),i=>vc(i,s,n),()=>je()),()=>ee(e))}function sE(e,t,n){const r=ih(n);return Ll(r)?oh(e,r.name,t,r.type):fe(n)?vc(e,t,n.anyOf):vc(e,t,[n])}function iE(e,t,n){return cn(n)?jt(e,t,n):$n(n)||An(n)?ee(e):je()}function oE(e,t,n){return os(n)?ee(e):jt(e,t,n)}function Ze(e,t,n){return $n(t)?p2(e,t,n):gt(t)?m2(e,t,t.items,n):is(t)?h2(e,t,n):Cr(t)?g2(e,t,n):xn(t)?y2(e,t.parameters,t.instanceType,n):wn(t)?w2(e,t.if,t.then,t.else,n):vn(t)?v2(e,t.enum,n):yn(t)?S2(e,t.parameters,t.returnType,n):qn(t)?j2(e,t,n):Be(t)?I2(e,t.allOf,n):Qe(t)?P2(e,t,n):Fs(t)?N2(e,t,n):Ni(t)?O2(e,t,n):un(t)?R2(e,t,n):Ue(t)?H2(e,t.properties,n):Ot(t)?K2(e,jn(t),Vt(t),n):Fn(t)?G2(e,t,n):Oi(t)?V2(e,t,n):Wt(t)?W2(e,t.pattern,n):at(t)?nE(e,t.items,n):_s(t)?rE(e,t,n):fe(t)?sE(e,t.anyOf,n):An(t)?iE(e,t,n):os(t)?oE(e,t,n):je()}function aE(e,t){return pn([...e,Me(t)])}function dh(e,t,n){return Xe(e)?ke(aE(e,t),{},n):_l(e,t,n)}function cE(e,t,n,r,s){const i=Xn(e,t,n),o=Xl(e,t,r);return dh(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 lE(e,t,n={}){return dh(e,t,n)}function dE(e,t,n){return e.includes(n)?!0:ki([...e,n],t,t[n])}function Mu(e,t,n){const r=hf(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)?dE(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)?Mu(e,t,n.parameters[1]):Be(n)?Ur(e,t,n.allOf):Ue(n)?Mu(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 uE(e,t,n){return ki(e,t,n)}function pE(e,t){return t.reduce((n,r)=>uE([r],e,e[r])?[...n,r]:n,[])}function fE(e){const t=mf(e);return pE(e,t)}function mE(e,t,n){return n.includes(t)?n:t in e?xi(e,e[t],[...n,t]):Ft()}function $u(e,t,n){const r=hf(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)?mE(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)?$u(e,t.parameters[1],n):Be(t)?Is(e,t.allOf,n):Ue(t)?$u(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 hE(e,t,n){return xi(e,n,[t])}function gE(e){return pl()}function bE(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)?gE(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(bE(e.properties)):Ot(e)?xl(da(e),Hr(Vt(e))):fe(e)?Je(ii(e.anyOf)):at(e)?Sn(ii(e.items)):e}function kE(e,t){return t in e?Hr(e[t]):Kt()}function xE(e){return kE(e.$defs,e.$ref)}function yE(e,t,n){const r=Xn(e,_t([],[]),t),s=Xl({},_t([],[]),n);return pn([...r,Me(s)])}function wE(e,t){return U(e).filter(r=>t.includes(r)).reduce((r,s)=>{const i=e[s],o=Ul(i)?yE(e,i.parameters[0],i.parameters[1]):i;return{...r,[s]:o}},{})}function vE(e,t,n){const r=hE(e,t,n),s=wE(e,r);return Pi(s,t)}function uh(e,t){return t in e?vt(e[t])?uh(e,e[t].$ref):e[t]:Nt()}function Di(e,t){return uh(e,t)}function Fu(e){return Gt(e)?xE(e):gf(e)?Kt():e}function sr(e,t,n){const r=Fu(t),s=Fu(n);return Ze(e,r,s)}const Bl="equal",SE="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:SE}function jE(e,t){return t.filter(n=>ga(e,n)!==ql)}function IE(e,t){const n=t.some(r=>{const s=ga(e,r);return g(s,Hl)||g(s,Bl)});return g(n,!1)}function CE(e,t){const n=Jr(e);return $n(n)?[n]:IE(n,t)?[...jE(n,t),n]:t}function EE(e){return e.reduce((t,n)=>Ue(n)?[...t,n]:Fs(n)?t:CE(n,t),[])}function ph(e){const t=EE(e);return aa(t)}function fh(e,t){return ke(Jr(e),{},t)}function TE(e,t,n,r){const s=V(e,t,n);return fh(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 AE(e,t){return e.reduce((n,r)=>[...n,t.includes(r.name)],[])}function mh(e,t,n=[]){return Te(e,(r,s)=>Te(t,(i,o)=>mh(s,o,[...n,[i,r]]),()=>n),()=>n)}function PE(e){return Wt(e)?or(e.pattern):vn(e)?Er(e.enum):e}function NE(e){const t=PE(e);return fe(t)?[...t.anyOf]:[t]}function OE(e,t){return e.reduce((n,r)=>[...n,[...r,t]],[])}function Lu(e,t){return t.reduce((n,r)=>[...n,...OE(e,r)],[])}function Du(e){return e.reduce((t,n)=>g(n[0],!0)?Lu(t,NE(n[1])):Lu(t,[n[1]]),[[]])}function RE(e,t,n){const r=ai(n),s=AE(e,r),i=mh(t,s);return Ps(n)&&g(n.action,"Conditional")||Ps(n)&&g(n.action,"Mapped")?Du(i):[t]}function ME(){return["(not-resolvable)",Nt()]}function $E(){return["(not-generic)",Nt()]}function FE(e,t,n){return[e,Ai(t,n)]}function LE(e,t,n){return t in e?hh(e,t,e[t]):ME()}function hh(e,t,n,r){return ul(n)?FE(t,n.parameters,n.expression):vt(n)?LE(e,n.$ref):$E()}function DE(e,t,n){return hh(e,"(anonymous)",t)}function _E(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 _u(e,t,n,r,s){const i=V(e,t,s);return _E(n,i,r),kt(e,{[n]:i})}function UE(e,t,n,r,s){const i=V(e,t,n.extends),o=V(e,t,n.equals);return Te(s,(d,f)=>Sc(_u(e,t,n.name,i,d),t,r,f),()=>Sc(_u(e,t,n.name,i,o),t,r,[]))}function Sc(e,t,n,r){return Te(n,(s,i)=>UE(e,t,s,i,r),()=>e)}function BE(e,t,n,r){return Sc(e,t,n,r)}let jc=0,zl=0;function HE(){if(!Si(zl,Ci().maxInstantiationCount))throw Error("Type instantiation is excessively deep and possibly infinite")}function qE(){HE(),zl++,jc++}function zE(){jc--,g(jc,0)&&(zl=0)}function KE(e){return ts(e.callstack.length,0)?e.callstack[e.callstack.length-1]:""}function GE(e,t){return g(KE(e),t)}function VE(e,t,n,r,s,i){qE();try{const o=BE(e,t,r,i),d=V(o,_t([...t.callstack,n.$ref],t.visited),s);return V(o,_t([],[]),d)}finally{zE()}}function WE(e,t,n,r,s,i){return i.reduce((o,d)=>{const f=VE(e,t,n,r,s,d);return[...o,f]},[])}function JE(e,t,n,r,s,i){const o=RE(r,i,s),d=WE(e,t,n,r,s,o);return g(d.length,1)?d[0]:ar(d)}function gh(e,t,n,r){const s=Xn(e,t,r),i=DE(e,n),o=i[0],d=i[1];return ul(d)?GE(t,o)?Ic(gn(o),s):JE(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 QE(e,t){return gh({},_t([],[]),e,t)}function Kl(e){return Ce(e,"Call")}function YE(e){return Mn(e,["~immutable"])}function ZE(e,t){return ke(YE(e),{},t)}function XE(e,t,n,r){const s=V(e,t,n);return ZE(s,r)}function eT(e,t){return e(t)}function tT(e,t){return pe(t)?De(eT(e,t)):De(t)}function nT(e,t){const n=or(t);return Us(e,n)}function rT(e,t){const n=t.map(r=>Us(e,r));return Je(n)}function Us(e,t){return Qe(t)?tT(e,t.const):Wt(t)?nT(e,t.pattern):fe(t)?rT(e,t.anyOf):t}function bh(e,t={}){return Ne("Capitalize",[e],t)}function sT(e,t={}){return wh(e,t)}function kh(e,t={}){return Ne("Lowercase",[e],t)}function iT(e,t={}){return vh(e,t)}function xh(e,t={}){return Ne("Uncapitalize",[e],t)}function oT(e,t={}){return Sh(e,t)}function yh(e,t={}){return Ne("Uppercase",[e],t)}function aT(e,t={}){return jh(e,t)}const cT=e=>e[0].toUpperCase()+e.slice(1),lT=e=>e.toLowerCase(),dT=e=>e[0].toLowerCase()+e.slice(1),uT=e=>e.toUpperCase();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 jh(e,t){return Xe([e])?ke(Us(uT,e),{},t):yh(e,t)}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 hT(e,t,n,r){const s=V(e,t,n);return jh(s,r)}function Ih(e,t,n,r,s={}){return Ne("Conditional",[e,t,n,r],s)}function gT(e,t,n,r,s={}){return Ch({},_t([],[]),e,t,n,r,s)}function bT(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 Ch(e,t,n,r,s,i,o){return Xe([n,r])?ke(bT(e,t,n,r,s,i),{},o):Ih(n,r,s,i,o)}function kT(e,t,n,r,s,i,o){const d=V(e,t,n),f=V(e,t,r);return Ch(e,t,d,f,s,i,o)}function Eh(e,t={}){return Ne("ConstructorParameters",[e],t)}function xT(e,t={}){return Th(e,t)}function yT(e){const t=xn(e)?e.parameters:[],n=Hi({},_t([],[]),t);return Sn(n)}function Th(e,t){return Xe([e])?ke(yT(e),{},t):Eh(e,t)}function wT(e,t,n,r){const s=V(e,t,n);return Th(s,r)}function Ah(e,t,n={}){return Ne("Exclude",[e,t],n)}function vT(e,t,n={}){return Gl(e,t,n)}function Gl(e,t,n){return Xe([e,t])?ke(Wf(e,t),{},n):Ah(e,t,n)}function ST(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Gl(i,o,s)}function Ph(e,t,n={}){return Ne("Extract",[e,t],n)}function jT(e,t,n={}){return Nh(e,t,n)}function IT(e,t){const n=sr({},e,t);return Yt(n)?[e]:[]}function CT(e,t){return e.reduce((n,r)=>[...n,...IT(r,t)],[])}function ET(e,t){const n=Jr(e),r=fe(n)?n.anyOf:[n],s=CT(r,t);return ar(s)}function Nh(e,t,n){return Xe([e,t])?ke(ET(e,t),{},n):Ph(e,t,n)}function TT(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Nh(i,o,s)}function AT(e){return e.reduce((t,n)=>Ef(n)?[...t,De(n)]:t,[])}function Vl(e){const t=AT(e);return Je(t)}function Wl(e,t,n={}){return Ne("Index",[e,t],n)}function PT(e,t,n={}){const r=q(t)?Vl(t):t;return Fh(e,r,n)}function NT(e,t){const n=Di(e,t);return cs(n)}function OT(e,t,n){const r=Ls(e,t,n);return cs(r)}function RT(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 MT(e){return e.reduce((t,n)=>RT(t,cs(n)),{})}function $T(e){const t=pS(Sn(e));return cs(t)}function FT(e,t){return U(e).filter(s=>s in t).reduce((s,i)=>({...s,[i]:ar([e[i],t[i]])}),{})}function Oh(e,t){return Te(e,(n,r)=>Oh(r,FT(t,cs(n))),()=>t)}function LT(e){return Te(e,(t,n)=>Oh(n,cs(t)),()=>Ft())}function cs(e){return Gt(e)?NT(e.$defs,e.$ref):wn(e)?OT(e.if,e.then,e.else):Be(e)?MT(e.allOf):fe(e)?LT(e.anyOf):at(e)?$T(e.items):Ue(e)?e.properties:{}}function Jl(e){const t=cs(e);return Me(t)}const DT=new RegExp("^(?:0|[1-9][0-9]*)$");function Ql(e){const t=`${e}`;return DT.test(t)?parseInt(t):e}function _T(e){return De(Ql(e))}function Uu(e){return e.map(t=>Rh(t))}function Rh(e){return Be(e)?Bn(Uu(e.allOf)):fe(e)?Je(Uu(e.anyOf)):Qe(e)?_T(e.const):e}function UT(e,t){const n=Rh(t),r=sr({},n,wr());return Yt(r)?e:Qe(t)&&g(t.const,"length")?wr():Nt()}function BT(e,t){const n=Di(e,t);return ls(n)}function HT(e,t,n){const r=Ls(e,t,n);return ls(r)}function qT(e){const t=Er(e);return ls(t)}function zT(e){const t=pn(e);return ls(t)}function KT(e){return[`${e}`]}function GT(e){const t=or(e);return ls(t)}function VT(e){return e.reduce((t,n)=>[...t,...ls(n)],[])}function ls(e){return Gt(e)?BT(e.$defs,e.$ref):wn(e)?HT(e.if,e.then,e.else):vn(e)?qT(e.enum):Be(e)?zT(e.allOf):Qe(e)?KT(e.const):Wt(e)?GT(e.pattern):fe(e)?VT(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)):Zf(t)?Me(e):t}function WT(e,t){return pi(e,t)}function JT(e,t){const n=t in e?e[t]:Nt();return WT(e,n)}function Mh(e,t){return t.reduce((n,r)=>[...n,JT(e,r)],[])}function QT(e,t){const n=Yl(t),r=Mh(e,n);return ar(r)}const YT=new RegExp(Mi);function ZT(e){return e.filter(n=>YT.test(n))}function XT(e){const t=mf(e),n=ZT(t),r=Mh(e,n);return ar(r)}function eA(e,t){return un(t)?XT(e):QT(e,t)}function tA(e){return De(Ql(e))}function Bu(e){return e.map(t=>$h(t))}function $h(e){return Be(e)?Bn(Bu(e.allOf)):fe(e)?Je(Bu(e.anyOf)):Qe(e)?tA(e.const):e}function nA(e,t){return e.reduceRight((n,r,s)=>{const i=sr({},De(s),t);return Yt(i)?[r,...n]:n},[])}function rA(e,t){const n=$h(t),r=nA(e,n);return Ds(r)}function sA(e){return Ds(e)}function iA(e,t){return Qe(t)&&g(t.const,"length")?De(e.length):un(t)||qn(t)?sA(e):rA(e,t)}function oA(e,t){return gt(e)?UT(e.items,t):Ue(e)?eA(e.properties,t):at(e)?iA(e.items,t):Nt()}function aA(e){return Gt(e)||wn(e)||Be(e)||fe(e)?Jl(e):e}function Fh(e,t,n){return Xe([e,t])?ke(oA(aA(e),t),{},n):Wl(e,t,n)}function cA(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Fh(i,o,s)}function Lh(e,t={}){return Ne("InstanceType",[e],t)}function lA(e,t={}){return Dh(e,t)}function dA(e){return xn(e)?e.instanceType:Nt()}function Dh(e,t){return Xe([e])?ke(dA(e),{},t):Lh(e,t)}function uA(e,t,n,r={}){const s=V(e,t,n);return Dh(s,r)}function Zl(e,t={}){return Ne("KeyOf",[e],t)}function pA(e,t={}){return _h(e,t)}function fA(){return Je([wr(),zn(),bl()])}function mA(e){return wr()}function hA(e){return e.reduce((n,r)=>Ef(r)?[...n,De(Ql(r))]:Ft(),[])}function gA(e){const t=U(e),n=hA(t);return Ds(n)}function bA(e){return da(e)}function kA(e){const t=e.map((n,r)=>De(r));return Ds(t)}function xA(e){return $n(e)?fA():gt(e)?mA(e.items):Ue(e)?gA(e.properties):Ot(e)?bA(e):at(e)?kA(e.items):Nt()}function yA(e){return Gt(e)||wn(e)||Be(e)||fe(e)?Jl(e):e}function _h(e,t){return Xe([e])?ke(xA(yA(e)),{},t):Zl(e,t)}function wA(e,t,n,r){const s=V(e,t,n);return _h(s,r)}function Cc(e,t,n,r,s={}){return Ne("Mapped",[e,t,n,r],s)}function vA(e,t,n,r,s={}){return Uh({},_t([],[]),e,t,n,r,s)}function SA(e){const t=or(e);return ba(t)}function jA(e){return e.reduce((t,n)=>[...t,...ba(n)],[])}function IA(e){const t=Er(e);return ba(t)}function CA(e){return Ie(e)?[De(`${e}`)]:[De(e)]}function ba(e){return vn(e)?IA(e.enum):Qe(e)?CA(e.const):Wt(e)?SA(e.pattern):fe(e)?jA(e.anyOf):[e]}function EA(e){return ba(e)}function TA(e){return Wt(e)?or(e.pattern):e}function AA(e,t,n,r,s,i){const o=kt(e,{[n.name]:r}),d=V(o,t,s),f=TA(d),u=V(o,t,i);return Tf(f)||Af(f)?{[f.const]:u}:{}}function PA(e,t,n,r,s,i){return r.reduce((o,d)=>[...o,AA(e,t,n,d,s,i)],[])}function NA(e){return e.reduce((t,n)=>[...t,Me(n)],[])}function OA(e,t,n,r,s,i){const o=EA(r),d=PA(e,t,n,o,s,i),f=NA(d);return pn(f)}function Uh(e,t,n,r,s,i,o){return Xe([r])?ke(OA(e,t,n,r,s,i),{},o):Cc(n,r,s,i,o)}function RA(e,t,n,r,s,i,o){const d=V(e,t,r);return Uh(e,t,n,d,s,i,o)}function MA(e,t,n){const r=kt(e,t);return U(t).filter(i=>n.includes(i)).reduce((i,o)=>({...i,[o]:vE(r,o,t[o])}),{})}function $A(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 FA(e,t,n){const r=fE(t),s=MA(e,t,r),i=$A(e,t,r),o={...s,...i};return ke(o,{},n)}function Bh(e,t,n,r){return FA(e,n,r)}function Hh(e,t={}){return Ne("NonNullable",[e],t)}function LA(e,t={}){return qh(e,t)}function DA(e){const t=Je([gl(),yl()]);return Gl(e,t,{})}function qh(e,t){return Xe([e])?ke(DA(e),{},t):Hh(e,t)}function _A(e,t,n,r){const s=V(e,t,n);return qh(s,r)}function zh(e,t,n={}){return Ne("Omit",[e,t],n)}function UA(e,t,n={}){const r=q(t)?Vl(t):t;return Gh(e,r,n)}function Kh(e){const t=Jl(e);return Ue(t)?t.properties:Ft()}function BA(e,t){return U(e).reduce((r,s)=>t.includes(s)?r:{...r,[s]:e[s]},{})}function HA(e,t){const n=Kh(e),r=Yl(t),s=BA(n,r);return Me(s)}function Gh(e,t,n){return Xe([e,t])?ke(HA(e,t),{},n):zh(e,t,n)}function qA(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Gh(i,o,s)}function Vh(e,t={}){return Ne("Parameters",[e],t)}function zA(e,t={}){return Wh(e,t)}function KA(e){const t=yn(e)?e.parameters:[],n=Hi({},_t([],[]),t);return Sn(n)}function Wh(e,t){return Xe([e])?ke(KA(e),{},t):Vh(e,t)}function GA(e,t,n,r){const s=V(e,t,n);return Wh(s,r)}function Jh(e,t={}){return Ne("Partial",[e],t)}function VA(e,t={}){return Qh(e,t)}function WA(e,t){const n=Di(e,t),r=_i(n);return Pi(kt(e,{[t]:r}),t)}function JA(e,t,n){const r=Ls(e,t,n);return _i(r)}function QA(e){const t=pn(e);return _i(t)}function YA(e){const t=e.map(n=>_i(n));return Je(t)}function ZA(e){const t=U(e).reduce((r,s)=>({...r,[s]:Fo(e[s])}),{});return Me(t)}function _i(e){return Gt(e)?WA(e.$defs,e.$ref):wn(e)?JA(e.if,e.then,e.else):Be(e)?QA(e.allOf):fe(e)?YA(e.anyOf):Ue(e)?ZA(e.properties):Me({})}function Qh(e,t){return Xe([e])?ke(_i(e),{},t):Jh(e,t)}function XA(e,t,n,r){const s=V(e,t,n);return Qh(s,r)}function Yh(e,t,n={}){return Ne("Pick",[e,t],n)}function eP(e,t,n={}){const r=q(t)?Vl(t):t;return Zh(e,r,n)}function tP(e,t){return U(e).reduce((r,s)=>t.includes(s)?kt(r,{[s]:e[s]}):r,{})}function nP(e,t){const n=Kh(e),r=Yl(t),s=tP(n,r);return Me(s)}function Zh(e,t,n){return Xe([e,t])?ke(nP(e,t),{},n):Yh(e,t,n)}function rP(e,t,n,r,s){const i=V(e,t,n),o=V(e,t,r);return Zh(i,o,s)}function Xh(e,t={}){return Ne("ReadonlyObject",[e],t)}function eg(e,t={}){return tg(e,t)}const sP=eg;function iP(e){return td(Ir(e))}function oP(e,t){const n=Di(e,t),r=Ui(n);return Pi(kt(e,{[t]:r}),t)}function aP(e,t,n){const r=Ls(e,t,n);return Ui(r)}function cP(e){const t=pn(e);return Ui(t)}function lP(e){const t=U(e).reduce((r,s)=>({...r,[s]:_o(e[s])}),{});return Me(t)}function dP(e){return td(Sn(e))}function uP(e){const t=e.map(n=>Ui(n));return Je(t)}function Ui(e){return gt(e)?iP(e.items):Gt(e)?oP(e.$defs,e.$ref):wn(e)?aP(e.if,e.then,e.else):Be(e)?cP(e.allOf):Ue(e)?lP(e.properties):at(e)?dP(e.items):fe(e)?uP(e.anyOf):e}function tg(e,t){return Xe([e])?ke(Ui(e),{},t):Xh(e)}function pP(e,t,n,r){const s=V(e,t,n);return tg(s,r)}function fP(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 mP(e,t){const n=Di(e,t),r=Bi(n);return Pi(kt(e,{[t]:r}),t)}function hP(e,t,n){const r=Ls(e,t,n);return Bi(r)}function gP(e){const t=pn(e);return Bi(t)}function bP(e){const t=e.map(n=>Bi(n));return Je(t)}function kP(e){const t=U(e).reduce((r,s)=>({...r,[s]:zf(e[s])}),{});return Me(t)}function Bi(e){return Gt(e)?mP(e.$defs,e.$ref):wn(e)?hP(e.if,e.then,e.else):Be(e)?gP(e.allOf):fe(e)?bP(e.anyOf):Ue(e)?kP(e.properties):Me({})}function ng(e,t={}){return Ne("Required",[e],t)}function xP(e,t={}){return rg(e,t)}function rg(e,t){return Xe([e])?ke(Bi(e),{},t):ng(e,t)}function yP(e,t,n,r){const s=V(e,t,n);return rg(s,r)}function sg(e,t={}){return Ne("ReturnType",[e],t)}function wP(e,t={}){return ig(e,t)}function vP(e){return yn(e)?e.returnType:Nt()}function ig(e,t){return Xe([e])?ke(vP(e),{},t):sg(e,t)}function SP(e,t,n,r={}){const s=V(e,t,n);return ig(s,r)}function og(e,t){return Ne("With",[e,t],{})}function ag(e,t){return cg(e,t)}function cg(e,t){return Xe([e])?ke(e,{},t):og(e,t)}function jP(e,t,n,r){const s=V(e,t,n);return cg(s,r)}function IP(e){return pa(e)?at(e.items)?lg(e.items.items):cn(e.items)?[e]:vt(e.items)?[e]:[Nt()]:[e]}function lg(e){return e.reduce((n,r)=>[...n,...IP(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 lg(r)}function Xn(e,t,n){return n.map(r=>V(e,t,r))}function CP(e,t){const n=an(e)?ll(t,{}):t,r=Uo(e)?cl(n,{}):n;return Do(e)?ed(r,{}):r}function EP(e,t,n,r,s){return g(n,"AddImmutable")?PP(e,t,r[0],s):g(n,"RemoveImmutable")?XE(e,t,r[0],s):g(n,"AddReadonly")?Yw(e,t,r[0],s):g(n,"RemoveReadonly")?oS(e,t,r[0],s):g(n,"AddOptional")?Xw(e,t,r[0],s):g(n,"RemoveOptional")?dS(e,t,r[0],s):g(n,"Capitalize")?pT(e,t,r[0],s):g(n,"Conditional")?kT(e,t,r[0],r[1],r[2],r[3],s):g(n,"ConstructorParameters")?wT(e,t,r[0],s):g(n,"Evaluate")?TE(e,t,r[0],s):g(n,"Exclude")?ST(e,t,r[0],r[1],s):g(n,"Extract")?TT(e,t,r[0],r[1],s):g(n,"Index")?cA(e,t,r[0],r[1],s):g(n,"InstanceType")?uA(e,t,r[0],s):g(n,"Interface")?cE(e,t,r[0],r[1],s):g(n,"KeyOf")?wA(e,t,r[0],s):g(n,"Lowercase")?fT(e,t,r[0],s):g(n,"Mapped")?RA(e,t,r[0],r[1],r[2],r[3],s):g(n,"Module")?Bh(e,t,r[0],s):g(n,"NonNullable")?_A(e,t,r[0],s):g(n,"Pick")?rP(e,t,r[0],r[1],s):g(n,"Parameters")?GA(e,t,r[0],s):g(n,"Partial")?XA(e,t,r[0],s):g(n,"Omit")?qA(e,t,r[0],r[1],s):g(n,"ReadonlyObject")?pP(e,t,r[0],s):g(n,"Record")?LS(e,t,r[0],r[1],s):g(n,"Required")?yP(e,t,r[0],s):g(n,"ReturnType")?SP(e,t,r[0],s):g(n,"TemplateLiteral")?n2(e,t,r[0],s):g(n,"Uncapitalize")?mT(e,t,r[0],s):g(n,"Uppercase")?hT(e,t,r[0],s):g(n,"With")?jP(e,t,r[0],r[1]):Ne(n,r,s)}function TP(e,t,n){const r=vt(n)?fP(e,t,n,n.$ref):gt(n)?Ir(V(e,t,n.items),dl(n)):Kl(n)?gh(e,t,n.target,n.arguments):xn(n)?Ei(Xn(e,t,n.parameters),V(e,t,n.instanceType),ev(n)):yn(n)?Ti(Xn(e,t,n.parameters),V(e,t,n.returnType),tv(n)):wn(n)?Lo(V(e,t,n.if),V(e,t,n.then),V(e,t,n.else),av(n)):Be(n)?Bn(Xn(e,t,n.allOf),pv(n)):Ue(n)?Me(Xl(e,t,n.properties),iv(n)):Ot(n)?DS(jn(n),V(e,t,Vt(n))):pa(n)?ua(V(e,t,n.items)):at(n)?Sn(Hi(e,t,n.items),sS(n)):fe(n)?Je(Xn(e,t,n.anyOf),Jv(n)):n;return CP(n,r)}function V(e,t,n){return Ps(n)?EP(e,t,n.action,n.parameters,n.options):TP(e,t,n)}function Bs(e,t){return V(e,_t([],[]),t)}function AP(e){return ke(e,{"~immutable":!0},{})}function ed(e,t){return ke(AP(e),{},t)}function PP(e,t,n,r){const s=V(e,t,n);return ed(s,r)}function NP(e,t={}){return Ne("AddImmutable",[e],t)}function td(e,t={}){return ed(e,t)}function OP(e,t={}){return Ne("Evaluate",[e],t)}function Kn(e,t={}){return fh(e,t)}function RP(e,t={}){return Ne("Module",[e],t)}function MP(e,t={}){return Bh({},_t([],[]),e,t)}function $P(e,t){const n=ga(e,t);return g(n,"right-inside")||g(n,"disjoint")?1:0}function dg(e,t,n=[]){return Te(t,(r,s)=>g($P(e,r),1)?dg(e,s,[...n,r]):[...n,e,...t],()=>[...n,e])}function ug(e,t=[]){return Te(e,(n,r)=>ug(r,dg(n,t)),()=>t)}function FP(e){return ug(e)}function LP(...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=BC(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:If,Call:QE,Capitalize:sT,Codec:fl,Conditional:gT,Constructor:Ei,ConstructorParameters:xT,Cyclic:Pi,Decode:$v,DecodeBuilder:jf,Dependent:Lo,Encode:Fv,EncodeBuilder:Sf,Enum:uv,Evaluate:Kn,Exclude:vT,Extends:sr,ExtendsResult:o2,Extract:jT,Function:Ti,Generic:Ai,Identifier:mc,Immutable:Lv,Index:PT,Infer:pc,InstanceType:lA,Instantiate:Bs,Integer:oa,Interface:lE,Intersect:Bn,IsAny:$n,IsArray:gt,IsBigInt:is,IsBoolean:Cr,IsCall:Kl,IsCodec:ln,IsConstructor:xn,IsCyclic:Gt,IsDependent:wn,IsEnum:vn,IsEnumValue:dv,IsFunction:yn,IsGeneric:ul,IsIdentifier:qv,IsImmutable:Do,IsInfer:cn,IsInteger:qn,IsIntersect:Be,IsKind:Ce,IsLiteral:Qe,IsNever:Fs,IsNull:Ni,IsNumber:un,IsObject:Ue,IsOptional:an,IsParameter:Wv,IsReadonly:Uo,IsRecord:Ot,IsRef:vt,IsRefine:ml,IsRest:pa,IsSchema:on,IsString:Fn,IsSymbol:Oi,IsTemplateLiteral:Wt,IsThis:Zf,IsTuple:at,IsUndefined:_s,IsUnion:fe,IsUnknown:An,IsUnsafe:gf,IsVoid:os,KeyOf:pA,Literal:De,Lowercase:iT,Mapped:vA,Module:MP,Never:Nt,NonNullable:LA,Null:gl,Number:wr,Object:Me,Omit:UA,Optional:rv,Parameter:Ri,Parameters:zA,Partial:VA,Pick:eP,Readonly:Dv,ReadonlyObject:eg,ReadonlyType:sP,Record:xl,RecordKey:da,RecordPattern:jn,RecordValue:Vt,Ref:gn,Refine:Uv,Required:xP,Rest:ua,ReturnType:wP,Script:LP,String:zn,Symbol:bl,TemplateLiteral:i2,This:Yf,Tuple:Sn,Uncapitalize:oT,Undefined:yl,Union:Je,Unknown:Kt,Unsafe:ov,Uppercase:aT,Void:Xf,With:ag},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 DP(e){return E(e,"contentEncoding")&&pe(e.contentEncoding)}function _P(e){return E(e,"contentMediaType")&&pe(e.contentMediaType)}function Ar(e){return E(e,"default")}function UP(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 BP(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 pg(e){return E(e,"$recursiveAnchor")&&xt(e.$recursiveAnchor)}function Eo(e){return pg(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 HP(e){return Vs(e)||Ws(e)||$s(U(e),t=>zo(e[t]))}function qP(e){return $s(e,t=>zo(t))}function zo(e){return q(e)?qP(e):re(e)?HP(e):!1}function fg(e,t){return zo(t)||$s(U(e),n=>zo(e[n]))}class mg{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 hg(){Ko.variables=[]}function gg(){return{...Ko}}function bg(e,t,n,r){const s=hs(n["~refine"].map(i=>i));return Hn(s,G(0),["refinement","_"],Ve(ge("refinement","check"),[r]))}function kg(e,t,n,r){return ht(n["~refine"],0,(s,i)=>s.check(r))}function xg(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 zP=0;function dt(){return`var_${zP++}`}function rd(e){return Nr(e)&&q(e.items)}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)),f=t.AddIndex(i);return Hn(r,G(0),[s,i],Ge(d,Ct(o,f)))}function GP(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 yg(e,t,n,r){return rd(n)?t.UseUnevaluated()?KP(e,t,n,r):GP(e,t,n,r):G(!0)}function wg(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 vg(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 VP(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(VP)),g(t.length,0)?"(?!)":`(${t.join("|")})`}function Sg(e,t,n){return ur(t)&&ms(t)&&!fs(t)&&g(t.additionalProperties,!1)&&g(U(t.properties).length,t.required.length)}function jg(e,t,n){return Zt(ge(Ve(ge("Object","getOwnPropertyNames"),[n]),"length"),G(t.required.length))}function Ig(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 Cg(e,t,n,r){return Sg(t,n)?jg(t,n,r):Ig(e,t,n,r)}function Eg(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 Tg(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)=>lf(`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 WP(e,t,n,r){return no(e,t,n.allOf,r,Zt(ge("results","length"),G(n.allOf.length)))}function JP(e,t,n,r){return Tt(n.allOf.map(s=>ct(e,t,s,r)))}function Ag(e,t,n,r){return t.UseUnevaluated()?WP(e,t,n,r):JP(e,t,n,r)}function Pg(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 Ng(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 QP(e,t,n,r){return no(e,t,n.anyOf,r,of(ge("results","length"),G(0)))}function YP(e,t,n,r){return ol(n.anyOf.map(s=>ct(e,t,s,r)))}function Og(e,t,n,r){return t.UseUnevaluated()?QP(e,t,n,r):YP(e,t,n,r)}function Rg(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 Mg(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 $g(e,t,n,r){return G(!!n)}function id(e,t,n,r){return n}function Fg(e,t,n,r,s,i){return id(e,t,s)||t.AddError({keyword:"boolean",schemaPath:n,instancePath:r,params:{}})}function Lg(e,t,n,r){return Ms(n.const)?Zt(r,G(n.const)):cf(r,hs(n.const))}function od(e,t,n,r){return Ms(n.const)?g(r,n.const):ns(r,n.const)}function Dg(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 _g(e){return!(us(e)&&g(e.minContains,0))}function ZP(e,t,n,r){const[s,i]=[dt(),dt()],o=$t(Zt(ge(r,"length"),G(0))),d=Nw(r,[s,i],Ct(ct(e,t,n.contains,s),t.AddIndex(i)));return Ct(o,d)}function XP(e,t,n,r){const[s]=[dt()],i=$t(Zt(ge(r,"length"),G(0))),o=Pw(r,[s,"_"],ct(e,t,n.contains,s));return Ct(i,o)}function Ug(e,t,n,r){return _g(n)?t.UseUnevaluated()?ZP(e,t,n,r):XP(e,t,n,r):G(!0)}function ad(e,t,n,r){return _g(n)?!g(r.length,0)&&Xp(r,(s,i)=>lt(e,t,n.contains,s)&&t.AddIndex(i)):!0}function Bg(e,t,n,r,s,i){return ad(e,t,s,i)||t.AddError({keyword:"contains",schemaPath:n,instancePath:r,params:{minContains:1}})}function Hg(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 qg(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 zg(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 Kg(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 Gg(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 Vg(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 Wg(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 Jg(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 Qg(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 eN(e,t,n,r){const s=e.DynamicRef(n)??!1;return Js(e,t,s,r)}function tN(e,t,n,r){const s=e.DynamicRef(n)??!1;return _e(s)&&lt(e,t,s,r)}function nN(e,t,n,r,s,i){const o=e.DynamicRef(s)??!1;return _e(o)&&At(e,t,"#",r,o,i)}function Yg(e,t,n,r){return ol(n.enum.map(s=>{if(Ms(s))return Zt(r,G(s));const i=hs(s);return cf(r,i)}))}function cd(e,t,n,r){return $s(n.enum,s=>Ms(s)?g(r,s):ns(r,s))}function Zg(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 Xg(e,t,n,r){return sl(r,G(n.exclusiveMaximum))}function ld(e,t,n,r){return Si(r,n.exclusiveMaximum)}function eb(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 tb(e,t,n,r){return of(r,G(n.exclusiveMinimum))}function dd(e,t,n,r){return ts(r,n.exclusiveMinimum)}function nb(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 rN=[0,31,28,31,30,31,30,31,31,30,31,30,31],sN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function iN(e){return e%4===0&&(e%100!==0||e%400===0)}function ud(e){const t=sN.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&&iN(n)?29:rN[r])}const oN=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function pd(e,t=!0){const n=oN.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 rb(e,t=!0){const n=e.split(/T/i);return n.length===2&&ud(n[0])&&pd(n[1],t)}const aN=/^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 sb(e){return aN.test(e)}const cN=/^(?!.*\.\.)[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 ib(e){return cN.test(e)}const qr=36,To=1,Ec=26,lN=38,dN=700,uN=72,pN=128;function fN(e,t,n){e=n?Math.floor(e/dN):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+lN))}function mN(e){const t=[];let n=pN,r=0,s=uN;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=fN(r-d,m,d===0),n+=Math.floor(r/m),r%=m,t.splice(r,0,n),r++}return globalThis.String.fromCodePoint(...t)}function hN(e){return new RegExp("\\p{Mn}","u").test(String.fromCodePoint(e))}function gN(e){return new RegExp("\\p{Mc}","u").test(String.fromCodePoint(e))}function bN(e){return new RegExp("\\p{Me}","u").test(String.fromCodePoint(e))}function kN(e){return hN(e)||gN(e)||bN(e)}const xN=new Set([1600,2042,12334,12335,12337,12338,12339,12340,12341,12347]),yN=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 wN(e){return new RegExp("\\p{Script=Greek}","u").test(String.fromCodePoint(e))}function vN(e){return new RegExp("\\p{Script=Hebrew}","u").test(String.fromCodePoint(e))}function SN(e){return new RegExp("\\p{Script=Hiragana}","u").test(String.fromCodePoint(e))}function jN(e){return new RegExp("\\p{Script=Katakana}","u").test(String.fromCodePoint(e))}function IN(e){return new RegExp("\\p{Script=Han}","u").test(String.fromCodePoint(e))}function CN(e){return e>=1632&&e<=1641}function EN(e){return e>=1776&&e<=1785}function Hu(e){return yN.has(e)}function ob(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||kN(t[0]))return!1;let r=!1,s=!1,i=!1;for(let o=0;o<n;o++){const d=t[o];if(xN.has(d))return!1;(SN(d)||jN(d)||IN(d))&&(r=!0),CN(d)&&(s=!0),EN(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||!wN(u))return!1;break;case 1523:case 1524:if(f===void 0||!vN(f))return!1;break;case 8204:if(f===void 0||f<128&&!Hu(f))return!1;break;case 8205:if(f===void 0||!Hu(f))return!1;break}}return!(e.includes("・")&&!r||s&&i)}function TN(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 ab(e){return e.toLowerCase().startsWith("xn--")}function cb(e){try{const t=e.slice(4).toLowerCase();if(t.lastIndexOf("-")===0)return!1;const r=mN(t);return r?ob(r):!1}catch{return!1}}function AN(e){return e.length===0||e.length>63?!1:ab(e)?cb(e):ob(e)}function PN(e){return e.length===0||e.length>63?!1:ab(e)?cb(e):TN(e)}function lb(e){if(e.length===0||e.length>253||e.charCodeAt(e.length-1)===46)return!1;for(const t of e.split("."))if(!PN(t))return!1;return!0}const NN=/^(?!.*\.\.)[\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 db(e){return NN.test(e)}function ub(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(!AN(n))return!1;return!0}function pb(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 fb(e){return pb(e,0,e.length)}function ON(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function mb(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&&ON(e.charCodeAt(s));)s++,i++;if(i===0)return!1;const d=e.charCodeAt(s);if(d===46){if(!pb(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 qu(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function hb(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))?qu(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:qu(e)}function gb(e){try{return new URL(e),!0}catch{return!1}}const RN=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function bb(e){return RN.test(e)}const MN=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function kb(e){return MN.test(e)}function xb(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}const $N=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function yb(e){return $N.test(e)}const FN=/^(?!.*[^\x00-\x7F])(?!.*\\)(?:(?:[a-z][a-z0-9+\-.]*:)?(?:\/\/[^\s[\]{}<>^`|]*)?|[^\s[\]{}<>^`|]*)(?:\?[^\s[\]{}<>^`|]*)?(?:#[^\s[\]{}<>^`|]*)?$/i;function wb(e){return FN.test(e)}const LN=/^(?:(?:[^\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 vb(e){return LN.test(e)}function Sb(e){return e>=97&&e<=122||e>=65&&e<=90}function jb(e){return Sb(e)||e>=48&&e<=57}function vo(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function DN(e){return jb(e)||e===43||e===45||e===46}function Tc(e){return jb(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 _N(e){return Tc(e)||Ac(e)||e===58||e===64}function Ib(e){const t=e.length;if(t===0||!Sb(e.charCodeAt(0)))return!1;let n=1;for(;n<t;){const r=e.charCodeAt(n);if(r===58)break;if(!DN(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(!(_N(r)||r===47||r===63||r===35))return!1}n++}return!0}const UN=/^(?: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 Cb(e){return UN.test(e)}const BN=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Eb(e){return BN.test(e)}const ze=new Map;function Tb(){ze.clear()}function HN(){return[...ze.entries()]}function qN(e,t){ze.set(e,t)}function zN(e){return ze.has(e)}function KN(e){return ze.get(e)}function Ab(e,t){var n;return((n=ze.get(e))==null?void 0:n(t))??!0}function Pb(){Tb(),ze.set("date-time",rb),ze.set("date",ud),ze.set("duration",sb),ze.set("email",ib),ze.set("hostname",lb),ze.set("idn-email",db),ze.set("idn-hostname",ub),ze.set("ipv4",fb),ze.set("ipv6",mb),ze.set("iri-reference",hb),ze.set("iri",gb),ze.set("json-pointer-uri-fragment",bb),ze.set("json-pointer",kb),ze.set("regex",xb),ze.set("relative-json-pointer",yb),ze.set("time",pd),ze.set("uri-reference",wb),ze.set("uri-template",vb),ze.set("uri",Ib),ze.set("url",Cb),ze.set("uuid",Eb)}Pb();const GN=Object.freeze(Object.defineProperty({__proto__:null,Clear:Tb,Entries:HN,Get:KN,Has:zN,IsDate:ud,IsDateTime:rb,IsDuration:sb,IsEmail:ib,IsHostname:lb,IsIPv4:fb,IsIPv6:mb,IsIdnEmail:db,IsIdnHostname:ub,IsIri:gb,IsIriReference:hb,IsJsonPointer:kb,IsJsonPointerUriFragment:bb,IsRegex:xb,IsRelativeJsonPointer:yb,IsTime:pd,IsUri:Ib,IsUriReference:wb,IsUriTemplate:vb,IsUrl:Cb,IsUuid:Eb,Reset:Pb,Set:qN,Test:Ab},Symbol.toStringTag,{value:"Module"}));function Nb(e,t,n,r){return Ve(ge("Format","Test"),[G(n.format),r])}function fd(e,t,n,r){return Ab(n.format,r)}function Ob(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 Rb(e,t,n,r){const s=Na(n)?n.then:!0,i=Sa(n)?n.else:!0;return Rw(ct(e,t,n.if,r),ct(e,t,s,r),ct(e,t,i,r))}function Mb(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 $b(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 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}]`),f=t.AddIndex(G(i));return Ge(o,Ct(d,f))}))}function WN(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 JN(e,t,n,r){return t.UseUnevaluated()?VN(e,t,n,r):WN(e,t,n,r)}function QN(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 YN(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 ZN(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 XN(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 eO(e,t,n,r){return t.UseUnevaluated()?ZN(e,t,n,r):XN(e,t,n,r)}function tO(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 nO(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 Fb(e,t,n,r){return Ca(n)?JN(e,t,n,r):eO(e,t,n,r)}function Lb(e,t,n,r){return Ca(n)?QN(e,t,n,r):tO(e,t,n,r)}function Db(e,t,n,r,s,i){return Ca(s)?YN(e,t,n,r,s,i):nO(e,t,n,r,s,i)}function _b(e){return ds(e)}function Ub(e,t,n,r){if(!_b(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(!_b(n))return!0;const s=el(r,i=>lt(e,t,n.contains,i));return ir(s,n.maxContains)}function Bb(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 Hb(e,t,n,r){return rs(r,G(n.maximum))}function hd(e,t,n,r){return ir(r,n.maximum)}function qb(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 zb(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 Kb(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 Gb(e,t,n,r){return Aw(r,G(n.maxLength))}function bd(e,t,n,r){return Yp(r,n.maxLength)}function Vb(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 Wb(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 Jb(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 Qb(e){return ds(e)}function rO(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 sO(e,t,n,r){const[s]=[dt()],i=na(r,[s,"_"],ct(e,t,n.contains,s));return ji(i,G(n.minContains))}function Yb(e,t,n,r){return Qb(n)?t.UseUnevaluated()?rO(e,t,n,r):sO(e,t,n,r):G(!0)}function xd(e,t,n,r){if(!Qb(n))return!0;const s=el(r,(i,o)=>lt(e,t,n.contains,i)&&t.AddIndex(o));return Rs(s,n.minContains)}function Zb(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 Xb(e,t,n,r){return ji(r,G(n.minimum))}function yd(e,t,n,r){return Rs(r,n.minimum)}function ek(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 tk(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 nk(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 rk(e,t,n,r){return Tw(r,G(n.minLength))}function vd(e,t,n,r){return Zp(r,n.minLength)}function sk(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 ik(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 ok(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 ak(e,t,n,r){return Mw(r,G(n.multipleOf))}function jd(e,t,n,r){return Jp(r,n.multipleOf)}function ck(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 iO(e,t,n,r){return no(e,t,[n.not],r,$t(Zt(ge("results","length"),G(1))))}function oO(e,t,n,r){return $t(ct(e,t,n.not,r))}function lk(e,t,n,r){return t.UseUnevaluated()?iO(e,t,n,r):oO(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 dk(e,t,n,r,s,i){return Id(e,t,s,i)||t.AddError({keyword:"not",schemaPath:n,instancePath:r,params:{}})}function aO(e,t,n,r){return no(e,t,n.oneOf,r,Zt(ge("results","length"),G(1)))}function cO(e,t,n,r){const[s]=[dt()],i=Ow(n.oneOf.map(d=>ct(e,t,d,r))),o=na(i,[s,"_"],Zt(s,G(!0)));return Zt(o,G(1))}function uk(e,t,n,r){return t.UseUnevaluated()?aO(e,t,n,r):cO(e,t,n,r)}function pk(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 fk(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 mk(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 hk(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 gk(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(af(r),G(0),[`[${o}, ${d}]`,"_"],h)}))}function bk(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 kk(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 xk(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 yk(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 wk(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 lO(e,t){return uc(ge(e,t))}function vk(e,t){return Fe(e[t])}function Sk(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(lO(r,o),h)});return Tt(i)}function jk(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:vk(r,o)||f})}function Ik(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():vk(i,f)||h()})}function Ck(e,t,n,r){const[s,i]=[dt(),dt()];return Hn(ss(r),G(0),[s,i],ct(e,t,n.propertyNames,s))}function Ek(e,t,n,r){return ht(U(r),0,(s,i)=>lt(e,t,n.propertyNames,s))}function Tk(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 Ak(e,t,n,r){const s=e.RecursiveRef(n)??!1;return Js(e,t,s,r)}function Pk(e,t,n,r){const s=e.RecursiveRef(n)??!1;return _e(s)&&lt(e,t,s,r)}function Nk(e,t,n,r,s,i){const o=e.RecursiveRef(s)??!1;return _e(o)&&At(e,t,"#",r,o,i)}function dO(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"])),lf("result",t.Merge("[nextContext]")),sa("result")]));return Ve(i,["context",r])}function uO(e,t,n,r){return Js(e,t,n,r)}function Ok(e,t,n,r){const s=e.Ref(n)??!1;return t.UseUnevaluated()?dO(e,t,s,r):uO(e,t,s,r)}function Rk(e,t,n,r){const s=e.Ref(n)??!1,i=new Gn,o=_e(s)&&lt(e,i,s,r);return o&&t.Merge([i]),o}function Mk(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 $k(e,t,n,r){return Tt(n.required.map(s=>Vr(r,G(s))))}function Fk(e,t,n,r){return ht(n.required,0,s=>E(r,s))}function Lk(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 Dk(e,t,n,r){return g(n,"object")?nf(r):g(n,"array")?$o(r):g(n,"boolean")?vw(r):g(n,"integer")?Sw(r):g(n,"number")?tf(r):g(n,"null")?jw(r):g(n,"string")?sf(r):g(n,"bigint")?ef(r):g(n,"constructor")?Ew(r):g(n,"function")?Cw(r):g(n,"symbol")?Iw(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 pO(e,t,n,r){return ol(n.map(s=>Dk(e,t,s,r)))}function _k(e,t,n,r,s){return $s(n,i=>Td(e,t,i,r,s))}function Uk(e,t,n,r){return q(n.type)?pO(e,t,n.type,r):Dk(e,t,n.type,r)}function Bk(e,t,n,r){return q(n.type)?_k(e,t,n.type,n,r):Td(e,t,n.type,n,r)}function Hk(e,t,n,r,s,i){return(q(s.type)?_k(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 qk(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 zk(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 Kk(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 Gk(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(af(r),G(0),[`[${s}, ${i}]`,"_"],Ge(d,Ct(u,f)));return Ve(xr(["context"],ra([tr("keys",o),sa(m)])),["context"])}function Vk(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 Wk(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 Jk(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 Qk(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 Yk(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 fO(e){return yi(e,"object")}function mO(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 hO(e){return yi(e,"array")}function gO(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 bO(e){return yi(e,"string")}function kO(e){return dn(e)&&(zs(e)||Yi(e)||Hs(e)||Gs(e))}function xO(e){return yi(e,"number")||yi(e,"bigint")}function yO(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 $g(e,t,n);if(to(n)&&s.push(Uk(e,t,n,r)),mO(n)){const o=[];ur(n)&&o.push($k(e,t,n,r)),lr(n)&&o.push(Cg(e,t,n,r)),Ki(n)&&o.push(Hg(e,t,n,r)),Gi(n)&&o.push(Kg(e,t,n,r)),Vi(n)&&o.push(Wg(e,t,n,r)),fs(n)&&o.push(gk(e,t,n,r)),ms(n)&&o.push(Sk(e,t,n,r)),eo(n)&&o.push(Ck(e,t,n,r)),Ks(n)&&o.push(ik(e,t,n,r)),Zi(n)&&o.push(Wb(e,t,n,r));const d=Tt(o),f=Ge($t(nf(r)),d);s.push(fO(n)?d:f)}if(gO(n)){const o=[];zi(n)&&o.push(yg(e,t,n,r)),ds(n)&&o.push(Ug(e,t,n,r)),Nr(n)&&o.push(Fb(e,t,n,r)),Qi(n)&&o.push(Ub(e,t,n,r)),qs(n)&&o.push(zb(e,t,n,r)),us(n)&&o.push(Yb(e,t,n,r)),ps(n)&&o.push(tk(e,t,n,r)),dr(n)&&o.push(xk(e,t,n,r)),jr(n)&&o.push(Jk(e,t,n,r));const d=Tt(o),f=Ge($t($o(r)),d);s.push(hO(n)?d:f)}if(kO(n)){const o=[];Yi(n)&&o.push(Gb(e,t,n,r)),zs(n)&&o.push(rk(e,t,n,r)),Hs(n)&&o.push(Nb(e,t,n,r)),Gs(n)&&o.push(mk(e,t,n,r));const d=Tt(o),f=Ge($t(sf(r)),d);s.push(bO(n)?d:f)}if(yO(n)){const o=[];Wi(n)&&o.push(Xg(e,t,n,r)),Pr(n)&&o.push(tb(e,t,n,r)),Ji(n)&&o.push(Hb(e,t,n,r)),Or(n)&&o.push(Xb(e,t,n,r)),Xi(n)&&o.push(ak(e,t,n,r));const d=Tt(o),f=Ge($t(Ge(tf(r),ef(r))),d);s.push(xO(n)?d:f)}Pa(n)&&s.push(Ok(e,t,n,r)),Aa(n)&&s.push(Ak(e,t,n,r)),va(n)&&s.push(eN(e,t,n,r)),wa(n)&&s.push(Lg(e,t,n,r)),ja(n)&&s.push(Yg(e,t,n,r)),Ia(n)&&s.push(Rb(e,t,n,r)),Ea(n)&&s.push(lk(e,t,n,r)),xa(n)&&s.push(Ag(e,t,n,r)),ya(n)&&s.push(Og(e,t,n,r)),Ta(n)&&s.push(uk(e,t,n,r)),Vs(n)&&s.push(Ge($t($o(r)),qk(e,t,n,r))),Ws(n)&&s.push(Ge($t(rf(r)),Gk(e,t,n,r))),ka(n)&&s.push(bg(e,t,n,r));const i=Tt(s);return e.Pop(n),i}function Rr(e,t,n,r){return t.Push()&&lt(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)||Bk(e,t,n,r))&&(!(re(r)&&!q(r))||(!ur(n)||Fk(e,t,n,r))&&(!lr(n)||Eg(e,t,n,r))&&(!Ki(n)||qg(e,t,n,r))&&(!Gi(n)||Gg(e,t,n,r))&&(!Vi(n)||Jg(e,t,n,r))&&(!fs(n)||bk(e,t,n,r))&&(!ms(n)||jk(e,t,n,r))&&(!eo(n)||Ek(e,t,n,r))&&(!Ks(n)||Sd(e,t,n,r))&&(!Zi(n)||kd(e,t,n,r)))&&(!q(r)||(!zi(n)||wg(e,t,n,r))&&(!ds(n)||ad(e,t,n,r))&&(!Nr(n)||Lb(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)||yk(e,t,n,r))&&(!jr(n)||Qk(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)||Rk(e,t,n,r))&&(!Aa(n)||Pk(e,t,n,r))&&(!va(n)||tN(e,t,n,r))&&(!wa(n)||od(e,t,n,r))&&(!ja(n)||cd(e,t,n,r))&&(!Ia(n)||Mb(e,t,n,r))&&(!Ea(n)||Id(e,t,n,r))&&(!xa(n)||Pg(e,t,n,r))&&(!ya(n)||Rg(e,t,n,r))&&(!Ta(n)||pk(e,t,n,r))&&(!Vs(n)||!q(r)||zk(e,t,n,r))&&(!Ws(n)||!re(r)||Vk(e,t,n,r))&&(!ka(n)||kg(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)?Fg(e,t,n,r,s):!!(+(!to(s)||Hk(e,t,n,r,s,i))&+(!(re(i)&&!q(i))||!!(+(!ur(s)||Lk(e,t,n,r,s,i))&+(!lr(s)||Tg(e,t,n,r,s,i))&+(!Ki(s)||zg(e,t,n,r,s,i))&+(!Gi(s)||Vg(e,t,n,r,s,i))&+(!Vi(s)||Qg(e,t,n,r,s,i))&+(!fs(s)||kk(e,t,n,r,s,i))&+(!ms(s)||Ik(e,t,n,r,s,i))&+(!eo(s)||Tk(e,t,n,r,s,i))&+(!Ks(s)||ok(e,t,n,r,s,i))&+(!Zi(s)||Jb(e,t,n,r,s,i))))&+(!q(i)||!!(+(!zi(s)||vg(e,t,n,r,s,i))&+(!ds(s)||Bg(e,t,n,r,s,i))&+(!Nr(s)||Db(e,t,n,r,s,i))&+(!Qi(s)||Bb(e,t,n,r,s,i))&+(!qs(s)||Kb(e,t,n,r,s,i))&+(!us(s)||Zb(e,t,n,r,s,i))&+(!ps(s)||nk(e,t,n,r,s,i))&+(!dr(s)||wk(e,t,n,r,s,i))&+(!jr(s)||Yk(e,t,n,r,s,i))))&+(!pe(i)||!!(+(!Yi(s)||Vb(e,t,n,r,s,i))&+(!zs(s)||sk(e,t,n,r,s,i))&+(!Hs(s)||Ob(e,t,n,r,s,i))&+(!Gs(s)||hk(e,t,n,r,s,i))))&+(!(Ie(i)||st(i))||!!(+(!Wi(s)||eb(e,t,n,r,s,i))&+(!Pr(s)||nb(e,t,n,r,s,i))&+(!Ji(s)||qb(e,t,n,r,s,i))&+(!Or(s)||ek(e,t,n,r,s,i))&+(!Xi(s)||ck(e,t,n,r,s,i))))&+(!Pa(s)||Mk(e,t,n,r,s,i))&+(!Aa(s)||Nk(e,t,n,r,s,i))&+(!va(s)||nN(e,t,n,r,s,i))&+(!wa(s)||Dg(e,t,n,r,s,i))&+(!ja(s)||Zg(e,t,n,r,s,i))&+(!Ia(s)||$b(e,t,n,r,s,i))&+(!Ea(s)||dk(e,t,n,r,s,i))&+(!xa(s)||Ng(e,t,n,r,s,i))&+(!ya(s)||Mg(e,t,n,r,s,i))&+(!Ta(s)||fk(e,t,n,r,s,i))&+(!Vs(s)||!q(i)||Kk(e,t,n,r,s,i))&+(!Ws(s)||!re(i)||Wk(e,t,n,r,s,i)))&&(!ka(s)||xg(e,t,n,r,s,i));return e.Pop(s),o}const Zk=[0],Ao=new Map,fi=new Map;function wO(){return`${Zk[0]++}`}function vO(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=wO();return n.set(t,r),r}function SO(e,t,n,r){return e.UseUnevaluated()?Ve(`check_${n}`,["context",r]):Ve(`check_${n}`,[r])}function jO(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 Xk(){Zk[0]=0,Ao.clear(),fi.clear()}function ex(){return[...fi.values()]}function Js(e,t,n,r){const s=vO(n,e.BaseURL().href),i=SO(t,n,s,r);return fi.has(s)||(fi.set(s,""),fi.set(s,jO(e,t,n,s))),i}function tx(e){if(e.length===0)throw Error("Cannot set root")}function nx(e){if(!re(e))throw Error("Cannot set value")}function IO(e){if(er(e))throw Error("Pointer contains unsafe property key")}function rx(e){for(const t of e)IO(t)}function CO(e){return/^(0|[1-9]\d*)$/.test(e)}function sx(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function EO(e,t){return re(t)&&E(t,e)}function TO(e,t){return re(t)&&!er(e)?t[e]:void 0}function Pd(e,t){return e.reduce((n,r)=>TO(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 AO(e,t){let n=e;return ro(t).every(r=>EO(r,n)?(n=n[r],!0):!1)}function ix(e,t){const n=ro(t);return Pd(n,e)}function Pc(e,t,n){const r=ro(t);tx(r),rx(r);const[s,i]=sx(r),o=Pd(s,e);return nx(o),o[i]=n,e}function ox(e,t){const n=ro(t);tx(n),rx(n);const[r,s]=sx(n),i=Pd(r,e);return nx(i),q(i)&&CO(s)?i.splice(+s,1):delete i[s],e}const ax=Object.freeze(Object.defineProperty({__proto__:null,Delete:ox,Get:ix,Has:AO,Indices:ro,Set:Pc},Symbol.toStringTag,{value:"Module"}));function PO(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("#")?cx(e,t,n):e}function NO(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 OO(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 cx(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 ix(e,r)}function RO(e,t,n){if(Sr(e)){const r=PO(e,t,n);if(!Fe(r))return r}if(qo(e)){const r=NO(e,t,n);if(!Fe(r))return r}if(Yr(e)){const r=OO(e,t,n);if(!Fe(r))return r}return cx(e,t,n)}function MO(e,t,n){return e.reduce((r,s)=>{const i=Nd(s,t,n);return Fe(i)?r:i},void 0)}function $O(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=RO(e,r,n);if(!Fe(s))return s}if(q(e))return MO(e,r,n);if(re(e))return $O(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 lx(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 FO=Object.freeze(Object.defineProperty({__proto__:null,DynamicRef:lx,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,dx,ux,px,fx;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",dx).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",ux).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",px).call(this,t)??Ts(this,br,"m",fx).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 lx(n,this.Base(),t,this.dynamicAnchors)}}br=new WeakSet,dx=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)}},ux=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)}},px=function(t){return E(this.context,t.$ref)?this.context[t.$ref]:void 0},fx=function(t){const n=this.schema;return t.$ref.startsWith("#")?Zr(this.Base(),t.$ref):Zr(n,t.$ref)};function LO(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 DO(e,t){return kf("CheckContext","Guard","Format","Hashing",e.External().identifier,t)(Gn,Mo,GN,Nv,e.External().variables)}function _O(e){const t=new so(e.Context(),e.Schema()),n=new Gn;return r=>lt(t,n,e.Schema(),r)}function UO(e,t){return bf()?DO(e,t):_O(e)}class mx{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 hx{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=LO(this),n=UO(this,t);return new mx(bf(),t,n)}}function gx(...e){const[t,n]=ut(e,{2:(f,u)=>[f,u],1:f=>[{},f]});hg(),Xk();const r=new so(t,n),s=new mg(fg(t,n)),i=Js(r,s,n,"value"),o=ex(),d=gg();return new hx(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=Mv(),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 BO(...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 bx{constructor(t,n){this.buildResult=gx(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 HO(...e){const[t,n]=ut(e,{2:(r,s)=>[r,s],1:r=>[{},r]});return new bx(t,n)}const qO=Object.freeze(Object.defineProperty({__proto__:null,AccumulatedErrorContext:Vn,Build:gx,BuildAdditionalItems:yg,BuildAdditionalProperties:Cg,BuildAdditionalPropertiesFast:jg,BuildAdditionalPropertiesStandard:Ig,BuildAllOf:Ag,BuildAnyOf:Og,BuildConst:Lg,BuildContains:Ug,BuildContext:mg,BuildDependencies:Hg,BuildDependentRequired:Kg,BuildDependentSchemas:Wg,BuildEnum:Yg,BuildExclusiveMaximum:Xg,BuildExclusiveMinimum:tb,BuildFormat:Nb,BuildIf:Rb,BuildItems:Fb,BuildMaxContains:Ub,BuildMaxItems:zb,BuildMaxLength:Gb,BuildMaxProperties:Wb,BuildMaximum:Hb,BuildMinContains:Yb,BuildMinItems:tk,BuildMinLength:rk,BuildMinProperties:ik,BuildMinimum:Xb,BuildMultipleOf:ak,BuildNot:lk,BuildOneOf:uk,BuildPattern:mk,BuildPatternProperties:gk,BuildPrefixItems:xk,BuildProperties:Sk,BuildPropertyNames:Ck,BuildRecursiveRef:Ak,BuildRef:Ok,BuildRefine:bg,BuildRequired:$k,BuildResult:hx,BuildSchema:ct,BuildSchemaBoolean:$g,BuildSchemaPushStack:Ln,BuildType:Uk,BuildUnevaluatedItems:qk,BuildUnevaluatedProperties:Gk,BuildUniqueItems:Jk,CanAdditionalPropertiesFast:Sg,Check:Od,CheckAdditionalItems:wg,CheckAdditionalProperties:Eg,CheckAllOf:Pg,CheckAnyOf:Rg,CheckConst:od,CheckContains:ad,CheckContext:Gn,CheckDependencies:qg,CheckDependentRequired:Gg,CheckDependentSchemas:Jg,CheckEnum:cd,CheckExclusiveMaximum:ld,CheckExclusiveMinimum:dd,CheckFormat:fd,CheckIf:Mb,CheckItems:Lb,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:pk,CheckPattern:Cd,CheckPatternProperties:bk,CheckPrefixItems:yk,CheckProperties:jk,CheckPropertyNames:Ek,CheckRecursiveRef:Pk,CheckRef:Rk,CheckRefine:kg,CheckRequired:Fk,CheckSchema:lt,CheckSchemaBoolean:id,CheckSchemaPushStack:Rr,CheckType:Bk,CheckUnevaluatedItems:zk,CheckUnevaluatedProperties:Vk,CheckUniqueItems:Qk,Compile:HO,CreateFunction:Js,CreateVariable:hs,ErrorAdditionalItems:vg,ErrorAdditionalProperties:Tg,ErrorAllOf:Ng,ErrorAnyOf:Mg,ErrorConst:Dg,ErrorContains:Bg,ErrorContext:nd,ErrorDependencies:zg,ErrorDependentRequired:Vg,ErrorDependentSchemas:Qg,ErrorEnum:Zg,ErrorExclusiveMaximum:eb,ErrorExclusiveMinimum:nb,ErrorFormat:Ob,ErrorIf:$b,ErrorItems:Db,ErrorMaxContains:Bb,ErrorMaxItems:Kb,ErrorMaxLength:Vb,ErrorMaxProperties:Jb,ErrorMaximum:qb,ErrorMinContains:Zb,ErrorMinItems:nk,ErrorMinLength:sk,ErrorMinProperties:ok,ErrorMinimum:ek,ErrorMultipleOf:ck,ErrorNot:dk,ErrorOneOf:fk,ErrorPattern:hk,ErrorPatternProperties:kk,ErrorPrefixItems:wk,ErrorProperties:Ik,ErrorPropertyNames:Tk,ErrorRecursiveRef:Nk,ErrorRef:Mk,ErrorRefine:xg,ErrorRequired:Lk,ErrorSchema:At,ErrorSchemaBoolean:Fg,ErrorSchemaPushStack:Mr,ErrorType:Hk,ErrorUnevaluatedItems:Kk,ErrorUnevaluatedProperties:Wk,ErrorUniqueItems:Yk,Errors:wi,EvaluateResult:mx,GetExternal:gg,GetFunctions:ex,HasUnevaluated:fg,IsAdditionalItems:zi,IsAdditionalProperties:lr,IsAllOf:xa,IsAnchor:qo,IsAnyOf:ya,IsConst:wa,IsContains:ds,IsContentEncoding:DP,IsContentMediaType:_P,IsDefault:Ar,IsDefs:UP,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:BP,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:pg,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:BO,ParseError:Rd,Pointer:ax,Reducer:no,ResetExternal:hg,ResetFunctions:Xk,Resolve:FO,Stack:so,Validator:bx},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 kx(...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 zO(e,t,n){return q(n)?n.map(r=>Nn(e,t.items,r)):n}function KO(e,t,n){return Nn({...e,...t.$defs},gn(t.$ref),n)}function GO(e,t){const n=E(t,"unevaluatedProperties")?{additionalProperties:t.unevaluatedProperties}:{},r=Bs(e,t),s=Kn(r);return Ue(s)?ag(s,n):s}function VO(e,t,n){const r=GO(e,t);return Nn(e,r,n)}function xx(e){return E(e,"additionalProperties")?e.additionalProperties:void 0}function WO(e,t,n){if(!re(n)||q(n))return n;const r=xx(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 JO(e,t,n){if(!re(n))return n;const r=xx(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 QO(e,t,n){return E(e,t.$ref)?Nn(e,e[t.$ref],n):n}function YO(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 ZO(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)?zO(e,t,n):Gt(t)?KO(e,t,n):Be(t)?VO(e,t,n):Ue(t)?WO(e,t,n):Ot(t)?JO(e,t,n):vt(t)?QO(e,t,n):at(t)?YO(e,t,n):fe(t)?ZO(e,t,n):n}function XO(e,t){for(const n of Mo.Keys(e))Mo.HasPropertyKey(t,n)||(t[n]=e[n]);return t}function eR(e){const t={};for(const n of Mo.Keys(e))t[n]=vi(e[n]);return t}function tR(e){return Nc(FP(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(tR(e.anyOf)):Ue(e)?Me(eR(e.properties)):Ot(e)?xl(da(e),vi(Vt(e))):at(e)?Sn(Nc(e.items)):e;return XO(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 nR(e){return q(e)?ne(e):ne([e])}function rR(e){return g(e,!0)?ne(BigInt(1)):ne(BigInt(0))}const sR=/^-?(0|[1-9]\d*)n$/,iR=/^-?(0|[1-9]\d*)\.\d+$/,oR=/^-?(0|[1-9]\d*)$/;function aR(e){return sR.test(e)}function cR(e){return iR.test(e)}function lR(e){return oR.test(e)}function dR(e){const t=e.toLowerCase();return aR(e)?ne(BigInt(e.slice(0,e.length-1))):cR(e)?ne(BigInt(e.split(".")[0])):lR(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)?rR(e):Ie(e)?ne(BigInt(Math.trunc(e))):Xt(e)?ne(BigInt(0)):pe(e)?dR(e):Fe(e)?ne(BigInt(0)):void 0}function uR(e){return g(e,BigInt(0))?ne(!1):g(e,BigInt(1))?ne(!0):void 0}function pR(e){return g(e,0)?ne(!1):g(e,1)?ne(!0):void 0}function fR(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 yx(e){return st(e)?uR(e):xt(e)?ne(e):Ie(e)?pR(e):Xt(e)?ne(!1):pe(e)?fR(e):Fe(e)?ne(!1):void 0}function mR(e){return g(e,BigInt(0))?ne(null):void 0}function hR(e){return g(e,!1)?ne(null):void 0}function gR(e){return g(e,0)?ne(null):void 0}function bR(e){const t=e.toLowerCase();return g(t,"undefined")||g(t,"null")||g(e,"")||g(e,"0")?ne(null):void 0}function kR(e){return st(e)?mR(e):xt(e)?hR(e):Ie(e)?gR(e):Xt(e)?ne(null):pe(e)?bR(e):Fe(e)?ne(null):void 0}const wx=BigInt(Number.MAX_SAFE_INTEGER),vx=BigInt(Number.MIN_SAFE_INTEGER);function xR(e){return e<=wx&&e>=vx?ne(Number(e)):void 0}function yR(e){return ne(e?1:0)}function wR(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<=wx&&r.value>=vx?ne(Number(r.value)):void 0}function Fd(e){return st(e)?xR(e):xt(e)?yR(e):Ie(e)?ne(e):Xt(e)?ne(0):pe(e)?wR(e):Fe(e)?ne(0):void 0}function Sx(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 vR(e){return g(e,BigInt(0))?ne(void 0):void 0}function SR(e){return g(e,!1)?ne(void 0):void 0}function jR(e){return g(e,0)?ne(void 0):void 0}function IR(e){const t=e.toLowerCase();return g(t,"undefined")||g(t,"null")||g(e,"")||g(e,"0")?ne(void 0):void 0}function jx(e){return st(e)?vR(e):xt(e)?SR(e):Ie(e)?jR(e):Xt(e)?ne(void 0):pe(e)?IR(e):Fe(e)?ne(e):void 0}function CR(e,t,n){return nR(n).value.map(s=>In(e,t.items,s))}function ER(e,t,n){const r=$d(n);return fn(r)?r.value:n}function TR(e,t,n){const r=yx(n);return fn(r)?r.value:n}function AR(e,t,n){return In({...e,...t.$defs},gn(t.$ref),n)}function PR(e,t,n){return In(e,Kn(t),n)}function NR(e,t,n){const r=Fd(n);return fn(r)?Math.trunc(r.value):n}function OR(e,t,n){const r=Bs(e,t),s=Kn(r);return In(e,s,n)}function RR(e,t,n){const r=$d(n);return fn(r)&&g(t.const,r.value)?r.value:n}function MR(e,t,n){const r=yx(n);return fn(r)&&g(t.const,r.value)?r.value:n}function $R(e,t,n){const r=Fd(n);return fn(r)&&g(t.const,r.value)?r.value:n}function FR(e,t,n){const r=Sx(n);return fn(r)&&g(t.const,r.value)?r.value:n}function LR(e,t,n){return g(t.const,n)?n:Gv(t)?RR(e,t,n):Vv(t)?MR(e,t,n):Tf(t)?$R(e,t,n):Af(t)?FR(e,t,n):Ft()}function DR(e,t,n){const r=kR(n);return fn(r)?r.value:n}function _R(e,t,n){const r=Fd(n);return fn(r)?r.value:n}function Ix(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 UR(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)?Ix(e,r,t.additionalProperties,n):n}function BR(e,t,n){return kn(n)?UR(e,t,n):n}function HR(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)?Ix(e,r,t.additionalProperties,n):n}function qR(e,t,n){return kn(n)?HR(e,t,n):n}function zR(e,t,n){return E(e,t.$ref)?In(e,e[t.$ref],n):n}function KR(e,t,n){const r=Sx(n);return fn(r)?r.value:n}function GR(e,t,n){return In(e,Kn(t),n)}function VR(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 WR(e,t,n){const r=jx(n);return fn(r)?r.value:n}function JR(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 QR(e,t,n){const r=jx(n);return fn(r)?void 0:n}function In(e,t,n){return gt(t)?CR(e,t,n):is(t)?ER(e,t,n):Cr(t)?TR(e,t,n):Gt(t)?AR(e,t,n):vn(t)?PR(e,t,n):qn(t)?NR(e,t,n):Be(t)?OR(e,t,n):Qe(t)?LR(e,t,n):Ni(t)?DR(e,t,n):un(t)?_R(e,t,n):Ue(t)?BR(e,t,n):Ot(t)?qR(e,t,n):vt(t)?zR(e,t,n):Fn(t)?KR(e,t,n):Wt(t)?GR(e,t,n):at(t)?VR(e,t,n):_s(t)?WR(e,t,n):fe(t)?JR(e,t,n):os(t)?QR(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 YR(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 ZR(e,t,n){return On({...e,...t.$defs},gn(t.$ref),n)}function XR(e,t){return Fe(t)?Tn(e.default)?e.default():zt(e.default):t}function eM(e,t,n){const r=Bs(e,t),s=Kn(r);return On(e,s,n)}function tM(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 nM(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 rM(e,t,n){return E(e,t.$ref)?On(e,e[t.$ref],n):n}function sM(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 iM(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)?XR(t,n):n;return gt(t)?YR(e,t,r):Gt(t)?ZR(e,t,r):Be(t)?eM(e,t,r):Ue(t)?tM(e,t,r):Ot(t)?nM(e,t,r):vt(t)?rM(e,t,r):at(t)?sM(e,t,r):fe(t)?iM(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 Cx(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 oM(e,t,n){return t["~codec"].decode(n)}function aM(e,t,n){return t["~codec"].encode(n)}function Et(e,t,n,r){return ln(n)?g(e,"Decode")?oM(t,n,r):aM(t,n,r):r}function cM(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 lM(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 dM(e,t,n,r){return g(e,"Decode")?cM(e,t,n,r):lM(e,t,n,r)}function uM(e,t,n,r){return r=Bt(e,{...t,...n.$defs},gn(n.$ref),r),Et(e,t,n,r)}function Ex(e){return e.reduce((t,n)=>({...t,...n}),{})}function Tx(e,t){for(const n of t)if(!ns(e,n))return n;return e}function pM(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))?Ex(s):Tx(r,s);return Et(e,t,n,o)}function fM(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))?Ex(i):Tx(s,i)}function mM(e,t,n,r){return g(e,"Decode")?pM(e,t,n,r):fM(e,t,n,r)}function hM(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 gM(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 bM(e,t,n,r){return g(e,"Decode")?hM(e,t,n,r):gM(e,t,n,r)}function kM(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 xM(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 yM(e,t,n,r){return g(e,"Decode")?kM(e,t,n,r):xM(e,t,n,r)}function zu(e,t,n,r){return E(t,n.$ref)?Bt(e,t,t[n.$ref],r):r}function wM(e,t,n,r){return g(e,"Decode")?Et(e,t,n,zu(e,t,n,r)):zu(e,t,n,Et(e,t,n,r))}function vM(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 SM(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 jM(e,t,n,r){return g(e,"Decode")?vM(e,t,n,r):SM(e,t,n,r)}function IM(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 CM(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 EM(e,t,n,r){return g(e,"Decode")?IM(e,t,n,r):CM(e,t,n,r)}function Bt(e,t,n,r){return gt(n)?dM(e,t,n,r):Gt(n)?uM(e,t,n,r):Be(n)?mM(e,t,n,r):Ue(n)?bM(e,t,n,r):Ot(n)?yM(e,t,n,r):vt(n)?wM(e,t,n,r):at(n)?jM(e,t,n,r):fe(n)?EM(e,t,n,r):Et(e,t,n,r)}class TM extends Oa{constructor(t,n){super("Decode",t,n)}}function AM(e,t,n){if(!ot(e,t,n))throw new TM(n,io(e,t,n));return n}function PM(e,t,n){const r=Md(t);return Bt("Decode",e,r,n)}const NM=Cx([(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)=>AM(e,t,n),(e,t,n)=>PM(e,t,n)]);function OM(...e){const[t,n,r]=ut(e,{3:(s,i,o)=>[s,i,o],2:(s,i)=>[{},s,i]});return NM(t,n,r)}class RM extends Oa{constructor(t,n){super("Encode",t,n)}}function MM(e,t,n){if(!ot(e,t,n))throw new RM(n,io(e,t,n));return n}function $M(e,t,n){const r=Md(t);return Bt("Encode",e,r,n)}const FM=Cx([(e,t,n)=>zt(n),(e,t,n)=>$M(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)=>MM(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)}function DM(e,t){return ln(t)||$r(e,t.items)}function _M(e,t){return ln(t)||Ax({...e,...t.$defs},gn(t.$ref))}function UM(e,t){return ln(t)||t.allOf.some(n=>$r(e,n))}function BM(e,t){return ln(t)||U(t.properties).some(n=>$r(e,t.properties[n]))}function HM(e,t){return ln(t)||$r(e,Vt(t))}function Ax(e,t){return Oc.has(t.$ref)?!1:(Oc.add(t.$ref),ln(t)||E(e,t.$ref)&&$r(e,e[t.$ref]))}function qM(e,t){return ln(t)||t.items.some(n=>$r(e,n))}function zM(e,t){return ln(t)||t.anyOf.some(n=>$r(e,n))}function $r(e,t){return gt(t)?DM(e,t):Gt(t)?_M(e,t):Be(t)?UM(e,t):Ue(t)?BM(e,t):Ot(t)?HM(e,t):vt(t)?Ax(e,t):at(t)?qM(e,t):fe(t)?zM(e,t):ln(t)}const Oc=new Set;function KM(...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 GM(e,t){return Tn(t.default)?t.default(t):re(t.default)?zt(t.default):t.default}function VM(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 WM(e,t){return Pr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):Or(t)?BigInt(t.minimum):BigInt(0)}function JM(e,t){return!1}function QM(e,t){const n=Cn(e,t.instanceType);return class{constructor(){Object.assign(this,n)}}}function YM(e,t){return Cn({...e,...t.$defs},gn(t.$ref))}function ZM(e,t){return Cn(e,Kn(t))}function XM(e,t){const n=Cn(e,t.returnType);return()=>n}function e$(e,t){return Pr(t)&&Ie(t.exclusiveMinimum)?t.exclusiveMinimum+1:Or(t)?t.minimum:0}function t$(e,t){const n=Bs(e,t),r=Kn(n);return Cn(e,r)}function n$(e,t){return t.const}function r$(e,t){throw new ao(t,"Cannot create TNever types")}function s$(e,t){return null}function i$(e,t){return Pr(t)&&Ie(t.exclusiveMinimum)?t.exclusiveMinimum+1:Or(t)?t.minimum:0}function o$(e,t){return(Fe(t.required)?[]:t.required).reduce((r,s)=>({...r,[s]:Cn(e,t.properties[s])}),{})}function a$(e,t){if(Ks(t)&&!Ar(t))throw new ao(t,"Record with the minProperties constraint must have a default annotation");return{}}function c$(e,t){return E(e,t.$ref)?Cn(e,e[t.$ref]):(()=>{throw new ao(t,"Unable to deref Ref")})()}function l$(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 d$(e,t){return Symbol()}function u$(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 p$(e,t){return Array.from({length:t.minItems},(n,r)=>Cn(e,t.items[r]))}function f$(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)?GM(e,t):gt(t)?VM(e,t):is(t)?WM(e,t):Cr(t)?JM():xn(t)?QM(e,t):Gt(t)?YM(e,t):vn(t)?ZM(e,t):yn(t)?XM(e,t):qn(t)?e$(e,t):Be(t)?t$(e,t):Qe(t)?n$(e,t):Fs(t)?r$(e,t):Ni(t)?s$():un(t)?i$(e,t):Ue(t)?o$(e,t):Ot(t)?a$(e,t):vt(t)?c$(e,t):Fn(t)?l$(e,t):Oi(t)?d$():Wt(t)?u$(e,t):at(t)?p$(e,t):_s(t)?void 0:fe(t)?f$(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 Px(e,t){return ns(e,t)}function Nx(e){return ia(e)}class m$ extends Oa{constructor(t,n){super("Parse",t,n)}}function h$(...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 m$(r,io(t,n,r))}function Ma(e,t){return{type:"update",path:e,value:t}}function Ox(e,t){return{type:"insert",path:e,value:t}}function Rx(e){return{type:"delete",path:e}}function Ku(e){if(!(re(e)&&g(nl(e).length,0)))throw new Error("Cannot create diffs for objects with symbols keys")}function*g$(e,t,n){if(!re(n)||q(n))return yield Ma(e,n);Ku(t),Ku(n);const r=U(t),s=U(n);for(const i of s)E(t,i)||er(i)||(yield Ox(`${e}/${i}`,n[i]));for(const i of r)E(n,i)&&(er(i)||Px(t,n)||(yield*$a(`${e}/${i}`,t[i],n[i])));for(const i of r)E(n,i)||er(i)||(yield Rx(`${e}/${i}`))}function*b$(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 Ox(`${e}/${r}`,n[r]));for(let r=t.length-1;r>=0;r--)r<n.length||(yield Rx(`${e}/${r}`))}function*k$(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*x$(e,t,n){t!==n&&(yield Ma(e,n))}function*$a(e,t,n){return Ii(t)?yield*k$(e,t,n):q(t)?yield*b$(e,t,n):re(t)?yield*g$(e,t,n):yield*x$(e,t,n)}function y$(e,t){return[...$a("",e,t)]}const w$=Me({type:De("insert"),path:zn(),value:Kt()}),v$=Object({type:De("update"),path:zn(),value:Kt()}),S$=Me({type:De("delete"),path:zn()});Je([w$,v$,S$]);function j$(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function I$(e){return e.length===0}function C$(e,t){if(j$(t))return zt(t[0].value);if(I$(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":{ox(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 E$(e){const[t,n]=[new Set,[]];for(const r of e){const s=Nx(r);t.has(s)||(t.add(s),n.push(r))}return n}function T$(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=E$(o);if(!ot(e,t,d))throw new Fa(e,t,n,"Failed to repair Array due to uniqueItems constraint");return d}function A$(e,t,n){return bn(e,Kn(t),n)}function P$(e,t,n){const r=Bs(e,t),s=Kn(r);return bn(e,s,n)}function N$(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 O$(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 R$(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 M$(e,t,n){const r=kl(t.pattern);return bn(e,r,n)}function $$(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 Mx(e,t,n){return vt(t)?E(e,t.$ref)?Mx(e,e[t.$ref]):(()=>{throw new Error("Unable to Deref target")})():t}function F$(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 L$(e,t,n){const r=t.anyOf.map(o=>Mx(e,o));let[s,i]=[r[0],0];for(const o of r){const d=F$(e,o,n);d>i&&(s=o,i=d)}return s}function D$(e,t,n){const r=Je(aa(t.anyOf)),s=L$(e,r,n);return bn(e,s,n)}function _$(e,t,n){return ot(e,t,n)?zt(n):Ar(t)?Rn(e,t):D$(e,t,n)}function U$(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 B$(e,t,n){if(uf(n)||ff(n)||pf(n)||Ii(n)||ta(n)||Tn(n))throw new Fa(e,t,n,"Value is not repairable")}function H$(e,t,n){if(xn(t)||yn(t)||Fs(t))throw new Fa(e,t,n,"Type is not repairable")}function q$(e,t,n){return Fe(n)&&!_s(t)?Rn(e,t):n}function z$(e,t,n){return ml(t)?ot(e,t,n)?n:Rn(e,t):n}function bn(e,t,n){B$(e,t,n),H$(e,t,n);const r=q$(e,t,n),s=gt(t)?T$(e,t,r):vn(t)?A$(e,t,r):Be(t)?P$(e,t,r):Ue(t)?N$(e,t,r):Ot(t)?O$(e,t,r):vt(t)?R$(e,t,r):Wt(t)?M$(e,t,r):at(t)?$$(e,t,r):fe(t)?_$(e,t,r):U$(e,t,r);return z$(e,t,s)}function K$(...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 kx(t,n,s),s}const Ya=Object.freeze(Object.defineProperty({__proto__:null,Assert:kx,Check:ot,Clean:oo,Clone:zt,Convert:Ra,Create:Rn,Decode:OM,Default:Dd,Diff:y$,Encode:LM,Equal:Px,Errors:io,HasCodec:KM,Hash:Nx,Parse:h$,Patch:C$,Pointer:ax,Repair:K$},Symbol.toStringTag,{value:"Module"}));class Gu 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 G$(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 V$(e,t){let n=e;for(const r of t){if(n===null||typeof n!="object")return;n=n[r]}return n}function Vu(e,t){const[,n]=qO.Errors(e,t);return n.map(r=>{const s=G$(r.instancePath);return{code:r.keyword,path:s,message:r.message,value:V$(t,s)}})}function $x(e,t){const n=Ya.Default(e,Ya.Clone(t)),r=Vu(e,n);if(r.length>0)return{success:!1,error:new Gu(r)};const s=Ya.Clean(e,n),i=Vu(e,s);return i.length>0?{success:!1,error:new Gu(i)}:{success:!0,data:s}}function Qn(e,t){const n=$x(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=>$x(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,W$=1e6,J$=16*1024;function Q$(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"])),Y$=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()})})])),Fx=c.Union([c.String(),c.Array(Y$)]);z(c.Object({id:c.String(),role:_d,content:Fx,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 Z$=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"])),X$=z(be(["applied","discarded","conflicted"])),eF=z(c.Object({status:X$,updatedAt:c.String(),sourceCommit:c.Optional(c.String()),changedFiles:c.Optional(c.Integer({minimum:0})),message:c.Optional(c.String())})),tF=z(c.Object({changedFiles:c.Integer({minimum:0}),additions:c.Integer({minimum:0}),deletions:c.Integer({minimum:0}),commits:c.Integer({minimum:0})})),nF=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()})),rF=z(c.Object({sessionId:c.String(),projectPath:c.String(),baseCommit:c.String(),files:c.Array(nF,{maxItems:100}),truncated:c.Boolean()})),sF=c.Union([c.String(),c.Number(),c.Boolean(),c.Array(c.String())]),iF=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(sF),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(iF)),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 oF=z(c.Object({type:be(["permission","question","elicitation"]),requestId:c.String()})),aF=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(Z$,"completed"),taskStatusReason:c.Optional(c.String()),taskFailure:c.Optional(aF),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(eF),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(tF),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(oF),messageCount:c.Number(),firstMessageTime:c.String(),lastMessageTime:c.String(),hasErrors:c.Boolean()})),cF=z(c.Object({sessions:c.Array(Un),nextCursor:c.Optional(c.String())})),lF=z(c.Object({session:Un,archivedSessionIds:c.Array(c.String())})),dF=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:Fx,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())})),uF=z(c.Object({session:Un,messages:c.Array(Hd)})),Lx=z(be(["conversation","code","both"])),Dx=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(Lx,"conversation")}));const pF=z(c.Object({checkpoint:Dx,mode:Lx,removedTurns:c.Integer({minimum:1}),restoredFiles:c.Array(c.String()),messages:c.Array(Hd)})),fF=be(["running","completed","failed","cancelled"]),Rc=z(c.Object({id:c.String(),subagentType:c.String(),description:c.String(),status:fF,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 mF=z(c.Object({source:Rc,session:Rc})),_x=z(c.Object({sessionId:c.String(),projectPath:c.String()})),Ux=z(c.Object({path:c.String(),name:c.String(),gitBranch:c.Optional(c.String()),available:c.Boolean(),isCurrent:c.Boolean(),boundAt:c.String()})),hF=z(c.Union([c.Object({cancelled:c.Literal(!0)}),c.Object({cancelled:c.Literal(!1),path:c.String({minLength:1})})])),Wu=z(c.Object({type:c.String(),seq:c.Optional(c.Number()),properties:c.Record(c.String(),c.Unknown())})),Bx=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())}),Hx=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(Bx,{maxItems:zr})),outputSchema:c.Optional(Hx)}));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 Ju=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}))})),gF=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:gF,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 bF=z(c.Object({schedules:c.Array(Cs)}));z(c.Object({content:c.String({maxLength:W$}),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(Bx,{maxItems:zr})),outputSchema:c.Optional(Hx)}));const kF=be(["completed","failed","aborted","timed_out","spawn_error"]),xF=z(c.Object({version:c.Literal(1),command:c.String(),status:kF,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 yF=z(c.Object({executionId:c.String(),messageId:c.String(),record:xF,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:J$,pattern:"^(?![\\s\\S]*\\x00)(?=[\\s\\S]*\\S)[\\s\\S]*$"}),projectPath:c.Optional(c.String())}));const wF=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 vF=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 SF=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(SF,{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 jF=z(be(["light","dark","system"])),IF=z(c.Object({language:c.String(),codeTheme:c.String(),uiTheme:jF,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(IF));class zd extends Error{constructor(t,n){super(t),this.status=n,this.name="HttpResponseError"}}function CF(e){return e instanceof zd}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 zd(o,n.status)}return r}const ie="",Qu=1e4,EF=c.Array(Un),TF=c.Array(Ux),AF=c.Array(Hd),PF=c.Array(Dx),NF=c.Array(Rc),Yu=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())}))}),OF=e=>Array.isArray(e)?e:e==null?"":typeof e=="string"?e:JSON.stringify(e),RF=()=>{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 MF(e){const t=_x.parse(e);return`projectPath=${encodeURIComponent(t.projectPath)}`}function ft(e,t){const n=MF(t);return`${e}${e.includes("?")?"&":"?"}${n}`}function Zu(e){return{"x-blade-directory":_x.parse(e).projectPath}}const Za=(e,t,n)=>({id:`history-${t}-${n}`,role:e.role,content:OF(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(TF,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 Ux.parse(await t.json())},pickProjectDirectory:async()=>Qn(hF,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(EF,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 cF.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||RF()})});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",...Zu(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 vF.parse(await n.json())},getWorkspaceInfo:async()=>Qn(Yu,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 Ju.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(Yu.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 Ju.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 rF.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=>lF.parse(await Dn(ft(`${ie}/sessions/${e.sessionId}/archive`,e),{method:"POST"})),unarchiveSession:async e=>dF.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(AF,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 zd(o||"Failed to send message",r.status)}return r.json()},askSideQuestion:async(e,t,n)=>wF.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)=>yF.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(PF,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=pF.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(NF,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 mF.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=uF.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"))},Qu)),o.onmessage=ae=>{try{const ce=JSON.parse(ae.data);typeof ce.seq=="number"&&ce.seq>k&&(k=ce.seq);const le=Wu.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")))},Qu),s.onmessage=h=>{try{const b=Wu.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:Zu(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 bF.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())}},$F=(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:{...lu(d,r),textBefore:d.textBefore+r}}:{...o,agentContent:{...lu(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:G0(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:{...K0(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?z0(o,r):cu(o,[])}})})),updateSubagent:(n,r,s)=>e(i=>({messages:i.messages.map(o=>{if(o.id!==n)return o;const d=o.agentContent||Wn(),f=[...q0(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:cu(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,FF=[/<system-reminder>[\s\S]*?<\/system-reminder>/gi,/<file[^>]*>[\s\S]*?<\/file>/gi,/<hooks_context>[\s\S]*?<\/hooks_context>/gi,/<[^>]+>/g];function LF(e){let t=e;for(const f of FF)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/",DF=/-[a-f0-9]{8,}$/i,_F=/^(.+?(?:test|config))-[a-z0-9]{6,}$/i;function UF(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 BF(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(_F);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(DF,""):t}function lo(e,t=null){const n=e.taskSourceProjectPath,r=BF(n||e.projectPath);if(r)return r;if(n)return n;const s=UF(e.projectPath);if(!s)return e.projectPath;const i=Mc(s);return t&&i===Mc(t)?t:s}function HF(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})})),qF=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 S3=()=>Xr(e=>qF(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 Kd(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 Xu(e,t){return e.filter(n=>!oe(he(n),t))}const qx="blade.tasks.unread",Go="blade:open-session";function zx(e){return e==="completed"||e==="failed"||e==="interrupted"}function zF(e,t,n){return!zx(t)||n?!1:e!==t&&!(e==="completed"||e==="failed"||e==="interrupted"||e==="cancelled")}function KF(e=typeof localStorage>"u"?null:localStorage){if(!e)return[];try{const t=JSON.parse(e.getItem(qx)??"[]");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(qx,JSON.stringify([...new Set(e)]))}catch{}}function ep(e,t){const n=new Set(t.map(r=>Re({sessionId:r.sessionId,projectPath:r.projectPath})));return e.filter(r=>n.has(r))}function tp(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 GF(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 VF=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}),np=()=>new Promise(e=>{globalThis.setTimeout(()=>{if(typeof window<"u"&&typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>e(),{timeout:750});return}e()},350)}),rp=async e=>(await es(async()=>{const{teamService:t}=await import("./teamService-DelV4FvL.js");return{teamService:t}},__vite__mapDeps([0,1,2,3]))).teamService.list(e),WF=(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:Xu(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 np(),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=ep(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 np())}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=Kd(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?rp(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=ep(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:Xu(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=Q$(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=LF(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:VF(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)&&!CF(Z)?!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 rp(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})}}}},JF=(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??du(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=>{du(t,e)(s)}}};function QF(e){var t;return((t=e.taskPromptSummary)==null?void 0:t.trimStart().startsWith("/review"))===!0}function Gd(e,t){var r;const n=(r=e.taskStatusReason)==null?void 0:r.trim();if(QF(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(jp(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 YF=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}}})),Kx="blade.projects.selected";function sp(){return typeof localStorage>"u"?null:localStorage.getItem(Kx)}function Io(e){typeof localStorage<"u"&&localStorage.setItem(Kx,e)}const ZF=new Set(["queued","running","completed","failed","cancelled","interrupted"]),rc=new Set(["default","autoEdit","yolo","plan"]),ip=new Set(["auto","off","minimal","low","medium","high","xhigh","max"]),op=new Set(["auto","standard","fast","flex"]),ap=new Set(["auto","low","medium","high"]),cp=new Set(["auto","pragmatic","friendly","explanatory"]),lp=new Set(["high","medium","low"]),dp=new Set(["feature","bug","maintenance","research"]);function XF(e){return typeof e=="string"&&ZF.has(e)}function e5(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 up(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=V0(t.code);if(!(!n||typeof t.message!="string"||typeof t.retryable!="boolean"))return{code:n,message:Ke(jp(n)),retryable:W0(n)}}function t5(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 n5=(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:sp(),isDispatchingTask:!1,isUpdatingTaskAdmission:!1,isBindingProject:!1,cancellingTaskKeys:[],retryingTaskKeys:[],updatingTaskKeys:[],taskDeliveryActions:{},unreadTaskKeys:KF(),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)||ip.has(O)||op.has(J)||ap.has(ae)||cp.has(ce)||lp.has(le)||dp.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}:{},...ip.has(O)?{reasoningEffort:O}:{},...op.has(J)?{serviceTier:J}:{},...ap.has(ae)?{responseVerbosity:ae}:{},...cp.has(ce)?{communicationStyle:ce}:{},...lp.has(le)?{taskPriority:le}:{},...dp.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=t5(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;tp({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"){YF.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"||!XF(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=zF(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&&zx(h)&&GF(h),h==="completed"?I.notifyBuild:I.notifyErrors){const M=Ke(h==="completed"?"attention.notification.completed":h==="failed"?"attention.notification.failed":"attention.notification.interrupted"),$=up(u.properties.taskFailure),te=N?Gd({...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;tp({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"?up(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:e5(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=sp(),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}}}},r5=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)=>({...WF(...e),...n5(...e),...$F(...e),...JF(...e),...r5(...e)}));function s5(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function i5({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(hu,{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(hu,{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:s5(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(iy,{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(qp,{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 Gx({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 pp(){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 Vx=[{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 o5(e){const t=e.key.toLocaleLowerCase();return Vx.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 a5(e){return e instanceof Element?!!e.closest('input, textarea, select, [contenteditable="true"], [role="textbox"], [role="combobox"]'):!1}function c5(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 l5(e,t){const n=e.key==="/"?"/":e.key.toLocaleUpperCase(),r=c5();return[...e.primaryModifier?[r?"⌘":"Ctrl"]:[],...e.shiftKey?[r?"⇧":"Shift"]:[],n]}function Fc(e,t){const n=Vx.find(r=>r.id===e);return n?l5(n).join(""):""}function d5(){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=o5(i);if(!o)return;const d=sn.getState(),f=d.isTaskSwitcherOpen,u=a5(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(()=>pp());return}if(o.id==="focusComposer"){pp()&&i.preventDefault();return}o.id==="toggleSidebar"&&(i.preventDefault(),n())}};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,e,r,n])}const Vd=y.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(wp,{ref:r,className:W("overflow-hidden relative",e),...n,children:[a.jsx(L0,{className:"h-full w-full rounded-[inherit] [&>div]:!block !overflow-auto",children:t}),a.jsx(Wx,{}),a.jsx(D0,{})]}));Vd.displayName=wp.displayName;const Wx=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>a.jsx(vp,{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(_0,{className:"relative flex-1 rounded-full bg-border"})}));Wx.displayName=vp.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 Jx(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=B0,Zn=H0,_n=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(U0,{children:a.jsx(Sp,{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=Sp.displayName;function u5(){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(Ip,{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(Vd,{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 Jx(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(Tp,{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(X0,{className:"h-3.5 w-3.5"})})]})]},C)})})})]})]})}function Wd({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 fp={en:"sidebar.language.en",zh:"sidebar.language.zh"};function Qx({className:e,variant:t="pill"}){const{locale:n,setLocale:r}=lw(),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(fp[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:sw.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(fp[i])},i)})})}const p5="[data-mobile-navigation-trigger]";function j3(e){return Yx(p5,e)}function Yx(e,t){const n=document.querySelector(e);return!n||n.getClientRects().length===0?!1:(t.preventDefault(),n.focus({preventScroll:!0}),!0)}function Zx({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=>Yx("[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(oy,{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(Mp,{className:"h-3.5 w-3.5"})})]},j.path)})})]})}):null}const f5={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 m5({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(Cp,{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)]":f5[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(my,{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(ay,{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(gy,{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(Ip,{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(Tp,{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(Mp,{className:"h-3 w-3","aria-hidden":!0}),I("session.action.deleteShort")]})]})]})]})]})}function h5({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:Pp,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(Wd,{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(Ap,{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(Rp,{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(Qx,{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 Xx="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 g5(){if(typeof window>"u")return[];try{const e=JSON.parse(window.localStorage.getItem(Xx)??"[]");return Array.isArray(e)?uo(e):[]}catch{return[]}}function b5(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Xx,JSON.stringify(uo(e)))}catch{}}function k5(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 x5(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 y5(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 w5({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(cy,{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(ry,{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 mp(e){return e.pendingInteraction?0:e.taskStatus==="running"?1:e.taskStatus==="queued"?2:3}function Jd(e,t){return mp(e)-mp(t)||Lc(t)-Lc(e)}const v5=["running","queued","interrupted","failed","cancelled","completed"],S5={running:"RUNNING",queued:"QUEUED",interrupted:"INTERRUPTED",failed:"FAILED",cancelled:"CANCELLED",completed:"DONE"},Ss=e=>e.length>1?e.replace(/\/+$/,""):e;function e0(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 j5(e){const t=e0(e),n=[];for(const r of v5){const s=t.filter(i=>i.taskStatus===r).sort(Jd);s.length>0&&n.push({code:S5[r],status:r,sessions:s})}return n}function I5(e,t,n=[]){const r=e0(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(Jd),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 hp=12,C5={RUNNING:"sidebar.group.running",QUEUED:"sidebar.group.queued",INTERRUPTED:"sidebar.group.interrupted",FAILED:"sidebar.group.failed",CANCELLED:"sidebar.group.cancelled",DONE:"sidebar.group.done"},E5={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 T5({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(g5),[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"?j5(t):[],[t,e]),O=y.useMemo(()=>e==="project"?I5(t,n,r.map(R=>R.path)):[],[n,r,t,e]),J=y.useMemo(()=>k5(O,x),[O,x]),ae=(R,ue)=>{const ve=S[R]??!1,He=ve?ue:ue.filter((tt,Y)=>{if(Y<hp)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>hp: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]",E5[R.code]??"text-[hsl(var(--deck-ink-faint))]",ue===0&&"pt-2"),children:[a.jsx("span",{children:h(C5[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),b5(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(x5(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(w5,{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=y5(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 A5({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=Gd(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 Jx(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(Wd,{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(ny,{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(Ap,{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(Rp,{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(Vd,{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(T5,{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(m5,{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(Op,{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(u5,{}),[{icon:Pp,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(Qx,{})]}),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(Zx,{open:F,onOpenChange:B})]}):a.jsx(h5,{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 P5=y.lazy(()=>es(()=>import("./SettingsModal-CJ8604CG.js"),__vite__mapDeps([4,1,2,5,6,7,8,3,9])).then(e=>({default:e.SettingsModal}))),t0=()=>es(()=>import("./TaskSwitcher-zfuhsPf1.js"),__vite__mapDeps([10,1,3,11,12,2])).then(e=>({default:e.TaskSwitcher})),N5=y.lazy(t0),n0=()=>es(()=>import("./FilePreview-p9GkBrrr.js"),__vite__mapDeps([13,1,3,14,5,9,11,2])),O5=y.lazy(()=>n0().then(e=>({default:e.FilePreview}))),R5=y.lazy(()=>n0().then(e=>({default:e.PreviewControls}))),M5=y.lazy(()=>es(()=>import("./TerminalPanel-BF6GORqQ.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},$5=e=>e.replace(/^~\//,"~/§").split("/").filter(Boolean).map((t,n,r)=>{var s;return n===0&&((s=r[0])!=null&&s.startsWith("~"))?"~":t.replace(/^§/,"")});function F5({children:e}){var Y,pt;const t=Ut();d5();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(()=>{t0()},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?$5(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(A5,{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(fy,{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(Gx,{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(R5,{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(P5,{})}):e}),r&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(O5,{returnFocusElement:le.current,maximized:tt},yt)})]})]}),i&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(M5,{workspacePath:He},He??"default-workspace")}),o&&a.jsx(y.Suspense,{fallback:null,children:a.jsx(N5,{})}),a.jsx(i5,{open:j,onOpenChange:I})]})}const ic="BladeCode";function L5(){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=Kd(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 D5=(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}},_5=(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}:D5(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}},U5=(e,t=!1)=>e.includes(" ")||t?`@"${e}"`:`@${e}`,B5=(e,t,n)=>{if(!t.hasQuery)return{newInput:e,newCursorPos:e.length};const r=U5(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 H5(){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 q5=(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}},z5=(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}:q5(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}},K5=(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}},G5="blade.composer.draft.",Vo=new Map,r0=1;function Wo(){return typeof sessionStorage>"u"?null:sessionStorage}function Jo(e){return`${G5}${e}`}function V5(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===r0&&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){s0(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:r0,content:t.content,...r?{outputSchema:r}:{}})):(i=Wo())==null||i.removeItem(Jo(e))}catch{}}function s0(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 W5(e){return`data:${e.type||"application/octet-stream"};base64,`.length+4*Math.ceil(e.size/3)}function J5(e,t){const r=_c(e)+t.reduce((s,i)=>s+W5(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 Q5=e=>typeof e=="object"&&"command"in e,gp=({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"?Ep:mu;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=Q5(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(mu,{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:dy},{value:kr.AUTO_EDIT,labelKey:"chat.input.mode.autoEdit",descriptionKey:"chat.input.mode.autoEdit.desc",icon:xy},{value:kr.YOLO,labelKey:"chat.input.mode.yolo",descriptionKey:"chat.input.mode.yolo.desc",icon:Np,tone:"danger"},{value:kr.PLAN,labelKey:"chat.input.mode.plan",descriptionKey:"chat.input.mode.plan.desc",icon:sy}],Y5=["off"],Z5=["high","xhigh","medium","max","low","minimal","off"],X5=["standard"],e3=[];function t3(e){return Z5.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 n3({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 ou;const x=Ut(),N=y.useRef(V5(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),Qd=H(w=>w.setMaxContextTokens),Pe=H(w=>w.currentSessionRef),Yd=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}),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.reasoningEffort}),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.serviceTier}),a0=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}),[c0,Zd]=y.useState(null),[l0,Xd]=y.useState(null),[d0,La]=y.useState(null),[u0,Da]=y.useState(null),p0=Lr.some(w=>w.id===Yd),xs=Pe?c0??(p0?Yd:qt):qt,nt=Lr.find(w=>w.id===xs),po=((nt==null?void 0:nt.supportedReasoningEfforts)??Y5).filter(w=>w!=="auto"),fo=l0??i0,f0=t3(po),mo=fo!==void 0&&fo!=="auto"&&po.includes(fo)?fo:f0,ho=(nt==null?void 0:nt.supportedServiceTiers)??X5,m0=["auto",...ho],Dr=d0??o0??"auto",go=(nt==null?void 0:nt.supportedResponseVerbosities)??e3,h0=["auto",...go],_r=u0??a0??"auto",eu=Xs??"auto",g0=po.length>1,b0=ho.some(w=>w!=="standard"),k0=go.length>0,tu=(nt==null?void 0:nt.displayName)||(nt==null?void 0:nt.model)||xs||x("chat.input.model.placeholder"),mr=((ou=nt==null?void 0:nt.input)==null?void 0:ou.includes("image"))===!0,ei=nt?x("chat.input.attachment.modelUnsupported",{model:tu}):x("chat.input.attachment.modelRequired"),bo=D.length>0&&!mr,tn=z5(P,le,{workspacePath:C}),nn=_5(P,le,{workspacePath:C}),ys=H5(),ti=tn.hasQuery&&tn.suggestions.length>0,ko=nn.hasQuery&&nn.suggestions.length>0,x0=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(()=>{Zd(null),Xd(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;Qd(nt.contextWindow||0,!w)},[nt,Qd]),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:eu,attachments:D,...w?{outputSchema:w}:{}})===!1)return;s0(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,eu,Dr,Qt,e,M,ys,x]),y0=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]),nu=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=J5(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=>nu(ws))),Rt=new Set(T.current.map(ws=>ws.dataUrl)),au=Oe.filter(ws=>Rt.has(ws.dataUrl)?!1:(Rt.add(ws.dataUrl),!0));if(au.length===0){Ae(null),et(null),bt.current=null;return}const yo=[...T.current,...au];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,nu,x]),w0=y.useCallback(async w=>{const Q=Array.from(w.target.files??[]).filter(K=>K.type.startsWith("image/"));await xo(Q),w.target.value=""},[xo]),v0=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}=K5(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}=B5(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]),S0=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
- `);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,ko,tn,nn,Ua,Ba,_a,k,P,ys]),j0=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]),ru=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],I0=x(Ha.labelKey),C0=Ha.icon,E0=!!P.trim()||D.length>0,su=D.length>=zr,T0=_c(D),qa=qe||(bo?ei:null),iu=qa?null:Jt,za=!!n||B,A0=za||su||!mr,ni=mr?su?x("chat.input.attachment.countLimit",{count:zr}):x("chat.input.attachment.add"):ei,P0=()=>{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(gp,{type:"command",suggestions:tn.suggestions,selectedIndex:tn.selectedIndex,loading:tn.loading,onSelect:Ua,onHover:tn.setSelectedIndex,visible:ti}),a.jsx(gp,{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:j0,onKeyDown:S0,onPaste:v0,onSelect:ru,onClick:ru,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"})})]}),iu&&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(py,{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--deck-accent))]"}),a.jsx("span",{className:"flex-1 min-w-0",children:iu}),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(T0),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:()=>y0(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:[A0?a.jsx("button",{type:"button",disabled:za,"aria-disabled":"true","aria-label":ni,title:ni,onClick:P0,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(gu,{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:w0}),a.jsx(gu,{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:[tu,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){Zd(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))})})]}),g0&&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:()=>{Xd(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))})]})]}),b0&&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:m0.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))})]})]}),k0&&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:h0.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(ty,{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(C0,{className:"h-3.5 w-3.5"}),I0,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(Cp,{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:!E0||n||Qt||bo||B||x0,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(ky,{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(Np,{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 r3={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 s3(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 i3(e){return e.split("/").filter(Boolean).at(-1)||e}function o3({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(Jd).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=r3[h.taskStatus],k=h.pendingInteraction?h.pendingInteraction.type==="question"?"interaction.badge.question":h.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission":null,S=i3(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=Gd(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:s3(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(ey,{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 a3({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:ly,prompt:"Build a production-ready ",hintKey:"taskHome.template.build.hint"},{key:"review",titleKey:"taskHome.template.review.title",descriptionKey:"taskHome.template.review.description",icon:by,prompt:"/review uncommitted",hintKey:"taskHome.template.review.hint"},{key:"fix",titleKey:"taskHome.template.fix.title",descriptionKey:"taskHome.template.fix.description",icon:yy,prompt:"Investigate and fix ",hintKey:"taskHome.template.fix.hint"}];function c3(e,t){return t?t.split("/").filter(Boolean).at(-1)||t:e("taskHome.hero.projectFallback")}function l3(){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(()=>HF(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:c3(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(Wd,{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(bu,{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(Ep,{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(a3,{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(hy,{className:"w-3 h-3"}):a.jsx(uy,{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(Gx,{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(fu,{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(fu,{className:"h-3.5 w-3.5"}):Z?a.jsx(Ns,{className:"h-3.5 w-3.5"}):a.jsx(pu,{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(pu,{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(n3,{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(bu,{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(o3,{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(Op,{className:"w-3 h-3"}),a.jsx("span",{className:"font-mono uppercase tracking-[0.14em]",children:e("taskHome.footer.note")})]}),a.jsx(Zx,{open:yt,onOpenChange:We})]})})}const Uc="blade.sessions.last",bi="session",Bc="project",Oo="workspace",Hc="view";function d3(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 u3(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 p3(e=typeof localStorage>"u"?null:localStorage){if(!e)return null;try{const t=e.getItem(Uc);return t?d3(JSON.parse(t)):null}catch{return null}}function f3(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 m3=y.lazy(()=>es(()=>import("./ChatView-EtPiVi9S.js").then(e=>e.a),__vite__mapDeps([18,1,3,5,14,2,19,7,12,8,0])).then(e=>({default:e.ChatView}))),h3=y.lazy(()=>es(()=>import("./KanbanBoard-B3HgXU0l.js"),__vite__mapDeps([20,1,3,6,12,7,19,2])).then(e=>({default:e.KanbanBoard})));function g3(){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=u3(window.location.search);P(T.view),D(T.view==="board"?T.projectPath:null);const M=p3(),$=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?Kd(k,i):void 0;f3(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(L5,{}),a.jsx(F5,{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(h3,{})}):!i||o?a.jsx(l3,{}):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(m3,{})}):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")})})]})}N0.createRoot(document.getElementById("root")).render(a.jsx(O0.StrictMode,{children:a.jsx(g3,{})}));export{Kc as $,Ns as A,ty as B,Cp as C,Wc as D,pp as E,mu as F,qc as G,uy as H,gi as I,Gd as J,Gc as K,mt as L,Ip as M,ey as N,w3 as O,hy as P,li as Q,Yo as R,ky as S,Mp as T,Kr as U,Mt as V,bu as W,ui as X,Gx as Y,zc as Z,es as _,H as a,Ro as a0,Zx as a1,Tp as a2,Dn as a3,Yx as a4,Yn as a5,Zn as a6,_n as a7,YF as a8,xy as a9,Vx as aa,l5 as ab,Jd as ac,lo as ad,Mc as ae,Ke as af,Fc as ag,iy as ah,Rp as ai,Pp as aj,Op as ak,j3 as al,_x as am,pu as an,oy as ao,Zu as ap,S3 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,qp as i,W as j,Np as k,X as l,Wd as m,js as n,ry as o,hu as p,Vd as q,lw as r,oe as s,fu as t,Ut as u,gy as v,Kd as w,Xr as x,di as y,n3 as z};