@redscope-ai/redscope 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (619) hide show
  1. package/README.md +224 -0
  2. package/dist/chunk-090920rk.js +288 -0
  3. package/dist/chunk-0afb2r78.js +141 -0
  4. package/dist/chunk-0d4ekx1g.js +73 -0
  5. package/dist/chunk-0g6nwbhq.js +15 -0
  6. package/dist/chunk-0qj905nt.js +18 -0
  7. package/dist/chunk-0s5btnn1.js +186 -0
  8. package/dist/chunk-0s8fars0.js +91 -0
  9. package/dist/chunk-10ev3dvh.js +312 -0
  10. package/dist/chunk-10k5jfc5.js +1295 -0
  11. package/dist/chunk-12tspwqa.js +240 -0
  12. package/dist/chunk-13qesvnw.js +17 -0
  13. package/dist/chunk-143eh1e0.js +121 -0
  14. package/dist/chunk-14p6wvsq.js +39 -0
  15. package/dist/chunk-19f3zb1m.js +342 -0
  16. package/dist/chunk-1a5cep8h.js +145 -0
  17. package/dist/chunk-1abw9kkn.js +34 -0
  18. package/dist/chunk-1aer7c78.js +118 -0
  19. package/dist/chunk-1dazz4g6.js +154 -0
  20. package/dist/chunk-1fcf4ty1.js +142 -0
  21. package/dist/chunk-1gnxhyf8.js +62 -0
  22. package/dist/chunk-1he3944e.js +8124 -0
  23. package/dist/chunk-1jpayz7y.js +952 -0
  24. package/dist/chunk-1qd6f6vk.js +269 -0
  25. package/dist/chunk-1v0kpe62.js +2547 -0
  26. package/dist/chunk-1w20m7gw.js +445 -0
  27. package/dist/chunk-1y7kp51j.js +72 -0
  28. package/dist/chunk-1ycb5sxt.js +247 -0
  29. package/dist/chunk-1zbwhcbt.js +1124 -0
  30. package/dist/chunk-20psem54.js +116 -0
  31. package/dist/chunk-23h69r5b.js +30 -0
  32. package/dist/chunk-23x86ptv.js +473 -0
  33. package/dist/chunk-24fyv3jz.js +378 -0
  34. package/dist/chunk-24kv69g3.js +97 -0
  35. package/dist/chunk-2azx8zsc.js +125 -0
  36. package/dist/chunk-2d1gwzz9.js +524 -0
  37. package/dist/chunk-2g0ytd9d.js +29058 -0
  38. package/dist/chunk-2hfp9kat.js +21 -0
  39. package/dist/chunk-2j875eq6.js +37 -0
  40. package/dist/chunk-2kcgxnvp.js +39 -0
  41. package/dist/chunk-2kz09j2s.js +23 -0
  42. package/dist/chunk-2mwnwp0n.js +17 -0
  43. package/dist/chunk-2p1cqhcn.js +921 -0
  44. package/dist/chunk-2p369q9z.js +61 -0
  45. package/dist/chunk-2rf6asgf.js +151 -0
  46. package/dist/chunk-2vr7mqx1.js +384 -0
  47. package/dist/chunk-2xcg933e.js +205 -0
  48. package/dist/chunk-2ypwckbz.js +40310 -0
  49. package/dist/chunk-30wnahyg.js +626 -0
  50. package/dist/chunk-326zehp8.js +204 -0
  51. package/dist/chunk-32s6jzgw.js +183 -0
  52. package/dist/chunk-35yzt1a7.js +202 -0
  53. package/dist/chunk-38frkej6.js +62 -0
  54. package/dist/chunk-3abaq08g.js +34 -0
  55. package/dist/chunk-3h59ttr5.js +32 -0
  56. package/dist/chunk-3nk9q8dr.js +154 -0
  57. package/dist/chunk-3prrxevm.js +224 -0
  58. package/dist/chunk-3tv8p9xw.js +127 -0
  59. package/dist/chunk-3txyekes.js +19 -0
  60. package/dist/chunk-3vfxjn7g.js +19 -0
  61. package/dist/chunk-3w9sye8h.js +81 -0
  62. package/dist/chunk-3y69j7y8.js +24 -0
  63. package/dist/chunk-3zwjpkjh.js +1603 -0
  64. package/dist/chunk-40t1d75v.js +3442 -0
  65. package/dist/chunk-470kmby4.js +318 -0
  66. package/dist/chunk-47jc141z.js +335 -0
  67. package/dist/chunk-48rz50ct.js +868 -0
  68. package/dist/chunk-49wv03ts.js +232 -0
  69. package/dist/chunk-4a189mn2.js +103 -0
  70. package/dist/chunk-4c4fmh7a.js +15 -0
  71. package/dist/chunk-4ct8dsj5.js +49 -0
  72. package/dist/chunk-4kqt1pm1.js +100 -0
  73. package/dist/chunk-4ng0xy0e.js +802 -0
  74. package/dist/chunk-4spgkgr3.js +43 -0
  75. package/dist/chunk-4tjdwtyy.js +19 -0
  76. package/dist/chunk-4tr60273.js +370 -0
  77. package/dist/chunk-4vnaeng5.js +29 -0
  78. package/dist/chunk-4wbqpeaw.js +871 -0
  79. package/dist/chunk-4wgkv3fv.js +1140 -0
  80. package/dist/chunk-4yjskjb6.js +40 -0
  81. package/dist/chunk-50m3a23z.js +35 -0
  82. package/dist/chunk-511f79az.js +182 -0
  83. package/dist/chunk-51sgztvv.js +161 -0
  84. package/dist/chunk-563fcpv1.js +290 -0
  85. package/dist/chunk-564cnq6v.js +735 -0
  86. package/dist/chunk-569r8cxc.js +31 -0
  87. package/dist/chunk-570x55d4.js +12 -0
  88. package/dist/chunk-571556cm.js +80 -0
  89. package/dist/chunk-59t4c56e.js +63 -0
  90. package/dist/chunk-5axjhkma.js +36 -0
  91. package/dist/chunk-5b188q5e.js +157 -0
  92. package/dist/chunk-5dmn1865.js +439 -0
  93. package/dist/chunk-5ks4829r.js +267 -0
  94. package/dist/chunk-5mmhfbxb.js +1078 -0
  95. package/dist/chunk-5rdt14hy.js +742 -0
  96. package/dist/chunk-5ssryexj.js +121 -0
  97. package/dist/chunk-5v95pnq4.js +15 -0
  98. package/dist/chunk-5xvjt2t9.js +68 -0
  99. package/dist/chunk-5zyq6t1q.js +118 -0
  100. package/dist/chunk-60fkafk2.js +15 -0
  101. package/dist/chunk-62fjkf5q.js +46 -0
  102. package/dist/chunk-64gazrrb.js +8067 -0
  103. package/dist/chunk-65tq2yjx.js +126 -0
  104. package/dist/chunk-65zbgg1n.js +14 -0
  105. package/dist/chunk-66v8mty3.js +264 -0
  106. package/dist/chunk-6acx5heq.js +292 -0
  107. package/dist/chunk-6hr7742d.js +61 -0
  108. package/dist/chunk-6hygvrhn.js +143 -0
  109. package/dist/chunk-6kjh280m.js +128 -0
  110. package/dist/chunk-6s0q1s5r.js +66 -0
  111. package/dist/chunk-6x35ffpx.js +690 -0
  112. package/dist/chunk-71jfy1hh.js +570 -0
  113. package/dist/chunk-71sdcaq6.js +15 -0
  114. package/dist/chunk-754qdxs5.js +92 -0
  115. package/dist/chunk-79v5bkj4.js +1176 -0
  116. package/dist/chunk-7br0w7j5.js +151 -0
  117. package/dist/chunk-7cjgrzz1.js +298 -0
  118. package/dist/chunk-7d41ks0y.js +133 -0
  119. package/dist/chunk-7f40pmtr.js +71 -0
  120. package/dist/chunk-7g15x8hm.js +131 -0
  121. package/dist/chunk-7gtnzdet.js +120 -0
  122. package/dist/chunk-7h0z4aqx.js +702 -0
  123. package/dist/chunk-7h7e5a7d.js +25 -0
  124. package/dist/chunk-7m2cznwr.js +40 -0
  125. package/dist/chunk-7nvday0n.js +252 -0
  126. package/dist/chunk-7qey87th.js +145 -0
  127. package/dist/chunk-7qx3xhv3.js +9076 -0
  128. package/dist/chunk-7tfdhkpy.js +61 -0
  129. package/dist/chunk-80m511j6.js +121 -0
  130. package/dist/chunk-80ysxfe9.js +784 -0
  131. package/dist/chunk-8375zk8t.js +17200 -0
  132. package/dist/chunk-85bpkyy9.js +412 -0
  133. package/dist/chunk-85tcn547.js +876 -0
  134. package/dist/chunk-85vqgbc8.js +13 -0
  135. package/dist/chunk-86626jb4.js +49 -0
  136. package/dist/chunk-87ms17f6.js +444 -0
  137. package/dist/chunk-87mz239c.js +118 -0
  138. package/dist/chunk-89vdzt4e.js +254 -0
  139. package/dist/chunk-89z3e99z.js +159 -0
  140. package/dist/chunk-8cwrz1dd.js +1806 -0
  141. package/dist/chunk-8gv2pjby.js +21 -0
  142. package/dist/chunk-8hdevr3s.js +140 -0
  143. package/dist/chunk-8hdsk6qc.js +710 -0
  144. package/dist/chunk-8kct9arg.js +724 -0
  145. package/dist/chunk-8kf8h7xf.js +23 -0
  146. package/dist/chunk-8qed8ymj.js +605 -0
  147. package/dist/chunk-8sdgr592.js +101 -0
  148. package/dist/chunk-8we9w8pw.js +111 -0
  149. package/dist/chunk-8xnm5637.js +72 -0
  150. package/dist/chunk-8y3q0eqy.js +67 -0
  151. package/dist/chunk-8yvsnrkr.js +3449 -0
  152. package/dist/chunk-8zz4z1q3.js +42 -0
  153. package/dist/chunk-90eyff3k.js +119 -0
  154. package/dist/chunk-92bjkrf2.js +121 -0
  155. package/dist/chunk-92zrc7c6.js +327 -0
  156. package/dist/chunk-935nrvdb.js +13 -0
  157. package/dist/chunk-94pfyv6a.js +48 -0
  158. package/dist/chunk-9568p8se.js +115 -0
  159. package/dist/chunk-96km1ywr.js +37 -0
  160. package/dist/chunk-980bg4w4.js +163 -0
  161. package/dist/chunk-9a9g5hbj.js +205 -0
  162. package/dist/chunk-9cm4725d.js +4395 -0
  163. package/dist/chunk-9ds3vzq8.js +847 -0
  164. package/dist/chunk-9ffc9n60.js +618 -0
  165. package/dist/chunk-9fstrwv2.js +184 -0
  166. package/dist/chunk-9gt0g0qe.js +153 -0
  167. package/dist/chunk-9h9k5vz3.js +2761 -0
  168. package/dist/chunk-9he8bmhy.js +17 -0
  169. package/dist/chunk-9hn8e6h1.js +12 -0
  170. package/dist/chunk-9j0n3g8e.js +179 -0
  171. package/dist/chunk-9j6pa3ft.js +251 -0
  172. package/dist/chunk-9jpg9dn7.js +122 -0
  173. package/dist/chunk-9mycnwj5.js +46 -0
  174. package/dist/chunk-9npy2c17.js +517 -0
  175. package/dist/chunk-9p6sec8n.js +34 -0
  176. package/dist/chunk-9pnym83h.js +4584 -0
  177. package/dist/chunk-9skwrnd2.js +25 -0
  178. package/dist/chunk-9tsfaqr8.js +459 -0
  179. package/dist/chunk-9tsw3cqv.js +5924 -0
  180. package/dist/chunk-9w6ckyk4.js +49 -0
  181. package/dist/chunk-a15bwzv6.js +147 -0
  182. package/dist/chunk-a9t6cp69.js +28 -0
  183. package/dist/chunk-ad2yk19p.js +102 -0
  184. package/dist/chunk-ad4cw4nw.js +336 -0
  185. package/dist/chunk-ad69fbsk.js +347 -0
  186. package/dist/chunk-ae76ded0.js +30 -0
  187. package/dist/chunk-aeysytks.js +216 -0
  188. package/dist/chunk-ag81m9bq.js +61 -0
  189. package/dist/chunk-ahx7gp6r.js +4448 -0
  190. package/dist/chunk-aj4tk4tk.js +23 -0
  191. package/dist/chunk-an82t9jc.js +104 -0
  192. package/dist/chunk-apg95qd7.js +1393 -0
  193. package/dist/chunk-aq5n2adz.js +27 -0
  194. package/dist/chunk-aw4s3a99.js +208 -0
  195. package/dist/chunk-awgdfggg.js +14 -0
  196. package/dist/chunk-ayymxgn1.js +164 -0
  197. package/dist/chunk-azbab59e.js +637 -0
  198. package/dist/chunk-azdxq2a3.js +293 -0
  199. package/dist/chunk-b0tjx3k1.js +523 -0
  200. package/dist/chunk-b5pp4g2g.js +371 -0
  201. package/dist/chunk-b5zm8dt6.js +26 -0
  202. package/dist/chunk-bcnye5a0.js +109 -0
  203. package/dist/chunk-beqz3k49.js +190 -0
  204. package/dist/chunk-bf906wpw.js +147 -0
  205. package/dist/chunk-bgan4cpf.js +13 -0
  206. package/dist/chunk-bhzp13h7.js +1178 -0
  207. package/dist/chunk-bk403kpw.js +142 -0
  208. package/dist/chunk-bmq4c135.js +489 -0
  209. package/dist/chunk-bprbeda7.js +35 -0
  210. package/dist/chunk-bst7czdd.js +888 -0
  211. package/dist/chunk-bths4xgn.js +111 -0
  212. package/dist/chunk-btjn3qby.js +13 -0
  213. package/dist/chunk-bwb1vxnt.js +120 -0
  214. package/dist/chunk-bxa6tw4m.js +643 -0
  215. package/dist/chunk-bxfjr8qb.js +27 -0
  216. package/dist/chunk-bxpzhrej.js +73 -0
  217. package/dist/chunk-bzyzrq0k.js +51 -0
  218. package/dist/chunk-c0k7b0jw.js +4265 -0
  219. package/dist/chunk-c17f0h2s.js +16 -0
  220. package/dist/chunk-c1yc761e.js +6748 -0
  221. package/dist/chunk-c5g9shkw.js +298 -0
  222. package/dist/chunk-c696122m.js +69 -0
  223. package/dist/chunk-c92b3yxx.js +109 -0
  224. package/dist/chunk-c9aqz56y.js +143 -0
  225. package/dist/chunk-cba7c5w3.js +345 -0
  226. package/dist/chunk-cbcxbbe6.js +6543 -0
  227. package/dist/chunk-cdfjb87h.js +11 -0
  228. package/dist/chunk-ce8zjt1y.js +136 -0
  229. package/dist/chunk-cep7e37k.js +22740 -0
  230. package/dist/chunk-chs5qm8d.js +258 -0
  231. package/dist/chunk-ckydq33g.js +144 -0
  232. package/dist/chunk-cnge6wpj.js +514 -0
  233. package/dist/chunk-cpnsvqf1.js +13 -0
  234. package/dist/chunk-cqqebkv4.js +32 -0
  235. package/dist/chunk-cvqpp7dk.js +627 -0
  236. package/dist/chunk-cwc33j40.js +65 -0
  237. package/dist/chunk-cypvrq2a.js +155 -0
  238. package/dist/chunk-d1ha0swn.js +475 -0
  239. package/dist/chunk-d2an0138.js +35 -0
  240. package/dist/chunk-d2tt72ck.js +343 -0
  241. package/dist/chunk-d6wvcqrw.js +9507 -0
  242. package/dist/chunk-d7ys2kka.js +991 -0
  243. package/dist/chunk-dbts5q5p.js +122 -0
  244. package/dist/chunk-dct29ggs.js +295 -0
  245. package/dist/chunk-de0qnnf7.js +1059 -0
  246. package/dist/chunk-dep72ce4.js +513 -0
  247. package/dist/chunk-dgpvgy8x.js +47 -0
  248. package/dist/chunk-dhhd7dtc.js +20 -0
  249. package/dist/chunk-dhzpmxv6.js +594 -0
  250. package/dist/chunk-djes4da7.js +413 -0
  251. package/dist/chunk-dnhv3vx7.js +166 -0
  252. package/dist/chunk-dqtvafan.js +2365 -0
  253. package/dist/chunk-dr4a3tcp.js +60 -0
  254. package/dist/chunk-dz2xk9kb.js +100 -0
  255. package/dist/chunk-dz7nc6rf.js +15 -0
  256. package/dist/chunk-e3abfxpy.js +1486 -0
  257. package/dist/chunk-e3cq9z89.js +85 -0
  258. package/dist/chunk-e3j7m7k2.js +642 -0
  259. package/dist/chunk-e4dsy4g1.js +9951 -0
  260. package/dist/chunk-e5592pnn.js +197 -0
  261. package/dist/chunk-e55hdegh.js +129 -0
  262. package/dist/chunk-e5r5r04e.js +1030 -0
  263. package/dist/chunk-e60zztbt.js +442 -0
  264. package/dist/chunk-e7qq6vn0.js +372 -0
  265. package/dist/chunk-e9aat7xw.js +80 -0
  266. package/dist/chunk-e9d5v3zs.js +143 -0
  267. package/dist/chunk-eax32zk4.js +87 -0
  268. package/dist/chunk-ebfwmbx1.js +117 -0
  269. package/dist/chunk-ec71pb8t.js +971 -0
  270. package/dist/chunk-eemjb825.js +17252 -0
  271. package/dist/chunk-ees8xdhd.js +256 -0
  272. package/dist/chunk-eewg66y1.js +112 -0
  273. package/dist/chunk-eg22v12d.js +266 -0
  274. package/dist/chunk-enzzk67f.js +313 -0
  275. package/dist/chunk-eskhp70f.js +117 -0
  276. package/dist/chunk-ewx6z4g8.js +55 -0
  277. package/dist/chunk-eyvx461k.js +76 -0
  278. package/dist/chunk-eztq2b5f.js +94 -0
  279. package/dist/chunk-f0ffwzdd.js +321 -0
  280. package/dist/chunk-f80n68mf.js +119 -0
  281. package/dist/chunk-fae2hjxp.js +99 -0
  282. package/dist/chunk-fbtfp370.js +60 -0
  283. package/dist/chunk-fc6ndtgf.js +94 -0
  284. package/dist/chunk-fdwabr8p.js +13870 -0
  285. package/dist/chunk-fejeqe61.js +785 -0
  286. package/dist/chunk-fh0d6mvk.js +168 -0
  287. package/dist/chunk-fh19zcaf.js +304 -0
  288. package/dist/chunk-fh8bd39r.js +186 -0
  289. package/dist/chunk-fj2ebbpn.js +33 -0
  290. package/dist/chunk-fjn632v7.js +194 -0
  291. package/dist/chunk-fncpkzs5.js +1389 -0
  292. package/dist/chunk-fpd1gpt8.js +332 -0
  293. package/dist/chunk-fq9snrnh.js +295 -0
  294. package/dist/chunk-fqcfzg3j.js +207 -0
  295. package/dist/chunk-ftt3vqj2.js +1919 -0
  296. package/dist/chunk-g06pm4n9.js +395 -0
  297. package/dist/chunk-g4m5pf4g.js +8 -0
  298. package/dist/chunk-g72h52y6.js +36 -0
  299. package/dist/chunk-g79ej71s.js +1627 -0
  300. package/dist/chunk-g7fwk59d.js +19 -0
  301. package/dist/chunk-g9jnkrtm.js +663 -0
  302. package/dist/chunk-g9vg5d7t.js +38 -0
  303. package/dist/chunk-ga1jkyqy.js +1636 -0
  304. package/dist/chunk-gaaap2nk.js +676 -0
  305. package/dist/chunk-gc6erq5q.js +483 -0
  306. package/dist/chunk-gjrcmf0a.js +752 -0
  307. package/dist/chunk-gmdy2w3z.js +238999 -0
  308. package/dist/chunk-gsz4yrrk.js +81 -0
  309. package/dist/chunk-gy47rjy8.js +3830 -0
  310. package/dist/chunk-h12a4f4x.js +11 -0
  311. package/dist/chunk-h1yratmg.js +725 -0
  312. package/dist/chunk-h9y0jnsy.js +155 -0
  313. package/dist/chunk-hbhs3mwy.js +133 -0
  314. package/dist/chunk-hbs8cmb4.js +8 -0
  315. package/dist/chunk-hdk0t1ht.js +940 -0
  316. package/dist/chunk-hef8dx4s.js +178 -0
  317. package/dist/chunk-hgsca8mt.js +381 -0
  318. package/dist/chunk-hhsxm2yr.js +67 -0
  319. package/dist/chunk-hj5tzzpd.js +39 -0
  320. package/dist/chunk-hjxqmtg5.js +94 -0
  321. package/dist/chunk-hn4w9pkj.js +68 -0
  322. package/dist/chunk-hnprkjgp.js +25 -0
  323. package/dist/chunk-hq3n5ex7.js +183 -0
  324. package/dist/chunk-hqjspfma.js +158 -0
  325. package/dist/chunk-hqxp6b72.js +1198 -0
  326. package/dist/chunk-hs6nrmq6.js +94 -0
  327. package/dist/chunk-hwba5xdc.js +267 -0
  328. package/dist/chunk-hy566ev3.js +430 -0
  329. package/dist/chunk-hzmzwte2.js +153 -0
  330. package/dist/chunk-hzxzvzw8.js +274 -0
  331. package/dist/chunk-j139fzgs.js +114 -0
  332. package/dist/chunk-j1mep9ck.js +62 -0
  333. package/dist/chunk-j3xveeg4.js +273 -0
  334. package/dist/chunk-j5y1s11j.js +100 -0
  335. package/dist/chunk-j9475b46.js +26 -0
  336. package/dist/chunk-j9rgqs8m.js +1192 -0
  337. package/dist/chunk-jccjaddz.js +74 -0
  338. package/dist/chunk-jdkwfy9e.js +35 -0
  339. package/dist/chunk-jdqp0r4h.js +6157 -0
  340. package/dist/chunk-jdzk4zwn.js +587 -0
  341. package/dist/chunk-jfafmkte.js +49 -0
  342. package/dist/chunk-jg3r989b.js +16 -0
  343. package/dist/chunk-jhtccjc9.js +54 -0
  344. package/dist/chunk-jj2ff1pr.js +688 -0
  345. package/dist/chunk-jmv7k0jn.js +37 -0
  346. package/dist/chunk-jmxzmwpw.js +65 -0
  347. package/dist/chunk-jnjxdqyr.js +353 -0
  348. package/dist/chunk-jsbbez9j.js +138 -0
  349. package/dist/chunk-jvpt2dc0.js +424 -0
  350. package/dist/chunk-jwd7cka0.js +34 -0
  351. package/dist/chunk-jy5er3st.js +15 -0
  352. package/dist/chunk-jyby79z5.js +121 -0
  353. package/dist/chunk-jzyr6j5n.js +332 -0
  354. package/dist/chunk-k49xc781.js +63 -0
  355. package/dist/chunk-k7dt2g4a.js +41 -0
  356. package/dist/chunk-k7hexw3v.js +969 -0
  357. package/dist/chunk-k7wwkraa.js +117 -0
  358. package/dist/chunk-kb3758f7.js +51 -0
  359. package/dist/chunk-kc67kt75.js +3119 -0
  360. package/dist/chunk-kdhmfxmh.js +3149 -0
  361. package/dist/chunk-kejdd6zc.js +51 -0
  362. package/dist/chunk-kekrjeem.js +402 -0
  363. package/dist/chunk-kez5r0zz.js +280 -0
  364. package/dist/chunk-kfsvcs5t.js +75 -0
  365. package/dist/chunk-khtvffc4.js +285 -0
  366. package/dist/chunk-kkz4w1tv.js +64 -0
  367. package/dist/chunk-kmywng0j.js +272 -0
  368. package/dist/chunk-kq6vcpdr.js +224 -0
  369. package/dist/chunk-kqzdszcc.js +37 -0
  370. package/dist/chunk-ktxpp02w.js +435 -0
  371. package/dist/chunk-kwcvhbtz.js +26 -0
  372. package/dist/chunk-kx0cm9qr.js +128 -0
  373. package/dist/chunk-kxcmqz10.js +120 -0
  374. package/dist/chunk-kxwava1g.js +14 -0
  375. package/dist/chunk-kywtr3jg.js +825 -0
  376. package/dist/chunk-kzwg923p.js +8 -0
  377. package/dist/chunk-m1eq3sgv.js +255 -0
  378. package/dist/chunk-m21h5zb4.js +119 -0
  379. package/dist/chunk-m2c3bjv1.js +111 -0
  380. package/dist/chunk-m41e19ms.js +42 -0
  381. package/dist/chunk-m7ka36ex.js +97 -0
  382. package/dist/chunk-m81w8tbm.js +259 -0
  383. package/dist/chunk-m95ggkax.js +281 -0
  384. package/dist/chunk-manx26xa.js +145 -0
  385. package/dist/chunk-mdxh3pk2.js +298 -0
  386. package/dist/chunk-mhbfkcja.js +311 -0
  387. package/dist/chunk-mjnr5erm.js +173 -0
  388. package/dist/chunk-mngvnmwp.js +135 -0
  389. package/dist/chunk-mvfqanv5.js +63 -0
  390. package/dist/chunk-mw1nesq1.js +140 -0
  391. package/dist/chunk-mx168925.js +661 -0
  392. package/dist/chunk-mxwvj18g.js +795 -0
  393. package/dist/chunk-my7r5mba.js +257 -0
  394. package/dist/chunk-myaa1kkf.js +17 -0
  395. package/dist/chunk-myypc3tn.js +46 -0
  396. package/dist/chunk-mzcnmnpq.js +3379 -0
  397. package/dist/chunk-mznav6d1.js +194 -0
  398. package/dist/chunk-n0qxskpr.js +24 -0
  399. package/dist/chunk-n6a6hgtp.js +394 -0
  400. package/dist/chunk-n6d5fgx0.js +254 -0
  401. package/dist/chunk-n6ym3n03.js +120 -0
  402. package/dist/chunk-n9g24mwe.js +104 -0
  403. package/dist/chunk-naamqdf9.js +185 -0
  404. package/dist/chunk-nb2jk7zj.js +15 -0
  405. package/dist/chunk-nbkbq9en.js +67 -0
  406. package/dist/chunk-ndttd6es.js +38 -0
  407. package/dist/chunk-nfygaaxg.js +133 -0
  408. package/dist/chunk-ngdzpszd.js +454 -0
  409. package/dist/chunk-nmfwksa4.js +1297 -0
  410. package/dist/chunk-nt837qt9.js +21 -0
  411. package/dist/chunk-nwc3v0vp.js +691 -0
  412. package/dist/chunk-nz8ha95p.js +3610 -0
  413. package/dist/chunk-nzxfj0gq.js +2007 -0
  414. package/dist/chunk-p0r8887g.js +6932 -0
  415. package/dist/chunk-p1seyqdm.js +120 -0
  416. package/dist/chunk-p425zbgw.js +726 -0
  417. package/dist/chunk-p7hamd2c.js +146 -0
  418. package/dist/chunk-pdvg91cg.js +32 -0
  419. package/dist/chunk-pecy49yr.js +14649 -0
  420. package/dist/chunk-pfxrg89f.js +547 -0
  421. package/dist/chunk-pfyw3155.js +2750 -0
  422. package/dist/chunk-pr8m11pm.js +1192 -0
  423. package/dist/chunk-ptxteaeh.js +1591 -0
  424. package/dist/chunk-pv164mac.js +394 -0
  425. package/dist/chunk-pxxhtxf5.js +10154 -0
  426. package/dist/chunk-q0e485mg.js +61 -0
  427. package/dist/chunk-q1vrhh0q.js +458 -0
  428. package/dist/chunk-q2h79ncs.js +370 -0
  429. package/dist/chunk-q3b4n194.js +56 -0
  430. package/dist/chunk-q44zc68f.js +4301 -0
  431. package/dist/chunk-q8gknbdx.js +352 -0
  432. package/dist/chunk-q8xk3kdj.js +11 -0
  433. package/dist/chunk-qak46xtp.js +119 -0
  434. package/dist/chunk-qfq7absv.js +95 -0
  435. package/dist/chunk-qfsn720k.js +151 -0
  436. package/dist/chunk-qg4811f6.js +228 -0
  437. package/dist/chunk-qgzn3qps.js +90 -0
  438. package/dist/chunk-qhaggqkt.js +113 -0
  439. package/dist/chunk-qjjp27z8.js +195 -0
  440. package/dist/chunk-qxp0nye6.js +34 -0
  441. package/dist/chunk-qy3nagaq.js +4957 -0
  442. package/dist/chunk-qz2meav1.js +1452 -0
  443. package/dist/chunk-r50hne7m.js +63 -0
  444. package/dist/chunk-r6m0vgnv.js +80 -0
  445. package/dist/chunk-r7yw38vf.js +22864 -0
  446. package/dist/chunk-r8xc618w.js +42 -0
  447. package/dist/chunk-r961r5kj.js +87 -0
  448. package/dist/chunk-r9b5xrh0.js +66 -0
  449. package/dist/chunk-rcn2pd6q.js +477 -0
  450. package/dist/chunk-rdeh8p3y.js +148 -0
  451. package/dist/chunk-rg9x1742.js +542 -0
  452. package/dist/chunk-rgyzsbs3.js +39 -0
  453. package/dist/chunk-rk2fsxtz.js +16 -0
  454. package/dist/chunk-rkchkwv9.js +40 -0
  455. package/dist/chunk-rp8whpb3.js +478 -0
  456. package/dist/chunk-rpkxdtgr.js +68 -0
  457. package/dist/chunk-rpmntgyh.js +394 -0
  458. package/dist/chunk-rpshz4dy.js +614 -0
  459. package/dist/chunk-rqd60ay5.js +133 -0
  460. package/dist/chunk-rrsjf2ea.js +229 -0
  461. package/dist/chunk-rtjk8c8e.js +173 -0
  462. package/dist/chunk-rw0y2wdf.js +1017 -0
  463. package/dist/chunk-rx5w7ess.js +663 -0
  464. package/dist/chunk-rx8t9d35.js +1947 -0
  465. package/dist/chunk-rxcazxgf.js +195 -0
  466. package/dist/chunk-rxg6q3bp.js +1413 -0
  467. package/dist/chunk-rxrb7xnd.js +71 -0
  468. package/dist/chunk-rxrzxff3.js +118 -0
  469. package/dist/chunk-ryqjc943.js +71 -0
  470. package/dist/chunk-rzk9k2rf.js +81 -0
  471. package/dist/chunk-s2qv0nht.js +119 -0
  472. package/dist/chunk-s3hafnk3.js +2285 -0
  473. package/dist/chunk-s4a496tt.js +226 -0
  474. package/dist/chunk-s4d1h3ka.js +35 -0
  475. package/dist/chunk-sm3k3ze4.js +16525 -0
  476. package/dist/chunk-sn0bja82.js +385 -0
  477. package/dist/chunk-sngjggw1.js +4227 -0
  478. package/dist/chunk-sq047n34.js +364 -0
  479. package/dist/chunk-sttwe2tw.js +8584 -0
  480. package/dist/chunk-sw8qx1r0.js +86 -0
  481. package/dist/chunk-swstah6a.js +240 -0
  482. package/dist/chunk-syrkr0mf.js +63 -0
  483. package/dist/chunk-sz206bd9.js +26 -0
  484. package/dist/chunk-t09669cj.js +333 -0
  485. package/dist/chunk-t5f8e30k.js +602 -0
  486. package/dist/chunk-t5m78mc8.js +432 -0
  487. package/dist/chunk-t5x1dqwn.js +143 -0
  488. package/dist/chunk-t877ea0w.js +168 -0
  489. package/dist/chunk-t91hb71c.js +17 -0
  490. package/dist/chunk-tb636bcf.js +942 -0
  491. package/dist/chunk-tb8sykbr.js +426 -0
  492. package/dist/chunk-tbdkekz3.js +125 -0
  493. package/dist/chunk-td2gsz7s.js +225 -0
  494. package/dist/chunk-tenvxbyh.js +20 -0
  495. package/dist/chunk-texg4qqt.js +317 -0
  496. package/dist/chunk-teymzz80.js +266 -0
  497. package/dist/chunk-tj26qpf7.js +153 -0
  498. package/dist/chunk-tk85ec4p.js +395 -0
  499. package/dist/chunk-tq205h01.js +164 -0
  500. package/dist/chunk-tqzddjzg.js +61 -0
  501. package/dist/chunk-trqrj23e.js +134 -0
  502. package/dist/chunk-tw1hfsxv.js +2477 -0
  503. package/dist/chunk-txxdfq83.js +122 -0
  504. package/dist/chunk-v0yhe582.js +31 -0
  505. package/dist/chunk-v14184xm.js +15 -0
  506. package/dist/chunk-v1h9z4hw.js +138 -0
  507. package/dist/chunk-v3ey5j7f.js +329 -0
  508. package/dist/chunk-v3nh1sfn.js +208 -0
  509. package/dist/chunk-v3x8tcc0.js +45 -0
  510. package/dist/chunk-v4nqnvqq.js +3984 -0
  511. package/dist/chunk-v4ypszbb.js +15 -0
  512. package/dist/chunk-v7wbqcx9.js +63 -0
  513. package/dist/chunk-v8r5fev3.js +341 -0
  514. package/dist/chunk-v9zg5kzx.js +2810 -0
  515. package/dist/chunk-va1wh5ss.js +24 -0
  516. package/dist/chunk-vbfswhht.js +42 -0
  517. package/dist/chunk-ve7x2tfq.js +124 -0
  518. package/dist/chunk-vfz8k89y.js +485 -0
  519. package/dist/chunk-vgm5k14x.js +35678 -0
  520. package/dist/chunk-vh9pej3c.js +247 -0
  521. package/dist/chunk-vjxqyt6f.js +3820 -0
  522. package/dist/chunk-vpb1xstn.js +178 -0
  523. package/dist/chunk-vqt79tj8.js +110 -0
  524. package/dist/chunk-vr0n9pv9.js +152 -0
  525. package/dist/chunk-vrejmja5.js +90 -0
  526. package/dist/chunk-vrxasmdw.js +449 -0
  527. package/dist/chunk-vrxb946v.js +125 -0
  528. package/dist/chunk-vv4kj0q8.js +98 -0
  529. package/dist/chunk-vvpfng7w.js +8 -0
  530. package/dist/chunk-vw6ybyew.js +2007 -0
  531. package/dist/chunk-vwenx8ke.js +17 -0
  532. package/dist/chunk-vwfa0s5a.js +155 -0
  533. package/dist/chunk-vx71j8xe.js +63 -0
  534. package/dist/chunk-vxbjzggp.js +43 -0
  535. package/dist/chunk-vxjxtz8w.js +440 -0
  536. package/dist/chunk-vy0c1bwp.js +9 -0
  537. package/dist/chunk-w3zczyse.js +14 -0
  538. package/dist/chunk-w4p5t920.js +655 -0
  539. package/dist/chunk-w68wc625.js +287 -0
  540. package/dist/chunk-w9ddp3yf.js +96 -0
  541. package/dist/chunk-wcggm5ja.js +125 -0
  542. package/dist/chunk-wgnyph3q.js +1306 -0
  543. package/dist/chunk-wjm5pc1e.js +134 -0
  544. package/dist/chunk-wnve0drm.js +131 -0
  545. package/dist/chunk-wp27ev2k.js +135 -0
  546. package/dist/chunk-wyvy8a4x.js +131 -0
  547. package/dist/chunk-x671y4dk.js +129 -0
  548. package/dist/chunk-xbj5keyy.js +22 -0
  549. package/dist/chunk-xf4fzms8.js +39 -0
  550. package/dist/chunk-xf59k3zg.js +65 -0
  551. package/dist/chunk-xgzc4w49.js +204 -0
  552. package/dist/chunk-xhj7g13b.js +2149 -0
  553. package/dist/chunk-xjp0cd00.js +56 -0
  554. package/dist/chunk-xkhnmhqs.js +74 -0
  555. package/dist/chunk-xkrkqx61.js +55 -0
  556. package/dist/chunk-xmpgmeb8.js +114 -0
  557. package/dist/chunk-xrw80zgd.js +4249 -0
  558. package/dist/chunk-xrzc96g0.js +202 -0
  559. package/dist/chunk-xt76sm44.js +318 -0
  560. package/dist/chunk-xwet3awb.js +20 -0
  561. package/dist/chunk-xyg1sk2w.js +78 -0
  562. package/dist/chunk-y0jpkqb0.js +180 -0
  563. package/dist/chunk-y1q7rt9n.js +102 -0
  564. package/dist/chunk-y67ntyek.js +258 -0
  565. package/dist/chunk-ybk37qp9.js +37 -0
  566. package/dist/chunk-yc1stfve.js +5386 -0
  567. package/dist/chunk-ychjpjef.js +62 -0
  568. package/dist/chunk-yez8fa9g.js +276 -0
  569. package/dist/chunk-ygm7xszr.js +90 -0
  570. package/dist/chunk-ym11azkj.js +37 -0
  571. package/dist/chunk-ympz2h15.js +578 -0
  572. package/dist/chunk-yqx3az3n.js +129 -0
  573. package/dist/chunk-yt3nfhcc.js +152 -0
  574. package/dist/chunk-yy8q0n8s.js +120 -0
  575. package/dist/chunk-yzb92zxv.js +8 -0
  576. package/dist/chunk-yzet6xyr.js +119 -0
  577. package/dist/chunk-yzm97qp1.js +226 -0
  578. package/dist/chunk-z0jgeax8.js +35 -0
  579. package/dist/chunk-z1r3z6w6.js +29 -0
  580. package/dist/chunk-z2dp53wn.js +17 -0
  581. package/dist/chunk-z79355gz.js +308 -0
  582. package/dist/chunk-z7e94hxz.js +251 -0
  583. package/dist/chunk-z8cqdcec.js +173 -0
  584. package/dist/chunk-z99tbg45.js +148 -0
  585. package/dist/chunk-z9nsjcht.js +37 -0
  586. package/dist/chunk-za3k6h2h.js +470 -0
  587. package/dist/chunk-zacynq5p.js +265 -0
  588. package/dist/chunk-zb0x40az.js +1785 -0
  589. package/dist/chunk-zbxtzycc.js +274 -0
  590. package/dist/chunk-zga50181.js +342 -0
  591. package/dist/chunk-zhb2pns1.js +44 -0
  592. package/dist/chunk-zkch6trx.js +231 -0
  593. package/dist/chunk-znf3z4qt.js +954 -0
  594. package/dist/chunk-zp8zwdgq.js +72 -0
  595. package/dist/chunk-ztjd8pyf.js +120 -0
  596. package/dist/chunk-ztmb7geg.js +173 -0
  597. package/dist/chunk-zvr4snzv.js +887 -0
  598. package/dist/chunk-zw62m6n3.js +34858 -0
  599. package/dist/chunk-zwwdebd0.js +65 -0
  600. package/dist/chunk-zxc6x9w8.js +340 -0
  601. package/dist/chunk-zy2e7sz0.js +8 -0
  602. package/dist/chunk-zzf074w3.js +196 -0
  603. package/dist/chunk-zzz0nwb5.js +310 -0
  604. package/dist/cli-bun.js +2 -0
  605. package/dist/cli-node.js +2 -0
  606. package/dist/cli.js +218 -0
  607. package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
  608. package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
  609. package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
  610. package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
  611. package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
  612. package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
  613. package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
  614. package/package.json +243 -0
  615. package/scripts/chrome-mcp-bridge-resolver.mjs +43 -0
  616. package/scripts/chrome-mcp-env.mjs +19 -0
  617. package/scripts/postinstall.cjs +339 -0
  618. package/scripts/run-parallel.mjs +10 -0
  619. package/scripts/setup-chrome-mcp.mjs +69 -0
