@qitqode/qitqode-android-arm64 0.2.6 → 0.2.7

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 (410) hide show
  1. package/bundle/{chunk-ztyy3ga3.js → chunk-01e3v1xz.js} +2 -2
  2. package/bundle/{chunk-p54bzjtv.js → chunk-060wbpz4.js} +1 -1
  3. package/bundle/{chunk-ypdt9mmr.js → chunk-0am156m5.js} +2 -2
  4. package/bundle/{chunk-gjd3wf8b.js → chunk-0bgssfvq.js} +1 -1
  5. package/bundle/{chunk-dnnkq5y4.js → chunk-0crgymtr.js} +2 -2
  6. package/bundle/chunk-0dzpjk7x.js +2 -0
  7. package/bundle/{chunk-bwbqkfv0.js → chunk-0ffmwhw7.js} +1 -1
  8. package/bundle/{chunk-h62chdmw.js → chunk-0g0jpw0z.js} +1 -1
  9. package/bundle/{chunk-mn9end71.js → chunk-0ggvqmnm.js} +1 -1
  10. package/bundle/{chunk-y7hgevfv.js → chunk-0gsw04hw.js} +2 -2
  11. package/bundle/{chunk-tkrwcjkr.js → chunk-0qpqd7nz.js} +2 -2
  12. package/bundle/{chunk-nty5z2cj.js → chunk-0tqmm8b8.js} +1 -1
  13. package/bundle/chunk-12fwmmcp.js +2 -0
  14. package/bundle/{chunk-8yvx3pgy.js → chunk-14d301ze.js} +1 -1
  15. package/bundle/{chunk-ngfxxfem.js → chunk-16srrzjr.js} +1 -1
  16. package/bundle/{chunk-45a4n21f.js → chunk-19pspc1p.js} +1 -1
  17. package/bundle/chunk-1a95ysv3.js +2 -0
  18. package/bundle/chunk-1akh8pk2.js +2 -0
  19. package/bundle/{chunk-5tky3csh.js → chunk-1ay97v74.js} +1 -1
  20. package/bundle/{chunk-6ar91jvd.js → chunk-1c0yp2gv.js} +1 -1
  21. package/bundle/{chunk-2md6sx8d.js → chunk-1rgt2vmt.js} +1 -1
  22. package/bundle/{chunk-3kpse7zy.js → chunk-1vpx7szf.js} +1 -1
  23. package/bundle/chunk-22qetqnp.js +2 -0
  24. package/bundle/{chunk-tm34qp8j.js → chunk-2bjfz4fb.js} +1 -1
  25. package/bundle/{chunk-a7rp46yt.js → chunk-2c26kxp4.js} +5 -5
  26. package/bundle/{chunk-xe69cnsk.js → chunk-2c41dncf.js} +1 -1
  27. package/bundle/{chunk-fyhqp4pb.js → chunk-2cjfezfr.js} +1 -1
  28. package/bundle/chunk-2d2a92kj.js +2 -0
  29. package/bundle/{chunk-m5dm7a1t.js → chunk-2pex3ak9.js} +1 -1
  30. package/bundle/chunk-2qrvkef8.js +2 -0
  31. package/bundle/chunk-2tppw8j9.js +2 -0
  32. package/bundle/chunk-2y87m7pe.js +2 -0
  33. package/bundle/{chunk-sfw5qddj.js → chunk-33jcxsbe.js} +1 -1
  34. package/bundle/{chunk-d0x5pbkm.js → chunk-3623jvcm.js} +1 -1
  35. package/bundle/{chunk-953pqp3w.js → chunk-368jx5dp.js} +1 -1
  36. package/bundle/chunk-3ft1dn9j.js +2 -0
  37. package/bundle/{chunk-rn83r0js.js → chunk-3k7016c2.js} +1 -1
  38. package/bundle/chunk-3rgct4bd.js +11 -0
  39. package/bundle/{chunk-68v3b6ns.js → chunk-3xdmxm5t.js} +2 -2
  40. package/bundle/{chunk-xwdxgg16.js → chunk-42q8vj0w.js} +1 -1
  41. package/bundle/{chunk-yhj01dz9.js → chunk-438faz6b.js} +2 -2
  42. package/bundle/chunk-4656qm05.js +2 -0
  43. package/bundle/chunk-46knch5z.js +2 -0
  44. package/bundle/{chunk-n23d0q00.js → chunk-4bewbvvr.js} +1 -1
  45. package/bundle/{chunk-pmg53fdd.js → chunk-4byvnx78.js} +1 -1
  46. package/bundle/chunk-4ftjx7ss.js +2 -0
  47. package/bundle/{chunk-jqk3v8d6.js → chunk-4fvbexr8.js} +1 -1
  48. package/bundle/{chunk-k1nh5sd2.js → chunk-4fy08jcj.js} +1 -1
  49. package/bundle/{chunk-0smnwqk6.js → chunk-4j76bf4j.js} +2 -2
  50. package/bundle/{chunk-5nrc5rhh.js → chunk-4jpab7ag.js} +1 -1
  51. package/bundle/{chunk-43ttzy29.js → chunk-4ngmjk8j.js} +2 -2
  52. package/bundle/{chunk-vnrjk2be.js → chunk-4rpgwgx9.js} +1 -1
  53. package/bundle/chunk-4sgy87h5.js +2 -0
  54. package/bundle/{chunk-65bmsp2t.js → chunk-4vzjdmts.js} +1 -1
  55. package/bundle/{chunk-zc0cdvcv.js → chunk-4zhrg3rv.js} +2 -2
  56. package/bundle/{chunk-5pzs51sp.js → chunk-52rdms56.js} +1 -1
  57. package/bundle/chunk-54hktc8h.js +2 -0
  58. package/bundle/{chunk-smznrv7k.js → chunk-55way0em.js} +1 -1
  59. package/bundle/{chunk-k4gsktts.js → chunk-59kk0mce.js} +1 -1
  60. package/bundle/chunk-59m55866.js +2 -0
  61. package/bundle/{chunk-q3h42a94.js → chunk-5b3v1x2c.js} +2 -2
  62. package/bundle/chunk-5js5nw7r.js +2 -0
  63. package/bundle/{chunk-f3zmdfqa.js → chunk-5nhwqg7c.js} +1 -1
  64. package/bundle/{chunk-tzb26ntq.js → chunk-5r05d901.js} +3 -3
  65. package/bundle/{chunk-avefgbjg.js → chunk-5zh91zk2.js} +2 -2
  66. package/bundle/chunk-61jn7908.js +2 -0
  67. package/bundle/chunk-61txdqz1.js +2 -0
  68. package/bundle/chunk-668g9wkg.js +2 -0
  69. package/bundle/chunk-6frhjpmt.js +2 -0
  70. package/bundle/{chunk-920z7g7j.js → chunk-6gqs1k7m.js} +1 -1
  71. package/bundle/chunk-6k14c8x1.js +5 -0
  72. package/bundle/{chunk-g42krp0z.js → chunk-6nxebcf8.js} +1 -1
  73. package/bundle/chunk-6r1jpj0h.js +2 -0
  74. package/bundle/{chunk-7bcm7gg1.js → chunk-6r48fje7.js} +1 -1
  75. package/bundle/{chunk-bqn6bqws.js → chunk-6ychs4wx.js} +1 -1
  76. package/bundle/{chunk-21rq4592.js → chunk-705xnxbc.js} +2 -2
  77. package/bundle/chunk-73fn4dqd.js +2 -0
  78. package/bundle/{chunk-q3nvzhyh.js → chunk-73xryfgn.js} +2 -2
  79. package/bundle/{chunk-q9tgdghx.js → chunk-76h0f86f.js} +1 -1
  80. package/bundle/{chunk-d51908mv.js → chunk-77h8tytk.js} +1 -1
  81. package/bundle/chunk-78j2c2je.js +2 -0
  82. package/bundle/chunk-78jt24ht.js +2 -0
  83. package/bundle/chunk-7j2vpavd.js +2 -0
  84. package/bundle/chunk-7nkxgm72.js +2 -0
  85. package/bundle/{chunk-f31yvp20.js → chunk-7p6mxch0.js} +1 -1
  86. package/bundle/{chunk-mhhtf0v3.js → chunk-7sq5dyv1.js} +1 -1
  87. package/bundle/{chunk-804vmbcd.js → chunk-7x2q1w0f.js} +1 -1
  88. package/bundle/{chunk-ac7482n2.js → chunk-7z96r2px.js} +2 -2
  89. package/bundle/chunk-84pjdenq.js +2 -0
  90. package/bundle/chunk-859pkecc.js +2 -0
  91. package/bundle/{chunk-y0527cg0.js → chunk-8hmt3avx.js} +1 -1
  92. package/bundle/{chunk-cng61dby.js → chunk-8jvfqh3b.js} +1 -1
  93. package/bundle/{chunk-8wwdrwf2.js → chunk-8p0t8qah.js} +1 -1
  94. package/bundle/chunk-8p249svd.js +2 -0
  95. package/bundle/{chunk-z1932c3f.js → chunk-8rfqv5he.js} +1 -1
  96. package/bundle/chunk-8rqbx4jw.js +2 -0
  97. package/bundle/chunk-8s3krfsm.js +2 -0
  98. package/bundle/{chunk-pb30kkbs.js → chunk-93pmbdz7.js} +6 -6
  99. package/bundle/{chunk-vcygx6hs.js → chunk-95am490c.js} +2 -2
  100. package/bundle/{chunk-k3dacdp5.js → chunk-9a6p1gdn.js} +8 -8
  101. package/bundle/chunk-9aafddkw.js +3 -0
  102. package/bundle/{chunk-0xrb12s8.js → chunk-9g9katgy.js} +2 -2
  103. package/bundle/{chunk-24rkf2gk.js → chunk-9qzwmt76.js} +1 -1
  104. package/bundle/chunk-9sv53kb4.js +2 -0
  105. package/bundle/chunk-9wbe0dkx.js +2 -0
  106. package/bundle/{chunk-bne5w117.js → chunk-9xxnwb33.js} +4 -4
  107. package/bundle/{chunk-fjbv3jht.js → chunk-a610qd3x.js} +1 -1
  108. package/bundle/{chunk-5c2438af.js → chunk-a76w2jwm.js} +1 -1
  109. package/bundle/{chunk-at22twxx.js → chunk-aa2n02qk.js} +2 -2
  110. package/bundle/{chunk-4pshnq6g.js → chunk-abv0fskc.js} +1 -1
  111. package/bundle/{chunk-7g66qc1v.js → chunk-acd72413.js} +2 -2
  112. package/bundle/{chunk-wkg3c643.js → chunk-ae7b11np.js} +2 -2
  113. package/bundle/{chunk-gy21fw82.js → chunk-agqss9ga.js} +2 -2
  114. package/bundle/chunk-aj5z8qd5.js +2 -0
  115. package/bundle/{chunk-8e4s6nc2.js → chunk-ajp53ksp.js} +1 -1
  116. package/bundle/{chunk-j164q40b.js → chunk-amp6mvbp.js} +2 -2
  117. package/bundle/{chunk-97q2t1yz.js → chunk-aqcpk2vg.js} +1 -1
  118. package/bundle/chunk-b0c2mvc0.js +2 -0
  119. package/bundle/{chunk-kth84vdn.js → chunk-b6eypnbj.js} +1 -1
  120. package/bundle/chunk-b79z8f94.js +2 -0
  121. package/bundle/chunk-bbwcsdy9.js +2 -0
  122. package/bundle/chunk-bbzjdbb9.js +2 -0
  123. package/bundle/{chunk-6evh2ke8.js → chunk-bd505nsd.js} +1 -1
  124. package/bundle/{chunk-p4027t94.js → chunk-bd84t3fb.js} +1 -1
  125. package/bundle/chunk-bh4s1yct.js +2 -0
  126. package/bundle/{chunk-rrv0n73b.js → chunk-bk7f59fn.js} +1 -1
  127. package/bundle/{chunk-venprxdp.js → chunk-bn71wqqf.js} +1 -1
  128. package/bundle/{chunk-j9h1sp4g.js → chunk-c3szabpf.js} +2 -2
  129. package/bundle/{chunk-z6sbjvtv.js → chunk-c6cajbyj.js} +1 -1
  130. package/bundle/{chunk-p6crzjtf.js → chunk-c8prg3jx.js} +2 -2
  131. package/bundle/chunk-crqcppwq.js +2 -0
  132. package/bundle/{chunk-t239rvej.js → chunk-cth373se.js} +2 -2
  133. package/bundle/chunk-d09zpgj1.js +2 -0
  134. package/bundle/{chunk-t5r3w9e1.js → chunk-d1tb1jd0.js} +1 -1
  135. package/bundle/{chunk-mmjgf680.js → chunk-dbpkq7ba.js} +2 -2
  136. package/bundle/{chunk-pe2xdkez.js → chunk-dd4qnh8s.js} +2 -2
  137. package/bundle/{chunk-p169ee92.js → chunk-defj5zs6.js} +1 -1
  138. package/bundle/chunk-dexcptaz.js +3 -0
  139. package/bundle/chunk-dgqkak21.js +2 -0
  140. package/bundle/{chunk-jww55nk9.js → chunk-dgva3y5v.js} +1 -1
  141. package/bundle/chunk-dhgvh7c3.js +2 -0
  142. package/bundle/{chunk-mhtxp66q.js → chunk-djqxbnwc.js} +2 -2
  143. package/bundle/chunk-dmd101ja.js +2 -0
  144. package/bundle/{chunk-vygkwwjd.js → chunk-drnj1a14.js} +2 -2
  145. package/bundle/{chunk-g3wvtyw3.js → chunk-dt1wwt7m.js} +1 -1
  146. package/bundle/{chunk-cz5vta94.js → chunk-dw70wds9.js} +1 -1
  147. package/bundle/{chunk-xdd3553a.js → chunk-dw7yrk1g.js} +1 -1
  148. package/bundle/chunk-dwb39jdf.js +2 -0
  149. package/bundle/chunk-dx4zxex7.js +2 -0
  150. package/bundle/{chunk-ph8hn1wt.js → chunk-dy2k5rdx.js} +2 -2
  151. package/bundle/{chunk-wwdpw27v.js → chunk-dz3bec8g.js} +1 -1
  152. package/bundle/{chunk-t0761rhq.js → chunk-e0zb6sw6.js} +2 -2
  153. package/bundle/chunk-e2pqvscp.js +2 -0
  154. package/bundle/{chunk-vsz4s6zt.js → chunk-e4g4mvak.js} +1 -1
  155. package/bundle/{chunk-fhqfqd5v.js → chunk-eeq0krp7.js} +2 -2
  156. package/bundle/chunk-efe6kj3d.js +2 -0
  157. package/bundle/{chunk-qp1n7kwe.js → chunk-egkhynj5.js} +1 -1
  158. package/bundle/chunk-emac0dss.js +2 -0
  159. package/bundle/chunk-encfnt6w.js +2 -0
  160. package/bundle/{chunk-y29ejqg2.js → chunk-etv6c77a.js} +1 -1
  161. package/bundle/{chunk-32j0q58h.js → chunk-eyr5ymt8.js} +1 -1
  162. package/bundle/{chunk-r9w0thdk.js → chunk-f2pv705d.js} +1 -1
  163. package/bundle/{chunk-5w76kdjr.js → chunk-f4mnp6xd.js} +1 -1
  164. package/bundle/{chunk-xdteq9bd.js → chunk-f84hw65n.js} +1 -1
  165. package/bundle/chunk-fg2nyz2x.js +2 -0
  166. package/bundle/chunk-ga6wc979.js +2 -0
  167. package/bundle/{chunk-hqbbs9dm.js → chunk-gbxf6e5d.js} +3 -3
  168. package/bundle/chunk-gdew7bwm.js +2 -0
  169. package/bundle/{chunk-w9gzfsy7.js → chunk-gdj7mqrd.js} +2 -2
  170. package/bundle/chunk-ge19ff9d.js +2 -0
  171. package/bundle/{chunk-bzebyyfr.js → chunk-ghap1n1m.js} +4 -4
  172. package/bundle/chunk-gt0q07xq.js +2 -0
  173. package/bundle/{chunk-7mppvhv9.js → chunk-gwrnxcdn.js} +2 -2
  174. package/bundle/{chunk-e8p92vz4.js → chunk-gww0skmn.js} +2 -2
  175. package/bundle/chunk-h4dnjfr2.js +2 -0
  176. package/bundle/{chunk-has2rz35.js → chunk-h7658zxy.js} +1 -1
  177. package/bundle/chunk-h8fx619t.js +2 -0
  178. package/bundle/{chunk-313zqzc1.js → chunk-hfefq104.js} +1 -1
  179. package/bundle/{chunk-ff548b0j.js → chunk-hhk2sp5n.js} +2 -2
  180. package/bundle/{chunk-47k5jy1p.js → chunk-hqjc4wgg.js} +2 -2
  181. package/bundle/{chunk-48r70n4s.js → chunk-hrtze4c5.js} +1 -1
  182. package/bundle/{chunk-r5zy4za0.js → chunk-hwsqqkrv.js} +2 -2
  183. package/bundle/{chunk-ehb4hd9c.js → chunk-j6xmgn63.js} +1 -1
  184. package/bundle/chunk-jnvb3s7f.js +2 -0
  185. package/bundle/chunk-jrq2xw6e.js +2 -0
  186. package/bundle/chunk-jwckmhjm.js +2 -0
  187. package/bundle/{chunk-99s035f0.js → chunk-jxkrhrp0.js} +2 -2
  188. package/bundle/chunk-jz27ypm5.js +2 -0
  189. package/bundle/chunk-jzrs878d.js +2 -0
  190. package/bundle/chunk-jzx700tb.js +2 -0
  191. package/bundle/chunk-k1x8469r.js +3 -0
  192. package/bundle/{chunk-bkct64rs.js → chunk-k3g28tbw.js} +1 -1
  193. package/bundle/{chunk-wy3a4cab.js → chunk-k6zwfstj.js} +1 -1
  194. package/bundle/{chunk-0qd3567w.js → chunk-kfj37631.js} +1 -1
  195. package/bundle/{chunk-khzzmyk2.js → chunk-kmzpeq8k.js} +1 -1
  196. package/bundle/{chunk-bd21p9zz.js → chunk-kre93a89.js} +2 -2
  197. package/bundle/{chunk-j8fcfhr2.js → chunk-kry4vcrf.js} +2 -2
  198. package/bundle/chunk-ktp2b4t4.js +2 -0
  199. package/bundle/chunk-m483jvn8.js +2 -0
  200. package/bundle/chunk-makecdh6.js +8 -0
  201. package/bundle/{chunk-tr6rdr6h.js → chunk-mbbxedsq.js} +2 -2
  202. package/bundle/chunk-menbcmkq.js +2 -0
  203. package/bundle/{chunk-hwrrrbqd.js → chunk-mghnkwp8.js} +1 -1
  204. package/bundle/{chunk-pr7z5dj8.js → chunk-mhxyv9c8.js} +1 -1
  205. package/bundle/{chunk-k5q9px67.js → chunk-mjrqhbp2.js} +1 -1
  206. package/bundle/{chunk-9zm6r55d.js → chunk-msh249db.js} +2 -2
  207. package/bundle/{chunk-nmzrrqgb.js → chunk-n0g4983e.js} +1 -1
  208. package/bundle/{chunk-dnsh1v42.js → chunk-n4qxj391.js} +2 -2
  209. package/bundle/{chunk-ptqk1j2r.js → chunk-n5p7cn4w.js} +1 -1
  210. package/bundle/{chunk-5zkj5xv9.js → chunk-n9twhc5d.js} +2 -2
  211. package/bundle/{chunk-p5be5ddp.js → chunk-na1wr2qf.js} +1 -1
  212. package/bundle/{chunk-4agaj51z.js → chunk-nbckdba0.js} +1 -1
  213. package/bundle/{chunk-ezrqhqkp.js → chunk-nftbj8g9.js} +1 -1
  214. package/bundle/{chunk-d7nsd979.js → chunk-nfzpegqx.js} +1 -1
  215. package/bundle/chunk-np8h66t0.js +2 -0
  216. package/bundle/{chunk-v6v9xn81.js → chunk-npzx3yd5.js} +1 -1
  217. package/bundle/chunk-nr2j8ytn.js +3 -0
  218. package/bundle/{chunk-w46g7kdq.js → chunk-nrk29616.js} +2 -2
  219. package/bundle/{chunk-fsqses4g.js → chunk-ns8xnkjb.js} +2 -2
  220. package/bundle/{chunk-7vmx8bg9.js → chunk-ntpn0w9m.js} +2 -2
  221. package/bundle/chunk-nwwmns3w.js +2 -0
  222. package/bundle/{chunk-ksme3gj1.js → chunk-p40z6510.js} +1 -1
  223. package/bundle/{chunk-3ktzxj69.js → chunk-p847g35y.js} +1 -1
  224. package/bundle/{chunk-vf492zs6.js → chunk-p8ak162p.js} +1 -1
  225. package/bundle/chunk-pe5dpzec.js +2 -0
  226. package/bundle/{chunk-bbng1cea.js → chunk-pf3nqf00.js} +1 -1
  227. package/bundle/{chunk-9hz56z6a.js → chunk-ppy0jy6j.js} +1 -1
  228. package/bundle/{chunk-et3804wr.js → chunk-prbxhnza.js} +1 -1
  229. package/bundle/{chunk-nrat6ncm.js → chunk-ptwex14s.js} +1 -1
  230. package/bundle/{chunk-qey1efpx.js → chunk-q3pt4p9f.js} +1 -1
  231. package/bundle/{chunk-pt0xphq9.js → chunk-q6mcnq9p.js} +1 -1
  232. package/bundle/{chunk-kengqzja.js → chunk-q6p92zyn.js} +2 -2
  233. package/bundle/{chunk-ycvwpmd9.js → chunk-q87fw8dk.js} +2 -2
  234. package/bundle/chunk-q8f6a074.js +2 -0
  235. package/bundle/{chunk-cj7r8w1e.js → chunk-qbrj9wzd.js} +1 -1
  236. package/bundle/{chunk-j0bwa5dk.js → chunk-qdvnscxm.js} +2 -2
  237. package/bundle/{chunk-d6jhs818.js → chunk-qp3hxqg5.js} +2 -2
  238. package/bundle/{chunk-jg1ccs3j.js → chunk-qph2c2v7.js} +1 -1
  239. package/bundle/{chunk-3vvd7j14.js → chunk-qprbef09.js} +1 -1
  240. package/bundle/chunk-qqaevt32.js +2 -0
  241. package/bundle/chunk-qzpvz708.js +2 -0
  242. package/bundle/{chunk-cbnkx933.js → chunk-r4kg0z96.js} +2 -2
  243. package/bundle/{chunk-faee8zgc.js → chunk-r73e8gsp.js} +1 -1
  244. package/bundle/chunk-reyjr2e0.js +2 -0
  245. package/bundle/{chunk-dxdggn90.js → chunk-rfzra502.js} +1 -1
  246. package/bundle/{chunk-tg226j37.js → chunk-rhrcgvb8.js} +1 -1
  247. package/bundle/{chunk-wyj8cpx5.js → chunk-rk0fnvp5.js} +1 -1
  248. package/bundle/{chunk-t8c4cs6z.js → chunk-rqedtjz9.js} +1 -1
  249. package/bundle/{chunk-eg3syjtv.js → chunk-s06t769q.js} +2 -2
  250. package/bundle/{chunk-m80v76m9.js → chunk-skxg3s8z.js} +1 -1
  251. package/bundle/{chunk-7x6yrtzn.js → chunk-spzd8rev.js} +1 -1
  252. package/bundle/chunk-t178njgb.js +2 -0
  253. package/bundle/{chunk-3jf3jhrs.js → chunk-t4b2fm7z.js} +1 -1
  254. package/bundle/{chunk-55fcmswd.js → chunk-t8sy5sgx.js} +2 -2
  255. package/bundle/{chunk-s4vx9x1v.js → chunk-t9qyzzsz.js} +1 -1
  256. package/bundle/{chunk-6scf311w.js → chunk-tc9xbn1t.js} +1 -1
  257. package/bundle/{chunk-qnvsqnz5.js → chunk-tezrgfc6.js} +2 -2
  258. package/bundle/chunk-tjpev5t6.js +2 -0
  259. package/bundle/{chunk-vkaa7k3e.js → chunk-tkzctbxq.js} +2 -2
  260. package/bundle/{chunk-xy0gnpen.js → chunk-ts2k13g0.js} +1 -1
  261. package/bundle/{chunk-gszvgz76.js → chunk-twd6r7nf.js} +2 -2
  262. package/bundle/{chunk-qxcyz5hc.js → chunk-twfvrafb.js} +2 -2
  263. package/bundle/{chunk-70q8qcb2.js → chunk-twvmjsxf.js} +1 -1
  264. package/bundle/{chunk-ggxzf22k.js → chunk-tz3s8dvy.js} +1 -1
  265. package/bundle/chunk-tzq7wjgv.js +3 -0
  266. package/bundle/{chunk-n78f8hfk.js → chunk-v0c3k797.js} +1 -1
  267. package/bundle/chunk-v1s16wwd.js +2 -0
  268. package/bundle/{chunk-fr34mnyg.js → chunk-v3nmnm57.js} +2 -2
  269. package/bundle/chunk-v6b29nx4.js +2 -0
  270. package/bundle/chunk-v6rgd1j5.js +2 -0
  271. package/bundle/chunk-v9dnetq8.js +2 -0
  272. package/bundle/{chunk-450fef7h.js → chunk-v9w88wpy.js} +2 -2
  273. package/bundle/{chunk-7hvf9dgx.js → chunk-va2qfh0x.js} +1 -1
  274. package/bundle/chunk-vd5mpvcc.js +2 -0
  275. package/bundle/{chunk-w4synhfg.js → chunk-vfb72vdy.js} +1 -1
  276. package/bundle/{chunk-3cr2p4mp.js → chunk-vhzx5bxd.js} +1 -1
  277. package/bundle/{chunk-cmb62jkt.js → chunk-vjn54xj5.js} +2 -2
  278. package/bundle/{chunk-ybane1en.js → chunk-vp3yf46q.js} +1 -1
  279. package/bundle/{chunk-p4b0s5td.js → chunk-vzrc2fmt.js} +1 -1
  280. package/bundle/{chunk-ejqzcdcx.js → chunk-w3zhy5vq.js} +1 -1
  281. package/bundle/{chunk-hjt94wce.js → chunk-w43kmnm9.js} +641 -635
  282. package/bundle/{chunk-w4brava0.js → chunk-wb1d3mqw.js} +1 -1
  283. package/bundle/{chunk-6m9jb0s9.js → chunk-wd8hbven.js} +2 -2
  284. package/bundle/{chunk-vshycswk.js → chunk-wgt1tqw9.js} +1 -1
  285. package/bundle/{chunk-0428v6mw.js → chunk-whw18cn9.js} +1 -1
  286. package/bundle/{chunk-pxm4qvqk.js → chunk-wjz42325.js} +2 -2
  287. package/bundle/{chunk-y67kaj0b.js → chunk-wvb17w0z.js} +1 -1
  288. package/bundle/chunk-wwct4z7j.js +2 -0
  289. package/bundle/{chunk-55ykn8nz.js → chunk-x55h5qdc.js} +4 -4
  290. package/bundle/{chunk-05ck7acg.js → chunk-x80d0zh7.js} +1 -1
  291. package/bundle/{chunk-mjjaezwq.js → chunk-x9fyt3vx.js} +2 -2
  292. package/bundle/{chunk-g22e4gw7.js → chunk-xb3sxa6f.js} +1 -1
  293. package/bundle/{chunk-yz25607t.js → chunk-xcxqt8ag.js} +1 -1
  294. package/bundle/{chunk-c36p881g.js → chunk-xhh70g8j.js} +3 -3
  295. package/bundle/chunk-xr9wz961.js +2 -0
  296. package/bundle/{chunk-0cnwsf8p.js → chunk-y0h3jfkj.js} +1 -1
  297. package/bundle/{chunk-m7ganre7.js → chunk-y2t5pmqw.js} +1 -1
  298. package/bundle/{chunk-qkvqvgcx.js → chunk-y5q9v80n.js} +1 -1
  299. package/bundle/{chunk-5asx1706.js → chunk-yd94wz5v.js} +2 -2
  300. package/bundle/{chunk-5df5aja0.js → chunk-yjqww6ag.js} +2 -2
  301. package/bundle/{chunk-2drzgtv3.js → chunk-yxttz5z5.js} +2 -2
  302. package/bundle/{chunk-da6kggv7.js → chunk-yy7r3t3w.js} +2 -2
  303. package/bundle/{chunk-5pwv2p3s.js → chunk-yzpc5kj2.js} +1 -1
  304. package/bundle/{chunk-73r8bjjz.js → chunk-z6kcnpsj.js} +2 -2
  305. package/bundle/{chunk-nj1ntakd.js → chunk-z744mz4w.js} +2 -2
  306. package/bundle/{chunk-39z96pc6.js → chunk-z7kswv9r.js} +3 -3
  307. package/bundle/chunk-zfegnt1e.js +2 -0
  308. package/bundle/chunk-zg7kesbp.js +2 -0
  309. package/bundle/{chunk-jnrnncqc.js → chunk-znmbfx70.js} +1 -1
  310. package/bundle/{chunk-24ygjbpf.js → chunk-zp5sr5nx.js} +2 -2
  311. package/bundle/{chunk-ha1w0xzh.js → chunk-zrhw1szj.js} +1 -1
  312. package/bundle/chunk-zy06fe4r.js +2 -0
  313. package/bundle/index.js +3 -3
  314. package/bundle/parser.worker.js +2 -2
  315. package/bundle/worker.js +1 -1
  316. package/package.json +1 -1
  317. package/bundle/chunk-0ppnq3a4.js +0 -2
  318. package/bundle/chunk-0te0vcdn.js +0 -2
  319. package/bundle/chunk-11h06z17.js +0 -2
  320. package/bundle/chunk-28yv4fqe.js +0 -2
  321. package/bundle/chunk-34a52hyr.js +0 -2
  322. package/bundle/chunk-3d73kfea.js +0 -2
  323. package/bundle/chunk-3n3gb3vd.js +0 -2
  324. package/bundle/chunk-3sq60y9f.js +0 -2
  325. package/bundle/chunk-49mbnqvc.js +0 -2
  326. package/bundle/chunk-4fr6kae9.js +0 -2
  327. package/bundle/chunk-516w1nc4.js +0 -2
  328. package/bundle/chunk-535nm66j.js +0 -2
  329. package/bundle/chunk-5kpxpm8e.js +0 -2
  330. package/bundle/chunk-5nm5s0h2.js +0 -2
  331. package/bundle/chunk-5ysbwr4x.js +0 -3
  332. package/bundle/chunk-6dvmyeg7.js +0 -2
  333. package/bundle/chunk-6ex981t8.js +0 -2
  334. package/bundle/chunk-6gpf2bjs.js +0 -2
  335. package/bundle/chunk-6jeg2r5j.js +0 -2
  336. package/bundle/chunk-6nry7tah.js +0 -2
  337. package/bundle/chunk-7bgzcpdw.js +0 -2
  338. package/bundle/chunk-7kjvcbwa.js +0 -2
  339. package/bundle/chunk-7x30x94y.js +0 -2
  340. package/bundle/chunk-86hsh44c.js +0 -3
  341. package/bundle/chunk-8jma2btf.js +0 -2
  342. package/bundle/chunk-8sbb95a4.js +0 -2
  343. package/bundle/chunk-93e0w75z.js +0 -2
  344. package/bundle/chunk-97gp818s.js +0 -2
  345. package/bundle/chunk-9epf2zbh.js +0 -2
  346. package/bundle/chunk-agv04nt7.js +0 -2
  347. package/bundle/chunk-be7smmar.js +0 -2
  348. package/bundle/chunk-bg1t0kke.js +0 -2
  349. package/bundle/chunk-bryx5cx9.js +0 -2
  350. package/bundle/chunk-c13rrw41.js +0 -2
  351. package/bundle/chunk-c2kkv619.js +0 -2
  352. package/bundle/chunk-c3zge8cg.js +0 -3
  353. package/bundle/chunk-c5xj1y5v.js +0 -2
  354. package/bundle/chunk-cfhfc86j.js +0 -8
  355. package/bundle/chunk-ckpm4dvv.js +0 -2
  356. package/bundle/chunk-cqkaamvn.js +0 -2
  357. package/bundle/chunk-ct8twng1.js +0 -2
  358. package/bundle/chunk-d38y7bvh.js +0 -2
  359. package/bundle/chunk-d6hxsfm6.js +0 -2
  360. package/bundle/chunk-descb9jz.js +0 -2
  361. package/bundle/chunk-dvr2b9r1.js +0 -2
  362. package/bundle/chunk-ea5fktnn.js +0 -2
  363. package/bundle/chunk-f0t7rryn.js +0 -3
  364. package/bundle/chunk-f4mf6tpp.js +0 -2
  365. package/bundle/chunk-f97k17t8.js +0 -2
  366. package/bundle/chunk-g4ehhdzp.js +0 -2
  367. package/bundle/chunk-gd6qpdjw.js +0 -2
  368. package/bundle/chunk-gdn91t9j.js +0 -2
  369. package/bundle/chunk-gehn9fd9.js +0 -2
  370. package/bundle/chunk-h9wh48d0.js +0 -5
  371. package/bundle/chunk-hhax4mxw.js +0 -2
  372. package/bundle/chunk-hjb1etf8.js +0 -2
  373. package/bundle/chunk-jvkzdap1.js +0 -2
  374. package/bundle/chunk-kg8fcv91.js +0 -2
  375. package/bundle/chunk-kgptyf7n.js +0 -3
  376. package/bundle/chunk-kjjjrjnb.js +0 -2
  377. package/bundle/chunk-ky88ba80.js +0 -2
  378. package/bundle/chunk-m5cfmhwh.js +0 -2
  379. package/bundle/chunk-m7qxxbns.js +0 -2
  380. package/bundle/chunk-mh19kwzw.js +0 -10
  381. package/bundle/chunk-n8wg5h5p.js +0 -2
  382. package/bundle/chunk-nvs0d8jg.js +0 -2
  383. package/bundle/chunk-p6hcj3kv.js +0 -2
  384. package/bundle/chunk-pexmns0j.js +0 -2
  385. package/bundle/chunk-pt603np4.js +0 -2
  386. package/bundle/chunk-pz1avwyt.js +0 -2
  387. package/bundle/chunk-qk5bfcv8.js +0 -2
  388. package/bundle/chunk-qr06byhp.js +0 -2
  389. package/bundle/chunk-r7sq3maz.js +0 -2
  390. package/bundle/chunk-rcrjbhaz.js +0 -2
  391. package/bundle/chunk-rmgs9nmj.js +0 -2
  392. package/bundle/chunk-rytavefg.js +0 -2
  393. package/bundle/chunk-sh9vjnsh.js +0 -2
  394. package/bundle/chunk-st0c5wwc.js +0 -2
  395. package/bundle/chunk-teb3k2sf.js +0 -2
  396. package/bundle/chunk-ts798jvf.js +0 -2
  397. package/bundle/chunk-tx5aj02v.js +0 -2
  398. package/bundle/chunk-v1t51rrq.js +0 -2
  399. package/bundle/chunk-vdrz2t9c.js +0 -2
  400. package/bundle/chunk-vh9ptqn0.js +0 -2
  401. package/bundle/chunk-vj4x8hvz.js +0 -2
  402. package/bundle/chunk-w72rctxz.js +0 -2
  403. package/bundle/chunk-wbw9zv3h.js +0 -2
  404. package/bundle/chunk-x6mw98c2.js +0 -2
  405. package/bundle/chunk-y6p57wgh.js +0 -2
  406. package/bundle/chunk-y6xs8v17.js +0 -2
  407. package/bundle/chunk-z3xsfpc6.js +0 -2
  408. package/bundle/chunk-zkm3yyyf.js +0 -2
  409. package/bundle/chunk-zn5pw733.js +0 -2
  410. package/bundle/chunk-zxwvnmea.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{T as I}from"./chunk-gbkz04ke.js";import{U as i,W as r}from"./chunk-4pshnq6g.js";import{Hd as c}from"./chunk-bwbqkfv0.js";import{Id as g}from"./chunk-32j0q58h.js";import{Jd as y}from"./chunk-0cnwsf8p.js";import{Kd as k}from"./chunk-2md6sx8d.js";import{Ld as A}from"./chunk-wyj8cpx5.js";import{Qd as w,Rd as u,Td as W,Ud as L,Vd as T,Xd as p,Yd as o,Zd as b,_d as P}from"./chunk-ff548b0j.js";import"./chunk-zc0cdvcv.js";import{ae as z}from"./chunk-5w76kdjr.js";import{dg as Y}from"./chunk-eg3syjtv.js";import{Bh as M}from"./chunk-hjt94wce.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{Qk as a,dl as s,xj as R}from"./chunk-k3dacdp5.js";import{pl as V}from"./chunk-99s035f0.js";import{Nl as n}from"./chunk-h9wh48d0.js";import"./chunk-tzb26ntq.js";import"./chunk-mh19kwzw.js";import"./chunk-q3h42a94.js";import"./chunk-hqbbs9dm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-cfhfc86j.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-q3nvzhyh.js";import"./chunk-5df5aja0.js";import"./chunk-73r8bjjz.js";import"./chunk-xy0gnpen.js";import{Nr as l}from"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-vdrz2t9c.js";import{ks as d}from"./chunk-fr34mnyg.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import{kt as v}from"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import{eH as O}from"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import{wO as H1}from"./chunk-r9w0thdk.js";import f from"path";import{pathToFileURL as J1}from"url";import Q1 from"os";import{access as S1,readdir as X1}from"fs/promises";var q1={en:A,zh:k,ja:c,fr:y,ru:g},B1=q1[I()]??A;function U($,B){let J=B1[$]??A[$]??$;if(!B)return J;return J.replace(/\{(\w+)\}/g,(X,H)=>(H in B)?String(B[H]):`{${H}}`)}import{text as Z1}from"stream/consumers";var D=($,B)=>M.runPromise(O.gen(function*(){yield*(yield*R.Service).set($,B)}));async function t(){let $=await p({message:"Enter your API key",validate:(B)=>B&&B.length>0?void 0:"Required"});if(w($))throw new Y.CancelledError;return $}async function h($,B){let J=$.provider??B;if("refresh"in $){let{type:X,provider:H,refresh:Z,access:j,expires:q,metadata:S,...G}=$;await D(J,{type:"oauth",refresh:Z,access:j,expires:q,...G})}if("key"in $)await D(J,{type:"api",key:$.key,...$.metadata?{metadata:$.metadata}:{}})}async function x($,B,J){let X=0;if(J){let j=$.auth.methods.findIndex((q)=>q.label.toLowerCase()===J.toLowerCase());if(j===-1)W.error(`Unknown method "${J}" for ${B}. Available: ${$.auth.methods.map((q)=>q.label).join(", ")}`),process.exit(1);X=j}else if($.auth.methods.length>1){let j=await b({message:"Login method",options:$.auth.methods.map((q,S)=>({label:q.label,value:S.toString()}))});if(w(j))throw new Y.CancelledError;X=parseInt(j)}let H=$.auth.methods[X];await new Promise((j)=>setTimeout(j,10));let Z={};if(H.prompts)for(let j of H.prompts){if(j.when){let q=Z[j.when.key];if(q===void 0)continue;if(!(j.when.op==="eq"?q===j.when.value:q!==j.when.value))continue}if(j.condition&&!j.condition(Z))continue;if(j.type==="select"){let q=await b({message:j.message,options:j.options});if(w(q))throw new Y.CancelledError;Z[j.key]=q}else{let q=await P({message:j.message,placeholder:j.placeholder,validate:j.validate?(S)=>j.validate(S??""):void 0});if(w(q))throw new Y.CancelledError;Z[j.key]=q}}if(H.type==="oauth"){let j=await H.authorize(Z);if(j.url)W.info("Go to: "+j.url);if(j.method==="auto"){if(j.instructions)W.info(j.instructions);let q=o();q.start("Waiting for authorization...");let S=await j.callback();if(S.type==="failed")q.stop("Failed to authorize",1);if(S.type==="success")await h(S,B),q.stop("Login successful")}if(j.method==="code"){let q=await P({message:"Paste the authorization code here: ",validate:(G)=>G&&G.length>0?void 0:"Required"});if(w(q))throw new Y.CancelledError;let S=await j.callback(q);if(S.type==="failed")W.error("Failed to authorize");if(S.type==="success")await h(S,B),W.success("Login successful")}return T("Done"),!0}if(H.type==="api"){if(H.authorize){let j=await t(),q=await H.authorize(Z);if(q.type==="failed")W.error("Failed to authorize");if(q.type==="success"){let S=q.provider??B;await D(S,{type:"api",key:q.key??j}),W.success("Login successful")}return T("Done"),!0}}return!1}function G1($){let B=new Set,J=[];for(let X of $.hooks){if(!X.auth)continue;let H=X.auth.provider;if(B.has(H))continue;if(B.add(H),Object.hasOwn($.existingProviders,H))continue;if($.disabled.has(H))continue;if($.enabled&&!$.enabled.has(H))continue;J.push({id:H,name:$.providerNames[H]??H})}return J}function m($){let B=$?.loginExtension;if(!B||typeof B!=="object")return;let J=B;if(typeof J.id!=="string"||typeof J.run!=="function")return;return J}async function W1(){try{let J=await import("./chunk-wbw9zv3h.js");for(let X of Object.values(J.modules??{})){let H=m(X);if(H)return H}}catch{}let $=f.join(import.meta.dir,"..","..","ext");await S1($).catch(()=>{return});let B=await X1($).catch(()=>[]);for(let J of B.filter((X)=>X.endsWith(".ts")&&!X.endsWith(".d.ts")))try{let X=m(await import(J1(f.join($,J)).href));if(X)return X}catch{}return}var l1=z({command:"providers",aliases:["auth"],describe:"manage AI providers and credentials",builder:($)=>$.command(Y1).command(_1).command(F1).command(K1).demandCommand(),async handler(){}}),Y1=z({command:"list",aliases:["ls"],describe:"list providers and credentials",async handler($){Y.empty();let B=f.join(v.Path.data,"auth.json"),J=Q1.homedir(),X=B===J||B.startsWith(J+f.sep)?"~"+B.slice(J.length):B;L(`Credentials ${Y.Style.TEXT_DIM}${X}`);let H=await M.runPromise(O.gen(function*(){let q=yield*R.Service;return Object.entries(yield*q.all())})),Z=await V.get();for(let[q,S]of H){let G=Z[q]?.name||q;W.info(`${G} ${Y.Style.TEXT_DIM}${S.type}`)}T(`${H.length} credentials`);let j=[];for(let[q,S]of Object.entries(Z))for(let G of S.env)if(process.env[G])j.push({provider:S.name||q,envVar:G});if(j.length>0){Y.empty(),L("Environment");for(let{provider:q,envVar:S}of j)W.info(`${q} ${Y.Style.TEXT_DIM}${S}`);T(`${j.length} environment variable`+(j.length===1?"":"s"))}}}),_1=z({command:"login [url]",describe:"log in to a provider",builder:($)=>$.positional("url",{describe:"qitqode auth provider",type:"string"}).option("provider",{alias:["p"],describe:"provider id or name to log in to (skips provider selection)",type:"string"}).option("method",{alias:["m"],describe:"login method label (skips method selection)",type:"string"}),async handler($){await n.provide({directory:process.cwd(),async fn(){if(Y.empty(),L("Add credential"),$.url){let Q=$.url.replace(/\/+$/,""),_=await fetch(`${Q}/.well-known/opencode`).then((j1)=>j1.json());W.info(`Running \`${_.auth.command.join(" ")}\``);let F=l.spawn(_.auth.command,{stdout:"pipe"});if(!F.stdout){W.error("Failed"),T("Done");return}let[C,N]=await Promise.all([F.exited,Z1(F.stdout)]);if(C!==0){W.error("Failed"),T("Done");return}await D(Q,{type:"wellknown",key:_.auth.env,token:N.trim()}),W.success("Logged into "+Q),T("Done");return}await V.refresh(!0).catch(()=>{});let B=await M.runPromise(s.Service.use((Q)=>Q.get())),J=new Set(B.disabled_providers??[]),X=B.enabled_providers?new Set(B.enabled_providers):void 0,H=await V.get().then((Q)=>{let _={};for(let[F,C]of Object.entries(Q))if((X?X.has(F):!0)&&!J.has(F))_[F]=C;return _}),Z=await M.runPromise(O.gen(function*(){return yield*(yield*a.Service).list()})),j=i,q=G1({hooks:Z,existingProviders:H,disabled:J,enabled:X,providerNames:Object.fromEntries(Object.entries(B.provider??{}).map(([Q,_])=>[Q,_.name]))}),S=[...r(d(H),j,(Q)=>({openai:"ChatGPT Plus/Pro or API key"})[Q.id]),...q.map((Q)=>({label:Q.name,value:Q.id,hint:"plugin"}))],G=await W1(),e=G?[G.id,...G.aliases??[]]:[],K;if(G&&$.provider&&e.includes($.provider)){await G.run();return}else if($.provider){let Q=$.provider,_=S.find((N)=>N.value===Q),F=S.find((N)=>N.label.toLowerCase()===Q.toLowerCase()),C=_??F;if(!C)W.error(`Unknown provider "${Q}"`),process.exit(1);K=C.value}else{let Q=await b({message:U("cli.providers.select"),options:[...G?.menu?[{label:G.menu.label,value:G.id,hint:G.menu.hint}]:[],{label:U("cli.providers.other"),value:"__other__"}]});if(w(Q))throw new Y.CancelledError;if(G&&Q===G.id){await G.run();return}let _=await u({message:U("cli.providers.select"),maxItems:8,options:[...S,{value:"other",label:"Other"}]});if(w(_))throw new Y.CancelledError;K=_}let E=Z.findLast((Q)=>Q.auth?.provider===K);if(E&&E.auth){if(await x({auth:E.auth},K,$.method))return}if(K==="other"){let Q=await P({message:"Enter provider id",validate:(F)=>F&&F.match(/^[0-9a-z-]+$/)?void 0:"a-z, 0-9 and hyphens only"});if(w(Q))throw new Y.CancelledError;K=Q.replace(/^@ai-sdk\//,"");let _=Z.findLast((F)=>F.auth?.provider===K);if(_&&_.auth){if(await x({auth:_.auth},K,$.method))return}W.warn(`This only stores a credential for ${K} - you will need configure it in qitqode.json, check the docs for examples.`)}if(K==="amazon-bedrock")W.info(`Amazon Bedrock authentication priority:
2
+ import{T as I}from"./chunk-gbkz04ke.js";import{U as i,W as r}from"./chunk-abv0fskc.js";import{Id as c}from"./chunk-0ffmwhw7.js";import{Jd as g}from"./chunk-eyr5ymt8.js";import{Kd as y}from"./chunk-y0h3jfkj.js";import{Ld as k}from"./chunk-1rgt2vmt.js";import{Md as A}from"./chunk-rk0fnvp5.js";import{$d as P,Rd as w,Sd as u,Ud as W,Vd as L,Wd as T,Yd as p,Zd as o,_d as b}from"./chunk-hhk2sp5n.js";import"./chunk-4zhrg3rv.js";import{be as z}from"./chunk-f4mnp6xd.js";import{eg as Y}from"./chunk-s06t769q.js";import{Ch as M}from"./chunk-w43kmnm9.js";import"./chunk-nrk29616.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-wd8hbven.js";import"./chunk-drnj1a14.js";import{Rk as a,el as s,yj as R}from"./chunk-9a6p1gdn.js";import{ql as V}from"./chunk-jxkrhrp0.js";import{Ol as n}from"./chunk-6k14c8x1.js";import"./chunk-5r05d901.js";import"./chunk-3rgct4bd.js";import"./chunk-5b3v1x2c.js";import"./chunk-gbxf6e5d.js";import"./chunk-msh249db.js";import"./chunk-95am490c.js";import"./chunk-kmzpeq8k.js";import"./chunk-0gsw04hw.js";import"./chunk-hqjc4wgg.js";import"./chunk-makecdh6.js";import"./chunk-dy2k5rdx.js";import"./chunk-n5p7cn4w.js";import"./chunk-cqtkxwd8.js";import"./chunk-mhxyv9c8.js";import"./chunk-0crgymtr.js";import"./chunk-cth373se.js";import"./chunk-xcxqt8ag.js";import"./chunk-va2qfh0x.js";import"./chunk-ae7b11np.js";import"./chunk-eeq0krp7.js";import"./chunk-73xryfgn.js";import"./chunk-yjqww6ag.js";import"./chunk-z6kcnpsj.js";import"./chunk-ts2k13g0.js";import{lt as l}from"./chunk-01e3v1xz.js";import"./chunk-dbpkq7ba.js";import"./chunk-z744mz4w.js";import"./chunk-vjn54xj5.js";import"./chunk-0qpqd7nz.js";import"./chunk-gdew7bwm.js";import{Kt as d}from"./chunk-v3nmnm57.js";import"./chunk-hwsqqkrv.js";import"./chunk-mbbxedsq.js";import{Ku as v}from"./chunk-aa2n02qk.js";import"./chunk-k1x8469r.js";import"./chunk-c3szabpf.js";import"./chunk-c8prg3jx.js";import"./chunk-t8sy5sgx.js";import{EI as O}from"./chunk-tezrgfc6.js";import"./chunk-wjz42325.js";import"./chunk-kry4vcrf.js";import{WP as H1}from"./chunk-f2pv705d.js";import f from"path";import{pathToFileURL as J1}from"url";import Q1 from"os";import{access as S1,readdir as X1}from"fs/promises";var q1={en:A,zh:k,ja:c,fr:y,ru:g},B1=q1[I()]??A;function U($,B){let J=B1[$]??A[$]??$;if(!B)return J;return J.replace(/\{(\w+)\}/g,(X,H)=>(H in B)?String(B[H]):`{${H}}`)}import{text as Z1}from"stream/consumers";var D=($,B)=>M.runPromise(O.gen(function*(){yield*(yield*R.Service).set($,B)}));async function t(){let $=await p({message:"Enter your API key",validate:(B)=>B&&B.length>0?void 0:"Required"});if(w($))throw new Y.CancelledError;return $}async function h($,B){let J=$.provider??B;if("refresh"in $){let{type:X,provider:H,refresh:Z,access:j,expires:q,metadata:S,...G}=$;await D(J,{type:"oauth",refresh:Z,access:j,expires:q,...G})}if("key"in $)await D(J,{type:"api",key:$.key,...$.metadata?{metadata:$.metadata}:{}})}async function x($,B,J){let X=0;if(J){let j=$.auth.methods.findIndex((q)=>q.label.toLowerCase()===J.toLowerCase());if(j===-1)W.error(`Unknown method "${J}" for ${B}. Available: ${$.auth.methods.map((q)=>q.label).join(", ")}`),process.exit(1);X=j}else if($.auth.methods.length>1){let j=await b({message:"Login method",options:$.auth.methods.map((q,S)=>({label:q.label,value:S.toString()}))});if(w(j))throw new Y.CancelledError;X=parseInt(j)}let H=$.auth.methods[X];await new Promise((j)=>setTimeout(j,10));let Z={};if(H.prompts)for(let j of H.prompts){if(j.when){let q=Z[j.when.key];if(q===void 0)continue;if(!(j.when.op==="eq"?q===j.when.value:q!==j.when.value))continue}if(j.condition&&!j.condition(Z))continue;if(j.type==="select"){let q=await b({message:j.message,options:j.options});if(w(q))throw new Y.CancelledError;Z[j.key]=q}else{let q=await P({message:j.message,placeholder:j.placeholder,validate:j.validate?(S)=>j.validate(S??""):void 0});if(w(q))throw new Y.CancelledError;Z[j.key]=q}}if(H.type==="oauth"){let j=await H.authorize(Z);if(j.url)W.info("Go to: "+j.url);if(j.method==="auto"){if(j.instructions)W.info(j.instructions);let q=o();q.start("Waiting for authorization...");let S=await j.callback();if(S.type==="failed")q.stop("Failed to authorize",1);if(S.type==="success")await h(S,B),q.stop("Login successful")}if(j.method==="code"){let q=await P({message:"Paste the authorization code here: ",validate:(G)=>G&&G.length>0?void 0:"Required"});if(w(q))throw new Y.CancelledError;let S=await j.callback(q);if(S.type==="failed")W.error("Failed to authorize");if(S.type==="success")await h(S,B),W.success("Login successful")}return T("Done"),!0}if(H.type==="api"){if(H.authorize){let j=await t(),q=await H.authorize(Z);if(q.type==="failed")W.error("Failed to authorize");if(q.type==="success"){let S=q.provider??B;await D(S,{type:"api",key:q.key??j}),W.success("Login successful")}return T("Done"),!0}}return!1}function G1($){let B=new Set,J=[];for(let X of $.hooks){if(!X.auth)continue;let H=X.auth.provider;if(B.has(H))continue;if(B.add(H),Object.hasOwn($.existingProviders,H))continue;if($.disabled.has(H))continue;if($.enabled&&!$.enabled.has(H))continue;J.push({id:H,name:$.providerNames[H]??H})}return J}function m($){let B=$?.loginExtension;if(!B||typeof B!=="object")return;let J=B;if(typeof J.id!=="string"||typeof J.run!=="function")return;return J}async function W1(){try{let J=await import("./chunk-xr9wz961.js");for(let X of Object.values(J.modules??{})){let H=m(X);if(H)return H}}catch{}let $=f.join(import.meta.dir,"..","..","ext");await S1($).catch(()=>{return});let B=await X1($).catch(()=>[]);for(let J of B.filter((X)=>X.endsWith(".ts")&&!X.endsWith(".d.ts")))try{let X=m(await import(J1(f.join($,J)).href));if(X)return X}catch{}return}var l1=z({command:"providers",aliases:["auth"],describe:"manage AI providers and credentials",builder:($)=>$.command(Y1).command(_1).command(F1).command(K1).demandCommand(),async handler(){}}),Y1=z({command:"list",aliases:["ls"],describe:"list providers and credentials",async handler($){Y.empty();let B=f.join(v.Path.data,"auth.json"),J=Q1.homedir(),X=B===J||B.startsWith(J+f.sep)?"~"+B.slice(J.length):B;L(`Credentials ${Y.Style.TEXT_DIM}${X}`);let H=await M.runPromise(O.gen(function*(){let q=yield*R.Service;return Object.entries(yield*q.all())})),Z=await V.get();for(let[q,S]of H){let G=Z[q]?.name||q;W.info(`${G} ${Y.Style.TEXT_DIM}${S.type}`)}T(`${H.length} credentials`);let j=[];for(let[q,S]of Object.entries(Z))for(let G of S.env)if(process.env[G])j.push({provider:S.name||q,envVar:G});if(j.length>0){Y.empty(),L("Environment");for(let{provider:q,envVar:S}of j)W.info(`${q} ${Y.Style.TEXT_DIM}${S}`);T(`${j.length} environment variable`+(j.length===1?"":"s"))}}}),_1=z({command:"login [url]",describe:"log in to a provider",builder:($)=>$.positional("url",{describe:"qitqode auth provider",type:"string"}).option("provider",{alias:["p"],describe:"provider id or name to log in to (skips provider selection)",type:"string"}).option("method",{alias:["m"],describe:"login method label (skips method selection)",type:"string"}),async handler($){await n.provide({directory:process.cwd(),async fn(){if(Y.empty(),L("Add credential"),$.url){let Q=$.url.replace(/\/+$/,""),_=await fetch(`${Q}/.well-known/opencode`).then((j1)=>j1.json());W.info(`Running \`${_.auth.command.join(" ")}\``);let F=l.spawn(_.auth.command,{stdout:"pipe"});if(!F.stdout){W.error("Failed"),T("Done");return}let[C,N]=await Promise.all([F.exited,Z1(F.stdout)]);if(C!==0){W.error("Failed"),T("Done");return}await D(Q,{type:"wellknown",key:_.auth.env,token:N.trim()}),W.success("Logged into "+Q),T("Done");return}await V.refresh(!0).catch(()=>{});let B=await M.runPromise(s.Service.use((Q)=>Q.get())),J=new Set(B.disabled_providers??[]),X=B.enabled_providers?new Set(B.enabled_providers):void 0,H=await V.get().then((Q)=>{let _={};for(let[F,C]of Object.entries(Q))if((X?X.has(F):!0)&&!J.has(F))_[F]=C;return _}),Z=await M.runPromise(O.gen(function*(){return yield*(yield*a.Service).list()})),j=i,q=G1({hooks:Z,existingProviders:H,disabled:J,enabled:X,providerNames:Object.fromEntries(Object.entries(B.provider??{}).map(([Q,_])=>[Q,_.name]))}),S=[...r(d(H),j,(Q)=>({openai:"ChatGPT Plus/Pro or API key"})[Q.id]),...q.map((Q)=>({label:Q.name,value:Q.id,hint:"plugin"}))],G=await W1(),e=G?[G.id,...G.aliases??[]]:[],K;if(G&&$.provider&&e.includes($.provider)){await G.run();return}else if($.provider){let Q=$.provider,_=S.find((N)=>N.value===Q),F=S.find((N)=>N.label.toLowerCase()===Q.toLowerCase()),C=_??F;if(!C)W.error(`Unknown provider "${Q}"`),process.exit(1);K=C.value}else{let Q=await b({message:U("cli.providers.select"),options:[...G?.menu?[{label:G.menu.label,value:G.id,hint:G.menu.hint}]:[],{label:U("cli.providers.other"),value:"__other__"}]});if(w(Q))throw new Y.CancelledError;if(G&&Q===G.id){await G.run();return}let _=await u({message:U("cli.providers.select"),maxItems:8,options:[...S,{value:"other",label:"Other"}]});if(w(_))throw new Y.CancelledError;K=_}let E=Z.findLast((Q)=>Q.auth?.provider===K);if(E&&E.auth){if(await x({auth:E.auth},K,$.method))return}if(K==="other"){let Q=await P({message:"Enter provider id",validate:(F)=>F&&F.match(/^[0-9a-z-]+$/)?void 0:"a-z, 0-9 and hyphens only"});if(w(Q))throw new Y.CancelledError;K=Q.replace(/^@ai-sdk\//,"");let _=Z.findLast((F)=>F.auth?.provider===K);if(_&&_.auth){if(await x({auth:_.auth},K,$.method))return}W.warn(`This only stores a credential for ${K} - you will need configure it in qitqode.json, check the docs for examples.`)}if(K==="amazon-bedrock")W.info(`Amazon Bedrock authentication priority:
3
3
  1. Bearer token (AWS_BEARER_TOKEN_BEDROCK or /connect)
4
4
  2. AWS credential chain (profile, access keys, IAM roles, EKS IRSA)
5
5
 
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Hf as _}from"./chunk-2drzgtv3.js";import{tO as r}from"./chunk-r9w0thdk.js";var O=r((e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.getRegionInfo=e.resolveRegionConfig=e.NODE_REGION_CONFIG_FILE_OPTIONS=e.NODE_REGION_CONFIG_OPTIONS=e.REGION_INI_NAME=e.REGION_ENV_NAME=e.resolveEndpointsConfig=e.resolveCustomEndpointsConfig=e.nodeFipsConfigSelectors=e.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS=e.DEFAULT_USE_FIPS_ENDPOINT=e.CONFIG_USE_FIPS_ENDPOINT=e.ENV_USE_FIPS_ENDPOINT=e.nodeDualstackConfigSelectors=e.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS=e.DEFAULT_USE_DUALSTACK_ENDPOINT=e.CONFIG_USE_DUALSTACK_ENDPOINT=e.ENV_USE_DUALSTACK_ENDPOINT=void 0;var t=_();Object.defineProperty(e,"ENV_USE_DUALSTACK_ENDPOINT",{enumerable:!0,get:function(){return t.ENV_USE_DUALSTACK_ENDPOINT}});Object.defineProperty(e,"CONFIG_USE_DUALSTACK_ENDPOINT",{enumerable:!0,get:function(){return t.CONFIG_USE_DUALSTACK_ENDPOINT}});Object.defineProperty(e,"DEFAULT_USE_DUALSTACK_ENDPOINT",{enumerable:!0,get:function(){return t.DEFAULT_USE_DUALSTACK_ENDPOINT}});Object.defineProperty(e,"NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS",{enumerable:!0,get:function(){return t.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS}});Object.defineProperty(e,"nodeDualstackConfigSelectors",{enumerable:!0,get:function(){return t.nodeDualstackConfigSelectors}});Object.defineProperty(e,"ENV_USE_FIPS_ENDPOINT",{enumerable:!0,get:function(){return t.ENV_USE_FIPS_ENDPOINT}});Object.defineProperty(e,"CONFIG_USE_FIPS_ENDPOINT",{enumerable:!0,get:function(){return t.CONFIG_USE_FIPS_ENDPOINT}});Object.defineProperty(e,"DEFAULT_USE_FIPS_ENDPOINT",{enumerable:!0,get:function(){return t.DEFAULT_USE_FIPS_ENDPOINT}});Object.defineProperty(e,"NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS",{enumerable:!0,get:function(){return t.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS}});Object.defineProperty(e,"nodeFipsConfigSelectors",{enumerable:!0,get:function(){return t.nodeFipsConfigSelectors}});Object.defineProperty(e,"resolveCustomEndpointsConfig",{enumerable:!0,get:function(){return t.resolveCustomEndpointsConfig}});Object.defineProperty(e,"resolveEndpointsConfig",{enumerable:!0,get:function(){return t.resolveEndpointsConfig}});Object.defineProperty(e,"REGION_ENV_NAME",{enumerable:!0,get:function(){return t.REGION_ENV_NAME}});Object.defineProperty(e,"REGION_INI_NAME",{enumerable:!0,get:function(){return t.REGION_INI_NAME}});Object.defineProperty(e,"NODE_REGION_CONFIG_OPTIONS",{enumerable:!0,get:function(){return t.NODE_REGION_CONFIG_OPTIONS}});Object.defineProperty(e,"NODE_REGION_CONFIG_FILE_OPTIONS",{enumerable:!0,get:function(){return t.NODE_REGION_CONFIG_FILE_OPTIONS}});Object.defineProperty(e,"resolveRegionConfig",{enumerable:!0,get:function(){return t.resolveRegionConfig}});Object.defineProperty(e,"getRegionInfo",{enumerable:!0,get:function(){return t.getRegionInfo}})});var u=r((n)=>{Object.defineProperty(n,"__esModule",{value:!0});n.loadConfig=void 0;var o=_();Object.defineProperty(n,"loadConfig",{enumerable:!0,get:function(){return o.loadConfig}})});
3
- export{O as ie,u as je};
2
+ import{If as _}from"./chunk-yxttz5z5.js";import{TP as r}from"./chunk-f2pv705d.js";var O=r((e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.getRegionInfo=e.resolveRegionConfig=e.NODE_REGION_CONFIG_FILE_OPTIONS=e.NODE_REGION_CONFIG_OPTIONS=e.REGION_INI_NAME=e.REGION_ENV_NAME=e.resolveEndpointsConfig=e.resolveCustomEndpointsConfig=e.nodeFipsConfigSelectors=e.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS=e.DEFAULT_USE_FIPS_ENDPOINT=e.CONFIG_USE_FIPS_ENDPOINT=e.ENV_USE_FIPS_ENDPOINT=e.nodeDualstackConfigSelectors=e.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS=e.DEFAULT_USE_DUALSTACK_ENDPOINT=e.CONFIG_USE_DUALSTACK_ENDPOINT=e.ENV_USE_DUALSTACK_ENDPOINT=void 0;var t=_();Object.defineProperty(e,"ENV_USE_DUALSTACK_ENDPOINT",{enumerable:!0,get:function(){return t.ENV_USE_DUALSTACK_ENDPOINT}});Object.defineProperty(e,"CONFIG_USE_DUALSTACK_ENDPOINT",{enumerable:!0,get:function(){return t.CONFIG_USE_DUALSTACK_ENDPOINT}});Object.defineProperty(e,"DEFAULT_USE_DUALSTACK_ENDPOINT",{enumerable:!0,get:function(){return t.DEFAULT_USE_DUALSTACK_ENDPOINT}});Object.defineProperty(e,"NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS",{enumerable:!0,get:function(){return t.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS}});Object.defineProperty(e,"nodeDualstackConfigSelectors",{enumerable:!0,get:function(){return t.nodeDualstackConfigSelectors}});Object.defineProperty(e,"ENV_USE_FIPS_ENDPOINT",{enumerable:!0,get:function(){return t.ENV_USE_FIPS_ENDPOINT}});Object.defineProperty(e,"CONFIG_USE_FIPS_ENDPOINT",{enumerable:!0,get:function(){return t.CONFIG_USE_FIPS_ENDPOINT}});Object.defineProperty(e,"DEFAULT_USE_FIPS_ENDPOINT",{enumerable:!0,get:function(){return t.DEFAULT_USE_FIPS_ENDPOINT}});Object.defineProperty(e,"NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS",{enumerable:!0,get:function(){return t.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS}});Object.defineProperty(e,"nodeFipsConfigSelectors",{enumerable:!0,get:function(){return t.nodeFipsConfigSelectors}});Object.defineProperty(e,"resolveCustomEndpointsConfig",{enumerable:!0,get:function(){return t.resolveCustomEndpointsConfig}});Object.defineProperty(e,"resolveEndpointsConfig",{enumerable:!0,get:function(){return t.resolveEndpointsConfig}});Object.defineProperty(e,"REGION_ENV_NAME",{enumerable:!0,get:function(){return t.REGION_ENV_NAME}});Object.defineProperty(e,"REGION_INI_NAME",{enumerable:!0,get:function(){return t.REGION_INI_NAME}});Object.defineProperty(e,"NODE_REGION_CONFIG_OPTIONS",{enumerable:!0,get:function(){return t.NODE_REGION_CONFIG_OPTIONS}});Object.defineProperty(e,"NODE_REGION_CONFIG_FILE_OPTIONS",{enumerable:!0,get:function(){return t.NODE_REGION_CONFIG_FILE_OPTIONS}});Object.defineProperty(e,"resolveRegionConfig",{enumerable:!0,get:function(){return t.resolveRegionConfig}});Object.defineProperty(e,"getRegionInfo",{enumerable:!0,get:function(){return t.getRegionInfo}})});var u=r((n)=>{Object.defineProperty(n,"__esModule",{value:!0});n.loadConfig=void 0;var o=_();Object.defineProperty(n,"loadConfig",{enumerable:!0,get:function(){return o.loadConfig}})});
3
+ export{O as je,u as ke};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var x=Object.defineProperty,z=(t,q,w)=>(q in t)?x(t,q,{enumerable:!0,configurable:!0,writable:!0,value:w}):t[q]=w,A=(t,q,w)=>(z(t,typeof q!="symbol"?q+"":q,w),w);
3
- export{A as Ph};
3
+ export{A as Qh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-f2pv705d.js";var R="./libopentui-c8ye7mqw.dylib";export{R as default};
package/bundle/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Tf as eD,Uf as g0}from"./chunk-mhtxp66q.js";import{$f as a0,Wf as s0,Xf as r0,ag as e0}from"./chunk-cbnkx933.js";import{dg as Ku}from"./chunk-eg3syjtv.js";import{$r as l0}from"./chunk-7vmx8bg9.js";import{as as d0}from"./chunk-tkrwcjkr.js";import"./chunk-vdrz2t9c.js";import{Cs as y0,ds as Lu,es as o0,fs as k0,gs as hF}from"./chunk-fr34mnyg.js";import{Hs as GF}from"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import{sO as v2,tO as p2,wO as p}from"./chunk-r9w0thdk.js";var eF=p2((j3,aF)=>{aF.exports=function(u){if(u===void 0)u=2;if(u>=Error.stackTraceLimit)throw TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+u+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var F=Error.prepareStackTrace;Error.prepareStackTrace=function(C,f){return f};var E=Error().stack;if(Error.prepareStackTrace=F,E!==null&&typeof E==="object")return E[u]?E[u].getFileName():void 0}});import{notStrictEqual as m2,strictEqual as i2}from"assert";var E2={right:f2,center:$2};class XF{constructor(D){var u;this.width=D.width,this.wrap=(u=D.wrap)!==null&&u!==void 0?u:!0,this.rows=[]}span(...D){let u=this.div(...D);u.span=!0}resetOutput(){this.rows=[]}div(...D){if(D.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...D)&&typeof D[0]==="string")return this.applyLayoutDSL(D[0]);let u=D.map((F)=>{if(typeof F==="string")return this.colFromString(F);return F});return this.rows.push(u),u}shouldApplyLayoutDSL(...D){return D.length===1&&typeof D[0]==="string"&&/[\t\n]/.test(D[0])}applyLayoutDSL(D){let u=D.split(`
2
+ import{Uf as eD,Vf as g0}from"./chunk-djqxbnwc.js";import{Xf as s0,Yf as r0,ag as a0,bg as e0}from"./chunk-r4kg0z96.js";import{eg as Ku}from"./chunk-s06t769q.js";import{zt as l0}from"./chunk-ntpn0w9m.js";import{At as d0}from"./chunk-0qpqd7nz.js";import"./chunk-gdew7bwm.js";import{Dt as Lu,Et as o0,Ft as k0,Gt as hF,au as y0}from"./chunk-v3nmnm57.js";import{fu as GF}from"./chunk-hwsqqkrv.js";import"./chunk-mbbxedsq.js";import"./chunk-aa2n02qk.js";import"./chunk-k1x8469r.js";import"./chunk-c3szabpf.js";import"./chunk-c8prg3jx.js";import"./chunk-t8sy5sgx.js";import"./chunk-tezrgfc6.js";import{SP as v2,TP as p2,WP as p}from"./chunk-f2pv705d.js";var eF=p2((j3,aF)=>{aF.exports=function(u){if(u===void 0)u=2;if(u>=Error.stackTraceLimit)throw TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+u+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var F=Error.prepareStackTrace;Error.prepareStackTrace=function(C,f){return f};var E=Error().stack;if(Error.prepareStackTrace=F,E!==null&&typeof E==="object")return E[u]?E[u].getFileName():void 0}});import{notStrictEqual as m2,strictEqual as i2}from"assert";var E2={right:f2,center:$2};class XF{constructor(D){var u;this.width=D.width,this.wrap=(u=D.wrap)!==null&&u!==void 0?u:!0,this.rows=[]}span(...D){let u=this.div(...D);u.span=!0}resetOutput(){this.rows=[]}div(...D){if(D.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...D)&&typeof D[0]==="string")return this.applyLayoutDSL(D[0]);let u=D.map((F)=>{if(typeof F==="string")return this.colFromString(F);return F});return this.rows.push(u),u}shouldApplyLayoutDSL(...D){return D.length===1&&typeof D[0]==="string"&&/[\t\n]/.test(D[0])}applyLayoutDSL(D){let u=D.split(`
3
3
  `).map((E)=>E.split("\t")),F=0;return u.forEach((E)=>{if(E.length>1&&JD.stringWidth(E[0])>F)F=Math.min(Math.floor(this.width*0.5),JD.stringWidth(E[0]))}),u.forEach((E)=>{this.div(...E.map((C,f)=>{return{text:C.trim(),padding:this.measurePadding(C),width:f===0&&E.length>1?F:void 0}}))}),this.rows[this.rows.length-1]}colFromString(D){return{text:D,padding:this.measurePadding(D)}}measurePadding(D){let u=JD.stripAnsi(D);return[0,u.match(/\s*$/)[0].length,0,u.match(/^\s*/)[0].length]}toString(){let D=[];return this.rows.forEach((u)=>{this.rowToString(u,D)}),D.filter((u)=>!u.hidden).map((u)=>u.text).join(`
4
4
  `)}rowToString(D,u){return this.rasterize(D).forEach((F,E)=>{let C="";F.forEach((f,$)=>{let{width:G}=D[$],J=this.negatePadding(D[$]),Y=f;if(J>JD.stringWidth(f))Y+=" ".repeat(J-JD.stringWidth(f));if(D[$].align&&D[$].align!=="left"&&this.wrap){let Q=E2[D[$].align];if(Y=Q(Y,J),JD.stringWidth(Y)<J)Y+=" ".repeat((G||0)-JD.stringWidth(Y)-1)}let U=D[$].padding||[0,0,0,0];if(U[3])C+=" ".repeat(U[3]);if(C+=ZF(D[$],Y,"| "),C+=Y,C+=ZF(D[$],Y," |"),U[1])C+=" ".repeat(U[1]);if(E===0&&u.length>0)C=this.renderInline(C,u[u.length-1])}),u.push({text:C.replace(/ +$/,""),span:D.span})}),u}renderInline(D,u){let F=D.match(/^ */),E=F?F[0].length:0,C=u.text,f=JD.stringWidth(C.trimRight());if(!u.span)return D;if(!this.wrap)return u.hidden=!0,C+D;if(E<f)return D;return u.hidden=!0,C.trimRight()+" ".repeat(E-f)+D.trimLeft()}rasterize(D){let u=[],F=this.columnWidths(D),E;return D.forEach((C,f)=>{if(C.width=F[f],this.wrap)E=JD.wrap(C.text,this.negatePadding(C),{hard:!0}).split(`
5
5
  `);else E=C.text.split(`
@@ -77,5 +77,5 @@ ${W.join(`
77
77
  `;Z.forEach((W)=>{O+=W}),u.fail(O)}};let J={};f.conflicts=function(Q,Z){if(q("<string|object> [array|string]",[Q,Z],arguments.length),typeof Q==="object")Object.keys(Q).forEach((O)=>{f.conflicts(O,Q[O])});else{if(D.global(Q),!J[Q])J[Q]=[];if(Array.isArray(Z))Z.forEach((O)=>f.conflicts(Q,O));else J[Q].push(Z)}},f.getConflicting=()=>J,f.conflicting=function(Q){if(Object.keys(Q).forEach((Z)=>{if(J[Z])J[Z].forEach((O)=>{if(O&&Q[Z]!==void 0&&Q[O]!==void 0)u.fail(E("Arguments %s and %s are mutually exclusive",Z,O))})}),D.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(J).forEach((Z)=>{J[Z].forEach((O)=>{if(O&&Q[F.Parser.camelCase(Z)]!==void 0&&Q[F.Parser.camelCase(O)]!==void 0)u.fail(E("Arguments %s and %s are mutually exclusive",Z,O))})})},f.recommendCommands=function(Q,Z){Z=Z.sort((A,v)=>v.length-A.length);let W=null,X=1/0;for(let A=0,v;(v=Z[A])!==void 0;A++){let n=O0(Q,v);if(n<=3&&n<X)X=n,W=v}if(W)u.fail(E("Did you mean %s?",W))},f.reset=function(Q){return $=xD($,(Z)=>!Q[Z]),J=xD(J,(Z)=>!Q[Z]),f};let Y=[];return f.freeze=function(){Y.push({implied:$,conflicting:J})},f.unfreeze=function(){let Q=Y.pop();ZD(Q,void 0,F),{implied:$,conflicting:J}=Q},f}var su=[],$u;function hu(D,u,F,E){$u=E;let C={};if(Object.prototype.hasOwnProperty.call(D,"extends")){if(typeof D.extends!=="string")return C;let f=/\.json|\..*rc$/.test(D.extends),$=null;if(!f)try{$=import.meta.resolve(D.extends)}catch(G){return D}else $=Z8(u,D.extends);M8($),su.push($),C=f?JSON.parse($u.readFileSync($,"utf8")):E.require(D.extends),delete D.extends,C=hu(C,$u.path.dirname($),F,$u)}return su=[],F?W0(C,D):Object.assign({},C,D)}function M8(D){if(su.indexOf(D)>-1)throw new DD(`Circular extended configurations: '${D}'.`)}function Z8(D,u){return $u.path.resolve(D,u)}function W0(D,u){let F={};function E(C){return C&&typeof C==="object"&&!Array.isArray(C)}Object.assign(F,D);for(let C of Object.keys(u))if(E(u[C])&&E(F[C]))F[C]=W0(D[C],u[C]);else F[C]=u[C];return F}var H=function(D,u,F,E,C){if(E==="m")throw TypeError("Private method is not writable");if(E==="a"&&!C)throw TypeError("Private accessor was defined without a setter");if(typeof u==="function"?D!==u||!C:!u.has(D))throw TypeError("Cannot write private member to an object whose class did not declare it");return E==="a"?C.call(D,F):C?C.value=F:u.set(D,F),F},B=function(D,u,F,E){if(F==="a"&&!E)throw TypeError("Private accessor was defined without a getter");if(typeof u==="function"?D!==u||!E:!u.has(D))throw TypeError("Cannot read private member from an object whose class did not declare it");return F==="m"?E:F==="a"?E.call(D):E?E.value:u.get(D)},uD,vD,zu,XD,QD,Wu,wD,mD,Uu,WD,Nu,UD,VD,OD,ND,Ru,iD,hD,K,ju,qu,TD,dD,Fu,oD,bD,Hu,P,kD,gD,yD,b,Iu,_D,r;function c0(D){return(u=[],F=D.process.cwd(),E)=>{let C=new p0(u,F,E,D);return Object.defineProperty(C,"argv",{get:()=>{return C.parse()},enumerable:!0}),C.help(),C.version(),C}}var U0=Symbol("copyDoubleDash"),N0=Symbol("copyDoubleDash"),ru=Symbol("deleteFromParserHintObject"),R0=Symbol("emitWarning"),j0=Symbol("freeze"),q0=Symbol("getDollarZero"),lD=Symbol("getParserConfiguration"),H0=Symbol("getUsageConfiguration"),au=Symbol("guessLocale"),I0=Symbol("guessVersion"),V0=Symbol("parsePositionalNumbers"),eu=Symbol("pkgUp"),tD=Symbol("populateParserHintArray"),Eu=Symbol("populateParserHintSingleValueDictionary"),DF=Symbol("populateParserHintArrayDictionary"),uF=Symbol("populateParserHintDictionary"),FF=Symbol("sanitizeKey"),EF=Symbol("setKey"),CF=Symbol("unfreeze"),_0=Symbol("validateAsync"),K0=Symbol("getCommandInstance"),L0=Symbol("getContext"),A0=Symbol("getHasOutput"),S0=Symbol("getLoggerInstance"),x0=Symbol("getParseContext"),P0=Symbol("getUsageInstance"),w0=Symbol("getValidationInstance"),Vu=Symbol("hasParseCallback"),b0=Symbol("isGlobalContext"),sD=Symbol("postProcess"),t0=Symbol("rebase"),BF=Symbol("reset"),Gu=Symbol("runYargsParserAndExecuteCommands"),fF=Symbol("runValidation"),n0=Symbol("setHasOutput"),rD=Symbol("kTrackManuallySetKeys"),X8="en_US";class p0{constructor(D=[],u,F,E){this.customScriptName=!1,this.parsed=!1,uD.set(this,void 0),vD.set(this,void 0),zu.set(this,{commands:[],fullCommands:[]}),XD.set(this,null),QD.set(this,null),Wu.set(this,"show-hidden"),wD.set(this,null),mD.set(this,!0),Uu.set(this,{}),WD.set(this,!0),Nu.set(this,[]),UD.set(this,void 0),VD.set(this,{}),OD.set(this,!1),ND.set(this,null),Ru.set(this,!0),iD.set(this,void 0),hD.set(this,""),K.set(this,void 0),ju.set(this,void 0),qu.set(this,{}),TD.set(this,null),dD.set(this,null),Fu.set(this,{}),oD.set(this,{}),bD.set(this,void 0),Hu.set(this,!1),P.set(this,void 0),kD.set(this,!1),gD.set(this,!1),yD.set(this,!1),b.set(this,void 0),Iu.set(this,{}),_D.set(this,null),r.set(this,void 0),H(this,P,E,"f"),H(this,bD,D,"f"),H(this,vD,u,"f"),H(this,ju,F,"f"),H(this,UD,new yu(this),"f"),this.$0=this[q0](),this[BF](),H(this,uD,B(this,uD,"f"),"f"),H(this,b,B(this,b,"f"),"f"),H(this,r,B(this,r,"f"),"f"),H(this,K,B(this,K,"f"),"f"),B(this,K,"f").showHiddenOpt=B(this,Wu,"f"),H(this,iD,this[N0](),"f"),B(this,P,"f").y18n.setLocale(X8)}addHelpOpt(D,u){if(q("[string|boolean] [string]",[D,u],arguments.length),B(this,ND,"f"))this[ru](B(this,ND,"f")),H(this,ND,null,"f");if(D===!1&&u===void 0)return this;return H(this,ND,typeof D==="string"?D:"help","f"),this.boolean(B(this,ND,"f")),this.describe(B(this,ND,"f"),u||B(this,b,"f").deferY18nLookup("Show help")),this}help(D,u){return this.addHelpOpt(D,u)}addShowHiddenOpt(D,u){if(q("[string|boolean] [string]",[D,u],arguments.length),D===!1&&u===void 0)return this;let F=typeof D==="string"?D:B(this,Wu,"f");return this.boolean(F),this.describe(F,u||B(this,b,"f").deferY18nLookup("Show hidden options")),B(this,K,"f").showHiddenOpt=F,this}showHidden(D,u){return this.addShowHiddenOpt(D,u)}alias(D,u){return q("<object|string|array> [string|array]",[D,u],arguments.length),this[DF](this.alias.bind(this),"alias",D,u),this}array(D){return q("<array|string>",[D],arguments.length),this[tD]("array",D),this[rD](D),this}boolean(D){return q("<array|string>",[D],arguments.length),this[tD]("boolean",D),this[rD](D),this}check(D,u){return q("<function> [boolean]",[D,u],arguments.length),this.middleware((F,E)=>{return pD(()=>{return D(F,E.getOptions())},(C)=>{if(!C)B(this,b,"f").fail(B(this,P,"f").y18n.__("Argument check failed: %s",D.toString()));else if(typeof C==="string"||C instanceof Error)B(this,b,"f").fail(C.toString(),C);return F},(C)=>{return B(this,b,"f").fail(C.message?C.message:C.toString(),C),F})},!1,u),this}choices(D,u){return q("<object|string|array> [string|array]",[D,u],arguments.length),this[DF](this.choices.bind(this),"choices",D,u),this}coerce(D,u){if(q("<object|string|array> [function]",[D,u],arguments.length),Array.isArray(D)){if(!u)throw new DD("coerce callback must be provided");for(let E of D)this.coerce(E,u);return this}else if(typeof D==="object"){for(let E of Object.keys(D))this.coerce(E,D[E]);return this}if(!u)throw new DD("coerce callback must be provided");let F=D;return B(this,K,"f").key[F]=!0,B(this,UD,"f").addCoerceMiddleware((E,C)=>{var f;let $=(f=C.getAliases()[F])!==null&&f!==void 0?f:[],G=[F,...$].filter((J)=>Object.prototype.hasOwnProperty.call(E,J));if(G.length===0)return E;return pD(()=>{return u(E[G[0]])},(J)=>{return G.forEach((Y)=>{E[Y]=J}),E},(J)=>{throw new DD(J.message)})},F),this}conflicts(D,u){return q("<string|object> [string|array]",[D,u],arguments.length),B(this,r,"f").conflicts(D,u),this}config(D="config",u,F){if(q("[object|string] [string|function] [function]",[D,u,F],arguments.length),typeof D==="object"&&!Array.isArray(D))return D=hu(D,B(this,vD,"f"),this[lD]()["deep-merge-config"]||!1,B(this,P,"f")),B(this,K,"f").configObjects=(B(this,K,"f").configObjects||[]).concat(D),this;if(typeof u==="function")F=u,u=void 0;return this.describe(D,u||B(this,b,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(D)?D:[D]).forEach((E)=>{B(this,K,"f").config[E]=F||!0}),this}completion(D,u,F){if(q("[string] [string|boolean|function] [function]",[D,u,F],arguments.length),typeof u==="function")F=u,u=void 0;if(H(this,QD,D||B(this,QD,"f")||"completion","f"),!u&&u!==!1)u="generate completion script";if(this.command(B(this,QD,"f"),u),F)B(this,XD,"f").registerFunction(F);return this}command(D,u,F,E,C,f){return q("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[D,u,F,E,C,f],arguments.length),B(this,uD,"f").addHandler(D,u,F,E,C,f),this}commands(D,u,F,E,C,f){return this.command(D,u,F,E,C,f)}commandDir(D,u){q("<string> [object]",[D,u],arguments.length);let F=B(this,ju,"f")||B(this,P,"f").require;return B(this,uD,"f").addDirectory(D,F,B(this,P,"f").getCallerFile(),u),this}count(D){return q("<array|string>",[D],arguments.length),this[tD]("count",D),this[rD](D),this}default(D,u,F){if(q("<object|string|array> [*] [string]",[D,u,F],arguments.length),F)gu(D,B(this,P,"f")),B(this,K,"f").defaultDescription[D]=F;if(typeof u==="function"){if(gu(D,B(this,P,"f")),!B(this,K,"f").defaultDescription[D])B(this,K,"f").defaultDescription[D]=B(this,b,"f").functionDescription(u);u=u.call()}return this[Eu](this.default.bind(this),"default",D,u),this}defaults(D,u,F){return this.default(D,u,F)}demandCommand(D=1,u,F,E){if(q("[number] [number|string] [string|null|undefined] [string|null|undefined]",[D,u,F,E],arguments.length),typeof u!=="number")F=u,u=1/0;return this.global("_",!1),B(this,K,"f").demandedCommands._={min:D,max:u,minMsg:F,maxMsg:E},this}demand(D,u,F){if(Array.isArray(u))u.forEach((E)=>{ZD(F,!0,B(this,P,"f")),this.demandOption(E,F)}),u=1/0;else if(typeof u!=="number")F=u,u=1/0;if(typeof D==="number")ZD(F,!0,B(this,P,"f")),this.demandCommand(D,u,F,F);else if(Array.isArray(D))D.forEach((E)=>{ZD(F,!0,B(this,P,"f")),this.demandOption(E,F)});else if(typeof F==="string")this.demandOption(D,F);else if(F===!0||typeof F>"u")this.demandOption(D);return this}demandOption(D,u){return q("<object|string|array> [string]",[D,u],arguments.length),this[Eu](this.demandOption.bind(this),"demandedOptions",D,u),this}deprecateOption(D,u){return q("<string> [string|boolean]",[D,u],arguments.length),B(this,K,"f").deprecatedOptions[D]=u,this}describe(D,u){return q("<object|string|array> [string]",[D,u],arguments.length),this[EF](D,!0),B(this,b,"f").describe(D,u),this}detectLocale(D){return q("<boolean>",[D],arguments.length),H(this,mD,D,"f"),this}env(D){if(q("[string|boolean]",[D],arguments.length),D===!1)delete B(this,K,"f").envPrefix;else B(this,K,"f").envPrefix=D||"";return this}epilogue(D){return q("<string>",[D],arguments.length),B(this,b,"f").epilog(D),this}epilog(D){return this.epilogue(D)}example(D,u){if(q("<string|array> [string]",[D,u],arguments.length),Array.isArray(D))D.forEach((F)=>this.example(...F));else B(this,b,"f").example(D,u);return this}exit(D,u){if(H(this,OD,!0,"f"),H(this,wD,u,"f"),B(this,WD,"f"))B(this,P,"f").process.exit(D)}exitProcess(D=!0){return q("[boolean]",[D],arguments.length),H(this,WD,D,"f"),this}fail(D){if(q("<function|boolean>",[D],arguments.length),typeof D==="boolean"&&D!==!1)throw new DD("Invalid first argument. Expected function or boolean 'false'");return B(this,b,"f").failFn(D),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(D,u){if(q("<array> [function]",[D,u],arguments.length),!u)return new Promise((F,E)=>{B(this,XD,"f").getCompletion(D,(C,f)=>{if(C)E(C);else F(f)})});else return B(this,XD,"f").getCompletion(D,u)}getDemandedOptions(){return q([],0),B(this,K,"f").demandedOptions}getDemandedCommands(){return q([],0),B(this,K,"f").demandedCommands}getDeprecatedOptions(){return q([],0),B(this,K,"f").deprecatedOptions}getDetectLocale(){return B(this,mD,"f")}getExitProcess(){return B(this,WD,"f")}getGroups(){return Object.assign({},B(this,VD,"f"),B(this,oD,"f"))}getHelp(){if(H(this,OD,!0,"f"),!B(this,b,"f").hasCachedHelpMessage()){if(!this.parsed){let u=this[Gu](B(this,bD,"f"),void 0,void 0,0,!0);if(y(u))return u.then(()=>{return B(this,b,"f").help()})}let D=B(this,uD,"f").runDefaultBuilderOn(this);if(y(D))return D.then(()=>{return B(this,b,"f").help()})}return Promise.resolve(B(this,b,"f").help())}getOptions(){return B(this,K,"f")}getStrict(){return B(this,kD,"f")}getStrictCommands(){return B(this,gD,"f")}getStrictOptions(){return B(this,yD,"f")}global(D,u){if(q("<string|array> [boolean]",[D,u],arguments.length),D=[].concat(D),u!==!1)B(this,K,"f").local=B(this,K,"f").local.filter((F)=>D.indexOf(F)===-1);else D.forEach((F)=>{if(!B(this,K,"f").local.includes(F))B(this,K,"f").local.push(F)});return this}group(D,u){q("<string|array> <string>",[D,u],arguments.length);let F=B(this,oD,"f")[u]||B(this,VD,"f")[u];if(B(this,oD,"f")[u])delete B(this,oD,"f")[u];let E={};return B(this,VD,"f")[u]=(F||[]).concat(D).filter((C)=>{if(E[C])return!1;return E[C]=!0}),this}hide(D){return q("<string>",[D],arguments.length),B(this,K,"f").hiddenOptions.push(D),this}implies(D,u){return q("<string|object> [number|string|array]",[D,u],arguments.length),B(this,r,"f").implies(D,u),this}locale(D){if(q("[string]",[D],arguments.length),D===void 0)return this[au](),B(this,P,"f").y18n.getLocale();return H(this,mD,!1,"f"),B(this,P,"f").y18n.setLocale(D),this}middleware(D,u,F){return B(this,UD,"f").addMiddleware(D,!!u,F)}nargs(D,u){return q("<string|object|array> [number]",[D,u],arguments.length),this[Eu](this.nargs.bind(this),"narg",D,u),this}normalize(D){return q("<array|string>",[D],arguments.length),this[tD]("normalize",D),this}number(D){return q("<array|string>",[D],arguments.length),this[tD]("number",D),this[rD](D),this}option(D,u){if(q("<string|object> [object]",[D,u],arguments.length),typeof D==="object")Object.keys(D).forEach((F)=>{this.options(F,D[F])});else{if(typeof u!=="object")u={};if(this[rD](D),B(this,_D,"f")&&(D==="version"||(u===null||u===void 0?void 0:u.alias)==="version"))this[R0](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
78
78
  `),void 0,"versionWarning");if(B(this,K,"f").key[D]=!0,u.alias)this.alias(D,u.alias);let F=u.deprecate||u.deprecated;if(F)this.deprecateOption(D,F);let E=u.demand||u.required||u.require;if(E)this.demand(D,E);if(u.demandOption)this.demandOption(D,typeof u.demandOption==="string"?u.demandOption:void 0);if(u.conflicts)this.conflicts(D,u.conflicts);if("default"in u)this.default(D,u.default);if(u.implies!==void 0)this.implies(D,u.implies);if(u.nargs!==void 0)this.nargs(D,u.nargs);if(u.config)this.config(D,u.configParser);if(u.normalize)this.normalize(D);if(u.choices)this.choices(D,u.choices);if(u.coerce)this.coerce(D,u.coerce);if(u.group)this.group(D,u.group);if(u.boolean||u.type==="boolean"){if(this.boolean(D),u.alias)this.boolean(u.alias)}if(u.array||u.type==="array"){if(this.array(D),u.alias)this.array(u.alias)}if(u.number||u.type==="number"){if(this.number(D),u.alias)this.number(u.alias)}if(u.string||u.type==="string"){if(this.string(D),u.alias)this.string(u.alias)}if(u.count||u.type==="count")this.count(D);if(typeof u.global==="boolean")this.global(D,u.global);if(u.defaultDescription)B(this,K,"f").defaultDescription[D]=u.defaultDescription;if(u.skipValidation)this.skipValidation(D);let C=u.describe||u.description||u.desc,f=B(this,b,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(f,D)||typeof C==="string")this.describe(D,C);if(u.hidden)this.hide(D);if(u.requiresArg)this.requiresArg(D)}return this}options(D,u){return this.option(D,u)}parse(D,u,F){if(q("[string|array] [function|boolean|object] [function]",[D,u,F],arguments.length),this[j0](),typeof D>"u")D=B(this,bD,"f");if(typeof u==="object")H(this,dD,u,"f"),u=F;if(typeof u==="function")H(this,TD,u,"f"),u=!1;if(!u)H(this,bD,D,"f");if(B(this,TD,"f"))H(this,WD,!1,"f");let E=this[Gu](D,!!u),C=this.parsed;if(B(this,XD,"f").setParsed(this.parsed),y(E))return E.then((f)=>{if(B(this,TD,"f"))B(this,TD,"f").call(this,B(this,wD,"f"),f,B(this,hD,"f"));return f}).catch((f)=>{if(B(this,TD,"f"))B(this,TD,"f")(f,this.parsed.argv,B(this,hD,"f"));throw f}).finally(()=>{this[CF](),this.parsed=C});else{if(B(this,TD,"f"))B(this,TD,"f").call(this,B(this,wD,"f"),E,B(this,hD,"f"));this[CF](),this.parsed=C}return E}parseAsync(D,u,F){let E=this.parse(D,u,F);return!y(E)?Promise.resolve(E):E}parseSync(D,u,F){let E=this.parse(D,u,F);if(y(E))throw new DD(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return E}parserConfiguration(D){return q("<object>",[D],arguments.length),H(this,qu,D,"f"),this}pkgConf(D,u){q("<string> [string]",[D,u],arguments.length);let F=null,E=this[eu](u||B(this,vD,"f"));if(E[D]&&typeof E[D]==="object")F=hu(E[D],u||B(this,vD,"f"),this[lD]()["deep-merge-config"]||!1,B(this,P,"f")),B(this,K,"f").configObjects=(B(this,K,"f").configObjects||[]).concat(F);return this}positional(D,u){q("<string> <object>",[D,u],arguments.length);let F=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];u=xD(u,(f,$)=>{if(f==="type"&&!["string","number","boolean"].includes($))return!1;return F.includes(f)});let E=B(this,zu,"f").fullCommands[B(this,zu,"f").fullCommands.length-1],C=E?B(this,uD,"f").cmdToParseOptions(E):{array:[],alias:{},default:{},demand:{}};return Du(C).forEach((f)=>{let $=C[f];if(Array.isArray($)){if($.indexOf(D)!==-1)u[f]=!0}else if($[D]&&!(f in u))u[f]=$[D]}),this.group(D,B(this,b,"f").getPositionalGroupName()),this.option(D,u)}recommendCommands(D=!0){return q("[boolean]",[D],arguments.length),H(this,Hu,D,"f"),this}required(D,u,F){return this.demand(D,u,F)}require(D,u,F){return this.demand(D,u,F)}requiresArg(D){if(q("<array|string|object> [number]",[D],arguments.length),typeof D==="string"&&B(this,K,"f").narg[D])return this;else this[Eu](this.requiresArg.bind(this),"narg",D,NaN);return this}showCompletionScript(D,u){return q("[string] [string]",[D,u],arguments.length),D=D||this.$0,B(this,iD,"f").log(B(this,XD,"f").generateCompletionScript(D,u||B(this,QD,"f")||"completion")),this}showHelp(D){if(q("[string|function]",[D],arguments.length),H(this,OD,!0,"f"),!B(this,b,"f").hasCachedHelpMessage()){if(!this.parsed){let F=this[Gu](B(this,bD,"f"),void 0,void 0,0,!0);if(y(F))return F.then(()=>{B(this,b,"f").showHelp(D)}),this}let u=B(this,uD,"f").runDefaultBuilderOn(this);if(y(u))return u.then(()=>{B(this,b,"f").showHelp(D)}),this}return B(this,b,"f").showHelp(D),this}scriptName(D){return this.customScriptName=!0,this.$0=D,this}showHelpOnFail(D,u){return q("[boolean|string] [string]",[D,u],arguments.length),B(this,b,"f").showHelpOnFail(D,u),this}showVersion(D){return q("[string|function]",[D],arguments.length),B(this,b,"f").showVersion(D),this}skipValidation(D){return q("<array|string>",[D],arguments.length),this[tD]("skipValidation",D),this}strict(D){return q("[boolean]",[D],arguments.length),H(this,kD,D!==!1,"f"),this}strictCommands(D){return q("[boolean]",[D],arguments.length),H(this,gD,D!==!1,"f"),this}strictOptions(D){return q("[boolean]",[D],arguments.length),H(this,yD,D!==!1,"f"),this}string(D){return q("<array|string>",[D],arguments.length),this[tD]("string",D),this[rD](D),this}terminalWidth(){return q([],0),B(this,P,"f").process.stdColumns}updateLocale(D){return this.updateStrings(D)}updateStrings(D){return q("<object>",[D],arguments.length),H(this,mD,!1,"f"),B(this,P,"f").y18n.updateLocale(D),this}usage(D,u,F,E){if(q("<string|null|undefined> [string|boolean] [function|object] [function]",[D,u,F,E],arguments.length),u!==void 0)if(ZD(D,null,B(this,P,"f")),(D||"").match(/^\$0( |$)/))return this.command(D,u,F,E);else throw new DD(".usage() description must start with $0 if being used as alias for .command()");else return B(this,b,"f").usage(D),this}usageConfiguration(D){return q("<object>",[D],arguments.length),H(this,Iu,D,"f"),this}version(D,u,F){if(q("[boolean|string] [string] [string]",[D,u,F],arguments.length),B(this,_D,"f"))this[ru](B(this,_D,"f")),B(this,b,"f").version(void 0),H(this,_D,null,"f");if(arguments.length===0)F=this[I0](),D="version";else if(arguments.length===1){if(D===!1)return this;F=D,D="version"}else if(arguments.length===2)F=u,u=void 0;return H(this,_D,typeof D==="string"?D:"version","f"),u=u||B(this,b,"f").deferY18nLookup("Show version number"),B(this,b,"f").version(F||void 0),this.boolean(B(this,_D,"f")),this.describe(B(this,_D,"f"),u),this}wrap(D){return q("<number|null|undefined>",[D],arguments.length),B(this,b,"f").wrap(D),this}[(uD=new WeakMap,vD=new WeakMap,zu=new WeakMap,XD=new WeakMap,QD=new WeakMap,Wu=new WeakMap,wD=new WeakMap,mD=new WeakMap,Uu=new WeakMap,WD=new WeakMap,Nu=new WeakMap,UD=new WeakMap,VD=new WeakMap,OD=new WeakMap,ND=new WeakMap,Ru=new WeakMap,iD=new WeakMap,hD=new WeakMap,K=new WeakMap,ju=new WeakMap,qu=new WeakMap,TD=new WeakMap,dD=new WeakMap,Fu=new WeakMap,oD=new WeakMap,bD=new WeakMap,Hu=new WeakMap,P=new WeakMap,kD=new WeakMap,gD=new WeakMap,yD=new WeakMap,b=new WeakMap,Iu=new WeakMap,_D=new WeakMap,r=new WeakMap,U0)](D){if(!D._||!D["--"])return D;D._.push.apply(D._,D["--"]);try{delete D["--"]}catch(u){}return D}[N0](){return{log:(...D)=>{if(!this[Vu]())console.log(...D);if(H(this,OD,!0,"f"),B(this,hD,"f").length)H(this,hD,B(this,hD,"f")+`
79
79
  `,"f");H(this,hD,B(this,hD,"f")+D.join(" "),"f")},error:(...D)=>{if(!this[Vu]())console.error(...D);if(H(this,OD,!0,"f"),B(this,hD,"f").length)H(this,hD,B(this,hD,"f")+`
80
- `,"f");H(this,hD,B(this,hD,"f")+D.join(" "),"f")}}}[ru](D){Du(B(this,K,"f")).forEach((u)=>{if(((E)=>E==="configObjects")(u))return;let F=B(this,K,"f")[u];if(Array.isArray(F)){if(F.includes(D))F.splice(F.indexOf(D),1)}else if(typeof F==="object")delete F[D]}),delete B(this,b,"f").getDescriptions()[D]}[R0](D,u,F){if(!B(this,Uu,"f")[F])B(this,P,"f").process.emitWarning(D,u),B(this,Uu,"f")[F]=!0}[j0](){B(this,Nu,"f").push({options:B(this,K,"f"),configObjects:B(this,K,"f").configObjects.slice(0),exitProcess:B(this,WD,"f"),groups:B(this,VD,"f"),strict:B(this,kD,"f"),strictCommands:B(this,gD,"f"),strictOptions:B(this,yD,"f"),completionCommand:B(this,QD,"f"),output:B(this,hD,"f"),exitError:B(this,wD,"f"),hasOutput:B(this,OD,"f"),parsed:this.parsed,parseFn:B(this,TD,"f"),parseContext:B(this,dD,"f")}),B(this,b,"f").freeze(),B(this,r,"f").freeze(),B(this,uD,"f").freeze(),B(this,UD,"f").freeze()}[q0](){let D="",u;if(/\b(node|iojs|electron)(\.exe)?$/.test(B(this,P,"f").process.argv()[0]))u=B(this,P,"f").process.argv().slice(1,2);else u=B(this,P,"f").process.argv().slice(0,1);if(D=u.map((F)=>{let E=this[t0](B(this,vD,"f"),F);return F.match(/^(\/|([a-zA-Z]:)?\\)/)&&E.length<F.length?E:F}).join(" ").trim(),B(this,P,"f").getEnv("_")&&B(this,P,"f").getProcessArgvBin()===B(this,P,"f").getEnv("_"))D=B(this,P,"f").getEnv("_").replace(`${B(this,P,"f").path.dirname(B(this,P,"f").process.execPath())}/`,"");return D}[lD](){return B(this,qu,"f")}[H0](){return B(this,Iu,"f")}[au](){if(!B(this,mD,"f"))return;let D=B(this,P,"f").getEnv("LC_ALL")||B(this,P,"f").getEnv("LC_MESSAGES")||B(this,P,"f").getEnv("LANG")||B(this,P,"f").getEnv("LANGUAGE")||"en_US";this.locale(D.replace(/[.:].*/,""))}[I0](){return this[eu]().version||"unknown"}[V0](D){let u=D["--"]?D["--"]:D._;for(let F=0,E;(E=u[F])!==void 0;F++)if(B(this,P,"f").Parser.looksLikeNumber(E)&&Number.isSafeInteger(Math.floor(parseFloat(`${E}`))))u[F]=Number(E);return D}[eu](D){let u=D||"*";if(B(this,Fu,"f")[u])return B(this,Fu,"f")[u];let F={};try{let E=D||B(this,P,"f").mainFilename;if(B(this,P,"f").path.extname(E))E=B(this,P,"f").path.dirname(E);let C=B(this,P,"f").findUp(E,(f,$)=>{if($.includes("package.json"))return"package.json";else return});ZD(C,void 0,B(this,P,"f")),F=JSON.parse(B(this,P,"f").readFileSync(C,"utf8"))}catch(E){}return B(this,Fu,"f")[u]=F||{},B(this,Fu,"f")[u]}[tD](D,u){u=[].concat(u),u.forEach((F)=>{F=this[FF](F),B(this,K,"f")[D].push(F)})}[Eu](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=$})}[DF](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=(B(this,K,"f")[C][f]||[]).concat($)})}[uF](D,u,F,E,C){if(Array.isArray(F))F.forEach((f)=>{D(f,E)});else if(((f)=>typeof f==="object")(F))for(let f of Du(F))D(f,F[f]);else C(u,this[FF](F),E)}[FF](D){if(D==="__proto__")return"___proto___";return D}[EF](D,u){return this[Eu](this[EF].bind(this),"key",D,u),this}[CF](){var D,u,F,E,C,f,$,G,J,Y,U,Q;let Z=B(this,Nu,"f").pop();ZD(Z,void 0,B(this,P,"f"));let O;D=this,u=this,F=this,E=this,C=this,f=this,$=this,G=this,J=this,Y=this,U=this,Q=this,{options:{set value(W){H(D,K,W,"f")}}.value,configObjects:O,exitProcess:{set value(W){H(u,WD,W,"f")}}.value,groups:{set value(W){H(F,VD,W,"f")}}.value,output:{set value(W){H(E,hD,W,"f")}}.value,exitError:{set value(W){H(C,wD,W,"f")}}.value,hasOutput:{set value(W){H(f,OD,W,"f")}}.value,parsed:this.parsed,strict:{set value(W){H($,kD,W,"f")}}.value,strictCommands:{set value(W){H(G,gD,W,"f")}}.value,strictOptions:{set value(W){H(J,yD,W,"f")}}.value,completionCommand:{set value(W){H(Y,QD,W,"f")}}.value,parseFn:{set value(W){H(U,TD,W,"f")}}.value,parseContext:{set value(W){H(Q,dD,W,"f")}}.value}=Z,B(this,K,"f").configObjects=O,B(this,b,"f").unfreeze(),B(this,r,"f").unfreeze(),B(this,uD,"f").unfreeze(),B(this,UD,"f").unfreeze()}[_0](D,u){return pD(u,(F)=>{return D(F),F})}getInternalMethods(){return{getCommandInstance:this[K0].bind(this),getContext:this[L0].bind(this),getHasOutput:this[A0].bind(this),getLoggerInstance:this[S0].bind(this),getParseContext:this[x0].bind(this),getParserConfiguration:this[lD].bind(this),getUsageConfiguration:this[H0].bind(this),getUsageInstance:this[P0].bind(this),getValidationInstance:this[w0].bind(this),hasParseCallback:this[Vu].bind(this),isGlobalContext:this[b0].bind(this),postProcess:this[sD].bind(this),reset:this[BF].bind(this),runValidation:this[fF].bind(this),runYargsParserAndExecuteCommands:this[Gu].bind(this),setHasOutput:this[n0].bind(this)}}[K0](){return B(this,uD,"f")}[L0](){return B(this,zu,"f")}[A0](){return B(this,OD,"f")}[S0](){return B(this,iD,"f")}[x0](){return B(this,dD,"f")||{}}[P0](){return B(this,b,"f")}[w0](){return B(this,r,"f")}[Vu](){return!!B(this,TD,"f")}[b0](){return B(this,Ru,"f")}[sD](D,u,F,E){if(F)return D;if(y(D))return D;if(!u)D=this[U0](D);if(this[lD]()["parse-positional-numbers"]||this[lD]()["parse-positional-numbers"]===void 0)D=this[V0](D);if(E)D=cD(D,this,B(this,UD,"f").getMiddleware(),!1);return D}[BF](D={}){H(this,K,B(this,K,"f")||{},"f");let u={};u.local=B(this,K,"f").local||[],u.configObjects=B(this,K,"f").configObjects||[];let F={};u.local.forEach((f)=>{F[f]=!0,(D[f]||[]).forEach(($)=>{F[$]=!0})}),Object.assign(B(this,oD,"f"),Object.keys(B(this,VD,"f")).reduce((f,$)=>{let G=B(this,VD,"f")[$].filter((J)=>!(J in F));if(G.length>0)f[$]=G;return f},{})),H(this,VD,{},"f");let E=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],C=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(E.forEach((f)=>{u[f]=(B(this,K,"f")[f]||[]).filter(($)=>!F[$])}),C.forEach((f)=>{u[f]=xD(B(this,K,"f")[f],($)=>!F[$])}),u.envPrefix=B(this,K,"f").envPrefix,H(this,K,u,"f"),H(this,b,B(this,b,"f")?B(this,b,"f").reset(F):M0(this,B(this,P,"f")),"f"),H(this,r,B(this,r,"f")?B(this,r,"f").reset(F):Y0(this,B(this,b,"f"),B(this,P,"f")),"f"),H(this,uD,B(this,uD,"f")?B(this,uD,"f").reset():h0(B(this,b,"f"),B(this,r,"f"),B(this,UD,"f"),B(this,P,"f")),"f"),!B(this,XD,"f"))H(this,XD,Q0(this,B(this,b,"f"),B(this,uD,"f"),B(this,P,"f")),"f");return B(this,UD,"f").reset(),H(this,QD,null,"f"),H(this,hD,"","f"),H(this,wD,null,"f"),H(this,OD,!1,"f"),this.parsed=!1,this}[t0](D,u){return B(this,P,"f").path.relative(D,u)}[Gu](D,u,F,E=0,C=!1){var f,$,G,J;let Y=!!F||C;D=D||B(this,bD,"f"),B(this,K,"f").__=B(this,P,"f").y18n.__,B(this,K,"f").configuration=this[lD]();let U=!!B(this,K,"f").configuration["populate--"],Q=Object.assign({},B(this,K,"f").configuration,{"populate--":!0}),Z=B(this,P,"f").Parser.detailed(D,Object.assign({},B(this,K,"f"),{configuration:{"parse-positional-numbers":!1,...Q}})),O=Object.assign(Z.argv,B(this,dD,"f")),W=void 0,X=Z.aliases,A=!1,v=!1;if(Object.keys(O).forEach((n)=>{if(n===B(this,ND,"f")&&O[n])A=!0;else if(n===B(this,_D,"f")&&O[n])v=!0}),O.$0=this.$0,this.parsed=Z,E===0)B(this,b,"f").clearCachedHelpMessage();try{if(this[au](),u)return this[sD](O,U,!!F,!1);if(B(this,ND,"f")){if([B(this,ND,"f")].concat(X[B(this,ND,"f")]||[]).filter((ED)=>ED.length>1).includes(""+O._[O._.length-1]))O._.pop(),A=!0}H(this,Ru,!1,"f");let n=B(this,uD,"f").getCommands(),GD=((f=B(this,XD,"f"))===null||f===void 0?void 0:f.completionKey)?[($=B(this,XD,"f"))===null||$===void 0?void 0:$.completionKey,...(J=this.getAliases()[(G=B(this,XD,"f"))===null||G===void 0?void 0:G.completionKey])!==null&&J!==void 0?J:[]].some((g)=>Object.prototype.hasOwnProperty.call(O,g)):!1,t=A||GD||C;if(O._.length){if(n.length){let g;for(let ED=E||0,a;O._[ED]!==void 0;ED++)if(a=String(O._[ED]),n.includes(a)&&a!==B(this,QD,"f")){let ID=B(this,uD,"f").runCommand(a,this,Z,ED+1,C,A||v||C);return this[sD](ID,U,!!F,!1)}else if(!g&&a!==B(this,QD,"f")){g=a;break}if(!B(this,uD,"f").hasDefaultCommand()&&B(this,Hu,"f")&&g&&!t)B(this,r,"f").recommendCommands(g,n)}if(B(this,QD,"f")&&O._.includes(B(this,QD,"f"))&&!GD){if(B(this,WD,"f"))PD(!0);this.showCompletionScript(),this.exit(0)}}if(B(this,uD,"f").hasDefaultCommand()&&!t){let g=B(this,uD,"f").runCommand(null,this,Z,0,C,A||v||C);return this[sD](g,U,!!F,!1)}if(GD){if(B(this,WD,"f"))PD(!0);D=[].concat(D);let g=D.slice(D.indexOf(`--${B(this,XD,"f").completionKey}`)+1);return B(this,XD,"f").getCompletion(g,(ED,a)=>{if(ED)throw new DD(ED.message);(a||[]).forEach((ID)=>{B(this,iD,"f").log(ID)}),this.exit(0)}),this[sD](O,!U,!!F,!1)}if(!B(this,OD,"f")){if(A){if(B(this,WD,"f"))PD(!0);Y=!0,this.showHelp((g)=>{B(this,iD,"f").log(g),this.exit(0)})}else if(v){if(B(this,WD,"f"))PD(!0);Y=!0,B(this,b,"f").showVersion("log"),this.exit(0)}}if(!Y&&B(this,K,"f").skipValidation.length>0)Y=Object.keys(O).some((g)=>B(this,K,"f").skipValidation.indexOf(g)>=0&&O[g]===!0);if(!Y){if(Z.error)throw new DD(Z.error.message);if(!GD){let g=this[fF](X,{},Z.error);if(!F)W=cD(O,this,B(this,UD,"f").getMiddleware(),!0);if(W=this[_0](g,W!==null&&W!==void 0?W:O),y(W)&&!F)W=W.then(()=>{return cD(O,this,B(this,UD,"f").getMiddleware(),!1)})}}}catch(n){if(n instanceof DD)B(this,b,"f").fail(n.message,n);else throw n}return this[sD](W!==null&&W!==void 0?W:O,U,!!F,!0)}[fF](D,u,F,E){let C={...this.getDemandedOptions()};return(f)=>{if(F)throw new DD(F.message);B(this,r,"f").nonOptionCount(f),B(this,r,"f").requiredArguments(f,C);let $=!1;if(B(this,gD,"f"))$=B(this,r,"f").unknownCommands(f);if(B(this,kD,"f")&&!$)B(this,r,"f").unknownArguments(f,D,u,!!E);else if(B(this,yD,"f"))B(this,r,"f").unknownArguments(f,D,{},!1,!1);B(this,r,"f").limitedChoices(f),B(this,r,"f").implications(f),B(this,r,"f").conflicting(f)}}[n0](){H(this,OD,!0,"f")}[rD](D){if(typeof D==="string")B(this,K,"f").key[D]=!0;else for(let u of D)B(this,K,"f").key[u]=!0}}function z0(D){return!!D&&typeof D.getInternalMethods==="function"}var J8=c0(ku),v0=J8;import{EOL as HD}from"os";import D2 from"path";import Q8 from"fs";function m0(D=process.env){if(!D.QITQODE_KEY&&D.QORTEX_KEY)D.QITQODE_KEY=D.QORTEX_KEY;if(!D.QLEX_API_KEY&&D.QITQODE_KEY)D.QLEX_API_KEY=D.QITQODE_KEY}m0();var i0=y0("main");l0("main");var RD=du(process.argv),u2=new Set(["--version","-v"]);if(RD.length===1&&u2.has(RD[0]))process.stdout.write(Lu+HD),process.exit();if(RD.length===2&&RD.some((D)=>u2.has(D))&&RD.includes("--verbose")){let D=process.argv[1],u=(()=>{if(!D||D.startsWith("-"))return;if(D.startsWith("/$bunfs/")||/^B:[\\/]~BUN[\\/]/.test(D))return;let E=D2.resolve(D);if(E===process.execPath)return;try{if(!Q8.statSync(E).isFile())return}catch{return}return E})(),F=[`version: ${Lu}`,`channel: ${o0}`,`commit: ${k0}`,`binary: ${process.execPath}`,...u?[`bundle: ${u}`]:[]];process.stdout.write(F.join(HD)+HD),process.exit()}var _u={acp:()=>import("./chunk-8e4s6nc2.js").then((D)=>D.AcpCommand),mcp:()=>import("./chunk-bkct64rs.js").then((D)=>D.McpCommand),attach:()=>import("./chunk-7x30x94y.js").then((D)=>D.AttachCommand),run:()=>import("./chunk-86hsh44c.js").then((D)=>D.RunCommand),generate:()=>import("./chunk-c3zge8cg.js").then((D)=>D.GenerateCommand),debug:()=>import("./chunk-3cr2p4mp.js").then((D)=>D.DebugCommand),console:()=>import("./chunk-97q2t1yz.js").then((D)=>D.ConsoleCommand),providers:()=>import("./chunk-jnrnncqc.js").then((D)=>D.ProvidersCommand),agent:()=>import("./chunk-nmzrrqgb.js").then((D)=>D.AgentCommand),upgrade:()=>import("./chunk-3d73kfea.js").then((D)=>D.UpgradeCommand),uninstall:()=>import("./chunk-t5r3w9e1.js").then((D)=>D.UninstallCommand),serve:()=>import("./chunk-m80v76m9.js").then((D)=>D.ServeCommand),models:()=>import("./chunk-6nry7tah.js").then((D)=>D.ModelsCommand),stats:()=>import("./chunk-8yvx3pgy.js").then((D)=>D.StatsCommand),usage:()=>import("./chunk-qkvqvgcx.js").then((D)=>D.UsageCommand),export:()=>import("./chunk-cj7r8w1e.js").then((D)=>D.ExportCommand),import:()=>import("./chunk-xwdxgg16.js").then((D)=>D.ImportCommand),github:()=>import("./chunk-kth84vdn.js").then((D)=>D.GithubCommand),pr:()=>import("./chunk-pt0xphq9.js").then((D)=>D.PrCommand),session:()=>import("./chunk-d51908mv.js").then((D)=>D.SessionCommand),plugin:()=>import("./chunk-3ktzxj69.js").then((D)=>D.PluginCommand),plug:()=>import("./chunk-3ktzxj69.js").then((D)=>D.PluginCommand),auth:()=>import("./chunk-cqkaamvn.js").then((D)=>D.AuthCommand),qredits:()=>import("./chunk-gjd3wf8b.js").then((D)=>D.QreditsCommand),batch:()=>import("./chunk-p4b0s5td.js").then((D)=>D.BatchCommand),db:()=>import("./chunk-fyhqp4pb.js").then((D)=>D.DbCommand),default:()=>import("./chunk-vkaa7k3e.js").then((D)=>D.TuiThreadCommand)};function l(D,u,F){return{command:D,describe:u,aliases:F,handler:async()=>{}}}function $F(){return[l("acp","start ACP (Agent Client Protocol) server"),l("mcp","manage MCP (Model Context Protocol) servers"),{command:"$0 [project]",describe:"start qitqode tui",builder:(D)=>D.positional("project",{type:"string",describe:"path to start qitqode in"}).options(r0).options(a0).option("never-ask",{type:"boolean",describe:"start in never-ask mode, auto-decide without asking (permissions excluded)",default:!1}),handler:async()=>{}},l("attach <url>","attach to a running qitqode server"),l("run [message..]","run qitqode with a message"),l("generate","generate files"),l("debug","debugging and troubleshooting tools"),l("console","manage qitqode accounts"),l("providers","manage AI providers and credentials",["auth"]),l("agent","manage agents"),l("upgrade [target]","upgrade qitqode to the latest or a specific version"),l("uninstall","uninstall qitqode and remove all related files"),l("serve","starts a headless qitqode server"),l("models [provider]","list all available models"),l("stats","show token usage and cost statistics"),l("usage [sessionID]","show per-turn token usage and cost"),l("export [sessionID]","export a complete session transcript as JSON or Markdown"),l("import <file>","import session data from JSON file or URL"),l("github","manage GitHub agent"),l("pr <number>","fetch and checkout a GitHub PR branch, then run qitqode"),l("session","manage sessions"),l("plugin <module>","install plugin and update config",["plug"]),l("auth <command>","Sign in or out of Forgewise"),l("qredits <command>","Check Qredits balance and spend history"),l("batch <command>","Submit and poll async batch LLM jobs"),l("db","database tools")]}function zF(D){let u=new Set(["--log-level","--model","-m","--session","-s","--prompt","--agent","--port","--hostname","--mdns-domain","--cors"]);for(let F=0;F<D.length;F++){let E=D[F];if(E==="--")return;if(E.startsWith("-")){if(u.has(E))F++;continue}return E}}function O8(D){return D.length>0&&D.every((u)=>u==="--help"||u==="-h")}function T8(D){return D.includes("--help")||D.includes("-h")}async function Y8(D){let u=zF(D);if(D.includes("--get-yargs-completions")||u==="completion")return $F();if(O8(D))return $F();else if(u&&u in _u)return[await _u[u]()];else if(T8(D))return $F();else return[await _u.default()]}function F2(D){let u=D.trimStart();if(!u.startsWith("qitqode ")){process.stderr.write(Ku.logo()+HD+HD),process.stderr.write(u);return}process.stderr.write(D)}var Mu=s0(v0(RD)).middleware(async(D)=>{if(D.pure)process.env.QITQODE_PURE="1";let u=await import("./chunk-st0c5wwc.js"),{Filesystem:F}=await import("./chunk-nvs0d8jg.js"),{Heap:E}=await import("./chunk-6dvmyeg7.js"),{Global:C}=await import("./chunk-dvr2b9r1.js");await u.init({print:process.argv.includes("--print-logs"),dev:hF,level:(()=>{if(D.logLevel)return D.logLevel;if(hF)return"DEBUG";return"INFO"})()}),E.start(),(await import("./chunk-bg1t0kke.js")).startRefresh(),process.env.AGENT="1",process.env.QITQODE="1",process.env.QITQODE_PID=String(process.pid),u.Default.info("qitqode",{version:Lu,command:zF(RD)??"tui",process_role:i0.processRole,run_id:i0.runID});let $=D2.join(C.Path.data,"qitqode.db");if(!await F.exists($)){let{JsonMigration:G,Database:J}=await import("./chunk-ky88ba80.js"),{drizzle:Y}=await import("./chunk-jvkzdap1.js"),U=process.stderr.isTTY;process.stderr.write("Performing one time database migration, may take a few minutes..."+HD);let Q=-1;if(U)process.stderr.write("\x1B[?25l");try{await G.run(Y({client:J.Client().$client}),{progress:(Z)=>{let O=Math.floor(Z.current/Z.total*100);if(O===Q&&Z.current!==Z.total)return;if(Q=O,U){if(process.stderr.write(e0(O,`${Z.label.padEnd(12)} ${Z.current}/${Z.total}`)),Z.current===Z.total)process.stderr.write(`
81
- `)}else process.stderr.write(`sqlite-migration:${O}${HD}`)}})}finally{if(U)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${HD}`)}process.stderr.write("Database migration complete."+HD)}if(!process.env.QITQODE_DISABLE_CLAUDE_IMPORT&&!process.env.QITQODE_CLAUDE_IMPORTED){process.env.QITQODE_CLAUDE_IMPORTED="1";let G=async()=>{try{let{ClaudeImport:U}=await import("./chunk-8sbb95a4.js");await U.run()}catch(U){u.Default.warn("claude-import failed",{e:GF(U)})}},J=zF(RD);if(!J||!(J in _u))G();else await G()}}).usage("").completion("completion","generate shell completion script");for(let D of await Y8(RD))Mu.command(D);Mu.fail((D,u)=>{if(D?.startsWith("Unknown argument")||D?.startsWith("Not enough non-option arguments")||D?.startsWith("Invalid values:")){if(u)throw u;Mu.showHelp(F2)}if(u)throw u;process.exit(1)}).strict();try{if(RD.includes("-h")||RD.includes("--help"))await Mu.parse(RD,(D,u,F)=>{if(D)throw D;if(!F)return;F2(F)});else await Mu.parse()}catch(D){let u={};if(D instanceof d0){let C=D.toObject();Object.assign(u,{...C.data})}if(D instanceof Error)Object.assign(u,{name:D.name,message:D.message,cause:D.cause?.toString(),stack:D.stack});if(D instanceof ResolveMessage)Object.assign(u,{name:D.name,message:D.message,code:D.code,specifier:D.specifier,referrer:D.referrer,position:D.position,importKind:D.importKind});let F=await import("./chunk-st0c5wwc.js");F.Default.error("fatal",u);let E=g0(D);if(E)Ku.error(E);if(E===void 0)Ku.error("Unexpected error, check log file at "+F.file()+" for more details"+HD),process.stderr.write(GF(D)+HD);process.exitCode=1}finally{process.exit()}
80
+ `,"f");H(this,hD,B(this,hD,"f")+D.join(" "),"f")}}}[ru](D){Du(B(this,K,"f")).forEach((u)=>{if(((E)=>E==="configObjects")(u))return;let F=B(this,K,"f")[u];if(Array.isArray(F)){if(F.includes(D))F.splice(F.indexOf(D),1)}else if(typeof F==="object")delete F[D]}),delete B(this,b,"f").getDescriptions()[D]}[R0](D,u,F){if(!B(this,Uu,"f")[F])B(this,P,"f").process.emitWarning(D,u),B(this,Uu,"f")[F]=!0}[j0](){B(this,Nu,"f").push({options:B(this,K,"f"),configObjects:B(this,K,"f").configObjects.slice(0),exitProcess:B(this,WD,"f"),groups:B(this,VD,"f"),strict:B(this,kD,"f"),strictCommands:B(this,gD,"f"),strictOptions:B(this,yD,"f"),completionCommand:B(this,QD,"f"),output:B(this,hD,"f"),exitError:B(this,wD,"f"),hasOutput:B(this,OD,"f"),parsed:this.parsed,parseFn:B(this,TD,"f"),parseContext:B(this,dD,"f")}),B(this,b,"f").freeze(),B(this,r,"f").freeze(),B(this,uD,"f").freeze(),B(this,UD,"f").freeze()}[q0](){let D="",u;if(/\b(node|iojs|electron)(\.exe)?$/.test(B(this,P,"f").process.argv()[0]))u=B(this,P,"f").process.argv().slice(1,2);else u=B(this,P,"f").process.argv().slice(0,1);if(D=u.map((F)=>{let E=this[t0](B(this,vD,"f"),F);return F.match(/^(\/|([a-zA-Z]:)?\\)/)&&E.length<F.length?E:F}).join(" ").trim(),B(this,P,"f").getEnv("_")&&B(this,P,"f").getProcessArgvBin()===B(this,P,"f").getEnv("_"))D=B(this,P,"f").getEnv("_").replace(`${B(this,P,"f").path.dirname(B(this,P,"f").process.execPath())}/`,"");return D}[lD](){return B(this,qu,"f")}[H0](){return B(this,Iu,"f")}[au](){if(!B(this,mD,"f"))return;let D=B(this,P,"f").getEnv("LC_ALL")||B(this,P,"f").getEnv("LC_MESSAGES")||B(this,P,"f").getEnv("LANG")||B(this,P,"f").getEnv("LANGUAGE")||"en_US";this.locale(D.replace(/[.:].*/,""))}[I0](){return this[eu]().version||"unknown"}[V0](D){let u=D["--"]?D["--"]:D._;for(let F=0,E;(E=u[F])!==void 0;F++)if(B(this,P,"f").Parser.looksLikeNumber(E)&&Number.isSafeInteger(Math.floor(parseFloat(`${E}`))))u[F]=Number(E);return D}[eu](D){let u=D||"*";if(B(this,Fu,"f")[u])return B(this,Fu,"f")[u];let F={};try{let E=D||B(this,P,"f").mainFilename;if(B(this,P,"f").path.extname(E))E=B(this,P,"f").path.dirname(E);let C=B(this,P,"f").findUp(E,(f,$)=>{if($.includes("package.json"))return"package.json";else return});ZD(C,void 0,B(this,P,"f")),F=JSON.parse(B(this,P,"f").readFileSync(C,"utf8"))}catch(E){}return B(this,Fu,"f")[u]=F||{},B(this,Fu,"f")[u]}[tD](D,u){u=[].concat(u),u.forEach((F)=>{F=this[FF](F),B(this,K,"f")[D].push(F)})}[Eu](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=$})}[DF](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=(B(this,K,"f")[C][f]||[]).concat($)})}[uF](D,u,F,E,C){if(Array.isArray(F))F.forEach((f)=>{D(f,E)});else if(((f)=>typeof f==="object")(F))for(let f of Du(F))D(f,F[f]);else C(u,this[FF](F),E)}[FF](D){if(D==="__proto__")return"___proto___";return D}[EF](D,u){return this[Eu](this[EF].bind(this),"key",D,u),this}[CF](){var D,u,F,E,C,f,$,G,J,Y,U,Q;let Z=B(this,Nu,"f").pop();ZD(Z,void 0,B(this,P,"f"));let O;D=this,u=this,F=this,E=this,C=this,f=this,$=this,G=this,J=this,Y=this,U=this,Q=this,{options:{set value(W){H(D,K,W,"f")}}.value,configObjects:O,exitProcess:{set value(W){H(u,WD,W,"f")}}.value,groups:{set value(W){H(F,VD,W,"f")}}.value,output:{set value(W){H(E,hD,W,"f")}}.value,exitError:{set value(W){H(C,wD,W,"f")}}.value,hasOutput:{set value(W){H(f,OD,W,"f")}}.value,parsed:this.parsed,strict:{set value(W){H($,kD,W,"f")}}.value,strictCommands:{set value(W){H(G,gD,W,"f")}}.value,strictOptions:{set value(W){H(J,yD,W,"f")}}.value,completionCommand:{set value(W){H(Y,QD,W,"f")}}.value,parseFn:{set value(W){H(U,TD,W,"f")}}.value,parseContext:{set value(W){H(Q,dD,W,"f")}}.value}=Z,B(this,K,"f").configObjects=O,B(this,b,"f").unfreeze(),B(this,r,"f").unfreeze(),B(this,uD,"f").unfreeze(),B(this,UD,"f").unfreeze()}[_0](D,u){return pD(u,(F)=>{return D(F),F})}getInternalMethods(){return{getCommandInstance:this[K0].bind(this),getContext:this[L0].bind(this),getHasOutput:this[A0].bind(this),getLoggerInstance:this[S0].bind(this),getParseContext:this[x0].bind(this),getParserConfiguration:this[lD].bind(this),getUsageConfiguration:this[H0].bind(this),getUsageInstance:this[P0].bind(this),getValidationInstance:this[w0].bind(this),hasParseCallback:this[Vu].bind(this),isGlobalContext:this[b0].bind(this),postProcess:this[sD].bind(this),reset:this[BF].bind(this),runValidation:this[fF].bind(this),runYargsParserAndExecuteCommands:this[Gu].bind(this),setHasOutput:this[n0].bind(this)}}[K0](){return B(this,uD,"f")}[L0](){return B(this,zu,"f")}[A0](){return B(this,OD,"f")}[S0](){return B(this,iD,"f")}[x0](){return B(this,dD,"f")||{}}[P0](){return B(this,b,"f")}[w0](){return B(this,r,"f")}[Vu](){return!!B(this,TD,"f")}[b0](){return B(this,Ru,"f")}[sD](D,u,F,E){if(F)return D;if(y(D))return D;if(!u)D=this[U0](D);if(this[lD]()["parse-positional-numbers"]||this[lD]()["parse-positional-numbers"]===void 0)D=this[V0](D);if(E)D=cD(D,this,B(this,UD,"f").getMiddleware(),!1);return D}[BF](D={}){H(this,K,B(this,K,"f")||{},"f");let u={};u.local=B(this,K,"f").local||[],u.configObjects=B(this,K,"f").configObjects||[];let F={};u.local.forEach((f)=>{F[f]=!0,(D[f]||[]).forEach(($)=>{F[$]=!0})}),Object.assign(B(this,oD,"f"),Object.keys(B(this,VD,"f")).reduce((f,$)=>{let G=B(this,VD,"f")[$].filter((J)=>!(J in F));if(G.length>0)f[$]=G;return f},{})),H(this,VD,{},"f");let E=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],C=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(E.forEach((f)=>{u[f]=(B(this,K,"f")[f]||[]).filter(($)=>!F[$])}),C.forEach((f)=>{u[f]=xD(B(this,K,"f")[f],($)=>!F[$])}),u.envPrefix=B(this,K,"f").envPrefix,H(this,K,u,"f"),H(this,b,B(this,b,"f")?B(this,b,"f").reset(F):M0(this,B(this,P,"f")),"f"),H(this,r,B(this,r,"f")?B(this,r,"f").reset(F):Y0(this,B(this,b,"f"),B(this,P,"f")),"f"),H(this,uD,B(this,uD,"f")?B(this,uD,"f").reset():h0(B(this,b,"f"),B(this,r,"f"),B(this,UD,"f"),B(this,P,"f")),"f"),!B(this,XD,"f"))H(this,XD,Q0(this,B(this,b,"f"),B(this,uD,"f"),B(this,P,"f")),"f");return B(this,UD,"f").reset(),H(this,QD,null,"f"),H(this,hD,"","f"),H(this,wD,null,"f"),H(this,OD,!1,"f"),this.parsed=!1,this}[t0](D,u){return B(this,P,"f").path.relative(D,u)}[Gu](D,u,F,E=0,C=!1){var f,$,G,J;let Y=!!F||C;D=D||B(this,bD,"f"),B(this,K,"f").__=B(this,P,"f").y18n.__,B(this,K,"f").configuration=this[lD]();let U=!!B(this,K,"f").configuration["populate--"],Q=Object.assign({},B(this,K,"f").configuration,{"populate--":!0}),Z=B(this,P,"f").Parser.detailed(D,Object.assign({},B(this,K,"f"),{configuration:{"parse-positional-numbers":!1,...Q}})),O=Object.assign(Z.argv,B(this,dD,"f")),W=void 0,X=Z.aliases,A=!1,v=!1;if(Object.keys(O).forEach((n)=>{if(n===B(this,ND,"f")&&O[n])A=!0;else if(n===B(this,_D,"f")&&O[n])v=!0}),O.$0=this.$0,this.parsed=Z,E===0)B(this,b,"f").clearCachedHelpMessage();try{if(this[au](),u)return this[sD](O,U,!!F,!1);if(B(this,ND,"f")){if([B(this,ND,"f")].concat(X[B(this,ND,"f")]||[]).filter((ED)=>ED.length>1).includes(""+O._[O._.length-1]))O._.pop(),A=!0}H(this,Ru,!1,"f");let n=B(this,uD,"f").getCommands(),GD=((f=B(this,XD,"f"))===null||f===void 0?void 0:f.completionKey)?[($=B(this,XD,"f"))===null||$===void 0?void 0:$.completionKey,...(J=this.getAliases()[(G=B(this,XD,"f"))===null||G===void 0?void 0:G.completionKey])!==null&&J!==void 0?J:[]].some((g)=>Object.prototype.hasOwnProperty.call(O,g)):!1,t=A||GD||C;if(O._.length){if(n.length){let g;for(let ED=E||0,a;O._[ED]!==void 0;ED++)if(a=String(O._[ED]),n.includes(a)&&a!==B(this,QD,"f")){let ID=B(this,uD,"f").runCommand(a,this,Z,ED+1,C,A||v||C);return this[sD](ID,U,!!F,!1)}else if(!g&&a!==B(this,QD,"f")){g=a;break}if(!B(this,uD,"f").hasDefaultCommand()&&B(this,Hu,"f")&&g&&!t)B(this,r,"f").recommendCommands(g,n)}if(B(this,QD,"f")&&O._.includes(B(this,QD,"f"))&&!GD){if(B(this,WD,"f"))PD(!0);this.showCompletionScript(),this.exit(0)}}if(B(this,uD,"f").hasDefaultCommand()&&!t){let g=B(this,uD,"f").runCommand(null,this,Z,0,C,A||v||C);return this[sD](g,U,!!F,!1)}if(GD){if(B(this,WD,"f"))PD(!0);D=[].concat(D);let g=D.slice(D.indexOf(`--${B(this,XD,"f").completionKey}`)+1);return B(this,XD,"f").getCompletion(g,(ED,a)=>{if(ED)throw new DD(ED.message);(a||[]).forEach((ID)=>{B(this,iD,"f").log(ID)}),this.exit(0)}),this[sD](O,!U,!!F,!1)}if(!B(this,OD,"f")){if(A){if(B(this,WD,"f"))PD(!0);Y=!0,this.showHelp((g)=>{B(this,iD,"f").log(g),this.exit(0)})}else if(v){if(B(this,WD,"f"))PD(!0);Y=!0,B(this,b,"f").showVersion("log"),this.exit(0)}}if(!Y&&B(this,K,"f").skipValidation.length>0)Y=Object.keys(O).some((g)=>B(this,K,"f").skipValidation.indexOf(g)>=0&&O[g]===!0);if(!Y){if(Z.error)throw new DD(Z.error.message);if(!GD){let g=this[fF](X,{},Z.error);if(!F)W=cD(O,this,B(this,UD,"f").getMiddleware(),!0);if(W=this[_0](g,W!==null&&W!==void 0?W:O),y(W)&&!F)W=W.then(()=>{return cD(O,this,B(this,UD,"f").getMiddleware(),!1)})}}}catch(n){if(n instanceof DD)B(this,b,"f").fail(n.message,n);else throw n}return this[sD](W!==null&&W!==void 0?W:O,U,!!F,!0)}[fF](D,u,F,E){let C={...this.getDemandedOptions()};return(f)=>{if(F)throw new DD(F.message);B(this,r,"f").nonOptionCount(f),B(this,r,"f").requiredArguments(f,C);let $=!1;if(B(this,gD,"f"))$=B(this,r,"f").unknownCommands(f);if(B(this,kD,"f")&&!$)B(this,r,"f").unknownArguments(f,D,u,!!E);else if(B(this,yD,"f"))B(this,r,"f").unknownArguments(f,D,{},!1,!1);B(this,r,"f").limitedChoices(f),B(this,r,"f").implications(f),B(this,r,"f").conflicting(f)}}[n0](){H(this,OD,!0,"f")}[rD](D){if(typeof D==="string")B(this,K,"f").key[D]=!0;else for(let u of D)B(this,K,"f").key[u]=!0}}function z0(D){return!!D&&typeof D.getInternalMethods==="function"}var J8=c0(ku),v0=J8;import{EOL as HD}from"os";import D2 from"path";import Q8 from"fs";function m0(D=process.env){if(!D.QITQODE_KEY&&D.QORTEX_KEY)D.QITQODE_KEY=D.QORTEX_KEY;if(!D.QLEX_API_KEY&&D.QITQODE_KEY)D.QLEX_API_KEY=D.QITQODE_KEY}m0();var i0=y0("main");l0("main");var RD=du(process.argv),u2=new Set(["--version","-v"]);if(RD.length===1&&u2.has(RD[0]))process.stdout.write(Lu+HD),process.exit();if(RD.length===2&&RD.some((D)=>u2.has(D))&&RD.includes("--verbose")){let D=process.argv[1],u=(()=>{if(!D||D.startsWith("-"))return;if(D.startsWith("/$bunfs/")||/^B:[\\/]~BUN[\\/]/.test(D))return;let E=D2.resolve(D);if(E===process.execPath)return;try{if(!Q8.statSync(E).isFile())return}catch{return}return E})(),F=[`version: ${Lu}`,`channel: ${o0}`,`commit: ${k0}`,`binary: ${process.execPath}`,...u?[`bundle: ${u}`]:[]];process.stdout.write(F.join(HD)+HD),process.exit()}var _u={acp:()=>import("./chunk-ajp53ksp.js").then((D)=>D.AcpCommand),mcp:()=>import("./chunk-k3g28tbw.js").then((D)=>D.McpCommand),attach:()=>import("./chunk-61jn7908.js").then((D)=>D.AttachCommand),run:()=>import("./chunk-9aafddkw.js").then((D)=>D.RunCommand),generate:()=>import("./chunk-dexcptaz.js").then((D)=>D.GenerateCommand),debug:()=>import("./chunk-vhzx5bxd.js").then((D)=>D.DebugCommand),console:()=>import("./chunk-aqcpk2vg.js").then((D)=>D.ConsoleCommand),providers:()=>import("./chunk-znmbfx70.js").then((D)=>D.ProvidersCommand),agent:()=>import("./chunk-n0g4983e.js").then((D)=>D.AgentCommand),upgrade:()=>import("./chunk-7j2vpavd.js").then((D)=>D.UpgradeCommand),uninstall:()=>import("./chunk-d1tb1jd0.js").then((D)=>D.UninstallCommand),serve:()=>import("./chunk-skxg3s8z.js").then((D)=>D.ServeCommand),models:()=>import("./chunk-dwb39jdf.js").then((D)=>D.ModelsCommand),stats:()=>import("./chunk-14d301ze.js").then((D)=>D.StatsCommand),usage:()=>import("./chunk-y5q9v80n.js").then((D)=>D.UsageCommand),export:()=>import("./chunk-qbrj9wzd.js").then((D)=>D.ExportCommand),import:()=>import("./chunk-42q8vj0w.js").then((D)=>D.ImportCommand),github:()=>import("./chunk-b6eypnbj.js").then((D)=>D.GithubCommand),pr:()=>import("./chunk-q6mcnq9p.js").then((D)=>D.PrCommand),session:()=>import("./chunk-77h8tytk.js").then((D)=>D.SessionCommand),plugin:()=>import("./chunk-p847g35y.js").then((D)=>D.PluginCommand),plug:()=>import("./chunk-p847g35y.js").then((D)=>D.PluginCommand),auth:()=>import("./chunk-12fwmmcp.js").then((D)=>D.AuthCommand),qredits:()=>import("./chunk-0bgssfvq.js").then((D)=>D.QreditsCommand),batch:()=>import("./chunk-vzrc2fmt.js").then((D)=>D.BatchCommand),db:()=>import("./chunk-2cjfezfr.js").then((D)=>D.DbCommand),default:()=>import("./chunk-tkzctbxq.js").then((D)=>D.TuiThreadCommand)};function l(D,u,F){return{command:D,describe:u,aliases:F,handler:async()=>{}}}function $F(){return[l("acp","start ACP (Agent Client Protocol) server"),l("mcp","manage MCP (Model Context Protocol) servers"),{command:"$0 [project]",describe:"start qitqode tui",builder:(D)=>D.positional("project",{type:"string",describe:"path to start qitqode in"}).options(r0).options(a0).option("never-ask",{type:"boolean",describe:"start in never-ask mode, auto-decide without asking (permissions excluded)",default:!1}),handler:async()=>{}},l("attach <url>","attach to a running qitqode server"),l("run [message..]","run qitqode with a message"),l("generate","generate files"),l("debug","debugging and troubleshooting tools"),l("console","manage qitqode accounts"),l("providers","manage AI providers and credentials",["auth"]),l("agent","manage agents"),l("upgrade [target]","upgrade qitqode to the latest or a specific version"),l("uninstall","uninstall qitqode and remove all related files"),l("serve","starts a headless qitqode server"),l("models [provider]","list all available models"),l("stats","show token usage and cost statistics"),l("usage [sessionID]","show per-turn token usage and cost"),l("export [sessionID]","export a complete session transcript as JSON or Markdown"),l("import <file>","import session data from JSON file or URL"),l("github","manage GitHub agent"),l("pr <number>","fetch and checkout a GitHub PR branch, then run qitqode"),l("session","manage sessions"),l("plugin <module>","install plugin and update config",["plug"]),l("auth <command>","Sign in or out of Forgewise"),l("qredits <command>","Check Qredits balance and spend history"),l("batch <command>","Submit and poll async batch LLM jobs"),l("db","database tools")]}function zF(D){let u=new Set(["--log-level","--model","-m","--session","-s","--prompt","--agent","--port","--hostname","--mdns-domain","--cors"]);for(let F=0;F<D.length;F++){let E=D[F];if(E==="--")return;if(E.startsWith("-")){if(u.has(E))F++;continue}return E}}function O8(D){return D.length>0&&D.every((u)=>u==="--help"||u==="-h")}function T8(D){return D.includes("--help")||D.includes("-h")}async function Y8(D){let u=zF(D);if(D.includes("--get-yargs-completions")||u==="completion")return $F();if(O8(D))return $F();else if(u&&u in _u)return[await _u[u]()];else if(T8(D))return $F();else return[await _u.default()]}function F2(D){let u=D.trimStart();if(!u.startsWith("qitqode ")){process.stderr.write(Ku.logo()+HD+HD),process.stderr.write(u);return}process.stderr.write(D)}var Mu=s0(v0(RD)).middleware(async(D)=>{if(D.pure)process.env.QITQODE_PURE="1";let u=await import("./chunk-v9dnetq8.js"),{Filesystem:F}=await import("./chunk-4656qm05.js"),{Heap:E}=await import("./chunk-54hktc8h.js"),{Global:C}=await import("./chunk-8p249svd.js");await u.init({print:process.argv.includes("--print-logs"),dev:hF,level:(()=>{if(D.logLevel)return D.logLevel;if(hF)return"DEBUG";return"INFO"})()}),E.start(),(await import("./chunk-3ft1dn9j.js")).startRefresh(),process.env.AGENT="1",process.env.QITQODE="1",process.env.QITQODE_PID=String(process.pid),u.Default.info("qitqode",{version:Lu,command:zF(RD)??"tui",process_role:i0.processRole,run_id:i0.runID});let $=D2.join(C.Path.data,"qitqode.db");if(!await F.exists($)){let{JsonMigration:G,Database:J}=await import("./chunk-dx4zxex7.js"),{drizzle:Y}=await import("./chunk-2d2a92kj.js"),U=process.stderr.isTTY;process.stderr.write("Performing one time database migration, may take a few minutes..."+HD);let Q=-1;if(U)process.stderr.write("\x1B[?25l");try{await G.run(Y({client:J.Client().$client}),{progress:(Z)=>{let O=Math.floor(Z.current/Z.total*100);if(O===Q&&Z.current!==Z.total)return;if(Q=O,U){if(process.stderr.write(e0(O,`${Z.label.padEnd(12)} ${Z.current}/${Z.total}`)),Z.current===Z.total)process.stderr.write(`
81
+ `)}else process.stderr.write(`sqlite-migration:${O}${HD}`)}})}finally{if(U)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${HD}`)}process.stderr.write("Database migration complete."+HD)}if(!process.env.QITQODE_DISABLE_CLAUDE_IMPORT&&!process.env.QITQODE_CLAUDE_IMPORTED){process.env.QITQODE_CLAUDE_IMPORTED="1";let G=async()=>{try{let{ClaudeImport:U}=await import("./chunk-wwct4z7j.js");await U.run()}catch(U){u.Default.warn("claude-import failed",{e:GF(U)})}},J=zF(RD);if(!J||!(J in _u))G();else await G()}}).usage("").completion("completion","generate shell completion script");for(let D of await Y8(RD))Mu.command(D);Mu.fail((D,u)=>{if(D?.startsWith("Unknown argument")||D?.startsWith("Not enough non-option arguments")||D?.startsWith("Invalid values:")){if(u)throw u;Mu.showHelp(F2)}if(u)throw u;process.exit(1)}).strict();try{if(RD.includes("-h")||RD.includes("--help"))await Mu.parse(RD,(D,u,F)=>{if(D)throw D;if(!F)return;F2(F)});else await Mu.parse()}catch(D){let u={};if(D instanceof d0){let C=D.toObject();Object.assign(u,{...C.data})}if(D instanceof Error)Object.assign(u,{name:D.name,message:D.message,cause:D.cause?.toString(),stack:D.stack});if(D instanceof ResolveMessage)Object.assign(u,{name:D.name,message:D.message,code:D.code,specifier:D.specifier,referrer:D.referrer,position:D.position,importKind:D.importKind});let F=await import("./chunk-v9dnetq8.js");F.Default.error("fatal",u);let E=g0(D);if(E)Ku.error(E);if(E===void 0)Ku.error("Unexpected error, check log file at "+F.file()+" for more details"+HD),process.stderr.write(GF(D)+HD);process.exitCode=1}finally{process.exit()}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{lO as L,mO as I,pO as D}from"./chunk-pxm4qvqk.js";import{wO as F}from"./chunk-r9w0thdk.js";import{mkdir as W}from"fs/promises";import*as M from"path";import{mkdir as R,readFile as N,writeFile as k}from"fs/promises";import*as U from"path";import{isMainThread as y}from"worker_threads";import{basename as P,join as h}from"path";import{mkdir as p,writeFile as d}from"fs/promises";import{dirname as j,isAbsolute as c,resolve as l}from"path";import{fileURLToPath as H}from"url";class w{static hashUrl(J){let K=0;for(let Z=0;Z<J.length;Z++){let Y=J.charCodeAt(Z);K=(K<<5)-K+Y,K=K&K}return Math.abs(K).toString(16)}static async downloadOrLoad(J,K,Z,Y,X=!0,V){if(J.startsWith("http://")||J.startsWith("https://")){let $;if(X){let B=this.hashUrl(J);$=V?`${V}-${B}${Y}`:`${B}${Y}`}else $=U.basename(J);let Q=U.join(K,Z,$);await R(U.dirname(Q),{recursive:!0});try{let B=await N(Q);if(B.byteLength>0)return console.log(`Loaded from cache: ${Q} (${J})`),{content:B,filePath:Q}}catch(B){}try{console.log(`Downloading from URL: ${J}`);let B=await fetch(J);if(!B.ok)return{error:`Failed to fetch from ${J}: ${B.statusText}`};let G=Buffer.from(await B.arrayBuffer());try{await k(Q,Buffer.from(G)),console.log(`Cached: ${J}`)}catch(v){console.warn(`Failed to cache: ${v}`)}return{content:G,filePath:Q}}catch(B){return{error:`Error downloading from ${J}: ${B}`}}}else try{return console.log(`Loading from local path: ${J}`),{content:await N(J),filePath:J}}catch($){return{error:`Error loading from local path ${J}: ${$}`}}}static async downloadToPath(J,K){let Z=J.startsWith("http://")||J.startsWith("https://");if(await R(U.dirname(K),{recursive:!0}),Z)try{console.log(`Downloading from URL: ${J}`);let Y=await fetch(J);if(!Y.ok)return{error:`Failed to fetch from ${J}: ${Y.statusText}`};let X=Buffer.from(await Y.arrayBuffer());return await k(K,Buffer.from(X)),console.log(`Downloaded: ${J} -> ${K}`),{content:X,filePath:K}}catch(Y){return{error:`Error downloading from ${J}: ${Y}`}}else try{console.log(`Copying from local path: ${J}`);let Y=await N(J);return await k(K,Buffer.from(Y)),{content:Y,filePath:K}}catch(Y){return{error:`Error copying from local path ${J}: ${Y}`}}}static async fetchHighlightQueries(J,K,Z){let Y=J.map((z)=>this.fetchHighlightQuery(z,K,Z));return(await Promise.all(Y)).filter((z)=>z.trim().length>0).join(`
3
- `)}static async fetchHighlightQuery(J,K,Z){let Y=await this.downloadOrLoad(J,K,"queries",".scm",!0,Z);if(Y.error)return console.error(`Error fetching highlight query from ${J}:`,Y.error),"";if(Y.content)return new TextDecoder().decode(Y.content);return""}}function f(J){return J.includes("$bunfs")||/^B:[\\/]~BUN/i.test(J)}function u(){return process.platform==="win32"?"B:\\~BUN\\root":"/$bunfs/root"}function g(J){return h(u(),P(J))}function o({onlyFirst:J=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",J?void 0:"g")}var s=o();function b(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(s,"")}function n(J){return J===161||J===164||J===167||J===168||J===170||J===173||J===174||J>=176&&J<=180||J>=182&&J<=186||J>=188&&J<=191||J===198||J===208||J===215||J===216||J>=222&&J<=225||J===230||J>=232&&J<=234||J===236||J===237||J===240||J===242||J===243||J>=247&&J<=250||J===252||J===254||J===257||J===273||J===275||J===283||J===294||J===295||J===299||J>=305&&J<=307||J===312||J>=319&&J<=322||J===324||J>=328&&J<=331||J===333||J===338||J===339||J===358||J===359||J===363||J===462||J===464||J===466||J===468||J===470||J===472||J===474||J===476||J===593||J===609||J===708||J===711||J>=713&&J<=715||J===717||J===720||J>=728&&J<=731||J===733||J===735||J>=768&&J<=879||J>=913&&J<=929||J>=931&&J<=937||J>=945&&J<=961||J>=963&&J<=969||J===1025||J>=1040&&J<=1103||J===1105||J===8208||J>=8211&&J<=8214||J===8216||J===8217||J===8220||J===8221||J>=8224&&J<=8226||J>=8228&&J<=8231||J===8240||J===8242||J===8243||J===8245||J===8251||J===8254||J===8308||J===8319||J>=8321&&J<=8324||J===8364||J===8451||J===8453||J===8457||J===8467||J===8470||J===8481||J===8482||J===8486||J===8491||J===8531||J===8532||J>=8539&&J<=8542||J>=8544&&J<=8555||J>=8560&&J<=8569||J===8585||J>=8592&&J<=8601||J===8632||J===8633||J===8658||J===8660||J===8679||J===8704||J===8706||J===8707||J===8711||J===8712||J===8715||J===8719||J===8721||J===8725||J===8730||J>=8733&&J<=8736||J===8739||J===8741||J>=8743&&J<=8748||J===8750||J>=8756&&J<=8759||J===8764||J===8765||J===8776||J===8780||J===8786||J===8800||J===8801||J>=8804&&J<=8807||J===8810||J===8811||J===8814||J===8815||J===8834||J===8835||J===8838||J===8839||J===8853||J===8857||J===8869||J===8895||J===8978||J>=9312&&J<=9449||J>=9451&&J<=9547||J>=9552&&J<=9587||J>=9600&&J<=9615||J>=9618&&J<=9621||J===9632||J===9633||J>=9635&&J<=9641||J===9650||J===9651||J===9654||J===9655||J===9660||J===9661||J===9664||J===9665||J>=9670&&J<=9672||J===9675||J>=9678&&J<=9681||J>=9698&&J<=9701||J===9711||J===9733||J===9734||J===9737||J===9742||J===9743||J===9756||J===9758||J===9792||J===9794||J===9824||J===9825||J>=9827&&J<=9829||J>=9831&&J<=9834||J===9836||J===9837||J===9839||J===9886||J===9887||J===9919||J>=9926&&J<=9933||J>=9935&&J<=9939||J>=9941&&J<=9953||J===9955||J===9960||J===9961||J>=9963&&J<=9969||J===9972||J>=9974&&J<=9977||J===9979||J===9980||J===9982||J===9983||J===10045||J>=10102&&J<=10111||J>=11094&&J<=11097||J>=12872&&J<=12879||J>=57344&&J<=63743||J>=65024&&J<=65039||J===65533||J>=127232&&J<=127242||J>=127248&&J<=127277||J>=127280&&J<=127337||J>=127344&&J<=127373||J===127375||J===127376||J>=127387&&J<=127404||J>=917760&&J<=917999||J>=983040&&J<=1048573||J>=1048576&&J<=1114109}function i(J){return J===12288||J>=65281&&J<=65376||J>=65504&&J<=65510}function r(J){return J>=4352&&J<=4447||J===8986||J===8987||J===9001||J===9002||J>=9193&&J<=9196||J===9200||J===9203||J===9725||J===9726||J===9748||J===9749||J>=9776&&J<=9783||J>=9800&&J<=9811||J===9855||J>=9866&&J<=9871||J===9875||J===9889||J===9898||J===9899||J===9917||J===9918||J===9924||J===9925||J===9934||J===9940||J===9962||J===9970||J===9971||J===9973||J===9978||J===9981||J===9989||J===9994||J===9995||J===10024||J===10060||J===10062||J>=10067&&J<=10069||J===10071||J>=10133&&J<=10135||J===10160||J===10175||J===11035||J===11036||J===11088||J===11093||J>=11904&&J<=11929||J>=11931&&J<=12019||J>=12032&&J<=12245||J>=12272&&J<=12287||J>=12289&&J<=12350||J>=12353&&J<=12438||J>=12441&&J<=12543||J>=12549&&J<=12591||J>=12593&&J<=12686||J>=12688&&J<=12773||J>=12783&&J<=12830||J>=12832&&J<=12871||J>=12880&&J<=42124||J>=42128&&J<=42182||J>=43360&&J<=43388||J>=44032&&J<=55203||J>=63744&&J<=64255||J>=65040&&J<=65049||J>=65072&&J<=65106||J>=65108&&J<=65126||J>=65128&&J<=65131||J>=94176&&J<=94180||J>=94192&&J<=94198||J>=94208&&J<=101589||J>=101631&&J<=101662||J>=101760&&J<=101874||J>=110576&&J<=110579||J>=110581&&J<=110587||J===110589||J===110590||J>=110592&&J<=110882||J===110898||J>=110928&&J<=110930||J===110933||J>=110948&&J<=110951||J>=110960&&J<=111355||J>=119552&&J<=119638||J>=119648&&J<=119670||J===126980||J===127183||J===127374||J>=127377&&J<=127386||J>=127488&&J<=127490||J>=127504&&J<=127547||J>=127552&&J<=127560||J===127568||J===127569||J>=127584&&J<=127589||J>=127744&&J<=127776||J>=127789&&J<=127797||J>=127799&&J<=127868||J>=127870&&J<=127891||J>=127904&&J<=127946||J>=127951&&J<=127955||J>=127968&&J<=127984||J===127988||J>=127992&&J<=128062||J===128064||J>=128066&&J<=128252||J>=128255&&J<=128317||J>=128331&&J<=128334||J>=128336&&J<=128359||J===128378||J===128405||J===128406||J===128420||J>=128507&&J<=128591||J>=128640&&J<=128709||J===128716||J>=128720&&J<=128722||J>=128725&&J<=128728||J>=128732&&J<=128735||J===128747||J===128748||J>=128756&&J<=128764||J>=128992&&J<=129003||J===129008||J>=129292&&J<=129338||J>=129340&&J<=129349||J>=129351&&J<=129535||J>=129648&&J<=129660||J>=129664&&J<=129674||J>=129678&&J<=129734||J===129736||J>=129741&&J<=129756||J>=129759&&J<=129770||J>=129775&&J<=129784||J>=131072&&J<=196605||J>=196608&&J<=262141}function a(J){if(!Number.isSafeInteger(J))throw TypeError(`Expected a code point, got \`${typeof J}\`.`)}function t(J,{ambiguousAsWide:K=!1}={}){if(a(J),i(J)||r(J)||K&&n(J))return 2;return 1}var x=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},e=new Intl.Segmenter,JJ=/^\p{Default_Ignorable_Code_Point}$/u;function KJ(J,K={}){if(typeof J!=="string"||J.length===0)return 0;let{ambiguousIsNarrow:Z=!0,countAnsiEscapeCodes:Y=!1}=K;if(!Y)J=b(J);if(J.length===0)return 0;let X=0,V={ambiguousAsWide:!Z};for(let{segment:z}of e.segment(J)){let $=z.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(JJ.test(z))continue;if(x().test(z)){X+=2;continue}X+=t($,V)}return X}var YJ=new TextEncoder,C=globalThis.Bun,AJ=C?.sleep??$J,vJ=C?.stringWidth??KJ,OJ=C?.stripANSI??b,MJ=C?.write??XJ;async function ZJ(J,K,Z){if(!C){let X=typeof K==="function"?K():K;return H(X instanceof URL?X:new URL(X,Z))}let Y=(await J()).default;if(Y.startsWith("file:"))return H(Y);if(c(Y))return Y;return l(j(H(Z)),Y)}function $J(J){let K=J instanceof Date?J.getTime()-Date.now():J;return new Promise((Z)=>setTimeout(Z,K))}async function XJ(J,K,Z){let Y=J instanceof URL?H(J):J;if(Z?.createPath)await p(j(Y),{recursive:!0});let X=typeof K==="string"?YJ.encode(K):new Uint8Array(K.buffer,K.byteOffset,K.byteLength);return await d(Y,X,{mode:Z?.mode}),X.byteLength}var A=globalThis;class S{bufferParsers=new Map;filetypeParserOptions=new Map;filetypeAliases=new Map;filetypeParsers=new Map;filetypeParserPromises=new Map;reusableParsers=new Map;reusableParserPromises=new Map;initializePromise;performance;dataPath;tsDataPath;initialized=!1;constructor(){this.performance={averageParseTime:0,parseTimes:[],averageQueryTime:0,queryTimes:[]}}async fetchQueries(J,K){if(!this.tsDataPath)return"";return w.fetchHighlightQueries(J,this.tsDataPath,K)}async initialize({dataPath:J}){if(this.initializePromise)return this.initializePromise;return this.initializePromise=(async()=>{this.dataPath=J,this.tsDataPath=M.join(J,"tree-sitter"),await W(M.join(this.tsDataPath,"languages"),{recursive:!0}),await W(M.join(this.tsDataPath,"queries"),{recursive:!0});let K=await ZJ(()=>import("./chunk-vh9ptqn0.js",{with:{type:"wasm"}}),()=>import.meta.resolve("web-tree-sitter/tree-sitter.wasm"),import.meta.url);if(f(K))K=g(M.parse(K).base);await D.init({locateFile(){return K}}),this.initialized=!0})(),this.initializePromise}addFiletypeParser(J){let K=this.filetypeParserOptions.get(J.filetype)?.aliases??[];for(let Y of K)if(this.filetypeAliases.get(Y)===J.filetype)this.filetypeAliases.delete(Y);let Z=[...new Set((J.aliases??[]).filter((Y)=>Y!==J.filetype))];this.filetypeAliases.delete(J.filetype),this.filetypeParserOptions.set(J.filetype,{...J,aliases:Z});for(let Y of Z)this.filetypeAliases.set(Y,J.filetype);this.invalidateParserCaches(J.filetype)}resolveCanonicalFiletype(J){if(this.filetypeParserOptions.has(J))return J;return this.filetypeAliases.get(J)??J}invalidateParserCaches(J){this.filetypeParsers.delete(J),this.filetypeParserPromises.delete(J);let K=this.reusableParsers.get(J);if(K)K.parser.delete(),this.reusableParsers.delete(J);this.reusableParserPromises.delete(J)}async createQueries(J,K){try{let Z=await this.fetchQueries(J.queries.highlights,J.filetype);if(!Z){console.error("Failed to fetch highlight queries for:",J.filetype);return}let X={highlights:new L(K,Z)};if(J.queries.injections&&J.queries.injections.length>0){let V=await this.fetchQueries(J.queries.injections,J.filetype);if(V)X.injections=new L(K,V)}return X}catch(Z){console.error("Error creating queries for",J.filetype,J.queries),console.error(Z);return}}async loadLanguage(J){if(!this.initialized||!this.tsDataPath)return;let K=await w.downloadOrLoad(J,this.tsDataPath,"languages",".wasm",!1);if(K.error){console.error(`Error loading language ${J}:`,K.error);return}if(!K.filePath)return;let Z=K.filePath.replaceAll("\\","/");try{return await I.load(Z)}catch(Y){console.error(`Error loading language from ${Z}:`,Y);return}}async resolveFiletypeParser(J){let K=this.resolveCanonicalFiletype(J);if(this.filetypeParsers.has(K))return this.filetypeParsers.get(K);if(this.filetypeParserPromises.has(K))return this.filetypeParserPromises.get(K);let Z=this.loadFiletypeParser(K);this.filetypeParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.filetypeParsers.set(K,Y);return Y}finally{this.filetypeParserPromises.delete(K)}}async loadFiletypeParser(J){let K=this.filetypeParserOptions.get(J);if(!K)return;let Z=await this.loadLanguage(K.wasm);if(!Z)return;let Y=await this.createQueries(K,Z);if(!Y){console.error("Failed to create queries for:",J);return}return{...K,queries:Y,language:Z}}async preloadParser(J){return this.resolveFiletypeParser(J)}async getReusableParser(J){let K=this.resolveCanonicalFiletype(J);if(this.reusableParsers.has(K))return this.reusableParsers.get(K);if(this.reusableParserPromises.has(K))return this.reusableParserPromises.get(K);let Z=this.createReusableParser(K);this.reusableParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.reusableParsers.set(K,Y);return Y}finally{this.reusableParserPromises.delete(K)}}async createReusableParser(J){let K=await this.resolveFiletypeParser(J);if(!K)return;let Z=new D;return Z.setLanguage(K.language),{parser:Z,filetypeParser:K,queries:K.queries}}async handleInitializeParser(J,K,Z,Y,X){let V=await this.resolveFiletypeParser(Y);if(!V){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,warning:`No parser available for filetype ${Y}`});return}let z=new D;z.setLanguage(V.language);let $=z.parse(Z);if(!$){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,error:"Failed to parse buffer"});return}let Q={parser:z,tree:$,queries:V.queries,filetype:Y,content:Z,injectionMapping:V.injectionMapping};this.bufferParsers.set(J,Q),A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!0});let B=await this.initialQuery(Q);A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:J,version:K,...B})}async initialQuery(J){let Z=J.queries.highlights.captures(J.tree.rootNode),Y=new Map;if(J.queries.injections){let X=await this.processInjections(J);Z.push(...X.captures),Y=X.injectionRanges}return this.getHighlights(J,Z,Y)}getNodeText(J,K){return K.substring(J.startIndex,J.endIndex)}async processInjections(J){let K=[],Z=new Map;if(!J.queries.injections)return{captures:K,injectionRanges:Z};let Y=J.content,X=J.queries.injections.captures(J.tree.rootNode),V=new Map,z=J.injectionMapping;for(let $ of X){let Q=$.name;if(Q==="injection.content"||Q.includes("injection")){let B=$.node.type,G;if(z?.nodeTypes&&z.nodeTypes[B])G=z.nodeTypes[B];else if(B==="code_fence_content"){let v=$.node.parent;if(v){let O=v.children.find((E)=>E.type==="info_string");if(O){let E=O.children.find((q)=>q.type==="language");if(E){let q=this.getNodeText(E,Y);if(z?.infoStringMap&&z.infoStringMap[q])G=z.infoStringMap[q];else G=q}}}}if(G){if(!V.has(G))V.set(G,[]);V.get(G).push({node:$.node,name:$.name})}}}for(let[$,Q]of V.entries()){let B=await this.getReusableParser($);if(!B){console.warn(`No parser found for injection language: ${$}`);continue}if(!Z.has($))Z.set($,[]);let G=B.parser;for(let{node:v}of Q)try{Z.get($).push({start:v.startIndex,end:v.endIndex});let O=this.getNodeText(v,Y),E=G.parse(O);if(E){let q=B.queries.highlights.captures(E.rootNode);for(let _ of q){let T={name:_.name,patternIndex:_.patternIndex,_injectedQuery:B.queries.highlights,node:{..._.node,startPosition:{row:_.node.startPosition.row+v.startPosition.row,column:_.node.startPosition.row===0?_.node.startPosition.column+v.startPosition.column:_.node.startPosition.column},endPosition:{row:_.node.endPosition.row+v.startPosition.row,column:_.node.endPosition.row===0?_.node.endPosition.column+v.startPosition.column:_.node.endPosition.column},startIndex:_.node.startIndex+v.startIndex,endIndex:_.node.endIndex+v.startIndex}};K.push(T)}E.delete()}}catch(O){console.error(`Error processing injection for language ${$}:`,O)}}return{captures:K,injectionRanges:Z}}editToRange(J){return{startPosition:{column:J.startPosition.column,row:J.startPosition.row},endPosition:{column:J.newEndPosition.column,row:J.newEndPosition.row},startIndex:J.startIndex,endIndex:J.newEndIndex}}async handleEdits(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=K;for(let q of Z)Y.tree.edit(q);let X=performance.now(),V=Y.parser.parse(K,Y.tree),$=performance.now()-X;if(this.performance.parseTimes.push($),this.performance.parseTimes.length>10)this.performance.parseTimes.shift();if(this.performance.averageParseTime=this.performance.parseTimes.reduce((q,_)=>q+_,0)/this.performance.parseTimes.length,!V)return{error:"Failed to parse buffer"};let Q=Y.tree.getChangedRanges(V);Y.tree=V;let B=performance.now(),G=[];if(Q.length===0)Z.forEach((q)=>{let _=this.editToRange(q);Q.push(_)});for(let q of Q){let _=Y.tree.rootNode.descendantForPosition(q.startPosition,q.endPosition);if(!_)continue;if(_.equals(Y.tree.rootNode)){let m=Y.queries.highlights.captures(_,{startIndex:q.startIndex-100,endIndex:q.endIndex+1000});G.push(...m);continue}while(_&&!this.nodeContainsRange(_,q))_=_.parent;if(!_)_=Y.tree.rootNode;let T=Y.queries.highlights.captures(_);G.push(...T)}let v=new Map;if(Y.queries.injections){let q=await this.processInjections(Y);G.push(...q.captures),v=q.injectionRanges}let E=performance.now()-B;if(this.performance.queryTimes.push(E),this.performance.queryTimes.length>10)this.performance.queryTimes.shift();return this.performance.averageQueryTime=this.performance.queryTimes.reduce((q,_)=>q+_,0)/this.performance.queryTimes.length,this.getHighlights(Y,G,v)}nodeContainsRange(J,K){return J.startPosition.row<=K.startPosition.row&&J.endPosition.row>=K.endPosition.row&&(J.startPosition.row<K.startPosition.row||J.startPosition.column<=K.startPosition.column)&&(J.endPosition.row>K.endPosition.row||J.endPosition.column>=K.endPosition.column)}getHighlights(J,K,Z){let Y=new Map,X=new Map;for(let V of K){let z=V.node,$=z.startPosition.row,Q=z.endPosition.row,B={startCol:z.startPosition.column,endCol:z.endPosition.column,group:V.name};if(!Y.has($))Y.set($,new Map),X.set($,new Map);if(Y.get($)?.has(z.id))X.get($)?.set(z.id,Y.get($)?.get(z.id));if(Y.get($)?.set(z.id,B),$!==Q)for(let G=$+1;G<=Q;G++){if(!Y.has(G))Y.set(G,new Map);let v={startCol:0,endCol:z.endPosition.column,group:V.name};Y.get(G)?.set(z.id,v)}}return{highlights:Array.from(Y.entries()).map(([V,z])=>({line:V,highlights:Array.from(z.values()),droppedHighlights:X.get(V)?Array.from(X.get(V).values()):[]}))}}getSimpleHighlights(J,K){let Z=[],Y=[];for(let[X,V]of K.entries())for(let z of V)Y.push({...z,lang:X});for(let X of J){let V=X.node,z=!1,$,Q=!1;for(let q of Y)if(V.startIndex>=q.start&&V.endIndex<=q.end){z=!0,$=q.lang;break}else if(V.startIndex<=q.start&&V.endIndex>=q.end){Q=!0;break}let G=X._injectedQuery?.setProperties?.[X.patternIndex],v=G?.conceal??X.setProperties?.conceal,O=G?.conceal_lines??X.setProperties?.conceal_lines,E={};if(z&&$)E.isInjection=!0,E.injectionLang=$;if(Q)E.containsInjection=!0;if(v!==void 0)E.conceal=v;if(O!==void 0)E.concealLines=O;if(Object.keys(E).length>0)Z.push([V.startIndex,V.endIndex,X.name,E]);else Z.push([V.startIndex,V.endIndex,X.name])}return Z.sort((X,V)=>X[0]-V[0]),Z}async handleResetBuffer(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=Z;let X=Y.parser.parse(Z);if(!X)return{error:"Failed to parse buffer during reset"};Y.tree=X;let V=Y.queries.highlights.captures(Y.tree.rootNode),z=new Map;if(Y.queries.injections){let $=await this.processInjections(Y);V.push(...$.captures),z=$.injectionRanges}return this.getHighlights(Y,V,z)}disposeBuffer(J){let K=this.bufferParsers.get(J);if(!K)return;K.tree.delete(),K.parser.delete(),this.bufferParsers.delete(J)}async handleOneShotHighlight(J,K,Z){let Y=await this.getReusableParser(K);if(!Y){A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!1,warning:`No parser available for filetype ${K}`});return}let X=K==="markdown"&&J.endsWith("```")?J+`
2
+ import{LP as L,MP as I,PP as D}from"./chunk-wjz42325.js";import{WP as F}from"./chunk-f2pv705d.js";import{mkdir as W}from"fs/promises";import*as M from"path";import{mkdir as R,readFile as N,writeFile as k}from"fs/promises";import*as U from"path";import{isMainThread as y}from"worker_threads";import{basename as P,join as h}from"path";import{mkdir as p,writeFile as d}from"fs/promises";import{dirname as j,isAbsolute as c,resolve as l}from"path";import{fileURLToPath as H}from"url";class w{static hashUrl(J){let K=0;for(let Z=0;Z<J.length;Z++){let Y=J.charCodeAt(Z);K=(K<<5)-K+Y,K=K&K}return Math.abs(K).toString(16)}static async downloadOrLoad(J,K,Z,Y,X=!0,V){if(J.startsWith("http://")||J.startsWith("https://")){let $;if(X){let B=this.hashUrl(J);$=V?`${V}-${B}${Y}`:`${B}${Y}`}else $=U.basename(J);let Q=U.join(K,Z,$);await R(U.dirname(Q),{recursive:!0});try{let B=await N(Q);if(B.byteLength>0)return console.log(`Loaded from cache: ${Q} (${J})`),{content:B,filePath:Q}}catch(B){}try{console.log(`Downloading from URL: ${J}`);let B=await fetch(J);if(!B.ok)return{error:`Failed to fetch from ${J}: ${B.statusText}`};let G=Buffer.from(await B.arrayBuffer());try{await k(Q,Buffer.from(G)),console.log(`Cached: ${J}`)}catch(v){console.warn(`Failed to cache: ${v}`)}return{content:G,filePath:Q}}catch(B){return{error:`Error downloading from ${J}: ${B}`}}}else try{return console.log(`Loading from local path: ${J}`),{content:await N(J),filePath:J}}catch($){return{error:`Error loading from local path ${J}: ${$}`}}}static async downloadToPath(J,K){let Z=J.startsWith("http://")||J.startsWith("https://");if(await R(U.dirname(K),{recursive:!0}),Z)try{console.log(`Downloading from URL: ${J}`);let Y=await fetch(J);if(!Y.ok)return{error:`Failed to fetch from ${J}: ${Y.statusText}`};let X=Buffer.from(await Y.arrayBuffer());return await k(K,Buffer.from(X)),console.log(`Downloaded: ${J} -> ${K}`),{content:X,filePath:K}}catch(Y){return{error:`Error downloading from ${J}: ${Y}`}}else try{console.log(`Copying from local path: ${J}`);let Y=await N(J);return await k(K,Buffer.from(Y)),{content:Y,filePath:K}}catch(Y){return{error:`Error copying from local path ${J}: ${Y}`}}}static async fetchHighlightQueries(J,K,Z){let Y=J.map((z)=>this.fetchHighlightQuery(z,K,Z));return(await Promise.all(Y)).filter((z)=>z.trim().length>0).join(`
3
+ `)}static async fetchHighlightQuery(J,K,Z){let Y=await this.downloadOrLoad(J,K,"queries",".scm",!0,Z);if(Y.error)return console.error(`Error fetching highlight query from ${J}:`,Y.error),"";if(Y.content)return new TextDecoder().decode(Y.content);return""}}function f(J){return J.includes("$bunfs")||/^B:[\\/]~BUN/i.test(J)}function u(){return process.platform==="win32"?"B:\\~BUN\\root":"/$bunfs/root"}function g(J){return h(u(),P(J))}function o({onlyFirst:J=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",J?void 0:"g")}var s=o();function b(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(s,"")}function n(J){return J===161||J===164||J===167||J===168||J===170||J===173||J===174||J>=176&&J<=180||J>=182&&J<=186||J>=188&&J<=191||J===198||J===208||J===215||J===216||J>=222&&J<=225||J===230||J>=232&&J<=234||J===236||J===237||J===240||J===242||J===243||J>=247&&J<=250||J===252||J===254||J===257||J===273||J===275||J===283||J===294||J===295||J===299||J>=305&&J<=307||J===312||J>=319&&J<=322||J===324||J>=328&&J<=331||J===333||J===338||J===339||J===358||J===359||J===363||J===462||J===464||J===466||J===468||J===470||J===472||J===474||J===476||J===593||J===609||J===708||J===711||J>=713&&J<=715||J===717||J===720||J>=728&&J<=731||J===733||J===735||J>=768&&J<=879||J>=913&&J<=929||J>=931&&J<=937||J>=945&&J<=961||J>=963&&J<=969||J===1025||J>=1040&&J<=1103||J===1105||J===8208||J>=8211&&J<=8214||J===8216||J===8217||J===8220||J===8221||J>=8224&&J<=8226||J>=8228&&J<=8231||J===8240||J===8242||J===8243||J===8245||J===8251||J===8254||J===8308||J===8319||J>=8321&&J<=8324||J===8364||J===8451||J===8453||J===8457||J===8467||J===8470||J===8481||J===8482||J===8486||J===8491||J===8531||J===8532||J>=8539&&J<=8542||J>=8544&&J<=8555||J>=8560&&J<=8569||J===8585||J>=8592&&J<=8601||J===8632||J===8633||J===8658||J===8660||J===8679||J===8704||J===8706||J===8707||J===8711||J===8712||J===8715||J===8719||J===8721||J===8725||J===8730||J>=8733&&J<=8736||J===8739||J===8741||J>=8743&&J<=8748||J===8750||J>=8756&&J<=8759||J===8764||J===8765||J===8776||J===8780||J===8786||J===8800||J===8801||J>=8804&&J<=8807||J===8810||J===8811||J===8814||J===8815||J===8834||J===8835||J===8838||J===8839||J===8853||J===8857||J===8869||J===8895||J===8978||J>=9312&&J<=9449||J>=9451&&J<=9547||J>=9552&&J<=9587||J>=9600&&J<=9615||J>=9618&&J<=9621||J===9632||J===9633||J>=9635&&J<=9641||J===9650||J===9651||J===9654||J===9655||J===9660||J===9661||J===9664||J===9665||J>=9670&&J<=9672||J===9675||J>=9678&&J<=9681||J>=9698&&J<=9701||J===9711||J===9733||J===9734||J===9737||J===9742||J===9743||J===9756||J===9758||J===9792||J===9794||J===9824||J===9825||J>=9827&&J<=9829||J>=9831&&J<=9834||J===9836||J===9837||J===9839||J===9886||J===9887||J===9919||J>=9926&&J<=9933||J>=9935&&J<=9939||J>=9941&&J<=9953||J===9955||J===9960||J===9961||J>=9963&&J<=9969||J===9972||J>=9974&&J<=9977||J===9979||J===9980||J===9982||J===9983||J===10045||J>=10102&&J<=10111||J>=11094&&J<=11097||J>=12872&&J<=12879||J>=57344&&J<=63743||J>=65024&&J<=65039||J===65533||J>=127232&&J<=127242||J>=127248&&J<=127277||J>=127280&&J<=127337||J>=127344&&J<=127373||J===127375||J===127376||J>=127387&&J<=127404||J>=917760&&J<=917999||J>=983040&&J<=1048573||J>=1048576&&J<=1114109}function i(J){return J===12288||J>=65281&&J<=65376||J>=65504&&J<=65510}function r(J){return J>=4352&&J<=4447||J===8986||J===8987||J===9001||J===9002||J>=9193&&J<=9196||J===9200||J===9203||J===9725||J===9726||J===9748||J===9749||J>=9776&&J<=9783||J>=9800&&J<=9811||J===9855||J>=9866&&J<=9871||J===9875||J===9889||J===9898||J===9899||J===9917||J===9918||J===9924||J===9925||J===9934||J===9940||J===9962||J===9970||J===9971||J===9973||J===9978||J===9981||J===9989||J===9994||J===9995||J===10024||J===10060||J===10062||J>=10067&&J<=10069||J===10071||J>=10133&&J<=10135||J===10160||J===10175||J===11035||J===11036||J===11088||J===11093||J>=11904&&J<=11929||J>=11931&&J<=12019||J>=12032&&J<=12245||J>=12272&&J<=12287||J>=12289&&J<=12350||J>=12353&&J<=12438||J>=12441&&J<=12543||J>=12549&&J<=12591||J>=12593&&J<=12686||J>=12688&&J<=12773||J>=12783&&J<=12830||J>=12832&&J<=12871||J>=12880&&J<=42124||J>=42128&&J<=42182||J>=43360&&J<=43388||J>=44032&&J<=55203||J>=63744&&J<=64255||J>=65040&&J<=65049||J>=65072&&J<=65106||J>=65108&&J<=65126||J>=65128&&J<=65131||J>=94176&&J<=94180||J>=94192&&J<=94198||J>=94208&&J<=101589||J>=101631&&J<=101662||J>=101760&&J<=101874||J>=110576&&J<=110579||J>=110581&&J<=110587||J===110589||J===110590||J>=110592&&J<=110882||J===110898||J>=110928&&J<=110930||J===110933||J>=110948&&J<=110951||J>=110960&&J<=111355||J>=119552&&J<=119638||J>=119648&&J<=119670||J===126980||J===127183||J===127374||J>=127377&&J<=127386||J>=127488&&J<=127490||J>=127504&&J<=127547||J>=127552&&J<=127560||J===127568||J===127569||J>=127584&&J<=127589||J>=127744&&J<=127776||J>=127789&&J<=127797||J>=127799&&J<=127868||J>=127870&&J<=127891||J>=127904&&J<=127946||J>=127951&&J<=127955||J>=127968&&J<=127984||J===127988||J>=127992&&J<=128062||J===128064||J>=128066&&J<=128252||J>=128255&&J<=128317||J>=128331&&J<=128334||J>=128336&&J<=128359||J===128378||J===128405||J===128406||J===128420||J>=128507&&J<=128591||J>=128640&&J<=128709||J===128716||J>=128720&&J<=128722||J>=128725&&J<=128728||J>=128732&&J<=128735||J===128747||J===128748||J>=128756&&J<=128764||J>=128992&&J<=129003||J===129008||J>=129292&&J<=129338||J>=129340&&J<=129349||J>=129351&&J<=129535||J>=129648&&J<=129660||J>=129664&&J<=129674||J>=129678&&J<=129734||J===129736||J>=129741&&J<=129756||J>=129759&&J<=129770||J>=129775&&J<=129784||J>=131072&&J<=196605||J>=196608&&J<=262141}function a(J){if(!Number.isSafeInteger(J))throw TypeError(`Expected a code point, got \`${typeof J}\`.`)}function t(J,{ambiguousAsWide:K=!1}={}){if(a(J),i(J)||r(J)||K&&n(J))return 2;return 1}var x=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},e=new Intl.Segmenter,JJ=/^\p{Default_Ignorable_Code_Point}$/u;function KJ(J,K={}){if(typeof J!=="string"||J.length===0)return 0;let{ambiguousIsNarrow:Z=!0,countAnsiEscapeCodes:Y=!1}=K;if(!Y)J=b(J);if(J.length===0)return 0;let X=0,V={ambiguousAsWide:!Z};for(let{segment:z}of e.segment(J)){let $=z.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(JJ.test(z))continue;if(x().test(z)){X+=2;continue}X+=t($,V)}return X}var YJ=new TextEncoder,C=globalThis.Bun,AJ=C?.sleep??$J,vJ=C?.stringWidth??KJ,OJ=C?.stripANSI??b,MJ=C?.write??XJ;async function ZJ(J,K,Z){if(!C){let X=typeof K==="function"?K():K;return H(X instanceof URL?X:new URL(X,Z))}let Y=(await J()).default;if(Y.startsWith("file:"))return H(Y);if(c(Y))return Y;return l(j(H(Z)),Y)}function $J(J){let K=J instanceof Date?J.getTime()-Date.now():J;return new Promise((Z)=>setTimeout(Z,K))}async function XJ(J,K,Z){let Y=J instanceof URL?H(J):J;if(Z?.createPath)await p(j(Y),{recursive:!0});let X=typeof K==="string"?YJ.encode(K):new Uint8Array(K.buffer,K.byteOffset,K.byteLength);return await d(Y,X,{mode:Z?.mode}),X.byteLength}var A=globalThis;class S{bufferParsers=new Map;filetypeParserOptions=new Map;filetypeAliases=new Map;filetypeParsers=new Map;filetypeParserPromises=new Map;reusableParsers=new Map;reusableParserPromises=new Map;initializePromise;performance;dataPath;tsDataPath;initialized=!1;constructor(){this.performance={averageParseTime:0,parseTimes:[],averageQueryTime:0,queryTimes:[]}}async fetchQueries(J,K){if(!this.tsDataPath)return"";return w.fetchHighlightQueries(J,this.tsDataPath,K)}async initialize({dataPath:J}){if(this.initializePromise)return this.initializePromise;return this.initializePromise=(async()=>{this.dataPath=J,this.tsDataPath=M.join(J,"tree-sitter"),await W(M.join(this.tsDataPath,"languages"),{recursive:!0}),await W(M.join(this.tsDataPath,"queries"),{recursive:!0});let K=await ZJ(()=>import("./chunk-nwwmns3w.js",{with:{type:"wasm"}}),()=>import.meta.resolve("web-tree-sitter/tree-sitter.wasm"),import.meta.url);if(f(K))K=g(M.parse(K).base);await D.init({locateFile(){return K}}),this.initialized=!0})(),this.initializePromise}addFiletypeParser(J){let K=this.filetypeParserOptions.get(J.filetype)?.aliases??[];for(let Y of K)if(this.filetypeAliases.get(Y)===J.filetype)this.filetypeAliases.delete(Y);let Z=[...new Set((J.aliases??[]).filter((Y)=>Y!==J.filetype))];this.filetypeAliases.delete(J.filetype),this.filetypeParserOptions.set(J.filetype,{...J,aliases:Z});for(let Y of Z)this.filetypeAliases.set(Y,J.filetype);this.invalidateParserCaches(J.filetype)}resolveCanonicalFiletype(J){if(this.filetypeParserOptions.has(J))return J;return this.filetypeAliases.get(J)??J}invalidateParserCaches(J){this.filetypeParsers.delete(J),this.filetypeParserPromises.delete(J);let K=this.reusableParsers.get(J);if(K)K.parser.delete(),this.reusableParsers.delete(J);this.reusableParserPromises.delete(J)}async createQueries(J,K){try{let Z=await this.fetchQueries(J.queries.highlights,J.filetype);if(!Z){console.error("Failed to fetch highlight queries for:",J.filetype);return}let X={highlights:new L(K,Z)};if(J.queries.injections&&J.queries.injections.length>0){let V=await this.fetchQueries(J.queries.injections,J.filetype);if(V)X.injections=new L(K,V)}return X}catch(Z){console.error("Error creating queries for",J.filetype,J.queries),console.error(Z);return}}async loadLanguage(J){if(!this.initialized||!this.tsDataPath)return;let K=await w.downloadOrLoad(J,this.tsDataPath,"languages",".wasm",!1);if(K.error){console.error(`Error loading language ${J}:`,K.error);return}if(!K.filePath)return;let Z=K.filePath.replaceAll("\\","/");try{return await I.load(Z)}catch(Y){console.error(`Error loading language from ${Z}:`,Y);return}}async resolveFiletypeParser(J){let K=this.resolveCanonicalFiletype(J);if(this.filetypeParsers.has(K))return this.filetypeParsers.get(K);if(this.filetypeParserPromises.has(K))return this.filetypeParserPromises.get(K);let Z=this.loadFiletypeParser(K);this.filetypeParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.filetypeParsers.set(K,Y);return Y}finally{this.filetypeParserPromises.delete(K)}}async loadFiletypeParser(J){let K=this.filetypeParserOptions.get(J);if(!K)return;let Z=await this.loadLanguage(K.wasm);if(!Z)return;let Y=await this.createQueries(K,Z);if(!Y){console.error("Failed to create queries for:",J);return}return{...K,queries:Y,language:Z}}async preloadParser(J){return this.resolveFiletypeParser(J)}async getReusableParser(J){let K=this.resolveCanonicalFiletype(J);if(this.reusableParsers.has(K))return this.reusableParsers.get(K);if(this.reusableParserPromises.has(K))return this.reusableParserPromises.get(K);let Z=this.createReusableParser(K);this.reusableParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.reusableParsers.set(K,Y);return Y}finally{this.reusableParserPromises.delete(K)}}async createReusableParser(J){let K=await this.resolveFiletypeParser(J);if(!K)return;let Z=new D;return Z.setLanguage(K.language),{parser:Z,filetypeParser:K,queries:K.queries}}async handleInitializeParser(J,K,Z,Y,X){let V=await this.resolveFiletypeParser(Y);if(!V){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,warning:`No parser available for filetype ${Y}`});return}let z=new D;z.setLanguage(V.language);let $=z.parse(Z);if(!$){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,error:"Failed to parse buffer"});return}let Q={parser:z,tree:$,queries:V.queries,filetype:Y,content:Z,injectionMapping:V.injectionMapping};this.bufferParsers.set(J,Q),A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!0});let B=await this.initialQuery(Q);A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:J,version:K,...B})}async initialQuery(J){let Z=J.queries.highlights.captures(J.tree.rootNode),Y=new Map;if(J.queries.injections){let X=await this.processInjections(J);Z.push(...X.captures),Y=X.injectionRanges}return this.getHighlights(J,Z,Y)}getNodeText(J,K){return K.substring(J.startIndex,J.endIndex)}async processInjections(J){let K=[],Z=new Map;if(!J.queries.injections)return{captures:K,injectionRanges:Z};let Y=J.content,X=J.queries.injections.captures(J.tree.rootNode),V=new Map,z=J.injectionMapping;for(let $ of X){let Q=$.name;if(Q==="injection.content"||Q.includes("injection")){let B=$.node.type,G;if(z?.nodeTypes&&z.nodeTypes[B])G=z.nodeTypes[B];else if(B==="code_fence_content"){let v=$.node.parent;if(v){let O=v.children.find((E)=>E.type==="info_string");if(O){let E=O.children.find((q)=>q.type==="language");if(E){let q=this.getNodeText(E,Y);if(z?.infoStringMap&&z.infoStringMap[q])G=z.infoStringMap[q];else G=q}}}}if(G){if(!V.has(G))V.set(G,[]);V.get(G).push({node:$.node,name:$.name})}}}for(let[$,Q]of V.entries()){let B=await this.getReusableParser($);if(!B){console.warn(`No parser found for injection language: ${$}`);continue}if(!Z.has($))Z.set($,[]);let G=B.parser;for(let{node:v}of Q)try{Z.get($).push({start:v.startIndex,end:v.endIndex});let O=this.getNodeText(v,Y),E=G.parse(O);if(E){let q=B.queries.highlights.captures(E.rootNode);for(let _ of q){let T={name:_.name,patternIndex:_.patternIndex,_injectedQuery:B.queries.highlights,node:{..._.node,startPosition:{row:_.node.startPosition.row+v.startPosition.row,column:_.node.startPosition.row===0?_.node.startPosition.column+v.startPosition.column:_.node.startPosition.column},endPosition:{row:_.node.endPosition.row+v.startPosition.row,column:_.node.endPosition.row===0?_.node.endPosition.column+v.startPosition.column:_.node.endPosition.column},startIndex:_.node.startIndex+v.startIndex,endIndex:_.node.endIndex+v.startIndex}};K.push(T)}E.delete()}}catch(O){console.error(`Error processing injection for language ${$}:`,O)}}return{captures:K,injectionRanges:Z}}editToRange(J){return{startPosition:{column:J.startPosition.column,row:J.startPosition.row},endPosition:{column:J.newEndPosition.column,row:J.newEndPosition.row},startIndex:J.startIndex,endIndex:J.newEndIndex}}async handleEdits(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=K;for(let q of Z)Y.tree.edit(q);let X=performance.now(),V=Y.parser.parse(K,Y.tree),$=performance.now()-X;if(this.performance.parseTimes.push($),this.performance.parseTimes.length>10)this.performance.parseTimes.shift();if(this.performance.averageParseTime=this.performance.parseTimes.reduce((q,_)=>q+_,0)/this.performance.parseTimes.length,!V)return{error:"Failed to parse buffer"};let Q=Y.tree.getChangedRanges(V);Y.tree=V;let B=performance.now(),G=[];if(Q.length===0)Z.forEach((q)=>{let _=this.editToRange(q);Q.push(_)});for(let q of Q){let _=Y.tree.rootNode.descendantForPosition(q.startPosition,q.endPosition);if(!_)continue;if(_.equals(Y.tree.rootNode)){let m=Y.queries.highlights.captures(_,{startIndex:q.startIndex-100,endIndex:q.endIndex+1000});G.push(...m);continue}while(_&&!this.nodeContainsRange(_,q))_=_.parent;if(!_)_=Y.tree.rootNode;let T=Y.queries.highlights.captures(_);G.push(...T)}let v=new Map;if(Y.queries.injections){let q=await this.processInjections(Y);G.push(...q.captures),v=q.injectionRanges}let E=performance.now()-B;if(this.performance.queryTimes.push(E),this.performance.queryTimes.length>10)this.performance.queryTimes.shift();return this.performance.averageQueryTime=this.performance.queryTimes.reduce((q,_)=>q+_,0)/this.performance.queryTimes.length,this.getHighlights(Y,G,v)}nodeContainsRange(J,K){return J.startPosition.row<=K.startPosition.row&&J.endPosition.row>=K.endPosition.row&&(J.startPosition.row<K.startPosition.row||J.startPosition.column<=K.startPosition.column)&&(J.endPosition.row>K.endPosition.row||J.endPosition.column>=K.endPosition.column)}getHighlights(J,K,Z){let Y=new Map,X=new Map;for(let V of K){let z=V.node,$=z.startPosition.row,Q=z.endPosition.row,B={startCol:z.startPosition.column,endCol:z.endPosition.column,group:V.name};if(!Y.has($))Y.set($,new Map),X.set($,new Map);if(Y.get($)?.has(z.id))X.get($)?.set(z.id,Y.get($)?.get(z.id));if(Y.get($)?.set(z.id,B),$!==Q)for(let G=$+1;G<=Q;G++){if(!Y.has(G))Y.set(G,new Map);let v={startCol:0,endCol:z.endPosition.column,group:V.name};Y.get(G)?.set(z.id,v)}}return{highlights:Array.from(Y.entries()).map(([V,z])=>({line:V,highlights:Array.from(z.values()),droppedHighlights:X.get(V)?Array.from(X.get(V).values()):[]}))}}getSimpleHighlights(J,K){let Z=[],Y=[];for(let[X,V]of K.entries())for(let z of V)Y.push({...z,lang:X});for(let X of J){let V=X.node,z=!1,$,Q=!1;for(let q of Y)if(V.startIndex>=q.start&&V.endIndex<=q.end){z=!0,$=q.lang;break}else if(V.startIndex<=q.start&&V.endIndex>=q.end){Q=!0;break}let G=X._injectedQuery?.setProperties?.[X.patternIndex],v=G?.conceal??X.setProperties?.conceal,O=G?.conceal_lines??X.setProperties?.conceal_lines,E={};if(z&&$)E.isInjection=!0,E.injectionLang=$;if(Q)E.containsInjection=!0;if(v!==void 0)E.conceal=v;if(O!==void 0)E.concealLines=O;if(Object.keys(E).length>0)Z.push([V.startIndex,V.endIndex,X.name,E]);else Z.push([V.startIndex,V.endIndex,X.name])}return Z.sort((X,V)=>X[0]-V[0]),Z}async handleResetBuffer(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=Z;let X=Y.parser.parse(Z);if(!X)return{error:"Failed to parse buffer during reset"};Y.tree=X;let V=Y.queries.highlights.captures(Y.tree.rootNode),z=new Map;if(Y.queries.injections){let $=await this.processInjections(Y);V.push(...$.captures),z=$.injectionRanges}return this.getHighlights(Y,V,z)}disposeBuffer(J){let K=this.bufferParsers.get(J);if(!K)return;K.tree.delete(),K.parser.delete(),this.bufferParsers.delete(J)}async handleOneShotHighlight(J,K,Z){let Y=await this.getReusableParser(K);if(!Y){A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!1,warning:`No parser available for filetype ${K}`});return}let X=K==="markdown"&&J.endsWith("```")?J+`
4
4
  `:J,V=Y.parser.parse(X);if(!V){A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!1,error:"Failed to parse content"});return}try{let z=Y.filetypeParser.queries.highlights.captures(V.rootNode),$=new Map;if(Y.filetypeParser.queries.injections){let B={parser:Y.parser,tree:V,queries:Y.filetypeParser.queries,filetype:K,content:J,injectionMapping:Y.filetypeParser.injectionMapping},G=await this.processInjections(B);z.push(...G.captures),$=G.injectionRanges}let Q=this.getSimpleHighlights(z,$);A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!0,highlights:Q})}finally{V.delete()}}async updateDataPath(J){this.dataPath=J,this.tsDataPath=M.join(J,"tree-sitter");try{await W(M.join(this.tsDataPath,"languages"),{recursive:!0}),await W(M.join(this.tsDataPath,"queries"),{recursive:!0})}catch(K){throw Error(`Failed to update data path: ${K}`)}}async clearCache(){if(!this.dataPath||!this.tsDataPath)throw Error("No data path configured");let{rm:J}=await import("fs/promises");try{let K=M.join(this.dataPath,"tree-sitter");await J(K,{recursive:!0,force:!0}),await W(M.join(K,"languages"),{recursive:!0}),await W(M.join(K,"queries"),{recursive:!0}),this.filetypeParsers.clear(),this.filetypeParserPromises.clear(),this.reusableParsers.clear(),this.reusableParserPromises.clear()}catch(K){throw Error(`Failed to clear cache: ${K}`)}}}if(!y){let J=function(Z,...Y){A.postMessage({type:"WORKER_LOG",logType:Z,data:Y})},K=new S;console.log=(...Z)=>J("log",...Z),console.error=(...Z)=>J("error",...Z),console.warn=(...Z)=>J("warn",...Z),A.onmessage=async(Z)=>{let{type:Y,bufferId:X,version:V,content:z,filetype:$,edits:Q,filetypeParser:B,messageId:G,dataPath:v}=Z.data;try{switch(Y){case"INIT":try{await K.initialize({dataPath:v}),A.postMessage({type:"INIT_RESPONSE"})}catch(_){A.postMessage({type:"INIT_RESPONSE",error:_ instanceof Error?_.stack||_.message:String(_)})}break;case"ADD_FILETYPE_PARSER":K.addFiletypeParser(B);break;case"PRELOAD_PARSER":let O=await K.preloadParser($);A.postMessage({type:"PRELOAD_PARSER_RESPONSE",messageId:G,hasParser:!!O});break;case"INITIALIZE_PARSER":await K.handleInitializeParser(X,V,z,$,G);break;case"HANDLE_EDITS":let E=await K.handleEdits(X,z,Q);if(E.highlights&&E.highlights.length>0)A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:X,version:V,...E});else if(E.warning)A.postMessage({type:"WARNING",bufferId:X,warning:E.warning});else if(E.error)A.postMessage({type:"ERROR",bufferId:X,error:E.error});break;case"GET_PERFORMANCE":A.postMessage({type:"PERFORMANCE_RESPONSE",performance:K.performance,messageId:G});break;case"RESET_BUFFER":let q=await K.handleResetBuffer(X,V,z);if(q.highlights&&q.highlights.length>0)A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:X,version:V,...q});else if(q.warning)A.postMessage({type:"WARNING",bufferId:X,warning:q.warning});else if(q.error)A.postMessage({type:"ERROR",bufferId:X,error:q.error});break;case"DISPOSE_BUFFER":K.disposeBuffer(X),A.postMessage({type:"BUFFER_DISPOSED",bufferId:X});break;case"ONESHOT_HIGHLIGHT":await K.handleOneShotHighlight(z,$,G);break;case"UPDATE_DATA_PATH":try{await K.updateDataPath(v),A.postMessage({type:"UPDATE_DATA_PATH_RESPONSE",messageId:G})}catch(_){A.postMessage({type:"UPDATE_DATA_PATH_RESPONSE",messageId:G,error:_ instanceof Error?_.message:String(_)})}break;case"CLEAR_CACHE":try{await K.clearCache(),A.postMessage({type:"CLEAR_CACHE_RESPONSE",messageId:G})}catch(_){A.postMessage({type:"CLEAR_CACHE_RESPONSE",messageId:G,error:_ instanceof Error?_.message:String(_)})}break;default:A.postMessage({type:"ERROR",bufferId:X,error:`Unknown message type: ${Y}`})}}catch(O){A.postMessage({type:"ERROR",bufferId:X,error:O instanceof Error?O.stack||O.message:String(O)})}}}
