@kyro-cms/core 0.13.3 → 0.13.6

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 (563) hide show
  1. package/dist/{WebhookService-BOJMgjBm.d.cts → WebhookService-BJTCP3cU.d.cts} +1 -1
  2. package/dist/{WebhookService-BLi5Rz2m.d.ts → WebhookService-Bqr_66lK.d.ts} +1 -1
  3. package/dist/api-handler-graphql.cjs +1 -1
  4. package/dist/api-handler-graphql.js +2 -2
  5. package/dist/api-handler-trpc.cjs +1 -1
  6. package/dist/api-handler-trpc.js +2 -2
  7. package/dist/api-handler.cjs +1 -1
  8. package/dist/api-handler.js +1 -1
  9. package/dist/auth-session-4WJUKESW.js +1 -0
  10. package/dist/auth-session-VHUHDBCL.cjs +1 -0
  11. package/dist/{base-A9AJPCG5.d.ts → base-C2DOe8wD.d.ts} +2 -2
  12. package/dist/{base-C6wyX2nC.d.cts → base-DIpT2Vuz.d.cts} +2 -2
  13. package/dist/bootstrap-JYAUQ52D.cjs +1 -0
  14. package/dist/bootstrap-TTMLNQM3.js +1 -0
  15. package/dist/chunk-23RSKVJP.cjs +1 -0
  16. package/dist/chunk-24W5I6SJ.cjs +2 -0
  17. package/dist/{chunk-CH4TZZI5.js → chunk-2I2AXTKY.cjs} +38 -39
  18. package/dist/chunk-34LCWI5X.cjs +1 -0
  19. package/dist/chunk-3A5UO6OQ.cjs +114 -0
  20. package/dist/chunk-3N34WXBS.js +2 -0
  21. package/dist/chunk-5BUAWCU6.js +91 -0
  22. package/dist/{chunk-7NKNSRCB.cjs → chunk-5I3BM5TV.js} +33 -32
  23. package/dist/chunk-5RBGM5N5.js +3 -0
  24. package/dist/chunk-7EY3GXRA.js +2 -0
  25. package/dist/chunk-7KTPBTH5.cjs +1 -0
  26. package/dist/chunk-A4XM33WO.js +109 -0
  27. package/dist/chunk-A7763NCF.cjs +19 -0
  28. package/dist/chunk-AQWTJGML.cjs +1 -0
  29. package/dist/chunk-CIWLQXB2.js +2 -0
  30. package/dist/chunk-DCFOVCJX.cjs +1 -0
  31. package/dist/chunk-DCKJT247.cjs +1 -0
  32. package/dist/chunk-EG4SRTYS.cjs +2 -0
  33. package/dist/chunk-FAG2645P.js +2 -0
  34. package/dist/chunk-FIVTKI25.cjs +3 -0
  35. package/dist/chunk-FU76HURF.cjs +1 -0
  36. package/dist/chunk-GDLMPZKD.cjs +2 -0
  37. package/dist/chunk-GS4CMYKS.cjs +1 -0
  38. package/dist/chunk-GTAKGVUY.js +2 -0
  39. package/dist/chunk-GWUHIIPO.cjs +132 -0
  40. package/dist/chunk-H2IJDTA2.cjs +1 -0
  41. package/dist/chunk-HACW42ZZ.cjs +108 -0
  42. package/dist/chunk-HCM2G674.cjs +20 -0
  43. package/dist/chunk-I22MSXGL.js +2 -0
  44. package/dist/chunk-IIPSXKNV.js +115 -0
  45. package/dist/{chunk-WNU76M2C.js → chunk-IIVBEZC2.js} +6 -6
  46. package/dist/chunk-JHFD3IAU.cjs +1 -0
  47. package/dist/chunk-JJY2F6NL.cjs +3 -0
  48. package/dist/chunk-JQ4V2MGJ.cjs +2 -0
  49. package/dist/chunk-JXJTFBHG.js +3 -0
  50. package/dist/chunk-KOSR7235.cjs +1 -0
  51. package/dist/chunk-KUY4QDAL.js +2 -0
  52. package/dist/chunk-LGUHXOEW.js +3 -0
  53. package/dist/chunk-LXTVMP5F.cjs +6 -0
  54. package/dist/chunk-N25DOGLQ.js +5 -0
  55. package/dist/chunk-N2BMGZIX.cjs +90 -0
  56. package/dist/chunk-N7CDHWQH.cjs +2 -0
  57. package/dist/chunk-NBBAMC2X.cjs +1 -0
  58. package/dist/chunk-NGNXOXI5.js +2 -0
  59. package/dist/chunk-O4PPZOVI.cjs +1 -0
  60. package/dist/chunk-O4RKZQYQ.js +2 -0
  61. package/dist/chunk-OJBL4CXK.cjs +2 -0
  62. package/dist/chunk-OPKZYQV7.js +3 -0
  63. package/dist/chunk-OXEJCIOA.cjs +1 -0
  64. package/dist/chunk-OXH6CANN.js +2 -0
  65. package/dist/{chunk-EQN3HDES.cjs → chunk-PW6Y5MQL.cjs} +5 -5
  66. package/dist/chunk-RLW6AQF2.js +2 -0
  67. package/dist/chunk-SBFVITY2.js +7 -0
  68. package/dist/chunk-SEJ7LMYY.js +4 -0
  69. package/dist/chunk-SZY25KAE.js +21 -0
  70. package/dist/chunk-TG5YQ4PB.cjs +4 -0
  71. package/dist/chunk-TJ6N5ZPZ.js +133 -0
  72. package/dist/chunk-V2RMDMWN.js +2 -0
  73. package/dist/chunk-V4SR7DU5.js +3 -0
  74. package/dist/chunk-VLFM66BZ.js +4 -0
  75. package/dist/chunk-VPBGZW4P.cjs +1 -0
  76. package/dist/chunk-VQWOCGJ2.cjs +1 -0
  77. package/dist/chunk-VWXHW74B.js +3 -0
  78. package/dist/chunk-W5GDZG64.js +2 -0
  79. package/dist/chunk-WLSVS3NC.js +2 -0
  80. package/dist/chunk-YLP3EKTQ.js +2 -0
  81. package/dist/chunk-YNSKDTFG.js +2 -0
  82. package/dist/chunk-YOJOVQIH.cjs +1 -0
  83. package/dist/chunk-ZE2X3FBU.js +20 -0
  84. package/dist/chunk-ZMH35QYG.js +2 -0
  85. package/dist/cli/index.cjs +53 -182
  86. package/dist/cli/index.js +54 -183
  87. package/dist/drizzle/index.cjs +1 -1
  88. package/dist/drizzle/index.d.cts +3 -3
  89. package/dist/drizzle/index.d.ts +3 -3
  90. package/dist/drizzle/index.js +1 -1
  91. package/dist/fields/index.cjs +1 -1
  92. package/dist/fields/index.d.cts +2 -2
  93. package/dist/fields/index.d.ts +2 -2
  94. package/dist/fields/index.js +1 -1
  95. package/dist/graphql/index.cjs +1 -1
  96. package/dist/graphql/index.d.cts +3 -3
  97. package/dist/graphql/index.d.ts +3 -3
  98. package/dist/graphql/index.js +1 -1
  99. package/dist/{index-BttsFZDa.d.ts → index-C9uBoJtm.d.ts} +2 -2
  100. package/dist/{index-BMcYFpTv.d.cts → index-Ci7aUrmN.d.cts} +2 -2
  101. package/dist/index.cjs +30 -30
  102. package/dist/index.d.cts +10 -10
  103. package/dist/index.d.ts +10 -10
  104. package/dist/index.js +31 -31
  105. package/dist/integration.cjs +1 -1
  106. package/dist/integration.js +1 -1
  107. package/dist/local-DKP43BWQ.cjs +1 -0
  108. package/dist/local-TF5ZMHWW.js +1 -0
  109. package/dist/media-M3EIZ4QS.cjs +1 -0
  110. package/dist/media-WYEILC6K.js +1 -0
  111. package/dist/mongo-auth-adapter-33M5ENM7.cjs +1 -0
  112. package/dist/mongo-auth-adapter-4ITULS2P.js +1 -0
  113. package/dist/mongodb/index.cjs +1 -1
  114. package/dist/mongodb/index.d.cts +3 -3
  115. package/dist/mongodb/index.d.ts +3 -3
  116. package/dist/mongodb/index.js +1 -1
  117. package/dist/nodemailer-transport-7F3VLLBW.js +1 -0
  118. package/dist/nodemailer-transport-WAPZD3SJ.cjs +1 -0
  119. package/dist/postgres-auth-adapter-7BCPXNBO.js +1 -0
  120. package/dist/postgres-auth-adapter-HMXFUM5W.cjs +1 -0
  121. package/dist/redis-adapter-2E5AWMMA.cjs +1 -0
  122. package/dist/redis-adapter-GFH74CF4.js +1 -0
  123. package/dist/rest/index.cjs +1 -1
  124. package/dist/rest/index.d.cts +4 -4
  125. package/dist/rest/index.d.ts +4 -4
  126. package/dist/rest/index.js +1 -1
  127. package/dist/schema-FNIDQKIJ.cjs +1 -0
  128. package/dist/schema-KD736QFN.js +1 -0
  129. package/dist/sqlite-adapter-HL53RLSN.cjs +1 -0
  130. package/dist/sqlite-adapter-TT6ZASDG.js +1 -0
  131. package/dist/templates/index.cjs +1 -1
  132. package/dist/templates/index.d.cts +2 -2
  133. package/dist/templates/index.d.ts +2 -2
  134. package/dist/templates/index.js +1 -1
  135. package/dist/trpc/index.cjs +1 -1
  136. package/dist/trpc/index.d.cts +3 -3
  137. package/dist/trpc/index.d.ts +3 -3
  138. package/dist/trpc/index.js +1 -1
  139. package/dist/{types-DxaK39ix.d.cts → types-C3QFX0l6.d.cts} +4 -0
  140. package/dist/{types-DxaK39ix.d.ts → types-C3QFX0l6.d.ts} +4 -0
  141. package/dist/{types-6ShQp2EM.d.cts → types-CKWnrUAh.d.ts} +23 -2
  142. package/dist/{types-BCOhfwHC.d.ts → types-CdwfDpyW.d.cts} +23 -2
  143. package/dist/ws/index.cjs +1 -1
  144. package/dist/ws/index.js +1 -1
  145. package/package.json +3 -11
  146. package/dist/WebhookService-BcuD8tnn.d.cts +0 -143
  147. package/dist/WebhookService-CFe6Zd0_.d.cts +0 -143
  148. package/dist/WebhookService-CGxHtw7E.d.cts +0 -143
  149. package/dist/WebhookService-CNC1lYz7.d.ts +0 -143
  150. package/dist/WebhookService-CVXmjbtQ.d.cts +0 -143
  151. package/dist/WebhookService-D5PSI5t6.d.cts +0 -143
  152. package/dist/WebhookService-DPCCn_12.d.ts +0 -143
  153. package/dist/WebhookService-Dk1lzSrG.d.cts +0 -143
  154. package/dist/WebhookService-Dncnbgm9.d.cts +0 -143
  155. package/dist/WebhookService-I6hdue2Y.d.ts +0 -143
  156. package/dist/WebhookService-KnQ2UDlW.d.ts +0 -143
  157. package/dist/WebhookService-UY5p89Bj.d.ts +0 -143
  158. package/dist/WebhookService-YZXBCRXA.d.ts +0 -143
  159. package/dist/WebhookService-fk0FGRlk.d.ts +0 -143
  160. package/dist/WebhookService-vsFnWrOh.d.ts +0 -143
  161. package/dist/WebhookService-zrDmAx7L.d.cts +0 -143
  162. package/dist/auth-session-DHVGXHOH.cjs +0 -1
  163. package/dist/auth-session-O7IIH7EP.js +0 -1
  164. package/dist/base-B--L0lCn.d.cts +0 -218
  165. package/dist/base-B-i-tjm1.d.ts +0 -218
  166. package/dist/base-B-siit_y.d.cts +0 -218
  167. package/dist/base-B8SyZI4D.d.ts +0 -218
  168. package/dist/base-BCgFt3Yx.d.ts +0 -218
  169. package/dist/base-BHRGJ40F.d.cts +0 -218
  170. package/dist/base-BVoDPNjJ.d.cts +0 -218
  171. package/dist/base-BaOJ5uWd.d.cts +0 -218
  172. package/dist/base-BfPaVEAE.d.cts +0 -218
  173. package/dist/base-BxrX5EPU.d.cts +0 -218
  174. package/dist/base-CAb9EYQs.d.ts +0 -218
  175. package/dist/base-CcZIEll-.d.ts +0 -218
  176. package/dist/base-CyG7aF1e.d.cts +0 -218
  177. package/dist/base-DOImeJ-F.d.ts +0 -218
  178. package/dist/base-DbnwE42-.d.cts +0 -218
  179. package/dist/base-NyiSsD-n.d.ts +0 -218
  180. package/dist/base-OYfoYPYP.d.ts +0 -218
  181. package/dist/base-xflndGDO.d.ts +0 -218
  182. package/dist/bcryptjs-WIQSWJGK.cjs +0 -1
  183. package/dist/bcryptjs-ZEEHSMAG.js +0 -2
  184. package/dist/better-sqlite3-5IISPX34.cjs +0 -1
  185. package/dist/better-sqlite3-B34RIU4C.js +0 -2
  186. package/dist/bootstrap-E24SGUJP.cjs +0 -1
  187. package/dist/bootstrap-PG2LGDLB.js +0 -1
  188. package/dist/bootstrap-QQ6D3OYG.js +0 -1
  189. package/dist/bootstrap-QVKSKXJF.cjs +0 -1
  190. package/dist/bootstrap-RILR44UM.cjs +0 -1
  191. package/dist/bootstrap-YD3GLTWX.cjs +0 -1
  192. package/dist/bootstrap-YFVE7MRG.js +0 -1
  193. package/dist/bootstrap-ZRRUPRUR.js +0 -1
  194. package/dist/bowser-SB3ZUPO4.js +0 -11
  195. package/dist/bowser-VX6B6ZSE.cjs +0 -10
  196. package/dist/chokidar-5RVQZVHP.cjs +0 -5
  197. package/dist/chokidar-BOYGRT4Q.js +0 -6
  198. package/dist/chunk-22RXJ442.js +0 -57
  199. package/dist/chunk-262YP5XA.cjs +0 -1
  200. package/dist/chunk-2FSOHXOU.cjs +0 -56
  201. package/dist/chunk-2HA6EKXX.js +0 -24
  202. package/dist/chunk-2OS5Y4LE.cjs +0 -1
  203. package/dist/chunk-2PXXQKN3.cjs +0 -3
  204. package/dist/chunk-2SPWRQ5O.js +0 -122
  205. package/dist/chunk-32QY56XF.js +0 -122
  206. package/dist/chunk-355R4LS5.cjs +0 -56
  207. package/dist/chunk-35IVNLMA.js +0 -122
  208. package/dist/chunk-35PGCW3S.cjs +0 -1
  209. package/dist/chunk-3GXLOYM3.js +0 -2
  210. package/dist/chunk-3KZXF4US.js +0 -2
  211. package/dist/chunk-3LAWUINR.cjs +0 -1
  212. package/dist/chunk-3NSZZCOJ.js +0 -2
  213. package/dist/chunk-3O3AVMWM.cjs +0 -1
  214. package/dist/chunk-3TAUNYEM.js +0 -8
  215. package/dist/chunk-3U6MKWET.cjs +0 -120
  216. package/dist/chunk-3VXEK5ZW.cjs +0 -1
  217. package/dist/chunk-47CXBWMA.js +0 -2
  218. package/dist/chunk-4BMWWGJN.js +0 -384
  219. package/dist/chunk-4NTIK6DF.cjs +0 -2
  220. package/dist/chunk-4YCI3HBD.js +0 -3
  221. package/dist/chunk-4ZWLNGLS.js +0 -2
  222. package/dist/chunk-5A7E7N4B.cjs +0 -431
  223. package/dist/chunk-5ZEYOFAK.js +0 -2
  224. package/dist/chunk-6DD4J7LI.js +0 -2
  225. package/dist/chunk-6E44MQQ5.js +0 -115
  226. package/dist/chunk-6GGPY7U2.js +0 -4
  227. package/dist/chunk-6LWF5MPL.js +0 -20
  228. package/dist/chunk-6MNLRAKM.cjs +0 -121
  229. package/dist/chunk-6NBZDW53.js +0 -133
  230. package/dist/chunk-6TPICJ2L.js +0 -7
  231. package/dist/chunk-73D2PNHD.cjs +0 -7
  232. package/dist/chunk-73Y63IPP.js +0 -57
  233. package/dist/chunk-7ACHOBWY.cjs +0 -13
  234. package/dist/chunk-7DUKWHRN.cjs +0 -1
  235. package/dist/chunk-7GGZA5YU.cjs +0 -2
  236. package/dist/chunk-7JWQ2PZP.cjs +0 -1
  237. package/dist/chunk-7K6ZUNJM.js +0 -4
  238. package/dist/chunk-7KLEANTO.cjs +0 -1
  239. package/dist/chunk-7LLCXY5O.cjs +0 -19
  240. package/dist/chunk-7MNDQU6K.js +0 -8
  241. package/dist/chunk-7NH7H3WA.js +0 -10
  242. package/dist/chunk-7WMMKGEO.cjs +0 -1
  243. package/dist/chunk-A35ZP72D.cjs +0 -132
  244. package/dist/chunk-A3IOQOV6.js +0 -2
  245. package/dist/chunk-A3XVL6ED.cjs +0 -3
  246. package/dist/chunk-A7LZ6T42.cjs +0 -1
  247. package/dist/chunk-APDQ6ZTG.cjs +0 -120
  248. package/dist/chunk-ATI2UZ7U.js +0 -2
  249. package/dist/chunk-AWQGDMOE.js +0 -3
  250. package/dist/chunk-B3BSVEFC.cjs +0 -3
  251. package/dist/chunk-B4AC23SG.js +0 -122
  252. package/dist/chunk-BAVN7VDR.cjs +0 -1
  253. package/dist/chunk-BCEE4NBZ.cjs +0 -2
  254. package/dist/chunk-BD6XHMMM.cjs +0 -2
  255. package/dist/chunk-BUNLC3II.cjs +0 -1
  256. package/dist/chunk-C7QCZX7X.js +0 -2
  257. package/dist/chunk-CHYVUWZ3.js +0 -2
  258. package/dist/chunk-CIVA6SKW.js +0 -2
  259. package/dist/chunk-CNHUCCQJ.js +0 -121
  260. package/dist/chunk-CRP6PSCE.js +0 -2
  261. package/dist/chunk-D6SDGHY6.js +0 -2
  262. package/dist/chunk-DI6TCZSE.js +0 -122
  263. package/dist/chunk-DORUYZQV.cjs +0 -1
  264. package/dist/chunk-DSHKQL3R.cjs +0 -121
  265. package/dist/chunk-DVWYO3KK.cjs +0 -1
  266. package/dist/chunk-E4H3ZZ7U.js +0 -4
  267. package/dist/chunk-EFKEVWAD.js +0 -4
  268. package/dist/chunk-EHWUALGH.cjs +0 -1
  269. package/dist/chunk-EI7FRSNY.js +0 -57
  270. package/dist/chunk-ELFQKQLL.js +0 -2
  271. package/dist/chunk-EML5FDUU.js +0 -2
  272. package/dist/chunk-EN65ZEK2.cjs +0 -2
  273. package/dist/chunk-EON4XLKQ.cjs +0 -1
  274. package/dist/chunk-EUQAOYEO.cjs +0 -121
  275. package/dist/chunk-EVAUBT7H.js +0 -57
  276. package/dist/chunk-EW424IBO.cjs +0 -1
  277. package/dist/chunk-EYHD7HZE.cjs +0 -1
  278. package/dist/chunk-EYYIPA5N.js +0 -432
  279. package/dist/chunk-EZIDQBXI.cjs +0 -1
  280. package/dist/chunk-F2O4QO5N.cjs +0 -383
  281. package/dist/chunk-F4ITQ6XQ.cjs +0 -3
  282. package/dist/chunk-FBWLSWZ4.js +0 -122
  283. package/dist/chunk-FDKU7HJX.js +0 -2
  284. package/dist/chunk-FG3IFGJP.cjs +0 -1
  285. package/dist/chunk-FGN6IMPY.cjs +0 -3
  286. package/dist/chunk-FK2BG4HU.js +0 -3
  287. package/dist/chunk-FLMUMPDE.js +0 -2
  288. package/dist/chunk-FLS2FJM6.cjs +0 -431
  289. package/dist/chunk-FP5UK272.cjs +0 -1
  290. package/dist/chunk-FSL3NLRT.cjs +0 -2
  291. package/dist/chunk-FUFS65Q5.js +0 -133
  292. package/dist/chunk-GIS6X43A.cjs +0 -3
  293. package/dist/chunk-GNEVCEJU.cjs +0 -3
  294. package/dist/chunk-GNOSG3PK.cjs +0 -1
  295. package/dist/chunk-GQGFNTDZ.js +0 -2
  296. package/dist/chunk-GTR7JAKP.cjs +0 -3
  297. package/dist/chunk-GV2IB4WQ.cjs +0 -56
  298. package/dist/chunk-GWIZT2P5.js +0 -57
  299. package/dist/chunk-H3FJ54KB.cjs +0 -121
  300. package/dist/chunk-HPIJI7TM.js +0 -3
  301. package/dist/chunk-HPYH7GTS.cjs +0 -1
  302. package/dist/chunk-HRAY65XH.js +0 -3
  303. package/dist/chunk-HTYVI2HK.cjs +0 -9
  304. package/dist/chunk-HY3EAWB2.js +0 -4
  305. package/dist/chunk-I6UJVO2P.js +0 -57
  306. package/dist/chunk-IKGVPXMK.js +0 -3
  307. package/dist/chunk-IQSF6XRV.js +0 -57
  308. package/dist/chunk-IXGDTAES.js +0 -4
  309. package/dist/chunk-J6V573PE.cjs +0 -1
  310. package/dist/chunk-JA44K75G.js +0 -2
  311. package/dist/chunk-JB4WG2YJ.cjs +0 -121
  312. package/dist/chunk-JCEJ4VTN.js +0 -20
  313. package/dist/chunk-JRUQ5ABB.js +0 -4
  314. package/dist/chunk-JV4HJBXW.js +0 -14
  315. package/dist/chunk-JZ7Z6WC2.cjs +0 -3
  316. package/dist/chunk-K5XGP57D.cjs +0 -19
  317. package/dist/chunk-K73HOMQY.cjs +0 -56
  318. package/dist/chunk-KEITOXIP.js +0 -2
  319. package/dist/chunk-KMFLHGD5.cjs +0 -1
  320. package/dist/chunk-KZHXYXSH.cjs +0 -10
  321. package/dist/chunk-L3Q64RUX.js +0 -3
  322. package/dist/chunk-LBLFU6KI.js +0 -57
  323. package/dist/chunk-LEBM6ZSZ.cjs +0 -10
  324. package/dist/chunk-LP3HRZGK.js +0 -57
  325. package/dist/chunk-LPFRMQFQ.js +0 -121
  326. package/dist/chunk-LQ3YZTPU.cjs +0 -15
  327. package/dist/chunk-LVBHOZZF.js +0 -4
  328. package/dist/chunk-LWM4WABU.js +0 -3
  329. package/dist/chunk-LY7N3UHH.cjs +0 -23
  330. package/dist/chunk-LYU44UNN.cjs +0 -56
  331. package/dist/chunk-M75VGFCI.js +0 -3
  332. package/dist/chunk-MCIZG4A3.cjs +0 -1
  333. package/dist/chunk-MDLJTZLV.cjs +0 -1
  334. package/dist/chunk-MFNN5DYG.cjs +0 -1
  335. package/dist/chunk-MJAODEFC.cjs +0 -121
  336. package/dist/chunk-MLCBSEBU.js +0 -2
  337. package/dist/chunk-MSC4G2HF.cjs +0 -2
  338. package/dist/chunk-MYHNTJLR.cjs +0 -56
  339. package/dist/chunk-N2YHO2WI.cjs +0 -3
  340. package/dist/chunk-N4FXLQE3.cjs +0 -132
  341. package/dist/chunk-N5POANYV.js +0 -2
  342. package/dist/chunk-N6MNQIQU.js +0 -123
  343. package/dist/chunk-NGNJSUGL.cjs +0 -1
  344. package/dist/chunk-NPBXLPOP.js +0 -3
  345. package/dist/chunk-NRE6VKL6.cjs +0 -121
  346. package/dist/chunk-O4YE57OS.cjs +0 -6
  347. package/dist/chunk-O7CBGP4N.cjs +0 -1
  348. package/dist/chunk-OBYAIJVU.js +0 -11
  349. package/dist/chunk-OJ3H4AQ2.cjs +0 -56
  350. package/dist/chunk-OLRCZ6E3.js +0 -2
  351. package/dist/chunk-ON5XJEPO.cjs +0 -3
  352. package/dist/chunk-OOVNTOZC.cjs +0 -56
  353. package/dist/chunk-OPTVCCQQ.cjs +0 -122
  354. package/dist/chunk-OT2Z4XBD.cjs +0 -1
  355. package/dist/chunk-P6JITOFF.js +0 -4
  356. package/dist/chunk-PFKVHUOT.js +0 -432
  357. package/dist/chunk-PFTBTWSC.cjs +0 -1
  358. package/dist/chunk-PITMDQYN.cjs +0 -18
  359. package/dist/chunk-PTPVFLET.js +0 -20
  360. package/dist/chunk-PYUWSKKP.js +0 -57
  361. package/dist/chunk-PZDLPRJF.js +0 -4
  362. package/dist/chunk-Q5TFO66G.cjs +0 -1
  363. package/dist/chunk-QC4YXUBT.cjs +0 -383
  364. package/dist/chunk-QO5ZWQA3.cjs +0 -74
  365. package/dist/chunk-QUTYCUST.js +0 -4
  366. package/dist/chunk-QYN6C3FZ.cjs +0 -114
  367. package/dist/chunk-REKKBAQX.cjs +0 -56
  368. package/dist/chunk-REQ622YC.js +0 -3
  369. package/dist/chunk-RPRGGGIW.js +0 -11
  370. package/dist/chunk-RTNQP6BV.js +0 -2
  371. package/dist/chunk-RUJW47ZJ.js +0 -2
  372. package/dist/chunk-RVBSJ4UQ.cjs +0 -7
  373. package/dist/chunk-RXYCFZJC.cjs +0 -121
  374. package/dist/chunk-RYHOWZLK.js +0 -2
  375. package/dist/chunk-RYXLEFS5.js +0 -2
  376. package/dist/chunk-S2MZNEBQ.cjs +0 -1
  377. package/dist/chunk-S5HTTLN7.cjs +0 -2
  378. package/dist/chunk-S73YERS2.js +0 -57
  379. package/dist/chunk-SBNMXQNO.cjs +0 -2
  380. package/dist/chunk-SLMIYECU.js +0 -2
  381. package/dist/chunk-SMQ6736Y.js +0 -57
  382. package/dist/chunk-SRIXRJHL.js +0 -4
  383. package/dist/chunk-T3DJ3UTP.cjs +0 -121
  384. package/dist/chunk-TBHNE4VV.js +0 -2
  385. package/dist/chunk-TCFL3UWT.cjs +0 -2
  386. package/dist/chunk-TEY5LZ26.cjs +0 -56
  387. package/dist/chunk-TJZO7ZSX.cjs +0 -3
  388. package/dist/chunk-TKUNRCRH.js +0 -4
  389. package/dist/chunk-TQLCOMKC.js +0 -4
  390. package/dist/chunk-TRXYDWGE.cjs +0 -1
  391. package/dist/chunk-TS55CUNJ.js +0 -57
  392. package/dist/chunk-TYQYKKWJ.js +0 -16
  393. package/dist/chunk-U6KFONKM.js +0 -2
  394. package/dist/chunk-UFBJ3WOZ.js +0 -2
  395. package/dist/chunk-UNYXWPLZ.cjs +0 -2
  396. package/dist/chunk-UQRVQUVR.js +0 -2
  397. package/dist/chunk-UW5W35NP.js +0 -122
  398. package/dist/chunk-UWHWSWDE.js +0 -2
  399. package/dist/chunk-UWVBFRCW.js +0 -2
  400. package/dist/chunk-UZWYFEUN.js +0 -122
  401. package/dist/chunk-V4FAL7AG.js +0 -2
  402. package/dist/chunk-VI7WCO2J.cjs +0 -3
  403. package/dist/chunk-VOYPKTID.cjs +0 -1
  404. package/dist/chunk-VQ53TFYA.cjs +0 -1
  405. package/dist/chunk-VRZC4TTF.cjs +0 -1
  406. package/dist/chunk-VTOL3URF.js +0 -4
  407. package/dist/chunk-VVVCCB6R.js +0 -2
  408. package/dist/chunk-W2GPP6RB.js +0 -122
  409. package/dist/chunk-W45TLOOT.js +0 -2
  410. package/dist/chunk-WAVGRSE6.js +0 -2
  411. package/dist/chunk-WHOA7YJU.cjs +0 -1
  412. package/dist/chunk-WNRUPL26.js +0 -2
  413. package/dist/chunk-WPM6LFCY.js +0 -2
  414. package/dist/chunk-WXT2XW7T.js +0 -13
  415. package/dist/chunk-X473JI7Z.js +0 -75
  416. package/dist/chunk-X6HUA6EF.cjs +0 -20
  417. package/dist/chunk-XBQ6HV3T.cjs +0 -114
  418. package/dist/chunk-XDPLVJRO.js +0 -21
  419. package/dist/chunk-XDQVYCIR.cjs +0 -1
  420. package/dist/chunk-XFYSADHV.cjs +0 -2
  421. package/dist/chunk-XIAJQLGS.js +0 -2
  422. package/dist/chunk-XK6UB77Q.js +0 -4
  423. package/dist/chunk-XOR64WUQ.cjs +0 -19
  424. package/dist/chunk-XP7BXFXT.cjs +0 -121
  425. package/dist/chunk-Y2VHO66Q.cjs +0 -3
  426. package/dist/chunk-Y2YAKDEQ.js +0 -2
  427. package/dist/chunk-Y5O2OD7J.cjs +0 -3
  428. package/dist/chunk-YARB43JG.cjs +0 -56
  429. package/dist/chunk-YENNL5HG.js +0 -2
  430. package/dist/chunk-YGI5W4RS.js +0 -2
  431. package/dist/chunk-YLCEMVYY.cjs +0 -56
  432. package/dist/chunk-YSOM57GK.cjs +0 -3
  433. package/dist/chunk-YUUXFD73.js +0 -19
  434. package/dist/chunk-Z2SN2MYP.js +0 -122
  435. package/dist/chunk-Z3UVDGYS.cjs +0 -56
  436. package/dist/chunk-ZAKYTBEN.js +0 -3
  437. package/dist/chunk-ZHA446FA.cjs +0 -1
  438. package/dist/chunk-ZO3YB5DK.cjs +0 -1
  439. package/dist/chunk-ZOVH6QT5.cjs +0 -1
  440. package/dist/chunk-ZRIBWDYJ.js +0 -384
  441. package/dist/chunk-ZTLGK6R4.cjs +0 -12
  442. package/dist/chunk-ZUBJ6RLQ.cjs +0 -1
  443. package/dist/chunk-ZWDBPEXL.js +0 -115
  444. package/dist/client.d.cts +0 -1266
  445. package/dist/client.d.ts +0 -1266
  446. package/dist/d1-5ZQJOFDX.cjs +0 -1
  447. package/dist/d1-HPB6B253.js +0 -2
  448. package/dist/dist-es-3SSNUZST.cjs +0 -1
  449. package/dist/dist-es-64F22JL2.js +0 -2
  450. package/dist/dist-es-A5OF2STN.cjs +0 -2
  451. package/dist/dist-es-BOW5V247.cjs +0 -6
  452. package/dist/dist-es-CRIMATLL.cjs +0 -2
  453. package/dist/dist-es-DL3VLVP6.cjs +0 -1
  454. package/dist/dist-es-F2ZR55UK.js +0 -4
  455. package/dist/dist-es-IPSSZNFP.js +0 -1
  456. package/dist/dist-es-M2F7M27Y.js +0 -2
  457. package/dist/dist-es-M66JKZF5.js +0 -7
  458. package/dist/dist-es-OKLLRYI3.js +0 -2
  459. package/dist/dist-es-P25IKLBI.cjs +0 -1
  460. package/dist/dist-es-SRPWSAF4.cjs +0 -1
  461. package/dist/dist-es-SVHZDVUF.js +0 -3
  462. package/dist/dist-es-T2H2W5BX.cjs +0 -3
  463. package/dist/dist-es-WFI55HKT.js +0 -3
  464. package/dist/drizzle-orm-47ELDEM6.cjs +0 -1
  465. package/dist/drizzle-orm-XRTSOQJS.js +0 -1
  466. package/dist/event-streams-7NAWZW2I.js +0 -1
  467. package/dist/event-streams-JBMWCI2O.cjs +0 -1
  468. package/dist/fs-KWBRQ6T6.js +0 -1
  469. package/dist/fs-ZQYOJOIO.cjs +0 -1
  470. package/dist/index-8Ino7vKq.d.ts +0 -105
  471. package/dist/index-B9BFNOHd.d.cts +0 -105
  472. package/dist/index-ByOM1Y5x.d.ts +0 -105
  473. package/dist/index-C6xmtRio.d.cts +0 -105
  474. package/dist/index-CTI3K_uq.d.cts +0 -105
  475. package/dist/index-CTL4zv_u.d.ts +0 -105
  476. package/dist/index-CaDbioSg.d.ts +0 -105
  477. package/dist/index-CxA9uOv0.d.ts +0 -105
  478. package/dist/index-D6AXbuPI.d.ts +0 -105
  479. package/dist/index-DF0KDBaM.d.cts +0 -105
  480. package/dist/index-DG4Xu7gA.d.cts +0 -105
  481. package/dist/index-DS3DpJli.d.cts +0 -105
  482. package/dist/index-NGnJpSgf.d.ts +0 -105
  483. package/dist/index-Zrg3sZ6R.d.cts +0 -105
  484. package/dist/index-eHex8Iwj.d.ts +0 -105
  485. package/dist/index-rm7uyOK1.d.cts +0 -105
  486. package/dist/jsonwebtoken-DFB6ZBZA.cjs +0 -8
  487. package/dist/jsonwebtoken-OD67R5JS.js +0 -9
  488. package/dist/lib-5QYYN6ML.cjs +0 -12
  489. package/dist/lib-A2D63VXD.cjs +0 -1
  490. package/dist/lib-JQD2JAOO.js +0 -2
  491. package/dist/lib-XXYYUPMW.js +0 -13
  492. package/dist/loadSso-JY4WDQPS.cjs +0 -2
  493. package/dist/loadSso-UQR6545M.js +0 -3
  494. package/dist/local-6UUGBZ4M.js +0 -1
  495. package/dist/local-DPLKZQA3.js +0 -1
  496. package/dist/local-KR3AIGVA.cjs +0 -1
  497. package/dist/local-S5VA7IXE.cjs +0 -1
  498. package/dist/local-T7GISZBL.js +0 -1
  499. package/dist/local-ZYHV3J2K.cjs +0 -1
  500. package/dist/media-3Z6YW5J4.cjs +0 -1
  501. package/dist/media-E762GEHL.js +0 -1
  502. package/dist/mongo-auth-adapter-2H2AXDRH.cjs +0 -1
  503. package/dist/mongo-auth-adapter-EUHAYWJ6.cjs +0 -1
  504. package/dist/mongo-auth-adapter-FW7ATYQ6.js +0 -1
  505. package/dist/mongo-auth-adapter-GR2CFFEA.js +0 -1
  506. package/dist/mongo-auth-adapter-UOO2LZUJ.cjs +0 -1
  507. package/dist/mongo-auth-adapter-YWMEOC42.js +0 -1
  508. package/dist/nodemailer-IDML4L6W.cjs +0 -53
  509. package/dist/nodemailer-NITB45SS.js +0 -54
  510. package/dist/nodemailer-transport-3VWVUBM5.cjs +0 -1
  511. package/dist/nodemailer-transport-7RHATUKL.js +0 -1
  512. package/dist/nodemailer-transport-CHO2WKIY.js +0 -1
  513. package/dist/nodemailer-transport-ED2IXNGW.cjs +0 -1
  514. package/dist/postgres-auth-adapter-QKBNXVPT.js +0 -1
  515. package/dist/postgres-auth-adapter-SK3N3OSS.js +0 -1
  516. package/dist/postgres-auth-adapter-WMLM4UUC.cjs +0 -1
  517. package/dist/postgres-auth-adapter-ZO6HK5AK.cjs +0 -1
  518. package/dist/postgres-js-7YBZKGXG.cjs +0 -1
  519. package/dist/postgres-js-JLFIWOBH.js +0 -1
  520. package/dist/redis-adapter-EGMUN65D.cjs +0 -1
  521. package/dist/redis-adapter-EVK2SMKH.cjs +0 -1
  522. package/dist/redis-adapter-LY2NBSAG.js +0 -1
  523. package/dist/redis-adapter-QPCTMF55.js +0 -1
  524. package/dist/schema-RT6WSUYC.cjs +0 -1
  525. package/dist/schema-YFMSJK2P.js +0 -2
  526. package/dist/signin-N3T2KF5Q.js +0 -3
  527. package/dist/signin-VFBLX7EL.cjs +0 -2
  528. package/dist/sqlite-adapter-52PL52VU.js +0 -1
  529. package/dist/sqlite-adapter-KPSISY6E.cjs +0 -1
  530. package/dist/sqlite-adapter-MNNZZXGX.cjs +0 -1
  531. package/dist/sqlite-adapter-PI6SIY7O.js +0 -1
  532. package/dist/src-6LAUXXDM.cjs +0 -1
  533. package/dist/src-QBADSZV4.js +0 -1
  534. package/dist/sso-oidc-54BIRYR6.cjs +0 -2
  535. package/dist/sso-oidc-UB7G4END.js +0 -3
  536. package/dist/sts-WAA6I22C.js +0 -3
  537. package/dist/sts-YLXXIB3X.cjs +0 -2
  538. package/dist/types-B5Qz1svz.d.cts +0 -822
  539. package/dist/types-B9oXBEKI.d.cts +0 -330
  540. package/dist/types-B9oXBEKI.d.ts +0 -330
  541. package/dist/types-BRDBNacn.d.ts +0 -839
  542. package/dist/types-Bii0bhUV.d.cts +0 -329
  543. package/dist/types-Bii0bhUV.d.ts +0 -329
  544. package/dist/types-Bt2_ycUO.d.ts +0 -811
  545. package/dist/types-C4wXHImf.d.ts +0 -822
  546. package/dist/types-C8yIAV6K.d.cts +0 -839
  547. package/dist/types-CORUQhY-.d.ts +0 -839
  548. package/dist/types-Cdssrcbz.d.cts +0 -839
  549. package/dist/types-CjGqxBd3.d.cts +0 -330
  550. package/dist/types-CjGqxBd3.d.ts +0 -330
  551. package/dist/types-DBGR-eQl.d.cts +0 -839
  552. package/dist/types-DCWgPFmi.d.cts +0 -822
  553. package/dist/types-DROqAsr0.d.cts +0 -330
  554. package/dist/types-DROqAsr0.d.ts +0 -330
  555. package/dist/types-DlGSbh7I.d.cts +0 -297
  556. package/dist/types-DlGSbh7I.d.ts +0 -297
  557. package/dist/types-DsF64Wrc.d.cts +0 -811
  558. package/dist/types-IeKFn7Ky.d.ts +0 -839
  559. package/dist/types-QglJ7PwT.d.cts +0 -839
  560. package/dist/types-ZrjEVWfi.d.ts +0 -811
  561. package/dist/types-dEy5JxvN.d.ts +0 -822
  562. package/dist/types-tVJc9YbX.d.cts +0 -811
  563. package/dist/types-zt5qIvje.d.ts +0 -839
