@qitqode/qitqode-android-arm64 0.2.6 → 0.2.8

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 (408) hide show
  1. package/bundle/chunk-03zpnwk2.js +2 -0
  2. package/bundle/{chunk-p54bzjtv.js → chunk-060wbpz4.js} +1 -1
  3. package/bundle/{chunk-j0bwa5dk.js → chunk-0a4pmkc9.js} +2 -2
  4. package/bundle/chunk-0aqdzyar.js +2 -0
  5. package/bundle/{chunk-vygkwwjd.js → chunk-0egrckx0.js} +2 -2
  6. package/bundle/{chunk-bwbqkfv0.js → chunk-0ffmwhw7.js} +1 -1
  7. package/bundle/{chunk-953pqp3w.js → chunk-0tcggtwv.js} +1 -1
  8. package/bundle/{chunk-tkrwcjkr.js → chunk-0tm6589k.js} +2 -2
  9. package/bundle/{chunk-y7hgevfv.js → chunk-0w19vmd7.js} +2 -2
  10. package/bundle/{chunk-ehb4hd9c.js → chunk-0z1keh2w.js} +1 -1
  11. package/bundle/{chunk-at22twxx.js → chunk-1bxfzd6r.js} +2 -2
  12. package/bundle/{chunk-48r70n4s.js → chunk-1har4t9a.js} +1 -1
  13. package/bundle/{chunk-sfw5qddj.js → chunk-1p9s5jj1.js} +1 -1
  14. package/bundle/{chunk-2md6sx8d.js → chunk-1rgt2vmt.js} +1 -1
  15. package/bundle/{chunk-ksme3gj1.js → chunk-1v0khv7p.js} +1 -1
  16. package/bundle/{chunk-a7rp46yt.js → chunk-26cr51wa.js} +5 -5
  17. package/bundle/{chunk-fhqfqd5v.js → chunk-27saej0r.js} +2 -2
  18. package/bundle/{chunk-9hz56z6a.js → chunk-29gwtcey.js} +1 -1
  19. package/bundle/chunk-2a5gjgvp.js +2 -0
  20. package/bundle/{chunk-venprxdp.js → chunk-2caaqmec.js} +1 -1
  21. package/bundle/{chunk-ff548b0j.js → chunk-2kh0tg92.js} +2 -2
  22. package/bundle/{chunk-6evh2ke8.js → chunk-2nheahmq.js} +1 -1
  23. package/bundle/chunk-2pkfphgb.js +2 -0
  24. package/bundle/{chunk-99s035f0.js → chunk-2qm46qvn.js} +2 -2
  25. package/bundle/{chunk-8e4s6nc2.js → chunk-2t5yh25f.js} +1 -1
  26. package/bundle/{chunk-k1nh5sd2.js → chunk-2vaphpz0.js} +1 -1
  27. package/bundle/{chunk-f3zmdfqa.js → chunk-33ebjca6.js} +1 -1
  28. package/bundle/{chunk-2drzgtv3.js → chunk-35fj1sfm.js} +2 -2
  29. package/bundle/chunk-37cbrnke.js +8 -0
  30. package/bundle/{chunk-3kpse7zy.js → chunk-3bb4aqh9.js} +1 -1
  31. package/bundle/chunk-3cx4p07h.js +2 -0
  32. package/bundle/chunk-3f2cjzb4.js +2 -0
  33. package/bundle/chunk-3qvap1kv.js +2 -0
  34. package/bundle/{chunk-p6crzjtf.js → chunk-3va85mbe.js} +2 -2
  35. package/bundle/{chunk-y67kaj0b.js → chunk-3z2zn8rj.js} +1 -1
  36. package/bundle/{chunk-bzebyyfr.js → chunk-3zwma68w.js} +4 -4
  37. package/bundle/{chunk-4pshnq6g.js → chunk-4064rbtp.js} +1 -1
  38. package/bundle/chunk-42hvspe7.js +2 -0
  39. package/bundle/chunk-452tk6v3.js +2 -0
  40. package/bundle/{chunk-ejqzcdcx.js → chunk-48gap82w.js} +1 -1
  41. package/bundle/{chunk-ycvwpmd9.js → chunk-4aajzxm9.js} +2 -2
  42. package/bundle/chunk-4gqb1hps.js +2 -0
  43. package/bundle/{chunk-e8p92vz4.js → chunk-4pmvxnkj.js} +2 -2
  44. package/bundle/chunk-50qgz5ka.js +2 -0
  45. package/bundle/{chunk-zc0cdvcv.js → chunk-52xvhxek.js} +2 -2
  46. package/bundle/{chunk-y0527cg0.js → chunk-56wq8cqj.js} +1 -1
  47. package/bundle/{chunk-tzb26ntq.js → chunk-58f4y4b7.js} +3 -3
  48. package/bundle/{chunk-tr6rdr6h.js → chunk-59csnjc3.js} +2 -2
  49. package/bundle/chunk-5b0xyq5z.js +2 -0
  50. package/bundle/{chunk-mn9end71.js → chunk-5bv63rqj.js} +1 -1
  51. package/bundle/{chunk-w4synhfg.js → chunk-5cw8235e.js} +1 -1
  52. package/bundle/{chunk-5asx1706.js → chunk-5f0nhthe.js} +2 -2
  53. package/bundle/chunk-5j4nxpdy.js +2 -0
  54. package/bundle/{chunk-cbnkx933.js → chunk-5nmm1kvx.js} +2 -2
  55. package/bundle/chunk-5nxgk6hw.js +2 -0
  56. package/bundle/chunk-5qkvhr6y.js +2 -0
  57. package/bundle/{chunk-avefgbjg.js → chunk-5r7c6vvx.js} +2 -2
  58. package/bundle/{chunk-z6sbjvtv.js → chunk-5wx962mw.js} +1 -1
  59. package/bundle/{chunk-mhhtf0v3.js → chunk-5xkp27b1.js} +1 -1
  60. package/bundle/chunk-66qmmmdp.js +2 -0
  61. package/bundle/{chunk-3cr2p4mp.js → chunk-66wv82vf.js} +1 -1
  62. package/bundle/chunk-6dpdkzrk.js +2 -0
  63. package/bundle/chunk-6p6m5956.js +3 -0
  64. package/bundle/{chunk-dnsh1v42.js → chunk-6ps30qax.js} +2 -2
  65. package/bundle/{chunk-hqbbs9dm.js → chunk-6qwk6z87.js} +3 -3
  66. package/bundle/{chunk-khzzmyk2.js → chunk-6tqbnxar.js} +1 -1
  67. package/bundle/chunk-6yhn9syz.js +2 -0
  68. package/bundle/{chunk-m5dm7a1t.js → chunk-72crs18f.js} +1 -1
  69. package/bundle/{chunk-hwrrrbqd.js → chunk-7adsab4h.js} +1 -1
  70. package/bundle/{chunk-97q2t1yz.js → chunk-7b60whxm.js} +1 -1
  71. package/bundle/chunk-7g59hc61.js +2 -0
  72. package/bundle/{chunk-5pzs51sp.js → chunk-7jy53zqy.js} +1 -1
  73. package/bundle/chunk-7p88j56s.js +2 -0
  74. package/bundle/{chunk-3jf3jhrs.js → chunk-7thhd7ds.js} +1 -1
  75. package/bundle/chunk-7trngc9g.js +2 -0
  76. package/bundle/{chunk-5df5aja0.js → chunk-82xrfk5x.js} +2 -2
  77. package/bundle/{chunk-jqk3v8d6.js → chunk-85wh85pk.js} +1 -1
  78. package/bundle/chunk-8cebbmtf.js +2 -0
  79. package/bundle/chunk-8csas2jc.js +2 -0
  80. package/bundle/chunk-8g4jdqq1.js +2 -0
  81. package/bundle/chunk-8j1xcdmd.js +2 -0
  82. package/bundle/{chunk-7vmx8bg9.js → chunk-8jmb5bd4.js} +2 -2
  83. package/bundle/{chunk-8wwdrwf2.js → chunk-8p0t8qah.js} +1 -1
  84. package/bundle/{chunk-bbng1cea.js → chunk-8ysp6vf8.js} +1 -1
  85. package/bundle/{chunk-rn83r0js.js → chunk-8yzghzjq.js} +1 -1
  86. package/bundle/{chunk-q3nvzhyh.js → chunk-9009v4d0.js} +2 -2
  87. package/bundle/chunk-90r2z49k.js +2 -0
  88. package/bundle/{chunk-j164q40b.js → chunk-92r1gw2j.js} +2 -2
  89. package/bundle/chunk-94mjwy22.js +2 -0
  90. package/bundle/{chunk-xdteq9bd.js → chunk-9cf2ktyh.js} +1 -1
  91. package/bundle/{chunk-ngfxxfem.js → chunk-9cn8cmt0.js} +1 -1
  92. package/bundle/{chunk-55ykn8nz.js → chunk-a1z8rnq7.js} +4 -4
  93. package/bundle/{chunk-j9h1sp4g.js → chunk-a48mx917.js} +2 -2
  94. package/bundle/{chunk-et3804wr.js → chunk-a8bjcvda.js} +1 -1
  95. package/bundle/chunk-aenrd7dk.js +2 -0
  96. package/bundle/{chunk-cz5vta94.js → chunk-afr8m0q1.js} +1 -1
  97. package/bundle/{chunk-f31yvp20.js → chunk-ag8wxwwz.js} +1 -1
  98. package/bundle/chunk-ahmy80vb.js +2 -0
  99. package/bundle/chunk-avn12jkt.js +2 -0
  100. package/bundle/{chunk-6scf311w.js → chunk-ax64ngf2.js} +1 -1
  101. package/bundle/{chunk-43ttzy29.js → chunk-ayb3bdb7.js} +2 -2
  102. package/bundle/{chunk-dnnkq5y4.js → chunk-az3nss5m.js} +2 -2
  103. package/bundle/chunk-b7ncyat6.js +2 -0
  104. package/bundle/{chunk-g3wvtyw3.js → chunk-b7sr9rn3.js} +1 -1
  105. package/bundle/{chunk-24rkf2gk.js → chunk-bc2krtaf.js} +1 -1
  106. package/bundle/{chunk-gjd3wf8b.js → chunk-bjv1h2dq.js} +1 -1
  107. package/bundle/{chunk-cng61dby.js → chunk-bnaj2hh3.js} +1 -1
  108. package/bundle/{chunk-70q8qcb2.js → chunk-bpfq8fz4.js} +1 -1
  109. package/bundle/chunk-brk6bge4.js +3 -0
  110. package/bundle/{chunk-eg3syjtv.js → chunk-bwadggys.js} +2 -2
  111. package/bundle/chunk-c2a74stf.js +2 -0
  112. package/bundle/{chunk-q9tgdghx.js → chunk-c3yjbent.js} +1 -1
  113. package/bundle/{chunk-7x6yrtzn.js → chunk-c76cjhn0.js} +1 -1
  114. package/bundle/{chunk-21rq4592.js → chunk-ccf4pgkr.js} +2 -2
  115. package/bundle/chunk-ce5e7j62.js +2 -0
  116. package/bundle/{chunk-tm34qp8j.js → chunk-cf9m9m9q.js} +1 -1
  117. package/bundle/{chunk-39z96pc6.js → chunk-cfwz1hgr.js} +3 -3
  118. package/bundle/{chunk-jww55nk9.js → chunk-cghz0855.js} +1 -1
  119. package/bundle/{chunk-5c2438af.js → chunk-cr5tknvb.js} +1 -1
  120. package/bundle/chunk-cw1gwjx9.js +2 -0
  121. package/bundle/chunk-czw30fjs.js +2 -0
  122. package/bundle/{chunk-05ck7acg.js → chunk-d30k7dpf.js} +1 -1
  123. package/bundle/{chunk-mjjaezwq.js → chunk-d839fr0w.js} +2 -2
  124. package/bundle/{chunk-nmzrrqgb.js → chunk-ddx2pcr4.js} +1 -1
  125. package/bundle/{chunk-pmg53fdd.js → chunk-dgcannw0.js} +1 -1
  126. package/bundle/{chunk-vnrjk2be.js → chunk-dhvx9p54.js} +1 -1
  127. package/bundle/chunk-dmkgjf1v.js +3 -0
  128. package/bundle/{chunk-nj1ntakd.js → chunk-dt3bsmfe.js} +2 -2
  129. package/bundle/chunk-dwhsvpag.js +2 -0
  130. package/bundle/{chunk-0smnwqk6.js → chunk-dwkrqtbc.js} +2 -2
  131. package/bundle/chunk-e01jgnnm.js +2 -0
  132. package/bundle/chunk-e0hfpdje.js +2 -0
  133. package/bundle/{chunk-r9w0thdk.js → chunk-e0vrxetq.js} +1 -1
  134. package/bundle/{chunk-k4gsktts.js → chunk-e2wfj86b.js} +1 -1
  135. package/bundle/chunk-e5jk67xh.js +2 -0
  136. package/bundle/{chunk-wkg3c643.js → chunk-eacpc64g.js} +2 -2
  137. package/bundle/{chunk-47k5jy1p.js → chunk-eewe7tx1.js} +2 -2
  138. package/bundle/{chunk-y29ejqg2.js → chunk-eg1m81ax.js} +1 -1
  139. package/bundle/chunk-eg4pq4hv.js +2 -0
  140. package/bundle/{chunk-bne5w117.js → chunk-ejhhrece.js} +3 -3
  141. package/bundle/{chunk-d7nsd979.js → chunk-epmc4aht.js} +1 -1
  142. package/bundle/chunk-ew3yz97p.js +2 -0
  143. package/bundle/{chunk-32j0q58h.js → chunk-eyr5ymt8.js} +1 -1
  144. package/bundle/chunk-ezgfhy4e.js +2 -0
  145. package/bundle/{chunk-45a4n21f.js → chunk-f2v4g7t1.js} +1 -1
  146. package/bundle/chunk-f2yfyhh8.js +2 -0
  147. package/bundle/chunk-f30em1wx.js +2 -0
  148. package/bundle/{chunk-5w76kdjr.js → chunk-f4mnp6xd.js} +1 -1
  149. package/bundle/{chunk-bkct64rs.js → chunk-f81kk8ra.js} +1 -1
  150. package/bundle/{chunk-3ktzxj69.js → chunk-f8cae1ap.js} +1 -1
  151. package/bundle/{chunk-ybane1en.js → chunk-fa8pwdwv.js} +1 -1
  152. package/bundle/{chunk-wwdpw27v.js → chunk-fej5x648.js} +1 -1
  153. package/bundle/{chunk-8yvx3pgy.js → chunk-fge37dke.js} +1 -1
  154. package/bundle/{chunk-nty5z2cj.js → chunk-fh3d0wce.js} +1 -1
  155. package/bundle/{chunk-gszvgz76.js → chunk-fjftb2sz.js} +2 -2
  156. package/bundle/{chunk-c36p881g.js → chunk-fs1vb39f.js} +3 -3
  157. package/bundle/{chunk-0xrb12s8.js → chunk-ftvvm4r5.js} +2 -2
  158. package/bundle/{chunk-nrat6ncm.js → chunk-fw1f47de.js} +1 -1
  159. package/bundle/{chunk-m7ganre7.js → chunk-g26redah.js} +1 -1
  160. package/bundle/{chunk-7g66qc1v.js → chunk-g3n465ee.js} +2 -2
  161. package/bundle/{chunk-313zqzc1.js → chunk-g4tyaj0m.js} +1 -1
  162. package/bundle/{chunk-fjbv3jht.js → chunk-g6y2c5az.js} +1 -1
  163. package/bundle/{chunk-qnvsqnz5.js → chunk-g7v6sp3c.js} +2 -2
  164. package/bundle/{chunk-n23d0q00.js → chunk-g878zd6e.js} +1 -1
  165. package/bundle/{chunk-p5be5ddp.js → chunk-g9nwqwqp.js} +1 -1
  166. package/bundle/chunk-gbvm6dpv.js +2 -0
  167. package/bundle/{chunk-fsqses4g.js → chunk-gc5rhnht.js} +2 -2
  168. package/bundle/{chunk-kengqzja.js → chunk-gefx3n08.js} +2 -2
  169. package/bundle/{chunk-yz25607t.js → chunk-ggncq8w8.js} +1 -1
  170. package/bundle/{chunk-7mppvhv9.js → chunk-gsg6zn7e.js} +2 -2
  171. package/bundle/{chunk-5nrc5rhh.js → chunk-gznt3dv8.js} +1 -1
  172. package/bundle/{chunk-p169ee92.js → chunk-h1bvqstw.js} +1 -1
  173. package/bundle/{chunk-pe2xdkez.js → chunk-h4hs2rhf.js} +2 -2
  174. package/bundle/chunk-h5w91zr4.js +2 -0
  175. package/bundle/{chunk-d6jhs818.js → chunk-h8mfbbjh.js} +2 -2
  176. package/bundle/{chunk-hjt94wce.js → chunk-he9kpk9r.js} +282 -276
  177. package/bundle/chunk-hmpb3c21.js +2 -0
  178. package/bundle/{chunk-920z7g7j.js → chunk-hz02vrqs.js} +1 -1
  179. package/bundle/{chunk-68v3b6ns.js → chunk-j10a984e.js} +2 -2
  180. package/bundle/chunk-j32rr7rt.js +2 -0
  181. package/bundle/chunk-j871xzr7.js +2 -0
  182. package/bundle/{chunk-0qd3567w.js → chunk-jmmtcr2r.js} +1 -1
  183. package/bundle/{chunk-has2rz35.js → chunk-jpn9zfj5.js} +1 -1
  184. package/bundle/{chunk-vshycswk.js → chunk-jqj1ay7x.js} +1 -1
  185. package/bundle/{chunk-vsz4s6zt.js → chunk-jr80q31w.js} +1 -1
  186. package/bundle/chunk-k3hgwszx.js +2 -0
  187. package/bundle/{chunk-wy3a4cab.js → chunk-kckr30tf.js} +1 -1
  188. package/bundle/{chunk-z1932c3f.js → chunk-kgv68cpb.js} +1 -1
  189. package/bundle/{chunk-vkaa7k3e.js → chunk-khpfseej.js} +2 -2
  190. package/bundle/{chunk-bd21p9zz.js → chunk-kre93a89.js} +2 -2
  191. package/bundle/{chunk-smznrv7k.js → chunk-kveztc6k.js} +1 -1
  192. package/bundle/{chunk-jnrnncqc.js → chunk-kwfe4em6.js} +1 -1
  193. package/bundle/chunk-kx88qekb.js +2 -0
  194. package/bundle/{chunk-4agaj51z.js → chunk-m4r8sepw.js} +1 -1
  195. package/bundle/{chunk-bqn6bqws.js → chunk-m7tmgvh6.js} +1 -1
  196. package/bundle/{chunk-qp1n7kwe.js → chunk-makegrxs.js} +1 -1
  197. package/bundle/{chunk-yhj01dz9.js → chunk-mr17tppa.js} +2 -2
  198. package/bundle/{chunk-5pwv2p3s.js → chunk-mv7q6ach.js} +1 -1
  199. package/bundle/chunk-n61e0znt.js +2 -0
  200. package/bundle/{chunk-j8fcfhr2.js → chunk-n6tqtk6h.js} +2 -2
  201. package/bundle/chunk-n6v36np0.js +2 -0
  202. package/bundle/chunk-ndd4cn3z.js +2 -0
  203. package/bundle/{chunk-t5r3w9e1.js → chunk-nfafk3ts.js} +1 -1
  204. package/bundle/{chunk-kth84vdn.js → chunk-nga216dm.js} +1 -1
  205. package/bundle/{chunk-cj7r8w1e.js → chunk-njsmma3a.js} +1 -1
  206. package/bundle/chunk-nr2j8ytn.js +3 -0
  207. package/bundle/{chunk-rrv0n73b.js → chunk-ntr0ezf2.js} +1 -1
  208. package/bundle/chunk-nwj6mcxz.js +2 -0
  209. package/bundle/{chunk-t239rvej.js → chunk-p2fte9vz.js} +2 -2
  210. package/bundle/chunk-p5b5ekhh.js +2 -0
  211. package/bundle/{chunk-vf492zs6.js → chunk-p8ak162p.js} +1 -1
  212. package/bundle/chunk-pf23nw4z.js +2 -0
  213. package/bundle/{chunk-0428v6mw.js → chunk-phf37x1c.js} +1 -1
  214. package/bundle/{chunk-faee8zgc.js → chunk-phpxxd48.js} +1 -1
  215. package/bundle/{chunk-5tky3csh.js → chunk-pqg1wjb5.js} +1 -1
  216. package/bundle/chunk-pw3cv89g.js +2 -0
  217. package/bundle/{chunk-d51908mv.js → chunk-q3c8mfbq.js} +1 -1
  218. package/bundle/{chunk-ypdt9mmr.js → chunk-qbnt4ynd.js} +2 -2
  219. package/bundle/chunk-qc89yj61.js +2 -0
  220. package/bundle/{chunk-k5q9px67.js → chunk-qgek59e6.js} +1 -1
  221. package/bundle/{chunk-v6v9xn81.js → chunk-qgfbsmsx.js} +1 -1
  222. package/bundle/{chunk-450fef7h.js → chunk-qgkb6n8k.js} +2 -2
  223. package/bundle/{chunk-xe69cnsk.js → chunk-qk1jkc0n.js} +1 -1
  224. package/bundle/{chunk-w4brava0.js → chunk-qk5vy2pr.js} +1 -1
  225. package/bundle/chunk-qn8tz704.js +2 -0
  226. package/bundle/{chunk-k3dacdp5.js → chunk-qq9m8fxv.js} +7 -7
  227. package/bundle/{chunk-q3h42a94.js → chunk-qxdpgdfk.js} +2 -2
  228. package/bundle/chunk-qxre2gqn.js +2 -0
  229. package/bundle/chunk-rdk62809.js +2 -0
  230. package/bundle/chunk-rew6r516.js +2 -0
  231. package/bundle/chunk-rjhvdfn5.js +2 -0
  232. package/bundle/{chunk-wyj8cpx5.js → chunk-rk0fnvp5.js} +1 -1
  233. package/bundle/{chunk-mh19kwzw.js → chunk-rmsqb6r4.js} +1 -1
  234. package/bundle/{chunk-jg1ccs3j.js → chunk-rva2ekrt.js} +1 -1
  235. package/bundle/{chunk-ac7482n2.js → chunk-rwnwjm82.js} +2 -2
  236. package/bundle/{chunk-ggxzf22k.js → chunk-rye1yjnr.js} +1 -1
  237. package/bundle/{chunk-s4vx9x1v.js → chunk-ryrxgn6d.js} +1 -1
  238. package/bundle/{chunk-pxm4qvqk.js → chunk-s2tc3qs0.js} +2 -2
  239. package/bundle/{chunk-mhtxp66q.js → chunk-s8z7v1me.js} +2 -2
  240. package/bundle/{chunk-9zm6r55d.js → chunk-sa0rrreh.js} +2 -2
  241. package/bundle/{chunk-mmjgf680.js → chunk-sbjymf20.js} +2 -2
  242. package/bundle/{chunk-ptqk1j2r.js → chunk-scnbt714.js} +1 -1
  243. package/bundle/chunk-skgr9ypq.js +2 -0
  244. package/bundle/{chunk-tg226j37.js → chunk-sm1g81cv.js} +1 -1
  245. package/bundle/chunk-sv40pwe2.js +2 -0
  246. package/bundle/{chunk-3vvd7j14.js → chunk-sy9w1t2y.js} +1 -1
  247. package/bundle/{chunk-p4027t94.js → chunk-sz0favtz.js} +1 -1
  248. package/bundle/{chunk-g22e4gw7.js → chunk-t18ka1e7.js} +1 -1
  249. package/bundle/{chunk-7hvf9dgx.js → chunk-t3w43rft.js} +1 -1
  250. package/bundle/{chunk-5zkj5xv9.js → chunk-t6zz47zk.js} +2 -2
  251. package/bundle/{chunk-6m9jb0s9.js → chunk-t8fjgkp8.js} +2 -2
  252. package/bundle/{chunk-7bcm7gg1.js → chunk-tbx741en.js} +1 -1
  253. package/bundle/chunk-tfhpjmny.js +2 -0
  254. package/bundle/chunk-tnete6ye.js +2 -0
  255. package/bundle/chunk-tpyq7ycb.js +2 -0
  256. package/bundle/{chunk-ezrqhqkp.js → chunk-trstb8ee.js} +1 -1
  257. package/bundle/{chunk-h9wh48d0.js → chunk-tsmj98yf.js} +2 -2
  258. package/bundle/{chunk-m80v76m9.js → chunk-txkdt4ep.js} +1 -1
  259. package/bundle/chunk-v5h5wxw5.js +2 -0
  260. package/bundle/chunk-v6141yq1.js +2 -0
  261. package/bundle/{chunk-cmb62jkt.js → chunk-vbfej8ds.js} +2 -2
  262. package/bundle/chunk-vfd3azkp.js +3 -0
  263. package/bundle/chunk-vjs69r6x.js +2 -0
  264. package/bundle/{chunk-xy0gnpen.js → chunk-vkjqy92f.js} +1 -1
  265. package/bundle/chunk-vmhar83s.js +2 -0
  266. package/bundle/{chunk-24ygjbpf.js → chunk-vph4w4yy.js} +2 -2
  267. package/bundle/chunk-vqvnw12p.js +2 -0
  268. package/bundle/{chunk-h62chdmw.js → chunk-vr8nwzp0.js} +1 -1
  269. package/bundle/{chunk-w46g7kdq.js → chunk-vs3s49jw.js} +2 -2
  270. package/bundle/{chunk-n78f8hfk.js → chunk-vsqvnxbz.js} +1 -1
  271. package/bundle/{chunk-t8c4cs6z.js → chunk-w0nc0gcx.js} +1 -1
  272. package/bundle/{chunk-qkvqvgcx.js → chunk-w0sng8a9.js} +1 -1
  273. package/bundle/chunk-w0sztk4y.js +2 -0
  274. package/bundle/chunk-w6bb320d.js +2 -0
  275. package/bundle/{chunk-55fcmswd.js → chunk-w7a33cwa.js} +2 -2
  276. package/bundle/{chunk-fyhqp4pb.js → chunk-w9qh2479.js} +1 -1
  277. package/bundle/{chunk-xwdxgg16.js → chunk-waa1ggtj.js} +1 -1
  278. package/bundle/{chunk-fr34mnyg.js → chunk-wb05bp10.js} +2 -2
  279. package/bundle/{chunk-gy21fw82.js → chunk-wb47k8ah.js} +2 -2
  280. package/bundle/{chunk-dxdggn90.js → chunk-wd8f9r4k.js} +1 -1
  281. package/bundle/chunk-wf41m019.js +2 -0
  282. package/bundle/{chunk-r5zy4za0.js → chunk-wgkcyqn1.js} +2 -2
  283. package/bundle/{chunk-ph8hn1wt.js → chunk-wm9nh9nb.js} +2 -2
  284. package/bundle/{chunk-g42krp0z.js → chunk-wn63q3xp.js} +1 -1
  285. package/bundle/{chunk-73r8bjjz.js → chunk-wqk1v8t0.js} +2 -2
  286. package/bundle/chunk-wqw6yjrg.js +2 -0
  287. package/bundle/{chunk-qey1efpx.js → chunk-wr6rnxr5.js} +1 -1
  288. package/bundle/chunk-ws08rxge.js +2 -0
  289. package/bundle/{chunk-xdd3553a.js → chunk-wtt5wms9.js} +1 -1
  290. package/bundle/{chunk-pb30kkbs.js → chunk-wtxh5m6j.js} +3 -3
  291. package/bundle/chunk-wz3dvc3g.js +2 -0
  292. package/bundle/{chunk-p4b0s5td.js → chunk-x00hwy3x.js} +1 -1
  293. package/bundle/chunk-x2pmqvdc.js +2 -0
  294. package/bundle/chunk-x4wfq39v.js +2 -0
  295. package/bundle/{chunk-pt0xphq9.js → chunk-xs6v0r9m.js} +1 -1
  296. package/bundle/{chunk-d0x5pbkm.js → chunk-xy8arehp.js} +1 -1
  297. package/bundle/{chunk-0cnwsf8p.js → chunk-y0h3jfkj.js} +1 -1
  298. package/bundle/{chunk-pr7z5dj8.js → chunk-y3gy62q5.js} +1 -1
  299. package/bundle/chunk-yb6m08zj.js +2 -0
  300. package/bundle/chunk-ybcqkgs7.js +2 -0
  301. package/bundle/{chunk-vcygx6hs.js → chunk-ydgst3h8.js} +2 -2
  302. package/bundle/{chunk-qxcyz5hc.js → chunk-ykpj10nz.js} +2 -2
  303. package/bundle/{chunk-t0761rhq.js → chunk-ynf17943.js} +2 -2
  304. package/bundle/{chunk-da6kggv7.js → chunk-ytyzrqev.js} +2 -2
  305. package/bundle/{chunk-ztyy3ga3.js → chunk-z0kbyr00.js} +2 -2
  306. package/bundle/{chunk-65bmsp2t.js → chunk-zfrftgcy.js} +1 -1
  307. package/bundle/chunk-zj1jc1xt.js +2 -0
  308. package/bundle/chunk-zm0m0504.js +2 -0
  309. package/bundle/{chunk-w9gzfsy7.js → chunk-zqdjk4rf.js} +2 -2
  310. package/bundle/{chunk-ha1w0xzh.js → chunk-zrhw1szj.js} +1 -1
  311. package/bundle/{chunk-804vmbcd.js → chunk-zsg29gba.js} +1 -1
  312. package/bundle/{chunk-6ar91jvd.js → chunk-zwhmg9dj.js} +1 -1
  313. package/bundle/index.js +3 -3
  314. package/bundle/parser.worker.js +2 -2
  315. package/bundle/worker.js +1 -1
  316. package/package.json +1 -1
  317. package/bundle/chunk-0ppnq3a4.js +0 -2
  318. package/bundle/chunk-0te0vcdn.js +0 -2
  319. package/bundle/chunk-11h06z17.js +0 -2
  320. package/bundle/chunk-28yv4fqe.js +0 -2
  321. package/bundle/chunk-34a52hyr.js +0 -2
  322. package/bundle/chunk-3d73kfea.js +0 -2
  323. package/bundle/chunk-3n3gb3vd.js +0 -2
  324. package/bundle/chunk-3sq60y9f.js +0 -2
  325. package/bundle/chunk-49mbnqvc.js +0 -2
  326. package/bundle/chunk-4fr6kae9.js +0 -2
  327. package/bundle/chunk-516w1nc4.js +0 -2
  328. package/bundle/chunk-535nm66j.js +0 -2
  329. package/bundle/chunk-5kpxpm8e.js +0 -2
  330. package/bundle/chunk-5nm5s0h2.js +0 -2
  331. package/bundle/chunk-5ysbwr4x.js +0 -3
  332. package/bundle/chunk-6dvmyeg7.js +0 -2
  333. package/bundle/chunk-6ex981t8.js +0 -2
  334. package/bundle/chunk-6gpf2bjs.js +0 -2
  335. package/bundle/chunk-6jeg2r5j.js +0 -2
  336. package/bundle/chunk-6nry7tah.js +0 -2
  337. package/bundle/chunk-7bgzcpdw.js +0 -2
  338. package/bundle/chunk-7kjvcbwa.js +0 -2
  339. package/bundle/chunk-7x30x94y.js +0 -2
  340. package/bundle/chunk-86hsh44c.js +0 -3
  341. package/bundle/chunk-8jma2btf.js +0 -2
  342. package/bundle/chunk-8sbb95a4.js +0 -2
  343. package/bundle/chunk-93e0w75z.js +0 -2
  344. package/bundle/chunk-97gp818s.js +0 -2
  345. package/bundle/chunk-9epf2zbh.js +0 -2
  346. package/bundle/chunk-agv04nt7.js +0 -2
  347. package/bundle/chunk-be7smmar.js +0 -2
  348. package/bundle/chunk-bg1t0kke.js +0 -2
  349. package/bundle/chunk-bryx5cx9.js +0 -2
  350. package/bundle/chunk-c13rrw41.js +0 -2
  351. package/bundle/chunk-c2kkv619.js +0 -2
  352. package/bundle/chunk-c3zge8cg.js +0 -3
  353. package/bundle/chunk-c5xj1y5v.js +0 -2
  354. package/bundle/chunk-cfhfc86j.js +0 -8
  355. package/bundle/chunk-ckpm4dvv.js +0 -2
  356. package/bundle/chunk-cqkaamvn.js +0 -2
  357. package/bundle/chunk-ct8twng1.js +0 -2
  358. package/bundle/chunk-d38y7bvh.js +0 -2
  359. package/bundle/chunk-d6hxsfm6.js +0 -2
  360. package/bundle/chunk-descb9jz.js +0 -2
  361. package/bundle/chunk-dvr2b9r1.js +0 -2
  362. package/bundle/chunk-ea5fktnn.js +0 -2
  363. package/bundle/chunk-f0t7rryn.js +0 -3
  364. package/bundle/chunk-f4mf6tpp.js +0 -2
  365. package/bundle/chunk-f97k17t8.js +0 -2
  366. package/bundle/chunk-g4ehhdzp.js +0 -2
  367. package/bundle/chunk-gd6qpdjw.js +0 -2
  368. package/bundle/chunk-gdn91t9j.js +0 -2
  369. package/bundle/chunk-gehn9fd9.js +0 -2
  370. package/bundle/chunk-hhax4mxw.js +0 -2
  371. package/bundle/chunk-hjb1etf8.js +0 -2
  372. package/bundle/chunk-jvkzdap1.js +0 -2
  373. package/bundle/chunk-kg8fcv91.js +0 -2
  374. package/bundle/chunk-kgptyf7n.js +0 -3
  375. package/bundle/chunk-kjjjrjnb.js +0 -2
  376. package/bundle/chunk-ky88ba80.js +0 -2
  377. package/bundle/chunk-m5cfmhwh.js +0 -2
  378. package/bundle/chunk-m7qxxbns.js +0 -2
  379. package/bundle/chunk-n8wg5h5p.js +0 -2
  380. package/bundle/chunk-nvs0d8jg.js +0 -2
  381. package/bundle/chunk-p6hcj3kv.js +0 -2
  382. package/bundle/chunk-pexmns0j.js +0 -2
  383. package/bundle/chunk-pt603np4.js +0 -2
  384. package/bundle/chunk-pz1avwyt.js +0 -2
  385. package/bundle/chunk-qk5bfcv8.js +0 -2
  386. package/bundle/chunk-qr06byhp.js +0 -2
  387. package/bundle/chunk-r7sq3maz.js +0 -2
  388. package/bundle/chunk-rcrjbhaz.js +0 -2
  389. package/bundle/chunk-rmgs9nmj.js +0 -2
  390. package/bundle/chunk-rytavefg.js +0 -2
  391. package/bundle/chunk-sh9vjnsh.js +0 -2
  392. package/bundle/chunk-st0c5wwc.js +0 -2
  393. package/bundle/chunk-teb3k2sf.js +0 -2
  394. package/bundle/chunk-ts798jvf.js +0 -2
  395. package/bundle/chunk-tx5aj02v.js +0 -2
  396. package/bundle/chunk-v1t51rrq.js +0 -2
  397. package/bundle/chunk-vdrz2t9c.js +0 -2
  398. package/bundle/chunk-vh9ptqn0.js +0 -2
  399. package/bundle/chunk-vj4x8hvz.js +0 -2
  400. package/bundle/chunk-w72rctxz.js +0 -2
  401. package/bundle/chunk-wbw9zv3h.js +0 -2
  402. package/bundle/chunk-x6mw98c2.js +0 -2
  403. package/bundle/chunk-y6p57wgh.js +0 -2
  404. package/bundle/chunk-y6xs8v17.js +0 -2
  405. package/bundle/chunk-z3xsfpc6.js +0 -2
  406. package/bundle/chunk-zkm3yyyf.js +0 -2
  407. package/bundle/chunk-zn5pw733.js +0 -2
  408. package/bundle/chunk-zxwvnmea.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{i as P,j as g,k as b,l as h,m as O}from"./chunk-ehb4hd9c.js";import"./chunk-ff548b0j.js";import"./chunk-zc0cdvcv.js";import{ae as u}from"./chunk-5w76kdjr.js";import{dg as s}from"./chunk-eg3syjtv.js";import{Bh as f}from"./chunk-hjt94wce.js";import{Ch as E}from"./chunk-w46g7kdq.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-6m9jb0s9.js";import"./chunk-vygkwwjd.js";import{Aj as S,Bj as p}from"./chunk-k3dacdp5.js";import"./chunk-99s035f0.js";import"./chunk-h9wh48d0.js";import"./chunk-tzb26ntq.js";import"./chunk-mh19kwzw.js";import"./chunk-q3h42a94.js";import"./chunk-hqbbs9dm.js";import"./chunk-9zm6r55d.js";import"./chunk-vcygx6hs.js";import"./chunk-khzzmyk2.js";import"./chunk-y7hgevfv.js";import"./chunk-47k5jy1p.js";import"./chunk-cfhfc86j.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-dnnkq5y4.js";import"./chunk-t239rvej.js";import"./chunk-yz25607t.js";import"./chunk-7hvf9dgx.js";import"./chunk-wkg3c643.js";import"./chunk-fhqfqd5v.js";import"./chunk-q3nvzhyh.js";import"./chunk-5df5aja0.js";import"./chunk-73r8bjjz.js";import"./chunk-xy0gnpen.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import"./chunk-nj1ntakd.js";import"./chunk-cmb62jkt.js";import"./chunk-tkrwcjkr.js";import"./chunk-vdrz2t9c.js";import"./chunk-fr34mnyg.js";import"./chunk-r5zy4za0.js";import"./chunk-tr6rdr6h.js";import"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import{Qy as I}from"./chunk-55fcmswd.js";import{AC as D,eH as l,lB as d}from"./chunk-qnvsqnz5.js";import"./chunk-pxm4qvqk.js";import"./chunk-j8fcfhr2.js";import"./chunk-r9w0thdk.js";var A=(o)=>l.promise(()=>E(o)),m=(o)=>l.sync(()=>s.println(o)),v=(o)=>s.Style.TEXT_DIM+o+s.Style.TEXT_NORMAL,L=(o)=>o?v(" (active)"):"",w=(o,e)=>`${o.email} ${v(o.url)}${L(e)}`,x=(o,e,t)=>`${e.name} (${o.email})${L(t)}`,C=(o,e,t)=>{let n=t?s.Style.TEXT_SUCCESS+"\u25CF"+s.Style.TEXT_NORMAL:" ",c=t?s.Style.TEXT_HIGHLIGHT_BOLD+e.name+s.Style.TEXT_NORMAL:e.name;return` ${n} ${c} ${v(o.email)} ${v(o.url)} ${v(e.id)}`},T=(o,e)=>d.isSome(o)&&o.value.id===e.accountID&&o.value.active_org_id===e.orgID,_=l.fn("login")(function*(o){let e=yield*p.Service;yield*P("Log in");let t=yield*e.login(o);yield*b.info("Go to: "+t.url),yield*b.info("Enter code: "+t.user),yield*A(t.url);let n=O();yield*n.start("Waiting for authorization...");let c=(r)=>l.gen(function*(){yield*l.sleep(r);let i=yield*e.poll(t);if(i._tag==="PollPending")return yield*c(r);if(i._tag==="PollSlow")return yield*c(D.sum(r,D.seconds(5)));return i}),a=yield*c(t.interval).pipe(l.timeout(t.expiry),l.catchTag("TimeoutError",()=>l.succeed(new S)));yield*I.valueTags(a,{PollSuccess:(r)=>l.gen(function*(){yield*n.stop("Logged in as "+r.email),yield*g("Done")}),PollExpired:()=>n.stop("Device code expired",1),PollDenied:()=>n.stop("Authorization denied",1),PollError:(r)=>n.stop("Error: "+String(r.cause),1),PollPending:()=>n.stop("Unexpected state",1),PollSlow:()=>n.stop("Unexpected state",1)})}),N=l.fn("logout")(function*(o){let e=yield*p.Service,t=yield*e.list();if(t.length===0)return yield*m("Not logged in");if(o){let i=t.find((y)=>y.email===o);if(!i)return yield*m("Account not found: "+o);yield*e.remove(i.id),yield*g("Logged out from "+o);return}let n=yield*e.active(),c=d.map(n,(i)=>i.id);yield*P("Log out");let a=t.map((i)=>{let y=d.isSome(c)&&c.value===i.id;return{value:i,label:w(i,y)}}),r=yield*h({message:"Select account to log out",options:a});if(d.isNone(r))return;yield*e.remove(r.value.id),yield*g("Logged out from "+r.value.email)}),$=l.fn("switch")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("Not logged in");let t=yield*o.active(),n=e.flatMap((r)=>r.orgs.map((i)=>{let y=T(t,{accountID:r.account.id,orgID:i.id});return{value:{orgID:i.id,accountID:r.account.id,label:i.name},label:x(r.account,i,y)}}));if(n.length===0)return yield*m("No orgs found");yield*P("Switch org");let c=yield*h({message:"Select org",options:n});if(d.isNone(c))return;let a=c.value;yield*o.use(a.accountID,d.some(a.orgID)),yield*g("Switched to "+a.label)}),R=l.fn("orgs")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("No accounts found");if(!e.some((n)=>n.orgs.length>0))return yield*m("No orgs found");let t=yield*o.active();for(let n of e)for(let c of n.orgs){let a=T(t,{accountID:n.account.id,orgID:c.id});yield*m(C(n.account,c,a))}}),M=l.fn("open")(function*(){let e=yield*(yield*p.Service).active();if(d.isNone(e))return yield*m("No active account");let t=e.value.url;yield*A(t),yield*g("Opened "+t)}),X=u({command:"login <url>",describe:!1,builder:(o)=>o.positional("url",{describe:"server URL",type:"string",demandOption:!0}),async handler(o){s.empty(),await f.runPromise(_(o.url))}}),B=u({command:"logout [email]",describe:!1,builder:(o)=>o.positional("email",{describe:"account email to log out from",type:"string"}),async handler(o){s.empty(),await f.runPromise(N(o.email))}}),U=u({command:"switch",describe:!1,async handler(){s.empty(),await f.runPromise($())}}),G=u({command:"orgs",describe:!1,async handler(){s.empty(),await f.runPromise(R())}}),H=u({command:"open",describe:!1,async handler(){s.empty(),await f.runPromise(M())}}),Y=u({command:"console",describe:!1,builder:(o)=>o.command({...X,describe:"log in to console"}).command({...B,describe:"log out from console"}).command({...U,describe:"switch active org"}).command({...G,describe:"list orgs"}).command({...H,describe:"open active console account"}).demandCommand(),async handler(){}});export{C as formatOrgLine,w as formatAccountLabel,U as SwitchCommand,G as OrgsCommand,H as OpenCommand,B as LogoutCommand,X as LoginCommand,Y as ConsoleCommand};