@@ -0,0 +1,3379 @@
1
+ // @bun
2
+ import {
3
+ require_dist_cjs as require_dist_cjs5,
4
+ require_dist_cjs1 as require_dist_cjs6,
5
+ require_dist_cjs2 as require_dist_cjs9,
6
+ require_dist_cjs3 as require_dist_cjs10,
7
+ require_dist_cjs4 as require_dist_cjs11
8
+ } from "./chunk-d7ys2kka.js";
9
+ import {
10
+ require_dist_cjs as require_dist_cjs3
11
+ } from "./chunk-5rdt14hy.js";
12
+ import"./chunk-4yjskjb6.js";
13
+ import {
14
+ require_dist_cjs as require_dist_cjs2
15
+ } from "./chunk-fh0d6mvk.js";
16
+ import {
17
+ require_dist_cjs as require_dist_cjs4
18
+ } from "./chunk-xkrkqx61.js";
19
+ import {
20
+ require_dist_cjs
21
+ } from "./chunk-qgzn3qps.js";
22
+ import {
23
+ require_dist_cjs1 as require_dist_cjs7,
24
+ require_dist_cjs2 as require_dist_cjs8
25
+ } from "./chunk-v7wbqcx9.js";
26
+ import {
27
+ __commonJS,
28
+ __esm,
29
+ __require
30
+ } from "./chunk-hhsxm2yr.js";
31
+
32
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js
33
+ var require_ChecksumStream = __commonJS((exports) => {
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.ChecksumStream = undefined;
36
+ var util_base64_1 = require_dist_cjs9();
37
+ var stream_1 = __require("stream");
38
+
39
+ class ChecksumStream extends stream_1.Duplex {
40
+ expectedChecksum;
41
+ checksumSourceLocation;
42
+ checksum;
43
+ source;
44
+ base64Encoder;
45
+ pendingCallback = null;
46
+ constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) {
47
+ super();
48
+ if (typeof source.pipe === "function") {
49
+ this.source = source;
50
+ } else {
51
+ throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
52
+ }
53
+ this.base64Encoder = base64Encoder ?? util_base64_1.toBase64;
54
+ this.expectedChecksum = expectedChecksum;
55
+ this.checksum = checksum;
56
+ this.checksumSourceLocation = checksumSourceLocation;
57
+ this.source.pipe(this);
58
+ }
59
+ _read(size) {
60
+ if (this.pendingCallback) {
61
+ const callback = this.pendingCallback;
62
+ this.pendingCallback = null;
63
+ callback();
64
+ }
65
+ }
66
+ _write(chunk, encoding, callback) {
67
+ try {
68
+ this.checksum.update(chunk);
69
+ const canPushMore = this.push(chunk);
70
+ if (!canPushMore) {
71
+ this.pendingCallback = callback;
72
+ return;
73
+ }
74
+ } catch (e) {
75
+ return callback(e);
76
+ }
77
+ return callback();
78
+ }
79
+ async _final(callback) {
80
+ try {
81
+ const digest = await this.checksum.digest();
82
+ const received = this.base64Encoder(digest);
83
+ if (this.expectedChecksum !== received) {
84
+ return callback(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}"` + ` in response header "${this.checksumSourceLocation}".`));
85
+ }
86
+ } catch (e) {
87
+ return callback(e);
88
+ }
89
+ this.push(null);
90
+ return callback();
91
+ }
92
+ }
93
+ exports.ChecksumStream = ChecksumStream;
94
+ });
95
+
96
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js
97
+ var require_stream_type_check = __commonJS((exports) => {
98
+ Object.defineProperty(exports, "__esModule", { value: true });
99
+ exports.isBlob = exports.isReadableStream = undefined;
100
+ var isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);
101
+ exports.isReadableStream = isReadableStream;
102
+ var isBlob = (blob) => {
103
+ return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob);
104
+ };
105
+ exports.isBlob = isBlob;
106
+ });
107
+
108
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js
109
+ var require_ChecksumStream_browser = __commonJS((exports) => {
110
+ Object.defineProperty(exports, "__esModule", { value: true });
111
+ exports.ChecksumStream = undefined;
112
+ var ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function() {};
113
+
114
+ class ChecksumStream extends ReadableStreamRef {
115
+ }
116
+ exports.ChecksumStream = ChecksumStream;
117
+ });
118
+
119
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js
120
+ var require_createChecksumStream_browser = __commonJS((exports) => {
121
+ Object.defineProperty(exports, "__esModule", { value: true });
122
+ exports.createChecksumStream = undefined;
123
+ var util_base64_1 = require_dist_cjs9();
124
+ var stream_type_check_1 = require_stream_type_check();
125
+ var ChecksumStream_browser_1 = require_ChecksumStream_browser();
126
+ var createChecksumStream = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) => {
127
+ if (!(0, stream_type_check_1.isReadableStream)(source)) {
128
+ throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
129
+ }
130
+ const encoder = base64Encoder ?? util_base64_1.toBase64;
131
+ if (typeof TransformStream !== "function") {
132
+ throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");
133
+ }
134
+ const transform = new TransformStream({
135
+ start() {},
136
+ async transform(chunk, controller) {
137
+ checksum.update(chunk);
138
+ controller.enqueue(chunk);
139
+ },
140
+ async flush(controller) {
141
+ const digest = await checksum.digest();
142
+ const received = encoder(digest);
143
+ if (expectedChecksum !== received) {
144
+ const error = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}"` + ` in response header "${checksumSourceLocation}".`);
145
+ controller.error(error);
146
+ } else {
147
+ controller.terminate();
148
+ }
149
+ }
150
+ });
151
+ source.pipeThrough(transform);
152
+ const readable = transform.readable;
153
+ Object.setPrototypeOf(readable, ChecksumStream_browser_1.ChecksumStream.prototype);
154
+ return readable;
155
+ };
156
+ exports.createChecksumStream = createChecksumStream;
157
+ });
158
+
159
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js
160
+ var require_createChecksumStream = __commonJS((exports) => {
161
+ Object.defineProperty(exports, "__esModule", { value: true });
162
+ exports.createChecksumStream = createChecksumStream;
163
+ var stream_type_check_1 = require_stream_type_check();
164
+ var ChecksumStream_1 = require_ChecksumStream();
165
+ var createChecksumStream_browser_1 = require_createChecksumStream_browser();
166
+ function createChecksumStream(init) {
167
+ if (typeof ReadableStream === "function" && (0, stream_type_check_1.isReadableStream)(init.source)) {
168
+ return (0, createChecksumStream_browser_1.createChecksumStream)(init);
169
+ }
170
+ return new ChecksumStream_1.ChecksumStream(init);
171
+ }
172
+ });
173
+
174
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js
175
+ var require_ByteArrayCollector = __commonJS((exports) => {
176
+ Object.defineProperty(exports, "__esModule", { value: true });
177
+ exports.ByteArrayCollector = undefined;
178
+
179
+ class ByteArrayCollector {
180
+ allocByteArray;
181
+ byteLength = 0;
182
+ byteArrays = [];
183
+ constructor(allocByteArray) {
184
+ this.allocByteArray = allocByteArray;
185
+ }
186
+ push(byteArray) {
187
+ this.byteArrays.push(byteArray);
188
+ this.byteLength += byteArray.byteLength;
189
+ }
190
+ flush() {
191
+ if (this.byteArrays.length === 1) {
192
+ const bytes = this.byteArrays[0];
193
+ this.reset();
194
+ return bytes;
195
+ }
196
+ const aggregation = this.allocByteArray(this.byteLength);
197
+ let cursor = 0;
198
+ for (let i = 0;i < this.byteArrays.length; ++i) {
199
+ const bytes = this.byteArrays[i];
200
+ aggregation.set(bytes, cursor);
201
+ cursor += bytes.byteLength;
202
+ }
203
+ this.reset();
204
+ return aggregation;
205
+ }
206
+ reset() {
207
+ this.byteArrays = [];
208
+ this.byteLength = 0;
209
+ }
210
+ }
211
+ exports.ByteArrayCollector = ByteArrayCollector;
212
+ });
213
+
214
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js
215
+ var require_createBufferedReadableStream = __commonJS((exports) => {
216
+ Object.defineProperty(exports, "__esModule", { value: true });
217
+ exports.createBufferedReadable = undefined;
218
+ exports.createBufferedReadableStream = createBufferedReadableStream;
219
+ exports.merge = merge;
220
+ exports.flush = flush;
221
+ exports.sizeOf = sizeOf;
222
+ exports.modeOf = modeOf;
223
+ var ByteArrayCollector_1 = require_ByteArrayCollector();
224
+ function createBufferedReadableStream(upstream, size, logger) {
225
+ const reader = upstream.getReader();
226
+ let streamBufferingLoggedWarning = false;
227
+ let bytesSeen = 0;
228
+ const buffers = ["", new ByteArrayCollector_1.ByteArrayCollector((size2) => new Uint8Array(size2))];
229
+ let mode = -1;
230
+ const pull = async (controller) => {
231
+ const { value, done } = await reader.read();
232
+ const chunk = value;
233
+ if (done) {
234
+ if (mode !== -1) {
235
+ const remainder = flush(buffers, mode);
236
+ if (sizeOf(remainder) > 0) {
237
+ controller.enqueue(remainder);
238
+ }
239
+ }
240
+ controller.close();
241
+ } else {
242
+ const chunkMode = modeOf(chunk, false);
243
+ if (mode !== chunkMode) {
244
+ if (mode >= 0) {
245
+ controller.enqueue(flush(buffers, mode));
246
+ }
247
+ mode = chunkMode;
248
+ }
249
+ if (mode === -1) {
250
+ controller.enqueue(chunk);
251
+ return;
252
+ }
253
+ const chunkSize = sizeOf(chunk);
254
+ bytesSeen += chunkSize;
255
+ const bufferSize = sizeOf(buffers[mode]);
256
+ if (chunkSize >= size && bufferSize === 0) {
257
+ controller.enqueue(chunk);
258
+ } else {
259
+ const newSize = merge(buffers, mode, chunk);
260
+ if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
261
+ streamBufferingLoggedWarning = true;
262
+ logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
263
+ }
264
+ if (newSize >= size) {
265
+ controller.enqueue(flush(buffers, mode));
266
+ } else {
267
+ await pull(controller);
268
+ }
269
+ }
270
+ }
271
+ };
272
+ return new ReadableStream({
273
+ pull
274
+ });
275
+ }
276
+ exports.createBufferedReadable = createBufferedReadableStream;
277
+ function merge(buffers, mode, chunk) {
278
+ switch (mode) {
279
+ case 0:
280
+ buffers[0] += chunk;
281
+ return sizeOf(buffers[0]);
282
+ case 1:
283
+ case 2:
284
+ buffers[mode].push(chunk);
285
+ return sizeOf(buffers[mode]);
286
+ }
287
+ }
288
+ function flush(buffers, mode) {
289
+ switch (mode) {
290
+ case 0:
291
+ const s = buffers[0];
292
+ buffers[0] = "";
293
+ return s;
294
+ case 1:
295
+ case 2:
296
+ return buffers[mode].flush();
297
+ }
298
+ throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`);
299
+ }
300
+ function sizeOf(chunk) {
301
+ return chunk?.byteLength ?? chunk?.length ?? 0;
302
+ }
303
+ function modeOf(chunk, allowBuffer = true) {
304
+ if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) {
305
+ return 2;
306
+ }
307
+ if (chunk instanceof Uint8Array) {
308
+ return 1;
309
+ }
310
+ if (typeof chunk === "string") {
311
+ return 0;
312
+ }
313
+ return -1;
314
+ }
315
+ });
316
+
317
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js
318
+ var require_createBufferedReadable = __commonJS((exports) => {
319
+ Object.defineProperty(exports, "__esModule", { value: true });
320
+ exports.createBufferedReadable = createBufferedReadable;
321
+ var node_stream_1 = __require("stream");
322
+ var ByteArrayCollector_1 = require_ByteArrayCollector();
323
+ var createBufferedReadableStream_1 = require_createBufferedReadableStream();
324
+ var stream_type_check_1 = require_stream_type_check();
325
+ function createBufferedReadable(upstream, size, logger) {
326
+ if ((0, stream_type_check_1.isReadableStream)(upstream)) {
327
+ return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size, logger);
328
+ }
329
+ const downstream = new node_stream_1.Readable({ read() {} });
330
+ let streamBufferingLoggedWarning = false;
331
+ let bytesSeen = 0;
332
+ const buffers = [
333
+ "",
334
+ new ByteArrayCollector_1.ByteArrayCollector((size2) => new Uint8Array(size2)),
335
+ new ByteArrayCollector_1.ByteArrayCollector((size2) => Buffer.from(new Uint8Array(size2)))
336
+ ];
337
+ let mode = -1;
338
+ upstream.on("data", (chunk) => {
339
+ const chunkMode = (0, createBufferedReadableStream_1.modeOf)(chunk, true);
340
+ if (mode !== chunkMode) {
341
+ if (mode >= 0) {
342
+ downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode));
343
+ }
344
+ mode = chunkMode;
345
+ }
346
+ if (mode === -1) {
347
+ downstream.push(chunk);
348
+ return;
349
+ }
350
+ const chunkSize = (0, createBufferedReadableStream_1.sizeOf)(chunk);
351
+ bytesSeen += chunkSize;
352
+ const bufferSize = (0, createBufferedReadableStream_1.sizeOf)(buffers[mode]);
353
+ if (chunkSize >= size && bufferSize === 0) {
354
+ downstream.push(chunk);
355
+ } else {
356
+ const newSize = (0, createBufferedReadableStream_1.merge)(buffers, mode, chunk);
357
+ if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
358
+ streamBufferingLoggedWarning = true;
359
+ logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
360
+ }
361
+ if (newSize >= size) {
362
+ downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode));
363
+ }
364
+ }
365
+ });
366
+ upstream.on("end", () => {
367
+ if (mode !== -1) {
368
+ const remainder = (0, createBufferedReadableStream_1.flush)(buffers, mode);
369
+ if ((0, createBufferedReadableStream_1.sizeOf)(remainder) > 0) {
370
+ downstream.push(remainder);
371
+ }
372
+ }
373
+ downstream.push(null);
374
+ });
375
+ return downstream;
376
+ }
377
+ });
378
+
379
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js
380
+ var require_getAwsChunkedEncodingStream_browser = __commonJS((exports) => {
381
+ Object.defineProperty(exports, "__esModule", { value: true });
382
+ exports.getAwsChunkedEncodingStream = undefined;
383
+ var getAwsChunkedEncodingStream = (readableStream, options) => {
384
+ const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
385
+ const checksumRequired = base64Encoder !== undefined && bodyLengthChecker !== undefined && checksumAlgorithmFn !== undefined && checksumLocationName !== undefined && streamHasher !== undefined;
386
+ const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined;
387
+ const reader = readableStream.getReader();
388
+ return new ReadableStream({
389
+ async pull(controller) {
390
+ const { value, done } = await reader.read();
391
+ if (done) {
392
+ controller.enqueue(`0\r
393
+ `);
394
+ if (checksumRequired) {
395
+ const checksum = base64Encoder(await digest);
396
+ controller.enqueue(`${checksumLocationName}:${checksum}\r
397
+ `);
398
+ controller.enqueue(`\r
399
+ `);
400
+ }
401
+ controller.close();
402
+ } else {
403
+ controller.enqueue(`${(bodyLengthChecker(value) || 0).toString(16)}\r
404
+ ${value}\r
405
+ `);
406
+ }
407
+ }
408
+ });
409
+ };
410
+ exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream;
411
+ });
412
+
413
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js
414
+ var require_getAwsChunkedEncodingStream = __commonJS((exports) => {
415
+ Object.defineProperty(exports, "__esModule", { value: true });
416
+ exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream;
417
+ var node_stream_1 = __require("stream");
418
+ var getAwsChunkedEncodingStream_browser_1 = require_getAwsChunkedEncodingStream_browser();
419
+ var stream_type_check_1 = require_stream_type_check();
420
+ function getAwsChunkedEncodingStream(stream, options) {
421
+ const readable = stream;
422
+ const readableStream = stream;
423
+ if ((0, stream_type_check_1.isReadableStream)(readableStream)) {
424
+ return (0, getAwsChunkedEncodingStream_browser_1.getAwsChunkedEncodingStream)(readableStream, options);
425
+ }
426
+ const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
427
+ const checksumRequired = base64Encoder !== undefined && checksumAlgorithmFn !== undefined && checksumLocationName !== undefined && streamHasher !== undefined;
428
+ const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readable) : undefined;
429
+ const awsChunkedEncodingStream = new node_stream_1.Readable({
430
+ read: () => {}
431
+ });
432
+ readable.on("data", (data) => {
433
+ const length = bodyLengthChecker(data) || 0;
434
+ if (length === 0) {
435
+ return;
436
+ }
437
+ awsChunkedEncodingStream.push(`${length.toString(16)}\r
438
+ `);
439
+ awsChunkedEncodingStream.push(data);
440
+ awsChunkedEncodingStream.push(`\r
441
+ `);
442
+ });
443
+ readable.on("end", async () => {
444
+ awsChunkedEncodingStream.push(`0\r
445
+ `);
446
+ if (checksumRequired) {
447
+ const checksum = base64Encoder(await digest);
448
+ awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r
449
+ `);
450
+ awsChunkedEncodingStream.push(`\r
451
+ `);
452
+ }
453
+ awsChunkedEncodingStream.push(null);
454
+ });
455
+ return awsChunkedEncodingStream;
456
+ }
457
+ });
458
+
459
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js
460
+ var require_headStream_browser = __commonJS((exports) => {
461
+ Object.defineProperty(exports, "__esModule", { value: true });
462
+ exports.headStream = headStream;
463
+ async function headStream(stream, bytes) {
464
+ let byteLengthCounter = 0;
465
+ const chunks = [];
466
+ const reader = stream.getReader();
467
+ let isDone = false;
468
+ while (!isDone) {
469
+ const { done, value } = await reader.read();
470
+ if (value) {
471
+ chunks.push(value);
472
+ byteLengthCounter += value?.byteLength ?? 0;
473
+ }
474
+ if (byteLengthCounter >= bytes) {
475
+ break;
476
+ }
477
+ isDone = done;
478
+ }
479
+ reader.releaseLock();
480
+ const collected = new Uint8Array(Math.min(bytes, byteLengthCounter));
481
+ let offset = 0;
482
+ for (const chunk of chunks) {
483
+ if (chunk.byteLength > collected.byteLength - offset) {
484
+ collected.set(chunk.subarray(0, collected.byteLength - offset), offset);
485
+ break;
486
+ } else {
487
+ collected.set(chunk, offset);
488
+ }
489
+ offset += chunk.length;
490
+ }
491
+ return collected;
492
+ }
493
+ });
494
+
495
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/headStream.js
496
+ var require_headStream = __commonJS((exports) => {
497
+ Object.defineProperty(exports, "__esModule", { value: true });
498
+ exports.headStream = undefined;
499
+ var stream_1 = __require("stream");
500
+ var headStream_browser_1 = require_headStream_browser();
501
+ var stream_type_check_1 = require_stream_type_check();
502
+ var headStream = (stream, bytes) => {
503
+ if ((0, stream_type_check_1.isReadableStream)(stream)) {
504
+ return (0, headStream_browser_1.headStream)(stream, bytes);
505
+ }
506
+ return new Promise((resolve, reject) => {
507
+ const collector = new Collector;
508
+ collector.limit = bytes;
509
+ stream.pipe(collector);
510
+ stream.on("error", (err) => {
511
+ collector.end();
512
+ reject(err);
513
+ });
514
+ collector.on("error", reject);
515
+ collector.on("finish", function() {
516
+ const bytes2 = new Uint8Array(Buffer.concat(this.buffers));
517
+ resolve(bytes2);
518
+ });
519
+ });
520
+ };
521
+ exports.headStream = headStream;
522
+
523
+ class Collector extends stream_1.Writable {
524
+ buffers = [];
525
+ limit = Infinity;
526
+ bytesBuffered = 0;
527
+ _write(chunk, encoding, callback) {
528
+ this.buffers.push(chunk);
529
+ this.bytesBuffered += chunk.byteLength ?? 0;
530
+ if (this.bytesBuffered >= this.limit) {
531
+ const excess = this.bytesBuffered - this.limit;
532
+ const tailBuffer = this.buffers[this.buffers.length - 1];
533
+ this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess);
534
+ this.emit("finish");
535
+ }
536
+ callback();
537
+ }
538
+ }
539
+ });
540
+
541
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js
542
+ var require_sdk_stream_mixin_browser = __commonJS((exports) => {
543
+ Object.defineProperty(exports, "__esModule", { value: true });
544
+ exports.sdkStreamMixin = undefined;
545
+ var fetch_http_handler_1 = require_dist_cjs10();
546
+ var util_base64_1 = require_dist_cjs9();
547
+ var util_hex_encoding_1 = require_dist_cjs11();
548
+ var util_utf8_1 = require_dist_cjs8();
549
+ var stream_type_check_1 = require_stream_type_check();
550
+ var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
551
+ var sdkStreamMixin = (stream) => {
552
+ if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) {
553
+ const name = stream?.__proto__?.constructor?.name || stream;
554
+ throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
555
+ }
556
+ let transformed = false;
557
+ const transformToByteArray = async () => {
558
+ if (transformed) {
559
+ throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
560
+ }
561
+ transformed = true;
562
+ return await (0, fetch_http_handler_1.streamCollector)(stream);
563
+ };
564
+ const blobToWebStream = (blob) => {
565
+ if (typeof blob.stream !== "function") {
566
+ throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
567
+ ` + "If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
568
+ }
569
+ return blob.stream();
570
+ };
571
+ return Object.assign(stream, {
572
+ transformToByteArray,
573
+ transformToString: async (encoding) => {
574
+ const buf = await transformToByteArray();
575
+ if (encoding === "base64") {
576
+ return (0, util_base64_1.toBase64)(buf);
577
+ } else if (encoding === "hex") {
578
+ return (0, util_hex_encoding_1.toHex)(buf);
579
+ } else if (encoding === undefined || encoding === "utf8" || encoding === "utf-8") {
580
+ return (0, util_utf8_1.toUtf8)(buf);
581
+ } else if (typeof TextDecoder === "function") {
582
+ return new TextDecoder(encoding).decode(buf);
583
+ } else {
584
+ throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
585
+ }
586
+ },
587
+ transformToWebStream: () => {
588
+ if (transformed) {
589
+ throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
590
+ }
591
+ transformed = true;
592
+ if (isBlobInstance(stream)) {
593
+ return blobToWebStream(stream);
594
+ } else if ((0, stream_type_check_1.isReadableStream)(stream)) {
595
+ return stream;
596
+ } else {
597
+ throw new Error(`Cannot transform payload to web stream, got ${stream}`);
598
+ }
599
+ }
600
+ });
601
+ };
602
+ exports.sdkStreamMixin = sdkStreamMixin;
603
+ var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
604
+ });
605
+
606
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js
607
+ var require_sdk_stream_mixin = __commonJS((exports) => {
608
+ Object.defineProperty(exports, "__esModule", { value: true });
609
+ exports.sdkStreamMixin = undefined;
610
+ var node_http_handler_1 = require_dist_cjs3();
611
+ var util_buffer_from_1 = require_dist_cjs7();
612
+ var stream_1 = __require("stream");
613
+ var sdk_stream_mixin_browser_1 = require_sdk_stream_mixin_browser();
614
+ var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
615
+ var sdkStreamMixin = (stream) => {
616
+ if (!(stream instanceof stream_1.Readable)) {
617
+ try {
618
+ return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream);
619
+ } catch (e) {
620
+ const name = stream?.__proto__?.constructor?.name || stream;
621
+ throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
622
+ }
623
+ }
624
+ let transformed = false;
625
+ const transformToByteArray = async () => {
626
+ if (transformed) {
627
+ throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
628
+ }
629
+ transformed = true;
630
+ return await (0, node_http_handler_1.streamCollector)(stream);
631
+ };
632
+ return Object.assign(stream, {
633
+ transformToByteArray,
634
+ transformToString: async (encoding) => {
635
+ const buf = await transformToByteArray();
636
+ if (encoding === undefined || Buffer.isEncoding(encoding)) {
637
+ return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
638
+ } else {
639
+ const decoder = new TextDecoder(encoding);
640
+ return decoder.decode(buf);
641
+ }
642
+ },
643
+ transformToWebStream: () => {
644
+ if (transformed) {
645
+ throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
646
+ }
647
+ if (stream.readableFlowing !== null) {
648
+ throw new Error("The stream has been consumed by other callbacks.");
649
+ }
650
+ if (typeof stream_1.Readable.toWeb !== "function") {
651
+ throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
652
+ }
653
+ transformed = true;
654
+ return stream_1.Readable.toWeb(stream);
655
+ }
656
+ });
657
+ };
658
+ exports.sdkStreamMixin = sdkStreamMixin;
659
+ });
660
+
661
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js
662
+ var require_splitStream_browser = __commonJS((exports) => {
663
+ Object.defineProperty(exports, "__esModule", { value: true });
664
+ exports.splitStream = splitStream;
665
+ async function splitStream(stream) {
666
+ if (typeof stream.stream === "function") {
667
+ stream = stream.stream();
668
+ }
669
+ const readableStream = stream;
670
+ return readableStream.tee();
671
+ }
672
+ });
673
+
674
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/splitStream.js
675
+ var require_splitStream = __commonJS((exports) => {
676
+ Object.defineProperty(exports, "__esModule", { value: true });
677
+ exports.splitStream = splitStream;
678
+ var stream_1 = __require("stream");
679
+ var splitStream_browser_1 = require_splitStream_browser();
680
+ var stream_type_check_1 = require_stream_type_check();
681
+ async function splitStream(stream) {
682
+ if ((0, stream_type_check_1.isReadableStream)(stream) || (0, stream_type_check_1.isBlob)(stream)) {
683
+ return (0, splitStream_browser_1.splitStream)(stream);
684
+ }
685
+ const stream1 = new stream_1.PassThrough;
686
+ const stream2 = new stream_1.PassThrough;
687
+ stream.pipe(stream1);
688
+ stream.pipe(stream2);
689
+ return [stream1, stream2];
690
+ }
691
+ });
692
+
693
+ // node_modules/.bun/@smithy+util-stream@4.5.23/node_modules/@smithy/util-stream/dist-cjs/index.js
694
+ var require_dist_cjs12 = __commonJS((exports) => {
695
+ var utilBase64 = require_dist_cjs9();
696
+ var utilUtf8 = require_dist_cjs8();
697
+ var ChecksumStream = require_ChecksumStream();
698
+ var createChecksumStream = require_createChecksumStream();
699
+ var createBufferedReadable = require_createBufferedReadable();
700
+ var getAwsChunkedEncodingStream = require_getAwsChunkedEncodingStream();
701
+ var headStream = require_headStream();
702
+ var sdkStreamMixin = require_sdk_stream_mixin();
703
+ var splitStream = require_splitStream();
704
+ var streamTypeCheck = require_stream_type_check();
705
+
706
+ class Uint8ArrayBlobAdapter extends Uint8Array {
707
+ static fromString(source, encoding = "utf-8") {
708
+ if (typeof source === "string") {
709
+ if (encoding === "base64") {
710
+ return Uint8ArrayBlobAdapter.mutate(utilBase64.fromBase64(source));
711
+ }
712
+ return Uint8ArrayBlobAdapter.mutate(utilUtf8.fromUtf8(source));
713
+ }
714
+ throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
715
+ }
716
+ static mutate(source) {
717
+ Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype);
718
+ return source;
719
+ }
720
+ transformToString(encoding = "utf-8") {
721
+ if (encoding === "base64") {
722
+ return utilBase64.toBase64(this);
723
+ }
724
+ return utilUtf8.toUtf8(this);
725
+ }
726
+ }
727
+ exports.isBlob = streamTypeCheck.isBlob;
728
+ exports.isReadableStream = streamTypeCheck.isReadableStream;
729
+ exports.Uint8ArrayBlobAdapter = Uint8ArrayBlobAdapter;
730
+ Object.prototype.hasOwnProperty.call(ChecksumStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
731
+ enumerable: true,
732
+ value: ChecksumStream["__proto__"]
733
+ });
734
+ Object.keys(ChecksumStream).forEach(function(k) {
735
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
736
+ exports[k] = ChecksumStream[k];
737
+ });
738
+ Object.prototype.hasOwnProperty.call(createChecksumStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
739
+ enumerable: true,
740
+ value: createChecksumStream["__proto__"]
741
+ });
742
+ Object.keys(createChecksumStream).forEach(function(k) {
743
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
744
+ exports[k] = createChecksumStream[k];
745
+ });
746
+ Object.prototype.hasOwnProperty.call(createBufferedReadable, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
747
+ enumerable: true,
748
+ value: createBufferedReadable["__proto__"]
749
+ });
750
+ Object.keys(createBufferedReadable).forEach(function(k) {
751
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
752
+ exports[k] = createBufferedReadable[k];
753
+ });
754
+ Object.prototype.hasOwnProperty.call(getAwsChunkedEncodingStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
755
+ enumerable: true,
756
+ value: getAwsChunkedEncodingStream["__proto__"]
757
+ });
758
+ Object.keys(getAwsChunkedEncodingStream).forEach(function(k) {
759
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
760
+ exports[k] = getAwsChunkedEncodingStream[k];
761
+ });
762
+ Object.prototype.hasOwnProperty.call(headStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
763
+ enumerable: true,
764
+ value: headStream["__proto__"]
765
+ });
766
+ Object.keys(headStream).forEach(function(k) {
767
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
768
+ exports[k] = headStream[k];
769
+ });
770
+ Object.prototype.hasOwnProperty.call(sdkStreamMixin, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
771
+ enumerable: true,
772
+ value: sdkStreamMixin["__proto__"]
773
+ });
774
+ Object.keys(sdkStreamMixin).forEach(function(k) {
775
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
776
+ exports[k] = sdkStreamMixin[k];
777
+ });
778
+ Object.prototype.hasOwnProperty.call(splitStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
779
+ enumerable: true,
780
+ value: splitStream["__proto__"]
781
+ });
782
+ Object.keys(splitStream).forEach(function(k) {
783
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
784
+ exports[k] = splitStream[k];
785
+ });
786
+ });
787
+
788
+ // node_modules/.bun/@smithy+core@3.23.15/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js
789
+ var require_endpoints = __commonJS((exports) => {
790
+ var urlParser = require_dist_cjs4();
791
+ var toEndpointV1 = (endpoint) => {
792
+ if (typeof endpoint === "object") {
793
+ if ("url" in endpoint) {
794
+ const v1Endpoint = urlParser.parseUrl(endpoint.url);
795
+ if (endpoint.headers) {
796
+ v1Endpoint.headers = {};
797
+ for (const [name, values] of Object.entries(endpoint.headers)) {
798
+ v1Endpoint.headers[name.toLowerCase()] = values.join(", ");
799
+ }
800
+ }
801
+ return v1Endpoint;
802
+ }
803
+ return endpoint;
804
+ }
805
+ return urlParser.parseUrl(endpoint);
806
+ };
807
+ exports.toEndpointV1 = toEndpointV1;
808
+ });
809
+
810
+ // node_modules/.bun/@smithy+core@3.23.15/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js
811
+ var require_schema = __commonJS((exports) => {
812
+ var protocolHttp = require_dist_cjs2();
813
+ var utilMiddleware = require_dist_cjs5();
814
+ var endpoints = require_endpoints();
815
+ var deref = (schemaRef) => {
816
+ if (typeof schemaRef === "function") {
817
+ return schemaRef();
818
+ }
819
+ return schemaRef;
820
+ };
821
+ var operation = (namespace, name, traits, input, output) => ({
822
+ name,
823
+ namespace,
824
+ traits,
825
+ input,
826
+ output
827
+ });
828
+ var schemaDeserializationMiddleware = (config) => (next, context) => async (args) => {
829
+ const { response } = await next(args);
830
+ const { operationSchema } = utilMiddleware.getSmithyContext(context);
831
+ const [, ns, n, t, i, o] = operationSchema ?? [];
832
+ try {
833
+ const parsed = await config.protocol.deserializeResponse(operation(ns, n, t, i, o), {
834
+ ...config,
835
+ ...context
836
+ }, response);
837
+ return {
838
+ response,
839
+ output: parsed
840
+ };
841
+ } catch (error2) {
842
+ Object.defineProperty(error2, "$response", {
843
+ value: response,
844
+ enumerable: false,
845
+ writable: false,
846
+ configurable: false
847
+ });
848
+ if (!("$metadata" in error2)) {
849
+ const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
850
+ try {
851
+ error2.message += `
852
+ ` + hint;
853
+ } catch (e) {
854
+ if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
855
+ console.warn(hint);
856
+ } else {
857
+ context.logger?.warn?.(hint);
858
+ }
859
+ }
860
+ if (typeof error2.$responseBodyText !== "undefined") {
861
+ if (error2.$response) {
862
+ error2.$response.body = error2.$responseBodyText;
863
+ }
864
+ }
865
+ try {
866
+ if (protocolHttp.HttpResponse.isInstance(response)) {
867
+ const { headers = {} } = response;
868
+ const headerEntries = Object.entries(headers);
869
+ error2.$metadata = {
870
+ httpStatusCode: response.statusCode,
871
+ requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries),
872
+ extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries),
873
+ cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries)
874
+ };
875
+ }
876
+ } catch (e) {}
877
+ }
878
+ throw error2;
879
+ }
880
+ };
881
+ var findHeader = (pattern, headers) => {
882
+ return (headers.find(([k]) => {
883
+ return k.match(pattern);
884
+ }) || [undefined, undefined])[1];
885
+ };
886
+ var schemaSerializationMiddleware = (config) => (next, context) => async (args) => {
887
+ const { operationSchema } = utilMiddleware.getSmithyContext(context);
888
+ const [, ns, n, t, i, o] = operationSchema ?? [];
889
+ const endpoint = context.endpointV2 ? async () => endpoints.toEndpointV1(context.endpointV2) : config.endpoint;
890
+ const request = await config.protocol.serializeRequest(operation(ns, n, t, i, o), args.input, {
891
+ ...config,
892
+ ...context,
893
+ endpoint
894
+ });
895
+ return next({
896
+ ...args,
897
+ request
898
+ });
899
+ };
900
+ var deserializerMiddlewareOption = {
901
+ name: "deserializerMiddleware",
902
+ step: "deserialize",
903
+ tags: ["DESERIALIZER"],
904
+ override: true
905
+ };
906
+ var serializerMiddlewareOption = {
907
+ name: "serializerMiddleware",
908
+ step: "serialize",
909
+ tags: ["SERIALIZER"],
910
+ override: true
911
+ };
912
+ function getSchemaSerdePlugin(config) {
913
+ return {
914
+ applyToStack: (commandStack) => {
915
+ commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption);
916
+ commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption);
917
+ config.protocol.setSerdeContext(config);
918
+ }
919
+ };
920
+ }
921
+
922
+ class Schema {
923
+ name;
924
+ namespace;
925
+ traits;
926
+ static assign(instance, values) {
927
+ const schema = Object.assign(instance, values);
928
+ return schema;
929
+ }
930
+ static [Symbol.hasInstance](lhs) {
931
+ const isPrototype = this.prototype.isPrototypeOf(lhs);
932
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
933
+ const list2 = lhs;
934
+ return list2.symbol === this.symbol;
935
+ }
936
+ return isPrototype;
937
+ }
938
+ getName() {
939
+ return this.namespace + "#" + this.name;
940
+ }
941
+ }
942
+
943
+ class ListSchema extends Schema {
944
+ static symbol = Symbol.for("@smithy/lis");
945
+ name;
946
+ traits;
947
+ valueSchema;
948
+ symbol = ListSchema.symbol;
949
+ }
950
+ var list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema, {
951
+ name,
952
+ namespace,
953
+ traits,
954
+ valueSchema
955
+ });
956
+
957
+ class MapSchema extends Schema {
958
+ static symbol = Symbol.for("@smithy/map");
959
+ name;
960
+ traits;
961
+ keySchema;
962
+ valueSchema;
963
+ symbol = MapSchema.symbol;
964
+ }
965
+ var map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema, {
966
+ name,
967
+ namespace,
968
+ traits,
969
+ keySchema,
970
+ valueSchema
971
+ });
972
+
973
+ class OperationSchema extends Schema {
974
+ static symbol = Symbol.for("@smithy/ope");
975
+ name;
976
+ traits;
977
+ input;
978
+ output;
979
+ symbol = OperationSchema.symbol;
980
+ }
981
+ var op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema, {
982
+ name,
983
+ namespace,
984
+ traits,
985
+ input,
986
+ output
987
+ });
988
+
989
+ class StructureSchema extends Schema {
990
+ static symbol = Symbol.for("@smithy/str");
991
+ name;
992
+ traits;
993
+ memberNames;
994
+ memberList;
995
+ symbol = StructureSchema.symbol;
996
+ }
997
+ var struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema, {
998
+ name,
999
+ namespace,
1000
+ traits,
1001
+ memberNames,
1002
+ memberList
1003
+ });
1004
+
1005
+ class ErrorSchema extends StructureSchema {
1006
+ static symbol = Symbol.for("@smithy/err");
1007
+ ctor;
1008
+ symbol = ErrorSchema.symbol;
1009
+ }
1010
+ var error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema, {
1011
+ name,
1012
+ namespace,
1013
+ traits,
1014
+ memberNames,
1015
+ memberList,
1016
+ ctor: null
1017
+ });
1018
+ var traitsCache = [];
1019
+ function translateTraits(indicator) {
1020
+ if (typeof indicator === "object") {
1021
+ return indicator;
1022
+ }
1023
+ indicator = indicator | 0;
1024
+ if (traitsCache[indicator]) {
1025
+ return traitsCache[indicator];
1026
+ }
1027
+ const traits = {};
1028
+ let i = 0;
1029
+ for (const trait of [
1030
+ "httpLabel",
1031
+ "idempotent",
1032
+ "idempotencyToken",
1033
+ "sensitive",
1034
+ "httpPayload",
1035
+ "httpResponseCode",
1036
+ "httpQueryParams"
1037
+ ]) {
1038
+ if ((indicator >> i++ & 1) === 1) {
1039
+ traits[trait] = 1;
1040
+ }
1041
+ }
1042
+ return traitsCache[indicator] = traits;
1043
+ }
1044
+ var anno = {
1045
+ it: Symbol.for("@smithy/nor-struct-it"),
1046
+ ns: Symbol.for("@smithy/ns")
1047
+ };
1048
+ var simpleSchemaCacheN = [];
1049
+ var simpleSchemaCacheS = {};
1050
+
1051
+ class NormalizedSchema {
1052
+ ref;
1053
+ memberName;
1054
+ static symbol = Symbol.for("@smithy/nor");
1055
+ symbol = NormalizedSchema.symbol;
1056
+ name;
1057
+ schema;
1058
+ _isMemberSchema;
1059
+ traits;
1060
+ memberTraits;
1061
+ normalizedTraits;
1062
+ constructor(ref, memberName) {
1063
+ this.ref = ref;
1064
+ this.memberName = memberName;
1065
+ const traitStack = [];
1066
+ let _ref = ref;
1067
+ let schema = ref;
1068
+ this._isMemberSchema = false;
1069
+ while (isMemberSchema(_ref)) {
1070
+ traitStack.push(_ref[1]);
1071
+ _ref = _ref[0];
1072
+ schema = deref(_ref);
1073
+ this._isMemberSchema = true;
1074
+ }
1075
+ if (traitStack.length > 0) {
1076
+ this.memberTraits = {};
1077
+ for (let i = traitStack.length - 1;i >= 0; --i) {
1078
+ const traitSet = traitStack[i];
1079
+ Object.assign(this.memberTraits, translateTraits(traitSet));
1080
+ }
1081
+ } else {
1082
+ this.memberTraits = 0;
1083
+ }
1084
+ if (schema instanceof NormalizedSchema) {
1085
+ const computedMemberTraits = this.memberTraits;
1086
+ Object.assign(this, schema);
1087
+ this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());
1088
+ this.normalizedTraits = undefined;
1089
+ this.memberName = memberName ?? schema.memberName;
1090
+ return;
1091
+ }
1092
+ this.schema = deref(schema);
1093
+ if (isStaticSchema(this.schema)) {
1094
+ this.name = `${this.schema[1]}#${this.schema[2]}`;
1095
+ this.traits = this.schema[3];
1096
+ } else {
1097
+ this.name = this.memberName ?? String(schema);
1098
+ this.traits = 0;
1099
+ }
1100
+ if (this._isMemberSchema && !memberName) {
1101
+ throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
1102
+ }
1103
+ }
1104
+ static [Symbol.hasInstance](lhs) {
1105
+ const isPrototype = this.prototype.isPrototypeOf(lhs);
1106
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
1107
+ const ns = lhs;
1108
+ return ns.symbol === this.symbol;
1109
+ }
1110
+ return isPrototype;
1111
+ }
1112
+ static of(ref) {
1113
+ const keyAble = typeof ref === "function" || typeof ref === "object" && ref !== null;
1114
+ if (typeof ref === "number") {
1115
+ if (simpleSchemaCacheN[ref]) {
1116
+ return simpleSchemaCacheN[ref];
1117
+ }
1118
+ } else if (typeof ref === "string") {
1119
+ if (simpleSchemaCacheS[ref]) {
1120
+ return simpleSchemaCacheS[ref];
1121
+ }
1122
+ } else if (keyAble) {
1123
+ if (ref[anno.ns]) {
1124
+ return ref[anno.ns];
1125
+ }
1126
+ }
1127
+ const sc = deref(ref);
1128
+ if (sc instanceof NormalizedSchema) {
1129
+ return sc;
1130
+ }
1131
+ if (isMemberSchema(sc)) {
1132
+ const [ns2, traits] = sc;
1133
+ if (ns2 instanceof NormalizedSchema) {
1134
+ Object.assign(ns2.getMergedTraits(), translateTraits(traits));
1135
+ return ns2;
1136
+ }
1137
+ throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
1138
+ }
1139
+ const ns = new NormalizedSchema(sc);
1140
+ if (keyAble) {
1141
+ return ref[anno.ns] = ns;
1142
+ }
1143
+ if (typeof sc === "string") {
1144
+ return simpleSchemaCacheS[sc] = ns;
1145
+ }
1146
+ if (typeof sc === "number") {
1147
+ return simpleSchemaCacheN[sc] = ns;
1148
+ }
1149
+ return ns;
1150
+ }
1151
+ getSchema() {
1152
+ const sc = this.schema;
1153
+ if (Array.isArray(sc) && sc[0] === 0) {
1154
+ return sc[4];
1155
+ }
1156
+ return sc;
1157
+ }
1158
+ getName(withNamespace = false) {
1159
+ const { name } = this;
1160
+ const short = !withNamespace && name && name.includes("#");
1161
+ return short ? name.split("#")[1] : name || undefined;
1162
+ }
1163
+ getMemberName() {
1164
+ return this.memberName;
1165
+ }
1166
+ isMemberSchema() {
1167
+ return this._isMemberSchema;
1168
+ }
1169
+ isListSchema() {
1170
+ const sc = this.getSchema();
1171
+ return typeof sc === "number" ? sc >= 64 && sc < 128 : sc[0] === 1;
1172
+ }
1173
+ isMapSchema() {
1174
+ const sc = this.getSchema();
1175
+ return typeof sc === "number" ? sc >= 128 && sc <= 255 : sc[0] === 2;
1176
+ }
1177
+ isStructSchema() {
1178
+ const sc = this.getSchema();
1179
+ if (typeof sc !== "object") {
1180
+ return false;
1181
+ }
1182
+ const id = sc[0];
1183
+ return id === 3 || id === -3 || id === 4;
1184
+ }
1185
+ isUnionSchema() {
1186
+ const sc = this.getSchema();
1187
+ if (typeof sc !== "object") {
1188
+ return false;
1189
+ }
1190
+ return sc[0] === 4;
1191
+ }
1192
+ isBlobSchema() {
1193
+ const sc = this.getSchema();
1194
+ return sc === 21 || sc === 42;
1195
+ }
1196
+ isTimestampSchema() {
1197
+ const sc = this.getSchema();
1198
+ return typeof sc === "number" && sc >= 4 && sc <= 7;
1199
+ }
1200
+ isUnitSchema() {
1201
+ return this.getSchema() === "unit";
1202
+ }
1203
+ isDocumentSchema() {
1204
+ return this.getSchema() === 15;
1205
+ }
1206
+ isStringSchema() {
1207
+ return this.getSchema() === 0;
1208
+ }
1209
+ isBooleanSchema() {
1210
+ return this.getSchema() === 2;
1211
+ }
1212
+ isNumericSchema() {
1213
+ return this.getSchema() === 1;
1214
+ }
1215
+ isBigIntegerSchema() {
1216
+ return this.getSchema() === 17;
1217
+ }
1218
+ isBigDecimalSchema() {
1219
+ return this.getSchema() === 19;
1220
+ }
1221
+ isStreaming() {
1222
+ const { streaming } = this.getMergedTraits();
1223
+ return !!streaming || this.getSchema() === 42;
1224
+ }
1225
+ isIdempotencyToken() {
1226
+ return !!this.getMergedTraits().idempotencyToken;
1227
+ }
1228
+ getMergedTraits() {
1229
+ return this.normalizedTraits ?? (this.normalizedTraits = {
1230
+ ...this.getOwnTraits(),
1231
+ ...this.getMemberTraits()
1232
+ });
1233
+ }
1234
+ getMemberTraits() {
1235
+ return translateTraits(this.memberTraits);
1236
+ }
1237
+ getOwnTraits() {
1238
+ return translateTraits(this.traits);
1239
+ }
1240
+ getKeySchema() {
1241
+ const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()];
1242
+ if (!isDoc && !isMap) {
1243
+ throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
1244
+ }
1245
+ const schema = this.getSchema();
1246
+ const memberSchema = isDoc ? 15 : schema[4] ?? 0;
1247
+ return member([memberSchema, 0], "key");
1248
+ }
1249
+ getValueSchema() {
1250
+ const sc = this.getSchema();
1251
+ const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()];
1252
+ const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap || isList) ? sc[3 + sc[0]] : isDoc ? 15 : undefined;
1253
+ if (memberSchema != null) {
1254
+ return member([memberSchema, 0], isMap ? "value" : "member");
1255
+ }
1256
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
1257
+ }
1258
+ getMemberSchema(memberName) {
1259
+ const struct2 = this.getSchema();
1260
+ if (this.isStructSchema() && struct2[4].includes(memberName)) {
1261
+ const i = struct2[4].indexOf(memberName);
1262
+ const memberSchema = struct2[5][i];
1263
+ return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName);
1264
+ }
1265
+ if (this.isDocumentSchema()) {
1266
+ return member([15, 0], memberName);
1267
+ }
1268
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${memberName}.`);
1269
+ }
1270
+ getMemberSchemas() {
1271
+ const buffer = {};
1272
+ try {
1273
+ for (const [k, v] of this.structIterator()) {
1274
+ buffer[k] = v;
1275
+ }
1276
+ } catch (ignored) {}
1277
+ return buffer;
1278
+ }
1279
+ getEventStreamMember() {
1280
+ if (this.isStructSchema()) {
1281
+ for (const [memberName, memberSchema] of this.structIterator()) {
1282
+ if (memberSchema.isStreaming() && memberSchema.isStructSchema()) {
1283
+ return memberName;
1284
+ }
1285
+ }
1286
+ }
1287
+ return "";
1288
+ }
1289
+ *structIterator() {
1290
+ if (this.isUnitSchema()) {
1291
+ return;
1292
+ }
1293
+ if (!this.isStructSchema()) {
1294
+ throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
1295
+ }
1296
+ const struct2 = this.getSchema();
1297
+ const z = struct2[4].length;
1298
+ let it = struct2[anno.it];
1299
+ if (it && z === it.length) {
1300
+ yield* it;
1301
+ return;
1302
+ }
1303
+ it = Array(z);
1304
+ for (let i = 0;i < z; ++i) {
1305
+ const k = struct2[4][i];
1306
+ const v = member([struct2[5][i], 0], k);
1307
+ yield it[i] = [k, v];
1308
+ }
1309
+ struct2[anno.it] = it;
1310
+ }
1311
+ }
1312
+ function member(memberSchema, memberName) {
1313
+ if (memberSchema instanceof NormalizedSchema) {
1314
+ return Object.assign(memberSchema, {
1315
+ memberName,
1316
+ _isMemberSchema: true
1317
+ });
1318
+ }
1319
+ const internalCtorAccess = NormalizedSchema;
1320
+ return new internalCtorAccess(memberSchema, memberName);
1321
+ }
1322
+ var isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2;
1323
+ var isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5;
1324
+
1325
+ class SimpleSchema extends Schema {
1326
+ static symbol = Symbol.for("@smithy/sim");
1327
+ name;
1328
+ schemaRef;
1329
+ traits;
1330
+ symbol = SimpleSchema.symbol;
1331
+ }
1332
+ var sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema, {
1333
+ name,
1334
+ namespace,
1335
+ traits,
1336
+ schemaRef
1337
+ });
1338
+ var simAdapter = (namespace, name, traits, schemaRef) => Schema.assign(new SimpleSchema, {
1339
+ name,
1340
+ namespace,
1341
+ traits,
1342
+ schemaRef
1343
+ });
1344
+ var SCHEMA = {
1345
+ BLOB: 21,
1346
+ STREAMING_BLOB: 42,
1347
+ BOOLEAN: 2,
1348
+ STRING: 0,
1349
+ NUMERIC: 1,
1350
+ BIG_INTEGER: 17,
1351
+ BIG_DECIMAL: 19,
1352
+ DOCUMENT: 15,
1353
+ TIMESTAMP_DEFAULT: 4,
1354
+ TIMESTAMP_DATE_TIME: 5,
1355
+ TIMESTAMP_HTTP_DATE: 6,
1356
+ TIMESTAMP_EPOCH_SECONDS: 7,
1357
+ LIST_MODIFIER: 64,
1358
+ MAP_MODIFIER: 128
1359
+ };
1360
+
1361
+ class TypeRegistry {
1362
+ namespace;
1363
+ schemas;
1364
+ exceptions;
1365
+ static registries = new Map;
1366
+ constructor(namespace, schemas = new Map, exceptions = new Map) {
1367
+ this.namespace = namespace;
1368
+ this.schemas = schemas;
1369
+ this.exceptions = exceptions;
1370
+ }
1371
+ static for(namespace) {
1372
+ if (!TypeRegistry.registries.has(namespace)) {
1373
+ TypeRegistry.registries.set(namespace, new TypeRegistry(namespace));
1374
+ }
1375
+ return TypeRegistry.registries.get(namespace);
1376
+ }
1377
+ copyFrom(other) {
1378
+ const { schemas, exceptions } = this;
1379
+ for (const [k, v] of other.schemas) {
1380
+ if (!schemas.has(k)) {
1381
+ schemas.set(k, v);
1382
+ }
1383
+ }
1384
+ for (const [k, v] of other.exceptions) {
1385
+ if (!exceptions.has(k)) {
1386
+ exceptions.set(k, v);
1387
+ }
1388
+ }
1389
+ }
1390
+ register(shapeId, schema) {
1391
+ const qualifiedName = this.normalizeShapeId(shapeId);
1392
+ for (const r of [this, TypeRegistry.for(qualifiedName.split("#")[0])]) {
1393
+ r.schemas.set(qualifiedName, schema);
1394
+ }
1395
+ }
1396
+ getSchema(shapeId) {
1397
+ const id = this.normalizeShapeId(shapeId);
1398
+ if (!this.schemas.has(id)) {
1399
+ throw new Error(`@smithy/core/schema - schema not found for ${id}`);
1400
+ }
1401
+ return this.schemas.get(id);
1402
+ }
1403
+ registerError(es, ctor) {
1404
+ const $error2 = es;
1405
+ const ns = $error2[1];
1406
+ for (const r of [this, TypeRegistry.for(ns)]) {
1407
+ r.schemas.set(ns + "#" + $error2[2], $error2);
1408
+ r.exceptions.set($error2, ctor);
1409
+ }
1410
+ }
1411
+ getErrorCtor(es) {
1412
+ const $error2 = es;
1413
+ if (this.exceptions.has($error2)) {
1414
+ return this.exceptions.get($error2);
1415
+ }
1416
+ const registry = TypeRegistry.for($error2[1]);
1417
+ return registry.exceptions.get($error2);
1418
+ }
1419
+ getBaseException() {
1420
+ for (const exceptionKey of this.exceptions.keys()) {
1421
+ if (Array.isArray(exceptionKey)) {
1422
+ const [, ns, name] = exceptionKey;
1423
+ const id = ns + "#" + name;
1424
+ if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) {
1425
+ return exceptionKey;
1426
+ }
1427
+ }
1428
+ }
1429
+ return;
1430
+ }
1431
+ find(predicate) {
1432
+ return [...this.schemas.values()].find(predicate);
1433
+ }
1434
+ clear() {
1435
+ this.schemas.clear();
1436
+ this.exceptions.clear();
1437
+ }
1438
+ normalizeShapeId(shapeId) {
1439
+ if (shapeId.includes("#")) {
1440
+ return shapeId;
1441
+ }
1442
+ return this.namespace + "#" + shapeId;
1443
+ }
1444
+ }
1445
+ exports.ErrorSchema = ErrorSchema;
1446
+ exports.ListSchema = ListSchema;
1447
+ exports.MapSchema = MapSchema;
1448
+ exports.NormalizedSchema = NormalizedSchema;
1449
+ exports.OperationSchema = OperationSchema;
1450
+ exports.SCHEMA = SCHEMA;
1451
+ exports.Schema = Schema;
1452
+ exports.SimpleSchema = SimpleSchema;
1453
+ exports.StructureSchema = StructureSchema;
1454
+ exports.TypeRegistry = TypeRegistry;
1455
+ exports.deref = deref;
1456
+ exports.deserializerMiddlewareOption = deserializerMiddlewareOption;
1457
+ exports.error = error;
1458
+ exports.getSchemaSerdePlugin = getSchemaSerdePlugin;
1459
+ exports.isStaticSchema = isStaticSchema;
1460
+ exports.list = list;
1461
+ exports.map = map;
1462
+ exports.op = op;
1463
+ exports.operation = operation;
1464
+ exports.serializerMiddlewareOption = serializerMiddlewareOption;
1465
+ exports.sim = sim;
1466
+ exports.simAdapter = simAdapter;
1467
+ exports.simpleSchemaCacheN = simpleSchemaCacheN;
1468
+ exports.simpleSchemaCacheS = simpleSchemaCacheS;
1469
+ exports.struct = struct;
1470
+ exports.traitsCache = traitsCache;
1471
+ exports.translateTraits = translateTraits;
1472
+ });
1473
+
1474
+ // node_modules/.bun/@smithy+core@3.23.15/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js
1475
+ var require_serde = __commonJS((exports) => {
1476
+ var uuid = require_dist_cjs6();
1477
+ var copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source;
1478
+ var parseBoolean = (value) => {
1479
+ switch (value) {
1480
+ case "true":
1481
+ return true;
1482
+ case "false":
1483
+ return false;
1484
+ default:
1485
+ throw new Error(`Unable to parse boolean value "${value}"`);
1486
+ }
1487
+ };
1488
+ var expectBoolean = (value) => {
1489
+ if (value === null || value === undefined) {
1490
+ return;
1491
+ }
1492
+ if (typeof value === "number") {
1493
+ if (value === 0 || value === 1) {
1494
+ logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
1495
+ }
1496
+ if (value === 0) {
1497
+ return false;
1498
+ }
1499
+ if (value === 1) {
1500
+ return true;
1501
+ }
1502
+ }
1503
+ if (typeof value === "string") {
1504
+ const lower = value.toLowerCase();
1505
+ if (lower === "false" || lower === "true") {
1506
+ logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
1507
+ }
1508
+ if (lower === "false") {
1509
+ return false;
1510
+ }
1511
+ if (lower === "true") {
1512
+ return true;
1513
+ }
1514
+ }
1515
+ if (typeof value === "boolean") {
1516
+ return value;
1517
+ }
1518
+ throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`);
1519
+ };
1520
+ var expectNumber = (value) => {
1521
+ if (value === null || value === undefined) {
1522
+ return;
1523
+ }
1524
+ if (typeof value === "string") {
1525
+ const parsed = parseFloat(value);
1526
+ if (!Number.isNaN(parsed)) {
1527
+ if (String(parsed) !== String(value)) {
1528
+ logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));
1529
+ }
1530
+ return parsed;
1531
+ }
1532
+ }
1533
+ if (typeof value === "number") {
1534
+ return value;
1535
+ }
1536
+ throw new TypeError(`Expected number, got ${typeof value}: ${value}`);
1537
+ };
1538
+ var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
1539
+ var expectFloat32 = (value) => {
1540
+ const expected = expectNumber(value);
1541
+ if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {
1542
+ if (Math.abs(expected) > MAX_FLOAT) {
1543
+ throw new TypeError(`Expected 32-bit float, got ${value}`);
1544
+ }
1545
+ }
1546
+ return expected;
1547
+ };
1548
+ var expectLong = (value) => {
1549
+ if (value === null || value === undefined) {
1550
+ return;
1551
+ }
1552
+ if (Number.isInteger(value) && !Number.isNaN(value)) {
1553
+ return value;
1554
+ }
1555
+ throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);
1556
+ };
1557
+ var expectInt = expectLong;
1558
+ var expectInt32 = (value) => expectSizedInt(value, 32);
1559
+ var expectShort = (value) => expectSizedInt(value, 16);
1560
+ var expectByte = (value) => expectSizedInt(value, 8);
1561
+ var expectSizedInt = (value, size) => {
1562
+ const expected = expectLong(value);
1563
+ if (expected !== undefined && castInt(expected, size) !== expected) {
1564
+ throw new TypeError(`Expected ${size}-bit integer, got ${value}`);
1565
+ }
1566
+ return expected;
1567
+ };
1568
+ var castInt = (value, size) => {
1569
+ switch (size) {
1570
+ case 32:
1571
+ return Int32Array.of(value)[0];
1572
+ case 16:
1573
+ return Int16Array.of(value)[0];
1574
+ case 8:
1575
+ return Int8Array.of(value)[0];
1576
+ }
1577
+ };
1578
+ var expectNonNull = (value, location) => {
1579
+ if (value === null || value === undefined) {
1580
+ if (location) {
1581
+ throw new TypeError(`Expected a non-null value for ${location}`);
1582
+ }
1583
+ throw new TypeError("Expected a non-null value");
1584
+ }
1585
+ return value;
1586
+ };
1587
+ var expectObject = (value) => {
1588
+ if (value === null || value === undefined) {
1589
+ return;
1590
+ }
1591
+ if (typeof value === "object" && !Array.isArray(value)) {
1592
+ return value;
1593
+ }
1594
+ const receivedType = Array.isArray(value) ? "array" : typeof value;
1595
+ throw new TypeError(`Expected object, got ${receivedType}: ${value}`);
1596
+ };
1597
+ var expectString = (value) => {
1598
+ if (value === null || value === undefined) {
1599
+ return;
1600
+ }
1601
+ if (typeof value === "string") {
1602
+ return value;
1603
+ }
1604
+ if (["boolean", "number", "bigint"].includes(typeof value)) {
1605
+ logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));
1606
+ return String(value);
1607
+ }
1608
+ throw new TypeError(`Expected string, got ${typeof value}: ${value}`);
1609
+ };
1610
+ var expectUnion = (value) => {
1611
+ if (value === null || value === undefined) {
1612
+ return;
1613
+ }
1614
+ const asObject = expectObject(value);
1615
+ const setKeys = Object.entries(asObject).filter(([, v]) => v != null).map(([k]) => k);
1616
+ if (setKeys.length === 0) {
1617
+ throw new TypeError(`Unions must have exactly one non-null member. None were found.`);
1618
+ }
1619
+ if (setKeys.length > 1) {
1620
+ throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`);
1621
+ }
1622
+ return asObject;
1623
+ };
1624
+ var strictParseDouble = (value) => {
1625
+ if (typeof value == "string") {
1626
+ return expectNumber(parseNumber(value));
1627
+ }
1628
+ return expectNumber(value);
1629
+ };
1630
+ var strictParseFloat = strictParseDouble;
1631
+ var strictParseFloat32 = (value) => {
1632
+ if (typeof value == "string") {
1633
+ return expectFloat32(parseNumber(value));
1634
+ }
1635
+ return expectFloat32(value);
1636
+ };
1637
+ var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
1638
+ var parseNumber = (value) => {
1639
+ const matches = value.match(NUMBER_REGEX);
1640
+ if (matches === null || matches[0].length !== value.length) {
1641
+ throw new TypeError(`Expected real number, got implicit NaN`);
1642
+ }
1643
+ return parseFloat(value);
1644
+ };
1645
+ var limitedParseDouble = (value) => {
1646
+ if (typeof value == "string") {
1647
+ return parseFloatString(value);
1648
+ }
1649
+ return expectNumber(value);
1650
+ };
1651
+ var handleFloat = limitedParseDouble;
1652
+ var limitedParseFloat = limitedParseDouble;
1653
+ var limitedParseFloat32 = (value) => {
1654
+ if (typeof value == "string") {
1655
+ return parseFloatString(value);
1656
+ }
1657
+ return expectFloat32(value);
1658
+ };
1659
+ var parseFloatString = (value) => {
1660
+ switch (value) {
1661
+ case "NaN":
1662
+ return NaN;
1663
+ case "Infinity":
1664
+ return Infinity;
1665
+ case "-Infinity":
1666
+ return -Infinity;
1667
+ default:
1668
+ throw new Error(`Unable to parse float value: ${value}`);
1669
+ }
1670
+ };
1671
+ var strictParseLong = (value) => {
1672
+ if (typeof value === "string") {
1673
+ return expectLong(parseNumber(value));
1674
+ }
1675
+ return expectLong(value);
1676
+ };
1677
+ var strictParseInt = strictParseLong;
1678
+ var strictParseInt32 = (value) => {
1679
+ if (typeof value === "string") {
1680
+ return expectInt32(parseNumber(value));
1681
+ }
1682
+ return expectInt32(value);
1683
+ };
1684
+ var strictParseShort = (value) => {
1685
+ if (typeof value === "string") {
1686
+ return expectShort(parseNumber(value));
1687
+ }
1688
+ return expectShort(value);
1689
+ };
1690
+ var strictParseByte = (value) => {
1691
+ if (typeof value === "string") {
1692
+ return expectByte(parseNumber(value));
1693
+ }
1694
+ return expectByte(value);
1695
+ };
1696
+ var stackTraceWarning = (message) => {
1697
+ return String(new TypeError(message).stack || message).split(`
1698
+ `).slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join(`
1699
+ `);
1700
+ };
1701
+ var logger = {
1702
+ warn: console.warn
1703
+ };
1704
+ var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
1705
+ var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
1706
+ function dateToUtcString(date2) {
1707
+ const year2 = date2.getUTCFullYear();
1708
+ const month = date2.getUTCMonth();
1709
+ const dayOfWeek = date2.getUTCDay();
1710
+ const dayOfMonthInt = date2.getUTCDate();
1711
+ const hoursInt = date2.getUTCHours();
1712
+ const minutesInt = date2.getUTCMinutes();
1713
+ const secondsInt = date2.getUTCSeconds();
1714
+ const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;
1715
+ const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;
1716
+ const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;
1717
+ const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;
1718
+ return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year2} ${hoursString}:${minutesString}:${secondsString} GMT`;
1719
+ }
1720
+ var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);
1721
+ var parseRfc3339DateTime = (value) => {
1722
+ if (value === null || value === undefined) {
1723
+ return;
1724
+ }
1725
+ if (typeof value !== "string") {
1726
+ throw new TypeError("RFC-3339 date-times must be expressed as strings");
1727
+ }
1728
+ const match = RFC3339.exec(value);
1729
+ if (!match) {
1730
+ throw new TypeError("Invalid RFC-3339 date-time value");
1731
+ }
1732
+ const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;
1733
+ const year2 = strictParseShort(stripLeadingZeroes(yearStr));
1734
+ const month = parseDateValue(monthStr, "month", 1, 12);
1735
+ const day = parseDateValue(dayStr, "day", 1, 31);
1736
+ return buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds });
1737
+ };
1738
+ var RFC3339_WITH_OFFSET$1 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/);
1739
+ var parseRfc3339DateTimeWithOffset = (value) => {
1740
+ if (value === null || value === undefined) {
1741
+ return;
1742
+ }
1743
+ if (typeof value !== "string") {
1744
+ throw new TypeError("RFC-3339 date-times must be expressed as strings");
1745
+ }
1746
+ const match = RFC3339_WITH_OFFSET$1.exec(value);
1747
+ if (!match) {
1748
+ throw new TypeError("Invalid RFC-3339 date-time value");
1749
+ }
1750
+ const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;
1751
+ const year2 = strictParseShort(stripLeadingZeroes(yearStr));
1752
+ const month = parseDateValue(monthStr, "month", 1, 12);
1753
+ const day = parseDateValue(dayStr, "day", 1, 31);
1754
+ const date2 = buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds });
1755
+ if (offsetStr.toUpperCase() != "Z") {
1756
+ date2.setTime(date2.getTime() - parseOffsetToMilliseconds(offsetStr));
1757
+ }
1758
+ return date2;
1759
+ };
1760
+ var IMF_FIXDATE$1 = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
1761
+ var RFC_850_DATE$1 = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
1762
+ var ASC_TIME$1 = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);
1763
+ var parseRfc7231DateTime = (value) => {
1764
+ if (value === null || value === undefined) {
1765
+ return;
1766
+ }
1767
+ if (typeof value !== "string") {
1768
+ throw new TypeError("RFC-7231 date-times must be expressed as strings");
1769
+ }
1770
+ let match = IMF_FIXDATE$1.exec(value);
1771
+ if (match) {
1772
+ const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
1773
+ return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
1774
+ }
1775
+ match = RFC_850_DATE$1.exec(value);
1776
+ if (match) {
1777
+ const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
1778
+ return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), {
1779
+ hours,
1780
+ minutes,
1781
+ seconds,
1782
+ fractionalMilliseconds
1783
+ }));
1784
+ }
1785
+ match = ASC_TIME$1.exec(value);
1786
+ if (match) {
1787
+ const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;
1788
+ return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
1789
+ }
1790
+ throw new TypeError("Invalid RFC-7231 date-time value");
1791
+ };
1792
+ var parseEpochTimestamp = (value) => {
1793
+ if (value === null || value === undefined) {
1794
+ return;
1795
+ }
1796
+ let valueAsDouble;
1797
+ if (typeof value === "number") {
1798
+ valueAsDouble = value;
1799
+ } else if (typeof value === "string") {
1800
+ valueAsDouble = strictParseDouble(value);
1801
+ } else if (typeof value === "object" && value.tag === 1) {
1802
+ valueAsDouble = value.value;
1803
+ } else {
1804
+ throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");
1805
+ }
1806
+ if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) {
1807
+ throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");
1808
+ }
1809
+ return new Date(Math.round(valueAsDouble * 1000));
1810
+ };
1811
+ var buildDate = (year2, month, day, time2) => {
1812
+ const adjustedMonth = month - 1;
1813
+ validateDayOfMonth(year2, adjustedMonth, day);
1814
+ return new Date(Date.UTC(year2, adjustedMonth, day, parseDateValue(time2.hours, "hour", 0, 23), parseDateValue(time2.minutes, "minute", 0, 59), parseDateValue(time2.seconds, "seconds", 0, 60), parseMilliseconds(time2.fractionalMilliseconds)));
1815
+ };
1816
+ var parseTwoDigitYear = (value) => {
1817
+ const thisYear = new Date().getUTCFullYear();
1818
+ const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value));
1819
+ if (valueInThisCentury < thisYear) {
1820
+ return valueInThisCentury + 100;
1821
+ }
1822
+ return valueInThisCentury;
1823
+ };
1824
+ var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1000;
1825
+ var adjustRfc850Year = (input) => {
1826
+ if (input.getTime() - new Date().getTime() > FIFTY_YEARS_IN_MILLIS) {
1827
+ return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds()));
1828
+ }
1829
+ return input;
1830
+ };
1831
+ var parseMonthByShortName = (value) => {
1832
+ const monthIdx = MONTHS.indexOf(value);
1833
+ if (monthIdx < 0) {
1834
+ throw new TypeError(`Invalid month: ${value}`);
1835
+ }
1836
+ return monthIdx + 1;
1837
+ };
1838
+ var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1839
+ var validateDayOfMonth = (year2, month, day) => {
1840
+ let maxDays = DAYS_IN_MONTH[month];
1841
+ if (month === 1 && isLeapYear(year2)) {
1842
+ maxDays = 29;
1843
+ }
1844
+ if (day > maxDays) {
1845
+ throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year2}: ${day}`);
1846
+ }
1847
+ };
1848
+ var isLeapYear = (year2) => {
1849
+ return year2 % 4 === 0 && (year2 % 100 !== 0 || year2 % 400 === 0);
1850
+ };
1851
+ var parseDateValue = (value, type, lower, upper) => {
1852
+ const dateVal = strictParseByte(stripLeadingZeroes(value));
1853
+ if (dateVal < lower || dateVal > upper) {
1854
+ throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
1855
+ }
1856
+ return dateVal;
1857
+ };
1858
+ var parseMilliseconds = (value) => {
1859
+ if (value === null || value === undefined) {
1860
+ return 0;
1861
+ }
1862
+ return strictParseFloat32("0." + value) * 1000;
1863
+ };
1864
+ var parseOffsetToMilliseconds = (value) => {
1865
+ const directionStr = value[0];
1866
+ let direction = 1;
1867
+ if (directionStr == "+") {
1868
+ direction = 1;
1869
+ } else if (directionStr == "-") {
1870
+ direction = -1;
1871
+ } else {
1872
+ throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`);
1873
+ }
1874
+ const hour = Number(value.substring(1, 3));
1875
+ const minute = Number(value.substring(4, 6));
1876
+ return direction * (hour * 60 + minute) * 60 * 1000;
1877
+ };
1878
+ var stripLeadingZeroes = (value) => {
1879
+ let idx = 0;
1880
+ while (idx < value.length - 1 && value.charAt(idx) === "0") {
1881
+ idx++;
1882
+ }
1883
+ if (idx === 0) {
1884
+ return value;
1885
+ }
1886
+ return value.slice(idx);
1887
+ };
1888
+ var LazyJsonString = function LazyJsonString2(val) {
1889
+ const str = Object.assign(new String(val), {
1890
+ deserializeJSON() {
1891
+ return JSON.parse(String(val));
1892
+ },
1893
+ toString() {
1894
+ return String(val);
1895
+ },
1896
+ toJSON() {
1897
+ return String(val);
1898
+ }
1899
+ });
1900
+ return str;
1901
+ };
1902
+ LazyJsonString.from = (object) => {
1903
+ if (object && typeof object === "object" && (object instanceof LazyJsonString || ("deserializeJSON" in object))) {
1904
+ return object;
1905
+ } else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) {
1906
+ return LazyJsonString(String(object));
1907
+ }
1908
+ return LazyJsonString(JSON.stringify(object));
1909
+ };
1910
+ LazyJsonString.fromObject = LazyJsonString.from;
1911
+ function quoteHeader(part) {
1912
+ if (part.includes(",") || part.includes('"')) {
1913
+ part = `"${part.replace(/"/g, "\\\"")}"`;
1914
+ }
1915
+ return part;
1916
+ }
1917
+ var ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`;
1918
+ var mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`;
1919
+ var time = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`;
1920
+ var date = `(\\d?\\d)`;
1921
+ var year = `(\\d{4})`;
1922
+ var RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/);
1923
+ var IMF_FIXDATE = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`);
1924
+ var RFC_850_DATE = new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time} GMT$`);
1925
+ var ASC_TIME = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} ${year}$`);
1926
+ var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
1927
+ var _parseEpochTimestamp = (value) => {
1928
+ if (value == null) {
1929
+ return;
1930
+ }
1931
+ let num = NaN;
1932
+ if (typeof value === "number") {
1933
+ num = value;
1934
+ } else if (typeof value === "string") {
1935
+ if (!/^-?\d*\.?\d+$/.test(value)) {
1936
+ throw new TypeError(`parseEpochTimestamp - numeric string invalid.`);
1937
+ }
1938
+ num = Number.parseFloat(value);
1939
+ } else if (typeof value === "object" && value.tag === 1) {
1940
+ num = value.value;
1941
+ }
1942
+ if (isNaN(num) || Math.abs(num) === Infinity) {
1943
+ throw new TypeError("Epoch timestamps must be valid finite numbers.");
1944
+ }
1945
+ return new Date(Math.round(num * 1000));
1946
+ };
1947
+ var _parseRfc3339DateTimeWithOffset = (value) => {
1948
+ if (value == null) {
1949
+ return;
1950
+ }
1951
+ if (typeof value !== "string") {
1952
+ throw new TypeError("RFC3339 timestamps must be strings");
1953
+ }
1954
+ const matches = RFC3339_WITH_OFFSET.exec(value);
1955
+ if (!matches) {
1956
+ throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
1957
+ }
1958
+ const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;
1959
+ range(monthStr, 1, 12);
1960
+ range(dayStr, 1, 31);
1961
+ range(hours, 0, 23);
1962
+ range(minutes, 0, 59);
1963
+ range(seconds, 0, 60);
1964
+ const date2 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1000) : 0));
1965
+ date2.setUTCFullYear(Number(yearStr));
1966
+ if (offsetStr.toUpperCase() != "Z") {
1967
+ const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [undefined, "+", 0, 0];
1968
+ const scalar = sign === "-" ? 1 : -1;
1969
+ date2.setTime(date2.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1000 + Number(offsetM) * 60 * 1000));
1970
+ }
1971
+ return date2;
1972
+ };
1973
+ var _parseRfc7231DateTime = (value) => {
1974
+ if (value == null) {
1975
+ return;
1976
+ }
1977
+ if (typeof value !== "string") {
1978
+ throw new TypeError("RFC7231 timestamps must be strings.");
1979
+ }
1980
+ let day;
1981
+ let month;
1982
+ let year2;
1983
+ let hour;
1984
+ let minute;
1985
+ let second;
1986
+ let fraction;
1987
+ let matches;
1988
+ if (matches = IMF_FIXDATE.exec(value)) {
1989
+ [, day, month, year2, hour, minute, second, fraction] = matches;
1990
+ } else if (matches = RFC_850_DATE.exec(value)) {
1991
+ [, day, month, year2, hour, minute, second, fraction] = matches;
1992
+ year2 = (Number(year2) + 1900).toString();
1993
+ } else if (matches = ASC_TIME.exec(value)) {
1994
+ [, month, day, hour, minute, second, fraction, year2] = matches;
1995
+ }
1996
+ if (year2 && second) {
1997
+ const timestamp = Date.UTC(Number(year2), months.indexOf(month), Number(day), Number(hour), Number(minute), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1000) : 0);
1998
+ range(day, 1, 31);
1999
+ range(hour, 0, 23);
2000
+ range(minute, 0, 59);
2001
+ range(second, 0, 60);
2002
+ const date2 = new Date(timestamp);
2003
+ date2.setUTCFullYear(Number(year2));
2004
+ return date2;
2005
+ }
2006
+ throw new TypeError(`Invalid RFC7231 date-time value ${value}.`);
2007
+ };
2008
+ function range(v, min, max) {
2009
+ const _v = Number(v);
2010
+ if (_v < min || _v > max) {
2011
+ throw new Error(`Value ${_v} out of range [${min}, ${max}]`);
2012
+ }
2013
+ }
2014
+ function splitEvery(value, delimiter, numDelimiters) {
2015
+ if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {
2016
+ throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery.");
2017
+ }
2018
+ const segments = value.split(delimiter);
2019
+ if (numDelimiters === 1) {
2020
+ return segments;
2021
+ }
2022
+ const compoundSegments = [];
2023
+ let currentSegment = "";
2024
+ for (let i = 0;i < segments.length; i++) {
2025
+ if (currentSegment === "") {
2026
+ currentSegment = segments[i];
2027
+ } else {
2028
+ currentSegment += delimiter + segments[i];
2029
+ }
2030
+ if ((i + 1) % numDelimiters === 0) {
2031
+ compoundSegments.push(currentSegment);
2032
+ currentSegment = "";
2033
+ }
2034
+ }
2035
+ if (currentSegment !== "") {
2036
+ compoundSegments.push(currentSegment);
2037
+ }
2038
+ return compoundSegments;
2039
+ }
2040
+ var splitHeader = (value) => {
2041
+ const z = value.length;
2042
+ const values = [];
2043
+ let withinQuotes = false;
2044
+ let prevChar = undefined;
2045
+ let anchor = 0;
2046
+ for (let i = 0;i < z; ++i) {
2047
+ const char = value[i];
2048
+ switch (char) {
2049
+ case `"`:
2050
+ if (prevChar !== "\\") {
2051
+ withinQuotes = !withinQuotes;
2052
+ }
2053
+ break;
2054
+ case ",":
2055
+ if (!withinQuotes) {
2056
+ values.push(value.slice(anchor, i));
2057
+ anchor = i + 1;
2058
+ }
2059
+ break;
2060
+ }
2061
+ prevChar = char;
2062
+ }
2063
+ values.push(value.slice(anchor));
2064
+ return values.map((v) => {
2065
+ v = v.trim();
2066
+ const z2 = v.length;
2067
+ if (z2 < 2) {
2068
+ return v;
2069
+ }
2070
+ if (v[0] === `"` && v[z2 - 1] === `"`) {
2071
+ v = v.slice(1, z2 - 1);
2072
+ }
2073
+ return v.replace(/\\"/g, '"');
2074
+ });
2075
+ };
2076
+ var format = /^-?\d*(\.\d+)?$/;
2077
+
2078
+ class NumericValue {
2079
+ string;
2080
+ type;
2081
+ constructor(string, type) {
2082
+ this.string = string;
2083
+ this.type = type;
2084
+ if (!format.test(string)) {
2085
+ throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
2086
+ }
2087
+ }
2088
+ toString() {
2089
+ return this.string;
2090
+ }
2091
+ static [Symbol.hasInstance](object) {
2092
+ if (!object || typeof object !== "object") {
2093
+ return false;
2094
+ }
2095
+ const _nv = object;
2096
+ return NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format.test(_nv.string);
2097
+ }
2098
+ }
2099
+ function nv(input) {
2100
+ return new NumericValue(String(input), "bigDecimal");
2101
+ }
2102
+ exports.generateIdempotencyToken = uuid.v4;
2103
+ exports.LazyJsonString = LazyJsonString;
2104
+ exports.NumericValue = NumericValue;
2105
+ exports._parseEpochTimestamp = _parseEpochTimestamp;
2106
+ exports._parseRfc3339DateTimeWithOffset = _parseRfc3339DateTimeWithOffset;
2107
+ exports._parseRfc7231DateTime = _parseRfc7231DateTime;
2108
+ exports.copyDocumentWithTransform = copyDocumentWithTransform;
2109
+ exports.dateToUtcString = dateToUtcString;
2110
+ exports.expectBoolean = expectBoolean;
2111
+ exports.expectByte = expectByte;
2112
+ exports.expectFloat32 = expectFloat32;
2113
+ exports.expectInt = expectInt;
2114
+ exports.expectInt32 = expectInt32;
2115
+ exports.expectLong = expectLong;
2116
+ exports.expectNonNull = expectNonNull;
2117
+ exports.expectNumber = expectNumber;
2118
+ exports.expectObject = expectObject;
2119
+ exports.expectShort = expectShort;
2120
+ exports.expectString = expectString;
2121
+ exports.expectUnion = expectUnion;
2122
+ exports.handleFloat = handleFloat;
2123
+ exports.limitedParseDouble = limitedParseDouble;
2124
+ exports.limitedParseFloat = limitedParseFloat;
2125
+ exports.limitedParseFloat32 = limitedParseFloat32;
2126
+ exports.logger = logger;
2127
+ exports.nv = nv;
2128
+ exports.parseBoolean = parseBoolean;
2129
+ exports.parseEpochTimestamp = parseEpochTimestamp;
2130
+ exports.parseRfc3339DateTime = parseRfc3339DateTime;
2131
+ exports.parseRfc3339DateTimeWithOffset = parseRfc3339DateTimeWithOffset;
2132
+ exports.parseRfc7231DateTime = parseRfc7231DateTime;
2133
+ exports.quoteHeader = quoteHeader;
2134
+ exports.splitEvery = splitEvery;
2135
+ exports.splitHeader = splitHeader;
2136
+ exports.strictParseByte = strictParseByte;
2137
+ exports.strictParseDouble = strictParseDouble;
2138
+ exports.strictParseFloat = strictParseFloat;
2139
+ exports.strictParseFloat32 = strictParseFloat32;
2140
+ exports.strictParseInt = strictParseInt;
2141
+ exports.strictParseInt32 = strictParseInt32;
2142
+ exports.strictParseLong = strictParseLong;
2143
+ exports.strictParseShort = strictParseShort;
2144
+ });
2145
+
2146
+ // node_modules/.bun/@smithy+core@3.23.15/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js
2147
+ var require_protocols = __commonJS((exports) => {
2148
+ var utilStream = require_dist_cjs12();
2149
+ var schema = require_schema();
2150
+ var serde = require_serde();
2151
+ var protocolHttp = require_dist_cjs2();
2152
+ var utilBase64 = require_dist_cjs9();
2153
+ var utilUtf8 = require_dist_cjs8();
2154
+ var collectBody = async (streamBody = new Uint8Array, context) => {
2155
+ if (streamBody instanceof Uint8Array) {
2156
+ return utilStream.Uint8ArrayBlobAdapter.mutate(streamBody);
2157
+ }
2158
+ if (!streamBody) {
2159
+ return utilStream.Uint8ArrayBlobAdapter.mutate(new Uint8Array);
2160
+ }
2161
+ const fromContext = context.streamCollector(streamBody);
2162
+ return utilStream.Uint8ArrayBlobAdapter.mutate(await fromContext);
2163
+ };
2164
+ function extendedEncodeURIComponent(str) {
2165
+ return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
2166
+ return "%" + c.charCodeAt(0).toString(16).toUpperCase();
2167
+ });
2168
+ }
2169
+
2170
+ class SerdeContext {
2171
+ serdeContext;
2172
+ setSerdeContext(serdeContext) {
2173
+ this.serdeContext = serdeContext;
2174
+ }
2175
+ }
2176
+
2177
+ class HttpProtocol extends SerdeContext {
2178
+ options;
2179
+ compositeErrorRegistry;
2180
+ constructor(options) {
2181
+ super();
2182
+ this.options = options;
2183
+ this.compositeErrorRegistry = schema.TypeRegistry.for(options.defaultNamespace);
2184
+ for (const etr of options.errorTypeRegistries ?? []) {
2185
+ this.compositeErrorRegistry.copyFrom(etr);
2186
+ }
2187
+ }
2188
+ getRequestType() {
2189
+ return protocolHttp.HttpRequest;
2190
+ }
2191
+ getResponseType() {
2192
+ return protocolHttp.HttpResponse;
2193
+ }
2194
+ setSerdeContext(serdeContext) {
2195
+ this.serdeContext = serdeContext;
2196
+ this.serializer.setSerdeContext(serdeContext);
2197
+ this.deserializer.setSerdeContext(serdeContext);
2198
+ if (this.getPayloadCodec()) {
2199
+ this.getPayloadCodec().setSerdeContext(serdeContext);
2200
+ }
2201
+ }
2202
+ updateServiceEndpoint(request, endpoint) {
2203
+ if ("url" in endpoint) {
2204
+ request.protocol = endpoint.url.protocol;
2205
+ request.hostname = endpoint.url.hostname;
2206
+ request.port = endpoint.url.port ? Number(endpoint.url.port) : undefined;
2207
+ request.path = endpoint.url.pathname;
2208
+ request.fragment = endpoint.url.hash || undefined;
2209
+ request.username = endpoint.url.username || undefined;
2210
+ request.password = endpoint.url.password || undefined;
2211
+ if (!request.query) {
2212
+ request.query = {};
2213
+ }
2214
+ for (const [k, v] of endpoint.url.searchParams.entries()) {
2215
+ request.query[k] = v;
2216
+ }
2217
+ if (endpoint.headers) {
2218
+ for (const [name, values] of Object.entries(endpoint.headers)) {
2219
+ request.headers[name] = values.join(", ");
2220
+ }
2221
+ }
2222
+ return request;
2223
+ } else {
2224
+ request.protocol = endpoint.protocol;
2225
+ request.hostname = endpoint.hostname;
2226
+ request.port = endpoint.port ? Number(endpoint.port) : undefined;
2227
+ request.path = endpoint.path;
2228
+ request.query = {
2229
+ ...endpoint.query
2230
+ };
2231
+ if (endpoint.headers) {
2232
+ for (const [name, value] of Object.entries(endpoint.headers)) {
2233
+ request.headers[name] = value;
2234
+ }
2235
+ }
2236
+ return request;
2237
+ }
2238
+ }
2239
+ setHostPrefix(request, operationSchema, input) {
2240
+ if (this.serdeContext?.disableHostPrefix) {
2241
+ return;
2242
+ }
2243
+ const inputNs = schema.NormalizedSchema.of(operationSchema.input);
2244
+ const opTraits = schema.translateTraits(operationSchema.traits ?? {});
2245
+ if (opTraits.endpoint) {
2246
+ let hostPrefix = opTraits.endpoint?.[0];
2247
+ if (typeof hostPrefix === "string") {
2248
+ const hostLabelInputs = [...inputNs.structIterator()].filter(([, member]) => member.getMergedTraits().hostLabel);
2249
+ for (const [name] of hostLabelInputs) {
2250
+ const replacement = input[name];
2251
+ if (typeof replacement !== "string") {
2252
+ throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`);
2253
+ }
2254
+ hostPrefix = hostPrefix.replace(`{${name}}`, replacement);
2255
+ }
2256
+ request.hostname = hostPrefix + request.hostname;
2257
+ }
2258
+ }
2259
+ }
2260
+ deserializeMetadata(output) {
2261
+ return {
2262
+ httpStatusCode: output.statusCode,
2263
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
2264
+ extendedRequestId: output.headers["x-amz-id-2"],
2265
+ cfId: output.headers["x-amz-cf-id"]
2266
+ };
2267
+ }
2268
+ async serializeEventStream({ eventStream, requestSchema, initialRequest }) {
2269
+ const eventStreamSerde = await this.loadEventStreamCapability();
2270
+ return eventStreamSerde.serializeEventStream({
2271
+ eventStream,
2272
+ requestSchema,
2273
+ initialRequest
2274
+ });
2275
+ }
2276
+ async deserializeEventStream({ response, responseSchema, initialResponseContainer }) {
2277
+ const eventStreamSerde = await this.loadEventStreamCapability();
2278
+ return eventStreamSerde.deserializeEventStream({
2279
+ response,
2280
+ responseSchema,
2281
+ initialResponseContainer
2282
+ });
2283
+ }
2284
+ async loadEventStreamCapability() {
2285
+ const { EventStreamSerde } = await import("./chunk-chs5qm8d.js");
2286
+ return new EventStreamSerde({
2287
+ marshaller: this.getEventStreamMarshaller(),
2288
+ serializer: this.serializer,
2289
+ deserializer: this.deserializer,
2290
+ serdeContext: this.serdeContext,
2291
+ defaultContentType: this.getDefaultContentType()
2292
+ });
2293
+ }
2294
+ getDefaultContentType() {
2295
+ throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);
2296
+ }
2297
+ async deserializeHttpMessage(schema2, context, response, arg4, arg5) {
2298
+ return [];
2299
+ }
2300
+ getEventStreamMarshaller() {
2301
+ const context = this.serdeContext;
2302
+ if (!context.eventStreamMarshaller) {
2303
+ throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");
2304
+ }
2305
+ return context.eventStreamMarshaller;
2306
+ }
2307
+ }
2308
+
2309
+ class HttpBindingProtocol extends HttpProtocol {
2310
+ async serializeRequest(operationSchema, _input, context) {
2311
+ const input = _input && typeof _input === "object" ? _input : {};
2312
+ const serializer = this.serializer;
2313
+ const query = {};
2314
+ const headers = {};
2315
+ const endpoint = await context.endpoint();
2316
+ const ns = schema.NormalizedSchema.of(operationSchema?.input);
2317
+ const payloadMemberNames = [];
2318
+ const payloadMemberSchemas = [];
2319
+ let hasNonHttpBindingMember = false;
2320
+ let payload;
2321
+ const request = new protocolHttp.HttpRequest({
2322
+ protocol: "",
2323
+ hostname: "",
2324
+ port: undefined,
2325
+ path: "",
2326
+ fragment: undefined,
2327
+ query,
2328
+ headers,
2329
+ body: undefined
2330
+ });
2331
+ if (endpoint) {
2332
+ this.updateServiceEndpoint(request, endpoint);
2333
+ this.setHostPrefix(request, operationSchema, input);
2334
+ const opTraits = schema.translateTraits(operationSchema.traits);
2335
+ if (opTraits.http) {
2336
+ request.method = opTraits.http[0];
2337
+ const [path, search] = opTraits.http[1].split("?");
2338
+ if (request.path == "/") {
2339
+ request.path = path;
2340
+ } else {
2341
+ request.path += path;
2342
+ }
2343
+ const traitSearchParams = new URLSearchParams(search ?? "");
2344
+ Object.assign(query, Object.fromEntries(traitSearchParams));
2345
+ }
2346
+ }
2347
+ for (const [memberName, memberNs] of ns.structIterator()) {
2348
+ const memberTraits = memberNs.getMergedTraits() ?? {};
2349
+ const inputMemberValue = input[memberName];
2350
+ if (inputMemberValue == null && !memberNs.isIdempotencyToken()) {
2351
+ if (memberTraits.httpLabel) {
2352
+ if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) {
2353
+ throw new Error(`No value provided for input HTTP label: ${memberName}.`);
2354
+ }
2355
+ }
2356
+ continue;
2357
+ }
2358
+ if (memberTraits.httpPayload) {
2359
+ const isStreaming = memberNs.isStreaming();
2360
+ if (isStreaming) {
2361
+ const isEventStream = memberNs.isStructSchema();
2362
+ if (isEventStream) {
2363
+ if (input[memberName]) {
2364
+ payload = await this.serializeEventStream({
2365
+ eventStream: input[memberName],
2366
+ requestSchema: ns
2367
+ });
2368
+ }
2369
+ } else {
2370
+ payload = inputMemberValue;
2371
+ }
2372
+ } else {
2373
+ serializer.write(memberNs, inputMemberValue);
2374
+ payload = serializer.flush();
2375
+ }
2376
+ } else if (memberTraits.httpLabel) {
2377
+ serializer.write(memberNs, inputMemberValue);
2378
+ const replacement = serializer.flush();
2379
+ if (request.path.includes(`{${memberName}+}`)) {
2380
+ request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/"));
2381
+ } else if (request.path.includes(`{${memberName}}`)) {
2382
+ request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));
2383
+ }
2384
+ } else if (memberTraits.httpHeader) {
2385
+ serializer.write(memberNs, inputMemberValue);
2386
+ headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
2387
+ } else if (typeof memberTraits.httpPrefixHeaders === "string") {
2388
+ for (const [key, val] of Object.entries(inputMemberValue)) {
2389
+ const amalgam = memberTraits.httpPrefixHeaders + key;
2390
+ serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
2391
+ headers[amalgam.toLowerCase()] = serializer.flush();
2392
+ }
2393
+ } else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {
2394
+ this.serializeQuery(memberNs, inputMemberValue, query);
2395
+ } else {
2396
+ hasNonHttpBindingMember = true;
2397
+ payloadMemberNames.push(memberName);
2398
+ payloadMemberSchemas.push(memberNs);
2399
+ }
2400
+ }
2401
+ if (hasNonHttpBindingMember && input) {
2402
+ const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#");
2403
+ const requiredMembers = ns.getSchema()[6];
2404
+ const payloadSchema = [
2405
+ 3,
2406
+ namespace,
2407
+ name,
2408
+ ns.getMergedTraits(),
2409
+ payloadMemberNames,
2410
+ payloadMemberSchemas,
2411
+ undefined
2412
+ ];
2413
+ if (requiredMembers) {
2414
+ payloadSchema[6] = requiredMembers;
2415
+ } else {
2416
+ payloadSchema.pop();
2417
+ }
2418
+ serializer.write(payloadSchema, input);
2419
+ payload = serializer.flush();
2420
+ }
2421
+ request.headers = headers;
2422
+ request.query = query;
2423
+ request.body = payload;
2424
+ return request;
2425
+ }
2426
+ serializeQuery(ns, data, query) {
2427
+ const serializer = this.serializer;
2428
+ const traits = ns.getMergedTraits();
2429
+ if (traits.httpQueryParams) {
2430
+ for (const [key, val] of Object.entries(data)) {
2431
+ if (!(key in query)) {
2432
+ const valueSchema = ns.getValueSchema();
2433
+ Object.assign(valueSchema.getMergedTraits(), {
2434
+ ...traits,
2435
+ httpQuery: key,
2436
+ httpQueryParams: undefined
2437
+ });
2438
+ this.serializeQuery(valueSchema, val, query);
2439
+ }
2440
+ }
2441
+ return;
2442
+ }
2443
+ if (ns.isListSchema()) {
2444
+ const sparse = !!ns.getMergedTraits().sparse;
2445
+ const buffer = [];
2446
+ for (const item of data) {
2447
+ serializer.write([ns.getValueSchema(), traits], item);
2448
+ const serializable = serializer.flush();
2449
+ if (sparse || serializable !== undefined) {
2450
+ buffer.push(serializable);
2451
+ }
2452
+ }
2453
+ query[traits.httpQuery] = buffer;
2454
+ } else {
2455
+ serializer.write([ns, traits], data);
2456
+ query[traits.httpQuery] = serializer.flush();
2457
+ }
2458
+ }
2459
+ async deserializeResponse(operationSchema, context, response) {
2460
+ const deserializer = this.deserializer;
2461
+ const ns = schema.NormalizedSchema.of(operationSchema.output);
2462
+ const dataObject = {};
2463
+ if (response.statusCode >= 300) {
2464
+ const bytes = await collectBody(response.body, context);
2465
+ if (bytes.byteLength > 0) {
2466
+ Object.assign(dataObject, await deserializer.read(15, bytes));
2467
+ }
2468
+ await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
2469
+ throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
2470
+ }
2471
+ for (const header in response.headers) {
2472
+ const value = response.headers[header];
2473
+ delete response.headers[header];
2474
+ response.headers[header.toLowerCase()] = value;
2475
+ }
2476
+ const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject);
2477
+ if (nonHttpBindingMembers.length) {
2478
+ const bytes = await collectBody(response.body, context);
2479
+ if (bytes.byteLength > 0) {
2480
+ const dataFromBody = await deserializer.read(ns, bytes);
2481
+ for (const member of nonHttpBindingMembers) {
2482
+ if (dataFromBody[member] != null) {
2483
+ dataObject[member] = dataFromBody[member];
2484
+ }
2485
+ }
2486
+ }
2487
+ } else if (nonHttpBindingMembers.discardResponseBody) {
2488
+ await collectBody(response.body, context);
2489
+ }
2490
+ dataObject.$metadata = this.deserializeMetadata(response);
2491
+ return dataObject;
2492
+ }
2493
+ async deserializeHttpMessage(schema$1, context, response, arg4, arg5) {
2494
+ let dataObject;
2495
+ if (arg4 instanceof Set) {
2496
+ dataObject = arg5;
2497
+ } else {
2498
+ dataObject = arg4;
2499
+ }
2500
+ let discardResponseBody = true;
2501
+ const deserializer = this.deserializer;
2502
+ const ns = schema.NormalizedSchema.of(schema$1);
2503
+ const nonHttpBindingMembers = [];
2504
+ for (const [memberName, memberSchema] of ns.structIterator()) {
2505
+ const memberTraits = memberSchema.getMemberTraits();
2506
+ if (memberTraits.httpPayload) {
2507
+ discardResponseBody = false;
2508
+ const isStreaming = memberSchema.isStreaming();
2509
+ if (isStreaming) {
2510
+ const isEventStream = memberSchema.isStructSchema();
2511
+ if (isEventStream) {
2512
+ dataObject[memberName] = await this.deserializeEventStream({
2513
+ response,
2514
+ responseSchema: ns
2515
+ });
2516
+ } else {
2517
+ dataObject[memberName] = utilStream.sdkStreamMixin(response.body);
2518
+ }
2519
+ } else if (response.body) {
2520
+ const bytes = await collectBody(response.body, context);
2521
+ if (bytes.byteLength > 0) {
2522
+ dataObject[memberName] = await deserializer.read(memberSchema, bytes);
2523
+ }
2524
+ }
2525
+ } else if (memberTraits.httpHeader) {
2526
+ const key = String(memberTraits.httpHeader).toLowerCase();
2527
+ const value = response.headers[key];
2528
+ if (value != null) {
2529
+ if (memberSchema.isListSchema()) {
2530
+ const headerListValueSchema = memberSchema.getValueSchema();
2531
+ headerListValueSchema.getMergedTraits().httpHeader = key;
2532
+ let sections;
2533
+ if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === 4) {
2534
+ sections = serde.splitEvery(value, ",", 2);
2535
+ } else {
2536
+ sections = serde.splitHeader(value);
2537
+ }
2538
+ const list = [];
2539
+ for (const section of sections) {
2540
+ list.push(await deserializer.read(headerListValueSchema, section.trim()));
2541
+ }
2542
+ dataObject[memberName] = list;
2543
+ } else {
2544
+ dataObject[memberName] = await deserializer.read(memberSchema, value);
2545
+ }
2546
+ }
2547
+ } else if (memberTraits.httpPrefixHeaders !== undefined) {
2548
+ dataObject[memberName] = {};
2549
+ for (const [header, value] of Object.entries(response.headers)) {
2550
+ if (header.startsWith(memberTraits.httpPrefixHeaders)) {
2551
+ const valueSchema = memberSchema.getValueSchema();
2552
+ valueSchema.getMergedTraits().httpHeader = header;
2553
+ dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value);
2554
+ }
2555
+ }
2556
+ } else if (memberTraits.httpResponseCode) {
2557
+ dataObject[memberName] = response.statusCode;
2558
+ } else {
2559
+ nonHttpBindingMembers.push(memberName);
2560
+ }
2561
+ }
2562
+ nonHttpBindingMembers.discardResponseBody = discardResponseBody;
2563
+ return nonHttpBindingMembers;
2564
+ }
2565
+ }
2566
+
2567
+ class RpcProtocol extends HttpProtocol {
2568
+ async serializeRequest(operationSchema, _input, context) {
2569
+ const serializer = this.serializer;
2570
+ const query = {};
2571
+ const headers = {};
2572
+ const endpoint = await context.endpoint();
2573
+ const ns = schema.NormalizedSchema.of(operationSchema?.input);
2574
+ const schema$1 = ns.getSchema();
2575
+ let payload;
2576
+ const input = _input && typeof _input === "object" ? _input : {};
2577
+ const request = new protocolHttp.HttpRequest({
2578
+ protocol: "",
2579
+ hostname: "",
2580
+ port: undefined,
2581
+ path: "/",
2582
+ fragment: undefined,
2583
+ query,
2584
+ headers,
2585
+ body: undefined
2586
+ });
2587
+ if (endpoint) {
2588
+ this.updateServiceEndpoint(request, endpoint);
2589
+ this.setHostPrefix(request, operationSchema, input);
2590
+ }
2591
+ if (input) {
2592
+ const eventStreamMember = ns.getEventStreamMember();
2593
+ if (eventStreamMember) {
2594
+ if (input[eventStreamMember]) {
2595
+ const initialRequest = {};
2596
+ for (const [memberName, memberSchema] of ns.structIterator()) {
2597
+ if (memberName !== eventStreamMember && input[memberName]) {
2598
+ serializer.write(memberSchema, input[memberName]);
2599
+ initialRequest[memberName] = serializer.flush();
2600
+ }
2601
+ }
2602
+ payload = await this.serializeEventStream({
2603
+ eventStream: input[eventStreamMember],
2604
+ requestSchema: ns,
2605
+ initialRequest
2606
+ });
2607
+ }
2608
+ } else {
2609
+ serializer.write(schema$1, input);
2610
+ payload = serializer.flush();
2611
+ }
2612
+ }
2613
+ request.headers = Object.assign(request.headers, headers);
2614
+ request.query = query;
2615
+ request.body = payload;
2616
+ request.method = "POST";
2617
+ return request;
2618
+ }
2619
+ async deserializeResponse(operationSchema, context, response) {
2620
+ const deserializer = this.deserializer;
2621
+ const ns = schema.NormalizedSchema.of(operationSchema.output);
2622
+ const dataObject = {};
2623
+ if (response.statusCode >= 300) {
2624
+ const bytes = await collectBody(response.body, context);
2625
+ if (bytes.byteLength > 0) {
2626
+ Object.assign(dataObject, await deserializer.read(15, bytes));
2627
+ }
2628
+ await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
2629
+ throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
2630
+ }
2631
+ for (const header in response.headers) {
2632
+ const value = response.headers[header];
2633
+ delete response.headers[header];
2634
+ response.headers[header.toLowerCase()] = value;
2635
+ }
2636
+ const eventStreamMember = ns.getEventStreamMember();
2637
+ if (eventStreamMember) {
2638
+ dataObject[eventStreamMember] = await this.deserializeEventStream({
2639
+ response,
2640
+ responseSchema: ns,
2641
+ initialResponseContainer: dataObject
2642
+ });
2643
+ } else {
2644
+ const bytes = await collectBody(response.body, context);
2645
+ if (bytes.byteLength > 0) {
2646
+ Object.assign(dataObject, await deserializer.read(ns, bytes));
2647
+ }
2648
+ }
2649
+ dataObject.$metadata = this.deserializeMetadata(response);
2650
+ return dataObject;
2651
+ }
2652
+ }
2653
+ var resolvedPath = (resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
2654
+ if (input != null && input[memberName] !== undefined) {
2655
+ const labelValue = labelValueProvider();
2656
+ if (labelValue == null || labelValue.length <= 0) {
2657
+ throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
2658
+ }
2659
+ resolvedPath2 = resolvedPath2.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue));
2660
+ } else {
2661
+ throw new Error("No value provided for input HTTP label: " + memberName + ".");
2662
+ }
2663
+ return resolvedPath2;
2664
+ };
2665
+ function requestBuilder(input, context) {
2666
+ return new RequestBuilder(input, context);
2667
+ }
2668
+
2669
+ class RequestBuilder {
2670
+ input;
2671
+ context;
2672
+ query = {};
2673
+ method = "";
2674
+ headers = {};
2675
+ path = "";
2676
+ body = null;
2677
+ hostname = "";
2678
+ resolvePathStack = [];
2679
+ constructor(input, context) {
2680
+ this.input = input;
2681
+ this.context = context;
2682
+ }
2683
+ async build() {
2684
+ const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
2685
+ this.path = basePath;
2686
+ for (const resolvePath of this.resolvePathStack) {
2687
+ resolvePath(this.path);
2688
+ }
2689
+ return new protocolHttp.HttpRequest({
2690
+ protocol,
2691
+ hostname: this.hostname || hostname,
2692
+ port,
2693
+ method: this.method,
2694
+ path: this.path,
2695
+ query: this.query,
2696
+ body: this.body,
2697
+ headers: this.headers
2698
+ });
2699
+ }
2700
+ hn(hostname) {
2701
+ this.hostname = hostname;
2702
+ return this;
2703
+ }
2704
+ bp(uriLabel) {
2705
+ this.resolvePathStack.push((basePath) => {
2706
+ this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
2707
+ });
2708
+ return this;
2709
+ }
2710
+ p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
2711
+ this.resolvePathStack.push((path) => {
2712
+ this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
2713
+ });
2714
+ return this;
2715
+ }
2716
+ h(headers) {
2717
+ this.headers = headers;
2718
+ return this;
2719
+ }
2720
+ q(query) {
2721
+ this.query = query;
2722
+ return this;
2723
+ }
2724
+ b(body) {
2725
+ this.body = body;
2726
+ return this;
2727
+ }
2728
+ m(method) {
2729
+ this.method = method;
2730
+ return this;
2731
+ }
2732
+ }
2733
+ function determineTimestampFormat(ns, settings) {
2734
+ if (settings.timestampFormat.useTrait) {
2735
+ if (ns.isTimestampSchema() && (ns.getSchema() === 5 || ns.getSchema() === 6 || ns.getSchema() === 7)) {
2736
+ return ns.getSchema();
2737
+ }
2738
+ }
2739
+ const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits();
2740
+ const bindingFormat = settings.httpBindings ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) ? 6 : Boolean(httpQuery) || Boolean(httpLabel) ? 5 : undefined : undefined;
2741
+ return bindingFormat ?? settings.timestampFormat.default;
2742
+ }
2743
+
2744
+ class FromStringShapeDeserializer extends SerdeContext {
2745
+ settings;
2746
+ constructor(settings) {
2747
+ super();
2748
+ this.settings = settings;
2749
+ }
2750
+ read(_schema, data) {
2751
+ const ns = schema.NormalizedSchema.of(_schema);
2752
+ if (ns.isListSchema()) {
2753
+ return serde.splitHeader(data).map((item) => this.read(ns.getValueSchema(), item));
2754
+ }
2755
+ if (ns.isBlobSchema()) {
2756
+ return (this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(data);
2757
+ }
2758
+ if (ns.isTimestampSchema()) {
2759
+ const format = determineTimestampFormat(ns, this.settings);
2760
+ switch (format) {
2761
+ case 5:
2762
+ return serde._parseRfc3339DateTimeWithOffset(data);
2763
+ case 6:
2764
+ return serde._parseRfc7231DateTime(data);
2765
+ case 7:
2766
+ return serde._parseEpochTimestamp(data);
2767
+ default:
2768
+ console.warn("Missing timestamp format, parsing value with Date constructor:", data);
2769
+ return new Date(data);
2770
+ }
2771
+ }
2772
+ if (ns.isStringSchema()) {
2773
+ const mediaType = ns.getMergedTraits().mediaType;
2774
+ let intermediateValue = data;
2775
+ if (mediaType) {
2776
+ if (ns.getMergedTraits().httpHeader) {
2777
+ intermediateValue = this.base64ToUtf8(intermediateValue);
2778
+ }
2779
+ const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
2780
+ if (isJson) {
2781
+ intermediateValue = serde.LazyJsonString.from(intermediateValue);
2782
+ }
2783
+ return intermediateValue;
2784
+ }
2785
+ }
2786
+ if (ns.isNumericSchema()) {
2787
+ return Number(data);
2788
+ }
2789
+ if (ns.isBigIntegerSchema()) {
2790
+ return BigInt(data);
2791
+ }
2792
+ if (ns.isBigDecimalSchema()) {
2793
+ return new serde.NumericValue(data, "bigDecimal");
2794
+ }
2795
+ if (ns.isBooleanSchema()) {
2796
+ return String(data).toLowerCase() === "true";
2797
+ }
2798
+ return data;
2799
+ }
2800
+ base64ToUtf8(base64String) {
2801
+ return (this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8)((this.serdeContext?.base64Decoder ?? utilBase64.fromBase64)(base64String));
2802
+ }
2803
+ }
2804
+
2805
+ class HttpInterceptingShapeDeserializer extends SerdeContext {
2806
+ codecDeserializer;
2807
+ stringDeserializer;
2808
+ constructor(codecDeserializer, codecSettings) {
2809
+ super();
2810
+ this.codecDeserializer = codecDeserializer;
2811
+ this.stringDeserializer = new FromStringShapeDeserializer(codecSettings);
2812
+ }
2813
+ setSerdeContext(serdeContext) {
2814
+ this.stringDeserializer.setSerdeContext(serdeContext);
2815
+ this.codecDeserializer.setSerdeContext(serdeContext);
2816
+ this.serdeContext = serdeContext;
2817
+ }
2818
+ read(schema$1, data) {
2819
+ const ns = schema.NormalizedSchema.of(schema$1);
2820
+ const traits = ns.getMergedTraits();
2821
+ const toString = this.serdeContext?.utf8Encoder ?? utilUtf8.toUtf8;
2822
+ if (traits.httpHeader || traits.httpResponseCode) {
2823
+ return this.stringDeserializer.read(ns, toString(data));
2824
+ }
2825
+ if (traits.httpPayload) {
2826
+ if (ns.isBlobSchema()) {
2827
+ const toBytes = this.serdeContext?.utf8Decoder ?? utilUtf8.fromUtf8;
2828
+ if (typeof data === "string") {
2829
+ return toBytes(data);
2830
+ }
2831
+ return data;
2832
+ } else if (ns.isStringSchema()) {
2833
+ if ("byteLength" in data) {
2834
+ return toString(data);
2835
+ }
2836
+ return data;
2837
+ }
2838
+ }
2839
+ return this.codecDeserializer.read(ns, data);
2840
+ }
2841
+ }
2842
+
2843
+ class ToStringShapeSerializer extends SerdeContext {
2844
+ settings;
2845
+ stringBuffer = "";
2846
+ constructor(settings) {
2847
+ super();
2848
+ this.settings = settings;
2849
+ }
2850
+ write(schema$1, value) {
2851
+ const ns = schema.NormalizedSchema.of(schema$1);
2852
+ switch (typeof value) {
2853
+ case "object":
2854
+ if (value === null) {
2855
+ this.stringBuffer = "null";
2856
+ return;
2857
+ }
2858
+ if (ns.isTimestampSchema()) {
2859
+ if (!(value instanceof Date)) {
2860
+ throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`);
2861
+ }
2862
+ const format = determineTimestampFormat(ns, this.settings);
2863
+ switch (format) {
2864
+ case 5:
2865
+ this.stringBuffer = value.toISOString().replace(".000Z", "Z");
2866
+ break;
2867
+ case 6:
2868
+ this.stringBuffer = serde.dateToUtcString(value);
2869
+ break;
2870
+ case 7:
2871
+ this.stringBuffer = String(value.getTime() / 1000);
2872
+ break;
2873
+ default:
2874
+ console.warn("Missing timestamp format, using epoch seconds", value);
2875
+ this.stringBuffer = String(value.getTime() / 1000);
2876
+ }
2877
+ return;
2878
+ }
2879
+ if (ns.isBlobSchema() && "byteLength" in value) {
2880
+ this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(value);
2881
+ return;
2882
+ }
2883
+ if (ns.isListSchema() && Array.isArray(value)) {
2884
+ let buffer = "";
2885
+ for (const item of value) {
2886
+ this.write([ns.getValueSchema(), ns.getMergedTraits()], item);
2887
+ const headerItem = this.flush();
2888
+ const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : serde.quoteHeader(headerItem);
2889
+ if (buffer !== "") {
2890
+ buffer += ", ";
2891
+ }
2892
+ buffer += serialized;
2893
+ }
2894
+ this.stringBuffer = buffer;
2895
+ return;
2896
+ }
2897
+ this.stringBuffer = JSON.stringify(value, null, 2);
2898
+ break;
2899
+ case "string":
2900
+ const mediaType = ns.getMergedTraits().mediaType;
2901
+ let intermediateValue = value;
2902
+ if (mediaType) {
2903
+ const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
2904
+ if (isJson) {
2905
+ intermediateValue = serde.LazyJsonString.from(intermediateValue);
2906
+ }
2907
+ if (ns.getMergedTraits().httpHeader) {
2908
+ this.stringBuffer = (this.serdeContext?.base64Encoder ?? utilBase64.toBase64)(intermediateValue.toString());
2909
+ return;
2910
+ }
2911
+ }
2912
+ this.stringBuffer = value;
2913
+ break;
2914
+ default:
2915
+ if (ns.isIdempotencyToken()) {
2916
+ this.stringBuffer = serde.generateIdempotencyToken();
2917
+ } else {
2918
+ this.stringBuffer = String(value);
2919
+ }
2920
+ }
2921
+ }
2922
+ flush() {
2923
+ const buffer = this.stringBuffer;
2924
+ this.stringBuffer = "";
2925
+ return buffer;
2926
+ }
2927
+ }
2928
+
2929
+ class HttpInterceptingShapeSerializer {
2930
+ codecSerializer;
2931
+ stringSerializer;
2932
+ buffer;
2933
+ constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) {
2934
+ this.codecSerializer = codecSerializer;
2935
+ this.stringSerializer = stringSerializer;
2936
+ }
2937
+ setSerdeContext(serdeContext) {
2938
+ this.codecSerializer.setSerdeContext(serdeContext);
2939
+ this.stringSerializer.setSerdeContext(serdeContext);
2940
+ }
2941
+ write(schema$1, value) {
2942
+ const ns = schema.NormalizedSchema.of(schema$1);
2943
+ const traits = ns.getMergedTraits();
2944
+ if (traits.httpHeader || traits.httpLabel || traits.httpQuery) {
2945
+ this.stringSerializer.write(ns, value);
2946
+ this.buffer = this.stringSerializer.flush();
2947
+ return;
2948
+ }
2949
+ return this.codecSerializer.write(ns, value);
2950
+ }
2951
+ flush() {
2952
+ if (this.buffer !== undefined) {
2953
+ const buffer = this.buffer;
2954
+ this.buffer = undefined;
2955
+ return buffer;
2956
+ }
2957
+ return this.codecSerializer.flush();
2958
+ }
2959
+ }
2960
+ exports.FromStringShapeDeserializer = FromStringShapeDeserializer;
2961
+ exports.HttpBindingProtocol = HttpBindingProtocol;
2962
+ exports.HttpInterceptingShapeDeserializer = HttpInterceptingShapeDeserializer;
2963
+ exports.HttpInterceptingShapeSerializer = HttpInterceptingShapeSerializer;
2964
+ exports.HttpProtocol = HttpProtocol;
2965
+ exports.RequestBuilder = RequestBuilder;
2966
+ exports.RpcProtocol = RpcProtocol;
2967
+ exports.SerdeContext = SerdeContext;
2968
+ exports.ToStringShapeSerializer = ToStringShapeSerializer;
2969
+ exports.collectBody = collectBody;
2970
+ exports.determineTimestampFormat = determineTimestampFormat;
2971
+ exports.extendedEncodeURIComponent = extendedEncodeURIComponent;
2972
+ exports.requestBuilder = requestBuilder;
2973
+ exports.resolvedPath = resolvedPath;
2974
+ });
2975
+
2976
+ // node_modules/.bun/@smithy+core@3.23.15/node_modules/@smithy/core/dist-cjs/index.js
2977
+ function convertHttpAuthSchemesToMap(httpAuthSchemes) {
2978
+ const map = new Map;
2979
+ for (const scheme of httpAuthSchemes) {
2980
+ map.set(scheme.schemeId, scheme);
2981
+ }
2982
+ return map;
2983
+ }
2984
+ function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
2985
+ return async function* paginateOperation(config, input, ...additionalArguments) {
2986
+ const _input = input;
2987
+ let token = config.startingToken ?? _input[inputTokenName];
2988
+ let hasNext = true;
2989
+ let page;
2990
+ while (hasNext) {
2991
+ _input[inputTokenName] = token;
2992
+ if (pageSizeTokenName) {
2993
+ _input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize;
2994
+ }
2995
+ if (config.client instanceof ClientCtor) {
2996
+ page = await makePagedClientRequest(CommandCtor, config.client, input, config.withCommand, ...additionalArguments);
2997
+ } else {
2998
+ throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
2999
+ }
3000
+ yield page;
3001
+ const prevToken = token;
3002
+ token = get(page, outputTokenName);
3003
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
3004
+ }
3005
+ return;
3006
+ };
3007
+ }
3008
+ function setFeature(context, feature, value) {
3009
+ if (!context.__smithy_context) {
3010
+ context.__smithy_context = {
3011
+ features: {}
3012
+ };
3013
+ } else if (!context.__smithy_context.features) {
3014
+ context.__smithy_context.features = {};
3015
+ }
3016
+ context.__smithy_context.features[feature] = value;
3017
+ }
3018
+
3019
+ class DefaultIdentityProviderConfig {
3020
+ authSchemes = new Map;
3021
+ constructor(config) {
3022
+ for (const [key, value] of Object.entries(config)) {
3023
+ if (value !== undefined) {
3024
+ this.authSchemes.set(key, value);
3025
+ }
3026
+ }
3027
+ }
3028
+ getIdentityProvider(schemeId) {
3029
+ return this.authSchemes.get(schemeId);
3030
+ }
3031
+ }
3032
+
3033
+ class HttpApiKeyAuthSigner {
3034
+ async sign(httpRequest, identity, signingProperties) {
3035
+ if (!signingProperties) {
3036
+ throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");
3037
+ }
3038
+ if (!signingProperties.name) {
3039
+ throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");
3040
+ }
3041
+ if (!signingProperties.in) {
3042
+ throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");
3043
+ }
3044
+ if (!identity.apiKey) {
3045
+ throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");
3046
+ }
3047
+ const clonedRequest = protocolHttp.HttpRequest.clone(httpRequest);
3048
+ if (signingProperties.in === types.HttpApiKeyAuthLocation.QUERY) {
3049
+ clonedRequest.query[signingProperties.name] = identity.apiKey;
3050
+ } else if (signingProperties.in === types.HttpApiKeyAuthLocation.HEADER) {
3051
+ clonedRequest.headers[signingProperties.name] = signingProperties.scheme ? `${signingProperties.scheme} ${identity.apiKey}` : identity.apiKey;
3052
+ } else {
3053
+ throw new Error("request can only be signed with `apiKey` locations `query` or `header`, " + "but found: `" + signingProperties.in + "`");
3054
+ }
3055
+ return clonedRequest;
3056
+ }
3057
+ }
3058
+
3059
+ class HttpBearerAuthSigner {
3060
+ async sign(httpRequest, identity, signingProperties) {
3061
+ const clonedRequest = protocolHttp.HttpRequest.clone(httpRequest);
3062
+ if (!identity.token) {
3063
+ throw new Error("request could not be signed with `token` since the `token` is not defined");
3064
+ }
3065
+ clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`;
3066
+ return clonedRequest;
3067
+ }
3068
+ }
3069
+
3070
+ class NoAuthSigner {
3071
+ async sign(httpRequest, identity, signingProperties) {
3072
+ return httpRequest;
3073
+ }
3074
+ }
3075
+ var types, protocolHttp, utilMiddleware, protocols, getSmithyContext = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {}), resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => {
3076
+ if (!authSchemePreference || authSchemePreference.length === 0) {
3077
+ return candidateAuthOptions;
3078
+ }
3079
+ const preferredAuthOptions = [];
3080
+ for (const preferredSchemeName of authSchemePreference) {
3081
+ for (const candidateAuthOption of candidateAuthOptions) {
3082
+ const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1];
3083
+ if (candidateAuthSchemeName === preferredSchemeName) {
3084
+ preferredAuthOptions.push(candidateAuthOption);
3085
+ }
3086
+ }
3087
+ }
3088
+ for (const candidateAuthOption of candidateAuthOptions) {
3089
+ if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {
3090
+ preferredAuthOptions.push(candidateAuthOption);
3091
+ }
3092
+ }
3093
+ return preferredAuthOptions;
3094
+ }, httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
3095
+ const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
3096
+ const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
3097
+ const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
3098
+ const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
3099
+ const smithyContext = utilMiddleware.getSmithyContext(context);
3100
+ const failureReasons = [];
3101
+ for (const option of resolvedOptions) {
3102
+ const scheme = authSchemes.get(option.schemeId);
3103
+ if (!scheme) {
3104
+ failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
3105
+ continue;
3106
+ }
3107
+ const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
3108
+ if (!identityProvider) {
3109
+ failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
3110
+ continue;
3111
+ }
3112
+ const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
3113
+ option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
3114
+ option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
3115
+ smithyContext.selectedHttpAuthScheme = {
3116
+ httpAuthOption: option,
3117
+ identity: await identityProvider(option.identityProperties),
3118
+ signer: scheme.signer
3119
+ };
3120
+ break;
3121
+ }
3122
+ if (!smithyContext.selectedHttpAuthScheme) {
3123
+ throw new Error(failureReasons.join(`
3124
+ `));
3125
+ }
3126
+ return next(args);
3127
+ }, httpAuthSchemeEndpointRuleSetMiddlewareOptions, getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
3128
+ applyToStack: (clientStack) => {
3129
+ clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
3130
+ httpAuthSchemeParametersProvider,
3131
+ identityProviderConfigProvider
3132
+ }), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
3133
+ }
3134
+ }), httpAuthSchemeMiddlewareOptions, getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
3135
+ applyToStack: (clientStack) => {
3136
+ clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
3137
+ httpAuthSchemeParametersProvider,
3138
+ identityProviderConfigProvider
3139
+ }), httpAuthSchemeMiddlewareOptions);
3140
+ }
3141
+ }), defaultErrorHandler = (signingProperties) => (error) => {
3142
+ throw error;
3143
+ }, defaultSuccessHandler = (httpResponse, signingProperties) => {}, httpSigningMiddleware = (config) => (next, context) => async (args) => {
3144
+ if (!protocolHttp.HttpRequest.isInstance(args.request)) {
3145
+ return next(args);
3146
+ }
3147
+ const smithyContext = utilMiddleware.getSmithyContext(context);
3148
+ const scheme = smithyContext.selectedHttpAuthScheme;
3149
+ if (!scheme) {
3150
+ throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
3151
+ }
3152
+ const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
3153
+ const output = await next({
3154
+ ...args,
3155
+ request: await signer.sign(args.request, identity, signingProperties)
3156
+ }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
3157
+ (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
3158
+ return output;
3159
+ }, httpSigningMiddlewareOptions, getHttpSigningPlugin = (config) => ({
3160
+ applyToStack: (clientStack) => {
3161
+ clientStack.addRelativeTo(httpSigningMiddleware(), httpSigningMiddlewareOptions);
3162
+ }
3163
+ }), normalizeProvider = (input) => {
3164
+ if (typeof input === "function")
3165
+ return input;
3166
+ const promisified = Promise.resolve(input);
3167
+ return () => promisified;
3168
+ }, makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => {
3169
+ let command = new CommandCtor(input);
3170
+ command = withCommand(command) ?? command;
3171
+ return await client.send(command, ...args);
3172
+ }, get = (fromObject, path) => {
3173
+ let cursor = fromObject;
3174
+ const pathComponents = path.split(".");
3175
+ for (const step of pathComponents) {
3176
+ if (!cursor || typeof cursor !== "object") {
3177
+ return;
3178
+ }
3179
+ cursor = cursor[step];
3180
+ }
3181
+ return cursor;
3182
+ }, createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired(identity) {
3183
+ return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
3184
+ }, EXPIRATION_MS = 300000, isIdentityExpired, doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined, memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
3185
+ if (provider === undefined) {
3186
+ return;
3187
+ }
3188
+ const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
3189
+ let resolved;
3190
+ let pending;
3191
+ let hasResult;
3192
+ let isConstant = false;
3193
+ const coalesceProvider = async (options) => {
3194
+ if (!pending) {
3195
+ pending = normalizedProvider(options);
3196
+ }
3197
+ try {
3198
+ resolved = await pending;
3199
+ hasResult = true;
3200
+ isConstant = false;
3201
+ } finally {
3202
+ pending = undefined;
3203
+ }
3204
+ return resolved;
3205
+ };
3206
+ if (isExpired === undefined) {
3207
+ return async (options) => {
3208
+ if (!hasResult || options?.forceRefresh) {
3209
+ resolved = await coalesceProvider(options);
3210
+ }
3211
+ return resolved;
3212
+ };
3213
+ }
3214
+ return async (options) => {
3215
+ if (!hasResult || options?.forceRefresh) {
3216
+ resolved = await coalesceProvider(options);
3217
+ }
3218
+ if (isConstant) {
3219
+ return resolved;
3220
+ }
3221
+ if (!requiresRefresh(resolved)) {
3222
+ isConstant = true;
3223
+ return resolved;
3224
+ }
3225
+ if (isExpired(resolved)) {
3226
+ await coalesceProvider(options);
3227
+ return resolved;
3228
+ }
3229
+ return resolved;
3230
+ };
3231
+ }, $requestBuilder, $DefaultIdentityProviderConfig, $EXPIRATION_MS, $HttpApiKeyAuthSigner, $HttpBearerAuthSigner, $NoAuthSigner, $createIsIdentityExpiredFunction, $createPaginator, $doesIdentityRequireRefresh, $getHttpAuthSchemeEndpointRuleSetPlugin, $getHttpAuthSchemePlugin, $getHttpSigningPlugin, $getSmithyContext, $httpAuthSchemeEndpointRuleSetMiddlewareOptions, $httpAuthSchemeMiddleware, $httpAuthSchemeMiddlewareOptions, $httpSigningMiddleware, $httpSigningMiddlewareOptions, $isIdentityExpired, $memoizeIdentityProvider, $normalizeProvider, $setFeature;
3232
+ var init_dist_cjs = __esm(() => {
3233
+ types = require_dist_cjs();
3234
+ protocolHttp = require_dist_cjs2();
3235
+ utilMiddleware = require_dist_cjs5();
3236
+ protocols = require_protocols();
3237
+ httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
3238
+ step: "serialize",
3239
+ tags: ["HTTP_AUTH_SCHEME"],
3240
+ name: "httpAuthSchemeMiddleware",
3241
+ override: true,
3242
+ relation: "before",
3243
+ toMiddleware: "endpointV2Middleware"
3244
+ };
3245
+ httpAuthSchemeMiddlewareOptions = {
3246
+ step: "serialize",
3247
+ tags: ["HTTP_AUTH_SCHEME"],
3248
+ name: "httpAuthSchemeMiddleware",
3249
+ override: true,
3250
+ relation: "before",
3251
+ toMiddleware: "serializerMiddleware"
3252
+ };
3253
+ httpSigningMiddlewareOptions = {
3254
+ step: "finalizeRequest",
3255
+ tags: ["HTTP_SIGNING"],
3256
+ name: "httpSigningMiddleware",
3257
+ aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
3258
+ override: true,
3259
+ relation: "after",
3260
+ toMiddleware: "retryMiddleware"
3261
+ };
3262
+ isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
3263
+ $requestBuilder = protocols.requestBuilder;
3264
+ $DefaultIdentityProviderConfig = DefaultIdentityProviderConfig;
3265
+ $EXPIRATION_MS = EXPIRATION_MS;
3266
+ $HttpApiKeyAuthSigner = HttpApiKeyAuthSigner;
3267
+ $HttpBearerAuthSigner = HttpBearerAuthSigner;
3268
+ $NoAuthSigner = NoAuthSigner;
3269
+ $createIsIdentityExpiredFunction = createIsIdentityExpiredFunction;
3270
+ $createPaginator = createPaginator;
3271
+ $doesIdentityRequireRefresh = doesIdentityRequireRefresh;
3272
+ $getHttpAuthSchemeEndpointRuleSetPlugin = getHttpAuthSchemeEndpointRuleSetPlugin;
3273
+ $getHttpAuthSchemePlugin = getHttpAuthSchemePlugin;
3274
+ $getHttpSigningPlugin = getHttpSigningPlugin;
3275
+ $getSmithyContext = getSmithyContext;
3276
+ $httpAuthSchemeEndpointRuleSetMiddlewareOptions = httpAuthSchemeEndpointRuleSetMiddlewareOptions;
3277
+ $httpAuthSchemeMiddleware = httpAuthSchemeMiddleware;
3278
+ $httpAuthSchemeMiddlewareOptions = httpAuthSchemeMiddlewareOptions;
3279
+ $httpSigningMiddleware = httpSigningMiddleware;
3280
+ $httpSigningMiddlewareOptions = httpSigningMiddlewareOptions;
3281
+ $isIdentityExpired = isIdentityExpired;
3282
+ $memoizeIdentityProvider = memoizeIdentityProvider;
3283
+ $normalizeProvider = normalizeProvider;
3284
+ $setFeature = setFeature;
3285
+ });
3286
+ init_dist_cjs();
3287
+
3288
+ export {
3289
+ $setFeature as setFeature,
3290
+ $requestBuilder as requestBuilder,
3291
+ $normalizeProvider as normalizeProvider,
3292
+ $memoizeIdentityProvider as memoizeIdentityProvider,
3293
+ $isIdentityExpired as isIdentityExpired,
3294
+ $httpSigningMiddlewareOptions as httpSigningMiddlewareOptions,
3295
+ $httpSigningMiddleware as httpSigningMiddleware,
3296
+ $httpAuthSchemeMiddlewareOptions as httpAuthSchemeMiddlewareOptions,
3297
+ $httpAuthSchemeMiddleware as httpAuthSchemeMiddleware,
3298
+ $httpAuthSchemeEndpointRuleSetMiddlewareOptions as httpAuthSchemeEndpointRuleSetMiddlewareOptions,
3299
+ $getSmithyContext as getSmithyContext,
3300
+ $getHttpSigningPlugin as getHttpSigningPlugin,
3301
+ $getHttpAuthSchemePlugin as getHttpAuthSchemePlugin,
3302
+ $getHttpAuthSchemeEndpointRuleSetPlugin as getHttpAuthSchemeEndpointRuleSetPlugin,
3303
+ $doesIdentityRequireRefresh as doesIdentityRequireRefresh,
3304
+ $createPaginator as createPaginator,
3305
+ $createIsIdentityExpiredFunction as createIsIdentityExpiredFunction,
3306
+ $NoAuthSigner as NoAuthSigner,
3307
+ $HttpBearerAuthSigner as HttpBearerAuthSigner,
3308
+ $HttpApiKeyAuthSigner as HttpApiKeyAuthSigner,
3309
+ $EXPIRATION_MS as EXPIRATION_MS,
3310
+ $DefaultIdentityProviderConfig as DefaultIdentityProviderConfig
3311
+ };
3312
+ export default {
3313
+ get setFeature() {
3314
+ return $setFeature;
3315
+ },
3316
+ get requestBuilder() {
3317
+ return $requestBuilder;
3318
+ },
3319
+ get normalizeProvider() {
3320
+ return $normalizeProvider;
3321
+ },
3322
+ get memoizeIdentityProvider() {
3323
+ return $memoizeIdentityProvider;
3324
+ },
3325
+ get isIdentityExpired() {
3326
+ return $isIdentityExpired;
3327
+ },
3328
+ get httpSigningMiddlewareOptions() {
3329
+ return $httpSigningMiddlewareOptions;
3330
+ },
3331
+ get httpSigningMiddleware() {
3332
+ return $httpSigningMiddleware;
3333
+ },
3334
+ get httpAuthSchemeMiddlewareOptions() {
3335
+ return $httpAuthSchemeMiddlewareOptions;
3336
+ },
3337
+ get httpAuthSchemeMiddleware() {
3338
+ return $httpAuthSchemeMiddleware;
3339
+ },
3340
+ get httpAuthSchemeEndpointRuleSetMiddlewareOptions() {
3341
+ return $httpAuthSchemeEndpointRuleSetMiddlewareOptions;
3342
+ },
3343
+ get getSmithyContext() {
3344
+ return $getSmithyContext;
3345
+ },
3346
+ get getHttpSigningPlugin() {
3347
+ return $getHttpSigningPlugin;
3348
+ },
3349
+ get getHttpAuthSchemePlugin() {
3350
+ return $getHttpAuthSchemePlugin;
3351
+ },
3352
+ get getHttpAuthSchemeEndpointRuleSetPlugin() {
3353
+ return $getHttpAuthSchemeEndpointRuleSetPlugin;
3354
+ },
3355
+ get doesIdentityRequireRefresh() {
3356
+ return $doesIdentityRequireRefresh;
3357
+ },
3358
+ get createPaginator() {
3359
+ return $createPaginator;
3360
+ },
3361
+ get createIsIdentityExpiredFunction() {
3362
+ return $createIsIdentityExpiredFunction;
3363
+ },
3364
+ get NoAuthSigner() {
3365
+ return $NoAuthSigner;
3366
+ },
3367
+ get HttpBearerAuthSigner() {
3368
+ return $HttpBearerAuthSigner;
3369
+ },
3370
+ get HttpApiKeyAuthSigner() {
3371
+ return $HttpApiKeyAuthSigner;
3372
+ },
3373
+ get EXPIRATION_MS() {
3374
+ return $EXPIRATION_MS;
3375
+ },
3376
+ get DefaultIdentityProviderConfig() {
3377
+ return $DefaultIdentityProviderConfig;
3378
+ }
3379
+ };