@qitqode/qitqode-android-arm64 0.2.8 → 0.2.10

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 (426) hide show
  1. package/bundle/chunk-062chtrq.js +2 -0
  2. package/bundle/chunk-062vs7bp.js +2 -0
  3. package/bundle/chunk-08g14hmz.js +2 -0
  4. package/bundle/{chunk-wgkcyqn1.js → chunk-0bhzhh7s.js} +2 -2
  5. package/bundle/{chunk-cfwz1hgr.js → chunk-0mwzxqt5.js} +3 -3
  6. package/bundle/{chunk-mr17tppa.js → chunk-0sfc21qe.js} +2 -2
  7. package/bundle/{chunk-7adsab4h.js → chunk-0tkznq75.js} +1 -1
  8. package/bundle/chunk-0w2v8dfy.js +2 -0
  9. package/bundle/chunk-10fr7a2y.js +2 -0
  10. package/bundle/chunk-141p12c4.js +4 -0
  11. package/bundle/chunk-15bjhfav.js +3 -0
  12. package/bundle/{chunk-92r1gw2j.js → chunk-1h96bk6p.js} +2 -2
  13. package/bundle/chunk-1hv61m11.js +2 -0
  14. package/bundle/{chunk-0z1keh2w.js → chunk-1m78yy4k.js} +1 -1
  15. package/bundle/chunk-1q10jyka.js +29 -0
  16. package/bundle/{chunk-g4tyaj0m.js → chunk-1r81q7m3.js} +1 -1
  17. package/bundle/{chunk-82xrfk5x.js → chunk-2cvwrabw.js} +2 -2
  18. package/bundle/{chunk-8p0t8qah.js → chunk-2dmcpqak.js} +1 -1
  19. package/bundle/{chunk-35fj1sfm.js → chunk-2fbkw84y.js} +2 -2
  20. package/bundle/chunk-2mkvx8b2.js +2 -0
  21. package/bundle/chunk-2rykfc3a.js +2 -0
  22. package/bundle/chunk-2w5hx4fs.js +2 -0
  23. package/bundle/{chunk-t3w43rft.js → chunk-2y5bthrp.js} +1 -1
  24. package/bundle/chunk-2yy63sxz.js +2 -0
  25. package/bundle/chunk-2z3fe4qw.js +2 -0
  26. package/bundle/{chunk-g7v6sp3c.js → chunk-2zjet9tx.js} +2 -2
  27. package/bundle/{chunk-qgkb6n8k.js → chunk-32xd626h.js} +2 -2
  28. package/bundle/chunk-361cmmrp.js +2 -0
  29. package/bundle/{chunk-eg1m81ax.js → chunk-3mtjxmw1.js} +1 -1
  30. package/bundle/chunk-3r6dq1h3.js +2 -0
  31. package/bundle/{chunk-wtt5wms9.js → chunk-3sj0jv91.js} +1 -1
  32. package/bundle/{chunk-hz02vrqs.js → chunk-3vae1s42.js} +1 -1
  33. package/bundle/{chunk-t18ka1e7.js → chunk-3yfjgks3.js} +1 -1
  34. package/bundle/{chunk-phf37x1c.js → chunk-3zzrdpsx.js} +1 -1
  35. package/bundle/chunk-4a12wv2m.js +2 -0
  36. package/bundle/{chunk-1rgt2vmt.js → chunk-4a9jqe5s.js} +1 -1
  37. package/bundle/{chunk-wqk1v8t0.js → chunk-4sa9t0vx.js} +2 -2
  38. package/bundle/{chunk-qbnt4ynd.js → chunk-532fnfmw.js} +2 -2
  39. package/bundle/chunk-547a55ba.js +2 -0
  40. package/bundle/{chunk-vr8nwzp0.js → chunk-56yp5v0w.js} +1 -1
  41. package/bundle/{chunk-ag8wxwwz.js → chunk-5fcyb122.js} +1 -1
  42. package/bundle/{chunk-4pmvxnkj.js → chunk-5nm5egq0.js} +2 -2
  43. package/bundle/{chunk-1v0khv7p.js → chunk-5p2r8bxx.js} +1 -1
  44. package/bundle/{chunk-5bv63rqj.js → chunk-5rqjze1g.js} +1 -1
  45. package/bundle/{chunk-sy9w1t2y.js → chunk-5w7ebtcd.js} +1 -1
  46. package/bundle/chunk-5ztmc770.js +2 -0
  47. package/bundle/{chunk-a1z8rnq7.js → chunk-61t4g8bh.js} +4 -4
  48. package/bundle/chunk-62x3r2q8.js +2 -0
  49. package/bundle/chunk-62y6zk9x.js +2 -0
  50. package/bundle/{chunk-c76cjhn0.js → chunk-6axm2qtj.js} +1 -1
  51. package/bundle/{chunk-zfrftgcy.js → chunk-6gbdvz6p.js} +1 -1
  52. package/bundle/{chunk-fa8pwdwv.js → chunk-6mnk5sg3.js} +1 -1
  53. package/bundle/chunk-6th7vpwm.js +2 -0
  54. package/bundle/{chunk-8yzghzjq.js → chunk-6wjdhvdf.js} +1 -1
  55. package/bundle/{chunk-a8bjcvda.js → chunk-6y58jzak.js} +1 -1
  56. package/bundle/chunk-6ybh5smv.js +2 -0
  57. package/bundle/chunk-73kprndw.js +2 -0
  58. package/bundle/chunk-79fr19xf.js +2 -0
  59. package/bundle/{chunk-3va85mbe.js → chunk-7a3txs9f.js} +2 -2
  60. package/bundle/chunk-7ezr478e.js +2 -0
  61. package/bundle/chunk-7gj1vqyj.js +2 -0
  62. package/bundle/{chunk-eacpc64g.js → chunk-7hdb1fhq.js} +2 -2
  63. package/bundle/{chunk-t8fjgkp8.js → chunk-7rbg6mg9.js} +2 -2
  64. package/bundle/{chunk-59csnjc3.js → chunk-7s0nq2aa.js} +2 -2
  65. package/bundle/chunk-7ywfkwb4.js +2 -0
  66. package/bundle/chunk-819qr675.js +2 -0
  67. package/bundle/{chunk-g6y2c5az.js → chunk-81dvy370.js} +1 -1
  68. package/bundle/chunk-85fnnwm2.js +2 -0
  69. package/bundle/chunk-89fwh84w.js +2 -0
  70. package/bundle/chunk-8e724g3k.js +2 -0
  71. package/bundle/{chunk-6qwk6z87.js → chunk-8gpjmj42.js} +3 -3
  72. package/bundle/{chunk-wtxh5m6j.js → chunk-8nnajdwf.js} +3 -3
  73. package/bundle/chunk-8peby2d1.js +2 -0
  74. package/bundle/{chunk-3zwma68w.js → chunk-8rkszwxq.js} +6 -6
  75. package/bundle/{chunk-w0nc0gcx.js → chunk-8v60bqm0.js} +1 -1
  76. package/bundle/chunk-9894a2yn.js +2 -0
  77. package/bundle/chunk-98ye2nwt.js +2 -0
  78. package/bundle/{chunk-48gap82w.js → chunk-9bbwxp5d.js} +1 -1
  79. package/bundle/{chunk-z0kbyr00.js → chunk-9d0exvey.js} +2 -2
  80. package/bundle/{chunk-8ysp6vf8.js → chunk-9fjcgdea.js} +1 -1
  81. package/bundle/{chunk-jpn9zfj5.js → chunk-9nf5650d.js} +1 -1
  82. package/bundle/{chunk-n6tqtk6h.js → chunk-9pj10pgd.js} +2 -2
  83. package/bundle/chunk-9s4excg8.js +2 -0
  84. package/bundle/{chunk-t6zz47zk.js → chunk-9s5h0f1y.js} +2 -2
  85. package/bundle/{chunk-p8ak162p.js → chunk-9tz18e54.js} +1 -1
  86. package/bundle/{chunk-fs1vb39f.js → chunk-9zy5tsry.js} +3 -3
  87. package/bundle/{chunk-bc2krtaf.js → chunk-a70m6kyn.js} +1 -1
  88. package/bundle/{chunk-cr5tknvb.js → chunk-acsqvgdw.js} +1 -1
  89. package/bundle/chunk-aetgcegz.js +2 -0
  90. package/bundle/chunk-agas0nay.js +2 -0
  91. package/bundle/{chunk-vs3s49jw.js → chunk-ajnzv5jt.js} +2 -2
  92. package/bundle/{chunk-9cf2ktyh.js → chunk-asxmkyz2.js} +1 -1
  93. package/bundle/{chunk-0ffmwhw7.js → chunk-at4dge22.js} +1 -1
  94. package/bundle/{chunk-sa0rrreh.js → chunk-atacnspd.js} +2 -2
  95. package/bundle/chunk-ayknzc4m.js +2 -0
  96. package/bundle/chunk-azss4acq.js +3 -0
  97. package/bundle/chunk-b2ybst88.js +2 -0
  98. package/bundle/{chunk-cghz0855.js → chunk-b8rzn48q.js} +1 -1
  99. package/bundle/{chunk-dhvx9p54.js → chunk-b9f78x5g.js} +1 -1
  100. package/bundle/chunk-bd5vtjd7.js +2 -0
  101. package/bundle/chunk-bjqqk6jt.js +2 -0
  102. package/bundle/{chunk-mv7q6ach.js → chunk-brk1jca3.js} +1 -1
  103. package/bundle/{chunk-5r7c6vvx.js → chunk-by1kwg4r.js} +2 -2
  104. package/bundle/{chunk-he9kpk9r.js → chunk-c1c8ch3g.js} +327 -313
  105. package/bundle/{chunk-2nheahmq.js → chunk-c2ns2csn.js} +1 -1
  106. package/bundle/{chunk-qk5vy2pr.js → chunk-c3ey896z.js} +1 -1
  107. package/bundle/{chunk-b7sr9rn3.js → chunk-c8080519.js} +1 -1
  108. package/bundle/{chunk-33ebjca6.js → chunk-c8yc8qcd.js} +1 -1
  109. package/bundle/{chunk-f81kk8ra.js → chunk-c9cngded.js} +1 -1
  110. package/bundle/{chunk-ejhhrece.js → chunk-ccdjzn2m.js} +3 -3
  111. package/bundle/{chunk-rk0fnvp5.js → chunk-cdenq7jb.js} +1 -1
  112. package/bundle/chunk-cpkcdykz.js +2 -0
  113. package/bundle/{chunk-56wq8cqj.js → chunk-cs825mxr.js} +1 -1
  114. package/bundle/{chunk-1bxfzd6r.js → chunk-cxtwavyf.js} +4 -4
  115. package/bundle/chunk-cyafm8d6.js +2 -0
  116. package/bundle/{chunk-eewe7tx1.js → chunk-d0dsgxk4.js} +2 -2
  117. package/bundle/{chunk-g3n465ee.js → chunk-d1fv2c7s.js} +2 -2
  118. package/bundle/{chunk-1p9s5jj1.js → chunk-d1xfv4d3.js} +1 -1
  119. package/bundle/chunk-d4316r53.js +2 -0
  120. package/bundle/chunk-d8ym7mcg.js +2 -0
  121. package/bundle/{chunk-epmc4aht.js → chunk-d9w2bn2e.js} +1 -1
  122. package/bundle/{chunk-g26redah.js → chunk-dd461rg3.js} +1 -1
  123. package/bundle/{chunk-e0vrxetq.js → chunk-djfrkbd5.js} +1 -1
  124. package/bundle/{chunk-ayb3bdb7.js → chunk-dm447tgc.js} +2 -2
  125. package/bundle/{chunk-qxdpgdfk.js → chunk-dnjyepb2.js} +2 -2
  126. package/bundle/chunk-dnpjxjkp.js +2 -0
  127. package/bundle/{chunk-0a4pmkc9.js → chunk-dp6ms01y.js} +2 -2
  128. package/bundle/{chunk-58f4y4b7.js → chunk-dx7rexx3.js} +3 -3
  129. package/bundle/{chunk-kre93a89.js → chunk-dz3kcsb6.js} +2 -2
  130. package/bundle/{chunk-4aajzxm9.js → chunk-dzma8zvf.js} +2 -2
  131. package/bundle/{chunk-e2wfj86b.js → chunk-e10c0crf.js} +1 -1
  132. package/bundle/{chunk-wn63q3xp.js → chunk-e1x1mp9m.js} +1 -1
  133. package/bundle/{chunk-w9qh2479.js → chunk-e3mrw0k7.js} +1 -1
  134. package/bundle/chunk-e5gjqtby.js +2 -0
  135. package/bundle/{chunk-3z2zn8rj.js → chunk-e72jwbfc.js} +1 -1
  136. package/bundle/{chunk-85wh85pk.js → chunk-eabbrt1p.js} +1 -1
  137. package/bundle/{chunk-jr80q31w.js → chunk-ecz4h0a2.js} +1 -1
  138. package/bundle/chunk-ee3mqzms.js +2 -0
  139. package/bundle/chunk-eme9xmh3.js +2 -0
  140. package/bundle/{chunk-cf9m9m9q.js → chunk-eqpep2m2.js} +1 -1
  141. package/bundle/chunk-er5f61s5.js +2 -0
  142. package/bundle/chunk-er716522.js +2 -0
  143. package/bundle/{chunk-qgek59e6.js → chunk-ev6jwt7q.js} +1 -1
  144. package/bundle/chunk-ez3gacqe.js +2 -0
  145. package/bundle/{chunk-ax64ngf2.js → chunk-f0ab2f28.js} +1 -1
  146. package/bundle/{chunk-ggncq8w8.js → chunk-f17se3hh.js} +1 -1
  147. package/bundle/chunk-f3y5kr76.js +14 -0
  148. package/bundle/{chunk-vsqvnxbz.js → chunk-f6btedtt.js} +1 -1
  149. package/bundle/{chunk-h4hs2rhf.js → chunk-f6vy70p6.js} +2 -2
  150. package/bundle/{chunk-5f0nhthe.js → chunk-ff8q10gk.js} +2 -2
  151. package/bundle/chunk-fkc7wf1p.js +2 -0
  152. package/bundle/chunk-fm6z8nqb.js +2 -0
  153. package/bundle/{chunk-fw1f47de.js → chunk-fsndgr9a.js} +1 -1
  154. package/bundle/{chunk-pqg1wjb5.js → chunk-fvv1cret.js} +1 -1
  155. package/bundle/{chunk-j10a984e.js → chunk-g08qj9z3.js} +2 -2
  156. package/bundle/chunk-g0qwm23d.js +2 -0
  157. package/bundle/chunk-g4yn8cj8.js +2 -0
  158. package/bundle/{chunk-vkjqy92f.js → chunk-g52wmt1v.js} +1 -1
  159. package/bundle/{chunk-trstb8ee.js → chunk-gb51fn3r.js} +1 -1
  160. package/bundle/{chunk-kgv68cpb.js → chunk-gbnf7zf9.js} +1 -1
  161. package/bundle/{chunk-0w19vmd7.js → chunk-ge7csm6m.js} +2 -2
  162. package/bundle/{chunk-gc5rhnht.js → chunk-gksbv613.js} +2 -2
  163. package/bundle/{chunk-afr8m0q1.js → chunk-gmq1kwn0.js} +1 -1
  164. package/bundle/{chunk-9009v4d0.js → chunk-gq3zb4wv.js} +2 -2
  165. package/bundle/{chunk-tbx741en.js → chunk-gqgjybjc.js} +1 -1
  166. package/bundle/{chunk-2qm46qvn.js → chunk-gx4v8z64.js} +2 -2
  167. package/bundle/{chunk-sm1g81cv.js → chunk-h0pvxre5.js} +1 -1
  168. package/bundle/chunk-h1spsy3y.js +2 -0
  169. package/bundle/{chunk-sbjymf20.js → chunk-h2p984qb.js} +2 -2
  170. package/bundle/{chunk-gznt3dv8.js → chunk-h6z86aay.js} +1 -1
  171. package/bundle/chunk-h8gkv40j.js +2 -0
  172. package/bundle/{chunk-zsg29gba.js → chunk-h91zmzs5.js} +1 -1
  173. package/bundle/{chunk-zrhw1szj.js → chunk-hgm8yfcb.js} +1 -1
  174. package/bundle/chunk-j59kmb49.js +2 -0
  175. package/bundle/chunk-j5z95b6f.js +3 -0
  176. package/bundle/{chunk-52xvhxek.js → chunk-j7637cwg.js} +2 -2
  177. package/bundle/{chunk-rwnwjm82.js → chunk-jbcqhw3x.js} +2 -2
  178. package/bundle/{chunk-qgfbsmsx.js → chunk-je8fcsa9.js} +1 -1
  179. package/bundle/{chunk-y0h3jfkj.js → chunk-jt6bvxtr.js} +1 -1
  180. package/bundle/chunk-jv37ghev.js +2 -0
  181. package/bundle/chunk-k10rtgsk.js +5 -0
  182. package/bundle/chunk-k3hcb6qf.js +2 -0
  183. package/bundle/chunk-k5d822n2.js +3 -0
  184. package/bundle/{chunk-2vaphpz0.js → chunk-kc8n5cgb.js} +1 -1
  185. package/bundle/chunk-kcqeh1e5.js +2 -0
  186. package/bundle/{chunk-5xkp27b1.js → chunk-kds2g7r2.js} +1 -1
  187. package/bundle/{chunk-scnbt714.js → chunk-kec1xw1n.js} +1 -1
  188. package/bundle/{chunk-s8z7v1me.js → chunk-kk850sdw.js} +2 -2
  189. package/bundle/{chunk-3bb4aqh9.js → chunk-m01h6kk1.js} +1 -1
  190. package/bundle/{chunk-2t5yh25f.js → chunk-m4j6t713.js} +1 -1
  191. package/bundle/chunk-m8ytbq04.js +2 -0
  192. package/bundle/chunk-mf9nc4xz.js +2 -0
  193. package/bundle/{chunk-7thhd7ds.js → chunk-mmqyter3.js} +1 -1
  194. package/bundle/{chunk-9cn8cmt0.js → chunk-mn0pshpv.js} +1 -1
  195. package/bundle/{chunk-s2tc3qs0.js → chunk-mn5cacf6.js} +2 -2
  196. package/bundle/{chunk-0egrckx0.js → chunk-mp1x10t5.js} +2 -2
  197. package/bundle/chunk-mxby91bj.js +2 -0
  198. package/bundle/chunk-mzv1gh6f.js +2 -0
  199. package/bundle/chunk-n0hsvvw8.js +2 -0
  200. package/bundle/{chunk-az3nss5m.js → chunk-ngyv4fhn.js} +2 -2
  201. package/bundle/{chunk-g9nwqwqp.js → chunk-nh4zk07t.js} +1 -1
  202. package/bundle/{chunk-8jmb5bd4.js → chunk-nk5vrenn.js} +2 -2
  203. package/bundle/chunk-nm1v9z14.js +2 -0
  204. package/bundle/chunk-nnkfdhh9.js +2 -0
  205. package/bundle/{chunk-jqj1ay7x.js → chunk-npdgfqaw.js} +1 -1
  206. package/bundle/{chunk-p2fte9vz.js → chunk-nq4x6792.js} +2 -2
  207. package/bundle/{chunk-wr6rnxr5.js → chunk-nqk8d62j.js} +1 -1
  208. package/bundle/{chunk-7jy53zqy.js → chunk-p506eydh.js} +1 -1
  209. package/bundle/{chunk-phpxxd48.js → chunk-p6jf1fyt.js} +1 -1
  210. package/bundle/chunk-p7nstcxa.js +2 -0
  211. package/bundle/{chunk-6ps30qax.js → chunk-pbanj1gk.js} +2 -2
  212. package/bundle/{chunk-vph4w4yy.js → chunk-pchv413c.js} +2 -2
  213. package/bundle/{chunk-5nmm1kvx.js → chunk-pf2vq6t1.js} +2 -2
  214. package/bundle/chunk-pfwkvv7g.js +2 -0
  215. package/bundle/{chunk-ntr0ezf2.js → chunk-pky8h8rh.js} +1 -1
  216. package/bundle/chunk-pn1jz8qj.js +2 -0
  217. package/bundle/chunk-pqvmtfk7.js +2 -0
  218. package/bundle/chunk-prgw26g3.js +2 -0
  219. package/bundle/{chunk-kckr30tf.js → chunk-psqtptrs.js} +1 -1
  220. package/bundle/chunk-pv9ty6v7.js +2 -0
  221. package/bundle/{chunk-060wbpz4.js → chunk-pwsajn96.js} +1 -1
  222. package/bundle/{chunk-c3yjbent.js → chunk-pxm0x3e0.js} +1 -1
  223. package/bundle/chunk-pyf649pz.js +2 -0
  224. package/bundle/{chunk-wd8f9r4k.js → chunk-q0xgxygw.js} +1 -1
  225. package/bundle/{chunk-rye1yjnr.js → chunk-q26s0wb5.js} +1 -1
  226. package/bundle/{chunk-a48mx917.js → chunk-q4mtwv1w.js} +2 -2
  227. package/bundle/chunk-q4rstre7.js +2 -0
  228. package/bundle/chunk-q6jk2v6g.js +2 -0
  229. package/bundle/{chunk-5wx962mw.js → chunk-q7s6z0nz.js} +1 -1
  230. package/bundle/{chunk-jmmtcr2r.js → chunk-q8fjktv4.js} +1 -1
  231. package/bundle/{chunk-m7tmgvh6.js → chunk-qbewhcsz.js} +1 -1
  232. package/bundle/chunk-qd43npx3.js +2 -0
  233. package/bundle/{chunk-ydgst3h8.js → chunk-qdafm7qg.js} +2 -2
  234. package/bundle/chunk-qdb21y83.js +2 -0
  235. package/bundle/{chunk-72crs18f.js → chunk-qdbx1qkr.js} +1 -1
  236. package/bundle/{chunk-nga216dm.js → chunk-qdh2dm62.js} +1 -1
  237. package/bundle/chunk-qeksaefy.js +2 -0
  238. package/bundle/{chunk-qk1jkc0n.js → chunk-qjw2zcq5.js} +1 -1
  239. package/bundle/{chunk-dt3bsmfe.js → chunk-qm9fm5ja.js} +2 -2
  240. package/bundle/{chunk-h8mfbbjh.js → chunk-qq9yc2tp.js} +2 -2
  241. package/bundle/{chunk-0tcggtwv.js → chunk-qtyapmy7.js} +1 -1
  242. package/bundle/{chunk-4064rbtp.js → chunk-qyan69nb.js} +1 -1
  243. package/bundle/chunk-r7t9yb9d.js +2 -0
  244. package/bundle/{chunk-6tqbnxar.js → chunk-r81w6skn.js} +1 -1
  245. package/bundle/{chunk-f4mnp6xd.js → chunk-rk21wv4k.js} +1 -1
  246. package/bundle/{chunk-ccf4pgkr.js → chunk-rpdgn9z3.js} +2 -2
  247. package/bundle/chunk-rxnd79h7.js +7 -0
  248. package/bundle/chunk-s05hqtx1.js +3 -0
  249. package/bundle/chunk-s27cz24e.js +808 -0
  250. package/bundle/chunk-sdv3a4w3.js +2 -0
  251. package/bundle/{chunk-zwhmg9dj.js → chunk-se8d5xg9.js} +1 -1
  252. package/bundle/chunk-sk89becn.js +2 -0
  253. package/bundle/{chunk-sz0favtz.js → chunk-snf6ahg7.js} +1 -1
  254. package/bundle/{chunk-dgcannw0.js → chunk-t2r51r6v.js} +1 -1
  255. package/bundle/{chunk-rva2ekrt.js → chunk-t5wdstzv.js} +1 -1
  256. package/bundle/{chunk-ytyzrqev.js → chunk-t9pq363q.js} +2 -2
  257. package/bundle/chunk-tc0996xz.js +2 -0
  258. package/bundle/chunk-td9hm9be.js +2 -0
  259. package/bundle/{chunk-xy8arehp.js → chunk-tdevq564.js} +1 -1
  260. package/bundle/chunk-te91d271.js +2 -0
  261. package/bundle/chunk-tfs50mgj.js +2 -0
  262. package/bundle/{chunk-5cw8235e.js → chunk-tg1f56s3.js} +1 -1
  263. package/bundle/chunk-thecq33z.js +3 -0
  264. package/bundle/{chunk-f2v4g7t1.js → chunk-tjfer79w.js} +1 -1
  265. package/bundle/chunk-tjvtp9d9.js +2 -0
  266. package/bundle/chunk-tkm9m3n0.js +2 -0
  267. package/bundle/{chunk-ynf17943.js → chunk-tm79yrf3.js} +2 -2
  268. package/bundle/{chunk-tsmj98yf.js → chunk-v03xq38e.js} +2 -2
  269. package/bundle/chunk-v0hnn7nb.js +2 -0
  270. package/bundle/{chunk-ftvvm4r5.js → chunk-v16n1fep.js} +2 -2
  271. package/bundle/chunk-v1s1rcqx.js +2 -0
  272. package/bundle/chunk-v4dt4062.js +2 -0
  273. package/bundle/{chunk-makegrxs.js → chunk-v8bxj01h.js} +1 -1
  274. package/bundle/{chunk-ryrxgn6d.js → chunk-v8rqgt7h.js} +1 -1
  275. package/bundle/{chunk-m4r8sepw.js → chunk-vbb1jg02.js} +1 -1
  276. package/bundle/{chunk-2kh0tg92.js → chunk-vbfc0wgv.js} +2 -2
  277. package/bundle/{chunk-d839fr0w.js → chunk-vjt6mh10.js} +2 -2
  278. package/bundle/{chunk-gsg6zn7e.js → chunk-vk35g121.js} +2 -2
  279. package/bundle/{chunk-dwkrqtbc.js → chunk-vsfj16v9.js} +2 -2
  280. package/bundle/{chunk-zqdjk4rf.js → chunk-vy93mn7d.js} +2 -2
  281. package/bundle/{chunk-1har4t9a.js → chunk-waa781eh.js} +1 -1
  282. package/bundle/{chunk-wb47k8ah.js → chunk-wbt31xap.js} +2 -2
  283. package/bundle/{chunk-0tm6589k.js → chunk-wd2xmkdp.js} +2 -2
  284. package/bundle/{chunk-fej5x648.js → chunk-wecs14rz.js} +1 -1
  285. package/bundle/chunk-wgrq86kd.js +2 -0
  286. package/bundle/chunk-wh2qqhep.js +8 -0
  287. package/bundle/{chunk-g878zd6e.js → chunk-x0hhw46n.js} +1 -1
  288. package/bundle/{chunk-w7a33cwa.js → chunk-x308f9j4.js} +2 -2
  289. package/bundle/{chunk-y3gy62q5.js → chunk-x50adh71.js} +1 -1
  290. package/bundle/chunk-x8ks2bn7.js +2 -0
  291. package/bundle/{chunk-f8cae1ap.js → chunk-xcmbxny8.js} +1 -1
  292. package/bundle/{chunk-rmsqb6r4.js → chunk-xgf4k9q7.js} +1 -1
  293. package/bundle/{chunk-2caaqmec.js → chunk-xj0zc9za.js} +1 -1
  294. package/bundle/{chunk-27saej0r.js → chunk-xnxw5zz9.js} +2 -2
  295. package/bundle/{chunk-fjftb2sz.js → chunk-xqwk2zsx.js} +2 -2
  296. package/bundle/{chunk-d30k7dpf.js → chunk-xstxdw7v.js} +1 -1
  297. package/bundle/{chunk-x00hwy3x.js → chunk-xv03hbgj.js} +1 -1
  298. package/bundle/{chunk-bwadggys.js → chunk-xvvt886p.js} +2 -2
  299. package/bundle/{chunk-khpfseej.js → chunk-xy2ty5h5.js} +2 -2
  300. package/bundle/{chunk-wm9nh9nb.js → chunk-yce8ph5b.js} +2 -2
  301. package/bundle/{chunk-fh3d0wce.js → chunk-yexzxx6f.js} +1 -1
  302. package/bundle/{chunk-eyr5ymt8.js → chunk-yh1t6jrj.js} +1 -1
  303. package/bundle/chunk-yspstxkq.js +2 -0
  304. package/bundle/{chunk-ykpj10nz.js → chunk-yydqavgh.js} +2 -2
  305. package/bundle/{chunk-bnaj2hh3.js → chunk-yzd6cyep.js} +1 -1
  306. package/bundle/chunk-z023h7t8.js +2 -0
  307. package/bundle/chunk-z0383stv.js +2 -0
  308. package/bundle/{chunk-vbfej8ds.js → chunk-z0m1qm7j.js} +2 -2
  309. package/bundle/{chunk-bpfq8fz4.js → chunk-z69tt390.js} +1 -1
  310. package/bundle/chunk-zewrmk8x.js +2 -0
  311. package/bundle/{chunk-29gwtcey.js → chunk-zfqgh9h7.js} +1 -1
  312. package/bundle/{chunk-h1bvqstw.js → chunk-zskdxbbh.js} +1 -1
  313. package/bundle/{chunk-kveztc6k.js → chunk-ztvkzex1.js} +1 -1
  314. package/bundle/index.js +3 -3
  315. package/bundle/parser.worker.js +2 -2
  316. package/bundle/worker.js +1 -1
  317. package/package.json +1 -1
  318. package/bundle/chunk-03zpnwk2.js +0 -2
  319. package/bundle/chunk-0aqdzyar.js +0 -2
  320. package/bundle/chunk-26cr51wa.js +0 -28
  321. package/bundle/chunk-2a5gjgvp.js +0 -2
  322. package/bundle/chunk-2pkfphgb.js +0 -2
  323. package/bundle/chunk-37cbrnke.js +0 -8
  324. package/bundle/chunk-3cx4p07h.js +0 -2
  325. package/bundle/chunk-3f2cjzb4.js +0 -2
  326. package/bundle/chunk-3qvap1kv.js +0 -2
  327. package/bundle/chunk-42hvspe7.js +0 -2
  328. package/bundle/chunk-452tk6v3.js +0 -2
  329. package/bundle/chunk-4gqb1hps.js +0 -2
  330. package/bundle/chunk-50qgz5ka.js +0 -2
  331. package/bundle/chunk-5b0xyq5z.js +0 -2
  332. package/bundle/chunk-5j4nxpdy.js +0 -2
  333. package/bundle/chunk-5nxgk6hw.js +0 -2
  334. package/bundle/chunk-5qkvhr6y.js +0 -2
  335. package/bundle/chunk-66qmmmdp.js +0 -2
  336. package/bundle/chunk-66wv82vf.js +0 -2
  337. package/bundle/chunk-6dpdkzrk.js +0 -2
  338. package/bundle/chunk-6p6m5956.js +0 -3
  339. package/bundle/chunk-6yhn9syz.js +0 -2
  340. package/bundle/chunk-7b60whxm.js +0 -2
  341. package/bundle/chunk-7g59hc61.js +0 -2
  342. package/bundle/chunk-7p88j56s.js +0 -2
  343. package/bundle/chunk-7trngc9g.js +0 -2
  344. package/bundle/chunk-8cebbmtf.js +0 -2
  345. package/bundle/chunk-8csas2jc.js +0 -2
  346. package/bundle/chunk-8g4jdqq1.js +0 -2
  347. package/bundle/chunk-8j1xcdmd.js +0 -2
  348. package/bundle/chunk-90r2z49k.js +0 -2
  349. package/bundle/chunk-94mjwy22.js +0 -2
  350. package/bundle/chunk-aenrd7dk.js +0 -2
  351. package/bundle/chunk-ahmy80vb.js +0 -2
  352. package/bundle/chunk-avn12jkt.js +0 -2
  353. package/bundle/chunk-b7ncyat6.js +0 -2
  354. package/bundle/chunk-bjv1h2dq.js +0 -2
  355. package/bundle/chunk-brk6bge4.js +0 -3
  356. package/bundle/chunk-c2a74stf.js +0 -2
  357. package/bundle/chunk-ce5e7j62.js +0 -2
  358. package/bundle/chunk-cw1gwjx9.js +0 -2
  359. package/bundle/chunk-czw30fjs.js +0 -2
  360. package/bundle/chunk-ddx2pcr4.js +0 -2
  361. package/bundle/chunk-dmkgjf1v.js +0 -3
  362. package/bundle/chunk-dwhsvpag.js +0 -2
  363. package/bundle/chunk-e01jgnnm.js +0 -2
  364. package/bundle/chunk-e0hfpdje.js +0 -2
  365. package/bundle/chunk-e5jk67xh.js +0 -2
  366. package/bundle/chunk-eg4pq4hv.js +0 -2
  367. package/bundle/chunk-ew3yz97p.js +0 -2
  368. package/bundle/chunk-ezgfhy4e.js +0 -2
  369. package/bundle/chunk-f2yfyhh8.js +0 -2
  370. package/bundle/chunk-f30em1wx.js +0 -2
  371. package/bundle/chunk-fge37dke.js +0 -2
  372. package/bundle/chunk-gbvm6dpv.js +0 -2
  373. package/bundle/chunk-gefx3n08.js +0 -14
  374. package/bundle/chunk-h5w91zr4.js +0 -2
  375. package/bundle/chunk-hmpb3c21.js +0 -2
  376. package/bundle/chunk-j32rr7rt.js +0 -2
  377. package/bundle/chunk-j871xzr7.js +0 -2
  378. package/bundle/chunk-k3hgwszx.js +0 -2
  379. package/bundle/chunk-kwfe4em6.js +0 -7
  380. package/bundle/chunk-kx88qekb.js +0 -2
  381. package/bundle/chunk-n61e0znt.js +0 -2
  382. package/bundle/chunk-n6v36np0.js +0 -2
  383. package/bundle/chunk-ndd4cn3z.js +0 -2
  384. package/bundle/chunk-nfafk3ts.js +0 -5
  385. package/bundle/chunk-njsmma3a.js +0 -2
  386. package/bundle/chunk-nr2j8ytn.js +0 -3
  387. package/bundle/chunk-nwj6mcxz.js +0 -2
  388. package/bundle/chunk-p5b5ekhh.js +0 -2
  389. package/bundle/chunk-pf23nw4z.js +0 -2
  390. package/bundle/chunk-pw3cv89g.js +0 -2
  391. package/bundle/chunk-q3c8mfbq.js +0 -2
  392. package/bundle/chunk-qc89yj61.js +0 -2
  393. package/bundle/chunk-qn8tz704.js +0 -2
  394. package/bundle/chunk-qq9m8fxv.js +0 -808
  395. package/bundle/chunk-qxre2gqn.js +0 -2
  396. package/bundle/chunk-rdk62809.js +0 -2
  397. package/bundle/chunk-rew6r516.js +0 -2
  398. package/bundle/chunk-rjhvdfn5.js +0 -2
  399. package/bundle/chunk-skgr9ypq.js +0 -2
  400. package/bundle/chunk-sv40pwe2.js +0 -2
  401. package/bundle/chunk-tfhpjmny.js +0 -2
  402. package/bundle/chunk-tnete6ye.js +0 -2
  403. package/bundle/chunk-tpyq7ycb.js +0 -2
  404. package/bundle/chunk-txkdt4ep.js +0 -2
  405. package/bundle/chunk-v5h5wxw5.js +0 -2
  406. package/bundle/chunk-v6141yq1.js +0 -2
  407. package/bundle/chunk-vfd3azkp.js +0 -3
  408. package/bundle/chunk-vjs69r6x.js +0 -2
  409. package/bundle/chunk-vmhar83s.js +0 -2
  410. package/bundle/chunk-vqvnw12p.js +0 -2
  411. package/bundle/chunk-w0sng8a9.js +0 -2
  412. package/bundle/chunk-w0sztk4y.js +0 -2
  413. package/bundle/chunk-w6bb320d.js +0 -2
  414. package/bundle/chunk-waa1ggtj.js +0 -2
  415. package/bundle/chunk-wb05bp10.js +0 -3
  416. package/bundle/chunk-wf41m019.js +0 -2
  417. package/bundle/chunk-wqw6yjrg.js +0 -2
  418. package/bundle/chunk-ws08rxge.js +0 -2
  419. package/bundle/chunk-wz3dvc3g.js +0 -2
  420. package/bundle/chunk-x2pmqvdc.js +0 -2
  421. package/bundle/chunk-x4wfq39v.js +0 -2
  422. package/bundle/chunk-xs6v0r9m.js +0 -3
  423. package/bundle/chunk-yb6m08zj.js +0 -2
  424. package/bundle/chunk-ybcqkgs7.js +0 -2
  425. package/bundle/chunk-zj1jc1xt.js +0 -2
  426. package/bundle/chunk-zm0m0504.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Oe as mt}from"./chunk-0a4pmkc9.js";import{Gf as fr,Hf as pt,Kf as ft}from"./chunk-35fj1sfm.js";import{uO as xe}from"./chunk-e0vrxetq.js";var br=xe((Ti)=>{var re=ft(),_e=mt(),oi=pt(),be=fr(),Oe=0,Ue=1,me=2,ce=3,Pe=4,ke=5,mr=6,ct=7,gr=20,ut=21,yr=22,ai=23,gt=24,ge=25,ye=26,he=27,yt=31;function Ae(r){return typeof Buffer<"u"?Buffer.alloc(r):new Uint8Array(r)}var xt=Symbol("@smithy/core/cbor::tagSymbol");function wt(r){return r[xt]=!0,r}var ci=typeof TextDecoder<"u",hi=typeof Buffer<"u",O=Ae(0),oe=new DataView(O.buffer,O.byteOffset,O.byteLength),ur=ci?new TextDecoder:null,D=0;function li(r){O=r,oe=new DataView(O.buffer,O.byteOffset,O.byteLength)}function ae(r,t){if(r>=t)throw Error("unexpected end of (decode) payload.");let i=(O[r]&224)>>5,n=O[r]&31;switch(i){case Oe:case Ue:case mr:let l,c;if(n<24)l=n,c=1;else switch(n){case gt:case ge:case ye:case he:let d=wr[n],f=d+1;if(c=f,t-r<f)throw Error(`countLength ${d} greater than remaining buf len.`);let m=r+1;if(d===1)l=O[m];else if(d===2)l=oe.getUint16(m);else if(d===4)l=oe.getUint32(m);else l=oe.getBigUint64(m);break;default:throw Error(`unexpected minor value ${n}.`)}if(i===Oe)return D=c,ht(l);else if(i===Ue){let d;if(typeof l==="bigint")d=BigInt(-1)-l;else d=-1-l;return D=c,ht(d)}else if(n===2||n===3){let d=$e(r+c,t),f=BigInt(0),m=r+c+D;for(let w=m;w<m+d;++w)f=f<<BigInt(8)|BigInt(O[w]);return D=c+D+d,n===3?-f-BigInt(1):f}else if(n===4){let d=ae(r+c,t),[f,m]=d,w=m<0?-1:1,E="0".repeat(Math.abs(f)+1)+String(BigInt(w)*BigInt(m)),S,_=m<0?"-":"";if(S=f===0?E:E.slice(0,E.length+f)+"."+E.slice(f),S=S.replace(/^0+/g,""),S==="")S="0";if(S[0]===".")S="0"+S;return S=_+S,D=c+D,re.nv(S)}else{let d=ae(r+c,t);return D=c+D,wt({tag:ht(l),value:d})}case ce:case ke:case Pe:case me:if(n===yt)switch(i){case ce:return fi(r,t);case ke:return wi(r,t);case Pe:return yi(r,t);case me:return mi(r,t)}else switch(i){case ce:return pi(r,t);case ke:return xi(r,t);case Pe:return gi(r,t);case me:return Et(r,t)}default:return Ei(r,t)}}function xr(r,t,i){if(hi&&r.constructor?.name==="Buffer")return r.toString("utf-8",t,i);if(ur)return ur.decode(r.subarray(t,i));return re.toUtf8(r.subarray(t,i))}function ui(r){let t=Number(r);if(t<Number.MIN_SAFE_INTEGER||Number.MAX_SAFE_INTEGER<t)console.warn(Error(`@smithy/core/cbor - truncating BigInt(${r}) to ${t} with loss of precision.`));return t}var wr={[gt]:1,[ge]:2,[ye]:4,[he]:8};function di(r,t){let i=r>>7,n=(r&124)>>2,l=(r&3)<<8|t,c=i===0?1:-1,d,f;if(n===0)if(l===0)return 0;else d=Math.pow(2,-14),f=0;else if(n===31)if(l===0)return c*(1/0);else return NaN;else d=Math.pow(2,n-15),f=1;return f+=l/1024,c*(d*f)}function $e(r,t){let i=O[r]&31;if(i<24)return D=1,i;if(i===gt||i===ge||i===ye||i===he){let n=wr[i];if(D=n+1,t-r<D)throw Error(`countLength ${n} greater than remaining buf len.`);let l=r+1;if(n===1)return O[l];else if(n===2)return oe.getUint16(l);else if(n===4)return oe.getUint32(l);return ui(oe.getBigUint64(l))}throw Error(`unexpected minor value ${i}.`)}function pi(r,t){let i=$e(r,t),n=D;if(r+=n,t-r<i)throw Error(`string len ${i} greater than remaining buf len.`);let l=xr(O,r,r+i);return D=n+i,l}function fi(r,t){r+=1;let i=[];for(let n=r;r<t;){if(O[r]===255){let m=Ae(i.length);return m.set(i,0),D=r-n+2,xr(m,0,m.length)}let l=(O[r]&224)>>5,c=O[r]&31;if(l!==ce)throw Error(`unexpected major type ${l} in indefinite string.`);if(c===yt)throw Error("nested indefinite string.");let d=Et(r,t);r+=D;for(let m=0;m<d.length;++m)i.push(d[m])}throw Error("expected break marker.")}function Et(r,t){let i=$e(r,t),n=D;if(r+=n,t-r<i)throw Error(`unstructured byte string len ${i} greater than remaining buf len.`);let l=O.subarray(r,r+i);return D=n+i,l}function mi(r,t){r+=1;let i=[];for(let n=r;r<t;){if(O[r]===255){let m=Ae(i.length);return m.set(i,0),D=r-n+2,m}let l=(O[r]&224)>>5,c=O[r]&31;if(l!==me)throw Error(`unexpected major type ${l} in indefinite string.`);if(c===yt)throw Error("nested indefinite string.");let d=Et(r,t);r+=D;for(let m=0;m<d.length;++m)i.push(d[m])}throw Error("expected break marker.")}function gi(r,t){let i=$e(r,t),n=D;r+=n;let l=r,c=Array(i);for(let d=0;d<i;++d){let f=ae(r,t),m=D;c[d]=f,r+=m}return D=n+(r-l),c}function yi(r,t){r+=1;let i=[];for(let n=r;r<t;){if(O[r]===255)return D=r-n+2,i;let l=ae(r,t);r+=D,i.push(l)}throw Error("expected break marker.")}function xi(r,t){let i=$e(r,t),n=D;r+=n;let l=r,c={};for(let d=0;d<i;++d){if(r>=t)throw Error("unexpected end of map payload.");let f=(O[r]&224)>>5;if(f!==ce)throw Error(`unexpected major type ${f} for map key at index ${r}.`);let m=ae(r,t);r+=D;let w=ae(r,t);r+=D,c[m]=w}return D=n+(r-l),c}function wi(r,t){r+=1;let i=r,n={};for(;r<t;){if(r>=t)throw Error("unexpected end of map payload.");if(O[r]===255)return D=r-i+2,n;let l=(O[r]&224)>>5;if(l!==ce)throw Error(`unexpected major type ${l} for map key.`);let c=ae(r,t);r+=D;let d=ae(r,t);r+=D,n[c]=d}throw Error("expected break marker.")}function Ei(r,t){let i=O[r]&31;switch(i){case ut:case gr:return D=1,i===ut;case yr:return D=1,null;case ai:return D=1,null;case ge:if(t-r<3)throw Error("incomplete float16 at end of buf.");return D=3,di(O[r+1],O[r+2]);case ye:if(t-r<5)throw Error("incomplete float32 at end of buf.");return D=5,oe.getFloat32(r+1);case he:if(t-r<9)throw Error("incomplete float64 at end of buf.");return D=9,oe.getFloat64(r+1);default:throw Error(`unexpected minor value ${i}.`)}}function ht(r){if(typeof r==="number")return r;let t=Number(r);if(Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER)return t;return r}var dr=typeof Buffer<"u",Ni=2048,$=Ae(Ni),ne=new DataView($.buffer,$.byteOffset,$.byteLength),C=0;function lt(r){if($.byteLength-C<r)if(C<16000000)dt(Math.max($.byteLength*4,$.byteLength+r));else dt($.byteLength+r+16000000)}function pr(){let r=Ae(C);return r.set($.subarray(0,C),0),C=0,r}function dt(r){let t=$;if($=Ae(r),t)if(t.copy)t.copy($,0,0,t.byteLength);else $.set(t,0);ne=new DataView($.buffer,$.byteOffset,$.byteLength)}function ie(r,t){if(t<24)$[C++]=r<<5|t;else if(t<256)$[C++]=r<<5|24,$[C++]=t;else if(t<65536)$[C++]=r<<5|ge,ne.setUint16(C,t),C+=2;else if(t<4294967296)$[C++]=r<<5|ye,ne.setUint32(C,t),C+=4;else $[C++]=r<<5|he,ne.setBigUint64(C,typeof t==="bigint"?t:BigInt(t)),C+=8}function Si(r){let t=[r];while(t.length){let i=t.pop();if(lt(typeof i==="string"?i.length*4:64),typeof i==="string"){if(dr)ie(ce,Buffer.byteLength(i)),C+=$.write(i,C);else{let n=re.fromUtf8(i);ie(ce,n.byteLength),$.set(n,C),C+=n.byteLength}continue}else if(typeof i==="number"){if(Number.isInteger(i)){let n=i>=0,l=n?Oe:Ue,c=n?i:-i-1;if(c<24)$[C++]=l<<5|c;else if(c<256)$[C++]=l<<5|24,$[C++]=c;else if(c<65536)$[C++]=l<<5|ge,$[C++]=c>>8,$[C++]=c;else if(c<4294967296)$[C++]=l<<5|ye,ne.setUint32(C,c),C+=4;else $[C++]=l<<5|he,ne.setBigUint64(C,BigInt(c)),C+=8;continue}$[C++]=ct<<5|he,ne.setFloat64(C,i),C+=8;continue}else if(typeof i==="bigint"){let n=i>=0,l=n?Oe:Ue,c=n?i:-i-BigInt(1),d=Number(c);if(d<24)$[C++]=l<<5|d;else if(d<256)$[C++]=l<<5|24,$[C++]=d;else if(d<65536)$[C++]=l<<5|ge,$[C++]=d>>8,$[C++]=d&255;else if(d<4294967296)$[C++]=l<<5|ye,ne.setUint32(C,d),C+=4;else if(c<BigInt("18446744073709551616"))$[C++]=l<<5|he,ne.setBigUint64(C,c),C+=8;else{let f=c.toString(2),m=new Uint8Array(Math.ceil(f.length/8)),w=c,E=0;while(m.byteLength-++E>=0)m[m.byteLength-E]=Number(w&BigInt(255)),w>>=BigInt(8);if(lt(m.byteLength*2),$[C++]=n?194:195,dr)ie(me,Buffer.byteLength(m));else ie(me,m.byteLength);$.set(m,C),C+=m.byteLength}continue}else if(i===null){$[C++]=ct<<5|yr;continue}else if(typeof i==="boolean"){$[C++]=ct<<5|(i?ut:gr);continue}else if(typeof i>"u")throw Error("@smithy/core/cbor: client may not serialize undefined value.");else if(Array.isArray(i)){for(let n=i.length-1;n>=0;--n)t.push(i[n]);ie(Pe,i.length);continue}else if(typeof i.byteLength==="number"){lt(i.length*2),ie(me,i.length),$.set(i,C),C+=i.byteLength;continue}else if(typeof i==="object"){if(i instanceof re.NumericValue){let l=i.string.indexOf("."),c=l===-1?0:l-i.string.length+1,d=BigInt(i.string.replace(".",""));$[C++]=196,t.push(d),t.push(c),ie(Pe,2);continue}if(i[xt])if("tag"in i&&"value"in i){t.push(i.value),ie(mr,i.tag);continue}else throw Error("tag encountered with missing fields, need 'tag' and 'value', found: "+JSON.stringify(i));let n=Object.keys(i);for(let l=n.length-1;l>=0;--l){let c=n[l];t.push(i[c]),t.push(c)}ie(ke,n.length);continue}throw Error(`data type ${i?.constructor?.name??typeof i} not compatible for encoding.`)}}var Ve={deserialize(r){return li(r),ae(0,r.length)},serialize(r){try{return Si(r),pr()}catch(t){throw pr(),t}},resizeEncodingBuffer(r){dt(r)}},Er=(r,t)=>{return _e.collectBody(r,t).then(async(i)=>{if(i.length)try{return Ve.deserialize(i)}catch(n){throw Object.defineProperty(n,"$responseBodyText",{value:t.utf8Encoder(i)}),n}return{}})},ze=(r)=>{return wt({tag:1,value:r.getTime()/1000})},bi=async(r,t)=>{let i=await Er(r,t);return i.message=i.message??i.Message,i},Nr=(r,t)=>{let i=(l)=>{let c=l;if(typeof c==="number")c=c.toString();if(c.indexOf(",")>=0)c=c.split(",")[0];if(c.indexOf(":")>=0)c=c.split(":")[0];if(c.indexOf("#")>=0)c=c.split("#")[1];return c};if(t.__type!==void 0)return i(t.__type);let n;for(let l in t)if(l.toLowerCase()==="code"){n=l;break}if(n&&t[n]!==void 0)return i(t[n])},_i=(r)=>{if(String(r.headers["smithy-protocol"]).toLowerCase()!=="rpc-v2-cbor")throw Error("Malformed RPCv2 CBOR response, status: "+r.statusCode)},Ai=async(r,t,i,n,l)=>{let c=await r.endpoint(),{hostname:d,protocol:f="https",port:m,path:w}=c,E={protocol:f,hostname:d,port:m,method:"POST",path:w.endsWith("/")?w.slice(0,-1)+i:w+i,headers:{...t}};if(n!==void 0)E.hostname=n;if(c.headers)for(let S in c.headers)E.headers[S]=c.headers[S];if(l!==void 0){E.body=l;try{E.headers["content-length"]=String(re.calculateBodyLength(l))}catch(S){}}return new _e.HttpRequest(E)};class Nt extends _e.SerdeContext{createSerializer(){let r=new St;return r.setSerdeContext(this.serdeContext),r}createDeserializer(){let r=new bt;return r.setSerdeContext(this.serdeContext),r}}class St extends _e.SerdeContext{value;write(r,t){this.value=this.serialize(r,t)}serialize(r,t){let i=be.NormalizedSchema.of(r);if(t==null){if(i.isIdempotencyToken())return re.generateIdempotencyToken();return t}if(i.isBlobSchema()){if(typeof t==="string")return(this.serdeContext?.base64Decoder??re.fromBase64)(t);return t}if(i.isTimestampSchema()){if(typeof t==="number"||typeof t==="bigint")return ze(new Date(Number(t)/1000|0));return ze(t)}if(typeof t==="function"||typeof t==="object"){let n=t;if(i.isListSchema()&&Array.isArray(n)){let c=!!i.getMergedTraits().sparse,d=[],f=0;for(let m of n){let w=this.serialize(i.getValueSchema(),m);if(w!=null||c)d[f++]=w}return d}if(n instanceof Date)return ze(n);let l={};if(i.isMapSchema()){let c=!!i.getMergedTraits().sparse;for(let d in n){let f=this.serialize(i.getValueSchema(),n[d]);if(f!=null||c)l[d]=f}}else if(i.isStructSchema()){for(let[d,f]of i.structIterator()){let m=this.serialize(f,n[d]);if(m!=null)l[d]=m}if(i.isUnionSchema()&&Array.isArray(n.$unknown)){let[d,f]=n.$unknown;l[d]=f}else if(typeof n.__type==="string"){for(let d in n)if(!(d in l))l[d]=this.serialize(15,n[d])}}else if(i.isDocumentSchema())for(let c in n)l[c]=this.serialize(i.getValueSchema(),n[c]);else if(i.isBigDecimalSchema())return n;return l}return t}flush(){let r=Ve.serialize(this.value);return this.value=void 0,r}}class bt extends _e.SerdeContext{read(r,t){let i=Ve.deserialize(t);return this.readValue(r,i)}readValue(r,t){let i=be.NormalizedSchema.of(r);if(i.isTimestampSchema()){if(typeof t==="number")return re._parseEpochTimestamp(t);if(typeof t==="object"){if(t.tag===1&&"value"in t)return re._parseEpochTimestamp(t.value)}}if(i.isBlobSchema()){if(typeof t==="string")return(this.serdeContext?.base64Decoder??re.fromBase64)(t);return t}if(typeof t>"u"||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="bigint"||typeof t==="symbol")return t;else if(typeof t==="object"){if(t===null)return null;if("byteLength"in t)return t;if(t instanceof Date)return t;if(i.isDocumentSchema())return t;if(i.isListSchema()){let l=[],c=i.getValueSchema();for(let d of t){let f=this.readValue(c,d);l.push(f)}return l}let n={};if(i.isMapSchema()){let l=i.getValueSchema();for(let c in t){let d=this.readValue(l,t[c]);n[c]=d}}else if(i.isStructSchema()){let l=i.isUnionSchema(),c;if(l){c=new Set;for(let d in t)if(d!=="__type")c.add(d)}for(let[d,f]of i.structIterator()){if(l)c.delete(d);if(t[d]!=null)n[d]=this.readValue(f,t[d])}if(l&&c?.size===1){let d=!0;for(let f in n){d=!1;break}if(d){let f=c.values().next().value;n.$unknown=[f,t[f]]}}else if(typeof t.__type==="string"){for(let d in t)if(!(d in n))n[d]=t[d]}}else if(t instanceof re.NumericValue)return t;return n}else return t}}class Sr extends _e.RpcProtocol{codec=new Nt;serializer=this.codec.createSerializer();deserializer=this.codec.createDeserializer();constructor({defaultNamespace:r,errorTypeRegistries:t}){super({defaultNamespace:r,errorTypeRegistries:t})}getShapeId(){return"smithy.protocols#rpcv2Cbor"}getPayloadCodec(){return this.codec}async serializeRequest(r,t,i){let n=await super.serializeRequest(r,t,i);if(Object.assign(n.headers,{"content-type":this.getDefaultContentType(),"smithy-protocol":"rpc-v2-cbor",accept:this.getDefaultContentType()}),be.deref(r.input)==="unit")delete n.body,delete n.headers["content-type"];else{if(!n.body)this.serializer.write(15,{}),n.body=this.serializer.flush();try{n.headers["content-length"]=String(n.body.byteLength)}catch(f){}}let{service:l,operation:c}=oi.getSmithyContext(i),d=`/service/${l}/operation/${c}`;if(n.path.endsWith("/"))n.path+=d.slice(1);else n.path+=d;return n}async deserializeResponse(r,t,i){return super.deserializeResponse(r,t,i)}async handleError(r,t,i,n,l){let c=Nr(i,n)??"Unknown",d={$metadata:l,$fault:i.statusCode<=500?"client":"server"},f=this.options.defaultNamespace;if(c.includes("#"))[f]=c.split("#");let m=this.compositeErrorRegistry,w=be.TypeRegistry.for(f);m.copyFrom(w);let E;try{E=m.getSchema(c)}catch(V){if(n.Message)n.message=n.Message;let B=be.TypeRegistry.for("smithy.ts.sdk.synthetic."+f);m.copyFrom(B);let Z=m.getBaseException();if(Z){let L=m.getErrorCtor(Z);throw Object.assign(new L({name:c}),d,n)}throw Object.assign(Error(c),d,n)}let S=be.NormalizedSchema.of(E),_=m.getErrorCtor(E),A=n.message??n.Message??"Unknown",I=new _({}),P={};for(let[V,B]of S.structIterator())P[V]=this.deserializer.readValue(B,n[V]);throw Object.assign(I,d,{$fault:S.getMergedTraits().error,message:A},P)}getDefaultContentType(){return"application/cbor"}}Ti.CborCodec=Nt;Ti.CborShapeDeserializer=bt;Ti.CborShapeSerializer=St;Ti.SmithyRpcV2CborProtocol=Sr;Ti.buildHttpRpcRequest=Ai;Ti.cbor=Ve;Ti.checkCborResponse=_i;Ti.dateToTag=ze;Ti.loadSmithyRpcV2CborErrorCode=Nr;Ti.parseCborBody=Er;Ti.parseCborErrorBody=bi;Ti.tag=wt;Ti.tagSymbol=xt});var Ar=xe((vo,_r)=>{(()=>{var r={d:(e,s)=>{for(var o in s)r.o(s,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:s[o]})},o:(e,s)=>Object.prototype.hasOwnProperty.call(e,s),r:(e)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};r.r(t),r.d(t,{XMLBuilder:()=>ii,XMLParser:()=>ir,XMLValidator:()=>ni});let i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("^["+i+"]["+i+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function l(e,s){let o=[],a=s.exec(e);for(;a;){let h=[];h.startIndex=s.lastIndex-a[0].length;let u=a.length;for(let x=0;x<u;x++)h.push(a[x]);o.push(h),a=s.exec(e)}return o}let c=function(e){return n.exec(e)!=null},d=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],f=["__proto__","constructor","prototype"],m={allowBooleanAttributes:!1,unpairedTags:[]};function w(e,s){s=Object.assign({},m,s);let o=[],a=!1,h=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let u=0;u<e.length;u++)if(e[u]==="<"&&e[u+1]==="?"){if(u+=2,u=S(e,u),u.err)return u}else{if(e[u]!=="<"){if(E(e[u]))continue;return L("InvalidChar","char '"+e[u]+"' is not expected.",F(e,u))}{let x=u;if(u++,e[u]==="!"){u=_(e,u);continue}{let p=!1;e[u]==="/"&&(p=!0,u++);let y="";for(;u<e.length&&e[u]!==">"&&e[u]!==" "&&e[u]!=="\t"&&e[u]!==`
2
+ import{Pe as mt}from"./chunk-dp6ms01y.js";import{Bf as fr,Cf as pt,Ff as ft}from"./chunk-2fbkw84y.js";import{rP as xe}from"./chunk-djfrkbd5.js";var br=xe((Ti)=>{var re=ft(),_e=mt(),oi=pt(),be=fr(),Oe=0,Ue=1,me=2,ce=3,Pe=4,ke=5,mr=6,ct=7,gr=20,ut=21,yr=22,ai=23,gt=24,ge=25,ye=26,he=27,yt=31;function Ae(r){return typeof Buffer<"u"?Buffer.alloc(r):new Uint8Array(r)}var xt=Symbol("@smithy/core/cbor::tagSymbol");function wt(r){return r[xt]=!0,r}var ci=typeof TextDecoder<"u",hi=typeof Buffer<"u",O=Ae(0),oe=new DataView(O.buffer,O.byteOffset,O.byteLength),ur=ci?new TextDecoder:null,D=0;function li(r){O=r,oe=new DataView(O.buffer,O.byteOffset,O.byteLength)}function ae(r,t){if(r>=t)throw Error("unexpected end of (decode) payload.");let i=(O[r]&224)>>5,n=O[r]&31;switch(i){case Oe:case Ue:case mr:let l,c;if(n<24)l=n,c=1;else switch(n){case gt:case ge:case ye:case he:let d=wr[n],f=d+1;if(c=f,t-r<f)throw Error(`countLength ${d} greater than remaining buf len.`);let m=r+1;if(d===1)l=O[m];else if(d===2)l=oe.getUint16(m);else if(d===4)l=oe.getUint32(m);else l=oe.getBigUint64(m);break;default:throw Error(`unexpected minor value ${n}.`)}if(i===Oe)return D=c,ht(l);else if(i===Ue){let d;if(typeof l==="bigint")d=BigInt(-1)-l;else d=-1-l;return D=c,ht(d)}else if(n===2||n===3){let d=$e(r+c,t),f=BigInt(0),m=r+c+D;for(let w=m;w<m+d;++w)f=f<<BigInt(8)|BigInt(O[w]);return D=c+D+d,n===3?-f-BigInt(1):f}else if(n===4){let d=ae(r+c,t),[f,m]=d,w=m<0?-1:1,E="0".repeat(Math.abs(f)+1)+String(BigInt(w)*BigInt(m)),S,_=m<0?"-":"";if(S=f===0?E:E.slice(0,E.length+f)+"."+E.slice(f),S=S.replace(/^0+/g,""),S==="")S="0";if(S[0]===".")S="0"+S;return S=_+S,D=c+D,re.nv(S)}else{let d=ae(r+c,t);return D=c+D,wt({tag:ht(l),value:d})}case ce:case ke:case Pe:case me:if(n===yt)switch(i){case ce:return fi(r,t);case ke:return wi(r,t);case Pe:return yi(r,t);case me:return mi(r,t)}else switch(i){case ce:return pi(r,t);case ke:return xi(r,t);case Pe:return gi(r,t);case me:return Et(r,t)}default:return Ei(r,t)}}function xr(r,t,i){if(hi&&r.constructor?.name==="Buffer")return r.toString("utf-8",t,i);if(ur)return ur.decode(r.subarray(t,i));return re.toUtf8(r.subarray(t,i))}function ui(r){let t=Number(r);if(t<Number.MIN_SAFE_INTEGER||Number.MAX_SAFE_INTEGER<t)console.warn(Error(`@smithy/core/cbor - truncating BigInt(${r}) to ${t} with loss of precision.`));return t}var wr={[gt]:1,[ge]:2,[ye]:4,[he]:8};function di(r,t){let i=r>>7,n=(r&124)>>2,l=(r&3)<<8|t,c=i===0?1:-1,d,f;if(n===0)if(l===0)return 0;else d=Math.pow(2,-14),f=0;else if(n===31)if(l===0)return c*(1/0);else return NaN;else d=Math.pow(2,n-15),f=1;return f+=l/1024,c*(d*f)}function $e(r,t){let i=O[r]&31;if(i<24)return D=1,i;if(i===gt||i===ge||i===ye||i===he){let n=wr[i];if(D=n+1,t-r<D)throw Error(`countLength ${n} greater than remaining buf len.`);let l=r+1;if(n===1)return O[l];else if(n===2)return oe.getUint16(l);else if(n===4)return oe.getUint32(l);return ui(oe.getBigUint64(l))}throw Error(`unexpected minor value ${i}.`)}function pi(r,t){let i=$e(r,t),n=D;if(r+=n,t-r<i)throw Error(`string len ${i} greater than remaining buf len.`);let l=xr(O,r,r+i);return D=n+i,l}function fi(r,t){r+=1;let i=[];for(let n=r;r<t;){if(O[r]===255){let m=Ae(i.length);return m.set(i,0),D=r-n+2,xr(m,0,m.length)}let l=(O[r]&224)>>5,c=O[r]&31;if(l!==ce)throw Error(`unexpected major type ${l} in indefinite string.`);if(c===yt)throw Error("nested indefinite string.");let d=Et(r,t);r+=D;for(let m=0;m<d.length;++m)i.push(d[m])}throw Error("expected break marker.")}function Et(r,t){let i=$e(r,t),n=D;if(r+=n,t-r<i)throw Error(`unstructured byte string len ${i} greater than remaining buf len.`);let l=O.subarray(r,r+i);return D=n+i,l}function mi(r,t){r+=1;let i=[];for(let n=r;r<t;){if(O[r]===255){let m=Ae(i.length);return m.set(i,0),D=r-n+2,m}let l=(O[r]&224)>>5,c=O[r]&31;if(l!==me)throw Error(`unexpected major type ${l} in indefinite string.`);if(c===yt)throw Error("nested indefinite string.");let d=Et(r,t);r+=D;for(let m=0;m<d.length;++m)i.push(d[m])}throw Error("expected break marker.")}function gi(r,t){let i=$e(r,t),n=D;r+=n;let l=r,c=Array(i);for(let d=0;d<i;++d){let f=ae(r,t),m=D;c[d]=f,r+=m}return D=n+(r-l),c}function yi(r,t){r+=1;let i=[];for(let n=r;r<t;){if(O[r]===255)return D=r-n+2,i;let l=ae(r,t);r+=D,i.push(l)}throw Error("expected break marker.")}function xi(r,t){let i=$e(r,t),n=D;r+=n;let l=r,c={};for(let d=0;d<i;++d){if(r>=t)throw Error("unexpected end of map payload.");let f=(O[r]&224)>>5;if(f!==ce)throw Error(`unexpected major type ${f} for map key at index ${r}.`);let m=ae(r,t);r+=D;let w=ae(r,t);r+=D,c[m]=w}return D=n+(r-l),c}function wi(r,t){r+=1;let i=r,n={};for(;r<t;){if(r>=t)throw Error("unexpected end of map payload.");if(O[r]===255)return D=r-i+2,n;let l=(O[r]&224)>>5;if(l!==ce)throw Error(`unexpected major type ${l} for map key.`);let c=ae(r,t);r+=D;let d=ae(r,t);r+=D,n[c]=d}throw Error("expected break marker.")}function Ei(r,t){let i=O[r]&31;switch(i){case ut:case gr:return D=1,i===ut;case yr:return D=1,null;case ai:return D=1,null;case ge:if(t-r<3)throw Error("incomplete float16 at end of buf.");return D=3,di(O[r+1],O[r+2]);case ye:if(t-r<5)throw Error("incomplete float32 at end of buf.");return D=5,oe.getFloat32(r+1);case he:if(t-r<9)throw Error("incomplete float64 at end of buf.");return D=9,oe.getFloat64(r+1);default:throw Error(`unexpected minor value ${i}.`)}}function ht(r){if(typeof r==="number")return r;let t=Number(r);if(Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER)return t;return r}var dr=typeof Buffer<"u",Ni=2048,$=Ae(Ni),ne=new DataView($.buffer,$.byteOffset,$.byteLength),C=0;function lt(r){if($.byteLength-C<r)if(C<16000000)dt(Math.max($.byteLength*4,$.byteLength+r));else dt($.byteLength+r+16000000)}function pr(){let r=Ae(C);return r.set($.subarray(0,C),0),C=0,r}function dt(r){let t=$;if($=Ae(r),t)if(t.copy)t.copy($,0,0,t.byteLength);else $.set(t,0);ne=new DataView($.buffer,$.byteOffset,$.byteLength)}function ie(r,t){if(t<24)$[C++]=r<<5|t;else if(t<256)$[C++]=r<<5|24,$[C++]=t;else if(t<65536)$[C++]=r<<5|ge,ne.setUint16(C,t),C+=2;else if(t<4294967296)$[C++]=r<<5|ye,ne.setUint32(C,t),C+=4;else $[C++]=r<<5|he,ne.setBigUint64(C,typeof t==="bigint"?t:BigInt(t)),C+=8}function Si(r){let t=[r];while(t.length){let i=t.pop();if(lt(typeof i==="string"?i.length*4:64),typeof i==="string"){if(dr)ie(ce,Buffer.byteLength(i)),C+=$.write(i,C);else{let n=re.fromUtf8(i);ie(ce,n.byteLength),$.set(n,C),C+=n.byteLength}continue}else if(typeof i==="number"){if(Number.isInteger(i)){let n=i>=0,l=n?Oe:Ue,c=n?i:-i-1;if(c<24)$[C++]=l<<5|c;else if(c<256)$[C++]=l<<5|24,$[C++]=c;else if(c<65536)$[C++]=l<<5|ge,$[C++]=c>>8,$[C++]=c;else if(c<4294967296)$[C++]=l<<5|ye,ne.setUint32(C,c),C+=4;else $[C++]=l<<5|he,ne.setBigUint64(C,BigInt(c)),C+=8;continue}$[C++]=ct<<5|he,ne.setFloat64(C,i),C+=8;continue}else if(typeof i==="bigint"){let n=i>=0,l=n?Oe:Ue,c=n?i:-i-BigInt(1),d=Number(c);if(d<24)$[C++]=l<<5|d;else if(d<256)$[C++]=l<<5|24,$[C++]=d;else if(d<65536)$[C++]=l<<5|ge,$[C++]=d>>8,$[C++]=d&255;else if(d<4294967296)$[C++]=l<<5|ye,ne.setUint32(C,d),C+=4;else if(c<BigInt("18446744073709551616"))$[C++]=l<<5|he,ne.setBigUint64(C,c),C+=8;else{let f=c.toString(2),m=new Uint8Array(Math.ceil(f.length/8)),w=c,E=0;while(m.byteLength-++E>=0)m[m.byteLength-E]=Number(w&BigInt(255)),w>>=BigInt(8);if(lt(m.byteLength*2),$[C++]=n?194:195,dr)ie(me,Buffer.byteLength(m));else ie(me,m.byteLength);$.set(m,C),C+=m.byteLength}continue}else if(i===null){$[C++]=ct<<5|yr;continue}else if(typeof i==="boolean"){$[C++]=ct<<5|(i?ut:gr);continue}else if(typeof i>"u")throw Error("@smithy/core/cbor: client may not serialize undefined value.");else if(Array.isArray(i)){for(let n=i.length-1;n>=0;--n)t.push(i[n]);ie(Pe,i.length);continue}else if(typeof i.byteLength==="number"){lt(i.length*2),ie(me,i.length),$.set(i,C),C+=i.byteLength;continue}else if(typeof i==="object"){if(i instanceof re.NumericValue){let l=i.string.indexOf("."),c=l===-1?0:l-i.string.length+1,d=BigInt(i.string.replace(".",""));$[C++]=196,t.push(d),t.push(c),ie(Pe,2);continue}if(i[xt])if("tag"in i&&"value"in i){t.push(i.value),ie(mr,i.tag);continue}else throw Error("tag encountered with missing fields, need 'tag' and 'value', found: "+JSON.stringify(i));let n=Object.keys(i);for(let l=n.length-1;l>=0;--l){let c=n[l];t.push(i[c]),t.push(c)}ie(ke,n.length);continue}throw Error(`data type ${i?.constructor?.name??typeof i} not compatible for encoding.`)}}var Ve={deserialize(r){return li(r),ae(0,r.length)},serialize(r){try{return Si(r),pr()}catch(t){throw pr(),t}},resizeEncodingBuffer(r){dt(r)}},Er=(r,t)=>{return _e.collectBody(r,t).then(async(i)=>{if(i.length)try{return Ve.deserialize(i)}catch(n){throw Object.defineProperty(n,"$responseBodyText",{value:t.utf8Encoder(i)}),n}return{}})},ze=(r)=>{return wt({tag:1,value:r.getTime()/1000})},bi=async(r,t)=>{let i=await Er(r,t);return i.message=i.message??i.Message,i},Nr=(r,t)=>{let i=(l)=>{let c=l;if(typeof c==="number")c=c.toString();if(c.indexOf(",")>=0)c=c.split(",")[0];if(c.indexOf(":")>=0)c=c.split(":")[0];if(c.indexOf("#")>=0)c=c.split("#")[1];return c};if(t.__type!==void 0)return i(t.__type);let n;for(let l in t)if(l.toLowerCase()==="code"){n=l;break}if(n&&t[n]!==void 0)return i(t[n])},_i=(r)=>{if(String(r.headers["smithy-protocol"]).toLowerCase()!=="rpc-v2-cbor")throw Error("Malformed RPCv2 CBOR response, status: "+r.statusCode)},Ai=async(r,t,i,n,l)=>{let c=await r.endpoint(),{hostname:d,protocol:f="https",port:m,path:w}=c,E={protocol:f,hostname:d,port:m,method:"POST",path:w.endsWith("/")?w.slice(0,-1)+i:w+i,headers:{...t}};if(n!==void 0)E.hostname=n;if(c.headers)for(let S in c.headers)E.headers[S]=c.headers[S];if(l!==void 0){E.body=l;try{E.headers["content-length"]=String(re.calculateBodyLength(l))}catch(S){}}return new _e.HttpRequest(E)};class Nt extends _e.SerdeContext{createSerializer(){let r=new St;return r.setSerdeContext(this.serdeContext),r}createDeserializer(){let r=new bt;return r.setSerdeContext(this.serdeContext),r}}class St extends _e.SerdeContext{value;write(r,t){this.value=this.serialize(r,t)}serialize(r,t){let i=be.NormalizedSchema.of(r);if(t==null){if(i.isIdempotencyToken())return re.generateIdempotencyToken();return t}if(i.isBlobSchema()){if(typeof t==="string")return(this.serdeContext?.base64Decoder??re.fromBase64)(t);return t}if(i.isTimestampSchema()){if(typeof t==="number"||typeof t==="bigint")return ze(new Date(Number(t)/1000|0));return ze(t)}if(typeof t==="function"||typeof t==="object"){let n=t;if(i.isListSchema()&&Array.isArray(n)){let c=!!i.getMergedTraits().sparse,d=[],f=0;for(let m of n){let w=this.serialize(i.getValueSchema(),m);if(w!=null||c)d[f++]=w}return d}if(n instanceof Date)return ze(n);let l={};if(i.isMapSchema()){let c=!!i.getMergedTraits().sparse;for(let d in n){let f=this.serialize(i.getValueSchema(),n[d]);if(f!=null||c)l[d]=f}}else if(i.isStructSchema()){for(let[d,f]of i.structIterator()){let m=this.serialize(f,n[d]);if(m!=null)l[d]=m}if(i.isUnionSchema()&&Array.isArray(n.$unknown)){let[d,f]=n.$unknown;l[d]=f}else if(typeof n.__type==="string"){for(let d in n)if(!(d in l))l[d]=this.serialize(15,n[d])}}else if(i.isDocumentSchema())for(let c in n)l[c]=this.serialize(i.getValueSchema(),n[c]);else if(i.isBigDecimalSchema())return n;return l}return t}flush(){let r=Ve.serialize(this.value);return this.value=void 0,r}}class bt extends _e.SerdeContext{read(r,t){let i=Ve.deserialize(t);return this.readValue(r,i)}readValue(r,t){let i=be.NormalizedSchema.of(r);if(i.isTimestampSchema()){if(typeof t==="number")return re._parseEpochTimestamp(t);if(typeof t==="object"){if(t.tag===1&&"value"in t)return re._parseEpochTimestamp(t.value)}}if(i.isBlobSchema()){if(typeof t==="string")return(this.serdeContext?.base64Decoder??re.fromBase64)(t);return t}if(typeof t>"u"||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="bigint"||typeof t==="symbol")return t;else if(typeof t==="object"){if(t===null)return null;if("byteLength"in t)return t;if(t instanceof Date)return t;if(i.isDocumentSchema())return t;if(i.isListSchema()){let l=[],c=i.getValueSchema();for(let d of t){let f=this.readValue(c,d);l.push(f)}return l}let n={};if(i.isMapSchema()){let l=i.getValueSchema();for(let c in t){let d=this.readValue(l,t[c]);n[c]=d}}else if(i.isStructSchema()){let l=i.isUnionSchema(),c;if(l){c=new Set;for(let d in t)if(d!=="__type")c.add(d)}for(let[d,f]of i.structIterator()){if(l)c.delete(d);if(t[d]!=null)n[d]=this.readValue(f,t[d])}if(l&&c?.size===1){let d=!0;for(let f in n){d=!1;break}if(d){let f=c.values().next().value;n.$unknown=[f,t[f]]}}else if(typeof t.__type==="string"){for(let d in t)if(!(d in n))n[d]=t[d]}}else if(t instanceof re.NumericValue)return t;return n}else return t}}class Sr extends _e.RpcProtocol{codec=new Nt;serializer=this.codec.createSerializer();deserializer=this.codec.createDeserializer();constructor({defaultNamespace:r,errorTypeRegistries:t}){super({defaultNamespace:r,errorTypeRegistries:t})}getShapeId(){return"smithy.protocols#rpcv2Cbor"}getPayloadCodec(){return this.codec}async serializeRequest(r,t,i){let n=await super.serializeRequest(r,t,i);if(Object.assign(n.headers,{"content-type":this.getDefaultContentType(),"smithy-protocol":"rpc-v2-cbor",accept:this.getDefaultContentType()}),be.deref(r.input)==="unit")delete n.body,delete n.headers["content-type"];else{if(!n.body)this.serializer.write(15,{}),n.body=this.serializer.flush();try{n.headers["content-length"]=String(n.body.byteLength)}catch(f){}}let{service:l,operation:c}=oi.getSmithyContext(i),d=`/service/${l}/operation/${c}`;if(n.path.endsWith("/"))n.path+=d.slice(1);else n.path+=d;return n}async deserializeResponse(r,t,i){return super.deserializeResponse(r,t,i)}async handleError(r,t,i,n,l){let c=Nr(i,n)??"Unknown",d={$metadata:l,$fault:i.statusCode<=500?"client":"server"},f=this.options.defaultNamespace;if(c.includes("#"))[f]=c.split("#");let m=this.compositeErrorRegistry,w=be.TypeRegistry.for(f);m.copyFrom(w);let E;try{E=m.getSchema(c)}catch(V){if(n.Message)n.message=n.Message;let B=be.TypeRegistry.for("smithy.ts.sdk.synthetic."+f);m.copyFrom(B);let Z=m.getBaseException();if(Z){let L=m.getErrorCtor(Z);throw Object.assign(new L({name:c}),d,n)}throw Object.assign(Error(c),d,n)}let S=be.NormalizedSchema.of(E),_=m.getErrorCtor(E),A=n.message??n.Message??"Unknown",I=new _({}),P={};for(let[V,B]of S.structIterator())P[V]=this.deserializer.readValue(B,n[V]);throw Object.assign(I,d,{$fault:S.getMergedTraits().error,message:A},P)}getDefaultContentType(){return"application/cbor"}}Ti.CborCodec=Nt;Ti.CborShapeDeserializer=bt;Ti.CborShapeSerializer=St;Ti.SmithyRpcV2CborProtocol=Sr;Ti.buildHttpRpcRequest=Ai;Ti.cbor=Ve;Ti.checkCborResponse=_i;Ti.dateToTag=ze;Ti.loadSmithyRpcV2CborErrorCode=Nr;Ti.parseCborBody=Er;Ti.parseCborErrorBody=bi;Ti.tag=wt;Ti.tagSymbol=xt});var Ar=xe((vo,_r)=>{(()=>{var r={d:(e,s)=>{for(var o in s)r.o(s,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:s[o]})},o:(e,s)=>Object.prototype.hasOwnProperty.call(e,s),r:(e)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};r.r(t),r.d(t,{XMLBuilder:()=>ii,XMLParser:()=>ir,XMLValidator:()=>ni});let i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("^["+i+"]["+i+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function l(e,s){let o=[],a=s.exec(e);for(;a;){let h=[];h.startIndex=s.lastIndex-a[0].length;let u=a.length;for(let x=0;x<u;x++)h.push(a[x]);o.push(h),a=s.exec(e)}return o}let c=function(e){return n.exec(e)!=null},d=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],f=["__proto__","constructor","prototype"],m={allowBooleanAttributes:!1,unpairedTags:[]};function w(e,s){s=Object.assign({},m,s);let o=[],a=!1,h=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let u=0;u<e.length;u++)if(e[u]==="<"&&e[u+1]==="?"){if(u+=2,u=S(e,u),u.err)return u}else{if(e[u]!=="<"){if(E(e[u]))continue;return L("InvalidChar","char '"+e[u]+"' is not expected.",F(e,u))}{let x=u;if(u++,e[u]==="!"){u=_(e,u);continue}{let p=!1;e[u]==="/"&&(p=!0,u++);let y="";for(;u<e.length&&e[u]!==">"&&e[u]!==" "&&e[u]!=="\t"&&e[u]!==`
3
3
  `&&e[u]!=="\r";u++)y+=e[u];if(y=y.trim(),y[y.length-1]==="/"&&(y=y.substring(0,y.length-1),u--),!Ye(y)){let b;return b=y.trim().length===0?"Invalid space after '<'.":"Tag '"+y+"' is an invalid name.",L("InvalidTag",b,F(e,u))}let g=P(e,u);if(g===!1)return L("InvalidAttr","Attributes for '"+y+"' have open quote.",F(e,u));let N=g.value;if(u=g.index,N[N.length-1]==="/"){let b=u-N.length;N=N.substring(0,N.length-1);let T=B(N,s);if(T!==!0)return L(T.err.code,T.err.msg,F(e,b+T.err.line));a=!0}else if(p){if(!g.tagClosed)return L("InvalidTag","Closing tag '"+y+"' doesn't have proper closing.",F(e,u));if(N.trim().length>0)return L("InvalidTag","Closing tag '"+y+"' can't have attributes or invalid starting.",F(e,x));if(o.length===0)return L("InvalidTag","Closing tag '"+y+"' has not been opened.",F(e,x));{let b=o.pop();if(y!==b.tagName){let T=F(e,b.tagStartPos);return L("InvalidTag","Expected closing tag '"+b.tagName+"' (opened in line "+T.line+", col "+T.col+") instead of closing tag '"+y+"'.",F(e,x))}o.length==0&&(h=!0)}}else{let b=B(N,s);if(b!==!0)return L(b.err.code,b.err.msg,F(e,u-N.length+b.err.line));if(h===!0)return L("InvalidXml","Multiple possible root nodes found.",F(e,u));s.unpairedTags.indexOf(y)!==-1||o.push({tagName:y,tagStartPos:x}),a=!0}for(u++;u<e.length;u++)if(e[u]==="<"){if(e[u+1]==="!"){u++,u=_(e,u);continue}if(e[u+1]!=="?")break;if(u=S(e,++u),u.err)return u}else if(e[u]==="&"){let b=Z(e,u);if(b==-1)return L("InvalidChar","char '&' is not expected.",F(e,u));u=b}else if(h===!0&&!E(e[u]))return L("InvalidXml","Extra text at the end",F(e,u));e[u]==="<"&&u--}}}return a?o.length==1?L("InvalidTag","Unclosed tag '"+o[0].tagName+"'.",F(e,o[0].tagStartPos)):!(o.length>0)||L("InvalidXml","Invalid '"+JSON.stringify(o.map((u)=>u.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):L("InvalidXml","Start tag expected.",1)}function E(e){return e===" "||e==="\t"||e===`
4
4
  `||e==="\r"}function S(e,s){let o=s;for(;s<e.length;s++)if(e[s]=="?"||e[s]==" "){let a=e.substr(o,s-o);if(s>5&&a==="xml")return L("InvalidXml","XML declaration allowed only at the start of the document.",F(e,s));if(e[s]=="?"&&e[s+1]==">"){s++;break}continue}return s}function _(e,s){if(e.length>s+5&&e[s+1]==="-"&&e[s+2]==="-"){for(s+=3;s<e.length;s++)if(e[s]==="-"&&e[s+1]==="-"&&e[s+2]===">"){s+=2;break}}else if(e.length>s+8&&e[s+1]==="D"&&e[s+2]==="O"&&e[s+3]==="C"&&e[s+4]==="T"&&e[s+5]==="Y"&&e[s+6]==="P"&&e[s+7]==="E"){let o=1;for(s+=8;s<e.length;s++)if(e[s]==="<")o++;else if(e[s]===">"&&(o--,o===0))break}else if(e.length>s+9&&e[s+1]==="["&&e[s+2]==="C"&&e[s+3]==="D"&&e[s+4]==="A"&&e[s+5]==="T"&&e[s+6]==="A"&&e[s+7]==="["){for(s+=8;s<e.length;s++)if(e[s]==="]"&&e[s+1]==="]"&&e[s+2]===">"){s+=2;break}}return s}let A='"',I="'";function P(e,s){let o="",a="",h=!1;for(;s<e.length;s++){if(e[s]===A||e[s]===I)a===""?a=e[s]:a!==e[s]||(a="");else if(e[s]===">"&&a===""){h=!0;break}o+=e[s]}return a===""&&{value:o,index:s,tagClosed:h}}let V=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function B(e,s){let o=l(e,V),a={};for(let h=0;h<o.length;h++){if(o[h][1].length===0)return L("InvalidAttr","Attribute '"+o[h][2]+"' has no space in starting.",te(o[h]));if(o[h][3]!==void 0&&o[h][4]===void 0)return L("InvalidAttr","Attribute '"+o[h][2]+"' is without value.",te(o[h]));if(o[h][3]===void 0&&!s.allowBooleanAttributes)return L("InvalidAttr","boolean attribute '"+o[h][2]+"' is not allowed.",te(o[h]));let u=o[h][2];if(!ue(u))return L("InvalidAttr","Attribute '"+u+"' is an invalid name.",te(o[h]));if(Object.prototype.hasOwnProperty.call(a,u))return L("InvalidAttr","Attribute '"+u+"' is repeated.",te(o[h]));a[u]=1}return!0}function Z(e,s){if(e[++s]===";")return-1;if(e[s]==="#")return function(a,h){let u=/\d/;for(a[h]==="x"&&(h++,u=/[\da-fA-F]/);h<a.length;h++){if(a[h]===";")return h;if(!a[h].match(u))break}return-1}(e,++s);let o=0;for(;s<e.length;s++,o++)if(!(e[s].match(/\w/)&&o<20)){if(e[s]===";")break;return-1}return s}function L(e,s,o){return{err:{code:e,msg:s,line:o.line||o,col:o.col}}}function ue(e){return c(e)}function Ye(e){return c(e)}function F(e,s){let o=e.substring(0,s).split(/\r?\n/);return{line:o.length,col:o[o.length-1].length+1}}function te(e){return e.startIndex+e[1].length}let Qt=(e)=>d.includes(e)?"__"+e:e,Ns={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,s){return s},attributeValueProcessor:function(e,s){return s},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,s,o){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Qt};function Ss(e,s){if(typeof e!="string")return;let o=e.toLowerCase();if(d.some((a)=>o===a.toLowerCase()))throw Error(`[SECURITY] Invalid ${s}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);if(f.some((a)=>o===a.toLowerCase()))throw Error(`[SECURITY] Invalid ${s}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function Kt(e,s){return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1000,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof e=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1000),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??"all"}:Kt(!0)}let bs=function(e){let s=Object.assign({},Ns,e),o=[{value:s.attributeNamePrefix,name:"attributeNamePrefix"},{value:s.attributesGroupName,name:"attributesGroupName"},{value:s.textNodeName,name:"textNodeName"},{value:s.cdataPropName,name:"cdataPropName"},{value:s.commentPropName,name:"commentPropName"}];for(let{value:a,name:h}of o)a&&Ss(a,h);return s.onDangerousProperty===null&&(s.onDangerousProperty=Qt),s.processEntities=Kt(s.processEntities,s.htmlEntities),s.unpairedTagsSet=new Set(s.unpairedTags),s.stopNodes&&Array.isArray(s.stopNodes)&&(s.stopNodes=s.stopNodes.map((a)=>typeof a=="string"&&a.startsWith("*.")?".."+a.substring(2):a)),s},Ze;Ze=typeof Symbol!="function"?"@@xmlMetadata":Symbol("XML Node Metadata");class se{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null)}add(e,s){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:s})}addChild(e,s){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),s!==void 0&&(this.child[this.child.length-1][Ze]={startIndex:s})}static getMetaDataSymbol(){return Ze}}class Gt{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,s){let o=Object.create(null),a=0;if(e[s+3]!=="O"||e[s+4]!=="C"||e[s+5]!=="T"||e[s+6]!=="Y"||e[s+7]!=="P"||e[s+8]!=="E")throw Error("Invalid Tag instead of DOCTYPE");{s+=9;let h=1,u=!1,x=!1,p="";for(;s<e.length;s++)if(e[s]!=="<"||x)if(e[s]===">"){if(x?e[s-1]==="-"&&e[s-2]==="-"&&(x=!1,h--):h--,h===0)break}else e[s]==="["?u=!0:p+=e[s];else{if(u&&de(e,"!ENTITY",s)){let y,g;if(s+=7,[y,g,s]=this.readEntityExp(e,s+1,this.suppressValidationErr),g.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&a>=this.options.maxEntityCount)throw Error(`Entity count (${a+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);o[y]=g,a++}}else if(u&&de(e,"!ELEMENT",s)){s+=8;let{index:y}=this.readElementExp(e,s+1);s=y}else if(u&&de(e,"!ATTLIST",s))s+=8;else if(u&&de(e,"!NOTATION",s)){s+=9;let{index:y}=this.readNotationExp(e,s+1,this.suppressValidationErr);s=y}else{if(!de(e,"!--",s))throw Error("Invalid DOCTYPE");x=!0}h++,p=""}if(h!==0)throw Error("Unclosed DOCTYPE")}return{entities:o,i:s}}readEntityExp(e,s){let o=s=J(e,s);for(;s<e.length&&!/\s/.test(e[s])&&e[s]!=='"'&&e[s]!=="'";)s++;let a=e.substring(o,s);if(Re(a),s=J(e,s),!this.suppressValidationErr){if(e.substring(s,s+6).toUpperCase()==="SYSTEM")throw Error("External entities are not supported");if(e[s]==="%")throw Error("Parameter entities are not supported")}let h="";if([s,h]=this.readIdentifierVal(e,s,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&h.length>this.options.maxEntitySize)throw Error(`Entity "${a}" size (${h.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[a,h,--s]}readNotationExp(e,s){let o=s=J(e,s);for(;s<e.length&&!/\s/.test(e[s]);)s++;let a=e.substring(o,s);!this.suppressValidationErr&&Re(a),s=J(e,s);let h=e.substring(s,s+6).toUpperCase();if(!this.suppressValidationErr&&h!=="SYSTEM"&&h!=="PUBLIC")throw Error(`Expected SYSTEM or PUBLIC, found "${h}"`);s+=h.length,s=J(e,s);let u=null,x=null;if(h==="PUBLIC")[s,u]=this.readIdentifierVal(e,s,"publicIdentifier"),e[s=J(e,s)]!=='"'&&e[s]!=="'"||([s,x]=this.readIdentifierVal(e,s,"systemIdentifier"));else if(h==="SYSTEM"&&([s,x]=this.readIdentifierVal(e,s,"systemIdentifier"),!this.suppressValidationErr&&!x))throw Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:a,publicIdentifier:u,systemIdentifier:x,index:--s}}readIdentifierVal(e,s,o){let a="",h=e[s];if(h!=='"'&&h!=="'")throw Error(`Expected quoted string, found "${h}"`);let u=++s;for(;s<e.length&&e[s]!==h;)s++;if(a=e.substring(u,s),e[s]!==h)throw Error(`Unterminated ${o} value`);return[++s,a]}readElementExp(e,s){let o=s=J(e,s);for(;s<e.length&&!/\s/.test(e[s]);)s++;let a=e.substring(o,s);if(!this.suppressValidationErr&&!c(a))throw Error(`Invalid element name: "${a}"`);let h="";if(e[s=J(e,s)]==="E"&&de(e,"MPTY",s))s+=4;else if(e[s]==="A"&&de(e,"NY",s))s+=2;else if(e[s]==="("){let u=++s;for(;s<e.length&&e[s]!==")";)s++;if(h=e.substring(u,s),e[s]!==")")throw Error("Unterminated content model")}else if(!this.suppressValidationErr)throw Error(`Invalid Element Expression, found "${e[s]}"`);return{elementName:a,contentModel:h.trim(),index:s}}readAttlistExp(e,s){let o=s=J(e,s);for(;s<e.length&&!/\s/.test(e[s]);)s++;let a=e.substring(o,s);for(Re(a),o=s=J(e,s);s<e.length&&!/\s/.test(e[s]);)s++;let h=e.substring(o,s);if(!Re(h))throw Error(`Invalid attribute name: "${h}"`);s=J(e,s);let u="";if(e.substring(s,s+8).toUpperCase()==="NOTATION"){if(u="NOTATION",e[s=J(e,s+=8)]!=="(")throw Error(`Expected '(', found "${e[s]}"`);s++;let p=[];for(;s<e.length&&e[s]!==")";){let y=s;for(;s<e.length&&e[s]!=="|"&&e[s]!==")";)s++;let g=e.substring(y,s);if(g=g.trim(),!Re(g))throw Error(`Invalid notation name: "${g}"`);p.push(g),e[s]==="|"&&(s++,s=J(e,s))}if(e[s]!==")")throw Error("Unterminated list of notations");s++,u+=" ("+p.join("|")+")"}else{let p=s;for(;s<e.length&&!/\s/.test(e[s]);)s++;u+=e.substring(p,s);let y=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!y.includes(u.toUpperCase()))throw Error(`Invalid attribute type: "${u}"`)}s=J(e,s);let x="";return e.substring(s,s+8).toUpperCase()==="#REQUIRED"?(x="#REQUIRED",s+=8):e.substring(s,s+7).toUpperCase()==="#IMPLIED"?(x="#IMPLIED",s+=7):[s,x]=this.readIdentifierVal(e,s,"ATTLIST"),{elementName:a,attributeName:h,attributeType:u,defaultValue:x,index:s}}}let J=(e,s)=>{for(;s<e.length&&/\s/.test(e[s]);)s++;return s};function de(e,s,o){for(let a=0;a<s.length;a++)if(s[a]!==e[o+a+1])return!1;return!0}function Re(e){if(c(e))return e;throw Error(`Invalid entity name ${e}`)}let _s=/^[-+]?0x[a-fA-F0-9]+$/,As=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Ts={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"},Cs=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;class Wt{constructor(e){this._matcher=e}get separator(){return this._matcher.separator}getCurrentTag(){let e=this._matcher.path;return e.length>0?e[e.length-1].tag:void 0}getCurrentNamespace(){let e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){let s=this._matcher.path;if(s.length!==0)return s[s.length-1].values?.[e]}hasAttr(e){let s=this._matcher.path;if(s.length===0)return!1;let o=s[s.length-1];return o.values!==void 0&&e in o.values}getPosition(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,s=!0){return this._matcher.toString(e,s)}toArray(){return this._matcher.path.map((e)=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}}class De{constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Wt(this)}push(e,s=null,o=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let a=this.path.length;this.siblingStacks[a]||(this.siblingStacks[a]=new Map);let h=this.siblingStacks[a],u=o?`${o}:${e}`:e,x=h.get(u)||0,p=0;for(let g of h.values())p+=g;h.set(u,x+1);let y={tag:e,position:p,counter:x};o!=null&&(y.namespace=o),s!=null&&(y.values=s),this.path.push(y)}pop(){if(this.path.length===0)return;this._pathStringCache=null;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){let s=this.path[this.path.length-1];e!=null&&(s.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let s=this.path[this.path.length-1];return s.values!==void 0&&e in s.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,s=!0){let o=e||this.separator;if(o===this.separator&&s===!0){if(this._pathStringCache!==null)return this._pathStringCache;let a=this.path.map((h)=>h.namespace?`${h.namespace}:${h.tag}`:h.tag).join(o);return this._pathStringCache=a,a}return this.path.map((a)=>s&&a.namespace?`${a.namespace}:${a.tag}`:a.tag).join(o)}toArray(){return this.path.map((e)=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(e){let s=e.segments;return s.length!==0&&(e.hasDeepWildcard()?this._matchWithDeepWildcard(s):this._matchSimple(s))}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let s=0;s<e.length;s++)if(!this._matchSegment(e[s],this.path[s],s===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(e){let s=this.path.length-1,o=e.length-1;for(;o>=0&&s>=0;){let a=e[o];if(a.type==="deep-wildcard"){if(o--,o<0)return!0;let h=e[o],u=!1;for(let x=s;x>=0;x--)if(this._matchSegment(h,this.path[x],x===this.path.length-1)){s=x-1,o--,u=!0;break}if(!u)return!1}else{if(!this._matchSegment(a,this.path[s],s===this.path.length-1))return!1;s--,o--}}return o<0}_matchSegment(e,s,o){if(e.tag!=="*"&&e.tag!==s.tag)return!1;if(e.namespace!==void 0&&e.namespace!=="*"&&e.namespace!==s.namespace)return!1;if(e.attrName!==void 0){if(!o)return!1;if(!s.values||!(e.attrName in s.values))return!1;if(e.attrValue!==void 0&&String(s.values[e.attrName])!==String(e.attrValue))return!1}if(e.position!==void 0){if(!o)return!1;let a=s.counter??0;if(e.position==="first"&&a!==0)return!1;if(e.position==="odd"&&a%2!=1)return!1;if(e.position==="even"&&a%2!=0)return!1;if(e.position==="nth"&&a!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}snapshot(){return{path:this.path.map((e)=>({...e})),siblingStacks:this.siblingStacks.map((e)=>new Map(e))}}restore(e){this._pathStringCache=null,this.path=e.path.map((s)=>({...s})),this.siblingStacks=e.siblingStacks.map((s)=>new Map(s))}readOnly(){return this._view}}class pe{constructor(e,s={},o){this.pattern=e,this.separator=s.separator||".",this.segments=this._parse(e),this.data=o,this._hasDeepWildcard=this.segments.some((a)=>a.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some((a)=>a.attrName!==void 0),this._hasPositionSelector=this.segments.some((a)=>a.position!==void 0)}_parse(e){let s=[],o=0,a="";for(;o<e.length;)e[o]===this.separator?o+1<e.length&&e[o+1]===this.separator?(a.trim()&&(s.push(this._parseSegment(a.trim())),a=""),s.push({type:"deep-wildcard"}),o+=2):(a.trim()&&s.push(this._parseSegment(a.trim())),a="",o++):(a+=e[o],o++);return a.trim()&&s.push(this._parseSegment(a.trim())),s}_parseSegment(e){let s={type:"tag"},o=null,a=e,h=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(h&&(a=h[1]+h[3],h[2])){let g=h[2].slice(1,-1);g&&(o=g)}let u,x,p=a;if(a.includes("::")){let g=a.indexOf("::");if(u=a.substring(0,g).trim(),p=a.substring(g+2).trim(),!u)throw Error(`Invalid namespace in pattern: ${e}`)}let y=null;if(p.includes(":")){let g=p.lastIndexOf(":"),N=p.substring(0,g).trim(),b=p.substring(g+1).trim();["first","last","odd","even"].includes(b)||/^nth\(\d+\)$/.test(b)?(x=N,y=b):x=p}else x=p;if(!x)throw Error(`Invalid segment pattern: ${e}`);if(s.tag=x,u&&(s.namespace=u),o)if(o.includes("=")){let g=o.indexOf("=");s.attrName=o.substring(0,g).trim(),s.attrValue=o.substring(g+1).trim()}else s.attrName=o.trim();if(y){let g=y.match(/^nth\((\d+)\)$/);g?(s.position="nth",s.positionValue=parseInt(g[1],10)):s.position=y}return s}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class Jt{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(e){if(this._sealed)throw TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(e.pattern))return this;if(this._patterns.add(e.pattern),e.hasDeepWildcard())return this._deepWildcards.push(e),this;let s=e.length,o=e.segments[e.segments.length-1],a=o?.tag;if(a&&a!=="*"){let h=`${s}:${a}`;this._byDepthAndTag.has(h)||this._byDepthAndTag.set(h,[]),this._byDepthAndTag.get(h).push(e)}else this._wildcardByDepth.has(s)||this._wildcardByDepth.set(s,[]),this._wildcardByDepth.get(s).push(e);return this}addAll(e){for(let s of e)this.add(s);return this}has(e){return this._patterns.has(e.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(e){return this.findMatch(e)!==null}findMatch(e){let s=e.getDepth(),o=`${s}:${e.getCurrentTag()}`,a=this._byDepthAndTag.get(o);if(a){for(let u=0;u<a.length;u++)if(e.matches(a[u]))return a[u]}let h=this._wildcardByDepth.get(s);if(h){for(let u=0;u<h.length;u++)if(e.matches(h[u]))return h[u]}for(let u=0;u<this._deepWildcards.length;u++)if(e.matches(this._deepWildcards[u]))return this._deepWildcards[u];return null}}let Ms={cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",euro:"\u20AC",dollar:"$",euro:"\u20AC",fnof:"\u0192",inr:"\u20B9",af:"\u060B",birr:"\u1265\u122D",peso:"\u20B1",rub:"\u20BD",won:"\u20A9",yuan:"\xA5",cedil:"\xB8"},jt={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Rs={nbsp:"\xA0",copy:"\xA9",reg:"\xAE",trade:"\u2122",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",bull:"\u2022",para:"\xB6",sect:"\xA7",deg:"\xB0",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE"},Ps=new Set("!?\\\\/[]$%{}^&*()<>|+");function Yt(e){if(e[0]==="#")throw Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(let s of e)if(Ps.has(s))throw Error(`[EntityReplacer] Invalid character '${s}' in entity name: "${e}"`);return e}function et(...e){let s=Object.create(null);for(let o of e)if(o)for(let a of Object.keys(o)){let h=o[a];if(typeof h=="string")s[a]=h;else if(h&&typeof h=="object"&&h.val!==void 0){let u=h.val;typeof u=="string"&&(s[a]=u)}}return s}let fe="external",Le="base",tt="all",Y=Object.freeze({allow:0,leave:1,remove:2,throw:3}),$s=new Set([9,10,13]);class Zt{constructor(e={}){var s;this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck=="function"?e.postCheck:(a)=>a,this._limitTiers=(s=this._limit.applyLimitsTo??fe)&&s!==fe?s===tt?new Set([tt]):s===Le?new Set([Le]):Array.isArray(s)?new Set(s):new Set([fe]):new Set([fe]),this._numericAllowed=e.numericAllowed??!0,this._baseMap=et(jt,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);let o=function(a){if(!a)return{xmlVersion:1,onLevel:Y.allow,nullLevel:Y.remove};let h=a.xmlVersion===1.1?1.1:1,u=Y[a.onNCR]??Y.allow,x=Y[a.nullNCR]??Y.remove;return{xmlVersion:h,onLevel:u,nullLevel:Math.max(x,Y.remove)}}(e.ncr);this._ncrXmlVersion=o.xmlVersion,this._ncrOnLevel=o.onLevel,this._ncrNullLevel=o.nullLevel}setExternalEntities(e){if(e)for(let s of Object.keys(e))Yt(s);this._externalMap=et(e)}addExternalEntity(e,s){Yt(e),typeof s=="string"&&s.indexOf("&")===-1&&(this._externalMap[e]=s)}addInputEntities(e){this._totalExpansions=0,this._expandedLength=0,this._inputMap=et(e)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1}decode(e){if(typeof e!="string"||e.length===0)return e;let s=e,o=[],a=e.length,h=0,u=0,x=this._maxTotalExpansions>0,p=this._maxExpandedLength>0,y=x||p;for(;u<a;){if(e.charCodeAt(u)!==38){u++;continue}let N=u+1;for(;N<a&&e.charCodeAt(N)!==59&&N-u<=32;)N++;if(N>=a||e.charCodeAt(N)!==59){u++;continue}let b=e.slice(u+1,N);if(b.length===0){u++;continue}let T,M;if(this._removeSet.has(b))T="",M===void 0&&(M=fe);else{if(this._leaveSet.has(b)){u++;continue}if(b.charCodeAt(0)===35){let R=this._resolveNCR(b);if(R===void 0){u++;continue}T=R,M=Le}else{let R=this._resolveName(b);T=R?.value,M=R?.tier}}if(T!==void 0){if(u>h&&o.push(e.slice(h,u)),o.push(T),h=N+1,u=h,y&&this._tierCounts(M)){if(x&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(p){let R=T.length-(b.length+2);if(R>0&&(this._expandedLength+=R,this._expandedLength>this._maxExpandedLength))throw Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else u++}h<a&&o.push(e.slice(h));let g=o.length===0?e:o.join("");return this._postCheck(g,s)}_tierCounts(e){return!!this._limitTiers.has(tt)||this._limitTiers.has(e)}_resolveName(e){return e in this._inputMap?{value:this._inputMap[e],tier:fe}:(e in this._externalMap)?{value:this._externalMap[e],tier:fe}:(e in this._baseMap)?{value:this._baseMap[e],tier:Le}:void 0}_classifyNCR(e){return e===0?this._ncrNullLevel:e>=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!$s.has(e)?Y.remove:-1}_applyNCRAction(e,s,o){switch(e){case Y.allow:return String.fromCodePoint(o);case Y.remove:return"";case Y.leave:return;case Y.throw:throw Error(`[EntityDecoder] Prohibited numeric character reference &${s}; (U+${o.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(o)}}_resolveNCR(e){let s=e.charCodeAt(1),o;if(o=s===120||s===88?parseInt(e.slice(2),16):parseInt(e.slice(1),10),Number.isNaN(o)||o<0||o>1114111)return;let a=this._classifyNCR(o);if(!this._numericAllowed&&a<Y.remove)return;let h=a===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,a);return this._applyNCRAction(h,e,o)}}function Is(e,s){if(!e)return{};let o=s.attributesGroupName?e[s.attributesGroupName]:e;if(!o)return{};let a={};for(let h in o)h.startsWith(s.attributeNamePrefix)?a[h.substring(s.attributeNamePrefix.length)]=o[h]:a[h]=o[h];return a}function Ds(e){if(!e||typeof e!="string")return;let s=e.indexOf(":");if(s!==-1&&s>0){let o=e.substring(0,s);if(o!=="xmlns")return o}}class er{constructor(e,s){var o;this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Us,this.parseTextData=Ls,this.resolveNameSpace=ks,this.buildAttributesMap=Os,this.isItStopNode=vs,this.replaceEntitiesValue=Bs,this.readStopNodeData=Hs,this.saveTextToParentTag=Xs,this.addChild=Vs,this.ignoreAttributesFn=typeof(o=this.options.ignoreAttributes)=="function"?o:Array.isArray(o)?(u)=>{for(let x of o){if(typeof x=="string"&&u===x)return!0;if(x instanceof RegExp&&x.test(u))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0;let a={...jt};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?a=this.options.htmlEntities:this.options.htmlEntities===!0&&(a={...Rs,...Ms}),this.entityDecoder=new Zt({namedEntities:{...a,...s},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new De,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new Jt;let h=this.options.stopNodes;if(h&&h.length>0){for(let u=0;u<h.length;u++){let x=h[u];typeof x=="string"?this.stopNodeExpressionsSet.add(new pe(x)):x instanceof pe&&this.stopNodeExpressionsSet.add(x)}this.stopNodeExpressionsSet.seal()}}}function Ls(e,s,o,a,h,u,x){let p=this.options;if(e!==void 0&&(p.trimValues&&!a&&(e=e.trim()),e.length>0)){x||(e=this.replaceEntitiesValue(e,s,o));let y=p.jPath?o.toString():o,g=p.tagValueProcessor(s,e,y,h,u);return g==null?e:typeof g!=typeof e||g!==e?g:p.trimValues||e.trim()===e?tr(e,p.parseTagValue,p.numberParseOptions):e}}function ks(e){if(this.options.removeNSPrefix){let s=e.split(":"),o=e.charAt(0)==="/"?"/":"";if(s[0]==="xmlns")return"";s.length===2&&(e=o+s[1])}return e}let zs=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Os(e,s,o,a=!1){let h=this.options;if(a===!0||h.ignoreAttributes!==!0&&typeof e=="string"){let u=l(e,zs),x=u.length,p={},y=Array(x),g=!1,N={};for(let M=0;M<x;M++){let R=this.resolveNameSpace(u[M][1]),z=u[M][4];if(R.length&&z!==void 0){let v=z;h.trimValues&&(v=v.trim()),v=this.replaceEntitiesValue(v,o,this.readonlyMatcher),y[M]=v,N[R]=v,g=!0}}g&&typeof s=="object"&&s.updateCurrent&&s.updateCurrent(N);let b=h.jPath?s.toString():this.readonlyMatcher,T=!1;for(let M=0;M<x;M++){let R=this.resolveNameSpace(u[M][1]);if(this.ignoreAttributesFn(R,b))continue;let z=h.attributeNamePrefix+R;if(R.length)if(h.transformAttributeName&&(z=h.transformAttributeName(z)),z=rr(z,h),u[M][4]!==void 0){let v=y[M],K=h.attributeValueProcessor(R,v,b);p[z]=K==null?v:typeof K!=typeof v||K!==v?K:tr(v,h.parseAttributeValue,h.numberParseOptions),T=!0}else h.allowBooleanAttributes&&(p[z]=!0,T=!0)}if(!T)return;if(h.attributesGroupName&&!h.preserveOrder){let M={};return M[h.attributesGroupName]=p,M}return p}}let Us=function(e){e=e.replace(/\r\n?/g,`
5
5
  `);let s=new se("!xml"),o=s,a="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let h=this.options,u=new Gt(h.processEntities),x=e.length;for(let p=0;p<x;p++)if(e[p]==="<"){let y=e.charCodeAt(p+1);if(y===47){let g=Ee(e,">",p,"Closing Tag is not closed."),N=e.substring(p+2,g).trim();if(h.removeNSPrefix){let T=N.indexOf(":");T!==-1&&(N=N.substr(T+1))}N=st(h.transformTagName,N,"",h).tagName,o&&(a=this.saveTextToParentTag(a,o,this.readonlyMatcher));let b=this.matcher.getCurrentTag();if(N&&h.unpairedTagsSet.has(N))throw Error(`Unpaired tag can not be used as closing tag: </${N}>`);b&&h.unpairedTagsSet.has(b)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,o=this.tagsNodeStack.pop(),a="",p=g}else if(y===63){let g=rt(e,p,!1,"?>");if(!g)throw Error("Pi Tag is not closed.");a=this.saveTextToParentTag(a,o,this.readonlyMatcher);let N=this.buildAttributesMap(g.tagExp,this.matcher,g.tagName,!0);if(N){let b=N[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(b)||1)}if(h.ignoreDeclaration&&g.tagName==="?xml"||h.ignorePiTags);else{let b=new se(g.tagName);b.add(h.textNodeName,""),g.tagName!==g.tagExp&&g.attrExpPresent&&h.ignoreAttributes!==!0&&(b[":@"]=N),this.addChild(o,b,this.readonlyMatcher,p)}p=g.closeIndex+1}else if(y===33&&e.charCodeAt(p+2)===45&&e.charCodeAt(p+3)===45){let g=Ee(e,"-->",p+4,"Comment is not closed.");if(h.commentPropName){let N=e.substring(p+4,g-2);a=this.saveTextToParentTag(a,o,this.readonlyMatcher),o.add(h.commentPropName,[{[h.textNodeName]:N}])}p=g}else if(y===33&&e.charCodeAt(p+2)===68){let g=u.readDocType(e,p);this.entityDecoder.addInputEntities(g.entities),p=g.i}else if(y===33&&e.charCodeAt(p+2)===91){let g=Ee(e,"]]>",p,"CDATA is not closed.")-2,N=e.substring(p+9,g);a=this.saveTextToParentTag(a,o,this.readonlyMatcher);let b=this.parseTextData(N,o.tagname,this.readonlyMatcher,!0,!1,!0,!0);b==null&&(b=""),h.cdataPropName?o.add(h.cdataPropName,[{[h.textNodeName]:N}]):o.add(h.textNodeName,b),p=g+2}else{let g=rt(e,p,h.removeNSPrefix);if(!g){let X=e.substring(Math.max(0,p-50),Math.min(x,p+50));throw Error(`readTagExp returned undefined at position ${p}. Context: "${X}"`)}let{tagName:N,rawTagName:b,tagExp:T,attrExpPresent:M,closeIndex:R}=g;if({tagName:N,tagExp:T}=st(h.transformTagName,N,T,h),h.strictReservedNames&&(N===h.commentPropName||N===h.cdataPropName||N===h.textNodeName||N===h.attributesGroupName))throw Error(`Invalid tag name: ${N}`);o&&a&&o.tagname!=="!xml"&&(a=this.saveTextToParentTag(a,o,this.readonlyMatcher,!1));let z=o;z&&h.unpairedTagsSet.has(z.tagname)&&(o=this.tagsNodeStack.pop(),this.matcher.pop());let v=!1;T.length>0&&T.lastIndexOf("/")===T.length-1&&(v=!0,N[N.length-1]==="/"?(N=N.substr(0,N.length-1),T=N):T=T.substr(0,T.length-1),M=N!==T);let K,q=null,Se={};K=Ds(b),N!==s.tagname&&this.matcher.push(N,{},K),N!==T&&M&&(q=this.buildAttributesMap(T,this.matcher,N),q&&(Se=Is(q,h))),N!==s.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let G=p;if(this.isCurrentNodeStopNode){let X="";if(v)p=g.closeIndex;else if(h.unpairedTagsSet.has(N))p=g.closeIndex;else{let at=this.readStopNodeData(e,b,R+1);if(!at)throw Error(`Unexpected end of ${b}`);p=at.i,X=at.tagContent}let ot=new se(N);q&&(ot[":@"]=q),ot.add(h.textNodeName,X),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(o,ot,this.readonlyMatcher,G)}else{if(v){({tagName:N,tagExp:T}=st(h.transformTagName,N,T,h));let X=new se(N);q&&(X[":@"]=q),this.addChild(o,X,this.readonlyMatcher,G),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(h.unpairedTagsSet.has(N)){let X=new se(N);q&&(X[":@"]=q),this.addChild(o,X,this.readonlyMatcher,G),this.matcher.pop(),this.isCurrentNodeStopNode=!1,p=g.closeIndex;continue}{let X=new se(N);if(this.tagsNodeStack.length>h.maxNestedTags)throw Error("Maximum nested tags exceeded");this.tagsNodeStack.push(o),q&&(X[":@"]=q),this.addChild(o,X,this.readonlyMatcher,G),o=X}}a="",p=R}}}else a+=e[p];return s.child};function Vs(e,s,o,a){this.options.captureMetaData||(a=void 0);let h=this.options.jPath?o.toString():o,u=this.options.updateTag(s.tagname,h,s[":@"]);u===!1||(typeof u=="string"?(s.tagname=u,e.addChild(s,a)):e.addChild(s,a))}function Bs(e,s,o){let a=this.options.processEntities;if(!a||!a.enabled)return e;if(a.allowedTags){let h=this.options.jPath?o.toString():o;if(!(Array.isArray(a.allowedTags)?a.allowedTags.includes(s):a.allowedTags(s,h)))return e}if(a.tagFilter){let h=this.options.jPath?o.toString():o;if(!a.tagFilter(s,h))return e}return this.entityDecoder.decode(e)}function Xs(e,s,o,a){return e&&(a===void 0&&(a=s.child.length===0),(e=this.parseTextData(e,s.tagname,o,!1,!!s[":@"]&&Object.keys(s[":@"]).length!==0,a))!==void 0&&e!==""&&s.add(this.options.textNodeName,e),e=""),e}function vs(){return this.stopNodeExpressionsSet.size!==0&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function Ee(e,s,o,a){let h=e.indexOf(s,o);if(h===-1)throw Error(a);return h+s.length-1}function Fs(e,s,o,a){let h=e.indexOf(s,o);if(h===-1)throw Error(a);return h}function rt(e,s,o,a=">"){let h=function(b,T,M=">"){let R=0,z=b.length,v=M.charCodeAt(0),K=M.length>1?M.charCodeAt(1):-1,q="",Se=T;for(let G=T;G<z;G++){let X=b.charCodeAt(G);if(R)X===R&&(R=0);else if(X===34||X===39)R=X;else if(X===v){if(K===-1)return q+=b.substring(Se,G),{data:q,index:G};if(b.charCodeAt(G+1)===K)return q+=b.substring(Se,G),{data:q,index:G}}else X!==9||R||(q+=b.substring(Se,G)+" ",Se=G+1)}}(e,s+1,a);if(!h)return;let{data:u,index:x}=h,p=u.search(/\s/),y=u,g=!0;p!==-1&&(y=u.substring(0,p),u=u.substring(p+1).trimStart());let N=y;if(o){let b=y.indexOf(":");b!==-1&&(y=y.substr(b+1),g=y!==h.data.substr(b+1))}return{tagName:y,tagExp:u,closeIndex:x,attrExpPresent:g,rawTagName:N}}function Hs(e,s,o){let a=o,h=1,u=e.length;for(;o<u;o++)if(e[o]==="<"){let x=e.charCodeAt(o+1);if(x===47){let p=Fs(e,">",o,`${s} is not closed`);if(e.substring(o+2,p).trim()===s&&(h--,h===0))return{tagContent:e.substring(a,o),i:p};o=p}else if(x===63)o=Ee(e,"?>",o+1,"StopNode is not closed.");else if(x===33&&e.charCodeAt(o+2)===45&&e.charCodeAt(o+3)===45)o=Ee(e,"-->",o+3,"StopNode is not closed.");else if(x===33&&e.charCodeAt(o+2)===91)o=Ee(e,"]]>",o,"StopNode is not closed.")-2;else{let p=rt(e,o,!1);p&&((p&&p.tagName)===s&&p.tagExp[p.tagExp.length-1]!=="/"&&h++,o=p.closeIndex)}}}function tr(e,s,o){if(s&&typeof e=="string"){let a=e.trim();return a==="true"||a!=="false"&&function(h,u={}){if(u=Object.assign({},Ts,u),!h||typeof h!="string")return h;let x=h.trim();if(x.length===0)return h;if(u.skipLike!==void 0&&u.skipLike.test(x))return h;if(x==="0")return 0;if(u.hex&&_s.test(x))return function(y){if(parseInt)return parseInt(y,16);if(Number.parseInt)return Number.parseInt(y,16);if(window&&window.parseInt)return window.parseInt(y,16);throw Error("parseInt, Number.parseInt, window.parseInt are not supported")}(x);if(isFinite(x)){if(x.includes("e")||x.includes("E"))return function(y,g,N){if(!N.eNotation)return y;let b=g.match(Cs);if(b){let T=b[1]||"",M=b[3].indexOf("e")===-1?"E":"e",R=b[2],z=T?y[R.length+1]===M:y[R.length]===M;return R.length>1&&z?y:(R.length!==1||!b[3].startsWith(`.${M}`)&&b[3][0]!==M)&&R.length>0?N.leadingZeros&&!z?(g=(b[1]||"")+b[3],Number(g)):y:Number(g)}return y}(h,x,u);{let y=As.exec(x);if(y){let g=y[1]||"",N=y[2],b=(p=y[3])&&p.indexOf(".")!==-1?((p=p.replace(/0+$/,""))==="."?p="0":p[0]==="."?p="0"+p:p[p.length-1]==="."&&(p=p.substring(0,p.length-1)),p):p,T=g?h[N.length+1]===".":h[N.length]===".";if(!u.leadingZeros&&(N.length>1||N.length===1&&!T))return h;{let M=Number(x),R=String(M);if(M===0)return M;if(R.search(/[eE]/)!==-1)return u.eNotation?M:h;if(x.indexOf(".")!==-1)return R==="0"||R===b||R===`${g}${b}`?M:h;let z=N?b:x;return N?z===R||g+z===R?M:h:z===R||z===g+R?M:h}}return h}}var p;return function(y,g,N){let b=g===1/0;switch(N.infinity.toLowerCase()){case"null":return null;case"infinity":return g;case"string":return b?"Infinity":"-Infinity";default:return y}}(h,Number(x),u)}(e,o)}return e!==void 0?e:""}function st(e,s,o,a){if(e){let h=e(s);o===s&&(o=h),s=h}return{tagName:s=rr(s,a),tagExp:o}}function rr(e,s){if(f.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return d.includes(e)?s.onDangerousProperty(e):e}let it=se.getMetaDataSymbol();function qs(e,s){if(!e||typeof e!="object")return{};if(!s)return e;let o={};for(let a in e)a.startsWith(s)?o[a.substring(s.length)]=e[a]:o[a]=e[a];return o}function Qs(e,s,o,a){return sr(e,s,o,a)}function sr(e,s,o,a){let h,u={};for(let x=0;x<e.length;x++){let p=e[x],y=Ks(p);if(y!==void 0&&y!==s.textNodeName){let g=qs(p[":@"]||{},s.attributeNamePrefix);o.push(y,g)}if(y===s.textNodeName)h===void 0?h=p[y]:h+=""+p[y];else{if(y===void 0)continue;if(p[y]){let g=sr(p[y],s,o,a),N=Ws(g,s);if(Object.keys(g).length===0&&s.alwaysCreateTextNode&&(g[s.textNodeName]=""),p[":@"]?Gs(g,p[":@"],a,s):Object.keys(g).length!==1||g[s.textNodeName]===void 0||s.alwaysCreateTextNode?Object.keys(g).length===0&&(s.alwaysCreateTextNode?g[s.textNodeName]="":g=""):g=g[s.textNodeName],p[it]!==void 0&&typeof g=="object"&&g!==null&&(g[it]=p[it]),u[y]!==void 0&&Object.prototype.hasOwnProperty.call(u,y))Array.isArray(u[y])||(u[y]=[u[y]]),u[y].push(g);else{let b=s.jPath?a.toString():a;s.isArray(y,b,N)?u[y]=[g]:u[y]=g}y!==void 0&&y!==s.textNodeName&&o.pop()}}}return typeof h=="string"?h.length>0&&(u[s.textNodeName]=h):h!==void 0&&(u[s.textNodeName]=h),u}function Ks(e){let s=Object.keys(e);for(let o=0;o<s.length;o++){let a=s[o];if(a!==":@")return a}}function Gs(e,s,o,a){if(s){let h=Object.keys(s),u=h.length;for(let x=0;x<u;x++){let p=h[x],y=p.startsWith(a.attributeNamePrefix)?p.substring(a.attributeNamePrefix.length):p,g=a.jPath?o.toString()+"."+y:o;a.isArray(p,g,!0,!0)?e[p]=[s[p]]:e[p]=s[p]}}}function Ws(e,s){let{textNodeName:o}=s,a=Object.keys(e).length;return a===0||!(a!==1||!e[o]&&typeof e[o]!="boolean"&&e[o]!==0)}class ir{constructor(e){this.externalEntities={},this.options=bs(e)}parse(e,s){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw Error("XML data is accepted in String or Bytes[] form.");if(s){s===!0&&(s={});let h=w(e,s);if(h!==!0)throw Error(`${h.err.msg}:${h.err.line}:${h.err.col}`)}let o=new er(this.options,this.externalEntities),a=o.parseXml(e);return this.options.preserveOrder||a===void 0?a:Qs(a,this.options,o.matcher,o.readonlyMatcher)}addEntity(e,s){if(s.indexOf("&")!==-1)throw Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(s==="&")throw Error("An entity with value '&' is not permitted");this.externalEntities[e]=s}static getMetaDataSymbol(){return se.getMetaDataSymbol()}}function nr(e){return String(e).replace(/--/g,"- -").replace(/--/g,"- -").replace(/-$/,"- ")}function or(e){return String(e).replace(/\]\]>/g,"]]]]><![CDATA[>")}function Ne(e){return String(e).replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function Js(e,s){let o="";s.format&&s.indentBy.length>0&&(o=`
@@ -18,4 +18,4 @@ ${r}
18
18
  ${t}
19
19
  ${Q.toHex(c)}`}getCanonicalPath({path:r}){if(this.uriEscapePath){let t=[];for(let l of r.split("/")){if(l?.length===0)continue;if(l===".")continue;if(l==="..")t.pop();else t.push(l)}let i=`${r?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&r?.endsWith("/")?"/":""}`;return Me.escapeUri(i).replace(/%2F/g,"/")}return r}validateResolvedCredentials(r){if(typeof r!=="object"||typeof r.accessKeyId!=="string"||typeof r.secretAccessKey!=="string")throw Error("Resolved credential object is not valid")}formatDate(r){let t=Wn(r).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(r){return Object.keys(r).sort().join(";")}}var Ce={},Ge=[],We=(r,t,i)=>`${r}/${t}/${i}/${Ht}`,ys=async(r,t,i,n,l)=>{let c=await Zr(r,t.secretAccessKey,t.accessKeyId),d=`${i}:${n}:${l}:${Q.toHex(c)}:${t.sessionToken}`;if(d in Ce)return Ce[d];Ge.push(d);while(Ge.length>fs)delete Ce[Ge.shift()];let f=`AWS4${t.secretAccessKey}`;for(let m of[i,n,l,Ht])f=await Zr(r,f,m);return Ce[d]=f},jn=()=>{Ge.length=0,Object.keys(Ce).forEach((r)=>{delete Ce[r]})},Zr=(r,t,i)=>{let n=new r(t);return n.update(Q.toUint8Array(i)),n.digest()},zt=({headers:r},t,i)=>{let n={};for(let l of Object.keys(r).sort()){if(r[l]==null)continue;let c=l.toLowerCase();if(c in hs||t?.has(c)||ls.test(c)||us.test(c)){if(!i||i&&!i.has(c))continue}n[c]=r[l].trim().replace(/\s+/g," ")}return n},Je=async({headers:r,body:t},i)=>{for(let n of Object.keys(r))if(n.toLowerCase()===je)return r[n];if(t==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof t==="string"||ArrayBuffer.isView(t)||Q.isArrayBuffer(t)){let n=new i;return n.update(Q.toUint8Array(t)),Q.toHex(await n.digest())}return ps},xs=(r,t)=>{r=r.toLowerCase();for(let i of Object.keys(t))if(r===i.toLowerCase())return!0;return!1},ws=(r,t={})=>{let{headers:i,query:n={}}=Me.HttpRequest.clone(r);for(let l of Object.keys(i)){let c=l.toLowerCase();if(c.slice(0,6)==="x-amz-"&&!t.unhoistableHeaders?.has(c)||t.hoistableHeaders?.has(c))n[l]=i[l],delete i[l]}return{...r,headers:i,query:n}},Ot=(r)=>{r=Me.HttpRequest.clone(r);for(let t of Object.keys(r.headers))if(os.indexOf(t.toLowerCase())>-1)delete r.headers[t];return r};class Es extends qt{headerFormatter=new es;constructor({applyChecksum:r,credentials:t,region:i,service:n,sha256:l,uriEscapePath:c=!0}){super({applyChecksum:r,credentials:t,region:i,service:n,sha256:l,uriEscapePath:c})}async presign(r,t={}){let{signingDate:i=new Date,expiresIn:n=3600,unsignableHeaders:l,unhoistableHeaders:c,signableHeaders:d,hoistableHeaders:f,signingRegion:m,signingService:w}=t,E=await this.credentialProvider();this.validateResolvedCredentials(E);let S=m??await this.regionProvider(),{longDate:_,shortDate:A}=this.formatDate(i);if(n>ms)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let I=We(A,S,w??this.service),P=ws(Ot(r),{unhoistableHeaders:c,hoistableHeaders:f});if(E.sessionToken)P.query[Xt]=E.sessionToken;P.query[ts]=Ke,P.query[rs]=`${E.accessKeyId}/${I}`,P.query[Vt]=_,P.query[is]=n.toString(10);let V=zt(P,l,d);return P.query[ss]=this.getCanonicalHeaderList(V),P.query[Bt]=await this.getSignature(_,I,this.getSigningKey(E,S,A,w),this.createCanonicalRequest(P,V,await Je(r,this.sha256))),P}async sign(r,t){if(typeof r==="string")return this.signString(r,t);else if(r.headers&&r.payload)return this.signEvent(r,t);else if(r.message)return this.signMessage(r,t);else return this.signRequest(r,t)}async signEvent({headers:r,payload:t},{signingDate:i=new Date,priorSignature:n,signingRegion:l,signingService:c,eventStreamCredentials:d}){let f=l??await this.regionProvider(),{shortDate:m,longDate:w}=this.formatDate(i),E=We(m,f,c??this.service),S=await Je({headers:{},body:t},this.sha256),_=new this.sha256;_.update(r);let A=Q.toHex(await _.digest()),I=[ds,w,E,n,A,S].join(`
20
20
  `);return this.signString(I,{signingDate:i,signingRegion:f,signingService:c,eventStreamCredentials:d})}async signMessage(r,{signingDate:t=new Date,signingRegion:i,signingService:n,eventStreamCredentials:l}){return this.signEvent({headers:this.headerFormatter.format(r.message.headers),payload:r.message.body},{signingDate:t,signingRegion:i,signingService:n,priorSignature:r.priorSignature,eventStreamCredentials:l}).then((d)=>{return{message:r.message,signature:d}})}async signString(r,{signingDate:t=new Date,signingRegion:i,signingService:n,eventStreamCredentials:l}={}){let c=l??await this.credentialProvider();this.validateResolvedCredentials(c);let d=i??await this.regionProvider(),{shortDate:f}=this.formatDate(t),m=new this.sha256(await this.getSigningKey(c,d,f,n));return m.update(Q.toUint8Array(r)),Q.toHex(await m.digest())}async signRequest(r,{signingDate:t=new Date,signableHeaders:i,unsignableHeaders:n,signingRegion:l,signingService:c}={}){let d=await this.credentialProvider();this.validateResolvedCredentials(d);let f=l??await this.regionProvider(),m=Ot(r),{longDate:w,shortDate:E}=this.formatDate(t),S=We(E,f,c??this.service);if(m.headers[Ft]=w,d.sessionToken)m.headers[cs]=d.sessionToken;let _=await Je(m,this.sha256);if(!xs(je,m.headers)&&this.applyChecksum)m.headers[je]=_;let A=zt(m,n,i),I=await this.getSignature(w,S,this.getSigningKey(d,f,E,c),this.createCanonicalRequest(m,A,_));return m.headers[vt]=`${Ke} Credential=${d.accessKeyId}/${S}, SignedHeaders=${this.getCanonicalHeaderList(A)}, Signature=${I}`,m}async getSignature(r,t,i,n){let l=await this.createStringToSign(r,t,n,Ke),c=new this.sha256(await i);return c.update(Q.toUint8Array(l)),Q.toHex(await c.digest())}getSigningKey(r,t,i,n){return ys(this.sha256,r,i,t,n||this.service)}}var Yn={SignatureV4a:null};Zn.ALGORITHM_IDENTIFIER=Ke;Zn.ALGORITHM_IDENTIFIER_V4A=Gn;Zn.ALGORITHM_QUERY_PARAM=ts;Zn.ALWAYS_UNSIGNABLE_HEADERS=hs;Zn.AMZ_DATE_HEADER=Ft;Zn.AMZ_DATE_QUERY_PARAM=Vt;Zn.AUTH_HEADER=vt;Zn.CREDENTIAL_QUERY_PARAM=rs;Zn.DATE_HEADER=ns;Zn.EVENT_ALGORITHM_IDENTIFIER=ds;Zn.EXPIRES_QUERY_PARAM=is;Zn.GENERATED_HEADERS=os;Zn.HOST_HEADER=Qn;Zn.KEY_TYPE_IDENTIFIER=Ht;Zn.MAX_CACHE_SIZE=fs;Zn.MAX_PRESIGNED_TTL=ms;Zn.PROXY_HEADER_PATTERN=ls;Zn.REGION_SET_PARAM=qn;Zn.SEC_HEADER_PATTERN=us;Zn.SHA256_HEADER=je;Zn.SIGNATURE_HEADER=as;Zn.SIGNATURE_QUERY_PARAM=Bt;Zn.SIGNED_HEADERS_QUERY_PARAM=ss;Zn.SignatureV4=Es;Zn.SignatureV4Base=qt;Zn.TOKEN_HEADER=cs;Zn.TOKEN_QUERY_PARAM=Xt;Zn.UNSIGNABLE_PATTERNS=Kn;Zn.UNSIGNED_PAYLOAD=ps;Zn.clearCredentialCache=jn;Zn.createScope=We;Zn.getCanonicalHeaders=zt;Zn.getCanonicalQuery=gs;Zn.getPayloadHash=Je;Zn.getSigningKey=ys;Zn.hasHeader=xs;Zn.moveHeadersToQuery=ws;Zn.prepareRequest=Ot;Zn.signatureV4aContainer=Yn});
21
- export{Bo as Ge,br as He,Dr as Ie,Fn as Je};
21
+ export{Bo as He,br as Ie,Dr as Je,Fn as Ke};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{uf as BX}from"./chunk-fs1vb39f.js";import{Ap as _,Bp as qQ,Cp as MQ,Dp as s,Hp as EQ,Io as p,Ko as mQ,Oo as UQ,Po as ZQ,Yo as r,ap as gQ,bp as cQ,gp as AQ,hp as zQ,jp as O,mp as f,tp as i,up as l,yp as u,zp as yQ}from"./chunk-wm9nh9nb.js";import{Jp as QQ,Up as uQ,Wp as YQ}from"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import{Kt as Q}from"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import{tO as wX}from"./chunk-e0vrxetq.js";var dQ=wX(BX(),1);function wQ(X){var Y,L,Z,K;if(X==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let U=(Y=X.promptTokenCount)!=null?Y:0,R=(L=X.candidatesTokenCount)!=null?L:0,N=(Z=X.cachedContentTokenCount)!=null?Z:0,z=(K=X.thoughtsTokenCount)!=null?K:0;return{inputTokens:{total:U,noCache:U-N,cacheRead:N,cacheWrite:void 0},outputTokens:{total:R+z,text:R,reasoning:z},raw:X}}function g(X,Y=!0){if(X==null)return;if(iQ(X)){if(Y)return;if(typeof X==="object"&&X.description)return{type:"object",description:X.description};return{type:"object"}}if(typeof X==="boolean")return{type:"boolean",properties:{}};let{type:L,description:Z,required:K,properties:U,items:R,allOf:N,anyOf:z,oneOf:D,format:A,const:V,minLength:W,enum:B}=X,E={};if(Z)E.description=Z;if(K)E.required=K;if(A)E.format=A;if(V!==void 0)E.enum=[V];if(L)if(Array.isArray(L)){let J=L.includes("null"),j=L.filter((w)=>w!=="null");if(j.length===0)E.type="null";else if(E.anyOf=j.map((w)=>({type:w})),J)E.nullable=!0}else E.type=L;if(B!==void 0)E.enum=B;if(U!=null)E.properties=Object.entries(U).reduce((J,[j,w])=>{return J[j]=g(w,!1),J},{});if(R)E.items=Array.isArray(R)?R.map((J)=>g(J,!1)):g(R,!1);if(N)E.allOf=N.map((J)=>g(J,!1));if(z)if(z.some((J)=>typeof J==="object"&&(J==null?void 0:J.type)==="null")){let J=z.filter((j)=>!(typeof j==="object"&&(j==null?void 0:j.type)==="null"));if(J.length===1){let j=g(J[0],!1);if(typeof j==="object")E.nullable=!0,Object.assign(E,j)}else E.anyOf=J.map((j)=>g(j,!1)),E.nullable=!0}else E.anyOf=z.map((J)=>g(J,!1));if(D)E.oneOf=D.map((J)=>g(J,!1));if(W!==void 0)E.minLength=W;return E}function iQ(X){return X!=null&&typeof X==="object"&&X.type==="object"&&(X.properties==null||Object.keys(X.properties).length===0)&&!X.additionalProperties}var lQ=/^data:([^;,]+);base64,(.+)$/s;function sQ(X){let Y=lQ.exec(X);if(Y==null)return;return{mediaType:Y[1],data:Y[2]}}function nQ(X){let Y=sQ(X);if(Y==null)return;return{inlineData:{mimeType:Y.mediaType,data:Y.data}}}function aQ(X,Y,L){let Z=[],K=[];for(let U of L)switch(U.type){case"text":{K.push(U.text);break}case"image-data":case"file-data":{Z.push({inlineData:{mimeType:U.mediaType,data:U.data}});break}case"image-url":case"file-url":{let R=nQ(U.url);if(R!=null)Z.push(R);else K.push(JSON.stringify(U));break}default:{K.push(JSON.stringify(U));break}}X.push({functionResponse:{name:Y,response:{name:Y,content:K.length>0?K.join(`
2
+ import{vf as BX}from"./chunk-9zy5tsry.js";import{Aq as s,Eq as EQ,Fp as p,Hp as mQ,Lp as UQ,Mp as ZQ,Vp as r,Zp as gQ,_p as cQ,dq as AQ,eq as zQ,gq as O,jq as f,qq as i,rq as l,vq as u,wq as yQ,xq as _,yq as qQ,zq as MQ}from"./chunk-yce8ph5b.js";import{Gq as QQ,Rq as uQ,Tq as YQ}from"./chunk-kec1xw1n.js";import"./chunk-cqtkxwd8.js";import"./chunk-x50adh71.js";import{Hu as Q}from"./chunk-q4mtwv1w.js";import"./chunk-7a3txs9f.js";import{qP as wX}from"./chunk-djfrkbd5.js";var dQ=wX(BX(),1);function wQ(X){var Y,L,Z,K;if(X==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let U=(Y=X.promptTokenCount)!=null?Y:0,R=(L=X.candidatesTokenCount)!=null?L:0,N=(Z=X.cachedContentTokenCount)!=null?Z:0,z=(K=X.thoughtsTokenCount)!=null?K:0;return{inputTokens:{total:U,noCache:U-N,cacheRead:N,cacheWrite:void 0},outputTokens:{total:R+z,text:R,reasoning:z},raw:X}}function g(X,Y=!0){if(X==null)return;if(iQ(X)){if(Y)return;if(typeof X==="object"&&X.description)return{type:"object",description:X.description};return{type:"object"}}if(typeof X==="boolean")return{type:"boolean",properties:{}};let{type:L,description:Z,required:K,properties:U,items:R,allOf:N,anyOf:z,oneOf:D,format:A,const:V,minLength:W,enum:B}=X,E={};if(Z)E.description=Z;if(K)E.required=K;if(A)E.format=A;if(V!==void 0)E.enum=[V];if(L)if(Array.isArray(L)){let J=L.includes("null"),j=L.filter((w)=>w!=="null");if(j.length===0)E.type="null";else if(E.anyOf=j.map((w)=>({type:w})),J)E.nullable=!0}else E.type=L;if(B!==void 0)E.enum=B;if(U!=null)E.properties=Object.entries(U).reduce((J,[j,w])=>{return J[j]=g(w,!1),J},{});if(R)E.items=Array.isArray(R)?R.map((J)=>g(J,!1)):g(R,!1);if(N)E.allOf=N.map((J)=>g(J,!1));if(z)if(z.some((J)=>typeof J==="object"&&(J==null?void 0:J.type)==="null")){let J=z.filter((j)=>!(typeof j==="object"&&(j==null?void 0:j.type)==="null"));if(J.length===1){let j=g(J[0],!1);if(typeof j==="object")E.nullable=!0,Object.assign(E,j)}else E.anyOf=J.map((j)=>g(j,!1)),E.nullable=!0}else E.anyOf=z.map((J)=>g(J,!1));if(D)E.oneOf=D.map((J)=>g(J,!1));if(W!==void 0)E.minLength=W;return E}function iQ(X){return X!=null&&typeof X==="object"&&X.type==="object"&&(X.properties==null||Object.keys(X.properties).length===0)&&!X.additionalProperties}var lQ=/^data:([^;,]+);base64,(.+)$/s;function sQ(X){let Y=lQ.exec(X);if(Y==null)return;return{mediaType:Y[1],data:Y[2]}}function nQ(X){let Y=sQ(X);if(Y==null)return;return{inlineData:{mimeType:Y.mediaType,data:Y.data}}}function aQ(X,Y,L){let Z=[],K=[];for(let U of L)switch(U.type){case"text":{K.push(U.text);break}case"image-data":case"file-data":{Z.push({inlineData:{mimeType:U.mediaType,data:U.data}});break}case"image-url":case"file-url":{let R=nQ(U.url);if(R!=null)Z.push(R);else K.push(JSON.stringify(U));break}default:{K.push(JSON.stringify(U));break}}X.push({functionResponse:{name:Y,response:{name:Y,content:K.length>0?K.join(`
3
3
  `):"Tool executed successfully."},...Z.length>0?{parts:Z}:{}}})}function rQ(X,Y,L){for(let Z of L)switch(Z.type){case"text":X.push({functionResponse:{name:Y,response:{name:Y,content:Z.text}}});break;case"image-data":X.push({inlineData:{mimeType:String(Z.mediaType),data:String(Z.data)}},{text:"Tool executed successfully and returned this image as a response"});break;default:X.push({text:JSON.stringify(Z)});break}}function tQ(X,Y){var L,Z,K,U,R,N,z,D;let A=[],V=[],W=!0,B=(L=Y==null?void 0:Y.isGemmaModel)!=null?L:!1,E=(Z=Y==null?void 0:Y.providerOptionsName)!=null?Z:"google",J=(K=Y==null?void 0:Y.supportsFunctionResponseParts)!=null?K:!0;for(let{role:j,content:w}of X)switch(j){case"system":{if(!W)throw new YQ({functionality:"system messages are only supported at the beginning of the conversation"});A.push({text:w});break}case"user":{W=!1;let q=[];for(let F of w)switch(F.type){case"text":{q.push({text:F.text});break}case"file":{let b=F.mediaType==="image/*"?"image/jpeg":F.mediaType;q.push(F.data instanceof URL?{fileData:{mimeType:b,fileUri:F.data.toString()}}:{inlineData:{mimeType:b,data:ZQ(F.data)}});break}}V.push({role:"user",parts:q});break}case"assistant":{W=!1,V.push({role:"model",parts:w.map((q)=>{var F,b,S,y;let $=(y=(F=q.providerOptions)==null?void 0:F[E])!=null?y:E!=="google"?(b=q.providerOptions)==null?void 0:b.google:(S=q.providerOptions)==null?void 0:S.vertex,P=($==null?void 0:$.thoughtSignature)!=null?String($.thoughtSignature):void 0;switch(q.type){case"text":return q.text.length===0?void 0:{text:q.text,thoughtSignature:P};case"reasoning":return q.text.length===0?void 0:{text:q.text,thought:!0,thoughtSignature:P};case"file":{if(q.data instanceof URL)throw new YQ({functionality:"File data URLs in assistant messages are not supported"});return{inlineData:{mimeType:q.mediaType,data:ZQ(q.data)},...($==null?void 0:$.thought)===!0?{thought:!0}:{},thoughtSignature:P}}case"tool-call":{let x=($==null?void 0:$.serverToolCallId)!=null?String($.serverToolCallId):void 0,k=($==null?void 0:$.serverToolType)!=null?String($.serverToolType):void 0;if(x&&k)return{toolCall:{toolType:k,args:typeof q.input==="string"?JSON.parse(q.input):q.input,id:x},thoughtSignature:P};return{functionCall:{name:q.toolName,args:q.input},thoughtSignature:P}}case"tool-result":{let x=($==null?void 0:$.serverToolCallId)!=null?String($.serverToolCallId):void 0,k=($==null?void 0:$.serverToolType)!=null?String($.serverToolType):void 0;if(x&&k)return{toolResponse:{toolType:k,response:q.output.type==="json"?q.output.value:{},id:x},thoughtSignature:P};return}}}).filter((q)=>q!==void 0)});break}case"tool":{W=!1;let q=[];for(let F of w){if(F.type==="tool-approval-response")continue;let b=(z=(U=F.providerOptions)==null?void 0:U[E])!=null?z:E!=="google"?(R=F.providerOptions)==null?void 0:R.google:(N=F.providerOptions)==null?void 0:N.vertex,S=(b==null?void 0:b.serverToolCallId)!=null?String(b.serverToolCallId):void 0,y=(b==null?void 0:b.serverToolType)!=null?String(b.serverToolType):void 0;if(S&&y){let P=(b==null?void 0:b.thoughtSignature)!=null?String(b.thoughtSignature):void 0;if(V.length>0){let x=V[V.length-1];if(x.role==="model"){x.parts.push({toolResponse:{toolType:y,response:F.output.type==="json"?F.output.value:{},id:S},thoughtSignature:P});continue}}}let $=F.output;if($.type==="content")if(J)aQ(q,F.toolName,$.value);else rQ(q,F.toolName,$.value);else q.push({functionResponse:{name:F.toolName,response:{name:F.toolName,content:$.type==="execution-denied"?(D=$.reason)!=null?D:"Tool execution denied.":$.value}}})}V.push({role:"user",parts:q});break}}if(B&&A.length>0&&V.length>0&&V[0].role==="user"){let j=A.map((w)=>w.text).join(`
4
4
 
5
5
  `);V[0].parts.unshift({text:j+`
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{h as R}from"./chunk-33ebjca6.js";import{be as g}from"./chunk-f4mnp6xd.js";import{eg as z}from"./chunk-bwadggys.js";import"./chunk-h4hs2rhf.js";import{Ch as F}from"./chunk-he9kpk9r.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import"./chunk-qq9m8fxv.js";import"./chunk-2qm46qvn.js";import"./chunk-tsmj98yf.js";import"./chunk-58f4y4b7.js";import"./chunk-rmsqb6r4.js";import"./chunk-qxdpgdfk.js";import"./chunk-6qwk6z87.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import{Ao as m,Bo as E,Ho as C,zo as n}from"./chunk-37cbrnke.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-9009v4d0.js";import"./chunk-82xrfk5x.js";import"./chunk-wqk1v8t0.js";import"./chunk-vkjqy92f.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import{ds as h}from"./chunk-6yhn9syz.js";import"./chunk-wb05bp10.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import{it as A,lt as b}from"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import{fH as K}from"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import{yO as B,zO as T}from"./chunk-e0vrxetq.js";import L from"fs/promises";import y from"path";function p(J){return K.promise(async()=>{try{return{ok:!0,value:await J()}}catch(O){return{ok:!1,err:O}}})}var H=["free","fast","economical","adaptive","planner","repair","max-int","orchestrated"],o="adaptive",N=y.join(b.Path.data,"batches.json"),i=100;function u(J){if(!Array.isArray(J))return[];let O=[];for(let V of J){if(!V||typeof V!=="object"||Array.isArray(V))continue;let Q=V,W=typeof Q.batchId==="string"?Q.batchId.trim():"";if(!W)continue;let $=Q.tier;if(typeof $!=="string"||!H.includes($))continue;O.push({batchId:W,tier:$,submittedAt:typeof Q.submittedAt==="string"?Q.submittedAt:"",requestCount:typeof Q.requestCount==="number"?Q.requestCount:void 0})}return O}async function l(){try{return u(JSON.parse(await L.readFile(N,"utf8")))}catch{return[]}}async function d(J){try{let O=[];try{const G=B(O,await A.acquire(`batch-index:${N}`),1);let M=(await l()).filter((X)=>X.batchId!==J.batchId);let S=[J,...M].slice(0,i);await L.mkdir(y.dirname(N),{recursive:!0});let P=`${N}.${process.pid}.tmp`;await L.writeFile(P,JSON.stringify(S,null,2)+`
2
+ import{h as R}from"./chunk-c8yc8qcd.js";import{ce as g}from"./chunk-rk21wv4k.js";import{$f as z}from"./chunk-xvvt886p.js";import"./chunk-f6vy70p6.js";import{xh as F}from"./chunk-c1c8ch3g.js";import"./chunk-ajnzv5jt.js";import"./chunk-dz3kcsb6.js";import"./chunk-pwsajn96.js";import"./chunk-hgm8yfcb.js";import"./chunk-7rbg6mg9.js";import"./chunk-mp1x10t5.js";import"./chunk-s27cz24e.js";import"./chunk-gx4v8z64.js";import"./chunk-v03xq38e.js";import"./chunk-dx7rexx3.js";import"./chunk-xgf4k9q7.js";import"./chunk-dnjyepb2.js";import"./chunk-8gpjmj42.js";import"./chunk-atacnspd.js";import"./chunk-qdafm7qg.js";import"./chunk-r81w6skn.js";import"./chunk-ge7csm6m.js";import"./chunk-d0dsgxk4.js";import"./chunk-1q10jyka.js";import{qp as n,rp as m,sp as E,yp as C}from"./chunk-wh2qqhep.js";import"./chunk-vy93mn7d.js";import"./chunk-yce8ph5b.js";import"./chunk-kec1xw1n.js";import"./chunk-cqtkxwd8.js";import"./chunk-x50adh71.js";import"./chunk-ngyv4fhn.js";import"./chunk-nq4x6792.js";import"./chunk-f17se3hh.js";import"./chunk-2y5bthrp.js";import"./chunk-7hdb1fhq.js";import"./chunk-xnxw5zz9.js";import"./chunk-gq3zb4wv.js";import"./chunk-2cvwrabw.js";import"./chunk-4sa9t0vx.js";import"./chunk-g52wmt1v.js";import"./chunk-9d0exvey.js";import"./chunk-h2p984qb.js";import"./chunk-qm9fm5ja.js";import"./chunk-z0m1qm7j.js";import"./chunk-wd2xmkdp.js";import{at as h}from"./chunk-8peby2d1.js";import"./chunk-azss4acq.js";import"./chunk-0bhzhh7s.js";import"./chunk-7s0nq2aa.js";import{fu as A,iu as b}from"./chunk-cxtwavyf.js";import"./chunk-15bjhfav.js";import"./chunk-q4mtwv1w.js";import"./chunk-7a3txs9f.js";import"./chunk-x308f9j4.js";import{cI as K}from"./chunk-2zjet9tx.js";import"./chunk-mn5cacf6.js";import"./chunk-9pj10pgd.js";import{vP as B,wP as T}from"./chunk-djfrkbd5.js";import L from"fs/promises";import y from"path";function p(J){return K.promise(async()=>{try{return{ok:!0,value:await J()}}catch(O){return{ok:!1,err:O}}})}var H=["free","fast","economical","adaptive","planner","repair","max-int","orchestrated"],o="adaptive",N=y.join(b.Path.data,"batches.json"),i=100;function u(J){if(!Array.isArray(J))return[];let O=[];for(let V of J){if(!V||typeof V!=="object"||Array.isArray(V))continue;let Q=V,W=typeof Q.batchId==="string"?Q.batchId.trim():"";if(!W)continue;let $=Q.tier;if(typeof $!=="string"||!H.includes($))continue;O.push({batchId:W,tier:$,submittedAt:typeof Q.submittedAt==="string"?Q.submittedAt:"",requestCount:typeof Q.requestCount==="number"?Q.requestCount:void 0})}return O}async function l(){try{return u(JSON.parse(await L.readFile(N,"utf8")))}catch{return[]}}async function d(J){try{let O=[];try{const G=B(O,await A.acquire(`batch-index:${N}`),1);let M=(await l()).filter((X)=>X.batchId!==J.batchId);let S=[J,...M].slice(0,i);await L.mkdir(y.dirname(N),{recursive:!0});let P=`${N}.${process.pid}.tmp`;await L.writeFile(P,JSON.stringify(S,null,2)+`
3
3
  `,"utf8");await L.rename(P,N).catch(async(X)=>{throw await L.rm(P,{force:!0}).catch(()=>{}),X})}catch(V){var Q=V,W=1}finally{var $=T(O,Q,W);$&&await $}}catch{}}function f(J){if(J instanceof n)return"Your QitQode sign-in has ended and couldn't be renewed automatically. Run `qitqode auth login` to sign in again.";if(J instanceof m)return J.message+h.copy().insufficientBalanceCliSuffix;if(J instanceof E)return J.message;return"Request failed: "+(J instanceof Error?J.message:String(J))}var U=(J,O=o)=>K.gen(function*(){if((yield*R())==="revoked")return;let V=yield*K.promise(async()=>{try{return{ok:!0,content:await L.readFile(y.resolve(J),"utf8")}}catch(v){let Y=v;return{ok:!1,message:`Cannot read '${J}': ${Y.message??String(Y)}`}}});if(!V.ok){yield*K.sync(()=>z.println(z.Style.TEXT_DANGER+V.message+z.Style.TEXT_NORMAL));return}let Q=[],W=V.content.split(`
4
4
  `);for(let v=0;v<W.length;v++){let Y=W[v];if(!Y||!Y.trim())continue;let Z=v+1,j;try{j=JSON.parse(Y)}catch{yield*K.sync(()=>z.println(z.Style.TEXT_DANGER+`Error: line ${Z} is not valid JSON.`+z.Style.TEXT_NORMAL));return}if(typeof j!=="object"||j===null||Array.isArray(j)){yield*K.sync(()=>z.println(z.Style.TEXT_DANGER+`Error: line ${Z} must be a JSON object (got ${j===null?"null":Array.isArray(j)?"array":typeof j}).`+z.Style.TEXT_NORMAL));return}let x=j;if(typeof x.prompt!=="string"||!x.prompt.trim()){yield*K.sync(()=>z.println(z.Style.TEXT_DANGER+`Error: line ${Z} must have a non-empty string 'prompt' field.`+z.Style.TEXT_NORMAL));return}if(x.options!==void 0){yield*K.sync(()=>z.println(z.Style.TEXT_DANGER+`Error: line ${Z} has an 'options' field, which batch jobs cannot honour \u2014 `+"per-request settings are not part of the batch API. Remove it, or run these prompts individually with `qitqode run`."+z.Style.TEXT_NORMAL));return}Q.push(x.prompt)}if(Q.length===0){yield*K.sync(()=>z.println(z.Style.TEXT_WARNING+"No prompts found in the file."+z.Style.TEXT_NORMAL));return}yield*K.sync(()=>z.println(z.Style.TEXT_DIM+`Submitting ${Q.length} request${Q.length===1?"":"s"}\u2026`+z.Style.TEXT_NORMAL));let $=yield*p(()=>C.resolveSubmitBatch({tier:O,requests:Q}));if(!$.ok){yield*K.sync(()=>z.println(z.Style.TEXT_DANGER+f($.err)+z.Style.TEXT_NORMAL));return}let{batchId:G,status:M,createdAt:S,totalCount:P,requestCount:X,supported:w}=$.value;if(w===!1||!G){yield*K.sync(()=>{z.println(z.Style.TEXT_WARNING+`The ${O} tier does not run batch jobs, so nothing was submitted.`+z.Style.TEXT_NORMAL),z.println(z.Style.TEXT_DIM+"Batching is a capability of the provider behind a tier. Try another tier with `qitqode batch submit <file> --tier <name>`."+z.Style.TEXT_NORMAL)}),process.exitCode=1;return}let q=X??P;yield*K.promise(()=>d({batchId:G,tier:O,submittedAt:new Date().toISOString(),...q!==void 0?{requestCount:q}:{}})),process.stdout.write(G+`
5
5
  `),yield*K.sync(()=>{if(z.println(z.Style.TEXT_SUCCESS+"Batch submitted."+z.Style.TEXT_NORMAL),z.println(" ID: "+z.Style.TEXT_HIGHLIGHT_BOLD+G+z.Style.TEXT_NORMAL),z.println(" Tier: "+O),M)z.println(" Status: "+M);if(q!==void 0)z.println(" Requests: "+q);if(S)z.println(" Created: "+z.Style.TEXT_DIM+new Date(S).toLocaleString()+z.Style.TEXT_NORMAL);z.println(`
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{bs as _}from"./chunk-0tm6589k.js";import{mt as h}from"./chunk-6p6m5956.js";import{vO as X,xO as L}from"./chunk-e0vrxetq.js";var E={};X(E,{println:()=>g,print:()=>a,markdown:()=>G,logo:()=>I,input:()=>w,error:()=>A,empty:()=>D,UI:()=>E,Style:()=>m,CancelledError:()=>N});import{EOL as x}from"os";var T={left:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551 "," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D "],right:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"]},R={left:[" "," ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 "],right:[" "," ","\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"]};var O=["\u2800 ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"],N=_.create("UICancelledError",h.void()),m={TEXT_HIGHLIGHT:"\x1B[96m",TEXT_HIGHLIGHT_BOLD:"\x1B[96m\x1B[1m",TEXT_DIM:"\x1B[90m",TEXT_DIM_BOLD:"\x1B[90m\x1B[1m",TEXT_NORMAL:"\x1B[0m",TEXT_NORMAL_BOLD:"\x1B[1m",TEXT_WARNING:"\x1B[93m",TEXT_WARNING_BOLD:"\x1B[93m\x1B[1m",TEXT_DANGER:"\x1B[91m",TEXT_DANGER_BOLD:"\x1B[91m\x1B[1m",TEXT_SUCCESS:"\x1B[92m",TEXT_SUCCESS_BOLD:"\x1B[92m\x1B[1m",TEXT_INFO:"\x1B[94m",TEXT_INFO_BOLD:"\x1B[94m\x1B[1m"};function g(...r){a(...r),process.stderr.write(x)}function a(...r){f=!1,process.stderr.write(r.join(" "))}var f=!1;function D(){if(f)return;g(""+m.TEXT_NORMAL),f=!0}function I(r){if(!process.stdout.isTTY&&!process.stderr.isTTY){let o=[];for(let s of O){if(r)o.push(r);o.push(s),o.push(x)}return o.join("").trimEnd()}let n=[],t="\x1B[0m",i={fg:"\x1B[90m",shadow:"\x1B[38;5;235m",bg:"\x1B[48;5;235m"},c={fg:t,shadow:"\x1B[38;5;238m",bg:"\x1B[48;5;238m"},d=" ",b=(o,s,u,l)=>{let e=[];for(let p of o){if(p==="_"){e.push(l," ",t);continue}if(p==="^"){e.push(s,l,"\u2580",t);continue}if(p==="~"){e.push(u,"\u2580",t);continue}if(p===" "){e.push(" ");continue}e.push(s,p,t)}return e.join("")};return T.left.forEach((o,s)=>{if(r)n.push(r);n.push(b(o,i.fg,i.shadow,i.bg)),n.push(d);let u=T.right[s]??"";n.push(b(u,c.fg,c.shadow,c.bg)),n.push(x)}),n.join("").trimEnd()}async function w(r){let t=L("readline").createInterface({input:process.stdin,output:process.stdout});return new Promise((i)=>{t.question(r,(c)=>{t.close(),i(c.trim())})})}function A(r){if(r.startsWith("Error: "))r=r.slice(7);g(m.TEXT_DANGER_BOLD+"Error: "+m.TEXT_NORMAL+r)}function G(r){return r}
3
- export{T as cg,R as dg,E as eg};
2
+ import{_s as _}from"./chunk-wd2xmkdp.js";import{ju as h}from"./chunk-15bjhfav.js";import{sP as X,uP as L}from"./chunk-djfrkbd5.js";var E={};X(E,{println:()=>g,print:()=>a,markdown:()=>G,logo:()=>I,input:()=>w,error:()=>A,empty:()=>D,UI:()=>E,Style:()=>m,CancelledError:()=>N});import{EOL as x}from"os";var T={left:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551 "," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D "],right:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"]},R={left:[" "," ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 "],right:[" "," ","\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"]};var O=["\u2800 ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"],N=_.create("UICancelledError",h.void()),m={TEXT_HIGHLIGHT:"\x1B[96m",TEXT_HIGHLIGHT_BOLD:"\x1B[96m\x1B[1m",TEXT_DIM:"\x1B[90m",TEXT_DIM_BOLD:"\x1B[90m\x1B[1m",TEXT_NORMAL:"\x1B[0m",TEXT_NORMAL_BOLD:"\x1B[1m",TEXT_WARNING:"\x1B[93m",TEXT_WARNING_BOLD:"\x1B[93m\x1B[1m",TEXT_DANGER:"\x1B[91m",TEXT_DANGER_BOLD:"\x1B[91m\x1B[1m",TEXT_SUCCESS:"\x1B[92m",TEXT_SUCCESS_BOLD:"\x1B[92m\x1B[1m",TEXT_INFO:"\x1B[94m",TEXT_INFO_BOLD:"\x1B[94m\x1B[1m"};function g(...r){a(...r),process.stderr.write(x)}function a(...r){f=!1,process.stderr.write(r.join(" "))}var f=!1;function D(){if(f)return;g(""+m.TEXT_NORMAL),f=!0}function I(r){if(!process.stdout.isTTY&&!process.stderr.isTTY){let o=[];for(let s of O){if(r)o.push(r);o.push(s),o.push(x)}return o.join("").trimEnd()}let n=[],t="\x1B[0m",i={fg:"\x1B[90m",shadow:"\x1B[38;5;235m",bg:"\x1B[48;5;235m"},c={fg:t,shadow:"\x1B[38;5;238m",bg:"\x1B[48;5;238m"},d=" ",b=(o,s,u,l)=>{let e=[];for(let p of o){if(p==="_"){e.push(l," ",t);continue}if(p==="^"){e.push(s,l,"\u2580",t);continue}if(p==="~"){e.push(u,"\u2580",t);continue}if(p===" "){e.push(" ");continue}e.push(s,p,t)}return e.join("")};return T.left.forEach((o,s)=>{if(r)n.push(r);n.push(b(o,i.fg,i.shadow,i.bg)),n.push(d);let u=T.right[s]??"";n.push(b(u,c.fg,c.shadow,c.bg)),n.push(x)}),n.join("").trimEnd()}async function w(r){let t=L("readline").createInterface({input:process.stdin,output:process.stdout});return new Promise((i)=>{t.question(r,(c)=>{t.close(),i(c.trim())})})}function A(r){if(r.startsWith("Error: "))r=r.slice(7);g(m.TEXT_DANGER_BOLD+"Error: "+m.TEXT_NORMAL+r)}function G(r){return r}
3
+ export{T as Zf,R as _f,E as $f};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{a as $B,b as zB}from"./chunk-bnaj2hh3.js";import"./chunk-33ebjca6.js";import"./chunk-0z1keh2w.js";import{B as XB}from"./chunk-gsez13bg.js";import{C as JB,E as VB}from"./chunk-c8k32724.js";import"./chunk-c3yjbent.js";import{Y as YB,Z as ZB}from"./chunk-nr2j8ytn.js";import"./chunk-2kh0tg92.js";import"./chunk-52xvhxek.js";import{be as BB}from"./chunk-f4mnp6xd.js";import{$f as O,Zf as g,_f as w,ag as i}from"./chunk-5nmm1kvx.js";import{eg as H}from"./chunk-bwadggys.js";import{Gg as r}from"./chunk-h4hs2rhf.js";import{Ch as S}from"./chunk-he9kpk9r.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import{Rj as o,Uk as e,yj as U}from"./chunk-qq9m8fxv.js";import"./chunk-2qm46qvn.js";import{Nl as T}from"./chunk-tsmj98yf.js";import"./chunk-58f4y4b7.js";import"./chunk-rmsqb6r4.js";import"./chunk-qxdpgdfk.js";import"./chunk-6qwk6z87.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import{bo as a,ho as s,wo as t}from"./chunk-37cbrnke.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-9009v4d0.js";import"./chunk-82xrfk5x.js";import"./chunk-wqk1v8t0.js";import{Hr as n}from"./chunk-vkjqy92f.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import{cs as f}from"./chunk-6yhn9syz.js";import{As as c,Bs as u,Cs as l,Es as p}from"./chunk-wb05bp10.js";import{Is as A}from"./chunk-wgkcyqn1.js";import{Rs as x}from"./chunk-59csnjc3.js";import{dt as E,ft as q}from"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import{fH as P}from"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import{xO as v}from"./chunk-e0vrxetq.js";import h from"path";import{fileURLToPath as KB}from"url";import{writeHeapSnapshot as MB}from"v8";import GB,{EOL as M}from"os";var WB={free:"free",adaptive:"adaptive",fast:"fast",economical:"economical",maxInt:"max-int",orchestrated:"orchestrated"},m=ZB;function R(B){if(B.agent)return B.agent;return m}function QB(B,V){if(h.isAbsolute(B)||B.includes("/")||B.includes("\\")||B.startsWith(".")||B.startsWith("~"))return{error:"Directory not found: "+V};return{error:`Unknown command "${B}"`,hint:"Run `qitqode --help` to see the available commands, or pass an existing directory to start the TUI there."}}function bB(B){for(let[V,X]of Object.entries(WB))if(B[V]){let Z=f[X];if(Z)return`${Z.providerID}/${Z.modelID}`}return}function jB(B){return async(X,Z)=>{let Y=new Request(X,Z),$=Y.body?await Y.text():void 0,z=await B.call("fetch",{url:Y.url,method:Y.method,headers:Object.fromEntries(Y.headers.entries()),body:$});return new Response(z.body,{status:z.status,headers:z.headers})}}function CB(B){return{subscribe:async(V)=>{return B.on("global.event",(X)=>{V(X)})}}}async function FB(){if(typeof globalThis.QITQODE_WORKER_PATH<"u")return globalThis.QITQODE_WORKER_PATH;let B=new URL("./cli/cmd/tui/worker.js",import.meta.url);if(await E(KB(B)))return B;return new URL("./worker.ts",import.meta.url)}async function _B(B){let V=process.stdin.isTTY?void 0:await Bun.stdin.text();if(!B)return V;if(!V)return B;return V+`
3
- `+B}async function d(B){let V=a({baseUrl:B.url,fetch:B.fetch,directory:B.directory}),X=[{permission:"question",action:"deny",pattern:"*"},{permission:"plan_enter",action:"deny",pattern:"*"},{permission:"plan_exit",action:"deny",pattern:"*"}],Y=(await V.session.create({permission:X})).data?.id;if(!Y){H.error("headless: failed to create session");return}let $=await V.event.subscribe(),z=YB({sessionID:Y,query:async()=>{return(await V.session.status()).data?.[Y]}}),D=$.stream[Symbol.asyncIterator](),C=z.completion.then(()=>"DONE");(async()=>{try{while(!0){let W=await Promise.race([D.next(),C]);if(W==="DONE")break;let N=W;if(N.done)break;let G=N.value;z.onEvent(G);let K=G.properties;if(G.type==="message.part.updated"){let J=K?.part;if(!J||J.sessionID!==Y)continue;if(J.type==="text"&&J.time?.end){let F=String(J.text??"").trim();if(F)process.stdout.write(F+M)}}if(G.type==="permission.asked"){if(!K||K.sessionID!==Y)continue;await V.permission.reply({requestID:String(K.id),reply:"once"})}if(G.type==="session.error"){if(!K||K.sessionID!==Y||!K.error)continue;let J=K.error,F=J?.data!==null&&typeof J?.data==="object"&&"message"in J.data?String(J.data.message):String(J?.name??J);H.error(F)}}}finally{z.stop(),await D.return?.(void 0).catch(()=>{})}})().catch((W)=>{console.error(W),process.exit(1)});let y=B.model?e.parseModel(B.model):void 0;await V.session.prompt({sessionID:Y,agent:B.agent,model:y,parts:[{type:"text",text:B.prompt}]}),z.markStarted(),await z.completion}var aB=BB({command:"$0 [project]",describe:"start qitqode tui",builder:(B)=>g(B).positional("project",{type:"string",describe:"path to start qitqode in"}).options(i).option("never-ask",{type:"boolean",describe:"start in never-ask mode \u2014 auto-decide without asking (permissions excluded), toggle at runtime with /never-ask",default:!1}).check((V)=>{if(V.dark&&V.light)throw Error("--dark and --light are mutually exclusive");if(V.sso&&!V.headless)throw Error("--sso requires --headless");if(V.sso&&V["api-key"]!==void 0)throw Error("--sso and --api-key are mutually exclusive");let X=Object.keys(WB).filter((Z)=>V[Z]);if(X.length>1)throw Error(`${X.map((Z)=>`--${Z}`).join(" and ")} are mutually exclusive \u2014 choose one tier flag`);if(X.length===1&&V.model)throw Error(`--${X[0]} and --model are mutually exclusive \u2014 use one or the other`);return!0}),handler:async(B)=>{if(B.monochrome)process.env.QITQODE_TUI_ACCESSIBLE="1",process.env.NO_COLOR="1";let V=VB();try{JB();let X=XB(B);if(X){H.error(X),process.exitCode=1;return}let Z=bB(B)??B.model,Y=q(process.env.PWD??process.cwd()),$=B.project?q(h.isAbsolute(B.project)?B.project:h.join(Y,B.project)):q(process.cwd());if(B.project&&!await E($)){let J=QB(B.project,$);if(H.error(J.error),J.hint)H.println(J.hint);process.exitCode=1;return}let z=T($);if(z){if(B.project){H.error("Cannot start in "+$+": "+z),process.exitCode=1;return}let J=q(GB.homedir());if(T(J)){H.error("Cannot start in "+$+": "+z),process.exitCode=1;return}x.warn("unsafe start directory, falling back to home",{requested:$,home:J}),$=J}let D=await FB();try{process.chdir($)}catch{H.error("Failed to change directory to "+$);return}let C=q(process.cwd()),I=p({[u]:"worker",[c]:l()}),y=new Worker(D,{env:I});y.onerror=(J)=>{x.error("thread error",{message:J.message,filename:J.filename,lineno:J.lineno,colno:J.colno,error:J.error})};let W=n(y),N=()=>{W.call("reload",void 0).catch((J)=>{x.warn("worker reload failed",{error:A(J)})})};process.on("SIGUSR2",N);let G=!1,K=async()=>{if(G)return;G=!0,process.off("SIGUSR2",N),await o(W.call("shutdown",void 0),5000).catch((J)=>{x.warn("worker shutdown failed",{error:A(J)})}),y.terminate()};try{let J=import("./chunk-qn8tz704.js"),F=import("./chunk-b7ncyat6.js").then(({TuiConfig:_})=>_.get()),L=await _B(B.prompt),HB=await F;if(B.headless&&w(O(B))){H.error("--headless cannot be combined with network-listener flags (--port, --hostname, --mdns)"),process.exitCode=1;return}let k=O(B),j=w(k)?{url:(await W.call("server",k)).url,fetch:void 0,events:void 0}:{url:"http://qitqode.internal",fetch:jB(W),events:CB(W)};if(setTimeout(()=>{W.call("checkUpgrade",{directory:C}).catch(()=>{})},1000).unref?.(),B.headless){if(!L){H.error("--headless requires a prompt: pass --prompt or pipe input via stdin"),process.exitCode=1;return}if(B.sso){try{let Q=await r({tryOpen:!1,onCode:(b)=>{if(process.stdout.write(M),process.stdout.write(" To sign in, open: "+b.verificationUri+M),process.stdout.write(" and enter code: "+b.userCode+M),b.verificationUriComplete)process.stdout.write(M+" Or open this link directly:"+M+" "+b.verificationUriComplete+M);process.stdout.write(M+" Waiting for approval... (ctrl+c to cancel)"+M)}});await S.runPromise(P.gen(function*(){yield*(yield*U.Service).set("forgewise",t(Q,{rotateRefreshToken:!0}))})),process.stdout.write(" Signed in as "+(Q.name||Q.email)+M)}catch(Q){H.error("SSO sign-in failed: "+A(Q)),process.exitCode=1;return}await d({url:j.url,fetch:j.fetch,prompt:L,model:Z,agent:R(B)??m,directory:C});return}let _=$B(typeof B["api-key"]==="string"?String(B["api-key"]):"");if(_)await S.runPromise(zB(_));else if(!await S.runPromise(P.gen(function*(){if(yield*P.promise(()=>s()))return!0;return!!(yield*(yield*U.Service).get("forgewise"))}))){H.error(`Not signed in. Use one of:
2
+ import{a as $B,b as zB}from"./chunk-yzd6cyep.js";import"./chunk-c8yc8qcd.js";import"./chunk-1m78yy4k.js";import{B as XB}from"./chunk-gsez13bg.js";import{C as JB,E as VB}from"./chunk-c8k32724.js";import"./chunk-pxm0x3e0.js";import{Z as YB,_ as ZB}from"./chunk-j5z95b6f.js";import"./chunk-vbfc0wgv.js";import"./chunk-j7637cwg.js";import{ce as BB}from"./chunk-rk21wv4k.js";import{Uf as g,Vf as w,Wf as O,Xf as i}from"./chunk-pf2vq6t1.js";import{$f as H}from"./chunk-xvvt886p.js";import{Bg as r}from"./chunk-f6vy70p6.js";import{xh as S}from"./chunk-c1c8ch3g.js";import"./chunk-ajnzv5jt.js";import"./chunk-dz3kcsb6.js";import"./chunk-pwsajn96.js";import"./chunk-hgm8yfcb.js";import"./chunk-7rbg6mg9.js";import"./chunk-mp1x10t5.js";import{Mj as o,Pk as e,tj as U}from"./chunk-s27cz24e.js";import"./chunk-gx4v8z64.js";import{Il as T}from"./chunk-v03xq38e.js";import"./chunk-dx7rexx3.js";import"./chunk-xgf4k9q7.js";import"./chunk-dnjyepb2.js";import"./chunk-8gpjmj42.js";import"./chunk-atacnspd.js";import"./chunk-qdafm7qg.js";import"./chunk-r81w6skn.js";import"./chunk-ge7csm6m.js";import"./chunk-d0dsgxk4.js";import"./chunk-1q10jyka.js";import{Uo as a,_o as s,np as t}from"./chunk-wh2qqhep.js";import"./chunk-vy93mn7d.js";import"./chunk-yce8ph5b.js";import"./chunk-kec1xw1n.js";import"./chunk-cqtkxwd8.js";import"./chunk-x50adh71.js";import"./chunk-ngyv4fhn.js";import"./chunk-nq4x6792.js";import"./chunk-f17se3hh.js";import"./chunk-2y5bthrp.js";import"./chunk-7hdb1fhq.js";import"./chunk-xnxw5zz9.js";import"./chunk-gq3zb4wv.js";import"./chunk-2cvwrabw.js";import"./chunk-4sa9t0vx.js";import{Es as n}from"./chunk-g52wmt1v.js";import"./chunk-9d0exvey.js";import"./chunk-h2p984qb.js";import"./chunk-qm9fm5ja.js";import"./chunk-z0m1qm7j.js";import"./chunk-wd2xmkdp.js";import{$s as f}from"./chunk-8peby2d1.js";import{Bt as p,xt as c,yt as u,zt as l}from"./chunk-azss4acq.js";import{Ft as A}from"./chunk-0bhzhh7s.js";import{Ot as x}from"./chunk-7s0nq2aa.js";import{au as E,cu as q}from"./chunk-cxtwavyf.js";import"./chunk-15bjhfav.js";import"./chunk-q4mtwv1w.js";import"./chunk-7a3txs9f.js";import"./chunk-x308f9j4.js";import{cI as P}from"./chunk-2zjet9tx.js";import"./chunk-mn5cacf6.js";import"./chunk-9pj10pgd.js";import{uP as v}from"./chunk-djfrkbd5.js";import h from"path";import{fileURLToPath as KB}from"url";import{writeHeapSnapshot as MB}from"v8";import GB,{EOL as M}from"os";var WB={free:"free",adaptive:"adaptive",fast:"fast",economical:"economical",maxInt:"max-int",orchestrated:"orchestrated"},m=ZB;function R(B){if(B.agent)return B.agent;return m}function QB(B,V){if(h.isAbsolute(B)||B.includes("/")||B.includes("\\")||B.startsWith(".")||B.startsWith("~"))return{error:"Directory not found: "+V};return{error:`Unknown command "${B}"`,hint:"Run `qitqode --help` to see the available commands, or pass an existing directory to start the TUI there."}}function bB(B){for(let[V,X]of Object.entries(WB))if(B[V]){let Z=f[X];if(Z)return`${Z.providerID}/${Z.modelID}`}return}function jB(B){return async(X,Z)=>{let Y=new Request(X,Z),$=Y.body?await Y.text():void 0,z=await B.call("fetch",{url:Y.url,method:Y.method,headers:Object.fromEntries(Y.headers.entries()),body:$});return new Response(z.body,{status:z.status,headers:z.headers})}}function CB(B){return{subscribe:async(V)=>{return B.on("global.event",(X)=>{V(X)})}}}async function FB(){if(typeof globalThis.QITQODE_WORKER_PATH<"u")return globalThis.QITQODE_WORKER_PATH;let B=new URL("./cli/cmd/tui/worker.js",import.meta.url);if(await E(KB(B)))return B;return new URL("./worker.ts",import.meta.url)}async function _B(B){let V=process.stdin.isTTY?void 0:await Bun.stdin.text();if(!B)return V;if(!V)return B;return V+`
3
+ `+B}async function d(B){let V=a({baseUrl:B.url,fetch:B.fetch,directory:B.directory}),X=[{permission:"question",action:"deny",pattern:"*"},{permission:"plan_enter",action:"deny",pattern:"*"},{permission:"plan_exit",action:"deny",pattern:"*"}],Y=(await V.session.create({permission:X})).data?.id;if(!Y){H.error("headless: failed to create session");return}let $=await V.event.subscribe(),z=YB({sessionID:Y,query:async()=>{return(await V.session.status()).data?.[Y]}}),D=$.stream[Symbol.asyncIterator](),C=z.completion.then(()=>"DONE");(async()=>{try{while(!0){let W=await Promise.race([D.next(),C]);if(W==="DONE")break;let N=W;if(N.done)break;let G=N.value;z.onEvent(G);let K=G.properties;if(G.type==="message.part.updated"){let J=K?.part;if(!J||J.sessionID!==Y)continue;if(J.type==="text"&&J.time?.end){let F=String(J.text??"").trim();if(F)process.stdout.write(F+M)}}if(G.type==="permission.asked"){if(!K||K.sessionID!==Y)continue;await V.permission.reply({requestID:String(K.id),reply:"once"})}if(G.type==="session.error"){if(!K||K.sessionID!==Y||!K.error)continue;let J=K.error,F=J?.data!==null&&typeof J?.data==="object"&&"message"in J.data?String(J.data.message):String(J?.name??J);H.error(F)}}}finally{z.stop(),await D.return?.(void 0).catch(()=>{})}})().catch((W)=>{console.error(W),process.exit(1)});let y=B.model?e.parseModel(B.model):void 0;await V.session.prompt({sessionID:Y,agent:B.agent,model:y,parts:[{type:"text",text:B.prompt}]}),z.markStarted(),await z.completion}var aB=BB({command:"$0 [project]",describe:"start qitqode tui",builder:(B)=>g(B).positional("project",{type:"string",describe:"path to start qitqode in"}).options(i).option("never-ask",{type:"boolean",describe:"start in never-ask mode \u2014 auto-decide without asking (permissions excluded), toggle at runtime with /never-ask",default:!1}).check((V)=>{if(V.dark&&V.light)throw Error("--dark and --light are mutually exclusive");if(V.sso&&!V.headless)throw Error("--sso requires --headless");if(V.sso&&V["api-key"]!==void 0)throw Error("--sso and --api-key are mutually exclusive");let X=Object.keys(WB).filter((Z)=>V[Z]);if(X.length>1)throw Error(`${X.map((Z)=>`--${Z}`).join(" and ")} are mutually exclusive \u2014 choose one tier flag`);if(X.length===1&&V.model)throw Error(`--${X[0]} and --model are mutually exclusive \u2014 use one or the other`);return!0}),handler:async(B)=>{if(B.monochrome)process.env.QITQODE_TUI_ACCESSIBLE="1",process.env.NO_COLOR="1";let V=VB();try{JB();let X=XB(B);if(X){H.error(X),process.exitCode=1;return}let Z=bB(B)??B.model,Y=q(process.env.PWD??process.cwd()),$=B.project?q(h.isAbsolute(B.project)?B.project:h.join(Y,B.project)):q(process.cwd());if(B.project&&!await E($)){let J=QB(B.project,$);if(H.error(J.error),J.hint)H.println(J.hint);process.exitCode=1;return}let z=T($);if(z){if(B.project){H.error("Cannot start in "+$+": "+z),process.exitCode=1;return}let J=q(GB.homedir());if(T(J)){H.error("Cannot start in "+$+": "+z),process.exitCode=1;return}x.warn("unsafe start directory, falling back to home",{requested:$,home:J}),$=J}let D=await FB();try{process.chdir($)}catch{H.error("Failed to change directory to "+$);return}let C=q(process.cwd()),I=p({[u]:"worker",[c]:l()}),y=new Worker(D,{env:I});y.onerror=(J)=>{x.error("thread error",{message:J.message,filename:J.filename,lineno:J.lineno,colno:J.colno,error:J.error})};let W=n(y),N=()=>{W.call("reload",void 0).catch((J)=>{x.warn("worker reload failed",{error:A(J)})})};process.on("SIGUSR2",N);let G=!1,K=async()=>{if(G)return;G=!0,process.off("SIGUSR2",N),await o(W.call("shutdown",void 0),5000).catch((J)=>{x.warn("worker shutdown failed",{error:A(J)})}),y.terminate()};try{let J=import("./chunk-q4rstre7.js"),F=import("./chunk-k3hcb6qf.js").then(({TuiConfig:_})=>_.get()),L=await _B(B.prompt),HB=await F;if(B.headless&&w(O(B))){H.error("--headless cannot be combined with network-listener flags (--port, --hostname, --mdns)"),process.exitCode=1;return}let k=O(B),j=w(k)?{url:(await W.call("server",k)).url,fetch:void 0,events:void 0}:{url:"http://qitqode.internal",fetch:jB(W),events:CB(W)};if(setTimeout(()=>{W.call("checkUpgrade",{directory:C}).catch(()=>{})},1000).unref?.(),B.headless){if(!L){H.error("--headless requires a prompt: pass --prompt or pipe input via stdin"),process.exitCode=1;return}if(B.sso){try{let Q=await r({tryOpen:!1,onCode:(b)=>{if(process.stdout.write(M),process.stdout.write(" To sign in, open: "+b.verificationUri+M),process.stdout.write(" and enter code: "+b.userCode+M),b.verificationUriComplete)process.stdout.write(M+" Or open this link directly:"+M+" "+b.verificationUriComplete+M);process.stdout.write(M+" Waiting for approval... (ctrl+c to cancel)"+M)}});await S.runPromise(P.gen(function*(){yield*(yield*U.Service).set("forgewise",t(Q,{rotateRefreshToken:!0}))})),process.stdout.write(" Signed in as "+(Q.name||Q.email)+M)}catch(Q){H.error("SSO sign-in failed: "+A(Q)),process.exitCode=1;return}await d({url:j.url,fetch:j.fetch,prompt:L,model:Z,agent:R(B)??m,directory:C});return}let _=$B(typeof B["api-key"]==="string"?String(B["api-key"]):"");if(_)await S.runPromise(zB(_));else if(!await S.runPromise(P.gen(function*(){if(yield*P.promise(()=>s()))return!0;return!!(yield*(yield*U.Service).get("forgewise"))}))){H.error(`Not signed in. Use one of:
4
4
  qitqode auth login (browser / device-code flow)
5
5
  qitqode auth login --api-key (paste a Qortex API key)
6
6
  --api-key <key> (inline for this run)
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{Jp as k,Kp as C,Lp as t,Np as V,Qp as B,Rp as A,Sp as H,Vp as I,_p as o}from"./chunk-scnbt714.js";import{$p as w}from"./chunk-y3gy62q5.js";import{ot as f}from"./chunk-a48mx917.js";import{yy as n}from"./chunk-3va85mbe.js";function RJ(...F){return F.reduce((J,Q)=>({...J,...Q!=null?Q:{}}),{})}function NJ({tools:F=[],providerToolNames:J,resolveProviderToolName:Q}){var W;let X={},Y={};for(let Z of F)if(Z.type==="provider"){let $=(W=Q==null?void 0:Q(Z))!=null?W:(Z.id in J)?J[Z.id]:void 0;if($==null)continue;X[Z.name]=$,Y[$]=Z.name}return{toProviderToolName:(Z)=>{var $;return($=X[Z])!=null?$:Z},toCustomToolName:(Z)=>{var $;return($=Y[Z])!=null?$:Z}}}async function VJ(F,J){if(F==null)return Promise.resolve();let Q=J==null?void 0:J.abortSignal;return new Promise((W,X)=>{if(Q==null?void 0:Q.aborted){X(m());return}let Y=setTimeout(()=>{Z(),W()},F),Z=()=>{clearTimeout(Y),Q==null||Q.removeEventListener("abort",$)},$=()=>{Z(),X(m())};Q==null||Q.addEventListener("abort",$)})}function m(){return new DOMException("Delay was aborted","AbortError")}var TJ=class{constructor(){this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}get promise(){if(this._promise)return this._promise;return this._promise=new Promise((F,J)=>{if(this.status.type==="resolved")F(this.status.value);else if(this.status.type==="rejected")J(this.status.error);this._resolve=F,this._reject=J}),this._promise}resolve(F){var J;if(this.status={type:"resolved",value:F},this._promise)(J=this._resolve)==null||J.call(this,F)}reject(F){var J;if(this.status={type:"rejected",error:F},this._promise)(J=this._reject)==null||J.call(this,F)}isResolved(){return this.status.type==="resolved"}isRejected(){return this.status.type==="rejected"}isPending(){return this.status.type==="pending"}};function z(F){return Object.fromEntries([...F.headers])}var{btoa:GF,atob:CF}=globalThis;function _J(F){let J=F.replace(/-/g,"+").replace(/_/g,"/"),Q=CF(J);return Uint8Array.from(Q,(W)=>W.codePointAt(0))}function a(F){let J="";for(let Q=0;Q<F.length;Q++)J+=String.fromCodePoint(F[Q]);return GF(J)}function jJ(F){return F instanceof Uint8Array?a(F):F}function kJ(F){if(F.type==="url")return F.url;return`data:${F.mediaType};base64,${typeof F.data==="string"?F.data:a(F.data)}`}function bJ(F,J={}){let{useArrayBrackets:Q=!0}=J,W=new FormData;for(let[X,Y]of Object.entries(F)){if(Y==null)continue;if(Array.isArray(Y)){if(Y.length===1){W.append(X,Y[0]);continue}let Z=Q?`${X}[]`:X;for(let $ of Y)W.append(Z,$);continue}W.append(X,Y)}return W}var s="AI_DownloadError",r=`vercel.ai.error.${s}`,MF=Symbol.for(r),u,i,O=class extends(i=k,u=MF,i){constructor({url:F,statusCode:J,statusText:Q,cause:W,message:X=W==null?`Failed to download ${F}: ${J} ${Q}`:`Failed to download ${F}: ${W}`}){super({name:s,message:X,cause:W});this[u]=!0,this.url=F,this.statusCode=J,this.statusText=Q}static isInstance(F){return k.hasMarker(F,r)}},e=2147483648;async function KF({response:F,url:J,maxBytes:Q=e}){let W=F.headers.get("content-length");if(W!=null){let G=parseInt(W,10);if(!isNaN(G)&&G>Q)throw new O({url:J,message:`Download of ${J} exceeded maximum size of ${Q} bytes (Content-Length: ${G}).`})}let X=F.body;if(X==null)return new Uint8Array(0);let Y=X.getReader(),Z=[],$=0;try{while(!0){let{done:G,value:N}=await Y.read();if(G)break;if($+=N.length,$>Q)throw new O({url:J,message:`Download of ${J} exceeded maximum size of ${Q} bytes.`});Z.push(N)}}finally{try{await Y.cancel()}finally{Y.releaseLock()}}let U=new Uint8Array($),L=0;for(let G of Z)U.set(G,L),L+=G.length;return U}function p(F){let J;try{J=new URL(F)}catch(W){throw new O({url:F,message:`Invalid URL: ${F}`})}if(J.protocol==="data:")return;if(J.protocol!=="http:"&&J.protocol!=="https:")throw new O({url:F,message:`URL scheme must be http, https, or data, got ${J.protocol}`});let Q=J.hostname;if(!Q)throw new O({url:F,message:"URL must have a hostname"});if(Q==="localhost"||Q.endsWith(".local")||Q.endsWith(".localhost"))throw new O({url:F,message:`URL with hostname ${Q} is not allowed`});if(Q.startsWith("[")&&Q.endsWith("]")){let W=Q.slice(1,-1);if(qF(W))throw new O({url:F,message:`URL with IPv6 address ${Q} is not allowed`});return}if(FF(Q)){if(b(Q))throw new O({url:F,message:`URL with IP address ${Q} is not allowed`});return}}function FF(F){let J=F.split(".");if(J.length!==4)return!1;return J.every((Q)=>{let W=Number(Q);return Number.isInteger(W)&&W>=0&&W<=255&&String(W)===Q})}function b(F){let J=F.split(".").map(Number),[Q,W]=J;if(Q===0)return!0;if(Q===10)return!0;if(Q===127)return!0;if(Q===169&&W===254)return!0;if(Q===172&&W>=16&&W<=31)return!0;if(Q===192&&W===168)return!0;return!1}function qF(F){let J=F.toLowerCase();if(J==="::1")return!0;if(J==="::")return!0;if(J.startsWith("::ffff:")){let Q=J.slice(7);if(FF(Q))return b(Q);let W=Q.split(":");if(W.length===2){let X=parseInt(W[0],16),Y=parseInt(W[1],16);if(!isNaN(X)&&!isNaN(Y)){let Z=X>>8&255,$=X&255,U=Y>>8&255,L=Y&255;return b(`${Z}.${$}.${U}.${L}`)}}}if(J.startsWith("fc")||J.startsWith("fd"))return!0;if(J.startsWith("fe80"))return!0;return!1}async function gJ(F,J){var Q,W;p(F);try{let X=await fetch(F,{signal:J==null?void 0:J.abortSignal});if(X.redirected)p(X.url);if(!X.ok)throw new O({url:F,statusCode:X.status,statusText:X.statusText});let Y=await KF({response:X,url:F,maxBytes:(Q=J==null?void 0:J.maxBytes)!=null?Q:e}),Z=(W=X.headers.get("content-type"))!=null?W:void 0;return new Blob([Y],Z?{type:Z}:void 0)}catch(X){if(O.isInstance(X))throw X;throw new O({url:F,cause:X})}}var DF=({prefix:F,size:J=16,alphabet:Q="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:W="-"}={})=>{let X=()=>{let Y=Q.length,Z=Array(J);for(let $=0;$<J;$++)Z[$]=Q[Math.random()*Y|0];return Z.join("")};if(F==null)return X;if(Q.includes(W))throw new V({argument:"separator",message:`The separator "${W}" must not be part of the alphabet "${Q}".`});return()=>`${F}${W}${X()}`},vJ=DF();function yJ(F){if(F==null)return"unknown error";if(typeof F==="string")return F;if(F instanceof Error)return F.message;return JSON.stringify(F)}function R(F){return(F instanceof Error||F instanceof DOMException)&&(F.name==="AbortError"||F.name==="ResponseAborted"||F.name==="TimeoutError")}var OF=["fetch failed","failed to fetch"],IF=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function PF(F){if(!(F instanceof Error))return!1;let J=F.code;if(typeof J==="string"&&IF.includes(J))return!0;return!1}function JF({error:F,url:J,requestBodyValues:Q}){if(R(F))return F;if(F instanceof TypeError&&OF.includes(F.message.toLowerCase())){let W=F.cause;if(W!=null)return new C({message:`Cannot connect to API: ${W.message}`,cause:W,url:J,requestBodyValues:Q,isRetryable:!0})}if(PF(F))return new C({message:`Cannot connect to API: ${F.message}`,cause:F,url:J,requestBodyValues:Q,isRetryable:!0});return F}function QF(F=globalThis){var J,Q,W;if(F.window)return"runtime/browser";if((J=F.navigator)==null?void 0:J.userAgent)return`runtime/${F.navigator.userAgent.toLowerCase()}`;if((W=(Q=F.process)==null?void 0:Q.versions)==null?void 0:W.node)return`runtime/node.js/${F.process.version.substring(0)}`;if(F.EdgeRuntime)return"runtime/vercel-edge";return"runtime/unknown"}function zF(F){if(F==null)return{};let J={};if(F instanceof Headers)F.forEach((Q,W)=>{J[W.toLowerCase()]=Q});else{if(!Array.isArray(F))F=Object.entries(F);for(let[Q,W]of F)if(W!=null)J[Q.toLowerCase()]=W}return J}function WF(F,...J){let Q=new Headers(zF(F)),W=Q.get("user-agent")||"";return Q.set("user-agent",[W,...J].filter(Boolean).join(" ")),Object.fromEntries(Q.entries())}var XF="4.0.23",AF=()=>globalThis.fetch,uJ=async({url:F,headers:J={},successfulResponseHandler:Q,failedResponseHandler:W,abortSignal:X,fetch:Y=AF()})=>{try{let Z=await Y(F,{method:"GET",headers:WF(J,`ai-sdk/provider-utils/${XF}`,QF()),signal:X}),$=z(Z);if(!Z.ok){let U;try{U=await W({response:Z,url:F,requestBodyValues:{}})}catch(L){if(R(L)||C.isInstance(L))throw L;throw new C({message:"Failed to process error response",cause:L,statusCode:Z.status,url:F,responseHeaders:$,requestBodyValues:{}})}throw U.value}try{return await Q({response:Z,url:F,requestBodyValues:{}})}catch(U){if(U instanceof Error){if(R(U)||C.isInstance(U))throw U}throw new C({message:"Failed to process successful response",cause:U,statusCode:Z.status,url:F,responseHeaders:$,requestBodyValues:{}})}}catch(Z){throw JF({error:Z,url:F,requestBodyValues:{}})}};function iJ(F){return F!=null}function pJ({mediaType:F,url:J,supportedUrls:Q}){return J=J.toLowerCase(),F=F.toLowerCase(),Object.entries(Q).map(([W,X])=>{let Y=W.toLowerCase();return Y==="*"||Y==="*/*"?{mediaTypePrefix:"",regexes:X}:{mediaTypePrefix:Y.replace(/\*/,""),regexes:X}}).filter(({mediaTypePrefix:W})=>F.startsWith(W)).flatMap(({regexes:W})=>W).some((W)=>W.test(J))}function cJ({apiKey:F,environmentVariableName:J,apiKeyParameterName:Q="apiKey",description:W}){if(typeof F==="string")return F;if(F!=null)throw new A({message:`${W} API key must be a string.`});if(typeof process>"u")throw new A({message:`${W} API key is missing. Pass it using the '${Q}' parameter. Environment variables are not supported in this environment.`});if(F=process.env[J],F==null)throw new A({message:`${W} API key is missing. Pass it using the '${Q}' parameter or the ${J} environment variable.`});if(typeof F!=="string")throw new A({message:`${W} API key must be a string. The value of the ${J} environment variable is not a string.`});return F}function dJ({settingValue:F,environmentVariableName:J}){if(typeof F==="string")return F;if(F!=null||typeof process>"u")return;if(F=process.env[J],F==null||typeof F!=="string")return;return F}function fJ({settingValue:F,environmentVariableName:J,settingName:Q,description:W}){if(typeof F==="string")return F;if(F!=null)throw new H({message:`${W} setting must be a string.`});if(typeof process>"u")throw new H({message:`${W} setting is missing. Pass it using the '${Q}' parameter. Environment variables are not supported in this environment.`});if(F=process.env[J],F==null)throw new H({message:`${W} setting is missing. Pass it using the '${Q}' parameter or the ${J} environment variable.`});if(typeof F!=="string")throw new H({message:`${W} setting must be a string. The value of the ${J} environment variable is not a string.`});return F}function tJ(F){var J;let[Q,W=""]=F.toLowerCase().split("/");return(J={mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"}[W])!=null?J:W}var HF=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,BF=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function l(F){let J=JSON.parse(F);if(J===null||typeof J!=="object")return J;if(HF.test(F)===!1&&BF.test(F)===!1)return J;return RF(J)}function RF(F){let J=[F];while(J.length){let Q=J;J=[];for(let W of Q){if(Object.prototype.hasOwnProperty.call(W,"__proto__"))throw SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(W,"constructor")&&W.constructor!==null&&typeof W.constructor==="object"&&Object.prototype.hasOwnProperty.call(W.constructor,"prototype"))throw SyntaxError("Object contains forbidden prototype property");for(let X in W){let Y=W[X];if(Y&&typeof Y==="object")J.push(Y)}}}return F}function x(F){let{stackTraceLimit:J}=Error;try{Error.stackTraceLimit=0}catch(Q){return l(F)}try{return l(F)}finally{Error.stackTraceLimit=J}}function v(F){if(F.type==="object"||Array.isArray(F.type)&&F.type.includes("object")){F.additionalProperties=!1;let{properties:Q}=F;if(Q!=null)for(let W of Object.keys(Q))Q[W]=P(Q[W])}if(F.items!=null)F.items=Array.isArray(F.items)?F.items.map(P):P(F.items);if(F.anyOf!=null)F.anyOf=F.anyOf.map(P);if(F.allOf!=null)F.allOf=F.allOf.map(P);if(F.oneOf!=null)F.oneOf=F.oneOf.map(P);let{definitions:J}=F;if(J!=null)for(let Q of Object.keys(J))J[Q]=P(J[Q]);return F}function P(F){if(typeof F==="boolean")return F;return v(F)}var NF=Symbol("Let zodToJsonSchema decide on which parser to use"),c={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},VF=(F)=>typeof F==="string"?{...c,name:F}:{...c,...F};function K(){return{}}function TF(F,J){var Q,W,X;let Y={type:"array"};if(((Q=F.type)==null?void 0:Q._def)&&((X=(W=F.type)==null?void 0:W._def)==null?void 0:X.typeName)!==w.ZodAny)Y.items=E(F.type._def,{...J,currentPath:[...J.currentPath,"items"]});if(F.minLength)Y.minItems=F.minLength.value;if(F.maxLength)Y.maxItems=F.maxLength.value;if(F.exactLength)Y.minItems=F.exactLength.value,Y.maxItems=F.exactLength.value;return Y}function _F(F){let J={type:"integer",format:"int64"};if(!F.checks)return J;for(let Q of F.checks)switch(Q.kind){case"min":if(Q.inclusive)J.minimum=Q.value;else J.exclusiveMinimum=Q.value;break;case"max":if(Q.inclusive)J.maximum=Q.value;else J.exclusiveMaximum=Q.value;break;case"multipleOf":J.multipleOf=Q.value;break}return J}function jF(){return{type:"boolean"}}function YF(F,J){return E(F.type._def,J)}var kF=(F,J)=>{return E(F.innerType._def,J)};function ZF(F,J,Q){let W=Q!=null?Q:J.dateStrategy;if(Array.isArray(W))return{anyOf:W.map((X,Y)=>ZF(F,J,X))};switch(W){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return bF(F)}}var bF=(F)=>{let J={type:"integer",format:"unix-time"};for(let Q of F.checks)switch(Q.kind){case"min":J.minimum=Q.value;break;case"max":J.maximum=Q.value;break}return J};function SF(F,J){return{...E(F.innerType._def,J),default:F.defaultValue()}}function gF(F,J){return J.effectStrategy==="input"?E(F.schema._def,J):K()}function xF(F){return{type:"string",enum:Array.from(F.values)}}var vF=(F)=>{if("type"in F&&F.type==="string")return!1;return"allOf"in F};function yF(F,J){let Q=[E(F.left._def,{...J,currentPath:[...J.currentPath,"allOf","0"]}),E(F.right._def,{...J,currentPath:[...J.currentPath,"allOf","1"]})].filter((X)=>!!X),W=[];return Q.forEach((X)=>{if(vF(X))W.push(...X.allOf);else{let Y=X;if("additionalProperties"in X&&X.additionalProperties===!1){let{additionalProperties:Z,...$}=X;Y=$}W.push(Y)}}),W.length?{allOf:W}:void 0}function hF(F){let J=typeof F.value;if(J!=="bigint"&&J!=="number"&&J!=="boolean"&&J!=="string")return{type:Array.isArray(F.value)?"array":"object"};return{type:J==="bigint"?"integer":J,const:F.value}}var _=void 0,q={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(_===void 0)_=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return _},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function $F(F,J){let Q={type:"string"};if(F.checks)for(let W of F.checks)switch(W.kind){case"min":Q.minLength=typeof Q.minLength==="number"?Math.max(Q.minLength,W.value):W.value;break;case"max":Q.maxLength=typeof Q.maxLength==="number"?Math.min(Q.maxLength,W.value):W.value;break;case"email":switch(J.emailStrategy){case"format:email":D(Q,"email",W.message,J);break;case"format:idn-email":D(Q,"idn-email",W.message,J);break;case"pattern:zod":M(Q,q.email,W.message,J);break}break;case"url":D(Q,"uri",W.message,J);break;case"uuid":D(Q,"uuid",W.message,J);break;case"regex":M(Q,W.regex,W.message,J);break;case"cuid":M(Q,q.cuid,W.message,J);break;case"cuid2":M(Q,q.cuid2,W.message,J);break;case"startsWith":M(Q,RegExp(`^${j(W.value,J)}`),W.message,J);break;case"endsWith":M(Q,RegExp(`${j(W.value,J)}$`),W.message,J);break;case"datetime":D(Q,"date-time",W.message,J);break;case"date":D(Q,"date",W.message,J);break;case"time":D(Q,"time",W.message,J);break;case"duration":D(Q,"duration",W.message,J);break;case"length":Q.minLength=typeof Q.minLength==="number"?Math.max(Q.minLength,W.value):W.value,Q.maxLength=typeof Q.maxLength==="number"?Math.min(Q.maxLength,W.value):W.value;break;case"includes":{M(Q,RegExp(j(W.value,J)),W.message,J);break}case"ip":{if(W.version!=="v6")D(Q,"ipv4",W.message,J);if(W.version!=="v4")D(Q,"ipv6",W.message,J);break}case"base64url":M(Q,q.base64url,W.message,J);break;case"jwt":M(Q,q.jwt,W.message,J);break;case"cidr":{if(W.version!=="v6")M(Q,q.ipv4Cidr,W.message,J);if(W.version!=="v4")M(Q,q.ipv6Cidr,W.message,J);break}case"emoji":M(Q,q.emoji(),W.message,J);break;case"ulid":{M(Q,q.ulid,W.message,J);break}case"base64":{switch(J.base64Strategy){case"format:binary":{D(Q,"binary",W.message,J);break}case"contentEncoding:base64":{Q.contentEncoding="base64";break}case"pattern:zod":{M(Q,q.base64,W.message,J);break}}break}case"nanoid":M(Q,q.nanoid,W.message,J);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return Q}function j(F,J){return J.patternStrategy==="escape"?uF(F):F}var mF=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function uF(F){let J="";for(let Q=0;Q<F.length;Q++){if(!mF.has(F[Q]))J+="\\";J+=F[Q]}return J}function D(F,J,Q,W){var X;if(F.format||((X=F.anyOf)==null?void 0:X.some((Y)=>Y.format))){if(!F.anyOf)F.anyOf=[];if(F.format)F.anyOf.push({format:F.format}),delete F.format;F.anyOf.push({format:J,...Q&&W.errorMessages&&{errorMessage:{format:Q}}})}else F.format=J}function M(F,J,Q,W){var X;if(F.pattern||((X=F.allOf)==null?void 0:X.some((Y)=>Y.pattern))){if(!F.allOf)F.allOf=[];if(F.pattern)F.allOf.push({pattern:F.pattern}),delete F.pattern;F.allOf.push({pattern:d(J,W),...Q&&W.errorMessages&&{errorMessage:{pattern:Q}}})}else F.pattern=d(J,W)}function d(F,J){var Q;if(!J.applyRegexFlags||!F.flags)return F.source;let W={i:F.flags.includes("i"),m:F.flags.includes("m"),s:F.flags.includes("s")},X=W.i?F.source.toLowerCase():F.source,Y="",Z=!1,$=!1,U=!1;for(let L=0;L<X.length;L++){if(Z){Y+=X[L],Z=!1;continue}if(W.i){if($){if(X[L].match(/[a-z]/)){if(U)Y+=X[L],Y+=`${X[L-2]}-${X[L]}`.toUpperCase(),U=!1;else if(X[L+1]==="-"&&((Q=X[L+2])==null?void 0:Q.match(/[a-z]/)))Y+=X[L],U=!0;else Y+=`${X[L]}${X[L].toUpperCase()}`;continue}}else if(X[L].match(/[a-z]/)){Y+=`[${X[L]}${X[L].toUpperCase()}]`;continue}}if(W.m){if(X[L]==="^"){Y+=`(^|(?<=[\r
2
+ import{Gq as k,Hq as C,Iq as t,Kq as V,Nq as B,Oq as A,Pq as H,Sq as I,Xq as o}from"./chunk-kec1xw1n.js";import{Yq as w}from"./chunk-x50adh71.js";import{lu as f}from"./chunk-q4mtwv1w.js";import{vz as n}from"./chunk-7a3txs9f.js";function RJ(...F){return F.reduce((J,Q)=>({...J,...Q!=null?Q:{}}),{})}function NJ({tools:F=[],providerToolNames:J,resolveProviderToolName:Q}){var W;let X={},Y={};for(let Z of F)if(Z.type==="provider"){let $=(W=Q==null?void 0:Q(Z))!=null?W:(Z.id in J)?J[Z.id]:void 0;if($==null)continue;X[Z.name]=$,Y[$]=Z.name}return{toProviderToolName:(Z)=>{var $;return($=X[Z])!=null?$:Z},toCustomToolName:(Z)=>{var $;return($=Y[Z])!=null?$:Z}}}async function VJ(F,J){if(F==null)return Promise.resolve();let Q=J==null?void 0:J.abortSignal;return new Promise((W,X)=>{if(Q==null?void 0:Q.aborted){X(m());return}let Y=setTimeout(()=>{Z(),W()},F),Z=()=>{clearTimeout(Y),Q==null||Q.removeEventListener("abort",$)},$=()=>{Z(),X(m())};Q==null||Q.addEventListener("abort",$)})}function m(){return new DOMException("Delay was aborted","AbortError")}var TJ=class{constructor(){this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}get promise(){if(this._promise)return this._promise;return this._promise=new Promise((F,J)=>{if(this.status.type==="resolved")F(this.status.value);else if(this.status.type==="rejected")J(this.status.error);this._resolve=F,this._reject=J}),this._promise}resolve(F){var J;if(this.status={type:"resolved",value:F},this._promise)(J=this._resolve)==null||J.call(this,F)}reject(F){var J;if(this.status={type:"rejected",error:F},this._promise)(J=this._reject)==null||J.call(this,F)}isResolved(){return this.status.type==="resolved"}isRejected(){return this.status.type==="rejected"}isPending(){return this.status.type==="pending"}};function z(F){return Object.fromEntries([...F.headers])}var{btoa:GF,atob:CF}=globalThis;function _J(F){let J=F.replace(/-/g,"+").replace(/_/g,"/"),Q=CF(J);return Uint8Array.from(Q,(W)=>W.codePointAt(0))}function a(F){let J="";for(let Q=0;Q<F.length;Q++)J+=String.fromCodePoint(F[Q]);return GF(J)}function jJ(F){return F instanceof Uint8Array?a(F):F}function kJ(F){if(F.type==="url")return F.url;return`data:${F.mediaType};base64,${typeof F.data==="string"?F.data:a(F.data)}`}function bJ(F,J={}){let{useArrayBrackets:Q=!0}=J,W=new FormData;for(let[X,Y]of Object.entries(F)){if(Y==null)continue;if(Array.isArray(Y)){if(Y.length===1){W.append(X,Y[0]);continue}let Z=Q?`${X}[]`:X;for(let $ of Y)W.append(Z,$);continue}W.append(X,Y)}return W}var s="AI_DownloadError",r=`vercel.ai.error.${s}`,MF=Symbol.for(r),u,i,O=class extends(i=k,u=MF,i){constructor({url:F,statusCode:J,statusText:Q,cause:W,message:X=W==null?`Failed to download ${F}: ${J} ${Q}`:`Failed to download ${F}: ${W}`}){super({name:s,message:X,cause:W});this[u]=!0,this.url=F,this.statusCode=J,this.statusText=Q}static isInstance(F){return k.hasMarker(F,r)}},e=2147483648;async function KF({response:F,url:J,maxBytes:Q=e}){let W=F.headers.get("content-length");if(W!=null){let G=parseInt(W,10);if(!isNaN(G)&&G>Q)throw new O({url:J,message:`Download of ${J} exceeded maximum size of ${Q} bytes (Content-Length: ${G}).`})}let X=F.body;if(X==null)return new Uint8Array(0);let Y=X.getReader(),Z=[],$=0;try{while(!0){let{done:G,value:N}=await Y.read();if(G)break;if($+=N.length,$>Q)throw new O({url:J,message:`Download of ${J} exceeded maximum size of ${Q} bytes.`});Z.push(N)}}finally{try{await Y.cancel()}finally{Y.releaseLock()}}let U=new Uint8Array($),L=0;for(let G of Z)U.set(G,L),L+=G.length;return U}function p(F){let J;try{J=new URL(F)}catch(W){throw new O({url:F,message:`Invalid URL: ${F}`})}if(J.protocol==="data:")return;if(J.protocol!=="http:"&&J.protocol!=="https:")throw new O({url:F,message:`URL scheme must be http, https, or data, got ${J.protocol}`});let Q=J.hostname;if(!Q)throw new O({url:F,message:"URL must have a hostname"});if(Q==="localhost"||Q.endsWith(".local")||Q.endsWith(".localhost"))throw new O({url:F,message:`URL with hostname ${Q} is not allowed`});if(Q.startsWith("[")&&Q.endsWith("]")){let W=Q.slice(1,-1);if(qF(W))throw new O({url:F,message:`URL with IPv6 address ${Q} is not allowed`});return}if(FF(Q)){if(b(Q))throw new O({url:F,message:`URL with IP address ${Q} is not allowed`});return}}function FF(F){let J=F.split(".");if(J.length!==4)return!1;return J.every((Q)=>{let W=Number(Q);return Number.isInteger(W)&&W>=0&&W<=255&&String(W)===Q})}function b(F){let J=F.split(".").map(Number),[Q,W]=J;if(Q===0)return!0;if(Q===10)return!0;if(Q===127)return!0;if(Q===169&&W===254)return!0;if(Q===172&&W>=16&&W<=31)return!0;if(Q===192&&W===168)return!0;return!1}function qF(F){let J=F.toLowerCase();if(J==="::1")return!0;if(J==="::")return!0;if(J.startsWith("::ffff:")){let Q=J.slice(7);if(FF(Q))return b(Q);let W=Q.split(":");if(W.length===2){let X=parseInt(W[0],16),Y=parseInt(W[1],16);if(!isNaN(X)&&!isNaN(Y)){let Z=X>>8&255,$=X&255,U=Y>>8&255,L=Y&255;return b(`${Z}.${$}.${U}.${L}`)}}}if(J.startsWith("fc")||J.startsWith("fd"))return!0;if(J.startsWith("fe80"))return!0;return!1}async function gJ(F,J){var Q,W;p(F);try{let X=await fetch(F,{signal:J==null?void 0:J.abortSignal});if(X.redirected)p(X.url);if(!X.ok)throw new O({url:F,statusCode:X.status,statusText:X.statusText});let Y=await KF({response:X,url:F,maxBytes:(Q=J==null?void 0:J.maxBytes)!=null?Q:e}),Z=(W=X.headers.get("content-type"))!=null?W:void 0;return new Blob([Y],Z?{type:Z}:void 0)}catch(X){if(O.isInstance(X))throw X;throw new O({url:F,cause:X})}}var DF=({prefix:F,size:J=16,alphabet:Q="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:W="-"}={})=>{let X=()=>{let Y=Q.length,Z=Array(J);for(let $=0;$<J;$++)Z[$]=Q[Math.random()*Y|0];return Z.join("")};if(F==null)return X;if(Q.includes(W))throw new V({argument:"separator",message:`The separator "${W}" must not be part of the alphabet "${Q}".`});return()=>`${F}${W}${X()}`},vJ=DF();function yJ(F){if(F==null)return"unknown error";if(typeof F==="string")return F;if(F instanceof Error)return F.message;return JSON.stringify(F)}function R(F){return(F instanceof Error||F instanceof DOMException)&&(F.name==="AbortError"||F.name==="ResponseAborted"||F.name==="TimeoutError")}var OF=["fetch failed","failed to fetch"],IF=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function PF(F){if(!(F instanceof Error))return!1;let J=F.code;if(typeof J==="string"&&IF.includes(J))return!0;return!1}function JF({error:F,url:J,requestBodyValues:Q}){if(R(F))return F;if(F instanceof TypeError&&OF.includes(F.message.toLowerCase())){let W=F.cause;if(W!=null)return new C({message:`Cannot connect to API: ${W.message}`,cause:W,url:J,requestBodyValues:Q,isRetryable:!0})}if(PF(F))return new C({message:`Cannot connect to API: ${F.message}`,cause:F,url:J,requestBodyValues:Q,isRetryable:!0});return F}function QF(F=globalThis){var J,Q,W;if(F.window)return"runtime/browser";if((J=F.navigator)==null?void 0:J.userAgent)return`runtime/${F.navigator.userAgent.toLowerCase()}`;if((W=(Q=F.process)==null?void 0:Q.versions)==null?void 0:W.node)return`runtime/node.js/${F.process.version.substring(0)}`;if(F.EdgeRuntime)return"runtime/vercel-edge";return"runtime/unknown"}function zF(F){if(F==null)return{};let J={};if(F instanceof Headers)F.forEach((Q,W)=>{J[W.toLowerCase()]=Q});else{if(!Array.isArray(F))F=Object.entries(F);for(let[Q,W]of F)if(W!=null)J[Q.toLowerCase()]=W}return J}function WF(F,...J){let Q=new Headers(zF(F)),W=Q.get("user-agent")||"";return Q.set("user-agent",[W,...J].filter(Boolean).join(" ")),Object.fromEntries(Q.entries())}var XF="4.0.23",AF=()=>globalThis.fetch,uJ=async({url:F,headers:J={},successfulResponseHandler:Q,failedResponseHandler:W,abortSignal:X,fetch:Y=AF()})=>{try{let Z=await Y(F,{method:"GET",headers:WF(J,`ai-sdk/provider-utils/${XF}`,QF()),signal:X}),$=z(Z);if(!Z.ok){let U;try{U=await W({response:Z,url:F,requestBodyValues:{}})}catch(L){if(R(L)||C.isInstance(L))throw L;throw new C({message:"Failed to process error response",cause:L,statusCode:Z.status,url:F,responseHeaders:$,requestBodyValues:{}})}throw U.value}try{return await Q({response:Z,url:F,requestBodyValues:{}})}catch(U){if(U instanceof Error){if(R(U)||C.isInstance(U))throw U}throw new C({message:"Failed to process successful response",cause:U,statusCode:Z.status,url:F,responseHeaders:$,requestBodyValues:{}})}}catch(Z){throw JF({error:Z,url:F,requestBodyValues:{}})}};function iJ(F){return F!=null}function pJ({mediaType:F,url:J,supportedUrls:Q}){return J=J.toLowerCase(),F=F.toLowerCase(),Object.entries(Q).map(([W,X])=>{let Y=W.toLowerCase();return Y==="*"||Y==="*/*"?{mediaTypePrefix:"",regexes:X}:{mediaTypePrefix:Y.replace(/\*/,""),regexes:X}}).filter(({mediaTypePrefix:W})=>F.startsWith(W)).flatMap(({regexes:W})=>W).some((W)=>W.test(J))}function cJ({apiKey:F,environmentVariableName:J,apiKeyParameterName:Q="apiKey",description:W}){if(typeof F==="string")return F;if(F!=null)throw new A({message:`${W} API key must be a string.`});if(typeof process>"u")throw new A({message:`${W} API key is missing. Pass it using the '${Q}' parameter. Environment variables are not supported in this environment.`});if(F=process.env[J],F==null)throw new A({message:`${W} API key is missing. Pass it using the '${Q}' parameter or the ${J} environment variable.`});if(typeof F!=="string")throw new A({message:`${W} API key must be a string. The value of the ${J} environment variable is not a string.`});return F}function dJ({settingValue:F,environmentVariableName:J}){if(typeof F==="string")return F;if(F!=null||typeof process>"u")return;if(F=process.env[J],F==null||typeof F!=="string")return;return F}function fJ({settingValue:F,environmentVariableName:J,settingName:Q,description:W}){if(typeof F==="string")return F;if(F!=null)throw new H({message:`${W} setting must be a string.`});if(typeof process>"u")throw new H({message:`${W} setting is missing. Pass it using the '${Q}' parameter. Environment variables are not supported in this environment.`});if(F=process.env[J],F==null)throw new H({message:`${W} setting is missing. Pass it using the '${Q}' parameter or the ${J} environment variable.`});if(typeof F!=="string")throw new H({message:`${W} setting must be a string. The value of the ${J} environment variable is not a string.`});return F}function tJ(F){var J;let[Q,W=""]=F.toLowerCase().split("/");return(J={mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"}[W])!=null?J:W}var HF=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,BF=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function l(F){let J=JSON.parse(F);if(J===null||typeof J!=="object")return J;if(HF.test(F)===!1&&BF.test(F)===!1)return J;return RF(J)}function RF(F){let J=[F];while(J.length){let Q=J;J=[];for(let W of Q){if(Object.prototype.hasOwnProperty.call(W,"__proto__"))throw SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(W,"constructor")&&W.constructor!==null&&typeof W.constructor==="object"&&Object.prototype.hasOwnProperty.call(W.constructor,"prototype"))throw SyntaxError("Object contains forbidden prototype property");for(let X in W){let Y=W[X];if(Y&&typeof Y==="object")J.push(Y)}}}return F}function x(F){let{stackTraceLimit:J}=Error;try{Error.stackTraceLimit=0}catch(Q){return l(F)}try{return l(F)}finally{Error.stackTraceLimit=J}}function v(F){if(F.type==="object"||Array.isArray(F.type)&&F.type.includes("object")){F.additionalProperties=!1;let{properties:Q}=F;if(Q!=null)for(let W of Object.keys(Q))Q[W]=P(Q[W])}if(F.items!=null)F.items=Array.isArray(F.items)?F.items.map(P):P(F.items);if(F.anyOf!=null)F.anyOf=F.anyOf.map(P);if(F.allOf!=null)F.allOf=F.allOf.map(P);if(F.oneOf!=null)F.oneOf=F.oneOf.map(P);let{definitions:J}=F;if(J!=null)for(let Q of Object.keys(J))J[Q]=P(J[Q]);return F}function P(F){if(typeof F==="boolean")return F;return v(F)}var NF=Symbol("Let zodToJsonSchema decide on which parser to use"),c={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},VF=(F)=>typeof F==="string"?{...c,name:F}:{...c,...F};function K(){return{}}function TF(F,J){var Q,W,X;let Y={type:"array"};if(((Q=F.type)==null?void 0:Q._def)&&((X=(W=F.type)==null?void 0:W._def)==null?void 0:X.typeName)!==w.ZodAny)Y.items=E(F.type._def,{...J,currentPath:[...J.currentPath,"items"]});if(F.minLength)Y.minItems=F.minLength.value;if(F.maxLength)Y.maxItems=F.maxLength.value;if(F.exactLength)Y.minItems=F.exactLength.value,Y.maxItems=F.exactLength.value;return Y}function _F(F){let J={type:"integer",format:"int64"};if(!F.checks)return J;for(let Q of F.checks)switch(Q.kind){case"min":if(Q.inclusive)J.minimum=Q.value;else J.exclusiveMinimum=Q.value;break;case"max":if(Q.inclusive)J.maximum=Q.value;else J.exclusiveMaximum=Q.value;break;case"multipleOf":J.multipleOf=Q.value;break}return J}function jF(){return{type:"boolean"}}function YF(F,J){return E(F.type._def,J)}var kF=(F,J)=>{return E(F.innerType._def,J)};function ZF(F,J,Q){let W=Q!=null?Q:J.dateStrategy;if(Array.isArray(W))return{anyOf:W.map((X,Y)=>ZF(F,J,X))};switch(W){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return bF(F)}}var bF=(F)=>{let J={type:"integer",format:"unix-time"};for(let Q of F.checks)switch(Q.kind){case"min":J.minimum=Q.value;break;case"max":J.maximum=Q.value;break}return J};function SF(F,J){return{...E(F.innerType._def,J),default:F.defaultValue()}}function gF(F,J){return J.effectStrategy==="input"?E(F.schema._def,J):K()}function xF(F){return{type:"string",enum:Array.from(F.values)}}var vF=(F)=>{if("type"in F&&F.type==="string")return!1;return"allOf"in F};function yF(F,J){let Q=[E(F.left._def,{...J,currentPath:[...J.currentPath,"allOf","0"]}),E(F.right._def,{...J,currentPath:[...J.currentPath,"allOf","1"]})].filter((X)=>!!X),W=[];return Q.forEach((X)=>{if(vF(X))W.push(...X.allOf);else{let Y=X;if("additionalProperties"in X&&X.additionalProperties===!1){let{additionalProperties:Z,...$}=X;Y=$}W.push(Y)}}),W.length?{allOf:W}:void 0}function hF(F){let J=typeof F.value;if(J!=="bigint"&&J!=="number"&&J!=="boolean"&&J!=="string")return{type:Array.isArray(F.value)?"array":"object"};return{type:J==="bigint"?"integer":J,const:F.value}}var _=void 0,q={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(_===void 0)_=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return _},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function $F(F,J){let Q={type:"string"};if(F.checks)for(let W of F.checks)switch(W.kind){case"min":Q.minLength=typeof Q.minLength==="number"?Math.max(Q.minLength,W.value):W.value;break;case"max":Q.maxLength=typeof Q.maxLength==="number"?Math.min(Q.maxLength,W.value):W.value;break;case"email":switch(J.emailStrategy){case"format:email":D(Q,"email",W.message,J);break;case"format:idn-email":D(Q,"idn-email",W.message,J);break;case"pattern:zod":M(Q,q.email,W.message,J);break}break;case"url":D(Q,"uri",W.message,J);break;case"uuid":D(Q,"uuid",W.message,J);break;case"regex":M(Q,W.regex,W.message,J);break;case"cuid":M(Q,q.cuid,W.message,J);break;case"cuid2":M(Q,q.cuid2,W.message,J);break;case"startsWith":M(Q,RegExp(`^${j(W.value,J)}`),W.message,J);break;case"endsWith":M(Q,RegExp(`${j(W.value,J)}$`),W.message,J);break;case"datetime":D(Q,"date-time",W.message,J);break;case"date":D(Q,"date",W.message,J);break;case"time":D(Q,"time",W.message,J);break;case"duration":D(Q,"duration",W.message,J);break;case"length":Q.minLength=typeof Q.minLength==="number"?Math.max(Q.minLength,W.value):W.value,Q.maxLength=typeof Q.maxLength==="number"?Math.min(Q.maxLength,W.value):W.value;break;case"includes":{M(Q,RegExp(j(W.value,J)),W.message,J);break}case"ip":{if(W.version!=="v6")D(Q,"ipv4",W.message,J);if(W.version!=="v4")D(Q,"ipv6",W.message,J);break}case"base64url":M(Q,q.base64url,W.message,J);break;case"jwt":M(Q,q.jwt,W.message,J);break;case"cidr":{if(W.version!=="v6")M(Q,q.ipv4Cidr,W.message,J);if(W.version!=="v4")M(Q,q.ipv6Cidr,W.message,J);break}case"emoji":M(Q,q.emoji(),W.message,J);break;case"ulid":{M(Q,q.ulid,W.message,J);break}case"base64":{switch(J.base64Strategy){case"format:binary":{D(Q,"binary",W.message,J);break}case"contentEncoding:base64":{Q.contentEncoding="base64";break}case"pattern:zod":{M(Q,q.base64,W.message,J);break}}break}case"nanoid":M(Q,q.nanoid,W.message,J);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return Q}function j(F,J){return J.patternStrategy==="escape"?uF(F):F}var mF=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function uF(F){let J="";for(let Q=0;Q<F.length;Q++){if(!mF.has(F[Q]))J+="\\";J+=F[Q]}return J}function D(F,J,Q,W){var X;if(F.format||((X=F.anyOf)==null?void 0:X.some((Y)=>Y.format))){if(!F.anyOf)F.anyOf=[];if(F.format)F.anyOf.push({format:F.format}),delete F.format;F.anyOf.push({format:J,...Q&&W.errorMessages&&{errorMessage:{format:Q}}})}else F.format=J}function M(F,J,Q,W){var X;if(F.pattern||((X=F.allOf)==null?void 0:X.some((Y)=>Y.pattern))){if(!F.allOf)F.allOf=[];if(F.pattern)F.allOf.push({pattern:F.pattern}),delete F.pattern;F.allOf.push({pattern:d(J,W),...Q&&W.errorMessages&&{errorMessage:{pattern:Q}}})}else F.pattern=d(J,W)}function d(F,J){var Q;if(!J.applyRegexFlags||!F.flags)return F.source;let W={i:F.flags.includes("i"),m:F.flags.includes("m"),s:F.flags.includes("s")},X=W.i?F.source.toLowerCase():F.source,Y="",Z=!1,$=!1,U=!1;for(let L=0;L<X.length;L++){if(Z){Y+=X[L],Z=!1;continue}if(W.i){if($){if(X[L].match(/[a-z]/)){if(U)Y+=X[L],Y+=`${X[L-2]}-${X[L]}`.toUpperCase(),U=!1;else if(X[L+1]==="-"&&((Q=X[L+2])==null?void 0:Q.match(/[a-z]/)))Y+=X[L],U=!0;else Y+=`${X[L]}${X[L].toUpperCase()}`;continue}}else if(X[L].match(/[a-z]/)){Y+=`[${X[L]}${X[L].toUpperCase()}]`;continue}}if(W.m){if(X[L]==="^"){Y+=`(^|(?<=[\r
3
3
  ]))`;continue}else if(X[L]==="$"){Y+=`($|(?=[\r
4
4
  ]))`;continue}}if(W.s&&X[L]==="."){Y+=$?`${X[L]}\r
5
5
  `:`[${X[L]}\r
6
6
  ]`;continue}if(Y+=X[L],X[L]==="\\")Z=!0;else if($&&X[L]==="]")$=!1;else if(!$&&X[L]==="[")$=!0}try{new RegExp(Y)}catch(L){return console.warn(`Could not convert regex pattern at ${J.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),F.source}return Y}function LF(F,J){var Q,W,X,Y,Z,$;let U={type:"object",additionalProperties:(Q=E(F.valueType._def,{...J,currentPath:[...J.currentPath,"additionalProperties"]}))!=null?Q:J.allowedAdditionalProperties};if(((W=F.keyType)==null?void 0:W._def.typeName)===w.ZodString&&((X=F.keyType._def.checks)==null?void 0:X.length)){let{type:L,...G}=$F(F.keyType._def,J);return{...U,propertyNames:G}}else if(((Y=F.keyType)==null?void 0:Y._def.typeName)===w.ZodEnum)return{...U,propertyNames:{enum:F.keyType._def.values}};else if(((Z=F.keyType)==null?void 0:Z._def.typeName)===w.ZodBranded&&F.keyType._def.type._def.typeName===w.ZodString&&(($=F.keyType._def.type._def.checks)==null?void 0:$.length)){let{type:L,...G}=YF(F.keyType._def,J);return{...U,propertyNames:G}}return U}function iF(F,J){if(J.mapStrategy==="record")return LF(F,J);let Q=E(F.keyType._def,{...J,currentPath:[...J.currentPath,"items","items","0"]})||K(),W=E(F.valueType._def,{...J,currentPath:[...J.currentPath,"items","items","1"]})||K();return{type:"array",maxItems:125,items:{type:"array",items:[Q,W],minItems:2,maxItems:2}}}function pF(F){let J=F.values,W=Object.keys(F.values).filter((Y)=>{return typeof J[J[Y]]!=="number"}).map((Y)=>J[Y]),X=Array.from(new Set(W.map((Y)=>typeof Y)));return{type:X.length===1?X[0]==="string"?"string":"number":["string","number"],enum:W}}function lF(){return{not:K()}}function cF(){return{type:"null"}}var S={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function dF(F,J){let Q=F.options instanceof Map?Array.from(F.options.values()):F.options;if(Q.every((W)=>(W._def.typeName in S)&&(!W._def.checks||!W._def.checks.length))){let W=Q.reduce((X,Y)=>{let Z=S[Y._def.typeName];return Z&&!X.includes(Z)?[...X,Z]:X},[]);return{type:W.length>1?W:W[0]}}else if(Q.every((W)=>W._def.typeName==="ZodLiteral"&&!W.description)){let W=Q.reduce((X,Y)=>{let Z=typeof Y._def.value;switch(Z){case"string":case"number":case"boolean":return[...X,Z];case"bigint":return[...X,"integer"];case"object":if(Y._def.value===null)return[...X,"null"];case"symbol":case"undefined":case"function":default:return X}},[]);if(W.length===Q.length){let X=W.filter((Y,Z,$)=>$.indexOf(Y)===Z);return{type:X.length>1?X:X[0],enum:Q.reduce((Y,Z)=>{return Y.includes(Z._def.value)?Y:[...Y,Z._def.value]},[])}}}else if(Q.every((W)=>W._def.typeName==="ZodEnum"))return{type:"string",enum:Q.reduce((W,X)=>[...W,...X._def.values.filter((Y)=>!W.includes(Y))],[])};return nF(F,J)}var nF=(F,J)=>{let Q=(F.options instanceof Map?Array.from(F.options.values()):F.options).map((W,X)=>E(W._def,{...J,currentPath:[...J.currentPath,"anyOf",`${X}`]})).filter((W)=>!!W&&(!J.strictUnions||typeof W==="object"&&Object.keys(W).length>0));return Q.length?{anyOf:Q}:void 0};function fF(F,J){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(F.innerType._def.typeName)&&(!F.innerType._def.checks||!F.innerType._def.checks.length))return{type:[S[F.innerType._def.typeName],"null"]};let Q=E(F.innerType._def,{...J,currentPath:[...J.currentPath,"anyOf","0"]});return Q&&{anyOf:[Q,{type:"null"}]}}function tF(F){let J={type:"number"};if(!F.checks)return J;for(let Q of F.checks)switch(Q.kind){case"int":J.type="integer";break;case"min":if(Q.inclusive)J.minimum=Q.value;else J.exclusiveMinimum=Q.value;break;case"max":if(Q.inclusive)J.maximum=Q.value;else J.exclusiveMaximum=Q.value;break;case"multipleOf":J.multipleOf=Q.value;break}return J}function oF(F,J){let Q={type:"object",properties:{}},W=[],X=F.shape();for(let Z in X){let $=X[Z];if($===void 0||$._def===void 0)continue;let U=sF($),L=E($._def,{...J,currentPath:[...J.currentPath,"properties",Z],propertyPath:[...J.currentPath,"properties",Z]});if(L===void 0)continue;if(Q.properties[Z]=L,!U)W.push(Z)}if(W.length)Q.required=W;let Y=aF(F,J);if(Y!==void 0)Q.additionalProperties=Y;return Q}function aF(F,J){if(F.catchall._def.typeName!=="ZodNever")return E(F.catchall._def,{...J,currentPath:[...J.currentPath,"additionalProperties"]});switch(F.unknownKeys){case"passthrough":return J.allowedAdditionalProperties;case"strict":return J.rejectedAdditionalProperties;case"strip":return J.removeAdditionalStrategy==="strict"?J.allowedAdditionalProperties:J.rejectedAdditionalProperties}}function sF(F){try{return F.isOptional()}catch(J){return!0}}var rF=(F,J)=>{var Q;if(J.currentPath.toString()===((Q=J.propertyPath)==null?void 0:Q.toString()))return E(F.innerType._def,J);let W=E(F.innerType._def,{...J,currentPath:[...J.currentPath,"anyOf","1"]});return W?{anyOf:[{not:K()},W]}:K()},eF=(F,J)=>{if(J.pipeStrategy==="input")return E(F.in._def,J);else if(J.pipeStrategy==="output")return E(F.out._def,J);let Q=E(F.in._def,{...J,currentPath:[...J.currentPath,"allOf","0"]}),W=E(F.out._def,{...J,currentPath:[...J.currentPath,"allOf",Q?"1":"0"]});return{allOf:[Q,W].filter((X)=>X!==void 0)}};function FJ(F,J){return E(F.type._def,J)}function JJ(F,J){let W={type:"array",uniqueItems:!0,items:E(F.valueType._def,{...J,currentPath:[...J.currentPath,"items"]})};if(F.minSize)W.minItems=F.minSize.value;if(F.maxSize)W.maxItems=F.maxSize.value;return W}function QJ(F,J){if(F.rest)return{type:"array",minItems:F.items.length,items:F.items.map((Q,W)=>E(Q._def,{...J,currentPath:[...J.currentPath,"items",`${W}`]})).reduce((Q,W)=>W===void 0?Q:[...Q,W],[]),additionalItems:E(F.rest._def,{...J,currentPath:[...J.currentPath,"additionalItems"]})};else return{type:"array",minItems:F.items.length,maxItems:F.items.length,items:F.items.map((Q,W)=>E(Q._def,{...J,currentPath:[...J.currentPath,"items",`${W}`]})).reduce((Q,W)=>W===void 0?Q:[...Q,W],[])}}function WJ(){return{not:K()}}function XJ(){return K()}var YJ=(F,J)=>{return E(F.innerType._def,J)},ZJ=(F,J,Q)=>{switch(J){case w.ZodString:return $F(F,Q);case w.ZodNumber:return tF(F);case w.ZodObject:return oF(F,Q);case w.ZodBigInt:return _F(F);case w.ZodBoolean:return jF();case w.ZodDate:return ZF(F,Q);case w.ZodUndefined:return WJ();case w.ZodNull:return cF();case w.ZodArray:return TF(F,Q);case w.ZodUnion:case w.ZodDiscriminatedUnion:return dF(F,Q);case w.ZodIntersection:return yF(F,Q);case w.ZodTuple:return QJ(F,Q);case w.ZodRecord:return LF(F,Q);case w.ZodLiteral:return hF(F);case w.ZodEnum:return xF(F);case w.ZodNativeEnum:return pF(F);case w.ZodNullable:return fF(F,Q);case w.ZodOptional:return rF(F,Q);case w.ZodMap:return iF(F,Q);case w.ZodSet:return JJ(F,Q);case w.ZodLazy:return()=>F.getter()._def;case w.ZodPromise:return FJ(F,Q);case w.ZodNaN:case w.ZodNever:return lF();case w.ZodEffects:return gF(F,Q);case w.ZodAny:return K();case w.ZodUnknown:return XJ();case w.ZodDefault:return SF(F,Q);case w.ZodBranded:return YF(F,Q);case w.ZodReadonly:return YJ(F,Q);case w.ZodCatch:return kF(F,Q);case w.ZodPipeline:return eF(F,Q);case w.ZodFunction:case w.ZodVoid:case w.ZodSymbol:return;default:return((W)=>{return})(J)}},$J=(F,J)=>{let Q=0;for(;Q<F.length&&Q<J.length;Q++)if(F[Q]!==J[Q])break;return[(F.length-Q).toString(),...J.slice(Q)].join("/")};function E(F,J,Q=!1){var W;let X=J.seen.get(F);if(J.override){let U=(W=J.override)==null?void 0:W.call(J,F,J,X,Q);if(U!==NF)return U}if(X&&!Q){let U=LJ(X,J);if(U!==void 0)return U}let Y={def:F,path:J.currentPath,jsonSchema:void 0};J.seen.set(F,Y);let Z=ZJ(F,F.typeName,J),$=typeof Z==="function"?E(Z(),J):Z;if($)UJ(F,J,$);if(J.postProcess){let U=J.postProcess($,F,J);return Y.jsonSchema=$,U}return Y.jsonSchema=$,$}var LJ=(F,J)=>{switch(J.$refStrategy){case"root":return{$ref:F.path.join("/")};case"relative":return{$ref:$J(J.currentPath,F.path)};case"none":case"seen":{if(F.path.length<J.currentPath.length&&F.path.every((Q,W)=>J.currentPath[W]===Q))return console.warn(`Recursive reference detected at ${J.currentPath.join("/")}! Defaulting to any`),K();return J.$refStrategy==="seen"?K():void 0}}},UJ=(F,J,Q)=>{if(F.description)Q.description=F.description;return Q},wJ=(F)=>{let J=VF(F),Q=J.name!==void 0?[...J.basePath,J.definitionPath,J.name]:J.basePath;return{...J,currentPath:Q,propertyPath:void 0,seen:new Map(Object.entries(J.definitions).map(([W,X])=>[X._def,{def:X._def,path:[...J.basePath,J.definitionPath,W],jsonSchema:void 0}]))}},EJ=(F,J)=>{var Q;let W=wJ(J),X=typeof J==="object"&&J.definitions?Object.entries(J.definitions).reduce((L,[G,N])=>{var h;return{...L,[G]:(h=E(N._def,{...W,currentPath:[...W.basePath,W.definitionPath,G]},!0))!=null?h:K()}},{}):void 0,Y=typeof J==="string"?J:(J==null?void 0:J.nameStrategy)==="title"?void 0:J==null?void 0:J.name,Z=(Q=E(F._def,Y===void 0?W:{...W,currentPath:[...W.basePath,W.definitionPath,Y]},!1))!=null?Q:K(),$=typeof J==="object"&&J.name!==void 0&&J.nameStrategy==="title"?J.name:void 0;if($!==void 0)Z.title=$;let U=Y===void 0?X?{...Z,[W.definitionPath]:X}:Z:{$ref:[...W.$refStrategy==="relative"?[]:W.basePath,W.definitionPath,Y].join("/"),[W.definitionPath]:{...X,[Y]:Z}};return U.$schema="http://json-schema.org/draft-07/schema#",U},g=Symbol.for("vercel.ai.schema");function JQ(F){let J;return()=>{if(J==null)J=F();return J}}function T(F,{validate:J}={}){return{[g]:!0,_type:void 0,get jsonSchema(){if(typeof F==="function")F=F();return F},validate:J}}function GJ(F){return typeof F==="object"&&F!==null&&g in F&&F[g]===!0&&"jsonSchema"in F&&"validate"in F}function CJ(F){return F==null?T({properties:{},additionalProperties:!1}):GJ(F)?F:("~standard"in F)?F["~standard"].vendor==="zod"?OJ(F):MJ(F):F()}function MJ(F){return T(()=>v(F["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async(J)=>{let Q=await F["~standard"].validate(J);return"value"in Q?{success:!0,value:Q.value}:{success:!1,error:new I({value:J,cause:Q.issues})}}})}function KJ(F,J){var Q;let W=(Q=J==null?void 0:J.useReferences)!=null?Q:!1;return T(()=>EJ(F,{$refStrategy:W?"root":"none"}),{validate:async(X)=>{let Y=await F.safeParseAsync(X);return Y.success?{success:!0,value:Y.data}:{success:!1,error:Y.error}}})}function qJ(F,J){var Q;let W=(Q=J==null?void 0:J.useReferences)!=null?Q:!1;return T(()=>v(n(F,{target:"draft-7",io:"input",reused:W?"ref":"inline"})),{validate:async(X)=>{let Y=await f(F,X);return Y.success?{success:!0,value:Y.data}:{success:!1,error:Y.error}}})}function DJ(F){return"_zod"in F}function OJ(F,J){if(DJ(F))return qJ(F,J);else return KJ(F,J)}async function IJ({value:F,schema:J,context:Q}){let W=await y({value:F,schema:J,context:Q});if(!W.success)throw I.wrap({value:F,cause:W.error,context:Q});return W.value}async function y({value:F,schema:J,context:Q}){let W=CJ(J);try{if(W.validate==null)return{success:!0,value:F,rawValue:F};let X=await W.validate(F);if(X.success)return{success:!0,value:X.value,rawValue:F};return{success:!1,error:I.wrap({value:F,cause:X.error,context:Q}),rawValue:F}}catch(X){return{success:!1,error:I.wrap({value:F,cause:X,context:Q}),rawValue:F}}}async function PJ({text:F,schema:J}){try{let Q=x(F);if(J==null)return Q;return IJ({value:Q,schema:J})}catch(Q){if(B.isInstance(Q)||I.isInstance(Q))throw Q;throw new B({text:F,cause:Q})}}async function UF({text:F,schema:J}){try{let Q=x(F);if(J==null)return{success:!0,value:Q,rawValue:Q};return await y({value:Q,schema:J})}catch(Q){return{success:!1,error:B.isInstance(Q)?Q:new B({text:F,cause:Q}),rawValue:void 0}}}function QQ(F){try{return x(F),!0}catch(J){return!1}}function zJ({stream:F,schema:J}){return F.pipeThrough(new TextDecoderStream).pipeThrough(new o).pipeThrough(new TransformStream({async transform({data:Q},W){if(Q==="[DONE]")return;W.enqueue(await UF({text:Q,schema:J}))}}))}async function YQ({provider:F,providerOptions:J,schema:Q}){if((J==null?void 0:J[F])==null)return;let W=await y({value:J[F],schema:Q});if(!W.success)throw new V({argument:"providerOptions",message:`invalid ${F} provider options`,cause:W.error});return W.value}var AJ=()=>globalThis.fetch,$Q=async({url:F,headers:J,body:Q,failedResponseHandler:W,successfulResponseHandler:X,abortSignal:Y,fetch:Z})=>wF({url:F,headers:{"Content-Type":"application/json",...J},body:{content:JSON.stringify(Q),values:Q},failedResponseHandler:W,successfulResponseHandler:X,abortSignal:Y,fetch:Z}),LQ=async({url:F,headers:J,formData:Q,failedResponseHandler:W,successfulResponseHandler:X,abortSignal:Y,fetch:Z})=>wF({url:F,headers:J,body:{content:Q,values:Object.fromEntries(Q.entries())},failedResponseHandler:W,successfulResponseHandler:X,abortSignal:Y,fetch:Z}),wF=async({url:F,headers:J={},body:Q,successfulResponseHandler:W,failedResponseHandler:X,abortSignal:Y,fetch:Z=AJ()})=>{try{let $=await Z(F,{method:"POST",headers:WF(J,`ai-sdk/provider-utils/${XF}`,QF()),body:Q.content,signal:Y}),U=z($);if(!$.ok){let L;try{L=await X({response:$,url:F,requestBodyValues:Q.values})}catch(G){if(R(G)||C.isInstance(G))throw G;throw new C({message:"Failed to process error response",cause:G,statusCode:$.status,url:F,responseHeaders:U,requestBodyValues:Q.values})}throw L.value}try{return await W({response:$,url:F,requestBodyValues:Q.values})}catch(L){if(L instanceof Error){if(R(L)||C.isInstance(L))throw L}throw new C({message:"Failed to process successful response",cause:L,statusCode:$.status,url:F,responseHeaders:U,requestBodyValues:Q.values})}}catch($){throw JF({error:$,url:F,requestBodyValues:Q.values})}};function EF(F){return F}function UQ(F){return{...F,type:"dynamic"}}function wQ({id:F,inputSchema:J}){return({execute:Q,outputSchema:W,needsApproval:X,toModelOutput:Y,onInputStart:Z,onInputDelta:$,onInputAvailable:U,...L})=>EF({type:"provider",id:F,args:L,inputSchema:J,outputSchema:W,execute:Q,needsApproval:X,toModelOutput:Y,onInputStart:Z,onInputDelta:$,onInputAvailable:U})}function EQ({id:F,inputSchema:J,outputSchema:Q,supportsDeferredResults:W}){return({execute:X,needsApproval:Y,toModelOutput:Z,onInputStart:$,onInputDelta:U,onInputAvailable:L,...G})=>EF({type:"provider",id:F,args:G,inputSchema:J,outputSchema:Q,execute:X,needsApproval:Y,toModelOutput:Z,onInputStart:$,onInputDelta:U,onInputAvailable:L,supportsDeferredResults:W})}async function GQ(F){if(typeof F==="function")F=F();return Promise.resolve(F)}var MQ=({errorSchema:F,errorToMessage:J,isRetryable:Q})=>async({response:W,url:X,requestBodyValues:Y})=>{let Z=await W.text(),$=z(W);if(Z.trim()==="")return{responseHeaders:$,value:new C({message:W.statusText,url:X,requestBodyValues:Y,statusCode:W.status,responseHeaders:$,responseBody:Z,isRetryable:Q==null?void 0:Q(W)})};try{let U=await PJ({text:Z,schema:F});return{responseHeaders:$,value:new C({message:J(U),url:X,requestBodyValues:Y,statusCode:W.status,responseHeaders:$,responseBody:Z,data:U,isRetryable:Q==null?void 0:Q(W,U)})}}catch(U){return{responseHeaders:$,value:new C({message:W.statusText,url:X,requestBodyValues:Y,statusCode:W.status,responseHeaders:$,responseBody:Z,isRetryable:Q==null?void 0:Q(W)})}}},KQ=(F)=>async({response:J})=>{let Q=z(J);if(J.body==null)throw new t({});return{responseHeaders:Q,value:zJ({stream:J.body,schema:F})}},qQ=(F)=>async({response:J,url:Q,requestBodyValues:W})=>{let X=await J.text(),Y=await UF({text:X,schema:F}),Z=z(J);if(!Y.success)throw new C({message:"Invalid JSON response",cause:Y.error,statusCode:J.status,responseHeaders:Z,responseBody:X,url:Q,requestBodyValues:W});return{responseHeaders:Z,value:Y.value,rawValue:Y.rawValue}},DQ=()=>async({response:F,url:J,requestBodyValues:Q})=>{let W=z(F);if(!F.body)throw new C({message:"Response body is empty",url:J,requestBodyValues:Q,statusCode:F.status,responseHeaders:W,responseBody:void 0});try{let X=await F.arrayBuffer();return{responseHeaders:W,value:new Uint8Array(X)}}catch(X){throw new C({message:"Failed to read response as array buffer",url:J,requestBodyValues:Q,statusCode:F.status,responseHeaders:W,responseBody:void 0,cause:X})}},OQ=()=>async({response:F,url:J,requestBodyValues:Q})=>{let W=z(F),X=await F.text();return{responseHeaders:W,value:new C({message:F.statusText,url:J,requestBodyValues:Q,statusCode:F.status,responseHeaders:W,responseBody:X})}};function IQ(F){let J=F.indexOf(".");return J===-1?F:F.slice(0,J)}function PQ(F){return F==null?void 0:F.replace(/\/$/,"")}function HJ(F){return F!=null&&typeof F[Symbol.asyncIterator]==="function"}async function*zQ({execute:F,input:J,options:Q}){let W=F(J,Q);if(HJ(W)){let X;for await(let Y of W)X=Y,yield{type:"preliminary",output:Y};yield{type:"final",output:X}}else yield{type:"final",output:await W}}
7
- export{RJ as Io,NJ as Jo,VJ as Ko,TJ as Lo,z as Mo,_J as No,a as Oo,jJ as Po,kJ as Qo,bJ as Ro,O as So,e as To,KF as Uo,p as Vo,gJ as Wo,DF as Xo,vJ as Yo,yJ as Zo,R as _o,QF as $o,zF as ap,WF as bp,uJ as cp,iJ as dp,pJ as ep,cJ as fp,dJ as gp,fJ as hp,tJ as ip,JQ as jp,T as kp,CJ as lp,OJ as mp,IJ as np,y as op,PJ as pp,UF as qp,QQ as rp,zJ as sp,YQ as tp,$Q as up,LQ as vp,EF as wp,UQ as xp,wQ as yp,EQ as zp,GQ as Ap,MQ as Bp,KQ as Cp,qQ as Dp,DQ as Ep,OQ as Fp,IQ as Gp,PQ as Hp,zQ as Ip};
7
+ export{RJ as Fp,NJ as Gp,VJ as Hp,TJ as Ip,z as Jp,_J as Kp,a as Lp,jJ as Mp,kJ as Np,bJ as Op,O as Pp,e as Qp,KF as Rp,p as Sp,gJ as Tp,DF as Up,vJ as Vp,yJ as Wp,R as Xp,QF as Yp,zF as Zp,WF as _p,uJ as $p,iJ as aq,pJ as bq,cJ as cq,dJ as dq,fJ as eq,tJ as fq,JQ as gq,T as hq,CJ as iq,OJ as jq,IJ as kq,y as lq,PJ as mq,UF as nq,QQ as oq,zJ as pq,YQ as qq,$Q as rq,LQ as sq,EF as tq,UQ as uq,wQ as vq,EQ as wq,GQ as xq,MQ as yq,KQ as zq,qQ as Aq,DQ as Bq,OQ as Cq,IQ as Dq,PQ as Eq,zQ as Fq};