package/bundle/worker.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{fg as V}from"./chunk-5zkj5xv9.js";import{kg as x}from"./chunk-kengqzja.js";import"./chunk-5asx1706.js";import"./chunk-43ttzy29.js";import"./chunk-pe2xdkez.js";import"./chunk-f0t7rryn.js";import"./chunk-nfg7nt13.js";import"./chunk-450fef7h.js";import"./chunk-ycvwpmd9.js";import{Bh as O,ah as S}from"./chunk-hjt94wce.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{dl as Z,wj as Y}from"./chunk-k3dacdp5.js";import{fl as N}from"./chunk-99s035f0.js";import{Nl as q,ql as P}from"./chunk-h9wh48d0.js";import"./chunk-tzb26ntq.js";import"./chunk-mh19kwzw.js";import"./chunk-q3h42a94.js";import"./chunk-hqbbs9dm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-cfhfc86j.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-q3nvzhyh.js";import"./chunk-5df5aja0.js";import"./chunk-73r8bjjz.js";import{Hr as z}from"./chunk-xy0gnpen.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import{$r as C}from"./chunk-7vmx8bg9.js";import"./chunk-tkrwcjkr.js";import"./chunk-vdrz2t9c.js";import{Cs as j,ds as X,gs as G}from"./chunk-fr34mnyg.js";import"./chunk-r5zy4za0.js";import{Ns as T,Ws as W}from"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";var $=W.create({service:"upgrade"});function k(D,E){if(D===!1)return"disabled";if(D===!0&&E==="patch")return"install";return"notify"}async function M(){if(G)return;let D=await O.runPromise(Z.Service.use((J)=>J.getGlobal())),E=await O.runPromise(N.Service.use((J)=>J.method())),K=await O.runPromise(N.Service.use((J)=>J.latest(E))).catch((J)=>{$.warn("failed to check for updates",{method:E,error:String(J)})});if(!K)return;if(!N.isNewerVersion(X,K)){$.warn("ignoring non-newer update version",{current:X,latest:K});return}if(T.QITQODE_ALWAYS_NOTIFY_UPDATE){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(T.QITQODE_DISABLE_AUTOUPDATE)return;let _=N.getReleaseType(X,K),Q=k(D.autoupdate,_);if(Q==="disabled")return;if(Q==="notify"){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(E==="unknown")return;await O.runPromise(N.Service.use((J)=>J.upgrade(E,K))).then(()=>Y.publish(N.Event.Updated,{version:K})).catch((J)=>{$.warn("auto-upgrade failed",{method:E,target:K,error:String(J)})})}import{writeHeapSnapshot as w}from"v8";j("worker");await W.init({print:process.argv.includes("--print-logs"),dev:N.isLocal(),level:(()=>{if(N.isLocal())return"DEBUG";return"INFO"})()});V.start();C("worker");P.on("event",(D)=>{z.emit("global.event",D)});var U,H={async ping(){return"pong"},async fetch(D){let E={...D.headers},K=L();if(K&&!E.authorization&&!E.Authorization)E.Authorization=K;let _=new Request(D.url,{method:D.method,headers:E,body:D.body}),Q=await x.Default().app.fetch(_),J=await Q.text();return{status:Q.status,headers:Object.fromEntries(Q.headers.entries()),body:J}},snapshot(){return w("server.heapsnapshot")},async server(D){if(U)await U.stop(!0);return U=await x.listen(D),{url:U.url.toString()}},async checkUpgrade(D){await q.provide({directory:D.directory,init:()=>O.runPromise(S),fn:async()=>{await M().catch(()=>{})}})},async reload(){await O.runPromise(Z.Service.use((D)=>D.invalidate(!0)))},async shutdown(){if(W.Default.info("worker shutting down"),await q.disposeAll(),U)await U.stop(!0)}};z.listen(H);function L(){let D=T.QITQODE_SERVER_PASSWORD;if(!D)return;let E=T.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${btoa(`${E}:${D}`)}`}export{H as rpc};
2
+ import{gg as V}from"./chunk-n9twhc5d.js";import{lg as x}from"./chunk-q6p92zyn.js";import"./chunk-yd94wz5v.js";import"./chunk-4ngmjk8j.js";import"./chunk-dd4qnh8s.js";import"./chunk-tzq7wjgv.js";import"./chunk-nfg7nt13.js";import"./chunk-v9w88wpy.js";import"./chunk-q87fw8dk.js";import{Ch as O,bh as S}from"./chunk-w43kmnm9.js";import"./chunk-nrk29616.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-wd8hbven.js";import"./chunk-drnj1a14.js";import{el as Z,xj as Y}from"./chunk-9a6p1gdn.js";import{gl as N}from"./chunk-jxkrhrp0.js";import{Ol as q,rl as P}from"./chunk-6k14c8x1.js";import"./chunk-5r05d901.js";import"./chunk-3rgct4bd.js";import"./chunk-5b3v1x2c.js";import"./chunk-gbxf6e5d.js";import"./chunk-msh249db.js";import"./chunk-95am490c.js";import"./chunk-kmzpeq8k.js";import"./chunk-0gsw04hw.js";import"./chunk-hqjc4wgg.js";import"./chunk-makecdh6.js";import"./chunk-dy2k5rdx.js";import"./chunk-n5p7cn4w.js";import"./chunk-cqtkxwd8.js";import"./chunk-mhxyv9c8.js";import"./chunk-0crgymtr.js";import"./chunk-cth373se.js";import"./chunk-xcxqt8ag.js";import"./chunk-va2qfh0x.js";import"./chunk-ae7b11np.js";import"./chunk-eeq0krp7.js";import"./chunk-73xryfgn.js";import"./chunk-yjqww6ag.js";import"./chunk-z6kcnpsj.js";import{ft as z}from"./chunk-ts2k13g0.js";import"./chunk-01e3v1xz.js";import"./chunk-dbpkq7ba.js";import"./chunk-z744mz4w.js";import"./chunk-vjn54xj5.js";import{zt as C}from"./chunk-ntpn0w9m.js";import"./chunk-0qpqd7nz.js";import"./chunk-gdew7bwm.js";import{Dt as X,Gt as G,au as j}from"./chunk-v3nmnm57.js";import"./chunk-hwsqqkrv.js";import{lu as T,uu as W}from"./chunk-mbbxedsq.js";import"./chunk-aa2n02qk.js";import"./chunk-k1x8469r.js";import"./chunk-c3szabpf.js";import"./chunk-c8prg3jx.js";import"./chunk-t8sy5sgx.js";import"./chunk-tezrgfc6.js";import"./chunk-wjz42325.js";import"./chunk-kry4vcrf.js";import"./chunk-f2pv705d.js";var $=W.create({service:"upgrade"});function k(D,E){if(D===!1)return"disabled";if(D===!0&&E==="patch")return"install";return"notify"}async function M(){if(G)return;let D=await O.runPromise(Z.Service.use((J)=>J.getGlobal())),E=await O.runPromise(N.Service.use((J)=>J.method())),K=await O.runPromise(N.Service.use((J)=>J.latest(E))).catch((J)=>{$.warn("failed to check for updates",{method:E,error:String(J)})});if(!K)return;if(!N.isNewerVersion(X,K)){$.warn("ignoring non-newer update version",{current:X,latest:K});return}if(T.QITQODE_ALWAYS_NOTIFY_UPDATE){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(T.QITQODE_DISABLE_AUTOUPDATE)return;let _=N.getReleaseType(X,K),Q=k(D.autoupdate,_);if(Q==="disabled")return;if(Q==="notify"){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(E==="unknown")return;await O.runPromise(N.Service.use((J)=>J.upgrade(E,K))).then(()=>Y.publish(N.Event.Updated,{version:K})).catch((J)=>{$.warn("auto-upgrade failed",{method:E,target:K,error:String(J)})})}import{writeHeapSnapshot as w}from"v8";j("worker");await W.init({print:process.argv.includes("--print-logs"),dev:N.isLocal(),level:(()=>{if(N.isLocal())return"DEBUG";return"INFO"})()});V.start();C("worker");P.on("event",(D)=>{z.emit("global.event",D)});var U,H={async ping(){return"pong"},async fetch(D){let E={...D.headers},K=L();if(K&&!E.authorization&&!E.Authorization)E.Authorization=K;let _=new Request(D.url,{method:D.method,headers:E,body:D.body}),Q=await x.Default().app.fetch(_),J=await Q.text();return{status:Q.status,headers:Object.fromEntries(Q.headers.entries()),body:J}},snapshot(){return w("server.heapsnapshot")},async server(D){if(U)await U.stop(!0);return U=await x.listen(D),{url:U.url.toString()}},async checkUpgrade(D){await q.provide({directory:D.directory,init:()=>O.runPromise(S),fn:async()=>{await M().catch(()=>{})}})},async reload(){await O.runPromise(Z.Service.use((D)=>D.invalidate(!0)))},async shutdown(){if(W.Default.info("worker shutting down"),await q.disposeAll(),U)await U.stop(!0)}};z.listen(H);function L(){let D=T.QITQODE_SERVER_PASSWORD;if(!D)return;let E=T.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${btoa(`${E}:${D}`)}`}export{H as rpc};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qitqode/qitqode-android-arm64",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Android arm64 runtime for @qitqode/cli.",
5
5
  "license": "MIT",
6
6
  "author": "QitQode",
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{cq as a,dq as b,eq as c}from"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-r9w0thdk.js";export{a as openApp,c as default,b as apps};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{De as a}from"./chunk-mhhtf0v3.js";import"./chunk-bne5w117.js";import"./chunk-j0bwa5dk.js";import"./chunk-2drzgtv3.js";import"./chunk-r9w0thdk.js";export{a as fromProcess};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-r9w0thdk.js";var _="./libopentui-0r5w9btr.so";export{_ as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-r9w0thdk.js";var L="./libopentui-430t0qv0.dylib";export{L as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-r9w0thdk.js";var a="./highlights-x6tmsnaa.scm";export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Td as q,Ud as K,Vd as D,Yd as L,Zd as N}from"./chunk-ff548b0j.js";import"./chunk-zc0cdvcv.js";import{dg as B}from"./chunk-eg3syjtv.js";import{Bh as G}from"./chunk-hjt94wce.js";import"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import"./chunk-k3dacdp5.js";import{fl as C}from"./chunk-99s035f0.js";import"./chunk-h9wh48d0.js";import"./chunk-tzb26ntq.js";import"./chunk-mh19kwzw.js";import"./chunk-q3h42a94.js";import"./chunk-hqbbs9dm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-cfhfc86j.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-q3nvzhyh.js";import"./chunk-5df5aja0.js";import"./chunk-73r8bjjz.js";import"./chunk-xy0gnpen.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-vdrz2t9c.js";import{ds as J}from"./chunk-fr34mnyg.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";var X={command:"upgrade [target]",describe:"upgrade qitqode to the latest or a specific version",builder:(z)=>{return z.positional("target",{describe:"version to upgrade to, for ex '0.1.48' or 'v0.1.48'",type:"string"}).option("method",{alias:"m",describe:"installation method to use",type:"string",choices:["curl","npm","pnpm","bun","brew","choco","scoop"]})},handler:async(z)=>{B.empty(),B.println(B.logo(" ")),B.empty(),K("Upgrade");let O=await G.runPromise(C.Service.use((j)=>j.method())),E=z.method??O;if(E==="unknown"){if(q.error(`qitqode is installed to ${process.execPath} and may be managed by a package manager`),!await N({message:"Install anyways?",options:[{label:"Yes",value:!0},{label:"No",value:!1}],initialValue:!1})){D("Done");return}}q.info("Using method: "+E);let F=z.target?z.target.replace(/^v/,""):await G.runPromise(C.Service.use((j)=>j.latest()));if(J===F){q.warn(`qitqode upgrade skipped: ${F} is already installed`),D("Done");return}q.info(`From ${J} \u2192 ${F}`);let H=L();H.start("Upgrading...");let x=await G.runPromise(C.Service.use((j)=>j.upgrade(E,F))).catch((j)=>j);if(x){if(H.stop("Upgrade failed",1),x instanceof C.UpgradeFailedError)if(E==="choco"&&x.stderr.includes("not running from an elevated command shell"))q.error("Please run the terminal as Administrator and try again");else q.error(x.stderr);else if(x instanceof Error)q.error(x.message);D("Done");return}H.stop("Upgrade complete"),D("Done")}};export{X as UpgradeCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-r9w0thdk.js";var F="./tree-sitter-markdown-411r6y9b.wasm";export{F as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-r9w0thdk.js";var R="./libopentui-c8ye7mqw.dylib";export{R as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{he as a}from"./chunk-6scf311w.js";import"./chunk-bne5w117.js";import"./chunk-j0bwa5dk.js";import"./chunk-2drzgtv3.js";import"./chunk-r9w0thdk.js";export{a as fromIni};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{wO as t}from"./chunk-r9w0thdk.js";var e=await import("./chunk-11h06z17.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{le as a,me as b,ne as c,oe as d,pe as e,qe as f,re as g,se as h,te as i,ue as j,ve as k}from"./chunk-ypdt9mmr.js";import"./chunk-j0bwa5dk.js";import"./chunk-2drzgtv3.js";import"./chunk-r9w0thdk.js";export{c as providerConfigFromInit,d as httpRequest,j as getInstanceMetadataEndpoint,k as fromInstanceMetadata,h as fromContainerMetadata,i as Endpoint,f as ENV_CMDS_RELATIVE_URI,e as ENV_CMDS_FULL_URI,g as ENV_CMDS_AUTH_TOKEN,a as DEFAULT_TIMEOUT,b as DEFAULT_MAX_RETRIES};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{rO as a}from"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";export default a();
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-r9w0thdk.js";var q="./tree-sitter-powershell-ryb2ffqs.wasm";export{q as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rf as a}from"./chunk-j164q40b.js";import"./chunk-d6jhs818.js";import"./chunk-r9w0thdk.js";export default a();