2
+ import{i as P,j as g,k as b,l as h,m as O}from"./chunk-0z1keh2w.js";import"./chunk-2kh0tg92.js";import"./chunk-52xvhxek.js";import{be as u}from"./chunk-f4mnp6xd.js";import{eg as s}from"./chunk-bwadggys.js";import{Ch as f}from"./chunk-he9kpk9r.js";import{Dh as E}from"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import{Bj as S,Cj as p}from"./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"./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"./chunk-6yhn9syz.js";import"./chunk-wb05bp10.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import{Ry as I}from"./chunk-w7a33cwa.js";import{BC as D,fH as l,mB as d}from"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";var A=(o)=>l.promise(()=>E(o)),m=(o)=>l.sync(()=>s.println(o)),v=(o)=>s.Style.TEXT_DIM+o+s.Style.TEXT_NORMAL,L=(o)=>o?v(" (active)"):"",w=(o,e)=>`${o.email} ${v(o.url)}${L(e)}`,x=(o,e,t)=>`${e.name} (${o.email})${L(t)}`,C=(o,e,t)=>{let n=t?s.Style.TEXT_SUCCESS+"\u25CF"+s.Style.TEXT_NORMAL:" ",c=t?s.Style.TEXT_HIGHLIGHT_BOLD+e.name+s.Style.TEXT_NORMAL:e.name;return` ${n} ${c} ${v(o.email)} ${v(o.url)} ${v(e.id)}`},T=(o,e)=>d.isSome(o)&&o.value.id===e.accountID&&o.value.active_org_id===e.orgID,_=l.fn("login")(function*(o){let e=yield*p.Service;yield*P("Log in");let t=yield*e.login(o);yield*b.info("Go to: "+t.url),yield*b.info("Enter code: "+t.user),yield*A(t.url);let n=O();yield*n.start("Waiting for authorization...");let c=(r)=>l.gen(function*(){yield*l.sleep(r);let i=yield*e.poll(t);if(i._tag==="PollPending")return yield*c(r);if(i._tag==="PollSlow")return yield*c(D.sum(r,D.seconds(5)));return i}),a=yield*c(t.interval).pipe(l.timeout(t.expiry),l.catchTag("TimeoutError",()=>l.succeed(new S)));yield*I.valueTags(a,{PollSuccess:(r)=>l.gen(function*(){yield*n.stop("Logged in as "+r.email),yield*g("Done")}),PollExpired:()=>n.stop("Device code expired",1),PollDenied:()=>n.stop("Authorization denied",1),PollError:(r)=>n.stop("Error: "+String(r.cause),1),PollPending:()=>n.stop("Unexpected state",1),PollSlow:()=>n.stop("Unexpected state",1)})}),N=l.fn("logout")(function*(o){let e=yield*p.Service,t=yield*e.list();if(t.length===0)return yield*m("Not logged in");if(o){let i=t.find((y)=>y.email===o);if(!i)return yield*m("Account not found: "+o);yield*e.remove(i.id),yield*g("Logged out from "+o);return}let n=yield*e.active(),c=d.map(n,(i)=>i.id);yield*P("Log out");let a=t.map((i)=>{let y=d.isSome(c)&&c.value===i.id;return{value:i,label:w(i,y)}}),r=yield*h({message:"Select account to log out",options:a});if(d.isNone(r))return;yield*e.remove(r.value.id),yield*g("Logged out from "+r.value.email)}),$=l.fn("switch")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("Not logged in");let t=yield*o.active(),n=e.flatMap((r)=>r.orgs.map((i)=>{let y=T(t,{accountID:r.account.id,orgID:i.id});return{value:{orgID:i.id,accountID:r.account.id,label:i.name},label:x(r.account,i,y)}}));if(n.length===0)return yield*m("No orgs found");yield*P("Switch org");let c=yield*h({message:"Select org",options:n});if(d.isNone(c))return;let a=c.value;yield*o.use(a.accountID,d.some(a.orgID)),yield*g("Switched to "+a.label)}),R=l.fn("orgs")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("No accounts found");if(!e.some((n)=>n.orgs.length>0))return yield*m("No orgs found");let t=yield*o.active();for(let n of e)for(let c of n.orgs){let a=T(t,{accountID:n.account.id,orgID:c.id});yield*m(C(n.account,c,a))}}),M=l.fn("open")(function*(){let e=yield*(yield*p.Service).active();if(d.isNone(e))return yield*m("No active account");let t=e.value.url;yield*A(t),yield*g("Opened "+t)}),X=u({command:"login <url>",describe:!1,builder:(o)=>o.positional("url",{describe:"server URL",type:"string",demandOption:!0}),async handler(o){s.empty(),await f.runPromise(_(o.url))}}),B=u({command:"logout [email]",describe:!1,builder:(o)=>o.positional("email",{describe:"account email to log out from",type:"string"}),async handler(o){s.empty(),await f.runPromise(N(o.email))}}),U=u({command:"switch",describe:!1,async handler(){s.empty(),await f.runPromise($())}}),G=u({command:"orgs",describe:!1,async handler(){s.empty(),await f.runPromise(R())}}),H=u({command:"open",describe:!1,async handler(){s.empty(),await f.runPromise(M())}}),Y=u({command:"console",describe:!1,builder:(o)=>o.command({...X,describe:"log in to console"}).command({...B,describe:"log out from console"}).command({...U,describe:"switch active org"}).command({...G,describe:"list orgs"}).command({...H,describe:"open active console account"}).demandCommand(),async handler(){}});export{C as formatOrgLine,w as formatAccountLabel,U as SwitchCommand,G as OrgsCommand,H as OpenCommand,B as LogoutCommand,X as LoginCommand,Y as ConsoleCommand};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{xO as t}from"./chunk-e0vrxetq.js";var e=await import("./chunk-j871xzr7.js",{with:{type:"file"}}),a=e.default;export{a as default};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-r9w0thdk.js";var pr=Object.defineProperty,hr=(e)=>{throw TypeError(e)},cn=(e,t,r)=>(t in e)?pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dr=(e,t)=>{for(var r in t)pr(e,r,{get:t[r],enumerable:!0})},kt=(e,t,r)=>cn(e,typeof t!="symbol"?t+"":t,r),mr=(e,t,r)=>t.has(e)||hr("Cannot "+r),F=(e,t,r)=>(mr(e,t,"read from private field"),r?r.call(e):t.get(e)),gr=(e,t,r)=>t.has(e)?hr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),pn=(e,t,r,n)=>(mr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),fr={};dr(fr,{languages:()=>ns,options:()=>is,parsers:()=>tn,printers:()=>mu});var hn=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},L=hn,vr="string",Cr="array",yr="cursor",rt="indent",nt="align",Sr="trim",at="group",it="fill",st="if-break",ut="indent-if-break",br="line-suffix",_r="line-suffix-boundary",Z="line",wr="label",ot="break-parent",Ar=new Set([yr,rt,nt,Sr,at,it,st,ut,br,_r,Z,wr,ot]),dn=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},de=dn;function mn(e){if(typeof e=="string")return vr;if(Array.isArray(e))return Cr;if(!e)return;let{type:t}=e;if(Ar.has(t))return t}var kr=mn,gn=(e)=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function fn(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
2
+ import"./chunk-e0vrxetq.js";var pr=Object.defineProperty,hr=(e)=>{throw TypeError(e)},cn=(e,t,r)=>(t in e)?pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dr=(e,t)=>{for(var r in t)pr(e,r,{get:t[r],enumerable:!0})},kt=(e,t,r)=>cn(e,typeof t!="symbol"?t+"":t,r),mr=(e,t,r)=>t.has(e)||hr("Cannot "+r),F=(e,t,r)=>(mr(e,t,"read from private field"),r?r.call(e):t.get(e)),gr=(e,t,r)=>t.has(e)?hr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),pn=(e,t,r,n)=>(mr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),fr={};dr(fr,{languages:()=>ns,options:()=>is,parsers:()=>tn,printers:()=>mu});var hn=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},L=hn,vr="string",Cr="array",yr="cursor",rt="indent",nt="align",Sr="trim",at="group",it="fill",st="if-break",ut="indent-if-break",br="line-suffix",_r="line-suffix-boundary",Z="line",wr="label",ot="break-parent",Ar=new Set([yr,rt,nt,Sr,at,it,st,ut,br,_r,Z,wr,ot]),dn=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},de=dn;function mn(e){if(typeof e=="string")return vr;if(Array.isArray(e))return Cr;if(!e)return;let{type:t}=e;if(Ar.has(t))return t}var kr=mn,gn=(e)=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function fn(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
3
3
  Expected it to be 'string' or 'object'.`;if(kr(e))throw Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=gn([...Ar].map((a)=>`'${a}'`));return`Unexpected doc.type '${e.type}'.
4
4
  Expected it to be ${n}.`}var vn=class extends Error{name="InvalidDocError";constructor(e){super(fn(e)),this.doc=e}},Cn=vn;function Er(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(i){if(r.has(i))return r.get(i);let s=a(i);return r.set(i,s),s}function a(i){switch(kr(i)){case Cr:return t(i.map(n));case it:return t({...i,parts:i.parts.map(n)});case st:return t({...i,breakContents:n(i.breakContents),flatContents:n(i.flatContents)});case at:{let{expandedStates:s,contents:u}=i;return s?(s=s.map(n),u=s[0]):u=n(u),t({...i,contents:u,expandedStates:s})}case nt:case rt:case ut:case wr:case br:return t({...i,contents:n(i.contents)});case vr:case yr:case Sr:case _r:case Z:case ot:return t(i);default:throw new Cn(i)}}}function P(e,t=kn){return Er(e,(r)=>typeof r=="string"?ee(t,r.split(`
5
5
  `)):r)}var lt=()=>{},$=lt,xr=lt,yn=lt;function H(e){return $(e),{type:rt,contents:e}}function Dr(e,t){return $(t),{type:nt,contents:t,n:e}}function k(e,t={}){return $(e),xr(t.expandedStates,!0),{type:at,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Sn(e){return Dr(Number.NEGATIVE_INFINITY,e)}function bn(e){return Dr({type:"root"},e)}function Tr(e){return yn(e),{type:it,parts:e}}function xe(e,t="",r={}){return $(e),t!==""&&$(t),{type:st,breakContents:e,flatContents:t,groupId:r.groupId}}function _n(e,t){return $(e),{type:ut,contents:e,groupId:t.groupId,negate:t.negate}}var me={type:ot},wn={type:Z,hard:!0},An={type:Z,hard:!0,literal:!0},_={type:Z},D={type:Z,soft:!0},y=[wn,me],kn=[An,me];function ee(e,t){$(e),xr(t);let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}var Se="'",Et='"';function En(e,t){let r=t===!0||t===Se?Se:Et,n=r===Se?Et:Se,a=0,i=0;for(let s of e)s===r?a++:s===n&&i++;return a>i?n:r}var xn=En;function Dn(e){if(typeof e!="string")throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var N,Tn=class{constructor(e){gr(this,N),pn(this,N,new Set(e))}getLeadingWhitespaceCount(e){let t=F(this,N),r=0;for(let n=0;n<e.length&&t.has(e.charAt(n));n++)r++;return r}getTrailingWhitespaceCount(e){let t=F(this,N),r=0;for(let n=e.length-1;n>=0&&t.has(e.charAt(n));n--)r++;return r}getLeadingWhitespace(e){let t=this.getLeadingWhitespaceCount(e);return e.slice(0,t)}getTrailingWhitespace(e){let t=this.getTrailingWhitespaceCount(e);return e.slice(e.length-t)}hasLeadingWhitespace(e){return F(this,N).has(e.charAt(0))}hasTrailingWhitespace(e){return F(this,N).has(de(!1,e,-1))}trimStart(e){let t=this.getLeadingWhitespaceCount(e);return e.slice(t)}trimEnd(e){let t=this.getTrailingWhitespaceCount(e);return e.slice(0,e.length-t)}trim(e){return this.trimEnd(this.trimStart(e))}split(e,t=!1){let r=`[${Dn([...F(this,N)].join(""))}]+`,n=new RegExp(t?`(${r})`:r,"u");return e.split(n)}hasWhitespaceCharacter(e){let t=F(this,N);return Array.prototype.some.call(e,(r)=>t.has(r))}hasNonWhitespaceCharacter(e){let t=F(this,N);return Array.prototype.some.call(e,(r)=>!t.has(r))}isWhitespaceOnly(e){let t=F(this,N);return Array.prototype.every.call(e,(r)=>t.has(r))}};N=new WeakMap;var Bn=Tn,Ln=["\t",`
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Of as a}from"./chunk-ahmy80vb.js";import"./chunk-p8ak162p.js";import"./chunk-nfg7nt13.js";import"./chunk-qgkb6n8k.js";import"./chunk-e0vrxetq.js";export{a as default};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./chunk-r9w0thdk.js";var e={"ui.sessionReview.title":"Modifications de la session","ui.sessionReview.title.lastTurn":"Modifications du dernier tour","ui.sessionReview.diffStyle.unified":"Unifi\xE9","ui.sessionReview.diffStyle.split":"Divis\xE9","ui.sessionReview.openFile":"Ouvrir le fichier","ui.sessionReview.selection.line":"ligne {{line}}","ui.sessionReview.selection.lines":"lignes {{start}}-{{end}}","ui.sessionReview.expandAll":"Tout d\xE9velopper","ui.sessionReview.collapseAll":"Tout r\xE9duire","ui.sessionReview.change.added":"Ajout\xE9","ui.sessionReview.change.removed":"Supprim\xE9","ui.sessionReview.change.modified":"Modifi\xE9","ui.sessionReview.image.loading":"Chargement...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff trop volumineux pour \xEAtre affich\xE9","ui.sessionReview.largeDiff.meta":"Limite : {{limit}} lignes modifi\xE9es. Actuel : {{current}} lignes modifi\xE9es.","ui.sessionReview.largeDiff.renderAnyway":"Afficher quand m\xEAme","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Fichier {{kind}} supprim\xE9","ui.fileMedia.state.loading":"Chargement du fichier {{kind}}","ui.fileMedia.state.error":"Erreur avec le fichier {{kind}}","ui.fileMedia.state.unavailable":"Fichier {{kind}} indisponible","ui.fileMedia.binary.title":"Fichier binaire","ui.fileMedia.binary.description.path":"Impossible d'afficher {{path}} car il s'agit d'un fichier binaire.","ui.fileMedia.binary.description.default":"Impossible d'afficher ce fichier car il s'agit d'un fichier binaire.","ui.lineComment.label.prefix":"Commenter sur ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commentaire sur ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Ajouter un commentaire","ui.lineComment.submit":"Commenter","ui.sessionTurn.steps.show":"Afficher les \xE9tapes","ui.sessionTurn.steps.hide":"Masquer les \xE9tapes","ui.sessionTurn.summary.response":"R\xE9ponse","ui.sessionTurn.diff.showMore":"Afficher plus de modifications ({{count}})","ui.sessionTurn.retry.retrying":"nouvelle tentative","ui.sessionTurn.retry.inSeconds":"dans {{seconds}}s","ui.sessionTurn.retry.attempt":"tentative n\xB0{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - tentative n\xB0{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini est en surchauffe","ui.sessionTurn.error.freeUsageExceeded":"Limite d'utilisation gratuite d\xE9pass\xE9e","ui.sessionTurn.error.addQredits":"Ajouter des cr\xE9dits","ui.sessionTurn.status.delegating":"D\xE9l\xE9gation du travail","ui.sessionTurn.status.planning":"Planification des prochaines \xE9tapes","ui.sessionTurn.status.gatheringContext":"Exploration","ui.sessionTurn.status.gatheredContext":"Explor\xE9","ui.sessionTurn.status.searchingCodebase":"Recherche dans la base de code","ui.sessionTurn.status.searchingWeb":"Recherche sur le web","ui.sessionTurn.status.makingEdits":"Application des modifications","ui.sessionTurn.status.runningCommands":"Ex\xE9cution des commandes","ui.sessionTurn.status.thinking":"R\xE9flexion","ui.sessionTurn.status.thinkingWithTopic":"R\xE9flexion - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Rassemblement des id\xE9es","ui.sessionTurn.status.consideringNextSteps":"Examen des prochaines \xE9tapes","ui.messagePart.questions.dismissed":"Questions ignor\xE9es","ui.messagePart.compaction":"Session compact\xE9e","ui.messagePart.context.read.one":"{{count}} lecture","ui.messagePart.context.read.other":"{{count}} lectures","ui.messagePart.context.search.one":"{{count}} recherche","ui.messagePart.context.search.other":"{{count}} recherches","ui.messagePart.context.list.one":"{{count}} liste","ui.messagePart.context.list.other":"{{count}} listes","ui.messagePart.diagnostic.error":"Erreur","ui.messagePart.title.edit":"Modifier","ui.messagePart.title.write":"\xC9crire","ui.messagePart.option.typeOwnAnswer":"Tapez votre propre r\xE9ponse","ui.messagePart.review.title":"Passez en revue vos r\xE9ponses","ui.list.loading":"Chargement","ui.list.empty":"Aucun r\xE9sultat","ui.list.clearFilter":"Effacer le filtre","ui.list.emptyWithFilter.prefix":"Aucun r\xE9sultat pour","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"Nouveau message","ui.textField.copyToClipboard":"Copier dans le presse-papiers","ui.textField.copyLink":"Copier le lien","ui.textField.copied":"Copi\xE9","ui.imagePreview.alt":"Aper\xE7u de l'image","ui.scrollView.ariaLabel":"contenu d\xE9filable","ui.tool.read":"Lire","ui.tool.loaded":"Charg\xE9","ui.tool.list":"Lister","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Recherche Web","ui.tool.codesearch":"Recherche de code","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"T\xE2ches","ui.tool.todos.read":"Lire les t\xE2ches","ui.tool.questions":"Questions","ui.tool.agent":"Agent {{type}}","ui.tool.agent.default":"Agent","ui.common.file.one":"fichier","ui.common.file.other":"fichiers","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Ajouter","ui.common.back":"Retour","ui.common.cancel":"Annuler","ui.common.confirm":"Confirmer","ui.common.dismiss":"Ignorer","ui.common.close":"Fermer","ui.common.next":"Suivant","ui.common.submit":"Soumettre","ui.permission.deny":"Refuser","ui.permission.allowAlways":"Toujours autoriser","ui.permission.allowOnce":"Autoriser une fois","ui.message.expand":"D\xE9velopper le message","ui.message.collapse":"R\xE9duire le message","ui.message.copy":"Copier","ui.message.copyMessage":"Copier le message","ui.message.forkMessage":"Bifurquer vers une nouvelle session","ui.message.revertMessage":"R\xE9initialiser \xE0 ce point","ui.message.copyResponse":"Copier la r\xE9ponse","ui.message.copied":"Copi\xE9 !","ui.message.interrupted":"Interrompu","ui.message.queued":"En file","ui.message.attachment.alt":"pi\xE8ce jointe","ui.patch.action.deleted":"Supprim\xE9","ui.patch.action.created":"Cr\xE9\xE9","ui.patch.action.moved":"D\xE9plac\xE9","ui.patch.action.patched":"Corrig\xE9","ui.question.subtitle.answered":"{{count}} r\xE9pondu(s)","ui.question.answer.none":"(pas de r\xE9ponse)","ui.question.review.notAnswered":"(non r\xE9pondu)","ui.question.multiHint":"S\xE9lectionnez tout ce qui s'applique","ui.question.singleHint":"S\xE9lectionnez une r\xE9ponse","ui.question.custom.placeholder":"Tapez votre r\xE9ponse...","ui.fileSearch.placeholder":"Rechercher","ui.fileSearch.previousMatch":"Pr\xE9c\xE9dent","ui.fileSearch.nextMatch":"Suivant","ui.fileSearch.close":"Fermer la recherche","ui.tool.task":"T\xE2che","ui.tool.skill":"Comp\xE9tence","ui.basicTool.called":"Appel\xE9 `{{tool}}`","ui.toolErrorCard.failed":"\xC9chou\xE9","ui.toolErrorCard.copyError":"Copier l'erreur","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s"};export{e as dict};
2
+ import"./chunk-e0vrxetq.js";var e={"ui.sessionReview.title":"Modifications de la session","ui.sessionReview.title.lastTurn":"Modifications du dernier tour","ui.sessionReview.diffStyle.unified":"Unifi\xE9","ui.sessionReview.diffStyle.split":"Divis\xE9","ui.sessionReview.openFile":"Ouvrir le fichier","ui.sessionReview.selection.line":"ligne {{line}}","ui.sessionReview.selection.lines":"lignes {{start}}-{{end}}","ui.sessionReview.expandAll":"Tout d\xE9velopper","ui.sessionReview.collapseAll":"Tout r\xE9duire","ui.sessionReview.change.added":"Ajout\xE9","ui.sessionReview.change.removed":"Supprim\xE9","ui.sessionReview.change.modified":"Modifi\xE9","ui.sessionReview.image.loading":"Chargement...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff trop volumineux pour \xEAtre affich\xE9","ui.sessionReview.largeDiff.meta":"Limite : {{limit}} lignes modifi\xE9es. Actuel : {{current}} lignes modifi\xE9es.","ui.sessionReview.largeDiff.renderAnyway":"Afficher quand m\xEAme","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Fichier {{kind}} supprim\xE9","ui.fileMedia.state.loading":"Chargement du fichier {{kind}}","ui.fileMedia.state.error":"Erreur avec le fichier {{kind}}","ui.fileMedia.state.unavailable":"Fichier {{kind}} indisponible","ui.fileMedia.binary.title":"Fichier binaire","ui.fileMedia.binary.description.path":"Impossible d'afficher {{path}} car il s'agit d'un fichier binaire.","ui.fileMedia.binary.description.default":"Impossible d'afficher ce fichier car il s'agit d'un fichier binaire.","ui.lineComment.label.prefix":"Commenter sur ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commentaire sur ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Ajouter un commentaire","ui.lineComment.submit":"Commenter","ui.sessionTurn.steps.show":"Afficher les \xE9tapes","ui.sessionTurn.steps.hide":"Masquer les \xE9tapes","ui.sessionTurn.summary.response":"R\xE9ponse","ui.sessionTurn.diff.showMore":"Afficher plus de modifications ({{count}})","ui.sessionTurn.retry.retrying":"nouvelle tentative","ui.sessionTurn.retry.inSeconds":"dans {{seconds}}s","ui.sessionTurn.retry.attempt":"tentative n\xB0{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - tentative n\xB0{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini est en surchauffe","ui.sessionTurn.error.freeUsageExceeded":"Limite d'utilisation gratuite d\xE9pass\xE9e","ui.sessionTurn.error.addQredits":"Ajouter des cr\xE9dits","ui.sessionTurn.status.delegating":"D\xE9l\xE9gation du travail","ui.sessionTurn.status.planning":"Planification des prochaines \xE9tapes","ui.sessionTurn.status.gatheringContext":"Exploration","ui.sessionTurn.status.gatheredContext":"Explor\xE9","ui.sessionTurn.status.searchingCodebase":"Recherche dans la base de code","ui.sessionTurn.status.searchingWeb":"Recherche sur le web","ui.sessionTurn.status.makingEdits":"Application des modifications","ui.sessionTurn.status.runningCommands":"Ex\xE9cution des commandes","ui.sessionTurn.status.thinking":"R\xE9flexion","ui.sessionTurn.status.thinkingWithTopic":"R\xE9flexion - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Rassemblement des id\xE9es","ui.sessionTurn.status.consideringNextSteps":"Examen des prochaines \xE9tapes","ui.messagePart.questions.dismissed":"Questions ignor\xE9es","ui.messagePart.compaction":"Session compact\xE9e","ui.messagePart.context.read.one":"{{count}} lecture","ui.messagePart.context.read.other":"{{count}} lectures","ui.messagePart.context.search.one":"{{count}} recherche","ui.messagePart.context.search.other":"{{count}} recherches","ui.messagePart.context.list.one":"{{count}} liste","ui.messagePart.context.list.other":"{{count}} listes","ui.messagePart.diagnostic.error":"Erreur","ui.messagePart.title.edit":"Modifier","ui.messagePart.title.write":"\xC9crire","ui.messagePart.option.typeOwnAnswer":"Tapez votre propre r\xE9ponse","ui.messagePart.review.title":"Passez en revue vos r\xE9ponses","ui.list.loading":"Chargement","ui.list.empty":"Aucun r\xE9sultat","ui.list.clearFilter":"Effacer le filtre","ui.list.emptyWithFilter.prefix":"Aucun r\xE9sultat pour","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"Nouveau message","ui.textField.copyToClipboard":"Copier dans le presse-papiers","ui.textField.copyLink":"Copier le lien","ui.textField.copied":"Copi\xE9","ui.imagePreview.alt":"Aper\xE7u de l'image","ui.scrollView.ariaLabel":"contenu d\xE9filable","ui.tool.read":"Lire","ui.tool.loaded":"Charg\xE9","ui.tool.list":"Lister","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Recherche Web","ui.tool.codesearch":"Recherche de code","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"T\xE2ches","ui.tool.todos.read":"Lire les t\xE2ches","ui.tool.questions":"Questions","ui.tool.agent":"Agent {{type}}","ui.tool.agent.default":"Agent","ui.common.file.one":"fichier","ui.common.file.other":"fichiers","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Ajouter","ui.common.back":"Retour","ui.common.cancel":"Annuler","ui.common.confirm":"Confirmer","ui.common.dismiss":"Ignorer","ui.common.close":"Fermer","ui.common.next":"Suivant","ui.common.submit":"Soumettre","ui.permission.deny":"Refuser","ui.permission.allowAlways":"Toujours autoriser","ui.permission.allowOnce":"Autoriser une fois","ui.message.expand":"D\xE9velopper le message","ui.message.collapse":"R\xE9duire le message","ui.message.copy":"Copier","ui.message.copyMessage":"Copier le message","ui.message.forkMessage":"Bifurquer vers une nouvelle session","ui.message.revertMessage":"R\xE9initialiser \xE0 ce point","ui.message.copyResponse":"Copier la r\xE9ponse","ui.message.copied":"Copi\xE9 !","ui.message.interrupted":"Interrompu","ui.message.queued":"En file","ui.message.attachment.alt":"pi\xE8ce jointe","ui.patch.action.deleted":"Supprim\xE9","ui.patch.action.created":"Cr\xE9\xE9","ui.patch.action.moved":"D\xE9plac\xE9","ui.patch.action.patched":"Corrig\xE9","ui.question.subtitle.answered":"{{count}} r\xE9pondu(s)","ui.question.answer.none":"(pas de r\xE9ponse)","ui.question.review.notAnswered":"(non r\xE9pondu)","ui.question.multiHint":"S\xE9lectionnez tout ce qui s'applique","ui.question.singleHint":"S\xE9lectionnez une r\xE9ponse","ui.question.custom.placeholder":"Tapez votre r\xE9ponse...","ui.fileSearch.placeholder":"Rechercher","ui.fileSearch.previousMatch":"Pr\xE9c\xE9dent","ui.fileSearch.nextMatch":"Suivant","ui.fileSearch.close":"Fermer la recherche","ui.tool.task":"T\xE2che","ui.tool.skill":"Comp\xE9tence","ui.basicTool.called":"Appel\xE9 `{{tool}}`","ui.toolErrorCard.failed":"\xC9chou\xE9","ui.toolErrorCard.copyError":"Copier l'erreur","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s"};export{e as dict};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{cq as a}from"./chunk-az3nss5m.js";import"./chunk-e0vrxetq.js";export default a();
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{$q as AQ,Iq as mJ,Jq as vJ,Kq as dJ,Lq as lJ,Oq as d,Pq as l,Rq as uJ,Sq as cJ,Vq as pJ,Wq as iJ,Xq as nJ,Yq as aJ,Zq as rJ}from"./chunk-73r8bjjz.js";import{Cs as FQ,ds as CQ,es as DQ}from"./chunk-fr34mnyg.js";import{Ns as x,Ws as GJ}from"./chunk-tr6rdr6h.js";import{$D as wQ,$N as g,DE as z,DG as xJ,ED as qQ,EF as EJ,HG as fJ,IF as MJ,JE as b,LD as _J,LE as CJ,LF as oJ,PF as RJ,QL as j,RF as VJ,SG as E,UF as hJ,VE as DJ,WE as FJ,XE as AJ,XG as yJ,YG as bJ,_D as BQ,aO as eJ,bC as GQ,bG as jJ,cE as $J,dE as UJ,dO as HQ,eB as wJ,eH as I,eO as WQ,fM as o,fO as R,hB as HJ,hF as t,hG as NJ,iE as zJ,iF as OJ,kB as WJ,kF as y,lI as gJ,mB as $Q,pC as IJ,rA as tJ,sC as PJ,sG as kJ,tE as ZJ,uB as f,vC as T,wG as LJ,xF as TJ,yC as KJ,zG as SJ}from"./chunk-qnvsqnz5.js";import{sO as zQ,uO as u,wO as S}from"./chunk-r9w0thdk.js";var IX={};u(IX,{resource:()=>BJ,layer:()=>EQ,enabled:()=>OQ,Observability:()=>WX});var p={};u(p,{make:()=>IQ,layer:()=>ZX});var VQ=AJ.pipe(FJ,DJ((J)=>{if(lJ(J)&&J.reason._tag==="StatusCodeError"&&J.reason.response.status===429){let Q=HJ(J.reason.response.headers["retry-after"]).pipe(WJ(CJ),wJ(()=>5));return t(T(Q))}return t(T(1))})),sJ=E(function*(J){let Q=yield*jJ(),X=f(Q,b),Y=f(Q,UJ),$=fJ(Q),G=KJ(IJ(J.exportInterval),PJ),B=void 0,C=nJ(f(Q,pJ)).pipe(iJ(NJ(rJ,!1)),aJ({schedule:VQ,times:3})),V=vJ({"user-agent":`effect-opentelemetry-${J.label}/0.0.0`});if(J.headers)V=dJ(mJ(J.headers),V);let r=uJ(J.url,{headers:V}),O=[],s=OJ(()=>{if(B!==void 0&&X.currentTimeMillisUnsafe()<B)return y;else if(B!==void 0)B=void 0;let h=O;if(J.maxBatchSize!=="disabled"){if(O.length===0)return y;O=[]}return C.execute(cJ(r,J.body(h))).pipe(EJ,SJ(!1))}).pipe(MJ((h)=>{if(B!==void 0)return y;return B=X.currentTimeMillisUnsafe()+60000,O=[],yJ("Disabling exporter for 60 seconds",h)}),bJ({package:"@effect/opentelemetry",module:J.label}));return yield*zJ(Y,s.pipe(RJ,kJ,VJ(J.shutdownTimeout))),yield*hJ(G).pipe(TJ(s),LJ,xJ(Y)),{push(h){if(B!==void 0)return;if(O.push(h),J.maxBatchSize!=="disabled"&&O.length>=J.maxBatchSize)gJ($(s),Y)}}});var jQ=(J)=>{let Q=J.attributes?e(Object.entries(J.attributes)):[];if(Q.push({key:"service.name",value:{stringValue:J.serviceName}}),J.serviceVersion)Q.push({key:"service.version",value:{stringValue:J.serviceVersion}});return{attributes:Q,droppedAttributesCount:0}},JQ=E(function*(J){let Q={...yield*g(o(eJ(j,j)),"OTEL_RESOURCE_ATTRIBUTES"),...J?.attributes},X=J?.serviceName??Q["service.name"]??(yield*g(j,"OTEL_SERVICE_NAME"));delete Q["service.name"];let Y=J?.serviceVersion??Q["service.version"]??(yield*g(o(j),"OTEL_SERVICE_VERSION"));return delete Q["service.version"],jQ({serviceName:X,serviceVersion:Y,attributes:Q})},oJ),QQ=(J)=>{let Q=J.attributes.find((X)=>X.key==="service.name");if(!Q||!Q.value.stringValue)throw Error("Resource does not contain a service name");return Q.value.stringValue},e=(J)=>{let Q=[];for(let[X,Y]of J)Q.push({key:X,value:m(Y)});return Q},m=(J)=>{if(Array.isArray(J))return{arrayValue:{values:J.map(m)}};switch(typeof J){case"string":return{stringValue:J};case"bigint":return{intValue:Number(J)};case"number":return Number.isInteger(J)?{intValue:J}:{doubleValue:J};case"boolean":return{boolValue:J};default:return{stringValue:tJ(J)}}};var c={};u(c,{layerProtobuf:()=>YX,layerJson:()=>XX,OtlpSerialization:()=>M});var N={Varint:0,Fixed64:1,LengthDelimited:2,Fixed32:5},k=(J,Q)=>J<<3|Q,D=(J)=>{let Q=[],X=typeof J==="bigint"?J:BigInt(J);while(X>0x7fn)Q.push(Number(X&0x7fn)|128),X>>=7n;return Q.push(Number(X)),new Uint8Array(Q)};var kQ=(J)=>{let Q=new Uint8Array(8);return new DataView(Q.buffer).setBigUint64(0,J,!0),Q},LQ=(J)=>{let Q=new Uint8Array(4);return new DataView(Q.buffer).setUint32(0,J,!0),Q},SQ=(J)=>{let Q=new Uint8Array(8);return new DataView(Q.buffer).setFloat64(0,J,!0),Q},xQ=(J)=>new TextEncoder().encode(J),fQ=(J)=>{let Q=new Uint8Array(J.length/2);for(let X=0;X<J.length;X+=2)Q[X/2]=parseInt(J.slice(X,X+2),16);return Q},Z=(...J)=>{let Q=J.reduce(($,G)=>$+G.length,0),X=new Uint8Array(Q),Y=0;for(let $ of J)X.set($,Y),Y+=$.length;return X},q=(J,Q)=>Z(D(k(J,N.Varint)),D(Q));var JJ=(J,Q)=>q(J,Q?1:0),W=(J,Q)=>Z(D(k(J,N.Fixed64)),kQ(Q)),v=(J,Q)=>Z(D(k(J,N.Fixed32)),LQ(Q)),F=(J,Q)=>Z(D(k(J,N.Fixed64)),SQ(Q)),L=(J,Q)=>Z(D(k(J,N.LengthDelimited)),D(Q.length),Q),K=(J,Q)=>L(J,xQ(Q)),U=(J,Q)=>L(J,fQ(Q)),w=(J,Q)=>L(J,Q),_=(J,Q,X)=>Z(...Q.map((Y)=>w(J,X(Y))));var H=(J,Q)=>Q!==void 0&&Q!==""?K(J,Q):new Uint8Array(0);var QJ=(J)=>{if(J.stringValue!==void 0&&J.stringValue!==null)return K(1,J.stringValue);if(J.boolValue!==void 0&&J.boolValue!==null)return JJ(2,J.boolValue);if(J.intValue!==void 0&&J.intValue!==null)return q(3,BigInt(J.intValue));if(J.doubleValue!==void 0&&J.doubleValue!==null)return F(4,J.doubleValue);if(J.arrayValue!==void 0)return w(5,bQ(J.arrayValue));if(J.kvlistValue!==void 0)return w(6,gQ(J.kvlistValue));if(J.bytesValue!==void 0)return L(7,J.bytesValue);return new Uint8Array(0)},bQ=(J)=>_(1,J.values,QJ),gQ=(J)=>_(1,J.values,P),P=(J)=>Z(K(1,J.key),w(2,QJ(J.value))),XJ=(J)=>Z(K(1,J.name),H(2,J.version),J.attributes?_(3,J.attributes,P):new Uint8Array(0),J.droppedAttributesCount?q(4,J.droppedAttributesCount):new Uint8Array(0)),YJ=(J)=>Z(_(1,J.attributes,P),J.droppedAttributesCount>0?q(2,J.droppedAttributesCount):new Uint8Array(0));var mQ=(J)=>Z(H(2,J.message),q(3,J.code)),vQ=(J)=>Z(W(1,BigInt(J.timeUnixNano)),K(2,J.name),_(3,J.attributes,P),J.droppedAttributesCount>0?q(4,J.droppedAttributesCount):new Uint8Array(0)),dQ=(J)=>Z(U(1,J.traceId),U(2,J.spanId),H(3,J.traceState),_(4,J.attributes,P),J.droppedAttributesCount>0?q(5,J.droppedAttributesCount):new Uint8Array(0),J.flags!==void 0?v(6,J.flags):new Uint8Array(0)),lQ=(J)=>Z(U(1,J.traceId),U(2,J.spanId),H(3,J.traceState),J.parentSpanId!==void 0?U(4,J.parentSpanId):new Uint8Array(0),K(5,J.name),q(6,J.kind),W(7,BigInt(J.startTimeUnixNano)),W(8,BigInt(J.endTimeUnixNano)),_(9,J.attributes,P),J.droppedAttributesCount>0?q(10,J.droppedAttributesCount):new Uint8Array(0),_(11,J.events,vQ),J.droppedEventsCount>0?q(12,J.droppedEventsCount):new Uint8Array(0),_(13,J.links,dQ),J.droppedLinksCount>0?q(14,J.droppedLinksCount):new Uint8Array(0),w(15,mQ(J.status)),J.flags!==void 0?v(16,J.flags):new Uint8Array(0)),uQ=(J)=>Z(w(1,XJ(J.scope)),_(2,J.spans,lQ),H(3,J.schemaUrl)),cQ=(J)=>Z(w(1,YJ(J.resource)),_(2,J.scopeSpans,uQ),H(3,J.schemaUrl)),XQ=(J)=>_(1,J.resourceSpans,cQ);var YQ=(J)=>Z(W(2,BigInt(J.startTimeUnixNano)),W(3,BigInt(J.timeUnixNano)),J.asDouble!==void 0?F(4,J.asDouble):new Uint8Array(0),J.asInt!==void 0?W(6,BigInt(J.asInt)):new Uint8Array(0),_(7,J.attributes,P),J.flags!==void 0?q(8,J.flags):new Uint8Array(0)),pQ=(J)=>{let Q=Z(...J.bucketCounts.map((Y)=>W(6,BigInt(Y)))),X=Z(...J.explicitBounds.map((Y)=>F(7,Y)));return Z(W(2,BigInt(J.startTimeUnixNano)),W(3,BigInt(J.timeUnixNano)),W(4,BigInt(J.count)),J.sum!==void 0?F(5,J.sum):new Uint8Array(0),Q,X,_(9,J.attributes,P),J.flags!==void 0?q(10,J.flags):new Uint8Array(0),J.min!==void 0?F(11,J.min):new Uint8Array(0),J.max!==void 0?F(12,J.max):new Uint8Array(0))},iQ=(J)=>_(1,J.dataPoints,YQ),nQ=(J)=>Z(_(1,J.dataPoints,YQ),q(2,J.aggregationTemporality),JJ(3,J.isMonotonic)),aQ=(J)=>Z(_(1,J.dataPoints,pQ),q(2,J.aggregationTemporality)),rQ=(J)=>Z(K(1,J.name),H(2,J.description),H(3,J.unit),J.gauge!==void 0?w(5,iQ(J.gauge)):new Uint8Array(0),J.sum!==void 0?w(7,nQ(J.sum)):new Uint8Array(0),J.histogram!==void 0?w(9,aQ(J.histogram)):new Uint8Array(0)),sQ=(J)=>Z(w(1,XJ(J.scope)),_(2,J.metrics,rQ),H(3,J.schemaUrl)),tQ=(J)=>Z(w(1,YJ(J.resource)),_(2,J.scopeMetrics,sQ),H(3,J.schemaUrl)),ZQ=(J)=>_(1,J.resourceMetrics,tQ);var oQ=(J)=>Z(W(1,BigInt(J.timeUnixNano)),J.severityNumber!==void 0?q(2,J.severityNumber):new Uint8Array(0),H(3,J.severityText),J.body!==void 0?w(5,QJ(J.body)):new Uint8Array(0),_(6,J.attributes,P),J.droppedAttributesCount!==void 0&&J.droppedAttributesCount>0?q(7,J.droppedAttributesCount):new Uint8Array(0),J.flags!==void 0?v(8,J.flags):new Uint8Array(0),J.traceId!==void 0&&J.traceId!==""?U(9,J.traceId):new Uint8Array(0),J.spanId!==void 0&&J.spanId!==""?U(10,J.spanId):new Uint8Array(0),J.observedTimeUnixNano!==void 0?W(11,BigInt(J.observedTimeUnixNano)):new Uint8Array(0)),eQ=(J)=>Z(w(1,XJ(J.scope)),_(2,J.logRecords,oQ),H(3,J.schemaUrl)),JX=(J)=>Z(w(1,YJ(J.resource)),_(2,J.scopeLogs,eQ),H(3,J.schemaUrl)),_Q=(J)=>_(1,J.resourceLogs,JX);class M extends $Q()("effect/observability/OtlpSerialization"){}var XX=ZJ(M,{traces:(J)=>l(J),metrics:(J)=>l(J),logs:(J)=>l(J)}),YX=ZJ(M,{traces:(J)=>d(XQ(J),"application/x-protobuf"),metrics:(J)=>d(ZQ(J),"application/x-protobuf"),logs:(J)=>d(_Q(J),"application/x-protobuf")});var IQ=E(function*(J){let Q=yield*M,X=yield*JQ(J.resource),Y={name:QQ(X)},$=yield*sJ({label:"OtlpLogger",url:J.url,headers:J.headers,maxBatchSize:J.maxBatchSize??1000,exportInterval:J.exportInterval??T(1),body:(B)=>Q.logs({resourceLogs:[{resource:X,scopeLogs:[{scope:Y,logRecords:B}]}]}),shutdownTimeout:J.shutdownTimeout??T(3)}),G={excludeLogSpans:J.excludeLogSpans??!1,clock:yield*b};return HQ((B)=>{$.push(_X(B,G))})}),ZX=(J)=>WQ([IQ(J)],{mergeWithExisting:J.mergeWithExisting??!0}),_X=(J,Q)=>{let Y=Q.clock.currentTimeNanosUnsafe().toString(),$=J.date.getTime(),G=e(Object.entries(J.fiber.getRef(BQ)));if(G.push({key:"fiberId",value:{intValue:J.fiber.id}}),!Q.excludeLogSpans)for(let[V,r]of J.fiber.getRef(wQ))G.push({key:`logSpan.${V}`,value:{stringValue:`${$-r}ms`}});if(J.cause.reasons.length>0)G.push({key:"log.error",value:{stringValue:qQ(J.cause)}});let B=GQ(J.message),C={severityNumber:$X(J.logLevel),severityText:J.logLevel,timeUnixNano:Y,observedTimeUnixNano:Y,attributes:G,body:m(B.length===1?B[0]:B),droppedAttributesCount:0};if(J.fiber.currentSpan)C.traceId=J.fiber.currentSpan.traceId,C.spanId=J.fiber.currentSpan.spanId;return C},$X=(J)=>{switch(J){case"Trace":return A.SEVERITY_NUMBER_TRACE;case"Debug":return A.SEVERITY_NUMBER_DEBUG;case"Info":return A.SEVERITY_NUMBER_INFO;case"Warn":return A.SEVERITY_NUMBER_WARN;case"Error":return A.SEVERITY_NUMBER_ERROR;case"Fatal":return A.SEVERITY_NUMBER_FATAL;default:return A.SEVERITY_NUMBER_UNSPECIFIED}},A={SEVERITY_NUMBER_UNSPECIFIED:0,SEVERITY_NUMBER_TRACE:1,SEVERITY_NUMBER_TRACE2:2,SEVERITY_NUMBER_TRACE3:3,SEVERITY_NUMBER_TRACE4:4,SEVERITY_NUMBER_DEBUG:5,SEVERITY_NUMBER_DEBUG2:6,SEVERITY_NUMBER_DEBUG3:7,SEVERITY_NUMBER_DEBUG4:8,SEVERITY_NUMBER_INFO:9,SEVERITY_NUMBER_INFO2:10,SEVERITY_NUMBER_INFO3:11,SEVERITY_NUMBER_INFO4:12,SEVERITY_NUMBER_WARN:13,SEVERITY_NUMBER_WARN2:14,SEVERITY_NUMBER_WARN3:15,SEVERITY_NUMBER_WARN4:16,SEVERITY_NUMBER_ERROR:17,SEVERITY_NUMBER_ERROR2:18,SEVERITY_NUMBER_ERROR3:19,SEVERITY_NUMBER_ERROR4:20,SEVERITY_NUMBER_FATAL:21,SEVERITY_NUMBER_FATAL2:22,SEVERITY_NUMBER_FATAL3:23,SEVERITY_NUMBER_FATAL4:24};var UQ={};u(UQ,{logger:()=>n,layer:()=>qJ,create:()=>KQ});var GX=(J)=>J==="sessionID"?"session.id":J,PQ=(J)=>Object.fromEntries(Object.entries(J??{}).filter((Q)=>Q[1]!==void 0&&Q[1]!==null).map(([Q,X])=>[GX(Q),X])),qX=(J)=>{if(Array.isArray(J))return J.map((Q)=>String(Q)).join(" ");return J===void 0?"":String(J)},i=(J,Q,X,Y)=>{let $=PQ({...Q,...Y}),G=J(X);return Object.keys($).length?I.annotateLogs(G,$):G},n=R.make((J)=>{let Q=PQ(J.fiber.getRef($J.CurrentLogAnnotations)),X=J.date.getTime();for(let[B,C]of J.fiber.getRef($J.CurrentLogSpans))Q[`logSpan.${B}`]=`${X-C}ms`;if(J.cause.reasons.length>0)Q.cause=_J.pretty(J.cause);let Y=typeof Q.service==="string"?Q.service:void 0;if(Y)delete Q.service;let $=Y?GJ.create({service:Y}):GJ.Default,G=qX(J.message);switch(J.logLevel){case"Trace":case"Debug":return $.debug(G,Q);case"Warn":return $.warn(G,Q);case"Error":case"Fatal":return $.error(G,Q);default:return $.info(G,Q)}}),qJ=R.layer([n],{mergeWithExisting:!1}),KQ=(J={})=>({debug:(Q,X)=>i((Y)=>I.logDebug(Y),J,Q,X),info:(Q,X)=>i((Y)=>I.logInfo(Y),J,Q,X),warn:(Q,X)=>i((Y)=>I.logWarning(Y),J,Q,X),error:(Q,X)=>i((Y)=>I.logError(Y),J,Q,X),with:(Q)=>KQ({...J,...Q})});var a=x.OTEL_EXPORTER_OTLP_ENDPOINT,OQ=!!a,BX=crypto.randomUUID(),TQ=x.OTEL_EXPORTER_OTLP_HEADERS?x.OTEL_EXPORTER_OTLP_HEADERS.split(",").reduce((J,Q)=>{let[X,...Y]=Q.split("=");return J[X]=Y.join("="),J},{}):void 0;function BJ(){let J=FQ("main"),Q=(()=>{let X=process.env.OTEL_RESOURCE_ATTRIBUTES;if(!X)return{};try{return Object.fromEntries(X.split(",").map((Y)=>{let $=Y.indexOf("=");if($<1)throw Error("Invalid OTEL_RESOURCE_ATTRIBUTES entry");return[decodeURIComponent(Y.slice(0,$)),decodeURIComponent(Y.slice($+1))]}))}catch{return{}}})();return{serviceName:"qitqode",serviceVersion:CQ,attributes:{...Q,"deployment.environment.name":DQ,"qitqode.client":x.QITQODE_CLIENT,"qitqode.process_role":J.processRole,"qitqode.run_id":J.runID,"service.instance.id":BX}}}function wX(){return R.layer([n,p.make({url:`${a}/v1/logs`,resource:BJ(),headers:TQ})],{mergeWithExisting:!1}).pipe(z.provide(c.layerJson),z.provide(AQ.layer))}var HX=async()=>{let J=await import("./chunk-rrv0n73b.js"),Q=await import("./chunk-5c2438af.js"),X=await import("./chunk-ejqzcdcx.js"),{AsyncLocalStorageContextManager:Y}=await import("./chunk-5tky3csh.js").then((m)=>zQ(m.default,1)),{context:$}=await import("./chunk-535nm66j.js").then((m)=>zQ(m.default,1)),G=new Y;return G.enable(),$.setGlobalContextManager(G),J.layer(()=>({resource:BJ(),spanProcessor:new X.BatchSpanProcessor(new Q.OTLPTraceExporter({url:`${a}/v1/traces`,headers:TQ}))}))},EQ=!a?qJ:z.unwrap(I.gen(function*(){let J=yield*I.promise(HX);return z.mergeAll(J,wX())})),WX={enabled:OQ,layer:EQ};var aX=z.makeMemoMapUnsafe();
3
- export{qJ as Cq,UQ as Dq,EQ as Eq,WX as Fq,IX as Gq,aX as Hq};
2
+ import{Jq as mJ,Kq as vJ,Lq as dJ,Mq as lJ,Pq as d,Qq as l,Sq as uJ,Tq as cJ,Wq as pJ,Xq as iJ,Yq as nJ,Zq as aJ,_q as rJ,ar as AQ}from"./chunk-wqk1v8t0.js";import{Ds as FQ,es as CQ,fs as DQ}from"./chunk-wb05bp10.js";import{Os as x,Xs as GJ}from"./chunk-59csnjc3.js";import{$D as BQ,AG as SJ,EE as z,EG as xJ,FD as qQ,FF as EJ,IG as fJ,JF as MJ,KE as b,MD as _J,ME as CJ,MF as oJ,QF as RJ,RL as j,SF as VJ,TG as E,VF as hJ,WE as DJ,XE as FJ,YE as AJ,YG as yJ,ZG as bJ,aE as wQ,aO as g,bO as eJ,cC as GQ,cG as jJ,dE as $J,eE as UJ,eO as HQ,fB as wJ,fH as I,fO as WQ,gM as o,gO as R,iB as HJ,iF as t,iG as NJ,jE as zJ,jF as OJ,lB as WJ,lF as y,mI as gJ,nB as $Q,qC as IJ,sA as tJ,tC as PJ,tG as kJ,uE as ZJ,vB as f,wC as T,xG as LJ,yF as TJ,zC as KJ}from"./chunk-g7v6sp3c.js";import{tO as zQ,vO as u,xO as S}from"./chunk-e0vrxetq.js";var IX={};u(IX,{resource:()=>BJ,layer:()=>EQ,enabled:()=>OQ,Observability:()=>WX});var p={};u(p,{make:()=>IQ,layer:()=>ZX});var VQ=AJ.pipe(FJ,DJ((J)=>{if(lJ(J)&&J.reason._tag==="StatusCodeError"&&J.reason.response.status===429){let Q=HJ(J.reason.response.headers["retry-after"]).pipe(WJ(CJ),wJ(()=>5));return t(T(Q))}return t(T(1))})),sJ=E(function*(J){let Q=yield*jJ(),X=f(Q,b),Y=f(Q,UJ),$=fJ(Q),G=KJ(IJ(J.exportInterval),PJ),B=void 0,C=nJ(f(Q,pJ)).pipe(iJ(NJ(rJ,!1)),aJ({schedule:VQ,times:3})),V=vJ({"user-agent":`effect-opentelemetry-${J.label}/0.0.0`});if(J.headers)V=dJ(mJ(J.headers),V);let r=uJ(J.url,{headers:V}),O=[],s=OJ(()=>{if(B!==void 0&&X.currentTimeMillisUnsafe()<B)return y;else if(B!==void 0)B=void 0;let h=O;if(J.maxBatchSize!=="disabled"){if(O.length===0)return y;O=[]}return C.execute(cJ(r,J.body(h))).pipe(EJ,SJ(!1))}).pipe(MJ((h)=>{if(B!==void 0)return y;return B=X.currentTimeMillisUnsafe()+60000,O=[],yJ("Disabling exporter for 60 seconds",h)}),bJ({package:"@effect/opentelemetry",module:J.label}));return yield*zJ(Y,s.pipe(RJ,kJ,VJ(J.shutdownTimeout))),yield*hJ(G).pipe(TJ(s),LJ,xJ(Y)),{push(h){if(B!==void 0)return;if(O.push(h),J.maxBatchSize!=="disabled"&&O.length>=J.maxBatchSize)gJ($(s),Y)}}});var jQ=(J)=>{let Q=J.attributes?e(Object.entries(J.attributes)):[];if(Q.push({key:"service.name",value:{stringValue:J.serviceName}}),J.serviceVersion)Q.push({key:"service.version",value:{stringValue:J.serviceVersion}});return{attributes:Q,droppedAttributesCount:0}},JQ=E(function*(J){let Q={...yield*g(o(eJ(j,j)),"OTEL_RESOURCE_ATTRIBUTES"),...J?.attributes},X=J?.serviceName??Q["service.name"]??(yield*g(j,"OTEL_SERVICE_NAME"));delete Q["service.name"];let Y=J?.serviceVersion??Q["service.version"]??(yield*g(o(j),"OTEL_SERVICE_VERSION"));return delete Q["service.version"],jQ({serviceName:X,serviceVersion:Y,attributes:Q})},oJ),QQ=(J)=>{let Q=J.attributes.find((X)=>X.key==="service.name");if(!Q||!Q.value.stringValue)throw Error("Resource does not contain a service name");return Q.value.stringValue},e=(J)=>{let Q=[];for(let[X,Y]of J)Q.push({key:X,value:m(Y)});return Q},m=(J)=>{if(Array.isArray(J))return{arrayValue:{values:J.map(m)}};switch(typeof J){case"string":return{stringValue:J};case"bigint":return{intValue:Number(J)};case"number":return Number.isInteger(J)?{intValue:J}:{doubleValue:J};case"boolean":return{boolValue:J};default:return{stringValue:tJ(J)}}};var c={};u(c,{layerProtobuf:()=>YX,layerJson:()=>XX,OtlpSerialization:()=>M});var N={Varint:0,Fixed64:1,LengthDelimited:2,Fixed32:5},k=(J,Q)=>J<<3|Q,D=(J)=>{let Q=[],X=typeof J==="bigint"?J:BigInt(J);while(X>0x7fn)Q.push(Number(X&0x7fn)|128),X>>=7n;return Q.push(Number(X)),new Uint8Array(Q)};var kQ=(J)=>{let Q=new Uint8Array(8);return new DataView(Q.buffer).setBigUint64(0,J,!0),Q},LQ=(J)=>{let Q=new Uint8Array(4);return new DataView(Q.buffer).setUint32(0,J,!0),Q},SQ=(J)=>{let Q=new Uint8Array(8);return new DataView(Q.buffer).setFloat64(0,J,!0),Q},xQ=(J)=>new TextEncoder().encode(J),fQ=(J)=>{let Q=new Uint8Array(J.length/2);for(let X=0;X<J.length;X+=2)Q[X/2]=parseInt(J.slice(X,X+2),16);return Q},Z=(...J)=>{let Q=J.reduce(($,G)=>$+G.length,0),X=new Uint8Array(Q),Y=0;for(let $ of J)X.set($,Y),Y+=$.length;return X},q=(J,Q)=>Z(D(k(J,N.Varint)),D(Q));var JJ=(J,Q)=>q(J,Q?1:0),W=(J,Q)=>Z(D(k(J,N.Fixed64)),kQ(Q)),v=(J,Q)=>Z(D(k(J,N.Fixed32)),LQ(Q)),F=(J,Q)=>Z(D(k(J,N.Fixed64)),SQ(Q)),L=(J,Q)=>Z(D(k(J,N.LengthDelimited)),D(Q.length),Q),K=(J,Q)=>L(J,xQ(Q)),U=(J,Q)=>L(J,fQ(Q)),w=(J,Q)=>L(J,Q),_=(J,Q,X)=>Z(...Q.map((Y)=>w(J,X(Y))));var H=(J,Q)=>Q!==void 0&&Q!==""?K(J,Q):new Uint8Array(0);var QJ=(J)=>{if(J.stringValue!==void 0&&J.stringValue!==null)return K(1,J.stringValue);if(J.boolValue!==void 0&&J.boolValue!==null)return JJ(2,J.boolValue);if(J.intValue!==void 0&&J.intValue!==null)return q(3,BigInt(J.intValue));if(J.doubleValue!==void 0&&J.doubleValue!==null)return F(4,J.doubleValue);if(J.arrayValue!==void 0)return w(5,bQ(J.arrayValue));if(J.kvlistValue!==void 0)return w(6,gQ(J.kvlistValue));if(J.bytesValue!==void 0)return L(7,J.bytesValue);return new Uint8Array(0)},bQ=(J)=>_(1,J.values,QJ),gQ=(J)=>_(1,J.values,P),P=(J)=>Z(K(1,J.key),w(2,QJ(J.value))),XJ=(J)=>Z(K(1,J.name),H(2,J.version),J.attributes?_(3,J.attributes,P):new Uint8Array(0),J.droppedAttributesCount?q(4,J.droppedAttributesCount):new Uint8Array(0)),YJ=(J)=>Z(_(1,J.attributes,P),J.droppedAttributesCount>0?q(2,J.droppedAttributesCount):new Uint8Array(0));var mQ=(J)=>Z(H(2,J.message),q(3,J.code)),vQ=(J)=>Z(W(1,BigInt(J.timeUnixNano)),K(2,J.name),_(3,J.attributes,P),J.droppedAttributesCount>0?q(4,J.droppedAttributesCount):new Uint8Array(0)),dQ=(J)=>Z(U(1,J.traceId),U(2,J.spanId),H(3,J.traceState),_(4,J.attributes,P),J.droppedAttributesCount>0?q(5,J.droppedAttributesCount):new Uint8Array(0),J.flags!==void 0?v(6,J.flags):new Uint8Array(0)),lQ=(J)=>Z(U(1,J.traceId),U(2,J.spanId),H(3,J.traceState),J.parentSpanId!==void 0?U(4,J.parentSpanId):new Uint8Array(0),K(5,J.name),q(6,J.kind),W(7,BigInt(J.startTimeUnixNano)),W(8,BigInt(J.endTimeUnixNano)),_(9,J.attributes,P),J.droppedAttributesCount>0?q(10,J.droppedAttributesCount):new Uint8Array(0),_(11,J.events,vQ),J.droppedEventsCount>0?q(12,J.droppedEventsCount):new Uint8Array(0),_(13,J.links,dQ),J.droppedLinksCount>0?q(14,J.droppedLinksCount):new Uint8Array(0),w(15,mQ(J.status)),J.flags!==void 0?v(16,J.flags):new Uint8Array(0)),uQ=(J)=>Z(w(1,XJ(J.scope)),_(2,J.spans,lQ),H(3,J.schemaUrl)),cQ=(J)=>Z(w(1,YJ(J.resource)),_(2,J.scopeSpans,uQ),H(3,J.schemaUrl)),XQ=(J)=>_(1,J.resourceSpans,cQ);var YQ=(J)=>Z(W(2,BigInt(J.startTimeUnixNano)),W(3,BigInt(J.timeUnixNano)),J.asDouble!==void 0?F(4,J.asDouble):new Uint8Array(0),J.asInt!==void 0?W(6,BigInt(J.asInt)):new Uint8Array(0),_(7,J.attributes,P),J.flags!==void 0?q(8,J.flags):new Uint8Array(0)),pQ=(J)=>{let Q=Z(...J.bucketCounts.map((Y)=>W(6,BigInt(Y)))),X=Z(...J.explicitBounds.map((Y)=>F(7,Y)));return Z(W(2,BigInt(J.startTimeUnixNano)),W(3,BigInt(J.timeUnixNano)),W(4,BigInt(J.count)),J.sum!==void 0?F(5,J.sum):new Uint8Array(0),Q,X,_(9,J.attributes,P),J.flags!==void 0?q(10,J.flags):new Uint8Array(0),J.min!==void 0?F(11,J.min):new Uint8Array(0),J.max!==void 0?F(12,J.max):new Uint8Array(0))},iQ=(J)=>_(1,J.dataPoints,YQ),nQ=(J)=>Z(_(1,J.dataPoints,YQ),q(2,J.aggregationTemporality),JJ(3,J.isMonotonic)),aQ=(J)=>Z(_(1,J.dataPoints,pQ),q(2,J.aggregationTemporality)),rQ=(J)=>Z(K(1,J.name),H(2,J.description),H(3,J.unit),J.gauge!==void 0?w(5,iQ(J.gauge)):new Uint8Array(0),J.sum!==void 0?w(7,nQ(J.sum)):new Uint8Array(0),J.histogram!==void 0?w(9,aQ(J.histogram)):new Uint8Array(0)),sQ=(J)=>Z(w(1,XJ(J.scope)),_(2,J.metrics,rQ),H(3,J.schemaUrl)),tQ=(J)=>Z(w(1,YJ(J.resource)),_(2,J.scopeMetrics,sQ),H(3,J.schemaUrl)),ZQ=(J)=>_(1,J.resourceMetrics,tQ);var oQ=(J)=>Z(W(1,BigInt(J.timeUnixNano)),J.severityNumber!==void 0?q(2,J.severityNumber):new Uint8Array(0),H(3,J.severityText),J.body!==void 0?w(5,QJ(J.body)):new Uint8Array(0),_(6,J.attributes,P),J.droppedAttributesCount!==void 0&&J.droppedAttributesCount>0?q(7,J.droppedAttributesCount):new Uint8Array(0),J.flags!==void 0?v(8,J.flags):new Uint8Array(0),J.traceId!==void 0&&J.traceId!==""?U(9,J.traceId):new Uint8Array(0),J.spanId!==void 0&&J.spanId!==""?U(10,J.spanId):new Uint8Array(0),J.observedTimeUnixNano!==void 0?W(11,BigInt(J.observedTimeUnixNano)):new Uint8Array(0)),eQ=(J)=>Z(w(1,XJ(J.scope)),_(2,J.logRecords,oQ),H(3,J.schemaUrl)),JX=(J)=>Z(w(1,YJ(J.resource)),_(2,J.scopeLogs,eQ),H(3,J.schemaUrl)),_Q=(J)=>_(1,J.resourceLogs,JX);class M extends $Q()("effect/observability/OtlpSerialization"){}var XX=ZJ(M,{traces:(J)=>l(J),metrics:(J)=>l(J),logs:(J)=>l(J)}),YX=ZJ(M,{traces:(J)=>d(XQ(J),"application/x-protobuf"),metrics:(J)=>d(ZQ(J),"application/x-protobuf"),logs:(J)=>d(_Q(J),"application/x-protobuf")});var IQ=E(function*(J){let Q=yield*M,X=yield*JQ(J.resource),Y={name:QQ(X)},$=yield*sJ({label:"OtlpLogger",url:J.url,headers:J.headers,maxBatchSize:J.maxBatchSize??1000,exportInterval:J.exportInterval??T(1),body:(B)=>Q.logs({resourceLogs:[{resource:X,scopeLogs:[{scope:Y,logRecords:B}]}]}),shutdownTimeout:J.shutdownTimeout??T(3)}),G={excludeLogSpans:J.excludeLogSpans??!1,clock:yield*b};return HQ((B)=>{$.push(_X(B,G))})}),ZX=(J)=>WQ([IQ(J)],{mergeWithExisting:J.mergeWithExisting??!0}),_X=(J,Q)=>{let Y=Q.clock.currentTimeNanosUnsafe().toString(),$=J.date.getTime(),G=e(Object.entries(J.fiber.getRef(BQ)));if(G.push({key:"fiberId",value:{intValue:J.fiber.id}}),!Q.excludeLogSpans)for(let[V,r]of J.fiber.getRef(wQ))G.push({key:`logSpan.${V}`,value:{stringValue:`${$-r}ms`}});if(J.cause.reasons.length>0)G.push({key:"log.error",value:{stringValue:qQ(J.cause)}});let B=GQ(J.message),C={severityNumber:$X(J.logLevel),severityText:J.logLevel,timeUnixNano:Y,observedTimeUnixNano:Y,attributes:G,body:m(B.length===1?B[0]:B),droppedAttributesCount:0};if(J.fiber.currentSpan)C.traceId=J.fiber.currentSpan.traceId,C.spanId=J.fiber.currentSpan.spanId;return C},$X=(J)=>{switch(J){case"Trace":return A.SEVERITY_NUMBER_TRACE;case"Debug":return A.SEVERITY_NUMBER_DEBUG;case"Info":return A.SEVERITY_NUMBER_INFO;case"Warn":return A.SEVERITY_NUMBER_WARN;case"Error":return A.SEVERITY_NUMBER_ERROR;case"Fatal":return A.SEVERITY_NUMBER_FATAL;default:return A.SEVERITY_NUMBER_UNSPECIFIED}},A={SEVERITY_NUMBER_UNSPECIFIED:0,SEVERITY_NUMBER_TRACE:1,SEVERITY_NUMBER_TRACE2:2,SEVERITY_NUMBER_TRACE3:3,SEVERITY_NUMBER_TRACE4:4,SEVERITY_NUMBER_DEBUG:5,SEVERITY_NUMBER_DEBUG2:6,SEVERITY_NUMBER_DEBUG3:7,SEVERITY_NUMBER_DEBUG4:8,SEVERITY_NUMBER_INFO:9,SEVERITY_NUMBER_INFO2:10,SEVERITY_NUMBER_INFO3:11,SEVERITY_NUMBER_INFO4:12,SEVERITY_NUMBER_WARN:13,SEVERITY_NUMBER_WARN2:14,SEVERITY_NUMBER_WARN3:15,SEVERITY_NUMBER_WARN4:16,SEVERITY_NUMBER_ERROR:17,SEVERITY_NUMBER_ERROR2:18,SEVERITY_NUMBER_ERROR3:19,SEVERITY_NUMBER_ERROR4:20,SEVERITY_NUMBER_FATAL:21,SEVERITY_NUMBER_FATAL2:22,SEVERITY_NUMBER_FATAL3:23,SEVERITY_NUMBER_FATAL4:24};var UQ={};u(UQ,{logger:()=>n,layer:()=>qJ,create:()=>KQ});var GX=(J)=>J==="sessionID"?"session.id":J,PQ=(J)=>Object.fromEntries(Object.entries(J??{}).filter((Q)=>Q[1]!==void 0&&Q[1]!==null).map(([Q,X])=>[GX(Q),X])),qX=(J)=>{if(Array.isArray(J))return J.map((Q)=>String(Q)).join(" ");return J===void 0?"":String(J)},i=(J,Q,X,Y)=>{let $=PQ({...Q,...Y}),G=J(X);return Object.keys($).length?I.annotateLogs(G,$):G},n=R.make((J)=>{let Q=PQ(J.fiber.getRef($J.CurrentLogAnnotations)),X=J.date.getTime();for(let[B,C]of J.fiber.getRef($J.CurrentLogSpans))Q[`logSpan.${B}`]=`${X-C}ms`;if(J.cause.reasons.length>0)Q.cause=_J.pretty(J.cause);let Y=typeof Q.service==="string"?Q.service:void 0;if(Y)delete Q.service;let $=Y?GJ.create({service:Y}):GJ.Default,G=qX(J.message);switch(J.logLevel){case"Trace":case"Debug":return $.debug(G,Q);case"Warn":return $.warn(G,Q);case"Error":case"Fatal":return $.error(G,Q);default:return $.info(G,Q)}}),qJ=R.layer([n],{mergeWithExisting:!1}),KQ=(J={})=>({debug:(Q,X)=>i((Y)=>I.logDebug(Y),J,Q,X),info:(Q,X)=>i((Y)=>I.logInfo(Y),J,Q,X),warn:(Q,X)=>i((Y)=>I.logWarning(Y),J,Q,X),error:(Q,X)=>i((Y)=>I.logError(Y),J,Q,X),with:(Q)=>KQ({...J,...Q})});var a=x.OTEL_EXPORTER_OTLP_ENDPOINT,OQ=!!a,BX=crypto.randomUUID(),TQ=x.OTEL_EXPORTER_OTLP_HEADERS?x.OTEL_EXPORTER_OTLP_HEADERS.split(",").reduce((J,Q)=>{let[X,...Y]=Q.split("=");return J[X]=Y.join("="),J},{}):void 0;function BJ(){let J=FQ("main"),Q=(()=>{let X=process.env.OTEL_RESOURCE_ATTRIBUTES;if(!X)return{};try{return Object.fromEntries(X.split(",").map((Y)=>{let $=Y.indexOf("=");if($<1)throw Error("Invalid OTEL_RESOURCE_ATTRIBUTES entry");return[decodeURIComponent(Y.slice(0,$)),decodeURIComponent(Y.slice($+1))]}))}catch{return{}}})();return{serviceName:"qitqode",serviceVersion:CQ,attributes:{...Q,"deployment.environment.name":DQ,"qitqode.client":x.QITQODE_CLIENT,"qitqode.process_role":J.processRole,"qitqode.run_id":J.runID,"service.instance.id":BX}}}function wX(){return R.layer([n,p.make({url:`${a}/v1/logs`,resource:BJ(),headers:TQ})],{mergeWithExisting:!1}).pipe(z.provide(c.layerJson),z.provide(AQ.layer))}var HX=async()=>{let J=await import("./chunk-ntr0ezf2.js"),Q=await import("./chunk-cr5tknvb.js"),X=await import("./chunk-48gap82w.js"),{AsyncLocalStorageContextManager:Y}=await import("./chunk-pqg1wjb5.js").then((m)=>zQ(m.default,1)),{context:$}=await import("./chunk-kx88qekb.js").then((m)=>zQ(m.default,1)),G=new Y;return G.enable(),$.setGlobalContextManager(G),J.layer(()=>({resource:BJ(),spanProcessor:new X.BatchSpanProcessor(new Q.OTLPTraceExporter({url:`${a}/v1/traces`,headers:TQ}))}))},EQ=!a?qJ:z.unwrap(I.gen(function*(){let J=yield*I.promise(HX);return z.mergeAll(J,wX())})),WX={enabled:OQ,layer:EQ};var aX=z.makeMemoMapUnsafe();
3
+ export{qJ as Dq,UQ as Eq,EQ as Fq,WX as Gq,IX as Hq,aX as Iq};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import"./chunk-r9w0thdk.js";function BX(G){if(G===void 0)return{BS_PRIVATE_NESTED_SOME_NONE:0};else if(G!==null&&G.BS_PRIVATE_NESTED_SOME_NONE!==void 0)return{BS_PRIVATE_NESTED_SOME_NONE:G.BS_PRIVATE_NESTED_SOME_NONE+1|0};else return G}function qG(G){if(G===null||G.BS_PRIVATE_NESTED_SOME_NONE===void 0)return G;let Q=G.BS_PRIVATE_NESTED_SOME_NONE;if(Q===0)return;else return{BS_PRIVATE_NESTED_SOME_NONE:Q-1|0}}function _Y(G){if(Array.isArray(G))return{TAG:"Array",_0:G};else return{TAG:"Single",_0:G}}var IY={classify:_Y},MQ={};function vY(G){let Q=MQ[G];if(Q!==void 0){let X=Q+1|0;return MQ[G]=X,G+("/"+X)}return MQ[G]=1,G}var DX={},gQ=[];function OY(G){return G.slice(0,1).toUpperCase()+G.slice(1)}var JQ=(G)=>({...G});function YG(G){let Q=0;while(!0){let X=Q,Y=G[X];if(Y===void 0)return'"'+G+'"';switch(Y){case'"':case`
2
+ import"./chunk-e0vrxetq.js";function BX(G){if(G===void 0)return{BS_PRIVATE_NESTED_SOME_NONE:0};else if(G!==null&&G.BS_PRIVATE_NESTED_SOME_NONE!==void 0)return{BS_PRIVATE_NESTED_SOME_NONE:G.BS_PRIVATE_NESTED_SOME_NONE+1|0};else return G}function qG(G){if(G===null||G.BS_PRIVATE_NESTED_SOME_NONE===void 0)return G;let Q=G.BS_PRIVATE_NESTED_SOME_NONE;if(Q===0)return;else return{BS_PRIVATE_NESTED_SOME_NONE:Q-1|0}}function _Y(G){if(Array.isArray(G))return{TAG:"Array",_0:G};else return{TAG:"Single",_0:G}}var IY={classify:_Y},MQ={};function vY(G){let Q=MQ[G];if(Q!==void 0){let X=Q+1|0;return MQ[G]=X,G+("/"+X)}return MQ[G]=1,G}var DX={},gQ=[];function OY(G){return G.slice(0,1).toUpperCase()+G.slice(1)}var JQ=(G)=>({...G});function YG(G){let Q=0;while(!0){let X=Q,Y=G[X];if(Y===void 0)return'"'+G+'"';switch(Y){case'"':case`
3
3
  `:return JSON.stringify(G);default:Q=X+1|0;continue}}}function WX(G){if(G==="")return[];else return JSON.parse(G.split('"]["').join('","'))}var fQ="sury",HQ=Symbol(fQ),qQ=Symbol(fQ+":item"),jY=vY("Sury.Error"),b="const";function xY(G){switch(G.type){case"undefined":return!0;case"union":return"undefined"in G.has;default:return!1}}function wX(G,Q){return(G&Q)!==0}var y={unknown:1,string:2,number:4,boolean:8,undefined:16,null:32,object:64,array:128,union:256,ref:512,bigint:1024,nan:2048,function:4096,instance:8192,never:16384,symbol:32768};function eG(G){let Q=y[typeof G];if(Q&16)return"undefined";if(!(Q&64))if(Q&2)return'"'+G+'"';else if(Q&1024)return G+"n";else return G.toString();if(G===null)return"null";if(Array.isArray(G)){let Z="[";for(let J=0,H=G.length;J<H;++J){if(J!==0)Z=Z+", ";Z=Z+eG(G[J])}return Z+"]"}if(G.constructor!==Object)return Object.prototype.toString.call(G);let X=Object.keys(G),Y="{ ";for(let Z=0,J=X.length;Z<J;++Z){let H=X[Z],q=G[H];Y=Y+H+": "+eG(q)+"; "}return Y+"}"}function j(G){let{type:Q,const:X,name:Y}=G;if(Y!==void 0)return Y;if(X!==void 0)return eG(X);let{format:Z,anyOf:J}=G;if(J!==void 0)return J.map(j).join(" | ");if(Z!==void 0)return Z;switch(Q){case"nan":return"NaN";case"object":let{additionalItems:H,properties:q}=G,U=Object.keys(q);if(U.length===0)if(typeof H==="object")return"{ [key: string]: "+j(H)+"; }";else return"{}";else return"{ "+U.map((z)=>z+": "+j(q[z])+";").join(" ")+" }";default:if(G.b)return Q;switch(Q){case"instance":return G.class.name;case"array":let{additionalItems:z,items:K}=G;if(typeof z!=="object")return"["+K.map((B)=>j(B.schema)).join(", ")+"]";let D=j(z);return(z.type==="union"?"("+D+")":D)+"[]";default:return Q}}}class BG extends Error{constructor(G,Q,X){super();this.flag=Q,this.code=G,this.path=X}}var TG=Object.defineProperty,dG=BG.prototype;TG(dG,"message",{get(){return LX(this)}});TG(dG,"reason",{get(){return UQ(this)}});TG(dG,"name",{value:"SuryError"});TG(dG,"s",{value:HQ});TG(dG,"_1",{get(){return this}});TG(dG,"RE_EXN_ID",{value:jY});var F=function(G){this.type=G},bQ=Object.create(null);TG(bQ,"with",{get(){return(G,...Q)=>G(this,...Q)}});F.prototype=bQ;function zQ(G){if(G&&G.s===HQ)return G;throw G}function UQ(G,Q){let X=Q!==void 0?Q:0,Y=G.code;if(typeof Y!=="object")return"Encountered unexpected async transform or refine. Use parseAsyncOrThrow operation instead";switch(Y.TAG){case"OperationFailed":return Y._0;case"InvalidOperation":return Y.description;case"InvalidType":let Z=Y.unionErrors,J="Expected "+j(Y.expected)+", received "+eG(Y.received);if(Z!==void 0){let H=`
4
4
  `+" ".repeat(X<<1),q={};for(let U=0,z=Z.length;U<z;++U){let K=Z[U],D=UQ(K,X+1),B=K.path,w="- "+(B===""?"":"At "+B+": ")+D;if(!q[w])q[w]=1,J=J+H+w}}return J;case"UnsupportedTransformation":return"Unsupported transformation from "+j(Y.from)+" to "+j(Y.to);case"ExcessField":return'Unrecognized key "'+Y._0+'"';case"InvalidJsonSchema":return j(Y._0)+" is not valid JSON"}}function LX(G){let Q=G.flag,X="Failed ";if(Q&2)X=X+"async ";if(X=X+(Q&1?Q&4?"asserting":"parsing":"converting"),Q&8)X=X+" to JSON"+(Q&16?" string":"");let Y=G.path,Z=Y===""?"":" at "+Y;return X+Z+": "+UQ(G,void 0)}var f={m:LX,d:void 0,a:"strip",n:!1},hG="as",VY={get:(G,Q)=>{let X=G[hG];if(X===void 0)return G[Q];if(Q===hG)return G[Q];let Y=qG(X),Z="Schema S."+Y+" is not enabled. To start using it, add S.enable"+OY(Y)+"() at the project root.";throw Error("[Sury] "+Z)}};function PX(G){let Q=new F("never");return Q[hG]=G,new Proxy(Q,VY)}var ZG=new F("unknown"),KQ=new F("boolean"),RX=new F("symbol"),c=new F("string"),yG=new F("number");yG.format="int32";var AG=new F("number"),EX=new F("bigint"),s=new F("undefined");s.const=void 0;var h=(G)=>{let Q=new F(G.type);for(let X in G)if(X>"a"||X==="$ref"||X==="$defs")Q[X]=G[X];return Q};function n(G,Q){let X=h(G),Y=X;while(Y.to){let Z=h(Y.to);Y.to=Z,Y=Z}return Q(Y),X}var yY=(G)=>{for(let Q in G)if(Number(Q[0]))delete G[Q]},SY=BG;function $Y(G,Q,X){return new BG(G,Q,X)}var NX={value:SY,constructor:$Y};function _(G,Q){let X=G.g.e,Y=X.length;return X[Y]=Q,"e["+Y+"]"}function BQ(G,Q){let X=y[Q.type],Y=Q.const;if(X&16)return"void 0";else if(X&2)return YG(Y);else if(X&1024)return Y+"n";else if(X&45056)return _(G,Q.const);else return Y}function UG(G,Q){let X='"'+Q+'"',Y=G.g[X];if(Y!==void 0)return Y;let Z=YG(Q);return G.g[X]=Z,Z}function gY(G){let Q=this;Q.l=Q.l+","+G}function JG(G){let Q=this;Q.l=G,Q.a=gY}function TX(G,Q){let X={c:"",l:"",a:JG,v:-1,o:G,f:"",e:[],d:Q};return X.g=X,X}function DG(G){delete G.a;let Q=G.l;if(Q==="")return G.f+G.c;else return G.f+"let "+Q+";"+G.c}function u(G){let Q=G.v+1;return G.v=Q,"v"+Q}function EG(G){return this.i}function i(G){let Q=this,X=u(G.g),Y=Q.i;if(Y==="")Q.b.a(X);else if(G.a!==void 0)G.a(X+"="+Y);else G.c=G.c+(X+"="+Y+";"),G.g.a(X);return Q.v=EG,Q.i=X,X}function GQ(G,Q){let X=u(G.g);return G.a(X),{b:G,v:EG,i:X,f:0,type:Q.type}}function $(G,Q,X){return{b:G,v:i,i:Q,f:0,type:X.type}}function RG(G,Q){return{b:G,v:i,i:BQ(G,Q),f:0,type:Q.type,const:Q.const}}function lG(G,Q){return{b:G,v:i,i:Q,f:2,type:"unknown"}}function fY(G,Q){return G+":"+Q+","}function bY(G,Q){return Q+","}function $G(G,Q){return{b:G,v:i,i:"",f:0,type:Q?"array":"object",properties:{},additionalItems:"strict",j:Q?bY:fY,c:0,r:""}}function _G(G,Q,X){let Y=UG(G.b,Q);if(G.properties[Q]=X,X.f&2)G.r=G.r+X.i+",",G.i=G.i+G.j(Y,"a["+G.c+++"]");else G.i=G.i+G.j(Y,X.i)}function dY(G,Q){let X=Object.keys(Q.properties);for(let Y=0,Z=X.length;Y<Z;++Y){let J=X[Y];_G(G,J,Q.properties[J])}}function gG(G,Q){if(G.i=Q?"["+G.i+"]":"{"+G.i+"}",G.c)G.f=G.f|2,G.i="Promise.all(["+G.r+"]).then(a=>("+G.i+"))";return G.additionalItems="strict",G}function dQ(G,Q,X,Y){return Q.v(G)+"["+X+"]="+Y.i}function JX(G,Q,X){if(Q===X)return"";let Y=Q.v(G),Z=Q.f&2,J=X.f&2;if(Z){if(!J)return Y+"=Promise.resolve("+X.i+")"}else if(J)return Q.f=Q.f|2,Y+"="+X.i;return Y+"="+X.i}function fG(G,Q,X){let Y=Q.properties,Z=Y[X];if(Z!==void 0)return Z;let J=Q.additionalItems,H;if(J==="strip"||J==="strict"){if(J==="strip")throw Error("[Sury] The schema doesn't have additional items");throw Error("[Sury] The schema doesn't have additional items")}else H=J;let q={b:G,v:i,i:Q.v(G)+("["+YG(X)+"]"),f:0,type:H.type};return Y[X]=q,q}function lY(G,Q,X){return Q.v(G)+"="+X}function kX(G,Q){return{b:Q.b,v:i,i:G+"("+Q.i+")",f:0,type:"unknown"}}function OG(G,Q,X){throw new BG(Q,G.g.o,X)}function CQ(G,Q,X){if(Q.f&2)return lG(Q.b,Q.i+".then("+_(G,X)+")");else return kX(_(G,X),Q)}function QG(G,Q,X,Y){return _(G,(Z)=>OG(G,X(Z),Q))+"("+Y+")"}function S(G,Q,X){return _(G,()=>OG(G,{TAG:"OperationFailed",_0:Q},X))+"()"}function FQ(G,Q,X){return{schema:Q,fail:(Y,Z)=>{return OG(G,{TAG:"OperationFailed",_0:Y},X+(Z!==void 0?Z:""))}}}function tG(G,Q,X){return OG(G,{TAG:"InvalidOperation",description:X},Q)}function sG(G,Q,X,Y,Z,J){if(X===""&&Y===void 0)return J(G,Q,X);try{let H=(E,N)=>{E.c=N+".path="+YG(X)+"+"+(Y!==void 0?`'["'+`+Y+`+'"]'+`:"")+N+".path"},q=(E)=>J(E,Q,""),U=G.c;G.c="";let z=u(G.g),K=H(G,z),D="if("+(z+"&&"+z+".s===s")+"){"+G.c;G.c="";let B={c:"",l:"",a:JG,f:"",g:G.g},W=q(B);G.c=G.c+DG(B);let w=W.i===Q.i&&G.c==="";if(Z!==void 0)Z(G,W);if(w)return W;let L=W.f&2,R=Q===W?Q:Z!==void 0?W:{b:G,v:i,i:"",f:L?2:0,type:"unknown"},P=K!==void 0?(E)=>D+(E===1?"return "+K.i:JX(G,R,K))+("}else{throw "+z+"}"):(E)=>D+"}throw "+z;return G.c=U+("try{"+G.c+(L?lY(G,R,W.i+".catch("+z+"=>{"+P(1)+"})"):JX(G,R,W))+"}catch("+z+"){"+P(0)+"}"),R}catch(H){let q=zQ(H);throw new BG(q.code,q.flag,X+"[]"+q.path)}}function SG(G,Q,X,Y){let Z=Y?"!==":"===",J=Y?"||":"&&",H=Y?"!":"",q=X.type,U=y[q];if(U&2048)return H+("Number.isNaN("+Q+")");if(b in X)return Q+Z+BQ(G,X);if(U&4)return"typeof "+Q+Z+'"'+q+'"';if(U&64)return"typeof "+Q+Z+'"'+q+'"'+J+H+Q;if(U&128)return H+"Array.isArray("+Q+")";if(!(U&8192))return"typeof "+Q+Z+'"'+q+'"';let z=Q+" instanceof "+_(G,X.class);if(Y)return"!("+z+")";else return z}function oG(G,Q,X,Y){let Z=Y?"!==":"===",J=Y?"||":"&&",H=Y?"":"!",q=Y?">":"<",U=Y?"<":">",z=X.type,K,D=0;if(X.const!==void 0)return"";let W=X.format;if(W!==void 0)switch(W){case"int32":return J+Q+q+"2147483647"+J+Q+U+"-2147483648"+J+Q+"%1"+Z+"0";case"port":case"json":D=2;break}else D=2;if(D===2)switch(z){case"number":if(f.n)return"";else return J+H+"Number.isNaN("+Q+")";case"array":case"object":K=z;break;default:return""}let{additionalItems:w,items:L}=X,R=L.length,P=K==="array"?w==="strip"||w==="strict"?w==="strip"?J+Q+".length"+U+R:J+Q+".length"+Z+R:"":w==="strip"?"":J+H+"Array.isArray("+Q+")";for(let E=0,N=L.length;E<N;++E){let M=L[E],C=M.location,T=M.schema,k;if(b in T||X.unnest){let A=UG(G,C);k=SG(G,Q+("["+A+"]"),T,Y)}else if(T.items){let A=UG(G,C),I=Q+("["+A+"]");k=SG(G,I,T,Y)+oG(G,I,T,Y)}else k="";if(k!=="")P=P+J+k}return P}function MX(G,Q,X){let Y={b:G,v:Q.v,i:Q.i,f:Q.f,type:X.type},Z=(J,H)=>{if(b in H)J.const=H.const;let q=H.items;if(q===void 0)return;let U={};q.forEach((z)=>{let K=z.schema,D=b in K;if(!(D||K.items))return;let B;if(D)B=BQ(G,K);else{let w=UG(G,z.location);B=J.v(G)+("["+w+"]")}let W={b:J.b,v:i,i:B,f:0,type:K.type};Z(W,K),U[z.location]=W}),J.properties=U,J.additionalItems=ZG};return Z(Y,X),Y}function _Q(G,Q,X,Y){if(Q.noValidation||y[Q.type]&17153)return"";let Z=X.v(G);return"if("+SG(G,Z,Q,!0)+oG(G,Z,Q,!0)+"){"+QG(G,Y,(J)=>({TAG:"InvalidType",expected:Q,received:J}),Z)+"}"}function DQ(G,Q,X,Y){return OG(G,{TAG:"UnsupportedTransformation",from:Q,to:X},Y)}function uY(G){return G}function CX(G,Q){G[Q==="union"||Q==="ref"?"unknown":Q]=!0}var LG="JSON",GG=PX("jsonString");function IQ(G,Q){return $(G,'""+'+Q.i,c)}function d(G,Q,X,Y){let Z={c:"",l:"",a:JG,f:"",g:G.g};if(Q.$defs)Z.g.d=Q.$defs;let J=X,H=b in J,q=b in Q,U=J.type===Q.type,z=y[Q.type],K=y[J.type],D=!1;if(!(z&257||Q.format==="json")){if(Q.name===LG&&!(K&1)){if(!(K&14))if(K&1024)J=IQ(Z,J);else D=!0}else if(q)if(H){if(J.const!==Q.const)J=RG(Z,Q)}else if(K&2&&z&3132){let w=J.v(Z);Z.f=Q.noValidation?"":J.i+'==="'+Q.const+'"||'+QG(Z,Y,(L)=>({TAG:"InvalidType",expected:Q,received:L}),w)+";",J=RG(Z,Q)}else if(Q.noValidation)J=RG(Z,Q);else Z.f=_Q(G,Q,J,Y),J.type=Q.type,J.const=Q.const;else if(H&&!q){if(!U)if(z&2&&K&3132){let w=""+J.const;J={b:Z,v:i,i:'"'+w+'"',f:0,type:"string",const:w}}else D=!0}else if(K&1){let w=Q.$ref;if(w!==void 0){let L=Z.g.d,R=w.slice(8),P=L[R],E=Q.noValidation?(Z.g.o|1)^1:Z.g.o,N=P[E],M;if(N!==void 0){let C=qG(N);M=C===0?_(Z,P)+("["+E+"]"):_(Z,C)}else{P[E]=0;let C=AX(P,E,Z.g.d);P[E]=C,M=_(Z,C)}J=sG(Z,J,Y,void 0,void 0,(C,T,k)=>{let A=kX(M,T);if(P.isAsync===void 0){let I=JQ(L);I[R]=ZG,pY(P,I)}if(P.isAsync)A.f=A.f|2;return A}),J.v(Z)}else{if(Z.g.o&1)Z.f=_Q(G,Q,J,Y);let L=MX(Z,J,Q);if(J.type=L.type,J.i=L.i,J.v=L.v,J.additionalItems=L.additionalItems,J.properties=L.properties,b in L)J.const=L.const}}else if(z&2&&K&1036)J=IQ(Z,J);else if(!U)if(K&2){let w=J.v(Z);if(z&8){let L=GQ(Z,Q);Z.c=Z.c+("("+L.i+"="+w+'==="true")||'+w+'==="false"||'+QG(Z,Y,(R)=>({TAG:"InvalidType",expected:Q,received:R}),w)+";"),J=L}else if(z&4){let L=$(Z,"+"+w,Q),R=L.v(Z),P=Q.format;Z.c=Z.c+(P!==void 0?"("+oG(Z,R,Q,!0).slice(2)+")":"Number.isNaN("+R+")")+("&&"+QG(Z,Y,(E)=>({TAG:"InvalidType",expected:Q,received:E}),w)+";"),J=L}else if(z&1024){let L=GQ(Z,Q);Z.c=Z.c+("try{"+L.i+"=BigInt("+w+")}catch(_){"+QG(Z,Y,(R)=>({TAG:"InvalidType",expected:Q,received:R}),w)+"}"),J=L}else D=!0}else if(K&4&&z&1024)J=$(Z,"BigInt("+J.i+")",Q);else D=!0}if(D)DQ(Z,J,Q,Y);let B=Q.compiler;if(B!==void 0)J=B(Z,J,Q,Y);if(J.t!==!0){let w=Q.refiner;if(w!==void 0)Z.c=Z.c+w(Z,J.v(Z),Q,Y)}let W=Q.to;if(W!==void 0){let w=Q.parser;if(w!==void 0)J=w(Z,J,Q,Y);if(J.t!==!0)J=d(Z,W,J,Y)}return G.c=G.c+DG(Z),J}function KG(G){while(!0){let Q=G,X=Q.to;if(X===void 0)return Q;G=X;continue}}function PG(G,Q,X,Y){let Z=y[G.type];if(Z&48129||Z&16&&Q.type!=="object")throw new BG({TAG:"InvalidJsonSchema",_0:Q},Y,X);if(Z&256){G.anyOf.forEach((q)=>PG(q,Q,X,Y));return}if(!(Z&192))return;let J=G.additionalItems;if(J==="strip"||J==="strict");else PG(J,Q,X,Y);let H=G.properties;if(H!==void 0){let q=Object.keys(H);for(let U=0,z=q.length;U<z;++U){let K=q[U];PG(H[K],Q,X,Y)}return}G.items.forEach((q)=>PG(q.schema,G,X+("["+YG(q.location)+"]"),Y))}function XG(G){let Q,X=G;while(X){let Y=h(X),Z=Y.to,J=Q;if(J!==void 0)Y.to=J;else delete Y.to;let{parser:H,serializer:q}=Y;if(q!==void 0)Y.parser=q;else delete Y.parser;if(H!==void 0)Y.serializer=H;else delete Y.serializer;let{fromDefault:U,default:z}=Y;if(z!==void 0)Y.fromDefault=z;else delete Y.fromDefault;if(U!==void 0)Y.default=U;else delete Y.default;let K=Y.items;if(K!==void 0){let W={},w=Array(K.length);for(let R=0,P=K.length;R<P;++R){let E=K[R],N=XG(E.schema),M=E.location,C={schema:N,location:M};if(E.r)C.r=E.r;W[E.location]=N,w[R]=C}if(Y.items=w,Y.properties!==void 0)Y.properties=W}if(typeof Y.additionalItems==="object")Y.additionalItems=XG(Y.additionalItems);let D=Y.anyOf;if(D!==void 0){let W={},w=[];for(let L=0,R=D.length;L<R;++L){let P=D[L],E=XG(P);w.push(E),CX(W,E.type)}Y.has=W,Y.anyOf=w}let B=Y.$defs;if(B!==void 0){let W={};for(let w=0,L=Object.keys(B).length;w<L;++w){let R=Object.keys(B)[w];W[R]=XG(B[R])}Y.$defs=W}Q=Y,X=Z}return Q}function AX(G,Q,X){let Y=TX(Q,X);if(Q&8){let B=XG(G);PG(B,B,"",Q)}let Z={b:Y,v:EG,i:"i",f:0,type:"unknown"},J=Q&4?n(G,(B)=>{let W=new F(s.type);W.const=s.const,W.noValidation=!0,B.to=W}):Q&16?n(G,(B)=>{B.to=GG}):G,H=d(Y,J,Z,""),q=DG(Y),U=wX(H.f,2);if(J.isAsync=U,q===""&&H===Z&&!(Q&2))return uY;let z=H.i;if(Q&2&&!U&&!X)z="Promise.resolve("+z+")";let K="i=>{"+q+"return "+z+"}",D=Y.g.e;return Function("e","s","return "+K)(D,HQ)}function pY(G,Q){try{let X=TX(2,Q),Z=d(X,G,{b:X,v:EG,i:"i",f:0,type:"unknown"},""),J=wX(Z.f,2);return G.isAsync=J,J}catch(X){return zQ(X),!1}}function o(G,Q){if(Q in G)return G[Q];let X=AX(Q&32?XG(G):G,Q,0);return G[Q]=X,X}TG(bQ,"~standard",{get:function(){let G=this;return{version:1,vendor:fQ,validate:(Q)=>{try{return{value:o(G,1)(Q)}}catch(X){let Y=zQ(X);return{issues:[{message:UQ(Y,void 0),path:Y.path===""?void 0:WX(Y.path)}]}}}}}});function FX(G,Q,X,Y,Z){let J=Z!==void 0?Z:!0,H=0,q=0;switch(X){case"Output":case"Input":q=1;break;case"Assert":H=H|4;break;case"Json":H=H|8;break;case"JsonString":H=H|24;break}if(q===1&&X===Q)throw Error("[Sury] Can't compile operation to converting value to self");if(Y!=="Sync")H=H|2;if(J)H=H|1;if(Q==="Output")H=H|32;let U=o(G,H);if(Q!=="JsonString")return U;let z=H;return(K)=>{try{return U(JSON.parse(K))}catch(D){throw new BG({TAG:"OperationFailed",_0:D.message},z,"")}}}function WQ(G,Q){return o(Q,1)(G)}function _X(G,Q){let X;try{X=JSON.parse(G)}catch(Y){throw new BG({TAG:"OperationFailed",_0:Y.message},1,"")}return WQ(X,Q)}function IX(G,Q){return o(Q,3)(G)}function vX(G,Q){return o(Q,0)(G)}function OX(G,Q){return o(Q,8)(G)}function jX(G,Q){return o(Q,24)(G)}function xX(G,Q){return o(Q,32)(G)}function lQ(G,Q){return o(Q,40)(G)}function VX(G,Q,X){let Y=X!==void 0?X:0;return JSON.stringify(lQ(G,Q),null,Y)}function wG(G,Q){return o(Q,5)(G)}var wQ=new F("null");wQ.const=null;function IG(G){if(G===null)return wQ;let Q=typeof G,X;if(Q==="object"){let Y=new F("instance");Y.class=G.constructor,X=Y}else X=Q==="undefined"?s:Q==="number"?Number.isNaN(G)?new F("nan"):new F(Q):new F(Q);return X.const=G,X}function vQ(G){if(G&&G.s===HQ)return{success:!1,error:G};throw G}function yX(G){try{return{success:!0,value:G()}}catch(Q){return vQ(Q)}}function SX(G){try{return G().then((Q)=>({success:!0,value:Q}),vQ)}catch(Q){return Promise.resolve(vQ(Q))}}function uQ(G,Q,X){let Y=h(G);return Y[Q]=X,Y}var pQ="#/$defs/";function $X(G,Q){let X=pQ+G,Y=new F("ref");Y.$ref=X,Y.name=G;let Z=f.d;if(!Z)f.d={};let J=Q(Y);if(J.name)Y.name=J.name;else J.name=G;if(f.d[G]=J,Z)return Y;let H=new F("ref");return H.name=J.name,H.$ref=X,H.$defs=f.d,f.d=void 0,H}function gX(G,Q){let X=h(G);return X.noValidation=Q,X}function fX(G,Q){if(G!==void 0)return(X,Y,Z,J)=>G(X,Y,Z,J)+Q(X,Y,Z,J);else return Q}function rQ(G,Q){return n(G,(X)=>{X.refiner=fX(X.refiner,Q)})}function rG(G,Q){return rQ(G,(X,Y,Z,J)=>_(X,Q(FQ(X,Z,J)))+"("+Y+");")}function g(G,Q,X,Y){let Z=G[Q];return rQ(uQ(G,Q,Z!==void 0?Z.concat(X):[X]),Y)}function LQ(G,Q){return n(G,(X)=>{X.parser=(Z,J,H,q)=>{let U=Q(FQ(Z,H,q)),z=U.p;if(z!==void 0)if(U.a!==void 0)return tG(Z,q,"The S.transform doesn't allow parser and asyncParser at the same time. Remove parser in favor of asyncParser");else return CQ(Z,J,z);let K=U.a;if(K!==void 0){if(!(Z.g.o&2))OG(Z,"UnexpectedAsync","");let D=CQ(Z,J,K);return D.f=D.f|2,D}else if(U.s!==void 0)return tG(Z,q,"The S.transform parser is missing");else return J};let Y=new F("unknown");X.to=(Y.serializer=(Z,J,H,q)=>{let U=Q(FQ(Z,H,q)),z=U.s;if(z!==void 0)return CQ(Z,J,z);else if(U.a!==void 0||U.p!==void 0)return tG(Z,q,"The S.transform serializer is missing");else return J},Y),delete X.isAsync})}var PQ=new F("null");PQ.const=null;PQ.to=s;function OQ(G,Q,X,Y){return G.c=G.c+QG(G,Y,(Z)=>({TAG:"InvalidType",expected:X,received:Z}),Q.i)+";",Q}var RQ=new F("never");RQ.compiler=OQ;var FG="BS_PRIVATE_NESTED_SOME_NONE";function AQ(G,Q,X,Y,Z,J){try{let H=G.g.o;if(Z)G.g.o=H|1;let q={c:"",l:"",a:JG,f:"",g:G.g},U=Z?JQ(X):MX(q,X,Q),z=d(q,Q,U,J);if(z!==U){if(z.b=q,z.f&2)Y.f=Y.f|2;q.c=q.c+(Y.v(G)+"="+z.i)}return G.g.o=H,DG(q)}catch(H){return"throw "+_(G,zQ(H))}}function HX(G,Q){if(G&8320&&"object"in Q)return!0;else if(G&2048)return"number"in Q;else return!1}function rY(G,Q){return Q.every((X,Y)=>{let Z=G[Y];if(Z!==void 0&&!(y[X.type]&9152)&&X.type===Z.type)return X.const===Z.const;else return!1})}function bX(G,Q,X,Y){let Z=X.anyOf,J=Q.anyOf;if(J!==void 0)if(rY(Z,J))return Q;else return DQ(G,Q,X,Y);let H=(T)=>_(G,function(){let k=arguments;return OG(G,{TAG:"InvalidType",expected:X,received:k[0],unionErrors:k.length>1?Array.from(k).slice(1):void 0},Y)})+"("+Q.v(G)+T+")",q=G.g.o&1,U=Q.i,z=-1,K=Z.length-1|0,D={},B=[];for(let T=0;T<=K;++T){let k=X.to,A=k!==void 0&&!X.parser&&k.type!=="union"?n(Z[T],(p)=>{let V=X.refiner;if(V!==void 0)p.refiner=fX(p.refiner,V);p.to=k}):Z[T],I=A.type,x=y[I];if(!(x&16&&("fromDefault"in X)))if(x&17153||!(y[Q.type]&1)&&Q.type!==I)z=T,D={},B=[];else{let p=x&8192?A.class.name:I,V=D[p];if(V!==void 0){if(x&64&&FG in A.properties)V.unshift(A);else if(!(x&2096))V.push(A)}else{if(HX(x,D))B.unshift(p);else B.push(p);D[p]=[A]}}}let W=z,w=D,L=B,R="",P="",E="",N=!1;if(W!==-1){for(let T=0;T<=W;++T)if(!N){let k=Z[T],A=AQ(G,k,Q,Q,!0,Y);if(A){let I="e"+T;R=R+("try{"+A+"}catch("+I+"){"),P="}"+P,E=E+","+I}else N=!0}}if(!N){let T=!1,k="";for(let A=0,I=L.length;A<I;++A){let x=w[L[A]],p=x.length>1,V=x[0],WG=0,kG;if(p){let l=Q.v(G),O="",uG="",HG=!1,a={contents:""},mG="",jG={},MG=0,TQ=x.length-1|0;while(MG<=TQ){let r=x[MG],t=(b in r?SG(G,l,r,!1):"")+oG(G,l,r,!1).slice(2),xG=AQ(G,r,Q,Q,!1,Y);if(t)if(xG){let e=jG[t];if(e!==void 0)if(typeof e==="string")jG[t]=[e,xG];else e.push(xG);else jG[t]=xG}else a.contents=a.contents?a.contents+"||"+t:t;if(!t||MG===TQ){let e=Object.keys(jG);for(let iG=0,CY=e.length;iG<CY;++iG){let YX=e[iG];O=O+(HG?"else if":"if")+("("+YX+"){");let pG=jG[YX];if(typeof pG==="string")O=O+pG+"}";else{let kQ="";for(let aG=0,AY=pG.length;aG<AY;++aG){let FY=pG[aG],ZX="e"+aG;O=O+("try{"+FY+"}catch("+ZX+"){"),kQ=kQ+","+ZX}O=O+H(kQ)+"}".repeat(pG.length)+"}"}HG=!0}jG={}}if(!t)if(xG){if(a.contents)O=O+(HG?"else if":"if")+("(!("+a.contents+")){"),uG="}"+uG,a.contents="",HG=!1;let e="e"+MG;O=O+((HG?"else{":"")+"try{"+xG+"}catch("+e+"){"),uG=(HG?"}":"")+"}"+uG,mG=mG+","+e,HG=!1}else a.contents="",MG=TQ;MG=MG+1}if(WG=(r)=>SG(G,r,{type:V.type,parser:0},!1),a.contents)if(O){if(q)O=O+(HG?"else if":"if")+("(!("+a.contents+")){"+H(mG)+"}")}else{let r=WG;WG=(t)=>r(t)+("&&("+a.contents+")")}else if(q&&O){let r=H(mG);O=O+(HG?"else{"+r+"}":r)}kG=O+uG}else WG=(l)=>SG(G,l,V,!1)+oG(G,l,V,!1),kG=AQ(G,V,Q,Q,!1,Y);if(kG||HX(y[V.type],w))R=R+(T?"else if":"if")+("("+WG(Q.v(G))+"){"+kG+"}"),T=!0;else if(q){let l=WG(Q.v(G));k=k?k+"||"+l:l}}if(q||W===K){let A=H(E),I;if(k)I=(T?"else if":"if")+("(!("+k+")){"+A+"}");else I=T?"else{"+A+"}":A;R=R+I}}G.c=G.c+R+P;let M=Q.f&2?lG(G,"Promise.resolve("+Q.i+")"):Q.v===EG?G.c===""&&Q.b.c===""&&(Q.b.l===Q.i+"="+U||U==="i")?(Q.b.l="",Q.b.a=JG,Q.v=i,Q.i=U,Q):JQ(Q):Q;M.anyOf=X.anyOf;let C=X.to;return M.type=C!==void 0&&C.type!=="union"?(M.t=!0,KG(C).type):"union",M}function zG(G){let Q=G.length;if(Q===1)return G[0];if(Q!==0){let X={},Y=new Set;for(let J=0,H=G.length;J<H;++J){let q=G[J];if(q.type==="union"&&q.to===void 0)q.anyOf.forEach((U)=>{Y.add(U)}),Object.assign(X,q.has);else Y.add(q),CX(X,q.type)}let Z=new F("union");return Z.anyOf=Array.from(Y),Z.compiler=bX,Z.has=X,Z}throw Error("[Sury] S.union requires at least one item")}function hY(){let G=IG(0),Q={schema:G,location:FG},X={};return X[FG]=G,{type:"object",serializer:(Y,Z,J,H)=>RG(Y,J.to),additionalItems:"strip",items:[Q],properties:X}}function oY(G,Q,X,Y){return $(G,"{"+FG+":"+KG(X).items[0].schema.const+"}",X.to)}function qX(G){return n(G,(Q)=>{Q.to=hY(),Q.parser=oY})}function EQ(G,Q){let X=Q!==void 0?Q:s,Y=KG(G);switch(Y.type){case"undefined":return zG([X,qX(G)]);case"union":let{has:J,anyOf:H}=Y;return n(G,(q)=>{let U=JQ(J),z=[];for(let K=0,D=H.length;K<D;++K){let B=H[K],W=KG(B),w=W.type,L;if(w==="undefined")U[X.type]=!0,z.push(X),L=qX(B);else{let R=W.properties;if(R!==void 0){let P=R[FG];L=P!==void 0?n(B,(E)=>{let N={type:P.type,parser:P.parser,const:P.const+1},M={schema:N,location:FG},C={};C[FG]=N,E.items=[M],E.properties=C}):B}else L=B}z.push(L)}if(z.length===H.length)U[X.type]=!0,z.push(X);q.anyOf=z,q.has=U});default:return zG([G,X])}}function vG(G,Q){return n(G,(X)=>{let Y=X.anyOf;if(Y!==void 0){let Z,J;for(let K=0,D=Y.length;K<D;++K){let B=Y[K],W=KG(B);if(W.type!=="undefined"){if(Z!==void 0){let R="Can't set default for "+j(X);throw Error("[Sury] "+R)}Z=B,J=W}}let H=Z,q;if(H!==void 0)q=H;else{let K="Can't set default for "+j(X);throw Error("[Sury] "+K)}X.parser=(K,D,B,W)=>{let w=(N,M)=>{let C=M.v(N),T;return T=Q.TAG==="Value"?BQ(N,IG(Q._0)):_(N,Q._0)+"()",$(N,C+"===void 0?"+T+":"+C,B.to)};if(!(D.f&2))return w(K,D);let L={c:"",l:"",a:JG,f:"",g:K.g},R={b:K,v:EG,i:u(L.g),f:0,type:"unknown"},P=w(L,R),E=DG(L);return lG(D.b,D.i+".then("+R.v(K)+"=>{"+E+"return "+P.i+"})")};let U=h(J),z=U.compiler;if(z!==void 0)U.serializer=z,delete U.compiler;else U.serializer=(K,D,B,W)=>D;if(X.to=U,Q.TAG!=="Value")return;try{X.default=o(q,32)(Q._0);return}catch(K){return}}else{let Z="Can't set default for "+j(X);throw Error("[Sury] "+Z)}})}var NQ="m:Array.refinements";function cY(G){let Q=G[NQ];if(Q!==void 0)return Q;else return[]}function sY(G,Q,X,Y){let Z=X.additionalItems,J=Q.v(G),H=u(G.g),q={c:"",l:"",a:JG,f:"",g:G.g},U=$(q,J+"["+H+"]",ZG),z=sG(q,U,Y,H,void 0,(W,w,L)=>d(W,Z,w,L)),K=DG(q),D=U!==z,B=D?$(G,"new Array("+J+".length)",X):Q;if(B.type=X.type,B.additionalItems=X.additionalItems,D||K!=="")G.c=G.c+("for(let "+H+"=0;"+H+"<"+J+".length;++"+H+"){"+K+(D?dQ(G,B,H,z):"")+"}");if(z.f&2)return lG(B.b,"Promise.all("+B.i+")");else return B}function cG(G){let Q=new F("array");return Q.additionalItems=G,Q.items=gQ,Q.compiler=sY,Q}function nG(G,Q,X){let Y=G.additionalItems;if(Y===void 0)return G;let Z=G.items;if(Y===Q||typeof Y==="object")return G;let J=h(G);if(J.additionalItems=Q,X){let H=[],q={};for(let U=0,z=Z.length;U<z;++U){let K=Z[U],D=nG(K.schema,Q,X),B=D===K.schema?K:{schema:D,location:K.location};q[K.location]=D,H.push(B)}J.items=H,J.properties=q}return J}function dX(G){return nG(G,"strip",!1)}function lX(G){return nG(G,"strip",!0)}function QQ(G){return nG(G,"strict",!1)}function uX(G){return nG(G,"strict",!0)}function nY(G,Q,X,Y){let Z=X.additionalItems,J=Q.v(G),H=u(G.g),q={c:"",l:"",a:JG,f:"",g:G.g},U=$(q,J+"["+H+"]",ZG),z=sG(q,U,Y,H,void 0,(E,N,M)=>d(E,Z,N,M)),K=DG(q),D=U!==z,B=D?$(G,"{}",X):Q;if(B.type=X.type,B.additionalItems=X.additionalItems,D||K!=="")G.c=G.c+("for(let "+H+" in "+J+"){"+K+(D?dQ(G,B,H,z):"")+"}");if(!(z.f&2))return B;let W=u(G.g),w=u(G.g),L=u(G.g),R=u(G.g),P=B.v(G);return lG(G,"new Promise(("+W+","+w+")=>{let "+R+"=Object.keys("+P+").length;for(let "+H+" in "+P+"){"+P+"["+H+"].then("+L+"=>{"+P+"["+H+"]="+L+";if("+R+"--===1){"+W+"("+P+")}},"+w+")}})")}function XQ(G){let Q=new F("object");return Q.properties=DX,Q.items=gQ,Q.additionalItems=G,Q.compiler=nY,Q}var m="m:String.refinements";function mY(G){let Q=G[m];if(Q!==void 0)return Q;else return[]}var iY=/^c[^\s-]{8,}$/i,aY=/^[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}$/i,tY=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eY=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/,v=PX("json");function pX(){if(!v[hG])return;delete v.as;let G=new F("ref");G.$ref=pQ+LG,G.name=LG,v.type=G.type,v.$ref=G.$ref,v.name=LG;let Q={};Q[LG]={type:"union",compiler:bX,name:LG,has:{string:!0,boolean:!0,number:!0,null:!0,object:!0,array:!0},anyOf:[c,KQ,AG,wQ,XQ(G),cG(G)]},v.$defs=Q}function zX(G,Q,X,Y){let Z=y[Q.type],J=Q.const;if(Z&48)return'"null"';else if(Z&2)return JSON.stringify(YG(J));else if(Z&1024)return'"\\"'+J+'\\""';else if(Z&12)return'"'+J+'"';else return DQ(G,Q,X,Y)}function rX(){if(GG[hG]){delete GG.as,GG.type="string",GG.format="json",GG.name=LG+" string",GG.compiler=(G,Q,X,Y)=>{let Z=y[Q.type],J=Q;if(Z&1){let H=X.to;if(H&&b in H){let q=J.v(G);G.f=q+"==="+zX(G,H,X,Y)+"||"+QG(G,Y,(U)=>({TAG:"InvalidType",expected:H,received:U}),q)+";",J=RG(G,H)}else if(!(H&&H.format==="json")){let q=J.v(G),U=G.g.o&1;if(U)G.f=_Q(G,c,J,Y);if(H||U){let z;if(H){PG(H,H,Y,G.g.o);let K=GQ(G,ZG);J=K,z=K.i+"="}else z="";G.c=G.c+("try{"+z+"JSON.parse("+q+")}catch(t){"+QG(G,Y,(K)=>({TAG:"InvalidType",expected:X,received:K}),q)+"}")}}}else{if(b in J)J=$(G,zX(G,J,X,Y),c);else if(Z&2){if(J.format!=="json")J=$(G,"JSON.stringify("+J.i+")",c)}else if(Z&12)J=IQ(G,J);else if(Z&1024)J=$(G,'"\\""+'+J.i+'+"\\""',c);else if(Z&192){PG(J,J,Y,G.g.o);let H=X.space;J=$(G,"JSON.stringify("+J.i+(H!==void 0&&H!==0?",null,"+H:"")+")",c)}else DQ(G,J,X,Y);J.format="json"}return J};return}}function hX(G){let Q=h(GG);return Q.space=G,Q}var hQ="m:Int.refinements";function GZ(G){let Q=G[hQ];if(Q!==void 0)return Q;else return[]}var oQ="m:Float.refinements";function QZ(G){let Q=G[oQ];if(Q!==void 0)return Q;else return[]}function oX(G,Q){if(G===Q)return G;else return n(G,(X)=>{X.to=Q})}function cX(G){let Q=new F("instance");return Q.class=G,Q}function cQ(G,Q){let X=h(G),Y=Q.name;if(Y!==void 0)if(Y==="")X.name=void 0;else X.name=Y;let Z=Q.title;if(Z!==void 0)if(Z==="")X.title=void 0;else X.title=Z;let J=Q.description;if(J!==void 0)if(J==="")X.description=void 0;else X.description=J;let H=Q.deprecated;if(H!==void 0)X.deprecated=H;let q=Q.examples;if(q!==void 0)if(q.length!==0)X.examples=q.map(o(G,32));else X.examples=void 0;return X}function sX(G,Q){let X=h(G);return X.name=Q,X}function nX(G){switch(G.k){case 0:return"["+YG(G.location)+"]";case 1:return nX(G.of)+G.p;case 2:return G.p}}function sQ(G,Q,X,Y){if(b in Y)return RG(G,Y);let Z=Q[qQ];if(Z!==void 0)return X(Z);let J=y[Y.type]&128,H=$G(G,J);return Y.items.forEach((q)=>_G(H,q.location,sQ(G,Q[q.location],X,q.schema))),gG(H,J)}function nQ(G,Q,X,Y,Z){if(!(Y.type==="object"&&Y.additionalItems==="strict"&&G.g.o&1))return;let H=GQ(G,ZG).i;if(G.c=G.c+("for("+H+" in "+Q.v(G)+"){if("),X.length!==0)for(let q=0,U=X.length;q<U;++q){let z=X[q];if(q!==0)G.c=G.c+"&&";G.c=G.c+(H+"!=="+UG(G,z.location))}else G.c=G.c+"true";G.c=G.c+("){"+QG(G,Z,(q)=>({TAG:"ExcessField",_0:q}),H)+"}}")}function bG(G){return new Proxy(DX,{get:(Q,X)=>{if(X===qQ)return G;let Y=YG(X),Z=KG(G.schema),J=Z.items,H=Z.properties,q;if(H!==void 0)q=H[X];else if(J!==void 0){let U=J[X];q=U!==void 0?U.schema:void 0}else q=void 0;if(q===void 0){let U="Cannot read property "+Y+" of "+j(Z);throw Error("[Sury] "+U)}return bG({k:1,location:X,schema:q,of:G,p:"["+Y+"]"})}})}function YQ(G,Q,X,Y){let{additionalItems:Z,items:J}=X,H=y[X.type]&128;if(G.g.o&64){let U=$G(G,H);for(let z=0,K=J.length;z<K;++z){let B=J[z].location;_G(U,B,Q.properties[B])}return gG(U,H)}let q=$G(G,H);for(let U=0,z=J.length;U<z;++U){let K=J[U],D=K.location,B=fG(G,Q,D),W=UG(G,D),w=Y+("["+W+"]");_G(q,D,d(G,K.schema,B,w))}if(nQ(G,Q,J,X,Y),(Z!=="strip"||G.g.o&32)&&J.every((U)=>q.properties[U.location]===Q.properties[U.location]))return Q.additionalItems="strip",Q;else return gG(q,H)}function mX(G){let Q=this,X="~"+G,Y=Q[X];if(Y!==void 0)return qG(Y);let Z={},J=[],H=new F("object");H.items=J,H.properties=Z,H.additionalItems=f.a,H.compiler=YQ;let q=Q.f(G,H)[qQ],U=(W,w)=>{let L=YG(W);if(W in Z)throw Error("[Sury] "+("The field "+L+" defined twice"));let R="["+L+"]",P={k:1,location:W,schema:w,of:q,p:R};return Z[W]=w,J.push(P),bG(P)},B={field:U,f:U,fieldOr:(W,w,L)=>{let R=EQ(w,void 0);return U(W,vG(R,{TAG:"Value",_0:L}))},tag:(W,w)=>{U(W,NG(w))},nested:mX,flatten:(W)=>{if(W.type==="object"){let{to:R,items:P}=W;if(R){let N="Unsupported nested flatten for transformed object schema "+j(W);throw Error("[Sury] "+N)}let E={};for(let N=0,M=P.length;N<M;++N){let C=P[N];E[C.location]=U(C.location,C.schema)}return E}let L="Can't flatten "+j(W)+" schema";throw Error("[Sury] "+L)}};return Q[X]=B,B}function NG(G){if(typeof G!=="object"||G===null)return IG(G);if(G["~standard"])return G;if(Array.isArray(G)){for(let q=0,U=G.length;q<U;++q){let z=NG(G[q]),K=q.toString();G[q]={schema:z,location:K}}let H=new F("array");return H.items=G,H.additionalItems="strict",H.compiler=YQ,H}let Q=G.constructor;if(Q&&Q!==Object)return{type:"instance",const:G,class:Q};let X=Object.keys(G),Y=X.length,Z=[];for(let H=0;H<Y;++H){let q=X[H],U=NG(G[q]),z={schema:U,location:q};G[q]=U,Z[H]=z}let J=new F("object");return J.items=Z,J.properties=G,J.additionalItems=f.a,J.compiler=YQ,J}function jQ(G,Q,X){if(typeof G!=="object"||G===null)return{k:1,p:Q,s:h(IG(G))};let Y=G[qQ];if(Y!==void 0){let U=h(KG(Y.schema));delete U.serializer;let z={k:0,p:Q,s:U};return Y.r=z,X[nX(Y)]=z,z}if(Array.isArray(G)){let U=[];for(let K=0,D=G.length;K<D;++K){let B=K.toString(),W='"'+B+'"',R={schema:jQ(G[K],Q+("["+W+"]"),X).s,location:B};U[K]=R}let z=new F("array");return{k:2,p:Q,s:(z.items=U,z.additionalItems="strict",z.serializer=OQ,z)}}let Z=Object.keys(G),J={},H=[];for(let U=0,z=Z.length;U<z;++U){let K=Z[U],D=YG(K),W=jQ(G[K],Q+("["+D+"]"),X).s,w={schema:W,location:K};H[U]=w,J[K]=W}let q=new F("object");return{k:2,p:Q,s:(q.items=H,q.properties=J,q.additionalItems=f.a,q.serializer=OQ,q)}}function mQ(G,Q,X){let Y={},J=jQ(G,"",Y).s;return delete J.refiner,delete J.compiler,J.serializer=(H,q,U,z)=>{let K=(P)=>{let E=P.p;if(E==="")return q;let N=q,M=WX(E);while(!0){let C=M,T=N;if(C.length===0)return T;let k=C[0];M=C.slice(1),N=fG(H,T,k);continue}},D=(P,E)=>{let N=KG(P);if(b in N)return RG(H,N);if(b in P)return d(H,P,RG(H,P),z);let{type:M,additionalItems:C,items:T}=N;if(T!==void 0&&typeof C==="string"){let A=y[M]&128,I=$G(H,A);for(let x=0,p=T.length;x<p;++x){let V=T[x],WG=UG(H,V.location),kG=E+("["+WG+"]"),l=Y[kG],O=l!==void 0?d(H,V.schema,K(l),l.p):D(V.schema,kG);_G(I,V.location,O)}return gG(I,A)}let k=E===""?"Schema isn't registered":"Schema for "+E+" isn't registered";return tG(H,z,k)},B=(P,E,N)=>{let M=P.r;if(M===void 0)return D(P.schema,E);let C=N?XG(P.schema):E===""?KG(P.schema):P.schema,T=K(M),k=z+M.p;return d(H,C,T,k)};if(Q!==void 0)return B(Q,"",!1);let W=U.to;nQ(H,q,U.items,U,z);let w=W.type==="array",L=W.items,R=$G(H,w);if(X!==void 0)for(let P=0,E=X.length;P<E;++P)dY(R,B(X[P],"",!0));for(let P=0,E=L.length;P<E;++P){let N=L[P];if(!(N.location in R.properties)){let M=UG(H,N.location);_G(R,N.location,B(N,"["+M+"]",!1))}}return gG(R,w)},J}function iX(G,Q){return(X,Y,Z,J)=>{let H=X.g.o&64,q=H?Y.properties:{};if(!H){let z=Z.items;for(let K=0,D=z.length;K<D;++K){let B=z[K],W=B.location,w=fG(X,Y,W),L=UG(X,W),R=J+("["+L+"]");q[W]=d(X,B.schema,w,R)}nQ(X,Y,z,Z,J)}if(Q!==void 0){let z=X.g.o;X.g.o=z|64;for(let K=0,D=Q.length;K<D;++K){let B=Q[K];q[B.i]=d(X,B.schema,Y,J)}X.g.o=z}let U=(z)=>{switch(z.k){case 0:return q[z.location];case 1:return fG(X,U(z.of),z.location);case 2:return q[z.i]}};return sQ(X,G,U,Z.to)}}function aX(G,Q){return n(G,(X)=>{let Y={k:2,schema:G,p:"",i:0},Z=Q(bG(Y));X.parser=(J,H,q,U)=>{let z=(K)=>{switch(K.k){case 1:return fG(J,z(K.of),K.location);case 0:case 2:return H}};return sQ(J,Z,z,q.to)},X.to=mQ(Z,Y,void 0)})}function ZQ(G){let Q=void 0,X=[],Y={},Z=(D)=>{if(D.type==="object"){let w=D.items;for(let E=0,N=w.length;E<N;++E){let M=w[E],C=M.location,T=M.schema,k=Y[C];if(k!==void 0){if(k!==T)throw Error("[Sury] "+('The field "'+C+'" defined twice with incompatible schemas'))}else{let A={k:0,schema:T,location:C};X.push(A),Y[C]=T}}let L=Q||(Q=[]),R=L.length,P={k:2,schema:D,p:"",i:R};return L.push(P),bG(P)}let W="The '"+j(D)+"' schema can't be flattened";throw Error("[Sury] "+W)},J=(D,B)=>{if(D in Y)throw Error("[Sury] "+('The field "'+D+'" defined twice with incompatible schemas'));let W={k:0,schema:B,location:D};return Y[D]=B,X.push(W),bG(W)},z=G({field:J,f:J,fieldOr:(D,B,W)=>{let w=EQ(B,void 0);return J(D,vG(w,{TAG:"Value",_0:W}))},tag:(D,B)=>{J(D,NG(B))},nested:mX,flatten:Z}),K=new F("object");return K.items=X,K.properties=Y,K.additionalItems=f.a,K.parser=iX(z,Q),K.to=mQ(z,void 0,Q),K}function iQ(G){let Q=[],X=(q,U)=>{let z=q.toString();if(Q[q])throw Error("[Sury] "+("The item ["+z+"] is defined multiple times"));let K={k:0,schema:U,location:z};return Q[q]=K,bG(K)},J=G({item:X,tag:(q,U)=>{X(q,NG(U))}});for(let q=0,U=Q.length;q<U;++q)if(!Q[q]){let z=q.toString(),K={schema:s,location:z};Q[q]=K}let H=new F("array");return H.items=Q,H.additionalItems="strict",H.parser=iX(J,void 0),H.to=mQ(J,void 0,void 0),H}function XZ(G){return EQ(G,PQ)}var aQ=NG;function YZ(G,Q,X,Y){let Z=X.additionalItems,J=Z.items,H=Q.v(G),q=u(G.g),U=u(G.g),z={c:"",l:"",a:JG,f:"",g:G.g},K={b:z,v:EG,i:H+"["+q+"]",f:0,type:"unknown"},D=sG(z,K,Y,q,(W,w)=>{let L="",R="";for(let P=0,E=J.length;P<E;++P){let N=J[P];L=L+("new Array("+H+".length),"),R=R+(U+"["+P+"]["+q+"]="+fG(G,w,N.location).i+";")}G.a(U+"=["+L+"]"),W.c=W.c+R},(W,w,L)=>d(W,Z,w,L)),B=DG(z);if(G.c=G.c+("for(let "+q+"=0;"+q+"<"+H+".length;++"+q+"){"+B+"}"),D.f&2)return{b:G,v:i,i:"Promise.all("+U+")",f:2,type:"array"};else return{b:G,v:EG,i:U,f:0,type:"array"}}function tX(G){if(G.type==="object"){let Q=G.items;if(Q.length===0)throw Error("[Sury] Invalid empty object for S.unnest schema.");let X=new F("array");X.items=Q.map((Z,J)=>{let H=J.toString();return{schema:cG(Z.schema),location:H}}),X.additionalItems="strict",X.parser=(Z,J,H,q)=>{let U=J.v(Z),z=u(Z.g),K={c:"",l:"",a:JG,f:"",g:Z.g},D=$G(K,!1),B="";for(let P=0,E=Q.length;P<E;++P){let N=Q[P];_G(D,N.location,$(K,U+"["+P+"]["+z+"]",ZG)),B=B+(U+"["+P+"].length,")}let W=$(Z,"new Array(Math.max("+B+"))",H.to),w=W.v(Z),L=sG(K,gG(D,!1),q,z,(P,E)=>{P.c=P.c+dQ(P,W,z,E)+";"},(P,E,N)=>d(P,G,E,N)),R=DG(K);if(Z.c=Z.c+("for(let "+z+"=0;"+z+"<"+w+".length;++"+z+"){"+R+"}"),L.f&2)return lG(W.b,"Promise.all("+W.i+")");else return W};let Y=new F("array");return Y.items=gQ,Y.additionalItems=G,Y.serializer=YZ,X.unnest=!0,X.to=Y,X}throw Error("[Sury] S.unnest supports only object schemas.")}function UX(G){return EQ(G,s)}function xQ(G,Q,X){let Y=X!==void 0?X:"Number must be greater than or equal to "+Q;return g(G,hQ,{kind:{TAG:"Min",value:Q},message:Y},(Z,J,H,q)=>"if("+J+"<"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function VQ(G,Q,X){let Y=X!==void 0?X:"Number must be lower than or equal to "+Q;return g(G,hQ,{kind:{TAG:"Max",value:Q},message:Y},(Z,J,H,q)=>"if("+J+">"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function eX(G,Q){let X=rQ(G,(Y,Z,J,H)=>Z+">0&&"+Z+"<65536&&"+Z+"%1===0||"+(Q!==void 0?S(Y,Q,H):QG(Y,H,(q)=>({TAG:"InvalidType",expected:J,received:q}),Z))+";");return X.format="port",XG(X).format="port",X}function yQ(G,Q,X){let Y=X!==void 0?X:"Number must be greater than or equal to "+Q;return g(G,oQ,{kind:{TAG:"Min",value:Q},message:Y},(Z,J,H,q)=>"if("+J+"<"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function SQ(G,Q,X){let Y=X!==void 0?X:"Number must be lower than or equal to "+Q;return g(G,oQ,{kind:{TAG:"Max",value:Q},message:Y},(Z,J,H,q)=>"if("+J+">"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function GY(G,Q,X){let Y=X!==void 0?X:"Array must be "+Q+" or more items long";return g(G,NQ,{kind:{TAG:"Min",length:Q},message:Y},(Z,J,H,q)=>"if("+J+".length<"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function QY(G,Q,X){let Y=X!==void 0?X:"Array must be "+Q+" or fewer items long";return g(G,NQ,{kind:{TAG:"Max",length:Q},message:Y},(Z,J,H,q)=>"if("+J+".length>"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function XY(G,Q,X){let Y=X!==void 0?X:"String must be "+Q+" or more characters long";return g(G,m,{kind:{TAG:"Min",length:Q},message:Y},(Z,J,H,q)=>"if("+J+".length<"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function YY(G,Q,X){let Y=X!==void 0?X:"String must be "+Q+" or fewer characters long";return g(G,m,{kind:{TAG:"Max",length:Q},message:Y},(Z,J,H,q)=>"if("+J+".length>"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function tQ(G,Q){let X=Q!==void 0?Q:"Invalid email address";return g(G,m,{kind:"Email",message:X},(Y,Z,J,H)=>"if(!"+_(Y,tY)+".test("+Z+")){"+S(Y,X,H)+"}")}function eQ(G,Q){let X=Q!==void 0?Q:"Invalid UUID";return g(G,m,{kind:"Uuid",message:X},(Y,Z,J,H)=>"if(!"+_(Y,aY)+".test("+Z+")){"+S(Y,X,H)+"}")}function ZY(G,Q){let X=Q!==void 0?Q:"Invalid CUID";return g(G,m,{kind:"Cuid",message:X},(Y,Z,J,H)=>"if(!"+_(Y,iY)+".test("+Z+")){"+S(Y,X,H)+"}")}function GX(G,Q){let X=Q!==void 0?Q:"Invalid url";return g(G,m,{kind:"Url",message:X},(Y,Z,J,H)=>"try{new URL("+Z+")}catch(_){"+S(Y,X,H)+"}")}function QX(G,Q,X){let Y=X!==void 0?X:"Invalid";return g(G,m,{kind:{TAG:"Pattern",re:Q},message:Y},(Z,J,H,q)=>(Q.global?_(Z,Q)+".lastIndex=0;":"")+("if(!"+_(Z,Q)+".test("+J+")){"+S(Z,Y,q)+"}"))}function XX(G,Q){let X=Q!==void 0?Q:"Invalid datetime string! Expected UTC",Y={kind:"Datetime",message:X},Z=G[m];return LQ(uQ(G,m,Z!==void 0?Z.concat(Y):[Y]),(J)=>({p:(H)=>{if(!eY.test(H))J.fail(X,void 0);return new Date(H)},s:(H)=>H.toISOString()}))}function JY(G){let Q=(X)=>X.trim();return LQ(G,(X)=>({p:Q,s:Q}))}function HY(G){return zG([G,s,wQ])}function qY(G){return zG(G.map(NG))}function zY(G,Q,X){return LQ(G,(Y)=>({p:Q!==void 0?(Z)=>Q(Z,Y):void 0,s:X!==void 0?(Z)=>X(Z,Y):void 0}))}function UY(G,Q){return rG(G,(X)=>(Y)=>Q(Y,X))}function ZZ(G){return G}function KY(G,Q){return LQ(G,(X)=>({a:(Y)=>Q(Y,X).then(()=>Y),s:ZZ}))}function BY(G,Q){let X=zG([G,s]);if(Q===void 0)return X;let Y=qG(Q);if(typeof Y==="function")return vG(X,{TAG:"Callback",_0:Y});else return vG(X,{TAG:"Value",_0:Y})}function DY(G,Q){let X=zG([G,PQ]);if(Q===void 0)return X;let Y=qG(Q);if(typeof Y==="function")return vG(X,{TAG:"Callback",_0:Y});else return vG(X,{TAG:"Value",_0:Y})}function WY(G,Q){let X;if(G.type==="object"&&Q.type==="object"){let Y=G.additionalItems;if(typeof Y==="string"&&typeof Q.additionalItems==="string"&&!G.to&&!Q.to){let Z=Q.items,J=G.items,H={},q=[],U=[];for(let K=0,D=J.length;K<D;++K){let B=J[K];q.push(B.location),H[B.location]=B.schema}for(let K=0,D=Z.length;K<D;++K){let B=Z[K];if(!(B.location in H))q.push(B.location);H[B.location]=B.schema}for(let K=0,D=q.length;K<D;++K){let B=q[K];U.push({schema:H[B],location:B})}let z=new F("object");z.items=U,z.properties=H,z.additionalItems=Y,z.compiler=YQ,X=z}else X=void 0}else X=void 0;if(X!==void 0)return X;throw Error("[Sury] The merge supports only structured object schemas without transformations")}function wY(G){let Q=G.defaultAdditionalItems;f.a=Q!==void 0?Q:"strip";let X=f.n,Y=G.disableNanNumberValidation;if(f.n=Y!==void 0?Y:!1,X!==f.n)return yY(AG)}var $Q="m:JSONSchema";function CG(G,Q){let X={};switch(G.type){case"never":X.not={};break;case"unknown":break;case"string":let z=G.const;if(X.type="string",mY(G).forEach((T)=>{let k=T.kind;if(typeof k!=="object")switch(k){case"Email":X.format="email";return;case"Uuid":X.format="uuid";return;case"Cuid":return;case"Url":X.format="uri";return;case"Datetime":X.format="date-time";return}else switch(k.TAG){case"Min":X.minLength=k.length;return;case"Max":X.maxLength=k.length;return;case"Length":let A=k.length;X.minLength=A,X.maxLength=A;return;case"Pattern":X.pattern=String(k.re);return}}),z!==void 0)X.const=z;break;case"number":let{format:K,const:D}=G;if(K!==void 0)if(K==="int32")X.type="integer",GZ(G).forEach((T)=>{let k=T.kind;if(k.TAG==="Min")X.minimum=k.value;else X.maximum=k.value});else X.type="integer",X.maximum=65535,X.minimum=0;else X.type="number",QZ(G).forEach((T)=>{let k=T.kind;if(k.TAG==="Min")X.minimum=k.value;else X.maximum=k.value});if(D!==void 0)X.const=D;break;case"boolean":let B=G.const;if(X.type="boolean",B!==void 0)X.const=B;break;case"null":X.type="null";break;case"array":let W=G.additionalItems,w=0;if(W==="strip"||W==="strict")w=1;else X.items=CG(W,Q),X.type="array",cY(G).forEach((T)=>{let k=T.kind;switch(k.TAG){case"Min":X.minItems=k.length;return;case"Max":X.maxItems=k.length;return;case"Length":let A=k.length;X.maxItems=A,X.minItems=A;return}});if(w===1){let T=G.items.map((A)=>CG(A.schema,Q)),k=T.length;X.items=BX(T),X.type="array",X.minItems=k,X.maxItems=k}break;case"object":let L=G.additionalItems,R=0;if(L==="strip"||L==="strict")R=1;else X.type="object",X.additionalProperties=CG(L,Q);if(R===1){let T={},k=[];G.items.forEach((I)=>{let x=CG(I.schema,Q);if(!xY(I.schema))k.push(I.location);T[I.location]=x}),X.type="object",X.properties=T;let A;if(A=L==="strip"||L==="strict"?L==="strip":!0,X.additionalProperties=A,k.length!==0)X.required=k}break;case"union":let P=[],E=[];G.anyOf.forEach((T)=>{if(T.type==="undefined")return;if(E.push(CG(T,Q)),b in T){P.push(T.const);return}});let N=E.length,M=G.default;if(M!==void 0)X.default=qG(M);if(N===1)Object.assign(X,E[0]);else if(P.length===N)X.enum=P;else X.anyOf=E;break;case"ref":let C=G.$ref;if(C===pQ+LG);else X.$ref=C;break;default:throw Error("[Sury] Unexpected schema type")}let Y=G.description;if(Y!==void 0)X.description=Y;let Z=G.title;if(Z!==void 0)X.title=Z;let J=G.deprecated;if(J!==void 0)X.deprecated=J;let H=G.examples;if(H!==void 0)X.examples=H;let q=G.$defs;if(q!==void 0)Object.assign(Q,q);let U=G[$Q];if(U!==void 0)Object.assign(X,U);return X}function LY(G){PG(G,G,"",8);let Q={},X=CG(G,Q);delete Q.JSON;let Y=Object.keys(Q);if(Y.length)Y.forEach((Z)=>{Q[Z]=CG(Q[Z],0)}),X.$defs=Q;return X}function PY(G,Q){let X=G[$Q];return uQ(G,$Q,X!==void 0?Object.assign({},X,Q):Q)}var JZ=IG;function KX(G){let Q=G.minimum,X;if(Q!==void 0)X=xQ(yG,Q|0,void 0);else{let J=G.exclusiveMinimum;X=J!==void 0?xQ(yG,J+1|0,void 0):yG}let Y=G.maximum;if(Y!==void 0)return VQ(X,Y|0,void 0);let Z=G.exclusiveMinimum;if(Z!==void 0)return VQ(X,Z-1|0,void 0);else return X}function HZ(G){if(typeof G!=="object")return;else return G.default}function VG(G){let Q=(H)=>{if(typeof H!=="object")if(H===!1)return RQ;else return v;else return VG(H)},X=G.type,Y,Z=0,J=0;if(G.nullable)Y=XZ(VG(Object.assign({},G,{nullable:!1})));else if(X!==void 0){let H=qG(X);if(H==="object"){let q=G.properties;if(q!==void 0){let U=ZQ((K)=>{let D={};return Object.keys(q).forEach((B)=>{let W=q[B],w=Q(W),L=G.required,R,P=0;if(L!==void 0&&L.includes(B))R=w;else P=1;if(P===1){let E=HZ(W);if(E!==void 0){let N=UX(w);R=vG(N,{TAG:"Value",_0:E})}else R=UX(w)}D[B]=K.f(B,R)}),D});Y=G.additionalProperties===!1?QQ(U):U}else{let U=G.additionalProperties;Y=U!==void 0?typeof U!=="object"?U===!1?QQ(ZQ((z)=>{})):XQ(v):XQ(VG(U)):NG()}}else if(H==="array"){let q=G.items,U;if(q!==void 0){let B=IY.classify(qG(q));if(B.TAG==="Single")U=cG(Q(B._0));else{let W=B._0;U=iQ((w)=>W.map((L,R)=>w.item(R,Q(L))))}}else U=cG(v);let z=G.minItems,K=z!==void 0?GY(U,z,void 0):U,D=G.maxItems;Y=D!==void 0?QY(K,D,void 0):K}else J=2}else J=2;if(J===2){let{enum:H,allOf:q,anyOf:U}=G;if(U!==void 0){let z=U.length;Y=z!==1?z!==0?zG(U.map(Q)):v:Q(U[0])}else if(q!==void 0){let z=q.length;Y=z!==1?z!==0?rG(v,(K)=>(D)=>{q.forEach((B)=>{try{return wG(D,Q(B))}catch(W){return K.fail("Should pass for all schemas of the allOf property.",void 0)}})}):v:Q(q[0])}else{let z=G.oneOf;if(z!==void 0){let K=z.length;Y=K!==1?K!==0?rG(v,(D)=>(B)=>{let W={contents:!1};if(z.forEach((w)=>{let L;try{wG(B,Q(w)),L=!0}catch(R){L=!1}if(L){if(W.contents)D.fail("Should pass single schema according to the oneOf property.",void 0);W.contents=!0;return}}),!W.contents)return D.fail("Should pass at least one schema according to the oneOf property.",void 0)}):v:Q(z[0])}else{let K=G.not;if(K!==void 0)Y=rG(v,(D)=>(B)=>{let W;try{wG(B,Q(K)),W=!0}catch(w){W=!1}if(W)return D.fail("Should NOT be valid against schema in the not property.",void 0)});else if(H!==void 0){let D=H.length;Y=D!==1?D!==0?zG(H.map(JZ)):v:IG(H[0])}else{let D=G.const;if(D!==void 0)Y=IG(D);else if(X!==void 0){let B=qG(X),W=0,w=0;if(Array.isArray(B))Y=zG(B.map((L)=>VG(Object.assign({},G,{type:BX(L)}))));else if(B==="string"){let L=G.pattern,R=L!==void 0?QX(c,new RegExp(L),void 0):c,P=G.minLength,E=P!==void 0?XY(R,P,void 0):R,N=G.maxLength,M=N!==void 0?YY(E,N,void 0):E;switch(G.format){case"date-time":Y=XX(M,void 0);break;case"email":Y=tQ(M,void 0);break;case"uri":Y=GX(M,void 0);break;case"uuid":Y=eQ(M,void 0);break;default:Y=M}}else if(B==="integer"||G.format==="int64"&&B==="number")Y=KX(G);else w=4;if(w===4)if(G.multipleOf!==1||B!=="number")W=3;else Y=KX(G);if(W===3)if(B==="number"){let L=G.minimum,R;if(L!==void 0)R=yQ(AG,L,void 0);else{let E=G.exclusiveMinimum;R=E!==void 0?yQ(AG,E+1,void 0):AG}let P=G.maximum;if(P!==void 0)Y=SQ(R,P,void 0);else{let E=G.exclusiveMinimum;Y=E!==void 0?SQ(R,E-1,void 0):R}}else if(B==="boolean")Y=KQ;else if(B==="null")Y=aQ(null);else Z=1}else Z=1}}}}if(Z===1){let H=G.if;if(H!==void 0){let q=G.then;if(q!==void 0){let U=G.else;if(U!==void 0){let z=Q(H),K=Q(q),D=Q(U);Y=rG(v,(B)=>(W)=>{let w;try{wG(W,z),w=!0}catch(L){w=!1}if(w)return wG(W,K);else return wG(W,D)})}else Y=v}else Y=v}else Y=v}if(G.description===void 0&&G.deprecated===void 0&&G.examples===void 0&&G.title===void 0)return Y;return cQ(Y,{title:G.title,description:G.description,deprecated:G.deprecated,examples:G.examples})}function RY(G,Q,X){switch(G.type){case"string":return XY(G,Q,X);case"number":if(G.format!==void 0)return xQ(G,Q,X);else return yQ(G,Q,X);case"array":return GY(G,Q,X);default:let Y="S.min is not supported for "+j(G)+" schema. Coerce the schema to string, number or array using S.to first.";throw Error("[Sury] "+Y)}}function EY(G,Q,X){switch(G.type){case"string":return YY(G,Q,X);case"number":if(G.format!==void 0)return VQ(G,Q,X);else return SQ(G,Q,X);case"array":return QY(G,Q,X);default:let Y="S.max is not supported for "+j(G)+" schema. Coerce the schema to string, number or array using S.to first.";throw Error("[Sury] "+Y)}}function NY(G,Q,X){switch(G.type){case"string":let Y=X!==void 0?X:"String must be exactly "+Q+" characters long";return g(G,m,{kind:{TAG:"Length",length:Q},message:Y},(H,q,U,z)=>"if("+q+".length!=="+_(H,Q)+"){"+S(H,Y,z)+"}");case"array":let Z=X!==void 0?X:"Array must be exactly "+Q+" items long";return g(G,NQ,{kind:{TAG:"Length",length:Q},message:Z},(H,q,U,z)=>"if("+q+".length!=="+_(H,Q)+"){"+S(H,Z,z)+"}");default:let J="S.length is not supported for "+j(G)+" schema. Coerce the schema to string or array using S.to first.";throw Error("[Sury] "+J)}}var TY=cG,kY=XQ;var MY=WQ;var UZ=NX.value,KZ=c,BZ=KQ,DZ=yG,WZ=AG,wZ=EX,LZ=RX,PZ=v,RZ=RQ,EZ=ZG,NZ=ZG,TZ=BY,kZ=DY,MZ=HY,CZ=TY,AZ=cX,FZ=tX,_Z=kY,IZ=GG,vZ=hX,OZ=qY,jZ=ZQ,xZ=aQ,VZ=yX,yZ=SX,SZ=XG,$Z=vX,gZ=OX,fZ=jX,bZ=xX,dZ=lQ,lZ=VX,uZ=WQ,pZ=MY,rZ=_X,hZ=IX,oZ=wG,cZ=$X,sZ=WY,nZ=QQ,mZ=uX,iZ=dX,aZ=lX,tZ=oX,eZ=LY,G0=VG,Q0=PY,X0=aX,Y0=iQ,Z0=KY,J0=UY,H0=zY,q0=cQ,z0=j,U0=gX,K0=FX,B0=eX,D0=RY,W0=EY,w0=NY,L0=tQ,P0=eQ,R0=ZY,E0=GX,N0=QX,T0=XX,k0=JY,M0=pX,C0=rX,A0=wY,F0=sX;export{s as void,P0 as uuid,E0 as url,FZ as unnest,EZ as unknown,OZ as union,Y0 as tuple,k0 as trim,H0 as transform,eZ as toJSONSchema,z0 as toExpression,tZ as to,LZ as symbol,iZ as strip,KZ as string,nZ as strict,X0 as shape,xZ as schema,yZ as safeAsync,VZ as safe,lZ as reverseConvertToJsonStringOrThrow,dZ as reverseConvertToJsonOrThrow,bZ as reverseConvertOrThrow,SZ as reverse,J0 as refine,cZ as recursive,_Z as record,B0 as port,N0 as pattern,uZ as parseOrThrow,rZ as parseJsonStringOrThrow,pZ as parseJsonOrThrow,hZ as parseAsyncOrThrow,TZ as optional,jZ as object,WZ as number,MZ as nullish,kZ as nullable,U0 as noValidation,RZ as never,D0 as min,q0 as meta,sZ as merge,W0 as max,w0 as length,vZ as jsonStringWithSpace,IZ as jsonString,PZ as json,DZ as int32,AZ as instance,A0 as global,G0 as fromJSONSchema,Q0 as extendJSONSchema,C0 as enableJsonString,M0 as enableJson,L0 as email,aZ as deepStrip,mZ as deepStrict,T0 as datetime,R0 as cuid,fZ as convertToJsonStringOrThrow,gZ as convertToJsonOrThrow,$Z as convertOrThrow,K0 as compile,F0 as brand,BZ as boolean,wZ as bigint,Z0 as asyncParserRefine,oZ as assertOrThrow,CZ as array,NZ as any,UZ as Error};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-e0vrxetq.js";var F="./tree-sitter-markdown-411r6y9b.wasm";export{F as default};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ud as q,Vd as K,Wd as D,Zd as L,_d as N}from"./chunk-2kh0tg92.js";import"./chunk-52xvhxek.js";import{eg as B}from"./chunk-bwadggys.js";import{Ch as G}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{gl as C}from"./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"./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"./chunk-6yhn9syz.js";import{es as J}from"./chunk-wb05bp10.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";var X={command:"upgrade [target]",describe:"upgrade qitqode to the latest or a specific version",builder:(z)=>{return z.positional("target",{describe:"version to upgrade to, for ex '0.1.48' or 'v0.1.48'",type:"string"}).option("method",{alias:"m",describe:"installation method to use",type:"string",choices:["curl","npm","pnpm","bun","brew","choco","scoop"]})},handler:async(z)=>{B.empty(),B.println(B.logo(" ")),B.empty(),K("Upgrade");let O=await G.runPromise(C.Service.use((j)=>j.method())),E=z.method??O;if(E==="unknown"){if(q.error(`qitqode is installed to ${process.execPath} and may be managed by a package manager`),!await N({message:"Install anyways?",options:[{label:"Yes",value:!0},{label:"No",value:!1}],initialValue:!1})){D("Done");return}}q.info("Using method: "+E);let F=z.target?z.target.replace(/^v/,""):await G.runPromise(C.Service.use((j)=>j.latest()));if(J===F){q.warn(`qitqode upgrade skipped: ${F} is already installed`),D("Done");return}q.info(`From ${J} \u2192 ${F}`);let H=L();H.start("Upgrading...");let x=await G.runPromise(C.Service.use((j)=>j.upgrade(E,F))).catch((j)=>j);if(x){if(H.stop("Upgrade failed",1),x instanceof C.UpgradeFailedError)if(E==="choco"&&x.stderr.includes("not running from an elevated command shell"))q.error("Please run the terminal as Administrator and try again");else q.error(x.stderr);else if(x instanceof Error)q.error(x.message);D("Done");return}H.stop("Upgrade complete"),D("Done")}};export{X as UpgradeCommand};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Cl as s,Dl as t,El as u,Gl as v,Hl as w}from"./chunk-tsmj98yf.js";import"./chunk-58f4y4b7.js";import{Bm as b,Cm as c,Dm as d,Em as e,Fm as f,Gm as g,Hm as h,Im as i,Jm as j,Km as k,Mm as l,Nm as m,Om as n,Qm as o,Sm as p,Zm as q,_m as r,om as a}from"./chunk-rmsqb6r4.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.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-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-wb05bp10.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-e0vrxetq.js";export{a as sql,e as or,f as not,c as ne,j as lte,i as lt,p as like,l as isNull,m as isNotNull,k as inArray,h as gte,g as gt,n as exists,b as eq,r as desc,t as count,o as between,q as asc,d as and,w as Storage,v as NotFoundError,s as JsonMigration,u as Database};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Lg as r}from"./chunk-qgkb6n8k.js";import{xO as o}from"./chunk-e0vrxetq.js";var c=new r("zod v4");async function m(){return async(n,e)=>{let t;if("_zod"in n)try{t=(await import("./chunk-afr8m0q1.js")).toJSONSchema}catch{throw c}else try{t=(await import("./chunk-wn63q3xp.js")).zodToJsonSchema}catch{throw new r("zod-to-json-schema")}return t(n,e)}}export{m as default};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Hs as B}from"./chunk-r5zy4za0.js";import{Qs as A,Ts as K}from"./chunk-tr6rdr6h.js";var C=new Set,O=!1;function Y(q){return C.add(q),()=>{C.delete(q)}}function Z(){return O}function _(q){let D=!1,F=(z,J)=>{if(D)return;D=!0,O=!0,process.exitCode=1,A.error(z,{error:B(J),process_role:q});let Q=setTimeout(()=>process.exit(1),5000),S=[...C].map((U)=>Promise.resolve().then(()=>U(J)).catch((V)=>{A.error("fatal teardown failed",{error:B(V),process_role:q})}));Promise.all([K(),...S]).finally(()=>{clearTimeout(Q),process.exit(1)})},G=(z)=>F("unhandled rejection",z),H=(z)=>F("uncaught exception",z);return process.on("unhandledRejection",G),process.on("uncaughtException",H),()=>{process.off("unhandledRejection",G),process.off("uncaughtException",H)}}
3
- export{Y as Zr,Z as _r,_ as $r};
2
+ import{Is as B}from"./chunk-wgkcyqn1.js";import{Rs as A,Us as K}from"./chunk-59csnjc3.js";var C=new Set,O=!1;function Y(q){return C.add(q),()=>{C.delete(q)}}function Z(){return O}function _(q){let D=!1,F=(z,J)=>{if(D)return;D=!0,O=!0,process.exitCode=1,A.error(z,{error:B(J),process_role:q});let Q=setTimeout(()=>process.exit(1),5000),S=[...C].map((U)=>Promise.resolve().then(()=>U(J)).catch((V)=>{A.error("fatal teardown failed",{error:B(V),process_role:q})}));Promise.all([K(),...S]).finally(()=>{clearTimeout(Q),process.exit(1)})},G=(z)=>F("unhandled rejection",z),H=(z)=>F("uncaught exception",z);return process.on("unhandledRejection",G),process.on("uncaughtException",H),()=>{process.off("unhandledRejection",G),process.off("uncaughtException",H)}}
3
+ export{Y as _r,Z as $r,_ as as};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var e={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.git":"Git changes","ui.sessionReview.title.branch":"Branch changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.submit":"Comment","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.diffs.changed":"Changed","ui.sessionTurn.diffs.showAll":"Show all","ui.sessionTurn.diffs.showLess":"Show less","ui.sessionTurn.diffs.more":"+{{count}} more files","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addQredits":"Add qredits","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.codesearch":"Code Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert message","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.answer.none":"(no answer)","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."};
3
- export{e as Md};
3
+ export{e as Nd};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ap as UV,Bp as BQ,Cp as $Q,Dp as AV,Gp as xV,Ho as l,Io as zV,Mo as UQ,Oo as JQ,Qo as GV,Vo as wQ,Xo as QQ,ap as JV,cp as FQ,ep as KV,fp as SV,hp as PV,ip as D,lp as F,mp as t,op as BV,qp as qQ,sp as VQ,tp as WQ,up as xQ,xp as EV,yp as a}from"./chunk-ph8hn1wt.js";import{Jp as ZV,Np as $V,Op as AQ,Tp as jV,Vp as YQ}from"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import{Jt as Q}from"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-r9w0thdk.js";var HQ=Q.object({error:Q.object({message:Q.string(),type:Q.string().nullish(),param:Q.any().nullish(),code:Q.union([Q.string(),Q.number()]).nullish()})}),zQ=UV({errorSchema:HQ,errorToMessage:(V)=>V.error.message});function LV(V){let Y=V.startsWith("o3")||V.startsWith("o4-mini")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-chat"),J=V.startsWith("gpt-4")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-nano")&&!V.startsWith("gpt-5-chat")&&!V.startsWith("gpt-5.4-nano")||V.startsWith("o3")||V.startsWith("o4-mini"),G=V.startsWith("o1")||V.startsWith("o3")||V.startsWith("o4-mini")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-chat"),j=V.startsWith("gpt-5.1")||V.startsWith("gpt-5.2")||V.startsWith("gpt-5.3")||V.startsWith("gpt-5.4");return{supportsFlexProcessing:Y,supportsPriorityProcessing:J,isReasoningModel:G,systemMessageMode:G?"developer":"system",supportsNonReasoningParameters:j}}function cQ(V){var Y,J,G,j,E,P;if(V==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 $=(Y=V.prompt_tokens)!=null?Y:0,A=(J=V.completion_tokens)!=null?J:0,O=(j=(G=V.prompt_tokens_details)==null?void 0:G.cached_tokens)!=null?j:0,K=(P=(E=V.completion_tokens_details)==null?void 0:E.reasoning_tokens)!=null?P:0;return{inputTokens:{total:$,noCache:$-O,cacheRead:O,cacheWrite:void 0},outputTokens:{total:A,text:A-K,reasoning:K},raw:V}}function HV(V){return JSON.stringify(V===void 0?{}:V)}function MV({prompt:V,systemMessageMode:Y="system"}){var J;let G=[],j=[];for(let{role:E,content:P}of V)switch(E){case"system":{switch(Y){case"system":{G.push({role:"system",content:P});break}case"developer":{G.push({role:"developer",content:P});break}case"remove":{j.push({type:"other",message:"system messages are removed for this model"});break}default:throw Error(`Unsupported system message mode: ${Y}`)}break}case"user":{if(P.length===1&&P[0].type==="text"){G.push({role:"user",content:P[0].text});break}G.push({role:"user",content:P.map(($,A)=>{var O,K,Z;switch($.type){case"text":return{type:"text",text:$.text};case"file":if($.mediaType.startsWith("image/")){let q=$.mediaType==="image/*"?"image/jpeg":$.mediaType;return{type:"image_url",image_url:{url:$.data instanceof URL?$.data.toString():`data:${q};base64,${JQ($.data)}`,detail:(K=(O=$.providerOptions)==null?void 0:O.openai)==null?void 0:K.imageDetail}}}else if($.mediaType.startsWith("audio/")){if($.data instanceof URL)throw new YQ({functionality:"audio file parts with URLs"});switch($.mediaType){case"audio/wav":return{type:"input_audio",input_audio:{data:JQ($.data),format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:JQ($.data),format:"mp3"}};default:throw new YQ({functionality:`audio content parts with media type ${$.mediaType}`})}}else if($.mediaType==="application/pdf"){if($.data instanceof URL)throw new YQ({functionality:"PDF file parts with URLs"});return{type:"file",file:typeof $.data==="string"&&$.data.startsWith("file-")?{file_id:$.data}:{filename:(Z=$.filename)!=null?Z:`part-${A}.pdf`,file_data:`data:application/pdf;base64,${JQ($.data)}`}}}else throw new YQ({functionality:`file part media type ${$.mediaType}`})}})});break}case"assistant":{let $="",A=[];for(let O of P)switch(O.type){case"text":{$+=O.text;break}case"tool-call":{A.push({id:O.toolCallId,type:"function",function:{name:O.toolName,arguments:HV(O.input)}});break}}G.push({role:"assistant",content:$,tool_calls:A.length>0?A:void 0});break}case"tool":{for(let $ of P){if($.type==="tool-approval-response")continue;let A=$.output,O;switch(A.type){case"text":case"error-text":O=A.value;break;case"execution-denied":O=(J=A.reason)!=null?J:"Tool execution denied.";break;case"content":case"json":case"error-json":O=JSON.stringify(A.value);break}G.push({role:"tool",tool_call_id:$.toolCallId,content:O})}break}default:throw Error(`Unsupported role: ${E}`)}return{messages:G,warnings:j}}function LQ({id:V,model:Y,created:J}){return{id:V!=null?V:void 0,modelId:Y!=null?Y:void 0,timestamp:J?new Date(J*1000):void 0}}function vQ(V){switch(V){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var bV=D(()=>F(Q.object({id:Q.string().nullish(),created:Q.number().nullish(),model:Q.string().nullish(),choices:Q.array(Q.object({message:Q.object({role:Q.literal("assistant").nullish(),content:Q.string().nullish(),tool_calls:Q.array(Q.object({id:Q.string().nullish(),type:Q.literal("function"),function:Q.object({name:Q.string(),arguments:Q.string()})})).nullish(),annotations:Q.array(Q.object({type:Q.literal("url_citation"),url_citation:Q.object({start_index:Q.number(),end_index:Q.number(),url:Q.string(),title:Q.string()})})).nullish()}),index:Q.number(),logprobs:Q.object({content:Q.array(Q.object({token:Q.string(),logprob:Q.number(),top_logprobs:Q.array(Q.object({token:Q.string(),logprob:Q.number()}))})).nullish()}).nullish(),finish_reason:Q.string().nullish()})),usage:Q.object({prompt_tokens:Q.number().nullish(),completion_tokens:Q.number().nullish(),total_tokens:Q.number().nullish(),prompt_tokens_details:Q.object({cached_tokens:Q.number().nullish()}).nullish(),completion_tokens_details:Q.object({reasoning_tokens:Q.number().nullish(),accepted_prediction_tokens:Q.number().nullish(),rejected_prediction_tokens:Q.number().nullish()}).nullish()}).nullish()}))),yV=D(()=>F(Q.union([Q.object({id:Q.string().nullish(),created:Q.number().nullish(),model:Q.string().nullish(),choices:Q.array(Q.object({delta:Q.object({role:Q.enum(["assistant"]).nullish(),content:Q.string().nullish(),tool_calls:Q.array(Q.object({index:Q.number(),id:Q.string().nullish(),type:Q.literal("function").nullish(),function:Q.object({name:Q.string().nullish(),arguments:Q.string().nullish()})})).nullish(),annotations:Q.array(Q.object({type:Q.literal("url_citation"),url_citation:Q.object({start_index:Q.number(),end_index:Q.number(),url:Q.string(),title:Q.string()})})).nullish()}).nullish(),logprobs:Q.object({content:Q.array(Q.object({token:Q.string(),logprob:Q.number(),top_logprobs:Q.array(Q.object({token:Q.string(),logprob:Q.number()}))})).nullish()}).nullish(),finish_reason:Q.string().nullish(),index:Q.number()})),usage:Q.object({prompt_tokens:Q.number().nullish(),completion_tokens:Q.number().nullish(),total_tokens:Q.number().nullish(),prompt_tokens_details:Q.object({cached_tokens:Q.number().nullish()}).nullish(),completion_tokens_details:Q.object({reasoning_tokens:Q.number().nullish(),accepted_prediction_tokens:Q.number().nullish(),rejected_prediction_tokens:Q.number().nullish()}).nullish()}).nullish()}),HQ]))),RV=D(()=>F(Q.object({logitBias:Q.record(Q.coerce.number(),Q.number()).optional(),logprobs:Q.union([Q.boolean(),Q.number()]).optional(),parallelToolCalls:Q.boolean().optional(),user:Q.string().optional(),reasoningEffort:Q.enum(["none","minimal","low","medium","high","xhigh"]).optional(),maxCompletionTokens:Q.number().optional(),store:Q.boolean().optional(),metadata:Q.record(Q.string().max(64),Q.string().max(512)).optional(),prediction:Q.record(Q.string(),Q.any()).optional(),serviceTier:Q.enum(["auto","flex","priority","default"]).optional(),strictJsonSchema:Q.boolean().optional(),textVerbosity:Q.enum(["low","medium","high"]).optional(),promptCacheKey:Q.string().optional(),promptCacheRetention:Q.enum(["in_memory","24h"]).optional(),safetyIdentifier:Q.string().optional(),systemMessageMode:Q.enum(["system","developer","remove"]).optional(),forceReasoning:Q.boolean().optional()})));function kV({tools:V,toolChoice:Y}){V=(V==null?void 0:V.length)?V:void 0;let J=[];if(V==null)return{tools:void 0,toolChoice:void 0,toolWarnings:J};let G=[];for(let E of V)switch(E.type){case"function":G.push({type:"function",function:{name:E.name,description:E.description,parameters:E.inputSchema,...E.strict!=null?{strict:E.strict}:{}}});break;default:J.push({type:"unsupported",feature:`tool type: ${E.type}`});break}if(Y==null)return{tools:G,toolChoice:void 0,toolWarnings:J};let j=Y.type;switch(j){case"auto":case"none":case"required":return{tools:G,toolChoice:j,toolWarnings:J};case"tool":return{tools:G,toolChoice:{type:"function",function:{name:Y.toolName}},toolWarnings:J};default:throw new YQ({functionality:`tool choice type: ${j}`})}}var gV=class{constructor(V,Y){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=V,this.config=Y}get provider(){return this.config.provider}async getArgs({prompt:V,maxOutputTokens:Y,temperature:J,topP:G,topK:j,frequencyPenalty:E,presencePenalty:P,stopSequences:$,responseFormat:A,seed:O,tools:K,toolChoice:Z,providerOptions:q}){var x,f,y,w,M;let g=[],b=(x=await VQ({provider:"openai",providerOptions:q,schema:RV}))!=null?x:{},n=LV(this.modelId),i=(f=b.forceReasoning)!=null?f:n.isReasoningModel;if(j!=null)g.push({type:"unsupported",feature:"topK"});let{messages:p,warnings:m}=MV({prompt:V,systemMessageMode:(y=b.systemMessageMode)!=null?y:i?"developer":n.systemMessageMode});g.push(...m);let s=(w=b.strictJsonSchema)!=null?w:!0,X={model:this.modelId,logit_bias:b.logitBias,logprobs:b.logprobs===!0||typeof b.logprobs==="number"?!0:void 0,top_logprobs:typeof b.logprobs==="number"?b.logprobs:typeof b.logprobs==="boolean"?b.logprobs?0:void 0:void 0,user:b.user,parallel_tool_calls:b.parallelToolCalls,max_tokens:Y,temperature:J,top_p:G,frequency_penalty:E,presence_penalty:P,response_format:(A==null?void 0:A.type)==="json"?A.schema!=null?{type:"json_schema",json_schema:{schema:A.schema,strict:s,name:(M=A.name)!=null?M:"response",description:A.description}}:{type:"json_object"}:void 0,stop:$,seed:O,verbosity:b.textVerbosity,max_completion_tokens:b.maxCompletionTokens,store:b.store,metadata:b.metadata,prediction:b.prediction,reasoning_effort:b.reasoningEffort,service_tier:b.serviceTier,prompt_cache_key:b.promptCacheKey,prompt_cache_retention:b.promptCacheRetention,safety_identifier:b.safetyIdentifier,messages:p};if(i){if(b.reasoningEffort!=="none"||!n.supportsNonReasoningParameters){if(X.temperature!=null)X.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"});if(X.top_p!=null)X.top_p=void 0,g.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"});if(X.logprobs!=null)X.logprobs=void 0,g.push({type:"other",message:"logprobs is not supported for reasoning models"})}if(X.frequency_penalty!=null)X.frequency_penalty=void 0,g.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"});if(X.presence_penalty!=null)X.presence_penalty=void 0,g.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"});if(X.logit_bias!=null)X.logit_bias=void 0,g.push({type:"other",message:"logitBias is not supported for reasoning models"});if(X.top_logprobs!=null)X.top_logprobs=void 0,g.push({type:"other",message:"topLogprobs is not supported for reasoning models"});if(X.max_tokens!=null){if(X.max_completion_tokens==null)X.max_completion_tokens=X.max_tokens;X.max_tokens=void 0}}else if(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview")){if(X.temperature!=null)X.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})}if(b.serviceTier==="flex"&&!n.supportsFlexProcessing)g.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),X.service_tier=void 0;if(b.serviceTier==="priority"&&!n.supportsPriorityProcessing)g.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),X.service_tier=void 0;let{tools:u,toolChoice:I,toolWarnings:H}=kV({tools:K,toolChoice:Z});return{args:{...X,tools:u,tool_choice:I},warnings:[...g,...H]}}async doGenerate(V){var Y,J,G,j,E,P,$;let{args:A,warnings:O}=await this.getArgs(V),{responseHeaders:K,value:Z,rawValue:q}=await WQ({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:l(this.config.headers(),V.headers),body:A,failedResponseHandler:zQ,successfulResponseHandler:$Q(bV),abortSignal:V.abortSignal,fetch:this.config.fetch}),x=Z.choices[0],f=[],y=x.message.content;if(y!=null&&y.length>0)f.push({type:"text",text:y});for(let b of(Y=x.message.tool_calls)!=null?Y:[])f.push({type:"tool-call",toolCallId:(J=b.id)!=null?J:QQ(),toolName:b.function.name,input:b.function.arguments});for(let b of(G=x.message.annotations)!=null?G:[])f.push({type:"source",sourceType:"url",id:QQ(),url:b.url_citation.url,title:b.url_citation.title});let w=(j=Z.usage)==null?void 0:j.completion_tokens_details,M=(E=Z.usage)==null?void 0:E.prompt_tokens_details,g={openai:{}};if((w==null?void 0:w.accepted_prediction_tokens)!=null)g.openai.acceptedPredictionTokens=w==null?void 0:w.accepted_prediction_tokens;if((w==null?void 0:w.rejected_prediction_tokens)!=null)g.openai.rejectedPredictionTokens=w==null?void 0:w.rejected_prediction_tokens;if(((P=x.logprobs)==null?void 0:P.content)!=null)g.openai.logprobs=x.logprobs.content;return{content:f,finishReason:{unified:vQ(x.finish_reason),raw:($=x.finish_reason)!=null?$:void 0},usage:cQ(Z.usage),request:{body:A},response:{...LQ(Z),headers:K,body:q},warnings:O,providerMetadata:g}}async doStream(V){let{args:Y,warnings:J}=await this.getArgs(V),G={...Y,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:j,value:E}=await WQ({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:l(this.config.headers(),V.headers),body:G,failedResponseHandler:zQ,successfulResponseHandler:BQ(yV),abortSignal:V.abortSignal,fetch:this.config.fetch}),P=[],$={unified:"other",raw:void 0},A=void 0,O=!1,K=!1,Z={openai:{}};return{stream:E.pipeThrough(new TransformStream({start(q){q.enqueue({type:"stream-start",warnings:J})},transform(q,x){var f,y,w,M,g,b,n,i,p,m,s,X,u,I,H,d,e;if(V.includeRawChunks)x.enqueue({type:"raw",rawValue:q.rawValue});if(!q.success){$={unified:"error",raw:void 0},x.enqueue({type:"error",error:q.error});return}let C=q.value;if("error"in C){$={unified:"error",raw:void 0},x.enqueue({type:"error",error:C.error});return}if(!O){let z=LQ(C);if(Object.values(z).some(Boolean))O=!0,x.enqueue({type:"response-metadata",...LQ(C)})}if(C.usage!=null){if(A=C.usage,((f=C.usage.completion_tokens_details)==null?void 0:f.accepted_prediction_tokens)!=null)Z.openai.acceptedPredictionTokens=(y=C.usage.completion_tokens_details)==null?void 0:y.accepted_prediction_tokens;if(((w=C.usage.completion_tokens_details)==null?void 0:w.rejected_prediction_tokens)!=null)Z.openai.rejectedPredictionTokens=(M=C.usage.completion_tokens_details)==null?void 0:M.rejected_prediction_tokens}let k=C.choices[0];if((k==null?void 0:k.finish_reason)!=null)$={unified:vQ(k.finish_reason),raw:k.finish_reason};if(((g=k==null?void 0:k.logprobs)==null?void 0:g.content)!=null)Z.openai.logprobs=k.logprobs.content;if((k==null?void 0:k.delta)==null)return;let L=k.delta;if(L.content!=null){if(!K)x.enqueue({type:"text-start",id:"0"}),K=!0;x.enqueue({type:"text-delta",id:"0",delta:L.content})}if(L.tool_calls!=null)for(let z of L.tool_calls){let T=z.index;if(P[T]==null){if(z.type!=null&&z.type!=="function")throw new AQ({data:z,message:"Expected 'function' type."});if(z.id==null)throw new AQ({data:z,message:"Expected 'id' to be a string."});if(((b=z.function)==null?void 0:b.name)==null)throw new AQ({data:z,message:"Expected 'function.name' to be a string."});x.enqueue({type:"tool-input-start",id:z.id,toolName:z.function.name}),P[T]={id:z.id,type:"function",function:{name:z.function.name,arguments:(n=z.function.arguments)!=null?n:""},hasFinished:!1};let B=P[T];if(((i=B.function)==null?void 0:i.name)!=null&&((p=B.function)==null?void 0:p.arguments)!=null){if(B.function.arguments.length>0)x.enqueue({type:"tool-input-delta",id:B.id,delta:B.function.arguments});if(qQ(B.function.arguments))x.enqueue({type:"tool-input-end",id:B.id}),x.enqueue({type:"tool-call",toolCallId:(m=B.id)!=null?m:QQ(),toolName:B.function.name,input:B.function.arguments}),B.hasFinished=!0}continue}let N=P[T];if(N.hasFinished)continue;if(((s=z.function)==null?void 0:s.arguments)!=null)N.function.arguments+=(u=(X=z.function)==null?void 0:X.arguments)!=null?u:"";if(x.enqueue({type:"tool-input-delta",id:N.id,delta:(I=z.function.arguments)!=null?I:""}),((H=N.function)==null?void 0:H.name)!=null&&((d=N.function)==null?void 0:d.arguments)!=null&&qQ(N.function.arguments))x.enqueue({type:"tool-input-end",id:N.id}),x.enqueue({type:"tool-call",toolCallId:(e=N.id)!=null?e:QQ(),toolName:N.function.name,input:N.function.arguments}),N.hasFinished=!0}if(L.annotations!=null)for(let z of L.annotations)x.enqueue({type:"source",sourceType:"url",id:QQ(),url:z.url_citation.url,title:z.url_citation.title})},flush(q){if(K)q.enqueue({type:"text-end",id:"0"});q.enqueue({type:"finish",finishReason:$,usage:cQ(A),...Z!=null?{providerMetadata:Z}:{}})}})),request:{body:G},response:{headers:j}}}};function nQ(V){var Y,J,G,j;if(V==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 E=(Y=V.prompt_tokens)!=null?Y:0,P=(J=V.completion_tokens)!=null?J:0;return{inputTokens:{total:(G=V.prompt_tokens)!=null?G:void 0,noCache:E,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:(j=V.completion_tokens)!=null?j:void 0,text:P,reasoning:void 0},raw:V}}function CV({prompt:V,user:Y="user",assistant:J="assistant"}){let G="";if(V[0].role==="system")G+=`${V[0].content}
2
+ import{Bp as UV,Cp as BQ,Dp as $Q,Ep as AV,Hp as xV,Io as l,Jo as zV,No as UQ,Po as JQ,Ro as GV,Wo as wQ,Yo as QQ,bp as JV,dp as FQ,fp as KV,gp as SV,ip as PV,jp as D,mp as F,np as t,pp as BV,rp as qQ,tp as VQ,up as WQ,vp as xQ,yp as EV,zp as a}from"./chunk-wm9nh9nb.js";import{Kp as ZV,Op as $V,Pp as AQ,Up as jV,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"./chunk-e0vrxetq.js";var HQ=Q.object({error:Q.object({message:Q.string(),type:Q.string().nullish(),param:Q.any().nullish(),code:Q.union([Q.string(),Q.number()]).nullish()})}),zQ=UV({errorSchema:HQ,errorToMessage:(V)=>V.error.message});function LV(V){let Y=V.startsWith("o3")||V.startsWith("o4-mini")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-chat"),J=V.startsWith("gpt-4")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-nano")&&!V.startsWith("gpt-5-chat")&&!V.startsWith("gpt-5.4-nano")||V.startsWith("o3")||V.startsWith("o4-mini"),G=V.startsWith("o1")||V.startsWith("o3")||V.startsWith("o4-mini")||V.startsWith("gpt-5")&&!V.startsWith("gpt-5-chat"),j=V.startsWith("gpt-5.1")||V.startsWith("gpt-5.2")||V.startsWith("gpt-5.3")||V.startsWith("gpt-5.4");return{supportsFlexProcessing:Y,supportsPriorityProcessing:J,isReasoningModel:G,systemMessageMode:G?"developer":"system",supportsNonReasoningParameters:j}}function cQ(V){var Y,J,G,j,E,P;if(V==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 $=(Y=V.prompt_tokens)!=null?Y:0,A=(J=V.completion_tokens)!=null?J:0,O=(j=(G=V.prompt_tokens_details)==null?void 0:G.cached_tokens)!=null?j:0,K=(P=(E=V.completion_tokens_details)==null?void 0:E.reasoning_tokens)!=null?P:0;return{inputTokens:{total:$,noCache:$-O,cacheRead:O,cacheWrite:void 0},outputTokens:{total:A,text:A-K,reasoning:K},raw:V}}function HV(V){return JSON.stringify(V===void 0?{}:V)}function MV({prompt:V,systemMessageMode:Y="system"}){var J;let G=[],j=[];for(let{role:E,content:P}of V)switch(E){case"system":{switch(Y){case"system":{G.push({role:"system",content:P});break}case"developer":{G.push({role:"developer",content:P});break}case"remove":{j.push({type:"other",message:"system messages are removed for this model"});break}default:throw Error(`Unsupported system message mode: ${Y}`)}break}case"user":{if(P.length===1&&P[0].type==="text"){G.push({role:"user",content:P[0].text});break}G.push({role:"user",content:P.map(($,A)=>{var O,K,Z;switch($.type){case"text":return{type:"text",text:$.text};case"file":if($.mediaType.startsWith("image/")){let q=$.mediaType==="image/*"?"image/jpeg":$.mediaType;return{type:"image_url",image_url:{url:$.data instanceof URL?$.data.toString():`data:${q};base64,${JQ($.data)}`,detail:(K=(O=$.providerOptions)==null?void 0:O.openai)==null?void 0:K.imageDetail}}}else if($.mediaType.startsWith("audio/")){if($.data instanceof URL)throw new YQ({functionality:"audio file parts with URLs"});switch($.mediaType){case"audio/wav":return{type:"input_audio",input_audio:{data:JQ($.data),format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:JQ($.data),format:"mp3"}};default:throw new YQ({functionality:`audio content parts with media type ${$.mediaType}`})}}else if($.mediaType==="application/pdf"){if($.data instanceof URL)throw new YQ({functionality:"PDF file parts with URLs"});return{type:"file",file:typeof $.data==="string"&&$.data.startsWith("file-")?{file_id:$.data}:{filename:(Z=$.filename)!=null?Z:`part-${A}.pdf`,file_data:`data:application/pdf;base64,${JQ($.data)}`}}}else throw new YQ({functionality:`file part media type ${$.mediaType}`})}})});break}case"assistant":{let $="",A=[];for(let O of P)switch(O.type){case"text":{$+=O.text;break}case"tool-call":{A.push({id:O.toolCallId,type:"function",function:{name:O.toolName,arguments:HV(O.input)}});break}}G.push({role:"assistant",content:$,tool_calls:A.length>0?A:void 0});break}case"tool":{for(let $ of P){if($.type==="tool-approval-response")continue;let A=$.output,O;switch(A.type){case"text":case"error-text":O=A.value;break;case"execution-denied":O=(J=A.reason)!=null?J:"Tool execution denied.";break;case"content":case"json":case"error-json":O=JSON.stringify(A.value);break}G.push({role:"tool",tool_call_id:$.toolCallId,content:O})}break}default:throw Error(`Unsupported role: ${E}`)}return{messages:G,warnings:j}}function LQ({id:V,model:Y,created:J}){return{id:V!=null?V:void 0,modelId:Y!=null?Y:void 0,timestamp:J?new Date(J*1000):void 0}}function vQ(V){switch(V){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var bV=D(()=>F(Q.object({id:Q.string().nullish(),created:Q.number().nullish(),model:Q.string().nullish(),choices:Q.array(Q.object({message:Q.object({role:Q.literal("assistant").nullish(),content:Q.string().nullish(),tool_calls:Q.array(Q.object({id:Q.string().nullish(),type:Q.literal("function"),function:Q.object({name:Q.string(),arguments:Q.string()})})).nullish(),annotations:Q.array(Q.object({type:Q.literal("url_citation"),url_citation:Q.object({start_index:Q.number(),end_index:Q.number(),url:Q.string(),title:Q.string()})})).nullish()}),index:Q.number(),logprobs:Q.object({content:Q.array(Q.object({token:Q.string(),logprob:Q.number(),top_logprobs:Q.array(Q.object({token:Q.string(),logprob:Q.number()}))})).nullish()}).nullish(),finish_reason:Q.string().nullish()})),usage:Q.object({prompt_tokens:Q.number().nullish(),completion_tokens:Q.number().nullish(),total_tokens:Q.number().nullish(),prompt_tokens_details:Q.object({cached_tokens:Q.number().nullish()}).nullish(),completion_tokens_details:Q.object({reasoning_tokens:Q.number().nullish(),accepted_prediction_tokens:Q.number().nullish(),rejected_prediction_tokens:Q.number().nullish()}).nullish()}).nullish()}))),yV=D(()=>F(Q.union([Q.object({id:Q.string().nullish(),created:Q.number().nullish(),model:Q.string().nullish(),choices:Q.array(Q.object({delta:Q.object({role:Q.enum(["assistant"]).nullish(),content:Q.string().nullish(),tool_calls:Q.array(Q.object({index:Q.number(),id:Q.string().nullish(),type:Q.literal("function").nullish(),function:Q.object({name:Q.string().nullish(),arguments:Q.string().nullish()})})).nullish(),annotations:Q.array(Q.object({type:Q.literal("url_citation"),url_citation:Q.object({start_index:Q.number(),end_index:Q.number(),url:Q.string(),title:Q.string()})})).nullish()}).nullish(),logprobs:Q.object({content:Q.array(Q.object({token:Q.string(),logprob:Q.number(),top_logprobs:Q.array(Q.object({token:Q.string(),logprob:Q.number()}))})).nullish()}).nullish(),finish_reason:Q.string().nullish(),index:Q.number()})),usage:Q.object({prompt_tokens:Q.number().nullish(),completion_tokens:Q.number().nullish(),total_tokens:Q.number().nullish(),prompt_tokens_details:Q.object({cached_tokens:Q.number().nullish()}).nullish(),completion_tokens_details:Q.object({reasoning_tokens:Q.number().nullish(),accepted_prediction_tokens:Q.number().nullish(),rejected_prediction_tokens:Q.number().nullish()}).nullish()}).nullish()}),HQ]))),RV=D(()=>F(Q.object({logitBias:Q.record(Q.coerce.number(),Q.number()).optional(),logprobs:Q.union([Q.boolean(),Q.number()]).optional(),parallelToolCalls:Q.boolean().optional(),user:Q.string().optional(),reasoningEffort:Q.enum(["none","minimal","low","medium","high","xhigh"]).optional(),maxCompletionTokens:Q.number().optional(),store:Q.boolean().optional(),metadata:Q.record(Q.string().max(64),Q.string().max(512)).optional(),prediction:Q.record(Q.string(),Q.any()).optional(),serviceTier:Q.enum(["auto","flex","priority","default"]).optional(),strictJsonSchema:Q.boolean().optional(),textVerbosity:Q.enum(["low","medium","high"]).optional(),promptCacheKey:Q.string().optional(),promptCacheRetention:Q.enum(["in_memory","24h"]).optional(),safetyIdentifier:Q.string().optional(),systemMessageMode:Q.enum(["system","developer","remove"]).optional(),forceReasoning:Q.boolean().optional()})));function kV({tools:V,toolChoice:Y}){V=(V==null?void 0:V.length)?V:void 0;let J=[];if(V==null)return{tools:void 0,toolChoice:void 0,toolWarnings:J};let G=[];for(let E of V)switch(E.type){case"function":G.push({type:"function",function:{name:E.name,description:E.description,parameters:E.inputSchema,...E.strict!=null?{strict:E.strict}:{}}});break;default:J.push({type:"unsupported",feature:`tool type: ${E.type}`});break}if(Y==null)return{tools:G,toolChoice:void 0,toolWarnings:J};let j=Y.type;switch(j){case"auto":case"none":case"required":return{tools:G,toolChoice:j,toolWarnings:J};case"tool":return{tools:G,toolChoice:{type:"function",function:{name:Y.toolName}},toolWarnings:J};default:throw new YQ({functionality:`tool choice type: ${j}`})}}var gV=class{constructor(V,Y){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=V,this.config=Y}get provider(){return this.config.provider}async getArgs({prompt:V,maxOutputTokens:Y,temperature:J,topP:G,topK:j,frequencyPenalty:E,presencePenalty:P,stopSequences:$,responseFormat:A,seed:O,tools:K,toolChoice:Z,providerOptions:q}){var x,f,y,w,M;let g=[],b=(x=await VQ({provider:"openai",providerOptions:q,schema:RV}))!=null?x:{},n=LV(this.modelId),i=(f=b.forceReasoning)!=null?f:n.isReasoningModel;if(j!=null)g.push({type:"unsupported",feature:"topK"});let{messages:p,warnings:m}=MV({prompt:V,systemMessageMode:(y=b.systemMessageMode)!=null?y:i?"developer":n.systemMessageMode});g.push(...m);let s=(w=b.strictJsonSchema)!=null?w:!0,X={model:this.modelId,logit_bias:b.logitBias,logprobs:b.logprobs===!0||typeof b.logprobs==="number"?!0:void 0,top_logprobs:typeof b.logprobs==="number"?b.logprobs:typeof b.logprobs==="boolean"?b.logprobs?0:void 0:void 0,user:b.user,parallel_tool_calls:b.parallelToolCalls,max_tokens:Y,temperature:J,top_p:G,frequency_penalty:E,presence_penalty:P,response_format:(A==null?void 0:A.type)==="json"?A.schema!=null?{type:"json_schema",json_schema:{schema:A.schema,strict:s,name:(M=A.name)!=null?M:"response",description:A.description}}:{type:"json_object"}:void 0,stop:$,seed:O,verbosity:b.textVerbosity,max_completion_tokens:b.maxCompletionTokens,store:b.store,metadata:b.metadata,prediction:b.prediction,reasoning_effort:b.reasoningEffort,service_tier:b.serviceTier,prompt_cache_key:b.promptCacheKey,prompt_cache_retention:b.promptCacheRetention,safety_identifier:b.safetyIdentifier,messages:p};if(i){if(b.reasoningEffort!=="none"||!n.supportsNonReasoningParameters){if(X.temperature!=null)X.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"});if(X.top_p!=null)X.top_p=void 0,g.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"});if(X.logprobs!=null)X.logprobs=void 0,g.push({type:"other",message:"logprobs is not supported for reasoning models"})}if(X.frequency_penalty!=null)X.frequency_penalty=void 0,g.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"});if(X.presence_penalty!=null)X.presence_penalty=void 0,g.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"});if(X.logit_bias!=null)X.logit_bias=void 0,g.push({type:"other",message:"logitBias is not supported for reasoning models"});if(X.top_logprobs!=null)X.top_logprobs=void 0,g.push({type:"other",message:"topLogprobs is not supported for reasoning models"});if(X.max_tokens!=null){if(X.max_completion_tokens==null)X.max_completion_tokens=X.max_tokens;X.max_tokens=void 0}}else if(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview")){if(X.temperature!=null)X.temperature=void 0,g.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})}if(b.serviceTier==="flex"&&!n.supportsFlexProcessing)g.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),X.service_tier=void 0;if(b.serviceTier==="priority"&&!n.supportsPriorityProcessing)g.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),X.service_tier=void 0;let{tools:u,toolChoice:I,toolWarnings:H}=kV({tools:K,toolChoice:Z});return{args:{...X,tools:u,tool_choice:I},warnings:[...g,...H]}}async doGenerate(V){var Y,J,G,j,E,P,$;let{args:A,warnings:O}=await this.getArgs(V),{responseHeaders:K,value:Z,rawValue:q}=await WQ({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:l(this.config.headers(),V.headers),body:A,failedResponseHandler:zQ,successfulResponseHandler:$Q(bV),abortSignal:V.abortSignal,fetch:this.config.fetch}),x=Z.choices[0],f=[],y=x.message.content;if(y!=null&&y.length>0)f.push({type:"text",text:y});for(let b of(Y=x.message.tool_calls)!=null?Y:[])f.push({type:"tool-call",toolCallId:(J=b.id)!=null?J:QQ(),toolName:b.function.name,input:b.function.arguments});for(let b of(G=x.message.annotations)!=null?G:[])f.push({type:"source",sourceType:"url",id:QQ(),url:b.url_citation.url,title:b.url_citation.title});let w=(j=Z.usage)==null?void 0:j.completion_tokens_details,M=(E=Z.usage)==null?void 0:E.prompt_tokens_details,g={openai:{}};if((w==null?void 0:w.accepted_prediction_tokens)!=null)g.openai.acceptedPredictionTokens=w==null?void 0:w.accepted_prediction_tokens;if((w==null?void 0:w.rejected_prediction_tokens)!=null)g.openai.rejectedPredictionTokens=w==null?void 0:w.rejected_prediction_tokens;if(((P=x.logprobs)==null?void 0:P.content)!=null)g.openai.logprobs=x.logprobs.content;return{content:f,finishReason:{unified:vQ(x.finish_reason),raw:($=x.finish_reason)!=null?$:void 0},usage:cQ(Z.usage),request:{body:A},response:{...LQ(Z),headers:K,body:q},warnings:O,providerMetadata:g}}async doStream(V){let{args:Y,warnings:J}=await this.getArgs(V),G={...Y,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:j,value:E}=await WQ({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:l(this.config.headers(),V.headers),body:G,failedResponseHandler:zQ,successfulResponseHandler:BQ(yV),abortSignal:V.abortSignal,fetch:this.config.fetch}),P=[],$={unified:"other",raw:void 0},A=void 0,O=!1,K=!1,Z={openai:{}};return{stream:E.pipeThrough(new TransformStream({start(q){q.enqueue({type:"stream-start",warnings:J})},transform(q,x){var f,y,w,M,g,b,n,i,p,m,s,X,u,I,H,d,e;if(V.includeRawChunks)x.enqueue({type:"raw",rawValue:q.rawValue});if(!q.success){$={unified:"error",raw:void 0},x.enqueue({type:"error",error:q.error});return}let C=q.value;if("error"in C){$={unified:"error",raw:void 0},x.enqueue({type:"error",error:C.error});return}if(!O){let z=LQ(C);if(Object.values(z).some(Boolean))O=!0,x.enqueue({type:"response-metadata",...LQ(C)})}if(C.usage!=null){if(A=C.usage,((f=C.usage.completion_tokens_details)==null?void 0:f.accepted_prediction_tokens)!=null)Z.openai.acceptedPredictionTokens=(y=C.usage.completion_tokens_details)==null?void 0:y.accepted_prediction_tokens;if(((w=C.usage.completion_tokens_details)==null?void 0:w.rejected_prediction_tokens)!=null)Z.openai.rejectedPredictionTokens=(M=C.usage.completion_tokens_details)==null?void 0:M.rejected_prediction_tokens}let k=C.choices[0];if((k==null?void 0:k.finish_reason)!=null)$={unified:vQ(k.finish_reason),raw:k.finish_reason};if(((g=k==null?void 0:k.logprobs)==null?void 0:g.content)!=null)Z.openai.logprobs=k.logprobs.content;if((k==null?void 0:k.delta)==null)return;let L=k.delta;if(L.content!=null){if(!K)x.enqueue({type:"text-start",id:"0"}),K=!0;x.enqueue({type:"text-delta",id:"0",delta:L.content})}if(L.tool_calls!=null)for(let z of L.tool_calls){let T=z.index;if(P[T]==null){if(z.type!=null&&z.type!=="function")throw new AQ({data:z,message:"Expected 'function' type."});if(z.id==null)throw new AQ({data:z,message:"Expected 'id' to be a string."});if(((b=z.function)==null?void 0:b.name)==null)throw new AQ({data:z,message:"Expected 'function.name' to be a string."});x.enqueue({type:"tool-input-start",id:z.id,toolName:z.function.name}),P[T]={id:z.id,type:"function",function:{name:z.function.name,arguments:(n=z.function.arguments)!=null?n:""},hasFinished:!1};let B=P[T];if(((i=B.function)==null?void 0:i.name)!=null&&((p=B.function)==null?void 0:p.arguments)!=null){if(B.function.arguments.length>0)x.enqueue({type:"tool-input-delta",id:B.id,delta:B.function.arguments});if(qQ(B.function.arguments))x.enqueue({type:"tool-input-end",id:B.id}),x.enqueue({type:"tool-call",toolCallId:(m=B.id)!=null?m:QQ(),toolName:B.function.name,input:B.function.arguments}),B.hasFinished=!0}continue}let N=P[T];if(N.hasFinished)continue;if(((s=z.function)==null?void 0:s.arguments)!=null)N.function.arguments+=(u=(X=z.function)==null?void 0:X.arguments)!=null?u:"";if(x.enqueue({type:"tool-input-delta",id:N.id,delta:(I=z.function.arguments)!=null?I:""}),((H=N.function)==null?void 0:H.name)!=null&&((d=N.function)==null?void 0:d.arguments)!=null&&qQ(N.function.arguments))x.enqueue({type:"tool-input-end",id:N.id}),x.enqueue({type:"tool-call",toolCallId:(e=N.id)!=null?e:QQ(),toolName:N.function.name,input:N.function.arguments}),N.hasFinished=!0}if(L.annotations!=null)for(let z of L.annotations)x.enqueue({type:"source",sourceType:"url",id:QQ(),url:z.url_citation.url,title:z.url_citation.title})},flush(q){if(K)q.enqueue({type:"text-end",id:"0"});q.enqueue({type:"finish",finishReason:$,usage:cQ(A),...Z!=null?{providerMetadata:Z}:{}})}})),request:{body:G},response:{headers:j}}}};function nQ(V){var Y,J,G,j;if(V==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 E=(Y=V.prompt_tokens)!=null?Y:0,P=(J=V.completion_tokens)!=null?J:0;return{inputTokens:{total:(G=V.prompt_tokens)!=null?G:void 0,noCache:E,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:(j=V.completion_tokens)!=null?j:void 0,text:P,reasoning:void 0},raw:V}}function CV({prompt:V,user:Y="user",assistant:J="assistant"}){let G="";if(V[0].role==="system")G+=`${V[0].content}
3
3
 
4
4
  `,V=V.slice(1);for(let{role:j,content:E}of V)switch(j){case"system":throw new $V({message:"Unexpected system message in prompt: ${content}",prompt:V});case"user":{let P=E.map(($)=>{switch($.type){case"text":return $.text}}).filter(Boolean).join("");G+=`${Y}:
5
5
  ${P}
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$e as u,Re as P,Ve as C,Ze as h,_e as g,bf as m,jf as d,kf as S,of as c,pf as i,qf as M,sf as p}from"./chunk-7mppvhv9.js";import{Sp as T,Tp as v,Vp as w}from"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import{Jt as j}from"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-r9w0thdk.js";function y(B){if(B==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{prompt_tokens:Q,completion_tokens:X}=B;return{inputTokens:{total:Q,noCache:Q,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:X,reasoning:void 0},raw:B}}function R({data:B,mediaType:Q}){return B instanceof URL?B.toString():`data:${Q};base64,${C(B)}`}function n(B){var Q;let X=[];for(let D=0;D<B.length;D++){let{role:K,content:$}=B[D],N=D===B.length-1;switch(K){case"system":{X.push({role:"system",content:$});break}case"user":{X.push({role:"user",content:$.map((G)=>{switch(G.type){case"text":return{type:"text",text:G.text};case"file":if(G.mediaType.startsWith("image/")){let Z=G.mediaType==="image/*"?"image/jpeg":G.mediaType;return{type:"image_url",image_url:R({data:G.data,mediaType:Z})}}else if(G.mediaType==="application/pdf")return{type:"document_url",document_url:R({data:G.data,mediaType:"application/pdf"})};else throw new w({functionality:"Only images and PDF file parts are supported"})}})});break}case"assistant":{let G="",Z=[];for(let Y of $)switch(Y.type){case"text":{G+=Y.text;break}case"tool-call":{Z.push({id:Y.toolCallId,type:"function",function:{name:Y.toolName,arguments:JSON.stringify(Y.input)}});break}case"reasoning":{G+=Y.text;break}default:throw Error(`Unsupported content type in assistant message: ${Y.type}`)}X.push({role:"assistant",content:G,prefix:N?!0:void 0,tool_calls:Z.length>0?Z:void 0});break}case"tool":{for(let G of $){if(G.type==="tool-approval-response")continue;let Z=G.output,Y;switch(Z.type){case"text":case"error-text":Y=Z.value;break;case"execution-denied":Y=(Q=Z.reason)!=null?Q:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(Z.value);break}X.push({role:"tool",name:G.toolName,tool_call_id:G.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${K}`)}}return X}function k({id:B,model:Q,created:X}){return{id:B!=null?B:void 0,modelId:Q!=null?Q:void 0,timestamp:X!=null?new Date(X*1000):void 0}}function x(B){switch(B){case"stop":return"stop";case"length":case"model_length":return"length";case"tool_calls":return"tool-calls";default:return"other"}}var t=j.object({safePrompt:j.boolean().optional(),documentImageLimit:j.number().optional(),documentPageLimit:j.number().optional(),structuredOutputs:j.boolean().optional(),strictJsonSchema:j.boolean().optional(),parallelToolCalls:j.boolean().optional(),reasoningEffort:j.enum(["high","none"]).optional()}),e=j.object({object:j.literal("error"),message:j.string(),type:j.string(),param:j.string().nullable(),code:j.string().nullable()}),b=c({errorSchema:e,errorToMessage:(B)=>B.message});function o({tools:B,toolChoice:Q}){B=(B==null?void 0:B.length)?B:void 0;let X=[];if(B==null)return{tools:void 0,toolChoice:void 0,toolWarnings:X};let D=[];for(let $ of B)if($.type==="provider")X.push({type:"unsupported",feature:`provider-defined tool ${$.id}`});else D.push({type:"function",function:{name:$.name,description:$.description,parameters:$.inputSchema,...$.strict!=null?{strict:$.strict}:{}}});if(Q==null)return{tools:D,toolChoice:void 0,toolWarnings:X};let K=Q.type;switch(K){case"auto":case"none":return{tools:D,toolChoice:K,toolWarnings:X};case"required":return{tools:D,toolChoice:"any",toolWarnings:X};case"tool":return{tools:D.filter(($)=>$.function.name===Q.toolName),toolChoice:"any",toolWarnings:X};default:throw new w({functionality:`tool choice type: ${K}`})}}var jj=class{constructor(B,Q){this.specificationVersion="v3",this.supportedUrls={"application/pdf":[/^https:\/\/.*$/]};var X;this.modelId=B,this.config=Q,this.generateId=(X=Q.generateId)!=null?X:h}get provider(){return this.config.provider}async getArgs({prompt:B,maxOutputTokens:Q,temperature:X,topP:D,topK:K,frequencyPenalty:$,presencePenalty:N,stopSequences:G,responseFormat:Z,seed:Y,providerOptions:J,tools:f,toolChoice:L}){var U,O,V,q;let E=[],A=(U=await d({provider:"mistral",providerOptions:J,schema:t}))!=null?U:{};if(K!=null)E.push({type:"unsupported",feature:"topK"});if($!=null)E.push({type:"unsupported",feature:"frequencyPenalty"});if(N!=null)E.push({type:"unsupported",feature:"presencePenalty"});if(G!=null)E.push({type:"unsupported",feature:"stopSequences"});let H=(O=A.structuredOutputs)!=null?O:!0,z=(V=A.strictJsonSchema)!=null?V:!1;if((Z==null?void 0:Z.type)==="json"&&!(Z==null?void 0:Z.schema))B=u({messages:B,schema:Z.schema});let W={model:this.modelId,safe_prompt:A.safePrompt,max_tokens:Q,temperature:X,top_p:D,random_seed:Y,reasoning_effort:A.reasoningEffort,response_format:(Z==null?void 0:Z.type)==="json"?H&&(Z==null?void 0:Z.schema)!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:z,name:(q=Z.name)!=null?q:"response",description:Z.description}}:{type:"json_object"}:void 0,document_image_limit:A.documentImageLimit,document_page_limit:A.documentPageLimit,messages:n(B)},{tools:_,toolChoice:s,toolWarnings:r}=o({tools:f,toolChoice:L});return{args:{...W,tools:_,tool_choice:s,..._!=null&&A.parallelToolCalls!==void 0?{parallel_tool_calls:A.parallelToolCalls}:{}},warnings:[...E,...r]}}async doGenerate(B){var Q;let{args:X,warnings:D}=await this.getArgs(B),{responseHeaders:K,value:$,rawValue:N}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:X,failedResponseHandler:b,successfulResponseHandler:M(Bj),abortSignal:B.abortSignal,fetch:this.config.fetch}),G=$.choices[0],Z=[];if(G.message.content!=null&&Array.isArray(G.message.content)){for(let Y of G.message.content)if(Y.type==="thinking"){let J=F(Y.thinking);if(J.length>0)Z.push({type:"reasoning",text:J})}else if(Y.type==="text"){if(Y.text.length>0)Z.push({type:"text",text:Y.text})}}else{let Y=I(G.message.content);if(Y!=null&&Y.length>0)Z.push({type:"text",text:Y})}if(G.message.tool_calls!=null)for(let Y of G.message.tool_calls)Z.push({type:"tool-call",toolCallId:Y.id,toolName:Y.function.name,input:Y.function.arguments});return{content:Z,finishReason:{unified:x(G.finish_reason),raw:(Q=G.finish_reason)!=null?Q:void 0},usage:y($.usage),request:{body:X},response:{...k($),headers:K,body:N},warnings:D}}async doStream(B){let{args:Q,warnings:X}=await this.getArgs(B),D={...Q,stream:!0},{responseHeaders:K,value:$}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:D,failedResponseHandler:b,successfulResponseHandler:i(Gj),abortSignal:B.abortSignal,fetch:this.config.fetch}),N={unified:"other",raw:void 0},G=void 0,Z=!0,Y=!1,J=null,f=this.generateId;return{stream:$.pipeThrough(new TransformStream({start(L){L.enqueue({type:"stream-start",warnings:X})},transform(L,U){if(B.includeRawChunks)U.enqueue({type:"raw",rawValue:L.rawValue});if(!L.success){U.enqueue({type:"error",error:L.error});return}let O=L.value;if(Z)Z=!1,U.enqueue({type:"response-metadata",...k(O)});if(O.usage!=null)G=O.usage;let V=O.choices[0],q=V.delta,E=I(q.content);if(q.content!=null&&Array.isArray(q.content)){for(let A of q.content)if(A.type==="thinking"){let H=F(A.thinking);if(H.length>0){if(J==null){if(Y)U.enqueue({type:"text-end",id:"0"}),Y=!1;J=f(),U.enqueue({type:"reasoning-start",id:J})}U.enqueue({type:"reasoning-delta",id:J,delta:H})}}}if(E!=null&&E.length>0){if(!Y){if(J!=null)U.enqueue({type:"reasoning-end",id:J}),J=null;U.enqueue({type:"text-start",id:"0"}),Y=!0}U.enqueue({type:"text-delta",id:"0",delta:E})}if((q==null?void 0:q.tool_calls)!=null)for(let A of q.tool_calls){let H=A.id,z=A.function.name,W=A.function.arguments;U.enqueue({type:"tool-input-start",id:H,toolName:z}),U.enqueue({type:"tool-input-delta",id:H,delta:W}),U.enqueue({type:"tool-input-end",id:H}),U.enqueue({type:"tool-call",toolCallId:H,toolName:z,input:W})}if(V.finish_reason!=null)N={unified:x(V.finish_reason),raw:V.finish_reason}},flush(L){if(J!=null)L.enqueue({type:"reasoning-end",id:J});if(Y)L.enqueue({type:"text-end",id:"0"});L.enqueue({type:"finish",finishReason:N,usage:y(G)})}})),request:{body:D},response:{headers:K}}}};function F(B){return B.filter((Q)=>Q.type==="text").map((Q)=>Q.text).join("")}function I(B){if(typeof B==="string")return B;if(B==null)return;let Q=[];for(let X of B){let{type:D}=X;switch(D){case"text":Q.push(X.text);break;case"thinking":case"image_url":case"reference":break;default:throw Error(`Unsupported type: ${D}`)}}return Q.length?Q.join(""):void 0}var l=j.union([j.string(),j.array(j.discriminatedUnion("type",[j.object({type:j.literal("text"),text:j.string()}),j.object({type:j.literal("image_url"),image_url:j.union([j.string(),j.object({url:j.string(),detail:j.string().nullable()})])}),j.object({type:j.literal("reference"),reference_ids:j.array(j.union([j.string(),j.number()]))}),j.object({type:j.literal("thinking"),thinking:j.array(j.object({type:j.literal("text"),text:j.string()}))})]))]).nullish(),a=j.object({prompt_tokens:j.number(),completion_tokens:j.number(),total_tokens:j.number()}),Bj=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({message:j.object({role:j.literal("assistant"),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),index:j.number(),finish_reason:j.string().nullish()})),object:j.literal("chat.completion"),usage:a}),Gj=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({delta:j.object({role:j.enum(["assistant"]).optional(),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),finish_reason:j.string().nullish(),index:j.number()})),usage:a.nullish()}),Qj=class{constructor(B,Q){this.specificationVersion="v3",this.maxEmbeddingsPerCall=32,this.supportsParallelCalls=!1,this.modelId=B,this.config=Q}get provider(){return this.config.provider}async doEmbed({values:B,abortSignal:Q,headers:X}){if(B.length>this.maxEmbeddingsPerCall)throw new v({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:B});let{responseHeaders:D,value:K,rawValue:$}=await S({url:`${this.config.baseURL}/embeddings`,headers:P(this.config.headers(),X),body:{model:this.modelId,input:B,encoding_format:"float"},failedResponseHandler:b,successfulResponseHandler:M(Xj),abortSignal:Q,fetch:this.config.fetch});return{warnings:[],embeddings:K.data.map((N)=>N.embedding),usage:K.usage?{tokens:K.usage.prompt_tokens}:void 0,response:{headers:D,body:$}}}},Xj=j.object({data:j.array(j.object({embedding:j.array(j.number())})),usage:j.object({prompt_tokens:j.number()}).nullish()}),Yj="3.0.27";function Zj(B={}){var Q;let X=(Q=p(B.baseURL))!=null?Q:"https://api.mistral.ai/v1",D=()=>g({Authorization:`Bearer ${m({apiKey:B.apiKey,environmentVariableName:"MISTRAL_API_KEY",description:"Mistral"})}`,...B.headers},`ai-sdk/mistral/${Yj}`),K=(G)=>new jj(G,{provider:"mistral.chat",baseURL:X,headers:D,fetch:B.fetch,generateId:B.generateId}),$=(G)=>new Qj(G,{provider:"mistral.embedding",baseURL:X,headers:D,fetch:B.fetch}),N=function(G){if(new.target)throw Error("The Mistral model function cannot be called with the new keyword.");return K(G)};return N.specificationVersion="v3",N.languageModel=K,N.chat=K,N.embedding=$,N.embeddingModel=$,N.textEmbedding=$,N.textEmbeddingModel=$,N.imageModel=(G)=>{throw new T({modelId:G,modelType:"imageModel"})},N}var Pj=Zj();export{Pj as mistral,Zj as createMistral,Yj as VERSION};
2
+ import{$e as g,Se as P,We as C,_e as h,af as u,cf as m,kf as d,lf as S,pf as c,qf as i,rf as M,tf as p}from"./chunk-gsg6zn7e.js";import{Tp as T,Up as v,Wp as w}from"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import{Kt as j}from"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-e0vrxetq.js";function y(B){if(B==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{prompt_tokens:Q,completion_tokens:X}=B;return{inputTokens:{total:Q,noCache:Q,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:X,reasoning:void 0},raw:B}}function R({data:B,mediaType:Q}){return B instanceof URL?B.toString():`data:${Q};base64,${C(B)}`}function n(B){var Q;let X=[];for(let D=0;D<B.length;D++){let{role:K,content:$}=B[D],N=D===B.length-1;switch(K){case"system":{X.push({role:"system",content:$});break}case"user":{X.push({role:"user",content:$.map((G)=>{switch(G.type){case"text":return{type:"text",text:G.text};case"file":if(G.mediaType.startsWith("image/")){let Z=G.mediaType==="image/*"?"image/jpeg":G.mediaType;return{type:"image_url",image_url:R({data:G.data,mediaType:Z})}}else if(G.mediaType==="application/pdf")return{type:"document_url",document_url:R({data:G.data,mediaType:"application/pdf"})};else throw new w({functionality:"Only images and PDF file parts are supported"})}})});break}case"assistant":{let G="",Z=[];for(let Y of $)switch(Y.type){case"text":{G+=Y.text;break}case"tool-call":{Z.push({id:Y.toolCallId,type:"function",function:{name:Y.toolName,arguments:JSON.stringify(Y.input)}});break}case"reasoning":{G+=Y.text;break}default:throw Error(`Unsupported content type in assistant message: ${Y.type}`)}X.push({role:"assistant",content:G,prefix:N?!0:void 0,tool_calls:Z.length>0?Z:void 0});break}case"tool":{for(let G of $){if(G.type==="tool-approval-response")continue;let Z=G.output,Y;switch(Z.type){case"text":case"error-text":Y=Z.value;break;case"execution-denied":Y=(Q=Z.reason)!=null?Q:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(Z.value);break}X.push({role:"tool",name:G.toolName,tool_call_id:G.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${K}`)}}return X}function k({id:B,model:Q,created:X}){return{id:B!=null?B:void 0,modelId:Q!=null?Q:void 0,timestamp:X!=null?new Date(X*1000):void 0}}function x(B){switch(B){case"stop":return"stop";case"length":case"model_length":return"length";case"tool_calls":return"tool-calls";default:return"other"}}var t=j.object({safePrompt:j.boolean().optional(),documentImageLimit:j.number().optional(),documentPageLimit:j.number().optional(),structuredOutputs:j.boolean().optional(),strictJsonSchema:j.boolean().optional(),parallelToolCalls:j.boolean().optional(),reasoningEffort:j.enum(["high","none"]).optional()}),e=j.object({object:j.literal("error"),message:j.string(),type:j.string(),param:j.string().nullable(),code:j.string().nullable()}),b=c({errorSchema:e,errorToMessage:(B)=>B.message});function o({tools:B,toolChoice:Q}){B=(B==null?void 0:B.length)?B:void 0;let X=[];if(B==null)return{tools:void 0,toolChoice:void 0,toolWarnings:X};let D=[];for(let $ of B)if($.type==="provider")X.push({type:"unsupported",feature:`provider-defined tool ${$.id}`});else D.push({type:"function",function:{name:$.name,description:$.description,parameters:$.inputSchema,...$.strict!=null?{strict:$.strict}:{}}});if(Q==null)return{tools:D,toolChoice:void 0,toolWarnings:X};let K=Q.type;switch(K){case"auto":case"none":return{tools:D,toolChoice:K,toolWarnings:X};case"required":return{tools:D,toolChoice:"any",toolWarnings:X};case"tool":return{tools:D.filter(($)=>$.function.name===Q.toolName),toolChoice:"any",toolWarnings:X};default:throw new w({functionality:`tool choice type: ${K}`})}}var jj=class{constructor(B,Q){this.specificationVersion="v3",this.supportedUrls={"application/pdf":[/^https:\/\/.*$/]};var X;this.modelId=B,this.config=Q,this.generateId=(X=Q.generateId)!=null?X:h}get provider(){return this.config.provider}async getArgs({prompt:B,maxOutputTokens:Q,temperature:X,topP:D,topK:K,frequencyPenalty:$,presencePenalty:N,stopSequences:G,responseFormat:Z,seed:Y,providerOptions:J,tools:f,toolChoice:L}){var U,O,V,q;let E=[],A=(U=await d({provider:"mistral",providerOptions:J,schema:t}))!=null?U:{};if(K!=null)E.push({type:"unsupported",feature:"topK"});if($!=null)E.push({type:"unsupported",feature:"frequencyPenalty"});if(N!=null)E.push({type:"unsupported",feature:"presencePenalty"});if(G!=null)E.push({type:"unsupported",feature:"stopSequences"});let H=(O=A.structuredOutputs)!=null?O:!0,z=(V=A.strictJsonSchema)!=null?V:!1;if((Z==null?void 0:Z.type)==="json"&&!(Z==null?void 0:Z.schema))B=u({messages:B,schema:Z.schema});let W={model:this.modelId,safe_prompt:A.safePrompt,max_tokens:Q,temperature:X,top_p:D,random_seed:Y,reasoning_effort:A.reasoningEffort,response_format:(Z==null?void 0:Z.type)==="json"?H&&(Z==null?void 0:Z.schema)!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:z,name:(q=Z.name)!=null?q:"response",description:Z.description}}:{type:"json_object"}:void 0,document_image_limit:A.documentImageLimit,document_page_limit:A.documentPageLimit,messages:n(B)},{tools:_,toolChoice:s,toolWarnings:r}=o({tools:f,toolChoice:L});return{args:{...W,tools:_,tool_choice:s,..._!=null&&A.parallelToolCalls!==void 0?{parallel_tool_calls:A.parallelToolCalls}:{}},warnings:[...E,...r]}}async doGenerate(B){var Q;let{args:X,warnings:D}=await this.getArgs(B),{responseHeaders:K,value:$,rawValue:N}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:X,failedResponseHandler:b,successfulResponseHandler:M(Bj),abortSignal:B.abortSignal,fetch:this.config.fetch}),G=$.choices[0],Z=[];if(G.message.content!=null&&Array.isArray(G.message.content)){for(let Y of G.message.content)if(Y.type==="thinking"){let J=F(Y.thinking);if(J.length>0)Z.push({type:"reasoning",text:J})}else if(Y.type==="text"){if(Y.text.length>0)Z.push({type:"text",text:Y.text})}}else{let Y=I(G.message.content);if(Y!=null&&Y.length>0)Z.push({type:"text",text:Y})}if(G.message.tool_calls!=null)for(let Y of G.message.tool_calls)Z.push({type:"tool-call",toolCallId:Y.id,toolName:Y.function.name,input:Y.function.arguments});return{content:Z,finishReason:{unified:x(G.finish_reason),raw:(Q=G.finish_reason)!=null?Q:void 0},usage:y($.usage),request:{body:X},response:{...k($),headers:K,body:N},warnings:D}}async doStream(B){let{args:Q,warnings:X}=await this.getArgs(B),D={...Q,stream:!0},{responseHeaders:K,value:$}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:D,failedResponseHandler:b,successfulResponseHandler:i(Gj),abortSignal:B.abortSignal,fetch:this.config.fetch}),N={unified:"other",raw:void 0},G=void 0,Z=!0,Y=!1,J=null,f=this.generateId;return{stream:$.pipeThrough(new TransformStream({start(L){L.enqueue({type:"stream-start",warnings:X})},transform(L,U){if(B.includeRawChunks)U.enqueue({type:"raw",rawValue:L.rawValue});if(!L.success){U.enqueue({type:"error",error:L.error});return}let O=L.value;if(Z)Z=!1,U.enqueue({type:"response-metadata",...k(O)});if(O.usage!=null)G=O.usage;let V=O.choices[0],q=V.delta,E=I(q.content);if(q.content!=null&&Array.isArray(q.content)){for(let A of q.content)if(A.type==="thinking"){let H=F(A.thinking);if(H.length>0){if(J==null){if(Y)U.enqueue({type:"text-end",id:"0"}),Y=!1;J=f(),U.enqueue({type:"reasoning-start",id:J})}U.enqueue({type:"reasoning-delta",id:J,delta:H})}}}if(E!=null&&E.length>0){if(!Y){if(J!=null)U.enqueue({type:"reasoning-end",id:J}),J=null;U.enqueue({type:"text-start",id:"0"}),Y=!0}U.enqueue({type:"text-delta",id:"0",delta:E})}if((q==null?void 0:q.tool_calls)!=null)for(let A of q.tool_calls){let H=A.id,z=A.function.name,W=A.function.arguments;U.enqueue({type:"tool-input-start",id:H,toolName:z}),U.enqueue({type:"tool-input-delta",id:H,delta:W}),U.enqueue({type:"tool-input-end",id:H}),U.enqueue({type:"tool-call",toolCallId:H,toolName:z,input:W})}if(V.finish_reason!=null)N={unified:x(V.finish_reason),raw:V.finish_reason}},flush(L){if(J!=null)L.enqueue({type:"reasoning-end",id:J});if(Y)L.enqueue({type:"text-end",id:"0"});L.enqueue({type:"finish",finishReason:N,usage:y(G)})}})),request:{body:D},response:{headers:K}}}};function F(B){return B.filter((Q)=>Q.type==="text").map((Q)=>Q.text).join("")}function I(B){if(typeof B==="string")return B;if(B==null)return;let Q=[];for(let X of B){let{type:D}=X;switch(D){case"text":Q.push(X.text);break;case"thinking":case"image_url":case"reference":break;default:throw Error(`Unsupported type: ${D}`)}}return Q.length?Q.join(""):void 0}var l=j.union([j.string(),j.array(j.discriminatedUnion("type",[j.object({type:j.literal("text"),text:j.string()}),j.object({type:j.literal("image_url"),image_url:j.union([j.string(),j.object({url:j.string(),detail:j.string().nullable()})])}),j.object({type:j.literal("reference"),reference_ids:j.array(j.union([j.string(),j.number()]))}),j.object({type:j.literal("thinking"),thinking:j.array(j.object({type:j.literal("text"),text:j.string()}))})]))]).nullish(),a=j.object({prompt_tokens:j.number(),completion_tokens:j.number(),total_tokens:j.number()}),Bj=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({message:j.object({role:j.literal("assistant"),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),index:j.number(),finish_reason:j.string().nullish()})),object:j.literal("chat.completion"),usage:a}),Gj=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({delta:j.object({role:j.enum(["assistant"]).optional(),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),finish_reason:j.string().nullish(),index:j.number()})),usage:a.nullish()}),Qj=class{constructor(B,Q){this.specificationVersion="v3",this.maxEmbeddingsPerCall=32,this.supportsParallelCalls=!1,this.modelId=B,this.config=Q}get provider(){return this.config.provider}async doEmbed({values:B,abortSignal:Q,headers:X}){if(B.length>this.maxEmbeddingsPerCall)throw new v({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:B});let{responseHeaders:D,value:K,rawValue:$}=await S({url:`${this.config.baseURL}/embeddings`,headers:P(this.config.headers(),X),body:{model:this.modelId,input:B,encoding_format:"float"},failedResponseHandler:b,successfulResponseHandler:M(Xj),abortSignal:Q,fetch:this.config.fetch});return{warnings:[],embeddings:K.data.map((N)=>N.embedding),usage:K.usage?{tokens:K.usage.prompt_tokens}:void 0,response:{headers:D,body:$}}}},Xj=j.object({data:j.array(j.object({embedding:j.array(j.number())})),usage:j.object({prompt_tokens:j.number()}).nullish()}),Yj="3.0.27";function Zj(B={}){var Q;let X=(Q=p(B.baseURL))!=null?Q:"https://api.mistral.ai/v1",D=()=>g({Authorization:`Bearer ${m({apiKey:B.apiKey,environmentVariableName:"MISTRAL_API_KEY",description:"Mistral"})}`,...B.headers},`ai-sdk/mistral/${Yj}`),K=(G)=>new jj(G,{provider:"mistral.chat",baseURL:X,headers:D,fetch:B.fetch,generateId:B.generateId}),$=(G)=>new Qj(G,{provider:"mistral.embedding",baseURL:X,headers:D,fetch:B.fetch}),N=function(G){if(new.target)throw Error("The Mistral model function cannot be called with the new keyword.");return K(G)};return N.specificationVersion="v3",N.languageModel=K,N.chat=K,N.embedding=$,N.embeddingModel=$,N.textEmbedding=$,N.textEmbeddingModel=$,N.imageModel=(G)=>{throw new T({modelId:G,modelType:"imageModel"})},N}var Pj=Zj();export{Pj as mistral,Zj as createMistral,Yj as VERSION};