zen-code 4.8.3 → 4.8.5

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 (395) hide show
  1. package/dist/app.js +92 -98
  2. package/dist/{chunk-9kydh60d.js → chunk-06dj0dnz.js} +1 -1
  3. package/dist/chunk-0cbmnyee.js +1 -0
  4. package/dist/{chunk-bd35cx5s.js → chunk-0cknr23d.js} +1 -1
  5. package/dist/{chunk-ywp666sg.js → chunk-0jtrg9s1.js} +1 -1
  6. package/dist/{chunk-dhgjjhh7.js → chunk-0k9tc7ys.js} +1 -1
  7. package/dist/{chunk-h5k1z56v.js → chunk-0kan91hr.js} +1 -1
  8. package/dist/{chunk-yj27rmw2.js → chunk-0kvk3r1g.js} +1 -1
  9. package/dist/{chunk-ak0aqr2c.js → chunk-0x0r76m6.js} +1 -1
  10. package/dist/{chunk-fmmsa2ry.js → chunk-154dd94d.js} +2 -2
  11. package/dist/{chunk-w8vzpn90.js → chunk-17g5e3tb.js} +1 -1
  12. package/dist/{chunk-0qrqmmqt.js → chunk-1b02dwxw.js} +1 -1
  13. package/dist/{chunk-bngqptzm.js → chunk-1ck3yagm.js} +1 -1
  14. package/dist/{chunk-zpes0b8m.js → chunk-1fmdjx58.js} +1 -1
  15. package/dist/{chunk-tchg9ygq.js → chunk-1m8bmdzc.js} +1 -1
  16. package/dist/{chunk-e112438q.js → chunk-1tj3j2rd.js} +1 -1
  17. package/dist/{chunk-z0abvgpr.js → chunk-1xdz3wdt.js} +1 -1
  18. package/dist/{chunk-px75djc6.js → chunk-1xjj19pz.js} +1 -1
  19. package/dist/{chunk-7h9sjfmy.js → chunk-1z3yy9vz.js} +1 -1
  20. package/dist/{chunk-3p4khpea.js → chunk-1zbnmy0p.js} +1 -1
  21. package/dist/{chunk-cm6vfvym.js → chunk-21gm4tm7.js} +1 -1
  22. package/dist/{chunk-3dqan531.js → chunk-250846sw.js} +1 -1
  23. package/dist/{chunk-9dh8d15f.js → chunk-2a6kan82.js} +1 -1
  24. package/dist/{chunk-crvp4wnc.js → chunk-2cfemb9q.js} +1 -1
  25. package/dist/{chunk-5g0asgdm.js → chunk-2mrbrsta.js} +1 -1
  26. package/dist/chunk-2yk5xgha.js +1 -0
  27. package/dist/{chunk-97bsgfnr.js → chunk-2z60cf4h.js} +1 -1
  28. package/dist/{chunk-p6dgtz38.js → chunk-3009w43m.js} +1 -1
  29. package/dist/{chunk-arppjtcv.js → chunk-3acyh64g.js} +1 -1
  30. package/dist/{chunk-9ynmrc70.js → chunk-3b8scss4.js} +1 -1
  31. package/dist/{chunk-41hzdwnx.js → chunk-3d8rzv4d.js} +1 -1
  32. package/dist/{chunk-ajtch74a.js → chunk-3emyjvqg.js} +1 -1
  33. package/dist/{chunk-pnhf6jtr.js → chunk-3fp2k4jh.js} +3 -3
  34. package/dist/{chunk-0gpa9n28.js → chunk-3j3wmx6g.js} +1 -1
  35. package/dist/chunk-3rew4tyk.js +1 -0
  36. package/dist/{chunk-tpgf3t6p.js → chunk-3s3b7nzy.js} +1 -1
  37. package/dist/{chunk-x0qb9311.js → chunk-3w98g1h4.js} +1 -1
  38. package/dist/{chunk-w69pf8zx.js → chunk-45bkb77s.js} +2 -2
  39. package/dist/{chunk-pd4wysbn.js → chunk-4agrg21g.js} +1 -1
  40. package/dist/{chunk-gp1ensbx.js → chunk-4asb3qnd.js} +1 -1
  41. package/dist/{chunk-gtms11w9.js → chunk-4k15drqf.js} +1 -1
  42. package/dist/{chunk-6gxwe3hq.js → chunk-4vhwsrc0.js} +1 -1
  43. package/dist/{chunk-8m6adpjf.js → chunk-4yddzp8e.js} +1 -1
  44. package/dist/{chunk-jppcve2j.js → chunk-53agfxhn.js} +1 -1
  45. package/dist/{chunk-k7e2abhq.js → chunk-54kyvbh7.js} +1 -1
  46. package/dist/{chunk-98x8wkt6.js → chunk-558jjzha.js} +1 -1
  47. package/dist/{chunk-4j4w856j.js → chunk-56q8b04m.js} +1 -1
  48. package/dist/{chunk-501c35tf.js → chunk-59vj8mx3.js} +1 -1
  49. package/dist/chunk-5bvkhjg1.js +1 -0
  50. package/dist/{chunk-76gx2wc0.js → chunk-5m8gh94n.js} +1 -1
  51. package/dist/{chunk-gy4p2qnz.js → chunk-5n57csbz.js} +1 -1
  52. package/dist/{chunk-cyd358a8.js → chunk-5n6g25gc.js} +1 -1
  53. package/dist/{chunk-v8ag7wgx.js → chunk-5rmyjm7a.js} +1 -1
  54. package/dist/{chunk-77gv3r7z.js → chunk-5wkah698.js} +1 -1
  55. package/dist/{chunk-gpmj4w3z.js → chunk-63ncy5kr.js} +1 -1
  56. package/dist/{chunk-zkfa00mf.js → chunk-66sfgeag.js} +1 -1
  57. package/dist/{chunk-ypj2k2de.js → chunk-6ag9x0z1.js} +1 -1
  58. package/dist/{chunk-w895krdx.js → chunk-6bhkrdb2.js} +1 -1
  59. package/dist/{chunk-dvmzq40v.js → chunk-6cs4tf5a.js} +1 -1
  60. package/dist/{chunk-c1gpr8nz.js → chunk-6czm9v10.js} +1 -1
  61. package/dist/{chunk-djmxgj5c.js → chunk-6dm27qn5.js} +1 -1
  62. package/dist/{chunk-86exrje1.js → chunk-6eyx9kb0.js} +1 -1
  63. package/dist/{chunk-pr7vzg5y.js → chunk-6fsb1bxc.js} +1 -1
  64. package/dist/chunk-6mcx89fj.js +3 -0
  65. package/dist/{chunk-0dstjr38.js → chunk-6qbdcv3t.js} +1 -1
  66. package/dist/{chunk-ywas7wb8.js → chunk-6qyeer8n.js} +1 -1
  67. package/dist/{chunk-mvv3ktys.js → chunk-6r5npryc.js} +1 -1
  68. package/dist/{chunk-h8ay3dqc.js → chunk-6rhb6xym.js} +1 -1
  69. package/dist/{chunk-xk0abc6t.js → chunk-6vhg46d2.js} +1 -1
  70. package/dist/{chunk-7hvw60gp.js → chunk-6yb36qx6.js} +1 -1
  71. package/dist/{chunk-gh5vbn9x.js → chunk-72cdrnwv.js} +1 -1
  72. package/dist/{chunk-eh3cemzk.js → chunk-731nq1br.js} +1 -1
  73. package/dist/{chunk-03d08304.js → chunk-748hk53z.js} +1 -1
  74. package/dist/{chunk-dw3081wb.js → chunk-774cjjgt.js} +1 -1
  75. package/dist/{chunk-1dwn0qqb.js → chunk-77chzpqs.js} +1 -1
  76. package/dist/chunk-77qt7n70.js +1 -0
  77. package/dist/{chunk-f40x0w1g.js → chunk-7d4h6qkf.js} +1 -1
  78. package/dist/{chunk-n72x5y7a.js → chunk-7en8vahs.js} +1 -1
  79. package/dist/{chunk-6a35z43a.js → chunk-7k80bxbe.js} +1 -1
  80. package/dist/{chunk-h8de6gyf.js → chunk-7khjf5c1.js} +1 -1
  81. package/dist/{chunk-vyfvrrc8.js → chunk-7khrhe0x.js} +2 -2
  82. package/dist/{chunk-e2qmvzgm.js → chunk-7m0c57rj.js} +1 -1
  83. package/dist/{chunk-b6xencpw.js → chunk-7n5b43s8.js} +1 -1
  84. package/dist/{chunk-7dmms791.js → chunk-7pwrx1pp.js} +1 -1
  85. package/dist/{chunk-3mzwewcx.js → chunk-7v4352jx.js} +1 -1
  86. package/dist/chunk-7w75nxwb.js +1 -0
  87. package/dist/{chunk-pf09ha3g.js → chunk-7wa89vcy.js} +1 -1
  88. package/dist/{chunk-wtwgpw9g.js → chunk-7wxg0yef.js} +1 -1
  89. package/dist/chunk-7yf45m28.js +1 -0
  90. package/dist/{chunk-8kv8e5sn.js → chunk-7z7g35xf.js} +1 -1
  91. package/dist/chunk-82xzyhyv.js +1 -0
  92. package/dist/{chunk-z46zzhqf.js → chunk-87w9rexn.js} +1 -1
  93. package/dist/{chunk-2w2pzwmm.js → chunk-8arg48f8.js} +1 -1
  94. package/dist/{chunk-4s6z4724.js → chunk-8cbtae81.js} +1 -1
  95. package/dist/{chunk-62zhdx11.js → chunk-8ee7jvcr.js} +1 -1
  96. package/dist/{chunk-6rzyzk0g.js → chunk-8gm5e25z.js} +1 -1
  97. package/dist/{chunk-v3bw2mnd.js → chunk-8jhmnz2v.js} +1 -1
  98. package/dist/{chunk-rmrp92n9.js → chunk-8qh81vdm.js} +1 -1
  99. package/dist/{chunk-8chx87e7.js → chunk-8vr1wy0r.js} +1 -1
  100. package/dist/{chunk-6e734rff.js → chunk-917pj3vx.js} +1 -1
  101. package/dist/{chunk-8mmvxxyj.js → chunk-91gd665t.js} +1 -1
  102. package/dist/{chunk-50hw7e2n.js → chunk-9hnbyswz.js} +1 -1
  103. package/dist/{chunk-tamfhbc6.js → chunk-9hznfyjs.js} +1 -1
  104. package/dist/chunk-9mjq1xxc.js +1 -0
  105. package/dist/{chunk-3pqm74e3.js → chunk-9rmve4r4.js} +1 -1
  106. package/dist/{chunk-aqyqcpz2.js → chunk-a36ttbrq.js} +1 -1
  107. package/dist/{chunk-5gaygdyf.js → chunk-a4vdvjsr.js} +1 -1
  108. package/dist/{chunk-gqdapzfq.js → chunk-a51szmhp.js} +1 -1
  109. package/dist/{chunk-c1r7zjt3.js → chunk-ae57mcvq.js} +1 -1
  110. package/dist/{chunk-mcrmg4m8.js → chunk-aeajq5ft.js} +1 -1
  111. package/dist/{chunk-hxw717c2.js → chunk-aekjcqbv.js} +1 -1
  112. package/dist/{chunk-frzyyytq.js → chunk-ah557n6f.js} +1 -1
  113. package/dist/{chunk-psdrzwp5.js → chunk-am5r5ynh.js} +1 -1
  114. package/dist/{chunk-jam7nh0r.js → chunk-asdze5kz.js} +1 -1
  115. package/dist/{chunk-nt5n8jcr.js → chunk-av215sh3.js} +1 -1
  116. package/dist/chunk-b1czvr4n.js +1 -0
  117. package/dist/{chunk-ke9tpkk2.js → chunk-b3g51e2m.js} +1 -1
  118. package/dist/{chunk-72h39xc8.js → chunk-b4qvb571.js} +1 -1
  119. package/dist/{chunk-3s6j6d1z.js → chunk-bba2g9qj.js} +1 -1
  120. package/dist/{chunk-t0tznkac.js → chunk-be8bz8xh.js} +1 -1
  121. package/dist/{chunk-1ggv4msc.js → chunk-bjctrgpr.js} +1 -1
  122. package/dist/{chunk-2hjzw0cx.js → chunk-bjqn0pzz.js} +1 -1
  123. package/dist/{chunk-afdat9a4.js → chunk-bqzvv2dy.js} +1 -1
  124. package/dist/{chunk-8hp4t30w.js → chunk-bs9fj12n.js} +1 -1
  125. package/dist/{chunk-bf0pjbfa.js → chunk-bz79zq7h.js} +1 -1
  126. package/dist/{chunk-bwnx1zht.js → chunk-bzanqq7a.js} +1 -1
  127. package/dist/{chunk-xmp5jp4r.js → chunk-cayjw3gk.js} +1 -1
  128. package/dist/{chunk-fbf3gztk.js → chunk-ceb97hw6.js} +1 -1
  129. package/dist/{chunk-anbr96y3.js → chunk-cpvvtyt1.js} +1 -1
  130. package/dist/{chunk-4n978rje.js → chunk-crrspdy9.js} +2 -2
  131. package/dist/{chunk-wb0ms9q0.js → chunk-ctet86gc.js} +1 -1
  132. package/dist/{chunk-n9x46wsq.js → chunk-ctp90f8y.js} +1 -1
  133. package/dist/chunk-cv5akzkw.js +1 -0
  134. package/dist/{chunk-1mdbzd7e.js → chunk-denz6x2z.js} +1 -1
  135. package/dist/{chunk-jafhgffb.js → chunk-dnpybaez.js} +1 -1
  136. package/dist/{chunk-3pd9zqn2.js → chunk-dp2418kp.js} +1 -1
  137. package/dist/{chunk-vkfhjhhh.js → chunk-dv9rvc0a.js} +1 -1
  138. package/dist/{chunk-70gnwjt8.js → chunk-dz0229fs.js} +1 -1
  139. package/dist/{chunk-q3x300wy.js → chunk-e8pjcdmj.js} +1 -1
  140. package/dist/chunk-edkft0pe.js +1 -0
  141. package/dist/{chunk-xb46b3bf.js → chunk-eemwtwb1.js} +1 -1
  142. package/dist/{chunk-wk8sx9ev.js → chunk-ejh8spnd.js} +1 -1
  143. package/dist/{chunk-mjwypsrz.js → chunk-emjqnzzj.js} +1 -1
  144. package/dist/{chunk-w0me5x6g.js → chunk-esskh0ge.js} +1 -1
  145. package/dist/chunk-ewx6fr7a.js +1 -0
  146. package/dist/{chunk-pe45n68n.js → chunk-ewxacd5v.js} +1 -1
  147. package/dist/{chunk-bb9mvt9d.js → chunk-ez2xn1tq.js} +1 -1
  148. package/dist/{chunk-fcxgd3qb.js → chunk-ezh4rq18.js} +1 -1
  149. package/dist/{chunk-jy5kmp4s.js → chunk-f1gz54zs.js} +1 -1
  150. package/dist/chunk-f2p8rps5.js +1 -0
  151. package/dist/{chunk-emdn1c33.js → chunk-f3mf8qk2.js} +1 -1
  152. package/dist/{chunk-y3d9nwzf.js → chunk-f51sey9j.js} +1 -1
  153. package/dist/{chunk-8m5dqftt.js → chunk-f8c6jyrc.js} +1 -1
  154. package/dist/{chunk-5743qc09.js → chunk-fb70a9sy.js} +1 -1
  155. package/dist/{chunk-03bb6pab.js → chunk-fd4dk58v.js} +1 -1
  156. package/dist/{chunk-p2z2bacg.js → chunk-fdhzjb42.js} +1 -1
  157. package/dist/{chunk-trx18gxg.js → chunk-fftvnc8t.js} +1 -1
  158. package/dist/{chunk-f3jbz60e.js → chunk-ffzytaw1.js} +1 -1
  159. package/dist/{chunk-vxzscaap.js → chunk-fm3k6prw.js} +1 -1
  160. package/dist/{chunk-1163kxya.js → chunk-fs5s90mk.js} +1 -1
  161. package/dist/{chunk-s6t5vxm9.js → chunk-fvhtfw18.js} +1 -1
  162. package/dist/{chunk-te7k3eqj.js → chunk-gaw2bhff.js} +1 -1
  163. package/dist/{chunk-y3gfd4y3.js → chunk-gbrg4c7y.js} +1 -1
  164. package/dist/{chunk-n220pha2.js → chunk-gkhxerej.js} +1 -1
  165. package/dist/{chunk-j8b7x5pr.js → chunk-gps0pyf7.js} +1 -1
  166. package/dist/{chunk-xzpqbfjh.js → chunk-gs9s59d4.js} +1 -1
  167. package/dist/{chunk-45dyg3fv.js → chunk-gsnrqmzp.js} +1 -1
  168. package/dist/{chunk-y1f3hfaq.js → chunk-gvjvbwk6.js} +1 -1
  169. package/dist/{chunk-6v5eepr1.js → chunk-gxc7a8cz.js} +1 -1
  170. package/dist/{chunk-09f94dtz.js → chunk-h06hyckd.js} +1 -1
  171. package/dist/{chunk-85j75g9q.js → chunk-h0b5na4r.js} +1 -1
  172. package/dist/{chunk-1efcgvx0.js → chunk-h1bjeyn7.js} +1 -1
  173. package/dist/chunk-h5y1vfrx.js +1 -0
  174. package/dist/chunk-hbhwzk5x.js +2 -0
  175. package/dist/{chunk-2qx9kzj1.js → chunk-hgkaxnh7.js} +1 -1
  176. package/dist/{chunk-ksr76npa.js → chunk-hgs9vzm2.js} +1 -1
  177. package/dist/{chunk-q56ns9ta.js → chunk-hjs9ffqg.js} +1 -1
  178. package/dist/chunk-hmtm22t7.js +1 -0
  179. package/dist/{chunk-3s46q55v.js → chunk-hps6tv25.js} +2 -2
  180. package/dist/{chunk-mymqnpgf.js → chunk-hraqhe5e.js} +1 -1
  181. package/dist/{chunk-ehpz2t7m.js → chunk-htns6qnb.js} +1 -1
  182. package/dist/{chunk-9gnhztzd.js → chunk-hv4arqm5.js} +1 -1
  183. package/dist/{chunk-4ecfe9a1.js → chunk-hzqb4sy6.js} +1 -1
  184. package/dist/chunk-j0szwqey.js +1 -0
  185. package/dist/{chunk-p89xw4y2.js → chunk-j3tfxj8n.js} +1 -1
  186. package/dist/{chunk-eyty7ng4.js → chunk-j6s60n91.js} +1 -1
  187. package/dist/{chunk-v28dexnx.js → chunk-j7f3n1aj.js} +1 -1
  188. package/dist/{chunk-4tgv8687.js → chunk-j9za9ext.js} +1 -1
  189. package/dist/{chunk-1pm5qfkm.js → chunk-ja5m6q40.js} +1 -1
  190. package/dist/{chunk-nw76mbwc.js → chunk-jdvv96q7.js} +1 -1
  191. package/dist/{chunk-rxxn6qxm.js → chunk-jfecjzq0.js} +2 -2
  192. package/dist/{chunk-r9r1v9kw.js → chunk-jsqwhbbt.js} +1 -1
  193. package/dist/{chunk-b68ekt52.js → chunk-jyrs3ysr.js} +1 -1
  194. package/dist/{chunk-m8mdqeye.js → chunk-jz8tmenz.js} +1 -1
  195. package/dist/{chunk-4g796wg5.js → chunk-k17n7dpm.js} +1 -1
  196. package/dist/{chunk-0ch9bkct.js → chunk-k1yv7tpj.js} +1 -1
  197. package/dist/{chunk-9hkn5b8e.js → chunk-k4ftjnx7.js} +1 -1
  198. package/dist/{chunk-3tq80kwe.js → chunk-k626mmdc.js} +1 -1
  199. package/dist/{chunk-y5pf2d0x.js → chunk-k8ygzjvv.js} +1 -1
  200. package/dist/{chunk-yr48as8z.js → chunk-ka0pqrag.js} +1 -1
  201. package/dist/chunk-kbgd9vsz.js +1 -0
  202. package/dist/{chunk-7zprjevz.js → chunk-kc6rwv2m.js} +1 -1
  203. package/dist/{chunk-g9q5nbz0.js → chunk-kc8375a8.js} +1 -1
  204. package/dist/{chunk-28p35k17.js → chunk-kgj1ssyj.js} +1 -1
  205. package/dist/{chunk-323aj0k7.js → chunk-kk4w0prd.js} +1 -1
  206. package/dist/{chunk-tpyp8wqr.js → chunk-kkks4cbp.js} +1 -1
  207. package/dist/{chunk-6nhdwm44.js → chunk-kq7y5ybe.js} +1 -1
  208. package/dist/{chunk-kwgygr4z.js → chunk-kqemj8nq.js} +1 -1
  209. package/dist/chunk-kr6cv1mp.js +1 -0
  210. package/dist/{chunk-0mryaqgb.js → chunk-kx3dsqc5.js} +1 -1
  211. package/dist/{chunk-y971vkwy.js → chunk-kys8sc0j.js} +1 -1
  212. package/dist/{chunk-b9fn4n7z.js → chunk-m0e2jefq.js} +2 -2
  213. package/dist/{chunk-yxwramd1.js → chunk-m0vtra47.js} +1 -1
  214. package/dist/{chunk-1q8wzky6.js → chunk-m9xdbw2j.js} +1 -1
  215. package/dist/{chunk-3ns6c29z.js → chunk-mft6e1b3.js} +1 -1
  216. package/dist/{chunk-4qs8qf3g.js → chunk-mfyvxat8.js} +1 -1
  217. package/dist/{chunk-bwjh7xrm.js → chunk-mjfe9s8t.js} +1 -1
  218. package/dist/{chunk-rxs4gexg.js → chunk-mns6edxc.js} +1 -1
  219. package/dist/{chunk-ba18by4y.js → chunk-mrapdjm5.js} +2 -2
  220. package/dist/{chunk-p3mpqeqw.js → chunk-mrbn4knm.js} +1 -1
  221. package/dist/{chunk-znpdxhep.js → chunk-ms3sqsez.js} +1 -1
  222. package/dist/chunk-mtyqtnv0.js +1 -0
  223. package/dist/{chunk-g30bcqjk.js → chunk-mvb82v3n.js} +1 -1
  224. package/dist/{chunk-hvekwfwd.js → chunk-n08dw2ke.js} +1 -1
  225. package/dist/{chunk-3z87tvcn.js → chunk-n0sxg10w.js} +1 -1
  226. package/dist/chunk-n3xjke41.js +1 -0
  227. package/dist/{chunk-v1e0cwqh.js → chunk-n6v7menj.js} +1 -1
  228. package/dist/{chunk-63ghca0g.js → chunk-n8apqh5d.js} +1 -1
  229. package/dist/{chunk-51h1tm3c.js → chunk-n8f65qbg.js} +1 -1
  230. package/dist/{chunk-jmzy9per.js → chunk-n92ey5c2.js} +1 -1
  231. package/dist/{chunk-q9711zm8.js → chunk-nbkkf36e.js} +1 -1
  232. package/dist/chunk-ndk5mkc1.js +1 -0
  233. package/dist/{chunk-4zemyepb.js → chunk-nks89eba.js} +1 -1
  234. package/dist/{chunk-feptb1bb.js → chunk-nr26055z.js} +1 -1
  235. package/dist/{chunk-rc027n67.js → chunk-nrkhbe10.js} +1 -1
  236. package/dist/chunk-nvnw7mcb.js +1 -0
  237. package/dist/{chunk-0myk23dw.js → chunk-nwx5cbjc.js} +1 -1
  238. package/dist/{chunk-geyhpd32.js → chunk-ny61b4ve.js} +1 -1
  239. package/dist/{chunk-m7bwshtn.js → chunk-p7ha3t1f.js} +1 -1
  240. package/dist/{chunk-xh3gtpfd.js → chunk-pbe0n109.js} +1 -1
  241. package/dist/{chunk-n9zmzbyq.js → chunk-pc3w4gkp.js} +1 -1
  242. package/dist/{chunk-952k4ak8.js → chunk-pcwsyc9b.js} +1 -1
  243. package/dist/{chunk-v9b5r8aq.js → chunk-pj843s6s.js} +1 -1
  244. package/dist/chunk-pm5gceg0.js +1 -0
  245. package/dist/chunk-pp1gnpdp.js +298 -0
  246. package/dist/{chunk-86em0evs.js → chunk-pqq81gzv.js} +1 -1
  247. package/dist/chunk-pt1m6xh9.js +1 -0
  248. package/dist/{chunk-7pntzqpm.js → chunk-pvzfgkkq.js} +1 -1
  249. package/dist/{chunk-rv0x9fbs.js → chunk-pz4hhw24.js} +1 -1
  250. package/dist/{chunk-x0mnchxz.js → chunk-pz5xskrk.js} +1 -1
  251. package/dist/{chunk-y6vatv51.js → chunk-q0z3nkep.js} +1 -1
  252. package/dist/{chunk-kncs6js6.js → chunk-q6m1k4fq.js} +1 -1
  253. package/dist/{chunk-tv1kqdv9.js → chunk-qd2hkayk.js} +1 -1
  254. package/dist/{chunk-2kka9ex2.js → chunk-qf60gd6x.js} +1 -1
  255. package/dist/{chunk-tx71e422.js → chunk-qpwtcr53.js} +1 -1
  256. package/dist/{chunk-8nkp692y.js → chunk-qzy0w65x.js} +1 -1
  257. package/dist/{chunk-f6cbjh6q.js → chunk-r5crgj5q.js} +1 -1
  258. package/dist/{chunk-hzejh175.js → chunk-r5psjv6v.js} +1 -1
  259. package/dist/{chunk-s719ttj9.js → chunk-r9dm0gyn.js} +1 -1
  260. package/dist/{chunk-zb9wth64.js → chunk-r9qyzgns.js} +1 -1
  261. package/dist/{chunk-ty5eswjv.js → chunk-raq8eqd9.js} +1 -1
  262. package/dist/{chunk-sws9653v.js → chunk-rayth86k.js} +1 -1
  263. package/dist/{chunk-c1345z85.js → chunk-rbebjqfq.js} +1 -1
  264. package/dist/chunk-rc81vkve.js +1 -0
  265. package/dist/chunk-rg8hdkt2.js +1 -0
  266. package/dist/{chunk-1w5m9c5y.js → chunk-rqvxk3e5.js} +1 -1
  267. package/dist/{chunk-6meyz753.js → chunk-rsb82wcd.js} +1 -1
  268. package/dist/{chunk-yr04s6b7.js → chunk-rt7af3wp.js} +1 -1
  269. package/dist/chunk-rx707y69.js +1 -0
  270. package/dist/{chunk-25es8s2e.js → chunk-s22hm2jp.js} +1 -1
  271. package/dist/{chunk-qpkn7wvc.js → chunk-s2wchktz.js} +1 -1
  272. package/dist/{chunk-acceg8yk.js → chunk-s5yace4y.js} +1 -1
  273. package/dist/{chunk-yfasv01s.js → chunk-sd65hz9x.js} +1 -1
  274. package/dist/{chunk-pn04v4sv.js → chunk-sdhd2kpk.js} +1 -1
  275. package/dist/chunk-sepabvgd.js +1 -0
  276. package/dist/{chunk-4wmmjwq3.js → chunk-sk4n2anv.js} +1 -1
  277. package/dist/chunk-sq9spyfd.js +1 -0
  278. package/dist/{chunk-fs2mzcgs.js → chunk-sv97fsr8.js} +1 -1
  279. package/dist/chunk-sw6b067z.js +1 -0
  280. package/dist/chunk-t07nqvz2.js +1 -0
  281. package/dist/{chunk-j5e4dmw7.js → chunk-t4vfr2g0.js} +1 -1
  282. package/dist/{chunk-p70r0dds.js → chunk-t6x8a62a.js} +1 -1
  283. package/dist/chunk-t8djp78p.js +1 -0
  284. package/dist/{chunk-3c791dd5.js → chunk-tj729ry3.js} +1 -1
  285. package/dist/{chunk-nv58ta3s.js → chunk-tkp1zzgb.js} +1 -1
  286. package/dist/{chunk-msha9pw1.js → chunk-tq142qfa.js} +1 -1
  287. package/dist/{chunk-v3ta4qyy.js → chunk-tq7jpqr7.js} +1 -1
  288. package/dist/{chunk-3ek4pcr6.js → chunk-tqh0rjpp.js} +1 -1
  289. package/dist/{chunk-yz8sseev.js → chunk-tx117rah.js} +1 -1
  290. package/dist/{chunk-q86xqx6c.js → chunk-v3t7hcht.js} +1 -1
  291. package/dist/chunk-v5mgjgc4.js +8 -0
  292. package/dist/{chunk-v85y10pz.js → chunk-v9qb0fer.js} +1 -1
  293. package/dist/{chunk-m3zge9wv.js → chunk-vcsqkf9c.js} +1 -1
  294. package/dist/{chunk-yb2kp04v.js → chunk-vg853h8j.js} +1 -1
  295. package/dist/{chunk-ak43xwf1.js → chunk-vgeyt962.js} +1 -1
  296. package/dist/chunk-vqpam6p8.js +1 -0
  297. package/dist/chunk-vrv07424.js +1 -0
  298. package/dist/{chunk-c3b7gwkd.js → chunk-vsydmxfh.js} +1 -1
  299. package/dist/{chunk-ztpff54v.js → chunk-vwhxfs9r.js} +1 -1
  300. package/dist/{chunk-cd37w7qk.js → chunk-vy4ecvry.js} +1 -1
  301. package/dist/{chunk-n65ycayf.js → chunk-w46ermgd.js} +1 -1
  302. package/dist/{chunk-nbcah8mh.js → chunk-w5qvj179.js} +1 -1
  303. package/dist/{chunk-mfexzmw2.js → chunk-w93s735t.js} +1 -1
  304. package/dist/{chunk-g8k4dhcx.js → chunk-wb08g5z8.js} +1 -1
  305. package/dist/{chunk-vjvr9n6y.js → chunk-wb43p5km.js} +1 -1
  306. package/dist/{chunk-syme57ea.js → chunk-wb6xn1kx.js} +1 -1
  307. package/dist/{chunk-r1enj0f0.js → chunk-wbg38h5j.js} +1 -1
  308. package/dist/chunk-wcyrmfpn.js +1 -0
  309. package/dist/{chunk-7893pky5.js → chunk-wd17hcv5.js} +1 -1
  310. package/dist/{chunk-5n3h6mhr.js → chunk-wdm62dbr.js} +1 -1
  311. package/dist/{chunk-bh33p34p.js → chunk-wgamcpyt.js} +1 -1
  312. package/dist/{chunk-1a5zv67s.js → chunk-whdmep96.js} +1 -1
  313. package/dist/{chunk-0cz1ygrn.js → chunk-wkc7w10f.js} +1 -1
  314. package/dist/{chunk-51cf1nrg.js → chunk-wkf1j21b.js} +1 -1
  315. package/dist/{chunk-88191bqb.js → chunk-wm3z6khn.js} +1 -1
  316. package/dist/{chunk-z6rwg7bs.js → chunk-wqvqvv9e.js} +1 -1
  317. package/dist/{chunk-fcexqvhh.js → chunk-wvmnb75v.js} +1 -1
  318. package/dist/{chunk-4mw5szy1.js → chunk-wznpd7sd.js} +1 -1
  319. package/dist/{chunk-4vr7sc1e.js → chunk-x01t9e3q.js} +1 -1
  320. package/dist/{chunk-tvbj84md.js → chunk-x8z2fzz8.js} +1 -1
  321. package/dist/{chunk-2vtz4ypn.js → chunk-xa4apmpd.js} +1 -1
  322. package/dist/chunk-xf4jswm4.js +137 -0
  323. package/dist/{chunk-8evmvqza.js → chunk-xf7ypd1b.js} +1 -1
  324. package/dist/{chunk-t8w9hqaa.js → chunk-xhjrdhgk.js} +1 -1
  325. package/dist/{chunk-ek58k066.js → chunk-xjgnj3p0.js} +1 -1
  326. package/dist/{chunk-8tg10bhe.js → chunk-xjwkmvfz.js} +1 -1
  327. package/dist/{chunk-azxn0zvz.js → chunk-xkc2ktrh.js} +1 -1
  328. package/dist/{chunk-2gr7rdv0.js → chunk-xm9015v4.js} +1 -1
  329. package/dist/chunk-xnx0j1hw.js +1 -0
  330. package/dist/{chunk-b4fn3tre.js → chunk-y0e2ymas.js} +1 -1
  331. package/dist/{chunk-ak2n1ckf.js → chunk-y3c3xgca.js} +1 -1
  332. package/dist/{chunk-htgt048s.js → chunk-y6mvs6yw.js} +1 -1
  333. package/dist/{chunk-4z0wk36t.js → chunk-y6z502pz.js} +1 -1
  334. package/dist/{chunk-g0fa5dyc.js → chunk-ya599ak5.js} +2 -2
  335. package/dist/{chunk-p3p6a3ht.js → chunk-ycthcn27.js} +1 -1
  336. package/dist/{chunk-t32zj7ah.js → chunk-ydc7pd3b.js} +1 -1
  337. package/dist/{chunk-21w7a0t2.js → chunk-ydkkycp3.js} +2 -2
  338. package/dist/{chunk-stp38gza.js → chunk-yhxvqyz4.js} +1 -1
  339. package/dist/{chunk-k1kzp019.js → chunk-ymmavdfp.js} +2 -2
  340. package/dist/{chunk-cwvb8zr5.js → chunk-ynnaxz2z.js} +1 -1
  341. package/dist/{chunk-hgpmrbsr.js → chunk-ywa5z7d9.js} +1 -1
  342. package/dist/{chunk-mp6yhf6a.js → chunk-ywbbf9eh.js} +1 -1
  343. package/dist/{chunk-p46at2ts.js → chunk-yzk3bfzn.js} +1 -1
  344. package/dist/{chunk-5vzt6z7d.js → chunk-z0wdan61.js} +1 -1
  345. package/dist/{chunk-6r7b9pg1.js → chunk-z5z774pp.js} +1 -1
  346. package/dist/{chunk-sd6qvm4t.js → chunk-z88rcc8t.js} +1 -1
  347. package/dist/{chunk-t5z5e89a.js → chunk-zh77yp9z.js} +1 -1
  348. package/dist/{chunk-yx4mdqvf.js → chunk-zjemnf8v.js} +1 -1
  349. package/dist/{chunk-c5d87fzk.js → chunk-zmsq5xc7.js} +1 -1
  350. package/dist/{chunk-3b8bw2gg.js → chunk-zqxrtejz.js} +1 -1
  351. package/dist/{chunk-04kzaj7h.js → chunk-zssv316b.js} +46 -46
  352. package/dist/{chunk-91rrbsk7.js → chunk-zytr7a4n.js} +1 -1
  353. package/dist/cli.js +1 -1
  354. package/dist/nonInteractive.js +1 -1
  355. package/dist/zen-keyboard.js +1 -1
  356. package/package.json +2 -1
  357. package/dist/chunk-0bpvpy2e.js +0 -1
  358. package/dist/chunk-0gb5n1jp.js +0 -1
  359. package/dist/chunk-13f0qh77.js +0 -1
  360. package/dist/chunk-17zj2hd5.js +0 -1
  361. package/dist/chunk-2m3g6fah.js +0 -1
  362. package/dist/chunk-40fxbk0k.js +0 -1
  363. package/dist/chunk-4pa2a33z.js +0 -1
  364. package/dist/chunk-6ezeq351.js +0 -1
  365. package/dist/chunk-6hbnk94n.js +0 -1
  366. package/dist/chunk-80jab8dy.js +0 -1
  367. package/dist/chunk-9c0wnb5t.js +0 -1
  368. package/dist/chunk-9dn65rqp.js +0 -1
  369. package/dist/chunk-bfm294j1.js +0 -1
  370. package/dist/chunk-cegx2zze.js +0 -1
  371. package/dist/chunk-crjf70s3.js +0 -1
  372. package/dist/chunk-d08qq3wd.js +0 -1
  373. package/dist/chunk-d9xgby9w.js +0 -1
  374. package/dist/chunk-e2vdc3vs.js +0 -1
  375. package/dist/chunk-g1yt0qc9.js +0 -1
  376. package/dist/chunk-gphyz2x3.js +0 -1
  377. package/dist/chunk-jh6wwc9v.js +0 -1
  378. package/dist/chunk-jhjbxj1k.js +0 -1
  379. package/dist/chunk-jhwm3phf.js +0 -1
  380. package/dist/chunk-k97swe5s.js +0 -1
  381. package/dist/chunk-ksy4d0za.js +0 -1
  382. package/dist/chunk-mr7em8w4.js +0 -1
  383. package/dist/chunk-mrkf2b3t.js +0 -434
  384. package/dist/chunk-ncs4rnsn.js +0 -1
  385. package/dist/chunk-r0gjpz5m.js +0 -1
  386. package/dist/chunk-rvxb17kx.js +0 -1
  387. package/dist/chunk-s6xjfvvd.js +0 -1
  388. package/dist/chunk-shc3fcge.js +0 -1
  389. package/dist/chunk-ss233wsa.js +0 -1
  390. package/dist/chunk-t97kks4j.js +0 -1
  391. package/dist/chunk-ts98e90r.js +0 -1
  392. package/dist/chunk-vgvekk29.js +0 -1
  393. package/dist/chunk-x7g4cwft.js +0 -1
  394. package/dist/chunk-yctck6wf.js +0 -1
  395. package/dist/chunk-zqx4fcfe.js +0 -2
package/dist/app.js CHANGED
@@ -1,10 +1,10 @@
1
- import{Y as _5,Z as w5}from"./chunk-1w5m9c5y.js";import{$ as t,_ as tY,aa as ZZ,ba as FZ,ca as CJ,da as WZ,ea as b1}from"./chunk-w69pf8zx.js";import{fa as a8,ga as Z5,ha as bJ,ia as bZ,ja as s0,ka as T1,la as G1,ma as gY,na as uZ,oa as d0}from"./chunk-c1gpr8nz.js";import{pa as g8,qa as X8,ra as r8,ta as H1,ua as K1,va as jZ}from"./chunk-b9fn4n7z.js";import{wa as UZ,xa as f1}from"./chunk-k1kzp019.js";import{Ba as z8,Ca as hY,Ea as xY,ya as U8,za as RW}from"./chunk-vyfvrrc8.js";import{Ga as p0,Ha as dY,Ia as lZ,Ka as dZ,La as lY,Ma as N4}from"./chunk-fmmsa2ry.js";import"./chunk-ba18by4y.js";import"./chunk-21w7a0t2.js";import{Wa as w4,Xa as W4}from"./chunk-xh3gtpfd.js";import{$a as K8,Ya as x,Za as N,_a as O,ab as SY,cb as c8,db as K4,eb as mZ,fb as v,gb as oZ,ib as u4,kb as V1,lb as PJ}from"./chunk-04kzaj7h.js";import{sb as R8}from"./chunk-3s46q55v.js";import{tb as J5,ub as G5,vb as W5,wb as $5,xb as Y5}from"./chunk-mrkf2b3t.js";import"./chunk-pnhf6jtr.js";import"./chunk-y5pf2d0x.js";import"./chunk-v28dexnx.js";import"./chunk-4n978rje.js";import"./chunk-wtwgpw9g.js";import"./chunk-vkfhjhhh.js";import"./chunk-0gpa9n28.js";import{gc as L,ic as B7,jc as q$,kc as q}from"./chunk-feptb1bb.js";class x8{renderers=new Map;register(Z,Y){this.renderers.set(Z,Y)}get(Z){return this.renderers.get(Z)}has(Z){return this.renderers.has(Z)}list(){return Array.from(this.renderers.keys())}unregister(Z){this.renderers.delete(Z)}clear(){this.renderers.clear()}}var E4;var o0=q$(()=>{E4=new x8});var G8=L(v(),1),j1=new U8({defaultOptions:{queries:{retry:(Z,Y)=>{if(Y instanceof TypeError&&Y.message.includes("fetch"))return Z<2;return!1},refetchOnWindowFocus:!1,refetchOnMount:!0,refetchOnReconnect:!1,staleTime:300000,gcTime:600000,networkMode:"online"},mutations:{retry:1,networkMode:"online"}}});function H8({children:Z}){return G8.jsxDEV(z8,{client:j1,children:Z},void 0,!1,void 0,this)}var O8={async search(Z){let Y=Object.entries(p0).map(([$,K])=>({assistant_id:$,graph_id:$,config:{},metadata:{},version:1,name:$,description:"",created_at:new Date().toISOString(),updated_at:new Date().toISOString()}));if(Z?.graphId)Y=Y.filter(($)=>$.graph_id===Z.graphId);if(Z?.metadata&&Object.keys(Z.metadata).length>0)Y=Y.filter(($)=>{return Object.entries(Z.metadata).every(([K,W])=>{return $.metadata&&$.metadata[K]===W})});if(Z?.sortBy)Y.sort(($,K)=>{let W=$[Z.sortBy],U=K[Z.sortBy],z=W<U?-1:W>U?1:0;return Z.sortOrder==="desc"?-z:z});let X=Z?.offset??0,J=Z?.limit;return J?Y.slice(X,X+J):Y.slice(X)},async count(Z){return(await this.search(Z)).length},async get(Z){if(!Object.entries(p0).find(([X,J])=>X===Z))throw Error(`Assistant not found: ${Z}`);return{assistant_id:Z,graph_id:Z,config:{},created_at:new Date().toISOString(),updated_at:new Date().toISOString(),metadata:{},version:1,name:Z,description:""}},async delete(Z){throw Error("Deleting assistants is not supported. Assistants are generated from registered graphs.")},async update(Z,Y){throw Error("Updating assistants is not supported. Assistants are generated from registered graphs.")},async getGraph(Z,Y){let X={};return(await(await lZ(Z,X)).getGraphAsync({...X,xray:Y?.xray??void 0})).toJSON()},async getSchemas(Z){let X=(await lZ(Z,{})).builder;return console.log(X),{graph_id:Z,state_schema:X._inputDefinition,input_schema:X._inputDefinition,output_schema:X._outputDefinition,config_schema:X._configSchema,context_schema:X._configSchema}},async getVersions(Z,Y){let X=await this.get(Z),J=Y?.offset??0,Q=Y?.limit;return Q?[X].slice(J,J+Q):[X].slice(J)},async setLatest(Z,Y){let X=await this.get(Z);return X.version=Y,X},async create(Z){if(console.warn("⚠️ Creating assistants is not supported. Assistants are generated from registered graphs. Returning mock data."),!Object.keys(p0).includes(Z.graphId)){if(Z.ifExists==="raise")throw Error(`Graph not found: ${Z.graphId}`)}return{assistant_id:Z.assistantId||Z.graphId,graph_id:Z.graphId,name:Z.name||Z.graphId,description:Z.description||"",metadata:Z.metadata||{},config:Z.config||{},version:1,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}}},cY=()=>{let Z=()=>{return dZ.globalThreadsManager};return{assistants:O8,get threads(){return dZ.globalThreadsManager},runs:{list(Y,X){return Z().listRuns(Y,X)},async cancel(Y,X,J,Q){return await dZ.globalMessageQueue.cancelQueue(X)},async*stream(Y,X,J){J.config={...J.config??{},configurable:{...J.config?.configurable??{},graph_id:X,thread_id:Y}};let Q=Z();for await(let $ of N4(Q,Q.createRun(Y,X,J),J,{attempt:0,getGraph:lZ}))yield $},async*joinStream(Y,X,J){let Q=J&&typeof J==="object"&&"signal"in J?J:{},$=(J instanceof AbortSignal?J:Q.signal)||new AbortController().signal,K=null,W=null;try{K=await dZ.globalMessageQueue.getQueue(X);let U=await K.getAll();for(let z of U){if($.aborted)return;if(yield{id:z.id,event:z.event,data:z.data},z.event==="__stream_end__"||z.event==="__stream_error__"||z.event==="__stream_cancel__")return}W=K.onDataReceive();for await(let z of W){if($.aborted)break;let{event:H,data:G}=z;if(yield{id:z.id,event:H,data:G},z.event==="__stream_end__"||z.event==="__stream_error__"||z.event==="__stream_cancel__")break}}catch(U){if(!(U instanceof Error)||!U.message.includes("does not exist"))console.warn("Join stream failed:",U)}finally{if(W)try{await W.return(void 0)}catch(U){}}}}}};import{entrypoint as m2,getPreviousState as p2,getConfig as c2,Command as d2}from"@langchain/langgraph";import{schemaMetaRegistry as i2}from"@langchain/langgraph/zod";import{z as JZ}from"zod";var x4=(Z,Y)=>Z.constructor.name===Y.name,LZ=new Map;LZ.set(JZ.ZodBoolean.name,()=>!1),LZ.set(JZ.ZodNumber.name,()=>0),LZ.set(JZ.ZodString.name,()=>""),LZ.set(JZ.ZodArray.name,()=>[]),LZ.set(JZ.ZodRecord.name,()=>({})),LZ.set(JZ.ZodDefault.name,(Z)=>Z.def.defaultValue),LZ.set(JZ.ZodPipe.name,(Z)=>_0(Z.def.in)),LZ.set(JZ.ZodOptional.name,(Z)=>x4(Z.def.innerType,JZ.ZodDefault)?Z.def.innerType.def.defaultValue:void 0),LZ.set(JZ.ZodTuple.name,(Z)=>{let Y=[];for(let X of Z.def.items)Y.push(_0(X));return Y}),LZ.set(JZ.ZodPipe.name,(Z)=>_0(Z.def.in)),LZ.set(JZ.ZodUnion.name,(Z)=>_0(Z.def.options[0])),LZ.set(JZ.ZodObject.name,(Z)=>g4(Z)),LZ.set(JZ.ZodRecord.name,(Z)=>g4(Z)),LZ.set(JZ.ZodIntersection.name,(Z)=>g4(Z));function _0(Z){let Y=Z.constructor.name;if(!LZ.has(Y)){console.warn("getSchemaDefaultForField: Unhandled type",Z.constructor.name);return}return LZ.get(Y)(Z)}function g4(Z){if(x4(Z,JZ.ZodRecord))return{};if(x4(Z,JZ.ZodPipe))return g4(Z.def.in);if(x4(Z,JZ.ZodIntersection))return{...g4(Z.def.left),...g4(Z.def.right)};if(x4(Z,JZ.ZodUnion)){for(let Y of Z.def.options)if(x4(Y,JZ.ZodObject))return g4(Y);return console.warn("getSchemaDefaultObject: No object found in union, returning empty object"),{}}return x4(Z,JZ.ZodObject)?Object.fromEntries(Object.entries(Z.shape).map(([Y,X])=>[Y,_0(X)]).filter((Y)=>Y[1]!==void 0)):(console.warn(`getSchemaDefaultObject: Expected object schema, got ${Z.constructor.name}`),{})}import{tool as n2,HumanMessage as a2}from"langchain";import{z as _4}from"zod";var t2=_4.object({task_store:_4.record(_4.string(),_4.any()).default({})}),e2=_4.object({task_id:_4.string().optional().describe("The task id to ask the subagent, if not provided, will use the tool call id"),subagent_id:_4.string(),task_description:_4.string().describe("Describe the user state and what you want the subagent to do."),data_transfer:_4.any().optional().describe("Data to transfer to the subagent.")});import w from"zod";var h=cY(),S1=w.object({thread_id:w.string().optional(),thread_ts:w.string().optional()}).catchall(w.unknown()),X0=w.object({tags:w.array(w.string()).optional(),recursion_limit:w.number().int().optional(),configurable:S1.optional()}).catchall(w.unknown()).describe("The configuration of an assistant.");w.object({assistant_id:w.string(),graph_id:w.string(),config:X0,created_at:w.string(),updated_at:w.string(),metadata:w.object({}).catchall(w.any())});var $4=w.object({source:w.union([w.literal("input"),w.literal("loop"),w.literal("update"),w.string()]).optional(),step:w.number().optional(),writes:w.any().nullable().optional(),parents:w.any().optional()}).catchall(w.unknown()),q8=w.object({node:w.string(),input:w.unknown().optional()}),iY=w.object({update:w.union([w.any(),w.array(w.tuple([w.string(),w.any()]))]).nullable().optional(),resume:w.unknown().optional(),goto:w.union([q8,w.array(q8),w.string(),w.array(w.string())]).optional()});w.object({limit:w.number().int().optional(),offset:w.number().int().optional()});var VZ=w.object({thread_id:w.string()}),w0=w.object({thread_id:w.string(),run_id:w.string()}),y1=w.object({graph_id:w.string().optional(),metadata:$4.optional(),limit:w.number().int().optional(),offset:w.number().int().optional(),sort_by:w.enum(["assistant_id","graph_id","name","created_at","updated_at"]).optional(),sort_order:w.enum(["asc","desc"]).optional()}),k1=w.object({graph_id:w.string().optional(),metadata:$4.optional()}),h1=w.object({xray:w.union([w.string(),w.boolean(),w.number()]).optional()}),F8=w.object({name:w.string().optional(),description:w.string().optional(),metadata:$4.optional(),config:X0.optional()}).optional(),x1=w.object({assistant_id:w.string().optional(),graph_id:w.string().describe("The ID of graph to create an assistant from."),name:w.string().optional(),description:w.string().optional(),metadata:$4.optional(),config:X0.optional(),if_exists:w.enum(["raise","do_nothing"]).optional()}),g1=w.object({assistant_id:w.union([w.string(),w.string()]),checkpoint_id:w.string().optional(),input:w.any().optional(),command:iY.optional(),metadata:$4.optional(),config:X0.optional(),webhook:w.string().optional(),interrupt_before:w.union([w.literal("*"),w.array(w.string())]).optional(),interrupt_after:w.union([w.literal("*"),w.array(w.string())]).optional(),on_disconnect:w.enum(["cancel","continue"]).optional().default("continue"),multitask_strategy:w.enum(["reject","rollback","interrupt","enqueue"]).optional(),stream_mode:w.array(w.enum(["values","messages","messages-tuple","updates","events","debug","custom"])).optional(),stream_subgraphs:w.boolean().optional(),stream_resumable:w.boolean().optional(),after_seconds:w.number().optional(),if_not_exists:w.enum(["create","reject"]).optional(),on_completion:w.enum(["complete","continue"]).optional(),feedback_keys:w.array(w.string()).optional(),langsmith_tracer:w.unknown().optional()}).describe("Payload for creating a stateful run."),u1=w.object({limit:w.coerce.number().int().optional().default(10),offset:w.coerce.number().int().optional().default(0),status:w.enum(["pending","running","error","success","timeout","interrupted"]).optional()}),m1=w.object({wait:w.coerce.boolean().optional().default(!1),action:w.enum(["interrupt","rollback"]).optional().default("interrupt")}),p1=w.object({cancel_on_disconnect:w.coerce.boolean().optional().default(!1),last_event_id:w.string().optional(),stream_mode:w.enum(["values","messages","messages-tuple","updates","events","debug","custom"]).optional()}),c1=w.object({thread_id:w.string().describe("The ID of thread. If not provided, an ID is generated.").optional(),metadata:$4.optional(),if_exists:w.union([w.literal("raise"),w.literal("do_nothing")]).optional()}).describe("Payload for creating a thread."),M8=w.object({ids:w.array(w.string()).describe("List of thread IDs to include. Others are excluded.").optional(),metadata:$4.describe("Metadata to search for.").optional(),status:w.enum(["idle","busy","interrupted","error"]).describe("Filter by thread status.").optional(),values:w.any().describe("Filter by thread values.").optional(),limit:w.number().int().gte(1).lte(1000).describe("Maximum number to return.").optional(),offset:w.number().int().gte(0).describe("Offset to start from.").optional(),sort_by:w.enum(["thread_id","status","created_at","updated_at"]).describe("Sort by field.").optional(),sort_order:w.enum(["asc","desc"]).describe("Sort order.").optional(),select:w.array(w.enum(["thread_id","created_at","updated_at","metadata","config","context","status","values","interrupts"])).describe("Specify which fields to return. If not provided, all fields are returned.").optional(),without_details:w.boolean().describe("Whether to return values.").optional()}).describe("Payload for listing threads.");w.object({values:w.union([w.record(w.string(),w.unknown()),w.array(w.record(w.string(),w.unknown()))]).nullish()}).describe("Payload for adding state to a thread.");var d1=w.object({metadata:$4.optional(),status:w.enum(["idle","busy","interrupted","error"]).optional(),values:w.any().optional()}).describe("Payload for patching a thread."),N8=w.object({assistant_id:w.string(),input:w.any().optional(),command:iY.optional(),metadata:$4.optional(),config:X0.optional(),webhook:w.string().optional(),interrupt_before:w.union([w.literal("*"),w.array(w.string())]).optional(),interrupt_after:w.union([w.literal("*"),w.array(w.string())]).optional(),on_disconnect:w.enum(["cancel","continue"]).optional().default("continue"),multitask_strategy:w.enum(["reject","rollback","interrupt","enqueue"]).optional(),stream_mode:w.array(w.enum(["values","messages","messages-tuple","updates","events","debug","custom"])).optional(),stream_subgraphs:w.boolean().optional(),stream_resumable:w.boolean().optional(),after_seconds:w.number().optional(),if_not_exists:w.enum(["create","reject"]).optional(),on_completion:w.enum(["complete","continue"]).optional(),feedback_keys:w.array(w.string()).optional(),langsmith_tracer:w.unknown().optional()}).describe("Payload for creating a run (background/wait)."),l1=w.object({cancel_on_disconnect:w.coerce.boolean().optional().default(!1)}),i1=w.object({cancel_on_disconnect:w.coerce.boolean().optional().default(!1)}),c0=w.object({assistant_id:w.string().describe("The assistant ID or graph name to run."),input:w.any().optional().describe("The input to the graph."),command:iY.optional(),metadata:$4.optional().describe("Metadata to assign to the run."),config:X0.optional(),context:w.object({}).catchall(w.any()).optional().describe("Static context added to the assistant."),webhook:w.string().optional(),interrupt_before:w.union([w.literal("*"),w.array(w.string())]).optional(),interrupt_after:w.union([w.literal("*"),w.array(w.string())]).optional(),stream_mode:w.union([w.enum(["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]),w.array(w.enum(["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]))]).optional().default(["values"]),feedback_keys:w.array(w.string()).optional(),stream_subgraphs:w.boolean().optional().default(!1),stream_resumable:w.boolean().optional().default(!1)}).describe("Payload for creating a stateless run."),r1=w.array(c0).min(1).describe("Payload for creating a batch of stateless runs."),o1=w.object({action:w.enum(["interrupt","rollback"]).optional().default("interrupt").describe("Action to take when cancelling the run."),wait:w.coerce.boolean().optional().default(!1)}),n1=w.union([w.object({status:w.enum(["pending","running","all"]).describe("Filter runs by status to cancel.")}),w.object({thread_id:w.string().describe("The ID of the thread containing runs to cancel.")}),w.object({run_ids:w.array(w.string()).min(1).describe("List of run IDs to cancel.")})]);function KZ(Z,Y){let X=Y.split("/").filter(($)=>$),J=new URL(Z).pathname.split("/").filter(($)=>$),Q={};return X.forEach(($,K)=>{if($.startsWith(":")){let W=$.slice(1);Q[W]=J[K]}}),Q}function iZ(Z){let Y=new URL(Z).searchParams,X={};return Y.forEach((J,Q)=>{if(!isNaN(Number(J))&&J!=="")X[Q]=Number(J);else if(J==="true"||J==="false")X[Q]=J==="true";else X[Q]=J}),X}function S(Z,Y){let X=Z.safeParse(Y);if(!X.success)throw new rY(X.error.issues);return X.data}class rY extends Error{errors;constructor(Z){super("Validation failed");this.name="ValidationError",this.errors=Z}}function m(Z,Y=200,X){return new Response(JSON.stringify(Z),{status:Y,headers:{"Content-Type":"application/json",...X}})}function k(Z,Y=500){if(Z instanceof rY)return m({error:"Validation Error",details:Z.errors},400);return m({error:Z instanceof Error?Z.message:"Unknown error"},Y)}function oY(Z){let Y,X=!1,J=new AbortController,Q=new ReadableStream({async start($){Y=$;let K=new TextEncoder,W={signal:J.signal,writeSSE:async({data:U,event:z,id:H})=>{if(X||J.signal.aborted)return;try{let G="";if(H)G+=`id: ${H}
1
+ import{Y as _5,Z as A5}from"./chunk-rqvxk3e5.js";import{$ as V1,_ as r}from"./chunk-v5mgjgc4.js";import{aa as eY,ba as t,ca as ZZ,da as FZ,ea as PJ,fa as WZ,ga as b1}from"./chunk-45bkb77s.js";import{ha as a8,ia as Z5,ja as VJ,ka as c4,la as t0,ma as T1,na as z1,oa as uY,pa as xZ,qa as l0}from"./chunk-6czm9v10.js";import{ra as g8,sa as J8,ta as r8,va as U1,wa as Q1,xa as TZ}from"./chunk-m0e2jefq.js";import{ya as UZ,za as f1}from"./chunk-ymmavdfp.js";import{Aa as U8,Ba as RW,Da as z8,Ea as xY,Ga as gY}from"./chunk-7khrhe0x.js";import{Ia as d0,Ja as lY,Ka as cZ,Ma as dZ,Na as iY,Oa as F4}from"./chunk-154dd94d.js";import"./chunk-mrapdjm5.js";import"./chunk-ydkkycp3.js";import{Ya as N4,Za as U4}from"./chunk-pbe0n109.js";import{$a as _,_a as g,ab as O,bb as K8,cb as yY,eb as d8,fb as W4,gb as uZ,hb as I,ib as iZ,kb as u4,mb as D1,nb as BJ}from"./chunk-zssv316b.js";import{ub as R8}from"./chunk-hps6tv25.js";import{vb as J5}from"./chunk-pp1gnpdp.js";import{Ab as Y5,xb as G5,yb as W5,zb as $5}from"./chunk-xf4jswm4.js";import"./chunk-3fp2k4jh.js";import"./chunk-k8ygzjvv.js";import"./chunk-j7f3n1aj.js";import"./chunk-crrspdy9.js";import"./chunk-7wxg0yef.js";import"./chunk-dv9rvc0a.js";import"./chunk-3j3wmx6g.js";import{lc as P,nc as B7,oc as q$,pc as q}from"./chunk-nr26055z.js";class x8{renderers=new Map;register(Z,Y){this.renderers.set(Z,Y)}get(Z){return this.renderers.get(Z)}has(Z){return this.renderers.has(Z)}list(){return Array.from(this.renderers.keys())}unregister(Z){this.renderers.delete(Z)}clear(){this.renderers.clear()}}var D4;var n0=q$(()=>{D4=new x8});var G8=P(I(),1),j1=new U8({defaultOptions:{queries:{retry:(Z,Y)=>{if(Y instanceof TypeError&&Y.message.includes("fetch"))return Z<2;return!1},refetchOnWindowFocus:!1,refetchOnMount:!0,refetchOnReconnect:!1,staleTime:300000,gcTime:600000,networkMode:"online"},mutations:{retry:1,networkMode:"online"}}});function H8({children:Z}){return G8.jsxDEV(z8,{client:j1,children:Z},void 0,!1,void 0,this)}var O8={async search(Z){let Y=Object.entries(d0).map(([$,K])=>({assistant_id:$,graph_id:$,config:{},metadata:{},version:1,name:$,description:"",created_at:new Date().toISOString(),updated_at:new Date().toISOString()}));if(Z?.graphId)Y=Y.filter(($)=>$.graph_id===Z.graphId);if(Z?.metadata&&Object.keys(Z.metadata).length>0)Y=Y.filter(($)=>{return Object.entries(Z.metadata).every(([K,U])=>{return $.metadata&&$.metadata[K]===U})});if(Z?.sortBy)Y.sort(($,K)=>{let U=$[Z.sortBy],W=K[Z.sortBy],z=U<W?-1:U>W?1:0;return Z.sortOrder==="desc"?-z:z});let X=Z?.offset??0,J=Z?.limit;return J?Y.slice(X,X+J):Y.slice(X)},async count(Z){return(await this.search(Z)).length},async get(Z){if(!Object.entries(d0).find(([X,J])=>X===Z))throw Error(`Assistant not found: ${Z}`);return{assistant_id:Z,graph_id:Z,config:{},created_at:new Date().toISOString(),updated_at:new Date().toISOString(),metadata:{},version:1,name:Z,description:""}},async delete(Z){throw Error("Deleting assistants is not supported. Assistants are generated from registered graphs.")},async update(Z,Y){throw Error("Updating assistants is not supported. Assistants are generated from registered graphs.")},async getGraph(Z,Y){let X={};return(await(await cZ(Z,X)).getGraphAsync({...X,xray:Y?.xray??void 0})).toJSON()},async getSchemas(Z){let X=(await cZ(Z,{})).builder;return console.log(X),{graph_id:Z,state_schema:X._inputDefinition,input_schema:X._inputDefinition,output_schema:X._outputDefinition,config_schema:X._configSchema,context_schema:X._configSchema}},async getVersions(Z,Y){let X=await this.get(Z),J=Y?.offset??0,Q=Y?.limit;return Q?[X].slice(J,J+Q):[X].slice(J)},async setLatest(Z,Y){let X=await this.get(Z);return X.version=Y,X},async create(Z){if(console.warn("⚠️ Creating assistants is not supported. Assistants are generated from registered graphs. Returning mock data."),!Object.keys(d0).includes(Z.graphId)){if(Z.ifExists==="raise")throw Error(`Graph not found: ${Z.graphId}`)}return{assistant_id:Z.assistantId||Z.graphId,graph_id:Z.graphId,name:Z.name||Z.graphId,description:Z.description||"",metadata:Z.metadata||{},config:Z.config||{},version:1,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}}},cY=()=>{let Z=()=>{return dZ.globalThreadsManager};return{assistants:O8,get threads(){return dZ.globalThreadsManager},runs:{list(Y,X){return Z().listRuns(Y,X)},async cancel(Y,X,J,Q){return await dZ.globalMessageQueue.cancelQueue(X)},async*stream(Y,X,J){J.config={...J.config??{},configurable:{...J.config?.configurable??{},graph_id:X,thread_id:Y}};let Q=Z();for await(let $ of F4(Q,Q.createRun(Y,X,J),J,{attempt:0,getGraph:cZ}))yield $},async*joinStream(Y,X,J){let Q=J&&typeof J==="object"&&"signal"in J?J:{},$=(J instanceof AbortSignal?J:Q.signal)||new AbortController().signal,K=null,U=null;try{K=await dZ.globalMessageQueue.getQueue(X);let W=await K.getAll();for(let z of W){if($.aborted)return;if(yield{id:z.id,event:z.event,data:z.data},z.event==="__stream_end__"||z.event==="__stream_error__"||z.event==="__stream_cancel__")return}U=K.onDataReceive();for await(let z of U){if($.aborted)break;let{event:H,data:G}=z;if(yield{id:z.id,event:H,data:G},z.event==="__stream_end__"||z.event==="__stream_error__"||z.event==="__stream_cancel__")break}}catch(W){if(!(W instanceof Error)||!W.message.includes("does not exist"))console.warn("Join stream failed:",W)}finally{if(U)try{await U.return(void 0)}catch(W){}}}}}};import{entrypoint as p2,getPreviousState as d2,getConfig as c2,Command as l2}from"@langchain/langgraph";import{schemaMetaRegistry as r2}from"@langchain/langgraph/zod";import{z as QZ}from"zod";var x4=(Z,Y)=>Z.constructor.name===Y.name,BZ=new Map;BZ.set(QZ.ZodBoolean.name,()=>!1),BZ.set(QZ.ZodNumber.name,()=>0),BZ.set(QZ.ZodString.name,()=>""),BZ.set(QZ.ZodArray.name,()=>[]),BZ.set(QZ.ZodRecord.name,()=>({})),BZ.set(QZ.ZodDefault.name,(Z)=>Z.def.defaultValue),BZ.set(QZ.ZodPipe.name,(Z)=>N0(Z.def.in)),BZ.set(QZ.ZodOptional.name,(Z)=>x4(Z.def.innerType,QZ.ZodDefault)?Z.def.innerType.def.defaultValue:void 0),BZ.set(QZ.ZodTuple.name,(Z)=>{let Y=[];for(let X of Z.def.items)Y.push(N0(X));return Y}),BZ.set(QZ.ZodPipe.name,(Z)=>N0(Z.def.in)),BZ.set(QZ.ZodUnion.name,(Z)=>N0(Z.def.options[0])),BZ.set(QZ.ZodObject.name,(Z)=>g4(Z)),BZ.set(QZ.ZodRecord.name,(Z)=>g4(Z)),BZ.set(QZ.ZodIntersection.name,(Z)=>g4(Z));function N0(Z){let Y=Z.constructor.name;if(!BZ.has(Y)){console.warn("getSchemaDefaultForField: Unhandled type",Z.constructor.name);return}return BZ.get(Y)(Z)}function g4(Z){if(x4(Z,QZ.ZodRecord))return{};if(x4(Z,QZ.ZodPipe))return g4(Z.def.in);if(x4(Z,QZ.ZodIntersection))return{...g4(Z.def.left),...g4(Z.def.right)};if(x4(Z,QZ.ZodUnion)){for(let Y of Z.def.options)if(x4(Y,QZ.ZodObject))return g4(Y);return console.warn("getSchemaDefaultObject: No object found in union, returning empty object"),{}}return x4(Z,QZ.ZodObject)?Object.fromEntries(Object.entries(Z.shape).map(([Y,X])=>[Y,N0(X)]).filter((Y)=>Y[1]!==void 0)):(console.warn(`getSchemaDefaultObject: Expected object schema, got ${Z.constructor.name}`),{})}import{tool as a2,HumanMessage as s2}from"langchain";import{z as M4}from"zod";var e2=M4.object({task_store:M4.record(M4.string(),M4.any()).default({})}),ZU=M4.object({task_id:M4.string().optional().describe("The task id to ask the subagent, if not provided, will use the tool call id"),subagent_id:M4.string(),task_description:M4.string().describe("Describe the user state and what you want the subagent to do."),data_transfer:M4.any().optional().describe("Data to transfer to the subagent.")});import A from"zod";var x=cY(),S1=A.object({thread_id:A.string().optional(),thread_ts:A.string().optional()}).catchall(A.unknown()),Y0=A.object({tags:A.array(A.string()).optional(),recursion_limit:A.number().int().optional(),configurable:S1.optional()}).catchall(A.unknown()).describe("The configuration of an assistant.");A.object({assistant_id:A.string(),graph_id:A.string(),config:Y0,created_at:A.string(),updated_at:A.string(),metadata:A.object({}).catchall(A.any())});var K4=A.object({source:A.union([A.literal("input"),A.literal("loop"),A.literal("update"),A.string()]).optional(),step:A.number().optional(),writes:A.any().nullable().optional(),parents:A.any().optional()}).catchall(A.unknown()),q8=A.object({node:A.string(),input:A.unknown().optional()}),rY=A.object({update:A.union([A.any(),A.array(A.tuple([A.string(),A.any()]))]).nullable().optional(),resume:A.unknown().optional(),goto:A.union([q8,A.array(q8),A.string(),A.array(A.string())]).optional()});A.object({limit:A.number().int().optional(),offset:A.number().int().optional()});var DZ=A.object({thread_id:A.string()}),_0=A.object({thread_id:A.string(),run_id:A.string()}),y1=A.object({graph_id:A.string().optional(),metadata:K4.optional(),limit:A.number().int().optional(),offset:A.number().int().optional(),sort_by:A.enum(["assistant_id","graph_id","name","created_at","updated_at"]).optional(),sort_order:A.enum(["asc","desc"]).optional()}),k1=A.object({graph_id:A.string().optional(),metadata:K4.optional()}),h1=A.object({xray:A.union([A.string(),A.boolean(),A.number()]).optional()}),F8=A.object({name:A.string().optional(),description:A.string().optional(),metadata:K4.optional(),config:Y0.optional()}).optional(),x1=A.object({assistant_id:A.string().optional(),graph_id:A.string().describe("The ID of graph to create an assistant from."),name:A.string().optional(),description:A.string().optional(),metadata:K4.optional(),config:Y0.optional(),if_exists:A.enum(["raise","do_nothing"]).optional()}),g1=A.object({assistant_id:A.union([A.string(),A.string()]),checkpoint_id:A.string().optional(),input:A.any().optional(),command:rY.optional(),metadata:K4.optional(),config:Y0.optional(),webhook:A.string().optional(),interrupt_before:A.union([A.literal("*"),A.array(A.string())]).optional(),interrupt_after:A.union([A.literal("*"),A.array(A.string())]).optional(),on_disconnect:A.enum(["cancel","continue"]).optional().default("continue"),multitask_strategy:A.enum(["reject","rollback","interrupt","enqueue"]).optional(),stream_mode:A.array(A.enum(["values","messages","messages-tuple","updates","events","debug","custom"])).optional(),stream_subgraphs:A.boolean().optional(),stream_resumable:A.boolean().optional(),after_seconds:A.number().optional(),if_not_exists:A.enum(["create","reject"]).optional(),on_completion:A.enum(["complete","continue"]).optional(),feedback_keys:A.array(A.string()).optional(),langsmith_tracer:A.unknown().optional()}).describe("Payload for creating a stateful run."),u1=A.object({limit:A.coerce.number().int().optional().default(10),offset:A.coerce.number().int().optional().default(0),status:A.enum(["pending","running","error","success","timeout","interrupted"]).optional()}),m1=A.object({wait:A.coerce.boolean().optional().default(!1),action:A.enum(["interrupt","rollback"]).optional().default("interrupt")}),p1=A.object({cancel_on_disconnect:A.coerce.boolean().optional().default(!1),last_event_id:A.string().optional(),stream_mode:A.enum(["values","messages","messages-tuple","updates","events","debug","custom"]).optional()}),d1=A.object({thread_id:A.string().describe("The ID of thread. If not provided, an ID is generated.").optional(),metadata:K4.optional(),if_exists:A.union([A.literal("raise"),A.literal("do_nothing")]).optional()}).describe("Payload for creating a thread."),M8=A.object({ids:A.array(A.string()).describe("List of thread IDs to include. Others are excluded.").optional(),metadata:K4.describe("Metadata to search for.").optional(),status:A.enum(["idle","busy","interrupted","error"]).describe("Filter by thread status.").optional(),values:A.any().describe("Filter by thread values.").optional(),limit:A.number().int().gte(1).lte(1000).describe("Maximum number to return.").optional(),offset:A.number().int().gte(0).describe("Offset to start from.").optional(),sort_by:A.enum(["thread_id","status","created_at","updated_at"]).describe("Sort by field.").optional(),sort_order:A.enum(["asc","desc"]).describe("Sort order.").optional(),select:A.array(A.enum(["thread_id","created_at","updated_at","metadata","config","context","status","values","interrupts"])).describe("Specify which fields to return. If not provided, all fields are returned.").optional(),without_details:A.boolean().describe("Whether to return values.").optional()}).describe("Payload for listing threads.");A.object({values:A.union([A.record(A.string(),A.unknown()),A.array(A.record(A.string(),A.unknown()))]).nullish()}).describe("Payload for adding state to a thread.");var c1=A.object({metadata:K4.optional(),status:A.enum(["idle","busy","interrupted","error"]).optional(),values:A.any().optional()}).describe("Payload for patching a thread."),N8=A.object({assistant_id:A.string(),input:A.any().optional(),command:rY.optional(),metadata:K4.optional(),config:Y0.optional(),webhook:A.string().optional(),interrupt_before:A.union([A.literal("*"),A.array(A.string())]).optional(),interrupt_after:A.union([A.literal("*"),A.array(A.string())]).optional(),on_disconnect:A.enum(["cancel","continue"]).optional().default("continue"),multitask_strategy:A.enum(["reject","rollback","interrupt","enqueue"]).optional(),stream_mode:A.array(A.enum(["values","messages","messages-tuple","updates","events","debug","custom"])).optional(),stream_subgraphs:A.boolean().optional(),stream_resumable:A.boolean().optional(),after_seconds:A.number().optional(),if_not_exists:A.enum(["create","reject"]).optional(),on_completion:A.enum(["complete","continue"]).optional(),feedback_keys:A.array(A.string()).optional(),langsmith_tracer:A.unknown().optional()}).describe("Payload for creating a run (background/wait)."),l1=A.object({cancel_on_disconnect:A.coerce.boolean().optional().default(!1)}),i1=A.object({cancel_on_disconnect:A.coerce.boolean().optional().default(!1)}),c0=A.object({assistant_id:A.string().describe("The assistant ID or graph name to run."),input:A.any().optional().describe("The input to the graph."),command:rY.optional(),metadata:K4.optional().describe("Metadata to assign to the run."),config:Y0.optional(),context:A.object({}).catchall(A.any()).optional().describe("Static context added to the assistant."),webhook:A.string().optional(),interrupt_before:A.union([A.literal("*"),A.array(A.string())]).optional(),interrupt_after:A.union([A.literal("*"),A.array(A.string())]).optional(),stream_mode:A.union([A.enum(["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]),A.array(A.enum(["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]))]).optional().default(["values"]),feedback_keys:A.array(A.string()).optional(),stream_subgraphs:A.boolean().optional().default(!1),stream_resumable:A.boolean().optional().default(!1)}).describe("Payload for creating a stateless run."),r1=A.array(c0).min(1).describe("Payload for creating a batch of stateless runs."),o1=A.object({action:A.enum(["interrupt","rollback"]).optional().default("interrupt").describe("Action to take when cancelling the run."),wait:A.coerce.boolean().optional().default(!1)}),n1=A.union([A.object({status:A.enum(["pending","running","all"]).describe("Filter runs by status to cancel.")}),A.object({thread_id:A.string().describe("The ID of the thread containing runs to cancel.")}),A.object({run_ids:A.array(A.string()).min(1).describe("List of run IDs to cancel.")})]);function KZ(Z,Y){let X=Y.split("/").filter(($)=>$),J=new URL(Z).pathname.split("/").filter(($)=>$),Q={};return X.forEach(($,K)=>{if($.startsWith(":")){let U=$.slice(1);Q[U]=J[K]}}),Q}function lZ(Z){let Y=new URL(Z).searchParams,X={};return Y.forEach((J,Q)=>{if(!isNaN(Number(J))&&J!=="")X[Q]=Number(J);else if(J==="true"||J==="false")X[Q]=J==="true";else X[Q]=J}),X}function S(Z,Y){let X=Z.safeParse(Y);if(!X.success)throw new oY(X.error.issues);return X.data}class oY extends Error{errors;constructor(Z){super("Validation failed");this.name="ValidationError",this.errors=Z}}function m(Z,Y=200,X){return new Response(JSON.stringify(Z),{status:Y,headers:{"Content-Type":"application/json",...X}})}function k(Z,Y=500){if(Z instanceof oY)return m({error:"Validation Error",details:Z.errors},400);return m({error:Z instanceof Error?Z.message:"Unknown error"},Y)}function nY(Z){let Y,X=!1,J=new AbortController,Q=new ReadableStream({async start($){Y=$;let K=new TextEncoder,U={signal:J.signal,writeSSE:async({data:W,event:z,id:H})=>{if(X||J.signal.aborted)return;try{let G="";if(H)G+=`id: ${H}
2
2
  `;if(z)G+=`event: ${z}
3
- `;G+=`data: ${U}
3
+ `;G+=`data: ${W}
4
4
 
5
- `,Y.enqueue(K.encode(G))}catch(G){if(!X&&!J.signal.aborted)throw G}},close:()=>{if(!X){X=!0;try{Y.close()}catch(U){}}}};try{await Z(W)}catch(U){if(!J.signal.aborted)console.error("SSE stream error:",U)}finally{if(!X){X=!0;try{Y.close()}catch(U){}}}},cancel(){if(X=!0,!J.signal.aborted)J.abort("Client disconnected")}});return new Response(Q,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}function nY(Z,Y=process.env.HEARTBEAT_INTERVAL?parseInt(process.env.HEARTBEAT_INTERVAL):1500){return async(X)=>{let J=null,Q=!1,$=()=>{if(J)clearInterval(J),J=null},K=()=>{$(),J=setInterval(async()=>{if(X.signal.aborted||Q){$();return}try{await X.writeSSE({event:"ping",data:"{}"})}catch(z){$()}},Y)},W=()=>{$()};X.signal.addEventListener("abort",W);let U={signal:X.signal,writeSSE:async(z)=>{if(X.signal.aborted)return;if($(),await X.writeSSE(z),!X.signal.aborted)K()},close:()=>{$(),X.close()}};K();try{await Z(U)}finally{Q=!0,$(),X.signal.removeEventListener("abort",W)}}}async function a1(Z,Y){try{let X=await Z.json(),J=S(y1,X),Q=await h.assistants.search(FZ(J));return m(Q,200,{"X-Pagination-Total":"0"})}catch(X){return k(X)}}async function s1(Z,Y){try{let X=await Z.json(),J=S(k1,X),Q=await h.assistants.count(FZ(J));return m(Q)}catch(X){return k(X)}}async function t1(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((K)=>K)[1],$=await h.assistants.get(Q);return m($)}catch(X){return k(X)}}async function e1(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter(($)=>$)[1];return await h.assistants.delete(Q),m({})}catch(X){return k(X)}}async function ZQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((U)=>U)[1],$=await Z.json(),K=S(F8,$),W=await h.assistants.update(Q,FZ(K));return m(W)}catch(X){return k(X)}}async function YQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((U)=>U)[1],$=iZ(Z.url),{xray:K}=S(h1,$),W=await h.assistants.getGraph(Q,{xray:K!==void 0?K==="true":void 0});return m(W)}catch(X){return k(X)}}async function XQ(Z,Y){return k({},501)}async function JQ(Z,Y){return k({},501)}async function QQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((K)=>K)[1],$=await h.assistants.getSchemas(Q);return m($)}catch(X){return k(X)}}async function $Q(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((U)=>U)[1],$=await Z.json(),K=S(F8,$),W=await h.assistants.getVersions(Q,FZ(K));return m(W)}catch(X){return k(X)}}async function KQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((U)=>U)[1],$=iZ(Z.url),K=$.version?parseInt($.version):1,W=await h.assistants.setLatest(Q,K);return m(W)}catch(X){return k(X)}}async function WQ(Z,Y){try{let X=await Z.json(),J=S(x1,X),Q=await h.assistants.create(FZ(J));return m(Q)}catch(X){return k(X)}}async function UQ(Z,Y){try{let X=await Z.json(),J=S(c1,X),Q=await h.threads.create(FZ(J));return m(Q)}catch(X){return k(X)}}async function zQ(Z,Y){try{let X=await Z.json(),J=S(M8,X),Q=await h.threads.search(FZ(J));return m(Q,200,{"X-Pagination-Total":Q.length.toString()})}catch(X){return k(X)}}async function HQ(Z,Y){try{let X=await Z.json(),J=S(M8.partial(),X),Q=await h.threads.count(FZ(J));return m(Q)}catch(X){return k(X)}}async function GQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id"),{thread_id:J}=S(VZ,X),Q=await h.threads.get(J);return m(Q)}catch(X){return k(X)}}async function OQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(d1,Q),K=await h.threads.patch(J,FZ($));return m(K)}catch(X){return k(X)}}async function qQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id"),{thread_id:J}=S(VZ,X);return await h.threads.delete(J),new Response(null,{status:204})}catch(X){return k(X)}}async function FQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/state"),{thread_id:J}=S(VZ,X),Q=iZ(Z.url),$={subgraphs:Q.subgraphs==="true"||Q.subgraphs===!0},K=await h.threads.getState(J,$);return m(K)}catch(X){return k(X)}}async function MQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/state"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=await h.threads.updateState(J,FZ(Q));return m($)}catch(X){return k(X)}}async function NQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/state/checkpoint"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=iZ(Z.url),K={subgraphs:$.subgraphs==="true"||$.subgraphs===!0,...Q},W=await h.threads.getState(J,K);return m(W)}catch(X){return k(X)}}async function _Q(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/history"),{thread_id:J}=S(VZ,X),Q=iZ(Z.url),$={limit:Q.limit?parseInt(Q.limit,10):void 0,before:Q.before},K=await h.threads.getStateHistory(J,$);return m(K)}catch(X){return k(X)}}async function wQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/history"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$={limit:Q.limit,before:Q.before},K=await h.threads.getStateHistory(J,$);return m(K)}catch(X){return k(X)}}async function AQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/copy"),{thread_id:J}=S(VZ,X),Q=await h.threads.copy(J);return m(Q)}catch(X){return k(X)}}async function BQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/stream"),{thread_id:J}=S(VZ,X),Q=iZ(Z.url),$={lastEventId:Z.headers.get("Last-Event-ID")||Q.last_event_id,streamModes:Q.stream_modes?Array.isArray(Q.stream_modes)?Q.stream_modes:[Q.stream_modes]:void 0};return new Response(`data: {"status": "stream_ready"}
5
+ `,Y.enqueue(K.encode(G))}catch(G){if(!X&&!J.signal.aborted)throw G}},close:()=>{if(!X){X=!0;try{Y.close()}catch(W){}}}};try{await Z(U)}catch(W){if(!J.signal.aborted)console.error("SSE stream error:",W)}finally{if(!X){X=!0;try{Y.close()}catch(W){}}}},cancel(){if(X=!0,!J.signal.aborted)J.abort("Client disconnected")}});return new Response(Q,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}function aY(Z,Y=process.env.HEARTBEAT_INTERVAL?parseInt(process.env.HEARTBEAT_INTERVAL):1500){return async(X)=>{let J=null,Q=!1,$=()=>{if(J)clearInterval(J),J=null},K=()=>{$(),J=setInterval(async()=>{if(X.signal.aborted||Q){$();return}try{await X.writeSSE({event:"ping",data:"{}"})}catch(z){$()}},Y)},U=()=>{$()};X.signal.addEventListener("abort",U);let W={signal:X.signal,writeSSE:async(z)=>{if(X.signal.aborted)return;if($(),await X.writeSSE(z),!X.signal.aborted)K()},close:()=>{$(),X.close()}};K();try{await Z(W)}finally{Q=!0,$(),X.signal.removeEventListener("abort",U)}}}async function a1(Z,Y){try{let X=await Z.json(),J=S(y1,X),Q=await x.assistants.search(FZ(J));return m(Q,200,{"X-Pagination-Total":"0"})}catch(X){return k(X)}}async function s1(Z,Y){try{let X=await Z.json(),J=S(k1,X),Q=await x.assistants.count(FZ(J));return m(Q)}catch(X){return k(X)}}async function t1(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((K)=>K)[1],$=await x.assistants.get(Q);return m($)}catch(X){return k(X)}}async function e1(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter(($)=>$)[1];return await x.assistants.delete(Q),m({})}catch(X){return k(X)}}async function ZQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((W)=>W)[1],$=await Z.json(),K=S(F8,$),U=await x.assistants.update(Q,FZ(K));return m(U)}catch(X){return k(X)}}async function YQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((W)=>W)[1],$=lZ(Z.url),{xray:K}=S(h1,$),U=await x.assistants.getGraph(Q,{xray:K!==void 0?K==="true":void 0});return m(U)}catch(X){return k(X)}}async function XQ(Z,Y){return k({},501)}async function JQ(Z,Y){return k({},501)}async function QQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((K)=>K)[1],$=await x.assistants.getSchemas(Q);return m($)}catch(X){return k(X)}}async function $Q(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((W)=>W)[1],$=await Z.json(),K=S(F8,$),U=await x.assistants.getVersions(Q,FZ(K));return m(U)}catch(X){return k(X)}}async function KQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((W)=>W)[1],$=lZ(Z.url),K=$.version?parseInt($.version):1,U=await x.assistants.setLatest(Q,K);return m(U)}catch(X){return k(X)}}async function WQ(Z,Y){try{let X=await Z.json(),J=S(x1,X),Q=await x.assistants.create(FZ(J));return m(Q)}catch(X){return k(X)}}async function UQ(Z,Y){try{let X=await Z.json(),J=S(d1,X),Q=await x.threads.create(FZ(J));return m(Q)}catch(X){return k(X)}}async function zQ(Z,Y){try{let X=await Z.json(),J=S(M8,X),Q=await x.threads.search(FZ(J));return m(Q,200,{"X-Pagination-Total":Q.length.toString()})}catch(X){return k(X)}}async function HQ(Z,Y){try{let X=await Z.json(),J=S(M8.partial(),X),Q=await x.threads.count(FZ(J));return m(Q)}catch(X){return k(X)}}async function GQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id"),{thread_id:J}=S(DZ,X),Q=await x.threads.get(J);return m(Q)}catch(X){return k(X)}}async function OQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id"),{thread_id:J}=S(DZ,X),Q=await Z.json(),$=S(c1,Q),K=await x.threads.patch(J,FZ($));return m(K)}catch(X){return k(X)}}async function qQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id"),{thread_id:J}=S(DZ,X);return await x.threads.delete(J),new Response(null,{status:204})}catch(X){return k(X)}}async function FQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/state"),{thread_id:J}=S(DZ,X),Q=lZ(Z.url),$={subgraphs:Q.subgraphs==="true"||Q.subgraphs===!0},K=await x.threads.getState(J,$);return m(K)}catch(X){return k(X)}}async function MQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/state"),{thread_id:J}=S(DZ,X),Q=await Z.json(),$=await x.threads.updateState(J,FZ(Q));return m($)}catch(X){return k(X)}}async function NQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/state/checkpoint"),{thread_id:J}=S(DZ,X),Q=await Z.json(),$=lZ(Z.url),K={subgraphs:$.subgraphs==="true"||$.subgraphs===!0,...Q},U=await x.threads.getState(J,K);return m(U)}catch(X){return k(X)}}async function _Q(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/history"),{thread_id:J}=S(DZ,X),Q=lZ(Z.url),$={limit:Q.limit?parseInt(Q.limit,10):void 0,before:Q.before},K=await x.threads.getStateHistory(J,$);return m(K)}catch(X){return k(X)}}async function AQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/history"),{thread_id:J}=S(DZ,X),Q=await Z.json(),$={limit:Q.limit,before:Q.before},K=await x.threads.getStateHistory(J,$);return m(K)}catch(X){return k(X)}}async function wQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/copy"),{thread_id:J}=S(DZ,X),Q=await x.threads.copy(J);return m(Q)}catch(X){return k(X)}}async function BQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/stream"),{thread_id:J}=S(DZ,X),Q=lZ(Z.url),$={lastEventId:Z.headers.get("Last-Event-ID")||Q.last_event_id,streamModes:Q.stream_modes?Array.isArray(Q.stream_modes)?Q.stream_modes:[Q.stream_modes]:void 0};return new Response(`data: {"status": "stream_ready"}
6
6
 
7
- `,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(X){return k(X)}}async function LQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/stream"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(g1,Q);return oY(nY(async(K)=>{$.config=$.config||{},$.config.configurable=$.config.configurable||{};let W=Y?.langgraph_context;if(W)Object.assign($.config.configurable,W);let U=null,z=!1,H=()=>{z=!0};K.signal.addEventListener("abort",H);try{U=h.runs.stream(J,$.assistant_id,FZ($));for await(let{event:G,data:F}of U){if(z||K.signal.aborted)break;await K.writeSSE({data:lY(F)??"",event:G})}}catch(G){if(!K.signal.aborted&&!z)throw G}finally{if(K.signal.removeEventListener("abort",H),U){try{await U.return(void 0)}catch(G){}U=null}}}))}catch(X){return k(X)}}async function PQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id/stream"),{thread_id:J,run_id:Q}=S(w0,X),$=iZ(Z.url),{cancel_on_disconnect:K,last_event_id:W,stream_mode:U}=S(p1,$);return oY(nY(async(z)=>{let H=new AbortController,G=null,F=!1,M=[],_=()=>{H.abort("Client disconnected")};if(Z.signal)Z.signal.addEventListener("abort",_),M.push({signal:Z.signal,handler:_});let A=()=>{F=!0,H.abort("SSE stream closed")};z.signal.addEventListener("abort",A),M.push({signal:z.signal,handler:A});try{G=h.runs.joinStream(J,Q,{signal:H.signal,cancelOnDisconnect:K,lastEventId:W,streamMode:U?[U]:void 0});for await(let{event:P,data:B,id:C}of G){if(F||z.signal.aborted||H.signal.aborted)break;await z.writeSSE({data:lY(B)??"",event:P,id:C})}}catch(P){if(!(H.signal.aborted||z.signal.aborted)&&!(P instanceof Error&&P.message.includes("user cancel")))console.error("Join stream error:",P),await z.writeSSE({event:"error",data:JSON.stringify({error:P instanceof Error?P.message:"Unknown error"})})}finally{for(let{signal:P,handler:B}of M)try{P.removeEventListener("abort",B)}catch(C){}if(G){try{await G.return(void 0)}catch(P){}G=null}}}))}catch(X){return k(X)}}async function RQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs"),{thread_id:J}=S(VZ,X),Q=iZ(Z.url),{limit:$,offset:K,status:W}=S(u1,Q),U=await h.runs.list(J,{limit:$,offset:K,status:W});return m(U)}catch(X){return k(X)}}async function CQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id/cancel"),{thread_id:J,run_id:Q}=S(w0,X),$=iZ(Z.url),{wait:K,action:W}=S(m1,$),U=h.runs.cancel(J,Q,K,W);if(K)await U;return new Response(null,{status:K?204:202})}catch(X){return k(X)}}async function vQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(N8,Q),K=FZ($);K.config=K.config||{},K.config.configurable=K.config.configurable||{};let W=Y?.langgraph_context;if(W)Object.assign(K.config.configurable,W);K.config.configurable.graph_id=$.assistant_id,K.config.configurable.thread_id=J;let U=h.threads,z=await U.createRun(J,$.assistant_id,K);return(async()=>{let H=!1;try{for await(let G of N4(U,z,K,{attempt:0,getGraph:lZ}));}catch(G){console.error("Background run error:",G)}finally{if(!H){H=!0;try{await dZ.globalMessageQueue.removeQueue(z.run_id)}catch(G){}}}})(),m(z,200,{"Content-Location":`/threads/${J}/runs/${z.run_id}`})}catch(X){return k(X)}}async function IQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/wait"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(N8,Q),K=iZ(Z.url),{cancel_on_disconnect:W}=S(l1,K),U=FZ($);U.config=U.config||{},U.config.configurable=U.config.configurable||{};let z=Y?.langgraph_context;if(z)Object.assign(U.config.configurable,z);U.config.configurable.graph_id=$.assistant_id,U.config.configurable.thread_id=J;let H=h.threads,G=await H.createRun(J,$.assistant_id,U),F={};for await(let{event:M,data:_}of N4(H,G,U,{attempt:0,getGraph:lZ}))if(M==="end"||M==="writes/value"){if(_&&typeof _==="object")Object.assign(F,_)}return m(F,200,{"Content-Location":`/threads/${J}/runs/${G.run_id}`})}catch(X){return k(X)}}async function DQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id"),{thread_id:J,run_id:Q}=S(w0,X),K=(await h.runs.list(J,{limit:1000})).find((W)=>W.run_id===Q);if(!K)return k(Error("Run not found"),404);return m(K)}catch(X){return k(X)}}async function VQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id"),{thread_id:J,run_id:Q}=S(w0,X);return await h.threads.updateRun(Q,{status:"deleted"}),new Response(null,{status:204})}catch(X){return k(X)}}async function EQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id/join"),{thread_id:J,run_id:Q}=S(w0,X),$=iZ(Z.url),{cancel_on_disconnect:K}=S(i1,$),U=(await h.runs.list(J,{limit:1000})).find((G)=>G.run_id===Q);if(!U)return k(Error("Run not found"),404);if(U.status==="success"||U.status==="error")return m({});let z=new AbortController;if(K){let G=()=>{z.abort("Client disconnected")};Z.signal?.addEventListener("abort",G)}let H={};for await(let{event:G,data:F}of h.runs.joinStream(J,Q,{signal:z.signal,cancelOnDisconnect:K}))if(G.event==="end"||G.event==="writes/value"){if(F&&typeof F==="object")Object.assign(H,F)}return m(H)}catch(X){return k(X)}}async function bQ(Z,Y){try{let X=await Z.json(),J=S(c0,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=h.threads,W=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=W.thread_id,Q.temporary=!0;let U=await K.createRun(W.thread_id,J.assistant_id,Q);return(async()=>{let z=!1;try{for await(let H of N4(K,U,Q,{attempt:0,getGraph:lZ}));}catch(H){console.error("Stateless run error:",H)}finally{try{await K.delete(W.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}if(!z){z=!0;try{await dZ.globalMessageQueue.removeQueue(U.run_id)}catch(H){}}}})(),m(U,200,{"Content-Location":`/threads/${W.thread_id}/runs/${U.run_id}`})}catch(X){return k(X)}}async function TQ(Z,Y){try{let X=await Z.json(),J=S(c0,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=h.threads,W=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=W.thread_id,Q.temporary=!0;let U=await K.createRun(W.thread_id,J.assistant_id,Q);return oY(nY(async(z)=>{try{for await(let H of N4(K,U,Q,{attempt:0,getGraph:lZ}))await z.writeSSE({data:JSON.stringify(H),event:"data"})}catch(H){if(H instanceof Error&&H.name!=="AbortError")throw console.error("Stream error:",H),H}finally{try{await K.delete(W.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}}}))}catch(X){return k(X)}}async function fQ(Z,Y){try{let X=await Z.json(),J=S(c0,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=h.threads,W=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=W.thread_id,Q.temporary=!0;let U=await K.createRun(W.thread_id,J.assistant_id,Q),z={};try{for await(let{event:H,data:G}of N4(K,U,Q,{attempt:0,getGraph:lZ}))if(H==="end"||H==="writes/value"){if(G&&typeof G==="object")Object.assign(z,G)}}finally{try{await K.delete(W.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}}return m(z,200,{"Content-Location":`/threads/${W.thread_id}/runs/${U.run_id}`})}catch(X){return k(X)}}async function jQ(Z,Y){try{let X=await Z.json(),J=S(r1,X),Q=h.threads,$=[],K=J.map(async(U)=>{try{let z=FZ(U);z.config=z.config||{},z.config.configurable=z.config.configurable||{};let H=Y?.langgraph_context;if(H)Object.assign(z.config.configurable,H);let G=await Q.create({metadata:{...z.metadata,temporary:!0}});z.config.configurable.graph_id=U.assistant_id,z.config.configurable.thread_id=G.thread_id,z.temporary=!0;let F=await Q.createRun(G.thread_id,U.assistant_id,z);return(async()=>{let M=!1;try{for await(let _ of N4(Q,F,z,{attempt:0,getGraph:lZ}));}catch(_){console.error("Batch run error:",_)}finally{try{await Q.delete(G.thread_id)}catch(_){console.error("Error cleaning up temporary thread:",_)}if(!M){M=!0;try{await dZ.globalMessageQueue.removeQueue(F.run_id)}catch(_){}}}})(),{thread_id:G.thread_id,run_id:F.run_id}}catch(z){return console.error("Batch run creation error:",z),{error:(z instanceof Error?z.message:"Unknown error")||"Unknown error"}}}),W=await Promise.all(K);return $.push(...W),m($,200)}catch(X){return k(X)}}async function SQ(Z,Y){try{let X=await Z.json(),J=S(n1,X),Q=new URL(Z.url),$=S(o1,{action:Q.searchParams.get("action")||"interrupt"}),K=h.threads,W=[];if("run_ids"in J&&J.run_ids)for(let U of J.run_ids)try{console.warn(`Cancel by run_id ${U} not fully implemented yet`)}catch(z){console.error(`Error cancelling run ${U}:`,z)}else if("thread_id"in J&&J.thread_id){let U=J.thread_id;try{let z=await K.listRuns(U,{limit:1000,offset:0});for(let H of z)try{h.runs.cancel(U,H.run_id,$.wait,$.action),W.push(H.run_id)}catch(G){console.error(`Error cancelling run ${H.run_id}:`,G)}}catch(z){console.error(`Error listing runs for thread ${U}:`,z)}}else if("status"in J&&J.status)console.warn(`Cancel by status ${J.status} not fully implemented yet`);return new Response(null,{status:204})}catch(X){return k(X)}}var yQ=[{method:"POST",pattern:/^\/assistants\/search$/,handler:a1},{method:"POST",pattern:/^\/assistants\/count$/,handler:s1},{method:"GET",pattern:/^\/assistants\/[^/]+$/,handler:t1},{method:"DELETE",pattern:/^\/assistants\/[^/]+$/,handler:e1},{method:"PATCH",pattern:/^\/assistants\/[^/]+$/,handler:ZQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/graph$/,handler:YQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/subgraphs$/,handler:XQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/subgraphs\/[^/]+$/,handler:JQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/schemas$/,handler:QQ},{method:"POST",pattern:/^\/assistants\/[^/]+\/versions$/,handler:$Q},{method:"POST",pattern:/^\/assistants\/[^/]+\/latest$/,handler:KQ},{method:"POST",pattern:/^\/assistants$/,handler:WQ},{method:"POST",pattern:/^\/threads$/,handler:UQ},{method:"POST",pattern:/^\/threads\/search$/,handler:zQ},{method:"POST",pattern:/^\/threads\/count$/,handler:HQ},{method:"GET",pattern:/^\/threads\/[^/]+$/,handler:GQ},{method:"PATCH",pattern:/^\/threads\/[^/]+$/,handler:OQ},{method:"DELETE",pattern:/^\/threads\/[^/]+$/,handler:qQ},{method:"GET",pattern:/^\/threads\/[^/]+\/state$/,handler:FQ},{method:"POST",pattern:/^\/threads\/[^/]+\/state$/,handler:MQ},{method:"POST",pattern:/^\/threads\/[^/]+\/state\/checkpoint$/,handler:NQ},{method:"GET",pattern:/^\/threads\/[^/]+\/history$/,handler:_Q},{method:"POST",pattern:/^\/threads\/[^/]+\/history$/,handler:wQ},{method:"POST",pattern:/^\/threads\/[^/]+\/copy$/,handler:AQ},{method:"GET",pattern:/^\/threads\/[^/]+\/stream$/,handler:BQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs$/,handler:vQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/stream$/,handler:LQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/wait$/,handler:IQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/cancel$/,handler:CQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs$/,handler:RQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+$/,handler:DQ},{method:"DELETE",pattern:/^\/threads\/[^/]+\/runs\/[^/]+$/,handler:VQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/join$/,handler:EQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/stream$/,handler:PQ},{method:"POST",pattern:/^\/runs$/,handler:bQ},{method:"POST",pattern:/^\/runs\/stream$/,handler:TQ},{method:"POST",pattern:/^\/runs\/wait$/,handler:fQ},{method:"POST",pattern:/^\/runs\/batch$/,handler:jQ},{method:"POST",pattern:/^\/runs\/cancel$/,handler:SQ}],kQ=(Z)=>{let Y=new URL(Z.url).pathname.toString(),X="";if(Y.includes("/threads"))X=Y.split("/threads")[0];else if(Y.includes("/assistants"))X=Y.split("/assistants")[0];return new Request(Z.url.replace(X,""),{method:Z.method,headers:Z.headers,body:Z.body,duplex:Z.duplex})};async function _8(Z,Y={}){Z=kQ(Z);try{await dZ.initGlobal();let J=new URL(Z.url).pathname,Q=Z.method;for(let $ of yQ)if($.method===Q&&$.pattern.test(J))return await $.handler(Z,Y);return new Response("Not Found",{status:404})}catch(X){return console.error("Request error:",X),k(X)}}import{execa as A8}from"execa";import hQ from"extract-zip";import xQ from"fs-extra";import*as A0 from"node:os";import{dirname as B8,join as gQ}from"node:path";import{pipeline as uQ}from"node:stream/promises";import{fileURLToPath as mQ}from"node:url";import{pathExists as w8}from"path-exists";import{temporaryFile as pQ}from"tempy";import{xdgCache as cQ}from"xdg-basedir";var{mkdir:sY,createWriteStream:dQ,move:lQ}=xQ,L8=B8(mQ(import.meta.url)),iQ="microsoft/ripgrep-prebuilt",aY=process.env.RIPGREP_VERSION||"v15.0.0",rQ=()=>{let Z=process.env.npm_config_arch||A0.arch(),Y=process.env.platform||A0.platform();switch(Y){case"darwin":switch(Z){case"arm64":return"aarch64-apple-darwin.tar.gz";default:return"x86_64-apple-darwin.tar.gz"}case"win32":switch(Z){case"x64":return"x86_64-pc-windows-msvc.zip";case"arm":return"aarch64-pc-windows-msvc.zip";default:return"i686-pc-windows-msvc.zip"}case"linux":switch(Z){case"x64":return"x86_64-unknown-linux-musl.tar.gz";case"arm":case"armv7l":return"arm-unknown-linux-gnueabihf.tar.gz";case"arm64":return"aarch64-unknown-linux-gnu.tar.gz";case"ppc64":return"powerpc64le-unknown-linux-gnu.tar.gz";case"s390x":return"s390x-unknown-linux-gnu.tar.gz";default:return"i686-unknown-linux-musl.tar.gz"}default:throw Error("Unknown platform: "+Y)}},oQ=async(Z,Y)=>{try{let X=pQ(),J=await fetch(Z);if(!J.ok)throw Error(`HTTP ${J.status}: ${J.statusText}`);await uQ(J.body,dQ(X)),await sY(B8(Y),{recursive:!0}),await lQ(X,Y)}catch(X){throw console.error(`Failed to download "${Z}"`),X}},nQ=async(Z,Y)=>{try{await sY(Y,{recursive:!0}),await hQ(Z,{dir:Y})}catch(X){throw console.error(`Failed to unzip "${Z}"`),X}},aQ=async(Z,Y)=>{try{await sY(Y,{recursive:!0}),await A8("tar",["xvf",Z,"-C",Y])}catch(X){throw console.error(`Failed to extract "${Z}"`),X}},sQ=async(Z)=>{if(Z==="android")try{return await A8("pkg",["install","ripgrep","-y"]),!0}catch(Y){return console.info("Could not install ripgrep via pkg. Falling back to download."),!1}return!1},tQ=gQ(L8,`rg${process.platform==="win32"?".exe":""}`),P8=async(Z)=>{if(await w8(tQ)){console.log("rg cached");return}let Y=process.env.platform||A0.platform();if(Y==="android"){if(await sQ(Y))return}let X=rQ(),Q=`${process.env.RIPGREP_PREBUILT_BINARIES_MIRROR||`https://v6.gh-proxy.org/https://github.com/${iQ}/releases/download`}/${aY}/ripgrep-${aY}-${X}`,$=`${cQ}/vscode-ripgrep/ripgrep-${aY}-${X}`,K=Z??L8;if(!await w8($))await oQ(Q,$);else console.info(`File ${$} has been cached`);if($.endsWith(".tar.gz"))await aQ($,K);else if($.endsWith(".zip"))await nQ($,K);else throw Error(`Invalid downloadPath ${$}`)};await P8();dY("code",R8);var C8=(Z,Y={})=>{return _8(new Request(Z,Y),{})};import eQ from"openai";import Z$ from"@anthropic-ai/sdk";import{GoogleGenerativeAI as Y$}from"@google/generative-ai";var X$=async()=>{if(!process.env.ANTHROPIC_API_KEY)return[];let Z=[];try{for await(let Y of new Z$().beta.models.list())Z.push({id:Y.id,name:Y.display_name,provider:"anthropic"})}catch(Y){console.error("Failed to fetch Anthropic models:",Y)}return Z},J$=async()=>{if(!process.env.OPENAI_API_KEY)return[];try{return await new eQ().models.list().then((Z)=>Z.data.map((Y)=>{return{id:Y.id,name:Y.id,provider:"openai"}}).sort((Y,X)=>Y.id.localeCompare(X.id)))}catch(Z){return console.error("Failed to fetch OpenAI models:",Z),[]}},Q$=async()=>{let Z=process.env.GEMINI_API_KEY;if(!Z)return[];let Y=[{id:"gemini-2.5-flash-preview-06-17",name:"Gemini 2.5 Flash Preview (06-17)",provider:"gemini"},{id:"gemini-2.5-pro-preview-06-05",name:"Gemini 2.5 Pro Preview (06-05)",provider:"gemini"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",provider:"gemini"},{id:"gemini-2.0-flash-lite",name:"Gemini 2.0 Flash Lite",provider:"gemini"},{id:"gemini-1.5-flash",name:"Gemini 1.5 Flash",provider:"gemini"},{id:"gemini-1.5-flash-8b",name:"Gemini 1.5 Flash 8B",provider:"gemini"},{id:"gemini-1.5-pro",name:"Gemini 1.5 Pro",provider:"gemini"},{id:"gemini-1.0-pro",name:"Gemini 1.0 Pro",provider:"gemini"},{id:"gemini-2.0-flash-exp",name:"Gemini 2.0 Flash Experimental",provider:"gemini"},{id:"gemini-exp-1206",name:"Gemini Experimental 1206",provider:"gemini"},{id:"gemini-2.5-pro-exp-03-25",name:"Gemini 2.5 Pro Experimental (03-25)",provider:"gemini"},{id:"gemini-2.5-flash-preview-05-20",name:"Gemini 2.5 Flash Preview (05-20)",provider:"gemini"}];try{return await new Y$(Z).getGenerativeModel({model:"gemini-1.5-flash"}),Y}catch(X){return console.error("Failed to verify Gemini API key:",X),[]}},v8=async()=>{return(await Promise.all([X$().catch(()=>[]),J$().catch(()=>[]),Q$().catch(()=>[])])).flat()};var l0=L(x(),1);function I8({tools:Z,setTools:Y}){let X=l0.useRef(!1);l0.useEffect(()=>{if(!X.current)Y(Z),X.current=!0},[Z,Y])}var V8=L(x(),1);function D8(Z){if(!Z)return{isValid:!1,needsSetup:!0,reason:"未找到配置文件"};if(!Z.providers||Z.providers.length===0)return{isValid:!1,needsSetup:!0,reason:"未配置任何 Provider"};let Y=Z.providers.find((X)=>X.id===Z.provider_id);if(!Y)return{isValid:!1,needsSetup:!0,reason:`Provider "${Z.provider_id}" 不存在`,invalidProviderRef:!0};if(!Y.apiKey||Y.apiKey.trim()==="")return{isValid:!1,needsSetup:!0,reason:`Provider "${Z.provider_id}" 未配置 API Key`,missingApiKey:!0};return{isValid:!0,needsSetup:!1}}function E8({config:Z}){return V8.useMemo(()=>{if(!Z)return{validation:null,needsSetup:!0,isValid:!1};let Y=D8(Z);return{validation:Y,needsSetup:Y.needsSetup,isValid:!Y.needsSetup}},[Z])}var b8=L(x(),1);function T8({shouldFocus:Z}){let Y=K4();b8.useEffect(()=>{if(Z)Y.focus("global-input")},[Z,Y])}var rZ=L(x(),1);function f8(){let[Z,Y]=rZ.useState("chat"),X=K4(),J=rZ.useCallback(()=>{Y("history")},[]),Q=rZ.useCallback(()=>{Y("knowledge")},[]),$=rZ.useCallback(()=>{Y("settings")},[]),K=rZ.useCallback(()=>{Y("model-provider")},[]),W=rZ.useCallback(()=>{Y("agent")},[]),U=rZ.useCallback(()=>{Y("task")},[]),z=rZ.useCallback(()=>{Y("mcp")},[]),H=rZ.useCallback(()=>{Y("chat"),X.focus("global-input")},[X]);return{activeView:Z,isChatView:Z==="chat",switchToHistory:J,switchToKnowledge:Q,switchToSettings:$,switchToModelProvider:K,switchToAgent:W,switchToTask:U,switchToMcp:z,closePanel:H}}var i0=L(x(),1);function $$(Z){let Y=`# 任务:${Z.title}
7
+ `,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(X){return k(X)}}async function LQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/stream"),{thread_id:J}=S(DZ,X),Q=await Z.json(),$=S(g1,Q);return nY(aY(async(K)=>{$.config=$.config||{},$.config.configurable=$.config.configurable||{};let U=Y?.langgraph_context;if(U)Object.assign($.config.configurable,U);let W=null,z=!1,H=()=>{z=!0};K.signal.addEventListener("abort",H);try{W=x.runs.stream(J,$.assistant_id,FZ($));for await(let{event:G,data:F}of W){if(z||K.signal.aborted)break;await K.writeSSE({data:iY(F)??"",event:G})}}catch(G){if(!K.signal.aborted&&!z)throw G}finally{if(K.signal.removeEventListener("abort",H),W){try{await W.return(void 0)}catch(G){}W=null}}}))}catch(X){return k(X)}}async function PQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id/stream"),{thread_id:J,run_id:Q}=S(_0,X),$=lZ(Z.url),{cancel_on_disconnect:K,last_event_id:U,stream_mode:W}=S(p1,$);return nY(aY(async(z)=>{let H=new AbortController,G=null,F=!1,M=[],N=()=>{H.abort("Client disconnected")};if(Z.signal)Z.signal.addEventListener("abort",N),M.push({signal:Z.signal,handler:N});let w=()=>{F=!0,H.abort("SSE stream closed")};z.signal.addEventListener("abort",w),M.push({signal:z.signal,handler:w});try{G=x.runs.joinStream(J,Q,{signal:H.signal,cancelOnDisconnect:K,lastEventId:U,streamMode:W?[W]:void 0});for await(let{event:L,data:B,id:C}of G){if(F||z.signal.aborted||H.signal.aborted)break;await z.writeSSE({data:iY(B)??"",event:L,id:C})}}catch(L){if(!(H.signal.aborted||z.signal.aborted)&&!(L instanceof Error&&L.message.includes("user cancel")))console.error("Join stream error:",L),await z.writeSSE({event:"error",data:JSON.stringify({error:L instanceof Error?L.message:"Unknown error"})})}finally{for(let{signal:L,handler:B}of M)try{L.removeEventListener("abort",B)}catch(C){}if(G){try{await G.return(void 0)}catch(L){}G=null}}}))}catch(X){return k(X)}}async function RQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs"),{thread_id:J}=S(DZ,X),Q=lZ(Z.url),{limit:$,offset:K,status:U}=S(u1,Q),W=await x.runs.list(J,{limit:$,offset:K,status:U});return m(W)}catch(X){return k(X)}}async function CQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id/cancel"),{thread_id:J,run_id:Q}=S(_0,X),$=lZ(Z.url),{wait:K,action:U}=S(m1,$),W=x.runs.cancel(J,Q,K,U);if(K)await W;return new Response(null,{status:K?204:202})}catch(X){return k(X)}}async function IQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs"),{thread_id:J}=S(DZ,X),Q=await Z.json(),$=S(N8,Q),K=FZ($);K.config=K.config||{},K.config.configurable=K.config.configurable||{};let U=Y?.langgraph_context;if(U)Object.assign(K.config.configurable,U);K.config.configurable.graph_id=$.assistant_id,K.config.configurable.thread_id=J;let W=x.threads,z=await W.createRun(J,$.assistant_id,K);return(async()=>{let H=!1;try{for await(let G of F4(W,z,K,{attempt:0,getGraph:cZ}));}catch(G){console.error("Background run error:",G)}finally{if(!H){H=!0;try{await dZ.globalMessageQueue.removeQueue(z.run_id)}catch(G){}}}})(),m(z,200,{"Content-Location":`/threads/${J}/runs/${z.run_id}`})}catch(X){return k(X)}}async function vQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/wait"),{thread_id:J}=S(DZ,X),Q=await Z.json(),$=S(N8,Q),K=lZ(Z.url),{cancel_on_disconnect:U}=S(l1,K),W=FZ($);W.config=W.config||{},W.config.configurable=W.config.configurable||{};let z=Y?.langgraph_context;if(z)Object.assign(W.config.configurable,z);W.config.configurable.graph_id=$.assistant_id,W.config.configurable.thread_id=J;let H=x.threads,G=await H.createRun(J,$.assistant_id,W),F={};for await(let{event:M,data:N}of F4(H,G,W,{attempt:0,getGraph:cZ}))if(M==="end"||M==="writes/value"){if(N&&typeof N==="object")Object.assign(F,N)}return m(F,200,{"Content-Location":`/threads/${J}/runs/${G.run_id}`})}catch(X){return k(X)}}async function DQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id"),{thread_id:J,run_id:Q}=S(_0,X),K=(await x.runs.list(J,{limit:1000})).find((U)=>U.run_id===Q);if(!K)return k(Error("Run not found"),404);return m(K)}catch(X){return k(X)}}async function VQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id"),{thread_id:J,run_id:Q}=S(_0,X);return await x.threads.updateRun(Q,{status:"deleted"}),new Response(null,{status:204})}catch(X){return k(X)}}async function EQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id/join"),{thread_id:J,run_id:Q}=S(_0,X),$=lZ(Z.url),{cancel_on_disconnect:K}=S(i1,$),W=(await x.runs.list(J,{limit:1000})).find((G)=>G.run_id===Q);if(!W)return k(Error("Run not found"),404);if(W.status==="success"||W.status==="error")return m({});let z=new AbortController;if(K){let G=()=>{z.abort("Client disconnected")};Z.signal?.addEventListener("abort",G)}let H={};for await(let{event:G,data:F}of x.runs.joinStream(J,Q,{signal:z.signal,cancelOnDisconnect:K}))if(G.event==="end"||G.event==="writes/value"){if(F&&typeof F==="object")Object.assign(H,F)}return m(H)}catch(X){return k(X)}}async function bQ(Z,Y){try{let X=await Z.json(),J=S(c0,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=x.threads,U=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=U.thread_id,Q.temporary=!0;let W=await K.createRun(U.thread_id,J.assistant_id,Q);return(async()=>{let z=!1;try{for await(let H of F4(K,W,Q,{attempt:0,getGraph:cZ}));}catch(H){console.error("Stateless run error:",H)}finally{try{await K.delete(U.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}if(!z){z=!0;try{await dZ.globalMessageQueue.removeQueue(W.run_id)}catch(H){}}}})(),m(W,200,{"Content-Location":`/threads/${U.thread_id}/runs/${W.run_id}`})}catch(X){return k(X)}}async function TQ(Z,Y){try{let X=await Z.json(),J=S(c0,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=x.threads,U=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=U.thread_id,Q.temporary=!0;let W=await K.createRun(U.thread_id,J.assistant_id,Q);return nY(aY(async(z)=>{try{for await(let H of F4(K,W,Q,{attempt:0,getGraph:cZ}))await z.writeSSE({data:JSON.stringify(H),event:"data"})}catch(H){if(H instanceof Error&&H.name!=="AbortError")throw console.error("Stream error:",H),H}finally{try{await K.delete(U.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}}}))}catch(X){return k(X)}}async function fQ(Z,Y){try{let X=await Z.json(),J=S(c0,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=x.threads,U=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=U.thread_id,Q.temporary=!0;let W=await K.createRun(U.thread_id,J.assistant_id,Q),z={};try{for await(let{event:H,data:G}of F4(K,W,Q,{attempt:0,getGraph:cZ}))if(H==="end"||H==="writes/value"){if(G&&typeof G==="object")Object.assign(z,G)}}finally{try{await K.delete(U.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}}return m(z,200,{"Content-Location":`/threads/${U.thread_id}/runs/${W.run_id}`})}catch(X){return k(X)}}async function jQ(Z,Y){try{let X=await Z.json(),J=S(r1,X),Q=x.threads,$=[],K=J.map(async(W)=>{try{let z=FZ(W);z.config=z.config||{},z.config.configurable=z.config.configurable||{};let H=Y?.langgraph_context;if(H)Object.assign(z.config.configurable,H);let G=await Q.create({metadata:{...z.metadata,temporary:!0}});z.config.configurable.graph_id=W.assistant_id,z.config.configurable.thread_id=G.thread_id,z.temporary=!0;let F=await Q.createRun(G.thread_id,W.assistant_id,z);return(async()=>{let M=!1;try{for await(let N of F4(Q,F,z,{attempt:0,getGraph:cZ}));}catch(N){console.error("Batch run error:",N)}finally{try{await Q.delete(G.thread_id)}catch(N){console.error("Error cleaning up temporary thread:",N)}if(!M){M=!0;try{await dZ.globalMessageQueue.removeQueue(F.run_id)}catch(N){}}}})(),{thread_id:G.thread_id,run_id:F.run_id}}catch(z){return console.error("Batch run creation error:",z),{error:(z instanceof Error?z.message:"Unknown error")||"Unknown error"}}}),U=await Promise.all(K);return $.push(...U),m($,200)}catch(X){return k(X)}}async function SQ(Z,Y){try{let X=await Z.json(),J=S(n1,X),Q=new URL(Z.url),$=S(o1,{action:Q.searchParams.get("action")||"interrupt"}),K=x.threads,U=[];if("run_ids"in J&&J.run_ids)for(let W of J.run_ids)try{console.warn(`Cancel by run_id ${W} not fully implemented yet`)}catch(z){console.error(`Error cancelling run ${W}:`,z)}else if("thread_id"in J&&J.thread_id){let W=J.thread_id;try{let z=await K.listRuns(W,{limit:1000,offset:0});for(let H of z)try{x.runs.cancel(W,H.run_id,$.wait,$.action),U.push(H.run_id)}catch(G){console.error(`Error cancelling run ${H.run_id}:`,G)}}catch(z){console.error(`Error listing runs for thread ${W}:`,z)}}else if("status"in J&&J.status)console.warn(`Cancel by status ${J.status} not fully implemented yet`);return new Response(null,{status:204})}catch(X){return k(X)}}var yQ=[{method:"POST",pattern:/^\/assistants\/search$/,handler:a1},{method:"POST",pattern:/^\/assistants\/count$/,handler:s1},{method:"GET",pattern:/^\/assistants\/[^/]+$/,handler:t1},{method:"DELETE",pattern:/^\/assistants\/[^/]+$/,handler:e1},{method:"PATCH",pattern:/^\/assistants\/[^/]+$/,handler:ZQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/graph$/,handler:YQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/subgraphs$/,handler:XQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/subgraphs\/[^/]+$/,handler:JQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/schemas$/,handler:QQ},{method:"POST",pattern:/^\/assistants\/[^/]+\/versions$/,handler:$Q},{method:"POST",pattern:/^\/assistants\/[^/]+\/latest$/,handler:KQ},{method:"POST",pattern:/^\/assistants$/,handler:WQ},{method:"POST",pattern:/^\/threads$/,handler:UQ},{method:"POST",pattern:/^\/threads\/search$/,handler:zQ},{method:"POST",pattern:/^\/threads\/count$/,handler:HQ},{method:"GET",pattern:/^\/threads\/[^/]+$/,handler:GQ},{method:"PATCH",pattern:/^\/threads\/[^/]+$/,handler:OQ},{method:"DELETE",pattern:/^\/threads\/[^/]+$/,handler:qQ},{method:"GET",pattern:/^\/threads\/[^/]+\/state$/,handler:FQ},{method:"POST",pattern:/^\/threads\/[^/]+\/state$/,handler:MQ},{method:"POST",pattern:/^\/threads\/[^/]+\/state\/checkpoint$/,handler:NQ},{method:"GET",pattern:/^\/threads\/[^/]+\/history$/,handler:_Q},{method:"POST",pattern:/^\/threads\/[^/]+\/history$/,handler:AQ},{method:"POST",pattern:/^\/threads\/[^/]+\/copy$/,handler:wQ},{method:"GET",pattern:/^\/threads\/[^/]+\/stream$/,handler:BQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs$/,handler:IQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/stream$/,handler:LQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/wait$/,handler:vQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/cancel$/,handler:CQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs$/,handler:RQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+$/,handler:DQ},{method:"DELETE",pattern:/^\/threads\/[^/]+\/runs\/[^/]+$/,handler:VQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/join$/,handler:EQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/stream$/,handler:PQ},{method:"POST",pattern:/^\/runs$/,handler:bQ},{method:"POST",pattern:/^\/runs\/stream$/,handler:TQ},{method:"POST",pattern:/^\/runs\/wait$/,handler:fQ},{method:"POST",pattern:/^\/runs\/batch$/,handler:jQ},{method:"POST",pattern:/^\/runs\/cancel$/,handler:SQ}],kQ=(Z)=>{let Y=new URL(Z.url).pathname.toString(),X="";if(Y.includes("/threads"))X=Y.split("/threads")[0];else if(Y.includes("/assistants"))X=Y.split("/assistants")[0];return new Request(Z.url.replace(X,""),{method:Z.method,headers:Z.headers,body:Z.body,duplex:Z.duplex})};async function _8(Z,Y={}){Z=kQ(Z);try{await dZ.initGlobal();let J=new URL(Z.url).pathname,Q=Z.method;for(let $ of yQ)if($.method===Q&&$.pattern.test(J))return await $.handler(Z,Y);return new Response("Not Found",{status:404})}catch(X){return console.error("Request error:",X),k(X)}}import{execa as w8}from"execa";import hQ from"extract-zip";import xQ from"fs-extra";import*as A0 from"node:os";import{dirname as B8,join as gQ}from"node:path";import{pipeline as uQ}from"node:stream/promises";import{fileURLToPath as mQ}from"node:url";import{pathExists as A8}from"path-exists";import{temporaryFile as pQ}from"tempy";import{xdgCache as dQ}from"xdg-basedir";var{mkdir:tY,createWriteStream:cQ,move:lQ}=xQ,L8=B8(mQ(import.meta.url)),iQ="microsoft/ripgrep-prebuilt",sY=process.env.RIPGREP_VERSION||"v15.0.0",rQ=()=>{let Z=process.env.npm_config_arch||A0.arch(),Y=process.env.platform||A0.platform();switch(Y){case"darwin":switch(Z){case"arm64":return"aarch64-apple-darwin.tar.gz";default:return"x86_64-apple-darwin.tar.gz"}case"win32":switch(Z){case"x64":return"x86_64-pc-windows-msvc.zip";case"arm":return"aarch64-pc-windows-msvc.zip";default:return"i686-pc-windows-msvc.zip"}case"linux":switch(Z){case"x64":return"x86_64-unknown-linux-musl.tar.gz";case"arm":case"armv7l":return"arm-unknown-linux-gnueabihf.tar.gz";case"arm64":return"aarch64-unknown-linux-gnu.tar.gz";case"ppc64":return"powerpc64le-unknown-linux-gnu.tar.gz";case"s390x":return"s390x-unknown-linux-gnu.tar.gz";default:return"i686-unknown-linux-musl.tar.gz"}default:throw Error("Unknown platform: "+Y)}},oQ=async(Z,Y)=>{try{let X=pQ(),J=await fetch(Z);if(!J.ok)throw Error(`HTTP ${J.status}: ${J.statusText}`);await uQ(J.body,cQ(X)),await tY(B8(Y),{recursive:!0}),await lQ(X,Y)}catch(X){throw console.error(`Failed to download "${Z}"`),X}},nQ=async(Z,Y)=>{try{await tY(Y,{recursive:!0}),await hQ(Z,{dir:Y})}catch(X){throw console.error(`Failed to unzip "${Z}"`),X}},aQ=async(Z,Y)=>{try{await tY(Y,{recursive:!0}),await w8("tar",["xvf",Z,"-C",Y])}catch(X){throw console.error(`Failed to extract "${Z}"`),X}},sQ=async(Z)=>{if(Z==="android")try{return await w8("pkg",["install","ripgrep","-y"]),!0}catch(Y){return console.info("Could not install ripgrep via pkg. Falling back to download."),!1}return!1},tQ=gQ(L8,`rg${process.platform==="win32"?".exe":""}`),P8=async(Z)=>{if(await A8(tQ)){console.log("rg cached");return}let Y=process.env.platform||A0.platform();if(Y==="android"){if(await sQ(Y))return}let X=rQ(),Q=`${process.env.RIPGREP_PREBUILT_BINARIES_MIRROR||`https://v6.gh-proxy.org/https://github.com/${iQ}/releases/download`}/${sY}/ripgrep-${sY}-${X}`,$=`${dQ}/vscode-ripgrep/ripgrep-${sY}-${X}`,K=Z??L8;if(!await A8($))await oQ(Q,$);else console.info(`File ${$} has been cached`);if($.endsWith(".tar.gz"))await aQ($,K);else if($.endsWith(".zip"))await nQ($,K);else throw Error(`Invalid downloadPath ${$}`)};await P8();lY("code",R8);var C8=(Z,Y={})=>{return _8(new Request(Z,Y),{})};import eQ from"openai";import Z$ from"@anthropic-ai/sdk";import{GoogleGenerativeAI as Y$}from"@google/generative-ai";var X$=async()=>{if(!process.env.ANTHROPIC_API_KEY)return[];let Z=[];try{for await(let Y of new Z$().beta.models.list())Z.push({id:Y.id,name:Y.display_name,provider:"anthropic"})}catch(Y){console.error("Failed to fetch Anthropic models:",Y)}return Z},J$=async()=>{if(!process.env.OPENAI_API_KEY)return[];try{return await new eQ().models.list().then((Z)=>Z.data.map((Y)=>{return{id:Y.id,name:Y.id,provider:"openai"}}).sort((Y,X)=>Y.id.localeCompare(X.id)))}catch(Z){return console.error("Failed to fetch OpenAI models:",Z),[]}},Q$=async()=>{let Z=process.env.GEMINI_API_KEY;if(!Z)return[];let Y=[{id:"gemini-2.5-flash-preview-06-17",name:"Gemini 2.5 Flash Preview (06-17)",provider:"gemini"},{id:"gemini-2.5-pro-preview-06-05",name:"Gemini 2.5 Pro Preview (06-05)",provider:"gemini"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",provider:"gemini"},{id:"gemini-2.0-flash-lite",name:"Gemini 2.0 Flash Lite",provider:"gemini"},{id:"gemini-1.5-flash",name:"Gemini 1.5 Flash",provider:"gemini"},{id:"gemini-1.5-flash-8b",name:"Gemini 1.5 Flash 8B",provider:"gemini"},{id:"gemini-1.5-pro",name:"Gemini 1.5 Pro",provider:"gemini"},{id:"gemini-1.0-pro",name:"Gemini 1.0 Pro",provider:"gemini"},{id:"gemini-2.0-flash-exp",name:"Gemini 2.0 Flash Experimental",provider:"gemini"},{id:"gemini-exp-1206",name:"Gemini Experimental 1206",provider:"gemini"},{id:"gemini-2.5-pro-exp-03-25",name:"Gemini 2.5 Pro Experimental (03-25)",provider:"gemini"},{id:"gemini-2.5-flash-preview-05-20",name:"Gemini 2.5 Flash Preview (05-20)",provider:"gemini"}];try{return await new Y$(Z).getGenerativeModel({model:"gemini-1.5-flash"}),Y}catch(X){return console.error("Failed to verify Gemini API key:",X),[]}},I8=async()=>{return(await Promise.all([X$().catch(()=>[]),J$().catch(()=>[]),Q$().catch(()=>[])])).flat()};var i0=P(g(),1);function v8({tools:Z,setTools:Y}){let X=i0.useRef(!1);i0.useEffect(()=>{if(!X.current)Y(Z),X.current=!0},[Z,Y])}var V8=P(g(),1);function D8(Z){if(!Z)return{isValid:!1,needsSetup:!0,reason:"未找到配置文件"};if(!Z.providers||Z.providers.length===0)return{isValid:!1,needsSetup:!0,reason:"未配置任何 Provider"};let Y=Z.providers.find((X)=>X.id===Z.provider_id);if(!Y)return{isValid:!1,needsSetup:!0,reason:`Provider "${Z.provider_id}" 不存在`,invalidProviderRef:!0};if(!Y.apiKey||Y.apiKey.trim()==="")return{isValid:!1,needsSetup:!0,reason:`Provider "${Z.provider_id}" 未配置 API Key`,missingApiKey:!0};return{isValid:!0,needsSetup:!1}}function E8({config:Z}){return V8.useMemo(()=>{if(!Z)return{validation:null,needsSetup:!0,isValid:!1};let Y=D8(Z);return{validation:Y,needsSetup:Y.needsSetup,isValid:!Y.needsSetup}},[Z])}var b8=P(g(),1);function T8({shouldFocus:Z}){let Y=W4();b8.useEffect(()=>{if(Z)Y.focus("global-input")},[Z,Y])}var gZ=P(g(),1);function f8(){let[Z,Y]=gZ.useState("chat"),X=W4(),J=gZ.useCallback(()=>{Y("history")},[]),Q=gZ.useCallback(()=>{Y("knowledge")},[]),$=gZ.useCallback(()=>{Y("settings")},[]),K=gZ.useCallback(()=>{Y("model-provider")},[]),U=gZ.useCallback(()=>{Y("agent")},[]),W=gZ.useCallback(()=>{Y("task")},[]),z=gZ.useCallback(()=>{Y("mcp")},[]),H=gZ.useCallback(()=>{Y("process")},[]),G=gZ.useCallback(()=>{Y("chat"),X.focus("global-input")},[X]);return{activeView:Z,isChatView:Z==="chat",switchToHistory:J,switchToKnowledge:Q,switchToSettings:$,switchToModelProvider:K,switchToAgent:U,switchToTask:W,switchToMcp:z,switchToProcess:H,closePanel:G}}var r0=P(g(),1);function $$(Z){let Y=`# 任务:${Z.title}
8
8
 
9
9
  `;if(Y+=`**描述:**
10
10
  ${Z.description}
@@ -31,22 +31,22 @@ ${Z.acceptanceCriteria.map((X,J)=>`${J+1}. ${X}`).join(`
31
31
  ${X.acceptanceCriteria.map((Q)=>`- ${Q}`).join(`
32
32
  `)}
33
33
  `}),Y+=`
34
- `;return Y.trim()}function j8(Z){let{sendMessage:Y,createNewChat:X}=WZ(),{extraParams:J}=UZ(),{closePanel:Q}=Z,$=i0.useMemo(()=>{return{...J,is_in_task:!0}},[J]);return{handleExecuteTask:i0.useCallback((W)=>{let z=[{type:"human",content:`${$$(W)}
34
+ `;return Y.trim()}function j8(Z){let{sendMessage:Y,createNewChat:X}=WZ(),{extraParams:J}=UZ(),{closePanel:Q}=Z,$=r0.useMemo(()=>{return{...J,is_in_task:!0}},[J]);return{handleExecuteTask:r0.useCallback((U)=>{let z=[{type:"human",content:`${$$(U)}
35
35
 
36
- 请你先写一个 TODO LIST 然后开始这个任务,最后完成任务的时候,使用 commit_task`}];X(W4).then(()=>{return Y(z,{extraParams:$,metadata:W4})}).then(()=>{w4("任务已发送给 Agent"),Q()}).catch((H)=>{console.error("Task execution failed:",H),w4("任务执行失败")})},[Y,X,$,Q])}}var r0=L(x(),1),k8=L(v(),1),S8=r0.createContext(void 0),J0=()=>{let Z=r0.useContext(S8);if(Z===void 0)throw Error("useChatPanel must be used within ChatPanelProvider. Make sure your component is a child of ChatController.");return Z},y8=({children:Z,value:Y})=>{return k8.jsxDEV(S8.Provider,{value:Y,children:Z},void 0,!1,void 0,this)};var p4=L(x(),1);var h8=(Z)=>{return Z.additional_kwargs?.reasoning_content||Array.isArray(Z.content)&&Z.content.find((Y)=>Y.type==="thinking")?.thinking},Q0=(Z)=>{return typeof Z.content==="string"?Z.content:Z.content?.filter((Y)=>{return Y.type==="text"}).map((Y)=>Y.text).join("")};o0();var eY=L(x(),1),s=L(v(),1),F$={approve:"green",reject:"red",edit:"yellow",modify:"cyan"},M$=(Z)=>{return F$[Z.toLowerCase()]||"white"},u8=({request:Z,allowedDecisions:Y=["approve","edit","reject"],onApprove:X,onEdit:J,onReject:Q,autoFocus:$=!0})=>{let[K,W]=eY.useState("approve"),{value:U,setTrue:z,setFalse:H}=g8(!1),[G,F]=eY.useState(""),M=K4(),_=Z.messageIndex,A=Z.description;mZ((E,c)=>{if(U&&c.escape)B()},{isActive:U});let P=()=>{if(!G.trim())return;if(K==="edit")try{let E=JSON.parse(G);J(E)}catch(E){console.error("Invalid JSON:",E);return}else{let E=`User rejected to run this tool, reason: ${G}`;Q(E)}H(),F("")},B=()=>{H(),F("")},C=([E])=>{if(E==="approve"){X(),M.focus("global-input");return}if(W(E),z(),E==="edit")F(JSON.stringify(Z.toolCall.args,null,2));else F("")},R=Y.map((E)=>({label:E,value:E}));return U?(()=>{let E=M$(K),c=K==="edit";return s.jsxDEV(N,{flexDirection:"column",paddingX:1,marginTop:0,children:[s.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[s.jsxDEV(O,{color:E,bold:!0,children:[K.toUpperCase()," MODE - ",Z.toolCall.name]},void 0,!0,void 0,this),_!==void 0&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Message Index: ",_]},void 0,!0,void 0,this),A&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Description: ",A]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),c?s.jsxDEV(N,{flexDirection:"column",marginTop:0,children:[s.jsxDEV(O,{color:"yellow",dimColor:!0,children:"Editing action arguments (JSON format):"},void 0,!1,void 0,this),s.jsxDEV(N,{paddingX:1,children:s.jsxDEV(oZ,{value:G,onChange:F,onSubmit:P,placeholder:"Enter JSON...",autoFocus:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):s.jsxDEV(N,{flexDirection:"column",marginTop:0,children:[s.jsxDEV(O,{color:"cyan",dimColor:!0,children:"Enter additional message for this action:"},void 0,!1,void 0,this),s.jsxDEV(N,{padding:1,children:s.jsxDEV(oZ,{value:G,onChange:F,onSubmit:P,placeholder:"Enter message...",autoFocus:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV(N,{marginTop:0,children:s.jsxDEV(O,{color:"gray",children:[s.jsxDEV(O,{color:E,bold:!0,children:"↵"},void 0,!1,void 0,this)," ","Submit |",s.jsxDEV(O,{color:"red",bold:!0,children:[" ","Esc"]},void 0,!0,void 0,this)," ","Cancel"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)})():(()=>s.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[s.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[s.jsxDEV(O,{color:"cyan",bold:!0,children:Z.toolCall.name},void 0,!1,void 0,this),_!==void 0&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Message Index: ",_]},void 0,!0,void 0,this),A&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Description: ",A]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV(N,{children:s.jsxDEV(u4,{singleSelect:!0,options:R,onSubmit:C,autoFocus:$},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this))()};var n0=L(x(),1),m8=L(v(),1),ZX={type:"approval",render(Z,Y){let{content:X,metadata:J}=Z,Q=K4(),$=n0.useCallback(()=>{Y({state:"submitted",result:{status:"approved"}}),Q.focus("global-input")},[Y,Q]),K=n0.useCallback((z)=>{Y({state:"edited",result:{status:"edited",editedArgs:z}}),Q.focus("global-input")},[Y,Q]),W=n0.useCallback((z)=>{Y({state:"cancelled",result:{status:"rejected",message:z}}),Q.focus("global-input")},[Y,Q]),U={id:Z.id,toolCall:X.toolCall,status:Z.state==="submitted"?"approved":Z.state==="edited"?"edited":Z.state==="cancelled"?"rejected":"pending",createdAt:Z.createdAt,messageIndex:J.messageIndex,description:J.description};return m8.jsxDEV(u8,{request:U,allowedDecisions:["approve","edit","reject"],onApprove:$,onEdit:K,onReject:W,autoFocus:!0},Z.id,!1,void 0,this)},defaultConfig:{layout:{border:!1,padding:0},interaction:{autoSubmit:!1,allowSkip:!1}}};var YX=L(x(),1);var N$={title:{maxWidth:60,ellipsis:"…"},description:{maxWidth:80,ellipsis:"…"},optionLabel:{maxWidth:50,ellipsis:"…"},tabLabel:{maxWidth:30,ellipsis:"…"},fullTitle:{maxWidth:80,ellipsis:"…"}},_$=(Z,Y=20,X="…")=>{if(!Z)return"";if(Z.length<=Y)return Z;return Z.substring(0,Y-X.length)+X},$0=(Z,Y)=>{let X=N$[Y];return _$(Z,X.maxWidth,X.ellipsis)};var A4=L(v(),1),w$=(Z)=>{return $0(Z,"optionLabel")},XX={type:"selection",render(Z,Y){let{content:X,metadata:J,result:Q}=Z,[$,K]=YX.useState(Q?.selected||[]),[W,U]=YX.useState(Q?.customInput||""),z=X.options.map((P)=>({label:w$(P.label),value:P.value})),H=(P,B)=>{Y({result:{selected:P??$,customInput:B??W}})},G=(P)=>{K(P),H(P,void 0)},F=(P)=>{U(P),H(void 0,P)},M=()=>{Y({state:"submitted",result:{selected:$,customInput:W}})},_=J?.title?$0(J.title,"title"):null,A=J?.description?$0(J.description,"description"):null;return A4.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[_&&A4.jsxDEV(N,{marginBottom:1,children:A4.jsxDEV(O,{color:"cyan",bold:!0,children:_},void 0,!1,void 0,this)},void 0,!1,void 0,this),A&&A4.jsxDEV(N,{marginBottom:1,children:A4.jsxDEV(O,{dimColor:!0,children:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),A4.jsxDEV(u4,{options:z,singleSelect:X.singleSelect,values:$,onChange:G,onSubmit:M,autoFocus:!0},void 0,!1,void 0,this),X.allowCustomInput&&A4.jsxDEV(N,{marginTop:1,flexDirection:"column",children:A4.jsxDEV(oZ,{value:W,onChange:F,onSubmit:M,placeholder:X.placeholder||"Type custom option...",autoFocus:!1},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},validate(Z){if(Z.options.length===0)return"At least one option is required";if(Z.singleSelect&&Z.maxSelections&&Z.maxSelections>1)return"Single select cannot have maxSelections > 1";return},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var p8=L(x(),1);var U4=L(v(),1),JX={type:"input",render(Z,Y){let{content:X,metadata:J}=Z,[Q,$]=p8.useState(X.defaultValue||""),K=()=>{Y({state:"submitted",result:{value:Q}})};return U4.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[J?.title&&U4.jsxDEV(N,{marginBottom:1,children:U4.jsxDEV(O,{color:"cyan",bold:!0,children:J.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),J?.description&&U4.jsxDEV(N,{marginBottom:1,children:U4.jsxDEV(O,{dimColor:!0,children:J.description},void 0,!1,void 0,this)},void 0,!1,void 0,this),U4.jsxDEV(N,{children:[U4.jsxDEV(oZ,{value:Q,onChange:$,onSubmit:K,placeholder:X.placeholder,autoFocus:!0},void 0,!1,void 0,this),")"]},void 0,!0,void 0,this),X.maxLength&&U4.jsxDEV(N,{marginTop:1,children:U4.jsxDEV(O,{dimColor:!0,children:["Max length: ",X.maxLength]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},validate(Z){if(Z.validation?.pattern&&Z.defaultValue){if(!Z.validation.pattern.test(Z.defaultValue))return"Input does not match required pattern"}if(Z.validation?.minLength&&Z.defaultValue&&Z.defaultValue.length<Z.validation.minLength)return`Input must be at least ${Z.validation.minLength} characters`;return},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var m4=L(v(),1),QX={type:"confirm",render(Z,Y){let{content:X,metadata:J}=Z,Q=()=>{Y({state:"submitted",result:{confirmed:!0}})},$=()=>{Y({state:"cancelled",result:{confirmed:!1}})},K=[{label:X.confirmLabel||"Confirm",value:"confirm"},{label:X.cancelLabel||"Cancel",value:"cancel"}],W=([U])=>{if(U==="confirm")Q();else $()};return m4.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[J?.title&&m4.jsxDEV(N,{marginBottom:1,children:m4.jsxDEV(O,{color:X.danger?"red":"cyan",bold:!0,children:J.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),m4.jsxDEV(N,{marginBottom:1,children:m4.jsxDEV(O,{children:X.message},void 0,!1,void 0,this)},void 0,!1,void 0,this),m4.jsxDEV(u4,{options:K,singleSelect:!0,onSubmit:W,autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var A$=L(x(),1);var B$=L(v(),1);var z4=L(x(),1);var K0=L(x(),1);var zZ=L(v(),1),d8=({items:Z,defaultIndex:Y=0,onChange:X,disabled:J=!1,autoFocus:Q=!0,variant:$="line"})=>{let{isFocused:K}=c8({autoFocus:Q}),[W,U]=K0.useState(Y),z=K0.default.useMemo(()=>`tabs-${Math.random().toString(36).substring(2,9)}`,[]),H=K0.useCallback((M)=>{if(M<0||M>=Z.length||Z[M].disabled)return;U(M),X?.(M,Z[M])},[Z,X]);mZ((M,_)=>{if(J)return;if(_.leftArrow)H(W-1);else if(_.rightArrow)H(W+1)},{isActive:!J});let G=()=>{return Z.map((M,_)=>{let A=_===W,P=K&&!J,B;if($==="line")B=zZ.jsxDEV(N,{marginRight:1,children:[zZ.jsxDEV(O,{color:M.disabled?"gray":A?P?"green":"cyan":"gray",bold:A&&P,children:M.label},void 0,!1,void 0,this),A&&zZ.jsxDEV(O,{color:P?"green":"cyan",children:"_"},void 0,!1,void 0,this)]},`${z}-${M.id}`,!0,void 0,this);else if($==="enclosed"){let C=_===0||A?"┌":"─",R=_===Z.length-1||A?"┐":"─",D=_===0||A?"│":" ",j=_===Z.length-1||A?"│":" ",E=A?"─":" ",c=A?" ":"",i=M.disabled?"gray":A?P?"green":"cyan":"gray";B=zZ.jsxDEV(N,{children:zZ.jsxDEV(N,{flexDirection:"column",children:[zZ.jsxDEV(N,{children:[zZ.jsxDEV(O,{color:i,children:C},void 0,!1,void 0,this),zZ.jsxDEV(O,{color:i,bold:A&&P,children:[c,M.label,c]},void 0,!0,void 0,this),zZ.jsxDEV(O,{color:i,children:R},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A&&zZ.jsxDEV(N,{children:[zZ.jsxDEV(O,{color:i,children:D},void 0,!1,void 0,this),zZ.jsxDEV(O,{color:i,children:E.repeat(M.label.length+2)},void 0,!1,void 0,this),zZ.jsxDEV(O,{color:i,children:j},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},`${z}-${M.id}`,!1,void 0,this)}else{let C=A?"●":"○";B=zZ.jsxDEV(N,{marginRight:2,children:zZ.jsxDEV(O,{color:M.disabled?"gray":A?P?"green":"cyan":"gray",bold:A&&P,children:[C," ",M.label]},void 0,!0,void 0,this)},`${z}-${M.id}`,!1,void 0,this)}return B})},F=()=>{let M=Z[W];if(!M?.content)return null;return zZ.jsxDEV(N,{marginTop:1,paddingX:2,paddingY:1,flexDirection:"column",children:M.content},void 0,!1,void 0,this)};return zZ.jsxDEV(N,{flexDirection:"column",flexGrow:1,children:[zZ.jsxDEV(N,{children:G()},void 0,!1,void 0,this),Z.some((M)=>M.content)&&F()]},void 0,!0,void 0,this)};var l8=L(x(),1);var i8=L(v(),1),$X=({interaction:Z,renderer:Y,onChange:X})=>{let J=l8.useMemo(()=>{return{layout:{border:!1,padding:0,...Y.defaultConfig?.layout,...Z.config.layout},interaction:{autoSubmit:!1,allowSkip:!1,showPreview:!0,...Y.defaultConfig?.interaction,...Z.config.interaction},style:{...Y.defaultConfig?.style,...Z.config.style}}},[Z.config,Y.defaultConfig]),Q=J.style.backgroundColor;return i8.jsxDEV(N,{backgroundColor:Q,paddingX:J.layout.padding,marginBottom:1,flexDirection:"column",children:Y.render({...Z,config:J},X)},void 0,!1,void 0,this)};o0();var B4=L(v(),1),L$=(Z)=>{return $0(Z,"fullTitle")},KX=()=>{let Z=uZ(),[Y,X]=z4.useState(null),{focusNext:J,focus:Q}=K4(),$=z4.useMemo(()=>{return Z.getInteractions()},[Z.getInteractions()]);z4.useEffect(()=>{if($.length>0&&!Y)X($[0].id)},[$,Y]);let K=z4.useMemo(()=>{return $.map((G)=>{let F={idle:"\uD83D\uDD04",active:"\uD83D\uDD04",submitted:"✅",edited:"⛔",cancelled:"\uD83D\uDEAB"}[G.state]||"",M=L$(G.metadata.title||G.content.type);return{id:G.id,label:`${F} ${M}`,content:null}})},[$]),W=z4.useCallback((G,F)=>{X(F.id)},[]),U=z4.useCallback((G)=>{if($.every((A)=>A.state==="submitted"||A.state==="edited"||A.state==="cancelled")){Q("global-input");return}let _=($.findIndex((A)=>A.id===G)+1)%$.length;X($[_].id)},[$,Q]),z=r8(()=>{J()});jZ(z,Y?100:null);let H=()=>{if(!Y)return null;let G=$.find((M)=>M.id===Y);if(!G)return null;let F=E4.get(G.content.type);if(!F)return B4.jsxDEV(N,{paddingX:1,children:B4.jsxDEV(O,{color:"red",children:["Unknown renderer: ",G.content.type]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return B4.jsxDEV($X,{interaction:G,renderer:F,onChange:(M)=>{if(Z.updateInteraction(G.id,M),M.state==="submitted"||M.state==="edited"||M.state==="cancelled")U(G.id)}},G.id,!1,void 0,this)};if($.length===0)return null;return B4.jsxDEV(N,{flexDirection:"column",borderColor:"cyan",borderStyle:"single",width:"100%",children:[B4.jsxDEV(N,{justifyContent:"space-between",paddingX:1,marginBottom:1,children:B4.jsxDEV(O,{color:"cyan",bold:!0,children:["Interactions (",$.length,")"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),B4.jsxDEV(N,{paddingX:1,marginBottom:1,children:B4.jsxDEV(d8,{items:K,defaultIndex:K.findIndex((G)=>G.id===Y),onChange:W,autoFocus:!0,variant:"line"},Y,!1,void 0,this)},void 0,!1,void 0,this),H()]},void 0,!0,void 0,this)};o0();function o8(){E4.register("approval",ZX),E4.register("selection",XX),E4.register("input",JX),E4.register("confirm",QX)}o8();var W0=L(v(),1);import{z as b4}from"zod";var P$=b4.object({label:b4.string().min(1).max(50).describe("选项显示文本,简洁明了(1-50 字符)")}),R$=b4.object({description:b4.string().min(1).describe("向用户提出的问题,清晰具体,包含必要的上下文"),type:b4.enum(["single_select","multi_select"]).describe("选择类型:single_select(单选)或 multi_select(多选)"),options:b4.array(P$).min(2).max(6).describe("选项列表,至少 2 个,最多 6 个"),allow_custom_input:b4.boolean().default(!0).describe("是否允许用户输入自定义文本,默认 true"),placeholder:b4.string().optional().describe("自定义输入框的占位符文本")}),C$=({tool:Z})=>{let{addInteraction:Y,getInteractions:X,updateInteraction:J}=uZ(),[Q,$]=p4.useState(null),K=p4.useRef(!1),W=Z.getInputRepaired();if(p4.useEffect(()=>{if(Z.state==="interrupted"&&!Q&&!K.current){let z={type:"selection",options:W.options?.map((G,F)=>({label:G.label,value:G.label}))||[],singleSelect:W.type==="single_select",allowCustomInput:W.allow_custom_input??!0,placeholder:W.placeholder},H=Y(z,{tool:Z,metadata:{title:W.description||"请选择一个选项",groupKey:"user-input"}});$(H.id)}},[Z,Q,Y,W]),p4.useEffect(()=>{if(!Q||K.current)return;let U=()=>{let G=X().find((F)=>F.id===Q);if(G&&(G.state==="submitted"||G.state==="edited"||G.state==="cancelled")&&!G.resultSent){K.current=!0;let F=G.result,M="";if(F){if(F.selected&&F.selected.length>0)M+=`User selected:
36
+ 请你先写一个 TODO LIST 然后开始这个任务,最后完成任务的时候,使用 commit_task`}];X(U4).then(()=>{return Y(z,{extraParams:$,metadata:U4})}).then(()=>{N4("任务已发送给 Agent"),Q()}).catch((H)=>{console.error("Task execution failed:",H),N4("任务执行失败")})},[Y,X,$,Q])}}var o0=P(g(),1),k8=P(I(),1),S8=o0.createContext(void 0),X0=()=>{let Z=o0.useContext(S8);if(Z===void 0)throw Error("useChatPanel must be used within ChatPanelProvider. Make sure your component is a child of ChatController.");return Z},y8=({children:Z,value:Y})=>{return k8.jsxDEV(S8.Provider,{value:Y,children:Z},void 0,!1,void 0,this)};var p4=P(g(),1);var h8=(Z)=>{return Z.additional_kwargs?.reasoning_content||Array.isArray(Z.content)&&Z.content.find((Y)=>Y.type==="thinking")?.thinking},J0=(Z)=>{return typeof Z.content==="string"?Z.content:Z.content?.filter((Y)=>{return Y.type==="text"}).map((Y)=>Y.text).join("")};n0();var ZX=P(g(),1),s=P(I(),1),F$={approve:"green",reject:"red",edit:"yellow",modify:"cyan"},M$=(Z)=>{return F$[Z.toLowerCase()]||"white"},u8=({request:Z,allowedDecisions:Y=["approve","edit","reject"],onApprove:X,onEdit:J,onReject:Q,autoFocus:$=!0})=>{let[K,U]=ZX.useState("approve"),{value:W,setTrue:z,setFalse:H}=g8(!1),[G,F]=ZX.useState(""),M=W4(),N=Z.messageIndex,w=Z.description;uZ((V,d)=>{if(W&&d.escape)B()},{isActive:W});let L=()=>{if(!G.trim())return;if(K==="edit")try{let V=JSON.parse(G);J(V)}catch(V){console.error("Invalid JSON:",V);return}else{let V=`User rejected to run this tool, reason: ${G}`;Q(V)}H(),F("")},B=()=>{H(),F("")},C=([V])=>{if(V==="approve"){X(),M.focus("global-input");return}if(U(V),z(),V==="edit")F(JSON.stringify(Z.toolCall.args,null,2));else F("")},R=Y.map((V)=>({label:V,value:V}));return W?(()=>{let V=M$(K),d=K==="edit";return s.jsxDEV(_,{flexDirection:"column",paddingX:1,marginTop:0,children:[s.jsxDEV(_,{flexDirection:"column",marginBottom:1,children:[s.jsxDEV(O,{color:V,bold:!0,children:[K.toUpperCase()," MODE - ",Z.toolCall.name]},void 0,!0,void 0,this),N!==void 0&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Message Index: ",N]},void 0,!0,void 0,this),w&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Description: ",w]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),d?s.jsxDEV(_,{flexDirection:"column",marginTop:0,children:[s.jsxDEV(O,{color:"yellow",dimColor:!0,children:"Editing action arguments (JSON format):"},void 0,!1,void 0,this),s.jsxDEV(_,{paddingX:1,children:s.jsxDEV(iZ,{value:G,onChange:F,onSubmit:L,placeholder:"Enter JSON...",autoFocus:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):s.jsxDEV(_,{flexDirection:"column",marginTop:0,children:[s.jsxDEV(O,{color:"cyan",dimColor:!0,children:"Enter additional message for this action:"},void 0,!1,void 0,this),s.jsxDEV(_,{padding:1,children:s.jsxDEV(iZ,{value:G,onChange:F,onSubmit:L,placeholder:"Enter message...",autoFocus:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV(_,{marginTop:0,children:s.jsxDEV(O,{color:"gray",children:[s.jsxDEV(O,{color:V,bold:!0,children:"↵"},void 0,!1,void 0,this)," ","Submit |",s.jsxDEV(O,{color:"red",bold:!0,children:[" ","Esc"]},void 0,!0,void 0,this)," ","Cancel"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)})():(()=>s.jsxDEV(_,{flexDirection:"column",paddingX:1,children:[s.jsxDEV(_,{flexDirection:"column",marginBottom:1,children:[s.jsxDEV(O,{color:"cyan",bold:!0,children:Z.toolCall.name},void 0,!1,void 0,this),N!==void 0&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Message Index: ",N]},void 0,!0,void 0,this),w&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Description: ",w]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV(_,{children:s.jsxDEV(u4,{singleSelect:!0,options:R,onSubmit:C,autoFocus:$},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this))()};var a0=P(g(),1),m8=P(I(),1),YX={type:"approval",render(Z,Y){let{content:X,metadata:J}=Z,Q=W4(),$=a0.useCallback(()=>{Y({state:"submitted",result:{status:"approved"}}),Q.focus("global-input")},[Y,Q]),K=a0.useCallback((z)=>{Y({state:"edited",result:{status:"edited",editedArgs:z}}),Q.focus("global-input")},[Y,Q]),U=a0.useCallback((z)=>{Y({state:"cancelled",result:{status:"rejected",message:z}}),Q.focus("global-input")},[Y,Q]),W={id:Z.id,toolCall:X.toolCall,status:Z.state==="submitted"?"approved":Z.state==="edited"?"edited":Z.state==="cancelled"?"rejected":"pending",createdAt:Z.createdAt,messageIndex:J.messageIndex,description:J.description};return m8.jsxDEV(u8,{request:W,allowedDecisions:["approve","edit","reject"],onApprove:$,onEdit:K,onReject:U,autoFocus:!0},Z.id,!1,void 0,this)},defaultConfig:{layout:{border:!1,padding:0},interaction:{autoSubmit:!1,allowSkip:!1}}};var XX=P(g(),1);var N$={title:{maxWidth:60,ellipsis:"…"},description:{maxWidth:80,ellipsis:"…"},optionLabel:{maxWidth:50,ellipsis:"…"},tabLabel:{maxWidth:30,ellipsis:"…"},fullTitle:{maxWidth:80,ellipsis:"…"}},_$=(Z,Y=20,X="…")=>{if(!Z)return"";if(Z.length<=Y)return Z;return Z.substring(0,Y-X.length)+X},Q0=(Z,Y)=>{let X=N$[Y];return _$(Z,X.maxWidth,X.ellipsis)};var _4=P(I(),1),A$=(Z)=>{return Q0(Z,"optionLabel")},JX={type:"selection",render(Z,Y){let{content:X,metadata:J,result:Q}=Z,[$,K]=XX.useState(Q?.selected||[]),[U,W]=XX.useState(Q?.customInput||""),z=X.options.map((L)=>({label:A$(L.label),value:L.value})),H=(L,B)=>{Y({result:{selected:L??$,customInput:B??U}})},G=(L)=>{K(L),H(L,void 0)},F=(L)=>{W(L),H(void 0,L)},M=()=>{Y({state:"submitted",result:{selected:$,customInput:U}})},N=J?.title?Q0(J.title,"title"):null,w=J?.description?Q0(J.description,"description"):null;return _4.jsxDEV(_,{flexDirection:"column",paddingX:1,children:[N&&_4.jsxDEV(_,{marginBottom:1,children:_4.jsxDEV(O,{color:"cyan",bold:!0,children:N},void 0,!1,void 0,this)},void 0,!1,void 0,this),w&&_4.jsxDEV(_,{marginBottom:1,children:_4.jsxDEV(O,{dimColor:!0,children:w},void 0,!1,void 0,this)},void 0,!1,void 0,this),_4.jsxDEV(u4,{options:z,singleSelect:X.singleSelect,values:$,onChange:G,onSubmit:M,autoFocus:!0},void 0,!1,void 0,this),X.allowCustomInput&&_4.jsxDEV(_,{marginTop:1,flexDirection:"column",children:_4.jsxDEV(iZ,{value:U,onChange:F,onSubmit:M,placeholder:X.placeholder||"Type custom option...",autoFocus:!1},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},validate(Z){if(Z.options.length===0)return"At least one option is required";if(Z.singleSelect&&Z.maxSelections&&Z.maxSelections>1)return"Single select cannot have maxSelections > 1";return},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var p8=P(g(),1);var z4=P(I(),1),QX={type:"input",render(Z,Y){let{content:X,metadata:J}=Z,[Q,$]=p8.useState(X.defaultValue||""),K=()=>{Y({state:"submitted",result:{value:Q}})};return z4.jsxDEV(_,{flexDirection:"column",paddingX:1,children:[J?.title&&z4.jsxDEV(_,{marginBottom:1,children:z4.jsxDEV(O,{color:"cyan",bold:!0,children:J.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),J?.description&&z4.jsxDEV(_,{marginBottom:1,children:z4.jsxDEV(O,{dimColor:!0,children:J.description},void 0,!1,void 0,this)},void 0,!1,void 0,this),z4.jsxDEV(_,{children:[z4.jsxDEV(iZ,{value:Q,onChange:$,onSubmit:K,placeholder:X.placeholder,autoFocus:!0},void 0,!1,void 0,this),")"]},void 0,!0,void 0,this),X.maxLength&&z4.jsxDEV(_,{marginTop:1,children:z4.jsxDEV(O,{dimColor:!0,children:["Max length: ",X.maxLength]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},validate(Z){if(Z.validation?.pattern&&Z.defaultValue){if(!Z.validation.pattern.test(Z.defaultValue))return"Input does not match required pattern"}if(Z.validation?.minLength&&Z.defaultValue&&Z.defaultValue.length<Z.validation.minLength)return`Input must be at least ${Z.validation.minLength} characters`;return},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var m4=P(I(),1),$X={type:"confirm",render(Z,Y){let{content:X,metadata:J}=Z,Q=()=>{Y({state:"submitted",result:{confirmed:!0}})},$=()=>{Y({state:"cancelled",result:{confirmed:!1}})},K=[{label:X.confirmLabel||"Confirm",value:"confirm"},{label:X.cancelLabel||"Cancel",value:"cancel"}],U=([W])=>{if(W==="confirm")Q();else $()};return m4.jsxDEV(_,{flexDirection:"column",paddingX:1,children:[J?.title&&m4.jsxDEV(_,{marginBottom:1,children:m4.jsxDEV(O,{color:X.danger?"red":"cyan",bold:!0,children:J.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),m4.jsxDEV(_,{marginBottom:1,children:m4.jsxDEV(O,{children:X.message},void 0,!1,void 0,this)},void 0,!1,void 0,this),m4.jsxDEV(u4,{options:K,singleSelect:!0,onSubmit:U,autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var w$=P(g(),1);var B$=P(I(),1);var H4=P(g(),1);var $0=P(g(),1);var zZ=P(I(),1),c8=({items:Z,defaultIndex:Y=0,onChange:X,disabled:J=!1,autoFocus:Q=!0,variant:$="line"})=>{let{isFocused:K}=d8({autoFocus:Q}),[U,W]=$0.useState(Y),z=$0.default.useMemo(()=>`tabs-${Math.random().toString(36).substring(2,9)}`,[]),H=$0.useCallback((M)=>{if(M<0||M>=Z.length||Z[M].disabled)return;W(M),X?.(M,Z[M])},[Z,X]);uZ((M,N)=>{if(J)return;if(N.leftArrow)H(U-1);else if(N.rightArrow)H(U+1)},{isActive:!J});let G=()=>{return Z.map((M,N)=>{let w=N===U,L=K&&!J,B;if($==="line")B=zZ.jsxDEV(_,{marginRight:1,children:[zZ.jsxDEV(O,{color:M.disabled?"gray":w?L?"green":"cyan":"gray",bold:w&&L,children:M.label},void 0,!1,void 0,this),w&&zZ.jsxDEV(O,{color:L?"green":"cyan",children:"_"},void 0,!1,void 0,this)]},`${z}-${M.id}`,!0,void 0,this);else if($==="enclosed"){let C=N===0||w?"┌":"─",R=N===Z.length-1||w?"┐":"─",D=N===0||w?"│":" ",f=N===Z.length-1||w?"│":" ",V=w?"─":" ",d=w?" ":"",l=M.disabled?"gray":w?L?"green":"cyan":"gray";B=zZ.jsxDEV(_,{children:zZ.jsxDEV(_,{flexDirection:"column",children:[zZ.jsxDEV(_,{children:[zZ.jsxDEV(O,{color:l,children:C},void 0,!1,void 0,this),zZ.jsxDEV(O,{color:l,bold:w&&L,children:[d,M.label,d]},void 0,!0,void 0,this),zZ.jsxDEV(O,{color:l,children:R},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w&&zZ.jsxDEV(_,{children:[zZ.jsxDEV(O,{color:l,children:D},void 0,!1,void 0,this),zZ.jsxDEV(O,{color:l,children:V.repeat(M.label.length+2)},void 0,!1,void 0,this),zZ.jsxDEV(O,{color:l,children:f},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},`${z}-${M.id}`,!1,void 0,this)}else{let C=w?"●":"○";B=zZ.jsxDEV(_,{marginRight:2,children:zZ.jsxDEV(O,{color:M.disabled?"gray":w?L?"green":"cyan":"gray",bold:w&&L,children:[C," ",M.label]},void 0,!0,void 0,this)},`${z}-${M.id}`,!1,void 0,this)}return B})},F=()=>{let M=Z[U];if(!M?.content)return null;return zZ.jsxDEV(_,{marginTop:1,paddingX:2,paddingY:1,flexDirection:"column",children:M.content},void 0,!1,void 0,this)};return zZ.jsxDEV(_,{flexDirection:"column",flexGrow:1,children:[zZ.jsxDEV(_,{children:G()},void 0,!1,void 0,this),Z.some((M)=>M.content)&&F()]},void 0,!0,void 0,this)};var l8=P(g(),1);var i8=P(I(),1),KX=({interaction:Z,renderer:Y,onChange:X})=>{let J=l8.useMemo(()=>{return{layout:{border:!1,padding:0,...Y.defaultConfig?.layout,...Z.config.layout},interaction:{autoSubmit:!1,allowSkip:!1,showPreview:!0,...Y.defaultConfig?.interaction,...Z.config.interaction},style:{...Y.defaultConfig?.style,...Z.config.style}}},[Z.config,Y.defaultConfig]),Q=J.style.backgroundColor;return i8.jsxDEV(_,{backgroundColor:Q,paddingX:J.layout.padding,marginBottom:1,flexDirection:"column",children:Y.render({...Z,config:J},X)},void 0,!1,void 0,this)};n0();var A4=P(I(),1),L$=(Z)=>{return Q0(Z,"fullTitle")},WX=()=>{let Z=xZ(),[Y,X]=H4.useState(null),{focusNext:J,focus:Q}=W4(),$=H4.useMemo(()=>{return Z.getInteractions()},[Z.getInteractions()]);H4.useEffect(()=>{if($.length>0&&!Y)X($[0].id)},[$,Y]);let K=H4.useMemo(()=>{return $.map((G)=>{let F={idle:"\uD83D\uDD04",active:"\uD83D\uDD04",submitted:"✅",edited:"⛔",cancelled:"\uD83D\uDEAB"}[G.state]||"",M=L$(G.metadata.title||G.content.type);return{id:G.id,label:`${F} ${M}`,content:null}})},[$]),U=H4.useCallback((G,F)=>{X(F.id)},[]),W=H4.useCallback((G)=>{if($.every((w)=>w.state==="submitted"||w.state==="edited"||w.state==="cancelled")){Q("global-input");return}let N=($.findIndex((w)=>w.id===G)+1)%$.length;X($[N].id)},[$,Q]),z=r8(()=>{J()});TZ(z,Y?100:null);let H=()=>{if(!Y)return null;let G=$.find((M)=>M.id===Y);if(!G)return null;let F=D4.get(G.content.type);if(!F)return A4.jsxDEV(_,{paddingX:1,children:A4.jsxDEV(O,{color:"red",children:["Unknown renderer: ",G.content.type]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return A4.jsxDEV(KX,{interaction:G,renderer:F,onChange:(M)=>{if(Z.updateInteraction(G.id,M),M.state==="submitted"||M.state==="edited"||M.state==="cancelled")W(G.id)}},G.id,!1,void 0,this)};if($.length===0)return null;return A4.jsxDEV(_,{flexDirection:"column",borderColor:"cyan",borderStyle:"single",width:"100%",children:[A4.jsxDEV(_,{justifyContent:"space-between",paddingX:1,marginBottom:1,children:A4.jsxDEV(O,{color:"cyan",bold:!0,children:["Interactions (",$.length,")"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),A4.jsxDEV(_,{paddingX:1,marginBottom:1,children:A4.jsxDEV(c8,{items:K,defaultIndex:K.findIndex((G)=>G.id===Y),onChange:U,autoFocus:!0,variant:"line"},Y,!1,void 0,this)},void 0,!1,void 0,this),H()]},void 0,!0,void 0,this)};n0();function o8(){D4.register("approval",YX),D4.register("selection",JX),D4.register("input",QX),D4.register("confirm",$X)}o8();var K0=P(I(),1);import{z as V4}from"zod";var P$=V4.object({label:V4.string().min(1).max(50).describe("选项显示文本,简洁明了(1-50 字符)")}),R$=V4.object({description:V4.string().min(1).describe("向用户提出的问题,清晰具体,包含必要的上下文"),type:V4.enum(["single_select","multi_select"]).describe("选择类型:single_select(单选)或 multi_select(多选)"),options:V4.array(P$).min(2).max(6).describe("选项列表,至少 2 个,最多 6 个"),allow_custom_input:V4.boolean().default(!0).describe("是否允许用户输入自定义文本,默认 true"),placeholder:V4.string().optional().describe("自定义输入框的占位符文本")}),C$=({tool:Z})=>{let{addInteraction:Y,getInteractions:X,updateInteraction:J}=xZ(),[Q,$]=p4.useState(null),K=p4.useRef(!1),U=Z.getInputRepaired();if(p4.useEffect(()=>{if(Z.state==="interrupted"&&!Q&&!K.current){let z={type:"selection",options:U.options?.map((G,F)=>({label:G.label,value:G.label}))||[],singleSelect:U.type==="single_select",allowCustomInput:U.allow_custom_input??!0,placeholder:U.placeholder},H=Y(z,{tool:Z,metadata:{title:U.description||"请选择一个选项",groupKey:"user-input"}});$(H.id)}},[Z,Q,Y,U]),p4.useEffect(()=>{if(!Q||K.current)return;let W=()=>{let G=X().find((F)=>F.id===Q);if(G&&(G.state==="submitted"||G.state==="edited"||G.state==="cancelled")&&!G.resultSent){K.current=!0;let F=G.result,M="";if(F){if(F.selected&&F.selected.length>0)M+=`User selected:
37
37
  ${F.selected.join(`
38
38
  - `)}`;if(F.customInput&&F.customInput.trim())M+=(M?`
39
- `:"")+`User Custom Input: ${F.customInput}`}Z.sendResumeData({type:"respond",message:M||"User made a selection"}),J(Q,{resultSent:!0})}};U();let z=setInterval(U,100);return()=>clearInterval(z)},[Q,X,J,Z]),Z.state==="interrupted"&&!Z.output)return W0.jsxDEV(N,{flexDirection:"column",children:W0.jsxDEV(N,{paddingX:1,children:W0.jsxDEV(O,{color:"yellow",children:"⏳ 等待用户选择..."},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(Z.output)return W0.jsxDEV(O,{color:"yellow",children:Z.output},void 0,!1,void 0,this);return null},n8=t({name:"ask_user_questions",description:"Ask the user a question with selectable options",parameters:R$,handler:ZZ.waitForUIDone,render(Z){return W0.jsxDEV(C$,{tool:Z},void 0,!1,void 0,this)}});var c4=L(x(),1);var B0=L(v(),1),U0=({content:Z,maxLines:Y=10,borderColor:X="cyan",borderStyle:J="single",marginTop:Q=0,paddingX:$=0,showOmittedInfo:K=!0})=>{if(!Z)return null;let{width:W}=a8(),U=Z.split(`
40
- `).map((G)=>G.slice(0,W-10)),z=Math.max(0,U.length-Y),H=U.slice(-Y).join(`
41
- `);return B0.jsxDEV(N,{flexDirection:"column",width:W-5,children:B0.jsxDEV(N,{borderStyle:J,borderColor:X,borderLeft:!1,borderRight:!1,flexDirection:"column",paddingX:$,marginTop:Q,children:[K&&z>0&&B0.jsxDEV(O,{color:"gray",dimColor:!0,children:["... ",z," lines omitted ..."]},void 0,!0,void 0,this),B0.jsxDEV(O,{dimColor:!0,children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)};var EZ=L(v(),1),v$=({tool:Z})=>{let{addInteraction:Y,getInteractions:X,updateInteraction:J}=uZ(),[Q,$]=c4.useState(null),K=c4.useRef(!1),W=Z.getHumanInTheLoopData();if(c4.useEffect(()=>{if(W?.reviewConfig&&Z.state==="interrupted"&&!Q&&!K.current){let z=Z.getInputRepaired()?.description,H={type:"approval",toolCall:{name:Z.message.name,args:Z.getInputRepaired()},editableFields:["args"]},G=Y(H,{tool:Z,metadata:{title:`Approve ${Z.message.name}`,description:z,groupKey:"approvals"}});$(G.id)}},[W,Z,Q,Y]),c4.useEffect(()=>{if(!Q||K.current)return;let z=()=>{let F=X().find((M)=>M.id===Q);if(F&&(F.state==="submitted"||F.state==="edited"||F.state==="cancelled")&&!F.resultSent){K.current=!0;let M=F.result;if(M){if(M.status==="approved")Z.sendResumeData({type:"approve"});else if(M.status==="edited"){let _={name:Z.message.name,args:M.editedArgs};Z.sendResumeData({type:"edit",edited_action:_})}else if(M.status==="rejected"){let _=M.message||"User rejected to run this tool";Z.sendResumeData({type:"reject",message:_})}}J(Q,{resultSent:!0})}};z();let H=setInterval(z,100);return()=>clearInterval(H)},[Q,X,J,Z]),W?.reviewConfig&&Q&&!Z.output)return EZ.jsxDEV(N,{flexDirection:"column",children:EZ.jsxDEV(N,{paddingX:1,paddingY:1,children:EZ.jsxDEV(O,{color:"yellow",children:"⏳ Wait for Approval"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);return EZ.jsxDEV(N,{flexDirection:"column",children:(()=>{if(!Z.output)return null;return EZ.jsxDEV(U0,{content:Z.output,maxLines:5,borderColor:"cyan"},void 0,!1,void 0,this)})()},void 0,!1,void 0,this)},I$=({tool:Z})=>{let X=Z.getInputRepaired()?.command||"",J=X.length>50?X.substring(0,50)+"...":X;return EZ.jsxDEV(N,{paddingX:1,children:[EZ.jsxDEV(O,{color:"magenta",children:"Run "},void 0,!1,void 0,this),EZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),EZ.jsxDEV(O,{color:"magenta",children:J},void 0,!1,void 0,this),EZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},s8=t({name:"terminal",description:"",parameters:{},handler:ZZ.waitForUIDone,render(Z){return EZ.jsxDEV(N,{flexDirection:"column",children:[EZ.jsxDEV(I$,{tool:Z},void 0,!1,void 0,this),EZ.jsxDEV(v$,{tool:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});import{diff_match_patch as D$}from"diff-match-patch";function V$(Z,Y,X){if(Z===Y)return[{type:"unchanged",content:Z,lineNumbers:{old:1,new:1}}];let J=new D$,Q=J.diff_main(Z,Y);J.diff_cleanupSemantic(Q);let $=[],K=1,W=1,U=[];for(let[P,B]of Q){if(B==="")continue;let C=B.split(`
39
+ `:"")+`User Custom Input: ${F.customInput}`}Z.sendResumeData({type:"respond",message:M||"User made a selection"}),J(Q,{resultSent:!0})}};W();let z=setInterval(W,100);return()=>clearInterval(z)},[Q,X,J,Z]),Z.state==="interrupted"&&!Z.output)return K0.jsxDEV(_,{flexDirection:"column",children:K0.jsxDEV(_,{paddingX:1,children:K0.jsxDEV(O,{color:"yellow",children:"⏳ 等待用户选择..."},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(Z.output)return K0.jsxDEV(O,{color:"yellow",children:Z.output},void 0,!1,void 0,this);return null},n8=t({name:"ask_user_questions",description:"Ask the user a question with selectable options",parameters:R$,handler:ZZ.waitForUIDone,render(Z){return K0.jsxDEV(C$,{tool:Z},void 0,!1,void 0,this)}});var d4=P(g(),1);var w0=P(I(),1),W0=({content:Z,maxLines:Y=10,borderColor:X="cyan",borderStyle:J="single",marginTop:Q=0,paddingX:$=0,showOmittedInfo:K=!0})=>{if(!Z)return null;let{width:U}=a8(),W=Z.split(`
40
+ `).map((G)=>G.slice(0,U-10)),z=Math.max(0,W.length-Y),H=W.slice(-Y).join(`
41
+ `);return w0.jsxDEV(_,{flexDirection:"column",width:U-5,children:w0.jsxDEV(_,{borderStyle:J,borderColor:X,borderLeft:!1,borderRight:!1,flexDirection:"column",paddingX:$,marginTop:Q,children:[K&&z>0&&w0.jsxDEV(O,{color:"gray",dimColor:!0,children:["... ",z," lines omitted ..."]},void 0,!0,void 0,this),w0.jsxDEV(O,{dimColor:!0,children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)};var VZ=P(I(),1),I$=({tool:Z})=>{let{addInteraction:Y,getInteractions:X,updateInteraction:J}=xZ(),[Q,$]=d4.useState(null),K=d4.useRef(!1),U=Z.getHumanInTheLoopData();if(d4.useEffect(()=>{if(U?.reviewConfig&&Z.state==="interrupted"&&!Q&&!K.current){let z=Z.getInputRepaired()?.description,H={type:"approval",toolCall:{name:Z.message.name,args:Z.getInputRepaired()},editableFields:["args"]},G=Y(H,{tool:Z,metadata:{title:`Approve ${Z.message.name}`,description:z,groupKey:"approvals"}});$(G.id)}},[U,Z,Q,Y]),d4.useEffect(()=>{if(!Q||K.current)return;let z=()=>{let F=X().find((M)=>M.id===Q);if(F&&(F.state==="submitted"||F.state==="edited"||F.state==="cancelled")&&!F.resultSent){K.current=!0;let M=F.result;if(M){if(M.status==="approved")Z.sendResumeData({type:"approve"});else if(M.status==="edited"){let N={name:Z.message.name,args:M.editedArgs};Z.sendResumeData({type:"edit",edited_action:N})}else if(M.status==="rejected"){let N=M.message||"User rejected to run this tool";Z.sendResumeData({type:"reject",message:N})}}J(Q,{resultSent:!0})}};z();let H=setInterval(z,100);return()=>clearInterval(H)},[Q,X,J,Z]),U?.reviewConfig&&Q&&!Z.output)return VZ.jsxDEV(_,{flexDirection:"column",children:VZ.jsxDEV(_,{paddingX:1,paddingY:1,children:VZ.jsxDEV(O,{color:"yellow",children:"⏳ Wait for Approval"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);return VZ.jsxDEV(_,{flexDirection:"column",children:(()=>{if(!Z.output)return null;return VZ.jsxDEV(W0,{content:Z.output,maxLines:5,borderColor:"cyan"},void 0,!1,void 0,this)})()},void 0,!1,void 0,this)},v$=({tool:Z})=>{let X=Z.getInputRepaired()?.command||"",J=X.length>50?X.substring(0,50)+"...":X;return VZ.jsxDEV(_,{paddingX:1,children:[VZ.jsxDEV(O,{color:"magenta",children:"Run "},void 0,!1,void 0,this),VZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),VZ.jsxDEV(O,{color:"magenta",children:J},void 0,!1,void 0,this),VZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},s8=t({name:"terminal",description:"",parameters:{},handler:ZZ.waitForUIDone,render(Z){return VZ.jsxDEV(_,{flexDirection:"column",children:[VZ.jsxDEV(v$,{tool:Z},void 0,!1,void 0,this),VZ.jsxDEV(I$,{tool:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});import{diff_match_patch as D$}from"diff-match-patch";function V$(Z,Y,X){if(Z===Y)return[{type:"unchanged",content:Z,lineNumbers:{old:1,new:1}}];let J=new D$,Q=J.diff_main(Z,Y);J.diff_cleanupSemantic(Q);let $=[],K=1,U=1,W=[];for(let[L,B]of Q){if(B==="")continue;let C=B.split(`
42
42
  `),R=B.endsWith(`
43
- `);for(let D=0;D<C.length;D++){let j=C[D];if(j===""&&(D<C.length-1||!R))continue;let E={type:P===0?"unchanged":P===-1?"added":"removed",content:j};if(P===0)E.lineNumbers={old:K,new:W},K++,W++;else if(P===-1)E.lineNumbers={new:W},W++;else if(P===1)E.lineNumbers={old:K},K++;U.push(E)}}if(!X?.maxLines)return U;let z=X.maxLines,H=X.contextLines||3,G=U.map((P,B)=>P.type!=="unchanged"?B:-1).filter((P)=>P!==-1);if(G.length===0||U.length<=z)return U;let F=[],M=0,_=[],A=[];for(let P=0;P<G.length;P++)if(A.length===0)A.push(G[P]);else{let B=A[A.length-1];if(G[P]-B<=1)A.push(G[P]);else _.push([...A]),A=[G[P]]}if(A.length>0)_.push(A);for(let P of _){if(M>=z)break;let B=P[0],C=P[P.length-1],R=Math.max(0,B-H),D=Math.min(U.length-1,C+H),j=D-R+1;if(M+j>z&&M>0){F.push({type:"unchanged",content:"..."});break}for(let E=R;E<=D;E++){if(M>=z){if(E<D)F.push({type:"unchanged",content:"..."});break}F.push(U[E]),M++}if(P===_[_.length-1]&&M<U.length){let E=U.length-D-1;if(E>0)F.push({type:"unchanged",content:`... (${E} more lines)`})}}return F}function t8(Z,Y=1000){return Z=Z||"",Z.length>Y||Z.split(`
44
- `).length>50}function e8(Z,Y,X){let J=t8(Z)||t8(Y),$=X!==void 0&&"maxLines"in X?X.maxLines:J?10:20,K=X?.contextLines??(J?1:3);return V$(Z,Y,{maxLines:$,contextLines:K})}var z0=L(v(),1),E$=["sky","primary"];function b$(Z){let Y=Z%2;return bZ(E$[Y])}function T$(Z){let Y=[];if(Z.startsWith("/"))Y.push({type:"separator",value:"/"}),Z=Z.slice(1);let X=Z.split("/");return X.forEach((J,Q)=>{if(J)Y.push({type:"segment",value:J});if(Q<X.length-1)Y.push({type:"separator",value:"/"})}),Y}var f$=({path:Z,color:Y="cyan",line:X,rainbow:J=!1})=>{let Q=Z5(Z)??"",$=X!==void 0?`:${X}`:"";if(!J)return z0.jsxDEV(O,{color:bZ(Y),children:[Q,$]},void 0,!0,void 0,this);let K=T$(Q),W=-1;for(let z=K.length-1;z>=0;z--)if(K[z].type==="segment"){W=z;break}let U=0;return z0.jsxDEV(O,{children:[K.map((z,H)=>{if(z.type==="separator")return z0.jsxDEV(O,{dimColor:!0,color:"gray",children:z.value},`sep-${H}`,!1,void 0,this);let G=H===W,F=b$(U);return U++,z0.jsxDEV(O,{color:F,dimColor:!G,children:z.value},`seg-${H}`,!1,void 0,this)}),$&&z0.jsxDEV(O,{color:"gray",children:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},SZ=f$;var HZ=L(v(),1),j$=Y5.schema,X5=t({name:"edit_file",description:"Performs exact string replacements in files with diff visualization",parameters:j$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output,J=Y.old_string&&Y.new_string&&Y.old_string!==Y.new_string,Q=0,$=0;if(J){let K=e8(Y.old_string,Y.new_string,{maxLines:void 0});for(let W of K){if(W.type==="removed")Q++;if(W.type==="added")$++}}return HZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[HZ.jsxDEV(N,{children:[HZ.jsxDEV(O,{color:"yellow",children:"Edit "},void 0,!1,void 0,this),HZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),HZ.jsxDEV(SZ,{path:Y.file_path,rainbow:!0},void 0,!1,void 0,this),HZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),J&&HZ.jsxDEV(HZ.Fragment,{children:[HZ.jsxDEV(O,{color:"gray",children:" ("},void 0,!1,void 0,this),HZ.jsxDEV(O,{color:"red",children:["-",Q]},void 0,!0,void 0,this),HZ.jsxDEV(O,{color:"gray",children:"/"},void 0,!1,void 0,this),HZ.jsxDEV(O,{color:"green",children:["+",$]},void 0,!0,void 0,this),HZ.jsxDEV(O,{color:"gray",children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X&&X.startsWith("Error:")&&HZ.jsxDEV(N,{marginTop:0,marginLeft:1,marginBottom:1,children:HZ.jsxDEV(O,{color:"red",children:X},void 0,!1,void 0,this)},void 0,!1,void 0,this),!X&&HZ.jsxDEV(N,{marginTop:0,children:HZ.jsxDEV(O,{color:"gray",children:"Press Enter to confirm, Ctrl+C to cancel"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});var nZ=L(v(),1),S$={pending:"gray",in_progress:"yellow",completed:"green"},y$={pending:"○",in_progress:"◐",completed:"✓"},Q5=t({name:"todo_write",description:"Use this tool to create and manage a structured task list",parameters:J5.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired();if(!Y||!Y.todos||!Array.isArray(Y.todos))return nZ.jsxDEV(N,{flexDirection:"column",borderStyle:"round",borderColor:"red",children:nZ.jsxDEV(O,{color:"red",children:"Error: Invalid todo data structure"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let X=Y.todos;return nZ.jsxDEV(N,{flexDirection:"column",paddingY:1,children:nZ.jsxDEV(N,{flexDirection:"column",marginTop:0,children:(()=>{if(X.length===0)return nZ.jsxDEV(N,{paddingX:1,children:nZ.jsxDEV(O,{color:"gray",children:"No tasks in todo list"},void 0,!1,void 0,this)},void 0,!1,void 0,this);return nZ.jsxDEV(N,{flexDirection:"column",marginTop:0,children:X.map((Q,$)=>nZ.jsxDEV(N,{paddingX:1,paddingY:0,children:[nZ.jsxDEV(O,{color:S$[Q.status],bold:!0,children:[y$[Q.status]," "]},void 0,!0,void 0,this),nZ.jsxDEV(O,{color:Q.status==="in_progress"?"white":"gray",children:[$+1,". ",Q.content]},void 0,!0,void 0,this)]},Q.id,!0,void 0,this))},void 0,!1,void 0,this)})()},void 0,!1,void 0,this)},void 0,!1,void 0,this)}});var aZ=L(v(),1),k$=$5.schema,K5=t({name:"read_file",description:"Reads a file from the local filesystem",parameters:k$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return aZ.jsxDEV(aZ.Fragment,{},void 0,!1,void 0,this);let Q=X.split(`
45
- `).length;return aZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:aZ.jsxDEV(N,{children:[aZ.jsxDEV(O,{color:"blue",children:"Read "},void 0,!1,void 0,this),aZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),aZ.jsxDEV(SZ,{path:Y.file_path,rainbow:!0},void 0,!1,void 0,this),aZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),aZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","(",Q," lines)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});var sZ=L(v(),1),h$=W5.schema,U5=t({name:"glob_files",description:"Find files by name patterns",parameters:h$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return sZ.jsxDEV(sZ.Fragment,{},void 0,!1,void 0,this);let Q=X.split(`
46
- `).filter(Boolean).length;return sZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:sZ.jsxDEV(O,{children:[sZ.jsxDEV(O,{color:"cyan",children:"Glob "},void 0,!1,void 0,this),sZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),sZ.jsxDEV(SZ,{path:Y.pattern,rainbow:!0},void 0,!1,void 0,this),sZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),sZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","(",Q," files)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});var wZ=L(v(),1),z5=t({name:"search_files_rg",description:"Ripgrep - fast text search tool",parameters:{},handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return wZ.jsxDEV(wZ.Fragment,{},void 0,!1,void 0,this);let Q=X.split(`
47
- `).filter(Boolean).length,$=Y.pattern,K=Y.path;if(!$){let U=(Y.args||[]).filter((z)=>!z.startsWith("-"));if(U.length>0){if(K=U[U.length-1],U.length>1)$=U[U.length-2]}}return wZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:wZ.jsxDEV(O,{children:[wZ.jsxDEV(O,{color:"magenta",children:"Ripgrep "},void 0,!1,void 0,this),$&&wZ.jsxDEV(wZ.Fragment,{children:[wZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),wZ.jsxDEV(SZ,{path:$,color:"magenta"},void 0,!1,void 0,this),wZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K&&K!=="./"&&wZ.jsxDEV(wZ.Fragment,{children:[wZ.jsxDEV(O,{dimColor:!0,children:" in "},void 0,!1,void 0,this),wZ.jsxDEV(SZ,{path:K,rainbow:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),wZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","(",Q," matches)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});import{z as a0}from"zod";var H4=L(v(),1),x$=a0.object({description:a0.string().optional(),file_path:a0.string(),content:a0.string()}),H5=t({name:"write_file",description:"Writes a file to the local filesystem",parameters:x$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output,J=Y.content?.split(`
48
- `)?.length;return H4.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[H4.jsxDEV(N,{children:[H4.jsxDEV(O,{color:"green",children:"Write "},void 0,!1,void 0,this),H4.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),H4.jsxDEV(SZ,{path:Y.file_path,rainbow:!0},void 0,!1,void 0,this),H4.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),H4.jsxDEV(O,{dimColor:!0,children:[" (",J," lines)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X&&X.startsWith("Error:")&&H4.jsxDEV(N,{marginTop:0,marginLeft:1,marginBottom:1,children:H4.jsxDEV(O,{color:"red",children:X},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});var RZ=L(v(),1),g$=G5.schema,O5=t({name:"folder_operations",description:"Unified folder operations tool supporting create, list, delete, and existence check",parameters:g$.shape,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return RZ.jsxDEV(RZ.Fragment,{},void 0,!1,void 0,this);let Q={create:"green",list:"blue",exists:"yellow",delete:"red"}[Y?.operation]||"cyan",K=X.split(`
49
- `).map((W,U)=>{if(W.match(/\d+ \w+|[\d-]+ [\d:]+/))return RZ.jsxDEV(O,{dimColor:!0,children:W},U,!1,void 0,this);if(W.includes("✓")||W.includes("successfully")||W.includes("created")||W.includes("deleted"))return RZ.jsxDEV(O,{color:"green",children:W},U,!1,void 0,this);if(W.includes("✗")||W.includes("Error")||W.includes("not found")||W.includes("failed"))return RZ.jsxDEV(O,{color:"red",children:W},U,!1,void 0,this);if(W.startsWith("/")||W.includes("/:"))return RZ.jsxDEV(O,{color:"cyan",children:W},U,!1,void 0,this);return RZ.jsxDEV(O,{children:W},U,!1,void 0,this)});return RZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:RZ.jsxDEV(N,{children:[RZ.jsxDEV(O,{bold:!0,color:Q,children:[Y.operation,"Folder"]},void 0,!0,void 0,this),RZ.jsxDEV(O,{dimColor:!0,children:" ("},void 0,!1,void 0,this),RZ.jsxDEV(SZ,{path:Y.folder_path,rainbow:!0},void 0,!1,void 0,this),RZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});import{z as u$}from"zod";var MZ=L(v(),1),m$=u$.object({}),q5=t({name:"load_mcp_tools",description:`加载并查询所有可用的 MCP 工具列表。
43
+ `);for(let D=0;D<C.length;D++){let f=C[D];if(f===""&&(D<C.length-1||!R))continue;let V={type:L===0?"unchanged":L===-1?"added":"removed",content:f};if(L===0)V.lineNumbers={old:K,new:U},K++,U++;else if(L===-1)V.lineNumbers={new:U},U++;else if(L===1)V.lineNumbers={old:K},K++;W.push(V)}}if(!X?.maxLines)return W;let z=X.maxLines,H=X.contextLines||3,G=W.map((L,B)=>L.type!=="unchanged"?B:-1).filter((L)=>L!==-1);if(G.length===0||W.length<=z)return W;let F=[],M=0,N=[],w=[];for(let L=0;L<G.length;L++)if(w.length===0)w.push(G[L]);else{let B=w[w.length-1];if(G[L]-B<=1)w.push(G[L]);else N.push([...w]),w=[G[L]]}if(w.length>0)N.push(w);for(let L of N){if(M>=z)break;let B=L[0],C=L[L.length-1],R=Math.max(0,B-H),D=Math.min(W.length-1,C+H),f=D-R+1;if(M+f>z&&M>0){F.push({type:"unchanged",content:"..."});break}for(let V=R;V<=D;V++){if(M>=z){if(V<D)F.push({type:"unchanged",content:"..."});break}F.push(W[V]),M++}if(L===N[N.length-1]&&M<W.length){let V=W.length-D-1;if(V>0)F.push({type:"unchanged",content:`... (${V} more lines)`})}}return F}function t8(Z,Y=1000){return Z=Z||"",Z.length>Y||Z.split(`
44
+ `).length>50}function e8(Z,Y,X){let J=t8(Z)||t8(Y),$=X!==void 0&&"maxLines"in X?X.maxLines:J?10:20,K=X?.contextLines??(J?1:3);return V$(Z,Y,{maxLines:$,contextLines:K})}var U0=P(I(),1),E$=["sky","primary"];function b$(Z){let Y=Z%2;return c4(E$[Y])}function T$(Z){let Y=[];if(Z.startsWith("/"))Y.push({type:"separator",value:"/"}),Z=Z.slice(1);let X=Z.split("/");return X.forEach((J,Q)=>{if(J)Y.push({type:"segment",value:J});if(Q<X.length-1)Y.push({type:"separator",value:"/"})}),Y}var f$=({path:Z,color:Y="cyan",line:X,rainbow:J=!1})=>{let Q=Z5(Z)??"",$=X!==void 0?`:${X}`:"";if(!J)return U0.jsxDEV(O,{color:c4(Y),children:[Q,$]},void 0,!0,void 0,this);let K=T$(Q),U=-1;for(let z=K.length-1;z>=0;z--)if(K[z].type==="segment"){U=z;break}let W=0;return U0.jsxDEV(O,{children:[K.map((z,H)=>{if(z.type==="separator")return U0.jsxDEV(O,{dimColor:!0,color:"gray",children:z.value},`sep-${H}`,!1,void 0,this);let G=H===U,F=b$(W);return W++,U0.jsxDEV(O,{color:F,dimColor:!G,children:z.value},`seg-${H}`,!1,void 0,this)}),$&&U0.jsxDEV(O,{color:"gray",children:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},fZ=f$;var HZ=P(I(),1),j$=Y5.schema,X5=t({name:"edit_file",description:"Performs exact string replacements in files with diff visualization",parameters:j$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output,J=Y.old_string&&Y.new_string&&Y.old_string!==Y.new_string,Q=0,$=0;if(J){let K=e8(Y.old_string,Y.new_string,{maxLines:void 0});for(let U of K){if(U.type==="removed")Q++;if(U.type==="added")$++}}return HZ.jsxDEV(_,{flexDirection:"column",paddingX:1,children:[HZ.jsxDEV(_,{children:[HZ.jsxDEV(O,{color:"yellow",children:"Edit "},void 0,!1,void 0,this),HZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),HZ.jsxDEV(fZ,{path:Y.file_path,rainbow:!0},void 0,!1,void 0,this),HZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),J&&HZ.jsxDEV(HZ.Fragment,{children:[HZ.jsxDEV(O,{color:"gray",children:" ("},void 0,!1,void 0,this),HZ.jsxDEV(O,{color:"red",children:["-",Q]},void 0,!0,void 0,this),HZ.jsxDEV(O,{color:"gray",children:"/"},void 0,!1,void 0,this),HZ.jsxDEV(O,{color:"green",children:["+",$]},void 0,!0,void 0,this),HZ.jsxDEV(O,{color:"gray",children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X&&X.startsWith("Error:")&&HZ.jsxDEV(_,{marginTop:0,marginLeft:1,marginBottom:1,children:HZ.jsxDEV(O,{color:"red",children:X},void 0,!1,void 0,this)},void 0,!1,void 0,this),!X&&HZ.jsxDEV(_,{marginTop:0,children:HZ.jsxDEV(O,{color:"gray",children:"Press Enter to confirm, Ctrl+C to cancel"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});var rZ=P(I(),1),S$={pending:"gray",in_progress:"yellow",completed:"green"},y$={pending:"○",in_progress:"◐",completed:"✓"},Q5=t({name:"todo_write",description:"Use this tool to create and manage a structured task list",parameters:J5.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired();if(!Y||!Y.todos||!Array.isArray(Y.todos))return rZ.jsxDEV(_,{flexDirection:"column",borderStyle:"round",borderColor:"red",children:rZ.jsxDEV(O,{color:"red",children:"Error: Invalid todo data structure"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let X=Y.todos;return rZ.jsxDEV(_,{flexDirection:"column",paddingY:1,children:rZ.jsxDEV(_,{flexDirection:"column",marginTop:0,children:(()=>{if(X.length===0)return rZ.jsxDEV(_,{paddingX:1,children:rZ.jsxDEV(O,{color:"gray",children:"No tasks in todo list"},void 0,!1,void 0,this)},void 0,!1,void 0,this);return rZ.jsxDEV(_,{flexDirection:"column",marginTop:0,children:X.map((Q,$)=>rZ.jsxDEV(_,{paddingX:1,paddingY:0,children:[rZ.jsxDEV(O,{color:S$[Q.status],bold:!0,children:[y$[Q.status]," "]},void 0,!0,void 0,this),rZ.jsxDEV(O,{color:Q.status==="in_progress"?"white":"gray",children:[$+1,". ",Q.content]},void 0,!0,void 0,this)]},Q.id,!0,void 0,this))},void 0,!1,void 0,this)})()},void 0,!1,void 0,this)},void 0,!1,void 0,this)}});var oZ=P(I(),1),k$=$5.schema,K5=t({name:"read_file",description:"Reads a file from the local filesystem",parameters:k$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return oZ.jsxDEV(oZ.Fragment,{},void 0,!1,void 0,this);let Q=X.split(`
45
+ `).length;return oZ.jsxDEV(_,{flexDirection:"column",paddingX:1,children:oZ.jsxDEV(_,{children:[oZ.jsxDEV(O,{color:"blue",children:"Read "},void 0,!1,void 0,this),oZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),oZ.jsxDEV(fZ,{path:Y.file_path,rainbow:!0},void 0,!1,void 0,this),oZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),oZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","(",Q," lines)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});var nZ=P(I(),1),h$=W5.schema,U5=t({name:"glob_files",description:"Find files by name patterns",parameters:h$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return nZ.jsxDEV(nZ.Fragment,{},void 0,!1,void 0,this);let Q=X.split(`
46
+ `).filter(Boolean).length;return nZ.jsxDEV(_,{flexDirection:"column",paddingX:1,children:nZ.jsxDEV(O,{children:[nZ.jsxDEV(O,{color:"cyan",children:"Glob "},void 0,!1,void 0,this),nZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),nZ.jsxDEV(fZ,{path:Y.pattern,rainbow:!0},void 0,!1,void 0,this),nZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),nZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","(",Q," files)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});var _Z=P(I(),1),z5=t({name:"search_files_rg",description:"Ripgrep - fast text search tool",parameters:{},handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return _Z.jsxDEV(_Z.Fragment,{},void 0,!1,void 0,this);let Q=X.split(`
47
+ `).filter(Boolean).length,$=Y.pattern,K=Y.path;if(!$){let W=(Y.args||[]).filter((z)=>!z.startsWith("-"));if(W.length>0){if(K=W[W.length-1],W.length>1)$=W[W.length-2]}}return _Z.jsxDEV(_,{flexDirection:"column",paddingX:1,children:_Z.jsxDEV(O,{children:[_Z.jsxDEV(O,{color:"magenta",children:"Ripgrep "},void 0,!1,void 0,this),$&&_Z.jsxDEV(_Z.Fragment,{children:[_Z.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),_Z.jsxDEV(fZ,{path:$,color:"magenta"},void 0,!1,void 0,this),_Z.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K&&K!=="./"&&_Z.jsxDEV(_Z.Fragment,{children:[_Z.jsxDEV(O,{dimColor:!0,children:" in "},void 0,!1,void 0,this),_Z.jsxDEV(fZ,{path:K,rainbow:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_Z.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","(",Q," matches)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});import{z as s0}from"zod";var G4=P(I(),1),x$=s0.object({description:s0.string().optional(),file_path:s0.string(),content:s0.string()}),H5=t({name:"write_file",description:"Writes a file to the local filesystem",parameters:x$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output,J=Y.content?.split(`
48
+ `)?.length;return G4.jsxDEV(_,{flexDirection:"column",paddingX:1,children:[G4.jsxDEV(_,{children:[G4.jsxDEV(O,{color:"green",children:"Write "},void 0,!1,void 0,this),G4.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),G4.jsxDEV(fZ,{path:Y.file_path,rainbow:!0},void 0,!1,void 0,this),G4.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),G4.jsxDEV(O,{dimColor:!0,children:[" (",J," lines)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X&&X.startsWith("Error:")&&G4.jsxDEV(_,{marginTop:0,marginLeft:1,marginBottom:1,children:G4.jsxDEV(O,{color:"red",children:X},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});var PZ=P(I(),1),g$=G5.schema,O5=t({name:"folder_operations",description:"Unified folder operations tool supporting create, list, delete, and existence check",parameters:g$.shape,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return PZ.jsxDEV(PZ.Fragment,{},void 0,!1,void 0,this);let Q={create:"green",list:"blue",exists:"yellow",delete:"red"}[Y?.operation]||"cyan",K=X.split(`
49
+ `).map((U,W)=>{if(U.match(/\d+ \w+|[\d-]+ [\d:]+/))return PZ.jsxDEV(O,{dimColor:!0,children:U},W,!1,void 0,this);if(U.includes("✓")||U.includes("successfully")||U.includes("created")||U.includes("deleted"))return PZ.jsxDEV(O,{color:"green",children:U},W,!1,void 0,this);if(U.includes("✗")||U.includes("Error")||U.includes("not found")||U.includes("failed"))return PZ.jsxDEV(O,{color:"red",children:U},W,!1,void 0,this);if(U.startsWith("/")||U.includes("/:"))return PZ.jsxDEV(O,{color:"cyan",children:U},W,!1,void 0,this);return PZ.jsxDEV(O,{children:U},W,!1,void 0,this)});return PZ.jsxDEV(_,{flexDirection:"column",paddingX:1,children:PZ.jsxDEV(_,{children:[PZ.jsxDEV(O,{bold:!0,color:Q,children:[Y.operation,"Folder"]},void 0,!0,void 0,this),PZ.jsxDEV(O,{dimColor:!0,children:" ("},void 0,!1,void 0,this),PZ.jsxDEV(fZ,{path:Y.folder_path,rainbow:!0},void 0,!1,void 0,this),PZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});import{z as u$}from"zod";var MZ=P(I(),1),m$=u$.object({}),q5=t({name:"load_mcp_tools",description:`加载并查询所有可用的 MCP 工具列表。
50
50
 
51
51
  返回:
52
52
  - tools: MCP 工具列表,每个工具包含 name, description, schema
@@ -57,7 +57,7 @@ ${F.selected.join(`
57
57
  - 获取工具的参数格式
58
58
  - 检查 MCP 连接状态
59
59
 
60
- 重要:工具列表是动态的,建议在需要时调用此命令获取最新信息。`,parameters:m$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.output,X=null;try{X=JSON.parse(Y)}catch(J){}return MZ.jsxDEV(N,{flexDirection:"column",children:[MZ.jsxDEV(N,{children:MZ.jsxDEV(O,{color:"blue",bold:!0,children:"load_mcp_tools"},void 0,!1,void 0,this)},void 0,!1,void 0,this),X?.status&&MZ.jsxDEV(N,{flexDirection:"column",marginTop:1,children:[MZ.jsxDEV(O,{color:"green",children:"✓ MCP 已连接"},void 0,!1,void 0,this),X.status.servers&&X.status.servers.length>0&&MZ.jsxDEV(N,{marginLeft:2,children:MZ.jsxDEV(O,{color:"gray",children:["服务器: ",X.status.servers.join(", ")]},void 0,!0,void 0,this)},void 0,!1,void 0,this),X.status.toolCount!==void 0&&MZ.jsxDEV(N,{marginLeft:2,children:MZ.jsxDEV(O,{color:"gray",children:["工具数量: ",X.status.toolCount]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X?.tools&&X.tools.length>0&&MZ.jsxDEV(N,{flexDirection:"column",marginTop:1,children:[MZ.jsxDEV(O,{color:"gray",dimColor:!0,children:["可用工具 (",X.tools.length,"):"]},void 0,!0,void 0,this),X.tools.slice(0,5).map((J,Q)=>MZ.jsxDEV(N,{marginLeft:2,children:[MZ.jsxDEV(O,{color:"cyan",children:J.name},void 0,!1,void 0,this),J.description&&MZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","- ",J.description.slice(0,50),J.description.length>50?"...":""]},void 0,!0,void 0,this)]},Q,!0,void 0,this)),X.tools.length>5&&MZ.jsxDEV(N,{marginLeft:2,children:MZ.jsxDEV(O,{color:"gray",dimColor:!0,children:["... 还有 ",X.tools.length-5," 个工具"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y&&MZ.jsxDEV(U0,{content:Y,maxLines:10,borderColor:"gray"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});import{z as d4}from"zod";var TZ=L(v(),1),p$=d4.object({commands:d4.array(d4.object({name:d4.string().describe("MCP 工具名称"),args:d4.record(d4.string(),d4.any()).describe("工具参数,JSON 对象格式")})).describe("要执行的 MCP 工具列表")}),F5=t({name:"execute_mcp_tool",description:`执行一个或多个 MCP 工具。
60
+ 重要:工具列表是动态的,建议在需要时调用此命令获取最新信息。`,parameters:m$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.output,X=null;try{X=JSON.parse(Y)}catch(J){}return MZ.jsxDEV(_,{flexDirection:"column",children:[MZ.jsxDEV(_,{children:MZ.jsxDEV(O,{color:"blue",bold:!0,children:"load_mcp_tools"},void 0,!1,void 0,this)},void 0,!1,void 0,this),X?.status&&MZ.jsxDEV(_,{flexDirection:"column",marginTop:1,children:[MZ.jsxDEV(O,{color:"green",children:"✓ MCP 已连接"},void 0,!1,void 0,this),X.status.servers&&X.status.servers.length>0&&MZ.jsxDEV(_,{marginLeft:2,children:MZ.jsxDEV(O,{color:"gray",children:["服务器: ",X.status.servers.join(", ")]},void 0,!0,void 0,this)},void 0,!1,void 0,this),X.status.toolCount!==void 0&&MZ.jsxDEV(_,{marginLeft:2,children:MZ.jsxDEV(O,{color:"gray",children:["工具数量: ",X.status.toolCount]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X?.tools&&X.tools.length>0&&MZ.jsxDEV(_,{flexDirection:"column",marginTop:1,children:[MZ.jsxDEV(O,{color:"gray",dimColor:!0,children:["可用工具 (",X.tools.length,"):"]},void 0,!0,void 0,this),X.tools.slice(0,5).map((J,Q)=>MZ.jsxDEV(_,{marginLeft:2,children:[MZ.jsxDEV(O,{color:"cyan",children:J.name},void 0,!1,void 0,this),J.description&&MZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","- ",J.description.slice(0,50),J.description.length>50?"...":""]},void 0,!0,void 0,this)]},Q,!0,void 0,this)),X.tools.length>5&&MZ.jsxDEV(_,{marginLeft:2,children:MZ.jsxDEV(O,{color:"gray",dimColor:!0,children:["... 还有 ",X.tools.length-5," 个工具"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y&&MZ.jsxDEV(W0,{content:Y,maxLines:10,borderColor:"gray"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});import{z as l4}from"zod";var EZ=P(I(),1),p$=l4.object({commands:l4.array(l4.object({name:l4.string().describe("MCP 工具名称"),args:l4.record(l4.string(),l4.any()).describe("工具参数,JSON 对象格式")})).describe("要执行的 MCP 工具列表")}),F5=t({name:"execute_mcp_tool",description:`执行一个或多个 MCP 工具。
61
61
 
62
62
  使用格式:
63
63
  - commands: MCP 工具数组,每个工具包含 name 和 args
@@ -69,61 +69,55 @@ ${F.selected.join(`
69
69
  重要:
70
70
  - 所有工具独立执行,失败不影响其他工具
71
71
  - 返回结果按命令顺序排列
72
- - 适合批量执行 MCP 相关操作`,parameters:p$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output,J=null;try{J=JSON.parse(X)}catch(Q){}return TZ.jsxDEV(N,{flexDirection:"column",children:[TZ.jsxDEV(N,{children:TZ.jsxDEV(O,{color:"blue",bold:!0,children:"execute_mcp_tool"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?.commands&&Y.commands.length>0&&TZ.jsxDEV(N,{flexDirection:"column",marginTop:1,children:[TZ.jsxDEV(O,{color:"gray",dimColor:!0,children:["执行 ",Y.commands.length," 个 MCP 工具:"]},void 0,!0,void 0,this),Y.commands.map((Q,$)=>TZ.jsxDEV(N,{marginLeft:2,children:[TZ.jsxDEV(O,{color:"yellow",children:[$+1,"."]},void 0,!0,void 0,this),TZ.jsxDEV(O,{color:"cyan",children:Q.name},void 0,!1,void 0,this)]},$,!0,void 0,this))]},void 0,!0,void 0,this),J?.results&&TZ.jsxDEV(N,{flexDirection:"column",marginTop:1,children:J.results.map((Q,$)=>TZ.jsxDEV(N,{marginLeft:2,children:Q.error?TZ.jsxDEV(O,{color:"red",children:["✗ ",Q.tool]},void 0,!0,void 0,this):TZ.jsxDEV(O,{color:"green",children:["✓ ",Q.tool]},void 0,!0,void 0,this)},$,!1,void 0,this))},void 0,!1,void 0,this),X&&TZ.jsxDEV(U0,{content:X,maxLines:10,borderColor:"gray"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});var G4=L(v(),1);import{z as H0}from"zod";var c$=H0.object({task_id:H0.string().optional().describe("The task id to ask the subagent"),subagent_id:H0.string().describe("The id of subagent to use"),subagent_type:H0.string().describe("The type of subagent to use (general-purpose, statusline-setup, output-style-setup)"),task_description:H0.string().describe("Describe what you want the subagent to do"),data_transfer:H0.any().optional().describe("Data to transfer to the subagent")}),d$=({tool:Z})=>{let Y=Z.getInputRepaired();return G4.jsxDEV(N,{paddingX:1,flexDirection:"column",children:G4.jsxDEV(N,{children:[G4.jsxDEV(O,{color:"yellow",children:"Task "},void 0,!1,void 0,this),G4.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),G4.jsxDEV(O,{color:"cyan",children:Y.subagent_id},void 0,!1,void 0,this),G4.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},l$=({tool:Z})=>{let Y=Z.getInputRepaired(),X=Z.output;return G4.jsxDEV(N,{flexDirection:"column",children:G4.jsxDEV(d$,{tool:Z},void 0,!1,void 0,this)},void 0,!1,void 0,this)},M5=t({name:"task",description:"Launch a subagent to handle complex tasks autonomously",parameters:c$.shape,handler:ZZ.waitForUIDone,render(Z){return G4.jsxDEV(l$,{tool:Z},void 0,!1,void 0,this)}});var N5=[s8,n8,X5,Q5,K5,U5,z5,H5,O5,q5,F5,M5];var e=L(x(),1);var b=L(v(),1),i$=({validation:Z,onComplete:Y})=>{let{config:X,updateConfig:J}=UZ(),[Q,$]=e.useState("welcome"),[K,W]=e.useState(!1),[U,z]=e.useState(null),[H,G]=e.useState(0),[F,M]=e.useState(null),_=e.useRef(!0),A=e.useRef([]),P=e.useRef(H),B=X?.providers||[];e.useEffect(()=>{A.current=B},[B]),e.useEffect(()=>{P.current=H},[H]);let C=B[H],R=e.useCallback(()=>M(null),[]);jZ(R,F?3000:null);let D=e.useCallback(()=>{_.current=!0,z(null),W(!0),M(null)},[]),j=e.useCallback(()=>{let g=A.current,r=P.current,o=g[r];if(!o)return;_.current=!1,z(o),W(!0),M(null)},[]),E=e.useCallback(()=>{W(!1),z(null),M(null)},[]),c=e.useCallback(async(g)=>{let r=A.current,o=_.current,F4=o?[...r,g]:r.map((M4)=>M4.id===g.id?g:M4);if(await J({providers:F4}),M(o?`已添加 Provider: ${g.id}`:`已更新 Provider: ${g.id}`),o){let M4=F4.findIndex((gZ)=>gZ.id===g.id);G(M4>=0?M4:0)}E()},[J,E]),i=e.useCallback(()=>{if(!C||!C.apiKey){M("请先配置 Provider 的 API Key");return}J({provider_id:C.id,provider_type:C.type}).then(()=>{$("model")})},[C,J]);if(mZ((g,r)=>{if(r.return||g===" ")$("provider")},{isActive:Q==="welcome"}),mZ((g,r)=>{if(K)return;if(r.upArrow)G((o)=>o>0?o-1:B.length-1);else if(r.downArrow)G((o)=>o<B.length-1?o+1:0);else if(g==="n"||g==="N")D();else if((g==="e"||g==="E"||r.return)&&C)j();else if(g==="s"||g==="S")i()},{isActive:Q==="provider"}),Q==="welcome")return b.jsxDEV(N,{flexDirection:"column",paddingX:2,paddingY:1,width:"100%",children:[b.jsxDEV(N,{marginBottom:1,children:b.jsxDEV(O,{bold:!0,color:"cyan",children:"欢迎使用 Zen Code"},void 0,!1,void 0,this)},void 0,!1,void 0,this),b.jsxDEV(N,{marginBottom:1,children:b.jsxDEV(O,{color:"yellow",children:Z.reason||"需要进行初始配置"},void 0,!1,void 0,this)},void 0,!1,void 0,this),b.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[b.jsxDEV(O,{dimColor:!0,children:"接下来将引导你完成:"},void 0,!1,void 0,this),b.jsxDEV(O,{dimColor:!0,children:" 1. 配置 Provider(API 服务提供商)"},void 0,!1,void 0,this),b.jsxDEV(O,{dimColor:!0,children:" 2. 选择 Model(AI 模型)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b.jsxDEV(N,{children:b.jsxDEV(O,{color:"green",bold:!0,children:"按 Enter 开始配置"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(Q==="provider")return b.jsxDEV(N,{flexDirection:"column",width:"100%",children:[b.jsxDEV(N,{paddingX:2,paddingY:1,children:b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 1/2: Provider 配置"},void 0,!1,void 0,this)},void 0,!1,void 0,this),K?b.jsxDEV(w5,{provider:U||void 0,onCancel:E,onSave:c},void 0,!1,void 0,this):b.jsxDEV(b.Fragment,{children:b.jsxDEV(N,{flexDirection:"column",paddingX:2,gap:1,children:[B.length===0?b.jsxDEV(N,{paddingY:1,children:b.jsxDEV(O,{color:"yellow",children:"未配置任何 Provider,请按 'n' 新增"},void 0,!1,void 0,this)},void 0,!1,void 0,this):B.map((g,r)=>{let o=!!g.apiKey,F4=o?"green":"yellow";return b.jsxDEV(N,{marginBottom:0,gap:1,children:[b.jsxDEV(O,{color:r===H?"cyan":"gray",bold:r===H,children:r===H?">":" "},void 0,!1,void 0,this),b.jsxDEV(O,{bold:r===H,color:r===H?"cyan":void 0,children:g.id},void 0,!1,void 0,this),b.jsxDEV(O,{color:"gray",dimColor:r!==H,children:[" ",g.type]},void 0,!0,void 0,this),b.jsxDEV(O,{color:F4,dimColor:r!==H,children:[" ","[",o?"已配置":"未配置","]"]},void 0,!0,void 0,this)]},g.id,!0,void 0,this)}),b.jsxDEV(N,{marginTop:1,children:[b.jsxDEV(O,{color:"gray",dimColor:!0,children:[b.jsxDEV(O,{color:"cyan",children:"↑↓"},void 0,!1,void 0,this)," 导航 ",b.jsxDEV(O,{color:"cyan",children:"n"},void 0,!1,void 0,this)," 新增"," ",b.jsxDEV(O,{color:"cyan",children:"e/Enter"},void 0,!1,void 0,this)," 编辑"," "]},void 0,!0,void 0,this),B.some((g)=>g.apiKey)&&b.jsxDEV(O,{children:[b.jsxDEV(O,{color:"green",children:"s"},void 0,!1,void 0,this)," 下一步"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F&&b.jsxDEV(N,{paddingX:2,paddingY:0,children:b.jsxDEV(O,{color:"green",children:F},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(Q==="model")return b.jsxDEV(r$,{onComplete:Y,onBack:()=>$("provider")},void 0,!1,void 0,this);return null},r$=({onComplete:Z,onBack:Y})=>{let{config:X,updateConfig:J}=UZ(),[Q,$]=e.useState(0),K=e.useMemo(()=>{return X?.providers.find((G)=>G.id===X.provider_id)||null},[X?.providers,X?.provider_id]),{data:W=[],isLoading:U,error:z}=_5({provider:K,enabled:!!K?.apiKey}),H=W[Q];if(mZ((G,F)=>{if(F.upArrow)$((M)=>M>0?M-1:W.length-1);else if(F.downArrow)$((M)=>M<W.length-1?M+1:0);else if(F.escape||G==="b"||G==="B")Y();else if((F.return||G===" ")&&H)J({model_id:H.id}).then(()=>{Z()})},{isActive:!U&&!z&&X!==null}),U)return b.jsxDEV(N,{flexDirection:"column",paddingX:2,paddingY:1,children:[b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 2/2: Model 选择"},void 0,!1,void 0,this),b.jsxDEV(N,{marginTop:1,children:b.jsxDEV(O,{color:"gray",children:"加载模型列表中..."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(z)return b.jsxDEV(N,{flexDirection:"column",paddingX:2,paddingY:1,children:[b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 2/2: Model 选择"},void 0,!1,void 0,this),b.jsxDEV(N,{marginTop:1,children:b.jsxDEV(O,{color:"red",children:["加载失败: ",z.message]},void 0,!0,void 0,this)},void 0,!1,void 0,this),b.jsxDEV(N,{marginTop:1,children:b.jsxDEV(O,{color:"gray",dimColor:!0,children:["按 ",b.jsxDEV(O,{color:"cyan",children:"Esc"},void 0,!1,void 0,this)," 返回上一步"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return b.jsxDEV(N,{flexDirection:"column",width:"100%",children:[b.jsxDEV(N,{paddingX:2,paddingY:1,children:[b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 2/2: Model 选择"},void 0,!1,void 0,this),K&&b.jsxDEV(O,{dimColor:!0,children:[" ","- ",K.id," (",K.type,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),b.jsxDEV(N,{flexDirection:"column",paddingX:2,gap:0,children:W.map((G,F)=>b.jsxDEV(N,{marginBottom:0,gap:1,children:[b.jsxDEV(O,{color:F===Q?"cyan":"gray",bold:F===Q,children:F===Q?">":" "},void 0,!1,void 0,this),b.jsxDEV(O,{bold:F===Q,color:F===Q?"cyan":void 0,children:G.id},void 0,!1,void 0,this),G.name!==G.id&&b.jsxDEV(O,{dimColor:F!==Q,children:["(",G.name,")"]},void 0,!0,void 0,this)]},G.id,!0,void 0,this))},void 0,!1,void 0,this),b.jsxDEV(N,{marginTop:1,paddingX:2,children:b.jsxDEV(O,{color:"gray",dimColor:!0,children:[b.jsxDEV(O,{color:"cyan",children:"↑↓"},void 0,!1,void 0,this)," 导航 ",b.jsxDEV(O,{color:"cyan",children:"Enter/Space"},void 0,!1,void 0,this)," 确认"," ",b.jsxDEV(O,{color:"cyan",children:"Esc/B"},void 0,!1,void 0,this)," 返回"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},A5=i$;var B5=L(x(),1);var GZ=L(v(),1);class L5 extends B5.Component{state={hasError:!1,error:null,errorInfo:null};static getDerivedStateFromError(Z){return{hasError:!0,error:Z}}componentDidCatch(Z,Y){let{name:X="ErrorBoundary"}=this.props;console.error(`
73
- ========================================`),console.error(`[${X}] React Error Caught`),console.error("========================================"),console.error("Error:",Z.message),console.error("Stack:",Z.stack),console.error("Component Stack:",Y.componentStack),console.error(`========================================
74
- `),this.setState({errorInfo:Y})}render(){let{hasError:Z,error:Y,errorInfo:X}=this.state,{name:J="ErrorBoundary",fallback:Q,children:$}=this.props;if(Z){if(Q)return GZ.jsxDEV(GZ.Fragment,{children:Q},void 0,!1,void 0,this);return GZ.jsxDEV(N,{flexDirection:"column",padding:1,borderStyle:"double",borderColor:"red",children:[GZ.jsxDEV(N,{marginBottom:1,children:GZ.jsxDEV(O,{color:"red",bold:!0,children:["✗ [",J,"] Render Error"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),GZ.jsxDEV(N,{marginBottom:1,children:GZ.jsxDEV(O,{color:"red",children:["Message: ",Y?.message||"Unknown error"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Y?.stack&&GZ.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[GZ.jsxDEV(O,{color:"yellow",bold:!0,children:"Stack Trace:"},void 0,!1,void 0,this),GZ.jsxDEV(O,{color:"gray",children:Y.stack.split(`
75
- `).slice(0,5).join(`
76
- `)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X?.componentStack&&GZ.jsxDEV(N,{flexDirection:"column",children:[GZ.jsxDEV(O,{color:"yellow",bold:!0,children:"Component Stack:"},void 0,!1,void 0,this),GZ.jsxDEV(O,{color:"gray",dimColor:!0,children:X.componentStack.split(`
77
- `).slice(0,5).join(`
78
- `)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),GZ.jsxDEV(N,{marginTop:1,children:GZ.jsxDEV(O,{color:"blue",dimColor:!0,children:"Press Ctrl+C to exit"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}return GZ.jsxDEV(GZ.Fragment,{children:$},void 0,!1,void 0,this)}}var n=L5;var G0=L(v(),1),o$=({children:Z})=>{let{extraParams:Y,toggleCompactMode:X,config:J}=UZ(),{setTools:Q,loading:$}=WZ(),{hasPendingInteractions:K}=uZ();I8({tools:N5,setTools:Q});let{needsSetup:W,validation:U}=E8({config:J});T8({shouldFocus:!$});let z=f8(),{isChatView:H}=z,{handleExecuteTask:G}=j8({closePanel:z.closePanel});if(mZ((M,_)=>{if(_.ctrl&&M==="o"&&H&&!$)X();else if(_.ctrl&&M==="z"&&globalThis.Bun)import("v8").then((A)=>{A.writeHeapSnapshot("my-application.heapsnapshot")})},{isActive:H}),W&&U)return G0.jsxDEV(n,{name:"SetupWizard",fallback:null,children:G0.jsxDEV(A5,{validation:U,onComplete:z.closePanel},void 0,!1,void 0,this)},void 0,!1,void 0,this);let F={activeView:z.activeView,isChatView:z.isChatView,switchToHistory:z.switchToHistory,switchToKnowledge:z.switchToKnowledge,switchToSettings:z.switchToSettings,switchToModelProvider:z.switchToModelProvider,switchToAgent:z.switchToAgent,switchToTask:z.switchToTask,switchToMcp:z.switchToMcp,closePanel:z.closePanel,handleExecuteTask:G,hasPendingInteractions:K};return G0.jsxDEV(n,{name:"ChatPanelContext",fallback:null,children:G0.jsxDEV(y8,{value:F,children:Z},void 0,!1,void 0,this)},void 0,!1,void 0,this)},P5=({children:Z})=>{return G0.jsxDEV(o$,{children:Z},void 0,!1,void 0,this)};var O1=L(x(),1);var yY=L(x(),1);var L4=L(v(),1),n$=({content:Z,messageNumber:Y})=>{let X=s0(),J=()=>{if(typeof Z==="string")return L4.jsxDEV(O,{color:"white",children:Z},void 0,!1,void 0,this);if(Array.isArray(Z))return Z.filter((Q)=>Q.type==="text").map((Q,$)=>L4.jsxDEV(O,{color:"white",children:Q.text},void 0,!1,void 0,this));return L4.jsxDEV(O,{color:"white",children:JSON.stringify(Z)},void 0,!1,void 0,this)};return L4.jsxDEV(N,{flexDirection:"column",children:[L4.jsxDEV(N,{children:L4.jsxDEV(O,{color:bZ("amber"),children:[Y," ",X]},void 0,!0,void 0,this)},void 0,!1,void 0,this),L4.jsxDEV(N,{children:L4.jsxDEV(O,{color:"gray",children:["└─ ",J()]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},t0=n$;var V=L(RW(),1);function UX(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var i4=UX();function E5(Z){i4=Z}var C0={exec:()=>null};function p(Z,Y=""){let X=typeof Z=="string"?Z:Z.source,J={replace:(Q,$)=>{let K=typeof $=="string"?$:$.source;return K=K.replace(CZ.caret,"$1"),X=X.replace(Q,K),J},getRegex:()=>new RegExp(X,Y)};return J}var a$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),CZ={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:(Z)=>new RegExp(`^( {0,3}${Z})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}#`),htmlBeginRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}<(?:[a-z].*>|!--)`,"i")},s$=/^(?:[ \t]*(?:\n|$))+/,t$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,e$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,v0=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ZK=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zX=/(?:[*+-]|\d{1,9}[.)])/,b5=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,T5=p(b5).replace(/bull/g,zX).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(),YK=p(b5).replace(/bull/g,zX).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(),HX=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,XK=/^[^\n]+/,GX=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,JK=p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",GX).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),QK=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,zX).getRegex(),JY="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",OX=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$K=p("^ {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[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",OX).replace("tag",JY).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),f5=p(HX).replace("hr",v0).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",JY).getRegex(),KK=p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",f5).getRegex(),qX={blockquote:KK,code:t$,def:JK,fences:e$,heading:ZK,hr:v0,html:$K,lheading:T5,list:QK,newline:s$,paragraph:f5,table:C0,text:XK},R5=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",v0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\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",JY).getRegex(),WK={...qX,lheading:YK,table:R5,paragraph:p(HX).replace("hr",v0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",R5).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",JY).getRegex()},UK={...qX,html:p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",OX).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:C0,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(HX).replace("hr",v0).replace("heading",` *#{1,6} *[^
79
- ]`).replace("lheading",T5).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zK=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,HK=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,j5=/^( {2,}|\\)\n(?!\s*$)/,GK=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,QY=/[\p{P}\p{S}]/u,FX=/[\s\p{P}\p{S}]/u,S5=/[^\s\p{P}\p{S}]/u,OK=p(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,FX).getRegex(),y5=/(?!~)[\p{P}\p{S}]/u,qK=/(?!~)[\s\p{P}\p{S}]/u,FK=/(?:[^\s\p{P}\p{S}]|~)/u,MK=p(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",a$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),k5=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,NK=p(k5,"u").replace(/punct/g,QY).getRegex(),_K=p(k5,"u").replace(/punct/g,y5).getRegex(),h5="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wK=p(h5,"gu").replace(/notPunctSpace/g,S5).replace(/punctSpace/g,FX).replace(/punct/g,QY).getRegex(),AK=p(h5,"gu").replace(/notPunctSpace/g,FK).replace(/punctSpace/g,qK).replace(/punct/g,y5).getRegex(),BK=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,S5).replace(/punctSpace/g,FX).replace(/punct/g,QY).getRegex(),LK=p(/\\(punct)/,"gu").replace(/punct/g,QY).getRegex(),PK=p(/^<(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(),RK=p(OX).replace("(?:-->|$)","-->").getRegex(),CK=p("^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",RK).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ZY=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,vK=p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ZY).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),x5=p(/^!?\[(label)\]\[(ref)\]/).replace("label",ZY).replace("ref",GX).getRegex(),g5=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",GX).getRegex(),IK=p("reflink|nolink(?!\\()","g").replace("reflink",x5).replace("nolink",g5).getRegex(),C5=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,MX={_backpedal:C0,anyPunctuation:LK,autolink:PK,blockSkip:MK,br:j5,code:HK,del:C0,emStrongLDelim:NK,emStrongRDelimAst:wK,emStrongRDelimUnd:BK,escape:zK,link:vK,nolink:g5,punctuation:OK,reflink:x5,reflinkSearch:IK,tag:CK,text:GK,url:C0},DK={...MX,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",ZY).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ZY).getRegex()},WX={...MX,emStrongRDelimAst:AK,emStrongLDelim:_K,url:p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",C5).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",C5).getRegex()},VK={...WX,br:p(j5).replace("{2,}","*").getRegex(),text:p(WX.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},e0={normal:qX,gfm:WK,pedantic:UK},L0={normal:MX,gfm:WX,breaks:VK,pedantic:DK},EK={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},v5=(Z)=>EK[Z];function O4(Z,Y){if(Y){if(CZ.escapeTest.test(Z))return Z.replace(CZ.escapeReplace,v5)}else if(CZ.escapeTestNoEncode.test(Z))return Z.replace(CZ.escapeReplaceNoEncode,v5);return Z}function I5(Z){try{Z=encodeURI(Z).replace(CZ.percentDecode,"%")}catch{return null}return Z}function D5(Z,Y){let X=Z.replace(CZ.findPipe,($,K,W)=>{let U=!1,z=K;for(;--z>=0&&W[z]==="\\";)U=!U;return U?"|":" |"}),J=X.split(CZ.splitPipe),Q=0;if(J[0].trim()||J.shift(),J.length>0&&!J.at(-1)?.trim()&&J.pop(),Y)if(J.length>Y)J.splice(Y);else for(;J.length<Y;)J.push("");for(;Q<J.length;Q++)J[Q]=J[Q].trim().replace(CZ.slashPipe,"|");return J}function P0(Z,Y,X){let J=Z.length;if(J===0)return"";let Q=0;for(;Q<J;){let $=Z.charAt(J-Q-1);if($===Y&&!X)Q++;else if($!==Y&&X)Q++;else break}return Z.slice(0,J-Q)}function bK(Z,Y){if(Z.indexOf(Y[1])===-1)return-1;let X=0;for(let J=0;J<Z.length;J++)if(Z[J]==="\\")J++;else if(Z[J]===Y[0])X++;else if(Z[J]===Y[1]&&(X--,X<0))return J;return X>0?-2:-1}function V5(Z,Y,X,J,Q){let $=Y.href,K=Y.title||null,W=Z[1].replace(Q.other.outputLinkReplace,"$1");J.state.inLink=!0;let U={type:Z[0].charAt(0)==="!"?"image":"link",raw:X,href:$,title:K,text:W,tokens:J.inlineTokens(W)};return J.state.inLink=!1,U}function TK(Z,Y,X){let J=Z.match(X.other.indentCodeCompensation);if(J===null)return Y;let Q=J[1];return Y.split(`
80
- `).map(($)=>{let K=$.match(X.other.beginningSpace);if(K===null)return $;let[W]=K;return W.length>=Q.length?$.slice(Q.length):$}).join(`
81
- `)}var YY=class{options;rules;lexer;constructor(Z){this.options=Z||i4}space(Z){let Y=this.rules.block.newline.exec(Z);if(Y&&Y[0].length>0)return{type:"space",raw:Y[0]}}code(Z){let Y=this.rules.block.code.exec(Z);if(Y){let X=Y[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:Y[0],codeBlockStyle:"indented",text:this.options.pedantic?X:P0(X,`
82
- `)}}}fences(Z){let Y=this.rules.block.fences.exec(Z);if(Y){let X=Y[0],J=TK(X,Y[3]||"",this.rules);return{type:"code",raw:X,lang:Y[2]?Y[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):Y[2],text:J}}}heading(Z){let Y=this.rules.block.heading.exec(Z);if(Y){let X=Y[2].trim();if(this.rules.other.endingHash.test(X)){let J=P0(X,"#");(this.options.pedantic||!J||this.rules.other.endingSpaceChar.test(J))&&(X=J.trim())}return{type:"heading",raw:Y[0],depth:Y[1].length,text:X,tokens:this.lexer.inline(X)}}}hr(Z){let Y=this.rules.block.hr.exec(Z);if(Y)return{type:"hr",raw:P0(Y[0],`
83
- `)}}blockquote(Z){let Y=this.rules.block.blockquote.exec(Z);if(Y){let X=P0(Y[0],`
72
+ - 适合批量执行 MCP 相关操作`,parameters:p$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output,J=null;try{J=JSON.parse(X)}catch(Q){}return EZ.jsxDEV(_,{flexDirection:"column",children:[EZ.jsxDEV(_,{children:EZ.jsxDEV(O,{color:"blue",bold:!0,children:"execute_mcp_tool"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?.commands&&Y.commands.length>0&&EZ.jsxDEV(_,{flexDirection:"column",marginTop:1,children:[EZ.jsxDEV(O,{color:"gray",dimColor:!0,children:["执行 ",Y.commands.length," 个 MCP 工具:"]},void 0,!0,void 0,this),Y.commands.map((Q,$)=>EZ.jsxDEV(_,{marginLeft:2,children:[EZ.jsxDEV(O,{color:"yellow",children:[$+1,"."]},void 0,!0,void 0,this),EZ.jsxDEV(O,{color:"cyan",children:Q.name},void 0,!1,void 0,this)]},$,!0,void 0,this))]},void 0,!0,void 0,this),J?.results&&EZ.jsxDEV(_,{flexDirection:"column",marginTop:1,children:J.results.map((Q,$)=>EZ.jsxDEV(_,{marginLeft:2,children:Q.error?EZ.jsxDEV(O,{color:"red",children:["✗ ",Q.tool]},void 0,!0,void 0,this):EZ.jsxDEV(O,{color:"green",children:["✓ ",Q.tool]},void 0,!0,void 0,this)},$,!1,void 0,this))},void 0,!1,void 0,this),X&&EZ.jsxDEV(W0,{content:X,maxLines:10,borderColor:"gray"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});var O4=P(I(),1);import{z as z0}from"zod";var d$=z0.object({task_id:z0.string().optional().describe("The task id to ask the subagent"),subagent_id:z0.string().describe("The id of subagent to use"),subagent_type:z0.string().describe("The type of subagent to use (general-purpose, statusline-setup, output-style-setup)"),task_description:z0.string().describe("Describe what you want the subagent to do"),data_transfer:z0.any().optional().describe("Data to transfer to the subagent")}),c$=({tool:Z})=>{let Y=Z.getInputRepaired();return O4.jsxDEV(_,{paddingX:1,flexDirection:"column",children:O4.jsxDEV(_,{children:[O4.jsxDEV(O,{color:"yellow",children:"Task "},void 0,!1,void 0,this),O4.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),O4.jsxDEV(O,{color:"cyan",children:Y.subagent_id},void 0,!1,void 0,this),O4.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},l$=({tool:Z})=>{let Y=Z.getInputRepaired(),X=Z.output;return O4.jsxDEV(_,{flexDirection:"column",children:O4.jsxDEV(c$,{tool:Z},void 0,!1,void 0,this)},void 0,!1,void 0,this)},M5=t({name:"task",description:"Launch a subagent to handle complex tasks autonomously",parameters:d$.shape,handler:ZZ.waitForUIDone,render(Z){return O4.jsxDEV(l$,{tool:Z},void 0,!1,void 0,this)}});var N5=[s8,n8,X5,Q5,K5,U5,z5,H5,O5,q5,F5,M5];var e=P(g(),1);var b=P(I(),1),i$=({validation:Z,onComplete:Y})=>{let{config:X,updateConfig:J}=UZ(),[Q,$]=e.useState("welcome"),[K,U]=e.useState(!1),[W,z]=e.useState(null),[H,G]=e.useState(0),[F,M]=e.useState(null),N=e.useRef(!0),w=e.useRef([]),L=e.useRef(H),B=X?.providers||[];e.useEffect(()=>{w.current=B},[B]),e.useEffect(()=>{L.current=H},[H]);let C=B[H],R=e.useCallback(()=>M(null),[]);TZ(R,F?3000:null);let D=e.useCallback(()=>{N.current=!0,z(null),U(!0),M(null)},[]),f=e.useCallback(()=>{let u=w.current,n=L.current,i=u[n];if(!i)return;N.current=!1,z(i),U(!0),M(null)},[]),V=e.useCallback(()=>{U(!1),z(null),M(null)},[]),d=e.useCallback(async(u)=>{let n=w.current,i=N.current,Q4=i?[...n,u]:n.map(($4)=>$4.id===u.id?u:$4);if(await J({providers:Q4}),M(i?`已添加 Provider: ${u.id}`:`已更新 Provider: ${u.id}`),i){let $4=Q4.findIndex((hZ)=>hZ.id===u.id);G($4>=0?$4:0)}V()},[J,V]),l=e.useCallback(()=>{if(!C||!C.apiKey){M("请先配置 Provider 的 API Key");return}J({provider_id:C.id,provider_type:C.type}).then(()=>{$("model")})},[C,J]);if(uZ((u,n)=>{if(n.return||u===" ")$("provider")},{isActive:Q==="welcome"}),uZ((u,n)=>{if(K)return;if(n.upArrow)G((i)=>i>0?i-1:B.length-1);else if(n.downArrow)G((i)=>i<B.length-1?i+1:0);else if(u==="n"||u==="N")D();else if((u==="e"||u==="E"||n.return)&&C)f();else if(u==="s"||u==="S")l()},{isActive:Q==="provider"}),Q==="welcome")return b.jsxDEV(_,{flexDirection:"column",paddingX:2,paddingY:1,width:"100%",children:[b.jsxDEV(_,{marginBottom:1,children:b.jsxDEV(O,{bold:!0,color:"cyan",children:"欢迎使用 Zen Code"},void 0,!1,void 0,this)},void 0,!1,void 0,this),b.jsxDEV(_,{marginBottom:1,children:b.jsxDEV(O,{color:"yellow",children:Z.reason||"需要进行初始配置"},void 0,!1,void 0,this)},void 0,!1,void 0,this),b.jsxDEV(_,{flexDirection:"column",marginBottom:1,children:[b.jsxDEV(O,{dimColor:!0,children:"接下来将引导你完成:"},void 0,!1,void 0,this),b.jsxDEV(O,{dimColor:!0,children:" 1. 配置 Provider(API 服务提供商)"},void 0,!1,void 0,this),b.jsxDEV(O,{dimColor:!0,children:" 2. 选择 Model(AI 模型)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b.jsxDEV(_,{children:b.jsxDEV(O,{color:"green",bold:!0,children:"按 Enter 开始配置"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(Q==="provider")return b.jsxDEV(_,{flexDirection:"column",width:"100%",children:[b.jsxDEV(_,{paddingX:2,paddingY:1,children:b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 1/2: Provider 配置"},void 0,!1,void 0,this)},void 0,!1,void 0,this),K?b.jsxDEV(A5,{provider:W||void 0,onCancel:V,onSave:d},void 0,!1,void 0,this):b.jsxDEV(b.Fragment,{children:b.jsxDEV(_,{flexDirection:"column",paddingX:2,gap:1,children:[B.length===0?b.jsxDEV(_,{paddingY:1,children:b.jsxDEV(O,{color:"yellow",children:"未配置任何 Provider,请按 'n' 新增"},void 0,!1,void 0,this)},void 0,!1,void 0,this):B.map((u,n)=>{let i=!!u.apiKey,Q4=i?"green":"yellow";return b.jsxDEV(_,{marginBottom:0,gap:1,children:[b.jsxDEV(O,{color:n===H?"cyan":"gray",bold:n===H,children:n===H?">":" "},void 0,!1,void 0,this),b.jsxDEV(O,{bold:n===H,color:n===H?"cyan":void 0,children:u.id},void 0,!1,void 0,this),b.jsxDEV(O,{color:"gray",dimColor:n!==H,children:[" ",u.type]},void 0,!0,void 0,this),b.jsxDEV(O,{color:Q4,dimColor:n!==H,children:[" ","[",i?"已配置":"未配置","]"]},void 0,!0,void 0,this)]},u.id,!0,void 0,this)}),b.jsxDEV(_,{marginTop:1,children:[b.jsxDEV(O,{color:"gray",dimColor:!0,children:[b.jsxDEV(O,{color:"cyan",children:"↑↓"},void 0,!1,void 0,this)," 导航 ",b.jsxDEV(O,{color:"cyan",children:"n"},void 0,!1,void 0,this)," 新增"," ",b.jsxDEV(O,{color:"cyan",children:"e/Enter"},void 0,!1,void 0,this)," 编辑"," "]},void 0,!0,void 0,this),B.some((u)=>u.apiKey)&&b.jsxDEV(O,{children:[b.jsxDEV(O,{color:"green",children:"s"},void 0,!1,void 0,this)," 下一步"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F&&b.jsxDEV(_,{paddingX:2,paddingY:0,children:b.jsxDEV(O,{color:"green",children:F},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(Q==="model")return b.jsxDEV(r$,{onComplete:Y,onBack:()=>$("provider")},void 0,!1,void 0,this);return null},r$=({onComplete:Z,onBack:Y})=>{let{config:X,updateConfig:J}=UZ(),[Q,$]=e.useState(0),K=e.useMemo(()=>{return X?.providers.find((G)=>G.id===X.provider_id)||null},[X?.providers,X?.provider_id]),{data:U=[],isLoading:W,error:z}=_5({provider:K,enabled:!!K?.apiKey}),H=U[Q];if(uZ((G,F)=>{if(F.upArrow)$((M)=>M>0?M-1:U.length-1);else if(F.downArrow)$((M)=>M<U.length-1?M+1:0);else if(F.escape||G==="b"||G==="B")Y();else if((F.return||G===" ")&&H)J({model_id:H.id}).then(()=>{Z()})},{isActive:!W&&!z&&X!==null}),W)return b.jsxDEV(_,{flexDirection:"column",paddingX:2,paddingY:1,children:[b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 2/2: Model 选择"},void 0,!1,void 0,this),b.jsxDEV(_,{marginTop:1,children:b.jsxDEV(O,{color:"gray",children:"加载模型列表中..."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(z)return b.jsxDEV(_,{flexDirection:"column",paddingX:2,paddingY:1,children:[b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 2/2: Model 选择"},void 0,!1,void 0,this),b.jsxDEV(_,{marginTop:1,children:b.jsxDEV(O,{color:"red",children:["加载失败: ",z.message]},void 0,!0,void 0,this)},void 0,!1,void 0,this),b.jsxDEV(_,{marginTop:1,children:b.jsxDEV(O,{color:"gray",dimColor:!0,children:["按 ",b.jsxDEV(O,{color:"cyan",children:"Esc"},void 0,!1,void 0,this)," 返回上一步"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return b.jsxDEV(_,{flexDirection:"column",width:"100%",children:[b.jsxDEV(_,{paddingX:2,paddingY:1,children:[b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 2/2: Model 选择"},void 0,!1,void 0,this),K&&b.jsxDEV(O,{dimColor:!0,children:[" ","- ",K.id," (",K.type,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),b.jsxDEV(_,{flexDirection:"column",paddingX:2,gap:0,children:U.map((G,F)=>b.jsxDEV(_,{marginBottom:0,gap:1,children:[b.jsxDEV(O,{color:F===Q?"cyan":"gray",bold:F===Q,children:F===Q?">":" "},void 0,!1,void 0,this),b.jsxDEV(O,{bold:F===Q,color:F===Q?"cyan":void 0,children:G.id},void 0,!1,void 0,this),G.name!==G.id&&b.jsxDEV(O,{dimColor:F!==Q,children:["(",G.name,")"]},void 0,!0,void 0,this)]},G.id,!0,void 0,this))},void 0,!1,void 0,this),b.jsxDEV(_,{marginTop:1,paddingX:2,children:b.jsxDEV(O,{color:"gray",dimColor:!0,children:[b.jsxDEV(O,{color:"cyan",children:"↑↓"},void 0,!1,void 0,this)," 导航 ",b.jsxDEV(O,{color:"cyan",children:"Enter/Space"},void 0,!1,void 0,this)," 确认"," ",b.jsxDEV(O,{color:"cyan",children:"Esc/B"},void 0,!1,void 0,this)," 返回"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},w5=i$;var H0=P(I(),1),o$=({children:Z})=>{let{extraParams:Y,toggleCompactMode:X,config:J}=UZ(),{setTools:Q,loading:$}=WZ(),{hasPendingInteractions:K}=xZ();v8({tools:N5,setTools:Q});let{needsSetup:U,validation:W}=E8({config:J});T8({shouldFocus:!$});let z=f8(),{isChatView:H}=z,{handleExecuteTask:G}=j8({closePanel:z.closePanel});if(uZ((M,N)=>{if(N.ctrl&&M==="o"&&H&&!$)X();else if(N.ctrl&&M==="z"&&globalThis.Bun)import("v8").then((w)=>{w.writeHeapSnapshot("my-application.heapsnapshot")})},{isActive:H}),U&&W)return H0.jsxDEV(r,{name:"SetupWizard",fallback:null,children:H0.jsxDEV(w5,{validation:W,onComplete:z.closePanel},void 0,!1,void 0,this)},void 0,!1,void 0,this);let F={activeView:z.activeView,isChatView:z.isChatView,switchToHistory:z.switchToHistory,switchToKnowledge:z.switchToKnowledge,switchToSettings:z.switchToSettings,switchToModelProvider:z.switchToModelProvider,switchToAgent:z.switchToAgent,switchToTask:z.switchToTask,switchToMcp:z.switchToMcp,switchToProcess:z.switchToProcess,closePanel:z.closePanel,handleExecuteTask:G,hasPendingInteractions:K};return H0.jsxDEV(r,{name:"ChatPanelContext",fallback:null,children:H0.jsxDEV(y8,{value:F,children:Z},void 0,!1,void 0,this)},void 0,!1,void 0,this)},B5=({children:Z})=>{return H0.jsxDEV(o$,{children:Z},void 0,!1,void 0,this)};var H1=P(g(),1);var kY=P(g(),1);var w4=P(I(),1),n$=({content:Z,messageNumber:Y})=>{let X=t0(),J=()=>{if(typeof Z==="string")return w4.jsxDEV(O,{color:"white",children:Z},void 0,!1,void 0,this);if(Array.isArray(Z))return Z.filter((Q)=>Q.type==="text").map((Q,$)=>w4.jsxDEV(O,{color:"white",children:Q.text},void 0,!1,void 0,this));return w4.jsxDEV(O,{color:"white",children:JSON.stringify(Z)},void 0,!1,void 0,this)};return w4.jsxDEV(_,{flexDirection:"column",children:[w4.jsxDEV(_,{children:w4.jsxDEV(O,{color:c4("amber"),children:[Y," ",X]},void 0,!0,void 0,this)},void 0,!1,void 0,this),w4.jsxDEV(_,{children:w4.jsxDEV(O,{color:"gray",children:["└─ ",J()]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},e0=n$;var E=P(RW(),1);function zX(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var r4=zX();function D5(Z){r4=Z}var R0={exec:()=>null};function p(Z,Y=""){let X=typeof Z=="string"?Z:Z.source,J={replace:(Q,$)=>{let K=typeof $=="string"?$:$.source;return K=K.replace(RZ.caret,"$1"),X=X.replace(Q,K),J},getRegex:()=>new RegExp(X,Y)};return J}var a$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),RZ={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:(Z)=>new RegExp(`^( {0,3}${Z})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}#`),htmlBeginRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}<(?:[a-z].*>|!--)`,"i")},s$=/^(?:[ \t]*(?:\n|$))+/,t$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,e$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C0=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ZK=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,HX=/(?:[*+-]|\d{1,9}[.)])/,V5=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,E5=p(V5).replace(/bull/g,HX).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(),YK=p(V5).replace(/bull/g,HX).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(),GX=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,XK=/^[^\n]+/,OX=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,JK=p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",OX).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),QK=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,HX).getRegex(),QY="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",qX=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$K=p("^ {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[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",qX).replace("tag",QY).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),b5=p(GX).replace("hr",C0).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",QY).getRegex(),KK=p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",b5).getRegex(),FX={blockquote:KK,code:t$,def:JK,fences:e$,heading:ZK,hr:C0,html:$K,lheading:E5,list:QK,newline:s$,paragraph:b5,table:R0,text:XK},L5=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",C0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\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",QY).getRegex(),WK={...FX,lheading:YK,table:L5,paragraph:p(GX).replace("hr",C0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",L5).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",QY).getRegex()},UK={...FX,html:p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qX).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:R0,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(GX).replace("hr",C0).replace("heading",` *#{1,6} *[^
73
+ ]`).replace("lheading",E5).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zK=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,HK=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,T5=/^( {2,}|\\)\n(?!\s*$)/,GK=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$Y=/[\p{P}\p{S}]/u,MX=/[\s\p{P}\p{S}]/u,f5=/[^\s\p{P}\p{S}]/u,OK=p(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,MX).getRegex(),j5=/(?!~)[\p{P}\p{S}]/u,qK=/(?!~)[\s\p{P}\p{S}]/u,FK=/(?:[^\s\p{P}\p{S}]|~)/u,MK=p(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",a$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),S5=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,NK=p(S5,"u").replace(/punct/g,$Y).getRegex(),_K=p(S5,"u").replace(/punct/g,j5).getRegex(),y5="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",AK=p(y5,"gu").replace(/notPunctSpace/g,f5).replace(/punctSpace/g,MX).replace(/punct/g,$Y).getRegex(),wK=p(y5,"gu").replace(/notPunctSpace/g,FK).replace(/punctSpace/g,qK).replace(/punct/g,j5).getRegex(),BK=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,f5).replace(/punctSpace/g,MX).replace(/punct/g,$Y).getRegex(),LK=p(/\\(punct)/,"gu").replace(/punct/g,$Y).getRegex(),PK=p(/^<(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(),RK=p(qX).replace("(?:-->|$)","-->").getRegex(),CK=p("^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",RK).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),YY=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,IK=p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",YY).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),k5=p(/^!?\[(label)\]\[(ref)\]/).replace("label",YY).replace("ref",OX).getRegex(),h5=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",OX).getRegex(),vK=p("reflink|nolink(?!\\()","g").replace("reflink",k5).replace("nolink",h5).getRegex(),P5=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,NX={_backpedal:R0,anyPunctuation:LK,autolink:PK,blockSkip:MK,br:T5,code:HK,del:R0,emStrongLDelim:NK,emStrongRDelimAst:AK,emStrongRDelimUnd:BK,escape:zK,link:IK,nolink:h5,punctuation:OK,reflink:k5,reflinkSearch:vK,tag:CK,text:GK,url:R0},DK={...NX,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",YY).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",YY).getRegex()},UX={...NX,emStrongRDelimAst:wK,emStrongLDelim:_K,url:p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",P5).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",P5).getRegex()},VK={...UX,br:p(T5).replace("{2,}","*").getRegex(),text:p(UX.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ZY={normal:FX,gfm:WK,pedantic:UK},B0={normal:NX,gfm:UX,breaks:VK,pedantic:DK},EK={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},R5=(Z)=>EK[Z];function q4(Z,Y){if(Y){if(RZ.escapeTest.test(Z))return Z.replace(RZ.escapeReplace,R5)}else if(RZ.escapeTestNoEncode.test(Z))return Z.replace(RZ.escapeReplaceNoEncode,R5);return Z}function C5(Z){try{Z=encodeURI(Z).replace(RZ.percentDecode,"%")}catch{return null}return Z}function I5(Z,Y){let X=Z.replace(RZ.findPipe,($,K,U)=>{let W=!1,z=K;for(;--z>=0&&U[z]==="\\";)W=!W;return W?"|":" |"}),J=X.split(RZ.splitPipe),Q=0;if(J[0].trim()||J.shift(),J.length>0&&!J.at(-1)?.trim()&&J.pop(),Y)if(J.length>Y)J.splice(Y);else for(;J.length<Y;)J.push("");for(;Q<J.length;Q++)J[Q]=J[Q].trim().replace(RZ.slashPipe,"|");return J}function L0(Z,Y,X){let J=Z.length;if(J===0)return"";let Q=0;for(;Q<J;){let $=Z.charAt(J-Q-1);if($===Y&&!X)Q++;else if($!==Y&&X)Q++;else break}return Z.slice(0,J-Q)}function bK(Z,Y){if(Z.indexOf(Y[1])===-1)return-1;let X=0;for(let J=0;J<Z.length;J++)if(Z[J]==="\\")J++;else if(Z[J]===Y[0])X++;else if(Z[J]===Y[1]&&(X--,X<0))return J;return X>0?-2:-1}function v5(Z,Y,X,J,Q){let $=Y.href,K=Y.title||null,U=Z[1].replace(Q.other.outputLinkReplace,"$1");J.state.inLink=!0;let W={type:Z[0].charAt(0)==="!"?"image":"link",raw:X,href:$,title:K,text:U,tokens:J.inlineTokens(U)};return J.state.inLink=!1,W}function TK(Z,Y,X){let J=Z.match(X.other.indentCodeCompensation);if(J===null)return Y;let Q=J[1];return Y.split(`
74
+ `).map(($)=>{let K=$.match(X.other.beginningSpace);if(K===null)return $;let[U]=K;return U.length>=Q.length?$.slice(Q.length):$}).join(`
75
+ `)}var XY=class{options;rules;lexer;constructor(Z){this.options=Z||r4}space(Z){let Y=this.rules.block.newline.exec(Z);if(Y&&Y[0].length>0)return{type:"space",raw:Y[0]}}code(Z){let Y=this.rules.block.code.exec(Z);if(Y){let X=Y[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:Y[0],codeBlockStyle:"indented",text:this.options.pedantic?X:L0(X,`
76
+ `)}}}fences(Z){let Y=this.rules.block.fences.exec(Z);if(Y){let X=Y[0],J=TK(X,Y[3]||"",this.rules);return{type:"code",raw:X,lang:Y[2]?Y[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):Y[2],text:J}}}heading(Z){let Y=this.rules.block.heading.exec(Z);if(Y){let X=Y[2].trim();if(this.rules.other.endingHash.test(X)){let J=L0(X,"#");(this.options.pedantic||!J||this.rules.other.endingSpaceChar.test(J))&&(X=J.trim())}return{type:"heading",raw:Y[0],depth:Y[1].length,text:X,tokens:this.lexer.inline(X)}}}hr(Z){let Y=this.rules.block.hr.exec(Z);if(Y)return{type:"hr",raw:L0(Y[0],`
77
+ `)}}blockquote(Z){let Y=this.rules.block.blockquote.exec(Z);if(Y){let X=L0(Y[0],`
84
78
  `).split(`
85
- `),J="",Q="",$=[];for(;X.length>0;){let K=!1,W=[],U;for(U=0;U<X.length;U++)if(this.rules.other.blockquoteStart.test(X[U]))W.push(X[U]),K=!0;else if(!K)W.push(X[U]);else break;X=X.slice(U);let z=W.join(`
79
+ `),J="",Q="",$=[];for(;X.length>0;){let K=!1,U=[],W;for(W=0;W<X.length;W++)if(this.rules.other.blockquoteStart.test(X[W]))U.push(X[W]),K=!0;else if(!K)U.push(X[W]);else break;X=X.slice(W);let z=U.join(`
86
80
  `),H=z.replace(this.rules.other.blockquoteSetextReplace,`
87
81
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");J=J?`${J}
88
82
  ${z}`:z,Q=Q?`${Q}
89
- ${H}`:H;let G=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(H,$,!0),this.lexer.state.top=G,X.length===0)break;let F=$.at(-1);if(F?.type==="code")break;if(F?.type==="blockquote"){let M=F,_=M.raw+`
83
+ ${H}`:H;let G=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(H,$,!0),this.lexer.state.top=G,X.length===0)break;let F=$.at(-1);if(F?.type==="code")break;if(F?.type==="blockquote"){let M=F,N=M.raw+`
90
84
  `+X.join(`
91
- `),A=this.blockquote(_);$[$.length-1]=A,J=J.substring(0,J.length-M.raw.length)+A.raw,Q=Q.substring(0,Q.length-M.text.length)+A.text;break}else if(F?.type==="list"){let M=F,_=M.raw+`
85
+ `),w=this.blockquote(N);$[$.length-1]=w,J=J.substring(0,J.length-M.raw.length)+w.raw,Q=Q.substring(0,Q.length-M.text.length)+w.text;break}else if(F?.type==="list"){let M=F,N=M.raw+`
92
86
  `+X.join(`
93
- `),A=this.list(_);$[$.length-1]=A,J=J.substring(0,J.length-F.raw.length)+A.raw,Q=Q.substring(0,Q.length-M.raw.length)+A.raw,X=_.substring($.at(-1).raw.length).split(`
94
- `);continue}}return{type:"blockquote",raw:J,tokens:$,text:Q}}}list(Z){let Y=this.rules.block.list.exec(Z);if(Y){let X=Y[1].trim(),J=X.length>1,Q={type:"list",raw:"",ordered:J,start:J?+X.slice(0,-1):"",loose:!1,items:[]};X=J?`\\d{1,9}\\${X.slice(-1)}`:`\\${X}`,this.options.pedantic&&(X=J?X:"[*+-]");let $=this.rules.other.listItemRegex(X),K=!1;for(;Z;){let U=!1,z="",H="";if(!(Y=$.exec(Z))||this.rules.block.hr.test(Z))break;z=Y[0],Z=Z.substring(z.length);let G=Y[2].split(`
87
+ `),w=this.list(N);$[$.length-1]=w,J=J.substring(0,J.length-F.raw.length)+w.raw,Q=Q.substring(0,Q.length-M.raw.length)+w.raw,X=N.substring($.at(-1).raw.length).split(`
88
+ `);continue}}return{type:"blockquote",raw:J,tokens:$,text:Q}}}list(Z){let Y=this.rules.block.list.exec(Z);if(Y){let X=Y[1].trim(),J=X.length>1,Q={type:"list",raw:"",ordered:J,start:J?+X.slice(0,-1):"",loose:!1,items:[]};X=J?`\\d{1,9}\\${X.slice(-1)}`:`\\${X}`,this.options.pedantic&&(X=J?X:"[*+-]");let $=this.rules.other.listItemRegex(X),K=!1;for(;Z;){let W=!1,z="",H="";if(!(Y=$.exec(Z))||this.rules.block.hr.test(Z))break;z=Y[0],Z=Z.substring(z.length);let G=Y[2].split(`
95
89
  `,1)[0].replace(this.rules.other.listReplaceTabs,(B)=>" ".repeat(3*B.length)),F=Z.split(`
96
- `,1)[0],M=!G.trim(),_=0;if(this.options.pedantic?(_=2,H=G.trimStart()):M?_=Y[1].length+1:(_=Y[2].search(this.rules.other.nonSpaceChar),_=_>4?1:_,H=G.slice(_),_+=Y[1].length),M&&this.rules.other.blankLine.test(F)&&(z+=F+`
97
- `,Z=Z.substring(F.length+1),U=!0),!U){let B=this.rules.other.nextBulletRegex(_),C=this.rules.other.hrRegex(_),R=this.rules.other.fencesBeginRegex(_),D=this.rules.other.headingBeginRegex(_),j=this.rules.other.htmlBeginRegex(_);for(;Z;){let E=Z.split(`
98
- `,1)[0],c;if(F=E,this.options.pedantic?(F=F.replace(this.rules.other.listReplaceNesting," "),c=F):c=F.replace(this.rules.other.tabCharGlobal," "),R.test(F)||D.test(F)||j.test(F)||B.test(F)||C.test(F))break;if(c.search(this.rules.other.nonSpaceChar)>=_||!F.trim())H+=`
99
- `+c.slice(_);else{if(M||G.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||R.test(G)||D.test(G)||C.test(G))break;H+=`
100
- `+F}!M&&!F.trim()&&(M=!0),z+=E+`
101
- `,Z=Z.substring(E.length+1),G=c.slice(_)}}Q.loose||(K?Q.loose=!0:this.rules.other.doubleBlankLine.test(z)&&(K=!0));let A=null,P;this.options.gfm&&(A=this.rules.other.listIsTask.exec(H),A&&(P=A[0]!=="[ ] ",H=H.replace(this.rules.other.listReplaceTask,""))),Q.items.push({type:"list_item",raw:z,task:!!A,checked:P,loose:!1,text:H,tokens:[]}),Q.raw+=z}let W=Q.items.at(-1);if(W)W.raw=W.raw.trimEnd(),W.text=W.text.trimEnd();else return;Q.raw=Q.raw.trimEnd();for(let U=0;U<Q.items.length;U++)if(this.lexer.state.top=!1,Q.items[U].tokens=this.lexer.blockTokens(Q.items[U].text,[]),!Q.loose){let z=Q.items[U].tokens.filter((G)=>G.type==="space"),H=z.length>0&&z.some((G)=>this.rules.other.anyLine.test(G.raw));Q.loose=H}if(Q.loose)for(let U=0;U<Q.items.length;U++)Q.items[U].loose=!0;return Q}}html(Z){let Y=this.rules.block.html.exec(Z);if(Y)return{type:"html",block:!0,raw:Y[0],pre:Y[1]==="pre"||Y[1]==="script"||Y[1]==="style",text:Y[0]}}def(Z){let Y=this.rules.block.def.exec(Z);if(Y){let X=Y[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),J=Y[2]?Y[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",Q=Y[3]?Y[3].substring(1,Y[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):Y[3];return{type:"def",tag:X,raw:Y[0],href:J,title:Q}}}table(Z){let Y=this.rules.block.table.exec(Z);if(!Y||!this.rules.other.tableDelimiter.test(Y[2]))return;let X=D5(Y[1]),J=Y[2].replace(this.rules.other.tableAlignChars,"").split("|"),Q=Y[3]?.trim()?Y[3].replace(this.rules.other.tableRowBlankLine,"").split(`
102
- `):[],$={type:"table",raw:Y[0],header:[],align:[],rows:[]};if(X.length===J.length){for(let K of J)this.rules.other.tableAlignRight.test(K)?$.align.push("right"):this.rules.other.tableAlignCenter.test(K)?$.align.push("center"):this.rules.other.tableAlignLeft.test(K)?$.align.push("left"):$.align.push(null);for(let K=0;K<X.length;K++)$.header.push({text:X[K],tokens:this.lexer.inline(X[K]),header:!0,align:$.align[K]});for(let K of Q)$.rows.push(D5(K,$.header.length).map((W,U)=>({text:W,tokens:this.lexer.inline(W),header:!1,align:$.align[U]})));return $}}lheading(Z){let Y=this.rules.block.lheading.exec(Z);if(Y)return{type:"heading",raw:Y[0],depth:Y[2].charAt(0)==="="?1:2,text:Y[1],tokens:this.lexer.inline(Y[1])}}paragraph(Z){let Y=this.rules.block.paragraph.exec(Z);if(Y){let X=Y[1].charAt(Y[1].length-1)===`
103
- `?Y[1].slice(0,-1):Y[1];return{type:"paragraph",raw:Y[0],text:X,tokens:this.lexer.inline(X)}}}text(Z){let Y=this.rules.block.text.exec(Z);if(Y)return{type:"text",raw:Y[0],text:Y[0],tokens:this.lexer.inline(Y[0])}}escape(Z){let Y=this.rules.inline.escape.exec(Z);if(Y)return{type:"escape",raw:Y[0],text:Y[1]}}tag(Z){let Y=this.rules.inline.tag.exec(Z);if(Y)return!this.lexer.state.inLink&&this.rules.other.startATag.test(Y[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(Y[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(Y[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(Y[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:Y[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:Y[0]}}link(Z){let Y=this.rules.inline.link.exec(Z);if(Y){let X=Y[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(X)){if(!this.rules.other.endAngleBracket.test(X))return;let $=P0(X.slice(0,-1),"\\");if((X.length-$.length)%2===0)return}else{let $=bK(Y[2],"()");if($===-2)return;if($>-1){let K=(Y[0].indexOf("!")===0?5:4)+Y[1].length+$;Y[2]=Y[2].substring(0,$),Y[0]=Y[0].substring(0,K).trim(),Y[3]=""}}let J=Y[2],Q="";if(this.options.pedantic){let $=this.rules.other.pedanticHrefTitle.exec(J);$&&(J=$[1],Q=$[3])}else Q=Y[3]?Y[3].slice(1,-1):"";return J=J.trim(),this.rules.other.startAngleBracket.test(J)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(X)?J=J.slice(1):J=J.slice(1,-1)),V5(Y,{href:J&&J.replace(this.rules.inline.anyPunctuation,"$1"),title:Q&&Q.replace(this.rules.inline.anyPunctuation,"$1")},Y[0],this.lexer,this.rules)}}reflink(Z,Y){let X;if((X=this.rules.inline.reflink.exec(Z))||(X=this.rules.inline.nolink.exec(Z))){let J=(X[2]||X[1]).replace(this.rules.other.multipleSpaceGlobal," "),Q=Y[J.toLowerCase()];if(!Q){let $=X[0].charAt(0);return{type:"text",raw:$,text:$}}return V5(X,Q,X[0],this.lexer,this.rules)}}emStrong(Z,Y,X=""){let J=this.rules.inline.emStrongLDelim.exec(Z);if(!J||J[3]&&X.match(this.rules.other.unicodeAlphaNumeric))return;if(!(J[1]||J[2])||!X||this.rules.inline.punctuation.exec(X)){let Q=[...J[0]].length-1,$,K,W=Q,U=0,z=J[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(z.lastIndex=0,Y=Y.slice(-1*Z.length+Q);(J=z.exec(Y))!=null;){if($=J[1]||J[2]||J[3]||J[4]||J[5]||J[6],!$)continue;if(K=[...$].length,J[3]||J[4]){W+=K;continue}else if((J[5]||J[6])&&Q%3&&!((Q+K)%3)){U+=K;continue}if(W-=K,W>0)continue;K=Math.min(K,K+W+U);let H=[...J[0]][0].length,G=Z.slice(0,Q+J.index+H+K);if(Math.min(Q,K)%2){let M=G.slice(1,-1);return{type:"em",raw:G,text:M,tokens:this.lexer.inlineTokens(M)}}let F=G.slice(2,-2);return{type:"strong",raw:G,text:F,tokens:this.lexer.inlineTokens(F)}}}}codespan(Z){let Y=this.rules.inline.code.exec(Z);if(Y){let X=Y[2].replace(this.rules.other.newLineCharGlobal," "),J=this.rules.other.nonSpaceChar.test(X),Q=this.rules.other.startingSpaceChar.test(X)&&this.rules.other.endingSpaceChar.test(X);return J&&Q&&(X=X.substring(1,X.length-1)),{type:"codespan",raw:Y[0],text:X}}}br(Z){let Y=this.rules.inline.br.exec(Z);if(Y)return{type:"br",raw:Y[0]}}del(Z){let Y=this.rules.inline.del.exec(Z);if(Y)return{type:"del",raw:Y[0],text:Y[2],tokens:this.lexer.inlineTokens(Y[2])}}autolink(Z){let Y=this.rules.inline.autolink.exec(Z);if(Y){let X,J;return Y[2]==="@"?(X=Y[1],J="mailto:"+X):(X=Y[1],J=X),{type:"link",raw:Y[0],text:X,href:J,tokens:[{type:"text",raw:X,text:X}]}}}url(Z){let Y;if(Y=this.rules.inline.url.exec(Z)){let X,J;if(Y[2]==="@")X=Y[0],J="mailto:"+X;else{let Q;do Q=Y[0],Y[0]=this.rules.inline._backpedal.exec(Y[0])?.[0]??"";while(Q!==Y[0]);X=Y[0],Y[1]==="www."?J="http://"+Y[0]:J=Y[0]}return{type:"link",raw:Y[0],text:X,href:J,tokens:[{type:"text",raw:X,text:X}]}}}inlineText(Z){let Y=this.rules.inline.text.exec(Z);if(Y){let X=this.lexer.state.inRawBlock;return{type:"text",raw:Y[0],text:Y[0],escaped:X}}}},tZ=class Z{tokens;options;state;tokenizer;inlineQueue;constructor(Y){this.tokens=[],this.tokens.links=Object.create(null),this.options=Y||i4,this.options.tokenizer=this.options.tokenizer||new YY,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let X={other:CZ,block:e0.normal,inline:L0.normal};this.options.pedantic?(X.block=e0.pedantic,X.inline=L0.pedantic):this.options.gfm&&(X.block=e0.gfm,this.options.breaks?X.inline=L0.breaks:X.inline=L0.gfm),this.tokenizer.rules=X}static get rules(){return{block:e0,inline:L0}}static lex(Y,X){return new Z(X).lex(Y)}static lexInline(Y,X){return new Z(X).inlineTokens(Y)}lex(Y){Y=Y.replace(CZ.carriageReturn,`
104
- `),this.blockTokens(Y,this.tokens);for(let X=0;X<this.inlineQueue.length;X++){let J=this.inlineQueue[X];this.inlineTokens(J.src,J.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(Y,X=[],J=!1){for(this.options.pedantic&&(Y=Y.replace(CZ.tabCharGlobal," ").replace(CZ.spaceLine,""));Y;){let Q;if(this.options.extensions?.block?.some((K)=>(Q=K.call({lexer:this},Y,X))?(Y=Y.substring(Q.raw.length),X.push(Q),!0):!1))continue;if(Q=this.tokenizer.space(Y)){Y=Y.substring(Q.raw.length);let K=X.at(-1);Q.raw.length===1&&K!==void 0?K.raw+=`
90
+ `,1)[0],M=!G.trim(),N=0;if(this.options.pedantic?(N=2,H=G.trimStart()):M?N=Y[1].length+1:(N=Y[2].search(this.rules.other.nonSpaceChar),N=N>4?1:N,H=G.slice(N),N+=Y[1].length),M&&this.rules.other.blankLine.test(F)&&(z+=F+`
91
+ `,Z=Z.substring(F.length+1),W=!0),!W){let B=this.rules.other.nextBulletRegex(N),C=this.rules.other.hrRegex(N),R=this.rules.other.fencesBeginRegex(N),D=this.rules.other.headingBeginRegex(N),f=this.rules.other.htmlBeginRegex(N);for(;Z;){let V=Z.split(`
92
+ `,1)[0],d;if(F=V,this.options.pedantic?(F=F.replace(this.rules.other.listReplaceNesting," "),d=F):d=F.replace(this.rules.other.tabCharGlobal," "),R.test(F)||D.test(F)||f.test(F)||B.test(F)||C.test(F))break;if(d.search(this.rules.other.nonSpaceChar)>=N||!F.trim())H+=`
93
+ `+d.slice(N);else{if(M||G.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||R.test(G)||D.test(G)||C.test(G))break;H+=`
94
+ `+F}!M&&!F.trim()&&(M=!0),z+=V+`
95
+ `,Z=Z.substring(V.length+1),G=d.slice(N)}}Q.loose||(K?Q.loose=!0:this.rules.other.doubleBlankLine.test(z)&&(K=!0));let w=null,L;this.options.gfm&&(w=this.rules.other.listIsTask.exec(H),w&&(L=w[0]!=="[ ] ",H=H.replace(this.rules.other.listReplaceTask,""))),Q.items.push({type:"list_item",raw:z,task:!!w,checked:L,loose:!1,text:H,tokens:[]}),Q.raw+=z}let U=Q.items.at(-1);if(U)U.raw=U.raw.trimEnd(),U.text=U.text.trimEnd();else return;Q.raw=Q.raw.trimEnd();for(let W=0;W<Q.items.length;W++)if(this.lexer.state.top=!1,Q.items[W].tokens=this.lexer.blockTokens(Q.items[W].text,[]),!Q.loose){let z=Q.items[W].tokens.filter((G)=>G.type==="space"),H=z.length>0&&z.some((G)=>this.rules.other.anyLine.test(G.raw));Q.loose=H}if(Q.loose)for(let W=0;W<Q.items.length;W++)Q.items[W].loose=!0;return Q}}html(Z){let Y=this.rules.block.html.exec(Z);if(Y)return{type:"html",block:!0,raw:Y[0],pre:Y[1]==="pre"||Y[1]==="script"||Y[1]==="style",text:Y[0]}}def(Z){let Y=this.rules.block.def.exec(Z);if(Y){let X=Y[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),J=Y[2]?Y[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",Q=Y[3]?Y[3].substring(1,Y[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):Y[3];return{type:"def",tag:X,raw:Y[0],href:J,title:Q}}}table(Z){let Y=this.rules.block.table.exec(Z);if(!Y||!this.rules.other.tableDelimiter.test(Y[2]))return;let X=I5(Y[1]),J=Y[2].replace(this.rules.other.tableAlignChars,"").split("|"),Q=Y[3]?.trim()?Y[3].replace(this.rules.other.tableRowBlankLine,"").split(`
96
+ `):[],$={type:"table",raw:Y[0],header:[],align:[],rows:[]};if(X.length===J.length){for(let K of J)this.rules.other.tableAlignRight.test(K)?$.align.push("right"):this.rules.other.tableAlignCenter.test(K)?$.align.push("center"):this.rules.other.tableAlignLeft.test(K)?$.align.push("left"):$.align.push(null);for(let K=0;K<X.length;K++)$.header.push({text:X[K],tokens:this.lexer.inline(X[K]),header:!0,align:$.align[K]});for(let K of Q)$.rows.push(I5(K,$.header.length).map((U,W)=>({text:U,tokens:this.lexer.inline(U),header:!1,align:$.align[W]})));return $}}lheading(Z){let Y=this.rules.block.lheading.exec(Z);if(Y)return{type:"heading",raw:Y[0],depth:Y[2].charAt(0)==="="?1:2,text:Y[1],tokens:this.lexer.inline(Y[1])}}paragraph(Z){let Y=this.rules.block.paragraph.exec(Z);if(Y){let X=Y[1].charAt(Y[1].length-1)===`
97
+ `?Y[1].slice(0,-1):Y[1];return{type:"paragraph",raw:Y[0],text:X,tokens:this.lexer.inline(X)}}}text(Z){let Y=this.rules.block.text.exec(Z);if(Y)return{type:"text",raw:Y[0],text:Y[0],tokens:this.lexer.inline(Y[0])}}escape(Z){let Y=this.rules.inline.escape.exec(Z);if(Y)return{type:"escape",raw:Y[0],text:Y[1]}}tag(Z){let Y=this.rules.inline.tag.exec(Z);if(Y)return!this.lexer.state.inLink&&this.rules.other.startATag.test(Y[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(Y[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(Y[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(Y[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:Y[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:Y[0]}}link(Z){let Y=this.rules.inline.link.exec(Z);if(Y){let X=Y[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(X)){if(!this.rules.other.endAngleBracket.test(X))return;let $=L0(X.slice(0,-1),"\\");if((X.length-$.length)%2===0)return}else{let $=bK(Y[2],"()");if($===-2)return;if($>-1){let K=(Y[0].indexOf("!")===0?5:4)+Y[1].length+$;Y[2]=Y[2].substring(0,$),Y[0]=Y[0].substring(0,K).trim(),Y[3]=""}}let J=Y[2],Q="";if(this.options.pedantic){let $=this.rules.other.pedanticHrefTitle.exec(J);$&&(J=$[1],Q=$[3])}else Q=Y[3]?Y[3].slice(1,-1):"";return J=J.trim(),this.rules.other.startAngleBracket.test(J)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(X)?J=J.slice(1):J=J.slice(1,-1)),v5(Y,{href:J&&J.replace(this.rules.inline.anyPunctuation,"$1"),title:Q&&Q.replace(this.rules.inline.anyPunctuation,"$1")},Y[0],this.lexer,this.rules)}}reflink(Z,Y){let X;if((X=this.rules.inline.reflink.exec(Z))||(X=this.rules.inline.nolink.exec(Z))){let J=(X[2]||X[1]).replace(this.rules.other.multipleSpaceGlobal," "),Q=Y[J.toLowerCase()];if(!Q){let $=X[0].charAt(0);return{type:"text",raw:$,text:$}}return v5(X,Q,X[0],this.lexer,this.rules)}}emStrong(Z,Y,X=""){let J=this.rules.inline.emStrongLDelim.exec(Z);if(!J||J[3]&&X.match(this.rules.other.unicodeAlphaNumeric))return;if(!(J[1]||J[2])||!X||this.rules.inline.punctuation.exec(X)){let Q=[...J[0]].length-1,$,K,U=Q,W=0,z=J[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(z.lastIndex=0,Y=Y.slice(-1*Z.length+Q);(J=z.exec(Y))!=null;){if($=J[1]||J[2]||J[3]||J[4]||J[5]||J[6],!$)continue;if(K=[...$].length,J[3]||J[4]){U+=K;continue}else if((J[5]||J[6])&&Q%3&&!((Q+K)%3)){W+=K;continue}if(U-=K,U>0)continue;K=Math.min(K,K+U+W);let H=[...J[0]][0].length,G=Z.slice(0,Q+J.index+H+K);if(Math.min(Q,K)%2){let M=G.slice(1,-1);return{type:"em",raw:G,text:M,tokens:this.lexer.inlineTokens(M)}}let F=G.slice(2,-2);return{type:"strong",raw:G,text:F,tokens:this.lexer.inlineTokens(F)}}}}codespan(Z){let Y=this.rules.inline.code.exec(Z);if(Y){let X=Y[2].replace(this.rules.other.newLineCharGlobal," "),J=this.rules.other.nonSpaceChar.test(X),Q=this.rules.other.startingSpaceChar.test(X)&&this.rules.other.endingSpaceChar.test(X);return J&&Q&&(X=X.substring(1,X.length-1)),{type:"codespan",raw:Y[0],text:X}}}br(Z){let Y=this.rules.inline.br.exec(Z);if(Y)return{type:"br",raw:Y[0]}}del(Z){let Y=this.rules.inline.del.exec(Z);if(Y)return{type:"del",raw:Y[0],text:Y[2],tokens:this.lexer.inlineTokens(Y[2])}}autolink(Z){let Y=this.rules.inline.autolink.exec(Z);if(Y){let X,J;return Y[2]==="@"?(X=Y[1],J="mailto:"+X):(X=Y[1],J=X),{type:"link",raw:Y[0],text:X,href:J,tokens:[{type:"text",raw:X,text:X}]}}}url(Z){let Y;if(Y=this.rules.inline.url.exec(Z)){let X,J;if(Y[2]==="@")X=Y[0],J="mailto:"+X;else{let Q;do Q=Y[0],Y[0]=this.rules.inline._backpedal.exec(Y[0])?.[0]??"";while(Q!==Y[0]);X=Y[0],Y[1]==="www."?J="http://"+Y[0]:J=Y[0]}return{type:"link",raw:Y[0],text:X,href:J,tokens:[{type:"text",raw:X,text:X}]}}}inlineText(Z){let Y=this.rules.inline.text.exec(Z);if(Y){let X=this.lexer.state.inRawBlock;return{type:"text",raw:Y[0],text:Y[0],escaped:X}}}},aZ=class Z{tokens;options;state;tokenizer;inlineQueue;constructor(Y){this.tokens=[],this.tokens.links=Object.create(null),this.options=Y||r4,this.options.tokenizer=this.options.tokenizer||new XY,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let X={other:RZ,block:ZY.normal,inline:B0.normal};this.options.pedantic?(X.block=ZY.pedantic,X.inline=B0.pedantic):this.options.gfm&&(X.block=ZY.gfm,this.options.breaks?X.inline=B0.breaks:X.inline=B0.gfm),this.tokenizer.rules=X}static get rules(){return{block:ZY,inline:B0}}static lex(Y,X){return new Z(X).lex(Y)}static lexInline(Y,X){return new Z(X).inlineTokens(Y)}lex(Y){Y=Y.replace(RZ.carriageReturn,`
98
+ `),this.blockTokens(Y,this.tokens);for(let X=0;X<this.inlineQueue.length;X++){let J=this.inlineQueue[X];this.inlineTokens(J.src,J.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(Y,X=[],J=!1){for(this.options.pedantic&&(Y=Y.replace(RZ.tabCharGlobal," ").replace(RZ.spaceLine,""));Y;){let Q;if(this.options.extensions?.block?.some((K)=>(Q=K.call({lexer:this},Y,X))?(Y=Y.substring(Q.raw.length),X.push(Q),!0):!1))continue;if(Q=this.tokenizer.space(Y)){Y=Y.substring(Q.raw.length);let K=X.at(-1);Q.raw.length===1&&K!==void 0?K.raw+=`
105
99
  `:X.push(Q);continue}if(Q=this.tokenizer.code(Y)){Y=Y.substring(Q.raw.length);let K=X.at(-1);K?.type==="paragraph"||K?.type==="text"?(K.raw+=(K.raw.endsWith(`
106
100
  `)?"":`
107
101
  `)+Q.raw,K.text+=`
108
102
  `+Q.text,this.inlineQueue.at(-1).src=K.text):X.push(Q);continue}if(Q=this.tokenizer.fences(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.heading(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.hr(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.blockquote(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.list(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.html(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.def(Y)){Y=Y.substring(Q.raw.length);let K=X.at(-1);K?.type==="paragraph"||K?.type==="text"?(K.raw+=(K.raw.endsWith(`
109
103
  `)?"":`
110
104
  `)+Q.raw,K.text+=`
111
- `+Q.raw,this.inlineQueue.at(-1).src=K.text):this.tokens.links[Q.tag]||(this.tokens.links[Q.tag]={href:Q.href,title:Q.title},X.push(Q));continue}if(Q=this.tokenizer.table(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.lheading(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}let $=Y;if(this.options.extensions?.startBlock){let K=1/0,W=Y.slice(1),U;this.options.extensions.startBlock.forEach((z)=>{U=z.call({lexer:this},W),typeof U=="number"&&U>=0&&(K=Math.min(K,U))}),K<1/0&&K>=0&&($=Y.substring(0,K+1))}if(this.state.top&&(Q=this.tokenizer.paragraph($))){let K=X.at(-1);J&&K?.type==="paragraph"?(K.raw+=(K.raw.endsWith(`
105
+ `+Q.raw,this.inlineQueue.at(-1).src=K.text):this.tokens.links[Q.tag]||(this.tokens.links[Q.tag]={href:Q.href,title:Q.title},X.push(Q));continue}if(Q=this.tokenizer.table(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.lheading(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}let $=Y;if(this.options.extensions?.startBlock){let K=1/0,U=Y.slice(1),W;this.options.extensions.startBlock.forEach((z)=>{W=z.call({lexer:this},U),typeof W=="number"&&W>=0&&(K=Math.min(K,W))}),K<1/0&&K>=0&&($=Y.substring(0,K+1))}if(this.state.top&&(Q=this.tokenizer.paragraph($))){let K=X.at(-1);J&&K?.type==="paragraph"?(K.raw+=(K.raw.endsWith(`
112
106
  `)?"":`
113
107
  `)+Q.raw,K.text+=`
114
108
  `+Q.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=K.text):X.push(Q),J=$.length!==Y.length,Y=Y.substring(Q.raw.length);continue}if(Q=this.tokenizer.text(Y)){Y=Y.substring(Q.raw.length);let K=X.at(-1);K?.type==="text"?(K.raw+=(K.raw.endsWith(`
115
109
  `)?"":`
116
110
  `)+Q.raw,K.text+=`
117
- `+Q.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=K.text):X.push(Q);continue}if(Y){let K="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(K);break}else throw Error(K)}}return this.state.top=!0,X}inline(Y,X=[]){return this.inlineQueue.push({src:Y,tokens:X}),X}inlineTokens(Y,X=[]){let J=Y,Q=null;if(this.tokens.links){let U=Object.keys(this.tokens.links);if(U.length>0)for(;(Q=this.tokenizer.rules.inline.reflinkSearch.exec(J))!=null;)U.includes(Q[0].slice(Q[0].lastIndexOf("[")+1,-1))&&(J=J.slice(0,Q.index)+"["+"a".repeat(Q[0].length-2)+"]"+J.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Q=this.tokenizer.rules.inline.anyPunctuation.exec(J))!=null;)J=J.slice(0,Q.index)+"++"+J.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let $;for(;(Q=this.tokenizer.rules.inline.blockSkip.exec(J))!=null;)$=Q[2]?Q[2].length:0,J=J.slice(0,Q.index+$)+"["+"a".repeat(Q[0].length-$-2)+"]"+J.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);J=this.options.hooks?.emStrongMask?.call({lexer:this},J)??J;let K=!1,W="";for(;Y;){K||(W=""),K=!1;let U;if(this.options.extensions?.inline?.some((H)=>(U=H.call({lexer:this},Y,X))?(Y=Y.substring(U.raw.length),X.push(U),!0):!1))continue;if(U=this.tokenizer.escape(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.tag(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.link(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(U.raw.length);let H=X.at(-1);U.type==="text"&&H?.type==="text"?(H.raw+=U.raw,H.text+=U.text):X.push(U);continue}if(U=this.tokenizer.emStrong(Y,J,W)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.codespan(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.br(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.del(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.autolink(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(!this.state.inLink&&(U=this.tokenizer.url(Y))){Y=Y.substring(U.raw.length),X.push(U);continue}let z=Y;if(this.options.extensions?.startInline){let H=1/0,G=Y.slice(1),F;this.options.extensions.startInline.forEach((M)=>{F=M.call({lexer:this},G),typeof F=="number"&&F>=0&&(H=Math.min(H,F))}),H<1/0&&H>=0&&(z=Y.substring(0,H+1))}if(U=this.tokenizer.inlineText(z)){Y=Y.substring(U.raw.length),U.raw.slice(-1)!=="_"&&(W=U.raw.slice(-1)),K=!0;let H=X.at(-1);H?.type==="text"?(H.raw+=U.raw,H.text+=U.text):X.push(U);continue}if(Y){let H="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(H);break}else throw Error(H)}}return X}},XY=class{options;parser;constructor(Z){this.options=Z||i4}space(Z){return""}code({text:Z,lang:Y,escaped:X}){let J=(Y||"").match(CZ.notSpaceStart)?.[0],Q=Z.replace(CZ.endingNewline,"")+`
118
- `;return J?'<pre><code class="language-'+O4(J)+'">'+(X?Q:O4(Q,!0))+`</code></pre>
119
- `:"<pre><code>"+(X?Q:O4(Q,!0))+`</code></pre>
111
+ `+Q.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=K.text):X.push(Q);continue}if(Y){let K="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(K);break}else throw Error(K)}}return this.state.top=!0,X}inline(Y,X=[]){return this.inlineQueue.push({src:Y,tokens:X}),X}inlineTokens(Y,X=[]){let J=Y,Q=null;if(this.tokens.links){let W=Object.keys(this.tokens.links);if(W.length>0)for(;(Q=this.tokenizer.rules.inline.reflinkSearch.exec(J))!=null;)W.includes(Q[0].slice(Q[0].lastIndexOf("[")+1,-1))&&(J=J.slice(0,Q.index)+"["+"a".repeat(Q[0].length-2)+"]"+J.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Q=this.tokenizer.rules.inline.anyPunctuation.exec(J))!=null;)J=J.slice(0,Q.index)+"++"+J.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let $;for(;(Q=this.tokenizer.rules.inline.blockSkip.exec(J))!=null;)$=Q[2]?Q[2].length:0,J=J.slice(0,Q.index+$)+"["+"a".repeat(Q[0].length-$-2)+"]"+J.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);J=this.options.hooks?.emStrongMask?.call({lexer:this},J)??J;let K=!1,U="";for(;Y;){K||(U=""),K=!1;let W;if(this.options.extensions?.inline?.some((H)=>(W=H.call({lexer:this},Y,X))?(Y=Y.substring(W.raw.length),X.push(W),!0):!1))continue;if(W=this.tokenizer.escape(Y)){Y=Y.substring(W.raw.length),X.push(W);continue}if(W=this.tokenizer.tag(Y)){Y=Y.substring(W.raw.length),X.push(W);continue}if(W=this.tokenizer.link(Y)){Y=Y.substring(W.raw.length),X.push(W);continue}if(W=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(W.raw.length);let H=X.at(-1);W.type==="text"&&H?.type==="text"?(H.raw+=W.raw,H.text+=W.text):X.push(W);continue}if(W=this.tokenizer.emStrong(Y,J,U)){Y=Y.substring(W.raw.length),X.push(W);continue}if(W=this.tokenizer.codespan(Y)){Y=Y.substring(W.raw.length),X.push(W);continue}if(W=this.tokenizer.br(Y)){Y=Y.substring(W.raw.length),X.push(W);continue}if(W=this.tokenizer.del(Y)){Y=Y.substring(W.raw.length),X.push(W);continue}if(W=this.tokenizer.autolink(Y)){Y=Y.substring(W.raw.length),X.push(W);continue}if(!this.state.inLink&&(W=this.tokenizer.url(Y))){Y=Y.substring(W.raw.length),X.push(W);continue}let z=Y;if(this.options.extensions?.startInline){let H=1/0,G=Y.slice(1),F;this.options.extensions.startInline.forEach((M)=>{F=M.call({lexer:this},G),typeof F=="number"&&F>=0&&(H=Math.min(H,F))}),H<1/0&&H>=0&&(z=Y.substring(0,H+1))}if(W=this.tokenizer.inlineText(z)){Y=Y.substring(W.raw.length),W.raw.slice(-1)!=="_"&&(U=W.raw.slice(-1)),K=!0;let H=X.at(-1);H?.type==="text"?(H.raw+=W.raw,H.text+=W.text):X.push(W);continue}if(Y){let H="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(H);break}else throw Error(H)}}return X}},JY=class{options;parser;constructor(Z){this.options=Z||r4}space(Z){return""}code({text:Z,lang:Y,escaped:X}){let J=(Y||"").match(RZ.notSpaceStart)?.[0],Q=Z.replace(RZ.endingNewline,"")+`
112
+ `;return J?'<pre><code class="language-'+q4(J)+'">'+(X?Q:q4(Q,!0))+`</code></pre>
113
+ `:"<pre><code>"+(X?Q:q4(Q,!0))+`</code></pre>
120
114
  `}blockquote({tokens:Z}){return`<blockquote>
121
115
  ${this.parser.parse(Z)}</blockquote>
122
116
  `}html({text:Z}){return Z}def(Z){return""}heading({tokens:Z,depth:Y}){return`<h${Y}>${this.parser.parseInline(Z)}</h${Y}>
123
117
  `}hr(Z){return`<hr>
124
- `}list(Z){let{ordered:Y,start:X}=Z,J="";for(let K=0;K<Z.items.length;K++){let W=Z.items[K];J+=this.listitem(W)}let Q=Y?"ol":"ul",$=Y&&X!==1?' start="'+X+'"':"";return"<"+Q+$+`>
118
+ `}list(Z){let{ordered:Y,start:X}=Z,J="";for(let K=0;K<Z.items.length;K++){let U=Z.items[K];J+=this.listitem(U)}let Q=Y?"ol":"ul",$=Y&&X!==1?' start="'+X+'"':"";return"<"+Q+$+`>
125
119
  `+J+"</"+Q+`>
126
- `}listitem(Z){let Y="";if(Z.task){let X=this.checkbox({checked:!!Z.checked});Z.loose?Z.tokens[0]?.type==="paragraph"?(Z.tokens[0].text=X+" "+Z.tokens[0].text,Z.tokens[0].tokens&&Z.tokens[0].tokens.length>0&&Z.tokens[0].tokens[0].type==="text"&&(Z.tokens[0].tokens[0].text=X+" "+O4(Z.tokens[0].tokens[0].text),Z.tokens[0].tokens[0].escaped=!0)):Z.tokens.unshift({type:"text",raw:X+" ",text:X+" ",escaped:!0}):Y+=X+" "}return Y+=this.parser.parse(Z.tokens,!!Z.loose),`<li>${Y}</li>
120
+ `}listitem(Z){let Y="";if(Z.task){let X=this.checkbox({checked:!!Z.checked});Z.loose?Z.tokens[0]?.type==="paragraph"?(Z.tokens[0].text=X+" "+Z.tokens[0].text,Z.tokens[0].tokens&&Z.tokens[0].tokens.length>0&&Z.tokens[0].tokens[0].type==="text"&&(Z.tokens[0].tokens[0].text=X+" "+q4(Z.tokens[0].tokens[0].text),Z.tokens[0].tokens[0].escaped=!0)):Z.tokens.unshift({type:"text",raw:X+" ",text:X+" ",escaped:!0}):Y+=X+" "}return Y+=this.parser.parse(Z.tokens,!!Z.loose),`<li>${Y}</li>
127
121
  `}checkbox({checked:Z}){return"<input "+(Z?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:Z}){return`<p>${this.parser.parseInline(Z)}</p>
128
122
  `}table(Z){let Y="",X="";for(let Q=0;Q<Z.header.length;Q++)X+=this.tablecell(Z.header[Q]);Y+=this.tablerow({text:X});let J="";for(let Q=0;Q<Z.rows.length;Q++){let $=Z.rows[Q];X="";for(let K=0;K<$.length;K++)X+=this.tablecell($[K]);J+=this.tablerow({text:X})}return J&&(J=`<tbody>${J}</tbody>`),`<table>
129
123
  <thead>
@@ -132,11 +126,11 @@ ${this.parser.parse(Z)}</blockquote>
132
126
  `}tablerow({text:Z}){return`<tr>
133
127
  ${Z}</tr>
134
128
  `}tablecell(Z){let Y=this.parser.parseInline(Z.tokens),X=Z.header?"th":"td";return(Z.align?`<${X} align="${Z.align}">`:`<${X}>`)+Y+`</${X}>
135
- `}strong({tokens:Z}){return`<strong>${this.parser.parseInline(Z)}</strong>`}em({tokens:Z}){return`<em>${this.parser.parseInline(Z)}</em>`}codespan({text:Z}){return`<code>${O4(Z,!0)}</code>`}br(Z){return"<br>"}del({tokens:Z}){return`<del>${this.parser.parseInline(Z)}</del>`}link({href:Z,title:Y,tokens:X}){let J=this.parser.parseInline(X),Q=I5(Z);if(Q===null)return J;Z=Q;let $='<a href="'+Z+'"';return Y&&($+=' title="'+O4(Y)+'"'),$+=">"+J+"</a>",$}image({href:Z,title:Y,text:X,tokens:J}){J&&(X=this.parser.parseInline(J,this.parser.textRenderer));let Q=I5(Z);if(Q===null)return O4(X);Z=Q;let $=`<img src="${Z}" alt="${X}"`;return Y&&($+=` title="${O4(Y)}"`),$+=">",$}text(Z){return"tokens"in Z&&Z.tokens?this.parser.parseInline(Z.tokens):("escaped"in Z)&&Z.escaped?Z.text:O4(Z.text)}},NX=class{strong({text:Z}){return Z}em({text:Z}){return Z}codespan({text:Z}){return Z}del({text:Z}){return Z}html({text:Z}){return Z}text({text:Z}){return Z}link({text:Z}){return""+Z}image({text:Z}){return""+Z}br(){return""}},eZ=class Z{options;renderer;textRenderer;constructor(Y){this.options=Y||i4,this.options.renderer=this.options.renderer||new XY,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new NX}static parse(Y,X){return new Z(X).parse(Y)}static parseInline(Y,X){return new Z(X).parseInline(Y)}parse(Y,X=!0){let J="";for(let Q=0;Q<Y.length;Q++){let $=Y[Q];if(this.options.extensions?.renderers?.[$.type]){let W=$,U=this.options.extensions.renderers[W.type].call({parser:this},W);if(U!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(W.type)){J+=U||"";continue}}let K=$;switch(K.type){case"space":{J+=this.renderer.space(K);continue}case"hr":{J+=this.renderer.hr(K);continue}case"heading":{J+=this.renderer.heading(K);continue}case"code":{J+=this.renderer.code(K);continue}case"table":{J+=this.renderer.table(K);continue}case"blockquote":{J+=this.renderer.blockquote(K);continue}case"list":{J+=this.renderer.list(K);continue}case"html":{J+=this.renderer.html(K);continue}case"def":{J+=this.renderer.def(K);continue}case"paragraph":{J+=this.renderer.paragraph(K);continue}case"text":{let W=K,U=this.renderer.text(W);for(;Q+1<Y.length&&Y[Q+1].type==="text";)W=Y[++Q],U+=`
136
- `+this.renderer.text(W);X?J+=this.renderer.paragraph({type:"paragraph",raw:U,text:U,tokens:[{type:"text",raw:U,text:U,escaped:!0}]}):J+=U;continue}default:{let W='Token with "'+K.type+'" type was not found.';if(this.options.silent)return console.error(W),"";throw Error(W)}}}return J}parseInline(Y,X=this.renderer){let J="";for(let Q=0;Q<Y.length;Q++){let $=Y[Q];if(this.options.extensions?.renderers?.[$.type]){let W=this.options.extensions.renderers[$.type].call({parser:this},$);if(W!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes($.type)){J+=W||"";continue}}let K=$;switch(K.type){case"escape":{J+=X.text(K);break}case"html":{J+=X.html(K);break}case"link":{J+=X.link(K);break}case"image":{J+=X.image(K);break}case"strong":{J+=X.strong(K);break}case"em":{J+=X.em(K);break}case"codespan":{J+=X.codespan(K);break}case"br":{J+=X.br(K);break}case"del":{J+=X.del(K);break}case"text":{J+=X.text(K);break}default:{let W='Token with "'+K.type+'" type was not found.';if(this.options.silent)return console.error(W),"";throw Error(W)}}}return J}},R0=class{options;block;constructor(Z){this.options=Z||i4}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(Z){return Z}postprocess(Z){return Z}processAllTokens(Z){return Z}emStrongMask(Z){return Z}provideLexer(){return this.block?tZ.lex:tZ.lexInline}provideParser(){return this.block?eZ.parse:eZ.parseInline}},fK=class{defaults=UX();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=eZ;Renderer=XY;TextRenderer=NX;Lexer=tZ;Tokenizer=YY;Hooks=R0;constructor(...Z){this.use(...Z)}walkTokens(Z,Y){let X=[];for(let J of Z)switch(X=X.concat(Y.call(this,J)),J.type){case"table":{let Q=J;for(let $ of Q.header)X=X.concat(this.walkTokens($.tokens,Y));for(let $ of Q.rows)for(let K of $)X=X.concat(this.walkTokens(K.tokens,Y));break}case"list":{let Q=J;X=X.concat(this.walkTokens(Q.items,Y));break}default:{let Q=J;this.defaults.extensions?.childTokens?.[Q.type]?this.defaults.extensions.childTokens[Q.type].forEach(($)=>{let K=Q[$].flat(1/0);X=X.concat(this.walkTokens(K,Y))}):Q.tokens&&(X=X.concat(this.walkTokens(Q.tokens,Y)))}}return X}use(...Z){let Y=this.defaults.extensions||{renderers:{},childTokens:{}};return Z.forEach((X)=>{let J={...X};if(J.async=this.defaults.async||J.async||!1,X.extensions&&(X.extensions.forEach((Q)=>{if(!Q.name)throw Error("extension name required");if("renderer"in Q){let $=Y.renderers[Q.name];$?Y.renderers[Q.name]=function(...K){let W=Q.renderer.apply(this,K);return W===!1&&(W=$.apply(this,K)),W}:Y.renderers[Q.name]=Q.renderer}if("tokenizer"in Q){if(!Q.level||Q.level!=="block"&&Q.level!=="inline")throw Error("extension level must be 'block' or 'inline'");let $=Y[Q.level];$?$.unshift(Q.tokenizer):Y[Q.level]=[Q.tokenizer],Q.start&&(Q.level==="block"?Y.startBlock?Y.startBlock.push(Q.start):Y.startBlock=[Q.start]:Q.level==="inline"&&(Y.startInline?Y.startInline.push(Q.start):Y.startInline=[Q.start]))}"childTokens"in Q&&Q.childTokens&&(Y.childTokens[Q.name]=Q.childTokens)}),J.extensions=Y),X.renderer){let Q=this.defaults.renderer||new XY(this.defaults);for(let $ in X.renderer){if(!($ in Q))throw Error(`renderer '${$}' does not exist`);if(["options","parser"].includes($))continue;let K=$,W=X.renderer[K],U=Q[K];Q[K]=(...z)=>{let H=W.apply(Q,z);return H===!1&&(H=U.apply(Q,z)),H||""}}J.renderer=Q}if(X.tokenizer){let Q=this.defaults.tokenizer||new YY(this.defaults);for(let $ in X.tokenizer){if(!($ in Q))throw Error(`tokenizer '${$}' does not exist`);if(["options","rules","lexer"].includes($))continue;let K=$,W=X.tokenizer[K],U=Q[K];Q[K]=(...z)=>{let H=W.apply(Q,z);return H===!1&&(H=U.apply(Q,z)),H}}J.tokenizer=Q}if(X.hooks){let Q=this.defaults.hooks||new R0;for(let $ in X.hooks){if(!($ in Q))throw Error(`hook '${$}' does not exist`);if(["options","block"].includes($))continue;let K=$,W=X.hooks[K],U=Q[K];R0.passThroughHooks.has($)?Q[K]=(z)=>{if(this.defaults.async&&R0.passThroughHooksRespectAsync.has($))return(async()=>{let G=await W.call(Q,z);return U.call(Q,G)})();let H=W.call(Q,z);return U.call(Q,H)}:Q[K]=(...z)=>{if(this.defaults.async)return(async()=>{let G=await W.apply(Q,z);return G===!1&&(G=await U.apply(Q,z)),G})();let H=W.apply(Q,z);return H===!1&&(H=U.apply(Q,z)),H}}J.hooks=Q}if(X.walkTokens){let Q=this.defaults.walkTokens,$=X.walkTokens;J.walkTokens=function(K){let W=[];return W.push($.call(this,K)),Q&&(W=W.concat(Q.call(this,K))),W}}this.defaults={...this.defaults,...J}}),this}setOptions(Z){return this.defaults={...this.defaults,...Z},this}lexer(Z,Y){return tZ.lex(Z,Y??this.defaults)}parser(Z,Y){return eZ.parse(Z,Y??this.defaults)}parseMarkdown(Z){return(Y,X)=>{let J={...X},Q={...this.defaults,...J},$=this.onError(!!Q.silent,!!Q.async);if(this.defaults.async===!0&&J.async===!1)return $(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 Y>"u"||Y===null)return $(Error("marked(): input parameter is undefined or null"));if(typeof Y!="string")return $(Error("marked(): input parameter is of type "+Object.prototype.toString.call(Y)+", string expected"));if(Q.hooks&&(Q.hooks.options=Q,Q.hooks.block=Z),Q.async)return(async()=>{let K=Q.hooks?await Q.hooks.preprocess(Y):Y,W=await(Q.hooks?await Q.hooks.provideLexer():Z?tZ.lex:tZ.lexInline)(K,Q),U=Q.hooks?await Q.hooks.processAllTokens(W):W;Q.walkTokens&&await Promise.all(this.walkTokens(U,Q.walkTokens));let z=await(Q.hooks?await Q.hooks.provideParser():Z?eZ.parse:eZ.parseInline)(U,Q);return Q.hooks?await Q.hooks.postprocess(z):z})().catch($);try{Q.hooks&&(Y=Q.hooks.preprocess(Y));let K=(Q.hooks?Q.hooks.provideLexer():Z?tZ.lex:tZ.lexInline)(Y,Q);Q.hooks&&(K=Q.hooks.processAllTokens(K)),Q.walkTokens&&this.walkTokens(K,Q.walkTokens);let W=(Q.hooks?Q.hooks.provideParser():Z?eZ.parse:eZ.parseInline)(K,Q);return Q.hooks&&(W=Q.hooks.postprocess(W)),W}catch(K){return $(K)}}}onError(Z,Y){return(X)=>{if(X.message+=`
137
- Please report this to https://github.com/markedjs/marked.`,Z){let J="<p>An error occurred:</p><pre>"+O4(X.message+"",!0)+"</pre>";return Y?Promise.resolve(J):J}if(Y)return Promise.reject(X);throw X}}},l4=new fK;function d(Z,Y){return l4.parse(Z,Y)}d.options=d.setOptions=function(Z){return l4.setOptions(Z),d.defaults=l4.defaults,E5(d.defaults),d};d.getDefaults=UX;d.defaults=i4;d.use=function(...Z){return l4.use(...Z),d.defaults=l4.defaults,E5(d.defaults),d};d.walkTokens=function(Z,Y){return l4.walkTokens(Z,Y)};d.parseInline=l4.parseInline;d.Parser=eZ;d.parser=eZ.parse;d.Renderer=XY;d.TextRenderer=NX;d.Lexer=tZ;d.lexer=tZ.lex;d.Tokenizer=YY;d.Hooks=R0;d.parse=d;var{options:oG,setOptions:nG,use:aG,walkTokens:sG,parseInline:tG}=d;var eG=eZ.parse,ZO=tZ.lex;var cZ=L(x(),1);class YZ extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function jK(Z){return CX(Z)}function CX(Z){if(Array.isArray(Z))return SK(Z);if(Z instanceof RegExp)return Z;if(typeof Z==="object")return yK(Z);return Z}function SK(Z){let Y=[];for(let X=0,J=Z.length;X<J;X++)Y[X]=CX(Z[X]);return Y}function yK(Z){let Y={};for(let X in Z)Y[X]=CX(Z[X]);return Y}function o5(Z,...Y){return Y.forEach((X)=>{for(let J in X)Z[J]=X[J]}),Z}function n5(Z){let Y=~Z.lastIndexOf("/")||~Z.lastIndexOf("\\");if(Y===0)return Z;else if(~Y===Z.length-1)return n5(Z.substring(0,Z.length-1));else return Z.substr(~Y+1)}var _X=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,$Y=class{static hasCaptures(Z){if(Z===null)return!1;return _X.lastIndex=0,_X.test(Z)}static replaceCaptures(Z,Y,X){return Z.replace(_X,(J,Q,$,K)=>{let W=X[parseInt(Q||$,10)];if(W){let U=Y.substring(W.start,W.end);while(U[0]===".")U=U.substring(1);switch(K){case"downcase":return U.toLowerCase();case"upcase":return U.toUpperCase();default:return U}}else return J})}};function a5(Z,Y){if(Z<Y)return-1;if(Z>Y)return 1;return 0}function s5(Z,Y){if(Z===null&&Y===null)return 0;if(!Z)return-1;if(!Y)return 1;let X=Z.length,J=Y.length;if(X===J){for(let Q=0;Q<X;Q++){let $=a5(Z[Q],Y[Q]);if($!==0)return $}return 0}return X-J}function u5(Z){if(/^#[0-9a-f]{6}$/i.test(Z))return!0;if(/^#[0-9a-f]{8}$/i.test(Z))return!0;if(/^#[0-9a-f]{3}$/i.test(Z))return!0;if(/^#[0-9a-f]{4}$/i.test(Z))return!0;return!1}function t5(Z){return Z.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var e5=class{constructor(Z){this.fn=Z}cache=new Map;get(Z){if(this.cache.has(Z))return this.cache.get(Z);let Y=this.fn(Z);return this.cache.set(Z,Y),Y}},V0=class{constructor(Z,Y,X){this._colorMap=Z,this._defaults=Y,this._root=X}static createFromRawTheme(Z,Y){return this.createFromParsedTheme(xK(Z),Y)}static createFromParsedTheme(Z,Y){return uK(Z,Y)}_cachedMatchRoot=new e5((Z)=>this._root.match(Z));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(Z){if(Z===null)return this._defaults;let Y=Z.scopeName,J=this._cachedMatchRoot.get(Y).find((Q)=>kK(Z.parent,Q.parentScopes));if(!J)return null;return new Z6(J.fontStyle,J.foreground,J.background)}},wX=class Z{constructor(Y,X){this.parent=Y,this.scopeName=X}static push(Y,X){for(let J of X)Y=new Z(Y,J);return Y}static from(...Y){let X=null;for(let J=0;J<Y.length;J++)X=new Z(X,Y[J]);return X}push(Y){return new Z(this,Y)}getSegments(){let Y=this,X=[];while(Y)X.push(Y.scopeName),Y=Y.parent;return X.reverse(),X}toString(){return this.getSegments().join(" ")}extends(Y){if(this===Y)return!0;if(this.parent===null)return!1;return this.parent.extends(Y)}getExtensionIfDefined(Y){let X=[],J=this;while(J&&J!==Y)X.push(J.scopeName),J=J.parent;return J===Y?X.reverse():void 0}};function kK(Z,Y){if(Y.length===0)return!0;for(let X=0;X<Y.length;X++){let J=Y[X],Q=!1;if(J===">"){if(X===Y.length-1)return!1;J=Y[++X],Q=!0}while(Z){if(hK(Z.scopeName,J))break;if(Q)return!1;Z=Z.parent}if(!Z)return!1;Z=Z.parent}return!0}function hK(Z,Y){return Y===Z||Z.startsWith(Y)&&Z[Y.length]==="."}var Z6=class{constructor(Z,Y,X){this.fontStyle=Z,this.foregroundId=Y,this.backgroundId=X}};function xK(Z){if(!Z)return[];if(!Z.settings||!Array.isArray(Z.settings))return[];let Y=Z.settings,X=[],J=0;for(let Q=0,$=Y.length;Q<$;Q++){let K=Y[Q];if(!K.settings)continue;let W;if(typeof K.scope==="string"){let G=K.scope;G=G.replace(/^[,]+/,""),G=G.replace(/[,]+$/,""),W=G.split(",")}else if(Array.isArray(K.scope))W=K.scope;else W=[""];let U=-1;if(typeof K.settings.fontStyle==="string"){U=0;let G=K.settings.fontStyle.split(" ");for(let F=0,M=G.length;F<M;F++)switch(G[F]){case"italic":U=U|1;break;case"bold":U=U|2;break;case"underline":U=U|4;break;case"strikethrough":U=U|8;break}}let z=null;if(typeof K.settings.foreground==="string"&&u5(K.settings.foreground))z=K.settings.foreground;let H=null;if(typeof K.settings.background==="string"&&u5(K.settings.background))H=K.settings.background;for(let G=0,F=W.length;G<F;G++){let _=W[G].trim().split(" "),A=_[_.length-1],P=null;if(_.length>1)P=_.slice(0,_.length-1),P.reverse();X[J++]=new gK(A,P,Q,U,z,H)}}return X}var gK=class{constructor(Z,Y,X,J,Q,$){this.scope=Z,this.parentScopes=Y,this.index=X,this.fontStyle=J,this.foreground=Q,this.background=$}},OZ=((Z)=>{return Z[Z.NotSet=-1]="NotSet",Z[Z.None=0]="None",Z[Z.Italic=1]="Italic",Z[Z.Bold=2]="Bold",Z[Z.Underline=4]="Underline",Z[Z.Strikethrough=8]="Strikethrough",Z})(OZ||{});function uK(Z,Y){Z.sort((U,z)=>{let H=a5(U.scope,z.scope);if(H!==0)return H;if(H=s5(U.parentScopes,z.parentScopes),H!==0)return H;return U.index-z.index});let X=0,J="#000000",Q="#ffffff";while(Z.length>=1&&Z[0].scope===""){let U=Z.shift();if(U.fontStyle!==-1)X=U.fontStyle;if(U.foreground!==null)J=U.foreground;if(U.background!==null)Q=U.background}let $=new mK(Y),K=new Z6(X,$.getId(J),$.getId(Q)),W=new cK(new BX(0,null,-1,0,0),[]);for(let U=0,z=Z.length;U<z;U++){let H=Z[U];W.insert(0,H.scope,H.parentScopes,H.fontStyle,$.getId(H.foreground),$.getId(H.background))}return new V0($,K,W)}var mK=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(Z){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(Z)){this._isFrozen=!0;for(let Y=0,X=Z.length;Y<X;Y++)this._color2id[Z[Y]]=Y,this._id2color[Y]=Z[Y]}else this._isFrozen=!1}getId(Z){if(Z===null)return 0;Z=Z.toUpperCase();let Y=this._color2id[Z];if(Y)return Y;if(this._isFrozen)throw Error(`Missing color in color map - ${Z}`);return Y=++this._lastColorId,this._color2id[Z]=Y,this._id2color[Y]=Z,Y}getColorMap(){return this._id2color.slice(0)}},pK=Object.freeze([]),BX=class Z{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(Y,X,J,Q,$){this.scopeDepth=Y,this.parentScopes=X||pK,this.fontStyle=J,this.foreground=Q,this.background=$}clone(){return new Z(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(Y){let X=[];for(let J=0,Q=Y.length;J<Q;J++)X[J]=Y[J].clone();return X}acceptOverwrite(Y,X,J,Q){if(this.scopeDepth>Y)console.log("how did this happen?");else this.scopeDepth=Y;if(X!==-1)this.fontStyle=X;if(J!==0)this.foreground=J;if(Q!==0)this.background=Q}},cK=class Z{constructor(Y,X=[],J={}){this._mainRule=Y,this._children=J,this._rulesWithParentScopes=X}_rulesWithParentScopes;static _cmpBySpecificity(Y,X){if(Y.scopeDepth!==X.scopeDepth)return X.scopeDepth-Y.scopeDepth;let J=0,Q=0;while(!0){if(Y.parentScopes[J]===">")J++;if(X.parentScopes[Q]===">")Q++;if(J>=Y.parentScopes.length||Q>=X.parentScopes.length)break;let $=X.parentScopes[Q].length-Y.parentScopes[J].length;if($!==0)return $;J++,Q++}return X.parentScopes.length-Y.parentScopes.length}match(Y){if(Y!==""){let J=Y.indexOf("."),Q,$;if(J===-1)Q=Y,$="";else Q=Y.substring(0,J),$=Y.substring(J+1);if(this._children.hasOwnProperty(Q))return this._children[Q].match($)}let X=this._rulesWithParentScopes.concat(this._mainRule);return X.sort(Z._cmpBySpecificity),X}insert(Y,X,J,Q,$,K){if(X===""){this._doInsertHere(Y,J,Q,$,K);return}let W=X.indexOf("."),U,z;if(W===-1)U=X,z="";else U=X.substring(0,W),z=X.substring(W+1);let H;if(this._children.hasOwnProperty(U))H=this._children[U];else H=new Z(this._mainRule.clone(),BX.cloneArr(this._rulesWithParentScopes)),this._children[U]=H;H.insert(Y+1,z,J,Q,$,K)}_doInsertHere(Y,X,J,Q,$){if(X===null){this._mainRule.acceptOverwrite(Y,J,Q,$);return}for(let K=0,W=this._rulesWithParentScopes.length;K<W;K++){let U=this._rulesWithParentScopes[K];if(s5(U.parentScopes,X)===0){U.acceptOverwrite(Y,J,Q,$);return}}if(J===-1)J=this._mainRule.fontStyle;if(Q===0)Q=this._mainRule.foreground;if($===0)$=this._mainRule.background;this._rulesWithParentScopes.push(new BX(Y,X,J,Q,$))}},r4=class Z{static toBinaryStr(Y){return Y.toString(2).padStart(32,"0")}static print(Y){let X=Z.getLanguageId(Y),J=Z.getTokenType(Y),Q=Z.getFontStyle(Y),$=Z.getForeground(Y),K=Z.getBackground(Y);console.log({languageId:X,tokenType:J,fontStyle:Q,foreground:$,background:K})}static getLanguageId(Y){return(Y&255)>>>0}static getTokenType(Y){return(Y&768)>>>8}static containsBalancedBrackets(Y){return(Y&1024)!==0}static getFontStyle(Y){return(Y&30720)>>>11}static getForeground(Y){return(Y&16744448)>>>15}static getBackground(Y){return(Y&4278190080)>>>24}static set(Y,X,J,Q,$,K,W){let U=Z.getLanguageId(Y),z=Z.getTokenType(Y),H=Z.containsBalancedBrackets(Y)?1:0,G=Z.getFontStyle(Y),F=Z.getForeground(Y),M=Z.getBackground(Y);if(X!==0)U=X;if(J!==8)z=lK(J);if(Q!==null)H=Q?1:0;if($!==-1)G=$;if(K!==0)F=K;if(W!==0)M=W;return(U<<0|z<<8|H<<10|G<<11|F<<15|M<<24)>>>0}};function dK(Z){return Z}function lK(Z){return Z}function WY(Z,Y){let X=[],J=iK(Z),Q=J.next();while(Q!==null){let U=0;if(Q.length===2&&Q.charAt(1)===":"){switch(Q.charAt(0)){case"R":U=1;break;case"L":U=-1;break;default:console.log(`Unknown priority ${Q} in scope selector`)}Q=J.next()}let z=K();if(X.push({matcher:z,priority:U}),Q!==",")break;Q=J.next()}return X;function $(){if(Q==="-"){Q=J.next();let U=$();return(z)=>!!U&&!U(z)}if(Q==="("){Q=J.next();let U=W();if(Q===")")Q=J.next();return U}if(m5(Q)){let U=[];do U.push(Q),Q=J.next();while(m5(Q));return(z)=>Y(U,z)}return null}function K(){let U=[],z=$();while(z)U.push(z),z=$();return(H)=>U.every((G)=>G(H))}function W(){let U=[],z=K();while(z){if(U.push(z),Q==="|"||Q===",")do Q=J.next();while(Q==="|"||Q===",");else break;z=K()}return(H)=>U.some((G)=>G(H))}}function m5(Z){return!!Z&&!!Z.match(/[\w\.:]+/)}function iK(Z){let Y=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,X=Y.exec(Z);return{next:()=>{if(!X)return null;let J=X[0];return X=Y.exec(Z),J}}}function Y6(Z){if(typeof Z.dispose==="function")Z.dispose()}var E0=class{constructor(Z){this.scopeName=Z}toKey(){return this.scopeName}},rK=class{constructor(Z,Y){this.scopeName=Z,this.ruleName=Y}toKey(){return`${this.scopeName}#${this.ruleName}`}},oK=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(Z){let Y=Z.toKey();if(this._seenReferenceKeys.has(Y))return;this._seenReferenceKeys.add(Y),this._references.push(Z)}},nK=class{constructor(Z,Y){this.repo=Z,this.initialScopeName=Y,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new E0(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let Z=this.Q;this.Q=[];let Y=new oK;for(let X of Z)aK(X,this.initialScopeName,this.repo,Y);for(let X of Y.references)if(X instanceof E0){if(this.seenFullScopeRequests.has(X.scopeName))continue;this.seenFullScopeRequests.add(X.scopeName),this.Q.push(X)}else{if(this.seenFullScopeRequests.has(X.scopeName))continue;if(this.seenPartialScopeRequests.has(X.toKey()))continue;this.seenPartialScopeRequests.add(X.toKey()),this.Q.push(X)}}};function aK(Z,Y,X,J){let Q=X.lookup(Z.scopeName);if(!Q){if(Z.scopeName===Y)throw Error(`No grammar provided for <${Y}>`);return}let $=X.lookup(Y);if(Z instanceof E0)KY({baseGrammar:$,selfGrammar:Q},J);else LX(Z.ruleName,{baseGrammar:$,selfGrammar:Q,repository:Q.repository},J);let K=X.injections(Z.scopeName);if(K)for(let W of K)J.add(new E0(W))}function LX(Z,Y,X){if(Y.repository&&Y.repository[Z]){let J=Y.repository[Z];UY([J],Y,X)}}function KY(Z,Y){if(Z.selfGrammar.patterns&&Array.isArray(Z.selfGrammar.patterns))UY(Z.selfGrammar.patterns,{...Z,repository:Z.selfGrammar.repository},Y);if(Z.selfGrammar.injections)UY(Object.values(Z.selfGrammar.injections),{...Z,repository:Z.selfGrammar.repository},Y)}function UY(Z,Y,X){for(let J of Z){if(X.visitedRule.has(J))continue;X.visitedRule.add(J);let Q=J.repository?o5({},Y.repository,J.repository):Y.repository;if(Array.isArray(J.patterns))UY(J.patterns,{...Y,repository:Q},X);let $=J.include;if(!$)continue;let K=X6($);switch(K.kind){case 0:KY({...Y,selfGrammar:Y.baseGrammar},X);break;case 1:KY(Y,X);break;case 2:LX(K.ruleName,{...Y,repository:Q},X);break;case 3:case 4:let W=K.scopeName===Y.selfGrammar.scopeName?Y.selfGrammar:K.scopeName===Y.baseGrammar.scopeName?Y.baseGrammar:void 0;if(W){let U={baseGrammar:Y.baseGrammar,selfGrammar:W,repository:Q};if(K.kind===4)LX(K.ruleName,U,X);else KY(U,X)}else if(K.kind===4)X.add(new rK(K.scopeName,K.ruleName));else X.add(new E0(K.scopeName));break}}}var sK=class{kind=0},tK=class{kind=1},eK=class{constructor(Z){this.ruleName=Z}kind=2},Z7=class{constructor(Z){this.scopeName=Z}kind=3},Y7=class{constructor(Z,Y){this.scopeName=Z,this.ruleName=Y}kind=4};function X6(Z){if(Z==="$base")return new sK;else if(Z==="$self")return new tK;let Y=Z.indexOf("#");if(Y===-1)return new Z7(Z);else if(Y===0)return new eK(Z.substring(1));else{let X=Z.substring(0,Y),J=Z.substring(Y+1);return new Y7(X,J)}}var X7=/\\(\d+)/,p5=/\\(\d+)/g,UO=Symbol("RuleId"),J7=-1,J6=-2;function Q6(Z){return Z}function $6(Z){return Z}var f0=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(Z,Y,X,J){this.$location=Z,this.id=Y,this._name=X||null,this._nameIsCapturing=$Y.hasCaptures(this._name),this._contentName=J||null,this._contentNameIsCapturing=$Y.hasCaptures(this._contentName)}get debugName(){let Z=this.$location?`${n5(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${Z}`}getName(Z,Y){if(!this._nameIsCapturing||this._name===null||Z===null||Y===null)return this._name;return $Y.replaceCaptures(this._name,Z,Y)}getContentName(Z,Y){if(!this._contentNameIsCapturing||this._contentName===null)return this._contentName;return $Y.replaceCaptures(this._contentName,Z,Y)}},Q7=class extends f0{retokenizeCapturedWithRuleId;constructor(Z,Y,X,J,Q){super(Z,Y,X,J);this.retokenizeCapturedWithRuleId=Q}dispose(){}collectPatterns(Z,Y){throw Error("Not supported!")}compile(Z,Y){throw Error("Not supported!")}compileAG(Z,Y,X,J){throw Error("Not supported!")}},$7=class extends f0{_match;captures;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q){super(Z,Y,X,null);this._match=new b0(J,this.id),this.captures=Q,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(Z,Y){Y.push(this._match)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new T0,this.collectPatterns(Z,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},c5=class extends f0{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q){super(Z,Y,X,J);this.patterns=Q.patterns,this.hasMissingPatterns=Q.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}collectPatterns(Z,Y){for(let X of this.patterns)Z.getRule(X).collectPatterns(Z,Y)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new T0,this.collectPatterns(Z,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},PX=class extends f0{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q,$,K,W,U,z){super(Z,Y,X,J);this._begin=new b0(Q,this.id),this.beginCaptures=$,this._end=new b0(K?K:"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=W,this.applyEndPatternLast=U||!1,this.patterns=z.patterns,this.hasMissingPatterns=z.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(Z,Y){return this._end.resolveBackReferences(Z,Y)}collectPatterns(Z,Y){Y.push(this._begin)}compile(Z,Y){return this._getCachedCompiledPatterns(Z,Y).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z,Y).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z,Y){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new T0;for(let X of this.patterns)Z.getRule(X).collectPatterns(Z,this._cachedCompiledPatterns);if(this.applyEndPatternLast)this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end);else this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}if(this._end.hasBackReferences)if(this.applyEndPatternLast)this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,Y);else this._cachedCompiledPatterns.setSource(0,Y);return this._cachedCompiledPatterns}},zY=class extends f0{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(Z,Y,X,J,Q,$,K,W,U){super(Z,Y,X,J);this._begin=new b0(Q,this.id),this.beginCaptures=$,this.whileCaptures=W,this._while=new b0(K,J6),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=U.patterns,this.hasMissingPatterns=U.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null;if(this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(Z,Y){return this._while.resolveBackReferences(Z,Y)}collectPatterns(Z,Y){Y.push(this._begin)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new T0;for(let Y of this.patterns)Z.getRule(Y).collectPatterns(Z,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(Z,Y){return this._getCachedCompiledWhilePatterns(Z,Y).compile(Z)}compileWhileAG(Z,Y,X,J){return this._getCachedCompiledWhilePatterns(Z,Y).compileAG(Z,X,J)}_getCachedCompiledWhilePatterns(Z,Y){if(!this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns=new T0,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while);if(this._while.hasBackReferences)this._cachedCompiledWhilePatterns.setSource(0,Y?Y:"￿");return this._cachedCompiledWhilePatterns}},K6=class Z{static createCaptureRule(Y,X,J,Q,$){return Y.registerRule((K)=>{return new Q7(X,K,J,Q,$)})}static getCompiledRuleId(Y,X,J){if(!Y.id)X.registerRule((Q)=>{if(Y.id=Q,Y.match)return new $7(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.match,Z._compileCaptures(Y.captures,X,J));if(typeof Y.begin>"u"){if(Y.repository)J=o5({},J,Y.repository);let $=Y.patterns;if(typeof $>"u"&&Y.include)$=[{include:Y.include}];return new c5(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Z._compilePatterns($,X,J))}if(Y.while)return new zY(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Y.begin,Z._compileCaptures(Y.beginCaptures||Y.captures,X,J),Y.while,Z._compileCaptures(Y.whileCaptures||Y.captures,X,J),Z._compilePatterns(Y.patterns,X,J));return new PX(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Y.begin,Z._compileCaptures(Y.beginCaptures||Y.captures,X,J),Y.end,Z._compileCaptures(Y.endCaptures||Y.captures,X,J),Y.applyEndPatternLast,Z._compilePatterns(Y.patterns,X,J))});return Y.id}static _compileCaptures(Y,X,J){let Q=[];if(Y){let $=0;for(let K in Y){if(K==="$vscodeTextmateLocation")continue;let W=parseInt(K,10);if(W>$)$=W}for(let K=0;K<=$;K++)Q[K]=null;for(let K in Y){if(K==="$vscodeTextmateLocation")continue;let W=parseInt(K,10),U=0;if(Y[K].patterns)U=Z.getCompiledRuleId(Y[K],X,J);Q[W]=Z.createCaptureRule(X,Y[K].$vscodeTextmateLocation,Y[K].name,Y[K].contentName,U)}}return Q}static _compilePatterns(Y,X,J){let Q=[];if(Y)for(let $=0,K=Y.length;$<K;$++){let W=Y[$],U=-1;if(W.include){let z=X6(W.include);switch(z.kind){case 0:case 1:U=Z.getCompiledRuleId(J[W.include],X,J);break;case 2:let H=J[z.ruleName];if(H)U=Z.getCompiledRuleId(H,X,J);break;case 3:case 4:let G=z.scopeName,F=z.kind===4?z.ruleName:null,M=X.getExternalGrammar(G,J);if(M)if(F){let _=M.repository[F];if(_)U=Z.getCompiledRuleId(_,X,M.repository)}else U=Z.getCompiledRuleId(M.repository.$self,X,M.repository);break}}else U=Z.getCompiledRuleId(W,X,J);if(U!==-1){let z=X.getRule(U),H=!1;if(z instanceof c5||z instanceof PX||z instanceof zY){if(z.hasMissingPatterns&&z.patterns.length===0)H=!0}if(H)continue;Q.push(U)}}return{patterns:Q,hasMissingPatterns:(Y?Y.length:0)!==Q.length}}},b0=class Z{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(Y,X){if(Y&&typeof Y==="string"){let J=Y.length,Q=0,$=[],K=!1;for(let W=0;W<J;W++)if(Y.charAt(W)==="\\"){if(W+1<J){let z=Y.charAt(W+1);if(z==="z")$.push(Y.substring(Q,W)),$.push("$(?!\\n)(?<!\\n)"),Q=W+2;else if(z==="A"||z==="G")K=!0;W++}}if(this.hasAnchor=K,Q===0)this.source=Y;else $.push(Y.substring(Q,J)),this.source=$.join("")}else this.hasAnchor=!1,this.source=Y;if(this.hasAnchor)this._anchorCache=this._buildAnchorCache();else this._anchorCache=null;if(this.ruleId=X,typeof this.source==="string")this.hasBackReferences=X7.test(this.source);else this.hasBackReferences=!1}clone(){return new Z(this.source,this.ruleId)}setSource(Y){if(this.source===Y)return;if(this.source=Y,this.hasAnchor)this._anchorCache=this._buildAnchorCache()}resolveBackReferences(Y,X){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let J=X.map((Q)=>{return Y.substring(Q.start,Q.end)});return p5.lastIndex=0,this.source.replace(p5,(Q,$)=>{return t5(J[parseInt($,10)]||"")})}_buildAnchorCache(){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let Y=[],X=[],J=[],Q=[],$,K,W,U;for($=0,K=this.source.length;$<K;$++)if(W=this.source.charAt($),Y[$]=W,X[$]=W,J[$]=W,Q[$]=W,W==="\\"){if($+1<K){if(U=this.source.charAt($+1),U==="A")Y[$+1]="￿",X[$+1]="￿",J[$+1]="A",Q[$+1]="A";else if(U==="G")Y[$+1]="￿",X[$+1]="G",J[$+1]="￿",Q[$+1]="G";else Y[$+1]=U,X[$+1]=U,J[$+1]=U,Q[$+1]=U;$++}}return{A0_G0:Y.join(""),A0_G1:X.join(""),A1_G0:J.join(""),A1_G1:Q.join("")}}resolveAnchors(Y,X){if(!this.hasAnchor||!this._anchorCache||typeof this.source!=="string")return this.source;if(Y)if(X)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;else if(X)return this._anchorCache.A0_G1;else return this._anchorCache.A0_G0}},T0=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){if(this._cached)this._cached.dispose(),this._cached=null;if(this._anchorCache.A0_G0)this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null;if(this._anchorCache.A0_G1)this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null;if(this._anchorCache.A1_G0)this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null;if(this._anchorCache.A1_G1)this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null}push(Z){this._items.push(Z),this._hasAnchors=this._hasAnchors||Z.hasAnchor}unshift(Z){this._items.unshift(Z),this._hasAnchors=this._hasAnchors||Z.hasAnchor}length(){return this._items.length}setSource(Z,Y){if(this._items[Z].source!==Y)this._disposeCaches(),this._items[Z].setSource(Y)}compile(Z){if(!this._cached){let Y=this._items.map((X)=>X.source);this._cached=new d5(Z,Y,this._items.map((X)=>X.ruleId))}return this._cached}compileAG(Z,Y,X){if(!this._hasAnchors)return this.compile(Z);else if(Y)if(X){if(!this._anchorCache.A1_G1)this._anchorCache.A1_G1=this._resolveAnchors(Z,Y,X);return this._anchorCache.A1_G1}else{if(!this._anchorCache.A1_G0)this._anchorCache.A1_G0=this._resolveAnchors(Z,Y,X);return this._anchorCache.A1_G0}else if(X){if(!this._anchorCache.A0_G1)this._anchorCache.A0_G1=this._resolveAnchors(Z,Y,X);return this._anchorCache.A0_G1}else{if(!this._anchorCache.A0_G0)this._anchorCache.A0_G0=this._resolveAnchors(Z,Y,X);return this._anchorCache.A0_G0}}_resolveAnchors(Z,Y,X){let J=this._items.map((Q)=>Q.resolveAnchors(Y,X));return new d5(Z,J,this._items.map((Q)=>Q.ruleId))}},d5=class{constructor(Z,Y,X){this.regExps=Y,this.rules=X,this.scanner=Z.createOnigScanner(Y)}scanner;dispose(){if(typeof this.scanner.dispose==="function")this.scanner.dispose()}toString(){let Z=[];for(let Y=0,X=this.rules.length;Y<X;Y++)Z.push(" - "+this.rules[Y]+": "+this.regExps[Y]);return Z.join(`
138
- `)}findNextMatchSync(Z,Y,X){let J=this.scanner.findNextMatchSync(Z,Y,X);if(!J)return null;return{ruleId:this.rules[J.index],captureIndices:J.captureIndices}}},AX=class{constructor(Z,Y){this.languageId=Z,this.tokenType=Y}},K7=class Z{_defaultAttributes;_embeddedLanguagesMatcher;constructor(Y,X){this._defaultAttributes=new AX(Y,8),this._embeddedLanguagesMatcher=new W7(Object.entries(X||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(Y){if(Y===null)return Z._NULL_SCOPE_METADATA;return this._getBasicScopeAttributes.get(Y)}static _NULL_SCOPE_METADATA=new AX(0,0);_getBasicScopeAttributes=new e5((Y)=>{let X=this._scopeToLanguage(Y),J=this._toStandardTokenType(Y);return new AX(X,J)});_scopeToLanguage(Y){return this._embeddedLanguagesMatcher.match(Y)||0}_toStandardTokenType(Y){let X=Y.match(Z.STANDARD_TOKEN_TYPE_REGEXP);if(!X)return 8;switch(X[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},W7=class{values;scopesRegExp;constructor(Z){if(Z.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(Z);let Y=Z.map(([X,J])=>t5(X));Y.sort(),Y.reverse(),this.scopesRegExp=new RegExp(`^((${Y.join(")|(")}))($|\\.)`,"")}}match(Z){if(!this.scopesRegExp)return;let Y=Z.match(this.scopesRegExp);if(!Y)return;return this.values.get(Y[1])}},zO={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},W6=!1,l5=class{constructor(Z,Y){this.stack=Z,this.stoppedEarly=Y}};function U6(Z,Y,X,J,Q,$,K,W){let U=Y.content.length,z=!1,H=-1;if(K){let M=U7(Z,Y,X,J,Q,$);Q=M.stack,J=M.linePos,X=M.isFirstLine,H=M.anchorPosition}let G=Date.now();while(!z){if(W!==0){if(Date.now()-G>W)return new l5(Q,!0)}F()}return new l5(Q,!1);function F(){let M=z7(Z,Y,X,J,Q,H);if(!M){$.produce(Q,U),z=!0;return}let{captureIndices:_,matchedRuleId:A}=M,P=_&&_.length>0?_[0].end>J:!1;if(A===J7){let B=Q.getRule(Z);$.produce(Q,_[0].start),Q=Q.withContentNameScopesList(Q.nameScopesList),I0(Z,Y,X,Q,$,B.endCaptures,_),$.produce(Q,_[0].end);let C=Q;if(Q=Q.parent,H=C.getAnchorPos(),!P&&C.getEnterPos()===J){Q=C,$.produce(Q,U),z=!0;return}}else{let B=Z.getRule(A);$.produce(Q,_[0].start);let C=Q,R=B.getName(Y.content,_),D=Q.contentNameScopesList.pushAttributed(R,Z);if(Q=Q.push(A,J,H,_[0].end===U,null,D,D),B instanceof PX){let j=B;I0(Z,Y,X,Q,$,j.beginCaptures,_),$.produce(Q,_[0].end),H=_[0].end;let E=j.getContentName(Y.content,_),c=D.pushAttributed(E,Z);if(Q=Q.withContentNameScopesList(c),j.endHasBackReferences)Q=Q.withEndRule(j.getEndWithResolvedBackReferences(Y.content,_));if(!P&&C.hasSameRuleAs(Q)){Q=Q.pop(),$.produce(Q,U),z=!0;return}}else if(B instanceof zY){let j=B;I0(Z,Y,X,Q,$,j.beginCaptures,_),$.produce(Q,_[0].end),H=_[0].end;let E=j.getContentName(Y.content,_),c=D.pushAttributed(E,Z);if(Q=Q.withContentNameScopesList(c),j.whileHasBackReferences)Q=Q.withEndRule(j.getWhileWithResolvedBackReferences(Y.content,_));if(!P&&C.hasSameRuleAs(Q)){Q=Q.pop(),$.produce(Q,U),z=!0;return}}else if(I0(Z,Y,X,Q,$,B.captures,_),$.produce(Q,_[0].end),Q=Q.pop(),!P){Q=Q.safePop(),$.produce(Q,U),z=!0;return}}if(_[0].end>J)J=_[0].end,X=!1}}function U7(Z,Y,X,J,Q,$){let K=Q.beginRuleCapturedEOL?0:-1,W=[];for(let U=Q;U;U=U.pop()){let z=U.getRule(Z);if(z instanceof zY)W.push({rule:z,stack:U})}for(let U=W.pop();U;U=W.pop()){let{ruleScanner:z,findOptions:H}=O7(U.rule,Z,U.stack.endRule,X,J===K),G=z.findNextMatchSync(Y,J,H);if(G){if(G.ruleId!==J6){Q=U.stack.pop();break}if(G.captureIndices&&G.captureIndices.length){if($.produce(U.stack,G.captureIndices[0].start),I0(Z,Y,X,U.stack,$,U.rule.whileCaptures,G.captureIndices),$.produce(U.stack,G.captureIndices[0].end),K=G.captureIndices[0].end,G.captureIndices[0].end>J)J=G.captureIndices[0].end,X=!1}}else{Q=U.stack.pop();break}}return{stack:Q,linePos:J,anchorPosition:K,isFirstLine:X}}function z7(Z,Y,X,J,Q,$){let K=H7(Z,Y,X,J,Q,$),W=Z.getInjections();if(W.length===0)return K;let U=G7(W,Z,Y,X,J,Q,$);if(!U)return K;if(!K)return U;let z=K.captureIndices[0].start,H=U.captureIndices[0].start;if(H<z||U.priorityMatch&&H===z)return U;return K}function H7(Z,Y,X,J,Q,$){let K=Q.getRule(Z),{ruleScanner:W,findOptions:U}=z6(K,Z,Q.endRule,X,J===$),z=W.findNextMatchSync(Y,J,U);if(z)return{captureIndices:z.captureIndices,matchedRuleId:z.ruleId};return null}function G7(Z,Y,X,J,Q,$,K){let W=Number.MAX_VALUE,U=null,z,H=0,G=$.contentNameScopesList.getScopeNames();for(let F=0,M=Z.length;F<M;F++){let _=Z[F];if(!_.matcher(G))continue;let A=Y.getRule(_.ruleId),{ruleScanner:P,findOptions:B}=z6(A,Y,null,J,Q===K),C=P.findNextMatchSync(X,Q,B);if(!C)continue;let R=C.captureIndices[0].start;if(R>=W)continue;if(W=R,U=C.captureIndices,z=C.ruleId,H=_.priority,W===Q)break}if(U)return{priorityMatch:H===-1,captureIndices:U,matchedRuleId:z};return null}function z6(Z,Y,X,J,Q){if(W6){let K=Z.compile(Y,X),W=H6(J,Q);return{ruleScanner:K,findOptions:W}}return{ruleScanner:Z.compileAG(Y,X,J,Q),findOptions:0}}function O7(Z,Y,X,J,Q){if(W6){let K=Z.compileWhile(Y,X),W=H6(J,Q);return{ruleScanner:K,findOptions:W}}return{ruleScanner:Z.compileWhileAG(Y,X,J,Q),findOptions:0}}function H6(Z,Y){let X=0;if(!Z)X|=1;if(!Y)X|=4;return X}function I0(Z,Y,X,J,Q,$,K){if($.length===0)return;let W=Y.content,U=Math.min($.length,K.length),z=[],H=K[0].end;for(let G=0;G<U;G++){let F=$[G];if(F===null)continue;let M=K[G];if(M.length===0)continue;if(M.start>H)break;while(z.length>0&&z[z.length-1].endPos<=M.start)Q.produceFromScopes(z[z.length-1].scopes,z[z.length-1].endPos),z.pop();if(z.length>0)Q.produceFromScopes(z[z.length-1].scopes,M.start);else Q.produce(J,M.start);if(F.retokenizeCapturedWithRuleId){let A=F.getName(W,K),P=J.contentNameScopesList.pushAttributed(A,Z),B=F.getContentName(W,K),C=P.pushAttributed(B,Z),R=J.push(F.retokenizeCapturedWithRuleId,M.start,-1,!1,null,P,C),D=Z.createOnigString(W.substring(0,M.end));U6(Z,D,X&&M.start===0,M.start,R,Q,!1,0),Y6(D);continue}let _=F.getName(W,K);if(_!==null){let P=(z.length>0?z[z.length-1].scopes:J.contentNameScopesList).pushAttributed(_,Z);z.push(new q7(P,M.end))}}while(z.length>0)Q.produceFromScopes(z[z.length-1].scopes,z[z.length-1].endPos),z.pop()}var q7=class{scopes;endPos;constructor(Z,Y){this.scopes=Z,this.endPos=Y}};function F7(Z,Y,X,J,Q,$,K,W){return new N7(Z,Y,X,J,Q,$,K,W)}function i5(Z,Y,X,J,Q){let $=WY(Y,HY),K=K6.getCompiledRuleId(X,J,Q.repository);for(let W of $)Z.push({debugSelector:Y,matcher:W.matcher,ruleId:K,grammar:Q,priority:W.priority})}function HY(Z,Y){if(Y.length<Z.length)return!1;let X=0;return Z.every((J)=>{for(let Q=X;Q<Y.length;Q++)if(M7(Y[Q],J))return X=Q+1,!0;return!1})}function M7(Z,Y){if(!Z)return!1;if(Z===Y)return!0;let X=Y.length;return Z.length>X&&Z.substr(0,X)===Y&&Z[X]==="."}var N7=class{constructor(Z,Y,X,J,Q,$,K,W){if(this._rootScopeName=Z,this.balancedBracketSelectors=$,this._onigLib=W,this._basicScopeAttributesProvider=new K7(X,J),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=K,this._grammar=r5(Y,null),this._injections=null,this._tokenTypeMatchers=[],Q)for(let U of Object.keys(Q)){let z=WY(U,HY);for(let H of z)this._tokenTypeMatchers.push({matcher:H.matcher,type:Q[U]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let Z of this._ruleId2desc)if(Z)Z.dispose()}createOnigScanner(Z){return this._onigLib.createOnigScanner(Z)}createOnigString(Z){return this._onigLib.createOnigString(Z)}getMetadataForScope(Z){return this._basicScopeAttributesProvider.getBasicScopeAttributes(Z)}_collectInjections(){let Z={lookup:(Q)=>{if(Q===this._rootScopeName)return this._grammar;return this.getExternalGrammar(Q)},injections:(Q)=>{return this._grammarRepository.injections(Q)}},Y=[],X=this._rootScopeName,J=Z.lookup(X);if(J){let Q=J.injections;if(Q)for(let K in Q)i5(Y,K,Q[K],this,J);let $=this._grammarRepository.injections(X);if($)$.forEach((K)=>{let W=this.getExternalGrammar(K);if(W){let U=W.injectionSelector;if(U)i5(Y,U,W,this,W)}})}return Y.sort((Q,$)=>Q.priority-$.priority),Y}getInjections(){if(this._injections===null)this._injections=this._collectInjections();return this._injections}registerRule(Z){let Y=++this._lastRuleId,X=Z(Q6(Y));return this._ruleId2desc[Y]=X,X}getRule(Z){return this._ruleId2desc[$6(Z)]}getExternalGrammar(Z,Y){if(this._includedGrammars[Z])return this._includedGrammars[Z];else if(this._grammarRepository){let X=this._grammarRepository.lookup(Z);if(X)return this._includedGrammars[Z]=r5(X,Y&&Y.$base),this._includedGrammars[Z]}return}tokenizeLine(Z,Y,X=0){let J=this._tokenize(Z,Y,!1,X);return{tokens:J.lineTokens.getResult(J.ruleStack,J.lineLength),ruleStack:J.ruleStack,stoppedEarly:J.stoppedEarly}}tokenizeLine2(Z,Y,X=0){let J=this._tokenize(Z,Y,!0,X);return{tokens:J.lineTokens.getBinaryResult(J.ruleStack,J.lineLength),ruleStack:J.ruleStack,stoppedEarly:J.stoppedEarly}}_tokenize(Z,Y,X,J){if(this._rootId===-1)this._rootId=K6.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections();let Q;if(!Y||Y===RX.NULL){Q=!0;let z=this._basicScopeAttributesProvider.getDefaultAttributes(),H=this.themeProvider.getDefaults(),G=r4.set(0,z.languageId,z.tokenType,null,H.fontStyle,H.foregroundId,H.backgroundId),F=this.getRule(this._rootId).getName(null,null),M;if(F)M=D0.createRootAndLookUpScopeName(F,G,this);else M=D0.createRoot("unknown",G);Y=new RX(null,this._rootId,-1,-1,!1,null,M,M)}else Q=!1,Y.reset();Z=Z+`
139
- `;let $=this.createOnigString(Z),K=$.content.length,W=new w7(X,Z,this._tokenTypeMatchers,this.balancedBracketSelectors),U=U6(this,$,Q,0,Y,W,!0,J);return Y6($),{lineLength:K,lineTokens:W,ruleStack:U.stack,stoppedEarly:U.stoppedEarly}}};function r5(Z,Y){return Z=jK(Z),Z.repository=Z.repository||{},Z.repository.$self={$vscodeTextmateLocation:Z.$vscodeTextmateLocation,patterns:Z.patterns,name:Z.scopeName},Z.repository.$base=Y||Z.repository.$self,Z}var D0=class Z{constructor(Y,X,J){this.parent=Y,this.scopePath=X,this.tokenAttributes=J}static fromExtension(Y,X){let J=Y,Q=Y?.scopePath??null;for(let $ of X)Q=wX.push(Q,$.scopeNames),J=new Z(J,Q,$.encodedTokenAttributes);return J}static createRoot(Y,X){return new Z(null,new wX(null,Y),X)}static createRootAndLookUpScopeName(Y,X,J){let Q=J.getMetadataForScope(Y),$=new wX(null,Y),K=J.themeProvider.themeMatch($),W=Z.mergeAttributes(X,Q,K);return new Z(null,$,W)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(Y){return Z.equals(this,Y)}static equals(Y,X){do{if(Y===X)return!0;if(!Y&&!X)return!0;if(!Y||!X)return!1;if(Y.scopeName!==X.scopeName||Y.tokenAttributes!==X.tokenAttributes)return!1;Y=Y.parent,X=X.parent}while(!0)}static mergeAttributes(Y,X,J){let Q=-1,$=0,K=0;if(J!==null)Q=J.fontStyle,$=J.foregroundId,K=J.backgroundId;return r4.set(Y,X.languageId,X.tokenType,null,Q,$,K)}pushAttributed(Y,X){if(Y===null)return this;if(Y.indexOf(" ")===-1)return Z._pushAttributed(this,Y,X);let J=Y.split(/ /g),Q=this;for(let $ of J)Q=Z._pushAttributed(Q,$,X);return Q}static _pushAttributed(Y,X,J){let Q=J.getMetadataForScope(X),$=Y.scopePath.push(X),K=J.themeProvider.themeMatch($),W=Z.mergeAttributes(Y.tokenAttributes,Q,K);return new Z(Y,$,W)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(Y){let X=[],J=this;while(J&&J!==Y)X.push({encodedTokenAttributes:J.tokenAttributes,scopeNames:J.scopePath.getExtensionIfDefined(J.parent?.scopePath??null)}),J=J.parent;return J===Y?X.reverse():void 0}},RX=class Z{constructor(Y,X,J,Q,$,K,W,U){this.parent=Y,this.ruleId=X,this.beginRuleCapturedEOL=$,this.endRule=K,this.nameScopesList=W,this.contentNameScopesList=U,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=J,this._anchorPos=Q}_stackElementBrand=void 0;static NULL=new Z(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(Y){if(Y===null)return!1;return Z._equals(this,Y)}static _equals(Y,X){if(Y===X)return!0;if(!this._structuralEquals(Y,X))return!1;return D0.equals(Y.contentNameScopesList,X.contentNameScopesList)}static _structuralEquals(Y,X){do{if(Y===X)return!0;if(!Y&&!X)return!0;if(!Y||!X)return!1;if(Y.depth!==X.depth||Y.ruleId!==X.ruleId||Y.endRule!==X.endRule)return!1;Y=Y.parent,X=X.parent}while(!0)}clone(){return this}static _reset(Y){while(Y)Y._enterPos=-1,Y._anchorPos=-1,Y=Y.parent}reset(){Z._reset(this)}pop(){return this.parent}safePop(){if(this.parent)return this.parent;return this}push(Y,X,J,Q,$,K,W){return new Z(this,Y,X,J,Q,$,K,W)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(Y){return Y.getRule(this.ruleId)}toString(){let Y=[];return this._writeString(Y,0),"["+Y.join(",")+"]"}_writeString(Y,X){if(this.parent)X=this.parent._writeString(Y,X);return Y[X++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,X}withContentNameScopesList(Y){if(this.contentNameScopesList===Y)return this;return this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,Y)}withEndRule(Y){if(this.endRule===Y)return this;return new Z(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,Y,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(Y){let X=this;while(X&&X._enterPos===Y._enterPos){if(X.ruleId===Y.ruleId)return!0;X=X.parent}return!1}toStateStackFrame(){return{ruleId:$6(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(Y,X){let J=D0.fromExtension(Y?.nameScopesList??null,X.nameScopesList);return new Z(Y,Q6(X.ruleId),X.enterPos??-1,X.anchorPos??-1,X.beginRuleCapturedEOL,X.endRule,J,D0.fromExtension(J,X.contentNameScopesList))}},_7=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(Z,Y){this.balancedBracketScopes=Z.flatMap((X)=>{if(X==="*")return this.allowAny=!0,[];return WY(X,HY).map((J)=>J.matcher)}),this.unbalancedBracketScopes=Y.flatMap((X)=>WY(X,HY).map((J)=>J.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(Z){for(let Y of this.unbalancedBracketScopes)if(Y(Z))return!1;for(let Y of this.balancedBracketScopes)if(Y(Z))return!0;return this.allowAny}},w7=class{constructor(Z,Y,X,J){this.balancedBracketSelectors=J,this._emitBinaryTokens=Z,this._tokenTypeOverrides=X,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(Z,Y){this.produceFromScopes(Z.contentNameScopesList,Y)}produceFromScopes(Z,Y){if(this._lastTokenEndIndex>=Y)return;if(this._emitBinaryTokens){let J=Z?.tokenAttributes??0,Q=!1;if(this.balancedBracketSelectors?.matchesAlways)Q=!0;if(this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let $=Z?.getScopeNames()??[];for(let K of this._tokenTypeOverrides)if(K.matcher($))J=r4.set(J,0,dK(K.type),null,-1,0,0);if(this.balancedBracketSelectors)Q=this.balancedBracketSelectors.match($)}if(Q)J=r4.set(J,0,8,Q,-1,0,0);if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===J){this._lastTokenEndIndex=Y;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(J),this._lastTokenEndIndex=Y;return}let X=Z?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:Y,scopes:X}),this._lastTokenEndIndex=Y}getResult(Z,Y){if(this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===Y-1)this._tokens.pop();if(this._tokens.length===0)this._lastTokenEndIndex=-1,this.produce(Z,Y),this._tokens[this._tokens.length-1].startIndex=0;return this._tokens}getBinaryResult(Z,Y){if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===Y-1)this._binaryTokens.pop(),this._binaryTokens.pop();if(this._binaryTokens.length===0)this._lastTokenEndIndex=-1,this.produce(Z,Y),this._binaryTokens[this._binaryTokens.length-2]=0;let X=new Uint32Array(this._binaryTokens.length);for(let J=0,Q=this._binaryTokens.length;J<Q;J++)X[J]=this._binaryTokens[J];return X}},A7=class{constructor(Z,Y){this._onigLib=Y,this._theme=Z}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let Z of this._grammars.values())Z.dispose()}setTheme(Z){this._theme=Z}getColorMap(){return this._theme.getColorMap()}addGrammar(Z,Y){if(this._rawGrammars.set(Z.scopeName,Z),Y)this._injectionGrammars.set(Z.scopeName,Y)}lookup(Z){return this._rawGrammars.get(Z)}injections(Z){return this._injectionGrammars.get(Z)}getDefaults(){return this._theme.getDefaults()}themeMatch(Z){return this._theme.match(Z)}grammarForScopeName(Z,Y,X,J,Q){if(!this._grammars.has(Z)){let $=this._rawGrammars.get(Z);if(!$)return null;this._grammars.set(Z,F7(Z,$,Y,X,J,Q,this,this._onigLib))}return this._grammars.get(Z)}},G6=class{_options;_syncRegistry;_ensureGrammarCache;constructor(Z){this._options=Z,this._syncRegistry=new A7(V0.createFromRawTheme(Z.theme,Z.colorMap),Z.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(Z,Y){this._syncRegistry.setTheme(V0.createFromRawTheme(Z,Y))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(Z,Y,X){return this.loadGrammarWithConfiguration(Z,Y,{embeddedLanguages:X})}loadGrammarWithConfiguration(Z,Y,X){return this._loadGrammar(Z,Y,X.embeddedLanguages,X.tokenTypes,new _7(X.balancedBracketSelectors||[],X.unbalancedBracketSelectors||[]))}loadGrammar(Z){return this._loadGrammar(Z,0,null,null,null)}_loadGrammar(Z,Y,X,J,Q){let $=new nK(this._syncRegistry,Z);while($.Q.length>0)$.Q.map((K)=>this._loadSingleGrammar(K.scopeName)),$.processQueue();return this._grammarForScopeName(Z,Y,X,J,Q)}_loadSingleGrammar(Z){if(!this._ensureGrammarCache.has(Z))this._doLoadSingleGrammar(Z),this._ensureGrammarCache.set(Z,!0)}_doLoadSingleGrammar(Z){let Y=this._options.loadGrammar(Z);if(Y){let X=typeof this._options.getInjections==="function"?this._options.getInjections(Z):void 0;this._syncRegistry.addGrammar(Y,X)}}addGrammar(Z,Y=[],X=0,J=null){return this._syncRegistry.addGrammar(Z,Y),this._grammarForScopeName(Z.scopeName,X,J)}_grammarForScopeName(Z,Y=0,X=null,J=null,Q=null){return this._syncRegistry.grammarForScopeName(Z,Y,X,J,Q)}},GY=RX.NULL;var O6=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class T4{constructor(Z,Y,X){if(this.normal=Y,this.property=Z,X)this.space=X}}T4.prototype.normal={};T4.prototype.property={};T4.prototype.space=void 0;function vX(Z,Y){let X={},J={};for(let Q of Z)Object.assign(X,Q.property),Object.assign(J,Q.normal);return new T4(X,J,Y)}function j0(Z){return Z.toLowerCase()}class AZ{constructor(Z,Y){this.attribute=Y,this.property=Z}}AZ.prototype.attribute="";AZ.prototype.booleanish=!1;AZ.prototype.boolean=!1;AZ.prototype.commaOrSpaceSeparated=!1;AZ.prototype.commaSeparated=!1;AZ.prototype.defined=!1;AZ.prototype.mustUseProperty=!1;AZ.prototype.number=!1;AZ.prototype.overloadedBoolean=!1;AZ.prototype.property="";AZ.prototype.spaceSeparated=!1;AZ.prototype.space=void 0;var S0={};B7(S0,{spaceSeparated:()=>l,overloadedBoolean:()=>OY,number:()=>I,commaSeparated:()=>f4,commaOrSpaceSeparated:()=>fZ,booleanish:()=>XZ,boolean:()=>y});var L7=0,y=o4(),XZ=o4(),OY=o4(),I=o4(),l=o4(),f4=o4(),fZ=o4();function o4(){return 2**++L7}var IX=Object.keys(S0);class O0 extends AZ{constructor(Z,Y,X,J){let Q=-1;super(Z,Y);if(q6(this,"space",J),typeof X==="number")while(++Q<IX.length){let $=IX[Q];q6(this,IX[Q],(X&S0[$])===S0[$])}}}O0.prototype.defined=!0;function q6(Z,Y,X){if(X)Z[Y]=X}function pZ(Z){let Y={},X={};for(let[J,Q]of Object.entries(Z.properties)){let $=new O0(J,Z.transform(Z.attributes||{},J),Q,Z.space);if(Z.mustUseProperty&&Z.mustUseProperty.includes(J))$.mustUseProperty=!0;Y[J]=$,X[j0(J)]=J,X[j0($.attribute)]=J}return new T4(Y,X,Z.space)}var DX=pZ({properties:{ariaActiveDescendant:null,ariaAtomic:XZ,ariaAutoComplete:null,ariaBusy:XZ,ariaChecked:XZ,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:l,ariaCurrent:null,ariaDescribedBy:l,ariaDetails:null,ariaDisabled:XZ,ariaDropEffect:l,ariaErrorMessage:null,ariaExpanded:XZ,ariaFlowTo:l,ariaGrabbed:XZ,ariaHasPopup:null,ariaHidden:XZ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:l,ariaLevel:I,ariaLive:null,ariaModal:XZ,ariaMultiLine:XZ,ariaMultiSelectable:XZ,ariaOrientation:null,ariaOwns:l,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:XZ,ariaReadOnly:XZ,ariaRelevant:null,ariaRequired:XZ,ariaRoleDescription:l,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:XZ,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(Z,Y){return Y==="role"?Y:"aria-"+Y.slice(4).toLowerCase()}});function qY(Z,Y){return Y in Z?Z[Y]:Y}function FY(Z,Y){return qY(Z,Y.toLowerCase())}var F6=pZ({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:f4,acceptCharset:l,accessKey:l,action:null,allow:null,allowFullScreen:y,allowPaymentRequest:y,allowUserMedia:y,alt:null,as:null,async:y,autoCapitalize:null,autoComplete:l,autoFocus:y,autoPlay:y,blocking:l,capture:null,charSet:null,checked:y,cite:null,className:l,cols:I,colSpan:null,content:null,contentEditable:XZ,controls:y,controlsList:l,coords:I|f4,crossOrigin:null,data:null,dateTime:null,decoding:null,default:y,defer:y,dir:null,dirName:null,disabled:y,download:OY,draggable:XZ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:y,formTarget:null,headers:l,height:I,hidden:OY,high:I,href:null,hrefLang:null,htmlFor:l,httpEquiv:l,id:null,imageSizes:null,imageSrcSet:null,inert:y,inputMode:null,integrity:null,is:null,isMap:y,itemId:null,itemProp:l,itemRef:l,itemScope:y,itemType:l,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:y,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:y,muted:y,name:null,nonce:null,noModule:y,noValidate:y,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:y,optimum:I,pattern:null,ping:l,placeholder:null,playsInline:y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:y,referrerPolicy:null,rel:l,required:y,reversed:y,rows:I,rowSpan:I,sandbox:l,scope:null,scoped:y,seamless:y,selected:y,shadowRootClonable:y,shadowRootDelegatesFocus:y,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:XZ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:y,useMap:null,value:XZ,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:l,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:y,declare:y,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:y,noHref:y,noShade:y,noWrap:y,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:XZ,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:y,disableRemotePlayback:y,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:FY});var M6=pZ({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:fZ,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:l,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:y,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:f4,g2:f4,glyphName:f4,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:fZ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:l,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fZ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fZ,rev:fZ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fZ,requiredFeatures:fZ,requiredFonts:fZ,requiredFormats:fZ,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:fZ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fZ,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fZ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qY});var VX=pZ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(Z,Y){return"xlink:"+Y.slice(5).toLowerCase()}});var EX=pZ({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:FY});var bX=pZ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(Z,Y){return"xml:"+Y.slice(3).toLowerCase()}});var P7=/[A-Z]/g,N6=/-[a-z]/g,R7=/^data[-\w.:]+$/i;function TX(Z,Y){let X=j0(Y),J=Y,Q=AZ;if(X in Z.normal)return Z.property[Z.normal[X]];if(X.length>4&&X.slice(0,4)==="data"&&R7.test(Y)){if(Y.charAt(4)==="-"){let $=Y.slice(5).replace(N6,v7);J="data"+$.charAt(0).toUpperCase()+$.slice(1)}else{let $=Y.slice(4);if(!N6.test($)){let K=$.replace(P7,C7);if(K.charAt(0)!=="-")K="-"+K;Y="data"+K}}Q=O0}return new Q(J,Y)}function C7(Z){return"-"+Z.toLowerCase()}function v7(Z){return Z.charAt(1).toUpperCase()}var _6=vX([DX,F6,VX,EX,bX],"html"),MY=vX([DX,M6,VX,EX,bX],"svg");var w6={}.hasOwnProperty;function A6(Z,Y){let X=Y||{};function J(Q,...$){let{invalid:K,handlers:W}=J;if(Q&&w6.call(Q,Z)){let U=String(Q[Z]);K=w6.call(W,U)?W[U]:J.unknown}if(K)return K.call(this,Q,...$)}return J.handlers=X.handlers||{},J.invalid=X.invalid,J.unknown=X.unknown,J}var I7=/["&'<>`]/g,D7=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,V7=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,E7=/[|\\{}()[\]^$+*?.]/g,B6=new WeakMap;function L6(Z,Y){if(Z=Z.replace(Y.subset?b7(Y.subset):I7,J),Y.subset||Y.escapeOnly)return Z;return Z.replace(D7,X).replace(V7,J);function X(Q,$,K){return Y.format((Q.charCodeAt(0)-55296)*1024+Q.charCodeAt(1)-56320+65536,K.charCodeAt($+2),Y)}function J(Q,$,K){return Y.format(Q.charCodeAt(0),K.charCodeAt($+1),Y)}}function b7(Z){let Y=B6.get(Z);if(!Y)Y=T7(Z),B6.set(Z,Y);return Y}function T7(Z){let Y=[],X=-1;while(++X<Z.length)Y.push(Z[X].replace(E7,"\\$&"));return new RegExp("(?:"+Y.join("|")+")","g")}var f7=/[\dA-Fa-f]/;function P6(Z,Y,X){let J="&#x"+Z.toString(16).toUpperCase();return X&&Y&&!f7.test(String.fromCharCode(Y))?J:J+";"}var j7=/\d/;function R6(Z,Y,X){let J="&#"+String(Z);return X&&Y&&!j7.test(String.fromCharCode(Y))?J:J+";"}var C6=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var NY={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"};var v6=["cent","copy","divide","gt","lt","not","para","times"];var I6={}.hasOwnProperty,fX={},_Y;for(_Y in NY)if(I6.call(NY,_Y))fX[NY[_Y]]=_Y;var S7=/[^\dA-Za-z]/;function D6(Z,Y,X,J){let Q=String.fromCharCode(Z);if(I6.call(fX,Q)){let $=fX[Q],K="&"+$;if(X&&C6.includes($)&&!v6.includes($)&&(!J||Y&&Y!==61&&S7.test(String.fromCharCode(Y))))return K;return K+";"}return""}function V6(Z,Y,X){let J=P6(Z,Y,X.omitOptionalSemicolons),Q;if(X.useNamedReferences||X.useShortestReferences)Q=D6(Z,Y,X.omitOptionalSemicolons,X.attribute);if((X.useShortestReferences||!Q)&&X.useShortestReferences){let $=R6(Z,Y,X.omitOptionalSemicolons);if($.length<J.length)J=$}return Q&&(!X.useShortestReferences||Q.length<J.length)?Q:J}function P4(Z,Y){return L6(Z,Object.assign({format:V6},Y))}var y7=/^>|^->|<!--|-->|--!>|<!-$/g,k7=[">"],h7=["<",">"];function E6(Z,Y,X,J){return J.settings.bogusComments?"<?"+P4(Z.value,Object.assign({},J.settings.characterReferences,{subset:k7}))+">":"<!--"+Z.value.replace(y7,Q)+"-->";function Q($){return P4($,Object.assign({},J.settings.characterReferences,{subset:h7}))}}function b6(Z,Y,X,J){return"<!"+(J.settings.upperDoctype?"DOCTYPE":"doctype")+(J.settings.tightDoctype?"":" ")+"html>"}function jX(Z,Y){let X=String(Z);if(typeof Y!=="string")throw TypeError("Expected character");let J=0,Q=X.indexOf(Y);while(Q!==-1)J++,Q=X.indexOf(Y,Q+Y.length);return J}function T6(Z,Y){let X=Y||{};return(Z[Z.length-1]===""?[...Z,""]:Z).join((X.padRight?" ":"")+","+(X.padLeft===!1?"":" ")).trim()}function f6(Z){return Z.join(" ").trim()}var x7=/[ \t\n\f\r]/g;function n4(Z){return typeof Z==="object"?Z.type==="text"?j6(Z.value):!1:j6(Z)}function j6(Z){return Z.replace(x7,"")===""}var QZ=S6(1),SX=S6(-1),g7=[];function S6(Z){return Y;function Y(X,J,Q){let $=X?X.children:g7,K=(J||0)+Z,W=$[K];if(!Q)while(W&&n4(W))K+=Z,W=$[K];return W}}var u7={}.hasOwnProperty;function wY(Z){return Y;function Y(X,J,Q){return u7.call(Z,X.tagName)&&Z[X.tagName](X,J,Q)}}var y0=wY({body:p7,caption:yX,colgroup:yX,dd:i7,dt:l7,head:yX,html:m7,li:d7,optgroup:r7,option:o7,p:c7,rp:y6,rt:y6,tbody:a7,td:k6,tfoot:s7,th:k6,thead:n7,tr:t7});function yX(Z,Y,X){let J=QZ(X,Y,!0);return!J||J.type!=="comment"&&!(J.type==="text"&&n4(J.value.charAt(0)))}function m7(Z,Y,X){let J=QZ(X,Y);return!J||J.type!=="comment"}function p7(Z,Y,X){let J=QZ(X,Y);return!J||J.type!=="comment"}function c7(Z,Y,X){let J=QZ(X,Y);return J?J.type==="element"&&(J.tagName==="address"||J.tagName==="article"||J.tagName==="aside"||J.tagName==="blockquote"||J.tagName==="details"||J.tagName==="div"||J.tagName==="dl"||J.tagName==="fieldset"||J.tagName==="figcaption"||J.tagName==="figure"||J.tagName==="footer"||J.tagName==="form"||J.tagName==="h1"||J.tagName==="h2"||J.tagName==="h3"||J.tagName==="h4"||J.tagName==="h5"||J.tagName==="h6"||J.tagName==="header"||J.tagName==="hgroup"||J.tagName==="hr"||J.tagName==="main"||J.tagName==="menu"||J.tagName==="nav"||J.tagName==="ol"||J.tagName==="p"||J.tagName==="pre"||J.tagName==="section"||J.tagName==="table"||J.tagName==="ul"):!X||!(X.type==="element"&&(X.tagName==="a"||X.tagName==="audio"||X.tagName==="del"||X.tagName==="ins"||X.tagName==="map"||X.tagName==="noscript"||X.tagName==="video"))}function d7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&J.tagName==="li"}function l7(Z,Y,X){let J=QZ(X,Y);return Boolean(J&&J.type==="element"&&(J.tagName==="dt"||J.tagName==="dd"))}function i7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&(J.tagName==="dt"||J.tagName==="dd")}function y6(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&(J.tagName==="rp"||J.tagName==="rt")}function r7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&J.tagName==="optgroup"}function o7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&(J.tagName==="option"||J.tagName==="optgroup")}function n7(Z,Y,X){let J=QZ(X,Y);return Boolean(J&&J.type==="element"&&(J.tagName==="tbody"||J.tagName==="tfoot"))}function a7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&(J.tagName==="tbody"||J.tagName==="tfoot")}function s7(Z,Y,X){return!QZ(X,Y)}function t7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&J.tagName==="tr"}function k6(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&(J.tagName==="td"||J.tagName==="th")}var h6=wY({body:Y9,colgroup:X9,head:Z9,html:e7,tbody:J9});function e7(Z){let Y=QZ(Z,-1);return!Y||Y.type!=="comment"}function Z9(Z){let Y=new Set;for(let J of Z.children)if(J.type==="element"&&(J.tagName==="base"||J.tagName==="title")){if(Y.has(J.tagName))return!1;Y.add(J.tagName)}let X=Z.children[0];return!X||X.type==="element"}function Y9(Z){let Y=QZ(Z,-1,!0);return!Y||Y.type!=="comment"&&!(Y.type==="text"&&n4(Y.value.charAt(0)))&&!(Y.type==="element"&&(Y.tagName==="meta"||Y.tagName==="link"||Y.tagName==="script"||Y.tagName==="style"||Y.tagName==="template"))}function X9(Z,Y,X){let J=SX(X,Y),Q=QZ(Z,-1,!0);if(X&&J&&J.type==="element"&&J.tagName==="colgroup"&&y0(J,X.children.indexOf(J),X))return!1;return Boolean(Q&&Q.type==="element"&&Q.tagName==="col")}function J9(Z,Y,X){let J=SX(X,Y),Q=QZ(Z,-1);if(X&&J&&J.type==="element"&&(J.tagName==="thead"||J.tagName==="tbody")&&y0(J,X.children.indexOf(J),X))return!1;return Boolean(Q&&Q.type==="element"&&Q.tagName==="tr")}var AY={name:[[`
129
+ `}strong({tokens:Z}){return`<strong>${this.parser.parseInline(Z)}</strong>`}em({tokens:Z}){return`<em>${this.parser.parseInline(Z)}</em>`}codespan({text:Z}){return`<code>${q4(Z,!0)}</code>`}br(Z){return"<br>"}del({tokens:Z}){return`<del>${this.parser.parseInline(Z)}</del>`}link({href:Z,title:Y,tokens:X}){let J=this.parser.parseInline(X),Q=C5(Z);if(Q===null)return J;Z=Q;let $='<a href="'+Z+'"';return Y&&($+=' title="'+q4(Y)+'"'),$+=">"+J+"</a>",$}image({href:Z,title:Y,text:X,tokens:J}){J&&(X=this.parser.parseInline(J,this.parser.textRenderer));let Q=C5(Z);if(Q===null)return q4(X);Z=Q;let $=`<img src="${Z}" alt="${X}"`;return Y&&($+=` title="${q4(Y)}"`),$+=">",$}text(Z){return"tokens"in Z&&Z.tokens?this.parser.parseInline(Z.tokens):("escaped"in Z)&&Z.escaped?Z.text:q4(Z.text)}},_X=class{strong({text:Z}){return Z}em({text:Z}){return Z}codespan({text:Z}){return Z}del({text:Z}){return Z}html({text:Z}){return Z}text({text:Z}){return Z}link({text:Z}){return""+Z}image({text:Z}){return""+Z}br(){return""}},sZ=class Z{options;renderer;textRenderer;constructor(Y){this.options=Y||r4,this.options.renderer=this.options.renderer||new JY,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _X}static parse(Y,X){return new Z(X).parse(Y)}static parseInline(Y,X){return new Z(X).parseInline(Y)}parse(Y,X=!0){let J="";for(let Q=0;Q<Y.length;Q++){let $=Y[Q];if(this.options.extensions?.renderers?.[$.type]){let U=$,W=this.options.extensions.renderers[U.type].call({parser:this},U);if(W!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(U.type)){J+=W||"";continue}}let K=$;switch(K.type){case"space":{J+=this.renderer.space(K);continue}case"hr":{J+=this.renderer.hr(K);continue}case"heading":{J+=this.renderer.heading(K);continue}case"code":{J+=this.renderer.code(K);continue}case"table":{J+=this.renderer.table(K);continue}case"blockquote":{J+=this.renderer.blockquote(K);continue}case"list":{J+=this.renderer.list(K);continue}case"html":{J+=this.renderer.html(K);continue}case"def":{J+=this.renderer.def(K);continue}case"paragraph":{J+=this.renderer.paragraph(K);continue}case"text":{let U=K,W=this.renderer.text(U);for(;Q+1<Y.length&&Y[Q+1].type==="text";)U=Y[++Q],W+=`
130
+ `+this.renderer.text(U);X?J+=this.renderer.paragraph({type:"paragraph",raw:W,text:W,tokens:[{type:"text",raw:W,text:W,escaped:!0}]}):J+=W;continue}default:{let U='Token with "'+K.type+'" type was not found.';if(this.options.silent)return console.error(U),"";throw Error(U)}}}return J}parseInline(Y,X=this.renderer){let J="";for(let Q=0;Q<Y.length;Q++){let $=Y[Q];if(this.options.extensions?.renderers?.[$.type]){let U=this.options.extensions.renderers[$.type].call({parser:this},$);if(U!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes($.type)){J+=U||"";continue}}let K=$;switch(K.type){case"escape":{J+=X.text(K);break}case"html":{J+=X.html(K);break}case"link":{J+=X.link(K);break}case"image":{J+=X.image(K);break}case"strong":{J+=X.strong(K);break}case"em":{J+=X.em(K);break}case"codespan":{J+=X.codespan(K);break}case"br":{J+=X.br(K);break}case"del":{J+=X.del(K);break}case"text":{J+=X.text(K);break}default:{let U='Token with "'+K.type+'" type was not found.';if(this.options.silent)return console.error(U),"";throw Error(U)}}}return J}},P0=class{options;block;constructor(Z){this.options=Z||r4}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(Z){return Z}postprocess(Z){return Z}processAllTokens(Z){return Z}emStrongMask(Z){return Z}provideLexer(){return this.block?aZ.lex:aZ.lexInline}provideParser(){return this.block?sZ.parse:sZ.parseInline}},fK=class{defaults=zX();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=sZ;Renderer=JY;TextRenderer=_X;Lexer=aZ;Tokenizer=XY;Hooks=P0;constructor(...Z){this.use(...Z)}walkTokens(Z,Y){let X=[];for(let J of Z)switch(X=X.concat(Y.call(this,J)),J.type){case"table":{let Q=J;for(let $ of Q.header)X=X.concat(this.walkTokens($.tokens,Y));for(let $ of Q.rows)for(let K of $)X=X.concat(this.walkTokens(K.tokens,Y));break}case"list":{let Q=J;X=X.concat(this.walkTokens(Q.items,Y));break}default:{let Q=J;this.defaults.extensions?.childTokens?.[Q.type]?this.defaults.extensions.childTokens[Q.type].forEach(($)=>{let K=Q[$].flat(1/0);X=X.concat(this.walkTokens(K,Y))}):Q.tokens&&(X=X.concat(this.walkTokens(Q.tokens,Y)))}}return X}use(...Z){let Y=this.defaults.extensions||{renderers:{},childTokens:{}};return Z.forEach((X)=>{let J={...X};if(J.async=this.defaults.async||J.async||!1,X.extensions&&(X.extensions.forEach((Q)=>{if(!Q.name)throw Error("extension name required");if("renderer"in Q){let $=Y.renderers[Q.name];$?Y.renderers[Q.name]=function(...K){let U=Q.renderer.apply(this,K);return U===!1&&(U=$.apply(this,K)),U}:Y.renderers[Q.name]=Q.renderer}if("tokenizer"in Q){if(!Q.level||Q.level!=="block"&&Q.level!=="inline")throw Error("extension level must be 'block' or 'inline'");let $=Y[Q.level];$?$.unshift(Q.tokenizer):Y[Q.level]=[Q.tokenizer],Q.start&&(Q.level==="block"?Y.startBlock?Y.startBlock.push(Q.start):Y.startBlock=[Q.start]:Q.level==="inline"&&(Y.startInline?Y.startInline.push(Q.start):Y.startInline=[Q.start]))}"childTokens"in Q&&Q.childTokens&&(Y.childTokens[Q.name]=Q.childTokens)}),J.extensions=Y),X.renderer){let Q=this.defaults.renderer||new JY(this.defaults);for(let $ in X.renderer){if(!($ in Q))throw Error(`renderer '${$}' does not exist`);if(["options","parser"].includes($))continue;let K=$,U=X.renderer[K],W=Q[K];Q[K]=(...z)=>{let H=U.apply(Q,z);return H===!1&&(H=W.apply(Q,z)),H||""}}J.renderer=Q}if(X.tokenizer){let Q=this.defaults.tokenizer||new XY(this.defaults);for(let $ in X.tokenizer){if(!($ in Q))throw Error(`tokenizer '${$}' does not exist`);if(["options","rules","lexer"].includes($))continue;let K=$,U=X.tokenizer[K],W=Q[K];Q[K]=(...z)=>{let H=U.apply(Q,z);return H===!1&&(H=W.apply(Q,z)),H}}J.tokenizer=Q}if(X.hooks){let Q=this.defaults.hooks||new P0;for(let $ in X.hooks){if(!($ in Q))throw Error(`hook '${$}' does not exist`);if(["options","block"].includes($))continue;let K=$,U=X.hooks[K],W=Q[K];P0.passThroughHooks.has($)?Q[K]=(z)=>{if(this.defaults.async&&P0.passThroughHooksRespectAsync.has($))return(async()=>{let G=await U.call(Q,z);return W.call(Q,G)})();let H=U.call(Q,z);return W.call(Q,H)}:Q[K]=(...z)=>{if(this.defaults.async)return(async()=>{let G=await U.apply(Q,z);return G===!1&&(G=await W.apply(Q,z)),G})();let H=U.apply(Q,z);return H===!1&&(H=W.apply(Q,z)),H}}J.hooks=Q}if(X.walkTokens){let Q=this.defaults.walkTokens,$=X.walkTokens;J.walkTokens=function(K){let U=[];return U.push($.call(this,K)),Q&&(U=U.concat(Q.call(this,K))),U}}this.defaults={...this.defaults,...J}}),this}setOptions(Z){return this.defaults={...this.defaults,...Z},this}lexer(Z,Y){return aZ.lex(Z,Y??this.defaults)}parser(Z,Y){return sZ.parse(Z,Y??this.defaults)}parseMarkdown(Z){return(Y,X)=>{let J={...X},Q={...this.defaults,...J},$=this.onError(!!Q.silent,!!Q.async);if(this.defaults.async===!0&&J.async===!1)return $(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 Y>"u"||Y===null)return $(Error("marked(): input parameter is undefined or null"));if(typeof Y!="string")return $(Error("marked(): input parameter is of type "+Object.prototype.toString.call(Y)+", string expected"));if(Q.hooks&&(Q.hooks.options=Q,Q.hooks.block=Z),Q.async)return(async()=>{let K=Q.hooks?await Q.hooks.preprocess(Y):Y,U=await(Q.hooks?await Q.hooks.provideLexer():Z?aZ.lex:aZ.lexInline)(K,Q),W=Q.hooks?await Q.hooks.processAllTokens(U):U;Q.walkTokens&&await Promise.all(this.walkTokens(W,Q.walkTokens));let z=await(Q.hooks?await Q.hooks.provideParser():Z?sZ.parse:sZ.parseInline)(W,Q);return Q.hooks?await Q.hooks.postprocess(z):z})().catch($);try{Q.hooks&&(Y=Q.hooks.preprocess(Y));let K=(Q.hooks?Q.hooks.provideLexer():Z?aZ.lex:aZ.lexInline)(Y,Q);Q.hooks&&(K=Q.hooks.processAllTokens(K)),Q.walkTokens&&this.walkTokens(K,Q.walkTokens);let U=(Q.hooks?Q.hooks.provideParser():Z?sZ.parse:sZ.parseInline)(K,Q);return Q.hooks&&(U=Q.hooks.postprocess(U)),U}catch(K){return $(K)}}}onError(Z,Y){return(X)=>{if(X.message+=`
131
+ Please report this to https://github.com/markedjs/marked.`,Z){let J="<p>An error occurred:</p><pre>"+q4(X.message+"",!0)+"</pre>";return Y?Promise.resolve(J):J}if(Y)return Promise.reject(X);throw X}}},i4=new fK;function c(Z,Y){return i4.parse(Z,Y)}c.options=c.setOptions=function(Z){return i4.setOptions(Z),c.defaults=i4.defaults,D5(c.defaults),c};c.getDefaults=zX;c.defaults=r4;c.use=function(...Z){return i4.use(...Z),c.defaults=i4.defaults,D5(c.defaults),c};c.walkTokens=function(Z,Y){return i4.walkTokens(Z,Y)};c.parseInline=i4.parseInline;c.Parser=sZ;c.parser=sZ.parse;c.Renderer=JY;c.TextRenderer=_X;c.Lexer=aZ;c.lexer=aZ.lex;c.Tokenizer=XY;c.Hooks=P0;c.parse=c;var{options:lG,setOptions:iG,use:rG,walkTokens:oG,parseInline:nG}=c;var aG=sZ.parse,sG=aZ.lex;var pZ=P(g(),1);class YZ extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function jK(Z){return IX(Z)}function IX(Z){if(Array.isArray(Z))return SK(Z);if(Z instanceof RegExp)return Z;if(typeof Z==="object")return yK(Z);return Z}function SK(Z){let Y=[];for(let X=0,J=Z.length;X<J;X++)Y[X]=IX(Z[X]);return Y}function yK(Z){let Y={};for(let X in Z)Y[X]=IX(Z[X]);return Y}function i5(Z,...Y){return Y.forEach((X)=>{for(let J in X)Z[J]=X[J]}),Z}function r5(Z){let Y=~Z.lastIndexOf("/")||~Z.lastIndexOf("\\");if(Y===0)return Z;else if(~Y===Z.length-1)return r5(Z.substring(0,Z.length-1));else return Z.substr(~Y+1)}var AX=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,KY=class{static hasCaptures(Z){if(Z===null)return!1;return AX.lastIndex=0,AX.test(Z)}static replaceCaptures(Z,Y,X){return Z.replace(AX,(J,Q,$,K)=>{let U=X[parseInt(Q||$,10)];if(U){let W=Y.substring(U.start,U.end);while(W[0]===".")W=W.substring(1);switch(K){case"downcase":return W.toLowerCase();case"upcase":return W.toUpperCase();default:return W}}else return J})}};function o5(Z,Y){if(Z<Y)return-1;if(Z>Y)return 1;return 0}function n5(Z,Y){if(Z===null&&Y===null)return 0;if(!Z)return-1;if(!Y)return 1;let X=Z.length,J=Y.length;if(X===J){for(let Q=0;Q<X;Q++){let $=o5(Z[Q],Y[Q]);if($!==0)return $}return 0}return X-J}function x5(Z){if(/^#[0-9a-f]{6}$/i.test(Z))return!0;if(/^#[0-9a-f]{8}$/i.test(Z))return!0;if(/^#[0-9a-f]{3}$/i.test(Z))return!0;if(/^#[0-9a-f]{4}$/i.test(Z))return!0;return!1}function a5(Z){return Z.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var s5=class{constructor(Z){this.fn=Z}cache=new Map;get(Z){if(this.cache.has(Z))return this.cache.get(Z);let Y=this.fn(Z);return this.cache.set(Z,Y),Y}},D0=class{constructor(Z,Y,X){this._colorMap=Z,this._defaults=Y,this._root=X}static createFromRawTheme(Z,Y){return this.createFromParsedTheme(xK(Z),Y)}static createFromParsedTheme(Z,Y){return uK(Z,Y)}_cachedMatchRoot=new s5((Z)=>this._root.match(Z));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(Z){if(Z===null)return this._defaults;let Y=Z.scopeName,J=this._cachedMatchRoot.get(Y).find((Q)=>kK(Z.parent,Q.parentScopes));if(!J)return null;return new t5(J.fontStyle,J.foreground,J.background)}},wX=class Z{constructor(Y,X){this.parent=Y,this.scopeName=X}static push(Y,X){for(let J of X)Y=new Z(Y,J);return Y}static from(...Y){let X=null;for(let J=0;J<Y.length;J++)X=new Z(X,Y[J]);return X}push(Y){return new Z(this,Y)}getSegments(){let Y=this,X=[];while(Y)X.push(Y.scopeName),Y=Y.parent;return X.reverse(),X}toString(){return this.getSegments().join(" ")}extends(Y){if(this===Y)return!0;if(this.parent===null)return!1;return this.parent.extends(Y)}getExtensionIfDefined(Y){let X=[],J=this;while(J&&J!==Y)X.push(J.scopeName),J=J.parent;return J===Y?X.reverse():void 0}};function kK(Z,Y){if(Y.length===0)return!0;for(let X=0;X<Y.length;X++){let J=Y[X],Q=!1;if(J===">"){if(X===Y.length-1)return!1;J=Y[++X],Q=!0}while(Z){if(hK(Z.scopeName,J))break;if(Q)return!1;Z=Z.parent}if(!Z)return!1;Z=Z.parent}return!0}function hK(Z,Y){return Y===Z||Z.startsWith(Y)&&Z[Y.length]==="."}var t5=class{constructor(Z,Y,X){this.fontStyle=Z,this.foregroundId=Y,this.backgroundId=X}};function xK(Z){if(!Z)return[];if(!Z.settings||!Array.isArray(Z.settings))return[];let Y=Z.settings,X=[],J=0;for(let Q=0,$=Y.length;Q<$;Q++){let K=Y[Q];if(!K.settings)continue;let U;if(typeof K.scope==="string"){let G=K.scope;G=G.replace(/^[,]+/,""),G=G.replace(/[,]+$/,""),U=G.split(",")}else if(Array.isArray(K.scope))U=K.scope;else U=[""];let W=-1;if(typeof K.settings.fontStyle==="string"){W=0;let G=K.settings.fontStyle.split(" ");for(let F=0,M=G.length;F<M;F++)switch(G[F]){case"italic":W=W|1;break;case"bold":W=W|2;break;case"underline":W=W|4;break;case"strikethrough":W=W|8;break}}let z=null;if(typeof K.settings.foreground==="string"&&x5(K.settings.foreground))z=K.settings.foreground;let H=null;if(typeof K.settings.background==="string"&&x5(K.settings.background))H=K.settings.background;for(let G=0,F=U.length;G<F;G++){let N=U[G].trim().split(" "),w=N[N.length-1],L=null;if(N.length>1)L=N.slice(0,N.length-1),L.reverse();X[J++]=new gK(w,L,Q,W,z,H)}}return X}var gK=class{constructor(Z,Y,X,J,Q,$){this.scope=Z,this.parentScopes=Y,this.index=X,this.fontStyle=J,this.foreground=Q,this.background=$}},GZ=((Z)=>{return Z[Z.NotSet=-1]="NotSet",Z[Z.None=0]="None",Z[Z.Italic=1]="Italic",Z[Z.Bold=2]="Bold",Z[Z.Underline=4]="Underline",Z[Z.Strikethrough=8]="Strikethrough",Z})(GZ||{});function uK(Z,Y){Z.sort((W,z)=>{let H=o5(W.scope,z.scope);if(H!==0)return H;if(H=n5(W.parentScopes,z.parentScopes),H!==0)return H;return W.index-z.index});let X=0,J="#000000",Q="#ffffff";while(Z.length>=1&&Z[0].scope===""){let W=Z.shift();if(W.fontStyle!==-1)X=W.fontStyle;if(W.foreground!==null)J=W.foreground;if(W.background!==null)Q=W.background}let $=new mK(Y),K=new t5(X,$.getId(J),$.getId(Q)),U=new dK(new LX(0,null,-1,0,0),[]);for(let W=0,z=Z.length;W<z;W++){let H=Z[W];U.insert(0,H.scope,H.parentScopes,H.fontStyle,$.getId(H.foreground),$.getId(H.background))}return new D0($,K,U)}var mK=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(Z){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(Z)){this._isFrozen=!0;for(let Y=0,X=Z.length;Y<X;Y++)this._color2id[Z[Y]]=Y,this._id2color[Y]=Z[Y]}else this._isFrozen=!1}getId(Z){if(Z===null)return 0;Z=Z.toUpperCase();let Y=this._color2id[Z];if(Y)return Y;if(this._isFrozen)throw Error(`Missing color in color map - ${Z}`);return Y=++this._lastColorId,this._color2id[Z]=Y,this._id2color[Y]=Z,Y}getColorMap(){return this._id2color.slice(0)}},pK=Object.freeze([]),LX=class Z{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(Y,X,J,Q,$){this.scopeDepth=Y,this.parentScopes=X||pK,this.fontStyle=J,this.foreground=Q,this.background=$}clone(){return new Z(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(Y){let X=[];for(let J=0,Q=Y.length;J<Q;J++)X[J]=Y[J].clone();return X}acceptOverwrite(Y,X,J,Q){if(this.scopeDepth>Y)console.log("how did this happen?");else this.scopeDepth=Y;if(X!==-1)this.fontStyle=X;if(J!==0)this.foreground=J;if(Q!==0)this.background=Q}},dK=class Z{constructor(Y,X=[],J={}){this._mainRule=Y,this._children=J,this._rulesWithParentScopes=X}_rulesWithParentScopes;static _cmpBySpecificity(Y,X){if(Y.scopeDepth!==X.scopeDepth)return X.scopeDepth-Y.scopeDepth;let J=0,Q=0;while(!0){if(Y.parentScopes[J]===">")J++;if(X.parentScopes[Q]===">")Q++;if(J>=Y.parentScopes.length||Q>=X.parentScopes.length)break;let $=X.parentScopes[Q].length-Y.parentScopes[J].length;if($!==0)return $;J++,Q++}return X.parentScopes.length-Y.parentScopes.length}match(Y){if(Y!==""){let J=Y.indexOf("."),Q,$;if(J===-1)Q=Y,$="";else Q=Y.substring(0,J),$=Y.substring(J+1);if(this._children.hasOwnProperty(Q))return this._children[Q].match($)}let X=this._rulesWithParentScopes.concat(this._mainRule);return X.sort(Z._cmpBySpecificity),X}insert(Y,X,J,Q,$,K){if(X===""){this._doInsertHere(Y,J,Q,$,K);return}let U=X.indexOf("."),W,z;if(U===-1)W=X,z="";else W=X.substring(0,U),z=X.substring(U+1);let H;if(this._children.hasOwnProperty(W))H=this._children[W];else H=new Z(this._mainRule.clone(),LX.cloneArr(this._rulesWithParentScopes)),this._children[W]=H;H.insert(Y+1,z,J,Q,$,K)}_doInsertHere(Y,X,J,Q,$){if(X===null){this._mainRule.acceptOverwrite(Y,J,Q,$);return}for(let K=0,U=this._rulesWithParentScopes.length;K<U;K++){let W=this._rulesWithParentScopes[K];if(n5(W.parentScopes,X)===0){W.acceptOverwrite(Y,J,Q,$);return}}if(J===-1)J=this._mainRule.fontStyle;if(Q===0)Q=this._mainRule.foreground;if($===0)$=this._mainRule.background;this._rulesWithParentScopes.push(new LX(Y,X,J,Q,$))}},o4=class Z{static toBinaryStr(Y){return Y.toString(2).padStart(32,"0")}static print(Y){let X=Z.getLanguageId(Y),J=Z.getTokenType(Y),Q=Z.getFontStyle(Y),$=Z.getForeground(Y),K=Z.getBackground(Y);console.log({languageId:X,tokenType:J,fontStyle:Q,foreground:$,background:K})}static getLanguageId(Y){return(Y&255)>>>0}static getTokenType(Y){return(Y&768)>>>8}static containsBalancedBrackets(Y){return(Y&1024)!==0}static getFontStyle(Y){return(Y&30720)>>>11}static getForeground(Y){return(Y&16744448)>>>15}static getBackground(Y){return(Y&4278190080)>>>24}static set(Y,X,J,Q,$,K,U){let W=Z.getLanguageId(Y),z=Z.getTokenType(Y),H=Z.containsBalancedBrackets(Y)?1:0,G=Z.getFontStyle(Y),F=Z.getForeground(Y),M=Z.getBackground(Y);if(X!==0)W=X;if(J!==8)z=lK(J);if(Q!==null)H=Q?1:0;if($!==-1)G=$;if(K!==0)F=K;if(U!==0)M=U;return(W<<0|z<<8|H<<10|G<<11|F<<15|M<<24)>>>0}};function cK(Z){return Z}function lK(Z){return Z}function UY(Z,Y){let X=[],J=iK(Z),Q=J.next();while(Q!==null){let W=0;if(Q.length===2&&Q.charAt(1)===":"){switch(Q.charAt(0)){case"R":W=1;break;case"L":W=-1;break;default:console.log(`Unknown priority ${Q} in scope selector`)}Q=J.next()}let z=K();if(X.push({matcher:z,priority:W}),Q!==",")break;Q=J.next()}return X;function $(){if(Q==="-"){Q=J.next();let W=$();return(z)=>!!W&&!W(z)}if(Q==="("){Q=J.next();let W=U();if(Q===")")Q=J.next();return W}if(g5(Q)){let W=[];do W.push(Q),Q=J.next();while(g5(Q));return(z)=>Y(W,z)}return null}function K(){let W=[],z=$();while(z)W.push(z),z=$();return(H)=>W.every((G)=>G(H))}function U(){let W=[],z=K();while(z){if(W.push(z),Q==="|"||Q===",")do Q=J.next();while(Q==="|"||Q===",");else break;z=K()}return(H)=>W.some((G)=>G(H))}}function g5(Z){return!!Z&&!!Z.match(/[\w\.:]+/)}function iK(Z){let Y=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,X=Y.exec(Z);return{next:()=>{if(!X)return null;let J=X[0];return X=Y.exec(Z),J}}}function e5(Z){if(typeof Z.dispose==="function")Z.dispose()}var V0=class{constructor(Z){this.scopeName=Z}toKey(){return this.scopeName}},rK=class{constructor(Z,Y){this.scopeName=Z,this.ruleName=Y}toKey(){return`${this.scopeName}#${this.ruleName}`}},oK=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(Z){let Y=Z.toKey();if(this._seenReferenceKeys.has(Y))return;this._seenReferenceKeys.add(Y),this._references.push(Z)}},nK=class{constructor(Z,Y){this.repo=Z,this.initialScopeName=Y,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new V0(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let Z=this.Q;this.Q=[];let Y=new oK;for(let X of Z)aK(X,this.initialScopeName,this.repo,Y);for(let X of Y.references)if(X instanceof V0){if(this.seenFullScopeRequests.has(X.scopeName))continue;this.seenFullScopeRequests.add(X.scopeName),this.Q.push(X)}else{if(this.seenFullScopeRequests.has(X.scopeName))continue;if(this.seenPartialScopeRequests.has(X.toKey()))continue;this.seenPartialScopeRequests.add(X.toKey()),this.Q.push(X)}}};function aK(Z,Y,X,J){let Q=X.lookup(Z.scopeName);if(!Q){if(Z.scopeName===Y)throw Error(`No grammar provided for <${Y}>`);return}let $=X.lookup(Y);if(Z instanceof V0)WY({baseGrammar:$,selfGrammar:Q},J);else PX(Z.ruleName,{baseGrammar:$,selfGrammar:Q,repository:Q.repository},J);let K=X.injections(Z.scopeName);if(K)for(let U of K)J.add(new V0(U))}function PX(Z,Y,X){if(Y.repository&&Y.repository[Z]){let J=Y.repository[Z];zY([J],Y,X)}}function WY(Z,Y){if(Z.selfGrammar.patterns&&Array.isArray(Z.selfGrammar.patterns))zY(Z.selfGrammar.patterns,{...Z,repository:Z.selfGrammar.repository},Y);if(Z.selfGrammar.injections)zY(Object.values(Z.selfGrammar.injections),{...Z,repository:Z.selfGrammar.repository},Y)}function zY(Z,Y,X){for(let J of Z){if(X.visitedRule.has(J))continue;X.visitedRule.add(J);let Q=J.repository?i5({},Y.repository,J.repository):Y.repository;if(Array.isArray(J.patterns))zY(J.patterns,{...Y,repository:Q},X);let $=J.include;if(!$)continue;let K=Z6($);switch(K.kind){case 0:WY({...Y,selfGrammar:Y.baseGrammar},X);break;case 1:WY(Y,X);break;case 2:PX(K.ruleName,{...Y,repository:Q},X);break;case 3:case 4:let U=K.scopeName===Y.selfGrammar.scopeName?Y.selfGrammar:K.scopeName===Y.baseGrammar.scopeName?Y.baseGrammar:void 0;if(U){let W={baseGrammar:Y.baseGrammar,selfGrammar:U,repository:Q};if(K.kind===4)PX(K.ruleName,W,X);else WY(W,X)}else if(K.kind===4)X.add(new rK(K.scopeName,K.ruleName));else X.add(new V0(K.scopeName));break}}}var sK=class{kind=0},tK=class{kind=1},eK=class{constructor(Z){this.ruleName=Z}kind=2},Z7=class{constructor(Z){this.scopeName=Z}kind=3},Y7=class{constructor(Z,Y){this.scopeName=Z,this.ruleName=Y}kind=4};function Z6(Z){if(Z==="$base")return new sK;else if(Z==="$self")return new tK;let Y=Z.indexOf("#");if(Y===-1)return new Z7(Z);else if(Y===0)return new eK(Z.substring(1));else{let X=Z.substring(0,Y),J=Z.substring(Y+1);return new Y7(X,J)}}var X7=/\\(\d+)/,u5=/\\(\d+)/g,$O=Symbol("RuleId"),J7=-1,Y6=-2;function X6(Z){return Z}function J6(Z){return Z}var T0=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(Z,Y,X,J){this.$location=Z,this.id=Y,this._name=X||null,this._nameIsCapturing=KY.hasCaptures(this._name),this._contentName=J||null,this._contentNameIsCapturing=KY.hasCaptures(this._contentName)}get debugName(){let Z=this.$location?`${r5(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${Z}`}getName(Z,Y){if(!this._nameIsCapturing||this._name===null||Z===null||Y===null)return this._name;return KY.replaceCaptures(this._name,Z,Y)}getContentName(Z,Y){if(!this._contentNameIsCapturing||this._contentName===null)return this._contentName;return KY.replaceCaptures(this._contentName,Z,Y)}},Q7=class extends T0{retokenizeCapturedWithRuleId;constructor(Z,Y,X,J,Q){super(Z,Y,X,J);this.retokenizeCapturedWithRuleId=Q}dispose(){}collectPatterns(Z,Y){throw Error("Not supported!")}compile(Z,Y){throw Error("Not supported!")}compileAG(Z,Y,X,J){throw Error("Not supported!")}},$7=class extends T0{_match;captures;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q){super(Z,Y,X,null);this._match=new E0(J,this.id),this.captures=Q,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(Z,Y){Y.push(this._match)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new b0,this.collectPatterns(Z,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},m5=class extends T0{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q){super(Z,Y,X,J);this.patterns=Q.patterns,this.hasMissingPatterns=Q.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}collectPatterns(Z,Y){for(let X of this.patterns)Z.getRule(X).collectPatterns(Z,Y)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new b0,this.collectPatterns(Z,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},RX=class extends T0{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q,$,K,U,W,z){super(Z,Y,X,J);this._begin=new E0(Q,this.id),this.beginCaptures=$,this._end=new E0(K?K:"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=U,this.applyEndPatternLast=W||!1,this.patterns=z.patterns,this.hasMissingPatterns=z.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(Z,Y){return this._end.resolveBackReferences(Z,Y)}collectPatterns(Z,Y){Y.push(this._begin)}compile(Z,Y){return this._getCachedCompiledPatterns(Z,Y).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z,Y).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z,Y){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new b0;for(let X of this.patterns)Z.getRule(X).collectPatterns(Z,this._cachedCompiledPatterns);if(this.applyEndPatternLast)this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end);else this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}if(this._end.hasBackReferences)if(this.applyEndPatternLast)this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,Y);else this._cachedCompiledPatterns.setSource(0,Y);return this._cachedCompiledPatterns}},HY=class extends T0{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(Z,Y,X,J,Q,$,K,U,W){super(Z,Y,X,J);this._begin=new E0(Q,this.id),this.beginCaptures=$,this.whileCaptures=U,this._while=new E0(K,Y6),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=W.patterns,this.hasMissingPatterns=W.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null;if(this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(Z,Y){return this._while.resolveBackReferences(Z,Y)}collectPatterns(Z,Y){Y.push(this._begin)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new b0;for(let Y of this.patterns)Z.getRule(Y).collectPatterns(Z,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(Z,Y){return this._getCachedCompiledWhilePatterns(Z,Y).compile(Z)}compileWhileAG(Z,Y,X,J){return this._getCachedCompiledWhilePatterns(Z,Y).compileAG(Z,X,J)}_getCachedCompiledWhilePatterns(Z,Y){if(!this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns=new b0,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while);if(this._while.hasBackReferences)this._cachedCompiledWhilePatterns.setSource(0,Y?Y:"￿");return this._cachedCompiledWhilePatterns}},Q6=class Z{static createCaptureRule(Y,X,J,Q,$){return Y.registerRule((K)=>{return new Q7(X,K,J,Q,$)})}static getCompiledRuleId(Y,X,J){if(!Y.id)X.registerRule((Q)=>{if(Y.id=Q,Y.match)return new $7(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.match,Z._compileCaptures(Y.captures,X,J));if(typeof Y.begin>"u"){if(Y.repository)J=i5({},J,Y.repository);let $=Y.patterns;if(typeof $>"u"&&Y.include)$=[{include:Y.include}];return new m5(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Z._compilePatterns($,X,J))}if(Y.while)return new HY(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Y.begin,Z._compileCaptures(Y.beginCaptures||Y.captures,X,J),Y.while,Z._compileCaptures(Y.whileCaptures||Y.captures,X,J),Z._compilePatterns(Y.patterns,X,J));return new RX(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Y.begin,Z._compileCaptures(Y.beginCaptures||Y.captures,X,J),Y.end,Z._compileCaptures(Y.endCaptures||Y.captures,X,J),Y.applyEndPatternLast,Z._compilePatterns(Y.patterns,X,J))});return Y.id}static _compileCaptures(Y,X,J){let Q=[];if(Y){let $=0;for(let K in Y){if(K==="$vscodeTextmateLocation")continue;let U=parseInt(K,10);if(U>$)$=U}for(let K=0;K<=$;K++)Q[K]=null;for(let K in Y){if(K==="$vscodeTextmateLocation")continue;let U=parseInt(K,10),W=0;if(Y[K].patterns)W=Z.getCompiledRuleId(Y[K],X,J);Q[U]=Z.createCaptureRule(X,Y[K].$vscodeTextmateLocation,Y[K].name,Y[K].contentName,W)}}return Q}static _compilePatterns(Y,X,J){let Q=[];if(Y)for(let $=0,K=Y.length;$<K;$++){let U=Y[$],W=-1;if(U.include){let z=Z6(U.include);switch(z.kind){case 0:case 1:W=Z.getCompiledRuleId(J[U.include],X,J);break;case 2:let H=J[z.ruleName];if(H)W=Z.getCompiledRuleId(H,X,J);break;case 3:case 4:let G=z.scopeName,F=z.kind===4?z.ruleName:null,M=X.getExternalGrammar(G,J);if(M)if(F){let N=M.repository[F];if(N)W=Z.getCompiledRuleId(N,X,M.repository)}else W=Z.getCompiledRuleId(M.repository.$self,X,M.repository);break}}else W=Z.getCompiledRuleId(U,X,J);if(W!==-1){let z=X.getRule(W),H=!1;if(z instanceof m5||z instanceof RX||z instanceof HY){if(z.hasMissingPatterns&&z.patterns.length===0)H=!0}if(H)continue;Q.push(W)}}return{patterns:Q,hasMissingPatterns:(Y?Y.length:0)!==Q.length}}},E0=class Z{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(Y,X){if(Y&&typeof Y==="string"){let J=Y.length,Q=0,$=[],K=!1;for(let U=0;U<J;U++)if(Y.charAt(U)==="\\"){if(U+1<J){let z=Y.charAt(U+1);if(z==="z")$.push(Y.substring(Q,U)),$.push("$(?!\\n)(?<!\\n)"),Q=U+2;else if(z==="A"||z==="G")K=!0;U++}}if(this.hasAnchor=K,Q===0)this.source=Y;else $.push(Y.substring(Q,J)),this.source=$.join("")}else this.hasAnchor=!1,this.source=Y;if(this.hasAnchor)this._anchorCache=this._buildAnchorCache();else this._anchorCache=null;if(this.ruleId=X,typeof this.source==="string")this.hasBackReferences=X7.test(this.source);else this.hasBackReferences=!1}clone(){return new Z(this.source,this.ruleId)}setSource(Y){if(this.source===Y)return;if(this.source=Y,this.hasAnchor)this._anchorCache=this._buildAnchorCache()}resolveBackReferences(Y,X){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let J=X.map((Q)=>{return Y.substring(Q.start,Q.end)});return u5.lastIndex=0,this.source.replace(u5,(Q,$)=>{return a5(J[parseInt($,10)]||"")})}_buildAnchorCache(){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let Y=[],X=[],J=[],Q=[],$,K,U,W;for($=0,K=this.source.length;$<K;$++)if(U=this.source.charAt($),Y[$]=U,X[$]=U,J[$]=U,Q[$]=U,U==="\\"){if($+1<K){if(W=this.source.charAt($+1),W==="A")Y[$+1]="￿",X[$+1]="￿",J[$+1]="A",Q[$+1]="A";else if(W==="G")Y[$+1]="￿",X[$+1]="G",J[$+1]="￿",Q[$+1]="G";else Y[$+1]=W,X[$+1]=W,J[$+1]=W,Q[$+1]=W;$++}}return{A0_G0:Y.join(""),A0_G1:X.join(""),A1_G0:J.join(""),A1_G1:Q.join("")}}resolveAnchors(Y,X){if(!this.hasAnchor||!this._anchorCache||typeof this.source!=="string")return this.source;if(Y)if(X)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;else if(X)return this._anchorCache.A0_G1;else return this._anchorCache.A0_G0}},b0=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){if(this._cached)this._cached.dispose(),this._cached=null;if(this._anchorCache.A0_G0)this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null;if(this._anchorCache.A0_G1)this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null;if(this._anchorCache.A1_G0)this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null;if(this._anchorCache.A1_G1)this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null}push(Z){this._items.push(Z),this._hasAnchors=this._hasAnchors||Z.hasAnchor}unshift(Z){this._items.unshift(Z),this._hasAnchors=this._hasAnchors||Z.hasAnchor}length(){return this._items.length}setSource(Z,Y){if(this._items[Z].source!==Y)this._disposeCaches(),this._items[Z].setSource(Y)}compile(Z){if(!this._cached){let Y=this._items.map((X)=>X.source);this._cached=new p5(Z,Y,this._items.map((X)=>X.ruleId))}return this._cached}compileAG(Z,Y,X){if(!this._hasAnchors)return this.compile(Z);else if(Y)if(X){if(!this._anchorCache.A1_G1)this._anchorCache.A1_G1=this._resolveAnchors(Z,Y,X);return this._anchorCache.A1_G1}else{if(!this._anchorCache.A1_G0)this._anchorCache.A1_G0=this._resolveAnchors(Z,Y,X);return this._anchorCache.A1_G0}else if(X){if(!this._anchorCache.A0_G1)this._anchorCache.A0_G1=this._resolveAnchors(Z,Y,X);return this._anchorCache.A0_G1}else{if(!this._anchorCache.A0_G0)this._anchorCache.A0_G0=this._resolveAnchors(Z,Y,X);return this._anchorCache.A0_G0}}_resolveAnchors(Z,Y,X){let J=this._items.map((Q)=>Q.resolveAnchors(Y,X));return new p5(Z,J,this._items.map((Q)=>Q.ruleId))}},p5=class{constructor(Z,Y,X){this.regExps=Y,this.rules=X,this.scanner=Z.createOnigScanner(Y)}scanner;dispose(){if(typeof this.scanner.dispose==="function")this.scanner.dispose()}toString(){let Z=[];for(let Y=0,X=this.rules.length;Y<X;Y++)Z.push(" - "+this.rules[Y]+": "+this.regExps[Y]);return Z.join(`
132
+ `)}findNextMatchSync(Z,Y,X){let J=this.scanner.findNextMatchSync(Z,Y,X);if(!J)return null;return{ruleId:this.rules[J.index],captureIndices:J.captureIndices}}},BX=class{constructor(Z,Y){this.languageId=Z,this.tokenType=Y}},K7=class Z{_defaultAttributes;_embeddedLanguagesMatcher;constructor(Y,X){this._defaultAttributes=new BX(Y,8),this._embeddedLanguagesMatcher=new W7(Object.entries(X||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(Y){if(Y===null)return Z._NULL_SCOPE_METADATA;return this._getBasicScopeAttributes.get(Y)}static _NULL_SCOPE_METADATA=new BX(0,0);_getBasicScopeAttributes=new s5((Y)=>{let X=this._scopeToLanguage(Y),J=this._toStandardTokenType(Y);return new BX(X,J)});_scopeToLanguage(Y){return this._embeddedLanguagesMatcher.match(Y)||0}_toStandardTokenType(Y){let X=Y.match(Z.STANDARD_TOKEN_TYPE_REGEXP);if(!X)return 8;switch(X[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},W7=class{values;scopesRegExp;constructor(Z){if(Z.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(Z);let Y=Z.map(([X,J])=>a5(X));Y.sort(),Y.reverse(),this.scopesRegExp=new RegExp(`^((${Y.join(")|(")}))($|\\.)`,"")}}match(Z){if(!this.scopesRegExp)return;let Y=Z.match(this.scopesRegExp);if(!Y)return;return this.values.get(Y[1])}},KO={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},$6=!1,d5=class{constructor(Z,Y){this.stack=Z,this.stoppedEarly=Y}};function K6(Z,Y,X,J,Q,$,K,U){let W=Y.content.length,z=!1,H=-1;if(K){let M=U7(Z,Y,X,J,Q,$);Q=M.stack,J=M.linePos,X=M.isFirstLine,H=M.anchorPosition}let G=Date.now();while(!z){if(U!==0){if(Date.now()-G>U)return new d5(Q,!0)}F()}return new d5(Q,!1);function F(){let M=z7(Z,Y,X,J,Q,H);if(!M){$.produce(Q,W),z=!0;return}let{captureIndices:N,matchedRuleId:w}=M,L=N&&N.length>0?N[0].end>J:!1;if(w===J7){let B=Q.getRule(Z);$.produce(Q,N[0].start),Q=Q.withContentNameScopesList(Q.nameScopesList),I0(Z,Y,X,Q,$,B.endCaptures,N),$.produce(Q,N[0].end);let C=Q;if(Q=Q.parent,H=C.getAnchorPos(),!L&&C.getEnterPos()===J){Q=C,$.produce(Q,W),z=!0;return}}else{let B=Z.getRule(w);$.produce(Q,N[0].start);let C=Q,R=B.getName(Y.content,N),D=Q.contentNameScopesList.pushAttributed(R,Z);if(Q=Q.push(w,J,H,N[0].end===W,null,D,D),B instanceof RX){let f=B;I0(Z,Y,X,Q,$,f.beginCaptures,N),$.produce(Q,N[0].end),H=N[0].end;let V=f.getContentName(Y.content,N),d=D.pushAttributed(V,Z);if(Q=Q.withContentNameScopesList(d),f.endHasBackReferences)Q=Q.withEndRule(f.getEndWithResolvedBackReferences(Y.content,N));if(!L&&C.hasSameRuleAs(Q)){Q=Q.pop(),$.produce(Q,W),z=!0;return}}else if(B instanceof HY){let f=B;I0(Z,Y,X,Q,$,f.beginCaptures,N),$.produce(Q,N[0].end),H=N[0].end;let V=f.getContentName(Y.content,N),d=D.pushAttributed(V,Z);if(Q=Q.withContentNameScopesList(d),f.whileHasBackReferences)Q=Q.withEndRule(f.getWhileWithResolvedBackReferences(Y.content,N));if(!L&&C.hasSameRuleAs(Q)){Q=Q.pop(),$.produce(Q,W),z=!0;return}}else if(I0(Z,Y,X,Q,$,B.captures,N),$.produce(Q,N[0].end),Q=Q.pop(),!L){Q=Q.safePop(),$.produce(Q,W),z=!0;return}}if(N[0].end>J)J=N[0].end,X=!1}}function U7(Z,Y,X,J,Q,$){let K=Q.beginRuleCapturedEOL?0:-1,U=[];for(let W=Q;W;W=W.pop()){let z=W.getRule(Z);if(z instanceof HY)U.push({rule:z,stack:W})}for(let W=U.pop();W;W=U.pop()){let{ruleScanner:z,findOptions:H}=O7(W.rule,Z,W.stack.endRule,X,J===K),G=z.findNextMatchSync(Y,J,H);if(G){if(G.ruleId!==Y6){Q=W.stack.pop();break}if(G.captureIndices&&G.captureIndices.length){if($.produce(W.stack,G.captureIndices[0].start),I0(Z,Y,X,W.stack,$,W.rule.whileCaptures,G.captureIndices),$.produce(W.stack,G.captureIndices[0].end),K=G.captureIndices[0].end,G.captureIndices[0].end>J)J=G.captureIndices[0].end,X=!1}}else{Q=W.stack.pop();break}}return{stack:Q,linePos:J,anchorPosition:K,isFirstLine:X}}function z7(Z,Y,X,J,Q,$){let K=H7(Z,Y,X,J,Q,$),U=Z.getInjections();if(U.length===0)return K;let W=G7(U,Z,Y,X,J,Q,$);if(!W)return K;if(!K)return W;let z=K.captureIndices[0].start,H=W.captureIndices[0].start;if(H<z||W.priorityMatch&&H===z)return W;return K}function H7(Z,Y,X,J,Q,$){let K=Q.getRule(Z),{ruleScanner:U,findOptions:W}=W6(K,Z,Q.endRule,X,J===$),z=U.findNextMatchSync(Y,J,W);if(z)return{captureIndices:z.captureIndices,matchedRuleId:z.ruleId};return null}function G7(Z,Y,X,J,Q,$,K){let U=Number.MAX_VALUE,W=null,z,H=0,G=$.contentNameScopesList.getScopeNames();for(let F=0,M=Z.length;F<M;F++){let N=Z[F];if(!N.matcher(G))continue;let w=Y.getRule(N.ruleId),{ruleScanner:L,findOptions:B}=W6(w,Y,null,J,Q===K),C=L.findNextMatchSync(X,Q,B);if(!C)continue;let R=C.captureIndices[0].start;if(R>=U)continue;if(U=R,W=C.captureIndices,z=C.ruleId,H=N.priority,U===Q)break}if(W)return{priorityMatch:H===-1,captureIndices:W,matchedRuleId:z};return null}function W6(Z,Y,X,J,Q){if($6){let K=Z.compile(Y,X),U=U6(J,Q);return{ruleScanner:K,findOptions:U}}return{ruleScanner:Z.compileAG(Y,X,J,Q),findOptions:0}}function O7(Z,Y,X,J,Q){if($6){let K=Z.compileWhile(Y,X),U=U6(J,Q);return{ruleScanner:K,findOptions:U}}return{ruleScanner:Z.compileWhileAG(Y,X,J,Q),findOptions:0}}function U6(Z,Y){let X=0;if(!Z)X|=1;if(!Y)X|=4;return X}function I0(Z,Y,X,J,Q,$,K){if($.length===0)return;let U=Y.content,W=Math.min($.length,K.length),z=[],H=K[0].end;for(let G=0;G<W;G++){let F=$[G];if(F===null)continue;let M=K[G];if(M.length===0)continue;if(M.start>H)break;while(z.length>0&&z[z.length-1].endPos<=M.start)Q.produceFromScopes(z[z.length-1].scopes,z[z.length-1].endPos),z.pop();if(z.length>0)Q.produceFromScopes(z[z.length-1].scopes,M.start);else Q.produce(J,M.start);if(F.retokenizeCapturedWithRuleId){let w=F.getName(U,K),L=J.contentNameScopesList.pushAttributed(w,Z),B=F.getContentName(U,K),C=L.pushAttributed(B,Z),R=J.push(F.retokenizeCapturedWithRuleId,M.start,-1,!1,null,L,C),D=Z.createOnigString(U.substring(0,M.end));K6(Z,D,X&&M.start===0,M.start,R,Q,!1,0),e5(D);continue}let N=F.getName(U,K);if(N!==null){let L=(z.length>0?z[z.length-1].scopes:J.contentNameScopesList).pushAttributed(N,Z);z.push(new q7(L,M.end))}}while(z.length>0)Q.produceFromScopes(z[z.length-1].scopes,z[z.length-1].endPos),z.pop()}var q7=class{scopes;endPos;constructor(Z,Y){this.scopes=Z,this.endPos=Y}};function F7(Z,Y,X,J,Q,$,K,U){return new N7(Z,Y,X,J,Q,$,K,U)}function c5(Z,Y,X,J,Q){let $=UY(Y,GY),K=Q6.getCompiledRuleId(X,J,Q.repository);for(let U of $)Z.push({debugSelector:Y,matcher:U.matcher,ruleId:K,grammar:Q,priority:U.priority})}function GY(Z,Y){if(Y.length<Z.length)return!1;let X=0;return Z.every((J)=>{for(let Q=X;Q<Y.length;Q++)if(M7(Y[Q],J))return X=Q+1,!0;return!1})}function M7(Z,Y){if(!Z)return!1;if(Z===Y)return!0;let X=Y.length;return Z.length>X&&Z.substr(0,X)===Y&&Z[X]==="."}var N7=class{constructor(Z,Y,X,J,Q,$,K,U){if(this._rootScopeName=Z,this.balancedBracketSelectors=$,this._onigLib=U,this._basicScopeAttributesProvider=new K7(X,J),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=K,this._grammar=l5(Y,null),this._injections=null,this._tokenTypeMatchers=[],Q)for(let W of Object.keys(Q)){let z=UY(W,GY);for(let H of z)this._tokenTypeMatchers.push({matcher:H.matcher,type:Q[W]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let Z of this._ruleId2desc)if(Z)Z.dispose()}createOnigScanner(Z){return this._onigLib.createOnigScanner(Z)}createOnigString(Z){return this._onigLib.createOnigString(Z)}getMetadataForScope(Z){return this._basicScopeAttributesProvider.getBasicScopeAttributes(Z)}_collectInjections(){let Z={lookup:(Q)=>{if(Q===this._rootScopeName)return this._grammar;return this.getExternalGrammar(Q)},injections:(Q)=>{return this._grammarRepository.injections(Q)}},Y=[],X=this._rootScopeName,J=Z.lookup(X);if(J){let Q=J.injections;if(Q)for(let K in Q)c5(Y,K,Q[K],this,J);let $=this._grammarRepository.injections(X);if($)$.forEach((K)=>{let U=this.getExternalGrammar(K);if(U){let W=U.injectionSelector;if(W)c5(Y,W,U,this,U)}})}return Y.sort((Q,$)=>Q.priority-$.priority),Y}getInjections(){if(this._injections===null)this._injections=this._collectInjections();return this._injections}registerRule(Z){let Y=++this._lastRuleId,X=Z(X6(Y));return this._ruleId2desc[Y]=X,X}getRule(Z){return this._ruleId2desc[J6(Z)]}getExternalGrammar(Z,Y){if(this._includedGrammars[Z])return this._includedGrammars[Z];else if(this._grammarRepository){let X=this._grammarRepository.lookup(Z);if(X)return this._includedGrammars[Z]=l5(X,Y&&Y.$base),this._includedGrammars[Z]}return}tokenizeLine(Z,Y,X=0){let J=this._tokenize(Z,Y,!1,X);return{tokens:J.lineTokens.getResult(J.ruleStack,J.lineLength),ruleStack:J.ruleStack,stoppedEarly:J.stoppedEarly}}tokenizeLine2(Z,Y,X=0){let J=this._tokenize(Z,Y,!0,X);return{tokens:J.lineTokens.getBinaryResult(J.ruleStack,J.lineLength),ruleStack:J.ruleStack,stoppedEarly:J.stoppedEarly}}_tokenize(Z,Y,X,J){if(this._rootId===-1)this._rootId=Q6.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections();let Q;if(!Y||Y===CX.NULL){Q=!0;let z=this._basicScopeAttributesProvider.getDefaultAttributes(),H=this.themeProvider.getDefaults(),G=o4.set(0,z.languageId,z.tokenType,null,H.fontStyle,H.foregroundId,H.backgroundId),F=this.getRule(this._rootId).getName(null,null),M;if(F)M=v0.createRootAndLookUpScopeName(F,G,this);else M=v0.createRoot("unknown",G);Y=new CX(null,this._rootId,-1,-1,!1,null,M,M)}else Q=!1,Y.reset();Z=Z+`
133
+ `;let $=this.createOnigString(Z),K=$.content.length,U=new A7(X,Z,this._tokenTypeMatchers,this.balancedBracketSelectors),W=K6(this,$,Q,0,Y,U,!0,J);return e5($),{lineLength:K,lineTokens:U,ruleStack:W.stack,stoppedEarly:W.stoppedEarly}}};function l5(Z,Y){return Z=jK(Z),Z.repository=Z.repository||{},Z.repository.$self={$vscodeTextmateLocation:Z.$vscodeTextmateLocation,patterns:Z.patterns,name:Z.scopeName},Z.repository.$base=Y||Z.repository.$self,Z}var v0=class Z{constructor(Y,X,J){this.parent=Y,this.scopePath=X,this.tokenAttributes=J}static fromExtension(Y,X){let J=Y,Q=Y?.scopePath??null;for(let $ of X)Q=wX.push(Q,$.scopeNames),J=new Z(J,Q,$.encodedTokenAttributes);return J}static createRoot(Y,X){return new Z(null,new wX(null,Y),X)}static createRootAndLookUpScopeName(Y,X,J){let Q=J.getMetadataForScope(Y),$=new wX(null,Y),K=J.themeProvider.themeMatch($),U=Z.mergeAttributes(X,Q,K);return new Z(null,$,U)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(Y){return Z.equals(this,Y)}static equals(Y,X){do{if(Y===X)return!0;if(!Y&&!X)return!0;if(!Y||!X)return!1;if(Y.scopeName!==X.scopeName||Y.tokenAttributes!==X.tokenAttributes)return!1;Y=Y.parent,X=X.parent}while(!0)}static mergeAttributes(Y,X,J){let Q=-1,$=0,K=0;if(J!==null)Q=J.fontStyle,$=J.foregroundId,K=J.backgroundId;return o4.set(Y,X.languageId,X.tokenType,null,Q,$,K)}pushAttributed(Y,X){if(Y===null)return this;if(Y.indexOf(" ")===-1)return Z._pushAttributed(this,Y,X);let J=Y.split(/ /g),Q=this;for(let $ of J)Q=Z._pushAttributed(Q,$,X);return Q}static _pushAttributed(Y,X,J){let Q=J.getMetadataForScope(X),$=Y.scopePath.push(X),K=J.themeProvider.themeMatch($),U=Z.mergeAttributes(Y.tokenAttributes,Q,K);return new Z(Y,$,U)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(Y){let X=[],J=this;while(J&&J!==Y)X.push({encodedTokenAttributes:J.tokenAttributes,scopeNames:J.scopePath.getExtensionIfDefined(J.parent?.scopePath??null)}),J=J.parent;return J===Y?X.reverse():void 0}},CX=class Z{constructor(Y,X,J,Q,$,K,U,W){this.parent=Y,this.ruleId=X,this.beginRuleCapturedEOL=$,this.endRule=K,this.nameScopesList=U,this.contentNameScopesList=W,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=J,this._anchorPos=Q}_stackElementBrand=void 0;static NULL=new Z(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(Y){if(Y===null)return!1;return Z._equals(this,Y)}static _equals(Y,X){if(Y===X)return!0;if(!this._structuralEquals(Y,X))return!1;return v0.equals(Y.contentNameScopesList,X.contentNameScopesList)}static _structuralEquals(Y,X){do{if(Y===X)return!0;if(!Y&&!X)return!0;if(!Y||!X)return!1;if(Y.depth!==X.depth||Y.ruleId!==X.ruleId||Y.endRule!==X.endRule)return!1;Y=Y.parent,X=X.parent}while(!0)}clone(){return this}static _reset(Y){while(Y)Y._enterPos=-1,Y._anchorPos=-1,Y=Y.parent}reset(){Z._reset(this)}pop(){return this.parent}safePop(){if(this.parent)return this.parent;return this}push(Y,X,J,Q,$,K,U){return new Z(this,Y,X,J,Q,$,K,U)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(Y){return Y.getRule(this.ruleId)}toString(){let Y=[];return this._writeString(Y,0),"["+Y.join(",")+"]"}_writeString(Y,X){if(this.parent)X=this.parent._writeString(Y,X);return Y[X++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,X}withContentNameScopesList(Y){if(this.contentNameScopesList===Y)return this;return this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,Y)}withEndRule(Y){if(this.endRule===Y)return this;return new Z(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,Y,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(Y){let X=this;while(X&&X._enterPos===Y._enterPos){if(X.ruleId===Y.ruleId)return!0;X=X.parent}return!1}toStateStackFrame(){return{ruleId:J6(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(Y,X){let J=v0.fromExtension(Y?.nameScopesList??null,X.nameScopesList);return new Z(Y,X6(X.ruleId),X.enterPos??-1,X.anchorPos??-1,X.beginRuleCapturedEOL,X.endRule,J,v0.fromExtension(J,X.contentNameScopesList))}},_7=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(Z,Y){this.balancedBracketScopes=Z.flatMap((X)=>{if(X==="*")return this.allowAny=!0,[];return UY(X,GY).map((J)=>J.matcher)}),this.unbalancedBracketScopes=Y.flatMap((X)=>UY(X,GY).map((J)=>J.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(Z){for(let Y of this.unbalancedBracketScopes)if(Y(Z))return!1;for(let Y of this.balancedBracketScopes)if(Y(Z))return!0;return this.allowAny}},A7=class{constructor(Z,Y,X,J){this.balancedBracketSelectors=J,this._emitBinaryTokens=Z,this._tokenTypeOverrides=X,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(Z,Y){this.produceFromScopes(Z.contentNameScopesList,Y)}produceFromScopes(Z,Y){if(this._lastTokenEndIndex>=Y)return;if(this._emitBinaryTokens){let J=Z?.tokenAttributes??0,Q=!1;if(this.balancedBracketSelectors?.matchesAlways)Q=!0;if(this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let $=Z?.getScopeNames()??[];for(let K of this._tokenTypeOverrides)if(K.matcher($))J=o4.set(J,0,cK(K.type),null,-1,0,0);if(this.balancedBracketSelectors)Q=this.balancedBracketSelectors.match($)}if(Q)J=o4.set(J,0,8,Q,-1,0,0);if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===J){this._lastTokenEndIndex=Y;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(J),this._lastTokenEndIndex=Y;return}let X=Z?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:Y,scopes:X}),this._lastTokenEndIndex=Y}getResult(Z,Y){if(this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===Y-1)this._tokens.pop();if(this._tokens.length===0)this._lastTokenEndIndex=-1,this.produce(Z,Y),this._tokens[this._tokens.length-1].startIndex=0;return this._tokens}getBinaryResult(Z,Y){if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===Y-1)this._binaryTokens.pop(),this._binaryTokens.pop();if(this._binaryTokens.length===0)this._lastTokenEndIndex=-1,this.produce(Z,Y),this._binaryTokens[this._binaryTokens.length-2]=0;let X=new Uint32Array(this._binaryTokens.length);for(let J=0,Q=this._binaryTokens.length;J<Q;J++)X[J]=this._binaryTokens[J];return X}},w7=class{constructor(Z,Y){this._onigLib=Y,this._theme=Z}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let Z of this._grammars.values())Z.dispose()}setTheme(Z){this._theme=Z}getColorMap(){return this._theme.getColorMap()}addGrammar(Z,Y){if(this._rawGrammars.set(Z.scopeName,Z),Y)this._injectionGrammars.set(Z.scopeName,Y)}lookup(Z){return this._rawGrammars.get(Z)}injections(Z){return this._injectionGrammars.get(Z)}getDefaults(){return this._theme.getDefaults()}themeMatch(Z){return this._theme.match(Z)}grammarForScopeName(Z,Y,X,J,Q){if(!this._grammars.has(Z)){let $=this._rawGrammars.get(Z);if(!$)return null;this._grammars.set(Z,F7(Z,$,Y,X,J,Q,this,this._onigLib))}return this._grammars.get(Z)}},z6=class{_options;_syncRegistry;_ensureGrammarCache;constructor(Z){this._options=Z,this._syncRegistry=new w7(D0.createFromRawTheme(Z.theme,Z.colorMap),Z.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(Z,Y){this._syncRegistry.setTheme(D0.createFromRawTheme(Z,Y))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(Z,Y,X){return this.loadGrammarWithConfiguration(Z,Y,{embeddedLanguages:X})}loadGrammarWithConfiguration(Z,Y,X){return this._loadGrammar(Z,Y,X.embeddedLanguages,X.tokenTypes,new _7(X.balancedBracketSelectors||[],X.unbalancedBracketSelectors||[]))}loadGrammar(Z){return this._loadGrammar(Z,0,null,null,null)}_loadGrammar(Z,Y,X,J,Q){let $=new nK(this._syncRegistry,Z);while($.Q.length>0)$.Q.map((K)=>this._loadSingleGrammar(K.scopeName)),$.processQueue();return this._grammarForScopeName(Z,Y,X,J,Q)}_loadSingleGrammar(Z){if(!this._ensureGrammarCache.has(Z))this._doLoadSingleGrammar(Z),this._ensureGrammarCache.set(Z,!0)}_doLoadSingleGrammar(Z){let Y=this._options.loadGrammar(Z);if(Y){let X=typeof this._options.getInjections==="function"?this._options.getInjections(Z):void 0;this._syncRegistry.addGrammar(Y,X)}}addGrammar(Z,Y=[],X=0,J=null){return this._syncRegistry.addGrammar(Z,Y),this._grammarForScopeName(Z.scopeName,X,J)}_grammarForScopeName(Z,Y=0,X=null,J=null,Q=null){return this._syncRegistry.grammarForScopeName(Z,Y,X,J,Q)}},OY=CX.NULL;var H6=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class E4{constructor(Z,Y,X){if(this.normal=Y,this.property=Z,X)this.space=X}}E4.prototype.normal={};E4.prototype.property={};E4.prototype.space=void 0;function vX(Z,Y){let X={},J={};for(let Q of Z)Object.assign(X,Q.property),Object.assign(J,Q.normal);return new E4(X,J,Y)}function f0(Z){return Z.toLowerCase()}class AZ{constructor(Z,Y){this.attribute=Y,this.property=Z}}AZ.prototype.attribute="";AZ.prototype.booleanish=!1;AZ.prototype.boolean=!1;AZ.prototype.commaOrSpaceSeparated=!1;AZ.prototype.commaSeparated=!1;AZ.prototype.defined=!1;AZ.prototype.mustUseProperty=!1;AZ.prototype.number=!1;AZ.prototype.overloadedBoolean=!1;AZ.prototype.property="";AZ.prototype.spaceSeparated=!1;AZ.prototype.space=void 0;var j0={};B7(j0,{spaceSeparated:()=>o,overloadedBoolean:()=>qY,number:()=>v,commaSeparated:()=>b4,commaOrSpaceSeparated:()=>bZ,booleanish:()=>XZ,boolean:()=>y});var L7=0,y=n4(),XZ=n4(),qY=n4(),v=n4(),o=n4(),b4=n4(),bZ=n4();function n4(){return 2**++L7}var DX=Object.keys(j0);class G0 extends AZ{constructor(Z,Y,X,J){let Q=-1;super(Z,Y);if(G6(this,"space",J),typeof X==="number")while(++Q<DX.length){let $=DX[Q];G6(this,DX[Q],(X&j0[$])===j0[$])}}}G0.prototype.defined=!0;function G6(Z,Y,X){if(X)Z[Y]=X}function mZ(Z){let Y={},X={};for(let[J,Q]of Object.entries(Z.properties)){let $=new G0(J,Z.transform(Z.attributes||{},J),Q,Z.space);if(Z.mustUseProperty&&Z.mustUseProperty.includes(J))$.mustUseProperty=!0;Y[J]=$,X[f0(J)]=J,X[f0($.attribute)]=J}return new E4(Y,X,Z.space)}var VX=mZ({properties:{ariaActiveDescendant:null,ariaAtomic:XZ,ariaAutoComplete:null,ariaBusy:XZ,ariaChecked:XZ,ariaColCount:v,ariaColIndex:v,ariaColSpan:v,ariaControls:o,ariaCurrent:null,ariaDescribedBy:o,ariaDetails:null,ariaDisabled:XZ,ariaDropEffect:o,ariaErrorMessage:null,ariaExpanded:XZ,ariaFlowTo:o,ariaGrabbed:XZ,ariaHasPopup:null,ariaHidden:XZ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:o,ariaLevel:v,ariaLive:null,ariaModal:XZ,ariaMultiLine:XZ,ariaMultiSelectable:XZ,ariaOrientation:null,ariaOwns:o,ariaPlaceholder:null,ariaPosInSet:v,ariaPressed:XZ,ariaReadOnly:XZ,ariaRelevant:null,ariaRequired:XZ,ariaRoleDescription:o,ariaRowCount:v,ariaRowIndex:v,ariaRowSpan:v,ariaSelected:XZ,ariaSetSize:v,ariaSort:null,ariaValueMax:v,ariaValueMin:v,ariaValueNow:v,ariaValueText:null,role:null},transform(Z,Y){return Y==="role"?Y:"aria-"+Y.slice(4).toLowerCase()}});function FY(Z,Y){return Y in Z?Z[Y]:Y}function MY(Z,Y){return FY(Z,Y.toLowerCase())}var O6=mZ({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:b4,acceptCharset:o,accessKey:o,action:null,allow:null,allowFullScreen:y,allowPaymentRequest:y,allowUserMedia:y,alt:null,as:null,async:y,autoCapitalize:null,autoComplete:o,autoFocus:y,autoPlay:y,blocking:o,capture:null,charSet:null,checked:y,cite:null,className:o,cols:v,colSpan:null,content:null,contentEditable:XZ,controls:y,controlsList:o,coords:v|b4,crossOrigin:null,data:null,dateTime:null,decoding:null,default:y,defer:y,dir:null,dirName:null,disabled:y,download:qY,draggable:XZ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:y,formTarget:null,headers:o,height:v,hidden:qY,high:v,href:null,hrefLang:null,htmlFor:o,httpEquiv:o,id:null,imageSizes:null,imageSrcSet:null,inert:y,inputMode:null,integrity:null,is:null,isMap:y,itemId:null,itemProp:o,itemRef:o,itemScope:y,itemType:o,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:y,low:v,manifest:null,max:null,maxLength:v,media:null,method:null,min:null,minLength:v,multiple:y,muted:y,name:null,nonce:null,noModule:y,noValidate:y,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:y,optimum:v,pattern:null,ping:o,placeholder:null,playsInline:y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:y,referrerPolicy:null,rel:o,required:y,reversed:y,rows:v,rowSpan:v,sandbox:o,scope:null,scoped:y,seamless:y,selected:y,shadowRootClonable:y,shadowRootDelegatesFocus:y,shadowRootMode:null,shape:null,size:v,sizes:null,slot:null,span:v,spellCheck:XZ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:v,step:null,style:null,tabIndex:v,target:null,title:null,translate:null,type:null,typeMustMatch:y,useMap:null,value:XZ,width:v,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:o,axis:null,background:null,bgColor:null,border:v,borderColor:null,bottomMargin:v,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:y,declare:y,event:null,face:null,frame:null,frameBorder:null,hSpace:v,leftMargin:v,link:null,longDesc:null,lowSrc:null,marginHeight:v,marginWidth:v,noResize:y,noHref:y,noShade:y,noWrap:y,object:null,profile:null,prompt:null,rev:null,rightMargin:v,rules:null,scheme:null,scrolling:XZ,standby:null,summary:null,text:null,topMargin:v,valueType:null,version:null,vAlign:null,vLink:null,vSpace:v,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:y,disableRemotePlayback:y,prefix:null,property:null,results:v,security:null,unselectable:null},space:"html",transform:MY});var q6=mZ({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bZ,accentHeight:v,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:v,amplitude:v,arabicForm:null,ascent:v,attributeName:null,attributeType:null,azimuth:v,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:v,by:null,calcMode:null,capHeight:v,className:o,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:v,diffuseConstant:v,direction:null,display:null,dur:null,divisor:v,dominantBaseline:null,download:y,dx:null,dy:null,edgeMode:null,editable:null,elevation:v,enableBackground:null,end:null,event:null,exponent:v,externalResourcesRequired:null,fill:null,fillOpacity:v,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:b4,g2:b4,glyphName:b4,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:v,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:v,horizOriginX:v,horizOriginY:v,id:null,ideographic:v,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:v,k:v,k1:v,k2:v,k3:v,k4:v,kernelMatrix:bZ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:v,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:v,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:v,overlineThickness:v,paintOrder:null,panose1:null,path:null,pathLength:v,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:o,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:v,pointsAtY:v,pointsAtZ:v,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bZ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bZ,rev:bZ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bZ,requiredFeatures:bZ,requiredFonts:bZ,requiredFormats:bZ,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:v,specularExponent:v,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:v,strikethroughThickness:v,string:null,stroke:null,strokeDashArray:bZ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:v,strokeOpacity:v,strokeWidth:null,style:null,surfaceScale:v,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bZ,tabIndex:v,tableValues:null,target:null,targetX:v,targetY:v,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bZ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:v,underlineThickness:v,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:v,values:null,vAlphabetic:v,vMathematical:v,vectorEffect:null,vHanging:v,vIdeographic:v,version:null,vertAdvY:v,vertOriginX:v,vertOriginY:v,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:v,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:FY});var EX=mZ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(Z,Y){return"xlink:"+Y.slice(5).toLowerCase()}});var bX=mZ({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:MY});var TX=mZ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(Z,Y){return"xml:"+Y.slice(3).toLowerCase()}});var P7=/[A-Z]/g,F6=/-[a-z]/g,R7=/^data[-\w.:]+$/i;function fX(Z,Y){let X=f0(Y),J=Y,Q=AZ;if(X in Z.normal)return Z.property[Z.normal[X]];if(X.length>4&&X.slice(0,4)==="data"&&R7.test(Y)){if(Y.charAt(4)==="-"){let $=Y.slice(5).replace(F6,I7);J="data"+$.charAt(0).toUpperCase()+$.slice(1)}else{let $=Y.slice(4);if(!F6.test($)){let K=$.replace(P7,C7);if(K.charAt(0)!=="-")K="-"+K;Y="data"+K}}Q=G0}return new Q(J,Y)}function C7(Z){return"-"+Z.toLowerCase()}function I7(Z){return Z.charAt(1).toUpperCase()}var M6=vX([VX,O6,EX,bX,TX],"html"),NY=vX([VX,q6,EX,bX,TX],"svg");var N6={}.hasOwnProperty;function _6(Z,Y){let X=Y||{};function J(Q,...$){let{invalid:K,handlers:U}=J;if(Q&&N6.call(Q,Z)){let W=String(Q[Z]);K=N6.call(U,W)?U[W]:J.unknown}if(K)return K.call(this,Q,...$)}return J.handlers=X.handlers||{},J.invalid=X.invalid,J.unknown=X.unknown,J}var v7=/["&'<>`]/g,D7=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,V7=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,E7=/[|\\{}()[\]^$+*?.]/g,A6=new WeakMap;function w6(Z,Y){if(Z=Z.replace(Y.subset?b7(Y.subset):v7,J),Y.subset||Y.escapeOnly)return Z;return Z.replace(D7,X).replace(V7,J);function X(Q,$,K){return Y.format((Q.charCodeAt(0)-55296)*1024+Q.charCodeAt(1)-56320+65536,K.charCodeAt($+2),Y)}function J(Q,$,K){return Y.format(Q.charCodeAt(0),K.charCodeAt($+1),Y)}}function b7(Z){let Y=A6.get(Z);if(!Y)Y=T7(Z),A6.set(Z,Y);return Y}function T7(Z){let Y=[],X=-1;while(++X<Z.length)Y.push(Z[X].replace(E7,"\\$&"));return new RegExp("(?:"+Y.join("|")+")","g")}var f7=/[\dA-Fa-f]/;function B6(Z,Y,X){let J="&#x"+Z.toString(16).toUpperCase();return X&&Y&&!f7.test(String.fromCharCode(Y))?J:J+";"}var j7=/\d/;function L6(Z,Y,X){let J="&#"+String(Z);return X&&Y&&!j7.test(String.fromCharCode(Y))?J:J+";"}var P6=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var _Y={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"};var R6=["cent","copy","divide","gt","lt","not","para","times"];var C6={}.hasOwnProperty,jX={},AY;for(AY in _Y)if(C6.call(_Y,AY))jX[_Y[AY]]=AY;var S7=/[^\dA-Za-z]/;function I6(Z,Y,X,J){let Q=String.fromCharCode(Z);if(C6.call(jX,Q)){let $=jX[Q],K="&"+$;if(X&&P6.includes($)&&!R6.includes($)&&(!J||Y&&Y!==61&&S7.test(String.fromCharCode(Y))))return K;return K+";"}return""}function v6(Z,Y,X){let J=B6(Z,Y,X.omitOptionalSemicolons),Q;if(X.useNamedReferences||X.useShortestReferences)Q=I6(Z,Y,X.omitOptionalSemicolons,X.attribute);if((X.useShortestReferences||!Q)&&X.useShortestReferences){let $=L6(Z,Y,X.omitOptionalSemicolons);if($.length<J.length)J=$}return Q&&(!X.useShortestReferences||Q.length<J.length)?Q:J}function B4(Z,Y){return w6(Z,Object.assign({format:v6},Y))}var y7=/^>|^->|<!--|-->|--!>|<!-$/g,k7=[">"],h7=["<",">"];function D6(Z,Y,X,J){return J.settings.bogusComments?"<?"+B4(Z.value,Object.assign({},J.settings.characterReferences,{subset:k7}))+">":"<!--"+Z.value.replace(y7,Q)+"-->";function Q($){return B4($,Object.assign({},J.settings.characterReferences,{subset:h7}))}}function V6(Z,Y,X,J){return"<!"+(J.settings.upperDoctype?"DOCTYPE":"doctype")+(J.settings.tightDoctype?"":" ")+"html>"}function SX(Z,Y){let X=String(Z);if(typeof Y!=="string")throw TypeError("Expected character");let J=0,Q=X.indexOf(Y);while(Q!==-1)J++,Q=X.indexOf(Y,Q+Y.length);return J}function E6(Z,Y){let X=Y||{};return(Z[Z.length-1]===""?[...Z,""]:Z).join((X.padRight?" ":"")+","+(X.padLeft===!1?"":" ")).trim()}function b6(Z){return Z.join(" ").trim()}var x7=/[ \t\n\f\r]/g;function a4(Z){return typeof Z==="object"?Z.type==="text"?T6(Z.value):!1:T6(Z)}function T6(Z){return Z.replace(x7,"")===""}var $Z=f6(1),yX=f6(-1),g7=[];function f6(Z){return Y;function Y(X,J,Q){let $=X?X.children:g7,K=(J||0)+Z,U=$[K];if(!Q)while(U&&a4(U))K+=Z,U=$[K];return U}}var u7={}.hasOwnProperty;function wY(Z){return Y;function Y(X,J,Q){return u7.call(Z,X.tagName)&&Z[X.tagName](X,J,Q)}}var S0=wY({body:p7,caption:kX,colgroup:kX,dd:i7,dt:l7,head:kX,html:m7,li:c7,optgroup:r7,option:o7,p:d7,rp:j6,rt:j6,tbody:a7,td:S6,tfoot:s7,th:S6,thead:n7,tr:t7});function kX(Z,Y,X){let J=$Z(X,Y,!0);return!J||J.type!=="comment"&&!(J.type==="text"&&a4(J.value.charAt(0)))}function m7(Z,Y,X){let J=$Z(X,Y);return!J||J.type!=="comment"}function p7(Z,Y,X){let J=$Z(X,Y);return!J||J.type!=="comment"}function d7(Z,Y,X){let J=$Z(X,Y);return J?J.type==="element"&&(J.tagName==="address"||J.tagName==="article"||J.tagName==="aside"||J.tagName==="blockquote"||J.tagName==="details"||J.tagName==="div"||J.tagName==="dl"||J.tagName==="fieldset"||J.tagName==="figcaption"||J.tagName==="figure"||J.tagName==="footer"||J.tagName==="form"||J.tagName==="h1"||J.tagName==="h2"||J.tagName==="h3"||J.tagName==="h4"||J.tagName==="h5"||J.tagName==="h6"||J.tagName==="header"||J.tagName==="hgroup"||J.tagName==="hr"||J.tagName==="main"||J.tagName==="menu"||J.tagName==="nav"||J.tagName==="ol"||J.tagName==="p"||J.tagName==="pre"||J.tagName==="section"||J.tagName==="table"||J.tagName==="ul"):!X||!(X.type==="element"&&(X.tagName==="a"||X.tagName==="audio"||X.tagName==="del"||X.tagName==="ins"||X.tagName==="map"||X.tagName==="noscript"||X.tagName==="video"))}function c7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&J.tagName==="li"}function l7(Z,Y,X){let J=$Z(X,Y);return Boolean(J&&J.type==="element"&&(J.tagName==="dt"||J.tagName==="dd"))}function i7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&(J.tagName==="dt"||J.tagName==="dd")}function j6(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&(J.tagName==="rp"||J.tagName==="rt")}function r7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&J.tagName==="optgroup"}function o7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&(J.tagName==="option"||J.tagName==="optgroup")}function n7(Z,Y,X){let J=$Z(X,Y);return Boolean(J&&J.type==="element"&&(J.tagName==="tbody"||J.tagName==="tfoot"))}function a7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&(J.tagName==="tbody"||J.tagName==="tfoot")}function s7(Z,Y,X){return!$Z(X,Y)}function t7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&J.tagName==="tr"}function S6(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&(J.tagName==="td"||J.tagName==="th")}var y6=wY({body:Y9,colgroup:X9,head:Z9,html:e7,tbody:J9});function e7(Z){let Y=$Z(Z,-1);return!Y||Y.type!=="comment"}function Z9(Z){let Y=new Set;for(let J of Z.children)if(J.type==="element"&&(J.tagName==="base"||J.tagName==="title")){if(Y.has(J.tagName))return!1;Y.add(J.tagName)}let X=Z.children[0];return!X||X.type==="element"}function Y9(Z){let Y=$Z(Z,-1,!0);return!Y||Y.type!=="comment"&&!(Y.type==="text"&&a4(Y.value.charAt(0)))&&!(Y.type==="element"&&(Y.tagName==="meta"||Y.tagName==="link"||Y.tagName==="script"||Y.tagName==="style"||Y.tagName==="template"))}function X9(Z,Y,X){let J=yX(X,Y),Q=$Z(Z,-1,!0);if(X&&J&&J.type==="element"&&J.tagName==="colgroup"&&S0(J,X.children.indexOf(J),X))return!1;return Boolean(Q&&Q.type==="element"&&Q.tagName==="col")}function J9(Z,Y,X){let J=yX(X,Y),Q=$Z(Z,-1);if(X&&J&&J.type==="element"&&(J.tagName==="thead"||J.tagName==="tbody")&&S0(J,X.children.indexOf(J),X))return!1;return Boolean(Q&&Q.type==="element"&&Q.tagName==="tr")}var BY={name:[[`
140
134
  \f\r &/=>`.split(""),`
141
135
  \f\r "&'/=>\``.split("")],[`\x00
142
136
  \f\r "&'/<=>`.split(""),`\x00
@@ -144,55 +138,55 @@ Please report this to https://github.com/markedjs/marked.`,Z){let J="<p>An error
144
138
  \f\r &>`.split(""),`\x00
145
139
  \f\r "&'<=>\``.split("")],[`\x00
146
140
  \f\r "&'<=>\``.split(""),`\x00
147
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\x00&'".split(""),"\x00\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\x00"&'.split(""),"\x00\"&'`".split("")]]};function x6(Z,Y,X,J){let Q=J.schema,$=Q.space==="svg"?!1:J.settings.omitOptionalTags,K=Q.space==="svg"?J.settings.closeEmptyElements:J.settings.voids.includes(Z.tagName.toLowerCase()),W=[],U;if(Q.space==="html"&&Z.tagName==="svg")J.schema=MY;let z=Q9(J,Z.properties),H=J.all(Q.space==="html"&&Z.tagName==="template"?Z.content:Z);if(J.schema=Q,H)K=!1;if(z||!$||!h6(Z,Y,X)){if(W.push("<",Z.tagName,z?" "+z:""),K&&(Q.space==="svg"||J.settings.closeSelfClosing)){if(U=z.charAt(z.length-1),!J.settings.tightSelfClosing||U==="/"||U&&U!=='"'&&U!=="'")W.push(" ");W.push("/")}W.push(">")}if(W.push(H),!K&&(!$||!y0(Z,Y,X)))W.push("</"+Z.tagName+">");return W.join("")}function Q9(Z,Y){let X=[],J=-1,Q;if(Y){for(Q in Y)if(Y[Q]!==null&&Y[Q]!==void 0){let $=$9(Z,Q,Y[Q]);if($)X.push($)}}while(++J<X.length){let $=Z.settings.tightAttributes?X[J].charAt(X[J].length-1):void 0;if(J!==X.length-1&&$!=='"'&&$!=="'")X[J]+=" "}return X.join("")}function $9(Z,Y,X){let J=TX(Z.schema,Y),Q=Z.settings.allowParseErrors&&Z.schema.space==="html"?0:1,$=Z.settings.allowDangerousCharacters?0:1,K=Z.quote,W;if(J.overloadedBoolean&&(X===J.attribute||X===""))X=!0;else if((J.boolean||J.overloadedBoolean)&&(typeof X!=="string"||X===J.attribute||X===""))X=Boolean(X);if(X===null||X===void 0||X===!1||typeof X==="number"&&Number.isNaN(X))return"";let U=P4(J.attribute,Object.assign({},Z.settings.characterReferences,{subset:AY.name[Q][$]}));if(X===!0)return U;if(X=Array.isArray(X)?(J.commaSeparated?T6:f6)(X,{padLeft:!Z.settings.tightCommaSeparatedLists}):String(X),Z.settings.collapseEmptyAttributes&&!X)return U;if(Z.settings.preferUnquoted)W=P4(X,Object.assign({},Z.settings.characterReferences,{attribute:!0,subset:AY.unquoted[Q][$]}));if(W!==X){if(Z.settings.quoteSmart&&jX(X,K)>jX(X,Z.alternative))K=Z.alternative;W=K+P4(X,Object.assign({},Z.settings.characterReferences,{subset:(K==="'"?AY.single:AY.double)[Q][$],attribute:!0}))+K}return U+(W?"="+W:W)}var K9=["<","&"];function BY(Z,Y,X,J){return X&&X.type==="element"&&(X.tagName==="script"||X.tagName==="style")?Z.value:P4(Z.value,Object.assign({},J.settings.characterReferences,{subset:K9}))}function g6(Z,Y,X,J){return J.settings.allowDangerousHtml?Z.value:BY(Z,Y,X,J)}function u6(Z,Y,X,J){return J.all(Z)}var m6=A6("type",{invalid:W9,unknown:U9,handlers:{comment:E6,doctype:b6,element:x6,raw:g6,root:u6,text:BY}});function W9(Z){throw Error("Expected node, not `"+Z+"`")}function U9(Z){throw Error("Cannot compile unknown node `"+Z.type+"`")}var z9={},H9={},G9=[];function kX(Z,Y){let X=Y||z9,J=X.quote||'"',Q=J==='"'?"'":'"';if(J!=='"'&&J!=="'")throw Error("Invalid quote `"+J+"`, expected `'` or `\"`");return{one:O9,all:q9,settings:{omitOptionalTags:X.omitOptionalTags||!1,allowParseErrors:X.allowParseErrors||!1,allowDangerousCharacters:X.allowDangerousCharacters||!1,quoteSmart:X.quoteSmart||!1,preferUnquoted:X.preferUnquoted||!1,tightAttributes:X.tightAttributes||!1,upperDoctype:X.upperDoctype||!1,tightDoctype:X.tightDoctype||!1,bogusComments:X.bogusComments||!1,tightCommaSeparatedLists:X.tightCommaSeparatedLists||!1,tightSelfClosing:X.tightSelfClosing||!1,collapseEmptyAttributes:X.collapseEmptyAttributes||!1,allowDangerousHtml:X.allowDangerousHtml||!1,voids:X.voids||O6,characterReferences:X.characterReferences||H9,closeSelfClosing:X.closeSelfClosing||!1,closeEmptyElements:X.closeEmptyElements||!1},schema:X.space==="svg"?MY:_6,quote:J,alternative:Q}.one(Array.isArray(Z)?{type:"root",children:Z}:Z,void 0,void 0)}function O9(Z,Y,X){return m6(Z,Y,X,this)}function q9(Z){let Y=[],X=Z&&Z.children||G9,J=-1;while(++J<X.length)Y[J]=this.one(X[J],J,Z);return Y.join("")}function LY(Z,Y){let X=typeof Z==="string"?{}:{...Z.colorReplacements},J=typeof Z==="string"?Z:Z.name;for(let[Q,$]of Object.entries(Y?.colorReplacements||{}))if(typeof $==="string")X[Q]=$;else if(Q===J)Object.assign(X,$);return X}function j4(Z,Y){if(!Z)return Z;return Y?.[Z?.toLowerCase()]||Z}function F9(Z){return Array.isArray(Z)?Z:[Z]}async function o6(Z){return Promise.resolve(typeof Z==="function"?Z():Z).then((Y)=>Y.default||Y)}function uX(Z){return!Z||["plaintext","txt","text","plain"].includes(Z)}function n6(Z){return Z==="ansi"||uX(Z)}function mX(Z){return Z==="none"}function a6(Z){return mX(Z)}function s6(Z,Y){if(!Y)return Z;if(Z.properties||={},Z.properties.class||=[],typeof Z.properties.class==="string")Z.properties.class=Z.properties.class.split(/\s+/g);if(!Array.isArray(Z.properties.class))Z.properties.class=[];let X=Array.isArray(Y)?Y:Y.split(/\s+/g);for(let J of X)if(J&&!Z.properties.class.includes(J))Z.properties.class.push(J);return Z}function IY(Z,Y=!1){if(Z.length===0)return[["",0]];let X=Z.split(/(\r?\n)/g),J=0,Q=[];for(let $=0;$<X.length;$+=2){let K=Y?X[$]+(X[$+1]||""):X[$];Q.push([K,J]),J+=X[$].length,J+=X[$+1]?.length||0}return Q}function M9(Z){let Y=IY(Z,!0).map(([Q])=>Q);function X(Q){if(Q===Z.length)return{line:Y.length-1,character:Y[Y.length-1].length};let $=Q,K=0;for(let W of Y){if($<W.length)break;$-=W.length,K++}return{line:K,character:$}}function J(Q,$){let K=0;for(let W=0;W<Q;W++)K+=Y[W].length;return K+=$,K}return{lines:Y,indexToPos:X,posToIndex:J}}function t6(Z,Y,X){let J=new Set;for(let $ of Z.matchAll(/:?lang=["']([^"']+)["']/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/(?:```|~~~)([\w-]+)/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/\\begin\{([\w-]+)\}/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let K=$[1].toLowerCase().trim(),W=K.includes("/")?K.split("/").pop():K;if(W)J.add(W)}if(!X)return Array.from(J);let Q=X.getBundledLanguages();return Array.from(J).filter(($)=>$&&Q[$])}var pX="light-dark()",N9=["color","background-color"];function _9(Z,Y){let X=0,J=[];for(let Q of Y){if(Q>X)J.push({...Z,content:Z.content.slice(X,Q),offset:Z.offset+X});X=Q}if(X<Z.content.length)J.push({...Z,content:Z.content.slice(X),offset:Z.offset+X});return J}function w9(Z,Y){let X=Array.from(Y instanceof Set?Y:new Set(Y)).sort((J,Q)=>J-Q);if(!X.length)return Z;return Z.map((J)=>{return J.flatMap((Q)=>{let $=X.filter((K)=>Q.offset<K&&K<Q.offset+Q.content.length).map((K)=>K-Q.offset).sort((K,W)=>K-W);if(!$.length)return Q;return _9(Q,$)})})}function A9(Z,Y,X,J,Q="css-vars"){let $={content:Z.content,explanation:Z.explanation,offset:Z.offset},K=Y.map((H)=>PY(Z.variants[H])),W=new Set(K.flatMap((H)=>Object.keys(H))),U={},z=(H,G)=>{let F=G==="color"?"":G==="background-color"?"-bg":`-${G}`;return X+Y[H]+(G==="color"?"":F)};return K.forEach((H,G)=>{for(let F of W){let M=H[F]||"inherit";if(G===0&&J&&N9.includes(F))if(J===pX&&K.length>1){let _=Y.findIndex((C)=>C==="light"),A=Y.findIndex((C)=>C==="dark");if(_===-1||A===-1)throw new YZ('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let P=K[_][F]||"inherit",B=K[A][F]||"inherit";if(U[F]=`light-dark(${P}, ${B})`,Q==="css-vars")U[z(G,F)]=M}else U[F]=M;else if(Q==="css-vars")U[z(G,F)]=M}}),$.htmlStyle=U,$}function PY(Z){let Y={};if(Z.color)Y.color=Z.color;if(Z.bgColor)Y["background-color"]=Z.bgColor;if(Z.fontStyle){if(Z.fontStyle&OZ.Italic)Y["font-style"]="italic";if(Z.fontStyle&OZ.Bold)Y["font-weight"]="bold";let X=[];if(Z.fontStyle&OZ.Underline)X.push("underline");if(Z.fontStyle&OZ.Strikethrough)X.push("line-through");if(X.length)Y["text-decoration"]=X.join(" ")}return Y}function gX(Z){if(typeof Z==="string")return Z;return Object.entries(Z).map(([Y,X])=>`${Y}:${X}`).join(";")}var e6=new WeakMap;function DY(Z,Y){e6.set(Z,Y)}function h0(Z){return e6.get(Z)}class q0{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(Z,Y){return new q0(Object.fromEntries(F9(Y).map((X)=>[X,GY])),Z)}constructor(...Z){if(Z.length===2){let[Y,X]=Z;this.lang=X,this._stacks=Y}else{let[Y,X,J]=Z;this.lang=X,this._stacks={[J]:Y}}}getInternalStack(Z=this.theme){return this._stacks[Z]}getScopes(Z=this.theme){return B9(this._stacks[Z])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function B9(Z){let Y=[],X=new Set;function J(Q){if(X.has(Q))return;X.add(Q);let $=Q?.nameScopesList?.scopeName;if($)Y.push($);if(Q.parent)J(Q.parent)}return J(Z),Y}function L9(Z,Y){if(!(Z instanceof q0))throw new YZ("Invalid grammar state");return Z.getInternalStack(Y)}function P9(){let Z=new WeakMap;function Y(X){if(!Z.has(X.meta)){let J=function(K){if(typeof K==="number"){if(K<0||K>X.source.length)throw new YZ(`Invalid decoration offset: ${K}. Code length: ${X.source.length}`);return{...Q.indexToPos(K),offset:K}}else{let W=Q.lines[K.line];if(W===void 0)throw new YZ(`Invalid decoration position ${JSON.stringify(K)}. Lines length: ${Q.lines.length}`);let U=K.character;if(U<0)U=W.length+U;if(U<0||U>W.length)throw new YZ(`Invalid decoration position ${JSON.stringify(K)}. Line ${K.line} length: ${W.length}`);return{...K,character:U,offset:Q.posToIndex(K.line,U)}}},Q=M9(X.source),$=(X.options.decorations||[]).map((K)=>({...K,start:J(K.start),end:J(K.end)}));R9($),Z.set(X.meta,{decorations:$,converter:Q,source:X.source})}return Z.get(X.meta)}return{name:"shiki:decorations",tokens(X){if(!this.options.decorations?.length)return;let Q=Y(this).decorations.flatMap((K)=>[K.start.offset,K.end.offset]);return w9(X,Q)},code(X){if(!this.options.decorations?.length)return;let J=Y(this),Q=Array.from(X.children).filter((H)=>H.type==="element"&&H.tagName==="span");if(Q.length!==J.converter.lines.length)throw new YZ(`Number of lines in code element (${Q.length}) does not match the number of lines in the source (${J.converter.lines.length}). Failed to apply decorations.`);function $(H,G,F,M){let _=Q[H],A="",P=-1,B=-1;if(G===0)P=0;if(F===0)B=0;if(F===Number.POSITIVE_INFINITY)B=_.children.length;if(P===-1||B===-1)for(let R=0;R<_.children.length;R++){if(A+=ZJ(_.children[R]),P===-1&&A.length===G)P=R+1;if(B===-1&&A.length===F)B=R+1}if(P===-1)throw new YZ(`Failed to find start index for decoration ${JSON.stringify(M.start)}`);if(B===-1)throw new YZ(`Failed to find end index for decoration ${JSON.stringify(M.end)}`);let C=_.children.slice(P,B);if(!M.alwaysWrap&&C.length===_.children.length)W(_,M,"line");else if(!M.alwaysWrap&&C.length===1&&C[0].type==="element")W(C[0],M,"token");else{let R={type:"element",tagName:"span",properties:{},children:C};W(R,M,"wrapper"),_.children.splice(P,C.length,R)}}function K(H,G){Q[H]=W(Q[H],G,"line")}function W(H,G,F){let M=G.properties||{},_=G.transform||((A)=>A);if(H.tagName=G.tagName||"span",H.properties={...H.properties,...M,class:H.properties.class},G.properties?.class)s6(H,G.properties.class);return H=_(H,F)||H,H}let U=[],z=J.decorations.sort((H,G)=>G.start.offset-H.start.offset||H.end.offset-G.end.offset);for(let H of z){let{start:G,end:F}=H;if(G.line===F.line)$(G.line,G.character,F.character,H);else if(G.line<F.line){$(G.line,G.character,Number.POSITIVE_INFINITY,H);for(let M=G.line+1;M<F.line;M++)U.unshift(()=>K(M,H));$(F.line,0,F.character,H)}}U.forEach((H)=>H())}}}function R9(Z){for(let Y=0;Y<Z.length;Y++){let X=Z[Y];if(X.start.offset>X.end.offset)throw new YZ(`Invalid decoration range: ${JSON.stringify(X.start)} - ${JSON.stringify(X.end)}`);for(let J=Y+1;J<Z.length;J++){let Q=Z[J],$=X.start.offset<=Q.start.offset&&Q.start.offset<X.end.offset,K=X.start.offset<Q.end.offset&&Q.end.offset<=X.end.offset,W=Q.start.offset<=X.start.offset&&X.start.offset<Q.end.offset,U=Q.start.offset<X.end.offset&&X.end.offset<=Q.end.offset;if($||K||W||U){if($&&K)continue;if(W&&U)continue;if(W&&X.start.offset===X.end.offset)continue;if(K&&Q.start.offset===Q.end.offset)continue;throw new YZ(`Decorations ${JSON.stringify(X.start)} and ${JSON.stringify(Q.start)} intersect.`)}}}}function ZJ(Z){if(Z.type==="text")return Z.value;if(Z.type==="element")return Z.children.map(ZJ).join("");return""}var C9=[P9()];function RY(Z){let Y=v9(Z.transformers||[]);return[...Y.pre,...Y.normal,...Y.post,...C9]}function v9(Z){let Y=[],X=[],J=[];for(let Q of Z)switch(Q.enforce){case"pre":Y.push(Q);break;case"post":X.push(Q);break;default:J.push(Q)}return{pre:Y,post:X,normal:J}}var a4=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],hX={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function I9(Z,Y){let X=Z.indexOf("\x1B",Y);if(X!==-1){if(Z[X+1]==="["){let J=Z.indexOf("m",X);if(J!==-1)return{sequence:Z.substring(X+2,J).split(";"),startPosition:X,position:J+1}}}return{position:Z.length}}function p6(Z){let Y=Z.shift();if(Y==="2"){let X=Z.splice(0,3).map((J)=>Number.parseInt(J));if(X.length!==3||X.some((J)=>Number.isNaN(J)))return;return{type:"rgb",rgb:X}}else if(Y==="5"){let X=Z.shift();if(X)return{type:"table",index:Number(X)}}}function D9(Z){let Y=[];while(Z.length>0){let X=Z.shift();if(!X)continue;let J=Number.parseInt(X);if(Number.isNaN(J))continue;if(J===0)Y.push({type:"resetAll"});else if(J<=9){if(hX[J])Y.push({type:"setDecoration",value:hX[J]})}else if(J<=29){let Q=hX[J-20];if(Q){if(Y.push({type:"resetDecoration",value:Q}),Q==="dim")Y.push({type:"resetDecoration",value:"bold"})}}else if(J<=37)Y.push({type:"setForegroundColor",value:{type:"named",name:a4[J-30]}});else if(J===38){let Q=p6(Z);if(Q)Y.push({type:"setForegroundColor",value:Q})}else if(J===39)Y.push({type:"resetForegroundColor"});else if(J<=47)Y.push({type:"setBackgroundColor",value:{type:"named",name:a4[J-40]}});else if(J===48){let Q=p6(Z);if(Q)Y.push({type:"setBackgroundColor",value:Q})}else if(J===49)Y.push({type:"resetBackgroundColor"});else if(J===53)Y.push({type:"setDecoration",value:"overline"});else if(J===55)Y.push({type:"resetDecoration",value:"overline"});else if(J>=90&&J<=97)Y.push({type:"setForegroundColor",value:{type:"named",name:a4[J-90+8]}});else if(J>=100&&J<=107)Y.push({type:"setBackgroundColor",value:{type:"named",name:a4[J-100+8]}})}return Y}function V9(){let Z=null,Y=null,X=new Set;return{parse(J){let Q=[],$=0;do{let K=I9(J,$),W=K.sequence?J.substring($,K.startPosition):J.substring($);if(W.length>0)Q.push({value:W,foreground:Z,background:Y,decorations:new Set(X)});if(K.sequence){let U=D9(K.sequence);for(let z of U)if(z.type==="resetAll")Z=null,Y=null,X.clear();else if(z.type==="resetForegroundColor")Z=null;else if(z.type==="resetBackgroundColor")Y=null;else if(z.type==="resetDecoration")X.delete(z.value);for(let z of U)if(z.type==="setForegroundColor")Z=z.value;else if(z.type==="setBackgroundColor")Y=z.value;else if(z.type==="setDecoration")X.add(z.value)}$=K.position}while($<J.length);return Q}}}var E9={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function b9(Z=E9){function Y(W){return Z[W]}function X(W){return`#${W.map((U)=>Math.max(0,Math.min(U,255)).toString(16).padStart(2,"0")).join("")}`}let J;function Q(){if(J)return J;J=[];for(let z=0;z<a4.length;z++)J.push(Y(a4[z]));let W=[0,95,135,175,215,255];for(let z=0;z<6;z++)for(let H=0;H<6;H++)for(let G=0;G<6;G++)J.push(X([W[z],W[H],W[G]]));let U=8;for(let z=0;z<24;z++,U+=10)J.push(X([U,U,U]));return J}function $(W){return Q()[W]}function K(W){switch(W.type){case"named":return Y(W.name);case"rgb":return X(W.rgb);case"table":return $(W.index)}}return{value:K}}var T9={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function f9(Z,Y,X){let J=LY(Z,X),Q=IY(Y),$=Object.fromEntries(a4.map((U)=>{let z=`terminal.ansi${U[0].toUpperCase()}${U.substring(1)}`,H=Z.colors?.[z];return[U,H||T9[U]]})),K=b9($),W=V9();return Q.map((U)=>W.parse(U[0]).map((z)=>{let H,G;if(z.decorations.has("reverse"))H=z.background?K.value(z.background):Z.bg,G=z.foreground?K.value(z.foreground):Z.fg;else H=z.foreground?K.value(z.foreground):Z.fg,G=z.background?K.value(z.background):void 0;if(H=j4(H,J),G=j4(G,J),z.decorations.has("dim"))H=j9(H);let F=OZ.None;if(z.decorations.has("bold"))F|=OZ.Bold;if(z.decorations.has("italic"))F|=OZ.Italic;if(z.decorations.has("underline"))F|=OZ.Underline;if(z.decorations.has("strikethrough"))F|=OZ.Strikethrough;return{content:z.value,offset:U[1],color:H,bgColor:G,fontStyle:F}}))}function j9(Z){let Y=Z.match(/#([0-9a-f]{3,8})/i);if(Y){let J=Y[1];if(J.length===8){let Q=Math.round(Number.parseInt(J.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${J.slice(0,6)}${Q}`}else if(J.length===6)return`#${J}80`;else if(J.length===4){let Q=J[0],$=J[1],K=J[2],W=J[3],U=Math.round(Number.parseInt(`${W}${W}`,16)/2).toString(16).padStart(2,"0");return`#${Q}${Q}${$}${$}${K}${K}${U}`}else if(J.length===3){let Q=J[0],$=J[1],K=J[2];return`#${Q}${Q}${$}${$}${K}${K}80`}}let X=Z.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);if(X)return`var(${X[1]}-dim)`;return Z}function cX(Z,Y,X={}){let{theme:J=Z.getLoadedThemes()[0]}=X,Q=Z.resolveLangAlias(X.lang||"text");if(uX(Q)||mX(J))return IY(Y).map((U)=>[{content:U[0],offset:U[1]}]);let{theme:$,colorMap:K}=Z.setTheme(J);if(Q==="ansi")return f9($,Y,X);let W=Z.getLanguage(X.lang||"text");if(X.grammarState){if(X.grammarState.lang!==W.name)throw new YZ(`Grammar state language "${X.grammarState.lang}" does not match highlight language "${W.name}"`);if(!X.grammarState.themes.includes($.name))throw new YZ(`Grammar state themes "${X.grammarState.themes}" do not contain highlight theme "${$.name}"`)}return y9(Y,W,$,K,X)}function S9(...Z){if(Z.length===2)return h0(Z[1]);let[Y,X,J={}]=Z,{lang:Q="text",theme:$=Y.getLoadedThemes()[0]}=J;if(uX(Q)||mX($))throw new YZ("Plain language does not have grammar state");if(Q==="ansi")throw new YZ("ANSI language does not have grammar state");let{theme:K,colorMap:W}=Y.setTheme($),U=Y.getLanguage(Q);return new q0(dX(X,U,K,W,J).stateStack,U.name,K.name)}function y9(Z,Y,X,J,Q){let $=dX(Z,Y,X,J,Q),K=new q0($.stateStack,Y.name,X.name);return DY($.tokens,K),$.tokens}function dX(Z,Y,X,J,Q){let $=LY(X,Q),{tokenizeMaxLineLength:K=0,tokenizeTimeLimit:W=500}=Q,U=IY(Z),z=Q.grammarState?L9(Q.grammarState,X.name)??GY:Q.grammarContextCode!=null?dX(Q.grammarContextCode,Y,X,J,{...Q,grammarState:void 0,grammarContextCode:void 0}).stateStack:GY,H=[],G=[];for(let F=0,M=U.length;F<M;F++){let[_,A]=U[F];if(_===""){H=[],G.push([]);continue}if(K>0&&_.length>=K){H=[],G.push([{content:_,offset:A,color:"",fontStyle:0}]);continue}let P,B,C;if(Q.includeExplanation)P=Y.tokenizeLine(_,z,W),B=P.tokens,C=0;let R=Y.tokenizeLine2(_,z,W),D=R.tokens.length/2;for(let j=0;j<D;j++){let E=R.tokens[2*j],c=j+1<D?R.tokens[2*j+2]:_.length;if(E===c)continue;let i=R.tokens[2*j+1],g=j4(J[r4.getForeground(i)],$),r=r4.getFontStyle(i),o={content:_.substring(E,c),offset:A+E,color:g,fontStyle:r};if(Q.includeExplanation){let F4=[];if(Q.includeExplanation!=="scopeName")for(let gZ of X.settings){let h4;switch(typeof gZ.scope){case"string":h4=gZ.scope.split(/,/).map((D4)=>D4.trim());break;case"object":h4=gZ.scope;break;default:continue}F4.push({settings:gZ,selectors:h4.map((D4)=>D4.split(/ /))})}o.explanation=[];let M4=0;while(E+M4<c){let gZ=B[C],h4=_.substring(gZ.startIndex,gZ.endIndex);M4+=h4.length,o.explanation.push({content:h4,scopes:Q.includeExplanation==="scopeName"?k9(gZ.scopes):h9(F4,gZ.scopes)}),C+=1}}H.push(o)}G.push(H),H=[],z=R.ruleStack}return{tokens:G,stateStack:z}}function k9(Z){return Z.map((Y)=>({scopeName:Y}))}function h9(Z,Y){let X=[];for(let J=0,Q=Y.length;J<Q;J++){let $=Y[J];X[J]={scopeName:$,themeMatches:g9(Z,$,Y.slice(0,J))}}return X}function c6(Z,Y){return Z===Y||Y.substring(0,Z.length)===Z&&Y[Z.length]==="."}function x9(Z,Y,X){if(!c6(Z[Z.length-1],Y))return!1;let J=Z.length-2,Q=X.length-1;while(J>=0&&Q>=0){if(c6(Z[J],X[Q]))J-=1;Q-=1}if(J===-1)return!0;return!1}function g9(Z,Y,X){let J=[];for(let{selectors:Q,settings:$}of Z)for(let K of Q)if(x9(K,Y,X)){J.push($);break}return J}function YJ(Z,Y,X){let J=Object.entries(X.themes).filter((U)=>U[1]).map((U)=>({color:U[0],theme:U[1]})),Q=J.map((U)=>{let z=cX(Z,Y,{...X,theme:U.theme}),H=h0(z),G=typeof U.theme==="string"?U.theme:U.theme.name;return{tokens:z,state:H,theme:G}}),$=u9(...Q.map((U)=>U.tokens)),K=$[0].map((U,z)=>U.map((H,G)=>{let F={content:H.content,variants:{},offset:H.offset};if("includeExplanation"in X&&X.includeExplanation)F.explanation=H.explanation;return $.forEach((M,_)=>{let{content:A,explanation:P,offset:B,...C}=M[z][G];F.variants[J[_].color]=C}),F})),W=Q[0].state?new q0(Object.fromEntries(Q.map((U)=>[U.theme,U.state?.getInternalStack(U.theme)])),Q[0].state.lang):void 0;if(W)DY(K,W);return K}function u9(...Z){let Y=Z.map(()=>[]),X=Z.length;for(let J=0;J<Z[0].length;J++){let Q=Z.map((U)=>U[J]),$=Y.map(()=>[]);Y.forEach((U,z)=>U.push($[z]));let K=Q.map(()=>0),W=Q.map((U)=>U[0]);while(W.every((U)=>U)){let U=Math.min(...W.map((z)=>z.content.length));for(let z=0;z<X;z++){let H=W[z];if(H.content.length===U)$[z].push(H),K[z]+=1,W[z]=Q[z][K[z]];else $[z].push({...H,content:H.content.slice(0,U)}),W[z]={...H,content:H.content.slice(U),offset:H.offset+U}}}}return Y}function CY(Z,Y,X){let J,Q,$,K,W,U;if("themes"in X){let{defaultColor:z="light",cssVariablePrefix:H="--shiki-",colorsRendering:G="css-vars"}=X,F=Object.entries(X.themes).filter((B)=>B[1]).map((B)=>({color:B[0],theme:B[1]})).sort((B,C)=>B.color===z?-1:C.color===z?1:0);if(F.length===0)throw new YZ("`themes` option must not be empty");let M=YJ(Z,Y,X);if(U=h0(M),z&&pX!==z&&!F.find((B)=>B.color===z))throw new YZ(`\`themes\` option must contain the defaultColor key \`${z}\``);let _=F.map((B)=>Z.getTheme(B.theme)),A=F.map((B)=>B.color);if($=M.map((B)=>B.map((C)=>A9(C,A,H,z,G))),U)DY($,U);let P=F.map((B)=>LY(B.theme,X));Q=d6(F,_,P,H,z,"fg",G),J=d6(F,_,P,H,z,"bg",G),K=`shiki-themes ${_.map((B)=>B.name).join(" ")}`,W=z?void 0:[Q,J].join(";")}else if("theme"in X){let z=LY(X.theme,X);$=cX(Z,Y,X);let H=Z.getTheme(X.theme);J=j4(H.bg,z),Q=j4(H.fg,z),K=H.name,U=h0($)}else throw new YZ("Invalid options, either `theme` or `themes` must be provided");return{tokens:$,fg:Q,bg:J,themeName:K,rootStyle:W,grammarState:U}}function d6(Z,Y,X,J,Q,$,K){return Z.map((W,U)=>{let z=j4(Y[U][$],X[U])||"inherit",H=`${J+W.color}${$==="bg"?"-bg":""}:${z}`;if(U===0&&Q){if(Q===pX&&Z.length>1){let G=Z.findIndex((A)=>A.color==="light"),F=Z.findIndex((A)=>A.color==="dark");if(G===-1||F===-1)throw new YZ('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let M=j4(Y[G][$],X[G])||"inherit",_=j4(Y[F][$],X[F])||"inherit";return`light-dark(${M}, ${_});${H}`}return z}if(K==="css-vars")return H;return null}).filter((W)=>!!W).join(";")}function vY(Z,Y,X,J={meta:{},options:X,codeToHast:(Q,$)=>vY(Z,Q,$),codeToTokens:(Q,$)=>CY(Z,Q,$)}){let Q=Y;for(let _ of RY(X))Q=_.preprocess?.call(J,Q,X)||Q;let{tokens:$,fg:K,bg:W,themeName:U,rootStyle:z,grammarState:H}=CY(Z,Q,X),{mergeWhitespaces:G=!0,mergeSameStyleTokens:F=!1}=X;if(G===!0)$=p9($);else if(G==="never")$=c9($);if(F)$=d9($);let M={...J,get source(){return Q}};for(let _ of RY(X))$=_.tokens?.call(M,$)||$;return m9($,{...X,fg:K,bg:W,themeName:U,rootStyle:X.rootStyle===!1?!1:X.rootStyle??z},M,H)}function m9(Z,Y,X,J=h0(Z)){let Q=RY(Y),$=[],K={type:"root",children:[]},{structure:W="classic",tabindex:U="0"}=Y,z={class:`shiki ${Y.themeName||""}`};if(Y.rootStyle!==!1)if(Y.rootStyle!=null)z.style=Y.rootStyle;else z.style=`background-color:${Y.bg};color:${Y.fg}`;if(U!==!1&&U!=null)z.tabindex=U.toString();for(let[A,P]of Object.entries(Y.meta||{}))if(!A.startsWith("_"))z[A]=P;let H={type:"element",tagName:"pre",properties:z,children:[],data:Y.data},G={type:"element",tagName:"code",properties:{},children:$},F=[],M={...X,structure:W,addClassToHast:s6,get source(){return X.source},get tokens(){return Z},get options(){return Y},get root(){return K},get pre(){return H},get code(){return G},get lines(){return F}};if(Z.forEach((A,P)=>{if(P){if(W==="inline")K.children.push({type:"element",tagName:"br",properties:{},children:[]});else if(W==="classic")$.push({type:"text",value:`
148
- `})}let B={type:"element",tagName:"span",properties:{class:"line"},children:[]},C=0;for(let R of A){let D={type:"element",tagName:"span",properties:{...R.htmlAttrs},children:[{type:"text",value:R.content}]},j=gX(R.htmlStyle||PY(R));if(j)D.properties.style=j;for(let E of Q)D=E?.span?.call(M,D,P+1,C,B,R)||D;if(W==="inline")K.children.push(D);else if(W==="classic")B.children.push(D);C+=R.content.length}if(W==="classic"){for(let R of Q)B=R?.line?.call(M,B,P+1)||B;F.push(B),$.push(B)}else if(W==="inline")F.push(B)}),W==="classic"){for(let A of Q)G=A?.code?.call(M,G)||G;H.children.push(G);for(let A of Q)H=A?.pre?.call(M,H)||H;K.children.push(H)}else if(W==="inline"){let A=[],P={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let R of K.children)if(R.type==="element"&&R.tagName==="br")A.push(P),P={type:"element",tagName:"span",properties:{class:"line"},children:[]};else if(R.type==="element"||R.type==="text")P.children.push(R);A.push(P);let C={type:"element",tagName:"code",properties:{},children:A};for(let R of Q)C=R?.code?.call(M,C)||C;K.children=[];for(let R=0;R<C.children.length;R++){if(R>0)K.children.push({type:"element",tagName:"br",properties:{},children:[]});let D=C.children[R];if(D.type==="element")K.children.push(...D.children)}}let _=K;for(let A of Q)_=A?.root?.call(M,_)||_;if(J)DY(_,J);return _}function p9(Z){return Z.map((Y)=>{let X=[],J="",Q;return Y.forEach(($,K)=>{let U=!($.fontStyle&&($.fontStyle&OZ.Underline||$.fontStyle&OZ.Strikethrough));if(U&&$.content.match(/^\s+$/)&&Y[K+1]){if(Q===void 0)Q=$.offset;J+=$.content}else if(J){if(U)X.push({...$,offset:Q,content:J+$.content});else X.push({content:J,offset:Q},$);Q=void 0,J=""}else X.push($)}),X})}function c9(Z){return Z.map((Y)=>{return Y.flatMap((X)=>{if(X.content.match(/^\s+$/))return X;let J=X.content.match(/^(\s*)(.*?)(\s*)$/);if(!J)return X;let[,Q,$,K]=J;if(!Q&&!K)return X;let W=[{...X,offset:X.offset+Q.length,content:$}];if(Q)W.unshift({content:Q,offset:X.offset});if(K)W.push({content:K,offset:X.offset+Q.length+$.length});return W})})}function d9(Z){return Z.map((Y)=>{let X=[];for(let J of Y){if(X.length===0){X.push({...J});continue}let Q=X[X.length-1],$=gX(Q.htmlStyle||PY(Q)),K=gX(J.htmlStyle||PY(J)),W=Q.fontStyle&&(Q.fontStyle&OZ.Underline||Q.fontStyle&OZ.Strikethrough),U=J.fontStyle&&(J.fontStyle&OZ.Underline||J.fontStyle&OZ.Strikethrough);if(!W&&!U&&$===K)Q.content+=J.content;else X.push({...J})}return X})}var l9=kX;function i9(Z,Y,X){let J={meta:{},options:X,codeToHast:($,K)=>vY(Z,$,K),codeToTokens:($,K)=>CY(Z,$,K)},Q=l9(vY(Z,Y,X,J));for(let $ of RY(X))Q=$.postprocess?.call(J,Q,X)||Q;return Q}var l6={light:"#333333",dark:"#bbbbbb"},i6={light:"#fffffe",dark:"#1e1e1e"},r6="__shiki_resolved";function lX(Z){if(Z?.[r6])return Z;let Y={...Z};if(Y.tokenColors&&!Y.settings)Y.settings=Y.tokenColors,delete Y.tokenColors;Y.type||="dark",Y.colorReplacements={...Y.colorReplacements},Y.settings||=[];let{bg:X,fg:J}=Y;if(!X||!J){let W=Y.settings?Y.settings.find((U)=>!U.name&&!U.scope):void 0;if(W?.settings?.foreground)J=W.settings.foreground;if(W?.settings?.background)X=W.settings.background;if(!J&&Y?.colors?.["editor.foreground"])J=Y.colors["editor.foreground"];if(!X&&Y?.colors?.["editor.background"])X=Y.colors["editor.background"];if(!J)J=Y.type==="light"?l6.light:l6.dark;if(!X)X=Y.type==="light"?i6.light:i6.dark;Y.fg=J,Y.bg=X}if(!(Y.settings[0]&&Y.settings[0].settings&&!Y.settings[0].scope))Y.settings.unshift({settings:{foreground:Y.fg,background:Y.bg}});let Q=0,$=new Map;function K(W){if($.has(W))return $.get(W);Q+=1;let U=`#${Q.toString(16).padStart(8,"0").toLowerCase()}`;if(Y.colorReplacements?.[`#${U}`])return K(W);return $.set(W,U),U}Y.settings=Y.settings.map((W)=>{let U=W.settings?.foreground&&!W.settings.foreground.startsWith("#"),z=W.settings?.background&&!W.settings.background.startsWith("#");if(!U&&!z)return W;let H={...W,settings:{...W.settings}};if(U){let G=K(W.settings.foreground);Y.colorReplacements[G]=W.settings.foreground,H.settings.foreground=G}if(z){let G=K(W.settings.background);Y.colorReplacements[G]=W.settings.background,H.settings.background=G}return H});for(let W of Object.keys(Y.colors||{}))if(W==="editor.foreground"||W==="editor.background"||W.startsWith("terminal.ansi")){if(!Y.colors[W]?.startsWith("#")){let U=K(Y.colors[W]);Y.colorReplacements[U]=Y.colors[W],Y.colors[W]=U}}return Object.defineProperty(Y,r6,{enumerable:!1,writable:!1,value:!0}),Y}async function XJ(Z){return Array.from(new Set((await Promise.all(Z.filter((Y)=>!n6(Y)).map(async(Y)=>await o6(Y).then((X)=>Array.isArray(X)?X:[X])))).flat()))}async function JJ(Z){return(await Promise.all(Z.map(async(X)=>a6(X)?null:lX(await o6(X))))).filter((X)=>!!X)}var xX=3,r9=!1;function o9(Z,Y=3){if(!xX)return;if(typeof xX==="number"&&Y>xX)return;if(r9)throw Error(`[SHIKI DEPRECATE]: ${Z}`);else console.trace(`[SHIKI DEPRECATE]: ${Z}`)}class s4 extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function QJ(Z,Y){if(!Y)return Z;if(Y[Z]){let X=new Set([Z]);while(Y[Z]){if(Z=Y[Z],X.has(Z))throw new s4(`Circular alias \`${Array.from(X).join(" -> ")} -> ${Z}\``);X.add(Z)}}return Z}class $J extends G6{constructor(Z,Y,X,J={}){super(Z);this._resolver=Z,this._themes=Y,this._langs=X,this._alias=J,this._themes.map((Q)=>this.loadTheme(Q)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(Z){if(typeof Z==="string")return this._resolvedThemes.get(Z);else return this.loadTheme(Z)}loadTheme(Z){let Y=lX(Z);if(Y.name)this._resolvedThemes.set(Y.name,Y),this._loadedThemesCache=null;return Y}getLoadedThemes(){if(!this._loadedThemesCache)this._loadedThemesCache=[...this._resolvedThemes.keys()];return this._loadedThemesCache}setTheme(Z){let Y=this._textmateThemeCache.get(Z);if(!Y)Y=V0.createFromRawTheme(Z),this._textmateThemeCache.set(Z,Y);this._syncRegistry.setTheme(Y)}getGrammar(Z){return Z=QJ(Z,this._alias),this._resolvedGrammars.get(Z)}loadLanguage(Z){if(this.getGrammar(Z.name))return;let Y=new Set([...this._langMap.values()].filter((Q)=>Q.embeddedLangsLazy?.includes(Z.name)));this._resolver.addLanguage(Z);let X={balancedBracketSelectors:Z.balancedBracketSelectors||["*"],unbalancedBracketSelectors:Z.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(Z.scopeName,Z);let J=this.loadGrammarWithConfiguration(Z.scopeName,1,X);if(J.name=Z.name,this._resolvedGrammars.set(Z.name,J),Z.aliases)Z.aliases.forEach((Q)=>{this._alias[Q]=Z.name});if(this._loadedLanguagesCache=null,Y.size)for(let Q of Y)this._resolvedGrammars.delete(Q.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(Q.scopeName),this._syncRegistry?._grammars?.delete(Q.scopeName),this.loadLanguage(this._langMap.get(Q.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(Z){for(let J of Z)this.resolveEmbeddedLanguages(J);let Y=Array.from(this._langGraph.entries()),X=Y.filter(([J,Q])=>!Q);if(X.length){let J=Y.filter(([Q,$])=>{if(!$)return!1;return($.embeddedLanguages||$.embeddedLangs)?.some((W)=>X.map(([U])=>U).includes(W))}).filter((Q)=>!X.includes(Q));throw new s4(`Missing languages ${X.map(([Q])=>`\`${Q}\``).join(", ")}, required by ${J.map(([Q])=>`\`${Q}\``).join(", ")}`)}for(let[J,Q]of Y)this._resolver.addLanguage(Q);for(let[J,Q]of Y)this.loadLanguage(Q)}getLoadedLanguages(){if(!this._loadedLanguagesCache)this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])];return this._loadedLanguagesCache}resolveEmbeddedLanguages(Z){this._langMap.set(Z.name,Z),this._langGraph.set(Z.name,Z);let Y=Z.embeddedLanguages??Z.embeddedLangs;if(Y)for(let X of Y)this._langGraph.set(X,this._langMap.get(X))}}class KJ{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(Z,Y){this._onigLib={createOnigScanner:(X)=>Z.createScanner(X),createOnigString:(X)=>Z.createString(X)},Y.forEach((X)=>this.addLanguage(X))}get onigLib(){return this._onigLib}getLangRegistration(Z){return this._langs.get(Z)}loadGrammar(Z){return this._scopeToLang.get(Z)}addLanguage(Z){if(this._langs.set(Z.name,Z),Z.aliases)Z.aliases.forEach((Y)=>{this._langs.set(Y,Z)});if(this._scopeToLang.set(Z.scopeName,Z),Z.injectTo)Z.injectTo.forEach((Y)=>{if(!this._injections.get(Y))this._injections.set(Y,[]);this._injections.get(Y).push(Z.scopeName)})}getInjections(Z){let Y=Z.split("."),X=[];for(let J=1;J<=Y.length;J++){let Q=Y.slice(0,J).join(".");X=[...X,...this._injections.get(Q)||[]]}return X}}var k0=0;function n9(Z){if(k0+=1,Z.warnings!==!1&&k0>=10&&k0%10===0)console.warn(`[Shiki] ${k0} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let Y=!1;if(!Z.engine)throw new s4("`engine` option is required for synchronous mode");let X=(Z.langs||[]).flat(1),J=(Z.themes||[]).flat(1).map(lX),Q=new KJ(Z.engine,X),$=new $J(Q,J,X,Z.langAlias),K;function W(R){return QJ(R,Z.langAlias)}function U(R){B();let D=$.getGrammar(typeof R==="string"?R:R.name);if(!D)throw new s4(`Language \`${R}\` not found, you may need to load it first`);return D}function z(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};B();let D=$.getTheme(R);if(!D)throw new s4(`Theme \`${R}\` not found, you may need to load it first`);return D}function H(R){B();let D=z(R);if(K!==R)$.setTheme(D),K=R;let j=$.getColorMap();return{theme:D,colorMap:j}}function G(){return B(),$.getLoadedThemes()}function F(){return B(),$.getLoadedLanguages()}function M(...R){B(),$.loadLanguages(R.flat(1))}async function _(...R){return M(await XJ(R))}function A(...R){B();for(let D of R.flat(1))$.loadTheme(D)}async function P(...R){return B(),A(await JJ(R))}function B(){if(Y)throw new s4("Shiki instance has been disposed")}function C(){if(Y)return;Y=!0,$.dispose(),k0-=1}return{setTheme:H,getTheme:z,getLanguage:U,getLoadedThemes:G,getLoadedLanguages:F,resolveLangAlias:W,loadLanguage:_,loadLanguageSync:M,loadTheme:P,loadThemeSync:A,dispose:C,[Symbol.dispose]:C}}async function a9(Z){if(!Z.engine)o9("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[Y,X,J]=await Promise.all([JJ(Z.themes||[]),XJ(Z.langs||[]),Z.engine]);return n9({...Z,themes:Y,langs:X,engine:J})}async function s9(Z){let Y=await a9(Z);return{getLastGrammarState:(...X)=>S9(Y,...X),codeToTokensBase:(X,J)=>cX(Y,X,J),codeToTokensWithThemes:(X,J)=>YJ(Y,X,J),codeToTokens:(X,J)=>CY(Y,X,J),codeToHast:(X,J)=>vY(Y,X,J),codeToHtml:(X,J)=>i9(Y,X,J),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...Y,getInternalContext:()=>Y}}function WJ(Z){let{langs:Y,themes:X,engine:J}=Z;async function Q($){function K(G){if(typeof G==="string"){if(G=$.langAlias?.[G]||G,n6(G))return[];let F=Y[G];if(!F)throw new YZ(`Language \`${G}\` is not included in this bundle. You may want to load it from external source.`);return F}return G}function W(G){if(a6(G))return"none";if(typeof G==="string"){let F=X[G];if(!F)throw new YZ(`Theme \`${G}\` is not included in this bundle. You may want to load it from external source.`);return F}return G}let U=($.themes??[]).map((G)=>W(G)),z=($.langs??[]).map((G)=>K(G)),H=await s9({engine:$.engine??J(),...$,themes:U,langs:z});return{...H,loadLanguage(...G){return H.loadLanguage(...G.map(K))},loadTheme(...G){return H.loadTheme(...G.map(W))},getBundledLanguages(){return Y},getBundledThemes(){return X}}}return Q}function t9(Z){let Y;async function X(J={}){if(!Y){Y=Z({...J,themes:[],langs:[]});let Q=await Y;return await Promise.all([Q.loadTheme(...J.themes||[]),Q.loadLanguage(...J.langs||[])]),Q}else{let Q=await Y;return await Promise.all([Q.loadTheme(...J.themes||[]),Q.loadLanguage(...J.langs||[])]),Q}}return X}function UJ(Z,Y){let X=t9(Z);async function J(Q,$){let K=await X({langs:[$.lang],themes:"theme"in $?[$.theme]:Object.values($.themes)}),W=await Y?.guessEmbeddedLanguages?.(Q,$.lang,K);if(W)await K.loadLanguage(...W);return K}return{getSingletonHighlighter(Q){return X(Q)},async codeToHtml(Q,$){return(await J(Q,$)).codeToHtml(Q,$)},async codeToHast(Q,$){return(await J(Q,$)).codeToHast(Q,$)},async codeToTokens(Q,$){return(await J(Q,$)).codeToTokens(Q,$)},async codeToTokensBase(Q,$){return(await J(Q,$)).codeToTokensBase(Q,$)},async codeToTokensWithThemes(Q,$){return(await J(Q,$)).codeToTokensWithThemes(Q,$)},async getLastGrammarState(Q,$){return(await X({langs:[$.lang],themes:[$.theme]})).getLastGrammarState(Q,$)}}}var zJ=[{id:"abap",name:"ABAP",import:()=>import("./chunk-2kka9ex2.js")},{id:"actionscript-3",name:"ActionScript",import:()=>import("./chunk-bngqptzm.js")},{id:"ada",name:"Ada",import:()=>import("./chunk-2gr7rdv0.js")},{id:"angular-html",name:"Angular HTML",import:()=>import("./chunk-4g796wg5.js")},{id:"angular-ts",name:"Angular TypeScript",import:()=>import("./chunk-frzyyytq.js")},{id:"apache",name:"Apache Conf",import:()=>import("./chunk-hvekwfwd.js")},{id:"apex",name:"Apex",import:()=>import("./chunk-97bsgfnr.js")},{id:"apl",name:"APL",import:()=>import("./chunk-1163kxya.js")},{id:"applescript",name:"AppleScript",import:()=>import("./chunk-cyd358a8.js")},{id:"ara",name:"Ara",import:()=>import("./chunk-91rrbsk7.js")},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>import("./chunk-te7k3eqj.js")},{id:"asm",name:"Assembly",import:()=>import("./chunk-jy5kmp4s.js")},{id:"astro",name:"Astro",import:()=>import("./chunk-ty5eswjv.js")},{id:"awk",name:"AWK",import:()=>import("./chunk-b4fn3tre.js")},{id:"ballerina",name:"Ballerina",import:()=>import("./chunk-45dyg3fv.js")},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>import("./chunk-w8vzpn90.js")},{id:"beancount",name:"Beancount",import:()=>import("./chunk-g30bcqjk.js")},{id:"berry",name:"Berry",aliases:["be"],import:()=>import("./chunk-trx18gxg.js")},{id:"bibtex",name:"BibTeX",import:()=>import("./chunk-ywas7wb8.js")},{id:"bicep",name:"Bicep",import:()=>import("./chunk-azxn0zvz.js")},{id:"blade",name:"Blade",import:()=>import("./chunk-v1e0cwqh.js")},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>import("./chunk-eyty7ng4.js")},{id:"c",name:"C",import:()=>import("./chunk-6hbnk94n.js")},{id:"c3",name:"C3",import:()=>import("./chunk-7893pky5.js")},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>import("./chunk-8chx87e7.js")},{id:"cairo",name:"Cairo",import:()=>import("./chunk-r1enj0f0.js")},{id:"clarity",name:"Clarity",import:()=>import("./chunk-n9zmzbyq.js")},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>import("./chunk-2qx9kzj1.js")},{id:"cmake",name:"CMake",import:()=>import("./chunk-gphyz2x3.js")},{id:"cobol",name:"COBOL",import:()=>import("./chunk-tchg9ygq.js")},{id:"codeowners",name:"CODEOWNERS",import:()=>import("./chunk-4j4w856j.js")},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>import("./chunk-09f94dtz.js")},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>import("./chunk-03bb6pab.js")},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>import("./chunk-nv58ta3s.js")},{id:"coq",name:"Coq",import:()=>import("./chunk-tpyp8wqr.js")},{id:"cpp",name:"C++",aliases:["c++"],import:()=>import("./chunk-eh3cemzk.js")},{id:"crystal",name:"Crystal",import:()=>import("./chunk-f6cbjh6q.js")},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>import("./chunk-crjf70s3.js")},{id:"css",name:"CSS",import:()=>import("./chunk-ksy4d0za.js")},{id:"csv",name:"CSV",import:()=>import("./chunk-0bpvpy2e.js")},{id:"cue",name:"CUE",import:()=>import("./chunk-b68ekt52.js")},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>import("./chunk-mfexzmw2.js")},{id:"d",name:"D",import:()=>import("./chunk-4wmmjwq3.js")},{id:"dart",name:"Dart",import:()=>import("./chunk-wb0ms9q0.js")},{id:"dax",name:"DAX",import:()=>import("./chunk-t5z5e89a.js")},{id:"desktop",name:"Desktop",import:()=>import("./chunk-1dwn0qqb.js")},{id:"diff",name:"Diff",import:()=>import("./chunk-cegx2zze.js")},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>import("./chunk-86em0evs.js")},{id:"dotenv",name:"dotEnv",import:()=>import("./chunk-emdn1c33.js")},{id:"dream-maker",name:"Dream Maker",import:()=>import("./chunk-c1345z85.js")},{id:"edge",name:"Edge",import:()=>import("./chunk-sd6qvm4t.js")},{id:"elixir",name:"Elixir",import:()=>import("./chunk-acceg8yk.js")},{id:"elm",name:"Elm",import:()=>import("./chunk-yj27rmw2.js")},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>import("./chunk-28p35k17.js")},{id:"erb",name:"ERB",import:()=>import("./chunk-htgt048s.js")},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>import("./chunk-cm6vfvym.js")},{id:"fennel",name:"Fennel",import:()=>import("./chunk-e112438q.js")},{id:"fish",name:"Fish",import:()=>import("./chunk-xk0abc6t.js")},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>import("./chunk-tvbj84md.js")},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>import("./chunk-stp38gza.js")},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>import("./chunk-jhwm3phf.js")},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>import("./chunk-p70r0dds.js")},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:()=>import("./chunk-8m5dqftt.js")},{id:"gdscript",name:"GDScript",aliases:["gd"],import:()=>import("./chunk-2m3g6fah.js")},{id:"gdshader",name:"GDShader",import:()=>import("./chunk-17zj2hd5.js")},{id:"genie",name:"Genie",import:()=>import("./chunk-y3gfd4y3.js")},{id:"gherkin",name:"Gherkin",import:()=>import("./chunk-mp6yhf6a.js")},{id:"git-commit",name:"Git Commit Message",import:()=>import("./chunk-9gnhztzd.js")},{id:"git-rebase",name:"Git Rebase Message",import:()=>import("./chunk-4zemyepb.js")},{id:"gleam",name:"Gleam",import:()=>import("./chunk-tpgf3t6p.js")},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>import("./chunk-0cz1ygrn.js")},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>import("./chunk-4mw5szy1.js")},{id:"glsl",name:"GLSL",import:()=>import("./chunk-m7bwshtn.js")},{id:"gn",name:"GN",import:()=>import("./chunk-0myk23dw.js")},{id:"gnuplot",name:"Gnuplot",import:()=>import("./chunk-bf0pjbfa.js")},{id:"go",name:"Go",import:()=>import("./chunk-ts98e90r.js")},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>import("./chunk-rxs4gexg.js")},{id:"groovy",name:"Groovy",import:()=>import("./chunk-4ecfe9a1.js")},{id:"hack",name:"Hack",import:()=>import("./chunk-vjvr9n6y.js")},{id:"haml",name:"Ruby Haml",import:()=>import("./chunk-bb9mvt9d.js")},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>import("./chunk-9dh8d15f.js")},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>import("./chunk-yz8sseev.js")},{id:"haxe",name:"Haxe",import:()=>import("./chunk-ss233wsa.js")},{id:"hcl",name:"HashiCorp HCL",import:()=>import("./chunk-fcexqvhh.js")},{id:"hjson",name:"Hjson",import:()=>import("./chunk-px75djc6.js")},{id:"hlsl",name:"HLSL",import:()=>import("./chunk-yctck6wf.js")},{id:"html",name:"HTML",import:()=>import("./chunk-zpes0b8m.js")},{id:"html-derivative",name:"HTML (Derivative)",import:()=>import("./chunk-afdat9a4.js")},{id:"http",name:"HTTP",import:()=>import("./chunk-3p4khpea.js")},{id:"hurl",name:"Hurl",import:()=>import("./chunk-0ch9bkct.js")},{id:"hxml",name:"HXML",import:()=>import("./chunk-86exrje1.js")},{id:"hy",name:"Hy",import:()=>import("./chunk-8mmvxxyj.js")},{id:"imba",name:"Imba",import:()=>import("./chunk-yxwramd1.js")},{id:"ini",name:"INI",aliases:["properties"],import:()=>import("./chunk-yx4mdqvf.js")},{id:"java",name:"Java",import:()=>import("./chunk-40fxbk0k.js")},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>import("./chunk-ncs4rnsn.js")},{id:"jinja",name:"Jinja",import:()=>import("./chunk-hgpmrbsr.js")},{id:"jison",name:"Jison",import:()=>import("./chunk-v8ag7wgx.js")},{id:"json",name:"JSON",import:()=>import("./chunk-g1yt0qc9.js")},{id:"json5",name:"JSON5",import:()=>import("./chunk-62zhdx11.js")},{id:"jsonc",name:"JSON with Comments",import:()=>import("./chunk-72h39xc8.js")},{id:"jsonl",name:"JSON Lines",import:()=>import("./chunk-z0abvgpr.js")},{id:"jsonnet",name:"Jsonnet",import:()=>import("./chunk-pd4wysbn.js")},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>import("./chunk-2vtz4ypn.js")},{id:"jsx",name:"JSX",import:()=>import("./chunk-4pa2a33z.js")},{id:"julia",name:"Julia",aliases:["jl"],import:()=>import("./chunk-6nhdwm44.js")},{id:"kdl",name:"KDL",import:()=>import("./chunk-3tq80kwe.js")},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>import("./chunk-c3b7gwkd.js")},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>import("./chunk-t8w9hqaa.js")},{id:"latex",name:"LaTeX",import:()=>import("./chunk-crvp4wnc.js")},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>import("./chunk-yr48as8z.js")},{id:"less",name:"Less",import:()=>import("./chunk-9dn65rqp.js")},{id:"liquid",name:"Liquid",import:()=>import("./chunk-7hvw60gp.js")},{id:"llvm",name:"LLVM IR",import:()=>import("./chunk-cd37w7qk.js")},{id:"log",name:"Log file",import:()=>import("./chunk-6e734rff.js")},{id:"logo",name:"Logo",import:()=>import("./chunk-7h9sjfmy.js")},{id:"lua",name:"Lua",import:()=>import("./chunk-w0me5x6g.js")},{id:"luau",name:"Luau",import:()=>import("./chunk-m8mdqeye.js")},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>import("./chunk-4z0wk36t.js")},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>import("./chunk-0gb5n1jp.js")},{id:"marko",name:"Marko",import:()=>import("./chunk-bwnx1zht.js")},{id:"matlab",name:"MATLAB",import:()=>import("./chunk-x0mnchxz.js")},{id:"mdc",name:"MDC",import:()=>import("./chunk-70gnwjt8.js")},{id:"mdx",name:"MDX",import:()=>import("./chunk-8evmvqza.js")},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>import("./chunk-j5e4dmw7.js")},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>import("./chunk-ztpff54v.js")},{id:"mojo",name:"Mojo",import:()=>import("./chunk-1efcgvx0.js")},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:()=>import("./chunk-5g0asgdm.js")},{id:"move",name:"Move",import:()=>import("./chunk-6a35z43a.js")},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>import("./chunk-nt5n8jcr.js")},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>import("./chunk-dvmzq40v.js")},{id:"nginx",name:"Nginx",import:()=>import("./chunk-51cf1nrg.js")},{id:"nim",name:"Nim",import:()=>import("./chunk-p3mpqeqw.js")},{id:"nix",name:"Nix",import:()=>import("./chunk-t32zj7ah.js")},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>import("./chunk-323aj0k7.js")},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>import("./chunk-y971vkwy.js")},{id:"objective-cpp",name:"Objective-C++",import:()=>import("./chunk-qpkn7wvc.js")},{id:"ocaml",name:"OCaml",import:()=>import("./chunk-6v5eepr1.js")},{id:"odin",name:"Odin",import:()=>import("./chunk-4qs8qf3g.js")},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:()=>import("./chunk-g9q5nbz0.js")},{id:"pascal",name:"Pascal",import:()=>import("./chunk-ehpz2t7m.js")},{id:"perl",name:"Perl",import:()=>import("./chunk-6r7b9pg1.js")},{id:"php",name:"PHP",import:()=>import("./chunk-63ghca0g.js")},{id:"pkl",name:"Pkl",import:()=>import("./chunk-s6t5vxm9.js")},{id:"plsql",name:"PL/SQL",import:()=>import("./chunk-8hp4t30w.js")},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>import("./chunk-9kydh60d.js")},{id:"polar",name:"Polar",import:()=>import("./chunk-50hw7e2n.js")},{id:"postcss",name:"PostCSS",import:()=>import("./chunk-x7g4cwft.js")},{id:"powerquery",name:"PowerQuery",import:()=>import("./chunk-41hzdwnx.js")},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>import("./chunk-ksr76npa.js")},{id:"prisma",name:"Prisma",import:()=>import("./chunk-ak43xwf1.js")},{id:"prolog",name:"Prolog",import:()=>import("./chunk-fbf3gztk.js")},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>import("./chunk-ywp666sg.js")},{id:"pug",name:"Pug",aliases:["jade"],import:()=>import("./chunk-n9x46wsq.js")},{id:"puppet",name:"Puppet",import:()=>import("./chunk-3mzwewcx.js")},{id:"purescript",name:"PureScript",import:()=>import("./chunk-geyhpd32.js")},{id:"python",name:"Python",aliases:["py"],import:()=>import("./chunk-rvxb17kx.js")},{id:"qml",name:"QML",import:()=>import("./chunk-j8b7x5pr.js")},{id:"qmldir",name:"QML Directory",import:()=>import("./chunk-gtms11w9.js")},{id:"qss",name:"Qt Style Sheets",import:()=>import("./chunk-zkfa00mf.js")},{id:"r",name:"R",import:()=>import("./chunk-s6xjfvvd.js")},{id:"racket",name:"Racket",import:()=>import("./chunk-pn04v4sv.js")},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>import("./chunk-3c791dd5.js")},{id:"razor",name:"ASP.NET Razor",import:()=>import("./chunk-znpdxhep.js")},{id:"reg",name:"Windows Registry Script",import:()=>import("./chunk-z46zzhqf.js")},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>import("./chunk-9c0wnb5t.js")},{id:"rel",name:"Rel",import:()=>import("./chunk-x0qb9311.js")},{id:"riscv",name:"RISC-V",import:()=>import("./chunk-cwvb8zr5.js")},{id:"ron",name:"RON",import:()=>import("./chunk-v85y10pz.js")},{id:"rosmsg",name:"ROS Interface",import:()=>import("./chunk-tx71e422.js")},{id:"rst",name:"reStructuredText",import:()=>import("./chunk-gy4p2qnz.js")},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>import("./chunk-c5d87fzk.js")},{id:"rust",name:"Rust",aliases:["rs"],import:()=>import("./chunk-2hjzw0cx.js")},{id:"sas",name:"SAS",import:()=>import("./chunk-ak0aqr2c.js")},{id:"sass",name:"Sass",import:()=>import("./chunk-4vr7sc1e.js")},{id:"scala",name:"Scala",import:()=>import("./chunk-7dmms791.js")},{id:"scheme",name:"Scheme",import:()=>import("./chunk-wk8sx9ev.js")},{id:"scss",name:"SCSS",import:()=>import("./chunk-psdrzwp5.js")},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>import("./chunk-d9xgby9w.js")},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>import("./chunk-fcxgd3qb.js")},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>import("./chunk-d08qq3wd.js")},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>import("./chunk-0mryaqgb.js")},{id:"smalltalk",name:"Smalltalk",import:()=>import("./chunk-p46at2ts.js")},{id:"solidity",name:"Solidity",import:()=>import("./chunk-tv1kqdv9.js")},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>import("./chunk-0dstjr38.js")},{id:"sparql",name:"SPARQL",import:()=>import("./chunk-g8k4dhcx.js")},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>import("./chunk-h5k1z56v.js")},{id:"sql",name:"SQL",import:()=>import("./chunk-mr7em8w4.js")},{id:"ssh-config",name:"SSH Config",import:()=>import("./chunk-hzejh175.js")},{id:"stata",name:"Stata",import:()=>import("./chunk-xmp5jp4r.js")},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>import("./chunk-shc3fcge.js")},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:()=>import("./chunk-v3ta4qyy.js")},{id:"svelte",name:"Svelte",import:()=>import("./chunk-mjwypsrz.js")},{id:"swift",name:"Swift",import:()=>import("./chunk-t0tznkac.js")},{id:"system-verilog",name:"SystemVerilog",import:()=>import("./chunk-jmzy9per.js")},{id:"systemd",name:"Systemd Units",import:()=>import("./chunk-yr04s6b7.js")},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>import("./chunk-v9b5r8aq.js")},{id:"tasl",name:"Tasl",import:()=>import("./chunk-jafhgffb.js")},{id:"tcl",name:"Tcl",import:()=>import("./chunk-3b8bw2gg.js")},{id:"templ",name:"Templ",import:()=>import("./chunk-3dqan531.js")},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>import("./chunk-1a5zv67s.js")},{id:"tex",name:"TeX",import:()=>import("./chunk-b6xencpw.js")},{id:"toml",name:"TOML",import:()=>import("./chunk-501c35tf.js")},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>import("./chunk-jam7nh0r.js")},{id:"tsv",name:"TSV",import:()=>import("./chunk-8nkp692y.js")},{id:"tsx",name:"TSX",import:()=>import("./chunk-t97kks4j.js")},{id:"turtle",name:"Turtle",import:()=>import("./chunk-bfm294j1.js")},{id:"twig",name:"Twig",import:()=>import("./chunk-3ns6c29z.js")},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>import("./chunk-jh6wwc9v.js")},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>import("./chunk-vxzscaap.js")},{id:"typst",name:"Typst",aliases:["typ"],import:()=>import("./chunk-s719ttj9.js")},{id:"v",name:"V",import:()=>import("./chunk-3pd9zqn2.js")},{id:"vala",name:"Vala",import:()=>import("./chunk-p2z2bacg.js")},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>import("./chunk-5n3h6mhr.js")},{id:"verilog",name:"Verilog",import:()=>import("./chunk-pf09ha3g.js")},{id:"vhdl",name:"VHDL",import:()=>import("./chunk-k7e2abhq.js")},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>import("./chunk-n220pha2.js")},{id:"vue",name:"Vue",import:()=>import("./chunk-ajtch74a.js")},{id:"vue-html",name:"Vue HTML",import:()=>import("./chunk-kncs6js6.js")},{id:"vue-vine",name:"Vue Vine",import:()=>import("./chunk-5vzt6z7d.js")},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>import("./chunk-dhgjjhh7.js")},{id:"wasm",name:"WebAssembly",import:()=>import("./chunk-03d08304.js")},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>import("./chunk-8tg10bhe.js")},{id:"wgsl",name:"WGSL",import:()=>import("./chunk-bd35cx5s.js")},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>import("./chunk-7zprjevz.js")},{id:"wit",name:"WebAssembly Interface Types",import:()=>import("./chunk-nbcah8mh.js")},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>import("./chunk-gp1ensbx.js")},{id:"xml",name:"XML",import:()=>import("./chunk-2w2pzwmm.js")},{id:"xsl",name:"XSL",import:()=>import("./chunk-f3jbz60e.js")},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>import("./chunk-k97swe5s.js")},{id:"zenscript",name:"ZenScript",import:()=>import("./chunk-p3p6a3ht.js")},{id:"zig",name:"Zig",import:()=>import("./chunk-6rzyzk0g.js")}],e9=Object.fromEntries(zJ.map((Z)=>[Z.id,Z.import])),ZW=Object.fromEntries(zJ.flatMap((Z)=>Z.aliases?.map((Y)=>[Y,Z.import])||[])),HJ={...e9,...ZW};var YW=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>import("./chunk-85j75g9q.js")},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>import("./chunk-jppcve2j.js")},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>import("./chunk-rmrp92n9.js")},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>import("./chunk-w895krdx.js")},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>import("./chunk-6gxwe3hq.js")},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>import("./chunk-h8ay3dqc.js")},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>import("./chunk-v3bw2mnd.js")},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>import("./chunk-1pm5qfkm.js")},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>import("./chunk-z6rwg7bs.js")},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>import("./chunk-h8de6gyf.js")},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>import("./chunk-r9r1v9kw.js")},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>import("./chunk-pe45n68n.js")},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>import("./chunk-8m6adpjf.js")},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>import("./chunk-51h1tm3c.js")},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>import("./chunk-gpmj4w3z.js")},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>import("./chunk-yfasv01s.js")},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>import("./chunk-rv0x9fbs.js")},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>import("./chunk-y3d9nwzf.js")},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>import("./chunk-y6vatv51.js")},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>import("./chunk-p6dgtz38.js")},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>import("./chunk-yb2kp04v.js")},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>import("./chunk-mvv3ktys.js")},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>import("./chunk-tamfhbc6.js")},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>import("./chunk-dw3081wb.js")},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>import("./chunk-mcrmg4m8.js")},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>import("./chunk-952k4ak8.js")},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>import("./chunk-mymqnpgf.js")},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>import("./chunk-y1f3hfaq.js")},{id:"houston",displayName:"Houston",type:"dark",import:()=>import("./chunk-ke9tpkk2.js")},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>import("./chunk-1mdbzd7e.js")},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>import("./chunk-25es8s2e.js")},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>import("./chunk-rc027n67.js")},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>import("./chunk-77gv3r7z.js")},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>import("./chunk-6meyz753.js")},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>import("./chunk-m3zge9wv.js")},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>import("./chunk-fs2mzcgs.js")},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>import("./chunk-3pqm74e3.js")},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>import("./chunk-djmxgj5c.js")},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>import("./chunk-8kv8e5sn.js")},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>import("./chunk-1ggv4msc.js")},{id:"min-light",displayName:"Min Light",type:"light",import:()=>import("./chunk-5743qc09.js")},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>import("./chunk-msha9pw1.js")},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>import("./chunk-q56ns9ta.js")},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>import("./chunk-3s6j6d1z.js")},{id:"nord",displayName:"Nord",type:"dark",import:()=>import("./chunk-zb9wth64.js")},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>import("./chunk-4tgv8687.js")},{id:"one-light",displayName:"One Light",type:"light",import:()=>import("./chunk-q9711zm8.js")},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>import("./chunk-pr7vzg5y.js")},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>import("./chunk-1q8wzky6.js")},{id:"red",displayName:"Red",type:"dark",import:()=>import("./chunk-n65ycayf.js")},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>import("./chunk-q3x300wy.js")},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>import("./chunk-88191bqb.js")},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>import("./chunk-ak2n1ckf.js")},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>import("./chunk-ypj2k2de.js")},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>import("./chunk-e2qmvzgm.js")},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>import("./chunk-nw76mbwc.js")},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>import("./chunk-9ynmrc70.js")},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>import("./chunk-7pntzqpm.js")},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>import("./chunk-76gx2wc0.js")},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>import("./chunk-ek58k066.js")},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>import("./chunk-bwjh7xrm.js")},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>import("./chunk-bh33p34p.js")},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>import("./chunk-kwgygr4z.js")},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>import("./chunk-gh5vbn9x.js")}],GJ=Object.fromEntries(YW.map((Z)=>[Z.id,Z.import]));class EY extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function XW(){return 2147483648}function JW(){return typeof performance<"u"?performance.now():Date.now()}var QW=(Z,Y)=>Z+(Y-Z%Y)%Y;async function $W(Z){let Y,X,J={};function Q(M){X=M,J.HEAPU8=new Uint8Array(M),J.HEAPU32=new Uint32Array(M)}function $(M,_,A){J.HEAPU8.copyWithin(M,_,_+A)}function K(M){try{return Y.grow(M-X.byteLength+65535>>>16),Q(Y.buffer),1}catch{}}function W(M){let _=J.HEAPU8.length;M=M>>>0;let A=XW();if(M>A)return!1;for(let P=1;P<=4;P*=2){let B=_*(1+0.2/P);B=Math.min(B,M+100663296);let C=Math.min(A,QW(Math.max(M,B),65536));if(K(C))return!0}return!1}let U=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function z(M,_,A=1024){let P=_+A,B=_;while(M[B]&&!(B>=P))++B;if(B-_>16&&M.buffer&&U)return U.decode(M.subarray(_,B));let C="";while(_<B){let R=M[_++];if(!(R&128)){C+=String.fromCharCode(R);continue}let D=M[_++]&63;if((R&224)===192){C+=String.fromCharCode((R&31)<<6|D);continue}let j=M[_++]&63;if((R&240)===224)R=(R&15)<<12|D<<6|j;else R=(R&7)<<18|D<<12|j<<6|M[_++]&63;if(R<65536)C+=String.fromCharCode(R);else{let E=R-65536;C+=String.fromCharCode(55296|E>>10,56320|E&1023)}}return C}function H(M,_){return M?z(J.HEAPU8,M,_):""}let G={emscripten_get_now:JW,emscripten_memcpy_big:$,emscripten_resize_heap:W,fd_write:()=>0};async function F(){let _=await Z({env:G,wasi_snapshot_preview1:G});Y=_.memory,Q(Y.buffer),Object.assign(J,_),J.UTF8ToString=H}return await F(),J}var KW=Object.defineProperty,WW=(Z,Y,X)=>(Y in Z)?KW(Z,Y,{enumerable:!0,configurable:!0,writable:!0,value:X}):Z[Y]=X,qZ=(Z,Y,X)=>WW(Z,typeof Y!=="symbol"?Y+"":Y,X),NZ=null;function UW(Z){throw new EY(Z.UTF8ToString(Z.getLastOnigError()))}class bY{constructor(Z){qZ(this,"utf16Length"),qZ(this,"utf8Length"),qZ(this,"utf16Value"),qZ(this,"utf8Value"),qZ(this,"utf16OffsetToUtf8"),qZ(this,"utf8OffsetToUtf16");let Y=Z.length,X=bY._utf8ByteLength(Z),J=X!==Y,Q=J?new Uint32Array(Y+1):null;if(J)Q[Y]=X;let $=J?new Uint32Array(X+1):null;if(J)$[X]=Y;let K=new Uint8Array(X),W=0;for(let U=0;U<Y;U++){let z=Z.charCodeAt(U),H=z,G=!1;if(z>=55296&&z<=56319){if(U+1<Y){let F=Z.charCodeAt(U+1);if(F>=56320&&F<=57343)H=(z-55296<<10)+65536|F-56320,G=!0}}if(J){if(Q[U]=W,G)Q[U+1]=W;if(H<=127)$[W+0]=U;else if(H<=2047)$[W+0]=U,$[W+1]=U;else if(H<=65535)$[W+0]=U,$[W+1]=U,$[W+2]=U;else $[W+0]=U,$[W+1]=U,$[W+2]=U,$[W+3]=U}if(H<=127)K[W++]=H;else if(H<=2047)K[W++]=192|(H&1984)>>>6,K[W++]=128|(H&63)>>>0;else if(H<=65535)K[W++]=224|(H&61440)>>>12,K[W++]=128|(H&4032)>>>6,K[W++]=128|(H&63)>>>0;else K[W++]=240|(H&1835008)>>>18,K[W++]=128|(H&258048)>>>12,K[W++]=128|(H&4032)>>>6,K[W++]=128|(H&63)>>>0;if(G)U++}this.utf16Length=Y,this.utf8Length=X,this.utf16Value=Z,this.utf8Value=K,this.utf16OffsetToUtf8=Q,this.utf8OffsetToUtf16=$}static _utf8ByteLength(Z){let Y=0;for(let X=0,J=Z.length;X<J;X++){let Q=Z.charCodeAt(X),$=Q,K=!1;if(Q>=55296&&Q<=56319){if(X+1<J){let W=Z.charCodeAt(X+1);if(W>=56320&&W<=57343)$=(Q-55296<<10)+65536|W-56320,K=!0}}if($<=127)Y+=1;else if($<=2047)Y+=2;else if($<=65535)Y+=3;else Y+=4;if(K)X++}return Y}createString(Z){let Y=Z.omalloc(this.utf8Length);return Z.HEAPU8.set(this.utf8Value,Y),Y}}var TY=class Z{constructor(Y){if(qZ(this,"id",++Z.LAST_ID),qZ(this,"_onigBinding"),qZ(this,"content"),qZ(this,"utf16Length"),qZ(this,"utf8Length"),qZ(this,"utf16OffsetToUtf8"),qZ(this,"utf8OffsetToUtf16"),qZ(this,"ptr"),!NZ)throw new EY("Must invoke loadWasm first.");this._onigBinding=NZ,this.content=Y;let X=new bY(Y);if(this.utf16Length=X.utf16Length,this.utf8Length=X.utf8Length,this.utf16OffsetToUtf8=X.utf16OffsetToUtf8,this.utf8OffsetToUtf16=X.utf8OffsetToUtf16,this.utf8Length<1e4&&!Z._sharedPtrInUse){if(!Z._sharedPtr)Z._sharedPtr=NZ.omalloc(1e4);Z._sharedPtrInUse=!0,NZ.HEAPU8.set(X.utf8Value,Z._sharedPtr),this.ptr=Z._sharedPtr}else this.ptr=X.createString(NZ)}convertUtf8OffsetToUtf16(Y){if(this.utf8OffsetToUtf16){if(Y<0)return 0;if(Y>this.utf8Length)return this.utf16Length;return this.utf8OffsetToUtf16[Y]}return Y}convertUtf16OffsetToUtf8(Y){if(this.utf16OffsetToUtf8){if(Y<0)return 0;if(Y>this.utf16Length)return this.utf8Length;return this.utf16OffsetToUtf8[Y]}return Y}dispose(){if(this.ptr===Z._sharedPtr)Z._sharedPtrInUse=!1;else this._onigBinding.ofree(this.ptr)}};qZ(TY,"LAST_ID",0);qZ(TY,"_sharedPtr",0);qZ(TY,"_sharedPtrInUse",!1);var OJ=TY;class qJ{constructor(Z){if(qZ(this,"_onigBinding"),qZ(this,"_ptr"),!NZ)throw new EY("Must invoke loadWasm first.");let Y=[],X=[];for(let K=0,W=Z.length;K<W;K++){let U=new bY(Z[K]);Y[K]=U.createString(NZ),X[K]=U.utf8Length}let J=NZ.omalloc(4*Z.length);NZ.HEAPU32.set(Y,J/4);let Q=NZ.omalloc(4*Z.length);NZ.HEAPU32.set(X,Q/4);let $=NZ.createOnigScanner(J,Q,Z.length);for(let K=0,W=Z.length;K<W;K++)NZ.ofree(Y[K]);if(NZ.ofree(Q),NZ.ofree(J),$===0)UW(NZ);this._onigBinding=NZ,this._ptr=$}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(Z,Y,X){let J=0;if(typeof X==="number")J=X;if(typeof Z==="string"){Z=new OJ(Z);let Q=this._findNextMatchSync(Z,Y,!1,J);return Z.dispose(),Q}return this._findNextMatchSync(Z,Y,!1,J)}_findNextMatchSync(Z,Y,X,J){let Q=this._onigBinding,$=Q.findNextOnigScannerMatch(this._ptr,Z.id,Z.ptr,Z.utf8Length,Z.convertUtf16OffsetToUtf8(Y),J);if($===0)return null;let K=Q.HEAPU32,W=$/4,U=K[W++],z=K[W++],H=[];for(let G=0;G<z;G++){let F=Z.convertUtf8OffsetToUtf16(K[W++]),M=Z.convertUtf8OffsetToUtf16(K[W++]);H[G]={start:F,end:M,length:M-F}}return{index:U,captureIndices:H}}}function zW(Z){return typeof Z.instantiator==="function"}function HW(Z){return typeof Z.default==="function"}function GW(Z){return typeof Z.data<"u"}function OW(Z){return typeof Response<"u"&&Z instanceof Response}function qW(Z){return typeof ArrayBuffer<"u"&&(Z instanceof ArrayBuffer||ArrayBuffer.isView(Z))||typeof Buffer<"u"&&Buffer.isBuffer?.(Z)||typeof SharedArrayBuffer<"u"&&Z instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&Z instanceof Uint32Array}var VY;function FW(Z){if(VY)return VY;async function Y(){NZ=await $W(async(X)=>{let J=Z;if(J=await J,typeof J==="function")J=await J(X);if(typeof J==="function")J=await J(X);if(zW(J))J=await J.instantiator(X);else if(HW(J))J=await J.default(X);else{if(GW(J))J=J.data;if(OW(J))if(typeof WebAssembly.instantiateStreaming==="function")J=await MW(J)(X);else J=await NW(J)(X);else if(qW(J))J=await iX(J)(X);else if(J instanceof WebAssembly.Module)J=await iX(J)(X);else if("default"in J&&J.default instanceof WebAssembly.Module)J=await iX(J.default)(X)}if("instance"in J)J=J.instance;if("exports"in J)J=J.exports;return J})}return VY=Y(),VY}function iX(Z){return(Y)=>WebAssembly.instantiate(Z,Y)}function MW(Z){return(Y)=>WebAssembly.instantiateStreaming(Z,Y)}function NW(Z){return async(Y)=>{let X=await Z.arrayBuffer();return WebAssembly.instantiate(X,Y)}}async function FJ(Z){if(Z)await FW(Z);return{createScanner(Y){return new qJ(Y.map((X)=>typeof X==="string"?X:X.source))},createString(Y){return new OJ(Y)}}}var MJ=WJ({langs:HJ,themes:GJ,engine:()=>FJ(import("./chunk-q86xqx6c.js"))}),{codeToHtml:_W,codeToHast:wW,codeToTokens:rX,codeToTokensBase:AW,codeToTokensWithThemes:BW,getSingletonHighlighter:LW,getLastGrammarState:PW}=UJ(MJ,{guessEmbeddedLanguages:t6});var vZ={h1:{bold:!0,marginBottom:1,color:"#f74cc7ff"},h2:{bold:!0,marginBottom:1,color:"#326cfcff"},h3:{bold:!0,color:"#24ffedff"},h4:{bold:!0,color:"#e29418ff"},h5:{bold:!0,color:"#9fc214ff"},h6:{bold:!0,dimColor:!0,color:"#88eb2bff"},paragraph:{},blockquote:{paddingLeft:1,dimColor:!0,borderTop:!1,borderBottom:!1,borderRight:!1,borderStyle:"single",borderDimColor:!0},code:{marginTop:1},codespan:{dimColor:!0},list:{},listItem:{bullet:"●",paddingLeft:2},hr:{char:"─",width:40,dimColor:!0},link:{color:"#343afcff",underline:!0},strong:{bold:!0},em:{italic:!0},del:{strikethrough:!0,dimColor:!0},image:{color:"blue"},table:{},tableCell:{paddingRight:2}},CW=["color","backgroundColor","dimColor","bold","italic","underline","strikethrough","inverse","wrap"],vW=["paddingLeft","paddingRight","paddingTop","paddingBottom","padding","paddingX","paddingY","marginLeft","marginRight","marginTop","marginBottom","margin","marginX","marginY","borderStyle","borderColor","borderTop","borderBottom","borderLeft","borderRight","borderDimColor","borderTopColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopDimColor","borderBottomDimColor","borderLeftDimColor","borderRightDimColor"];async function IW(Z,Y,X="github-dark"){try{let J=await rX(Z,{lang:Y||"text",theme:X}),Q=[],$=0;for(let K=0;K<J.tokens.length;K++){let W=J.tokens[K];if(W){for(let U of W){let z=U.color||void 0;Q.push(V.jsx(O,{color:z,children:U.content},`token-${$}`)),$++}if(K<J.tokens.length-1)Q.push(V.jsx(O,{children:`
149
- `},`nl-${K}`))}}return Q}catch{return null}}function PZ(Z){if(!Z)return{};let Y={};for(let X of CW)if(X in Z)Y[X]=Z[X];return Y}function Z4(Z){if(!Z)return{};let Y={};for(let X of vW)if(X in Z)Y[X]=Z[X];return Y}function IZ(Z,Y){if(!Z&&!Y)return{};if(!Z)return Y;if(!Y)return Z;return{...Z,...Y}}function DW({code:Z,language:Y,style:X,theme:J}){let[Q,$]=cZ.useState(null),[K,W]=cZ.useState(!0);if(cZ.useEffect(()=>{let U=!1;async function z(){try{let H=await IW(Z,Y,J);if(!U)$(H),W(!1)}catch{if(!U)$(null),W(!1)}}return z(),()=>{U=!0}},[Z,Y,J]),K||!Q)return V.jsx(N,{...Z4(X),children:V.jsx(O,{...PZ(X),children:Z})});return V.jsx(N,{paddingX:2,paddingY:1,...Z4(X),children:V.jsx(O,{...PZ(X),children:Q})})}function yZ(Z,Y,X){if(!Z||Z.length===0)return null;return Z.map((J,Q)=>{let $=`inline-${Q}`;switch(J.type){case"text":case"escape":{let K=J;if("tokens"in K&&K.tokens)return V.jsx(O,{children:yZ(K.tokens,Y,X)},$);return V.jsx(O,{children:K.text},$)}case"strong":{let K=J,W=IZ(vZ.strong,Y.strong);if(X.strong)return V.jsx(O,{children:X.strong(yZ(K.tokens,Y,X),K)},$);return V.jsx(O,{...PZ(W),children:yZ(K.tokens,Y,X)},$)}case"em":{let K=J,W=IZ(vZ.em,Y.em);if(X.em)return V.jsx(O,{children:X.em(yZ(K.tokens,Y,X),K)},$);return V.jsx(O,{...PZ(W),children:yZ(K.tokens,Y,X)},$)}case"del":{let K=J,W=IZ(vZ.del,Y.del);if(X.del)return V.jsx(O,{children:X.del(yZ(K.tokens,Y,X),K)},$);return V.jsx(O,{...PZ(W),children:yZ(K.tokens,Y,X)},$)}case"codespan":{let K=J,W=IZ(vZ.codespan,Y.codespan);if(X.codespan)return V.jsx(O,{children:X.codespan(K.text,K)},$);return V.jsx(O,{...PZ(W),children:K.text},$)}case"link":{let K=J,W=IZ(vZ.link,Y.link);if(X.link)return V.jsx(O,{children:X.link(K.text,K.href,K.title,K)},$);return V.jsxs(O,{...PZ(W),children:[K.text,K.href&&` (${K.href})`]},$)}case"image":{let K=J,W=IZ(vZ.image,Y.image);if(X.image)return V.jsx(O,{children:X.image(K.text,K.href,K.title,K)},$);return V.jsxs(O,{...PZ(W),children:["[Image: ",K.text||K.href,"]"]},$)}case"br":return V.jsx(O,{children:`
150
- `},$);default:if("text"in J)return V.jsx(O,{children:J.text},$);return null}})}function oX(Z,Y,X,J,Q,$="github-dark"){switch(Z.type){case"heading":{let K=Z,W=`h${K.depth}`,U=`h${K.depth}`,z=X[W];if(z)return z(K.text,K);let H=IZ(vZ[U],Y[U]),G=typeof H.showSharp=="boolean"?H.showSharp:Boolean(J);return V.jsx(N,{...Z4(H),children:V.jsxs(O,{...PZ(H),children:[G&&`${"#".repeat(K.depth)} `,yZ(K.tokens,Y,X)]})})}case"paragraph":{let K=Z,W=IZ(vZ.paragraph,Y.paragraph),U=yZ(K.tokens,Y,X);if(X.paragraph)return X.paragraph(U,K);return V.jsx(N,{...Z4(W),children:V.jsx(O,{...PZ(W),children:U})})}case"code":{let K=Z,W=IZ(vZ.code,Y.code);if(X.code)return X.code(K.text,K.lang,K);if(Q)return V.jsx(DW,{code:K.text,language:K.lang,style:W,theme:$});return V.jsx(N,{...Z4(W),children:V.jsx(O,{...PZ(W),children:K.text})})}case"blockquote":{let K=Z,W=IZ(vZ.blockquote,Y.blockquote),U=K.tokens.map((z,H)=>V.jsx(N,{children:oX(z,Y,X,J,Q,$)},`bq-${H}`));if(X.blockquote)return X.blockquote(U,K);return V.jsx(N,{...Z4(W),children:V.jsx(N,{flexDirection:"column",children:K.tokens.map((z,H)=>{if(oX(z,Y,X,J,Q,$))return V.jsx(O,{...PZ(W),children:z.type==="paragraph"?yZ(z.tokens,Y,X):z.text||""},`bq-text-${H}`);return null})})})}case"list":{let K=Z,W=IZ(vZ.list,Y.list),U=IZ(vZ.listItem,Y.listItem),z=U.bullet||"●",H=K.items.map((G,F)=>{let M=typeof K.start=="number"?K.start:1,_=K.ordered?`${M+F}. `:`${z} `,A=yZ(G.tokens,Y,X);if(X.listItem)return V.jsx(N,{...Z4(U),children:X.listItem(A,G)},`li-${F}`);return V.jsx(N,{...Z4(U),children:V.jsxs(O,{...PZ(U),children:[_,A]})},`li-${F}`)});if(X.list)return X.list(H,K.ordered,K);return V.jsx(N,{flexDirection:"column",...Z4(W),children:H})}case"hr":{let K=Z,W=IZ(vZ.hr,Y.hr),U=W.char||"─",z=W.width||40;if(X.hr)return X.hr(K);return V.jsx(N,{...Z4(W),children:V.jsx(O,{...PZ(W),children:U.repeat(z)})})}case"table":{let K=Z,W=IZ(vZ.table,Y.table),U=IZ(vZ.tableCell,Y.tableCell),z=(B)=>B.map((C)=>{if("text"in C)return C.text;return""}).join(""),H=K.header.map((B,C)=>{let R=z(B.tokens).length,D=Math.max(...K.rows.map((j)=>{let E=j[C]?.tokens;return E?z(E).length:0}),0);return Math.max(R,D,3)}),G=V.jsxs(O,{dimColor:!0,children:["┌─",H.map((B)=>"─".repeat(B)).join("─┬─"),"─┐"]}),F=V.jsxs(O,{children:[V.jsx(O,{dimColor:!0,children:"│ "}),K.header.map((B,C)=>{let R=yZ(B.tokens,Y,X),D=z(B.tokens);return V.jsxs(O,{children:[V.jsxs(O,{bold:!0,...PZ(U),children:[R," ".repeat(Math.max(0,(H[C]||3)-D.length))]}),V.jsxs(O,{dimColor:!0,children:[" │",C<K.header.length-1?" ":""]})]},`th-${C}`)})]}),M=V.jsxs(O,{dimColor:!0,children:["├─",H.map((B)=>"─".repeat(B)).join("─┼─"),"─┤"]}),_=K.rows.map((B,C)=>V.jsxs(O,{children:[V.jsx(O,{dimColor:!0,children:"│ "}),B.map((R,D)=>{let j=yZ(R.tokens,Y,X),E=z(R.tokens),c=H[D]||3;return V.jsxs(O,{children:[V.jsxs(O,{...PZ(U),children:[j," ".repeat(Math.max(0,c-E.length))]}),V.jsxs(O,{dimColor:!0,children:[" │",D<B.length-1?" ":""]})]},`td-${C}-${D}`)})]},`tr-${C}`)),A=V.jsxs(O,{dimColor:!0,children:["└─",H.map((B)=>"─".repeat(B)).join("─┴─"),"─┘"]}),P=V.jsxs(V.Fragment,{children:[G,F,M,_,A]});if(X.table)return X.table(F,_,K);return V.jsx(N,{flexDirection:"column",...Z4(W),children:P})}case"space":return V.jsx(O,{children:`
151
- `});case"html":return V.jsx(O,{dimColor:!0,children:Z.text});default:if("text"in Z)return V.jsx(O,{children:Z.text});return null}}var NJ=cZ.memo(function({token:Z,styles:Y,renderers:X,showSharp:J,highlight:Q,theme:$}){return V.jsx(V.Fragment,{children:oX(Z,Y,X,J,Q,$)})},(Z,Y)=>Z.token===Y.token);NJ.displayName="MemoizedBlock";function VW({children:Z,id:Y,styles:X={},renderers:J={},showSharp:Q=!1,highlight:$=!0,theme:K="github-dark"}){let W=cZ.useId(),U=Y||W,z=cZ.useMemo(()=>d.lexer(Z,{silent:!0,gfm:!0}),[Z]);return V.jsx(N,{flexDirection:"column",children:z.map((H,G)=>V.jsx(NJ,{token:H,styles:X,renderers:J,showSharp:Q,highlight:$,theme:K},`${U}-block-${G}`))})}var _J=cZ.memo(VW);_J.displayName="Markdown";var EW=_J,wJ=EW;var AJ=L(x(),1);var x0=L(v(),1),BJ=({children:Z,color:Y,dim:X,bold:J,italic:Q})=>{let $=AJ.useMemo(()=>{return Z.split(`
141
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\x00&'".split(""),"\x00\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\x00"&'.split(""),"\x00\"&'`".split("")]]};function k6(Z,Y,X,J){let Q=J.schema,$=Q.space==="svg"?!1:J.settings.omitOptionalTags,K=Q.space==="svg"?J.settings.closeEmptyElements:J.settings.voids.includes(Z.tagName.toLowerCase()),U=[],W;if(Q.space==="html"&&Z.tagName==="svg")J.schema=NY;let z=Q9(J,Z.properties),H=J.all(Q.space==="html"&&Z.tagName==="template"?Z.content:Z);if(J.schema=Q,H)K=!1;if(z||!$||!y6(Z,Y,X)){if(U.push("<",Z.tagName,z?" "+z:""),K&&(Q.space==="svg"||J.settings.closeSelfClosing)){if(W=z.charAt(z.length-1),!J.settings.tightSelfClosing||W==="/"||W&&W!=='"'&&W!=="'")U.push(" ");U.push("/")}U.push(">")}if(U.push(H),!K&&(!$||!S0(Z,Y,X)))U.push("</"+Z.tagName+">");return U.join("")}function Q9(Z,Y){let X=[],J=-1,Q;if(Y){for(Q in Y)if(Y[Q]!==null&&Y[Q]!==void 0){let $=$9(Z,Q,Y[Q]);if($)X.push($)}}while(++J<X.length){let $=Z.settings.tightAttributes?X[J].charAt(X[J].length-1):void 0;if(J!==X.length-1&&$!=='"'&&$!=="'")X[J]+=" "}return X.join("")}function $9(Z,Y,X){let J=fX(Z.schema,Y),Q=Z.settings.allowParseErrors&&Z.schema.space==="html"?0:1,$=Z.settings.allowDangerousCharacters?0:1,K=Z.quote,U;if(J.overloadedBoolean&&(X===J.attribute||X===""))X=!0;else if((J.boolean||J.overloadedBoolean)&&(typeof X!=="string"||X===J.attribute||X===""))X=Boolean(X);if(X===null||X===void 0||X===!1||typeof X==="number"&&Number.isNaN(X))return"";let W=B4(J.attribute,Object.assign({},Z.settings.characterReferences,{subset:BY.name[Q][$]}));if(X===!0)return W;if(X=Array.isArray(X)?(J.commaSeparated?E6:b6)(X,{padLeft:!Z.settings.tightCommaSeparatedLists}):String(X),Z.settings.collapseEmptyAttributes&&!X)return W;if(Z.settings.preferUnquoted)U=B4(X,Object.assign({},Z.settings.characterReferences,{attribute:!0,subset:BY.unquoted[Q][$]}));if(U!==X){if(Z.settings.quoteSmart&&SX(X,K)>SX(X,Z.alternative))K=Z.alternative;U=K+B4(X,Object.assign({},Z.settings.characterReferences,{subset:(K==="'"?BY.single:BY.double)[Q][$],attribute:!0}))+K}return W+(U?"="+U:U)}var K9=["<","&"];function LY(Z,Y,X,J){return X&&X.type==="element"&&(X.tagName==="script"||X.tagName==="style")?Z.value:B4(Z.value,Object.assign({},J.settings.characterReferences,{subset:K9}))}function h6(Z,Y,X,J){return J.settings.allowDangerousHtml?Z.value:LY(Z,Y,X,J)}function x6(Z,Y,X,J){return J.all(Z)}var g6=_6("type",{invalid:W9,unknown:U9,handlers:{comment:D6,doctype:V6,element:k6,raw:h6,root:x6,text:LY}});function W9(Z){throw Error("Expected node, not `"+Z+"`")}function U9(Z){throw Error("Cannot compile unknown node `"+Z.type+"`")}var z9={},H9={},G9=[];function hX(Z,Y){let X=Y||z9,J=X.quote||'"',Q=J==='"'?"'":'"';if(J!=='"'&&J!=="'")throw Error("Invalid quote `"+J+"`, expected `'` or `\"`");return{one:O9,all:q9,settings:{omitOptionalTags:X.omitOptionalTags||!1,allowParseErrors:X.allowParseErrors||!1,allowDangerousCharacters:X.allowDangerousCharacters||!1,quoteSmart:X.quoteSmart||!1,preferUnquoted:X.preferUnquoted||!1,tightAttributes:X.tightAttributes||!1,upperDoctype:X.upperDoctype||!1,tightDoctype:X.tightDoctype||!1,bogusComments:X.bogusComments||!1,tightCommaSeparatedLists:X.tightCommaSeparatedLists||!1,tightSelfClosing:X.tightSelfClosing||!1,collapseEmptyAttributes:X.collapseEmptyAttributes||!1,allowDangerousHtml:X.allowDangerousHtml||!1,voids:X.voids||H6,characterReferences:X.characterReferences||H9,closeSelfClosing:X.closeSelfClosing||!1,closeEmptyElements:X.closeEmptyElements||!1},schema:X.space==="svg"?NY:M6,quote:J,alternative:Q}.one(Array.isArray(Z)?{type:"root",children:Z}:Z,void 0,void 0)}function O9(Z,Y,X){return g6(Z,Y,X,this)}function q9(Z){let Y=[],X=Z&&Z.children||G9,J=-1;while(++J<X.length)Y[J]=this.one(X[J],J,Z);return Y.join("")}function PY(Z,Y){let X=typeof Z==="string"?{}:{...Z.colorReplacements},J=typeof Z==="string"?Z:Z.name;for(let[Q,$]of Object.entries(Y?.colorReplacements||{}))if(typeof $==="string")X[Q]=$;else if(Q===J)Object.assign(X,$);return X}function T4(Z,Y){if(!Z)return Z;return Y?.[Z?.toLowerCase()]||Z}function F9(Z){return Array.isArray(Z)?Z:[Z]}async function i6(Z){return Promise.resolve(typeof Z==="function"?Z():Z).then((Y)=>Y.default||Y)}function mX(Z){return!Z||["plaintext","txt","text","plain"].includes(Z)}function r6(Z){return Z==="ansi"||mX(Z)}function pX(Z){return Z==="none"}function o6(Z){return pX(Z)}function n6(Z,Y){if(!Y)return Z;if(Z.properties||={},Z.properties.class||=[],typeof Z.properties.class==="string")Z.properties.class=Z.properties.class.split(/\s+/g);if(!Array.isArray(Z.properties.class))Z.properties.class=[];let X=Array.isArray(Y)?Y:Y.split(/\s+/g);for(let J of X)if(J&&!Z.properties.class.includes(J))Z.properties.class.push(J);return Z}function DY(Z,Y=!1){if(Z.length===0)return[["",0]];let X=Z.split(/(\r?\n)/g),J=0,Q=[];for(let $=0;$<X.length;$+=2){let K=Y?X[$]+(X[$+1]||""):X[$];Q.push([K,J]),J+=X[$].length,J+=X[$+1]?.length||0}return Q}function M9(Z){let Y=DY(Z,!0).map(([Q])=>Q);function X(Q){if(Q===Z.length)return{line:Y.length-1,character:Y[Y.length-1].length};let $=Q,K=0;for(let U of Y){if($<U.length)break;$-=U.length,K++}return{line:K,character:$}}function J(Q,$){let K=0;for(let U=0;U<Q;U++)K+=Y[U].length;return K+=$,K}return{lines:Y,indexToPos:X,posToIndex:J}}function a6(Z,Y,X){let J=new Set;for(let $ of Z.matchAll(/:?lang=["']([^"']+)["']/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/(?:```|~~~)([\w-]+)/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/\\begin\{([\w-]+)\}/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let K=$[1].toLowerCase().trim(),U=K.includes("/")?K.split("/").pop():K;if(U)J.add(U)}if(!X)return Array.from(J);let Q=X.getBundledLanguages();return Array.from(J).filter(($)=>$&&Q[$])}var dX="light-dark()",N9=["color","background-color"];function _9(Z,Y){let X=0,J=[];for(let Q of Y){if(Q>X)J.push({...Z,content:Z.content.slice(X,Q),offset:Z.offset+X});X=Q}if(X<Z.content.length)J.push({...Z,content:Z.content.slice(X),offset:Z.offset+X});return J}function A9(Z,Y){let X=Array.from(Y instanceof Set?Y:new Set(Y)).sort((J,Q)=>J-Q);if(!X.length)return Z;return Z.map((J)=>{return J.flatMap((Q)=>{let $=X.filter((K)=>Q.offset<K&&K<Q.offset+Q.content.length).map((K)=>K-Q.offset).sort((K,U)=>K-U);if(!$.length)return Q;return _9(Q,$)})})}function w9(Z,Y,X,J,Q="css-vars"){let $={content:Z.content,explanation:Z.explanation,offset:Z.offset},K=Y.map((H)=>RY(Z.variants[H])),U=new Set(K.flatMap((H)=>Object.keys(H))),W={},z=(H,G)=>{let F=G==="color"?"":G==="background-color"?"-bg":`-${G}`;return X+Y[H]+(G==="color"?"":F)};return K.forEach((H,G)=>{for(let F of U){let M=H[F]||"inherit";if(G===0&&J&&N9.includes(F))if(J===dX&&K.length>1){let N=Y.findIndex((C)=>C==="light"),w=Y.findIndex((C)=>C==="dark");if(N===-1||w===-1)throw new YZ('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let L=K[N][F]||"inherit",B=K[w][F]||"inherit";if(W[F]=`light-dark(${L}, ${B})`,Q==="css-vars")W[z(G,F)]=M}else W[F]=M;else if(Q==="css-vars")W[z(G,F)]=M}}),$.htmlStyle=W,$}function RY(Z){let Y={};if(Z.color)Y.color=Z.color;if(Z.bgColor)Y["background-color"]=Z.bgColor;if(Z.fontStyle){if(Z.fontStyle&GZ.Italic)Y["font-style"]="italic";if(Z.fontStyle&GZ.Bold)Y["font-weight"]="bold";let X=[];if(Z.fontStyle&GZ.Underline)X.push("underline");if(Z.fontStyle&GZ.Strikethrough)X.push("line-through");if(X.length)Y["text-decoration"]=X.join(" ")}return Y}function uX(Z){if(typeof Z==="string")return Z;return Object.entries(Z).map(([Y,X])=>`${Y}:${X}`).join(";")}var s6=new WeakMap;function VY(Z,Y){s6.set(Z,Y)}function k0(Z){return s6.get(Z)}class O0{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(Z,Y){return new O0(Object.fromEntries(F9(Y).map((X)=>[X,OY])),Z)}constructor(...Z){if(Z.length===2){let[Y,X]=Z;this.lang=X,this._stacks=Y}else{let[Y,X,J]=Z;this.lang=X,this._stacks={[J]:Y}}}getInternalStack(Z=this.theme){return this._stacks[Z]}getScopes(Z=this.theme){return B9(this._stacks[Z])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function B9(Z){let Y=[],X=new Set;function J(Q){if(X.has(Q))return;X.add(Q);let $=Q?.nameScopesList?.scopeName;if($)Y.push($);if(Q.parent)J(Q.parent)}return J(Z),Y}function L9(Z,Y){if(!(Z instanceof O0))throw new YZ("Invalid grammar state");return Z.getInternalStack(Y)}function P9(){let Z=new WeakMap;function Y(X){if(!Z.has(X.meta)){let J=function(K){if(typeof K==="number"){if(K<0||K>X.source.length)throw new YZ(`Invalid decoration offset: ${K}. Code length: ${X.source.length}`);return{...Q.indexToPos(K),offset:K}}else{let U=Q.lines[K.line];if(U===void 0)throw new YZ(`Invalid decoration position ${JSON.stringify(K)}. Lines length: ${Q.lines.length}`);let W=K.character;if(W<0)W=U.length+W;if(W<0||W>U.length)throw new YZ(`Invalid decoration position ${JSON.stringify(K)}. Line ${K.line} length: ${U.length}`);return{...K,character:W,offset:Q.posToIndex(K.line,W)}}},Q=M9(X.source),$=(X.options.decorations||[]).map((K)=>({...K,start:J(K.start),end:J(K.end)}));R9($),Z.set(X.meta,{decorations:$,converter:Q,source:X.source})}return Z.get(X.meta)}return{name:"shiki:decorations",tokens(X){if(!this.options.decorations?.length)return;let Q=Y(this).decorations.flatMap((K)=>[K.start.offset,K.end.offset]);return A9(X,Q)},code(X){if(!this.options.decorations?.length)return;let J=Y(this),Q=Array.from(X.children).filter((H)=>H.type==="element"&&H.tagName==="span");if(Q.length!==J.converter.lines.length)throw new YZ(`Number of lines in code element (${Q.length}) does not match the number of lines in the source (${J.converter.lines.length}). Failed to apply decorations.`);function $(H,G,F,M){let N=Q[H],w="",L=-1,B=-1;if(G===0)L=0;if(F===0)B=0;if(F===Number.POSITIVE_INFINITY)B=N.children.length;if(L===-1||B===-1)for(let R=0;R<N.children.length;R++){if(w+=t6(N.children[R]),L===-1&&w.length===G)L=R+1;if(B===-1&&w.length===F)B=R+1}if(L===-1)throw new YZ(`Failed to find start index for decoration ${JSON.stringify(M.start)}`);if(B===-1)throw new YZ(`Failed to find end index for decoration ${JSON.stringify(M.end)}`);let C=N.children.slice(L,B);if(!M.alwaysWrap&&C.length===N.children.length)U(N,M,"line");else if(!M.alwaysWrap&&C.length===1&&C[0].type==="element")U(C[0],M,"token");else{let R={type:"element",tagName:"span",properties:{},children:C};U(R,M,"wrapper"),N.children.splice(L,C.length,R)}}function K(H,G){Q[H]=U(Q[H],G,"line")}function U(H,G,F){let M=G.properties||{},N=G.transform||((w)=>w);if(H.tagName=G.tagName||"span",H.properties={...H.properties,...M,class:H.properties.class},G.properties?.class)n6(H,G.properties.class);return H=N(H,F)||H,H}let W=[],z=J.decorations.sort((H,G)=>G.start.offset-H.start.offset||H.end.offset-G.end.offset);for(let H of z){let{start:G,end:F}=H;if(G.line===F.line)$(G.line,G.character,F.character,H);else if(G.line<F.line){$(G.line,G.character,Number.POSITIVE_INFINITY,H);for(let M=G.line+1;M<F.line;M++)W.unshift(()=>K(M,H));$(F.line,0,F.character,H)}}W.forEach((H)=>H())}}}function R9(Z){for(let Y=0;Y<Z.length;Y++){let X=Z[Y];if(X.start.offset>X.end.offset)throw new YZ(`Invalid decoration range: ${JSON.stringify(X.start)} - ${JSON.stringify(X.end)}`);for(let J=Y+1;J<Z.length;J++){let Q=Z[J],$=X.start.offset<=Q.start.offset&&Q.start.offset<X.end.offset,K=X.start.offset<Q.end.offset&&Q.end.offset<=X.end.offset,U=Q.start.offset<=X.start.offset&&X.start.offset<Q.end.offset,W=Q.start.offset<X.end.offset&&X.end.offset<=Q.end.offset;if($||K||U||W){if($&&K)continue;if(U&&W)continue;if(U&&X.start.offset===X.end.offset)continue;if(K&&Q.start.offset===Q.end.offset)continue;throw new YZ(`Decorations ${JSON.stringify(X.start)} and ${JSON.stringify(Q.start)} intersect.`)}}}}function t6(Z){if(Z.type==="text")return Z.value;if(Z.type==="element")return Z.children.map(t6).join("");return""}var C9=[P9()];function CY(Z){let Y=I9(Z.transformers||[]);return[...Y.pre,...Y.normal,...Y.post,...C9]}function I9(Z){let Y=[],X=[],J=[];for(let Q of Z)switch(Q.enforce){case"pre":Y.push(Q);break;case"post":X.push(Q);break;default:J.push(Q)}return{pre:Y,post:X,normal:J}}var s4=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],xX={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function v9(Z,Y){let X=Z.indexOf("\x1B",Y);if(X!==-1){if(Z[X+1]==="["){let J=Z.indexOf("m",X);if(J!==-1)return{sequence:Z.substring(X+2,J).split(";"),startPosition:X,position:J+1}}}return{position:Z.length}}function u6(Z){let Y=Z.shift();if(Y==="2"){let X=Z.splice(0,3).map((J)=>Number.parseInt(J));if(X.length!==3||X.some((J)=>Number.isNaN(J)))return;return{type:"rgb",rgb:X}}else if(Y==="5"){let X=Z.shift();if(X)return{type:"table",index:Number(X)}}}function D9(Z){let Y=[];while(Z.length>0){let X=Z.shift();if(!X)continue;let J=Number.parseInt(X);if(Number.isNaN(J))continue;if(J===0)Y.push({type:"resetAll"});else if(J<=9){if(xX[J])Y.push({type:"setDecoration",value:xX[J]})}else if(J<=29){let Q=xX[J-20];if(Q){if(Y.push({type:"resetDecoration",value:Q}),Q==="dim")Y.push({type:"resetDecoration",value:"bold"})}}else if(J<=37)Y.push({type:"setForegroundColor",value:{type:"named",name:s4[J-30]}});else if(J===38){let Q=u6(Z);if(Q)Y.push({type:"setForegroundColor",value:Q})}else if(J===39)Y.push({type:"resetForegroundColor"});else if(J<=47)Y.push({type:"setBackgroundColor",value:{type:"named",name:s4[J-40]}});else if(J===48){let Q=u6(Z);if(Q)Y.push({type:"setBackgroundColor",value:Q})}else if(J===49)Y.push({type:"resetBackgroundColor"});else if(J===53)Y.push({type:"setDecoration",value:"overline"});else if(J===55)Y.push({type:"resetDecoration",value:"overline"});else if(J>=90&&J<=97)Y.push({type:"setForegroundColor",value:{type:"named",name:s4[J-90+8]}});else if(J>=100&&J<=107)Y.push({type:"setBackgroundColor",value:{type:"named",name:s4[J-100+8]}})}return Y}function V9(){let Z=null,Y=null,X=new Set;return{parse(J){let Q=[],$=0;do{let K=v9(J,$),U=K.sequence?J.substring($,K.startPosition):J.substring($);if(U.length>0)Q.push({value:U,foreground:Z,background:Y,decorations:new Set(X)});if(K.sequence){let W=D9(K.sequence);for(let z of W)if(z.type==="resetAll")Z=null,Y=null,X.clear();else if(z.type==="resetForegroundColor")Z=null;else if(z.type==="resetBackgroundColor")Y=null;else if(z.type==="resetDecoration")X.delete(z.value);for(let z of W)if(z.type==="setForegroundColor")Z=z.value;else if(z.type==="setBackgroundColor")Y=z.value;else if(z.type==="setDecoration")X.add(z.value)}$=K.position}while($<J.length);return Q}}}var E9={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function b9(Z=E9){function Y(U){return Z[U]}function X(U){return`#${U.map((W)=>Math.max(0,Math.min(W,255)).toString(16).padStart(2,"0")).join("")}`}let J;function Q(){if(J)return J;J=[];for(let z=0;z<s4.length;z++)J.push(Y(s4[z]));let U=[0,95,135,175,215,255];for(let z=0;z<6;z++)for(let H=0;H<6;H++)for(let G=0;G<6;G++)J.push(X([U[z],U[H],U[G]]));let W=8;for(let z=0;z<24;z++,W+=10)J.push(X([W,W,W]));return J}function $(U){return Q()[U]}function K(U){switch(U.type){case"named":return Y(U.name);case"rgb":return X(U.rgb);case"table":return $(U.index)}}return{value:K}}var T9={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function f9(Z,Y,X){let J=PY(Z,X),Q=DY(Y),$=Object.fromEntries(s4.map((W)=>{let z=`terminal.ansi${W[0].toUpperCase()}${W.substring(1)}`,H=Z.colors?.[z];return[W,H||T9[W]]})),K=b9($),U=V9();return Q.map((W)=>U.parse(W[0]).map((z)=>{let H,G;if(z.decorations.has("reverse"))H=z.background?K.value(z.background):Z.bg,G=z.foreground?K.value(z.foreground):Z.fg;else H=z.foreground?K.value(z.foreground):Z.fg,G=z.background?K.value(z.background):void 0;if(H=T4(H,J),G=T4(G,J),z.decorations.has("dim"))H=j9(H);let F=GZ.None;if(z.decorations.has("bold"))F|=GZ.Bold;if(z.decorations.has("italic"))F|=GZ.Italic;if(z.decorations.has("underline"))F|=GZ.Underline;if(z.decorations.has("strikethrough"))F|=GZ.Strikethrough;return{content:z.value,offset:W[1],color:H,bgColor:G,fontStyle:F}}))}function j9(Z){let Y=Z.match(/#([0-9a-f]{3,8})/i);if(Y){let J=Y[1];if(J.length===8){let Q=Math.round(Number.parseInt(J.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${J.slice(0,6)}${Q}`}else if(J.length===6)return`#${J}80`;else if(J.length===4){let Q=J[0],$=J[1],K=J[2],U=J[3],W=Math.round(Number.parseInt(`${U}${U}`,16)/2).toString(16).padStart(2,"0");return`#${Q}${Q}${$}${$}${K}${K}${W}`}else if(J.length===3){let Q=J[0],$=J[1],K=J[2];return`#${Q}${Q}${$}${$}${K}${K}80`}}let X=Z.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);if(X)return`var(${X[1]}-dim)`;return Z}function cX(Z,Y,X={}){let{theme:J=Z.getLoadedThemes()[0]}=X,Q=Z.resolveLangAlias(X.lang||"text");if(mX(Q)||pX(J))return DY(Y).map((W)=>[{content:W[0],offset:W[1]}]);let{theme:$,colorMap:K}=Z.setTheme(J);if(Q==="ansi")return f9($,Y,X);let U=Z.getLanguage(X.lang||"text");if(X.grammarState){if(X.grammarState.lang!==U.name)throw new YZ(`Grammar state language "${X.grammarState.lang}" does not match highlight language "${U.name}"`);if(!X.grammarState.themes.includes($.name))throw new YZ(`Grammar state themes "${X.grammarState.themes}" do not contain highlight theme "${$.name}"`)}return y9(Y,U,$,K,X)}function S9(...Z){if(Z.length===2)return k0(Z[1]);let[Y,X,J={}]=Z,{lang:Q="text",theme:$=Y.getLoadedThemes()[0]}=J;if(mX(Q)||pX($))throw new YZ("Plain language does not have grammar state");if(Q==="ansi")throw new YZ("ANSI language does not have grammar state");let{theme:K,colorMap:U}=Y.setTheme($),W=Y.getLanguage(Q);return new O0(lX(X,W,K,U,J).stateStack,W.name,K.name)}function y9(Z,Y,X,J,Q){let $=lX(Z,Y,X,J,Q),K=new O0($.stateStack,Y.name,X.name);return VY($.tokens,K),$.tokens}function lX(Z,Y,X,J,Q){let $=PY(X,Q),{tokenizeMaxLineLength:K=0,tokenizeTimeLimit:U=500}=Q,W=DY(Z),z=Q.grammarState?L9(Q.grammarState,X.name)??OY:Q.grammarContextCode!=null?lX(Q.grammarContextCode,Y,X,J,{...Q,grammarState:void 0,grammarContextCode:void 0}).stateStack:OY,H=[],G=[];for(let F=0,M=W.length;F<M;F++){let[N,w]=W[F];if(N===""){H=[],G.push([]);continue}if(K>0&&N.length>=K){H=[],G.push([{content:N,offset:w,color:"",fontStyle:0}]);continue}let L,B,C;if(Q.includeExplanation)L=Y.tokenizeLine(N,z,U),B=L.tokens,C=0;let R=Y.tokenizeLine2(N,z,U),D=R.tokens.length/2;for(let f=0;f<D;f++){let V=R.tokens[2*f],d=f+1<D?R.tokens[2*f+2]:N.length;if(V===d)continue;let l=R.tokens[2*f+1],u=T4(J[o4.getForeground(l)],$),n=o4.getFontStyle(l),i={content:N.substring(V,d),offset:w+V,color:u,fontStyle:n};if(Q.includeExplanation){let Q4=[];if(Q.includeExplanation!=="scopeName")for(let hZ of X.settings){let h4;switch(typeof hZ.scope){case"string":h4=hZ.scope.split(/,/).map((m0)=>m0.trim());break;case"object":h4=hZ.scope;break;default:continue}Q4.push({settings:hZ,selectors:h4.map((m0)=>m0.split(/ /))})}i.explanation=[];let $4=0;while(V+$4<d){let hZ=B[C],h4=N.substring(hZ.startIndex,hZ.endIndex);$4+=h4.length,i.explanation.push({content:h4,scopes:Q.includeExplanation==="scopeName"?k9(hZ.scopes):h9(Q4,hZ.scopes)}),C+=1}}H.push(i)}G.push(H),H=[],z=R.ruleStack}return{tokens:G,stateStack:z}}function k9(Z){return Z.map((Y)=>({scopeName:Y}))}function h9(Z,Y){let X=[];for(let J=0,Q=Y.length;J<Q;J++){let $=Y[J];X[J]={scopeName:$,themeMatches:g9(Z,$,Y.slice(0,J))}}return X}function m6(Z,Y){return Z===Y||Y.substring(0,Z.length)===Z&&Y[Z.length]==="."}function x9(Z,Y,X){if(!m6(Z[Z.length-1],Y))return!1;let J=Z.length-2,Q=X.length-1;while(J>=0&&Q>=0){if(m6(Z[J],X[Q]))J-=1;Q-=1}if(J===-1)return!0;return!1}function g9(Z,Y,X){let J=[];for(let{selectors:Q,settings:$}of Z)for(let K of Q)if(x9(K,Y,X)){J.push($);break}return J}function e6(Z,Y,X){let J=Object.entries(X.themes).filter((W)=>W[1]).map((W)=>({color:W[0],theme:W[1]})),Q=J.map((W)=>{let z=cX(Z,Y,{...X,theme:W.theme}),H=k0(z),G=typeof W.theme==="string"?W.theme:W.theme.name;return{tokens:z,state:H,theme:G}}),$=u9(...Q.map((W)=>W.tokens)),K=$[0].map((W,z)=>W.map((H,G)=>{let F={content:H.content,variants:{},offset:H.offset};if("includeExplanation"in X&&X.includeExplanation)F.explanation=H.explanation;return $.forEach((M,N)=>{let{content:w,explanation:L,offset:B,...C}=M[z][G];F.variants[J[N].color]=C}),F})),U=Q[0].state?new O0(Object.fromEntries(Q.map((W)=>[W.theme,W.state?.getInternalStack(W.theme)])),Q[0].state.lang):void 0;if(U)VY(K,U);return K}function u9(...Z){let Y=Z.map(()=>[]),X=Z.length;for(let J=0;J<Z[0].length;J++){let Q=Z.map((W)=>W[J]),$=Y.map(()=>[]);Y.forEach((W,z)=>W.push($[z]));let K=Q.map(()=>0),U=Q.map((W)=>W[0]);while(U.every((W)=>W)){let W=Math.min(...U.map((z)=>z.content.length));for(let z=0;z<X;z++){let H=U[z];if(H.content.length===W)$[z].push(H),K[z]+=1,U[z]=Q[z][K[z]];else $[z].push({...H,content:H.content.slice(0,W)}),U[z]={...H,content:H.content.slice(W),offset:H.offset+W}}}}return Y}function IY(Z,Y,X){let J,Q,$,K,U,W;if("themes"in X){let{defaultColor:z="light",cssVariablePrefix:H="--shiki-",colorsRendering:G="css-vars"}=X,F=Object.entries(X.themes).filter((B)=>B[1]).map((B)=>({color:B[0],theme:B[1]})).sort((B,C)=>B.color===z?-1:C.color===z?1:0);if(F.length===0)throw new YZ("`themes` option must not be empty");let M=e6(Z,Y,X);if(W=k0(M),z&&dX!==z&&!F.find((B)=>B.color===z))throw new YZ(`\`themes\` option must contain the defaultColor key \`${z}\``);let N=F.map((B)=>Z.getTheme(B.theme)),w=F.map((B)=>B.color);if($=M.map((B)=>B.map((C)=>w9(C,w,H,z,G))),W)VY($,W);let L=F.map((B)=>PY(B.theme,X));Q=p6(F,N,L,H,z,"fg",G),J=p6(F,N,L,H,z,"bg",G),K=`shiki-themes ${N.map((B)=>B.name).join(" ")}`,U=z?void 0:[Q,J].join(";")}else if("theme"in X){let z=PY(X.theme,X);$=cX(Z,Y,X);let H=Z.getTheme(X.theme);J=T4(H.bg,z),Q=T4(H.fg,z),K=H.name,W=k0($)}else throw new YZ("Invalid options, either `theme` or `themes` must be provided");return{tokens:$,fg:Q,bg:J,themeName:K,rootStyle:U,grammarState:W}}function p6(Z,Y,X,J,Q,$,K){return Z.map((U,W)=>{let z=T4(Y[W][$],X[W])||"inherit",H=`${J+U.color}${$==="bg"?"-bg":""}:${z}`;if(W===0&&Q){if(Q===dX&&Z.length>1){let G=Z.findIndex((w)=>w.color==="light"),F=Z.findIndex((w)=>w.color==="dark");if(G===-1||F===-1)throw new YZ('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let M=T4(Y[G][$],X[G])||"inherit",N=T4(Y[F][$],X[F])||"inherit";return`light-dark(${M}, ${N});${H}`}return z}if(K==="css-vars")return H;return null}).filter((U)=>!!U).join(";")}function vY(Z,Y,X,J={meta:{},options:X,codeToHast:(Q,$)=>vY(Z,Q,$),codeToTokens:(Q,$)=>IY(Z,Q,$)}){let Q=Y;for(let N of CY(X))Q=N.preprocess?.call(J,Q,X)||Q;let{tokens:$,fg:K,bg:U,themeName:W,rootStyle:z,grammarState:H}=IY(Z,Q,X),{mergeWhitespaces:G=!0,mergeSameStyleTokens:F=!1}=X;if(G===!0)$=p9($);else if(G==="never")$=d9($);if(F)$=c9($);let M={...J,get source(){return Q}};for(let N of CY(X))$=N.tokens?.call(M,$)||$;return m9($,{...X,fg:K,bg:U,themeName:W,rootStyle:X.rootStyle===!1?!1:X.rootStyle??z},M,H)}function m9(Z,Y,X,J=k0(Z)){let Q=CY(Y),$=[],K={type:"root",children:[]},{structure:U="classic",tabindex:W="0"}=Y,z={class:`shiki ${Y.themeName||""}`};if(Y.rootStyle!==!1)if(Y.rootStyle!=null)z.style=Y.rootStyle;else z.style=`background-color:${Y.bg};color:${Y.fg}`;if(W!==!1&&W!=null)z.tabindex=W.toString();for(let[w,L]of Object.entries(Y.meta||{}))if(!w.startsWith("_"))z[w]=L;let H={type:"element",tagName:"pre",properties:z,children:[],data:Y.data},G={type:"element",tagName:"code",properties:{},children:$},F=[],M={...X,structure:U,addClassToHast:n6,get source(){return X.source},get tokens(){return Z},get options(){return Y},get root(){return K},get pre(){return H},get code(){return G},get lines(){return F}};if(Z.forEach((w,L)=>{if(L){if(U==="inline")K.children.push({type:"element",tagName:"br",properties:{},children:[]});else if(U==="classic")$.push({type:"text",value:`
142
+ `})}let B={type:"element",tagName:"span",properties:{class:"line"},children:[]},C=0;for(let R of w){let D={type:"element",tagName:"span",properties:{...R.htmlAttrs},children:[{type:"text",value:R.content}]},f=uX(R.htmlStyle||RY(R));if(f)D.properties.style=f;for(let V of Q)D=V?.span?.call(M,D,L+1,C,B,R)||D;if(U==="inline")K.children.push(D);else if(U==="classic")B.children.push(D);C+=R.content.length}if(U==="classic"){for(let R of Q)B=R?.line?.call(M,B,L+1)||B;F.push(B),$.push(B)}else if(U==="inline")F.push(B)}),U==="classic"){for(let w of Q)G=w?.code?.call(M,G)||G;H.children.push(G);for(let w of Q)H=w?.pre?.call(M,H)||H;K.children.push(H)}else if(U==="inline"){let w=[],L={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let R of K.children)if(R.type==="element"&&R.tagName==="br")w.push(L),L={type:"element",tagName:"span",properties:{class:"line"},children:[]};else if(R.type==="element"||R.type==="text")L.children.push(R);w.push(L);let C={type:"element",tagName:"code",properties:{},children:w};for(let R of Q)C=R?.code?.call(M,C)||C;K.children=[];for(let R=0;R<C.children.length;R++){if(R>0)K.children.push({type:"element",tagName:"br",properties:{},children:[]});let D=C.children[R];if(D.type==="element")K.children.push(...D.children)}}let N=K;for(let w of Q)N=w?.root?.call(M,N)||N;if(J)VY(N,J);return N}function p9(Z){return Z.map((Y)=>{let X=[],J="",Q;return Y.forEach(($,K)=>{let W=!($.fontStyle&&($.fontStyle&GZ.Underline||$.fontStyle&GZ.Strikethrough));if(W&&$.content.match(/^\s+$/)&&Y[K+1]){if(Q===void 0)Q=$.offset;J+=$.content}else if(J){if(W)X.push({...$,offset:Q,content:J+$.content});else X.push({content:J,offset:Q},$);Q=void 0,J=""}else X.push($)}),X})}function d9(Z){return Z.map((Y)=>{return Y.flatMap((X)=>{if(X.content.match(/^\s+$/))return X;let J=X.content.match(/^(\s*)(.*?)(\s*)$/);if(!J)return X;let[,Q,$,K]=J;if(!Q&&!K)return X;let U=[{...X,offset:X.offset+Q.length,content:$}];if(Q)U.unshift({content:Q,offset:X.offset});if(K)U.push({content:K,offset:X.offset+Q.length+$.length});return U})})}function c9(Z){return Z.map((Y)=>{let X=[];for(let J of Y){if(X.length===0){X.push({...J});continue}let Q=X[X.length-1],$=uX(Q.htmlStyle||RY(Q)),K=uX(J.htmlStyle||RY(J)),U=Q.fontStyle&&(Q.fontStyle&GZ.Underline||Q.fontStyle&GZ.Strikethrough),W=J.fontStyle&&(J.fontStyle&GZ.Underline||J.fontStyle&GZ.Strikethrough);if(!U&&!W&&$===K)Q.content+=J.content;else X.push({...J})}return X})}var l9=hX;function i9(Z,Y,X){let J={meta:{},options:X,codeToHast:($,K)=>vY(Z,$,K),codeToTokens:($,K)=>IY(Z,$,K)},Q=l9(vY(Z,Y,X,J));for(let $ of CY(X))Q=$.postprocess?.call(J,Q,X)||Q;return Q}var d6={light:"#333333",dark:"#bbbbbb"},c6={light:"#fffffe",dark:"#1e1e1e"},l6="__shiki_resolved";function iX(Z){if(Z?.[l6])return Z;let Y={...Z};if(Y.tokenColors&&!Y.settings)Y.settings=Y.tokenColors,delete Y.tokenColors;Y.type||="dark",Y.colorReplacements={...Y.colorReplacements},Y.settings||=[];let{bg:X,fg:J}=Y;if(!X||!J){let U=Y.settings?Y.settings.find((W)=>!W.name&&!W.scope):void 0;if(U?.settings?.foreground)J=U.settings.foreground;if(U?.settings?.background)X=U.settings.background;if(!J&&Y?.colors?.["editor.foreground"])J=Y.colors["editor.foreground"];if(!X&&Y?.colors?.["editor.background"])X=Y.colors["editor.background"];if(!J)J=Y.type==="light"?d6.light:d6.dark;if(!X)X=Y.type==="light"?c6.light:c6.dark;Y.fg=J,Y.bg=X}if(!(Y.settings[0]&&Y.settings[0].settings&&!Y.settings[0].scope))Y.settings.unshift({settings:{foreground:Y.fg,background:Y.bg}});let Q=0,$=new Map;function K(U){if($.has(U))return $.get(U);Q+=1;let W=`#${Q.toString(16).padStart(8,"0").toLowerCase()}`;if(Y.colorReplacements?.[`#${W}`])return K(U);return $.set(U,W),W}Y.settings=Y.settings.map((U)=>{let W=U.settings?.foreground&&!U.settings.foreground.startsWith("#"),z=U.settings?.background&&!U.settings.background.startsWith("#");if(!W&&!z)return U;let H={...U,settings:{...U.settings}};if(W){let G=K(U.settings.foreground);Y.colorReplacements[G]=U.settings.foreground,H.settings.foreground=G}if(z){let G=K(U.settings.background);Y.colorReplacements[G]=U.settings.background,H.settings.background=G}return H});for(let U of Object.keys(Y.colors||{}))if(U==="editor.foreground"||U==="editor.background"||U.startsWith("terminal.ansi")){if(!Y.colors[U]?.startsWith("#")){let W=K(Y.colors[U]);Y.colorReplacements[W]=Y.colors[U],Y.colors[U]=W}}return Object.defineProperty(Y,l6,{enumerable:!1,writable:!1,value:!0}),Y}async function ZJ(Z){return Array.from(new Set((await Promise.all(Z.filter((Y)=>!r6(Y)).map(async(Y)=>await i6(Y).then((X)=>Array.isArray(X)?X:[X])))).flat()))}async function YJ(Z){return(await Promise.all(Z.map(async(X)=>o6(X)?null:iX(await i6(X))))).filter((X)=>!!X)}var gX=3,r9=!1;function o9(Z,Y=3){if(!gX)return;if(typeof gX==="number"&&Y>gX)return;if(r9)throw Error(`[SHIKI DEPRECATE]: ${Z}`);else console.trace(`[SHIKI DEPRECATE]: ${Z}`)}class t4 extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function XJ(Z,Y){if(!Y)return Z;if(Y[Z]){let X=new Set([Z]);while(Y[Z]){if(Z=Y[Z],X.has(Z))throw new t4(`Circular alias \`${Array.from(X).join(" -> ")} -> ${Z}\``);X.add(Z)}}return Z}class JJ extends z6{constructor(Z,Y,X,J={}){super(Z);this._resolver=Z,this._themes=Y,this._langs=X,this._alias=J,this._themes.map((Q)=>this.loadTheme(Q)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(Z){if(typeof Z==="string")return this._resolvedThemes.get(Z);else return this.loadTheme(Z)}loadTheme(Z){let Y=iX(Z);if(Y.name)this._resolvedThemes.set(Y.name,Y),this._loadedThemesCache=null;return Y}getLoadedThemes(){if(!this._loadedThemesCache)this._loadedThemesCache=[...this._resolvedThemes.keys()];return this._loadedThemesCache}setTheme(Z){let Y=this._textmateThemeCache.get(Z);if(!Y)Y=D0.createFromRawTheme(Z),this._textmateThemeCache.set(Z,Y);this._syncRegistry.setTheme(Y)}getGrammar(Z){return Z=XJ(Z,this._alias),this._resolvedGrammars.get(Z)}loadLanguage(Z){if(this.getGrammar(Z.name))return;let Y=new Set([...this._langMap.values()].filter((Q)=>Q.embeddedLangsLazy?.includes(Z.name)));this._resolver.addLanguage(Z);let X={balancedBracketSelectors:Z.balancedBracketSelectors||["*"],unbalancedBracketSelectors:Z.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(Z.scopeName,Z);let J=this.loadGrammarWithConfiguration(Z.scopeName,1,X);if(J.name=Z.name,this._resolvedGrammars.set(Z.name,J),Z.aliases)Z.aliases.forEach((Q)=>{this._alias[Q]=Z.name});if(this._loadedLanguagesCache=null,Y.size)for(let Q of Y)this._resolvedGrammars.delete(Q.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(Q.scopeName),this._syncRegistry?._grammars?.delete(Q.scopeName),this.loadLanguage(this._langMap.get(Q.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(Z){for(let J of Z)this.resolveEmbeddedLanguages(J);let Y=Array.from(this._langGraph.entries()),X=Y.filter(([J,Q])=>!Q);if(X.length){let J=Y.filter(([Q,$])=>{if(!$)return!1;return($.embeddedLanguages||$.embeddedLangs)?.some((U)=>X.map(([W])=>W).includes(U))}).filter((Q)=>!X.includes(Q));throw new t4(`Missing languages ${X.map(([Q])=>`\`${Q}\``).join(", ")}, required by ${J.map(([Q])=>`\`${Q}\``).join(", ")}`)}for(let[J,Q]of Y)this._resolver.addLanguage(Q);for(let[J,Q]of Y)this.loadLanguage(Q)}getLoadedLanguages(){if(!this._loadedLanguagesCache)this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])];return this._loadedLanguagesCache}resolveEmbeddedLanguages(Z){this._langMap.set(Z.name,Z),this._langGraph.set(Z.name,Z);let Y=Z.embeddedLanguages??Z.embeddedLangs;if(Y)for(let X of Y)this._langGraph.set(X,this._langMap.get(X))}}class QJ{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(Z,Y){this._onigLib={createOnigScanner:(X)=>Z.createScanner(X),createOnigString:(X)=>Z.createString(X)},Y.forEach((X)=>this.addLanguage(X))}get onigLib(){return this._onigLib}getLangRegistration(Z){return this._langs.get(Z)}loadGrammar(Z){return this._scopeToLang.get(Z)}addLanguage(Z){if(this._langs.set(Z.name,Z),Z.aliases)Z.aliases.forEach((Y)=>{this._langs.set(Y,Z)});if(this._scopeToLang.set(Z.scopeName,Z),Z.injectTo)Z.injectTo.forEach((Y)=>{if(!this._injections.get(Y))this._injections.set(Y,[]);this._injections.get(Y).push(Z.scopeName)})}getInjections(Z){let Y=Z.split("."),X=[];for(let J=1;J<=Y.length;J++){let Q=Y.slice(0,J).join(".");X=[...X,...this._injections.get(Q)||[]]}return X}}var y0=0;function n9(Z){if(y0+=1,Z.warnings!==!1&&y0>=10&&y0%10===0)console.warn(`[Shiki] ${y0} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let Y=!1;if(!Z.engine)throw new t4("`engine` option is required for synchronous mode");let X=(Z.langs||[]).flat(1),J=(Z.themes||[]).flat(1).map(iX),Q=new QJ(Z.engine,X),$=new JJ(Q,J,X,Z.langAlias),K;function U(R){return XJ(R,Z.langAlias)}function W(R){B();let D=$.getGrammar(typeof R==="string"?R:R.name);if(!D)throw new t4(`Language \`${R}\` not found, you may need to load it first`);return D}function z(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};B();let D=$.getTheme(R);if(!D)throw new t4(`Theme \`${R}\` not found, you may need to load it first`);return D}function H(R){B();let D=z(R);if(K!==R)$.setTheme(D),K=R;let f=$.getColorMap();return{theme:D,colorMap:f}}function G(){return B(),$.getLoadedThemes()}function F(){return B(),$.getLoadedLanguages()}function M(...R){B(),$.loadLanguages(R.flat(1))}async function N(...R){return M(await ZJ(R))}function w(...R){B();for(let D of R.flat(1))$.loadTheme(D)}async function L(...R){return B(),w(await YJ(R))}function B(){if(Y)throw new t4("Shiki instance has been disposed")}function C(){if(Y)return;Y=!0,$.dispose(),y0-=1}return{setTheme:H,getTheme:z,getLanguage:W,getLoadedThemes:G,getLoadedLanguages:F,resolveLangAlias:U,loadLanguage:N,loadLanguageSync:M,loadTheme:L,loadThemeSync:w,dispose:C,[Symbol.dispose]:C}}async function a9(Z){if(!Z.engine)o9("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[Y,X,J]=await Promise.all([YJ(Z.themes||[]),ZJ(Z.langs||[]),Z.engine]);return n9({...Z,themes:Y,langs:X,engine:J})}async function s9(Z){let Y=await a9(Z);return{getLastGrammarState:(...X)=>S9(Y,...X),codeToTokensBase:(X,J)=>cX(Y,X,J),codeToTokensWithThemes:(X,J)=>e6(Y,X,J),codeToTokens:(X,J)=>IY(Y,X,J),codeToHast:(X,J)=>vY(Y,X,J),codeToHtml:(X,J)=>i9(Y,X,J),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...Y,getInternalContext:()=>Y}}function $J(Z){let{langs:Y,themes:X,engine:J}=Z;async function Q($){function K(G){if(typeof G==="string"){if(G=$.langAlias?.[G]||G,r6(G))return[];let F=Y[G];if(!F)throw new YZ(`Language \`${G}\` is not included in this bundle. You may want to load it from external source.`);return F}return G}function U(G){if(o6(G))return"none";if(typeof G==="string"){let F=X[G];if(!F)throw new YZ(`Theme \`${G}\` is not included in this bundle. You may want to load it from external source.`);return F}return G}let W=($.themes??[]).map((G)=>U(G)),z=($.langs??[]).map((G)=>K(G)),H=await s9({engine:$.engine??J(),...$,themes:W,langs:z});return{...H,loadLanguage(...G){return H.loadLanguage(...G.map(K))},loadTheme(...G){return H.loadTheme(...G.map(U))},getBundledLanguages(){return Y},getBundledThemes(){return X}}}return Q}function t9(Z){let Y;async function X(J={}){if(!Y){Y=Z({...J,themes:[],langs:[]});let Q=await Y;return await Promise.all([Q.loadTheme(...J.themes||[]),Q.loadLanguage(...J.langs||[])]),Q}else{let Q=await Y;return await Promise.all([Q.loadTheme(...J.themes||[]),Q.loadLanguage(...J.langs||[])]),Q}}return X}function KJ(Z,Y){let X=t9(Z);async function J(Q,$){let K=await X({langs:[$.lang],themes:"theme"in $?[$.theme]:Object.values($.themes)}),U=await Y?.guessEmbeddedLanguages?.(Q,$.lang,K);if(U)await K.loadLanguage(...U);return K}return{getSingletonHighlighter(Q){return X(Q)},async codeToHtml(Q,$){return(await J(Q,$)).codeToHtml(Q,$)},async codeToHast(Q,$){return(await J(Q,$)).codeToHast(Q,$)},async codeToTokens(Q,$){return(await J(Q,$)).codeToTokens(Q,$)},async codeToTokensBase(Q,$){return(await J(Q,$)).codeToTokensBase(Q,$)},async codeToTokensWithThemes(Q,$){return(await J(Q,$)).codeToTokensWithThemes(Q,$)},async getLastGrammarState(Q,$){return(await X({langs:[$.lang],themes:[$.theme]})).getLastGrammarState(Q,$)}}}var WJ=[{id:"abap",name:"ABAP",import:()=>import("./chunk-qf60gd6x.js")},{id:"actionscript-3",name:"ActionScript",import:()=>import("./chunk-1ck3yagm.js")},{id:"ada",name:"Ada",import:()=>import("./chunk-xm9015v4.js")},{id:"angular-html",name:"Angular HTML",import:()=>import("./chunk-k17n7dpm.js")},{id:"angular-ts",name:"Angular TypeScript",import:()=>import("./chunk-ah557n6f.js")},{id:"apache",name:"Apache Conf",import:()=>import("./chunk-n08dw2ke.js")},{id:"apex",name:"Apex",import:()=>import("./chunk-2z60cf4h.js")},{id:"apl",name:"APL",import:()=>import("./chunk-fs5s90mk.js")},{id:"applescript",name:"AppleScript",import:()=>import("./chunk-5n6g25gc.js")},{id:"ara",name:"Ara",import:()=>import("./chunk-zytr7a4n.js")},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>import("./chunk-gaw2bhff.js")},{id:"asm",name:"Assembly",import:()=>import("./chunk-f1gz54zs.js")},{id:"astro",name:"Astro",import:()=>import("./chunk-raq8eqd9.js")},{id:"awk",name:"AWK",import:()=>import("./chunk-y0e2ymas.js")},{id:"ballerina",name:"Ballerina",import:()=>import("./chunk-gsnrqmzp.js")},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>import("./chunk-17g5e3tb.js")},{id:"beancount",name:"Beancount",import:()=>import("./chunk-mvb82v3n.js")},{id:"berry",name:"Berry",aliases:["be"],import:()=>import("./chunk-fftvnc8t.js")},{id:"bibtex",name:"BibTeX",import:()=>import("./chunk-6qyeer8n.js")},{id:"bicep",name:"Bicep",import:()=>import("./chunk-xkc2ktrh.js")},{id:"blade",name:"Blade",import:()=>import("./chunk-n6v7menj.js")},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>import("./chunk-j6s60n91.js")},{id:"c",name:"C",import:()=>import("./chunk-sq9spyfd.js")},{id:"c3",name:"C3",import:()=>import("./chunk-wd17hcv5.js")},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>import("./chunk-8vr1wy0r.js")},{id:"cairo",name:"Cairo",import:()=>import("./chunk-wbg38h5j.js")},{id:"clarity",name:"Clarity",import:()=>import("./chunk-pc3w4gkp.js")},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>import("./chunk-hgkaxnh7.js")},{id:"cmake",name:"CMake",import:()=>import("./chunk-ewx6fr7a.js")},{id:"cobol",name:"COBOL",import:()=>import("./chunk-1m8bmdzc.js")},{id:"codeowners",name:"CODEOWNERS",import:()=>import("./chunk-56q8b04m.js")},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>import("./chunk-h06hyckd.js")},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>import("./chunk-fd4dk58v.js")},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>import("./chunk-tkp1zzgb.js")},{id:"coq",name:"Coq",import:()=>import("./chunk-kkks4cbp.js")},{id:"cpp",name:"C++",aliases:["c++"],import:()=>import("./chunk-731nq1br.js")},{id:"crystal",name:"Crystal",import:()=>import("./chunk-r5crgj5q.js")},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>import("./chunk-2yk5xgha.js")},{id:"css",name:"CSS",import:()=>import("./chunk-7w75nxwb.js")},{id:"csv",name:"CSV",import:()=>import("./chunk-f2p8rps5.js")},{id:"cue",name:"CUE",import:()=>import("./chunk-jyrs3ysr.js")},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>import("./chunk-w93s735t.js")},{id:"d",name:"D",import:()=>import("./chunk-sk4n2anv.js")},{id:"dart",name:"Dart",import:()=>import("./chunk-ctet86gc.js")},{id:"dax",name:"DAX",import:()=>import("./chunk-zh77yp9z.js")},{id:"desktop",name:"Desktop",import:()=>import("./chunk-77chzpqs.js")},{id:"diff",name:"Diff",import:()=>import("./chunk-vrv07424.js")},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>import("./chunk-pqq81gzv.js")},{id:"dotenv",name:"dotEnv",import:()=>import("./chunk-f3mf8qk2.js")},{id:"dream-maker",name:"Dream Maker",import:()=>import("./chunk-rbebjqfq.js")},{id:"edge",name:"Edge",import:()=>import("./chunk-z88rcc8t.js")},{id:"elixir",name:"Elixir",import:()=>import("./chunk-s5yace4y.js")},{id:"elm",name:"Elm",import:()=>import("./chunk-0kvk3r1g.js")},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>import("./chunk-kgj1ssyj.js")},{id:"erb",name:"ERB",import:()=>import("./chunk-y6mvs6yw.js")},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>import("./chunk-21gm4tm7.js")},{id:"fennel",name:"Fennel",import:()=>import("./chunk-1tj3j2rd.js")},{id:"fish",name:"Fish",import:()=>import("./chunk-6vhg46d2.js")},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>import("./chunk-x8z2fzz8.js")},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>import("./chunk-yhxvqyz4.js")},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>import("./chunk-vqpam6p8.js")},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>import("./chunk-t6x8a62a.js")},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:()=>import("./chunk-f8c6jyrc.js")},{id:"gdscript",name:"GDScript",aliases:["gd"],import:()=>import("./chunk-82xzyhyv.js")},{id:"gdshader",name:"GDShader",import:()=>import("./chunk-wcyrmfpn.js")},{id:"genie",name:"Genie",import:()=>import("./chunk-gbrg4c7y.js")},{id:"gherkin",name:"Gherkin",import:()=>import("./chunk-ywbbf9eh.js")},{id:"git-commit",name:"Git Commit Message",import:()=>import("./chunk-hv4arqm5.js")},{id:"git-rebase",name:"Git Rebase Message",import:()=>import("./chunk-nks89eba.js")},{id:"gleam",name:"Gleam",import:()=>import("./chunk-3s3b7nzy.js")},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>import("./chunk-wkc7w10f.js")},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>import("./chunk-wznpd7sd.js")},{id:"glsl",name:"GLSL",import:()=>import("./chunk-p7ha3t1f.js")},{id:"gn",name:"GN",import:()=>import("./chunk-nwx5cbjc.js")},{id:"gnuplot",name:"Gnuplot",import:()=>import("./chunk-bz79zq7h.js")},{id:"go",name:"Go",import:()=>import("./chunk-pm5gceg0.js")},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>import("./chunk-mns6edxc.js")},{id:"groovy",name:"Groovy",import:()=>import("./chunk-hzqb4sy6.js")},{id:"hack",name:"Hack",import:()=>import("./chunk-wb43p5km.js")},{id:"haml",name:"Ruby Haml",import:()=>import("./chunk-ez2xn1tq.js")},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>import("./chunk-2a6kan82.js")},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>import("./chunk-tx117rah.js")},{id:"haxe",name:"Haxe",import:()=>import("./chunk-0cbmnyee.js")},{id:"hcl",name:"HashiCorp HCL",import:()=>import("./chunk-wvmnb75v.js")},{id:"hjson",name:"Hjson",import:()=>import("./chunk-1xjj19pz.js")},{id:"hlsl",name:"HLSL",import:()=>import("./chunk-rx707y69.js")},{id:"html",name:"HTML",import:()=>import("./chunk-1fmdjx58.js")},{id:"html-derivative",name:"HTML (Derivative)",import:()=>import("./chunk-bqzvv2dy.js")},{id:"http",name:"HTTP",import:()=>import("./chunk-1zbnmy0p.js")},{id:"hurl",name:"Hurl",import:()=>import("./chunk-k1yv7tpj.js")},{id:"hxml",name:"HXML",import:()=>import("./chunk-6eyx9kb0.js")},{id:"hy",name:"Hy",import:()=>import("./chunk-91gd665t.js")},{id:"imba",name:"Imba",import:()=>import("./chunk-m0vtra47.js")},{id:"ini",name:"INI",aliases:["properties"],import:()=>import("./chunk-zjemnf8v.js")},{id:"java",name:"Java",import:()=>import("./chunk-j0szwqey.js")},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>import("./chunk-rg8hdkt2.js")},{id:"jinja",name:"Jinja",import:()=>import("./chunk-ywa5z7d9.js")},{id:"jison",name:"Jison",import:()=>import("./chunk-5rmyjm7a.js")},{id:"json",name:"JSON",import:()=>import("./chunk-sw6b067z.js")},{id:"json5",name:"JSON5",import:()=>import("./chunk-8ee7jvcr.js")},{id:"jsonc",name:"JSON with Comments",import:()=>import("./chunk-b4qvb571.js")},{id:"jsonl",name:"JSON Lines",import:()=>import("./chunk-1xdz3wdt.js")},{id:"jsonnet",name:"Jsonnet",import:()=>import("./chunk-4agrg21g.js")},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>import("./chunk-xa4apmpd.js")},{id:"jsx",name:"JSX",import:()=>import("./chunk-ndk5mkc1.js")},{id:"julia",name:"Julia",aliases:["jl"],import:()=>import("./chunk-kq7y5ybe.js")},{id:"kdl",name:"KDL",import:()=>import("./chunk-k626mmdc.js")},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>import("./chunk-vsydmxfh.js")},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>import("./chunk-xhjrdhgk.js")},{id:"latex",name:"LaTeX",import:()=>import("./chunk-2cfemb9q.js")},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>import("./chunk-ka0pqrag.js")},{id:"less",name:"Less",import:()=>import("./chunk-9mjq1xxc.js")},{id:"liquid",name:"Liquid",import:()=>import("./chunk-6yb36qx6.js")},{id:"llvm",name:"LLVM IR",import:()=>import("./chunk-vy4ecvry.js")},{id:"log",name:"Log file",import:()=>import("./chunk-917pj3vx.js")},{id:"logo",name:"Logo",import:()=>import("./chunk-1z3yy9vz.js")},{id:"lua",name:"Lua",import:()=>import("./chunk-esskh0ge.js")},{id:"luau",name:"Luau",import:()=>import("./chunk-jz8tmenz.js")},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>import("./chunk-y6z502pz.js")},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>import("./chunk-sepabvgd.js")},{id:"marko",name:"Marko",import:()=>import("./chunk-bzanqq7a.js")},{id:"matlab",name:"MATLAB",import:()=>import("./chunk-pz5xskrk.js")},{id:"mdc",name:"MDC",import:()=>import("./chunk-dz0229fs.js")},{id:"mdx",name:"MDX",import:()=>import("./chunk-xf7ypd1b.js")},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>import("./chunk-t4vfr2g0.js")},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>import("./chunk-vwhxfs9r.js")},{id:"mojo",name:"Mojo",import:()=>import("./chunk-h1bjeyn7.js")},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:()=>import("./chunk-2mrbrsta.js")},{id:"move",name:"Move",import:()=>import("./chunk-7k80bxbe.js")},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>import("./chunk-av215sh3.js")},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>import("./chunk-6cs4tf5a.js")},{id:"nginx",name:"Nginx",import:()=>import("./chunk-wkf1j21b.js")},{id:"nim",name:"Nim",import:()=>import("./chunk-mrbn4knm.js")},{id:"nix",name:"Nix",import:()=>import("./chunk-ydc7pd3b.js")},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>import("./chunk-kk4w0prd.js")},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>import("./chunk-kys8sc0j.js")},{id:"objective-cpp",name:"Objective-C++",import:()=>import("./chunk-s2wchktz.js")},{id:"ocaml",name:"OCaml",import:()=>import("./chunk-gxc7a8cz.js")},{id:"odin",name:"Odin",import:()=>import("./chunk-mfyvxat8.js")},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:()=>import("./chunk-kc8375a8.js")},{id:"pascal",name:"Pascal",import:()=>import("./chunk-htns6qnb.js")},{id:"perl",name:"Perl",import:()=>import("./chunk-z5z774pp.js")},{id:"php",name:"PHP",import:()=>import("./chunk-n8apqh5d.js")},{id:"pkl",name:"Pkl",import:()=>import("./chunk-fvhtfw18.js")},{id:"plsql",name:"PL/SQL",import:()=>import("./chunk-bs9fj12n.js")},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>import("./chunk-06dj0dnz.js")},{id:"polar",name:"Polar",import:()=>import("./chunk-9hnbyswz.js")},{id:"postcss",name:"PostCSS",import:()=>import("./chunk-rc81vkve.js")},{id:"powerquery",name:"PowerQuery",import:()=>import("./chunk-3d8rzv4d.js")},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>import("./chunk-hgs9vzm2.js")},{id:"prisma",name:"Prisma",import:()=>import("./chunk-vgeyt962.js")},{id:"prolog",name:"Prolog",import:()=>import("./chunk-ceb97hw6.js")},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>import("./chunk-0jtrg9s1.js")},{id:"pug",name:"Pug",aliases:["jade"],import:()=>import("./chunk-ctp90f8y.js")},{id:"puppet",name:"Puppet",import:()=>import("./chunk-7v4352jx.js")},{id:"purescript",name:"PureScript",import:()=>import("./chunk-ny61b4ve.js")},{id:"python",name:"Python",aliases:["py"],import:()=>import("./chunk-mtyqtnv0.js")},{id:"qml",name:"QML",import:()=>import("./chunk-gps0pyf7.js")},{id:"qmldir",name:"QML Directory",import:()=>import("./chunk-4k15drqf.js")},{id:"qss",name:"Qt Style Sheets",import:()=>import("./chunk-66sfgeag.js")},{id:"r",name:"R",import:()=>import("./chunk-3rew4tyk.js")},{id:"racket",name:"Racket",import:()=>import("./chunk-sdhd2kpk.js")},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>import("./chunk-tj729ry3.js")},{id:"razor",name:"ASP.NET Razor",import:()=>import("./chunk-ms3sqsez.js")},{id:"reg",name:"Windows Registry Script",import:()=>import("./chunk-87w9rexn.js")},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>import("./chunk-xnx0j1hw.js")},{id:"rel",name:"Rel",import:()=>import("./chunk-3w98g1h4.js")},{id:"riscv",name:"RISC-V",import:()=>import("./chunk-ynnaxz2z.js")},{id:"ron",name:"RON",import:()=>import("./chunk-v9qb0fer.js")},{id:"rosmsg",name:"ROS Interface",import:()=>import("./chunk-qpwtcr53.js")},{id:"rst",name:"reStructuredText",import:()=>import("./chunk-5n57csbz.js")},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>import("./chunk-zmsq5xc7.js")},{id:"rust",name:"Rust",aliases:["rs"],import:()=>import("./chunk-bjqn0pzz.js")},{id:"sas",name:"SAS",import:()=>import("./chunk-0x0r76m6.js")},{id:"sass",name:"Sass",import:()=>import("./chunk-x01t9e3q.js")},{id:"scala",name:"Scala",import:()=>import("./chunk-7pwrx1pp.js")},{id:"scheme",name:"Scheme",import:()=>import("./chunk-ejh8spnd.js")},{id:"scss",name:"SCSS",import:()=>import("./chunk-am5r5ynh.js")},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>import("./chunk-5bvkhjg1.js")},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>import("./chunk-ezh4rq18.js")},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>import("./chunk-h5y1vfrx.js")},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>import("./chunk-kx3dsqc5.js")},{id:"smalltalk",name:"Smalltalk",import:()=>import("./chunk-yzk3bfzn.js")},{id:"solidity",name:"Solidity",import:()=>import("./chunk-qd2hkayk.js")},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>import("./chunk-6qbdcv3t.js")},{id:"sparql",name:"SPARQL",import:()=>import("./chunk-wb08g5z8.js")},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>import("./chunk-0kan91hr.js")},{id:"sql",name:"SQL",import:()=>import("./chunk-nvnw7mcb.js")},{id:"ssh-config",name:"SSH Config",import:()=>import("./chunk-r5psjv6v.js")},{id:"stata",name:"Stata",import:()=>import("./chunk-cayjw3gk.js")},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>import("./chunk-pt1m6xh9.js")},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:()=>import("./chunk-tq7jpqr7.js")},{id:"svelte",name:"Svelte",import:()=>import("./chunk-emjqnzzj.js")},{id:"swift",name:"Swift",import:()=>import("./chunk-be8bz8xh.js")},{id:"system-verilog",name:"SystemVerilog",import:()=>import("./chunk-n92ey5c2.js")},{id:"systemd",name:"Systemd Units",import:()=>import("./chunk-rt7af3wp.js")},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>import("./chunk-pj843s6s.js")},{id:"tasl",name:"Tasl",import:()=>import("./chunk-dnpybaez.js")},{id:"tcl",name:"Tcl",import:()=>import("./chunk-zqxrtejz.js")},{id:"templ",name:"Templ",import:()=>import("./chunk-250846sw.js")},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>import("./chunk-whdmep96.js")},{id:"tex",name:"TeX",import:()=>import("./chunk-7n5b43s8.js")},{id:"toml",name:"TOML",import:()=>import("./chunk-59vj8mx3.js")},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>import("./chunk-asdze5kz.js")},{id:"tsv",name:"TSV",import:()=>import("./chunk-qzy0w65x.js")},{id:"tsx",name:"TSX",import:()=>import("./chunk-cv5akzkw.js")},{id:"turtle",name:"Turtle",import:()=>import("./chunk-kr6cv1mp.js")},{id:"twig",name:"Twig",import:()=>import("./chunk-mft6e1b3.js")},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>import("./chunk-7yf45m28.js")},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>import("./chunk-fm3k6prw.js")},{id:"typst",name:"Typst",aliases:["typ"],import:()=>import("./chunk-r9dm0gyn.js")},{id:"v",name:"V",import:()=>import("./chunk-dp2418kp.js")},{id:"vala",name:"Vala",import:()=>import("./chunk-fdhzjb42.js")},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>import("./chunk-wdm62dbr.js")},{id:"verilog",name:"Verilog",import:()=>import("./chunk-7wa89vcy.js")},{id:"vhdl",name:"VHDL",import:()=>import("./chunk-54kyvbh7.js")},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>import("./chunk-gkhxerej.js")},{id:"vue",name:"Vue",import:()=>import("./chunk-3emyjvqg.js")},{id:"vue-html",name:"Vue HTML",import:()=>import("./chunk-q6m1k4fq.js")},{id:"vue-vine",name:"Vue Vine",import:()=>import("./chunk-z0wdan61.js")},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>import("./chunk-0k9tc7ys.js")},{id:"wasm",name:"WebAssembly",import:()=>import("./chunk-748hk53z.js")},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>import("./chunk-xjwkmvfz.js")},{id:"wgsl",name:"WGSL",import:()=>import("./chunk-0cknr23d.js")},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>import("./chunk-kc6rwv2m.js")},{id:"wit",name:"WebAssembly Interface Types",import:()=>import("./chunk-w5qvj179.js")},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>import("./chunk-4asb3qnd.js")},{id:"xml",name:"XML",import:()=>import("./chunk-8arg48f8.js")},{id:"xsl",name:"XSL",import:()=>import("./chunk-ffzytaw1.js")},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>import("./chunk-hmtm22t7.js")},{id:"zenscript",name:"ZenScript",import:()=>import("./chunk-ycthcn27.js")},{id:"zig",name:"Zig",import:()=>import("./chunk-8gm5e25z.js")}],e9=Object.fromEntries(WJ.map((Z)=>[Z.id,Z.import])),ZW=Object.fromEntries(WJ.flatMap((Z)=>Z.aliases?.map((Y)=>[Y,Z.import])||[])),UJ={...e9,...ZW};var YW=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>import("./chunk-h0b5na4r.js")},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>import("./chunk-53agfxhn.js")},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>import("./chunk-8qh81vdm.js")},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>import("./chunk-6bhkrdb2.js")},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>import("./chunk-4vhwsrc0.js")},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>import("./chunk-6rhb6xym.js")},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>import("./chunk-8jhmnz2v.js")},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>import("./chunk-ja5m6q40.js")},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>import("./chunk-wqvqvv9e.js")},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>import("./chunk-7khjf5c1.js")},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>import("./chunk-jsqwhbbt.js")},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>import("./chunk-ewxacd5v.js")},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>import("./chunk-4yddzp8e.js")},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>import("./chunk-n8f65qbg.js")},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>import("./chunk-63ncy5kr.js")},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>import("./chunk-sd65hz9x.js")},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>import("./chunk-pz4hhw24.js")},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>import("./chunk-f51sey9j.js")},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>import("./chunk-q0z3nkep.js")},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>import("./chunk-3009w43m.js")},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>import("./chunk-vg853h8j.js")},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>import("./chunk-6r5npryc.js")},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>import("./chunk-9hznfyjs.js")},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>import("./chunk-774cjjgt.js")},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>import("./chunk-aeajq5ft.js")},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>import("./chunk-pcwsyc9b.js")},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>import("./chunk-hraqhe5e.js")},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>import("./chunk-gvjvbwk6.js")},{id:"houston",displayName:"Houston",type:"dark",import:()=>import("./chunk-b3g51e2m.js")},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>import("./chunk-denz6x2z.js")},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>import("./chunk-s22hm2jp.js")},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>import("./chunk-nrkhbe10.js")},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>import("./chunk-5wkah698.js")},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>import("./chunk-rsb82wcd.js")},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>import("./chunk-vcsqkf9c.js")},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>import("./chunk-sv97fsr8.js")},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>import("./chunk-9rmve4r4.js")},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>import("./chunk-6dm27qn5.js")},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>import("./chunk-7z7g35xf.js")},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>import("./chunk-bjctrgpr.js")},{id:"min-light",displayName:"Min Light",type:"light",import:()=>import("./chunk-fb70a9sy.js")},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>import("./chunk-tq142qfa.js")},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>import("./chunk-hjs9ffqg.js")},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>import("./chunk-bba2g9qj.js")},{id:"nord",displayName:"Nord",type:"dark",import:()=>import("./chunk-r9qyzgns.js")},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>import("./chunk-j9za9ext.js")},{id:"one-light",displayName:"One Light",type:"light",import:()=>import("./chunk-nbkkf36e.js")},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>import("./chunk-6fsb1bxc.js")},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>import("./chunk-m9xdbw2j.js")},{id:"red",displayName:"Red",type:"dark",import:()=>import("./chunk-w46ermgd.js")},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>import("./chunk-e8pjcdmj.js")},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>import("./chunk-wm3z6khn.js")},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>import("./chunk-y3c3xgca.js")},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>import("./chunk-6ag9x0z1.js")},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>import("./chunk-7m0c57rj.js")},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>import("./chunk-jdvv96q7.js")},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>import("./chunk-3b8scss4.js")},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>import("./chunk-pvzfgkkq.js")},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>import("./chunk-5m8gh94n.js")},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>import("./chunk-xjgnj3p0.js")},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>import("./chunk-mjfe9s8t.js")},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>import("./chunk-wgamcpyt.js")},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>import("./chunk-kqemj8nq.js")},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>import("./chunk-72cdrnwv.js")}],zJ=Object.fromEntries(YW.map((Z)=>[Z.id,Z.import]));class bY extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function XW(){return 2147483648}function JW(){return typeof performance<"u"?performance.now():Date.now()}var QW=(Z,Y)=>Z+(Y-Z%Y)%Y;async function $W(Z){let Y,X,J={};function Q(M){X=M,J.HEAPU8=new Uint8Array(M),J.HEAPU32=new Uint32Array(M)}function $(M,N,w){J.HEAPU8.copyWithin(M,N,N+w)}function K(M){try{return Y.grow(M-X.byteLength+65535>>>16),Q(Y.buffer),1}catch{}}function U(M){let N=J.HEAPU8.length;M=M>>>0;let w=XW();if(M>w)return!1;for(let L=1;L<=4;L*=2){let B=N*(1+0.2/L);B=Math.min(B,M+100663296);let C=Math.min(w,QW(Math.max(M,B),65536));if(K(C))return!0}return!1}let W=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function z(M,N,w=1024){let L=N+w,B=N;while(M[B]&&!(B>=L))++B;if(B-N>16&&M.buffer&&W)return W.decode(M.subarray(N,B));let C="";while(N<B){let R=M[N++];if(!(R&128)){C+=String.fromCharCode(R);continue}let D=M[N++]&63;if((R&224)===192){C+=String.fromCharCode((R&31)<<6|D);continue}let f=M[N++]&63;if((R&240)===224)R=(R&15)<<12|D<<6|f;else R=(R&7)<<18|D<<12|f<<6|M[N++]&63;if(R<65536)C+=String.fromCharCode(R);else{let V=R-65536;C+=String.fromCharCode(55296|V>>10,56320|V&1023)}}return C}function H(M,N){return M?z(J.HEAPU8,M,N):""}let G={emscripten_get_now:JW,emscripten_memcpy_big:$,emscripten_resize_heap:U,fd_write:()=>0};async function F(){let N=await Z({env:G,wasi_snapshot_preview1:G});Y=N.memory,Q(Y.buffer),Object.assign(J,N),J.UTF8ToString=H}return await F(),J}var KW=Object.defineProperty,WW=(Z,Y,X)=>(Y in Z)?KW(Z,Y,{enumerable:!0,configurable:!0,writable:!0,value:X}):Z[Y]=X,OZ=(Z,Y,X)=>WW(Z,typeof Y!=="symbol"?Y+"":Y,X),NZ=null;function UW(Z){throw new bY(Z.UTF8ToString(Z.getLastOnigError()))}class TY{constructor(Z){OZ(this,"utf16Length"),OZ(this,"utf8Length"),OZ(this,"utf16Value"),OZ(this,"utf8Value"),OZ(this,"utf16OffsetToUtf8"),OZ(this,"utf8OffsetToUtf16");let Y=Z.length,X=TY._utf8ByteLength(Z),J=X!==Y,Q=J?new Uint32Array(Y+1):null;if(J)Q[Y]=X;let $=J?new Uint32Array(X+1):null;if(J)$[X]=Y;let K=new Uint8Array(X),U=0;for(let W=0;W<Y;W++){let z=Z.charCodeAt(W),H=z,G=!1;if(z>=55296&&z<=56319){if(W+1<Y){let F=Z.charCodeAt(W+1);if(F>=56320&&F<=57343)H=(z-55296<<10)+65536|F-56320,G=!0}}if(J){if(Q[W]=U,G)Q[W+1]=U;if(H<=127)$[U+0]=W;else if(H<=2047)$[U+0]=W,$[U+1]=W;else if(H<=65535)$[U+0]=W,$[U+1]=W,$[U+2]=W;else $[U+0]=W,$[U+1]=W,$[U+2]=W,$[U+3]=W}if(H<=127)K[U++]=H;else if(H<=2047)K[U++]=192|(H&1984)>>>6,K[U++]=128|(H&63)>>>0;else if(H<=65535)K[U++]=224|(H&61440)>>>12,K[U++]=128|(H&4032)>>>6,K[U++]=128|(H&63)>>>0;else K[U++]=240|(H&1835008)>>>18,K[U++]=128|(H&258048)>>>12,K[U++]=128|(H&4032)>>>6,K[U++]=128|(H&63)>>>0;if(G)W++}this.utf16Length=Y,this.utf8Length=X,this.utf16Value=Z,this.utf8Value=K,this.utf16OffsetToUtf8=Q,this.utf8OffsetToUtf16=$}static _utf8ByteLength(Z){let Y=0;for(let X=0,J=Z.length;X<J;X++){let Q=Z.charCodeAt(X),$=Q,K=!1;if(Q>=55296&&Q<=56319){if(X+1<J){let U=Z.charCodeAt(X+1);if(U>=56320&&U<=57343)$=(Q-55296<<10)+65536|U-56320,K=!0}}if($<=127)Y+=1;else if($<=2047)Y+=2;else if($<=65535)Y+=3;else Y+=4;if(K)X++}return Y}createString(Z){let Y=Z.omalloc(this.utf8Length);return Z.HEAPU8.set(this.utf8Value,Y),Y}}var fY=class Z{constructor(Y){if(OZ(this,"id",++Z.LAST_ID),OZ(this,"_onigBinding"),OZ(this,"content"),OZ(this,"utf16Length"),OZ(this,"utf8Length"),OZ(this,"utf16OffsetToUtf8"),OZ(this,"utf8OffsetToUtf16"),OZ(this,"ptr"),!NZ)throw new bY("Must invoke loadWasm first.");this._onigBinding=NZ,this.content=Y;let X=new TY(Y);if(this.utf16Length=X.utf16Length,this.utf8Length=X.utf8Length,this.utf16OffsetToUtf8=X.utf16OffsetToUtf8,this.utf8OffsetToUtf16=X.utf8OffsetToUtf16,this.utf8Length<1e4&&!Z._sharedPtrInUse){if(!Z._sharedPtr)Z._sharedPtr=NZ.omalloc(1e4);Z._sharedPtrInUse=!0,NZ.HEAPU8.set(X.utf8Value,Z._sharedPtr),this.ptr=Z._sharedPtr}else this.ptr=X.createString(NZ)}convertUtf8OffsetToUtf16(Y){if(this.utf8OffsetToUtf16){if(Y<0)return 0;if(Y>this.utf8Length)return this.utf16Length;return this.utf8OffsetToUtf16[Y]}return Y}convertUtf16OffsetToUtf8(Y){if(this.utf16OffsetToUtf8){if(Y<0)return 0;if(Y>this.utf16Length)return this.utf8Length;return this.utf16OffsetToUtf8[Y]}return Y}dispose(){if(this.ptr===Z._sharedPtr)Z._sharedPtrInUse=!1;else this._onigBinding.ofree(this.ptr)}};OZ(fY,"LAST_ID",0);OZ(fY,"_sharedPtr",0);OZ(fY,"_sharedPtrInUse",!1);var HJ=fY;class GJ{constructor(Z){if(OZ(this,"_onigBinding"),OZ(this,"_ptr"),!NZ)throw new bY("Must invoke loadWasm first.");let Y=[],X=[];for(let K=0,U=Z.length;K<U;K++){let W=new TY(Z[K]);Y[K]=W.createString(NZ),X[K]=W.utf8Length}let J=NZ.omalloc(4*Z.length);NZ.HEAPU32.set(Y,J/4);let Q=NZ.omalloc(4*Z.length);NZ.HEAPU32.set(X,Q/4);let $=NZ.createOnigScanner(J,Q,Z.length);for(let K=0,U=Z.length;K<U;K++)NZ.ofree(Y[K]);if(NZ.ofree(Q),NZ.ofree(J),$===0)UW(NZ);this._onigBinding=NZ,this._ptr=$}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(Z,Y,X){let J=0;if(typeof X==="number")J=X;if(typeof Z==="string"){Z=new HJ(Z);let Q=this._findNextMatchSync(Z,Y,!1,J);return Z.dispose(),Q}return this._findNextMatchSync(Z,Y,!1,J)}_findNextMatchSync(Z,Y,X,J){let Q=this._onigBinding,$=Q.findNextOnigScannerMatch(this._ptr,Z.id,Z.ptr,Z.utf8Length,Z.convertUtf16OffsetToUtf8(Y),J);if($===0)return null;let K=Q.HEAPU32,U=$/4,W=K[U++],z=K[U++],H=[];for(let G=0;G<z;G++){let F=Z.convertUtf8OffsetToUtf16(K[U++]),M=Z.convertUtf8OffsetToUtf16(K[U++]);H[G]={start:F,end:M,length:M-F}}return{index:W,captureIndices:H}}}function zW(Z){return typeof Z.instantiator==="function"}function HW(Z){return typeof Z.default==="function"}function GW(Z){return typeof Z.data<"u"}function OW(Z){return typeof Response<"u"&&Z instanceof Response}function qW(Z){return typeof ArrayBuffer<"u"&&(Z instanceof ArrayBuffer||ArrayBuffer.isView(Z))||typeof Buffer<"u"&&Buffer.isBuffer?.(Z)||typeof SharedArrayBuffer<"u"&&Z instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&Z instanceof Uint32Array}var EY;function FW(Z){if(EY)return EY;async function Y(){NZ=await $W(async(X)=>{let J=Z;if(J=await J,typeof J==="function")J=await J(X);if(typeof J==="function")J=await J(X);if(zW(J))J=await J.instantiator(X);else if(HW(J))J=await J.default(X);else{if(GW(J))J=J.data;if(OW(J))if(typeof WebAssembly.instantiateStreaming==="function")J=await MW(J)(X);else J=await NW(J)(X);else if(qW(J))J=await rX(J)(X);else if(J instanceof WebAssembly.Module)J=await rX(J)(X);else if("default"in J&&J.default instanceof WebAssembly.Module)J=await rX(J.default)(X)}if("instance"in J)J=J.instance;if("exports"in J)J=J.exports;return J})}return EY=Y(),EY}function rX(Z){return(Y)=>WebAssembly.instantiate(Z,Y)}function MW(Z){return(Y)=>WebAssembly.instantiateStreaming(Z,Y)}function NW(Z){return async(Y)=>{let X=await Z.arrayBuffer();return WebAssembly.instantiate(X,Y)}}async function OJ(Z){if(Z)await FW(Z);return{createScanner(Y){return new GJ(Y.map((X)=>typeof X==="string"?X:X.source))},createString(Y){return new HJ(Y)}}}var qJ=$J({langs:UJ,themes:zJ,engine:()=>OJ(import("./chunk-v3t7hcht.js"))}),{codeToHtml:_W,codeToHast:AW,codeToTokens:oX,codeToTokensBase:wW,codeToTokensWithThemes:BW,getSingletonHighlighter:LW,getLastGrammarState:PW}=KJ(qJ,{guessEmbeddedLanguages:a6});var CZ={h1:{bold:!0,marginBottom:1,color:"#f74cc7ff"},h2:{bold:!0,marginBottom:1,color:"#326cfcff"},h3:{bold:!0,color:"#24ffedff"},h4:{bold:!0,color:"#e29418ff"},h5:{bold:!0,color:"#9fc214ff"},h6:{bold:!0,dimColor:!0,color:"#88eb2bff"},paragraph:{},blockquote:{paddingLeft:1,dimColor:!0,borderTop:!1,borderBottom:!1,borderRight:!1,borderStyle:"single",borderDimColor:!0},code:{marginTop:1},codespan:{dimColor:!0},list:{},listItem:{bullet:"●",paddingLeft:2},hr:{char:"─",width:40,dimColor:!0},link:{color:"#343afcff",underline:!0},strong:{bold:!0},em:{italic:!0},del:{strikethrough:!0,dimColor:!0},image:{color:"blue"},table:{},tableCell:{paddingRight:2}},CW=["color","backgroundColor","dimColor","bold","italic","underline","strikethrough","inverse","wrap"],IW=["paddingLeft","paddingRight","paddingTop","paddingBottom","padding","paddingX","paddingY","marginLeft","marginRight","marginTop","marginBottom","margin","marginX","marginY","borderStyle","borderColor","borderTop","borderBottom","borderLeft","borderRight","borderDimColor","borderTopColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopDimColor","borderBottomDimColor","borderLeftDimColor","borderRightDimColor"];async function vW(Z,Y,X="github-dark"){try{let J=await oX(Z,{lang:Y||"text",theme:X}),Q=[],$=0;for(let K=0;K<J.tokens.length;K++){let U=J.tokens[K];if(U){for(let W of U){let z=W.color||void 0;Q.push(E.jsx(O,{color:z,children:W.content},`token-${$}`)),$++}if(K<J.tokens.length-1)Q.push(E.jsx(O,{children:`
143
+ `},`nl-${K}`))}}return Q}catch{return null}}function LZ(Z){if(!Z)return{};let Y={};for(let X of CW)if(X in Z)Y[X]=Z[X];return Y}function tZ(Z){if(!Z)return{};let Y={};for(let X of IW)if(X in Z)Y[X]=Z[X];return Y}function IZ(Z,Y){if(!Z&&!Y)return{};if(!Z)return Y;if(!Y)return Z;return{...Z,...Y}}function DW({code:Z,language:Y,style:X,theme:J}){let[Q,$]=pZ.useState(null),[K,U]=pZ.useState(!0);if(pZ.useEffect(()=>{let W=!1;async function z(){try{let H=await vW(Z,Y,J);if(!W)$(H),U(!1)}catch{if(!W)$(null),U(!1)}}return z(),()=>{W=!0}},[Z,Y,J]),K||!Q)return E.jsx(_,{...tZ(X),children:E.jsx(O,{...LZ(X),children:Z})});return E.jsx(_,{paddingX:2,paddingY:1,...tZ(X),children:E.jsx(O,{...LZ(X),children:Q})})}function jZ(Z,Y,X){if(!Z||Z.length===0)return null;return Z.map((J,Q)=>{let $=`inline-${Q}`;switch(J.type){case"text":case"escape":{let K=J;if("tokens"in K&&K.tokens)return E.jsx(O,{children:jZ(K.tokens,Y,X)},$);return E.jsx(O,{children:K.text},$)}case"strong":{let K=J,U=IZ(CZ.strong,Y.strong);if(X.strong)return E.jsx(O,{children:X.strong(jZ(K.tokens,Y,X),K)},$);return E.jsx(O,{...LZ(U),children:jZ(K.tokens,Y,X)},$)}case"em":{let K=J,U=IZ(CZ.em,Y.em);if(X.em)return E.jsx(O,{children:X.em(jZ(K.tokens,Y,X),K)},$);return E.jsx(O,{...LZ(U),children:jZ(K.tokens,Y,X)},$)}case"del":{let K=J,U=IZ(CZ.del,Y.del);if(X.del)return E.jsx(O,{children:X.del(jZ(K.tokens,Y,X),K)},$);return E.jsx(O,{...LZ(U),children:jZ(K.tokens,Y,X)},$)}case"codespan":{let K=J,U=IZ(CZ.codespan,Y.codespan);if(X.codespan)return E.jsx(O,{children:X.codespan(K.text,K)},$);return E.jsx(O,{...LZ(U),children:K.text},$)}case"link":{let K=J,U=IZ(CZ.link,Y.link);if(X.link)return E.jsx(O,{children:X.link(K.text,K.href,K.title,K)},$);return E.jsxs(O,{...LZ(U),children:[K.text,K.href&&` (${K.href})`]},$)}case"image":{let K=J,U=IZ(CZ.image,Y.image);if(X.image)return E.jsx(O,{children:X.image(K.text,K.href,K.title,K)},$);return E.jsxs(O,{...LZ(U),children:["[Image: ",K.text||K.href,"]"]},$)}case"br":return E.jsx(O,{children:`
144
+ `},$);default:if("text"in J)return E.jsx(O,{children:J.text},$);return null}})}function nX(Z,Y,X,J,Q,$="github-dark"){switch(Z.type){case"heading":{let K=Z,U=`h${K.depth}`,W=`h${K.depth}`,z=X[U];if(z)return z(K.text,K);let H=IZ(CZ[W],Y[W]),G=typeof H.showSharp=="boolean"?H.showSharp:Boolean(J);return E.jsx(_,{...tZ(H),children:E.jsxs(O,{...LZ(H),children:[G&&`${"#".repeat(K.depth)} `,jZ(K.tokens,Y,X)]})})}case"paragraph":{let K=Z,U=IZ(CZ.paragraph,Y.paragraph),W=jZ(K.tokens,Y,X);if(X.paragraph)return X.paragraph(W,K);return E.jsx(_,{...tZ(U),children:E.jsx(O,{...LZ(U),children:W})})}case"code":{let K=Z,U=IZ(CZ.code,Y.code);if(X.code)return X.code(K.text,K.lang,K);if(Q)return E.jsx(DW,{code:K.text,language:K.lang,style:U,theme:$});return E.jsx(_,{...tZ(U),children:E.jsx(O,{...LZ(U),children:K.text})})}case"blockquote":{let K=Z,U=IZ(CZ.blockquote,Y.blockquote),W=K.tokens.map((z,H)=>E.jsx(_,{children:nX(z,Y,X,J,Q,$)},`bq-${H}`));if(X.blockquote)return X.blockquote(W,K);return E.jsx(_,{...tZ(U),children:E.jsx(_,{flexDirection:"column",children:K.tokens.map((z,H)=>{if(nX(z,Y,X,J,Q,$))return E.jsx(O,{...LZ(U),children:z.type==="paragraph"?jZ(z.tokens,Y,X):z.text||""},`bq-text-${H}`);return null})})})}case"list":{let K=Z,U=IZ(CZ.list,Y.list),W=IZ(CZ.listItem,Y.listItem),z=W.bullet||"●",H=K.items.map((G,F)=>{let M=typeof K.start=="number"?K.start:1,N=K.ordered?`${M+F}. `:`${z} `,w=jZ(G.tokens,Y,X);if(X.listItem)return E.jsx(_,{...tZ(W),children:X.listItem(w,G)},`li-${F}`);return E.jsx(_,{...tZ(W),children:E.jsxs(O,{...LZ(W),children:[N,w]})},`li-${F}`)});if(X.list)return X.list(H,K.ordered,K);return E.jsx(_,{flexDirection:"column",...tZ(U),children:H})}case"hr":{let K=Z,U=IZ(CZ.hr,Y.hr),W=U.char||"─",z=U.width||40;if(X.hr)return X.hr(K);return E.jsx(_,{...tZ(U),children:E.jsx(O,{...LZ(U),children:W.repeat(z)})})}case"table":{let K=Z,U=IZ(CZ.table,Y.table),W=IZ(CZ.tableCell,Y.tableCell),z=(B)=>B.map((C)=>{if("text"in C)return C.text;return""}).join(""),H=K.header.map((B,C)=>{let R=z(B.tokens).length,D=Math.max(...K.rows.map((f)=>{let V=f[C]?.tokens;return V?z(V).length:0}),0);return Math.max(R,D,3)}),G=E.jsxs(O,{dimColor:!0,children:["┌─",H.map((B)=>"─".repeat(B)).join("─┬─"),"─┐"]}),F=E.jsxs(O,{children:[E.jsx(O,{dimColor:!0,children:"│ "}),K.header.map((B,C)=>{let R=jZ(B.tokens,Y,X),D=z(B.tokens);return E.jsxs(O,{children:[E.jsxs(O,{bold:!0,...LZ(W),children:[R," ".repeat(Math.max(0,(H[C]||3)-D.length))]}),E.jsxs(O,{dimColor:!0,children:[" │",C<K.header.length-1?" ":""]})]},`th-${C}`)})]}),M=E.jsxs(O,{dimColor:!0,children:["├─",H.map((B)=>"─".repeat(B)).join("─┼─"),"─┤"]}),N=K.rows.map((B,C)=>E.jsxs(O,{children:[E.jsx(O,{dimColor:!0,children:"│ "}),B.map((R,D)=>{let f=jZ(R.tokens,Y,X),V=z(R.tokens),d=H[D]||3;return E.jsxs(O,{children:[E.jsxs(O,{...LZ(W),children:[f," ".repeat(Math.max(0,d-V.length))]}),E.jsxs(O,{dimColor:!0,children:[" │",D<B.length-1?" ":""]})]},`td-${C}-${D}`)})]},`tr-${C}`)),w=E.jsxs(O,{dimColor:!0,children:["└─",H.map((B)=>"─".repeat(B)).join("─┴─"),"─┘"]}),L=E.jsxs(E.Fragment,{children:[G,F,M,N,w]});if(X.table)return X.table(F,N,K);return E.jsx(_,{flexDirection:"column",...tZ(U),children:L})}case"space":return E.jsx(O,{children:`
145
+ `});case"html":return E.jsx(O,{dimColor:!0,children:Z.text});default:if("text"in Z)return E.jsx(O,{children:Z.text});return null}}var FJ=pZ.memo(function({token:Z,styles:Y,renderers:X,showSharp:J,highlight:Q,theme:$}){return E.jsx(E.Fragment,{children:nX(Z,Y,X,J,Q,$)})},(Z,Y)=>Z.token===Y.token);FJ.displayName="MemoizedBlock";function VW({children:Z,id:Y,styles:X={},renderers:J={},showSharp:Q=!1,highlight:$=!0,theme:K="github-dark"}){let U=pZ.useId(),W=Y||U,z=pZ.useMemo(()=>c.lexer(Z,{silent:!0,gfm:!0}),[Z]);return E.jsx(_,{flexDirection:"column",children:z.map((H,G)=>E.jsx(FJ,{token:H,styles:X,renderers:J,showSharp:Q,highlight:$,theme:K},`${W}-block-${G}`))})}var MJ=pZ.memo(VW);MJ.displayName="Markdown";var EW=MJ,NJ=EW;var _J=P(g(),1);var h0=P(I(),1),AJ=({children:Z,color:Y,dim:X,bold:J,italic:Q})=>{let $=_J.useMemo(()=>{return Z.split(`
152
146
  `).map((K)=>K===""?`
153
- `:K)},[Z]);return x0.jsxDEV(x0.Fragment,{children:$.map((K,W)=>x0.jsxDEV(O,{color:Y,dimColor:X,bold:J,italic:Q,children:K},W,!1,void 0,this))},void 0,!1,void 0,this)};var fY=L(x(),1),nX=L(v(),1),bW=(Z,Y,X=5)=>{if(!Y||!Z||Z.trim()==="")return Z;let J=Z.split(`
147
+ `:K)},[Z]);return h0.jsxDEV(h0.Fragment,{children:$.map((K,U)=>h0.jsxDEV(O,{color:Y,dimColor:X,bold:J,italic:Q,children:K},U,!1,void 0,this))},void 0,!1,void 0,this)};var jY=P(g(),1),aX=P(I(),1),bW=(Z,Y,X=5)=>{if(!Y||!Z||Z.trim()==="")return Z;let J=Z.split(`
154
148
  `);if(J.length<=X)return Z;let Q=J.length-X,$=J.slice(-X);return`\x1B[33m${Q} rows hidden...\x1B[0m
155
149
  ${$.join(`
156
- `)}`},TW=({children:Z,simple:Y,loading:X,maxRows:J=5})=>{let Q=fY.useMemo(()=>{return bW(Z,X,J)},[Z,X,J]);if(Y)return nX.jsxDEV(BJ,{children:Q},void 0,!1,void 0,this);return nX.jsxDEV(wJ,{children:Q},void 0,!1,void 0,this)},LJ=fY.memo(TW);var kZ=L(v(),1),fW=({message:Z,messageNumber:Y,loading:X})=>{let Q=h8(Z),$=Q0(Z);if(!$)return kZ.jsxDEV(kZ.Fragment,{},void 0,!1,void 0,this);return kZ.jsxDEV(N,{flexDirection:"column",children:[kZ.jsxDEV(N,{paddingBottom:0,marginBottom:1,children:kZ.jsxDEV(O,{color:bZ("teal"),children:[Y," ","Zen Code"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Q&&kZ.jsxDEV(jW,{thinking:Q,visible:$.trim().length===0},void 0,!1,void 0,this),kZ.jsxDEV(LJ,{simple:!1,loading:X,children:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},jW=({thinking:Z,visible:Y})=>{let X=Z.split(`
157
- `);return kZ.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[kZ.jsxDEV(N,{paddingBottom:0,children:kZ.jsxDEV(O,{color:"gray",bold:!0,children:["Think ",X.length," rows"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Y&&kZ.jsxDEV(PJ,{content:Z,maxLines:3},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},jY=fW;var f=L(v(),1),RJ=["yellow","magenta","blue"],SW=(Z)=>{let Y=0;for(let J=0;J<Z.length;J++)Y=Z.charCodeAt(J)+((Y<<5)-Y);let X=Math.abs(Y%RJ.length);return RJ[X]},yW=(Z)=>{return{success:"✓",completed:"✓",ok:"✓",error:"✗",failed:"✗",pending:"⏳",in_progress:"⏳",running:"⏳",cancelled:"⏹"}[Z]||"⏳"},kW=(Z,Y=4,X=100)=>{let J=Z.split(`
158
- `),Q=(W)=>{if(W.length<=X)return W;return W.substring(0,X)+`... (${W.length-X} more chars)`};if(J.length<=Y)return J.map(Q).join(`
150
+ `)}`},TW=({children:Z,simple:Y,loading:X,maxRows:J=5})=>{let Q=jY.useMemo(()=>{return bW(Z,X,J)},[Z,X,J]);if(Y)return aX.jsxDEV(AJ,{children:Q},void 0,!1,void 0,this);return aX.jsxDEV(NJ,{children:Q},void 0,!1,void 0,this)},wJ=jY.memo(TW);var SZ=P(I(),1),fW=({message:Z,messageNumber:Y,loading:X})=>{let Q=h8(Z),$=J0(Z);if(!$)return SZ.jsxDEV(SZ.Fragment,{},void 0,!1,void 0,this);return SZ.jsxDEV(_,{flexDirection:"column",children:[SZ.jsxDEV(_,{paddingBottom:0,marginBottom:1,children:SZ.jsxDEV(O,{color:c4("teal"),children:[Y," ","Zen Code"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Q&&SZ.jsxDEV(jW,{thinking:Q,visible:$.trim().length===0},void 0,!1,void 0,this),SZ.jsxDEV(wJ,{simple:!1,loading:X,children:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},jW=({thinking:Z,visible:Y})=>{let X=Z.split(`
151
+ `);return SZ.jsxDEV(_,{flexDirection:"column",marginBottom:1,children:[SZ.jsxDEV(_,{paddingBottom:0,children:SZ.jsxDEV(O,{color:"gray",bold:!0,children:["Think ",X.length," rows"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Y&&SZ.jsxDEV(BJ,{content:Z,maxLines:3},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},SY=fW;var j=P(I(),1),LJ=["yellow","magenta","blue"],SW=(Z)=>{let Y=0;for(let J=0;J<Z.length;J++)Y=Z.charCodeAt(J)+((Y<<5)-Y);let X=Math.abs(Y%LJ.length);return LJ[X]},yW=(Z)=>{return{success:"✓",completed:"✓",ok:"✓",error:"✗",failed:"✗",pending:"⏳",in_progress:"⏳",running:"⏳",cancelled:"⏹"}[Z]||"⏳"},kW=(Z,Y=4,X=100)=>{let J=Z.split(`
152
+ `),Q=(U)=>{if(U.length<=X)return U;return U.substring(0,X)+`... (${U.length-X} more chars)`};if(J.length<=Y)return J.map(Q).join(`
159
153
  `);let $=J.slice(0,2).map(Q),K=J.slice(J.length-3).map(Q);return[...$,`... and more ${J.length-5} lines`,...K].join(`
160
- `)},hW=({content:Z})=>{let Y=(X,J=0,Q=0)=>{let K=" ".repeat(J);if(Q>=3)return f.jsxDEV(O,{dimColor:!0,children:"{...} (truncated)"},void 0,!1,void 0,this);if(X===null)return f.jsxDEV(O,{color:"gray",children:"null"},void 0,!1,void 0,this);if(typeof X!=="object"){let z=JSON.stringify(X);if(typeof X==="string"&&z.length>102){let H=z.substring(1,101);return f.jsxDEV(O,{children:[f.jsxDEV(O,{color:"cyan",children:['"',H,'..."']},void 0,!0,void 0,this)," ",f.jsxDEV(O,{dimColor:!0,children:["(truncated, ",z.length-2," chars)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}if(typeof X==="string")return f.jsxDEV(O,{color:"cyan",children:z},void 0,!1,void 0,this);else if(typeof X==="number")return f.jsxDEV(O,{color:"yellow",children:X},void 0,!1,void 0,this);else if(typeof X==="boolean")return f.jsxDEV(O,{color:"magenta",children:X.toString()},void 0,!1,void 0,this);else return f.jsxDEV(O,{children:z},void 0,!1,void 0,this)}if(Array.isArray(X)){if(X.length===0)return f.jsxDEV(O,{color:"gray",children:"[]"},void 0,!1,void 0,this);let z=5;return f.jsxDEV(f.Fragment,{children:[`
161
- `,X.slice(0,z).map((H,G)=>f.jsxDEV(O,{children:[f.jsxDEV(O,{children:K},void 0,!1,void 0,this),f.jsxDEV(O,{color:"green",children:"- "},void 0,!1,void 0,this)," ",Y(H,J+1,Q+1),G<Math.min(X.length,z)-1?`
162
- `:""]},void 0,!0,void 0,this)),X.length>z&&f.jsxDEV(O,{children:[`
163
- `,f.jsxDEV(O,{children:K},void 0,!1,void 0,this),f.jsxDEV(O,{dimColor:!0,children:["... (",X.length-z," more)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}let W=Object.keys(X);if(W.length===0)return f.jsxDEV(O,{color:"gray"},void 0,!1,void 0,this);let U=5;return f.jsxDEV(f.Fragment,{children:[W.slice(0,U).map((z,H)=>f.jsxDEV(O,{children:[f.jsxDEV(O,{children:K},void 0,!1,void 0,this),f.jsxDEV(O,{color:"blue",children:z},void 0,!1,void 0,this)," ",f.jsxDEV(O,{color:"gray",children:": "},void 0,!1,void 0,this)," ",Y(X[z],J+1,Q+1),H<Math.min(W.length,U)-1?`
164
- `:""]},void 0,!0,void 0,this)),W.length>U&&f.jsxDEV(O,{children:[`
165
- `,f.jsxDEV(O,{children:K},void 0,!1,void 0,this),f.jsxDEV(O,{dimColor:!0,children:["... (",W.length-U," more)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};return f.jsxDEV(O,{children:Y(Z)},void 0,!1,void 0,this)},xW=({message:Z,messageNumber:Y})=>{let{getToolUIRender:X,client:J}=WZ(),Q=new tY(Z,J),$=Q.getInputRepaired(),K=$?.title?`: ${$.title}`:$?.description?`: ${$.description}`:"",W=Z.name?X(Z.name):null,U=SW(Z.name||"");return U=Z.status==="error"?"red":"yellow",f.jsxDEV(n,{children:f.jsxDEV(N,{flexDirection:"column",children:[f.jsxDEV(N,{children:[f.jsxDEV(O,{color:U,children:[Y," ",Z.name,f.jsxDEV(O,{color:"gray",children:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f.jsxDEV(O,{children:[" ",yW(Z?.status)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W?f.jsxDEV(N,{children:[f.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),f.jsxDEV(N,{flexDirection:"column",children:W(Z)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):f.jsxDEV(N,{flexDirection:"column",paddingTop:0,children:[f.jsxDEV(N,{children:[f.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),f.jsxDEV(hW,{content:Q.getInputRepaired()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f.jsxDEV(N,{paddingTop:0,paddingBottom:0,children:[f.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),f.jsxDEV(O,{dimColor:!0,italic:!0,children:kW(CJ(Z.content))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z.sub_messages?.length?f.jsxDEV(N,{children:[f.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),f.jsxDEV(O,{color:U,dimColor:!0,children:["(hidden ",Z.sub_messages.length," subagent messages)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},vJ=xW;var S4=L(v(),1),IJ=yY.memo(function({renderMessages:Y,startIndex:X,staticKey:J,loading:Q}){let[$,K]=yY.useState(!1);jZ(()=>K(!0),$?null:0);let W=(G,F,M,_)=>S4.jsxDEV(N,{flexDirection:"column",borderStyle:M?"double":"single",borderLeft:!0,paddingLeft:1,paddingBottom:1,borderBottom:!1,borderTop:!1,borderRight:!1,borderLeftColor:G.type==="ai"?bZ("teal"):G.type==="human"?bZ("amber"):"yellow",children:G.type==="human"?S4.jsxDEV(t0,{content:G.content,messageNumber:F+1+X},void 0,!1,void 0,this):G.type==="tool"?S4.jsxDEV(vJ,{message:G,messageNumber:F+1+X},void 0,!1,void 0,this):S4.jsxDEV(jY,{message:G,messageNumber:F+1+X,loading:Q},void 0,!1,void 0,this)},G.id?`${_}-${G.id}`:`${_}-msg-${F}`,!1,void 0,this),U=Y.findIndex((G)=>{if(G.type==="tool"&&!G.done&&!["success","error"].includes(G.status))return!0;return!1});if(U===-1)U=Y.length-1;let z=Y.slice(0,U),H=Y.slice(U);if(!$)return S4.jsxDEV(N,{flexDirection:"column",children:Y.map((G,F)=>W(G,F,F===U,"init"))},void 0,!1,void 0,this);return S4.jsxDEV(N,{flexDirection:"column",children:[S4.jsxDEV(SY,{items:z,children:(G,F)=>W(G,F,!1,"hist")},J,!1,void 0,this),H.map((G,F)=>W(G,z.length+F,!0,"curr"))]},void 0,!0,void 0,this)});var y4=L(x(),1);var F0=L(x(),1);var kY=L(v(),1),gW=({staticKey:Z,children:Y,delay:X=1})=>{let[J,Q]=F0.useState(!0),$=F0.useRef(!0);return F0.useEffect(()=>{Q(!1),$.current=!0},[Z]),jZ(()=>{if($.current)console.clear(),Q(!0),$.current=!1},J?null:X),kY.jsxDEV(kY.Fragment,{children:J?Y():null},void 0,!1,void 0,this)},DJ=gW;var $Z=L(v(),1),uW=y4.memo(function({toolGroup:Y,groupId:X,getToolUIRender:J,depth:Q=0,loading:$}){if(Q>1)return null;return $Z.jsxDEV(N,{flexDirection:"column",children:Y.map((K,W)=>{let U=K.name?J(K.name):null;if(!U)return null;let z=K.sub_messages?.length||0,H=K.sub_messages?.slice(-4)||[],G=z-H.length;return $Z.jsxDEV(y4.Fragment,{children:[U(K),H.length?$Z.jsxDEV($Z.Fragment,{children:[G>0&&$Z.jsxDEV(N,{paddingLeft:2,children:$Z.jsxDEV(O,{dimColor:!0,children:["... ",G," more submessage",G>1?"s":""]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$Z.jsxDEV(aX,{renderMessages:H,startIndex:1,depth:Q+1,staticKey:`sub-d${Q}-i${W}`,getToolUIRender:J,loading:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},`${X}-${W}-${K.status}`,!0,void 0,this)})},void 0,!1,void 0,this)}),VJ=y4.memo(function({message:Y,displayIndex:X,isCurrent:J,startIndex:Q=0,getToolUIRender:$,depth:K=0,loading:W}){return $Z.jsxDEV(N,{flexDirection:"column",borderStyle:J?"double":"single",paddingBottom:1,borderLeft:!1,borderBottom:!1,borderTop:Y.type==="group"?!1:!0,borderRight:!1,borderTopColor:Y.type==="ai"?bZ("teal"):Y.type==="human"?bZ("amber"):bZ("rose"),children:[Y.type==="human"?$Z.jsxDEV(t0,{content:Y.content,messageNumber:X+1+Q},void 0,!1,void 0,this):null,Y.type==="ai"?$Z.jsxDEV(jY,{message:Y,messageNumber:X+1+Q,loading:W},void 0,!1,void 0,this):null,Y.type==="group"&&$Z.jsxDEV($Z.Fragment,{children:$Z.jsxDEV(uW,{toolGroup:Y.toolGroup,groupId:Y.id,getToolUIRender:$,depth:K,loading:W},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}),EJ=(Z)=>{if(Z.type!=="ai")return!0;try{let Y=Q0(Z);return!!(Y&&Y.trim().length>0)}catch{return!1}},aX=y4.memo(function({renderMessages:Y,startIndex:X,staticKey:J,depth:Q=0,getToolUIRender:$,loading:K}){let W=y4.useMemo(()=>{let G=0;return Y.filter((F)=>{if(F.type==="ai")return EJ(F);return!0}).reduce((F,M)=>{if(M.type==="tool"){let _=F[F.length-1];if(_&&_.type==="group"&&_.toolGroup.length<5)_.toolGroup.push(M);else F.push({id:`tool-group-${G++}`,type:"group",toolGroup:[M]})}else F.push(M);return F},[])},[Y,EJ]),U=W.length-1;if(U===-1)U=W.length-1;if(!K)U=W.length;let z=W.slice(0,U),H=W.slice(U);return $Z.jsxDEV(N,{flexDirection:"column",children:[$Z.jsxDEV(DJ,{staticKey:`${J} ${z.length}`,children:()=>$Z.jsxDEV(SY,{items:z,children:(G,F)=>$Z.jsxDEV(VJ,{message:G,displayIndex:F,isCurrent:!1,startIndex:X,getToolUIRender:$,depth:Q,loading:K},G.id?`hist-${G.id}`:`hist-msg-${Q}-${F}`,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.map((G,F)=>$Z.jsxDEV(VJ,{message:G,displayIndex:z.length+F,isCurrent:!0,startIndex:X,getToolUIRender:$,depth:Q,loading:K},G.id?`curr-${G.id}`:`curr-msg-${Q}-${z.length}-${F}`,!1,void 0,this))]},void 0,!0,void 0,this)});var T=L(v(),1),mW=()=>{let Z=s0(),Y=new Date().toLocaleDateString(),{extraParams:X,AVAILABLE_MODELS:J,config:Q}=UZ(),$=X.mcp_config||{},K=Object.keys($).length,W=bJ(),U=process.platform,z=U==="darwin"?"macOS":U==="win32"?"Windows":"Linux",H=process.cwd(),G=Q?.provider_id||process.env.MODEL_PROVIDER||"openai",M=!!Q?.providers?.find((P)=>P.id===G)?.apiKey,_=J.length>0,A=M&&_;return T.jsxDEV(N,{flexDirection:"column",borderStyle:"round",borderColor:"cyan",paddingX:1,marginBottom:1,children:[T.jsxDEV(N,{flexDirection:"row",justifyContent:"space-between",borderBottom:!1,children:[T.jsxDEV(O,{color:"cyan",bold:!0,children:"ZEN CODE"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"gray",children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{flexDirection:"row",marginTop:1,gap:2,children:[T.jsxDEV(N,{flexDirection:"column",children:T.jsxDEV(O,{color:"cyan",children:`███████╗███████╗███╗ ██╗
154
+ `)},hW=({content:Z})=>{let Y=(X,J=0,Q=0)=>{let K=" ".repeat(J);if(Q>=3)return j.jsxDEV(O,{dimColor:!0,children:"{...} (truncated)"},void 0,!1,void 0,this);if(X===null)return j.jsxDEV(O,{color:"gray",children:"null"},void 0,!1,void 0,this);if(typeof X!=="object"){let z=JSON.stringify(X);if(typeof X==="string"&&z.length>102){let H=z.substring(1,101);return j.jsxDEV(O,{children:[j.jsxDEV(O,{color:"cyan",children:['"',H,'..."']},void 0,!0,void 0,this)," ",j.jsxDEV(O,{dimColor:!0,children:["(truncated, ",z.length-2," chars)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}if(typeof X==="string")return j.jsxDEV(O,{color:"cyan",children:z},void 0,!1,void 0,this);else if(typeof X==="number")return j.jsxDEV(O,{color:"yellow",children:X},void 0,!1,void 0,this);else if(typeof X==="boolean")return j.jsxDEV(O,{color:"magenta",children:X.toString()},void 0,!1,void 0,this);else return j.jsxDEV(O,{children:z},void 0,!1,void 0,this)}if(Array.isArray(X)){if(X.length===0)return j.jsxDEV(O,{color:"gray",children:"[]"},void 0,!1,void 0,this);let z=5;return j.jsxDEV(j.Fragment,{children:[`
155
+ `,X.slice(0,z).map((H,G)=>j.jsxDEV(O,{children:[j.jsxDEV(O,{children:K},void 0,!1,void 0,this),j.jsxDEV(O,{color:"green",children:"- "},void 0,!1,void 0,this)," ",Y(H,J+1,Q+1),G<Math.min(X.length,z)-1?`
156
+ `:""]},void 0,!0,void 0,this)),X.length>z&&j.jsxDEV(O,{children:[`
157
+ `,j.jsxDEV(O,{children:K},void 0,!1,void 0,this),j.jsxDEV(O,{dimColor:!0,children:["... (",X.length-z," more)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}let U=Object.keys(X);if(U.length===0)return j.jsxDEV(O,{color:"gray"},void 0,!1,void 0,this);let W=5;return j.jsxDEV(j.Fragment,{children:[U.slice(0,W).map((z,H)=>j.jsxDEV(O,{children:[j.jsxDEV(O,{children:K},void 0,!1,void 0,this),j.jsxDEV(O,{color:"blue",children:z},void 0,!1,void 0,this)," ",j.jsxDEV(O,{color:"gray",children:": "},void 0,!1,void 0,this)," ",Y(X[z],J+1,Q+1),H<Math.min(U.length,W)-1?`
158
+ `:""]},void 0,!0,void 0,this)),U.length>W&&j.jsxDEV(O,{children:[`
159
+ `,j.jsxDEV(O,{children:K},void 0,!1,void 0,this),j.jsxDEV(O,{dimColor:!0,children:["... (",U.length-W," more)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};return j.jsxDEV(O,{children:Y(Z)},void 0,!1,void 0,this)},xW=({message:Z,messageNumber:Y})=>{let{getToolUIRender:X,client:J}=WZ(),Q=new eY(Z,J),$=Q.getInputRepaired(),K=$?.title?`: ${$.title}`:$?.description?`: ${$.description}`:"",U=Z.name?X(Z.name):null,W=SW(Z.name||"");return W=Z.status==="error"?"red":"yellow",j.jsxDEV(r,{children:j.jsxDEV(_,{flexDirection:"column",children:[j.jsxDEV(_,{children:[j.jsxDEV(O,{color:W,children:[Y," ",Z.name,j.jsxDEV(O,{color:"gray",children:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j.jsxDEV(O,{children:[" ",yW(Z?.status)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),U?j.jsxDEV(_,{children:[j.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),j.jsxDEV(_,{flexDirection:"column",children:U(Z)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):j.jsxDEV(_,{flexDirection:"column",paddingTop:0,children:[j.jsxDEV(_,{children:[j.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),j.jsxDEV(hW,{content:Q.getInputRepaired()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j.jsxDEV(_,{paddingTop:0,paddingBottom:0,children:[j.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),j.jsxDEV(O,{dimColor:!0,italic:!0,children:kW(PJ(Z.content))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z.sub_messages?.length?j.jsxDEV(_,{children:[j.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),j.jsxDEV(O,{color:W,dimColor:!0,children:["(hidden ",Z.sub_messages.length," subagent messages)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},RJ=xW;var f4=P(I(),1),CJ=kY.memo(function({renderMessages:Y,startIndex:X,staticKey:J,loading:Q}){let[$,K]=kY.useState(!1);TZ(()=>K(!0),$?null:0);let U=(G,F,M,N)=>f4.jsxDEV(_,{flexDirection:"column",paddingLeft:1,paddingBottom:1,children:G.type==="human"?f4.jsxDEV(e0,{content:G.content,messageNumber:F+1+X},void 0,!1,void 0,this):G.type==="tool"?f4.jsxDEV(RJ,{message:G,messageNumber:F+1+X},void 0,!1,void 0,this):f4.jsxDEV(SY,{message:G,messageNumber:F+1+X,loading:Q},void 0,!1,void 0,this)},G.id?`${N}-${G.id}`:`${N}-msg-${F}`,!1,void 0,this),W=Y.findIndex((G)=>{if(G.type==="tool"&&!G.done&&!["success","error"].includes(G.status))return!0;return!1});if(W===-1)W=Y.length-1;let z=Y.slice(0,W),H=Y.slice(W);if(!$)return f4.jsxDEV(_,{flexDirection:"column",children:Y.map((G,F)=>U(G,F,F===W,"init"))},void 0,!1,void 0,this);return f4.jsxDEV(_,{flexDirection:"column",children:[f4.jsxDEV(yY,{items:z,children:(G,F)=>U(G,F,!1,"hist")},J,!1,void 0,this),H.map((G,F)=>U(G,z.length+F,!0,"curr"))]},void 0,!0,void 0,this)});var j4=P(g(),1);var q0=P(g(),1);var hY=P(I(),1),gW=({staticKey:Z,children:Y,delay:X=1})=>{let[J,Q]=q0.useState(!0),$=q0.useRef(!0);return q0.useEffect(()=>{Q(!1),$.current=!0},[Z]),TZ(()=>{if($.current)console.clear(),Q(!0),$.current=!1},J?null:X),hY.jsxDEV(hY.Fragment,{children:J?Y():null},void 0,!1,void 0,this)},IJ=gW;var JZ=P(I(),1),uW=j4.memo(function({toolGroup:Y,groupId:X,getToolUIRender:J,depth:Q=0,loading:$}){if(Q>1)return null;return JZ.jsxDEV(_,{flexDirection:"column",children:Y.map((K,U)=>{let W=K.name?J(K.name):null;if(!W)return null;let z=K.sub_messages?.length||0,H=K.sub_messages?.slice(-4)||[],G=z-H.length;return JZ.jsxDEV(j4.Fragment,{children:[JZ.jsxDEV(()=>{return JZ.jsxDEV(r,{fallback:K.name+" is error",children:W(K)},void 0,!1,void 0,this)},{},void 0,!1,void 0,this),H.length?JZ.jsxDEV(JZ.Fragment,{children:[G>0&&JZ.jsxDEV(_,{paddingLeft:2,children:JZ.jsxDEV(O,{dimColor:!0,children:["... ",G," more submessage",G>1?"s":""]},void 0,!0,void 0,this)},void 0,!1,void 0,this),JZ.jsxDEV(sX,{renderMessages:H,startIndex:1,depth:Q+1,staticKey:`sub-d${Q}-i${U}`,getToolUIRender:J,loading:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},`${X}-${U}-${K.status}`,!0,void 0,this)})},void 0,!1,void 0,this)}),vJ=j4.memo(function({message:Y,displayIndex:X,isCurrent:J,startIndex:Q=0,getToolUIRender:$,depth:K=0,loading:U}){return JZ.jsxDEV(_,{flexDirection:"column",paddingBottom:1,children:[Y.type==="human"?JZ.jsxDEV(e0,{content:Y.content,messageNumber:X+1+Q},void 0,!1,void 0,this):null,Y.type==="ai"?JZ.jsxDEV(SY,{message:Y,messageNumber:X+1+Q,loading:U},void 0,!1,void 0,this):null,Y.type==="group"&&JZ.jsxDEV(JZ.Fragment,{children:JZ.jsxDEV(uW,{toolGroup:Y.toolGroup,groupId:Y.id,getToolUIRender:$,depth:K,loading:U},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}),DJ=(Z)=>{if(Z.type!=="ai")return!0;try{let Y=J0(Z);return!!(Y&&Y.trim().length>0)}catch{return!1}},sX=j4.memo(function({renderMessages:Y,startIndex:X,staticKey:J,depth:Q=0,getToolUIRender:$,loading:K}){let U=j4.useMemo(()=>{let G=0;return Y.filter((F)=>{if(F.type==="ai")return DJ(F);return!0}).reduce((F,M)=>{if(M.type==="tool"){let N=F[F.length-1];if(N&&N.type==="group"&&N.toolGroup.length<5)N.toolGroup.push(M);else F.push({id:`tool-group-${G++}`,type:"group",toolGroup:[M]})}else F.push(M);return F},[])},[Y,DJ]),W=U.length-1;if(W===-1)W=U.length-1;if(!K)W=U.length;let z=U.slice(0,W),H=U.slice(W);return JZ.jsxDEV(_,{flexDirection:"column",children:[JZ.jsxDEV(IJ,{staticKey:`${J} ${z.length}`,children:()=>JZ.jsxDEV(yY,{items:z,children:(G,F)=>JZ.jsxDEV(vJ,{message:G,displayIndex:F,isCurrent:!1,startIndex:X,getToolUIRender:$,depth:Q,loading:K},G.id?`hist-${G.id}`:`hist-msg-${Q}-${F}`,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.map((G,F)=>JZ.jsxDEV(vJ,{message:G,displayIndex:z.length+F,isCurrent:!0,startIndex:X,getToolUIRender:$,depth:Q,loading:K},G.id?`curr-${G.id}`:`curr-msg-${Q}-${z.length}-${F}`,!1,void 0,this))]},void 0,!0,void 0,this)});var T=P(I(),1),mW=()=>{let Z=t0(),Y=new Date().toLocaleDateString(),{extraParams:X,AVAILABLE_MODELS:J,config:Q}=UZ(),$=X.mcp_config||{},K=Object.keys($).length,U=VJ(),W=process.platform,z=W==="darwin"?"macOS":W==="win32"?"Windows":"Linux",H=process.cwd(),G=Q?.provider_id||process.env.MODEL_PROVIDER||"openai",M=!!Q?.providers?.find((L)=>L.id===G)?.apiKey,N=J.length>0,w=M&&N;return T.jsxDEV(_,{flexDirection:"column",borderStyle:"round",borderColor:"cyan",paddingX:1,marginBottom:1,children:[T.jsxDEV(_,{flexDirection:"row",justifyContent:"space-between",borderBottom:!1,children:[T.jsxDEV(O,{color:"cyan",bold:!0,children:"ZEN CODE"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"gray",children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(_,{flexDirection:"row",marginTop:1,gap:2,children:[T.jsxDEV(_,{flexDirection:"column",children:T.jsxDEV(O,{color:"cyan",children:`███████╗███████╗███╗ ██╗
166
160
  ╚══███╔╝██╔════╝████╗ ██║
167
161
  ███╔╝ █████╗ ██╔██╗ ██║
168
162
  ███╔╝ ██╔══╝ ██║╚██╗██║
169
163
  ███████╗███████╗██║ ╚████║
170
- ╚══════╝╚══════╝╚═╝ ╚═══╝`},void 0,!1,void 0,this)},void 0,!1,void 0,this),T.jsxDEV(N,{flexDirection:"column",justifyContent:"center",flexGrow:1,children:[T.jsxDEV(N,{marginBottom:1,children:A?T.jsxDEV(O,{color:"green",bold:!0,children:[" ","[ SYSTEM ONLINE ]"]},void 0,!0,void 0,this):T.jsxDEV(O,{color:"red",bold:!0,children:[" ","[ CONFIG REQUIRED ]"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),T.jsxDEV(N,{flexDirection:"column",gap:0,children:[T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:"USER::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:"ARCH::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:process.arch},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:"PLATFORM::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:z},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:"NODE::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:process.version},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:"TERM::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:W},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:[G?.toUpperCase(),"::"]},void 0,!0,void 0,this),T.jsxDEV(O,{color:_?"white":"red",children:_?X.model_id:"无可用模型"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{marginTop:1,paddingX:1,flexDirection:"column",gap:0,children:[T.jsxDEV(N,{children:T.jsxDEV(O,{color:"blue",children:"WORKING_DIR ::"},void 0,!1,void 0,this)},void 0,!1,void 0,this),T.jsxDEV(N,{children:T.jsxDEV(O,{color:"gray",children:H},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!A&&T.jsxDEV(N,{marginTop:1,paddingX:1,flexDirection:"column",gap:0,children:[T.jsxDEV(O,{color:"red",bold:!0,children:["⚠️ 需要配置 ",G==="anthropic"?"Anthropic":"OpenAI"," API:"]},void 0,!0,void 0,this),!M&&T.jsxDEV(O,{color:"yellow",children:" • 请使用 /m 进入模型配置面板"},void 0,!1,void 0,this),!_&&T.jsxDEV(O,{color:"yellow",children:" • 请确保网络连接正常以获取模型列表"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"gray",children:" • 配置后使用 /m 查看可用模型"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{marginTop:1,paddingTop:1,borderTop:!1,flexDirection:"row",justifyContent:"space-between",children:[T.jsxDEV(N,{gap:3,children:[T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"green",children:"●"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",dimColor:!0,children:[" ","AGENTS"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:K>0?"green":"gray",children:"●"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",dimColor:!0,children:[" ","MCP (",K,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[A?T.jsxDEV(O,{color:"yellow",bold:!0,children:">>> WAITING_FOR_INPUT"},void 0,!1,void 0,this):T.jsxDEV(O,{color:"red",bold:!0,children:">>> CONFIGURATION_NEEDED"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"yellow",dimColor:!0,children:[" ","▌"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},TJ=mW;var uY=L(x(),1);var u0=L(x(),1);class fJ{commands=new Map;aliases=new Map;register(Z){if(this.commands.set(Z.name,Z),Z.aliases)Z.aliases.forEach((Y)=>{this.aliases.set(Y,Z.name)})}getCommand(Z){let Y=this.aliases.get(Z)||Z;return this.commands.get(Y)}getAllCommands(){return Array.from(this.commands.values())}isCommand(Z){return Z.trim().startsWith("/")}parseCommand(Z){if(!this.isCommand(Z))return null;let X=Z.trim().slice(1).split(/\s+/),J=X[0],Q=X.slice(1);return{command:J,args:Q}}async executeCommand(Z,Y){let X=this.parseCommand(Z);if(!X)return{success:!1,message:"无效的命令格式"};let{command:J,args:Q}=X,$=this.getCommand(J);if(!$)return{success:!1,message:`未知命令: /${J}`};if($.requiresArgs&&Q.length===0)return{success:!1,message:`命令 /${J} 需要参数。用法: ${$.usage||`/${J} <args>`}`};if($.validateArgs&&!$.validateArgs(Q))return{success:!1,message:`命令 /${J} 参数无效。用法: ${$.usage||`/${J} <args>`}`};try{return await $.execute(Q,Y)}catch(K){return{success:!1,message:`命令执行失败: ${K instanceof Error?K.message:String(K)}`}}}getSuggestions(Z){if(!Z.startsWith("/"))return[];let Y=Z.slice(1).toLowerCase(),X=[];if(Y===""){let W=["new","history","task","agent","model","settings","mcp","knowledge","summarize","template","plan","interview","help"];for(let U of W){let z=this.commands.get(U);if(z)X.push({command:U,displayText:`/${U}`,description:z.description})}return X.slice(0,10)}let J=new Set(["history","knowledge","help","init","model","config"]),Q=[],$=[];for(let[W,U]of this.commands){let z=W.toLowerCase();if(z.startsWith(Y))Q.push({command:W,displayText:`/${W}`,description:U.description});else if(z.includes(Y))$.push({command:W,displayText:`/${W}`,description:U.description});if(U.aliases)for(let H of U.aliases){let G=H.toLowerCase();if(G.startsWith(Y))Q.push({command:W,displayText:`/${H}`,description:`${U.description} (别名)`});else if(G.includes(Y))$.push({command:W,displayText:`/${H}`,description:`${U.description} (别名)`})}}let K=(W,U)=>{let z=J.has(W.command)?1:0,H=J.has(U.command)?1:0;if(z!==H)return H-z;return W.displayText.length-U.displayText.length};return Q.sort(K),$.sort(K),X.push(...Q,...$),X.slice(0,10)}getHelp(Z){if(Z){let X=this.getCommand(Z);if(!X)return`未找到命令: /${Z}`;let J=`命令: /${X.name}
164
+ ╚══════╝╚══════╝╚═╝ ╚═══╝`},void 0,!1,void 0,this)},void 0,!1,void 0,this),T.jsxDEV(_,{flexDirection:"column",justifyContent:"center",flexGrow:1,children:[T.jsxDEV(_,{marginBottom:1,children:w?T.jsxDEV(O,{color:"green",bold:!0,children:[" ","[ SYSTEM ONLINE ]"]},void 0,!0,void 0,this):T.jsxDEV(O,{color:"red",bold:!0,children:[" ","[ CONFIG REQUIRED ]"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),T.jsxDEV(_,{flexDirection:"column",gap:0,children:[T.jsxDEV(_,{children:[T.jsxDEV(O,{color:"blue",children:"USER::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(_,{children:[T.jsxDEV(O,{color:"blue",children:"ARCH::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:process.arch},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(_,{children:[T.jsxDEV(O,{color:"blue",children:"PLATFORM::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:z},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(_,{children:[T.jsxDEV(O,{color:"blue",children:"NODE::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:process.version},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(_,{children:[T.jsxDEV(O,{color:"blue",children:"TERM::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(_,{children:[T.jsxDEV(O,{color:"blue",children:[G?.toUpperCase(),"::"]},void 0,!0,void 0,this),T.jsxDEV(O,{color:N?"white":"red",children:N?X.model_id:"无可用模型"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(_,{marginTop:1,paddingX:1,flexDirection:"column",gap:0,children:[T.jsxDEV(_,{children:T.jsxDEV(O,{color:"blue",children:"WORKING_DIR ::"},void 0,!1,void 0,this)},void 0,!1,void 0,this),T.jsxDEV(_,{children:T.jsxDEV(O,{color:"gray",children:H},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!w&&T.jsxDEV(_,{marginTop:1,paddingX:1,flexDirection:"column",gap:0,children:[T.jsxDEV(O,{color:"red",bold:!0,children:["⚠️ 需要配置 ",G==="anthropic"?"Anthropic":"OpenAI"," API:"]},void 0,!0,void 0,this),!M&&T.jsxDEV(O,{color:"yellow",children:" • 请使用 /m 进入模型配置面板"},void 0,!1,void 0,this),!N&&T.jsxDEV(O,{color:"yellow",children:" • 请确保网络连接正常以获取模型列表"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"gray",children:" • 配置后使用 /m 查看可用模型"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(_,{marginTop:1,paddingTop:1,borderTop:!1,flexDirection:"row",justifyContent:"space-between",children:[T.jsxDEV(_,{gap:3,children:[T.jsxDEV(_,{children:[T.jsxDEV(O,{color:"green",children:"●"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",dimColor:!0,children:[" ","AGENTS"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(_,{children:[T.jsxDEV(O,{color:K>0?"green":"gray",children:"●"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",dimColor:!0,children:[" ","MCP (",K,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(_,{children:[w?T.jsxDEV(O,{color:"yellow",bold:!0,children:">>> WAITING_FOR_INPUT"},void 0,!1,void 0,this):T.jsxDEV(O,{color:"red",bold:!0,children:">>> CONFIGURATION_NEEDED"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"yellow",dimColor:!0,children:[" ","▌"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},EJ=mW;var mY=P(g(),1);var g0=P(g(),1);class bJ{commands=new Map;aliases=new Map;register(Z){if(this.commands.set(Z.name,Z),Z.aliases)Z.aliases.forEach((Y)=>{this.aliases.set(Y,Z.name)})}getCommand(Z){let Y=this.aliases.get(Z)||Z;return this.commands.get(Y)}getAllCommands(){return Array.from(this.commands.values())}isCommand(Z){return Z.trim().startsWith("/")}parseCommand(Z){if(!this.isCommand(Z))return null;let X=Z.trim().slice(1).split(/\s+/),J=X[0],Q=X.slice(1);return{command:J,args:Q}}async executeCommand(Z,Y){let X=this.parseCommand(Z);if(!X)return{success:!1,message:"无效的命令格式"};let{command:J,args:Q}=X,$=this.getCommand(J);if(!$)return{success:!1,message:`未知命令: /${J}`};if($.requiresArgs&&Q.length===0)return{success:!1,message:`命令 /${J} 需要参数。用法: ${$.usage||`/${J} <args>`}`};if($.validateArgs&&!$.validateArgs(Q))return{success:!1,message:`命令 /${J} 参数无效。用法: ${$.usage||`/${J} <args>`}`};try{return await $.execute(Q,Y)}catch(K){return{success:!1,message:`命令执行失败: ${K instanceof Error?K.message:String(K)}`}}}getSuggestions(Z){if(!Z.startsWith("/"))return[];let Y=Z.slice(1).toLowerCase(),X=[];if(Y===""){let U=["new","history","task","agent","model","settings","mcp","knowledge","summarize","template","plan","interview","help"];for(let W of U){let z=this.commands.get(W);if(z)X.push({command:W,displayText:`/${W}`,description:z.description})}return X.slice(0,10)}let J=new Set(["history","knowledge","help","init","model","config"]),Q=[],$=[];for(let[U,W]of this.commands){let z=U.toLowerCase();if(z.startsWith(Y))Q.push({command:U,displayText:`/${U}`,description:W.description});else if(z.includes(Y))$.push({command:U,displayText:`/${U}`,description:W.description});if(W.aliases)for(let H of W.aliases){let G=H.toLowerCase();if(G.startsWith(Y))Q.push({command:U,displayText:`/${H}`,description:`${W.description} (别名)`});else if(G.includes(Y))$.push({command:U,displayText:`/${H}`,description:`${W.description} (别名)`})}}let K=(U,W)=>{let z=J.has(U.command)?1:0,H=J.has(W.command)?1:0;if(z!==H)return H-z;return U.displayText.length-W.displayText.length};return Q.sort(K),$.sort(K),X.push(...Q,...$),X.slice(0,10)}getHelp(Z){if(Z){let X=this.getCommand(Z);if(!X)return`未找到命令: /${Z}`;let J=`命令: /${X.name}
171
165
  `;if(J+=`描述: ${X.description}
172
166
  `,X.usage)J+=`用法: ${X.usage}
173
167
  `;if(X.aliases&&X.aliases.length>0)J+=`别名: ${X.aliases.map((Q)=>`/${Q}`).join(", ")}
174
168
  `;return J}let Y=`可用命令:
175
169
  `;for(let X of this.getAllCommands())Y+=` /${X.name} - ${X.description}
176
170
  `;return Y+=`
177
- 使用 /help <命令名> 获取具体命令的帮助信息`,Y}}var R4=new fJ;var jJ={name:"settings",description:"打开 Settings 面板(Model 和 Provider 配置)",aliases:["s","model","settings","m"],usage:"/settings",execute:async(Z,Y)=>{return Y.switchToSettings?.(),{success:!0,message:"打开 Settings 面板",shouldClearInput:!0}}};var pW={name:"new",description:"初始化新的对话会话",aliases:["new","n"],usage:"/new [主题]",execute:async(Z,Y)=>{let X=Z.join(" ");if(await Y.createNewChat(),X){let J=`我想开始一个关于 "${X}" 的新对话。`;return Y.sendMessage([{type:"human",content:J}]),{success:!0,message:`已创建新对话,主题: ${X}`,shouldClearInput:!0}}return{success:!0,message:"已创建新对话",shouldClearInput:!0}}},cW={name:"help",description:"显示命令帮助信息",aliases:["h","?"],usage:"/help [命令名]",execute:async(Z,Y)=>{let X=Z[0];return{success:!0,message:R4.getHelp(X),shouldClearInput:!0}}},dW={name:"task",description:"打开任务看板面板",aliases:["tasks","kanban"],usage:"/task",execute:async(Z,Y)=>{return Y.switchToTask?.(),{success:!0,message:"打开任务看板",shouldClearInput:!0}}},SJ=[pW,cW,dW,jJ];import{readFileSync as lW,readdirSync as iW}from"fs";import{join as yJ}from"path";var g0=null;function rW(Z){let Y=Z.split(`
178
- `);if(Y[0]!=="---")return{metadata:{},content:Z};let X=Y.indexOf("---",1);if(X===-1)return{metadata:{},content:Z};let J=Y.slice(1,X),Q={};for(let K of J){let W=K.match(/^(\w+):\s*(.+)$/);if(W){let[,U,z]=W;if(U==="name")Q.name=z.trim();if(U==="description")Q.description=z.trim()}}let $=Y.slice(X+1).join(`
179
- `).trim();return{metadata:Q,content:$}}function kJ(Z,Y){let X=new Map;try{let J=iW(Z,{withFileTypes:!0});for(let Q of J){let $=yJ(Z,Q.name);if(Q.isDirectory())kJ($,Y).forEach((W)=>X.set(W.name,W));else if(Q.name.endsWith(".md"))try{let K=lW($,"utf-8"),{metadata:W,content:U}=rW(K),z=W.name||Q.name.replace(/\.md$/,"");if(!W.name)console.warn(`Template missing "name" in frontmatter: ${$}`);X.set(z,{name:z,description:W.description||"No description",content:U,path:$})}catch(K){console.warn(`Failed to read template file: ${$}`,K)}}}catch(J){if(J.code!=="ENOENT")console.warn(`Error scanning templates directory: ${Z}`,J)}return X}function hJ(){g0=null}function xJ(Z="./.claude/templates"){if(g0)return Array.from(g0.values());let Y=Z.startsWith("/")?Z:yJ(process.cwd(),Z);return g0=kJ(Y,Y),Array.from(g0.values())}var oW={name:"status",description:"显示当前聊天状态信息",aliases:["stat","info"],execute:async(Z,Y)=>{return{success:!0,message:[`当前代理: ${Y.client?.availableAssistants.find((Q)=>Q.graph_id===Y.currentAgent)?.name||"未选择"} (${Y.currentAgent||"N/A"})`,`聊天ID: ${Y.client?.currentChatId?.slice(-8)||"N/A"}`,`可用代理数: ${Y.client?.availableAssistants?.length||0}`,`模型: ${Y.extraParams?.model_id||"N/A"}`].join(`
180
- `),shouldClearInput:!0}}},nW={name:"template",description:"插入预定义的消息模板",aliases:["tpl","t"],usage:"/template <模板名>",execute:async(Z,Y)=>{let X=Z[0];if(Z.includes("--refresh"))return hJ(),{success:!0,message:"模板缓存已清除",shouldClearInput:!0};let J=xJ();if(!X){if(J.length===0)return{success:!0,message:"当前没有可用的模板。可以在 ./.claude/templates/ 目录下创建 .md 模板文件。",shouldClearInput:!0};return{success:!0,message:`可用模板:
171
+ 使用 /help <命令名> 获取具体命令的帮助信息`,Y}}var L4=new bJ;var TJ={name:"settings",description:"打开 Settings 面板(Model 和 Provider 配置)",aliases:["s","model","settings","m"],usage:"/settings",execute:async(Z,Y)=>{return Y.switchToSettings?.(),{success:!0,message:"打开 Settings 面板",shouldClearInput:!0}}};var pW={name:"new",description:"初始化新的对话会话",aliases:["new","n"],usage:"/new [主题]",execute:async(Z,Y)=>{let X=Z.join(" ");if(await Y.createNewChat(),X){let J=`我想开始一个关于 "${X}" 的新对话。`;return Y.sendMessage([{type:"human",content:J}]),{success:!0,message:`已创建新对话,主题: ${X}`,shouldClearInput:!0}}return{success:!0,message:"已创建新对话",shouldClearInput:!0}}},dW={name:"help",description:"显示命令帮助信息",aliases:["h","?"],usage:"/help [命令名]",execute:async(Z,Y)=>{let X=Z[0];return{success:!0,message:L4.getHelp(X),shouldClearInput:!0}}},cW={name:"task",description:"打开任务看板面板",aliases:["tasks","kanban"],usage:"/task",execute:async(Z,Y)=>{return Y.switchToTask?.(),{success:!0,message:"打开任务看板",shouldClearInput:!0}}},lW={name:"process",description:"打开进程管理器面板",aliases:["ps","proc"],usage:"/process",execute:async(Z,Y)=>{return Y.switchToProcess?.(),{success:!0,message:"打开进程管理器",shouldClearInput:!0}}},fJ=[pW,dW,cW,TJ,lW];import{readFileSync as iW,readdirSync as rW}from"fs";import{join as jJ}from"path";var x0=null;function oW(Z){let Y=Z.split(`
172
+ `);if(Y[0]!=="---")return{metadata:{},content:Z};let X=Y.indexOf("---",1);if(X===-1)return{metadata:{},content:Z};let J=Y.slice(1,X),Q={};for(let K of J){let U=K.match(/^(\w+):\s*(.+)$/);if(U){let[,W,z]=U;if(W==="name")Q.name=z.trim();if(W==="description")Q.description=z.trim()}}let $=Y.slice(X+1).join(`
173
+ `).trim();return{metadata:Q,content:$}}function SJ(Z,Y){let X=new Map;try{let J=rW(Z,{withFileTypes:!0});for(let Q of J){let $=jJ(Z,Q.name);if(Q.isDirectory())SJ($,Y).forEach((U)=>X.set(U.name,U));else if(Q.name.endsWith(".md"))try{let K=iW($,"utf-8"),{metadata:U,content:W}=oW(K),z=U.name||Q.name.replace(/\.md$/,"");if(!U.name)console.warn(`Template missing "name" in frontmatter: ${$}`);X.set(z,{name:z,description:U.description||"No description",content:W,path:$})}catch(K){console.warn(`Failed to read template file: ${$}`,K)}}}catch(J){if(J.code!=="ENOENT")console.warn(`Error scanning templates directory: ${Z}`,J)}return X}function yJ(){x0=null}function kJ(Z="./.claude/templates"){if(x0)return Array.from(x0.values());let Y=Z.startsWith("/")?Z:jJ(process.cwd(),Z);return x0=SJ(Y,Y),Array.from(x0.values())}var nW={name:"status",description:"显示当前聊天状态信息",aliases:["stat","info"],execute:async(Z,Y)=>{return{success:!0,message:[`当前代理: ${Y.client?.availableAssistants.find((Q)=>Q.graph_id===Y.currentAgent)?.name||"未选择"} (${Y.currentAgent||"N/A"})`,`聊天ID: ${Y.client?.currentChatId?.slice(-8)||"N/A"}`,`可用代理数: ${Y.client?.availableAssistants?.length||0}`,`模型: ${Y.extraParams?.model_id||"N/A"}`].join(`
174
+ `),shouldClearInput:!0}}},aW={name:"template",description:"插入预定义的消息模板",aliases:["tpl","t"],usage:"/template <模板名>",execute:async(Z,Y)=>{let X=Z[0];if(Z.includes("--refresh"))return yJ(),{success:!0,message:"模板缓存已清除",shouldClearInput:!0};let J=kJ();if(!X){if(J.length===0)return{success:!0,message:"当前没有可用的模板。可以在 ./.claude/templates/ 目录下创建 .md 模板文件。",shouldClearInput:!0};return{success:!0,message:`可用模板:
181
175
  ${J.map((K)=>` - ${K.name}: ${K.description}`).join(`
182
176
  `)}
183
177
 
184
178
  使用 /template <name> 插入模板`,shouldClearInput:!0}}let Q=J.find(($)=>$.name===X);if(!Q){let $=J.map((K)=>K.name).join(", ");return{success:!1,message:`未找到模板 "${X}"。可用模板: ${$||"(无)"}`}}return Y.setUserInput(Q.content),{success:!0,message:`已插入模板: ${Q.name}
185
- ${Q.description}`,shouldClearInput:!1}}},aW={name:"config",description:"查看或设置配置项",aliases:["cfg"],usage:"/config [key] [value]",execute:async(Z,Y)=>{if(Z.length===0)return{success:!0,message:["当前配置:",` model_id: ${Y.extraParams?.model_id||"N/A"}`,` provider_id: ${Y.extraParams?.provider_id||"N/A"}`,` enable_thinking: ${Y.extraParams?.enable_thinking??!0}`,` compact_mode: ${Y.compactMode??!1}`,` stream_refresh_interval: ${Y.extraParams?.stream_refresh_interval}`,"","使用方法:"," /config <key> <value> - 设置配置项"," /config <key> - 查看配置项","","可用配置项:"," model_id - 当前使用的模型 ID"," provider_id - 当前使用的 Provider ID"," enable_thinking - 启用思考模式 (true, false)"," compact_mode - 紧凑模式 (true, false)"," stream_refresh_interval - 流刷新间隔"].join(`
179
+ ${Q.description}`,shouldClearInput:!1}}},sW={name:"config",description:"查看或设置配置项",aliases:["cfg"],usage:"/config [key] [value]",execute:async(Z,Y)=>{if(Z.length===0)return{success:!0,message:["当前配置:",` model_id: ${Y.extraParams?.model_id||"N/A"}`,` provider_id: ${Y.extraParams?.provider_id||"N/A"}`,` enable_thinking: ${Y.extraParams?.enable_thinking??!0}`,` compact_mode: ${Y.compactMode??!1}`,` stream_refresh_interval: ${Y.extraParams?.stream_refresh_interval}`,"","使用方法:"," /config <key> <value> - 设置配置项"," /config <key> - 查看配置项","","可用配置项:"," model_id - 当前使用的模型 ID"," provider_id - 当前使用的 Provider ID"," enable_thinking - 启用思考模式 (true, false)"," compact_mode - 紧凑模式 (true, false)"," stream_refresh_interval - 流刷新间隔"].join(`
186
180
  `),shouldClearInput:!0};let X=Z[0],J=["enable_thinking","stream_refresh_interval","provider_id","model_id","compact_mode"];if(!J.includes(X))return{success:!1,message:`无效的配置项: ${X}
187
181
  可用配置项: ${J.join(", ")}`,shouldClearInput:!0};if(Z.length===1){let $;switch(X){case"model_id":$=Y.extraParams?.model_id;break;case"provider_id":$=Y.extraParams?.provider_id;break;case"enable_thinking":$=Y.extraParams?.enable_thinking??!0;break;case"compact_mode":$=Y.compactMode??!1;break;case"stream_refresh_interval":$=Y.extraParams?.stream_refresh_interval;break}return{success:!0,message:`${X}: ${$??"未设置"}`,shouldClearInput:!0}}let Q=Z.slice(1).join(" ");if(X==="enable_thinking"||X==="compact_mode"){if(Q==="true"||Q==="1"||Q==="yes")Q=!0;else if(Q==="false"||Q==="0"||Q==="no")Q=!1}if(X==="stream_refresh_interval"){let $=parseInt(Q,10);if(!isNaN($))Q=$}try{if(!Y.updateConfig)return{success:!1,message:"无法访问配置更新功能",shouldClearInput:!0};await Y.updateConfig({[X]:Q});let $=`配置已更新: ${X} = ${Q} 重启程序生效`;if(X==="model_id"||X==="provider_id")$+=`
188
182
 
189
- 提示: 更换模型或提供商后,请重启程序以确保完整生效`;return{success:!0,message:$,shouldClearInput:!0}}catch($){return{success:!1,message:`配置更新失败: ${$ instanceof Error?$.message:String($)}`,shouldClearInput:!0}}}},sW={name:"mcp",description:"管理 MCP 服务器配置",aliases:[],usage:"/mcp [list|add|remove|get] [args]",execute:async(Z,Y)=>{if(Z.length===0)return{success:!0,message:["MCP 配置管理命令:","","用法:"," /mcp list - 列出所有 MCP 服务器"," /mcp add <name> <json_string> - 添加 MCP 服务器 (传统格式)"," /mcp remove <name> - 移除 MCP 服务器"," /mcp get <name> - 查看 MCP 服务器详情","","示例 (JSON 格式):",' /mcp add context7 {"name":"context7","url":"https://mcp.context7.com/mcp"}',""].join(`
183
+ 提示: 更换模型或提供商后,请重启程序以确保完整生效`;return{success:!0,message:$,shouldClearInput:!0}}catch($){return{success:!1,message:`配置更新失败: ${$ instanceof Error?$.message:String($)}`,shouldClearInput:!0}}}},tW={name:"mcp",description:"管理 MCP 服务器配置",aliases:[],usage:"/mcp [list|add|remove|get] [args]",execute:async(Z,Y)=>{if(Z.length===0)return{success:!0,message:["MCP 配置管理命令:","","用法:"," /mcp list - 列出所有 MCP 服务器"," /mcp add <name> <json_string> - 添加 MCP 服务器 (传统格式)"," /mcp remove <name> - 移除 MCP 服务器"," /mcp get <name> - 查看 MCP 服务器详情","","示例 (JSON 格式):",' /mcp add context7 {"name":"context7","url":"https://mcp.context7.com/mcp"}',""].join(`
190
184
  `),shouldClearInput:!0};let X=Z[0];try{let Q=(Y.extraParams||{}).mcp_config||{};switch(X){case"list":{let $=Object.keys(Q);if($.length===0)return{success:!0,message:"当前未配置任何 MCP 服务器",shouldClearInput:!0};return{success:!0,message:`已配置的 MCP 服务器:
191
- ${$.map((W)=>{return` - ${W}`}).join(`
192
- `)}`,shouldClearInput:!0}}case"add":{if(Z.length<2)return{success:!1,message:"用法: /mcp add <name> <json_string>",shouldClearInput:!0};let[$,K,...W]=Z,U=W.join(""),z={...Q,[K]:JSON.parse(U)};if(!Y.updateConfig)return{success:!1,message:"无法访问配置更新功能",shouldClearInput:!0};return await Y.updateConfig({mcp_config:z}),{success:!0,message:`MCP 服务器 "${K}" 已添加`,shouldClearInput:!0}}case"remove":{if(Z.length<2)return{success:!1,message:"用法: /mcp remove <name>",shouldClearInput:!0};let $=Z[1];if(!Q[$])return{success:!1,message:`MCP 服务器 "${$}" 不存在`,shouldClearInput:!0};let K={...Q};if(delete K[$],!Y.updateConfig)return{success:!1,message:"无法访问配置更新功能",shouldClearInput:!0};return await Y.updateConfig({mcp_config:K}),{success:!0,message:`MCP 服务器 "${$}" 已移除
185
+ ${$.map((U)=>{return` - ${U}`}).join(`
186
+ `)}`,shouldClearInput:!0}}case"add":{if(Z.length<2)return{success:!1,message:"用法: /mcp add <name> <json_string>",shouldClearInput:!0};let[$,K,...U]=Z,W=U.join(""),z={...Q,[K]:JSON.parse(W)};if(!Y.updateConfig)return{success:!1,message:"无法访问配置更新功能",shouldClearInput:!0};return await Y.updateConfig({mcp_config:z}),{success:!0,message:`MCP 服务器 "${K}" 已添加`,shouldClearInput:!0}}case"remove":{if(Z.length<2)return{success:!1,message:"用法: /mcp remove <name>",shouldClearInput:!0};let $=Z[1];if(!Q[$])return{success:!1,message:`MCP 服务器 "${$}" 不存在`,shouldClearInput:!0};let K={...Q};if(delete K[$],!Y.updateConfig)return{success:!1,message:"无法访问配置更新功能",shouldClearInput:!0};return await Y.updateConfig({mcp_config:K}),{success:!0,message:`MCP 服务器 "${$}" 已移除
193
187
  重启程序生效`,shouldClearInput:!0}}case"get":{if(Z.length<2)return{success:!1,message:"用法: /mcp get <name>",shouldClearInput:!0};let $=Z[1],K=Q[$];if(!K)return{success:!1,message:`MCP 服务器 "${$}" 不存在`,shouldClearInput:!0};return{success:!0,message:[`MCP 服务器: ${$}`,` URL: ${K.url}`,` Headers: ${JSON.stringify(K.headers||{},null,2)}`].join(`
194
188
  `),shouldClearInput:!0}}default:return{success:!1,message:`未知操作: ${X}
195
- 可用操作: list, add, remove, get`,shouldClearInput:!0}}}catch(J){return{success:!1,message:`MCP 操作失败: ${J instanceof Error?J.message:String(J)}`,shouldClearInput:!0}}}},tW={name:"summarize",description:"智能总结对话并提取有价值信息保存为记忆",aliases:["sum","summary","compact"],usage:"/sum",execute:async(Z,Y)=>{if(!Y.renderMessages||Y.renderMessages.length===0)return{success:!1,message:"当前会话没有消息可以总结",shouldClearInput:!0};let X=Y.renderMessages.length;try{let J={...Y.extraParams,switch_command:"smart_memory"};return await Y.sendMessage([],{extraParams:J}),{success:!0,message:`正在智能分析 ${X} 条消息并提取记忆...`,shouldClearInput:!0}}catch(J){return{success:!1,message:`总结失败: ${J instanceof Error?J.message:String(J)}`,shouldClearInput:!0}}}},eW={name:"history",description:"打开历史面板",aliases:["h"],execute:async(Z,Y)=>{if(Y.switchToHistory)return Y.switchToHistory(),{success:!0,message:"已打开历史面板",shouldClearInput:!0};return{success:!1,message:"面板切换功能不可用",shouldClearInput:!0}}},Z2={name:"knowledge",description:"打开知识库面板",aliases:["k"],execute:async(Z,Y)=>{if(Y.switchToKnowledge)return Y.switchToKnowledge(),{success:!0,message:"已打开知识库面板",shouldClearInput:!0};return{success:!1,message:"面板切换功能不可用",shouldClearInput:!0}}},Y2={name:"close",description:"关闭当前面板返回聊天",aliases:["c","q"],execute:async(Z,Y)=>{if(Y.closePanel)return Y.closePanel(),{success:!0,message:"已关闭面板",shouldClearInput:!0};return{success:!1,message:"面板关闭功能不可用",shouldClearInput:!0}}},X2={name:"model",description:"打开模型/Provider配置面板",aliases:["mp","m"],execute:async(Z,Y)=>{if(Y.switchToModelProvider)return Y.switchToModelProvider(),{success:!0,message:"已打开模型/Provider配置面板",shouldClearInput:!0};return{success:!1,message:"模型面板切换功能不可用",shouldClearInput:!0}}},J2={name:"ralph",description:"进入循环模式,持续发送响应直到返回 <COMPLETE></COMPLETE>",aliases:[],usage:"/ralph <text>",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ");if(!X.trim())return{success:!1,message:"请提供要循环的文本内容",shouldClearInput:!0};if(Y.startRalphLoop)return Y.startRalphLoop(X),{success:!0,message:`进入 Ralph 循环模式: "${X}"`,shouldClearInput:!0};return{success:!1,message:"Ralph 循环功能不可用",shouldClearInput:!0}}},gJ=[oW,nW,aW,sW,tW,eW,Z2,Y2,X2,J2];var Q2={name:"agent",description:"打开 Agent 选择面板",aliases:["a"],usage:"/agent",execute:async(Z,Y)=>{if(Y.switchToAgent)Y.switchToAgent();return{success:!0,message:"打开 Agent 面板",shouldClearInput:!0}}},uJ=[Q2];var $2=`
189
+ 可用操作: list, add, remove, get`,shouldClearInput:!0}}}catch(J){return{success:!1,message:`MCP 操作失败: ${J instanceof Error?J.message:String(J)}`,shouldClearInput:!0}}}},eW={name:"summarize",description:"智能总结对话并提取有价值信息保存为记忆",aliases:["sum","summary","compact"],usage:"/sum",execute:async(Z,Y)=>{if(!Y.renderMessages||Y.renderMessages.length===0)return{success:!1,message:"当前会话没有消息可以总结",shouldClearInput:!0};let X=Y.renderMessages.length;try{let J={...Y.extraParams,switch_command:"smart_memory"};return await Y.sendMessage([],{extraParams:J}),{success:!0,message:`正在智能分析 ${X} 条消息并提取记忆...`,shouldClearInput:!0}}catch(J){return{success:!1,message:`总结失败: ${J instanceof Error?J.message:String(J)}`,shouldClearInput:!0}}}},Z2={name:"history",description:"打开历史面板",aliases:["h"],execute:async(Z,Y)=>{if(Y.switchToHistory)return Y.switchToHistory(),{success:!0,message:"已打开历史面板",shouldClearInput:!0};return{success:!1,message:"面板切换功能不可用",shouldClearInput:!0}}},Y2={name:"knowledge",description:"打开知识库面板",aliases:["k"],execute:async(Z,Y)=>{if(Y.switchToKnowledge)return Y.switchToKnowledge(),{success:!0,message:"已打开知识库面板",shouldClearInput:!0};return{success:!1,message:"面板切换功能不可用",shouldClearInput:!0}}},X2={name:"close",description:"关闭当前面板返回聊天",aliases:["c","q"],execute:async(Z,Y)=>{if(Y.closePanel)return Y.closePanel(),{success:!0,message:"已关闭面板",shouldClearInput:!0};return{success:!1,message:"面板关闭功能不可用",shouldClearInput:!0}}},J2={name:"model",description:"打开模型/Provider配置面板",aliases:["mp","m"],execute:async(Z,Y)=>{if(Y.switchToModelProvider)return Y.switchToModelProvider(),{success:!0,message:"已打开模型/Provider配置面板",shouldClearInput:!0};return{success:!1,message:"模型面板切换功能不可用",shouldClearInput:!0}}},Q2={name:"ralph",description:"进入循环模式,持续发送响应直到返回 <COMPLETE></COMPLETE>",aliases:[],usage:"/ralph <text>",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ");if(!X.trim())return{success:!1,message:"请提供要循环的文本内容",shouldClearInput:!0};if(Y.startRalphLoop)return Y.startRalphLoop(X),{success:!0,message:`进入 Ralph 循环模式: "${X}"`,shouldClearInput:!0};return{success:!1,message:"Ralph 循环功能不可用",shouldClearInput:!0}}},hJ=[nW,aW,sW,tW,eW,Z2,Y2,X2,J2,Q2];var $2={name:"agent",description:"打开 Agent 选择面板",aliases:["a"],usage:"/agent",execute:async(Z,Y)=>{if(Y.switchToAgent)Y.switchToAgent();return{success:!0,message:"打开 Agent 面板",shouldClearInput:!0}}},xJ=[$2];var K2=`
196
190
  [Interview Mode Activated]
197
191
 
198
192
  I want to clarify requirements through guided questions.
@@ -211,8 +205,8 @@ After getting answers:
211
205
  ---
212
206
 
213
207
  User's original message:
214
- `,K2={name:"interview",description:"Start Interview mode to clarify requirements through questions",aliases:["i"],usage:"/interview [your request]",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ").trim();if(!X)return{success:!1,message:`❌ Interview 模式需要提供任务描述
215
- 用法: /interview [your request]`};let J=$2+X;return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCCB Interview mode activated",shouldClearInput:!0}}},mJ=[K2];var W2=`
208
+ `,W2={name:"interview",description:"Start Interview mode to clarify requirements through questions",aliases:["i"],usage:"/interview [your request]",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ").trim();if(!X)return{success:!1,message:`❌ Interview 模式需要提供任务描述
209
+ 用法: /interview [your request]`};let J=K2+X;return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCCB Interview mode activated",shouldClearInput:!0}}},gJ=[W2];var U2=`
216
210
  [Plan Mode Activated]
217
211
 
218
212
  I want to create a comprehensive implementation plan for this task.
@@ -235,8 +229,8 @@ After the plan is created, ask if I want to execute it immediately or save for l
235
229
  ---
236
230
 
237
231
  User's original request:
238
- `,U2={name:"plan",description:"Enter Plan mode to create detailed implementation plans",aliases:["p"],usage:"/plan [your task description]",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ").trim();if(!X)return{success:!1,message:`❌ Plan 模式需要提供任务描述
239
- 用法: /plan [your task description]`};let J=W2+X;return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCCB Plan mode activated",shouldClearInput:!0}}},pJ=[U2];var cJ=`
232
+ `,z2={name:"plan",description:"Enter Plan mode to create detailed implementation plans",aliases:["p"],usage:"/plan [your task description]",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ").trim();if(!X)return{success:!1,message:`❌ Plan 模式需要提供任务描述
233
+ 用法: /plan [your task description]`};let J=U2+X;return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCCB Plan mode activated",shouldClearInput:!0}}},uJ=[z2];var mJ=`
240
234
  [Create AGENTS.md Mode Activated]
241
235
 
242
236
  I want to create or update the AGENTS.md file for this project.
@@ -268,7 +262,7 @@ After the AGENTS.md is created or updated, provide a summary of the changes made
268
262
  ---
269
263
 
270
264
  User's request:
271
- `,z2={name:"create-agent-md",description:"Create or update AGENTS.md file with project guidelines",aliases:["agentmd","am"],usage:"/create-agent-md [description or goal for AGENTS.md]",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ").trim();if(!X)return{success:!1,message:"❌ 需要提供描述或目标。例如: /create-agent-md 初始化项目指南文档",shouldClearInput:!1};let J=cJ+X;return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCDD AGENTS.md creation mode activated",shouldClearInput:!0}}},H2={name:"init-agents-md",description:"快速初始化 AGENTS.md 项目指南文档",aliases:["iam","init-agents"],usage:"/init-agents-md",requiresArgs:!1,execute:async(Z,Y)=>{let J=cJ+"初始化项目 AGENTS.md 指南文档";return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCDD 开始初始化 AGENTS.md...",shouldClearInput:!0}}},dJ=[z2,H2];var lJ={name:"compact-message",description:"切换紧凑消息显示模式 (紧凑模式显示简化的消息预览)",aliases:["cm"],usage:"/compact-message",requiresArgs:!1,execute:async(Z,Y)=>{try{let{updateConfig:X,compactMode:J}=Y;if(!X)return{success:!1,message:"配置更新功能不可用"};let Q=J??!1;return await X({compact_mode:!Q}),{success:!0,message:!Q?"紧凑模式已启用":"紧凑模式已关闭",shouldClearInput:!0}}catch(X){return{success:!1,message:`切换紧凑模式失败: ${X instanceof Error?X.message:String(X)}`}}}};var iJ={name:"mcp",description:"打开 MCP 服务器配置面板",aliases:[],usage:"/mcp",execute:async(Z,Y)=>{return Y.switchToMcp?.(),{success:!0,message:"打开 MCP 配置面板",shouldClearInput:!0}}};var rJ={name:"settings",description:"打开通用设置面板",aliases:["set"],usage:"/settings",execute:async(Z,Y)=>{if(Y.switchToSettings)return Y.switchToSettings(),{success:!0,message:"打开通用设置面板",shouldClearInput:!0};return{success:!1,message:"Settings 面板不可用",shouldClearInput:!0}}};var G2=`
265
+ `,H2={name:"create-agent-md",description:"Create or update AGENTS.md file with project guidelines",aliases:["agentmd","am"],usage:"/create-agent-md [description or goal for AGENTS.md]",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ").trim();if(!X)return{success:!1,message:"❌ 需要提供描述或目标。例如: /create-agent-md 初始化项目指南文档",shouldClearInput:!1};let J=mJ+X;return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCDD AGENTS.md creation mode activated",shouldClearInput:!0}}},G2={name:"init-agents-md",description:"快速初始化 AGENTS.md 项目指南文档",aliases:["iam","init-agents"],usage:"/init-agents-md",requiresArgs:!1,execute:async(Z,Y)=>{let J=mJ+"初始化项目 AGENTS.md 指南文档";return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCDD 开始初始化 AGENTS.md...",shouldClearInput:!0}}},pJ=[H2,G2];var dJ={name:"compact-message",description:"切换紧凑消息显示模式 (紧凑模式显示简化的消息预览)",aliases:["cm"],usage:"/compact-message",requiresArgs:!1,execute:async(Z,Y)=>{try{let{updateConfig:X,compactMode:J}=Y;if(!X)return{success:!1,message:"配置更新功能不可用"};let Q=J??!1;return await X({compact_mode:!Q}),{success:!0,message:!Q?"紧凑模式已启用":"紧凑模式已关闭",shouldClearInput:!0}}catch(X){return{success:!1,message:`切换紧凑模式失败: ${X instanceof Error?X.message:String(X)}`}}}};var cJ={name:"mcp",description:"打开 MCP 服务器配置面板",aliases:[],usage:"/mcp",execute:async(Z,Y)=>{return Y.switchToMcp?.(),{success:!0,message:"打开 MCP 配置面板",shouldClearInput:!0}}};var lJ={name:"settings",description:"打开通用设置面板",aliases:["set"],usage:"/settings",execute:async(Z,Y)=>{if(Y.switchToSettings)return Y.switchToSettings(),{success:!0,message:"打开通用设置面板",shouldClearInput:!0};return{success:!1,message:"Settings 面板不可用",shouldClearInput:!0}}};var O2=`
272
266
  [Memory Organization Mode Activated]
273
267
 
274
268
  I want to organize and manage the .claude/memories folder.
@@ -322,26 +316,26 @@ Provide a detailed report of:
322
316
 
323
317
  ---
324
318
 
325
- `,O2={name:"memory-clear",description:"整理 .claude/memories 文件夹,清理、合并和优化项目记忆",aliases:["mem-clean","clean-memory"],usage:"/memory-clear",execute:async(Z,Y)=>{let X=Z.join(" ").trim(),J=G2+(X?`Additional context: ${X}
319
+ `,q2={name:"memory-clear",description:"整理 .claude/memories 文件夹,清理、合并和优化项目记忆",aliases:["mem-clean","clean-memory"],usage:"/memory-clear",execute:async(Z,Y)=>{let X=Z.join(" ").trim(),J=O2+(X?`Additional context: ${X}
326
320
 
327
- ---`:"开始整理记忆文件夹。");return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83E\uDDE0 记忆整理模式已激活 - 正在分析 .claude/memories 文件夹...",shouldClearInput:!0}}},oJ=[O2];function Y4(Z){if(Z===0)return"0 B";let Y=1024,X=["B","KB","MB","GB"],J=Math.floor(Math.log(Z)/Math.log(Y));return parseFloat((Z/Math.pow(Y,J)).toFixed(2))+" "+X[J]}function sX(){let Z=process.memoryUsage();return{heapTotal:Z.heapTotal,heapUsed:Z.heapUsed,external:Z.external,rss:Z.rss,heapUsedMB:(Z.heapUsed/1024/1024).toFixed(2),heapTotalMB:(Z.heapTotal/1024/1024).toFixed(2)}}function nJ(){return typeof Bun<"u"}function q2(){let Z=sX();if(nJ()&&typeof Bun.gc==="function"){Bun.gc(!0);let Y=sX(),X=Z.heapUsed-Y.heapUsed;return{success:!0,before:Z,after:Y,freed:X,message:`GC 执行成功,释放了 ${Y4(Math.max(0,X))} 内存`}}if(globalThis.global&&typeof globalThis.global.gc==="function"){globalThis.global.gc();let Y=sX(),X=Z.heapUsed-Y.heapUsed;return{success:!0,before:Z,after:Y,freed:X,message:`GC 执行成功,释放了 ${Y4(Math.max(0,X))} 内存`}}return{success:!1,before:Z,message:`/gc 命令仅在 Bun 或者 node --expose-gc 可用
328
- `+"当前内存使用: "+Y4(Z.heapUsed)+" / "+Y4(Z.heapTotal)}}function F2(){let Z=[];if(!nJ())Z.push("/gc 命令仅支持 Bun 运行时,请使用 bun 启动应用");else Z.push("当前运行在 Bun 环境,/gc 命令已就绪");return Z.join(`
329
- `)}var aJ={name:"gc",description:"手动触发垃圾回收,减少内存占用",aliases:["garbage-collect","mem-opt","memory"],usage:"/gc",execute:async(Z,Y)=>{let X=Z.includes("-v")||Z.includes("--verbose"),J=q2(),Q=`\uD83D\uDDD1️ ${J.message}
321
+ ---`:"开始整理记忆文件夹。");return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83E\uDDE0 记忆整理模式已激活 - 正在分析 .claude/memories 文件夹...",shouldClearInput:!0}}},iJ=[q2];function eZ(Z){if(Z===0)return"0 B";let Y=1024,X=["B","KB","MB","GB"],J=Math.floor(Math.log(Z)/Math.log(Y));return parseFloat((Z/Math.pow(Y,J)).toFixed(2))+" "+X[J]}function tX(){let Z=process.memoryUsage();return{heapTotal:Z.heapTotal,heapUsed:Z.heapUsed,external:Z.external,rss:Z.rss,heapUsedMB:(Z.heapUsed/1024/1024).toFixed(2),heapTotalMB:(Z.heapTotal/1024/1024).toFixed(2)}}function rJ(){return typeof Bun<"u"}function F2(){let Z=tX();if(rJ()&&typeof Bun.gc==="function"){Bun.gc(!0);let Y=tX(),X=Z.heapUsed-Y.heapUsed;return{success:!0,before:Z,after:Y,freed:X,message:`GC 执行成功,释放了 ${eZ(Math.max(0,X))} 内存`}}if(globalThis.global&&typeof globalThis.global.gc==="function"){globalThis.global.gc();let Y=tX(),X=Z.heapUsed-Y.heapUsed;return{success:!0,before:Z,after:Y,freed:X,message:`GC 执行成功,释放了 ${eZ(Math.max(0,X))} 内存`}}return{success:!1,before:Z,message:`/gc 命令仅在 Bun 或者 node --expose-gc 可用
322
+ `+"当前内存使用: "+eZ(Z.heapUsed)+" / "+eZ(Z.heapTotal)}}function M2(){let Z=[];if(!rJ())Z.push("/gc 命令仅支持 Bun 运行时,请使用 bun 启动应用");else Z.push("当前运行在 Bun 环境,/gc 命令已就绪");return Z.join(`
323
+ `)}var oJ={name:"gc",description:"手动触发垃圾回收,减少内存占用",aliases:["garbage-collect","mem-opt","memory"],usage:"/gc",execute:async(Z,Y)=>{let X=Z.includes("-v")||Z.includes("--verbose"),J=F2(),Q=`\uD83D\uDDD1️ ${J.message}
330
324
  `;if(J.before&&J.after){if(Q+=`
331
325
  \uD83D\uDCCA 内存统计:
332
- `,Q+=` Before: ${Y4(J.before.heapUsed)} / ${Y4(J.before.heapTotal)}
333
- `,Q+=` After: ${Y4(J.after.heapUsed)} / ${Y4(J.after.heapTotal)}
334
- `,J.freed!==void 0&&J.freed>0)Q+=` Freed: ${Y4(J.freed)}
326
+ `,Q+=` Before: ${eZ(J.before.heapUsed)} / ${eZ(J.before.heapTotal)}
327
+ `,Q+=` After: ${eZ(J.after.heapUsed)} / ${eZ(J.after.heapTotal)}
328
+ `,J.freed!==void 0&&J.freed>0)Q+=` Freed: ${eZ(J.freed)}
335
329
  `}else if(J.before)Q+=`
336
- \uD83D\uDCCA 当前内存使用: ${Y4(J.before.heapUsed)} / ${Y4(J.before.heapTotal)}
330
+ \uD83D\uDCCA 当前内存使用: ${eZ(J.before.heapUsed)} / ${eZ(J.before.heapTotal)}
337
331
  `;if(!J.success||X)Q+=`
338
332
  \uD83D\uDCA1 提示:
339
- `,Q+=` ${F2().replace(/\n/g,`
333
+ `,Q+=` ${M2().replace(/\n/g,`
340
334
  `)}
341
- `;return{success:J.success,message:Q,shouldClearInput:!0}}};[...SJ,...gJ,...uJ,...mJ,...pJ,...dJ,...oJ,lJ,iJ,rJ,aJ].forEach((Z)=>{R4.register(Z)});var C4=L(v(),1),sJ=(Z)=>{let{onCommandExecuted:Y,switchToHistory:X,switchToKnowledge:J,switchToSettings:Q,switchToAgent:$,closePanel:K,switchToTask:W,switchToModelProvider:U,switchToMcp:z}=Z,{userInput:H,setUserInput:G,sendMessage:F,currentAgent:M,client:_,createNewChat:A,renderMessages:P}=WZ(),{extraParams:B,updateConfig:C,AVAILABLE_MODELS:R,compactMode:D}=UZ(),[j,E]=u0.useState(null),[c,i]=u0.useState(null);jZ(()=>{E(null)},j?3000:null),jZ(()=>{i(null)},c?5000:null);let g=H.startsWith("/"),r=g?R4.getSuggestions(H):[],o=g,F4=u0.useCallback(async(D4)=>{let M0=D4||H;if(!R4.isCommand(M0))return!1;try{let N0={userInput:M0,setUserInput:G,sendMessage(pY,W8={}){return F(pY,{extraParams:{...B,...W8.extraParams},...W8,metadata:W4})},currentAgent:M,client:_,extraParams:B,createNewChat(){return A(W4)},updateConfig:C,AVAILABLE_MODELS:R,renderMessages:P,compactMode:D,switchToHistory:X,switchToKnowledge:J,switchToSettings:Q,switchToModelProvider:U,switchToAgent:$,switchToTask:W,switchToMcp:z,closePanel:K,startRalphLoop:Z.startRalphLoop},V4=await R4.executeCommand(M0,N0);if(!V4.success)E(V4.message||"命令执行失败");else if(V4.message)i(V4.message);if(V4.shouldClearInput)G("");if(V4.shouldSendMessage&&V4.messageContent){let pY=[{type:"human",content:V4.messageContent}];F(pY,{extraParams:B})}return Y?.(),!0}catch(N0){return E(`命令执行错误: ${N0 instanceof Error?N0.message:String(N0)}`),!0}},[H,G,F,M,_,B,A,Y,R,D,X,J,Q,U,$,W,z,K,Z.startRalphLoop]);return{isCommandInput:g,commandSuggestions:r,showCommandHint:o,commandError:j,executeCommand:F4,CommandHintUI:()=>{if(!o||r.length===0)return null;return C4.jsxDEV(N,{marginBottom:1,flexDirection:"column",children:[C4.jsxDEV(O,{color:"yellow",bold:!0,children:"命令建议:"},void 0,!1,void 0,this),r.slice(0,5).map((D4,M0)=>C4.jsxDEV(O,{color:"cyan",children:[D4.displayText," - ",D4.description]},M0,!0,void 0,this)),r.length>5&&C4.jsxDEV(O,{color:"gray",children:["...还有 ",r.length-5," 个命令"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},CommandErrorUI:()=>{if(!j)return null;return C4.jsxDEV(N,{marginBottom:1,children:C4.jsxDEV(O,{color:"red",children:["❌ ",j]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},CommandSuccessUI:()=>{if(!c)return null;return C4.jsxDEV(N,{marginBottom:1,children:C4.jsxDEV(O,{color:"green",children:["✅ ",c]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}}};function tJ({manager:Z,enabled:Y=!0}){return hY({queryKey:xY.skills.list(),queryFn:async()=>{if(!Z)throw Error("ConfigManager not initialized");return await Z.listSkills()},enabled:Y&&!!Z,staleTime:120000})}var M2=[{id:"agents/default",name:"Jarvis",description:"代码实现助手"},{id:"agents/manager",name:"Manager",description:"任务管理员"}];function eJ({enabled:Z=!0}={}){return hY({queryKey:xY.agents.list(),queryFn:async()=>{return M2},enabled:Z,staleTime:300000})}var X4=L(x(),1);function Z1({loading:Z,renderMessages:Y,sendMessage:X,setUserInput:J,extraParams:Q}){let[$,K]=X4.useState(null),[W,U]=X4.useState(!1),z=X4.useRef(!1),H=X4.useRef(0),G=X4.useCallback(async(M)=>{if(!M)return;let _=z.current?`
335
+ `;return{success:J.success,message:Q,shouldClearInput:!0}}};[...fJ,...hJ,...xJ,...gJ,...uJ,...pJ,...iJ,dJ,cJ,lJ,oJ].forEach((Z)=>{L4.register(Z)});var P4=P(I(),1),nJ=(Z)=>{let{onCommandExecuted:Y,switchToHistory:X,switchToKnowledge:J,switchToSettings:Q,switchToAgent:$,closePanel:K,switchToTask:U,switchToModelProvider:W,switchToMcp:z,switchToProcess:H}=Z,{userInput:G,setUserInput:F,sendMessage:M,currentAgent:N,client:w,createNewChat:L,renderMessages:B}=WZ(),{extraParams:C,updateConfig:R,AVAILABLE_MODELS:D,compactMode:f}=UZ(),[V,d]=g0.useState(null),[l,u]=g0.useState(null);TZ(()=>{d(null)},V?3000:null),TZ(()=>{u(null)},l?5000:null);let n=G.startsWith("/"),i=n?L4.getSuggestions(G):[],Q4=n,$4=g0.useCallback(async(p0)=>{let F0=p0||G;if(!L4.isCommand(F0))return!1;try{let M0={userInput:F0,setUserInput:F,sendMessage(dY,W8={}){return M(dY,{extraParams:{...C,...W8.extraParams},...W8,metadata:U4})},currentAgent:N,client:w,extraParams:C,createNewChat(){return L(U4)},updateConfig:R,AVAILABLE_MODELS:D,renderMessages:B,compactMode:f,switchToHistory:X,switchToKnowledge:J,switchToSettings:Q,switchToModelProvider:W,switchToAgent:$,switchToTask:U,switchToMcp:z,switchToProcess:H,closePanel:K,startRalphLoop:Z.startRalphLoop},v4=await L4.executeCommand(F0,M0);if(!v4.success)d(v4.message||"命令执行失败");else if(v4.message)u(v4.message);if(v4.shouldClearInput)F("");if(v4.shouldSendMessage&&v4.messageContent){let dY=[{type:"human",content:v4.messageContent}];M(dY,{extraParams:C})}return Y?.(),!0}catch(M0){return d(`命令执行错误: ${M0 instanceof Error?M0.message:String(M0)}`),!0}},[G,F,M,N,w,C,L,Y,D,f,X,J,Q,W,$,U,z,H,K,Z.startRalphLoop]);return{isCommandInput:n,commandSuggestions:i,showCommandHint:Q4,commandError:V,executeCommand:$4,CommandHintUI:()=>{if(!Q4||i.length===0)return null;return P4.jsxDEV(_,{marginBottom:1,flexDirection:"column",children:[P4.jsxDEV(O,{color:"yellow",bold:!0,children:"命令建议:"},void 0,!1,void 0,this),i.slice(0,5).map((p0,F0)=>P4.jsxDEV(O,{color:"cyan",children:[p0.displayText," - ",p0.description]},F0,!0,void 0,this)),i.length>5&&P4.jsxDEV(O,{color:"gray",children:["...还有 ",i.length-5," 个命令"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},CommandErrorUI:()=>{if(!V)return null;return P4.jsxDEV(_,{marginBottom:1,children:P4.jsxDEV(O,{color:"red",children:["❌ ",V]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},CommandSuccessUI:()=>{if(!l)return null;return P4.jsxDEV(_,{marginBottom:1,children:P4.jsxDEV(O,{color:"green",children:["✅ ",l]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}}};function aJ({manager:Z,enabled:Y=!0}){return xY({queryKey:gY.skills.list(),queryFn:async()=>{if(!Z)throw Error("ConfigManager not initialized");return await Z.listSkills()},enabled:Y&&!!Z,staleTime:120000})}var N2=[{id:"agents/default",name:"Jarvis",description:"代码实现助手"},{id:"agents/manager",name:"Manager",description:"任务管理员"}];function sJ({enabled:Z=!0}={}){return xY({queryKey:gY.agents.list(),queryFn:async()=>{return N2},enabled:Z,staleTime:300000})}var Z4=P(g(),1);function tJ({loading:Z,renderMessages:Y,sendMessage:X,setUserInput:J,extraParams:Q}){let[$,K]=Z4.useState(null),[U,W]=Z4.useState(!1),z=Z4.useRef(!1),H=Z4.useRef(0),G=Z4.useCallback(async(M)=>{if(!M)return;let N=z.current?`
342
336
 
343
- [System Context: You are currently in Ralph loop mode. Continue executing the task based on previous context. Respond with <COMPLETE></COMPLETE> tag when the task is complete.]`:"",A=[{type:"human",content:M+_}];await X(A,{extraParams:Q,metadata:W4})},[X,Q]);jZ(()=>{if($)G($);U(!1)},W?100:null);let F=X4.useCallback((M)=>{K(M),z.current=!0,H.current=0,U(!0)},[]);return X4.useEffect(()=>{if(z.current&&$&&!Z){let M=Y.length;if(M>H.current){H.current=M;let _=Y[M-1],A=Q0(_);if(typeof A==="string"&&A.includes("<COMPLETE></COMPLETE>"))z.current=!1,K(null),w4("Ralph 循环完成");else G($)}}},[Z,Y,$,G]),{ralphLoopText:$,startRalphLoop:F,sendTextMessage:G}}var BZ=L(x(),1);var t4=L(x(),1);import tX from"fuzzysort";function N2(Z,Y){if(Y===0)return!0;let X=Z[Y-1];return X===" "||X===`
344
- `||X==="\t"}function _2(Z,Y){let X=Y+1;while(X<Z.length&&!/[\s\n\t]/.test(Z[X]))X++;return Z.slice(Y+1,X)}function w2(Z,Y,X){if(!Y)return Z.slice(0,X).map((K)=>({skill:K,result:null}));let J=Z.map((K)=>({skill:K,name:tX.prepare(K.name.toLowerCase()),description:tX.prepare((K.description||"").toLowerCase())}));return tX.go(Y.toLowerCase(),J,{key:"name",limit:X,threshold:-1e4}).map((K)=>({skill:K.obj.skill,result:K}))}function Y1({skills:Z,maxSuggestions:Y=5}){let[X,J]=t4.useState({visible:!1,query:"",filteredSkills:[],triggerPosition:-1}),Q=t4.useCallback((z,H)=>{let G=z.lastIndexOf("#");if(G===-1){J((_)=>({..._,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}));return}if(!N2(z,G)){J((_)=>({..._,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}));return}let F=_2(z,G),M=w2(Z,F,Y);if(M.length===1&&M[0].skill.name.toLowerCase()===F.toLowerCase()){J((_)=>({..._,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}));return}J((_)=>({..._,visible:!0,query:F,filteredSkills:M,triggerPosition:G}))},[Z.length,Y]),$=t4.useCallback(()=>{if(!X.visible||X.filteredSkills.length===0)return null;return X.filteredSkills[0]?.skill??null},[X.visible,X.filteredSkills]),K=t4.useCallback((z)=>{let H=$();if(!H)return z;let G=z.slice(0,X.triggerPosition),F=z.slice(X.triggerPosition+1+X.query.length);return`${G}#${H.name} ${F}`},[$,X.triggerPosition,X.query]),W=t4.useCallback(()=>{J((z)=>({...z,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}))},[]),U=X.visible&&X.filteredSkills.length>0;return{state:X,checkTrigger:Q,getFirstSkill:$,complete:K,hide:W,isActive:U}}var e4=L(x(),1);function A2(Z,Y){if(Y===0)return!0;let X=Z[Y-1];return X===" "||X===`
345
- `||X==="\t"}function B2(Z,Y){let X=Y+1;while(X<Z.length&&!/[\s\n\t]/.test(Z[X]))X++;return Z.slice(Y+1,X)}function L2(Z,Y,X){let J=Y.toLowerCase(),Q=Z.filter(($)=>{let K=$.name.toLowerCase(),W=$.id.toLowerCase();return K.startsWith(J)||W.includes(J)});return Q.sort(($,K)=>$.name.localeCompare(K.name)),Q.slice(0,X)}function X1({agents:Z,maxSuggestions:Y=5}){let[X,J]=e4.useState({visible:!1,query:"",filteredAgents:[],triggerPosition:-1}),Q=e4.useCallback((z,H)=>{let G=z.lastIndexOf("@");if(G===-1){J((_)=>({..._,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}if(!A2(z,G)){J((_)=>({..._,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}let F=B2(z,G),M=L2(Z,F,Y);if(M.length===1&&M[0].name.toLowerCase()===F.toLowerCase()){J((_)=>({..._,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}J((_)=>({..._,visible:!0,query:F,filteredAgents:M,triggerPosition:G}))},[Z.length,Y]),$=e4.useCallback(()=>{if(!X.visible||X.filteredAgents.length===0)return null;return X.filteredAgents[0]??null},[X.visible,X.filteredAgents]),K=e4.useCallback((z)=>{let H=$();if(!H)return z;let G=z.slice(0,X.triggerPosition),F=z.slice(X.triggerPosition+1+X.query.length);return`${G}@${H.name} ${F}`},[$,X.triggerPosition,X.query]),W=e4.useCallback(()=>{J((z)=>({...z,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}))},[]),U=X.visible&&X.filteredAgents.length>0;return{state:X,checkTrigger:Q,getFirstAgent:$,complete:K,hide:W,isActive:U}}var J1=L(x(),1);var hZ=L(v(),1);function P2({name:Z,result:Y}){if(!Y)return hZ.jsxDEV(O,{color:"cyan",children:Z},void 0,!1,void 0,this);let X=Y.highlight((J)=>hZ.jsxDEV(O,{color:"green",bold:!0,children:J},void 0,!1,void 0,this));if(Array.isArray(X))return hZ.jsxDEV(O,{color:"cyan",children:X.map((J,Q)=>{if(typeof J==="string")return hZ.jsxDEV(O,{children:J},`p-${Q}`,!1,void 0,this);return hZ.jsxDEV(J1.default.Fragment,{children:J},`m-${Q}`,!1,void 0,this)})},void 0,!1,void 0,this);return hZ.jsxDEV(O,{color:"cyan",children:Z},void 0,!1,void 0,this)}var Q1=({visible:Z,skills:Y,query:X,maxVisible:J=5})=>{if(!Z||Y.length===0)return null;let Q=Y.slice(0,J);return hZ.jsxDEV(N,{marginBottom:1,flexDirection:"column",children:[hZ.jsxDEV(O,{color:"yellow",bold:!0,children:"技能建议 (按 → 补全):"},void 0,!1,void 0,this),Q.map(({skill:$,result:K})=>hZ.jsxDEV(N,{children:[hZ.jsxDEV(O,{children:" #"},void 0,!1,void 0,this),hZ.jsxDEV(P2,{name:$.name,result:K},void 0,!1,void 0,this)]},$.name,!0,void 0,this)),Y.length>J&&hZ.jsxDEV(O,{color:"gray",children:["...还有 ",Y.length-J," 个技能"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var DZ=L(v(),1);function R2({name:Z,query:Y}){if(!Y)return DZ.jsxDEV(O,{color:"magenta",children:Z},void 0,!1,void 0,this);let X=Z.toLowerCase(),J=Y.toLowerCase();if(X.startsWith(J))return DZ.jsxDEV(DZ.Fragment,{children:[DZ.jsxDEV(O,{color:"green",bold:!0,children:Z.slice(0,Y.length)},void 0,!1,void 0,this),DZ.jsxDEV(O,{color:"magenta",children:Z.slice(Y.length)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return DZ.jsxDEV(O,{color:"magenta",children:Z},void 0,!1,void 0,this)}var $1=({visible:Z,agents:Y,query:X,maxVisible:J=5})=>{if(!Z||Y.length===0)return null;let Q=Y.slice(0,J);return DZ.jsxDEV(N,{marginBottom:1,flexDirection:"column",children:[DZ.jsxDEV(O,{color:"yellow",bold:!0,children:"Agent 建议 (按 → 补全):"},void 0,!1,void 0,this),Q.map(($)=>DZ.jsxDEV(N,{children:[DZ.jsxDEV(O,{children:" @"},void 0,!1,void 0,this),DZ.jsxDEV(R2,{name:$.name,query:X},void 0,!1,void 0,this),DZ.jsxDEV(O,{dimColor:!0,children:[" - ",$.description]},void 0,!0,void 0,this)]},$.id,!0,void 0,this)),Y.length>J&&DZ.jsxDEV(O,{color:"gray",children:["...还有 ",Y.length-J," 个 Agent"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var W1=L(x(),1);function U1(){let{extraParams:Z}=UZ(),{sendMessage:Y,loading:X}=WZ(),{bufferedMessage:J,clearBuffer:Q}=gY(),$=K1();W1.useEffect(()=>{if(!X&&J.trim()){let K=[{type:"human",content:J}];Q(),Y(K,{extraParams:Z}).then(()=>{w4("Zen Code 完成任务")}).catch((W)=>{console.error("Failed to send buffered message:",W)})}},[X,J,Y,Z,Q,$])}var v4=L(v(),1),z1=({value:Z,onChange:Y,onSubmit:X,loading:J,placeholder:Q="输入消息...",commandHandler:$,skills:K=[],agents:W=[]})=>{U1();let{bufferedMessage:U,setBufferedMessage:z,clearBuffer:H}=gY(),[G,F]=BZ.useState(Z),M=BZ.useRef(!1),_=Y1({skills:K,maxSuggestions:5}),A=X1({agents:W,maxSuggestions:5});BZ.useEffect(()=>{if(Z!==G)M.current=!0,F(Z)},[Z]);let P=BZ.useMemo(()=>G.startsWith("/"),[G]);BZ.useEffect(()=>{if(!P)_.checkTrigger(G),A.checkTrigger(G)},[G,P]);let B=BZ.useCallback((i)=>{if(M.current){M.current=!1;return}F(i),Y(i)},[Y]),C=BZ.useCallback((i)=>{if(!i.trim())return;if(_.hide(),A.hide(),P){X(i),F("");return}if(J)z(i),F("");else X(i),F("")},[P,J,X,z,_,A]),R=BZ.useCallback(()=>{if(A.isActive){A.hide();return}if(_.isActive){_.hide();return}if(U)H();else F("")},[U,H,_.isActive,A.isActive]),D=BZ.useCallback(()=>{if(!P||!$.commandSuggestions||$.commandSuggestions.length===0)return!1;let g=$.commandSuggestions[0],o=(g.displayText||g.command||"")+" ";return B(o),!0},[P,$.commandSuggestions,B]),j=BZ.useCallback(()=>{if(!_.isActive)return!1;let i=_.complete(G);return B(i),_.hide(),!0},[_.isActive,G,B]),E=BZ.useCallback(()=>{if(!A.isActive)return!1;let i=A.complete(G);return B(i),A.hide(),!0},[A.isActive,G,B]),c=BZ.useMemo(()=>{if(J)return U?"按 Esc 清空缓冲区":"AI 响应中,Enter 将消息加入缓冲区";if(P)return"输入命令... (试试 /help,按 → 补全第一个建议)";if(A.isActive)return"按 → 补全 Agent";if(_.isActive)return"按 → 补全技能";return Q},[J,U,P,A.isActive,_.isActive,Q]);return v4.jsxDEV(N,{flexDirection:"column",children:[U&&v4.jsxDEV(N,{padding:1,children:v4.jsxDEV(O,{color:"yellow",children:["\uD83D\uDCDD 缓冲区: ",U.slice(0,50),U.length>50?"...":""]},void 0,!0,void 0,this)},void 0,!1,void 0,this),v4.jsxDEV($.CommandHintUI,{},void 0,!1,void 0,this),v4.jsxDEV($1,{visible:A.state.visible,agents:A.state.filteredAgents,query:A.state.query},void 0,!1,void 0,this),v4.jsxDEV(Q1,{visible:_.state.visible,skills:_.state.filteredSkills,query:_.state.query},void 0,!1,void 0,this),v4.jsxDEV(N,{paddingY:1,children:v4.jsxDEV(oZ,{id:"global-input",value:G,onChange:B,onSubmit:C,onHotKey:(i,g)=>{if(g.escape)return R(),!1;if(g.rightArrow){if(A.isActive){if(E())return!1}if(_.isActive){if(j())return!1}if(D())return!1}return!0},placeholder:c},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};var m0=L(v(),1),eX=uY.memo(()=>{let{userInput:Z,setUserInput:Y,loading:X,renderMessages:J,sendMessage:Q}=WZ(),{extraParams:$,manager:K}=UZ(),{switchToHistory:W,switchToKnowledge:U,switchToSettings:z,switchToModelProvider:H,switchToAgent:G,switchToTask:F,switchToMcp:M,closePanel:_}=J0(),{data:A=[]}=tJ({manager:K}),{data:P=[]}=eJ(),{startRalphLoop:B}=Z1({loading:X,renderMessages:J,sendMessage:Q,setUserInput:Y,extraParams:$}),C=sJ({extraParams:$,switchToHistory:W,switchToKnowledge:U,switchToSettings:z,switchToModelProvider:H,switchToAgent:G,switchToTask:F,switchToMcp:M,closePanel:_,startRalphLoop:B}),R=uY.useCallback(async(D)=>{if(!D)return;if(D.startsWith("/")){if(await C.executeCommand(D)){Y("");return}}await Q([{type:"human",content:D}],{extraParams:$,metadata:W4}),w4("Zen Code 完成任务")},[C,Y]);return m0.jsxDEV(N,{flexDirection:"column",paddingX:0,paddingY:0,borderColor:"grey",borderTop:!0,borderStyle:"single",borderLeft:!1,borderBottom:!1,borderRight:!1,children:[m0.jsxDEV(C.CommandErrorUI,{},void 0,!1,void 0,this),m0.jsxDEV(C.CommandSuccessUI,{},void 0,!1,void 0,this),m0.jsxDEV(z1,{value:Z,onChange:Y,onSubmit:R,loading:X,commandHandler:{isCommandInput:C.isCommandInput,CommandHintUI:C.CommandHintUI,commandSuggestions:C.commandSuggestions},skills:A,agents:P},void 0,!1,void 0,this)]},void 0,!0,void 0,this)});eX.displayName="ChatInput";var xZ=L(v(),1),C2=()=>{let{renderMessages:Z,currentChatId:Y,getToolUIRender:X,loading:J}=WZ(),{compactMode:Q}=UZ(),[$]=H1(Z,50),K=O1.useCallback((W)=>X(W),[X]);return xZ.jsxDEV(N,{flexDirection:"column",flexGrow:1,paddingX:0,paddingY:0,children:[$.length===0&&xZ.jsxDEV(TJ,{},void 0,!1,void 0,this),$.length?Q?xZ.jsxDEV(aX,{renderMessages:$,startIndex:0,staticKey:Y,getToolUIRender:K,loading:J},Y,!1,void 0,this):xZ.jsxDEV(IJ,{loading:J,renderMessages:$,startIndex:0,staticKey:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},Z8=()=>{let{hasPendingInteractions:Z}=uZ();return xZ.jsxDEV(N,{flexDirection:"column",flexGrow:1,children:[xZ.jsxDEV(n,{name:"ChatMessages",fallback:null,children:xZ.jsxDEV(C2,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),xZ.jsxDEV(G1,{children:xZ.jsxDEV(n,{name:"InteractionArea",fallback:null,children:Z?xZ.jsxDEV(N,{paddingX:0,paddingY:0,children:xZ.jsxDEV(KX,{},void 0,!1,void 0,this)},void 0,!1,void 0,this):xZ.jsxDEV(eX,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};Z8.displayName="ChatMain";var q4=L(x(),1);var k4=L(x(),1),q1=k4.lazy(()=>import("./chunk-5gaygdyf.js").then((Z)=>({default:Z.default}))),F1=k4.lazy(()=>import("./chunk-3ek4pcr6.js").then((Z)=>({default:Z.default}))),M1=k4.lazy(()=>import("./chunk-syme57ea.js").then((Z)=>({default:Z.default}))),N1=k4.lazy(()=>import("./chunk-3z87tvcn.js").then((Z)=>({default:Z.default}))),_1=k4.lazy(()=>import("./chunk-r0gjpz5m.js").then((Z)=>({default:Z.default}))),w1=k4.lazy(()=>import("./chunk-f40x0w1g.js").then((Z)=>({default:Z.default}))),A1=k4.lazy(()=>import("./chunk-xb46b3bf.js").then((Z)=>({default:Z.default})));var u=L(v(),1),Z0=()=>u.jsxDEV(N,{paddingX:1,paddingY:1,children:u.jsxDEV(O,{color:"grey",children:"Loading..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y0=(Z)=>u.jsxDEV(N,{paddingX:1,paddingY:1,children:[u.jsxDEV(O,{color:"red",children:["✗ ",Z," panel error"]},void 0,!0,void 0,this),u.jsxDEV(N,{marginTop:1,children:u.jsxDEV(O,{color:"gray",children:"Try reopening or press ESC to return"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y8=q4.memo(()=>{let{activeView:Z,closePanel:Y,handleExecuteTask:X}=J0();return u.jsxDEV(N,{flexGrow:1,flexDirection:"row",children:[Z==="history"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"HistoryPanel",fallback:Y0("History"),children:u.jsxDEV(q1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="knowledge"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"KnowledgePanel",fallback:Y0("Knowledge"),children:u.jsxDEV(F1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="settings"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"SettingsPanel",fallback:Y0("Settings"),children:u.jsxDEV(M1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="model-provider"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"ModelProviderPanel",fallback:Y0("Model Provider"),children:u.jsxDEV(N1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="agent"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"AgentPanel",fallback:Y0("Agent"),children:u.jsxDEV(_1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="task"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"TaskPanel",fallback:Y0("Task"),children:u.jsxDEV(w1,{onClose:Y,onExecuteTask:X},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="mcp"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"McpPanel",fallback:Y0("MCP"),children:u.jsxDEV(A1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)});Y8.displayName="LazyChatViewManager";var Q8=L(x(),1);var B1=L(x(),1);var mY=L(v(),1),L1=()=>{let{renderMessages:Z}=WZ(),Y=B1.default.useMemo(()=>{if(!Z)return null;for(let X=Z.length-1;X>=0;X--){let J=Z[X];if(J.role==="assistant"&&J.content)try{let $=(Array.isArray(J.content)?J.content:[{type:"text",text:J.content}]).find((K)=>K.type==="text")?.text||"";if($.includes("load_mcp_tools"))try{let K=JSON.parse($);if(K.status&&K.status.toolCount!==void 0)return K.status}catch(K){}}catch(Q){}}return null},[Z]);if(!Y||Y.toolCount===0)return null;return mY.jsxDEV(N,{paddingX:1,children:[mY.jsxDEV(O,{color:"green",bold:!0,children:"MCP"},void 0,!1,void 0,this),mY.jsxDEV(O,{color:"cyan",children:[" ",Y.toolCount]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var J4=L(x(),1);function J8(Z){if(Z===0)return"0";if(Z<1024)return`${Z}`;if(Z<1048576)return`${(Z/1024).toFixed(0)}K`;if(Z<1073741824)return`${(Z/1048576).toFixed(0)}M`;return`${(Z/1073741824).toFixed(1)}G`}function P1(Z){let Y=Math.floor(Z/1000),X=Math.floor(Y/3600),J=Math.floor(Y%3600/60),Q=Y%60;if(X>0)return`${X}:${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`;return`${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`}function R1(Z){let[Y,X]=J4.useState(0),J=J4.useRef(null);return J4.useEffect(()=>{if(Z)J.current=Date.now(),X(0);else J.current=null,X(0)},[Z]),X8(()=>{if(J.current)X(Date.now()-J.current)},Z?1000:null),Y}function C1(){let[Z,Y]=J4.useState({cpuPercent:0,memoryRSS:0,memoryHeapUsed:0,memoryHeapTotal:0}),X=J4.useRef(process.cpuUsage()),J=J4.useRef(Date.now()),Q=()=>{let $=Date.now(),K=process.cpuUsage(),W=process.memoryUsage(),U=$-J.current,z=K.user-X.current.user,H=K.system-X.current.system,F=(z+H)/1000/U*100;Y({cpuPercent:Math.min(100,Math.max(0,F)),memoryRSS:W.rss,memoryHeapUsed:W.heapUsed,memoryHeapTotal:W.heapTotal}),X.current=K,J.current=$};return J4.useEffect(()=>{Q()},[]),X8(Q,2000),Z}function v1(Z){if(Z<50)return"green";if(Z<80)return"yellow";return"red"}function I1(Z,Y){if(Y===0)return"gray";let X=Z/Y*100;if(X<50)return"green";if(X<80)return"yellow";return"red"}var I4=L(v(),1),v2=()=>{let Z=C1(),Y=v1(Z.cpuPercent),X=I1(Z.memoryHeapUsed,Z.memoryHeapTotal);return I4.jsxDEV(N,{paddingX:1,width:"100%",children:I4.jsxDEV(N,{gap:2,children:[I4.jsxDEV(N,{children:[I4.jsxDEV(O,{dimColor:!0,children:"CPU:"},void 0,!1,void 0,this),I4.jsxDEV(O,{color:Y,children:[" ",Z.cpuPercent.toFixed(0),"%"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I4.jsxDEV(N,{children:[I4.jsxDEV(O,{dimColor:!0,children:"MEM:"},void 0,!1,void 0,this),I4.jsxDEV(O,{color:X,children:[J8(Z.memoryHeapUsed),"/",J8(Z.memoryRSS)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},D1=v2;var _Z=L(v(),1);import I2 from"path";var D2=()=>{let{extraParams:Z,compactMode:Y,showDetailedInfo:X}=UZ(),{currentChatId:J,renderMessages:Q}=WZ(),{loading:$,stopGeneration:K}=WZ(),W=process.env.YOLO_MODE==="true",U=Q8.default.useCallback((M,_)=>{if(_.ctrl&&M==="c")process.exit()},[$,K]);mZ(U);let z=R1($),H=Q8.default.useMemo(()=>{return I2.basename(process.cwd())},[]),F=(Q?.length||0)>100;return _Z.jsxDEV(N,{flexDirection:"column",width:"100%",children:[_Z.jsxDEV(N,{paddingX:1,paddingY:0,justifyContent:"space-between",width:"100%",marginBottom:1,children:[_Z.jsxDEV(N,{gap:1,children:[$&&_Z.jsxDEV(O,{color:"yellow",bold:!0,children:_Z.jsxDEV(V1,{text:"LOADING"},void 0,!1,void 0,this)},void 0,!1,void 0,this),!$&&_Z.jsxDEV(O,{color:"magenta",bold:!0,children:"Zen Code"},void 0,!1,void 0,this),_Z.jsxDEV(O,{color:"cyan",bold:!0,children:[" ",Z.model_id]},void 0,!0,void 0,this),_Z.jsxDEV(O,{color:"yellow",bold:!0,children:[" ","@",Z.switch_command||"default"]},void 0,!0,void 0,this),!Y&&_Z.jsxDEV(O,{color:"blue",bold:!0,children:[" ","[FULL]"]},void 0,!0,void 0,this),W&&_Z.jsxDEV(O,{color:"red",bold:!0,children:[" ","YOLO"]},void 0,!0,void 0,this),_Z.jsxDEV(L1,{},void 0,!1,void 0,this),F&&_Z.jsxDEV(O,{color:"red",bold:!0,children:[" ","/summary"]},void 0,!0,void 0,this),_Z.jsxDEV(O,{color:"green",bold:!0,children:Q.length},void 0,!1,void 0,this),_Z.jsxDEV(O,{color:"blue",children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$&&_Z.jsxDEV(N,{children:_Z.jsxDEV(O,{color:"yellow",children:P1(z)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X&&_Z.jsxDEV(D1,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E1=D2;var a=L(v(),1),V2=()=>{let{activeView:Z}=J0();return a.jsxDEV(N,{flexDirection:"column",width:"100%",children:[a.jsxDEV(N,{flexGrow:1,flexDirection:"row",children:[a.jsxDEV(n,{name:"ChatMain",fallback:a.jsxDEV(O,{color:"yellow",children:"Chat view unavailable"},void 0,!1,void 0,this),children:Z==="chat"?a.jsxDEV(Z8,{},void 0,!1,void 0,this):null},void 0,!1,void 0,this),a.jsxDEV(n,{name:"PanelView",fallback:a.jsxDEV(O,{color:"yellow",children:"Panel unavailable"},void 0,!1,void 0,this),children:Z!=="chat"?a.jsxDEV(Y8,{},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a.jsxDEV(n,{name:"StatusBar",fallback:null,children:a.jsxDEV(E1,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E2=()=>{return a.jsxDEV(n,{name:"Chat",children:a.jsxDEV(P5,{children:a.jsxDEV(V2,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},b2=()=>{return a.jsxDEV(n,{name:"AppRoot",children:a.jsxDEV(b1,{apiUrl:"http://127.0.0.1:8123",defaultAgent:"code",defaultHeaders:{},withCredentials:!1,showHistory:!1,showGraph:!1,onInitError:(Z,Y)=>{console.error(Z,Y)},fetch:C8,autoRestoreLastSession:!0,historyFilter:{metadata:{path:process.cwd()}},children:a.jsxDEV(n,{name:"TanStackQueryProvider",children:a.jsxDEV(H8,{children:a.jsxDEV(n,{name:"SettingsProvider",children:a.jsxDEV(f1,{get_allowed_models:v8,children:a.jsxDEV(n,{name:"ApprovalProvider",children:a.jsxDEV(T1,{children:a.jsxDEV(n,{name:"InteractionProvider",children:a.jsxDEV(d0,{children:a.jsxDEV(E2,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},T2=()=>a.jsxDEV(b2,{},void 0,!1,void 0,this),$8=T2;var Q4=L(v(),1),f2=({error:Z})=>Q4.jsxDEV(N,{flexDirection:"column",padding:2,borderStyle:"double",borderColor:"red",children:[Q4.jsxDEV(O,{color:"red",bold:!0,children:"✗ Application Crashed"},void 0,!1,void 0,this),Q4.jsxDEV(N,{marginTop:1,children:Q4.jsxDEV(O,{color:"red",children:Z.message},void 0,!1,void 0,this)},void 0,!1,void 0,this),Q4.jsxDEV(N,{marginTop:1,children:Q4.jsxDEV(O,{color:"gray",children:["Stack: ",Z.stack?.split(`
337
+ [System Context: You are currently in Ralph loop mode. Continue executing the task based on previous context. Respond with <COMPLETE></COMPLETE> tag when the task is complete.]`:"",w=[{type:"human",content:M+N}];await X(w,{extraParams:Q,metadata:U4})},[X,Q]);TZ(()=>{if($)G($);W(!1)},U?100:null);let F=Z4.useCallback((M)=>{K(M),z.current=!0,H.current=0,W(!0)},[]);return Z4.useEffect(()=>{if(z.current&&$&&!Z){let M=Y.length;if(M>H.current){H.current=M;let N=Y[M-1],w=J0(N);if(typeof w==="string"&&w.includes("<COMPLETE></COMPLETE>"))z.current=!1,K(null),N4("Ralph 循环完成");else G($)}}},[Z,Y,$,G]),{ralphLoopText:$,startRalphLoop:F,sendTextMessage:G}}var wZ=P(g(),1);var e4=P(g(),1);import eX from"fuzzysort";function _2(Z,Y){if(Y===0)return!0;let X=Z[Y-1];return X===" "||X===`
338
+ `||X==="\t"}function A2(Z,Y){let X=Y+1;while(X<Z.length&&!/[\s\n\t]/.test(Z[X]))X++;return Z.slice(Y+1,X)}function w2(Z,Y,X){if(!Y)return Z.slice(0,X).map((K)=>({skill:K,result:null}));let J=Z.map((K)=>({skill:K,name:eX.prepare(K.name.toLowerCase()),description:eX.prepare((K.description||"").toLowerCase())}));return eX.go(Y.toLowerCase(),J,{key:"name",limit:X,threshold:-1e4}).map((K)=>({skill:K.obj.skill,result:K}))}function eJ({skills:Z,maxSuggestions:Y=5}){let[X,J]=e4.useState({visible:!1,query:"",filteredSkills:[],triggerPosition:-1}),Q=e4.useCallback((z,H)=>{let G=z.lastIndexOf("#");if(G===-1){J((N)=>({...N,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}));return}if(!_2(z,G)){J((N)=>({...N,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}));return}let F=A2(z,G),M=w2(Z,F,Y);if(M.length===1&&M[0].skill.name.toLowerCase()===F.toLowerCase()){J((N)=>({...N,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}));return}J((N)=>({...N,visible:!0,query:F,filteredSkills:M,triggerPosition:G}))},[Z.length,Y]),$=e4.useCallback(()=>{if(!X.visible||X.filteredSkills.length===0)return null;return X.filteredSkills[0]?.skill??null},[X.visible,X.filteredSkills]),K=e4.useCallback((z)=>{let H=$();if(!H)return z;let G=z.slice(0,X.triggerPosition),F=z.slice(X.triggerPosition+1+X.query.length);return`${G}#${H.name} ${F}`},[$,X.triggerPosition,X.query]),U=e4.useCallback(()=>{J((z)=>({...z,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}))},[]),W=X.visible&&X.filteredSkills.length>0;return{state:X,checkTrigger:Q,getFirstSkill:$,complete:K,hide:U,isActive:W}}var Z0=P(g(),1);function B2(Z,Y){if(Y===0)return!0;let X=Z[Y-1];return X===" "||X===`
339
+ `||X==="\t"}function L2(Z,Y){let X=Y+1;while(X<Z.length&&!/[\s\n\t]/.test(Z[X]))X++;return Z.slice(Y+1,X)}function P2(Z,Y,X){let J=Y.toLowerCase(),Q=Z.filter(($)=>{let K=$.name.toLowerCase(),U=$.id.toLowerCase();return K.startsWith(J)||U.includes(J)});return Q.sort(($,K)=>$.name.localeCompare(K.name)),Q.slice(0,X)}function Z1({agents:Z,maxSuggestions:Y=5}){let[X,J]=Z0.useState({visible:!1,query:"",filteredAgents:[],triggerPosition:-1}),Q=Z0.useCallback((z,H)=>{let G=z.lastIndexOf("@");if(G===-1){J((N)=>({...N,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}if(!B2(z,G)){J((N)=>({...N,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}let F=L2(z,G),M=P2(Z,F,Y);if(M.length===1&&M[0].name.toLowerCase()===F.toLowerCase()){J((N)=>({...N,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}J((N)=>({...N,visible:!0,query:F,filteredAgents:M,triggerPosition:G}))},[Z.length,Y]),$=Z0.useCallback(()=>{if(!X.visible||X.filteredAgents.length===0)return null;return X.filteredAgents[0]??null},[X.visible,X.filteredAgents]),K=Z0.useCallback((z)=>{let H=$();if(!H)return z;let G=z.slice(0,X.triggerPosition),F=z.slice(X.triggerPosition+1+X.query.length);return`${G}@${H.name} ${F}`},[$,X.triggerPosition,X.query]),U=Z0.useCallback(()=>{J((z)=>({...z,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}))},[]),W=X.visible&&X.filteredAgents.length>0;return{state:X,checkTrigger:Q,getFirstAgent:$,complete:K,hide:U,isActive:W}}var Y1=P(g(),1);var yZ=P(I(),1);function R2({name:Z,result:Y}){if(!Y)return yZ.jsxDEV(O,{color:"cyan",children:Z},void 0,!1,void 0,this);let X=Y.highlight((J)=>yZ.jsxDEV(O,{color:"green",bold:!0,children:J},void 0,!1,void 0,this));if(Array.isArray(X))return yZ.jsxDEV(O,{color:"cyan",children:X.map((J,Q)=>{if(typeof J==="string")return yZ.jsxDEV(O,{children:J},`p-${Q}`,!1,void 0,this);return yZ.jsxDEV(Y1.default.Fragment,{children:J},`m-${Q}`,!1,void 0,this)})},void 0,!1,void 0,this);return yZ.jsxDEV(O,{color:"cyan",children:Z},void 0,!1,void 0,this)}var X1=({visible:Z,skills:Y,query:X,maxVisible:J=5})=>{if(!Z||Y.length===0)return null;let Q=Y.slice(0,J);return yZ.jsxDEV(_,{marginBottom:1,flexDirection:"column",children:[yZ.jsxDEV(O,{color:"yellow",bold:!0,children:"技能建议 (按 → 补全):"},void 0,!1,void 0,this),Q.map(({skill:$,result:K})=>yZ.jsxDEV(_,{children:[yZ.jsxDEV(O,{children:" #"},void 0,!1,void 0,this),yZ.jsxDEV(R2,{name:$.name,result:K},void 0,!1,void 0,this)]},$.name,!0,void 0,this)),Y.length>J&&yZ.jsxDEV(O,{color:"gray",children:["...还有 ",Y.length-J," 个技能"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var vZ=P(I(),1);function C2({name:Z,query:Y}){if(!Y)return vZ.jsxDEV(O,{color:"magenta",children:Z},void 0,!1,void 0,this);let X=Z.toLowerCase(),J=Y.toLowerCase();if(X.startsWith(J))return vZ.jsxDEV(vZ.Fragment,{children:[vZ.jsxDEV(O,{color:"green",bold:!0,children:Z.slice(0,Y.length)},void 0,!1,void 0,this),vZ.jsxDEV(O,{color:"magenta",children:Z.slice(Y.length)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return vZ.jsxDEV(O,{color:"magenta",children:Z},void 0,!1,void 0,this)}var J1=({visible:Z,agents:Y,query:X,maxVisible:J=5})=>{if(!Z||Y.length===0)return null;let Q=Y.slice(0,J);return vZ.jsxDEV(_,{marginBottom:1,flexDirection:"column",children:[vZ.jsxDEV(O,{color:"yellow",bold:!0,children:"Agent 建议 (按 → 补全):"},void 0,!1,void 0,this),Q.map(($)=>vZ.jsxDEV(_,{children:[vZ.jsxDEV(O,{children:" @"},void 0,!1,void 0,this),vZ.jsxDEV(C2,{name:$.name,query:X},void 0,!1,void 0,this),vZ.jsxDEV(O,{dimColor:!0,children:[" - ",$.description]},void 0,!0,void 0,this)]},$.id,!0,void 0,this)),Y.length>J&&vZ.jsxDEV(O,{color:"gray",children:["...还有 ",Y.length-J," 个 Agent"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var $1=P(g(),1);function K1(){let{extraParams:Z}=UZ(),{sendMessage:Y,loading:X}=WZ(),{bufferedMessage:J,clearBuffer:Q}=uY(),$=Q1();$1.useEffect(()=>{if(!X&&J.trim()){let K=[{type:"human",content:J}];Q(),Y(K,{extraParams:Z}).then(()=>{N4("Zen Code 完成任务")}).catch((U)=>{console.error("Failed to send buffered message:",U)})}},[X,J,Y,Z,Q,$])}var R4=P(I(),1),W1=({value:Z,onChange:Y,onSubmit:X,loading:J,placeholder:Q="输入消息...",commandHandler:$,skills:K=[],agents:U=[]})=>{K1();let{bufferedMessage:W,setBufferedMessage:z,clearBuffer:H}=uY(),[G,F]=wZ.useState(Z),M=wZ.useRef(!1),N=eJ({skills:K,maxSuggestions:5}),w=Z1({agents:U,maxSuggestions:5});wZ.useEffect(()=>{if(Z!==G)M.current=!0,F(Z)},[Z]);let L=wZ.useMemo(()=>G.startsWith("/"),[G]);wZ.useEffect(()=>{if(!L)N.checkTrigger(G),w.checkTrigger(G)},[G,L]);let B=wZ.useCallback((l)=>{if(M.current){M.current=!1;return}F(l),Y(l)},[Y]),C=wZ.useCallback((l)=>{if(!l.trim())return;if(N.hide(),w.hide(),L){X(l),F("");return}if(J)z(l),F("");else X(l),F("")},[L,J,X,z,N,w]),R=wZ.useCallback(()=>{if(w.isActive){w.hide();return}if(N.isActive){N.hide();return}if(W)H();else F("")},[W,H,N.isActive,w.isActive]),D=wZ.useCallback(()=>{if(!L||!$.commandSuggestions||$.commandSuggestions.length===0)return!1;let u=$.commandSuggestions[0],i=(u.displayText||u.command||"")+" ";return B(i),!0},[L,$.commandSuggestions,B]),f=wZ.useCallback(()=>{if(!N.isActive)return!1;let l=N.complete(G);return B(l),N.hide(),!0},[N.isActive,G,B]),V=wZ.useCallback(()=>{if(!w.isActive)return!1;let l=w.complete(G);return B(l),w.hide(),!0},[w.isActive,G,B]),d=wZ.useMemo(()=>{if(J)return W?"按 Esc 清空缓冲区":"AI 响应中,Enter 将消息加入缓冲区";if(L)return"输入命令... (试试 /help,按 → 补全第一个建议)";if(w.isActive)return"按 → 补全 Agent";if(N.isActive)return"按 → 补全技能";return Q},[J,W,L,w.isActive,N.isActive,Q]);return R4.jsxDEV(_,{flexDirection:"column",children:[W&&R4.jsxDEV(_,{padding:1,children:R4.jsxDEV(O,{color:"yellow",children:["\uD83D\uDCDD 缓冲区: ",W.slice(0,50),W.length>50?"...":""]},void 0,!0,void 0,this)},void 0,!1,void 0,this),R4.jsxDEV($.CommandHintUI,{},void 0,!1,void 0,this),R4.jsxDEV(J1,{visible:w.state.visible,agents:w.state.filteredAgents,query:w.state.query},void 0,!1,void 0,this),R4.jsxDEV(X1,{visible:N.state.visible,skills:N.state.filteredSkills,query:N.state.query},void 0,!1,void 0,this),R4.jsxDEV(_,{paddingY:1,children:R4.jsxDEV(iZ,{id:"global-input",value:G,onChange:B,onSubmit:C,onHotKey:(l,u)=>{if(u.escape)return R(),!1;if(u.rightArrow){if(w.isActive){if(V())return!1}if(N.isActive){if(f())return!1}if(D())return!1}return!0},placeholder:d},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};var u0=P(I(),1),Z8=mY.memo(()=>{let{userInput:Z,setUserInput:Y,loading:X,renderMessages:J,sendMessage:Q}=WZ(),{extraParams:$,manager:K}=UZ(),{switchToHistory:U,switchToKnowledge:W,switchToSettings:z,switchToModelProvider:H,switchToAgent:G,switchToTask:F,switchToMcp:M,switchToProcess:N,closePanel:w}=X0(),{data:L=[]}=aJ({manager:K}),{data:B=[]}=sJ(),{startRalphLoop:C}=tJ({loading:X,renderMessages:J,sendMessage:Q,setUserInput:Y,extraParams:$}),R=nJ({extraParams:$,switchToHistory:U,switchToKnowledge:W,switchToSettings:z,switchToModelProvider:H,switchToAgent:G,switchToTask:F,switchToMcp:M,switchToProcess:N,closePanel:w,startRalphLoop:C}),D=mY.useCallback(async(f)=>{if(!f)return;if(f.startsWith("/")){if(await R.executeCommand(f)){Y("");return}}await Q([{type:"human",content:f}],{extraParams:$,metadata:U4}),N4("Zen Code 完成任务")},[R,Y]);return u0.jsxDEV(_,{flexDirection:"column",paddingX:0,paddingY:0,borderColor:"grey",borderTop:!0,borderStyle:"single",borderLeft:!1,borderBottom:!1,borderRight:!1,children:[u0.jsxDEV(R.CommandErrorUI,{},void 0,!1,void 0,this),u0.jsxDEV(R.CommandSuccessUI,{},void 0,!1,void 0,this),u0.jsxDEV(W1,{value:Z,onChange:Y,onSubmit:D,loading:X,commandHandler:{isCommandInput:R.isCommandInput,CommandHintUI:R.CommandHintUI,commandSuggestions:R.commandSuggestions},skills:L,agents:B},void 0,!1,void 0,this)]},void 0,!0,void 0,this)});Z8.displayName="ChatInput";var kZ=P(I(),1),I2=()=>{let{renderMessages:Z,currentChatId:Y,getToolUIRender:X,loading:J}=WZ(),{compactMode:Q}=UZ(),[$]=U1(Z,50),K=H1.useCallback((U)=>X(U),[X]);return kZ.jsxDEV(_,{flexDirection:"column",flexGrow:1,paddingX:0,paddingY:0,children:[$.length===0&&kZ.jsxDEV(EJ,{},void 0,!1,void 0,this),$.length?Q?kZ.jsxDEV(sX,{renderMessages:$,startIndex:0,staticKey:Y,getToolUIRender:K,loading:J},Y,!1,void 0,this):kZ.jsxDEV(CJ,{loading:J,renderMessages:$,startIndex:0,staticKey:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},Y8=()=>{let{hasPendingInteractions:Z}=xZ();return kZ.jsxDEV(_,{flexDirection:"column",flexGrow:1,children:[kZ.jsxDEV(r,{name:"ChatMessages",fallback:null,children:kZ.jsxDEV(I2,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),kZ.jsxDEV(z1,{children:kZ.jsxDEV(r,{name:"InteractionArea",fallback:null,children:Z?kZ.jsxDEV(_,{paddingX:0,paddingY:0,children:kZ.jsxDEV(WX,{},void 0,!1,void 0,this)},void 0,!1,void 0,this):kZ.jsxDEV(Z8,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};Y8.displayName="ChatMain";var Y4=P(g(),1);var C4=P(g(),1),G1=C4.lazy(()=>import("./chunk-a4vdvjsr.js").then((Z)=>({default:Z.default}))),O1=C4.lazy(()=>import("./chunk-tqh0rjpp.js").then((Z)=>({default:Z.default}))),q1=C4.lazy(()=>import("./chunk-wb6xn1kx.js").then((Z)=>({default:Z.default}))),F1=C4.lazy(()=>import("./chunk-n0sxg10w.js").then((Z)=>({default:Z.default}))),M1=C4.lazy(()=>import("./chunk-edkft0pe.js").then((Z)=>({default:Z.default}))),N1=C4.lazy(()=>import("./chunk-7d4h6qkf.js").then((Z)=>({default:Z.default}))),_1=C4.lazy(()=>import("./chunk-eemwtwb1.js").then((Z)=>({default:Z.default}))),A1=C4.lazy(()=>import("./chunk-6mcx89fj.js").then((Z)=>({default:Z.default})));var h=P(I(),1),S4=()=>h.jsxDEV(_,{paddingX:1,paddingY:1,children:h.jsxDEV(O,{color:"grey",children:"Loading..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),y4=(Z)=>h.jsxDEV(_,{paddingX:1,paddingY:1,children:[h.jsxDEV(O,{color:"red",children:["✗ ",Z," panel error"]},void 0,!0,void 0,this),h.jsxDEV(_,{marginTop:1,children:h.jsxDEV(O,{color:"gray",children:"Try reopening or press ESC to return"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X8=Y4.memo(()=>{let{activeView:Z,closePanel:Y,handleExecuteTask:X}=X0();return h.jsxDEV(_,{flexGrow:1,flexDirection:"row",children:[Z==="history"&&h.jsxDEV(Y4.Suspense,{fallback:h.jsxDEV(S4,{},void 0,!1,void 0,this),children:h.jsxDEV(r,{name:"HistoryPanel",fallback:y4("History"),children:h.jsxDEV(G1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="knowledge"&&h.jsxDEV(Y4.Suspense,{fallback:h.jsxDEV(S4,{},void 0,!1,void 0,this),children:h.jsxDEV(r,{name:"KnowledgePanel",fallback:y4("Knowledge"),children:h.jsxDEV(O1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="settings"&&h.jsxDEV(Y4.Suspense,{fallback:h.jsxDEV(S4,{},void 0,!1,void 0,this),children:h.jsxDEV(r,{name:"SettingsPanel",fallback:y4("Settings"),children:h.jsxDEV(q1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="model-provider"&&h.jsxDEV(Y4.Suspense,{fallback:h.jsxDEV(S4,{},void 0,!1,void 0,this),children:h.jsxDEV(r,{name:"ModelProviderPanel",fallback:y4("Model Provider"),children:h.jsxDEV(F1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="agent"&&h.jsxDEV(Y4.Suspense,{fallback:h.jsxDEV(S4,{},void 0,!1,void 0,this),children:h.jsxDEV(r,{name:"AgentPanel",fallback:y4("Agent"),children:h.jsxDEV(M1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="task"&&h.jsxDEV(Y4.Suspense,{fallback:h.jsxDEV(S4,{},void 0,!1,void 0,this),children:h.jsxDEV(r,{name:"TaskPanel",fallback:y4("Task"),children:h.jsxDEV(N1,{onClose:Y,onExecuteTask:X},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="mcp"&&h.jsxDEV(Y4.Suspense,{fallback:h.jsxDEV(S4,{},void 0,!1,void 0,this),children:h.jsxDEV(r,{name:"McpPanel",fallback:y4("MCP"),children:h.jsxDEV(_1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="process"&&h.jsxDEV(Y4.Suspense,{fallback:h.jsxDEV(S4,{},void 0,!1,void 0,this),children:h.jsxDEV(r,{name:"ProcessPanel",fallback:y4("Process"),children:h.jsxDEV(A1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)});X8.displayName="LazyChatViewManager";var k4=P(g(),1);var w1=P(g(),1);var pY=P(I(),1),B1=()=>{let{renderMessages:Z}=WZ(),Y=w1.default.useMemo(()=>{if(!Z)return null;for(let X=Z.length-1;X>=0;X--){let J=Z[X];if(J.role==="assistant"&&J.content)try{let $=(Array.isArray(J.content)?J.content:[{type:"text",text:J.content}]).find((K)=>K.type==="text")?.text||"";if($.includes("load_mcp_tools"))try{let K=JSON.parse($);if(K.status&&K.status.toolCount!==void 0)return K.status}catch(K){}}catch(Q){}}return null},[Z]);if(!Y||Y.toolCount===0)return null;return pY.jsxDEV(_,{paddingX:1,children:[pY.jsxDEV(O,{color:"green",bold:!0,children:"MCP"},void 0,!1,void 0,this),pY.jsxDEV(O,{color:"cyan",children:[" ",Y.toolCount]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var X4=P(g(),1);function Q8(Z){if(Z===0)return"0";if(Z<1024)return`${Z}`;if(Z<1048576)return`${(Z/1024).toFixed(0)}K`;if(Z<1073741824)return`${(Z/1048576).toFixed(0)}M`;return`${(Z/1073741824).toFixed(1)}G`}function L1(Z){let Y=Math.floor(Z/1000),X=Math.floor(Y/3600),J=Math.floor(Y%3600/60),Q=Y%60;if(X>0)return`${X}:${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`;return`${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`}function P1(Z){let[Y,X]=X4.useState(0),J=X4.useRef(null);return X4.useEffect(()=>{if(Z)J.current=Date.now(),X(0);else J.current=null,X(0)},[Z]),J8(()=>{if(J.current)X(Date.now()-J.current)},Z?1000:null),Y}function R1(){let[Z,Y]=X4.useState({cpuPercent:0,memoryRSS:0,memoryHeapUsed:0,memoryHeapTotal:0}),X=X4.useRef(process.cpuUsage()),J=X4.useRef(Date.now()),Q=()=>{let $=Date.now(),K=process.cpuUsage(),U=process.memoryUsage(),W=$-J.current,z=K.user-X.current.user,H=K.system-X.current.system,F=(z+H)/1000/W*100;Y({cpuPercent:Math.min(100,Math.max(0,F)),memoryRSS:U.rss,memoryHeapUsed:U.heapUsed,memoryHeapTotal:U.heapTotal}),X.current=K,J.current=$};return X4.useEffect(()=>{Q()},[]),J8(Q,2000),Z}function C1(Z){if(Z<50)return"green";if(Z<80)return"yellow";return"red"}function I1(Z,Y){if(Y===0)return"gray";let X=Z/Y*100;if(X<50)return"green";if(X<80)return"yellow";return"red"}var I4=P(I(),1),v2=()=>{let Z=R1(),Y=C1(Z.cpuPercent),X=I1(Z.memoryHeapUsed,Z.memoryHeapTotal);return I4.jsxDEV(_,{paddingX:1,width:"100%",children:I4.jsxDEV(_,{gap:2,children:[I4.jsxDEV(_,{children:[I4.jsxDEV(O,{dimColor:!0,children:"CPU:"},void 0,!1,void 0,this),I4.jsxDEV(O,{color:Y,children:[" ",Z.cpuPercent.toFixed(0),"%"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I4.jsxDEV(_,{children:[I4.jsxDEV(O,{dimColor:!0,children:"MEM:"},void 0,!1,void 0,this),I4.jsxDEV(O,{color:X,children:[Q8(Z.memoryHeapUsed),"/",Q8(Z.memoryRSS)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},v1=v2;var qZ=P(I(),1);import D2 from"path";var V2=()=>{let{extraParams:Z,compactMode:Y,showDetailedInfo:X}=UZ(),{currentChatId:J,renderMessages:Q}=WZ(),{loading:$,stopGeneration:K}=WZ(),U=process.env.YOLO_MODE==="true",[W,z]=k4.useState(0);k4.useEffect(()=>{let w=async()=>{let B=await V1.getProcessList();z(B.length)};w();let L=setInterval(w,2000);return()=>clearInterval(L)},[]);let H=k4.useCallback((w,L)=>{if(L.ctrl&&w==="c")process.exit()},[$,K]);uZ(H);let G=P1($),F=k4.default.useMemo(()=>{return D2.basename(process.cwd())},[]),N=(Q?.length||0)>100;return qZ.jsxDEV(_,{flexDirection:"column",width:"100%",children:[qZ.jsxDEV(_,{paddingX:1,paddingY:0,justifyContent:"space-between",width:"100%",marginBottom:1,children:[qZ.jsxDEV(_,{gap:1,children:[$&&qZ.jsxDEV(O,{color:"yellow",bold:!0,children:qZ.jsxDEV(D1,{text:"LOADING"},void 0,!1,void 0,this)},void 0,!1,void 0,this),!$&&qZ.jsxDEV(O,{color:"magenta",bold:!0,children:"Zen Code"},void 0,!1,void 0,this),qZ.jsxDEV(O,{color:"cyan",bold:!0,children:[" ",Z.model_id]},void 0,!0,void 0,this),qZ.jsxDEV(O,{color:"yellow",bold:!0,children:[" ","@",Z.switch_command||"default"]},void 0,!0,void 0,this),!Y&&qZ.jsxDEV(O,{color:"blue",bold:!0,children:[" ","[FULL]"]},void 0,!0,void 0,this),U&&qZ.jsxDEV(O,{color:"red",bold:!0,children:[" ","YOLO"]},void 0,!0,void 0,this),qZ.jsxDEV(B1,{},void 0,!1,void 0,this),W>0&&qZ.jsxDEV(O,{color:"magenta",bold:!0,children:[" ","● BG (",W,")"]},void 0,!0,void 0,this),N&&qZ.jsxDEV(O,{color:"red",bold:!0,children:[" ","/summary"]},void 0,!0,void 0,this),qZ.jsxDEV(O,{color:"green",bold:!0,children:Q.length},void 0,!1,void 0,this),qZ.jsxDEV(O,{color:"blue",children:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$&&qZ.jsxDEV(_,{children:qZ.jsxDEV(O,{color:"yellow",children:L1(G)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X&&qZ.jsxDEV(v1,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E1=V2;var a=P(I(),1),E2=()=>{let{activeView:Z}=X0();return a.jsxDEV(_,{flexDirection:"column",width:"100%",children:[a.jsxDEV(_,{flexGrow:1,flexDirection:"row",children:[a.jsxDEV(r,{name:"ChatMain",fallback:a.jsxDEV(O,{color:"yellow",children:"Chat view unavailable"},void 0,!1,void 0,this),children:Z==="chat"?a.jsxDEV(Y8,{},void 0,!1,void 0,this):null},void 0,!1,void 0,this),a.jsxDEV(r,{name:"PanelView",fallback:a.jsxDEV(O,{color:"yellow",children:"Panel unavailable"},void 0,!1,void 0,this),children:Z!=="chat"?a.jsxDEV(X8,{},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a.jsxDEV(r,{name:"StatusBar",fallback:null,children:a.jsxDEV(E1,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},b2=()=>{return a.jsxDEV(r,{name:"Chat",children:a.jsxDEV(B5,{children:a.jsxDEV(E2,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},T2=()=>{return a.jsxDEV(r,{name:"AppRoot",children:a.jsxDEV(b1,{apiUrl:"http://127.0.0.1:8123",defaultAgent:"code",defaultHeaders:{},withCredentials:!1,showHistory:!1,showGraph:!1,onInitError:(Z,Y)=>{console.error(Z,Y)},fetch:C8,autoRestoreLastSession:!0,historyFilter:{metadata:{path:process.cwd()}},children:a.jsxDEV(r,{name:"TanStackQueryProvider",children:a.jsxDEV(H8,{children:a.jsxDEV(r,{name:"SettingsProvider",children:a.jsxDEV(f1,{get_allowed_models:I8,children:a.jsxDEV(r,{name:"ApprovalProvider",children:a.jsxDEV(T1,{children:a.jsxDEV(r,{name:"InteractionProvider",children:a.jsxDEV(l0,{children:a.jsxDEV(b2,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},f2=()=>a.jsxDEV(T2,{},void 0,!1,void 0,this),$8=f2;var J4=P(I(),1),j2=({error:Z})=>J4.jsxDEV(_,{flexDirection:"column",padding:2,borderStyle:"double",borderColor:"red",children:[J4.jsxDEV(O,{color:"red",bold:!0,children:"✗ Application Crashed"},void 0,!1,void 0,this),J4.jsxDEV(_,{marginTop:1,children:J4.jsxDEV(O,{color:"red",children:Z.message},void 0,!1,void 0,this)},void 0,!1,void 0,this),J4.jsxDEV(_,{marginTop:1,children:J4.jsxDEV(O,{color:"gray",children:["Stack: ",Z.stack?.split(`
346
340
  `).slice(0,3).join(`
347
- `)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Q4.jsxDEV(N,{marginTop:1,children:Q4.jsxDEV(O,{color:"blue",children:"Press Ctrl+C to exit"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);try{K8(Q4.jsxDEV($8,{},void 0,!1,void 0,this),{exitOnCtrlC:!1})}catch(Z){console.error("Critical rendering error:",Z),K8(Q4.jsxDEV(f2,{error:Z},void 0,!1,void 0,this))}process.on("unhandledRejection",(Z,Y)=>{console.error("Unhandled Rejection at:",Y,"reason:",Z)});process.on("uncaughtException",(Z)=>{console.error("Uncaught Exception:",Z)});
341
+ `)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),J4.jsxDEV(_,{marginTop:1,children:J4.jsxDEV(O,{color:"blue",children:"Press Ctrl+C to exit"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);try{K8(J4.jsxDEV($8,{},void 0,!1,void 0,this),{exitOnCtrlC:!1})}catch(Z){console.error("Critical rendering error:",Z),K8(J4.jsxDEV(j2,{error:Z},void 0,!1,void 0,this))}process.on("unhandledRejection",(Z,Y)=>{console.error("Unhandled Rejection at:",Y,"reason:",Z)});process.on("uncaughtException",(Z)=>{console.error("Uncaught Exception:",Z)});