spec-cat 0.1.0

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 (667) hide show
  1. package/.output/nitro.json +15 -0
  2. package/.output/public/_nuxt/2EtD6e53.js +1 -0
  3. package/.output/public/_nuxt/2UxHyX5q.js +1 -0
  4. package/.output/public/_nuxt/3e1v2bzS.js +1 -0
  5. package/.output/public/_nuxt/4A_iFExJ.js +1 -0
  6. package/.output/public/_nuxt/5FxpIoe_.js +1 -0
  7. package/.output/public/_nuxt/5X7smno1.js +1 -0
  8. package/.output/public/_nuxt/5i3qLPDT.js +1 -0
  9. package/.output/public/_nuxt/83L43bj1.js +1 -0
  10. package/.output/public/_nuxt/85-TOEBH.js +1 -0
  11. package/.output/public/_nuxt/B0m2ddpp.js +1 -0
  12. package/.output/public/_nuxt/B1dDrJ26.js +1 -0
  13. package/.output/public/_nuxt/B1yitclQ.js +1 -0
  14. package/.output/public/_nuxt/B2wdmh_w.js +126 -0
  15. package/.output/public/_nuxt/B6aJPvgy.js +1 -0
  16. package/.output/public/_nuxt/B7c-h3xW.js +1 -0
  17. package/.output/public/_nuxt/B7mTdjB0.js +1 -0
  18. package/.output/public/_nuxt/B93PlW-d.js +1 -0
  19. package/.output/public/_nuxt/BBf5iR-q.js +1 -0
  20. package/.output/public/_nuxt/BEDo0Tqx.js +1 -0
  21. package/.output/public/_nuxt/BERRCDM3.js +1 -0
  22. package/.output/public/_nuxt/BETggiCN.js +1 -0
  23. package/.output/public/_nuxt/BEwlwnbL.js +1 -0
  24. package/.output/public/_nuxt/BFfxhgS-.js +1 -0
  25. package/.output/public/_nuxt/BGHnOYBU.js +1 -0
  26. package/.output/public/_nuxt/BGJmEYvX.js +1 -0
  27. package/.output/public/_nuxt/BH7IYjvW.js +1 -0
  28. package/.output/public/_nuxt/BIGW1oBm.js +1 -0
  29. package/.output/public/_nuxt/BJDFO7_C.js +1 -0
  30. package/.output/public/_nuxt/BLmx8bSh.js +1 -0
  31. package/.output/public/_nuxt/BLtJtn59.js +1 -0
  32. package/.output/public/_nuxt/BM1_JUlF.js +1 -0
  33. package/.output/public/_nuxt/BMWR74SV.js +1 -0
  34. package/.output/public/_nuxt/BPQ3VLAy.js +1 -0
  35. package/.output/public/_nuxt/BQ8w6xss.js +1 -0
  36. package/.output/public/_nuxt/BR5kRUq4.js +1 -0
  37. package/.output/public/_nuxt/BRHolxvo.js +1 -0
  38. package/.output/public/_nuxt/BRZ36xJF.js +1 -0
  39. package/.output/public/_nuxt/BTJTHyun.js +1 -0
  40. package/.output/public/_nuxt/BTifaqeh.js +1 -0
  41. package/.output/public/_nuxt/BUOk7wkI.js +1 -0
  42. package/.output/public/_nuxt/BUw7H-hv.js +1 -0
  43. package/.output/public/_nuxt/BV7otONQ.js +1 -0
  44. package/.output/public/_nuxt/BVQ-GDCI.js +1 -0
  45. package/.output/public/_nuxt/BWvSN4gD.js +1 -0
  46. package/.output/public/_nuxt/BXkSAIEj.js +1 -0
  47. package/.output/public/_nuxt/BYV0-3_D.js +1 -0
  48. package/.output/public/_nuxt/BYunw83y.js +1 -0
  49. package/.output/public/_nuxt/BZvkOJ9d.js +1 -0
  50. package/.output/public/_nuxt/B_m7g4N7.js +1 -0
  51. package/.output/public/_nuxt/Ba13S78F.js +1 -0
  52. package/.output/public/_nuxt/BcOcwvcX.js +1 -0
  53. package/.output/public/_nuxt/BcVCzyr7.js +1 -0
  54. package/.output/public/_nuxt/BdImnpbu.js +1 -0
  55. package/.output/public/_nuxt/BdnUsdx6.js +1 -0
  56. package/.output/public/_nuxt/BfHTSMKl.js +1 -0
  57. package/.output/public/_nuxt/BfjtVDDH.js +1 -0
  58. package/.output/public/_nuxt/BgDCqdQA.js +1 -0
  59. package/.output/public/_nuxt/BhOHFoWU.js +1 -0
  60. package/.output/public/_nuxt/BhRPY-oY.js +1 -0
  61. package/.output/public/_nuxt/Bhrxn6JZ.js +1 -0
  62. package/.output/public/_nuxt/BkioyH1T.js +1 -0
  63. package/.output/public/_nuxt/Bkuqu6BP.js +1 -0
  64. package/.output/public/_nuxt/BmXAJ9_W.js +1 -0
  65. package/.output/public/_nuxt/Bmn6On1c.js +1 -0
  66. package/.output/public/_nuxt/Bp3cYrEr.js +1 -0
  67. package/.output/public/_nuxt/Bp6g37R7.js +1 -0
  68. package/.output/public/_nuxt/BqTXFGrv.js +1 -0
  69. package/.output/public/_nuxt/BqYA7rlc.js +1 -0
  70. package/.output/public/_nuxt/Bqlz6CoK.js +1 -0
  71. package/.output/public/_nuxt/Br6cN0cg.js +1 -0
  72. package/.output/public/_nuxt/BrzmwbiE.js +1 -0
  73. package/.output/public/_nuxt/BsS91CYL.js +1 -0
  74. package/.output/public/_nuxt/BspZqrRM.js +1 -0
  75. package/.output/public/_nuxt/BtCnVYZw.js +1 -0
  76. package/.output/public/_nuxt/BtOb2qkB.js +1 -0
  77. package/.output/public/_nuxt/BthQWCQV.js +1 -0
  78. package/.output/public/_nuxt/BtqSS_iP.js +1 -0
  79. package/.output/public/_nuxt/BtvRca6l.js +1 -0
  80. package/.output/public/_nuxt/Buea-lGh.js +1 -0
  81. package/.output/public/_nuxt/Bv_4Rxtq.js +1 -0
  82. package/.output/public/_nuxt/BvosqTnx.js +1 -0
  83. package/.output/public/_nuxt/BvzEVeQv.js +1 -0
  84. package/.output/public/_nuxt/Bw305WKR.js +1 -0
  85. package/.output/public/_nuxt/BwcbSlWF.js +4 -0
  86. package/.output/public/_nuxt/BxgE0vQu.js +1 -0
  87. package/.output/public/_nuxt/BzJJZx-M.js +1 -0
  88. package/.output/public/_nuxt/BzTr9Aqm.js +1 -0
  89. package/.output/public/_nuxt/C-HG3fhB.js +1 -0
  90. package/.output/public/_nuxt/C-SQnVFl.js +1 -0
  91. package/.output/public/_nuxt/C-sUppwS.js +1 -0
  92. package/.output/public/_nuxt/C0HS_06l.js +1 -0
  93. package/.output/public/_nuxt/C0hk2d4L.js +1 -0
  94. package/.output/public/_nuxt/C151Ov-r.js +1 -0
  95. package/.output/public/_nuxt/C2t-YnRu.js +1 -0
  96. package/.output/public/_nuxt/C39BiMTA.js +1 -0
  97. package/.output/public/_nuxt/C3B-1QV4.js +1 -0
  98. package/.output/public/_nuxt/C3Wv6jpd.js +1 -0
  99. package/.output/public/_nuxt/C3mMm8J8.js +1 -0
  100. package/.output/public/_nuxt/C47S-Tmv.js +1 -0
  101. package/.output/public/_nuxt/C4EeE6gA.js +1 -0
  102. package/.output/public/_nuxt/C4IJs8-o.js +1 -0
  103. package/.output/public/_nuxt/C4gqWexZ.js +1 -0
  104. package/.output/public/_nuxt/C5YyOfLZ.js +1 -0
  105. package/.output/public/_nuxt/C5wk2twv.js +1 -0
  106. package/.output/public/_nuxt/C7zT0LnQ.js +1 -0
  107. package/.output/public/_nuxt/C8M2exoo.js +1 -0
  108. package/.output/public/_nuxt/C8lEn-DE.js +1 -0
  109. package/.output/public/_nuxt/C98Dy4si.js +1 -0
  110. package/.output/public/_nuxt/C9XAeP06.js +1 -0
  111. package/.output/public/_nuxt/C9dUb6Cb.js +1 -0
  112. package/.output/public/_nuxt/C9oPPf7i.js +1 -0
  113. package/.output/public/_nuxt/C9tS-k6U.js +1 -0
  114. package/.output/public/_nuxt/CDVJQ6XC.js +1 -0
  115. package/.output/public/_nuxt/CDx5xZoG.js +1 -0
  116. package/.output/public/_nuxt/CEL-wOlO.js +1 -0
  117. package/.output/public/_nuxt/CEu0bR-o.js +1 -0
  118. package/.output/public/_nuxt/CF10PKvl.js +1 -0
  119. package/.output/public/_nuxt/CFHQjOhq.js +1 -0
  120. package/.output/public/_nuxt/CG6Dc4jp.js +1 -0
  121. package/.output/public/_nuxt/CG8Ifv2g.js +1 -0
  122. package/.output/public/_nuxt/CGscLIrv.js +1 -0
  123. package/.output/public/_nuxt/CH1njM8p.js +1 -0
  124. package/.output/public/_nuxt/CHLpvVh8.js +1 -0
  125. package/.output/public/_nuxt/CHM0blh-.js +1 -0
  126. package/.output/public/_nuxt/CJc9bBzg.js +1 -0
  127. package/.output/public/_nuxt/CKIfxQSi.js +1 -0
  128. package/.output/public/_nuxt/CLZrNe3w.js +1 -0
  129. package/.output/public/_nuxt/CLxacb5B.js +1 -0
  130. package/.output/public/_nuxt/CMTm3GFP.js +1 -0
  131. package/.output/public/_nuxt/CMjwMIkn.js +1 -0
  132. package/.output/public/_nuxt/CO1LY3CK.js +1 -0
  133. package/.output/public/_nuxt/COTT6rNZ.js +1 -0
  134. package/.output/public/_nuxt/COcwbKMJ.js +1 -0
  135. package/.output/public/_nuxt/COkxafJQ.js +1 -0
  136. package/.output/public/_nuxt/COt5Ahok.js +1 -0
  137. package/.output/public/_nuxt/CQ8jqdy-.js +1 -0
  138. package/.output/public/_nuxt/CS3Unz2-.js +1 -0
  139. package/.output/public/_nuxt/CSXwinHm.js +1 -0
  140. package/.output/public/_nuxt/CTRr51gU.js +1 -0
  141. package/.output/public/_nuxt/CVO1_9PV.js +1 -0
  142. package/.output/public/_nuxt/CVdnzihN.js +1 -0
  143. package/.output/public/_nuxt/CW8IKDeL.js +1 -0
  144. package/.output/public/_nuxt/CXZktZb0.js +1 -0
  145. package/.output/public/_nuxt/CXtECtnM.js +1 -0
  146. package/.output/public/_nuxt/CYsAdtH9.js +1 -0
  147. package/.output/public/_nuxt/CZhp0h8q.js +1 -0
  148. package/.output/public/_nuxt/CafNBF8u.js +1 -0
  149. package/.output/public/_nuxt/CbFg5uaA.js +1 -0
  150. package/.output/public/_nuxt/CbfX1IO0.js +1 -0
  151. package/.output/public/_nuxt/CeAyd5Ju.js +1 -0
  152. package/.output/public/_nuxt/CeZK1NFH.js +1 -0
  153. package/.output/public/_nuxt/CenWIFCC.js +1 -0
  154. package/.output/public/_nuxt/CfQXZHmo.js +1 -0
  155. package/.output/public/_nuxt/Cg-RD9OK.js +1 -0
  156. package/.output/public/_nuxt/ChMvpjG-.js +1 -0
  157. package/.output/public/_nuxt/Cj5Yp3dK.js +1 -0
  158. package/.output/public/_nuxt/CjoLj4QM.js +1 -0
  159. package/.output/public/_nuxt/CkByrt1z.js +1 -0
  160. package/.output/public/_nuxt/CkXjmgJE.js +1 -0
  161. package/.output/public/_nuxt/CklMAg4u.js +1 -0
  162. package/.output/public/_nuxt/Cl0AqbOI.js +1 -0
  163. package/.output/public/_nuxt/Cm3UrAx6.js +1 -0
  164. package/.output/public/_nuxt/CmIQRyeF.js +1 -0
  165. package/.output/public/_nuxt/Cmh6b_Ma.js +1 -0
  166. package/.output/public/_nuxt/Cn7AkR1O.js +1 -0
  167. package/.output/public/_nuxt/CnnebwVN.js +1 -0
  168. package/.output/public/_nuxt/CnnmHF94.js +1 -0
  169. package/.output/public/_nuxt/CnsnAmq5.js +1 -0
  170. package/.output/public/_nuxt/Co6uUVPk.js +1 -0
  171. package/.output/public/_nuxt/CoDkCxhg.js +1 -0
  172. package/.output/public/_nuxt/Cp-IABpG.js +1 -0
  173. package/.output/public/_nuxt/CpOuai2O.js +1 -0
  174. package/.output/public/_nuxt/Cq5zzVJU.js +1 -0
  175. package/.output/public/_nuxt/CquLrc37.js +1 -0
  176. package/.output/public/_nuxt/CsfeWuGM.js +1 -0
  177. package/.output/public/_nuxt/Csfq5Kiy.js +1 -0
  178. package/.output/public/_nuxt/CuPHTKiy.js +1 -0
  179. package/.output/public/_nuxt/CufHLc7y.js +1 -0
  180. package/.output/public/_nuxt/Cuk6v7N8.js +1 -0
  181. package/.output/public/_nuxt/Cvjx9yec.js +1 -0
  182. package/.output/public/_nuxt/CwoSXNpI.js +1 -0
  183. package/.output/public/_nuxt/CxGSJlkm.js +1 -0
  184. package/.output/public/_nuxt/CxLEBnE3.js +1 -0
  185. package/.output/public/_nuxt/CxbxFI8M.js +1 -0
  186. package/.output/public/_nuxt/CyktbL80.js +1 -0
  187. package/.output/public/_nuxt/CylS5w8V.js +1 -0
  188. package/.output/public/_nuxt/CzTSHFRz.js +1 -0
  189. package/.output/public/_nuxt/D-2ljcwZ.js +1 -0
  190. package/.output/public/_nuxt/D0YGMca9.js +1 -0
  191. package/.output/public/_nuxt/D0r3Knsf.js +1 -0
  192. package/.output/public/_nuxt/D17OF-Vu.js +1 -0
  193. package/.output/public/_nuxt/D1j8_8rp.js +1 -0
  194. package/.output/public/_nuxt/D3lLCCz7.js +1 -0
  195. package/.output/public/_nuxt/D4_iv3hh.js +1 -0
  196. package/.output/public/_nuxt/D4h5O-jR.js +1 -0
  197. package/.output/public/_nuxt/D5-asLiD.js +1 -0
  198. package/.output/public/_nuxt/D53aC0YG.js +1 -0
  199. package/.output/public/_nuxt/D5KoaKCx.js +1 -0
  200. package/.output/public/_nuxt/D7o27uSR.js +1 -0
  201. package/.output/public/_nuxt/D7oLnXFd.js +1 -0
  202. package/.output/public/_nuxt/D82EKSYY.js +1 -0
  203. package/.output/public/_nuxt/D87Tk5Gz.js +1 -0
  204. package/.output/public/_nuxt/D8_7TLub.js +1 -0
  205. package/.output/public/_nuxt/D93ZcfNL.js +1 -0
  206. package/.output/public/_nuxt/D97Zzqfu.js +1 -0
  207. package/.output/public/_nuxt/DAi9KRSo.js +1 -0
  208. package/.output/public/_nuxt/DBab5Zcv.js +153 -0
  209. package/.output/public/_nuxt/DEthMvLe.js +1 -0
  210. package/.output/public/_nuxt/DFQXde-d.js +1 -0
  211. package/.output/public/_nuxt/DFWUc33u.js +1 -0
  212. package/.output/public/_nuxt/DFXneXwc.js +1 -0
  213. package/.output/public/_nuxt/DGP4VlC8.js +1 -0
  214. package/.output/public/_nuxt/DGztddWO.js +1 -0
  215. package/.output/public/_nuxt/DH5Ifo-i.js +1 -0
  216. package/.output/public/_nuxt/DHCkPAjA.js +1 -0
  217. package/.output/public/_nuxt/DHJKELXO.js +1 -0
  218. package/.output/public/_nuxt/DHQR4-dF.js +1 -0
  219. package/.output/public/_nuxt/DJjDtW9f.js +1 -0
  220. package/.output/public/_nuxt/DM8c43g1.js +1 -0
  221. package/.output/public/_nuxt/DMwsHuHA.js +1 -0
  222. package/.output/public/_nuxt/DMzUqQB5.js +1 -0
  223. package/.output/public/_nuxt/DPfMkruS.js +1 -0
  224. package/.output/public/_nuxt/DQwYQDb2.js +1 -0
  225. package/.output/public/_nuxt/DQyhUUbL.js +1 -0
  226. package/.output/public/_nuxt/DRg8JJMk.js +1 -0
  227. package/.output/public/_nuxt/DRw_LuNl.js +1 -0
  228. package/.output/public/_nuxt/DU1UobuO.js +1 -0
  229. package/.output/public/_nuxt/DUszq2jm.js +1 -0
  230. package/.output/public/_nuxt/DV7GczEv.js +1 -0
  231. package/.output/public/_nuxt/DVFEvuxE.js +1 -0
  232. package/.output/public/_nuxt/DVMEJ2y_.js +1 -0
  233. package/.output/public/_nuxt/DVxCFoDh.js +1 -0
  234. package/.output/public/_nuxt/DWedfzmr.js +1 -0
  235. package/.output/public/_nuxt/DWrx1Km3.js +1 -0
  236. package/.output/public/_nuxt/DXbdFlpD.js +1 -0
  237. package/.output/public/_nuxt/DXmwc3jG.js +1 -0
  238. package/.output/public/_nuxt/DXvB9xmW.js +1 -0
  239. package/.output/public/_nuxt/DYoxhk2S.js +1 -0
  240. package/.output/public/_nuxt/DZf3V79B.js +1 -0
  241. package/.output/public/_nuxt/DZu-aV2c.js +1 -0
  242. package/.output/public/_nuxt/DZxFcAj9.js +1 -0
  243. package/.output/public/_nuxt/D_Q5rh1f.js +1 -0
  244. package/.output/public/_nuxt/Da5cRb03.js +1 -0
  245. package/.output/public/_nuxt/DcaNXYhu.js +1 -0
  246. package/.output/public/_nuxt/Dd19v3D-.js +1 -0
  247. package/.output/public/_nuxt/DdkO51Og.js +1 -0
  248. package/.output/public/_nuxt/Ddv68eIx.js +1 -0
  249. package/.output/public/_nuxt/Des-eS-w.js +1 -0
  250. package/.output/public/_nuxt/Df6bDoY_.js +1 -0
  251. package/.output/public/_nuxt/Dg5xB15N.js +1 -0
  252. package/.output/public/_nuxt/DhmSosst.js +1 -0
  253. package/.output/public/_nuxt/DkFqJrB1.js +1 -0
  254. package/.output/public/_nuxt/DkwncUOv.js +1 -0
  255. package/.output/public/_nuxt/DlAUqK2U.js +1 -0
  256. package/.output/public/_nuxt/DnULxvSX.js +1 -0
  257. package/.output/public/_nuxt/Dpen1YoG.js +1 -0
  258. package/.output/public/_nuxt/Dph4kLrZ.js +1 -0
  259. package/.output/public/_nuxt/DqQDbK_p.js +1 -0
  260. package/.output/public/_nuxt/DqwNpetd.js +1 -0
  261. package/.output/public/_nuxt/DsOJ9woJ.js +1 -0
  262. package/.output/public/_nuxt/Dspwwk_N.js +1 -0
  263. package/.output/public/_nuxt/DsumFeuD.js +1 -0
  264. package/.output/public/_nuxt/Dv7Oe6Be.js +1 -0
  265. package/.output/public/_nuxt/Dx-B1_4e.js +1 -0
  266. package/.output/public/_nuxt/DxNHbxmM.js +1 -0
  267. package/.output/public/_nuxt/DxSwrfjg.js +1 -0
  268. package/.output/public/_nuxt/DyxjwDmM.js +1 -0
  269. package/.output/public/_nuxt/Dzze3sRP.js +1 -0
  270. package/.output/public/_nuxt/E3gJ1_iC.js +1 -0
  271. package/.output/public/_nuxt/GsRaNv29.js +1 -0
  272. package/.output/public/_nuxt/IF9eRakj.js +1 -0
  273. package/.output/public/_nuxt/IeuSbFQv.js +1 -0
  274. package/.output/public/_nuxt/KNuzSjk0.js +1 -0
  275. package/.output/public/_nuxt/L9t79GZl.js +1 -0
  276. package/.output/public/_nuxt/MzD3tlZU.js +1 -0
  277. package/.output/public/_nuxt/P80f7IUj.js +1 -0
  278. package/.output/public/_nuxt/Pmp26Uib.js +1 -0
  279. package/.output/public/_nuxt/QIJgUcNo.js +1 -0
  280. package/.output/public/_nuxt/RNghxpo_.js +1 -0
  281. package/.output/public/_nuxt/TsXTqZ29.js +1 -0
  282. package/.output/public/_nuxt/VCDPK7BO.js +1 -0
  283. package/.output/public/_nuxt/VOosw3JB.js +1 -0
  284. package/.output/public/_nuxt/W9tJ9s81.js +1 -0
  285. package/.output/public/_nuxt/YqXBG_HV.js +1 -0
  286. package/.output/public/_nuxt/Yzrsuije.js +1 -0
  287. package/.output/public/_nuxt/_ykCGR6B.js +1 -0
  288. package/.output/public/_nuxt/bCR0ucgS.js +1 -0
  289. package/.output/public/_nuxt/bN70gL4F.js +1 -0
  290. package/.output/public/_nuxt/builds/latest.json +1 -0
  291. package/.output/public/_nuxt/builds/meta/21578a05-1b7e-4847-a8ff-7480800ea4a6.json +1 -0
  292. package/.output/public/_nuxt/default.DcjOo57q.css +1 -0
  293. package/.output/public/_nuxt/dwOrl1Do.js +1 -0
  294. package/.output/public/_nuxt/entry.CFLOfmis.css +1 -0
  295. package/.output/public/_nuxt/error-404.DuOyHzDc.css +1 -0
  296. package/.output/public/_nuxt/error-500.MhEffcqa.css +1 -0
  297. package/.output/public/_nuxt/fKv21gyL.js +1 -0
  298. package/.output/public/_nuxt/fuZLfV_i.js +1 -0
  299. package/.output/public/_nuxt/g9-lgVsj.js +1 -0
  300. package/.output/public/_nuxt/gcz8RCvz.js +1 -0
  301. package/.output/public/_nuxt/hJgmCMqR.js +1 -0
  302. package/.output/public/_nuxt/hegEt444.js +1 -0
  303. package/.output/public/_nuxt/k_qm7-4y.js +1 -0
  304. package/.output/public/_nuxt/lXgVvXCa.js +1 -0
  305. package/.output/public/_nuxt/m17aaUwq.js +1 -0
  306. package/.output/public/_nuxt/mWjccvbQ.js +1 -0
  307. package/.output/public/_nuxt/mjskCLCv.js +1 -0
  308. package/.output/public/_nuxt/n2N0HUVH.js +1 -0
  309. package/.output/public/_nuxt/qdsjHGoJ.js +1 -0
  310. package/.output/public/_nuxt/rGO070M0.js +1 -0
  311. package/.output/public/_nuxt/u5AG7uiY.js +1 -0
  312. package/.output/public/_nuxt/uYugtg8r.js +1 -0
  313. package/.output/public/_nuxt/vGWfd6FD.js +1 -0
  314. package/.output/public/_nuxt/wDzz0qaB.js +1 -0
  315. package/.output/public/_nuxt/yv6CvBhz.js +1 -0
  316. package/.output/public/app-logo.svg +1 -0
  317. package/.output/server/chunks/_/chat.mjs +9 -0
  318. package/.output/server/chunks/_/chat.mjs.map +1 -0
  319. package/.output/server/chunks/_/claudeProvider.mjs +159 -0
  320. package/.output/server/chunks/_/claudeProvider.mjs.map +1 -0
  321. package/.output/server/chunks/_/codexProvider.mjs +757 -0
  322. package/.output/server/chunks/_/codexProvider.mjs.map +1 -0
  323. package/.output/server/chunks/_/error-500.mjs +19 -0
  324. package/.output/server/chunks/_/error-500.mjs.map +1 -0
  325. package/.output/server/chunks/_/git.mjs +707 -0
  326. package/.output/server/chunks/_/git.mjs.map +1 -0
  327. package/.output/server/chunks/_/git2.mjs +33 -0
  328. package/.output/server/chunks/_/git2.mjs.map +1 -0
  329. package/.output/server/chunks/_/providerProcessError.mjs +119 -0
  330. package/.output/server/chunks/_/providerProcessError.mjs.map +1 -0
  331. package/.output/server/chunks/_/validateWorktree.mjs +19 -0
  332. package/.output/server/chunks/_/validateWorktree.mjs.map +1 -0
  333. package/.output/server/chunks/build/client.precomputed.mjs +4 -0
  334. package/.output/server/chunks/build/client.precomputed.mjs.map +1 -0
  335. package/.output/server/chunks/nitro/nitro.mjs +15584 -0
  336. package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
  337. package/.output/server/chunks/routes/_ws.mjs +575 -0
  338. package/.output/server/chunks/routes/_ws.mjs.map +1 -0
  339. package/.output/server/chunks/routes/api/ai/providers.get.mjs +34 -0
  340. package/.output/server/chunks/routes/api/ai/providers.get.mjs.map +1 -0
  341. package/.output/server/chunks/routes/api/auto-mode/status.get.mjs +35 -0
  342. package/.output/server/chunks/routes/api/auto-mode/status.get.mjs.map +1 -0
  343. package/.output/server/chunks/routes/api/auto-mode/toggle.post.mjs +45 -0
  344. package/.output/server/chunks/routes/api/auto-mode/toggle.post.mjs.map +1 -0
  345. package/.output/server/chunks/routes/api/chat/compare.get.mjs +70 -0
  346. package/.output/server/chunks/routes/api/chat/compare.get.mjs.map +1 -0
  347. package/.output/server/chunks/routes/api/chat/context.get.mjs +147 -0
  348. package/.output/server/chunks/routes/api/chat/context.get.mjs.map +1 -0
  349. package/.output/server/chunks/routes/api/chat/finalize.post.mjs +173 -0
  350. package/.output/server/chunks/routes/api/chat/finalize.post.mjs.map +1 -0
  351. package/.output/server/chunks/routes/api/chat/generate-commit-message.post.mjs +92 -0
  352. package/.output/server/chunks/routes/api/chat/generate-commit-message.post.mjs.map +1 -0
  353. package/.output/server/chunks/routes/api/chat/preview-sync.post.mjs +59 -0
  354. package/.output/server/chunks/routes/api/chat/preview-sync.post.mjs.map +1 -0
  355. package/.output/server/chunks/routes/api/chat/preview.delete.mjs +63 -0
  356. package/.output/server/chunks/routes/api/chat/preview.delete.mjs.map +1 -0
  357. package/.output/server/chunks/routes/api/chat/preview.post.mjs +91 -0
  358. package/.output/server/chunks/routes/api/chat/preview.post.mjs.map +1 -0
  359. package/.output/server/chunks/routes/api/chat/rebase.post.mjs +109 -0
  360. package/.output/server/chunks/routes/api/chat/rebase.post.mjs.map +1 -0
  361. package/.output/server/chunks/routes/api/chat/worktree-commit.post.mjs +69 -0
  362. package/.output/server/chunks/routes/api/chat/worktree-commit.post.mjs.map +1 -0
  363. package/.output/server/chunks/routes/api/chat/worktree.delete.mjs +72 -0
  364. package/.output/server/chunks/routes/api/chat/worktree.delete.mjs.map +1 -0
  365. package/.output/server/chunks/routes/api/chat/worktree.post.mjs +99 -0
  366. package/.output/server/chunks/routes/api/chat/worktree.post.mjs.map +1 -0
  367. package/.output/server/chunks/routes/api/chat.post.mjs +217 -0
  368. package/.output/server/chunks/routes/api/chat.post.mjs.map +1 -0
  369. package/.output/server/chunks/routes/api/conversations/_conversationId/archive.post.mjs +119 -0
  370. package/.output/server/chunks/routes/api/conversations/_conversationId/archive.post.mjs.map +1 -0
  371. package/.output/server/chunks/routes/api/conversations/archives/_archiveId/restore.post.mjs +125 -0
  372. package/.output/server/chunks/routes/api/conversations/archives/_archiveId/restore.post.mjs.map +1 -0
  373. package/.output/server/chunks/routes/api/conversations/archives/_archiveId_.delete.mjs +56 -0
  374. package/.output/server/chunks/routes/api/conversations/archives/_archiveId_.delete.mjs.map +1 -0
  375. package/.output/server/chunks/routes/api/conversations/archives.get.mjs +54 -0
  376. package/.output/server/chunks/routes/api/conversations/archives.get.mjs.map +1 -0
  377. package/.output/server/chunks/routes/api/conversations.get.mjs +33 -0
  378. package/.output/server/chunks/routes/api/conversations.get.mjs.map +1 -0
  379. package/.output/server/chunks/routes/api/conversations.post.mjs +45 -0
  380. package/.output/server/chunks/routes/api/conversations.post.mjs.map +1 -0
  381. package/.output/server/chunks/routes/api/cwd.get.mjs +34 -0
  382. package/.output/server/chunks/routes/api/cwd.get.mjs.map +1 -0
  383. package/.output/server/chunks/routes/api/git/branch-rename.post.mjs +91 -0
  384. package/.output/server/chunks/routes/api/git/branch-rename.post.mjs.map +1 -0
  385. package/.output/server/chunks/routes/api/git/branch.delete.mjs +108 -0
  386. package/.output/server/chunks/routes/api/git/branch.delete.mjs.map +1 -0
  387. package/.output/server/chunks/routes/api/git/branches.get.mjs +115 -0
  388. package/.output/server/chunks/routes/api/git/branches.get.mjs.map +1 -0
  389. package/.output/server/chunks/routes/api/git/checkout.post.mjs +110 -0
  390. package/.output/server/chunks/routes/api/git/checkout.post.mjs.map +1 -0
  391. package/.output/server/chunks/routes/api/git/cherry-pick.post.mjs +79 -0
  392. package/.output/server/chunks/routes/api/git/cherry-pick.post.mjs.map +1 -0
  393. package/.output/server/chunks/routes/api/git/clean.post.mjs +65 -0
  394. package/.output/server/chunks/routes/api/git/clean.post.mjs.map +1 -0
  395. package/.output/server/chunks/routes/api/git/commit/_id_.get.mjs +63 -0
  396. package/.output/server/chunks/routes/api/git/commit/_id_.get.mjs.map +1 -0
  397. package/.output/server/chunks/routes/api/git/commit.post.mjs +95 -0
  398. package/.output/server/chunks/routes/api/git/commit.post.mjs.map +1 -0
  399. package/.output/server/chunks/routes/api/git/diff.get.mjs +83 -0
  400. package/.output/server/chunks/routes/api/git/diff.get.mjs.map +1 -0
  401. package/.output/server/chunks/routes/api/git/fetch.post.mjs +82 -0
  402. package/.output/server/chunks/routes/api/git/fetch.post.mjs.map +1 -0
  403. package/.output/server/chunks/routes/api/git/file-diff.get.mjs +84 -0
  404. package/.output/server/chunks/routes/api/git/file-diff.get.mjs.map +1 -0
  405. package/.output/server/chunks/routes/api/git/graph.get.mjs +146 -0
  406. package/.output/server/chunks/routes/api/git/graph.get.mjs.map +1 -0
  407. package/.output/server/chunks/routes/api/git/log.get.mjs +166 -0
  408. package/.output/server/chunks/routes/api/git/log.get.mjs.map +1 -0
  409. package/.output/server/chunks/routes/api/git/merge-base.get.mjs +105 -0
  410. package/.output/server/chunks/routes/api/git/merge-base.get.mjs.map +1 -0
  411. package/.output/server/chunks/routes/api/git/merge.post.mjs +91 -0
  412. package/.output/server/chunks/routes/api/git/merge.post.mjs.map +1 -0
  413. package/.output/server/chunks/routes/api/git/pull.post.mjs +86 -0
  414. package/.output/server/chunks/routes/api/git/pull.post.mjs.map +1 -0
  415. package/.output/server/chunks/routes/api/git/push.post.mjs +91 -0
  416. package/.output/server/chunks/routes/api/git/push.post.mjs.map +1 -0
  417. package/.output/server/chunks/routes/api/git/rebase.post.mjs +82 -0
  418. package/.output/server/chunks/routes/api/git/rebase.post.mjs.map +1 -0
  419. package/.output/server/chunks/routes/api/git/remote.delete.mjs +70 -0
  420. package/.output/server/chunks/routes/api/git/remote.delete.mjs.map +1 -0
  421. package/.output/server/chunks/routes/api/git/remote.post.mjs +76 -0
  422. package/.output/server/chunks/routes/api/git/remote.post.mjs.map +1 -0
  423. package/.output/server/chunks/routes/api/git/remote.put.mjs +79 -0
  424. package/.output/server/chunks/routes/api/git/remote.put.mjs.map +1 -0
  425. package/.output/server/chunks/routes/api/git/remotes.get.mjs +63 -0
  426. package/.output/server/chunks/routes/api/git/remotes.get.mjs.map +1 -0
  427. package/.output/server/chunks/routes/api/git/reset.post.mjs +83 -0
  428. package/.output/server/chunks/routes/api/git/reset.post.mjs.map +1 -0
  429. package/.output/server/chunks/routes/api/git/revert.post.mjs +76 -0
  430. package/.output/server/chunks/routes/api/git/revert.post.mjs.map +1 -0
  431. package/.output/server/chunks/routes/api/git/show.get.mjs +82 -0
  432. package/.output/server/chunks/routes/api/git/show.get.mjs.map +1 -0
  433. package/.output/server/chunks/routes/api/git/stage.post.mjs +73 -0
  434. package/.output/server/chunks/routes/api/git/stage.post.mjs.map +1 -0
  435. package/.output/server/chunks/routes/api/git/stash-apply.post.mjs +74 -0
  436. package/.output/server/chunks/routes/api/git/stash-apply.post.mjs.map +1 -0
  437. package/.output/server/chunks/routes/api/git/stash-branch.post.mjs +80 -0
  438. package/.output/server/chunks/routes/api/git/stash-branch.post.mjs.map +1 -0
  439. package/.output/server/chunks/routes/api/git/stash-drop.post.mjs +71 -0
  440. package/.output/server/chunks/routes/api/git/stash-drop.post.mjs.map +1 -0
  441. package/.output/server/chunks/routes/api/git/stash-pop.post.mjs +74 -0
  442. package/.output/server/chunks/routes/api/git/stash-pop.post.mjs.map +1 -0
  443. package/.output/server/chunks/routes/api/git/stash.get.mjs +62 -0
  444. package/.output/server/chunks/routes/api/git/stash.get.mjs.map +1 -0
  445. package/.output/server/chunks/routes/api/git/stash.post.mjs +71 -0
  446. package/.output/server/chunks/routes/api/git/stash.post.mjs.map +1 -0
  447. package/.output/server/chunks/routes/api/git/state.get.mjs +70 -0
  448. package/.output/server/chunks/routes/api/git/state.get.mjs.map +1 -0
  449. package/.output/server/chunks/routes/api/git/status.get.mjs +121 -0
  450. package/.output/server/chunks/routes/api/git/status.get.mjs.map +1 -0
  451. package/.output/server/chunks/routes/api/git/tag/_name_.get.mjs +70 -0
  452. package/.output/server/chunks/routes/api/git/tag/_name_.get.mjs.map +1 -0
  453. package/.output/server/chunks/routes/api/git/tag-push.post.mjs +73 -0
  454. package/.output/server/chunks/routes/api/git/tag-push.post.mjs.map +1 -0
  455. package/.output/server/chunks/routes/api/git/tag.delete.mjs +76 -0
  456. package/.output/server/chunks/routes/api/git/tag.delete.mjs.map +1 -0
  457. package/.output/server/chunks/routes/api/git/tag.post.mjs +87 -0
  458. package/.output/server/chunks/routes/api/git/tag.post.mjs.map +1 -0
  459. package/.output/server/chunks/routes/api/git/unstage.post.mjs +74 -0
  460. package/.output/server/chunks/routes/api/git/unstage.post.mjs.map +1 -0
  461. package/.output/server/chunks/routes/api/index.get.mjs +41 -0
  462. package/.output/server/chunks/routes/api/index.get.mjs.map +1 -0
  463. package/.output/server/chunks/routes/api/index.get2.mjs +168 -0
  464. package/.output/server/chunks/routes/api/index.get2.mjs.map +1 -0
  465. package/.output/server/chunks/routes/api/index.post.mjs +150 -0
  466. package/.output/server/chunks/routes/api/index.post.mjs.map +1 -0
  467. package/.output/server/chunks/routes/api/rebase/abort.post.mjs +49 -0
  468. package/.output/server/chunks/routes/api/rebase/abort.post.mjs.map +1 -0
  469. package/.output/server/chunks/routes/api/rebase/ai-resolve.post.mjs +79 -0
  470. package/.output/server/chunks/routes/api/rebase/ai-resolve.post.mjs.map +1 -0
  471. package/.output/server/chunks/routes/api/rebase/conflicts.get.mjs +69 -0
  472. package/.output/server/chunks/routes/api/rebase/conflicts.get.mjs.map +1 -0
  473. package/.output/server/chunks/routes/api/rebase/continue-sync.post.mjs +76 -0
  474. package/.output/server/chunks/routes/api/rebase/continue-sync.post.mjs.map +1 -0
  475. package/.output/server/chunks/routes/api/rebase/continue.post.mjs +136 -0
  476. package/.output/server/chunks/routes/api/rebase/continue.post.mjs.map +1 -0
  477. package/.output/server/chunks/routes/api/rebase/resolve.put.mjs +52 -0
  478. package/.output/server/chunks/routes/api/rebase/resolve.put.mjs.map +1 -0
  479. package/.output/server/chunks/routes/api/repository/status.get.mjs +132 -0
  480. package/.output/server/chunks/routes/api/repository/status.get.mjs.map +1 -0
  481. package/.output/server/chunks/routes/api/settings.get.mjs +54 -0
  482. package/.output/server/chunks/routes/api/settings.get.mjs.map +1 -0
  483. package/.output/server/chunks/routes/api/settings.post.mjs +49 -0
  484. package/.output/server/chunks/routes/api/settings.post.mjs.map +1 -0
  485. package/.output/server/chunks/routes/api/skills/_skillId/prompt.post.mjs +64 -0
  486. package/.output/server/chunks/routes/api/skills/_skillId/prompt.post.mjs.map +1 -0
  487. package/.output/server/chunks/routes/api/specs/_featureId/_...filename_.get.mjs +61 -0
  488. package/.output/server/chunks/routes/api/specs/_featureId/_...filename_.get.mjs.map +1 -0
  489. package/.output/server/chunks/routes/api/specs/_featureId/_...filename_.put.mjs +65 -0
  490. package/.output/server/chunks/routes/api/specs/_featureId/_...filename_.put.mjs.map +1 -0
  491. package/.output/server/chunks/routes/api/specs/features.get.mjs +110 -0
  492. package/.output/server/chunks/routes/api/specs/features.get.mjs.map +1 -0
  493. package/.output/server/chunks/routes/api/specs/reindex.post.mjs +43 -0
  494. package/.output/server/chunks/routes/api/specs/reindex.post.mjs.map +1 -0
  495. package/.output/server/chunks/routes/api/specs/search.get.mjs +72 -0
  496. package/.output/server/chunks/routes/api/specs/search.get.mjs.map +1 -0
  497. package/.output/server/chunks/routes/api/specs/status.get.mjs +32 -0
  498. package/.output/server/chunks/routes/api/specs/status.get.mjs.map +1 -0
  499. package/.output/server/chunks/routes/api/worktrees/_name/switch.post.mjs +77 -0
  500. package/.output/server/chunks/routes/api/worktrees/_name/switch.post.mjs.map +1 -0
  501. package/.output/server/chunks/routes/api/worktrees/_name_.delete.mjs +99 -0
  502. package/.output/server/chunks/routes/api/worktrees/_name_.delete.mjs.map +1 -0
  503. package/.output/server/chunks/routes/auto-mode-ws.mjs +65 -0
  504. package/.output/server/chunks/routes/auto-mode-ws.mjs.map +1 -0
  505. package/.output/server/chunks/routes/git-watcher-ws.mjs +155 -0
  506. package/.output/server/chunks/routes/git-watcher-ws.mjs.map +1 -0
  507. package/.output/server/chunks/routes/renderer.mjs +417 -0
  508. package/.output/server/chunks/routes/renderer.mjs.map +1 -0
  509. package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
  510. package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
  511. package/.output/server/index.mjs +26 -0
  512. package/.output/server/index.mjs.map +1 -0
  513. package/.output/server/node_modules/@babel/parser/lib/index.js +14582 -0
  514. package/.output/server/node_modules/@babel/parser/package.json +50 -0
  515. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6763 -0
  516. package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
  517. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
  518. package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
  519. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
  520. package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
  521. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1868 -0
  522. package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
  523. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6770 -0
  524. package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
  525. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1732 -0
  526. package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
  527. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +879 -0
  528. package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
  529. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +604 -0
  530. package/.output/server/node_modules/@vue/shared/package.json +47 -0
  531. package/.output/server/node_modules/chokidar/handler.js +632 -0
  532. package/.output/server/node_modules/chokidar/index.js +822 -0
  533. package/.output/server/node_modules/chokidar/package.json +63 -0
  534. package/.output/server/node_modules/devalue/index.js +4 -0
  535. package/.output/server/node_modules/devalue/package.json +37 -0
  536. package/.output/server/node_modules/devalue/src/base64.js +110 -0
  537. package/.output/server/node_modules/devalue/src/constants.js +6 -0
  538. package/.output/server/node_modules/devalue/src/parse.js +234 -0
  539. package/.output/server/node_modules/devalue/src/stringify.js +265 -0
  540. package/.output/server/node_modules/devalue/src/uneval.js +407 -0
  541. package/.output/server/node_modules/devalue/src/utils.js +118 -0
  542. package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  543. package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
  544. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
  545. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
  546. package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
  547. package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
  548. package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
  549. package/.output/server/node_modules/entities/package.json +120 -0
  550. package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
  551. package/.output/server/node_modules/estree-walker/package.json +37 -0
  552. package/.output/server/node_modules/hookable/dist/index.mjs +266 -0
  553. package/.output/server/node_modules/hookable/package.json +52 -0
  554. package/.output/server/node_modules/readdirp/index.js +272 -0
  555. package/.output/server/node_modules/readdirp/package.json +66 -0
  556. package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
  557. package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  558. package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
  559. package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
  560. package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
  561. package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
  562. package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  563. package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  564. package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
  565. package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
  566. package/.output/server/node_modules/source-map-js/package.json +71 -0
  567. package/.output/server/node_modules/source-map-js/source-map.js +8 -0
  568. package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
  569. package/.output/server/node_modules/ufo/package.json +48 -0
  570. package/.output/server/node_modules/unhead/dist/parser.mjs +508 -0
  571. package/.output/server/node_modules/unhead/dist/plugins.mjs +101 -0
  572. package/.output/server/node_modules/unhead/dist/server.mjs +180 -0
  573. package/.output/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
  574. package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
  575. package/.output/server/node_modules/unhead/dist/shared/unhead.CGCfDSEL.mjs +180 -0
  576. package/.output/server/node_modules/unhead/dist/shared/unhead.CYpwL2hc.mjs +194 -0
  577. package/.output/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
  578. package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
  579. package/.output/server/node_modules/unhead/dist/shared/unhead.ckV6dpEQ.mjs +166 -0
  580. package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
  581. package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
  582. package/.output/server/node_modules/unhead/package.json +105 -0
  583. package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
  584. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
  585. package/.output/server/node_modules/vue/index.js +7 -0
  586. package/.output/server/node_modules/vue/index.mjs +1 -0
  587. package/.output/server/node_modules/vue/package.json +112 -0
  588. package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
  589. package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +301 -0
  590. package/.output/server/node_modules/vue-bundle-renderer/package.json +55 -0
  591. package/.output/server/node_modules/yaml/dist/compose/compose-collection.js +90 -0
  592. package/.output/server/node_modules/yaml/dist/compose/compose-doc.js +45 -0
  593. package/.output/server/node_modules/yaml/dist/compose/compose-node.js +105 -0
  594. package/.output/server/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
  595. package/.output/server/node_modules/yaml/dist/compose/composer.js +222 -0
  596. package/.output/server/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
  597. package/.output/server/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
  598. package/.output/server/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
  599. package/.output/server/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  600. package/.output/server/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
  601. package/.output/server/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
  602. package/.output/server/node_modules/yaml/dist/compose/resolve-props.js +148 -0
  603. package/.output/server/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  604. package/.output/server/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
  605. package/.output/server/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  606. package/.output/server/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
  607. package/.output/server/node_modules/yaml/dist/doc/Document.js +337 -0
  608. package/.output/server/node_modules/yaml/dist/doc/anchors.js +76 -0
  609. package/.output/server/node_modules/yaml/dist/doc/applyReviver.js +57 -0
  610. package/.output/server/node_modules/yaml/dist/doc/createNode.js +90 -0
  611. package/.output/server/node_modules/yaml/dist/doc/directives.js +178 -0
  612. package/.output/server/node_modules/yaml/dist/errors.js +62 -0
  613. package/.output/server/node_modules/yaml/dist/index.js +50 -0
  614. package/.output/server/node_modules/yaml/dist/log.js +19 -0
  615. package/.output/server/node_modules/yaml/dist/nodes/Alias.js +116 -0
  616. package/.output/server/node_modules/yaml/dist/nodes/Collection.js +151 -0
  617. package/.output/server/node_modules/yaml/dist/nodes/Node.js +40 -0
  618. package/.output/server/node_modules/yaml/dist/nodes/Pair.js +39 -0
  619. package/.output/server/node_modules/yaml/dist/nodes/Scalar.js +27 -0
  620. package/.output/server/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
  621. package/.output/server/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
  622. package/.output/server/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
  623. package/.output/server/node_modules/yaml/dist/nodes/identity.js +53 -0
  624. package/.output/server/node_modules/yaml/dist/nodes/toJS.js +39 -0
  625. package/.output/server/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
  626. package/.output/server/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  627. package/.output/server/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  628. package/.output/server/node_modules/yaml/dist/parse/cst.js +112 -0
  629. package/.output/server/node_modules/yaml/dist/parse/lexer.js +719 -0
  630. package/.output/server/node_modules/yaml/dist/parse/line-counter.js +41 -0
  631. package/.output/server/node_modules/yaml/dist/parse/parser.js +972 -0
  632. package/.output/server/node_modules/yaml/dist/public-api.js +107 -0
  633. package/.output/server/node_modules/yaml/dist/schema/Schema.js +39 -0
  634. package/.output/server/node_modules/yaml/dist/schema/common/map.js +19 -0
  635. package/.output/server/node_modules/yaml/dist/schema/common/null.js +17 -0
  636. package/.output/server/node_modules/yaml/dist/schema/common/seq.js +19 -0
  637. package/.output/server/node_modules/yaml/dist/schema/common/string.js +16 -0
  638. package/.output/server/node_modules/yaml/dist/schema/core/bool.js +21 -0
  639. package/.output/server/node_modules/yaml/dist/schema/core/float.js +47 -0
  640. package/.output/server/node_modules/yaml/dist/schema/core/int.js +42 -0
  641. package/.output/server/node_modules/yaml/dist/schema/core/schema.js +25 -0
  642. package/.output/server/node_modules/yaml/dist/schema/json/schema.js +64 -0
  643. package/.output/server/node_modules/yaml/dist/schema/tags.js +99 -0
  644. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
  645. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  646. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  647. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  648. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/merge.js +68 -0
  649. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
  650. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
  651. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
  652. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
  653. package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  654. package/.output/server/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
  655. package/.output/server/node_modules/yaml/dist/stringify/stringify.js +131 -0
  656. package/.output/server/node_modules/yaml/dist/stringify/stringifyCollection.js +145 -0
  657. package/.output/server/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
  658. package/.output/server/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
  659. package/.output/server/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
  660. package/.output/server/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
  661. package/.output/server/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
  662. package/.output/server/node_modules/yaml/dist/visit.js +236 -0
  663. package/.output/server/node_modules/yaml/package.json +97 -0
  664. package/.output/server/package.json +29 -0
  665. package/README.md +136 -0
  666. package/bin/spec-cat.js +80 -0
  667. package/package.json +82 -0
@@ -0,0 +1,126 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BUOk7wkI.js","./BwcbSlWF.js","./entry.CFLOfmis.css","./DBab5Zcv.js"])))=>i.map(i=>d[i]);
2
+ import{y as i,z as d,A as o,d as Ce,C as Y,G as s,P as Me,R as ut,Q as Ie,S as he,E as ke,B as T,O as P,g as S,U as Be,V as ln,k as H,W as Nt,H as ve,L as ie,o as st,X as _t,Y as Ts,K as Ae,Z as cn,T as Jt,_ as Rn,M as $n,D as Ge,N as lt,$ as As,I as po,a0 as ge,a1 as Bn,a2 as Pt,a3 as _n,a4 as Lo,a5 as Bs,a6 as Io,a7 as gr,a8 as Rs,a9 as Es,x as Ps}from"./BwcbSlWF.js";import{r as ht,c as un,b as vo,a as xn}from"./COTT6rNZ.js";import{_ as Ko}from"./DlAUqK2U.js";import{S as No,i as Ds,c as Ls,P as Is,W as xr,M as br,d as yr,e as kr,g as uo,f as Ur,D as jr,h as zr,j as Ns,u as Kn,b as Dn,k as gn,l as Fs,m as An,n as to,a as wr,_ as Hs}from"./BUOk7wkI.js";function Os(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"})])}function Us(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function Fo(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function js(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25"})])}function zs(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"})])}function Vs(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})])}function Vr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3"})])}function Wr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"})])}function Gr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3"})])}function qr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})])}function Zr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})])}function Kr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})])}function Ws(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.75 3.104v5.714a2.25 2.25 0 0 1-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 0 1 4.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0 1 12 15a9.065 9.065 0 0 0-6.23-.693L5 14.5m14.8.8 1.402 1.402c1.232 1.232.65 3.318-1.067 3.611A48.309 48.309 0 0 1 12 21c-2.773 0-5.491-.235-8.135-.687-1.718-.293-2.3-2.379-1.067-3.61L5 14.5"})])}function Yo(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"})])}function Gs(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"})])}function qs(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"})])}function Zs(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})])}function Yr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})])}function go(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Xo(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"})])}function Ks(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})])}function Qo(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})])}function Jo(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"})])}function Ys(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})])}function er(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})])}function En(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"})])}function Xr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Qr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9.75v6.75m0 0-3-3m3 3 3-3m-8.25 6a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"})])}function Ho(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})])}function Jr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function Xs(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})])}function es(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})])}function Qs(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"})])}function Js(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"})])}function ea(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"})])}function qn(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})])}function Ln(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})])}function Cn(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})])}function ta(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"})])}function ts(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function na(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"})])}function Oo(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})])}function oa(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})])}function ra(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"})])}function sa(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"})])}function aa(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})])}function ns(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0ZM3.75 12h.007v.008H3.75V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm-.375 5.25h.007v.008H3.75v-.008Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})])}function Zn(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})])}function ia(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 12h14"})])}function la(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})])}function tr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"})])}function os(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"})])}function ca(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})])}function Cr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})])}function nr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})])}function rs(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})])}function or(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m0-10.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.75c0 5.592 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.57-.598-3.75h-.152c-3.196 0-6.1-1.25-8.25-3.286Zm0 13.036h.008v.008H12v-.008Z"})])}function xo(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})])}function ua(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})])}function rr(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}),o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 6h.008v.008H6V6Z"})])}function Uo(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})])}function da(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})])}const fa={class:"flex items-center gap-1.5 px-2 py-1.5 bg-retro-panel border-b border-retro-border"},ma={class:"relative flex-1 min-w-0"},ha={key:0,class:"text-[11px] text-retro-muted flex-shrink-0 min-w-[60px] text-center"},pa=["disabled"],va=["disabled"],ga=Ce({__name:"GitFindWidget",props:{resultCount:{},currentIndex:{}},emits:["search","next","prev","close"],setup(e,{expose:n,emit:t}){const a=t,r=S(""),l=S(null);let c=null;function f(){c&&clearTimeout(c),c=setTimeout(()=>{a("search",r.value)},200)}function h(y){y.key==="Escape"?(y.preventDefault(),a("close")):y.key==="Enter"&&(y.preventDefault(),y.shiftKey?a("prev"):a("next"))}function m(){l.value?.focus(),l.value?.select()}return n({focus:m}),(y,C)=>(i(),d("div",fa,[Y(s(Zn),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),o("div",ma,[Me(o("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":C[0]||(C[0]=x=>Ie(r)?r.value=x:null),type:"text",placeholder:"Find in commits... (Ctrl+F)","aria-label":"Search commits",class:"w-full px-2 py-1 text-sm bg-retro-dark border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",onInput:f,onKeydown:h},null,544),[[ut,s(r)]])]),s(r)?(i(),d("span",ha,[e.resultCount>0?(i(),d(he,{key:0},[ke(T(e.currentIndex+1)+" of "+T(e.resultCount),1)],64)):(i(),d(he,{key:1},[ke(" No results ")],64))])):P("",!0),o("button",{class:"p-0.5 text-retro-muted hover:text-retro-text disabled:opacity-30 disabled:cursor-not-allowed transition-colors",disabled:e.resultCount===0,"aria-label":"Previous result",title:"Previous (Shift+Enter)",onClick:C[1]||(C[1]=x=>a("prev"))},[Y(s(Ys),{class:"w-4 h-4"})],8,pa),o("button",{class:"p-0.5 text-retro-muted hover:text-retro-text disabled:opacity-30 disabled:cursor-not-allowed transition-colors",disabled:e.resultCount===0,"aria-label":"Next result",title:"Next (Enter)",onClick:C[2]||(C[2]=x=>a("next"))},[Y(s(Ks),{class:"w-4 h-4"})],8,va),o("button",{class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors","aria-label":"Close find widget",title:"Close (Escape)",onClick:C[3]||(C[3]=x=>a("close"))},[Y(s(ht),{class:"w-4 h-4"})])]))}}),xa={class:"flex flex-col bg-retro-dark border border-retro-border rounded shadow-lg max-w-md w-full"},ba={class:"flex items-center justify-between px-3 py-2 border-b border-retro-border"},ya={class:"flex-1 overflow-auto max-h-[300px]"},ka={class:"font-semibold text-retro-cyan flex-shrink-0 min-w-[60px]"},wa=["onKeyup"],Ca=["onClick"],$a={class:"text-retro-muted truncate flex-1 font-mono"},Sa=["onClick"],_a=["onClick"],Ma={key:0,class:"px-3 py-4 text-center text-retro-muted text-xs"},Ta={key:0,class:"px-3 py-2 border-t border-retro-border space-y-2"},Aa={class:"flex gap-2 justify-end"},Ba=["disabled"],Ra={key:1,class:"px-3 py-2 border-t border-retro-border"},Ea=Ce({__name:"GitRemoteManager",props:{remotes:{},loading:{type:Boolean}},emits:["add","edit","delete","close"],setup(e,{emit:n}){const t=n,a=S(!1),r=S(""),l=S(""),c=S(null),f=S("");function h(){a.value=!0,r.value="",l.value=""}function m(){!r.value.trim()||!l.value.trim()||(t("add",{name:r.value.trim(),url:l.value.trim()}),a.value=!1)}function y(v){c.value=v.name,f.value=v.fetchUrl}function C(v){f.value.trim()&&(t("edit",{name:v,newUrl:f.value.trim()}),c.value=null)}function x(){c.value=null}return(v,g)=>(i(),d("div",xa,[o("div",ba,[g[5]||(g[5]=o("h3",{class:"text-sm font-semibold text-retro-text"},"Remote Repositories",-1)),o("button",{class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",onClick:g[0]||(g[0]=B=>t("close"))},[Y(s(ht),{class:"w-4 h-4"})])]),o("div",ya,[(i(!0),d(he,null,Be(e.remotes,B=>(i(),d("div",{key:B.name,class:"flex items-center gap-2 px-3 py-2 border-b border-retro-border/50 text-xs"},[o("span",ka,T(B.name),1),s(c)===B.name?(i(),d(he,{key:0},[Me(o("input",{"onUpdate:modelValue":g[1]||(g[1]=V=>Ie(f)?f.value=V:null),type:"text",class:"flex-1 px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text focus:outline-none focus:border-retro-cyan",onKeyup:[ln(V=>C(B.name),["enter"]),ln(x,["escape"])]},null,40,wa),[[ut,s(f)]]),o("button",{class:"p-0.5 text-retro-green hover:text-retro-green/80",onClick:V=>C(B.name)},[Y(s(Xo),{class:"w-3.5 h-3.5"})],8,Ca),o("button",{class:"p-0.5 text-retro-muted hover:text-retro-text",onClick:x},[Y(s(ht),{class:"w-3.5 h-3.5"})])],64)):(i(),d(he,{key:1},[o("span",$a,T(B.fetchUrl),1),o("button",{class:"p-0.5 text-retro-muted hover:text-retro-text",title:"Edit",onClick:V=>y(B)},[Y(s(tr),{class:"w-3.5 h-3.5"})],8,Sa),o("button",{class:"p-0.5 text-retro-muted hover:text-retro-red",title:"Delete",onClick:V=>t("delete",B.name)},[Y(s(un),{class:"w-3.5 h-3.5"})],8,_a)],64))]))),128)),e.remotes.length===0?(i(),d("div",Ma," No remotes configured ")):P("",!0)]),s(a)?(i(),d("div",Ta,[Me(o("input",{"onUpdate:modelValue":g[2]||(g[2]=B=>Ie(r)?r.value=B:null),type:"text",placeholder:"Remote name (e.g., origin)",class:"w-full px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan"},null,512),[[ut,s(r)]]),Me(o("input",{"onUpdate:modelValue":g[3]||(g[3]=B=>Ie(l)?l.value=B:null),type:"text",placeholder:"Remote URL",class:"w-full px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",onKeyup:ln(m,["enter"])},null,544),[[ut,s(l)]]),o("div",Aa,[o("button",{class:"px-2 py-1 text-xs text-retro-muted hover:text-retro-text transition-colors",onClick:g[4]||(g[4]=B=>a.value=!1)}," Cancel "),o("button",{class:"px-2 py-1 text-xs bg-retro-cyan/20 text-retro-cyan border border-retro-cyan/40 rounded hover:bg-retro-cyan/30 transition-colors",disabled:!s(r).trim()||!s(l).trim(),onClick:m}," Add Remote ",8,Ba)])])):P("",!0),s(a)?P("",!0):(i(),d("div",Ra,[o("button",{class:"flex items-center gap-1 text-xs text-retro-cyan hover:text-retro-cyan/80 transition-colors",onClick:h},[Y(s(vo),{class:"w-3.5 h-3.5"}),g[6]||(g[6]=ke(" Add Remote ",-1))])]))]))}}),bo={NODE_RADIUS:4,ROW_HEIGHT:32,COLUMN_WIDTH:20,PADDING:10,VISIBLE_BUFFER:10},no=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#06B6D4","#84CC16","#F43F5E","#A855F7"],Pn={A:{label:"Added",colorClass:"text-retro-green"},M:{label:"Modified",colorClass:"text-retro-yellow"},D:{label:"Deleted",colorClass:"text-retro-red"},R:{label:"Renamed",colorClass:"text-retro-blue"},C:{label:"Copied",colorClass:"text-retro-purple"},U:{label:"Unmerged",colorClass:"text-retro-cyan"}},Pa=["width","height"],Da=["d","stroke","stroke-dasharray"],La={key:0},Ia=["cx","r"],Na=["cx","r","fill"],Fa=["cx","r","stroke"],Ha=["cx","r","fill"],Oa=["cx","r","stroke"],Ua=["cx","r","fill"],ja=["cx","r"],za=["cx","r","fill"],ss=Ce({__name:"GitGraphSvg",props:{rowData:{},maxLane:{default:4},highlightBranches:{},tooltipText:{}},setup(e){const n=e,{COLUMN_WIDTH:t,ROW_HEIGHT:a,NODE_RADIUS:r,PADDING:l}=bo,c=H(()=>l*2+(n.maxLane+1)*t),f=a,h=a/2;function m(x){return l+x*t}function y(x){const v=m(x.fromLane),g=m(x.toLane);if(x.type==="vertical")return`M ${v} 0 L ${g} ${f}`;if(x.type==="vertical-top")return`M ${v} 0 L ${v} ${h}`;if(x.type==="vertical-bottom")return`M ${v} ${h} L ${v} ${f}`;if(x.style==="rounded")return`M ${v} ${h} C ${v} ${f}, ${g} ${f}, ${g} ${f}`;{const B=f*.75;return`M ${v} ${h} L ${v} ${B} L ${g} ${f}`}}const C=H(()=>n.rowData?m(n.rowData.lane):l);return(x,v)=>(i(),d("svg",{width:s(c),height:s(f),class:"block flex-shrink-0","aria-hidden":"true"},[e.rowData?(i(),d(he,{key:0},[(i(!0),d(he,null,Be(e.rowData.connections,(g,B)=>(i(),d("path",{key:B,d:y(g),stroke:g.color,"stroke-width":"2",fill:"none","stroke-dasharray":g.type.startsWith("merge")?"4 3":"none"},null,8,Da))),128)),o("g",null,[e.tooltipText?(i(),d("title",La,T(e.tooltipText),1)):P("",!0),e.rowData.nodeType==="head"?(i(),d(he,{key:1},[o("circle",{cx:s(C),cy:h,r:s(r)+2,fill:"none",stroke:"currentColor","stroke-width":"2",class:"text-retro-cyan"},null,8,Ia),o("circle",{cx:s(C),cy:h,r:s(r),fill:e.rowData.color},null,8,Na)],64)):e.rowData.nodeType==="merge"?(i(),d(he,{key:2},[o("circle",{cx:s(C),cy:h,r:s(r)+1,fill:"none",stroke:e.rowData.color,"stroke-width":"1.5"},null,8,Fa),o("circle",{cx:s(C),cy:h,r:s(r)-1,fill:e.rowData.color},null,8,Ha)],64)):e.rowData.nodeType==="stash"?(i(),d(he,{key:3},[o("circle",{cx:s(C),cy:h,r:s(r),fill:"none",stroke:e.rowData.color,"stroke-width":"2"},null,8,Oa),o("circle",{cx:s(C),cy:h,r:s(r)-2,fill:e.rowData.color},null,8,Ua)],64)):e.rowData.nodeType==="uncommitted"?(i(),d("circle",{key:4,cx:s(C),cy:h,r:s(r),fill:"none",stroke:"currentColor","stroke-width":"2",class:"text-retro-yellow","stroke-dasharray":"3 2"},null,8,ja)):(i(),d("circle",{key:5,cx:s(C),cy:h,r:s(r),fill:e.rowData.color},null,8,za))])],64)):P("",!0)],8,Pa))}}),Va=["aria-selected","aria-label"],Wa={key:1,class:"flex gap-1 flex-shrink-0"},Ga=["title","onContextmenu"],qa={key:2,class:"flex gap-1 flex-shrink-0"},Za=["onContextmenu"],Ka={class:"text-retro-text text-xs truncate flex-1"},Ya={key:5,class:"flex-shrink-0 text-retro-muted text-[10px] hidden sm:inline"},Xa={key:6,class:"flex-shrink-0 text-retro-muted text-[10px]"},Qa=Ce({__name:"GitCommitRow",props:{commit:{},index:{},isSelected:{type:Boolean},isHighlighted:{type:Boolean},isBranchHighlighted:{type:Boolean},isFeatureHighlighted:{type:Boolean},isPreviewHighlighted:{type:Boolean},isMuted:{type:Boolean},currentBranchName:{},localBranchNames:{},graphRowData:{},maxLane:{},columnVisibility:{}},emits:["click","keydown","branchContextMenu","commitContextMenu","tagContextMenu"],setup(e,{emit:n}){const t=e,a=n,r=H(()=>{const x=t.commit.branches;if(x.length===0)return[];const v=t.localBranchNames,g=[],B=[];for(const W of x)v.has(W)?g.push(W):B.push(W);const V=new Set(g),E=new Map,fe=[];for(const W of B){const ue=W.indexOf("/");if(ue>0){const de=W.substring(ue+1),le=W.substring(0,ue);V.has(de)?(E.has(de)||E.set(de,[]),E.get(de).push(le)):fe.push(W)}else fe.push(W)}const ce=[];for(const W of g){const ue=E.get(W)||[];ue.length>0?ce.push({displayName:`${W}/${ue.join(",")}`,originalBranches:[W,...ue.map(de=>`${de}/${W}`)],isLocal:!0}):ce.push({displayName:W,originalBranches:[W],isLocal:!0})}for(const W of fe)ce.push({displayName:W,originalBranches:[W],isLocal:!1});return ce});function l(x,v){x.preventDefault(),x.stopPropagation();const g=v.originalBranches[0];a("branchContextMenu",{branch:g,x:x.clientX,y:x.clientY,isCurrentBranch:v.isLocal&&v.originalBranches.includes(t.currentBranchName??""),isLocal:v.isLocal})}function c(x,v){x.preventDefault(),x.stopPropagation(),a("tagContextMenu",{tag:v,x:x.clientX,y:x.clientY})}function f(x){x.preventDefault(),x.stopPropagation(),a("commitContextMenu",{x:x.clientX,y:x.clientY})}const{ROW_HEIGHT:h}=bo,m=H(()=>{const x=[t.commit.shortHash];return t.commit.branches.length>0&&x.push(t.commit.branches.join(", ")),t.commit.tags.length>0&&x.push(t.commit.tags.map(v=>`tag: ${v}`).join(", ")),x.join(" — ")});function y(x){const g=Date.now()/1e3-x;return g<60?"just now":g<3600?`${Math.floor(g/60)}m ago`:g<86400?`${Math.floor(g/3600)}h ago`:g<604800?`${Math.floor(g/86400)}d ago`:g<2592e3?`${Math.floor(g/604800)}w ago`:new Date(x*1e3).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function C(x){const v=x.split(`
3
+ `)[0];return v.length>72?v.substring(0,69)+"...":v}return(x,v)=>{const g=ss;return i(),d("div",{class:ve(["flex items-center cursor-pointer group focus:outline-none focus:ring-1 focus:ring-retro-cyan/50 focus:ring-inset",{"opacity-40":e.isMuted,"bg-retro-red/10":e.isPreviewHighlighted,"bg-retro-yellow/20":e.isFeatureHighlighted&&!e.isPreviewHighlighted}]),style:Nt({height:`${s(h)}px`}),role:"row",tabindex:"0","aria-selected":e.isSelected,"aria-label":`Commit ${e.commit.shortHash} by ${e.commit.author}: ${e.commit.message.split(`
4
+ `)[0]}`,onClick:v[0]||(v[0]=B=>a("click",B)),onKeydown:v[1]||(v[1]=B=>a("keydown",B)),onContextmenu:f},[Y(g,{rowData:e.graphRowData,maxLane:e.maxLane,tooltipText:s(m)},null,8,["rowData","maxLane","tooltipText"]),o("div",{class:ve(["flex-1 flex items-center gap-2 px-2 min-w-0 rounded-r transition-colors",{"bg-retro-red/10 border-l-2 border-retro-red/40":e.isPreviewHighlighted,"bg-retro-yellow/30 border-l-2 border-retro-yellow":e.isFeatureHighlighted&&!e.isPreviewHighlighted,"bg-retro-cyan/15":e.isSelected&&!e.isFeatureHighlighted&&!e.isPreviewHighlighted,"bg-retro-yellow/10":e.isHighlighted&&!e.isSelected&&!e.isFeatureHighlighted&&!e.isPreviewHighlighted,"bg-retro-cyan/5":e.isBranchHighlighted&&!e.isSelected&&!e.isHighlighted&&!e.isFeatureHighlighted&&!e.isPreviewHighlighted,"group-hover:bg-retro-panel/50":!e.isSelected&&!e.isHighlighted&&!e.isFeatureHighlighted&&!e.isPreviewHighlighted&&!e.isBranchHighlighted}]),style:Nt({height:`${s(h)-4}px`})},[!e.columnVisibility||e.columnVisibility.commit!==!1?(i(),d("span",{key:0,class:ve(["flex-shrink-0 font-mono text-[11px]",e.commit.isHead?"text-retro-cyan font-semibold":"text-retro-muted"])},T(e.commit.shortHash),3)):P("",!0),s(r).length>0?(i(),d("div",Wa,[(i(!0),d(he,null,Be(s(r),B=>(i(),d("span",{key:B.displayName,class:ve(["px-1.5 py-0.5 text-[10px] rounded font-semibold leading-none cursor-context-menu hover:ring-1 hover:ring-retro-cyan/50",e.commit.isHead&&B.isLocal?"bg-retro-cyan/20 text-retro-cyan border border-retro-cyan/40":e.isPreviewHighlighted?"bg-retro-red/10 text-retro-red border border-retro-red/40":e.isFeatureHighlighted?"bg-retro-yellow/15 text-retro-yellow border border-retro-yellow/30":e.isBranchHighlighted?"bg-retro-cyan/15 text-retro-cyan/80 border border-retro-cyan/30":B.isLocal?"bg-retro-green/15 text-retro-green border border-retro-green/30":"bg-retro-orange/15 text-retro-orange border border-retro-orange/30"]),title:B.originalBranches.join(", "),onContextmenu:V=>l(V,B)},T(B.displayName),43,Ga))),128))])):P("",!0),e.commit.tags.length>0?(i(),d("div",qa,[(i(!0),d(he,null,Be(e.commit.tags,B=>(i(),d("span",{key:B,class:"px-1 py-0.5 text-[10px] rounded-sm bg-retro-yellow/15 text-retro-yellow border border-retro-yellow/25 flex items-center gap-0.5 leading-none cursor-context-menu hover:ring-1 hover:ring-retro-yellow/50",onContextmenu:V=>c(V,B)},[Y(s(rr),{class:"w-2.5 h-2.5"}),ke(" "+T(B),1)],40,Za))),128))])):P("",!0),o("span",Ka,T(C(e.commit.message)),1),e.commit.signatureStatus==="good"?(i(),ie(s(rs),{key:3,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-green",title:"Verified signature"})):e.commit.signatureStatus==="bad"?(i(),ie(s(or),{key:4,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-red",title:"Bad signature"})):P("",!0),!e.columnVisibility||e.columnVisibility.author!==!1?(i(),d("span",Ya,T(e.commit.author),1)):P("",!0),!e.columnVisibility||e.columnVisibility.date!==!1?(i(),d("span",Xa,T(y(e.commit.timestamp)),1)):P("",!0)],6)],46,Va)}}});function Ja(){const{COLUMN_WIDTH:e,ROW_HEIGHT:n,NODE_RADIUS:t,PADDING:a}=bo;function r(h){let m=0;for(let y=0;y<h.length;y++){const C=h.charCodeAt(y);m=(m<<5)-m+C,m=m&m}return Math.abs(m)}function l(h){const m=r(h)%no.length;return no[m]}function c(h,m="rounded"){const y=new Map;if(h.length===0)return y;const C=new Set,x=new Map;for(const ce of h)x.set(ce.hash,ce);const v=h.find(ce=>ce.isHead)||h[0];if(v){let ce=v;for(;ce;){C.add(ce.hash);const W=ce.parents?.[0];ce=W?x.get(W):void 0}}const g=new Map,B=new Map,V=new Map,E=new Map,fe=new Map;for(let ce=0;ce<h.length;ce++){const W=h[ce];fe.set(W.hash,ce);const ue=C.has(W.hash);let de,le;if(E.has(W.hash)){const p=E.get(W.hash);de=p.lane,le=p.color,E.delete(W.hash)}else if(ue)de=0,le=no[0];else{for(de=1;V.has(de);)de++;le=l(W.hash.substring(0,7))}g.set(W.hash,de),B.set(W.hash,le),V.set(de,W.hash);const re=W.isMerge||W.parents&&W.parents.length>1;let Z="regular";W.isHead?Z="head":re&&(Z="merge"),y.set(W.hash,{commitHash:W.hash,lane:de,color:le,nodeType:Z,isMainline:C.has(W.hash),connections:[]});const z=W.parents||[];for(let p=0;p<z.length;p++){const u=z[p];if(g.has(u)||E.has(u))continue;const b=C.has(u);let j,G;if(p===0)j=de,G=le;else if(b)j=0,G=no[0];else{for(j=1;V.has(j)||j===de;)j++;G=l(u.substring(0,7))}E.set(u,{lane:j,color:G,childHash:W.hash})}const N=z[0];if(!N)V.delete(de);else{const p=g.get(N),u=E.get(N),b=p??u?.lane;b!==void 0&&b!==de&&V.delete(de)}}for(let ce=0;ce<h.length;ce++){const W=h[ce],ue=y.get(W.hash);if(!ue)continue;const de=W.parents||[];for(let le=0;le<de.length;le++){const re=de[le],Z=g.get(re),z=fe.get(re);if(Z===void 0)continue;const N=ue.lane,p=Z,u=le===0?ue.color:B.get(re)||l(re.substring(0,7));if(N===p?ue.connections.push({type:"vertical-bottom",fromLane:N,toLane:p,color:u,style:m}):le>0?ue.connections.push({type:N<p?"merge-out":"merge-in",fromLane:N,toLane:p,color:u,style:m}):ue.connections.push({type:N<p?"branch-out":"branch-in",fromLane:N,toLane:p,color:u,style:m}),z!==void 0&&z>ce+1)for(let b=ce+1;b<z;b++){const j=h[b],G=y.get(j.hash);G&&G.connections.push({type:"vertical",fromLane:p,toLane:p,color:u,style:m})}if(z!==void 0){const b=y.get(re);b&&b.connections.push({type:"vertical-top",fromLane:p,toLane:p,color:u,style:m})}}}return y}function f(h){let m=0;for(const y of h.values()){y.lane>m&&(m=y.lane);for(const C of y.connections)C.fromLane>m&&(m=C.fromLane),C.toLane>m&&(m=C.toLane)}return m}return{computeGraphRows:c,computeMaxLane:f,getBranchColor:l,COLUMN_WIDTH:e,ROW_HEIGHT:n,NODE_RADIUS:t,PADDING:a}}const ei=["aria-selected"],ti={class:"text-retro-yellow text-xs font-medium"},ni={key:1,class:"flex items-center justify-center gap-2 p-2 text-retro-muted text-sm"},oi={key:2,class:"p-2 text-center text-retro-muted/50 text-xs"},ri=Ce({__name:"GitCommitList",props:{commits:{},stashes:{},selectedCommit:{},hasMore:{type:Boolean},loading:{type:Boolean},loadingMore:{type:Boolean},searchQuery:{},uncommittedChangesCount:{},isUncommittedChangesSelected:{type:Boolean},highlightBranches:{},featureHighlightBranches:{},featureMergeBases:{},previewHighlightBranches:{},previewMergeBases:{},currentBranchName:{},localBranchNames:{},graphStyle:{default:"rounded"},muteNonAncestral:{type:Boolean},columnVisibility:{}},emits:["select","compareSelect","loadMore","branchContextMenu","commitContextMenu","tagContextMenu","stashContextMenu","selectUncommittedChanges","scrollStart","scrollEnd"],setup(e,{expose:n,emit:t}){const a=e,r=t;function l(){r("selectUncommittedChanges")}function c(I){(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),r("selectUncommittedChanges"))}const f=H(()=>a.searchQuery?.toLowerCase()??""),h=H(()=>new Set(a.highlightBranches??[])),m=H(()=>h.value.size>0),y=H(()=>{const I=f.value;if(!I)return new Set;const L=new Set;for(const K of a.commits)(K.message.toLowerCase().includes(I)||K.author.toLowerCase().includes(I)||K.shortHash.toLowerCase().includes(I)||K.hash.toLowerCase().includes(I)||K.branches.some(k=>k.toLowerCase().includes(I))||K.tags.some(k=>k.toLowerCase().includes(I)))&&L.add(K.hash);return L}),C=H(()=>{if(!m.value)return new Set;const I=new Set;for(const L of a.commits)L.branches.some(K=>h.value.has(K))&&I.add(L.hash);return I}),x=H(()=>{if(!a.featureHighlightBranches||a.featureHighlightBranches.length===0)return new Set;const I=a.featureMergeBases??{},L=new Map;for(const k of a.commits)L.set(k.hash,k);const K=new Set;for(const k of a.featureHighlightBranches){const F=a.commits.find(ne=>ne.branches.includes(k));if(!F)continue;const q=I[k]??null;if(!q)continue;let se=F;for(;se&&se.hash!==q;)K.add(se.hash),se=se.parents?.[0]?L.get(se.parents[0]):void 0}return K}),v=H(()=>{if(!a.previewHighlightBranches||a.previewHighlightBranches.length===0)return new Set;const I=a.previewMergeBases??{},L=new Map;for(const k of a.commits)L.set(k.hash,k);const K=new Set;for(const k of a.previewHighlightBranches){const F=a.commits.find(ne=>ne.branches.includes(k));if(!F)continue;const q=I[k]??null;if(!q)continue;let se=F;for(;se&&se.hash!==q;)K.add(se.hash),se=se.parents?.[0]?L.get(se.parents[0]):void 0}return K});function g(I,L){r("branchContextMenu",{...L,commitHash:I.hash})}function B(I,L){r("commitContextMenu",{commit:I,...L})}function V(I,L){r("tagContextMenu",{...L,commitHash:I.hash})}const{ROW_HEIGHT:E,VISIBLE_BUFFER:fe}=bo,{computeGraphRows:ce,computeMaxLane:W}=Ja(),ue=H(()=>ce([...a.commits],a.graphStyle)),de=H(()=>W(ue.value)),le=H(()=>{const I=a.stashes||[];if(I.length===0)return a.commits.map((F,q)=>({type:"commit",commit:F,commitIndex:q}));const L=[],K=[...I].sort((F,q)=>new Date(q.date).getTime()-new Date(F.date).getTime());let k=0;for(let F=0;F<a.commits.length;F++){const q=a.commits[F],se=q.timestamp*1e3;for(;k<K.length&&new Date(K[k].date).getTime()>=se;)L.push({type:"stash",stash:K[k]}),k++;L.push({type:"commit",commit:q,commitIndex:F})}for(;k<K.length;)L.push({type:"stash",stash:K[k]}),k++;return L}),re=S(null),Z=S(0),z=S(400);let N=null;const p=H(()=>{const I=fe,L=le.value.length,K=Math.max(0,Math.floor(Z.value/E)-I),k=Math.min(L,Math.ceil((Z.value+z.value)/E)+I);return{startIndex:K,endIndex:k}}),u=H(()=>{const{startIndex:I,endIndex:L}=p.value;return le.value.slice(I,L).map((K,k)=>({row:K,index:I+k,graphRow:K.type==="commit"&&ue.value.get(K.commit.hash)||null,isHighlighted:K.type==="commit"?y.value.has(K.commit.hash):!1,isBranchHighlighted:K.type==="commit"?C.value.has(K.commit.hash):!1,isFeatureHighlighted:K.type==="commit"?x.value.has(K.commit.hash):!1,isPreviewHighlighted:K.type==="commit"?v.value.has(K.commit.hash):!1,isMuted:K.type==="commit"&&a.muteNonAncestral?!(ue.value.get(K.commit.hash)?.isMainline??!1):!1}))}),b=H(()=>le.value.length*E),j=H(()=>p.value.startIndex*E);function G(I){const L=I.target;Z.value=L.scrollTop,N||r("scrollStart"),N&&clearTimeout(N),N=setTimeout(()=>{N=null,r("scrollEnd")},150),a.hasMore&&!a.loading&&!a.loadingMore&&L.scrollTop+L.clientHeight>=L.scrollHeight-200&&r("loadMore")}function Q(I,L){L.ctrlKey||L.metaKey?r("compareSelect",I):r("select",I)}function J(I,L,K){if(I.key==="Enter"||I.key===" ")I.preventDefault(),r("select",L);else if(I.key==="ArrowDown"){I.preventDefault();for(let k=K+1;k<le.value.length;k++){const F=le.value[k];if(F.type==="commit"){r("select",F.commit),ee(k);break}}}else if(I.key==="ArrowUp"){I.preventDefault();for(let k=K-1;k>=0;k--){const F=le.value[k];if(F.type==="commit"){r("select",F.commit),ee(k);break}}}}function ee(I){if(!re.value)return;const L=I*E,K=re.value.scrollTop,k=K+re.value.clientHeight;L<K?re.value.scrollTop=L:L+E>k&&(re.value.scrollTop=L+E-re.value.clientHeight)}st(()=>{if(re.value){z.value=re.value.clientHeight;const I=new ResizeObserver(L=>{for(const K of L)z.value=K.contentRect.height});I.observe(re.value),_t(()=>I.disconnect())}});function te(){return re.value?.scrollTop??0}function O(I){re.value&&(re.value.scrollTop=I)}return n({getScrollPosition:te,setScrollPosition:O,scrollToIndex:ee}),(I,L)=>{const K=ss,k=Qa;return i(),d("div",{ref_key:"containerRef",ref:re,class:"h-full overflow-auto",role:"list","aria-label":"Commit history",onScroll:G},[e.uncommittedChangesCount&&e.uncommittedChangesCount>0?(i(),d("div",{key:0,class:"flex items-center cursor-pointer group sticky top-0 z-10 bg-retro-dark border-b border-retro-border",style:Nt({height:`${s(E)}px`}),role:"button",tabindex:"0","aria-selected":e.isUncommittedChangesSelected,onClick:l,onKeydown:c},[Y(K,{rowData:{commitHash:"uncommitted",lane:0,color:"#F59E0B",nodeType:"uncommitted",isMainline:!1,connections:[]},maxLane:s(de)},null,8,["maxLane"]),o("div",{class:ve(["flex-1 flex items-center gap-2 px-2 min-w-0 rounded-r transition-colors",{"bg-retro-yellow/15":e.isUncommittedChangesSelected,"group-hover:bg-retro-panel/50":!e.isUncommittedChangesSelected}]),style:Nt({height:`${s(E)-4}px`})},[Y(s(Ln),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),o("span",ti," Uncommitted Changes ("+T(e.uncommittedChangesCount)+") ",1),L[1]||(L[1]=o("span",{class:"flex-1"},null,-1)),L[2]||(L[2]=o("span",{class:"text-retro-muted text-[10px]"},"Working tree",-1))],6)],44,ei)):P("",!0),o("div",{class:"relative",style:Nt({height:`${s(b)}px`})},[o("div",{class:"absolute left-0 right-0",style:Nt({transform:`translateY(${s(j)}px)`})},[(i(!0),d(he,null,Be(s(u),({row:F,index:q,graphRow:se,isHighlighted:ne,isBranchHighlighted:be,isFeatureHighlighted:De,isPreviewHighlighted:_e,isMuted:ot})=>(i(),d(he,{key:F.type==="commit"?F.commit.hash:`stash-${F.stash.index}`},[F.type==="commit"?Ts([F.commit.hash,F.commit.message,F.commit.timestamp,F.commit.branches.join("|"),F.commit.tags.join("|"),e.selectedCommit?.hash===F.commit.hash,ne,be,De,_e,ot,a.currentBranchName||"",a.columnVisibility?.date!==!1,a.columnVisibility?.author!==!1,a.columnVisibility?.commit!==!1],()=>(i(),ie(k,{key:0,commit:F.commit,index:F.commitIndex,isSelected:e.selectedCommit?.hash===F.commit.hash,isHighlighted:ne,isBranchHighlighted:be,isFeatureHighlighted:De,isPreviewHighlighted:_e,isMuted:ot,currentBranchName:a.currentBranchName,localBranchNames:a.localBranchNames,graphRowData:se,maxLane:s(de),columnVisibility:a.columnVisibility,onClick:We=>Q(F.commit,We),onKeydown:We=>J(We,F.commit,q),onBranchContextMenu:We=>g(F.commit,We),onCommitContextMenu:We=>B(F.commit,We),onTagContextMenu:We=>V(F.commit,We)},null,8,["commit","index","isSelected","isHighlighted","isBranchHighlighted","isFeatureHighlighted","isPreviewHighlighted","isMuted","currentBranchName","localBranchNames","graphRowData","maxLane","columnVisibility","onClick","onKeydown","onBranchContextMenu","onCommitContextMenu","onTagContextMenu"])),L,0):P("",!0)],64))),128))],4)],4),(e.loading||e.loadingMore)&&e.commits.length>0?(i(),d("div",ni,[...L[3]||(L[3]=[o("div",{class:"w-3 h-3 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),ke(" Loading more commits... ",-1)])])):P("",!0),!e.hasMore&&e.commits.length>0&&!e.loading?(i(),d("div",oi,T(e.commits.length)+" commits loaded ",1)):P("",!0)],544)}}});function si(e){const n=e.charAt(0).toUpperCase();return n in Pn?n:"M"}function oo(e,n){if(e&&typeof e=="object"){const t=e;if(typeof t.data?.message=="string"&&t.data.message.trim())return t.data.message;if(typeof t.statusMessage=="string"&&t.statusMessage.trim())return t.statusMessage;if(typeof t.message=="string"&&t.message.trim())return t.message}return e instanceof Error&&e.message?e.message:n}function $r(e,n){const t=n.trim().toLowerCase();return t?e.filter(a=>a.message.toLowerCase().includes(t)||a.author.toLowerCase().includes(t)||a.shortHash.includes(t)||a.hash.includes(t)||a.branches.some(r=>r.toLowerCase().includes(t))||a.tags.some(r=>r.toLowerCase().includes(t))):[...e]}function ai(e,n){return n.size===0?[...e]:e.filter(t=>t.branches.some(a=>n.has(a)))}const ii={class:"flex flex-col h-full border-t border-retro-border bg-retro-dark"},li={class:"flex items-center justify-between p-2 border-b border-retro-border flex-shrink-0"},ci={class:"flex items-center gap-2 text-xs min-w-0"},ui={class:"font-mono text-retro-cyan"},di={class:"font-mono text-retro-cyan"},fi={key:0,class:"px-3 py-1.5 text-xs text-retro-muted border-b border-retro-border flex-shrink-0"},mi={class:"text-retro-green"},hi={class:"text-retro-red"},pi={key:1,class:"flex-1 flex items-center justify-center"},vi={key:2,class:"flex-1 overflow-auto"},gi={class:"text-retro-text truncate flex-1"},xi={class:"text-retro-muted"},bi={key:0,class:"flex-shrink-0 text-[10px] font-mono"},yi={key:0,class:"text-retro-green"},ki={key:1,class:"text-retro-red ml-1"},wi={key:1,class:"flex-shrink-0 text-[10px] text-retro-muted italic"},Ci={key:3,class:"flex-1 flex items-center justify-center text-retro-muted text-sm"},$i=Ce({__name:"GitComparisonView",props:{fromCommit:{},toCommit:{},files:{},stats:{},loading:{type:Boolean}},emits:["close"],setup(e,{emit:n}){const t=n;function a(r){const l=si(r);return Pn[l]||Pn.M}return(r,l)=>(i(),d("div",ii,[o("div",li,[o("div",ci,[l[1]||(l[1]=o("span",{class:"text-retro-muted"},"Comparing",-1)),o("span",ui,T(e.fromCommit.shortHash),1),l[2]||(l[2]=o("span",{class:"text-retro-muted"},"→",-1)),o("span",di,T(e.toCommit.shortHash),1)]),o("button",{class:"p-1 text-retro-muted hover:text-retro-text transition-colors flex-shrink-0","aria-label":"Close comparison",onClick:l[0]||(l[0]=c=>t("close"))},[Y(s(ht),{class:"w-4 h-4"})])]),e.stats?(i(),d("div",fi,[ke(T(e.stats.filesChanged)+" file"+T(e.stats.filesChanged!==1?"s":"")+" changed, ",1),o("span",mi,"+"+T(e.stats.additions),1),o("span",hi," -"+T(e.stats.deletions),1)])):P("",!0),e.loading?(i(),d("div",pi,[...l[3]||(l[3]=[o("div",{class:"flex items-center gap-2 text-retro-muted text-sm"},[o("div",{class:"w-4 h-4 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"}),ke(" Loading comparison... ")],-1)])])):e.files&&e.files.length>0?(i(),d("div",vi,[(i(!0),d(he,null,Be(e.files,c=>(i(),d("div",{key:c.path,class:"flex items-center gap-2 px-3 py-1.5 hover:bg-retro-panel/50 text-xs border-b border-retro-border/50"},[o("span",{class:ve(["flex-shrink-0 w-4 text-center font-semibold text-[10px]",a(c.status).colorClass])},T(c.status.charAt(0)),3),o("span",gi,[c.oldPath&&c.status.startsWith("R")?(i(),d(he,{key:0},[o("span",xi,T(c.oldPath),1),l[4]||(l[4]=o("span",{class:"text-retro-muted mx-1"},"→",-1))],64)):P("",!0),ke(" "+T(c.path),1)]),c.binary?(i(),d("span",wi,"binary")):(i(),d("span",bi,[c.additions>0?(i(),d("span",yi,"+"+T(c.additions),1)):P("",!0),c.deletions>0?(i(),d("span",ki,"-"+T(c.deletions),1)):P("",!0)]))]))),128))])):e.files&&e.files.length===0?(i(),d("div",Ci," No differences between these commits ")):P("",!0)]))}});function sr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Mn=sr();function as(e){Mn=e}var Gn={exec:()=>null};function Ue(e,n=""){let t=typeof e=="string"?e:e.source;const a={replace:(r,l)=>{let c=typeof l=="string"?l:l.source;return c=c.replace(bt.caret,"$1"),t=t.replace(r,c),a},getRegex:()=>new RegExp(t,n)};return a}var bt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Si=/^(?:[ \t]*(?:\n|$))+/,_i=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Mi=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Yn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ti=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ar=/(?:[*+-]|\d{1,9}[.)])/,is=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ls=Ue(is).replace(/bull/g,ar).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ai=Ue(is).replace(/bull/g,ar).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ir=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Bi=/^[^\n]+/,lr=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ri=Ue(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",lr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ei=Ue(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ar).getRegex(),yo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",cr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pi=Ue("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",cr).replace("tag",yo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cs=Ue(ir).replace("hr",Yn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yo).getRegex(),Di=Ue(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cs).getRegex(),ur={blockquote:Di,code:_i,def:Ri,fences:Mi,heading:Ti,hr:Yn,html:Pi,lheading:ls,list:Ei,newline:Si,paragraph:cs,table:Gn,text:Bi},Sr=Ue("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Yn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yo).getRegex(),Li={...ur,lheading:Ai,table:Sr,paragraph:Ue(ir).replace("hr",Yn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Sr).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yo).getRegex()},Ii={...ur,html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",cr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Gn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ue(ir).replace("hr",Yn).replace("heading",` *#{1,6} *[^
5
+ ]`).replace("lheading",ls).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ni=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Fi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,us=/^( {2,}|\\)\n(?!\s*$)/,Hi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ko=/[\p{P}\p{S}]/u,dr=/[\s\p{P}\p{S}]/u,ds=/[^\s\p{P}\p{S}]/u,Oi=Ue(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,dr).getRegex(),fs=/(?!~)[\p{P}\p{S}]/u,Ui=/(?!~)[\s\p{P}\p{S}]/u,ji=/(?:[^\s\p{P}\p{S}]|~)/u,zi=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ms=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Vi=Ue(ms,"u").replace(/punct/g,ko).getRegex(),Wi=Ue(ms,"u").replace(/punct/g,fs).getRegex(),hs="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Gi=Ue(hs,"gu").replace(/notPunctSpace/g,ds).replace(/punctSpace/g,dr).replace(/punct/g,ko).getRegex(),qi=Ue(hs,"gu").replace(/notPunctSpace/g,ji).replace(/punctSpace/g,Ui).replace(/punct/g,fs).getRegex(),Zi=Ue("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ds).replace(/punctSpace/g,dr).replace(/punct/g,ko).getRegex(),Ki=Ue(/\\(punct)/,"gu").replace(/punct/g,ko).getRegex(),Yi=Ue(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Xi=Ue(cr).replace("(?:-->|$)","-->").getRegex(),Qi=Ue("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Xi).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),fo=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ji=Ue(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",fo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ps=Ue(/^!?\[(label)\]\[(ref)\]/).replace("label",fo).replace("ref",lr).getRegex(),vs=Ue(/^!?\[(ref)\](?:\[\])?/).replace("ref",lr).getRegex(),el=Ue("reflink|nolink(?!\\()","g").replace("reflink",ps).replace("nolink",vs).getRegex(),fr={_backpedal:Gn,anyPunctuation:Ki,autolink:Yi,blockSkip:zi,br:us,code:Fi,del:Gn,emStrongLDelim:Vi,emStrongRDelimAst:Gi,emStrongRDelimUnd:Zi,escape:Ni,link:Ji,nolink:vs,punctuation:Oi,reflink:ps,reflinkSearch:el,tag:Qi,text:Hi,url:Gn},tl={...fr,link:Ue(/^!?\[(label)\]\((.*?)\)/).replace("label",fo).getRegex(),reflink:Ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",fo).getRegex()},jo={...fr,emStrongRDelimAst:qi,emStrongLDelim:Wi,url:Ue(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},nl={...jo,br:Ue(us).replace("{2,}","*").getRegex(),text:Ue(jo.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ro={normal:ur,gfm:Li,pedantic:Ii},Hn={normal:fr,gfm:jo,breaks:nl,pedantic:tl},ol={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_r=e=>ol[e];function Xt(e,n){if(n){if(bt.escapeTest.test(e))return e.replace(bt.escapeReplace,_r)}else if(bt.escapeTestNoEncode.test(e))return e.replace(bt.escapeReplaceNoEncode,_r);return e}function Mr(e){try{e=encodeURI(e).replace(bt.percentDecode,"%")}catch{return null}return e}function Tr(e,n){const t=e.replace(bt.findPipe,(l,c,f)=>{let h=!1,m=c;for(;--m>=0&&f[m]==="\\";)h=!h;return h?"|":" |"}),a=t.split(bt.splitPipe);let r=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),n)if(a.length>n)a.splice(n);else for(;a.length<n;)a.push("");for(;r<a.length;r++)a[r]=a[r].trim().replace(bt.slashPipe,"|");return a}function On(e,n,t){const a=e.length;if(a===0)return"";let r=0;for(;r<a&&e.charAt(a-r-1)===n;)r++;return e.slice(0,a-r)}function rl(e,n){if(e.indexOf(n[1])===-1)return-1;let t=0;for(let a=0;a<e.length;a++)if(e[a]==="\\")a++;else if(e[a]===n[0])t++;else if(e[a]===n[1]&&(t--,t<0))return a;return t>0?-2:-1}function Ar(e,n,t,a,r){const l=n.href,c=n.title||null,f=e[1].replace(r.other.outputLinkReplace,"$1");a.state.inLink=!0;const h={type:e[0].charAt(0)==="!"?"image":"link",raw:t,href:l,title:c,text:f,tokens:a.inlineTokens(f)};return a.state.inLink=!1,h}function sl(e,n,t){const a=e.match(t.other.indentCodeCompensation);if(a===null)return n;const r=a[1];return n.split(`
6
+ `).map(l=>{const c=l.match(t.other.beginningSpace);if(c===null)return l;const[f]=c;return f.length>=r.length?l.slice(r.length):l}).join(`
7
+ `)}var mo=class{options;rules;lexer;constructor(e){this.options=e||Mn}space(e){const n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){const n=this.rules.block.code.exec(e);if(n){const t=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?t:On(t,`
8
+ `)}}}fences(e){const n=this.rules.block.fences.exec(e);if(n){const t=n[0],a=sl(t,n[3]||"",this.rules);return{type:"code",raw:t,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:a}}}heading(e){const n=this.rules.block.heading.exec(e);if(n){let t=n[2].trim();if(this.rules.other.endingHash.test(t)){const a=On(t,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(t=a.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(e){const n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:On(n[0],`
9
+ `)}}blockquote(e){const n=this.rules.block.blockquote.exec(e);if(n){let t=On(n[0],`
10
+ `).split(`
11
+ `),a="",r="";const l=[];for(;t.length>0;){let c=!1;const f=[];let h;for(h=0;h<t.length;h++)if(this.rules.other.blockquoteStart.test(t[h]))f.push(t[h]),c=!0;else if(!c)f.push(t[h]);else break;t=t.slice(h);const m=f.join(`
12
+ `),y=m.replace(this.rules.other.blockquoteSetextReplace,`
13
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
14
+ ${m}`:m,r=r?`${r}
15
+ ${y}`:y;const C=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,l,!0),this.lexer.state.top=C,t.length===0)break;const x=l.at(-1);if(x?.type==="code")break;if(x?.type==="blockquote"){const v=x,g=v.raw+`
16
+ `+t.join(`
17
+ `),B=this.blockquote(g);l[l.length-1]=B,a=a.substring(0,a.length-v.raw.length)+B.raw,r=r.substring(0,r.length-v.text.length)+B.text;break}else if(x?.type==="list"){const v=x,g=v.raw+`
18
+ `+t.join(`
19
+ `),B=this.list(g);l[l.length-1]=B,a=a.substring(0,a.length-x.raw.length)+B.raw,r=r.substring(0,r.length-v.raw.length)+B.raw,t=g.substring(l.at(-1).raw.length).split(`
20
+ `);continue}}return{type:"blockquote",raw:a,tokens:l,text:r}}}list(e){let n=this.rules.block.list.exec(e);if(n){let t=n[1].trim();const a=t.length>1,r={type:"list",raw:"",ordered:a,start:a?+t.slice(0,-1):"",loose:!1,items:[]};t=a?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=a?t:"[*+-]");const l=this.rules.other.listItemRegex(t);let c=!1;for(;e;){let h=!1,m="",y="";if(!(n=l.exec(e))||this.rules.block.hr.test(e))break;m=n[0],e=e.substring(m.length);let C=n[2].split(`
21
+ `,1)[0].replace(this.rules.other.listReplaceTabs,E=>" ".repeat(3*E.length)),x=e.split(`
22
+ `,1)[0],v=!C.trim(),g=0;if(this.options.pedantic?(g=2,y=C.trimStart()):v?g=n[1].length+1:(g=n[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,y=C.slice(g),g+=n[1].length),v&&this.rules.other.blankLine.test(x)&&(m+=x+`
23
+ `,e=e.substring(x.length+1),h=!0),!h){const E=this.rules.other.nextBulletRegex(g),fe=this.rules.other.hrRegex(g),ce=this.rules.other.fencesBeginRegex(g),W=this.rules.other.headingBeginRegex(g),ue=this.rules.other.htmlBeginRegex(g);for(;e;){const de=e.split(`
24
+ `,1)[0];let le;if(x=de,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),le=x):le=x.replace(this.rules.other.tabCharGlobal," "),ce.test(x)||W.test(x)||ue.test(x)||E.test(x)||fe.test(x))break;if(le.search(this.rules.other.nonSpaceChar)>=g||!x.trim())y+=`
25
+ `+le.slice(g);else{if(v||C.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ce.test(C)||W.test(C)||fe.test(C))break;y+=`
26
+ `+x}!v&&!x.trim()&&(v=!0),m+=de+`
27
+ `,e=e.substring(de.length+1),C=le.slice(g)}}r.loose||(c?r.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0));let B=null,V;this.options.gfm&&(B=this.rules.other.listIsTask.exec(y),B&&(V=B[0]!=="[ ] ",y=y.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:m,task:!!B,checked:V,loose:!1,text:y,tokens:[]}),r.raw+=m}const f=r.items.at(-1);if(f)f.raw=f.raw.trimEnd(),f.text=f.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let h=0;h<r.items.length;h++)if(this.lexer.state.top=!1,r.items[h].tokens=this.lexer.blockTokens(r.items[h].text,[]),!r.loose){const m=r.items[h].tokens.filter(C=>C.type==="space"),y=m.length>0&&m.some(C=>this.rules.other.anyLine.test(C.raw));r.loose=y}if(r.loose)for(let h=0;h<r.items.length;h++)r.items[h].loose=!0;return r}}html(e){const n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){const n=this.rules.block.def.exec(e);if(n){const t=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:t,raw:n[0],href:a,title:r}}}table(e){const n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;const t=Tr(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
28
+ `):[],l={type:"table",raw:n[0],header:[],align:[],rows:[]};if(t.length===a.length){for(const c of a)this.rules.other.tableAlignRight.test(c)?l.align.push("right"):this.rules.other.tableAlignCenter.test(c)?l.align.push("center"):this.rules.other.tableAlignLeft.test(c)?l.align.push("left"):l.align.push(null);for(let c=0;c<t.length;c++)l.header.push({text:t[c],tokens:this.lexer.inline(t[c]),header:!0,align:l.align[c]});for(const c of r)l.rows.push(Tr(c,l.header.length).map((f,h)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:l.align[h]})));return l}}lheading(e){const n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){const n=this.rules.block.paragraph.exec(e);if(n){const t=n[1].charAt(n[1].length-1)===`
29
+ `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:t,tokens:this.lexer.inline(t)}}}text(e){const n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){const n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){const n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){const n=this.rules.inline.link.exec(e);if(n){const t=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const l=On(t.slice(0,-1),"\\");if((t.length-l.length)%2===0)return}else{const l=rl(n[2],"()");if(l===-2)return;if(l>-1){const f=(n[0].indexOf("!")===0?5:4)+n[1].length+l;n[2]=n[2].substring(0,l),n[0]=n[0].substring(0,f).trim(),n[3]=""}}let a=n[2],r="";if(this.options.pedantic){const l=this.rules.other.pedanticHrefTitle.exec(a);l&&(a=l[1],r=l[3])}else r=n[3]?n[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?a=a.slice(1):a=a.slice(1,-1)),Ar(n,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let t;if((t=this.rules.inline.reflink.exec(e))||(t=this.rules.inline.nolink.exec(e))){const a=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=n[a.toLowerCase()];if(!r){const l=t[0].charAt(0);return{type:"text",raw:l,text:l}}return Ar(t,r,t[0],this.lexer,this.rules)}}emStrong(e,n,t=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!a||a[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(a[1]||a[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const l=[...a[0]].length-1;let c,f,h=l,m=0;const y=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(y.lastIndex=0,n=n.slice(-1*e.length+l);(a=y.exec(n))!=null;){if(c=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!c)continue;if(f=[...c].length,a[3]||a[4]){h+=f;continue}else if((a[5]||a[6])&&l%3&&!((l+f)%3)){m+=f;continue}if(h-=f,h>0)continue;f=Math.min(f,f+h+m);const C=[...a[0]][0].length,x=e.slice(0,l+a.index+C+f);if(Math.min(l,f)%2){const g=x.slice(1,-1);return{type:"em",raw:x,text:g,tokens:this.lexer.inlineTokens(g)}}const v=x.slice(2,-2);return{type:"strong",raw:x,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(e){const n=this.rules.inline.code.exec(e);if(n){let t=n[2].replace(this.rules.other.newLineCharGlobal," ");const a=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return a&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:n[0],text:t}}}br(e){const n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){const n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){const n=this.rules.inline.autolink.exec(e);if(n){let t,a;return n[2]==="@"?(t=n[1],a="mailto:"+t):(t=n[1],a=t),{type:"link",raw:n[0],text:t,href:a,tokens:[{type:"text",raw:t,text:t}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let t,a;if(n[2]==="@")t=n[0],a="mailto:"+t;else{let r;do r=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(r!==n[0]);t=n[0],n[1]==="www."?a="http://"+n[0]:a=n[0]}return{type:"link",raw:n[0],text:t,href:a,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(e){const n=this.rules.inline.text.exec(e);if(n){const t=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:t}}}},sn=class zo{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||Mn,this.options.tokenizer=this.options.tokenizer||new mo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:bt,block:ro.normal,inline:Hn.normal};this.options.pedantic?(t.block=ro.pedantic,t.inline=Hn.pedantic):this.options.gfm&&(t.block=ro.gfm,this.options.breaks?t.inline=Hn.breaks:t.inline=Hn.gfm),this.tokenizer.rules=t}static get rules(){return{block:ro,inline:Hn}}static lex(n,t){return new zo(t).lex(n)}static lexInline(n,t){return new zo(t).inlineTokens(n)}lex(n){n=n.replace(bt.carriageReturn,`
30
+ `),this.blockTokens(n,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const a=this.inlineQueue[t];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,t=[],a=!1){for(this.options.pedantic&&(n=n.replace(bt.tabCharGlobal," ").replace(bt.spaceLine,""));n;){let r;if(this.options.extensions?.block?.some(c=>(r=c.call({lexer:this},n,t))?(n=n.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(n)){n=n.substring(r.raw.length);const c=t.at(-1);r.raw.length===1&&c!==void 0?c.raw+=`
31
+ `:t.push(r);continue}if(r=this.tokenizer.code(n)){n=n.substring(r.raw.length);const c=t.at(-1);c?.type==="paragraph"||c?.type==="text"?(c.raw+=`
32
+ `+r.raw,c.text+=`
33
+ `+r.text,this.inlineQueue.at(-1).src=c.text):t.push(r);continue}if(r=this.tokenizer.fences(n)){n=n.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(n)){n=n.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(n)){n=n.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(n)){n=n.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(n)){n=n.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(n)){n=n.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(n)){n=n.substring(r.raw.length);const c=t.at(-1);c?.type==="paragraph"||c?.type==="text"?(c.raw+=`
34
+ `+r.raw,c.text+=`
35
+ `+r.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(n)){n=n.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(n)){n=n.substring(r.raw.length),t.push(r);continue}let l=n;if(this.options.extensions?.startBlock){let c=1/0;const f=n.slice(1);let h;this.options.extensions.startBlock.forEach(m=>{h=m.call({lexer:this},f),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(l=n.substring(0,c+1))}if(this.state.top&&(r=this.tokenizer.paragraph(l))){const c=t.at(-1);a&&c?.type==="paragraph"?(c.raw+=`
36
+ `+r.raw,c.text+=`
37
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(r),a=l.length!==n.length,n=n.substring(r.raw.length);continue}if(r=this.tokenizer.text(n)){n=n.substring(r.raw.length);const c=t.at(-1);c?.type==="text"?(c.raw+=`
38
+ `+r.raw,c.text+=`
39
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(r);continue}if(n){const c="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,t}inline(n,t=[]){return this.inlineQueue.push({src:n,tokens:t}),t}inlineTokens(n,t=[]){let a=n,r=null;if(this.tokens.links){const f=Object.keys(this.tokens.links);if(f.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)f.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,r.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let l=!1,c="";for(;n;){l||(c=""),l=!1;let f;if(this.options.extensions?.inline?.some(m=>(f=m.call({lexer:this},n,t))?(n=n.substring(f.raw.length),t.push(f),!0):!1))continue;if(f=this.tokenizer.escape(n)){n=n.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.tag(n)){n=n.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.link(n)){n=n.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(f.raw.length);const m=t.at(-1);f.type==="text"&&m?.type==="text"?(m.raw+=f.raw,m.text+=f.text):t.push(f);continue}if(f=this.tokenizer.emStrong(n,a,c)){n=n.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.codespan(n)){n=n.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.br(n)){n=n.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.del(n)){n=n.substring(f.raw.length),t.push(f);continue}if(f=this.tokenizer.autolink(n)){n=n.substring(f.raw.length),t.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(n))){n=n.substring(f.raw.length),t.push(f);continue}let h=n;if(this.options.extensions?.startInline){let m=1/0;const y=n.slice(1);let C;this.options.extensions.startInline.forEach(x=>{C=x.call({lexer:this},y),typeof C=="number"&&C>=0&&(m=Math.min(m,C))}),m<1/0&&m>=0&&(h=n.substring(0,m+1))}if(f=this.tokenizer.inlineText(h)){n=n.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(c=f.raw.slice(-1)),l=!0;const m=t.at(-1);m?.type==="text"?(m.raw+=f.raw,m.text+=f.text):t.push(f);continue}if(n){const m="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return t}},ho=class{options;parser;constructor(e){this.options=e||Mn}space(e){return""}code({text:e,lang:n,escaped:t}){const a=(n||"").match(bt.notSpaceStart)?.[0],r=e.replace(bt.endingNewline,"")+`
40
+ `;return a?'<pre><code class="language-'+Xt(a)+'">'+(t?r:Xt(r,!0))+`</code></pre>
41
+ `:"<pre><code>"+(t?r:Xt(r,!0))+`</code></pre>
42
+ `}blockquote({tokens:e}){return`<blockquote>
43
+ ${this.parser.parse(e)}</blockquote>
44
+ `}html({text:e}){return e}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
45
+ `}hr(e){return`<hr>
46
+ `}list(e){const n=e.ordered,t=e.start;let a="";for(let c=0;c<e.items.length;c++){const f=e.items[c];a+=this.listitem(f)}const r=n?"ol":"ul",l=n&&t!==1?' start="'+t+'"':"";return"<"+r+l+`>
47
+ `+a+"</"+r+`>
48
+ `}listitem(e){let n="";if(e.task){const t=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=t+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=t+" "+Xt(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:t+" ",text:t+" ",escaped:!0}):n+=t+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>
49
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
50
+ `}table(e){let n="",t="";for(let r=0;r<e.header.length;r++)t+=this.tablecell(e.header[r]);n+=this.tablerow({text:t});let a="";for(let r=0;r<e.rows.length;r++){const l=e.rows[r];t="";for(let c=0;c<l.length;c++)t+=this.tablecell(l[c]);a+=this.tablerow({text:t})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
51
+ <thead>
52
+ `+n+`</thead>
53
+ `+a+`</table>
54
+ `}tablerow({text:e}){return`<tr>
55
+ ${e}</tr>
56
+ `}tablecell(e){const n=this.parser.parseInline(e.tokens),t=e.header?"th":"td";return(e.align?`<${t} align="${e.align}">`:`<${t}>`)+n+`</${t}>
57
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Xt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:t}){const a=this.parser.parseInline(t),r=Mr(e);if(r===null)return a;e=r;let l='<a href="'+e+'"';return n&&(l+=' title="'+Xt(n)+'"'),l+=">"+a+"</a>",l}image({href:e,title:n,text:t,tokens:a}){a&&(t=this.parser.parseInline(a,this.parser.textRenderer));const r=Mr(e);if(r===null)return Xt(t);e=r;let l=`<img src="${e}" alt="${t}"`;return n&&(l+=` title="${Xt(n)}"`),l+=">",l}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Xt(e.text)}},mr=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},an=class Vo{options;renderer;textRenderer;constructor(n){this.options=n||Mn,this.options.renderer=this.options.renderer||new ho,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new mr}static parse(n,t){return new Vo(t).parse(n)}static parseInline(n,t){return new Vo(t).parseInline(n)}parse(n,t=!0){let a="";for(let r=0;r<n.length;r++){const l=n[r];if(this.options.extensions?.renderers?.[l.type]){const f=l,h=this.options.extensions.renderers[f.type].call({parser:this},f);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(f.type)){a+=h||"";continue}}const c=l;switch(c.type){case"space":{a+=this.renderer.space(c);continue}case"hr":{a+=this.renderer.hr(c);continue}case"heading":{a+=this.renderer.heading(c);continue}case"code":{a+=this.renderer.code(c);continue}case"table":{a+=this.renderer.table(c);continue}case"blockquote":{a+=this.renderer.blockquote(c);continue}case"list":{a+=this.renderer.list(c);continue}case"html":{a+=this.renderer.html(c);continue}case"paragraph":{a+=this.renderer.paragraph(c);continue}case"text":{let f=c,h=this.renderer.text(f);for(;r+1<n.length&&n[r+1].type==="text";)f=n[++r],h+=`
58
+ `+this.renderer.text(f);t?a+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):a+=h;continue}default:{const f='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return a}parseInline(n,t=this.renderer){let a="";for(let r=0;r<n.length;r++){const l=n[r];if(this.options.extensions?.renderers?.[l.type]){const f=this.options.extensions.renderers[l.type].call({parser:this},l);if(f!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){a+=f||"";continue}}const c=l;switch(c.type){case"escape":{a+=t.text(c);break}case"html":{a+=t.html(c);break}case"link":{a+=t.link(c);break}case"image":{a+=t.image(c);break}case"strong":{a+=t.strong(c);break}case"em":{a+=t.em(c);break}case"codespan":{a+=t.codespan(c);break}case"br":{a+=t.br(c);break}case"del":{a+=t.del(c);break}case"text":{a+=t.text(c);break}default:{const f='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return a}},lo=class{options;block;constructor(e){this.options=e||Mn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?sn.lex:sn.lexInline}provideParser(){return this.block?an.parse:an.parseInline}},al=class{defaults=sr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=an;Renderer=ho;TextRenderer=mr;Lexer=sn;Tokenizer=mo;Hooks=lo;constructor(...e){this.use(...e)}walkTokens(e,n){let t=[];for(const a of e)switch(t=t.concat(n.call(this,a)),a.type){case"table":{const r=a;for(const l of r.header)t=t.concat(this.walkTokens(l.tokens,n));for(const l of r.rows)for(const c of l)t=t.concat(this.walkTokens(c.tokens,n));break}case"list":{const r=a;t=t.concat(this.walkTokens(r.items,n));break}default:{const r=a;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(l=>{const c=r[l].flat(1/0);t=t.concat(this.walkTokens(c,n))}):r.tokens&&(t=t.concat(this.walkTokens(r.tokens,n)))}}return t}use(...e){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(t=>{const a={...t};if(a.async=this.defaults.async||a.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const l=n.renderers[r.name];l?n.renderers[r.name]=function(...c){let f=r.renderer.apply(this,c);return f===!1&&(f=l.apply(this,c)),f}:n.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=n[r.level];l?l.unshift(r.tokenizer):n[r.level]=[r.tokenizer],r.start&&(r.level==="block"?n.startBlock?n.startBlock.push(r.start):n.startBlock=[r.start]:r.level==="inline"&&(n.startInline?n.startInline.push(r.start):n.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(n.childTokens[r.name]=r.childTokens)}),a.extensions=n),t.renderer){const r=this.defaults.renderer||new ho(this.defaults);for(const l in t.renderer){if(!(l in r))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;const c=l,f=t.renderer[c],h=r[c];r[c]=(...m)=>{let y=f.apply(r,m);return y===!1&&(y=h.apply(r,m)),y||""}}a.renderer=r}if(t.tokenizer){const r=this.defaults.tokenizer||new mo(this.defaults);for(const l in t.tokenizer){if(!(l in r))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const c=l,f=t.tokenizer[c],h=r[c];r[c]=(...m)=>{let y=f.apply(r,m);return y===!1&&(y=h.apply(r,m)),y}}a.tokenizer=r}if(t.hooks){const r=this.defaults.hooks||new lo;for(const l in t.hooks){if(!(l in r))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;const c=l,f=t.hooks[c],h=r[c];lo.passThroughHooks.has(l)?r[c]=m=>{if(this.defaults.async)return Promise.resolve(f.call(r,m)).then(C=>h.call(r,C));const y=f.call(r,m);return h.call(r,y)}:r[c]=(...m)=>{let y=f.apply(r,m);return y===!1&&(y=h.apply(r,m)),y}}a.hooks=r}if(t.walkTokens){const r=this.defaults.walkTokens,l=t.walkTokens;a.walkTokens=function(c){let f=[];return f.push(l.call(this,c)),r&&(f=f.concat(r.call(this,c))),f}}this.defaults={...this.defaults,...a}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return sn.lex(e,n??this.defaults)}parser(e,n){return an.parse(e,n??this.defaults)}parseMarkdown(e){return(t,a)=>{const r={...a},l={...this.defaults,...r},c=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&r.async===!1)return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));l.hooks&&(l.hooks.options=l,l.hooks.block=e);const f=l.hooks?l.hooks.provideLexer():e?sn.lex:sn.lexInline,h=l.hooks?l.hooks.provideParser():e?an.parse:an.parseInline;if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(t):t).then(m=>f(m,l)).then(m=>l.hooks?l.hooks.processAllTokens(m):m).then(m=>l.walkTokens?Promise.all(this.walkTokens(m,l.walkTokens)).then(()=>m):m).then(m=>h(m,l)).then(m=>l.hooks?l.hooks.postprocess(m):m).catch(c);try{l.hooks&&(t=l.hooks.preprocess(t));let m=f(t,l);l.hooks&&(m=l.hooks.processAllTokens(m)),l.walkTokens&&this.walkTokens(m,l.walkTokens);let y=h(m,l);return l.hooks&&(y=l.hooks.postprocess(y)),y}catch(m){return c(m)}}}onError(e,n){return t=>{if(t.message+=`
59
+ Please report this to https://github.com/markedjs/marked.`,e){const a="<p>An error occurred:</p><pre>"+Xt(t.message+"",!0)+"</pre>";return n?Promise.resolve(a):a}if(n)return Promise.reject(t);throw t}}},Sn=new al;function Oe(e,n){return Sn.parse(e,n)}Oe.options=Oe.setOptions=function(e){return Sn.setOptions(e),Oe.defaults=Sn.defaults,as(Oe.defaults),Oe};Oe.getDefaults=sr;Oe.defaults=Mn;Oe.use=function(...e){return Sn.use(...e),Oe.defaults=Sn.defaults,as(Oe.defaults),Oe};Oe.walkTokens=function(e,n){return Sn.walkTokens(e,n)};Oe.parseInline=Sn.parseInline;Oe.Parser=an;Oe.parser=an.parse;Oe.Renderer=ho;Oe.TextRenderer=mr;Oe.Lexer=sn;Oe.lexer=sn.lex;Oe.Tokenizer=mo;Oe.Hooks=lo;Oe.parse=Oe;Oe.options;Oe.setOptions;Oe.use;Oe.walkTokens;Oe.parseInline;an.parse;sn.lex;const{entries:gs,setPrototypeOf:Br,isFrozen:il,getPrototypeOf:ll,getOwnPropertyDescriptor:cl}=Object;let{freeze:yt,seal:Ft,create:Wo}=Object,{apply:Go,construct:qo}=typeof Reflect<"u"&&Reflect;yt||(yt=function(n){return n});Ft||(Ft=function(n){return n});Go||(Go=function(n,t){for(var a=arguments.length,r=new Array(a>2?a-2:0),l=2;l<a;l++)r[l-2]=arguments[l];return n.apply(t,r)});qo||(qo=function(n){for(var t=arguments.length,a=new Array(t>1?t-1:0),r=1;r<t;r++)a[r-1]=arguments[r];return new n(...a)});const so=kt(Array.prototype.forEach),ul=kt(Array.prototype.lastIndexOf),Rr=kt(Array.prototype.pop),Un=kt(Array.prototype.push),dl=kt(Array.prototype.splice),co=kt(String.prototype.toLowerCase),Mo=kt(String.prototype.toString),To=kt(String.prototype.match),jn=kt(String.prototype.replace),fl=kt(String.prototype.indexOf),ml=kt(String.prototype.trim),jt=kt(Object.prototype.hasOwnProperty),xt=kt(RegExp.prototype.test),zn=hl(TypeError);function kt(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var t=arguments.length,a=new Array(t>1?t-1:0),r=1;r<t;r++)a[r-1]=arguments[r];return Go(e,n,a)}}function hl(e){return function(){for(var n=arguments.length,t=new Array(n),a=0;a<n;a++)t[a]=arguments[a];return qo(e,t)}}function Re(e,n){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:co;Br&&Br(e,null);let a=n.length;for(;a--;){let r=n[a];if(typeof r=="string"){const l=t(r);l!==r&&(il(n)||(n[a]=l),r=l)}e[r]=!0}return e}function pl(e){for(let n=0;n<e.length;n++)jt(e,n)||(e[n]=null);return e}function Qt(e){const n=Wo(null);for(const[t,a]of gs(e))jt(e,t)&&(Array.isArray(a)?n[t]=pl(a):a&&typeof a=="object"&&a.constructor===Object?n[t]=Qt(a):n[t]=a);return n}function Vn(e,n){for(;e!==null;){const a=cl(e,n);if(a){if(a.get)return kt(a.get);if(typeof a.value=="function")return kt(a.value)}e=ll(e)}function t(){return null}return t}const Er=yt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ao=yt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Bo=yt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vl=yt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ro=yt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),gl=yt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Pr=yt(["#text"]),Dr=yt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Eo=yt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Lr=yt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ao=yt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xl=Ft(/\{\{[\w\W]*|[\w\W]*\}\}/gm),bl=Ft(/<%[\w\W]*|[\w\W]*%>/gm),yl=Ft(/\$\{[\w\W]*/gm),kl=Ft(/^data-[\-\w.\u00B7-\uFFFF]+$/),wl=Ft(/^aria-[\-\w]+$/),xs=Ft(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Cl=Ft(/^(?:\w+script|data):/i),$l=Ft(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bs=Ft(/^html$/i),Sl=Ft(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ir=Object.freeze({__proto__:null,ARIA_ATTR:wl,ATTR_WHITESPACE:$l,CUSTOM_ELEMENT:Sl,DATA_ATTR:kl,DOCTYPE_NAME:bs,ERB_EXPR:bl,IS_ALLOWED_URI:xs,IS_SCRIPT_OR_DATA:Cl,MUSTACHE_EXPR:xl,TMPLIT_EXPR:yl});const Wn={element:1,text:3,progressingInstruction:7,comment:8,document:9},_l=function(){return typeof window>"u"?null:window},Ml=function(n,t){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(a=t.getAttribute(r));const l="dompurify"+(a?"#"+a:"");try{return n.createPolicy(l,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},Nr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ys(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_l();const n=pe=>ys(pe);if(n.version="3.3.1",n.removed=[],!e||!e.document||e.document.nodeType!==Wn.document||!e.Element)return n.isSupported=!1,n;let{document:t}=e;const a=t,r=a.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:f,Element:h,NodeFilter:m,NamedNodeMap:y=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:C,DOMParser:x,trustedTypes:v}=e,g=h.prototype,B=Vn(g,"cloneNode"),V=Vn(g,"remove"),E=Vn(g,"nextSibling"),fe=Vn(g,"childNodes"),ce=Vn(g,"parentNode");if(typeof c=="function"){const pe=t.createElement("template");pe.content&&pe.content.ownerDocument&&(t=pe.content.ownerDocument)}let W,ue="";const{implementation:de,createNodeIterator:le,createDocumentFragment:re,getElementsByTagName:Z}=t,{importNode:z}=a;let N=Nr();n.isSupported=typeof gs=="function"&&typeof ce=="function"&&de&&de.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:p,ERB_EXPR:u,TMPLIT_EXPR:b,DATA_ATTR:j,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:Q,ATTR_WHITESPACE:J,CUSTOM_ELEMENT:ee}=Ir;let{IS_ALLOWED_URI:te}=Ir,O=null;const I=Re({},[...Er,...Ao,...Bo,...Ro,...Pr]);let L=null;const K=Re({},[...Dr,...Eo,...Lr,...ao]);let k=Object.seal(Wo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),F=null,q=null;const se=Object.seal(Wo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ne=!0,be=!0,De=!1,_e=!0,ot=!1,We=!0,rt=!1,pt=!1,vt=!1,Dt=!1,zt=!1,Vt=!1,Mt=!0,Xe=!1;const Ht="user-content-";let Tt=!0,gt=!1,At={},dt=null;const Wt=Re({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let at=null;const Bt=Re({},["audio","video","img","source","image","track"]);let en=null;const Gt=Re({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ot="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",ft="http://www.w3.org/1999/xhtml";let Rt=ft,Ct=!1,tn=null;const bn=Re({},[Ot,Qe,ft],Mo);let qt=Re({},["mi","mo","mn","ms","mtext"]),Zt=Re({},["annotation-xml"]);const yn=Re({},["title","style","font","a","script"]);let Ut=null;const Je=["application/xhtml+xml","text/html"],kn="text/html";let Te=null,Lt=null;const Pe=t.createElement("form"),$t=function(A){return A instanceof RegExp||A instanceof Function},ze=function(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Lt&&Lt===A)){if((!A||typeof A!="object")&&(A={}),A=Qt(A),Ut=Je.indexOf(A.PARSER_MEDIA_TYPE)===-1?kn:A.PARSER_MEDIA_TYPE,Te=Ut==="application/xhtml+xml"?Mo:co,O=jt(A,"ALLOWED_TAGS")?Re({},A.ALLOWED_TAGS,Te):I,L=jt(A,"ALLOWED_ATTR")?Re({},A.ALLOWED_ATTR,Te):K,tn=jt(A,"ALLOWED_NAMESPACES")?Re({},A.ALLOWED_NAMESPACES,Mo):bn,en=jt(A,"ADD_URI_SAFE_ATTR")?Re(Qt(Gt),A.ADD_URI_SAFE_ATTR,Te):Gt,at=jt(A,"ADD_DATA_URI_TAGS")?Re(Qt(Bt),A.ADD_DATA_URI_TAGS,Te):Bt,dt=jt(A,"FORBID_CONTENTS")?Re({},A.FORBID_CONTENTS,Te):Wt,F=jt(A,"FORBID_TAGS")?Re({},A.FORBID_TAGS,Te):Qt({}),q=jt(A,"FORBID_ATTR")?Re({},A.FORBID_ATTR,Te):Qt({}),At=jt(A,"USE_PROFILES")?A.USE_PROFILES:!1,ne=A.ALLOW_ARIA_ATTR!==!1,be=A.ALLOW_DATA_ATTR!==!1,De=A.ALLOW_UNKNOWN_PROTOCOLS||!1,_e=A.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ot=A.SAFE_FOR_TEMPLATES||!1,We=A.SAFE_FOR_XML!==!1,rt=A.WHOLE_DOCUMENT||!1,Dt=A.RETURN_DOM||!1,zt=A.RETURN_DOM_FRAGMENT||!1,Vt=A.RETURN_TRUSTED_TYPE||!1,vt=A.FORCE_BODY||!1,Mt=A.SANITIZE_DOM!==!1,Xe=A.SANITIZE_NAMED_PROPS||!1,Tt=A.KEEP_CONTENT!==!1,gt=A.IN_PLACE||!1,te=A.ALLOWED_URI_REGEXP||xs,Rt=A.NAMESPACE||ft,qt=A.MATHML_TEXT_INTEGRATION_POINTS||qt,Zt=A.HTML_INTEGRATION_POINTS||Zt,k=A.CUSTOM_ELEMENT_HANDLING||{},A.CUSTOM_ELEMENT_HANDLING&&$t(A.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(k.tagNameCheck=A.CUSTOM_ELEMENT_HANDLING.tagNameCheck),A.CUSTOM_ELEMENT_HANDLING&&$t(A.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(k.attributeNameCheck=A.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),A.CUSTOM_ELEMENT_HANDLING&&typeof A.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(k.allowCustomizedBuiltInElements=A.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ot&&(be=!1),zt&&(Dt=!0),At&&(O=Re({},Pr),L=[],At.html===!0&&(Re(O,Er),Re(L,Dr)),At.svg===!0&&(Re(O,Ao),Re(L,Eo),Re(L,ao)),At.svgFilters===!0&&(Re(O,Bo),Re(L,Eo),Re(L,ao)),At.mathMl===!0&&(Re(O,Ro),Re(L,Lr),Re(L,ao))),A.ADD_TAGS&&(typeof A.ADD_TAGS=="function"?se.tagCheck=A.ADD_TAGS:(O===I&&(O=Qt(O)),Re(O,A.ADD_TAGS,Te))),A.ADD_ATTR&&(typeof A.ADD_ATTR=="function"?se.attributeCheck=A.ADD_ATTR:(L===K&&(L=Qt(L)),Re(L,A.ADD_ATTR,Te))),A.ADD_URI_SAFE_ATTR&&Re(en,A.ADD_URI_SAFE_ATTR,Te),A.FORBID_CONTENTS&&(dt===Wt&&(dt=Qt(dt)),Re(dt,A.FORBID_CONTENTS,Te)),A.ADD_FORBID_CONTENTS&&(dt===Wt&&(dt=Qt(dt)),Re(dt,A.ADD_FORBID_CONTENTS,Te)),Tt&&(O["#text"]=!0),rt&&Re(O,["html","head","body"]),O.table&&(Re(O,["tbody"]),delete F.tbody),A.TRUSTED_TYPES_POLICY){if(typeof A.TRUSTED_TYPES_POLICY.createHTML!="function")throw zn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof A.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw zn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');W=A.TRUSTED_TYPES_POLICY,ue=W.createHTML("")}else W===void 0&&(W=Ml(v,r)),W!==null&&typeof ue=="string"&&(ue=W.createHTML(""));yt&&yt(A),Lt=A}},It=Re({},[...Ao,...Bo,...vl]),qe=Re({},[...Ro,...gl]),dn=function(A){let oe=ce(A);(!oe||!oe.tagName)&&(oe={namespaceURI:Rt,tagName:"template"});const me=co(A.tagName),Fe=co(oe.tagName);return tn[A.namespaceURI]?A.namespaceURI===Qe?oe.namespaceURI===ft?me==="svg":oe.namespaceURI===Ot?me==="svg"&&(Fe==="annotation-xml"||qt[Fe]):!!It[me]:A.namespaceURI===Ot?oe.namespaceURI===ft?me==="math":oe.namespaceURI===Qe?me==="math"&&Zt[Fe]:!!qe[me]:A.namespaceURI===ft?oe.namespaceURI===Qe&&!Zt[Fe]||oe.namespaceURI===Ot&&!qt[Fe]?!1:!qe[me]&&(yn[me]||!It[me]):!!(Ut==="application/xhtml+xml"&&tn[A.namespaceURI]):!1},Ne=function(A){Un(n.removed,{element:A});try{ce(A).removeChild(A)}catch{V(A)}},Et=function(A,oe){try{Un(n.removed,{attribute:oe.getAttributeNode(A),from:oe})}catch{Un(n.removed,{attribute:null,from:oe})}if(oe.removeAttribute(A),A==="is")if(Dt||zt)try{Ne(oe)}catch{}else try{oe.setAttribute(A,"")}catch{}},et=function(A){let oe=null,me=null;if(vt)A="<remove></remove>"+A;else{const He=To(A,/^[\r\n\t ]+/);me=He&&He[0]}Ut==="application/xhtml+xml"&&Rt===ft&&(A='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+A+"</body></html>");const Fe=W?W.createHTML(A):A;if(Rt===ft)try{oe=new x().parseFromString(Fe,Ut)}catch{}if(!oe||!oe.documentElement){oe=de.createDocument(Rt,"template",null);try{oe.documentElement.innerHTML=Ct?ue:Fe}catch{}}const Ee=oe.body||oe.documentElement;return A&&me&&Ee.insertBefore(t.createTextNode(me),Ee.childNodes[0]||null),Rt===ft?Z.call(oe,rt?"html":"body")[0]:rt?oe.documentElement:Ee},fn=function(A){return le.call(A.ownerDocument||A,A,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Ze=function(A){return A instanceof C&&(typeof A.nodeName!="string"||typeof A.textContent!="string"||typeof A.removeChild!="function"||!(A.attributes instanceof y)||typeof A.removeAttribute!="function"||typeof A.setAttribute!="function"||typeof A.namespaceURI!="string"||typeof A.insertBefore!="function"||typeof A.hasChildNodes!="function")},nn=function(A){return typeof f=="function"&&A instanceof f};function je(pe,A,oe){so(pe,me=>{me.call(n,A,oe,Lt)})}const mn=function(A){let oe=null;if(je(N.beforeSanitizeElements,A,null),Ze(A))return Ne(A),!0;const me=Te(A.nodeName);if(je(N.uponSanitizeElement,A,{tagName:me,allowedTags:O}),We&&A.hasChildNodes()&&!nn(A.firstElementChild)&&xt(/<[/\w!]/g,A.innerHTML)&&xt(/<[/\w!]/g,A.textContent)||A.nodeType===Wn.progressingInstruction||We&&A.nodeType===Wn.comment&&xt(/<[/\w]/g,A.data))return Ne(A),!0;if(!(se.tagCheck instanceof Function&&se.tagCheck(me))&&(!O[me]||F[me])){if(!F[me]&&hn(me)&&(k.tagNameCheck instanceof RegExp&&xt(k.tagNameCheck,me)||k.tagNameCheck instanceof Function&&k.tagNameCheck(me)))return!1;if(Tt&&!dt[me]){const Fe=ce(A)||A.parentNode,Ee=fe(A)||A.childNodes;if(Ee&&Fe){const He=Ee.length;for(let tt=He-1;tt>=0;--tt){const Ve=B(Ee[tt],!0);Ve.__removalCount=(A.__removalCount||0)+1,Fe.insertBefore(Ve,E(A))}}}return Ne(A),!0}return A instanceof h&&!dn(A)||(me==="noscript"||me==="noembed"||me==="noframes")&&xt(/<\/no(script|embed|frames)/i,A.innerHTML)?(Ne(A),!0):(ot&&A.nodeType===Wn.text&&(oe=A.textContent,so([p,u,b],Fe=>{oe=jn(oe,Fe," ")}),A.textContent!==oe&&(Un(n.removed,{element:A.cloneNode()}),A.textContent=oe)),je(N.afterSanitizeElements,A,null),!1)},Ke=function(A,oe,me){if(Mt&&(oe==="id"||oe==="name")&&(me in t||me in Pe))return!1;if(!(be&&!q[oe]&&xt(j,oe))){if(!(ne&&xt(G,oe))){if(!(se.attributeCheck instanceof Function&&se.attributeCheck(oe,A))){if(!L[oe]||q[oe]){if(!(hn(A)&&(k.tagNameCheck instanceof RegExp&&xt(k.tagNameCheck,A)||k.tagNameCheck instanceof Function&&k.tagNameCheck(A))&&(k.attributeNameCheck instanceof RegExp&&xt(k.attributeNameCheck,oe)||k.attributeNameCheck instanceof Function&&k.attributeNameCheck(oe,A))||oe==="is"&&k.allowCustomizedBuiltInElements&&(k.tagNameCheck instanceof RegExp&&xt(k.tagNameCheck,me)||k.tagNameCheck instanceof Function&&k.tagNameCheck(me))))return!1}else if(!en[oe]){if(!xt(te,jn(me,J,""))){if(!((oe==="src"||oe==="xlink:href"||oe==="href")&&A!=="script"&&fl(me,"data:")===0&&at[A])){if(!(De&&!xt(Q,jn(me,J,"")))){if(me)return!1}}}}}}}return!0},hn=function(A){return A!=="annotation-xml"&&To(A,ee)},Ye=function(A){je(N.beforeSanitizeAttributes,A,null);const{attributes:oe}=A;if(!oe||Ze(A))return;const me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0};let Fe=oe.length;for(;Fe--;){const Ee=oe[Fe],{name:He,namespaceURI:tt,value:Ve}=Ee,$=Te(He),R=Ve;let M=He==="value"?R:ml(R);if(me.attrName=$,me.attrValue=M,me.keepAttr=!0,me.forceKeepAttr=void 0,je(N.uponSanitizeAttribute,A,me),M=me.attrValue,Xe&&($==="id"||$==="name")&&(Et(He,A),M=Ht+M),We&&xt(/((--!?|])>)|<\/(style|title|textarea)/i,M)){Et(He,A);continue}if($==="attributename"&&To(M,"href")){Et(He,A);continue}if(me.forceKeepAttr)continue;if(!me.keepAttr){Et(He,A);continue}if(!_e&&xt(/\/>/i,M)){Et(He,A);continue}ot&&so([p,u,b],ae=>{M=jn(M,ae," ")});const U=Te(A.nodeName);if(!Ke(U,$,M)){Et(He,A);continue}if(W&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!tt)switch(v.getAttributeType(U,$)){case"TrustedHTML":{M=W.createHTML(M);break}case"TrustedScriptURL":{M=W.createScriptURL(M);break}}if(M!==R)try{tt?A.setAttributeNS(tt,He,M):A.setAttribute(He,M),Ze(A)?Ne(A):Rr(n.removed)}catch{Et(He,A)}}je(N.afterSanitizeAttributes,A,null)},on=function pe(A){let oe=null;const me=fn(A);for(je(N.beforeSanitizeShadowDOM,A,null);oe=me.nextNode();)je(N.uponSanitizeShadowNode,oe,null),mn(oe),Ye(oe),oe.content instanceof l&&pe(oe.content);je(N.afterSanitizeShadowDOM,A,null)};return n.sanitize=function(pe){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},oe=null,me=null,Fe=null,Ee=null;if(Ct=!pe,Ct&&(pe="<!-->"),typeof pe!="string"&&!nn(pe))if(typeof pe.toString=="function"){if(pe=pe.toString(),typeof pe!="string")throw zn("dirty is not a string, aborting")}else throw zn("toString is not a function");if(!n.isSupported)return pe;if(pt||ze(A),n.removed=[],typeof pe=="string"&&(gt=!1),gt){if(pe.nodeName){const Ve=Te(pe.nodeName);if(!O[Ve]||F[Ve])throw zn("root node is forbidden and cannot be sanitized in-place")}}else if(pe instanceof f)oe=et("<!---->"),me=oe.ownerDocument.importNode(pe,!0),me.nodeType===Wn.element&&me.nodeName==="BODY"||me.nodeName==="HTML"?oe=me:oe.appendChild(me);else{if(!Dt&&!ot&&!rt&&pe.indexOf("<")===-1)return W&&Vt?W.createHTML(pe):pe;if(oe=et(pe),!oe)return Dt?null:Vt?ue:""}oe&&vt&&Ne(oe.firstChild);const He=fn(gt?pe:oe);for(;Fe=He.nextNode();)mn(Fe),Ye(Fe),Fe.content instanceof l&&on(Fe.content);if(gt)return pe;if(Dt){if(zt)for(Ee=re.call(oe.ownerDocument);oe.firstChild;)Ee.appendChild(oe.firstChild);else Ee=oe;return(L.shadowroot||L.shadowrootmode)&&(Ee=z.call(a,Ee,!0)),Ee}let tt=rt?oe.outerHTML:oe.innerHTML;return rt&&O["!doctype"]&&oe.ownerDocument&&oe.ownerDocument.doctype&&oe.ownerDocument.doctype.name&&xt(bs,oe.ownerDocument.doctype.name)&&(tt="<!DOCTYPE "+oe.ownerDocument.doctype.name+`>
60
+ `+tt),ot&&so([p,u,b],Ve=>{tt=jn(tt,Ve," ")}),W&&Vt?W.createHTML(tt):tt},n.setConfig=function(){let pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ze(pe),pt=!0},n.clearConfig=function(){Lt=null,pt=!1},n.isValidAttribute=function(pe,A,oe){Lt||ze({});const me=Te(pe),Fe=Te(A);return Ke(me,Fe,oe)},n.addHook=function(pe,A){typeof A=="function"&&Un(N[pe],A)},n.removeHook=function(pe,A){if(A!==void 0){const oe=ul(N[pe],A);return oe===-1?void 0:dl(N[pe],oe,1)[0]}return Rr(N[pe])},n.removeHooks=function(pe){N[pe]=[]},n.removeAllHooks=function(){N=Nr()},n}var ks=ys();const Tl={":art:":"🎨",":zap:":"⚡",":fire:":"🔥",":bug:":"🐛",":ambulance:":"🚑",":sparkles:":"✨",":memo:":"📝",":rocket:":"🚀",":lipstick:":"💄",":tada:":"🎉",":white_check_mark:":"✅",":lock:":"🔒",":closed_lock_with_key:":"🔐",":bookmark:":"🔖",":rotating_light:":"🚨",":construction:":"🚧",":green_heart:":"💚",":arrow_down:":"⬇️",":arrow_up:":"⬆️",":pushpin:":"📌",":construction_worker:":"👷",":chart_with_upwards_trend:":"📈",":recycle:":"♻️",":heavy_plus_sign:":"➕",":heavy_minus_sign:":"➖",":wrench:":"🔧",":hammer:":"🔨",":globe_with_meridians:":"🌐",":pencil2:":"✏️",":poop:":"💩",":rewind:":"⏪",":twisted_rightwards_arrows:":"🔀",":package:":"📦",":alien:":"👽",":truck:":"🚚",":page_facing_up:":"📄",":boom:":"💥",":bento:":"🍱",":wheelchair:":"♿",":bulb:":"💡",":beers:":"🍻",":speech_balloon:":"💬",":card_file_box:":"🗃️",":loud_sound:":"🔊",":mute:":"🔇",":busts_in_silhouette:":"👥",":children_crossing:":"🚸",":building_construction:":"🏗️",":iphone:":"📱",":clown_face:":"🤡",":egg:":"🥚",":see_no_evil:":"🙈",":camera_flash:":"📸",":alembic:":"⚗️",":mag:":"🔍",":label:":"🏷️",":seedling:":"🌱",":triangular_flag_on_post:":"🚩",":goal_net:":"🥅",":dizzy:":"💫",":wastebasket:":"🗑️",":passport_control:":"🛂",":adhesive_bandage:":"🩹",":monocle_face:":"🧐",":coffin:":"⚰️",":test_tube:":"🧪",":necktie:":"👔",":stethoscope:":"🩺",":bricks:":"🧱",":technologist:":"🧑‍💻",":money_with_wings:":"💸",":thread:":"🧵",":safety_vest:":"🦺"},Al=/https?:\/\/[^\s<>)"']+/g;function Bl(e){return e.replace(Al,n=>`<a href="${n}" target="_blank" rel="noopener noreferrer" class="text-retro-blue hover:underline">${n}</a>`)}function Rl(e){return e.replace(/:[a-z0-9_]+:/g,n=>Tl[n]||n)}function El(e){if(!e)return"";let n=Rl(e);return n=Oe.parse(n),n=Bl(n),n=ks.sanitize(n,{ALLOWED_TAGS:["a","strong","em","code","b","i","br","p","ul","ol","li","pre","blockquote","h1","h2","h3"],ALLOWED_ATTR:["href","target","rel","class"]}),n}const Pl={class:"flex-shrink-0 flex items-center justify-between px-4 py-2 border-b border-retro-border bg-retro-panel"},Dl={class:"flex items-center gap-2 min-w-0"},Ll={class:"text-retro-cyan font-mono text-sm"},Il={class:"text-retro-muted text-sm truncate"},Nl={class:"flex items-center gap-1 flex-shrink-0"},Fl=["aria-label","title"],Hl={class:"flex-1 overflow-auto p-4 space-y-4"},Ol={class:"space-y-2"},Ul={class:"flex items-center gap-2 text-sm"},jl={class:"text-retro-text font-mono text-xs bg-retro-panel px-2 py-1 rounded"},zl={class:"flex items-center gap-2 text-sm"},Vl={class:"text-retro-text"},Wl={class:"text-retro-muted"},Gl={key:0,class:"flex items-center gap-2 text-sm"},ql={class:"text-retro-text"},Zl={class:"text-retro-muted"},Kl={class:"flex items-center gap-2 text-sm"},Yl={class:"text-retro-text"},Xl={key:1,class:"flex items-start gap-2 text-sm"},Ql={class:"flex flex-wrap gap-1"},Jl=["onClick","title"],ec={key:2,class:"flex items-start gap-2 text-sm"},tc={class:"flex flex-wrap gap-1"},nc={key:3,class:"flex items-start gap-2 text-sm"},oc={class:"flex flex-wrap gap-1"},rc={class:"space-y-1"},sc={class:"text-retro-text text-sm font-mono bg-retro-panel p-3 rounded"},ac={key:0,class:"space-y-1"},ic=["innerHTML"],lc={key:1,class:"space-y-2"},cc={class:"flex items-center gap-2 text-sm"},uc={class:"text-retro-muted"},dc={key:0,class:"flex items-center gap-2"},fc={class:"text-retro-green text-xs font-mono"},mc={class:"flex-1 h-2 rounded overflow-hidden bg-retro-panel flex"},hc={class:"text-retro-red text-xs font-mono"},pc={key:2,class:"space-y-2"},vc={class:"flex items-center justify-between"},gc={class:"text-retro-muted text-xs uppercase tracking-wide"},xc={class:"flex items-center gap-1"},bc={key:0,class:"text-retro-muted text-sm py-2"},yc={key:1,class:"space-y-0.5"},kc=["onClick"],wc=["title"],Cc={class:"text-retro-text font-mono text-xs truncate flex-1"},$c={class:"text-retro-muted"},Sc={class:"text-retro-text"},_c={key:0,class:"flex-shrink-0 font-mono text-xs flex items-center gap-1"},Mc={key:0,class:"text-retro-green"},Tc={key:1,class:"text-retro-red"},Ac={key:1,class:"flex-shrink-0 font-mono text-xs text-retro-muted"},Bc={key:2,class:"space-y-0"},Rc=["onClick"],Ec={class:"text-retro-text font-mono text-xs"},Pc=["title"],Dc={class:"text-retro-text font-mono text-xs truncate flex-1"},Lc={class:"text-retro-muted"},Ic={class:"text-retro-text"},Nc={key:0,class:"flex-shrink-0 font-mono text-xs flex items-center gap-1"},Fc={key:0,class:"text-retro-green"},Hc={key:1,class:"text-retro-red"},Oc={key:1,class:"flex-shrink-0 font-mono text-xs text-retro-muted"},Uc={key:3,class:"flex items-center gap-2 text-retro-muted text-sm py-2"},jc={key:4,class:"text-retro-muted text-sm py-2"},zc=Ce({__name:"GitCommitDetail",props:{commit:{},files:{},stats:{},loading:{type:Boolean,default:!1},committer:{},committerEmail:{},detailPosition:{default:"inline"}},emits:["close","navigateToCommit","togglePosition","navigatePrev","navigateNext","openFileDiff"],setup(e,{emit:n}){const t=e,a=n,r=S(null),l=S("flat"),c=S(new Set),f=H(()=>!t.committer||!t.committerEmail?!1:t.committer!==t.commit.author||t.committerEmail!==t.commit.email),h=H(()=>{const N=t.commit.body;return N?El(N):""}),m=H(()=>{if(!t.stats)return"";const{filesChanged:N,additions:p,deletions:u}=t.stats,j=[`${N} ${N===1?"file":"files"} changed`];return p>0&&j.push(`+${p} insertion${p===1?"":"s"}`),u>0&&j.push(`-${u} deletion${u===1?"":"s"}`),j.join(", ")});function y(N){const p=[];for(const u of N){const b=u.path.split("/");let j=p;for(let G=0;G<b.length;G++){const Q=b[G],J=G===b.length-1,ee=b.slice(0,G+1).join("/");let te=j.find(O=>O.name===Q&&O.isDirectory===!J);te||(te={name:Q,fullPath:ee,isDirectory:!J,children:[],file:J?u:void 0},j.push(te)),J||(j=te.children)}}return C(p),p}function C(N){for(const p of N)if(p.isDirectory)for(C(p.children);p.children.length===1&&p.children[0].isDirectory;){const u=p.children[0];p.name=`${p.name}/${u.name}`,p.fullPath=u.fullPath,p.children=u.children}}function x(N){return[...N].sort((p,u)=>p.isDirectory&&!u.isDirectory?-1:!p.isDirectory&&u.isDirectory?1:p.name.localeCompare(u.name))}function v(N,p,u){const b=[];for(const j of x(N)){const G=u.size===0?!0:u.has(j.fullPath);b.push({key:j.fullPath,depth:p,isDirectory:j.isDirectory,name:j.name,fullPath:j.fullPath,expanded:j.isDirectory?G:!1,file:j.file}),j.isDirectory&&G&&b.push(...v(j.children,p+1,u))}return b}const g=H(()=>!t.files||t.files.length===0?[]:y(t.files)),B=H(()=>v(g.value,0,c.value));function V(N){c.value.has(N)?c.value.delete(N):c.value.add(N),c.value=new Set(c.value)}function E(){const N=p=>{const u=[];for(const b of p)b.isDirectory&&(u.push(b.fullPath),u.push(...N(b.children)));return u};c.value=new Set(N(g.value))}function fe(){c.value=new Set}Ae(l,N=>{N==="tree"&&E()});function ce(N){return new Date(N*1e3).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})}function W(N){return Pn[N]||{label:N,colorClass:"text-retro-muted"}}const ue=H(()=>{if(!t.stats)return{addPct:0,delPct:0};const N=t.stats.additions+t.stats.deletions;return N===0?{addPct:50,delPct:50}:{addPct:Math.round(t.stats.additions/N*100),delPct:Math.round(t.stats.deletions/N*100)}});function de(N){N.key==="ArrowUp"?(N.preventDefault(),a("navigatePrev")):N.key==="ArrowDown"?(N.preventDefault(),a("navigateNext")):N.key==="Escape"&&(N.preventDefault(),a("close"))}st(()=>{cn(()=>{r.value?.focus()})}),Ae(()=>t.commit.hash,()=>{cn(()=>{r.value?.focus()})});function le(){a("close")}function re(N){a("navigateToCommit",N)}function Z(){a("togglePosition")}function z(N){a("openFileDiff",N)}return(N,p)=>(i(),d("section",{ref_key:"containerRef",ref:r,tabindex:0,onKeydown:de,class:"flex-1 min-h-0 flex flex-col border-t border-retro-border bg-retro-dark focus:outline-none","aria-label":"Commit details",role:"region"},[o("div",Pl,[o("div",Dl,[o("span",Ll,T(e.commit.shortHash),1),o("span",Il,T(e.commit.message.split(`
61
+ `)[0]),1)]),o("div",Nl,[o("button",{onClick:Z,class:"p-1 hover:bg-retro-dark rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":e.detailPosition==="inline"?"Dock detail to bottom":"Show detail inline",title:e.detailPosition==="inline"?"Dock to bottom":"Show inline"},[e.detailPosition==="inline"?(i(),ie(s(Zr),{key:0,class:"w-4 h-4 text-retro-muted hover:text-retro-text"})):(i(),ie(s(qr),{key:1,class:"w-4 h-4 text-retro-muted hover:text-retro-text"}))],8,Fl),o("button",{onClick:le,class:"p-1 hover:bg-retro-dark rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":"Close commit details"},[Y(s(ht),{class:"w-4 h-4 text-retro-muted hover:text-retro-text"})])])]),o("div",Hl,[o("div",Ol,[o("div",Ul,[p[2]||(p[2]=o("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Hash:",-1)),o("code",jl,T(e.commit.hash),1)]),o("div",zl,[Y(s(Uo),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),o("span",Vl,T(e.commit.author),1),o("span",Wl,"<"+T(e.commit.email)+">",1)]),f.value?(i(),d("div",Gl,[Y(s(Uo),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),p[3]||(p[3]=o("span",{class:"text-retro-muted text-xs uppercase mr-1"},"Committer:",-1)),o("span",ql,T(e.committer),1),o("span",Zl,"<"+T(e.committerEmail)+">",1)])):P("",!0),o("div",Kl,[Y(s(Xr),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),o("span",Yl,T(ce(e.commit.timestamp)),1)]),e.commit.parents?.length>0?(i(),d("div",Xl,[p[4]||(p[4]=o("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Parents:",-1)),o("div",Ql,[(i(!0),d(he,null,Be(e.commit.parents,u=>(i(),d("button",{key:u,onClick:b=>re(u),class:"text-retro-cyan font-mono text-xs bg-retro-panel px-2 py-0.5 rounded hover:bg-retro-dark hover:text-retro-text transition-colors cursor-pointer focus:outline-none focus:ring-2 focus:ring-retro-cyan",title:`Navigate to parent ${u.substring(0,7)}`},T(u.substring(0,7)),9,Jl))),128))])])):P("",!0),e.commit.branches?.length>0?(i(),d("div",ec,[p[5]||(p[5]=o("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Branches:",-1)),o("div",tc,[(i(!0),d(he,null,Be(e.commit.branches,u=>(i(),d("span",{key:u,class:"text-retro-green font-mono text-xs bg-retro-panel px-2 py-0.5 rounded"},T(u),1))),128))])])):P("",!0),e.commit.tags?.length>0?(i(),d("div",nc,[p[6]||(p[6]=o("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Tags:",-1)),o("div",oc,[(i(!0),d(he,null,Be(e.commit.tags,u=>(i(),d("span",{key:u,class:"text-retro-yellow font-mono text-xs bg-retro-panel px-2 py-0.5 rounded"},T(u),1))),128))])])):P("",!0)]),o("div",rc,[p[7]||(p[7]=o("h4",{class:"text-retro-muted text-xs uppercase tracking-wide"}," Message ",-1)),o("div",sc,T(e.commit.message.split(`
62
+ `)[0]),1)]),e.commit.body?(i(),d("div",ac,[p[8]||(p[8]=o("h4",{class:"text-retro-muted text-xs uppercase tracking-wide"}," Body ",-1)),o("div",{class:"text-retro-text text-sm font-mono bg-retro-panel p-3 rounded commit-body-rendered",innerHTML:h.value},null,8,ic)])):P("",!0),e.stats?(i(),d("div",lc,[o("div",cc,[o("span",uc,T(m.value),1)]),e.stats.additions>0||e.stats.deletions>0?(i(),d("div",dc,[o("span",fc,"+"+T(e.stats.additions),1),o("div",mc,[o("div",{class:"bg-retro-green h-full transition-all",style:Nt({width:ue.value.addPct+"%"})},null,4),o("div",{class:"bg-retro-red h-full transition-all",style:Nt({width:ue.value.delPct+"%"})},null,4)]),o("span",hc,"-"+T(e.stats.deletions),1)])):P("",!0)])):P("",!0),e.files?(i(),d("div",pc,[o("div",vc,[o("h4",gc," Files Changed ("+T(e.files.length)+") ",1),o("div",xc,[o("button",{onClick:p[0]||(p[0]=u=>l.value="flat"),class:ve(["p-1 rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan",l.value==="flat"?"bg-retro-panel text-retro-cyan":"text-retro-muted hover:text-retro-text"]),"aria-label":"Flat file list",title:"Flat file list"},[Y(s(ns),{class:"w-4 h-4"})],2),o("button",{onClick:p[1]||(p[1]=u=>l.value="tree"),class:ve(["p-1 rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan",l.value==="tree"?"bg-retro-panel text-retro-cyan":"text-retro-muted hover:text-retro-text"]),"aria-label":"Tree file view",title:"Tree file view"},[Y(s(Oo),{class:"w-4 h-4"})],2)])]),e.files.length===0?(i(),d("div",bc," No files changed in this commit. ")):l.value==="flat"?(i(),d("ul",yc,[(i(!0),d(he,null,Be(e.files,u=>(i(),d("li",{key:u.path,class:"flex items-center gap-2 text-sm py-1 px-2 hover:bg-retro-panel rounded group cursor-pointer",onClick:b=>z(u)},[o("span",{class:ve(["flex-shrink-0 w-5 h-5 flex items-center justify-center text-xs font-bold rounded",W(u.status).colorClass]),title:W(u.status).label},T(u.status),11,wc),Y(s(qn),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),o("span",Cc,[u.status==="R"&&u.oldPath?(i(),d(he,{key:0},[o("span",$c,T(u.oldPath),1),p[9]||(p[9]=o("span",{class:"text-retro-yellow mx-1"},"→",-1)),o("span",Sc,T(u.path),1)],64)):(i(),d(he,{key:1},[ke(T(u.path),1)],64))]),!u.binary&&(u.additions>0||u.deletions>0)?(i(),d("span",_c,[u.additions>0?(i(),d("span",Mc,"+"+T(u.additions),1)):P("",!0),u.deletions>0?(i(),d("span",Tc,"-"+T(u.deletions),1)):P("",!0)])):u.binary?(i(),d("span",Ac,"binary")):P("",!0)],8,kc))),128))])):(i(),d("div",Bc,[o("div",{class:"flex items-center gap-2 mb-1"},[o("button",{onClick:E,class:"text-xs text-retro-muted hover:text-retro-text transition-colors"}," Expand all "),p[10]||(p[10]=o("span",{class:"text-retro-muted text-xs"},"|",-1)),o("button",{onClick:fe,class:"text-xs text-retro-muted hover:text-retro-text transition-colors"}," Collapse all ")]),(i(!0),d(he,null,Be(B.value,u=>(i(),d("div",{key:u.key,class:ve(["flex items-center gap-1 py-0.5 px-1 hover:bg-retro-panel rounded text-sm cursor-pointer",{"select-none":u.isDirectory}]),style:Nt({paddingLeft:u.depth*16+4+"px"}),onClick:b=>u.isDirectory?V(u.fullPath):u.file?z(u.file):void 0},[u.isDirectory?(i(),d(he,{key:0},[Y(s(Qo),{class:ve(["w-3 h-3 text-retro-muted transition-transform flex-shrink-0",{"rotate-90":u.expanded}])},null,8,["class"]),Y(s(Oo),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),o("span",Ec,T(u.name),1)],64)):u.file?(i(),d(he,{key:1},[o("span",{class:ve(["flex-shrink-0 w-5 h-5 flex items-center justify-center text-xs font-bold rounded",W(u.file.status).colorClass]),title:W(u.file.status).label},T(u.file.status),11,Pc),Y(s(qn),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),o("span",Dc,[u.file.status==="R"&&u.file.oldPath?(i(),d(he,{key:0},[o("span",Lc,T(u.file.oldPath.split("/").pop()),1),p[11]||(p[11]=o("span",{class:"text-retro-yellow mx-1"},"→",-1)),o("span",Ic,T(u.name),1)],64)):(i(),d(he,{key:1},[ke(T(u.name),1)],64))]),!u.file.binary&&(u.file.additions>0||u.file.deletions>0)?(i(),d("span",Nc,[u.file.additions>0?(i(),d("span",Fc,"+"+T(u.file.additions),1)):P("",!0),u.file.deletions>0?(i(),d("span",Hc,"-"+T(u.file.deletions),1)):P("",!0)])):u.file.binary?(i(),d("span",Oc,"binary")):P("",!0)],64)):P("",!0)],14,Rc))),128))]))])):e.loading?(i(),d("div",Uc,[...p[12]||(p[12]=[o("div",{class:"w-3 h-3 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),ke(" Loading file changes... ",-1)])])):(i(),d("div",jc," Failed to load file changes. "))])],544))}}),Vc=Ko(zc,[["__scopeId","data-v-29f450ea"]]),Wc={class:"flex-1 min-h-0 flex flex-col border-t border-retro-border bg-retro-dark","aria-label":"Uncommitted changes details"},Gc={class:"flex-shrink-0 flex items-center justify-between px-4 py-2 border-b border-retro-border bg-retro-panel"},qc={class:"flex items-center gap-2 min-w-0"},Zc={class:"text-retro-muted text-sm"},Kc={key:0,class:"w-3 h-3 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin",title:"Staging..."},Yc={class:"flex-1 overflow-auto p-4 space-y-3"},Xc={class:"space-y-2"},Qc=["disabled"],Jc={class:"space-y-1"},eu={class:"flex items-center justify-between"},tu={class:"text-retro-green text-xs uppercase tracking-wide font-semibold"},nu={key:0,class:"text-retro-muted text-xs py-1"},ou={key:1,class:"space-y-0.5"},ru=["aria-label","onClick"],su={class:"text-retro-text font-mono text-xs truncate"},au={class:"space-y-1"},iu={class:"flex items-center justify-between"},lu={class:"text-retro-yellow text-xs uppercase tracking-wide font-semibold"},cu={key:0,class:"text-retro-muted text-xs py-1"},uu={key:1,class:"space-y-0.5"},du=["aria-label","onClick"],fu={class:"text-retro-text font-mono text-xs truncate"},mu=Ce({__name:"GitUncommittedDetail",props:{stagedFiles:{default:()=>[]},unstagedFiles:{default:()=>[]},isStaging:{type:Boolean,default:!1},isCommitting:{type:Boolean,default:!1}},emits:["close","stageFiles","unstageFiles","stageAll","unstageAll","commit"],setup(e,{emit:n}){const t=e,a=n,r=S(""),l=S(!1),c=H(()=>r.value.trim().length>0&&t.stagedFiles.length>0&&!l.value&&!t.isCommitting);function f(B){return Pn[B]||{label:B,colorClass:"text-retro-muted"}}function h(){a("close")}function m(B){a("stageFiles",[B.path])}function y(B){a("unstageFiles",[B.path])}function C(){a("stageAll")}function x(){a("unstageAll")}async function v(){c.value&&(l.value=!0,a("commit",r.value.trim()),r.value="",l.value=!1)}function g(B){(B.metaKey||B.ctrlKey)&&B.key==="Enter"&&(B.preventDefault(),v())}return(B,V)=>(i(),d("section",Wc,[o("div",Gc,[o("div",qc,[Y(s(Ln),{class:"w-4 h-4 text-retro-yellow"}),V[1]||(V[1]=o("span",{class:"text-retro-yellow font-semibold text-sm"},"Uncommitted Changes",-1)),o("span",Zc,"("+T(e.stagedFiles.length+e.unstagedFiles.length)+" files)",1),t.isStaging?(i(),d("div",Kc)):P("",!0)]),o("button",{onClick:h,class:"p-1 hover:bg-retro-dark rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":"Close uncommitted changes details"},[Y(s(ht),{class:"w-4 h-4 text-retro-muted hover:text-retro-text"})])]),o("div",Yc,[o("div",Xc,[Me(o("textarea",{"onUpdate:modelValue":V[0]||(V[0]=E=>Ie(r)?r.value=E:null),placeholder:"Commit message...",rows:"3",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan resize-none font-mono",onKeydown:g},null,544),[[ut,s(r)]]),o("button",{disabled:!s(c),class:ve(["w-full px-3 py-1.5 text-sm font-semibold rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",s(c)?"bg-retro-green text-retro-dark hover:bg-retro-green/90":"bg-retro-green/30 text-retro-dark"]),onClick:v},T(s(l)||t.isCommitting?"Committing...":`Commit (${e.stagedFiles.length} staged)`),11,Qc)]),o("div",Jc,[o("div",eu,[o("h4",tu," Staged Changes ("+T(e.stagedFiles.length)+") ",1),e.stagedFiles.length>0?(i(),d("button",{key:0,class:"text-[11px] text-retro-muted hover:text-retro-text transition-colors",onClick:x}," Unstage All ")):P("",!0)]),e.stagedFiles.length===0?(i(),d("div",nu," No staged files. Stage files below to commit. ")):(i(),d("ul",ou,[(i(!0),d(he,null,Be(e.stagedFiles,E=>(i(),d("li",{key:"staged-"+E.path,class:"flex items-center gap-2 text-sm py-1 px-2 hover:bg-retro-panel rounded group"},[o("button",{class:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded hover:bg-retro-red/20 transition-colors opacity-60 group-hover:opacity-100",title:"Unstage file","aria-label":`Unstage ${E.path}`,onClick:fe=>y(E)},[Y(s(ia),{class:"w-3.5 h-3.5 text-retro-red"})],8,ru),o("span",{class:ve(["flex-shrink-0 w-4 text-center text-xs font-bold",f(E.status).colorClass])},T(E.status),3),Y(s(qn),{class:"w-3.5 h-3.5 text-retro-muted flex-shrink-0"}),o("span",su,T(E.oldPath?`${E.oldPath} → ${E.path}`:E.path),1)]))),128))]))]),o("div",au,[o("div",iu,[o("h4",lu," Unstaged Changes ("+T(e.unstagedFiles.length)+") ",1),e.unstagedFiles.length>0?(i(),d("button",{key:0,class:"text-[11px] text-retro-muted hover:text-retro-text transition-colors",onClick:C}," Stage All ")):P("",!0)]),e.unstagedFiles.length===0?(i(),d("div",cu," No unstaged changes. ")):(i(),d("ul",uu,[(i(!0),d(he,null,Be(e.unstagedFiles,E=>(i(),d("li",{key:"unstaged-"+E.path,class:"flex items-center gap-2 text-sm py-1 px-2 hover:bg-retro-panel rounded group"},[o("button",{class:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded hover:bg-retro-green/20 transition-colors opacity-60 group-hover:opacity-100",title:"Stage file","aria-label":`Stage ${E.path}`,onClick:fe=>m(E)},[Y(s(vo),{class:"w-3.5 h-3.5 text-retro-green"})],8,du),o("span",{class:ve(["flex-shrink-0 w-4 text-center text-xs font-bold",f(E.status).colorClass])},T(E.status),3),Y(s(qn),{class:"w-3.5 h-3.5 text-retro-muted flex-shrink-0"}),o("span",fu,T(E.oldPath?`${E.oldPath} → ${E.path}`:E.path),1)]))),128))]))])])]))}}),hu=["aria-label"],pu={key:0,class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border truncate font-mono"},vu={key:0,class:"my-1 border-t border-retro-border",role:"separator"},gu=["aria-disabled","onClick","onMouseenter"],xu={key:1,class:"w-4 h-4 flex-shrink-0"},Xn=Ce({__name:"GitContextMenu",props:{items:{},x:{},y:{},title:{}},emits:["close","action"],setup(e,{emit:n}){const t=e,a=n,r=S(null),l=S(-1),c=H(()=>t.items.map((v,g)=>({item:v,i:g})).filter(({item:v})=>!v.disabled).map(({i:v})=>v));let f=!1;function h(v){f&&r.value&&!r.value.contains(v.target)&&a("close")}st(()=>{requestAnimationFrame(()=>{f=!0}),document.addEventListener("mousedown",h),document.addEventListener("contextmenu",h),cn(()=>{r.value?.focus()})}),_t(()=>{f=!1,document.removeEventListener("mousedown",h),document.removeEventListener("contextmenu",h)});function m(v){const g=c.value;if(g.length===0)return;if(l.value===-1){l.value=v===1?g[0]:g[g.length-1];return}const B=g.indexOf(l.value);if(B===-1){l.value=v===1?g[0]:g[g.length-1];return}const V=B+v;V>=0&&V<g.length&&(l.value=g[V])}function y(v){switch(v.key){case"Escape":v.preventDefault(),a("close");break;case"ArrowDown":v.preventDefault(),m(1);break;case"ArrowUp":v.preventDefault(),m(-1);break;case"Enter":{v.preventDefault();const g=t.items[l.value];g&&!g.disabled&&(a("action",g.key),a("close"));break}}}function C(v){v.disabled||(a("action",v.key),a("close"))}const x=H(()=>{const g=t.title?29:0,B=t.items.filter(ue=>ue.separator).length,V=t.items.length*36+B*9+8,E=g+V,fe=8;let ce=t.x,W=t.y;return typeof window<"u"&&(ce+220>window.innerWidth-fe&&(ce=window.innerWidth-220-fe),ce<fe&&(ce=fe),W+E>window.innerHeight-fe&&(W=window.innerHeight-E-fe),W<fe&&(W=fe)),{left:`${ce}px`,top:`${W}px`}});return(v,g)=>(i(),ie(Jt,{to:"body"},[o("div",{ref_key:"menuRef",ref:r,class:"fixed z-50 bg-retro-panel border border-retro-border rounded shadow-lg py-1 min-w-[220px]",style:Nt(s(x)),role:"menu","aria-label":e.title??"Context menu",tabindex:"-1",onKeydown:y},[e.title?(i(),d("div",pu,T(e.title),1)):P("",!0),(i(!0),d(he,null,Be(e.items,(B,V)=>(i(),d(he,{key:B.key},[B.separator?(i(),d("div",vu)):P("",!0),o("button",{class:ve(["w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors focus:outline-none",[B.disabled?"text-retro-muted/50 cursor-not-allowed":B.danger?["text-retro-red hover:bg-retro-red/10 focus:bg-retro-red/10",s(l)===V?"bg-retro-red/10":""]:["text-retro-text hover:bg-retro-cyan/10 focus:bg-retro-cyan/10",s(l)===V?"bg-retro-cyan/10":""]]]),role:"menuitem","aria-disabled":B.disabled||void 0,tabindex:-1,onClick:E=>C(B),onMouseenter:E=>l.value=B.disabled?s(l):V,onMouseleave:g[0]||(g[0]=E=>l.value=-1)},[B.icon?(i(),ie(Rn(B.icon),{key:0,class:ve(["w-4 h-4 flex-shrink-0",B.disabled?"opacity-50":B.danger?"":"text-retro-muted"])},null,8,["class"])):(i(),d("span",xu)),ke(" "+T(B.label),1)],42,gu)],64))),128))],44,hu)]))}}),bu=Ce({__name:"GitBranchMenu",props:{branchName:{},isCurrentBranch:{type:Boolean},isLocal:{type:Boolean},x:{},y:{}},emits:["close","checkout","createBranch","deleteBranch","rename","merge","rebase","push","pull","fetch","copyName"],setup(e,{emit:n}){const t=e,a=n,r=H(()=>[{key:"checkout",label:"Checkout",icon:xn,disabled:t.isCurrentBranch},{key:"rename",label:"Rename",icon:os,separator:!0},{key:"deleteBranch",label:"Delete",icon:un,danger:!0,disabled:t.isCurrentBranch},{key:"merge",label:"Merge into Current",icon:Kr,separator:!0,disabled:t.isCurrentBranch},{key:"rebase",label:"Rebase Current Onto",icon:Vr,disabled:t.isCurrentBranch},{key:"push",label:"Push",icon:Wr,separator:!0},{key:"copyName",label:"Copy Branch Name",icon:En,separator:!0}]),l=H(()=>[{key:"checkout",label:"Checkout",icon:xn},{key:"deleteBranch",label:"Delete Remote Branch",icon:un,separator:!0,danger:!0},{key:"fetch",label:"Fetch",icon:Qr,separator:!0},{key:"pull",label:"Pull into Current",icon:zs},{key:"copyName",label:"Copy Branch Name",icon:En,separator:!0}]),c=H(()=>t.isLocal?r.value:l.value),f={checkout:()=>a("checkout"),createBranch:()=>a("createBranch"),deleteBranch:()=>a("deleteBranch"),rename:()=>a("rename"),merge:()=>a("merge"),rebase:()=>a("rebase"),push:()=>a("push"),pull:()=>a("pull"),fetch:()=>a("fetch"),copyName:()=>a("copyName")};function h(m){const y=f[m];y&&y(),a("close")}return(m,y)=>{const C=Xn;return i(),ie(C,{items:s(c),x:e.x,y:e.y,title:e.branchName,onAction:h,onClose:y[0]||(y[0]=x=>a("close"))},null,8,["items","x","y","title"])}}}),yu=Ce({__name:"GitCommitMenu",props:{commit:{},x:{},y:{}},emits:["close","addTag","createBranch","checkout","cherryPick","revert","mergeInto","reset","copyHash","copySubject"],setup(e,{emit:n}){const t=n,a=H(()=>[{key:"addTag",label:"Add Tag",icon:rr},{key:"createBranch",label:"Create Branch",icon:vo},{key:"checkout",label:"Checkout (detached HEAD)",icon:xn,separator:!0},{key:"cherryPick",label:"Cherry Pick",icon:Js},{key:"revert",label:"Revert",icon:Gr},{key:"mergeInto",label:"Merge into Current",icon:Kr,separator:!0},{key:"reset",label:"Reset Current Branch to Here",icon:Vr,danger:!0},{key:"copyHash",label:"Copy Commit Hash",icon:En,separator:!0},{key:"copySubject",label:"Copy Commit Subject",icon:En}]),r={addTag:()=>t("addTag"),createBranch:()=>t("createBranch"),checkout:()=>t("checkout"),cherryPick:()=>t("cherryPick"),revert:()=>t("revert"),mergeInto:()=>t("mergeInto"),reset:()=>t("reset"),copyHash:()=>t("copyHash"),copySubject:()=>t("copySubject")};function l(c){const f=r[c];f&&f(),t("close")}return(c,f)=>{const h=Xn;return i(),ie(h,{items:s(a),x:e.x,y:e.y,title:e.commit.shortHash,onAction:l,onClose:f[0]||(f[0]=m=>t("close"))},null,8,["items","x","y","title"])}}}),ku=Ce({__name:"GitTagMenu",props:{tagName:{},x:{},y:{}},emits:["close","viewDetails","deleteTag","pushTag","copyName"],setup(e,{emit:n}){const t=n,a=[{key:"viewDetails",label:"View Details",icon:rr},{key:"deleteTag",label:"Delete Tag",icon:un,separator:!0,danger:!0},{key:"pushTag",label:"Push Tag",icon:Wr},{key:"copyName",label:"Copy Tag Name",icon:En,separator:!0}];function r(l){switch(l){case"viewDetails":t("viewDetails");break;case"deleteTag":t("deleteTag");break;case"pushTag":t("pushTag");break;case"copyName":t("copyName");break}}return(l,c)=>{const f=Xn;return i(),ie(f,{items:a,x:e.x,y:e.y,title:e.tagName,onClose:c[0]||(c[0]=h=>t("close")),onAction:r},null,8,["x","y","title"])}}}),wu=Ce({__name:"GitStashMenu",props:{stashIndex:{},stashMessage:{},x:{},y:{}},emits:["close","apply","pop","drop","createBranch","copyName","copyHash"],setup(e,{emit:n}){const t=n,a=[{key:"apply",label:"Apply Stash",icon:js},{key:"pop",label:"Pop Stash",icon:Gr},{key:"createBranch",label:"Create Branch from Stash",icon:Ho,separator:!0},{key:"drop",label:"Drop Stash",icon:un,separator:!0,danger:!0},{key:"copyName",label:"Copy Stash Reference",icon:En,separator:!0},{key:"copyHash",label:"Copy Stash Hash",icon:ra}];function r(l){switch(l){case"apply":t("apply");break;case"pop":t("pop");break;case"drop":t("drop");break;case"createBranch":t("createBranch");break;case"copyName":t("copyName");break;case"copyHash":t("copyHash");break}}return(l,c)=>{const f=Xn;return i(),ie(f,{items:a,x:e.x,y:e.y,title:e.stashMessage,onClose:c[0]||(c[0]=h=>t("close")),onAction:r},null,8,["x","y","title"])}}}),Cu=Ce({__name:"GitUncommittedMenu",props:{x:{},y:{}},emits:["close","stash","reset","clean"],setup(e,{emit:n}){const t=n,a=[{key:"stash",label:"Stash Uncommitted Changes",icon:Us},{key:"reset",label:"Reset Working Directory",icon:xn,separator:!0,danger:!0},{key:"clean",label:"Clean Untracked Files",icon:un,danger:!0}];function r(l){switch(l){case"stash":t("stash");break;case"reset":t("reset");break;case"clean":t("clean");break}}return(l,c)=>{const f=Xn;return i(),ie(f,{items:a,x:e.x,y:e.y,title:"Uncommitted Changes",onClose:c[0]||(c[0]=h=>t("close")),onAction:r},null,8,["x","y"])}}}),$u={class:"w-full max-w-md mx-4 bg-retro-dark border border-retro-border rounded-lg shadow-xl"},Su={class:"flex items-center justify-between px-4 py-3 border-b border-retro-border"},_u={class:"text-sm font-mono text-retro-text"},Mu={class:"p-4"},Tu={key:0,class:"mb-3 p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},Au={class:"flex justify-end gap-2 px-4 py-3 border-t border-retro-border"},Bu=["disabled"],Ru=["disabled"],wt=Ce({__name:"GitDialog",props:{title:{},visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null},confirmLabel:{default:"Confirm"},confirmDanger:{type:Boolean,default:!1},cancelLabel:{default:"Cancel"}},emits:["close","confirm"],setup(e,{emit:n}){const t=e,a=n;function r(l){l.key==="Escape"&&a("close"),l.key==="Enter"&&!t.loading&&(l.preventDefault(),a("confirm"))}return Ae(()=>t.visible,l=>{l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r)}),_t(()=>{document.removeEventListener("keydown",r)}),(l,c)=>(i(),ie(Jt,{to:"body"},[Y($n,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:Ge(()=>[e.visible?(i(),d("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",role:"dialog","aria-modal":"true",onClick:c[3]||(c[3]=lt(f=>a("close"),["self"]))},[o("div",$u,[o("div",Su,[o("h3",_u,T(e.title),1),o("button",{type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close",onClick:c[0]||(c[0]=f=>a("close"))},[Y(s(ht),{class:"h-4 w-4"})])]),o("div",Mu,[e.error?(i(),d("div",Tu,T(e.error),1)):P("",!0),As(l.$slots,"default")]),o("div",Au,[o("button",{type:"button",class:"px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-text bg-retro-panel hover:bg-retro-border rounded transition-colors",disabled:e.loading,onClick:c[1]||(c[1]=f=>a("close"))},T(e.cancelLabel),9,Bu),o("button",{type:"button",class:ve(["px-3 py-1.5 text-xs font-mono rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",[e.confirmDanger?"text-retro-red bg-retro-red/10 border border-retro-red/30 hover:bg-retro-red/20":"text-retro-black bg-retro-cyan hover:bg-retro-cyan/80"]]),disabled:e.loading,onClick:c[2]||(c[2]=f=>a("confirm"))},T(e.loading?"Loading...":e.confirmLabel),11,Ru)])])])):P("",!0)]),_:3})]))}}),Qn=po("gitGraph",()=>{const e=S([]),n=S([]),t=S([]),a=S(new Set),r=S([]),l=S([]),c=S(0),f=S(!1),h=S(null),m=S(null),y=S(null),C=S(!1),x=S(null),v=S(!1),g=S(0),B=S(""),V=S([]),E=S(null),fe=S(!1),ce=S(!1),W=S(!1),ue=S(!1),de=S(null);let le=null;function re(D){de.value=D,le&&clearTimeout(le),le=setTimeout(()=>{de.value=null},8e3)}function Z(){de.value=null,le&&(clearTimeout(le),le=null)}async function z(D,X,ye,ct){if(!E.value)return{success:!1,error:"No working directory set"};try{const Kt=await $fetch(D,{method:ct?.method??"POST",body:{workingDirectory:E.value,...X}});return(ct?.reloadGraph??!0)&&await Mt(E.value),{success:!0,data:Kt}}catch(Kt){const Yt=oo(Kt,ye);return re(Yt),{success:!1,error:Yt}}}const N=S(null),p=S(!1),u=S(!1),b=S(null),j=S([]),G=S([]),Q=S(null),J=S(null),ee=S(null),te=S("inline"),O=S("list"),I=S("rounded"),L=S(!1),K=S({date:!0,author:!0,commit:!0}),k=S(0),F=S(0),q=S(null),se=S(null),ne=S(null),be=S(null),De=S(null),_e=S(null),ot=S(null),We=S(null),rt=S(null),pt=S(!1),vt=new Map,Dt=10,zt=H(()=>{if(!B.value&&V.value.length===0)return e.value;let D=e.value;if(B.value){const X=B.value.toLowerCase(),ye=`${X}:${e.value.length}`;if(vt.has(ye))D=vt.get(ye);else{if(D=$r(D,X),vt.size>=Dt){const ct=vt.keys().next().value;ct&&vt.delete(ct)}vt.set(ye,D)}}if(V.value.length>0){const X=new Set(V.value);D=ai(D,X)}return D}),Vt=H(()=>n.value.find(D=>D.isHead)||null);async function Mt(D){E.value=D,C.value=!0,x.value=null;try{const[X,ye,ct,Kt,Yt]=await Promise.all([$fetch("/api/git/log",{query:{workingDirectory:D}}),$fetch("/api/git/status",{query:{workingDirectory:D}}),$fetch("/api/git/stash",{query:{workingDirectory:D}}).then(pn=>pn.stashes).catch(()=>[]),$fetch("/api/git/remotes",{query:{workingDirectory:D}}).then(pn=>pn.remotes).catch(()=>[]),$fetch("/api/git/state",{query:{workingDirectory:D}}).then(pn=>pn.state).catch(()=>null)]);e.value=X.commits,n.value=X.branches,t.value=X.tags,a.value=new Set(X.localBranches??[]),v.value=X.hasMore,g.value=X.totalCount,r.value=ye.stagedFiles??[],l.value=ye.unstagedFiles??[],c.value=(ye.stagedCount??0)+(ye.unstagedCount??0),j.value=ct,G.value=Kt,b.value=Yt,N.value=Date.now(),await U()}catch(X){const ye=X instanceof Error?X.message:"Failed to load git graph";x.value=ye,e.value=[],n.value=[],t.value=[],r.value=[],l.value=[],c.value=0,j.value=[],G.value=[]}finally{C.value=!1}}async function Xe(){if(E.value)try{const D=await $fetch("/api/git/status",{query:{workingDirectory:E.value}});r.value=D.stagedFiles??[],l.value=D.unstagedFiles??[],c.value=(D.stagedCount??0)+(D.unstagedCount??0)}catch(D){console.error("Failed to refresh uncommitted changes:",D)}}const Ht=S(!1);async function Tt(){if(!(!E.value||!v.value||C.value||Ht.value)){Ht.value=!0;try{const D=await $fetch("/api/git/log",{query:{workingDirectory:E.value,offset:e.value.length}});e.value=[...e.value,...D.commits],v.value=D.hasMore}catch(D){console.error("Failed to load more commits:",D)}finally{Ht.value=!1}}}async function gt(D){if(h.value=D,m.value=null,y.value=null,f.value=!1,fe.value=!0,!E.value){fe.value=!1;return}try{const X=await $fetch("/api/git/show",{query:{workingDirectory:E.value,hash:D.hash}});m.value=X.files,y.value=X.stats}catch(X){console.error("Failed to load commit details:",X),m.value=[],y.value={additions:0,deletions:0,filesChanged:0},re("Failed to load commit details")}finally{fe.value=!1}}function At(){h.value=null,m.value=null,y.value=null,f.value=!1}function dt(){h.value=null,y.value=null,m.value=null,f.value=!0}function Wt(D){B.value=D,k.value=0,Bt()}const at=H(()=>B.value?$r(e.value,B.value).map(D=>D.hash):[]);function Bt(){F.value=at.value.length}function en(){at.value.length!==0&&(k.value=(k.value+1)%at.value.length,Bt(),Ot())}function Gt(){at.value.length!==0&&(k.value=k.value<=0?at.value.length-1:k.value-1,Bt(),Ot())}function Ot(){const D=at.value[k.value];if(D){const X=e.value.find(ye=>ye.hash===D);X&&gt(X)}}function Qe(D){const X=V.value.indexOf(D);X===-1?V.value.push(D):V.value.splice(X,1)}function ft(){B.value="",V.value=[]}async function Rt(D){if(!E.value)return{success:!1,error:"No working directory set"};ue.value=!0;try{const X=await $fetch("/api/git/checkout",{method:"POST",body:{workingDirectory:E.value,branchName:D}});return X.success&&await Mt(E.value),{success:X.success,error:X.error}}catch(X){const ye=X instanceof Error?X.message:"Failed to checkout branch";return re(ye),{success:!1,error:ye}}finally{ue.value=!1}}async function Ct(D,X){if(!E.value)return{success:!1,error:"No working directory set"};try{const ye=await $fetch("/api/git/checkout",{method:"POST",body:{workingDirectory:E.value,branchName:D,createBranch:!0,fromCommit:X}});return ye.success&&await Mt(E.value),{success:ye.success,error:ye.error}}catch(ye){return{success:!1,error:ye instanceof Error?ye.message:"Failed to create branch"}}}async function tn(D,X=!1){return z("/api/git/branch",{branchName:D,force:X},"Failed to delete branch",{method:"DELETE"})}async function bn(D){return z("/api/git/branch",{branchName:D,remote:!0},"Failed to delete remote branch",{method:"DELETE"})}async function qt(D){if(!E.value)return{success:!1,error:"No working directory set"};ce.value=!0;try{return await $fetch("/api/git/stage",{method:"POST",body:{workingDirectory:E.value,files:D}}),await Xe(),{success:!0}}catch(X){const ye=X instanceof Error?X.message:"Failed to stage files";return re(ye),{success:!1,error:ye}}finally{ce.value=!1}}async function Zt(D){if(!E.value)return{success:!1,error:"No working directory set"};ce.value=!0;try{return await $fetch("/api/git/unstage",{method:"POST",body:{workingDirectory:E.value,files:D}}),await Xe(),{success:!0}}catch(X){const ye=X instanceof Error?X.message:"Failed to unstage files";return re(ye),{success:!1,error:ye}}finally{ce.value=!1}}async function yn(D){if(!E.value)return{success:!1,error:"No working directory set"};W.value=!0;try{return await $fetch("/api/git/commit",{method:"POST",body:{workingDirectory:E.value,message:D}}),await Mt(E.value),{success:!0}}catch(X){const ye=X instanceof Error?X.message:"Failed to commit changes";return re(ye),{success:!1,error:ye}}finally{W.value=!1}}async function Ut(D,X){return z("/api/git/branch-rename",{oldName:D,newName:X},"Failed to rename branch")}async function Je(D,X){return z("/api/git/merge",{branch:D,...X},"Failed to merge branch")}async function kn(D){return z("/api/git/rebase",{onto:D},"Failed to rebase branch")}async function Te(D,X,ye,ct){return z("/api/git/push",{branch:D,remote:X,force:ye,forceWithLease:ct},"Failed to push branch")}async function Lt(D,X,ye,ct){return z("/api/git/pull",{branch:D,remote:X,noFastForward:ye,squash:ct},"Failed to pull branch")}async function Pe(D,X,ye){return z("/api/git/fetch",{branch:D,remote:X,...ye},"Failed to fetch")}async function $t(D,X,ye){return z("/api/git/cherry-pick",{hash:D,recordOrigin:X,noCommit:ye},"Failed to cherry-pick commit")}async function ze(D){return z("/api/git/revert",{hash:D},"Failed to revert commit")}async function It(D,X){return z("/api/git/reset",{hash:D,mode:X},"Failed to reset to commit")}async function qe(D){if(!E.value)return{success:!1,error:"No working directory set"};try{return await $fetch("/api/git/checkout",{method:"POST",body:{workingDirectory:E.value,branchName:D}}),await Mt(E.value),{success:!0}}catch(X){const ye=X?.data?.message||X?.statusMessage||X?.message||"Failed to checkout commit";return re(ye),{success:!1,error:ye}}}async function dn(D){try{const X=D.message.split(`
63
+ `)[0];return await In(X),{success:!0}}catch(X){const ye=X?.message||"Failed to copy commit subject";return re(ye),{success:!1,error:ye}}}async function Ne(D,X,ye,ct,Kt){return z("/api/git/tag",{name:D,hash:X,annotated:ye,message:ct,pushToRemote:Kt},"Failed to create tag")}async function Et(D,X){return z("/api/git/tag",{name:D,deleteFromRemote:X},"Failed to delete tag",{method:"DELETE"})}async function et(D,X){return z("/api/git/tag-push",{name:D,remote:X},"Failed to push tag")}async function fn(D){if(!E.value)return{success:!1,error:"No working directory set"};try{return{success:!0,data:await $fetch(`/api/git/tag/${encodeURIComponent(D)}`,{query:{workingDirectory:E.value}})}}catch(X){const ye=oo(X,"Failed to get tag detail");return re(ye),{success:!1,error:ye}}}async function Ze(D){try{return await In(D),{success:!0}}catch(X){const ye=X?.message||"Failed to copy tag name";return re(ye),{success:!1,error:ye}}}async function nn(){if(!E.value)return{success:!1,error:"No working directory set"};try{const D=await $fetch("/api/git/stash",{query:{workingDirectory:E.value}});return j.value=D.stashes,{success:!0}}catch(D){const X=oo(D,"Failed to load stashes");return re(X),{success:!1,error:X}}}async function je(D,X){return z("/api/git/stash-apply",{index:D,reinstateIndex:X},"Failed to apply stash")}async function mn(D,X){return z("/api/git/stash-pop",{index:D,reinstateIndex:X},"Failed to pop stash")}async function Ke(D){return z("/api/git/stash-drop",{index:D},"Failed to drop stash")}async function hn(D,X){return z("/api/git/stash-branch",{index:D,branchName:X},"Failed to create branch from stash")}async function Ye(D,X){return z("/api/git/stash",{message:D,includeUntracked:X},"Failed to stash changes")}async function on(){if(!E.value)return{success:!1,error:"No working directory set"};try{const D=await $fetch("/api/git/remotes",{query:{workingDirectory:E.value}});return G.value=D.remotes,{success:!0}}catch(D){const X=oo(D,"Failed to load remotes");return re(X),{success:!1,error:X}}}async function pe(D,X){return z("/api/git/remote",{name:D,url:X},"Failed to add remote")}async function A(D,X){return z("/api/git/remote",{name:D,newUrl:X},"Failed to edit remote",{method:"PUT"})}async function oe(D){return z("/api/git/remote",{name:D},"Failed to delete remote",{method:"DELETE"})}async function me(D,X){return z("/api/git/fetch",{all:!0,prune:D,pruneTags:X},"Failed to fetch all")}function Fe(){te.value=te.value==="inline"?"bottom":"inline"}function Ee(){O.value=O.value==="list"?"tree":"list"}function He(D){I.value=D}function tt(){L.value=!L.value}function Ve(D){K.value={...K.value,[D]:!K.value[D]}}async function $(D){if(q.value=D,se.value=null,D&&E.value)try{const X=await $fetch("/api/git/merge-base",{params:{workingDirectory:E.value,branch:D}});se.value=X.mergeBase}catch{se.value=null}}async function R(D){if(ne.value=D,be.value=null,D&&E.value)try{const X=await $fetch("/api/git/merge-base",{params:{workingDirectory:E.value,branch:D}});be.value=X.mergeBase}catch{be.value=null}}async function M(D){if(De.value=D,_e.value=null,D&&E.value)try{const X=await $fetch("/api/git/merge-base",{params:{workingDirectory:E.value,branch:D}});_e.value=X.mergeBase}catch{_e.value=null}}async function U(){if(!E.value)return;const D=[];q.value&&D.push((async()=>{try{const X=await $fetch("/api/git/merge-base",{params:{workingDirectory:E.value,branch:q.value}});se.value=X.mergeBase}catch{se.value=null}})()),ne.value&&D.push((async()=>{try{const X=await $fetch("/api/git/merge-base",{params:{workingDirectory:E.value,branch:ne.value}});be.value=X.mergeBase}catch{be.value=null}})()),De.value&&D.push((async()=>{try{const X=await $fetch("/api/git/merge-base",{params:{workingDirectory:E.value,branch:De.value}});_e.value=X.mergeBase}catch{_e.value=null}})()),D.length>0&&await Promise.all(D)}function ae(D){const X=e.value.find(ye=>ye.hash===D||ye.shortHash===D);X&&gt(X)}async function xe(D){return z("/api/git/reset",{hash:"HEAD",mode:D},"Failed to reset working directory")}async function we(){return z("/api/git/clean",{},"Failed to clean untracked files")}function Se(D){J.value=D}function w(){J.value=null}function _(D){ee.value=D}function Le(){ee.value=null}const it=S(null),St=S(null),wn=S(!1),wo=H(()=>!!Q.value&&!!h.value);function Co(D){Q.value=D,D&&h.value&&Jn()}function $o(){Q.value=null,it.value=null,St.value=null,wn.value=!1}async function Jn(){if(!(!E.value||!h.value||!Q.value)){wn.value=!0;try{const D=Q.value.hash,X=h.value.hash,ye=await $fetch("/api/git/diff",{query:{workingDirectory:E.value,from:D,to:X}});it.value=ye.files,St.value=ye.stats}catch(D){console.error("Failed to load comparison:",D),re("Failed to load commit comparison"),it.value=null,St.value=null}finally{wn.value=!1}}}async function In(D){navigator?.clipboard&&await navigator.clipboard.writeText(D)}async function So(D,X){ot.value=X,We.value=D,rt.value=null,pt.value=!0,await Nn()}function _o(){ot.value=null,We.value=null,rt.value=null,pt.value=!1}async function Nn(){if(!E.value||!We.value||!ot.value){pt.value=!1;return}pt.value=!0;try{const D=await $fetch("/api/git/file-diff",{query:{workingDirectory:E.value,commitHash:We.value,filePath:ot.value.path}});rt.value=D}catch(D){console.error("Failed to load file diff:",D),re("Failed to load file diff"),rt.value=null}finally{pt.value=!1}}function $e(){e.value=[],n.value=[],t.value=[],a.value=new Set,r.value=[],l.value=[],c.value=0,f.value=!1,h.value=null,m.value=null,y.value=null,C.value=!1,x.value=null,v.value=!1,g.value=0,B.value="",V.value=[],E.value=null,N.value=null,p.value=!1,u.value=!1,b.value=null,Ht.value=!1,fe.value=!1,ce.value=!1,W.value=!1,ue.value=!1,j.value=[],G.value=[],Q.value=null,it.value=null,St.value=null,wn.value=!1,J.value=null,ee.value=null,te.value="inline",O.value="list",I.value="rounded",L.value=!1,K.value={date:!0,author:!0,commit:!0},k.value=0,F.value=0,q.value=null,ne.value=null,be.value=null,De.value=null,_e.value=null,ot.value=null,We.value=null,rt.value=null,pt.value=!1,Z(),vt.clear()}async function Fn(){if(!E.value||u.value||C.value)return!1;u.value=!0;try{const D=(await $fetch("/api/git/state",{query:{workingDirectory:E.value}})).state,X=b.value;if(b.value=D,N.value=Date.now(),!X)return!1;const ye=X.headCommit!==D.headCommit||X.branchListHash!==D.branchListHash,ct=X.workingTreeHash!==D.workingTreeHash,Kt=X.stashListHash!==D.stashListHash;if(ye){const[vn,eo,_s]=await Promise.all([$fetch("/api/git/log",{query:{workingDirectory:E.value}}),$fetch("/api/git/status",{query:{workingDirectory:E.value}}),$fetch("/api/git/stash",{query:{workingDirectory:E.value}}).then(Ms=>Ms.stashes).catch(()=>[])]);return e.value=vn.commits,n.value=vn.branches,t.value=vn.tags,a.value=new Set(vn.localBranches??[]),v.value=vn.hasMore,g.value=vn.totalCount,r.value=eo.stagedFiles??[],l.value=eo.unstagedFiles??[],c.value=(eo.stagedCount??0)+(eo.unstagedCount??0),j.value=_s,await U(),!0}if(!ct&&!Kt)return!1;const[Yt,pn]=await Promise.all([ct?$fetch("/api/git/status",{query:{workingDirectory:E.value}}):Promise.resolve(null),Kt?$fetch("/api/git/stash",{query:{workingDirectory:E.value}}).then(vn=>vn.stashes).catch(()=>[]):Promise.resolve(null)]);return Yt&&(r.value=Yt.stagedFiles??[],l.value=Yt.unstagedFiles??[],c.value=(Yt.stagedCount??0)+(Yt.unstagedCount??0)),pn&&(j.value=pn),!0}catch(D){return console.error("Failed to refresh git graph:",D),!1}finally{u.value=!1}}function Tn(){p.value=!0}function vr(){p.value=!1}return{commits:ge(e),branches:ge(n),tags:ge(t),localBranchNames:ge(a),stagedFiles:ge(r),unstagedFiles:ge(l),uncommittedChangesCount:ge(c),isUncommittedChangesSelected:ge(f),selectedCommit:ge(h),selectedCommitFiles:ge(m),selectedCommitStats:ge(y),loading:ge(C),loadingMore:ge(Ht),error:ge(x),hasMore:ge(v),totalCount:ge(g),searchQuery:ge(B),filteredBranches:ge(V),workingDirectory:ge(E),stashes:ge(j),remotes:ge(G),comparisonCommit:ge(Q),comparisonFiles:ge(it),comparisonStats:ge(St),comparisonLoading:ge(wn),isComparing:wo,activeDialog:ge(J),activeContextMenu:ge(ee),detailViewPosition:ge(te),fileViewMode:ge(O),graphStyle:ge(I),muteNonAncestral:ge(L),columnVisibility:ge(K),searchResultIndex:ge(k),searchResultCount:ge(F),selectedFeatureId:ge(q),featureMergeBase:ge(se),conversationBranch:ge(ne),conversationMergeBase:ge(be),previewBranch:ge(De),previewMergeBase:ge(_e),diffViewerFile:ge(ot),diffViewerCommitHash:ge(We),diffViewerContent:ge(rt),diffViewerLoading:ge(pt),lastRefreshTime:ge(N),isPollingActive:ge(p),isRefreshing:ge(u),isLoadingDetails:ge(fe),isStaging:ge(ce),isCommitting:ge(W),isCheckingOut:ge(ue),operationError:ge(de),filteredCommits:zt,currentBranch:Vt,searchResultHashes:at,loadGitGraph:Mt,loadMoreCommits:Tt,refreshUncommittedChanges:Xe,selectCommit:gt,selectUncommittedChanges:dt,clearSelection:At,setSearchQuery:Wt,toggleBranchFilter:Qe,clearFilters:ft,nextSearchResult:en,prevSearchResult:Gt,checkoutBranch:Rt,createBranch:Ct,deleteLocalBranch:tn,deleteRemoteBranch:bn,stageFiles:qt,unstageFiles:Zt,commitChanges:yn,reset:$e,clearOperationError:Z,renameBranch:Ut,mergeBranch:Je,rebaseBranch:kn,pushBranch:Te,pullBranch:Lt,fetchBranch:Pe,cherryPickCommit:$t,revertCommit:ze,resetToCommit:It,checkoutCommit:qe,copyCommitSubject:dn,createTag:Ne,deleteTag:Et,pushTag:et,getTagDetail:fn,copyTagName:Ze,loadStashes:nn,applyStash:je,popStash:mn,dropStash:Ke,stashBranch:hn,stashChanges:Ye,loadRemotes:on,addRemote:pe,editRemote:A,deleteRemote:oe,fetchAll:me,setActiveDialog:Se,clearActiveDialog:w,setActiveContextMenu:_,clearActiveContextMenu:Le,selectComparisonCommit:Co,clearComparison:$o,loadComparisonData:Jn,copyToClipboard:In,toggleDetailViewPosition:Fe,toggleFileViewMode:Ee,setGraphStyle:He,toggleMuteNonAncestral:tt,toggleColumnVisibility:Ve,navigateToCommit:ae,resetWorking:xe,cleanUntracked:we,setSelectedFeatureId:$,setConversationBranch:R,setPreviewBranch:M,openFileDiff:So,closeFileDiff:_o,checkAndRefresh:Fn,startPolling:Tn,stopPolling:vr}});async function Eu(){if(typeof window>"u")return{conversations:[],archivedConversations:[],discardedConversations:0,discardedArchives:0};try{const e=await $fetch("/api/conversations");if(!e||!Array.isArray(e.conversations))return console.warn("[conversationStorage] Invalid data structure from server"),{conversations:[],archivedConversations:[],discardedConversations:0,discardedArchives:0};e.version!==No&&console.warn(`[conversationStorage] Storage version mismatch: ${e.version} vs ${No}`);const n=e.conversations.map(h=>{if(!h||typeof h!="object")return h;const m=h;return"claudeSessionId"in m&&!("providerSessionId"in m)?{...m,providerSessionId:m.claudeSessionId}:h}),a=(Array.isArray(e.archivedConversations)?e.archivedConversations:[]).map(h=>{if(!h||typeof h!="object")return h;const m=h;return"claudeSessionId"in m&&!("providerSessionId"in m)?{...m,providerSessionId:m.claudeSessionId}:h}),r=n.filter(Ds),l=a.filter(Ls),c=n.length-r.length,f=a.length-l.length;return c>0&&console.warn(`[conversationStorage] Discarded ${c} corrupted active conversation(s)`),f>0&&console.warn(`[conversationStorage] Discarded ${f} corrupted archive conversation(s)`),{conversations:r,archivedConversations:l,discardedConversations:c,discardedArchives:f}}catch(e){return console.error("[conversationStorage] Failed to load conversations:",e),{conversations:[],archivedConversations:[],discardedConversations:0,discardedArchives:0}}}async function Pu(e,n=[]){if(typeof window>"u")return!1;try{return await $fetch("/api/conversations",{method:"POST",body:{version:No,conversations:e,archivedConversations:n}}),!0}catch(t){return console.error("Failed to save conversations:",t),!1}}function Du(e){return e?e.map(n=>{switch(n.type){case"text":return n.text;case"tool_use":return`[${n.name}] ${n.inputSummary}`;case"tool_result":return n.isError?`Error: ${n.content.slice(0,100)}`:"";case"thinking":case"result_summary":case"session_init":return"";default:return""}}).filter(Boolean).join(`
64
+ `):""}const mt=po("chat",()=>{const e=S(!1),n=S(Is),t=S("ask"),a=S(""),r=S([]),l=S([]),c=S(null),f=S("active"),h=S(new Set),m=new Map,y=S(0),C=new Map,x=1200,v=S(null),g=S(null);function B($){return $?m.get($)??null:null}function V($){let R=m.get($);return R||(R={session:null,pendingPermission:null,pendingPlanApproval:null,lastError:null,debugEvents:[]},m.set($,R)),R}const E=H(()=>r.value.find($=>$.id===c.value)||null),fe=H(()=>E.value?.messages??[]),ce=H(()=>(y.value,B(c.value)?.session??null)),W=H(()=>(y.value,B(c.value)?.pendingPermission??null)),ue=H(()=>(y.value,B(c.value)?.pendingPlanApproval??null)),de=H(()=>(y.value,B(c.value)?.lastError??null)),le=H(()=>(y.value,B(c.value)?.debugEvents??[])),re=H(()=>ce.value?.status==="streaming"),Z=H(()=>E.value?.providerSessionId??""),z=H(()=>fe.value.length>0),N=H(()=>fe.value[fe.value.length-1]||null);function p($){return h.value.has($)}const u=H(()=>c.value?h.value.has(c.value):!1),b=H(()=>r.value.length>0),j=H(()=>l.value.length>0),G=H(()=>r.value.length),Q=H(()=>G.value>=xr),J=H(()=>r.value),ee=H(()=>l.value),te=H(()=>v.value&&r.value.find($=>$.id===v.value)||null);function O($){return v.value===$}function I($){f.value=$}async function L($){if(p($))return{success:!1,error:"Cannot archive while this conversation is streaming"};if(r.value.findIndex(M=>M.id===$)===-1)return{success:!1,error:"Conversation not found"};try{const M=await $fetch(`/api/conversations/${$}/archive`,{method:"POST"});if(M.success&&M.archived){const U=C.get($);return U&&(clearTimeout(U),C.delete($)),m.delete($),r.value=Array.isArray(M.conversations)?M.conversations:r.value.filter(ae=>ae.id!==$),l.value=Array.isArray(M.archivedConversations)?M.archivedConversations:[M.archived,...l.value],qe(),v.value===$&&(v.value=null),c.value===$&&(c.value=r.value[0]?.id??null),typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:c.value}}).catch(ae=>{console.error("Failed to save active conversation:",ae)}),{success:!0}}return{success:!1,error:"Failed to archive conversation"}}catch(M){return{success:!1,error:M instanceof Error?M.message:"Failed to archive conversation"}}}async function K($,R){if(Ee().atLimit)return{success:!1,error:`Cannot restore. Active conversations reached ${br}.`};if(!l.value.some(U=>U.id===$))return{success:!1,error:"Archived conversation not found"};try{const U=await $fetch(`/api/conversations/archives/${$}/restore`,{method:"POST",body:{baseBranch:R}});return U.success&&U.conversation?(r.value=Array.isArray(U.conversations)?U.conversations:[U.conversation,...r.value],Array.isArray(U.archivedConversations)?l.value=U.archivedConversations:l.value=l.value.filter(ae=>ae.id!==$),f.value="active",Ne(U.conversation.id),It(),Pe(),{success:!0,conversationId:U.conversation.id}):{success:!1,error:"Failed to restore archived conversation"}}catch(U){return{success:!1,error:U instanceof Error?U.message:"Failed to restore archived conversation"}}}async function k($){const R=l.value.findIndex(M=>M.id===$);if(R===-1)return{success:!1,error:"Archived conversation not found"};try{const M=await $fetch(`/api/conversations/archives/${$}`,{method:"DELETE"});return M.success?(Array.isArray(M.archivedConversations)?l.value=M.archivedConversations:l.value.splice(R,1),qe(),{success:!0}):{success:!1,error:"Failed to delete archived conversation"}}catch{return l.value.splice(R,1),Pe(),{success:!0}}}async function F(){if(!(typeof window>"u"))try{const $=await $fetch("/api/settings");if($){if(typeof $.panelWidth=="number"){const U=$.panelWidth;U>=yr&&U<=kr&&(n.value=U)}typeof $.isPanelOpen=="boolean"&&(e.value=$.isPanelOpen),typeof $.activeConversationId=="string"&&(c.value=$.activeConversationId);const{useSettingsStore:R}=await Bn(async()=>{const{useSettingsStore:U}=await import("./BUOk7wkI.js").then(ae=>ae.s);return{useSettingsStore:U}},__vite__mapDeps([0,1,2]),import.meta.url),M=R();await M.hydrate(),t.value=M.permissionMode}}catch($){console.error("Failed to load chat settings:",$)}}function q($){t.value=$,typeof window<"u"&&Bn(async()=>{const{useSettingsStore:R}=await import("./BUOk7wkI.js").then(M=>M.s);return{useSettingsStore:R}},__vite__mapDeps([0,1,2]),import.meta.url).then(({useSettingsStore:R})=>{R().setPermissionMode($)})}function se($,R){const M=R??c.value;if(!M)return;const U=V(M);U.pendingPermission=$,y.value++}function ne($){const R=$??c.value;if(!R)return;const M=m.get(R);M&&(M.pendingPermission=null,y.value++)}function be($,R){const M=R??c.value;if(!M)return;const U=V(M);U.pendingPlanApproval=$,y.value++}function De($){const R=$??c.value;if(!R)return;const M=m.get(R);M&&(M.pendingPlanApproval=null,y.value++)}function _e(){e.value=!e.value,rt()}function ot(){e.value=!0,rt()}function We(){e.value=!1,rt()}function rt(){typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{isPanelOpen:e.value}}).catch($=>{console.error("Failed to save panel state:",$)})}function pt($){const R=Math.max(yr,Math.min(kr,$));n.value=R,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{panelWidth:R}}).catch(M=>{console.error("Failed to save panel width:",M)})}function vt($){a.value=$}function Dt($,R){const M=R??c.value;if(!M)return;const U=r.value.find(ae=>ae.id===M);U&&(U.providerSessionId=$)}function zt($,R){const M=r.value.find(U=>U.id===$);M&&(M.worktreeBranch=R,M.lastCommitTime=new Date().toISOString())}function Vt($,R,M){const U=r.value.find(ae=>ae.id===$);U&&(U.providerId=R,U.providerModelKey=M)}function Mt($){const R=$??c.value;if(!R)return;const M=r.value.find(U=>U.id===R);M&&(M.providerSessionId="")}function Xe($){return r.value.find(M=>M.id===$)?.providerSessionId??""}function Ht($){h.value.add($)}function Tt($){h.value.delete($)}function gt($,R){const M=R??c.value;if(!M)return;const U=r.value.find(ae=>ae.id===M);U&&U.messages.push($)}function At($,R){const M={id:uo(),role:"user",content:$,timestamp:new Date().toISOString()};return gt(M,R),M}function dt($){const R={id:uo(),role:"assistant",content:"",timestamp:new Date().toISOString(),status:"streaming"};return gt(R,$),R}function Wt($,R,M){const U=M??c.value;if(!U)return;const ae=r.value.find(we=>we.id===U);if(!ae)return;const xe=ae.messages.findIndex(we=>we.id===$);xe!==-1&&(ae.messages[xe]={...ae.messages[xe],...R})}function at($,R,M){const U=M??c.value;if(!U)return;const ae=r.value.find(we=>we.id===U);if(!ae)return;const xe=ae.messages.findIndex(we=>we.id===$);xe!==-1&&(ae.messages[xe].content+=R)}function Bt($,R,M){const U=M??c.value;if(!U)return;const ae=r.value.find(we=>we.id===U);if(!ae)return;const xe=ae.messages.findIndex(we=>we.id===$);if(xe!==-1){const we=ae.messages[xe],Se=we.tools?[...we.tools,R]:[R];ae.messages[xe]={...we,tools:Se}}}function en($,R,M,U){const ae=U??c.value;if(!ae)return;const xe=r.value.find(Se=>Se.id===ae);if(!xe)return;const we=xe.messages.findIndex(Se=>Se.id===$);if(we!==-1){const Se=xe.messages[we];if(Se.tools){const w=Se.tools.findIndex(_=>_.id===R);if(w!==-1){const _=[...Se.tools];_[w]={..._[w],...M},xe.messages[we]={...Se,tools:_}}}}$t(ae,!1)}function Gt($){$.contentBlocks&&($.content=Du($.contentBlocks))}function Ot($,R){const M=R??c.value;if(!M)return;const U=r.value.find(xe=>xe.id===M);if(!U)return;const ae=U.messages.find(xe=>xe.id===$);ae&&!ae.contentBlocks&&(ae.contentBlocks=[])}function Qe($,R,M){const U=M??c.value;if(!U)return;const ae=r.value.find(we=>we.id===U);if(!ae)return;const xe=ae.messages.find(we=>we.id===$);xe&&(xe.contentBlocks||(xe.contentBlocks=[]),xe.contentBlocks.push(R),Gt(xe))}function ft($,R,M,U){const ae=U??c.value;if(!ae)return;const xe=r.value.find(w=>w.id===ae);if(!xe)return;const we=xe.messages.find(w=>w.id===$);if(!we?.contentBlocks)return;const Se=we.contentBlocks.find(w=>w.id===R);Se&&M(Se)}function Rt($,R,M,U){const ae=U??c.value;if(!ae)return;const xe=r.value.find(Se=>Se.id===ae);if(!xe)return;const we=xe.messages.find(Se=>Se.id===$);we&&(ft($,R,M,ae),Gt(we),$t(ae,!1))}function Ct($,R,M){const U=M??c.value;U&&(Qe($,R,U),$t(U,!1))}function tn($,R,M){const U=M??c.value;if(!U)return null;const ae=r.value.find(we=>we.id===U);if(!ae)return null;const xe=ae.messages.find(we=>we.id===$);return xe?.contentBlocks?xe.contentBlocks.find(we=>we.type==="tool_use"&&we.toolUseId===R)??null:null}function bn($,R){const M=R??c.value;if(!M)return;const U=m.get(M);U?.session&&(U.session.status=$,y.value++)}function qt($,R){const M=R??c.value;if(!M)return;const U=V(M);U.session={sessionId:$,cwd:a.value,status:"streaming",startedAt:new Date().toISOString()},U.lastError=null,y.value++}function Zt($){const R=$??c.value;if(!R)return;const M=m.get(R);M?.session&&(M.session.status="idle",y.value++)}function yn($,R){const M=R??c.value;if(!M)return;const U=V(M);U.session&&(U.session.status="error",U.session.error=$),U.lastError=$,y.value++}function Ut($,R){const M=R??c.value;if(!M)return;const U=V(M),ae=(()=>{if(typeof $.payload=="string")return $.payload;try{return JSON.stringify($.payload,null,2)}catch{return String($.payload)}})(),xe=8e3,we=300,Se=ae.length>xe?`${ae.slice(0,xe)}
65
+ ... (truncated)`:ae;U.debugEvents.push({id:`dbg-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,timestamp:new Date().toISOString(),direction:$.direction,channel:$.channel,eventType:$.eventType||"unknown",payload:Se}),U.debugEvents.length>we&&U.debugEvents.splice(0,U.debugEvents.length-we),y.value++}function Je($){const R=$??c.value;if(!R)return;const M=m.get(R);M&&(M.debugEvents=[],y.value++)}function kn(){if(!c.value)return;const $=r.value.find(M=>M.id===c.value);$&&($.messages=[]);const R=c.value;m.delete(R),y.value++}function Te($){const R=$??c.value;if(!R)return;const M=m.get(R);M&&(M.lastError=null,M.session&&(M.session.error=void 0),y.value++)}async function Lt(){const $=await Eu();if(r.value=$.conversations,l.value=$.archivedConversations,$.discardedArchives>0&&console.warn(`[chat] Skipped ${$.discardedArchives} corrupted archived conversation(s)`),It(),qe(),!v.value){const R=r.value.find(M=>!!M.previewBranch&&!M.finalized);R&&(v.value=R.id)}if(c.value){const R=r.value.find(M=>M.id===c.value);R&&R.cwd?a.value=R.cwd:R||(c.value=null,e.value=!1)}}function Pe(){Pu(r.value,l.value)}function $t($,R=!1){const M=r.value.find(U=>U.id===$);if(M)if(R){const U=C.get($);U&&(clearTimeout(U),C.delete($)),M.updatedAt=new Date().toISOString(),Pe()}else{const U=C.get($);U&&clearTimeout(U);const ae=setTimeout(()=>{M.updatedAt=new Date().toISOString(),Pe(),C.delete($)},x);C.set($,ae)}}function ze($=!1){c.value&&$t(c.value,$)}function It(){r.value.sort(($,R)=>new Date(R.createdAt).getTime()-new Date($.createdAt).getTime())}function qe(){l.value.sort(($,R)=>new Date(R.archivedAt).getTime()-new Date($.archivedAt).getTime())}async function dn($){if(Ee().atLimit)return"";const M=Ur();let U=null;if($?.featureId){const Se=await $fetch("/api/chat/worktree",{method:"POST",body:{conversationId:M,featureId:$.featureId,baseBranch:$.baseBranch}});if(!Se.success&&Se.error)throw new Error(Se.error);U=Se}let ae=null;if(typeof window<"u")try{const{useSettingsStore:Se}=await Bn(async()=>{const{useSettingsStore:_}=await import("./BUOk7wkI.js").then(Le=>Le.s);return{useSettingsStore:_}},__vite__mapDeps([0,1,2]),import.meta.url),w=Se();await w.hydrate(),ae=w.providerSelection}catch(Se){console.warn("[chat] Failed to load provider selection for new conversation",Se)}const xe=ae||{providerId:zr,modelKey:jr},we={id:M,title:"New Conversation",messages:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),cwd:a.value||process.cwd?.()||"",featureId:$?.featureId,providerId:xe.providerId,providerModelKey:xe.modelKey};if(U?.success&&U.worktreePath&&U.branch&&(we.worktreePath=U.worktreePath,we.worktreeBranch=U.branch,we.cwd=U.worktreePath,we.hasWorktree=!0,U.baseBranch&&(we.baseBranch=U.baseBranch),U.providerSessionId&&(we.providerSessionId=U.providerSessionId)),r.value.unshift(we),c.value=M,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:M}}).catch(Se=>{console.error("Failed to save active conversation:",Se)}),!$?.featureId)try{const Se=await $fetch("/api/chat/worktree",{method:"POST",body:{conversationId:M,baseBranch:$?.baseBranch}});if(Se.success&&Se.worktreePath&&Se.branch){const w=r.value.find(_=>_.id===M);w&&(w.worktreePath=Se.worktreePath,w.worktreeBranch=Se.branch,w.cwd=Se.worktreePath,w.hasWorktree=!0,Se.baseBranch&&(w.baseBranch=Se.baseBranch))}}catch(Se){console.warn("[chat] Failed to create worktree for conversation",M,Se)}return Pe(),M}function Ne($){const R=r.value.find(M=>M.id===$);R&&(c.value=$,e.value=!0,R.cwd&&(a.value=R.cwd),typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:$,isPanelOpen:!0}}).catch(M=>{console.error("Failed to save active conversation:",M)}))}async function Et($){const R=r.value.findIndex(ae=>ae.id===$);if(R===-1)return;const M=r.value[R];if(v.value===$&&(v.value=null),M.hasWorktree&&M.worktreePath&&M.worktreeBranch)try{await $fetch("/api/chat/worktree",{method:"DELETE",body:{worktreePath:M.worktreePath,branch:M.worktreeBranch}})}catch(ae){console.warn("[chat] Failed to clean up worktree for conversation",$,ae)}r.value.splice(R,1),m.delete($);const U=C.get($);U&&(clearTimeout(U),C.delete($)),c.value===$&&(c.value=null,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:null}}).catch(ae=>{console.error("Failed to clear active conversation:",ae)})),Pe()}async function et($,R,M){const U=r.value.find(xe=>xe.id===$);if(!U)return{success:!1,error:"Conversation not found"};if(!U.hasWorktree)return{success:!1,error:"No worktree associated with this conversation"};const ae=M||U.baseBranch;try{const xe=await $fetch("/api/chat/finalize",{method:"POST",body:{conversationId:$,commitMessage:R,baseBranch:ae,worktreePath:U.worktreePath,worktreeBranch:U.worktreeBranch}});return xe.success?(v.value===$&&(v.value=null),U.worktreePath=void 0,U.worktreeBranch=void 0,U.hasWorktree=!1,U.baseBranch=void 0,U.previewBranch=void 0,U.finalized=!0,U.updatedAt=new Date().toISOString(),Pe()):xe.rebaseInProgress&&xe.conflictFiles?.length&&await Ze($,U.worktreePath,ae||"main",R),xe}catch(xe){return{success:!1,error:xe instanceof Error?xe.message:String(xe)}}}async function fn($,R){const M=r.value.find(ae=>ae.id===$);if(!M)return{success:!1,error:"Conversation not found"};if(!M.hasWorktree)return{success:!1,error:"No worktree associated with this conversation"};const U=R||M.baseBranch;try{const ae=await $fetch("/api/chat/rebase",{method:"POST",body:{conversationId:$,baseBranch:U,worktreePath:M.worktreePath}});return ae.rebaseInProgress&&ae.conflictFiles?.length?await Ze($,M.worktreePath,U||"main","","sync"):ae.success&&(M.baseBranch=U,Pe()),ae}catch(ae){return{success:!1,error:ae instanceof Error?ae.message:String(ae)}}}async function Ze($,R,M,U,ae="finalize"){g.value={conversationId:$,worktreePath:R,baseBranch:M,commitMessage:U,files:[],resolvedFiles:new Set,loading:!0,error:null,mode:ae};try{const xe=await $fetch("/api/rebase/conflicts",{params:{worktreePath:R}});g.value&&(g.value.files=xe.files,g.value.loading=!1)}catch(xe){g.value&&(g.value.error=xe instanceof Error?xe.message:String(xe),g.value.loading=!1)}}async function nn($,R){if(!g.value)return!1;try{const M=await $fetch("/api/rebase/resolve",{method:"PUT",body:{worktreePath:g.value.worktreePath,filePath:$,content:R}});return M.success&&g.value&&g.value.resolvedFiles.add($),M.success}catch{return!1}}async function je(){if(!g.value)return{success:!1,error:"No conflict resolution in progress"};const{conversationId:$,commitMessage:R,baseBranch:M,mode:U,worktreePath:ae}=g.value,xe=U==="sync"?"/api/rebase/continue-sync":"/api/rebase/continue";try{const we=r.value.find(w=>w.id===$),Se=await $fetch(xe,{method:"POST",body:{conversationId:$,commitMessage:R,baseBranch:M,worktreePath:ae,worktreeBranch:we?.worktreeBranch}});if(Se.success){if(U==="finalize"){v.value===$&&(v.value=null);const w=r.value.find(_=>_.id===$);w&&(w.worktreePath=void 0,w.worktreeBranch=void 0,w.hasWorktree=!1,w.baseBranch=void 0,w.previewBranch=void 0,w.finalized=!0,w.updatedAt=new Date().toISOString(),Pe())}else if(U==="sync"){const w=r.value.find(_=>_.id===$);w&&(w.baseBranch=M,w.updatedAt=new Date().toISOString(),Pe())}g.value=null}else Se.rebaseInProgress&&Se.conflictFiles?.length&&await Ze($,ae,M,R,U);return Se}catch(we){return{success:!1,error:we instanceof Error?we.message:String(we)}}}async function mn(){if(!g.value)return!1;try{const $=await $fetch("/api/rebase/abort",{method:"POST",body:{worktreePath:g.value.worktreePath}});return g.value=null,$.success}catch{return g.value=null,!1}}async function Ke($){if(!g.value)return!1;const R=g.value.files.find(M=>M.path===$);if(!R)return!1;try{const M=await $fetch("/api/rebase/ai-resolve",{method:"POST",body:{worktreePath:g.value.worktreePath,filePath:$,conflictContent:R.content}});return M.success&&M.resolvedContent!==void 0?(R.content=M.resolvedContent,await nn($,M.resolvedContent)):!1}catch{return!1}}async function hn(){if(!g.value)return;const $=g.value.files.filter(R=>!g.value.resolvedFiles.has(R.path));for(const R of $)await Ke(R.path)}async function Ye($){const R=r.value.find(M=>M.id===$);if(!R)return{success:!1,error:"Conversation not found"};if(!R.hasWorktree||!R.worktreePath||!R.baseBranch)return{success:!1,error:"No worktree to preview"};try{const M=await $fetch("/api/chat/preview",{method:"POST",body:{conversationId:$,worktreePath:R.worktreePath,baseBranch:R.baseBranch}});return M.success&&M.previewBranch&&(R.previewBranch=M.previewBranch,v.value=$,R.updatedAt=new Date().toISOString(),Pe()),{success:M.success,error:M.error}}catch(M){return{success:!1,error:M instanceof Error?M.message:String(M)}}}async function on($){const R=r.value.find(M=>M.id===$);if(!R)return{success:!1,error:"Conversation not found"};if(!R.previewBranch||!R.baseBranch)return v.value=null,{success:!1,error:"No active preview"};try{const M=await $fetch("/api/chat/preview",{method:"DELETE",body:{previewBranch:R.previewBranch,baseBranch:R.baseBranch}});return M.success&&(R.previewBranch=void 0,v.value=null,R.updatedAt=new Date().toISOString(),Pe()),{success:M.success,error:M.error}}catch(M){return{success:!1,error:M instanceof Error?M.message:String(M)}}}async function pe($){if(v.value===$)return await on($);if(v.value){const R=await on(v.value);if(!R.success)return{success:!1,error:`Failed to end previous preview: ${R.error}`}}return await Ye($)}function A($){return r.value.find(R=>R.featureId===$)||null}function oe($){r.value.unshift($),It(),Pe()}function me($,R){const M=r.value.find(U=>U.id===$);M&&(M.title=R.trim(),M.updatedAt=new Date().toISOString(),It(),Pe())}function Fe($){const R=c.value;if(!R)return;const M=r.value.find(ae=>ae.id===R);if(!M||M.title!=="New Conversation")return;const U=M.messages.find(ae=>ae.role==="user");U&&(M.title=Ns(U.content))}function Ee(){const $=r.value.length;return{atLimit:$>=br,nearLimit:$>=xr,count:$}}async function He($){c.value||await dn();const R=At($);return Fe(),ze(!0),R}function tt($,R,M){const U=M??c.value;at($,R,U??void 0),U&&$t(U,!1)}function Ve($,R){const M=R??c.value;Wt($,{status:"complete"},M??void 0),M&&$t(M,!0)}return{messages:fe,session:ce,isPanelOpen:e,panelWidth:ge(n),permissionMode:ge(t),pendingPermission:W,pendingPlanApproval:ue,cwd:ge(a),lastError:de,debugEvents:le,providerSessionId:Z,conversations:ge(r),archivedConversations:ge(l),activeConversationId:ge(c),conversationViewMode:ge(f),conflictState:ge(g),previewingConversationId:ge(v),isStreaming:re,hasMessages:z,lastMessage:N,isActiveConversationStreaming:u,hasConversations:b,hasArchivedConversations:j,activeConversation:E,conversationCount:G,isNearStorageLimit:Q,sortedConversations:J,sortedArchivedConversations:ee,previewingConversation:te,streamingConversations:ge(h),initialize:F,togglePanel:_e,openPanel:ot,closePanel:We,setPanelWidth:pt,setPermissionMode:q,setPendingPermission:se,clearPendingPermission:ne,setPendingPlanApproval:be,clearPendingPlanApproval:De,setCwd:vt,setProviderSessionId:Dt,clearProviderSession:Mt,getProviderSessionId:Xe,updateWorktreeBranch:zt,setConversationProviderSelection:Vt,startConversationStreaming:Ht,endConversationStreaming:Tt,isConversationStreaming:p,addMessage:gt,addUserMessage:At,addAssistantMessage:dt,updateMessage:Wt,appendToMessage:at,addToolToMessage:Bt,updateToolInMessage:en,initContentBlocks:Ot,appendContentBlock:Qe,appendContentBlockWithSave:Ct,updateBlockById:ft,updateBlockWithSave:Rt,findToolUseBlock:tn,syncContentFromBlocks:Gt,setSessionStatus:bn,startSession:qt,endSession:Zt,setSessionError:yn,pushDebugEvent:Ut,clearDebugEvents:Je,clearMessages:kn,clearError:Te,loadConversations:Lt,saveAllConversations:Pe,saveCurrentConversation:ze,saveConversation:$t,createConversation:dn,selectConversation:Ne,deleteConversation:Et,archiveConversation:L,restoreArchivedConversation:K,deleteArchivedConversation:k,setConversationViewMode:I,findConversationByFeature:A,addAutoModeConversation:oe,renameConversation:me,checkStorageLimits:Ee,finalizeConversation:et,rebaseConversation:fn,resolveConflictFile:nn,continueRebase:je,abortRebase:mn,aiResolveConflictFile:Ke,aiResolveAllConflicts:hn,previewConversation:Ye,unpreviewConversation:on,togglePreview:pe,isConversationPreviewing:O,addUserMessageWithConversation:He,appendToMessageWithSave:tt,completeMessageWithSave:Ve}});function Lu(e={}){const n=Qn(),t=300,a=5e3,r=250;let l=null,c=null,f=null,h=null,m=null,y=!1,C=!1;const x=S(!1),v=S(!1);let g=e;function B(p){g=p}async function V(){const p=g.getScrollPosition?.()??0,u=await n.checkAndRefresh();return u&&g.setScrollPosition&&(await cn(),g.setScrollPosition(p)),u}function E(){return x.value||!!n.activeContextMenu||!!n.activeDialog}async function fe(){if(E()){v.value=!0;return}W()}async function ce(){if(y){C=!0;return}y=!0;try{await V()}finally{y=!1,C&&(C=!1,W())}}function W(){c&&clearTimeout(c),c=setTimeout(()=>{c=null,ce()},r)}function ue(p){if(typeof window>"u")return;if(f&&f.readyState===WebSocket.OPEN){f.send(JSON.stringify({type:"watch",workingDirectory:p}));return}h&&(clearTimeout(h),h=null);const b=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/git-watcher-ws`;f=new WebSocket(b),f.onopen=()=>{f.send(JSON.stringify({type:"watch",workingDirectory:p}))},f.onmessage=j=>{try{JSON.parse(j.data).type==="git_changed"&&fe()}catch{}},f.onclose=()=>{f=null,n.isPollingActive&&m&&(h=setTimeout(()=>{m&&ue(m)},a))},f.onerror=()=>{}}function de(){h&&(clearTimeout(h),h=null),f&&(f.close(),f=null)}function le(p){p&&(m=p),!n.isPollingActive&&(n.startPolling(),m&&ue(m))}function re(){de(),n.stopPolling()}function Z(){x.value=!0,l&&(clearTimeout(l),l=null)}function z(){l&&clearTimeout(l),l=setTimeout(async()=>{x.value=!1,v.value&&(v.value=!1,W())},t)}function N(){re(),l&&(clearTimeout(l),l=null),c&&(clearTimeout(c),c=null),y=!1,C=!1,m=null}return Ae(()=>[n.activeContextMenu,n.activeDialog],()=>{!n.activeContextMenu&&!n.activeDialog&&v.value&&!x.value&&(v.value=!1,W())}),{isUserInteracting:ge(x),isDeferredRefresh:ge(v),startPolling:le,stopPolling:re,startInteraction:Z,endInteraction:z,cleanup:N,setScrollCallbacks:B}}function Iu(e){Qn();function n(r){const l=r.ctrlKey||r.metaKey;if(l&&r.key==="f"){r.preventDefault(),e.onFind();return}if(l&&r.key==="r"){r.preventDefault(),e.onRefresh();return}if(l&&r.key==="h"){r.preventDefault(),e.onScrollToHead();return}if(r.key==="Escape"){r.preventDefault(),e.onEscape();return}}function t(){document.addEventListener("keydown",n)}function a(){document.removeEventListener("keydown",n)}return{start:t,stop:a}}const Nu={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},Fu={class:"text-sm font-mono text-retro-cyan"},Hu={class:"text-xs font-mono text-retro-text mt-1 truncate"},Ou={class:"space-y-3"},Uu={class:"flex items-start gap-2 cursor-pointer group"},ju={class:"flex items-start gap-2 cursor-pointer group"},zu=Ce({__name:"CherryPickDialog",props:{visible:{type:Boolean},commitHash:{},commitMessage:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=n,a=S(!1),r=S(!1);function l(){t("confirm",{recordOrigin:a.value,noCommit:r.value})}function c(){a.value=!1,r.value=!1,t("close")}return(f,h)=>(i(),ie(wt,{title:"Cherry-Pick Commit",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Cherry-Pick",onClose:c,onConfirm:l},{default:Ge(()=>[o("div",Nu,[h[2]||(h[2]=o("div",{class:"text-xs font-mono text-retro-muted mb-1"},"Commit",-1)),o("div",Fu,T(e.commitHash.slice(0,7)),1),o("div",Hu,T(e.commitMessage.split(`
66
+ `)[0]),1)]),o("div",Ou,[o("label",Uu,[Me(o("input",{"onUpdate:modelValue":h[0]||(h[0]=m=>Ie(a)?a.value=m:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[Pt,s(a)]]),h[3]||(h[3]=o("div",null,[o("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," Record origin (-x) "),o("p",{class:"text-xs font-mono text-retro-muted mt-0.5"},' Append "(cherry picked from commit ...)" to the commit message ')],-1))]),o("label",ju,[Me(o("input",{"onUpdate:modelValue":h[1]||(h[1]=m=>Ie(r)?r.value=m:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[Pt,s(r)]]),h[4]||(h[4]=o("div",null,[o("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," No commit "),o("p",{class:"text-xs font-mono text-retro-muted mt-0.5"}," Apply changes to the working directory without committing ")],-1))])])]),_:1},8,["visible","loading","error"]))}}),Vu={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},Wu={class:"text-sm font-mono text-retro-cyan"},Gu={class:"mb-4"},qu={class:"flex items-start gap-2 cursor-pointer group"},Zu=Ce({__name:"CreateBranchDialog",props:{visible:{type:Boolean},fromCommit:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=n,a=S(""),r=S(!0),l=H(()=>a.value.trim().length>0);function c(){l.value&&t("confirm",{name:a.value.trim(),checkout:r.value})}function f(){a.value="",r.value=!0,t("close")}return(h,m)=>(i(),ie(wt,{title:"Create Branch",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Create Branch",onClose:f,onConfirm:c},{default:Ge(()=>[o("div",Vu,[m[2]||(m[2]=o("div",{class:"text-xs font-mono text-retro-muted mb-1"},"From",-1)),o("div",Wu,T(e.fromCommit.slice(0,7)),1)]),o("div",Gu,[m[3]||(m[3]=o("label",{class:"block text-xs font-mono text-retro-muted mb-1.5"},"Branch name",-1)),Me(o("input",{"onUpdate:modelValue":m[0]||(m[0]=y=>Ie(a)?a.value=y:null),type:"text",placeholder:"feature/my-branch",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan"},null,512),[[ut,s(a)]])]),o("label",qu,[Me(o("input",{"onUpdate:modelValue":m[1]||(m[1]=y=>Ie(r)?r.value=y:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[Pt,s(r)]]),m[4]||(m[4]=o("div",null,[o("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," Switch to new branch "),o("p",{class:"text-xs font-mono text-retro-muted mt-0.5"}," Checkout the branch after creating it ")],-1))])]),_:1},8,["visible","loading","error"]))}}),Ku=Ce({__name:"CleanUntrackedDialog",props:{visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=n;return(a,r)=>(i(),ie(wt,{title:"Clean Untracked Files",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Clean","confirm-danger":"",onClose:r[0]||(r[0]=l=>t("close")),onConfirm:r[1]||(r[1]=l=>t("confirm"))},{default:Ge(()=>[...r[2]||(r[2]=[o("div",{class:"space-y-3"},[o("p",{class:"text-retro-text text-sm font-mono"}," Remove all untracked files and directories from the working tree. "),o("p",{class:"text-retro-muted text-xs font-mono"},[ke(" This runs "),o("code",null,"git clean -fd"),ke(" and cannot be undone. ")])],-1)])]),_:1},8,["visible","loading","error"]))}}),Yu={class:"text-retro-text text-sm font-mono mb-2"},Xu={class:"text-retro-cyan"},Qu={class:"space-y-3 mt-4"},Ju={class:"flex items-center gap-2 cursor-pointer"},ed=Ce({__name:"DeleteBranchDialog",props:{visible:{type:Boolean},branchName:{},isLocal:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=e,a=n,r=S(!1);function l(){a("confirm",{force:r.value})}return Ae(()=>t.visible,c=>{c&&(r.value=!1)}),(c,f)=>(i(),ie(wt,{title:"Delete Branch",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Delete","confirm-danger":!0,onClose:f[1]||(f[1]=h=>a("close")),onConfirm:l},{default:Ge(()=>[f[4]||(f[4]=o("div",{class:"mb-4 p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"}," This action is permanent and cannot be undone. ",-1)),o("p",Yu,[ke(" Delete "+T(e.isLocal?"local":"remote")+" branch ",1),o("span",Xu,T(e.branchName),1),f[2]||(f[2]=ke("? ",-1))]),o("div",Qu,[o("label",Ju,[Me(o("input",{"onUpdate:modelValue":f[0]||(f[0]=h=>Ie(r)?r.value=h:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Pt,s(r)]]),f[3]||(f[3]=o("span",{class:"text-retro-muted text-sm"},"Force delete (even if not fully merged)",-1))])])]),_:1},8,["visible","loading","error"]))}}),td={class:"text-retro-text text-sm font-mono mb-4"},nd={class:"text-retro-cyan"},od={class:"space-y-3"},rd={class:"flex items-center gap-2 cursor-pointer"},sd={class:"flex items-center gap-2 cursor-pointer"},ad={class:"flex items-center gap-2 cursor-pointer"},id=Ce({__name:"MergeDialog",props:{visible:{type:Boolean},branchName:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=e,a=n,r=S(!1),l=S(!1),c=S(!1);function f(){a("confirm",{noCommit:r.value,noFastForward:l.value,squash:c.value})}return Ae(()=>t.visible,h=>{h&&(r.value=!1,l.value=!1,c.value=!1)}),(h,m)=>(i(),ie(wt,{title:"Merge Branch",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Merge",onClose:m[3]||(m[3]=y=>a("close")),onConfirm:f},{default:Ge(()=>[o("p",td,[m[4]||(m[4]=ke(" Merge ",-1)),o("span",nd,T(e.branchName),1),m[5]||(m[5]=ke(" into current branch ",-1))]),o("div",od,[o("label",rd,[Me(o("input",{"onUpdate:modelValue":m[0]||(m[0]=y=>Ie(r)?r.value=y:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Pt,s(r)]]),m[6]||(m[6]=o("span",{class:"text-retro-muted text-sm"},"No commit (stage changes only)",-1))]),o("label",sd,[Me(o("input",{"onUpdate:modelValue":m[1]||(m[1]=y=>Ie(l)?l.value=y:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Pt,s(l)]]),m[7]||(m[7]=o("span",{class:"text-retro-muted text-sm"},"No fast-forward (always create merge commit)",-1))]),o("label",ad,[Me(o("input",{"onUpdate:modelValue":m[2]||(m[2]=y=>Ie(c)?c.value=y:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Pt,s(c)]]),m[8]||(m[8]=o("span",{class:"text-retro-muted text-sm"},"Squash (combine all commits into one)",-1))])])]),_:1},8,["visible","loading","error"]))}}),ld={class:"text-retro-text text-sm font-mono mb-4"},cd={class:"text-retro-cyan"},ud={class:"space-y-3"},dd=["value"],fd={class:"flex items-center gap-2 cursor-pointer"},md={class:"flex items-center gap-2 cursor-pointer"},hd=Ce({__name:"PullDialog",props:{visible:{type:Boolean},branchName:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=e,a=n,r=S("origin"),l=S(!1),c=S(!1);function f(){a("confirm",{remote:r.value,noFastForward:l.value,squash:c.value})}return Ae(()=>t.visible,h=>{h&&(r.value=t.remotes.includes("origin")?"origin":t.remotes[0]??"origin",l.value=!1,c.value=!1)}),(h,m)=>(i(),ie(wt,{title:"Pull Branch",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Pull",onClose:m[3]||(m[3]=y=>a("close")),onConfirm:f},{default:Ge(()=>[o("p",ld,[m[4]||(m[4]=ke(" Pull ",-1)),o("span",cd,T(e.branchName),1),m[5]||(m[5]=ke(" from remote ",-1))]),o("div",ud,[o("div",null,[m[6]||(m[6]=o("label",{class:"text-retro-muted text-sm block mb-1"},"Remote",-1)),Me(o("select",{"onUpdate:modelValue":m[0]||(m[0]=y=>Ie(r)?r.value=y:null),class:"w-full bg-retro-panel border border-retro-border rounded text-retro-text text-sm px-2 py-1.5 font-mono focus:outline-none focus:border-retro-cyan"},[(i(!0),d(he,null,Be(e.remotes,y=>(i(),d("option",{key:y,value:y},T(y),9,dd))),128))],512),[[_n,s(r)]])]),o("label",fd,[Me(o("input",{"onUpdate:modelValue":m[1]||(m[1]=y=>Ie(l)?l.value=y:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Pt,s(l)]]),m[7]||(m[7]=o("span",{class:"text-retro-muted text-sm"},"No fast-forward (always create merge commit)",-1))]),o("label",md,[Me(o("input",{"onUpdate:modelValue":m[2]||(m[2]=y=>Ie(c)?c.value=y:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Pt,s(c)]]),m[8]||(m[8]=o("span",{class:"text-retro-muted text-sm"},"Squash (combine all commits into one)",-1))])])]),_:1},8,["visible","loading","error"]))}}),pd={class:"text-retro-text text-sm font-mono mb-4"},vd={class:"text-retro-cyan"},gd={class:"space-y-3"},xd=["value"],bd={class:"flex items-center gap-2 cursor-pointer"},yd=["checked"],kd={class:"flex items-center gap-2 cursor-pointer"},wd=["checked"],Cd={key:0,class:"p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"},$d=Ce({__name:"PushDialog",props:{visible:{type:Boolean},branchName:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=e,a=n,r=S("origin"),l=S(!1),c=S(!1);function f(y){l.value=y,y&&(c.value=!1)}function h(y){c.value=y,y&&(l.value=!1)}function m(){a("confirm",{remote:r.value,force:l.value,forceWithLease:c.value})}return Ae(()=>t.visible,y=>{y&&(r.value=t.remotes.includes("origin")?"origin":t.remotes[0]??"origin",l.value=!1,c.value=!1)}),(y,C)=>(i(),ie(wt,{title:"Push Branch",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Push",onClose:C[3]||(C[3]=x=>a("close")),onConfirm:m},{default:Ge(()=>[o("p",pd,[C[4]||(C[4]=ke(" Push ",-1)),o("span",vd,T(e.branchName),1),C[5]||(C[5]=ke(" to remote ",-1))]),o("div",gd,[o("div",null,[C[6]||(C[6]=o("label",{class:"text-retro-muted text-sm block mb-1"},"Remote",-1)),Me(o("select",{"onUpdate:modelValue":C[0]||(C[0]=x=>Ie(r)?r.value=x:null),class:"w-full bg-retro-panel border border-retro-border rounded text-retro-text text-sm px-2 py-1.5 font-mono focus:outline-none focus:border-retro-cyan"},[(i(!0),d(he,null,Be(e.remotes,x=>(i(),d("option",{key:x,value:x},T(x),9,xd))),128))],512),[[_n,s(r)]])]),o("label",bd,[o("input",{checked:s(l),type:"checkbox",class:"accent-retro-cyan",onChange:C[1]||(C[1]=x=>f(x.target.checked))},null,40,yd),C[7]||(C[7]=o("span",{class:"text-retro-muted text-sm"},"Force push",-1))]),o("label",kd,[o("input",{checked:s(c),type:"checkbox",class:"accent-retro-cyan",onChange:C[2]||(C[2]=x=>h(x.target.checked))},null,40,wd),C[8]||(C[8]=o("span",{class:"text-retro-muted text-sm"},"Force with lease (safer force push)",-1))]),s(l)||s(c)?(i(),d("div",Cd,T(s(l)?"Force push will overwrite remote history. Use with caution.":"Force with lease will reject the push if the remote has been updated since your last fetch."),1)):P("",!0)])]),_:1},8,["visible","loading","error"]))}}),Sd={class:"text-retro-text text-sm font-mono mb-4"},_d={class:"text-retro-cyan"},Md={class:"text-retro-cyan"},Td={class:"p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"},Ad={class:"text-retro-cyan"},Bd={class:"text-retro-cyan"},Rd=Ce({__name:"RebaseDialog",props:{visible:{type:Boolean},branchName:{},ontoBranch:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=n;return(a,r)=>(i(),ie(wt,{title:"Rebase Branch",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Rebase",onClose:r[0]||(r[0]=l=>t("close")),onConfirm:r[1]||(r[1]=l=>t("confirm"))},{default:Ge(()=>[o("p",Sd,[r[2]||(r[2]=ke(" Rebase ",-1)),o("span",_d,T(e.branchName),1),r[3]||(r[3]=ke(" onto ",-1)),o("span",Md,T(e.ontoBranch),1)]),o("div",Td,[r[4]||(r[4]=ke(" This will rewrite commit history. Commits from ",-1)),o("span",Ad,T(e.branchName),1),r[5]||(r[5]=ke(" will be replayed on top of ",-1)),o("span",Bd,T(e.ontoBranch),1),r[6]||(r[6]=ke(". ",-1))])]),_:1},8,["visible","loading","error"]))}}),Ed={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},Pd={class:"text-sm font-mono text-retro-cyan"},Dd={class:"text-xs font-mono text-retro-text mt-1 truncate"},Ld={class:"space-y-2"},Id=["value"],Nd={key:0,class:"mt-3 p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},Fd=Ce({__name:"ResetDialog",props:{visible:{type:Boolean},commitHash:{},commitMessage:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=n,a=S("mixed"),r=[{value:"soft",label:"Soft",description:"Move HEAD, keep staged changes and working directory"},{value:"mixed",label:"Mixed",description:"Move HEAD, reset staging area, keep working directory"},{value:"hard",label:"Hard",description:"Move HEAD, reset staging area and working directory (DESTRUCTIVE)"}];function l(){t("confirm",{mode:a.value})}function c(){a.value="mixed",t("close")}return(f,h)=>(i(),ie(wt,{title:"Reset to Commit",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Reset","confirm-danger":s(a)==="hard",onClose:c,onConfirm:l},{default:Ge(()=>[o("div",Ed,[h[1]||(h[1]=o("div",{class:"text-xs font-mono text-retro-muted mb-1"},"Reset to",-1)),o("div",Pd,T(e.commitHash.slice(0,7)),1),o("div",Dd,T(e.commitMessage.split(`
67
+ `)[0]),1)]),o("div",Ld,[h[2]||(h[2]=o("div",{class:"text-xs font-mono text-retro-muted mb-2"},"Reset mode",-1)),(i(),d(he,null,Be(r,m=>o("label",{key:m.value,class:ve(["flex items-start gap-2 p-2 rounded cursor-pointer group border transition-colors",[s(a)===m.value?"border-retro-cyan bg-retro-cyan/5":"border-transparent hover:bg-retro-panel"]])},[Me(o("input",{"onUpdate:modelValue":h[0]||(h[0]=y=>Ie(a)?a.value=y:null),type:"radio",name:"reset-mode",value:m.value,class:"mt-0.5 accent-retro-cyan"},null,8,Id),[[Lo,s(a)]]),o("div",null,[o("span",{class:ve(["text-sm font-mono transition-colors",[m.value==="hard"?"text-retro-red":"text-retro-text",s(a)===m.value?"text-retro-cyan":""]])},T(m.label),3),o("p",{class:ve(["text-xs font-mono mt-0.5",m.value==="hard"?"text-retro-red/70":"text-retro-muted"])},T(m.description),3)])],2)),64))]),s(a)==="hard"?(i(),d("div",Nd," Warning: Hard reset will permanently discard all uncommitted changes in your working directory and staging area. This action cannot be undone. ")):P("",!0)]),_:1},8,["visible","loading","error","confirm-danger"]))}}),Hd={class:"space-y-3"},Od={class:"flex items-start gap-2 cursor-pointer"},Ud={class:"flex items-start gap-2 cursor-pointer"},jd={key:0,class:"mt-4 p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},zd=Ce({__name:"ResetWorkingDialog",props:{visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=e,a=n,r=S("mixed"),l=H(()=>r.value==="hard");function c(){a("confirm",{mode:r.value})}return Ae(()=>t.visible,f=>{f&&(r.value="mixed")}),(f,h)=>(i(),ie(wt,{title:"Reset Working Directory",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Reset","confirm-danger":s(l),onClose:h[2]||(h[2]=m=>a("close")),onConfirm:c},{default:Ge(()=>[h[5]||(h[5]=o("p",{class:"text-retro-text text-sm font-mono mb-4"}," Reset the working directory to HEAD. ",-1)),o("div",Hd,[o("label",Od,[Me(o("input",{"onUpdate:modelValue":h[0]||(h[0]=m=>Ie(r)?r.value=m:null),type:"radio",value:"mixed",name:"reset-mode",class:"accent-retro-cyan mt-0.5"},null,512),[[Lo,s(r)]]),h[3]||(h[3]=o("div",null,[o("span",{class:"text-retro-text text-sm font-mono"},"Mixed"),o("p",{class:"text-retro-muted text-xs font-mono mt-0.5"}," Reset staging area, keep working directory ")],-1))]),o("label",Ud,[Me(o("input",{"onUpdate:modelValue":h[1]||(h[1]=m=>Ie(r)?r.value=m:null),type:"radio",value:"hard",name:"reset-mode",class:"accent-retro-cyan mt-0.5"},null,512),[[Lo,s(r)]]),h[4]||(h[4]=o("div",null,[o("span",{class:"text-retro-text text-sm font-mono"},"Hard"),o("p",{class:"text-retro-muted text-xs font-mono mt-0.5"}," Reset staging area AND working directory (DESTRUCTIVE) ")],-1))])]),s(l)?(i(),d("div",jd," WARNING: Hard reset will permanently discard all uncommitted changes. This cannot be undone. ")):P("",!0)]),_:1},8,["visible","loading","error","confirm-danger"]))}}),Vd={class:"space-y-4"},Wd={class:"flex items-center gap-2 cursor-pointer"},Gd=Ce({__name:"StashDialog",props:{visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=e,a=n,r=S(""),l=S(!1);function c(){a("confirm",{message:r.value.trim()||void 0,includeUntracked:l.value})}return Ae(()=>t.visible,f=>{f&&(r.value="",l.value=!1)}),(f,h)=>(i(),ie(wt,{title:"Stash Changes",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Stash",onClose:h[2]||(h[2]=m=>a("close")),onConfirm:c},{default:Ge(()=>[h[5]||(h[5]=o("p",{class:"text-retro-text text-sm font-mono mb-4"}," Save uncommitted changes to the stash. ",-1)),o("div",Vd,[o("div",null,[h[3]||(h[3]=o("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Message (optional)",-1)),Me(o("input",{"onUpdate:modelValue":h[0]||(h[0]=m=>Ie(r)?r.value=m:null),type:"text",placeholder:"Stash description...",class:"w-full px-2 py-1.5 text-sm font-mono bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted/50 focus:outline-none focus:border-retro-cyan"},null,512),[[ut,s(r)]])]),o("label",Wd,[Me(o("input",{"onUpdate:modelValue":h[1]||(h[1]=m=>Ie(l)?l.value=m:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Pt,s(l)]]),h[4]||(h[4]=o("span",{class:"text-retro-muted text-sm"},"Include untracked files",-1))])])]),_:1},8,["visible","loading","error"]))}}),qd={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},Zd={class:"text-sm font-mono text-retro-cyan"},Kd={class:"mb-4"},Yd={class:"mb-3"},Xd={class:"flex items-start gap-2 cursor-pointer group"},Qd={key:0,class:"mb-4"},Jd={class:"space-y-2"},ef={class:"flex items-start gap-2 cursor-pointer group"},tf=["disabled"],nf={key:0,class:"ml-6"},of=["value"],rf=Ce({__name:"TagCreateDialog",props:{visible:{type:Boolean},commitHash:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=n,a=S(""),r=S(!1),l=S(""),c=S(!1),f=S(""),h=H(()=>a.value.trim().length>0);function m(){if(!h.value)return;const C={name:a.value.trim(),annotated:r.value};r.value&&l.value.trim()&&(C.message=l.value.trim()),c.value&&f.value&&(C.pushToRemote=f.value),t("confirm",C)}function y(){a.value="",r.value=!1,l.value="",c.value=!1,f.value="",t("close")}return Ae(()=>r.value,C=>{C||(l.value="")}),(C,x)=>(i(),ie(wt,{title:"Create Tag",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Create Tag",onClose:y,onConfirm:m},{default:Ge(()=>[o("div",qd,[x[5]||(x[5]=o("div",{class:"text-xs font-mono text-retro-muted mb-1"},"At commit",-1)),o("div",Zd,T(e.commitHash.slice(0,7)),1)]),o("div",Kd,[x[6]||(x[6]=o("label",{class:"block text-xs font-mono text-retro-muted mb-1.5"},"Tag name",-1)),Me(o("input",{"onUpdate:modelValue":x[0]||(x[0]=v=>Ie(a)?a.value=v:null),type:"text",placeholder:"v1.0.0",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan"},null,512),[[ut,s(a)]])]),o("div",Yd,[o("label",Xd,[Me(o("input",{"onUpdate:modelValue":x[1]||(x[1]=v=>Ie(r)?r.value=v:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[Pt,s(r)]]),x[7]||(x[7]=o("div",null,[o("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," Annotated tag "),o("p",{class:"text-xs font-mono text-retro-muted mt-0.5"}," Create a full tag object with message and tagger info ")],-1))])]),s(r)?(i(),d("div",Qd,[x[8]||(x[8]=o("label",{class:"block text-xs font-mono text-retro-muted mb-1.5"},"Tag message",-1)),Me(o("textarea",{"onUpdate:modelValue":x[2]||(x[2]=v=>Ie(l)?l.value=v:null),rows:"3",placeholder:"Release description...",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan resize-none"},null,512),[[ut,s(l)]])])):P("",!0),o("div",Jd,[o("label",ef,[Me(o("input",{"onUpdate:modelValue":x[3]||(x[3]=v=>Ie(c)?c.value=v:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan",disabled:e.remotes.length===0},null,8,tf),[[Pt,s(c)]]),o("div",null,[o("span",{class:ve(["text-sm font-mono transition-colors",e.remotes.length===0?"text-retro-muted":"text-retro-text group-hover:text-retro-cyan"])}," Push to remote ",2)])]),s(c)&&e.remotes.length>0?(i(),d("div",nf,[Me(o("select",{"onUpdate:modelValue":x[4]||(x[4]=v=>Ie(f)?f.value=v:null),class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text focus:outline-none focus:border-retro-cyan"},[x[9]||(x[9]=o("option",{value:"",disabled:"",class:"text-retro-muted"},"Select remote",-1)),(i(!0),d(he,null,Be(e.remotes,v=>(i(),d("option",{key:v,value:v},T(v),9,of))),128))],512),[[_n,s(f)]])])):P("",!0)])]),_:1},8,["visible","loading","error"]))}}),sf={class:"text-retro-text text-sm font-mono mb-2"},af={class:"text-retro-cyan"},lf={class:"space-y-3 mt-4"},cf={class:"flex items-center gap-2 cursor-pointer"},uf={key:0,class:"ml-6"},df=["value"],ff=Ce({__name:"TagDeleteDialog",props:{visible:{type:Boolean},tagName:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(e,{emit:n}){const t=e,a=n,r=S(!1),l=S("origin");function c(){a("confirm",{deleteFromRemote:r.value,remote:r.value?l.value:void 0})}return Ae(()=>t.visible,f=>{f&&(r.value=!1,l.value=t.remotes.includes("origin")?"origin":t.remotes[0]??"origin")}),(f,h)=>(i(),ie(wt,{title:"Delete Tag",visible:e.visible,loading:e.loading,error:e.error,"confirm-label":"Delete","confirm-danger":!0,onClose:h[2]||(h[2]=m=>a("close")),onConfirm:c},{default:Ge(()=>[h[7]||(h[7]=o("div",{class:"mb-4 p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"}," This action is permanent and cannot be undone. ",-1)),o("p",sf,[h[3]||(h[3]=ke(" Delete tag ",-1)),o("span",af,T(e.tagName),1),h[4]||(h[4]=ke("? ",-1))]),o("div",lf,[o("label",cf,[Me(o("input",{"onUpdate:modelValue":h[0]||(h[0]=m=>Ie(r)?r.value=m:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[Pt,s(r)]]),h[5]||(h[5]=o("span",{class:"text-retro-muted text-sm"},"Also delete from remote",-1))]),s(r)?(i(),d("div",uf,[h[6]||(h[6]=o("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Remote",-1)),Me(o("select",{"onUpdate:modelValue":h[1]||(h[1]=m=>Ie(l)?l.value=m:null),class:"w-full px-2 py-1.5 text-sm font-mono bg-retro-panel border border-retro-border rounded text-retro-text focus:outline-none focus:border-retro-cyan"},[(i(!0),d(he,null,Be(e.remotes,m=>(i(),d("option",{key:m,value:m},T(m),9,df))),128))],512),[[_n,s(l)]])])):P("",!0)])]),_:1},8,["visible","loading","error"]))}}),mf={class:"mb-4"},hf={class:"text-retro-cyan text-sm font-mono"},pf={class:"mb-4"},vf={class:"text-retro-text text-sm font-mono"},gf={class:"mb-4"},xf={class:"text-retro-text text-sm font-mono break-all select-all"},bf={class:"mb-4"},yf={class:"text-retro-text text-sm font-mono"},kf={class:"text-retro-muted"},wf={class:"mb-4"},Cf={class:"text-retro-text text-sm font-mono"},$f={key:1,class:"mb-2"},Sf={class:"p-2 text-sm font-mono text-retro-text bg-retro-panel border border-retro-border rounded whitespace-pre-wrap"},_f={key:1,class:"text-retro-muted text-sm font-mono text-center py-4"},Mf=Ce({__name:"TagDetailDialog",props:{visible:{type:Boolean},tagName:{},tagDetail:{},loading:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:n}){const t=n;return(a,r)=>(i(),ie(wt,{title:"Tag Details",visible:e.visible,loading:e.loading,"confirm-label":"Close","cancel-label":"Close",onClose:r[0]||(r[0]=l=>t("close")),onConfirm:r[1]||(r[1]=l=>t("close"))},{default:Ge(()=>[o("div",mf,[r[2]||(r[2]=o("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Tag",-1)),o("p",hf,T(e.tagName),1)]),e.tagDetail?(i(),d(he,{key:0},[o("div",pf,[r[3]||(r[3]=o("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Type",-1)),o("p",vf,T(e.tagDetail.isAnnotated?"Annotated":"Lightweight"),1)]),o("div",gf,[r[4]||(r[4]=o("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Hash",-1)),o("p",xf,T(e.tagDetail.hash),1)]),e.tagDetail.tagger?(i(),d(he,{key:0},[o("div",bf,[r[5]||(r[5]=o("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Tagger",-1)),o("p",yf,[ke(T(e.tagDetail.tagger.name)+" ",1),o("span",kf,"<"+T(e.tagDetail.tagger.email)+">",1)])]),o("div",wf,[r[6]||(r[6]=o("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Date",-1)),o("p",Cf,T(e.tagDetail.tagger.date),1)])],64)):P("",!0),e.tagDetail.message?(i(),d("div",$f,[r[7]||(r[7]=o("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Message",-1)),o("div",Sf,T(e.tagDetail.message),1)])):P("",!0)],64)):e.loading?(i(),d("div",_f," Loading tag details... ")):P("",!0)]),_:1},8,["visible","loading"]))}}),hr=globalThis.setInterval,Tf={class:"h-full flex flex-col bg-retro-dark",role:"region","aria-label":"Git Graph"},Af={key:0,class:"flex-1 flex flex-col items-center justify-center gap-3"},Bf={key:1,class:"flex-1 flex flex-col items-center justify-center p-8 text-center"},Rf={key:2,class:"flex-1 flex flex-col items-center justify-center p-8 text-center"},Ef={class:"text-retro-red text-sm mb-4"},Pf={key:3,class:"flex-1 flex items-center justify-center p-4"},Df={class:"flex-shrink-0 flex items-center gap-2 p-2 border-b border-retro-border"},Lf={class:"relative"},If={key:0,class:"absolute left-0 top-full mt-1 z-10 bg-retro-panel border border-retro-border rounded shadow-lg py-2 min-w-[200px]"},Nf={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},Ff=["checked"],Hf={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},Of=["checked"],Uf={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},jf=["checked"],zf={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},Vf=["checked"],Wf={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},Gf=["checked"],qf={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},Zf=["checked"],Kf={class:"relative"},Yf=["aria-expanded"],Xf={key:0,class:"text-xs"},Qf={key:0,class:"absolute right-0 top-full mt-1 z-10 bg-retro-panel border border-retro-border rounded shadow-lg py-1 min-w-[220px] max-h-[400px] overflow-auto"},Jf=["checked","onChange"],em={class:"text-sm text-retro-text truncate"},tm={key:0,class:"text-[10px] text-retro-cyan"},nm={class:"px-3 py-1 text-[10px] text-retro-orange font-semibold uppercase tracking-wider mt-1"},om=["checked","onChange"],rm={class:"text-sm text-retro-text truncate"},sm={class:"relative"},am={key:0,class:"absolute right-0 top-full mt-1 z-20"},im=["title"],lm={class:"text-retro-muted text-sm"},cm={class:"text-retro-cyan font-mono"},um={class:"space-y-3"},dm={class:"text-retro-muted text-sm"},fm={class:"text-retro-cyan font-mono"},mm={class:"space-y-3"},hm={class:"text-retro-muted text-sm"},pm={class:"text-retro-magenta font-mono"},vm={key:0,class:"fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2.5 text-sm bg-retro-red/90 text-white rounded-lg shadow-lg max-w-sm",role:"alert"},gm={class:"flex-1"},xm=Ce({__name:"GitGraph",props:{workingDirectory:{},isActive:{type:Boolean,default:!0}},setup(e){const n=e,t=Qn(),a=mt(),r=Lu(),l=H(()=>{const w=a.activeConversation?.worktreeBranch;return w?[w]:[]}),c=H(()=>{const w=[],_=t.selectedFeatureId;_&&w.push(_);const Le=t.conversationBranch;return Le&&!w.includes(Le)&&w.push(Le),w});Ae(()=>a.activeConversation?.worktreeBranch,w=>{t.setConversationBranch(w??null)},{immediate:!0});const f=H(()=>{const w=t.previewBranch;return w?[w]:[]});Ae(()=>a.previewingConversation?.worktreeBranch,w=>{t.setPreviewBranch(w??null)},{immediate:!0});const h=H(()=>{const w={};return t.previewBranch&&t.previewMergeBase&&(w[t.previewBranch]=t.previewMergeBase),w}),m=H(()=>{const w={};return t.selectedFeatureId&&t.featureMergeBase&&(w[t.selectedFeatureId]=t.featureMergeBase),t.conversationBranch&&t.conversationMergeBase&&(w[t.conversationBranch]=t.conversationMergeBase),w}),y=H(()=>t.remotes.map(w=>w.name)),C=S(null);Ae(()=>n.workingDirectory,async w=>{if(w){await t.loadGitGraph(w);const _=a.previewingConversation?.worktreeBranch;_&&await t.setPreviewBranch(_);const Le=a.activeConversation?.worktreeBranch;Le&&await t.setConversationBranch(Le)}},{immediate:!0}),Ae(()=>n.isActive,w=>{w&&t.commits.length>0&&!t.error?r.startPolling(n.workingDirectory):r.stopPolling()},{immediate:!0}),Ae(()=>t.commits.length,w=>{w>0&&n.isActive&&!t.error&&r.startPolling(n.workingDirectory)}),Ae(()=>C.value,w=>{w&&r.setScrollCallbacks({getScrollPosition:()=>w.getScrollPosition(),setScrollPosition:_=>w.setScrollPosition(_)})}),_t(()=>{r.cleanup(),t.reset()});const x=H(()=>t.error?.includes("Not a Git repository")),v=S(Date.now());let g=null;const B=()=>{g||(g=hr(()=>{v.value=Date.now()},5e3))},V=()=>{g&&(clearInterval(g),g=null)};st(()=>{Ae(()=>n.isActive,w=>{w?(v.value=Date.now(),B()):V()},{immediate:!0})}),_t(()=>{V()});const E=H(()=>{const w=t.lastRefreshTime;if(!w)return null;const _=Math.floor((v.value-w)/1e3);return t.isRefreshing?"Syncing...":_<5?"Just now":_<60?`${_}s ago`:`${Math.floor(_/60)}m ago`}),fe=S(!1),ce=S(!1),W=S(null);function ue(){fe.value=!0,cn(()=>W.value?.focus())}function de(){fe.value=!1,t.setSearchQuery("")}function le(w){t.setSearchQuery(w)}const re=Iu({onFind:()=>ue(),onRefresh:async()=>{n.workingDirectory&&await t.loadGitGraph(n.workingDirectory)},onScrollToHead:()=>{const w=t.commits.find(_=>_.isHead);w&&t.selectCommit(w)},onEscape:()=>{Z.value?Z.value=!1:ce.value?ce.value=!1:z.value?z.value=!1:fe.value?de():t.isComparing?t.clearComparison():(t.selectedCommit||t.isUncommittedChangesSelected)&&t.clearSelection()}});st(()=>{re.start()}),_t(()=>{re.stop()});const Z=S(!1),z=S(!1);async function N(){await t.fetchAll(!0)}async function p(w){await t.addRemote(w.name,w.url)}async function u(w){await t.editRemote(w.name,w.newUrl)}async function b(w){await t.deleteRemote(w)}const j=H(()=>{const w=[],_={};for(const Le of t.branches)if(t.localBranchNames.has(Le.name))w.push(Le);else{const it=Le.name.indexOf("/");if(it>0){const St=Le.name.substring(0,it);_[St]||(_[St]=[]),_[St].push(Le)}else w.push(Le)}return{local:w,remotes:_}}),G=S({visible:!1,branch:"",x:0,y:0,isCurrentBranch:!1,isLocal:!0,commitHash:""});function Q(w){G.value={visible:!0,...w},t.setActiveContextMenu({type:"branch",props:w,position:{x:w.x,y:w.y}})}function J(){G.value.visible=!1,t.clearActiveContextMenu()}function ee(){J(),Je.value={visible:!0,branchName:G.value.branch,loading:!1,error:null}}function te(){const w=G.value.branch;J(),ze.value={visible:!0,branchName:w,newName:w,loading:!1,error:null}}function O(){const{branch:w,isLocal:_}=G.value;J(),Pe.value={visible:!0,branchName:w,isLocal:_,force:!1,loading:!1,error:null}}function I(){const w=G.value.branch;J(),qe.value={visible:!0,branchName:w,loading:!1,error:null}}function L(){const w=G.value.branch;J(),Ne.value={visible:!0,branchName:w,loading:!1,error:null}}function K(){const w=G.value.branch;J(),et.value={visible:!0,branchName:w,loading:!1,error:null}}function k(){const w=G.value.branch;J(),Ze.value={visible:!0,branchName:w,loading:!1,error:null}}async function F(){const w=G.value.branch;J(),await t.fetchBranch(w)}async function q(){const w=G.value.branch;J(),await t.copyToClipboard(w),ae(G.value.x,G.value.y)}function se(){J(),Te.value={visible:!0,fromCommit:G.value.commitHash,loading:!1,error:null}}const ne=S({visible:!1,commit:null,x:0,y:0});function be(w){ne.value={visible:!0,commit:w.commit,x:w.x,y:w.y},t.setActiveContextMenu({type:"commit",props:w,position:{x:w.x,y:w.y}})}function De(){ne.value.visible=!1,t.clearActiveContextMenu()}function _e(w){const _=ne.value.commit;if(!_)return!1;De();const Le=w(_);return Le&&typeof Le.then=="function"?Le.then(()=>!0):!0}function ot(){_e(w=>{Ye.value={visible:!0,commitHash:w.hash,loading:!1,error:null}})}function We(){_e(w=>{Te.value={visible:!0,fromCommit:w.hash,loading:!1,error:null}})}function rt(){_e(w=>{Je.value={visible:!0,branchName:w.hash,loading:!1,error:null}})}function pt(){_e(w=>{je.value={visible:!0,commitHash:w.hash,commitMessage:w.message,loading:!1,error:null}})}async function vt(){await _e(w=>t.revertCommit(w.hash))}function Dt(){_e(w=>{qe.value={visible:!0,branchName:w.shortHash,loading:!1,error:null}})}function zt(){_e(w=>{Ke.value={visible:!0,commitHash:w.hash,commitMessage:w.message,loading:!1,error:null}})}async function Vt(){const{x:w,y:_}=ne.value;await _e(it=>t.copyToClipboard(it.hash))&&ae(w,_)}async function Mt(){await _e(w=>t.copyCommitSubject(w))}const Xe=S({visible:!1,tag:"",x:0,y:0,commitHash:""});function Ht(w){Xe.value={visible:!0,...w},t.setActiveContextMenu({type:"tag",props:w,position:{x:w.x,y:w.y}})}function Tt(){Xe.value.visible=!1,t.clearActiveContextMenu()}async function gt(){const w=Xe.value.tag;Tt(),oe.value={visible:!0,tagName:w,loading:!0,tagDetail:null};const _=await t.getTagDetail(w);oe.value.loading=!1,_.success&&_.data&&(oe.value.tagDetail=_.data)}function At(){const w=Xe.value.tag;Tt(),pe.value={visible:!0,tagName:w,loading:!1,error:null}}async function dt(){const w=Xe.value.tag;Tt(),await t.pushTag(w)}async function Wt(){const w=Xe.value.tag;Tt(),await t.copyToClipboard(w),ae(Xe.value.x,Xe.value.y)}const at=S({visible:!1,x:0,y:0});function Bt(){at.value.visible=!1,t.clearActiveContextMenu()}function en(){Bt(),me.value={visible:!0,loading:!1,error:null}}function Gt(){Bt(),Ve.value={visible:!0,loading:!1,error:null}}async function Ot(){Bt(),R.value={visible:!0,loading:!1,error:null}}const Qe=S({visible:!1,stash:null,x:0,y:0});function ft(w){Qe.value={visible:!0,stash:w.stash,x:w.x,y:w.y},t.setActiveContextMenu({type:"stash",props:w,position:{x:w.x,y:w.y}})}function Rt(){Qe.value.visible=!1,t.clearActiveContextMenu()}function Ct(w){const _=Qe.value.stash;if(!_)return!1;Rt();const Le=w(_);return Le&&typeof Le.then=="function"?Le.then(()=>!0):!0}async function tn(){await Ct(w=>t.applyStash(w.index))}async function bn(){await Ct(w=>t.popStash(w.index))}async function qt(){await Ct(w=>t.dropStash(w.index))}function Zt(){Ct(w=>{Ee.value={visible:!0,stashIndex:w.index,loading:!1,error:null}})}async function yn(){const{x:w,y:_}=Qe.value;await Ct(it=>t.copyToClipboard(`stash@{${it.index}}`))&&ae(w,_)}async function Ut(){const{x:w,y:_}=Qe.value;await Ct(it=>t.copyToClipboard(it.hash))&&ae(w,_)}const Je=S({visible:!1,branchName:"",loading:!1,error:null});async function kn(){Je.value.loading=!0,Je.value.error=null;const w=await t.checkoutBranch(Je.value.branchName);Je.value.loading=!1,w.success?Je.value.visible=!1:Je.value.error=w.error||"Unknown error"}const Te=S({visible:!1,fromCommit:"",loading:!1,error:null});async function Lt(w){Te.value.loading=!0,Te.value.error=null;const _=await t.createBranch(w.name,Te.value.fromCommit);Te.value.loading=!1,_.success?(w.checkout&&await t.checkoutBranch(w.name),Te.value.visible=!1):Te.value.error=_.error||"Unknown error"}const Pe=S({visible:!1,branchName:"",isLocal:!0,force:!1,loading:!1,error:null});async function $t(w){Pe.value.loading=!0,Pe.value.error=null;const{branchName:_,isLocal:Le}=Pe.value,it=w?.force??Pe.value.force,St=Le?await t.deleteLocalBranch(_,it):await t.deleteRemoteBranch(_);Pe.value.loading=!1,St.success?Pe.value.visible=!1:Pe.value.error=St.error||"Unknown error"}const ze=S({visible:!1,branchName:"",newName:"",loading:!1,error:null});async function It(){if(!ze.value.newName.trim()){ze.value.error="Branch name is required";return}ze.value.loading=!0,ze.value.error=null;const w=await t.renameBranch(ze.value.branchName,ze.value.newName.trim());ze.value.loading=!1,w.success?ze.value.visible=!1:ze.value.error=w.error||"Unknown error"}const qe=S({visible:!1,branchName:"",loading:!1,error:null});async function dn(w){qe.value.loading=!0,qe.value.error=null;const _=await t.mergeBranch(qe.value.branchName,w);qe.value.loading=!1,_.success?qe.value.visible=!1:qe.value.error=_.error||"Unknown error"}const Ne=S({visible:!1,branchName:"",loading:!1,error:null});async function Et(){Ne.value.loading=!0,Ne.value.error=null;const w=await t.rebaseBranch(Ne.value.branchName);Ne.value.loading=!1,w.success?Ne.value.visible=!1:Ne.value.error=w.error||"Unknown error"}const et=S({visible:!1,branchName:"",loading:!1,error:null});async function fn(w){et.value.loading=!0,et.value.error=null;const _=await t.pushBranch(et.value.branchName,w.remote,w.force,w.forceWithLease);et.value.loading=!1,_.success?et.value.visible=!1:et.value.error=_.error||"Unknown error"}const Ze=S({visible:!1,branchName:"",loading:!1,error:null});async function nn(w){Ze.value.loading=!0,Ze.value.error=null;const _=await t.pullBranch(Ze.value.branchName,w.remote,w.noFastForward,w.squash);Ze.value.loading=!1,_.success?Ze.value.visible=!1:Ze.value.error=_.error||"Unknown error"}const je=S({visible:!1,commitHash:"",commitMessage:"",loading:!1,error:null});async function mn(w){je.value.loading=!0,je.value.error=null;const _=await t.cherryPickCommit(je.value.commitHash,w.recordOrigin,w.noCommit);je.value.loading=!1,_.success?je.value.visible=!1:je.value.error=_.error||"Unknown error"}const Ke=S({visible:!1,commitHash:"",commitMessage:"",loading:!1,error:null});async function hn(w){Ke.value.loading=!0,Ke.value.error=null;const _=await t.resetToCommit(Ke.value.commitHash,w.mode);Ke.value.loading=!1,_.success?Ke.value.visible=!1:Ke.value.error=_.error||"Unknown error"}const Ye=S({visible:!1,commitHash:"",loading:!1,error:null});async function on(w){Ye.value.loading=!0,Ye.value.error=null;const _=await t.createTag(w.name,Ye.value.commitHash,w.annotated,w.message,w.pushToRemote);Ye.value.loading=!1,_.success?Ye.value.visible=!1:Ye.value.error=_.error||"Unknown error"}const pe=S({visible:!1,tagName:"",loading:!1,error:null});async function A(w){pe.value.loading=!0,pe.value.error=null;const _=await t.deleteTag(pe.value.tagName,w.deleteFromRemote?w.remote||"origin":void 0);pe.value.loading=!1,_.success?pe.value.visible=!1:pe.value.error=_.error||"Unknown error"}const oe=S({visible:!1,tagName:"",loading:!1,tagDetail:null}),me=S({visible:!1,loading:!1,error:null});async function Fe(w){me.value.loading=!0,me.value.error=null;const _=await t.stashChanges(w.message,w.includeUntracked);me.value.loading=!1,_.success?me.value.visible=!1:me.value.error=_.error||"Unknown error"}const Ee=S({visible:!1,stashIndex:0,loading:!1,error:null}),He=S("");async function tt(w){Ee.value.loading=!0,Ee.value.error=null;const _=await t.stashBranch(Ee.value.stashIndex,w);Ee.value.loading=!1,_.success?Ee.value.visible=!1:Ee.value.error=_.error||"Unknown error"}const Ve=S({visible:!1,loading:!1,error:null});async function $(w){Ve.value.loading=!0,Ve.value.error=null;const _=await t.resetWorking(w.mode);Ve.value.loading=!1,_.success?Ve.value.visible=!1:Ve.value.error=_.error||"Unknown error"}const R=S({visible:!1,loading:!1,error:null});async function M(){R.value.loading=!0,R.value.error=null;const w=await t.cleanUntracked();R.value.loading=!1,w.success?R.value.visible=!1:R.value.error=w.error||"Unknown error"}const U=S({visible:!1,x:0,y:0});function ae(w,_){U.value={visible:!0,x:w,y:_},setTimeout(()=>{U.value.visible=!1},1500)}const xe=H(()=>Je.value.visible||Te.value.visible||Pe.value.visible||ze.value.visible||qe.value.visible||Ne.value.visible||et.value.visible||Ze.value.visible||je.value.visible||Ke.value.visible||Ye.value.visible||pe.value.visible||oe.value.visible||me.value.visible||Ee.value.visible||Ve.value.visible||R.value.visible);Ae(xe,w=>{w?t.setActiveDialog({type:"generic",props:{}}):t.clearActiveDialog()});function we(w){t.selectedCommit?t.selectComparisonCommit(w):t.selectCommit(w)}function Se(w){t.navigateToCommit(w)}return(w,_)=>{const Le=ga,it=Ea,St=ri,wn=$i,wo=Vc,Co=mu,$o=bu,Jn=yu,In=ku,So=wu,_o=Cu,Nn=wt;return i(),d("div",Tf,[s(t).loading&&s(t).commits.length===0?(i(),d("div",Af,[..._[42]||(_[42]=[o("div",{class:"w-6 h-6 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),o("div",{class:"text-retro-muted text-sm"},"Loading git history...",-1)])])):s(x)?(i(),d("div",Bf,[Y(s(Cn),{class:"w-12 h-12 text-retro-yellow mb-4"}),_[43]||(_[43]=o("h3",{class:"text-retro-text font-semibold mb-2"},"Not a Git Repository",-1)),_[44]||(_[44]=o("p",{class:"text-retro-muted text-sm max-w-xs"},[ke(" This directory is not initialized as a Git repository. Run "),o("code",{class:"text-retro-cyan"},"git init"),ke(" to get started. ")],-1))])):s(t).error?(i(),d("div",Rf,[Y(s(Cn),{class:"w-10 h-10 text-retro-red mb-3"}),o("p",Ef,T(s(t).error),1),o("button",{class:"flex items-center gap-2 px-3 py-1.5 text-sm text-retro-text border border-retro-border rounded hover:border-retro-cyan hover:text-retro-cyan transition-colors",onClick:_[0]||(_[0]=$e=>s(t).loadGitGraph(n.workingDirectory))},[Y(s(xn),{class:"w-4 h-4"}),_[45]||(_[45]=ke(" Retry ",-1))])])):s(t).commits.length===0?(i(),d("div",Pf,[..._[46]||(_[46]=[o("div",{class:"text-retro-muted text-center"},[o("p",null,"No commits found in this repository.")],-1)])])):(i(),d(he,{key:4},[s(fe)?(i(),ie(Le,{key:0,ref_key:"findWidgetRef",ref:W,resultCount:s(t).searchResultHashes.length,currentIndex:s(t).searchResultIndex,onSearch:le,onNext:s(t).nextSearchResult,onPrev:s(t).prevSearchResult,onClose:de},null,8,["resultCount","currentIndex","onNext","onPrev"])):P("",!0),o("div",Df,[o("button",{class:ve(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",s(fe)?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Find (Ctrl+F)",title:"Find (Ctrl+F)",onClick:_[1]||(_[1]=$e=>s(fe)?de():ue())},[Y(s(Zn),{class:"w-4 h-4"})],2),o("div",Lf,[o("button",{class:ve(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",s(Z)?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Graph settings",title:"Settings",onClick:_[2]||(_[2]=$e=>Z.value=!s(Z))},[Y(s(Os),{class:"w-4 h-4"})],2),s(Z)?(i(),d("div",If,[_[53]||(_[53]=o("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border mb-1"}," Graph Style ",-1)),o("label",Nf,[o("input",{type:"radio",name:"graphStyle",value:"rounded",checked:s(t).graphStyle==="rounded",class:"accent-retro-cyan",onChange:_[3]||(_[3]=$e=>s(t).setGraphStyle("rounded"))},null,40,Ff),_[47]||(_[47]=o("span",{class:"text-sm text-retro-text"},"Rounded",-1))]),o("label",Hf,[o("input",{type:"radio",name:"graphStyle",value:"angular",checked:s(t).graphStyle==="angular",class:"accent-retro-cyan",onChange:_[4]||(_[4]=$e=>s(t).setGraphStyle("angular"))},null,40,Of),_[48]||(_[48]=o("span",{class:"text-sm text-retro-text"},"Angular",-1))]),_[54]||(_[54]=o("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border mt-2 mb-1"}," Display ",-1)),o("label",Uf,[o("input",{type:"checkbox",checked:s(t).muteNonAncestral,class:"accent-retro-cyan",onChange:_[5]||(_[5]=$e=>s(t).toggleMuteNonAncestral())},null,40,jf),_[49]||(_[49]=o("span",{class:"text-sm text-retro-text"},"Mute non-ancestral",-1))]),_[55]||(_[55]=o("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border mt-2 mb-1"}," Columns ",-1)),o("label",zf,[o("input",{type:"checkbox",checked:s(t).columnVisibility.commit!==!1,class:"accent-retro-cyan",onChange:_[6]||(_[6]=$e=>s(t).toggleColumnVisibility("commit"))},null,40,Vf),_[50]||(_[50]=o("span",{class:"text-sm text-retro-text"},"Hash",-1))]),o("label",Wf,[o("input",{type:"checkbox",checked:s(t).columnVisibility.author!==!1,class:"accent-retro-cyan",onChange:_[7]||(_[7]=$e=>s(t).toggleColumnVisibility("author"))},null,40,Gf),_[51]||(_[51]=o("span",{class:"text-sm text-retro-text"},"Author",-1))]),o("label",qf,[o("input",{type:"checkbox",checked:s(t).columnVisibility.date!==!1,class:"accent-retro-cyan",onChange:_[8]||(_[8]=$e=>s(t).toggleColumnVisibility("date"))},null,40,Zf),_[52]||(_[52]=o("span",{class:"text-sm text-retro-text"},"Date",-1))])])):P("",!0)]),_[58]||(_[58]=o("span",{class:"flex-1"},null,-1)),o("div",Kf,[o("button",{class:ve(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",s(ce)||s(t).filteredBranches.length>0?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Filter by branch","aria-expanded":s(ce),onClick:_[9]||(_[9]=$e=>ce.value=!s(ce))},[Y(s(oa),{class:"w-4 h-4"}),s(t).filteredBranches.length>0?(i(),d("span",Xf," ("+T(s(t).filteredBranches.length)+") ",1)):P("",!0)],10,Yf),s(ce)?(i(),d("div",Qf,[_[57]||(_[57]=o("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border"}," Filter by Branch ",-1)),s(t).filteredBranches.length>0?(i(),d("button",{key:0,class:"w-full text-left px-3 py-1.5 text-sm text-retro-cyan hover:bg-retro-cyan/10",onClick:_[10]||(_[10]=$e=>s(t).clearFilters())}," Clear All Filters ")):P("",!0),s(j).local.length>0?(i(),d(he,{key:1},[_[56]||(_[56]=o("div",{class:"px-3 py-1 text-[10px] text-retro-green font-semibold uppercase tracking-wider mt-1"}," Local ",-1)),(i(!0),d(he,null,Be(s(j).local,$e=>(i(),d("label",{key:$e.name,class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},[o("input",{type:"checkbox",checked:s(t).filteredBranches.includes($e.name),class:"accent-retro-cyan",onChange:Fn=>s(t).toggleBranchFilter($e.name)},null,40,Jf),o("span",em,T($e.name),1),$e.isHead?(i(),d("span",tm,"(HEAD)")):P("",!0)]))),128))],64)):P("",!0),(i(!0),d(he,null,Be(s(j).remotes,($e,Fn)=>(i(),d(he,{key:Fn},[o("div",nm,T(Fn),1),(i(!0),d(he,null,Be($e,Tn=>(i(),d("label",{key:Tn.name,class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},[o("input",{type:"checkbox",checked:s(t).filteredBranches.includes(Tn.name),class:"accent-retro-cyan",onChange:vr=>s(t).toggleBranchFilter(Tn.name)},null,40,om),o("span",rm,T(Tn.name),1)]))),128))],64))),128))])):P("",!0)]),o("button",{class:ve(["flex items-center gap-1 px-2 py-1.5 text-sm border border-retro-border text-retro-muted rounded hover:text-retro-text hover:border-retro-text transition-colors",{"animate-spin":s(t).isRefreshing}]),"aria-label":"Refresh (Ctrl+R)",title:"Refresh (Ctrl+R)",onClick:_[11]||(_[11]=$e=>s(t).loadGitGraph(n.workingDirectory))},[Y(s(xn),{class:"w-4 h-4"})],2),o("button",{class:"flex items-center gap-1 px-2 py-1.5 text-sm border border-retro-border text-retro-muted rounded hover:text-retro-text hover:border-retro-text transition-colors","aria-label":"Fetch all remotes",title:"Fetch All",onClick:N},[Y(s(Qr),{class:"w-4 h-4"})]),o("div",sm,[o("button",{class:ve(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",s(z)?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Manage remotes",title:"Remotes",onClick:_[12]||(_[12]=$e=>z.value=!s(z))},[Y(s(Jr),{class:"w-4 h-4"})],2),s(z)?(i(),d("div",am,[Y(it,{remotes:s(t).remotes,onAdd:p,onEdit:u,onDelete:b,onClose:_[13]||(_[13]=$e=>z.value=!1)},null,8,["remotes"])])):P("",!0)]),s(E)&&n.isActive?(i(),d("div",{key:0,class:ve(["flex items-center text-[10px] text-retro-muted",{"text-retro-cyan":s(t).isRefreshing}]),title:s(t).lastRefreshTime?`Last checked: ${new Date(s(t).lastRefreshTime).toLocaleTimeString()}`:"","aria-live":"polite","aria-atomic":"true"},[o("span",{class:ve(["inline-block w-1.5 h-1.5 rounded-full mr-1",s(t).isRefreshing?"bg-retro-cyan animate-pulse":"bg-retro-muted/50"]),"aria-hidden":"true"},null,2),ke(" "+T(s(E)),1)],10,im)):P("",!0)]),o("div",{class:ve(["flex-1 min-h-0 overflow-hidden",{"max-h-[50%]":s(t).selectedCommit||s(t).isUncommittedChangesSelected}])},[Y(St,{ref_key:"commitListRef",ref:C,commits:s(t).filteredCommits,stashes:s(t).stashes,selectedCommit:s(t).selectedCommit,hasMore:s(t).hasMore,loading:s(t).loading,loadingMore:s(t).loadingMore,searchQuery:s(t).searchQuery,uncommittedChangesCount:s(t).uncommittedChangesCount,isUncommittedChangesSelected:s(t).isUncommittedChangesSelected,highlightBranches:s(l),featureHighlightBranches:s(c),featureMergeBases:s(m),previewHighlightBranches:s(f),previewMergeBases:s(h),currentBranchName:s(t).currentBranch?.name,localBranchNames:s(t).localBranchNames,graphStyle:s(t).graphStyle,muteNonAncestral:s(t).muteNonAncestral,columnVisibility:s(t).columnVisibility,onSelect:s(t).selectCommit,onLoadMore:s(t).loadMoreCommits,onBranchContextMenu:Q,onCommitContextMenu:be,onTagContextMenu:Ht,onStashContextMenu:ft,onCompareSelect:we,onSelectUncommittedChanges:s(t).selectUncommittedChanges,onScrollStart:s(r).startInteraction,onScrollEnd:s(r).endInteraction},null,8,["commits","stashes","selectedCommit","hasMore","loading","loadingMore","searchQuery","uncommittedChangesCount","isUncommittedChangesSelected","highlightBranches","featureHighlightBranches","featureMergeBases","previewHighlightBranches","previewMergeBases","currentBranchName","localBranchNames","graphStyle","muteNonAncestral","columnVisibility","onSelect","onLoadMore","onSelectUncommittedChanges","onScrollStart","onScrollEnd"])],2),s(t).isComparing&&s(t).selectedCommit&&s(t).comparisonCommit?(i(),ie(wn,{key:1,fromCommit:s(t).comparisonCommit,toCommit:s(t).selectedCommit,files:s(t).comparisonFiles,stats:s(t).comparisonStats,loading:s(t).comparisonLoading,onClose:s(t).clearComparison},null,8,["fromCommit","toCommit","files","stats","loading","onClose"])):s(t).selectedCommit?(i(),ie(wo,{key:2,commit:s(t).selectedCommit,files:s(t).selectedCommitFiles,stats:s(t).selectedCommitStats,loading:s(t).isLoadingDetails,detailPosition:s(t).detailViewPosition,onClose:s(t).clearSelection,onNavigateToCommit:Se,onTogglePosition:s(t).toggleDetailViewPosition,onOpenFileDiff:_[14]||(_[14]=$e=>s(t).selectedCommit&&s(t).openFileDiff(s(t).selectedCommit.hash,$e))},null,8,["commit","files","stats","loading","detailPosition","onClose","onTogglePosition"])):P("",!0),s(t).isUncommittedChangesSelected?(i(),ie(Co,{key:3,stagedFiles:s(t).stagedFiles,unstagedFiles:s(t).unstagedFiles,isStaging:s(t).isStaging,isCommitting:s(t).isCommitting,onClose:s(t).clearSelection,onStageFiles:_[15]||(_[15]=$e=>s(t).stageFiles($e)),onUnstageFiles:_[16]||(_[16]=$e=>s(t).unstageFiles($e)),onStageAll:_[17]||(_[17]=()=>s(t).stageFiles([])),onUnstageAll:_[18]||(_[18]=()=>s(t).unstageFiles([])),onCommit:_[19]||(_[19]=$e=>s(t).commitChanges($e))},null,8,["stagedFiles","unstagedFiles","isStaging","isCommitting","onClose"])):P("",!0)],64)),s(G).visible?(i(),ie($o,{key:5,branchName:s(G).branch,isCurrentBranch:s(G).isCurrentBranch,isLocal:s(G).isLocal,x:s(G).x,y:s(G).y,onClose:J,onCheckout:ee,onCreateBranch:se,onDeleteBranch:O,onRename:te,onMerge:I,onRebase:L,onPush:K,onPull:k,onFetch:F,onCopyName:q},null,8,["branchName","isCurrentBranch","isLocal","x","y"])):P("",!0),s(ne).visible&&s(ne).commit?(i(),ie(Jn,{key:6,commit:s(ne).commit,x:s(ne).x,y:s(ne).y,onClose:De,onAddTag:ot,onCreateBranch:We,onCheckout:rt,onCherryPick:pt,onRevert:vt,onMergeInto:Dt,onReset:zt,onCopyHash:Vt,onCopySubject:Mt},null,8,["commit","x","y"])):P("",!0),s(Xe).visible?(i(),ie(In,{key:7,tagName:s(Xe).tag,x:s(Xe).x,y:s(Xe).y,onClose:Tt,onViewDetails:gt,onDeleteTag:At,onPushTag:dt,onCopyName:Wt},null,8,["tagName","x","y"])):P("",!0),s(Qe).visible&&s(Qe).stash?(i(),ie(So,{key:8,stashIndex:s(Qe).stash.index,stashMessage:s(Qe).stash.message,x:s(Qe).x,y:s(Qe).y,onClose:Rt,onApply:tn,onPop:bn,onDrop:qt,onCreateBranch:Zt,onCopyName:yn,onCopyHash:Ut},null,8,["stashIndex","stashMessage","x","y"])):P("",!0),s(at).visible?(i(),ie(_o,{key:9,x:s(at).x,y:s(at).y,onClose:Bt,onStash:en,onReset:Gt,onClean:Ot},null,8,["x","y"])):P("",!0),s(Je).visible?(i(),ie(Nn,{key:10,title:"Checkout",visible:s(Je).visible,loading:s(Je).loading,error:s(Je).error,confirmLabel:"Checkout",onClose:_[20]||(_[20]=$e=>s(Je).visible=!1),onConfirm:kn},{default:Ge(()=>[o("p",lm,[_[59]||(_[59]=ke(" Are you sure you want to checkout ",-1)),o("span",cm,T(s(Je).branchName),1),_[60]||(_[60]=ke("? ",-1))])]),_:1},8,["visible","loading","error"])):P("",!0),s(ze).visible?(i(),ie(Nn,{key:11,title:"Rename Branch",visible:s(ze).visible,loading:s(ze).loading,error:s(ze).error,confirmLabel:"Rename",onClose:_[22]||(_[22]=$e=>s(ze).visible=!1),onConfirm:It},{default:Ge(()=>[o("div",um,[o("p",dm,[_[61]||(_[61]=ke(" Rename ",-1)),o("span",fm,T(s(ze).branchName),1)]),Me(o("input",{"onUpdate:modelValue":_[21]||(_[21]=$e=>s(ze).newName=$e),type:"text",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",placeholder:"New branch name",onKeyup:ln(It,["enter"])},null,544),[[ut,s(ze).newName]])])]),_:1},8,["visible","loading","error"])):P("",!0),s(qe).visible?(i(),ie(id,{key:12,visible:s(qe).visible,branchName:s(qe).branchName,loading:s(qe).loading,error:s(qe).error,onClose:_[23]||(_[23]=$e=>s(qe).visible=!1),onConfirm:dn},null,8,["visible","branchName","loading","error"])):P("",!0),s(Pe).visible?(i(),ie(ed,{key:13,visible:s(Pe).visible,branchName:s(Pe).branchName,isLocal:s(Pe).isLocal,loading:s(Pe).loading,error:s(Pe).error,onClose:_[24]||(_[24]=$e=>s(Pe).visible=!1),onConfirm:$t},null,8,["visible","branchName","isLocal","loading","error"])):P("",!0),s(et).visible?(i(),ie($d,{key:14,visible:s(et).visible,branchName:s(et).branchName,remotes:s(y),loading:s(et).loading,error:s(et).error,onClose:_[25]||(_[25]=$e=>s(et).visible=!1),onConfirm:fn},null,8,["visible","branchName","remotes","loading","error"])):P("",!0),s(Ze).visible?(i(),ie(hd,{key:15,visible:s(Ze).visible,branchName:s(Ze).branchName,remotes:s(y),loading:s(Ze).loading,error:s(Ze).error,onClose:_[26]||(_[26]=$e=>s(Ze).visible=!1),onConfirm:nn},null,8,["visible","branchName","remotes","loading","error"])):P("",!0),s(Ne).visible?(i(),ie(Rd,{key:16,visible:s(Ne).visible,branchName:s(t).currentBranch?.name||"HEAD",ontoBranch:s(Ne).branchName,loading:s(Ne).loading,error:s(Ne).error,onClose:_[27]||(_[27]=$e=>s(Ne).visible=!1),onConfirm:Et},null,8,["visible","branchName","ontoBranch","loading","error"])):P("",!0),s(je).visible?(i(),ie(zu,{key:17,visible:s(je).visible,commitHash:s(je).commitHash,commitMessage:s(je).commitMessage,loading:s(je).loading,error:s(je).error,onClose:_[28]||(_[28]=$e=>s(je).visible=!1),onConfirm:mn},null,8,["visible","commitHash","commitMessage","loading","error"])):P("",!0),s(Ke).visible?(i(),ie(Fd,{key:18,visible:s(Ke).visible,commitHash:s(Ke).commitHash,commitMessage:s(Ke).commitMessage,loading:s(Ke).loading,error:s(Ke).error,onClose:_[29]||(_[29]=$e=>s(Ke).visible=!1),onConfirm:hn},null,8,["visible","commitHash","commitMessage","loading","error"])):P("",!0),s(Ye).visible?(i(),ie(rf,{key:19,visible:s(Ye).visible,commitHash:s(Ye).commitHash,remotes:s(y),loading:s(Ye).loading,error:s(Ye).error,onClose:_[30]||(_[30]=$e=>s(Ye).visible=!1),onConfirm:on},null,8,["visible","commitHash","remotes","loading","error"])):P("",!0),s(pe).visible?(i(),ie(ff,{key:20,visible:s(pe).visible,tagName:s(pe).tagName,remotes:s(y),loading:s(pe).loading,error:s(pe).error,onClose:_[31]||(_[31]=$e=>s(pe).visible=!1),onConfirm:A},null,8,["visible","tagName","remotes","loading","error"])):P("",!0),s(oe).visible?(i(),ie(Mf,{key:21,visible:s(oe).visible,tagName:s(oe).tagName,tagDetail:s(oe).tagDetail,loading:s(oe).loading,onClose:_[32]||(_[32]=$e=>s(oe).visible=!1)},null,8,["visible","tagName","tagDetail","loading"])):P("",!0),s(Te).visible?(i(),ie(Zu,{key:22,visible:s(Te).visible,fromCommit:s(Te).fromCommit,loading:s(Te).loading,error:s(Te).error,onClose:_[33]||(_[33]=$e=>s(Te).visible=!1),onConfirm:Lt},null,8,["visible","fromCommit","loading","error"])):P("",!0),s(Ee).visible?(i(),ie(Nn,{key:23,title:"Create Branch from Stash",visible:s(Ee).visible,loading:s(Ee).loading,error:s(Ee).error,confirmLabel:"Create Branch",onClose:_[36]||(_[36]=$e=>s(Ee).visible=!1),onConfirm:_[37]||(_[37]=$e=>tt(s(He)))},{default:Ge(()=>[o("div",mm,[o("p",hm,[_[62]||(_[62]=ke(" Create a new branch from ",-1)),o("span",pm,"stash@"+T("{")+T(s(Ee).stashIndex)+T("}"),1)]),Me(o("input",{"onUpdate:modelValue":_[34]||(_[34]=$e=>Ie(He)?He.value=$e:null),type:"text",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",placeholder:"Branch name",onKeyup:_[35]||(_[35]=ln($e=>tt(s(He)),["enter"]))},null,544),[[ut,s(He)]])])]),_:1},8,["visible","loading","error"])):P("",!0),s(me).visible?(i(),ie(Gd,{key:24,visible:s(me).visible,loading:s(me).loading,error:s(me).error,onClose:_[38]||(_[38]=$e=>s(me).visible=!1),onConfirm:Fe},null,8,["visible","loading","error"])):P("",!0),s(Ve).visible?(i(),ie(zd,{key:25,visible:s(Ve).visible,loading:s(Ve).loading,error:s(Ve).error,onClose:_[39]||(_[39]=$e=>s(Ve).visible=!1),onConfirm:$},null,8,["visible","loading","error"])):P("",!0),s(R).visible?(i(),ie(Ku,{key:26,visible:s(R).visible,loading:s(R).loading,error:s(R).error,onClose:_[40]||(_[40]=$e=>s(R).visible=!1),onConfirm:M},null,8,["visible","loading","error"])):P("",!0),(i(),ie(Jt,{to:"body"},[Y($n,{name:"fade"},{default:Ge(()=>[s(U).visible?(i(),d("div",{key:0,class:"fixed z-50 px-3 py-1.5 text-sm bg-retro-green text-retro-dark rounded shadow-lg",style:Nt({left:`${s(U).x}px`,top:`${s(U).y-40}px`})}," Copied! ",4)):P("",!0)]),_:1})])),(i(),ie(Jt,{to:"body"},[Y($n,{name:"fade"},{default:Ge(()=>[s(t).operationError?(i(),d("div",vm,[Y(s(Cn),{class:"w-4 h-4 flex-shrink-0"}),o("span",gm,T(s(t).operationError),1),o("button",{class:"flex-shrink-0 p-0.5 hover:bg-white/20 rounded transition-colors",onClick:_[41]||(_[41]=$e=>s(t).clearOperationError()),"aria-label":"Dismiss error"},[Y(s(ht),{class:"w-3.5 h-3.5"})])])):P("",!0)]),_:1})]))])}}}),bm=Ko(xm,[["__scopeId","data-v-100753e7"]]),ym=Bs("/app-logo.svg");function km(e){return/^\/speckit\.(clarify|plan|tasks|implement)(\s|$)/.test(e)}function wm(e=Date.now,n=Math.random){return`req-${e()}-${n().toString(36).slice(2,8)}`}function Fr(e=Date.now){return`session-${e()}`}function Po(e,n=!1){const t={};return(!n||e?.hasWorktree)&&e?.worktreePath&&(t.cwd=e.worktreePath,t.worktreeBranch=e.worktreeBranch),e?.featureId&&(t.featureId=e.featureId),Object.keys(t).length>0?t:void 0}function ws(e){if(e.file_path)return String(e.file_path);if(e.path)return String(e.path);if(e.command)return String(e.command).slice(0,50);if(e.pattern)return String(e.pattern);for(const n of Object.values(e))if(typeof n=="string"&&n.length<100)return n;return""}function Do(e,n="Permission"){const t=e||"",a=t.match(/write to (.+?)(?:[\s,?]|$)/i),r=t.match(/read (.+?)(?:[\s,?]|$)/i),l=t.match(/run (.+?)(?:[?,]|$)/i);return a?.[1]?{tool:"Write",description:t,filePath:a[1].trim()}:r?.[1]?{tool:"Read",description:t,filePath:r[1].trim()}:l?.[1]?{tool:"Bash",description:t,command:l[1].trim()}:{tool:n,description:t}}const Cs=po("autoMode",()=>{const e=S(!1),n=S(null),t=S(!1),a=S(null);let r=null,l=null;const c=new Map,f=H(()=>n.value?.state==="active"),h=H(()=>n.value?.tasks??[]),m=H(()=>h.value.filter(Z=>Z.state==="queued").length),y=H(()=>h.value.find(Z=>Z.state==="running")??null),C=H(()=>h.value.filter(Z=>Z.state==="completed").length),x=H(()=>h.value.filter(Z=>Z.state==="failed").length),v=H(()=>h.value.length);async function g(){if(typeof window<"u")try{(await $fetch("/api/settings"))?.autoModeEnabled===!0&&(e.value=!0)}catch{}try{const Z=await $fetch("/api/auto-mode/status");e.value=Z.enabled,n.value=Z.session}catch{}de()}async function B(){t.value=!0,a.value=null;try{const z=Kn().autoModeConcurrency,N=await $fetch("/api/auto-mode/toggle",{method:"POST",body:{enabled:!e.value,concurrency:z}});N.success?(e.value=N.enabled,re(N.enabled)):a.value=N.error||"Toggle failed"}catch(Z){a.value=Z instanceof Error?Z.message:String(Z)}finally{t.value=!1}}function V(Z){switch(Z.type){case"auto_mode_status":e.value=Z.enabled,n.value=Z.session,re(Z.enabled);break;case"auto_mode_task_update":if(n.value){const z=n.value.tasks.findIndex(N=>N.featureId===Z.task.featureId);z>=0&&(n.value.tasks[z]=Z.task)}Z.task.state==="running"&&Z.task.worktreePath&&Z.task.worktreeBranch&&ue(Z.task);break;case"auto_mode_error":a.value=Z.error;break;case"auto_mode_step_start":fe(Z.featureId,Z.step);break;case"auto_mode_step_complete":ce(Z.featureId);break;case"auto_mode_message":W(Z.featureId,Z.sdkMessage);break}}function E(Z){return mt().findConversationByFeature(Z)}function fe(Z,z){if(typeof window>"u")return;const N=mt(),p=E(Z);if(!p)return;const u={id:uo(),role:"user",content:`/speckit.${z} ${Z}`,timestamp:new Date().toISOString()};N.addMessage(u,p.id);const b={id:uo(),role:"assistant",content:"",timestamp:new Date().toISOString(),status:"streaming"};N.addMessage(b,p.id),c.set(Z,b.id),N.startConversationStreaming(p.id),N.saveConversation(p.id,!1)}function ce(Z){if(typeof window>"u")return;const z=mt(),N=E(Z);if(!N)return;const p=c.get(Z);p&&(z.updateMessage(p,{status:"complete"},N.id),c.delete(Z)),z.endConversationStreaming(N.id),z.saveConversation(N.id,!0)}function W(Z,z){if(typeof window>"u")return;const N=mt(),p=E(Z);if(!p)return;const u=c.get(Z);if(u){if(z.type==="assistant"&&z.message?.content){for(const b of z.message.content)if(b.type==="text"&&b.text)N.appendToMessageWithSave(u,b.text,p.id);else if(b.type==="tool_use"&&b.name){const j=b.input?ws(b.input):"",G=`
68
+
69
+ ▶ **${b.name}** ${j}
70
+ `;N.appendToMessageWithSave(u,G,p.id)}}if(z.type==="tool_result"||z.type==="user"){const b=z.message?.content||z.content;if(Array.isArray(b)){for(const j of b)if(j.type==="tool_result"&&j.content){const G=typeof j.content=="string"?j.content:Array.isArray(j.content)?j.content.filter(Q=>Q.type==="text").map(Q=>Q.text).join(""):"";if(G){const Q=G.slice(0,300),J=G.length>300?"...":"",ee=j.is_error?"✗ Error:":"✓";N.appendToMessageWithSave(u,`${ee} ${Q}${J}
71
+ `,p.id)}}}}}}function ue(Z){if(typeof window>"u")return;const z=mt(),N=z.findConversationByFeature(Z.featureId);if(N){const b=z.conversations.find(j=>j.id===N.id);b&&(b.autoMode||(b.autoMode=!0),Z.worktreePath&&!b.worktreePath&&(b.worktreePath=Z.worktreePath,b.worktreeBranch=Z.worktreeBranch,b.baseBranch=Z.baseBranch,b.cwd=Z.worktreePath,b.hasWorktree=!0),z.saveAllConversations());return}const u={id:Ur(),title:`Auto: ${Z.featureId}`,messages:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),cwd:Z.worktreePath||"",featureId:Z.featureId,autoMode:!0,worktreePath:Z.worktreePath,worktreeBranch:Z.worktreeBranch,baseBranch:Z.baseBranch,hasWorktree:!0};z.addAutoModeConversation(u)}function de(){if(typeof window>"u"||r&&r.readyState===WebSocket.OPEN)return;l&&(clearTimeout(l),l=null);const z=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/auto-mode-ws`;r=new WebSocket(z),r.onmessage=N=>{try{const p=JSON.parse(N.data);V(p)}catch{}},r.onclose=()=>{r=null,l=setTimeout(()=>de(),5e3)},r.onerror=()=>{}}function le(){l&&(clearTimeout(l),l=null),r&&(r.close(),r=null)}function re(Z){typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{autoModeEnabled:Z}}).catch(z=>{console.error("Failed to persist autoModeEnabled:",z)})}return{enabled:e,session:n,loading:t,error:a,isActive:f,tasks:h,queuedCount:m,runningTask:y,completedCount:C,failedCount:x,totalCount:v,initialize:g,toggle:B,disconnectWebSocket:le}}),Cm=["disabled"],$m=Ce({__name:"AutoModeToggle",setup(e){const n=Cs();return st(()=>{n.initialize()}),(t,a)=>(i(),d("button",{type:"button",class:ve(["flex items-center gap-1.5 px-2 py-1 rounded text-xs font-mono transition-colors",s(n).enabled?"bg-retro-yellow/20 text-retro-yellow hover:bg-retro-yellow/30":"text-retro-muted hover:text-retro-text hover:bg-retro-panel"]),disabled:s(n).loading,title:"Toggle Auto Mode — background spec processing",onClick:a[0]||(a[0]=r=>s(n).toggle())},[Y(s(Yo),{class:ve(["h-4 w-4",{"animate-pulse":s(n).isActive}])},null,8,["class"]),a[1]||(a[1]=o("span",null,"Auto",-1)),s(n).enabled?(i(),d("span",{key:0,class:ve(["inline-block w-1.5 h-1.5 rounded-full bg-retro-yellow",{"animate-pulse":s(n).isActive}])},null,2)):P("",!0)],10,Cm))}}),Sm={class:"flex items-start justify-between gap-2"},_m={class:"flex-1 min-w-0"},Mm={class:"flex items-center gap-2"},Tm={class:"font-mono text-sm text-retro-text truncate"},Am={class:"text-sm font-mono text-retro-muted mt-1 truncate"},Bm={class:"flex items-center gap-1 flex-shrink-0"},Rm={key:0,class:"w-2 h-2 rounded-full bg-retro-green",title:"spec"},Em={key:1,class:"w-2 h-2 rounded-full bg-retro-cyan",title:"plan"},Pm={key:2,class:"w-2 h-2 rounded-full bg-retro-yellow",title:"tasks"},Dm={class:"flex flex-wrap items-center justify-between gap-1 mt-2"},Lm={key:0,class:"flex items-center gap-1"},Im=["title","disabled","onClick"],Nm=Ce({__name:"FeatureCard",props:{feature:{},skills:{},isActive:{type:Boolean}},emits:["select","cascade","openChat","skill"],setup(e,{emit:n}){const t={DocumentCheckIcon:Qs,PuzzlePieceIcon:Cr,DocumentMagnifyingGlassIcon:ea,WrenchScrewdriverIcon:da,SparklesIcon:xo,BeakerIcon:Ws,ShieldCheckIcon:rs,CommandLineIcon:Xs,CpuChipIcon:es,LightBulbIcon:aa},a=e,r=n,l=mt();function c(x){return t[x]||Cr}function f(x){return x.prerequisites.every(v=>a.feature.files.some(g=>g.filename===v))}function h(x){return x.prerequisites.filter(v=>!a.feature.files.some(g=>g.filename===v))}function m(x){return f(x)?`${x.name} (Shift+click: new conversation)`:`Requires: ${h(x).join(", ")}`}const y=H(()=>{const x=l.findConversationByFeature(a.feature.id);return x?l.isConversationStreaming(x.id):!1}),C=H(()=>a.isActive?["border-retro-cyan shadow-retro","feature-card-active","dark:bg-gradient-to-br dark:from-retro-cyan/10 dark:via-retro-panel dark:to-retro-magenta/5"]:["border-retro-border","feature-card-light","hover:border-retro-muted","dark:bg-gradient-to-br","dark:from-retro-panel dark:via-retro-panel dark:to-retro-cyan/5","dark:hover:from-retro-cyan/5 dark:hover:via-retro-panel dark:hover:to-retro-magenta/5"]);return(x,v)=>(i(),d("button",{type:"button",class:ve(["w-full p-3 text-left rounded-lg border transition-all duration-200 group",s(C)]),onClick:v[6]||(v[6]=g=>r("select",e.feature.id))},[o("div",Sm,[o("div",_m,[o("div",Mm,[Y(s(qn),{class:ve(["h-4 w-4 flex-shrink-0 transition-colors duration-200",e.isActive?"text-retro-cyan":"text-retro-muted group-hover:text-retro-cyan"])},null,8,["class"]),o("span",Tm,T(e.feature.id),1)]),o("p",Am,T(e.feature.name),1)]),o("div",Bm,[e.feature.hasSpec?(i(),d("span",Rm)):P("",!0),e.feature.hasPlan?(i(),d("span",Em)):P("",!0),e.feature.hasTasks?(i(),d("span",Pm)):P("",!0)])]),o("div",Dm,[e.feature.hasSpec?(i(),d("div",Lm,[o("button",{type:"button",class:"flex items-center justify-center p-1 bg-retro-cyan/20 text-retro-cyan rounded hover:bg-retro-cyan/30 transition-colors",title:"Clarify spec (Shift+click: new conversation)",onClick:v[0]||(v[0]=lt(g=>r("cascade",g,e.feature.id,"clarify"),["stop"]))},[Y(s(nr),{class:"h-3.5 w-3.5"})]),o("button",{type:"button",class:"flex items-center justify-center p-1 bg-retro-cyan/20 text-retro-cyan rounded hover:bg-retro-cyan/30 transition-colors",title:"Plan → Tasks → Implement (Shift+click: new conversation)",onClick:v[1]||(v[1]=lt(g=>r("cascade",g,e.feature.id,"plan"),["stop"]))},[Y(s(er),{class:"h-3.5 w-3.5"})]),e.feature.hasPlan?(i(),d("button",{key:0,type:"button",class:"flex items-center justify-center p-1 bg-retro-yellow/20 text-retro-yellow rounded hover:bg-retro-yellow/30 transition-colors",title:"Tasks → Implement (Shift+click: new conversation)",onClick:v[2]||(v[2]=lt(g=>r("cascade",g,e.feature.id,"tasks"),["stop"]))},[Y(s(ns),{class:"h-3.5 w-3.5"})])):P("",!0),e.feature.hasTasks?(i(),d("button",{key:1,type:"button",class:"flex items-center justify-center p-1 bg-retro-magenta/20 text-retro-magenta rounded hover:bg-retro-magenta/30 transition-colors",title:"Implement (Shift+click: new conversation)",onClick:v[3]||(v[3]=lt(g=>r("cascade",g,e.feature.id,"implement"),["stop"]))},[Y(s(ca),{class:"h-3.5 w-3.5"})])):P("",!0),e.feature.hasTasks?(i(),d("button",{key:2,type:"button",class:"flex items-center justify-center p-1 bg-retro-orange/20 text-retro-orange rounded hover:bg-retro-orange/30 transition-colors",title:"Analyze spec/plan/tasks consistency (Shift+click: new conversation)",onClick:v[4]||(v[4]=lt(g=>r("cascade",g,e.feature.id,"analyze"),["stop"]))},[Y(s(qs),{class:"h-3.5 w-3.5"})])):P("",!0),e.skills.length>0?(i(),d(he,{key:3},[v[7]||(v[7]=o("div",{class:"w-px h-4 bg-retro-border mx-0.5"},null,-1)),(i(!0),d(he,null,Be(e.skills,g=>(i(),d("button",{key:g.id,type:"button",class:ve(["flex items-center justify-center p-1 rounded transition-colors",[f(g)&&!s(y)?"bg-retro-pink/20 text-retro-pink hover:bg-retro-pink/30":"bg-retro-subtle/10 text-retro-subtle cursor-not-allowed",s(y)?"animate-pulse":""]]),title:m(g),disabled:!f(g)||s(y),onClick:lt(B=>r("skill",B,e.feature.id,g.id),["stop"])},[(i(),ie(Rn(c(g.icon)),{class:"h-3.5 w-3.5"}))],10,Im))),128))],64)):P("",!0)])):P("",!0),e.feature.hasSpec?(i(),d("button",{key:1,type:"button",class:"flex items-center justify-center p-1 bg-retro-green/20 text-retro-green rounded hover:bg-retro-green/30 transition-colors",title:"Open new chat linked to this spec",onClick:v[5]||(v[5]=lt(g=>r("openChat",g,e.feature.id),["stop"]))},[Y(s(Yr),{class:"h-3.5 w-3.5"})])):P("",!0)])],2))}});function $s(){function e(n){const t=Oe.parse(n);return ks.sanitize(t)}return{renderMarkdown:e}}const Fm={class:"fixed inset-0 z-50 flex items-center justify-center"},Hm={class:"relative w-[96vw] h-[94vh] bg-retro-black border border-retro-border rounded-lg shadow-2xl flex flex-col overflow-hidden"},Om={class:"flex-shrink-0 flex items-center justify-between px-4 h-12 border-b border-retro-border bg-retro-dark"},Um={class:"flex items-center gap-3 min-w-0"},jm={class:"text-sm font-mono font-bold text-retro-cyan truncate"},zm={class:"text-xs font-mono text-retro-subtle"},Vm={class:"flex items-center gap-2"},Wm=["disabled"],Gm={key:0,class:"flex-shrink-0 flex items-center gap-0 border-b border-retro-border bg-retro-dark overflow-x-auto"},qm=["onClick"],Zm={class:"flex-1 min-h-0 overflow-y-auto"},Km={key:0,class:"flex items-center justify-center py-12"},Ym={key:1,class:"flex flex-col items-center justify-center py-12 text-center px-4"},Xm={class:"text-sm font-mono text-retro-red"},Qm={key:2,class:"flex flex-col items-center justify-center py-12 text-center"},Jm={key:3,class:"h-full flex flex-col"},eh=["innerHTML"],th=Ce({__name:"SpecViewerModal",props:{feature:{}},emits:["close"],setup(e,{emit:n}){const t=e,a=n,r=Dn(),{renderMarkdown:l}=$s(),c=S(t.feature.files[0]?.filename||""),f=S(""),h=S(!1),m=S(null),y=S(!1),C=S(""),x=S(!1);async function v(){if(c.value){h.value=!0,m.value=null;try{const W=`/api/specs/${t.feature.id}/${c.value}`,ue=await $fetch(W);f.value=ue.content}catch{m.value="Failed to load file",f.value=""}finally{h.value=!1}}}const g=H(()=>f.value?l(f.value):"");function B(W){y.value&&(y.value=!1),c.value=W,v()}function V(){C.value=f.value,y.value=!0}function E(){y.value=!1,C.value=""}async function fe(){x.value=!0;try{const W=`/api/specs/${t.feature.id}/${c.value}`;await $fetch(W,{method:"PUT",body:{content:C.value}}),f.value=C.value,y.value=!1,r.success("Saved")}catch{r.error("Failed to save")}finally{x.value=!1}}function ce(W){W.key==="Escape"&&(y.value?E():a("close"))}return st(()=>{window.addEventListener("keydown",ce),v()}),_t(()=>{window.removeEventListener("keydown",ce)}),(W,ue)=>(i(),ie(Jt,{to:"body"},[o("div",Fm,[o("div",{class:"absolute inset-0 bg-black/80",onClick:ue[0]||(ue[0]=de=>a("close"))}),o("div",Hm,[o("div",Om,[o("div",Um,[o("span",jm,T(e.feature.name),1),o("span",zm,T(e.feature.id),1)]),o("div",Vm,[s(y)?(i(),d(he,{key:0},[o("button",{type:"button",class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-muted transition-colors",onClick:E}," Cancel "),o("button",{type:"button",class:"px-3 py-1 text-xs font-mono rounded border border-retro-cyan text-retro-cyan hover:bg-retro-cyan/10 transition-colors disabled:opacity-50",disabled:s(x),onClick:fe},T(s(x)?"Saving...":"Save"),9,Wm)],64)):s(f)&&!s(h)&&!s(m)?(i(),d("button",{key:1,type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Edit",onClick:V},[Y(s(tr),{class:"h-4 w-4"})])):P("",!0),o("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close (ESC)",onClick:ue[1]||(ue[1]=de=>a("close"))},[Y(s(ht),{class:"h-4 w-4"})])])]),e.feature.files.length>0?(i(),d("div",Gm,[(i(!0),d(he,null,Be(e.feature.files,de=>(i(),d("button",{key:de.filename,type:"button",class:ve(["px-4 py-2 text-xs font-mono border-b-2 transition-colors whitespace-nowrap",[s(c)===de.filename?"border-retro-cyan text-retro-cyan bg-retro-black":"border-transparent text-retro-muted hover:text-retro-text hover:bg-retro-panel"]]),onClick:le=>B(de.filename)},T(de.label),11,qm))),128))])):P("",!0),o("div",Zm,[s(h)?(i(),d("div",Km,[...ue[3]||(ue[3]=[o("span",{class:"text-sm font-mono text-retro-muted animate-pulse"},"Loading...",-1)])])):s(m)?(i(),d("div",Ym,[o("p",Xm,T(s(m)),1),o("button",{type:"button",class:"mt-3 px-3 py-1.5 text-xs font-mono bg-retro-panel border border-retro-border rounded text-retro-muted hover:text-retro-cyan hover:border-retro-cyan transition-colors",onClick:v}," Retry ")])):e.feature.files.length===0?(i(),d("div",Qm,[...ue[4]||(ue[4]=[o("p",{class:"text-sm font-mono text-retro-muted"},"No spec files found",-1),o("p",{class:"mt-1 text-xs font-mono text-retro-subtle"}," This feature directory has no .md files ",-1)])])):s(y)?(i(),d("div",Jm,[Me(o("textarea",{"onUpdate:modelValue":ue[2]||(ue[2]=de=>Ie(C)?C.value=de:null),class:"flex-1 w-full p-4 bg-retro-black text-sm font-mono text-retro-text resize-none focus:outline-none",spellcheck:"false"},null,512),[[ut,s(C)]])])):(i(),d("div",{key:4,class:"spec-markdown p-6 text-sm font-mono text-retro-text max-w-4xl mx-auto",innerHTML:s(g)},null,8,eh))])])])]))}}),nt=new Map,rn=new Map,io=new Set,nh=3e4,oh=18e4;function pr(){const e=mt(),n=Kn();function t(){return typeof window>"u"?"":`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/_ws`}function a(p){p.healthCheckInterval&&(clearInterval(p.healthCheckInterval),p.healthCheckInterval=null)}function r(p){a(p),p.lastMessageTime=Date.now(),p.healthCheckInterval=hr(()=>{const u=p.conversationId;if(p.ws.readyState!==WebSocket.OPEN){console.warn(`[useChatStream] Health check: WebSocket not open for ${u}`),a(p),e.isConversationStreaming(u)&&(f(p.currentMessageId,u,"error"),e.updateMessage(p.currentMessageId,{status:"error"},u),e.setSessionError("Connection lost during streaming",u),e.endSession(u),e.endConversationStreaming(u)),nt.delete(u);return}if(e.isConversationStreaming(u)){const b=Date.now()-p.lastMessageTime;b>oh&&(console.warn(`[useChatStream] Health check: streaming timeout for ${u} (${Math.round(b/1e3)}s)`),a(p),f(p.currentMessageId,u,"error"),e.updateMessage(p.currentMessageId,{status:"error"},u),e.setSessionError("Streaming timed out — no response from server for 3 minutes",u),e.endSession(u),e.endConversationStreaming(u),p.ws.close(),nt.delete(u))}},nh)}function l(p,u){return e.conversations.find(j=>j.id===p)?.messages.find(j=>j.id===u)?.status}function c(p,u=!0){const b=nt.get(p);b&&(a(b),u&&b.ws.readyState===WebSocket.OPEN&&b.ws.close(),nt.delete(p))}function f(p,u,b){const G=e.conversations.find(Q=>Q.id===u)?.messages.find(Q=>Q.id===p);if(G?.contentBlocks)for(const Q of G.contentBlocks)Q.type==="tool_use"&&(Q.status==="running"||Q.status==="pending")&&e.updateBlockById(p,Q.id,J=>{J.type==="tool_use"&&(J.status=b)},u)}async function h(p){try{(await m(p)).send(JSON.stringify({type:"reset_context"})),e.clearProviderSession(p),console.log("[useChatStream] Context reset requested for conversation:",p)}catch(u){throw console.error("[useChatStream] Failed to reset context:",u),u}}function m(p){return new Promise((u,b)=>{const j=nt.get(p);if(j&&j.ws.readyState===WebSocket.OPEN){u(j.ws);return}j&&(j.ws.close(),nt.delete(p));const G=t(),Q=new WebSocket(G),J={ws:Q,currentMessageId:"",conversationId:p,activeTools:new Map,currentTextBlockId:null,currentThinkingBlockId:null,healthCheckInterval:null,lastMessageTime:Date.now()};nt.set(p,J),Q.onopen=()=>{u(Q)},Q.onerror=ee=>{console.error(`[useChatStream] WebSocket error for conversation ${p}:`,ee);const te=nt.get(p);e.isConversationStreaming(p)&&(te?.currentMessageId&&(f(te.currentMessageId,p,"error"),e.updateMessage(te.currentMessageId,{status:"error"},p)),e.setSessionError("Connection error during streaming",p),e.endSession(p),e.endConversationStreaming(p)),nt.delete(p),b(new Error("WebSocket connection failed. Server may be unavailable."))},Q.onclose=ee=>{const te=nt.get(p);if(te&&a(te),nt.delete(p),rn.delete(p),e.isConversationStreaming(p)){te?.currentMessageId&&(f(te.currentMessageId,p,"error"),e.updateMessage(te.currentMessageId,{status:"error"},p));const O=ee.reason||(ee.code===1006?"Network error or server unavailable":"Unknown reason");e.setSessionError(`Connection closed: ${O} (code: ${ee.code})`,p),e.endSession(p),e.endConversationStreaming(p)}},Q.onmessage=ee=>{v(ee.data,p)}})}async function y(p,u=3){for(let b=0;b<u;b++){const j=e.conversations.find(G=>G.id===p);if(j)return j;b<u-1&&await new Promise(G=>setTimeout(G,100))}console.error("[useChatStream] Conversation not found after retries:",p)}function C(p,u){return`${p}:${u}`}function x(p,u){const b=e.conversations.find(G=>G.id===p);if(!b)return null;const j=b.messages.findIndex(G=>G.id===u);if(j<=0)return null;for(let G=j-1;G>=0;G--){const Q=b.messages[G];if(Q.role==="user"&&Q.content.trim().length>0)return Q.content}return null}async function v(p,u){const b=nt.get(u);if(b){b.lastMessageTime=Date.now();try{e.pushDebugEvent({direction:"in",channel:"ws",eventType:"ws.raw",payload:p},u);const j=JSON.parse(p);if(e.pushDebugEvent({direction:"in",channel:"ws",eventType:j.type,payload:j},u),j.type==="error"){console.error(`[useChatStream] Server error for ${u}:`,j.error);const G=j.error||"Unknown server error",Q=/codex cannot access session files|failed to clean up stale arg0 temp dirs: Permission denied|failed to initialize rollout recorder: Permission denied|failed to create session: Permission denied|\/\.codex\/.*permission denied/i.test(G);if(/state db missing rollout path for thread/i.test(G)&&!Q){const ee=C(u,b.currentMessageId);if(!io.has(ee)){const te=x(u,b.currentMessageId);if(te){io.add(ee),e.setProviderSessionId("",u),B(b.currentMessageId,`
72
+
73
+ > **Session Reset**: Codex resume state was corrupted. Retrying once with a fresh session...
74
+
75
+ `,u);try{const O=e.conversations.find(L=>L.id===u),I=Po(O);await fe(te,b.currentMessageId,u,I);return}catch(O){console.error(`[useChatStream] Rollout-path recovery retry failed for ${u}:`,O)}}}}a(b),f(b.currentMessageId,u,"error"),e.updateMessage(b.currentMessageId,{status:"error"},u),/state db missing rollout path for thread/i.test(G)&&e.setProviderSessionId("",u),io.delete(C(u,b.currentMessageId)),e.setSessionError(G,u),e.endSession(u),e.endConversationStreaming(u),ue(u),e.saveConversation(u,!0),c(u);return}if(j.type==="done"){a(b);const G=l(u,b.currentMessageId);if(io.delete(C(u,b.currentMessageId)),j.denied){f(b.currentMessageId,u,"error"),e.updateMessage(b.currentMessageId,{status:"stopped"},u),e.endSession(u),e.endConversationStreaming(u),ue(u),e.clearPendingPermission(u),b.activeTools.clear(),e.saveConversation(u,!0),c(u);return}if(G==="error"||G==="stopped"){f(b.currentMessageId,u,"error"),e.endSession(u),e.endConversationStreaming(u),ue(u),e.clearPendingPermission(u),b.activeTools.clear(),e.saveConversation(u,!0),c(u);return}f(b.currentMessageId,u,"complete"),e.completeMessageWithSave(b.currentMessageId,u),e.endSession(u),e.endConversationStreaming(u);const Q=await y(u),J=Q?.hasWorktree&&Q.worktreePath?$fetch("/api/chat/worktree-commit",{method:"POST",body:{worktreePath:Q.worktreePath,conversationId:u}}).then(te=>Q.previewBranch&&Q.worktreePath?fetch("/api/chat/preview-sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({previewBranch:Q.previewBranch,worktreePath:Q.worktreePath})}).then(()=>te):te).then(te=>{if(te?.success&&te.currentBranch!==Q.worktreeBranch){const O=Q.worktreeBranch;e.updateWorktreeBranch(u,te.currentBranch),B(b.currentMessageId,`
76
+
77
+ > **Branch changed**: AI switched from \`${O}\` to \`${te.currentBranch}\`
78
+
79
+ `,u)}else te?.success&&Q.worktreeBranch&&e.updateWorktreeBranch(u,Q.worktreeBranch);return e.saveConversation(u,!1),te}).catch(te=>{console.warn("[useChatStream] Auto-commit/preview-sync failed:",te)}):Promise.resolve(),ee=rn.get(u);if(ee&&ee.queue.length>0){const te=ee.queue.shift(),O=ee.featureId;J.then(()=>{setTimeout(()=>{de(u,O,te)},1500)}),ee.queue.length===0&&rn.delete(u)}e.clearPendingPermission(u),e.saveConversation(u,!0),b.activeTools.clear(),c(u),rn.delete(u);return}if(j.type==="pong")return;if(j.type==="session_reset"){console.warn(`[useChatStream] Session reset for ${u}:`,j.reason),e.setProviderSessionId("",u),B(b.currentMessageId,`
80
+
81
+ > **Session Reset**: Previous session could not be resumed. Retrying with a fresh session...
82
+
83
+ `,u);return}if(j.type==="worktree_recovered"){console.log(`[useChatStream] Worktree recovered for ${u}`),B(b.currentMessageId,`
84
+
85
+ > **Worktree recovered**: The work directory was restored after a system restart.
86
+
87
+ `,u);return}if(j.type==="context_reset"){console.log(`[useChatStream] Context reset confirmed for ${u}`);return}if(j.type==="aborted"){console.log(`[useChatStream] Abort confirmed for ${u}`);return}if(j.type==="permission_request"){a(b),e.endConversationStreaming(u);const G=Do(j.description||"",j.tool||"Permission");e.setPendingPermission(G,u);let Q=`
88
+
89
+ **Permission Required**: ${G.tool}`;G.filePath&&(Q+=` - ${G.filePath}`),B(b.currentMessageId,Q+`
90
+ `,u);return}if(j.type==="permission_prompt"&&j.text){a(b),e.endConversationStreaming(u);const G=Do(j.text,"Permission");e.setPendingPermission(G,u);const Q=`
91
+
92
+ **${G.tool}**: ${G.filePath||G.command||G.description}
93
+ `;B(b.currentMessageId,Q,u);return}j.type==="provider_json"&&j.data&&E(j.data,u)}catch(j){console.error(`[useChatStream] Failed to parse WebSocket message for ${u}:`,j,"Raw data:",p?.slice(0,200)),f(b.currentMessageId,u,"error"),e.updateMessage(b.currentMessageId,{status:"error"},u),e.setSessionError(`Failed to parse server response: ${j instanceof Error?j.message:"Invalid JSON"}`,u),e.endSession(u),e.endConversationStreaming(u),ue(u),e.saveConversation(u,!0),c(u)}}}function g(p,u){e.initContentBlocks(p,u)}function B(p,u,b){g(p,b);const j={id:gn(),type:"text",text:u};e.appendContentBlockWithSave(p,j,b),e.appendToMessage(p,u,b)}function V(p,u){return!!e.conversations.find(G=>G.id===u)?.messages.find(G=>G.id===p)?.contentBlocks?.some(G=>G.type==="session_init")}function E(p,u){const b=nt.get(u);if(!b)return;e.pushDebugEvent({direction:"in",channel:"provider",eventType:p.type,payload:p},u);const j=typeof p.type=="string"?p.type.toLowerCase():"",G="subtype"in p&&typeof p.subtype=="string"?String(p.subtype).toLowerCase():"";if(!(j.includes("error")||j.includes("failed")||G.startsWith("error"))&&"session_id"in p&&p.session_id&&e.setProviderSessionId(p.session_id,u),p.type==="permission_request"){const ee=p.permission,te={tool:ee.tool,filePath:ee.file_path||ee.path,command:ee.command,description:ee.description,input:ee};e.setPendingPermission(te,u);let O=`
94
+
95
+ **Permission Required**: ${ee.tool}`;te.filePath?O+=` - ${te.filePath}`:te.command&&(O+=` - \`${te.command}\``),B(b.currentMessageId,O+`
96
+ `,u);return}if(p.type==="user"){const J=p,ee=J.message?.content||J.content;if(ee){for(const te of ee)if(te.type==="tool_result"&&te.is_error&&te.content){const O=te.content;if(O.includes("requested permissions")||O.includes("haven't granted")){const I=Do(O,"Permission");e.setPendingPermission(I,u);let L=`
97
+
98
+ **Permission Required**: ${I.tool}`;I.filePath?L+=` - ${I.filePath}`:I.command&&(L+=` - \`${I.command}\``),B(b.currentMessageId,L+`
99
+ `,u);return}}}}if(p.type==="system"){const J=p;if(J.subtype==="init"&&J.model){g(b.currentMessageId,u);const ee={id:gn(),type:"session_init",model:J.model,tools:J.tools||[],permissionMode:J.permissionMode||"",cwd:J.cwd||""};e.appendContentBlockWithSave(b.currentMessageId,ee,u)}return}if(p.type==="stream_event"){const ee=p.event;if(ee.type==="content_block_start"&&ee.content_block){const te=ee.content_block;if(te.type==="text"){g(b.currentMessageId,u);const O=gn(),I={id:O,type:"text",text:te.text||""};e.appendContentBlockWithSave(b.currentMessageId,I,u),b.currentTextBlockId=O}if(te.type==="thinking"){g(b.currentMessageId,u);const O=gn(),I={id:O,type:"thinking",thinking:te.thinking||""};e.appendContentBlockWithSave(b.currentMessageId,I,u),b.currentThinkingBlockId=O}if((te.type==="tool_use"||te.type==="server_tool_use")&&te.id&&te.name){g(b.currentMessageId,u);const O=gn(),I={id:O,type:"tool_use",toolUseId:te.id,name:te.name,input:{},inputSummary:"",status:"running"};e.appendContentBlockWithSave(b.currentMessageId,I,u),b.activeTools.set(ee.index??0,{blockId:O,toolUseId:te.id,name:te.name,inputJson:""})}}if(ee.type==="content_block_delta"&&ee.delta&&(ee.delta.text&&b.currentTextBlockId&&(e.updateBlockWithSave(b.currentMessageId,b.currentTextBlockId,te=>{te.type==="text"&&(te.text+=ee.delta.text)},u),e.appendToMessage(b.currentMessageId,ee.delta.text,u)),ee.delta.thinking&&b.currentThinkingBlockId&&e.updateBlockWithSave(b.currentMessageId,b.currentThinkingBlockId,te=>{te.type==="thinking"&&(te.thinking+=ee.delta.thinking)},u),ee.delta.partial_json&&ee.index!==void 0)){const te=b.activeTools.get(ee.index);te&&(te.inputJson+=ee.delta.partial_json)}if(ee.type==="content_block_stop"&&(b.currentTextBlockId&&(b.currentTextBlockId=null),b.currentThinkingBlockId&&(b.currentThinkingBlockId=null),ee.index!==void 0)){const te=b.activeTools.get(ee.index);if(te){let O={};try{O=JSON.parse(te.inputJson)}catch{}if(te.name==="ExitPlanMode"){const I={allowedPrompts:O.allowedPrompts};e.setPendingPlanApproval(I,u)}e.updateBlockWithSave(b.currentMessageId,te.blockId,I=>{if(I.type==="tool_use"){const L=I;L.input=O,L.inputSummary=ws(O),L.status="pending"}},u)}}return}if(p.type==="tool_result"){const J=p;g(b.currentMessageId,u);const ee=e.findToolUseBlock(b.currentMessageId,J.tool_use_id,u);ee&&ee.type==="tool_use"&&e.updateBlockById(b.currentMessageId,ee.id,O=>{O.type==="tool_use"&&(O.status=J.is_error?"error":"complete")},u);const te={id:gn(),type:"tool_result",toolUseId:J.tool_use_id,content:J.content||"",isError:!!J.is_error};e.appendContentBlockWithSave(b.currentMessageId,te,u),J.is_error&&console.warn("[useChatStream] Tool error:",J.content?.slice(0,500));return}if(p.type==="result"){const J=p;if((J.is_error||J.subtype==="error_max_turns"||J.subtype==="error_during_execution")&&(e.updateMessage(b.currentMessageId,{status:"error"},u),ue(u),J.subtype==="error_max_turns"?e.setSessionError("Maximum conversation turns reached. Please start a new conversation.",u):J.subtype==="error_during_execution"&&e.setSessionError("An error occurred during provider execution.",u),console.error("[useChatStream] Result error:",J.subtype)),J.subtype==="success"&&J.usage){g(b.currentMessageId,u);const ee={id:gn(),type:"result_summary",totalCostUsd:J.total_cost_usd??0,durationMs:J.duration_ms??0,numTurns:J.num_turns??0,usage:{inputTokens:J.usage.input_tokens??0,outputTokens:J.usage.output_tokens??0,cacheCreationInputTokens:J.usage.cache_creation_input_tokens??0,cacheReadInputTokens:J.usage.cache_read_input_tokens??0}};e.appendContentBlockWithSave(b.currentMessageId,ee,u)}}}async function fe(p,u,b,j){if(typeof window>"u")return;const G=wm();try{const Q=await m(b),J=nt.get(b);J&&(J.currentMessageId=u,J.activeTools.clear(),J.currentTextBlockId=null,J.currentThinkingBlockId=null,r(J)),km(p)&&e.setProviderSessionId("",b);const te=e.getProviderSessionId(b),O=e.conversations.find(k=>k.id===b),I=O?.providerId||n.providerSelection.providerId||zr,L=O?.providerModelKey||n.providerSelection.modelKey||jr;O&&(!O.providerId||!O.providerModelKey)&&(e.setConversationProviderSelection(b,I,L),e.saveConversation(b,!0));const K={type:"chat",message:p,requestId:G,sessionId:te||void 0,permissionMode:e.permissionMode,conversationId:b,cwd:j?.cwd,worktreeBranch:j?.worktreeBranch,featureId:j?.featureId,providerId:I,providerModelKey:L};if(I==="codex"&&!V(u,b)){g(u,b);const k=e.permissionMode==="bypass"||e.permissionMode==="auto",q={id:gn(),type:"session_init",model:L,tools:Array.from({length:32},(se,ne)=>`tool-${ne+1}`),permissionMode:k?"bypassPermissions":e.permissionMode,cwd:j?.cwd||O?.cwd||""};e.appendContentBlockWithSave(u,q,b)}e.pushDebugEvent({direction:"out",channel:"ws",eventType:"chat",payload:K},b),Q.send(JSON.stringify(K))}catch(Q){e.updateMessage(u,{status:"error"},b),e.setSessionError(Q.message||"Connection failed",b),e.endSession(b),e.endConversationStreaming(b),e.saveConversation(b,!0),c(b)}}function ce(p,u){const b=u??e.activeConversationId;if(!b)return;const j=nt.get(b);if(!j||j.ws.readyState!==WebSocket.OPEN)return;const G={type:"permission_response",allow:p};e.pushDebugEvent({direction:"out",channel:"ws",eventType:"permission_response",payload:G},b),j.ws.send(JSON.stringify(G)),p&&(e.startConversationStreaming(b),r(j));const Q=p?"Allowed":"Denied";B(j.currentMessageId,`${Q}
100
+ `,b),e.clearPendingPermission(b)}function W(p,u,b){rn.set(u,{featureId:p,queue:[...b]})}function ue(p){p?rn.delete(p):rn.clear()}async function de(p,u,b){e.activeConversationId!==p&&e.selectConversation(p);let j;if(b.startsWith("skill:")){const ee=b.replace("skill:","");try{j=(await $fetch(`/api/skills/${ee}/prompt`,{method:"POST",body:{featureId:u}})).prompt}catch(te){console.error(`[useChatStream] Failed to render skill prompt for ${ee}:`,te);return}}else j=`/speckit.${b} ${u}`;e.addUserMessage(j,p),e.saveConversation(p,!0);const G=e.conversations.find(ee=>ee.id===p),Q=e.addAssistantMessage(p);e.startSession(Fr(),p),e.startConversationStreaming(p);const J=Po(G);await fe(j,Q.id,p,J)}function le(p){const u=p??e.activeConversationId;if(!u)return;const b=nt.get(u);if(b){if(b.ws.readyState===WebSocket.OPEN){const j={type:"abort"};e.pushDebugEvent({direction:"out",channel:"ws",eventType:"abort",payload:j},u),b.ws.send(JSON.stringify(j)),b.ws.close()}b.currentMessageId&&(f(b.currentMessageId,u,"error"),e.updateMessage(b.currentMessageId,{status:"stopped"},u),e.endSession(u),e.saveConversation(u,!0)),nt.delete(u)}e.endConversationStreaming(u),e.clearPendingPermission(u),ue(u)}function re(p){const u=nt.get(p);u&&(a(u),u.ws.close(),nt.delete(p)),rn.delete(p)}function Z(){for(const[p,u]of nt)a(u),u.ws.close(),nt.delete(p);rn.clear()}async function z(p){const u=p??e.activeConversationId;if(!u)return;e.clearPendingPlanApproval(u),e.setPermissionMode("auto");const b="Approved. Proceed with the implementation.";e.addUserMessage(b,u),e.saveConversation(u,!0);const j=e.addAssistantMessage(u);e.startSession(Fr(),u),e.startConversationStreaming(u);const G=e.conversations.find(J=>J.id===u),Q=Po(G,!0);await fe(b,j.id,u,Q)}function N(p){const u=p??e.activeConversationId;u&&e.clearPendingPlanApproval(u)}return _t(()=>{Z()}),{sendMessage:fe,sendPermissionResponse:ce,approvePlan:z,rejectPlan:N,abort:le,disconnect:Z,disconnectConversation:re,enableCascade:W,disableCascade:ue,resetContext:h}}const rh={class:"w-full max-w-md mx-4 bg-retro-dark border border-retro-border rounded-lg shadow-xl"},sh={class:"px-4 py-3 border-b border-retro-border flex items-center justify-between"},ah=["disabled"],ih={class:"px-4 py-4 space-y-3"},lh={class:"relative"},ch=["disabled"],uh={key:0,value:""},dh=["value"],fh={key:0,class:"text-xs font-mono text-retro-red"},mh={key:1,class:"text-xs font-mono text-retro-muted"},hh={class:"px-4 py-3 border-t border-retro-border flex items-center gap-2 justify-end"},ph=["disabled"],vh=["disabled"],Zo=Ce({__name:"NewConversationModal",props:{show:{type:Boolean},creating:{type:Boolean}},emits:["close","create"],setup(e,{emit:n}){const t=e,a=n,r=S([]),l=S(""),c=S(!1),f=S(""),h=H(()=>!c.value&&!t.creating&&l.value.length>0&&r.value.length>0);async function m(){c.value=!0,f.value="";try{const C=await $fetch("/api/git/branches"),x=C.branches.filter(g=>!g.isRemote&&!g.name.startsWith("br/")&&!g.name.startsWith("br/p-")).map(g=>g.name);if(r.value=x,!x.length){l.value="",f.value="No local branches available for chat creation.";return}const v=(C.current&&x.includes(C.current)?C.current:"")||(x.includes("main")?"main":"")||(x.includes("master")?"master":"")||x[0];l.value=v}catch(C){r.value=[],l.value="",f.value=C instanceof Error?C.message:"Failed to load branches"}finally{c.value=!1}}Ae(()=>t.show,C=>{C&&m()});function y(){h.value&&a("create",l.value)}return(C,x)=>(i(),ie(Jt,{to:"body"},[Y($n,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:Ge(()=>[e.show?(i(),d("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:x[3]||(x[3]=lt(v=>a("close"),["self"]))},[o("div",rh,[o("div",sh,[x[4]||(x[4]=o("h3",{class:"text-sm font-mono text-retro-text font-semibold"},"New Conversation",-1)),o("button",{type:"button",class:"p-1 text-retro-muted hover:text-retro-text transition-colors",disabled:e.creating,onClick:x[0]||(x[0]=v=>a("close"))},[Y(s(ht),{class:"w-4 h-4"})],8,ah)]),o("div",ih,[x[5]||(x[5]=o("label",{class:"block text-xs font-mono text-retro-muted"},"Base Branch",-1)),o("div",lh,[Me(o("select",{"onUpdate:modelValue":x[1]||(x[1]=v=>l.value=v),disabled:c.value||e.creating||r.value.length===0,class:"w-full appearance-none bg-retro-black border border-retro-border rounded px-2 py-1.5 pr-7 text-xs font-mono text-retro-cyan focus:outline-none focus:border-retro-cyan disabled:opacity-40"},[c.value?(i(),d("option",uh,"Loading branches...")):P("",!0),(i(!0),d(he,null,Be(r.value,v=>(i(),d("option",{key:v,value:v},T(v),9,dh))),128))],8,ch),[[_n,l.value]]),Y(s(Jo),{class:"absolute right-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted pointer-events-none"})]),f.value?(i(),d("p",fh,T(f.value),1)):(i(),d("p",mh," The conversation worktree will be created from the selected branch. "))]),o("div",hh,[o("button",{type:"button",class:"px-3 py-1.5 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text/30 transition-colors disabled:opacity-40",disabled:e.creating,onClick:x[2]||(x[2]=v=>a("close"))}," Cancel ",8,ph),o("button",{type:"button",disabled:!h.value,class:"px-3 py-1.5 text-xs font-mono rounded border bg-retro-cyan/10 border-retro-cyan/50 text-retro-cyan hover:bg-retro-cyan/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",onClick:y},T(e.creating?"Creating...":"Create"),9,vh)])])])):P("",!0)]),_:1})]))}}),gh={class:"h-full flex flex-col bg-retro-black"},xh={class:"flex-shrink-0 flex items-center justify-between px-4 py-2 border-b border-retro-border"},bh={class:"flex items-center gap-2 min-w-0"},yh={class:"flex-shrink-0 px-3 pt-3"},kh={class:"relative"},wh={class:"flex-1 overflow-y-auto p-3"},Ch={class:"space-y-2"},$h={key:0,class:"flex items-center justify-center py-12"},Sh={key:1,class:"flex flex-col items-center justify-center py-12 text-center"},_h={key:2,class:"flex flex-col items-center justify-center py-12 text-center"},Mh=Ce({__name:"FeaturesPanel",setup(e){const n=mt(),t=Qn(),{sendMessage:a,enableCascade:r}=pr(),l=Dn(),c=S("features"),f=S(null),h=S(null),m=S([]),y=S([]),C=S(!1),x=S(!1),v=S(null),g=S(!1),B=S(!1),V=S(null),E=S(""),fe=S("");let ce=null;Ae(E,K=>{ce&&clearTimeout(ce),ce=setTimeout(()=>{fe.value=K},300)});const W=H(()=>{const K=fe.value.trim().toLowerCase();return K?m.value.filter(k=>k.name.toLowerCase().includes(K)||k.id.toLowerCase().includes(K)):m.value}),ue=S({}),de=H(()=>n.activeConversation?.featureId||null);Ae(()=>n.activeConversationId,()=>{const K=de.value;K&&cn(()=>{const k=ue.value[K];k&&k.scrollIntoView({behavior:"smooth",block:"nearest"})})});async function le(){C.value=!0;try{const K=await $fetch("/api/specs/features");m.value=K.features}catch{l.error("Failed to load features"),m.value=[]}finally{C.value=!1}}async function re(){try{const K=await $fetch("/api/skills");y.value=K.skills}catch{y.value=[]}}st(()=>{le(),re()});function Z(K){f.value=K,h.value=null,c.value="files",t.setSelectedFeatureId(K);const k=m.value.find(F=>F.id===K);k&&(v.value=k,x.value=!0)}function z(){x.value=!1,v.value=null}const N={plan:["tasks","implement"],tasks:["implement"],implement:[],clarify:[],analyze:[]},p={analyze:["skill:better-spec"]};async function u(K,k){if(K.startsWith("skill:")){const F=K.replace("skill:","");return(await $fetch(`/api/skills/${F}/prompt`,{method:"POST",body:{featureId:k}})).prompt}return`/speckit.${K} ${k}`}function b(K,k){if(k)return null;const F=n.findConversationByFeature(K);return F&&!n.isConversationStreaming(F.id)?(n.selectConversation(F.id),F.id):null}async function j(K,k,F){const q=await n.createConversation({featureId:K,baseBranch:F});if(!q)throw new Error("Failed to create conversation");return n.renameConversation(q,k),n.selectConversation(q),q}async function G(K,k){n.addUserMessage(k,K),n.saveConversation(K,!0);const F=n.conversations.find(ne=>ne.id===K),q=n.addAssistantMessage(K);n.startSession(`session-${Date.now()}`,K),n.startConversationStreaming(K);const se={};F?.worktreePath&&(se.cwd=F.worktreePath,se.worktreeBranch=F.worktreeBranch),F?.featureId&&(se.featureId=F.featureId),await a(k,q.id,K,Object.keys(se).length>0?se:void 0)}async function Q(K,k,F){const q=p[k];let se;if(q&&q.length>0){const ne=[...q.slice(1),k,...N[k]||[]];r(K,F,ne);const be=q[0];try{se=await u(be,K)}catch(De){l.error(De instanceof Error?De.message:"Failed to resolve prerequisite step");return}}else{const ne=N[k]||[];ne.length>0&&r(K,F,ne),se=`/speckit.${k} ${K}`}await G(F,se)}async function J(K,k,F){const q=K.shiftKey,se=b(k,q);if(se){try{await Q(k,F,se)}catch(ne){l.error(ne instanceof Error?ne.message:"Failed to run cascade action")}return}V.value={type:"cascade",featureId:k,command:F,title:`${F}: ${k}`},g.value=!0}async function ee(K,k){V.value={type:"open-chat",featureId:k,title:`spec: ${k}`},g.value=!0}async function te(K,k,F){let q;try{q=await $fetch(`/api/skills/${k}/prompt`,{method:"POST",body:{featureId:K}})}catch(se){throw new Error(se instanceof Error?se.message:"Failed to render skill prompt")}await G(F,q.prompt)}async function O(K,k,F){const q=K.shiftKey,se=b(k,q);if(se){try{await te(k,F,se)}catch(ne){l.error(ne instanceof Error?ne.message:"Failed to run skill")}return}V.value={type:"skill",featureId:k,skillId:F,title:`skill: ${F} — ${k}`},g.value=!0}function I(){g.value=!1,V.value=null}async function L(K){if(V.value){B.value=!0;try{const k=V.value,F=await j(k.featureId,k.title,K);k.type==="cascade"?await Q(k.featureId,k.command,F):k.type==="skill"&&await te(k.featureId,k.skillId,F),g.value=!1,V.value=null}catch(k){l.error(k instanceof Error?k.message:"Failed to create conversation")}finally{B.value=!1}}}return(K,k)=>{const F=$m,q=Nm,se=th;return i(),d("div",gh,[o("div",xh,[o("div",bh,[Y(F)]),o("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Refresh",onClick:le},[Y(s(xn),{class:ve(["h-4 w-4",{"animate-spin":s(C)}])},null,8,["class"])])]),o("div",yh,[o("div",kh,[Y(s(Zn),{class:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-retro-subtle"}),Me(o("input",{"onUpdate:modelValue":k[0]||(k[0]=ne=>Ie(E)?E.value=ne:null),type:"text",placeholder:"Search features...",class:"w-full pl-8 pr-3 py-1.5 text-xs font-mono rounded border border-retro-border bg-retro-panel text-retro-text placeholder:text-retro-subtle focus:outline-none focus:border-retro-cyan transition-colors"},null,512),[[ut,s(E)]])])]),o("div",wh,[o("div",Ch,[(i(!0),d(he,null,Be(s(W),ne=>(i(),d("div",{key:ne.id,ref_for:!0,ref:be=>{s(ue)[ne.id]=be}},[Y(q,{feature:ne,skills:s(y),"is-active":s(de)===ne.id,onSelect:Z,onCascade:J,onOpenChat:ee,onSkill:O},null,8,["feature","skills","is-active"])]))),128))]),s(C)&&s(m).length===0?(i(),d("div",$h,[...k[1]||(k[1]=[o("span",{class:"text-sm font-mono text-retro-muted animate-pulse"},"Loading features...",-1)])])):P("",!0),!s(C)&&s(m).length>0&&s(W).length===0?(i(),d("div",Sh,[Y(s(Zn),{class:"h-10 w-10 text-retro-subtle mb-3"}),k[2]||(k[2]=o("p",{class:"text-sm font-mono text-retro-muted"},"No matching features",-1)),k[3]||(k[3]=o("p",{class:"mt-1 text-xs font-mono text-retro-subtle"}," Try a different search term ",-1))])):P("",!0),!s(C)&&s(m).length===0?(i(),d("div",_h,[Y(s(na),{class:"h-10 w-10 text-retro-subtle mb-3"}),k[4]||(k[4]=o("p",{class:"text-sm font-mono text-retro-muted"},"No features found",-1)),k[5]||(k[5]=o("p",{class:"mt-1 text-xs font-mono text-retro-subtle"}," Create a feature in specs/ to get started ",-1))])):P("",!0)]),s(x)&&s(v)?(i(),ie(se,{key:0,feature:s(v),onClose:z},null,8,["feature"])):P("",!0),Y(Zo,{show:s(g),creating:s(B),onClose:I,onCreate:L},null,8,["show","creating"])])}}}),Th={class:"flex items-start justify-between gap-2"},Ah={class:"flex-1 min-w-0"},Bh={key:1,class:"flex items-center gap-2"},Rh={key:0,class:"flex-shrink-0 relative"},Eh={class:"text-sm font-mono text-retro-text truncate"},Ph={key:2,class:"text-xs font-mono text-retro-green bg-retro-green/10 px-1.5 py-0.5 rounded flex-shrink-0"},Dh={key:3,class:"text-xs font-mono text-retro-red bg-retro-red/10 px-1.5 py-0.5 rounded flex-shrink-0"},Lh={key:5,class:"text-xs font-mono text-retro-yellow bg-retro-yellow/10 px-1.5 py-0.5 rounded flex-shrink-0"},Ih={key:6,class:"text-xs font-mono text-retro-cyan bg-retro-cyan/10 px-1.5 py-0.5 rounded flex-shrink-0"},Nh=["title"],Fh={class:"text-xs text-retro-muted mt-1 truncate pl-6"},Hh={class:"text-xs text-retro-muted/60 mt-1 pl-6"},Oh={class:"truncate"},Uh={class:"truncate"},jh={class:"truncate"},zh=Ce({__name:"ConversationItem",props:{conversation:{},isActive:{type:Boolean},isStreaming:{type:Boolean},isPreviewing:{type:Boolean},autoModeTask:{}},emits:["select","archive","rename"],setup(e,{emit:n}){const t=e,a=n,r=S(!1),l=S("");function c(){l.value=t.conversation.title,r.value=!0}function f(){const v=l.value.trim();v&&v!==t.conversation.title&&a("rename",v),r.value=!1}function h(){r.value=!1}const m=Dn();async function y(v){try{await navigator.clipboard.writeText(v),m.success("Copied to clipboard",1500)}catch{m.error("Failed to copy")}}const C=H(()=>{const v=t.conversation.messages;if(!v.length)return"No messages";const g=v[v.length-1],B=g.content.slice(0,60);return B.length<g.content.length?B+"...":B}),x=H(()=>{const v=new Date(t.conversation.updatedAt),B=new Date().getTime()-v.getTime(),V=Math.floor(B/(1e3*60*60*24));return V===0?v.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):V===1?"Yesterday":V<7?`${V} days ago`:v.toLocaleDateString()});return(v,g)=>(i(),d("div",{class:ve(["p-3 rounded border cursor-pointer transition-colors",[e.isPreviewing?"border-retro-red/40 bg-retro-red/10":e.isActive?"border-retro-cyan bg-retro-cyan/10":"border-retro-border hover:border-retro-cyan/50"]]),onClick:g[8]||(g[8]=B=>a("select"))},[o("div",Th,[o("div",Ah,[r.value?(i(),d("div",{key:0,class:"flex gap-2",onClick:g[1]||(g[1]=lt(()=>{},["stop"]))},[Me(o("input",{"onUpdate:modelValue":g[0]||(g[0]=B=>l.value=B),onKeyup:[ln(f,["enter"]),ln(h,["escape"])],onBlur:f,class:"flex-1 px-2 py-1 text-sm font-mono bg-retro-black border border-retro-cyan rounded text-retro-text focus:outline-none focus:ring-1 focus:ring-retro-cyan",autofocus:""},null,544),[[ut,l.value]])])):(i(),d("div",Bh,[e.isStreaming?(i(),d("div",Rh,[...g[9]||(g[9]=[o("div",{class:"w-4 h-4 rounded-full bg-retro-cyan/30 animate-pulse"},null,-1),o("div",{class:"absolute inset-0 flex items-center justify-center"},[o("div",{class:"w-2 h-2 rounded-full bg-retro-cyan animate-ping"})],-1)])])):(i(),ie(s(Yr),{key:1,class:"w-4 h-4 text-retro-muted flex-shrink-0 -translate-y-px"})),o("h3",Eh,T(e.conversation.title),1),e.conversation.finalized?(i(),d("span",Ph," finalized ")):e.isPreviewing?(i(),d("span",Dh," previewing ")):P("",!0),e.conversation.autoMode&&e.autoModeTask?(i(),d("span",{key:4,class:ve(["text-xs font-mono px-1.5 py-0.5 rounded flex-shrink-0",{"text-retro-yellow bg-retro-yellow/10":e.autoModeTask.state==="running"||e.autoModeTask.state==="queued","text-retro-green bg-retro-green/10":e.autoModeTask.state==="completed","text-retro-red bg-retro-red/10":e.autoModeTask.state==="failed","text-retro-muted bg-retro-muted/10":e.autoModeTask.state==="skipped"}])},[e.autoModeTask.state==="running"&&e.autoModeTask.currentStep?(i(),d(he,{key:0},[ke(T(e.autoModeTask.currentStep),1)],64)):e.autoModeTask.state==="queued"?(i(),d(he,{key:1},[ke("queued")],64)):e.autoModeTask.state==="completed"?(i(),d(he,{key:2},[ke("done")],64)):e.autoModeTask.state==="failed"?(i(),d(he,{key:3},[ke("failed")],64)):e.autoModeTask.state==="skipped"?(i(),d(he,{key:4},[ke("skipped")],64)):(i(),d(he,{key:5},[ke("auto")],64))],2)):e.conversation.autoMode?(i(),d("span",Lh," auto ")):P("",!0),e.isStreaming?(i(),d("span",Ih," streaming ")):P("",!0)])),e.autoModeTask?.state==="failed"&&e.autoModeTask.error?(i(),d("p",{key:2,class:"text-xs text-retro-red mt-1 truncate pl-6",title:e.autoModeTask.error},T(e.autoModeTask.error),9,Nh)):P("",!0),o("p",Fh,T(C.value),1),o("p",Hh,T(x.value),1),e.conversation.worktreeBranch||e.conversation.baseBranch?(i(),d("div",{key:3,class:"mt-1.5 pl-6 flex flex-wrap gap-1",onClick:g[5]||(g[5]=lt(()=>{},["stop"]))},[e.conversation.baseBranch?(i(),d("button",{key:0,onClick:g[2]||(g[2]=B=>y(e.conversation.baseBranch)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-cyan/30 text-retro-cyan hover:border-retro-cyan hover:bg-retro-cyan/10 transition-colors max-w-full",title:"Click to copy base branch"},[Y(s(Ho),{class:"w-3 h-3 flex-shrink-0"}),o("span",Oh,"base: "+T(e.conversation.baseBranch),1)])):P("",!0),o("button",{onClick:g[3]||(g[3]=B=>y(e.conversation.worktreeBranch)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-green/30 text-retro-green hover:border-retro-green hover:bg-retro-green/10 transition-colors max-w-full",title:"Click to copy branch"},[Y(s(Ho),{class:"w-3 h-3 flex-shrink-0"}),o("span",Uh,T(e.conversation.worktreeBranch),1)]),e.conversation.worktreePath?(i(),d("button",{key:1,onClick:g[4]||(g[4]=B=>y(e.conversation.worktreePath)),class:"inline-flex items-center gap-1 px-1.5 py-0.5 text-xs font-mono rounded border border-retro-muted/30 text-retro-muted hover:border-retro-muted hover:bg-retro-muted/10 transition-colors max-w-full",title:"Click to copy path"},[Y(s(Oo),{class:"w-3 h-3 flex-shrink-0"}),o("span",jh,T(e.conversation.worktreePath),1)])):P("",!0)])):P("",!0)]),o("div",{class:"flex gap-1 flex-shrink-0",onClick:g[7]||(g[7]=lt(()=>{},["stop"]))},[o("button",{onClick:c,class:"p-1 hover:bg-retro-panel rounded transition-colors",title:"Rename conversation"},[Y(s(os),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})]),o("button",{onClick:g[6]||(g[6]=B=>a("archive")),class:"p-1 hover:bg-retro-cyan/20 rounded transition-colors",title:"Archive conversation"},[Y(s(Fo),{class:"w-4 h-4 text-retro-muted hover:text-retro-cyan"})])])])],2))}}),Vh={class:"h-full flex flex-col bg-retro-black"},Wh={class:"flex-shrink-0 px-3 py-2 border-b border-retro-border space-y-2"},Gh={class:"flex items-center justify-between gap-2"},qh={class:"flex items-center gap-1"},Zh={class:"inline-flex items-center gap-1"},Kh={class:"inline-flex items-center gap-1"},Yh={class:"relative"},Xh=["placeholder"],Qh={key:0,class:"flex-shrink-0 flex items-center gap-2 px-3 py-2 bg-retro-yellow/10 border-b border-retro-yellow/30 text-xs"},Jh={class:"text-retro-yellow font-mono"},ep={class:"flex-1 overflow-y-auto p-2"},tp={key:0,class:"space-y-1"},np={key:1,class:"text-center py-6 text-retro-muted"},op={class:"font-mono text-xs"},rp={key:1,class:"text-center py-8 text-retro-muted"},sp={key:0,class:"space-y-2"},ap={class:"flex items-start justify-between gap-2"},ip={class:"min-w-0"},lp={class:"text-sm font-mono text-retro-text truncate"},cp={class:"text-xs text-retro-muted mt-1 truncate"},up={class:"text-xs text-retro-muted/70 mt-1"},dp={class:"text-xs text-retro-muted/70"},fp={class:"flex items-center gap-1 flex-shrink-0"},mp=["onClick"],hp=["onClick"],pp={key:1,class:"text-center py-6 text-retro-muted"},vp={class:"font-mono text-xs"},gp={key:1,class:"text-center py-8 text-retro-muted"},xp=Ce({__name:"ConversationsPanel",setup(e){const n=mt(),t=Cs(),a=Dn(),r=H(()=>{const O=new Map;for(const I of t.tasks)O.set(I.featureId,I);return O}),l=H(()=>{const O=new Map;for(const I of t.tasks)O.set(I.featureId,`${I.state}|${I.currentStep||""}|${I.error||""}`);return O});function c(O){if(O)return r.value.get(O)}function f(O){return O&&l.value.get(O)||""}const h=S(""),m=S(""),y=S(!1),C=S(!1),x=S(!1),v=S(!1),g=S(null);let B=null;Ae(h,O=>{B&&clearTimeout(B),B=setTimeout(()=>{m.value=O},180)},{immediate:!0}),_t(()=>{B&&(clearTimeout(B),B=null)});const V=new Map,E=new Map;Ae(()=>n.sortedConversations.map(O=>O.id),O=>{const I=new Set(O);for(const L of V.keys())I.has(L)||V.delete(L)},{immediate:!0}),Ae(()=>n.sortedArchivedConversations.map(O=>O.id),O=>{const I=new Set(O);for(const L of E.keys())I.has(L)||E.delete(L)},{immediate:!0});function fe(O){const I=O.messages[O.messages.length-1];return[O.updatedAt,O.title,O.messages.length,I?.id||"",I?.content?.length||0].join("|")}function ce(O){const I=O.messages[O.messages.length-1];return[O.updatedAt,O.archivedAt,O.title,O.messages.length,I?.id||"",I?.content?.length||0].join("|")}function W(O){const I=fe(O),L=V.get(O.id);if(L&&L.signature===I)return L.text;const K=[O.title,...O.messages.map(k=>k.content||"")].join(`
101
+ `).toLowerCase();return V.set(O.id,{signature:I,text:K}),K}function ue(O){const I=ce(O),L=E.get(O.id);if(L&&L.signature===I)return L.text;const K=[O.title,...O.messages.map(k=>k.content||"")].join(`
102
+ `).toLowerCase();return E.set(O.id,{signature:I,text:K}),K}const de=H(()=>n.conversationViewMode==="archive"),le=H(()=>{const O=n.sortedConversations;if(!m.value.trim())return O;const I=m.value.toLowerCase().trim();return O.filter(L=>W(L).includes(I))}),re=H(()=>{const O=n.sortedArchivedConversations;if(!m.value.trim())return O;const I=m.value.toLowerCase().trim();return O.filter(L=>ue(L).includes(I))}),Z=H(()=>n.previewingConversationId);async function z(){if(n.checkStorageLimits().atLimit){a.error("Delete or archive a conversation first (limit: 100).");return}y.value=!0}async function N(O){C.value=!0;try{if(!await n.createConversation({baseBranch:O})){a.error("Failed to create conversation");return}y.value=!1}catch(I){a.error(I instanceof Error?I.message:"Failed to create conversation")}finally{C.value=!1}}function p(O){n.selectConversation(O),n.setConversationViewMode("active")}async function u(O){const I=await n.archiveConversation(O);if(!I.success){a.error(I.error||"Failed to archive conversation");return}a.success("Conversation archived")}async function b(O){g.value=O,x.value=!0}function j(){x.value=!1,g.value=null}async function G(O){if(g.value){v.value=!0;try{const I=await n.restoreArchivedConversation(g.value,O);if(!I.success){a.error(I.error||"Failed to restore archived conversation");return}a.success("Archived conversation restored"),x.value=!1,g.value=null}finally{v.value=!1}}}async function Q(O){const I=await n.deleteArchivedConversation(O);if(!I.success){a.error(I.error||"Failed to delete archived conversation");return}a.success("Archived conversation deleted")}function J(O,I){n.renameConversation(O,I)}function ee(O){return new Date(O).toLocaleString()}function te(O){if(!O.length)return"No messages";const L=(O[O.length-1].content||"").trim();return L?L.length>80?`${L.slice(0,80)}...`:L:"No messages"}return(O,I)=>(i(),d("div",Vh,[o("div",Wh,[o("div",Gh,[o("button",{onClick:z,class:"flex items-center gap-1 px-2 py-1 text-xs font-mono bg-retro-cyan/10 text-retro-cyan border border-retro-cyan/30 rounded hover:bg-retro-cyan/20 transition-colors"},[Y(s(vo),{class:"w-3.5 h-3.5"}),I[8]||(I[8]=ke(" New ",-1))]),o("div",qh,[o("button",{onClick:I[0]||(I[0]=L=>s(n).setConversationViewMode("active")),class:ve(["px-2 py-1 text-xs font-mono rounded border transition-colors",de.value?"border-retro-border text-retro-muted hover:text-retro-cyan":"border-retro-cyan text-retro-cyan bg-retro-cyan/10"]),title:"Active conversations"},[o("span",Zh,[Y(s(Zs),{class:"w-3.5 h-3.5"}),I[9]||(I[9]=ke(" Active ",-1))])],2),o("button",{onClick:I[1]||(I[1]=L=>s(n).setConversationViewMode("archive")),class:ve(["px-2 py-1 text-xs font-mono rounded border transition-colors",de.value?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-cyan"]),title:"Archived conversations"},[o("span",Kh,[Y(s(Fo),{class:"w-3.5 h-3.5"}),I[10]||(I[10]=ke(" Archive ",-1))])],2)])]),o("div",Yh,[Y(s(Zn),{class:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted"}),Me(o("input",{"onUpdate:modelValue":I[2]||(I[2]=L=>h.value=L),type:"text",placeholder:de.value?"Search archive...":"Search conversations...",class:"w-full pl-8 pr-3 py-1.5 text-xs font-mono bg-retro-black border border-retro-border rounded focus:border-retro-cyan focus:outline-none focus:ring-1 focus:ring-retro-cyan text-retro-text placeholder-retro-muted"},null,8,Xh),[[ut,h.value]])])]),s(n).isNearStorageLimit?(i(),d("div",Qh,[Y(s(Cn),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),o("p",Jh,T(s(n).conversationCount)+" active conversations. Limit is 100. ",1)])):P("",!0),o("div",ep,[de.value?(i(),d(he,{key:1},[s(n).hasArchivedConversations?(i(),d("div",sp,[re.value.length>0?(i(!0),d(he,{key:0},Be(re.value,(L,K,k,F)=>{const q=[L.id,L.title,L.updatedAt,L.archivedAt,L.messages.length];if(F&&F.key===L.id&&Io(F,q))return F;const se=(i(),d("div",{key:L.id,onClick:ne=>b(L.id),onKeydown:[ln(lt(ne=>b(L.id),["prevent"]),["enter"]),ln(lt(ne=>b(L.id),["prevent"]),["space"])],class:"w-full text-left p-3 rounded border border-retro-border hover:border-retro-cyan/50 hover:bg-retro-cyan/5 transition-colors",role:"button",tabindex:"0"},[o("div",ap,[o("div",ip,[o("h3",lp,T(L.title),1),o("p",cp,T(te(L.messages)),1),o("p",up," Archived: "+T(ee(L.archivedAt)),1),o("p",dp," Updated: "+T(ee(L.updatedAt)),1)]),o("div",fp,[o("button",{onClick:lt(ne=>b(L.id),["stop"]),class:"inline-flex items-center gap-1 px-2 py-1 text-xs font-mono border border-retro-cyan/40 text-retro-cyan rounded hover:bg-retro-cyan/10 transition-colors",title:"Restore archived conversation"},[Y(s(Fo),{class:"w-3.5 h-3.5"}),I[12]||(I[12]=ke(" Restore ",-1))],8,mp),o("button",{onClick:lt(ne=>Q(L.id),["stop"]),class:"inline-flex items-center gap-1 px-2 py-1 text-xs font-mono border border-red-400/40 text-red-300 rounded hover:bg-red-500/10 transition-colors",title:"Delete archived conversation"},[Y(s(un),{class:"w-3.5 h-3.5"}),I[13]||(I[13]=ke(" Delete ",-1))],8,hp)])])],40,["onClick","onKeydown"]));return se.memo=q,se},I,5),128)):(i(),d("div",pp,[o("p",vp,'No archived results for "'+T(h.value)+'"',1)]))])):(i(),d("div",gp,[...I[14]||(I[14]=[o("p",{class:"font-mono text-sm"},"No archived conversations",-1),o("p",{class:"text-xs mt-1"},"Archived conversations will appear here",-1)])]))],64)):(i(),d(he,{key:0},[s(n).hasConversations?(i(),d("div",tp,[le.value.length>0?(i(!0),d(he,{key:0},Be(le.value,(L,K,k,F)=>{const q=[L.id,L.title,L.updatedAt,L.messages.length,L.finalized,L.id===s(n).activeConversationId,s(n).isConversationStreaming(L.id),Z.value===L.id,f(L.featureId)];if(F&&F.key===L.id&&Io(F,q))return F;const se=(i(),d("div",{key:L.id},[Y(zh,{conversation:L,"is-active":L.id===s(n).activeConversationId,"is-streaming":s(n).isConversationStreaming(L.id),"is-previewing":Z.value===L.id,"auto-mode-task":L.autoMode?c(L.featureId):void 0,onSelect:ne=>p(L.id),onArchive:ne=>u(L.id),onRename:ne=>J(L.id,ne)},null,8,["conversation","is-active","is-streaming","is-previewing","auto-mode-task","onSelect","onArchive","onRename"])]));return se.memo=q,se},I,3),128)):(i(),d("div",np,[o("p",op,'No results for "'+T(h.value)+'"',1)]))])):(i(),d("div",rp,[...I[11]||(I[11]=[o("p",{class:"font-mono text-sm"},"No conversations",-1),o("p",{class:"text-xs mt-1"},'Click "New" to start',-1)])]))],64))]),Y(Zo,{show:y.value,creating:C.value,onClose:I[7]||(I[7]=L=>y.value=!1),onCreate:N},null,8,["show","creating"]),Y(Zo,{show:x.value,creating:v.value,onClose:j,onCreate:G},null,8,["show","creating"])]))}}),bp={mobile:768,tablet:1024};function yp(e,n){return e<n.mobile?"mobile":e<n.tablet?"tablet":"desktop"}const Ss=po("layout",{state:()=>({currentViewport:"desktop",chatFullscreen:!1}),getters:{isMobile:e=>e.currentViewport==="mobile",isTablet:e=>e.currentViewport==="tablet",isDesktop:e=>e.currentViewport==="desktop",isChatFullscreen:e=>e.chatFullscreen},actions:{updateViewport(e){this.currentViewport=yp(e,bp)},toggleChatFullscreen(){this.chatFullscreen=!this.chatFullscreen},setChatFullscreen(e){this.chatFullscreen=e}}});function kp(){const e=S(null),n=S(!0),t=50;function a(){const y=e.value;return y?y.scrollHeight-y.scrollTop-y.clientHeight<t:!0}function r(){n.value=a()}function l(y="smooth"){cn(()=>{const C=e.value;C&&C.scrollTo({top:C.scrollHeight,behavior:y})})}function c(y="smooth"){l(y),n.value=!0}function f(y="smooth"){n.value&&l(y)}function h(){n.value=!0}function m(){n.value=!1}return{containerRef:e,shouldAutoScroll:ge(n),onScroll:r,scrollToBottom:l,forceScrollToBottom:c,maybeScrollToBottom:f,enableAutoScroll:h,disableAutoScroll:m}}function wp(e){const{allMessages:n,containerRef:t,initialSize:a=50,batchSize:r=30,topThreshold:l=100}=e,c=S(a),f=S(!1),h=H(()=>{const v=n.value;return v.length<=c.value?v:v.slice(v.length-c.value)}),m=H(()=>n.value.length>c.value);Ae(()=>n.value.length,(v,g)=>{g!==void 0&&v>g&&(c.value+=v-g)});function y(){c.value=a,f.value=!1}async function C(){const v=t.value;if(!v)return;f.value=!0;const g=v.scrollHeight,B=v.scrollTop,V=n.value.length;c.value=Math.min(c.value+r,V),await cn();const E=v.scrollHeight-g;v.scrollTop=B+E,f.value=!1}function x(){const v=t.value;v&&(f.value||m.value&&v.scrollTop<l&&C())}return{visibleMessages:h,hasOlderMessages:m,isLoadingMore:f,resetWindow:y,onScrollForLoadMore:x}}const Cp=["innerHTML"],$p=Ce({__name:"ChatTextBlock",props:{block:{}},setup(e){const n=e,{renderMarkdown:t}=$s(),a=H(()=>t(n.block.text));return(r,l)=>e.block.text.trim()?(i(),d("div",{key:0,class:"text-sm font-mono text-retro-text break-words chat-markdown",innerHTML:s(a)},null,8,Cp)):P("",!0)}}),Sp={class:"my-1 border border-retro-border/30 rounded bg-retro-dark/30"},_p={class:"ml-auto text-retro-muted/60 text-[10px]"},Mp={key:0,class:"px-3 pb-2 text-xs font-mono text-retro-muted whitespace-pre-wrap max-h-60 overflow-y-auto scrollbar-custom border-t border-retro-border/20"},Tp=Ce({__name:"ChatThinkingBlock",props:{block:{}},setup(e){const n=S(!1);return(t,a)=>(i(),d("div",Sp,[o("button",{class:"flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-yellow transition-colors",onClick:a[0]||(a[0]=r=>n.value=!s(n))},[Y(s(Qo),{class:ve(["w-3 h-3 transition-transform flex-shrink-0",{"rotate-90":s(n)}])},null,8,["class"]),a[1]||(a[1]=o("span",{class:"text-retro-yellow"},"Thinking",-1)),o("span",_p,T(e.block.thinking.length)+" chars ",1)]),s(n)?(i(),d("div",Mp,T(e.block.thinking),1)):P("",!0)]))}}),Ap={class:"my-2 border border-retro-border/30 rounded"},Bp={key:0,class:"w-3 h-3 border-2 border-retro-yellow border-t-transparent rounded-full animate-spin flex-shrink-0"},Rp={class:"text-retro-cyan font-bold"},Ep={class:"text-retro-muted truncate"},Pp={key:0,class:"px-3 pb-2 border-t border-retro-border/20"},Dp={class:"text-xs font-mono text-retro-muted space-y-2 mt-2"},Lp={key:0,class:"flex items-start gap-2"},Ip={class:"text-retro-cyan break-all"},Np={key:1,class:"flex items-start gap-2"},Fp={key:0,class:"mt-2"},Hp={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-52 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},Op={key:0,class:"text-[10px] text-retro-muted mt-1"},Up={key:1,class:"mt-2"},jp={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-40 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},zp={key:0,class:"text-[10px] text-retro-muted mt-1"},Vp={key:2,class:"mt-2"},Wp={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded overflow-x-auto max-h-40 overflow-y-auto scrollbar-custom whitespace-pre-wrap"},Gp={key:0,class:"text-[10px] text-retro-muted mt-1"},qp={class:"mt-2"},Zp={class:"text-xs font-mono text-retro-muted bg-retro-panel p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto scrollbar-custom"},Kp={key:1,class:"px-3 pb-2 border-t border-retro-border/20"},Yp={class:"whitespace-pre-wrap"},Xp={class:"whitespace-pre-wrap"},Qp=Ce({__name:"ChatToolBlock",props:{block:{},result:{}},setup(e){const n=e,t=S(!1),a=S(!1);function r(le,re){for(const Z of re){const z=le[Z];if(typeof z=="string"&&z.trim())return z}return""}function l(le,re){for(const Z of re){const z=le[Z];if(typeof z=="number"&&Number.isFinite(z))return z;if(typeof z=="string"&&z.trim()){const N=Number(z);if(Number.isFinite(N))return N}}return null}function c(le,re=14,Z=1400){if(!le)return{text:"",truncated:!1};const z=le.split(`
103
+ `);let N=z.slice(0,re).join(`
104
+ `),p=z.length>re;return N.length>Z&&(N=N.slice(0,Z),p=!0),{text:N,truncated:p}}const f=H(()=>n.block.name.toLowerCase()),h=H(()=>f.value==="read"),m=H(()=>f.value==="write"),y=H(()=>f.value==="edit"||f.value==="multiedit"),C=H(()=>r(n.block.input,["file_path","path","file","filepath","target_file"])),x=H(()=>{const le=l(n.block.input,["offset","start_line","line"]),re=l(n.block.input,["limit","lines","line_count"]),Z=l(n.block.input,["end_line"]);return le!==null&&re!==null?`from line ${le}, ${re} lines`:le!==null&&Z!==null?`lines ${le}-${Z}`:le!==null?`from line ${le}`:re!==null?`${re} lines`:""}),v=H(()=>r(n.block.input,["content","text","new_content"])),g=H(()=>r(n.block.input,["old_string","oldText","old"])),B=H(()=>r(n.block.input,["new_string","newText","new","replacement"])),V=H(()=>c(v.value)),E=H(()=>c(g.value,10,1e3)),fe=H(()=>c(B.value,10,1e3)),ce=H(()=>{if(h.value){if(C.value&&x.value)return`Read ${C.value} (${x.value})`;if(C.value)return`Read ${C.value}`}return m.value&&C.value?`Write ${C.value}`:y.value&&C.value?`Edit ${C.value}`:n.block.inputSummary}),W=H(()=>{switch(n.block.status){case"running":return"text-retro-yellow";case"pending":return"text-retro-muted";case"complete":return"text-retro-green";case"error":return"text-retro-red"}}),ue=H(()=>n.result?n.result.content.split(`
105
+ `).slice(0,3).join(`
106
+ `):""),de=H(()=>n.result?n.result.content.split(`
107
+ `).length>3||n.result.content.length>300:!1);return(le,re)=>(i(),d("div",Ap,[o("button",{class:"flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono hover:bg-retro-dark/30 transition-colors",onClick:re[0]||(re[0]=Z=>t.value=!s(t))},[e.block.status==="running"?(i(),d("span",Bp)):e.block.status==="pending"?(i(),ie(s(Xr),{key:1,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-muted animate-pulse"})):e.block.status==="complete"?(i(),ie(s(go),{key:2,class:ve(["w-3.5 h-3.5 flex-shrink-0",s(W)])},null,8,["class"])):(i(),ie(s(Ln),{key:3,class:ve(["w-3.5 h-3.5 flex-shrink-0",s(W)])},null,8,["class"])),o("span",Rp,T(e.block.name),1),o("span",Ep,T(s(ce)||e.block.inputSummary),1),Y(s(Qo),{class:ve(["w-3 h-3 ml-auto transition-transform text-retro-muted flex-shrink-0",{"rotate-90":s(t)}])},null,8,["class"])]),s(t)?(i(),d("div",Pp,[o("div",Dp,[s(C)?(i(),d("div",Lp,[re[3]||(re[3]=o("span",{class:"text-retro-muted/80 min-w-12"},"File",-1)),o("code",Ip,T(s(C)),1)])):P("",!0),s(h)&&s(x)?(i(),d("div",Np,[re[4]||(re[4]=o("span",{class:"text-retro-muted/80 min-w-12"},"Range",-1)),o("span",null,T(s(x)),1)])):P("",!0)]),s(m)&&s(V).text?(i(),d("div",Fp,[re[5]||(re[5]=o("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"New Content",-1)),o("pre",Hp,T(s(V).text),1),s(V).truncated?(i(),d("div",Op,"Truncated preview")):P("",!0)])):P("",!0),s(y)&&s(E).text?(i(),d("div",Up,[re[6]||(re[6]=o("div",{class:"text-[11px] font-mono text-retro-yellow mb-1"},"Before",-1)),o("pre",jp,T(s(E).text),1),s(E).truncated?(i(),d("div",zp,"Truncated preview")):P("",!0)])):P("",!0),s(y)&&s(fe).text?(i(),d("div",Vp,[re[7]||(re[7]=o("div",{class:"text-[11px] font-mono text-retro-green mb-1"},"After",-1)),o("pre",Wp,T(s(fe).text),1),s(fe).truncated?(i(),d("div",Gp,"Truncated preview")):P("",!0)])):P("",!0),o("details",qp,[re[8]||(re[8]=o("summary",{class:"text-[11px] font-mono text-retro-muted cursor-pointer hover:text-retro-cyan"},"Raw input JSON",-1)),o("pre",Zp,T(JSON.stringify(e.block.input,null,2)),1)])])):P("",!0),e.result?(i(),d("div",Kp,[o("div",{class:ve(["text-xs font-mono rounded p-2 mt-1 overflow-y-auto scrollbar-custom",e.result.isError?"text-retro-red bg-retro-red/5":"text-retro-muted bg-retro-panel/50"]),style:Nt(s(a)?"max-height: 20rem":"")},[!s(a)&&s(de)?(i(),d(he,{key:0},[o("pre",Yp,T(s(ue)),1),o("button",{class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:re[1]||(re[1]=lt(Z=>a.value=!0,["stop"]))}," Show full ("+T(e.result.content.length)+" chars) ",1)],64)):(i(),d(he,{key:1},[o("pre",Xp,T(e.result.content),1),s(de)?(i(),d("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:re[2]||(re[2]=lt(Z=>a.value=!1,["stop"]))}," Collapse ")):P("",!0)],64))],6)])):P("",!0)]))}}),Jp={class:"mt-2 pt-2 border-t border-retro-border/20 flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] font-mono text-retro-muted"},ev={class:"flex items-center gap-1"},tv={class:"flex items-center gap-1"},nv=Ce({__name:"ChatResultSummary",props:{block:{}},setup(e){const n=e,t=H(()=>{const l=Math.round(n.block.durationMs/1e3);return l<60?`${l}s`:`${Math.floor(l/60)}m ${l%60}s`}),a=H(()=>`$${n.block.totalCostUsd.toFixed(4)}`),r=H(()=>{const{inputTokens:l,outputTokens:c}=n.block.usage;return`${l.toLocaleString()} in / ${c.toLocaleString()} out`});return(l,c)=>(i(),d("div",Jp,[o("span",ev,[c[0]||(c[0]=o("span",{class:"text-retro-muted/60"},"time",-1)),ke(" "+T(s(t)),1)]),o("span",tv,[c[1]||(c[1]=o("span",{class:"text-retro-muted/60"},"cost",-1)),ke(" "+T(s(a)),1)]),o("span",null,T(s(r)),1),o("span",null,T(e.block.numTurns)+" turn"+T(e.block.numTurns!==1?"s":""),1)]))}}),ov={class:"px-2 py-1 text-[10px] font-mono text-retro-muted border-b border-retro-border/20 mb-1 flex items-center gap-2"},rv={class:"text-retro-cyan"},sv={key:0,class:"text-retro-border"},av={key:1},iv=Ce({__name:"ChatSessionInit",props:{block:{}},setup(e){return(n,t)=>(i(),d("div",ov,[o("span",rv,T(e.block.model),1),t[0]||(t[0]=o("span",{class:"text-retro-border"},"|",-1)),o("span",null,T(e.block.tools.length)+" tools",1),e.block.permissionMode?(i(),d("span",sv,"|")):P("",!0),e.block.permissionMode?(i(),d("span",av,T(e.block.permissionMode),1)):P("",!0)]))}}),lv=Ce({__name:"ChatContentBlock",props:{block:{},allBlocks:{}},setup(e){const n=e,t=H(()=>{if(n.block.type!=="tool_use")return;const a=n.block.toolUseId;return n.allBlocks.find(r=>r.type==="tool_result"&&r.toolUseId===a)});return(a,r)=>{const l=$p,c=Tp,f=Qp,h=nv,m=iv;return e.block.type==="text"?(i(),ie(l,{key:0,block:e.block},null,8,["block"])):e.block.type==="thinking"?(i(),ie(c,{key:1,block:e.block},null,8,["block"])):e.block.type==="tool_use"?(i(),ie(f,{key:2,block:e.block,result:s(t)},null,8,["block","result"])):e.block.type==="result_summary"?(i(),ie(h,{key:3,block:e.block},null,8,["block"])):e.block.type==="session_init"?(i(),ie(m,{key:4,block:e.block},null,8,["block"])):P("",!0)}}}),cv={class:"flex-1 min-w-0"},uv={class:"flex items-center gap-2 mb-1"},dv={class:"text-xs font-mono text-retro-muted"},fv={key:0,class:"text-xs font-mono text-retro-yellow animate-pulse"},mv={key:1,class:"text-xs font-mono text-retro-muted"},hv={key:2,class:"text-xs font-mono text-retro-red"},pv=["innerHTML"],vv={key:2,class:"text-xs font-mono text-retro-muted italic"},gv={key:3,class:"inline-block w-2 h-4 bg-retro-cyan animate-pulse ml-0.5"},xv=Ce({__name:"ChatMessage",props:{message:{}},setup(e){const n=e,t=H(()=>n.message.role==="user"),a=H(()=>n.message.status==="streaming"),r=H(()=>n.message.status==="error"),l=H(()=>n.message.status==="stopped"),c=H(()=>Fs(n.message)),f=H(()=>n.message.contentBlocks?n.message.contentBlocks.filter(x=>x.type!=="tool_result"):[]),h=H(()=>c.value&&f.value.length>0),m=H(()=>n.message.content.trim().length>0),y=x=>new Date(x).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),C=H(()=>{let x=n.message.content;return x=x.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),x=x.replace(/```(\w*)\n?([\s\S]*?)```/g,'<pre class="bg-retro-panel p-3 rounded my-2 overflow-x-auto"><code class="text-retro-cyan">$2</code></pre>'),x=x.replace(/`([^`]+)`/g,'<code class="bg-retro-panel px-1 rounded text-retro-cyan">$1</code>'),x=x.replace(/\*\*([^*]+)\*\*/g,'<strong class="text-retro-text font-bold">$1</strong>'),x=x.replace(/\n/g,"<br>"),x});return(x,v)=>{const g=lv;return i(),d("div",{class:ve(["flex gap-3 p-3",[s(t)?"bg-retro-dark/50":"bg-transparent",s(r)?"border-l-2 border-retro-red":""]])},[o("div",{class:ve(["flex-shrink-0 w-6 h-6 rounded flex items-center justify-center",s(t)?"bg-retro-cyan/20":"bg-retro-green/20"])},[s(t)?(i(),ie(s(Uo),{key:0,class:"w-4 h-4 text-retro-cyan"})):(i(),ie(s(es),{key:1,class:"w-4 h-4 text-retro-green"}))],2),o("div",cv,[o("div",uv,[o("span",{class:ve(["text-xs font-mono",s(t)?"text-retro-cyan":"text-retro-green"])},T(s(t)?"You":"Assistant"),3),o("span",dv,T(y(e.message.timestamp)),1),s(a)?(i(),d("span",fv," typing... ")):P("",!0),s(l)?(i(),d("span",mv," (stopped) ")):P("",!0),s(r)?(i(),d("span",hv," (error) ")):P("",!0)]),s(h)?(i(!0),d(he,{key:0},Be(s(f),B=>(i(),ie(g,{key:B.id,block:B,"all-blocks":e.message.contentBlocks},null,8,["block","all-blocks"]))),128)):s(m)?(i(),d("div",{key:1,class:"text-sm font-mono text-retro-text break-words",innerHTML:s(C)},null,8,pv)):!s(t)&&!s(a)?(i(),d("div",vv," (no visible response content) ")):P("",!0),s(a)?(i(),d("span",gv)):P("",!0)])],2)}}}),bv={key:0,class:"flex flex-col items-center justify-center h-full p-8 text-center"},yv={key:1,class:"divide-y divide-retro-border/30"},kv={key:0,class:"flex justify-center py-3"},wv={key:1,class:"flex justify-center py-2"},Cv={class:"sticky bottom-0"},$v={key:0,class:"px-4 py-2 bg-retro-dark/90 border-t border-retro-border/50 backdrop-blur-sm"},Sv={key:1,class:"px-4 py-2.5 bg-retro-red/20 border-t border-retro-red/50"},_v={class:"flex items-start gap-2"},Mv={class:"flex-1 min-w-0"},Tv={class:"flex items-center justify-between gap-2 mb-0.5"},Av={class:"text-xs font-mono text-retro-red/80 break-words whitespace-pre-wrap"},Bv={key:2,class:"px-4 py-2 bg-retro-dark/90 border-t border-retro-border/50"},Rv=Ce({__name:"ChatMessages",setup(e){const n=mt(),{containerRef:t,onScroll:a,maybeScrollToBottom:r,scrollToBottom:l}=kp(),{visibleMessages:c,hasOlderMessages:f,isLoadingMore:h,resetWindow:m,onScrollForLoadMore:y}=wp({allMessages:H(()=>n.messages),containerRef:t});function C(){a(),y()}let x=!0;const v=H(()=>n.isActiveConversationStreaming),g=H(()=>{const B=n.lastMessage;return!B||B.role!=="assistant"?null:B.status});return st(()=>{x=!0,l("instant")}),Ae(()=>n.activeConversationId,()=>{m(),x=!0,l("instant")}),Ae(()=>n.messages.length,()=>{if(x){x=!1,l("instant");return}r()}),Ae(()=>n.lastMessage?.content,()=>{r()}),Ae([v,()=>n.lastError],()=>{r()}),(B,V)=>(i(),d("div",{ref_key:"containerRef",ref:t,class:"flex-1 overflow-y-auto",onScroll:C},[s(n).hasMessages?(i(),d("div",yv,[s(h)?(i(),d("div",kv,[...V[4]||(V[4]=[gr('<div class="flex items-center gap-2"><div class="flex gap-1"><span class="w-1.5 h-1.5 rounded-full bg-retro-muted animate-bounce" style="animation-delay:0ms;"></span><span class="w-1.5 h-1.5 rounded-full bg-retro-muted animate-bounce" style="animation-delay:150ms;"></span><span class="w-1.5 h-1.5 rounded-full bg-retro-muted animate-bounce" style="animation-delay:300ms;"></span></div><span class="text-xs font-mono text-retro-muted">Loading older messages...</span></div>',1)])])):s(f)?(i(),d("div",wv,[...V[5]||(V[5]=[o("span",{class:"text-xs font-mono text-retro-muted/60"},"Scroll up for older messages",-1)])])):P("",!0),(i(!0),d(he,null,Be(s(c),(E,fe,ce,W)=>{const ue=[E.id,E.status,E.content,E.contentBlocks?.length||0,E.tools?.length||0];if(W&&W.key===E.id&&Io(W,ue))return W;const de=(i(),ie(xv,{key:E.id,message:E},null,8,["message"]));return de.memo=ue,de},V,0),128))])):(i(),d("div",bv,[...V[3]||(V[3]=[o("div",{class:"text-retro-muted text-sm font-mono mb-2"}," No messages yet ",-1),o("div",{class:"text-retro-muted text-xs font-mono"}," Send a message to start chatting ",-1)])])),o("div",Cv,[s(v)&&!s(n).lastError?(i(),d("div",$v,[...V[6]||(V[6]=[gr('<div class="flex items-center gap-2"><div class="flex gap-1"><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:0ms;"></span><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:150ms;"></span><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:300ms;"></span></div><span class="text-xs font-mono text-retro-muted">Processing...</span></div>',1)])])):P("",!0),s(n).lastError?(i(),d("div",Sv,[o("div",_v,[Y(s(Ln),{class:"w-4 h-4 text-retro-red flex-shrink-0 mt-0.5"}),o("div",Mv,[o("div",Tv,[V[7]||(V[7]=o("p",{class:"text-xs font-mono font-semibold text-retro-red"},"Error",-1)),o("button",{class:"text-xs font-mono text-retro-red/60 hover:text-retro-red underline",onClick:V[2]||(V[2]=E=>s(n).clearError())}," Dismiss ")]),o("p",Av,T(s(n).lastError),1),V[8]||(V[8]=o("p",{class:"text-xs font-mono text-retro-muted mt-1"}," Check browser console (F12) for more details ",-1))])])])):s(g)==="stopped"?(i(),d("div",Bv,[...V[9]||(V[9]=[o("div",{class:"flex items-center gap-2"},[o("span",{class:"w-2 h-2 rounded-full bg-retro-muted"}),o("span",{class:"text-xs font-mono text-retro-muted"},"Stopped")],-1)])])):P("",!0)])],544))}});function Ev(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"fill-rule":"evenodd",d:"M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z","clip-rule":"evenodd"})])}function Pv(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"fill-rule":"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z","clip-rule":"evenodd"})])}function Dv(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{d:"M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"})])}function Lv(e,n){return i(),d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[o("path",{"fill-rule":"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z","clip-rule":"evenodd"})])}const Iv={class:"flex-shrink-0 border-t border-retro-border bg-retro-dark p-3"},Nv={class:"flex items-center gap-2 mb-2"},Fv={class:"relative mode-selector"},Hv={key:0,class:"absolute bottom-full left-0 mb-1 py-1 bg-retro-dark border border-retro-border rounded shadow-lg z-10 min-w-[140px]"},Ov=["onClick"],Uv={class:"text-xs font-mono text-retro-muted"},jv={key:0,class:"mb-3 p-3 bg-retro-yellow/10 border border-retro-yellow/50 rounded"},zv={class:"flex items-center justify-between gap-3"},Vv={class:"flex-1 min-w-0"},Wv={class:"text-xs font-mono text-retro-text truncate"},Gv={class:"text-retro-cyan"},qv={key:0,class:"text-retro-muted"},Zv={key:1,class:"text-retro-muted"},Kv={key:1,class:"mb-3 p-3 bg-retro-cyan/10 border border-retro-cyan/50 rounded"},Yv={class:"flex gap-2 items-end"},Xv={class:"flex-1 relative"},Qv=["disabled","placeholder"],Jv=["disabled"],eg=Ce({__name:"ChatInput",props:{disabled:{type:Boolean}},setup(e){const n=e,t=mt(),{sendMessage:a,sendPermissionResponse:r,approvePlan:l,rejectPlan:c,abort:f,resetContext:h}=pr(),m=S(""),y=S(null),C=S(!1),x=S(!1),v={plan:er,ask:nr,auto:Yo,bypass:or},g={plan:"text-retro-cyan",ask:"text-retro-green",auto:"text-retro-yellow",bypass:"text-retro-red"};function B(k){t.setPermissionMode(k),x.value=!1}function V(k){k.target.closest(".mode-selector")||(x.value=!1)}st(()=>{document.addEventListener("click",V)}),_t(()=>{document.removeEventListener("click",V)});const E=H(()=>m.value.trim().length>0&&!t.isActiveConversationStreaming&&!C.value&&!t.pendingPermission&&!W.value),fe=H(()=>t.isActiveConversationStreaming&&!t.pendingPermission),ce=H(()=>t.pendingPermission!==null),W=H(()=>t.pendingPlanApproval!==null);function ue(){r(!0,t.activeConversationId)}function de(){r(!1,t.activeConversationId)}function le(){l(t.activeConversationId)}function re(){c(t.activeConversationId)}const Z=H(()=>{if(t.isActiveConversationStreaming||C.value)return!1;const k=t.lastMessage;return k?.role==="assistant"&&k?.status==="error"});function z(k){const F=k.instructionFiles.length>0?k.instructionFiles.map(se=>{const ne=se.source==="cwd"?"cwd":"ancestor",be=se.mtime?` (mtime: ${se.mtime})`:"";return`- \`${se.path}\` [${ne}] - ${se.hint}${be}`}):["- (none detected from current cwd ancestry)"],q=k.specContext.files.length>0?k.specContext.files.map(se=>`- \`${se}\``):["- (none)"];return["## Context Snapshot","",`- Time: ${k.generatedAt}`,`- Session state: **${k.sessionState}**`,`- Provider session ID: \`${k.providerSessionId??"(empty)"}\``,`- Provider: \`${k.providerId}\` / \`${k.providerModelKey}\``,`- Permission mode: \`${k.permissionMode}\``,`- CWD (requested): \`${k.requestedCwd}\``,`- CWD (effective): \`${k.effectiveCwd}\``,`- Feature: \`${k.featureId??"(none)"}\``,"","### Spec Context Injection",`- Active on next turn: **${k.specContext.active?"yes":"no"}**`,`- Reason: ${k.specContext.reason}`,...q,"","### Detected Instruction Files",...F].join(`
108
+ `)}function N(k){return(k.match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(q=>q.startsWith('"')&&q.endsWith('"')||q.startsWith("'")&&q.endsWith("'")?q.slice(1,-1):q)}function p(k){const F=k.match(/^\/(?:spec-search|specsearch)\b(.*)$/i);if(!F)return null;const q=N(F[1]?.trim()??""),se=[],ne={q:""};for(let be=0;be<q.length;be++){const De=q[be];if(De==="--mode"&&q[be+1]){const _e=q[++be];(_e==="keyword"||_e==="semantic"||_e==="hybrid")&&(ne.mode=_e);continue}if(De.startsWith("--mode=")){const _e=De.slice(7);(_e==="keyword"||_e==="semantic"||_e==="hybrid")&&(ne.mode=_e);continue}if(De==="--feature"&&q[be+1]){ne.featureId=q[++be];continue}if(De.startsWith("--feature=")){ne.featureId=De.slice(10);continue}if(De==="--file-type"&&q[be+1]){ne.fileType=q[++be];continue}if(De.startsWith("--file-type=")){ne.fileType=De.slice(12);continue}if(De==="--limit"&&q[be+1]){const _e=Number.parseInt(q[++be],10);Number.isFinite(_e)&&_e>0&&(ne.limit=_e);continue}if(De.startsWith("--limit=")){const _e=Number.parseInt(De.slice(8),10);Number.isFinite(_e)&&_e>0&&(ne.limit=_e);continue}se.push(De)}return ne.q=se.join(" ").trim(),ne}function u(k,F=260){const q=k.replace(/\s+/g," ").trim();return q.length<=F?q:`${q.slice(0,F)}...`}function b(k,F){const q=[];if(q.push("## Spec Search Results"),q.push(""),q.push(`- Query: \`${k.q}\``),q.push(`- Mode: \`${F.mode}\``),k.featureId&&q.push(`- Feature filter: \`${k.featureId}\``),k.fileType&&q.push(`- File type filter: \`${k.fileType}\``),q.push(`- Hits: **${F.totalCount}** (${F.searchTime}ms)`),F.warning&&q.push(`- Warning: ${F.warning}`),F.results.length===0)return q.push(""),q.push("No matching indexed chunks were found."),q.join(`
109
+ `);q.push("");for(const[se,ne]of F.results.entries()){const be=ne.chunk;q.push(`${se+1}. \`${be.sourcePath}:${be.lineStart}\` (${ne.matchType}, score: ${ne.score.toFixed(3)})`),be.headingHierarchy.length>0&&q.push(` Headings: ${be.headingHierarchy.join(" > ")}`),q.push(` ${u(be.content)}`)}return q.join(`
110
+ `)}async function j(k){const F=t.activeConversationId??await t.createConversation(),q=t.addAssistantMessage(F);if(!k.q){t.updateMessage(q.id,{content:["Usage: `/spec-search <query> [--mode keyword|semantic|hybrid] [--feature <feature-id>] [--file-type <type>] [--limit <n>]`","","Examples:","- `/spec-search FR-001`",'- `/spec-search "indexing indicator" --mode hybrid --feature 008-spec-search --limit 5`'].join(`
111
+ `),status:"complete"},F);return}const se=t.activeConversation,ne={q:k.q,mode:k.mode??"hybrid",featureId:k.featureId??se?.featureId,fileType:k.fileType,limit:String(k.limit??5)};try{const be=await $fetch("/api/specs/search",{query:ne});t.updateMessage(q.id,{content:b({...k,mode:ne.mode,featureId:ne.featureId},be),status:"complete"},F)}catch(be){const De=be instanceof Error?be.message:"Failed to run spec search";t.updateMessage(q.id,{content:`Spec search failed: ${De}`,status:"error"},F)}}async function G(){const k=t.activeConversation,F={permissionMode:t.permissionMode};k?.hasWorktree&&k.worktreePath?F.cwd=k.worktreePath:k?.cwd&&(F.cwd=k.cwd),k?.featureId&&(F.featureId=k.featureId),k?.providerId&&(F.providerId=k.providerId),k?.providerModelKey&&(F.providerModelKey=k.providerModelKey),k?.providerSessionId&&(F.providerSessionId=k.providerSessionId);const q=await $fetch("/api/chat/context",{query:F}),se=t.activeConversationId??await t.createConversation(),ne=t.addAssistantMessage(se);t.updateMessage(ne.id,{content:z(q),status:"complete"},se)}async function Q(){const k=m.value.trim();if(!k||t.isActiveConversationStreaming||C.value||n.disabled)return;if(k==="/reset"||k==="/reset-context"){await ee();return}if(k==="/context"||k==="/ctx"){await G(),m.value="",L();return}const F=p(k);if(F){await j(F),m.value="",L();return}C.value=!0,m.value="",L();try{await t.addUserMessageWithConversation(k);const q=t.activeConversationId,se=t.addAssistantMessage();t.startSession(`session-${Date.now()}`),t.startConversationStreaming(q);const ne=t.activeConversation,be={};ne?.hasWorktree&&ne.worktreePath&&(be.cwd=ne.worktreePath,be.worktreeBranch=ne.worktreeBranch),ne?.featureId&&(be.featureId=ne.featureId),await a(k,se.id,q,Object.keys(be).length>0?be:void 0)}catch(q){const se=q instanceof Error?q.message:"Failed to send message";t.setSessionError(se);const ne=t.lastMessage;ne&&ne.role==="assistant"&&t.updateMessage(ne.id,{status:"error"}),t.activeConversationId&&(t.endSession(t.activeConversationId),t.endConversationStreaming(t.activeConversationId))}finally{C.value=!1}}async function J(){try{f(t.activeConversationId)}catch{}}async function ee(){if(t.activeConversationId){m.value="",L(),C.value=!0;try{await h(t.activeConversationId);const k=t.addAssistantMessage(t.activeConversationId);t.updateMessage(k.id,{content:"✨ **Context cleared** — The AI conversation context has been reset. Starting fresh from here.",status:"complete"},t.activeConversationId);const{useToast:F}=await Bn(async()=>{const{useToast:se}=await import("./BUOk7wkI.js").then(ne=>ne.o);return{useToast:se}},__vite__mapDeps([0,1,2]),import.meta.url);F().success("AI context has been reset. The conversation will start fresh.")}catch(k){console.error("Failed to reset context:",k);const{useToast:F}=await Bn(async()=>{const{useToast:se}=await import("./BUOk7wkI.js").then(ne=>ne.o);return{useToast:se}},__vite__mapDeps([0,1,2]),import.meta.url);F().error("Failed to reset context. Please try again.")}finally{C.value=!1}}}async function te(){const k=t.messages;let F=null;for(let se=k.length-1;se>=0;se--)if(k[se].role==="user"){F=k[se].content;break}if(!F||!t.activeConversationId)return;const q=t.activeConversationId;t.clearError(),C.value=!0;try{const se=t.addAssistantMessage();t.startSession(`session-${Date.now()}`),t.startConversationStreaming(q);const ne=t.activeConversation,be={};ne?.hasWorktree&&ne.worktreePath&&(be.cwd=ne.worktreePath,be.worktreeBranch=ne.worktreeBranch),ne?.featureId&&(be.featureId=ne.featureId),await a(F,se.id,q,Object.keys(be).length>0?be:void 0)}catch(se){const ne=se instanceof Error?se.message:"Failed to retry message";t.setSessionError(ne);const be=t.lastMessage;be&&be.role==="assistant"&&t.updateMessage(be.id,{status:"error"}),t.endSession(q),t.endConversationStreaming(q)}finally{C.value=!1}}function O(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),Q())}function I(){const k=y.value;if(k){if(!m.value.trim()){k.style.height="";return}k.style.height="auto",k.style.height=Math.min(k.scrollHeight,200)+"px"}}function L(){const k=y.value;k&&(k.style.height="")}function K(){cn(()=>{y.value?.focus()})}return Ae(m,I),Ae(()=>t.isActiveConversationStreaming,(k,F)=>{F&&!k&&K()}),Ae(()=>t.activeConversationId,()=>{K()}),(k,F)=>(i(),d("div",Iv,[o("div",Nv,[o("div",Fv,[o("button",{class:ve(["flex items-center gap-1.5 px-2 py-1 rounded border border-retro-border/50 hover:border-retro-border text-xs font-mono transition-colors",g[s(t).permissionMode]]),onClick:F[0]||(F[0]=q=>x.value=!s(x))},[(i(),ie(Rn(v[s(t).permissionMode]),{class:"w-4 h-4"})),o("span",null,T(s(An)[s(t).permissionMode]),1),Y(s(Pv),{class:"w-3 h-3"})],2),s(x)?(i(),d("div",Hv,[(i(),d(he,null,Be(["plan","ask","auto","bypass"],q=>o("button",{key:q,class:ve(["flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-left hover:bg-retro-panel transition-colors",[g[q],s(t).permissionMode===q?"bg-retro-panel":""]]),onClick:se=>B(q)},[(i(),ie(Rn(v[q]),{class:"w-4 h-4"})),o("span",null,T(s(An)[q]),1)],10,Ov)),64))])):P("",!0)]),o("span",Uv,T(s(t).permissionMode==="plan"?"Plan only":s(t).permissionMode==="ask"?"Ask before actions":s(t).permissionMode==="auto"?"Auto approve":"All permissions"),1)]),s(ce)?(i(),d("div",jv,[o("div",zv,[o("div",Vv,[F[2]||(F[2]=o("div",{class:"text-xs font-mono text-retro-yellow font-bold mb-1"}," Permission Required ",-1)),o("div",Wv,[o("span",Gv,T(s(t).pendingPermission?.tool),1),s(t).pendingPermission?.filePath?(i(),d("span",qv," - "+T(s(t).pendingPermission.filePath),1)):s(t).pendingPermission?.command?(i(),d("span",Zv," - "+T(s(t).pendingPermission.command),1)):P("",!0)])]),o("div",{class:"flex gap-2 flex-shrink-0"},[o("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-green/20 text-retro-green border border-retro-green/50 hover:bg-retro-green/30 transition-colors",onClick:ue}," Allow "),o("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-red/20 text-retro-red border border-retro-red/50 hover:bg-retro-red/30 transition-colors",onClick:de}," Deny ")])])])):P("",!0),s(W)?(i(),d("div",Kv,[o("div",{class:"flex items-center justify-between gap-3"},[F[3]||(F[3]=o("div",{class:"flex-1 min-w-0"},[o("div",{class:"text-xs font-mono text-retro-cyan font-bold mb-1"}," Plan Ready for Review "),o("div",{class:"text-xs font-mono text-retro-muted"}," Approve to switch to Auto mode and start implementation. ")],-1)),o("div",{class:"flex gap-2 flex-shrink-0"},[o("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-green/20 text-retro-green border border-retro-green/50 hover:bg-retro-green/30 transition-colors",onClick:le}," Approve & Implement "),o("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-red/20 text-retro-red border border-retro-red/50 hover:bg-retro-red/30 transition-colors",onClick:re}," Reject ")])])])):P("",!0),o("div",Yv,[o("div",Xv,[Me(o("textarea",{ref_key:"inputRef",ref:y,"onUpdate:modelValue":F[1]||(F[1]=q=>Ie(m)?m.value=q:null),disabled:e.disabled||s(t).isActiveConversationStreaming||s(ce)||s(W),placeholder:e.disabled?"This conversation is finalized (read-only)":"Type a message...",rows:"1",class:"w-full px-3 py-2 bg-retro-black border border-retro-border rounded text-sm font-mono text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan disabled:opacity-50 disabled:cursor-not-allowed resize-none overflow-hidden",onKeydown:O},null,40,Qv),[[ut,s(m)]])]),s(Z)?(i(),d("button",{key:0,class:"flex-shrink-0 p-2 rounded bg-retro-yellow/20 text-retro-yellow hover:bg-retro-yellow/30 transition-colors",title:"Retry last message",onClick:te},[Y(s(Ev),{class:"w-5 h-5"})])):P("",!0),!s(fe)&&!s(ce)?(i(),d("button",{key:1,disabled:!s(E),class:"flex-shrink-0 p-2 rounded bg-retro-cyan/20 text-retro-cyan hover:bg-retro-cyan/30 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onClick:Q},[Y(s(Dv),{class:"w-5 h-5"})],8,Jv)):s(fe)?(i(),d("button",{key:2,class:"flex-shrink-0 p-2 rounded bg-retro-red/20 text-retro-red hover:bg-retro-red/30 transition-colors",onClick:J},[Y(s(Lv),{class:"w-5 h-5"})])):P("",!0)]),F[4]||(F[4]=o("div",{class:"mt-1 text-xs font-mono text-retro-muted"}," Press Enter to send, Shift+Enter for new line. Slash commands: `/context`, `/reset`, `/spec-search`. ",-1))]))}}),tg={class:"h-64 border-t border-retro-border bg-retro-dark/50 flex flex-col"},ng={class:"h-9 flex items-center justify-between px-3 border-b border-retro-border/40"},og={key:0,class:"flex-1 flex items-center justify-center text-xs font-mono text-retro-muted"},rg={key:1,class:"flex-1 overflow-y-auto scrollbar-custom"},sg={class:"flex items-center gap-2 text-[10px] font-mono"},ag={class:"text-retro-muted"},ig={class:"text-retro-muted"},lg={class:"text-retro-green truncate"},cg={class:"mt-1 text-[11px] font-mono text-retro-text whitespace-pre-wrap break-words"},ug=Ce({__name:"ChatDebugPanel",setup(e){const n=mt(),{debugEvents:t}=Rs(n);function a(l){return new Date(l).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function r(l){return l==="in"?"text-retro-cyan":l==="out"?"text-retro-yellow":"text-retro-muted"}return(l,c)=>(i(),d("div",tg,[o("div",ng,[c[1]||(c[1]=o("div",{class:"text-[11px] font-mono text-retro-text"}," Debug Stream (CLI/Provider) ",-1)),o("button",{class:"p-1 rounded hover:bg-retro-panel transition-colors",title:"Clear debug events",onClick:c[0]||(c[0]=f=>s(n).clearDebugEvents())},[Y(s(un),{class:"w-3.5 h-3.5 text-retro-muted"})])]),s(t).length===0?(i(),d("div",og," No debug events yet ")):(i(),d("div",rg,[(i(!0),d(he,null,Be(s(t),f=>(i(),d("div",{key:f.id,class:"px-3 py-2 border-b border-retro-border/20"},[o("div",sg,[o("span",ag,T(a(f.timestamp)),1),o("span",{class:ve(r(f.direction))},T(f.direction.toUpperCase()),3),o("span",ig,T(f.channel),1),o("span",lg,T(f.eventType),1)]),o("pre",cg,T(f.payload),1)]))),128))]))]))}}),dg={class:"px-4 py-3 border-b border-retro-border bg-retro-dark/80 space-y-3"},fg={class:"flex items-center justify-between"},mg={class:"space-y-1 text-xs font-mono"},hg={class:"flex items-center gap-2"},pg={class:"relative"},vg=["disabled"],gg=["value"],xg=["value"],bg={class:"flex items-center gap-2"},yg={class:"text-retro-text"},kg={class:"relative"},wg=["disabled"],Cg=["disabled"],$g={class:"flex items-center gap-2"},Sg=["disabled"],_g=["disabled"],Mg=Ce({__name:"FinalizeConfirm",props:{baseBranch:{},worktreeBranch:{},worktreePath:{}},emits:["confirm","cancel"],setup(e,{emit:n}){const t=e,a=n,r=S(""),l=S(null),c=S(!1),f=S(!1),h=S(t.baseBranch),m=S([]),y=S(!1);async function C(){f.value=!0;try{const v=await $fetch("/api/chat/generate-commit-message",{method:"POST",body:{conversationId:t.worktreePath.split("/").pop()?.replace("br-","")||"",worktreePath:t.worktreePath}});v.success&&v.message&&(r.value=v.message)}catch{}finally{f.value=!1}}st(async()=>{const v=(async()=>{try{const B=t.worktreePath.split("/").pop()||"",V=await $fetch(`/api/commits/${encodeURIComponent(B)}`,{params:{workingDirectory:t.worktreePath}});l.value=V.aheadCount}catch{l.value=null}})(),g=(async()=>{y.value=!0;try{const B=await $fetch("/api/git/branches");m.value=B.branches.filter(V=>!V.isRemote&&!V.name.startsWith("br/")&&!V.name.startsWith("br/p-")).map(V=>V.name),m.value.length>0&&!m.value.includes(h.value)&&(h.value=m.value.includes("main")?"main":m.value.includes("master")?"master":m.value[0])}catch{m.value=[]}finally{y.value=!1}})();await Promise.all([v,g])});function x(){r.value.trim()&&(c.value=!0,a("confirm",r.value.trim(),h.value))}return(v,g)=>(i(),d("div",dg,[o("div",fg,[g[4]||(g[4]=o("span",{class:"text-xs font-mono text-retro-text font-semibold uppercase tracking-wide"}," Finalize ",-1)),o("button",{type:"button",class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",title:"Cancel",onClick:g[0]||(g[0]=B=>a("cancel"))},[Y(s(ht),{class:"w-4 h-4"})])]),o("div",mg,[o("div",hg,[g[5]||(g[5]=o("span",{class:"text-retro-muted"},"target:",-1)),o("div",pg,[Me(o("select",{"onUpdate:modelValue":g[1]||(g[1]=B=>h.value=B),disabled:c.value||y.value,class:"appearance-none bg-retro-black border border-retro-border rounded px-2 py-0.5 pr-6 text-xs font-mono text-retro-cyan focus:outline-none focus:border-retro-cyan cursor-pointer disabled:opacity-40"},[y.value?(i(),d("option",{key:0,value:e.baseBranch},T(e.baseBranch),9,gg)):P("",!0),(i(!0),d(he,null,Be(m.value,B=>(i(),d("option",{key:B,value:B},T(B),9,xg))),128))],8,vg),[[_n,h.value]]),Y(s(Jo),{class:"absolute right-1 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted pointer-events-none"})])]),o("div",bg,[g[6]||(g[6]=o("span",{class:"text-retro-muted"},"commits:",-1)),o("span",yg,T(l.value!==null?l.value:"..."),1)])]),o("div",kg,[Me(o("textarea",{"onUpdate:modelValue":g[2]||(g[2]=B=>r.value=B),placeholder:"Squash commit message...",rows:"2",class:"w-full px-2 py-1.5 pr-8 text-xs font-mono bg-retro-black border border-retro-border rounded text-retro-text placeholder-retro-subtle focus:outline-none focus:border-retro-cyan resize-none",disabled:c.value||f.value},null,8,wg),[[ut,r.value]]),o("button",{type:"button",disabled:c.value||f.value,class:"absolute right-1.5 top-1.5 p-0.5 rounded text-retro-muted hover:text-retro-cyan transition-colors disabled:opacity-40",title:"Generate commit message",onClick:C},[Y(s(xo),{class:ve(["w-4 h-4",{"animate-spin":f.value}])},null,8,["class"])],8,Cg)]),o("div",$g,[o("button",{type:"button",disabled:!r.value.trim()||c.value,class:"flex items-center gap-1 px-3 py-1 text-xs font-mono rounded border transition-colors bg-retro-green/10 border-retro-green/50 text-retro-green hover:bg-retro-green/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:x},[Y(s(Xo),{class:"w-3.5 h-3.5"}),ke(" "+T(c.value?"Finalizing...":"Confirm"),1)],8,Sg),o("button",{type:"button",disabled:c.value,class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text/30 transition-colors disabled:opacity-40",onClick:g[3]||(g[3]=B=>a("cancel"))}," Cancel ",8,_g)])]))}}),Tg={class:"px-4 py-3 border-b border-retro-border bg-retro-dark/80 space-y-3"},Ag={class:"flex items-center justify-between"},Bg={class:"space-y-1 text-xs font-mono"},Rg={class:"flex items-center gap-2"},Eg={class:"text-retro-cyan"},Pg={class:"flex items-center gap-2"},Dg={class:"relative"},Lg=["disabled"],Ig=["value"],Ng=["value"],Fg={class:"flex items-center gap-2"},Hg={class:"text-retro-text"},Og={class:"flex items-center gap-2"},Ug=["disabled"],jg=["disabled"],zg=Ce({__name:"RebaseConfirm",props:{baseBranch:{},worktreeBranch:{},worktreePath:{}},emits:["confirm","cancel"],setup(e,{emit:n}){const t=e,a=n,r=S(null),l=S(!1),c=S(t.baseBranch),f=S([]),h=S(!1);async function m(C){try{const x=await $fetch("/api/chat/compare",{params:{worktreePath:t.worktreePath,baseBranch:C}});r.value=x.ahead}catch{r.value=null}}st(async()=>{const C=m(c.value),x=(async()=>{h.value=!0;try{const v=await $fetch("/api/git/branches");f.value=v.branches.filter(g=>!g.isRemote&&!g.name.startsWith("br/")&&!g.name.startsWith("br/p-")).map(g=>g.name),f.value.length>0&&!f.value.includes(c.value)&&(c.value=f.value.includes("main")?"main":f.value.includes("master")?"master":f.value[0])}catch{f.value=[]}finally{h.value=!1}})();await Promise.all([C,x])}),Ae(c,C=>{m(C)});function y(){l.value=!0,a("confirm",c.value)}return(C,x)=>(i(),d("div",Tg,[o("div",Ag,[x[3]||(x[3]=o("span",{class:"text-xs font-mono text-retro-text font-semibold uppercase tracking-wide"}," Rebase Worktree ",-1)),o("button",{type:"button",class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",title:"Cancel",onClick:x[0]||(x[0]=v=>a("cancel"))},[Y(s(ht),{class:"w-4 h-4"})])]),o("div",Bg,[o("div",Rg,[x[4]||(x[4]=o("span",{class:"text-retro-muted"},"worktree:",-1)),o("span",Eg,T(e.worktreeBranch),1)]),o("div",Pg,[x[5]||(x[5]=o("span",{class:"text-retro-muted"},"target:",-1)),o("div",Dg,[Me(o("select",{"onUpdate:modelValue":x[1]||(x[1]=v=>c.value=v),disabled:l.value||h.value,class:"appearance-none bg-retro-black border border-retro-border rounded px-2 py-0.5 pr-6 text-xs font-mono text-retro-cyan focus:outline-none focus:border-retro-cyan cursor-pointer disabled:opacity-40"},[h.value?(i(),d("option",{key:0,value:e.baseBranch},T(e.baseBranch),9,Ig)):P("",!0),(i(!0),d(he,null,Be(f.value,v=>(i(),d("option",{key:v,value:v},T(v),9,Ng))),128))],8,Lg),[[_n,c.value]]),Y(s(Jo),{class:"absolute right-1 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted pointer-events-none"})])]),o("div",Fg,[x[6]||(x[6]=o("span",{class:"text-retro-muted"},"commits ahead:",-1)),o("span",Hg,T(r.value!==null?r.value:"..."),1)])]),o("div",Og,[o("button",{type:"button",disabled:l.value,class:"flex items-center gap-1 px-3 py-1 text-xs font-mono rounded border transition-colors bg-retro-cyan/10 border-retro-cyan/50 text-retro-cyan hover:bg-retro-cyan/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:y},[Y(s(Xo),{class:"w-3.5 h-3.5"}),ke(" "+T(l.value?"Rebasing...":"Confirm"),1)],8,Ug),o("button",{type:"button",disabled:l.value,class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text/30 transition-colors disabled:opacity-40",onClick:x[2]||(x[2]=v=>a("cancel"))}," Cancel ",8,jg)])]))}}),Vg={class:"flex-1 flex flex-col overflow-hidden"},Wg={class:"flex-shrink-0 px-4 py-2 border-b border-retro-border flex items-center justify-between bg-retro-dark"},Gg={class:"text-xs font-mono text-retro-text truncate"},qg={class:"flex items-center gap-2 flex-shrink-0"},Zg=["title"],Kg=["disabled"],Yg=["disabled"],Xg={key:5,class:"text-xs font-mono text-retro-green"},Qg={key:6,class:"text-[11px] font-mono text-retro-muted"},Jg={key:0,class:"flex items-center justify-center h-full text-retro-muted text-xs font-mono"},e1=["innerHTML"],t1=["value","readonly"],n1={key:2,class:"flex-shrink-0 px-4 py-2 border-t border-retro-border bg-retro-yellow/10 text-retro-yellow text-xs font-mono"},o1=Ce({__name:"ConflictFileEditor",props:{file:{},resolved:{type:Boolean},aiResolving:{type:Boolean}},emits:["resolve","aiResolve"],setup(e,{emit:n}){const t=e,a=n,r=S(t.file.content),l=S(!1),c=S(""),f=S(!1);Ae(()=>t.file.path,()=>{r.value=t.file.content,l.value=!1,v()}),Ae(()=>t.file.content,()=>{l.value||(r.value=t.file.content,v())});const h=/^<{7}\s.*\n([\s\S]*?)^={7}\n([\s\S]*?)^>{7}\s.*\n/gm,m=/^<{7}[^\n]*\n([\s\S]*?)^={7}[^\n]*\n([\s\S]*?)^>{7}[^\n]*\n?/gm,y=H(()=>/^<{7}\s/m.test(r.value)),C=H(()=>E(r.value).length);function x(z){const N=z.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",vue:"vue",html:"html",css:"css",scss:"scss",less:"less",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",sh:"bash",zsh:"bash",sql:"sql",graphql:"graphql",xml:"xml",svg:"xml",toml:"toml",ini:"ini",dockerfile:"dockerfile"}[N]||"text"}async function v(){f.value=!0;try{const{codeToHtml:z}=await Bn(async()=>{const{codeToHtml:ee}=await import("./DBab5Zcv.js");return{codeToHtml:ee}},__vite__mapDeps([3,1,2]),import.meta.url),N=x(t.file.path),u=r.value.split(`
112
+ `);let b="",j=!1,G=!1,Q=0,J=-1;for(const ee of u){Q++;const te=/^<{7}\s/.test(ee),O=/^={7}$/.test(ee),I=/^>{7}\s/.test(ee);if(te){J++,j=!0,G=!1,b+=`<div class="conflict-line conflict-marker-line" data-line="${Q}"><span class="line-number">${Q}</span><span class="line-content conflict-marker">${g(ee)}</span></div>
113
+ `,t.resolved||(b+=W(J));continue}if(O&&j){j=!1,G=!0,b+=`<div class="conflict-line conflict-marker-line" data-line="${Q}"><span class="line-number">${Q}</span><span class="line-content conflict-marker">${g(ee)}</span></div>
114
+ `;continue}if(I){G=!1,b+=`<div class="conflict-line conflict-marker-line" data-line="${Q}"><span class="line-number">${Q}</span><span class="line-content conflict-marker">${g(ee)}</span></div>
115
+ `;continue}let L=g(ee);try{const F=(await z(ee||" ",{lang:N,theme:"vitesse-dark"})).match(/<code[^>]*><span class="line">(.*?)<\/span><\/code>/s);F&&(L=F[1])}catch{}let K="";j?K="conflict-ours":G&&(K="conflict-theirs"),b+=`<div class="conflict-line ${K}" data-line="${Q}"><span class="line-number">${Q}</span><span class="line-content">${L}</span></div>
116
+ `}c.value=b}catch{const z=r.value.split(`
117
+ `);c.value=z.map((N,p)=>{const u=p+1;return`<div class="conflict-line" data-line="${u}"><span class="line-number">${u}</span><span class="line-content">${g(N)}</span></div>`}).join(`
118
+ `)}finally{f.value=!1}}function g(z){return z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function B(){ce("ours")}function V(){ce("theirs")}function E(z){const N=[],p=new RegExp(m.source,m.flags);let u=null,b=0;for(;(u=p.exec(z))!==null;)N.push({index:b,start:u.index,end:p.lastIndex,ours:u[1]??"",theirs:u[2]??""}),b++;return N}function fe(z,N){return z?N?z.endsWith(`
119
+ `)||N.startsWith(`
120
+ `)?`${z}${N}`:`${z}
121
+ ${N}`:z:N}function ce(z,N){const p=r.value,u=E(p);if(u.length){if(typeof N=="number"){const b=u.find(G=>G.index===N);if(!b)return;const j=z==="ours"?b.ours:z==="theirs"?b.theirs:fe(b.ours,b.theirs);r.value=p.slice(0,b.start)+j+p.slice(b.end)}else r.value=p.replace(h,(b,j,G)=>z==="ours"?j:z==="theirs"?G:fe(j,G));v()}}function W(z){return`<div class="conflict-inline-actions" data-conflict-controls="${z}">
122
+ <button type="button" class="conflict-inline-button conflict-inline-button-ours" data-conflict-index="${z}" data-conflict-action="ours">Accept Ours</button>
123
+ <button type="button" class="conflict-inline-button conflict-inline-button-theirs" data-conflict-index="${z}" data-conflict-action="theirs">Accept Theirs</button>
124
+ <button type="button" class="conflict-inline-button conflict-inline-button-both" data-conflict-index="${z}" data-conflict-action="both">Accept Both</button>
125
+ </div>
126
+ `}function ue(z){const N=z.target?.closest("button[data-conflict-action]");if(!N||t.resolved)return;const p=N.dataset.conflictAction,u=N.dataset.conflictIndex;if(!p||u===void 0)return;const b=Number.parseInt(u,10);Number.isNaN(b)||ce(p,b)}function de(){y.value||a("resolve",t.file.path,r.value)}function le(){a("aiResolve",t.file.path)}function re(){l.value=!l.value,l.value||v()}function Z(z){const N=z.target;r.value=N.value}return st(()=>{v()}),(z,N)=>(i(),d("div",Vg,[o("div",Wg,[o("span",Gg,T(e.file.path),1),o("div",qg,[e.resolved?P("",!0):(i(),d("button",{key:0,type:"button",class:ve(["px-2 py-0.5 text-xs font-mono rounded border transition-colors",l.value?"border-retro-yellow/50 text-retro-yellow hover:bg-retro-yellow/10":"border-retro-subtle/50 text-retro-muted hover:bg-retro-subtle/10"]),title:l.value?"Switch to highlighted view":"Switch to edit mode",onClick:re},[l.value?(i(),ie(s(ts),{key:0,class:"w-3.5 h-3.5 inline-block"})):(i(),ie(s(tr),{key:1,class:"w-3.5 h-3.5 inline-block"}))],10,Zg)),!e.resolved&&y.value?(i(),d("button",{key:1,type:"button",disabled:e.aiResolving,class:"flex items-center gap-1 px-2 py-0.5 text-xs font-mono rounded border border-retro-orange/50 text-retro-orange hover:bg-retro-orange/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",onClick:le},[Y(s(xo),{class:"w-3.5 h-3.5"}),ke(" "+T(e.aiResolving?"Resolving...":"AI Resolve"),1)],8,Kg)):P("",!0),!e.resolved&&y.value?(i(),d("button",{key:2,type:"button",class:"px-2 py-0.5 text-xs font-mono rounded border border-retro-cyan/50 text-retro-cyan hover:bg-retro-cyan/10 transition-colors",onClick:B}," Accept All Ours ")):P("",!0),!e.resolved&&y.value?(i(),d("button",{key:3,type:"button",class:"px-2 py-0.5 text-xs font-mono rounded border border-retro-magenta/50 text-retro-magenta hover:bg-retro-magenta/10 transition-colors",onClick:V}," Accept All Theirs ")):P("",!0),e.resolved?P("",!0):(i(),d("button",{key:4,type:"button",disabled:y.value,class:"px-2 py-0.5 text-xs font-mono rounded border border-retro-green/50 text-retro-green hover:bg-retro-green/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",onClick:de}," Mark Resolved ",8,Yg)),e.resolved?(i(),d("span",Xg," Resolved ")):C.value>0?(i(),d("span",Qg,T(C.value)+" conflict "+T(C.value===1?"block":"blocks"),1)):P("",!0)])]),l.value?P("",!0):(i(),d("div",{key:0,class:ve(["flex-1 overflow-auto bg-retro-black conflict-viewer",{"opacity-60":e.resolved}]),onClick:ue},[f.value?(i(),d("div",Jg," Highlighting... ")):(i(),d("div",{key:1,class:"conflict-code",innerHTML:c.value},null,8,e1))],2)),l.value?(i(),d("textarea",{key:1,value:r.value,readonly:e.resolved,class:ve(["flex-1 w-full p-4 font-mono text-xs bg-retro-black text-retro-text resize-none focus:outline-none leading-relaxed",{"opacity-60":e.resolved}]),spellcheck:"false",onInput:Z},null,42,t1)):P("",!0),y.value&&!e.resolved?(i(),d("div",n1," File still contains conflict markers. Remove all <<<<<<<, =======, >>>>>>> markers to resolve. ")):P("",!0)]))}}),r1={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60"},s1={class:"w-full max-w-5xl mx-4 my-8 h-[80vh] bg-retro-dark border border-retro-border rounded-lg shadow-xl flex flex-col overflow-hidden"},a1={class:"flex-shrink-0 px-4 py-3 border-b border-retro-border flex items-center justify-between"},i1={class:"flex items-center gap-3"},l1={class:"text-xs font-mono text-retro-muted"},c1={class:"flex items-center gap-2"},u1=["disabled"],d1=["disabled"],f1=["disabled"],m1={key:0,class:"flex-1 flex items-center justify-center text-retro-muted text-sm font-mono"},h1={key:1,class:"flex-1 flex items-center justify-center text-retro-red text-sm font-mono"},p1={key:2,class:"flex-1 flex overflow-hidden"},v1={class:"w-64 flex-shrink-0 border-r border-retro-border overflow-y-auto bg-retro-dark"},g1={class:"py-1"},x1=["onClick"],b1={key:1,class:"flex-1 flex items-center justify-center text-retro-muted text-sm font-mono"},y1=Ce({__name:"ConflictResolutionModal",emits:["close"],setup(e,{emit:n}){const t=n,a=mt(),r=S(null),l=S(!1),c=S(!1),f=S(null),h=S(!1),m=H(()=>a.conflictState?.files??[]),y=H(()=>a.conflictState?.resolvedFiles??new Set),C=H(()=>m.value.length),x=H(()=>y.value.size),v=H(()=>C.value>0&&x.value>=C.value),g=H(()=>C.value-x.value),B=H(()=>r.value?m.value.find(le=>le.path===r.value)??null:null);function V(le){return y.value.has(le)}function E(le){r.value=le}async function fe(le,re){await a.resolveConflictFile(le,re)}async function ce(le){f.value=le,await a.aiResolveConflictFile(le),f.value=null}async function W(){h.value=!0,await a.aiResolveAllConflicts(),h.value=!1}async function ue(){l.value=!0;const le=await a.continueRebase();l.value=!1,le.success&&t("close")}async function de(){c.value=!0,await a.abortRebase(),c.value=!1,t("close")}return(le,re)=>(i(),ie(Jt,{to:"body"},[Y($n,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:Ge(()=>[s(a).conflictState?(i(),d("div",r1,[o("div",s1,[o("div",a1,[o("div",i1,[Y(s(Cn),{class:"w-5 h-5 text-retro-yellow"}),re[0]||(re[0]=o("h3",{class:"text-sm font-mono text-retro-text font-semibold"},"Resolve Rebase Conflicts",-1)),o("span",l1,T(x.value)+"/"+T(C.value)+" resolved ",1)]),o("div",c1,[g.value>0?(i(),d("button",{key:0,type:"button",disabled:h.value||l.value||c.value,class:"flex items-center gap-1 px-3 py-1.5 text-xs font-mono rounded border transition-colors bg-retro-orange/10 border-retro-orange/50 text-retro-orange hover:bg-retro-orange/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:W},[Y(s(xo),{class:"w-3.5 h-3.5"}),ke(" "+T(h.value?"AI Resolving...":`AI Resolve All (${g.value})`),1)],8,u1)):P("",!0),o("button",{type:"button",disabled:!v.value||l.value||c.value,class:"flex items-center gap-1 px-3 py-1.5 text-xs font-mono rounded border transition-colors bg-retro-green/10 border-retro-green/50 text-retro-green hover:bg-retro-green/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:ue},T(l.value?"Continuing...":"Continue Rebase"),9,d1),o("button",{type:"button",disabled:l.value||c.value,class:"px-3 py-1.5 text-xs font-mono rounded border border-retro-red/50 text-retro-red hover:bg-retro-red/10 transition-colors disabled:opacity-40",onClick:de},T(c.value?"Aborting...":"Abort"),9,f1)])]),s(a).conflictState?.loading?(i(),d("div",m1," Loading conflict files... ")):s(a).conflictState?.error?(i(),d("div",h1,T(s(a).conflictState.error),1)):(i(),d("div",p1,[o("div",v1,[o("div",g1,[(i(!0),d(he,null,Be(m.value,Z=>(i(),d("button",{key:Z.path,type:"button",class:ve(["w-full text-left px-3 py-2 text-xs font-mono flex items-center gap-2 transition-colors hover:bg-retro-panel",{"bg-retro-panel":r.value===Z.path}]),onClick:z=>E(Z.path)},[V(Z.path)?(i(),ie(s(go),{key:0,class:"w-3.5 h-3.5 text-retro-green flex-shrink-0"})):(i(),ie(s(Ln),{key:1,class:"w-3.5 h-3.5 text-retro-yellow flex-shrink-0"})),o("span",{class:ve(["truncate",V(Z.path)?"text-retro-green":"text-retro-yellow"])},T(Z.path),3)],10,x1))),128))])]),B.value?(i(),ie(o1,{key:0,file:B.value,resolved:V(B.value.path),"ai-resolving":f.value===B.value.path||h.value,onResolve:fe,onAiResolve:ce},null,8,["file","resolved","ai-resolving"])):(i(),d("div",b1," Select a file to resolve "))]))])])):P("",!0)]),_:1})]))}}),k1={key:0,class:"w-full max-w-md mx-4 bg-retro-dark border border-retro-border rounded-lg shadow-xl"},w1={class:"flex items-center justify-between p-4 border-b border-retro-border"},C1={class:"flex items-center gap-2"},$1={class:"p-4"},S1={class:"mt-2 text-sm text-retro-text font-mono truncate"},_1={class:"flex justify-end gap-3 p-4 border-t border-retro-border"},M1=Ce({__name:"DeleteConfirmModal",props:{show:{type:Boolean},title:{}},emits:["confirm","cancel"],setup(e,{emit:n}){const t=n;function a(r){r.target===r.currentTarget&&t("cancel")}return(r,l)=>(i(),ie(Jt,{to:"body"},[Y($n,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:Ge(()=>[e.show?(i(),d("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:a},[Y($n,{"enter-active-class":"transition-all duration-200","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"transition-all duration-200","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:Ge(()=>[e.show?(i(),d("div",k1,[o("div",w1,[o("div",C1,[Y(s(Cn),{class:"w-5 h-5 text-retro-red"}),l[3]||(l[3]=o("h3",{class:"text-lg font-mono text-retro-text"},"Delete Conversation",-1))]),o("button",{onClick:l[0]||(l[0]=c=>t("cancel")),class:"p-1 hover:bg-retro-panel rounded transition-colors"},[Y(s(ht),{class:"w-5 h-5 text-retro-muted"})])]),o("div",$1,[l[4]||(l[4]=o("p",{class:"text-sm text-retro-muted font-mono"}," Are you sure you want to delete this conversation? ",-1)),o("p",S1,' "'+T(e.title)+'" ',1),l[5]||(l[5]=o("p",{class:"mt-3 text-xs text-retro-muted"}," This action cannot be undone. ",-1))]),o("div",_1,[o("button",{onClick:l[1]||(l[1]=c=>t("cancel")),class:"px-4 py-2 text-sm font-mono text-retro-muted border border-retro-border rounded hover:bg-retro-panel transition-colors"}," Cancel "),o("button",{onClick:l[2]||(l[2]=c=>t("confirm")),class:"px-4 py-2 text-sm font-mono text-white bg-retro-red/80 border border-retro-red rounded hover:bg-retro-red transition-colors"}," Delete ")])])):P("",!0)]),_:1})])):P("",!0)]),_:1})]))}}),T1={class:"h-full flex flex-col bg-retro-black"},A1={class:"flex-shrink-0 h-12 flex items-center justify-between px-4 border-b border-retro-border bg-retro-dark"},B1={class:"flex items-center gap-2 min-w-0"},R1={class:"text-xs font-mono text-retro-text truncate"},E1={class:"flex items-center gap-1"},P1=["disabled","title"],D1=["title"],L1=["title"],I1=["disabled"],N1={key:4,class:"flex-shrink-0 px-4 py-2 border-b border-retro-border bg-retro-green/10 text-retro-green text-xs font-mono text-center"},F1={class:"flex-1 min-h-0 flex flex-col"},Hr=Ce({__name:"ChatPanel",setup(e){const n=mt(),t=Ss(),{disconnectConversation:a}=pr();st(async()=>{try{const Q=await $fetch("/api/cwd");n.setCwd(Q.cwd)}catch{}});const r=H(()=>n.activeConversation?.title||"New Chat"),l=S(!1),c=H(()=>t.isChatFullscreen),f=S(!1);function h(){t.toggleChatFullscreen()}async function m(){l.value=!1;const Q=n.activeConversationId;Q&&(a(Q),await n.deleteConversation(Q)),n.clearMessages()}function y(){n.hasMessages&&(l.value=!0)}function C(){l.value=!1}const x=S(!1),v=S(null),g=H(()=>n.activeConversation?.finalized===!0),B=H(()=>g.value),V=S(null),E=S(!1);async function fe(){const Q=n.activeConversation;if(!Q?.worktreePath||!Q?.baseBranch){V.value=null;return}E.value=!0;try{const J=await $fetch("/api/chat/compare",{params:{worktreePath:Q.worktreePath,baseBranch:Q.baseBranch}});V.value=J}catch{V.value=null}finally{E.value=!1}}Ae(()=>[n.activeConversationId,n.activeConversation?.worktreePath,n.activeConversation?.baseBranch,n.activeConversation?.lastCommitTime],()=>{fe()},{immediate:!0});const ce=H(()=>V.value?V.value.ahead===0&&V.value.behind===0:!1),W=H(()=>{const Q=n.activeConversation;return Q?.hasWorktree&&!Q?.finalized&&!n.isActiveConversationStreaming}),ue=H(()=>W.value&&!ce.value);function de(){x.value=!0,v.value=null}async function le(Q,J){const ee=n.activeConversationId;if(!ee)return;const te=await n.finalizeConversation(ee,Q,J);if(x.value=!1,te.success)v.value={type:"success",message:`Merged to ${J}`},setTimeout(()=>{v.value=null},5e3);else if(te.rebaseInProgress)v.value=null;else{const O=te.conflictFiles?.length?`Conflict in: ${te.conflictFiles.join(", ")}`:te.error||"Finalize failed";v.value={type:"error",message:O}}}function re(){x.value=!1}function Z(){if(!n.conflictState&&n.activeConversation?.hasWorktree){const Q=n.activeConversation?.baseBranch||"main";v.value={type:"success",message:`Rebased onto ${Q}`},setTimeout(()=>{v.value=null},5e3)}else v.value=null}const z=S(!1),N=H(()=>!!n.activeConversation?.previewBranch);async function p(){const Q=n.activeConversationId;if(!Q)return;z.value=!0,v.value=null;const J=N.value,ee=await n.togglePreview(Q);if(ee.success){const te=J?`Switched back to ${n.activeConversation?.baseBranch}`:"Preview active — main worktree updated";v.value={type:"success",message:te},setTimeout(()=>{v.value=null},3e3)}else v.value={type:"error",message:ee.error||"Preview toggle failed"};z.value=!1}const u=S(!1);function b(){u.value=!0,v.value=null}async function j(Q){const J=n.activeConversationId;if(!J)return;const ee=await n.rebaseConversation(J,Q);u.value=!1,ee.success?(v.value={type:"success",message:`Rebased onto ${Q}`},setTimeout(()=>{v.value=null},5e3)):ee.rebaseInProgress?v.value=null:v.value={type:"error",message:ee.error||"Rebase failed"}}function G(){u.value=!1}return(Q,J)=>(i(),d("div",T1,[o("div",A1,[o("div",B1,[o("span",R1,T(s(r)),1)]),o("div",E1,[s(W)?(i(),d("button",{key:0,disabled:s(z),class:"p-1.5 rounded hover:bg-retro-panel transition-colors disabled:opacity-40",title:s(N)?"End preview: switch back to base branch":"Preview: test worktree changes in main worktree",onClick:p},[s(N)?(i(),ie(s(ta),{key:0,class:"w-4 h-4 text-retro-orange"})):(i(),ie(s(ts),{key:1,class:"w-4 h-4 text-retro-cyan"}))],8,P1)):P("",!0),s(ue)?(i(),d("button",{key:1,class:"p-1.5 rounded hover:bg-retro-panel transition-colors",title:"Rebase: sync worktree onto target base branch",onClick:b},[Y(s(xn),{class:"w-4 h-4 text-retro-purple"})])):P("",!0),s(ue)?(i(),d("button",{key:2,class:"p-1.5 rounded hover:bg-retro-panel transition-colors",title:"Finalize: squash & merge to base branch",onClick:de},[Y(s(go),{class:"w-4 h-4 text-retro-green"})])):P("",!0),o("button",{class:"p-1.5 rounded hover:bg-retro-panel transition-colors",title:s(c)?"Exit fullscreen chat":"Fullscreen chat",onClick:h},[s(c)?(i(),ie(s(qr),{key:0,class:"w-4 h-4 text-retro-muted"})):(i(),ie(s(Zr),{key:1,class:"w-4 h-4 text-retro-muted"}))],8,D1),o("button",{class:"p-1.5 rounded hover:bg-retro-panel transition-colors",title:s(f)?"Hide debug stream":"Show debug stream",onClick:J[0]||(J[0]=ee=>f.value=!s(f))},[Y(s(Gs),{class:ve(["w-4 h-4",s(f)?"text-retro-yellow":"text-retro-muted"])},null,8,["class"])],8,L1),o("button",{disabled:!s(n).hasMessages,class:"p-1.5 rounded hover:bg-retro-panel disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:"New conversation",onClick:y},[Y(s(un),{class:"w-4 h-4 text-retro-muted"})],8,I1)])]),Y(M1,{show:s(l),title:s(r),onConfirm:m,onCancel:C},null,8,["show","title"]),s(x)&&s(n).activeConversation?.hasWorktree?(i(),ie(Mg,{key:0,"base-branch":s(n).activeConversation.baseBranch||"main","worktree-branch":s(n).activeConversation.worktreeBranch||"","worktree-path":s(n).activeConversation.worktreePath||"",onConfirm:le,onCancel:re},null,8,["base-branch","worktree-branch","worktree-path"])):P("",!0),s(u)&&s(n).activeConversation?.hasWorktree?(i(),ie(zg,{key:1,"base-branch":s(n).activeConversation.baseBranch||"main","worktree-branch":s(n).activeConversation.worktreeBranch||"","worktree-path":s(n).activeConversation.worktreePath||"",onConfirm:j,onCancel:G},null,8,["base-branch","worktree-branch","worktree-path"])):P("",!0),s(n).conflictState?(i(),ie(y1,{key:2,onClose:Z})):P("",!0),s(v)?(i(),d("div",{key:3,class:ve(["flex-shrink-0 px-4 py-2 border-b border-retro-border text-xs font-mono",s(v).type==="success"?"bg-retro-green/10 text-retro-green":"bg-retro-red/10 text-retro-red"])},[ke(T(s(v).message)+" ",1),s(v).type==="error"?(i(),d("button",{key:0,class:"ml-2 underline hover:no-underline",onClick:J[1]||(J[1]=ee=>v.value=null)}," dismiss ")):P("",!0)],2)):P("",!0),s(g)?(i(),d("div",N1," This conversation has been finalized and is read-only. ")):P("",!0),o("div",F1,[Y(Rv,{class:"flex-1 overflow-hidden"}),s(f)?(i(),ie(ug,{key:0})):P("",!0)]),Y(eg,{disabled:s(B)},null,8,["disabled"])]))}}),H1={class:"flex-shrink-0 flex items-center justify-between px-4 py-2 border-b border-retro-border bg-retro-panel"},O1={class:"flex items-center gap-2 min-w-0"},U1=["title"],j1={class:"text-retro-text font-mono text-sm truncate"},z1={class:"text-retro-muted"},V1={class:"text-retro-text"},W1={class:"text-retro-muted font-mono text-xs flex-shrink-0"},G1={class:"flex-1 overflow-auto"},q1={key:0,class:"flex items-center justify-center gap-2 text-retro-muted text-sm py-8"},Z1={key:1,class:"flex items-center justify-center text-retro-muted text-sm py-8"},K1={key:2,class:"flex items-center justify-center text-retro-muted text-sm py-8"},Y1={key:3,class:"w-full text-xs font-mono border-collapse diff-table"},X1={key:0,class:"diff-warning"},Q1={key:0,colspan:"3",class:"diff-hunk-header px-4 py-1"},J1={class:"diff-line-num select-none text-right px-2 w-12"},ex={class:"diff-line-num select-none text-right px-2 w-12 border-r border-retro-border"},tx={class:"diff-line-content px-3 whitespace-pre-wrap break-all"},nx={key:0,class:"diff-sign"},ox={key:1,class:"diff-sign"},rx={key:2,class:"diff-sign"},sx={key:4,class:"flex items-center justify-center text-retro-muted text-sm py-8"},ax=Ce({__name:"GitFileDiffViewer",props:{file:{},commitHash:{},content:{},loading:{type:Boolean}},emits:["close"],setup(e,{emit:n}){const t=e,a=n,r=S(null),l=H(()=>t.commitHash.substring(0,7)),c=H(()=>Pn[t.file.status]||{label:t.file.status,colorClass:"text-retro-muted"}),f=H(()=>t.file.status==="R"&&t.file.oldPath);function h(m){m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),a("close"))}return st(()=>{r.value?.focus()}),_t(()=>{}),(m,y)=>(i(),d("div",{ref_key:"containerRef",ref:r,tabindex:0,onKeydown:h,class:"flex flex-col h-full bg-retro-dark focus:outline-none","aria-label":"File diff viewer",role:"region"},[o("div",H1,[o("div",O1,[o("span",{class:ve(["flex-shrink-0 w-5 h-5 flex items-center justify-center text-xs font-bold rounded",c.value.colorClass]),title:c.value.label},T(e.file.status),11,U1),o("span",j1,[f.value&&e.file.oldPath?(i(),d(he,{key:0},[o("span",z1,T(e.file.oldPath),1),y[1]||(y[1]=o("span",{class:"text-retro-yellow mx-1"},"→",-1)),o("span",V1,T(e.file.path),1)],64)):(i(),d(he,{key:1},[ke(T(e.file.path),1)],64))]),o("span",W1," @ "+T(l.value),1)]),o("button",{onClick:y[0]||(y[0]=C=>a("close")),class:"p-1 hover:bg-retro-dark rounded transition-colors flex-shrink-0 focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":"Close diff viewer",title:"Close (Esc)"},[Y(s(ht),{class:"w-5 h-5 text-retro-muted hover:text-retro-text"})])]),o("div",G1,[e.loading?(i(),d("div",q1,[...y[2]||(y[2]=[o("div",{class:"w-4 h-4 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),ke(" Loading diff... ",-1)])])):e.content&&e.content.binary?(i(),d("div",Z1,[...y[3]||(y[3]=[o("span",{class:"bg-retro-panel px-4 py-2 rounded font-mono"}," Binary file — cannot display diff ",-1)])])):e.content&&e.content.lines.length===0?(i(),d("div",K1,[...y[4]||(y[4]=[o("span",{class:"bg-retro-panel px-4 py-2 rounded font-mono"}," No changes in this file ",-1)])])):e.content?(i(),d("table",Y1,[o("tbody",null,[e.content.truncated?(i(),d("tr",X1,[...y[5]||(y[5]=[o("td",{colspan:"3",class:"px-4 py-2 text-retro-yellow bg-retro-panel text-center"}," Diff truncated — file has more than 10,000 lines ",-1)])])):P("",!0),(i(!0),d(he,null,Be(e.content.lines,(C,x)=>(i(),d("tr",{key:x,class:ve({"diff-add":C.type==="add","diff-delete":C.type==="delete","diff-context":C.type==="context","diff-header":C.type==="header"})},[C.type==="header"?(i(),d("td",Q1,T(C.content),1)):(i(),d(he,{key:1},[o("td",J1,T(C.oldLineNumber??""),1),o("td",ex,T(C.newLineNumber??""),1),o("td",tx,[C.type==="add"?(i(),d("span",nx,"+")):C.type==="delete"?(i(),d("span",ox,"-")):(i(),d("span",rx," ")),ke(" "+T(C.content),1)])],64))],2))),128))])])):(i(),d("div",sx," Failed to load diff content. "))])],544))}}),ix=Ko(ax,[["__scopeId","data-v-c726b0c5"]]),lx={class:"fixed inset-0 z-50 flex items-center justify-center"},cx={class:"relative w-[90vw] max-w-lg bg-retro-black border border-retro-border rounded-lg shadow-2xl flex flex-col overflow-hidden"},ux={class:"flex-shrink-0 h-12 flex items-center justify-between px-4 border-b border-retro-border bg-retro-dark"},dx={class:"flex items-center gap-2"},fx={class:"text-sm font-mono text-retro-text"},mx={class:"p-6 overflow-y-auto max-h-[70vh] space-y-6"},hx={key:0},px={class:"space-y-6"},vx={class:"space-y-1.5"},gx=["value","checked","onChange"],xx={class:"flex-1"},bx={class:"text-sm font-mono text-retro-text"},yx={class:"text-xs text-retro-muted leading-tight"},kx={class:"text-xs font-mono text-retro-muted"},wx={class:"text-xs text-retro-muted mb-3"},Cx=["disabled"],$x={class:"space-y-1.5"},Sx=["value","checked","onChange"],_x={class:"flex-1"},Mx={class:"text-sm font-mono text-retro-text"},Tx={class:"text-xs text-retro-muted leading-tight"},Ax={class:"flex items-center gap-4 px-3 py-2 rounded border border-retro-border bg-retro-panel"},Bx=["value"],Rx={class:"font-mono text-retro-cyan text-sm w-6 text-center"},Ex={key:1,class:"space-y-4"},Px={class:"space-y-1.5"},Dx=["checked"],Lx=["checked"],Ix=Ce({__name:"SettingsModal",emits:["close"],setup(e,{emit:n}){const t=n,a=Kn(),r=Dn(),l=S("main"),c=S(!1),f=[{value:"dark",label:"Dark",description:"Retro terminal theme with dark backgrounds"},{value:"light",label:"Light",description:"Bright theme for well-lit environments"}],h=[{value:"plan",label:An.plan,description:to.plan,icon:er,color:"text-retro-cyan"},{value:"ask",label:An.ask,description:to.ask,icon:nr,color:"text-retro-green"},{value:"auto",label:An.auto,description:to.auto,icon:Yo,color:"text-retro-yellow"},{value:"bypass",label:An.bypass,description:to.bypass,icon:or,color:"text-retro-red"}],{data:m,pending:y,error:C}=wr("ai-providers",()=>$fetch("/api/ai/providers"),{server:!1}),x=H(()=>m.value?.providers??[]),v=H(()=>{const p=C.value;return p?p instanceof Error?p.message:String(p):null}),{data:g,refresh:B}=wr("spec-search-status",()=>$fetch("/api/specs/status"),{server:!1,default:()=>null}),V=H(()=>{const p=g.value;return p?p.isIndexing?`Indexing (${p.currentJob||"running"})`:p.schedulerActive?`Indexed ${p.fileCount} files / ${p.chunkCount} chunks`:"Scheduler inactive":"Status unavailable"});st(()=>{a.hydrate()});const E=p=>{a.setProviderSelection(p),r.success("Settings saved")},fe=()=>{l.value="provider"},ce=()=>{l.value="main"},W=p=>{a.setTheme(p),r.success("Settings saved")},ue=p=>{a.setPermissionMode(p),r.success("Settings saved")},de=p=>{const u=parseInt(p.target.value,10);isNaN(u)||(a.setAutoModeConcurrency(u),r.success("Settings saved"))},le=p=>{a.setAutoGenerateCommitMessages(p),r.success("Settings saved")},re=()=>{t("close")},Z=async()=>{if(!c.value){c.value=!0;try{const p=await $fetch("/api/specs/reindex",{method:"POST",body:{}});!p.success&&p.status==="already-indexing"?r.info("Spec index is already running"):r.success("Spec reindex started"),await B()}catch(p){r.error(p instanceof Error?p.message:"Failed to start spec reindex")}finally{c.value=!1}}},z=p=>{p.key==="Escape"&&t("close")};st(()=>{window.addEventListener("keydown",z)}),_t(()=>{window.removeEventListener("keydown",z)});let N=null;return st(()=>{N=hr(()=>{B()},5e3)}),_t(()=>{N&&clearInterval(N)}),(p,u)=>(i(),ie(Jt,{to:"body"},[o("div",lx,[o("div",{class:"absolute inset-0 bg-black/70",onClick:re}),o("div",cx,[o("div",ux,[o("div",dx,[l.value==="provider"?(i(),d("button",{key:0,type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Back",onClick:ce},[Y(s(Vs),{class:"h-4 w-4"})])):P("",!0),o("h2",fx,T(l.value==="provider"?"AI Provider Settings":"Settings"),1)]),o("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close",onClick:u[0]||(u[0]=b=>t("close"))},[Y(s(ht),{class:"h-4 w-4"})])]),o("div",mx,[l.value==="main"?(i(),d("section",hx,[o("div",px,[o("section",null,[u[3]||(u[3]=o("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"Theme",-1)),u[4]||(u[4]=o("p",{class:"text-xs text-retro-muted mb-3"}," Choose between dark and light appearance. ",-1)),o("div",vx,[(i(),d(he,null,Be(f,b=>o("label",{key:b.value,class:ve(["flex items-center gap-3 px-3 py-2 rounded border cursor-pointer transition-colors",[s(a).theme===b.value?"border-retro-cyan bg-retro-cyan/10":"border-retro-border bg-retro-panel hover:border-retro-muted"]])},[o("input",{type:"radio",name:"theme",value:b.value,checked:s(a).theme===b.value,class:"w-3.5 h-3.5 text-retro-cyan accent-retro-cyan",onChange:j=>W(b.value)},null,40,gx),o("div",xx,[o("div",bx,T(b.label),1),o("div",yx,T(b.description),1)])],2)),64))])]),u[14]||(u[14]=o("div",{class:"border-t border-retro-border"},null,-1)),o("section",null,[u[6]||(u[6]=o("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"AI Provider",-1)),u[7]||(u[7]=o("p",{class:"text-xs text-retro-muted mb-3"}," Configure provider and model settings for new conversations. ",-1)),o("button",{type:"button",class:"w-full flex items-center justify-between px-3 py-2 rounded border border-retro-border bg-retro-panel hover:border-retro-muted transition-colors",onClick:fe},[u[5]||(u[5]=o("span",{class:"text-sm font-mono text-retro-text"},"Provider Settings",-1)),o("span",kx,T(s(a).providerSelection.providerId)+" / "+T(s(a).providerSelection.modelKey),1)])]),u[15]||(u[15]=o("div",{class:"border-t border-retro-border"},null,-1)),o("section",null,[u[8]||(u[8]=o("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"Spec Search Index",-1)),o("p",wx,T(V.value),1),o("button",{type:"button",class:"w-full flex items-center justify-center px-3 py-2 rounded border border-retro-border bg-retro-panel text-retro-text hover:border-retro-muted transition-colors disabled:opacity-60",disabled:c.value||s(g)?.isIndexing,onClick:Z},T(c.value?"Starting reindex...":"Reindex Specs"),9,Cx)]),u[16]||(u[16]=o("div",{class:"border-t border-retro-border"},null,-1)),o("section",null,[u[9]||(u[9]=o("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"Default Permission Mode",-1)),u[10]||(u[10]=o("p",{class:"text-xs text-retro-muted mb-3"}," Set the default permission mode for all new chat conversations. ",-1)),o("div",$x,[(i(),d(he,null,Be(h,b=>o("label",{key:b.value,class:ve(["flex items-center gap-3 px-3 py-2 rounded border cursor-pointer transition-colors",[s(a).permissionMode===b.value?"border-retro-cyan bg-retro-cyan/10":"border-retro-border bg-retro-panel hover:border-retro-muted"]])},[o("input",{type:"radio",name:"permission-mode",value:b.value,checked:s(a).permissionMode===b.value,class:"w-3.5 h-3.5 text-retro-cyan accent-retro-cyan",onChange:j=>ue(b.value)},null,40,Sx),(i(),ie(Rn(b.icon),{class:ve(["w-4 h-4 flex-shrink-0",b.color])},null,8,["class"])),o("div",_x,[o("div",Mx,T(b.label),1),o("div",Tx,T(b.description),1)])],2)),64))])]),u[17]||(u[17]=o("div",{class:"border-t border-retro-border"},null,-1)),o("section",null,[u[12]||(u[12]=o("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"Auto Mode",-1)),u[13]||(u[13]=o("p",{class:"text-xs text-retro-muted mb-3"}," Configure how many spec cascades can run in parallel during Auto Mode. ",-1)),o("div",Ax,[u[11]||(u[11]=o("label",{class:"font-mono text-retro-text text-sm whitespace-nowrap",for:"concurrency-modal"}," Concurrency ",-1)),o("input",{id:"concurrency-modal",type:"range",min:"1",max:"10",step:"1",value:s(a).autoModeConcurrency,class:"flex-1 accent-retro-cyan",onChange:de},null,40,Bx),o("span",Rx,T(s(a).autoModeConcurrency),1)])])])])):(i(),d("section",Ex,[u[18]||(u[18]=o("div",null,[o("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"AI Provider"),o("p",{class:"text-xs text-retro-muted mb-3"}," Choose which registered provider and model powers new conversations. ")],-1)),Y(Hs,{providers:x.value,selected:s(a).providerSelection,permissionMode:s(a).permissionMode,pending:s(y),errorMessage:v.value,onSelect:E},null,8,["providers","selected","permissionMode","pending","errorMessage"])])),u[23]||(u[23]=o("div",{class:"border-t border-retro-border"},null,-1)),o("section",null,[u[21]||(u[21]=o("h3",{class:"text-sm font-mono font-semibold text-retro-text mb-1"},"Commit Messages",-1)),u[22]||(u[22]=o("p",{class:"text-xs text-retro-muted mb-3"}," Choose whether to use AI to generate commit messages automatically. ",-1)),o("div",Px,[o("label",{class:ve(["flex items-center gap-3 px-3 py-2 rounded border cursor-pointer transition-colors",[s(a).autoGenerateCommitMessages?"border-retro-border bg-retro-panel hover:border-retro-muted":"border-retro-cyan bg-retro-cyan/10"]])},[o("input",{type:"radio",name:"commit-messages",value:!1,checked:!s(a).autoGenerateCommitMessages,class:"w-3.5 h-3.5 text-retro-cyan accent-retro-cyan",onChange:u[1]||(u[1]=b=>le(!1))},null,40,Dx),u[19]||(u[19]=o("div",{class:"flex-1"},[o("div",{class:"text-sm font-mono text-retro-text"},"Template (Recommended)"),o("div",{class:"text-xs text-retro-muted leading-tight"},"Simple template-based messages. No token usage.")],-1))],2),o("label",{class:ve(["flex items-center gap-3 px-3 py-2 rounded border cursor-pointer transition-colors",[s(a).autoGenerateCommitMessages?"border-retro-cyan bg-retro-cyan/10":"border-retro-border bg-retro-panel hover:border-retro-muted"]])},[o("input",{type:"radio",name:"commit-messages",value:!0,checked:s(a).autoGenerateCommitMessages,class:"w-3.5 h-3.5 text-retro-cyan accent-retro-cyan",onChange:u[2]||(u[2]=b=>le(!0))},null,40,Lx),u[20]||(u[20]=o("div",{class:"flex-1"},[o("div",{class:"text-sm font-mono text-retro-text"},"AI-Generated"),o("div",{class:"text-xs text-retro-muted leading-tight"},"Uses Claude Haiku to create meaningful commit messages. ~300-500 tokens per commit.")],-1))],2)])])])])])]))}}),Nx={class:"fixed top-4 right-4 z-50 flex flex-col gap-2 max-w-sm"},Fx={class:"flex-1 text-sm font-mono text-retro-text"},Hx=["onClick"],Ox=Ce({__name:"ToastContainer",setup(e){const{toasts:n,remove:t}=Dn(),a={success:{bg:"bg-retro-green/20",icon:"text-retro-green",border:"border-retro-green/50"},error:{bg:"bg-retro-red/20",icon:"text-retro-red",border:"border-retro-red/50"},info:{bg:"bg-retro-cyan/20",icon:"text-retro-cyan",border:"border-retro-cyan/50"},warning:{bg:"bg-retro-yellow/20",icon:"text-retro-yellow",border:"border-retro-yellow/50"}},r=l=>{switch(l){case"success":return go;case"error":return Ln;case"warning":return Cn;default:return sa}};return(l,c)=>(i(),ie(Jt,{to:"body"},[o("div",Nx,[Y(Es,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-x-4","enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 translate-x-4"},{default:Ge(()=>[(i(!0),d(he,null,Be(s(n),f=>(i(),d("div",{key:f.id,class:ve(["flex items-start gap-3 p-3 rounded-lg border shadow-lg",[a[f.type].bg,a[f.type].border]])},[(i(),ie(Rn(r(f.type)),{class:ve(["h-5 w-5 flex-shrink-0 mt-0.5",a[f.type].icon])},null,8,["class"])),o("p",Fx,T(f.message),1),o("button",{type:"button",class:"p-0.5 rounded text-retro-muted hover:text-retro-text transition-colors",onClick:h=>s(t)(f.id)},[Y(s(ht),{class:"h-4 w-4"})],8,Hx)],2))),128))]),_:1})])]))}});function Or(e){typeof document>"u"||(e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),document.cookie=`spec-cat-theme=${e};path=/;SameSite=Lax`)}function Ux(){const e=Kn(),n=H(()=>e.theme),t=H(()=>e.theme==="dark");function a(){const r=e.theme==="dark"?"light":"dark";e.setTheme(r),Or(r)}return Ae(()=>e.theme,r=>{Or(r)},{immediate:!0}),{theme:n,isDark:t,toggleTheme:a}}const jx={class:"flex h-screen min-w-[320px] overflow-x-auto bg-retro-black text-retro-text"},zx={class:"flex flex-col overflow-hidden",style:{flex:"3"}},Vx={class:"flex-shrink-0 h-14 flex items-center justify-between px-4 border-b border-retro-border bg-retro-panel"},Wx={class:"flex items-center gap-2 min-w-0"},Gx={key:0,class:"text-xs text-retro-muted font-mono truncate"},qx={class:"flex items-center gap-1"},Zx=["title"],Kx={class:"flex-1 min-h-0 overflow-y-auto"},Yx={key:0,class:"flex flex-col overflow-hidden border-l border-retro-border",style:{flex:"7"}},Xx={class:"flex flex-col overflow-hidden border-l border-retro-border",style:{flex:"2"}},Qx={class:"flex flex-col overflow-hidden border-l border-retro-border",style:{flex:"2"}},Jx={key:0,class:"flex flex-col overflow-hidden border-l border-retro-border",style:{flex:"3"}},e0={key:3,class:"fixed inset-0 z-40 flex flex-col bg-retro-black"},s0=Ce({__name:"default",setup(e){const n=Ss(),t=Kn(),a=mt(),r=Qn(),{isDark:l,toggleTheme:c}=Ux(),f=H(()=>r.diffViewerFile!==null),h=H(()=>n.isChatFullscreen),m=S(!1),y=S(""),C=H(()=>{if(!y.value)return"";const g=y.value.replace(/\/+$/,"").split("/");return g[g.length-1]||""}),x=H(()=>C.value?`spec cat :: ${C.value}`:"spec cat");Ps(()=>({title:x.value}));const v=()=>{typeof window<"u"&&n.updateViewport(window.innerWidth)};return st(async()=>{typeof window<"u"&&(n.updateViewport(window.innerWidth),window.addEventListener("resize",v)),await t.hydrate(),await a.initialize(),await a.loadConversations();try{const g=await $fetch("/api/cwd");y.value=g.cwd}catch{y.value=""}}),_t(()=>{typeof window<"u"&&window.removeEventListener("resize",v)}),(g,B)=>{const V=bm;return i(),d("div",jx,[o("div",zx,[o("div",Vx,[o("div",Wx,[B[4]||(B[4]=o("img",{alt:"SpecCat",src:ym,class:"w-5 h-5 text-retro-cyan mb-1"},null,-1)),B[5]||(B[5]=o("span",{class:"text-sm font-bold text-retro-cyan font-mono uppercase tracking-wider flex-shrink-0"},"SPECCAT",-1)),C.value?(i(),d("span",Gx,"/ "+T(C.value),1)):P("",!0)]),o("div",qx,[o("button",{type:"button",class:"p-2 rounded transition-colors text-retro-muted hover:text-retro-text hover:bg-retro-panel",title:s(l)?"Switch to light theme":"Switch to dark theme",onClick:B[0]||(B[0]=(...E)=>s(c)&&s(c)(...E))},[s(l)?(i(),ie(s(ua),{key:0,class:"w-5 h-5"})):(i(),ie(s(la),{key:1,class:"w-5 h-5"}))],8,Zx),o("button",{type:"button",class:"p-2 rounded transition-colors text-retro-muted hover:text-retro-text hover:bg-retro-panel",title:"Settings",onClick:B[1]||(B[1]=E=>m.value=!0)},[Y(s(Jr),{class:"w-5 h-5"})])])]),o("div",Kx,[Y(V,{"working-directory":y.value},null,8,["working-directory"])])]),f.value?(i(),d("div",Yx,[Y(ix,{file:s(r).diffViewerFile,"commit-hash":s(r).diffViewerCommitHash,content:s(r).diffViewerContent,loading:s(r).diffViewerLoading,onClose:B[2]||(B[2]=E=>s(r).closeFileDiff())},null,8,["file","commit-hash","content","loading"])])):(i(),d(he,{key:1},[o("div",Xx,[Y(Mh)]),o("div",Qx,[Y(xp)]),h.value?P("",!0):(i(),d("div",Jx,[Y(Hr)]))],64)),m.value?(i(),ie(Ix,{key:2,onClose:B[3]||(B[3]=E=>m.value=!1)})):P("",!0),Y(Ox),h.value?(i(),d("div",e0,[Y(Hr)])):P("",!0)])}}});export{s0 as default};