@@ -1,18 +0,0 @@
1
- 'use strict';var chunkLEBM6ZSZ_cjs=require('./chunk-LEBM6ZSZ.cjs'),chunkGNEVCEJU_cjs=require('./chunk-GNEVCEJU.cjs'),chunkLQ3YZTPU_cjs=require('./chunk-LQ3YZTPU.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var re=i=>chunkGNEVCEJU_cjs.f.isInstance(i)?i.headers?.date??i.headers?.Date:void 0;chunkBUNLC3II_cjs.h();var $=i=>new Date(Date.now()+i);chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var rt=(i,e)=>Math.abs($(e).getTime()-i)>=3e5;var se=(i,e)=>{let t=Date.parse(i);return rt(t,e)?t-Date.now():e};var Q=(i,e)=>{if(!e)throw new Error(`Property \`${i}\` is not resolved for AWS SDK SigV4Auth`);return e},q=async i=>{let e=Q("context",i.context),t=Q("config",i.config),r=e.endpointV2?.properties?.authSchemes?.[0],o=await Q("signer",t.signer)(r),n=i?.signingRegion,a=i?.signingRegionSet,m=i?.signingName;return {config:t,signer:o,signingRegion:n,signingRegionSet:a,signingName:m}},B=class{async sign(e,t,r){if(!chunkGNEVCEJU_cjs.e.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let s=await q(r),{config:o,signer:n}=s,{signingRegion:a,signingName:m}=s,c=r.context;if(c?.authSchemes?.length??false){let[l,h]=c.authSchemes;l?.name==="sigv4a"&&h?.name==="sigv4"&&(a=h?.signingRegion??a,m=h?.signingName??m);}return r._preRequestSystemClockOffset=o.systemClockOffset,await n.sign(e,{signingDate:$(o.systemClockOffset),signingRegion:a,signingService:m})}errorHandler(e){return t=>{let r=t,s=r.ServerTime??re(r.$response);if(s){let o=Q("config",e.config),n=e._preRequestSystemClockOffset,a=se(s,o.systemClockOffset);(a!==o.systemClockOffset||n!==void 0&&n!==a)&&r.$metadata&&(o.systemClockOffset=a,r.$metadata.clockSkewCorrected=true);}throw t}}successHandler(e,t){let r=re(e);if(r){let s=Q("config",t.config);s.systemClockOffset=se(r,s.systemClockOffset);}}};chunkBUNLC3II_cjs.h();var ie=class extends B{async sign(e,t,r){if(!chunkGNEVCEJU_cjs.e.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:s,signer:o,signingRegion:n,signingRegionSet:a,signingName:m}=await q(r),f=(await s.sigv4aSigningRegionSet?.()??a??[n]).join(",");return r._preRequestSystemClockOffset=s.systemClockOffset,await o.sign(e,{signingDate:$(s.systemClockOffset),signingRegion:f,signingService:m})}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ce=i=>typeof i=="string"&&i.length>0?i.split(",").map(e=>e.trim()):[];chunkBUNLC3II_cjs.h();var st=i=>`AWS_BEARER_TOKEN_${i.replace(/[\s-]/g,"_").toUpperCase()}`;var it="AWS_AUTH_SCHEME_PREFERENCE",ot="auth_scheme_preference",nt={environmentVariableSelector:(i,e)=>{if(e?.signingName&&st(e.signingName)in i)return ["httpBearerAuth"];if(it in i)return Ce(i[it])},configFileSelector:i=>{if(ot in i)return Ce(i[ot])},default:[]};chunkBUNLC3II_cjs.h();var at=i=>(i.sigv4aSigningRegionSet=chunkLEBM6ZSZ_cjs.H(i.sigv4aSigningRegionSet),i),ct={environmentVariableSelector(i){if(i.AWS_SIGV4A_SIGNING_REGION_SET)return i.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map(e=>e.trim());throw new chunkGNEVCEJU_cjs.o("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:true})},configFileSelector(i){if(i.sigv4a_signing_region_set)return (i.sigv4a_signing_region_set??"").split(",").map(e=>e.trim());throw new chunkGNEVCEJU_cjs.o("sigv4a_signing_region_set not set in profile.",{tryNextLink:true})},default:void 0};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var oe=class{format(e){let t=[];for(let o of Object.keys(e)){let n=chunkLQ3YZTPU_cjs.c(o);t.push(Uint8Array.from([n.byteLength]),n,this.formatHeaderValue(e[o]));}let r=new Uint8Array(t.reduce((o,n)=>o+n.byteLength,0)),s=0;for(let o of t)r.set(o,s),s+=o.byteLength;return r}formatHeaderValue(e){switch(e.type){case "boolean":return Uint8Array.from([e.value?R.boolTrue:R.boolFalse]);case "byte":return Uint8Array.from([R.byte,e.value]);case "short":let t=new DataView(new ArrayBuffer(3));return t.setUint8(0,R.short),t.setInt16(1,e.value,false),new Uint8Array(t.buffer);case "integer":let r=new DataView(new ArrayBuffer(5));return r.setUint8(0,R.integer),r.setInt32(1,e.value,false),new Uint8Array(r.buffer);case "long":let s=new Uint8Array(9);return s[0]=R.long,s.set(e.value.bytes,1),s;case "binary":let o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,R.byteArray),o.setUint16(1,e.value.byteLength,false);let n=new Uint8Array(o.buffer);return n.set(e.value,3),n;case "string":let a=chunkLQ3YZTPU_cjs.c(e.value),m=new DataView(new ArrayBuffer(3+a.byteLength));m.setUint8(0,R.string),m.setUint16(1,a.byteLength,false);let c=new Uint8Array(m.buffer);return c.set(a,3),c;case "timestamp":let f=new Uint8Array(9);return f[0]=R.timestamp,f.set(be.fromNumber(e.value.valueOf()).bytes,1),f;case "uuid":if(!Kt.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let l=new Uint8Array(17);return l[0]=R.uuid,l.set(chunkLQ3YZTPU_cjs.s(e.value.replace(/-/g,"")),1),l}}},R;(function(i){i[i.boolTrue=0]="boolTrue",i[i.boolFalse=1]="boolFalse",i[i.byte=2]="byte",i[i.short=3]="short",i[i.integer=4]="integer",i[i.long=5]="long",i[i.byteArray=6]="byteArray",i[i.string=7]="string",i[i.timestamp=8]="timestamp",i[i.uuid=9]="uuid";})(R||(R={}));var Kt=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,be=class i{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let t=new Uint8Array(8);for(let r=7,s=Math.abs(Math.round(e));r>-1&&s>0;r--,s/=256)t[r]=s;return e<0&&mt(t),new i(t)}valueOf(){let e=this.bytes.slice(0),t=e[0]&128;return t&&mt(e),parseInt(chunkLQ3YZTPU_cjs.t(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}};function mt(i){for(let e=0;e<8;e++)i[e]^=255;for(let e=7;e>-1&&(i[e]++,i[e]===0);e--);}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var ft="X-Amz-Algorithm",dt="X-Amz-Credential",Re="X-Amz-Date",lt="X-Amz-SignedHeaders",ht="X-Amz-Expires",Te="X-Amz-Signature",_e="X-Amz-Security-Token";var ke="authorization",Ie=Re.toLowerCase(),Vt="date",ut=[ke,Ie,Vt],gt=Te.toLowerCase(),v="x-amz-content-sha256",pt=_e.toLowerCase();var yt={authorization:true,"cache-control":true,connection:true,expect:true,from:true,"keep-alive":true,"max-forwards":true,pragma:true,referer:true,te:true,trailer:true,"transfer-encoding":true,upgrade:true,"user-agent":true,"x-amzn-trace-id":true},St=/^proxy-/,wt=/^sec-/;var ne="AWS4-HMAC-SHA256";var Et="AWS4-HMAC-SHA256-PAYLOAD",xt="UNSIGNED-PAYLOAD",At=50,Me="aws4_request",Nt=3600*24*7;var Ct=({query:i={}})=>{let e=[],t={};for(let r of Object.keys(i)){if(r.toLowerCase()===gt)continue;let s=chunkGNEVCEJU_cjs.U(r);e.push(s);let o=i[r];typeof o=="string"?t[s]=`${s}=${chunkGNEVCEJU_cjs.U(o)}`:Array.isArray(o)&&(t[s]=o.slice(0).reduce((n,a)=>n.concat([`${s}=${chunkGNEVCEJU_cjs.U(a)}`]),[]).sort().join("&"));}return e.sort().map(r=>t[r]).filter(r=>r).join("&")};chunkBUNLC3II_cjs.h();var bt=i=>jt(i).toISOString().replace(/\.\d{3}Z$/,"Z"),jt=i=>typeof i=="number"?new Date(i*1e3):typeof i=="string"?Number(i)?new Date(Number(i)*1e3):new Date(i):i;var ae=class{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:r,service:s,sha256:o,uriEscapePath:n=true}){this.service=s,this.sha256=o,this.uriEscapePath=n,this.applyChecksum=typeof e=="boolean"?e:true,this.regionProvider=chunkGNEVCEJU_cjs.h(r),this.credentialProvider=chunkGNEVCEJU_cjs.h(t);}createCanonicalRequest(e,t,r){let s=Object.keys(t).sort();return `${e.method}
2
- ${this.getCanonicalPath(e)}
3
- ${Ct(e)}
4
- ${s.map(o=>`${o}:${t[o]}`).join(`
5
- `)}
6
-
7
- ${s.join(";")}
8
- ${r}`}async createStringToSign(e,t,r,s){let o=new this.sha256;o.update(chunkLQ3YZTPU_cjs.v(r));let n=await o.digest();return `${s}
9
- ${e}
10
- ${t}
11
- ${chunkLQ3YZTPU_cjs.t(n)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let t=[];for(let o of e.split("/"))o?.length!==0&&o!=="."&&(o===".."?t.pop():t.push(o));let r=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return chunkGNEVCEJU_cjs.U(r).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){let t=bt(e).replace(/[-:]/g,"");return {longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}};chunkBUNLC3II_cjs.h();var ce={},De=[],me=(i,e,t)=>`${i}/${e}/${t}/${Me}`,Tt=async(i,e,t,r,s)=>{let o=await Rt(i,e.secretAccessKey,e.accessKeyId),n=`${t}:${r}:${s}:${chunkLQ3YZTPU_cjs.t(o)}:${e.sessionToken}`;if(n in ce)return ce[n];for(De.push(n);De.length>At;)delete ce[De.shift()];let a=`AWS4${e.secretAccessKey}`;for(let m of [t,r,s,Me])a=await Rt(i,a,m);return ce[n]=a};var Rt=(i,e,t)=>{let r=new i(e);return r.update(chunkLQ3YZTPU_cjs.v(t)),r.digest()};chunkBUNLC3II_cjs.h();var ze=({headers:i},e,t)=>{let r={};for(let s of Object.keys(i).sort()){if(i[s]==null)continue;let o=s.toLowerCase();(o in yt||e?.has(o)||St.test(o)||wt.test(o))&&(!t||t&&!t.has(o))||(r[o]=i[s].trim().replace(/\s+/g," "));}return r};chunkBUNLC3II_cjs.h();var fe=async({headers:i,body:e},t)=>{for(let r of Object.keys(i))if(r.toLowerCase()===v)return i[r];if(e==null)return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||chunkLQ3YZTPU_cjs.a(e)){let r=new t;return r.update(chunkLQ3YZTPU_cjs.v(e)),chunkLQ3YZTPU_cjs.t(await r.digest())}return xt};chunkBUNLC3II_cjs.h();var _t=(i,e)=>{i=i.toLowerCase();for(let t of Object.keys(e))if(i===t.toLowerCase())return true;return false};chunkBUNLC3II_cjs.h();var kt=(i,e={})=>{let{headers:t,query:r={}}=chunkGNEVCEJU_cjs.e.clone(i);for(let s of Object.keys(t)){let o=s.toLowerCase();(o.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(o)||e.hoistableHeaders?.has(o))&&(r[s]=t[s],delete t[s]);}return {...i,headers:t,query:r}};chunkBUNLC3II_cjs.h();var Oe=i=>{i=chunkGNEVCEJU_cjs.e.clone(i);for(let e of Object.keys(i.headers))ut.indexOf(e.toLowerCase())>-1&&delete i.headers[e];return i};var K=class extends ae{headerFormatter=new oe;constructor({applyChecksum:e,credentials:t,region:r,service:s,sha256:o,uriEscapePath:n=true}){super({applyChecksum:e,credentials:t,region:r,service:s,sha256:o,uriEscapePath:n});}async presign(e,t={}){let{signingDate:r=new Date,expiresIn:s=3600,unsignableHeaders:o,unhoistableHeaders:n,signableHeaders:a,hoistableHeaders:m,signingRegion:c,signingService:f}=t,l=await this.credentialProvider();this.validateResolvedCredentials(l);let h=c??await this.regionProvider(),{longDate:u,shortDate:p}=this.formatDate(r);if(s>Nt)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let y=me(p,h,f??this.service),S=kt(Oe(e),{unhoistableHeaders:n,hoistableHeaders:m});l.sessionToken&&(S.query[_e]=l.sessionToken),S.query[ft]=ne,S.query[dt]=`${l.accessKeyId}/${y}`,S.query[Re]=u,S.query[ht]=s.toString(10);let C=ze(S,o,a);return S.query[lt]=this.getCanonicalHeaderList(C),S.query[Te]=await this.getSignature(u,y,this.getSigningKey(l,h,p,f),this.createCanonicalRequest(S,C,await fe(e,this.sha256))),S}async sign(e,t){return typeof e=="string"?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:r=new Date,priorSignature:s,signingRegion:o,signingService:n,eventStreamCredentials:a}){let m=o??await this.regionProvider(),{shortDate:c,longDate:f}=this.formatDate(r),l=me(c,m,n??this.service),h=await fe({headers:{},body:t},this.sha256),u=new this.sha256;u.update(e);let p=chunkLQ3YZTPU_cjs.t(await u.digest()),y=[Et,f,l,s,p,h].join(`
12
- `);return this.signString(y,{signingDate:r,signingRegion:m,signingService:n,eventStreamCredentials:a})}async signMessage(e,{signingDate:t=new Date,signingRegion:r,signingService:s,eventStreamCredentials:o}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:r,signingService:s,priorSignature:e.priorSignature,eventStreamCredentials:o}).then(a=>({message:e.message,signature:a}))}async signString(e,{signingDate:t=new Date,signingRegion:r,signingService:s,eventStreamCredentials:o}={}){let n=o??await this.credentialProvider();this.validateResolvedCredentials(n);let a=r??await this.regionProvider(),{shortDate:m}=this.formatDate(t),c=new this.sha256(await this.getSigningKey(n,a,m,s));return c.update(chunkLQ3YZTPU_cjs.v(e)),chunkLQ3YZTPU_cjs.t(await c.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:r,unsignableHeaders:s,signingRegion:o,signingService:n}={}){let a=await this.credentialProvider();this.validateResolvedCredentials(a);let m=o??await this.regionProvider(),c=Oe(e),{longDate:f,shortDate:l}=this.formatDate(t),h=me(l,m,n??this.service);c.headers[Ie]=f,a.sessionToken&&(c.headers[pt]=a.sessionToken);let u=await fe(c,this.sha256);!_t(v,c.headers)&&this.applyChecksum&&(c.headers[v]=u);let p=ze(c,s,r),y=await this.getSignature(f,h,this.getSigningKey(a,m,l,n),this.createCanonicalRequest(c,p,u));return c.headers[ke]=`${ne} Credential=${a.accessKeyId}/${h}, SignedHeaders=${this.getCanonicalHeaderList(p)}, Signature=${y}`,c}async getSignature(e,t,r,s){let o=await this.createStringToSign(e,t,s,ne),n=new this.sha256(await r);return n.update(chunkLQ3YZTPU_cjs.v(o)),chunkLQ3YZTPU_cjs.t(await n.digest())}getSigningKey(e,t,r,s){return Tt(this.sha256,e,r,t,s||this.service)}};chunkBUNLC3II_cjs.h();var Xt={SignatureV4a:null};var It=i=>{let e=i.credentials,t=!!i.credentials,r;Object.defineProperty(i,"credentials",{set(c){c&&c!==e&&c!==r&&(t=true),e=c;let f=Ft(i,{credentials:e,credentialDefaultProvider:i.credentialDefaultProvider}),l=Gt(i,f);if(t&&!l.attributed){let h=typeof e=="object"&&e!==null;r=async u=>{let y=await l(u);return h&&(!y.$source||Object.keys(y.$source).length===0)?chunkLEBM6ZSZ_cjs.b(y,"CREDENTIALS_CODE","e"):y},r.memoized=l.memoized,r.configBound=l.configBound,r.attributed=true;}else r=l;},get(){return r},enumerable:true,configurable:true}),i.credentials=e;let{signingEscapePath:s=true,systemClockOffset:o=i.systemClockOffset||0,sha256:n}=i,a;return i.signer?a=chunkLEBM6ZSZ_cjs.H(i.signer):i.regionInfoProvider?a=()=>chunkLEBM6ZSZ_cjs.H(i.region)().then(async c=>[await i.regionInfoProvider(c,{useFipsEndpoint:await i.useFipsEndpoint(),useDualstackEndpoint:await i.useDualstackEndpoint()})||{},c]).then(([c,f])=>{let{signingRegion:l,signingService:h}=c;i.signingRegion=i.signingRegion||l||f,i.signingName=i.signingName||h||i.serviceId;let u={...i,credentials:i.credentials,region:i.signingRegion,service:i.signingName,sha256:n,uriEscapePath:s},p=i.signerConstructor||K;return new p(u)}):a=async c=>{c=Object.assign({},{name:"sigv4",signingName:i.signingName||i.defaultSigningName,signingRegion:await chunkLEBM6ZSZ_cjs.H(i.region)(),properties:{}},c);let f=c.signingRegion,l=c.signingName;i.signingRegion=i.signingRegion||f,i.signingName=i.signingName||l||i.serviceId;let h={...i,credentials:i.credentials,region:i.signingRegion,service:i.signingName,sha256:n,uriEscapePath:s},u=i.signerConstructor||K;return new u(h)},Object.assign(i,{systemClockOffset:o,signingEscapePath:s,signer:a})};function Ft(i,{credentials:e,credentialDefaultProvider:t}){let r;return e?e?.memoized?r=e:r=chunkLEBM6ZSZ_cjs.M(e,chunkLEBM6ZSZ_cjs.K,chunkLEBM6ZSZ_cjs.L):t?r=chunkLEBM6ZSZ_cjs.H(t(Object.assign({},i,{parentClientConfig:i}))):r=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=true,r}function Gt(i,e){if(e.configBound)return e;let t=async r=>e({...r,callerClientConfig:i});return t.memoized=e.memoized,t.configBound=true,t}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var M=class{queryCompat;errorRegistry;constructor(e=false){this.queryCompat=e;}resolveRestContentType(e,t){let r=t.getMemberSchemas(),s=Object.values(r).find(o=>!!o.getMergedTraits().httpPayload);if(s){let o=s.getMergedTraits().mediaType;return o||(s.isStringSchema()?"text/plain":s.isBlobSchema()?"application/octet-stream":e)}else if(!t.isUnitSchema()&&Object.values(r).find(n=>{let{httpQuery:a,httpQueryParams:m,httpHeader:c,httpLabel:f,httpPrefixHeaders:l}=n.getMergedTraits();return !a&&!m&&!c&&!f&&l===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,r,s,o,n){let a=e;e.includes("#")&&([,a]=e.split("#"));let m={$metadata:o,$fault:r.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return {errorSchema:n?.(this.errorRegistry,a)??this.errorRegistry.getSchema(e),errorMetadata:m}}catch{s.message=s.message??s.Message??"UnknownError";let f=this.errorRegistry,l=f.getBaseException();if(l){let p=f.getErrorCtor(l)??Error;throw this.decorateServiceException(Object.assign(new p({name:a}),m),s)}let h=s,u=h?.message??h?.Message??h?.Error?.Message??h?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(u),{name:a},m),s)}}compose(e,t,r){let s=r;t.includes("#")&&([s]=t.split("#"));let o=chunkGNEVCEJU_cjs.n.for(s),n=chunkGNEVCEJU_cjs.n.for("smithy.ts.sdk.synthetic."+r);e.copyFrom(o),e.copyFrom(n),this.errorRegistry=e;}decorateServiceException(e,t={}){if(this.queryCompat){let r=e.Message??t.Message,s=chunkLEBM6ZSZ_cjs.g(e,t);r&&(s.message=r);let o=s.Error??{};o.Type=s.Error?.Type,o.Code=s.Error?.Code,o.Message=s.Error?.message??s.Error?.Message??r,s.Error=o;let n=s.$metadata.requestId;return n&&(s.RequestId=n),s}return chunkLEBM6ZSZ_cjs.g(e,t)}setQueryCompatError(e,t){let r=t.headers?.["x-amzn-query-error"];if(e!==void 0&&r!=null){let[s,o]=r.split(";"),n=Object.keys(e),a={Code:s,Type:o};e.Code=s,e.Type=o;for(let m=0;m<n.length;m++){let c=n[m];a[c==="message"?"Message":c]=e[c];}delete a.__type,e.Error=a;}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code);}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(s=>chunkGNEVCEJU_cjs.m.of(s).getMergedTraits().awsQueryError?.[0]===t)}}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var x=class{serdeContext;setSerdeContext(e){this.serdeContext=e;}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var V=class{from;to;keys;constructor(e,t){this.from=e,this.to=t;let r=Object.keys(this.from),s=new Set(r);s.delete("__type"),this.keys=s;}mark(e){this.keys.delete(e);}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){let e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t];}}};chunkBUNLC3II_cjs.h();function Mt(i,e,t){if(t?.source){let r=t.source;if(typeof e=="number"&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER||r!==String(e)))return r.includes(".")?new chunkLQ3YZTPU_cjs.r(r,"bigDecimal"):BigInt(r)}return e}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Dt=(i,e)=>chunkGNEVCEJU_cjs.J(i,e).then(t=>(e?.utf8Encoder??chunkLQ3YZTPU_cjs.e)(t));var Ot=(i,e)=>Dt(i,e).then(t=>{if(t.length)try{return JSON.parse(t)}catch(r){throw r?.name==="SyntaxError"&&Object.defineProperty(r,"$responseBodyText",{value:t}),r}return {}});var zt=(i,e)=>Object.keys(i).find(t=>t.toLowerCase()===e.toLowerCase()),Pe=i=>{let e=i;return typeof e=="number"&&(e=e.toString()),e.indexOf(",")>=0&&(e=e.split(",")[0]),e.indexOf(":")>=0&&(e=e.split(":")[0]),e.indexOf("#")>=0&&(e=e.split("#")[1]),e},Pt=(i,e)=>vt(i,e,["header","code","type"]);var vt=({headers:i},e,t)=>{for(;t.length>0;)switch(t.shift()){case "header":let s=zt(i??{},"x-amzn-errortype");if(s!==void 0)return Pe(i[s]);break;case "code":let o=zt(e??{},"code");if(o&&e[o]!==void 0)return Pe(e[o]);break;case "type":if(e?.__type!==void 0)return Pe(e.__type);break}};var de=class extends x{settings;constructor(e){super(),this.settings=e;}async read(e,t){return this._read(e,typeof t=="string"?JSON.parse(t,Mt):await Ot(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){let r=t!==null&&typeof t=="object",s=chunkGNEVCEJU_cjs.m.of(e);if(r){if(s.isStructSchema()){let n=t,a=s.isUnionSchema(),m={},c,{jsonName:f}=this.settings;f&&(c={});let l;a&&(l=new V(n,m));for(let[h,u]of s.structIterator()){let p=h;f&&(p=u.getMergedTraits().jsonName??p,c[p]=h),a&&l.mark(p),n[p]!=null&&(m[h]=this._read(u,n[p]));}if(a)l.writeUnknown();else if(typeof n.__type=="string")for(let h in n){let u=n[h],p=f?c[h]??h:h;p in m||(m[p]=u);}return m}if(Array.isArray(t)&&s.isListSchema()){let n=s.getValueSchema(),a=[];for(let m of t)a.push(this._read(n,m));return a}if(s.isMapSchema()){let n=s.getValueSchema(),a={};for(let m in t)a[m]=this._read(n,t[m]);return a}}if(s.isBlobSchema()&&typeof t=="string")return chunkLQ3YZTPU_cjs.b(t);let o=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof t=="string"&&o)return o==="application/json"||o.endsWith("+json")?chunkLQ3YZTPU_cjs.k.from(t):t;if(s.isTimestampSchema()&&t!=null)switch(chunkGNEVCEJU_cjs.N(s,this.settings)){case 5:return chunkLQ3YZTPU_cjs.h(t);case 6:return chunkLQ3YZTPU_cjs.i(t);case 7:return chunkLQ3YZTPU_cjs.j(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(s.isBigIntegerSchema()&&(typeof t=="number"||typeof t=="string"))return BigInt(t);if(s.isBigDecimalSchema()&&t!=null){if(t instanceof chunkLQ3YZTPU_cjs.r)return t;let n=t;return n.type==="bigDecimal"&&"string"in n?new chunkLQ3YZTPU_cjs.r(n.string,n.type):new chunkLQ3YZTPU_cjs.r(String(t),"bigDecimal")}if(s.isNumericSchema()&&typeof t=="string"){switch(t){case "Infinity":return 1/0;case "-Infinity":return -1/0;case "NaN":return NaN}return t}if(s.isDocumentSchema())if(r){let n=Array.isArray(t)?[]:{};for(let a in t){let m=t[a];m instanceof chunkLQ3YZTPU_cjs.r?n[a]=m:n[a]=this._read(s,m);}return n}else return structuredClone(t);return t}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ht="\u039D",le=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,t)=>{if(t instanceof chunkLQ3YZTPU_cjs.r){let r=`${Ht+"nv"+this.counter++}_`+t.string;return this.values.set(`"${r}"`,t.string),r}if(typeof t=="bigint"){let r=t.toString(),s=`${Ht+"b"+this.counter++}_`+r;return this.values.set(`"${s}"`,r),s}return t}}replaceInJson(e){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(let[t,r]of this.values)e=e.replace(t,r);return e}};var he=class extends x{settings;buffer;useReplacer=false;rootSchema;constructor(e){super(),this.settings=e;}write(e,t){this.rootSchema=chunkGNEVCEJU_cjs.m.of(e),this.buffer=this._write(this.rootSchema,t);}flush(){let{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=false,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);let r=new le;return r.replaceInJson(JSON.stringify(this.buffer,r.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(e,t){this.write(e,t),typeof this.buffer=="object"&&(this.buffer.__type=chunkGNEVCEJU_cjs.m.of(e).getName(true));}_write(e,t,r){let s=t!==null&&typeof t=="object",o=chunkGNEVCEJU_cjs.m.of(e);if(s){if(o.isStructSchema()){let n=t,a={},{jsonName:m}=this.settings,c;m&&(c={});let f=0;for(let[l,h]of o.structIterator()){let u=this._write(h,n[l],o);if(u!==void 0){let p=l;m&&(p=h.getMergedTraits().jsonName??l,c[l]=p),a[p]=u,f++;}}if(o.isUnionSchema()&&f===0){let{$unknown:l}=n;if(Array.isArray(l)){let[h,u]=l;a[h]=this._write(15,u);}}else if(typeof n.__type=="string")for(let l in n){let h=n[l],u=m?c[l]??l:l;u in a||(a[u]=this._write(15,h));}return a}if(Array.isArray(t)&&o.isListSchema()){let n=o.getValueSchema(),a=[],m=!!o.getMergedTraits().sparse;for(let c of t)(m||c!=null)&&a.push(this._write(n,c));return a}if(o.isMapSchema()){let n=o.getValueSchema(),a={},m=!!o.getMergedTraits().sparse;for(let c in t){let f=t[c];(m||f!=null)&&(a[c]=this._write(n,f));}return a}if(t instanceof Uint8Array&&(o.isBlobSchema()||o.isDocumentSchema()))return o===this.rootSchema?t:(this.serdeContext?.base64Encoder??chunkLQ3YZTPU_cjs.d)(t);if(t instanceof Date&&(o.isTimestampSchema()||o.isDocumentSchema()))switch(chunkGNEVCEJU_cjs.N(o,this.settings)){case 5:return t.toISOString().replace(".000Z","Z");case 6:return chunkLQ3YZTPU_cjs.f(t);case 7:return t.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",t),t.getTime()/1e3}t instanceof chunkLQ3YZTPU_cjs.r&&(this.useReplacer=true);}if(!(t===null&&r?.isStructSchema())){if(o.isStringSchema()){if(typeof t>"u"&&o.isIdempotencyToken())return chunkLQ3YZTPU_cjs.D();let n=o.getMergedTraits().mediaType;return t!=null&&n&&(n==="application/json"||n.endsWith("+json"))?chunkLQ3YZTPU_cjs.k.from(t):t}if(typeof t=="number"&&o.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if(typeof t=="string"&&o.isBlobSchema())return o===this.rootSchema?t:(this.serdeContext?.base64Encoder??chunkLQ3YZTPU_cjs.d)(t);if(typeof t=="bigint"&&(this.useReplacer=true),o.isDocumentSchema())if(s){let n=Array.isArray(t)?[]:{};for(let a in t){let m=t[a];m instanceof chunkLQ3YZTPU_cjs.r?(this.useReplacer=true,n[a]=m):n[a]=this._write(o,m);}return n}else return structuredClone(t);return t}}};var ue=class extends x{settings;constructor(e){super(),this.settings=e;}createSerializer(){let e=new he(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new de(this.settings);return e.setSerdeContext(this.serdeContext),e}};var He=class extends chunkGNEVCEJU_cjs.L{serializer;deserializer;codec;mixin=new M;constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t});let r={timestampFormat:{useTrait:true,default:7},httpBindings:true,jsonName:true};this.codec=new ue(r),this.serializer=new chunkGNEVCEJU_cjs.Q(this.codec.createSerializer(),r),this.deserializer=new chunkGNEVCEJU_cjs.P(this.codec.createDeserializer(),r);}getShapeId(){return "aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e);}async serializeRequest(e,t,r){let s=await super.serializeRequest(e,t,r),o=chunkGNEVCEJU_cjs.m.of(e.input);if(!s.headers["content-type"]){let n=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);n&&(s.headers["content-type"]=n);}return s.body==null&&s.headers["content-type"]===this.getDefaultContentType()&&(s.body="{}"),s}async deserializeResponse(e,t,r){let s=await super.deserializeResponse(e,t,r),o=chunkGNEVCEJU_cjs.m.of(e.output);for(let[n,a]of o.structIterator())a.getMemberTraits().httpPayload&&!(n in s)&&(s[n]=null);return s}async handleError(e,t,r,s,o){let n=Pt(r,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,n,this.options.defaultNamespace);let{errorSchema:a,errorMetadata:m}=await this.mixin.getErrorSchemaOrThrowBaseException(n,this.options.defaultNamespace,r,s,o),c=chunkGNEVCEJU_cjs.m.of(a),f=s.message??s.Message??"UnknownError",l=this.compositeErrorRegistry.getErrorCtor(a)??Error,h=new l({});await this.deserializeHttpMessage(a,t,r,s);let u={},p=this.codec.createDeserializer();for(let[y,S]of c.structIterator()){let C=S.getMergedTraits().jsonName??y;u[y]=p.readObject(S,s[C]);}throw this.mixin.decorateServiceException(Object.assign(h,m,{$fault:c.getMergedTraits().error,message:f},u),s)}getDefaultContentType(){return "application/json"}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Jt=/[&<>"]/g,Wt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function $t(i){return i.replace(Jt,e=>Wt[e])}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Yt=/[&"'<>\r\n\u0085\u2028]/g,Zt={"&":"&amp;",'"':"&quot;","'":"&apos;","<":"&lt;",">":"&gt;","\r":"&#x0D;","\n":"&#x0A;","\x85":"&#x85;","\u2028":"&#x2028;"};function Ut(i){return i.replace(Yt,e=>Zt[e])}var D=class{value;constructor(e){this.value=e;}toString(){return Ut(""+this.value)}};var A=class i{name;children;attributes={};static of(e,t,r){let s=new i(e);return t!==void 0&&s.addChildNode(new D(t)),r!==void 0&&s.withName(r),s}constructor(e,t=[]){this.name=e,this.children=t;}withName(e){return this.name=e,this}addAttribute(e,t){return this.attributes[e]=t,this}addChildNode(e){return this.children.push(e),this}removeAttribute(e){return delete this.attributes[e],this}n(e){return this.name=e,this}c(e){return this.children.push(e),this}a(e,t){return t!=null&&(this.attributes[e]=t),this}cc(e,t,r=t){if(e[t]!=null){let s=i.of(t,e[t]).withName(r);this.c(s);}}l(e,t,r,s){e[t]!=null&&s().map(n=>{n.withName(r),this.c(n);});}lc(e,t,r,s){if(e[t]!=null){let o=s(),n=new i(r);o.map(a=>{n.c(a);}),this.c(n);}}toString(){let e=!!this.children.length,t=`<${this.name}`,r=this.attributes;for(let s of Object.keys(r)){let o=r[s];o!=null&&(t+=` ${s}="${$t(""+o)}"`);}return t+=e?`>${this.children.map(s=>s.toString()).join("")}</${this.name}>`:"/>"}};chunkBUNLC3II_cjs.h();function Ue(i){return new $e(i).parse()}var $e=class i{x;i=0;z;constructor(e){this.x=e,this.x=e.replace(/\r\n?/g,`
13
- `),this.z=this.x.length;}parse(){let e=this,{z:t}=e;for(;e.i<t&&(e.trim(),!(e.i>=t));)if(e.isNext("<?"))e.readTo("?>"),e.trim();else if(e.isNext("<!--"))e.readTo("-->"),e.trim();else if(e.isNext("<!DOCTYPE",false))e.skipDoctype(),e.trim();else if(e.x[e.i]==="<"){let r=e.parseTag();return {[r.tag]:r.value}}else throw new Error("@aws-sdk XML parse error: unexpected content.");throw new Error("@aws-sdk XML parse error: no root element.")}isNext(e,t=true){let r=this;return t?r.x.startsWith(e,r.i):r.x.toLowerCase().startsWith(e.toLowerCase(),r.i)}readTo(e){let t=this,r=t.x.indexOf(e,t.i);if(r===-1)throw new Error(`@aws-sdk XML parse error: expected "${e}" not found.`);let s=t.x.slice(t.i,r);return t.i=r+e.length,s}trim(){let e=this;for(;e.i<e.z&&` \r
14
- `.includes(e.x[e.i]);)++e.i;}readAttrValue(){let e=this,t=e.x[e.i];++e.i;let r="";for(;e.i<e.z&&e.x[e.i]!==t;)r+=e.x[e.i++];return ++e.i,e.decodeEntities(r)}parseTag(){let e=this;++e.i;let t="";for(;e.i<e.z&&!` \r
15
- >/`.includes(e.x[e.i]);)t+=e.x[e.i++];let r=false,s=Object.create(null);for(;e.i<e.z&&(e.trim(),!">/".includes(e.x[e.i]));){let f="";for(;e.i<e.z&&!`= \r
16
- >/?`.includes(e.x[e.i]);)f+=e.x[e.i++];if(e.trim(),e.x[e.i]!=="=")break;++e.i,e.trim(),s[f]=e.readAttrValue(),r=true;}if(e.i>=e.z)throw new Error("@aws-sdk XML parse error: unexpected end of input.");if(e.x[e.i]==="/"){if(++e.i,e.i>=e.z||e.x[e.i]!==">")throw new Error("@aws-sdk XML parse error: expected > at the end of self-closing tag.");return ++e.i,Object.setPrototypeOf(s,Object.prototype),{tag:t,value:r?s:""}}if(e.x[e.i]!==">")throw new Error("@aws-sdk XML parse error: expected > at the end of opening tag.");++e.i;let o=[],n=[],a=false;for(;e.i<e.z&&!e.isNext("</");)if(e.x[e.i]==="<")e.isNext("<!--")?e.readTo("-->"):e.isNext("<![CDATA[")?(e.i+=9,o.push(e.readTo("]]>"))):e.isNext("<?")?e.readTo("?>"):(a=true,n.push(e.parseTag()));else {let f="";for(;e.i<e.z&&e.x[e.i]!=="<";)f+=e.x[e.i++];o.push(e.decodeEntities(f));}if(!e.isNext("</"))throw new Error(`@aws-sdk XML parse error: missing closing tag </${t}>.`);e.i+=2;let m=e.readTo(">").trim();if(m!==t)throw new Error(`@aws-sdk XML parse error: mismatched tags <${t}> and </${m}>.`);if(!r&&o.length===0&&!a)return {tag:t,value:""};if(!r&&!a){let f=o.length===1?o[0]:o.join("");return f.trim()===""&&f.includes(`
17
- `)?{tag:t,value:""}:{tag:t,value:f}}let c=Object.create(null);for(let f of o)f.trim()===""&&f.includes(`
18
- `)||(c["#text"]="#text"in c?c["#text"]+f:f);for(let f of n)f.tag in c?Array.isArray(c[f.tag])?c[f.tag].push(f.value):c[f.tag]=[c[f.tag],f.value]:c[f.tag]=f.value;for(let[f,l]of Object.entries(s))c[f]=l;return Object.setPrototypeOf(c,Object.prototype),{tag:t,value:c}}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};skipDoctype(){let e=this;e.i+=9;let t=0;for(;e.i<e.z;){let r=e.x[e.i];if(r==="[")++t;else if(r==="]")--t;else if(r===">"&&t===0){++e.i;return}++e.i;}throw new Error("@aws-sdk XML parse error: unclosed DOCTYPE.")}decodeEntities(e){return e.replace(/&(?:#x([0-9a-fA-F]{1,6})|#(\d{1,7})|([a-zA-Z][a-zA-Z0-9]{0,30}));/g,(t,r,s,o)=>r?String.fromCharCode(parseInt(r,16)):s?String.fromCharCode(parseInt(s,10)):i.ENTITIES[o]??"")}};var j=class extends x{settings;stringDeserializer;constructor(e){super(),this.settings=e,this.stringDeserializer=new chunkGNEVCEJU_cjs.O(e);}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e);}read(e,t,r){let s=chunkGNEVCEJU_cjs.m.of(e),o=s.getMemberSchemas();if(s.isStructSchema()&&s.isMemberSchema()&&!!Object.values(o).find(c=>!!c.getMemberTraits().eventPayload)){let c={},f=Object.keys(o)[0];return o[f].isBlobSchema()?c[f]=t:c[f]=this.read(o[f],t),c}let a=(this.serdeContext?.utf8Encoder??chunkLQ3YZTPU_cjs.e)(t),m=this.parseXml(a);return this.readSchema(e,r?m[r]:m)}readSchema(e,t){let r=chunkGNEVCEJU_cjs.m.of(e);if(r.isUnitSchema())return;let s=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(t))return this.readSchema(r,[t]);if(t==null)return t;if(typeof t=="object"){let o=!!s.xmlFlattened;if(r.isListSchema()){let a=r.getValueSchema(),m=[],c=a.getMergedTraits().xmlName??"member",f=o?t:(t[0]??t)[c];if(f==null)return m;let l=Array.isArray(f)?f:[f];for(let h of l)m.push(this.readSchema(a,h));return m}let n={};if(r.isMapSchema()){let a=r.getKeySchema(),m=r.getValueSchema(),c;o?c=Array.isArray(t)?t:[t]:c=Array.isArray(t.entry)?t.entry:[t.entry];let f=a.getMergedTraits().xmlName??"key",l=m.getMergedTraits().xmlName??"value";for(let h of c){let u=h[f],p=h[l];n[u]=this.readSchema(m,p);}return n}if(r.isStructSchema()){let a=r.isUnionSchema(),m;a&&(m=new V(t,n));for(let[c,f]of r.structIterator()){let l=f.getMergedTraits(),h=l.httpPayload?l.xmlName??f.getName():f.getMemberTraits().xmlName??c;a&&m.mark(h),t[h]!=null&&(n[c]=this.readSchema(f,t[h]));}return a&&m.writeUnknown(),n}if(r.isDocumentSchema())return t;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(true)}`)}return r.isListSchema()?[]:r.isMapSchema()||r.isStructSchema()?{}:this.stringDeserializer.read(r,t)}parseXml(e){if(e.length){let t;try{t=Ue(e);}catch(n){throw n&&typeof n=="object"&&Object.defineProperty(n,"$responseBodyText",{value:e}),n}let r="#text",s=Object.keys(t)[0],o=t[s];return o[r]&&(o[s]=o[r],delete o[r]),chunkLEBM6ZSZ_cjs.l(o)}return {}}};chunkBUNLC3II_cjs.h();var ge=class extends x{settings;buffer;constructor(e){super(),this.settings=e;}write(e,t,r=""){this.buffer===void 0&&(this.buffer="");let s=chunkGNEVCEJU_cjs.m.of(e);if(r&&!r.endsWith(".")&&(r+="."),s.isBlobSchema())(typeof t=="string"||t instanceof Uint8Array)&&(this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??chunkLQ3YZTPU_cjs.d)(t)));else if(s.isBooleanSchema()||s.isNumericSchema()||s.isStringSchema())t!=null?(this.writeKey(r),this.writeValue(String(t))):s.isIdempotencyToken()&&(this.writeKey(r),this.writeValue(chunkLQ3YZTPU_cjs.D()));else if(s.isBigIntegerSchema())t!=null&&(this.writeKey(r),this.writeValue(String(t)));else if(s.isBigDecimalSchema())t!=null&&(this.writeKey(r),this.writeValue(t instanceof chunkLQ3YZTPU_cjs.r?t.string:String(t)));else if(s.isTimestampSchema()){if(t instanceof Date)switch(this.writeKey(r),chunkGNEVCEJU_cjs.N(s,this.settings)){case 5:this.writeValue(t.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(chunkLQ3YZTPU_cjs.f(t));break;case 7:this.writeValue(String(t.getTime()/1e3));break}}else if(s.isDocumentSchema())Array.isArray(t)?this.write(79,t,r):t instanceof Date?this.write(4,t,r):t instanceof Uint8Array?this.write(21,t,r):t&&typeof t=="object"?this.write(143,t,r):(this.writeKey(r),this.writeValue(String(t)));else if(s.isListSchema()){if(Array.isArray(t))if(t.length===0)this.settings.serializeEmptyLists&&(this.writeKey(r),this.writeValue(""));else {let o=s.getValueSchema(),n=this.settings.flattenLists||s.getMergedTraits().xmlFlattened,a=1;for(let m of t){if(m==null)continue;let c=o.getMergedTraits(),f=this.getKey("member",c.xmlName,c.ec2QueryName),l=n?`${r}${a}`:`${r}${f}.${a}`;this.write(o,m,l),++a;}}}else if(s.isMapSchema()){if(t&&typeof t=="object"){let o=s.getKeySchema(),n=s.getValueSchema(),a=s.getMergedTraits().xmlFlattened,m=1;for(let c in t){let f=t[c];if(f==null)continue;let l=o.getMergedTraits(),h=this.getKey("key",l.xmlName,l.ec2QueryName),u=a?`${r}${m}.${h}`:`${r}entry.${m}.${h}`,p=n.getMergedTraits(),y=this.getKey("value",p.xmlName,p.ec2QueryName),S=a?`${r}${m}.${y}`:`${r}entry.${m}.${y}`;this.write(o,c,u),this.write(n,f,S),++m;}}}else if(s.isStructSchema()){if(t&&typeof t=="object"){let o=false;for(let[n,a]of s.structIterator()){if(t[n]==null&&!a.isIdempotencyToken())continue;let m=a.getMergedTraits(),c=this.getKey(n,m.xmlName,m.ec2QueryName,"struct"),f=`${r}${c}`;this.write(a,t[n],f),o=true;}if(!o&&s.isUnionSchema()){let{$unknown:n}=t;if(Array.isArray(n)){let[a,m]=n,c=`${r}${a}`;this.write(15,m,c);}}}}else if(!s.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${s.getName(true)}`)}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");let e=this.buffer;return delete this.buffer,e}getKey(e,t,r,s){let{ec2:o,capitalizeKeys:n}=this.settings;if(o&&r)return r;let a=t??e;return n&&s==="struct"?a[0].toUpperCase()+a.slice(1):a}writeKey(e){e.endsWith(".")&&(e=e.slice(0,e.length-1)),this.buffer+=`&${chunkGNEVCEJU_cjs.K(e)}=`;}writeValue(e){this.buffer+=chunkGNEVCEJU_cjs.K(e);}};var Le=class extends chunkGNEVCEJU_cjs.M{options;serializer;deserializer;mixin=new M;constructor(e){super({defaultNamespace:e.defaultNamespace,errorTypeRegistries:e.errorTypeRegistries}),this.options=e;let t={timestampFormat:{useTrait:true,default:5},httpBindings:false,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:true};this.serializer=new ge(t),this.deserializer=new j(t);}getShapeId(){return "aws.protocols#awsQuery"}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e);}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(e,t,r){let s=await super.serializeRequest(e,t,r);s.path.endsWith("/")||(s.path+="/"),s.headers["content-type"]="application/x-www-form-urlencoded",(chunkGNEVCEJU_cjs.k(e.input)==="unit"||!s.body)&&(s.body="");let o=e.name.split("#")[1]??e.name;return s.body=`Action=${o}&Version=${this.options.version}`+s.body,s.body.endsWith("&")&&(s.body=s.body.slice(-1)),s}async deserializeResponse(e,t,r){let s=this.deserializer,o=chunkGNEVCEJU_cjs.m.of(e.output),n={};if(r.statusCode>=300){let f=await chunkGNEVCEJU_cjs.J(r.body,t);f.byteLength>0&&Object.assign(n,await s.read(15,f)),await this.handleError(e,t,r,n,this.deserializeMetadata(r));}for(let f in r.headers){let l=r.headers[f];delete r.headers[f],r.headers[f.toLowerCase()]=l;}let a=e.name.split("#")[1]??e.name,m=o.isStructSchema()&&this.useNestedResult()?a+"Result":void 0,c=await chunkGNEVCEJU_cjs.J(r.body,t);return c.byteLength>0&&Object.assign(n,await s.read(o,c,m)),n.$metadata=this.deserializeMetadata(r),n}useNestedResult(){return true}async handleError(e,t,r,s,o){let n=this.loadQueryErrorCode(r,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,n,this.options.defaultNamespace);let a=this.loadQueryError(s)??{},m=this.loadQueryErrorMessage(s);a.message=m,a.Error={Type:a.Type,Code:a.Code,Message:m};let{errorSchema:c,errorMetadata:f}=await this.mixin.getErrorSchemaOrThrowBaseException(n,this.options.defaultNamespace,r,a,o,this.mixin.findQueryCompatibleError),l=chunkGNEVCEJU_cjs.m.of(c),h=this.compositeErrorRegistry.getErrorCtor(c)??Error,u=new h({}),p={Type:a.Error.Type,Code:a.Error.Code,Error:a.Error};for(let[y,S]of l.structIterator()){let C=S.getMergedTraits().xmlName??y,N=a[C]??s[C];p[y]=this.deserializer.readSchema(S,N);}throw this.mixin.decorateServiceException(Object.assign(u,f,{$fault:l.getMergedTraits().error,message:m},p),s)}loadQueryErrorCode(e,t){let r=(t.Errors?.[0]?.Error??t.Errors?.Error??t.Error)?.Code;if(r!==void 0)return r;if(e.statusCode==404)return "NotFound"}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){let t=this.loadQueryError(e);return t?.message??t?.Message??e.message??e.Message??"Unknown"}getDefaultContentType(){return "application/x-www-form-urlencoded"}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Lt=(i,e)=>{if(e?.Error?.Code!==void 0)return e.Error.Code;if(e?.Code!==void 0)return e.Code;if(i.statusCode==404)return "NotFound"};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var pe=class extends x{settings;stringBuffer;byteBuffer;buffer;constructor(e){super(),this.settings=e;}write(e,t){let r=chunkGNEVCEJU_cjs.m.of(e);if(r.isStringSchema()&&typeof t=="string")this.stringBuffer=t;else if(r.isBlobSchema())this.byteBuffer="byteLength"in t?t:(this.serdeContext?.base64Decoder??chunkLQ3YZTPU_cjs.b)(t);else {this.buffer=this.writeStruct(r,t,void 0);let s=r.getMergedTraits();s.httpPayload&&!s.xmlName&&this.buffer.withName(r.getName());}}flush(){if(this.byteBuffer!==void 0){let t=this.byteBuffer;return delete this.byteBuffer,t}if(this.stringBuffer!==void 0){let t=this.stringBuffer;return delete this.stringBuffer,t}let e=this.buffer;return this.settings.xmlNamespace&&(e?.attributes?.xmlns||e.addAttribute("xmlns",this.settings.xmlNamespace)),delete this.buffer,e.toString()}writeStruct(e,t,r){let s=e.getMergedTraits(),o=e.isMemberSchema()&&!s.httpPayload?e.getMemberTraits().xmlName??e.getMemberName():s.xmlName??e.getName();if(!o||!e.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${e.getName(true)}.`);let n=A.of(o),[a,m]=this.getXmlnsAttribute(e,r);for(let[f,l]of e.structIterator()){let h=t[f];if(h!=null||l.isIdempotencyToken()){if(l.getMergedTraits().xmlAttribute){n.addAttribute(l.getMergedTraits().xmlName??f,this.writeSimple(l,h));continue}if(l.isListSchema())this.writeList(l,h,n,m);else if(l.isMapSchema())this.writeMap(l,h,n,m);else if(l.isStructSchema())n.addChildNode(this.writeStruct(l,h,m));else {let u=A.of(l.getMergedTraits().xmlName??l.getMemberName());this.writeSimpleInto(l,h,u,m),n.addChildNode(u);}}}let{$unknown:c}=t;if(c&&e.isUnionSchema()&&Array.isArray(c)&&Object.keys(t).length===1){let[f,l]=c,h=A.of(f);if(typeof l!="string")if(t instanceof A||t instanceof D)n.addChildNode(t);else throw new Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,l,h,m),n.addChildNode(h);}return m&&n.addAttribute(a,m),n}writeList(e,t,r,s){if(!e.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${e.getName(true)}`);let o=e.getMergedTraits(),n=e.getValueSchema(),a=n.getMergedTraits(),m=!!a.sparse,c=!!o.xmlFlattened,[f,l]=this.getXmlnsAttribute(e,s),h=(u,p)=>{if(n.isListSchema())this.writeList(n,Array.isArray(p)?p:[p],u,l);else if(n.isMapSchema())this.writeMap(n,p,u,l);else if(n.isStructSchema()){let y=this.writeStruct(n,p,l);u.addChildNode(y.withName(c?o.xmlName??e.getMemberName():a.xmlName??"member"));}else {let y=A.of(c?o.xmlName??e.getMemberName():a.xmlName??"member");this.writeSimpleInto(n,p,y,l),u.addChildNode(y);}};if(c)for(let u of t)(m||u!=null)&&h(r,u);else {let u=A.of(o.xmlName??e.getMemberName());l&&u.addAttribute(f,l);for(let p of t)(m||p!=null)&&h(u,p);r.addChildNode(u);}}writeMap(e,t,r,s,o=false){if(!e.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${e.getName(true)}`);let n=e.getMergedTraits(),a=e.getKeySchema(),c=a.getMergedTraits().xmlName??"key",f=e.getValueSchema(),l=f.getMergedTraits(),h=l.xmlName??"value",u=!!l.sparse,p=!!n.xmlFlattened,[y,S]=this.getXmlnsAttribute(e,s),C=(N,z,T)=>{let X=A.of(c,z),[Bt,Ke]=this.getXmlnsAttribute(a,S);Ke&&X.addAttribute(Bt,Ke),N.addChildNode(X);let F=A.of(h);f.isListSchema()?this.writeList(f,T,F,S):f.isMapSchema()?this.writeMap(f,T,F,S,true):f.isStructSchema()?F=this.writeStruct(f,T,S):this.writeSimpleInto(f,T,F,S),N.addChildNode(F);};if(p)for(let N in t){let z=t[N];if(u||z!=null){let T=A.of(n.xmlName??e.getMemberName());C(T,N,z),r.addChildNode(T);}}else {let N;o||(N=A.of(n.xmlName??e.getMemberName()),S&&N.addAttribute(y,S),r.addChildNode(N));for(let z in t){let T=t[z];if(u||T!=null){let X=A.of("entry");C(X,z,T),(o?r:N).addChildNode(X);}}}}writeSimple(e,t){if(t===null)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");let r=chunkGNEVCEJU_cjs.m.of(e),s=null;if(t&&typeof t=="object")if(r.isBlobSchema())s=(this.serdeContext?.base64Encoder??chunkLQ3YZTPU_cjs.d)(t);else if(r.isTimestampSchema()&&t instanceof Date)switch(chunkGNEVCEJU_cjs.N(r,this.settings)){case 5:s=t.toISOString().replace(".000Z","Z");break;case 6:s=chunkLQ3YZTPU_cjs.f(t);break;case 7:s=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",t),s=chunkLQ3YZTPU_cjs.f(t);break}else {if(r.isBigDecimalSchema()&&t)return t instanceof chunkLQ3YZTPU_cjs.r?t.string:String(t);throw r.isMapSchema()||r.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${r.getName(true)}`)}if((r.isBooleanSchema()||r.isNumericSchema()||r.isBigIntegerSchema()||r.isBigDecimalSchema())&&(s=String(t)),r.isStringSchema()&&(t===void 0&&r.isIdempotencyToken()?s=chunkLQ3YZTPU_cjs.D():s=String(t)),s===null)throw new Error(`Unhandled schema-value pair ${r.getName(true)}=${t}`);return s}writeSimpleInto(e,t,r,s){let o=this.writeSimple(e,t),n=chunkGNEVCEJU_cjs.m.of(e),a=new D(o),[m,c]=this.getXmlnsAttribute(n,s);c&&r.addAttribute(m,c),r.addChildNode(a);}getXmlnsAttribute(e,t){let r=e.getMergedTraits(),[s,o]=r.xmlNamespace??[];return o&&o!==t?[s?`xmlns:${s}`:"xmlns",o]:[void 0,void 0]}};var ye=class extends x{settings;constructor(e){super(),this.settings=e;}createSerializer(){let e=new pe(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new j(this.settings);return e.setSerdeContext(this.serdeContext),e}};var Be=class extends chunkGNEVCEJU_cjs.L{codec;serializer;deserializer;mixin=new M;constructor(e){super(e);let t={timestampFormat:{useTrait:true,default:5},httpBindings:true,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace};this.codec=new ye(t),this.serializer=new chunkGNEVCEJU_cjs.Q(this.codec.createSerializer(),t),this.deserializer=new chunkGNEVCEJU_cjs.P(this.codec.createDeserializer(),t);}getPayloadCodec(){return this.codec}getShapeId(){return "aws.protocols#restXml"}async serializeRequest(e,t,r){let s=await super.serializeRequest(e,t,r),o=chunkGNEVCEJU_cjs.m.of(e.input);if(!s.headers["content-type"]){let n=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);n&&(s.headers["content-type"]=n);}return typeof s.body=="string"&&s.headers["content-type"]===this.getDefaultContentType()&&!s.body.startsWith("<?xml ")&&!this.hasUnstructuredPayloadBinding(o)&&(s.body='<?xml version="1.0" encoding="UTF-8"?>'+s.body),s}async deserializeResponse(e,t,r){return super.deserializeResponse(e,t,r)}async handleError(e,t,r,s,o){let n=Lt(r,s)??"Unknown";if(this.mixin.compose(this.compositeErrorRegistry,n,this.options.defaultNamespace),s.Error&&typeof s.Error=="object")for(let y of Object.keys(s.Error))s[y]=s.Error[y],y.toLowerCase()==="message"&&(s.message=s.Error[y]);s.RequestId&&!o.requestId&&(o.requestId=s.RequestId);let{errorSchema:a,errorMetadata:m}=await this.mixin.getErrorSchemaOrThrowBaseException(n,this.options.defaultNamespace,r,s,o),c=chunkGNEVCEJU_cjs.m.of(a),f=s.Error?.message??s.Error?.Message??s.message??s.Message??"UnknownError",l=this.compositeErrorRegistry.getErrorCtor(a)??Error,h=new l({});await this.deserializeHttpMessage(a,t,r,s);let u={},p=this.codec.createDeserializer();for(let[y,S]of c.structIterator()){let C=S.getMergedTraits().xmlName??y,N=s.Error?.[C]??s[C];u[y]=p.readSchema(S,N);}throw this.mixin.decorateServiceException(Object.assign(h,m,{$fault:c.getMergedTraits().error,message:f},u),s)}getDefaultContentType(){return "application/xml"}hasUnstructuredPayloadBinding(e){for(let[,t]of e.structIterator())if(t.getMergedTraits().httpPayload)return !(t.isStructSchema()||t.isMapSchema()||t.isListSchema());return false}};exports.a=K;exports.b=Xt;exports.c=He;exports.d=Le;exports.e=Be;exports.f=B;exports.g=ie;exports.h=nt;exports.i=at;exports.j=ct;exports.k=It;
@@ -1,20 +0,0 @@
1
- import {a,c,b,d}from'./chunk-SLMIYECU.js';import {a as a$1}from'./chunk-JA44K75G.js';import {g}from'./chunk-Y2YAKDEQ.js';import {createRequire}from'module';import {randomBytes}from'crypto';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g();g();g();function E(m){let t=[];for(let a of m)if(a.type==="tabs"&&"tabs"in a)for(let n of a.tabs)t.push(...E(n.fields));else a.type==="row"&&"fields"in a?t.push(...E(a.fields)):a.type==="collapsible"&&"fields"in a?t.push(...E(a.fields)):t.push(a);return t}function P(m,t){let a=t,n=m[a.name];if(a.type==="json"||a.type==="richtext"||a.type==="array"||a.type==="group"||a.type==="blocks"||a.type==="list"||a.type==="relationship-block")try{n=n?JSON.parse(n):null;}catch{n=null;}if(a.type==="checkbox"&&(n=!!n),a.type==="date"&&n)try{let i=new Date(n);isNaN(i.getTime())?n=null:n=i.toISOString();}catch{n=null;}if((a.type==="upload"||a.type==="image")&&n)try{let i=JSON.parse(n);Array.isArray(i)?n=i.map(o=>typeof o=="object"&&o!==null?o:{id:o}):n=typeof i=="object"?i:{id:i};}catch{n=typeof n=="string"?{id:n}:n;}return n}var R;function U(){return R||(R=createRequire("file:///")("node:sqlite").DatabaseSync,R)}function j(m,t){return Array.isArray(m)?m.map(a=>{if(!a||typeof a!="object")return a;let n=a.data?{...a.data}:void 0;if(!n)return a;let i=t.find(o=>o.slug===a.type||o.slug===a.slug);if(!i||!Array.isArray(i.fields))return a;for(let o of i.fields){if(o.name&&(o.type==="upload"||o.type==="image")&&n[o.name]){let e=n[o.name];Array.isArray(e)?n[o.name]=e.map(s=>typeof s=="string"?{id:s}:s):typeof e=="string"&&(n[o.name]={id:e});}if(o.type==="blocks"&&o.name&&n[o.name]){let e=o.blocks||[];n[o.name]=j(n[o.name],e);}}return {...a,data:n}}):m}function I(m,t){try{return m.prepare(`PRAGMA table_info(${t})`).all().map(n=>n.name)}catch{return []}}var L=class extends a{db;path;migrations=new Map;versionsTableName="kyro_versions";constructor(t){super(),this.path=t.path,t.db?this.db=t.db:this.db=null;}async connect(){if(!this.db)this.db=new(U())(this.path||":memory:");else try{this.db.exec("SELECT 1");}catch{this.db=new(U())(this.path||":memory:");}if(this.db&&typeof this.db.prepare=="function"&&!this.db.prepare.__wrapped){let t=this.db.prepare.bind(this.db),a=n=>{let i=t(n),o=e=>typeof e=="boolean"?e?1:0:e===void 0?null:e;return new Proxy(i,{get(e,s,r){if(s==="all")return (...c)=>e.all(...c.map(o));if(s==="get")return (...c)=>e.get(...c.map(o));if(s==="run")return (...c)=>e.run(...c.map(o));let l=Reflect.get(e,s,r);return typeof l=="function"?l.bind(e):l}})};a.__wrapped=true,this.db.prepare=a;}this.db.exec("PRAGMA journal_mode = WAL"),this.db.exec("PRAGMA foreign_keys = ON"),this.connected=true;}async disconnect(){if(this.db){try{this.db.close();}catch{}this.db=null;}this.connected=false;}ensureTable(t,a){let n=a||this.getTableNameFor(t.slug),i=["id TEXT PRIMARY KEY"];for(let s of E(t.fields)){if(!s.name||s.name==="id")continue;let r=this.fieldToSQL(s);r&&i.push(r);}let o=E(t.fields);o.some(s=>s.name==="createdAt")||i.push(`${this.col("createdAt")} TEXT DEFAULT (datetime('now'))`),o.some(s=>s.name==="updatedAt")||i.push(`${this.col("updatedAt")} TEXT DEFAULT (datetime('now'))`),o.some(s=>s.name==="status")||i.push("status TEXT DEFAULT 'draft'"),o.some(s=>s.name==="hasDraft")||i.push("hasDraft INTEGER DEFAULT 0"),t.tenantScoped&&i.push("tenant_id TEXT NOT NULL");let e=I(this.db,n);if(e.length===0){let s=`CREATE TABLE IF NOT EXISTS ${n} (${i.join(", ")})`;this.db.exec(s),this.db.exec(`CREATE INDEX IF NOT EXISTS idx_${n}_status ON ${n}(status)`);for(let r of E(t.fields))r.name&&r.indexed&&this.db.exec(`CREATE INDEX IF NOT EXISTS idx_${n}_${r.name} ON ${n}(${this.col(r.name)})`),r.name&&r.unique&&this.db.exec(`CREATE UNIQUE INDEX IF NOT EXISTS idx_${n}_${r.name}_unique ON ${n}(${this.col(r.name)})`);}else {let s=new Set(e);for(let r of i){let l=r.split(" ")[0].replace(/^"/,"").replace(/"$/,"");if(!s.has(l)&&l!=="id")try{l==="status"?this.db.exec(`ALTER TABLE ${n} ADD COLUMN ${this.col(l)} TEXT DEFAULT 'published'`):l==="hasDraft"?this.db.exec(`ALTER TABLE ${n} ADD COLUMN ${this.col(l)} INTEGER DEFAULT 0`):this.db.exec(`ALTER TABLE ${n} ADD COLUMN ${this.col(l)} TEXT`);}catch{}}}this.migrations.set(n,true);}ensureVersionsTable(){this.db.exec(`
3
- CREATE TABLE IF NOT EXISTS ${this.versionsTableName} (
4
- id TEXT PRIMARY KEY,
5
- collection_slug TEXT NOT NULL,
6
- document_id TEXT NOT NULL,
7
- tenant_id TEXT,
8
- version INTEGER NOT NULL,
9
- status TEXT NOT NULL DEFAULT 'draft',
10
- autosave INTEGER NOT NULL DEFAULT 0,
11
- data TEXT NOT NULL,
12
- created_by TEXT,
13
- change_description TEXT,
14
- published_at TEXT,
15
- created_at TEXT DEFAULT (datetime('now')),
16
- updated_at TEXT DEFAULT (datetime('now'))
17
- )
18
- `);try{this.db.exec(`ALTER TABLE ${this.versionsTableName} ADD COLUMN autosave INTEGER NOT NULL DEFAULT 0`);}catch{}this.db.exec(`CREATE INDEX IF NOT EXISTS idx_${this.versionsTableName}_doc ON ${this.versionsTableName}(collection_slug, document_id)`),this.db.exec(`CREATE INDEX IF NOT EXISTS idx_${this.versionsTableName}_status ON ${this.versionsTableName}(status)`),this.db.exec(`CREATE INDEX IF NOT EXISTS idx_${this.versionsTableName}_autosave ON ${this.versionsTableName}(autosave)`);}resolveCol(t,a){let n=a.replace(/^-/,""),i=I(this.db,t);if(!i.includes(n)){if(n==="created_at"&&i.includes("createdAt"))return '"createdAt"';if(n==="createdAt"&&i.includes("created_at"))return '"created_at"';if(n==="updated_at"&&i.includes("updatedAt"))return '"updatedAt"';if(n==="updatedAt"&&i.includes("updated_at"))return '"updated_at"'}return this.col(n)}col(t){return `"${t}"`}fieldToSQL(t){switch(t.type){case "text":case "email":case "password":case "textarea":case "color":case "icon":case "code":case "markdown":case "url":return this.col(t.name)+" TEXT";case "number":return this.col(t.name)+" REAL";case "checkbox":return this.col(t.name)+" INTEGER DEFAULT 0";case "date":return this.col(t.name)+" TEXT";case "select":case "radio":return this.col(t.name)+" TEXT";case "relationship":case "upload":return this.col(t.name)+" TEXT";case "json":case "richtext":case "array":case "group":case "blocks":return this.col(t.name)+" TEXT";default:return null}}parseGlobalsSlug(t){if(t.startsWith("_globals_")){let a=t.replace("_globals_","");return {isGlobal:true,globalSlug:a,tableName:`global_${a.replace(/-/g,"_")}`}}return {isGlobal:false,globalSlug:"",tableName:this.getTableNameFor(t)}}buildWhere(t,a){let n=[],i=[];for(let[o,e]of Object.entries(t)){let s=o.toUpperCase();if((s==="AND"||s==="OR")&&Array.isArray(e)){let l=[];for(let c of e)if(typeof c=="object"&&c!==null){let d=this.buildWhere(c,a);d.clause&&(l.push(`(${d.clause})`),i.push(...d.params));}l.length>0&&n.push(`(${l.join(` ${s} `)})`);continue}let r=this.resolveCol(a,o);typeof e=="object"&&e!==null&&!Array.isArray(e)?(e.equals!==void 0&&(n.push(`${r} = ?`),i.push(e.equals)),e.not_equals!==void 0&&(n.push(`${r} != ?`),i.push(e.not_equals)),e.in!==void 0&&Array.isArray(e.in)&&(e.in.length===0?n.push("1 = 0"):(n.push(`${r} IN (${e.in.map(()=>"?").join(", ")})`),i.push(...e.in))),e.contains!==void 0&&(n.push(`LOWER(${r}) LIKE LOWER(?)`),i.push(`%${e.contains}%`)),e.like!==void 0&&(n.push(`LOWER(${r}) LIKE LOWER(?)`),i.push(e.like)),e.greater_than!==void 0&&(n.push(`${r} > ?`),i.push(e.greater_than)),e.greater_than_equal!==void 0&&(n.push(`${r} >= ?`),i.push(e.greater_than_equal)),e.less_than!==void 0&&(n.push(`${r} < ?`),i.push(e.less_than)),e.less_than_equal!==void 0&&(n.push(`${r} <= ?`),i.push(e.less_than_equal))):e!==void 0&&(n.push(`${r} = ?`),i.push(e));}return {clause:n.join(" AND "),params:i}}async find(t){let{collection:a,where:n={},sort:i,limit:o=10,page:e=1,tenantId:s,select:r,draft:l=false}=t,c$1=this.parseGlobalsSlug(a),d$1=c$1.isGlobal?this.globals.get(c$1.globalSlug):this.getCollection(a);this.ensureTable(d$1,c$1.tableName);let y=c$1.tableName,h=`SELECT * FROM ${y}`,f=[],u=[],g={...n};this.tenantContext&&d$1.tenantScoped&&(g=c({where:g},a,this.tenantContext,b).where||{});let b$1=d$1.fields.find(p=>p.name==="status"),T=b$1?.type==="select"&&Array.isArray(b$1.options)&&b$1.options.some(p=>p.value==="published");if(!l&&T&&(u.push("status = ?"),f.push("published")),s&&d$1.tenantScoped&&(u.push("tenant_id = ?"),f.push(s)),g&&Object.keys(g).length>0){let p=this.buildWhere(g,y);p.clause&&(u.push(`(${p.clause})`),f.push(...p.params));}u.length>0&&(h+=` WHERE ${u.join(" AND ")}`);let $=i||"-createdAt",M=this.resolveCol(y,$),V=$.startsWith("-")?"DESC":"ASC";h+=` ORDER BY ${M} ${V}`;let X=h.replace("SELECT *","SELECT COUNT(*) as count"),S=this.db.prepare(X).get(...f)?.count||0;h+=" LIMIT ? OFFSET ?",f.push(o,(e-1)*o);let N=this.db.prepare(h).all(...f).map(p=>this.rowToDoc(p,d$1));return this.tenantContext&&!this.tenantContext.isSuperAdmin&&(N=N.filter(p=>d(p,a,this.tenantContext,b))),l&&(N=await Promise.all(N.map(async p=>{let D=this.db.prepare(`SELECT * FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? AND tenant_id IS NULL ORDER BY version DESC LIMIT 1`).get(a,p.id);if(D){let G=D.data?JSON.parse(D.data):{};return a$1({...p,...G,status:p.status,_hasUnpublishedChanges:D.status==="draft"})}return p}))),N=N.map(p=>a$1(p)),{docs:N,totalDocs:S,limit:o,totalPages:Math.ceil(S/o),page:e,pagingCounter:(e-1)*o+1,hasPrevPage:e>1,hasNextPage:e<Math.ceil(S/o),prevPage:e>1?e-1:null,nextPage:e<Math.ceil(S/o)?e+1:null}}async findByID(t){let{collection:a,id:n,tenantId:i,draft:o=false}=t,e=this.parseGlobalsSlug(a),s=e.isGlobal?this.globals.get(e.globalSlug):this.getCollection(a);this.ensureTable(s,e.tableName);let l=`SELECT * FROM ${e.tableName} WHERE id = ?`,c=[n];if(this.tenantContext&&s.tenantScoped){let u={id:n,tenant_id:this.tenantContext.tenantId};if(!d(u,a,this.tenantContext,b))return null}let d$1=s.fields.find(u=>u.name==="status"),y=d$1?.type==="select"&&Array.isArray(d$1.options)&&d$1.options.some(u=>u.value==="published");!o&&y&&(l+=" AND status = ?",c.push("published")),i&&s.tenantScoped&&(l+=" AND tenant_id = ?",c.push(i));let h=this.db.prepare(l).get(...c);if(!h)return null;let f=this.rowToDoc(h,s);if(o){let u=this.db.prepare(`SELECT * FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? AND tenant_id IS NULL ORDER BY version DESC LIMIT 1`).get(a,f.id);if(u){let g=u.data?JSON.parse(u.data):{};f={...f,...g,status:f.status,_hasUnpublishedChanges:u.status==="draft"};}}return a$1(f)}async create(t){let{collection:a,data:n,tenantId:i}=t,o=this.parseGlobalsSlug(a),e=o.isGlobal?this.globals.get(o.globalSlug):this.getCollection(a);this.ensureTable(e,o.tableName);let s=o.tableName,r=o.isGlobal?o.globalSlug:n.id||this.generateId(),l=this.prepareData(n,e);l.id=r;let c=new Date().toISOString();l.created_at=c,l.updated_at=c,i&&e.tenantScoped&&(l.tenant_id=i);let d=Object.keys(l),y=I(this.db,s),h={};for(let T of d)y.includes(T)&&(h[T]=l[T]);let f=Object.keys(h),u=f.map(T=>this.col(T)),g=f.map(()=>"?").join(", "),b=Object.values(h).map(T=>T!==null&&typeof T=="object"?JSON.stringify(T):T);return this.db.prepare(`INSERT OR REPLACE INTO ${s} (${u.join(", ")}) VALUES (${g})`).run(...b),this.ensureVersionsTable(),this.findByID({collection:a,id:r,tenantId:i,draft:true})}async update(t){let{collection:a,id:n,data:i,tenantId:o}=t,e=this.parseGlobalsSlug(a),s=e.isGlobal?this.globals.get(e.globalSlug):this.getCollection(a);this.ensureTable(s,e.tableName);let r=e.tableName,l=this.prepareData(i,s);l.updated_at=new Date().toISOString();let c=I(this.db,r),d={};for(let b of Object.keys(l))c.includes(b)&&(d[b]=l[b]);let h=Object.keys(d).map(b=>`${this.col(b)} = ?`).join(", "),f=Object.values(d).map(b=>b!==null&&typeof b=="object"?JSON.stringify(b):b),u=`UPDATE ${r} SET ${h} WHERE id = ?`,g=[...f,n];return o&&s.tenantScoped&&(u+=" AND tenant_id = ?",g.push(o)),this.db.prepare(u).run(...g),this.ensureVersionsTable(),this.findByID({collection:a,id:n,tenantId:o,draft:true})}async delete(t){let{collection:a,id:n,tenantId:i}=t,o=this.parseGlobalsSlug(a),e=o.isGlobal?this.globals.get(o.globalSlug):this.getCollection(a);this.ensureTable(e,o.tableName),this.ensureVersionsTable();let s=await this.findByID({collection:a,id:n,tenantId:i,draft:true});if(!s)throw new Error(`Document not found: ${a}/${n}`);let l=`DELETE FROM ${o.tableName} WHERE id = ?`,c=[n];return i&&e.tenantScoped&&(l+=" AND tenant_id = ?",c.push(i)),this.db.prepare(l).run(...c),s}async count(t){let{collection:a,tenantId:n}=t,i=this.parseGlobalsSlug(a),o=i.isGlobal?this.globals.get(i.globalSlug):this.getCollection(a);this.ensureTable(o,i.tableName);let e=i.tableName,s=`SELECT COUNT(*) as count FROM ${e}`,r=[],l=[];if(n&&o.tenantScoped&&(r.push("tenant_id = ?"),l.push(n)),t.where&&Object.keys(t.where).length>0){let d=this.buildWhere(t.where,e);d.clause&&(r.push(`(${d.clause})`),l.push(...d.params));}return r.length>0&&(s+=` WHERE ${r.join(" AND ")}`),this.db.prepare(s).get(...l)?.count||0}async findOne(t){let a=this.parseGlobalsSlug(t.collection);if(a.isGlobal){let i=this.globals.get(a.globalSlug);if(!i)throw new Error(`Global "${a.globalSlug}" not found in adapter`);this.ensureTable(i,a.tableName);let o=`SELECT * FROM ${a.tableName}`,e=[],s=[],r=i.fields.find(d=>d.name==="status"),l=r?.type==="select"&&Array.isArray(r.options)&&r.options.some(d=>d.value==="published");!t.draft&&i.versions&&l&&e.push("status = 'published'"),e.length>0&&(o+=` WHERE ${e.join(" AND ")}`),o+=" LIMIT 1";let c=this.db.prepare(o).get(...s);if(c){let d=this.rowToDoc(c,i);if(t.draft){let y=this.db.prepare(`SELECT * FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? AND tenant_id IS NULL ORDER BY version DESC LIMIT 1`).get(t.collection,a.globalSlug);if(y){let h=y.data?JSON.parse(y.data):{};d={...d,...h,status:d.status,_hasUnpublishedChanges:y.status==="draft"};}}return d}return null}return (await this.find({...t,limit:1})).docs[0]||null}async findVersions(t){this.ensureVersionsTable();let{collection:a,documentId:n,tenantId:i,limit:o=20,page:e=1}=t,s=["collection_slug = ?","document_id = ?","autosave = 0"],r=[a,n];i?(s.push("tenant_id = ?"),r.push(i)):s.push("tenant_id IS NULL");let l=`WHERE ${s.join(" AND ")}`,d=this.db.prepare(`SELECT COUNT(*) as count FROM ${this.versionsTableName} ${l}`).get(...r)?.count||0,y=(e-1)*o;return {docs:this.db.prepare(`SELECT * FROM ${this.versionsTableName} ${l} ORDER BY version DESC LIMIT ? OFFSET ?`).all(...r,o,y).map(u=>this.rowToVersion(u)),totalDocs:d,limit:o,totalPages:Math.ceil(d/o),page:e,pagingCounter:(e-1)*o+1,hasPrevPage:e>1,hasNextPage:e<Math.ceil(d/o),prevPage:e>1?e-1:null,nextPage:e<Math.ceil(d/o)?e+1:null}}async findVersionByID(t){this.ensureVersionsTable();let a=this.db.prepare(`SELECT * FROM ${this.versionsTableName} WHERE id = ? AND collection_slug = ? LIMIT 1`).get(t.versionId,t.collection);return a?this.rowToVersion(a):null}async createVersion(t){this.ensureVersionsTable();let a=new Date().toISOString();if(t.autosave){let s=`SELECT * FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? AND autosave = 1`,r=[t.collection,t.documentId];t.tenantId?(s+=" AND tenant_id = ?",r.push(t.tenantId)):s+=" AND tenant_id IS NULL",s+=" LIMIT 1";let l=this.db.prepare(s).get(...r);if(l){this.db.prepare(`UPDATE ${this.versionsTableName} SET data = ?, status = ?, updated_at = ? WHERE id = ?`).run(JSON.stringify(t.data),t.status,a,l.id);let c=await this.findVersionByID({collection:t.collection,versionId:l.id});if(c)return c}}let n=this.generateId(),o=(this.db.prepare(`SELECT version FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? AND autosave = 0 ORDER BY version DESC LIMIT 1`).get(t.collection,t.documentId)?.version??0)+1;if(this.db.prepare(`INSERT INTO ${this.versionsTableName} (
19
- id, collection_slug, document_id, tenant_id, version, status, autosave, data, created_by, change_description, published_at, created_at, updated_at
20
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(n,t.collection,t.documentId,t.tenantId??null,o,t.status,t.autosave?1:0,JSON.stringify(t.data),t.createdBy??null,t.changeDescription??null,t.status==="published"?a:null,a,a),!t.autosave){let r=this.collections.get(t.collection)?.versions?.maxPerDoc;r&&r>0&&await this.deleteVersions({collection:t.collection,documentId:t.documentId,keepLatest:r,tenantId:t.tenantId});}return await this.findVersionByID({collection:t.collection,versionId:n})}async updateLatestVersion(t){return this.createVersion({...t,autosave:true})}async deleteVersions(t){this.ensureVersionsTable();let{collection:a,documentId:n,keepLatest:i,tenantId:o}=t;if(i&&i>0){let e=this.db.prepare(`SELECT id, status, autosave FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? ORDER BY version DESC`).all(a,n),s=0,r=[];for(let l of e)l.status==="published"||l.autosave===1||(s++,s>i&&r.push(l.id));for(let l of r)this.db.prepare(`DELETE FROM ${this.versionsTableName} WHERE id = ?`).run(l);}else {let e=`DELETE FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ?`,s=[a,n];o&&(e+=" AND tenant_id = ?",s.push(o)),this.db.prepare(e).run(...s);}}rowToVersion(t){return {id:String(t.id),collection:t.collection_slug,documentId:t.document_id,version:t.version,status:t.status,data:t.data?JSON.parse(t.data):{},createdBy:t.created_by??void 0,changeDescription:t.change_description??void 0,publishedAt:t.published_at??null,createdAt:t.created_at,updatedAt:t.updated_at}}prepareData(t,a){let n={},i=E(a.fields),o=(e,s)=>{let r=e;if(r.type==="json"||r.type==="richtext"||r.type==="array"||r.type==="group"||r.type==="blocks"||r.type==="list"||r.type==="relationship-block")return s!=null?JSON.stringify(s):null;if(r.type==="checkbox")return s?1:0;if(r.type==="number")return s!==null&&s!==""?Number(s):null;if(r.type==="upload"||r.type==="image"){if(s==null)return null;if(Array.isArray(s)){let l=s.map(c=>typeof c=="string"?c:typeof c=="object"?c.id||c._id||c:String(c));return JSON.stringify(l)}return typeof s=="string"?s:typeof s=="object"?JSON.stringify(s):String(s)}else if(e.type==="relationship"){if(s==null)return null;if(Array.isArray(s)){let l=s.map(c=>typeof c=="string"?c:typeof c=="object"?JSON.stringify({relationTo:e.relationTo,value:c.id||c}):String(c));return JSON.stringify(l)}return typeof s=="string"?s:typeof s=="object"?JSON.stringify({relationTo:e.relationTo,value:s.id||s}):String(s)}return s};for(let e of i){if(!e.name||e.name==="id"||a.fields.some(l=>l.type==="tabs"&&l.name&&"tabs"in l&&l.tabs.some(c=>c.fields.some(d=>d.name===e.name))))continue;let r=t[e.name];r!==void 0&&(n[e.name]=o(e,r));}for(let e of a.fields)if(e.type==="tabs"&&"tabs"in e&&e.name){let s=t[e.name];if(s&&typeof s=="object"){for(let r of e.tabs)for(let l of r.fields)if(l.name&&l.name!=="id"){let c=s[l.name];c!==void 0&&(n[l.name]=o(l,c));}}}return n}rowToDoc(t,a){let n={id:t.id};for(let i of E(a.fields)){if(!i.name||i.name==="id")continue;let o=i,e=t[o.name];if(o.type==="json"||o.type==="richtext"||o.type==="array"||o.type==="group"||o.type==="blocks"||o.type==="list"||o.type==="relationship-block")try{e=e?JSON.parse(e):null;}catch{e=null;}if(o.type==="blocks"&&e&&Array.isArray(e)){let s=o.blocks||[];e=j(e,s);}if(i.type==="checkbox"&&(e=!!e),i.type==="date"&&e)try{let s=new Date(e);isNaN(s.getTime())?(console.warn(`[LocalAdapter] Invalid date value for field "${i.name}":`,e),e=null):e=s.toISOString();}catch{e=null;}if((i.type==="upload"||i.type==="image")&&e)try{let s=JSON.parse(e);Array.isArray(s)?e=s.map(r=>typeof r=="object"&&r!==null?r:{id:r}):e=typeof s=="object"?s:{id:s};}catch{e={id:e};}if(i.type==="relationship"&&e)try{let s=JSON.parse(e);Array.isArray(s),e=s;}catch{e={relationTo:Array.isArray(i.relationTo)?i.relationTo[0]:i.relationTo,value:e};}n[i.name]=e;}for(let i of a.fields)if(!(!i.name||i.name==="id"||i.name==="row"||i.name==="collapsible")&&i.type==="tabs"&&"tabs"in i){let o={};for(let e of i.tabs)for(let s of e.fields)s.name&&s.name!=="id"&&(o[s.name]=P(t,s));n[i.name]=o;}if(a.timestamps){let i=t.createdAt||t.created_at,o=t.updatedAt||t.updated_at;if(i)try{let e=new Date(i);isNaN(e.getTime())||(n.createdAt=e.toISOString());}catch{}if(o)try{let e=new Date(o);isNaN(e.getTime())||(n.updatedAt=e.toISOString());}catch{}}a.tenantScoped&&(n.tenantId=t.tenant_id),n.status=t.status??"published",n.hasDraft=t.hasDraft?!!t.hasDraft:false;for(let i of Object.keys(n))/^\d+$/.test(i)&&delete n[i];return n}generateId(){let t=Date.now().toString(16).padStart(12,"0"),a=randomBytes(6).toString("hex");return t+a}getMediaById(t){try{let a=this.getTableNameFor("media"),n=this.db.prepare(`SELECT id, url, thumbnail_url FROM ${a} WHERE id = ?`).get(t);if(n)return {id:n.id,url:n.url,thumbnailUrl:n.thumbnail_url||n.url}}catch{}return null}getTableNameFor(t){return t.replace(/-/g,"_")}async migrate(){for(let t of this.collections.values())this.ensureTable(t);}async rollback(){}async transaction(t){return new Promise((a,n)=>{let i=this.db.transaction(async()=>t({db:this.db}));try{let o=i();a(o);}catch(o){n(o);}})}getDatabase(){return this.db}exec(t){this.db.exec(t);}prepare(t){return this.db.prepare(t)}};function W(m){return new L(m||{})}export{L as a,W as b};